eurostat-map 4.3.42 → 4.3.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/eurostatmap.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! /*! eurostat-map v4.3.
|
|
1
|
+
/*! /*! eurostat-map v4.3.44 | 2026 Eurostat | EUPL License. See https://github.com/eurostat/eurostat-map/blob/master/LICENSE * / */
|
|
2
2
|
!function webpackUniversalModuleDefinition(c,h){"object"==typeof exports&&"object"==typeof module?module.exports=h():"function"==typeof define&&define.amd?define([],h):"object"==typeof exports?exports.eurostatmap=h():c.eurostatmap=h()}(self,()=>(()=>{var c={358(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,".em-minimap-outer-circle {\n filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.3))\n drop-shadow(0 0 12px rgba(0, 0, 0, 0.15));\n opacity:0.5\n}\n\n.em-minimap-inner-circle {\n\n}\n","",{version:3,sources:["webpack://./src/css/minimap.css"],names:[],mappings:"AAAA;MACM;mDAC6C;MAC7C;AACN;;AAEA;;AAEA",sourcesContent:[".em-minimap-outer-circle {\r\n filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.3))\r\n drop-shadow(0 0 12px rgba(0, 0, 0, 0.15));\r\n opacity:0.5\r\n}\r\n\r\n.em-minimap-inner-circle {\r\n\r\n}\r\n"],sourceRoot:""}]);const M=S},540(c){"use strict";c.exports=function insertStyleElement(c){var h=document.createElement("style");return c.setAttributes(h,c.attributes),c.insert(h,c.options),h}},579(c,h,g){var m=g(3738).default;c.exports=function _regeneratorValues(c){if(null!=c){var h=c["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],g=0;if(h)return h.call(c);if("function"==typeof c.next)return c;if(!isNaN(c.length))return{next:function next(){return c&&g>=c.length&&(c=void 0),{value:c&&c[g++],done:!c}}}}throw new TypeError(m(c)+" is not iterable")},c.exports.__esModule=!0,c.exports.default=c.exports},654(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,".em-cntbn,\n.em-cntbn-halo,\n.em-kosovo-bn,\n.em-bn-co {\n stroke-linecap: round;\n stroke-linejoin: round;\n fill: none;\n pointer-events: none;\n}\n\n/* coastal boundaries */\n.em-bn-co {\n stroke: white;\n}\n\n/* kosovo */\n.em-kosovo-bn {\n stroke: #3f3f3f;\n stroke-width: 0.15;\n stroke-opacity: 0.8;\n}\n\n/* country boundaries */\n.em-cntbn {\n stroke: #3f3f3f;\n stroke-width: 1px;\n stroke-opacity: 0.8;\n}\n\n/* country boundary halo (not coastline) */\n.em-cntbn-halo:not(.em-bn-co) {\n stroke: white;\n stroke-width: 3px;\n stroke-opacity: 0.4;\n}\n\n/* Hide non-nuts borders (country boundaries > that are 'other' and not coastal, not candidates, not eu and not efta) */\n/* g#em-cntbn > .em-bn-oth:not(.em-bn-co):not(.em-bn-cc):not(.em-bn-eu):not(.em-bn-efta) {\n stroke-width: 0px;\n} */\n","",{version:3,sources:["webpack://./src/css/borders.css"],names:[],mappings:"AAAA;;;;IAII,qBAAqB;IACrB,sBAAsB;IACtB,UAAU;IACV,oBAAoB;AACxB;;AAEA,uBAAuB;AACvB;IACI,aAAa;AACjB;;AAEA,WAAW;AACX;IACI,eAAe;IACf,kBAAkB;IAClB,mBAAmB;AACvB;;AAEA,uBAAuB;AACvB;IACI,eAAe;IACf,iBAAiB;IACjB,mBAAmB;AACvB;;AAEA,0CAA0C;AAC1C;IACI,aAAa;IACb,iBAAiB;IACjB,mBAAmB;AACvB;;AAEA,uHAAuH;AACvH;;GAEG",sourcesContent:[".em-cntbn,\r\n.em-cntbn-halo,\r\n.em-kosovo-bn,\r\n.em-bn-co {\r\n stroke-linecap: round;\r\n stroke-linejoin: round;\r\n fill: none;\r\n pointer-events: none;\r\n}\r\n\r\n/* coastal boundaries */\r\n.em-bn-co {\r\n stroke: white;\r\n}\r\n\r\n/* kosovo */\r\n.em-kosovo-bn {\r\n stroke: #3f3f3f;\r\n stroke-width: 0.15;\r\n stroke-opacity: 0.8;\r\n}\r\n\r\n/* country boundaries */\r\n.em-cntbn {\r\n stroke: #3f3f3f;\r\n stroke-width: 1px;\r\n stroke-opacity: 0.8;\r\n}\r\n\r\n/* country boundary halo (not coastline) */\r\n.em-cntbn-halo:not(.em-bn-co) {\r\n stroke: white;\r\n stroke-width: 3px;\r\n stroke-opacity: 0.4;\r\n}\r\n\r\n/* Hide non-nuts borders (country boundaries > that are 'other' and not coastal, not candidates, not eu and not efta) */\r\n/* g#em-cntbn > .em-bn-oth:not(.em-bn-co):not(.em-bn-cc):not(.em-bn-eu):not(.em-bn-efta) {\r\n stroke-width: 0px;\r\n} */\r\n"],sourceRoot:""}]);const M=S},765(c,h,g){"use strict";g.d(h,{A:()=>T});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w),M=g(5144),k=S()(b());k.i(M.A),k.push([c.id,".em-button {\n width: 35px;\n height: 35px;\n user-select: none;\n cursor: pointer;\n}\n\n.em-button rect {\n fill: white;\n stroke: #ccc;\n}\n\n.em-button rect:hover {\n fill: lightgrey;\n}\n\n.em-button text {\n text-anchor: middle;\n font-size: 20px;\n fill: #333333;\n}\n\n/* zoom */\n/* .em-zoom-buttons {\n transform: translate(94%, 10%);\n} */\n\n/* insets */\n/* .em-insets-button {\n transform: translate(94%, 2%);\n} */\n\n.em-logo-group {\n pointer-events: none;\n}\n","",{version:3,sources:["webpack://./src/css/ui.css"],names:[],mappings:"AACA;IACI,WAAW;IACX,YAAY;IACZ,iBAAiB;IACjB,eAAe;AACnB;;AAEA;IACI,WAAW;IACX,YAAY;AAChB;;AAEA;IACI,eAAe;AACnB;;AAEA;IACI,mBAAmB;IACnB,eAAe;IACf,aAAa;AACjB;;AAEA,UAAU;AACV;;GAEG;;AAEH,WAAW;AACX;;GAEG;;AAEH;IACI,oBAAoB;AACxB",sourcesContent:["@import 'spinner.css';\r\n.em-button {\r\n width: 35px;\r\n height: 35px;\r\n user-select: none;\r\n cursor: pointer;\r\n}\r\n\r\n.em-button rect {\r\n fill: white;\r\n stroke: #ccc;\r\n}\r\n\r\n.em-button rect:hover {\r\n fill: lightgrey;\r\n}\r\n\r\n.em-button text {\r\n text-anchor: middle;\r\n font-size: 20px;\r\n fill: #333333;\r\n}\r\n\r\n/* zoom */\r\n/* .em-zoom-buttons {\r\n transform: translate(94%, 10%);\r\n} */\r\n\r\n/* insets */\r\n/* .em-insets-button {\r\n transform: translate(94%, 2%);\r\n} */\r\n\r\n.em-logo-group {\r\n pointer-events: none;\r\n}\r\n"],sourceRoot:""}]);const T=k},781(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,".em-cntrg {\n fill: #e1e1e1;\n cursor: pointer !important;\n}\n","",{version:3,sources:["webpack://./src/css/countries.css"],names:[],mappings:"AAAA;IACI,aAAa;IACb,0BAA0B;AAC9B",sourcesContent:[".em-cntrg {\r\n fill: #e1e1e1;\r\n cursor: pointer !important;\r\n}\r\n"],sourceRoot:""}]);const M=S},825(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,".em-flow-width-horizontal-label {\n text-anchor: middle;\n font-size: 13px;\n /* fill: #3a3a3a */\n}","",{version:3,sources:["webpack://./src/css/legend/flow.css"],names:[],mappings:"AAAA;IACI,mBAAmB;IACnB,eAAe;IACf,kBAAkB;AACtB",sourcesContent:[".em-flow-width-horizontal-label {\r\n text-anchor: middle;\r\n font-size: 13px;\r\n /* fill: #3a3a3a */\r\n}"],sourceRoot:""}]);const M=S},887(c,h,g){var m=g(6993),b=g(1791);c.exports=function _regeneratorAsyncGen(c,h,g,w,S){return new b(m().w(c,h,g,w),S||Promise)},c.exports.__esModule=!0,c.exports.default=c.exports},924(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,".em-coxcomb-legend-time-label {\nfont-size: 13px;\n}\n.em-coxcomb-legend-time-segment {\n stroke: #444;\n stroke-width: 0.5;\n opacity: 0.4;\n fill: #ccc;\n cursor: pointer;\n}\n.em-coxcomb-legend-time-segment {\n stroke: #444;\n stroke-width: 0.5;\n opacity: 0.4;\n fill: #ccc;\n cursor: pointer;\n}","",{version:3,sources:["webpack://./src/css/legend/coxcomb.css"],names:[],mappings:"AAAA;AACA,eAAe;AACf;AACA;IACI,YAAY;IACZ,iBAAiB;IACjB,YAAY;IACZ,UAAU;IACV,eAAe;AACnB;AACA;QACQ,YAAY;IAChB,iBAAiB;IACjB,YAAY;IACZ,UAAU;IACV,eAAe;AACnB",sourcesContent:[".em-coxcomb-legend-time-label {\r\nfont-size: 13px;\r\n}\r\n.em-coxcomb-legend-time-segment {\r\n stroke: #444;\r\n stroke-width: 0.5;\r\n opacity: 0.4;\r\n fill: #ccc;\r\n cursor: pointer;\r\n}\r\n.em-coxcomb-legend-time-segment {\r\n stroke: #444;\r\n stroke-width: 0.5;\r\n opacity: 0.4;\r\n fill: #ccc;\r\n cursor: pointer;\r\n}"],sourceRoot:""}]);const M=S},1113(c){"use strict";c.exports=function styleTagTransform(c,h){if(h.styleSheet)h.styleSheet.cssText=c;else{for(;h.firstChild;)h.removeChild(h.firstChild);h.appendChild(document.createTextNode(c))}}},1354(c){"use strict";c.exports=function(c){var h=c[1],g=c[3];if(!g)return h;if("function"==typeof btoa){var m=btoa(unescape(encodeURIComponent(JSON.stringify(g)))),b="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(m),w="/*# ".concat(b," */");return[h].concat([w]).join("\n")}return[h].join("\n")}},1477(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,".em-bivariate-nodata-label {\n font-size: 14px;\n dominant-baseline: middle;\n}\n.em-bivariate-tick-label {\n text-anchor: middle;\n font-size: 12px;\n}\n.em-bivariate-axis-title {\n font-size: 15px;\n}\n.em-bivariate-tick {\n stroke: #696969;\n stroke-width: 1;\n}\n.em-bivariate-frame {\n fill: none;\n stroke: #696969;\n}\n.em-bivariate-nodata {\n stroke: #696969;\n stroke-width: 0.5;\n cursor: pointer;\n}","",{version:3,sources:["webpack://./src/css/legend/bivariate-choropleth.css"],names:[],mappings:"AAAA;IACI,eAAe;IACf,yBAAyB;AAC7B;AACA;IACI,mBAAmB;IACnB,eAAe;AACnB;AACA;IACI,eAAe;AACnB;AACA;IACI,eAAe;IACf,eAAe;AACnB;AACA;IACI,UAAU;IACV,eAAe;AACnB;AACA;IACI,eAAe;IACf,iBAAiB;IACjB,eAAe;AACnB",sourcesContent:[".em-bivariate-nodata-label {\r\n font-size: 14px;\r\n dominant-baseline: middle;\r\n}\r\n.em-bivariate-tick-label {\r\n text-anchor: middle;\r\n font-size: 12px;\r\n}\r\n.em-bivariate-axis-title {\r\n font-size: 15px;\r\n}\r\n.em-bivariate-tick {\r\n stroke: #696969;\r\n stroke-width: 1;\r\n}\r\n.em-bivariate-frame {\r\n fill: none;\r\n stroke: #696969;\r\n}\r\n.em-bivariate-nodata {\r\n stroke: #696969;\r\n stroke-width: 0.5;\r\n cursor: pointer;\r\n}"],sourceRoot:""}]);const M=S},1791(c,h,g){var m=g(5172),b=g(5546);c.exports=function AsyncIterator(c,h){function n(g,b,w,S){try{var M=c[g](b),k=M.value;return k instanceof m?h.resolve(k.v).then(function(c){n("next",c,w,S)},function(c){n("throw",c,w,S)}):h.resolve(k).then(function(c){M.value=c,w(M)},function(c){return n("throw",c,w,S)})}catch(c){S(c)}}var g;this.next||(b(AsyncIterator.prototype),b(AsyncIterator.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),b(this,"_invoke",function(c,m,b){function f(){return new h(function(h,g){n(c,b,h,g)})}return g=g?g.then(f,f):f()},!0)},c.exports.__esModule=!0,c.exports.default=c.exports},2275(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,".em-legend-label.em-spike-legend-label {\n font-size:12px;\n}","",{version:3,sources:["webpack://./src/css/legend/spike.css"],names:[],mappings:"AAAA;IACI,cAAc;AAClB",sourcesContent:[".em-legend-label.em-spike-legend-label {\r\n font-size:12px;\r\n}"],sourceRoot:""}]);const M=S},2476(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,".em-placename {\n text-anchor: start;\n}\n\n.em-placename-halo {\n text-anchor: start;\n fill:none;\n stroke: white;\n opacity:0.8;\n stroke-linejoin: round;\n}","",{version:3,sources:["webpack://./src/css/placenames.css"],names:[],mappings:"AAAA;IACI,kBAAkB;AACtB;;AAEA;IACI,kBAAkB;IAClB,SAAS;IACT,aAAa;IACb,WAAW;IACX,sBAAsB;AAC1B",sourcesContent:[".em-placename {\r\n text-anchor: start;\r\n}\r\n\r\n.em-placename-halo {\r\n text-anchor: start;\r\n fill:none;\r\n stroke: white;\r\n opacity:0.8;\r\n stroke-linejoin: round;\r\n}"],sourceRoot:""}]);const M=S},2489(c,h,g){"use strict";g.d(h,{A:()=>z});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w),M=g(5262),k=g(4429),T=g(4768),E=g(3006),I=g(3774),P=g(7549),L=g(9971),B=S()(b());B.i(M.A),B.i(k.A),B.i(T.A),B.i(E.A),B.i(I.A),B.i(P.A),B.i(L.A),B.push([c.id,"/* wrapper DOM */\n.em-map-wrapper {\n position: relative;\n display: inline-block;\n}\n\n.em-map-wrapper > svg {\n display: block;\n}\n\n/* General text settings */\ntext {\n pointer-events: none;\n font-family: Arial, Helvetica, sans-serif;\n}\n\na text {\n pointer-events: all;\n}\n\n/* Main map */\n.em-map text,\n.em-legend text,\n.em-title,\n.em-subtitle,\n.em-footnote {\n font-family: Arial, Helvetica, sans-serif;\n}\n\n.em-map.em-draggable g {\n cursor: grab;\n}\n\n.em-map.em-dragging g {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n/* Coastal margin */\n.em-coastal-margin {\n filter: url(#em-coastal-blur);\n stroke-linejoin: round;\n stroke-linecap: round;\n fill: none;\n stroke-width: 1;\n stroke: rgb(0, 52, 107);\n}\n\n/* Title and subtitle styling */\n.em-title,\n.em-inset-title {\n fill: #4c4b4b;\n stroke: none;\n}\n\n.em-title {\n font-size: 21px;\n font-weight: bold;\n}\n\n.em-subtitle,\n.em-inset-subtitle {\n fill: #4c4b4b;\n fill-opacity: 0.9;\n stroke: none;\n stroke-linejoin: round;\n paint-order: stroke;\n}\n\n.em-subtitle {\n font-size: 18px;\n font-weight: 100;\n}\n\n.em-source-pretext {\n fill: #848280;\n font-size: 11px;\n transform: translate(-5px, -5px);\n}\n\n.em-source-dataset-link {\n font-size: 11px;\n fill: #0e47cb;\n cursor: pointer !important;\n text-decoration: underline;\n transform: translate(-5px, -5px);\n}\n\n.em-source-dataset-link:hover {\n fill: #082b7a;\n cursor: pointer !important;\n text-decoration: underline;\n}\n\n.em-frame {\n stroke-width: 0;\n stroke: grey;\n}\n\n/* Graticule styling */\n.em-graticule {\n stroke: lightgray;\n stroke-width: 1;\n}\n.em-frame,\n.em-graticule {\n fill: none;\n pointer-events: none;\n}\n\n.em-sea {\n fill: white;\n /* pointer-events: none; */\n}\n\n.em-scalebar-line {\n stroke: #696969;\n stroke-width: 0.8px;\n}\n\n.em-scalebar-label {\n font-size: 9px;\n text-anchor: middle;\n}\n\n/* Bottom text and symbol styling */\n.em-footnote {\n fill: #848280;\n pointer-events: all;\n cursor: pointer !important;\n font-size: 11px;\n transform: translate(5px, -5px);\n}\n\n.em-footnote a {\n fill: #0e47cb;\n text-decoration: underline;\n}\n\n.em-footnote a:hover {\n fill: #0a328e;\n}\n\n.em-centroid,\n.em-coxcomb g {\n cursor: pointer !important;\n}\n\n.em-flow-link {\n cursor: pointer !important;\n}\n\n.em-flow-link-outline {\n cursor: pointer !important;\n}\n\n.em-flow-labels {\n font-size: 15px;\n stroke-width: 1px;\n fill: #696969;\n pointer-events: none;\n}\n\n.em-flow-labels-halo {\n font-size: 15px;\n stroke-width: 2px;\n fill: white;\n pointer-events: none;\n}\n\n.em-grid-rect,\n.em-grid-hexagon {\n stroke: white;\n}\n\n.em-flow-donuts {\n cursor: pointer !important;\n}\n","",{version:3,sources:["webpack://./src/css/map.css"],names:[],mappings:"AAQA,gBAAgB;AAChB;IACI,kBAAkB;IAClB,qBAAqB;AACzB;;AAEA;IACI,cAAc;AAClB;;AAEA,0BAA0B;AAC1B;IACI,oBAAoB;IACpB,yCAAyC;AAC7C;;AAEA;IACI,mBAAmB;AACvB;;AAEA,aAAa;AACb;;;;;IAKI,yCAAyC;AAC7C;;AAEA;IACI,YAAY;AAChB;;AAEA;IACI,gBAAgB;IAChB,wBAAwB;AAC5B;;AAEA,mBAAmB;AACnB;IACI,6BAA6B;IAC7B,sBAAsB;IACtB,qBAAqB;IACrB,UAAU;IACV,eAAe;IACf,uBAAuB;AAC3B;;AAEA,+BAA+B;AAC/B;;IAEI,aAAa;IACb,YAAY;AAChB;;AAEA;IACI,eAAe;IACf,iBAAiB;AACrB;;AAEA;;IAEI,aAAa;IACb,iBAAiB;IACjB,YAAY;IACZ,sBAAsB;IACtB,mBAAmB;AACvB;;AAEA;IACI,eAAe;IACf,gBAAgB;AACpB;;AAEA;IACI,aAAa;IACb,eAAe;IACf,gCAAgC;AACpC;;AAEA;IACI,eAAe;IACf,aAAa;IACb,0BAA0B;IAC1B,0BAA0B;IAC1B,gCAAgC;AACpC;;AAEA;IACI,aAAa;IACb,0BAA0B;IAC1B,0BAA0B;AAC9B;;AAEA;IACI,eAAe;IACf,YAAY;AAChB;;AAEA,sBAAsB;AACtB;IACI,iBAAiB;IACjB,eAAe;AACnB;AACA;;IAEI,UAAU;IACV,oBAAoB;AACxB;;AAEA;IACI,WAAW;IACX,0BAA0B;AAC9B;;AAEA;IACI,eAAe;IACf,mBAAmB;AACvB;;AAEA;IACI,cAAc;IACd,mBAAmB;AACvB;;AAEA,mCAAmC;AACnC;IACI,aAAa;IACb,mBAAmB;IACnB,0BAA0B;IAC1B,eAAe;IACf,+BAA+B;AACnC;;AAEA;IACI,aAAa;IACb,0BAA0B;AAC9B;;AAEA;IACI,aAAa;AACjB;;AAEA;;IAEI,0BAA0B;AAC9B;;AAEA;IACI,0BAA0B;AAC9B;;AAEA;IACI,0BAA0B;AAC9B;;AAEA;IACI,eAAe;IACf,iBAAiB;IACjB,aAAa;IACb,oBAAoB;AACxB;;AAEA;IACI,eAAe;IACf,iBAAiB;IACjB,WAAW;IACX,oBAAoB;AACxB;;AAEA;;IAEI,aAAa;AACjB;;AAEA;IACI,0BAA0B;AAC9B",sourcesContent:["@import './map-types/proportional-symbol.css';\r\n@import './map-types/coxcomb.css';\r\n@import './map-types/alpha.css';\r\n@import './map-types/flow.css';\r\n@import './map-types/pie.css';\r\n@import './map-types/sparkline.css';\r\n@import './map-types/waffle.css';\r\n\r\n/* wrapper DOM */\r\n.em-map-wrapper {\r\n position: relative;\r\n display: inline-block;\r\n}\r\n\r\n.em-map-wrapper > svg {\r\n display: block;\r\n}\r\n\r\n/* General text settings */\r\ntext {\r\n pointer-events: none;\r\n font-family: Arial, Helvetica, sans-serif;\r\n}\r\n\r\na text {\r\n pointer-events: all;\r\n}\r\n\r\n/* Main map */\r\n.em-map text,\r\n.em-legend text,\r\n.em-title,\r\n.em-subtitle,\r\n.em-footnote {\r\n font-family: Arial, Helvetica, sans-serif;\r\n}\r\n\r\n.em-map.em-draggable g {\r\n cursor: grab;\r\n}\r\n\r\n.em-map.em-dragging g {\r\n cursor: grabbing;\r\n cursor: -webkit-grabbing;\r\n}\r\n\r\n/* Coastal margin */\r\n.em-coastal-margin {\r\n filter: url(#em-coastal-blur);\r\n stroke-linejoin: round;\r\n stroke-linecap: round;\r\n fill: none;\r\n stroke-width: 1;\r\n stroke: rgb(0, 52, 107);\r\n}\r\n\r\n/* Title and subtitle styling */\r\n.em-title,\r\n.em-inset-title {\r\n fill: #4c4b4b;\r\n stroke: none;\r\n}\r\n\r\n.em-title {\r\n font-size: 21px;\r\n font-weight: bold;\r\n}\r\n\r\n.em-subtitle,\r\n.em-inset-subtitle {\r\n fill: #4c4b4b;\r\n fill-opacity: 0.9;\r\n stroke: none;\r\n stroke-linejoin: round;\r\n paint-order: stroke;\r\n}\r\n\r\n.em-subtitle {\r\n font-size: 18px;\r\n font-weight: 100;\r\n}\r\n\r\n.em-source-pretext {\r\n fill: #848280;\r\n font-size: 11px;\r\n transform: translate(-5px, -5px);\r\n}\r\n\r\n.em-source-dataset-link {\r\n font-size: 11px;\r\n fill: #0e47cb;\r\n cursor: pointer !important;\r\n text-decoration: underline;\r\n transform: translate(-5px, -5px);\r\n}\r\n\r\n.em-source-dataset-link:hover {\r\n fill: #082b7a;\r\n cursor: pointer !important;\r\n text-decoration: underline;\r\n}\r\n\r\n.em-frame {\r\n stroke-width: 0;\r\n stroke: grey;\r\n}\r\n\r\n/* Graticule styling */\r\n.em-graticule {\r\n stroke: lightgray;\r\n stroke-width: 1;\r\n}\r\n.em-frame,\r\n.em-graticule {\r\n fill: none;\r\n pointer-events: none;\r\n}\r\n\r\n.em-sea {\r\n fill: white;\r\n /* pointer-events: none; */\r\n}\r\n\r\n.em-scalebar-line {\r\n stroke: #696969;\r\n stroke-width: 0.8px;\r\n}\r\n\r\n.em-scalebar-label {\r\n font-size: 9px;\r\n text-anchor: middle;\r\n}\r\n\r\n/* Bottom text and symbol styling */\r\n.em-footnote {\r\n fill: #848280;\r\n pointer-events: all;\r\n cursor: pointer !important;\r\n font-size: 11px;\r\n transform: translate(5px, -5px);\r\n}\r\n\r\n.em-footnote a {\r\n fill: #0e47cb;\r\n text-decoration: underline;\r\n}\r\n\r\n.em-footnote a:hover {\r\n fill: #0a328e;\r\n}\r\n\r\n.em-centroid,\r\n.em-coxcomb g {\r\n cursor: pointer !important;\r\n}\r\n\r\n.em-flow-link {\r\n cursor: pointer !important;\r\n}\r\n\r\n.em-flow-link-outline {\r\n cursor: pointer !important;\r\n}\r\n\r\n.em-flow-labels {\r\n font-size: 15px;\r\n stroke-width: 1px;\r\n fill: #696969;\r\n pointer-events: none;\r\n}\r\n\r\n.em-flow-labels-halo {\r\n font-size: 15px;\r\n stroke-width: 2px;\r\n fill: white;\r\n pointer-events: none;\r\n}\r\n\r\n.em-grid-rect,\r\n.em-grid-hexagon {\r\n stroke: white;\r\n}\r\n\r\n.em-flow-donuts {\r\n cursor: pointer !important;\r\n}\r\n"],sourceRoot:""}]);const z=B},2875(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,"#g_worldbn,\n.em-worldrg,\n.em-worldbn,\n.em-worldbn-halo {\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n.em-worldbn {\n stroke: #4d4d4d;\n stroke-width: 0.5px;\n}\n\n.em-worldbn,\n.em-worldbn-halo {\n fill: none;\n}\n\n.em-worldrg {\n fill: #efefef;\n cursor: pointer;\n}\n\n.em-bn-d {\n /* disputed */\n stroke: #4d4d4d;\n stroke-width: 0.1;\n opacity: 0.9;\n fill: none;\n stroke-dasharray: 1 1;\n}\n\n/* world boundary halo (not coastline) */\n.em-worldbn-halo:not(.em-bn-co) {\n stroke: rgba(216, 216, 216, 0.3);\n stroke-width: 1px;\n}\n/* world boundary halo (not coastline, disputed) */\n.em-worldbn-halo:not(.em-bn-co) .em-bn-d {\n stroke: rgba(141, 141, 141, 0.3);\n stroke-width: 1px;\n stroke-dasharray: 1 1;\n}\n","",{version:3,sources:["webpack://./src/css/world.css"],names:[],mappings:"AAAA;;;;IAII,qBAAqB;IACrB,sBAAsB;AAC1B;;AAEA;IACI,eAAe;IACf,mBAAmB;AACvB;;AAEA;;IAEI,UAAU;AACd;;AAEA;IACI,aAAa;IACb,eAAe;AACnB;;AAEA;IACI,aAAa;IACb,eAAe;IACf,iBAAiB;IACjB,YAAY;IACZ,UAAU;IACV,qBAAqB;AACzB;;AAEA,wCAAwC;AACxC;IACI,gCAAgC;IAChC,iBAAiB;AACrB;AACA,kDAAkD;AAClD;IACI,gCAAgC;IAChC,iBAAiB;IACjB,qBAAqB;AACzB",sourcesContent:["#g_worldbn,\r\n.em-worldrg,\r\n.em-worldbn,\r\n.em-worldbn-halo {\r\n stroke-linecap: round;\r\n stroke-linejoin: round;\r\n}\r\n\r\n.em-worldbn {\r\n stroke: #4d4d4d;\r\n stroke-width: 0.5px;\r\n}\r\n\r\n.em-worldbn,\r\n.em-worldbn-halo {\r\n fill: none;\r\n}\r\n\r\n.em-worldrg {\r\n fill: #efefef;\r\n cursor: pointer;\r\n}\r\n\r\n.em-bn-d {\r\n /* disputed */\r\n stroke: #4d4d4d;\r\n stroke-width: 0.1;\r\n opacity: 0.9;\r\n fill: none;\r\n stroke-dasharray: 1 1;\r\n}\r\n\r\n/* world boundary halo (not coastline) */\r\n.em-worldbn-halo:not(.em-bn-co) {\r\n stroke: rgba(216, 216, 216, 0.3);\r\n stroke-width: 1px;\r\n}\r\n/* world boundary halo (not coastline, disputed) */\r\n.em-worldbn-halo:not(.em-bn-co) .em-bn-d {\r\n stroke: rgba(141, 141, 141, 0.3);\r\n stroke-width: 1px;\r\n stroke-dasharray: 1 1;\r\n}\r\n"],sourceRoot:""}]);const M=S},2991(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,"/* STYLING OF NUTS REGIONS AND BOUNDARIES */\n/* Default region fill */\n.em-nutsrg {\n fill: #e1e1e1;\n}\n\n.em-nutsrg,\n#em-user-regions {\n cursor: pointer !important;\n}\n\n/* boundaries stroke-width */\n.em-bn-0 {\n stroke: none;\n}\n.em-bn-1,\n.em-bn-2,\n.em-bn-3,\n/* when using MIXED NUTS levels, we add stroke to the regions, then show/hide those that have/dont have data */\n.em-nutsrg [lvl='3'],\n.em-nutsrg [lvl='2'],\n.em-nutsrg [lvl='1'],\n.em-bn-co {\n stroke-width: 0.3;\n stroke-opacity: 0.5;\n}\n\n/* all NUTS boundaries and regions */\n#em-nutsbn,\n.em-bn-0,\n.em-bn-1,\n.em-bn-2,\n.em-bn-3,\n.em-nutsrg [lvl='3'],\n.em-nutsrg [lvl='2'],\n.em-nutsrg [lvl='1'],\n.em-nutsrg {\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n/* NUTS boundaries stroke color */\n.em-bn-1,\n.em-bn-2,\n.em-bn-3,\n.em-nutsrg [lvl='3'],\n.em-nutsrg [lvl='2'],\n.em-nutsrg [lvl='1'] {\n stroke: #474747;\n}\n\n/* dont fill border elements */\n.em-bn-0,\n.em-bn-1,\n.em-bn-2,\n.em-bn-3 {\n fill: none;\n pointer-events: none;\n}\n","",{version:3,sources:["webpack://./src/css/NUTS.css"],names:[],mappings:"AAAA,2CAA2C;AAC3C,wBAAwB;AACxB;IACI,aAAa;AACjB;;AAEA;;IAEI,0BAA0B;AAC9B;;AAEA,6BAA6B;AAC7B;IACI,YAAY;AAChB;AACA;;;;;;;;IAQI,iBAAiB;IACjB,mBAAmB;AACvB;;AAEA,oCAAoC;AACpC;;;;;;;;;IASI,qBAAqB;IACrB,sBAAsB;AAC1B;;AAEA,iCAAiC;AACjC;;;;;;IAMI,eAAe;AACnB;;AAEA,8BAA8B;AAC9B;;;;IAII,UAAU;IACV,oBAAoB;AACxB",sourcesContent:["/* STYLING OF NUTS REGIONS AND BOUNDARIES */\r\n/* Default region fill */\r\n.em-nutsrg {\r\n fill: #e1e1e1;\r\n}\r\n\r\n.em-nutsrg,\r\n#em-user-regions {\r\n cursor: pointer !important;\r\n}\r\n\r\n/* boundaries stroke-width */\r\n.em-bn-0 {\r\n stroke: none;\r\n}\r\n.em-bn-1,\r\n.em-bn-2,\r\n.em-bn-3,\r\n/* when using MIXED NUTS levels, we add stroke to the regions, then show/hide those that have/dont have data */\r\n.em-nutsrg [lvl='3'],\r\n.em-nutsrg [lvl='2'],\r\n.em-nutsrg [lvl='1'],\r\n.em-bn-co {\r\n stroke-width: 0.3;\r\n stroke-opacity: 0.5;\r\n}\r\n\r\n/* all NUTS boundaries and regions */\r\n#em-nutsbn,\r\n.em-bn-0,\r\n.em-bn-1,\r\n.em-bn-2,\r\n.em-bn-3,\r\n.em-nutsrg [lvl='3'],\r\n.em-nutsrg [lvl='2'],\r\n.em-nutsrg [lvl='1'],\r\n.em-nutsrg {\r\n stroke-linecap: round;\r\n stroke-linejoin: round;\r\n}\r\n\r\n/* NUTS boundaries stroke color */\r\n.em-bn-1,\r\n.em-bn-2,\r\n.em-bn-3,\r\n.em-nutsrg [lvl='3'],\r\n.em-nutsrg [lvl='2'],\r\n.em-nutsrg [lvl='1'] {\r\n stroke: #474747;\r\n}\r\n\r\n/* dont fill border elements */\r\n.em-bn-0,\r\n.em-bn-1,\r\n.em-bn-2,\r\n.em-bn-3 {\r\n fill: none;\r\n pointer-events: none;\r\n}\r\n"],sourceRoot:""}]);const M=S},3006(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,"/* muted country boundaries */\n.em--flow .em-cntbn {\n stroke: grey;\n stroke-width: 0.25px;\n}\n\n/* dim everything except the highlighted color group */\n.em-flow-container line.dimmed,\n.em-flow-lines line.dimmed,\n.em-flow-container path.em-flow-link.dimmed,\n.em-flow-lines path.em-flow-link.dimmed {\n opacity: 0;\n stroke-opacity: 0;\n}\n\n/* emphasize the matching ones */\n.em-flow-container line.highlighted,\n.em-flow-lines line.highlighted {\n opacity: 1;\n stroke-opacity: 1;\n}\n\n.em-flow-container path.em-flow-link.highlighted,\n.em-flow-lines path.em-flow-link.highlighted {\n /* tapered polygons use FILL */\n filter: brightness(1.05);\n opacity: 1;\n stroke-opacity: 1;\n}\n\n.em-legend-label.em-flow-legend-min-label,\n.em-legend-label.em-flow-legend-max-label {\n font-size: 12px;\n fill: #666;\n}\n\n/* DONUT TOOLTIP */\n.em-donut-tooltip-table {\n border-collapse: collapse;\n width: 100%;\n max-width: 100%;\n table-layout: fixed; /* required for ellipsis to work predictably */\n}\n\n.em-donut-tooltip-table td {\n padding: 3px 0;\n font-size: 12px;\n vertical-align: middle;\n}\n\n.em-donut-tooltip-table td:last-child {\n width: 32%;\n text-align: right;\n white-space: nowrap;\n}\n\n.em-donut-tooltip-table {\n border-collapse: collapse;\n width: 100%;\n max-width: 100%;\n table-layout: fixed;\n border-spacing: 0;\n box-sizing: border-box;\n}\n\n.em-donut-tooltip-table td {\n padding: 2px 6px;\n font-size: 12px;\n vertical-align: middle;\n box-sizing: border-box;\n}\n\n.em-donut-tooltip-table td:last-child {\n text-align: right;\n white-space: nowrap;\n padding-left: 6px;\n}\n\n.em-donut-tooltip-table td:first-child {\n padding-right: 6px;\n box-sizing: border-box;\n min-width: 0;\n}\n\n.em-donut-tooltip-label {\n display: flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n}\n\n.em-donut-tooltip-colorchip {\n width: 10px;\n height: 10px;\n border-radius: 50%;\n flex-shrink: 0;\n display: inline-block;\n vertical-align: middle;\n}\n\n.em-tooltip-label-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex: 1 1 auto;\n min-width: 0;\n display: inline-block;\n vertical-align: middle;\n}\n\n.em-donut-tooltip-section-header td {\n padding-top: 6px;\n font-weight: 600;\n color: #222;\n}\n.em-donut-tooltip-row td {\n padding-top: 2px;\n}\n.em-donut-tooltip-total td {\n padding-top: 6px;\n font-weight: 700;\n border-top: 1px solid #ddd;\n}\n\n.em-tooltip-text {\n max-width: 320px;\n box-sizing: border-box;\n overflow: hidden;\n padding: 0;\n}\n\n/* END DONUT TOOLTIP */\n","",{version:3,sources:["webpack://./src/css/map-types/flow.css"],names:[],mappings:"AAAA,8BAA8B;AAC9B;IACI,YAAY;IACZ,oBAAoB;AACxB;;AAEA,sDAAsD;AACtD;;;;IAII,UAAU;IACV,iBAAiB;AACrB;;AAEA,gCAAgC;AAChC;;IAEI,UAAU;IACV,iBAAiB;AACrB;;AAEA;;IAEI,8BAA8B;IAC9B,wBAAwB;IACxB,UAAU;IACV,iBAAiB;AACrB;;AAEA;;IAEI,eAAe;IACf,UAAU;AACd;;AAEA,kBAAkB;AAClB;IACI,yBAAyB;IACzB,WAAW;IACX,eAAe;IACf,mBAAmB,EAAE,8CAA8C;AACvE;;AAEA;IACI,cAAc;IACd,eAAe;IACf,sBAAsB;AAC1B;;AAEA;IACI,UAAU;IACV,iBAAiB;IACjB,mBAAmB;AACvB;;AAEA;IACI,yBAAyB;IACzB,WAAW;IACX,eAAe;IACf,mBAAmB;IACnB,iBAAiB;IACjB,sBAAsB;AAC1B;;AAEA;IACI,gBAAgB;IAChB,eAAe;IACf,sBAAsB;IACtB,sBAAsB;AAC1B;;AAEA;IACI,iBAAiB;IACjB,mBAAmB;IACnB,iBAAiB;AACrB;;AAEA;IACI,kBAAkB;IAClB,sBAAsB;IACtB,YAAY;AAChB;;AAEA;IACI,aAAa;IACb,mBAAmB;IACnB,QAAQ;IACR,YAAY;IACZ,gBAAgB;IAChB,mBAAmB;AACvB;;AAEA;IACI,WAAW;IACX,YAAY;IACZ,kBAAkB;IAClB,cAAc;IACd,qBAAqB;IACrB,sBAAsB;AAC1B;;AAEA;IACI,gBAAgB;IAChB,uBAAuB;IACvB,mBAAmB;IACnB,cAAc;IACd,YAAY;IACZ,qBAAqB;IACrB,sBAAsB;AAC1B;;AAEA;IACI,gBAAgB;IAChB,gBAAgB;IAChB,WAAW;AACf;AACA;IACI,gBAAgB;AACpB;AACA;IACI,gBAAgB;IAChB,gBAAgB;IAChB,0BAA0B;AAC9B;;AAEA;IACI,gBAAgB;IAChB,sBAAsB;IACtB,gBAAgB;IAChB,UAAU;AACd;;AAEA,sBAAsB",sourcesContent:["/* muted country boundaries */\r\n.em--flow .em-cntbn {\r\n stroke: grey;\r\n stroke-width: 0.25px;\r\n}\r\n\r\n/* dim everything except the highlighted color group */\r\n.em-flow-container line.dimmed,\r\n.em-flow-lines line.dimmed,\r\n.em-flow-container path.em-flow-link.dimmed,\r\n.em-flow-lines path.em-flow-link.dimmed {\r\n opacity: 0;\r\n stroke-opacity: 0;\r\n}\r\n\r\n/* emphasize the matching ones */\r\n.em-flow-container line.highlighted,\r\n.em-flow-lines line.highlighted {\r\n opacity: 1;\r\n stroke-opacity: 1;\r\n}\r\n\r\n.em-flow-container path.em-flow-link.highlighted,\r\n.em-flow-lines path.em-flow-link.highlighted {\r\n /* tapered polygons use FILL */\r\n filter: brightness(1.05);\r\n opacity: 1;\r\n stroke-opacity: 1;\r\n}\r\n\r\n.em-legend-label.em-flow-legend-min-label,\r\n.em-legend-label.em-flow-legend-max-label {\r\n font-size: 12px;\r\n fill: #666;\r\n}\r\n\r\n/* DONUT TOOLTIP */\r\n.em-donut-tooltip-table {\r\n border-collapse: collapse;\r\n width: 100%;\r\n max-width: 100%;\r\n table-layout: fixed; /* required for ellipsis to work predictably */\r\n}\r\n\r\n.em-donut-tooltip-table td {\r\n padding: 3px 0;\r\n font-size: 12px;\r\n vertical-align: middle;\r\n}\r\n\r\n.em-donut-tooltip-table td:last-child {\r\n width: 32%;\r\n text-align: right;\r\n white-space: nowrap;\r\n}\r\n\r\n.em-donut-tooltip-table {\r\n border-collapse: collapse;\r\n width: 100%;\r\n max-width: 100%;\r\n table-layout: fixed;\r\n border-spacing: 0;\r\n box-sizing: border-box;\r\n}\r\n\r\n.em-donut-tooltip-table td {\r\n padding: 2px 6px;\r\n font-size: 12px;\r\n vertical-align: middle;\r\n box-sizing: border-box;\r\n}\r\n\r\n.em-donut-tooltip-table td:last-child {\r\n text-align: right;\r\n white-space: nowrap;\r\n padding-left: 6px;\r\n}\r\n\r\n.em-donut-tooltip-table td:first-child {\r\n padding-right: 6px;\r\n box-sizing: border-box;\r\n min-width: 0;\r\n}\r\n\r\n.em-donut-tooltip-label {\r\n display: flex;\r\n align-items: center;\r\n gap: 6px;\r\n min-width: 0;\r\n overflow: hidden;\r\n white-space: nowrap;\r\n}\r\n\r\n.em-donut-tooltip-colorchip {\r\n width: 10px;\r\n height: 10px;\r\n border-radius: 50%;\r\n flex-shrink: 0;\r\n display: inline-block;\r\n vertical-align: middle;\r\n}\r\n\r\n.em-tooltip-label-text {\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n flex: 1 1 auto;\r\n min-width: 0;\r\n display: inline-block;\r\n vertical-align: middle;\r\n}\r\n\r\n.em-donut-tooltip-section-header td {\r\n padding-top: 6px;\r\n font-weight: 600;\r\n color: #222;\r\n}\r\n.em-donut-tooltip-row td {\r\n padding-top: 2px;\r\n}\r\n.em-donut-tooltip-total td {\r\n padding-top: 6px;\r\n font-weight: 700;\r\n border-top: 1px solid #ddd;\r\n}\r\n\r\n.em-tooltip-text {\r\n max-width: 320px;\r\n box-sizing: border-box;\r\n overflow: hidden;\r\n padding: 0;\r\n}\r\n\r\n/* END DONUT TOOLTIP */\r\n"],sourceRoot:""}]);const M=S},3176(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,"/* TERNARY */\n.em-ternary-legend-label {\n font-size: 13px;\n stroke: none;\n fill: #3a3a3a;\n}\n.em-ternary-grid-line,\n.em-ternary-grid-line-minor {\n pointer-events: none;\n}\n.em-ternary-axis-title {\n font-size: 13px;\n}\n.em-ternary-axis-tick {\n stroke: #3a3a3a;\n stroke-width: 1;\n pointer-events: none;\n}\n.em-ternary-legend-data-point,\n.em-ternary-discrete-polygon {\n cursor: pointer;\n}\n.em-ternary-discrete-polygon {\n transition: fill 150ms;\n}\n.em-ternary-annotation-line {\n stroke: #161616;\n stroke-width: 1;\n opacity: 1;\n}\n.em-ternary-center-annotation-label {\n font-size: 11px;\n fill: #161616;\n font-style: italic;\n text-anchor: start;\n}\n.em-ternary-center-line-label {\n opacity: 1;\n font-size: 10px;\n}\n.em-ternary-center-point {\n pointer-events: none;\n}","",{version:3,sources:["webpack://./src/css/legend/ternary.css"],names:[],mappings:"AAAA,YAAY;AACZ;IACI,eAAe;IACf,YAAY;IACZ,aAAa;AACjB;AACA;;IAEI,oBAAoB;AACxB;AACA;IACI,eAAe;AACnB;AACA;IACI,eAAe;IACf,eAAe;IACf,oBAAoB;AACxB;AACA;;IAEI,eAAe;AACnB;AACA;IACI,sBAAsB;AAC1B;AACA;IACI,eAAe;IACf,eAAe;IACf,UAAU;AACd;AACA;IACI,eAAe;IACf,aAAa;IACb,kBAAkB;IAClB,kBAAkB;AACtB;AACA;IACI,UAAU;IACV,eAAe;AACnB;AACA;IACI,oBAAoB;AACxB",sourcesContent:["/* TERNARY */\r\n.em-ternary-legend-label {\r\n font-size: 13px;\r\n stroke: none;\r\n fill: #3a3a3a;\r\n}\r\n.em-ternary-grid-line,\r\n.em-ternary-grid-line-minor {\r\n pointer-events: none;\r\n}\r\n.em-ternary-axis-title {\r\n font-size: 13px;\r\n}\r\n.em-ternary-axis-tick {\r\n stroke: #3a3a3a;\r\n stroke-width: 1;\r\n pointer-events: none;\r\n}\r\n.em-ternary-legend-data-point,\r\n.em-ternary-discrete-polygon {\r\n cursor: pointer;\r\n}\r\n.em-ternary-discrete-polygon {\r\n transition: fill 150ms;\r\n}\r\n.em-ternary-annotation-line {\r\n stroke: #161616;\r\n stroke-width: 1;\r\n opacity: 1;\r\n}\r\n.em-ternary-center-annotation-label {\r\n font-size: 11px;\r\n fill: #161616;\r\n font-style: italic;\r\n text-anchor: start;\r\n}\r\n.em-ternary-center-line-label {\r\n opacity: 1;\r\n font-size: 10px;\r\n}\r\n.em-ternary-center-point {\r\n pointer-events: none;\r\n}"],sourceRoot:""}]);const M=S},3606(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,".em-spark-legend-label {\n fill: #5c5c5c;\n}\n","",{version:3,sources:["webpack://./src/css/legend/spark.css"],names:[],mappings:"AAAA;IACI,aAAa;AACjB",sourcesContent:[".em-spark-legend-label {\r\n fill: #5c5c5c;\r\n}\r\n"],sourceRoot:""}]);const M=S},3738(c){function _typeof(h){return c.exports=_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},c.exports.__esModule=!0,c.exports.default=c.exports,_typeof(h)}c.exports=_typeof,c.exports.__esModule=!0,c.exports.default=c.exports},3774(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,"/* Proportional pie chart maps */\n\n/* muted country boundaries */\n.em--pie .em-cntbn {\n stroke: grey;\n}\n\n/* muted nuts boundaries */\n.em--pie .em-bn-1,\n.em--pie .em-bn-2,\n.em--pie .em-bn-3,\n.em--pie .em-nutsrg [lvl='3'],\n.em--pie .em-nutsrg [lvl='2'],\n.em--pie .em-nutsrg [lvl='1'],\n.em--pie .em-bn-co {\n stroke-width: 0.07px;\n}\n\n/* muted country fill */\n.em--pie .em-cntrg {\n fill: #f2f2f2;\n}\n\n/* nuts fill (regions with data) */\n.em--pie .em-nutsrg {\n fill: #fffeef;\n}\n\n/* regions without data input */\n.em--pie [ecl='ni'] {\n fill: #f2f2f2;\n}\n\n/* Hide non-nuts borders (country boundaries > that are 'other' and not coastal, not candidates, not eu and not efta) */\n.em--pie g#em-cntbn > .em-bn-oth:not(.em-bn-co):not(.em-bn-cc):not(.em-bn-eu):not(.em-bn-efta) {\n stroke-width: 0px;\n}\n\n/* Coastlines should not be drawn for choropleths, however for prop symbol maps with white regions they can be necessary */\n.em--pie .em-bn-co {\n stroke: grey;\n stroke-width: 0.2px;\n}\n\n.em--pie #em-cntbn-halo {\n stroke: none;\n}\n","",{version:3,sources:["webpack://./src/css/map-types/pie.css"],names:[],mappings:"AAAA,gCAAgC;;AAEhC,+BAA+B;AAC/B;IACI,YAAY;AAChB;;AAEA,4BAA4B;AAC5B;;;;;;;IAOI,oBAAoB;AACxB;;AAEA,wBAAwB;AACxB;IACI,aAAa;AACjB;;AAEA,mCAAmC;AACnC;IACI,aAAa;AACjB;;AAEA,gCAAgC;AAChC;IACI,aAAa;AACjB;;AAEA,uHAAuH;AACvH;IACI,iBAAiB;AACrB;;AAEA,0HAA0H;AAC1H;IACI,YAAY;IACZ,mBAAmB;AACvB;;AAEA;IACI,YAAY;AAChB",sourcesContent:["/* Proportional pie chart maps */\r\n\r\n/* muted country boundaries */\r\n.em--pie .em-cntbn {\r\n stroke: grey;\r\n}\r\n\r\n/* muted nuts boundaries */\r\n.em--pie .em-bn-1,\r\n.em--pie .em-bn-2,\r\n.em--pie .em-bn-3,\r\n.em--pie .em-nutsrg [lvl='3'],\r\n.em--pie .em-nutsrg [lvl='2'],\r\n.em--pie .em-nutsrg [lvl='1'],\r\n.em--pie .em-bn-co {\r\n stroke-width: 0.07px;\r\n}\r\n\r\n/* muted country fill */\r\n.em--pie .em-cntrg {\r\n fill: #f2f2f2;\r\n}\r\n\r\n/* nuts fill (regions with data) */\r\n.em--pie .em-nutsrg {\r\n fill: #fffeef;\r\n}\r\n\r\n/* regions without data input */\r\n.em--pie [ecl='ni'] {\r\n fill: #f2f2f2;\r\n}\r\n\r\n/* Hide non-nuts borders (country boundaries > that are 'other' and not coastal, not candidates, not eu and not efta) */\r\n.em--pie g#em-cntbn > .em-bn-oth:not(.em-bn-co):not(.em-bn-cc):not(.em-bn-eu):not(.em-bn-efta) {\r\n stroke-width: 0px;\r\n}\r\n\r\n/* Coastlines should not be drawn for choropleths, however for prop symbol maps with white regions they can be necessary */\r\n.em--pie .em-bn-co {\r\n stroke: grey;\r\n stroke-width: 0.2px;\r\n}\r\n\r\n.em--pie #em-cntbn-halo {\r\n stroke: none;\r\n}\r\n"],sourceRoot:""}]);const M=S},3869(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,".em-inset .em-zoom-buttons {\n display: none;\n}\n.em-inset-title {\n font-size: 11px;\n}\n.em-inset-subtitle {\n font-size: 12px;\n}\n.em-insets .em-frame {\n /* this will give a frame to inset maps */\n stroke: grey;\n stroke-width: 0.3px !important;\n}\n","",{version:3,sources:["webpack://./src/css/insets.css"],names:[],mappings:"AAAA;IACI,aAAa;AACjB;AACA;IACI,eAAe;AACnB;AACA;IACI,eAAe;AACnB;AACA;IACI,yCAAyC;IACzC,YAAY;IACZ,8BAA8B;AAClC",sourcesContent:[".em-inset .em-zoom-buttons {\r\n display: none;\r\n}\r\n.em-inset-title {\r\n font-size: 11px;\r\n}\r\n.em-inset-subtitle {\r\n font-size: 12px;\r\n}\r\n.em-insets .em-frame {\r\n /* this will give a frame to inset maps */\r\n stroke: grey;\r\n stroke-width: 0.3px !important;\r\n}\r\n"],sourceRoot:""}]);const M=S},4282(c,h,g){"use strict";g.d(h,{A:()=>z});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w),M=g(1477),k=g(924),T=g(825),E=g(4399),I=g(2275),P=g(3176),L=g(3606),B=S()(b());B.i(M.A),B.i(k.A),B.i(T.A),B.i(E.A),B.i(I.A),B.i(P.A),B.i(L.A),B.push([c.id,".em-legend-background {\n fill: white;\n opacity: 0.7;\n rx: 0;\n ry: 0;\n pointer-events: none;\n}\n\n/* titles */\n.em-legend-title {\n font-weight: bold;\n font-size: 15px;\n fill: #696969;\n}\n\n.em-size-legend-title {\n font-size: 15px;\n fill: #666;\n}\n\n.em-color-legend-title {\n font-size: 15px;\n fill: #696969;\n}\n\n.em-width-legend-title {\n font-size: 15px;\n fill: #696969;\n}\n\n.em-legend-subtitle {\n font-size: 15px;\n fill: #696969;\n opacity: 0.8;\n}\n\n/* labels */\n.em-legend-label {\n font-size: 14px;\n stroke: none;\n fill: #696969;\n dominant-baseline: unset;\n}\n\n.em-legend-label-max,\n.em-legend-label-min {\n opacity: 0.8;\n}\n\n.em-legend-label-max:hover,\n.em-legend-label-min:hover,\n.em-legend-label-no-data:hover {\n opacity: 1;\n font-weight: bold;\n}\n\n/* ticks */\n.em-legend-tick {\n stroke: #696969;\n stroke-width: 1;\n}\n\n/* misc */\n.em-legend-separator {\n stroke: white;\n stroke-width: 1;\n}\n\n/* cursor: pointer */\n.em-legend-gradient {\n cursor: pointer;\n}\n.em-bivariate-square,\n.em-legend-rect {\n cursor: pointer;\n}\n.em-legend-histogram-bar {\n cursor: pointer;\n}\n\n/* hover */\n.em-bivariate-square:hover,\n.em-legend-rect:hover {\n stroke-width: 2;\n stroke: red;\n}\n\n.em-legend-diverging-line {\n stroke: #696969;\n}\n.em-legend-background {\n filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.5));\n opacity: 0.9;\n}\n","",{version:3,sources:["webpack://./src/css/legend/legend.css"],names:[],mappings:"AAQA;IACI,WAAW;IACX,YAAY;IACZ,KAAK;IACL,KAAK;IACL,oBAAoB;AACxB;;AAEA,WAAW;AACX;IACI,iBAAiB;IACjB,eAAe;IACf,aAAa;AACjB;;AAEA;IACI,eAAe;IACf,UAAU;AACd;;AAEA;IACI,eAAe;IACf,aAAa;AACjB;;AAEA;IACI,eAAe;IACf,aAAa;AACjB;;AAEA;IACI,eAAe;IACf,aAAa;IACb,YAAY;AAChB;;AAEA,WAAW;AACX;IACI,eAAe;IACf,YAAY;IACZ,aAAa;IACb,wBAAwB;AAC5B;;AAEA;;IAEI,YAAY;AAChB;;AAEA;;;IAGI,UAAU;IACV,iBAAiB;AACrB;;AAEA,UAAU;AACV;IACI,eAAe;IACf,eAAe;AACnB;;AAEA,SAAS;AACT;IACI,aAAa;IACb,eAAe;AACnB;;AAEA,oBAAoB;AACpB;IACI,eAAe;AACnB;AACA;;IAEI,eAAe;AACnB;AACA;IACI,eAAe;AACnB;;AAEA,UAAU;AACV;;IAEI,eAAe;IACf,WAAW;AACf;;AAEA;IACI,eAAe;AACnB;AACA;IACI,mDAAmD;IACnD,YAAY;AAChB",sourcesContent:["@import 'bivariate-choropleth.css';\r\n@import 'coxcomb.css';\r\n@import 'flow.css';\r\n@import 'pie.css';\r\n@import 'spike.css';\r\n@import 'ternary.css';\r\n@import 'spark.css';\r\n\r\n.em-legend-background {\r\n fill: white;\r\n opacity: 0.7;\r\n rx: 0;\r\n ry: 0;\r\n pointer-events: none;\r\n}\r\n\r\n/* titles */\r\n.em-legend-title {\r\n font-weight: bold;\r\n font-size: 15px;\r\n fill: #696969;\r\n}\r\n\r\n.em-size-legend-title {\r\n font-size: 15px;\r\n fill: #666;\r\n}\r\n\r\n.em-color-legend-title {\r\n font-size: 15px;\r\n fill: #696969;\r\n}\r\n\r\n.em-width-legend-title {\r\n font-size: 15px;\r\n fill: #696969;\r\n}\r\n\r\n.em-legend-subtitle {\r\n font-size: 15px;\r\n fill: #696969;\r\n opacity: 0.8;\r\n}\r\n\r\n/* labels */\r\n.em-legend-label {\r\n font-size: 14px;\r\n stroke: none;\r\n fill: #696969;\r\n dominant-baseline: unset;\r\n}\r\n\r\n.em-legend-label-max,\r\n.em-legend-label-min {\r\n opacity: 0.8;\r\n}\r\n\r\n.em-legend-label-max:hover,\r\n.em-legend-label-min:hover,\r\n.em-legend-label-no-data:hover {\r\n opacity: 1;\r\n font-weight: bold;\r\n}\r\n\r\n/* ticks */\r\n.em-legend-tick {\r\n stroke: #696969;\r\n stroke-width: 1;\r\n}\r\n\r\n/* misc */\r\n.em-legend-separator {\r\n stroke: white;\r\n stroke-width: 1;\r\n}\r\n\r\n/* cursor: pointer */\r\n.em-legend-gradient {\r\n cursor: pointer;\r\n}\r\n.em-bivariate-square,\r\n.em-legend-rect {\r\n cursor: pointer;\r\n}\r\n.em-legend-histogram-bar {\r\n cursor: pointer;\r\n}\r\n\r\n/* hover */\r\n.em-bivariate-square:hover,\r\n.em-legend-rect:hover {\r\n stroke-width: 2;\r\n stroke: red;\r\n}\r\n\r\n.em-legend-diverging-line {\r\n stroke: #696969;\r\n}\r\n.em-legend-background {\r\n filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.5));\r\n opacity: 0.9;\r\n}\r\n"],sourceRoot:""}]);const z=B},4373(c){c.exports=function _regeneratorKeys(c){var h=Object(c),g=[];for(var m in h)g.unshift(m);return function e(){for(;g.length;)if((m=g.pop())in h)return e.value=m,e.done=!1,e;return e.done=!0,e}},c.exports.__esModule=!0,c.exports.default=c.exports},4399(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,".em-pie-size-legend-line {\n stroke-dasharray: 2;\n stroke: grey;\n}","",{version:3,sources:["webpack://./src/css/legend/pie.css"],names:[],mappings:"AAAA;IACI,mBAAmB;IACnB,YAAY;AAChB",sourcesContent:[".em-pie-size-legend-line {\r\n stroke-dasharray: 2;\r\n stroke: grey;\r\n}"],sourceRoot:""}]);const M=S},4429(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,"/* muted country boundaries */\n.em--coxcomb .em-cntbn {\n stroke: grey;\n stroke-width: 0.25px;\n}\n\n/* Coastlines should not be drawn for choropleths, however for prop symbol maps with white regions they can be necessary */\n.em--ps .em-bn-co,\n.em--pie .em-bn-co {\n stroke: grey;\n stroke-width: 0.1px;\n}\n\n/* regions without data input */\n.em--coxcomb [ecl='ni'] {\n fill: #e9e9e9;\n}\n\n/* Default region fill */\n.em--coxcomb .em-cntrg,\n.em--coxcomb .em-nutsrg {\n fill: #fafcde;\n}\n\n.em--coxcomb #em-cntbn-halo {\n stroke: none;\n}\n","",{version:3,sources:["webpack://./src/css/map-types/coxcomb.css"],names:[],mappings:"AAAA,+BAA+B;AAC/B;IACI,YAAY;IACZ,oBAAoB;AACxB;;AAEA,0HAA0H;AAC1H;;IAEI,YAAY;IACZ,mBAAmB;AACvB;;AAEA,gCAAgC;AAChC;IACI,aAAa;AACjB;;AAEA,wBAAwB;AACxB;;IAEI,aAAa;AACjB;;AAEA;IACI,YAAY;AAChB",sourcesContent:["/* muted country boundaries */\r\n.em--coxcomb .em-cntbn {\r\n stroke: grey;\r\n stroke-width: 0.25px;\r\n}\r\n\r\n/* Coastlines should not be drawn for choropleths, however for prop symbol maps with white regions they can be necessary */\r\n.em--ps .em-bn-co,\r\n.em--pie .em-bn-co {\r\n stroke: grey;\r\n stroke-width: 0.1px;\r\n}\r\n\r\n/* regions without data input */\r\n.em--coxcomb [ecl='ni'] {\r\n fill: #e9e9e9;\r\n}\r\n\r\n/* Default region fill */\r\n.em--coxcomb .em-cntrg,\r\n.em--coxcomb .em-nutsrg {\r\n fill: #fafcde;\r\n}\r\n\r\n.em--coxcomb #em-cntbn-halo {\r\n stroke: none;\r\n}\r\n"],sourceRoot:""}]);const M=S},4470(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,"#em-labels {\n text-anchor: middle;\n stroke-linejoin: round;\n stroke-linecap: round;\n font-family: Arial, Helvetica, sans-serif;\n dominant-baseline: central;\n pointer-events: none;\n paint-order: stroke fill;\n}\n\n.em-labels {\n font-size: 12px;\n fill: #000000;\n}\n\n.em-label {\n font-size: 12px;\n opacity: 0.9;\n}\n\n.em-label-shadow,\n.em-flow-label-shadow {\n font-size: 12px;\n stroke-width: 2px;\n stroke: white;\n opacity: 0.9;\n fill: none;\n}\n\n.em-label-background {\n fill: #ffffff;\n opacity: 0.9;\n}\n\n.em-stat-label {\n fill: #111111;\n stroke: #111111;\n stroke-width: 0.5px;\n}\n\n.em-stat-label-shadow {\n fill: none;\n stroke: white;\n stroke-width: 2.5px;\n opacity: 0.9;\n}\n\n.em-stat-label,\n.em-stat-label-shadow {\n font-size: 13px;\n}\n\n.em-label-cc {\n font-size: 12px;\n}\n\n.em-label-shadow-cc {\n font-size: 12px;\n stroke-width: 3px;\n}\n\n.em-label-countries {\n fill: #111111;\n font-size: 10px;\n}\n\n.em-label-shadow-countries {\n font-size: 10px;\n stroke-width: 3px;\n}\n\n.em-label-seas {\n font-size: 9px;\n fill: #2a58b3;\n letter-spacing: 0.25em;\n opacity: 0.7;\n}\n\n.em-label-shadow-seas {\n font-size: 9px;\n letter-spacing: 0.25em;\n stroke-width: 3px;\n opacity: 0.5;\n}\n\n.em-flow-labels {\n text-anchor: middle;\n stroke-linejoin: round;\n font-family: Arial, Helvetica, sans-serif;\n dominant-baseline: central;\n}\n\n.em-flow-label {\n font-size: 13px;\n fill: #333333;\n font-weight: bold;\n opacity: 0.9;\n}\n\n.em-flow-label-shadow {\n font-size: 13px;\n stroke-width: 3px;\n}\n","",{version:3,sources:["webpack://./src/css/labels.css"],names:[],mappings:"AAAA;IACI,mBAAmB;IACnB,sBAAsB;IACtB,qBAAqB;IACrB,yCAAyC;IACzC,0BAA0B;IAC1B,oBAAoB;IACpB,wBAAwB;AAC5B;;AAEA;IACI,eAAe;IACf,aAAa;AACjB;;AAEA;IACI,eAAe;IACf,YAAY;AAChB;;AAEA;;IAEI,eAAe;IACf,iBAAiB;IACjB,aAAa;IACb,YAAY;IACZ,UAAU;AACd;;AAEA;IACI,aAAa;IACb,YAAY;AAChB;;AAEA;IACI,aAAa;IACb,eAAe;IACf,mBAAmB;AACvB;;AAEA;IACI,UAAU;IACV,aAAa;IACb,mBAAmB;IACnB,YAAY;AAChB;;AAEA;;IAEI,eAAe;AACnB;;AAEA;IACI,eAAe;AACnB;;AAEA;IACI,eAAe;IACf,iBAAiB;AACrB;;AAEA;IACI,aAAa;IACb,eAAe;AACnB;;AAEA;IACI,eAAe;IACf,iBAAiB;AACrB;;AAEA;IACI,cAAc;IACd,aAAa;IACb,sBAAsB;IACtB,YAAY;AAChB;;AAEA;IACI,cAAc;IACd,sBAAsB;IACtB,iBAAiB;IACjB,YAAY;AAChB;;AAEA;IACI,mBAAmB;IACnB,sBAAsB;IACtB,yCAAyC;IACzC,0BAA0B;AAC9B;;AAEA;IACI,eAAe;IACf,aAAa;IACb,iBAAiB;IACjB,YAAY;AAChB;;AAEA;IACI,eAAe;IACf,iBAAiB;AACrB",sourcesContent:["#em-labels {\r\n text-anchor: middle;\r\n stroke-linejoin: round;\r\n stroke-linecap: round;\r\n font-family: Arial, Helvetica, sans-serif;\r\n dominant-baseline: central;\r\n pointer-events: none;\r\n paint-order: stroke fill;\r\n}\r\n\r\n.em-labels {\r\n font-size: 12px;\r\n fill: #000000;\r\n}\r\n\r\n.em-label {\r\n font-size: 12px;\r\n opacity: 0.9;\r\n}\r\n\r\n.em-label-shadow,\r\n.em-flow-label-shadow {\r\n font-size: 12px;\r\n stroke-width: 2px;\r\n stroke: white;\r\n opacity: 0.9;\r\n fill: none;\r\n}\r\n\r\n.em-label-background {\r\n fill: #ffffff;\r\n opacity: 0.9;\r\n}\r\n\r\n.em-stat-label {\r\n fill: #111111;\r\n stroke: #111111;\r\n stroke-width: 0.5px;\r\n}\r\n\r\n.em-stat-label-shadow {\r\n fill: none;\r\n stroke: white;\r\n stroke-width: 2.5px;\r\n opacity: 0.9;\r\n}\r\n\r\n.em-stat-label,\r\n.em-stat-label-shadow {\r\n font-size: 13px;\r\n}\r\n\r\n.em-label-cc {\r\n font-size: 12px;\r\n}\r\n\r\n.em-label-shadow-cc {\r\n font-size: 12px;\r\n stroke-width: 3px;\r\n}\r\n\r\n.em-label-countries {\r\n fill: #111111;\r\n font-size: 10px;\r\n}\r\n\r\n.em-label-shadow-countries {\r\n font-size: 10px;\r\n stroke-width: 3px;\r\n}\r\n\r\n.em-label-seas {\r\n font-size: 9px;\r\n fill: #2a58b3;\r\n letter-spacing: 0.25em;\r\n opacity: 0.7;\r\n}\r\n\r\n.em-label-shadow-seas {\r\n font-size: 9px;\r\n letter-spacing: 0.25em;\r\n stroke-width: 3px;\r\n opacity: 0.5;\r\n}\r\n\r\n.em-flow-labels {\r\n text-anchor: middle;\r\n stroke-linejoin: round;\r\n font-family: Arial, Helvetica, sans-serif;\r\n dominant-baseline: central;\r\n}\r\n\r\n.em-flow-label {\r\n font-size: 13px;\r\n fill: #333333;\r\n font-weight: bold;\r\n opacity: 0.9;\r\n}\r\n\r\n.em-flow-label-shadow {\r\n font-size: 13px;\r\n stroke-width: 3px;\r\n}\r\n"],sourceRoot:""}]);const M=S},4633(c,h,g){var m=g(5172),b=g(6993),w=g(5869),S=g(887),M=g(1791),k=g(4373),T=g(579);function _regeneratorRuntime(){"use strict";var h=b(),g=h.m(_regeneratorRuntime),E=(Object.getPrototypeOf?Object.getPrototypeOf(g):g.__proto__).constructor;function n(c){var h="function"==typeof c&&c.constructor;return!!h&&(h===E||"GeneratorFunction"===(h.displayName||h.name))}var I={throw:1,return:2,break:3,continue:3};function a(c){var h,g;return function(m){h||(h={stop:function stop(){return g(m.a,2)},catch:function _catch(){return m.v},abrupt:function abrupt(c,h){return g(m.a,I[c],h)},delegateYield:function delegateYield(c,b,w){return h.resultName=b,g(m.d,T(c),w)},finish:function finish(c){return g(m.f,c)}},g=function t(c,g,b){m.p=h.prev,m.n=h.next;try{return c(g,b)}finally{h.next=m.n}}),h.resultName&&(h[h.resultName]=m.v,h.resultName=void 0),h.sent=m.v,h.next=m.n;try{return c.call(this,h)}finally{m.p=h.prev,m.n=h.next}}}return(c.exports=_regeneratorRuntime=function _regeneratorRuntime(){return{wrap:function wrap(c,g,m,b){return h.w(a(c),g,m,b&&b.reverse())},isGeneratorFunction:n,mark:h.m,awrap:function awrap(c,h){return new m(c,h)},AsyncIterator:M,async:function async(c,h,g,m,b){return(n(h)?S:w)(a(c),h,g,m,b)},keys:k,values:T}},c.exports.__esModule=!0,c.exports.default=c.exports)()}c.exports=_regeneratorRuntime,c.exports.__esModule=!0,c.exports.default=c.exports},4756(c,h,g){var m=g(4633)();c.exports=m;try{regeneratorRuntime=m}catch(c){"object"==typeof globalThis?globalThis.regeneratorRuntime=m:Function("r","regeneratorRuntime = r")(m)}},4768(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,"/* muted country fill */\n.em--alpha .em-cntrg,\n.em--alpha .em-cntrg {\n fill: #f2f2f2;\n}\n\n/* muted nuts fill */\n.em--alpha .em-nutsrg,\n.em--alpha .em-nutsrg {\n fill: #fdfdfd;\n}\n\n/* Coastlines should not be drawn for choropleths, however for alpha maps with white regions they can be necessary */\n.em--alpha .em-bn-co {\n stroke: grey;\n stroke-width: 0.1px;\n}\n","",{version:3,sources:["webpack://./src/css/map-types/alpha.css"],names:[],mappings:"AAAA,yBAAyB;AACzB;;IAEI,aAAa;AACjB;;AAEA,sBAAsB;AACtB;;IAEI,aAAa;AACjB;;AAEA,oHAAoH;AACpH;IACI,YAAY;IACZ,mBAAmB;AACvB",sourcesContent:["/* muted country fill */\r\n.em--alpha .em-cntrg,\r\n.em--alpha .em-cntrg {\r\n fill: #f2f2f2;\r\n}\r\n\r\n/* muted nuts fill */\r\n.em--alpha .em-nutsrg,\r\n.em--alpha .em-nutsrg {\r\n fill: #fdfdfd;\r\n}\r\n\r\n/* Coastlines should not be drawn for choropleths, however for alpha maps with white regions they can be necessary */\r\n.em--alpha .em-bn-co {\r\n stroke: grey;\r\n stroke-width: 0.1px;\r\n}\r\n"],sourceRoot:""}]);const M=S},4789(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,".em-annotations {\n /* pointer-events: none; */\n}\n","",{version:3,sources:["webpack://./src/css/annotations.css"],names:[],mappings:"AAAA;IACI,0BAA0B;AAC9B",sourcesContent:[".em-annotations {\r\n /* pointer-events: none; */\r\n}\r\n"],sourceRoot:""}]);const M=S},5056(c,h,g){"use strict";c.exports=function setAttributesWithoutAttributes(c){var h=g.nc;h&&c.setAttribute("nonce",h)}},5072(c){"use strict";var h=[];function getIndexByIdentifier(c){for(var g=-1,m=0;m<h.length;m++)if(h[m].identifier===c){g=m;break}return g}function modulesToDom(c,g){for(var m={},b=[],w=0;w<c.length;w++){var S=c[w],M=g.base?S[0]+g.base:S[0],k=m[M]||0,T="".concat(M," ").concat(k);m[M]=k+1;var E=getIndexByIdentifier(T),I={css:S[1],media:S[2],sourceMap:S[3],supports:S[4],layer:S[5]};if(-1!==E)h[E].references++,h[E].updater(I);else{var P=addElementStyle(I,g);g.byIndex=w,h.splice(w,0,{identifier:T,updater:P,references:1})}b.push(T)}return b}function addElementStyle(c,h){var g=h.domAPI(h);g.update(c);return function updater(h){if(h){if(h.css===c.css&&h.media===c.media&&h.sourceMap===c.sourceMap&&h.supports===c.supports&&h.layer===c.layer)return;g.update(c=h)}else g.remove()}}c.exports=function(c,g){var m=modulesToDom(c=c||[],g=g||{});return function update(c){c=c||[];for(var b=0;b<m.length;b++){var w=getIndexByIdentifier(m[b]);h[w].references--}for(var S=modulesToDom(c,g),M=0;M<m.length;M++){var k=getIndexByIdentifier(m[M]);0===h[k].references&&(h[k].updater(),h.splice(k,1))}m=S}}},5144(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,"/* spinner overlay */\n#em-loading-overlay {\n font-family: Arial, Helvetica, sans-serif;\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(255, 255, 255, 0.6);\n z-index: 9999;\n pointer-events: auto;\n}\n\n/* hidden state */\n#em-loading-overlay.is-hidden {\n display: none;\n}\n\n/* center spinner */\n.em-loading-spinner {\n width: 48px;\n height: 48px;\n border-radius: 50%;\n border: 4px solid rgba(0, 0, 0, 0.12);\n border-top-color: rgba(0, 0, 0, 0.65);\n animation: em-spinner-rotate 1s linear infinite;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);\n}\n\n/* label */\n#em-loading-overlay .em-loading-label {\n margin-top: 8px;\n font-size: 13px;\n color: #222;\n text-align: center;\n font-weight: 500;\n}\n\n#em-loading-overlay .em-spinner-stack {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n@keyframes em-spinner-rotate {\n to { transform: rotate(360deg); }\n}\n","",{version:3,sources:["webpack://./src/css/spinner.css"],names:[],mappings:"AAAA,oBAAoB;AACpB;IACI,yCAAyC;IACzC,kBAAkB;IAClB,QAAQ;IACR,aAAa;IACb,mBAAmB;IACnB,uBAAuB;IACvB,oCAAoC;IACpC,aAAa;IACb,oBAAoB;AACxB;;AAEA,iBAAiB;AACjB;IACI,aAAa;AACjB;;AAEA,mBAAmB;AACnB;IACI,WAAW;IACX,YAAY;IACZ,kBAAkB;IAClB,qCAAqC;IACrC,qCAAqC;IACrC,+CAA+C;IAC/C,yCAAyC;AAC7C;;AAEA,UAAU;AACV;IACI,eAAe;IACf,eAAe;IACf,WAAW;IACX,kBAAkB;IAClB,gBAAgB;AACpB;;AAEA;IACI,aAAa;IACb,sBAAsB;IACtB,mBAAmB;AACvB;;AAEA;IACI,KAAK,yBAAyB,EAAE;AACpC",sourcesContent:["/* spinner overlay */\r\n#em-loading-overlay {\r\n font-family: Arial, Helvetica, sans-serif;\r\n position: absolute;\r\n inset: 0;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n background: rgba(255, 255, 255, 0.6);\r\n z-index: 9999;\r\n pointer-events: auto;\r\n}\r\n\r\n/* hidden state */\r\n#em-loading-overlay.is-hidden {\r\n display: none;\r\n}\r\n\r\n/* center spinner */\r\n.em-loading-spinner {\r\n width: 48px;\r\n height: 48px;\r\n border-radius: 50%;\r\n border: 4px solid rgba(0, 0, 0, 0.12);\r\n border-top-color: rgba(0, 0, 0, 0.65);\r\n animation: em-spinner-rotate 1s linear infinite;\r\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);\r\n}\r\n\r\n/* label */\r\n#em-loading-overlay .em-loading-label {\r\n margin-top: 8px;\r\n font-size: 13px;\r\n color: #222;\r\n text-align: center;\r\n font-weight: 500;\r\n}\r\n\r\n#em-loading-overlay .em-spinner-stack {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n}\r\n\r\n@keyframes em-spinner-rotate {\r\n to { transform: rotate(360deg); }\r\n}\r\n"],sourceRoot:""}]);const M=S},5172(c){c.exports=function _OverloadYield(c,h){this.v=c,this.k=h},c.exports.__esModule=!0,c.exports.default=c.exports},5262(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,"/* Proportional symbol and pie styles */\n\n/* muted country boundaries */\n.em--ps .em-cntbn {\n stroke: grey;\n}\n\n/* muted nuts boundaries */\n.em--ps .em-bn-1,\n.em--ps .em-bn-2,\n.em--ps .em-bn-3,\n.em--ps .em-nutsrg [lvl='3'],\n.em--ps .em-nutsrg [lvl='2'],\n.em--ps .em-nutsrg [lvl='1'],\n.em--ps .em-bn-co {\n stroke-width: 0.07px;\n}\n\n/* muted country fill */\n.em--ps .em-cntrg {\n fill: #f2f2f2;\n}\n\n/* regions without data input */\n.em--ps [ecl=\"ni\"] {\n fill: #e9e9e9;\n}\n\n/* Hide non-nuts borders (country boundaries > that are 'other' and not coastal, not candidates, not eu and not efta) */\n/* .em--ps g#em-cntbn>.em-bn-oth:not(.em-bn-co):not(.em-bn-cc):not(.em-bn-eu):not(.em-bn-efta) {\n stroke-width: 0px;\n} */\n\n/* Coastlines should not be drawn for choropleths, however for prop symbol maps with white regions they can be necessary */\n.em--ps .em-bn-co {\n stroke: grey;\n stroke-width: 0.2px;\n}","",{version:3,sources:["webpack://./src/css/map-types/proportional-symbol.css"],names:[],mappings:"AAAA,uCAAuC;;AAEvC,+BAA+B;AAC/B;IACI,YAAY;AAChB;;AAEA,4BAA4B;AAC5B;;;;;;;IAOI,oBAAoB;AACxB;;AAEA,wBAAwB;AACxB;IACI,aAAa;AACjB;;AAEA,gCAAgC;AAChC;IACI,aAAa;AACjB;;AAEA,uHAAuH;AACvH;;GAEG;;AAEH,0HAA0H;AAC1H;IACI,YAAY;IACZ,mBAAmB;AACvB",sourcesContent:["/* Proportional symbol and pie styles */\r\n\r\n/* muted country boundaries */\r\n.em--ps .em-cntbn {\r\n stroke: grey;\r\n}\r\n\r\n/* muted nuts boundaries */\r\n.em--ps .em-bn-1,\r\n.em--ps .em-bn-2,\r\n.em--ps .em-bn-3,\r\n.em--ps .em-nutsrg [lvl='3'],\r\n.em--ps .em-nutsrg [lvl='2'],\r\n.em--ps .em-nutsrg [lvl='1'],\r\n.em--ps .em-bn-co {\r\n stroke-width: 0.07px;\r\n}\r\n\r\n/* muted country fill */\r\n.em--ps .em-cntrg {\r\n fill: #f2f2f2;\r\n}\r\n\r\n/* regions without data input */\r\n.em--ps [ecl=\"ni\"] {\r\n fill: #e9e9e9;\r\n}\r\n\r\n/* Hide non-nuts borders (country boundaries > that are 'other' and not coastal, not candidates, not eu and not efta) */\r\n/* .em--ps g#em-cntbn>.em-bn-oth:not(.em-bn-co):not(.em-bn-cc):not(.em-bn-eu):not(.em-bn-efta) {\r\n stroke-width: 0px;\r\n} */\r\n\r\n/* Coastlines should not be drawn for choropleths, however for prop symbol maps with white regions they can be necessary */\r\n.em--ps .em-bn-co {\r\n stroke: grey;\r\n stroke-width: 0.2px;\r\n}"],sourceRoot:""}]);const M=S},5546(c){function _regeneratorDefine(h,g,m,b){var w=Object.defineProperty;try{w({},"",{})}catch(h){w=0}c.exports=_regeneratorDefine=function regeneratorDefine(c,h,g,m){function o(h,g){_regeneratorDefine(c,h,function(c){return this._invoke(h,g,c)})}h?w?w(c,h,{value:g,enumerable:!m,configurable:!m,writable:!m}):c[h]=g:(o("next",0),o("throw",1),o("return",2))},c.exports.__esModule=!0,c.exports.default=c.exports,_regeneratorDefine(h,g,m,b)}c.exports=_regeneratorDefine,c.exports.__esModule=!0,c.exports.default=c.exports},5869(c,h,g){var m=g(887);c.exports=function _regeneratorAsync(c,h,g,b,w){var S=m(c,h,g,b,w);return S.next().then(function(c){return c.done?c.value:S.next()})},c.exports.__esModule=!0,c.exports.default=c.exports},6314(c){"use strict";c.exports=function(c){var h=[];return h.toString=function toString(){return this.map(function(h){var g="",m=void 0!==h[5];return h[4]&&(g+="@supports (".concat(h[4],") {")),h[2]&&(g+="@media ".concat(h[2]," {")),m&&(g+="@layer".concat(h[5].length>0?" ".concat(h[5]):""," {")),g+=c(h),m&&(g+="}"),h[2]&&(g+="}"),h[4]&&(g+="}"),g}).join("")},h.i=function i(c,g,m,b,w){"string"==typeof c&&(c=[[null,c,void 0]]);var S={};if(m)for(var M=0;M<this.length;M++){var k=this[M][0];null!=k&&(S[k]=!0)}for(var T=0;T<c.length;T++){var E=[].concat(c[T]);m&&S[E[0]]||(void 0!==w&&(void 0===E[5]||(E[1]="@layer".concat(E[5].length>0?" ".concat(E[5]):""," {").concat(E[1],"}")),E[5]=w),g&&(E[2]?(E[1]="@media ".concat(E[2]," {").concat(E[1],"}"),E[2]=g):E[2]=g),b&&(E[4]?(E[1]="@supports (".concat(E[4],") {").concat(E[1],"}"),E[4]=b):E[4]="".concat(b)),h.push(E))}},h}},6923(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,".em-grid-cell {\n fill: #e1e1e1;\n stroke-linecap: round;\n stroke-linejoin: round;\n cursor: pointer !important;\n}\n\n.em--coxcomb .em-grid-cell,\n.em--spark .em-grid-cell {\n /* fill: navajowhite; */\n fill: #fce8cc;\n}\n\n.em--ch .em-grid-cell,\n.em--scomp .em-grid-cell {\n fill: #eeeeee;\n}\n.em-grid-text {\n opacity: 0.75;\n}\n.em-grid-hexagon {\n /* opacity: 0.7; */\n}\n\n.em--coxcomb .em-grid-shape,\n.em--pie .em-grid-shape {\n fill: none;\n stroke: #ccc !important;\n stroke-width: 0px;\n}\n\n/* .em--coxcomb .em-grid-text,\n.em--pie .em-grid-text {\n transform: translate(0, -22px) !important;\n} */\n","",{version:3,sources:["webpack://./src/css/cartogram.css"],names:[],mappings:"AAAA;IACI,aAAa;IACb,qBAAqB;IACrB,sBAAsB;IACtB,0BAA0B;AAC9B;;AAEA;;IAEI,uBAAuB;IACvB,aAAa;AACjB;;AAEA;;IAEI,aAAa;AACjB;AACA;IACI,aAAa;AACjB;AACA;IACI,kBAAkB;AACtB;;AAEA;;IAEI,UAAU;IACV,uBAAuB;IACvB,iBAAiB;AACrB;;AAEA;;;GAGG",sourcesContent:[".em-grid-cell {\r\n fill: #e1e1e1;\r\n stroke-linecap: round;\r\n stroke-linejoin: round;\r\n cursor: pointer !important;\r\n}\r\n\r\n.em--coxcomb .em-grid-cell,\r\n.em--spark .em-grid-cell {\r\n /* fill: navajowhite; */\r\n fill: #fce8cc;\r\n}\r\n\r\n.em--ch .em-grid-cell,\r\n.em--scomp .em-grid-cell {\r\n fill: #eeeeee;\r\n}\r\n.em-grid-text {\r\n opacity: 0.75;\r\n}\r\n.em-grid-hexagon {\r\n /* opacity: 0.7; */\r\n}\r\n\r\n.em--coxcomb .em-grid-shape,\r\n.em--pie .em-grid-shape {\r\n fill: none;\r\n stroke: #ccc !important;\r\n stroke-width: 0px;\r\n}\r\n\r\n/* .em--coxcomb .em-grid-text,\r\n.em--pie .em-grid-text {\r\n transform: translate(0, -22px) !important;\r\n} */\r\n"],sourceRoot:""}]);const M=S},6993(c,h,g){var m=g(5546);function _regenerator(){
|
|
3
3
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
4
|
-
var h,g,b="function"==typeof Symbol?Symbol:{},w=b.iterator||"@@iterator",S=b.toStringTag||"@@toStringTag";function i(c,b,w,S){var k=b&&b.prototype instanceof Generator?b:Generator,T=Object.create(k.prototype);return m(T,"_invoke",function(c,m,b){var w,S,k,T=0,E=b||[],I=!1,P={p:0,n:0,v:h,a:d,f:d.bind(h,4),d:function d(c,g){return w=c,S=0,k=h,P.n=g,M}};function d(c,m){for(S=c,k=m,g=0;!I&&T&&!b&&g<E.length;g++){var b,w=E[g],L=P.p,B=w[2];c>3?(b=B===m)&&(k=w[(S=w[4])?5:(S=3,3)],w[4]=w[5]=h):w[0]<=L&&((b=c<2&&L<w[1])?(S=0,P.v=m,P.n=w[1]):L<B&&(b=c<3||w[0]>m||m>B)&&(w[4]=c,w[5]=m,P.n=B,S=0))}if(b||c>1)return M;throw I=!0,m}return function(b,E,L){if(T>1)throw TypeError("Generator is already running");for(I&&1===E&&d(E,L),S=E,k=L;(g=S<2?h:k)||!I;){w||(S?S<3?(S>1&&(P.n=-1),d(S,k)):P.n=k:P.v=k);try{if(T=2,w){if(S||(b="next"),g=w[b]){if(!(g=g.call(w,k)))throw TypeError("iterator result is not an object");if(!g.done)return g;k=g.value,S<2&&(S=0)}else 1===S&&(g=w.return)&&g.call(w),S<2&&(k=TypeError("The iterator does not provide a '"+b+"' method"),S=1);w=h}else if((g=(I=P.n<0)?k:c.call(m,P))!==M)break}catch(c){w=h,S=1,k=c}finally{T=1}}return{value:g,done:I}}}(c,w,S),!0),T}var M={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}g=Object.getPrototypeOf;var k=[][w]?g(g([][w]())):(m(g={},w,function(){return this}),g),T=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(k);function f(c){return Object.setPrototypeOf?Object.setPrototypeOf(c,GeneratorFunctionPrototype):(c.__proto__=GeneratorFunctionPrototype,m(c,S,"GeneratorFunction")),c.prototype=Object.create(T),c}return GeneratorFunction.prototype=GeneratorFunctionPrototype,m(T,"constructor",GeneratorFunctionPrototype),m(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",m(GeneratorFunctionPrototype,S,"GeneratorFunction"),m(T),m(T,S,"Generator"),m(T,w,function(){return this}),m(T,"toString",function(){return"[object Generator]"}),(c.exports=_regenerator=function _regenerator(){return{w:i,m:f}},c.exports.__esModule=!0,c.exports.default=c.exports)()}c.exports=_regenerator,c.exports.__esModule=!0,c.exports.default=c.exports},7211(c,h,g){"use strict";g.d(h,{A:()=>W});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w),M=g(2489),k=g(9666),T=g(4282),E=g(4470),I=g(4789),P=g(2991),L=g(2875),B=g(765),z=g(358),j=g(2476),D=g(3869),N=g(6923),R=g(781),G=g(654),q=S()(b());q.i(M.A),q.i(k.A),q.i(T.A),q.i(E.A),q.i(I.A),q.i(P.A),q.i(L.A),q.i(B.A),q.i(z.A),q.i(j.A),q.i(D.A),q.i(N.A),q.i(R.A),q.i(G.A),q.push([c.id,"\n","",{version:3,sources:[],names:[],mappings:"",sourceRoot:""}]);const W=q},7549(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,"/* Sparkline maps */\n\n/* muted country boundaries */\n.em--spark .em-cntbn {\n stroke: rgb(163, 163, 163);\n stroke-width: 0.5px;\n}\n\n.em--spark #em-cntbn-halo {\n stroke: none;\n}\n\n/* muted nuts boundaries */\n.em--spark .em-bn-1,\n.em--spark .em-bn-2,\n.em--spark .em-bn-3,\n.em--spark .em-nutsrg [lvl='3'],\n.em--spark .em-nutsrg [lvl='2'],\n.em--spark .em-nutsrg [lvl='1'],\n.em--spark .em-bn-co {\n stroke-width: 0.1px;\n}\n\n/* muted country fill */\n.em--spark .em-cntrg {\n fill: #f2f2f2;\n}\n\n/* nuts fill (regions with data) */\n.em--spark .em-nutsrg {\n fill: #fffeef;\n /*fill: #c9ffd524; very light green */\n /*fill: #fffee724; very light yellow */\n}\n\n/* regions without data input */\n.em--spark [ecl='ni'] {\n fill: #e9e9e9;\n}\n\n/* Hide non-nuts borders (country boundaries > that are 'other' and not coastal, not candidates, not eu and not efta) */\n/* .em--spark g#em-cntbn > .em-bn-oth:not(.em-bn-co):not(.em-bn-cc):not(.em-bn-eu):not(.em-bn-efta) {\n stroke-width: 0px;\n} */\n\n/* Coastlines should not be drawn for choropleths, however for prop symbol maps with white regions they can be necessary */\n.em--spark .em-bn-co {\n stroke: grey;\n stroke-width: 0.2px;\n}\n","",{version:3,sources:["webpack://./src/css/map-types/sparkline.css"],names:[],mappings:"AAAA,mBAAmB;;AAEnB,+BAA+B;AAC/B;IACI,0BAA0B;IAC1B,mBAAmB;AACvB;;AAEA;IACI,YAAY;AAChB;;AAEA,4BAA4B;AAC5B;;;;;;;IAOI,mBAAmB;AACvB;;AAEA,wBAAwB;AACxB;IACI,aAAa;AACjB;;AAEA,mCAAmC;AACnC;IACI,aAAa;IACb,sCAAsC;IACtC,uCAAuC;AAC3C;;AAEA,gCAAgC;AAChC;IACI,aAAa;AACjB;;AAEA,uHAAuH;AACvH;;GAEG;;AAEH,0HAA0H;AAC1H;IACI,YAAY;IACZ,mBAAmB;AACvB",sourcesContent:["/* Sparkline maps */\r\n\r\n/* muted country boundaries */\r\n.em--spark .em-cntbn {\r\n stroke: rgb(163, 163, 163);\r\n stroke-width: 0.5px;\r\n}\r\n\r\n.em--spark #em-cntbn-halo {\r\n stroke: none;\r\n}\r\n\r\n/* muted nuts boundaries */\r\n.em--spark .em-bn-1,\r\n.em--spark .em-bn-2,\r\n.em--spark .em-bn-3,\r\n.em--spark .em-nutsrg [lvl='3'],\r\n.em--spark .em-nutsrg [lvl='2'],\r\n.em--spark .em-nutsrg [lvl='1'],\r\n.em--spark .em-bn-co {\r\n stroke-width: 0.1px;\r\n}\r\n\r\n/* muted country fill */\r\n.em--spark .em-cntrg {\r\n fill: #f2f2f2;\r\n}\r\n\r\n/* nuts fill (regions with data) */\r\n.em--spark .em-nutsrg {\r\n fill: #fffeef;\r\n /*fill: #c9ffd524; very light green */\r\n /*fill: #fffee724; very light yellow */\r\n}\r\n\r\n/* regions without data input */\r\n.em--spark [ecl='ni'] {\r\n fill: #e9e9e9;\r\n}\r\n\r\n/* Hide non-nuts borders (country boundaries > that are 'other' and not coastal, not candidates, not eu and not efta) */\r\n/* .em--spark g#em-cntbn > .em-bn-oth:not(.em-bn-co):not(.em-bn-cc):not(.em-bn-eu):not(.em-bn-efta) {\r\n stroke-width: 0px;\r\n} */\r\n\r\n/* Coastlines should not be drawn for choropleths, however for prop symbol maps with white regions they can be necessary */\r\n.em--spark .em-bn-co {\r\n stroke: grey;\r\n stroke-width: 0.2px;\r\n}\r\n"],sourceRoot:""}]);const M=S},7659(c){"use strict";var h={};c.exports=function insertBySelector(c,g){var m=function getTarget(c){if(void 0===h[c]){var g=document.querySelector(c);if(window.HTMLIFrameElement&&g instanceof window.HTMLIFrameElement)try{g=g.contentDocument.head}catch(c){g=null}h[c]=g}return h[c]}(c);if(!m)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");m.appendChild(g)}},7825(c){"use strict";c.exports=function domAPI(c){if("undefined"==typeof document)return{update:function update(){},remove:function remove(){}};var h=c.insertStyleElement(c);return{update:function update(g){!function apply(c,h,g){var m="";g.supports&&(m+="@supports (".concat(g.supports,") {")),g.media&&(m+="@media ".concat(g.media," {"));var b=void 0!==g.layer;b&&(m+="@layer".concat(g.layer.length>0?" ".concat(g.layer):""," {")),m+=g.css,b&&(m+="}"),g.media&&(m+="}"),g.supports&&(m+="}");var w=g.sourceMap;w&&"undefined"!=typeof btoa&&(m+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(w))))," */")),h.styleTagTransform(m,c,h.options)}(h,c,g)},remove:function remove(){!function removeStyleElement(c){if(null===c.parentNode)return!1;c.parentNode.removeChild(c)}(h)}}}},9666(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,".em-tooltip {\n font-family: Arial;\n color: #383838;\n max-width: 300px;\n overflow: hidden;\n background: white;\n padding: 0px;\n border: 0px;\n border-radius: 0px;\n box-shadow:\n 0px 4px 6px rgba(0, 0, 0, 0.1),\n 0px 1px 3px rgba(0, 0, 0, 0.08);\n position: absolute;\n font-family: Helvetica, Arial, sans-serif;\n pointer-events: none;\n z-index: 99999999;\n}\n.em-tooltip-text {\n background: #ffffff;\n padding: 4px;\n font-size: 15px;\n}\n.em-tooltip-bar {\n background: #515560;\n color: #ffffff;\n padding: 6px;\n font-size: 16px;\n}\n\n.em-footnote-tooltip {\n background: #ffffff;\n padding: 4px;\n font-size: 12px;\n}\n.em-tooltip-table {\n margin: 0px;\n}\n.em-tooltip-piechart-container {\n text-align: center;\n fill: #383838;\n display: flex;\n justify-content: center;\n}\n.em-tooltip-breakdown {\n display: flex;\n flex-direction: column;\n gap: 2px;\n font-size: 13px;\n line-height: 1.2;\n padding: 10px;\n padding-top: 3px;\n}\n\n.em-breakdown-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.em-breakdown-color {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n display: inline-block;\n margin-right: 6px;\n flex-shrink: 0;\n}\n\n.em-breakdown-label {\n flex: 1;\n color: #333;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.em-breakdown-value {\n margin-left: 8px;\n font-weight: 500;\n color: #222;\n white-space: nowrap;\n}\n\n.em-breakdown-item.em-total {\n border-top: 1px solid #ccc;\n margin-top: 3px;\n padding-top: 3px;\n font-weight: bold;\n}\n\n.em-cx-breakdown-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.em-tooltip-cx {\n line-height: 1;\n padding: 0px;\n}\n\n.em-tooltip-cx .em-breakdown-value,\n.em-tooltip-cx .em-breakdown-label,\n.em-tooltip-cx .em-breakdown-color {\n margin: 0;\n font-size: 11px; /* Smaller text for compactness */\n white-space: nowrap;\n}\n\n.em-tooltip-cx-table {\n width: 100%;\n border-collapse: collapse;\n table-layout: fixed;\n}\n\n.em-tooltip-cx-table th,\n.em-tooltip-cx-table td {\n padding: 2px 4px; /* Minimal padding */\n border: 1px solid #eee;\n}\n\n.em-tooltip-cx-table th {\n background: #f7f7f7;\n font-weight: bold;\n font-size: 11px;\n}\n\n.em-tooltip-cx-table td {\n font-size: 11px;\n white-space: nowrap;\n}\n\n/* Make the Total value bold and right-aligned */\n.em-tooltip-cx-table .em-total td[colspan] {\n text-align: right;\n font-weight: bold !important;\n}\n\n/* Also make the inner number span bold */\n.em-tooltip-cx-table .em-total td[colspan] .em-breakdown-value {\n font-weight: bold !important;\n}\n.em-total {\n font-weight: bold !important;\n}\n","",{version:3,sources:["webpack://./src/css/tooltip.css"],names:[],mappings:"AAAA;IACI,kBAAkB;IAClB,cAAc;IACd,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB,YAAY;IACZ,WAAW;IACX,kBAAkB;IAClB;;uCAEmC;IACnC,kBAAkB;IAClB,yCAAyC;IACzC,oBAAoB;IACpB,iBAAiB;AACrB;AACA;IACI,mBAAmB;IACnB,YAAY;IACZ,eAAe;AACnB;AACA;IACI,mBAAmB;IACnB,cAAc;IACd,YAAY;IACZ,eAAe;AACnB;;AAEA;IACI,mBAAmB;IACnB,YAAY;IACZ,eAAe;AACnB;AACA;IACI,WAAW;AACf;AACA;IACI,kBAAkB;IAClB,aAAa;IACb,aAAa;IACb,uBAAuB;AAC3B;AACA;IACI,aAAa;IACb,sBAAsB;IACtB,QAAQ;IACR,eAAe;IACf,gBAAgB;IAChB,aAAa;IACb,gBAAgB;AACpB;;AAEA;IACI,aAAa;IACb,mBAAmB;IACnB,8BAA8B;AAClC;;AAEA;IACI,UAAU;IACV,WAAW;IACX,kBAAkB;IAClB,qBAAqB;IACrB,iBAAiB;IACjB,cAAc;AAClB;;AAEA;IACI,OAAO;IACP,WAAW;IACX,mBAAmB;IACnB,gBAAgB;IAChB,uBAAuB;AAC3B;;AAEA;IACI,gBAAgB;IAChB,gBAAgB;IAChB,WAAW;IACX,mBAAmB;AACvB;;AAEA;IACI,0BAA0B;IAC1B,eAAe;IACf,gBAAgB;IAChB,iBAAiB;AACrB;;AAEA;IACI,aAAa;IACb,mBAAmB;IACnB,8BAA8B;AAClC;;AAEA;IACI,cAAc;IACd,YAAY;AAChB;;AAEA;;;IAGI,SAAS;IACT,eAAe,EAAE,iCAAiC;IAClD,mBAAmB;AACvB;;AAEA;IACI,WAAW;IACX,yBAAyB;IACzB,mBAAmB;AACvB;;AAEA;;IAEI,gBAAgB,EAAE,oBAAoB;IACtC,sBAAsB;AAC1B;;AAEA;IACI,mBAAmB;IACnB,iBAAiB;IACjB,eAAe;AACnB;;AAEA;IACI,eAAe;IACf,mBAAmB;AACvB;;AAEA,gDAAgD;AAChD;IACI,iBAAiB;IACjB,4BAA4B;AAChC;;AAEA,yCAAyC;AACzC;IACI,4BAA4B;AAChC;AACA;IACI,4BAA4B;AAChC",sourcesContent:[".em-tooltip {\r\n font-family: Arial;\r\n color: #383838;\r\n max-width: 300px;\r\n overflow: hidden;\r\n background: white;\r\n padding: 0px;\r\n border: 0px;\r\n border-radius: 0px;\r\n box-shadow:\r\n 0px 4px 6px rgba(0, 0, 0, 0.1),\r\n 0px 1px 3px rgba(0, 0, 0, 0.08);\r\n position: absolute;\r\n font-family: Helvetica, Arial, sans-serif;\r\n pointer-events: none;\r\n z-index: 99999999;\r\n}\r\n.em-tooltip-text {\r\n background: #ffffff;\r\n padding: 4px;\r\n font-size: 15px;\r\n}\r\n.em-tooltip-bar {\r\n background: #515560;\r\n color: #ffffff;\r\n padding: 6px;\r\n font-size: 16px;\r\n}\r\n\r\n.em-footnote-tooltip {\r\n background: #ffffff;\r\n padding: 4px;\r\n font-size: 12px;\r\n}\r\n.em-tooltip-table {\r\n margin: 0px;\r\n}\r\n.em-tooltip-piechart-container {\r\n text-align: center;\r\n fill: #383838;\r\n display: flex;\r\n justify-content: center;\r\n}\r\n.em-tooltip-breakdown {\r\n display: flex;\r\n flex-direction: column;\r\n gap: 2px;\r\n font-size: 13px;\r\n line-height: 1.2;\r\n padding: 10px;\r\n padding-top: 3px;\r\n}\r\n\r\n.em-breakdown-item {\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n}\r\n\r\n.em-breakdown-color {\r\n width: 8px;\r\n height: 8px;\r\n border-radius: 50%;\r\n display: inline-block;\r\n margin-right: 6px;\r\n flex-shrink: 0;\r\n}\r\n\r\n.em-breakdown-label {\r\n flex: 1;\r\n color: #333;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n}\r\n\r\n.em-breakdown-value {\r\n margin-left: 8px;\r\n font-weight: 500;\r\n color: #222;\r\n white-space: nowrap;\r\n}\r\n\r\n.em-breakdown-item.em-total {\r\n border-top: 1px solid #ccc;\r\n margin-top: 3px;\r\n padding-top: 3px;\r\n font-weight: bold;\r\n}\r\n\r\n.em-cx-breakdown-item {\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n}\r\n\r\n.em-tooltip-cx {\r\n line-height: 1;\r\n padding: 0px;\r\n}\r\n\r\n.em-tooltip-cx .em-breakdown-value,\r\n.em-tooltip-cx .em-breakdown-label,\r\n.em-tooltip-cx .em-breakdown-color {\r\n margin: 0;\r\n font-size: 11px; /* Smaller text for compactness */\r\n white-space: nowrap;\r\n}\r\n\r\n.em-tooltip-cx-table {\r\n width: 100%;\r\n border-collapse: collapse;\r\n table-layout: fixed;\r\n}\r\n\r\n.em-tooltip-cx-table th,\r\n.em-tooltip-cx-table td {\r\n padding: 2px 4px; /* Minimal padding */\r\n border: 1px solid #eee;\r\n}\r\n\r\n.em-tooltip-cx-table th {\r\n background: #f7f7f7;\r\n font-weight: bold;\r\n font-size: 11px;\r\n}\r\n\r\n.em-tooltip-cx-table td {\r\n font-size: 11px;\r\n white-space: nowrap;\r\n}\r\n\r\n/* Make the Total value bold and right-aligned */\r\n.em-tooltip-cx-table .em-total td[colspan] {\r\n text-align: right;\r\n font-weight: bold !important;\r\n}\r\n\r\n/* Also make the inner number span bold */\r\n.em-tooltip-cx-table .em-total td[colspan] .em-breakdown-value {\r\n font-weight: bold !important;\r\n}\r\n.em-total {\r\n font-weight: bold !important;\r\n}\r\n"],sourceRoot:""}]);const M=S},9971(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,".em-tooltip-wafflechart-container {\n max-width: 150px;\n}\n","",{version:3,sources:["webpack://./src/css/map-types/waffle.css"],names:[],mappings:"AAAA;IACI,gBAAgB;AACpB",sourcesContent:[".em-tooltip-wafflechart-container {\r\n max-width: 150px;\r\n}\r\n"],sourceRoot:""}]);const M=S}},h={};function __webpack_require__(g){var m=h[g];if(void 0!==m)return m.exports;var b=h[g]={id:g,exports:{}};return c[g](b,b.exports,__webpack_require__),b.exports}__webpack_require__.m=c,__webpack_require__.n=c=>{var h=c&&c.__esModule?()=>c.default:()=>c;return __webpack_require__.d(h,{a:h}),h},__webpack_require__.d=(c,h)=>{for(var g in h)__webpack_require__.o(h,g)&&!__webpack_require__.o(c,g)&&Object.defineProperty(c,g,{enumerable:!0,get:h[g]})},__webpack_require__.u=c=>c+".eurostatmap.min.js",__webpack_require__.o=(c,h)=>Object.prototype.hasOwnProperty.call(c,h),__webpack_require__.r=c=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})},__webpack_require__.p="/build/",__webpack_require__.b="undefined"!=typeof document&&document.baseURI||self.location.href,__webpack_require__.nc=void 0;var g={};return(()=>{"use strict";__webpack_require__.r(g),__webpack_require__.d(g,{getDefaultLabels:()=>Mc,getFillPatternDefinitionFun:()=>Sc,getFillPatternDefinitionFunction:()=>Cc,map:()=>wc,version:()=>kc});var c=__webpack_require__(5072),h=__webpack_require__.n(c),m=__webpack_require__(7825),b=__webpack_require__.n(m),w=__webpack_require__(7659),S=__webpack_require__.n(w),M=__webpack_require__(5056),k=__webpack_require__.n(M),T=__webpack_require__(540),E=__webpack_require__.n(T),I=__webpack_require__(1113),P=__webpack_require__.n(I),L=__webpack_require__(7211),B={};B.styleTagTransform=P(),B.setAttributes=k(),B.insert=S().bind(null,"head"),B.domAPI=b(),B.insertStyleElement=E();h()(L.A,B);L.A&&L.A.locals&&L.A.locals;function _arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function _unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return _arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?_arrayLikeToArray(c,h):void 0}}function slicedToArray_slicedToArray(c,h){return function _arrayWithHoles(c){if(Array.isArray(c))return c}(c)||function _iterableToArrayLimit(c,h){var g=null==c?null:"undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(null!=g){var m,b,w,S,M=[],k=!0,T=!1;try{if(w=(g=g.call(c)).next,0===h){if(Object(g)!==g)return;k=!1}else for(;!(k=(m=w.call(g)).done)&&(M.push(m.value),M.length!==h);k=!0);}catch(c){T=!0,b=c}finally{try{if(!k&&null!=g.return&&(S=g.return(),Object(S)!==S))return}finally{if(T)throw b}}return M}}(c,h)||_unsupportedIterableToArray(c,h)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function toConsumableArray_toConsumableArray(c){return function _arrayWithoutHoles(c){if(Array.isArray(c))return _arrayLikeToArray(c)}(c)||function _iterableToArray(c){if("undefined"!=typeof Symbol&&null!=c[Symbol.iterator]||null!=c["@@iterator"])return Array.from(c)}(c)||_unsupportedIterableToArray(c)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function none(){}function selector(c){return null==c?none:function(){return this.querySelector(c)}}function array(c){return null==c?[]:Array.isArray(c)?c:Array.from(c)}function empty(){return[]}function selectorAll(c){return null==c?empty:function(){return this.querySelectorAll(c)}}function matcher(c){return function(){return this.matches(c)}}function childMatcher(c){return function(h){return h.matches(c)}}var z=Array.prototype.find;function childFirst(){return this.firstElementChild}var j=Array.prototype.filter;function children(){return Array.from(this.children)}function sparse(c){return new Array(c.length)}function EnterNode(c,h){this.ownerDocument=c.ownerDocument,this.namespaceURI=c.namespaceURI,this._next=null,this._parent=c,this.__data__=h}function bindIndex(c,h,g,m,b,w){for(var S,M=0,k=h.length,T=w.length;M<T;++M)(S=h[M])?(S.__data__=w[M],m[M]=S):g[M]=new EnterNode(c,w[M]);for(;M<k;++M)(S=h[M])&&(b[M]=S)}function bindKey(c,h,g,m,b,w,S){var M,k,T,E=new Map,I=h.length,P=w.length,L=new Array(I);for(M=0;M<I;++M)(k=h[M])&&(L[M]=T=S.call(k,k.__data__,M,h)+"",E.has(T)?b[M]=k:E.set(T,k));for(M=0;M<P;++M)T=S.call(c,w[M],M,w)+"",(k=E.get(T))?(m[M]=k,k.__data__=w[M],E.delete(T)):g[M]=new EnterNode(c,w[M]);for(M=0;M<I;++M)(k=h[M])&&E.get(L[M])===k&&(b[M]=k)}function datum(c){return c.__data__}function arraylike(c){return"object"==typeof c&&"length"in c?c:Array.from(c)}function ascending(c,h){return c<h?-1:c>h?1:c>=h?0:NaN}EnterNode.prototype={constructor:EnterNode,appendChild:function(c){return this._parent.insertBefore(c,this._next)},insertBefore:function(c,h){return this._parent.insertBefore(c,h)},querySelector:function(c){return this._parent.querySelector(c)},querySelectorAll:function(c){return this._parent.querySelectorAll(c)}};var D="http://www.w3.org/1999/xhtml";const N={svg:"http://www.w3.org/2000/svg",xhtml:D,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function namespace(c){var h=c+="",g=h.indexOf(":");return g>=0&&"xmlns"!==(h=c.slice(0,g))&&(c=c.slice(g+1)),N.hasOwnProperty(h)?{space:N[h],local:c}:c}function attrRemove(c){return function(){this.removeAttribute(c)}}function attrRemoveNS(c){return function(){this.removeAttributeNS(c.space,c.local)}}function attrConstant(c,h){return function(){this.setAttribute(c,h)}}function attrConstantNS(c,h){return function(){this.setAttributeNS(c.space,c.local,h)}}function attrFunction(c,h){return function(){var g=h.apply(this,arguments);null==g?this.removeAttribute(c):this.setAttribute(c,g)}}function attrFunctionNS(c,h){return function(){var g=h.apply(this,arguments);null==g?this.removeAttributeNS(c.space,c.local):this.setAttributeNS(c.space,c.local,g)}}function src_window(c){return c.ownerDocument&&c.ownerDocument.defaultView||c.document&&c||c.defaultView}function styleRemove(c){return function(){this.style.removeProperty(c)}}function styleConstant(c,h,g){return function(){this.style.setProperty(c,h,g)}}function styleFunction(c,h,g){return function(){var m=h.apply(this,arguments);null==m?this.style.removeProperty(c):this.style.setProperty(c,m,g)}}function styleValue(c,h){return c.style.getPropertyValue(h)||src_window(c).getComputedStyle(c,null).getPropertyValue(h)}function propertyRemove(c){return function(){delete this[c]}}function propertyConstant(c,h){return function(){this[c]=h}}function propertyFunction(c,h){return function(){var g=h.apply(this,arguments);null==g?delete this[c]:this[c]=g}}function classArray(c){return c.trim().split(/^|\s+/)}function classList(c){return c.classList||new ClassList(c)}function ClassList(c){this._node=c,this._names=classArray(c.getAttribute("class")||"")}function classedAdd(c,h){for(var g=classList(c),m=-1,b=h.length;++m<b;)g.add(h[m])}function classedRemove(c,h){for(var g=classList(c),m=-1,b=h.length;++m<b;)g.remove(h[m])}function classedTrue(c){return function(){classedAdd(this,c)}}function classedFalse(c){return function(){classedRemove(this,c)}}function classedFunction(c,h){return function(){(h.apply(this,arguments)?classedAdd:classedRemove)(this,c)}}function textRemove(){this.textContent=""}function textConstant(c){return function(){this.textContent=c}}function textFunction(c){return function(){var h=c.apply(this,arguments);this.textContent=null==h?"":h}}function htmlRemove(){this.innerHTML=""}function htmlConstant(c){return function(){this.innerHTML=c}}function htmlFunction(c){return function(){var h=c.apply(this,arguments);this.innerHTML=null==h?"":h}}function raise(){this.nextSibling&&this.parentNode.appendChild(this)}function lower(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function creatorInherit(c){return function(){var h=this.ownerDocument,g=this.namespaceURI;return g===D&&h.documentElement.namespaceURI===D?h.createElement(c):h.createElementNS(g,c)}}function creatorFixed(c){return function(){return this.ownerDocument.createElementNS(c.space,c.local)}}function src_creator(c){var h=namespace(c);return(h.local?creatorFixed:creatorInherit)(h)}function constantNull(){return null}function remove(){var c=this.parentNode;c&&c.removeChild(this)}function selection_cloneShallow(){var c=this.cloneNode(!1),h=this.parentNode;return h?h.insertBefore(c,this.nextSibling):c}function selection_cloneDeep(){var c=this.cloneNode(!0),h=this.parentNode;return h?h.insertBefore(c,this.nextSibling):c}function onRemove(c){return function(){var h=this.__on;if(h){for(var g,m=0,b=-1,w=h.length;m<w;++m)g=h[m],c.type&&g.type!==c.type||g.name!==c.name?h[++b]=g:this.removeEventListener(g.type,g.listener,g.options);++b?h.length=b:delete this.__on}}}function onAdd(c,h,g){return function(){var m,b=this.__on,w=function contextListener(c){return function(h){c.call(this,h,this.__data__)}}(h);if(b)for(var S=0,M=b.length;S<M;++S)if((m=b[S]).type===c.type&&m.name===c.name)return this.removeEventListener(m.type,m.listener,m.options),this.addEventListener(m.type,m.listener=w,m.options=g),void(m.value=h);this.addEventListener(c.type,w,g),m={type:c.type,name:c.name,value:h,listener:w,options:g},b?b.push(m):this.__on=[m]}}function dispatchEvent(c,h,g){var m=src_window(c),b=m.CustomEvent;"function"==typeof b?b=new b(h,g):(b=m.document.createEvent("Event"),g?(b.initEvent(h,g.bubbles,g.cancelable),b.detail=g.detail):b.initEvent(h,!1,!1)),c.dispatchEvent(b)}function dispatchConstant(c,h){return function(){return dispatchEvent(this,c,h)}}function dispatchFunction(c,h){return function(){return dispatchEvent(this,c,h.apply(this,arguments))}}ClassList.prototype={add:function(c){this._names.indexOf(c)<0&&(this._names.push(c),this._node.setAttribute("class",this._names.join(" ")))},remove:function(c){var h=this._names.indexOf(c);h>=0&&(this._names.splice(h,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(c){return this._names.indexOf(c)>=0}};var R=[null];function selection_Selection(c,h){this._groups=c,this._parents=h}function selection(){return new selection_Selection([[document.documentElement]],R)}selection_Selection.prototype=selection.prototype={constructor:selection_Selection,select:function selection_select(c){"function"!=typeof c&&(c=selector(c));for(var h=this._groups,g=h.length,m=new Array(g),b=0;b<g;++b)for(var w,S,M=h[b],k=M.length,T=m[b]=new Array(k),E=0;E<k;++E)(w=M[E])&&(S=c.call(w,w.__data__,E,M))&&("__data__"in w&&(S.__data__=w.__data__),T[E]=S);return new selection_Selection(m,this._parents)},selectAll:function selectAll(c){c="function"==typeof c?function arrayAll(c){return function(){return array(c.apply(this,arguments))}}(c):selectorAll(c);for(var h=this._groups,g=h.length,m=[],b=[],w=0;w<g;++w)for(var S,M=h[w],k=M.length,T=0;T<k;++T)(S=M[T])&&(m.push(c.call(S,S.__data__,T,M)),b.push(S));return new selection_Selection(m,b)},selectChild:function selectChild(c){return this.select(null==c?childFirst:function childFind(c){return function(){return z.call(this.children,c)}}("function"==typeof c?c:childMatcher(c)))},selectChildren:function selectChildren(c){return this.selectAll(null==c?children:function childrenFilter(c){return function(){return j.call(this.children,c)}}("function"==typeof c?c:childMatcher(c)))},filter:function selection_filter(c){"function"!=typeof c&&(c=matcher(c));for(var h=this._groups,g=h.length,m=new Array(g),b=0;b<g;++b)for(var w,S=h[b],M=S.length,k=m[b]=[],T=0;T<M;++T)(w=S[T])&&c.call(w,w.__data__,T,S)&&k.push(w);return new selection_Selection(m,this._parents)},data:function data(c,h){if(!arguments.length)return Array.from(this,datum);var g=h?bindKey:bindIndex,m=this._parents,b=this._groups;"function"!=typeof c&&(c=function src_constant(c){return function(){return c}}(c));for(var w=b.length,S=new Array(w),M=new Array(w),k=new Array(w),T=0;T<w;++T){var E=m[T],I=b[T],P=I.length,L=arraylike(c.call(E,E&&E.__data__,T,m)),B=L.length,z=M[T]=new Array(B),j=S[T]=new Array(B);g(E,I,z,j,k[T]=new Array(P),L,h);for(var D,N,R=0,G=0;R<B;++R)if(D=z[R]){for(R>=G&&(G=R+1);!(N=j[G])&&++G<B;);D._next=N||null}}return(S=new selection_Selection(S,m))._enter=M,S._exit=k,S},enter:function enter(){return new selection_Selection(this._enter||this._groups.map(sparse),this._parents)},exit:function exit(){return new selection_Selection(this._exit||this._groups.map(sparse),this._parents)},join:function join(c,h,g){var m=this.enter(),b=this,w=this.exit();return"function"==typeof c?(m=c(m))&&(m=m.selection()):m=m.append(c+""),null!=h&&(b=h(b))&&(b=b.selection()),null==g?w.remove():g(w),m&&b?m.merge(b).order():b},merge:function merge(c){for(var h=c.selection?c.selection():c,g=this._groups,m=h._groups,b=g.length,w=m.length,S=Math.min(b,w),M=new Array(b),k=0;k<S;++k)for(var T,E=g[k],I=m[k],P=E.length,L=M[k]=new Array(P),B=0;B<P;++B)(T=E[B]||I[B])&&(L[B]=T);for(;k<b;++k)M[k]=g[k];return new selection_Selection(M,this._parents)},selection:function selection_selection(){return this},order:function order(){for(var c=this._groups,h=-1,g=c.length;++h<g;)for(var m,b=c[h],w=b.length-1,S=b[w];--w>=0;)(m=b[w])&&(S&&4^m.compareDocumentPosition(S)&&S.parentNode.insertBefore(m,S),S=m);return this},sort:function sort(c){function compareNode(h,g){return h&&g?c(h.__data__,g.__data__):!h-!g}c||(c=ascending);for(var h=this._groups,g=h.length,m=new Array(g),b=0;b<g;++b){for(var w,S=h[b],M=S.length,k=m[b]=new Array(M),T=0;T<M;++T)(w=S[T])&&(k[T]=w);k.sort(compareNode)}return new selection_Selection(m,this._parents).order()},call:function call(){var c=arguments[0];return arguments[0]=this,c.apply(null,arguments),this},nodes:function nodes(){return Array.from(this)},node:function node(){for(var c=this._groups,h=0,g=c.length;h<g;++h)for(var m=c[h],b=0,w=m.length;b<w;++b){var S=m[b];if(S)return S}return null},size:function size(){let c=0;for(const h of this)++c;return c},empty:function selection_empty(){return!this.node()},each:function each(c){for(var h=this._groups,g=0,m=h.length;g<m;++g)for(var b,w=h[g],S=0,M=w.length;S<M;++S)(b=w[S])&&c.call(b,b.__data__,S,w);return this},attr:function attr(c,h){var g=namespace(c);if(arguments.length<2){var m=this.node();return g.local?m.getAttributeNS(g.space,g.local):m.getAttribute(g)}return this.each((null==h?g.local?attrRemoveNS:attrRemove:"function"==typeof h?g.local?attrFunctionNS:attrFunction:g.local?attrConstantNS:attrConstant)(g,h))},style:function style(c,h,g){return arguments.length>1?this.each((null==h?styleRemove:"function"==typeof h?styleFunction:styleConstant)(c,h,null==g?"":g)):styleValue(this.node(),c)},property:function property(c,h){return arguments.length>1?this.each((null==h?propertyRemove:"function"==typeof h?propertyFunction:propertyConstant)(c,h)):this.node()[c]},classed:function classed(c,h){var g=classArray(c+"");if(arguments.length<2){for(var m=classList(this.node()),b=-1,w=g.length;++b<w;)if(!m.contains(g[b]))return!1;return!0}return this.each(("function"==typeof h?classedFunction:h?classedTrue:classedFalse)(g,h))},text:function selection_text(c){return arguments.length?this.each(null==c?textRemove:("function"==typeof c?textFunction:textConstant)(c)):this.node().textContent},html:function html(c){return arguments.length?this.each(null==c?htmlRemove:("function"==typeof c?htmlFunction:htmlConstant)(c)):this.node().innerHTML},raise:function selection_raise(){return this.each(raise)},lower:function selection_lower(){return this.each(lower)},append:function append(c){var h="function"==typeof c?c:src_creator(c);return this.select(function(){return this.appendChild(h.apply(this,arguments))})},insert:function insert(c,h){var g="function"==typeof c?c:src_creator(c),m=null==h?constantNull:"function"==typeof h?h:selector(h);return this.select(function(){return this.insertBefore(g.apply(this,arguments),m.apply(this,arguments)||null)})},remove:function selection_remove(){return this.each(remove)},clone:function clone(c){return this.select(c?selection_cloneDeep:selection_cloneShallow)},datum:function selection_datum(c){return arguments.length?this.property("__data__",c):this.node().__data__},on:function on(c,h,g){var m,b,w=function parseTypenames(c){return c.trim().split(/^|\s+/).map(function(c){var h="",g=c.indexOf(".");return g>=0&&(h=c.slice(g+1),c=c.slice(0,g)),{type:c,name:h}})}(c+""),S=w.length;if(!(arguments.length<2)){for(M=h?onAdd:onRemove,m=0;m<S;++m)this.each(M(w[m],h,g));return this}var M=this.node().__on;if(M)for(var k,T=0,E=M.length;T<E;++T)for(m=0,k=M[T];m<S;++m)if((b=w[m]).type===k.type&&b.name===k.name)return k.value},dispatch:function dispatch(c,h){return this.each(("function"==typeof h?dispatchFunction:dispatchConstant)(c,h))},[Symbol.iterator]:function*iterator(){for(var c=this._groups,h=0,g=c.length;h<g;++h)for(var m,b=c[h],w=0,S=b.length;w<S;++w)(m=b[w])&&(yield m)}};const G=selection;function src_select(c){return"string"==typeof c?new selection_Selection([[document.querySelector(c)]],[document.documentElement]):new selection_Selection([[c]],R)}function min_min(c,h){let g;if(void 0===h)for(const h of c)null!=h&&(g>h||void 0===g&&h>=h)&&(g=h);else{let m=-1;for(let b of c)null!=(b=h(b,++m,c))&&(g>b||void 0===g&&b>=b)&&(g=b)}return g}function max_max(c,h){let g;if(void 0===h)for(const h of c)null!=h&&(g<h||void 0===g&&h>=h)&&(g=h);else{let m=-1;for(let b of c)null!=(b=h(b,++m,c))&&(g<b||void 0===g&&b>=b)&&(g=b)}return g}function number_number(c){return null===c?NaN:+c}function quantileSorted(c,h,g=number_number){if((m=c.length)&&!isNaN(h=+h)){if(h<=0||m<2)return+g(c[0],0,c);if(h>=1)return+g(c[m-1],m-1,c);var m,b=(m-1)*h,w=Math.floor(b),S=+g(c[w],w,c);return S+(+g(c[w+1],w+1,c)-S)*(b-w)}}function ascending_ascending(c,h){return null==c||null==h?NaN:c<h?-1:c>h?1:c>=h?0:NaN}function descending_descending(c,h){return null==c||null==h?NaN:h<c?-1:h>c?1:h>=c?0:NaN}function bisector(c){let h,g,m;function left(c,m,b=0,w=c.length){if(b<w){if(0!==h(m,m))return w;do{const h=b+w>>>1;g(c[h],m)<0?b=h+1:w=h}while(b<w)}return b}return 2!==c.length?(h=ascending_ascending,g=(h,g)=>ascending_ascending(c(h),g),m=(h,g)=>c(h)-g):(h=c===ascending_ascending||c===descending_descending?c:zero,g=c,m=c),{left,center:function center(c,h,g=0,b=c.length){const w=left(c,h,g,b-1);return w>g&&m(c[w-1],h)>-m(c[w],h)?w-1:w},right:function right(c,m,b=0,w=c.length){if(b<w){if(0!==h(m,m))return w;do{const h=b+w>>>1;g(c[h],m)<=0?b=h+1:w=h}while(b<w)}return b}}}function zero(){return 0}const q=bisector(ascending_ascending),W=q.right,H=(q.left,bisector(number_number).center,W);function initRange(c,h){switch(arguments.length){case 0:break;case 1:this.range(c);break;default:this.range(h).domain(c)}return this}function quantile_quantile(){var c,h=[],g=[],m=[];function rescale(){var c=0,b=Math.max(1,g.length);for(m=new Array(b-1);++c<b;)m[c-1]=quantileSorted(h,c/b);return scale}function scale(h){return null==h||isNaN(h=+h)?c:g[H(m,h)]}return scale.invertExtent=function(c){var b=g.indexOf(c);return b<0?[NaN,NaN]:[b>0?m[b-1]:h[0],b<m.length?m[b]:h[h.length-1]]},scale.domain=function(c){if(!arguments.length)return h.slice();h=[];for(let g of c)null==g||isNaN(g=+g)||h.push(g);return h.sort(ascending_ascending),rescale()},scale.range=function(c){return arguments.length?(g=Array.from(c),rescale()):g.slice()},scale.unknown=function(h){return arguments.length?(c=h,scale):c},scale.quantiles=function(){return m.slice()},scale.copy=function(){return quantile_quantile().domain(h).range(g).unknown(c)},initRange.apply(scale,arguments)}const U=Math.sqrt(50),Y=Math.sqrt(10),V=Math.sqrt(2);function tickSpec(c,h,g){const m=(h-c)/Math.max(0,g),b=Math.floor(Math.log10(m)),w=m/Math.pow(10,b),S=w>=U?10:w>=Y?5:w>=V?2:1;let M,k,T;return b<0?(T=Math.pow(10,-b)/S,M=Math.round(c*T),k=Math.round(h*T),M/T<c&&++M,k/T>h&&--k,T=-T):(T=Math.pow(10,b)*S,M=Math.round(c/T),k=Math.round(h/T),M*T<c&&++M,k*T>h&&--k),k<M&&.5<=g&&g<2?tickSpec(c,h,2*g):[M,k,T]}function tickIncrement(c,h,g){return tickSpec(c=+c,h=+h,g=+g)[2]}function src_define(c,h,g){c.prototype=h.prototype=g,g.constructor=c}function extend(c,h){var g=Object.create(c.prototype);for(var m in h)g[m]=h[m];return g}function Color(){}var $=.7,X=1/$,K="\\s*([+-]?\\d+)\\s*",Z="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",J="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Q=/^#([0-9a-f]{3,8})$/,tt=new RegExp(`^rgb\\(${K},${K},${K}\\)$`),et=new RegExp(`^rgb\\(${J},${J},${J}\\)$`),nt=new RegExp(`^rgba\\(${K},${K},${K},${Z}\\)$`),rt=new RegExp(`^rgba\\(${J},${J},${J},${Z}\\)$`),ot=new RegExp(`^hsl\\(${Z},${J},${J}\\)$`),at=new RegExp(`^hsla\\(${Z},${J},${J},${Z}\\)$`),it={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function color_formatHex(){return this.rgb().formatHex()}function color_formatRgb(){return this.rgb().formatRgb()}function color_color(c){var h,g;return c=(c+"").trim().toLowerCase(),(h=Q.exec(c))?(g=h[1].length,h=parseInt(h[1],16),6===g?rgbn(h):3===g?new Rgb(h>>8&15|h>>4&240,h>>4&15|240&h,(15&h)<<4|15&h,1):8===g?rgba(h>>24&255,h>>16&255,h>>8&255,(255&h)/255):4===g?rgba(h>>12&15|h>>8&240,h>>8&15|h>>4&240,h>>4&15|240&h,((15&h)<<4|15&h)/255):null):(h=tt.exec(c))?new Rgb(h[1],h[2],h[3],1):(h=et.exec(c))?new Rgb(255*h[1]/100,255*h[2]/100,255*h[3]/100,1):(h=nt.exec(c))?rgba(h[1],h[2],h[3],h[4]):(h=rt.exec(c))?rgba(255*h[1]/100,255*h[2]/100,255*h[3]/100,h[4]):(h=ot.exec(c))?hsla(h[1],h[2]/100,h[3]/100,1):(h=at.exec(c))?hsla(h[1],h[2]/100,h[3]/100,h[4]):it.hasOwnProperty(c)?rgbn(it[c]):"transparent"===c?new Rgb(NaN,NaN,NaN,0):null}function rgbn(c){return new Rgb(c>>16&255,c>>8&255,255&c,1)}function rgba(c,h,g,m){return m<=0&&(c=h=g=NaN),new Rgb(c,h,g,m)}function rgbConvert(c){return c instanceof Color||(c=color_color(c)),c?new Rgb((c=c.rgb()).r,c.g,c.b,c.opacity):new Rgb}function color_rgb(c,h,g,m){return 1===arguments.length?rgbConvert(c):new Rgb(c,h,g,null==m?1:m)}function Rgb(c,h,g,m){this.r=+c,this.g=+h,this.b=+g,this.opacity=+m}function rgb_formatHex(){return`#${hex(this.r)}${hex(this.g)}${hex(this.b)}`}function rgb_formatRgb(){const c=clampa(this.opacity);return`${1===c?"rgb(":"rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${1===c?")":`, ${c})`}`}function clampa(c){return isNaN(c)?1:Math.max(0,Math.min(1,c))}function clampi(c){return Math.max(0,Math.min(255,Math.round(c)||0))}function hex(c){return((c=clampi(c))<16?"0":"")+c.toString(16)}function hsla(c,h,g,m){return m<=0?c=h=g=NaN:g<=0||g>=1?c=h=NaN:h<=0&&(c=NaN),new Hsl(c,h,g,m)}function hslConvert(c){if(c instanceof Hsl)return new Hsl(c.h,c.s,c.l,c.opacity);if(c instanceof Color||(c=color_color(c)),!c)return new Hsl;if(c instanceof Hsl)return c;var h=(c=c.rgb()).r/255,g=c.g/255,m=c.b/255,b=Math.min(h,g,m),w=Math.max(h,g,m),S=NaN,M=w-b,k=(w+b)/2;return M?(S=h===w?(g-m)/M+6*(g<m):g===w?(m-h)/M+2:(h-g)/M+4,M/=k<.5?w+b:2-w-b,S*=60):M=k>0&&k<1?0:S,new Hsl(S,M,k,c.opacity)}function Hsl(c,h,g,m){this.h=+c,this.s=+h,this.l=+g,this.opacity=+m}function clamph(c){return(c=(c||0)%360)<0?c+360:c}function clampt(c){return Math.max(0,Math.min(1,c||0))}function hsl2rgb(c,h,g){return 255*(c<60?h+(g-h)*c/60:c<180?g:c<240?h+(g-h)*(240-c)/60:h)}function basis(c,h,g,m,b){var w=c*c,S=w*c;return((1-3*c+3*w-S)*h+(4-6*w+3*S)*g+(1+3*c+3*w-3*S)*m+S*b)/6}src_define(Color,color_color,{copy(c){return Object.assign(new this.constructor,this,c)},displayable(){return this.rgb().displayable()},hex:color_formatHex,formatHex:color_formatHex,formatHex8:function color_formatHex8(){return this.rgb().formatHex8()},formatHsl:function color_formatHsl(){return hslConvert(this).formatHsl()},formatRgb:color_formatRgb,toString:color_formatRgb}),src_define(Rgb,color_rgb,extend(Color,{brighter(c){return c=null==c?X:Math.pow(X,c),new Rgb(this.r*c,this.g*c,this.b*c,this.opacity)},darker(c){return c=null==c?$:Math.pow($,c),new Rgb(this.r*c,this.g*c,this.b*c,this.opacity)},rgb(){return this},clamp(){return new Rgb(clampi(this.r),clampi(this.g),clampi(this.b),clampa(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rgb_formatHex,formatHex:rgb_formatHex,formatHex8:function rgb_formatHex8(){return`#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:rgb_formatRgb,toString:rgb_formatRgb})),src_define(Hsl,function hsl(c,h,g,m){return 1===arguments.length?hslConvert(c):new Hsl(c,h,g,null==m?1:m)},extend(Color,{brighter(c){return c=null==c?X:Math.pow(X,c),new Hsl(this.h,this.s,this.l*c,this.opacity)},darker(c){return c=null==c?$:Math.pow($,c),new Hsl(this.h,this.s,this.l*c,this.opacity)},rgb(){var c=this.h%360+360*(this.h<0),h=isNaN(c)||isNaN(this.s)?0:this.s,g=this.l,m=g+(g<.5?g:1-g)*h,b=2*g-m;return new Rgb(hsl2rgb(c>=240?c-240:c+120,b,m),hsl2rgb(c,b,m),hsl2rgb(c<120?c+240:c-120,b,m),this.opacity)},clamp(){return new Hsl(clamph(this.h),clampt(this.s),clampt(this.l),clampa(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const c=clampa(this.opacity);return`${1===c?"hsl(":"hsla("}${clamph(this.h)}, ${100*clampt(this.s)}%, ${100*clampt(this.l)}%${1===c?")":`, ${c})`}`}}));const d3_interpolate_src_constant=c=>()=>c;function linear(c,h){return function(g){return c+g*h}}function gamma(c){return 1===(c=+c)?nogamma:function(h,g){return g-h?function exponential(c,h,g){return c=Math.pow(c,g),h=Math.pow(h,g)-c,g=1/g,function(m){return Math.pow(c+m*h,g)}}(h,g,c):d3_interpolate_src_constant(isNaN(h)?g:h)}}function nogamma(c,h){var g=h-c;return g?linear(c,g):d3_interpolate_src_constant(isNaN(c)?h:c)}const st=function rgbGamma(c){var h=gamma(c);function rgb(c,g){var m=h((c=color_rgb(c)).r,(g=color_rgb(g)).r),b=h(c.g,g.g),w=h(c.b,g.b),S=nogamma(c.opacity,g.opacity);return function(h){return c.r=m(h),c.g=b(h),c.b=w(h),c.opacity=S(h),c+""}}return rgb.gamma=rgbGamma,rgb}(1);function rgbSpline(c){return function(h){var g,m,b=h.length,w=new Array(b),S=new Array(b),M=new Array(b);for(g=0;g<b;++g)m=color_rgb(h[g]),w[g]=m.r||0,S[g]=m.g||0,M[g]=m.b||0;return w=c(w),S=c(S),M=c(M),m.opacity=1,function(c){return m.r=w(c),m.g=S(c),m.b=M(c),m+""}}}var lt=rgbSpline(function src_basis(c){var h=c.length-1;return function(g){var m=g<=0?g=0:g>=1?(g=1,h-1):Math.floor(g*h),b=c[m],w=c[m+1],S=m>0?c[m-1]:2*b-w,M=m<h-1?c[m+2]:2*w-b;return basis((g-m/h)*h,S,b,w,M)}});rgbSpline(function basisClosed(c){var h=c.length;return function(g){var m=Math.floor(((g%=1)<0?++g:g)*h),b=c[(m+h-1)%h],w=c[m%h],S=c[(m+1)%h],M=c[(m+2)%h];return basis((g-m/h)*h,b,w,S,M)}});function genericArray(c,h){var g,m=h?h.length:0,b=c?Math.min(m,c.length):0,w=new Array(b),S=new Array(m);for(g=0;g<b;++g)w[g]=value(c[g],h[g]);for(;g<m;++g)S[g]=h[g];return function(c){for(g=0;g<b;++g)S[g]=w[g](c);return S}}function date(c,h){var g=new Date;return c=+c,h=+h,function(m){return g.setTime(c*(1-m)+h*m),g}}function src_number(c,h){return c=+c,h=+h,function(g){return c*(1-g)+h*g}}function object(c,h){var g,m={},b={};for(g in null!==c&&"object"==typeof c||(c={}),null!==h&&"object"==typeof h||(h={}),h)g in c?m[g]=value(c[g],h[g]):b[g]=h[g];return function(c){for(g in m)b[g]=m[g](c);return b}}var ct=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ut=new RegExp(ct.source,"g");function string(c,h){var g,m,b,w=ct.lastIndex=ut.lastIndex=0,S=-1,M=[],k=[];for(c+="",h+="";(g=ct.exec(c))&&(m=ut.exec(h));)(b=m.index)>w&&(b=h.slice(w,b),M[S]?M[S]+=b:M[++S]=b),(g=g[0])===(m=m[0])?M[S]?M[S]+=m:M[++S]=m:(M[++S]=null,k.push({i:S,x:src_number(g,m)})),w=ut.lastIndex;return w<h.length&&(b=h.slice(w),M[S]?M[S]+=b:M[++S]=b),M.length<2?k[0]?function one(c){return function(h){return c(h)+""}}(k[0].x):function string_zero(c){return function(){return c}}(h):(h=k.length,function(c){for(var g,m=0;m<h;++m)M[(g=k[m]).i]=g.x(c);return M.join("")})}function src_numberArray(c,h){h||(h=[]);var g,m=c?Math.min(h.length,c.length):0,b=h.slice();return function(w){for(g=0;g<m;++g)b[g]=c[g]*(1-w)+h[g]*w;return b}}function value(c,h){var g,m=typeof h;return null==h||"boolean"===m?d3_interpolate_src_constant(h):("number"===m?src_number:"string"===m?(g=color_color(h))?(h=g,st):string:h instanceof color_color?st:h instanceof Date?date:function numberArray_isNumberArray(c){return ArrayBuffer.isView(c)&&!(c instanceof DataView)}(h)?src_numberArray:Array.isArray(h)?genericArray:"function"!=typeof h.valueOf&&"function"!=typeof h.toString||isNaN(h)?object:src_number)(c,h)}function round(c,h){return c=+c,h=+h,function(g){return Math.round(c*(1-g)+h*g)}}function src_number_number(c){return+c}var ht=[0,1];function continuous_identity(c){return c}function normalize(c,h){return(h-=c=+c)?function(g){return(g-c)/h}:function constants(c){return function(){return c}}(isNaN(h)?NaN:.5)}function bimap(c,h,g){var m=c[0],b=c[1],w=h[0],S=h[1];return b<m?(m=normalize(b,m),w=g(S,w)):(m=normalize(m,b),w=g(w,S)),function(c){return w(m(c))}}function polymap(c,h,g){var m=Math.min(c.length,h.length)-1,b=new Array(m),w=new Array(m),S=-1;for(c[m]<c[0]&&(c=c.slice().reverse(),h=h.slice().reverse());++S<m;)b[S]=normalize(c[S],c[S+1]),w[S]=g(h[S],h[S+1]);return function(h){var g=H(c,h,1,m)-1;return w[g](b[g](h))}}function copy(c,h){return h.domain(c.domain()).range(c.range()).interpolate(c.interpolate()).clamp(c.clamp()).unknown(c.unknown())}function transformer(){var c,h,g,m,b,w,S=ht,M=ht,k=value,T=continuous_identity;function rescale(){var c=Math.min(S.length,M.length);return T!==continuous_identity&&(T=function clamper(c,h){var g;return c>h&&(g=c,c=h,h=g),function(g){return Math.max(c,Math.min(h,g))}}(S[0],S[c-1])),m=c>2?polymap:bimap,b=w=null,scale}function scale(h){return null==h||isNaN(h=+h)?g:(b||(b=m(S.map(c),M,k)))(c(T(h)))}return scale.invert=function(g){return T(h((w||(w=m(M,S.map(c),src_number)))(g)))},scale.domain=function(c){return arguments.length?(S=Array.from(c,src_number_number),rescale()):S.slice()},scale.range=function(c){return arguments.length?(M=Array.from(c),rescale()):M.slice()},scale.rangeRound=function(c){return M=Array.from(c),k=round,rescale()},scale.clamp=function(c){return arguments.length?(T=!!c||continuous_identity,rescale()):T!==continuous_identity},scale.interpolate=function(c){return arguments.length?(k=c,rescale()):k},scale.unknown=function(c){return arguments.length?(g=c,scale):g},function(g,m){return c=g,h=m,rescale()}}function continuous(){return transformer()(continuous_identity,continuous_identity)}var dt,pt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(c){if(!(h=pt.exec(c)))throw new Error("invalid format: "+c);var h;return new FormatSpecifier({fill:h[1],align:h[2],sign:h[3],symbol:h[4],zero:h[5],width:h[6],comma:h[7],precision:h[8]&&h[8].slice(1),trim:h[9],type:h[10]})}function FormatSpecifier(c){this.fill=void 0===c.fill?" ":c.fill+"",this.align=void 0===c.align?">":c.align+"",this.sign=void 0===c.sign?"-":c.sign+"",this.symbol=void 0===c.symbol?"":c.symbol+"",this.zero=!!c.zero,this.width=void 0===c.width?void 0:+c.width,this.comma=!!c.comma,this.precision=void 0===c.precision?void 0:+c.precision,this.trim=!!c.trim,this.type=void 0===c.type?"":c.type+""}function formatDecimalParts(c,h){if((g=(c=h?c.toExponential(h-1):c.toExponential()).indexOf("e"))<0)return null;var g,m=c.slice(0,g);return[m.length>1?m[0]+m.slice(2):m,+c.slice(g+1)]}function exponent(c){return(c=formatDecimalParts(Math.abs(c)))?c[1]:NaN}function formatRounded(c,h){var g=formatDecimalParts(c,h);if(!g)return c+"";var m=g[0],b=g[1];return b<0?"0."+new Array(-b).join("0")+m:m.length>b+1?m.slice(0,b+1)+"."+m.slice(b+1):m+new Array(b-m.length+2).join("0")}formatSpecifier.prototype=FormatSpecifier.prototype,FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const ft={"%":(c,h)=>(100*c).toFixed(h),b:c=>Math.round(c).toString(2),c:c=>c+"",d:function formatDecimal(c){return Math.abs(c=Math.round(c))>=1e21?c.toLocaleString("en").replace(/,/g,""):c.toString(10)},e:(c,h)=>c.toExponential(h),f:(c,h)=>c.toFixed(h),g:(c,h)=>c.toPrecision(h),o:c=>Math.round(c).toString(8),p:(c,h)=>formatRounded(100*c,h),r:formatRounded,s:function formatPrefixAuto(c,h){var g=formatDecimalParts(c,h);if(!g)return c+"";var m=g[0],b=g[1],w=b-(dt=3*Math.max(-8,Math.min(8,Math.floor(b/3))))+1,S=m.length;return w===S?m:w>S?m+new Array(w-S+1).join("0"):w>0?m.slice(0,w)+"."+m.slice(w):"0."+new Array(1-w).join("0")+formatDecimalParts(c,Math.max(0,h+w-1))[0]},X:c=>Math.round(c).toString(16).toUpperCase(),x:c=>Math.round(c).toString(16)};function src_identity(c){return c}var gt,_t,mt,vt=Array.prototype.map,yt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function locale(c){var h=void 0===c.grouping||void 0===c.thousands?src_identity:function formatGroup(c,h){return function(g,m){for(var b=g.length,w=[],S=0,M=c[0],k=0;b>0&&M>0&&(k+M+1>m&&(M=Math.max(1,m-k)),w.push(g.substring(b-=M,b+M)),!((k+=M+1)>m));)M=c[S=(S+1)%c.length];return w.reverse().join(h)}}(vt.call(c.grouping,Number),c.thousands+""),g=void 0===c.currency?"":c.currency[0]+"",m=void 0===c.currency?"":c.currency[1]+"",b=void 0===c.decimal?".":c.decimal+"",w=void 0===c.numerals?src_identity:function formatNumerals(c){return function(h){return h.replace(/[0-9]/g,function(h){return c[+h]})}}(vt.call(c.numerals,String)),S=void 0===c.percent?"%":c.percent+"",M=void 0===c.minus?"−":c.minus+"",k=void 0===c.nan?"NaN":c.nan+"";function newFormat(c){var T=(c=formatSpecifier(c)).fill,E=c.align,I=c.sign,P=c.symbol,L=c.zero,B=c.width,z=c.comma,j=c.precision,D=c.trim,N=c.type;"n"===N?(z=!0,N="g"):ft[N]||(void 0===j&&(j=12),D=!0,N="g"),(L||"0"===T&&"="===E)&&(L=!0,T="0",E="=");var R="$"===P?g:"#"===P&&/[boxX]/.test(N)?"0"+N.toLowerCase():"",G="$"===P?m:/[%p]/.test(N)?S:"",q=ft[N],W=/[defgprs%]/.test(N);function format(c){var g,m,S,P=R,H=G;if("c"===N)H=q(c)+H,c="";else{var U=(c=+c)<0||1/c<0;if(c=isNaN(c)?k:q(Math.abs(c),j),D&&(c=function formatTrim(c){t:for(var h,g=c.length,m=1,b=-1;m<g;++m)switch(c[m]){case".":b=h=m;break;case"0":0===b&&(b=m),h=m;break;default:if(!+c[m])break t;b>0&&(b=0)}return b>0?c.slice(0,b)+c.slice(h+1):c}(c)),U&&0===+c&&"+"!==I&&(U=!1),P=(U?"("===I?I:M:"-"===I||"("===I?"":I)+P,H=("s"===N?yt[8+dt/3]:"")+H+(U&&"("===I?")":""),W)for(g=-1,m=c.length;++g<m;)if(48>(S=c.charCodeAt(g))||S>57){H=(46===S?b+c.slice(g+1):c.slice(g))+H,c=c.slice(0,g);break}}z&&!L&&(c=h(c,1/0));var Y=P.length+c.length+H.length,V=Y<B?new Array(B-Y+1).join(T):"";switch(z&&L&&(c=h(V+c,V.length?B-H.length:1/0),V=""),E){case"<":c=P+c+H+V;break;case"=":c=P+V+c+H;break;case"^":c=V.slice(0,Y=V.length>>1)+P+c+H+V.slice(Y);break;default:c=V+P+c+H}return w(c)}return j=void 0===j?6:/[gprs]/.test(N)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j)),format.toString=function(){return c+""},format}return{format:newFormat,formatPrefix:function formatPrefix(c,h){var g=newFormat(((c=formatSpecifier(c)).type="f",c)),m=3*Math.max(-8,Math.min(8,Math.floor(exponent(h)/3))),b=Math.pow(10,-m),w=yt[8+m/3];return function(c){return g(b*c)+w}}}}function defaultLocale(c){return gt=locale(c),_t=gt.format,mt=gt.formatPrefix,gt}function tickFormat(c,h,g,m){var b,w=function tickStep(c,h,g){g=+g;const m=(h=+h)<(c=+c),b=m?tickIncrement(h,c,g):tickIncrement(c,h,g);return(m?-1:1)*(b<0?1/-b:b)}(c,h,g);switch((m=formatSpecifier(null==m?",f":m)).type){case"s":var S=Math.max(Math.abs(c),Math.abs(h));return null!=m.precision||isNaN(b=function precisionPrefix(c,h){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(exponent(h)/3)))-exponent(Math.abs(c)))}(w,S))||(m.precision=b),mt(m,S);case"":case"e":case"g":case"p":case"r":null!=m.precision||isNaN(b=function precisionRound(c,h){return c=Math.abs(c),h=Math.abs(h)-c,Math.max(0,exponent(h)-exponent(c))+1}(w,Math.max(Math.abs(c),Math.abs(h))))||(m.precision=b-("e"===m.type));break;case"f":case"%":null!=m.precision||isNaN(b=function precisionFixed(c){return Math.max(0,-exponent(Math.abs(c)))}(w))||(m.precision=b-2*("%"===m.type))}return _t(m)}function linearish(c){var h=c.domain;return c.ticks=function(c){var g=h();return function ticks(c,h,g){if(!((g=+g)>0))return[];if((c=+c)===(h=+h))return[c];const m=h<c,[b,w,S]=m?tickSpec(h,c,g):tickSpec(c,h,g);if(!(w>=b))return[];const M=w-b+1,k=new Array(M);if(m)if(S<0)for(let c=0;c<M;++c)k[c]=(w-c)/-S;else for(let c=0;c<M;++c)k[c]=(w-c)*S;else if(S<0)for(let c=0;c<M;++c)k[c]=(b+c)/-S;else for(let c=0;c<M;++c)k[c]=(b+c)*S;return k}(g[0],g[g.length-1],null==c?10:c)},c.tickFormat=function(c,g){var m=h();return tickFormat(m[0],m[m.length-1],null==c?10:c,g)},c.nice=function(g){null==g&&(g=10);var m,b,w=h(),S=0,M=w.length-1,k=w[S],T=w[M],E=10;for(T<k&&(b=k,k=T,T=b,b=S,S=M,M=b);E-- >0;){if((b=tickIncrement(k,T,g))===m)return w[S]=k,w[M]=T,h(w);if(b>0)k=Math.floor(k/b)*b,T=Math.ceil(T/b)*b;else{if(!(b<0))break;k=Math.ceil(k*b)/b,T=Math.floor(T*b)/b}m=b}return c},c}function linear_linear(){var c=continuous();return c.copy=function(){return copy(c,linear_linear())},initRange.apply(c,arguments),linearish(c)}function quantize(){var c,h=0,g=1,m=1,b=[.5],w=[0,1];function scale(h){return null!=h&&h<=h?w[H(b,h,0,m)]:c}function rescale(){var c=-1;for(b=new Array(m);++c<m;)b[c]=((c+1)*g-(c-m)*h)/(m+1);return scale}return scale.domain=function(c){return arguments.length?([h,g]=c,h=+h,g=+g,rescale()):[h,g]},scale.range=function(c){return arguments.length?(m=(w=Array.from(c)).length-1,rescale()):w.slice()},scale.invertExtent=function(c){var S=w.indexOf(c);return S<0?[NaN,NaN]:S<1?[h,b[0]]:S>=m?[b[m-1],g]:[b[S-1],b[S]]},scale.unknown=function(h){return arguments.length?(c=h,scale):scale},scale.thresholds=function(){return b.slice()},scale.copy=function(){return quantize().domain([h,g]).range(w).unknown(c)},initRange.apply(linearish(scale),arguments)}function threshold(){var c,h=[.5],g=[0,1],m=1;function scale(b){return null!=b&&b<=b?g[H(h,b,0,m)]:c}return scale.domain=function(c){return arguments.length?(h=Array.from(c),m=Math.min(h.length,g.length-1),scale):h.slice()},scale.range=function(c){return arguments.length?(g=Array.from(c),m=Math.min(h.length,g.length-1),scale):g.slice()},scale.invertExtent=function(c){var m=g.indexOf(c);return[h[m-1],h[m]]},scale.unknown=function(h){return arguments.length?(c=h,scale):c},scale.copy=function(){return threshold().domain(h).range(g).unknown(c)},initRange.apply(scale,arguments)}function colors(c){for(var h=c.length/6|0,g=new Array(h),m=0;m<h;)g[m]="#"+c.slice(6*m,6*++m);return g}defaultLocale({thousands:",",grouping:[3],currency:["$",""]});const ramp=c=>lt(c[c.length-1]);const At=ramp(new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(colors));const bt=Math.PI/180,xt=180/Math.PI,wt=.96422,Ct=.82521,St=4/29,Mt=6/29,kt=3*Mt*Mt,Tt=Mt*Mt*Mt;function labConvert(c){if(c instanceof Lab)return new Lab(c.l,c.a,c.b,c.opacity);if(c instanceof Hcl)return hcl2lab(c);c instanceof Rgb||(c=rgbConvert(c));var h,g,m=rgb2lrgb(c.r),b=rgb2lrgb(c.g),w=rgb2lrgb(c.b),S=xyz2lab((.2225045*m+.7168786*b+.0606169*w)/1);return m===b&&b===w?h=g=S:(h=xyz2lab((.4360747*m+.3850649*b+.1430804*w)/wt),g=xyz2lab((.0139322*m+.0971045*b+.7141733*w)/Ct)),new Lab(116*S-16,500*(h-S),200*(S-g),c.opacity)}function lab(c,h,g,m){return 1===arguments.length?labConvert(c):new Lab(c,h,g,null==m?1:m)}function Lab(c,h,g,m){this.l=+c,this.a=+h,this.b=+g,this.opacity=+m}function xyz2lab(c){return c>Tt?Math.pow(c,1/3):c/kt+St}function lab2xyz(c){return c>Mt?c*c*c:kt*(c-St)}function lrgb2rgb(c){return 255*(c<=.0031308?12.92*c:1.055*Math.pow(c,1/2.4)-.055)}function rgb2lrgb(c){return(c/=255)<=.04045?c/12.92:Math.pow((c+.055)/1.055,2.4)}function hclConvert(c){if(c instanceof Hcl)return new Hcl(c.h,c.c,c.l,c.opacity);if(c instanceof Lab||(c=labConvert(c)),0===c.a&&0===c.b)return new Hcl(NaN,0<c.l&&c.l<100?0:NaN,c.l,c.opacity);var h=Math.atan2(c.b,c.a)*xt;return new Hcl(h<0?h+360:h,Math.sqrt(c.a*c.a+c.b*c.b),c.l,c.opacity)}function Hcl(c,h,g,m){this.h=+c,this.c=+h,this.l=+g,this.opacity=+m}function hcl2lab(c){if(isNaN(c.h))return new Lab(c.l,0,0,c.opacity);var h=c.h*bt;return new Lab(c.l,Math.cos(h)*c.c,Math.sin(h)*c.c,c.opacity)}function lab_lab(c,h){var g=nogamma((c=lab(c)).l,(h=lab(h)).l),m=nogamma(c.a,h.a),b=nogamma(c.b,h.b),w=nogamma(c.opacity,h.opacity);return function(h){return c.l=g(h),c.a=m(h),c.b=b(h),c.opacity=w(h),c+""}}function asyncGeneratorStep(c,h,g,m,b,w,S){try{var M=c[w](S),k=M.value}catch(c){return void g(c)}M.done?h(k):Promise.resolve(k).then(m,b)}function _asyncToGenerator(c){return function(){var h=this,g=arguments;return new Promise(function(m,b){var w=c.apply(h,g);function _next(c){asyncGeneratorStep(w,m,b,_next,_throw,"next",c)}function _throw(c){asyncGeneratorStep(w,m,b,_next,_throw,"throw",c)}_next(void 0)})}}src_define(Lab,lab,extend(Color,{brighter(c){return new Lab(this.l+18*(null==c?1:c),this.a,this.b,this.opacity)},darker(c){return new Lab(this.l-18*(null==c?1:c),this.a,this.b,this.opacity)},rgb(){var c=(this.l+16)/116,h=isNaN(this.a)?c:c+this.a/500,g=isNaN(this.b)?c:c-this.b/200;return new Rgb(lrgb2rgb(3.1338561*(h=wt*lab2xyz(h))-1.6168667*(c=1*lab2xyz(c))-.4906146*(g=Ct*lab2xyz(g))),lrgb2rgb(-.9787684*h+1.9161415*c+.033454*g),lrgb2rgb(.0719453*h-.2289914*c+1.4052427*g),this.opacity)}})),src_define(Hcl,function hcl(c,h,g,m){return 1===arguments.length?hclConvert(c):new Hcl(c,h,g,null==m?1:m)},extend(Color,{brighter(c){return new Hcl(this.h,this.c,this.l+18*(null==c?1:c),this.opacity)},darker(c){return new Hcl(this.h,this.c,this.l-18*(null==c?1:c),this.opacity)},rgb(){return hcl2lab(this).rgb()}}));var Et=__webpack_require__(4756),It=__webpack_require__.n(Et);function _createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function utils_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return utils_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?utils_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function utils_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function ensureGroup(c,h){var g=c.select("g.".concat(h));return g.empty()?g=c.append("g").attr("class",h):g.selectAll("*").remove(),g}function updateCSSRule(c,h,g){if(!c.startsWith(".")&&!c.startsWith("#"))throw new Error('Invalid selector: Must start with "." for classes or "#" for IDs.');for(var m=0,b=Array.from(document.styleSheets);m<b.length;m++){var w=b[m];try{var S,M=_createForOfIteratorHelper(w.cssRules||w.rules);try{for(M.s();!(S=M.n()).done;){var k=S.value;if(k.selectorText===c)return void(k.style[h]=g)}}catch(c){M.e(c)}finally{M.f()}}catch(c){}}var T=document.getElementById("custom-styles");T||((T=document.createElement("style")).id="custom-styles",document.head.appendChild(T));try{T.sheet.insertRule("".concat(c," { ").concat(h,": ").concat(g,"; }"),T.sheet.cssRules.length)}catch(m){console.error("Failed to insert rule: ".concat(c," { ").concat(h,": ").concat(g,"; }"),m)}}var Pt=function getFontSizeFromClass(c){var h=document.createElement("div");h.className=c,h.style.position="absolute",h.style.visibility="hidden",h.style.height="auto",h.style.width="auto",h.style.lineHeight="normal",h.style.fontSize="initial",document.body.appendChild(h);var g=parseFloat(window.getComputedStyle(h).fontSize);return document.body.removeChild(h),g||0},Lt=function getCSSPropertyFromClass(c,h){var g=document.createElement("div");g.className=c,g.style.position="absolute",g.style.visibility="hidden",g.style.height="auto",g.style.lineHeight="normal",document.body.appendChild(g);var m=window.getComputedStyle(g).getPropertyValue(h);return document.body.removeChild(g),m||null};function applyComputedStylesToSVG(c){if(c&&c instanceof SVGElement){var h=new Set(["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset"]),g=[].concat(toConsumableArray_toConsumableArray(Array.from(h)),["vector-effect","shape-rendering","text-anchor","dominant-baseline","font-family","font-size","font-style","font-weight","letter-spacing","word-spacing","line-height","opacity","visibility","display","mix-blend-mode","filter","marker-start","marker-mid","marker-end","transform"]);inlineComputedStyle(c),c.querySelectorAll("*").forEach(function(c){return inlineComputedStyle(c)})}function inlineComputedStyle(c){var m=window.getComputedStyle(c);if(g.forEach(function(g){try{var b=m.getPropertyValue(g);if(!b||""===b||"initial"===b)return;if("none"===b&&!h.has(g))return;if("0px"===b&&"stroke-width"!==g)return;c.style.getPropertyValue(g)||c.style.setProperty(g,b)}catch(c){}}),c.tagName&&"text"===c.tagName.toLowerCase()){var b=m.getPropertyValue("font-size");b&&!c.style.getPropertyValue("font-size")&&c.style.setProperty("font-size",b)}}}function ensureSvgSize(c){var h=c.getBoundingClientRect(),g=Math.round(h.width)||parseInt(c.getAttribute("width"))||800,m=Math.round(h.height)||parseInt(c.getAttribute("height"))||600;c.hasAttribute("viewBox")||c.setAttribute("viewBox","0 0 ".concat(g," ").concat(m)),c.setAttribute("width",g),c.setAttribute("height",m)}var Ft=function spaceAsThousandSeparator(c){return c.toLocaleString("en").replace(/,/gi," ")};function generateUniqueId(c){return"".concat(c,"-").concat(Math.random().toString(36).substr(2,9))}var Bt=function executeForAllInsets(c,h,g){var m=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,b=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;for(var w in c){var S=c[w];Array.isArray(S)?S.forEach(function(c){Array.isArray(c)?c.forEach(function(c){c.svgId_!==h&&g(c,m,b)}):c.svgId_!==h&&g(c,m,b)}):S.svgId_!==h&&g(S,m,b)}};function getParameterByName(c){c=c.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var h=new RegExp("[\\?&]"+c+"=([^&#]*)").exec(location.search);return h?decodeURIComponent(h[1].replace(/\+/g," ")):null}var Ot=function getTextColorForBackground(c){var h,g,m;if(!c.startsWith("rgb")&&!c.startsWith("#")){var b=document.createElement("div");b.style.color=c,document.body.appendChild(b);var w=window.getComputedStyle(b).color;document.body.removeChild(b),c=w}if(c.startsWith("#")){var S=c.replace("#","");3===S.length&&(S=S.split("").map(function(c){return c+c}).join("")),h=parseInt(S.substring(0,2),16),g=parseInt(S.substring(2,4),16),m=parseInt(S.substring(4,6),16)}else{var M=c.match(/\d+/g);h=parseInt(M[0]),g=parseInt(M[1]),m=parseInt(M[2])}return h/255*.2126+g/255*.7152+m/255*.0722>.5?"black":"white"},zt=function getRegionsSelector(c){return c.Geometries.userGeometries?"#em-user-regions path":c.gridCartogram_?"#em-grid-container .em-grid-cell":"WORLD"===c.geo_?"#em-worldrg path":"#em-nutsrg path:not(#em-cntrg-RS):not(#em-cntrg-EL), #em-cntrg path:not(#em-cntrg-RS):not(#em-cntrg-EL)"},jt=function getLegendRegionsSelector(c){return c.Geometries.userGeometries?"#em-user-regions":c.gridCartogram_?"#em-grid-container":"WORLD"===c.geo_?"#em-worldrg":"#em-nutsrg, #em-cntrg"};function _typeof(c){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},_typeof(c)}function toPropertyKey(c){var h=function toPrimitive(c,h){if("object"!=_typeof(c)||!c)return c;var g=c[Symbol.toPrimitive];if(void 0!==g){var m=g.call(c,h||"default");if("object"!=_typeof(m))return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===h?String:Number)(c)}(c,"string");return"symbol"==_typeof(h)?h:h+""}function _defineProperty(c,h,g){return(h=toPropertyKey(h))in c?Object.defineProperty(c,h,{value:g,enumerable:!0,configurable:!0,writable:!0}):c[h]=g,c}function src_selectAll(c){return"string"==typeof c?new selection_Selection([document.querySelectorAll(c)],[document.documentElement]):new selection_Selection([array(c)],R)}class Adder{constructor(){this._partials=new Float64Array(32),this._n=0}add(c){const h=this._partials;let g=0;for(let m=0;m<this._n&&m<32;m++){const b=h[m],w=c+b,S=Math.abs(c)<Math.abs(b)?c-(w-b):b-(w-c);S&&(h[g++]=S),c=w}return h[g]=c,this._n=g+1,this}valueOf(){const c=this._partials;let h,g,m,b=this._n,w=0;if(b>0){for(w=c[--b];b>0&&(h=w,g=c[--b],w=h+g,m=g-(w-h),!m););b>0&&(m<0&&c[b-1]<0||m>0&&c[b-1]>0)&&(g=2*m,h=w+g,g==h-w&&(w=h))}return w}}var Dt=1e-6,Nt=1e-12,Rt=Math.PI,Gt=Rt/2,qt=Rt/4,Wt=2*Rt,Ht=180/Rt,Ut=Rt/180,Yt=Math.abs,Vt=Math.atan,$t=Math.atan2,Xt=Math.cos,Kt=Math.ceil,Zt=(Math.exp,Math.floor,Math.hypot),Jt=(Math.log,Math.pow,Math.sin),Qt=Math.sign||function(c){return c>0?1:c<0?-1:0},te=Math.sqrt;Math.tan;function asin(c){return c>1?Gt:c<-1?-Gt:Math.asin(c)}function noop(){}function streamGeometry(c,h){c&&ve.hasOwnProperty(c.type)&&ve[c.type](c,h)}var ee,ne,re,oe,ae,ie,se,le,ce,ue,he,de,pe,fe,ge,_e,me={Feature:function(c,h){streamGeometry(c.geometry,h)},FeatureCollection:function(c,h){for(var g=c.features,m=-1,b=g.length;++m<b;)streamGeometry(g[m].geometry,h)}},ve={Sphere:function(c,h){h.sphere()},Point:function(c,h){c=c.coordinates,h.point(c[0],c[1],c[2])},MultiPoint:function(c,h){for(var g=c.coordinates,m=-1,b=g.length;++m<b;)c=g[m],h.point(c[0],c[1],c[2])},LineString:function(c,h){streamLine(c.coordinates,h,0)},MultiLineString:function(c,h){for(var g=c.coordinates,m=-1,b=g.length;++m<b;)streamLine(g[m],h,0)},Polygon:function(c,h){streamPolygon(c.coordinates,h)},MultiPolygon:function(c,h){for(var g=c.coordinates,m=-1,b=g.length;++m<b;)streamPolygon(g[m],h)},GeometryCollection:function(c,h){for(var g=c.geometries,m=-1,b=g.length;++m<b;)streamGeometry(g[m],h)}};function streamLine(c,h,g){var m,b=-1,w=c.length-g;for(h.lineStart();++b<w;)m=c[b],h.point(m[0],m[1],m[2]);h.lineEnd()}function streamPolygon(c,h){var g=-1,m=c.length;for(h.polygonStart();++g<m;)streamLine(c[g],h,1);h.polygonEnd()}function stream(c,h){c&&me.hasOwnProperty(c.type)?me[c.type](c,h):streamGeometry(c,h)}var ye={sphere:noop,point:centroidPoint,lineStart:centroidLineStart,lineEnd:centroidLineEnd,polygonStart:function(){ye.lineStart=centroidRingStart,ye.lineEnd=centroidRingEnd},polygonEnd:function(){ye.lineStart=centroidLineStart,ye.lineEnd=centroidLineEnd}};function centroidPoint(c,h){c*=Ut;var g=Xt(h*=Ut);centroidPointCartesian(g*Xt(c),g*Jt(c),Jt(h))}function centroidPointCartesian(c,h,g){++ee,re+=(c-re)/ee,oe+=(h-oe)/ee,ae+=(g-ae)/ee}function centroidLineStart(){ye.point=centroidLinePointFirst}function centroidLinePointFirst(c,h){c*=Ut;var g=Xt(h*=Ut);fe=g*Xt(c),ge=g*Jt(c),_e=Jt(h),ye.point=centroidLinePoint,centroidPointCartesian(fe,ge,_e)}function centroidLinePoint(c,h){c*=Ut;var g=Xt(h*=Ut),m=g*Xt(c),b=g*Jt(c),w=Jt(h),S=$t(te((S=ge*w-_e*b)*S+(S=_e*m-fe*w)*S+(S=fe*b-ge*m)*S),fe*m+ge*b+_e*w);ne+=S,ie+=S*(fe+(fe=m)),se+=S*(ge+(ge=b)),le+=S*(_e+(_e=w)),centroidPointCartesian(fe,ge,_e)}function centroidLineEnd(){ye.point=centroidPoint}function centroidRingStart(){ye.point=centroidRingPointFirst}function centroidRingEnd(){centroidRingPoint(de,pe),ye.point=centroidPoint}function centroidRingPointFirst(c,h){de=c,pe=h,c*=Ut,h*=Ut,ye.point=centroidRingPoint;var g=Xt(h);fe=g*Xt(c),ge=g*Jt(c),_e=Jt(h),centroidPointCartesian(fe,ge,_e)}function centroidRingPoint(c,h){c*=Ut;var g=Xt(h*=Ut),m=g*Xt(c),b=g*Jt(c),w=Jt(h),S=ge*w-_e*b,M=_e*m-fe*w,k=fe*b-ge*m,T=Zt(S,M,k),E=asin(T),I=T&&-E/T;ce.add(I*S),ue.add(I*M),he.add(I*k),ne+=E,ie+=E*(fe+(fe=m)),se+=E*(ge+(ge=b)),le+=E*(_e+(_e=w)),centroidPointCartesian(fe,ge,_e)}function centroid(c){ee=ne=re=oe=ae=ie=se=le=0,ce=new Adder,ue=new Adder,he=new Adder,stream(c,ye);var h=+ce,g=+ue,m=+he,b=Zt(h,g,m);return b<Nt&&(h=ie,g=se,m=le,ne<Dt&&(h=re,g=oe,m=ae),(b=Zt(h,g,m))<Nt)?[NaN,NaN]:[$t(g,h)*Ht,asin(m/b)*Ht]}function buffer(){var c,h=[];return{point:function(h,g,m){c.push([h,g,m])},lineStart:function(){h.push(c=[])},lineEnd:noop,rejoin:function(){h.length>1&&h.push(h.pop().concat(h.shift()))},result:function(){var g=h;return h=[],c=null,g}}}function pointEqual(c,h){return Yt(c[0]-h[0])<Dt&&Yt(c[1]-h[1])<Dt}function Intersection(c,h,g,m){this.x=c,this.z=h,this.o=g,this.e=m,this.v=!1,this.n=this.p=null}function rejoin(c,h,g,m,b){var w,S,M=[],k=[];if(c.forEach(function(c){if(!((h=c.length-1)<=0)){var h,g,m=c[0],S=c[h];if(pointEqual(m,S)){if(!m[2]&&!S[2]){for(b.lineStart(),w=0;w<h;++w)b.point((m=c[w])[0],m[1]);return void b.lineEnd()}S[0]+=2e-6}M.push(g=new Intersection(m,c,null,!0)),k.push(g.o=new Intersection(m,null,g,!1)),M.push(g=new Intersection(S,c,null,!1)),k.push(g.o=new Intersection(S,null,g,!0))}}),M.length){for(k.sort(h),rejoin_link(M),rejoin_link(k),w=0,S=k.length;w<S;++w)k[w].e=g=!g;for(var T,E,I=M[0];;){for(var P=I,L=!0;P.v;)if((P=P.n)===I)return;T=P.z,b.lineStart();do{if(P.v=P.o.v=!0,P.e){if(L)for(w=0,S=T.length;w<S;++w)b.point((E=T[w])[0],E[1]);else m(P.x,P.n.x,1,b);P=P.n}else{if(L)for(T=P.p.z,w=T.length-1;w>=0;--w)b.point((E=T[w])[0],E[1]);else m(P.x,P.p.x,-1,b);P=P.p}T=(P=P.o).z,L=!L}while(!P.v);b.lineEnd()}}}function rejoin_link(c){if(h=c.length){for(var h,g,m=0,b=c[0];++m<h;)b.n=g=c[m],g.p=b,b=g;b.n=g=c[0],g.p=b}}function merge_merge(c){return Array.from(function*flatten(c){for(const h of c)yield*h}(c))}var Ae=1e9,be=-Ae;function clipRectangle(c,h,g,m){function visible(b,w){return c<=b&&b<=g&&h<=w&&w<=m}function interpolate(b,w,S,M){var k=0,T=0;if(null==b||(k=corner(b,S))!==(T=corner(w,S))||comparePoint(b,w)<0^S>0)do{M.point(0===k||3===k?c:g,k>1?m:h)}while((k=(k+S+4)%4)!==T);else M.point(w[0],w[1])}function corner(m,b){return Yt(m[0]-c)<Dt?b>0?0:3:Yt(m[0]-g)<Dt?b>0?2:1:Yt(m[1]-h)<Dt?b>0?1:0:b>0?3:2}function compareIntersection(c,h){return comparePoint(c.x,h.x)}function comparePoint(c,h){var g=corner(c,1),m=corner(h,1);return g!==m?g-m:0===g?h[1]-c[1]:1===g?c[0]-h[0]:2===g?c[1]-h[1]:h[0]-c[0]}return function(b){var w,S,M,k,T,E,I,P,L,B,z,j=b,D=buffer(),N={point,lineStart:function lineStart(){N.point=linePoint,S&&S.push(M=[]);B=!0,L=!1,I=P=NaN},lineEnd:function lineEnd(){w&&(linePoint(k,T),E&&L&&D.rejoin(),w.push(D.result()));N.point=point,L&&j.lineEnd()},polygonStart:function polygonStart(){j=D,w=[],S=[],z=!0},polygonEnd:function polygonEnd(){var h=function polygonInside(){for(var h=0,g=0,b=S.length;g<b;++g)for(var w,M,k=S[g],T=1,E=k.length,I=k[0],P=I[0],L=I[1];T<E;++T)w=P,M=L,P=(I=k[T])[0],L=I[1],M<=m?L>m&&(P-w)*(m-M)>(L-M)*(c-w)&&++h:L<=m&&(P-w)*(m-M)<(L-M)*(c-w)&&--h;return h}(),g=z&&h,k=(w=merge_merge(w)).length;(g||k)&&(b.polygonStart(),g&&(b.lineStart(),interpolate(null,null,1,b),b.lineEnd()),k&&rejoin(w,compareIntersection,h,interpolate,b),b.polygonEnd());j=b,w=S=M=null}};function point(c,h){visible(c,h)&&j.point(c,h)}function linePoint(b,w){var D=visible(b,w);if(S&&M.push([b,w]),B)k=b,T=w,E=D,B=!1,D&&(j.lineStart(),j.point(b,w));else if(D&&L)j.point(b,w);else{var N=[I=Math.max(be,Math.min(Ae,I)),P=Math.max(be,Math.min(Ae,P))],R=[b=Math.max(be,Math.min(Ae,b)),w=Math.max(be,Math.min(Ae,w))];!function clip_line(c,h,g,m,b,w){var S,M=c[0],k=c[1],T=0,E=1,I=h[0]-M,P=h[1]-k;if(S=g-M,I||!(S>0)){if(S/=I,I<0){if(S<T)return;S<E&&(E=S)}else if(I>0){if(S>E)return;S>T&&(T=S)}if(S=b-M,I||!(S<0)){if(S/=I,I<0){if(S>E)return;S>T&&(T=S)}else if(I>0){if(S<T)return;S<E&&(E=S)}if(S=m-k,P||!(S>0)){if(S/=P,P<0){if(S<T)return;S<E&&(E=S)}else if(P>0){if(S>E)return;S>T&&(T=S)}if(S=w-k,P||!(S<0)){if(S/=P,P<0){if(S>E)return;S>T&&(T=S)}else if(P>0){if(S<T)return;S<E&&(E=S)}return T>0&&(c[0]=M+T*I,c[1]=k+T*P),E<1&&(h[0]=M+E*I,h[1]=k+E*P),!0}}}}}(N,R,c,h,g,m)?D&&(j.lineStart(),j.point(b,w),z=!1):(L||(j.lineStart(),j.point(N[0],N[1])),j.point(R[0],R[1]),D||j.lineEnd(),z=!1)}I=b,P=w,L=D}return N}}const d3_geo_src_identity=c=>c;function transform_transformer(c){return function(h){var g=new TransformStream;for(var m in c)g[m]=c[m];return g.stream=h,g}}function TransformStream(){}TransformStream.prototype={constructor:TransformStream,point:function(c,h){this.stream.point(c,h)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var xe=1/0,we=xe,Ce=-xe,Se=Ce,Me={point:function boundsPoint(c,h){c<xe&&(xe=c);c>Ce&&(Ce=c);h<we&&(we=h);h>Se&&(Se=h)},lineStart:noop,lineEnd:noop,polygonStart:noop,polygonEnd:noop,result:function(){var c=[[xe,we],[Ce,Se]];return Ce=Se=-(we=xe=1/0),c}};const ke=Me;function fit(c,h,g){var m=c.clipExtent&&c.clipExtent();return c.scale(150).translate([0,0]),null!=m&&c.clipExtent(null),stream(g,c.stream(ke)),h(ke.result()),null!=m&&c.clipExtent(m),c}function fitExtent(c,h,g){return fit(c,function(g){var m=h[1][0]-h[0][0],b=h[1][1]-h[0][1],w=Math.min(m/(g[1][0]-g[0][0]),b/(g[1][1]-g[0][1])),S=+h[0][0]+(m-w*(g[1][0]+g[0][0]))/2,M=+h[0][1]+(b-w*(g[1][1]+g[0][1]))/2;c.scale(150*w).translate([S,M])},g)}function fitSize(c,h,g){return fitExtent(c,[[0,0],h],g)}function fitWidth(c,h,g){return fit(c,function(g){var m=+h,b=m/(g[1][0]-g[0][0]),w=(m-b*(g[1][0]+g[0][0]))/2,S=-b*g[0][1];c.scale(150*b).translate([w,S])},g)}function fitHeight(c,h,g){return fit(c,function(g){var m=+h,b=m/(g[1][1]-g[0][1]),w=-b*g[0][0],S=(m-b*(g[1][1]+g[0][1]))/2;c.scale(150*b).translate([w,S])},g)}var Te,Ee,Ie,Pe,Le=new Adder,Fe=new Adder,Be={point:noop,lineStart:noop,lineEnd:noop,polygonStart:function(){Be.lineStart=areaRingStart,Be.lineEnd=areaRingEnd},polygonEnd:function(){Be.lineStart=Be.lineEnd=Be.point=noop,Le.add(Yt(Fe)),Fe=new Adder},result:function(){var c=Le/2;return Le=new Adder,c}};function areaRingStart(){Be.point=areaPointFirst}function areaPointFirst(c,h){Be.point=areaPoint,Te=Ie=c,Ee=Pe=h}function areaPoint(c,h){Fe.add(Pe*c-Ie*h),Ie=c,Pe=h}function areaRingEnd(){areaPoint(Te,Ee)}const Oe=Be;var ze,je,De,Ne,Re=0,Ge=0,qe=0,We=0,He=0,Ue=0,Ye=0,Ve=0,$e=0,Xe={point:centroid_centroidPoint,lineStart:centroid_centroidLineStart,lineEnd:centroid_centroidLineEnd,polygonStart:function(){Xe.lineStart=centroid_centroidRingStart,Xe.lineEnd=centroid_centroidRingEnd},polygonEnd:function(){Xe.point=centroid_centroidPoint,Xe.lineStart=centroid_centroidLineStart,Xe.lineEnd=centroid_centroidLineEnd},result:function(){var c=$e?[Ye/$e,Ve/$e]:Ue?[We/Ue,He/Ue]:qe?[Re/qe,Ge/qe]:[NaN,NaN];return Re=Ge=qe=We=He=Ue=Ye=Ve=$e=0,c}};function centroid_centroidPoint(c,h){Re+=c,Ge+=h,++qe}function centroid_centroidLineStart(){Xe.point=centroidPointFirstLine}function centroidPointFirstLine(c,h){Xe.point=centroidPointLine,centroid_centroidPoint(De=c,Ne=h)}function centroidPointLine(c,h){var g=c-De,m=h-Ne,b=te(g*g+m*m);We+=b*(De+c)/2,He+=b*(Ne+h)/2,Ue+=b,centroid_centroidPoint(De=c,Ne=h)}function centroid_centroidLineEnd(){Xe.point=centroid_centroidPoint}function centroid_centroidRingStart(){Xe.point=centroidPointFirstRing}function centroid_centroidRingEnd(){centroidPointRing(ze,je)}function centroidPointFirstRing(c,h){Xe.point=centroidPointRing,centroid_centroidPoint(ze=De=c,je=Ne=h)}function centroidPointRing(c,h){var g=c-De,m=h-Ne,b=te(g*g+m*m);We+=b*(De+c)/2,He+=b*(Ne+h)/2,Ue+=b,Ye+=(b=Ne*c-De*h)*(De+c),Ve+=b*(Ne+h),$e+=3*b,centroid_centroidPoint(De=c,Ne=h)}const Ke=Xe;function PathContext(c){this._context=c}PathContext.prototype={_radius:4.5,pointRadius:function(c){return this._radius=c,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(c,h){switch(this._point){case 0:this._context.moveTo(c,h),this._point=1;break;case 1:this._context.lineTo(c,h);break;default:this._context.moveTo(c+this._radius,h),this._context.arc(c,h,this._radius,0,Wt)}},result:noop};var Ze,Je,Qe,tn,en,nn=new Adder,rn={point:noop,lineStart:function(){rn.point=lengthPointFirst},lineEnd:function(){Ze&&lengthPoint(Je,Qe),rn.point=noop},polygonStart:function(){Ze=!0},polygonEnd:function(){Ze=null},result:function(){var c=+nn;return nn=new Adder,c}};function lengthPointFirst(c,h){rn.point=lengthPoint,Je=tn=c,Qe=en=h}function lengthPoint(c,h){tn-=c,en-=h,nn.add(te(tn*tn+en*en)),tn=c,en=h}const an=rn;let sn,ln,cn,un;class PathString{constructor(c){this._append=null==c?string_append:function appendRound(c){const h=Math.floor(c);if(!(h>=0))throw new RangeError(`invalid digits: ${c}`);if(h>15)return string_append;if(h!==sn){const c=10**h;sn=h,ln=function append(h){let g=1;this._+=h[0];for(const m=h.length;g<m;++g)this._+=Math.round(arguments[g]*c)/c+h[g]}}return ln}(c),this._radius=4.5,this._=""}pointRadius(c){return this._radius=+c,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(c,h){switch(this._point){case 0:this._append`M${c},${h}`,this._point=1;break;case 1:this._append`L${c},${h}`;break;default:if(this._append`M${c},${h}`,this._radius!==cn||this._append!==ln){const c=this._radius,h=this._;this._="",this._append`m0,${c}a${c},${c} 0 1,1 0,${-2*c}a${c},${c} 0 1,1 0,${2*c}z`,cn=c,ln=this._append,un=this._,this._=h}this._+=un}}result(){const c=this._;return this._="",c.length?c:null}}function string_append(c){let h=1;this._+=c[0];for(const g=c.length;h<g;++h)this._+=arguments[h]+c[h]}function src_path(c,h){let g,m,b=3,w=4.5;function path(c){return c&&("function"==typeof w&&m.pointRadius(+w.apply(this,arguments)),stream(c,g(m))),m.result()}return path.area=function(c){return stream(c,g(Oe)),Oe.result()},path.measure=function(c){return stream(c,g(an)),an.result()},path.bounds=function(c){return stream(c,g(ke)),ke.result()},path.centroid=function(c){return stream(c,g(Ke)),Ke.result()},path.projection=function(h){return arguments.length?(g=null==h?(c=null,d3_geo_src_identity):(c=h).stream,path):c},path.context=function(c){return arguments.length?(m=null==c?(h=null,new PathString(b)):new PathContext(h=c),"function"!=typeof w&&m.pointRadius(w),path):h},path.pointRadius=function(c){return arguments.length?(w="function"==typeof c?c:(m.pointRadius(+c),+c),path):w},path.digits=function(c){if(!arguments.length)return b;if(null==c)b=null;else{const h=Math.floor(c);if(!(h>=0))throw new RangeError(`invalid digits: ${c}`);b=h}return null===h&&(m=new PathString(b)),path},path.projection(c).digits(b).context(h)}function noop_noop(){}function clip_buffer(){var c,h=[];return{point:function(h,g,m){c.push([h,g,m])},lineStart:function(){h.push(c=[])},lineEnd:noop_noop,rejoin:function(){h.length>1&&h.push(h.pop().concat(h.shift()))},result:function(){var g=h;return h=[],c=null,g}}}var hn=1e-6,dn=Math.PI,pn=dn/2,fn=dn/4,gn=2*dn,_n=180/dn,mn=dn/180,vn=Math.abs,yn=Math.atan,An=Math.atan2,bn=Math.cos,xn=(Math.ceil,Math.exp,Math.floor,Math.hypot,Math.log,Math.pow,Math.sin),wn=Math.sign||function(c){return c>0?1:c<0?-1:0},Cn=Math.sqrt;Math.tan;function math_asin(c){return c>1?pn:c<-1?-pn:Math.asin(c)}function src_pointEqual(c,h){return vn(c[0]-h[0])<hn&&vn(c[1]-h[1])<hn}function rejoin_Intersection(c,h,g,m){this.x=c,this.z=h,this.o=g,this.e=m,this.v=!1,this.n=this.p=null}function clip_rejoin(c,h,g,m,b){var w,S,M=[],k=[];if(c.forEach(function(c){if(!((h=c.length-1)<=0)){var h,g,m=c[0],S=c[h];if(src_pointEqual(m,S)){if(!m[2]&&!S[2]){for(b.lineStart(),w=0;w<h;++w)b.point((m=c[w])[0],m[1]);return void b.lineEnd()}S[0]+=2e-6}M.push(g=new rejoin_Intersection(m,c,null,!0)),k.push(g.o=new rejoin_Intersection(m,null,g,!1)),M.push(g=new rejoin_Intersection(S,c,null,!1)),k.push(g.o=new rejoin_Intersection(S,null,g,!0))}}),M.length){for(k.sort(h),clip_rejoin_link(M),clip_rejoin_link(k),w=0,S=k.length;w<S;++w)k[w].e=g=!g;for(var T,E,I=M[0];;){for(var P=I,L=!0;P.v;)if((P=P.n)===I)return;T=P.z,b.lineStart();do{if(P.v=P.o.v=!0,P.e){if(L)for(w=0,S=T.length;w<S;++w)b.point((E=T[w])[0],E[1]);else m(P.x,P.n.x,1,b);P=P.n}else{if(L)for(T=P.p.z,w=T.length-1;w>=0;--w)b.point((E=T[w])[0],E[1]);else m(P.x,P.p.x,-1,b);P=P.p}T=(P=P.o).z,L=!L}while(!P.v);b.lineEnd()}}}function clip_rejoin_link(c){if(h=c.length){for(var h,g,m=0,b=c[0];++m<h;)b.n=g=c[m],g.p=b,b=g;b.n=g=c[0],g.p=b}}class fsum_Adder{constructor(){this._partials=new Float64Array(32),this._n=0}add(c){const h=this._partials;let g=0;for(let m=0;m<this._n&&m<32;m++){const b=h[m],w=c+b,S=Math.abs(c)<Math.abs(b)?c-(w-b):b-(w-c);S&&(h[g++]=S),c=w}return h[g]=c,this._n=g+1,this}valueOf(){const c=this._partials;let h,g,m,b=this._n,w=0;if(b>0){for(w=c[--b];b>0&&(h=w,g=c[--b],w=h+g,m=g-(w-h),!m););b>0&&(m<0&&c[b-1]<0||m>0&&c[b-1]>0)&&(g=2*m,h=w+g,g==h-w&&(w=h))}return w}}function spherical(c){return[An(c[1],c[0]),math_asin(c[2])]}function cartesian(c){var h=c[0],g=c[1],m=bn(g);return[m*bn(h),m*xn(h),xn(g)]}function cartesianDot(c,h){return c[0]*h[0]+c[1]*h[1]+c[2]*h[2]}function cartesianCross(c,h){return[c[1]*h[2]-c[2]*h[1],c[2]*h[0]-c[0]*h[2],c[0]*h[1]-c[1]*h[0]]}function cartesianAddInPlace(c,h){c[0]+=h[0],c[1]+=h[1],c[2]+=h[2]}function cartesianScale(c,h){return[c[0]*h,c[1]*h,c[2]*h]}function cartesianNormalizeInPlace(c){var h=Cn(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);c[0]/=h,c[1]/=h,c[2]/=h}function longitude(c){return vn(c[0])<=dn?c[0]:wn(c[0])*((vn(c[0])+dn)%gn-dn)}function src_merge_merge(c){return Array.from(function*merge_flatten(c){for(const h of c)yield*h}(c))}function clip(c,h,g,m){return function(b){var w,S,M,k=h(b),T=clip_buffer(),E=h(T),I=!1,P={point,lineStart,lineEnd,polygonStart:function(){P.point=pointRing,P.lineStart=ringStart,P.lineEnd=ringEnd,S=[],w=[]},polygonEnd:function(){P.point=point,P.lineStart=lineStart,P.lineEnd=lineEnd,S=src_merge_merge(S);var c=function polygonContains(c,h){var g=longitude(h),m=h[1],b=xn(m),w=[xn(g),-bn(g),0],S=0,M=0,k=new fsum_Adder;1===b?m=pn+hn:-1===b&&(m=-pn-hn);for(var T=0,E=c.length;T<E;++T)if(P=(I=c[T]).length)for(var I,P,L=I[P-1],B=longitude(L),z=L[1]/2+fn,j=xn(z),D=bn(z),N=0;N<P;++N,B=G,j=W,D=H,L=R){var R=I[N],G=longitude(R),q=R[1]/2+fn,W=xn(q),H=bn(q),U=G-B,Y=U>=0?1:-1,V=Y*U,$=V>dn,X=j*W;if(k.add(An(X*Y*xn(V),D*H+X*bn(V))),S+=$?U+Y*gn:U,$^B>=g^G>=g){var K=cartesianCross(cartesian(L),cartesian(R));cartesianNormalizeInPlace(K);var Z=cartesianCross(w,K);cartesianNormalizeInPlace(Z);var J=($^U>=0?-1:1)*math_asin(Z[2]);(m>J||m===J&&(K[0]||K[1]))&&(M+=$^U>=0?1:-1)}}return(S<-1e-6||S<hn&&k<-1e-12)^1&M}(w,m);S.length?(I||(b.polygonStart(),I=!0),clip_rejoin(S,compareIntersection,c,g,b)):c&&(I||(b.polygonStart(),I=!0),b.lineStart(),g(null,null,1,b),b.lineEnd()),I&&(b.polygonEnd(),I=!1),S=w=null},sphere:function(){b.polygonStart(),b.lineStart(),g(null,null,1,b),b.lineEnd(),b.polygonEnd()}};function point(h,g){c(h,g)&&b.point(h,g)}function pointLine(c,h){k.point(c,h)}function lineStart(){P.point=pointLine,k.lineStart()}function lineEnd(){P.point=point,k.lineEnd()}function pointRing(c,h){M.push([c,h]),E.point(c,h)}function ringStart(){E.lineStart(),M=[]}function ringEnd(){pointRing(M[0][0],M[0][1]),E.lineEnd();var c,h,g,m,k=E.clean(),P=T.result(),L=P.length;if(M.pop(),w.push(M),M=null,L)if(1&k){if((h=(g=P[0]).length-1)>0){for(I||(b.polygonStart(),I=!0),b.lineStart(),c=0;c<h;++c)b.point((m=g[c])[0],m[1]);b.lineEnd()}}else L>1&&2&k&&P.push(P.pop().concat(P.shift())),S.push(P.filter(validSegment))}return P}}function validSegment(c){return c.length>1}function compareIntersection(c,h){return((c=c.x)[0]<0?c[1]-pn-hn:pn-c[1])-((h=h.x)[0]<0?h[1]-pn-hn:pn-h[1])}const Sn=clip(function(){return!0},function clipAntimeridianLine(c){var h,g=NaN,m=NaN,b=NaN;return{lineStart:function(){c.lineStart(),h=1},point:function(w,S){var M=w>0?dn:-dn,k=vn(w-g);vn(k-dn)<hn?(c.point(g,m=(m+S)/2>0?pn:-pn),c.point(b,m),c.lineEnd(),c.lineStart(),c.point(M,m),c.point(w,m),h=0):b!==M&&k>=dn&&(vn(g-b)<hn&&(g-=b*hn),vn(w-M)<hn&&(w-=M*hn),m=function clipAntimeridianIntersect(c,h,g,m){var b,w,S=xn(c-g);return vn(S)>hn?yn((xn(h)*(w=bn(m))*xn(g)-xn(m)*(b=bn(h))*xn(c))/(b*w*S)):(h+m)/2}(g,m,w,S),c.point(b,m),c.lineEnd(),c.lineStart(),c.point(M,m),h=0),c.point(g=w,m=S),b=M},lineEnd:function(){c.lineEnd(),g=m=NaN},clean:function(){return 2-h}}},function clipAntimeridianInterpolate(c,h,g,m){var b;if(null==c)b=g*pn,m.point(-dn,b),m.point(0,b),m.point(dn,b),m.point(dn,0),m.point(dn,-b),m.point(0,-b),m.point(-dn,-b),m.point(-dn,0),m.point(-dn,b);else if(vn(c[0]-h[0])>hn){var w=c[0]<h[0]?dn:-dn;b=g*w/2,m.point(-w,b),m.point(0,b),m.point(w,b)}else m.point(h[0],h[1])},[-dn,-pn]);function circleStream(c,h,g,m,b,w){if(g){var S=bn(h),M=xn(h),k=m*g;null==b?(b=h+m*gn,w=h-k/2):(b=circleRadius(S,b),w=circleRadius(S,w),(m>0?b<w:b>w)&&(b+=m*gn));for(var T,E=b;m>0?E>w:E<w;E-=k)T=spherical([S,-M*bn(E),-M*xn(E)]),c.point(T[0],T[1])}}function circleRadius(c,h){(h=cartesian(h))[0]-=c,cartesianNormalizeInPlace(h);var g=function math_acos(c){return c>1?0:c<-1?dn:Math.acos(c)}(-h[1]);return((-h[2]<0?-g:g)+gn-hn)%gn}var Mn=1e9,kn=-1e9;function rectangle_clipRectangle(c,h,g,m){function visible(b,w){return c<=b&&b<=g&&h<=w&&w<=m}function interpolate(b,w,S,M){var k=0,T=0;if(null==b||(k=corner(b,S))!==(T=corner(w,S))||comparePoint(b,w)<0^S>0)do{M.point(0===k||3===k?c:g,k>1?m:h)}while((k=(k+S+4)%4)!==T);else M.point(w[0],w[1])}function corner(m,b){return vn(m[0]-c)<hn?b>0?0:3:vn(m[0]-g)<hn?b>0?2:1:vn(m[1]-h)<hn?b>0?1:0:b>0?3:2}function compareIntersection(c,h){return comparePoint(c.x,h.x)}function comparePoint(c,h){var g=corner(c,1),m=corner(h,1);return g!==m?g-m:0===g?h[1]-c[1]:1===g?c[0]-h[0]:2===g?c[1]-h[1]:h[0]-c[0]}return function(b){var w,S,M,k,T,E,I,P,L,B,z,j=b,D=clip_buffer(),N={point,lineStart:function lineStart(){N.point=linePoint,S&&S.push(M=[]);B=!0,L=!1,I=P=NaN},lineEnd:function lineEnd(){w&&(linePoint(k,T),E&&L&&D.rejoin(),w.push(D.result()));N.point=point,L&&j.lineEnd()},polygonStart:function polygonStart(){j=D,w=[],S=[],z=!0},polygonEnd:function polygonEnd(){var h=function polygonInside(){for(var h=0,g=0,b=S.length;g<b;++g)for(var w,M,k=S[g],T=1,E=k.length,I=k[0],P=I[0],L=I[1];T<E;++T)w=P,M=L,P=(I=k[T])[0],L=I[1],M<=m?L>m&&(P-w)*(m-M)>(L-M)*(c-w)&&++h:L<=m&&(P-w)*(m-M)<(L-M)*(c-w)&&--h;return h}(),g=z&&h,k=(w=src_merge_merge(w)).length;(g||k)&&(b.polygonStart(),g&&(b.lineStart(),interpolate(null,null,1,b),b.lineEnd()),k&&clip_rejoin(w,compareIntersection,h,interpolate,b),b.polygonEnd());j=b,w=S=M=null}};function point(c,h){visible(c,h)&&j.point(c,h)}function linePoint(b,w){var D=visible(b,w);if(S&&M.push([b,w]),B)k=b,T=w,E=D,B=!1,D&&(j.lineStart(),j.point(b,w));else if(D&&L)j.point(b,w);else{var N=[I=Math.max(kn,Math.min(Mn,I)),P=Math.max(kn,Math.min(Mn,P))],R=[b=Math.max(kn,Math.min(Mn,b)),w=Math.max(kn,Math.min(Mn,w))];!function src_clip_line(c,h,g,m,b,w){var S,M=c[0],k=c[1],T=0,E=1,I=h[0]-M,P=h[1]-k;if(S=g-M,I||!(S>0)){if(S/=I,I<0){if(S<T)return;S<E&&(E=S)}else if(I>0){if(S>E)return;S>T&&(T=S)}if(S=b-M,I||!(S<0)){if(S/=I,I<0){if(S>E)return;S>T&&(T=S)}else if(I>0){if(S<T)return;S<E&&(E=S)}if(S=m-k,P||!(S>0)){if(S/=P,P<0){if(S<T)return;S<E&&(E=S)}else if(P>0){if(S>E)return;S>T&&(T=S)}if(S=w-k,P||!(S<0)){if(S/=P,P<0){if(S>E)return;S>T&&(T=S)}else if(P>0){if(S<T)return;S<E&&(E=S)}return T>0&&(c[0]=M+T*I,c[1]=k+T*P),E<1&&(h[0]=M+E*I,h[1]=k+E*P),!0}}}}}(N,R,c,h,g,m)?D&&(j.lineStart(),j.point(b,w),z=!1):(L||(j.lineStart(),j.point(N[0],N[1])),j.point(R[0],R[1]),D||j.lineEnd(),z=!1)}I=b,P=w,L=D}return N}}function compose(c,h){function compose(g,m){return g=c(g,m),h(g[0],g[1])}return c.invert&&h.invert&&(compose.invert=function(g,m){return(g=h.invert(g,m))&&c.invert(g[0],g[1])}),compose}const node_modules_d3_geo_src_identity=c=>c;function rotationIdentity(c,h){return[vn(c)>dn?c+Math.round(-c/gn)*gn:c,h]}function rotation_rotateRadians(c,h,g){return(c%=gn)?h||g?compose(rotationLambda(c),rotationPhiGamma(h,g)):rotationLambda(c):h||g?rotationPhiGamma(h,g):rotationIdentity}function forwardRotationLambda(c){return function(h,g){return[(h+=c)>dn?h-gn:h<-dn?h+gn:h,g]}}function rotationLambda(c){var h=forwardRotationLambda(c);return h.invert=forwardRotationLambda(-c),h}function rotationPhiGamma(c,h){var g=bn(c),m=xn(c),b=bn(h),w=xn(h);function rotation(c,h){var S=bn(h),M=bn(c)*S,k=xn(c)*S,T=xn(h),E=T*g+M*m;return[An(k*b-E*w,M*g-T*m),math_asin(E*b+k*w)]}return rotation.invert=function(c,h){var S=bn(h),M=bn(c)*S,k=xn(c)*S,T=xn(h),E=T*b-k*w;return[An(k*b+T*w,M*g+E*m),math_asin(E*g-M*m)]},rotation}function src_transform_transformer(c){return function(h){var g=new transform_TransformStream;for(var m in c)g[m]=c[m];return g.stream=h,g}}function transform_TransformStream(){}function stream_streamGeometry(c,h){c&&En.hasOwnProperty(c.type)&&En[c.type](c,h)}rotationIdentity.invert=rotationIdentity,transform_TransformStream.prototype={constructor:transform_TransformStream,point:function(c,h){this.stream.point(c,h)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Tn={Feature:function(c,h){stream_streamGeometry(c.geometry,h)},FeatureCollection:function(c,h){for(var g=c.features,m=-1,b=g.length;++m<b;)stream_streamGeometry(g[m].geometry,h)}},En={Sphere:function(c,h){h.sphere()},Point:function(c,h){c=c.coordinates,h.point(c[0],c[1],c[2])},MultiPoint:function(c,h){for(var g=c.coordinates,m=-1,b=g.length;++m<b;)c=g[m],h.point(c[0],c[1],c[2])},LineString:function(c,h){stream_streamLine(c.coordinates,h,0)},MultiLineString:function(c,h){for(var g=c.coordinates,m=-1,b=g.length;++m<b;)stream_streamLine(g[m],h,0)},Polygon:function(c,h){stream_streamPolygon(c.coordinates,h)},MultiPolygon:function(c,h){for(var g=c.coordinates,m=-1,b=g.length;++m<b;)stream_streamPolygon(g[m],h)},GeometryCollection:function(c,h){for(var g=c.geometries,m=-1,b=g.length;++m<b;)stream_streamGeometry(g[m],h)}};function stream_streamLine(c,h,g){var m,b=-1,w=c.length-g;for(h.lineStart();++b<w;)m=c[b],h.point(m[0],m[1],m[2]);h.lineEnd()}function stream_streamPolygon(c,h){var g=-1,m=c.length;for(h.polygonStart();++g<m;)stream_streamLine(c[g],h,1);h.polygonEnd()}var In=1/0,Pn=In,Ln=-In,Fn=Ln,Bn={point:function bounds_boundsPoint(c,h){c<In&&(In=c);c>Ln&&(Ln=c);h<Pn&&(Pn=h);h>Fn&&(Fn=h)},lineStart:noop_noop,lineEnd:noop_noop,polygonStart:noop_noop,polygonEnd:noop_noop,result:function(){var c=[[In,Pn],[Ln,Fn]];return Ln=Fn=-(Pn=In=1/0),c}};const On=Bn;function fit_fit(c,h,g){var m=c.clipExtent&&c.clipExtent();return c.scale(150).translate([0,0]),null!=m&&c.clipExtent(null),function src_stream(c,h){c&&Tn.hasOwnProperty(c.type)?Tn[c.type](c,h):stream_streamGeometry(c,h)}(g,c.stream(On)),h(On.result()),null!=m&&c.clipExtent(m),c}function fit_fitExtent(c,h,g){return fit_fit(c,function(g){var m=h[1][0]-h[0][0],b=h[1][1]-h[0][1],w=Math.min(m/(g[1][0]-g[0][0]),b/(g[1][1]-g[0][1])),S=+h[0][0]+(m-w*(g[1][0]+g[0][0]))/2,M=+h[0][1]+(b-w*(g[1][1]+g[0][1]))/2;c.scale(150*w).translate([S,M])},g)}var zn=bn(30*mn);function resample(c,h){return+h?function resample_resample(c,h){function resampleLineTo(g,m,b,w,S,M,k,T,E,I,P,L,B,z){var j=k-g,D=T-m,N=j*j+D*D;if(N>4*h&&B--){var R=w+I,G=S+P,q=M+L,W=Cn(R*R+G*G+q*q),H=math_asin(q/=W),U=vn(vn(q)-1)<hn||vn(b-E)<hn?(b+E)/2:An(G,R),Y=c(U,H),V=Y[0],$=Y[1],X=V-g,K=$-m,Z=D*X-j*K;(Z*Z/N>h||vn((j*X+D*K)/N-.5)>.3||w*I+S*P+M*L<zn)&&(resampleLineTo(g,m,b,w,S,M,V,$,U,R/=W,G/=W,q,B,z),z.point(V,$),resampleLineTo(V,$,U,R,G,q,k,T,E,I,P,L,B,z))}}return function(h){var g,m,b,w,S,M,k,T,E,I,P,L,B={point,lineStart,lineEnd,polygonStart:function(){h.polygonStart(),B.lineStart=ringStart},polygonEnd:function(){h.polygonEnd(),B.lineStart=lineStart}};function point(g,m){g=c(g,m),h.point(g[0],g[1])}function lineStart(){T=NaN,B.point=linePoint,h.lineStart()}function linePoint(g,m){var b=cartesian([g,m]),w=c(g,m);resampleLineTo(T,E,k,I,P,L,T=w[0],E=w[1],k=g,I=b[0],P=b[1],L=b[2],16,h),h.point(T,E)}function lineEnd(){B.point=point,h.lineEnd()}function ringStart(){lineStart(),B.point=ringPoint,B.lineEnd=ringEnd}function ringPoint(c,h){linePoint(g=c,h),m=T,b=E,w=I,S=P,M=L,B.point=linePoint}function ringEnd(){resampleLineTo(T,E,k,I,P,L,m,b,g,w,S,M,16,h),B.lineEnd=lineEnd,lineEnd()}return B}}(c,h):function resampleNone(c){return src_transform_transformer({point:function(h,g){h=c(h,g),this.stream.point(h[0],h[1])}})}(c)}var jn=src_transform_transformer({point:function(c,h){this.stream.point(c*mn,h*mn)}});function scaleTranslateRotate(c,h,g,m,b,w){if(!w)return function scaleTranslate(c,h,g,m,b){function transform(w,S){return[h+c*(w*=m),g-c*(S*=b)]}return transform.invert=function(w,S){return[(w-h)/c*m,(g-S)/c*b]},transform}(c,h,g,m,b);var S=bn(w),M=xn(w),k=S*c,T=M*c,E=S/c,I=M/c,P=(M*g-S*h)/c,L=(M*h+S*g)/c;function transform(c,w){return[k*(c*=m)-T*(w*=b)+h,g-T*c-k*w]}return transform.invert=function(c,h){return[m*(E*c-I*h+P),b*(L-I*c-E*h)]},transform}function projection(c){return function projectionMutator(c){var h,g,m,b,w,S,M,k,T,E,I=150,P=480,L=250,B=0,z=0,j=0,D=0,N=0,R=0,G=1,q=1,W=null,H=Sn,U=null,Y=node_modules_d3_geo_src_identity,V=.5;function projection(c){return k(c[0]*mn,c[1]*mn)}function invert(c){return(c=k.invert(c[0],c[1]))&&[c[0]*_n,c[1]*_n]}function recenter(){var c=scaleTranslateRotate(I,0,0,G,q,R).apply(null,h(B,z)),m=scaleTranslateRotate(I,P-c[0],L-c[1],G,q,R);return g=rotation_rotateRadians(j,D,N),M=compose(h,m),k=compose(g,M),S=resample(M,V),reset()}function reset(){return T=E=null,projection}return projection.stream=function(c){return T&&E===c?T:T=jn(function transformRotate(c){return src_transform_transformer({point:function(h,g){var m=c(h,g);return this.stream.point(m[0],m[1])}})}(g)(H(S(Y(E=c)))))},projection.preclip=function(c){return arguments.length?(H=c,W=void 0,reset()):H},projection.postclip=function(c){return arguments.length?(Y=c,U=m=b=w=null,reset()):Y},projection.clipAngle=function(c){return arguments.length?(H=+c?function clip_circle(c){var h=bn(c),g=6*mn,m=h>0,b=vn(h)>hn;function visible(c,g){return bn(c)*bn(g)>h}function intersect(c,g,m){var b=[1,0,0],w=cartesianCross(cartesian(c),cartesian(g)),S=cartesianDot(w,w),M=w[0],k=S-M*M;if(!k)return!m&&c;var T=h*S/k,E=-h*M/k,I=cartesianCross(b,w),P=cartesianScale(b,T);cartesianAddInPlace(P,cartesianScale(w,E));var L=I,B=cartesianDot(P,L),z=cartesianDot(L,L),j=B*B-z*(cartesianDot(P,P)-1);if(!(j<0)){var D=Cn(j),N=cartesianScale(L,(-B-D)/z);if(cartesianAddInPlace(N,P),N=spherical(N),!m)return N;var R,G=c[0],q=g[0],W=c[1],H=g[1];q<G&&(R=G,G=q,q=R);var U=q-G,Y=vn(U-dn)<hn;if(!Y&&H<W&&(R=W,W=H,H=R),Y||U<hn?Y?W+H>0^N[1]<(vn(N[0]-G)<hn?W:H):W<=N[1]&&N[1]<=H:U>dn^(G<=N[0]&&N[0]<=q)){var V=cartesianScale(L,(-B+D)/z);return cartesianAddInPlace(V,P),[N,spherical(V)]}}}function code(h,g){var b=m?c:dn-c,w=0;return h<-b?w|=1:h>b&&(w|=2),g<-b?w|=4:g>b&&(w|=8),w}return clip(visible,function clipLine(c){var h,g,w,S,M;return{lineStart:function(){S=w=!1,M=1},point:function(k,T){var E,I=[k,T],P=visible(k,T),L=m?P?0:code(k,T):P?code(k+(k<0?dn:-dn),T):0;if(!h&&(S=w=P)&&c.lineStart(),P!==w&&(!(E=intersect(h,I))||src_pointEqual(h,E)||src_pointEqual(I,E))&&(I[2]=1),P!==w)M=0,P?(c.lineStart(),E=intersect(I,h),c.point(E[0],E[1])):(E=intersect(h,I),c.point(E[0],E[1],2),c.lineEnd()),h=E;else if(b&&h&&m^P){var B;L&g||!(B=intersect(I,h,!0))||(M=0,m?(c.lineStart(),c.point(B[0][0],B[0][1]),c.point(B[1][0],B[1][1]),c.lineEnd()):(c.point(B[1][0],B[1][1]),c.lineEnd(),c.lineStart(),c.point(B[0][0],B[0][1],3)))}!P||h&&src_pointEqual(h,I)||c.point(I[0],I[1]),h=I,w=P,g=L},lineEnd:function(){w&&c.lineEnd(),h=null},clean:function(){return M|(S&&w)<<1}}},function interpolate(h,m,b,w){circleStream(w,c,g,b,h,m)},m?[0,-c]:[-dn,c-dn])}(W=c*mn):(W=null,Sn),reset()):W*_n},projection.clipExtent=function(c){return arguments.length?(Y=null==c?(U=m=b=w=null,node_modules_d3_geo_src_identity):rectangle_clipRectangle(U=+c[0][0],m=+c[0][1],b=+c[1][0],w=+c[1][1]),reset()):null==U?null:[[U,m],[b,w]]},projection.scale=function(c){return arguments.length?(I=+c,recenter()):I},projection.translate=function(c){return arguments.length?(P=+c[0],L=+c[1],recenter()):[P,L]},projection.center=function(c){return arguments.length?(B=c[0]%360*mn,z=c[1]%360*mn,recenter()):[B*_n,z*_n]},projection.rotate=function(c){return arguments.length?(j=c[0]%360*mn,D=c[1]%360*mn,N=c.length>2?c[2]%360*mn:0,recenter()):[j*_n,D*_n,N*_n]},projection.angle=function(c){return arguments.length?(R=c%360*mn,recenter()):R*_n},projection.reflectX=function(c){return arguments.length?(G=c?-1:1,recenter()):G<0},projection.reflectY=function(c){return arguments.length?(q=c?-1:1,recenter()):q<0},projection.precision=function(c){return arguments.length?(S=resample(M,V=c*c),reset()):Cn(V)},projection.fitExtent=function(c,h){return fit_fitExtent(projection,c,h)},projection.fitSize=function(c,h){return function fit_fitSize(c,h,g){return fit_fitExtent(c,[[0,0],h],g)}(projection,c,h)},projection.fitWidth=function(c,h){return function fit_fitWidth(c,h,g){return fit_fit(c,function(g){var m=+h,b=m/(g[1][0]-g[0][0]),w=(m-b*(g[1][0]+g[0][0]))/2,S=-b*g[0][1];c.scale(150*b).translate([w,S])},g)}(projection,c,h)},projection.fitHeight=function(c,h){return function fit_fitHeight(c,h,g){return fit_fit(c,function(g){var m=+h,b=m/(g[1][1]-g[0][1]),w=-b*g[0][0],S=(m-b*(g[1][1]+g[0][1]))/2;c.scale(150*b).translate([w,S])},g)}(projection,c,h)},function(){return h=c.apply(this,arguments),projection.invert=h.invert&&invert,recenter()}}(function(){return c})()}var Dn=Math.abs,Nn=(Math.atan,Math.atan2,Math.ceil,Math.cos,Math.exp,Math.floor),Rn=(Math.log,Math.max),Gn=Math.min,qn=(Math.pow,Math.round,Math.sign,Math.sin,Math.tan,Math.PI),Wn=qn/2,Hn=(Math.SQRT1_2,src_math_sqrt(2),src_math_sqrt(qn),180/qn),Un=qn/180;function src_math_sqrt(c){return c>0?Math.sqrt(c):0}var Yn=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];function robinsonRaw(c,h){var g,m=Gn(18,36*Dn(h)/qn),b=Nn(m),w=m-b,S=(g=Yn[b])[0],M=g[1],k=(g=Yn[++b])[0],T=g[1],E=(g=Yn[Gn(19,++b)])[0],I=g[1];return[c*(k+w*(E-S)/2+w*w*(E-2*k+S)/2),(h>0?Wn:-Wn)*(T+w*(I-M)/2+w*w*(I-2*T+M)/2)]}Yn.forEach(function(c){c[1]*=1.0144}),robinsonRaw.invert=function(c,h){var g=h/Wn,m=90*g,b=Gn(18,Dn(m/5)),w=Rn(0,Nn(b));do{var S=Yn[w][1],M=Yn[w+1][1],k=Yn[Gn(19,w+2)][1],T=k-S,E=k-2*M+S,I=2*(Dn(g)-M)/T,P=E/T,L=I*(1-P*I*(1-2*P*I));if(L>=0||1===w){m=(h>=0?5:-5)*(L+b);var B,z=50;do{L=(b=Gn(18,Dn(m)/5))-(w=Nn(b)),S=Yn[w][1],M=Yn[w+1][1],k=Yn[Gn(19,w+2)][1],m-=(B=(h>=0?Wn:-Wn)*(M+L*(k-S)/2+L*L*(k-2*M+S)/2)-h)*Hn}while(Dn(B)>1e-12&&--z>0);break}}while(--w>=0);var j=Yn[w][0],D=Yn[w+1][0],N=Yn[Gn(19,w+2)][0];return[c/(D+L*(N-j)/2+L*L*(N-2*D+j)/2),m*Un]};var Vn="http://www.w3.org/1999/xhtml";const $n={svg:"http://www.w3.org/2000/svg",xhtml:Vn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function src_namespace(c){var h=c+="",g=h.indexOf(":");return g>=0&&"xmlns"!==(h=c.slice(0,g))&&(c=c.slice(g+1)),$n.hasOwnProperty(h)?{space:$n[h],local:c}:c}function creator_creatorInherit(c){return function(){var h=this.ownerDocument,g=this.namespaceURI;return g===Vn&&h.documentElement.namespaceURI===Vn?h.createElement(c):h.createElementNS(g,c)}}function creator_creatorFixed(c){return function(){return this.ownerDocument.createElementNS(c.space,c.local)}}function d3_selection_src_creator(c){var h=src_namespace(c);return(h.local?creator_creatorFixed:creator_creatorInherit)(h)}function selector_none(){}function src_selector(c){return null==c?selector_none:function(){return this.querySelector(c)}}function selectorAll_empty(){return[]}function selection_sparse(c){return new Array(c.length)}function enter_EnterNode(c,h){this.ownerDocument=c.ownerDocument,this.namespaceURI=c.namespaceURI,this._next=null,this._parent=c,this.__data__=h}enter_EnterNode.prototype={constructor:enter_EnterNode,appendChild:function(c){return this._parent.insertBefore(c,this._next)},insertBefore:function(c,h){return this._parent.insertBefore(c,h)},querySelector:function(c){return this._parent.querySelector(c)},querySelectorAll:function(c){return this._parent.querySelectorAll(c)}};function data_bindIndex(c,h,g,m,b,w){for(var S,M=0,k=h.length,T=w.length;M<T;++M)(S=h[M])?(S.__data__=w[M],m[M]=S):g[M]=new enter_EnterNode(c,w[M]);for(;M<k;++M)(S=h[M])&&(b[M]=S)}function data_bindKey(c,h,g,m,b,w,S){var M,k,T,E={},I=h.length,P=w.length,L=new Array(I);for(M=0;M<I;++M)(k=h[M])&&(L[M]=T="$"+S.call(k,k.__data__,M,h),T in E?b[M]=k:E[T]=k);for(M=0;M<P;++M)(k=E[T="$"+S.call(c,w[M],M,w)])?(m[M]=k,k.__data__=w[M],E[T]=null):g[M]=new enter_EnterNode(c,w[M]);for(M=0;M<I;++M)(k=h[M])&&E[L[M]]===k&&(b[M]=k)}function sort_ascending(c,h){return c<h?-1:c>h?1:c>=h?0:NaN}function attr_attrRemove(c){return function(){this.removeAttribute(c)}}function attr_attrRemoveNS(c){return function(){this.removeAttributeNS(c.space,c.local)}}function attr_attrConstant(c,h){return function(){this.setAttribute(c,h)}}function attr_attrConstantNS(c,h){return function(){this.setAttributeNS(c.space,c.local,h)}}function attr_attrFunction(c,h){return function(){var g=h.apply(this,arguments);null==g?this.removeAttribute(c):this.setAttribute(c,g)}}function attr_attrFunctionNS(c,h){return function(){var g=h.apply(this,arguments);null==g?this.removeAttributeNS(c.space,c.local):this.setAttributeNS(c.space,c.local,g)}}function d3_selection_src_window(c){return c.ownerDocument&&c.ownerDocument.defaultView||c.document&&c||c.defaultView}function style_styleRemove(c){return function(){this.style.removeProperty(c)}}function style_styleConstant(c,h,g){return function(){this.style.setProperty(c,h,g)}}function style_styleFunction(c,h,g){return function(){var m=h.apply(this,arguments);null==m?this.style.removeProperty(c):this.style.setProperty(c,m,g)}}function property_propertyRemove(c){return function(){delete this[c]}}function property_propertyConstant(c,h){return function(){this[c]=h}}function property_propertyFunction(c,h){return function(){var g=h.apply(this,arguments);null==g?delete this[c]:this[c]=g}}function classed_classArray(c){return c.trim().split(/^|\s+/)}function classed_classList(c){return c.classList||new classed_ClassList(c)}function classed_ClassList(c){this._node=c,this._names=classed_classArray(c.getAttribute("class")||"")}function classed_classedAdd(c,h){for(var g=classed_classList(c),m=-1,b=h.length;++m<b;)g.add(h[m])}function classed_classedRemove(c,h){for(var g=classed_classList(c),m=-1,b=h.length;++m<b;)g.remove(h[m])}function classed_classedTrue(c){return function(){classed_classedAdd(this,c)}}function classed_classedFalse(c){return function(){classed_classedRemove(this,c)}}function classed_classedFunction(c,h){return function(){(h.apply(this,arguments)?classed_classedAdd:classed_classedRemove)(this,c)}}function text_textRemove(){this.textContent=""}function text_textConstant(c){return function(){this.textContent=c}}function text_textFunction(c){return function(){var h=c.apply(this,arguments);this.textContent=null==h?"":h}}function html_htmlRemove(){this.innerHTML=""}function html_htmlConstant(c){return function(){this.innerHTML=c}}function html_htmlFunction(c){return function(){var h=c.apply(this,arguments);this.innerHTML=null==h?"":h}}function raise_raise(){this.nextSibling&&this.parentNode.appendChild(this)}function lower_lower(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function insert_constantNull(){return null}function remove_remove(){var c=this.parentNode;c&&c.removeChild(this)}function clone_selection_cloneShallow(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function clone_selection_cloneDeep(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}classed_ClassList.prototype={add:function(c){this._names.indexOf(c)<0&&(this._names.push(c),this._node.setAttribute("class",this._names.join(" ")))},remove:function(c){var h=this._names.indexOf(c);h>=0&&(this._names.splice(h,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(c){return this._names.indexOf(c)>=0}};var Xn={},Kn=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(Xn={mouseenter:"mouseover",mouseleave:"mouseout"}));function filterContextListener(c,h,g){return c=on_contextListener(c,h,g),function(h){var g=h.relatedTarget;g&&(g===this||8&g.compareDocumentPosition(this))||c.call(this,h)}}function on_contextListener(c,h,g){return function(m){var b=Kn;Kn=m;try{c.call(this,this.__data__,h,g)}finally{Kn=b}}}function on_onRemove(c){return function(){var h=this.__on;if(h){for(var g,m=0,b=-1,w=h.length;m<w;++m)g=h[m],c.type&&g.type!==c.type||g.name!==c.name?h[++b]=g:this.removeEventListener(g.type,g.listener,g.capture);++b?h.length=b:delete this.__on}}}function on_onAdd(c,h,g){var m=Xn.hasOwnProperty(c.type)?filterContextListener:on_contextListener;return function(b,w,S){var M,k=this.__on,T=m(h,w,S);if(k)for(var E=0,I=k.length;E<I;++E)if((M=k[E]).type===c.type&&M.name===c.name)return this.removeEventListener(M.type,M.listener,M.capture),this.addEventListener(M.type,M.listener=T,M.capture=g),void(M.value=h);this.addEventListener(c.type,T,g),M={type:c.type,name:c.name,value:h,listener:T,capture:g},k?k.push(M):this.__on=[M]}}function customEvent(c,h,g,m){var b=Kn;c.sourceEvent=Kn,Kn=c;try{return h.apply(g,m)}finally{Kn=b}}function dispatch_dispatchEvent(c,h,g){var m=d3_selection_src_window(c),b=m.CustomEvent;"function"==typeof b?b=new b(h,g):(b=m.document.createEvent("Event"),g?(b.initEvent(h,g.bubbles,g.cancelable),b.detail=g.detail):b.initEvent(h,!1,!1)),c.dispatchEvent(b)}function dispatch_dispatchConstant(c,h){return function(){return dispatch_dispatchEvent(this,c,h)}}function dispatch_dispatchFunction(c,h){return function(){return dispatch_dispatchEvent(this,c,h.apply(this,arguments))}}var Zn=[null];function src_selection_Selection(c,h){this._groups=c,this._parents=h}function src_selection_selection(){return new src_selection_Selection([[document.documentElement]],Zn)}src_selection_Selection.prototype=src_selection_selection.prototype={constructor:src_selection_Selection,select:function src_selection_select(c){"function"!=typeof c&&(c=src_selector(c));for(var h=this._groups,g=h.length,m=new Array(g),b=0;b<g;++b)for(var w,S,M=h[b],k=M.length,T=m[b]=new Array(k),E=0;E<k;++E)(w=M[E])&&(S=c.call(w,w.__data__,E,M))&&("__data__"in w&&(S.__data__=w.__data__),T[E]=S);return new src_selection_Selection(m,this._parents)},selectAll:function selection_selectAll(c){"function"!=typeof c&&(c=function src_selectorAll(c){return null==c?selectorAll_empty:function(){return this.querySelectorAll(c)}}(c));for(var h=this._groups,g=h.length,m=[],b=[],w=0;w<g;++w)for(var S,M=h[w],k=M.length,T=0;T<k;++T)(S=M[T])&&(m.push(c.call(S,S.__data__,T,M)),b.push(S));return new src_selection_Selection(m,b)},filter:function src_selection_filter(c){"function"!=typeof c&&(c=function src_matcher(c){return function(){return this.matches(c)}}(c));for(var h=this._groups,g=h.length,m=new Array(g),b=0;b<g;++b)for(var w,S=h[b],M=S.length,k=m[b]=[],T=0;T<M;++T)(w=S[T])&&c.call(w,w.__data__,T,S)&&k.push(w);return new src_selection_Selection(m,this._parents)},data:function selection_data(c,h){if(!c)return L=new Array(this.size()),T=-1,this.each(function(c){L[++T]=c}),L;var g=h?data_bindKey:data_bindIndex,m=this._parents,b=this._groups;"function"!=typeof c&&(c=function d3_selection_src_constant(c){return function(){return c}}(c));for(var w=b.length,S=new Array(w),M=new Array(w),k=new Array(w),T=0;T<w;++T){var E=m[T],I=b[T],P=I.length,L=c.call(E,E&&E.__data__,T,m),B=L.length,z=M[T]=new Array(B),j=S[T]=new Array(B);g(E,I,z,j,k[T]=new Array(P),L,h);for(var D,N,R=0,G=0;R<B;++R)if(D=z[R]){for(R>=G&&(G=R+1);!(N=j[G])&&++G<B;);D._next=N||null}}return(S=new src_selection_Selection(S,m))._enter=M,S._exit=k,S},enter:function selection_enter(){return new src_selection_Selection(this._enter||this._groups.map(selection_sparse),this._parents)},exit:function selection_exit(){return new src_selection_Selection(this._exit||this._groups.map(selection_sparse),this._parents)},join:function selection_join(c,h,g){var m=this.enter(),b=this,w=this.exit();return m="function"==typeof c?c(m):m.append(c+""),null!=h&&(b=h(b)),null==g?w.remove():g(w),m&&b?m.merge(b).order():b},merge:function selection_merge(c){for(var h=this._groups,g=c._groups,m=h.length,b=g.length,w=Math.min(m,b),S=new Array(m),M=0;M<w;++M)for(var k,T=h[M],E=g[M],I=T.length,P=S[M]=new Array(I),L=0;L<I;++L)(k=T[L]||E[L])&&(P[L]=k);for(;M<m;++M)S[M]=h[M];return new src_selection_Selection(S,this._parents)},order:function selection_order(){for(var c=this._groups,h=-1,g=c.length;++h<g;)for(var m,b=c[h],w=b.length-1,S=b[w];--w>=0;)(m=b[w])&&(S&&4^m.compareDocumentPosition(S)&&S.parentNode.insertBefore(m,S),S=m);return this},sort:function selection_sort(c){function compareNode(h,g){return h&&g?c(h.__data__,g.__data__):!h-!g}c||(c=sort_ascending);for(var h=this._groups,g=h.length,m=new Array(g),b=0;b<g;++b){for(var w,S=h[b],M=S.length,k=m[b]=new Array(M),T=0;T<M;++T)(w=S[T])&&(k[T]=w);k.sort(compareNode)}return new src_selection_Selection(m,this._parents).order()},call:function selection_call(){var c=arguments[0];return arguments[0]=this,c.apply(null,arguments),this},nodes:function selection_nodes(){var c=new Array(this.size()),h=-1;return this.each(function(){c[++h]=this}),c},node:function selection_node(){for(var c=this._groups,h=0,g=c.length;h<g;++h)for(var m=c[h],b=0,w=m.length;b<w;++b){var S=m[b];if(S)return S}return null},size:function selection_size(){var c=0;return this.each(function(){++c}),c},empty:function src_selection_empty(){return!this.node()},each:function selection_each(c){for(var h=this._groups,g=0,m=h.length;g<m;++g)for(var b,w=h[g],S=0,M=w.length;S<M;++S)(b=w[S])&&c.call(b,b.__data__,S,w);return this},attr:function selection_attr(c,h){var g=src_namespace(c);if(arguments.length<2){var m=this.node();return g.local?m.getAttributeNS(g.space,g.local):m.getAttribute(g)}return this.each((null==h?g.local?attr_attrRemoveNS:attr_attrRemove:"function"==typeof h?g.local?attr_attrFunctionNS:attr_attrFunction:g.local?attr_attrConstantNS:attr_attrConstant)(g,h))},style:function selection_style(c,h,g){return arguments.length>1?this.each((null==h?style_styleRemove:"function"==typeof h?style_styleFunction:style_styleConstant)(c,h,null==g?"":g)):function style_styleValue(c,h){return c.style.getPropertyValue(h)||d3_selection_src_window(c).getComputedStyle(c,null).getPropertyValue(h)}(this.node(),c)},property:function selection_property(c,h){return arguments.length>1?this.each((null==h?property_propertyRemove:"function"==typeof h?property_propertyFunction:property_propertyConstant)(c,h)):this.node()[c]},classed:function selection_classed(c,h){var g=classed_classArray(c+"");if(arguments.length<2){for(var m=classed_classList(this.node()),b=-1,w=g.length;++b<w;)if(!m.contains(g[b]))return!1;return!0}return this.each(("function"==typeof h?classed_classedFunction:h?classed_classedTrue:classed_classedFalse)(g,h))},text:function src_selection_text(c){return arguments.length?this.each(null==c?text_textRemove:("function"==typeof c?text_textFunction:text_textConstant)(c)):this.node().textContent},html:function selection_html(c){return arguments.length?this.each(null==c?html_htmlRemove:("function"==typeof c?html_htmlFunction:html_htmlConstant)(c)):this.node().innerHTML},raise:function src_selection_raise(){return this.each(raise_raise)},lower:function src_selection_lower(){return this.each(lower_lower)},append:function selection_append(c){var h="function"==typeof c?c:d3_selection_src_creator(c);return this.select(function(){return this.appendChild(h.apply(this,arguments))})},insert:function selection_insert(c,h){var g="function"==typeof c?c:d3_selection_src_creator(c),m=null==h?insert_constantNull:"function"==typeof h?h:src_selector(h);return this.select(function(){return this.insertBefore(g.apply(this,arguments),m.apply(this,arguments)||null)})},remove:function src_selection_remove(){return this.each(remove_remove)},clone:function selection_clone(c){return this.select(c?clone_selection_cloneDeep:clone_selection_cloneShallow)},datum:function src_selection_datum(c){return arguments.length?this.property("__data__",c):this.node().__data__},on:function selection_on(c,h,g){var m,b,w=function on_parseTypenames(c){return c.trim().split(/^|\s+/).map(function(c){var h="",g=c.indexOf(".");return g>=0&&(h=c.slice(g+1),c=c.slice(0,g)),{type:c,name:h}})}(c+""),S=w.length;if(!(arguments.length<2)){for(M=h?on_onAdd:on_onRemove,null==g&&(g=!1),m=0;m<S;++m)this.each(M(w[m],h,g));return this}var M=this.node().__on;if(M)for(var k,T=0,E=M.length;T<E;++T)for(m=0,k=M[T];m<S;++m)if((b=w[m]).type===k.type&&b.name===k.name)return k.value},dispatch:function selection_dispatch(c,h){return this.each(("function"==typeof h?dispatch_dispatchFunction:dispatch_dispatchConstant)(c,h))}};function d3_selection_src_select(c){return"string"==typeof c?new src_selection_Selection([[document.querySelector(c)]],[document.documentElement]):new src_selection_Selection([[c]],Zn)}var Jn=0;function Local(){this._="@"+(++Jn).toString(36)}function src_sourceEvent(){for(var c,h=Kn;c=h.sourceEvent;)h=c;return h}function src_point(c,h){var g=c.ownerSVGElement||c;if(g.createSVGPoint){var m=g.createSVGPoint();return m.x=h.clientX,m.y=h.clientY,[(m=m.matrixTransform(c.getScreenCTM().inverse())).x,m.y]}var b=c.getBoundingClientRect();return[h.clientX-b.left-c.clientLeft,h.clientY-b.top-c.clientTop]}function mouse(c){var h=src_sourceEvent();return h.changedTouches&&(h=h.changedTouches[0]),src_point(c,h)}function touch(c,h,g){arguments.length<3&&(g=h,h=src_sourceEvent().changedTouches);for(var m,b=0,w=h?h.length:0;b<w;++b)if((m=h[b]).identifier===g)return src_point(c,m);return null}Local.prototype=function local(){return new Local}.prototype={constructor:Local,get:function(c){for(var h=this._;!(h in c);)if(!(c=c.parentNode))return;return c[h]},set:function(c,h){return c[this._]=h},remove:function(c){return this._ in c&&delete c[this._]},toString:function(){return this._}};var Qn={value:function(){}};function dispatch_dispatch(){for(var c,h=0,g=arguments.length,m={};h<g;++h){if(!(c=arguments[h]+"")||c in m)throw new Error("illegal type: "+c);m[c]=[]}return new Dispatch(m)}function Dispatch(c){this._=c}function get(c,h){for(var g,m=0,b=c.length;m<b;++m)if((g=c[m]).name===h)return g.value}function set(c,h,g){for(var m=0,b=c.length;m<b;++m)if(c[m].name===h){c[m]=Qn,c=c.slice(0,m).concat(c.slice(m+1));break}return null!=g&&c.push({name:h,value:g}),c}Dispatch.prototype=dispatch_dispatch.prototype={constructor:Dispatch,on:function(c,h){var g,m=this._,b=function dispatch_parseTypenames(c,h){return c.trim().split(/^|\s+/).map(function(c){var g="",m=c.indexOf(".");if(m>=0&&(g=c.slice(m+1),c=c.slice(0,m)),c&&!h.hasOwnProperty(c))throw new Error("unknown type: "+c);return{type:c,name:g}})}(c+"",m),w=-1,S=b.length;if(!(arguments.length<2)){if(null!=h&&"function"!=typeof h)throw new Error("invalid callback: "+h);for(;++w<S;)if(g=(c=b[w]).type)m[g]=set(m[g],c.name,h);else if(null==h)for(g in m)m[g]=set(m[g],c.name,null);return this}for(;++w<S;)if((g=(c=b[w]).type)&&(g=get(m[g],c.name)))return g},copy:function(){var c={},h=this._;for(var g in h)c[g]=h[g].slice();return new Dispatch(c)},call:function(c,h){if((g=arguments.length-2)>0)for(var g,m,b=new Array(g),w=0;w<g;++w)b[w]=arguments[w+2];if(!this._.hasOwnProperty(c))throw new Error("unknown type: "+c);for(w=0,g=(m=this._[c]).length;w<g;++w)m[w].value.apply(h,b)},apply:function(c,h,g){if(!this._.hasOwnProperty(c))throw new Error("unknown type: "+c);for(var m=this._[c],b=0,w=m.length;b<w;++b)m[b].value.apply(h,g)}};const tr=dispatch_dispatch;function nopropagation(){Kn.stopImmediatePropagation()}function noevent(){Kn.preventDefault(),Kn.stopImmediatePropagation()}function d3_drag_src_constant(c){return function(){return c}}function DragEvent(c,h,g,m,b,w,S,M,k,T){this.target=c,this.type=h,this.subject=g,this.identifier=m,this.active=b,this.x=w,this.y=S,this.dx=M,this.dy=k,this._=T}function defaultFilter(){return!Kn.button}function defaultContainer(){return this.parentNode}function defaultSubject(c){return null==c?{x:Kn.x,y:Kn.y}:c}function defaultTouchable(){return"ontouchstart"in this}function drag(){var c,h,g,m,b=defaultFilter,w=defaultContainer,S=defaultSubject,M=defaultTouchable,k={},T=tr("start","drag","end"),E=0,I=0;function drag(c){c.on("mousedown.drag",mousedowned).filter(M).on("touchstart.drag",touchstarted).on("touchmove.drag",touchmoved).on("touchend.drag touchcancel.drag",touchended).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function mousedowned(){if(!m&&b.apply(this,arguments)){var S=beforestart("mouse",w.apply(this,arguments),mouse,this,arguments);S&&(d3_selection_src_select(Kn.view).on("mousemove.drag",mousemoved,!0).on("mouseup.drag",mouseupped,!0),function nodrag(c){var h=c.document.documentElement,g=d3_selection_src_select(c).on("dragstart.drag",noevent,!0);"onselectstart"in h?g.on("selectstart.drag",noevent,!0):(h.__noselect=h.style.MozUserSelect,h.style.MozUserSelect="none")}(Kn.view),nopropagation(),g=!1,c=Kn.clientX,h=Kn.clientY,S("start"))}}function mousemoved(){if(noevent(),!g){var m=Kn.clientX-c,b=Kn.clientY-h;g=m*m+b*b>I}k.mouse("drag")}function mouseupped(){d3_selection_src_select(Kn.view).on("mousemove.drag mouseup.drag",null),function yesdrag(c,h){var g=c.document.documentElement,m=d3_selection_src_select(c).on("dragstart.drag",null);h&&(m.on("click.drag",noevent,!0),setTimeout(function(){m.on("click.drag",null)},0)),"onselectstart"in g?m.on("selectstart.drag",null):(g.style.MozUserSelect=g.__noselect,delete g.__noselect)}(Kn.view,g),noevent(),k.mouse("end")}function touchstarted(){if(b.apply(this,arguments)){var c,h,g=Kn.changedTouches,m=w.apply(this,arguments),S=g.length;for(c=0;c<S;++c)(h=beforestart(g[c].identifier,m,touch,this,arguments))&&(nopropagation(),h("start"))}}function touchmoved(){var c,h,g=Kn.changedTouches,m=g.length;for(c=0;c<m;++c)(h=k[g[c].identifier])&&(noevent(),h("drag"))}function touchended(){var c,h,g=Kn.changedTouches,b=g.length;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),c=0;c<b;++c)(h=k[g[c].identifier])&&(nopropagation(),h("end"))}function beforestart(c,h,g,m,b){var w,M,I,P=g(h,c),L=T.copy();if(customEvent(new DragEvent(drag,"beforestart",w,c,E,P[0],P[1],0,0,L),function(){return null!=(Kn.subject=w=S.apply(m,b))&&(M=w.x-P[0]||0,I=w.y-P[1]||0,!0)}))return function gesture(S){var T,B=P;switch(S){case"start":k[c]=gesture,T=E++;break;case"end":delete k[c],--E;case"drag":P=g(h,c),T=E}customEvent(new DragEvent(drag,S,w,c,T,P[0]+M,P[1]+I,P[0]-B[0],P[1]-B[1],L),L.apply,L,[S,m,b])}}return drag.filter=function(c){return arguments.length?(b="function"==typeof c?c:d3_drag_src_constant(!!c),drag):b},drag.container=function(c){return arguments.length?(w="function"==typeof c?c:d3_drag_src_constant(c),drag):w},drag.subject=function(c){return arguments.length?(S="function"==typeof c?c:d3_drag_src_constant(c),drag):S},drag.touchable=function(c){return arguments.length?(M="function"==typeof c?c:d3_drag_src_constant(!!c),drag):M},drag.on=function(){var c=T.on.apply(T,arguments);return c===T?drag:c},drag.clickDistance=function(c){return arguments.length?(I=(c=+c)*c,drag):Math.sqrt(I)},drag}DragEvent.prototype.on=function(){var c=this._.on.apply(this._,arguments);return c===this._?this:c};var er=Math.PI,nr=2*er,rr=1e-6,or=nr-rr;function Path(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function path_path(){return new Path}Path.prototype=path_path.prototype={constructor:Path,moveTo:function(c,h){this._+="M"+(this._x0=this._x1=+c)+","+(this._y0=this._y1=+h)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(c,h){this._+="L"+(this._x1=+c)+","+(this._y1=+h)},quadraticCurveTo:function(c,h,g,m){this._+="Q"+ +c+","+ +h+","+(this._x1=+g)+","+(this._y1=+m)},bezierCurveTo:function(c,h,g,m,b,w){this._+="C"+ +c+","+ +h+","+ +g+","+ +m+","+(this._x1=+b)+","+(this._y1=+w)},arcTo:function(c,h,g,m,b){c=+c,h=+h,g=+g,m=+m,b=+b;var w=this._x1,S=this._y1,M=g-c,k=m-h,T=w-c,E=S-h,I=T*T+E*E;if(b<0)throw new Error("negative radius: "+b);if(null===this._x1)this._+="M"+(this._x1=c)+","+(this._y1=h);else if(I>rr)if(Math.abs(E*M-k*T)>rr&&b){var P=g-w,L=m-S,B=M*M+k*k,z=P*P+L*L,j=Math.sqrt(B),D=Math.sqrt(I),N=b*Math.tan((er-Math.acos((B+I-z)/(2*j*D)))/2),R=N/D,G=N/j;Math.abs(R-1)>rr&&(this._+="L"+(c+R*T)+","+(h+R*E)),this._+="A"+b+","+b+",0,0,"+ +(E*P>T*L)+","+(this._x1=c+G*M)+","+(this._y1=h+G*k)}else this._+="L"+(this._x1=c)+","+(this._y1=h);else;},arc:function(c,h,g,m,b,w){c=+c,h=+h,w=!!w;var S=(g=+g)*Math.cos(m),M=g*Math.sin(m),k=c+S,T=h+M,E=1^w,I=w?m-b:b-m;if(g<0)throw new Error("negative radius: "+g);null===this._x1?this._+="M"+k+","+T:(Math.abs(this._x1-k)>rr||Math.abs(this._y1-T)>rr)&&(this._+="L"+k+","+T),g&&(I<0&&(I=I%nr+nr),I>or?this._+="A"+g+","+g+",0,1,"+E+","+(c-S)+","+(h-M)+"A"+g+","+g+",0,1,"+E+","+(this._x1=k)+","+(this._y1=T):I>rr&&(this._+="A"+g+","+g+",0,"+ +(I>=er)+","+E+","+(this._x1=c+g*Math.cos(b))+","+(this._y1=h+g*Math.sin(b))))},rect:function(c,h,g,m){this._+="M"+(this._x0=this._x1=+c)+","+(this._y0=this._y1=+h)+"h"+ +g+"v"+ +m+"h"+-g+"Z"},toString:function(){return this._}};const ar=path_path;function d3_shape_src_constant(c){return function constant(){return c}}var ir=1e-12,sr=Math.PI,lr=sr/2,cr=2*sr;function arcInnerRadius(c){return c.innerRadius}function arcOuterRadius(c){return c.outerRadius}function arcStartAngle(c){return c.startAngle}function arcEndAngle(c){return c.endAngle}function arcPadAngle(c){return c&&c.padAngle}function arc_asin(c){return c>=1?lr:c<=-1?-lr:Math.asin(c)}function cornerTangents(c,h,g,m,b,w,S){var M=c-g,k=h-m,T=(S?w:-w)/Math.sqrt(M*M+k*k),E=T*k,I=-T*M,P=c+E,L=h+I,B=g+E,z=m+I,j=(P+B)/2,D=(L+z)/2,N=B-P,R=z-L,G=N*N+R*R,q=b-w,W=P*z-B*L,H=(R<0?-1:1)*Math.sqrt(Math.max(0,q*q*G-W*W)),U=(W*R-N*H)/G,Y=(-W*N-R*H)/G,V=(W*R+N*H)/G,$=(-W*N+R*H)/G,X=U-j,K=Y-D,Z=V-j,J=$-D;return X*X+K*K>Z*Z+J*J&&(U=V,Y=$),{cx:U,cy:Y,x01:-E,y01:-I,x11:U*(b/q-1),y11:Y*(b/q-1)}}function Linear(c){this._context=c}function curve_linear(c){return new Linear(c)}function point_x(c){return c[0]}function point_y(c){return c[1]}Linear.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1,this._line?this._context.lineTo(c,h):this._context.moveTo(c,h);break;case 1:this._point=2;default:this._context.lineTo(c,h)}}};(function radial_curveRadial(c){function radial(h){return new Radial(c(h))}return radial._curve=c,radial})(curve_linear);function Radial(c){this._curve=c}Radial.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(c,h){this._curve.point(h*Math.sin(c),h*-Math.cos(c))}};Math.sqrt(1/3);var ur=Math.sin(sr/10)/Math.sin(7*sr/10);Math.sin(cr/10),Math.cos(cr/10);Math.sqrt(3);Math.sqrt(3),Math.sqrt(12);function src_noop(){}function basis_point(c,h,g){c._context.bezierCurveTo((2*c._x0+c._x1)/3,(2*c._y0+c._y1)/3,(c._x0+2*c._x1)/3,(c._y0+2*c._y1)/3,(c._x0+4*c._x1+h)/6,(c._y0+4*c._y1+g)/6)}function Basis(c){this._context=c}function BasisClosed(c){this._context=c}function BasisOpen(c){this._context=c}function Bundle(c,h){this._basis=new Basis(c),this._beta=h}Basis.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:basis_point(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1,this._line?this._context.lineTo(c,h):this._context.moveTo(c,h);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:basis_point(this,c,h)}this._x0=this._x1,this._x1=c,this._y0=this._y1,this._y1=h}},BasisClosed.prototype={areaStart:src_noop,areaEnd:src_noop,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1,this._x2=c,this._y2=h;break;case 1:this._point=2,this._x3=c,this._y3=h;break;case 2:this._point=3,this._x4=c,this._y4=h,this._context.moveTo((this._x0+4*this._x1+c)/6,(this._y0+4*this._y1+h)/6);break;default:basis_point(this,c,h)}this._x0=this._x1,this._x1=c,this._y0=this._y1,this._y1=h}},BasisOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var g=(this._x0+4*this._x1+c)/6,m=(this._y0+4*this._y1+h)/6;this._line?this._context.lineTo(g,m):this._context.moveTo(g,m);break;case 3:this._point=4;default:basis_point(this,c,h)}this._x0=this._x1,this._x1=c,this._y0=this._y1,this._y1=h}},Bundle.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var c=this._x,h=this._y,g=c.length-1;if(g>0)for(var m,b=c[0],w=h[0],S=c[g]-b,M=h[g]-w,k=-1;++k<=g;)m=k/g,this._basis.point(this._beta*c[k]+(1-this._beta)*(b+m*S),this._beta*h[k]+(1-this._beta)*(w+m*M));this._x=this._y=null,this._basis.lineEnd()},point:function(c,h){this._x.push(+c),this._y.push(+h)}};(function custom(c){function bundle(h){return 1===c?new Basis(h):new Bundle(h,c)}return bundle.beta=function(c){return custom(+c)},bundle})(.85);function cardinal_point(c,h,g){c._context.bezierCurveTo(c._x1+c._k*(c._x2-c._x0),c._y1+c._k*(c._y2-c._y0),c._x2+c._k*(c._x1-h),c._y2+c._k*(c._y1-g),c._x2,c._y2)}function Cardinal(c,h){this._context=c,this._k=(1-h)/6}Cardinal.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:cardinal_point(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1,this._line?this._context.lineTo(c,h):this._context.moveTo(c,h);break;case 1:this._point=2,this._x1=c,this._y1=h;break;case 2:this._point=3;default:cardinal_point(this,c,h)}this._x0=this._x1,this._x1=this._x2,this._x2=c,this._y0=this._y1,this._y1=this._y2,this._y2=h}};(function custom(c){function cardinal(h){return new Cardinal(h,c)}return cardinal.tension=function(c){return custom(+c)},cardinal})(0);function CardinalClosed(c,h){this._context=c,this._k=(1-h)/6}CardinalClosed.prototype={areaStart:src_noop,areaEnd:src_noop,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1,this._x3=c,this._y3=h;break;case 1:this._point=2,this._context.moveTo(this._x4=c,this._y4=h);break;case 2:this._point=3,this._x5=c,this._y5=h;break;default:cardinal_point(this,c,h)}this._x0=this._x1,this._x1=this._x2,this._x2=c,this._y0=this._y1,this._y1=this._y2,this._y2=h}};(function custom(c){function cardinal(h){return new CardinalClosed(h,c)}return cardinal.tension=function(c){return custom(+c)},cardinal})(0);function CardinalOpen(c,h){this._context=c,this._k=(1-h)/6}CardinalOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:cardinal_point(this,c,h)}this._x0=this._x1,this._x1=this._x2,this._x2=c,this._y0=this._y1,this._y1=this._y2,this._y2=h}};(function custom(c){function cardinal(h){return new CardinalOpen(h,c)}return cardinal.tension=function(c){return custom(+c)},cardinal})(0);function catmullRom_point(c,h,g){var m=c._x1,b=c._y1,w=c._x2,S=c._y2;if(c._l01_a>ir){var M=2*c._l01_2a+3*c._l01_a*c._l12_a+c._l12_2a,k=3*c._l01_a*(c._l01_a+c._l12_a);m=(m*M-c._x0*c._l12_2a+c._x2*c._l01_2a)/k,b=(b*M-c._y0*c._l12_2a+c._y2*c._l01_2a)/k}if(c._l23_a>ir){var T=2*c._l23_2a+3*c._l23_a*c._l12_a+c._l12_2a,E=3*c._l23_a*(c._l23_a+c._l12_a);w=(w*T+c._x1*c._l23_2a-h*c._l12_2a)/E,S=(S*T+c._y1*c._l23_2a-g*c._l12_2a)/E}c._context.bezierCurveTo(m,b,w,S,c._x2,c._y2)}function CatmullRom(c,h){this._context=c,this._alpha=h}CatmullRom.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){if(c=+c,h=+h,this._point){var g=this._x2-c,m=this._y2-h;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(g*g+m*m,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(c,h):this._context.moveTo(c,h);break;case 1:this._point=2;break;case 2:this._point=3;default:catmullRom_point(this,c,h)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=c,this._y0=this._y1,this._y1=this._y2,this._y2=h}};const hr=function custom(c){function catmullRom(h){return c?new CatmullRom(h,c):new Cardinal(h,0)}return catmullRom.alpha=function(c){return custom(+c)},catmullRom}(.5);function CatmullRomClosed(c,h){this._context=c,this._alpha=h}CatmullRomClosed.prototype={areaStart:src_noop,areaEnd:src_noop,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(c,h){if(c=+c,h=+h,this._point){var g=this._x2-c,m=this._y2-h;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(g*g+m*m,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=c,this._y3=h;break;case 1:this._point=2,this._context.moveTo(this._x4=c,this._y4=h);break;case 2:this._point=3,this._x5=c,this._y5=h;break;default:catmullRom_point(this,c,h)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=c,this._y0=this._y1,this._y1=this._y2,this._y2=h}};(function custom(c){function catmullRom(h){return c?new CatmullRomClosed(h,c):new CardinalClosed(h,0)}return catmullRom.alpha=function(c){return custom(+c)},catmullRom})(.5);function CatmullRomOpen(c,h){this._context=c,this._alpha=h}CatmullRomOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){if(c=+c,h=+h,this._point){var g=this._x2-c,m=this._y2-h;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(g*g+m*m,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:catmullRom_point(this,c,h)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=c,this._y0=this._y1,this._y1=this._y2,this._y2=h}};(function custom(c){function catmullRom(h){return c?new CatmullRomOpen(h,c):new CardinalOpen(h,0)}return catmullRom.alpha=function(c){return custom(+c)},catmullRom})(.5);function LinearClosed(c){this._context=c}function monotone_sign(c){return c<0?-1:1}function slope3(c,h,g){var m=c._x1-c._x0,b=h-c._x1,w=(c._y1-c._y0)/(m||b<0&&-0),S=(g-c._y1)/(b||m<0&&-0),M=(w*b+S*m)/(m+b);return(monotone_sign(w)+monotone_sign(S))*Math.min(Math.abs(w),Math.abs(S),.5*Math.abs(M))||0}function slope2(c,h){var g=c._x1-c._x0;return g?(3*(c._y1-c._y0)/g-h)/2:h}function monotone_point(c,h,g){var m=c._x0,b=c._y0,w=c._x1,S=c._y1,M=(w-m)/3;c._context.bezierCurveTo(m+M,b+M*h,w-M,S-M*g,w,S)}function MonotoneX(c){this._context=c}function MonotoneY(c){this._context=new ReflectContext(c)}function ReflectContext(c){this._context=c}function Natural(c){this._context=c}function controlPoints(c){var h,g,m=c.length-1,b=new Array(m),w=new Array(m),S=new Array(m);for(b[0]=0,w[0]=2,S[0]=c[0]+2*c[1],h=1;h<m-1;++h)b[h]=1,w[h]=4,S[h]=4*c[h]+2*c[h+1];for(b[m-1]=2,w[m-1]=7,S[m-1]=8*c[m-1]+c[m],h=1;h<m;++h)g=b[h]/w[h-1],w[h]-=g,S[h]-=g*S[h-1];for(b[m-1]=S[m-1]/w[m-1],h=m-2;h>=0;--h)b[h]=(S[h]-b[h+1])/w[h];for(w[m-1]=(c[m]+b[m-1])/2,h=0;h<m-1;++h)w[h]=2*c[h+1]-b[h+1];return[b,w]}function Step(c,h){this._context=c,this._t=h}LinearClosed.prototype={areaStart:src_noop,areaEnd:src_noop,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(c,h){c=+c,h=+h,this._point?this._context.lineTo(c,h):(this._point=1,this._context.moveTo(c,h))}},MonotoneX.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:monotone_point(this,this._t0,slope2(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){var g=NaN;if(h=+h,(c=+c)!==this._x1||h!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(c,h):this._context.moveTo(c,h);break;case 1:this._point=2;break;case 2:this._point=3,monotone_point(this,slope2(this,g=slope3(this,c,h)),g);break;default:monotone_point(this,this._t0,g=slope3(this,c,h))}this._x0=this._x1,this._x1=c,this._y0=this._y1,this._y1=h,this._t0=g}}},(MonotoneY.prototype=Object.create(MonotoneX.prototype)).point=function(c,h){MonotoneX.prototype.point.call(this,h,c)},ReflectContext.prototype={moveTo:function(c,h){this._context.moveTo(h,c)},closePath:function(){this._context.closePath()},lineTo:function(c,h){this._context.lineTo(h,c)},bezierCurveTo:function(c,h,g,m,b,w){this._context.bezierCurveTo(h,c,m,g,w,b)}},Natural.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var c=this._x,h=this._y,g=c.length;if(g)if(this._line?this._context.lineTo(c[0],h[0]):this._context.moveTo(c[0],h[0]),2===g)this._context.lineTo(c[1],h[1]);else for(var m=controlPoints(c),b=controlPoints(h),w=0,S=1;S<g;++w,++S)this._context.bezierCurveTo(m[0][w],b[0][w],m[1][w],b[1][w],c[S],h[S]);(this._line||0!==this._line&&1===g)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(c,h){this._x.push(+c),this._y.push(+h)}},Step.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1,this._line?this._context.lineTo(c,h):this._context.moveTo(c,h);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,h),this._context.lineTo(c,h);else{var g=this._x*(1-this._t)+c*this._t;this._context.lineTo(g,this._y),this._context.lineTo(g,h)}}this._x=c,this._y=h}};Array.prototype.slice;var dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},classCallCheck=function(c,h){if(!(c instanceof h))throw new TypeError("Cannot call a class as a function")},pr=function(){function defineProperties(c,h){for(var g=0;g<h.length;g++){var m=h[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(c,m.key,m)}}return function(c,h,g){return h&&defineProperties(c.prototype,h),g&&defineProperties(c,g),c}}(),fr=Object.assign||function(c){for(var h=1;h<arguments.length;h++){var g=arguments[h];for(var m in g)Object.prototype.hasOwnProperty.call(g,m)&&(c[m]=g[m])}return c},gr=function get(c,h,g){null===c&&(c=Function.prototype);var m=Object.getOwnPropertyDescriptor(c,h);if(void 0===m){var b=Object.getPrototypeOf(c);return null===b?void 0:get(b,h,g)}if("value"in m)return m.value;var w=m.get;return void 0!==w?w.call(g):void 0},inherits=function(c,h){if("function"!=typeof h&&null!==h)throw new TypeError("Super expression must either be null or a function, not "+typeof h);c.prototype=Object.create(h&&h.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(c,h):c.__proto__=h)},possibleConstructorReturn=function(c,h){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!h||"object"!=typeof h&&"function"!=typeof h?c:h},_r=function(){function Annotation(c){var h=c.x,g=void 0===h?0:h,m=c.y,b=void 0===m?0:m,w=c.nx,S=c.ny,M=c.dy,k=void 0===M?0:M,T=c.dx,E=void 0===T?0:T,I=c.color,P=void 0===I?"grey":I,L=c.data,B=c.type,z=c.subject,j=c.connector,D=c.note,N=c.disable,R=c.id,G=c.className;classCallCheck(this,Annotation),this._dx=void 0!==w?w-g:E,this._dy=void 0!==S?S-b:k,this._x=g,this._y=b,this._color=P,this.id=R,this._className=G||"",this._type=B||"",this.data=L,this.note=D||{},this.connector=j||{},this.subject=z||{},this.disable=N||[]}return pr(Annotation,[{key:"updatePosition",value:function updatePosition(){this.type.setPosition&&(this.type.setPosition(),this.type.subject&&0!==this.type.subject.selectAll(":not(.handle)").nodes().length&&this.type.redrawSubject())}},{key:"clearComponents",value:function clearComponents(){this.type.clearComponents&&this.type.clearComponents()}},{key:"updateOffset",value:function updateOffset(){this.type.setOffset&&(this.type.setOffset(),0!==this.type.connector.selectAll(":not(.handle)").nodes().length&&this.type.redrawConnector(),this.type.redrawNote())}},{key:"className",get:function get$$1(){return this._className},set:function set$$1(c){this._className=c,this.type.setClassName&&this.type.setClassName()}},{key:"type",get:function get$$1(){return this._type},set:function set$$1(c){this._type=c,this.clearComponents()}},{key:"x",get:function get$$1(){return this._x},set:function set$$1(c){this._x=c,this.updatePosition()}},{key:"y",get:function get$$1(){return this._y},set:function set$$1(c){this._y=c,this.updatePosition()}},{key:"color",get:function get$$1(){return this._color},set:function set$$1(c){this._color=c,this.updatePosition()}},{key:"dx",get:function get$$1(){return this._dx},set:function set$$1(c){this._dx=c,this.updateOffset()}},{key:"dy",get:function get$$1(){return this._dy},set:function set$$1(c){this._dy=c,this.updateOffset()}},{key:"nx",set:function set$$1(c){this._dx=c-this._x,this.updateOffset()}},{key:"ny",set:function set$$1(c){this._dy=c-this._y,this.updateOffset()}},{key:"offset",get:function get$$1(){return{x:this._dx,y:this._dy}},set:function set$$1(c){var h=c.x,g=c.y;this._dx=h,this._dy=g,this.updateOffset()}},{key:"position",get:function get$$1(){return{x:this._x,y:this._y}},set:function set$$1(c){var h=c.x,g=c.y;this._x=h,this._y=g,this.updatePosition()}},{key:"translation",get:function get$$1(){return{x:this._x+this._dx,y:this._y+this._dy}}},{key:"json",get:function get$$1(){var c={x:this._x,y:this._y,dx:this._dx,dy:this._dy};return this.data&&Object.keys(this.data).length>0&&(c.data=this.data),this.type&&(c.type=this.type),this._className&&(c.className=this._className),Object.keys(this.connector).length>0&&(c.connector=this.connector),Object.keys(this.subject).length>0&&(c.subject=this.subject),Object.keys(this.note).length>0&&(c.note=this.note),c}}]),Annotation}(),mr=function(){function AnnotationCollection(c){var h=c.annotations,g=c.accessors,m=c.accessorsInverse;classCallCheck(this,AnnotationCollection),this.accessors=g,this.accessorsInverse=m,this.annotations=h}return pr(AnnotationCollection,[{key:"clearTypes",value:function clearTypes(c){this.annotations.forEach(function(h){h.type=void 0,h.subject=c&&c.subject||h.subject,h.connector=c&&c.connector||h.connector,h.note=c&&c.note||h.note})}},{key:"setPositionWithAccessors",value:function setPositionWithAccessors(){var c=this;this.annotations.forEach(function(h){h.type.setPositionWithAccessors(c.accessors)})}},{key:"editMode",value:function editMode(c){this.annotations.forEach(function(h){h.type&&(h.type.editMode=c,h.type.updateEditMode())})}},{key:"updateDisable",value:function updateDisable(c){this.annotations.forEach(function(h){h.disable=c,h.type&&c.forEach(function(c){h.type[c]&&(h.type[c].remove&&h.type[c].remove(),h.type[c]=void 0)})})}},{key:"updateTextWrap",value:function updateTextWrap(c){this.annotations.forEach(function(h){h.type&&h.type.updateTextWrap&&h.type.updateTextWrap(c)})}},{key:"updateText",value:function updateText(){this.annotations.forEach(function(c){c.type&&c.type.drawText&&c.type.drawText()})}},{key:"updateNotePadding",value:function updateNotePadding(c){this.annotations.forEach(function(h){h.type&&(h.type.notePadding=c)})}},{key:"json",get:function get$$1(){var c=this;return this.annotations.map(function(h){var g=h.json;return c.accessorsInverse&&h.data&&(g.data={},Object.keys(c.accessorsInverse).forEach(function(m){g.data[m]=c.accessorsInverse[m]({x:h.x,y:h.y})})),g})}},{key:"noteNodes",get:function get$$1(){return this.annotations.map(function(c){return fr({},c.type.getNoteBBoxOffset(),{positionX:c.x,positionY:c.y})})}}]),AnnotationCollection}(),vr=function leftRightDynamic(c,h){return"dynamic"!==c&&"left"!==c&&"right"!==c||(c=h<0?"top":"bottom"),c},yr=function topBottomDynamic(c,h){return"dynamic"!==c&&"top"!==c&&"bottom"!==c||(c=h<0?"right":"left"),c},Ar=["topBottom","top","bottom"],br=["leftRight","left","right"],xr=function lineBuilder(c){var h=c.data,g=c.curve,m=void 0===g?curve_linear:g,b=c.canvasContext,w=c.className,S=c.classID,M=function src_line(){var c=point_x,h=point_y,g=d3_shape_src_constant(!0),m=null,b=curve_linear,w=null;function line(S){var M,k,T,E=S.length,I=!1;for(null==m&&(w=b(T=ar())),M=0;M<=E;++M)!(M<E&&g(k=S[M],M,S))===I&&((I=!I)?w.lineStart():w.lineEnd()),I&&w.point(+c(k,M,S),+h(k,M,S));if(T)return w=null,T+""||null}return line.x=function(h){return arguments.length?(c="function"==typeof h?h:d3_shape_src_constant(+h),line):c},line.y=function(c){return arguments.length?(h="function"==typeof c?c:d3_shape_src_constant(+c),line):h},line.defined=function(c){return arguments.length?(g="function"==typeof c?c:d3_shape_src_constant(!!c),line):g},line.curve=function(c){return arguments.length?(b=c,null!=m&&(w=b(m)),line):b},line.context=function(c){return arguments.length?(null==c?m=w=null:w=b(m=c),line):m},line}().curve(m),k={type:"path",className:w,classID:S,data:h};return b?(M.context(b),k.pathMethods=M):k.attrs={d:M(h)},k},wr=function arcBuilder(c){var h=c.data,g=c.canvasContext,m={type:"path",className:c.className,classID:c.classID,data:h},b=function arc(){var c=arcInnerRadius,h=arcOuterRadius,g=d3_shape_src_constant(0),m=null,b=arcStartAngle,w=arcEndAngle,S=arcPadAngle,M=null;function arc(){var k,T,E=+c.apply(this,arguments),I=+h.apply(this,arguments),P=b.apply(this,arguments)-lr,L=w.apply(this,arguments)-lr,B=Math.abs(L-P),z=L>P;if(M||(M=k=ar()),I<E&&(T=I,I=E,E=T),I>ir)if(B>cr-ir)M.moveTo(I*Math.cos(P),I*Math.sin(P)),M.arc(0,0,I,P,L,!z),E>ir&&(M.moveTo(E*Math.cos(L),E*Math.sin(L)),M.arc(0,0,E,L,P,z));else{var j,D,N=P,R=L,G=P,q=L,W=B,H=B,U=S.apply(this,arguments)/2,Y=U>ir&&(m?+m.apply(this,arguments):Math.sqrt(E*E+I*I)),V=Math.min(Math.abs(I-E)/2,+g.apply(this,arguments)),$=V,X=V;if(Y>ir){var K=arc_asin(Y/E*Math.sin(U)),Z=arc_asin(Y/I*Math.sin(U));(W-=2*K)>ir?(G+=K*=z?1:-1,q-=K):(W=0,G=q=(P+L)/2),(H-=2*Z)>ir?(N+=Z*=z?1:-1,R-=Z):(H=0,N=R=(P+L)/2)}var J=I*Math.cos(N),Q=I*Math.sin(N),tt=E*Math.cos(q),et=E*Math.sin(q);if(V>ir){var nt=I*Math.cos(R),rt=I*Math.sin(R),ot=E*Math.cos(G),at=E*Math.sin(G);if(B<sr){var it=W>ir?function intersect(c,h,g,m,b,w,S,M){var k=g-c,T=m-h,E=S-b,I=M-w,P=(E*(h-w)-I*(c-b))/(I*k-E*T);return[c+P*k,h+P*T]}(J,Q,ot,at,nt,rt,tt,et):[tt,et],st=J-it[0],lt=Q-it[1],ct=nt-it[0],ut=rt-it[1],ht=1/Math.sin(Math.acos((st*ct+lt*ut)/(Math.sqrt(st*st+lt*lt)*Math.sqrt(ct*ct+ut*ut)))/2),dt=Math.sqrt(it[0]*it[0]+it[1]*it[1]);$=Math.min(V,(E-dt)/(ht-1)),X=Math.min(V,(I-dt)/(ht+1))}}H>ir?X>ir?(j=cornerTangents(ot,at,J,Q,I,X,z),D=cornerTangents(nt,rt,tt,et,I,X,z),M.moveTo(j.cx+j.x01,j.cy+j.y01),X<V?M.arc(j.cx,j.cy,X,Math.atan2(j.y01,j.x01),Math.atan2(D.y01,D.x01),!z):(M.arc(j.cx,j.cy,X,Math.atan2(j.y01,j.x01),Math.atan2(j.y11,j.x11),!z),M.arc(0,0,I,Math.atan2(j.cy+j.y11,j.cx+j.x11),Math.atan2(D.cy+D.y11,D.cx+D.x11),!z),M.arc(D.cx,D.cy,X,Math.atan2(D.y11,D.x11),Math.atan2(D.y01,D.x01),!z))):(M.moveTo(J,Q),M.arc(0,0,I,N,R,!z)):M.moveTo(J,Q),E>ir&&W>ir?$>ir?(j=cornerTangents(tt,et,nt,rt,E,-$,z),D=cornerTangents(J,Q,ot,at,E,-$,z),M.lineTo(j.cx+j.x01,j.cy+j.y01),$<V?M.arc(j.cx,j.cy,$,Math.atan2(j.y01,j.x01),Math.atan2(D.y01,D.x01),!z):(M.arc(j.cx,j.cy,$,Math.atan2(j.y01,j.x01),Math.atan2(j.y11,j.x11),!z),M.arc(0,0,E,Math.atan2(j.cy+j.y11,j.cx+j.x11),Math.atan2(D.cy+D.y11,D.cx+D.x11),z),M.arc(D.cx,D.cy,$,Math.atan2(D.y11,D.x11),Math.atan2(D.y01,D.x01),!z))):M.arc(0,0,E,q,G,z):M.lineTo(tt,et)}else M.moveTo(0,0);if(M.closePath(),k)return M=null,k+""||null}return arc.centroid=function(){var g=(+c.apply(this,arguments)+ +h.apply(this,arguments))/2,m=(+b.apply(this,arguments)+ +w.apply(this,arguments))/2-sr/2;return[Math.cos(m)*g,Math.sin(m)*g]},arc.innerRadius=function(h){return arguments.length?(c="function"==typeof h?h:d3_shape_src_constant(+h),arc):c},arc.outerRadius=function(c){return arguments.length?(h="function"==typeof c?c:d3_shape_src_constant(+c),arc):h},arc.cornerRadius=function(c){return arguments.length?(g="function"==typeof c?c:d3_shape_src_constant(+c),arc):g},arc.padRadius=function(c){return arguments.length?(m=null==c?null:"function"==typeof c?c:d3_shape_src_constant(+c),arc):m},arc.startAngle=function(c){return arguments.length?(b="function"==typeof c?c:d3_shape_src_constant(+c),arc):b},arc.endAngle=function(c){return arguments.length?(w="function"==typeof c?c:d3_shape_src_constant(+c),arc):w},arc.padAngle=function(c){return arguments.length?(S="function"==typeof c?c:d3_shape_src_constant(+c),arc):S},arc.context=function(c){return arguments.length?(M=null==c?null:c,arc):M},arc}().innerRadius(h.innerRadius||0).outerRadius(h.outerRadius||h.radius||2).startAngle(h.startAngle||0).endAngle(h.endAngle||2*Math.PI);return g?(b.context(g),m.pathMethods=lineGen):m.attrs={d:b()},m},Cr=function lineSetup(c){var h=c.type,g=c.subjectType,m=h.annotation,b=m.position,w=m.x-b.x,S=w+m.dx,M=m.y-b.y,k=M+m.dy,T=m.subject;if("circle"===g&&(T.outerRadius||T.radius)){var E=Math.sqrt((w-S)*(w-S)+(M-k)*(M-k)),I=Math.asin(-k/E),P=T.outerRadius||T.radius+(T.radiusPadding||0);w=Math.abs(Math.cos(I)*P)*(S<0?-1:1),M=Math.abs(Math.sin(I)*P)*(k<0?-1:1)}if("rect"===g){var L=T.width,B=T.height;(L>0&&m.dx>0||L<0&&m.dx<0)&&(w=Math.abs(L)>Math.abs(m.dx)?L/2:L),(B>0&&m.dy>0||B<0&&m.dy<0)&&(M=Math.abs(B)>Math.abs(m.dy)?B/2:B),w===L/2&&M===B/2&&(w=S,M=k)}return[[w,M],[S,k]]},connectorCurve=function(c){var h=c.type,g=c.connectorData,m=c.subjectType;g||(g={}),g.points&&"number"!=typeof g.points||(g.points=Sr(h.annotation.offset,g.points)),g.curve||(g.curve=hr);var b=[];if(h.editMode){var w=g.points.map(function(c,h){return fr({},function pointHandle(c){var h=c.cx,g=void 0===h?0:h,m=c.cy;return{move:{x:g,y:void 0===m?0:m}}}({cx:c[0],cy:c[1]}),{index:h})}),S=function updatePoint(c){g.points[c][0]+=Kn.dx,g.points[c][1]+=Kn.dy,h.redrawConnector()};b=h.mapHandles(w.map(function(c){return fr({},c.move,{drag:S.bind(h,c.index)})}))}var M=Cr({type:h,subjectType:m});return M=[M[0]].concat(function(c){if(Array.isArray(c)){for(var h=0,g=Array(c.length);h<c.length;h++)g[h]=c[h];return g}return Array.from(c)}(g.points),[M[1]]),{components:[xr({data:M,curve:g.curve,className:"connector"})],handles:b}},Sr=function createPoints(c){for(var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,g=c.x/(h+1),m=c.y/(h+1),b=[],w=1;w<=h;w++)b.push([g*w+w%2*20,m*w-w%2*20]);return b},subjectCircle=function(c){var h=c.subjectData,g=c.type;h.radius||h.outerRadius||(h.radius=20);var m=[],b=wr({data:h,className:"subject"});if(g.editMode){var w=function circleHandles(c){var h=c.cx,g=void 0===h?0:h,m=c.cy,b=void 0===m?0:m,w=c.r1,S=c.r2,M=c.padding,k={move:{x:g,y:b}};return void 0!==w&&(k.r1={x:g+w/Math.sqrt(2),y:b+w/Math.sqrt(2)}),void 0!==S&&(k.r2={x:g+S/Math.sqrt(2),y:b+S/Math.sqrt(2)}),void 0!==M&&(k.padding={x:g+w+M,y:b}),k}({r1:b.data.outerRadius||b.data.radius,r2:b.data.innerRadius,padding:h.radiusPadding}),S=function updateRadius(c){var m=h[c]+Kn.dx*Math.sqrt(2);h[c]=m,g.redrawSubject(),g.redrawConnector()},M=[fr({},w.r1,{drag:S.bind(g,void 0!==h.outerRadius?"outerRadius":"radius")})];h.innerRadius&&M.push(fr({},w.r2,{drag:S.bind(g,"innerRadius")})),m=g.mapHandles(M)}return b.attrs["fill-opacity"]=0,{components:[b],handles:m}},Mr=function(){function Type(c){var h=c.a,g=c.annotation,m=c.editMode,b=c.dispatcher,w=c.notePadding,S=c.accessors;if(classCallCheck(this,Type),this.a=h,this.note=-1===g.disable.indexOf("note")&&h.select("g.annotation-note"),this.noteContent=this.note&&h.select("g.annotation-note-content"),this.connector=-1===g.disable.indexOf("connector")&&h.select("g.annotation-connector"),this.subject=-1===g.disable.indexOf("subject")&&h.select("g.annotation-subject"),this.dispatcher=b,b){var M=zr.bind(null,b,g);M({component:this.note,name:"note"}),M({component:this.connector,name:"connector"}),M({component:this.subject,name:"subject"})}this.annotation=g,this.editMode=g.editMode||m,this.notePadding=void 0!==w?w:3,this.offsetCornerX=0,this.offsetCornerY=0,S&&g.data&&this.init(S)}return pr(Type,[{key:"init",value:function init(c){this.annotation.x||this.mapX(c),this.annotation.y||this.mapY(c)}},{key:"mapY",value:function mapY(c){c.y&&(this.annotation.y=c.y(this.annotation.data))}},{key:"mapX",value:function mapX(c){c.x&&(this.annotation.x=c.x(this.annotation.data))}},{key:"updateEditMode",value:function updateEditMode(){this.a.selectAll("circle.handle").remove()}},{key:"drawOnSVG",value:function drawOnSVG(c,h){var g=this;Array.isArray(h)||(h=[h]),h.filter(function(c){return c}).forEach(function(h){var m=h.type,b=h.className,w=h.attrs,S=h.handles,M=h.classID;if("handle"===m)!function addHandles(c){var h=c.group,g=c.handles,m=c.r,b=void 0===m?10:m,w=h.selectAll("circle.handle").data(g);w.enter().append("circle").attr("class","handle").attr("fill","grey").attr("fill-opacity",.1).attr("cursor","move").attr("stroke-dasharray",5).attr("stroke","grey").call(drag().container(d3_selection_src_select("g.annotations").node()).on("start",function(c){return c.start&&c.start(c)}).on("drag",function(c){return c.drag&&c.drag(c)}).on("end",function(c){return c.end&&c.end(c)})),h.selectAll("circle.handle").attr("cx",function(c){return c.x}).attr("cy",function(c){return c.y}).attr("r",function(c){return c.r||b}).attr("class",function(c){return"handle "+(c.className||"")}),w.exit().remove()}({group:c,r:w&&w.r,handles:S});else{Or(c,[g.annotation],m,b,M);for(var k=c.select(m+"."+(M||b)),T=Object.keys(w),E=[],I=k.node().attributes,P=I.length-1;P>=0;P--){var L=I[P].name;-1===T.indexOf(L)&&"class"!==L&&E.push(L)}T.forEach(function(c){"text"===c?k.text(w[c]):k.attr(c,w[c])}),E.forEach(function(c){return k.attr(c,null)})}})}},{key:"getNoteBBox",value:function getNoteBBox(){return Dr(this.note,".annotation-note-content text")}},{key:"getNoteBBoxOffset",value:function getNoteBBoxOffset(){var c=Dr(this.note,".annotation-note-content"),h=this.noteContent.attr("transform").split(/\(|\,|\)/g);return c.offsetCornerX=parseFloat(h[1])+this.annotation.dx,c.offsetCornerY=parseFloat(h[2])+this.annotation.dy,c.offsetX=this.annotation.dx,c.offsetY=this.annotation.dy,c}},{key:"drawSubject",value:function drawSubject(){var c=this,h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},g=this.annotation.subject,m=h.type,b={type:this,subjectData:g},w={};"circle"===m?w=subjectCircle(b):"rect"===m?w=function(c){var h=c.subjectData,g=c.type;h.width||(h.width=100),h.height||(h.height=100);var m=[],b=h.width,w=h.height,S=xr({data:[[0,0],[b,0],[b,w],[0,w],[0,0]],className:"subject"});if(g.editMode){var M=[{x:b,y:w/2,drag:function updateWidth(){h.width=Kn.x,g.redrawSubject(),g.redrawConnector()}.bind(g)},{x:b/2,y:w,drag:function updateHeight(){h.height=Kn.y,g.redrawSubject(),g.redrawConnector()}.bind(g)}];m=g.mapHandles(M)}return S.attrs["fill-opacity"]=.1,{components:[S],handles:m}}(b):"threshold"===m?w=function(c){var h=c.subjectData,g=c.type.annotation.position,m=(void 0!==h.x1?h.x1:g.x)-g.x,b=(void 0!==h.x2?h.x2:g.x)-g.x,w=(void 0!==h.y1?h.y1:g.y)-g.y,S=(void 0!==h.y2?h.y2:g.y)-g.y;return{components:[xr({data:[[m,w],[b,S]],className:"subject"})]}}(b):"badge"===m&&(w=function(c){var h=c.subjectData,g=void 0===h?{}:h,m=c.type,b=void 0===m?{}:m,w=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},S=b.typeSettings&&b.typeSettings.subject;g.radius||(S&&S.radius?g.radius=S.radius:g.radius=14),g.x||S&&S.x&&(g.x=S.x),g.y||S&&S.y&&(g.y=S.y);var M=[],k=[],T=g.radius,E=.7*T,I=0,P=0,L=Math.sqrt(2)*T,B={xleftcorner:-T,xrightcorner:T,ytopcorner:-T,ybottomcorner:T,xleft:-L,xright:L,ytop:-L,ybottom:L};g.x&&!g.y?I=B["x"+g.x]:g.y&&!g.x?P=B["y"+g.y]:g.x&&g.y&&(I=B["x"+g.x+"corner"],P=B["y"+g.y+"corner"]);var z="translate("+I+", "+P+")",j=wr({className:"subject",data:{radius:T}});j.attrs.transform=z,j.attrs.fill=w.color,j.attrs["stroke-linecap"]="round",j.attrs["stroke-width"]="3px";var D=wr({className:"subject-ring",data:{outerRadius:T,innerRadius:E}});D.attrs.transform=z,D.attrs["stroke-width"]="3px",D.attrs.fill="white";var N=void 0;if(I&&P||!I&&!P)N=xr({className:"subject-pointer",data:[[0,0],[I||0,0],[0,P||0],[0,0]]});else if(I||P){var R=function notCornerPointerXY(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return c&&c/Math.sqrt(2)/Math.sqrt(2)||h*T/Math.sqrt(2)};N=xr({className:"subject-pointer",data:[[0,0],[R(I),R(P)],[R(I,-1),R(P,-1)],[0,0]]})}if(N&&(N.attrs.fill=w.color,N.attrs["stroke-linecap"]="round",N.attrs["stroke-width"]="3px",k.push(N)),b.editMode){var G={x:2*I,y:2*P,drag:function dragBadge(){g.x=Kn.x<2*-T?"left":Kn.x>2*T?"right":void 0,g.y=Kn.y<2*-T?"top":Kn.y>2*T?"bottom":void 0,b.redrawSubject()}.bind(b)};G.x||G.y||(G.y=-T),M=b.mapHandles([G])}var q=void 0;return g.text&&(q={type:"text",className:"badge-text",attrs:{fill:"white",stroke:"none","font-size":".7em",text:g.text,"text-anchor":"middle",dy:".25em",x:I,y:P}}),k.push(j),k.push(D),k.push(q),{components:k,handles:M}}(b,this.annotation));var S=w,M=S.components,k=void 0===M?[]:M,T=S.handles,E=void 0===T?[]:T;return k.forEach(function(h){h&&h.attrs&&!h.attrs.stroke&&(h.attrs.stroke=c.annotation.color)}),this.editMode&&(E=E.concat(this.mapHandles([{drag:this.dragSubject.bind(this)}])),k.push({type:"handle",handles:E})),k}},{key:"drawConnector",value:function drawConnector(){var c=this,h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},g=this.annotation.connector,m=g.type||h.type,b={type:this,connectorData:g};b.subjectType=this.typeSettings&&this.typeSettings.subject&&this.typeSettings.subject.type;var w={};w="curve"===m?connectorCurve(b):"elbow"===m?function(c){var h=c.type,g=c.subjectType,m=h.annotation,b=m.position,w=m.x-b.x,S=w+m.dx,M=m.y-b.y,k=M+m.dy,T=m.subject;if("rect"===g){var E=T.width,I=T.height;(E>0&&m.dx>0||E<0&&m.dx<0)&&(w=Math.abs(E)>Math.abs(m.dx)?E/2:E),(I>0&&m.dy>0||I<0&&m.dy<0)&&(M=Math.abs(I)>Math.abs(m.dy)?I/2:I),w===E/2&&M===I/2&&(w=S,M=k)}var P=[[w,M],[S,k]],L=k-M,B=S-w,z=S,j=k,D=k<M&&S>w||S<w&&k>M?-1:1;if(Math.abs(B)<Math.abs(L)?(z=S,j=M+B*D):(j=k,z=w+L*D),"circle"===g&&(T.outerRadius||T.radius)){var N=(T.outerRadius||T.radius)+(T.radiusPadding||0),R=N/Math.sqrt(2);if(Math.abs(B)>R&&Math.abs(L)>R)P=[[w=R*(S<0?-1:1),M=R*(k<0?-1:1)],[z,j],[S,k]];else if(Math.abs(B)>Math.abs(L)){var G=Math.asin(-k/N);P=[[w=Math.abs(Math.cos(G)*N)*(S<0?-1:1),k],[S,k]]}else{var q=Math.acos(S/N);P=[[S,M=Math.abs(Math.sin(q)*N)*(k<0?-1:1)],[S,k]]}}else P=[[w,M],[z,j],[S,k]];return{components:[xr({data:P,className:"connector"})]}}(b):function(c){var h=Cr(c);return{components:[xr({data:h,className:"connector"})]}}(b);var S=w,M=S.components,k=void 0===M?[]:M,T=S.handles,E=void 0===T?[]:T,I=k[0];I&&(I.attrs.stroke=this.annotation.color,I.attrs.fill="none");var P=g.end||h.end,L={};if("arrow"===P){var B=I.data[1],z=I.data[0];Math.sqrt(Math.pow(B[0]-z[0],2)+Math.pow(B[1]-z[1],2))<5&&I.data[2]&&(B=I.data[2]),L=function(c){var h=c.annotation,g=c.start,m=c.end,b=c.scale,w=void 0===b?1:b,S=h.position;g=g?[-m[0]+g[0],-m[1]+g[1]]:[h.dx,h.dy],m||(m=[h.x-S.x,h.y-S.y]);var M=m[0],k=m[1],T=g[0],E=g[1],I=10*w,P=16/180*Math.PI,L=Math.atan(E/T);T<0&&(L+=Math.PI);var B=[[M,k],[Math.cos(L+P)*I+M,Math.sin(L+P)*I+k],[Math.cos(L-P)*I+M,Math.sin(L-P)*I+k],[M,k]];return{components:[xr({data:B,className:"connector-end connector-arrow",classID:"connector-end"})]}}({annotation:this.annotation,start:B,end:z,scale:g.endScale})}else"dot"===P?L=function(c){var h=c.line,g=c.scale,m=void 0===g?1:g,b=wr({className:"connector-end connector-dot",classID:"connector-end",data:{radius:3*Math.sqrt(m)}});return b.attrs.transform="translate("+h.data[0][0]+", "+h.data[0][1]+")",{components:[b]}}({line:I,scale:g.endScale}):P&&"none"!==P||this.connector&&this.connector.select(".connector-end").remove();return L.components&&(L.components.forEach(function(h){h.attrs.fill=c.annotation.color,h.attrs.stroke=c.annotation.color}),k=k.concat(L.components)),this.editMode&&0!==E.length&&k.push({type:"handle",handles:E}),k}},{key:"drawNote",value:function drawNote(){var c=this,h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},g=this.annotation.note,m=g.align||h.align||"dynamic",b={bbox:h.bbox,align:m,offset:this.annotation.offset},w=g.lineType||h.lineType,S={};"vertical"===w?S=function(c){var h=c.align,g=c.x,m=void 0===g?0:g,b=c.y,w=void 0===b?0:b,S=c.bbox,M=c.offset;"top"===(h=vr(h,M.y))?w-=S.height:"middle"===h&&(w-=S.height/2);var k=[[m,w],[m,w+S.height]];return{components:[xr({data:k,className:"note-line"})]}}(b):"horizontal"===w&&(S=function(c){var h=c.align,g=c.x,m=void 0===g?0:g,b=c.y,w=void 0===b?0:b,S=c.offset,M=c.bbox;"right"===(h=yr(h,S.x))?m-=M.width:"middle"===h&&(m-=M.width/2);var k=[[m,w],[m+M.width,w]];return{components:[xr({data:k,className:"note-line"})]}}(b));var M=S,k=M.components,T=void 0===k?[]:k,E=M.handles,I=void 0===E?[]:E;if(T.forEach(function(h){h.attrs.stroke=c.annotation.color}),this.editMode){I=this.mapHandles([{x:0,y:0,drag:this.dragNote.bind(this)}]),T.push({type:"handle",handles:I});var P=this.dragNote.bind(this),L=this.dragstarted.bind(this),B=this.dragended.bind(this);this.note.call(drag().container(d3_selection_src_select("g.annotations").node()).on("start",function(c){return L(c)}).on("drag",function(c){return P(c)}).on("end",function(c){return B(c)}))}else this.note.on("mousedown.drag",null);return T}},{key:"drawNoteContent",value:function drawNoteContent(c){var h=this.annotation.note,g=void 0!==h.padding?h.padding:this.notePadding,m=h.orientation||c.orientation||"topBottom",b=h.lineType||c.lineType,w=h.align||c.align||"dynamic";"vertical"===b?m="leftRight":"horizontal"===b&&(m="topBottom");var S=function(c){var h=c.padding,g=void 0===h?0:h,m=c.bbox,b=void 0===m?{x:0,y:0,width:0,height:0}:m,w=c.align,S=c.orientation,M=c.offset,k=void 0===M?{x:0,y:0}:M,T=-b.x,E=0;return-1!==Ar.indexOf(S)?(w=yr(w,k.x),k.y<0&&"topBottom"===S||"top"===S?E-=b.height+g:E+=g,"middle"===w?T-=b.width/2:"right"===w&&(T-=b.width)):-1!==br.indexOf(S)&&(w=vr(w,k.y),k.x<0&&"leftRight"===S||"left"===S?T-=b.width+g:T+=g,"middle"===w?E-=b.height/2:"top"===w&&(E-=b.height)),{x:T,y:E}}({padding:g,bbox:c.bbox,offset:this.annotation.offset,orientation:m,align:w}),M=S.x,k=S.y;return this.offsetCornerX=M+this.annotation.dx,this.offsetCornerY=k+this.annotation.dy,this.note&&this.noteContent.attr("transform","translate("+M+", "+k+")"),[]}},{key:"drawOnScreen",value:function drawOnScreen(c,h){return this.drawOnSVG(c,h)}},{key:"redrawSubject",value:function redrawSubject(){this.subject&&this.drawOnScreen(this.subject,this.drawSubject())}},{key:"redrawConnector",value:function redrawConnector(){this.connector&&this.drawOnScreen(this.connector,this.drawConnector())}},{key:"redrawNote",value:function redrawNote(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getNoteBBox();this.noteContent&&this.drawOnScreen(this.noteContent,this.drawNoteContent({bbox:c})),this.note&&this.drawOnScreen(this.note,this.drawNote({bbox:c}))}},{key:"setPosition",value:function setPosition(){var c=this.annotation.position;this.a.attr("transform","translate("+c.x+", "+c.y+")")}},{key:"clearComponents",value:function clearComponents(){this.subject&&this.subject.select("*").remove(),this.connector&&this.connector.select("*").remove()}},{key:"setOffset",value:function setOffset(){if(this.note){var c=this.annotation.offset;this.note.attr("transform","translate("+c.x+", "+c.y+")")}}},{key:"setPositionWithAccessors",value:function setPositionWithAccessors(c){c&&this.annotation.data&&(this.mapX(c),this.mapY(c)),this.setPosition()}},{key:"setClassName",value:function setClassName(){this.a.attr("class","annotation "+(this.className&&this.className())+" "+(this.editMode?"editable":"")+" "+(this.annotation.className||""))}},{key:"draw",value:function draw(){this.setClassName(),this.setPosition(),this.setOffset(),this.redrawSubject(),this.redrawConnector(),this.redrawNote()}},{key:"dragstarted",value:function dragstarted(){Kn.sourceEvent.stopPropagation(),this.dispatcher&&this.dispatcher.call("dragstart",this.a,this.annotation),this.a.classed("dragging",!0),this.a.selectAll("circle.handle").style("pointer-events","none")}},{key:"dragended",value:function dragended(){this.dispatcher&&this.dispatcher.call("dragend",this.a,this.annotation),this.a.classed("dragging",!1),this.a.selectAll("circle.handle").style("pointer-events","all")}},{key:"dragSubject",value:function dragSubject(){var c=this.annotation.position;c.x+=Kn.dx,c.y+=Kn.dy,this.annotation.position=c}},{key:"dragNote",value:function dragNote(){var c=this.annotation.offset;c.x+=Kn.dx,c.y+=Kn.dy,this.annotation.offset=c}},{key:"mapHandles",value:function mapHandles(c){var h=this;return c.map(function(c){return fr({},c,{start:h.dragstarted.bind(h),end:h.dragended.bind(h)})})}}]),Type}(),kr=function customType(c,h,g){return function(c){function customType(c){classCallCheck(this,customType);var g=possibleConstructorReturn(this,(customType.__proto__||Object.getPrototypeOf(customType)).call(this,c));return g.typeSettings=h,h.disable&&h.disable.forEach(function(c){g[c]&&g[c].remove(),g[c]=void 0,"note"===c&&(g.noteContent=void 0)}),g}return inherits(customType,c),pr(customType,[{key:"className",value:function className(){return""+(h.className||gr(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),"className",this)&&gr(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),"className",this).call(this)||"")}},{key:"drawSubject",value:function drawSubject(c){return this.typeSettings.subject=fr({},h.subject,this.typeSettings.subject),gr(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),"drawSubject",this).call(this,fr({},c,this.typeSettings.subject))}},{key:"drawConnector",value:function drawConnector(c){return this.typeSettings.connector=fr({},h.connector,this.typeSettings.connector),gr(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),"drawConnector",this).call(this,fr({},c,h.connector,this.typeSettings.connector))}},{key:"drawNote",value:function drawNote(c){return this.typeSettings.note=fr({},h.note,this.typeSettings.note),gr(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),"drawNote",this).call(this,fr({},c,h.note,this.typeSettings.note))}},{key:"drawNoteContent",value:function drawNoteContent(c){return gr(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),"drawNoteContent",this).call(this,fr({},c,h.note,this.typeSettings.note))}}],[{key:"init",value:function init(c,h){return gr(customType.__proto__||Object.getPrototypeOf(customType),"init",this).call(this,c,h),g&&(c=g(c,h)),c}}]),customType}(c)},Tr=function(c){function d3NoteText(c){classCallCheck(this,d3NoteText);var h=possibleConstructorReturn(this,(d3NoteText.__proto__||Object.getPrototypeOf(d3NoteText)).call(this,c));return h.textWrap=c.textWrap||120,h.drawText(),h}return inherits(d3NoteText,c),pr(d3NoteText,[{key:"updateTextWrap",value:function updateTextWrap(c){this.textWrap=c,this.drawText()}},{key:"drawText",value:function drawText(){if(this.note){Or(this.note,[this.annotation],"g","annotation-note-content");var c=this.note.select("g.annotation-note-content");Or(c,[this.annotation],"rect","annotation-note-bg"),Or(c,[this.annotation],"text","annotation-note-label"),Or(c,[this.annotation],"text","annotation-note-title");var h={height:0},g=this.a.select("text.annotation-note-label"),m=this.annotation.note&&this.annotation.note.wrap||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrap||this.textWrap,b=this.annotation.note&&this.annotation.note.wrapSplitter||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrapSplitter,w=this.annotation.note&&this.annotation.note.bgPadding||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.bgPadding,S={top:0,bottom:0,left:0,right:0};if("number"==typeof w?S={top:w,bottom:w,left:w,right:w}:w&&"object"===(void 0===w?"undefined":dr(w))&&(S=fr(S,w)),this.annotation.note.title){var M=this.a.select("text.annotation-note-title");M.text(this.annotation.note.title),M.attr("fill",this.annotation.color),M.attr("font-weight","bold"),M.call(jr,m,b),h=M.node().getBBox()}g.text(this.annotation.note.label).attr("dx","0"),g.call(jr,m,b),g.attr("y",1.1*h.height||0),g.attr("fill",this.annotation.color);var k=this.getNoteBBox();this.a.select("rect.annotation-note-bg").attr("width",k.width+S.left+S.right).attr("height",k.height+S.top+S.bottom).attr("x",k.x-S.left).attr("y",-S.top).attr("fill","white").attr("fill-opacity",0)}}}]),d3NoteText}(Mr),Er=kr(Tr,{className:"label",note:{align:"middle"}}),Ir=kr(Tr,{className:"callout",note:{lineType:"horizontal"}}),Pr=(kr(Ir,{className:"callout elbow",connector:{type:"elbow"}}),kr(Ir,{className:"callout curve",connector:{type:"curve"}}),kr(Mr,{className:"badge",subject:{type:"badge"},disable:["connector","note"]}),kr(Tr,{className:"callout circle",subject:{type:"circle"},note:{lineType:"horizontal"},connector:{type:"elbow"}})),Lr=kr(Tr,{className:"callout rect",subject:{type:"rect"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),Fr=function(c){function ThresholdMap(){return classCallCheck(this,ThresholdMap),possibleConstructorReturn(this,(ThresholdMap.__proto__||Object.getPrototypeOf(ThresholdMap)).apply(this,arguments))}return inherits(ThresholdMap,c),pr(ThresholdMap,[{key:"mapY",value:function mapY(c){gr(ThresholdMap.prototype.__proto__||Object.getPrototypeOf(ThresholdMap.prototype),"mapY",this).call(this,c);var h=this.annotation;(h.subject.x1||h.subject.x2)&&h.data&&c.y&&(h.y=c.y(h.data)),!h.subject.x1&&!h.subject.x2||h.x||(h.x=h.subject.x1||h.subject.x2)}},{key:"mapX",value:function mapX(c){gr(ThresholdMap.prototype.__proto__||Object.getPrototypeOf(ThresholdMap.prototype),"mapX",this).call(this,c);var h=this.annotation;(h.subject.y1||h.subject.y2)&&h.data&&c.x&&(h.x=c.x(h.data)),!h.subject.y1&&!h.subject.y2||h.y||(h.y=h.subject.y1||h.subject.y2)}}]),ThresholdMap}(Ir),Br=kr(Fr,{className:"callout xythreshold",subject:{type:"threshold"}}),Or=function newWithClass(c,h,g,m,b){var w=c.selectAll(g+"."+(b||m)).data(h);return w.enter().append(g).merge(w).attr("class",m),w.exit().remove(),c},zr=function addHandlers(c,h,g){var m=g.component,b=g.name;m&&m.on("mouseover.annotations",function(){c.call(b+"over",m,h)}).on("mouseout.annotations",function(){return c.call(b+"out",m,h)}).on("click.annotations",function(){return c.call(b+"click",m,h)})},jr=function wrap(c,h,g){var m=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1.2;c.each(function(){for(var c=d3_selection_src_select(this),b=c.text().split(g||/[ \t\r\n]+/).reverse().filter(function(c){return""!==c}),w=void 0,S=[],M=c.text(null).append("tspan").attr("x",0).attr("dy","0.8em");w=b.pop();)S.push(w),M.text(S.join(" ")),M.node().getComputedTextLength()>h&&S.length>1&&(S.pop(),M.text(S.join(" ")),S=[w],M=c.append("tspan").attr("x",0).attr("dy",m+"em").text(w))})},Dr=function bboxWithoutHandles(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:":not(.handle)";return c?c.selectAll(h).nodes().reduce(function(c,h){var g=h.getBBox();c.x=Math.min(c.x,g.x),c.y=Math.min(c.y,g.y),c.width=Math.max(c.width,g.width);var m=h&&h.attributes&&h.attributes.y;return c.height=Math.max(c.height,(m&&parseFloat(m.value)||0)+g.height),c},{x:0,y:0,width:0,height:0}):{x:0,y:0,width:0,height:0}};function annotation(){var c=[],h=void 0,g=void 0,m=[],b={},w={},S=!1,M=void 0,k=Ir,T=void 0,E=void 0,I=tr("subjectover","subjectout","subjectclick","connectorover","connectorout","connectorclick","noteover","noteout","noteclick","dragend","dragstart"),P=void 0,L=function annotation(g){P=g,S||g.selectAll("circle.handle").remove();var L=c.map(function(c){return c.type||(c.type=k),c.disable||(c.disable=m),new _r(c)});h=h||new mr({annotations:L,accessors:b,accessorsInverse:w,ids:M}),g.selectAll("g").data([h]).enter().append("g").attr("class","annotations");var B=g.select("g.annotations");Or(B,h.annotations,"g","annotation");var annotation=B.selectAll("g.annotation");annotation.each(function(c){var h=d3_selection_src_select(this);h.attr("class","annotation"),Or(h,[c],"g","annotation-connector"),Or(h,[c],"g","annotation-subject"),Or(h,[c],"g","annotation-note"),Or(h.select("g.annotation-note"),[c],"g","annotation-note-content"),c.type="[object Object]"===c.type.toString()?c.type:new c.type({a:h,annotation:c,textWrap:T,notePadding:E,editMode:S,dispatcher:I,accessors:b}),c.type.draw(),c.type.drawText&&c.type.drawText()})};return L.json=function(){return console.log("Annotations JSON was copied to your clipboard. Please note the annotation type is not JSON compatible. It appears in the objects array in the console, but not in the copied JSON.",h.json),window.copy(JSON.stringify(h.json.map(function(c){return delete c.type,c}))),L},L.update=function(){return c&&h&&(c=h.annotations.map(function(c){return c.type.draw(),c})),L},L.updateText=function(){return h&&(h.updateText(T),c=h.annotations),L},L.updatedAccessors=function(){return h.setPositionWithAccessors(),c=h.annotations,L},L.disable=function(g){return arguments.length?(m=g,h&&(h.updateDisable(m),c=h.annotations),L):m},L.textWrap=function(g){return arguments.length?(T=g,h&&(h.updateTextWrap(T),c=h.annotations),L):T},L.notePadding=function(g){return arguments.length?(E=g,h&&(h.updateNotePadding(E),c=h.annotations),L):E},L.type=function(g,m){return arguments.length?(k=g,h&&(h.annotations.map(function(c){c.type.note&&c.type.note.selectAll("*:not(.annotation-note-content)").remove(),c.type.noteContent&&c.type.noteContent.selectAll("*").remove(),c.type.subject&&c.type.subject.selectAll("*").remove(),c.type.connector&&c.type.connector.selectAll("*").remove(),c.type.typeSettings={},c.type=k,c.subject=m&&m.subject||c.subject,c.connector=m&&m.connector||c.connector,c.note=m&&m.note||c.note}),c=h.annotations),L):k},L.annotations=function(g){if(!arguments.length)return h&&h.annotations||c;(c=g,h&&h.annotations)&&(c.some(function(c){return!c.type||"[object Object]"!==c.type.toString()})?(h=null,L(P)):h.annotations=c);return L},L.context=function(c){return arguments.length?(g=c,L):g},L.accessors=function(c){return arguments.length?(b=c,L):b},L.accessorsInverse=function(c){return arguments.length?(w=c,L):w},L.ids=function(c){return arguments.length?(M=c,L):M},L.editMode=function(g){return arguments.length?(S=g,P&&P.selectAll("g.annotation").classed("editable",S),h&&(h.editMode(S),c=h.annotations),L):S},L.collection=function(c){return arguments.length?(h=c,L):h},L.on=function(){var c=I.on.apply(I,arguments);return c===I?L:c},L}function ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function _objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}function appendAnnotations(c){if(c.svg_){var h=c.svg_.select("#em-zoom-group-"+c.svgId_);h.selectAll(".em-annotations").remove();var g=c.annotations_;if(g){var m={annotationLabel:Er,annotationCallout:Ir,annotationCalloutRect:Lr,annotationCalloutCircle:Pr,annotationXYThreshold:Br},b=g.annotations.map(function(c){var h=m[c.type]||Er;return _objectSpread(_objectSpread({},c),{},{type:h})}),w=annotation().type(Er).annotations(b).editMode(g.editMode);h.append("g").attr("id","em-annotations").attr("class","em-annotations").call(w)}}}var Nr=function addLabelsToMap(c,h){var g,m;c.labels_.config||(c.labels_.config=Hr),c.labels_.statLabelsPositions||(c.labels_.statLabelsPositions=Ur),c._statLabelFormatter=c.labels_.valuesFormatter?c.labels_.valuesFormatter:Ft;var b=h.select("#em-labels"),w=b.empty()?h.append("g").attr("id","em-labels").attr("class","em-labels"):b;null!==(g=c.labels_)&&void 0!==g&&g.values&&"ps"!==c._mapType&&Wr(c,w);var S=(null===(m=c.labels_)||void 0===m?void 0:m.labels)||Hr["".concat(c.geo,"_").concat(c.proj_,".cc")];if(S){var M,k=ensureGroup(w,"em-label-shadows"),T=ensureGroup(w,"em-labels");if(null!==(M=c.labels_)&&void 0!==M&&M.shadows)k.selectAll("text").data(S).enter().append("text").attr("id",function(c){return"em-label-shadow-"+c.text.replace(/\s+/g,"-")}).attr("class",function(c){return"em-label-shadow em-label-shadow-"+c.class}).attr("x",function(h){return h.rotate?0:c._projection([h.x,h.y])[0]}).attr("y",function(h){return h.rotate?0:c._projection([h.x,h.y])[1]}).attr("dy",-7).attr("transform",function(h){if(h.rotate){var g=c._projection([h.x,h.y]),m=g[0],b=g[1];return"translate(".concat(m,",").concat(b,") rotate(").concat(h.rotate,")")}return"rotate(0)"}).text(function(c){return c.text});T.selectAll("text").data(S).enter().append("text").attr("id",function(c){return"em-label-"+c.text.replace(/\s+/g,"-")}).attr("class",function(c){return"em-label em-label-"+c.class}).attr("x",function(h){return h.rotate?0:c._projection([h.x,h.y])[0]}).attr("y",function(h){return h.rotate?0:c._projection([h.x,h.y])[1]}).attr("dy",-7).attr("transform",function(h){if(h.rotate){var g=c._projection([h.x,h.y]),m=g[0],b=g[1];return"translate(".concat(m,",").concat(b,") rotate(").concat(h.rotate,")")}return"rotate(0)"}).text(function(c){return c.text})}};var Rr=function updateValuesLabels(c){var h,g,m;if(c){c.svg_.selectAll("g.em-stat-label > *").remove(),c.svg_.selectAll("g.em-stat-label-shadow > *").remove();var b=c.svg_.selectAll("g.em-stat-label"),w=null!==(h=c.labels_)&&void 0!==h&&h.statLabelsFilterFunction?null===(g=c.labels_)||void 0===g?void 0:g.statLabelsFilterFunction:qr,S=c.statData();return b.filter(function(h){return w(h,c)}).each(function(h){var g=src_select(this),m=Gr(h,S,c);c.labels_.backgrounds&&function appendRect(c,h){var g=5,m=2,b=h.append("text").attr("visibility","hidden").text(c).node().getBBox(),w=b.width,S=b.height;h.select('text[visibility="hidden"]').remove();var M=-w/2-g,k=-S/2-m;h.append("rect").attr("x",M).attr("y",k).attr("width",w+2*g).attr("height",S+2*m).attr("class","em-label-background")}(m,g),g.append("text").text(m).attr("class","em-stat-label-text")}),null!==(m=c.labels_)&&void 0!==m&&m.shadows&&c.svg_.selectAll("g.em-stat-label-shadow").filter(function(h){return w(h,c)}).append("text").text(function(h){return Gr(h,S,c)}),c}console.warn("No map specified")},Gr=function statLabelsTextFunction(c,h,g){if(h&&null!=h&&h.get){var m=h.get(c.properties.id);if(!m||!m.value&&0!==m&&0!==m.value)return"";if(":"!==m.value)return g._statLabelFormatter?g._statLabelFormatter(m.value):Ft(m.value)}},qr=function defaultStatLabelFilter(c,h){var g=h.statData().get(c.properties.id);return!(!g||!g.value&&0!==g&&0!==g.value)},Wr=function appendStatLabelCentroidsToMap(c,h){var g,m=ensureGroup(h,"em-stat-labels-shadows"),b=ensureGroup(h,"em-stat-labels"),w=c.Geometries.getAllRegionFeatures(),S=w.filter(function(c,h,g){return h===g.findIndex(function(h){return h.properties.id===c.properties.id})});b.selectAll("g").data(S).enter().append("g").attr("transform",function(h){if(c.labels_.statLabelsPositions[h.properties.id]){var g=c.labels_.statLabelsPositions[h.properties.id],m=c._projection([g.x,g.y]),b=m[0].toFixed(3),w=m[1].toFixed(3);return"translate(".concat(b,",").concat(w,")")}var S=c._pathFunction.centroid(h);return c.labels_.processValueLabelCentroids&&(S=c.labels_.processValueLabelCentroids(h,S)),"translate("+S+")"}).attr("class","em-stat-label"),null!==(g=c.labels_)&&void 0!==g&&g.shadows&&m.selectAll("g").data(w).enter().append("g").attr("transform",function(h){if(c.labels_.statLabelsPositions[h.properties.id]){var g=c._projection([c.labels_.statLabelsPositions[h.properties.id].x,c.labels_.statLabelsPositions[h.properties.id].y]),m=g[0].toFixed(3),b=g[1].toFixed(3);return"translate(".concat(m,",").concat(b,")")}var w=c._pathFunction.centroid(h);return c.labels_.processValueLabelCentroids&&(w=c.labels_.processValueLabelCentroids(h,w)),"translate("+w+")"}).attr("class","em-stat-label-shadow")},Hr={EUR_3035:{cc:[{text:"AL",x:515e4,y:206e4,class:"cc",size:7},{text:"AT",x:467e4,y:269e4,class:"cc",size:18},{text:"BE",x:393e4,y:301e4,class:"cc",size:17},{text:"BG",x:5567e3,y:225e4,class:"cc",size:22},{text:"HR",x:484e4,y:248e4,class:"cc",size:10},{text:"CY",x:6426e3,y:148e4,class:"cc",size:10},{text:"CZ",x:4707e3,y:292e4,class:"cc",size:18},{text:"DK",x:4316e3,y:3621e3,class:"cc",size:20},{text:"EE",x:522e4,y:399e4,class:"cc",size:12},{text:"FI",x:515e4,y:4424e3,class:"cc",size:20},{text:"FR",x:3767740,y:2662817,class:"cc",size:22},{text:"DE",x:4347284,y:3093276,class:"cc",size:22},{text:"EL",x:537e4,y:175e4,class:"cc",size:22},{text:"HU",x:502e4,y:263e4,class:"cc",size:17},{text:"IS",x:304e4,y:4833e3,class:"cc",size:10},{text:"IE",x:3136e3,y:3394e3,class:"cc",size:17},{text:"IT",x:4469967,y:2181963,class:"cc",size:22},{text:"LV",x:529e4,y:38e5,class:"cc",size:12},{text:"LT",x:519e4,y:363e4,class:"cc",size:12},{text:"LU",x:412e4,y:294e4,class:"cc",size:12},{text:"MT",x:4731e3,y:13e5,class:"cc",size:10},{text:"ME",x:5073e3,y:2185e3,class:"cc",size:7},{text:"GE",x:6942680,y:266e4,class:"cc"},{text:"UA",x:589e4,y:305e4,class:"cc"},{text:"BA",x:4949262,y:2338688,class:"cc"},{text:"MD",x:574e4,y:279e4,class:"cc"},{text:"MK",x:53e5,y:208e4,class:"cc",size:10},{text:"NL",x:402e4,y:3208e3,class:"cc",size:17},{text:"NO",x:43e5,y:4147e3,class:"cc",size:20},{text:"PL",x:4964e3,y:32e5,class:"cc",size:22},{text:"PT",x:277e4,y:199e4,class:"cc",size:18},{text:"RO",x:5451e3,y:26e5,class:"cc",size:22},{text:"RS",x:52e5,y:235e4,class:"cc",size:10},{text:"SK",x:504e4,y:286e4,class:"cc",size:12},{text:"SI",x:4675e3,y:25e5,class:"cc",size:10},{text:"ES",x:3160096,y:19e5,class:"cc",size:22},{text:"SE",x:463e4,y:4e6,class:"cc",size:20},{text:"CH",x:417e4,y:26e5,class:"cc",size:16},{text:"TR",x:651e4,y:21e5,class:"cc",size:22},{text:"UK",x:3558e3,y:325e4,class:"cc",size:17}],en:[{text:"MEDITERRANEAN SEA",x:398e4,y:16e5,class:"seas",size:12,letterSpacing:7},{text:"ATLANTIC OCEAN",x:282e4,y:254e4,class:"seas",size:12,letterSpacing:2},{text:"NORTH SEA",x:3915e3,y:37e5,class:"seas",size:12},{text:"BALTIC SEA",x:49e5,y:373e4,class:"seas",size:10,rotate:-50},{text:"NORWEGIAN SEA",x:385e4,y:48e5,class:"seas",size:12,letterSpacing:1},{text:"BLACK SEA",x:63e5,y:25e5,class:"seas",size:12,letterSpacing:4},{text:"ALBANIA",cc:"AL",x:51e5,y:203e4,class:"countries",size:7,rotate:70},{text:"AUSTRIA",cc:"AT",x:467e4,y:2629e3,class:"countries",size:10},{text:"BELGIUM",cc:"BE",x:39e5,y:303e4,class:"countries",size:7,rotate:30},{text:"BULGARIA",cc:"BG",x:5567e3,y:2256e3,class:"countries",size:12},{text:"CROATIA",cc:"HR",x:4876e3,y:2455e3,class:"countries",size:7},{text:"CYPRUS",cc:"CY",x:6426e3,y:148e4,class:"countries",size:10},{text:"CZECHIA",cc:"CZ",x:4707e3,y:2885e3,class:"countries",size:12},{text:"DENMARK",cc:"DK",x:4316e3,y:3621e3,class:"countries",size:10},{text:"ESTONIA",cc:"EE",x:522e4,y:399e4,class:"countries",size:7},{text:"FINLAND",cc:"FI",x:515e4,y:4424e3,class:"countries",size:12},{text:"FRANCE",cc:"FR",x:3767740,y:2662817,class:"countries",size:12},{text:"GERMANY",cc:"DE",x:4347284,y:3093276,class:"countries",size:12},{text:"GREECE",cc:"EL",x:547e4,y:186e4,class:"countries",size:12},{text:"HUNGARY",cc:"HU",x:502e4,y:263e4,class:"countries",size:10},{text:"ICELAND",cc:"IS",x:304e4,y:4833e3,class:"countries",size:10},{text:"IRELAND",cc:"IE",x:3136e3,y:3394e3,class:"countries",size:10},{text:"ITALY",cc:"IT",x:4469967,y:2181963,class:"countries",size:12},{text:"LATVIA",cc:"LV",x:529e4,y:38e5,class:"countries",size:7},{text:"LITHUANIA",cc:"LT",x:519e4,y:363e4,class:"countries",size:7},{text:"LUX.",cc:"LU",x:416e4,y:291e4,class:"countries",size:7},{text:"MALTA",cc:"MT",x:4731e3,y:133e4,class:"countries",size:7},{text:"MONT.",cc:"ME",x:5073e3,y:2185e3,class:"countries",size:7},{text:"N. MACEDONIA",cc:"MK",x:54e5,y:2082e3,class:"countries",size:7},{text:"NETHERLANDS",cc:"NL",x:3977e3,y:3208e3,class:"countries",size:7},{text:"NORWAY",cc:"NO",x:433e4,y:4147e3,class:"countries",size:12,rotate:-75},{text:"POLAND",cc:"PL",x:4964e3,y:3269e3,class:"countries",size:12},{text:"PORTUGAL",cc:"PT",x:283e4,y:199e4,class:"countries",size:10,rotate:-75},{text:"ROMANIA",cc:"RO",x:5451e3,y:26e5,class:"countries",size:12},{text:"SERBIA",cc:"RS",x:52e5,y:23e5,class:"countries",size:7},{text:"SLOVAKIA",cc:"SK",x:504e4,y:2835e3,class:"countries",size:7,rotate:-30},{text:"SLOVENIA",cc:"SI",x:4735e3,y:2522e3,class:"countries",size:7,rotate:-30},{text:"SPAIN",cc:"ES",x:3160096,y:185e4,class:"countries",size:12},{text:"SWEDEN",cc:"SE",x:463e4,y:41e5,class:"countries",size:12,rotate:-75},{text:"SWITZERLAND",cc:"CH",x:42e5,y:2564e3,class:"countries",size:7},{text:"TÜRKIYE",cc:"TR",x:651e4,y:21e5,class:"countries",size:12},{text:"U.K.",cc:"UK",x:3558e3,y:325e4,class:"countries",size:12},{text:"UKRAINE",cc:"UA",x:589e4,y:305e4,class:"countries",size:12},{text:"MOLDOVA",class:"countries",cc:"MD",x:574e4,y:279e4,size:12},{text:"GEORGIA",class:"countries",cc:"GE",x:6942680,y:266e4,size:12}]},IC_32628:{cc:[{text:"ES",x:420468,y:3180647,class:"cc",size:12}],en:[{text:"Canary Islands",x:420468,y:3180647,class:"countries",size:12}]},GP_32620:{cc:[{text:"FR",x:667e3,y:174e4,class:"cc",size:12}],en:[{text:"Guadeloupe",x:7e5,y:181e4,class:"countries",size:12}]},MQ_32620:{cc:[{text:"FR",x:716521,y:1621322,class:"cc",size:12}],en:[{text:"Martinique",x:716521,y:1621322,class:"countries",size:12}]},GF_32622:{cc:[{text:"FR",x:266852,y:444074,class:"cc",size:12}],en:[{text:"Guyane",x:266852,y:444074,class:"countries",size:12}]},RE_32740:{cc:[{text:"FR",x:348011,y:768e4,class:"cc",size:10}],en:[{text:"Réunion",x:348011,y:768e4,class:"countries",size:10}]},YT_32738:{cc:[{text:"FR",x:516549,y:8593920,class:"cc",size:10}],en:[{text:"Mayotte",x:516549,y:8593920,class:"countries",size:10}]},MT_3035:{cc:[{text:"MT",x:4719755,y:1410701,class:"cc",size:10}],en:[{text:"Malta",x:4719755,y:1410701,class:"countries",size:10}]},PT20_32626:{cc:[{text:"PT",x:397418,y:432e4,class:"cc",size:10}],en:[{text:"Azores",x:397418,y:432e4,class:"countries",size:10}]},PT30_32628:{cc:[{text:"PT",x:333586,y:3624e3,class:"cc",size:10,rotate:30}],en:[{text:"Madeira",x:333586,y:3624e3,class:"countries",size:10,rotate:30}]},LI_3035:{cc:[{text:"LI",x:4287060,y:266e4,class:"cc",size:12}],en:[{text:"Liechtenstein",x:4287060,y:2679e3,class:"countries",size:7}]},IS_3035:{cc:[{text:"IS",x:3011804,y:496e4,class:"cc",size:12}],en:[{text:"Iceland",x:3011804,y:496e4,class:"countries",size:12}]},SJ_SV_3035:{cc:[{text:"NO",x:457e4,y:626e4,class:"cc",size:10}],en:[{text:"Svalbard",x:457e4,y:626e4,class:"countries",size:10}]},SJ_JM_3035:{cc:[{text:"NO",x:3647762,y:5420300,class:"cc",size:10}],en:[{text:"Jan Mayen",x:3647762,y:5420300,class:"countries",size:7}]},CARIB_32620:{cc:[{text:"FR",x:7e5,y:181e4,class:"cc",size:10},{text:"FR",x:64e4,y:159e4,class:"cc",size:10},{text:"FR",x:54e4,y:1962e3,class:"cc",size:7}],en:[{text:"Guadeloupe",x:7e5,y:181e4,class:"countries",size:10},{text:"Martinique",x:57e4,y:159e4,class:"countries",size:10},{text:"Saint Martin",x:597e3,y:1962e3,class:"countries",size:7}]},WORLD_54030:{en:[{text:"NORTH ATLANTIC",x:-45,y:25,class:"seas",size:10,letterSpacing:1},{text:"SOUTH ATLANTIC",x:-15,y:-25,class:"seas",size:10,letterSpacing:1},{text:"SOUTH PACIFIC",x:-126,y:-25,class:"seas",size:10,letterSpacing:1},{text:"NORTH",x:-136,y:25,class:"seas",size:10,letterSpacing:1},{text:"PACIFIC",x:-134,y:20,class:"seas",size:10,letterSpacing:1},{text:"INDIAN OCEAN",x:80,y:-25,class:"seas",size:10,letterSpacing:1},{text:"SOUTHERN OCEAN",x:-5,y:-67,class:"seas",size:10,letterSpacing:6}]}},Ur={AL:{x:515e4,y:2e6},AT:{x:467e4,y:274e4},BE:{x:393e4,y:306e4},BG:{x:5567e3,y:23e5},HR:{x:4657718,y:2400243},CY:{x:6426e3,y:157e4},CH:{x:417e4,y:26e5},CZ:{x:4707e3,y:295e4},DK:{x:4316e3,y:3621e3},EE:{x:522e4,y:405e4},FI:{x:515e4,y:4424e3},FR:{x:3767740,y:2662817},DE:{x:4347284,y:3093276},EL:{x:537e4,y:175e4},HU:{x:502e4,y:267e4},IS:{x:304e4,y:4833e3},IE:{x:3136e3,y:3394e3},IT:{x:45e5,y:2181963},LV:{x:529e4,y:384e4},LT:{x:519e4,y:367e4},LU:{x:412e4,y:294e4},MT:{x:488e4,y:148e4},GE:{x:6912680,y:2696554},UA:{x:5865507,y:3130158},BA:{x:4959262,y:2368688},MD:{x:5736016,y:2835957},ME:{x:5073e3,y:223e4},MK:{x:53e5,y:213e4},NL:{x:402e4,y:3208e3},NO:{x:43e5,y:4147e3},PL:{x:4964e3,y:32e5},PT:{x:276e4,y:199e4},RO:{x:5451e3,y:26e5},RS:{x:52e5,y:237e4},SK:{x:504e4,y:289e4},SI:{x:466e4,y:255e4},ES:{x:32e5,y:2e6},SE:{x:463e4,y:4e6},TR:{x:651e4,y:21e5},UK:{x:3558e3,y:325e4},RU:{x:6842086,y:3230517}};function responseJson(c){if(!c.ok)throw new Error(c.status+" "+c.statusText);if(204!==c.status&&205!==c.status)return c.json()}function json(c,h){return fetch(c,h).then(responseJson)}function topojson_client_src_identity(c){return c}function feature(c,h){return"string"==typeof h&&(h=c.objects[h]),"GeometryCollection"===h.type?{type:"FeatureCollection",features:h.geometries.map(function(h){return feature_feature(c,h)})}:feature_feature(c,h)}function feature_feature(c,h){var g=h.id,m=h.bbox,b=null==h.properties?{}:h.properties,w=function feature_object(c,h){var g=function topojson_client_src_transform(c){if(null==c)return topojson_client_src_identity;var h,g,m=c.scale[0],b=c.scale[1],w=c.translate[0],S=c.translate[1];return function(c,M){M||(h=g=0);var k=2,T=c.length,E=new Array(T);for(E[0]=(h+=c[0])*m+w,E[1]=(g+=c[1])*b+S;k<T;)E[k]=c[k],++k;return E}}(c.transform),m=c.arcs;function arc(c,h){h.length&&h.pop();for(var b=m[c<0?~c:c],w=0,S=b.length;w<S;++w)h.push(g(b[w],w));c<0&&function reverse(c,h){for(var g,m=c.length,b=m-h;b<--m;)g=c[b],c[b++]=c[m],c[m]=g}(h,S)}function point(c){return g(c)}function line(c){for(var h=[],g=0,m=c.length;g<m;++g)arc(c[g],h);return h.length<2&&h.push(h[0]),h}function ring(c){for(var h=line(c);h.length<4;)h.push(h[0]);return h}function polygon(c){return c.map(ring)}function geometry(c){var h,g=c.type;switch(g){case"GeometryCollection":return{type:g,geometries:c.geometries.map(geometry)};case"Point":h=point(c.coordinates);break;case"MultiPoint":h=c.coordinates.map(point);break;case"LineString":h=line(c.arcs);break;case"MultiLineString":h=c.arcs.map(line);break;case"Polygon":h=polygon(c.arcs);break;case"MultiPolygon":h=c.arcs.map(polygon);break;default:return null}return{type:g,coordinates:h}}return geometry(h)}(c,h);return null==g&&null==m?{type:"Feature",properties:b,geometry:w}:null==m?{type:"Feature",id:g,properties:b,geometry:w}:{type:"Feature",id:g,bbox:m,properties:b,geometry:w}}var Yr={2021:{3035:{"03M":{type:"Topology",arcs:[[[3061,1303],[-152,-59],[-32,-66],[-65,72],[-96,7],[-16,59],[-64,19],[-56,-39],[-120,39],[-184,-19],[-16,26],[32,52],[-16,72],[24,40],[8,183]],[[2885,0],[-8,46],[-65,85],[-40,-7],[-40,40],[0,111],[80,13],[25,46],[72,13],[40,98],[-56,118],[144,196],[-24,79],[88,59],[-24,98],[-8,20],[24,39],[8,52],[48,72],[-88,125]],[[825,2638],[-112,-98],[-72,-7],[-88,-118],[-176,-39],[56,-91],[88,-33],[24,-53],[56,-39],[24,-91],[-56,-46],[24,-105],[-56,-92],[-104,0],[-48,-104],[-16,-40],[-57,7],[-40,-53],[-16,-78],[113,-118],[-97,-65],[-88,-99],[-80,20],[-80,-39],[-24,-13]],[[1098,2304],[-193,66],[24,39],[-16,39],[65,13],[0,33],[-65,79],[-88,65]],[[2308,1689],[-153,-20],[-64,59],[-40,7],[-96,-27],[-104,138],[-8,92],[-32,78],[-64,26],[-32,-59],[-24,0],[-56,86],[-40,137],[-25,65],[-56,0],[-56,46],[-64,-72],[-120,53],[-88,-40],[-88,46]]],transform:{scale:[37.761044752777565,38.54734205626113],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:1000004,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:1000005,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:1000001,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:1000002,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:1000003,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"10M":{type:"Topology",arcs:[[[962,0],[-29,75],[48,131],[21,35],[11,38],[32,117],[-24,44]],[[1021,440],[-64,-29],[-70,36],[-120,2],[3,121]],[[770,570],[-126,16],[-40,91],[-45,4],[-51,93],[-142,4]],[[275,891],[-131,-99],[30,-36],[24,-31],[-6,-86],[-98,-86],[13,-64],[-27,-38],[-80,-31]],[[366,778],[-37,22],[-54,91]]],transform:{scale:[113.2099448513097,114.12782081303801],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:1000005,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[1],properties:{id:1000004,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[2],properties:{id:1000003,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[3],properties:{id:1000001,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[4],properties:{id:1000002,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}}]}}},"20M":{type:"Topology",arcs:[[[536,0],[-24,45],[15,30],[45,92],[-1,44],[-2,37]],[[569,248],[-130,9],[-10,64]],[[429,321],[-64,10],[-78,94],[-83,13]],[[153,502],[-73,-51],[26,-84],[-48,-53],[-3,-52],[-55,-25]],[[204,438],[-51,64]]],transform:{scale:[203.12309601494124,202.56551463031246],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:1000005,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[1],properties:{id:1000004,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[2],properties:{id:1000003,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[3],properties:{id:1000001,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[4],properties:{id:1000002,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}}]}}},"60M":{type:"Topology",arcs:[[[310,138],[-36,-2],[-40,42]],[[234,178],[-123,65]],[[84,278],[-84,-147]],[[111,243],[-27,35]],[[292,0],[18,138]]],transform:{scale:[372.84281730215633,364.87611898580536],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:1000004,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[1],properties:{id:1000003,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[2],properties:{id:1000001,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[3],properties:{id:1000002,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[4],properties:{id:1000005,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}}]}}}},4326:{"03M":{type:"Topology",arcs:[[[1900,1275],[-30,27],[-27,-13],[-34,23],[-87,6],[25,59],[1,70],[20,34],[24,167]],[[1792,1648],[-116,1],[-62,77],[-89,-8],[-60,148],[7,86],[-4,15],[-13,60],[-45,28],[-33,-48],[-26,4],[-31,142],[-11,53],[5,43],[-19,44],[-39,8],[-40,49],[-52,-59],[-93,71],[-38,-6],[-16,-26]],[[945,2388],[-54,27],[-20,28],[-22,-3],[-17,22],[-25,1],[-10,10],[4,17],[27,14],[-15,29],[1,16],[68,1],[-8,16],[-5,30],[-14,29],[-27,42],[-25,22],[-30,41]],[[773,2730],[-89,-69],[-64,-4],[-82,-92],[-133,-15],[27,-93],[64,-43],[16,-50],[38,-44],[9,-75],[-48,-51],[5,-41],[6,-50],[-52,-84],[-78,14],[-35,-66],[-33,-61],[-45,11],[-35,-42],[-18,-72],[33,-71],[48,-55]],[[1017,2330],[-72,58]],[[307,1677],[-36,-12],[-25,-21],[-26,-10],[-76,-90],[-17,4],[-30,31],[-52,-14],[-26,-23],[-19,1]],[[2319,1185],[-116,-32],[-39,-52],[-42,70],[-68,23],[-12,58],[-43,23],[-42,-23],[-57,23]],[[2044,0],[-4,43],[-38,82],[-34,9],[-24,43],[13,97],[61,4],[32,41],[49,0],[37,82],[-26,118],[130,167],[-8,73],[74,46],[-2,18],[-9,92],[24,35],[7,49],[48,52],[-55,134]]],transform:{scale:[.0006038339283908974,.00036983475567765975],translate:[20.35292839300007,42.26281764300006]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000002,co:"F",oth:"F"}},{type:"LineString",arcs:[1],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000001,co:"F",oth:"F"}},{type:"LineString",arcs:[2],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000003,co:"F",oth:"F"}},{type:"LineString",arcs:[3],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000004,co:"F",oth:"F"}},{type:"LineString",arcs:[4],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000005,co:"F",oth:"F"}},{type:"LineString",arcs:[5],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000006,co:"F",oth:"F"}},{type:"LineString",arcs:[6],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000007,co:"F",oth:"F"}},{type:"LineString",arcs:[7],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000008,co:"F",oth:"F"}}]}}},"10M":{type:"Topology",arcs:[[[659,439],[-54,17],[17,111]],[[622,567],[-93,31],[-25,92],[-36,11],[-29,97],[-23,1],[-63,3]],[[328,822],[-33,74],[-27,44]],[[268,940],[-72,-44],[-38,-31],[27,-86],[-14,-65],[-81,-78],[16,-58]],[[353,802],[-25,20]],[[106,578],[-41,-19],[-65,-28]],[[805,408],[-54,-21],[-92,52]],[[709,0],[-22,72],[0,17],[40,36],[18,67],[53,101],[16,64],[-9,51]]],transform:{scale:[.001740521547911524,.0010740945563829907],translate:[20.35292839300007,42.26281764300006]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000002,co:"F",oth:"F"}},{type:"LineString",arcs:[1],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000003,co:"F",oth:"F"}},{type:"LineString",arcs:[2],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000004,co:"F",oth:"F"}},{type:"LineString",arcs:[3],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000005,co:"F",oth:"F"}},{type:"LineString",arcs:[4],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000006,co:"F",oth:"F"}},{type:"LineString",arcs:[5],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000007,co:"F",oth:"F"}},{type:"LineString",arcs:[6],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000001,co:"F",oth:"F"}},{type:"LineString",arcs:[7],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000008,co:"F",oth:"F"}}]}}},"20M":{type:"Topology",arcs:[[[380,252],[-21,26],[0,48]],[[359,326],[-49,17],[-56,107],[-51,11]],[[189,472],[-34,68]],[[155,540],[-66,-39],[18,-66],[-54,-68],[8,-35]],[[61,332],[-21,-13],[-10,-12],[-13,5],[-17,-7]],[[464,234],[-84,18]],[[409,0],[-14,46],[61,110],[8,78]]],transform:{scale:[.003018276831896498,.0018697201537037245],translate:[20.35292839300007,42.26281764300006]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000002,co:"F",oth:"F"}},{type:"LineString",arcs:[1],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000003,co:"F",oth:"F"}},{type:"LineString",arcs:[2],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000004,co:"F",oth:"F"}},{type:"LineString",arcs:[3],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000005,co:"F",oth:"F"}},{type:"LineString",arcs:[4],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000007,co:"F",oth:"F"}},{type:"LineString",arcs:[5],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000001,co:"F",oth:"F"}},{type:"LineString",arcs:[6],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000008,co:"F",oth:"F"}}]}}},"60M":{type:"Topology",arcs:[[[235,156],[-13,46]],[[222,202],[-96,84]],[[117,293],[-21,42]],[[96,335],[-58,-129]],[[126,286],[-9,7]],[[38,206],[-38,-17]],[[287,145],[-52,11]],[[253,0],[34,145]]],transform:{scale:[.004879722822299564,.0030138772626866006],translate:[20.352928393000074,42.26281764300006]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000002,co:"F",oth:"F"}},{type:"LineString",arcs:[1],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000003,co:"F",oth:"F"}},{type:"LineString",arcs:[2],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000004,co:"F",oth:"F"}},{type:"LineString",arcs:[3],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000005,co:"F",oth:"F"}},{type:"LineString",arcs:[4],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000006,co:"F",oth:"F"}},{type:"LineString",arcs:[5],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000001,co:"F",oth:"F"}},{type:"LineString",arcs:[6],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000007,co:"F",oth:"F"}},{type:"LineString",arcs:[7],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000008,co:"F",oth:"F"}}]}}}}},2024:{3035:{"03M":{type:"Topology",arcs:[[[728,1508],[-48,12],[-22,18],[-15,-5],[-16,13],[-22,-4],[-10,8],[0,13],[21,13],[-16,17],[0,13],[58,9],[-5,8],[-10,22],[-16,17],[-27,25],[-21,13],[-32,26]],[[1912,0],[-6,30],[-42,51],[-32,0],[-21,30],[0,69],[53,8],[21,35],[43,4],[26,60],[-37,81],[96,129],[-16,51],[58,43],[0,9],[-21,64],[16,26],[5,34],[32,43],[-58,85]],[[250,942],[-27,-13],[-21,-17],[-21,-8],[-59,-73],[-16,0],[-26,17],[-43,-13],[-21,-21],[-16,0]],[[1657,861],[-27,13],[-21,-13],[-32,13],[-74,-9],[16,47],[-6,47],[11,26],[5,120]],[[1529,1105],[-100,-17],[-64,47],[-75,-17],[-63,94],[-6,60],[-5,13],[-16,38],[-42,13],[-22,-38],[-21,0],[-42,94],[-16,34],[0,30],[-21,30],[-32,0],[-38,30],[-42,-47],[-85,39],[-32,-9],[-10,-21]],[[547,1726],[-69,-60],[-53,-13],[-59,-73],[-111,-25],[32,-60],[58,-22],[16,-34],[37,-26],[16,-51],[-37,-39],[5,-30],[11,-34],[-37,-64],[-64,4],[-26,-51],[-22,-47],[-42,4],[-21,-34],[-11,-52],[37,-47],[43,-30]],[[797,1478],[-69,30]],[[2029,852],[-96,-38],[-32,-39],[-42,43],[-59,4],[-16,39],[-42,13],[-32,-22],[-53,9]]],transform:{scale:[56.97629608361119,58.91534666536319],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"10M":{type:"Topology",arcs:[[[242,508],[-33,47],[-27,27]],[[637,0],[-25,46],[-2,12],[30,29],[7,47],[34,75],[7,45],[-12,33]],[[83,318],[-32,-18],[-51,-26]],[[552,290],[-46,5],[3,78]],[[509,373],[-79,8],[-30,59],[-30,3],[-34,62],[-19,-1],[-52,-6]],[[182,582],[-55,-39],[-28,-25],[30,-56],[-5,-45],[-59,-62],[18,-37]],[[265,498],[-23,10]],[[676,287],[-43,-21],[-81,24]]],transform:{scale:[171.07449827433382,174.72145763645509],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"20M":{type:"Topology",arcs:[[[50,191],[-17,-11],[-8,-10],[-11,1],[-14,-6]],[[305,224],[-44,6],[-58,68],[-44,2]],[[109,350],[-52,-36],[21,-45],[-38,-54],[10,-24]],[[159,300],[-14,6]],[[145,306],[-36,44]],[[381,0],[-17,31],[41,85],[-1,57]],[[404,173],[-74,2]],[[330,175],[-20,15],[-5,34]]],transform:{scale:[286.13294356075795,290.536823841191],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"60M":{type:"Topology",arcs:[[[258,111],[-47,1]],[[32,123],[-32,-17]],[[211,112],[-16,32]],[[195,144],[-94,49]],[[70,225],[-38,-102]],[[101,193],[-8,4]],[[93,197],[-23,28]],[[243,0],[15,111]]],transform:{scale:[447.98943164212585,451.9461704196305],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}}},4326:{"03M":{type:"Topology",arcs:[[[1543,0],[-4,32],[-28,65],[-24,5],[-19,33],[10,70],[47,5],[23,33],[38,0],[28,59],[-19,92],[94,124],[-5,54],[56,37],[0,11],[-9,70],[19,27],[4,38],[38,38],[-42,102]],[[1750,895],[-85,-27],[-32,-37],[-29,54],[-56,16],[-5,43],[-32,16],[-33,-16],[-43,16]],[[1435,960],[-23,22],[-19,-11],[-28,16],[-66,5],[19,44],[0,54],[14,26],[19,125]],[[230,1262],[-24,-5],[-23,-16],[-19,-11],[-56,-65],[-14,0],[-24,27],[-37,-11],[-19,-21],[-14,5]],[[1351,1241],[-84,0],[-47,59],[-71,-6],[-42,114],[5,64],[-5,11],[-9,43],[-33,22],[-24,-38],[-23,6],[-23,108],[-5,37],[0,33],[-14,32],[-28,5],[-29,38],[-42,-43],[-70,54],[-28,-5],[-10,-22]],[[582,2055],[-66,-49],[-47,-5],[-61,-70],[-103,-11],[19,-70],[51,-32],[10,-38],[28,-32],[9,-54],[-37,-44],[4,-26],[5,-38],[-37,-65],[-61,11],[-29,-49],[-23,-48],[-33,11],[-28,-33],[-14,-54],[28,-54],[33,-43]],[[769,1753],[-56,48]],[[713,1801],[-42,17],[-14,21],[-19,0],[-9,16],[-19,0],[-10,6],[5,16],[19,11],[-9,21],[0,11],[51,0],[-5,11],[-4,22],[-10,26],[-23,27],[-19,22],[-23,27]]],transform:{scale:[.0007994261320208862,.0004913384355349169],translate:[20.35361768088405,42.262163108155406]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"10M":{type:"Topology",arcs:[[[539,0],[-17,52],[0,13],[30,27],[13,48],[41,74],[13,47],[-8,38]],[[611,299],[-41,-16],[-69,37]],[[501,320],[-41,13],[12,81]],[[80,421],[-31,-12],[-49,-20]],[[472,414],[-71,24],[-18,66],[-28,7],[-21,72],[-18,0],[-47,2]],[[203,686],[-54,-32],[-29,-22],[21,-63],[-12,-47],[-60,-57],[11,-44]],[[269,585],[-20,16]],[[249,601],[-25,53],[-21,32]]],transform:{scale:[.002290098349828638,.0014718665962452685],translate:[20.35361768088405,42.262163108155406]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"20M":{type:"Topology",arcs:[[[337,0],[-12,36],[51,84],[6,62]],[[382,182],[-69,13]],[[313,195],[-17,20],[-1,37]],[[50,256],[-17,-10],[-8,-8],[-11,3],[-14,-5]],[[295,252],[-40,13],[-46,82],[-41,9]],[[127,417],[-54,-30],[15,-51],[-44,-53],[6,-27]],[[168,356],[-12,10]],[[156,366],[-29,51]]],transform:{scale:[.0036618323062750017,.0024213440887871805],translate:[20.35361768088405,42.262163108155406]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"60M":{type:"Topology",arcs:[[[220,0],[29,116]],[[249,116],[-45,8]],[[204,124],[-12,37]],[[192,161],[-83,66]],[[109,227],[-8,6]],[[33,163],[-33,-12]],[[83,266],[-50,-103]],[[101,233],[-18,33]]],transform:{scale:[.005617750767056427,.003795866485053587],translate:[20.35361768088405,42.262163108155406]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}}}}};function range(c,h,g){c=+c,h=+h,g=(b=arguments.length)<2?(h=c,c=0,1):b<3?1:+g;for(var m=-1,b=0|Math.max(0,Math.ceil((h-c)/g)),w=new Array(b);++m<b;)w[m]=c+m*g;return w}function graticuleX(c,h,g){var m=range(c,h-Dt,g).concat(h);return function(c){return m.map(function(h){return[c,h]})}}function graticuleY(c,h,g){var m=range(c,h-Dt,g).concat(h);return function(c){return m.map(function(h){return[h,c]})}}function graticule(){var c,h,g,m,b,w,S,M,k,T,E,I,P=10,L=P,B=90,z=360,j=2.5;function graticule(){return{type:"MultiLineString",coordinates:lines()}}function lines(){return range(Kt(m/B)*B,g,B).map(E).concat(range(Kt(M/z)*z,S,z).map(I)).concat(range(Kt(h/P)*P,c,P).filter(function(c){return Yt(c%B)>Dt}).map(k)).concat(range(Kt(w/L)*L,b,L).filter(function(c){return Yt(c%z)>Dt}).map(T))}return graticule.lines=function(){return lines().map(function(c){return{type:"LineString",coordinates:c}})},graticule.outline=function(){return{type:"Polygon",coordinates:[E(m).concat(I(S).slice(1),E(g).reverse().slice(1),I(M).reverse().slice(1))]}},graticule.extent=function(c){return arguments.length?graticule.extentMajor(c).extentMinor(c):graticule.extentMinor()},graticule.extentMajor=function(c){return arguments.length?(m=+c[0][0],g=+c[1][0],M=+c[0][1],S=+c[1][1],m>g&&(c=m,m=g,g=c),M>S&&(c=M,M=S,S=c),graticule.precision(j)):[[m,M],[g,S]]},graticule.extentMinor=function(g){return arguments.length?(h=+g[0][0],c=+g[1][0],w=+g[0][1],b=+g[1][1],h>c&&(g=h,h=c,c=g),w>b&&(g=w,w=b,b=g),graticule.precision(j)):[[h,w],[c,b]]},graticule.step=function(c){return arguments.length?graticule.stepMajor(c).stepMinor(c):graticule.stepMinor()},graticule.stepMajor=function(c){return arguments.length?(B=+c[0],z=+c[1],graticule):[B,z]},graticule.stepMinor=function(c){return arguments.length?(P=+c[0],L=+c[1],graticule):[P,L]},graticule.precision=function(P){return arguments.length?(j=+P,k=graticuleX(w,b,90),T=graticuleY(h,c,j),E=graticuleX(M,S,90),I=graticuleY(m,g,j),graticule):j},graticule.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function promisifyRequest(c){return new Promise((h,g)=>{c.oncomplete=c.onsuccess=()=>h(c.result),c.onabort=c.onerror=()=>g(c.error)})}function createStore(c,h){let g;return(m,b)=>(()=>{if(g)return g;const m=indexedDB.open(c);return m.onupgradeneeded=()=>m.result.createObjectStore(h),g=promisifyRequest(m),g.then(c=>{c.onclose=()=>g=void 0},()=>{}),g})().then(c=>b(c.transaction(h,m).objectStore(h)))}let Vr;function defaultGetStore(){return Vr||(Vr=createStore("keyval-store","keyval")),Vr}function dist_get(c,h=defaultGetStore()){return h("readonly",h=>promisifyRequest(h.get(c)))}function dist_set(c,h,g=defaultGetStore()){return g("readwrite",g=>(g.put(h,c),promisifyRequest(g.transaction)))}var $r=new Map,Xr=864e5;function canUseIDB(){return"undefined"!=typeof window&&((!0===window.isSecureContext||"localhost"===location.hostname||"127.0.0.1"===location.hostname)&&"undefined"!=typeof indexedDB)}function safeGetIDB(c){return _safeGetIDB.apply(this,arguments)}function _safeGetIDB(){return _safeGetIDB=_asyncToGenerator(It().mark(function _callee2(c){var h;return It().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(canUseIDB()){g.next=1;break}return g.abrupt("return",null);case 1:return g.prev=1,g.next=2,dist_get(c);case 2:return g.abrupt("return",g.sent);case 3:return g.prev=3,h=g.catch(1),console.warn("[IDB] read skipped:",(null==h?void 0:h.name)||h),g.abrupt("return",null);case 4:case"end":return g.stop()}},_callee2,null,[[1,3]])})),_safeGetIDB.apply(this,arguments)}function safeSetIDB(c,h){return _safeSetIDB.apply(this,arguments)}function _safeSetIDB(){return _safeSetIDB=_asyncToGenerator(It().mark(function _callee3(c,h){var g;return It().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(canUseIDB()){m.next=1;break}return m.abrupt("return",!1);case 1:return m.prev=1,m.next=2,dist_set(c,h);case 2:return m.abrupt("return",!0);case 3:return m.prev=3,g=m.catch(1),console.warn("[IDB] write skipped:",(null==g?void 0:g.name)||g),m.abrupt("return",!1);case 4:case"end":return m.stop()}},_callee3,null,[[1,3]])})),_safeSetIDB.apply(this,arguments)}var Kr=function Geometries(c,h){var g={};return g.defaultGeoData=void 0,g.allNUTSGeoData=void 0,g.geoJSONs={mixed:{rg0:void 0,rg1:void 0,rg2:void 0,rg3:void 0},cntbn:void 0,cntrg:void 0,nutsbn:void 0,nutsrg:void 0,gra:void 0,worldrg:void 0,worldbn:void 0,kosovo:void 0},g.userGeometries=void 0,g.statisticalRegions=void 0,g.centroidsData=void 0,g.centroidsFeatures=void 0,g._allCentroidsFeatures=void 0,g.getRegionFeatures=function(){return"WORLD"==c.geo_?g.geoJSONs.worldrg:"mixed"===c.nutsLevel_?[g.geoJSONs.mixed.rg0,g.geoJSONs.mixed.rg1,g.geoJSONs.mixed.rg2,g.geoJSONs.mixed.rg3]:g.geoJSONs.nutsrg.concat(g.geoJSONs.cntrg)},g.getDefaultGeoData=function(c,m,b){var w=g.getDefaultGeoDataPromise();return Promise.all(w).then(function(w){var S="function"==typeof m?m(w):w;return g.allNUTSGeoData=S,g.defaultGeoData=S[0],h&&(g.centroidsData="mixed"===b?[S[4],S[5],S[6],S[7]]:S[1]),"WORLD"===c?(g.geoJSONs.worldrg=feature(g.defaultGeoData,g.defaultGeoData.objects.CNTR_RG_20M_2020_4326).features,g.geoJSONs.worldbn=feature(g.defaultGeoData,g.defaultGeoData.objects.CNTR_BN_20M_2020_4326).features,g.geoJSONs.kosovo=feature(g.defaultGeoData,g.defaultGeoData.objects.NUTS_BN_20M_2021_RS_XK_border).features,g.geoJSONs.graticule=[graticule().step([30,30])()]):(g.geoJSONs.graticule=feature(g.defaultGeoData,g.defaultGeoData.objects.gra).features,g.geoJSONs.nutsrg=feature(g.defaultGeoData,g.defaultGeoData.objects.nutsrg).features,g.geoJSONs.nutsbn=feature(g.defaultGeoData,g.defaultGeoData.objects.nutsbn).features,g.geoJSONs.cntrg=feature(g.defaultGeoData,g.defaultGeoData.objects.cntrg).features,g.geoJSONs.cntbn=feature(g.defaultGeoData,g.defaultGeoData.objects.cntbn).features),S}).catch(function(c){return Promise.reject(c)})},g.getDefaultGeoDataPromise=function(){var g=[0,1,2,3],m=[],b=function buildUrl(c,h,g,m,b,w){var S=arguments.length>6&&void 0!==arguments[6]&&arguments[6],M="".concat(c,"/").concat(h);return g&&"EUR"!==g&&"WORLD"!==g&&(M+="/".concat(g)),M+="/".concat("WORLD"==g?"4326":m),!S&&b&&(M+="/".concat(b)),M+="/".concat(S?"nutspt_":"").concat(w,".json")},w=function(){var c=_asyncToGenerator(It().mark(function _callee(c){var h,g,m,b,w;return It().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(h="geojson-cache:".concat(c),!((g=$r.get(h))&&Date.now()-g.timestamp<Xr)){S.next=1;break}return S.abrupt("return",g.data);case 1:return S.next=2,safeGetIDB(h);case 2:if(!((m=S.sent)&&Date.now()-m.timestamp<Xr)){S.next=3;break}return $r.set(h,m),S.abrupt("return",m.data);case 3:return S.next=4,json(c).catch(function(h){if(null!=m&&m.data)return m.data;throw new Error("Fetch failed for ".concat(c,": ").concat((null==h?void 0:h.message)||h))});case 4:return b=S.sent,w={timestamp:Date.now(),data:b},$r.set(h,w),S.next=5,safeSetIDB(h,w);case 5:return S.abrupt("return",b);case 6:case"end":return S.stop()}},_callee)}));return function fetchWithCache(h){return c.apply(this,arguments)}}();if(!c||!c.nuts2jsonBaseURL_)throw new Error("Missing required map context or configuration");if("mixed"===c.nutsLevel_&&"WORLD"!==c.geo_)g.forEach(function(h){var g=b(c.nuts2jsonBaseURL_,c.nutsYear_,c.geo_,c.proj_,c.scale_,h);m.push(w(g))}),h&&g.forEach(function(h){var g=b(c.nuts2jsonBaseURL_,c.nutsYear_,c.geo_,c.proj_,c.scale_,h,!0);m.push(w(g))});else if("WORLD"===c.geo_){var S=window.location.hostname.includes("ec.europa.eu")?"https://ec.europa.eu/assets/estat/E/E4/gisco/IMAGE/WORLD_4326.json":"https://raw.githubusercontent.com/eurostat/eurostat-map/master/src/assets/topojson/WORLD_4326.json";m.push(w(S))}else{var M=b(c.nuts2jsonBaseURL_,c.nutsYear_,c.geo_,c.proj_,c.scale_,c.nutsLevel_);if(m.push(w(M)),h){var k=b(c.nuts2jsonBaseURL_,c.nutsYear_,c.geo_,c.proj_,c.scale_,c.nutsLevel_,!0);m.push(w(k))}}return m},g.isGeoReady=function(){if(!g.defaultGeoData&&!g.userGeometries)return!1;var h=!0;return Bt(c.insetTemplates_,null,function(c){c.Geometries.isGeoReady()||(h=!1)}),h},g.setUserGeometries=function(c){var h=this;this.userGeometries=c,c.forEach(function(c){c.statisticalRegions&&(h.statisticalRegions=c)})},g.addDefaultGeometriesToMap=function(h,m,b,w,S,M,k,T){(this.geoJSONs.graticule&&m&&h.append("g").attr("id","em-graticule").attr("class","em-graticule").selectAll("path").data(this.geoJSONs.graticule).enter().append("path").attr("d",b),this.geoJSONs.cntrg&&h.append("g").attr("id","em-cntrg").attr("class","em-cntrg").selectAll("path").data(this.geoJSONs.cntrg).enter().append("path").attr("d",b).attr("id",function(c){var h=c.properties.id;if("RS"==h||"EL"==h)return"em-cntrg-"+h}),this.geoJSONs.worldrg&&h.append("g").attr("id","em-worldrg").attr("class","em-worldrg").selectAll("path").data(this.geoJSONs.worldrg).enter().append("path").attr("d",b),this.geoJSONs.nutsrg)&&("mixed"==w?(this.geoJSONs.mixed.rg0=this.geoJSONs.nutsrg,this.geoJSONs.mixed.rg1=feature(g.allNUTSGeoData[1],g.allNUTSGeoData[1].objects.nutsrg).features,this.geoJSONs.mixed.rg2=feature(g.allNUTSGeoData[2],g.allNUTSGeoData[2].objects.nutsrg).features,this.geoJSONs.mixed.rg3=feature(g.allNUTSGeoData[3],g.allNUTSGeoData[3].objects.nutsrg).features,[this.geoJSONs.mixed.rg0,this.geoJSONs.mixed.rg1,this.geoJSONs.mixed.rg2,this.geoJSONs.mixed.rg3].forEach(function(g,m){attachClickEventToRegions(h.append("g").attr("id","em-nutsrg").attr("class","em-nutsrg em-nutsrg-".concat(m)).selectAll("path").data(g).enter().append("path").attr("d",b).attr("lvl",m),c)}),"EUR"!=M||"3035"!=k&&"4326"!=k||function addKosovoBorder(c,h,g,m,b){var w=Yr[b]?Yr[b][g][m]:Yr[2024][g][m],S=feature(w,"nutsbn_1").features;c.append("g").attr("id","em-kosovo-bn").attr("class","em-kosovo-bn em-bn-cc").selectAll("path").data(S).enter().append("path").attr("d",h)}(h,b,k,T,S)):attachClickEventToRegions(h.append("g").attr("id","em-nutsrg").attr("class","em-nutsrg").selectAll("path").data(this.geoJSONs.nutsrg).enter().append("path").attr("d",b),c));this.geoJSONs.cntbn&&h.append("g").attr("id","em-cntbn-halo").attr("class","em-cntbn-halo").selectAll("path").data(this.geoJSONs.cntbn).enter().append("path").filter(function(c){return"T"==c.properties.eu||"T"==c.properties.efta||"T"==c.properties.cc||"T"==c.properties.oth||"T"==c.properties.co?c:void 0}).attr("d",b).attr("id",function(c){return"em-bn-"+c.properties.id+"-halo"}).attr("class",function(c){var h=[];return"T"===c.properties.eu&&h.push("em-bn-eu"),"T"===c.properties.efta&&h.push("em-bn-efta"),"T"===c.properties.cc&&h.push("em-bn-cc"),"T"===c.properties.oth&&h.push("em-bn-oth"),"T"===c.properties.co&&h.push("em-bn-co"),h.join(" ")}),this.geoJSONs.cntbn&&h.append("g").attr("id","em-cntbn").attr("class","em-cntbn").selectAll("path").data(this.geoJSONs.cntbn).enter().append("path").filter(function(c){return"T"==c.properties.eu||"T"==c.properties.efta||"T"==c.properties.cc||"T"==c.properties.oth||"T"==c.properties.co?c:void 0}).attr("d",b).attr("id",function(c){return"em-bn-"+c.properties.id}).attr("class",function(c){var h=[];return"T"===c.properties.eu&&h.push("em-bn-eu"),"T"===c.properties.efta&&h.push("em-bn-efta"),"T"===c.properties.cc&&h.push("em-bn-cc"),"T"===c.properties.oth&&h.push("em-bn-oth"),"T"===c.properties.co&&h.push("em-bn-co"),h.join(" ")}),this.geoJSONs.nutsbn&&"mixed"!==w&&(this.geoJSONs.nutsbn.sort(function(c,h){return h.properties.lvl-c.properties.lvl}),h.append("g").attr("id","em-nutsbn").attr("class","em-nutsbn").selectAll("path").data(this.geoJSONs.nutsbn).enter().filter(function(c){return"T"==c.properties.eu||"T"==c.properties.efta||"T"==c.properties.cc||"T"==c.properties.oth||"T"==c.properties.co?c:void 0}).append("path").attr("d",b).attr("class",function(c){var h=c.properties;return h.id>1e5?"em-kosovo-bn":"T"===h.co?"em-bn-co":["em-bn-"+h.lvl].join(" ")})),this.geoJSONs.worldbn&&(h.append("g").attr("id","em-worldbn-halo").attr("class","em-worldbn-halo").selectAll("path").data(this.geoJSONs.worldbn).enter().append("path").attr("d",b).attr("class",function(c){return c.properties.POL_STAT>0?"em-bn-d em-worldbn-halo":"T"===c.properties.COAS_FLAG?"em-bn-co":"em-worldbn-halo"}),h.append("g").attr("id","em-worldbn").attr("class","em-worldbn").selectAll("path").data(this.geoJSONs.worldbn).enter().append("path").attr("d",b).attr("class",function(c){return c.properties.POL_STAT>0?"em-bn-d":"T"===c.properties.COAS_FLAG?"em-bn-co":"em-worldbn"})),this.geoJSONs.kosovo&&h.append("g").attr("id","em-kosovo-bn").attr("class","em-kosovo-bn").selectAll("path").data(this.geoJSONs.kosovo).enter().append("path").attr("d",b)},g.addUserGeometriesToMap=function(c,h,g){c.forEach(function(c){var m=h.append("g").attr("id",c.statisticalRegions?"em-user-regions":"").attr("class",c.class?c.class:"").selectAll("path").data(c.features).enter().append("path").attr("d",g);"function"==typeof c.onEach&&c.onEach(m)})},g.getAllRegionFeatures=function(){var h=[];return g.geoJSONs.nutsrg?h="mixed"==c.nutsLevel_?g.geoJSONs.mixed.rg0.concat(g.geoJSONs.mixed.rg1,g.geoJSONs.mixed.rg2,g.geoJSONs.mixed.rg3,g.geoJSONs.cntrg):g.geoJSONs.nutsrg.concat(g.geoJSONs.cntrg):g.userGeometries&&(h=g.statisticalRegions.features),h},g};function attachClickEventToRegions(c,h){c.on("click",function(c,g){var m,b;null!==(m=h.tooltip_.omitRegions)&&void 0!==m&&m.includes(null===(b=g.properties)||void 0===b?void 0:b.id)||h.onRegionClick_&&h.onRegionClick_(c,g,this,h)})}var Zr=function buildInset(c,h,g,m){var b=zs(c,g,m);for(var w in(c=c||{}).proj=c.proj||Qr[c.geo],c.scale=c.scale||h.insetScale_,c.footnote=c.footnote||"",c.showSourceLink=c.showSourceLink||!1,c.zoomExtent=c.zoomExtent||h.insetZoomExtent_,c.width=c.width||h.insetBoxWidth_,c.height=c.height||h.insetBoxWidth_,c.insets=c.insets||[],c.insetTemplates=c.insetTemplates||{},c.callback=c.callback||h.callback_,["nutsLevel_","nutsYear_","hoverColor_","cntrgFillStyle_","cntbnStroke_","cntbnStrokeWidth_","seaFillStyle_","drawCoastalMargin_","coastalMarginColor_","coastalMarginWidth_","coastalMarginStdDev_","graticuleStroke_","graticuleStrokeWidth_","lg_","projectionFunction_","filterGeometriesFunction_","processCentroids_"].forEach(function(c){b[c]=h[c]}),["stat","statData","legend","legendObj","noDataText","language","transitionDuration","tooltip_","classToText_"].forEach(function(c){b[c]=h[c]}),c)b[w+"_"]=c[w];return b.isInset=!0,b},Jr=function defaultInsetConfig(c,h){for(var g=[{geo:"IC",x:0,y:0,width:c,height:.3*c},{geo:"CARIB",x:0,y:.3*c+h,width:.5*c,height:c},{geo:"GF",x:.5*c,y:.3*c+h,width:.5*c,height:.75*c},{geo:"YT",x:.5*c,y:1.05*c+h,width:.25*c,height:.25*c},{geo:"RE",x:.75*c,y:1.05*c+h,width:.25*c,height:.25*c},{geo:"PT20",x:0,y:1.3*c+2*h,width:.75*c,height:.25*c},{geo:"PT30",x:.75*c,y:1.3*c+2*h,width:.25*c,height:.25*c},{geo:"MT",x:0,y:1.55*c+3*h,width:.25*c,height:.25*c},{geo:"LI",x:.25*c,y:1.55*c+3*h,width:.25*c,height:.25*c},{geo:"SJ_SV",x:.5*c,y:1.55*c+3*h,width:.25*c,height:.25*c},{geo:"SJ_JM",x:.75*c,y:1.55*c+3*h,width:.25*c,height:.25*c}],m=0;m<g.length;m++)g[m].drawGraticule=!1;return g},Qr={EUR:"3035",IC:"32628",GP:"32620",MQ:"32620",GF:"32622",RE:"32740",YT:"32738",MT:"3035",PT20:"32626",PT30:"32628",LI:"3035",IS:"3035",SJ_SV:"3035",SJ_JM:"3035",CARIB:"32620",WORLD:"54030"},to=function appendStamp(c,h){if(h.svg_&&(h.svg_.select("#em-stamp").remove(),c)){var g=h.svg_.append("g").attr("id","em-stamp");c.size||(c.size=60),c.x||(c.x=230),c.y||(c.y=100),c.textColor||(c.textColor="#000"),c.stampColor||(c.stampColor="#000"),c.strokeWidth||(c.strokeWidth=1),c.lineHeight||(c.lineHeight=15),c.shape||(c.shape="circle"),void 0===c.padding&&(c.padding="rectangle"===c.shape?1:0);var m=c.text,b=Math.sqrt(no(m.trim())*c.lineHeight),w=oo(eo(m.trim()),b);if("rectangle"===c.shape){var S=Math.max.apply(Math,toConsumableArray_toConsumableArray(w.map(function(c){return c.width}))),M=w.length*c.lineHeight,k=c.size/M,T=S*k,E=c.size,I=T+2*c.padding,P=E+2*c.padding;g.append("rect").attr("width",I).attr("height",P).attr("x",c.x-I/2).attr("y",c.y-P/2).attr("id","em-stamp-shape").attr("fill","none").attr("stroke",c.stampColor).attr("stroke-width",c.strokeWidth),g.append("text").attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",c.textColor).attr("id","em-stamp-text").attr("transform","translate(".concat(c.x,",").concat(c.y,") scale(").concat(k,")")).selectAll("tspan").data(w).enter().append("tspan").attr("x",0).attr("y",function(h,g){return(g-w.length/2+.5)*c.lineHeight}).text(function(c){return c.text.replaceAll("~"," ").replaceAll("¶","")})}else{var L=ro(w,c.lineHeight),B=c.size/L;if("square"===c.shape){var z=2*(c.size+c.padding);g.append("rect").attr("width",z).attr("height",z).attr("x",c.x-c.size-c.padding).attr("y",c.y-c.size-c.padding).attr("id","em-stamp-shape").attr("fill","none").attr("stroke",c.stampColor).attr("stroke-width",c.strokeWidth)}else g.append("circle").attr("r",c.size+c.padding).attr("cx",c.x).attr("cy",c.y).attr("id","em-stamp-shape").attr("fill","none").attr("stroke",c.stampColor).attr("stroke-width",c.strokeWidth);g.append("text").attr("text-anchor","middle").attr("fill",c.textColor).attr("id","em-stamp-text").attr("transform","translate(".concat(c.x,",").concat(c.y,") scale(").concat(B,")")).selectAll("tspan").data(w).enter().append("tspan").attr("x",0).attr("y",function(h,g){return(g-w.length/2+.8)*c.lineHeight}).text(function(c){return c.text.replaceAll("~"," ").replaceAll("¶","")})}}},eo=function getWords(c){return c.split(/(?<=¶)|\s+/g).map(function(c){return c.trim()}).filter(function(c){return c.length>0})},no=function measureWidth(c){var h=document.createElementNS("http://www.w3.org/2000/svg","svg"),g=document.createElementNS("http://www.w3.org/2000/svg","text");g.textContent=c,h.appendChild(g),document.body.appendChild(h);var m=g.getComputedTextLength();return document.body.removeChild(h),m},ro=function getTextRadius(c,h){for(var g=0,m=0,b=c.length;m<b;++m){var w=(Math.abs(m-b/2+.5)+.5)*h,S=c[m].width/2;g=Math.max(g,Math.sqrt(Math.pow(S,2)+Math.pow(w,2)))}return g},oo=function getLines(c,h){for(var g=[],m={width:0,text:""},b=0,w=c.length;b<w;++b)if("¶"!==c[b]){var S=(m.text?m.text+" ":"")+c[b],M=no(S);(m.width+M)/2<h?(m.width=M,m.text=S):(m.text&&g.push(m),m={width:no(c[b]),text:c[b]})}else m.text&&g.push(m),m={width:0,text:""};return m.text&&g.push(m),g},ao={},io={};function objectConverter(c){return new Function("d","return {"+c.map(function(c,h){return JSON.stringify(c)+": d["+h+'] || ""'}).join(",")+"}")}function inferColumns(c){var h=Object.create(null),g=[];return c.forEach(function(c){for(var m in c)m in h||g.push(h[m]=m)}),g}function pad(c,h){var g=c+"",m=g.length;return m<h?new Array(h-m+1).join(0)+g:g}function formatDate(c){var h=c.getUTCHours(),g=c.getUTCMinutes(),m=c.getUTCSeconds(),b=c.getUTCMilliseconds();return isNaN(c)?"Invalid Date":function formatYear(c){return c<0?"-"+pad(-c,6):c>9999?"+"+pad(c,6):pad(c,4)}(c.getUTCFullYear())+"-"+pad(c.getUTCMonth()+1,2)+"-"+pad(c.getUTCDate(),2)+(b?"T"+pad(h,2)+":"+pad(g,2)+":"+pad(m,2)+"."+pad(b,3)+"Z":m?"T"+pad(h,2)+":"+pad(g,2)+":"+pad(m,2)+"Z":g||h?"T"+pad(h,2)+":"+pad(g,2)+"Z":"")}function dsv(c){var h=new RegExp('["'+c+"\n\r]"),g=c.charCodeAt(0);function parseRows(c,h){var m,b=[],w=c.length,S=0,M=0,k=w<=0,T=!1;function token(){if(k)return io;if(T)return T=!1,ao;var h,m,b=S;if(34===c.charCodeAt(b)){for(;S++<w&&34!==c.charCodeAt(S)||34===c.charCodeAt(++S););return(h=S)>=w?k=!0:10===(m=c.charCodeAt(S++))?T=!0:13===m&&(T=!0,10===c.charCodeAt(S)&&++S),c.slice(b+1,h-1).replace(/""/g,'"')}for(;S<w;){if(10===(m=c.charCodeAt(h=S++)))T=!0;else if(13===m)T=!0,10===c.charCodeAt(S)&&++S;else if(m!==g)continue;return c.slice(b,h)}return k=!0,c.slice(b,w)}for(10===c.charCodeAt(w-1)&&--w,13===c.charCodeAt(w-1)&&--w;(m=token())!==io;){for(var E=[];m!==ao&&m!==io;)E.push(m),m=token();h&&null==(E=h(E,M++))||b.push(E)}return b}function preformatBody(h,g){return h.map(function(h){return g.map(function(c){return formatValue(h[c])}).join(c)})}function formatRow(h){return h.map(formatValue).join(c)}function formatValue(c){return null==c?"":c instanceof Date?formatDate(c):h.test(c+="")?'"'+c.replace(/"/g,'""')+'"':c}return{parse:function parse(c,h){var g,m,b=parseRows(c,function(c,b){if(g)return g(c,b-1);m=c,g=h?function customConverter(c,h){var g=objectConverter(c);return function(m,b){return h(g(m),b,c)}}(c,h):objectConverter(c)});return b.columns=m||[],b},parseRows,format:function format(h,g){return null==g&&(g=inferColumns(h)),[g.map(formatValue).join(c)].concat(preformatBody(h,g)).join("\n")},formatBody:function formatBody(c,h){return null==h&&(h=inferColumns(c)),preformatBody(c,h).join("\n")},formatRows:function formatRows(c){return c.map(formatRow).join("\n")},formatRow,formatValue}}var so=dsv(","),lo=so.parse,co=so.parseRows,uo=(so.format,so.formatBody,so.formatRows,so.formatRow,so.formatValue,function getGridLayout(c){return c.gridCartogramPositions_||("hexagon"===c.gridCartogramShape_?"\n ,IS, , , , , , , , , , ,\n , , , ,NO,SE,FI,EE, , , , ,\n , , , , , , ,LV, , , , ,\n ,IE,UK, , ,DK, ,LT, , , , ,\n , , , ,NL,DE,PL, , , , , ,\n , , ,BE,LU,CZ,SK,UA, , , , ,\n , ,FR,CH,LI,AT,HU,RO,MD, , , ,\n ,PT,ES, ,IT,SI,HR,RS,BG, , , ,\n , , , , , ,BA,ME,MK, , , , \n , , , , , , ,AL,EL,TR,GE, , \n , , , ,MT, , , , ,CY, , , ":"\n ,IS, , ,NO,SE,FI, , , , , ,\n , , , , , , ,EE, , , , ,\n , , , , , , ,LV, , , , ,\n ,IE,UK, , ,DK, ,LT, , , , ,\n , , , ,NL,DE,PL, , , , , ,\n , , ,BE,LU,CZ,SK,UA, , , , ,\n , ,FR,CH,LI,AT,HU,RO,MD, , , ,\n ,PT,ES, ,IT,SI,HR,RS,BG, , , ,\n , , , , , ,BA,ME,MK, , , , \n , , , , , , ,AL,EL,TR,GE, , \n , , , ,MT, , , , ,CY, , , ")}),ho=function parseGridLayout(c){var h=new Map;return co(c.trim(),function(c,g){c.forEach(function(c,m){(c=c.trim())&&h.set(c,[m,g])})}),h},po=function getGridData(c,h){return Array.from(c,function(c){var g=slicedToArray_slicedToArray(c,2),m=g[0],b=slicedToArray_slicedToArray(g[1],2),w=b[0],S=b[1],M=h.Geometries.geoJSONs.nutsrg.find(function(c){return c.properties.id==m});return{id:m,col:w,row:S,properties:{id:m,name:M?M.properties.na:""}}})},fo=function drawSquareGrid(c,h,g){var m=Math.max.apply(Math,toConsumableArray_toConsumableArray(h.map(function(c){return c.col})))+1,b=Math.max.apply(Math,toConsumableArray_toConsumableArray(h.map(function(c){return c.row})))+1,w=g.gridCartogramMargins_,S=g.gridCartogramCellPadding_||0,M=(g.width_-w.left-w.right)/m-S,k=(g.height_-w.top-w.bottom)/b-S,T=Math.min(M,k);c.selectAll(".em-grid-cell").data(h).enter().append("g").attr("class","em-grid-cell").attr("transform",function(c){return"translate(".concat(c.col*(T+S)+w.left,", ").concat(c.row*(T+S)+w.top,")")}).each(function(c){src_select(this).append("rect").datum(c).attr("width",T).attr("height",T).attr("class","em-grid-rect em-grid-shape"),src_select(this).append("text").attr("id","em-grid-text-".concat(c.id)).attr("class","em-grid-text").attr("text-anchor","middle").style("font-size",_o(g._mapType)).style("transform",mo(g._mapType)).style("pointer-events","none").attr("fill","black").text(c.id).attr("x",T/2).attr("y",T/2+5)})},go=function drawHexagonGrid(c,h,g){var m=Math.max.apply(Math,toConsumableArray_toConsumableArray(h.map(function(c){return c.col})))+1,b=Math.max.apply(Math,toConsumableArray_toConsumableArray(h.map(function(c){return c.row})))+1,w=g.gridCartogramMargins_,S=g.gridCartogramCellPadding_||0,M=Math.min((g.width_-w.left-w.right)/(1.5*m),(g.height_-w.top-w.bottom)/(b*Math.sqrt(3))),k=Math.sqrt(3)*M;c.selectAll(".em-grid-cell").data(h).enter().append("g").attr("class","em-grid-cell").attr("transform",function(c){var h=c.col*(1.5*M+S)+w.left,g=c.row*(k+S)+(c.col%2==1?(k+S)/2:0)+w.top;return"translate(".concat(h,", ").concat(g,")")}).each(function(c){src_select(this).append("path").datum(c).attr("d",vo(M)).attr("class","em-grid-hexagon em-grid-shape"),src_select(this).append("text").attr("id","em-grid-text-".concat(c.id)).attr("class","em-grid-text").attr("text-anchor","middle").style("font-size",_o(g._mapType)).style("transform",mo(g._mapType)).style("pointer-events","none").attr("fill","black").text(c.id).attr("y",5)})},_o=function getFontSize(c){switch(c){case"sparkline":case"spark":default:return 12;case"proportionalSymbol":return 14;case"choropleth":return 15}},mo=function getLabelTranslate(c){switch(c){case"sparkline":case"spark":return"translate(0, -10px)";case"proportionalSymbol":return"translate(0, -12px)";default:return"translate(0, 0px)"}},vo=function drawHexagon(c){var h=Math.PI/3;return Array.from({length:6},function(g,m){var b=c*Math.cos(h*m),w=c*Math.sin(h*m);return"".concat(0===m?"M":"L").concat(b,",").concat(w)}).join(" ")+" Z"},yo=function centerGrid(c,h,g,m){c.each(function(){var b=this.getBBox(),w=(h-m.left-m.right-b.width)/2-b.x+m.left,S=(g-m.top-m.bottom-b.height)/2-b.y+m.top;c.attr("transform","translate(".concat(w,", ").concat(S,")"))})};function adjustGridCartogramTextLabels(c){var h=c.map,g=c.getAnchors,m=c.getRadius,b=c.margin,w=void 0===b?2:b,S="hexagon"===h.gridCartogramShape_;g(h).each(function(c){var h=src_select(this),g=h.select(".em-grid-text");if(!g.empty()){var b=c.properties.id,M=m(b,c);if(M&&!(M<=0)){var k=h.select(".em-grid-shape, .em-grid-rect, .em-grid-hexagon").node();if(k){var T=k.getBBox(),E=(S?0:T.height/2)-M-w;g.attr("y",E)}}}})}function cartesian_spherical(c){return[$t(c[1],c[0]),asin(c[2])]}function cartesian_cartesian(c){var h=c[0],g=c[1],m=Xt(g);return[m*Xt(h),m*Jt(h),Jt(g)]}function cartesian_cartesianDot(c,h){return c[0]*h[0]+c[1]*h[1]+c[2]*h[2]}function cartesian_cartesianCross(c,h){return[c[1]*h[2]-c[2]*h[1],c[2]*h[0]-c[0]*h[2],c[0]*h[1]-c[1]*h[0]]}function cartesian_cartesianAddInPlace(c,h){c[0]+=h[0],c[1]+=h[1],c[2]+=h[2]}function cartesian_cartesianScale(c,h){return[c[0]*h,c[1]*h,c[2]*h]}function cartesian_cartesianNormalizeInPlace(c){var h=te(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);c[0]/=h,c[1]/=h,c[2]/=h}function polygonContains_longitude(c){return Yt(c[0])<=Rt?c[0]:Qt(c[0])*((Yt(c[0])+Rt)%Wt-Rt)}function src_clip(c,h,g,m){return function(b){var w,S,M,k=h(b),T=buffer(),E=h(T),I=!1,P={point,lineStart,lineEnd,polygonStart:function(){P.point=pointRing,P.lineStart=ringStart,P.lineEnd=ringEnd,S=[],w=[]},polygonEnd:function(){P.point=point,P.lineStart=lineStart,P.lineEnd=lineEnd,S=merge_merge(S);var c=function src_polygonContains(c,h){var g=polygonContains_longitude(h),m=h[1],b=Jt(m),w=[Jt(g),-Xt(g),0],S=0,M=0,k=new Adder;1===b?m=Gt+Dt:-1===b&&(m=-Gt-Dt);for(var T=0,E=c.length;T<E;++T)if(P=(I=c[T]).length)for(var I,P,L=I[P-1],B=polygonContains_longitude(L),z=L[1]/2+qt,j=Jt(z),D=Xt(z),N=0;N<P;++N,B=G,j=W,D=H,L=R){var R=I[N],G=polygonContains_longitude(R),q=R[1]/2+qt,W=Jt(q),H=Xt(q),U=G-B,Y=U>=0?1:-1,V=Y*U,$=V>Rt,X=j*W;if(k.add($t(X*Y*Jt(V),D*H+X*Xt(V))),S+=$?U+Y*Wt:U,$^B>=g^G>=g){var K=cartesian_cartesianCross(cartesian_cartesian(L),cartesian_cartesian(R));cartesian_cartesianNormalizeInPlace(K);var Z=cartesian_cartesianCross(w,K);cartesian_cartesianNormalizeInPlace(Z);var J=($^U>=0?-1:1)*asin(Z[2]);(m>J||m===J&&(K[0]||K[1]))&&(M+=$^U>=0?1:-1)}}return(S<-Dt||S<Dt&&k<-1e-12)^1&M}(w,m);S.length?(I||(b.polygonStart(),I=!0),rejoin(S,clip_compareIntersection,c,g,b)):c&&(I||(b.polygonStart(),I=!0),b.lineStart(),g(null,null,1,b),b.lineEnd()),I&&(b.polygonEnd(),I=!1),S=w=null},sphere:function(){b.polygonStart(),b.lineStart(),g(null,null,1,b),b.lineEnd(),b.polygonEnd()}};function point(h,g){c(h,g)&&b.point(h,g)}function pointLine(c,h){k.point(c,h)}function lineStart(){P.point=pointLine,k.lineStart()}function lineEnd(){P.point=point,k.lineEnd()}function pointRing(c,h){M.push([c,h]),E.point(c,h)}function ringStart(){E.lineStart(),M=[]}function ringEnd(){pointRing(M[0][0],M[0][1]),E.lineEnd();var c,h,g,m,k=E.clean(),P=T.result(),L=P.length;if(M.pop(),w.push(M),M=null,L)if(1&k){if((h=(g=P[0]).length-1)>0){for(I||(b.polygonStart(),I=!0),b.lineStart(),c=0;c<h;++c)b.point((m=g[c])[0],m[1]);b.lineEnd()}}else L>1&&2&k&&P.push(P.pop().concat(P.shift())),S.push(P.filter(clip_validSegment))}return P}}function clip_validSegment(c){return c.length>1}function clip_compareIntersection(c,h){return((c=c.x)[0]<0?c[1]-Gt-Dt:Gt-c[1])-((h=h.x)[0]<0?h[1]-Gt-Dt:Gt-h[1])}const Ao=src_clip(function(){return!0},function antimeridian_clipAntimeridianLine(c){var h,g=NaN,m=NaN,b=NaN;return{lineStart:function(){c.lineStart(),h=1},point:function(w,S){var M=w>0?Rt:-Rt,k=Yt(w-g);Yt(k-Rt)<Dt?(c.point(g,m=(m+S)/2>0?Gt:-Gt),c.point(b,m),c.lineEnd(),c.lineStart(),c.point(M,m),c.point(w,m),h=0):b!==M&&k>=Rt&&(Yt(g-b)<Dt&&(g-=b*Dt),Yt(w-M)<Dt&&(w-=M*Dt),m=function antimeridian_clipAntimeridianIntersect(c,h,g,m){var b,w,S=Jt(c-g);return Yt(S)>Dt?Vt((Jt(h)*(w=Xt(m))*Jt(g)-Jt(m)*(b=Xt(h))*Jt(c))/(b*w*S)):(h+m)/2}(g,m,w,S),c.point(b,m),c.lineEnd(),c.lineStart(),c.point(M,m),h=0),c.point(g=w,m=S),b=M},lineEnd:function(){c.lineEnd(),g=m=NaN},clean:function(){return 2-h}}},function antimeridian_clipAntimeridianInterpolate(c,h,g,m){var b;if(null==c)b=g*Gt,m.point(-Rt,b),m.point(0,b),m.point(Rt,b),m.point(Rt,0),m.point(Rt,-b),m.point(0,-b),m.point(-Rt,-b),m.point(-Rt,0),m.point(-Rt,b);else if(Yt(c[0]-h[0])>Dt){var w=c[0]<h[0]?Rt:-Rt;b=g*w/2,m.point(-w,b),m.point(0,b),m.point(w,b)}else m.point(h[0],h[1])},[-Rt,-Gt]);function circle_circleStream(c,h,g,m,b,w){if(g){var S=Xt(h),M=Jt(h),k=m*g;null==b?(b=h+m*Wt,w=h-k/2):(b=circle_circleRadius(S,b),w=circle_circleRadius(S,w),(m>0?b<w:b>w)&&(b+=m*Wt));for(var T,E=b;m>0?E>w:E<w;E-=k)T=cartesian_spherical([S,-M*Xt(E),-M*Jt(E)]),c.point(T[0],T[1])}}function circle_circleRadius(c,h){(h=cartesian_cartesian(h))[0]-=c,cartesian_cartesianNormalizeInPlace(h);var g=function acos(c){return c>1?0:c<-1?Rt:Math.acos(c)}(-h[1]);return((-h[2]<0?-g:g)+Wt-Dt)%Wt}function src_compose(c,h){function compose(g,m){return g=c(g,m),h(g[0],g[1])}return c.invert&&h.invert&&(compose.invert=function(g,m){return(g=h.invert(g,m))&&c.invert(g[0],g[1])}),compose}function rotation_rotationIdentity(c,h){return Yt(c)>Rt&&(c-=Math.round(c/Wt)*Wt),[c,h]}function src_rotation_rotateRadians(c,h,g){return(c%=Wt)?h||g?src_compose(rotation_rotationLambda(c),rotation_rotationPhiGamma(h,g)):rotation_rotationLambda(c):h||g?rotation_rotationPhiGamma(h,g):rotation_rotationIdentity}function rotation_forwardRotationLambda(c){return function(h,g){return Yt(h+=c)>Rt&&(h-=Math.round(h/Wt)*Wt),[h,g]}}function rotation_rotationLambda(c){var h=rotation_forwardRotationLambda(c);return h.invert=rotation_forwardRotationLambda(-c),h}function rotation_rotationPhiGamma(c,h){var g=Xt(c),m=Jt(c),b=Xt(h),w=Jt(h);function rotation(c,h){var S=Xt(h),M=Xt(c)*S,k=Jt(c)*S,T=Jt(h),E=T*g+M*m;return[$t(k*b-E*w,M*g-T*m),asin(E*b+k*w)]}return rotation.invert=function(c,h){var S=Xt(h),M=Xt(c)*S,k=Jt(c)*S,T=Jt(h),E=T*b-k*w;return[$t(k*b+T*w,M*g+E*m),asin(E*g-M*m)]},rotation}rotation_rotationIdentity.invert=rotation_rotationIdentity;var bo=Xt(30*Ut);function projection_resample(c,h){return+h?function projection_resample_resample(c,h){function resampleLineTo(g,m,b,w,S,M,k,T,E,I,P,L,B,z){var j=k-g,D=T-m,N=j*j+D*D;if(N>4*h&&B--){var R=w+I,G=S+P,q=M+L,W=te(R*R+G*G+q*q),H=asin(q/=W),U=Yt(Yt(q)-1)<Dt||Yt(b-E)<Dt?(b+E)/2:$t(G,R),Y=c(U,H),V=Y[0],$=Y[1],X=V-g,K=$-m,Z=D*X-j*K;(Z*Z/N>h||Yt((j*X+D*K)/N-.5)>.3||w*I+S*P+M*L<bo)&&(resampleLineTo(g,m,b,w,S,M,V,$,U,R/=W,G/=W,q,B,z),z.point(V,$),resampleLineTo(V,$,U,R,G,q,k,T,E,I,P,L,B,z))}}return function(h){var g,m,b,w,S,M,k,T,E,I,P,L,B={point,lineStart,lineEnd,polygonStart:function(){h.polygonStart(),B.lineStart=ringStart},polygonEnd:function(){h.polygonEnd(),B.lineStart=lineStart}};function point(g,m){g=c(g,m),h.point(g[0],g[1])}function lineStart(){T=NaN,B.point=linePoint,h.lineStart()}function linePoint(g,m){var b=cartesian_cartesian([g,m]),w=c(g,m);resampleLineTo(T,E,k,I,P,L,T=w[0],E=w[1],k=g,I=b[0],P=b[1],L=b[2],16,h),h.point(T,E)}function lineEnd(){B.point=point,h.lineEnd()}function ringStart(){lineStart(),B.point=ringPoint,B.lineEnd=ringEnd}function ringPoint(c,h){linePoint(g=c,h),m=T,b=E,w=I,S=P,M=L,B.point=linePoint}function ringEnd(){resampleLineTo(T,E,k,I,P,L,m,b,g,w,S,M,16,h),B.lineEnd=lineEnd,lineEnd()}return B}}(c,h):function resample_resampleNone(c){return transform_transformer({point:function(h,g){h=c(h,g),this.stream.point(h[0],h[1])}})}(c)}var xo=transform_transformer({point:function(c,h){this.stream.point(c*Ut,h*Ut)}});function projection_scaleTranslateRotate(c,h,g,m,b,w){if(!w)return function projection_scaleTranslate(c,h,g,m,b){function transform(w,S){return[h+c*(w*=m),g-c*(S*=b)]}return transform.invert=function(w,S){return[(w-h)/c*m,(g-S)/c*b]},transform}(c,h,g,m,b);var S=Xt(w),M=Jt(w),k=S*c,T=M*c,E=S/c,I=M/c,P=(M*g-S*h)/c,L=(M*h+S*g)/c;function transform(c,w){return[k*(c*=m)-T*(w*=b)+h,g-T*c-k*w]}return transform.invert=function(c,h){return[m*(E*c-I*h+P),b*(L-I*c-E*h)]},transform}function projection_projection(c){return function projection_projectionMutator(c){var h,g,m,b,w,S,M,k,T,E,I=150,P=480,L=250,B=0,z=0,j=0,D=0,N=0,R=0,G=1,q=1,W=null,H=Ao,U=null,Y=d3_geo_src_identity,V=.5;function projection(c){return k(c[0]*Ut,c[1]*Ut)}function invert(c){return(c=k.invert(c[0],c[1]))&&[c[0]*Ht,c[1]*Ht]}function recenter(){var c=projection_scaleTranslateRotate(I,0,0,G,q,R).apply(null,h(B,z)),m=projection_scaleTranslateRotate(I,P-c[0],L-c[1],G,q,R);return g=src_rotation_rotateRadians(j,D,N),M=src_compose(h,m),k=src_compose(g,M),S=projection_resample(M,V),reset()}function reset(){return T=E=null,projection}return projection.stream=function(c){return T&&E===c?T:T=xo(function projection_transformRotate(c){return transform_transformer({point:function(h,g){var m=c(h,g);return this.stream.point(m[0],m[1])}})}(g)(H(S(Y(E=c)))))},projection.preclip=function(c){return arguments.length?(H=c,W=void 0,reset()):H},projection.postclip=function(c){return arguments.length?(Y=c,U=m=b=w=null,reset()):Y},projection.clipAngle=function(c){return arguments.length?(H=+c?function src_clip_circle(c){var h=Xt(c),g=2*Ut,m=h>0,b=Yt(h)>Dt;function visible(c,g){return Xt(c)*Xt(g)>h}function intersect(c,g,m){var b=[1,0,0],w=cartesian_cartesianCross(cartesian_cartesian(c),cartesian_cartesian(g)),S=cartesian_cartesianDot(w,w),M=w[0],k=S-M*M;if(!k)return!m&&c;var T=h*S/k,E=-h*M/k,I=cartesian_cartesianCross(b,w),P=cartesian_cartesianScale(b,T);cartesian_cartesianAddInPlace(P,cartesian_cartesianScale(w,E));var L=I,B=cartesian_cartesianDot(P,L),z=cartesian_cartesianDot(L,L),j=B*B-z*(cartesian_cartesianDot(P,P)-1);if(!(j<0)){var D=te(j),N=cartesian_cartesianScale(L,(-B-D)/z);if(cartesian_cartesianAddInPlace(N,P),N=cartesian_spherical(N),!m)return N;var R,G=c[0],q=g[0],W=c[1],H=g[1];q<G&&(R=G,G=q,q=R);var U=q-G,Y=Yt(U-Rt)<Dt;if(!Y&&H<W&&(R=W,W=H,H=R),Y||U<Dt?Y?W+H>0^N[1]<(Yt(N[0]-G)<Dt?W:H):W<=N[1]&&N[1]<=H:U>Rt^(G<=N[0]&&N[0]<=q)){var V=cartesian_cartesianScale(L,(-B+D)/z);return cartesian_cartesianAddInPlace(V,P),[N,cartesian_spherical(V)]}}}function code(h,g){var b=m?c:Rt-c,w=0;return h<-b?w|=1:h>b&&(w|=2),g<-b?w|=4:g>b&&(w|=8),w}return src_clip(visible,function clipLine(c){var h,g,w,S,M;return{lineStart:function(){S=w=!1,M=1},point:function(k,T){var E,I=[k,T],P=visible(k,T),L=m?P?0:code(k,T):P?code(k+(k<0?Rt:-Rt),T):0;if(!h&&(S=w=P)&&c.lineStart(),P!==w&&(!(E=intersect(h,I))||pointEqual(h,E)||pointEqual(I,E))&&(I[2]=1),P!==w)M=0,P?(c.lineStart(),E=intersect(I,h),c.point(E[0],E[1])):(E=intersect(h,I),c.point(E[0],E[1],2),c.lineEnd()),h=E;else if(b&&h&&m^P){var B;L&g||!(B=intersect(I,h,!0))||(M=0,m?(c.lineStart(),c.point(B[0][0],B[0][1]),c.point(B[1][0],B[1][1]),c.lineEnd()):(c.point(B[1][0],B[1][1]),c.lineEnd(),c.lineStart(),c.point(B[0][0],B[0][1],3)))}!P||h&&pointEqual(h,I)||c.point(I[0],I[1]),h=I,w=P,g=L},lineEnd:function(){w&&c.lineEnd(),h=null},clean:function(){return M|(S&&w)<<1}}},function interpolate(h,m,b,w){circle_circleStream(w,c,g,b,h,m)},m?[0,-c]:[-Rt,c-Rt])}(W=c*Ut):(W=null,Ao),reset()):W*Ht},projection.clipExtent=function(c){return arguments.length?(Y=null==c?(U=m=b=w=null,d3_geo_src_identity):clipRectangle(U=+c[0][0],m=+c[0][1],b=+c[1][0],w=+c[1][1]),reset()):null==U?null:[[U,m],[b,w]]},projection.scale=function(c){return arguments.length?(I=+c,recenter()):I},projection.translate=function(c){return arguments.length?(P=+c[0],L=+c[1],recenter()):[P,L]},projection.center=function(c){return arguments.length?(B=c[0]%360*Ut,z=c[1]%360*Ut,recenter()):[B*Ht,z*Ht]},projection.rotate=function(c){return arguments.length?(j=c[0]%360*Ut,D=c[1]%360*Ut,N=c.length>2?c[2]%360*Ut:0,recenter()):[j*Ht,D*Ht,N*Ht]},projection.angle=function(c){return arguments.length?(R=c%360*Ut,recenter()):R*Ht},projection.reflectX=function(c){return arguments.length?(G=c?-1:1,recenter()):G<0},projection.reflectY=function(c){return arguments.length?(q=c?-1:1,recenter()):q<0},projection.precision=function(c){return arguments.length?(S=projection_resample(M,V=c*c),reset()):te(V)},projection.fitExtent=function(c,h){return fitExtent(projection,c,h)},projection.fitSize=function(c,h){return fitSize(projection,c,h)},projection.fitWidth=function(c,h){return fitWidth(projection,c,h)},projection.fitHeight=function(c,h){return fitHeight(projection,c,h)},function(){return h=c.apply(this,arguments),projection.invert=h.invert&&invert,recenter()}}(function(){return c})()}function orthographicRaw(c,h){return[Xt(h)*Jt(c),Jt(h)]}orthographicRaw.invert=function azimuthalInvert(c){return function(h,g){var m=te(h*h+g*g),b=c(m),w=Jt(b),S=Xt(b);return[$t(h*w,m*S),asin(m&&g*w/m)]}}(asin);var wo=6378137,Co=.0066943799901413165,So=484813681109536e-20,Mo=Math.PI/2,ko=1e-10,To=.017453292519943295,Eo=57.29577951308232,Io=Math.PI/4,Po=2*Math.PI,Lo=3.14159265359,Fo={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};const Bo=Fo,Oo={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var zo=/[\s_\-\/\(\)]/g;function match(c,h){if(c[h])return c[h];for(var g,m=Object.keys(c),b=h.toLowerCase().replace(zo,""),w=-1;++w<m.length;)if((g=m[w]).toLowerCase().replace(zo,"")===b)return c[g]}function projString(c){var h,g,m,b={},w=c.split("+").map(function(c){return c.trim()}).filter(function(c){return c}).reduce(function(c,h){var g=h.split("=");return g.push(!0),c[g[0].toLowerCase()]=g[1],c},{}),S={proj:"projName",datum:"datumCode",rf:function(c){b.rf=parseFloat(c)},lat_0:function(c){b.lat0=c*To},lat_1:function(c){b.lat1=c*To},lat_2:function(c){b.lat2=c*To},lat_ts:function(c){b.lat_ts=c*To},lon_0:function(c){b.long0=c*To},lon_1:function(c){b.long1=c*To},lon_2:function(c){b.long2=c*To},alpha:function(c){b.alpha=parseFloat(c)*To},gamma:function(c){b.rectified_grid_angle=parseFloat(c)*To},lonc:function(c){b.longc=c*To},x_0:function(c){b.x0=parseFloat(c)},y_0:function(c){b.y0=parseFloat(c)},k_0:function(c){b.k0=parseFloat(c)},k:function(c){b.k0=parseFloat(c)},a:function(c){b.a=parseFloat(c)},b:function(c){b.b=parseFloat(c)},r:function(c){b.a=b.b=parseFloat(c)},r_a:function(){b.R_A=!0},zone:function(c){b.zone=parseInt(c,10)},south:function(){b.utmSouth=!0},towgs84:function(c){b.datum_params=c.split(",").map(function(c){return parseFloat(c)})},to_meter:function(c){b.to_meter=parseFloat(c)},units:function(c){b.units=c;var h=match(Oo,c);h&&(b.to_meter=h.to_meter)},from_greenwich:function(c){b.from_greenwich=c*To},pm:function(c){var h=match(Bo,c);b.from_greenwich=(h||parseFloat(c))*To},nadgrids:function(c){"@null"===c?b.datumCode="none":b.nadgrids=c},axis:function(c){var h="ewnsud";3===c.length&&-1!==h.indexOf(c.substr(0,1))&&-1!==h.indexOf(c.substr(1,1))&&-1!==h.indexOf(c.substr(2,1))&&(b.axis=c)},approx:function(){b.approx=!0},over:function(){b.over=!0}};for(h in w)g=w[h],h in S?"function"==typeof(m=S[h])?m(g):b[m]=g:b[h]=g;return"string"==typeof b.datumCode&&"WGS84"!==b.datumCode&&(b.datumCode=b.datumCode.toLowerCase()),b.projStr=c,b}const jo=class PROJJSONBuilderBase{static getId(c){const h=c.find(c=>Array.isArray(c)&&"ID"===c[0]);return h&&h.length>=3?{authority:h[1],code:parseInt(h[2],10)}:null}static convertUnit(c,h="unit"){if(!c||c.length<3)return{type:h,name:"unknown",conversion_factor:null};const g=c[1],m=parseFloat(c[2])||null,b=c.find(c=>Array.isArray(c)&&"ID"===c[0]);return{type:h,name:g,conversion_factor:m,id:b?{authority:b[1],code:parseInt(b[2],10)}:null}}static convertAxis(c){const h=c[1]||"Unknown";let g;const m=h.match(/^\((.)\)$/);if(m){const c=m[1].toUpperCase();if("E"===c)g="east";else if("N"===c)g="north";else{if("U"!==c)throw new Error(`Unknown axis abbreviation: ${c}`);g="up"}}else g=c[2]?c[2].toLowerCase():"unknown";const b=c.find(c=>Array.isArray(c)&&"ORDER"===c[0]),w=b?parseInt(b[1],10):null,S=c.find(c=>Array.isArray(c)&&("LENGTHUNIT"===c[0]||"ANGLEUNIT"===c[0]||"SCALEUNIT"===c[0]));return{name:h,direction:g,unit:this.convertUnit(S),order:w}}static extractAxes(c){return c.filter(c=>Array.isArray(c)&&"AXIS"===c[0]).map(c=>this.convertAxis(c)).sort((c,h)=>(c.order||0)-(h.order||0))}static convert(c,h={}){switch(c[0]){case"PROJCRS":h.type="ProjectedCRS",h.name=c[1],h.base_crs=c.find(c=>Array.isArray(c)&&"BASEGEOGCRS"===c[0])?this.convert(c.find(c=>Array.isArray(c)&&"BASEGEOGCRS"===c[0])):null,h.conversion=c.find(c=>Array.isArray(c)&&"CONVERSION"===c[0])?this.convert(c.find(c=>Array.isArray(c)&&"CONVERSION"===c[0])):null;const g=c.find(c=>Array.isArray(c)&&"CS"===c[0]);g&&(h.coordinate_system={type:g[1],axis:this.extractAxes(c)});const m=c.find(c=>Array.isArray(c)&&"LENGTHUNIT"===c[0]);if(m){const c=this.convertUnit(m);h.coordinate_system.unit=c}h.id=this.getId(c);break;case"BASEGEOGCRS":case"GEOGCRS":h.type="GeographicCRS",h.name=c[1];const b=c.find(c=>Array.isArray(c)&&("DATUM"===c[0]||"ENSEMBLE"===c[0]));if(b){const g=this.convert(b);"ENSEMBLE"===b[0]?h.datum_ensemble=g:h.datum=g;const m=c.find(c=>Array.isArray(c)&&"PRIMEM"===c[0]);m&&"Greenwich"!==m[1]&&(g.prime_meridian={name:m[1],longitude:parseFloat(m[2])})}h.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(c)},h.id=this.getId(c);break;case"DATUM":h.type="GeodeticReferenceFrame",h.name=c[1],h.ellipsoid=c.find(c=>Array.isArray(c)&&"ELLIPSOID"===c[0])?this.convert(c.find(c=>Array.isArray(c)&&"ELLIPSOID"===c[0])):null;break;case"ENSEMBLE":h.type="DatumEnsemble",h.name=c[1],h.members=c.filter(c=>Array.isArray(c)&&"MEMBER"===c[0]).map(c=>({type:"DatumEnsembleMember",name:c[1],id:this.getId(c)}));const w=c.find(c=>Array.isArray(c)&&"ENSEMBLEACCURACY"===c[0]);w&&(h.accuracy=parseFloat(w[1]));const S=c.find(c=>Array.isArray(c)&&"ELLIPSOID"===c[0]);S&&(h.ellipsoid=this.convert(S)),h.id=this.getId(c);break;case"ELLIPSOID":h.type="Ellipsoid",h.name=c[1],h.semi_major_axis=parseFloat(c[2]),h.inverse_flattening=parseFloat(c[3]);c.find(c=>Array.isArray(c)&&"LENGTHUNIT"===c[0])&&this.convert(c.find(c=>Array.isArray(c)&&"LENGTHUNIT"===c[0]),h);break;case"CONVERSION":h.type="Conversion",h.name=c[1],h.method=c.find(c=>Array.isArray(c)&&"METHOD"===c[0])?this.convert(c.find(c=>Array.isArray(c)&&"METHOD"===c[0])):null,h.parameters=c.filter(c=>Array.isArray(c)&&"PARAMETER"===c[0]).map(c=>this.convert(c));break;case"METHOD":h.type="Method",h.name=c[1],h.id=this.getId(c);break;case"PARAMETER":h.type="Parameter",h.name=c[1],h.value=parseFloat(c[2]),h.unit=this.convertUnit(c.find(c=>Array.isArray(c)&&("LENGTHUNIT"===c[0]||"ANGLEUNIT"===c[0]||"SCALEUNIT"===c[0]))),h.id=this.getId(c);break;case"BOUNDCRS":h.type="BoundCRS";const M=c.find(c=>Array.isArray(c)&&"SOURCECRS"===c[0]);if(M){const c=M.find(c=>Array.isArray(c));h.source_crs=c?this.convert(c):null}const k=c.find(c=>Array.isArray(c)&&"TARGETCRS"===c[0]);if(k){const c=k.find(c=>Array.isArray(c));h.target_crs=c?this.convert(c):null}const T=c.find(c=>Array.isArray(c)&&"ABRIDGEDTRANSFORMATION"===c[0]);h.transformation=T?this.convert(T):null;break;case"ABRIDGEDTRANSFORMATION":if(h.type="Transformation",h.name=c[1],h.method=c.find(c=>Array.isArray(c)&&"METHOD"===c[0])?this.convert(c.find(c=>Array.isArray(c)&&"METHOD"===c[0])):null,h.parameters=c.filter(c=>Array.isArray(c)&&("PARAMETER"===c[0]||"PARAMETERFILE"===c[0])).map(c=>"PARAMETER"===c[0]?this.convert(c):"PARAMETERFILE"===c[0]?{name:c[1],value:c[2],id:{authority:"EPSG",code:8656}}:void 0),7===h.parameters.length){const c=h.parameters[6];"Scale difference"===c.name&&(c.value=Math.round(1e12*(c.value-1))/1e6)}h.id=this.getId(c);break;case"AXIS":h.coordinate_system||(h.coordinate_system={type:"unspecified",axis:[]}),h.coordinate_system.axis.push(this.convertAxis(c));break;case"LENGTHUNIT":const E=this.convertUnit(c,"LinearUnit");h.coordinate_system&&h.coordinate_system.axis&&h.coordinate_system.axis.forEach(c=>{c.unit||(c.unit=E)}),E.conversion_factor&&1!==E.conversion_factor&&h.semi_major_axis&&(h.semi_major_axis={value:h.semi_major_axis,unit:E});break;default:h.keyword=c[0]}return h}};const Do=class PROJJSONBuilder2015 extends jo{static convert(c,h={}){return super.convert(c,h),h.coordinate_system&&"Cartesian"===h.coordinate_system.subtype&&delete h.coordinate_system,h.usage&&delete h.usage,h}};const No=class PROJJSONBuilder2019 extends jo{static convert(c,h={}){super.convert(c,h);const g=c.find(c=>Array.isArray(c)&&"CS"===c[0]);g&&(h.coordinate_system={subtype:g[1],axis:this.extractAxes(c)});const m=c.find(c=>Array.isArray(c)&&"USAGE"===c[0]);if(m){const c=m.find(c=>Array.isArray(c)&&"SCOPE"===c[0]),g=m.find(c=>Array.isArray(c)&&"AREA"===c[0]),b=m.find(c=>Array.isArray(c)&&"BBOX"===c[0]);h.usage={},c&&(h.usage.scope=c[1]),g&&(h.usage.area=g[1]),b&&(h.usage.bbox=b.slice(1))}return h}};function buildPROJJSON(c){const h=function detectWKT2Version(c){return c.find(c=>Array.isArray(c)&&"USAGE"===c[0])?"2019":(c.find(c=>Array.isArray(c)&&"CS"===c[0])||"BOUNDCRS"===c[0]||"PROJCRS"===c[0]||c[0],"2015")}(c);return("2019"===h?No:Do).convert(c)}const Ro=function parseString(c){var h=new Parser(c);return h.output()};var Go=1,qo=/\s/,Wo=/[A-Za-z]/,Ho=/[A-Za-z84_]/,Uo=/[,\]]/,Yo=/[\d\.E\-\+]/;function Parser(c){if("string"!=typeof c)throw new Error("not a string");this.text=c.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Go}function mapit(c,h,g){Array.isArray(h)&&(g.unshift(h),h=null);var m=h?{}:c,b=g.reduce(function(c,h){return sExpr(h,c),c},m);h&&(c[h]=b)}function sExpr(c,h){if(Array.isArray(c)){var g=c.shift();if("PARAMETER"===g&&(g=c.shift()),1===c.length)return Array.isArray(c[0])?(h[g]={},void sExpr(c[0],h[g])):void(h[g]=c[0]);if(c.length)if("TOWGS84"!==g){if("AXIS"===g)return g in h||(h[g]=[]),void h[g].push(c);var m;switch(Array.isArray(g)||(h[g]={}),g){case"UNIT":case"PRIMEM":case"VERT_DATUM":return h[g]={name:c[0].toLowerCase(),convert:c[1]},void(3===c.length&&sExpr(c[2],h[g]));case"SPHEROID":case"ELLIPSOID":return h[g]={name:c[0],a:c[1],rf:c[2]},void(4===c.length&&sExpr(c[3],h[g]));case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":return c[0]=["name",c[0]],void mapit(h,g,c);case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":return c[0]=["name",c[0]],mapit(h,g,c),void(h[g].type=g);default:for(m=-1;++m<c.length;)if(!Array.isArray(c[m]))return sExpr(c,h[g]);return mapit(h,g,c)}}else h[g]=c;else h[g]=!0}else h[c]=!0}Parser.prototype.readCharicter=function(){var c=this.text[this.place++];if(4!==this.state)for(;qo.test(c);){if(this.place>=this.text.length)return;c=this.text[this.place++]}switch(this.state){case Go:return this.neutral(c);case 2:return this.keyword(c);case 4:return this.quoted(c);case 5:return this.afterquote(c);case 3:return this.number(c);case-1:return}},Parser.prototype.afterquote=function(c){if('"'===c)return this.word+='"',void(this.state=4);if(Uo.test(c))return this.word=this.word.trim(),void this.afterItem(c);throw new Error("havn't handled \""+c+'" in afterquote yet, index '+this.place)},Parser.prototype.afterItem=function(c){return","===c?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=Go)):"]"===c?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=Go,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},Parser.prototype.number=function(c){if(!Yo.test(c)){if(Uo.test(c))return this.word=parseFloat(this.word),void this.afterItem(c);throw new Error("havn't handled \""+c+'" in number yet, index '+this.place)}this.word+=c},Parser.prototype.quoted=function(c){'"'!==c?this.word+=c:this.state=5},Parser.prototype.keyword=function(c){if(Ho.test(c))this.word+=c;else{if("["===c){var h=[];return h.push(this.word),this.level++,null===this.root?this.root=h:this.currentObject.push(h),this.stack.push(this.currentObject),this.currentObject=h,void(this.state=Go)}if(!Uo.test(c))throw new Error("havn't handled \""+c+'" in keyword yet, index '+this.place);this.afterItem(c)}},Parser.prototype.neutral=function(c){if(Wo.test(c))return this.word=c,void(this.state=2);if('"'===c)return this.word="",void(this.state=4);if(Yo.test(c))return this.word=c,void(this.state=3);if(!Uo.test(c))throw new Error("havn't handled \""+c+'" in neutral yet, index '+this.place);this.afterItem(c)},Parser.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function d2r(c){return.017453292519943295*c}function applyProjectionDefaults(c){const h=(c.projName||"").toLowerCase().replace(/_/g," ");c.long0||!c.longc||"albers conic equal area"!==h&&"lambert azimuthal equal area"!==h||(c.long0=c.longc),c.lat_ts||!c.lat1||"stereographic south pole"!==h&&"polar stereographic (variant b)"!==h?c.lat_ts||!c.lat0||"polar stereographic"!==h&&"polar stereographic (variant a)"!==h||(c.lat_ts=c.lat0,c.lat0=d2r(c.lat0>0?90:-90),delete c.lat1):(c.lat0=d2r(c.lat1>0?90:-90),c.lat_ts=c.lat1,delete c.lat1)}function processUnit(c){let h={units:null,to_meter:void 0};return"string"==typeof c?(h.units=c.toLowerCase(),"metre"===h.units&&(h.units="meter"),"meter"===h.units&&(h.to_meter=1)):c&&c.name&&(h.units=c.name.toLowerCase(),"metre"===h.units&&(h.units="meter"),h.to_meter=c.conversion_factor),h}function toValue(c){return"object"==typeof c?c.value*c.unit.conversion_factor:c}function calculateEllipsoid(c,h){c.ellipsoid.radius?(h.a=c.ellipsoid.radius,h.rf=0):(h.a=toValue(c.ellipsoid.semi_major_axis),void 0!==c.ellipsoid.inverse_flattening?h.rf=c.ellipsoid.inverse_flattening:void 0!==c.ellipsoid.semi_major_axis&&void 0!==c.ellipsoid.semi_minor_axis&&(h.rf=h.a/(h.a-toValue(c.ellipsoid.semi_minor_axis))))}function transformPROJJSON(c,h={}){return c&&"object"==typeof c?"BoundCRS"===c.type?(transformPROJJSON(c.source_crs,h),c.transformation&&(c.transformation.method&&"NTv2"===c.transformation.method.name?h.nadgrids=c.transformation.parameters[0].value:h.datum_params=c.transformation.parameters.map(c=>c.value)),h):(Object.keys(c).forEach(g=>{const m=c[g];if(null!==m)switch(g){case"name":if(h.srsCode)break;h.name=m,h.srsCode=m;break;case"type":"GeographicCRS"===m?h.projName="longlat":"ProjectedCRS"===m&&c.conversion&&c.conversion.method&&(h.projName=c.conversion.method.name);break;case"datum":case"datum_ensemble":m.ellipsoid&&(h.ellps=m.ellipsoid.name,calculateEllipsoid(m,h)),m.prime_meridian&&(h.from_greenwich=m.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":h.ellps=m.name,calculateEllipsoid(m,h);break;case"prime_meridian":h.long0=(m.longitude||0)*Math.PI/180;break;case"coordinate_system":if(m.axis)if(h.axis=m.axis.map(c=>{const h=c.direction;if("east"===h)return"e";if("north"===h)return"n";if("west"===h)return"w";if("south"===h)return"s";throw new Error(`Unknown axis direction: ${h}`)}).join("")+"u",m.unit){const{units:c,to_meter:g}=processUnit(m.unit);h.units=c,h.to_meter=g}else if(m.axis[0]&&m.axis[0].unit){const{units:c,to_meter:g}=processUnit(m.axis[0].unit);h.units=c,h.to_meter=g}break;case"id":m.authority&&m.code&&(h.title=m.authority+":"+m.code);break;case"conversion":m.method&&m.method.name&&(h.projName=m.method.name),m.parameters&&m.parameters.forEach(c=>{const g=c.name.toLowerCase().replace(/\s+/g,"_"),m=c.value;c.unit&&c.unit.conversion_factor?h[g]=m*c.unit.conversion_factor:"degree"===c.unit?h[g]=m*Math.PI/180:h[g]=m});break;case"unit":m.name&&(h.units=m.name.toLowerCase(),"metre"===h.units&&(h.units="meter")),m.conversion_factor&&(h.to_meter=m.conversion_factor);break;case"base_crs":transformPROJJSON(m,h),h.datumCode=m.id?m.id.authority+"_"+m.id.code:m.name}}),void 0!==h.latitude_of_false_origin&&(h.lat0=h.latitude_of_false_origin),void 0!==h.longitude_of_false_origin&&(h.long0=h.longitude_of_false_origin),void 0!==h.latitude_of_standard_parallel&&(h.lat0=h.latitude_of_standard_parallel,h.lat1=h.latitude_of_standard_parallel),void 0!==h.latitude_of_1st_standard_parallel&&(h.lat1=h.latitude_of_1st_standard_parallel),void 0!==h.latitude_of_2nd_standard_parallel&&(h.lat2=h.latitude_of_2nd_standard_parallel),void 0!==h.latitude_of_projection_centre&&(h.lat0=h.latitude_of_projection_centre),void 0!==h.longitude_of_projection_centre&&(h.longc=h.longitude_of_projection_centre),void 0!==h.easting_at_false_origin&&(h.x0=h.easting_at_false_origin),void 0!==h.northing_at_false_origin&&(h.y0=h.northing_at_false_origin),void 0!==h.latitude_of_natural_origin&&(h.lat0=h.latitude_of_natural_origin),void 0!==h.longitude_of_natural_origin&&(h.long0=h.longitude_of_natural_origin),void 0!==h.longitude_of_origin&&(h.long0=h.longitude_of_origin),void 0!==h.false_easting&&(h.x0=h.false_easting),h.easting_at_projection_centre&&(h.x0=h.easting_at_projection_centre),void 0!==h.false_northing&&(h.y0=h.false_northing),h.northing_at_projection_centre&&(h.y0=h.northing_at_projection_centre),void 0!==h.standard_parallel_1&&(h.lat1=h.standard_parallel_1),void 0!==h.standard_parallel_2&&(h.lat2=h.standard_parallel_2),void 0!==h.scale_factor_at_natural_origin&&(h.k0=h.scale_factor_at_natural_origin),void 0!==h.scale_factor_at_projection_centre&&(h.k0=h.scale_factor_at_projection_centre),void 0!==h.scale_factor_on_pseudo_standard_parallel&&(h.k0=h.scale_factor_on_pseudo_standard_parallel),void 0!==h.azimuth&&(h.alpha=h.azimuth),void 0!==h.azimuth_at_projection_centre&&(h.alpha=h.azimuth_at_projection_centre),h.angle_from_rectified_to_skew_grid&&(h.rectified_grid_angle=h.angle_from_rectified_to_skew_grid),applyProjectionDefaults(h),h):c}var Vo=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function cleanWKT(c){for(var h=Object.keys(c),g=0,m=h.length;g<m;++g){var b=h[g];-1!==Vo.indexOf(b)&&setPropertiesFromWkt(c[b]),"object"==typeof c[b]&&cleanWKT(c[b])}}function setPropertiesFromWkt(c){if(c.AUTHORITY){var h=Object.keys(c.AUTHORITY)[0];h&&h in c.AUTHORITY&&(c.title=h+":"+c.AUTHORITY[h])}if("GEOGCS"===c.type?c.projName="longlat":"LOCAL_CS"===c.type?(c.projName="identity",c.local=!0):"object"==typeof c.PROJECTION?c.projName=Object.keys(c.PROJECTION)[0]:c.projName=c.PROJECTION,c.AXIS){for(var g="",m=0,b=c.AXIS.length;m<b;++m){var w=[c.AXIS[m][0].toLowerCase(),c.AXIS[m][1].toLowerCase()];-1!==w[0].indexOf("north")||("y"===w[0]||"lat"===w[0])&&"north"===w[1]?g+="n":-1!==w[0].indexOf("south")||("y"===w[0]||"lat"===w[0])&&"south"===w[1]?g+="s":-1!==w[0].indexOf("east")||("x"===w[0]||"lon"===w[0])&&"east"===w[1]?g+="e":-1===w[0].indexOf("west")&&("x"!==w[0]&&"lon"!==w[0]||"west"!==w[1])||(g+="w")}2===g.length&&(g+="u"),3===g.length&&(c.axis=g)}c.UNIT&&(c.units=c.UNIT.name.toLowerCase(),"metre"===c.units&&(c.units="meter"),c.UNIT.convert&&("GEOGCS"===c.type?c.DATUM&&c.DATUM.SPHEROID&&(c.to_meter=c.UNIT.convert*c.DATUM.SPHEROID.a):c.to_meter=c.UNIT.convert));var S=c.GEOGCS;function toMeter(h){return h*(c.to_meter||1)}"GEOGCS"===c.type&&(S=c),S&&(S.DATUM?c.datumCode=S.DATUM.name.toLowerCase():c.datumCode=S.name.toLowerCase(),"d_"===c.datumCode.slice(0,2)&&(c.datumCode=c.datumCode.slice(2)),"new_zealand_1949"===c.datumCode&&(c.datumCode="nzgd49"),"wgs_1984"!==c.datumCode&&"world_geodetic_system_1984"!==c.datumCode||("Mercator_Auxiliary_Sphere"===c.PROJECTION&&(c.sphere=!0),c.datumCode="wgs84"),"belge_1972"===c.datumCode&&(c.datumCode="rnb72"),S.DATUM&&S.DATUM.SPHEROID&&(c.ellps=S.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===c.ellps.toLowerCase().slice(0,13)&&(c.ellps="intl"),c.a=S.DATUM.SPHEROID.a,c.rf=parseFloat(S.DATUM.SPHEROID.rf,10)),S.DATUM&&S.DATUM.TOWGS84&&(c.datum_params=S.DATUM.TOWGS84),~c.datumCode.indexOf("osgb_1936")&&(c.datumCode="osgb36"),~c.datumCode.indexOf("osni_1952")&&(c.datumCode="osni52"),(~c.datumCode.indexOf("tm65")||~c.datumCode.indexOf("geodetic_datum_of_1965"))&&(c.datumCode="ire65"),"ch1903+"===c.datumCode&&(c.datumCode="ch1903"),~c.datumCode.indexOf("israel")&&(c.datumCode="isr93")),c.b&&!isFinite(c.b)&&(c.b=c.a),c.rectified_grid_angle&&(c.rectified_grid_angle=d2r(c.rectified_grid_angle));[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",d2r],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",d2r],["x0","false_easting",toMeter],["y0","false_northing",toMeter],["long0","central_meridian",d2r],["lat0","latitude_of_origin",d2r],["lat0","standard_parallel_1",d2r],["lat1","standard_parallel_1",d2r],["lat2","standard_parallel_2",d2r],["azimuth","Azimuth"],["alpha","azimuth",d2r],["srsCode","name"]].forEach(function(h){return function rename(c,h){var g=h[0],m=h[1];!(g in c)&&m in c&&(c[g]=c[m],3===h.length&&(c[g]=h[2](c[g])))}(c,h)}),applyProjectionDefaults(c)}function wkt_parser(c){if("object"==typeof c)return transformPROJJSON(c);const h=function detectWKTVersion(c){const h=c.toUpperCase();return h.includes("PROJCRS")||h.includes("GEOGCRS")||h.includes("BOUNDCRS")||h.includes("VERTCRS")||h.includes("LENGTHUNIT")||h.includes("ANGLEUNIT")||h.includes("SCALEUNIT")?"WKT2":(h.includes("PROJCS")||h.includes("GEOGCS")||h.includes("LOCAL_CS")||h.includes("VERT_CS")||h.includes("UNIT"),"WKT1")}(c);var g=Ro(c);if("WKT2"===h){return transformPROJJSON(buildPROJJSON(g))}var m=g[0],b={};return sExpr(g,b),cleanWKT(b),b[m]}function defs(c){var h=this;if(2===arguments.length){var g=arguments[1];"string"==typeof g?"+"===g.charAt(0)?defs[c]=projString(arguments[1]):defs[c]=wkt_parser(arguments[1]):g&&"object"==typeof g&&!("projName"in g)?defs[c]=wkt_parser(arguments[1]):(defs[c]=g,g||delete defs[c])}else if(1===arguments.length){if(Array.isArray(c))return c.map(function(c){return Array.isArray(c)?defs.apply(h,c):defs(c)});if("string"==typeof c){if(c in defs)return defs[c]}else"EPSG"in c?defs["EPSG:"+c.EPSG]=c:"ESRI"in c?defs["ESRI:"+c.ESRI]=c:"IAU2000"in c?defs["IAU2000:"+c.IAU2000]=c:console.log(c);return}}!function global(c){c("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),c("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),c("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var h=1;h<=60;++h)c("EPSG:"+(32600+h),"+proj=utm +zone="+h+" +datum=WGS84 +units=m"),c("EPSG:"+(32700+h),"+proj=utm +zone="+h+" +south +datum=WGS84 +units=m");c("EPSG:5041","+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),c("EPSG:5042","+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),c.WGS84=c["EPSG:4326"],c["EPSG:3785"]=c["EPSG:3857"],c.GOOGLE=c["EPSG:3857"],c["EPSG:900913"]=c["EPSG:3857"],c["EPSG:102113"]=c["EPSG:3857"]}(defs);const $o=defs;var Xo=["3857","900913","3785","102113"];const Ko=function parse(c){if(!function testObj(c){return"string"==typeof c}(c))return"projName"in c?c:wkt_parser(c);if(function testDef(c){return c in $o}(c))return $o[c];if(function testWKT(c){return 0!==c.indexOf("+")&&-1!==c.indexOf("[")||"object"==typeof c&&!("srsCode"in c)}(c)){var h=wkt_parser(c);if(function checkMercator(c){var h=match(c,"authority");if(h){var g=match(h,"epsg");return g&&Xo.indexOf(g)>-1}}(h))return $o["EPSG:3857"];var g=function checkProjStr(c){var h=match(c,"extension");if(h)return match(h,"proj4")}(h);return g?projString(g):h}return function testProj(c){return"+"===c[0]}(c)?projString(c):void 0};function lib_extend(c,h){var g,m;if(c=c||{},!h)return c;for(m in h)void 0!==(g=h[m])&&(c[m]=g);return c}function msfnz(c,h,g){var m=c*h;return g/Math.sqrt(1-m*m)}function common_sign(c){return c<0?-1:1}function adjust_lon(c,h){return h||Math.abs(c)<=Lo?c:c-common_sign(c)*Po}function tsfnz(c,h,g){var m=c*g,b=.5*c;return m=Math.pow((1-m)/(1+m),b),Math.tan(.5*(Mo-h))/m}function phi2z(c,h){for(var g,m,b=.5*c,w=Mo-2*Math.atan(h),S=0;S<=15;S++)if(g=c*Math.sin(w),w+=m=Mo-2*Math.atan(h*Math.pow((1-g)/(1+g),b))-w,Math.abs(m)<=1e-10)return w;return-9999}const Zo={init:function init(){var c=this.b/this.a;this.es=1-c*c,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=msfnz(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function forward(c){var h,g,m=c.x,b=c.y;if(b*Eo>90&&b*Eo<-90&&m*Eo>180&&m*Eo<-180)return null;if(Math.abs(Math.abs(b)-Mo)<=ko)return null;if(this.sphere)h=this.x0+this.a*this.k0*adjust_lon(m-this.long0,this.over),g=this.y0+this.a*this.k0*Math.log(Math.tan(Io+.5*b));else{var w=Math.sin(b),S=tsfnz(this.e,b,w);h=this.x0+this.a*this.k0*adjust_lon(m-this.long0,this.over),g=this.y0-this.a*this.k0*Math.log(S)}return c.x=h,c.y=g,c},inverse:function inverse(c){var h,g,m=c.x-this.x0,b=c.y-this.y0;if(this.sphere)g=Mo-2*Math.atan(Math.exp(-b/(this.a*this.k0)));else{var w=Math.exp(-b/(this.a*this.k0));if(-9999===(g=phi2z(this.e,w)))return null}return h=adjust_lon(this.long0+m/(this.a*this.k0),this.over),c.x=h,c.y=g,c},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"]};function longlat_identity(c){return c}var Jo=["longlat","identity"];var Qo=[Zo,{init:function longlat_init(){},forward:longlat_identity,inverse:longlat_identity,names:Jo}],ta={},ea=[];function add(c,h){var g=ea.length;return c.names?(ea[g]=c,c.names.forEach(function(c){ta[c.toLowerCase()]=g}),this):(console.log(h),!0)}function getNormalizedProjName(c){return c.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}const na={start:function start(){Qo.forEach(add)},add,get:function projections_get(c){if(!c)return!1;var h=c.toLowerCase();return void 0!==ta[h]&&ea[ta[h]]||(h=getNormalizedProjName(h))in ta&&ea[ta[h]]?ea[ta[h]]:void 0}};const ra={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},oa=ra.WGS84;var aa={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-8.393,0.749,-10.276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"374,150,588"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"}};for(var ia in aa){var sa=aa[ia];sa.datumName&&(aa[sa.datumName]=sa)}const la=aa;const ca=function datum_datum(c,h,g,m,b,w,S){var M={};return M.datum_type=void 0===c||"none"===c?5:4,h&&(M.datum_params=h.map(parseFloat),0===M.datum_params[0]&&0===M.datum_params[1]&&0===M.datum_params[2]||(M.datum_type=1),M.datum_params.length>3&&(0===M.datum_params[3]&&0===M.datum_params[4]&&0===M.datum_params[5]&&0===M.datum_params[6]||(M.datum_type=2,M.datum_params[3]*=So,M.datum_params[4]*=So,M.datum_params[5]*=So,M.datum_params[6]=M.datum_params[6]/1e6+1))),S&&(M.datum_type=3,M.grids=S),M.a=g,M.b=m,M.es=b,M.ep2=w,M};var ua={};async function readGeotiffGrid(c,h){for(var g=[],m=await h.getImageCount(),b=m-1;b>=0;b--){var w=await h.getImage(b),S=await w.readRasters(),M=[w.getWidth(),w.getHeight()],k=w.getBoundingBox().map(degreesToRadians),T=[w.fileDirectory.ModelPixelScale[0],w.fileDirectory.ModelPixelScale[1]].map(degreesToRadians),E=k[0]+(M[0]-1)*T[0],I=k[3]-(M[1]-1)*T[1],P=S[0],L=S[1],B=[];for(let c=M[1]-1;c>=0;c--)for(let h=M[0]-1;h>=0;h--){var z=c*M[0]+h;B.push([-secondsToRadians(L[z]),secondsToRadians(P[z])])}g.push({del:T,lim:M,ll:[-E,I],cvs:B})}var j={header:{nSubgrids:m},subgrids:g};return ua[c]=j,j}function parseNadgridString(c){if(0===c.length)return null;var h="@"===c[0];return h&&(c=c.slice(1)),"null"===c?{name:"null",mandatory:!h,grid:null,isNull:!0}:{name:c,mandatory:!h,grid:ua[c]||null,isNull:!1}}function degreesToRadians(c){return c*Math.PI/180}function secondsToRadians(c){return c/3600*Math.PI/180}function decodeString(c,h,g){return String.fromCharCode.apply(null,new Uint8Array(c.buffer.slice(h,g)))}function mapNodes(c){return c.map(function(c){return[secondsToRadians(c.longitudeShift),secondsToRadians(c.latitudeShift)]})}function readGridHeader(c,h,g){return{name:decodeString(c,h+8,h+16).trim(),parent:decodeString(c,h+24,h+24+8).trim(),lowerLatitude:c.getFloat64(h+72,g),upperLatitude:c.getFloat64(h+88,g),lowerLongitude:c.getFloat64(h+104,g),upperLongitude:c.getFloat64(h+120,g),latitudeInterval:c.getFloat64(h+136,g),longitudeInterval:c.getFloat64(h+152,g),gridNodeCount:c.getInt32(h+168,g)}}function readGridNodes(c,h,g,m,b){var w=h+176,S=16;!1===b&&(S=8);for(var M=[],k=0;k<g.gridNodeCount;k++){var T={latitudeShift:c.getFloat32(w+k*S,m),longitudeShift:c.getFloat32(w+k*S+4,m)};!1!==b&&(T.latitudeAccuracy=c.getFloat32(w+k*S+8,m),T.longitudeAccuracy=c.getFloat32(w+k*S+12,m)),M.push(T)}return M}function Projection(c,h){if(!(this instanceof Projection))return new Projection(c);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,h=h||function(c){if(c)throw c};var g=Ko(c);if("object"==typeof g){var m=Projection.projections.get(g.projName);if(m){if(g.datumCode&&"none"!==g.datumCode){var b=match(la,g.datumCode);b&&(g.datum_params=g.datum_params||(b.towgs84?b.towgs84.split(","):null),g.ellps=b.ellipse,g.datumName=b.datumName?b.datumName:g.datumCode)}g.k0=g.k0||1,g.axis=g.axis||"enu",g.ellps=g.ellps||"wgs84",g.lat1=g.lat1||g.lat0;var w=function sphere(c,h,g,m,b){if(!c){var w=match(ra,m);w||(w=oa),c=w.a,h=w.b,g=w.rf}return g&&!h&&(h=(1-1/g)*c),(0===g||Math.abs(c-h)<ko)&&(b=!0,h=c),{a:c,b:h,rf:g,sphere:b}}(g.a,g.b,g.rf,g.ellps,g.sphere),S=function eccentricity(c,h,g,m){var b=c*c,w=h*h,S=(b-w)/b,M=0;return m?(b=(c*=1-S*(.16666666666666666+S*(.04722222222222222+.022156084656084655*S)))*c,S=0):M=Math.sqrt(S),{es:S,e:M,ep2:(b-w)/w}}(w.a,w.b,w.rf,g.R_A),M=function getNadgrids(c){return void 0===c?null:c.split(",").map(parseNadgridString)}(g.nadgrids),k=g.datum||ca(g.datumCode,g.datum_params,w.a,w.b,S.es,S.ep2,M);lib_extend(this,g),lib_extend(this,m),this.a=w.a,this.b=w.b,this.rf=w.rf,this.sphere=w.sphere,this.es=S.es,this.e=S.e,this.ep2=S.ep2,this.datum=k,"init"in this&&"function"==typeof this.init&&this.init(),h(null,this)}else h("Could not get projection name from: "+c)}else h("Could not parse to valid json: "+c)}Projection.projections=na,Projection.projections.start();const ha=Projection;function geodeticToGeocentric(c,h,g){var m,b,w,S,M=c.x,k=c.y,T=c.z?c.z:0;if(k<-Mo&&k>-1.001*Mo)k=-Mo;else if(k>Mo&&k<1.001*Mo)k=Mo;else{if(k<-Mo)return{x:-1/0,y:-1/0,z:c.z};if(k>Mo)return{x:1/0,y:1/0,z:c.z}}return M>Math.PI&&(M-=2*Math.PI),b=Math.sin(k),S=Math.cos(k),w=b*b,{x:((m=g/Math.sqrt(1-h*w))+T)*S*Math.cos(M),y:(m+T)*S*Math.sin(M),z:(m*(1-h)+T)*b}}function geocentricToGeodetic(c,h,g,m){var b,w,S,M,k,T,E,I,P,L,B,z,j,D,N,R=1e-12,G=c.x,q=c.y,W=c.z?c.z:0;if(b=Math.sqrt(G*G+q*q),w=Math.sqrt(G*G+q*q+W*W),b/g<R){if(D=0,w/g<R)return N=-m,{x:c.x,y:c.y,z:c.z}}else D=Math.atan2(q,G);S=W/w,I=(M=b/w)*(1-h)*(k=1/Math.sqrt(1-h*(2-h)*M*M)),P=S*k,j=0;do{j++,T=h*(E=g/Math.sqrt(1-h*P*P))/(E+(N=b*I+W*P-E*(1-h*P*P))),z=(B=S*(k=1/Math.sqrt(1-T*(2-T)*M*M)))*I-(L=M*(1-T)*k)*P,I=L,P=B}while(z*z>1e-24&&j<30);return{x:D,y:Math.atan(B/Math.abs(L)),z:N}}function checkParams(c){return 1===c||2===c}function datum_transform(c,h,g){if(function compareDatums(c,h){return c.datum_type===h.datum_type&&!(c.a!==h.a||Math.abs(c.es-h.es)>5e-11)&&(1===c.datum_type?c.datum_params[0]===h.datum_params[0]&&c.datum_params[1]===h.datum_params[1]&&c.datum_params[2]===h.datum_params[2]:2!==c.datum_type||c.datum_params[0]===h.datum_params[0]&&c.datum_params[1]===h.datum_params[1]&&c.datum_params[2]===h.datum_params[2]&&c.datum_params[3]===h.datum_params[3]&&c.datum_params[4]===h.datum_params[4]&&c.datum_params[5]===h.datum_params[5]&&c.datum_params[6]===h.datum_params[6])}(c,h))return g;if(5===c.datum_type||5===h.datum_type)return g;var m=c.a,b=c.es;if(3===c.datum_type){if(0!==applyGridShift(c,!1,g))return;m=wo,b=Co}var w=h.a,S=h.b,M=h.es;if(3===h.datum_type&&(w=wo,S=6356752.314,M=Co),b===M&&m===w&&!checkParams(c.datum_type)&&!checkParams(h.datum_type))return g;if((g=geodeticToGeocentric(g,b,m),checkParams(c.datum_type)&&(g=function geocentricToWgs84(c,h,g){if(1===h)return{x:c.x+g[0],y:c.y+g[1],z:c.z+g[2]};if(2===h){var m=g[0],b=g[1],w=g[2],S=g[3],M=g[4],k=g[5],T=g[6];return{x:T*(c.x-k*c.y+M*c.z)+m,y:T*(k*c.x+c.y-S*c.z)+b,z:T*(-M*c.x+S*c.y+c.z)+w}}}(g,c.datum_type,c.datum_params)),checkParams(h.datum_type)&&(g=function geocentricFromWgs84(c,h,g){if(1===h)return{x:c.x-g[0],y:c.y-g[1],z:c.z-g[2]};if(2===h){var m=g[0],b=g[1],w=g[2],S=g[3],M=g[4],k=g[5],T=g[6],E=(c.x-m)/T,I=(c.y-b)/T,P=(c.z-w)/T;return{x:E+k*I-M*P,y:-k*E+I+S*P,z:M*E-S*I+P}}}(g,h.datum_type,h.datum_params)),g=geocentricToGeodetic(g,M,w,S),3===h.datum_type)&&0!==applyGridShift(h,!0,g))return;return g}function applyGridShift(c,h,g){if(null===c.grids||0===c.grids.length)return console.log("Grid shift grids not found"),-1;var m={x:-g.x,y:g.y},b={x:Number.NaN,y:Number.NaN},w=[];t:for(var S=0;S<c.grids.length;S++){var M=c.grids[S];if(w.push(M.name),M.isNull){b=m;break}if(null!==M.grid)for(var k=M.grid.subgrids,T=0,E=k.length;T<E;T++){var I=k[T],P=(Math.abs(I.del[1])+Math.abs(I.del[0]))/1e4,L=I.ll[0]-P,B=I.ll[1]-P,z=I.ll[0]+(I.lim[0]-1)*I.del[0]+P,j=I.ll[1]+(I.lim[1]-1)*I.del[1]+P;if(!(B>m.y||L>m.x||j<m.y||z<m.x)&&(b=applySubgridShift(m,h,I),!isNaN(b.x)))break t}else if(M.mandatory)return console.log("Unable to find mandatory grid '"+M.name+"'"),-1}return isNaN(b.x)?(console.log("Failed to find a grid shift table for location '"+-m.x*Eo+" "+m.y*Eo+" tried: '"+w+"'"),-1):(g.x=-b.x,g.y=b.y,0)}function applySubgridShift(c,h,g){var m={x:Number.NaN,y:Number.NaN};if(isNaN(c.x))return m;var b={x:c.x,y:c.y};b.x-=g.ll[0],b.y-=g.ll[1],b.x=adjust_lon(b.x-Math.PI)+Math.PI;var w=nadInterpolate(b,g);if(h){if(isNaN(w.x))return m;w.x=b.x-w.x,w.y=b.y-w.y;var S,M,k=9;do{if(M=nadInterpolate(w,g),isNaN(M.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}S={x:b.x-(M.x+w.x),y:b.y-(M.y+w.y)},w.x+=S.x,w.y+=S.y}while(k--&&Math.abs(S.x)>1e-12&&Math.abs(S.y)>1e-12);if(k<0)return console.log("Inverse grid shift iterator failed to converge."),m;m.x=adjust_lon(w.x+g.ll[0]),m.y=w.y+g.ll[1]}else isNaN(w.x)||(m.x=c.x+w.x,m.y=c.y+w.y);return m}function nadInterpolate(c,h){var g,m={x:c.x/h.del[0],y:c.y/h.del[1]},b=Math.floor(m.x),w=Math.floor(m.y),S=m.x-1*b,M=m.y-1*w,k={x:Number.NaN,y:Number.NaN};if(b<0||b>=h.lim[0])return k;if(w<0||w>=h.lim[1])return k;g=w*h.lim[0]+b;var T=h.cvs[g][0],E=h.cvs[g][1];g++;var I=h.cvs[g][0],P=h.cvs[g][1];g+=h.lim[0];var L=h.cvs[g][0],B=h.cvs[g][1];g--;var z=h.cvs[g][0],j=h.cvs[g][1],D=S*M,N=S*(1-M),R=(1-S)*(1-M),G=(1-S)*M;return k.x=R*T+N*I+G*z+D*L,k.y=R*E+N*P+G*j+D*B,k}function adjust_axis(c,h,g){var m,b,w,S=g.x,M=g.y,k=g.z||0,T={};for(w=0;w<3;w++)if(!h||2!==w||void 0!==g.z)switch(0===w?(m=S,b=-1!=="ew".indexOf(c.axis[w])?"x":"y"):1===w?(m=M,b=-1!=="ns".indexOf(c.axis[w])?"y":"x"):(m=k,b="z"),c.axis[w]){case"e":case"n":T[b]=m;break;case"w":case"s":T[b]=-m;break;case"u":void 0!==g[b]&&(T.z=m);break;case"d":void 0!==g[b]&&(T.z=-m);break;default:return null}return T}function toPoint(c){var h={x:c[0],y:c[1]};return c.length>2&&(h.z=c[2]),c.length>3&&(h.m=c[3]),h}function checkCoord(c){if("function"==typeof Number.isFinite){if(Number.isFinite(c))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof c||c!=c||!isFinite(c))throw new TypeError("coordinates must be finite numbers")}function transform_transform(c,h,g,m){var b,w=void 0!==(g=Array.isArray(g)?toPoint(g):{x:g.x,y:g.y,z:g.z,m:g.m}).z;if(function checkSanity(c){checkCoord(c.x),checkCoord(c.y)}(g),c.datum&&h.datum&&function checkNotWGS(c,h){return(1===c.datum.datum_type||2===c.datum.datum_type||3===c.datum.datum_type)&&"WGS84"!==h.datumCode||(1===h.datum.datum_type||2===h.datum.datum_type||3===h.datum.datum_type)&&"WGS84"!==c.datumCode}(c,h)&&(g=transform_transform(c,b=new ha("WGS84"),g,m),c=b),m&&"enu"!==c.axis&&(g=adjust_axis(c,!1,g)),"longlat"===c.projName)g={x:g.x*To,y:g.y*To,z:g.z||0};else if(c.to_meter&&(g={x:g.x*c.to_meter,y:g.y*c.to_meter,z:g.z||0}),!(g=c.inverse(g)))return;if(c.from_greenwich&&(g.x+=c.from_greenwich),g=datum_transform(c.datum,h.datum,g))return h.from_greenwich&&(g={x:g.x-h.from_greenwich,y:g.y,z:g.z||0}),"longlat"===h.projName?g={x:g.x*Eo,y:g.y*Eo,z:g.z||0}:(g=h.forward(g),h.to_meter&&(g={x:g.x/h.to_meter,y:g.y/h.to_meter,z:g.z||0})),m&&"enu"!==h.axis?adjust_axis(h,!0,g):(g&&!w&&delete g.z,g)}var da=ha("WGS84");function core_transformer(c,h,g,m){var b,w,S;return Array.isArray(g)?(b=transform_transform(c,h,g,m)||{x:NaN,y:NaN},g.length>2?void 0!==c.name&&"geocent"===c.name||void 0!==h.name&&"geocent"===h.name?"number"==typeof b.z?[b.x,b.y,b.z].concat(g.slice(3)):[b.x,b.y,g[2]].concat(g.slice(3)):[b.x,b.y].concat(g.slice(2)):[b.x,b.y]):(w=transform_transform(c,h,g,m),2===(S=Object.keys(g)).length||S.forEach(function(m){if(void 0!==c.name&&"geocent"===c.name||void 0!==h.name&&"geocent"===h.name){if("x"===m||"y"===m||"z"===m)return}else if("x"===m||"y"===m)return;w[m]=g[m]}),w)}function checkProj(c){return c instanceof ha?c:"object"==typeof c&&"oProj"in c?c.oProj:ha(c)}const pa=function core_proj4(c,h,g){var m,b,w,S=!1;return void 0===h?(b=checkProj(c),m=da,S=!0):(void 0!==h.x||Array.isArray(h))&&(g=h,b=checkProj(c),m=da,S=!0),m||(m=checkProj(c)),b||(b=checkProj(h)),g?core_transformer(m,b,g):(w={forward:function(c,h){return core_transformer(m,b,c,h)},inverse:function(c,h){return core_transformer(b,m,c,h)}},S&&(w.oProj=b),w)};var fa="AJSAJS",ga="AFAFAF",_a=65,ma=73,va=79,ya=86,Aa=90;const ba={forward:mgrs_forward,inverse:function mgrs_inverse(c){var h=UTMtoLL(decode(c.toUpperCase()));if(h.lat&&h.lon)return[h.lon,h.lat,h.lon,h.lat];return[h.left,h.bottom,h.right,h.top]},toPoint:mgrs_toPoint};function mgrs_forward(c,h){return h=h||5,function encode(c,h){var g="00000"+c.easting,m="00000"+c.northing;return c.zoneNumber+c.zoneLetter+function get100kID(c,h,g){var m=get100kSetForZone(g),b=Math.floor(c/1e5),w=Math.floor(h/1e5)%20;return function getLetter100kID(c,h,g){var m=g-1,b=fa.charCodeAt(m),w=ga.charCodeAt(m),S=b+c-1,M=w+h,k=!1;S>Aa&&(S=S-Aa+_a-1,k=!0);(S===ma||b<ma&&S>ma||(S>ma||b<ma)&&k)&&S++;(S===va||b<va&&S>va||(S>va||b<va)&&k)&&++S===ma&&S++;S>Aa&&(S=S-Aa+_a-1);M>ya?(M=M-ya+_a-1,k=!0):k=!1;(M===ma||w<ma&&M>ma||(M>ma||w<ma)&&k)&&M++;(M===va||w<va&&M>va||(M>va||w<va)&&k)&&++M===ma&&M++;M>ya&&(M=M-ya+_a-1);return String.fromCharCode(S)+String.fromCharCode(M)}(b,w,m)}(c.easting,c.northing,c.zoneNumber)+g.substr(g.length-5,h)+m.substr(m.length-5,h)}(function LLtoUTM(c){var h,g,m,b,w,S,M,k,T=c.lat,E=c.lon,I=6378137,P=.00669438,L=.9996,B=degToRad(T),z=degToRad(E);k=Math.floor((E+180)/6)+1,180===E&&(k=60);T>=56&&T<64&&E>=3&&E<12&&(k=32);T>=72&&T<84&&(E>=0&&E<9?k=31:E>=9&&E<21?k=33:E>=21&&E<33?k=35:E>=33&&E<42&&(k=37));M=degToRad(6*(k-1)-180+3),h=P/(1-P),g=I/Math.sqrt(1-P*Math.sin(B)*Math.sin(B)),m=Math.tan(B)*Math.tan(B),b=h*Math.cos(B)*Math.cos(B),w=Math.cos(B)*(z-M),S=I*((1-P/4-3*P*P/64-5*P*P*P/256)*B-(3*P/8+3*P*P/32+45*P*P*P/1024)*Math.sin(2*B)+(15*P*P/256+45*P*P*P/1024)*Math.sin(4*B)-35*P*P*P/3072*Math.sin(6*B));var j=L*g*(w+(1-m+b)*w*w*w/6+(5-18*m+m*m+72*b-58*h)*w*w*w*w*w/120)+5e5,D=L*(S+g*Math.tan(B)*(w*w/2+(5-m+9*b+4*b*b)*w*w*w*w/24+(61-58*m+m*m+600*b-330*h)*w*w*w*w*w*w/720));T<0&&(D+=1e7);return{northing:Math.round(D),easting:Math.round(j),zoneNumber:k,zoneLetter:getLetterDesignator(T)}}({lat:c[1],lon:c[0]}),h)}function mgrs_toPoint(c){var h=UTMtoLL(decode(c.toUpperCase()));return h.lat&&h.lon?[h.lon,h.lat]:[(h.left+h.right)/2,(h.top+h.bottom)/2]}function degToRad(c){return c*(Math.PI/180)}function radToDeg(c){return c/Math.PI*180}function UTMtoLL(c){var h=c.northing,g=c.easting,m=c.zoneLetter,b=c.zoneNumber;if(b<0||b>60)return null;var w,S,M,k,T,E,I,P,L,B=.9996,z=6378137,j=.00669438,D=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),N=g-5e5,R=h;m<"N"&&(R-=1e7),I=6*(b-1)-180+3,w=.006739496752268451,L=(P=R/B/6367449.145945056)+(3*D/2-27*D*D*D/32)*Math.sin(2*P)+(21*D*D/16-55*D*D*D*D/32)*Math.sin(4*P)+151*D*D*D/96*Math.sin(6*P),S=z/Math.sqrt(1-j*Math.sin(L)*Math.sin(L)),M=Math.tan(L)*Math.tan(L),k=w*Math.cos(L)*Math.cos(L),T=.99330562*z/Math.pow(1-j*Math.sin(L)*Math.sin(L),1.5),E=N/(S*B);var G=L-S*Math.tan(L)/T*(E*E/2-(5+3*M+10*k-4*k*k-9*w)*E*E*E*E/24+(61+90*M+298*k+45*M*M-1.6983531815716497-3*k*k)*E*E*E*E*E*E/720);G=radToDeg(G);var q,W=(E-(1+2*M+k)*E*E*E/6+(5-2*k+28*M-3*k*k+8*w+24*M*M)*E*E*E*E*E/120)/Math.cos(L);if(W=I+radToDeg(W),c.accuracy){var H=UTMtoLL({northing:c.northing+c.accuracy,easting:c.easting+c.accuracy,zoneLetter:c.zoneLetter,zoneNumber:c.zoneNumber});q={top:H.lat,right:H.lon,bottom:G,left:W}}else q={lat:G,lon:W};return q}function getLetterDesignator(c){var h="Z";return 84>=c&&c>=72?h="X":72>c&&c>=64?h="W":64>c&&c>=56?h="V":56>c&&c>=48?h="U":48>c&&c>=40?h="T":40>c&&c>=32?h="S":32>c&&c>=24?h="R":24>c&&c>=16?h="Q":16>c&&c>=8?h="P":8>c&&c>=0?h="N":0>c&&c>=-8?h="M":-8>c&&c>=-16?h="L":-16>c&&c>=-24?h="K":-24>c&&c>=-32?h="J":-32>c&&c>=-40?h="H":-40>c&&c>=-48?h="G":-48>c&&c>=-56?h="F":-56>c&&c>=-64?h="E":-64>c&&c>=-72?h="D":-72>c&&c>=-80&&(h="C"),h}function get100kSetForZone(c){var h=c%6;return 0===h&&(h=6),h}function decode(c){if(c&&0===c.length)throw"MGRSPoint coverting from nothing";for(var h,g=c.length,m=null,b="",w=0;!/[A-Z]/.test(h=c.charAt(w));){if(w>=2)throw"MGRSPoint bad conversion from: "+c;b+=h,w++}var S=parseInt(b,10);if(0===w||w+3>g)throw"MGRSPoint bad conversion from: "+c;var M=c.charAt(w++);if(M<="A"||"B"===M||"Y"===M||M>="Z"||"I"===M||"O"===M)throw"MGRSPoint zone letter "+M+" not handled: "+c;m=c.substring(w,w+=2);for(var k=get100kSetForZone(S),T=function getEastingFromChar(c,h){var g=fa.charCodeAt(h-1),m=1e5,b=!1;for(;g!==c.charCodeAt(0);){if(++g===ma&&g++,g===va&&g++,g>Aa){if(b)throw"Bad character: "+c;g=_a,b=!0}m+=1e5}return m}(m.charAt(0),k),E=function getNorthingFromChar(c,h){if(c>"V")throw"MGRSPoint given invalid Northing "+c;var g=ga.charCodeAt(h-1),m=0,b=!1;for(;g!==c.charCodeAt(0);){if(++g===ma&&g++,g===va&&g++,g>ya){if(b)throw"Bad character: "+c;g=_a,b=!0}m+=1e5}return m}(m.charAt(1),k);E<getMinNorthing(M);)E+=2e6;var I=g-w;if(I%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+c;var P,L,B,z=I/2,j=0,D=0;return z>0&&(P=1e5/Math.pow(10,z),L=c.substring(w,w+z),j=parseFloat(L)*P,B=c.substring(w+z),D=parseFloat(B)*P),{easting:j+T,northing:D+E,zoneLetter:M,zoneNumber:S,accuracy:P}}function getMinNorthing(c){var h;switch(c){case"C":h=11e5;break;case"D":h=2e6;break;case"E":h=28e5;break;case"F":h=37e5;break;case"G":h=46e5;break;case"H":h=55e5;break;case"J":h=64e5;break;case"K":h=73e5;break;case"L":h=82e5;break;case"M":h=91e5;break;case"N":h=0;break;case"P":h=8e5;break;case"Q":h=17e5;break;case"R":h=26e5;break;case"S":h=35e5;break;case"T":h=44e5;break;case"U":h=53e5;break;case"V":h=62e5;break;case"W":h=7e6;break;case"X":h=79e5;break;default:h=-1}if(h>=0)return h;throw"Invalid zone letter: "+c}function Point(c,h,g){if(!(this instanceof Point))return new Point(c,h,g);if(Array.isArray(c))this.x=c[0],this.y=c[1],this.z=c[2]||0;else if("object"==typeof c)this.x=c.x,this.y=c.y,this.z=c.z||0;else if("string"==typeof c&&void 0===h){var m=c.split(",");this.x=parseFloat(m[0]),this.y=parseFloat(m[1]),this.z=parseFloat(m[2])||0}else this.x=c,this.y=h,this.z=g||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Point.fromMGRS=function(c){return new Point(mgrs_toPoint(c))},Point.prototype.toMGRS=function(c){return mgrs_forward([this.x,this.y],c)};const xa=Point;var wa=.046875,Ca=.01953125,Sa=.01068115234375;function pj_enfn(c){var h=[];h[0]=1-c*(.25+c*(wa+c*(Ca+c*Sa))),h[1]=c*(.75-c*(wa+c*(Ca+c*Sa)));var g=c*c;return h[2]=g*(.46875-c*(.013020833333333334+.007120768229166667*c)),g*=c,h[3]=g*(.3645833333333333-.005696614583333333*c),h[4]=g*c*.3076171875,h}function pj_mlfn(c,h,g,m){return g*=h,h*=h,m[0]*c-g*(m[1]+h*(m[2]+h*(m[3]+h*m[4])))}function pj_inv_mlfn(c,h,g){for(var m=1/(1-h),b=c,w=20;w;--w){var S=Math.sin(b),M=1-h*S*S;if(b-=M=(pj_mlfn(b,S,Math.cos(b),g)-c)*(M*Math.sqrt(M))*m,Math.abs(M)<ko)return b}return b}const Ma={init:function tmerc_init(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=pj_enfn(this.es),this.ml0=pj_mlfn(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function tmerc_forward(c){var h,g,m,b=c.x,w=c.y,S=adjust_lon(b-this.long0,this.over),M=Math.sin(w),k=Math.cos(w);if(this.es){var T=k*S,E=Math.pow(T,2),I=this.ep2*Math.pow(k,2),P=Math.pow(I,2),L=Math.abs(k)>ko?Math.tan(w):0,B=Math.pow(L,2),z=Math.pow(B,2);h=1-this.es*Math.pow(M,2),T/=Math.sqrt(h);var j=pj_mlfn(w,M,k,this.en);g=this.a*(this.k0*T*(1+E/6*(1-B+I+E/20*(5-18*B+z+14*I-58*B*I+E/42*(61+179*z-z*B-479*B)))))+this.x0,m=this.a*(this.k0*(j-this.ml0+M*S*T/2*(1+E/12*(5-B+9*I+4*P+E/30*(61+z-58*B+270*I-330*B*I+E/56*(1385+543*z-z*B-3111*B))))))+this.y0}else{var D=k*Math.sin(S);if(Math.abs(Math.abs(D)-1)<ko)return 93;if(g=.5*this.a*this.k0*Math.log((1+D)/(1-D))+this.x0,m=k*Math.cos(S)/Math.sqrt(1-Math.pow(D,2)),(D=Math.abs(m))>=1){if(D-1>ko)return 93;m=0}else m=Math.acos(m);w<0&&(m=-m),m=this.a*this.k0*(m-this.lat0)+this.y0}return c.x=g,c.y=m,c},inverse:function tmerc_inverse(c){var h,g,m,b,w=(c.x-this.x0)*(1/this.a),S=(c.y-this.y0)*(1/this.a);if(this.es)if(g=pj_inv_mlfn(h=this.ml0+S/this.k0,this.es,this.en),Math.abs(g)<Mo){var M=Math.sin(g),k=Math.cos(g),T=Math.abs(k)>ko?Math.tan(g):0,E=this.ep2*Math.pow(k,2),I=Math.pow(E,2),P=Math.pow(T,2),L=Math.pow(P,2);h=1-this.es*Math.pow(M,2);var B=w*Math.sqrt(h)/this.k0,z=Math.pow(B,2);m=g-(h*=T)*z/(1-this.es)*.5*(1-z/12*(5+3*P-9*E*P+E-4*I-z/30*(61+90*P-252*E*P+45*L+46*E-z/56*(1385+3633*P+4095*L+1574*L*P)))),b=adjust_lon(this.long0+B*(1-z/6*(1+2*P+E-z/20*(5+28*P+24*L+8*E*P+6*E-z/42*(61+662*P+1320*L+720*L*P))))/k,this.over)}else m=Mo*common_sign(S),b=0;else{var j=Math.exp(w/this.k0),D=.5*(j-1/j),N=this.lat0+S/this.k0,R=Math.cos(N);h=Math.sqrt((1-Math.pow(R,2))/(1+Math.pow(D,2))),m=Math.asin(h),S<0&&(m=-m),b=0===D&&0===R?0:adjust_lon(Math.atan2(D,R)+this.long0,this.over)}return c.x=b,c.y=m,c},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function common_sinh(c){var h=Math.exp(c);return h=(h-1/h)/2}function common_hypot(c,h){c=Math.abs(c),h=Math.abs(h);var g=Math.max(c,h),m=Math.min(c,h)/(g||1);return g*Math.sqrt(1+Math.pow(m,2))}function asinhy(c){var h=Math.abs(c);return h=function log1py(c){var h=1+c,g=h-1;return 0===g?c:c*Math.log(h)/g}(h*(1+h/(common_hypot(1,h)+1))),c<0?-h:h}function gatg(c,h){for(var g,m=2*Math.cos(2*h),b=c.length-1,w=c[b],S=0;--b>=0;)g=m*w-S+c[b],S=w,w=g;return h+g*Math.sin(2*h)}function clens_cmplx(c,h,g){for(var m,b,w=Math.sin(h),S=Math.cos(h),M=common_sinh(g),k=function common_cosh(c){var h=Math.exp(c);return(h+1/h)/2}(g),T=2*S*k,E=-2*w*M,I=c.length-1,P=c[I],L=0,B=0,z=0;--I>=0;)m=B,b=L,P=T*(B=P)-m-E*(L=z)+c[I],z=E*B-b+T*L;return[(T=w*k)*P-(E=S*M)*z,T*z+E*P]}const ka={init:function etmerc_init(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Ma.init.apply(this),this.forward=Ma.forward,this.inverse=Ma.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var c=this.es/(1+Math.sqrt(1-this.es)),h=c/(2-c),g=h;this.cgb[0]=h*(2+h*(-2/3+h*(h*(116/45+h*(26/45+h*(-2854/675)))-2))),this.cbg[0]=h*(h*(2/3+h*(4/3+h*(-82/45+h*(32/45+h*(4642/4725)))))-2),g*=h,this.cgb[1]=g*(7/3+h*(h*(-227/45+h*(2704/315+h*(2323/945)))-1.6)),this.cbg[1]=g*(5/3+h*(-16/15+h*(-13/9+h*(904/315+h*(-1522/945))))),g*=h,this.cgb[2]=g*(56/15+h*(-136/35+h*(-1262/105+h*(73814/2835)))),this.cbg[2]=g*(-26/15+h*(34/21+h*(1.6+h*(-12686/2835)))),g*=h,this.cgb[3]=g*(4279/630+h*(-332/35+h*(-399572/14175))),this.cbg[3]=g*(1237/630+h*(h*(-24832/14175)-2.4)),g*=h,this.cgb[4]=g*(4174/315+h*(-144838/6237)),this.cbg[4]=g*(-734/315+h*(109598/31185)),g*=h,this.cgb[5]=g*(601676/22275),this.cbg[5]=g*(444337/155925),g=Math.pow(h,2),this.Qn=this.k0/(1+h)*(1+g*(1/4+g*(1/64+g/256))),this.utg[0]=h*(h*(2/3+h*(-37/96+h*(1/360+h*(81/512+h*(-96199/604800)))))-.5),this.gtu[0]=h*(.5+h*(-2/3+h*(5/16+h*(41/180+h*(-127/288+h*(7891/37800)))))),this.utg[1]=g*(-1/48+h*(-1/15+h*(437/1440+h*(-46/105+h*(1118711/3870720))))),this.gtu[1]=g*(13/48+h*(h*(557/1440+h*(281/630+h*(-1983433/1935360)))-.6)),g*=h,this.utg[2]=g*(-17/480+h*(37/840+h*(209/4480+h*(-5569/90720)))),this.gtu[2]=g*(61/240+h*(-103/140+h*(15061/26880+h*(167603/181440)))),g*=h,this.utg[3]=g*(-4397/161280+h*(11/504+h*(830251/7257600))),this.gtu[3]=g*(49561/161280+h*(-179/168+h*(6601661/7257600))),g*=h,this.utg[4]=g*(-4583/161280+h*(108847/3991680)),this.gtu[4]=g*(34729/80640+h*(-3418889/1995840)),g*=h,this.utg[5]=g*(-20648693/638668800),this.gtu[5]=.6650675310896665*g;var m=gatg(this.cbg,this.lat0);this.Zb=-this.Qn*(m+function clens(c,h){for(var g,m=2*Math.cos(h),b=c.length-1,w=c[b],S=0;--b>=0;)g=m*w-S+c[b],S=w,w=g;return Math.sin(h)*g}(this.gtu,2*m))},forward:function etmerc_forward(c){var h=adjust_lon(c.x-this.long0,this.over),g=c.y;g=gatg(this.cbg,g);var m=Math.sin(g),b=Math.cos(g),w=Math.sin(h),S=Math.cos(h);g=Math.atan2(m,S*b),h=Math.atan2(w*b,common_hypot(m,b*S)),h=asinhy(Math.tan(h));var M,k,T=clens_cmplx(this.gtu,2*g,2*h);return g+=T[0],h+=T[1],Math.abs(h)<=2.623395162778?(M=this.a*(this.Qn*h)+this.x0,k=this.a*(this.Qn*g+this.Zb)+this.y0):(M=1/0,k=1/0),c.x=M,c.y=k,c},inverse:function etmerc_inverse(c){var h,g,m=(c.x-this.x0)*(1/this.a),b=(c.y-this.y0)*(1/this.a);if(b=(b-this.Zb)/this.Qn,m/=this.Qn,Math.abs(m)<=2.623395162778){var w=clens_cmplx(this.utg,2*b,2*m);b+=w[0],m+=w[1],m=Math.atan(common_sinh(m));var S=Math.sin(b),M=Math.cos(b),k=Math.sin(m),T=Math.cos(m);b=Math.atan2(S*T,common_hypot(k,T*M)),h=adjust_lon((m=Math.atan2(k,T*M))+this.long0,this.over),g=gatg(this.cgb,b)}else h=1/0,g=1/0;return c.x=h,c.y=g,c},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]};const Ta={init:function utm_init(){var c=function adjust_zone(c,h){if(void 0===c){if((c=Math.floor(30*(adjust_lon(h)+Math.PI)/Math.PI)+1)<0)return 0;if(c>60)return 60}return c}(this.zone,this.long0);if(void 0===c)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(c)-183)*To,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,ka.init.apply(this),this.forward=ka.forward,this.inverse=ka.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function srat(c,h){return Math.pow((1-c)/(1+c),h)}const Ea={init:function gauss_init(){var c=Math.sin(this.lat0),h=Math.cos(this.lat0);h*=h,this.rc=Math.sqrt(1-this.es)/(1-this.es*c*c),this.C=Math.sqrt(1+this.es*h*h/(1-this.es)),this.phic0=Math.asin(c/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Io)/(Math.pow(Math.tan(.5*this.lat0+Io),this.C)*srat(this.e*c,this.ratexp))},forward:function gauss_forward(c){var h=c.x,g=c.y;return c.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*g+Io),this.C)*srat(this.e*Math.sin(g),this.ratexp))-Mo,c.x=this.C*h,c},inverse:function gauss_inverse(c){for(var h=c.x/this.C,g=c.y,m=Math.pow(Math.tan(.5*g+Io)/this.K,1/this.C),b=20;b>0&&(g=2*Math.atan(m*srat(this.e*Math.sin(c.y),-.5*this.e))-Mo,!(Math.abs(g-c.y)<1e-14));--b)c.y=g;return b?(c.x=h,c.y=g,c):null},names:["gauss"]};const Ia={init:function sterea_init(){Ea.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function sterea_forward(c){var h,g,m,b;return c.x=adjust_lon(c.x-this.long0,this.over),Ea.forward.apply(this,[c]),h=Math.sin(c.y),g=Math.cos(c.y),m=Math.cos(c.x),b=this.k0*this.R2/(1+this.sinc0*h+this.cosc0*g*m),c.x=b*g*Math.sin(c.x),c.y=b*(this.cosc0*h-this.sinc0*g*m),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function sterea_inverse(c){var h,g,m,b,w;if(c.x=(c.x-this.x0)/this.a,c.y=(c.y-this.y0)/this.a,c.x/=this.k0,c.y/=this.k0,w=common_hypot(c.x,c.y)){var S=2*Math.atan2(w,this.R2);h=Math.sin(S),g=Math.cos(S),b=Math.asin(g*this.sinc0+c.y*h*this.cosc0/w),m=Math.atan2(c.x*h,w*this.cosc0*g-c.y*this.sinc0*h)}else b=this.phic0,m=0;return c.x=m,c.y=b,Ea.inverse.apply(this,[c]),c.x=adjust_lon(c.x+this.long0,this.over),c},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};function ssfn_(c,h,g){return h*=g,Math.tan(.5*(Mo+c))*Math.pow((1-h)/(1+h),.5*g)}const Pa={init:function stere_init(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=ko&&(this.k0=.5*(1+common_sign(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=ko&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=ko&&Math.abs(Math.cos(this.lat_ts))>ko&&(this.k0=.5*this.cons*msfnz(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/tsfnz(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=msfnz(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(ssfn_(this.lat0,this.sinlat0,this.e))-Mo,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function stere_forward(c){var h,g,m,b,w,S,M=c.x,k=c.y,T=Math.sin(k),E=Math.cos(k),I=adjust_lon(M-this.long0,this.over);return Math.abs(Math.abs(M-this.long0)-Math.PI)<=ko&&Math.abs(k+this.lat0)<=ko?(c.x=NaN,c.y=NaN,c):this.sphere?(h=2*this.k0/(1+this.sinlat0*T+this.coslat0*E*Math.cos(I)),c.x=this.a*h*E*Math.sin(I)+this.x0,c.y=this.a*h*(this.coslat0*T-this.sinlat0*E*Math.cos(I))+this.y0,c):(g=2*Math.atan(ssfn_(k,T,this.e))-Mo,b=Math.cos(g),m=Math.sin(g),Math.abs(this.coslat0)<=ko?(w=tsfnz(this.e,k*this.con,this.con*T),S=2*this.a*this.k0*w/this.cons,c.x=this.x0+S*Math.sin(M-this.long0),c.y=this.y0-this.con*S*Math.cos(M-this.long0),c):(Math.abs(this.sinlat0)<ko?(h=2*this.a*this.k0/(1+b*Math.cos(I)),c.y=h*m):(h=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*m+this.cosX0*b*Math.cos(I))),c.y=h*(this.cosX0*m-this.sinX0*b*Math.cos(I))+this.y0),c.x=h*b*Math.sin(I)+this.x0,c))},inverse:function stere_inverse(c){var h,g,m,b,w;c.x-=this.x0,c.y-=this.y0;var S=Math.sqrt(c.x*c.x+c.y*c.y);if(this.sphere){var M=2*Math.atan(S/(2*this.a*this.k0));return h=this.long0,g=this.lat0,S<=ko?(c.x=h,c.y=g,c):(g=Math.asin(Math.cos(M)*this.sinlat0+c.y*Math.sin(M)*this.coslat0/S),h=Math.abs(this.coslat0)<ko?this.lat0>0?adjust_lon(this.long0+Math.atan2(c.x,-1*c.y),this.over):adjust_lon(this.long0+Math.atan2(c.x,c.y),this.over):adjust_lon(this.long0+Math.atan2(c.x*Math.sin(M),S*this.coslat0*Math.cos(M)-c.y*this.sinlat0*Math.sin(M)),this.over),c.x=h,c.y=g,c)}if(Math.abs(this.coslat0)<=ko){if(S<=ko)return g=this.lat0,h=this.long0,c.x=h,c.y=g,c;c.x*=this.con,c.y*=this.con,m=S*this.cons/(2*this.a*this.k0),g=this.con*phi2z(this.e,m),h=this.con*adjust_lon(this.con*this.long0+Math.atan2(c.x,-1*c.y),this.over)}else b=2*Math.atan(S*this.cosX0/(2*this.a*this.k0*this.ms1)),h=this.long0,S<=ko?w=this.X0:(w=Math.asin(Math.cos(b)*this.sinX0+c.y*Math.sin(b)*this.cosX0/S),h=adjust_lon(this.long0+Math.atan2(c.x*Math.sin(b),S*this.cosX0*Math.cos(b)-c.y*this.sinX0*Math.sin(b)),this.over)),g=-1*phi2z(this.e,Math.tan(.5*(Mo+w)));return c.x=h,c.y=g,c},names:["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"],ssfn_};const La={init:function somerc_init(){var c=this.lat0;this.lambda0=this.long0;var h=Math.sin(c),g=this.a,m=1/this.rf,b=2*m-Math.pow(m,2),w=this.e=Math.sqrt(b);this.R=this.k0*g*Math.sqrt(1-b)/(1-b*Math.pow(h,2)),this.alpha=Math.sqrt(1+b/(1-b)*Math.pow(Math.cos(c),4)),this.b0=Math.asin(h/this.alpha);var S=Math.log(Math.tan(Math.PI/4+this.b0/2)),M=Math.log(Math.tan(Math.PI/4+c/2)),k=Math.log((1+w*h)/(1-w*h));this.K=S-this.alpha*M+this.alpha*w/2*k},forward:function somerc_forward(c){var h=Math.log(Math.tan(Math.PI/4-c.y/2)),g=this.e/2*Math.log((1+this.e*Math.sin(c.y))/(1-this.e*Math.sin(c.y))),m=-this.alpha*(h+g)+this.K,b=2*(Math.atan(Math.exp(m))-Math.PI/4),w=this.alpha*(c.x-this.lambda0),S=Math.atan(Math.sin(w)/(Math.sin(this.b0)*Math.tan(b)+Math.cos(this.b0)*Math.cos(w))),M=Math.asin(Math.cos(this.b0)*Math.sin(b)-Math.sin(this.b0)*Math.cos(b)*Math.cos(w));return c.y=this.R/2*Math.log((1+Math.sin(M))/(1-Math.sin(M)))+this.y0,c.x=this.R*S+this.x0,c},inverse:function somerc_inverse(c){for(var h=c.x-this.x0,g=c.y-this.y0,m=h/this.R,b=2*(Math.atan(Math.exp(g/this.R))-Math.PI/4),w=Math.asin(Math.cos(this.b0)*Math.sin(b)+Math.sin(this.b0)*Math.cos(b)*Math.cos(m)),S=Math.atan(Math.sin(m)/(Math.cos(this.b0)*Math.cos(m)-Math.sin(this.b0)*Math.tan(b))),M=this.lambda0+S/this.alpha,k=0,T=w,E=-1e3,I=0;Math.abs(T-E)>1e-7;){if(++I>20)return;k=1/this.alpha*(Math.log(Math.tan(Math.PI/4+w/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(T))/2)),E=T,T=2*Math.atan(Math.exp(k))-Math.PI/2}return c.x=M,c.y=T,c},names:["somerc"]};var Fa=1e-7;const Ba={init:function omerc_init(){var c,h,g,m,b,w,S,M,k,T,E,I=0,P=0,L=0,B=0,z=0,j=0,D=0;this.no_off=function isTypeA(c){var h=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],g="object"==typeof c.projName?Object.keys(c.projName)[0]:c.projName;return"no_uoff"in c||"no_off"in c||-1!==h.indexOf(g)||-1!==h.indexOf(getNormalizedProjName(g))}(this),this.no_rot="no_rot"in this;var N=!1;"alpha"in this&&(N=!0);var R=!1;if("rectified_grid_angle"in this&&(R=!0),N&&(D=this.alpha),R&&(I=this.rectified_grid_angle),N||R)P=this.longc;else if(L=this.long1,z=this.lat1,B=this.long2,j=this.lat2,Math.abs(z-j)<=Fa||(c=Math.abs(z))<=Fa||Math.abs(c-Mo)<=Fa||Math.abs(Math.abs(this.lat0)-Mo)<=Fa||Math.abs(Math.abs(j)-Mo)<=Fa)throw new Error;var G=1-this.es;h=Math.sqrt(G),Math.abs(this.lat0)>ko?(M=Math.sin(this.lat0),g=Math.cos(this.lat0),c=1-this.es*M*M,this.B=g*g,this.B=Math.sqrt(1+this.es*this.B*this.B/G),this.A=this.B*this.k0*h/c,(b=(m=this.B*h/(g*Math.sqrt(c)))*m-1)<=0?b=0:(b=Math.sqrt(b),this.lat0<0&&(b=-b)),this.E=b+=m,this.E*=Math.pow(tsfnz(this.e,this.lat0,M),this.B)):(this.B=1/h,this.A=this.k0,this.E=m=b=1),N||R?(N?(E=Math.asin(Math.sin(D)/m),R||(I=D)):(E=I,D=Math.asin(m*Math.sin(E))),this.lam0=P-Math.asin(.5*(b-1/b)*Math.tan(E))/this.B):(w=Math.pow(tsfnz(this.e,z,Math.sin(z)),this.B),S=Math.pow(tsfnz(this.e,j,Math.sin(j)),this.B),b=this.E/w,k=(S-w)/(S+w),T=((T=this.E*this.E)-S*w)/(T+S*w),(c=L-B)<-Math.PI?B-=Po:c>Math.PI&&(B+=Po),this.lam0=adjust_lon(.5*(L+B)-Math.atan(T*Math.tan(.5*this.B*(L-B))/k)/this.B,this.over),E=Math.atan(2*Math.sin(this.B*adjust_lon(L-this.lam0,this.over))/(b-1/b)),I=D=Math.asin(m*Math.sin(E))),this.singam=Math.sin(E),this.cosgam=Math.cos(E),this.sinrot=Math.sin(I),this.cosrot=Math.cos(I),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(m*m-1)/Math.cos(D))),this.lat0<0&&(this.u_0=-this.u_0)),b=.5*E,this.v_pole_n=this.ArB*Math.log(Math.tan(Io-b)),this.v_pole_s=this.ArB*Math.log(Math.tan(Io+b))},forward:function omerc_forward(c){var h,g,m,b,w,S,M,k,T={};if(c.x=c.x-this.lam0,Math.abs(Math.abs(c.y)-Mo)>ko){if(h=.5*((w=this.E/Math.pow(tsfnz(this.e,c.y,Math.sin(c.y)),this.B))-(S=1/w)),g=.5*(w+S),b=Math.sin(this.B*c.x),m=(h*this.singam-b*this.cosgam)/g,Math.abs(Math.abs(m)-1)<ko)throw new Error;k=.5*this.ArB*Math.log((1-m)/(1+m)),S=Math.cos(this.B*c.x),M=Math.abs(S)<Fa?this.A*c.x:this.ArB*Math.atan2(h*this.cosgam+b*this.singam,S)}else k=c.y>0?this.v_pole_n:this.v_pole_s,M=this.ArB*c.y;return this.no_rot?(T.x=M,T.y=k):(M-=this.u_0,T.x=k*this.cosrot+M*this.sinrot,T.y=M*this.cosrot-k*this.sinrot),T.x=this.a*T.x+this.x0,T.y=this.a*T.y+this.y0,T},inverse:function omerc_inverse(c){var h,g,m,b,w,S,M,k={};if(c.x=(c.x-this.x0)*(1/this.a),c.y=(c.y-this.y0)*(1/this.a),this.no_rot?(g=c.y,h=c.x):(g=c.x*this.cosrot-c.y*this.sinrot,h=c.y*this.cosrot+c.x*this.sinrot+this.u_0),b=.5*((m=Math.exp(-this.BrA*g))-1/m),w=.5*(m+1/m),M=((S=Math.sin(this.BrA*h))*this.cosgam+b*this.singam)/w,Math.abs(Math.abs(M)-1)<ko)k.x=0,k.y=M<0?-Mo:Mo;else{if(k.y=this.E/Math.sqrt((1+M)/(1-M)),k.y=phi2z(this.e,Math.pow(k.y,1/this.B)),k.y===1/0)throw new Error;k.x=-this.rB*Math.atan2(b*this.cosgam-S*this.singam,Math.cos(this.BrA*h))}return k.x+=this.lam0,k},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]};const Oa={init:function lcc_init(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<ko)){var c=this.b/this.a;this.e=Math.sqrt(1-c*c);var h=Math.sin(this.lat1),g=Math.cos(this.lat1),m=msfnz(this.e,h,g),b=tsfnz(this.e,this.lat1,h),w=Math.sin(this.lat2),S=Math.cos(this.lat2),M=msfnz(this.e,w,S),k=tsfnz(this.e,this.lat2,w),T=Math.abs(Math.abs(this.lat0)-Mo)<ko?0:tsfnz(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>ko?this.ns=Math.log(m/M)/Math.log(b/k):this.ns=h,isNaN(this.ns)&&(this.ns=h),this.f0=m/(this.ns*Math.pow(b,this.ns)),this.rh=this.a*this.f0*Math.pow(T,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function lcc_forward(c){var h=c.x,g=c.y;Math.abs(2*Math.abs(g)-Math.PI)<=ko&&(g=common_sign(g)*(Mo-2e-10));var m,b,w=Math.abs(Math.abs(g)-Mo);if(w>ko)m=tsfnz(this.e,g,Math.sin(g)),b=this.a*this.f0*Math.pow(m,this.ns);else{if((w=g*this.ns)<=0)return null;b=0}var S=this.ns*adjust_lon(h-this.long0,this.over);return c.x=this.k0*(b*Math.sin(S))+this.x0,c.y=this.k0*(this.rh-b*Math.cos(S))+this.y0,c},inverse:function lcc_inverse(c){var h,g,m,b,w,S=(c.x-this.x0)/this.k0,M=this.rh-(c.y-this.y0)/this.k0;this.ns>0?(h=Math.sqrt(S*S+M*M),g=1):(h=-Math.sqrt(S*S+M*M),g=-1);var k=0;if(0!==h&&(k=Math.atan2(g*S,g*M)),0!==h||this.ns>0){if(g=1/this.ns,m=Math.pow(h/(this.a*this.f0),g),-9999===(b=phi2z(this.e,m)))return null}else b=-Mo;return w=adjust_lon(k/this.ns+this.long0,this.over),c.x=w,c.y=b,c},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};const za={init:function krovak_init(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function krovak_forward(c){var h,g,m,b,w,S,M,k=c.x,T=c.y,E=adjust_lon(k-this.long0,this.over);return h=Math.pow((1+this.e*Math.sin(T))/(1-this.e*Math.sin(T)),this.alfa*this.e/2),g=2*(Math.atan(this.k*Math.pow(Math.tan(T/2+this.s45),this.alfa)/h)-this.s45),m=-E*this.alfa,b=Math.asin(Math.cos(this.ad)*Math.sin(g)+Math.sin(this.ad)*Math.cos(g)*Math.cos(m)),w=Math.asin(Math.cos(g)*Math.sin(m)/Math.cos(b)),S=this.n*w,M=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(b/2+this.s45),this.n),c.y=M*Math.cos(S)/1,c.x=M*Math.sin(S)/1,this.czech||(c.y*=-1,c.x*=-1),c},inverse:function krovak_inverse(c){var h,g,m,b,w,S,M,k=c.x;c.x=c.y,c.y=k,this.czech||(c.y*=-1,c.x*=-1),w=Math.sqrt(c.x*c.x+c.y*c.y),b=Math.atan2(c.y,c.x)/Math.sin(this.s0),m=2*(Math.atan(Math.pow(this.ro0/w,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),h=Math.asin(Math.cos(this.ad)*Math.sin(m)-Math.sin(this.ad)*Math.cos(m)*Math.cos(b)),g=Math.asin(Math.cos(m)*Math.sin(b)/Math.cos(h)),c.x=this.long0-g/this.alfa,S=h,M=0;var T=0;do{c.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(h/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(S))/(1-this.e*Math.sin(S)),this.e/2))-this.s45),Math.abs(S-c.y)<1e-10&&(M=1),S=c.y,T+=1}while(0===M&&T<15);return T>=15?null:c},names:["Krovak","krovak"]};function mlfn(c,h,g,m,b){return c*b-h*Math.sin(2*b)+g*Math.sin(4*b)-m*Math.sin(6*b)}function e0fn(c){return 1-.25*c*(1+c/16*(3+1.25*c))}function e1fn(c){return.375*c*(1+.25*c*(1+.46875*c))}function e2fn(c){return.05859375*c*c*(1+.75*c)}function e3fn(c){return c*c*c*(35/3072)}function gN(c,h,g){var m=h*g;return c/Math.sqrt(1-m*m)}function adjust_lat(c){return Math.abs(c)<Mo?c:c-common_sign(c)*Math.PI}function imlfn(c,h,g,m,b){var w,S;w=c/h;for(var M=0;M<15;M++)if(w+=S=(c-(h*w-g*Math.sin(2*w)+m*Math.sin(4*w)-b*Math.sin(6*w)))/(h-2*g*Math.cos(2*w)+4*m*Math.cos(4*w)-6*b*Math.cos(6*w)),Math.abs(S)<=1e-10)return w;return NaN}const ja={init:function cass_init(){this.sphere||(this.e0=e0fn(this.es),this.e1=e1fn(this.es),this.e2=e2fn(this.es),this.e3=e3fn(this.es),this.ml0=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function cass_forward(c){var h,g,m=c.x,b=c.y;if(m=adjust_lon(m-this.long0,this.over),this.sphere)h=this.a*Math.asin(Math.cos(b)*Math.sin(m)),g=this.a*(Math.atan2(Math.tan(b),Math.cos(m))-this.lat0);else{var w=Math.sin(b),S=Math.cos(b),M=gN(this.a,this.e,w),k=Math.tan(b)*Math.tan(b),T=m*Math.cos(b),E=T*T,I=this.es*S*S/(1-this.es);h=M*T*(1-E*k*(1/6-(8-k+8*I)*E/120)),g=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,b)-this.ml0+M*w/S*E*(.5+(5-k+6*I)*E/24)}return c.x=h+this.x0,c.y=g+this.y0,c},inverse:function cass_inverse(c){c.x-=this.x0,c.y-=this.y0;var h,g,m=c.x/this.a,b=c.y/this.a;if(this.sphere){var w=b+this.lat0;h=Math.asin(Math.sin(w)*Math.cos(m)),g=Math.atan2(Math.tan(m),Math.cos(w))}else{var S=imlfn(this.ml0/this.a+b,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(S)-Mo)<=ko)return c.x=this.long0,c.y=Mo,b<0&&(c.y*=-1),c;var M=gN(this.a,this.e,Math.sin(S)),k=M*M*M/this.a/this.a*(1-this.es),T=Math.pow(Math.tan(S),2),E=m*this.a/M,I=E*E;h=S-M*Math.tan(S)/k*E*E*(.5-(1+3*T)*E*E/24),g=E*(1-I*(T/3+(1+3*T)*T*I/15))/Math.cos(S)}return c.x=adjust_lon(g+this.long0,this.over),c.y=adjust_lat(h),c},names:["Cassini","Cassini_Soldner","cass"]};function qsfnz(c,h){var g;return c>1e-7?(1-c*c)*(h/(1-(g=c*h)*g)-.5/c*Math.log((1-g)/(1+g))):2*h}var Da=.3333333333333333,Na=.17222222222222222,Ra=.10257936507936508,Ga=.06388888888888888,qa=.0664021164021164,Wa=.016415012942191543;const Ha={init:function laea_init(){var c,h=Math.abs(this.lat0);if(Math.abs(h-Mo)<ko?this.mode=this.lat0<0?1:2:Math.abs(h)<ko?this.mode=3:this.mode=4,this.es>0)switch(this.qp=qsfnz(this.e,1),this.mmf=.5/(1-this.es),this.apa=function authset(c){var h,g=[];return g[0]=c*Da,h=c*c,g[0]+=h*Na,g[1]=h*Ga,h*=c,g[0]+=h*Ra,g[1]+=h*qa,g[2]=h*Wa,g}(this.es),this.mode){case 2:case 1:this.dd=1;break;case 3:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case 4:this.rq=Math.sqrt(.5*this.qp),c=Math.sin(this.lat0),this.sinb1=qsfnz(this.e,c)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*c*c)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else 4===this.mode&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function laea_forward(c){var h,g,m,b,w,S,M,k,T,E,I=c.x,P=c.y;if(I=adjust_lon(I-this.long0,this.over),this.sphere){if(w=Math.sin(P),E=Math.cos(P),m=Math.cos(I),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((g=this.mode===this.EQUIT?1+E*m:1+this.sinph0*w+this.cosph0*E*m)<=ko)return null;h=(g=Math.sqrt(2/g))*E*Math.sin(I),g*=this.mode===this.EQUIT?w:this.cosph0*w-this.sinph0*E*m}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(m=-m),Math.abs(P+this.lat0)<ko)return null;g=Io-.5*P,h=(g=2*(this.mode===this.S_POLE?Math.cos(g):Math.sin(g)))*Math.sin(I),g*=m}}else{switch(M=0,k=0,T=0,m=Math.cos(I),b=Math.sin(I),w=Math.sin(P),S=qsfnz(this.e,w),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(M=S/this.qp,k=Math.sqrt(1-M*M)),this.mode){case this.OBLIQ:T=1+this.sinb1*M+this.cosb1*k*m;break;case this.EQUIT:T=1+k*m;break;case this.N_POLE:T=Mo+P,S=this.qp-S;break;case this.S_POLE:T=P-Mo,S=this.qp+S}if(Math.abs(T)<ko)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:T=Math.sqrt(2/T),g=this.mode===this.OBLIQ?this.ymf*T*(this.cosb1*M-this.sinb1*k*m):(T=Math.sqrt(2/(1+k*m)))*M*this.ymf,h=this.xmf*T*k*b;break;case this.N_POLE:case this.S_POLE:S>=0?(h=(T=Math.sqrt(S))*b,g=m*(this.mode===this.S_POLE?T:-T)):h=g=0}}return c.x=this.a*h+this.x0,c.y=this.a*g+this.y0,c},inverse:function laea_inverse(c){c.x-=this.x0,c.y-=this.y0;var h,g,m,b,w,S,M,k=c.x/this.a,T=c.y/this.a;if(this.sphere){var E,I=0,P=0;if((g=.5*(E=Math.sqrt(k*k+T*T)))>1)return null;switch(g=2*Math.asin(g),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(P=Math.sin(g),I=Math.cos(g)),this.mode){case this.EQUIT:g=Math.abs(E)<=ko?0:Math.asin(T*P/E),k*=P,T=I*E;break;case this.OBLIQ:g=Math.abs(E)<=ko?this.lat0:Math.asin(I*this.sinph0+T*P*this.cosph0/E),k*=P*this.cosph0,T=(I-Math.sin(g)*this.sinph0)*E;break;case this.N_POLE:T=-T,g=Mo-g;break;case this.S_POLE:g-=Mo}h=0!==T||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(k,T):0}else{if(M=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(k/=this.dd,T*=this.dd,(S=Math.sqrt(k*k+T*T))<ko)return c.x=this.long0,c.y=this.lat0,c;b=2*Math.asin(.5*S/this.rq),m=Math.cos(b),k*=b=Math.sin(b),this.mode===this.OBLIQ?(M=m*this.sinb1+T*b*this.cosb1/S,w=this.qp*M,T=S*this.cosb1*m-T*this.sinb1*b):(M=T*b/S,w=this.qp*M,T=S*m)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(T=-T),!(w=k*k+T*T))return c.x=this.long0,c.y=this.lat0,c;M=1-w/this.qp,this.mode===this.S_POLE&&(M=-M)}h=Math.atan2(k,T),g=function authlat(c,h){var g=c+c;return c+h[0]*Math.sin(g)+h[1]*Math.sin(g+g)+h[2]*Math.sin(g+g+g)}(Math.asin(M),this.apa)}return c.x=adjust_lon(this.long0+h,this.over),c.y=g,c},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function asinz(c){return Math.abs(c)>1&&(c=c>1?1:-1),Math.asin(c)}const Ua={init:function aea_init(){Math.abs(this.lat1+this.lat2)<ko||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=msfnz(this.e3,this.sin_po,this.cos_po),this.qs1=qsfnz(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=msfnz(this.e3,this.sin_po,this.cos_po),this.qs2=qsfnz(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=qsfnz(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>ko?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function aea_forward(c){var h=c.x,g=c.y;this.sin_phi=Math.sin(g),this.cos_phi=Math.cos(g);var m=qsfnz(this.e3,this.sin_phi),b=this.a*Math.sqrt(this.c-this.ns0*m)/this.ns0,w=this.ns0*adjust_lon(h-this.long0,this.over),S=b*Math.sin(w)+this.x0,M=this.rh-b*Math.cos(w)+this.y0;return c.x=S,c.y=M,c},inverse:function aea_inverse(c){var h,g,m,b,w,S;return c.x-=this.x0,c.y=this.rh-c.y+this.y0,this.ns0>=0?(h=Math.sqrt(c.x*c.x+c.y*c.y),m=1):(h=-Math.sqrt(c.x*c.x+c.y*c.y),m=-1),b=0,0!==h&&(b=Math.atan2(m*c.x,m*c.y)),m=h*this.ns0/this.a,this.sphere?S=Math.asin((this.c-m*m)/(2*this.ns0)):(g=(this.c-m*m)/this.ns0,S=this.phi1z(this.e3,g)),w=adjust_lon(b/this.ns0+this.long0,this.over),c.x=w,c.y=S,c},names:["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"],phi1z:function phi1z(c,h){var g,m,b,w,S=asinz(.5*h);if(c<ko)return S;for(var M=c*c,k=1;k<=25;k++)if(S+=w=.5*(b=1-(m=c*(g=Math.sin(S)))*m)*b/Math.cos(S)*(h/(1-M)-g/b+.5/c*Math.log((1-m)/(1+m))),Math.abs(w)<=1e-7)return S;return null}};const Ya={init:function gnom_init(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function gnom_forward(c){var h,g,m,b,w,S,M,k=c.x,T=c.y;return m=adjust_lon(k-this.long0,this.over),h=Math.sin(T),g=Math.cos(T),b=Math.cos(m),(w=this.sin_p14*h+this.cos_p14*g*b)>0||Math.abs(w)<=ko?(S=this.x0+1*this.a*g*Math.sin(m)/w,M=this.y0+1*this.a*(this.cos_p14*h-this.sin_p14*g*b)/w):(S=this.x0+this.infinity_dist*g*Math.sin(m),M=this.y0+this.infinity_dist*(this.cos_p14*h-this.sin_p14*g*b)),c.x=S,c.y=M,c},inverse:function gnom_inverse(c){var h,g,m,b,w,S;return c.x=(c.x-this.x0)/this.a,c.y=(c.y-this.y0)/this.a,c.x/=this.k0,c.y/=this.k0,(h=Math.sqrt(c.x*c.x+c.y*c.y))?(b=Math.atan2(h,this.rc),g=Math.sin(b),S=asinz((m=Math.cos(b))*this.sin_p14+c.y*g*this.cos_p14/h),w=Math.atan2(c.x*g,h*this.cos_p14*m-c.y*this.sin_p14*g),w=adjust_lon(this.long0+w,this.over)):(S=this.phic0,w=0),c.x=w,c.y=S,c},names:["gnom"]};const Va={init:function cea_init(){this.sphere||(this.k0=msfnz(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function cea_forward(c){var h,g,m=c.x,b=c.y,w=adjust_lon(m-this.long0,this.over);if(this.sphere)h=this.x0+this.a*w*Math.cos(this.lat_ts),g=this.y0+this.a*Math.sin(b)/Math.cos(this.lat_ts);else{var S=qsfnz(this.e,Math.sin(b));h=this.x0+this.a*this.k0*w,g=this.y0+this.a*S*.5/this.k0}return c.x=h,c.y=g,c},inverse:function cea_inverse(c){var h,g;return c.x-=this.x0,c.y-=this.y0,this.sphere?(h=adjust_lon(this.long0+c.x/this.a/Math.cos(this.lat_ts),this.over),g=Math.asin(c.y/this.a*Math.cos(this.lat_ts))):(g=function iqsfnz(c,h){var g=1-(1-c*c)/(2*c)*Math.log((1-c)/(1+c));if(Math.abs(Math.abs(h)-g)<1e-6)return h<0?-1*Mo:Mo;for(var m,b,w,S,M=Math.asin(.5*h),k=0;k<30;k++)if(b=Math.sin(M),w=Math.cos(M),S=c*b,M+=m=Math.pow(1-S*S,2)/(2*w)*(h/(1-c*c)-b/(1-S*S)+.5/c*Math.log((1-S)/(1+S))),Math.abs(m)<=1e-10)return M;return NaN}(this.e,2*c.y*this.k0/this.a),h=adjust_lon(this.long0+c.x/(this.a*this.k0),this.over)),c.x=h,c.y=g,c},names:["cea"]};const $a={init:function eqc_init(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function eqc_forward(c){var h=c.x,g=c.y,m=adjust_lon(h-this.long0,this.over),b=adjust_lat(g-this.lat0);return c.x=this.x0+this.a*m*this.rc,c.y=this.y0+this.a*b,c},inverse:function eqc_inverse(c){var h=c.x,g=c.y;return c.x=adjust_lon(this.long0+(h-this.x0)/(this.a*this.rc),this.over),c.y=adjust_lat(this.lat0+(g-this.y0)/this.a),c},names:["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"]};const Xa={init:function poly_init(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=e0fn(this.es),this.e1=e1fn(this.es),this.e2=e2fn(this.es),this.e3=e3fn(this.es),this.ml0=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function poly_forward(c){var h,g,m,b=c.x,w=c.y,S=adjust_lon(b-this.long0,this.over);if(m=S*Math.sin(w),this.sphere)Math.abs(w)<=ko?(h=this.a*S,g=-1*this.a*this.lat0):(h=this.a*Math.sin(m)/Math.tan(w),g=this.a*(adjust_lat(w-this.lat0)+(1-Math.cos(m))/Math.tan(w)));else if(Math.abs(w)<=ko)h=this.a*S,g=-1*this.ml0;else{var M=gN(this.a,this.e,Math.sin(w))/Math.tan(w);h=M*Math.sin(m),g=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,w)-this.ml0+M*(1-Math.cos(m))}return c.x=h+this.x0,c.y=g+this.y0,c},inverse:function poly_inverse(c){var h,g,m,b,w,S,M,k,T;if(m=c.x-this.x0,b=c.y-this.y0,this.sphere)if(Math.abs(b+this.a*this.lat0)<=ko)h=adjust_lon(m/this.a+this.long0,this.over),g=0;else{var E;for(S=this.lat0+b/this.a,M=m*m/this.a/this.a+S*S,k=S,w=20;w;--w)if(k+=T=-1*(S*(k*(E=Math.tan(k))+1)-k-.5*(k*k+M)*E)/((k-S)/E-1),Math.abs(T)<=ko){g=k;break}h=adjust_lon(this.long0+Math.asin(m*Math.tan(k)/this.a)/Math.sin(g),this.over)}else if(Math.abs(b+this.ml0)<=ko)g=0,h=adjust_lon(this.long0+m/this.a,this.over);else{var I,P,L,B,z;for(S=(this.ml0+b)/this.a,M=m*m/this.a/this.a+S*S,k=S,w=20;w;--w)if(z=this.e*Math.sin(k),I=Math.sqrt(1-z*z)*Math.tan(k),P=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,k),L=this.e0-2*this.e1*Math.cos(2*k)+4*this.e2*Math.cos(4*k)-6*this.e3*Math.cos(6*k),k-=T=(S*(I*(B=P/this.a)+1)-B-.5*I*(B*B+M))/(this.es*Math.sin(2*k)*(B*B+M-2*S*B)/(4*I)+(S-B)*(I*L-2/Math.sin(2*k))-L),Math.abs(T)<=ko){g=k;break}I=Math.sqrt(1-this.es*Math.pow(Math.sin(g),2))*Math.tan(g),h=adjust_lon(this.long0+Math.asin(m*I/this.a)/Math.sin(g),this.over)}return c.x=h,c.y=g,c},names:["Polyconic","American_Polyconic","poly"]};const Ka={init:function nzmg_init(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function nzmg_forward(c){var h,g=c.x,m=c.y-this.lat0,b=g-this.long0,w=m/So*1e-5,S=b,M=1,k=0;for(h=1;h<=10;h++)M*=w,k+=this.A[h]*M;var T,E=k,I=S,P=1,L=0,B=0,z=0;for(h=1;h<=6;h++)T=L*E+P*I,P=P*E-L*I,L=T,B=B+this.B_re[h]*P-this.B_im[h]*L,z=z+this.B_im[h]*P+this.B_re[h]*L;return c.x=z*this.a+this.x0,c.y=B*this.a+this.y0,c},inverse:function nzmg_inverse(c){var h,g,m=c.x,b=c.y,w=m-this.x0,S=(b-this.y0)/this.a,M=w/this.a,k=1,T=0,E=0,I=0;for(h=1;h<=6;h++)g=T*S+k*M,k=k*S-T*M,T=g,E=E+this.C_re[h]*k-this.C_im[h]*T,I=I+this.C_im[h]*k+this.C_re[h]*T;for(var P=0;P<this.iterations;P++){var L,B=E,z=I,j=S,D=M;for(h=2;h<=6;h++)L=z*E+B*I,B=B*E-z*I,z=L,j+=(h-1)*(this.B_re[h]*B-this.B_im[h]*z),D+=(h-1)*(this.B_im[h]*B+this.B_re[h]*z);B=1,z=0;var N=this.B_re[1],R=this.B_im[1];for(h=2;h<=6;h++)L=z*E+B*I,B=B*E-z*I,z=L,N+=h*(this.B_re[h]*B-this.B_im[h]*z),R+=h*(this.B_im[h]*B+this.B_re[h]*z);var G=N*N+R*R;E=(j*N+D*R)/G,I=(D*N-j*R)/G}var q=E,W=I,H=1,U=0;for(h=1;h<=9;h++)H*=q,U+=this.D[h]*H;var Y=this.lat0+U*So*1e5,V=this.long0+W;return c.x=V,c.y=Y,c},names:["New_Zealand_Map_Grid","nzmg"]};const Za={init:function mill_init(){},forward:function mill_forward(c){var h=c.x,g=c.y,m=adjust_lon(h-this.long0,this.over),b=this.x0+this.a*m,w=this.y0+this.a*Math.log(Math.tan(Math.PI/4+g/2.5))*1.25;return c.x=b,c.y=w,c},inverse:function mill_inverse(c){c.x-=this.x0,c.y-=this.y0;var h=adjust_lon(this.long0+c.x/this.a,this.over),g=2.5*(Math.atan(Math.exp(.8*c.y/this.a))-Math.PI/4);return c.x=h,c.y=g,c},names:["Miller_Cylindrical","mill"]};const Ja={init:function sinu_init(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=pj_enfn(this.es)},forward:function sinu_forward(c){var h,g,m=c.x,b=c.y;if(m=adjust_lon(m-this.long0,this.over),this.sphere){if(this.m)for(var w=this.n*Math.sin(b),S=20;S;--S){var M=(this.m*b+Math.sin(b)-w)/(this.m+Math.cos(b));if(b-=M,Math.abs(M)<ko)break}else b=1!==this.n?Math.asin(this.n*Math.sin(b)):b;h=this.a*this.C_x*m*(this.m+Math.cos(b)),g=this.a*this.C_y*b}else{var k=Math.sin(b),T=Math.cos(b);g=this.a*pj_mlfn(b,k,T,this.en),h=this.a*m*T/Math.sqrt(1-this.es*k*k)}return c.x=h,c.y=g,c},inverse:function sinu_inverse(c){var h,g,m;return c.x-=this.x0,g=c.x/this.a,c.y-=this.y0,h=c.y/this.a,this.sphere?(h/=this.C_y,g/=this.C_x*(this.m+Math.cos(h)),this.m?h=asinz((this.m*h+Math.sin(h))/this.n):1!==this.n&&(h=asinz(Math.sin(h)/this.n)),g=adjust_lon(g+this.long0,this.over),h=adjust_lat(h)):(h=pj_inv_mlfn(c.y/this.a,this.es,this.en),(m=Math.abs(h))<Mo?(m=Math.sin(h),g=adjust_lon(this.long0+c.x*Math.sqrt(1-this.es*m*m)/(this.a*Math.cos(h)),this.over)):m-ko<Mo&&(g=this.long0)),c.x=g,c.y=h,c},names:["Sinusoidal","sinu"]};const Qa={init:function moll_init(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0},forward:function moll_forward(c){for(var h=c.x,g=c.y,m=adjust_lon(h-this.long0,this.over),b=g,w=Math.PI*Math.sin(g);;){var S=-(b+Math.sin(b)-w)/(1+Math.cos(b));if(b+=S,Math.abs(S)<ko)break}b/=2,Math.PI/2-Math.abs(g)<ko&&(m=0);var M=.900316316158*this.a*m*Math.cos(b)+this.x0,k=1.4142135623731*this.a*Math.sin(b)+this.y0;return c.x=M,c.y=k,c},inverse:function moll_inverse(c){var h,g;c.x-=this.x0,c.y-=this.y0,g=c.y/(1.4142135623731*this.a),Math.abs(g)>.999999999999&&(g=.999999999999),h=Math.asin(g);var m=adjust_lon(this.long0+c.x/(.900316316158*this.a*Math.cos(h)),this.over);m<-Math.PI&&(m=-Math.PI),m>Math.PI&&(m=Math.PI),g=(2*h+Math.sin(2*h))/Math.PI,Math.abs(g)>1&&(g=1);var b=Math.asin(g);return c.x=m,c.y=b,c},names:["Mollweide","moll"]};const ti={init:function eqdc_init(){Math.abs(this.lat1+this.lat2)<ko||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=e0fn(this.es),this.e1=e1fn(this.es),this.e2=e2fn(this.es),this.e3=e3fn(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=msfnz(this.e,this.sin_phi,this.cos_phi),this.ml1=mlfn(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<ko?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=msfnz(this.e,this.sin_phi,this.cos_phi),this.ml2=mlfn(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function eqdc_forward(c){var h,g=c.x,m=c.y;if(this.sphere)h=this.a*(this.g-m);else{var b=mlfn(this.e0,this.e1,this.e2,this.e3,m);h=this.a*(this.g-b)}var w=this.ns*adjust_lon(g-this.long0,this.over),S=this.x0+h*Math.sin(w),M=this.y0+this.rh-h*Math.cos(w);return c.x=S,c.y=M,c},inverse:function eqdc_inverse(c){var h,g,m,b;c.x-=this.x0,c.y=this.rh-c.y+this.y0,this.ns>=0?(g=Math.sqrt(c.x*c.x+c.y*c.y),h=1):(g=-Math.sqrt(c.x*c.x+c.y*c.y),h=-1);var w=0;return 0!==g&&(w=Math.atan2(h*c.x,h*c.y)),this.sphere?(b=adjust_lon(this.long0+w/this.ns,this.over),m=adjust_lat(this.g-g/this.a),c.x=b,c.y=m,c):(m=imlfn(this.g-g/this.a,this.e0,this.e1,this.e2,this.e3),b=adjust_lon(this.long0+w/this.ns,this.over),c.x=b,c.y=m,c)},names:["Equidistant_Conic","eqdc"]};const ei={init:function vandg_init(){this.R=this.a},forward:function vandg_forward(c){var h,g,m=c.x,b=c.y,w=adjust_lon(m-this.long0,this.over);Math.abs(b)<=ko&&(h=this.x0+this.R*w,g=this.y0);var S=asinz(2*Math.abs(b/Math.PI));(Math.abs(w)<=ko||Math.abs(Math.abs(b)-Mo)<=ko)&&(h=this.x0,g=b>=0?this.y0+Math.PI*this.R*Math.tan(.5*S):this.y0+Math.PI*this.R*-Math.tan(.5*S));var M=.5*Math.abs(Math.PI/w-w/Math.PI),k=M*M,T=Math.sin(S),E=Math.cos(S),I=E/(T+E-1),P=I*I,L=I*(2/T-1),B=L*L,z=Math.PI*this.R*(M*(I-B)+Math.sqrt(k*(I-B)*(I-B)-(B+k)*(P-B)))/(B+k);w<0&&(z=-z),h=this.x0+z;var j=k+I;return z=Math.PI*this.R*(L*j-M*Math.sqrt((B+k)*(k+1)-j*j))/(B+k),g=b>=0?this.y0+z:this.y0-z,c.x=h,c.y=g,c},inverse:function vandg_inverse(c){var h,g,m,b,w,S,M,k,T,E,I,P;return c.x-=this.x0,c.y-=this.y0,I=Math.PI*this.R,w=(m=c.x/I)*m+(b=c.y/I)*b,I=3*(b*b/(k=-2*(S=-Math.abs(b)*(1+w))+1+2*b*b+w*w)+(2*(M=S-2*b*b+m*m)*M*M/k/k/k-9*S*M/k/k)/27)/(T=(S-M*M/3/k)/k)/(E=2*Math.sqrt(-T/3)),Math.abs(I)>1&&(I=I>=0?1:-1),P=Math.acos(I)/3,g=c.y>=0?(-E*Math.cos(P+Math.PI/3)-M/3/k)*Math.PI:-(-E*Math.cos(P+Math.PI/3)-M/3/k)*Math.PI,h=Math.abs(m)<ko?this.long0:adjust_lon(this.long0+Math.PI*(w-1+Math.sqrt(1+2*(m*m-b*b)+w*w))/2/m,this.over),c.x=h,c.y=g,c},names:["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"]};const ni={init:function aeqd_init(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))},forward:function aeqd_forward(c){var h,g,m,b,w,S,M,k,T,E,I,P=c.x,L=c.y,B=Math.sin(c.y),z=Math.cos(c.y),j=adjust_lon(P-this.long0,this.over);return this.sphere?Math.abs(this.sin_p12-1)<=ko?(c.x=this.x0+this.a*(Mo-L)*Math.sin(j),c.y=this.y0-this.a*(Mo-L)*Math.cos(j),c):Math.abs(this.sin_p12+1)<=ko?(c.x=this.x0+this.a*(Mo+L)*Math.sin(j),c.y=this.y0+this.a*(Mo+L)*Math.cos(j),c):(T=this.sin_p12*B+this.cos_p12*z*Math.cos(j),k=(M=Math.acos(T))?M/Math.sin(M):1,c.x=this.x0+this.a*k*z*Math.sin(j),c.y=this.y0+this.a*k*(this.cos_p12*B-this.sin_p12*z*Math.cos(j)),c):(h=e0fn(this.es),g=e1fn(this.es),m=e2fn(this.es),b=e3fn(this.es),Math.abs(this.sin_p12-1)<=ko?(w=this.a*mlfn(h,g,m,b,Mo),S=this.a*mlfn(h,g,m,b,L),c.x=this.x0+(w-S)*Math.sin(j),c.y=this.y0-(w-S)*Math.cos(j),c):Math.abs(this.sin_p12+1)<=ko?(w=this.a*mlfn(h,g,m,b,Mo),S=this.a*mlfn(h,g,m,b,L),c.x=this.x0+(w+S)*Math.sin(j),c.y=this.y0+(w+S)*Math.cos(j),c):Math.abs(P)<ko&&Math.abs(L-this.lat0)<ko?(c.x=c.y=0,c):(E=function vincentyInverse(c,h,g,m,b,w){const S=m-h,M=Math.atan((1-w)*Math.tan(c)),k=Math.atan((1-w)*Math.tan(g)),T=Math.sin(M),E=Math.cos(M),I=Math.sin(k),P=Math.cos(k);let L,B,z,j,D,N,R,G,q,W,H,U,Y,V,$,X=S,K=100;do{if(B=Math.sin(X),z=Math.cos(X),j=Math.sqrt(P*B*(P*B)+(E*I-T*P*z)*(E*I-T*P*z)),0===j)return{azi1:0,s12:0};D=T*I+E*P*z,N=Math.atan2(j,D),R=E*P*B/j,G=1-R*R,q=0!==G?D-2*T*I/G:0,W=w/16*G*(4+w*(4-3*G)),L=X,X=S+(1-W)*w*R*(N+W*j*(q+W*D*(2*q*q-1)))}while(Math.abs(X-L)>1e-12&&--K>0);return 0===K?{azi1:NaN,s12:NaN}:(H=G*(b*b-b*(1-w)*(b*(1-w)))/(b*(1-w)*(b*(1-w))),U=1+H/16384*(4096+H*(H*(320-175*H)-768)),Y=H/1024*(256+H*(H*(74-47*H)-128)),V=Y*j*(q+Y/4*(D*(2*q*q-1)-Y/6*q*(4*j*j-3)*(4*q*q-3))),$=b*(1-w)*U*(N-V),{azi1:Math.atan2(P*B,E*I-T*P*z),s12:$})}(this.lat0,this.long0,L,P,this.a,this.f),I=E.azi1,c.x=E.s12*Math.sin(I),c.y=E.s12*Math.cos(I),c))},inverse:function aeqd_inverse(c){var h,g,m,b,w,S,M,k,T,E,I,P,L,B,z;if(c.x-=this.x0,c.y-=this.y0,this.sphere){if((h=Math.sqrt(c.x*c.x+c.y*c.y))>2*Mo*this.a)return;return g=h/this.a,m=Math.sin(g),b=Math.cos(g),w=this.long0,Math.abs(h)<=ko?S=this.lat0:(S=asinz(b*this.sin_p12+c.y*m*this.cos_p12/h),M=Math.abs(this.lat0)-Mo,w=Math.abs(M)<=ko?this.lat0>=0?adjust_lon(this.long0+Math.atan2(c.x,-c.y),this.over):adjust_lon(this.long0-Math.atan2(-c.x,c.y),this.over):adjust_lon(this.long0+Math.atan2(c.x*m,h*this.cos_p12*b-c.y*this.sin_p12*m),this.over)),c.x=w,c.y=S,c}return k=e0fn(this.es),T=e1fn(this.es),E=e2fn(this.es),I=e3fn(this.es),Math.abs(this.sin_p12-1)<=ko?(S=imlfn(((P=this.a*mlfn(k,T,E,I,Mo))-(h=Math.sqrt(c.x*c.x+c.y*c.y)))/this.a,k,T,E,I),w=adjust_lon(this.long0+Math.atan2(c.x,-1*c.y),this.over),c.x=w,c.y=S,c):Math.abs(this.sin_p12+1)<=ko?(P=this.a*mlfn(k,T,E,I,Mo),S=imlfn(((h=Math.sqrt(c.x*c.x+c.y*c.y))-P)/this.a,k,T,E,I),w=adjust_lon(this.long0+Math.atan2(c.x,c.y),this.over),c.x=w,c.y=S,c):(L=Math.atan2(c.x,c.y),B=Math.sqrt(c.x*c.x+c.y*c.y),z=function vincentyDirect(c,h,g,m,b,w){const S=Math.atan((1-w)*Math.tan(c)),M=Math.sin(S),k=Math.cos(S),T=Math.sin(g),E=Math.cos(g),I=Math.atan2(M,k*E),P=k*T,L=1-P*P,B=L*(b*b-b*(1-w)*(b*(1-w)))/(b*(1-w)*(b*(1-w))),z=1+B/16384*(4096+B*(B*(320-175*B)-768)),j=B/1024*(256+B*(B*(74-47*B)-128));let D,N,R,G,q,W=m/(b*(1-w)*z),H=100;do{N=Math.cos(2*I+W),R=Math.sin(W),G=Math.cos(W),q=j*R*(N+j/4*(G*(2*N*N-1)-j/6*N*(4*R*R-3)*(4*N*N-3))),D=W,W=m/(b*(1-w)*z)+q}while(Math.abs(W-D)>1e-12&&--H>0);if(0===H)return{lat2:NaN,lon2:NaN};const U=M*R-k*G*E,Y=w/16*L*(4+w*(4-3*L));return{lat2:Math.atan2(M*G+k*R*E,(1-w)*Math.sqrt(P*P+U*U)),lon2:h+(Math.atan2(R*T,k*G-M*R*E)-(1-Y)*w*P*(W+Y*R*(N+Y*G*(2*N*N-1))))}}(this.lat0,this.long0,L,B,this.a,this.f),c.x=z.lon2,c.y=z.lat2,c)},names:["Azimuthal_Equidistant","aeqd"]};const ri={init:function ortho_init(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function ortho_forward(c){var h,g,m,b,w,S,M,k=c.x,T=c.y;return m=adjust_lon(k-this.long0,this.over),h=Math.sin(T),g=Math.cos(T),b=Math.cos(m),((w=this.sin_p14*h+this.cos_p14*g*b)>0||Math.abs(w)<=ko)&&(S=1*this.a*g*Math.sin(m),M=this.y0+1*this.a*(this.cos_p14*h-this.sin_p14*g*b)),c.x=S,c.y=M,c},inverse:function ortho_inverse(c){var h,g,m,b,w,S,M;return c.x-=this.x0,c.y-=this.y0,g=asinz((h=Math.sqrt(c.x*c.x+c.y*c.y))/this.a),m=Math.sin(g),b=Math.cos(g),S=this.long0,Math.abs(h)<=ko?(M=this.lat0,c.x=S,c.y=M,c):(M=asinz(b*this.sin_p14+c.y*m*this.cos_p14/h),w=Math.abs(this.lat0)-Mo,Math.abs(w)<=ko?(S=this.lat0>=0?adjust_lon(this.long0+Math.atan2(c.x,-c.y),this.over):adjust_lon(this.long0-Math.atan2(-c.x,c.y),this.over),c.x=S,c.y=M,c):(S=adjust_lon(this.long0+Math.atan2(c.x*m,h*this.cos_p14*b-c.y*this.sin_p14*m),this.over),c.x=S,c.y=M,c))},names:["ortho"]};var oi=1,ai=2,ii=3,si=4,li=5,ci=6,ui=1,hi=2,di=3,pi=4;function qsc_fwd_equat_face_theta(c,h,g,m){var b;return c<ko?(m.value=ui,b=0):(b=Math.atan2(h,g),Math.abs(b)<=Io?m.value=ui:b>Io&&b<=Mo+Io?(m.value=hi,b-=Mo):b>Mo+Io||b<=-(Mo+Io)?(m.value=di,b=b>=0?b-Lo:b+Lo):(m.value=pi,b+=Mo)),b}function qsc_shift_lon_origin(c,h){var g=c+h;return g<-Lo?g+=Po:g>+Lo&&(g-=Po),g}const fi={init:function qsc_init(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Mo-Io/2?this.face=li:this.lat0<=-(Mo-Io/2)?this.face=ci:Math.abs(this.long0)<=Io?this.face=oi:Math.abs(this.long0)<=Mo+Io?this.face=this.long0>0?ai:si:this.face=ii,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function qsc_forward(c){var h,g,m,b,w,S,M={x:0,y:0},k={value:0};if(c.x-=this.long0,h=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(c.y)):c.y,g=c.x,this.face===li)b=Mo-h,g>=Io&&g<=Mo+Io?(k.value=ui,m=g-Mo):g>Mo+Io||g<=-(Mo+Io)?(k.value=hi,m=g>0?g-Lo:g+Lo):g>-(Mo+Io)&&g<=-Io?(k.value=di,m=g+Mo):(k.value=pi,m=g);else if(this.face===ci)b=Mo+h,g>=Io&&g<=Mo+Io?(k.value=ui,m=-g+Mo):g<Io&&g>=-Io?(k.value=hi,m=-g):g<-Io&&g>=-(Mo+Io)?(k.value=di,m=-g-Mo):(k.value=pi,m=g>0?-g+Lo:-g-Lo);else{var T,E,I,P,L,B;this.face===ai?g=qsc_shift_lon_origin(g,+Mo):this.face===ii?g=qsc_shift_lon_origin(g,+Lo):this.face===si&&(g=qsc_shift_lon_origin(g,-Mo)),P=Math.sin(h),L=Math.cos(h),B=Math.sin(g),T=L*Math.cos(g),E=L*B,I=P,this.face===oi?m=qsc_fwd_equat_face_theta(b=Math.acos(T),I,E,k):this.face===ai?m=qsc_fwd_equat_face_theta(b=Math.acos(E),I,-T,k):this.face===ii?m=qsc_fwd_equat_face_theta(b=Math.acos(-T),I,-E,k):this.face===si?m=qsc_fwd_equat_face_theta(b=Math.acos(-E),I,T,k):(b=m=0,k.value=ui)}return S=Math.atan(12/Lo*(m+Math.acos(Math.sin(m)*Math.cos(Io))-Mo)),w=Math.sqrt((1-Math.cos(b))/(Math.cos(S)*Math.cos(S))/(1-Math.cos(Math.atan(1/Math.cos(m))))),k.value===hi?S+=Mo:k.value===di?S+=Lo:k.value===pi&&(S+=1.5*Lo),M.x=w*Math.cos(S),M.y=w*Math.sin(S),M.x=M.x*this.a+this.x0,M.y=M.y*this.a+this.y0,c.x=M.x,c.y=M.y,c},inverse:function qsc_inverse(c){var h,g,m,b,w,S,M,k,T,E,I,P,L={lam:0,phi:0},B={value:0};if(c.x=(c.x-this.x0)/this.a,c.y=(c.y-this.y0)/this.a,g=Math.atan(Math.sqrt(c.x*c.x+c.y*c.y)),h=Math.atan2(c.y,c.x),c.x>=0&&c.x>=Math.abs(c.y)?B.value=ui:c.y>=0&&c.y>=Math.abs(c.x)?(B.value=hi,h-=Mo):c.x<0&&-c.x>=Math.abs(c.y)?(B.value=di,h=h<0?h+Lo:h-Lo):(B.value=pi,h+=Mo),T=Lo/12*Math.tan(h),w=Math.sin(T)/(Math.cos(T)-1/Math.sqrt(2)),S=Math.atan(w),(M=1-(m=Math.cos(h))*m*(b=Math.tan(g))*b*(1-Math.cos(Math.atan(1/Math.cos(S)))))<-1?M=-1:M>1&&(M=1),this.face===li)k=Math.acos(M),L.phi=Mo-k,B.value===ui?L.lam=S+Mo:B.value===hi?L.lam=S<0?S+Lo:S-Lo:B.value===di?L.lam=S-Mo:L.lam=S;else if(this.face===ci)k=Math.acos(M),L.phi=k-Mo,B.value===ui?L.lam=-S+Mo:B.value===hi?L.lam=-S:B.value===di?L.lam=-S-Mo:L.lam=S<0?-S-Lo:-S+Lo;else{var z,j,D;T=(z=M)*z,j=(T+=(D=T>=1?0:Math.sqrt(1-T)*Math.sin(S))*D)>=1?0:Math.sqrt(1-T),B.value===hi?(T=j,j=-D,D=T):B.value===di?(j=-j,D=-D):B.value===pi&&(T=j,j=D,D=-T),this.face===ai?(T=z,z=-j,j=T):this.face===ii?(z=-z,j=-j):this.face===si&&(T=z,z=j,j=-T),L.phi=Math.acos(-D)-Mo,L.lam=Math.atan2(j,z),this.face===ai?L.lam=qsc_shift_lon_origin(L.lam,-Mo):this.face===ii?L.lam=qsc_shift_lon_origin(L.lam,-Lo):this.face===si&&(L.lam=qsc_shift_lon_origin(L.lam,+Mo))}return 0!==this.es&&(E=L.phi<0?1:0,I=Math.tan(L.phi),P=this.b/Math.sqrt(I*I+this.one_minus_f_squared),L.phi=Math.atan(Math.sqrt(this.a*this.a-P*P)/(this.one_minus_f*P)),E&&(L.phi=-L.phi)),L.lam+=this.long0,c.x=L.lam,c.y=L.phi,c},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};var gi=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],_i=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],mi=.8487,vi=1.3523,yi=Eo/5,Ai=1/yi,bi=18,poly3_val=function(c,h){return c[0]+h*(c[1]+h*(c[2]+h*c[3]))};const wi={init:function robin_init(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function robin_forward(c){var h=adjust_lon(c.x-this.long0,this.over),g=Math.abs(c.y),m=Math.floor(g*yi);m<0?m=0:m>=bi&&(m=17);var b={x:poly3_val(gi[m],g=Eo*(g-Ai*m))*h,y:poly3_val(_i[m],g)};return c.y<0&&(b.y=-b.y),b.x=b.x*this.a*mi+this.x0,b.y=b.y*this.a*vi+this.y0,b},inverse:function robin_inverse(c){var h={x:(c.x-this.x0)/(this.a*mi),y:Math.abs(c.y-this.y0)/(this.a*vi)};if(h.y>=1)h.x/=gi[18][0],h.y=c.y<0?-Mo:Mo;else{var g=Math.floor(h.y*bi);for(g<0?g=0:g>=bi&&(g=17);;)if(_i[g][0]>h.y)--g;else{if(!(_i[g+1][0]<=h.y))break;++g}var m=_i[g],b=5*(h.y-m[0])/(_i[g+1][0]-m[0]);b=function newton_rapshon(c,h,g,m){for(var b=h;m;--m){var w=c(b);if(b-=w,Math.abs(w)<g)break}return b}(function(c){return(poly3_val(m,c)-h.y)/function(c,h){return c[1]+h*(2*c[2]+3*h*c[3])}(m,c)},b,ko,100),h.x/=poly3_val(gi[g],b),h.y=(5*g+b)*To,c.y<0&&(h.y=-h.y)}return h.x=adjust_lon(h.x+this.long0,this.over),h},names:["Robinson","robin"]};const Ci={init:function geocent_init(){this.name="geocent"},forward:function geocent_forward(c){return geodeticToGeocentric(c,this.es,this.a)},inverse:function geocent_inverse(c){return geocentricToGeodetic(c,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};var Si=0,Mi=1,ki=2,Ti=3,Ei={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};const Ii={init:function tpers_init(){if(Object.keys(Ei).forEach(function(c){if(void 0===this[c])this[c]=Ei[c].def;else{if(Ei[c].num&&isNaN(this[c]))throw new Error("Invalid parameter value, must be numeric "+c+" = "+this[c]);Ei[c].num&&(this[c]=parseFloat(this[c]))}Ei[c].degrees&&(this[c]=this[c]*To)}.bind(this)),Math.abs(Math.abs(this.lat0)-Mo)<ko?this.mode=this.lat0<0?Mi:Si:Math.abs(this.lat0)<ko?this.mode=ki:(this.mode=Ti,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var c=this.tilt,h=this.azi;this.cg=Math.cos(h),this.sg=Math.sin(h),this.cw=Math.cos(c),this.sw=Math.sin(c)},forward:function tpers_forward(c){c.x-=this.long0;var h,g,m,b,w=Math.sin(c.y),S=Math.cos(c.y),M=Math.cos(c.x);switch(this.mode){case Ti:g=this.sinph0*w+this.cosph0*S*M;break;case ki:g=S*M;break;case Mi:g=-w;break;case Si:g=w}switch(h=(g=this.pn1/(this.p-g))*S*Math.sin(c.x),this.mode){case Ti:g*=this.cosph0*w-this.sinph0*S*M;break;case ki:g*=w;break;case Si:g*=-S*M;break;case Mi:g*=S*M}return b=1/((m=g*this.cg+h*this.sg)*this.sw*this.h1+this.cw),h=(h*this.cg-g*this.sg)*this.cw*b,g=m*b,c.x=h*this.a,c.y=g*this.a,c},inverse:function tpers_inverse(c){c.x/=this.a,c.y/=this.a;var h,g,m,b={x:c.x,y:c.y};m=1/(this.pn1-c.y*this.sw),h=this.pn1*c.x*m,g=this.pn1*c.y*this.cw*m,c.x=h*this.cg+g*this.sg,c.y=g*this.cg-h*this.sg;var w=common_hypot(c.x,c.y);if(Math.abs(w)<ko)b.x=0,b.y=c.y;else{var S,M;switch(M=1-w*w*this.pfact,M=(this.p-Math.sqrt(M))/(this.pn1/w+w/this.pn1),S=Math.sqrt(1-M*M),this.mode){case Ti:b.y=Math.asin(S*this.sinph0+c.y*M*this.cosph0/w),c.y=(S-this.sinph0*Math.sin(b.y))*w,c.x*=M*this.cosph0;break;case ki:b.y=Math.asin(c.y*M/w),c.y=S*w,c.x*=M;break;case Si:b.y=Math.asin(S),c.y=-c.y;break;case Mi:b.y=-Math.asin(S)}b.x=Math.atan2(c.x,c.y)}return c.x=b.x+this.long0,c.y=b.y,c},names:["Tilted_Perspective","tpers"]};const Pi={init:function geos_init(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var c=1-this.es,h=1/c;this.radius_p=Math.sqrt(c),this.radius_p2=c,this.radius_p_inv2=h,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function geos_forward(c){var h,g,m,b,w=c.x,S=c.y;if(w-=this.long0,"ellipse"===this.shape){S=Math.atan(this.radius_p2*Math.tan(S));var M=this.radius_p/common_hypot(this.radius_p*Math.cos(S),Math.sin(S));if(g=M*Math.cos(w)*Math.cos(S),m=M*Math.sin(w)*Math.cos(S),b=M*Math.sin(S),(this.radius_g-g)*g-m*m-b*b*this.radius_p_inv2<0)return c.x=Number.NaN,c.y=Number.NaN,c;h=this.radius_g-g,this.flip_axis?(c.x=this.radius_g_1*Math.atan(m/common_hypot(b,h)),c.y=this.radius_g_1*Math.atan(b/h)):(c.x=this.radius_g_1*Math.atan(m/h),c.y=this.radius_g_1*Math.atan(b/common_hypot(m,h)))}else"sphere"===this.shape&&(h=Math.cos(S),g=Math.cos(w)*h,m=Math.sin(w)*h,b=Math.sin(S),h=this.radius_g-g,this.flip_axis?(c.x=this.radius_g_1*Math.atan(m/common_hypot(b,h)),c.y=this.radius_g_1*Math.atan(b/h)):(c.x=this.radius_g_1*Math.atan(m/h),c.y=this.radius_g_1*Math.atan(b/common_hypot(m,h))));return c.x=c.x*this.a,c.y=c.y*this.a,c},inverse:function geos_inverse(c){var h,g,m,b,w=-1,S=0,M=0;if(c.x=c.x/this.a,c.y=c.y/this.a,"ellipse"===this.shape){this.flip_axis?(M=Math.tan(c.y/this.radius_g_1),S=Math.tan(c.x/this.radius_g_1)*common_hypot(1,M)):(S=Math.tan(c.x/this.radius_g_1),M=Math.tan(c.y/this.radius_g_1)*common_hypot(1,S));var k=M/this.radius_p;if(h=S*S+k*k+w*w,(m=(g=2*this.radius_g*w)*g-4*h*this.C)<0)return c.x=Number.NaN,c.y=Number.NaN,c;b=(-g-Math.sqrt(m))/(2*h),w=this.radius_g+b*w,S*=b,M*=b,c.x=Math.atan2(S,w),c.y=Math.atan(M*Math.cos(c.x)/w),c.y=Math.atan(this.radius_p_inv2*Math.tan(c.y))}else if("sphere"===this.shape){if(this.flip_axis?(M=Math.tan(c.y/this.radius_g_1),S=Math.tan(c.x/this.radius_g_1)*Math.sqrt(1+M*M)):(S=Math.tan(c.x/this.radius_g_1),M=Math.tan(c.y/this.radius_g_1)*Math.sqrt(1+S*S)),h=S*S+M*M+w*w,(m=(g=2*this.radius_g*w)*g-4*h*this.C)<0)return c.x=Number.NaN,c.y=Number.NaN,c;b=(-g-Math.sqrt(m))/(2*h),w=this.radius_g+b*w,S*=b,M*=b,c.x=Math.atan2(S,w),c.y=Math.atan(M*Math.cos(c.x)/w)}return c.x=c.x+this.long0,c},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};var Li=1.340264,Fi=-.081106,Bi=893e-6,Oi=.003796,zi=Math.sqrt(3)/2;const ji={init:function eqearth_init(){this.es=0,this.long0=void 0!==this.long0?this.long0:0,this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0},forward:function eqearth_forward(c){var h=adjust_lon(c.x-this.long0,this.over),g=c.y,m=Math.asin(zi*Math.sin(g)),b=m*m,w=b*b*b;return c.x=h*Math.cos(m)/(zi*(Li+3*Fi*b+w*(7*Bi+9*Oi*b))),c.y=m*(Li+Fi*b+w*(Bi+Oi*b)),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function eqearth_inverse(c){c.x=(c.x-this.x0)/this.a,c.y=(c.y-this.y0)/this.a;var h,g,m,b,w=c.y;for(b=0;b<12&&(w-=m=(w*(Li+Fi*(h=w*w)+(g=h*h*h)*(Bi+Oi*h))-c.y)/(Li+3*Fi*h+g*(7*Bi+9*Oi*h)),!(Math.abs(m)<1e-9));++b);return g=(h=w*w)*h*h,c.x=zi*c.x*(Li+3*Fi*h+g*(7*Bi+9*Oi*h))/Math.cos(w),c.y=Math.asin(Math.sin(w)/zi),c.x=adjust_lon(c.x+this.long0,this.over),c},names:["eqearth","Equal Earth","Equal_Earth"]};var Di=1e-10;function e_fwd(c){var h,g,m,b=adjust_lon(c.x-(this.long0||0),this.over),w=c.y;return h=this.am1+this.m1-pj_mlfn(w,g=Math.sin(w),m=Math.cos(w),this.en),g=m*b/(h*Math.sqrt(1-this.es*g*g)),c.x=h*Math.sin(g),c.y=this.am1-h*Math.cos(g),c.x=this.a*c.x+(this.x0||0),c.y=this.a*c.y+(this.y0||0),c}function e_inv(c){var h,g,m,b;if(c.x=(c.x-(this.x0||0))/this.a,c.y=(c.y-(this.y0||0))/this.a,g=common_hypot(c.x,c.y=this.am1-c.y),b=pj_inv_mlfn(this.am1+this.m1-g,this.es,this.en),(h=Math.abs(b))<Mo)h=Math.sin(b),m=g*Math.atan2(c.x,c.y)*Math.sqrt(1-this.es*h*h)/Math.cos(b);else{if(!(Math.abs(h-Mo)<=Di))throw new Error;m=0}return c.x=adjust_lon(m+(this.long0||0),this.over),c.y=adjust_lat(b),c}function s_fwd(c){var h,g,m=adjust_lon(c.x-(this.long0||0),this.over),b=c.y;return g=this.cphi1+this.phi1-b,Math.abs(g)>Di?(c.x=g*Math.sin(h=m*Math.cos(b)/g),c.y=this.cphi1-g*Math.cos(h)):c.x=c.y=0,c.x=this.a*c.x+(this.x0||0),c.y=this.a*c.y+(this.y0||0),c}function s_inv(c){var h,g;c.x=(c.x-(this.x0||0))/this.a,c.y=(c.y-(this.y0||0))/this.a;var m=common_hypot(c.x,c.y=this.cphi1-c.y);if(g=this.cphi1+this.phi1-m,Math.abs(g)>Mo)throw new Error;return h=Math.abs(Math.abs(g)-Mo)<=Di?0:m*Math.atan2(c.x,c.y)/Math.cos(g),c.x=adjust_lon(h+(this.long0||0),this.over),c.y=adjust_lat(g),c}const Ni={init:function bonne_init(){var c;if(this.phi1=this.lat1,Math.abs(this.phi1)<Di)throw new Error;this.es?(this.en=pj_enfn(this.es),this.m1=pj_mlfn(this.phi1,this.am1=Math.sin(this.phi1),c=Math.cos(this.phi1),this.en),this.am1=c/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=e_inv,this.forward=e_fwd):(Math.abs(this.phi1)+Di>=Mo?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=s_inv,this.forward=s_fwd)},names:["bonne","Bonne (Werner lat_1=90)"]},Ri={OBLIQUE:{forward:function forwardOblique(c,h){let{x:g,y:m}=h;g+=c.long0;const b=Math.cos(g),w=Math.sin(m),S=Math.cos(m);h.x=adjust_lon(Math.atan2(S*Math.sin(g),c.sphip*S*b+c.cphip*w)+c.lamp),h.y=Math.asin(c.sphip*w-c.cphip*S*b);const M=c.obliqueProjection.forward(h);c.isIdentity&&(M.x*=Eo,M.y*=Eo);return M},inverse:function inverseOblique(c,h){c.isIdentity&&(h.x*=To,h.y*=To);const g=c.obliqueProjection.inverse(h);let{x:m,y:b}=g;if(m<Number.MAX_VALUE){m-=c.lamp;const g=Math.cos(m),w=Math.sin(b),S=Math.cos(b);h.x=Math.atan2(S*Math.sin(m),c.sphip*S*g-c.cphip*w),h.y=Math.asin(c.sphip*w+c.cphip*S*g)}return h.x=adjust_lon(h.x+c.long0),h}},TRANSVERSE:{forward:function forwardTransverse(c,h){let{x:g,y:m}=h;g+=c.long0;const b=Math.cos(m),w=Math.cos(g);h.x=adjust_lon(Math.atan2(b*Math.sin(g),Math.sin(m))+c.lamp),h.y=Math.asin(-1*b*w);const S=c.obliqueProjection.forward(h);c.isIdentity&&(S.x*=Eo,S.y*=Eo);return S},inverse:function inverseTransverse(c,h){c.isIdentity&&(h.x*=To,h.y*=To);const g=c.obliqueProjection.inverse(h);let{x:m,y:b}=g;if(m<Number.MAX_VALUE){const g=Math.cos(b);m-=c.lamp,h.x=Math.atan2(g*Math.sin(m),-1*Math.sin(b)),h.y=Math.asin(g*Math.cos(m))}return h.x=adjust_lon(h.x+c.long0),h}}},Gi={ROTATE:{o_alpha:"oAlpha",o_lon_c:"oLongC",o_lat_c:"oLatC"},NEW_POLE:{o_lat_p:"oLatP",o_lon_p:"oLongP"},NEW_EQUATOR:{o_lon_1:"oLong1",o_lat_1:"oLat1",o_lon_2:"oLong2",o_lat_2:"oLat2"}};const qi={init:function ob_tran_init(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||"General Oblique Transformation",this.isIdentity=Jo.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if("ob_tran"===this.o_proj)throw new Error("Invalid value for o_proj: "+this.o_proj);const c=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),h=ha(c);if(!h)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);let g;h.long0=0,this.obliqueProjection=h;const m=Object.keys(Gi),parseParam=c=>{if(void 0===this[c])return;const h=parseFloat(this[c])*To;if(isNaN(h))throw new Error("Invalid value for "+c+": "+this[c]);return h};for(let c=0;c<m.length;c++){const h=m[c],b=Gi[h],w=Object.entries(b);if(w.some(([c])=>void 0!==this[c])){g=b;for(let c=0;c<w.length;c++){const[h,g]=w[c],m=parseParam(h);if(void 0===m)throw new Error("Missing parameter: "+h+".");this[g]=m}break}}if(!g)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:b,phip:w}=function createRotation(c,h){let g,m;if(h===Gi.ROTATE){let h=c.oLongC,b=c.oLatC,w=c.oAlpha;if(Math.abs(Math.abs(b)-Mo)<=ko)throw new Error("Invalid value for o_lat_c: "+c.o_lat_c+" should be < 90°");m=h+Math.atan2(-1*Math.cos(w),-1*Math.sin(w)*Math.sin(b)),g=Math.asin(Math.cos(b)*Math.sin(w))}else if(h===Gi.NEW_POLE)m=c.oLongP,g=c.oLatP;else{let h=c.oLong1,b=c.oLat1,w=c.oLong2,S=c.oLat2,M=Math.abs(b);if(Math.abs(b)>Mo-ko)throw new Error("Invalid value for o_lat_1: "+c.o_lat_1+" should be < 90°");if(Math.abs(S)>Mo-ko)throw new Error("Invalid value for o_lat_2: "+c.o_lat_2+" should be < 90°");if(Math.abs(b-S)<ko)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(M<ko)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");m=Math.atan2(Math.cos(b)*Math.sin(S)*Math.cos(h)-Math.sin(b)*Math.cos(S)*Math.cos(w),Math.sin(b)*Math.cos(S)*Math.sin(w)-Math.cos(b)*Math.sin(S)*Math.sin(h)),g=Math.atan(-1*Math.cos(m-h)/Math.tan(b))}return{lamp:m,phip:g}}(this,g);this.lamp=b,Math.abs(w)>ko?(this.cphip=Math.cos(w),this.sphip=Math.sin(w),this.projectionType=Ri.OBLIQUE):this.projectionType=Ri.TRANSVERSE},forward:function ob_tran_forward(c){return this.projectionType.forward(this,c)},inverse:function ob_tran_inverse(c){return this.projectionType.inverse(this,c)},names:["General Oblique Transformation","General_Oblique_Transformation","ob_tran"]};const Wi=Object.assign(pa,{defaultDatum:"WGS84",Proj:ha,WGS84:new ha("WGS84"),Point:xa,toPoint,defs:$o,nadgrid:function nadgrid(c,h,g){return h instanceof ArrayBuffer?function readNTV2Grid(c,h,g){var m=!0;void 0!==g&&!1===g.includeErrorFields&&(m=!1);var b=new DataView(h),w=function detectLittleEndian(c){var h=c.getInt32(8,!1);if(11===h)return!1;h=c.getInt32(8,!0),11!==h&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian");return!0}(b),S=function readHeader(c,h){return{nFields:c.getInt32(8,h),nSubgridFields:c.getInt32(24,h),nSubgrids:c.getInt32(40,h),shiftType:decodeString(c,56,64).trim(),fromSemiMajorAxis:c.getFloat64(120,h),fromSemiMinorAxis:c.getFloat64(136,h),toSemiMajorAxis:c.getFloat64(152,h),toSemiMinorAxis:c.getFloat64(168,h)}}(b,w),M=function readSubgrids(c,h,g,m){for(var b=176,w=[],S=0;S<h.nSubgrids;S++){var M=readGridHeader(c,b,g),k=readGridNodes(c,b,M,g,m),T=Math.round(1+(M.upperLongitude-M.lowerLongitude)/M.longitudeInterval),E=Math.round(1+(M.upperLatitude-M.lowerLatitude)/M.latitudeInterval);w.push({ll:[secondsToRadians(M.lowerLongitude),secondsToRadians(M.lowerLatitude)],del:[secondsToRadians(M.longitudeInterval),secondsToRadians(M.latitudeInterval)],lim:[T,E],count:M.gridNodeCount,cvs:mapNodes(k)});var I=16;!1===m&&(I=8),b+=176+M.gridNodeCount*I}return w}(b,S,w,m),k={header:S,subgrids:M};return ua[c]=k,k}(c,h,g):{ready:readGeotiffGrid(c,h)}},transform:transform_transform,mgrs:ba,version:"__VERSION__"});!function proj4_projs(c){c.Proj.projections.add(Ma),c.Proj.projections.add(ka),c.Proj.projections.add(Ta),c.Proj.projections.add(Ia),c.Proj.projections.add(Pa),c.Proj.projections.add(La),c.Proj.projections.add(Ba),c.Proj.projections.add(Oa),c.Proj.projections.add(za),c.Proj.projections.add(ja),c.Proj.projections.add(Ha),c.Proj.projections.add(Ua),c.Proj.projections.add(Ya),c.Proj.projections.add(Va),c.Proj.projections.add($a),c.Proj.projections.add(Xa),c.Proj.projections.add(Ka),c.Proj.projections.add(Za),c.Proj.projections.add(Ja),c.Proj.projections.add(Qa),c.Proj.projections.add(ti),c.Proj.projections.add(ei),c.Proj.projections.add(ni),c.Proj.projections.add(ri),c.Proj.projections.add(fi),c.Proj.projections.add(wi),c.Proj.projections.add(Ci),c.Proj.projections.add(Ii),c.Proj.projections.add(Pi),c.Proj.projections.add(ji),c.Proj.projections.add(Ni),c.Proj.projections.add(qi)}(Wi);const Hi=Wi;var Ui=function appendMinimap(c){var h;if(c.svg_){if(c.minimap_.size||(c.minimap_.size=150),c.Geometries.geoJSONs.worldrg)$i(c);else json(window.location.hostname.includes("ec.europa.eu")?"https://ec.europa.eu/assets/estat/E/E4/gisco/eurostat-map/world-topo-2024-60M-4326.json":"https://raw.githubusercontent.com/eurostat/eurostat-map/master/src/assets/topojson/world-topo-60M.json").then(function(h){var g=feature(h,h.objects.CNTR_RG_60M_2024_4326).features;c.Geometries.geoJSONs.worldrg=g,$i(c)}).catch(function(c){return console.error("Failed to load world-topo-60M.json",c)});window.addEventListener("estatmap:zoomed-"+c.svgId_,function debounce(c,h){var g;return function(){for(var m=arguments.length,b=new Array(m),w=0;w<m;w++)b[w]=arguments[w];clearTimeout(g),g=setTimeout(function(){return c.apply(void 0,b)},h)}}(function(c){return Yi(c.detail)},(null===(h=c.minimap_)||void 0===h?void 0:h.debounce)||3))}},Yi=function onMiniUpdate(c){applyMinimapRotation(c),applyMinimapScale(c),c._minimapGlobe.selectAll("path").attr("d",c._minimapPath)};function normalizeLon(c){return(c+540)%360-180}function applyMinimapRotation(c){var h=function getLonLatFromMapPosition(c){var h,g,m=null===(h=c.position_)||void 0===h?void 0:h.x,b=null===(g=c.position_)||void 0===g?void 0:g.y;if(!Number.isFinite(m)||!Number.isFinite(b))return null;if("3035"===c.proj_){var w=slicedToArray_slicedToArray(Hi("EPSG:3035","EPSG:4326",[m,b]),2);m=w[0],b=w[1]}else if("54030"===c.proj_){var S=slicedToArray_slicedToArray(Hi("EPSG:54030","EPSG:4326",[m,b]),2);m=S[0],b=S[1]}return[m,b]}(c);if(h){var g=slicedToArray_slicedToArray(h,2),m=g[0],b=g[1];c._minimapProjection.rotate([-normalizeLon(m),-b,0])}}function applyMinimapScale(c){var h,g=c._minimapBaseScale||c._minimapProjection.scale(),m=c._lastZoomK||(null===(h=c.__lastTransform)||void 0===h?void 0:h.k)||1,b=g*Math.pow(m,.65)*.9,w=.35*g,S=5*g;c._minimapProjection.scale(Math.max(w,Math.min(S,b)))}var Vi=function defineMinimapProjection(c){var h,g=(null===(h=c.minimap_)||void 0===h?void 0:h.z)||160;c._minimapProjection=function orthographic(){return projection_projection(orthographicRaw).scale(249.5).clipAngle(90.000001)}().scale(g).translate([0,0]),c._minimapPath=src_path().projection(c._minimapProjection),c._minimapBaseScale=c._minimapProjection.scale(),applyMinimapRotation(c),applyMinimapScale(c)},$i=function drawMinimap(c){try{var h=c.minimap_||{},g=h.x||80,m=h.y||80,b=h.color||"#929292ff",w=h.size||160,S=c.Geometries.geoJSONs.worldrg;if(c._minimapContainer=c.svg_.append("g").attr("id","em-minimap").attr("transform","translate(".concat(g,",").concat(m,")")),c._minimapContainer.append("circle").attr("class","em-minimap-inner-circle").attr("r",w/2).attr("cx",0).attr("cy",0).attr("fill","white").attr("filter","url(#em-minimap-inner-shadow)"),Vi(c),function addDefsToMinimap(c,h){var g=c._minimapContainer.append("defs");(function addInnerShadowToDefs(c){var h=c.append("filter").attr("id","em-minimap-inner-shadow").attr("x","-50%").attr("y","-50%").attr("width","200%").attr("height","200%").attr("color-interpolation-filters","sRGB");h.append("feGaussianBlur").attr("in","SourceAlpha").attr("stdDeviation",3).attr("result","blur"),h.append("feOffset").attr("in","blur").attr("dx",0).attr("dy",0).attr("result","off"),h.append("feComposite").attr("in","SourceAlpha").attr("in2","off").attr("operator","arithmetic").attr("k2","1").attr("k3","-1").attr("result","inner"),h.append("feFlood").attr("flood-color","#000").attr("flood-opacity",.4),h.append("feComposite").attr("in2","inner").attr("operator","in").attr("result","shadow"),h.append("feBlend").attr("in","SourceGraphic").attr("in2","shadow").attr("mode","multiply")})(g),g.append("clipPath").attr("id","minimap-clip").append("circle").attr("r",h/2-3).attr("cx",0).attr("cy",0)}(c,w),c._minimapGlobe=c._minimapContainer.append("g").attr("class","em-minimap-globe").attr("clip-path","url(#minimap-clip)"),c._minimapGlobe.selectAll("path.country").data(S).enter().append("path").attr("d",c._minimapPath).attr("fill","#e0e0e0"),h.highlightIds&&Array.isArray(h.highlightIds)){var M=S.filter(function(c){return h.highlightIds.includes(c.id)});M.length&&M.forEach(function(h){c._minimapGlobe.append("path").datum(h).attr("d",c._minimapPath).attr("fill",b).attr("stroke",b).attr("stroke-width",.5)})}c._minimapContainer.append("circle").attr("class","em-minimap-outer-circle").attr("r",w/2).attr("cx",0).attr("cy",0).attr("fill","none").attr("stroke",b).attr("stroke-width",3),Yi(c)}catch(c){console.error("Error drawing minimap:",c)}};var Xi={value:()=>{}};function src_dispatch_dispatch(){for(var c,h=0,g=arguments.length,m={};h<g;++h){if(!(c=arguments[h]+"")||c in m||/[\s.]/.test(c))throw new Error("illegal type: "+c);m[c]=[]}return new dispatch_Dispatch(m)}function dispatch_Dispatch(c){this._=c}function dispatch_get(c,h){for(var g,m=0,b=c.length;m<b;++m)if((g=c[m]).name===h)return g.value}function dispatch_set(c,h,g){for(var m=0,b=c.length;m<b;++m)if(c[m].name===h){c[m]=Xi,c=c.slice(0,m).concat(c.slice(m+1));break}return null!=g&&c.push({name:h,value:g}),c}dispatch_Dispatch.prototype=src_dispatch_dispatch.prototype={constructor:dispatch_Dispatch,on:function(c,h){var g,m=this._,b=function src_dispatch_parseTypenames(c,h){return c.trim().split(/^|\s+/).map(function(c){var g="",m=c.indexOf(".");if(m>=0&&(g=c.slice(m+1),c=c.slice(0,m)),c&&!h.hasOwnProperty(c))throw new Error("unknown type: "+c);return{type:c,name:g}})}(c+"",m),w=-1,S=b.length;if(!(arguments.length<2)){if(null!=h&&"function"!=typeof h)throw new Error("invalid callback: "+h);for(;++w<S;)if(g=(c=b[w]).type)m[g]=dispatch_set(m[g],c.name,h);else if(null==h)for(g in m)m[g]=dispatch_set(m[g],c.name,null);return this}for(;++w<S;)if((g=(c=b[w]).type)&&(g=dispatch_get(m[g],c.name)))return g},copy:function(){var c={},h=this._;for(var g in h)c[g]=h[g].slice();return new dispatch_Dispatch(c)},call:function(c,h){if((g=arguments.length-2)>0)for(var g,m,b=new Array(g),w=0;w<g;++w)b[w]=arguments[w+2];if(!this._.hasOwnProperty(c))throw new Error("unknown type: "+c);for(w=0,g=(m=this._[c]).length;w<g;++w)m[w].value.apply(h,b)},apply:function(c,h,g){if(!this._.hasOwnProperty(c))throw new Error("unknown type: "+c);for(var m=this._[c],b=0,w=m.length;b<w;++b)m[b].value.apply(h,g)}};const Ki=src_dispatch_dispatch,Zi={capture:!0,passive:!1};function src_noevent(c){c.preventDefault(),c.stopImmediatePropagation()}function zoom_cosh(c){return((c=Math.exp(c))+1/c)/2}const Ji=function zoomRho(c,h,g){function zoom(m,b){var w,S,M=m[0],k=m[1],T=m[2],E=b[0],I=b[1],P=b[2],L=E-M,B=I-k,z=L*L+B*B;if(z<1e-12)S=Math.log(P/T)/c,w=function(h){return[M+h*L,k+h*B,T*Math.exp(c*h*S)]};else{var j=Math.sqrt(z),D=(P*P-T*T+g*z)/(2*T*h*j),N=(P*P-T*T-g*z)/(2*P*h*j),R=Math.log(Math.sqrt(D*D+1)-D),G=Math.log(Math.sqrt(N*N+1)-N);S=(G-R)/c,w=function(g){var m=g*S,b=zoom_cosh(R),w=T/(h*j)*(b*function zoom_tanh(c){return((c=Math.exp(2*c))-1)/(c+1)}(c*m+R)-function zoom_sinh(c){return((c=Math.exp(c))-1/c)/2}(R));return[M+w*L,k+w*B,T*b/zoom_cosh(c*m+R)]}}return w.duration=1e3*S*c/Math.SQRT2,w}return zoom.rho=function(c){var h=Math.max(.001,+c),g=h*h;return zoomRho(h,g,g*g)},zoom}(Math.SQRT2,2,4);function pointer(c,h){if(c=function d3_selection_src_sourceEvent(c){let h;for(;h=c.sourceEvent;)c=h;return c}(c),void 0===h&&(h=c.currentTarget),h){var g=h.ownerSVGElement||h;if(g.createSVGPoint){var m=g.createSVGPoint();return m.x=c.clientX,m.y=c.clientY,[(m=m.matrixTransform(h.getScreenCTM().inverse())).x,m.y]}if(h.getBoundingClientRect){var b=h.getBoundingClientRect();return[c.clientX-b.left-h.clientLeft,c.clientY-b.top-h.clientTop]}}return[c.pageX,c.pageY]}var Qi,ts,es=0,ns=0,rs=0,os=0,as=0,is=0,ss="object"==typeof performance&&performance.now?performance:Date,ls="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(c){setTimeout(c,17)};function now(){return as||(ls(clearNow),as=ss.now()+is)}function clearNow(){as=0}function Timer(){this._call=this._time=this._next=null}function timer(c,h,g){var m=new Timer;return m.restart(c,h,g),m}function wake(){as=(os=ss.now())+is,es=ns=0;try{!function timerFlush(){now(),++es;for(var c,h=Qi;h;)(c=as-h._time)>=0&&h._call.call(void 0,c),h=h._next;--es}()}finally{es=0,function nap(){var c,h,g=Qi,m=1/0;for(;g;)g._call?(m>g._time&&(m=g._time),c=g,g=g._next):(h=g._next,g._next=null,g=c?c._next=h:Qi=h);ts=c,sleep(m)}(),as=0}}function poke(){var c=ss.now(),h=c-os;h>1e3&&(is-=h,os=c)}function sleep(c){es||(ns&&(ns=clearTimeout(ns)),c-as>24?(c<1/0&&(ns=setTimeout(wake,c-ss.now()-is)),rs&&(rs=clearInterval(rs))):(rs||(os=ss.now(),rs=setInterval(poke,1e3)),es=1,ls(wake)))}function src_timeout(c,h,g){var m=new Timer;return h=null==h?0:+h,m.restart(g=>{m.stop(),c(g+h)},h,g),m}Timer.prototype=timer.prototype={constructor:Timer,restart:function(c,h,g){if("function"!=typeof c)throw new TypeError("callback is not a function");g=(null==g?now():+g)+(null==h?0:+h),this._next||ts===this||(ts?ts._next=this:Qi=this,ts=this),this._call=c,this._time=g,sleep()},stop:function(){this._call&&(this._call=null,this._time=1/0,sleep())}};var cs=Ki("start","end","cancel","interrupt"),us=[];function schedule(c,h,g,m,b,w){var S=c.__transition;if(S){if(g in S)return}else c.__transition={};!function schedule_create(c,h,g){var m,b=c.__transition;function schedule(c){g.state=1,g.timer.restart(start,g.delay,g.time),g.delay<=c&&start(c-g.delay)}function start(w){var S,M,k,T;if(1!==g.state)return stop();for(S in b)if((T=b[S]).name===g.name){if(3===T.state)return src_timeout(start);4===T.state?(T.state=6,T.timer.stop(),T.on.call("interrupt",c,c.__data__,T.index,T.group),delete b[S]):+S<h&&(T.state=6,T.timer.stop(),T.on.call("cancel",c,c.__data__,T.index,T.group),delete b[S])}if(src_timeout(function(){3===g.state&&(g.state=4,g.timer.restart(tick,g.delay,g.time),tick(w))}),g.state=2,g.on.call("start",c,c.__data__,g.index,g.group),2===g.state){for(g.state=3,m=new Array(k=g.tween.length),S=0,M=-1;S<k;++S)(T=g.tween[S].value.call(c,c.__data__,g.index,g.group))&&(m[++M]=T);m.length=M+1}}function tick(h){for(var b=h<g.duration?g.ease.call(null,h/g.duration):(g.timer.restart(stop),g.state=5,1),w=-1,S=m.length;++w<S;)m[w].call(c,b);5===g.state&&(g.on.call("end",c,c.__data__,g.index,g.group),stop())}function stop(){for(var m in g.state=6,g.timer.stop(),delete b[h],b)return;delete c.__transition}b[h]=g,g.timer=timer(schedule,0,g.time)}(c,g,{name:h,index:m,group:b,on:cs,tween:us,time:w.time,delay:w.delay,duration:w.duration,ease:w.ease,timer:null,state:0})}function schedule_init(c,h){var g=schedule_get(c,h);if(g.state>0)throw new Error("too late; already scheduled");return g}function schedule_set(c,h){var g=schedule_get(c,h);if(g.state>3)throw new Error("too late; already running");return g}function schedule_get(c,h){var g=c.__transition;if(!g||!(g=g[h]))throw new Error("transition not found");return g}function interrupt(c,h){var g,m,b,w=c.__transition,S=!0;if(w){for(b in h=null==h?null:h+"",w)(g=w[b]).name===h?(m=g.state>2&&g.state<5,g.state=6,g.timer.stop(),g.on.call(m?"interrupt":"cancel",c,c.__data__,g.index,g.group),delete w[b]):S=!1;S&&delete c.__transition}}var hs,ds=180/Math.PI,ps={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function decompose(c,h,g,m,b,w){var S,M,k;return(S=Math.sqrt(c*c+h*h))&&(c/=S,h/=S),(k=c*g+h*m)&&(g-=c*k,m-=h*k),(M=Math.sqrt(g*g+m*m))&&(g/=M,m/=M,k/=M),c*m<h*g&&(c=-c,h=-h,k=-k,S=-S),{translateX:b,translateY:w,rotate:Math.atan2(h,c)*ds,skewX:Math.atan(k)*ds,scaleX:S,scaleY:M}}function interpolateTransform(c,h,g,m){function pop(c){return c.length?c.pop()+" ":""}return function(b,w){var S=[],M=[];return b=c(b),w=c(w),function translate(c,m,b,w,S,M){if(c!==b||m!==w){var k=S.push("translate(",null,h,null,g);M.push({i:k-4,x:src_number(c,b)},{i:k-2,x:src_number(m,w)})}else(b||w)&&S.push("translate("+b+h+w+g)}(b.translateX,b.translateY,w.translateX,w.translateY,S,M),function rotate(c,h,g,b){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),b.push({i:g.push(pop(g)+"rotate(",null,m)-2,x:src_number(c,h)})):h&&g.push(pop(g)+"rotate("+h+m)}(b.rotate,w.rotate,S,M),function skewX(c,h,g,b){c!==h?b.push({i:g.push(pop(g)+"skewX(",null,m)-2,x:src_number(c,h)}):h&&g.push(pop(g)+"skewX("+h+m)}(b.skewX,w.skewX,S,M),function scale(c,h,g,m,b,w){if(c!==g||h!==m){var S=b.push(pop(b)+"scale(",null,",",null,")");w.push({i:S-4,x:src_number(c,g)},{i:S-2,x:src_number(h,m)})}else 1===g&&1===m||b.push(pop(b)+"scale("+g+","+m+")")}(b.scaleX,b.scaleY,w.scaleX,w.scaleY,S,M),b=w=null,function(c){for(var h,g=-1,m=M.length;++g<m;)S[(h=M[g]).i]=h.x(c);return S.join("")}}}var fs=interpolateTransform(function parseCss(c){const h=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(c+"");return h.isIdentity?ps:decompose(h.a,h.b,h.c,h.d,h.e,h.f)},"px, ","px)","deg)"),gs=interpolateTransform(function parseSvg(c){return null==c?ps:(hs||(hs=document.createElementNS("http://www.w3.org/2000/svg","g")),hs.setAttribute("transform",c),(c=hs.transform.baseVal.consolidate())?decompose((c=c.matrix).a,c.b,c.c,c.d,c.e,c.f):ps)},", ",")",")");function tweenRemove(c,h){var g,m;return function(){var b=schedule_set(this,c),w=b.tween;if(w!==g)for(var S=0,M=(m=g=w).length;S<M;++S)if(m[S].name===h){(m=m.slice()).splice(S,1);break}b.tween=m}}function tweenFunction(c,h,g){var m,b;if("function"!=typeof g)throw new Error;return function(){var w=schedule_set(this,c),S=w.tween;if(S!==m){b=(m=S).slice();for(var M={name:h,value:g},k=0,T=b.length;k<T;++k)if(b[k].name===h){b[k]=M;break}k===T&&b.push(M)}w.tween=b}}function tweenValue(c,h,g){var m=c._id;return c.each(function(){var c=schedule_set(this,m);(c.value||(c.value={}))[h]=g.apply(this,arguments)}),function(c){return schedule_get(c,m).value[h]}}function interpolate(c,h){var g;return("number"==typeof h?src_number:h instanceof color_color?st:(g=color_color(h))?(h=g,st):string)(c,h)}function transition_attr_attrRemove(c){return function(){this.removeAttribute(c)}}function transition_attr_attrRemoveNS(c){return function(){this.removeAttributeNS(c.space,c.local)}}function transition_attr_attrConstant(c,h,g){var m,b,w=g+"";return function(){var S=this.getAttribute(c);return S===w?null:S===m?b:b=h(m=S,g)}}function transition_attr_attrConstantNS(c,h,g){var m,b,w=g+"";return function(){var S=this.getAttributeNS(c.space,c.local);return S===w?null:S===m?b:b=h(m=S,g)}}function transition_attr_attrFunction(c,h,g){var m,b,w;return function(){var S,M,k=g(this);if(null!=k)return(S=this.getAttribute(c))===(M=k+"")?null:S===m&&M===b?w:(b=M,w=h(m=S,k));this.removeAttribute(c)}}function transition_attr_attrFunctionNS(c,h,g){var m,b,w;return function(){var S,M,k=g(this);if(null!=k)return(S=this.getAttributeNS(c.space,c.local))===(M=k+"")?null:S===m&&M===b?w:(b=M,w=h(m=S,k));this.removeAttributeNS(c.space,c.local)}}function attrTweenNS(c,h){var g,m;function tween(){var b=h.apply(this,arguments);return b!==m&&(g=(m=b)&&function attrInterpolateNS(c,h){return function(g){this.setAttributeNS(c.space,c.local,h.call(this,g))}}(c,b)),g}return tween._value=h,tween}function attrTween(c,h){var g,m;function tween(){var b=h.apply(this,arguments);return b!==m&&(g=(m=b)&&function attrInterpolate(c,h){return function(g){this.setAttribute(c,h.call(this,g))}}(c,b)),g}return tween._value=h,tween}function delayFunction(c,h){return function(){schedule_init(this,c).delay=+h.apply(this,arguments)}}function delayConstant(c,h){return h=+h,function(){schedule_init(this,c).delay=h}}function durationFunction(c,h){return function(){schedule_set(this,c).duration=+h.apply(this,arguments)}}function durationConstant(c,h){return h=+h,function(){schedule_set(this,c).duration=h}}var _s=G.prototype.constructor;function transition_style_styleRemove(c){return function(){this.style.removeProperty(c)}}var ms=0;function Transition(c,h,g,m){this._groups=c,this._parents=h,this._name=g,this._id=m}function newId(){return++ms}var vs=G.prototype;Transition.prototype=function transition_transition(c){return G().transition(c)}.prototype={constructor:Transition,select:function transition_select(c){var h=this._name,g=this._id;"function"!=typeof c&&(c=selector(c));for(var m=this._groups,b=m.length,w=new Array(b),S=0;S<b;++S)for(var M,k,T=m[S],E=T.length,I=w[S]=new Array(E),P=0;P<E;++P)(M=T[P])&&(k=c.call(M,M.__data__,P,T))&&("__data__"in M&&(k.__data__=M.__data__),I[P]=k,schedule(I[P],h,g,P,I,schedule_get(M,g)));return new Transition(w,this._parents,h,g)},selectAll:function transition_selectAll(c){var h=this._name,g=this._id;"function"!=typeof c&&(c=selectorAll(c));for(var m=this._groups,b=m.length,w=[],S=[],M=0;M<b;++M)for(var k,T=m[M],E=T.length,I=0;I<E;++I)if(k=T[I]){for(var P,L=c.call(k,k.__data__,I,T),B=schedule_get(k,g),z=0,j=L.length;z<j;++z)(P=L[z])&&schedule(P,h,g,z,L,B);w.push(L),S.push(k)}return new Transition(w,S,h,g)},selectChild:vs.selectChild,selectChildren:vs.selectChildren,filter:function transition_filter(c){"function"!=typeof c&&(c=matcher(c));for(var h=this._groups,g=h.length,m=new Array(g),b=0;b<g;++b)for(var w,S=h[b],M=S.length,k=m[b]=[],T=0;T<M;++T)(w=S[T])&&c.call(w,w.__data__,T,S)&&k.push(w);return new Transition(m,this._parents,this._name,this._id)},merge:function transition_merge(c){if(c._id!==this._id)throw new Error;for(var h=this._groups,g=c._groups,m=h.length,b=g.length,w=Math.min(m,b),S=new Array(m),M=0;M<w;++M)for(var k,T=h[M],E=g[M],I=T.length,P=S[M]=new Array(I),L=0;L<I;++L)(k=T[L]||E[L])&&(P[L]=k);for(;M<m;++M)S[M]=h[M];return new Transition(S,this._parents,this._name,this._id)},selection:function transition_selection(){return new _s(this._groups,this._parents)},transition:function transition(){for(var c=this._name,h=this._id,g=newId(),m=this._groups,b=m.length,w=0;w<b;++w)for(var S,M=m[w],k=M.length,T=0;T<k;++T)if(S=M[T]){var E=schedule_get(S,h);schedule(S,c,g,T,M,{time:E.time+E.delay+E.duration,delay:0,duration:E.duration,ease:E.ease})}return new Transition(m,this._parents,c,g)},call:vs.call,nodes:vs.nodes,node:vs.node,size:vs.size,empty:vs.empty,each:vs.each,on:function transition_on(c,h){var g=this._id;return arguments.length<2?schedule_get(this.node(),g).on.on(c):this.each(function onFunction(c,h,g){var m,b,w=function on_start(c){return(c+"").trim().split(/^|\s+/).every(function(c){var h=c.indexOf(".");return h>=0&&(c=c.slice(0,h)),!c||"start"===c})}(h)?schedule_init:schedule_set;return function(){var S=w(this,c),M=S.on;M!==m&&(b=(m=M).copy()).on(h,g),S.on=b}}(g,c,h))},attr:function transition_attr(c,h){var g=namespace(c),m="transform"===g?gs:interpolate;return this.attrTween(c,"function"==typeof h?(g.local?transition_attr_attrFunctionNS:transition_attr_attrFunction)(g,m,tweenValue(this,"attr."+c,h)):null==h?(g.local?transition_attr_attrRemoveNS:transition_attr_attrRemove)(g):(g.local?transition_attr_attrConstantNS:transition_attr_attrConstant)(g,m,h))},attrTween:function transition_attrTween(c,h){var g="attr."+c;if(arguments.length<2)return(g=this.tween(g))&&g._value;if(null==h)return this.tween(g,null);if("function"!=typeof h)throw new Error;var m=namespace(c);return this.tween(g,(m.local?attrTweenNS:attrTween)(m,h))},style:function transition_style(c,h,g){var m="transform"==(c+="")?fs:interpolate;return null==h?this.styleTween(c,function styleNull(c,h){var g,m,b;return function(){var w=styleValue(this,c),S=(this.style.removeProperty(c),styleValue(this,c));return w===S?null:w===g&&S===m?b:b=h(g=w,m=S)}}(c,m)).on("end.style."+c,transition_style_styleRemove(c)):"function"==typeof h?this.styleTween(c,function transition_style_styleFunction(c,h,g){var m,b,w;return function(){var S=styleValue(this,c),M=g(this),k=M+"";return null==M&&(this.style.removeProperty(c),k=M=styleValue(this,c)),S===k?null:S===m&&k===b?w:(b=k,w=h(m=S,M))}}(c,m,tweenValue(this,"style."+c,h))).each(function styleMaybeRemove(c,h){var g,m,b,w,S="style."+h,M="end."+S;return function(){var k=schedule_set(this,c),T=k.on,E=null==k.value[S]?w||(w=transition_style_styleRemove(h)):void 0;T===g&&b===E||(m=(g=T).copy()).on(M,b=E),k.on=m}}(this._id,c)):this.styleTween(c,function transition_style_styleConstant(c,h,g){var m,b,w=g+"";return function(){var S=styleValue(this,c);return S===w?null:S===m?b:b=h(m=S,g)}}(c,m,h),g).on("end.style."+c,null)},styleTween:function transition_styleTween(c,h,g){var m="style."+(c+="");if(arguments.length<2)return(m=this.tween(m))&&m._value;if(null==h)return this.tween(m,null);if("function"!=typeof h)throw new Error;return this.tween(m,function styleTween(c,h,g){var m,b;function tween(){var w=h.apply(this,arguments);return w!==b&&(m=(b=w)&&function styleInterpolate(c,h,g){return function(m){this.style.setProperty(c,h.call(this,m),g)}}(c,w,g)),m}return tween._value=h,tween}(c,h,null==g?"":g))},text:function transition_text(c){return this.tween("text","function"==typeof c?function transition_text_textFunction(c){return function(){var h=c(this);this.textContent=null==h?"":h}}(tweenValue(this,"text",c)):function transition_text_textConstant(c){return function(){this.textContent=c}}(null==c?"":c+""))},textTween:function transition_textTween(c){var h="text";if(arguments.length<1)return(h=this.tween(h))&&h._value;if(null==c)return this.tween(h,null);if("function"!=typeof c)throw new Error;return this.tween(h,function textTween(c){var h,g;function tween(){var m=c.apply(this,arguments);return m!==g&&(h=(g=m)&&function textInterpolate(c){return function(h){this.textContent=c.call(this,h)}}(m)),h}return tween._value=c,tween}(c))},remove:function transition_remove(){return this.on("end.remove",function removeFunction(c){return function(){var h=this.parentNode;for(var g in this.__transition)if(+g!==c)return;h&&h.removeChild(this)}}(this._id))},tween:function tween(c,h){var g=this._id;if(c+="",arguments.length<2){for(var m,b=schedule_get(this.node(),g).tween,w=0,S=b.length;w<S;++w)if((m=b[w]).name===c)return m.value;return null}return this.each((null==h?tweenRemove:tweenFunction)(g,c,h))},delay:function delay(c){var h=this._id;return arguments.length?this.each(("function"==typeof c?delayFunction:delayConstant)(h,c)):schedule_get(this.node(),h).delay},duration:function duration(c){var h=this._id;return arguments.length?this.each(("function"==typeof c?durationFunction:durationConstant)(h,c)):schedule_get(this.node(),h).duration},ease:function ease(c){var h=this._id;return arguments.length?this.each(function easeConstant(c,h){if("function"!=typeof h)throw new Error;return function(){schedule_set(this,c).ease=h}}(h,c)):schedule_get(this.node(),h).ease},easeVarying:function transition_easeVarying(c){if("function"!=typeof c)throw new Error;return this.each(function easeVarying(c,h){return function(){var g=h.apply(this,arguments);if("function"!=typeof g)throw new Error;schedule_set(this,c).ease=g}}(this._id,c))},end:function end(){var c,h,g=this,m=g._id,b=g.size();return new Promise(function(w,S){var M={value:S},k={value:function(){0===--b&&w()}};g.each(function(){var g=schedule_set(this,m),b=g.on;b!==c&&((h=(c=b).copy())._.cancel.push(M),h._.interrupt.push(M),h._.end.push(k)),g.on=h}),0===b&&w()})},[Symbol.iterator]:vs[Symbol.iterator]};var ys={time:null,delay:0,duration:250,ease:function cubicInOut(c){return((c*=2)<=1?c*c*c:(c-=2)*c*c+2)/2}};function inherit(c,h){for(var g;!(g=c.__transition)||!(g=g[h]);)if(!(c=c.parentNode))throw new Error(`transition ${h} not found`);return g}G.prototype.interrupt=function selection_interrupt(c){return this.each(function(){interrupt(this,c)})},G.prototype.transition=function selection_transition(c){var h,g;c instanceof Transition?(h=c._id,c=c._name):(h=newId(),(g=ys).time=now(),c=null==c?null:c+"");for(var m=this._groups,b=m.length,w=0;w<b;++w)for(var S,M=m[w],k=M.length,T=0;T<k;++T)(S=M[T])&&schedule(S,c,h,T,M,g||inherit(S,h));return new Transition(m,this._parents,c,h)};const d3_zoom_src_constant=c=>()=>c;function ZoomEvent(c,{sourceEvent:h,target:g,transform:m,dispatch:b}){Object.defineProperties(this,{type:{value:c,enumerable:!0,configurable:!0},sourceEvent:{value:h,enumerable:!0,configurable:!0},target:{value:g,enumerable:!0,configurable:!0},transform:{value:m,enumerable:!0,configurable:!0},_:{value:b}})}function Transform(c,h,g){this.k=c,this.x=h,this.y=g}Transform.prototype={constructor:Transform,scale:function(c){return 1===c?this:new Transform(this.k*c,this.x,this.y)},translate:function(c,h){return 0===c&0===h?this:new Transform(this.k,this.x+this.k*c,this.y+this.k*h)},apply:function(c){return[c[0]*this.k+this.x,c[1]*this.k+this.y]},applyX:function(c){return c*this.k+this.x},applyY:function(c){return c*this.k+this.y},invert:function(c){return[(c[0]-this.x)/this.k,(c[1]-this.y)/this.k]},invertX:function(c){return(c-this.x)/this.k},invertY:function(c){return(c-this.y)/this.k},rescaleX:function(c){return c.copy().domain(c.range().map(this.invertX,this).map(c.invert,c))},rescaleY:function(c){return c.copy().domain(c.range().map(this.invertY,this).map(c.invert,c))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var As=new Transform(1,0,0);function src_noevent_nopropagation(c){c.stopImmediatePropagation()}function d3_zoom_src_noevent(c){c.preventDefault(),c.stopImmediatePropagation()}function zoom_defaultFilter(c){return!(c.ctrlKey&&"wheel"!==c.type||c.button)}function defaultExtent(){var c=this;return c instanceof SVGElement?(c=c.ownerSVGElement||c).hasAttribute("viewBox")?[[(c=c.viewBox.baseVal).x,c.y],[c.x+c.width,c.y+c.height]]:[[0,0],[c.width.baseVal.value,c.height.baseVal.value]]:[[0,0],[c.clientWidth,c.clientHeight]]}function defaultTransform(){return this.__zoom||As}function defaultWheelDelta(c){return-c.deltaY*(1===c.deltaMode?.05:c.deltaMode?1:.002)*(c.ctrlKey?10:1)}function zoom_defaultTouchable(){return navigator.maxTouchPoints||"ontouchstart"in this}function defaultConstrain(c,h,g){var m=c.invertX(h[0][0])-g[0][0],b=c.invertX(h[1][0])-g[1][0],w=c.invertY(h[0][1])-g[0][1],S=c.invertY(h[1][1])-g[1][1];return c.translate(b>m?(m+b)/2:Math.min(0,m)||Math.max(0,b),S>w?(w+S)/2:Math.min(0,w)||Math.max(0,S))}function zoom(){var c,h,g,m=zoom_defaultFilter,b=defaultExtent,w=defaultConstrain,S=defaultWheelDelta,M=zoom_defaultTouchable,k=[0,1/0],T=[[-1/0,-1/0],[1/0,1/0]],E=250,I=Ji,P=Ki("start","zoom","end"),L=0,B=10;function zoom(c){c.property("__zoom",defaultTransform).on("wheel.zoom",wheeled,{passive:!1}).on("mousedown.zoom",mousedowned).on("dblclick.zoom",dblclicked).filter(M).on("touchstart.zoom",touchstarted).on("touchmove.zoom",touchmoved).on("touchend.zoom touchcancel.zoom",touchended).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function scale(c,h){return(h=Math.max(k[0],Math.min(k[1],h)))===c.k?c:new Transform(h,c.x,c.y)}function translate(c,h,g){var m=h[0]-g[0]*c.k,b=h[1]-g[1]*c.k;return m===c.x&&b===c.y?c:new Transform(c.k,m,b)}function centroid(c){return[(+c[0][0]+ +c[1][0])/2,(+c[0][1]+ +c[1][1])/2]}function schedule(c,h,g,m){c.on("start.zoom",function(){gesture(this,arguments).event(m).start()}).on("interrupt.zoom end.zoom",function(){gesture(this,arguments).event(m).end()}).tween("zoom",function(){var c=this,w=arguments,S=gesture(c,w).event(m),M=b.apply(c,w),k=null==g?centroid(M):"function"==typeof g?g.apply(c,w):g,T=Math.max(M[1][0]-M[0][0],M[1][1]-M[0][1]),E=c.__zoom,P="function"==typeof h?h.apply(c,w):h,L=I(E.invert(k).concat(T/E.k),P.invert(k).concat(T/P.k));return function(c){if(1===c)c=P;else{var h=L(c),g=T/h[2];c=new Transform(g,k[0]-h[0]*g,k[1]-h[1]*g)}S.zoom(null,c)}})}function gesture(c,h,g){return!g&&c.__zooming||new Gesture(c,h)}function Gesture(c,h){this.that=c,this.args=h,this.active=0,this.sourceEvent=null,this.extent=b.apply(c,h),this.taps=0}function wheeled(c,...h){if(m.apply(this,arguments)){var g=gesture(this,h).event(c),b=this.__zoom,M=Math.max(k[0],Math.min(k[1],b.k*Math.pow(2,S.apply(this,arguments)))),E=pointer(c);if(g.wheel)g.mouse[0][0]===E[0]&&g.mouse[0][1]===E[1]||(g.mouse[1]=b.invert(g.mouse[0]=E)),clearTimeout(g.wheel);else{if(b.k===M)return;g.mouse=[E,b.invert(E)],interrupt(this),g.start()}d3_zoom_src_noevent(c),g.wheel=setTimeout(function wheelidled(){g.wheel=null,g.end()},150),g.zoom("mouse",w(translate(scale(b,M),g.mouse[0],g.mouse[1]),g.extent,T))}}function mousedowned(c,...h){if(!g&&m.apply(this,arguments)){var b=c.currentTarget,S=gesture(this,h,!0).event(c),M=src_select(c.view).on("mousemove.zoom",function mousemoved(c){if(d3_zoom_src_noevent(c),!S.moved){var h=c.clientX-E,g=c.clientY-I;S.moved=h*h+g*g>L}S.event(c).zoom("mouse",w(translate(S.that.__zoom,S.mouse[0]=pointer(c,b),S.mouse[1]),S.extent,T))},!0).on("mouseup.zoom",function mouseupped(c){M.on("mousemove.zoom mouseup.zoom",null),function nodrag_yesdrag(c,h){var g=c.document.documentElement,m=src_select(c).on("dragstart.drag",null);h&&(m.on("click.drag",src_noevent,Zi),setTimeout(function(){m.on("click.drag",null)},0)),"onselectstart"in g?m.on("selectstart.drag",null):(g.style.MozUserSelect=g.__noselect,delete g.__noselect)}(c.view,S.moved),d3_zoom_src_noevent(c),S.event(c).end()},!0),k=pointer(c,b),E=c.clientX,I=c.clientY;!function src_nodrag(c){var h=c.document.documentElement,g=src_select(c).on("dragstart.drag",src_noevent,Zi);"onselectstart"in h?g.on("selectstart.drag",src_noevent,Zi):(h.__noselect=h.style.MozUserSelect,h.style.MozUserSelect="none")}(c.view),src_noevent_nopropagation(c),S.mouse=[k,this.__zoom.invert(k)],interrupt(this),S.start()}}function dblclicked(c,...h){if(m.apply(this,arguments)){var g=this.__zoom,S=pointer(c.changedTouches?c.changedTouches[0]:c,this),M=g.invert(S),k=g.k*(c.shiftKey?.5:2),I=w(translate(scale(g,k),S,M),b.apply(this,h),T);d3_zoom_src_noevent(c),E>0?src_select(this).transition().duration(E).call(schedule,I,S,c):src_select(this).call(zoom.transform,I,S,c)}}function touchstarted(g,...b){if(m.apply(this,arguments)){var w,S,M,k,T=g.touches,E=T.length,I=gesture(this,b,g.changedTouches.length===E).event(g);for(src_noevent_nopropagation(g),S=0;S<E;++S)k=[k=pointer(M=T[S],this),this.__zoom.invert(k),M.identifier],I.touch0?I.touch1||I.touch0[2]===k[2]||(I.touch1=k,I.taps=0):(I.touch0=k,w=!0,I.taps=1+!!c);c&&(c=clearTimeout(c)),w&&(I.taps<2&&(h=k[0],c=setTimeout(function(){c=null},500)),interrupt(this),I.start())}}function touchmoved(c,...h){if(this.__zooming){var g,m,b,S,M=gesture(this,h).event(c),k=c.changedTouches,E=k.length;for(d3_zoom_src_noevent(c),g=0;g<E;++g)b=pointer(m=k[g],this),M.touch0&&M.touch0[2]===m.identifier?M.touch0[0]=b:M.touch1&&M.touch1[2]===m.identifier&&(M.touch1[0]=b);if(m=M.that.__zoom,M.touch1){var I=M.touch0[0],P=M.touch0[1],L=M.touch1[0],B=M.touch1[1],z=(z=L[0]-I[0])*z+(z=L[1]-I[1])*z,j=(j=B[0]-P[0])*j+(j=B[1]-P[1])*j;m=scale(m,Math.sqrt(z/j)),b=[(I[0]+L[0])/2,(I[1]+L[1])/2],S=[(P[0]+B[0])/2,(P[1]+B[1])/2]}else{if(!M.touch0)return;b=M.touch0[0],S=M.touch0[1]}M.zoom("touch",w(translate(m,b,S),M.extent,T))}}function touchended(c,...m){if(this.__zooming){var b,w,S=gesture(this,m).event(c),M=c.changedTouches,k=M.length;for(src_noevent_nopropagation(c),g&&clearTimeout(g),g=setTimeout(function(){g=null},500),b=0;b<k;++b)w=M[b],S.touch0&&S.touch0[2]===w.identifier?delete S.touch0:S.touch1&&S.touch1[2]===w.identifier&&delete S.touch1;if(S.touch1&&!S.touch0&&(S.touch0=S.touch1,delete S.touch1),S.touch0)S.touch0[1]=this.__zoom.invert(S.touch0[0]);else if(S.end(),2===S.taps&&(w=pointer(w,this),Math.hypot(h[0]-w[0],h[1]-w[1])<B)){var T=src_select(this).on("dblclick.zoom");T&&T.apply(this,arguments)}}}return zoom.transform=function(c,h,g,m){var b=c.selection?c.selection():c;b.property("__zoom",defaultTransform),c!==b?schedule(c,h,g,m):b.interrupt().each(function(){gesture(this,arguments).event(m).start().zoom(null,"function"==typeof h?h.apply(this,arguments):h).end()})},zoom.scaleBy=function(c,h,g,m){zoom.scaleTo(c,function(){return this.__zoom.k*("function"==typeof h?h.apply(this,arguments):h)},g,m)},zoom.scaleTo=function(c,h,g,m){zoom.transform(c,function(){var c=b.apply(this,arguments),m=this.__zoom,S=null==g?centroid(c):"function"==typeof g?g.apply(this,arguments):g,M=m.invert(S),k="function"==typeof h?h.apply(this,arguments):h;return w(translate(scale(m,k),S,M),c,T)},g,m)},zoom.translateBy=function(c,h,g,m){zoom.transform(c,function(){return w(this.__zoom.translate("function"==typeof h?h.apply(this,arguments):h,"function"==typeof g?g.apply(this,arguments):g),b.apply(this,arguments),T)},null,m)},zoom.translateTo=function(c,h,g,m,S){zoom.transform(c,function(){var c=b.apply(this,arguments),S=this.__zoom,M=null==m?centroid(c):"function"==typeof m?m.apply(this,arguments):m;return w(As.translate(M[0],M[1]).scale(S.k).translate("function"==typeof h?-h.apply(this,arguments):-h,"function"==typeof g?-g.apply(this,arguments):-g),c,T)},m,S)},Gesture.prototype={event:function(c){return c&&(this.sourceEvent=c),this},start:function(){return 1===++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(c,h){return this.mouse&&"mouse"!==c&&(this.mouse[1]=h.invert(this.mouse[0])),this.touch0&&"touch"!==c&&(this.touch0[1]=h.invert(this.touch0[0])),this.touch1&&"touch"!==c&&(this.touch1[1]=h.invert(this.touch1[0])),this.that.__zoom=h,this.emit("zoom"),this},end:function(){return 0===--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(c){var h=src_select(this.that).datum();P.call(c,this.that,new ZoomEvent(c,{sourceEvent:this.sourceEvent,target:zoom,type:c,transform:this.that.__zoom,dispatch:P}),h)}},zoom.wheelDelta=function(c){return arguments.length?(S="function"==typeof c?c:d3_zoom_src_constant(+c),zoom):S},zoom.filter=function(c){return arguments.length?(m="function"==typeof c?c:d3_zoom_src_constant(!!c),zoom):m},zoom.touchable=function(c){return arguments.length?(M="function"==typeof c?c:d3_zoom_src_constant(!!c),zoom):M},zoom.extent=function(c){return arguments.length?(b="function"==typeof c?c:d3_zoom_src_constant([[+c[0][0],+c[0][1]],[+c[1][0],+c[1][1]]]),zoom):b},zoom.scaleExtent=function(c){return arguments.length?(k[0]=+c[0],k[1]=+c[1],zoom):[k[0],k[1]]},zoom.translateExtent=function(c){return arguments.length?(T[0][0]=+c[0][0],T[1][0]=+c[1][0],T[0][1]=+c[0][1],T[1][1]=+c[1][1],zoom):[[T[0][0],T[0][1]],[T[1][0],T[1][1]]]},zoom.constrain=function(c){return arguments.length?(w=c,zoom):w},zoom.duration=function(c){return arguments.length?(E=+c,zoom):E},zoom.interpolate=function(c){return arguments.length?(I=c,zoom):I},zoom.on=function(){var c=P.on.apply(P,arguments);return c===P?zoom:c},zoom.clickDistance=function(c){return arguments.length?(L=(c=+c)*c,zoom):Math.sqrt(L)},zoom.tapDistance=function(c){return arguments.length?(B=+c,zoom):B},zoom}Transform.prototype;var bs=function defineMapZoom(c){c.gridCartogram_?function defineGridCartogramZoom(c){var h=c.svg(),g=h.select("#em-zoom-group-"+c.svgId_);c.__zoomBehavior=zoom().scaleExtent(c.zoomExtent_||[1,8]).on("zoom",function(h){var m;g.attr("transform",h.transform),c.__lastTransform=h.transform,null===(m=c.onZoom_)||void 0===m||m.call(c,h,c)}).on("end",function(h){var g;null===(g=c.onZoomEnd_)||void 0===g||g.call(c,h,c)}),h.call(c.__zoomBehavior),h.call(c.__zoomBehavior.transform,As)}(c):xs(c)};var xs=function defineGeographicZoom(c){var h,g=src_select("#"+c.svgId()),m=As,b=!c.lockPanUntilZoom_,w=!1,S=c.zoomExtent_||[0,0],M=Math.max(S[0]||1,.01),k=M<1,T=null!==(h=c.panPadFactor_)&&void 0!==h?h:.1,E=k?T*(1/M-1)*c.width_:c.width_,I=k?T*(1/M-1)*c.height_:c.height_,P=c.translateExtent_?c.translateExtent_:k?[[-E,-I],[c.width_+E,c.height_+I]]:[[0,0],[c.width_,c.height_]];if(c.__zoomBehavior=zoom().filter(function(c){return!c.target.closest(".em-zoom-buttons")&&!c.target.closest(".em-button")}).extent([[0,0],[c.width_,c.height_]]).scaleExtent(S).translateExtent(P).on("start",function(c){c.sourceEvent&&"wheel"!==c.sourceEvent.type&&g.classed("em-dragging",!0)}).on("zoom",function(h){var S=h.transform,M=c.svg_.select("#em-zoom-group-"+c.svgId_);w?w=!1:(c.__lastTransform=S,S.k!==m.k?(c.lockPanUntilZoom_&&(b=!0),Cs(h,m,c),M.attr("data-zoom",S.k).attr("transform",S),m=S):!c.lockPanUntilZoom_||b?(ws(h,c),M.attr("transform",S),m=S):(w=!0,g.call(c.__zoomBehavior.transform,m)))}).on("end",function(h){var m;g.classed("em-dragging",!1),null===(m=c.onZoomEnd_)||void 0===m||m.call(c,h,c),window.dispatchEvent(new CustomEvent("estatmap:zoomend-"+c.svgId_,{detail:c}))}),c.__lastTransform=m,!c.__baseZ){var L=c.height_/2,B=slicedToArray_slicedToArray(c._projection.invert([0,L]),1)[0],z=slicedToArray_slicedToArray(c._projection.invert([c.width_,L]),1)[0];c.__baseZ=(z-B)/c.width_}g.call(c.__zoomBehavior)};var ws=function panHandler(c,h){var g=c.transform,m=(h.width_/2-g.x)/g.k,b=(h.height_/2-g.y)/g.k,w=slicedToArray_slicedToArray(h._projection.invert([m,b]),2),S=w[0],M=w[1];h.position_.x=S,h.position_.y=M,window.dispatchEvent(new CustomEvent("estatmap:zoomed-"+h.svgId_,{detail:h})),"function"==typeof h.onZoom_&&h.onZoom_(c,h)},Cs=function zoomHandler(c,h,g){var m,b,w=c.transform,S=(g.width_/2-w.x)/w.k,M=(g.height_/2-w.y)/w.k,k=slicedToArray_slicedToArray(g._projection.invert([S,M]),2),T=k[0],E=k[1];if(g.__programmaticZoom){var I=g.__programmaticZoom;g.position_.x=I.x,g.position_.y=I.y,g.position_.z=I.z,delete g.__programmaticZoom}else g.position_.x=T,g.position_.y=E,g.position_.z=g.__baseZ/w.k;g._lastZoomK=w.k,ks(w,g),!1!==(null===(m=g.labels_)||void 0===m?void 0:m.scaleOnZoom)&&Ms(w,g),null!==(b=g.labels_)&&void 0!==b&&b.backgrounds&&Ss(w,g),window.dispatchEvent(new CustomEvent("estatmap:zoomed-"+g.svgId_,{detail:g})),"function"==typeof g.onZoom_&&g.onZoom_(c,g)},Ss=function scaleLabelBackgrounds(c,h){var g=h.svg_.select("#em-zoom-group-"+h.svgId_).selectAll(".em-label-background"),m=c.k,b=[];g.each(function(){var c=src_select(this),h=parseFloat(c.attr("data-width"))||parseFloat(c.attr("width")),g=parseFloat(c.attr("data-height"))||parseFloat(c.attr("height")),w=parseFloat(c.attr("data-x"))||parseFloat(c.attr("x")),S=parseFloat(c.attr("data-y"))||parseFloat(c.attr("y"));if(h>0&&g>0&&!isNaN(w)&&!isNaN(S)){c.attr("data-width")||(c.attr("data-width",h),c.attr("data-height",g),c.attr("data-x",w),c.attr("data-y",S));var M=h*(1/m),k=g*(1/m),T=w*(1/m),E=S*(1/m);b.push({element:c,targetWidth:M,targetHeight:k,targetX:T,targetY:E})}}),b.forEach(function(c){var h=c.element,g=c.targetWidth,m=c.targetHeight,b=c.targetX,w=c.targetY;h.attr("width",g).attr("height",m).attr("x",b).attr("y",w)})},Ms=function scaleLabelTexts(c,h){var g=h.svg_.select("#em-zoom-group-"+h.svgId_).select("#em-labels").selectAll("*"),m=c.k,b=[];g.each(function(){var c=src_select(this),h=window.getComputedStyle(this),g=c.attr("font-size"),w=h.fontSize,S=g||w;if(S&&parseFloat(S)>0){var M=parseFloat(c.attr("data-fs"))||parseFloat(g)||parseFloat(w);c.attr("data-fs")||c.attr("data-fs",M);var k=M/m;b.push({element:this,targetFontSize:k})}}),b.forEach(function(c){var h=c.element,g=c.targetFontSize;h.style.setProperty("font-size","".concat(g,"px"),"important")})},ks=function scaleStrokeWidths(c,h){var g=h.svg_.select("#em-zoom-group-"+h.svgId_).selectAll("*"),m=c.k,b=[];g.each(function(){var c=src_select(this),h=window.getComputedStyle(this),g=c.attr("stroke-width"),w=h.strokeWidth,S=g||w;if(S&&parseFloat(S)>0){var M=parseFloat(c.attr("data-sw"))||parseFloat(g)||parseFloat(w);c.attr("data-sw")||c.attr("data-sw",M);var k=M/m;b.push({element:this,targetStrokeWidth:k})}}),b.forEach(function(c){var h=c.element,g=c.targetStrokeWidth;h.style.setProperty("stroke-width","".concat(g,"px"),"important")})};var Ts=dsv("\t"),Es=Ts.parse;Ts.parseRows,Ts.format,Ts.formatBody,Ts.formatRows,Ts.formatRow,Ts.formatValue;function responseText(c){if(!c.ok)throw new Error(c.status+" "+c.statusText);return c.text()}function dsvParse(c){return function(h,g,m){return 2===arguments.length&&"function"==typeof g&&(m=g,g=void 0),function src_text(c,h){return fetch(c,h).then(responseText)}(h,g).then(function(h){return c(h,m)})}}var Is=dsvParse(lo);dsvParse(Es);var Ps=function projectToMap(c,h,g){switch(c.proj_){case"3035":return Hi("EPSG:4326","EPSG:3035",[h,g]);case"54030":return Hi("EPSG:4326","EPSG:54030",[h,g]);default:return[h,g]}};function placenames_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function placenames_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?placenames_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):placenames_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}function placenames_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function placenames_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return placenames_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?placenames_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function placenames_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}var Ls=window.location.hostname.includes("ec.europa.eu")?"https://ec.europa.eu/assets/estat/E/E4/gisco/pub/euronym/v3/UTF_LATIN/50/EUR.csv":"https://raw.githubusercontent.com/eurostat/euronym/main/pub/v3/UTF_LATIN/50/EUR.csv";function loadPlacenames(c){return _loadPlacenames.apply(this,arguments)}function _loadPlacenames(){return _loadPlacenames=_asyncToGenerator(It().mark(function _callee(c){var h,g,m,b=arguments;return It().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return h=b.length>1&&void 0!==b[1]?b[1]:Ls,w.next=1,Is(h);case 1:return g=w.sent,m=g,c.placenamesFilter_&&(m=c.placenamesFilter_(g)),c._placenameLabels=m,w.abrupt("return",m);case 2:case"end":return w.stop()}},_callee)})),_loadPlacenames.apply(this,arguments)}function _addPlacenameLabels(){return _addPlacenameLabels=_asyncToGenerator(It().mark(function _callee2(c){return It().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(c._placenameLabels){h.next=1;break}return h.next=1,loadPlacenames(c);case 1:appendPlacenameLabels(c),window.addEventListener("estatmap:zoomend-"+c.svgId_,function(c){updatePlacenameLabels(c.detail,c.detail.__lastTransform)});case 2:case"end":return h.stop()}},_callee2)})),_addPlacenameLabels.apply(this,arguments)}function appendPlacenameLabels(c){var h,g=c.svg_,m=(null===(h=c.__lastTransform)||void 0===h?void 0:h.k)||1,b=Fs(c);console.log("Filtered ".concat(b.length," placenames for zoom level ").concat(m)),g.select("#em-placenames").remove();var w=g.select("#em-zoom-group-"+c.svgId_).append("g").attr("id","em-placenames").attr("class","em-placenames").attr("pointer-events","none");w.selectAll("text").data(b).join("text").attr("x",function(c){return c.screenX}).attr("y",function(c){return c.screenY}).text(function(c){return c.name}).attr("class","em-placename").attr("font-size",function(c){return"".concat(13*c.sizeFactor/m,"px")}).attr("font-weight",function(c){return c.sizeFactor>1?"bold":"normal"}).attr("dy","-0.35em").clone(!0).lower().attr("class","em-placename-halo").attr("stroke-width",3/m),c.placenameGroup_=w}var Fs=function getFilteredPlacenames(c){if(!c._placenameLabels)return[];var h,g=c._projection,m=c.width_,b=c.height_,w=c.position_.z,S=c.__lastTransform||{k:1,x:0,y:0},M=S.invertX(0)-30,k=S.invertY(0)-30,T=S.invertX(m)+30,E=S.invertY(b)+30,I=[],P=placenames_createForOfIteratorHelper(c._placenameLabels);try{for(P.s();!(h=P.n()).done;){var L=h.value,B=+L.rs,z=+L.r1;if(B&&!(w>B)){var j=+L.lon,D=+L.lat,N=slicedToArray_slicedToArray(Ps(c,j,D),2),R=slicedToArray_slicedToArray(g([N[0],N[1]]),2),G=R[0],q=R[1];if(!(G<M||G>T||q<k||q>E)&&(I.push(placenames_objectSpread(placenames_objectSpread({},L),{},{screenX:G,screenY:q,sizeFactor:w>z?1:1.1})),I.length>=500))break}}}catch(c){P.e(c)}finally{P.f()}return console.log("After filtering, ".concat(I.length," placenames remain.")),I};function updatePlacenameLabels(c,h){c._placenameLabels&&c._projection&&appendPlacenameLabels(c)}function appendCoastalMargin(c){if(c.svg_&&c._pathFunction){var h=function draw(c){var h=src_select("#em-zoom-group-"+c.svgId_);if(!h.empty()&&(h.select(".em-coastal-margin").remove(),c.drawCoastalMargin_)){!function ensureCoastalMarginFilter(c,h){var g,m=c.select("defs").empty()?c.append("defs"):c.select("defs");if(!m.select("#em-coastal-margin-filter").empty())return;var b=m.append("filter").attr("id","em-coastal-margin-filter").attr("x","-50%").attr("y","-50%").attr("width","200%").attr("height","200%");b.append("feGaussianBlur").attr("in","SourceGraphic").attr("stdDeviation",h.standardDeviation).attr("result","blur"),b.append("feColorMatrix").attr("in","blur").attr("type","matrix").attr("values","\n 1 0 0 0 0\n 0 1 0 0 0\n 0 0 1 0 0\n 0 0 0 ".concat(null!==(g=h.opacity)&&void 0!==g?g:.4," 0\n ")).attr("result","blurred");var w=b.append("feMerge");w.append("feMergeNode").attr("in","blurred"),w.append("feMergeNode").attr("in","SourceGraphic")}(c.svg_,c.coastalMarginSettings_);var g=h.append("g").attr("class","em-coastal-margin").attr("filter","url(#em-coastal-margin-filter)").attr("fill","none").style("stroke",c.coastalMarginSettings_.color).style("stroke-width",c.coastalMarginSettings_.strokeWidth).style("opacity",c.coastalMarginSettings_.opacity).attr("pointer-events","none"),m=function drawPaths(h,m,b){h&&g.append("g").attr("class",b).selectAll("path").data(h.filter(m)).enter().append("path").attr("d",c._pathFunction)};m(c.Geometries.geoJSONs.cntbn,function(c){return"T"===c.properties.co},"em-coastal-margin-cnt"),m(c.Geometries.geoJSONs.nutsbn,function(c){return"T"===c.properties.co},"em-coastal-margin-nuts"),m(c.Geometries.geoJSONs.worldbn,function(c){return"T"===c.properties.COAS_FLAG},"em-coastal-margin-world");var b=g.node().parentNode,w="WORLD"===c.geo_?3:1;b.childNodes[w]&&b.insertBefore(g.node(),b.childNodes[w])}};c.insetTemplates_&&Bt(c.insetTemplates_,c.svgId_,h),h(c)}}function texts_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function texts_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return texts_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?texts_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function texts_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}var Bs=function niceScaleBarLength(c){var h=Math.pow(10,Math.floor(Math.log(c)/Math.log(10)));return 5*h<=c?[5*h,5]:2*h<=c?[2*h,2]:[h,1]},Os=function getScalebarLabel(c){return c<.01?1e3*c+"mm":c<1?100*c+"cm":c<1e3?1*c+"m":c/1e3};function map_template_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}defaultLocale({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),function initProj4(){Hi.defs("EPSG:3035","+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs"),Hi.defs("EPSG:54030","+proj=robin +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs")}();var zs=function mapTemplate(c,h,g){var m={};m._mapType=g,m.updateValuesLabels=Rr,m.svgId_="map",m.svg_=void 0,m.width_=Math.min(795,window.innerWidth),m.height_=0,m.containerId_=void 0,m.nutsLevel_=3,m.nutsYear_=2024,m.geo_="EUR",m.proj_="3035",m.projectionFunction_=void 0,m.filterGeometriesFunction_=void 0,m.scale_="20M",m.position_={x:void 0,y:void 0,z:void 0},m.placenames_=!1,m.placenamesFilter_=void 0,m.gridCartogram_=!1,m.gridCartogramShape_="square",m.gridCartogramMargins_={top:80,right:50,bottom:80,left:150},m.gridCartogramCellPadding_=4,m.gridCartogramPositions_=void 0,m.zoomExtent_=void 0,m.translateExtent_=void 0,m.lockPanUntilZoom_=!0,m.onZoomEnd_=void 0,m.onZoom_=void 0,m.onRegionMouseOver_=void 0,m.onRegionMouseMove_=void 0,m.onRegionMouseOut_=void 0,m.onRegionClick_=void 0,m.geometries_=void 0,m.processCentroids_=void 0,m.dorling_=!1,m.animateDorling_=!0,m.dorlingStrength_={x:1,y:1},m.dorlingIterations_=1,m.onDorlingProgress_=void 0,m.dorlingWorker_=!1,m.dorlingWorkerD3URL_=void 0,m.header_=!1,m.footer_=!1,m.footerPadding_=void 0,m.headerPadding_=void 0,m.title_="",m.titlePosition_=void 0,m.subtitle_="",m.subtitlePosition_=void 0,m.showScalebar_=!1,m.scalebarPosition_=[],m.scalebarUnits_=" km",m.scalebarTextOffset_=[0,12],m.scalebarMaxWidth_=150,m.scalebarHeight_=90,m.scalebarStrokeWidth_=1,m.scalebarSegmentHeight_=6,m.scalebarTickHeight_=8,m.stamp_=void 0,m.minimap_=void 0,m.zoomButtons_=!0,m.zoomButtonsPosition_=void 0,m.insetsButton_=!1,m.insetsButtonPosition_=void 0,m.tooltip_={fontSize:"14px",transitionDuration:200,xOffset:0,yOffset:0,textFunction:null,showFlags:!1,omitRegions:[]},m.hoverColor_="red",m.drawCoastalMargin_=!1,m.coastalMarginSettings_={standardDeviation:.8,x:"-50%",y:"-50%",width:"150%",height:"150%",strokeWidth:.6,color:"rgb(0, 0, 0)",opacity:.1},m.drawGraticule_=!1,m.backgroundMap_=!0,m.labels_=void 0,m.annotations_=void 0,m.annotationsAdded=!1,m.patternFill_=void 0,m.showSourceLink_=!0,m.defaultFootnote_="Administrative boundaries: ©EuroGeographics ©OpenStreetMap",m.defaultFootnoteTooltipText_='<div class="em-footnote-tooltip">The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the European Union concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Kosovo*: This designation is without prejudice to positions on status, and is in line with UNSCR 1244/1999 and the ICJ Opinion on the Kosovo declaration of independence.</div>',m.footnote_=m.defaultFootnote_,m.footnoteTooltipText_=m.defaultFootnoteTooltipText_,m.footnoteWrap_=!1,m.footnotePosition_=void 0,m.showEstatLogo_=!1,m.showEstatRibbon_=!1,m.logoPosition_=void 0,m.ribbonPosition_=void 0,m.ribbonWidth_=void 0,m.ribbonHeight_=void 0,m.logoWidth_=void 0,m.logoHeight_=void 0,m.nuts2jsonBaseURL_=window.location.hostname.includes("ec.europa.eu")?"https://ec.europa.eu/assets/estat/E/E4/gisco/pub/nuts2json/v2":"https://raw.githubusercontent.com/eurostat/Nuts2json/master/pub/v2",m.noDataFillStyle_="#bcbcbc",m.insets_=[],m.insetTemplates_={},m.insetBoxPosition_=void 0,m.insetBoxPadding_=5,m.insetBoxWidth_=210,m.insetZoomExtent_=null,m.insetScale_="03M";var b=function _loop(c){m[c.substring(0,c.length-1)]=function(h){return arguments.length?(m[c]=h,m):m[c]}};for(var w in m)b(w);!function defineDeprecatedFunctions(c){c.showZoomButtons=function(h){return console.warn("showZoomButtons() is now DEPRECATED, please use zoomButtons() instead"),c.zoomButtons_=h,c},c.showInsetsButton=function(h){return console.warn("showInsetsButton() is now DEPRECATED, please use insetsButton() instead"),c.insetsButton_=h,c},c.seaFillStyle=function(h){return console.warn("seaFillStyle() is now DEPRECATED, please use the .em-sea CSS class"),updateCSSRule(".em-sea","fill",h),c},c.cntrgFillStyle=function(h){return console.warn("cntrgFillStyle() is now DEPRECATED, please use the .em-cntrg CSS class"),updateCSSRule(".em-cntrg","fill",h),c},c.nutsrgFillStyle=function(h){return console.warn("nutsrgFillStyle() is now DEPRECATED, please use the .em-nutsrg CSS class"),updateCSSRule(".em-nutsrg","fill",h),c},c.nutsbnStroke=function(h){return console.warn("nutsbnStroke() is now DEPRECATED, please use the .bn_0, .bn_1, .bn_2, .bn_3 CSS classes"),h[0]&&updateCSSRule(".bn_0","stroke",h[0]),h[1]&&updateCSSRule(".bn_1","stroke",h[1]),h[2]&&updateCSSRule(".bn_2","stroke",h[2]),h[3]&&updateCSSRule(".bn_3","stroke",h[3]),c},c.nutsbnStrokeWidth=function(h){return console.warn("nutsbnStrokeWidth() is now DEPRECATED, please use the .bn_0, .bn_1, .bn_2, .bn_3 CSS classes"),h[0]&&updateCSSRule(".bn_0","stroke-width",h[0]),h[1]&&updateCSSRule(".bn_1","stroke-width",h[1]),h[2]&&updateCSSRule(".bn_2","stroke-width",h[2]),h[3]&&updateCSSRule(".bn_3","stroke-width",h[3]),c},c.graticuleStroke=function(h){return console.warn("graticuleStroke() is now DEPRECATED, please use the .em-graticule CSS class"),updateCSSRule(".em-graticule","stroke",h),c},c.graticuleStrokeWidth=function(h){return console.warn("graticuleStrokeWidth() is now DEPRECATED, please use the .em-graticule CSS class"),updateCSSRule(".em-graticule","stroke-width",h),c},c.nutsrgSelFillSty=function(h){return console.warn("nutsrgSelFillSty() is now DEPRECATED, please use hoverColor() instead"),c.hoverColor_=h,c},c.titleFontSize=function(h){return console.warn("map.titleFontSize() is now DEPRECATED. please use the .em-title CSS class"),updateCSSRule(".em-title","font-size",h),c},c.subtitleFontSize=function(h){return console.warn("map.subtitleFontSize() is now DEPRECATED. please use the .em-subtitle CSS class"),updateCSSRule(".em-subtitle","font-size",h),c},c.subtitleFontWeight=function(h){return console.warn("map.subtitleFontWeight() is now DEPRECATED. please use the .em-subtitle CSS class"),updateCSSRule(".em-subtitle","font-weight",h),c},c.titleFill=function(h){return console.warn("map.titleFill() is now DEPRECATED. please use the .em-title CSS class"),updateCSSRule(".em-title","fill",h),c},c.subtitleFill=function(h){return console.warn("map.subtitleFill() is now DEPRECATED. please use the .em-subtitle CSS class"),updateCSSRule(".em-subtitle","fill",h),c},c.cntbnStroke=function(h){return console.warn("cntbnStroke() is now DEPRECATED, please use the .em-cntbn .em-bn-eu .em-bn-efta .em-bn-cc .em-bn-oth CSS classes"),h.eu&&updateCSSRule(".em-bn-eu","stroke",h.eu),h.efta&&updateCSSRule(".em-bn-efta","stroke",h.efta),h.cc&&updateCSSRule(".em-bn-cc","stroke",h.cc),h.oth&&updateCSSRule(".em-bn-oth","stroke",h.oth),h.co&&updateCSSRule(".em-bn-co","stroke",h.co),c},c.cntbnStrokeWidth=function(h){return console.warn("cntbnStrokeWidth() is now DEPRECATED, please use the .em-cntbn .em-worldbn .em-bn-eu .em-bn-efta .em-bn-cc .em-bn-oth CSS classes"),h.eu&&updateCSSRule(".em-bn-eu","stroke-width",h.eu),h.efta&&updateCSSRule(".em-bn-efta","stroke-width",h.efta),h.cc&&updateCSSRule(".em-bn-cc","stroke-width",h.cc),h.oth&&updateCSSRule(".em-bn-oth","stroke-width",h.oth),h.co&&updateCSSRule(".em-bn-co","stroke-width",h.co),c},c.worldStroke=function(h){return console.warn("map.worldStroke() is now DEPRECATED. please use the .em-worldbn .em-bn-co .em-bn-d CSS classes"),updateCSSRule(".em-worldbn","stroke",h),c},c.worldStrokeWidth=function(h){return console.warn("map.worldStrokeWidth() is now DEPRECATED. please use the .em-worldbn .em-bn-co .em-bn-d CSS classes"),updateCSSRule(".em-worldbn","stroke-width",h),c},c.worldCoastStroke=function(h){return console.warn("map.worldCoastStroke() is now DEPRECATED. please use the .em-bn-co CSS class"),updateCSSRule(".em-bn-co","stroke",h),c},c.worldCoastStrokeWidth=function(h){return console.warn("map.worldCoastStrokeWidth() is now DEPRECATED. please use the .em-bn-co CSS class"),updateCSSRule(".em-bn-co","stroke-width",h),c},c.worldFillStyle=function(h){return console.warn("map.worldFillStyle() is now DEPRECATED. please use the .em-worldrg CSS class"),updateCSSRule(".em-worldrg","fill",h),c},c.coastalMarginWidth=function(h){return console.warn("map.coastalMarginWidth() is now DEPRECATED. please use the #em-coast-margin CSS rule"),updateCSSRule("#em-coast-margin","stroke-width",h),c},c.coastalMarginColor=function(h){return console.warn("map.coastalMarginColor() is now DEPRECATED. please use the #em-coast-margin CSS rule"),updateCSSRule("#em-coast-margin","stroke",h),c},c.coastalMarginStdDev=function(h){return console.warn("map.coastalMarginStdDev() is now DEPRECATED. please use map.coastalMarginSettings.standardDeviation instead."),c.coastalMarginSettings.standardDeviation=h,c},c.fontFamily=function(h){return console.warn("map.fontFamily() is now DEPRECATED. please use the .em-map CSS class"),updateCSSRule(".em-map","font-family",h),c},c.botTxtFontSize=function(h){return console.warn("map.botTxtFontSize() is now DEPRECATED. please use the .em-footnote CSS class"),updateCSSRule(".em-footnote","font-size",h),c},c.botTxtFill=function(h){return console.warn("map.botTxtFill() is now DEPRECATED. please use the .em-footnote CSS class"),updateCSSRule(".em-footnote","fill",h),c},c.scalebarFontSize=function(h){return console.warn("map.scalebarFontSize() is now DEPRECATED. please use the .em-scalebar-label CSS class"),updateCSSRule(".em-scalebar-label","font-size",h),c},c.frameStroke=function(h){return console.warn("map.frameStroke() is now DEPRECATED. please use the .em-frame CSS class"),updateCSSRule(".em-frame","stroke",h),c},c.frameStrokeWidth=function(h){return console.warn("map.frameStrokeWidth() is now DEPRECATED. please use the .em-frame CSS class"),updateCSSRule(".em-frame","stroke-width",h),c},c.psClassifMethod=function(h){return console.warn("psClassifMethod() is now DEPRECATED. please use psClassificationMethod instead"),c.psClassificationMethod_=h,c},c.geoCenter=function(h){return console.warn("map.geoCenter() is now DEPRECATED. Please use map.position({x,y,z}) instead."),c.position_.x=h[0],c.position_.y=h[1],c},c.pixelSize=function(h){return console.warn("map.pixelSize() is now DEPRECATED. Please use the z property in map.position({x,y,z}) instead."),c.position_.z=h,c},c.pixSize=function(h){return console.warn("map.pixelSize() is now DEPRECATED. Please use the z property in map.position({x,y,z}) instead."),c.position_.z=h,c},c.tooltipText=function(h){return console.warn("map.tooltipText() is now DEPRECATED. Please use map.tooltip(config.textFunction) instead. See API reference for details."),c.tooltip_.textFunction=h,c},c.classifMethod=function(h){return console.warn("map.classifMethod() is now DEPRECATED. please use map.classificationMethod() instead."),c.classificationMethod_=h,c},c.threshold=function(h){return console.warn("map.threshold() is now DEPRECATED. please use map.thresholds() instead."),c.thresholds_=h,c},c.psThreshold=function(h){return console.warn("map.psThreshold() is now DEPRECATED. please use map.psThresholds() instead."),c.psThresholds_=h,c},c.clnb=function(h){return console.warn("map.clnb() is now DEPRECATED. please use map.numberOfClasses() instead."),c.numberOfClasses_=h,c},c.nutsLvl=function(h){return console.warn("map.nutsLvl() is now DEPRECATED. please use map.nutsLevel() instead."),c.nutsLevel_=h,c},c.lg=function(h){return console.warn("map.lg() is now DEPRECATED. please use map.language() instead."),c.language_=h,c},c.bottomText=function(h){return console.warn("bottomText is now DEPRECATED. Please use the footnote() method and em-footnote CSS class instead."),c.footnote_=h,c},c.botTxtFontSize=function(h){return console.warn("botTxtFontSize is now DEPRECATED. Please use the em-footnote CSS class instead."),c},c.botTxtFill=function(h){return console.warn("botTxtFill is now DEPRECATED. Please use the em-footnote CSS class instead."),c},c.botTxtPadding=function(h){return console.warn("botTxtPadding is now DEPRECATED. Please use the em-footnote CSS class instead."),c},c.botTxtTooltipTxt=function(h){return console.warn("botTxtTooltipTxt is now DEPRECATED. Please use footnoteTooltipText() instead."),c},c.tooltipShowFlags=function(h){return console.warn("tooltipShowFlags is now DEPRECATED. Please use out.tooltip({showFlags}) instead."),c.tooltip_.showFlags=h,c},c.colorFun=function(h){return console.warn("colorFun is now DEPRECATED. Please use out.colorFunction() instead."),c.colorFunction_=h,c},c.filtersDefinitionFun=function(h){return console.warn("filtersDefinitionFun is now DEPRECATED. Please use out.filtersDefinitionFunction() instead."),c.filtersDefinitionFunction_=h,c},c.labelling=function(h){return console.warn("labelling is now DEPRECATED. Please use out.labels({}) configuration object instead. See documentation for details."),c},c.labelsConfig=function(h){return console.warn("labelsConfig is now DEPRECATED. Please use out.labels({config:yourConfig}) configuration object instead. See documentation for details."),c.labels_=Object.assign(c.labels_||{},{config:h}),c},c.statLabelsPositions=function(h){return console.warn("statLabelsPositions is now DEPRECATED. Please use out.labels({statLabelsPositions:yourPositions}) instead. See documentation for details."),c.labels_=Object.assign(c.labels_||{},{statLabelsPositions:h}),c},c.labelsToShow=function(h){return console.warn("labelsToShow is now DEPRECATED. Please use out.labels({labelFilterFunction:yourFunction(region,map)}) function instead. See documentation for details."),c},c.labelShadowsToShow=function(h){return console.warn("labelShadowsToShow is now DEPRECATED. Please use out.labels({labelFilterFunction:yourFunction(region,map)}) function instead. See documentation for details."),c},c.labelShadow=function(h){return console.warn("labelShadow is now DEPRECATED. Please use out.labels({labelShadow:boolean}) instead. See documentation for details."),c},c.labelShadowWidth=function(h){return console.warn("labelShadow is now DEPRECATED. Please use out.labels({labelShadow:boolean}) instead. See documentation for details."),c},c.labelFilterFunction=function(h){return console.warn("labelFilterFunction is now DEPRECATED. Please use out.labels({labelFilterFunction:yourFunction(region,map)}) instead. See documentation for details."),c},c.labelFill=function(h){return console.warn("map.labelFill() is now DEPRECATED. please use the .em-stat-labels CSS class"),c},c.labelStroke=function(h){return console.warn("map.labelStroke() is now DEPRECATED. please use the .em-stat-labels CSS class"),c},c.labelStrokeWidth=function(h){return console.warn("map.labelStrokeWidth() is now DEPRECATED. please use the .em-stat-labels CSS class"),c},c.labelOpacity=function(h){return console.warn("map.labelOpacity() is now DEPRECATED. please use the .em-stat-labels CSS class"),c},c.labelValuesFontSize=function(h){return console.warn("map.labelValuesFontSize() is now DEPRECATED. please use the .em-stat-labels CSS class"),c},c.labelShadowWidth=function(h){return console.warn("map.labelShadowWidth() is now DEPRECATED. please use the .em-stat-labels-shadows CSS class"),c},c.labelShadowColor=function(h){return console.warn("map.labelShadowColor() is now DEPRECATED. please use the .em-stat-labels-shadows CSS class"),c},c.countriesToShow=function(h){return console.warn("map.countriesToShow() is now DEPRECATED. please use the map.filterGeometriesFunction() function if you wish to filter the default geometries."),c},c.bordersToShow=function(h){return console.warn("map.bordersToShow() is now DEPRECATED. please use the map.filterGeometriesFunction() function if you wish to filter the default geometries."),c},c.flowDonutSizeScale=function(h){return console.warn("map.flowDonutSizeScale() is now DEPRECATED. please use flowNodeSizeScale_() instead."),c.flowDonutSizeScale_=h,c},c.flowDonuts=function(h){return console.warn('map.flowDonuts() is now DEPRECATED. please use flowNodes(true).flowNodeType("donut") instead.'),c.flowNodeType_=h?"donut":"circle",c},c.flowMapType=function(h){return console.warn("map.flowMapType() is now DEPRECATED. please use flowLineType() instead."),c.flowLineType_=h,c},c.flowGradient=function(h){return console.warn("map.flowGradient() is now DEPRECATED. please use flowColorGradient() or flowWidthGradient() instead."),c.flowColorGradient_=h,c},c.flowOverlayColors=function(h){return console.warn("map.flowOverlayColors() is now DEPRECATED. please use flowRegionColors() instead."),c.flowRegionColors_=h,c},c.getFillPatternDefinitionFun=function(h){return console.warn("getFillPatternDefinitionFun is now DEPRECATED. please use fillPatternDefinitionFunction() instead."),c.fillPatternDefinitionFunction_=h,c}}(m),m.geo=function(c){return arguments.length?(m.geo_=c.toUpperCase(),m):m.geo_},["tooltip_","nuts2jsonBaseURL_","processCentroids_","coastalMarginSettings_"].forEach(function(c){m[c.substring(0,c.length-1)]=function(h){if(!arguments.length)return m[c];if("object"!==_typeof(h)||null===h||Array.isArray(h))m[c]=h;else for(var g in h)m[c][g]=h[g];return m.insetTemplates_&&Bt(m.insetTemplates_,m.svgId_,function(h,g){h[c.substring(0,c.length-1)](g)},h),m}}),m.title=function(c){return arguments.length?(m.title_=c,m.svg()&&m.svg().select("#title"+m.geo()).text(c),m):m.title_},m.subtitle=function(c){return arguments.length?(m.subtitle_=c,m.svg()&&m.svg().select("#subtitle"+m.geo()).text(c),m):m.subtitle_},m.insets=function(){return arguments.length?(1==arguments.length&&"default"===arguments[0]?m.insets_="default":1==arguments.length&&!1===arguments[0]?m.insets_=!1:1==arguments.length&&Array.isArray(arguments[0])?m.insets_=arguments[0]:m.insets_=arguments,m):m.insets_},m.drawGraticule=function(c){if(!arguments.length)return m.drawGraticule_;m.drawGraticule_=c;var h=m.svg_?m.svg().select("#em-graticule"):null,g=m.svg_?m.svg_.select("#em-zoom-group-"+m.svgId_):null;return h&&(h._groups[0][0]&&0==c?h.remove():m.Geometries.geoJSONs.graticule&&m._pathFunction&&g&&1==c&&(h.remove(),g.append("g").attr("id","em-graticule").selectAll("path").data(m.Geometries.geoJSONs.graticule).enter().append("path").attr("d",m._pathFunction).attr("class","em-graticule"),m.svg().select("#em-graticule").each(function(){"WORLD"==m.geo_?this.parentNode.insertBefore(this,this.parentNode.childNodes[3]):this.parentNode.insertBefore(this,this.parentNode.childNodes[1])}))),m},m.drawCoastalMargin=function(c){return arguments.length?(m.drawCoastalMargin_=c,appendCoastalMargin(m),m):m.drawCoastalMargin_},m.annotations=function(c){return arguments.length?(m.annotations_=c,appendAnnotations(m),m):m.annotations_},m.stamp=function(c){return arguments.length?(m.stamp_=c,to(m.stamp_,m),m):m.stamp_},m.minimap=function(c){return arguments.length?(m.minimap_=c,Ui(m),m):m.minimap_},m.labels=function(c){return arguments.length?(m.labels_=c,void 0===m.labels_.scaleOnZoom&&(m.labels_.scaleOnZoom=!0),function updateLabels(c){if(c.svg_){var h=c.svg_.selectAll("#em-labels > *");if(h&&h.remove(),c.labels_){var g=c.labels_,m=c.svg_.select("#em-zoom-group-"+c.svgId_);Nr(c,m),g.values&&c.updateValuesLabels&&c.updateValuesLabels(c),c.insetTemplates_&&Bt(c.insetTemplates_,c.svgId_,function applyLabelsCallback(c){if(g){var h=c.svg_.select("#em-zoom-group-"+c.svgId_);c.labels_&&Nr(c,h),g.values&&c.updateValuesLabels&&c.updateValuesLabels(c)}})}}}(m),m):m.labels_},m.position=function(c){return arguments.length?(m.position_=c,function setMapView(c,h){if(c.svg_&&c.__zoomBehavior){var g=c.svg_,m=g.select("#em-zoom-group-"+c.svgId_),b=c.__baseZ/h.z,w=slicedToArray_slicedToArray(c._projection([h.x,h.y]),2),S=w[0],M=w[1],k=c.width_/2-S*b,T=c.height_/2-M*b,E=As.translate(k,T).scale(b);c.__programmaticZoom={x:h.x,y:h.y,z:h.z},c.__lastTransform=E,g.call(c.__zoomBehavior.transform,E),m.attr("data-zoom",b),c.position_.x=h.x,c.position_.y=h.y,c.position_.z=h.z}}(m,c),m):m.position_},m.Geometries=Kr(m,h),m.updateGeoMapTemplate=function(c){return c||console.warn("⚠️ map.updateGeoMapTemplate called without callback function!"),m.Geometries.defaultGeoData=null,m.Geometries.allNUTSGeoData=null,m.Geometries.centroidsData=null,m.geometries_?(m.Geometries.setUserGeometries(m.geometries_),m.buildMapTemplate(),c&&c()):m.Geometries.getDefaultGeoData(m.geo_,m.filterGeometriesFunction_,m.nutsLevel_).then(function(){m.buildMapTemplate(),c&&c()}),Bt(m.insetTemplates_,m.svgId_,function(h){h.updateGeoMapTemplate(c)}),m};m.buildMapTemplateBase=function(){var c=function createMapSVG(c){var h=src_select("#"+c.svgId());return 0==h.size()&&(h=src_select("body").append("svg").attr("id",c.svgId())),h.attr("class","em-map"),h.classed("em--"+c._mapType,!0),"pie"!==c._mapType&&"coxcomb"!==c._mapType||h.classed("em--ps",!0),h}(m);m.svg_=c,m.isInset||(m._wrapper_=function wrapMapSvg(c){var h,g=c.node();if(g){var m=g.parentNode;if(m&&!(m instanceof SVGElement)){if(null!==(h=m.classList)&&void 0!==h&&h.contains("em-map-wrapper"))return m;var b=document.createElement("div");return b.className="em-map-wrapper",m.insertBefore(b,g),b.appendChild(g),b}}}(c)),m.containerId_||(m.containerId_=m.svgId_),m.tooltip_.containerId||(m.tooltip_.containerId=m.containerId_),src_selectAll("#"+m.svgId()+" > *").remove(),"WORLD"==m.geo_.toUpperCase()&&(m.height()||m.height(.55*m.width()),c.attr("width",m.width()).attr("height",m.height()),m.proj_=54030),m.height()||m.height(.85*m.width()),c.attr("width",m.width()).attr("height",m.height()),c.append("defs").attr("class","em-defs").append("clipPath").attr("id",m.svgId_+"-clip-path").append("rect").attr("x",0).attr("y",0).attr("width",m.width_).attr("height",m.height_),m.drawCoastalMargin_&&c.append("filter").attr("id","em-coastal-blur").attr("x",m.coastalMarginSettings_.x).attr("y",m.coastalMarginSettings_.y).attr("width",m.coastalMarginSettings_.width).attr("height",m.coastalMarginSettings_.height).append("feGaussianBlur").attr("in","SourceGraphic").attr("stdDeviation",m.coastalMarginSettings_.standardDeviation),c.append("g").attr("id","em-header-"+m.svgId_).attr("class","em-header");var g=c.append("g").attr("id","em-drawing-"+m.svgId_).attr("class","em-drawing-group").attr("clip-path","url(#".concat(m.svgId_,"-clip-path)"));(m.zoomExtent_||m.zoomButtons_)&&g.classed("em-draggable",!0);g.append("g").attr("id","em-zoom-group-"+m.svgId_).attr("class","em-zoom-group");return c.append("g").attr("id","em-footer-"+m.svgId_).attr("class","em-footer"),function removeInsets(c){if(c.insetTemplates_){for(var h in c.insetTemplates_){var g=src_select("#"+c.insetTemplates_[h].svgId_);g&&g.html("")}c.insetTemplates_={}}}(m),function buildInsets(c,h,g){if(!c.insets_||0===c.insets_.length)return c;c.insetBoxPosition_||(c.insetBoxPosition_=[c.width_-c.insetBoxWidth_-2*c.insetBoxPadding_,2*c.insetBoxPadding_]);var m=src_select("#"+c.svgId_).select("#em-drawing-"+c.svgId_).append("g").attr("id","em-insets-group").attr("class","em-insets").attr("transform","translate("+c.insetBoxPosition_[0]+","+c.insetBoxPosition_[1]+")");"default"===c.insets_&&(c.insets_=Jr(c.insetBoxWidth_,c.insetBoxPadding_));for(var b=0;b<c.insets_.length;b++){var w=c.insets_[b];if(w.svgId=w.svgId||"inset"+w.geo+Math.random().toString(36).substring(7),0==src_select("#"+w.svgId).size()){var S=null==w.x?c.insetBoxPadding_:w.x,M=null==w.y?c.insetBoxPadding_+b*(c.insetBoxPadding_+c.insetBoxWidth_):w.y;m.append("g").attr("id","em-inset-"+w.svgId).attr("class","em-inset").attr("transform","translate("+S+","+M+")").append("svg").attr("id",w.svgId)}if(c.insetTemplates_[w.geo]){var k=Zr(w,c,h,g);k.buildMapTemplateBase(),c.insetTemplates_[w.geo]=[c.insetTemplates_[w.geo],k]}else{var T=Zr(w,c,h,g).buildMapTemplateBase();c.insetTemplates_[w.geo]=T}}}(m,h,m._mapType),g.append("rect").attr("id","em-frame-"+m.geo_).attr("class","em-frame").attr("x",0).attr("y",0).attr("width",m.width_).attr("height",m.height_),m.stamp_&&to(m.stamp_,m),m},m.buildMapTemplate=function(){var c=m.svg().select("#em-zoom-group-"+m.svgId_);return c.selectAll("*").remove(),1==m.gridCartogram_?(!function buildGridCartogramBase(c){var h=src_select("#em-zoom-group-".concat(c.svgId_)).append("g").attr("id","em-grid-container");c.gridCartogramMargins_=c.gridCartogramMargins_||{top:80,right:80,bottom:80,left:80};var g=uo(c),m=ho(g),b=po(m,c);"hexagon"===c.gridCartogramShape_?go(h,b,c):fo(h,b,c),yo(h,c.width_,c.height_,c.gridCartogramMargins_)}(m),m.footnote_==m.defaultFootnote_&&(m.footnote_=!1),m.footnoteTooltipText_==m.defaultFootnoteTooltipText_&&(m.footnoteTooltipText_=!1)):(m.position_.x&&m.position_.y||T(),m.position_.z=m.position_.z||E(),I(),P(),m.backgroundMap_&&k(m)),(m.zoomExtent_||m.zoomButtons_)&&(m.zoomExtent_||(m.zoomExtent_=[1,10]),bs(m)),h&&!m.gridCartogram_&&S(m),m.labels_&&!m.gridCartogram_&&Nr(m,c),m.annotations_&&(appendAnnotations(m),m.annotationsAdded=!0),m.placenames_&&!m.gridCartogram_&&function addPlacenameLabels(c){return _addPlacenameLabels.apply(this,arguments)}(m),m.title()&&function addTitle(c){var h=c.isInset?"em-inset-title":"em-title";c.titlePosition()||c.titlePosition([10,Pt(h)+(c.isInset?0:10)]),c.header_&&!c.isInset&&c.svg().select("#em-header-"+c.svgId_).empty()&&c.svg().append("g").attr("id","em-header-"+c.svgId_).attr("class","em-header");var g=c.header_&&!c.isInset?c.svg().select("#em-header-"+c.svgId_):c.svg();g.select("#title"+c.geo_).remove(),g.append("text").attr("id","title"+c.geo_).attr("class",h).attr("x",c.titlePosition()[0]).attr("y",c.titlePosition()[1]).html(c.title())}(m),m.subtitle()&&function addSubtitle(c){if(c.subtitle()){var h=c.isInset?"em-inset-subtitle":"em-subtitle",g=c.isInset?"em-inset-title":"em-title";c.subtitlePosition()||c.subtitlePosition([10,Pt(g)+Pt(h)+15]),c.header_&&!c.isInset&&c.svg().select("#em-header-"+c.svgId_).empty()&&c.svg().append("g").attr("id","em-header-"+c.svgId_).attr("class","em-header");var m=c.header_&&!c.isInset?c.svg().select("#em-header-"+c.svgId_):c.svg();m.select("#subtitle"+c.geo_).remove(),m.append("text").attr("id","subtitle"+c.geo_).attr("class",h).attr("x",c.subtitlePosition()[0]).attr("y",c.subtitlePosition()[1]).html(c.subtitle())}}(m),m.footnote_&&function addFootnote(c){var h,g=c.footnoteWrap_||1/0,m=c.footnote_||"";h=c.footer_&&!c.isInset?c.footnotePosition_?[c.footnotePosition_[0],c.footnotePosition_[1]]:[5,10]:c.footnotePosition_?c.footnotePosition_:[10,c.height_];var b,w=c.svg();c.footer_&&!c.isInset?(b=w.select("#em-footer-"+c.svgId_)).empty()&&(b=w.append("g").attr("id","em-footer-"+c.svgId_).attr("class","em-footer")):b=w,b.select("#em-footnote").remove();var S,M=b.append("text").attr("id","em-footnote").attr("class","em-footnote").attr("x",h[0]).attr("y",h[1]),k="",T=0,E=texts_createForOfIteratorHelper(m.split(/(\s+)/));try{for(E.s();!(S=E.n()).done;){var I=S.value;(k+I).length>g&&k.length>0?(M.append("tspan").attr("x",h[0]).attr("dy",0===T?0:"1.2em").html(k.trim()),k=I,T++):k+=I}}catch(c){E.e(c)}finally{E.f()}k.trim().length>0&&M.append("tspan").attr("x",h[0]).attr("dy",0===T?0:"1.2em").html(k.trim()),M.on("mouseover",function(){c._tooltip.mw___=c._tooltip.style("max-width"),c._tooltip.style("max-width","400px"),c.footnoteTooltipText_&&c._tooltip.mouseover(c.footnoteTooltipText_)}).on("mousemove",function(h){c.footnoteTooltipText_&&c._tooltip.mousemove(h)}).on("mouseout",function(){c.footnoteTooltipText_&&c._tooltip.mouseout(),c._tooltip.style("max-width",c._tooltip.mw___)})}(m),m.showEstatLogo_&&function addEurostatLogo(c){var h=c.svg(),g=h.select("#em-logo-group");g.empty()&&(g=h.append("g").attr("id","em-logo-group").attr("class","em-logo-group"));var m=c.logoWidth_||200,b=c.logoHeight_||40,w=c.logoPosition_?c.logoPosition_[0]:c.width_-m-10,S=c.logoPosition_?c.logoPosition_[1]:c.height_-b-10;g.selectAll(".em-eurostat-logo").remove(),g.append("image").attr("href","data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20%20%20%20%20viewBox%3D%22317.6%20263.7%20206.4%2067.9%22%20%20%20%20%20preserveAspectRatio%3D%22xMinYMid%20meet%22%20%20%20%20%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20%20%20%20%20xml%3Aspace%3D%22preserve%22%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E.st0%7Bfill%3Anone%3B%7D.st1%7Bfill%3A%23164194%3B%7D.st2%7Bfill%3A%23FFED00%3B%7D.st3%7Bfill%3A%237C7C7B%3B%7D%3C%2Fstyle%3E%3Crect%20x%3D%22317.6%22%20y%3D%22263.7%22%20class%3D%22st0%22%20width%3D%22206.4%22%20height%3D%2267.9%22%2F%3E%3Cg%3E%3Cg%3E%3Cg%20id%3D%22EUflag_16_%22%3E%3Cpolygon%20class%3D%22st1%22%20points%3D%22501.4%2C309%20501.4%2C286.3%20467.4%2C286.3%20467.4%2C309%20501.4%2C309%20%22%2F%3E%3C%2Fg%3E%3Cg%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22485%2C289.8%20486.1%2C289.8%20485.2%2C290.5%20485.6%2C291.6%20484.6%2C290.9%20483.7%2C291.6%20484.1%2C290.5%20483.2%2C289.8%20484.3%2C289.8%20484.6%2C288.7%20485%2C289.8%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22485%2C304.9%20486.2%2C304.9%20485.2%2C305.6%20485.6%2C306.7%20484.7%2C306%20483.8%2C306.7%20484.1%2C305.6%20483.2%2C304.9%20484.3%2C304.9%20484.7%2C303.8%20485%2C304.9%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22488.8%2C303.9%20489.9%2C303.9%20489%2C304.6%20489.3%2C305.7%20488.4%2C305%20487.5%2C305.7%20487.9%2C304.6%20486.9%2C303.9%20488.1%2C303.9%20488.4%2C302.8%20488.8%2C303.9%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22488.8%2C290.8%20489.9%2C290.8%20489%2C291.5%20489.3%2C292.6%20488.4%2C291.9%20487.5%2C292.6%20487.9%2C291.5%20486.9%2C290.8%20488.1%2C290.8%20488.4%2C289.7%20488.8%2C290.8%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22491.5%2C293.6%20492.7%2C293.6%20491.8%2C294.3%20492.1%2C295.4%20491.2%2C294.7%20490.3%2C295.4%20490.6%2C294.3%20489.7%2C293.6%20490.9%2C293.6%20491.2%2C292.5%20491.5%2C293.6%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22491.5%2C301.2%20492.7%2C301.2%20491.8%2C301.9%20492.1%2C302.9%20491.2%2C302.3%20490.3%2C302.9%20490.6%2C301.9%20489.7%2C301.2%20490.9%2C301.2%20491.2%2C300.1%20491.5%2C301.2%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22492.6%2C297.3%20493.7%2C297.3%20492.8%2C298%20493.1%2C299.1%20492.2%2C298.4%20491.3%2C299.1%20491.7%2C298%20490.8%2C297.3%20491.9%2C297.3%20492.2%2C296.3%20492.6%2C297.3%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22481.2%2C290.8%20482.3%2C290.8%20481.4%2C291.5%20481.7%2C292.6%20480.8%2C291.9%20479.9%2C292.6%20480.3%2C291.5%20479.4%2C290.8%20480.5%2C290.8%20480.8%2C289.7%20481.2%2C290.8%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22478.5%2C293.6%20479.6%2C293.6%20478.7%2C294.3%20479%2C295.4%20478.1%2C294.7%20477.2%2C295.4%20477.6%2C294.3%20476.7%2C293.6%20477.8%2C293.6%20478.1%2C292.5%20478.5%2C293.6%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22477.5%2C297.3%20478.6%2C297.3%20477.7%2C298%20478%2C299.1%20477.1%2C298.4%20476.2%2C299.1%20476.6%2C298%20475.7%2C297.3%20476.8%2C297.3%20477.1%2C296.3%20477.5%2C297.3%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22478.5%2C301.2%20479.6%2C301.2%20478.7%2C301.9%20479%2C303%20478.1%2C302.3%20477.2%2C303%20477.6%2C301.9%20476.7%2C301.2%20477.8%2C301.2%20478.1%2C300.1%20478.5%2C301.2%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22481.2%2C303.9%20482.3%2C303.9%20481.4%2C304.6%20481.8%2C305.7%20480.9%2C305%20480%2C305.7%20480.3%2C304.6%20479.4%2C303.9%20480.5%2C303.9%20480.9%2C302.9%20481.2%2C303.9%20%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%3E%3Cpath%20class%3D%22st3%22%20d%3D%22M337.3%2C304.5c0.7%2C0.7%2C1.8%2C1.1%2C3.1%2C1.1c1%2C0%2C1.8-0.2%2C2.5-0.7s1.1-1%2C1.3-1.5h4.2c-0.7%2C2.1-1.7%2C3.6-3.1%2C4.5c-1.4%2C0.9-3.1%2C1.4-5.1%2C1.4c-1.4%2C0-2.6-0.2-3.7-0.7c-1.1-0.4-2-1.1-2.8-1.9s-1.4-1.8-1.8-2.9c-0.4-1.1-0.6-2.4-0.6-3.7c0-1.3%2C0.2-2.5%2C0.6-3.7c0.4-1.1%2C1-2.1%2C1.8-2.9c0.8-0.8%2C1.7-1.5%2C2.8-1.9c1.1-0.5%2C2.3-0.7%2C3.6-0.7c1.5%2C0%2C2.8%2C0.3%2C3.9%2C0.9s2%2C1.4%2C2.7%2C2.3c0.7%2C1%2C1.2%2C2.1%2C1.5%2C3.3c0.3%2C1.2%2C0.4%2C2.5%2C0.3%2C3.9h-12.6C336.2%2C302.7%2C336.6%2C303.8%2C337.3%2C304.5z%20M342.8%2C295.3c-0.6-0.6-1.5-0.9-2.6-0.9c-0.8%2C0-1.4%2C0.1-1.9%2C0.4c-0.5%2C0.3-0.9%2C0.6-1.2%2C1c-0.3%2C0.4-0.5%2C0.8-0.6%2C1.2c-0.1%2C0.4-0.2%2C0.8-0.2%2C1.2h7.8C343.7%2C296.9%2C343.3%2C296%2C342.8%2C295.3z%20M462.6%2C291v3.9h-3.1v8.2c0%2C0.8%2C0%2C1.4%2C0.3%2C1.6c0.3%2C0.3%2C0.8%2C0.4%2C1.6%2C0.4c0.3%2C0%2C0.4%2C0%2C0.7%2C0c0.2%2C0%2C0.6-0.1%2C0.6-0.1v3.7c0%2C0.1-0.8%2C0.1-1.3%2C0.1c-0.5%2C0-0.9%2C0-1.4%2C0c-0.7%2C0-1.4%2C0-2.1-0.2c-0.7-0.1-1.2-0.3-1.7-0.6c-0.5-0.3-0.8-0.7-1.1-1.2c-0.3-0.5-0.3-1.2-0.3-2.1V295h-3.1V291h3.1v-4.7h4.7v4.7H462.6z%20M443.9%2C300.7c-0.3%2C0.1-0.6%2C0.2-0.9%2C0.2c-0.3%2C0.1-0.7%2C0.1-1.1%2C0.2c-0.4%2C0.1-0.8%2C0.1-1.1%2C0.2c-0.4%2C0.1-0.7%2C0.1-1%2C0.3c-0.4%2C0.1-0.7%2C0.3-0.9%2C0.5c-0.3%2C0.2-0.5%2C0.4-0.6%2C0.7c-0.2%2C0.3-0.2%2C0.7-0.2%2C1.1c0%2C0.4%2C0.1%2C0.8%2C0.2%2C1.1c0.2%2C0.3%2C0.4%2C0.5%2C0.6%2C0.7c0.3%2C0.2%2C0.6%2C0.3%2C0.9%2C0.4c0.4%2C0.1%2C0.7%2C0.1%2C1.1%2C0.1c0.9%2C0%2C1.7-0.1%2C2.2-0.5c0.5-0.3%2C0.9-0.7%2C1.1-1.1c0.2-0.4%2C0.3-0.9%2C0.4-1.3c0.1-0.5%2C0-0.8%2C0-1.1v-1.8C444.6%2C300.4%2C444.2%2C300.6%2C443.9%2C300.7%20M434.6%2C293.8c0.5-0.7%2C1.1-1.3%2C1.9-1.7c0.8-0.5%2C1.6-0.7%2C2.6-0.9c0.9-0.2%2C1.9-0.3%2C2.9-0.3c0.9%2C0%2C1.8%2C0.1%2C2.7%2C0.2c0.9%2C0.1%2C1.7%2C0.4%2C2.5%2C0.7c0.7%2C0.4%2C1.2%2C0.9%2C1.7%2C1.5c0.5%2C0.6%2C0.6%2C1.5%2C0.6%2C2.5v9.1c0%2C0.8%2C0.2%2C1.5%2C0.3%2C2.2c0.1%2C0.7%2C0.3%2C1.3%2C0.5%2C1.6l-4.8%2C0c-0.1-0.3-0.1-0.5-0.2-0.8c-0.1-0.3-0.1-0.6-0.1-0.9c-0.8%2C0.8-1.7%2C1.3-2.7%2C1.6c-1%2C0.3-2.1%2C0.5-3.2%2C0.5c-0.8%2C0-1.6-0.1-2.3-0.3c-0.7-0.2-1.3-0.5-1.9-0.9c-0.5-0.4-1-1-1.3-1.6c-0.3-0.7-0.4-1.4-0.4-2.3c0-1%2C0.2-1.8%2C0.5-2.4c0.3-0.6%2C0.8-1.2%2C1.3-1.5c0.5-0.4%2C1.2-0.7%2C1.9-0.9c0.7-0.2%2C1.4-0.3%2C2.1-0.5c0.7-0.1%2C1.4-0.2%2C2.1-0.3c0.7-0.1%2C1.3-0.2%2C1.9-0.3c0.5-0.1%2C1-0.3%2C1.3-0.6c0.3-0.3%2C0.5-0.6%2C0.4-1.1c0-0.5-0.1-0.9-0.3-1.2c-0.2-0.3-0.4-0.5-0.7-0.7c-0.3-0.2-0.6-0.3-1-0.3c-0.4-0.1-0.8-0.1-1.2-0.1c-0.9%2C0-1.7%2C0.1-2.2%2C0.5c-0.5%2C0.4-0.8%2C1.1-0.9%2C1.9h-4.8C433.9%2C295.7%2C434.1%2C294.6%2C434.6%2C293.8%20M431.3%2C291v3.9h-3.9v8.2c0%2C0.8%2C0.3%2C1.4%2C0.5%2C1.6c0.3%2C0.3%2C0.9%2C0.4%2C1.7%2C0.4c0.3%2C0%2C0.6%2C0%2C0.9%2C0c0.3%2C0%2C0.8-0.1%2C0.8-0.1v3.7c-0.8%2C0.1-0.9%2C0.1-1.4%2C0.1c-0.5%2C0-1%2C0-1.5%2C0c-0.7%2C0-1.5%2C0-2.1-0.2c-0.7-0.1-1.3-0.3-1.8-0.6c-0.5-0.3-1-0.7-1.3-1.2c-0.3-0.5-0.5-1.2-0.5-2.1V295h-2.3V291h2.3v-4.7h4.7v4.7H431.3z%20M407.5%2C304.3c0.2%2C0.4%2C0.5%2C0.8%2C0.8%2C1c0.3%2C0.2%2C0.7%2C0.5%2C1.2%2C0.6c0.4%2C0.1%2C0.9%2C0.2%2C1.3%2C0.2c0.3%2C0%2C0.7%2C0%2C1.1-0.1c0.4-0.1%2C0.7-0.2%2C1-0.4c0.3-0.2%2C0.6-0.4%2C0.8-0.7c0.2-0.3%2C0.3-0.6%2C0.3-1.1c0-0.7-0.5-1.3-1.4-1.6c-1-0.4-2.3-0.7-4-1.1c-0.7-0.2-1.4-0.4-2-0.6c-0.7-0.2-1.2-0.5-1.8-0.8c-0.5-0.4-0.9-0.8-1.2-1.3c-0.3-0.5-0.5-1.2-0.5-1.9c0-1.1%2C0.2-2%2C0.7-2.7c0.4-0.7%2C1-1.3%2C1.7-1.7c0.7-0.4%2C1.5-0.7%2C2.4-0.9c0.9-0.2%2C1.8-0.2%2C2.8-0.2c0.9%2C0%2C1.9%2C0.1%2C2.7%2C0.3c0.9%2C0.2%2C1.7%2C0.5%2C2.4%2C0.9c0.7%2C0.4%2C1.3%2C1%2C1.7%2C1.7c0.5%2C0.7%2C0.7%2C1.9%2C0.8%2C2.7h-4.5c-0.1-0.8-0.4-1.6-1-1.9c-0.6-0.3-1.4-0.5-2.2-0.5c-0.3%2C0-0.6%2C0-0.9%2C0c-0.3%2C0-0.6%2C0.1-0.9%2C0.2c-0.3%2C0.1-0.5%2C0.3-0.7%2C0.5c-0.2%2C0.2-0.3%2C0.5-0.3%2C0.9c0%2C0.4%2C0.2%2C0.8%2C0.5%2C1c0.3%2C0.3%2C0.7%2C0.5%2C1.2%2C0.7c0.5%2C0.2%2C1.1%2C0.3%2C1.7%2C0.5c0.6%2C0.1%2C1.3%2C0.3%2C2%2C0.4c0.7%2C0.2%2C1.4%2C0.3%2C2%2C0.6c0.7%2C0.2%2C1.2%2C0.5%2C1.8%2C0.9c0.5%2C0.4%2C0.9%2C0.8%2C1.2%2C1.4c0.3%2C0.6%2C0.5%2C1.2%2C0.5%2C2c0%2C1.1-0.2%2C2.1-0.7%2C2.9c-0.5%2C0.8-1.1%2C1.4-1.8%2C1.9c-0.7%2C0.5-1.6%2C0.8-2.5%2C1c-1%2C0.2-1.9%2C0.3-2.9%2C0.3c-1%2C0-2-0.1-2.9-0.3c-1-0.2-1.8-0.5-2.6-1c-0.7-0.5-1.4-1.3-1.8-2c-0.5-0.8-0.7-1.5-0.8-3.1h4.5C407.2%2C303.6%2C407.3%2C303.9%2C407.5%2C304.3%20M383.7%2C296.3c0.4-1.1%2C1-2.1%2C1.8-2.9c0.8-0.8%2C1.7-1.4%2C2.8-1.8c1.1-0.4%2C2.3-0.6%2C3.7-0.6c1.4%2C0%2C2.6%2C0.2%2C3.7%2C0.6c1.1%2C0.4%2C2%2C1.1%2C2.8%2C1.8c0.8%2C0.8%2C1.4%2C1.8%2C1.8%2C2.9c0.4%2C1.1%2C0.6%2C2.4%2C0.6%2C3.8c0%2C1.4-0.2%2C2.6-0.6%2C3.8c-0.4%2C1.1-1%2C2.1-1.8%2C2.9c-0.8%2C0.8-1.7%2C1.4-2.8%2C1.8c-1.1%2C0.4-2.4%2C0.6-3.7%2C0.6c-1.4%2C0-2.6-0.2-3.7-0.6c-1.1-0.4-2-1-2.8-1.8c-0.8-0.8-1.4-1.8-1.8-2.9c-0.4-1.1-0.6-2.4-0.6-3.8C383.1%2C298.7%2C383.3%2C297.4%2C383.7%2C296.3%20M388.1%2C302.1c0.1%2C0.7%2C0.4%2C1.3%2C0.7%2C1.8c0.3%2C0.5%2C0.8%2C0.9%2C1.3%2C1.3c0.5%2C0.3%2C1.2%2C0.5%2C2%2C0.5c0.8%2C0%2C1.5-0.2%2C2-0.5c0.5-0.3%2C1-0.7%2C1.3-1.3c0.3-0.5%2C0.6-1.1%2C0.7-1.8c0.1-0.7%2C0.2-1.3%2C0.2-2c0-0.7-0.1-1.4-0.2-2.1c-0.1-0.7-0.4-1.3-0.7-1.8c-0.3-0.5-0.8-0.9-1.3-1.3c-0.6-0.3-1.2-0.5-2-0.5c-0.8%2C0-1.5%2C0.2-2%2C0.5c-0.5%2C0.3-1%2C0.8-1.3%2C1.3c-0.3%2C0.5-0.5%2C1.1-0.7%2C1.8c-0.1%2C0.7-0.2%2C1.4-0.2%2C2.1C387.9%2C300.8%2C387.9%2C301.5%2C388.1%2C302.1%20M376.5%2C291v3.9h-0.1c0.2-0.8%2C0.5-1.2%2C0.9-1.7c0.4-0.5%2C0.8-0.9%2C1.3-1.3c0.5-0.3%2C1-0.6%2C1.6-0.8c0.6-0.2%2C1.1-0.3%2C1.6-0.3c0.3%2C0%2C0.9%2C0%2C0.9%2C0.1v4.4c0%2C0-0.4-0.1-0.7-0.1c-0.3%2C0-0.6%2C0-0.9%2C0c-0.9%2C0-1.6%2C0.1-2.2%2C0.4c-0.6%2C0.3-1.1%2C0.7-1.4%2C1.2c-0.4%2C0.5-0.6%2C1.1-0.8%2C1.8c-0.2%2C0.7-0.2%2C1.4-0.2%2C2.2v8.1h-4.7v-18H376.5z%20M363.2%2C309v-2.3h0c-0.6%2C0.8-1.4%2C1.6-2.4%2C2c-1%2C0.4-1.9%2C0.6-3%2C0.6c-1.3%2C0-2.3-0.2-3.1-0.5c-0.8-0.3-1.5-0.8-1.9-1.4c-0.5-0.6-0.8-1.4-1-2.3c-0.2-0.9-0.3-1.9-0.3-3V291h4.7v10.2c0%2C1.4%2C0.3%2C2.5%2C0.8%2C3.2c0.5%2C0.7%2C1.3%2C1.1%2C2.4%2C1.1c1.3%2C0%2C2.3-0.4%2C2.9-1.2c0.6-0.8%2C1-2.1%2C1-3.8V291h4.7v18H363.2z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E").attr("width",m).attr("height",b).attr("x",w).attr("y",S).attr("class","em-eurostat-logo")}(m),m.showEstatRibbon_&&function addEurostatRibbon(c){var h=c.svg(),g=h.select("#em-logo-group");g.empty()&&(g=h.append("g").attr("id","em-logo-group").attr("class","em-logo-group"));var m=c.ribbonWidth_||200,b=c.ribbonHeight_||40,w=c.ribbonPosition_?c.ribbonPosition_[0]:c.width_-m-10,S=c.ribbonPosition_?c.ribbonPosition_[1]:c.height_-b-10;c.footer&&!c.ribbonPosition_&&(S+=80),g.selectAll(".em-eurostat-ribbon").remove(),g.append("image").attr("href","data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNDAiIGhlaWdodD0iNjMiIHZpZXdCb3g9IjAgMCAxNDAgNjMiPgogIDxkZWZzPgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQiIHgxPSIwLjE1NSIgeTE9IjEiIHgyPSIwLjgzNyIgeTI9IjAuMDExIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iIzA4MmI3YSIgLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIwLjUiIHN0b3AtY29sb3I9IiMwZTQ3Y2IiIC8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQtMiIgeDE9IjAuNzU5IiB5MT0iMC45OTEiIHgyPSIwLjI0MyIgeTI9IjAuMDEzIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2Y0ZjVmNSIgLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjN2Q4MDg4IiAvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0ibGluZWFyLWdyYWRpZW50LTMiIHgxPSIwLjE3IiB5MT0iMC45NzkiIHgyPSIwLjg0MyIgeTI9IjAuMDAyIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2ZmZmNmMiIgLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIwLjUiIHN0b3AtY29sb3I9IiNmYzAiIC8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KCiAgPGcgaWQ9ImV1cm9zdGF0LXJpYmJvbiI+CiAgICA8cGF0aCBkPSJNMTA2LjUyMiA0Ljk4MUw5MC42MjggNC45ODFMNTUuMjUyIDQ3LjEzN0w3MS4xNDYgNDcuMTM3TDEwNi41MjIgNC45ODFaIgogICAgICAgICAgZmlsbD0idXJsKCNsaW5lYXItZ3JhZGllbnQpIiAvPgogICAgPHBhdGggZD0iTTM3LjU2MyAyNi4wNkw1My40NTkgMjYuMDZMNzEuMTQ2IDQ3LjEzOEw1NS4yNTIgNDcuMTM4TDM3LjU2MyAyNi4wNloiCiAgICAgICAgICBmaWxsPSJ1cmwoI2xpbmVhci1ncmFkaWVudC0yKSIgLz4KICAgIDxwYXRoIGQ9Ik01My40NTYgMjYuMDZMMzcuNTYgMjYuMDZMMi4xODQgNjguMjE2TDE4LjA3OSA2OC4yMTZMNTMuNDU2IDI2LjA2WiIKICAgICAgICAgIGZpbGw9InVybCgjbGluZWFyLWdyYWRpZW50LTMpIiAvPgogICAgPHBhdGggZD0iTTQ1LjQ5MSAzNS40ODlMNTYuOTc1IDQ5LjE5MkwzNC4wMDYgNDkuMTkyTDQ1LjQ5MSAzNS40ODlaIgogICAgICAgICAgY2xhc3M9ImxvZ28tcmliYm9uLWN1dC1maWxsIgogICAgICAgICAgZmlsbD0iI2ZmZiIgLz4KICAgIDxwYXRoIGQ9Ik0xMDYuNDkxIDQuOTgzTDE0Mi4xODQgNDcuNTI5TDcwLjc5NyA0Ny41MjlMMTA2LjQ5MSA0Ljk4M1oiCiAgICAgICAgICBmaWxsPSIjZmZmIiAvPgogIDwvZz4KPC9zdmc+Cg==").attr("width",m).attr("height",b).attr("x",w).attr("y",S).attr("class","em-eurostat-ribbon")}(m),m.showSourceLink_&&function addSourceLink(c,h){var g,m=c.svg();c.footer_&&!c.isInset?(g=m.select("#em-footer-"+c.svgId_)).empty()&&(g=m.append("g").attr("id","em-footer-"+c.svgId_).attr("class","em-footer")):g=m,g.selectAll("#em-source-link, .em-source-dataset-link, .em-source-pretext").remove();var b=c._primaryDataset_||c.stat();if(b&&b.eurostatDatasetCode){var w=b.eurostatDatasetCode,S="https://ec.europa.eu/eurostat/databrowser/view/".concat(w,"/default/table?lang=en"),M=c.footer_&&!c.isInset?10:c.height_,k=g.append("a").attr("class","em-source-dataset-link").attr("href",S).attr("target","_blank").append("text").attr("class","em-source-dataset-link-text").attr("x",c.width_-10).attr("y",M).text("EUROSTAT").attr("text-anchor","end").node().getComputedTextLength();g.append("text").attr("id","em-source-link").attr("class","em-source-pretext").attr("x",c.width_-k-10-6).attr("y",M).text("Source:").attr("text-anchor","end")}}(m),m.showScalebar_&&!m.gridCartogram_&&(2!==m.scalebarPosition_.length&&(m.scalebarPosition_[0]=15,m.scalebarPosition_[1]=m.height_-50),function addScalebarToMap(c){var h=c.scalebarMaxWidth_,g=c.scalebarTextOffset_[0],m=c.scalebarTextOffset_[1],b=c.position_.z,w=Bs(h*b),S=w[0]/b,M=w[1],k=c.svg().append("g").attr("class","em-scalebar").attr("transform","translate(".concat(c.scalebarPosition_[0],",").concat(c.scalebarPosition_[1],")")).attr("width",h+20).attr("height",c.scalebarHeight_);k.append("line").attr("class","em-scalebar-line").attr("x1",5).attr("y1",1).attr("x2",5).attr("y2",c.scalebarTickHeight_),k.append("text").attr("class","em-scalebar-label").attr("x",5+g).attr("y",c.scalebarTickHeight_+m).text("0");var T={1:4,2:2,5:5}[M],E=S/T,I=c.scalebarSegmentHeight_/2+1;if(E>=15){for(var P=1;P<T;P++)if(k.append("line").attr("class","em-scalebar-line").attr("x1",5+c.scalebarStrokeWidth_/2+P*E).attr("y1",1).attr("x2",5+c.scalebarStrokeWidth_/2+P*E).attr("y2",c.scalebarTickHeight_),k.append("text").attr("class","em-scalebar-label").attr("x",5+g+P*E).attr("y",c.scalebarTickHeight_+m).text(Os(w[0]/T*P)),1==P)k.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",5+c.scalebarStrokeWidth_-1).attr("y1",I).attr("x2",5+c.scalebarStrokeWidth_/2+P*E).attr("y2",I);else{var L=5+c.scalebarStrokeWidth_/2+(P-1)*E;L>0&&k.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",L).attr("y1",I).attr("x2",5+c.scalebarStrokeWidth_/2+P*E).attr("y2",I)}E>=15&&k.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",5+(T-1)*E).attr("y1",I).attr("x2",5+T*E).attr("y2",I)}else k.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",5+c.scalebarStrokeWidth_-1).attr("y1",I).attr("x2",5+c.scalebarStrokeWidth_/2+E*T).attr("y2",I);k.append("line").attr("class","em-scalebar-line").attr("x1",S+5).attr("y1",1).attr("x2",S+5).attr("y2",c.scalebarTickHeight_),k.append("text").attr("class","em-scalebar-label").attr("x",S+5+g).attr("y",c.scalebarTickHeight_+m).text(Os(w[0])+c.scalebarUnits_)}(m)),m.minimap_&&Ui(m),m.zoomButtons_&&!m.gridCartogram_&&function appendZoomButtons(c){var h=src_select("#"+c.svgId()).append("g").attr("class","em-zoom-buttons").style("pointer-events","all");if(c.zoomButtonsPosition_){var g=c.zoomButtonsPosition_;h.attr("transform","translate(".concat(g[0],", ").concat(g[1],")"))}else{var m=parseInt(Lt("em-button","width"))||30;h.attr("transform","translate(".concat(c.width_-m-10,", ").concat(10,")"))}var b=parseInt(Lt("em-button","width"))||30,w=h.append("g").attr("class","em-zoom-in em-button").style("cursor","pointer");w.append("title").text("Zoom in"),w.append("rect").attr("width",b).attr("height",b),w.append("text").attr("x",b/2).attr("y",b/2+7).text("+");var S=h.append("g").attr("class","em-zoom-out em-button").style("cursor","pointer").attr("transform","translate(0, ".concat(b,")")).style("cursor","pointer");S.append("title").text("Zoom out"),S.append("rect").attr("width",b).attr("height",b),S.append("text").attr("x",b/2).attr("y",b/2+7).text("−"),w.on("click",function(h){h.preventDefault(),h.stopPropagation(),function zoomIn(c){c.svg_.transition().call(c.__zoomBehavior.scaleBy,2)}(c)}),S.on("click",function(h){h.preventDefault(),h.stopPropagation(),function zoomOut(c){c.svg_.transition().call(c.__zoomBehavior.scaleBy,.5)}(c)})}(m),m.insetsButton_&&function appendInsetsButton(c){var h=src_select("#"+c.svgId()),g=parseInt(Lt("em-button","width"))||30,m=h.append("g").attr("class","em-insets-button em-button").attr("id","em-insets-button");if(c.insetsButtonPosition_){var b=c.insetsButtonPosition_;m.attr("transform","translate(".concat(b[0],", ").concat(b[1],")"))}else m.attr("transform","translate(".concat(c.width_-g-10,", ").concat(2*g+20,")"));m.append("title").text("Show/hide inset maps"),m.append("rect").attr("width",g).attr("height",g);var w=document.createComment("!Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.");m.node().appendChild(w);var S=g/700;m.append("path").attr("d","M266.3 48.3L232.5 73.6c-5.4 4-8.5 10.4-8.5 17.1l0 9.1c0 6.8 5.5 12.3 12.3 12.3c2.4 0 4.8-.7 6.8-2.1l41.8-27.9c2-1.3 4.4-2.1 6.8-2.1l1 0c6.2 0 11.3 5.1 11.3 11.3c0 3-1.2 5.9-3.3 8l-19.9 19.9c-5.8 5.8-12.9 10.2-20.7 12.8l-26.5 8.8c-5.8 1.9-9.6 7.3-9.6 13.4c0 3.7-1.5 7.3-4.1 10l-17.9 17.9c-6.4 6.4-9.9 15-9.9 24l0 4.3c0 16.4 13.6 29.7 29.9 29.7c11 0 21.2-6.2 26.1-16l4-8.1c2.4-4.8 7.4-7.9 12.8-7.9c4.5 0 8.7 2.1 11.4 5.7l16.3 21.7c2.1 2.9 5.5 4.5 9.1 4.5c8.4 0 13.9-8.9 10.1-16.4l-1.1-2.3c-3.5-7 0-15.5 7.5-18l21.2-7.1c7.6-2.5 12.7-9.6 12.7-17.6c0-10.3 8.3-18.6 18.6-18.6l29.4 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-20.7 0c-7.2 0-14.2 2.9-19.3 8l-4.7 4.7c-2.1 2.1-3.3 5-3.3 8c0 6.2 5.1 11.3 11.3 11.3l11.3 0c6 0 11.8 2.4 16 6.6l6.5 6.5c1.8 1.8 2.8 4.3 2.8 6.8s-1 5-2.8 6.8l-7.5 7.5C386 262 384 266.9 384 272s2 10 5.7 13.7L408 304c10.2 10.2 24.1 16 38.6 16l7.3 0c6.5-20.2 10-41.7 10-64c0-111.4-87.6-202.4-197.7-207.7zm172 307.9c-3.7-2.6-8.2-4.1-13-4.1c-6 0-11.8-2.4-16-6.6L396 332c-7.7-7.7-18-12-28.9-12c-9.7 0-19.2-3.5-26.6-9.8L314 287.4c-11.6-9.9-26.4-15.4-41.7-15.4l-20.9 0c-12.6 0-25 3.7-35.5 10.7L188.5 301c-17.8 11.9-28.5 31.9-28.5 53.3l0 3.2c0 17 6.7 33.3 18.7 45.3l16 16c8.5 8.5 20 13.3 32 13.3l21.3 0c13.3 0 24 10.7 24 24c0 2.5 .4 5 1.1 7.3c71.3-5.8 132.5-47.6 165.2-107.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM187.3 100.7c-6.2-6.2-16.4-6.2-22.6 0l-32 32c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l32-32c6.2-6.2 6.2-16.4 0-22.6z").attr("transform","translate(".concat(g/2,", ").concat(g/2,") scale(").concat(S,") translate(").concat(-256,", ").concat(-256,")")).attr("fill","#333").attr("pointer-events","none"),m.on("click",function(c){c.preventDefault(),c.stopPropagation();var g=h.select("#em-insets-group");"none"===g.style("display")||""===g.style("display")?g.style("display","block"):g.style("display","none")})}(m),m.drawCoastalMargin_&&!m.gridCartogram_&&appendCoastalMargin(m),setTimeout(function(){return m.recalculateLayout()},20),m};var S=function addCentroidsToMap(c){var h;c.Geometries.centroidsData?h="mixed"==c.nutsLevel_?[].concat(toConsumableArray_toConsumableArray(c.Geometries.centroidsData[0].features),toConsumableArray_toConsumableArray(c.Geometries.centroidsData[1].features),toConsumableArray_toConsumableArray(c.Geometries.centroidsData[2].features),toConsumableArray_toConsumableArray(c.Geometries.centroidsData[3].features)):c.Geometries.centroidsData.features:"WORLD"==c.geo_&&(h=[],c.Geometries.geoJSONs.worldrg.forEach(function(c){var g=function map_template_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?map_template_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):map_template_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}({},c);"FR"==c.properties.id?g.geometry={coordinates:[2.2,46.2],type:"Point"}:g.geometry={coordinates:centroid(c),type:"Point"},h.push(g)})),c.processCentroids_&&(h=c.processCentroids_(h));var g=h.map(function(h){var g=c._projection(h.geometry.coordinates);return h.properties.centroid=g,h});c.Geometries._allCentroidsFeatures=toConsumableArray_toConsumableArray(g),c.Geometries.centroidsFeatures=g.filter(function(h){return M(h.properties.id,c)}),(m.getCentroidsGroup(c).empty()?c.svg().select("#em-zoom-group-"+c.svgId_).append("g").attr("id","em-centroids-".concat(c.svgId_)).attr("class","em-centroids"):m.getCentroidsGroup(c)).selectAll("g.em-centroid").data(c.Geometries.centroidsFeatures,function(c){return c.properties.id}).join(function(c){return c.append("g").attr("class","em-centroid").attr("id",function(c){return"ps"+c.properties.id}).attr("transform",function(c){return"translate(".concat(c.properties.centroid[0].toFixed(3),",").concat(c.properties.centroid[1].toFixed(3),")")})},function(c){return c},function(c){return c.remove()})};m.getCentroidsGroup=function(c){return c.svg().select("#em-centroids-".concat(c.svgId_))},m.refreshCentroids=function(c){if(c.gridCartogram_)return c;var h=c.Geometries._allCentroidsFeatures;return h?(c.Geometries.centroidsFeatures=h.filter(function(h){return M(h.properties.id,c)}),m.getCentroidsGroup(c).selectAll("g.em-centroid").data(c.Geometries.centroidsFeatures,function(c){return c.properties.id}).join(function(c){return c.append("g").attr("class","em-centroid").attr("id",function(c){return"ps"+c.properties.id}).attr("transform",function(c){return"translate(".concat(c.properties.centroid[0].toFixed(3),",").concat(c.properties.centroid[1].toFixed(3),")")})},function(c){return c},function(c){return c.remove()}),c):void 0};var M=function hasStatData(c,h){return!h.statCodes_||h.statCodes_.some(function(g){var m,b=null===(m=h.statData(g))||void 0===m?void 0:m.get(c);return b&&!isNaN(b.value)&&0!==b.value})},k=function drawBackgroundMap(c){var h=c.svg().select("#em-zoom-group-"+c.svgId_);h.append("rect").attr("id","sea").attr("class","em-sea").attr("x",-5*c.width_).attr("y",-5*c.height_).attr("width",11*c.width_).attr("height",11*c.height_),"WORLD"==c.geo_&&h.append("path").datum({type:"Sphere"}).attr("id","sphere").attr("d",c._pathFunction).attr("class","em-graticule"),c.geometries_?c.Geometries.addUserGeometriesToMap(c.geometries_,h,c._pathFunction):c.Geometries.addDefaultGeometriesToMap(h,c.drawGraticule_,c._pathFunction,c.nutsLevel_,c.nutsYear_,c.geo_,c.proj_,c.scale_)},T=function defineDefaultPosition(){if(m.projectionFunction_){if("function"==typeof m.projectionFunction_.rotate){var c=m.projectionFunction_.rotate();if(Array.isArray(c)&&c.length>=2){var h,g,b=-c[0],w=-c[1];m.position_.x=null!==(h=m.position_.x)&&void 0!==h?h:b,m.position_.y=null!==(g=m.position_.y)&&void 0!==g?g:w}}else if("function"==typeof m.projectionFunction_.center){var S,M,k=m.projectionFunction_.center();if(Array.isArray(k)&&2===k.length)m.position_.x=null!==(S=m.position_.x)&&void 0!==S?S:k[0],m.position_.y=null!==(M=m.position_.y)&&void 0!==M?M:k[1]}}else{var T,E=js[m.geo_+"_"+m.proj_];E?(m.position_.x=m.position_.x||E.geoCenter[0],m.position_.y=m.position_.y||E.geoCenter[1]):null!==(T=m.Geometries.defaultGeoData)&&void 0!==T&&T.bbox&&(m.position_.x=m.position_.x||.5*(m.Geometries.defaultGeoData.bbox[0]+m.Geometries.defaultGeoData.bbox[2]),m.position_.y=m.position_.y||.5*(m.Geometries.defaultGeoData.bbox[1]+m.Geometries.defaultGeoData.bbox[3]))}L()},E=function getDefaultZ(){var c,h=js[m.geo_+"_"+m.proj_];return h?800*h.pixelSize/m.width_:null!==(c=m.Geometries.defaultGeoData)&&void 0!==c&&c.bbox?Math.min((m.Geometries.defaultGeoData.bbox[2]-m.Geometries.defaultGeoData.bbox[0])/m.width_,(m.Geometries.defaultGeoData.bbox[3]-m.Geometries.defaultGeoData.bbox[1])/m.height_):100},I=function defineProjection(){"WORLD"===m.geo_?m._projection=m.projectionFunction_||function robinson(){return projection(robinsonRaw).scale(152.63)}().translate([m.width_/2,m.height_/2]).scale((m.width_-20)/(2*Math.PI)):m._projection=m.projectionFunction_||function projection_identity(){var c,h,g,m,b,w,S,M=1,k=0,T=0,E=1,I=1,P=0,L=null,B=1,z=1,j=transform_transformer({point:function(c,h){var g=projection([c,h]);this.stream.point(g[0],g[1])}}),D=d3_geo_src_identity;function reset(){return B=M*E,z=M*I,w=S=null,projection}function projection(g){var m=g[0]*B,b=g[1]*z;if(P){var w=b*c-m*h;m=m*c+b*h,b=w}return[m+k,b+T]}return projection.invert=function(g){var m=g[0]-k,b=g[1]-T;if(P){var w=b*c+m*h;m=m*c-b*h,b=w}return[m/B,b/z]},projection.stream=function(c){return w&&S===c?w:w=j(D(S=c))},projection.postclip=function(c){return arguments.length?(D=c,L=g=m=b=null,reset()):D},projection.clipExtent=function(c){return arguments.length?(D=null==c?(L=g=m=b=null,d3_geo_src_identity):clipRectangle(L=+c[0][0],g=+c[0][1],m=+c[1][0],b=+c[1][1]),reset()):null==L?null:[[L,g],[m,b]]},projection.scale=function(c){return arguments.length?(M=+c,reset()):M},projection.translate=function(c){return arguments.length?(k=+c[0],T=+c[1],reset()):[k,T]},projection.angle=function(g){return arguments.length?(h=Jt(P=g%360*Ut),c=Xt(P),reset()):P*Ht},projection.reflectX=function(c){return arguments.length?(E=c?-1:1,reset()):E<0},projection.reflectY=function(c){return arguments.length?(I=c?-1:1,reset()):I<0},projection.fitExtent=function(c,h){return fitExtent(projection,c,h)},projection.fitSize=function(c,h){return fitSize(projection,c,h)},projection.fitWidth=function(c,h){return fitWidth(projection,c,h)},projection.fitHeight=function(c,h){return fitHeight(projection,c,h)},projection}().reflectY(!0).fitSize([m.width_,m.height_],function getBBOXAsGeoJSON(c){return{type:"Feature",geometry:{type:"MultiPoint",coordinates:[[c[0],c[1]],[c[2],c[3]]]}}}(function getApproxCurrentGeoBbox(c){var h=.5*c.position_.z*c.width_,g=.5*c.position_.z*c.height_;return[c.position_.x-h,c.position_.y-g,c.position_.x+h,c.position_.y+g]}(m)))},P=function definePathFunction(){m._pathFunction=src_path().projection(m._projection)},L=function setViewFromURL(){var c=getParameterByName("x"),h=getParameterByName("y"),g=getParameterByName("z");null==c||null==c||isNaN(+c)||(m.position_.x=+c),null==h||null==h||isNaN(+h)||(m.position_.y=+h),null==g||null==g||isNaN(+g)||(m.position_.z=+g)};return m.recalculateLayout=function(){var c=m.svg(),h=c.select("#em-header-"+m.svgId_),g=c.select("#em-drawing-"+m.svgId_),b=c.select("#em-footer-"+m.svgId_),w=g.select("#em-frame-"+m.geo_),S=c.select("#".concat(m.svgId_,"-clip-path rect")),M=0,k=0,T=m.headerPadding_?m.headerPadding_:20,E=m.footerPadding_?m.footerPadding_:10;if(m.header_&&!h.empty()){var I,P,L=null===(I=h.node())||void 0===I||null===(P=I.getBBox)||void 0===P?void 0:P.call(I);L&&(M=L.height+T)}if(m.footer_&&!b.empty()){var B,z,j=null===(B=b.node())||void 0===B||null===(z=B.getBBox)||void 0===z?void 0:z.call(B);j&&(k=j.height+E)}g.attr("transform","translate(0, ".concat(M,")")),b.attr("transform","translate(0, ".concat(M+m.height_+E,")")),w.attr("x",0).attr("y",0).attr("width",m.width_).attr("height",m.height_),S.attr("x",0).attr("y",0).attr("width",m.width_).attr("height",m.height_);var D=m.height_+M+k+E;c.attr("width",m.width_).attr("height",D)},m},js={EUR_3035:{geoCenter:[479e4,342e4],pixelSize:6400},IC_32628:{geoCenter:[443468,3145647],pixelSize:1e3},GP_32620:{geoCenter:[669498,1784552],pixelSize:130},MQ_32620:{geoCenter:[716521,1621322],pixelSize:130},GF_32622:{geoCenter:[266852,444074],pixelSize:500},RE_32740:{geoCenter:[348011,7661627],pixelSize:130},YT_32738:{geoCenter:[516549,8583920],pixelSize:70},MT_3035:{geoCenter:[4719755,1441701],pixelSize:70},PT20_32626:{geoCenter:[397418,4271471],pixelSize:1500},PT30_32628:{geoCenter:[333586,3622706],pixelSize:150},LI_3035:{geoCenter:[4287060,2672e3],pixelSize:40},IS_3035:{geoCenter:[3011804,496e4],pixelSize:700},SJ_SV_3035:{geoCenter:[457e4,6160156],pixelSize:800},SJ_JM_3035:{geoCenter:[3647762,5408300],pixelSize:100},CARIB_32620:{geoCenter:[636345,1669439],pixelSize:500},WORLD_54030:{geoCenter:[14,17],pixelSize:9e3}};function t(c,h){var g,m,b,w,u=function(c,h,g){if(0===Object.entries(c).length)return null;var m,b=[];if(g&&!n(g.name)&&(g=null),"string"==typeof c&&(c=[c]),Array.isArray(c)||e(c)){if(c.length===h)return g&&-1===c.findIndex(function(c){return null==c})?g.from(c):c;if(1===c.length){for(m=0;m<h;m++)b.push(c[0]);return b}}for(m=0;m<h;m++){var w=void 0===c[m]?null:c[m];b.push(w)}return b};if(this.length=0,this.id=[],null!=c)switch(this.class=c.class||"bundle",this.class){case"bundle":var S=[],M=0;if(this.error=null,this.length=0,null===c||"object"!=typeof c)return void(this.class=null);if(c.hasOwnProperty("error"))return void(this.error=c.error);if("dataset"===c.class||"collection"===c.class||"dimension"===c.class)return new t(c);for(m in c)M++,S.push(m);this.__tree__=c,this.length=M,this.id=S;break;case"dataset":c.hasOwnProperty("__tree__")?this.__tree__=g=c.__tree__:this.__tree__=g=c,this.label=g.label||null,this.note=g.note||null,this.link=g.link||null,this.href=g.href||null,this.updated=g.updated||null,this.source=g.source||null,this.extension=g.extension||null;var k,T=0,E=g.size||g.dimension&&g.dimension.size;if(this.size=E,this.value=g.hasOwnProperty("value")&&null!==g.value&&0!==g.value.length?g.value:{},Array.isArray(this.value)||e(this.value))T=this.value.length;else{var I=1;for(k=E.length;k--;)I*=E[k];T=I}if(this.value=u(this.value,T,h),this.status=g.hasOwnProperty("status")&&null!==g.status?u(g.status,T):null,g.hasOwnProperty("dimension")){var P=g.dimension,L=g.role||!g.version&&P.role||null,B=g.id||P.id,z=E.length,_=function(c){L.hasOwnProperty(c)||(L[c]=null)};if(!Array.isArray(B)||!Array.isArray(E)||B.length!=z)return;if(this.length=z,this.id=B,L&&(_("time"),_("geo"),_("metric"),_("classification")),L&&null===L.classification){var j=[],D=["time","geo","metric"],A=function(c,h){for(var g=h.length;g--;)if(c===h[g])return!0;return!1};for(k=0;k<3;k++){var N=L[D[k]];null!==N&&(j=j.concat(N))}for(L.classification=[],k=0;k<z;k++)A(B[k],j)||L.classification.push(B[k]);0===L.classification.length&&(L.classification=null)}this.role=L,this.n=T;for(var R=0,G=this.length;R<G;R++)if(P[B[R]].category.hasOwnProperty("index")){if(Array.isArray(P[B[R]].category.index)){var q={},W=P[B[R]].category.index;for(b=W.length,w=0;w<b;w++)q[W[w]]=w;P[B[R]].category.index=q}}else{var H=0;for(m in P[B[R]].category.index={},P[B[R]].category.label)P[B[R]].category.index[m]=H++}}else this.length=0;break;case"dimension":if(!c.hasOwnProperty("__tree__"))return new t({version:"2.0",class:"dataset",dimension:{d:c},id:["d"],size:[function(c){var h=void 0===c.index?c.label:c.index;return Array.isArray(h)?h.length:Object.keys(h).length}(c.category)],value:[null]}).Dimension(0);var U=[],Y=(g=c.__tree__).category;if(!g.hasOwnProperty("category"))return;if(!Y.hasOwnProperty("label"))for(m in Y.label={},Y.index)Y.label[m]=m;for(m in Y.index)U[Y.index[m]]=m;this.__tree__=g,this.label=g.label||null,this.note=g.note||null,this.link=g.link||null,this.href=g.href||null,this.id=U,this.length=U.length,this.role=c.role,this.hierarchy=Y.hasOwnProperty("child"),this.extension=g.extension||null;break;case"category":var V=c.child;this.id=V,this.length=null===V?0:V.length,this.index=c.index,this.label=c.label,this.note=c.note||null,this.unit=c.unit,this.coordinates=c.coord;break;case"collection":if(this.length=0,this.label=c.label||null,this.note=c.note||null,this.link=c.link||null,this.href=c.href||null,this.updated=c.updated||null,this.source=c.source||null,this.extension=c.extension||null,null!==this.link&&c.link.item){var $=c.link.item;if(this.length=Array.isArray($)?$.length:0,this.length)for(w=0;w<this.length;w++)this.id[w]=$[w].href}}}function e(c){return"[object ArrayBuffer]"===Object.prototype.toString.call(c.buffer)}function n(c){return-1!==["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"].indexOf(c)}function i(c){if(!c.ok)throw new Error(c.status+" "+c.statusText);return c.json()}t.prototype.Item=function(c){if(null===this||"collection"!==this.class||!this.length)return null;if("number"==typeof c)return c>this.length||c<0?null:this.link.item[c];var h,g=[];if("object"==typeof c){if(!c.class&&!c.follow)return null;c.class&&(h="dataset"===c.class&&"boolean"==typeof c.embedded?!0===c.embedded?function(c,h,m){var b=c.link.item[h];m.class===b.class&&b.id&&b.size&&b.dimension&&g.push(b)}:function(c,h,m){var b=c.link.item[h];m.class!==b.class||b.id&&b.size&&b.dimension||g.push(b)}:function(c,h,m){m.class===c.link.item[h].class&&g.push(c.link.item[h])})}else h=function(c,h){g.push(c.link.item[h])};for(var m=0;m<this.length;m++)h(this,m,c);return g},t.prototype.Dataset=function(c){if(null===this)return null;if("dataset"===this.class)return void 0!==c?this:[this];var h,g=[],m=0;if("collection"===this.class){var b=this.Item({class:"dataset",embedded:!0});if(void 0===c){for(h=b.length;m<h;m++)g.push(new t(b[m]));return g}if("number"==typeof c&&c>=0&&c<b.length)return new t(b[c]);if("string"==typeof c)for(h=b.length;m<h;m++)if(b[m].href===c)return new t(b[m]);return null}if("bundle"!==this.class)return null;if(void 0===c){for(h=this.id.length;m<h;m++)g.push(this.Dataset(this.id[m]));return g}if("number"==typeof c){var w=this.id[c];return void 0!==w?this.Dataset(w):null}var S=this.__tree__[c];return void 0===S?null:new t({class:"dataset",__tree__:S})},t.prototype.Dimension=function(c,h){h="boolean"!=typeof h||h;var g,m=[],b=this.id.length,s=function(c,h){if(null!==c)for(var g in c)for(var m=null!==c[g]?c[g].length:0;m--;)if(c[g][m]===h)return g;return null};if(null===this||"dataset"!==this.class)return null;if(void 0===c){for(g=0;g<b;g++)m.push(this.Dimension(this.id[g]));return m}if("number"==typeof c){var w=this.id[c];return void 0!==w?this.Dimension(w,h):null}var S=this.role;if("object"==typeof c){if(c.hasOwnProperty("role")){for(g=0;g<b;g++){var M=this.id[g];s(S,M)===c.role&&m.push(this.Dimension(M,h))}return void 0===m[0]?null:m}return null}var k=this.__tree__.dimension;if(void 0===k)return null;var T=k[c];return void 0===T?null:h?new t({class:"dimension",__tree__:T,role:s(S,c)}):function(c,h){var g=[];for(var m in c)g[c[m]]=h[m];return g}(T.category.index,T.category.label)},t.prototype.Category=function(c){if(null===this||"dimension"!==this.class)return null;if(void 0===c){for(var h=[],g=0,m=this.id.length;g<m;g++)h.push(this.Category(this.id[g]));return h}if("number"==typeof c){var b=this.id[c];return void 0!==b?this.Category(b):null}var w=this.__tree__.category;if(void 0===w)return null;var S=w.index[c];if(void 0===S)return null;var M=w.unit&&w.unit[c]||null,k=w.coordinates&&w.coordinates[c]||null,T=w.child&&w.child[c]||null,E=w.note&&w.note[c]||null;return new t({class:"category",index:S,label:w.label[c],note:E,child:T,unit:M,coord:k})},t.prototype.Dice=function(c,h,g){var m,b,w,S,u=function(c,h){return c.hasOwnProperty(h)&&!!c[h]};if(null===this||"dataset"!==this.class||null===this.value)return null;if("object"!=typeof c)return this;"object"!=typeof h?("boolean"==typeof h&&!0===h&&(m=!0),"boolean"==typeof g&&!0===g||(g=!1)):(m=u(h,"clone"),g=u(h,"drop"),b=u(h,"stringify"),w=u(h,"ovalue"),S=u(h,"ostatus"));var M,k=this.value,T=m?new t(JSON.parse(JSON.stringify(this))):this,E=T.status,I=[],P=[],p=function(c,h){var g,m,b,w=(g=c,m=h,b={},Array.isArray(g[m])?(g[m].forEach(function(c,h){null!==c&&(b[String(h)]=c)}),b):g[m]);delete c[h],c[h]=w};Array.isArray(c)&&(c=function(c){var h={};return c.forEach(function(c){h[c[0]]=c[1]}),h}(c)),null===c&&(c={});var L=Object.keys(c);return L.length>0&&(L.forEach(function(h){var g=c[h];Array.isArray(g)||(c[h]=[g]),0===c[h].length&&delete c[h]}),g&&(c=function(c){var h={};return Object.keys(c).forEach(function(g){h[g]=T.Dimension(g).id.filter(function(h){return-1===c[g].indexOf(h)})}),h}(c)),T.toTable({type:"arrobj",content:"id",status:!0}).forEach(function(h,g){var m=[];L.forEach(function(g){var b=c[g],w=[];b.forEach(function(c){w.push(h[g]===c)}),m.push(-1!==w.indexOf(!0))}),-1===m.indexOf(!1)&&(I.push(h.value),P.push(h.status))}),L.forEach(function(h){var g=T.Dimension(h).id,m=0,b={};T.size[T.id.indexOf(h)]=c[h].length,g.forEach(function(g){-1!==c[h].indexOf(g)&&(b[g]=m,m++)}),T.__tree__.dimension[h].category.index=b}),T.n=I.length,T.value=T.__tree__.value=e(k)?function(c,h){return h.from(c)}(I,k.constructor):I,T.status=T.__tree__.status=null!==E?P:null),b?((M=T.__tree__).hasOwnProperty("id")||(M.version="2.0",M.hasOwnProperty("class")||(M.class="dataset"),M.id=M.dimension.id,M.size=M.dimension.size,delete M.dimension.id,delete M.dimension.size,M.dimension.hasOwnProperty("role")&&(M.role=M.dimension.role,delete M.dimension.role)),M.hasOwnProperty("status")&&-1!==["null","{}","[]"].indexOf(JSON.stringify(M.status))&&delete M.status,M.hasOwnProperty("role")&&(delete M.role.classification,["geo","time","metric"].forEach(function(c){null===M.role[c]&&delete M.role[c]})),w&&p(M,"value"),S&&M.hasOwnProperty("status")&&p(M,"status"),JSON.stringify(M)):T},t.prototype.Slice=function(c){if(null===this||"dataset"!==this.class||0===Object.entries(this.value).length)return null;if(void 0===c)return this;if(!Array.isArray(c)){var h,g=[];for(h in c)g.push([h,c[h]]);c=g}return this.Dice(c.map(function(c){return[c[0],[c[1]]]}))},t.prototype.Data=function(c,h){var g,m,b=[],l=function(c){for(var h in c)if(c.hasOwnProperty(h))return h};if(null===this||"dataset"!==this.class||null===this.value)return null;if(void 0===c){for(m=this.value.length,g=0;g<m;g++)b.push(this.Data(g));return b}if("boolean"!=typeof h&&(h=!0),"number"==typeof c){var w=this.value[c];return void 0===w?null:h?{value:w,status:this.status?this.status[c]:null}:w}var S="object",M=this.__tree__,k=M.size||M.dimension&&M.dimension.size,T=k.length;if(Array.isArray(c)){if(!Array.isArray(c[0])){if(this.length!==c.length)return null;var E=1,I=0,P=[],L=[];for(g=0;g<T;g++)if(void 0!==c[g]){if("number"!=typeof c[g]||c[g]>=k[g])return null;I+=(E*=g>0?k[T-g]:1)*c[T-g-1]}else P.push(g),L.push(k[g]);if(P.length>1)return null;if(1===P.length){for(var B=0,z=L[0];B<z;B++){var j=[];for(g=0;g<T;g++)g!==P[0]?j.push(c[g]):j.push(B);b.push(this.Data(j,h))}return b}return h?{value:this.value[I],status:this.status?this.status[I]:null}:this.value[I]}S="array"}var D=function(c,h,g){var m,b=[],w={},S=c.dimension,M=c.id||S.id,k=c.size||S&&S.size;if("array"===g){for(m=h.length;m--;)w[h[m][0]]=h[m][1];h=w}for(var T=0,E=M.length;T<E;T++){var I=M[T],P=h[I];b.push("string"==typeof P?P:1===k[T]?l(S[I].category.index):null)}return b}(M,c,S),N=[],R=M.dimension,G=M.id||R.id;for(g=0,m=D.length;g<m;g++)N.push(R[G[g]].category.index[D[g]]);return this.Data(N,h)},t.prototype.toTable=function(c,h){if(null===this||"dataset"!==this.class||null===this.value)return null;1==arguments.length&&"function"==typeof c&&(h=c,c=null),"arrobj"!==(c=c||{field:"label",content:"label",vlabel:"Value",slabel:"Status",type:"array",status:!1,unit:!1,by:null,prefix:"",drop:[],meta:!1,comma:!1,bylabel:!1}).type&&"objarr"!==c.type||void 0!==c.field||(c.field="id");var g,m,b,w,S,M,k,T,E,I="id"===c.field,d=function(c){return(I?"value":c)||"Value"},v=function(c){return(I?"status":c)||"Status"},P=this.__tree__,L=!0===c.status;if("function"==typeof h){g=this.toTable(c);var B=[],z="array"!==c.type?0:1;for(S=(nt="object"!==c.type?g.slice(z):g.rows.slice(0)).length,m=0;m<S;m++){var j=h.call(this,nt[m],m);void 0!==j&&B.push(j)}return"object"===c.type?{cols:g.cols,rows:B}:("array"===c.type&&B.unshift(g[0]),B)}if("arrobj"===c.type||"objarr"===c.type){var D=[],N=P.role&&P.role.metric,O=function(){},R={},G=this,q=G.id,W=c.by&&-1!==q.indexOf(c.by)?c.by:null,H=!0===c.meta,U=void 0!==c.drop&&Array.isArray(c.drop)?c.drop:[],Y=!0===c.comma,V=!0===c.bylabel,$=G.value.constructor,C=function(h){var g,m={},b=d(c.vlabel);return"objarr"===c.type&&(g=null===W&&n($.name)?function(c){m[c]=c===b?$.from(h,function(h){return h[c]}):h.map(function(h){return h[c]})}:function(c){m[c]=h.map(function(h){return h[c]})},Object.keys(h[0]).forEach(g),h=m),H?(m={},q.forEach(function(c){var h=G.Dimension(c);m[c]={label:h.label,role:h.role,categories:{id:h.id,label:G.Dimension(c,!1)}}}),{meta:{label:G.label,source:G.source,updated:G.updated,id:q,status:L,unit:c.unit,by:W,bylabel:V,drop:null!==W&&U.length>0?U:null,prefix:null!==W?ot||"":null,comma:Y,dimensions:m},data:h}):h};W&&(c.field="id");var X=(g=this.toTable({field:c.field,vlabel:c.vlabel,slabel:c.slabel,content:c.content,status:L})).shift();if(null===W&&c.unit&&N){if("id"!==c.content)for(var K=N.length;K--;){var Z=this.Dimension(N[K]);R[N[K]]={};for(var J=Z.length;J--;)R[N[K]][Z.Category(J).label]=Z.id[J]}O=function(h,g){if(-1!==N.indexOf(h)){var m=P.dimension[h].category;m.unit?Q.unit=m.unit["id"!==c.content?R[h][g]:g]:Q.unit=null}},c.unit=!0}else c.unit=!1;for(S=g.length,m=0;m<S;m++){var Q={};for(b=g[m].length;b--;)Q[X[b]]=g[m][b],O(X[b],g[m][b]);D.push(Q)}if(Y&&D.forEach(function(c){null!==c.value&&(c.value=(""+c.value).replace(".",","))}),null!==W){var tt,et={},nt=[],rt={},ot=void 0!==c.prefix?c.prefix:"";U.forEach(function(c,h){(!G.Dimension(c)||G.Dimension(c).length>1)&&(U[h]="")});var at=q.filter(function(c){return c!==W&&-1===U.indexOf(c)}),it=G.Dimension(W);for(var st in"id"!==c.content?V?tt=function(c,h,g){c[h][ot+g[W]]=g.value}:(it.Category().forEach(function(c,h){rt[c.label]=it.id[h]}),tt=function(c,h,g){c[h][ot+rt[g[W]]]=g.value}):tt=function(c,h,g){c[h][ot+g[W]]=g.value},D.forEach(function(c){var h=function(c,h){var g=[];return h.forEach(function(h){g.push(c[h])}),g.join("\t")}(c,at);void 0===et[h]&&(et[h]=function(c,h){var g={};return h.forEach(function(h){g[h]=c[h]}),g}(c,at)),tt(et,h,c,W)}),et)nt.push(et[st]);return L=!1,C(nt)}return C(D)}if("object"===c.type){var lt="number"==typeof this.value[0]||null===this.value[0]?"number":"string";M=function(c,h){var g=I&&c||h||c;yt.push({id:c,label:g,type:"string"})},k=function(c,h,g){var m=d(c),b=v(h);g&&yt.push({id:"status",label:b,type:"string"}),yt.push({id:"value",label:m,type:lt})},T=function(c){Pt.push({v:c})},E=function(c){Pt.push({v:c}),At.push({c:Pt})}}else M=function(c,h){var g=I&&c||h||c;yt.push(g)},k=function(c,h,g){var m=d(c),b=v(h);g&&yt.push(b),yt.push(m),vt.push(yt)},T=function(c){Pt.push(c)},E=function(c){Pt.push(c),vt.push(Pt)};var ct=P.dimension,ut=P.id||ct.id,ht=P.size||ct.size,dt=ut.length;if(dt!=ht.length)return!1;var pt=[],ft=1,gt=(K=1,[]),_t=[],mt=[],vt=[],yt=[],At=[];for(m=0;m<dt;m++){var bt=ut[m];M(bt,ct[bt].label),ft*=ht[m],K*=ht[m];var xt=[];for(b=0;b<ht[m];b++)for(var wt in ct[ut[m]].category.index)if(ct[ut[m]].category.index[wt]===b){var Ct="id"!==c.content&&ct[ut[m]].category.label?ct[ut[m]].category.label[wt]:wt;xt.push(Ct)}pt.push(xt),gt.push(K)}for(k(c.vlabel,c.slabel,L),S=pt.length,m=0;m<S;m++){for(var St=[],Mt=0,kt=pt[m].length;Mt<kt;Mt++)for(var Tt=0;Tt<ft/gt[m];Tt++)St.push(pt[m][Mt]);_t.push(St)}for(S=_t.length,m=0;m<S;m++){var Et=[],It=0;for(w=0;w<ft;w++)Et.push(_t[m][It]),++It===_t[m].length&&(It=0);mt.push(Et)}for(w=0;w<ft;w++){var Pt=[];S=_t.length;for(var Lt=0;Lt<S;Lt++)T(mt[Lt][w]);L&&T(this.status?this.status[w]:null),E(this.value[w])}return"object"===c.type?{cols:yt,rows:At}:vt},t.prototype.node=function(){return this.__tree__},t.prototype.toString=function(){return this.class},t.prototype.Unflatten=function(c){if(null===this||"dataset"!==this.class||null===this.value||"function"!=typeof c)return null;const h=this.id,g=this.size,m=[];for(let b=0;b<this.n;b++){const w=this.Data(b),S={};let M=b;for(let c=h.length-1;c>=0;c--){const h=this.Dimension(c),m=this.id[c],b=g[c],w=M%b;h.Category(w);const k=h.id[w];M=Math.floor(M/b),S[m]=k}const k=c(S,w,b,m);void 0!==k&&m.push(k)}return m};var Ds=function statData(c){var h={__data:void 0,_data_:void 0,get:function(c){return c?h._data_?h._data_[c]:void 0:h._data_},getValue:function(c){var g=h.get(c);return g?g.value:void 0},set:function(c,g){h._data_=h._data_||{};var m=h._data_[c];return m?g.value?(m.value=g.value,m.status=g.status):m.value=g:h._data_[c]=g.value?g:{value:g},h},setData:function(c){return h.__data=c,h._data_={},Object.keys(c).forEach(function(g){return h.set(g,c[g])}),h},setManualMultiDate:function(c){for(var g in h._data_=h._data_||{},c){var m=c[g];for(var b in h._data_[g]={},m){var w=m[b];h._data_[g][b]={value:w}}}return h},hasData:function(){return null!=h._data_&&Object.keys(h._data_).length>0},hasNumericData:function(){return!!h._data_&&Object.values(h._data_).some(function(c){return Number.isFinite(+c.value)})},getArray:function(){if(h.hasData())return Object.values(h._data_).map(function(c){return c.value}).filter(function(c){return 0==c||c})},getUniqueValues:function(){if(h.hasData())return Object.values(h._data_).map(function(c){return c.value}).filter(function(c,h,g){return g.indexOf(c)===h})},getMin:function(){if(h.hasNumericData())return Object.values(h._data_).map(function(c){return c.value}).filter(function(c){return 0==c||c&&":"!==c}).reduce(function(c,h){return Math.min(c,h)})},getMax:function(){if(h.hasNumericData())return Object.values(h._data_).map(function(c){return c.value}).filter(function(c){return 0==c||c&&":"!==c}).reduce(function(c,h){return Math.max(c,h)})},getMaxRegionId:function(){if(h.hasNumericData()){var c=-1/0,g=null;for(var m in h._data_){var b=h._data_[m].value;null!=b&&":"!==b&&b>c&&(c=b,g=m)}return g}},getMinRegionId:function(){if(h.hasNumericData()){var c=1/0,g=null;for(var m in h._data_){var b=h._data_[m].value;null!=b&&":"!==b&&b<c&&(c=b,g=m)}return g}},isReady:function(){return h.hasData()},metadata:void 0,unitText_:void 0,retrieveFromRemote:function(c,g,w){return h.eurostatDatasetCode_?m(c,g,w):h.csvURL_&&b(w),h},eurostatDatasetCode_:void 0,filters_:{lastTimePeriod:1},precision_:2,label_:void 0},g=function getEurobasePromise(c,g){return h.filters_.geo||(h.filters_.geoLevel=c+""=="0"?"country":"nuts"+c),json(function getEstatDataURL(c,h,g,m){g=g||"en",m=m||"json";var b=[];if(b.push("https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data/",c,"?","format=",m,"&lang=",g),h)for(var w in h){var S=h[w];if(Array.isArray(S))for(var M=0;M<S.length;M++)b.push("&",w,"=",S[M]);else b.push("&",w,"=",S)}return b.join("")}(h.eurostatDatasetCode_,h.filters_,g))},m=function updateEurobase(c,m,b){h._data_=null,g(c,m).then(function(c){var g;if(c.error)return console.error("Error retrieving Eurostat data: "+(null===(g=c.error[0])||void 0===g?void 0:g.label));var m=function r(c,h,g){var m="object"==typeof h?h:null;return"function"!=typeof g&&(g=null),g||"function"!=typeof h||(g=h),"object"==typeof c?new t(c,g):"version"===c?"1.6.0":fetch?fetch(c,m).then(i).then(function(c){return new t(c,g)}):void 0}(c);h.metadata={label:m.label,href:m.href,source:m.source,updated:m.updated,extension:m.extension},h.metadata.time=m.Dimension("time").id[0],h._data_=function jsonstatToIndex(c){for(var h={},g=c.Dimension("geo").id,m=0;m<g.length;m++)h[g[m]]=c.Data(m);return h}(m),Object.keys(h._data_).forEach(function(c){null===h._data_[c]?h._data_[c]={value:":"}:null===h._data_[c].value&&(h._data_[c].value=":")}),b&&b()})};h.getTime=function(){var c=h.filters_.time;return c||(h._data_?h.metadata.time:void 0)},h.csvURL_=void 0,h.geoCol_="geo",h.valueCol_="value";var b=function updateCSV(c){h._data_=null,function getCSVPromise(){return Is(h.csvURL_)}().then(function(g){h._data_=function csvToIndex(c,h,g){for(var m={},b=0;b<c.length;b++){var w=c[b],S=w[g];m[w[h]]=S?{value:isNaN(+S)?S:+S,status:""}:{value:":",status:""}}return m}(g,h.geoCol_,h.valueCol_),h.metadata={href:h.csvURL_},c&&c()})};if(["unitText_"].forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c)for(var w in c)h[w+"_"]=c[w];return h};function appendPatternFillLegend(c,h){var g=c.map;g.patternFill_&&g.patternFill_.forEach(function(m,b){if(m.legendLabel){var w=b*c.shapeHeight+b*c.shapePadding+15,S=h.append("g").attr("class","em-legend-item em-pattern-legend-item"),M=m.color||"#000";("#fff"===M.toLowerCase()||"white"===M.toLowerCase())&&S.append("rect").attr("x",0).attr("y",w).attr("width",c.shapeWidth).attr("height",c.shapeHeight).attr("fill","#ddd"),S.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",w).attr("width",c.shapeWidth).attr("height",c.shapeHeight).attr("fill","url(#".concat(m.patternId||m.pattern,")")).on("mouseover",function(){highlightPatternFillRegions(g,m.patternId||m.pattern),g.insetTemplates_&&Bt(g.insetTemplates_,g.svgId,highlightPatternFillRegions,m.patternId||m.pattern)}).on("mouseout",function(){unhighlightPatternFillRegions(g),g.insetTemplates_&&Bt(g.insetTemplates_,g.svgId,unhighlightPatternFillRegions)}),S.append("text").attr("class","em-legend-label").attr("x",c.shapeWidth+c.labelOffsets.x).attr("y",w+c.shapeHeight/2).attr("dominant-baseline","middle").attr("dy","0.35em").text(m.legendLabel)}})}function highlightPatternFillRegions(c,h){var g="url(#".concat(h,")"),m=jt(c);c.svg_.selectAll(m).selectAll("[ecl]").filter(function(){return!src_select(this).classed("pattern-fill-overlay")}).style("fill","white"),c.svg_.selectAll(".pattern-fill-overlay").style("opacity",0),c.svg_.selectAll(".pattern-fill-overlay").filter(function(){return src_select(this).attr("fill")===g}).style("opacity",1)}function unhighlightPatternFillRegions(c){c.svg_.selectAll(".pattern-fill-overlay").style("opacity",1);var h=jt(c);c.svg_.selectAll(h).selectAll("[ecl]").filter(function(){return!src_select(this).classed("pattern-fill-overlay")}).each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}class InternMap extends Map{constructor(c,h=keyof){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:h}}),null!=c)for(const[h,g]of c)this.set(h,g)}get(c){return super.get(intern_get(this,c))}has(c){return super.has(intern_get(this,c))}set(c,h){return super.set(intern_set(this,c),h)}delete(c){return super.delete(intern_delete(this,c))}}Set;function intern_get({_intern:c,_key:h},g){const m=h(g);return c.has(m)?c.get(m):g}function intern_set({_intern:c,_key:h},g){const m=h(g);return c.has(m)?c.get(m):(c.set(m,g),g)}function intern_delete({_intern:c,_key:h},g){const m=h(g);return c.has(m)&&(g=c.get(m),c.delete(m)),g}function keyof(c){return null!==c&&"object"==typeof c?c.valueOf():c}const Ns=Symbol("implicit");function ordinal(){var c=new InternMap,h=[],g=[],m=Ns;function scale(b){let w=c.get(b);if(void 0===w){if(m!==Ns)return m;c.set(b,w=h.push(b)-1)}return g[w%g.length]}return scale.domain=function(g){if(!arguments.length)return h.slice();h=[],c=new InternMap;for(const m of g)c.has(m)||c.set(m,h.push(m)-1);return scale},scale.range=function(c){return arguments.length?(g=Array.from(c),scale):g.slice()},scale.unknown=function(c){return arguments.length?(m=c,scale):m},scale.copy=function(){return ordinal(h,g).unknown(m)},initRange.apply(scale,arguments),scale}function band(){var c,h,g=ordinal().unknown(void 0),m=g.domain,b=g.range,w=0,S=1,M=!1,k=0,T=0,E=.5;function rescale(){var g=m().length,I=S<w,P=I?S:w,L=I?w:S;c=(L-P)/Math.max(1,g-k+2*T),M&&(c=Math.floor(c)),P+=(L-P-c*(g-k))*E,h=c*(1-k),M&&(P=Math.round(P),h=Math.round(h));var B=range(g).map(function(h){return P+c*h});return b(I?B.reverse():B)}return delete g.unknown,g.domain=function(c){return arguments.length?(m(c),rescale()):m()},g.range=function(c){return arguments.length?([w,S]=c,w=+w,S=+S,rescale()):[w,S]},g.rangeRound=function(c){return[w,S]=c,w=+w,S=+S,M=!0,rescale()},g.bandwidth=function(){return h},g.step=function(){return c},g.round=function(c){return arguments.length?(M=!!c,rescale()):M},g.padding=function(c){return arguments.length?(k=Math.min(1,T=+c),rescale()):k},g.paddingInner=function(c){return arguments.length?(k=Math.min(1,c),rescale()):k},g.paddingOuter=function(c){return arguments.length?(T=+c,rescale()):T},g.align=function(c){return arguments.length?(E=Math.max(0,Math.min(1,c)),rescale()):E},g.copy=function(){return band(m(),[w,S]).round(M).paddingInner(k).paddingOuter(T).align(E)},initRange.apply(rescale(),arguments)}function d3_axis_src_identity(c){return c}var Rs=1e-6;function translateX(c){return"translate("+c+",0)"}function translateY(c){return"translate(0,"+c+")"}function axis_number(c){return h=>+c(h)}function center(c,h){return h=Math.max(0,c.bandwidth()-2*h)/2,c.round()&&(h=Math.round(h)),g=>+c(g)+h}function entering(){return!this.__axis}function axis(c,h){var g=[],m=null,b=null,w=6,S=6,M=3,k="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,T=1===c||4===c?-1:1,E=4===c||2===c?"x":"y",I=1===c||3===c?translateX:translateY;function axis(P){var L=null==m?h.ticks?h.ticks.apply(h,g):h.domain():m,B=null==b?h.tickFormat?h.tickFormat.apply(h,g):d3_axis_src_identity:b,z=Math.max(w,0)+M,j=h.range(),D=+j[0]+k,N=+j[j.length-1]+k,R=(h.bandwidth?center:axis_number)(h.copy(),k),G=P.selection?P.selection():P,q=G.selectAll(".domain").data([null]),W=G.selectAll(".tick").data(L,h).order(),H=W.exit(),U=W.enter().append("g").attr("class","tick"),Y=W.select("line"),V=W.select("text");q=q.merge(q.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),W=W.merge(U),Y=Y.merge(U.append("line").attr("stroke","currentColor").attr(E+"2",T*w)),V=V.merge(U.append("text").attr("fill","currentColor").attr(E,T*z).attr("dy",1===c?"0em":3===c?"0.71em":"0.32em")),P!==G&&(q=q.transition(P),W=W.transition(P),Y=Y.transition(P),V=V.transition(P),H=H.transition(P).attr("opacity",Rs).attr("transform",function(c){return isFinite(c=R(c))?I(c+k):this.getAttribute("transform")}),U.attr("opacity",Rs).attr("transform",function(c){var h=this.parentNode.__axis;return I((h&&isFinite(h=h(c))?h:R(c))+k)})),H.remove(),q.attr("d",4===c||2===c?S?"M"+T*S+","+D+"H"+k+"V"+N+"H"+T*S:"M"+k+","+D+"V"+N:S?"M"+D+","+T*S+"V"+k+"H"+N+"V"+T*S:"M"+D+","+k+"H"+N),W.attr("opacity",1).attr("transform",function(c){return I(R(c)+k)}),Y.attr(E+"2",T*w),V.attr(E,T*z).text(B),G.filter(entering).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===c?"start":4===c?"end":"middle"),G.each(function(){this.__axis=R})}return axis.scale=function(c){return arguments.length?(h=c,axis):h},axis.ticks=function(){return g=Array.from(arguments),axis},axis.tickArguments=function(c){return arguments.length?(g=null==c?[]:Array.from(c),axis):g.slice()},axis.tickValues=function(c){return arguments.length?(m=null==c?null:Array.from(c),axis):m&&m.slice()},axis.tickFormat=function(c){return arguments.length?(b=c,axis):b},axis.tickSize=function(c){return arguments.length?(w=S=+c,axis):w},axis.tickSizeInner=function(c){return arguments.length?(w=+c,axis):w},axis.tickSizeOuter=function(c){return arguments.length?(S=+c,axis):S},axis.tickPadding=function(c){return arguments.length?(M=+c,axis):M},axis.offset=function(c){return arguments.length?(k=+c,axis):k},axis}function axisBottom(c){return axis(3,c)}function axisLeft(c){return axis(4,c)}var Gs=function createHistogramLegend(c,h,g){var m=c.histogram.orientation||"horizontal",b=c.histogram.showCounts,w=c.histogram.showPercentages,S=c.histogram.labelRotation||0,M=c.histogram.margin||{top:0,right:0,bottom:0,left:0},k=c.histogram.height||200,T=c.histogram.width||270,E=c.getNumberOfClasses(c),I=c.getLabelFormatter(c),P=c.getColorClassifier(c),L=new Array(E).fill(0),B=function getData(c){var h=c.map;return Object.values(h.statData()._data_).map(function(c){return c.value})}(c),z=function getColors(c){var h=c.map;return h.colors_?h.colors_:Array.from({length:h.numberOfClasses_}).map(function(c,g){return h.classToFillStyle()(g,h.numberOfClasses_)})}(c),j=getThresholds(c);B.forEach(function(c){var h=P(c);"number"==typeof h&&h>=0&&h<L.length&&L[h]++});var D=L.reduce(function(c,h){return c+h},0),N=c.lgg.append("g").attr("class","em-legend-histogram").attr("transform","translate(".concat(h,", ").concat(g,")"));function handleMouseOver(h,g){var m=src_select(this).style("stroke","black").attr("ecl"),b=z.length-1-parseInt(m,10);legend_choropleth_highlightRegions(c.map,b),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,legend_choropleth_highlightRegions,m)}function handleMouseOut(h,g){src_select(this).style("stroke","none");legend_choropleth_unhighlightRegions(c.map),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,legend_choropleth_unhighlightRegions)}"vertical"===m?function drawVerticalHistogram(h){var g=L.slice().reverse(),m=g.map(function(c){return D>0?c/D*100:0}),S=j.slice().reverse(),E=band().domain(g.map(function(c,h){return h})).range([M.top,k-M.bottom]).padding(.1),P=linear_linear().domain([0,max_max(g)]).nice().range([M.left,T-M.right]);h.selectAll("rect").data(g).join("rect").attr("class","em-legend-histogram-bar").attr("y",function(c,h){return E(h)}).attr("x",M.left).attr("height",E.bandwidth()).attr("width",function(c){return P(c)-M.left}).attr("fill",function(c,h){return z[z.length-h-1]}).attr("ecl",function(c,h){return h}).on("mouseover",handleMouseOver).on("mouseout",handleMouseOut),(b||w)&&h.selectAll("text.em-histogram-label").data(g).join("text").attr("class","em-legend-label em-histogram-label").attr("x",function(c){return P(c)+5}).attr("y",function(c,h){return E(h)+E.bandwidth()/2}).attr("alignment-baseline","middle").text(function(c,h){return w?"".concat(m[h].toFixed(1),"%"):g[h]});var B=h.append("g").attr("id","em-legend-histogram-y-axis").attr("transform","translate(".concat(M.left,",0)"));if("thresholds"===c.labelType){for(var N=[],R=0;R<S.length;R++){var G=E(R);void 0!==G&&N.push(G+E.bandwidth())}var q=linear_linear().domain([0,k]).range([0,k]);B.call(axisLeft(q).tickValues(N).tickFormat(function(c,h){return I?I(S[h],h):S[h]}).tickSize(4).tickSizeOuter(0))}else"ranges"===c.labelType&&B.call(axisLeft(E).tickSizeOuter(0).tickSize(0).tickFormat(function(c,h){return I?I(S[h],h):S[h]}));B.selectAll("text").attr("class","em-legend-label em-tick-label").attr("text-anchor","end")}(N):function drawHorizontalHistogram(h){var g=L.slice().reverse(),m=g.map(function(c){return D>0?c/D*100:0}),E=z.slice().reverse(),P=band().domain(g.map(function(c,h){return h})).range([M.left,T-M.right]).padding(.1),B=linear_linear().domain([0,max_max(g)]).nice().range([k-M.bottom,M.top]);h.selectAll("rect").data(g).join("rect").attr("class","em-legend-histogram-bar").attr("x",function(c,h){return P(h)}).attr("y",function(c){return B(c)}).attr("width",P.bandwidth()).attr("height",function(c){return k-M.bottom-B(c)}).attr("fill",function(c,h){return E[h]}).attr("ecl",function(c,h){return h}).on("mouseover",handleMouseOver).on("mouseout",handleMouseOut),(b||w)&&h.selectAll("text.em-histogram-label").data(g).join("text").attr("class","em-legend-label em-histogram-label").attr("x",function(c,h){return P(h)+P.bandwidth()/2}).attr("y",function(c){return B(c)-5}).attr("text-anchor","middle").text(function(c,h){return w?"".concat(m[h].toFixed(1),"%"):c});var N=h.append("g").attr("id","em-legend-histogram-x-axis").attr("transform","translate(0, ".concat(k-M.bottom,")"));if("thresholds"===c.labelType){for(var R=[],G=0;G<j.length;G++){var q=j.length-G-1,W=P(q);void 0!==W&&R.push(W+P.bandwidth())}var H=linear_linear().domain([0,T]).range([0,T]);N.call(axisBottom(H).tickValues(R).tickFormat(function(c,h){return I?I(j[h],h):j[h]}).tickSize(4).tickSizeOuter(0)),N.selectAll("text").attr("class","em-legend-label em-tick-label").attr("text-anchor","end").attr("dy","0em").attr("dx","-0.45em").attr("transform","rotate(-".concat(S,")"))}else"ranges"===c.labelType&&(N.call(axisBottom(P).tickSizeOuter(0).tickSize(0).tickFormat(function(c,h){return I?I(j[h],h):j[h]})),N.selectAll("text").attr("class","em-legend-label em-tick-label").attr("text-anchor","end").attr("dy","0.35em").attr("dx","-0.35em").attr("transform","rotate(-".concat(S,")")))}(N)};function createContinuousLegend(c,h,g){c.map;c._continuousLegendContainer=c.lgg.append("g").attr("class","em-continuous-legend").attr("id","em-continuous-legend").attr("transform","translate(".concat(h,", ").concat(g,")"));var m="ps"==c.map._mapType?c.colorLegend:c,b="vertical"===m.orientation,w="legend-gradient-"+Math.random().toString(36).substr(2,5),S=c.width||6*c.shapeWidth,M=b?c.shapeWidth:c.shapeHeight;if(function createLegendGradient(c,h,g){for(var m,b=c.map,w="function"==typeof(null===(m=b.colorFunction_)||void 0===m?void 0:m.domain),S=20,M=function getTransformedDomain(c){var h=c.valueTransform_||function(c){return c},g=getUntransformedDomain(c);return g.map(h)}(b),k=slicedToArray_slicedToArray(3===M.length?M:[M[0],null,M[1]],3),T=k[0],E=k[1],I=k[2],P=c._continuousLegendContainer.append("defs").append("linearGradient").attr("id",h).attr("x1","0%").attr("x2",g?"0%":"100%").attr("y1",g?"100%":"0%").attr("y2","0%"),L=0;L<=S;L++){var B=L/S,z=void 0;z=3===M.length?B<.5?T+2*B*(E-T):E+2*(B-.5)*(I-E):T+B*(I-T);var j=b.colorFunction_(w?z:B);P.append("stop").attr("offset","".concat(100*B,"%")).attr("stop-color",j)}}(c,w,b),function drawLegendRect(c,h,g,m,b){var w=getTitlePadding(h),S=h._continuousLegendContainer.append("rect").attr("class","em-legend-gradient").attr("id","em-legend-gradient").attr("x",0).attr("y",w).attr("width",b?m:g).attr("height",b?g:m).style("fill","url(#".concat(c,")"));!function addMouseEvents(c,h,g,m){var b=h.map,w=getUntransformedDomain(b),S=b.valueUntransform_||function(c){return c},M=h._continuousLegendContainer,k=getTitlePadding(h),T=function getHighlightFunction(c){return"ps"==c._mapType?highlightPsSymbols:highlightRegions}(b),E=function getUnHighlightFunction(c){return"ps"==c._mapType?unhighlightPsSymbols:unhighlightRegions}(b);c.on("mousemove",function(c){var E,I=slicedToArray_slicedToArray(pointer(c,this),2),P=I[0],L=I[1],B=m?L-k:P,z=Math.max(0,Math.min(g,B)),j=z/g,D=m?1-j:j;if(3===w.length){var N=slicedToArray_slicedToArray(w,3),R=N[0],G=N[1],q=N[2];if(D<.5)E=R+(G-R)*(D/.5);else E=G+(q-G)*((D-.5)/.5)}else{var W=slicedToArray_slicedToArray(w,2),H=W[0];E=H+D*(W[1]-H)}E=S(E),M.selectAll(".em-hover-line, .em-hover-tick, .em-hover-label").remove();var U=m?0:z,Y=m?z+k:0;M.append("line").attr("class","em-hover-line").attr("x1",U).attr("y1",Y).attr("x2",m?U+h.shapeWidth:U).attr("y2",m?Y:Y+h.shapeHeight).attr("stroke","black").attr("stroke-width",1).attr("pointer-events","none"),M.append("circle").attr("class","em-hover-tick").attr("cx",m?U+h.shapeWidth:U).attr("cy",m?Y:Y+h.shapeHeight).attr("r",3).attr("fill","black").attr("pointer-events","none");var V=getChoroplethLabelFormatter(h);M.append("text").attr("class","em-hover-label").attr("x",m?U+h.shapeWidth+5:U).attr("y",m?Y:Y+h.shapeHeight+12).attr("text-anchor",m?"start":"middle").attr("alignment-baseline","middle").attr("pointer-events","none").text(V(E)),T(b,E)}),c.on("mouseout",function(){M.selectAll(".em-hover-line, .em-hover-tick, .em-hover-label").remove(),E(b)})}(S,h,g,b)}(w,c,S,M,b),!function hasTicks(c){return c.ticks>1||c.tickValues}(c)?function drawLowHighLabels(c,h,g,m){var b=getTitlePadding(c),w=c.lowLabel,S=c.highLabel,M=c.pointOfDivergenceLabel,k=c._continuousLegendContainer;if(m){var T=h,E=g+5;w&&k.append("text").attr("class","em-legend-label").attr("x",E).attr("y",b+T).attr("dy","-0.2em").attr("text-anchor","start").text(w),S&&k.append("text").attr("class","em-legend-label").attr("x",E).attr("y",b).attr("dy","0.8em").attr("text-anchor","start").text(S),M&&k.append("text").attr("class","em-legend-label").attr("x",E).attr("y",b+T/2).attr("dy","0.35em").attr("text-anchor","start").text(M)}else{var I=g+b+10;w&&k.append("text").attr("class","em-legend-label").attr("x",0).attr("y",I).attr("text-anchor","start").text(w),S&&k.append("text").attr("class","em-legend-label").attr("x",h).attr("y",I).attr("text-anchor","end").text(S),M&&k.append("text").attr("class","em-legend-label").attr("x",h/2).attr("y",I).attr("text-anchor","middle").text(M)}}(c,S,M,b):function drawTickLabels(c,h,g,m){var b=c.map,w=getUntransformedDomain(b),S=c._continuousLegendContainer.append("g").attr("class","em-legend-ticks"),M=getChoroplethLabelFormatter(c),k=b.valueTransform_||function(c){return c},T=getTitlePadding(c),E=Array.isArray(c.tickValues)&&c.tickValues?c.tickValues.map(k):function generateTickValues(c,h){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(c){return c};if(Array.isArray(c)&&3===c.length){var m=slicedToArray_slicedToArray(c,3),b=m[0],w=m[1],S=m[2];return Array.from({length:h},function(c,m){var M=m/(h-1);return g(M<.5?b+2*M*(w-b):w+2*(M-.5)*(S-w))})}var M=slicedToArray_slicedToArray(c,2),k=M[0],T=M[1];return Array.from({length:h},function(c,m){return g(k+m/(h-1)*(T-k))})}(w,c.ticks,k);E.forEach(function(k,I){var P=function computeNormalizedTickPosition(c,h){if(3===h.length){var g=slicedToArray_slicedToArray(h,3),m=g[0],b=g[1],w=g[2];return c<b?.5*(c-m)/(b-m):.5+.5*(c-b)/(w-b)}return(c-h[0])/(h[1]-h[0])}(k,w);if(m){var L=g,B=h-P*h+T;S.append("line").attr("class","em-legend-tick").attr("x1",L).attr("y1",B).attr("x2",L+c.tickLength).attr("y2",B);var z=Array.isArray(c.tickLabels)&&null!=c.tickLabels[I]?c.tickLabels[I]:b.valueUntransform_?M(b.valueUntransform_(k)):M(k);S.append("text").attr("class","em-legend-label em-legend-ticklabel").attr("x",L+c.tickLength+3).attr("y",B).attr("dy","0.35em").attr("text-anchor","start").text(z)}else{var j=P*h,D=g+T;S.append("line").attr("class","em-legend-tick").attr("x1",j).attr("y1",D).attr("x2",j).attr("y2",D+c.tickLength);var N=Array.isArray(c.tickLabels)&&null!=c.tickLabels[I]?c.tickLabels[I]:b.valueUntransform_?M(b.valueUntransform_(k)):M(k);S.append("text").attr("class","em-legend-label em-legend-ticklabel").attr("x",j).attr("y",D+c.tickLength+10).attr("dy","0").attr("text-anchor",0===I?"start":I===E.length-1?"end":"middle").text(N)}})}(c,S,M,b),c.noData){var k=(b?c.width+5:M+30)+getTitlePadding(c);m.pointOfDivergence&&m.pointOfDivergencePadding&&(k+=m.pointOfDivergencePadding);var T=c._continuousLegendContainer.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(0,",").concat(k,")"));c.appendNoDataLegend(T,m.noDataText,highlightRegions,unhighlightRegions)}}function getUntransformedDomain(c){var h;return"function"==typeof(null===(h=c.colorFunction_)||void 0===h?void 0:h.domain)?c.colorFunction_.domain():c.domain_||[0,1]}function getTitlePadding(c){return"ps"==c.map._mapType?c.colorLegend.titlePadding:c.titlePadding}function getHighlightTolerance(c){var h,g,m;return c&&c.legend_&&null!==(h=null!==(g=c.legend_.highlightTolerance)&&void 0!==g?g:null===(m=c.legend_.colorLegend)||void 0===m?void 0:m.highlightTolerance)&&void 0!==h?h:1}function highlightRegions(c,h){var g=getHighlightTolerance(c),m=jt(c),b=c.svg_.selectAll(m).selectAll("[ecl]");b&&b.each(function(){var c=src_select(this),m=c.attr("ecl");if(m&&"nd"!==m){var b=+m;b>=h-g&&b<=h+g?c.style("fill",src_select(this).attr("fill___")):c.style("fill","white")}else{if("nd"===h)return;c.style("fill","white")}})}function unhighlightRegions(c){var h=jt(c);c.svg_.selectAll(h).selectAll("[ecl]").each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}function highlightPsSymbols(c,h){var g=getHighlightTolerance(c);c.getCentroidsGroup(c).selectAll("[ecl]").each(function(){var m=src_select(this),b=m.attr("ecl");if(!b||"nd"===b)return"nd"===h?void m.style("opacity",c.psFillOpacity_):void m.style("opacity",0);var w=+b;w>=h-g&&w<=h+g?m.style("opacity",c.psFillOpacity_):m.style("opacity",0)})}function unhighlightPsSymbols(c){c.getCentroidsGroup(c).selectAll("[ecl]").each(function(){src_select(this).style("opacity",c.psFillOpacity_)})}function drawDiscreteLegend(c,h,g){var m,b;c._discreteLegendContainer=c.lgg.append("g").attr("class","em-discrete-legend-container").attr("transform","translate(".concat(h,",").concat(g,")")),null!==(m=c.colorLegend)&&void 0!==m&&m.title&&c._discreteLegendContainer.append("text").attr("class","em-legend-title em-color-legend-title").attr("id","em-color-legend-title").attr("x",0).attr("y",0).text(c.colorLegend.title);var w="ps"==c.map._mapType?c.colorLegend:c;if("ranges"===c.labelType||"ranges"===(null===(b=c.colorLegend)||void 0===b?void 0:b.labelType)?function createRangesLegend(c,h){for(var g=c.map,m=c._discreteLegendContainer,b=c.getLabelFormatter(c),w=c.getNumberOfClasses(c),S=c.getHighlightFunction(g),M=c.getUnHighlightFunction(g),k=c.getClassToFillStyle(c),T=c.getColorClassifier(c),E=legend_discrete_getTitlePadding(c),I=function _loop2(){var g=P*h.shapeHeight+E,I=0,L=c.ascending?w-P-1:P,B=k(L,w),z=m.append("g").attr("class","em-legend-item");h.pointOfDivergenceLabel&&P>=h.pointOfDivergence&&(g+=h.pointOfDivergencePadding),z.append("rect").attr("class","em-legend-rect").attr("x",I).attr("y",g).attr("width",h.shapeWidth).attr("height",h.shapeHeight).style("fill",B).on("mouseover",function(){src_select(this).raise(),S(c.map,L),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,S,L)}).on("mouseout",function(){M(c.map),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,M,L)}),P>0&&z.append("line").attr("class","em-legend-separator").attr("x1",0).attr("y1",g).attr("x2",h.sepLineLength).attr("y2",g),z.append("text").attr("class","em-legend-label").attr("x",Math.max(h.shapeWidth,h.sepLineLength+h.tickLength)+(h.labelOffsets.x||0)).attr("y",g+h.shapeHeight/2).attr("dy","0.3em").text(h.labels?h.labels[P]:b(T.invertExtent(L)[c.ascending?0:1],P))},P=0;P<w;P++)I();if(h.pointOfDivergenceLabel)for(var L=0;L<w;L++){var B=L*h.shapeHeight+E;L==h.pointOfDivergence&&drawDivergingLine(c,B,h)}}(c,w):function createThresholdsLegend(c,h){var g,m,b,w,S,M,k=c.map,T=c._discreteLegendContainer,E=c.getNumberOfClasses(c),I=legend_discrete_getTitlePadding(c),P=c.getHighlightFunction(k),L=c.getUnHighlightFunction(k),B=c.getColorClassifier(c),z=c.getClassToFillStyle(c),j=c.getColorStats(c),D=c.getLabelFormatter(c);if((c.maxMin||h.maxMin)&&j&&(null!=j&&j.getMin&&null!=j&&j.getMax&&(g=j.getMin(),m=j.getMax()),null!=j&&j.getMaxRegionId&&null!=j&&j.getMinRegionId)){var N,R,G,q;b=j.getMinRegionId(),w=j.getMaxRegionId();var W=k.Geometries.getAllRegionFeatures(),H=W.find(function(c){return c.properties.id===b}),U=W.find(function(c){return c.properties.id===w});H&&(S=(null===(N=H.properties)||void 0===N?void 0:N.na)||(null===(R=H.properties)||void 0===R?void 0:R.na)||b),U&&(M=(null===(G=U.properties)||void 0===G?void 0:G.na)||(null===(q=U.properties)||void 0===q?void 0:q.na)||w)}for(var Y=function _loop(g){var m=g*h.shapeHeight+I,b=0,w=c.ascending?E-g-1:g,S=z(w,E),M=T.append("g").attr("class","em-legend-item");if(M.append("rect").attr("class","em-legend-rect").attr("x",b).attr("y",m).attr("width",h.shapeWidth).attr("height",h.shapeHeight).style("fill",S).on("mouseover",function(){src_select(this).raise(),P(k,w),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,P,w)}).on("mouseout",function(){L(k),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,L,w)}),g>0&&M.append("line").attr("class","em-legend-separator").attr("x1",0).attr("y1",m).attr("x2",c.sepLineLength).attr("y2",m),g>0&&M.append("line").attr("class","em-legend-tick").attr("x1",h.sepLineLength).attr("y1",m).attr("x2",h.sepLineLength+h.tickLength).attr("y2",m),g<E-1){var j=M.append("text").attr("class","em-legend-label").attr("x",Math.max(h.shapeWidth,h.sepLineLength+h.tickLength)+(h.labelOffsets.x||0)).attr("y",m+h.shapeHeight).attr("dy","0.3em").text(function(){if(h.labels)return h.labels[g];if(null!=B&&B.invertExtent){var m=B.invertExtent(w);return D(m[c.ascending?0:1])}return k.noDataText_||""});h.pointOfDivergenceLabel&&g==h.pointOfDivergence-1&&j.attr("class","em-legend-label em-legend-label-divergence")}},V=0;V<E;V++)Y(V);if((c.maxMin||h.maxMin)&&Number.isFinite(g)&&Number.isFinite(m)){var $=!0,X=!0;if(null!=B&&B.invertExtent){var K=c.ascending?E-1:0,Z=c.ascending?0:E-1,J=B.invertExtent(K),Q=B.invertExtent(Z);!J||J[0]!==J[1]&&J[0]!==m||($=!1),!Q||Q[0]!==Q[1]&&Q[1]!==g||(X=!1)}var tt=0,et=h.maxMinTickLength?h.sepLineLength+h.maxMinTickLength:h.sepLineLength+h.tickLength,nt=h.maxMinTickLength?Math.max(h.shapeWidth,h.sepLineLength+h.maxMinTickLength)+(h.labelOffsets.x||0):Math.max(h.shapeWidth,h.sepLineLength+h.tickLength)+(h.labelOffsets.x||0),rt=D(m)+(h.maxMinLabels?h.maxMinLabels[1]:""),ot=D(g)+(h.maxMinLabels?h.maxMinLabels[0]:"");h.maxMinRegionLabels&&(rt="".concat(D(m)," (").concat(M,")"),ot="".concat(D(g)," (").concat(S,")"));var at=T.append("g").attr("class","em-legend-max-min-group");if($){var it=I;at.append("line").attr("class","em-legend-tick em-legend-tick-max").attr("x1",tt).attr("y1",it).attr("x2",et).attr("y2",it),at.append("text").style("pointer-events","all").style("cursor","pointer").on("mouseover",function(){var h=c.getNumberOfClasses(c);!function highlightMaxRegion(c,h,g){var m=jt(c),b=h-1,w=c.svg_.selectAll(m).selectAll("[ecl]");w.style("fill","white"),w.filter("[ecl='"+b+"']").each(function(h){h.properties.id===g&&src_select(this).style("fill",c.hoverColor_)})}(k,h,w)}).on("mouseout",function(){legend_choropleth_unhighlightRegions(k)}).attr("class","em-legend-label em-legend-label-max").attr("x",nt).attr("y",it).attr("dy","0.3em").text(rt)}if(X){var st=E*h.shapeHeight+I;at.append("line").attr("class","em-legend-tick em-legend-tick-min").attr("x1",tt).attr("y1",st).attr("x2",et).attr("y2",st),at.append("text").style("pointer-events","all").style("cursor","pointer").on("mouseover",function(){!function highlightMinRegion(c,h){var g=jt(c),m=0,b=c.svg_.selectAll(g).selectAll("[ecl]");b.style("fill","white"),b.filter("[ecl='"+m+"']").each(function(g){g.properties.id===h&&src_select(this).style("fill",c.hoverColor_)})}(k,b)}).on("mouseout",function(){legend_choropleth_unhighlightRegions(k)}).attr("class","em-legend-label em-legend-label-min").attr("x",nt).attr("y",st).attr("dy","0.3em").text(ot)}}if(h.pointOfDivergenceLabel)for(var lt=0;lt<E;lt++){var ct=lt*h.shapeHeight+I;lt==h.pointOfDivergence&&drawDivergingLine(c,ct,h)}}(c,w),w.noData){var S=c.getNumberOfClasses(c)*w.shapeHeight+legend_discrete_getTitlePadding(c)+3;w.pointOfDivergence&&w.pointOfDivergencePadding&&(S+=w.pointOfDivergencePadding);var M=c._discreteLegendContainer.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(0,",").concat(S,")")),k=c.getHighlightFunction(c.map),T=c.getUnHighlightFunction(c.map);c.appendNoDataLegend(M,w.noDataText,k,T)}}function legend_discrete_getTitlePadding(c){var h="ps"==c.map._mapType?c.colorLegend.titlePadding:c.titlePadding||0;return c.maxMin&&(h+=10),h}function drawDivergingLine(c,h,g){var m,b,w,S=c._discreteLegendContainer.append("g").attr("class","em-legend-divergence-container");"ranges"==g.labelType&&(h+=g.pointOfDivergencePadding/2);var M=c._discreteLegendContainer.selectAll(".em-legend-label").nodes().reduce(function(c,h){return Math.max(c,h.getBBox().width)},0),k=c.divergingLineLength||c.shapeWidth+(null===(m=c.labelOffsets)||void 0===m?void 0:m.x)+M+(null===(b=c.labelOffsets)||void 0===b?void 0:b.x)+15;S.append("line").attr("x1",0).attr("y1",h).attr("x2",0+k).attr("y2",h).attr("class","em-legend-diverging-line");var T=c.pointOfDivergenceLabel.split("|");if(T.length>1){var E=c.divergingArrowLength||30,I=0+k;S.append("defs").append("marker").attr("id","arrowhead").attr("markerWidth",6).attr("markerHeight",6).attr("refX",0).attr("refY",3).attr("orient","auto").append("polygon").attr("points","0 0, ".concat(6," ").concat(3,", 0 ").concat(6)).attr("fill","black"),S.append("line").attr("class","em-legend-diverging-line").attr("x1",I).attr("y1",h).attr("x2",I).attr("y2",h-E).attr("marker-end","url(#arrowhead)"),S.append("line").attr("class","em-legend-diverging-line").attr("x1",I).attr("y1",h).attr("x2",I).attr("y2",h+E).attr("marker-end","url(#arrowhead)"),S.append("text").attr("class","em-legend-label").attr("x",I+10).attr("y",h-E+10).attr("dy","0.3em").text(T[0]),S.append("text").attr("class","em-legend-label").attr("x",I+10).attr("y",h+E-10).attr("dy","0.3em").text(T[1])}else S.append("text").attr("class","em-legend-diverging-label em-legend-label").attr("x",0+k+5).attr("y",h).attr("dy","0.3em").text(c.pointOfDivergenceLabel);"thresholds"!=c.labelType&&"thresholds"!=(null===(w=c.colorLegend)||void 0===w?void 0:w.labelType)||(T.length>1?c._discreteLegendContainer.selectAll(".em-legend-label-divergence").attr("x",0+k+10):c._discreteLegendContainer.selectAll(".em-legend-label-divergence").remove())}function legend_choropleth_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function legend_choropleth_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?legend_choropleth_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):legend_choropleth_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}var qs=function legend(c,h){var g=wl(c);if(g.labelType="thresholds",g.sepLineLength=g.shapeWidth,g.tickLength=4,g.decimals=0,g.labelOffsets={x:3,y:0},g.labels=null,g.histogram=null,g.pointOfDivergenceLabel=void 0,g.pointOfDivergence=void 0,g.pointOfDivergencePadding=7,g.divergingLineLength=void 0,g.divergingArrowLength=void 0,g.lowLabel="Low",g.highLabel="High",g.ticks=0,g.tickValues=void 0,g.tickLabels=void 0,g.orientation="vertical",h)for(var m in h)"histogram"===m&&"object"===_typeof(h[m])?g.histogram=legend_choropleth_objectSpread({orientation:"horizontal",showCounts:!1,showPercentages:!1,labelRotation:0},h.histogram):g[m]=h[m];return g.update=function(){if(g.updateConfig(),g.updateContainer(),g.lgg.node()){var c=g.map;if(g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle(),!c.classToFillStyle())return;g.pointOfDivergenceLabel&&!g.pointOfDivergence&&(g.pointOfDivergence=c.numberOfClasses_/2);var h=g.getBaseY(),m=g.getBaseX();if(g.histogram?Gs(g,m,h):"continuous"===c.colorSchemeType_?createContinuousLegend(g,m,h):drawDiscreteLegend(g,m,h),c.opacityScale_){var b=g.lgg.node().getBBox().height+10;!function createAlphaLegend(c,h,g){var m,b=c.map,w=b.statData("alpha");if(w&&w.isReady()){var S=b.opacityScale_,M=S.domain()[0],k=S.domain()[1],T=getChoroplethLabelFormatter(c);c._alphaLegendContainer=c.lgg.append("g").attr("class","alpha-legend-container").attr("transform","translate(".concat(h,",").concat(g,")"));for(var E=0;E<40;E++){var I=M+(k-M)*E/40;c._alphaLegendContainer.append("rect").attr("x",3*E).attr("y",0).attr("width",3).attr("height",10).style("fill","#000").style("opacity",S(I))}c._alphaLegendContainer.append("text").attr("x",0).attr("y",22).attr("class","em-legend-label").text(T(M)),c._alphaLegendContainer.append("text").attr("x",120).attr("y",22).attr("text-anchor","end").attr("class","em-legend-label").text(T(k)),c._alphaLegendContainer.append("text").attr("x",60).attr("y",-5).attr("text-anchor","middle").attr("class","em-legend-label").text((null===(m=w.unitText)||void 0===m?void 0:m.call(w))||"Transparency")}}(g,m,h+b)}if(g.map.patternFill_){var w=g.lgg.node().getBBox().height,S=g.lgg.append("g").attr("class","pattern-fill-legend").attr("transform","translate(".concat(g.getBaseX(),", ").concat(w+g.boxPadding+5,")"));appendPatternFillLegend(g,S)}g.setBoxDimension()}},g.labelDecNb=function(c){return console.warn("labelDecNb is now DEPRECATED. Please use decimals instead."),g},g};function getThresholds(c){var h=c.map,g=h.thresholds_.length>1?h.thresholds_:Array.from({length:h.numberOfClasses_}).map(function(g,m){return h.classifier().invertExtent(m)[c.ascending?0:1]}).slice(1);return g}function getChoroplethLabelFormatter(c){if("ranges"==c.labelType){var h=getThresholds(c);return c.labelFormatter||function defaultLabeller(g,m){var b=_t(".".concat(c.decimals,"f"));return 0===m?"> ".concat(b(h[h.length-1])):m===h.length?"< ".concat(b(h[0])):"".concat(b(h[h.length-m-1])," - < ").concat(b(h[h.length-m])," ")}}var g=_t(".".concat(c.decimals,"f"));return c.labelFormatter||function(c){return Ft(g(c))}}function legend_choropleth_highlightRegions(c,h){var g=jt(c),m=c.svg_.selectAll(g).selectAll("[ecl]");m.style("fill","white"),m.filter("[ecl='"+h+"']").each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}function legend_choropleth_unhighlightRegions(c){var h=jt(c);c.svg_.selectAll(h).selectAll("[ecl]").each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}function node_modules_d3_shape_src_constant(c){return function constant(){return c}}const Ws=Math.PI,Hs=2*Ws,Us=1e-6,Ys=Hs-Us;function path_append(c){this._+=c[0];for(let h=1,g=c.length;h<g;++h)this._+=arguments[h]+c[h]}class path_Path{constructor(c){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==c?path_append:function path_appendRound(c){let h=Math.floor(c);if(!(h>=0))throw new Error(`invalid digits: ${c}`);if(h>15)return path_append;const g=10**h;return function(c){this._+=c[0];for(let h=1,m=c.length;h<m;++h)this._+=Math.round(arguments[h]*g)/g+c[h]}}(c)}moveTo(c,h){this._append`M${this._x0=this._x1=+c},${this._y0=this._y1=+h}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(c,h){this._append`L${this._x1=+c},${this._y1=+h}`}quadraticCurveTo(c,h,g,m){this._append`Q${+c},${+h},${this._x1=+g},${this._y1=+m}`}bezierCurveTo(c,h,g,m,b,w){this._append`C${+c},${+h},${+g},${+m},${this._x1=+b},${this._y1=+w}`}arcTo(c,h,g,m,b){if(c=+c,h=+h,g=+g,m=+m,(b=+b)<0)throw new Error(`negative radius: ${b}`);let w=this._x1,S=this._y1,M=g-c,k=m-h,T=w-c,E=S-h,I=T*T+E*E;if(null===this._x1)this._append`M${this._x1=c},${this._y1=h}`;else if(I>Us)if(Math.abs(E*M-k*T)>Us&&b){let P=g-w,L=m-S,B=M*M+k*k,z=P*P+L*L,j=Math.sqrt(B),D=Math.sqrt(I),N=b*Math.tan((Ws-Math.acos((B+I-z)/(2*j*D)))/2),R=N/D,G=N/j;Math.abs(R-1)>Us&&this._append`L${c+R*T},${h+R*E}`,this._append`A${b},${b},0,0,${+(E*P>T*L)},${this._x1=c+G*M},${this._y1=h+G*k}`}else this._append`L${this._x1=c},${this._y1=h}`;else;}arc(c,h,g,m,b,w){if(c=+c,h=+h,w=!!w,(g=+g)<0)throw new Error(`negative radius: ${g}`);let S=g*Math.cos(m),M=g*Math.sin(m),k=c+S,T=h+M,E=1^w,I=w?m-b:b-m;null===this._x1?this._append`M${k},${T}`:(Math.abs(this._x1-k)>Us||Math.abs(this._y1-T)>Us)&&this._append`L${k},${T}`,g&&(I<0&&(I=I%Hs+Hs),I>Ys?this._append`A${g},${g},0,1,${E},${c-S},${h-M}A${g},${g},0,1,${E},${this._x1=k},${this._y1=T}`:I>Us&&this._append`A${g},${g},0,${+(I>=Ws)},${E},${this._x1=c+g*Math.cos(b)},${this._y1=h+g*Math.sin(b)}`)}rect(c,h,g,m){this._append`M${this._x0=this._x1=+c},${this._y0=this._y1=+h}h${g=+g}v${+m}h${-g}Z`}toString(){return this._}}function withPath(c){let h=3;return c.digits=function(g){if(!arguments.length)return h;if(null==g)h=null;else{const c=Math.floor(g);if(!(c>=0))throw new RangeError(`invalid digits: ${g}`);h=c}return c},()=>new path_Path(h)}const Vs=Math.abs,$s=Math.atan2,Xs=Math.cos,Ks=Math.max,Zs=Math.min,Js=Math.sin,Qs=Math.sqrt,tl=1e-12,el=Math.PI,nl=el/2,rl=2*el;function d3_shape_src_math_asin(c){return c>=1?nl:c<=-1?-nl:Math.asin(c)}Qs(3);const ol={draw(c,h){const g=Qs(h/el);c.moveTo(g,0),c.arc(0,0,g,0,rl)}},al={draw(c,h){const g=Qs(h/5)/2;c.moveTo(-3*g,-g),c.lineTo(-g,-g),c.lineTo(-g,-3*g),c.lineTo(g,-3*g),c.lineTo(g,-g),c.lineTo(3*g,-g),c.lineTo(3*g,g),c.lineTo(g,g),c.lineTo(g,3*g),c.lineTo(-g,3*g),c.lineTo(-g,g),c.lineTo(-3*g,g),c.closePath()}},il=Qs(1/3),sl=2*il,ll={draw(c,h){const g=Qs(h/sl),m=g*il;c.moveTo(0,-g),c.lineTo(m,0),c.lineTo(0,g),c.lineTo(-m,0),c.closePath()}},cl={draw(c,h){const g=Qs(h),m=-g/2;c.rect(m,m,g,g)}},ul=Js(el/10)/Js(7*el/10),hl=Js(rl/10)*ul,dl=-Xs(rl/10)*ul,pl={draw(c,h){const g=Qs(.8908130915292852*h),m=hl*g,b=dl*g;c.moveTo(0,-g),c.lineTo(m,b);for(let h=1;h<5;++h){const w=rl*h/5,S=Xs(w),M=Js(w);c.lineTo(M*g,-S*g),c.lineTo(S*m-M*b,M*m+S*b)}c.closePath()}},fl=Qs(3),gl={draw(c,h){const g=-Qs(h/(3*fl));c.moveTo(0,2*g),c.lineTo(-fl*g,-g),c.lineTo(fl*g,-g),c.closePath()}},_l=(Qs(3),-.5),ml=Qs(3)/2,vl=1/Qs(12),yl=3*(vl/2+1),Al={draw(c,h){const g=Qs(h/yl),m=g/2,b=g*vl,w=m,S=g*vl+g,M=-w,k=S;c.moveTo(m,b),c.lineTo(w,S),c.lineTo(M,k),c.lineTo(_l*m-ml*b,ml*m+_l*b),c.lineTo(_l*w-ml*S,ml*w+_l*S),c.lineTo(_l*M-ml*k,ml*M+_l*k),c.lineTo(_l*m+ml*b,_l*b-ml*m),c.lineTo(_l*w+ml*S,_l*S-ml*w),c.lineTo(_l*M+ml*k,_l*k-ml*M),c.closePath()}};function symbol_Symbol(c,h){let g=null,m=withPath(symbol);function symbol(){let b;if(g||(g=b=m()),c.apply(this,arguments).draw(g,+h.apply(this,arguments)),b)return g=null,b+""||null}return c="function"==typeof c?c:node_modules_d3_shape_src_constant(c||ol),h="function"==typeof h?h:node_modules_d3_shape_src_constant(void 0===h?64:+h),symbol.type=function(h){return arguments.length?(c="function"==typeof h?h:node_modules_d3_shape_src_constant(h),symbol):c},symbol.size=function(c){return arguments.length?(h="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),symbol):h},symbol.context=function(c){return arguments.length?(g=null==c?null:c,symbol):g},symbol}function drawCircleSizeLegend(c,h,g,m,b){var w,S,M,k,T=arguments.length>5&&void 0!==arguments[5]?arguments[5]:16;if(b){var E=Pt("em-size-legend-title");T+=E,h.append("text").attr("class","em-size-legend-title").attr("id","em-size-legend-title").attr("x",0).attr("y",E).text(b)}var I=m.domain();if(!g){var P,L=I[0],B=I[1];0===L&&null!==(P=m._values)&&void 0!==P&&P.length&&(L=Math.min.apply(Math,toConsumableArray_toConsumableArray(m._values.filter(function(c){return c>0})))),g=[B,L]}var z=m(max_max(g)),j=z,D=2*z+T,N=h.append("g").attr("transform","translate(".concat(j,",").concat(D,")")).attr("class","em-circle-size-legend").attr("id","em-circle-size-legend").attr("text-anchor","right").style("fill","black").selectAll("g").data(g.filter(function(c){return m(c)})).join("g").attr("class","em-legend-item");N.append("circle").attr("class","em-legend-circle").style("fill","none").attr("stroke","black").attr("cy",function(c){return-m(c)}).attr("r",m);var R=(null===(w=c.sizeLegend)||void 0===w?void 0:w.labelFormatter)||Ft;null!==(S=c.nodeSizeLegend)&&void 0!==S&&S.labelFormatter&&(R=c.nodeSizeLegend.labelFormatter);var G=(null===(M=c.sizeLegend)||void 0===M?void 0:M.labels)||(null===(k=c.nodeSizeLegend)||void 0===k?void 0:k.labels);return N.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("y",function(c,h){return-1-2*m(c)}).attr("x",z+5).text(function(c,h){return G&&G[h]?G[h]:R(c)}),N.append("line").style("stroke-dasharray",2).style("stroke","grey").attr("x1",2).attr("y1",function(c,h){return-1-2*m(c)}).attr("x2",z+5).attr("y2",function(c,h){return-1-2*m(c)}),c}function buildSpikeLegend(c){var h,g=c.map,m=(null===(h=c.sizeLegend)||void 0===h?void 0:h.labelFormatter)||Ft,b=g.classifierSize_.domain(),w=b[1],S=b[0],M=g.classifierSize_(w),k=c.sizeLegend.values||[w,S],T=Pt("em-legend-label"),E=c.sizeLegend.title?Pt("em-size-legend-title"):0,I=T+2,P=c._sizeLegendContainer.append("g").attr("id","em-spike-legend"),L=0;c.sizeLegend.title&&(P.append("text").attr("class","em-legend-title em-spike-legend-title").attr("id","em-size-legend-title").attr("x",0).attr("y",E).text(c.sizeLegend.title),L+=E+8);var B=k.map(function(c){return String(m(c))}),z=Math.max.apply(Math,toConsumableArray_toConsumableArray(B.map(function(c){return c.length}))),j=z*T*.45+5,D=P.append("g").attr("id","em-spike-legend-items").attr("transform","translate(".concat(c.boxPadding+T,",").concat(L+M,")")).attr("text-anchor","middle").style("font-size","".concat(T,"px")).selectAll("g").data(k).join("g").attr("transform",function(c,h){return"translate(".concat(h*j,",0)")});D.append("path").attr("d",function(c){return function spike(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.psSpikeWidth_;return"M".concat(-h/2,",0L0,").concat(-c,"L").concat(h/2,",0")}(g.classifierSize_(c))}).attr("fill",g.psFill_).attr("fill-opacity",g.psFillOpacity_).attr("stroke",g.psStroke_).attr("stroke-width",g.psStrokeWidth_),D.append("text").attr("class","em-legend-label em-spike-legend-label").attr("dy",I).text(function(c){return m(c)})}var bl={cross:al,square:cl,diamond:ll,triangle:gl,star:pl,wye:Al,circle:ol};function buildD3SymbolItem(c,h,g,m,b){var w=c.map;null==c.sizeLegend._cursorY&&(c.sizeLegend._cursorY=c.boxPadding+(c.sizeLegend.title?c.sizeLegend.titlePadding:0));var S=w.classifierSize_(w.classifierSize_.domain()[1]),M=S,k=c.sizeLegend._cursorY+c.sizeLegend.shapePadding,T=c._sizeLegendContainer.append("g").attr("class","em-size-legend-item").attr("transform","translate(".concat(M,",").concat(k,")")),E=function getShape(c){var h,g=c.map;if(g.psCustomSVG_)h=g.psCustomSVG_;else if(g.psCustomShape_)h=g.psCustomShape_;else if("bar"==g.psShape_)h=symbol_Symbol().type({draw:function drawRectangle(c,h){var m=Math.sqrt(h);c.moveTo(0,0),c.lineTo(0,m),c.lineTo(g.psBarWidth_,m),c.lineTo(g.psBarWidth_,0),c.lineTo(0,0),c.closePath()}});else{var m=bl[g.psShape_]||bl.circle;h=symbol_Symbol().type(m)}return h}(c),I=E.size(g*g)(),P=T.append("g").style("fill",w.classifierColor_?c.sizeLegend.shapeFill:w.psFill_).style("fill-opacity",w.psFillOpacity()).style("stroke",c.sizeLegend.shapeStroke||w.psStroke()).style("stroke-width",c.sizeLegend.shapeStrokeWidth||w.psStrokeWidth()).append("path").attr("d",I),L=P.node().getBBox();P.attr("transform","translate(".concat(c.sizeLegend.shapeOffsets.x,",").concat(c.sizeLegend.shapeOffsets.y+L.height/2,")"));var B=S/2+c.sizeLegend.labelOffsets.x+c.boxPadding;T.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("x",B).attr("y",L.height/2).text(b(h));var z=T.node().getBBox().height;c.sizeLegend._cursorY+=z+c.sizeLegend.shapePadding}function drawSizeLegend(c,h,g){var m=c.map;if(c._sizeLegendContainer=c.lgg.append("g").attr("class","em-size-legend-container").attr("id","em-size-legend-container").attr("transform","translate(".concat(h,",").concat(g,")")),c.sizeLegend._cursorY=null,m.psCustomSVG_||"circle"!==m.psShape_)if("spike"===m.psShape_)buildSpikeLegend(c);else{var b,w=c._sizeLegendContainer;if(c.sizeLegend.title){var S=Pt("em-size-legend-title");w.append("text").attr("class","em-legend-title em-size-legend-title").attr("id","em-size-legend-title").attr("x",0).attr("y",S).text(c.sizeLegend.title)}var M=(null===(b=c.sizeLegend)||void 0===b?void 0:b.labelFormatter)||Ft,k=m.classifierSize_.domain();m.customSymbols={nodeHeights:0},c.sizeLegend.values||(c.sizeLegend.values=[k[1],k[0]]);var T=c.sizeLegend.values.length;(!T||T<2)&&(console.warn("eurostat-map: sizeLegend.values length must be at least 2"),T=2);for(var E=1;E<T+1;E++){var I=c.sizeLegend.values[E-1],P=m.classifierSize_(I);"bar"===m.psShape_?buildBarsItem(c,I,P,E,M):"custom"===m.psShape_||m.psCustomSVG_?buildCustomSVGItem(c,I,P,E,M):buildD3SymbolItem(c,I,P,0,M)}}else drawCircleSizeLegend(c,c._sizeLegendContainer,c.sizeLegend.values,m.classifierSize_,c.sizeLegend.title,c.sizeLegend.titlePadding);c.sizeLegend.noData&&function addNoDataLegend(c){var h=c._sizeLegendContainer.node().getBBox(),g={default:20,bar:35,spike:1,circle:1,square:20},m=g[c.map.psShape_]||g.default,b=c.noDataShapeHeight,w=h.height+m+b/2,S=0,M=c._sizeLegendContainer.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(S,",").concat(w,")"));c.appendNoDataLegend(M,c.sizeLegend.noDataText,highlightPsRegions,unhighlightPsRegions)}(c)}function buildCustomSVGItem(c,h,g,m,b){var w=c.map;null==c.sizeLegend._cursorY&&(c.sizeLegend._cursorY=c.boxPadding+(c.sizeLegend.title?c.sizeLegend.titlePadding:0));var S=w.classifierSize_(w.classifierSize_.domain()[1]),M=c.boxPadding+S,k=c.sizeLegend._cursorY,T=c._sizeLegendContainer.append("g").attr("class","em-size-legend-item").attr("transform","translate(".concat(M,",").concat(k,")")),E=T.append("g").attr("class","em-size-legend-symbol").style("fill",w.classifierColor_?c.sizeLegend.shapeFill:w.psFill_).style("fill-opacity",w.psFillOpacity()).style("stroke",c.sizeLegend.shapeStroke||w.psStroke()).style("stroke-width",c.sizeLegend.shapeStrokeWidth||w.psStrokeWidth()).append("g").html(w.psCustomSVG_).attr("transform","scale(".concat(g,")")),I=E.node().getBBox();E.attr("transform","translate(".concat(-I.x-I.width/2,",").concat(-I.y-I.height/2,") scale(").concat(g,")"));var P=M+w.classifierSize_(w.classifierSize_.domain()[0])+c.sizeLegend.labelOffsets.x;T.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("x",P).attr("y",0).text(b(h));var L=T.node().getBBox().height;c.sizeLegend._cursorY+=L+c.sizeLegend.shapePadding}function buildBarsItem(c,h,g,m,b){var w=c.map;null==c.sizeLegend._cursorY&&(c.sizeLegend._cursorY=c.boxPadding+(c.sizeLegend.title?c.sizeLegend.titlePadding:0));var S=c.boxPadding,M=c.sizeLegend._cursorY+c.sizeLegend.shapePadding,k=function legend_symbol_size_getShape(c){var h,g=c.map;if(g.psCustomSVG_)h=g.psCustomSVG_;else if(g.psCustomShape_)h=g.psCustomShape_;else if("bar"==g.psShape_){var m=function drawRectangle(c,h){var m=Math.sqrt(h);c.moveTo(0,0),c.lineTo(0,m),c.lineTo(g.psBarWidth_,m),c.lineTo(g.psBarWidth_,0),c.lineTo(0,0),c.closePath()};h=symbol_Symbol().type({draw:m})}else{var b=bl[g.psShape_]||bl.circle;h=symbol_Symbol().type(b)}return h}(c),T=k.size(g*g)(),E=c._sizeLegendContainer.append("g").attr("class","em-size-legend-item").attr("transform","translate(".concat(S,",").concat(M,")"));E.append("g").style("fill",w.classifierColor_?c.sizeLegend.shapeFill:w.psFill_).style("fill-opacity",w.psFillOpacity()).style("stroke",c.sizeLegend.shapeStroke?c.sizeLegend.shapeStroke:w.psStroke()).style("stroke-width",c.sizeLegend.shapeStrokeWidth||w.psStrokeWidth()).append("path").attr("d",T).attr("transform","translate(".concat(c.sizeLegend.shapeOffsets.x,",").concat(c.sizeLegend.shapeOffsets.y,")"));var I=S+w.psBarWidth_+c.sizeLegend.labelOffsets.x,P=g/2+c.sizeLegend.labelOffsets.y;E.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("x",I).attr("y",P).text(b(h));var L=E.node().getBBox().height;c.sizeLegend._cursorY+=L+c.sizeLegend.shapePadding}function highlightPsRegions(c,h){var g=c.getCentroidsGroup(c).selectAll("[ecl]");g.each(function(c,h){src_select(this).style("opacity","0")}),g.filter("[ecl='"+h+"']").each(function(h,g){src_select(this).style("opacity",c.psFillOpacity_)})}function unhighlightPsRegions(c){c.getCentroidsGroup(c).selectAll("[ecl]").each(function(h,g){src_select(this).style("opacity",c.psFillOpacity_)})}var xl=function legend(c,h){var g=wl(c);if(g.sizeLegend={title:null,titlePadding:15,values:void 0,cellNb:3,shapePadding:15,shapeOffsets:{x:0,y:0},shapeFill:"white",shapeStroke:null,shapeStrokeWidth:null,labelOffsets:{x:10,y:0},decimals:0,labelFormatter:void 0,labels:null,noData:!1,noDataText:"No data",_totalBarsHeight:0,_totalD3SymbolsHeight:0},g.colorLegend={title:null,titlePadding:10,marginTop:30,shapeWidth:25,shapeHeight:20,shapePadding:1,labelOffsets:{x:5,y:0},decimals:0,labelFormatter:void 0,labelType:"thresholds",labels:null,noData:!0,noDataText:"No data",sepLineLength:24,sepLineStroke:"black",sepLineStrokeWidth:1,tickLength:5,pointOfDivergenceLabel:void 0,pointOfDivergence:void 0,pointOfDivergencePadding:7,divergingLineLength:void 0,divergingArrowLength:void 0},h)for(var m in h)if("colorLegend"==m||"sizeLegend"==m){for(var b in g[m])void 0!==h[m][b]&&(g[m][b]=h[m][b]);0==h.colorLegend&&(g.colorLegend=!1)}else g[m]=h[m];return g.update=function(){if(g.updateConfig(),g.updateContainer(),g.lgg.node()){g.lgg.selectAll("*").remove(),g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle(),g.sizeLegend._totalBarsHeight=0,g.sizeLegend._totalD3SymbolsHeight=0;var h=g.getBaseY(),m=g.getBaseX();if(c.classifierSize_&&drawSizeLegend(g,m,h),c.classifierColor_&&g.colorLegend){var b=m,w=h;g._sizeLegendContainer&&(w+=g._sizeLegendContainer.node().getBBox().height+g.colorLegend.marginTop),drawDiscreteLegend(g,b,w)}if(g.map.patternFill_){var S=g.lgg.node().getBBox().height,M=g.lgg.append("g").attr("class","pattern-fill-legend").attr("transform","translate(".concat(m,", ").concat(S+g.boxPadding+5,")"));appendPatternFillLegend(g,M)}g.setBoxDimension()}},g};function getPropSymbolColorLabelFormatter(c){if("ranges"==c.colorLegend.labelType){var h=function getColorThresholds(c){var h=c.map,g=h.psThresholds_.length>1?h.psThresholds_:Array.from({length:h.psClasses_}).map(function(g,m){return h.classifier().invertExtent(m)[c.ascending?0:1]}).slice(1);return g}(c);return c.colorLegend.labelFormatter||function defaultLabeller(g,m){var b=_t(".".concat(c.decimals,"f"));return 0===m?"> ".concat(b(h[h.length-1])):m===h.length?"< ".concat(b(h[0])):"".concat(b(h[h.length-m-1])," - < ").concat(b(h[h.length-m])," ")}}return c.colorLegend.labelType,c.colorLegend.labelFormatter||_t(".".concat(c.decimals,"f"))}function legend_proportional_symbols_highlightPsSymbols(c,h){var g=c.getCentroidsGroup(c).selectAll("[ecl]");g.each(function(c,h){src_select(this).style("opacity","0")}),g.filter("[ecl='"+h+"']").each(function(h,g){src_select(this).style("opacity",c.psFillOpacity_)})}function legend_proportional_symbols_unhighlightPsSymbols(c){c.getCentroidsGroup(c).selectAll("[ecl]").each(function(h,g){src_select(this).style("opacity",c.psFillOpacity_)})}var wl=function legend(c){var h={};function deepMergeExistingKeys(c,h){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},m=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new WeakSet,b=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,w=g.maxDepth||100;if(m.has(c))return c;if(m.add(c),b>w)return console.warn("Max recursion depth (".concat(w,") reached.")),c;for(var S in h)if(h.hasOwnProperty(S)&&c.hasOwnProperty(S)){var M=h[S],k=c[S];"function"==typeof M?c[S]=M:isPlainObject(M)&&isPlainObject(k)?deepMergeExistingKeys(k,M,g,m,b+1):Array.isArray(M)&&Array.isArray(k)?c[S]=g.mergeArrays?toConsumableArray_toConsumableArray(new Set([].concat(toConsumableArray_toConsumableArray(k),toConsumableArray_toConsumableArray(M)))):toConsumableArray_toConsumableArray(M):M instanceof Date?c[S]=new Date(M.getTime()):M instanceof RegExp?c[S]=new RegExp(M):M instanceof Map?c[S]=new Map(M):M instanceof Set?c[S]=new Set(M):c[S]=M}return c}function isPlainObject(c){return"[object Object]"===Object.prototype.toString.call(c)}return h.map=c,h.svgId="em-legend-container-"+Math.round(1e5*Math.random()),h.svg=void 0,h.lgg=void 0,h.x=void 0,h.y=void 0,h.boxPadding=7,h.boxOpacity=.7,h.title="",h.titleFontSize=Pt("em-legend-title"),h.width=150,h.titlePadding=5,h.shapeWidth=25,h.shapeHeight=20,h.shapePadding=5,h.labelFontSize=Pt("em-legend-label"),h.labelOffsets={x:5,y:5},h.labelFormatter=null,defaultLocale({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),h.noData=!0,h.noDataText="No data",h.noDataPadding=5,h.noDataShapeWidth=25,h.noDataShapeHeight=20,h.ascending=!0,h.decimals=0,h.maxMin=!0,h.maxMinLabels=["",""],h.build=function(){h.svg=src_select("#"+h.svgId),h.svg.selectAll("*").remove(),h.lgg=h.svg.attr("class","em-legend")},h.update=function(){return console.log("Legend update function not implemented"),h},h.updateContainer=function(){var c=h.map,g=h.lgg,m=h.svg;if(g.selectAll("*").remove(),c&&g&&(!m||m.attr("id")!==c.legend_.svgId)&&h.build(),(null!=h.x||null!=h.y)&&g){var b,w,S=null!==(b=h.x)&&void 0!==b?b:c.width()-h.width-h.boxPadding,M=null!==(w=h.y)&&void 0!==w?w:h.boxPadding;g.attr("transform","translate(".concat(S,",").concat(M,")"))}},h.updateConfig=function(){var c=h.map;c.legend_&&deepMergeExistingKeys(h,c.legend_)},h.makeBackgroundBox=function(){h.lgg.append("rect").attr("id","em-legend-background").attr("class","em-legend-background").style("opacity",h.boxOpacity)},h.addTitle=function(){if(h.title){var c=h.lgg.append("g").attr("id","em-legend-titles"),g=Pt("em-legend-title");c.append("text").attr("class","em-legend-title").attr("x",h.boxPadding).attr("y",h.boxPadding+g).text(h.title)}},h.addSubtitle=function(){if(h.subtitle){var c=h.lgg.select("#em-legend-titles"),g=Pt("em-legend-title"),m=Pt("em-legend-subtitle");c.append("text").attr("class","em-legend-subtitle").attr("x",h.boxPadding).attr("y",h.boxPadding+g+m+3).html(h.subtitle)}},h.getBaseY=function(){return h.boxPadding+(h.title?Pt("em-legend-title"):0)+(h.subtitle?Pt("em-legend-subtitle"):0)+10},h.getBaseX=function(){return h.boxPadding},h.setBoxDimension=function(){if(h.lgg.node()){var c=h.lgg.node().getBBox({stroke:!0}),g=h.boxPadding;h.svg.select("#em-legend-background").attr("x",c.x-g).attr("y",c.y-g).attr("width",c.width+2*g).attr("height",c.height+2*g)}},h.appendNoDataLegend=function(c,g,m,b){var w=h.map;c.append("rect").attr("class","em-legend-rect").style("fill",w.noDataFillStyle()).attr("y",h.noDataPadding).attr("width",h.noDataShapeWidth).attr("height",h.noDataShapeHeight).on("mouseover",function(){m(w,"nd"),w.insetTemplates_&&Bt(w.insetTemplates_,w.svgId,m,"nd")}).on("mouseout",function(){b(w),w.insetTemplates_&&Bt(w.insetTemplates_,w.svgId,b,"nd")}),c.append("text").attr("class","em-legend-label em-legend-label-no-data").attr("dy","0.35em").attr("x",h.noDataShapeWidth+5).attr("y",h.noDataShapeHeight/2+h.noDataPadding).style("pointer-events","all").style("cursor","pointer").on("mouseover",function(){m(w,"nd"),w.insetTemplates_&&Bt(w.insetTemplates_,w.svgId,m,"nd")}).on("mouseout",function(){b(w),w.insetTemplates_&&Bt(w.insetTemplates_,w.svgId,b,"nd")}).text(g)},h.getNumberOfClasses=function(c){var h=c.map;return"ps"===h._mapType?h.psClasses_:h.numberOfClasses_},h.getLabelFormatter=function(c){return"ps"===c.map._mapType?getPropSymbolColorLabelFormatter(c):getChoroplethLabelFormatter(c)},h.getClassToFillStyle=function(c){var h=c.map;return"ps"===h._mapType?h.psClassToFillStyle_:h.classToFillStyle_},h.getColorClassifier=function(c){var h=c.map;return"ps"===h._mapType?h.classifierColor_:h.classifier_},h.getColorStats=function(c){var h=c.map;return"ps"===h._mapType?h.statData("color"):h.statData()},h.getHighlightFunction=function(c){return"ps"==c._mapType?legend_proportional_symbols_highlightPsSymbols:legend_choropleth_highlightRegions},h.getUnHighlightFunction=function(c){return"ps"==c._mapType?legend_proportional_symbols_unhighlightPsSymbols:legend_choropleth_unhighlightRegions},h},Cl=function tooltip(c){var h,g,tooltip;function my(){tooltip=src_select("#"+c.id),tooltip.empty()&&(tooltip=src_select("body").append("div").attr("id",c.id)),tooltip.attr("class","em-tooltip")}return(c=c||{}).containerId=c.containerId||c.svgId||"map",c.id=c.id||"em-tooltip-".concat(c.containerId),c.offset={x:(null===(h=c.offset)||void 0===h?void 0:h.x)||c.xOffset||30,y:(null===(g=c.offset)||void 0===g?void 0:g.y)||c.yOffset||20},c.transitionDuration=0,c.opacity=c.opacity||1,my.mouseover=function(h){if(tooltip.html(h),h){var g=event.pageX,m=event.pageY;my.ensureTooltipOnScreen(g,m),tooltip.interrupt().transition().duration(c.transitionDuration).style("opacity",c.opacity)}},my.mousemove=function(c){var h=c.pageX,g=c.pageY;this.ensureTooltipOnScreen(h,g)},my.mouseout=function(){tooltip.interrupt().transition().duration(c.transitionDuration).style("opacity",0)},my.style=function(c,h){return 1==arguments.length?tooltip.style(c):(tooltip.style(c,h),my)},my.attr=function(c,h){return 1==arguments.length?tooltip.attr(c):(tooltip.attr(c,h),my)},my.ensureTooltipOnScreen=function(h,g){var m=tooltip.node();m.style.left=h+c.offset.x+"px",m.style.top=g-c.offset.y+"px";var b=document.getElementById(c.containerId).getBoundingClientRect(),w=b.width,S=b.height;if(m.offsetLeft>b.left+w-m.clientWidth){var M=h-m.clientWidth-c.offset.x;if(m.style.left=M+"px",m.offsetLeft+m.clientWidth>h){var k=h-m.clientWidth-c.offset.x;m.style.left=k+"px"}}m.offsetTop+m.clientHeight>b.top+S&&(m.style.top=m.offsetTop-m.clientHeight+"px")},my(),my},Sl="em-loading-overlay";function showSpinner(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Loading…",g=function createOverlay(c){if(!c)return null;var h=c.querySelector("#".concat(Sl));return h||((h=document.createElement("div")).id=Sl,h.classList.add("is-hidden"),h.setAttribute("aria-hidden","true"),h.innerHTML='\n <div class="em-spinner-stack" role="status" aria-live="polite">\n <div class="em-loading-spinner" aria-hidden="true"></div>\n <div class="em-loading-label">Loading…</div>\n </div>\n ',c.appendChild(h),h)}(c);if(g){var m=g.querySelector(".em-loading-label");m&&(m.textContent=h),g.classList.remove("is-hidden"),g.setAttribute("aria-hidden","false")}}var Ml=function statMap(c,h,g){var m=zs(c,h,g);m._geoDone_=!1,m._statDone_=!1,m._finalized_=!1;var b=function tryFinalize(){m._finalized_||m._geoDone_&&m._statDone_&&(m._finalized_=!0,m.callback()&&m.callback()(m))},w=!1;if(m._loadingStatCount_=0,m.stat_={default:void 0},m.stat=function(c,h){return arguments.length?2==arguments.length?(m.stat_[c]=h,m):"string"==typeof c||c instanceof String?m.stat_[c]:(m.stat_=c.default?c:{default:c},m):m.stat_.default},m.statData_={default:Ds(),color:Ds(),size:Ds(),v1:Ds(),v2:Ds(),v3:Ds()},m.statData=function(c,h){return arguments.length?1===arguments.length?(m.statData_[c]||(m.statData_[c]=Ds()),m.statData_[c]):(m.statData_[c]=h,m):m.statData_.default},m.noDataText_="No data available",m.language_="en",m.transitionDuration_=500,m.tooltip_.textFunction=void 0,m.filtersDefinitionFunction_=void 0,m.callback_=void 0,m.legend_=void 0,m.legendObj_=void 0,["legend_","legendObj_","noDataText_","language_","transitionDuration_","tooltipText_","filtersDefinitionFunction_","callback_"].forEach(function(c){m[c.substring(0,c.length-1)]=function(h){return arguments.length?(m[c]=h,m):m[c]}}),c)for(var S in c)m[S]&&null!=c[S]&&m[S](c[S]);m.legend=function(c){if(!arguments.length)return m.legend_;if(0==c){var h=m.legendObj();if(h){var g=src_select("#"+h.svgId);g.size()>0&&g.selectAll("*").remove()}return m.legend_=c,m}return m.legend_=c,m.legendObj_&&m.updateLegend(),m},m.updateLegend=function(c){return m.legendObj_&&m.legendObj().update(),m},m.build=function(){return m._geoDone_=!1,m._statDone_=!1,m._finalized_=!1,w=!1,m.projectionFunction_&&m.proj("4326"),m.buildMapTemplateBase(),m.filtersDefinitionFunction_&&m.filtersDefinitionFunction_(m.svg(),m.numberOfClasses_),m.legend()&&m.buildLegend(),m.tooltip_||m.tooltip_||(m.tooltip_={id:m.svgId()}),m._tooltip=Cl(m.tooltip_),m.updateGeoData(),m.updateStatData(),m},m.updateLoader=function(){if(!m.isInset){if(!m._wrapper_){var c,h,g=null===(c=m.svg)||void 0===c?void 0:c.call(m);if(!g||g.empty())return;m._wrapper_=null!==(h=g.node().parentNode)&&void 0!==h&&null!==(h=h.classList)&&void 0!==h&&h.contains("em-map-wrapper")?g.node().parentNode:null}m._wrapper_&&(m._loadingGeo_||m._loadingStatCount_>0?showSpinner(m._wrapper_,"Loading…"):function hideSpinner(c){if(c){var h=c.querySelector("#".concat(Sl));h&&(h.classList.add("is-hidden"),h.setAttribute("aria-hidden","true"))}}(m._wrapper_))}},m.buildLegend=function(){m.legendObj(m.getLegendConstructor()(m,m.legend()));var c=m.legendObj();if(0==src_select("#"+c.svgId).size()){null==c.x?(m.width(),c.boxPadding):c.x,null==c.y?c.boxPadding:c.y;m.svg().append("g").attr("id",c.svgId).attr("class","em-legend")}c.build()};var M=function isStatDataReady(){for(var c in m.statData_){var h=!!m.stat_[c],g=!(!m.statData_[c]||!m.statData_[c].get());if((h||g)&&!m.statData_[c].isReady())return!1}return!0};function escapeHtml(c){return c.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}return m.updateGeoData=function(){return m._loadingGeo_=!0,m.updateLoader(),m.updateGeoMapTemplate(function(){m._loadingGeo_=!1,m.updateLoader(),m.Geometries.isGeoReady()&&(m._geoDone_=!0,M()&&(m._statDone_=!0,m.updateStatValues()),b())}),m},m.updateStatData=function(){var c=function _loop(){var c,g,S=m.stat(h),k=null===(c=(g=m.statData(h)).get)||void 0===c?void 0:c.call(g);if(!S&&!k)return 1;if(S){var T=Ds(S);m.statData(h,T);var E=!!T.eurostatDatasetCode_||!!T.csvURL_;E&&(m._loadingStatCount_++,m.updateLoader());var I=m.nutsLevel_;"mixed"===I&&(I=0),T.retrieveFromRemote(I,m.language(),function(){E&&(m._loadingStatCount_=Math.max(0,m._loadingStatCount_-1),m.updateLoader()),M()&&(m._statDone_=!0,m.Geometries.isGeoReady()&&(w?b():(w=!0,Promise.resolve().then(function(){w=!1,m.updateStatValues(),b()}))))})}};for(var h in m.stat_)c();return m},m.updateStatValues=function(){return h&&(m.insetTemplates_&&Bt(m.insetTemplates_,m.svgId_,m.refreshCentroids),m.refreshCentroids(m)),m.updateClassification(),m.updateStyle(),m.legend_&&m.legendObj()&&m.legendObj().update(),m},m.updateClassification=function(){return console.log("Map updateClassification function not implemented"),m},m.updateStyle=function(){return console.log("Map updateStyle function not implemented"),m},m.getLegendConstructor=function(){return console.log("Map getLegendConstructor function not implemented"),wl},m.getTime=function(){return m.statData("default").getTime()},m.setFromURL=function(){var c=kl();return c.w&&m.width(c.w),c.h&&m.height(c.h),c.x&&c.y&&m.geoCenter([c.x,c.y]),c.z&&m.pixelSize(c.z),c.s&&m.scale(c.s),c.lvl&&m.nutsLevel(c.lvl),c.time&&(m.filters_.time=c.time,delete m.filters_.lastTimePeriod),c.proj&&m.proj(c.proj),c.geo&&m.geo(c.geo),c.ny&&m.nutsYear(c.ny),c.language&&m.language(c.language),c.numberOfClasses&&m.numberOfClasses(+c.numberOfClasses),m},m.exportMapToSVG=function(){var c=m.svg_.node().cloneNode(!0);c.hasAttribute("xmlns")||c.setAttribute("xmlns","http://www.w3.org/2000/svg"),c.hasAttribute("xmlns:xlink")||c.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),document.body.appendChild(c),applyComputedStylesToSVG(c),ensureSvgSize(c),document.body.removeChild(c);var h=function getDownloadURL(c){var h='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'+c.outerHTML;h=h.replace(/ /g," ").replace(/©/g,"©").replace(/®/g,"®").replace(/×/g,"×").replace(/°/g,"°");var g=new Blob([h],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(g)}(c),g=document.createElement("a");return g.href=h,g.download="eurostatmap.svg",document.body.appendChild(g),g.click(),document.body.removeChild(g),m},m.exportMapToPNG=function(){var c=_asyncToGenerator(It().mark(function _callee(c,h){var g,b,w,S,M,k,T,E,I,P,L,B,z;return It().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:if((g=m.svg_.node().cloneNode(!0)).hasAttribute("xmlns")||g.setAttribute("xmlns","http://www.w3.org/2000/svg"),g.hasAttribute("xmlns:xlink")||g.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),document.body.appendChild(g),!document.fonts||!document.fonts.ready){j.next=4;break}return j.prev=1,j.next=2,document.fonts.ready;case 2:j.next=4;break;case 3:j.prev=3,z=j.catch(1),console.warn("document.fonts.ready failed",z);case 4:return applyComputedStylesToSVG(g),ensureSvgSize(g),g.querySelector("rect[data-export-background]")||(b=g.getAttribute("width")||g.viewBox.baseVal.width||g.getBoundingClientRect().width,w=g.getAttribute("height")||g.viewBox.baseVal.height||g.getBoundingClientRect().height,(S=document.createElementNS("http://www.w3.org/2000/svg","rect")).setAttribute("x",0),S.setAttribute("y",0),S.setAttribute("width",String(b)),S.setAttribute("height",String(w)),S.setAttribute("fill","#ffffff"),S.setAttribute("data-export-background","true"),g.insertBefore(S,g.firstElementChild)),M=new XMLSerializer,k=M.serializeToString(g),document.body.removeChild(g),T=new Blob([k],{type:"image/svg+xml;charset=utf-8"}),E=URL.createObjectURL(T),I=Math.round(c||parseFloat(g.getAttribute("width"))||800),P=Math.round(h||parseFloat(g.getAttribute("height"))||600),(L=new Image).crossOrigin="anonymous",B=function cleanup(c){try{URL.revokeObjectURL(E)}catch(c){}if(c)try{URL.revokeObjectURL(c)}catch(c){}},L.onload=function(){try{var c=document.createElement("canvas");c.width=I,c.height=P;var h=c.getContext("2d");h.fillStyle="#ffffff",h.fillRect(0,0,I,P),h.drawImage(L,0,0,I,P),c.toBlob(function(c){if(!c)return console.error("canvas.toBlob returned null — likely CORS/taint issue."),window.open().document.write("<pre>"+escapeHtml(k)+"</pre>"),void B();var h=URL.createObjectURL(c),g=document.createElement("a");g.href=h,g.download="eurostat-map.png",document.body.appendChild(g),g.click(),document.body.removeChild(g),B(h)},"image/png")}catch(c){console.error("Error drawing SVG to canvas:",c),window.open().document.write("<pre>"+escapeHtml(k)+"</pre>"),B()}},L.onerror=function(c){console.error("Image failed to load for export. Likely CORS or invalid SVG. Error:",c),window.open().document.write("<pre>"+escapeHtml(k)+"</pre>"),B()},L.src=E,j.abrupt("return",m);case 5:case"end":return j.stop()}},_callee,null,[[1,3]])}));return function(h,g){return c.apply(this,arguments)}}(),m},kl=function getURLParameters(){for(var c={},h=["w","h","x","y","z","s","lvl","time","proj","geo","ny","language","sl","numberOfClasses"],g=0;g<h.length;g++)c[h[g]]=getURLParameterByName(h[g]);return c};function numericSort(c){return c.slice().sort(function(c,h){return c-h})}function makeMatrix(c,h){for(var g=[],m=0;m<c;m++){for(var b=[],w=0;w<h;w++)b.push(0);g.push(b)}return g}function ssq(c,h,g,m){var b;if(c>0){var w=(g[h]-g[c-1])/(h-c+1);b=m[h]-m[c-1]-(h-c+1)*w*w}else b=m[h]-g[h]*g[h]/(h+1);return b<0?0:b}function fillMatrixColumn(c,h,g,m,b,w,S){if(!(c>h)){var M=Math.floor((c+h)/2);m[g][M]=m[g-1][M-1],b[g][M]=M;var k=g;c>g&&(k=Math.max(k,b[g][c-1]||0)),k=Math.max(k,b[g-1][M]||0);var T,E,I,P=M-1;h<m[0].length-1&&(P=Math.min(P,b[g][h+1]||0));for(var L=P;L>=k&&!((T=ssq(L,M,w,S))+m[g-1][k-1]>=m[g][M]);--L)(E=ssq(k,M,w,S)+m[g-1][k-1])<m[g][M]&&(m[g][M]=E,b[g][M]=k),k++,(I=T+m[g-1][L-1])<m[g][M]&&(m[g][M]=I,b[g][M]=L);fillMatrixColumn(c,M-1,g,m,b,w,S),fillMatrixColumn(M+1,h,g,m,b,w,S)}}function ckmeans(c,h){if(h>c.length)throw new Error("cannot generate more classes than there are data values");var g=numericSort(c),m=function uniqueCountSorted(c){for(var h,g=0,m=0;m<c.length;m++)0!==m&&c[m]===h||(h=c[m],g++);return g}(g);if(1===m)return[g];var b=makeMatrix(h,g.length),w=makeMatrix(h,g.length);!function fillMatrices(c,h,g){for(var m=h[0].length,b=c[Math.floor(m/2)],w=[],S=[],M=0,k=void 0;M<m;++M)k=c[M]-b,0===M?(w.push(k),S.push(k*k)):(w.push(w[M-1]+k),S.push(S[M-1]+k*k)),h[0][M]=ssq(0,M,w,S),g[0][M]=0;for(var T=1;T<h.length;++T)fillMatrixColumn(T<h.length-1?T:m-1,m-1,T,h,g,w,S)}(g,b,w);for(var S=[],M=w[0].length-1,k=w.length-1;k>=0;k--){var T=w[k][M];S[k]=g.slice(T,M+1),k>0&&(M=T-1)}return S}function jenks(c,h){if(h>c.length)return null;c=c.slice().sort(function(c,h){return c-h});var g=function jenksMatrices(c,h){var g,m,b=[],w=[],S=0;for(g=0;g<c.length+1;g++){var M=[],k=[];for(m=0;m<h+1;m++)M.push(0),k.push(0);b.push(M),w.push(k)}for(g=1;g<h+1;g++)for(b[1][g]=1,w[1][g]=0,m=2;m<c.length+1;m++)w[m][g]=Number.POSITIVE_INFINITY;for(var T=2;T<c.length+1;T++){for(var E=0,I=0,P=0,L=0,B=1;B<T+1;B++){var z=T-B+1,j=c[z-1];if(S=(I+=j*j)-(E+=j)*E/++P,0!=(L=z-1))for(m=2;m<h+1;m++)w[T][m]>=S+w[L][m-1]&&(b[T][m]=z,w[T][m]=S+w[L][m-1])}b[T][1]=1,w[T][1]=S}return{lowerClassLimits:b,varianceCombinations:w}}(c,h);return function jenksBreaks(c,h,g){var m=c.length,b=[],w=g;for(b[g]=c[c.length-1];w>0;)b[w-1]=c[h[m][w]-1],m=h[m][w]-1,w--;return b}(c,g.lowerClassLimits,h)}var Tl=function BayesianClassifier(){this.totalCount=0,this.data={}};Tl.prototype.train=function train(c,h){for(var g in this.data[h]||(this.data[h]={}),c){var m=c[g];void 0===this.data[h][g]&&(this.data[h][g]={}),void 0===this.data[h][g][m]&&(this.data[h][g][m]=0),this.data[h][g][m]++}this.totalCount++},Tl.prototype.score=function score(c){var h,g={};for(var m in c){var b=c[m];for(h in this.data)g[h]={},this.data[h][m]?g[h][m+"_"+b]=(this.data[h][m][b]||0)/this.totalCount:g[h][m+"_"+b]=0}var w={};for(h in g)for(var S in w[h]=0,g[h])w[h]+=g[h][S];return w};var El=function PerceptronModel(){this.weights=[],this.bias=0};El.prototype.predict=function predict(c){if(c.length!==this.weights.length)return null;for(var h=0,g=0;g<this.weights.length;g++)h+=this.weights[g]*c[g];return(h+=this.bias)>0?1:0},El.prototype.train=function train(c,h){if(0!==h&&1!==h)return null;c.length!==this.weights.length&&(this.weights=c,this.bias=1);var g=this.predict(c);if("number"==typeof g&&g!==h){for(var m=h-g,b=0;b<this.weights.length;b++)this.weights[b]+=m*c[b];this.bias+=m}return this};Math.log(Math.sqrt(2*Math.PI));Math.sqrt(2*Math.PI);var Il=Math.sqrt(2*Math.PI);function cumulativeDistribution(c){for(var h=c,g=c,m=1;m<15;m++)h+=g*=c*c/(2*m+1);return Math.round(1e4*(.5+h/Il*Math.exp(-c*c/2)))/1e4}for(var Pl=[],Ll=0;Ll<=3.09;Ll+=.01)Pl.push(cumulativeDistribution(Ll));function applyPatternFill(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(Array.isArray(h)){var g=c.svg().select("defs");g.empty()&&(g=c.svg().append("defs"));var m={};h.forEach(function(h){var b,w=h.pattern,S=void 0===w?"hatching":w,M=h.regionIds,k=void 0===M?[]:M,T=h.color,E=void 0===T?"#000":T,I=h.strokeWidth,P=void 0===I?1:I,L=h.customPattern,B=h.spacing;if(L){var z=L.match(/id=['"]([^'"]+)['"]/);if(!z)return void console.warn("customPattern must include an id attribute.");b=z[1],c.svg().select("#".concat(b)).empty()&&g.node().insertAdjacentHTML("beforeend",L)}else{var j=E.replace("#","").toLowerCase();b="".concat(S,"-").concat(j,"-sw").concat(P),function definePattern(c,h,g,m,b){var w=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8,S=c.svg().select("defs");if(c.svg().select("#".concat(CSS.escape(h))).empty()){var M=S.append("pattern").attr("id",h).attr("patternUnits","userSpaceOnUse").attr("width",w).attr("height",w);"hatching"===g?M.append("path").attr("d","M-".concat(w/8,",").concat(w/8," l").concat(w/4,",-").concat(w/4," M0,").concat(w," l").concat(w,",-").concat(w," M").concat(w-w/8,",").concat(w+w/8," l").concat(w/4,",-").concat(w/4)).attr("stroke",m).attr("stroke-width",b):"crosshatch"===g?M.append("path").attr("d","M0,0 l".concat(w,",").concat(w," M").concat(w,",0 l-").concat(w,",").concat(w)).attr("stroke",m).attr("stroke-width",b):"dots"===g?M.append("circle").attr("cx",w/2).attr("cy",w/2).attr("r",b).attr("fill",m):(console.warn('Unknown pattern "'.concat(g,'", defaulting to hatching.')),M.append("path").attr("d","M-".concat(w/8,",").concat(w/8," l").concat(w/4,",-").concat(w/4," M0,").concat(w," l").concat(w,",-").concat(w," M").concat(w-w/8,",").concat(w+w/8," l").concat(w/4,",-").concat(w/4)).attr("stroke",m).attr("stroke-width",b))}}(c,b,S,E,P,B)}h.patternId=b,k.forEach(function(c){m[c]||(m[c]=[]),m[c].push(b)})}),c.svg().selectAll(zt(c)).each(function(c){var h,g=this,b=null==c||null===(h=c.properties)||void 0===h?void 0:h.id,w=m[b];if(w&&w.length){var S=src_select(this);w.forEach(function(c){var h=S.node().cloneNode(!0);src_select(h).attr("fill","url(#".concat(c,")")).attr("pointer-events","none").attr("class",(S.attr("class")||"")+"pattern-fill-overlay"),src_select(g.parentNode).append(function(){return h})})}})}else console.warn("patternFill expects an array of configs")}var Fl=function map(c){var h=Ml(c,!1,"ch");h.numberOfClasses_=7,h.classificationMethod_="quantile",h.thresholds_=[0],h.colors_=null,h.makeClassifNice_=!0;var g=["#D4DAF0","#C1C9EB","#A8B4E6","#93A2DC","#7C90D6","#677CD2","#5169BE","#3C57B0","#2644A7","#15246B"];h.colorFunction_=function(c){return function piecewise(c,h){void 0===h&&(h=c,c=value);for(var g=0,m=h.length-1,b=h[0],w=new Array(m<0?0:m);g<m;)w[g]=c(b,b=h[++g]);return function(c){var h=Math.max(0,Math.min(m-1,Math.floor(c*=m)));return w[h](c-h)}}(lab_lab,g)(Math.min(Math.max(0,c),1))},h.classToFillStyle_=void 0,h.classifier_=void 0,h.tooltip_.textFunction=zl,h.colorSchemeType_="discrete",h.valueTransform_=function(c){return c},h.valueUntransform_=function(c){return c},h.skipNormalization_=!1,h.pointOfDivergence_=null;var m=["numberOfClasses_","classificationMethod_","thresholds_","makeClassifNice_","colorFunction_","classToFillStyle_","noDataFillStyle_","classifier_","colors_","colorFunction_","colorSchemeType_","valueTransform_","valueUntransform_","pointOfDivergence_","skipNormalization_"];function applyClassificationToMap(c){var g=function generateRange(c){return toConsumableArray_toConsumableArray(Array(c).keys())},m=h.statData().getArray();if(m){var b=function classifyRegions(c){c.attr("ecl",function(c){var g=h.statData().get(c.properties.id);if(g){var m=g.value;return":"===m||null===m?"nd":"continuous"===h.colorSchemeType_?m:null!=m?+h.classifier_(m):void 0}})};if(function setupClassifier(){var c=g(h.numberOfClasses_);if("continuous"===h.colorSchemeType_){var b=h.valueTransform_||function(c){return c};if(h.skipNormalization_)h.domain_=null;else{var w,S=m.map(b),M=min_min(S),k=max_max(S),T=function checkIfDiverging(c){return null!==c.pointOfDivergence_}(h);if(!("function"==typeof(null===(w=h.colorFunction_)||void 0===w?void 0:w.domain)))if(T){var E,I=b(null!==(E=h.pointOfDivergence_)&&void 0!==E?E:0);h.domain_=[M,I,k]}else h.domain_=[M,k]}h.classifier(function(c){return c})}var P=toConsumableArray_toConsumableArray(m).filter(function(c){return!isNaN(parseFloat(c))&&isFinite(c)});switch(h.classificationMethod_){case"quantile":h.classifier(quantile_quantile().domain(m).range(c));break;case"equal-interval":case"equinter":h.classifier(quantize().domain([min_min(m),max_max(m)]).range(c)),h.makeClassifNice_&&h.classifier().nice();break;case"threshold":h.numberOfClasses(h.thresholds_.length+1),h.classifier(threshold().domain(h.thresholds_).range(g(h.numberOfClasses_)));break;case"jenks":var L=jenks(P,h.numberOfClasses_).slice(1,-1);h.classifier(threshold().domain(L).range(c));break;case"ckmeans":var B=ckmeans(P,h.numberOfClasses_).map(function(c){return c.pop()}).slice(0,-1);h.classifier(threshold().domain(B).range(c))}}(),c.svg_){var w=zt(c);if(b(c.svg().selectAll(w)),"mixed"===c.nutsLevel_)b(c.svg().selectAll("path.em-nutsrg0"))}}}function applyStyleToMap(c){if(h.filtersDefinitionFunction_?h.classToFillStyle(Ol()):h.classToFillStyle(Bl(h.colorFunction_,h.colors_)),c.svg_){var g=zt(c),m=c.svg().selectAll(g);m.style("pointer-events","none").transition().duration(h.transitionDuration()).style("fill",w).end().then(function(){m.style("pointer-events",null),m.each(function(){var c=src_select(this);c.attr("fill___",c.style("fill"))}),S(c,m),h.gridCartogram_&&c.svg().selectAll(".em-grid-text").each(function(){var c=src_select(this.parentNode).style("fill");src_select(this).attr("fill",Ot(c))})}).catch(function(c){}),"mixed"===h.nutsLevel_&&b(c),h.labels_&&h.labels_.values&&h.updateValuesLabels(c),h.patternFill_&&applyPatternFill(c,h.patternFill_)}}m.forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&m.forEach(function(g){var m=g.slice(0,-1);null!=c[m]&&h[m](c[m])}),h.colorFunction=function(c){if(!arguments.length)return h.colorFunction_;if(h.colorFunction_=c,h.filtersDefinitionFunction_)h.classToFillStyle(Ol());else{var g=Bl(h.colorFunction_,h.colors_,h.colorSchemeType_);h.classToFillStyle(g)}return h},h.threshold=function(c){return arguments.length?(h.thresholds_=c,h.numberOfClasses(c.length+1),h):h.thresholds_},h.filtersDefinitionFunction=function(c){return arguments.length?(h.filtersDefinitionFunction_=c,h.svg()&&h.filtersDefinitionFunction_(h.svg(),h.numberOfClasses_),h):h.filtersDefinitionFunction_},h.updateClassification=function(){try{return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyClassificationToMap),applyClassificationToMap(h),h}catch(c){console.error("Error in updateClassification:",c.message),console.error(c)}},h.updateStyle=function(){try{return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyStyleToMap),applyStyleToMap(h),h}catch(c){console.error("Error in updateStyle:",c.message),console.error(c)}},h.getLegendConstructor=function(){return qs};var b=function styleMixedNUTS(c){c.svg().selectAll(zt(c)).each(function(){if(!this.parentNode.classList.contains("em-cntrg")){var c=src_select(this),h=c.attr("ecl"),g=c.attr("lvl"),m=h||"0"===g;if(c.style("display",m?"block":"none"),h&&"0"!==g){var b=c.style("stroke")||"#777",w=c.style("stroke-width")||.2;c.style("stroke",b).style("stroke-width",w)}}})};var w=function regionsFillFunction(c){var g,m=src_select(this).attr("ecl"),b=h.colorSchemeType_||"discrete";if(m||"0"===m)return"nd"===m?h.noDataFillStyle_||"gray":h.filtersDefinitionFunction_?h.classToFillStyle_(m):"continuous"===b?function getContinuousColor(c,h){var g=h.colorFunction_,m=h.valueTransform_||function(c){return c},b=m(c);if(isNaN(b))return h.noDataFillStyle_||"gray";if(h.skipNormalization_)return g(Math.min(Math.max(b,0),1));var w,S=h.domain_||[0,1];if("function"==typeof(null==g?void 0:g.domain))return g(b);if(3===S.length){var M,k=slicedToArray_slicedToArray(S,3),T=k[0],E=k[2],I=m(null!==(M=h.pointOfDivergence_)&&void 0!==M?M:0);w=b<I?.5*(b-T)/(I-T):.5+.5*(b-I)/(E-I)}else{var P=slicedToArray_slicedToArray(S,2),L=P[0];w=(b-L)/(P[1]-L)}return g(Math.min(Math.max(w,0),1))}(+m,h):null!==(g=h.Geometries)&&void 0!==g&&g.userGeometries?h.classToFillStyle_(m,h.numberOfClasses_||1):"WORLD"===h.geo_?h.classToFillStyle_(m,h.numberOfClasses_||1)||h.cntrgFillStyle_:h.classToFillStyle_(m,h.numberOfClasses_||1)},S=function addMouseEventsToRegions(c,g){var m=function shouldOmit(h){var g;return null===(g=c.tooltip_.omitRegions)||void 0===g?void 0:g.includes(h)};g.on("mouseover",function(g,b){m(b.properties.id)||(src_select(this).style("fill",c.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(b,h)),h.onRegionMouseOver_&&h.onRegionMouseOver_(g,b,this,c))}).on("mousemove",function(g,b){m(b.properties.id)||(h._tooltip&&h._tooltip.mousemove(g),h.onRegionMouseMove_&&h.onRegionMouseMove_(g,b,this,c))}).on("mouseout",function(g,b){if(!m(b.properties.id)){var w=src_select(this);w.style("fill",w.attr("fill___")),h._tooltip&&h._tooltip.mouseout(),h.onRegionMouseOut_&&h.onRegionMouseOut_(g,b,this,c)}})};return h.highlightRegion=function(c){if(!h.svg_)return h;var g=zt(h),m=h.svg().selectAll(g).filter(function(h){return h.properties.id===c});if(!m.empty()){var b=m.datum();if(m.style("fill",h.hoverColor_||"orange"),h._tooltip){var w=h.tooltip_.textFunction(b,h);h._tooltip.mouseover(w);var S=m.node().getBBox(),M=h.__lastTransform||{x:0,y:0,k:1},k=(S.x+S.width/2)*M.k+M.x,T=(S.y+S.height/2)*M.k+M.y,E=h.svg().node().getBoundingClientRect(),I=E.left+k,P=E.top+T;h._tooltip.ensureTooltipOnScreen(I,P)}h.onRegionMouseOver_&&h.onRegionMouseOver_(null,b,m.node(),h)}return h},h.clearHighlight=function(){if(!h.svg_)return h;var c=zt(h);return h.svg().selectAll(c).each(function(){var c=src_select(this),h=c.attr("fill___");h&&c.style("fill",h)}),h._tooltip&&h._tooltip.mouseout(),h},h},Bl=function getColorFunction(c,h){return c=c||At,"continuous"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"discrete")?function(h){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,1],m=(h-g[0])/(g[1]-g[0]);return c(Math.min(Math.max(m,0),1))}:h?function(c,g){return h[c]}:function(h,g){return c(h/(g-1))}},Ol=function getFillPatternLegend(){return function(c){return"url(#pattern_"+c+")"}},zl=function choroplethTooltipFunction(c,h){if(h.tooltip_.omitRegions&&h.tooltip_.omitRegions.includes(c.properties.id))return"";var g=[],m=c.properties.na||c.properties.name,b=c.properties.id;g.push('\n <div class="em-tooltip-bar">\n <b>'.concat(m,"</b>").concat(b?" (".concat(b,")"):"","\n </div>\n "));var w=h.statData(),S=w.get(b),M=w.unitText()||"";if(!S||0!==S.value&&!S.value||":"===S.value)return g.push('\n <div class="em-tooltip-text no-data">\n <table class="em-tooltip-table">\n <tbody>\n <tr><td>'.concat(h.noDataText_,"</td></tr>\n </tbody>\n </table>\n </div>\n ")),g.join("");g.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr><td>'.concat(Ft(S.value)," ").concat(M,"</td></tr>\n </tbody>\n </table>\n </div>\n "));var k=S.status;if(k&&h.tooltip_.showFlags){var T="short"===h.tooltip_.showFlags?k:flags[k]||k;g.push(' <span class="status-flag">'.concat(T,"</span>"))}return g.join("")};const jl=ramp(new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(colors)),Dl=4294967296;function x(c){return c.x}function y(c){return c.y}var Nl=Math.PI*(3-Math.sqrt(5));function simulation(c){var h,g=1,m=.001,b=1-Math.pow(m,1/300),w=0,S=.6,M=new Map,k=timer(step),T=Ki("tick","end"),E=function lcg(){let c=1;return()=>(c=(1664525*c+1013904223)%Dl)/Dl}();function step(){tick(),T.call("tick",h),g<m&&(k.stop(),T.call("end",h))}function tick(m){var k,T,E=c.length;void 0===m&&(m=1);for(var I=0;I<m;++I)for(g+=(w-g)*b,M.forEach(function(c){c(g)}),k=0;k<E;++k)null==(T=c[k]).fx?T.x+=T.vx*=S:(T.x=T.fx,T.vx=0),null==T.fy?T.y+=T.vy*=S:(T.y=T.fy,T.vy=0);return h}function initializeNodes(){for(var h,g=0,m=c.length;g<m;++g){if((h=c[g]).index=g,null!=h.fx&&(h.x=h.fx),null!=h.fy&&(h.y=h.fy),isNaN(h.x)||isNaN(h.y)){var b=10*Math.sqrt(.5+g),w=g*Nl;h.x=b*Math.cos(w),h.y=b*Math.sin(w)}(isNaN(h.vx)||isNaN(h.vy))&&(h.vx=h.vy=0)}}function initializeForce(h){return h.initialize&&h.initialize(c,E),h}return null==c&&(c=[]),initializeNodes(),h={tick,restart:function(){return k.restart(step),h},stop:function(){return k.stop(),h},nodes:function(g){return arguments.length?(c=g,initializeNodes(),M.forEach(initializeForce),h):c},alpha:function(c){return arguments.length?(g=+c,h):g},alphaMin:function(c){return arguments.length?(m=+c,h):m},alphaDecay:function(c){return arguments.length?(b=+c,h):+b},alphaTarget:function(c){return arguments.length?(w=+c,h):w},velocityDecay:function(c){return arguments.length?(S=1-c,h):1-S},randomSource:function(c){return arguments.length?(E=c,M.forEach(initializeForce),h):E},force:function(c,g){return arguments.length>1?(null==g?M.delete(c):M.set(c,initializeForce(g)),h):M.get(c)},find:function(h,g,m){var b,w,S,M,k,T=0,E=c.length;for(null==m?m=1/0:m*=m,T=0;T<E;++T)(S=(b=h-(M=c[T]).x)*b+(w=g-M.y)*w)<m&&(k=M,m=S);return k},on:function(c,g){return arguments.length>1?(T.on(c,g),h):T.on(c)}}}function d3_force_src_constant(c){return function(){return c}}function src_x(c){var h,g,m,b=d3_force_src_constant(.1);function force(c){for(var b,w=0,S=h.length;w<S;++w)(b=h[w]).vx+=(m[w]-b.x)*g[w]*c}function initialize(){if(h){var w,S=h.length;for(g=new Array(S),m=new Array(S),w=0;w<S;++w)g[w]=isNaN(m[w]=+c(h[w],w,h))?0:+b(h[w],w,h)}}return"function"!=typeof c&&(c=d3_force_src_constant(null==c?0:+c)),force.initialize=function(c){h=c,initialize()},force.strength=function(c){return arguments.length?(b="function"==typeof c?c:d3_force_src_constant(+c),initialize(),force):b},force.x=function(h){return arguments.length?(c="function"==typeof h?h:d3_force_src_constant(+h),initialize(),force):c},force}function src_y(c){var h,g,m,b=d3_force_src_constant(.1);function force(c){for(var b,w=0,S=h.length;w<S;++w)(b=h[w]).vy+=(m[w]-b.y)*g[w]*c}function initialize(){if(h){var w,S=h.length;for(g=new Array(S),m=new Array(S),w=0;w<S;++w)g[w]=isNaN(m[w]=+c(h[w],w,h))?0:+b(h[w],w,h)}}return"function"!=typeof c&&(c=d3_force_src_constant(null==c?0:+c)),force.initialize=function(c){h=c,initialize()},force.strength=function(c){return arguments.length?(b="function"==typeof c?c:d3_force_src_constant(+c),initialize(),force):b},force.y=function(h){return arguments.length?(c="function"==typeof h?h:d3_force_src_constant(+h),initialize(),force):c},force}function add_add(c,h,g,m){if(isNaN(h)||isNaN(g))return c;var b,w,S,M,k,T,E,I,P,L=c._root,B={data:m},z=c._x0,j=c._y0,D=c._x1,N=c._y1;if(!L)return c._root=B,c;for(;L.length;)if((T=h>=(w=(z+D)/2))?z=w:D=w,(E=g>=(S=(j+N)/2))?j=S:N=S,b=L,!(L=L[I=E<<1|T]))return b[I]=B,c;if(M=+c._x.call(null,L.data),k=+c._y.call(null,L.data),h===M&&g===k)return B.next=L,b?b[I]=B:c._root=B,c;do{b=b?b[I]=new Array(4):c._root=new Array(4),(T=h>=(w=(z+D)/2))?z=w:D=w,(E=g>=(S=(j+N)/2))?j=S:N=S}while((I=E<<1|T)==(P=(k>=S)<<1|M>=w));return b[P]=L,b[I]=B,c}function quad(c,h,g,m,b){this.node=c,this.x0=h,this.y0=g,this.x1=m,this.y1=b}function defaultX(c){return c[0]}function defaultY(c){return c[1]}function quadtree(c,h,g){var m=new Quadtree(null==h?defaultX:h,null==g?defaultY:g,NaN,NaN,NaN,NaN);return null==c?m:m.addAll(c)}function Quadtree(c,h,g,m,b,w){this._x=c,this._y=h,this._x0=g,this._y0=m,this._x1=b,this._y1=w,this._root=void 0}function leaf_copy(c){for(var h={data:c.data},g=h;c=c.next;)g=g.next={data:c.data};return h}var Rl=quadtree.prototype=Quadtree.prototype;function jiggle(c){return 1e-6*(c()-.5)}function collide_x(c){return c.x+c.vx}function collide_y(c){return c.y+c.vy}function collide(c){var h,g,m,b=1,w=1;function force(){for(var c,S,M,k,T,E,I,P=h.length,L=0;L<w;++L)for(S=quadtree(h,collide_x,collide_y).visitAfter(prepare),c=0;c<P;++c)M=h[c],E=g[M.index],I=E*E,k=M.x+M.vx,T=M.y+M.vy,S.visit(apply);function apply(c,h,g,w,S){var P=c.data,L=c.r,B=E+L;if(!P)return h>k+B||w<k-B||g>T+B||S<T-B;if(P.index>M.index){var z=k-P.x-P.vx,j=T-P.y-P.vy,D=z*z+j*j;D<B*B&&(0===z&&(D+=(z=jiggle(m))*z),0===j&&(D+=(j=jiggle(m))*j),D=(B-(D=Math.sqrt(D)))/D*b,M.vx+=(z*=D)*(B=(L*=L)/(I+L)),M.vy+=(j*=D)*B,P.vx-=z*(B=1-B),P.vy-=j*B)}}}function prepare(c){if(c.data)return c.r=g[c.data.index];for(var h=c.r=0;h<4;++h)c[h]&&c[h].r>c.r&&(c.r=c[h].r)}function initialize(){if(h){var m,b,w=h.length;for(g=new Array(w),m=0;m<w;++m)b=h[m],g[b.index]=+c(b,m,h)}}return"function"!=typeof c&&(c=d3_force_src_constant(null==c?1:+c)),force.initialize=function(c,g){h=c,m=g,initialize()},force.iterations=function(c){return arguments.length?(w=+c,force):w},force.strength=function(c){return arguments.length?(b=+c,force):b},force.radius=function(h){return arguments.length?(c="function"==typeof h?h:d3_force_src_constant(+h),initialize(),force):c},force}function dorling_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function dorling_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function dorling_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return dorling_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?dorling_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function dorling_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function runDorlingSimulation(c,h){var g=function runSim(g){var m,b,w,S,M,k=g.Geometries.centroidsFeatures||[];if(k.length){stopDorlingSimulation(g);var T,E=null!==(m=null===(b=g.dorlingStrength_)||void 0===b?void 0:b.x)&&void 0!==m?m:1,I=null!==(w=null===(S=g.dorlingStrength_)||void 0===S?void 0:S.y)&&void 0!==w?w:1,P=null!==(M=g.dorlingIterations_)&&void 0!==M?M:1,L=!1!==g.dorlingWorker_,B=g.dorlingWorkerD3URL_||"https://unpkg.com/d3@7/dist/d3.min.js",z=dorling_createForOfIteratorHelper(k);try{for(z.s();!(T=z.n()).done;){var j,D=T.value,N=null===(j=g._projection)||void 0===j?void 0:j.call(g,D.geometry.coordinates);N?(D.x=N[0],D.y=N[1]):(D.x=NaN,D.y=NaN)}}catch(c){z.e(c)}finally{z.f()}var R=c.getCentroidsGroup(g).selectAll("g.em-centroid"),G=function tickTransform(c){c.attr("transform",function(c){return!c||isNaN(c.x)||isNaN(c.y)?null:"translate(".concat(c.x,",").concat(c.y,")")})};if(!1===g.animateDorling_){if(L){console.log("Running Dorling simulation asynchronously in a Web Worker");var q=new Worker(new URL(__webpack_require__.p+__webpack_require__.u(215),__webpack_require__.b),{type:void 0});return q.postMessage({nodes:k.map(function(c){return function dorling_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?dorling_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):dorling_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}({},c)}),radii:k.map(function(c){return h(c)}),strengthX:E,strengthY:I,iterations:P,d3URL:B}),void(q.onmessage=function(c){var h=c.data,m=h.type,b=h.nodes,w=h.progress,S=h.total;"progress"!==m?"end"===m&&b&&(k.forEach(function(c,h){c.x=b[h].x,c.y=b[h].y}),G(R),updateDorlingProgress(1,g),q.terminate()):updateDorlingProgress(w/S,g)})}for(var W=simulation(k).force("x",src_x(function(c){return c.properties.centroid[0]}).strength(E)).force("y",src_y(function(c){return c.properties.centroid[1]}).strength(I)).force("collide",collide(function(c){return h(c)}).iterations(P)).stop(),H=Math.ceil(Math.log(W.alphaMin())/Math.log(1-W.alphaDecay())),U=0;U<H;U++)W.tick(),U%10==0&&G(R);return G(R),updateDorlingProgress(1,g),W}return g.simulation=simulation(k).force("x",src_x(function(c){return c.properties.centroid[0]}).strength(E)).force("y",src_y(function(c){return c.properties.centroid[1]}).strength(I)).force("collide",collide(function(c){return h(c)}).iterations(P)).on("tick",function(){return G(R)}),g.simulation}};g(c),c.insetTemplates_&&Bt(c.insetTemplates_,c.svgId_,function(c){g(c)})}function updateDorlingProgress(c,h){h.onDorlingProgress_&&h.onDorlingProgress_(c,h)}function stopDorlingSimulation(c){c.simulation&&(c.simulation.stop(),c.simulation.on("tick",null),c.simulation=null)}function transformPow(c){return function(h){return h<0?-Math.pow(-h,c):Math.pow(h,c)}}function transformSqrt(c){return c<0?-Math.sqrt(-c):Math.sqrt(c)}function transformSquare(c){return c<0?-c*c:c*c}function powish(c){var h=c(continuous_identity,continuous_identity),g=1;return h.exponent=function(h){return arguments.length?(g=+h,function rescale(){return 1===g?c(continuous_identity,continuous_identity):.5===g?c(transformSqrt,transformSquare):c(transformPow(g),transformPow(1/g))}()):g},linearish(h)}function pow_pow(){var c=powish(transformer());return c.copy=function(){return copy(c,pow_pow()).exponent(c.exponent())},initRange.apply(c,arguments),c}function pow_sqrt(){return pow_pow.apply(null,arguments).exponent(.5)}function createSqrtScale(){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,g=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(Number).filter(function(c){return Number.isFinite(c)&&c>0}),m=max_max(g),b=min_min(g);(!Number.isFinite(m)||m<=0)&&(m=1),(!Number.isFinite(b)||b<=0)&&(b=m);var w=Math.max(0,h),S=pow_sqrt().domain([0,m]).range([0,c]).clamp(!0);function scale(c){var h=+c;return!Number.isFinite(h)||h<=0?0:Math.max(w,S(h))}return scale.domain=function(){return[b,m]},scale.maxSize=function(){return c},scale.minSize=function(){return w},scale.baseScale=function(){return S},scale}function defineClassifiers(c){!function defineSizeClassifier(c){var h,g,m,b,w=null!==(h=null!==(g=null===(m=c.statData("size"))||void 0===m?void 0:m.getArray())&&void 0!==g?g:null===(b=c.statData())||void 0===b?void 0:b.getArray())&&void 0!==h?h:[],S="spike"===c.psShape_||"bar"===c.psShape_||"line"===c.psShape_,M=S?function createLinearScale(){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,g=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(Number).filter(function(c){return Number.isFinite(c)&&c>0}),m=max_max(g),b=min_min(g);(!Number.isFinite(m)||m<=0)&&(m=1),(!Number.isFinite(b)||b<=0)&&(b=m);var w=Math.max(0,h),S=linear_linear().domain([0,m]).range([0,c]).clamp(!0);function scale(c){var h=+c;return!Number.isFinite(h)||h<=0?0:Math.max(w,S(h))}return scale.domain=function(){return[b,m]},scale.maxSize=function(){return c},scale.minSize=function(){return w},scale.baseScale=function(){return S},scale}(w,c.psMaxSize_,c.psMinSize_||0):createSqrtScale(w,c.psMaxSize_,c.psMinSize_||0);c.classifierSize(M)}(c),c.statData("color").getArray()&&function defineColorClassifier(c){var h=function getA(c){return toConsumableArray_toConsumableArray(Array(c).keys())};if("quantile"===c.psClassificationMethod_){var g=c.statData("color").getArray(),m=h(c.psClasses_);c.classifierColor(quantile_quantile().domain(g).range(m))}else if("equinter"===c.psClassificationMethod_){var b=c.statData("color").getArray(),w=h(c.psClasses_);c.classifierColor(quantize().domain([min(b),max(b)]).range(w)),c.makeClassifNice_&&c.classifierColor().nice()}else if("threshold"===c.psClassificationMethod_){c.psClasses(c.psThresholds().length+1);var S=h(c.psClasses_);c.classifierColor(threshold().domain(c.psThresholds()).range(S))}}(c)}function applyClassificationToMap(c,h){if(null!=c&&c.svg_){var g=c.classifierColor_||(null==h?void 0:h.classifierColor_);if("function"==typeof g){var m=c.statData("color");m&&c.svg_.selectAll(".em-centroid").attr("ecl",function(c){var h=m.get(c.properties.id);if(!h)return"nd";var b=h.value;return 0!==b&&!b||":"===b?"nd":+g(+b)})}}}function updateBackgroundColor(c,h){var g=color_color(h||"#ffffff"),m=g?g.formatHex():"#ffffff",b=c.svgId_||"",w=function getBackgroundColor(c,h){return function brightenHex(c,h){var g=h;c=c.replace(/^#/,""),3===c.length&&(c=c.split("").map(function(c){return c+c}).join(""));var m=parseInt(c,16),b=m>>16&255,w=m>>8&255,S=255&m;return b=Math.min(255,Math.round(b+(255-b)*g)),w=Math.min(255,Math.round(w+(255-w)*g)),S=Math.min(255,Math.round(S+(255-S)*g)),"#".concat((1<<24|b<<16|w<<8|S).toString(16).slice(1))}(c,h)}(m,c.psBrightenFactor_||.9);updateCSSRule("#".concat(b,".em--ps .em-nutsrg"),"fill",w)}function ps_interactions_addMouseEvents(c,h){!function clearMouseEvents(c){c.svg().selectAll("g.em-centroid").on("mouseover",null).on("mousemove",null).on("mouseout",null),c.svg().selectAll(zt(c)).on("mouseover",null).on("mousemove",null).on("mouseout",null)}(c),ql(c,h),Gl(c,h)}Rl.copy=function(){var c,h,g=new Quadtree(this._x,this._y,this._x0,this._y0,this._x1,this._y1),m=this._root;if(!m)return g;if(!m.length)return g._root=leaf_copy(m),g;for(c=[{source:m,target:g._root=new Array(4)}];m=c.pop();)for(var b=0;b<4;++b)(h=m.source[b])&&(h.length?c.push({source:h,target:m.target[b]=new Array(4)}):m.target[b]=leaf_copy(h));return g},Rl.add=function src_add(c){const h=+this._x.call(null,c),g=+this._y.call(null,c);return add_add(this.cover(h,g),h,g,c)},Rl.addAll=function addAll(c){var h,g,m,b,w=c.length,S=new Array(w),M=new Array(w),k=1/0,T=1/0,E=-1/0,I=-1/0;for(g=0;g<w;++g)isNaN(m=+this._x.call(null,h=c[g]))||isNaN(b=+this._y.call(null,h))||(S[g]=m,M[g]=b,m<k&&(k=m),m>E&&(E=m),b<T&&(T=b),b>I&&(I=b));if(k>E||T>I)return this;for(this.cover(k,T).cover(E,I),g=0;g<w;++g)add_add(this,S[g],M[g],c[g]);return this},Rl.cover=function cover(c,h){if(isNaN(c=+c)||isNaN(h=+h))return this;var g=this._x0,m=this._y0,b=this._x1,w=this._y1;if(isNaN(g))b=(g=Math.floor(c))+1,w=(m=Math.floor(h))+1;else{for(var S,M,k=b-g||1,T=this._root;g>c||c>=b||m>h||h>=w;)switch(M=(h<m)<<1|c<g,(S=new Array(4))[M]=T,T=S,k*=2,M){case 0:b=g+k,w=m+k;break;case 1:g=b-k,w=m+k;break;case 2:b=g+k,m=w-k;break;case 3:g=b-k,m=w-k}this._root&&this._root.length&&(this._root=T)}return this._x0=g,this._y0=m,this._x1=b,this._y1=w,this},Rl.data=function src_data(){var c=[];return this.visit(function(h){if(!h.length)do{c.push(h.data)}while(h=h.next)}),c},Rl.extent=function src_extent(c){return arguments.length?this.cover(+c[0][0],+c[0][1]).cover(+c[1][0],+c[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},Rl.find=function src_find(c,h,g){var m,b,w,S,M,k,T,E=this._x0,I=this._y0,P=this._x1,L=this._y1,B=[],z=this._root;for(z&&B.push(new quad(z,E,I,P,L)),null==g?g=1/0:(E=c-g,I=h-g,P=c+g,L=h+g,g*=g);k=B.pop();)if(!(!(z=k.node)||(b=k.x0)>P||(w=k.y0)>L||(S=k.x1)<E||(M=k.y1)<I))if(z.length){var j=(b+S)/2,D=(w+M)/2;B.push(new quad(z[3],j,D,S,M),new quad(z[2],b,D,j,M),new quad(z[1],j,w,S,D),new quad(z[0],b,w,j,D)),(T=(h>=D)<<1|c>=j)&&(k=B[B.length-1],B[B.length-1]=B[B.length-1-T],B[B.length-1-T]=k)}else{var N=c-+this._x.call(null,z.data),R=h-+this._y.call(null,z.data),G=N*N+R*R;if(G<g){var q=Math.sqrt(g=G);E=c-q,I=h-q,P=c+q,L=h+q,m=z.data}}return m},Rl.remove=function src_remove(c){if(isNaN(w=+this._x.call(null,c))||isNaN(S=+this._y.call(null,c)))return this;var h,g,m,b,w,S,M,k,T,E,I,P,L=this._root,B=this._x0,z=this._y0,j=this._x1,D=this._y1;if(!L)return this;if(L.length)for(;;){if((T=w>=(M=(B+j)/2))?B=M:j=M,(E=S>=(k=(z+D)/2))?z=k:D=k,h=L,!(L=L[I=E<<1|T]))return this;if(!L.length)break;(h[I+1&3]||h[I+2&3]||h[I+3&3])&&(g=h,P=I)}for(;L.data!==c;)if(m=L,!(L=L.next))return this;return(b=L.next)&&delete L.next,m?(b?m.next=b:delete m.next,this):h?(b?h[I]=b:delete h[I],(L=h[0]||h[1]||h[2]||h[3])&&L===(h[3]||h[2]||h[1]||h[0])&&!L.length&&(g?g[P]=L:this._root=L),this):(this._root=b,this)},Rl.removeAll=function removeAll(c){for(var h=0,g=c.length;h<g;++h)this.remove(c[h]);return this},Rl.root=function src_root(){return this._root},Rl.size=function src_size(){var c=0;return this.visit(function(h){if(!h.length)do{++c}while(h=h.next)}),c},Rl.visit=function visit(c){var h,g,m,b,w,S,M=[],k=this._root;for(k&&M.push(new quad(k,this._x0,this._y0,this._x1,this._y1));h=M.pop();)if(!c(k=h.node,m=h.x0,b=h.y0,w=h.x1,S=h.y1)&&k.length){var T=(m+w)/2,E=(b+S)/2;(g=k[3])&&M.push(new quad(g,T,E,w,S)),(g=k[2])&&M.push(new quad(g,m,E,T,S)),(g=k[1])&&M.push(new quad(g,T,b,w,E)),(g=k[0])&&M.push(new quad(g,m,b,T,E))}return this},Rl.visitAfter=function visitAfter(c){var h,g=[],m=[];for(this._root&&g.push(new quad(this._root,this._x0,this._y0,this._x1,this._y1));h=g.pop();){var b=h.node;if(b.length){var w,S=h.x0,M=h.y0,k=h.x1,T=h.y1,E=(S+k)/2,I=(M+T)/2;(w=b[0])&&g.push(new quad(w,S,M,E,I)),(w=b[1])&&g.push(new quad(w,E,M,k,I)),(w=b[2])&&g.push(new quad(w,S,I,E,T)),(w=b[3])&&g.push(new quad(w,E,I,k,T))}m.push(h)}for(;h=m.pop();)c(h.node,h.x0,h.y0,h.x1,h.y1);return this},Rl.x=function d3_quadtree_src_x(c){return arguments.length?(this._x=c,this):this._x},Rl.y=function d3_quadtree_src_y(c){return arguments.length?(this._y=c,this):this._y};var Gl=function addMouseEventsToRegions(c,h){var g=c.svg().selectAll(zt(c)),m=getSizeStatData(c);g.on("mouseover",function(g,b){var w=m.get(b.properties.id);w&&void 0!==w.value&&null!==w.value&&(src_select(this).style("fill",c.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(b,h)),h.onRegionMouseOver_&&h.onRegionMouseOver_(g,b,this,c))}).on("mousemove",function(g,b){var w=m.get(b.properties.id);w&&void 0!==w.value&&null!==w.value&&(h._tooltip&&h._tooltip.mousemove(g),h.onRegionMouseMove_&&h.onRegionMouseMove_(g,b,this,c))}).on("mouseout",function(g,b){var w=m.get(b.properties.id);if(w&&void 0!==w.value&&null!==w.value){var S=src_select(this);S.style("fill",S.attr("fill___")),h._tooltip&&h._tooltip.mouseout(),h.onRegionMouseOut_&&h.onRegionMouseOut_(g,b,this,c)}})},ql=function addMouseEventsToSymbols(c,h){c.svg().selectAll("g.em-centroid").on("mouseover",function(g,m){var b=src_select(this.childNodes[0]);b.attr("fill___",b.style("fill")),b.style("fill",h.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(m,h)),h.onRegionMouseOver_&&h.onRegionMouseOver_(g,m,this,c)}).on("mousemove",function(g,m){h._tooltip&&h._tooltip.mousemove(g),h.onRegionMouseMove_&&h.onRegionMouseMove_(g,m,this,c)}).on("mouseout",function(g,m){var b=src_select(this.childNodes[0]),w=b.attr("fill___");w&&(b.style("fill",w),h._tooltip&&h._tooltip.mouseout()),h.onRegionMouseOut_&&h.onRegionMouseOut_(g,m,this,c)})};function appendSpikesToMap(c,h,g){var m=c.svg().selectAll("g.em-centroid").append("path").attr("d",function(c){var m=h.get(c.properties.id),b=function spike(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.psSpikeWidth_;return"M".concat(-h/2,",0L0,").concat(-c,"L").concat(h/2,",0")}(m?g.classifierSize_(+m.value):0);return b}).style("fill",function(c){return c.color||"steelblue"}).attr("fill-opacity",c.psFillOpacity_).attr("stroke",c.psStroke_).attr("stroke-width",c.psStrokeWidth_);return m}var Wl=function map(c){var h=Ml(c,!0,"ps");h.psShape_="circle",h.psCustomShape_,h.psCustomSVG_,h.psSpikeWidth_=7,h.psOffset_={x:0,y:0},h.psMaxSize_=30,h.psMinSize_=5,h.psBarWidth_=10,h.psMaxValue_=void 0,h.psMinValue_=void 0,h.psSizeScale_=void 0,h.psFill_="#009569",h.psFillOpacity_=1,h.psStroke_="#ffffff",h.psStrokeWidth_=.2,h.psStrokeOpacity_=1,h.psClasses_=5,h.psColors_=null,h.psColorFun_=jl,h.psClassToFillStyle_=void 0,h.psBrightenFactor_=.9,h.psThresholds_=[0],h.psClassificationMethod_="quantile",h.makeClassifNice_=!0,h.classifierSize_=void 0,h.classifierColor_=void 0,h.tooltip_.textFunction=Ul,h.psCodeLabels_=!1;var g=["psMaxSize_","psMinSize_","psMaxValue_","psMinValue_","psFill_","psFillOpacity_","psStrokeOpacity_","psStroke_","psStrokeWidth_","classifierSize_","classifierColor_","psShape_","psCustomShape_","psBarWidth_","psClassToFillStyle_","psColorFun_","psSizeScale_","noDataFillStyle_","psThresholds_","psColors_","psCustomSVG_","psOffset_","psClassificationMethod_","psClasses_","dorling_","dorlingStrength_","dorlingIterations_","animateDorling_","psSpikeWidth_","psCodeLabels_","psBrightenFactor_"];function applyStyleToMap(c){updateBackgroundColor(c,h.psFill_),h.psClassToFillStyle()||h.psClassToFillStyle(Hl(h.psColorFun_,h.psColors_));var g=getSizeStatData(c);if(c.svg_){var w,S;c.svg_.selectAll(":not(#em-insets-group) g.em-centroid > *").remove(),h.updateSymbolsDrawOrder(c),S=h.psCustomSVG_?function appendCustomSymbolsToMap(c,h,g){return c.getCentroidsGroup(c).selectAll("g.em-centroid").append("g").filter(function(c){var g=h.get(c.properties.id);if(g&&":"!==g.value)return c}).attr("class","ps").html(g.psCustomSVG_).attr("transform",function(c){var m=h.get(c.properties.id),b=g.classifierSize_(+m.value);if(b)return"translate(".concat(g.psOffset_.x*b,",").concat(g.psOffset_.y*b,") scale(").concat(b,")")})}(c,g,h):"bar"==h.psShape_?function appendBarsToMap(c,h,g){return c.getCentroidsGroup(c).selectAll("g.em-centroid").append("rect").filter(function(c){var g=h.get(c.properties.id);if(g&&":"!==g.value)return c}).attr("width",g.psBarWidth_).attr("height",function(c){var m=h.get(c.properties.id);return m&&m.value?g.classifierSize_(+m.value):0}).attr("transform",function(){return this.getBoundingClientRect(),"translate(".concat(-this.getAttribute("width")/2)+", -".concat(this.getAttribute("height"),")")})}(c,g,h):"circle"==h.psShape_?function appendCirclesToMap(c,h,g){c.svg().selectAll("g.em-centroid").style("pointer-events","none");var m=c.svg().selectAll("g.em-centroid").filter(function(c){var g=h.get(c.properties.id);return g&&":"!==g.value&&g.value}).append("circle").attr("stroke-width",g.psStrokeWidth_).attr("stroke",g.psStroke_).attr("fill-opacity",g.psFillOpacity_).attr("stroke-opacity",g.psStrokeOpacity_).transition().duration(g.transitionDuration_).attr("r",function(c){var m=h.get(c.properties.id),b=g.classifierSize_(+m.value);return b<0&&console.error("Negative radius for circle:",c.properties.id),isNaN(b)&&console.error("NaN radius for circle:",c.properties.id),b}).on("end",function(){src_select(this.parentNode).style("pointer-events",null)});return m}(c,g,h):"spike"==h.psShape_?appendSpikesToMap(c,g,h):function appendD3SymbolsToMap(c,h,g){return c.svg().selectAll("g.em-centroid").append("path").filter(function(c){var g=h.get(c.properties.id);if(g&&":"!==g.value)return c}).attr("class","ps").attr("d",function(c){if(h){var m=h.get(c.properties.id);if(0==m||m){var b=g.classifierSize_(+m.value)||0;if(g.psCustomShape_)return g.psCustomShape_.size(b*b)();var w=bl[g.psShape_]||bl.circle;return symbol_Symbol().type(w).size(b*b)()}}})}(c,g,h),m(c,g),function setSymbolStyles(c){c.attr("fill-opacity",h.psFillOpacity()).attr("stroke-opacity",h.psStrokeOpacity()).attr("stroke",h.psStroke()).attr("stroke-width",h.psStrokeWidth()).style("fill",function(){if(h.classifierColor_){var c=src_select(this.parentNode).attr("ecl");return c&&"nd"!==c?h.psClassToFillStyle_(c,h.psClasses_):h.noDataFillStyle_||"gray"}return h.psFill_}).attr("fill___",function(){if(h.classifierColor_){var c=src_select(this.parentNode).attr("ecl");return c&&"nd"!==c?h.psClassToFillStyle_(c,h.psClasses_):h.noDataFillStyle_||"gray"}return h.psFill_})}(S),b(c,g);var M=h.transitionDuration_||0;M>0?setTimeout(function(){ps_interactions_addMouseEvents(c,h)},M+100):ps_interactions_addMouseEvents(c,h),null!==(w=h.labels_)&&void 0!==w&&w.values&&h.updateValuesLabels(c),h.patternFill_&&applyPatternFill(c,h.patternFill_)}return c}g.forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&g.forEach(function(g){var m=g.slice(0,-1);null!=c[m]&&h[m](c[m])}),h.psColorFun=function(c){return arguments.length?(h.psColorFun_=c,h.psClassToFillStyle_=Hl(h.psColorFun_,h.psColors_),h):h.psColorFun_},h.psThresholds=function(c){return arguments.length?(h.psThresholds_=c,h.psClasses(c.length+1),h):h.psThresholds_},h.updateClassification=function(){try{return defineClassifiers(h),h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,function(c){return applyClassificationToMap(c,h)}),applyClassificationToMap(h),h}catch(c){console.error("Error in proportional symbols classification: "+c.message),console.error(c)}};var m=function setRegionStyles(c,g){var m=zt(c),b=c.svg().selectAll(m);if("WORLD"!==c.geo_){if("mixed"==c.nutsLevel_){!function styleMixedNUTSRegions(c,g,m){m.style("display",function(h){if(!this.parentNode.classList.contains("em-cntrg")){var m=g.get(h.properties.id);return!m||!m.value&&0!==m&&0!==m.value&&"0"!==m.value?"none":"WORLD"==c.geo_?"block":void 0}}),m.style("stroke",function(c){var h=src_select(this),m=h.attr("lvl"),b=h.style("stroke"),w=g.get(c.properties.id);if(w&&w.value)return"0"!==m?b||"#777":void 0}).style("stroke-width",function(c){var m=src_select(this),b=m.attr("lvl"),w=m.style("stroke-width"),S=g.get(c.properties.id);if(S&&S.value)return"WORLD"==h.geo_&&"0"!==b?w||"#777":void 0})}(c,g,b);var w=[];c.svg().selectAll("g.em-centroid").each(function(c){var h;null!==(h=c.properties)&&void 0!==h&&h.centroid&&w.push(c)}),c.Geometries.centroidsFeatures=w}b.attr("ecl",function(c){var h=g.get(c.properties.id);return!h||!h.value&&0!==h&&0!==h.value&&"0"!==h.value?"ni":h&&h.value&&":"==h.value?"nd":void 0}),b.style("fill",null),b.filter(function(c){var h=g.get(c.properties.id);return h&&":"===h.value}).style("fill",h.noDataFillStyle()).attr("fill___",h.noDataFillStyle())}},b=function appendLabelsToSymbols(c,g){var m,b=c.svg().selectAll("g.em-centroid");if(h.psCodeLabels_)b.filter(function(c){var h=g.get(c.properties.id);return":"!==(null==h?void 0:h.value)&&null!=(null==h?void 0:h.value)}).append("text").attr("class","em-circle-code-label").text(function(c){var h=g.get(c.properties.id);return":"===(null==h?void 0:h.value)?"":c.properties.id}).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","sans-serif").style("font-size",function(c){var m,b,w=g.get(c.properties.id),S=w?h.classifierSize_(+w.value):0,M=null!==(m=h.labels_)&&void 0!==m&&m.values&&null!==(b=g.get(c.properties.id))&&void 0!==b&&b.value?.8:.9;return"square"===h.psShape_&&(M-=.4),"".concat(S*M,"px")}).attr("fill",function(){var c,h=null===(c=window.getComputedStyle(this.parentNode.firstChild))||void 0===c?void 0:c.fill;return Ot(h)}).attr("dy",function(c){var m,b;return null!==(m=h.labels_)&&void 0!==m&&m.values&&null!==(b=g.get(c.properties.id))&&void 0!==b&&b.value?"-0.3em":"0"});if(null!==(m=h.labels_)&&void 0!==m&&m.values)b.filter(function(c){var h=g.get(c.properties.id);return":"!==(null==h?void 0:h.value)&&null!=(null==h?void 0:h.value)}).append("text").attr("class","em-circle-stat-label").text(function(c){var h=g.get(c.properties.id);if(null!=h&&h.value)return h.value}).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","sans-serif").style("font-size",function(c){var m=g.get(c.properties.id),b=m?h.classifierSize_(+m.value):0;return"".concat(.4*b,"px")}).attr("fill",function(){var c,g=(null===(c=window.getComputedStyle(this.parentNode.firstChild))||void 0===c?void 0:c.fill)||h.psFill_;return Ot(g)}).attr("dy",function(c){return h.psCodeLabels_?"0.8em":"0"})};return h.updateSymbolsDrawOrder=function(c){var g=h.getCentroidsGroup(c),m=getSizeStatData(c);c.Geometries.centroidsFeatures&&c.Geometries.centroidsFeatures.length||(c.Geometries.centroidsFeatures=c.svg().selectAll("g.em-centroid").data().filter(function(c){var h;return null==c||null===(h=c.properties)||void 0===h?void 0:h.centroid}));var b=c.Geometries.centroidsFeatures.filter(function(c){var h,g=null===(h=m.get)||void 0===h||null===(h=h.call(m,c.properties.id))||void 0===h?void 0:h.value;return null!=g&&":"!==g}).sort(function(c,h){return m.get(h.properties.id).value-m.get(c.properties.id).value});g.selectAll("g.em-centroid").remove(),g.selectAll("g.em-centroid").data(b,function(c){return c.properties.id}).enter().append("g").attr("class","em-centroid").attr("id",function(c){return"ps"+c.properties.id}).attr("transform",function(c){return"translate(".concat(c.properties.centroid[0].toFixed(3),",").concat(c.properties.centroid[1].toFixed(3),")")}),applyClassificationToMap(c,h)},h.updateStyle=function(){try{if(applyStyleToMap(h),h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyStyleToMap),h.dorling_){var c=getSizeStatData(h);runDorlingSimulation(h,function(g){var m=c.get(g.properties.id),b=m?h.classifierSize_(+m.value):0;return"square"===h.psShape_?b/2*Math.SQRT2:b})}else stopDorlingSimulation(h);return h}catch(c){console.error("Error in proportional symbols styling: "+c.message),console.error(c)}},h.getLegendConstructor=function(){return xl},h},Hl=function getColorLegend(c,h){return c=c||jl,h?function(c,g){return h[c]}:function(h,g){return c(h/(g-1))}};function getSizeStatData(c){return c.statData("size").getArray()?c.statData("size"):c.statData()}var Ul=function tooltipTextFunPs(c,h){var g,m;if(h.tooltip_.omitRegions&&h.tooltip_.omitRegions.includes(c.properties.id))return"";var b=c.properties.na,w=c.properties.id,S=function formatValue(c,h,g){return":"===c?g||"Data not available":Ft(c)+(h?" "+h:"")},M=h.statData("size").getArray()?h.statData("size"):h.statData(),k=M.get(c.properties.id),T=(null===(g=M.unitText)||void 0===g?void 0:g.call(M))||"",E="<tr><td>".concat(S(null==k?void 0:k.value,T,h.noDataText_),"</td></tr>"),I="",P=null!==(m=h.statData("color"))&&void 0!==m&&m.getArray()?h.statData("color"):null;if(P){var L,B=P.get(c.properties.id),z=(null===(L=P.unitText)||void 0===L?void 0:L.call(P))||"";I="<tr><td>".concat(S(null==B?void 0:B.value,z,h.noDataText_),"</td></tr>")}return'\n <div class="em-tooltip-bar">\n <b>'.concat(b,"</b>").concat(w?" (".concat(w,")"):"",'\n </div>\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n ').concat(E,"\n ").concat(I,"\n </tbody>\n </table>\n </div>\n ").trim()};const Yl=colors("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");var Vl=function legend(c,h){var g=wl(c);if(g.order=void 0,h)for(var m in h)g[m]=h[m];function highlightRegions(c,h){var g=jt(c),m=c.svg_.selectAll(g).selectAll("[ecl]");m.style("fill","white"),m.filter("[ecl='"+h+"']").each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}function unhighlightRegions(c){var h=jt(c);c.svg_.selectAll(h).selectAll("[ecl]").each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}return g.update=function(){if(g.updateConfig(),g.updateContainer(),g.lgg.node()&&g.map.classifier_){g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle();var c=g.getBaseY(),h=g.getBaseX();if(g._categoricalContainer=g.lgg.append("g").attr("class","em-legend-categorical").attr("transform","translate(".concat(h,", ").concat(c,")")),function createCategoricalLegend(c){for(var h=c._categoricalContainer,g=c.map,m=g.classToFillStyle()?Object.keys(g.classToFillStyle()):g.classifier_.domain(),b=c.order?c.order:m,w=function _loop(){var m=b[S],w=g.classifier_(m),M=g.classToFillStyle_[m],k=c.titlePadding+S*(c.shapeHeight+c.shapePadding);h.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",k).attr("width",c.shapeWidth).attr("height",c.shapeHeight).style("fill",M).on("mouseover",function(){highlightRegions(c.map,w),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.svgId_,highlightRegions,w)}).on("mouseout",function(){unhighlightRegions(c.map),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.svgId_,unhighlightRegions,w)}),h.append("text").attr("class","em-legend-label").attr("x",c.shapeWidth+c.labelOffsets.x).attr("y",k+.5*c.shapeHeight).attr("dy","0.35em").text(g.classToText()?g.classToText()[m]:m)},S=0;S<b.length;S++)w()}(g),g.map.patternFill_){var m=g.lgg.node().getBBox().height,b=g.lgg.append("g").attr("class","pattern-fill-legend").attr("transform","translate(".concat(h,", ").concat(m+15,")"));appendPatternFillLegend(g,b)}if(g.noData){var w=g.lgg.node().getBBox().height+10,S=h,M=g.lgg.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(S,",").concat(w+15,")"));g.appendNoDataLegend(M,g.noDataText,highlightRegions,unhighlightRegions)}g.setBoxDimension()}},g},$l=function tooltipTextFunCat(c,h){var g=[];c.properties.id?g.push('<div class="em-tooltip-bar">'+c.properties.na+" ("+c.properties.id+") </div>"):g.push('<div class="em-tooltip-bar">'+c.properties.na+"</div>");var m=h.statData().get(c.properties.id);if(!m||0!=m.value&&!m.value)return g.push(h.noDataText_),g.join("");var b=m.value;if(h.classToText_){var w=h.classToText_[b];return g.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>\n '.concat(w||b,"\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n")),g.join("")}return g.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>\n '.concat(b,"\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n")),g.join("")};Array.prototype.slice;function d3_shape_src_array(c){return"object"==typeof c&&"length"in c?c:Array.from(c)}function linear_Linear(c){this._context=c}function src_curve_linear(c){return new linear_Linear(c)}function src_point_x(c){return c[0]}function src_point_y(c){return c[1]}function d3_shape_src_line(c,h){var g=node_modules_d3_shape_src_constant(!0),m=null,b=src_curve_linear,w=null,S=withPath(line);function line(M){var k,T,E,I=(M=d3_shape_src_array(M)).length,P=!1;for(null==m&&(w=b(E=S())),k=0;k<=I;++k)!(k<I&&g(T=M[k],k,M))===P&&((P=!P)?w.lineStart():w.lineEnd()),P&&w.point(+c(T,k,M),+h(T,k,M));if(E)return w=null,E+""||null}return c="function"==typeof c?c:void 0===c?src_point_x:node_modules_d3_shape_src_constant(c),h="function"==typeof h?h:void 0===h?src_point_y:node_modules_d3_shape_src_constant(h),line.x=function(h){return arguments.length?(c="function"==typeof h?h:node_modules_d3_shape_src_constant(+h),line):c},line.y=function(c){return arguments.length?(h="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),line):h},line.defined=function(c){return arguments.length?(g="function"==typeof c?c:node_modules_d3_shape_src_constant(!!c),line):g},line.curve=function(c){return arguments.length?(b=c,null!=m&&(w=b(m)),line):b},line.context=function(c){return arguments.length?(null==c?m=w=null:w=b(m=c),line):m},line}linear_Linear.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1,this._line?this._context.lineTo(c,h):this._context.moveTo(c,h);break;case 1:this._point=2;default:this._context.lineTo(c,h)}}};var Xl=function legend(c,h){var g=wl(c);if(g.squareSize=100,g.rotation=0,g.label1="Variable 1",g.label2="Variable 2",g.axisTitleFontSize=Pt("em-bivariate-axis-title"),g.breaks1=void 0,g.breaks2=void 0,g.showBreaks=!1,g.tickLength=5,g.yAxisLabelsOffset={x:0,y:0},g.xAxisLabelsOffset={x:0,y:0},g.yAxisTitleOffset={x:0,y:0},g.xAxisTitleOffset={x:0,y:0},g.boxPadding=g.labelFontSize,g.noDataYOffset=30,g.axisArrows=!0,g.arrowHeight=15,g.arrowWidth=14,g.arrowPadding=10,h)for(var m in h)g[m]=h[m];function highlightRegions(c,h,g){var m=jt(c),b=c.svg_.selectAll(m).selectAll("[ecl1],[ecl2]");b.style("fill","white"),b.filter("[ecl1='".concat(h,"']")).filter("[ecl2='".concat(g,"']")).filter(":not([nd])").each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}function unhighlightRegions(c){var h=jt(c);c.svg_.selectAll(h).selectAll("[ecl1],[ecl2]").each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}return g.update=function(){if(g.updateConfig(),g.updateContainer(),g._horizontalOffset=g.axisTitleFontSize+g.arrowPadding,g.lgg.selectAll("*").remove(),g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle(),g._y=g.boxPadding+(g.title?g.titleFontSize+g.boxPadding:0),function addSquares(){for(var c=g.lgg,h=g.map.numberOfClasses(),m=g.squareSize/h,b=0===g.rotation?0:.7071*g.squareSize+g.boxPadding,w=0,S=c.append("g").attr("class","bivariate-squares-chart").attr("transform","translate(".concat(g.boxPadding+g._horizontalOffset,",").concat(b+g._y,") rotate(").concat(g.rotation,") translate(").concat(g.boxPadding,",0)")),M=0;M<h;M++)for(var k=function _loop(){var c=h-M-1,b=h-T-1,k=g.map.classToFillStyle()(c,b);S.append("rect").attr("class","em-bivariate-square").attr("x",w+(h-1-M)*m).attr("y",T*m).attr("width",m).attr("height",m).style("fill",k).on("mouseover",function(){highlightRegions(g.map,c,b),g.map.insetTemplates_&&Bt(g.map.insetTemplates_,g.map.svgId,highlightRegions,c,b),src_select(this).raise()}).on("mouseout",function(){unhighlightRegions(g.map),g.map.insetTemplates_&&Bt(g.map.insetTemplates_,g.map.svgId,unhighlightRegions,c,b)})},T=0;T<h;T++)k();S.append("rect").attr("class","em-bivariate-frame").attr("x",w).attr("y",0).attr("width",g.squareSize).attr("height",g.squareSize).attr("stroke-width",.7)}(),!g.breaks1&&!g.breaks2&&g.showBreaks){var h=c.classifier1_;"function"==typeof h.quantiles?g.breaks1=h.quantiles().map(function(c){return parseFloat(c.toFixed(0))}):h.domain&&(g.breaks1=h.domain().map(function(c){return parseFloat(c.toFixed(0))}));var m=c.classifier2_;"function"==typeof m.quantiles?g.breaks2=m.quantiles().map(function(c){return parseFloat(c.toFixed(0))}):m.domain&&(g.breaks2=m.domain().map(function(c){return parseFloat(c.toFixed(0))}))}!function addBreakLabels(){var c=0===g.rotation?0:.7071*g.squareSize+g.boxPadding,h=0,m=g.map.numberOfClasses(),b=g.squareSize/m,w=g.lgg.append("g").attr("class","bivariate-break-labels").attr("transform","translate(".concat(g.boxPadding+g._horizontalOffset,",").concat(c+g._y,") rotate(").concat(g.rotation,") translate(").concat(g.boxPadding,",0)"));if(g.breaks1)for(var S=0;S<g.breaks1.length;S++){var M=h+b*(S+1),k=g.squareSize+Pt("em-bivariate-tick-label");w.append("text").attr("class","em-bivariate-tick-label").attr("x",M+g.xAxisLabelsOffset.x).attr("y",k+g.xAxisLabelsOffset.y).text(g.breaks1[S]),w.append("line").attr("class","em-bivariate-tick").attr("x1",M).attr("x2",M).attr("y1",g.squareSize).attr("y2",g.squareSize+g.tickLength)}if(g.breaks2)for(var T=0;T<g.breaks2.length;T++){var E=h,I=b*(T+2)-b;w.append("text").attr("class","em-bivariate-tick-label").attr("x",E+g.yAxisLabelsOffset.x).attr("y",I-g.yAxisLabelsOffset.y-(g.tickLength+2)).text(toConsumableArray_toConsumableArray(g.breaks2).reverse()[T]).attr("text-anchor","middle").attr("transform","rotate(-90, ".concat(E,", ").concat(I,")")),w.append("line").attr("class","em-bivariate-tick").attr("x1",E).attr("x2",E-g.tickLength).attr("y1",I).attr("y2",I)}}(),g._xAxisArrowY=0,g._yAxisArrowX=0,g.axisArrows&&function addAxisArrows(){var c=0===g.rotation?0:.7071*g.squareSize+g.boxPadding,h=0,m=g.lgg.append("g").attr("class","bivariate-axis-arrows").attr("transform","translate(".concat(g.boxPadding+g._horizontalOffset,",").concat(c+g._y,") rotate(").concat(g.rotation,") translate(").concat(g.boxPadding,",0)"));g._xAxisArrowY=g.squareSize+g.tickLength+g.arrowPadding,(g.showBreaks||g.breaks1&&g.breaks2)&&(g._xAxisArrowY+=Pt("em-bivariate-tick-label")/1.5);m.append("path").attr("class","em-bivariate-axis-arrow").attr("d",d3_shape_src_line()([[h,g._xAxisArrowY],[h+g.squareSize,g._xAxisArrowY]])).attr("stroke","black").attr("marker-end","url(#arrowhead)"),g._yAxisArrowX=-g.tickLength-g.arrowPadding,(g.showBreaks||g.breaks1&&g.breaks2)&&(g._yAxisArrowX-=g.labelFontSize/2);m.append("path").attr("class","em-bivariate-axis-arrow").attr("d",d3_shape_src_line()([[g._yAxisArrowX,g.squareSize],[g._yAxisArrowX,0]])).attr("stroke","black").attr("marker-end","url(#arrowhead)")}(),function addAxisTitles(){var c=0===g.rotation?0:.7071*g.squareSize+g.boxPadding,h=0,m=g.lgg.append("g").attr("class","bivariate-axis-titles").attr("transform","translate(".concat(g.boxPadding+g._horizontalOffset,",").concat(c+g._y,") rotate(").concat(g.rotation,") translate(").concat(g.boxPadding,",0)")),b=g.squareSize+g.xAxisLabelsOffset.y+(g.axisArrows?g.arrowPadding+g.arrowHeight:7),w=h;(g.showBreaks||g.breaks1&&g.breaks2)&&(b+=Pt("em-bivariate-tick-label"));g.xAxisTitleOffset&&(b+=g.xAxisTitleOffset.y);g.xAxisTitleOffset&&(w+=g.xAxisTitleOffset.x);m.append("text").attr("class","em-bivariate-axis-title em-bivariate-axis-title-x").attr("x",w).attr("y",b).text(g.label1).attr("dominant-baseline","hanging").attr("alignment-baseline","hanging");var S=(g.axisArrows?g._yAxisArrowX-g.arrowPadding:7)+(-45==g.rotation?-4:-10);(g.showBreaks||g.breaks1&&g.breaks2)&&(b+=Pt("em-bivariate-tick-label"));var M=-g.squareSize;g.yAxisTitleOffset&&(S+=g.yAxisTitleOffset.y);g.yAxisTitleOffset&&(M+=g.yAxisTitleOffset.x);m.append("text").attr("class","em-bivariate-axis-title em-bivariate-axis-title-y").attr("x",M).attr("y",S).text(g.label2).style("transform",g.rotation<0?"translate(".concat(g.axisArrows?-51:-15,"px, 95px) rotate(90deg)"):"rotate(-90deg)")}(),g.lgg.append("defs").append("marker").attr("viewBox","0 0 ".concat(g.arrowWidth," ").concat(g.arrowHeight)).attr("id","arrowhead").attr("refX",0).attr("refY",5).attr("markerWidth",g.arrowWidth).attr("markerHeight",g.arrowHeight).attr("orient","auto").append("path").attr("d","M 0 0 L 5 5 L 0 10").attr("marker-units","strokeWidth"),g.noData&&function addNoDataElement(){var c=0===g.rotation?g.noDataYOffset+g.squareSize/g.map.numberOfClasses_+g.arrowHeight/2:g.noDataYOffset,h=0===g.rotation?g._y+g.squareSize+c:g._y+1.4142*g.squareSize+2*g.boxPadding+c;g.lgg.append("rect").attr("class","em-bivariate-nodata").attr("x",g.boxPadding+g.noDataShapeWidth/2).attr("y",h+(0==g.rotation?0:-10)).attr("width",g.noDataShapeWidth).attr("height",g.noDataShapeHeight).style("fill",g.map.noDataFillStyle()).on("mouseover",function(){("mixed"==g.map.nutsLevel_?src_selectAll("#em-nutsrg"):src_select("#em-nutsrg")).selectAll("[nd='nd']").style("fill","red")}).on("mouseout",function(){("mixed"==g.map.nutsLevel_?src_selectAll("#em-nutsrg"):src_select("#em-nutsrg")).selectAll("[nd='nd']").style("fill",function(){return src_select(this).attr("fill___")}),src_select(this).style("fill",g.map.noDataFillStyle())}),g.lgg.append("text").attr("class","em-bivariate-nodata-label").attr("x",g.boxPadding+g.noDataShapeWidth+(g.noDataShapeWidth/2+5)).attr("y",h+.5*g.noDataShapeHeight+1+(0==g.rotation?0:-10)).text(g.noDataText)}(),g.setBoxDimension()},g},Kl=function scaleBivariate(c,h,g,m,b){for(var w=[],S=st(h,g),M=st(m,b),k=0;k<c;k++){for(var T=k/(c-1),E=st(S(T),M(T)),I=[],P=0;P<c;P++)I.push(E(P/(c-1)));w.push(I)}return function(c,h){return w[c][h]}},Zl=function tooltipTextFunBiv(c,h){var g=[],m=c.properties.na||c.properties.name;c.properties.id?g.push('<div class="em-tooltip-bar" >'+m+" ("+c.properties.id+") </div>"):g.push('<div class="em-tooltip-bar" >'+m+"</div>");var b=h.statData("v1").get(c.properties.id),w=h.statData("v1").unitText(),S=h.statData("v2").get(c.properties.id),M=h.statData("v2").unitText();return g.push('\n <div class="em-tooltip-text" style="background: #ffffff;color: #171a22;padding: 4px;font-size:15px;">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>\n '.concat(b&&b.value?Ft(b.value):""," ").concat(w&&b&&b.value?w:"","\n ").concat(!b||0!=b.value&&!b.value?h.noDataText_:"","\n </td>\n </tr>\n <tr>\n <td>\n ").concat(S&&S.value?Ft(S.value):""," ").concat(M&&S&&S.value?M:"","\n ").concat(!S||0!=S.value&&!S.value?h.noDataText_:"","\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n ")),g.join("")};class TernaryGeometry{static ternaryMeshCentroids(c){const h=c*c,g=[];for(let m=1;m<=h;m++){const b=Math.floor(Math.sqrt(h-m)),w=b*b,S=((-h+m+b*(b+2)+1)%2-3*w-3*m+3*h+1)/(6*c),M=-((-h+w+m+2*b+1)%2+3*b-3*c+1)/(3*c),k=((-h+w+m+2*b+1)%2+3*w+6*b+3*m-3*h+1)/(6*c);g.push({id:m,p1:S,p2:M,p3:k})}return g}static ternaryMeshVertices(c){const h=Math.sqrt(c.length),g=[];return c.forEach(c=>{const m=h-Math.floor(Math.sqrt(h*h-c.id)),b=c.id-(m-1)*(2*h-m+1),w=2*Math.pow(-1,b%2)/(3*h),S=Math.pow(-1,b%2)/(3*h);g.push({id:c.id,vertex:1,p1:c.p1-w,p2:c.p2+S,p3:c.p3+S}),g.push({id:c.id,vertex:2,p1:c.p1+S,p2:c.p2-w,p3:c.p3+S}),g.push({id:c.id,vertex:3,p1:c.p1+S,p2:c.p2+S,p3:c.p3-w})}),g}static ternaryDistance(c,h){return h.map(h=>{const g=c[0]-h[0],m=c[1]-h[1],b=c[2]-h[2];return-(m*b+b*g+g*m)})}static ternaryNearest(c,h){return c.map(c=>{if(!c)return null;const g=this.ternaryDistance(c,h),m=g.indexOf(Math.min(...g));return h[m]})}static ternarySextantVertices(c){const h=[],g=[c[0],1-c[0],0],m=[c[0],0,1-c[0]],b=[0,c[1],1-c[1]],w=[1-c[1],c[1],0],S=[1-c[2],0,c[2]],M=[0,1-c[2],c[2]],k=[[c,S,[1,0,0],w,c],[c,w,g,c],[c,g,[0,1,0],M,c],[c,M,b,c],[c,b,[0,0,1],m,c],[c,m,S,c]];for(let c=1;c<=6;c++){const g=k[c-1];for(let m=0;m<g.length;m++)h.push({id:c,vertex:m+1,p1:g[m][0],p2:g[m][1],p3:g[m][2]})}return h}static ternarySurroundingSextant(c,h){return c.map(c=>{if(!c)return null;const g=[c[0]>h[0],c[1]>h[1],c[2]>h[2]];return!g[0]||g[1]||g[2]?g[0]&&g[1]&&!g[2]?2:g[0]||!g[1]||g[2]?!g[0]&&g[1]&&g[2]?4:g[0]||g[1]||!g[2]?g[0]&&!g[1]&&g[2]?6:null:5:3:1})}static ternaryToCartesian(c){return[.5*(2*c[2]+c[1]),Math.sqrt(3)/2*c[1]]}static cartesianToTernary(c,h){const g=2*h/Math.sqrt(3),m=c-g/2;return[1-g-m,g,m]}static ternaryLimits(c){const h=[1,1,1],g=[0,0,0];return c.forEach(c=>{h[0]=Math.min(h[0],c[0]),h[1]=Math.min(h[1],c[1]),h[2]=Math.min(h[2],c[2]),g[0]=Math.max(g[0],c[0]),g[1]=Math.max(g[1],c[1]),g[2]=Math.max(g[2],c[2])}),{lower:h,upper:g}}}class CompositionUtils{static geometricMean(c,h=!0){const g=h?c.filter(c=>0!==c):c;return 0===g.length?0:Math.exp(g.reduce((c,h)=>c+Math.log(h),0)/g.length)}static centre(c){const h=this.geometricMean(c.map(c=>c[0])),g=this.geometricMean(c.map(c=>c[1])),m=this.geometricMean(c.map(c=>c[2])),b=h+g+m;return[h/b,g/b,m/b]}static perturbe(c,h=[1/3,1/3,1/3]){return c.map(c=>{if(!c)return null;const g=[c[0]*h[0],c[1]*h[1],c[2]*h[2]],m=g.reduce((c,h)=>c+h,0);return[g[0]/m,g[1]/m,g[2]/m]})}static powerScale(c,h=1){return c.map(c=>{if(!c)return null;const g=[Math.pow(c[0],h),Math.pow(c[1],h),Math.pow(c[2],h)],m=g.reduce((c,h)=>c+h,0);return[g[0]/m,g[1]/m,g[2]/m]})}static close(c){return c.map(c=>{if(!this.isValidTernary(c))return null;const h=c[0]+c[1]+c[2];return[c[0]/h,c[1]/h,c[2]/h]})}static validateTernaryPoints(c){for(let h=0;h<c.length;h++){const g=c[h];if(!g)continue;if(3!==g.length)throw new Error(`Ternary point must have exactly 3 components, got ${g.length}`);if(g.some(c=>c<0))throw new Error(`Ternary point contains negative values: [${g}]`);const m=g[0]+g[1]+g[2];if(Math.abs(m-1)>1e-9)throw new Error(`Ternary point components must sum to 1, got ${m}: [${g}]`)}}static isValidTernary(c){return Array.isArray(c)&&3===c.length&&c.every(c=>"number"==typeof c&&!Number.isNaN(c))}}class colorMapping_ColorMapping{static colorMapTricolore(c,h=[1/3,1/3,1/3],g=4,m=80,b=140,w=80,S=.4,M=1){const k=CompositionUtils.close([...c]);let T=CompositionUtils.close([...c]);if(Number.isFinite(g)&&g<100){const c=TernaryGeometry.ternaryMeshCentroids(g).map(c=>[c.p1,c.p2,c.p3]);T=TernaryGeometry.ternaryNearest(T,c)}const E=CompositionUtils.perturbe(T,[1/h[0],1/h[1],1/h[2]]);return CompositionUtils.powerScale(E,M).map((h,g)=>{if(!h)return{p1:c[g][0],p2:c[g][1],p3:c[g][2],h:null,c:null,l:null,rgb:null};const M=h.map(c=>c*b),T=[m,m+120,m+240].map(c=>c*Math.PI/180),E=T.map((c,h)=>({re:M[h]*Math.cos(c),im:M[h]*Math.sin(c)})).reduce((c,h)=>({re:c.re+h.re,im:c.im+h.im}),{re:0,im:0}),I=(180*Math.atan2(E.im,E.re)/Math.PI+360)%360,P=Math.sqrt(E.re*E.re+E.im*E.im),L=P*S/b+1-S,B=L*w,z=L*P,j=this.hclToHex(I,z,B);return{p1:k[g][0],p2:k[g][1],p3:k[g][2],h:I,c:z,l:B,rgb:j}})}static colorMapSextant(c,h=[1/3,1/3,1/3],g=["#FFFF00","#B3DCC3","#01A0C6","#B8B3D8","#F11D8C","#FFB3B3"]){if(6!==g.length)throw new Error("Sextant values array must have exactly 6 elements");const m=CompositionUtils.close([...c]),b=TernaryGeometry.ternarySurroundingSextant(m,h);return m.map((h,m)=>{if(!h)return{p1:c[m][0],p2:c[m][1],p3:c[m][2],sextant:null,rgb:null};const w=b[m],S=null!==w?g[w-1]:null;return{p1:h[0],p2:h[1],p3:h[2],sextant:w,rgb:S}})}static hclToHex(c,h,g){(c%=360)<0&&(c+=360),h=Math.max(0,Math.min(h,230)),g=Math.max(0,Math.min(g,100));const m=c*Math.PI/180,b=(g+16)/116,w=Math.cos(m)*h/500+b,S=b-Math.sin(m)*h/200,M=.95047*(w>.206893034?w**3:(w-16/116)/7.787),k=1*(b>.206893034?b**3:(b-16/116)/7.787),T=1.08883*(S>.206893034?S**3:(S-16/116)/7.787);let E=3.2406*M-1.5372*k-.4986*T,I=-.9689*M+1.8758*k+.0415*T,P=.0557*M-.204*k+1.057*T;const gamma=c=>c>.0031308?1.055*c**(1/2.4)-.055:12.92*c;E=gamma(E),I=gamma(I),P=gamma(P);const to8bit=c=>Math.round(255*(c=>Math.max(0,Math.min(1,c)))(c)),toHex=c=>{const h=to8bit(c).toString(16);return 1===h.length?"0"+h:h};return`#${toHex(E)}${toHex(I)}${toHex(P)}`}}function identity_identity(c){return c}function group(c,...h){return nest(c,identity_identity,identity_identity,h)}function nest(c,h,g,m){return function regroup(c,b){if(b>=m.length)return g(c);const w=new InternMap,S=m[b++];let M=-1;for(const h of c){const g=S(h,++M,c),m=w.get(g);m?m.push(h):w.set(g,[h])}for(const[c,h]of w)w.set(c,regroup(h,b));return h(w)}(c,0)}class TricoloreViz{constructor(c,h=650,g=520,m={top:20,right:60,bottom:50,left:60}){this.canvas=null,this.ctx=null,this.container=src_select(c),this.width=h,this.height=g,this.margin=m,this.svg=this.container.append("svg").attr("width",h).attr("height",g),this.triangle=this.svg.append("g").attr("transform",`translate(${m.left},${m.top})`).attr("class","em-tricolore-triangle"),this.legend=this.svg.append("g").attr("transform",`translate(${m.left},${m.top})`).attr("class","em-tricolore-legend-labels"),this.circles=this.svg.append("g").attr("transform",`translate(${m.left},${m.top})`).attr("class","em-tricolore-data-points")}createContinuousPlot(c=[],h={}){var g,m;const{center:b=[1/3,1/3,1/3],hue:w=80,chroma:S=140,lightness:M=80,contrast:k=.4,spread:T=1,showData:E=!0,showCenter:I=!0,showLines:P=!0,labels:L=["p₁","p₂","p₃"],labelPosition:B="corner",colorTarget:z="triangles"}=h,j=this.width-this.margin.left-this.margin.right,D=this.height-this.margin.top-this.margin.bottom,N=Math.min(j,D);if(this.canvas&&src_select(this.canvas).remove(),this.triangle.selectAll("*").remove(),this.legend.selectAll("*").remove(),this.circles.selectAll("*").remove(),this.canvas=document.createElement("canvas"),this.canvas.width=N,this.canvas.height=N,this.ctx=this.canvas.getContext("2d"),this.ctx){if(this.drawContinuousTriangle(N,b,w,S,M,k,T),this.triangle.append("image").attr("x",0).attr("y",0).attr("width",N).attr("height",N).attr("href",this.canvas.toDataURL()),this.drawTriangleFrame(N,L,b,I,P,B,z),E&&c.length>0){const m=null!==(g=h.colorTarget)&&void 0!==g?g:"triangles";this.addDataPoints(c,N,h.dataPointHandlers,I,b,void 0,m)}I&&this.addCenterAnnotation(N,b,null!==(m=h.centerLabel)&&void 0!==m?m:"Average value",h.centerAnnotationOffsets)}}createDiscretePlot(c=[],h={}){var g;const{center:m=[1/3,1/3,1/3],breaks:b=4,hue:w=80,chroma:S=140,lightness:M=80,contrast:k=.4,spread:T=1,showData:E=!0,showCenter:I=!0,showLines:P=!0,labels:L=["p₁","p₂","p₃"],labelPosition:B="corner",colorTarget:z="triangles"}=h,j=this.width-this.margin.left-this.margin.right,D=this.height-this.margin.top-this.margin.bottom,N=Math.min(j,D);this.triangle.selectAll("*").remove(),this.legend.selectAll("*").remove(),this.circles.selectAll("*").remove();const R=TernaryGeometry.ternaryMeshCentroids(b),G=TernaryGeometry.ternaryMeshVertices(R),q=R.map(c=>[c.p1,c.p2,c.p3]),W=colorMapping_ColorMapping.colorMapTricolore(q,m,b,w,S,M,k,T);if(group(G,c=>c.id).forEach((c,g)=>{const m=c.map(c=>{const[h,g]=this.ternaryToSvgCoords([c.p1,c.p2,c.p3],N);return`${h},${g}`}).join(" "),b=W[Number(g)-1].rgb,w=Number(g)-1,S=this.triangle.append("polygon").attr("points",m).attr("stroke","none").attr("classIndex",w).attr("class","em-ternary-discrete-polygon");"triangles"===z?S.attr("fill",b):S.attr("fill","#fffefe");const M=h.triangleHandlers;(null==M?void 0:M.mouseover)&&S.on("mouseover",c=>M.mouseover(c,b)),(null==M?void 0:M.mouseout)&&S.on("mouseout",c=>M.mouseout(c))}),this.drawTriangleFrame(N,L,m,I,P,B,z,b),E&&c.length>0){const g="points"===z?colorMapping_ColorMapping.colorMapTricolore(c,m,b,w,S,M,k,T):void 0;this.addDataPoints(c,N,h.dataPointHandlers,I,m,"points"===z?g:void 0,z)}I&&this.addCenterAnnotation(N,m,null!==(g=h.centerLabel)&&void 0!==g?g:"Average value",h.centerAnnotationOffsets)}createSextantPlot(c=[],h={}){var g,m;const{center:b=[1/3,1/3,1/3],values:w=["#FFFF00","#B3DCC3","#01A0C6","#B8B3D8","#F11D8C","#FFB3B3"],showData:S=!0,showCenter:M=!0,showLines:k=!0,labels:T=["p₁","p₂","p₃"],labelPosition:E="corner",colorTarget:I="triangles"}=h;if(6!==w.length)throw new Error("Sextant plot requires exactly 6 color values");const P=this.width-this.margin.left-this.margin.right,L=this.height-this.margin.top-this.margin.bottom,B=Math.min(P,L);this.triangle.selectAll("*").remove(),this.legend.selectAll("*").remove(),this.circles.selectAll("*").remove();if(group(TernaryGeometry.ternarySextantVertices(b),c=>c.id).forEach((c,g)=>{c.sort((c,h)=>c.vertex-h.vertex);const m=c.map(c=>{const[h,g]=this.ternaryToSvgCoords([c.p1,c.p2,c.p3],B);return`${h},${g}`}).join(" "),b=Number(g)-1,S=Number(g)-1,M=this.triangle.append("polygon").attr("points",m).attr("fill",w[b]).attr("stroke","none").attr("data-ecl",S),k=h.triangleHandlers;(null==k?void 0:k.mouseover)&&M.on("mouseover",c=>k.mouseover(c,w[b])),(null==k?void 0:k.mouseout)&&M.on("mouseout",c=>k.mouseout(c))}),this.drawTriangleFrame(B,T,b,M,k,E,I),S&&c.length>0){const m=null!==(g=h.colorTarget)&&void 0!==g?g:"triangles";this.addDataPoints(c,B,h.dataPointHandlers,M,b,void 0,m)}M&&this.addCenterAnnotation(B,b,null!==(m=h.centerLabel)&&void 0!==m?m:"Average value",h.centerAnnotationOffsets)}drawContinuousTriangle(c,h,g,m,b,w,S){if(!this.ctx)return;const M=c,k=this.ctx.createImageData(M,M);for(let c=0;c<M;c++)for(let T=0;T<M;T++){const[E,I,P]=this.svgToTernaryCoords([T,c],M);if(E<0||I<0||P<0||E>1||I>1||P>1)continue;const L=colorMapping_ColorMapping.colorMapTricolore([[E,I,P]],h,100,g,m,b,w,S)[0],B=parseInt(L.rgb.slice(1,3),16),z=parseInt(L.rgb.slice(3,5),16),j=parseInt(L.rgb.slice(5,7),16),D=4*(c*M+T);k.data[D]=B,k.data[D+1]=z,k.data[D+2]=j,k.data[D+3]=255}this.ctx.putImageData(k,0,0)}drawTriangleFrame(c,h,g,m,b,w="corner",S="triangles",M=4){const k=[[1,0,0],[0,1,0],[0,0,1]].map(h=>this.ternaryToSvgCoords(h,c)),T=k.map(c=>c.join(",")).join(" ");if(this.triangle.append("polygon").attr("points",T).attr("fill","none").attr("stroke","black").attr("stroke-width",1),"edge"===w){const c=[[(k[0][0]+k[1][0])/2-35,(k[0][1]+k[1][1])/2-14],[(k[1][0]+k[2][0])/2+35,(k[1][1]+k[2][1])/2-14],[(k[0][0]+k[2][0])/2,(k[0][1]+k[2][1])/2+35]],g=[-60,60,0];h.forEach((h,m)=>{this.legend.append("text").attr("x",c[m][0]).attr("y",c[m][1]).attr("class","em-ternary-axis-title em-legend-label em-ternary-legend-label").attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",`rotate(${g[m]},${c[m][0]},${c[m][1]})`).text(h)})}else{const c=[[k[0][0],k[0][1]+25],[k[1][0],k[1][1]-15],[k[2][0],k[2][1]+25]];h.forEach((h,g)=>{this.legend.append("text").attr("class","em-ternary-axis-title em-legend-label em-ternary-legend-label").attr("x",c[g][0]).attr("y",c[g][1]).attr("text-anchor","middle").text(h)})}const E="number"==typeof M&&M>1?Array.from({length:M-1},(c,h)=>(h+1)/M):[],I=[];for(let c=0;c<E.length;c++){const h=0===c?0:E[c-1],g=(E[c]-h)/5;for(let c=1;c<5;c++)I.push(h+c*g)}const drawGridLine=(h,g,m)=>{const[b,w]=this.ternaryToSvgCoords(h,c),[S,M]=this.ternaryToSvgCoords(g,c);this.legend.append("line").attr("x1",b).attr("y1",w).attr("x2",S).attr("y2",M).attr("stroke","#555").attr("stroke-width",m?1:.2).attr("opacity",m?.4:.25).attr("class",m?"em-ternary-grid-line":"em-ternary-grid-line-minor")};b&&(I.forEach(c=>{drawGridLine([c,0,1-c],[c,1-c,0],!1),drawGridLine([0,c,1-c],[1-c,c,0],!1),drawGridLine([1-c,0,c],[0,1-c,c],!1)}),E.forEach(h=>{const g=[h,0,1-h];drawGridLine(g,[h,1-h,0],!0),this.drawAxisTick(g,[0,-1,1],c);const m=[1-h,h,0];drawGridLine([0,h,1-h],m,!0),this.drawAxisTick(m,[1,0,-1],c);const b=[0,1-h,h];drawGridLine([1-h,0,h],b,!0),this.drawAxisTick(b,[-1,1,0],c)}));const P=this.computeLabelStride(E.length+1),L=E.filter((c,h)=>h%P===0);L.forEach(h=>{const g=[this.ternaryToSvgCoords([h,1-h,0],c),this.ternaryToSvgCoords([h,0,1-h],c)];this.legend.append("text").attr("x",g[0][0]-10).attr("y",g[0][1]+3).attr("text-anchor","end").attr("font-size","10px").attr("class","em-ternary-axis-tick-label").text(`${(100*h).toFixed(0)}%`)}),L.forEach(h=>{const g=[this.ternaryToSvgCoords([0,h,1-h],c),this.ternaryToSvgCoords([1-h,h,0],c)];this.legend.append("text").attr("x",g[0][0]+5).attr("y",g[0][1]-10).attr("text-anchor","start").attr("font-size","10px").attr("class","em-ternary-axis-tick-label").text(`${(100*h).toFixed(0)}%`)}),L.forEach(h=>{const g=[this.ternaryToSvgCoords([1-h,0,h],c),this.ternaryToSvgCoords([0,1-h,h],c)];this.legend.append("text").attr("x",g[0][0]+10).attr("y",g[0][1]+18).attr("text-anchor","middle").attr("font-size","10px").attr("class","em-ternary-axis-tick-label").text(`${(100*h).toFixed(0)}%`)})}computeLabelStride(c){return c<=7?1:c<=10?2:c<=15?3:Math.ceil(c/4)}drawAxisTick(c,h,g,m=8){const[b,w]=this.ternaryToSvgCoords(c,g),S=[c[0]+h[0]*(m/g),c[1]+h[1]*(m/g),c[2]+h[2]*(m/g)],[M,k]=this.ternaryToSvgCoords(S,g);this.legend.append("line").attr("x1",b).attr("y1",w).attr("x2",M).attr("y2",k).attr("stroke-width",1).attr("opacity",.4).attr("class","em-ternary-axis-tick")}addDataPoints(c,h,g,m,b,w,S="triangles"){const M=CompositionUtils.close([...c]);if(CompositionUtils.validateTernaryPoints(M),M.forEach((c,m)=>{if(c){const[b,M]=this.ternaryToSvgCoords(c,h),k="points"===S&&w&&w[m]&&w[m].rgb?w[m].rgb:"black",T=this.circles.append("circle").datum({point:c,index:m}).attr("cx",b).attr("cy",M).attr("r",2).attr("fill",k).attr("opacity","points"===S?1:.7).attr("class","em-ternary-legend-data-point");(null==g?void 0:g.mouseover)&&T.on("mouseover",c=>g.mouseover(c,T.datum())),(null==g?void 0:g.mousemove)&&T.on("mousemove",c=>g.mousemove(c,T.datum())),(null==g?void 0:g.mouseout)&&T.on("mouseout",c=>g.mouseout(c,T.datum()))}}),m){const c=this.ternaryToSvgCoords(b,h),[g,m]=c;[[[b[0],0,1-b[0]],b],[[1-b[1],b[1],0],b],[[0,1-b[2],b[2]],b]].forEach(([c,g],m)=>{const[w,M]=this.ternaryToSvgCoords(c,h),[k,T]=this.ternaryToSvgCoords(g,h);this.circles.append("line").attr("x1",w).attr("y1",M).attr("x2",k).attr("y2",T).attr("stroke","triangles"===S?"white":"#000").attr("stroke-width",1).attr("opacity","triangles"===S?.9:1).attr("class","em-ternary-center-line");const E=Math.round(100*b[m]),I=w,P=M,L=Math.atan2(T-M,k-w)*(180/Math.PI);let B=L;const z=0===m?25:15;let j=z*Math.cos(L*Math.PI/180),D=z*Math.sin(L*Math.PI/180);1===m&&(j+=-5,D+=8),0===m&&(B=L+180,j+=14,D+=10),2===m&&(B=L+180,j+=5,D+=10),this.circles.append("text").attr("x",I+j).attr("y",P+D).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("fill","triangles"===S?"white":"#000").attr("transform",`rotate(${B}, ${I+j}, ${P+D})`).attr("class","em-ternary-center-line-label").text(`${E}%`)}),this.circles.append("circle").attr("cx",g).attr("cy",m).attr("r",3).attr("fill","black").attr("stroke","white").attr("class","em-ternary-center-point")}}addCenterAnnotation(c,h,g="Average value",m={labelX:70,labelY:20,curveX:10,curveY:0}){const[b,w]=this.ternaryToSvgCoords(h,c),S=b+m.labelX,M=35+m.labelY,k=`\n M ${b},${w}\n Q ${b+m.curveX},${w-m.curveY} ${S},${M}\n `,T=this.circles.append("g").attr("class","em-ternary-center-annotation");T.append("path").attr("d",k).attr("fill","none").attr("class","em-ternary-annotation-line"),T.append("text").attr("x",S).attr("y",M-6).attr("class","em-ternary-center-annotation-label").text(g)}ternaryToSvgCoords(c,h){const[g,m]=TernaryGeometry.ternaryToCartesian(c);return[g*h,h-m*h]}svgToTernaryCoords(c,h){return TernaryGeometry.cartesianToTernary(c[0]/h,1-c[1]/h)}}var Jl=null,Ql=function legend(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},g=wl(c);return g.width=160,g.height=160,g.padding={top:50,right:50,bottom:10,left:50},g.type="continuous",g.showCenter=!0,g.centerLabel="Average",g.showLines=!1,g.labels=["Variable 1","Variable 2","Variable 3"],g.labelPosition="edge",g.colorTarget="points",g.showData=!0,g.centerAnnotationOffsets={labelX:70,labelY:10,curveX:-20,curveY:-20},Object.assign(g,h),g.update=function(){return g.updateConfig(),g.updateContainer(),g.lgg.node()?(g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle(),function drawTricoloreLegend(){var h=g.getBaseY(),m=g.getBaseX(),b=g.lgg.append("g").attr("class","em-ternary-legend").attr("transform","translate(".concat(m,",").concat(h,")"));b.selectAll("*").remove();var w=b.append("foreignObject").attr("x",0).attr("y",0).attr("width",g.width).attr("height",g.height).append("xhtml:div").style("width","".concat(g.width,"px")).style("height","".concat(g.height,"px")),S=new TricoloreViz(w.node(),g.width,g.height,g.padding),M={center:c._ternaryCenter_,hue:c.ternarySettings_.hue,chroma:c.ternarySettings_.chroma,lightness:c.ternarySettings_.lightness,contrast:c.ternarySettings_.contrast,spread:c.ternarySettings_.spread,labels:g.labels,labelPosition:g.labelPosition,showCenter:g.showCenter,centerLabel:g.centerLabel,showLines:g.showLines,breaks:c.ternarySettings_.breaks,colorTarget:g.colorTarget,showData:g.showData,centerAnnotationOffsets:g.centerAnnotationOffsets,dataPointHandlers:{mouseover:function mouseover(h,g){var m=src_select(h.currentTarget);Jl&&Jl.node()!==m.node()&&Jl.attr("stroke",null).attr("stroke-width",null).lower(),Jl=m,g.index,highlightRegionsByClass(c,g.index),c.insetTemplates_&&Bt(c.insetTemplates_,c.svgId,highlightRegionsByClass,g.index);var b,w=function getRegionByClassIndex(c,h){var g,m,b=c._ternaryIdByClass_?c._ternaryIdByClass_.get(h):null===(g=toConsumableArray_toConsumableArray(c._ternaryClassById_.entries()).find(function(c){return slicedToArray_slicedToArray(c,2)[1]===h}))||void 0===g?void 0:g[0];return b&&(null===(m=c.Geometries.getRegionFeatures())||void 0===m?void 0:m.find(function(c){return c.properties.id===b}))||null}(c,g.index);w&&(null===(b=c._tooltip)||void 0===b||b.mouseover(c.tooltip_.textFunction(w,c)));m.attr("stroke","red").attr("stroke-width",2).raise()},mousemove:function mousemove(h){var g;null===(g=c._tooltip)||void 0===g||g.mousemove(h)},mouseout:function mouseout(h){var g,m=src_select(h.currentTarget);Jl&&Jl.node()===m.node()&&(m.attr("stroke",null).attr("stroke-width",null).lower(),Jl=null,resetRegions(c),c.insetTemplates_&&Bt(c.insetTemplates_,c.svgId,resetRegions),null===(g=c._tooltip)||void 0===g||g.mouseout())}},triangleHandlers:{mouseover:function mouseover(h,g){var m=src_select(h.currentTarget);Jl&&Jl.node()!==m.node()&&Jl.attr("stroke",null).attr("stroke-width",null).lower(),Jl=m,highlightRegionsByColor(c,g),c.insetTemplates_&&Bt(c.insetTemplates_,c.svgId,highlightRegionsByColor,g),m.attr("stroke","red").attr("stroke-width",2).raise()},mouseout:function mouseout(h){var g=src_select(h.currentTarget);Jl&&Jl.node()===g.node()&&(g.attr("stroke",null).attr("stroke-width",null).lower(),Jl=null,resetRegions(c),c.insetTemplates_&&Bt(c.insetTemplates_,c.svgId,resetRegions))}}};c.ternarySettings_.breaks<30?S.createDiscretePlot(c._ternaryData_,M):S.createContinuousPlot(c._ternaryData_,M)}(),g.setBoxDimension(),g):g},g};function highlightRegionsByClass(c,h){var g=jt(c);c.svg_.selectAll(g).selectAll("[ecl]").each(function(){var c=src_select(this),g=+c.attr("ecl");c.style("opacity",g===h?1:.15)})}function highlightRegionsByColor(c,h){var g=jt(c),m=c.svg_.selectAll(g).selectAll("[ecl]"),b=normalizeColor(h);m.each(function(){var c=src_select(this),h=normalizeColor(c.attr("fill___"));c.style("opacity",h===b?1:.15)})}function resetRegions(c){var h=jt(c);c.svg_.selectAll(h).selectAll("[ecl]").style("opacity",1)}function normalizeColor(c){if(!c)return null;var h=document.createElement("canvas").getContext("2d");return h.fillStyle=c,h.fillStyle.toLowerCase()}function map_choropleth_trivariate_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function map_choropleth_trivariate_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?map_choropleth_trivariate_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):map_choropleth_trivariate_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}var tc=function map(c){var h=Ml(c,!1,"chtri");h.ternaryCodes_=["v1","v2","v3"],h.noDataFillStyle_="#ccc",h.ternarySettings_={hue:10,chroma:120,lightness:70,contrast:.2,spread:.8,breaks:5,meanCentering:!0},h._ternaryColors_=null,h._ternaryData_=null,h._ternaryCenter_=null,h.tooltip_.textFunction=ec;var g=["ternaryCodes_","noDataFillStyle_","ternarySettings_"];function regionsFillFunction(c){var g=c.properties.id,m=h._ternaryColorById_.get(g),b=h._ternaryClassById_.get(g);return src_select(this).attr("ecl",null!=b?b:null),null!=m?m:tc.noDataFillStyle_}function styleRegions(c){if(c.svg()&&c._ternaryColorById_){var g=zt(c),m=c.svg().selectAll(g);m.style("pointer-events","none").transition().duration(h.transitionDuration()).style("fill",regionsFillFunction).end().then(function(){m.style("pointer-events",null),m.each(function(){var c=src_select(this);c.attr("fill___",c.style("fill"))}),addMouseEventsToRegions(c,m),h.gridCartogram_&&c.svg().selectAll(".em-grid-text").each(function(){var c=src_select(this.parentNode).style("fill");src_select(this).attr("fill",getTextColorForBackground(c))})}).catch(function(c){})}}function addMouseEventsToRegions(c,g){var m=function shouldOmit(h){var g;return null===(g=c.tooltip_.omitRegions)||void 0===g?void 0:g.includes(h)};g.on("mouseover",function(g,b){m(b.properties.id)||(src_select(this).style("fill",c.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(b,h)),h.onRegionMouseOver_&&h.onRegionMouseOver_(g,b,this,c))}).on("mousemove",function(g,b){m(b.properties.id)||(h._tooltip&&h._tooltip.mousemove(g),h.onRegionMouseMove_&&h.onRegionMouseMove_(g,b,this,c))}).on("mouseout",function(g,b){if(!m(b.properties.id)){var w=src_select(this);w.style("fill",w.attr("fill___")),h._tooltip&&h._tooltip.mouseout(),h.onRegionMouseOut_&&h.onRegionMouseOut_(g,b,this,c)}})}return g.forEach(function(c){var g=c.slice(0,-1);h[g]=function(g){return arguments.length?("ternarySettings_"===c?h.ternarySettings_=map_choropleth_trivariate_objectSpread(map_choropleth_trivariate_objectSpread({},h.ternarySettings_),g):h[c]=g,h):h[c]}}),c&&g.forEach(function(g){var m=g.slice(0,-1);null!=c[m]&&h[m](c[m])}),h.updateClassification=function(){h._ternaryData_=[],h._ternaryColorById_=new Map,h._ternaryCenter_=null;var c=h.Geometries.getRegionFeatures();if(!c||0===c.length)return h;var g=slicedToArray_slicedToArray(h.ternaryCodes_,3),m=g[0],b=g[1],w=g[2],S=[],M=h.statData(m),k=h.statData(b),T=h.statData(w);c.forEach(function(c){var h=c.properties.id,g=M.get(h),m=k.get(h),b=T.get(h),w=+(null==g?void 0:g.value),E=+(null==m?void 0:m.value),I=+(null==b?void 0:b.value);Number.isFinite(w)&&Number.isFinite(E)&&Number.isFinite(I)&&w+E+I>0&&S.push({id:h,values:[w,E,I]})}),h._ternaryData_=S.map(function(c){return c.values}),h._ternaryCenter_=h.ternarySettings_.meanCentering?CompositionUtils.centre(h._ternaryData_):[1/3,1/3,1/3];var E=function tricolore(c,h={}){const{center:g=[1/3,1/3,1/3],breaks:m=4,hue:b=80,chroma:w=140,lightness:S=80,contrast:M=.4,spread:k=1}=h;return colorMapping_ColorMapping.colorMapTricolore(c,g,m,b,w,S,M,k).map(c=>c.rgb)}(h._ternaryData_,{center:h._ternaryCenter_,breaks:h.ternarySettings_.breaks,hue:h.ternarySettings_.hue,chroma:h.ternarySettings_.chroma,lightness:h.ternarySettings_.lightness,contrast:h.ternarySettings_.contrast,spread:h.ternarySettings_.spread});return h._ternaryColorById_=new Map,h._ternaryClassById_=new Map,S.forEach(function(c,g){var m=E[g];null!=m&&(h._ternaryColorById_.set(c.id,m),h._ternaryClassById_.set(c.id,g))}),h},h.updateStyle=function(){return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,styleRegions),styleRegions(h),addMouseEventsToRegions(h,h.svg().selectAll(zt(h))),h},h.getLegendConstructor=function(){return Ql},h},ec=function tooltipTextFunctionTrivariate(c,h){var g=[],m=c.properties.na||"",b=c.properties.id||"";g.push('<div class="em-tooltip-bar">'.concat(m).concat(b?" (".concat(b,")"):"","</div>"));var w=slicedToArray_slicedToArray(h.ternaryCodes_,3),S=w[0],M=w[1],k=w[2],T=h.statData(S).get(b),E=h.statData(M).get(b),I=h.statData(k).get(b),P=h.statData(S).unitText()||h.statData(M).unit_||h.statData(k).unit_||"";return g.push('<div class="em-tooltip-text" style="background:#fff;color:#171a22;padding:4px;font-size:15px;">\n <table class="em-tooltip-table"><tbody>\n <tr><td>'.concat(h.statData(S).label_||S,": ").concat(null!=T&&T.value?Ft(T.value)+P:"","</td></tr>\n <tr><td>").concat(h.statData(M).label_||M,": ").concat(null!=E&&E.value?Ft(E.value)+P:"","</td></tr>\n <tr><td>").concat(h.statData(k).label_||k,": ").concat(null!=I&&I.value?Ft(I.value)+P:"","</td></tr>\n </tbody></table></div>")),g.join("")};function src_descending(c,h){return h<c?-1:h>c?1:h>=c?0:NaN}function d3_shape_src_identity(c){return c}function src_pie(){var c=d3_shape_src_identity,h=src_descending,g=null,m=node_modules_d3_shape_src_constant(0),b=node_modules_d3_shape_src_constant(rl),w=node_modules_d3_shape_src_constant(0);function pie(S){var M,k,T,E,I,P=(S=d3_shape_src_array(S)).length,L=0,B=new Array(P),z=new Array(P),j=+m.apply(this,arguments),D=Math.min(rl,Math.max(-rl,b.apply(this,arguments)-j)),N=Math.min(Math.abs(D)/P,w.apply(this,arguments)),R=N*(D<0?-1:1);for(M=0;M<P;++M)(I=z[B[M]=M]=+c(S[M],M,S))>0&&(L+=I);for(null!=h?B.sort(function(c,g){return h(z[c],z[g])}):null!=g&&B.sort(function(c,h){return g(S[c],S[h])}),M=0,T=L?(D-P*R)/L:0;M<P;++M,j=E)k=B[M],E=j+((I=z[k])>0?I*T:0)+R,z[k]={data:S[k],index:M,value:I,startAngle:j,endAngle:E,padAngle:N};return z}return pie.value=function(h){return arguments.length?(c="function"==typeof h?h:node_modules_d3_shape_src_constant(+h),pie):c},pie.sortValues=function(c){return arguments.length?(h=c,g=null,pie):h},pie.sort=function(c){return arguments.length?(g=c,h=null,pie):g},pie.startAngle=function(c){return arguments.length?(m="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),pie):m},pie.endAngle=function(c){return arguments.length?(b="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),pie):b},pie.padAngle=function(c){return arguments.length?(w="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),pie):w},pie}function arc_arcInnerRadius(c){return c.innerRadius}function arc_arcOuterRadius(c){return c.outerRadius}function arc_arcStartAngle(c){return c.startAngle}function arc_arcEndAngle(c){return c.endAngle}function arc_arcPadAngle(c){return c&&c.padAngle}function arc_cornerTangents(c,h,g,m,b,w,S){var M=c-g,k=h-m,T=(S?w:-w)/Qs(M*M+k*k),E=T*k,I=-T*M,P=c+E,L=h+I,B=g+E,z=m+I,j=(P+B)/2,D=(L+z)/2,N=B-P,R=z-L,G=N*N+R*R,q=b-w,W=P*z-B*L,H=(R<0?-1:1)*Qs(Ks(0,q*q*G-W*W)),U=(W*R-N*H)/G,Y=(-W*N-R*H)/G,V=(W*R+N*H)/G,$=(-W*N+R*H)/G,X=U-j,K=Y-D,Z=V-j,J=$-D;return X*X+K*K>Z*Z+J*J&&(U=V,Y=$),{cx:U,cy:Y,x01:-E,y01:-I,x11:U*(b/q-1),y11:Y*(b/q-1)}}function src_arc(){var c=arc_arcInnerRadius,h=arc_arcOuterRadius,g=node_modules_d3_shape_src_constant(0),m=null,b=arc_arcStartAngle,w=arc_arcEndAngle,S=arc_arcPadAngle,M=null,k=withPath(arc);function arc(){var T,E,I=+c.apply(this,arguments),P=+h.apply(this,arguments),L=b.apply(this,arguments)-nl,B=w.apply(this,arguments)-nl,z=Vs(B-L),j=B>L;if(M||(M=T=k()),P<I&&(E=P,P=I,I=E),P>tl)if(z>rl-tl)M.moveTo(P*Xs(L),P*Js(L)),M.arc(0,0,P,L,B,!j),I>tl&&(M.moveTo(I*Xs(B),I*Js(B)),M.arc(0,0,I,B,L,j));else{var D,N,R=L,G=B,q=L,W=B,H=z,U=z,Y=S.apply(this,arguments)/2,V=Y>tl&&(m?+m.apply(this,arguments):Qs(I*I+P*P)),$=Zs(Vs(P-I)/2,+g.apply(this,arguments)),X=$,K=$;if(V>tl){var Z=d3_shape_src_math_asin(V/I*Js(Y)),J=d3_shape_src_math_asin(V/P*Js(Y));(H-=2*Z)>tl?(q+=Z*=j?1:-1,W-=Z):(H=0,q=W=(L+B)/2),(U-=2*J)>tl?(R+=J*=j?1:-1,G-=J):(U=0,R=G=(L+B)/2)}var Q=P*Xs(R),tt=P*Js(R),et=I*Xs(W),nt=I*Js(W);if($>tl){var rt,ot=P*Xs(G),at=P*Js(G),it=I*Xs(q),st=I*Js(q);if(z<el)if(rt=function arc_intersect(c,h,g,m,b,w,S,M){var k=g-c,T=m-h,E=S-b,I=M-w,P=I*k-E*T;if(!(P*P<tl))return[c+(P=(E*(h-w)-I*(c-b))/P)*k,h+P*T]}(Q,tt,it,st,ot,at,et,nt)){var lt=Q-rt[0],ct=tt-rt[1],ut=ot-rt[0],ht=at-rt[1],dt=1/Js(function d3_shape_src_math_acos(c){return c>1?0:c<-1?el:Math.acos(c)}((lt*ut+ct*ht)/(Qs(lt*lt+ct*ct)*Qs(ut*ut+ht*ht)))/2),pt=Qs(rt[0]*rt[0]+rt[1]*rt[1]);X=Zs($,(I-pt)/(dt-1)),K=Zs($,(P-pt)/(dt+1))}else X=K=0}U>tl?K>tl?(D=arc_cornerTangents(it,st,Q,tt,P,K,j),N=arc_cornerTangents(ot,at,et,nt,P,K,j),M.moveTo(D.cx+D.x01,D.cy+D.y01),K<$?M.arc(D.cx,D.cy,K,$s(D.y01,D.x01),$s(N.y01,N.x01),!j):(M.arc(D.cx,D.cy,K,$s(D.y01,D.x01),$s(D.y11,D.x11),!j),M.arc(0,0,P,$s(D.cy+D.y11,D.cx+D.x11),$s(N.cy+N.y11,N.cx+N.x11),!j),M.arc(N.cx,N.cy,K,$s(N.y11,N.x11),$s(N.y01,N.x01),!j))):(M.moveTo(Q,tt),M.arc(0,0,P,R,G,!j)):M.moveTo(Q,tt),I>tl&&H>tl?X>tl?(D=arc_cornerTangents(et,nt,ot,at,I,-X,j),N=arc_cornerTangents(Q,tt,it,st,I,-X,j),M.lineTo(D.cx+D.x01,D.cy+D.y01),X<$?M.arc(D.cx,D.cy,X,$s(D.y01,D.x01),$s(N.y01,N.x01),!j):(M.arc(D.cx,D.cy,X,$s(D.y01,D.x01),$s(D.y11,D.x11),!j),M.arc(0,0,I,$s(D.cy+D.y11,D.cx+D.x11),$s(N.cy+N.y11,N.cx+N.x11),j),M.arc(N.cx,N.cy,X,$s(N.y11,N.x11),$s(N.y01,N.x01),!j))):M.arc(0,0,I,W,q,j):M.lineTo(et,nt)}else M.moveTo(0,0);if(M.closePath(),T)return M=null,T+""||null}return arc.centroid=function(){var g=(+c.apply(this,arguments)+ +h.apply(this,arguments))/2,m=(+b.apply(this,arguments)+ +w.apply(this,arguments))/2-el/2;return[Xs(m)*g,Js(m)*g]},arc.innerRadius=function(h){return arguments.length?(c="function"==typeof h?h:node_modules_d3_shape_src_constant(+h),arc):c},arc.outerRadius=function(c){return arguments.length?(h="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),arc):h},arc.cornerRadius=function(c){return arguments.length?(g="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),arc):g},arc.padRadius=function(c){return arguments.length?(m=null==c?null:"function"==typeof c?c:node_modules_d3_shape_src_constant(+c),arc):m},arc.startAngle=function(c){return arguments.length?(b="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),arc):b},arc.endAngle=function(c){return arguments.length?(w="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),arc):w},arc.padAngle=function(c){return arguments.length?(S="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),arc):S},arc.context=function(c){return arguments.length?(M=null==c?null:c,arc):M},arc}const nc=colors("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");var rc=function legend(c,h){var g=wl(c);if(h)for(var m in h)g[m]=h[m];function highlightRegions(c,h){c.svg_.selectAll("pattern").selectAll("rect").each(function(){var c=src_select(this);c.attr("data-original-fill")||c.attr("data-original-fill",c.style("fill")),c.style("fill","white")}),c.svg_.selectAll("pattern").selectAll("rect[code='"+h+"']").each(function(){var c=src_select(this);c.style("fill",c.attr("data-original-fill"))})}function unhighlightRegions(c){c.svg_.selectAll("pattern").selectAll("rect").each(function(){var c=src_select(this),h=c.attr("data-original-fill");h&&c.style("fill",h)})}return g.update=function(){g.updateConfig(),g.updateContainer();var c=g.map,h=c.svg(),m=g.lgg;m.selectAll("*").remove(),g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle();var b=0,w=c.catColors(),S=function _loop(S){var M=g.boxPadding+(g.title?g.titleFontSize+g.boxPadding:0)+b*(g.shapeHeight+g.shapePadding);c.catColors()[S];m.append("rect").attr("class","em-legend-rect").attr("x",g.boxPadding).attr("y",M).attr("width",g.shapeWidth).attr("height",g.shapeHeight).style("fill",w[S]).attr("stroke","black").attr("stroke-width",.5).on("mouseover",function(){src_select(this).raise(),highlightRegions(g.map,S),g.map.insetTemplates_&&Bt(g.map.insetTemplates_,g.map.svgId,highlightRegions,S)}).on("mouseout",function(){unhighlightRegions(g.map),g.map.insetTemplates_&&Bt(g.map.insetTemplates_,g.map.svgId,unhighlightRegions)}),m.append("text").attr("class","em-legend-label").attr("x",g.boxPadding+g.shapeWidth+g.labelOffsets.x).attr("y",M+.5*g.shapeHeight).attr("dy","0.35em").text(c.catLabels()[S]||S).on("mouseover",function(){h.selectAll("pattern").selectAll("rect[code='"+S+"']").style("fill",c.hoverColor())}).on("mouseout",function(){var g=c.catColors()[S]||"lightgray";h.selectAll("pattern").selectAll("rect[code='"+S+"']").style("fill",g)}),b++};for(var M in w)S(M);if(g.noData){var k=g.boxPadding+(g.title?g.titleFontSize+g.boxPadding:0)+b*(g.shapeHeight+g.shapePadding);m.append("rect").attr("class","em-legend-rect").attr("x",g.boxPadding).attr("y",k).attr("width",g.shapeWidth).attr("height",g.shapeHeight).style("fill",c.noDataFillStyle()).on("mouseover",function(){h.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",c.hoverColor()),src_select(this).style("fill",c.hoverColor())}).on("mouseout",function(){h.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",function(h){c.noDataFillStyle()});src_select(this).style("fill",c.noDataFillStyle())}),m.append("text").attr("class","em-legend-label").attr("x",g.boxPadding+g.shapeWidth+g.labelOffsets.x).attr("y",k+.5*g.shapeHeight).text(g.noDataText).on("mouseover",function(){h.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",c.hoverColor())}).on("mouseout",function(){h.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",function(h){c.noDataFillStyle()})})}g.setBoxDimension()},g};function map_stripe_composition_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function map_stripe_composition_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return map_stripe_composition_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?map_stripe_composition_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function map_stripe_composition_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function map_stripe_composition_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function map_stripe_composition_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?map_stripe_composition_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):map_stripe_composition_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}var oc=function legend(c,h){var g=wl(c);if(g.sizeLegend={title:null,titlePadding:10,values:null,labelFormatter:void 0,noData:!1,noDataText:"No data"},g.colorLegend={title:null,titlePadding:10,marginTop:33,labelOffsets:{x:5,y:5},shapeWidth:25,shapeHeight:20,shapePadding:1,noData:!0,noDataText:"No data"},g._sizeLegendHeight=0,h)for(var m in h)if("colorLegend"==m||"sizeLegend"==m){for(var b in g[m])void 0!==h[m][b]&&(g[m][b]=h[m][b]);0==h.colorLegend&&(g.colorLegend=!1)}else g[m]=h[m];function highlightRegions(c,h){var g=c.svg_.selectAll(".piechart").selectAll("path[code]");g.style("opacity",0),g.filter("path[code='"+h+"']").each(function(){src_select(this).style("opacity",1)})}function unhighlightRegions(c){c.svg_.selectAll(".piechart").selectAll("path[code]").each(function(){src_select(this).style("opacity",1)})}return g.update=function(){g.updateConfig(),g.updateContainer();var c=g.map,h=g.lgg;h.selectAll("*").remove(),g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle();var m=g.getBaseY(),b=g.getBaseX();c.classifierSize_&&(g._sizeLegendContainer=h.append("g").attr("class","em-pie-size-legend").attr("transform","translate(".concat(b,", ").concat(m,")")),drawCircleSizeLegend(g,g._sizeLegendContainer,g.sizeLegend.values,c.classifierSize_,g.sizeLegend.title,g.sizeLegend.titlePadding)),function buildColorLegend(c,h,g){var m=c.map,b=c.colorLegend;if(c._colorLegendContainer=c.lgg.append("g").attr("class","em-pie-color-legend"),c._sizeLegendContainer){var w=c._sizeLegendContainer.node().getBBox().height;c._colorLegendContainer.attr("transform","translate(".concat(h,",").concat(w+c.colorLegend.marginTop,")"))}else c._colorLegendContainer.attr("transform","translate(".concat(h,",").concat(g,")"));b.title&&c._colorLegendContainer.append("text").attr("id","em-color-legend-title").attr("class","em-color-legend-title").attr("x",0).attr("y",c.titleFontSize).text(b.title);var S=0,M=m.catColors(),k=function _loop(h){var g=c.colorLegend.titlePadding+(b.title?c.titleFontSize:0)+S*(b.shapeHeight+b.shapePadding);m.catColors()[h];c._colorLegendContainer.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",g).attr("width",b.shapeWidth).attr("height",b.shapeHeight).style("fill",M[h]).on("mouseover",function(){highlightRegions(c.map,h),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,highlightRegions,h)}).on("mouseout",function(){unhighlightRegions(c.map),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,unhighlightRegions,h)}),c._colorLegendContainer.append("text").attr("class","em-legend-label").attr("x",b.shapeWidth+b.labelOffsets.x).attr("y",g+.5*b.shapeHeight).attr("dy","0.35em").text(m.catLabels()[h]||h),S++};for(var T in M)k(T);if(b.noData){var E=0;c._sizeLegendContainer&&(E=c._sizeLegendContainer.node().getBBox().height);var I=E+c.colorLegend.marginTop+c.boxPadding+(b.title?c.titleFontSize+c.boxPadding:0)+S*(b.shapeHeight+b.shapePadding),P=c.lgg.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(c.boxPadding,",").concat(I,")"));c.appendNoDataLegend(P,c.noDataText,highlightRegions,unhighlightRegions)}}(g,b,m),g.setBoxDimension()},g};function map_pie_charts_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function map_pie_charts_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return map_pie_charts_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?map_pie_charts_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function map_pie_charts_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function map_pie_charts_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function map_pie_charts_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?map_pie_charts_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):map_pie_charts_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}var ac=function map(c){var h=Ml(c,!0,"pie");h.dorling_=(null==c?void 0:c.dorling)||!1,h.animateDorling_=!0,h.pieMinRadius_=5,h.pieMaxRadius_=15,h.pieChartInnerRadius_=0,h.pieStrokeFill_="white",h.pieStrokeWidth_=.3,h.tooltipPieRadius_=40,h.tooltipPieInnerRadius_=0,h.catColors_=void 0,h.catLabels_=void 0,h.pieOtherColor_="#FFCC80",h.pieOtherText_="Other",h.showOnlyWhenComplete_=!1,h.classifierSize_=null,h.statPie_=null,h.pieTotalCode_=void 0,h.statCodes_=void 0,["catColors_","catLabels_","showOnlyWhenComplete_","noDataFillStyle_","pieMaxRadius_","pieMinRadius_","pieChartInnerRadius_","pieOtherColor_","pieOtherText_","pieStrokeFill_","pieStrokeWidth_","dorling_","animateDorling_","pieTotalCode_","statCodes_"].forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&["catColors","catLabels","showOnlyWhenComplete","noDataFillStyle","pieMaxRadius","pieMinRadius","pieChartInnerRadius","pieOtherColor","pieOtherText","pieStrokeFill","pieStrokeWidth","statCodes"].forEach(function(g){null!=c[g]&&h[g](c[g])}),h.statPie=function(c,g,m,b,w,S){void 0!==g&&"string"==typeof g&&(c=map_pie_charts_objectSpread(map_pie_charts_objectSpread({},c),{},{categoryParameter:g,categoryCodes:m,categoryLabels:b,categoryColors:w,totalCode:S})),c.stat&&delete(c=map_pie_charts_objectSpread(map_pie_charts_objectSpread({},c.stat),c)).stat;var M=c,k=M.eurostatDatasetCode,T=M.filters,E=M.unitText,I=M.categoryParameter,P=M.categoryCodes,L=M.categoryLabels,B=M.categoryColors,z=M.totalCode;if(!k)return console.error("statPie: eurostatDatasetCode is required"),h;if(!I)return console.error("statPie: categoryParameter is required"),h;if(!P||!P.length)return console.error("statPie: categoryCodes array is required"),h;for(var j=T?map_pie_charts_objectSpread({},T):{},D=0;D<P.length;D++){var N=P[D],R={eurostatDatasetCode:k,unitText:E,filters:map_pie_charts_objectSpread(map_pie_charts_objectSpread({},j),{},_defineProperty({},I,N))};h.stat(N,R),B&&B[D]&&(h.catColors_=h.catColors_||{},h.catColors_[N]=B[D]),L&&L[D]&&(h.catLabels_=h.catLabels_||{},h.catLabels_[N]=L[D])}if(h.statCodes_=P,z){h.pieTotalCode_=z;var G={eurostatDatasetCode:k,unitText:E,filters:map_pie_charts_objectSpread(map_pie_charts_objectSpread({},j),{},_defineProperty({},I,z))};h.stat(z,G)}else h.pieTotalCode_=void 0;return h},h.updateClassification=function(){return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,g),g(h),h};var g=function applyClassificationToMap(c){if(!h.statCodes_){h.statCodes_=Object.keys(h.statData_);var g=h.statCodes_.indexOf("default");g>-1&&h.statCodes_.splice(g,1)}var m=function getDatasetMaxMin(c){var g,m=[];g=c&&c.gridCartogram_?getPieAnchors(c).data():h.getCentroidsGroup(h).selectAll("g.em-centroid").data();return g.forEach(function(c){var h=c.properties.id,g=b(h);g&&m.push(g)}),function extent_extent(c,h){let g,m;if(void 0===h)for(const h of c)null!=h&&(void 0===g?h>=h&&(g=m=h):(g>h&&(g=h),m<h&&(m=h)));else{let b=-1;for(let w of c)null!=(w=h(w,++b,c))&&(void 0===g?w>=w&&(g=m=w):(g>w&&(g=w),m<w&&(m=w)))}return[g,m]}(m)}(c);return isNaN(m[0])||(h.classifierSize_=pow_sqrt().domain(m).range([h.pieMinRadius_,h.pieMaxRadius_])),h};function getPieAnchors(c){return c.gridCartogram_?c.svg().selectAll("#em-grid-container .em-grid-cell"):c.getCentroidsGroup(c).selectAll("g.em-centroid")}function applyStyleToMap(c){if(h.svg_)if(c.gridCartogram_)!function applyStyleToGridCartogram(c){var g=[],w=getPieAnchors(c);w.attr("id",function(c){return g.push(c.properties.id),"pie_"+c.properties.id}),function addPieChartsToGridCartogram(c,g){c.forEach(function(c){var g=h.svg().select("#pie_"+c);if(!g.empty()){var w=m(c);if(w){var S=[];for(var M in w)S.push({code:M,value:w[M]});if(S&&0!==S.length){g.selectAll(".em-pie").remove();var k=g.node().getBBox(),T="hexagon"==h.gridCartogramShape_?0:k.width/2,E="hexagon"==h.gridCartogramShape_?0:k.height/2,I=h.classifierSize_(b(c)),P=h.pieChartInnerRadius_,L=g.append("g").attr("id","piechart_"+c).attr("class","em-pie").attr("transform","translate(".concat(T,", ").concat(E,")")),B=src_pie().sort(null).value(function(c){return c.value}),z=src_arc().innerRadius(P).outerRadius(I),j=L.append("g").attr("class","piechart").attr("stroke",h.pieStrokeFill_).attr("stroke-width",h.pieStrokeWidth_+"px"),D=B(S);j.selectAll("path").data(D).join("path").attr("fill",function(c){return h.catColors_[c.data.code]||"lightgray"}).attr("code",function(c){return c.data.code}).each(function(c){this._current={startAngle:c.startAngle,endAngle:c.startAngle}}).transition().delay(function(c,h){return 150*h}).duration(h.transitionDuration_).attrTween("d",function(c){var h=value(this._current,c);return this._current=h(1),function(c){return z(h(c))}});var N=g.select(".em-grid-shape, .em-grid-rect, .em-grid-hexagon").node();N&&N.nextSibling&&g.node().insertBefore(L.node(),N.nextSibling)}}}}),adjustGridCartogramTextLabels({map:g,getAnchors:getPieAnchors,getRadius:function getRadius(c){var g=b(c);return g?h.classifierSize_(g):0}})}(g,c),function addMouseEventsToGridCartogram(c){var g=h.svg().selectAll("#em-grid-container .em-grid-cell .em-grid-shape"),m=h.svg().selectAll("#em-grid-container .em-grid-cell .em-pie"),w=function getRegionData(c){return src_select(c.closest(".em-grid-cell")).datum()},S=function getShapeForCell(c){return c.select(".em-grid-shape")},M=function getChartForCell(c){return c.select(".piechart")},k=function handleMouseOver(c){var g=w(this);if(g){var m=g.properties.id;if(b(m)){var k=src_select(this.closest(".em-grid-cell")),T=S(k),E=M(k);T.attr("fill___",T.style("fill")),T.style("fill",h.hoverColor_),E.empty()||E.style("stroke-width",h.pieStrokeWidth_+1).style("stroke","black"),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(g,h))}}},T=function handleMouseMove(c){var g=w(this);if(g){var m=g.properties.id;b(m)&&h._tooltip&&h._tooltip.mousemove(c)}},E=function handleMouseOut(c){var g=w(this);if(g){var m=g.properties.id;if(b(m)){var k=src_select(this.closest(".em-grid-cell")),T=S(k),E=M(k);T.style("fill",T.attr("fill___")||""),T.attr("fill___",null),E.empty()||E.style("stroke-width",h.pieStrokeWidth_).style("stroke",h.pieStrokeFill_),h._tooltip&&h._tooltip.mouseout()}}};g.on("mouseover",k).on("mousemove",T).on("mouseout",E),m.style("pointer-events","all").on("mouseover",k).on("mousemove",T).on("mouseout",E)}()}(c);else{var g=[],w=c.getCentroidsGroup(c);if(w){w.selectAll("g.em-centroid").append("g").attr("class","em-pie").attr("id",function(c){return g.push(c),"pie_"+c.properties.id});var S=zt(h),M=h.svg().selectAll(S);"WORLD"!==c.geo_&&"mixed"==c.nutsLevel_&&function styleMixedNUTSRegions(c,h){h.each(function(h){var g=src_select(this);if(!this.parentNode.classList.contains("em-cntrg")){var b=g.attr("lvl"),w=m(h.properties.id),S=w?"WORLD"===c.geo_?"block":null:"none",M=null,k=null;w&&"0"!==b&&(M=g.style("stroke")||"#777","WORLD"===c.geo_&&(k=g.style("stroke-width")||"#777")),g.style("display",S).style("stroke",M).style("stroke-width",k)}})}(c,M),function addPieChartsToMap(c){c.forEach(function(c){var g=c.properties.id,w=[],S=m(g);for(var M in S)w.push({code:M,value:S[M]});if(w&&0!=w.length){var k=h.svg().selectAll("#pie_"+g),T=h.classifierSize_(b(g)),E=h.pieChartInnerRadius_,I=src_pie().sort(null).value(function(c){return c.value}),P=src_arc().innerRadius(E).outerRadius(T),L=k.append("g").attr("class","piechart").attr("stroke",h.pieStrokeFill_).attr("stroke-width",h.pieStrokeWidth_+"px").style("pointer-events","none"),B=I(w);L.selectAll("path").data(B).join("path").attr("fill",function(c){return h.catColors_[c.data.code]||"lightgray"}).attr("code",function(c){return c.data.code}).each(function(c){this._current={startAngle:c.startAngle,endAngle:c.startAngle}}).transition().delay(function(c,h){return 150*h}).duration(h.transitionDuration_).attrTween("d",function(c){var h=value(this._current,c);return this._current=h(1),function(c){return P(h(c))}}).on("end",function(){src_select(L.node()).style("pointer-events",null)});L.on("mouseover",function(c,g){src_select(this).style("stroke-width",h.pieStrokeWidth_+1).style("stroke","black"),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(g,h))}).on("mousemove",function(c){h._tooltip&&h._tooltip.mousemove(c)}).on("mouseout",function(){src_select(this).style("stroke-width",h.pieStrokeWidth_).style("stroke",h.pieStrokeFill_),h._tooltip&&h._tooltip.mouseout()})}})}(g),function addMouseEventsToRegions(c,g){g.on("mouseover",function(c,g){var m=src_select(this);m.attr("fill___",m.style("fill")),m.style("fill",h.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(g,h))}).on("mousemove",function(c,g){h._tooltip&&h._tooltip.mousemove(c)}).on("mouseout",function(){var c=src_select(this);c.attr("fill___")&&(c.style("fill",c.attr("fill___")),h._tooltip&&h._tooltip.mouseout())})}(0,M)}}}h.updateStyle=function(){try{if(!h.classifierSize_)return;if(!h.catColors_){h.catColors({});for(var c=0;c<h.statCodes_.length;c++)h.catColors_[h.statCodes_[c]]=nc[c%10]}return h.pieTotalCode_&&(h.catColors_.other=h.pieOtherColor_,h.catLabels_.other=h.pieOtherText_),h.catLabels_=h.catLabels_||{},h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyStyleToMap),applyStyleToMap(h),h.dorling_&&!h.gridCartogram_?runDorlingSimulation(h,function(c){var g=b(c.properties.id)||0;return h.classifierSize_(g)||0}):stopDorlingSimulation(h),h}catch(c){console.error("Error in pie symbols styling: "+c.message),console.error(c)}};var m=function getComposition(c){for(var g={},m=0,b=h.statCodes_,w=0;w<b.length;w++){var S=b[w],M=h.statData(S).get(c),k=null==M?void 0:M.value;if(null==k||isNaN(k)){if(h.showOnlyWhenComplete())return}else g[S]=k,m+=k}if(h.pieTotalCode_){var T=h.statData(h.pieTotalCode_).get(c),E=null==T?void 0:T.value;m=null==E||isNaN(E)?0:E}if(m&&!isNaN(m)){var I,P=map_pie_charts_createForOfIteratorHelper(b);try{for(P.s();!(I=P.n()).done;){var L=I.value;void 0!==g[L]&&(g[L]/=m)}}catch(c){P.e(c)}finally{P.f()}if(h.pieTotalCode_){var B=Object.values(g).reduce(function(c,h){return c+h},0);g.other=Math.max(0,1-B)}return g}};var b=function getRegionTotal(c){var g,m=0;if(h.pieTotalCode_)!(g=h.statData(h.pieTotalCode_).get(c))||0!=g.value&&!g.value||isNaN(g.value)?h.showOnlyWhenComplete()&&(m=void 0):m=g.value;else for(var b=0;b<h.statCodes_.length;b++){var w=h.statCodes_[b];if(!(g=h.statData(w).get(c))||0!=g.value&&!g.value||isNaN(g.value)){if(h.showOnlyWhenComplete())return}else m+=g.value}if(0!=m)return m};h.getLegendConstructor=function(){return oc};var w=150,S=120,M=Math.min(w,S)/2-10,k=src_pie().sort(null).value(function(c){return c.value}),T=src_arc().innerRadius(0).outerRadius(.8*M),E=src_arc().innerRadius(.9*M).outerRadius(.9*M);return h.tooltip_.textFunction=function pieChartTooltipFunction(c,g){var I=c.properties.na||c.properties.name,P=c.properties.id,L=m(P),B=[];for(var z in L)B.push({code:z,value:L[z]});var j="";if(j+='<div class="em-tooltip-bar">'.concat(I).concat(P?" (".concat(P,")"):"","</div>"),!B||0===B.length)return j+="<div>".concat(h.noDataText(),"</div>");var D,N="",R="",G="",q=map_pie_charts_createForOfIteratorHelper(k(B));try{for(q.s();!(D=q.n()).done;){var W=D.value,H=h.catColors()[W.data.code]||"lightgray",U=T(W);if(N+='<path d="'.concat(U,'" fill="').concat(H,'" stroke="white" stroke-width="1" opacity="0.7"></path>'),W.data.value>.1){var Y=T.centroid(W),V=E.centroid(W),$=E.centroid(W),X=W.startAngle+(W.endAngle-W.startAngle)/2;$[0]=.95*M*(X<Math.PI?1:-1),R+='<polyline points="'.concat(Y.join(",")," ").concat(V.join(",")," ").concat($.join(","),'"\n stroke="black" fill="none" stroke-width="1" />');var K=E.centroid(W);K[0]=.99*M*(X<Math.PI?1:-1);var Z=X<Math.PI?"start":"end",J=(100*W.data.value).toFixed();isNaN(J)||(G+='<text x="'.concat(K[0],'" y="').concat(K[1],'" text-anchor="').concat(Z,'" font-size="12px">\n ').concat(J,"%\n </text>"))}}}catch(c){q.e(c)}finally{q.f()}j+="\n <div class='em-tooltip-piechart-container'>\n <svg viewBox=\"".concat(-75," ").concat(-60," ").concat(w," ").concat(S,'" width="').concat(w,'" height="').concat(115,'">\n <g transform="translate(0,0)">\n ').concat(N,"\n ").concat(R,"\n ").concat(G,"\n </g>\n </svg>\n </div>\n "),j+='<div class="em-tooltip-breakdown">';var Q,tt=h.statCodes_.map(function(c){var g=h.statData(c).get(P);return g&&void 0!==g.value&&null!==g.value?{code:c,label:h.catLabels_[c],value:g.value,color:h.catColors()[c]||"#666"}:null}).filter(Boolean).sort(function(c,h){return h.value-c.value}),et=b(P)||tt.reduce(function(c,h){return c+h.value},0),nt=map_pie_charts_createForOfIteratorHelper(tt);try{for(nt.s();!(Q=nt.n()).done;){var rt,ot=Q.value,at=et?(ot.value/et*100).toFixed(0):0;j+='\n <div class="em-breakdown-item">\n <span class="em-breakdown-color" style="background:'.concat(ot.color,'"></span>\n <span class="em-breakdown-label">').concat(ot.label,'</span>\n <span class="em-breakdown-value">').concat(null!==(rt=ot.value)&&void 0!==rt&&rt.toFixed?Ft(ot.value):0," (").concat(isNaN(at)?0:at,"%)</span>\n </div>\n ")}}catch(c){nt.e(c)}finally{nt.f()}if(null!=et){var it=h.statData(h.statCodes_[0]).unitText()||"";j+='\n <div class="em-breakdown-item em-total">\n <span class="em-breakdown-label">Total</span>\n <span class="em-breakdown-value">'.concat(Ft(et)," ").concat(it,"</span>\n </div>\n ")}return j+="</div>"},h};const src_linear_linear=c=>+c;var ic=function legend(c,h){var g=wl(c);if(g.scaleLegend={title:null,titlePadding:5,showExampleChart:!1,showMaxRegion:!0,exampleData:null,tickCount:5,tickFormat:null,showXAxis:!0,xAxisRotation:-45,xAxisTickStep:1,margin:c.sparkTooltipChart_.margin,lineOpacity:.5,lineStrokeWidth:1},g.noDataLegend={show:!0,text:"No data"},g._scaleLegendHeight=0,g._maxRegionId=null,h)for(var m in h)if("scaleLegend"===m)for(var b in g.scaleLegend)void 0!==h.scaleLegend[b]&&(g.scaleLegend[b]=h.scaleLegend[b]);else if("noDataLegend"===m){if(!1===h.noDataLegend)g.noDataLegend.show=!1;else if("object"===_typeof(h.noDataLegend))for(var w in g.noDataLegend)void 0!==h.noDataLegend[w]&&(g.noDataLegend[w]=h.noDataLegend[w])}else"noData"===m?g.noDataLegend.show=h.noData:"width"===m?g.width=h.width:g[m]=h[m];return g.update=function(){g.updateConfig(),g.updateContainer();var c=g.map,h=g.lgg;h.selectAll("*").remove(),g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle();var m=g.getBaseY(),b=g.getBaseX();c.sparkYScale_&&(g._scaleLegendContainer=h.append("g").attr("class","em-spark-scale-legend em-grid-cell").attr("transform","translate(".concat(b,", ").concat(m,")")),function drawScaleLegend(c,h){var g=c.map,m=c.scaleLegend,b=m.margin,w=g._statDates||[];if(!w.length)return;var S=g.sparkLineWidth_||30,M=g.sparkLineHeight_||20,k=M/S,T=c.width-b.left-b.right,E=T*k,I=function getRegionIds(c){var h=[],g=c.svg_||c.svg();if(!g)return h;if(c.gridCartogram_)g.selectAll("#em-grid-container .em-grid-cell").each(function(c){c&&c.properties&&c.properties.id&&h.push(c.properties.id)});else{var m=c.getCentroidsGroup?c.getCentroidsGroup(c):null;m&&m.selectAll("g.em-centroid").each(function(c){c&&c.properties&&c.properties.id&&h.push(c.properties.id)})}return h}(g),P=I.map(function(c){for(var h=[],m=0;m<w.length;m++){var b=g.statData(w[m]);if(b){var S=b.get(c);S&&null!=S.value&&!isNaN(S.value)&&h.push({x:m,y:S.value})}}return h.length?{id:c,series:h}:null}).filter(Boolean),L=linear_linear().domain([0,w.length-1]).range([0,T]),B=slicedToArray_slicedToArray(function getLegendYDomain(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.05,g=1/0,m=-1/0;if(c.forEach(function(c){c.series.forEach(function(c){null==c.y||isNaN(c.y)||(g=Math.min(g,c.y),m=Math.max(m,c.y))})}),!isFinite(g)||!isFinite(m))return[0,1];if(g===m){var b=0===g?1:.1*Math.abs(g);return[g-b,m+b]}var w=(m-g)*h;return[g-w,m+w]}(P),2),z=B[0],j=B[1],D=linear_linear().domain([z,j]).range([E,0]),N=h.append("g").attr("transform","translate(".concat(b.left,", ").concat(b.top,")"));N.append("g").attr("class","em-spark-legend-y-axis").call(axisLeft(D).ticks(m.tickCount));var R=Math.max(1,m.xAxisTickStep||1),G=w.map(function(c,h){return h}).filter(function(c){return c%R===0});N.append("g").attr("class","em-spark-legend-x-axis").attr("transform","translate(0, ".concat(E,")")).call(axisBottom(L).tickValues(G).tickFormat(function(c){var h,m=w[c];return(null===(h=g.catLabels_)||void 0===h?void 0:h[m])||m})).selectAll("text").style("text-anchor","end").attr("dx","-.8em").attr("dy",".15em").attr("transform","rotate(".concat(m.xAxisRotation||-45,")"));var q=d3_shape_src_line().x(function(c){return L(c.x)}).y(function(c){return D(c.y)}),W=N.append("g").attr("class","em-spark-legend-series"),H=W.selectAll("path").data(P).enter().append("path").attr("d",function(c){return q(c.series)}).attr("fill","none").attr("stroke",g.sparkLineColor_||"#000").attr("stroke-width",m.lineStrokeWidth||1).attr("opacity",m.lineOpacity).style("cursor","pointer");H.on("mouseover",function(c,h){var m,b;H.attr("opacity",.1).attr("stroke-width",.6),src_select(this).attr("opacity",1).attr("stroke-width",1.4).raise();var w=function getRegionById(c,h){var g=c.svg_||c.svg(),m=null;return c.gridCartogram_?g.selectAll("#em-grid-container .em-grid-cell").each(function(c){var g;(null==c||null===(g=c.properties)||void 0===g?void 0:g.id)===h&&(m=c)}):g.selectAll("path").each(function(c){var g;(null==c||null===(g=c.properties)||void 0===g?void 0:g.id)===h&&(m=c)}),m}(g,h.id),S=(null==w||null===(m=w.properties)||void 0===m?void 0:m.na)||(null==w||null===(b=w.properties)||void 0===b?void 0:b.name)||h.id;g._tooltip&&(g._tooltip.mouseover('\n <div class="em-tooltip-bar">\n <b>'.concat(S,"</b> (").concat(h.id,")\n </div>\n ")),g._tooltip.mousemove(c))}).on("mousemove",function(c){g._tooltip&&g._tooltip.mousemove(c)}).on("mouseout",function(){H.attr("opacity",m.lineOpacity).attr("stroke-width",m.lineStrokeWidth),g._tooltip&&g._tooltip.mouseout()}),c._scaleLegendHeight=b.top+E+b.bottom}(g,g._scaleLegendContainer)),g.setBoxDimension()},g};function map_sparklines_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function map_sparklines_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?map_sparklines_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):map_sparklines_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}var sc=function map(c){var h=Ml(c,!0,"spark");h.sparkLineColor_="black",h.sparkAreaColor_="#41afaa",h.sparkLineWidth_=30,h.sparkLineHeight_=20,h.sparkLineStrokeWidth_=.4,h.sparkLineOpacity_=.6,h.sparkType_="line",h.sparkLineCircleRadius_=0,h.sparkTooltipChart_={width:150,height:80,margin:{left:40,right:20,top:10,bottom:40},circleRadius:1.5},h.sparkLineOffsets_={x:0,y:0},h.showOnlyWhenComplete_=!1,h.sparkLineChartFunction_=void 0,h.sparkYScale_=void 0,h.statSpark_=null;var g=["sparkLineColor_","showOnlyWhenComplete_","sparkType_","sparkLineWidth_","sparkLineHeight_","sparkLineStrokeWidth_","sparkLineOpacity_","sparkLineCircleRadius_","sparkLineAreaColor_","sparkTooltipChart_","sparkLineChartFunction_","sparkLineOffsets_"];g.forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&g.forEach(function(g){var m=g.slice(0,-1);null!=c[m]&&h[m](c[m])}),h.sparklineData_=void 0,h.sparklineData=function(c){var g=Object.keys(c[Object.keys(c)[0]]);return h._statDates=g,g.forEach(function(g){var m=Ds(),b={};for(var w in c){var S=c[w];b[w]=S[g]}m.setData(b),h.statData(g,m)}),h},h.statSpark=function(c,g,m){void 0!==g&&Array.isArray(g)&&(c=map_sparklines_objectSpread(map_sparklines_objectSpread({},c),{},{dates:g,labels:m})),c.stat&&delete(c=map_sparklines_objectSpread(map_sparklines_objectSpread({},c.stat),c)).stat;var b=c,w=b.eurostatDatasetCode,S=b.filters,M=b.unitText,k=b.dates,T=b.labels;if(!w)return console.error("statSpark: eurostatDatasetCode is required"),h;if(!k||!k.length)return console.error("statSpark: dates array is required"),h;var E=S?map_sparklines_objectSpread({},S):{};h._primaryDataset_={eurostatDatasetCode:w,filters:E,type:"statSpark"};for(var I=0;I<k.length;I++){var P=k[I],L={eurostatDatasetCode:w,unitText:M,filters:map_sparklines_objectSpread(map_sparklines_objectSpread({},E),{},{time:P})};h.stat(P,L),T&&T[I]&&(h.catLabels_=h.catLabels_||{},h.catLabels_[P]=T[I])}return h._statDates=k,h},h._statDates=void 0;var m=function getComposition(c){for(var g=[],m=0,b=0;b<h._statDates.length;b++){var w=h._statDates[b],S=h.statData(w).get(c);if(!S||0!=S.value&&!S.value||isNaN(S.value)){if(h.showOnlyWhenComplete())return}else g.push({date:w,value:S.value}),m+=S.value}if(0!=m){for(var M=1;M<g.length;M++){var k=g[M-1].value,T=g[M].value;g[M].percentageChange=0===k?.001:(T-k)/k*100}return g}};function applyStyleToMap(c){var g=[];return getSparkAnchors(c).attr("id",function(c){return g.push(c.properties.id),"spark_"+c.properties.id}),function addSparkLinesToMap(c){var g=h.sparkLineOffsets_||{x:0,y:0};"hexagon"===h.gridCartogramShape_&&(g.x-=h.sparkLineWidth_-4,g.y-=h.sparkLineHeight_+4);"square"===h.gridCartogramShape_&&(g.y+=10);c.forEach(function(c){var g=h.svg().select("#spark_"+c),b=m(c);if(b){g.selectAll(".em-sparkline-chart").remove();var w=g.append("g").attr("class","em-sparkline-chart").style("pointer-events","none"),S=h.sparkLineOffsets_||{x:0,y:0},M=0,k=0;if(h.gridCartogram_){var T=g.node().getBBox();M=T.width/2,k=T.height/2;var E=g.select(".em-grid-shape, .em-grid-rect, .em-grid-hexagon").node();E&&E.nextSibling&&g.node().insertBefore(w.node(),E.nextSibling),w.attr("transform","translate(\n ".concat(M+S.x-h.sparkLineWidth_/2,",\n ").concat(k+S.y-h.sparkLineHeight_/2,"\n )"))}createSparkLineChart(w,b,h.sparkLineWidth_,h.sparkLineHeight_)}})}(g),function addMouseEventsToRegions(c){var g;if(c.gridCartogram_)g=h.svg().selectAll("#em-grid-container .em-grid-cell .em-grid-shape");else{var b=zt(c);g=h.svg().selectAll(b)}g.on("mouseover",function(c,g){if(m(g.properties.id)){var b=src_select(this);b.attr("fill___",b.style("fill")),b.style("fill",h.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(g,h))}}).on("mousemove",function(c,g){m(g.properties.id)&&h._tooltip&&h._tooltip.mousemove(c)}).on("mouseout",function(){var c=src_select(this);c.style("fill");c.attr("fill___")&&(c.style("fill",c.attr("fill___")),h._tooltip&&h._tooltip.mouseout())})}(c),c}function getSparkAnchors(c){return c.gridCartogram_?c.svg().selectAll("#em-grid-container .em-grid-cell"):c.getCentroidsGroup(c).selectAll("g.em-centroid")}function createSparkLineChart(c,g,m,b){var w=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return h.sparkLineChartFunction_&&h.sparkLineChartFunction_!==createSparkLineChart?h.sparkLineChartFunction_(c,g,m,b,w):"bar"===h.sparkType_?function createSparkBarChart(c,g,m,b,w){var S=linear_linear().domain([0,g.length-1]).range([.5,m-.5]),M=h.sparkYScale_.range([b,0]),k=slicedToArray_slicedToArray(h.sparkYScale_.domain(),2),T=k[0],E=k[1],I=m/g.length,P=M(0),L=g.length*I,B=(m-L)/2;w&&(c.append("g").attr("class","axis-x").attr("transform","translate(0, ".concat(b,")")).call(axisBottom(S).tickValues(g.map(function(c,h){return h})).tickFormat(function(c){var h;return(null===(h=g[c])||void 0===h?void 0:h.date)||""})).selectAll("text").style("text-anchor","end").attr("dx","-.8em").attr("dy",".15em").attr("transform","rotate(-65)"),c.append("g").attr("class","axis-y").call(axisLeft(M).ticks(5)));var z,j=function getBarColor(c,m){return"function"==typeof h.sparkLineColor_?h.sparkLineColor_(c.value,m,g):h.sparkLineColor_};z=T>=0?b:E<=0?0:P;var D=c.selectAll("rect.spark-bar").data(g).enter().append("rect").attr("class","spark-bar").attr("x",function(c,h){return B+h*I+.05*I}).attr("width",.9*I).attr("fill",function(c,h){return j(c,h)}).attr("opacity",h.sparkLineOpacity_);w?D.attr("y",function(c){return T>=0?M(c.value):E<=0?0:c.value>=0?M(c.value):P}).attr("height",function(c){return T>=0?b-M(c.value):E<=0?M(c.value):Math.abs(M(c.value)-P)}):D.attr("y",z).attr("height",0).transition().duration(h.transitionDuration()).attr("y",function(c){return T>=0?M(c.value):E<=0?0:c.value>=0?M(c.value):P}).attr("height",function(c){return T>=0?b-M(c.value):E<=0?M(c.value):Math.abs(M(c.value)-P)});w&&T<0&&E>0&&c.append("line").attr("x1",0).attr("x2",m).attr("y1",P).attr("y2",P).attr("stroke","gray").attr("stroke-dasharray","2,2").attr("stroke-width",1)}(c,g,m,b,w):function createSparkLineOrAreaChart(c,g,m,b,w){var S=linear_linear().domain([0,g.length-1]).range([.5,m-.5]),M=h.sparkYScale_.range([b,0]),k=slicedToArray_slicedToArray(h.sparkYScale_.domain(),2),T=k[0],E=k[1],I=g.map(function(c,h){return map_sparklines_objectSpread(map_sparklines_objectSpread({},c),{},{scaledXValue:S(h),scaledYValue:M(c.value)})}),P=M(0);w&&(c.append("g").attr("class","axis-x").attr("transform","translate(0, ".concat(b,")")).call(axisBottom(S).tickValues(g.map(function(c,h){return h})).tickFormat(function(c){var h;return(null===(h=g[c])||void 0===h?void 0:h.date)||""})).selectAll("text").style("text-anchor","end").attr("dx","-.8em").attr("dy",".15em").attr("transform","rotate(-65)"),c.append("g").attr("class","axis-y").call(axisLeft(M).ticks(5)),T<0&&E>0&&c.append("line").attr("x1",0).attr("x2",m).attr("y1",P).attr("y2",P).attr("stroke","#999").attr("stroke-dasharray","2,2").attr("stroke-width",1));if("area"===h.sparkType_){var L,B=function getAreaColor(c,m){return"function"==typeof h.sparkAreaColor_?h.sparkAreaColor_(c.value,m,g):h.sparkAreaColor_};L=T>=0?b:E<=0?0:P,c.append("path").datum(I).attr("fill",B).attr("opacity",h.sparkLineOpacity_).attr("fill-opacity",.4).attr("d",function d3_shape_src_area(c,h,g){var m=null,b=node_modules_d3_shape_src_constant(!0),w=null,S=src_curve_linear,M=null,k=withPath(area);function area(T){var E,I,P,L,B,z=(T=d3_shape_src_array(T)).length,j=!1,D=new Array(z),N=new Array(z);for(null==w&&(M=S(B=k())),E=0;E<=z;++E){if(!(E<z&&b(L=T[E],E,T))===j)if(j=!j)I=E,M.areaStart(),M.lineStart();else{for(M.lineEnd(),M.lineStart(),P=E-1;P>=I;--P)M.point(D[P],N[P]);M.lineEnd(),M.areaEnd()}j&&(D[E]=+c(L,E,T),N[E]=+h(L,E,T),M.point(m?+m(L,E,T):D[E],g?+g(L,E,T):N[E]))}if(B)return M=null,B+""||null}function arealine(){return d3_shape_src_line().defined(b).curve(S).context(w)}return c="function"==typeof c?c:void 0===c?src_point_x:node_modules_d3_shape_src_constant(+c),h="function"==typeof h?h:node_modules_d3_shape_src_constant(void 0===h?0:+h),g="function"==typeof g?g:void 0===g?src_point_y:node_modules_d3_shape_src_constant(+g),area.x=function(h){return arguments.length?(c="function"==typeof h?h:node_modules_d3_shape_src_constant(+h),m=null,area):c},area.x0=function(h){return arguments.length?(c="function"==typeof h?h:node_modules_d3_shape_src_constant(+h),area):c},area.x1=function(c){return arguments.length?(m=null==c?null:"function"==typeof c?c:node_modules_d3_shape_src_constant(+c),area):m},area.y=function(c){return arguments.length?(h="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),g=null,area):h},area.y0=function(c){return arguments.length?(h="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),area):h},area.y1=function(c){return arguments.length?(g=null==c?null:"function"==typeof c?c:node_modules_d3_shape_src_constant(+c),area):g},area.lineX0=area.lineY0=function(){return arealine().x(c).y(h)},area.lineY1=function(){return arealine().x(c).y(g)},area.lineX1=function(){return arealine().x(m).y(h)},area.defined=function(c){return arguments.length?(b="function"==typeof c?c:node_modules_d3_shape_src_constant(!!c),area):b},area.curve=function(c){return arguments.length?(S=c,null!=w&&(M=S(w)),area):S},area.context=function(c){return arguments.length?(null==c?w=M=null:M=S(w=c),area):w},area}().x(function(c){return c.scaledXValue}).y0(L).y1(function(c){return c.scaledYValue}))}var z=I.slice(1).map(function(c,h){return{from:I[h],to:c,index:h,value:c.value}}),j=function getSegmentColor(c){return"function"==typeof h.sparkLineColor_?h.sparkLineColor_(c.value,c.index,g):h.sparkLineColor_},D=d3_shape_src_line().x(function(c){return c.scaledXValue}).y(function(c){return c.scaledYValue}),N=c.selectAll("path.spark-line-segment").data(z).enter().append("path").attr("class","spark-line-segment").attr("fill","none").attr("opacity",h.sparkLineOpacity_).attr("stroke-width",h.sparkLineStrokeWidth_+"px").attr("stroke",function(c){return j(c)}).attr("d",function(c){return D([c.from,c.to])});if(!w){var R=h.transitionDuration()/z.length;N.each(function(c,h){var g=src_select(this),m=this.getTotalLength();g.attr("stroke-dasharray",m).attr("stroke-dashoffset",m).transition().delay(h*R).duration(R).ease(src_linear_linear).attr("stroke-dashoffset",0)})}}(c,g,m,b,w)}return h.updateClassification=function(){if(!h._statDates){h._statDates=Object.keys(h.statData_);var c=h._statDates.indexOf("default");c>-1&&h._statDates.splice(c,1)}h.domain=function getDatasetExtent(){var c=1/0,g=-1/0;if(getSparkAnchors(h).data().forEach(function(m){for(var b=m.properties.id,w=0;w<h._statDates.length;w++){var S=h._statDates[w],M=h.statData(S);if(M){var k=M.get(b);k&&!isNaN(k.value)&&(c=Math.min(c,k.value),g=Math.max(g,k.value))}}}),!isFinite(c)||!isFinite(g))return[0,1];return[c,g]}(),h.sparkXScale_=linear_linear().domain([0,h._statDates.length-1]);var g,m,b=slicedToArray_slicedToArray(h.domain,2),w=b[0],S=b[1];if(w>=0)g=0,m=S;else if(S<=0)g=w,m=0;else{var M=Math.max(Math.abs(w),Math.abs(S));g=-M,m=M}var k=.05*(m-g);return g-=k,m+=k,h.sparkYScale_=h.sparkYScale_||linear_linear().domain([g,m]),h},h.updateStyle=function(){try{return applyStyleToMap(h),h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyStyleToMap),h}catch(c){console.error("Error in sparkline styling: "+c.message),console.error(c)}return h},h.tooltip_.textFunction=function(c,g){var b=[],w=c.properties.na||c.properties.name||"",S=c.properties.id;b.push('\n <div class="em-tooltip-bar">\n <b>'.concat(w,"</b>").concat(S?" (".concat(S,")"):"","\n </div>\n "));var M=h.sparkTooltipChart_.height,k=h.sparkTooltipChart_.width,T=h.sparkTooltipChart_.margin,E=m(c.properties.id);if(E){var I=k+T.left+T.right,P=M+T.top+T.bottom,L=function src_create(c){return src_select(src_creator(c).call(document.documentElement))}("div").attr("class","em-tooltip-chart-container");createSparkLineChart(L.append("svg").attr("class","em-tooltip-chart-svg").attr("width",I).attr("height",P).append("g").attr("class","em-tooltip-chart-group").attr("transform","translate(".concat(T.left,", ").concat(T.top,")")),E,k,M,!0),b.push(L.node().outerHTML)}return b.join("")},h.getLegendConstructor=function(){return ic},h},lc=_t?_t(".2s"):function(c){return String(c)},cc=_t?_t(","):function(c){return String(c)};function drawFlowColorLegend(c,h,g){var m,b=c.map;null===(m=c._flowColorContainer)||void 0===m||m.remove(),c._flowColorContainer=c.lgg.append("g").attr("class","em-flow-color-legend").attr("transform","translate(".concat(h,", ").concat(g,")"));var w=c._flowColorContainer.append("text").attr("class","em-color-legend-title").attr("id","em-color-legend-title").attr("dy","0.35em").text(c.flowColorLegend.title||"Destination"),S=[];if("function"==typeof b.flowColor_)S=c.flowColorLegend.items&&c.flowColorLegend.items.length>0?c.flowColorLegend.items.map(function(c){var h;return{label:c.label,color:c.color,key:null!==(h=c.key)&&void 0!==h?h:null}}):[{label:"please specify legend items ...",color:"#888",key:null}];else{var M=b.topLocationColorScale;S=Array.from(b.topLocationKeys||[]).map(function(c){return{key:c,label:b.nodeNameMap.get(c)||c,color:M(c)}}),S.push({key:"Other",label:"Other",color:b.flowColor_})}var k=w.node().getBBox().height+c.flowColorLegend.titlePadding;c.itemHeight;S.forEach(function(h,g){var m=c._flowColorContainer.append("g").attr("class","em-color-legend-item").attr("transform","translate(0, ".concat(22*g+k,")")).style("cursor","pointer").on("mouseover",function(){!function highlightLines(c){if(!c)return;src_selectAll(".em-flow-link, .em-flow-link-bundled").classed("highlighted",function(){return this.getAttribute("data-dest")===c}).classed("dimmed",function(){return!(this.getAttribute("data-dest")===c)})}(h.key),src_select(this).select("text").style("font-weight","bold"),src_select(this).select("rect").attr("stroke","black").attr("stroke-width",2)}).on("mouseout",function(){!function unhighlightLines(){src_selectAll(".em-flow-link, .em-flow-link-bundled").classed("highlighted",!1).classed("dimmed",!1)}(),src_select(this).select("text").style("font-weight","normal"),src_select(this).select("rect").attr("stroke","none")});m.append("rect").attr("width",18).attr("height",22).attr("fill",h.color),m.append("text").attr("x",25).attr("y",14).attr("class","em-legend-label").text(h.label)})}var uc=function legend(c,h){var g=wl(c);if(g.flowWidthLegend={title:null,titlePadding:17,values:null,marginTop:15,labelFormatter:void 0,labels:null,color:"#616161",orientation:"horizontal",segments:3,width:150,maxMin:!1},g.nodeSizeLegend={title:null,titlePadding:25,values:null,labels:null,marginTop:20,labelFormatter:void 0},g.flowColorLegend={title:null,titlePadding:0,marginTop:50,items:[],ticks:!1},g.regionColorLegend={title:null,titlePadding:15,marginTop:30,labels:["Exporter","Importer"]},h)for(var m in h)if("colorLegend"==m||"flowWidthLegend"==m||"nodeSizeLegend"==m||"flowColorLegend"==m||"regionColorLegend"==m){for(var b in g[m])void 0!==h[m][b]&&(g[m][b]=h[m][b]);0==h.colorLegend&&(g.colorLegend=!1)}else g[m]=h[m];return g.update=function(){g.updateConfig(),g.updateContainer();var c=g.map,h=g.lgg;if(c.legend_)for(var m in c.legend_)if("colorLegend"==m||"flowWidthLegend"==m||"nodeSizeLegend"==m||"flowColorLegend"==m||"regionColorLegend"==m)for(var b in g[m])void 0!==c.legend_[m][b]&&(g[m][b]=c.legend_[m][b]);else g[m]=c.legend_[m];h.selectAll("*").remove(),g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle(),function buildFlowLegend(c){var h=c.map,g=c.getBaseX(),m=c.getBaseY();c.flowWidthLegend&&("vertical"==c.flowWidthLegend.orientation?function drawVerticalFlowWidthLegend(c,h,g){var m,b=c.map;if(b.strokeWidthScale){c._flowWidthContainer=c.lgg.append("g").attr("class","em-flow-width-legend").attr("transform","translate(".concat(h,", ").concat(g,")"));var w=c.flowWidthLegend,S=null!==(m=w.segments)&&void 0!==m?m:5;w.title&&c._flowWidthContainer.append("text").attr("class","em-width-legend-title").text(w.title||"Flow width");for(var M=[],k=c.map.maxFlowCount,T=c.map.minFlowCount,E=0;E<S;E++){var I=1===S?.5:E/(S-1);M.push(T+I*(k-T))}var P=w.values||M,L=w.titlePadding||10,B=b.strokeWidthScale;P.forEach(function(h,g){var m=B(h);if(g>0){var b=B(P[g-1]);L+=b/2+m/g+7}var S=w.labelFormatter?w.labelFormatter(h):Ft(h);w.labels&&w.labels[g]&&(S=w.labels[g]),c._flowWidthContainer.append("line").attr("x1",0).attr("x2",40).attr("y1",L).attr("y2",L).attr("stroke",w.color?w.color:"#6b6b6b").attr("stroke-width",m),c._flowWidthContainer.append("text").attr("x",50).attr("y",L).attr("dy","0.35em").attr("class","em-legend-label").text(S)})}}(c,g,m+c.flowWidthLegend.marginTop):function drawHorizontalFlowWidthLegend(c,h,g){var m,b,w,S;if(!c)return null;var M=c.map||c;if(!M||!M.strokeWidthScale)return null;c._flowWidthContainer&&c._flowWidthContainer.remove();var k=c.flowWidthLegend;c._flowWidthContainer=c.lgg.append("g").attr("class","em-flow-width-legend-horizontal").attr("transform","translate(".concat(h,", ").concat(g,")")),k.title&&c._flowWidthContainer.append("text").attr("class","em-width-legend-title").text(k.title||"Flow width");for(var T=null!==(m=k.x)&&void 0!==m?m:0,E=k.width||c.width,I=null!==(b=k.segments)&&void 0!==b?b:5,P=null!==(w=k.labelOffset)&&void 0!==w?w:12,L=null!==(S=k.pad)&&void 0!==S?S:0,B=T+L,z=T+E-L,j=Math.max(0,z-B),D=[],N=c.map.maxFlowCount,R=c.map.minFlowCount,G=0;G<I+1;G++){var q=1===I?.5:G/(I-1);D.push(R+q*(N-R))}var W=k.values||D,H=Math.max(1,W.length-1),U=j/H,Y=W.map(function(c){return Math.max(.5,M.strokeWidthScale(c))}),V=Math.max.apply(Math,toConsumableArray_toConsumableArray(Y)),$=M.strokeWidthScale(N)+k.titlePadding,X=c._flowWidthContainer.append("g").attr("class","em-flow-legend-texts"),K=c._flowWidthContainer.append("g").attr("class","em-flow-legend-lines");K.append("line").attr("class","em-flow-legend-baseline").attr("x1",B).attr("x2",z).attr("y1",$).attr("y2",$).attr("stroke","#eee").attr("stroke-width",1);for(var Z=0;Z<H;Z++){var J,Q,tt=B+Z*U,et=Z===H-1?z:B+(Z+1)*U,nt=Y[Z],rt=W[Z];K.append("line").style("stroke-width",nt).attr("x1",tt).attr("x2",et).attr("y1",$).attr("y2",$).style("stroke",null!==(J=k.color)&&void 0!==J?J:"#000").style("stroke-opacity",null!==(Q=k.strokeOpacity)&&void 0!==Q?Q:1);var ot=(tt+et)/2;X.append("text").attr("x",ot).attr("y",$-P).attr("dy","-0.35em").attr("class","em-legend-label em-flow-legend-label em-flow-width-horizontal-label").text(lc(rt))}k.maxMin&&(X.append("text").attr("x",B).attr("y",$+V+6).attr("class","em-legend-label em-flow-legend-min-label").attr("dy","0.5em").text(cc(Math.round(R))),X.append("text").attr("x",z).attr("y",$+V+6).attr("class","em-legend-label em-flow-legend-max-label").attr("dy","0.5em").text(cc(Math.round(N))))}(c,g,m+c.flowWidthLegend.marginTop));var b=c._flowWidthContainer.node(),w=b.getBBox().height;h.flowNodes_&&h._nodeSizeScale&&(c._nodeLegendContainer=c.lgg.append("g").attr("class","em-node-color-legend").attr("transform","translate(".concat(g,", ").concat(m+w,")")),c._nodeSizeContainer=c._nodeLegendContainer.append("g").attr("class","em-node-size-legend").attr("transform","translate(".concat(0,", ",c.nodeSizeLegend.marginTop,")")),drawCircleSizeLegend(c,c._nodeSizeContainer,c.nodeSizeLegend.values,h._nodeSizeScale,c.nodeSizeLegend.title,c.nodeSizeLegend.titlePadding));if(c.flowColorLegend&&(h.flowNodes_&&h._nodeSizeScale||"function"==typeof h.flowColor_)){var S=c.lgg.node().getBBox().height+c.flowColorLegend.marginTop;drawFlowColorLegend(c,g,S)}if((h.importerRegionIds.length>0||h.exporterRegionIds.length>0)&&c.regionColorLegend){var M=c.lgg.node().getBBox().height+c.regionColorLegend.marginTop;!function drawRegionColorLegend(c,h,g){var m;null===(m=c._regionColorContainer)||void 0===m||m.remove(),c._regionColorContainer=c.lgg.append("g").attr("class","em-flow-region-color-legend").attr("transform","translate(".concat(h,", ").concat(g,")"));c._regionColorContainer.append("text").attr("class","em-color-legend-title").attr("id","em-color-legend-title").attr("dy","0.35em").text(c.regionColorLegend.title||"Region fill colors");var b=c.map,w=_defineProperty(_defineProperty({},c.regionColorLegend.labels[0],b.flowRegionColors_[0]),c.regionColorLegend.labels[1],b.flowRegionColors_[1]),S=c.regionColorLegend.titlePadding;Object.entries(w).forEach(function(h,g){var m=slicedToArray_slicedToArray(h,2),b=m[0],w=m[1];c._regionColorContainer.append("rect").attr("x",0).attr("y",S+20*g).attr("width",c.shapeWidth).attr("height",c.shapeHeight).attr("fill",w),c._regionColorContainer.append("text").attr("x",c.shapeWidth+5).attr("y",S+20*g+15).attr("class","em-legend-label").text(b)})}(c,g,M)}}(g),g.setBoxDimension()},g};function sum_sum(c,h){let g=0;if(void 0===h)for(let h of c)(h=+h)&&(g+=h);else{let m=-1;for(let b of c)(b=+h(b,++m,c))&&(g+=b)}return g}function ensureArrowMarkers(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},g=h.cacheKey,m=void 0===g?"default":g,b=h.scale,w=void 0===b?1:b,S=h.markerUnits,M=void 0===S?"strokeWidth":S,k=h.hoverColor,T=void 0===k?"black":k,E=h.outlineColor,I=void 0===E?"#ffffff":E,P=h.idBase,L=void 0===P?function uid(){return"".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"arrow","-").concat(Math.random().toString(36).slice(2))}("arrow"):P,B=h.useContextStroke,z=void 0===B||B,j=c.node();if(j._arrowCache||(j._arrowCache=new Map),j._arrowCache.has(m))return j._arrowCache.get(m);var D,N=function ensureDefs(c){var h=c.select("defs");return h.empty()&&(h=c.append("defs")),h}(c),R={normal:"".concat(L),hover:"".concat(L,"-hover"),outline:"".concat(L,"-outline")};(N.select("#".concat(R.normal)).empty()&&createMarker(N,R.normal,{markerUnits:M,scale:w,fill:z?"context-stroke":T,out:h.out}),N.select("#".concat(R.hover)).empty()&&createMarker(N,R.hover,{markerUnits:M,scale:w,fill:T,out:h.out}),N.select("#".concat(R.outline)).empty())&&createMarker(N,R.outline,{markerUnits:M,scale:w,fill:(null===(D=h.out)||void 0===D?void 0:D.flowOutlineColor_)||I,out:h.out});return j._arrowCache.set(m,R),R}function applyArrow(c,h){if(!h)return c;var g=h[arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal"];return c.attr("marker-end",g?"url(#".concat(g,")"):null)}function setHoverArrow(c,h,g){return applyArrow(c,h,g?"hover":"normal")}function createMarker(c,h,g){var m=g.markerUnits,b=void 0===m?"strokeWidth":m,w=g.scale,S=void 0===w?1:w,M=g.fill,k=void 0===M?"context-stroke":M,T=10,E=3*S;c.append("marker").attr("id",h).attr("markerUnits",b).attr("markerWidth",E).attr("markerHeight",E).attr("viewBox","0 0 ".concat(T," ").concat(T)).attr("refX",9.9).attr("refY",5).attr("orient","auto").append("path").attr("fill",k).attr("d","M0,0 L".concat(9.9,",").concat(5," L0,").concat(T," L").concat(2.2,",").concat(5," Z"))}function flow_bidirectional_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function flow_bidirectional_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?flow_bidirectional_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):flow_bidirectional_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}function flow_bidirectional_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function flow_bidirectional_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return flow_bidirectional_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?flow_bidirectional_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function flow_bidirectional_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function buildBidirectionalRouteMap(c,h){var g,m=new Map(c.map(function(c){return[c.id,c]})),b=new Map,w=flow_bidirectional_createForOfIteratorHelper(h);try{for(w.s();!(g=w.n()).done;){var S=g.value,M="object"===_typeof(S.source)?S.source.id:S.source,k="object"===_typeof(S.target)?S.target.id:S.target,T=m.get(M),E=m.get(k);if(T&&E){var I=M<k?"".concat(M,"|").concat(k):"".concat(k,"|").concat(M);if(!b.has(I)){var P=M<k?T:E,L=M<k?E:T;b.set(I,{key:I,idA:P.id,idB:L.id,nodeA:P,nodeB:L,coordsA:[P.x,P.y],coordsB:[L.x,L.y],flowAB:0,flowBA:0,sampleAB:null,sampleBA:null})}var B=b.get(I),z=+S.value||0;M===B.idA&&k===B.idB?(B.flowAB+=z,B.sampleAB||(B.sampleAB=S)):(B.flowBA+=z,B.sampleBA||(B.sampleBA=S))}}}catch(c){w.e(c)}finally{w.f()}return b}function sankey_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function sankey_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return sankey_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?sankey_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function sankey_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function sankey_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function sankey_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?sankey_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):sankey_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}function createSankeyFlowMap(c,h){var g=c.svg_,m=c.flowGraph_,b=c.flowColorGradient_||c.flowOpacityGradient_;c._nodeById=c._nodeById||new Map(m.nodes.map(function(c){return[c.id,c]}));var w=function expandRoutesToSankeyMidpointGraph(c,h){var g,m=buildBidirectionalRouteMap(c,h),b=new Map(c.map(function(c){return[c.id,c]})),w=c.map(function(c){return flow_bidirectional_objectSpread({},c)}),S=[],M=0,k=flow_bidirectional_createForOfIteratorHelper(m.values());try{for(k.s();!(g=k.n()).done;){var T=g.value,E=T.idA,I=T.idB,P=T.coordsA,L=T.coordsB,B=T.flowAB,z=T.flowBA,j=T.sampleAB,D=T.sampleBA,N=b.get(E),R=b.get(I);if(N&&R){var G=j?flow_bidirectional_objectSpread({},j):{},q=D?flow_bidirectional_objectSpread({},D):{};if(delete G.source,delete G.target,delete G.value,delete q.source,delete q.target,delete q.value,B>0&&z>0){var W="__mid__".concat(E,"__").concat(I,"__").concat(M++),H={id:W,x:(P[0]+L[0])/2,y:(P[1]+L[1])/2,isMidpoint:!0};w.push(H),S.push(flow_bidirectional_objectSpread(flow_bidirectional_objectSpread({},G),{},{source:W,target:I,value:B,route:T,originId:E,destId:I,dir:"AtoB"})),S.push(flow_bidirectional_objectSpread(flow_bidirectional_objectSpread({},q),{},{source:W,target:E,value:z,route:T,originId:I,destId:E,dir:"BtoA"}))}else B>0?S.push(flow_bidirectional_objectSpread(flow_bidirectional_objectSpread({},G),{},{source:E,target:I,value:B,route:T,originId:E,destId:I,dir:"AtoB"})):z>0&&S.push(flow_bidirectional_objectSpread(flow_bidirectional_objectSpread({},q),{},{source:I,target:E,value:z,route:T,originId:I,destId:E,dir:"BtoA"}))}}}catch(c){k.e(c)}finally{k.f()}return{nodes:w,links:S}}(m.nodes,m.links),S=function sankey(c,h){var g=function cloneGraph(c){var h=c.nodes,g=c.links;return{nodes:h.map(function(c){return sankey_objectSpread({},c)}),links:g.map(function(c){return sankey_objectSpread({},c)})}}(h);return function initGraphLinks(c){var h,g=c.nodes,m=c.links,b=function id(c){return c.id},w=sankey_createForOfIteratorHelper(g.entries());try{for(w.s();!(h=w.n()).done;){var S=slicedToArray_slicedToArray(h.value,2),M=S[0],k=S[1];k.index=M,k.sourceLinks=[],k.targetLinks=[]}}catch(c){w.e(c)}finally{w.f()}var T,E=new Map(g.map(function(c,h){return[b(c,h,g),c]})),I=sankey_createForOfIteratorHelper(m.entries());try{for(I.s();!(T=I.n()).done;){var P=slicedToArray_slicedToArray(T.value,2),L=P[0],B=P[1];B.index=L;var z=B.source,j=B.target;"object"!==_typeof(z)&&(z=B.source=E.get(z)),"object"!==_typeof(j)&&(j=B.target=E.get(j)),z&&j&&(z.sourceLinks.push(B),j.targetLinks.push(B))}}catch(c){I.e(c)}finally{I.f()}}(g),function computeNodeValues(c){var h,g=c.nodes,m=sankey_createForOfIteratorHelper(g);try{for(m.s();!(h=m.n()).done;){var b=h.value;b.value=Math.max(sum_sum(b.sourceLinks,function(c){return c.value}),sum_sum(b.targetLinks,function(c){return c.value}))}}catch(c){m.e(c)}finally{m.f()}}(g),function computeNodeDepths(c){var h=c.nodes,g=h.length,m=new Set(h),b=new Set,w=0;for(;m.size;){var S,M=sankey_createForOfIteratorHelper(m);try{for(M.s();!(S=M.n()).done;){var k=S.value;k.depth=w;var T,E=sankey_createForOfIteratorHelper(k.sourceLinks);try{for(E.s();!(T=E.n()).done;){var I=T.value.target;b.add(I)}}catch(c){E.e(c)}finally{E.f()}}}catch(c){M.e(c)}finally{M.f()}if(++w>g){console.log("Detected circular link(s); continuing layout.");break}m=b,b=new Set}}(g),function computeNodeHeights(c){var h=c.nodes,g=new Set,m=[];function visit(c){var h,b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(g.has(c))return null!==(h=c.height)&&void 0!==h?h:0;g.add(c),m.push(c);var w,S=0,M=sankey_createForOfIteratorHelper(c.targetLinks);try{for(M.s();!(w=M.n()).done;){var k=w.value.source;if(m.includes(k))console.log("Circular link detected between ".concat(k.id," and ").concat(c.id));else{var T=visit(k,b+1);T+1>S&&(S=T+1)}}}catch(c){M.e(c)}finally{M.f()}return c.height=S,m.pop(),S}var b,w=sankey_createForOfIteratorHelper(h);try{for(w.s();!(b=w.n()).done;){visit(b.value)}}catch(c){w.e(c)}finally{w.f()}var S,M=Math.min.apply(Math,toConsumableArray_toConsumableArray(h.map(function(c){var h;return null!==(h=c.height)&&void 0!==h?h:0}))),k=sankey_createForOfIteratorHelper(h);try{for(k.s();!(S=k.n()).done;){var T,E=S.value;E.height=(null!==(T=E.height)&&void 0!==T?T:0)-M}}catch(c){k.e(c)}finally{k.f()}}(g),function computeNodeBreadths(c,h){var g,m=h.nodes,b=sankey_createForOfIteratorHelper(m);try{for(b.s();!(g=b.n()).done;){var w=g.value;w.sourceLinks.forEach(function(h){return h.width=c.strokeWidthScale(h.value)}),w.targetLinks.forEach(function(h){return h.width=c.strokeWidthScale(h.value)});var S=Math.max(sum_sum(w.sourceLinks,function(c){return c.width}),sum_sum(w.targetLinks,function(c){return c.width}));w.x0=w.x1=w.x,w.y0=w.y-S/2,w.y1=w.y+S/2}}catch(c){b.e(c)}finally{b.f()}!function reorderLinks(c){var h,g=sankey_createForOfIteratorHelper(c);try{for(g.s();!(h=g.n()).done;){var m=h.value,b=m.sourceLinks,w=m.targetLinks;b.sort(function(c,h){return c.target.y-h.target.y}),w.sort(function(c,h){return c.source.y-h.source.y})}}catch(c){g.e(c)}finally{g.f()}}(m)}(c,g),function computeLinkBreadths(c,h){var g,m=h.nodes,b=sankey_createForOfIteratorHelper(m);try{for(b.s();!(g=b.n()).done;){var w=g.value,S=w.y;if(w.isMidpoint){var M,k=sankey_createForOfIteratorHelper(w.sourceLinks);try{for(k.s();!(M=k.n()).done;){M.value.y0=S}}catch(c){k.e(c)}finally{k.f()}var T,E=sankey_createForOfIteratorHelper(w.targetLinks);try{for(E.s();!(T=E.n()).done;){T.value.y1=S}}catch(c){E.e(c)}finally{E.f()}w.y0=S,w.y1=S}else if(c.flowStack_){var I,P=[],L=[],B=sankey_createForOfIteratorHelper(w.sourceLinks);try{for(B.s();!(I=B.n()).done;){var z=I.value,j=z.target,D={link:z,width:z.width,otherY:j.y,at:"out"};(j.x<w.x?P:L).push(D)}}catch(c){B.e(c)}finally{B.f()}var N,R=sankey_createForOfIteratorHelper(w.targetLinks);try{for(R.s();!(N=R.n()).done;){var G=N.value,q=G.source,W={link:G,width:G.width,otherY:q.y,at:"in"};(q.x<w.x?P:L).push(W)}}catch(c){R.e(c)}finally{R.f()}var H=P.reduce(function(c,h){return c+h.width},0),U=L.reduce(function(c,h){return c+h.width},0);P.sort(c.flowOrder_),L.sort(c.flowOrder_);for(var Y=S-H/2,V=0,$=P;V<$.length;V++){var X=$[V],K=Y+X.width/2;"out"===X.at?X.link.y0=K:X.link.y1=K,Y+=X.width}for(var Z=S-U/2,J=0,Q=L;J<Q.length;J++){var tt=Q[J],et=Z+tt.width/2;"out"===tt.at?tt.link.y0=et:tt.link.y1=et,Z+=tt.width}var nt=Math.max(H,U);w.y0=S-nt/2,w.y1=S+nt/2}else{var rt,ot=sankey_createForOfIteratorHelper(w.sourceLinks);try{for(ot.s();!(rt=ot.n()).done;){rt.value.y0=S}}catch(c){ot.e(c)}finally{ot.f()}var at,it=sankey_createForOfIteratorHelper(w.targetLinks);try{for(it.s();!(at=it.n()).done;){at.value.y1=S}}catch(c){it.e(c)}finally{it.f()}w.y0=S,w.y1=S}}}catch(c){b.e(c)}finally{b.f()}}(c,g),function adjustMidpointNodes(c){var h,g=c.nodes,m=sankey_createForOfIteratorHelper(g);try{for(m.s();!(h=m.n()).done;){var b=h.value;if(b.isMidpoint){var w=[].concat(toConsumableArray_toConsumableArray(b.sourceLinks||[]),toConsumableArray_toConsumableArray(b.targetLinks||[]));if(2===w.length){var S,M=[],k=sankey_createForOfIteratorHelper(w);try{for(k.s();!(S=k.n()).done;){var T=S.value;T.source===b?M.push({x:T.target.x0,y:T.y1}):T.target===b&&M.push({x:T.source.x1,y:T.y0})}}catch(c){k.e(c)}finally{k.f()}if(2===M.length){var E=(M[0].y+M[1].y)/2;b.y=E,b.y0=E,b.y1=E;var I,P=sankey_createForOfIteratorHelper(w);try{for(P.s();!(I=P.n()).done;){var L=I.value;L.source===b&&(L.y0=E),L.target===b&&(L.y1=E)}}catch(c){P.e(c)}finally{P.f()}}}}}}catch(c){m.e(c)}finally{m.f()}}(g),g}(c,w),M=S.nodes,k=S.links,T=c.flowArrows_?ensureArrowMarkers(g,{cacheKey:"sankey",scale:c.flowArrowScale_||1,markerUnits:"strokeWidth",hoverColor:c.hoverColor_||"black",outlineColor:c.flowOutlineColor_||"#ffffff",useContextStroke:!0}):null,E=g.select("defs").empty()?g.append("defs"):g.select("defs"),I=k.map(function(){return generateUniqueId("gradient")});return b&&function addFlowGradients(c,h,g,m){h.selectAll("linearGradient").data(m).join("linearGradient").attr("id",function(c,h){return g[h]}).attr("gradientUnits","userSpaceOnUse").attr("x1",function(c){var h,g,m,b;return null!==(h=null!==(g=null==c||null===(m=c.source)||void 0===m?void 0:m.x1)&&void 0!==g?g:null==c||null===(b=c.target)||void 0===b?void 0:b.x0)&&void 0!==h?h:0}).attr("x2",function(c){var h,g,m,b;return null!==(h=null!==(g=null==c||null===(m=c.target)||void 0===m?void 0:m.x0)&&void 0!==g?g:null==c||null===(b=c.source)||void 0===b?void 0:b.x1)&&void 0!==h?h:0}).attr("y1",function(c){var h,g;return null!==(h=null!==(g=null==c?void 0:c.y0)&&void 0!==g?g:null==c?void 0:c.y1)&&void 0!==h?h:0}).attr("y2",function(c){var h,g;return null!==(h=null!==(g=null==c?void 0:c.y1)&&void 0!==g?g:null==c?void 0:c.y0)&&void 0!==h?h:0}).each(function(h){var g,m,b=src_select(this);b.selectAll("stop").remove();var w=c.flowColorGradient_&&null!==(g=null===(m=c.flowRegionColors_)||void 0===m?void 0:m[0])&&void 0!==g?g:getFlowStroke(c,h),S=c.flowColorGradient_?"function"==typeof c.flowColor_?c.flowColor_(h):c.flowColor_:getFlowStroke(c,h),M=c.flowOpacityGradient_?0:1,k=1;b.append("stop").attr("offset","0%").attr("stop-color",w).attr("stop-opacity",M),b.append("stop").attr("offset","100%").attr("stop-color",S).attr("stop-opacity",k)})}(c,E,I,k),function addSankeyFlows(c,h,g,m,b,w){var S,M=c.flowColorGradient_||c.flowOpacityGradient_,k=function buildFlowsGroup(c,h){return c.append("g").attr("class","em-flow-lines").attr("id","em-flow-lines").style("opacity",h.flowOpacity_)}(h,c),T=c.flowCurvatureSettings_||{},E=null!==(S=T.curvature)&&void 0!==S?S:.5,I=function sankeyLinkAvoidingNodes(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},g=h.gapX,m=void 0===g?10:g,b=h.padX,w=void 0===b?2:b,S=h.padY,M=void 0===S?2:S,k=h.bumpY,T=void 0===k?0:k,E=h.curvature,I=void 0===E?.5:E;return function(h){var g=h.source.x1,b=h.y0,S=h.target.x0,k=h.y1;if(g===S)return"M".concat(g,",").concat(b,"L").concat(S,",").concat(k);var E,P=g>S,L=P?S:g,B=P?k:b,z=P?g:S,j=P?b:k,D=[[L,B]],N=function yAt(c){return B+(j-B)*(z===L?0:(c-L)/(z-L))},R=[],G=sankey_createForOfIteratorHelper(c);try{for(G.s();!(E=G.n()).done;){var q,W,H=E.value;if(H!==h.source&&H!==h.target){var U=H.x0;if(!(U<=L||U>=z)){var Y=null!==(q=H.y0)&&void 0!==q?q:H.y,V=null!==(W=H.y1)&&void 0!==W?W:H.y,$=(Y+V)/2,X=U-w,K=U+w,Z=N(U),J=Z>=$,Q=Y-(J?0:M),tt=V+(J?M:0);if(Z>=Q&&Z<=tt){var et=J?tt+T:Q-T,nt=Math.max(L,X-m),rt=Math.min(z,K+m);if(rt<nt)continue;R.push({x1:nt,x2:rt,y:et})}}}}}catch(c){G.e(c)}finally{G.f()}if(R.length){R.sort(function(c,h){return c.x1-h.x1});var ot,at=[],it=sankey_createForOfIteratorHelper(R);try{for(it.s();!(ot=it.n()).done;){var st=ot.value;if(!at.length||st.x1>at[at.length-1].x2)at.push(sankey_objectSpread({},st));else{var lt=at[at.length-1];lt.x2=Math.max(lt.x2,st.x2),lt.y=st.y}}}catch(c){it.e(c)}finally{it.f()}for(var ct=0,ut=at;ct<ut.length;ct++){var ht=ut[ct],dt=Math.max(L,ht.x1),pt=Math.min(z,ht.x2),ft=D[D.length-1][0];dt>ft&&(D.push([dt,ht.y]),ft=dt),pt>ft&&D.push([pt,ht.y])}}D.push([z,j]),P&&D.reverse();for(var gt="function"==typeof I?I(h):I,_t="M".concat(D[0][0],",").concat(D[0][1]),mt=1;mt<D.length;mt++)_t+=cubicSegment(D[mt-1],D[mt],gt);return _t}}(g,sankey_objectSpread(sankey_objectSpread({},T),{},{curvature:"function"==typeof T.curvature?T.curvature:function(c){return c.source&&c.source.isMidpoint?.5*E:E}}));m.forEach(function(h,g){var m=I(h),S=function computeColorKey(c,h){var g,m,b,w,S,M,k;return c.topLocationKeys&&null!==(g=(m=c.topLocationKeys).has)&&void 0!==g&&g.call(m,null==h||null===(b=h.target)||void 0===b?void 0:b.id)?h.target.id:null!==(w=null!==(S=null==h||null===(M=h.target)||void 0===M?void 0:M.id)&&void 0!==S?S:null==h||null===(k=h.source)||void 0===k?void 0:k.id)&&void 0!==w?w:"Other"}(c,h),T=getFlowStroke(c,h),E=M?"url(#".concat(w[g],")"):T;c.flowOutlines_&&!c.flowWidthGradient_&&function buildOutlinePath(c,h,g,m,b){var w=m.width+c.flowOutlineWidth_,S=getBackoffAndDash(c,w,g),M=S.dashVis,k=S.dashGap,T=h.append("path").attr("d",g).attr("fill","none").attr("class","em-flow-link-outline").attr("stroke",c.flowOutlineColor_).attr("stroke-width",w).attr("stroke-dasharray",c.flowArrows_?"".concat(M," ").concat(k):null).style("pointer-events","none");c.flowArrows_&&applyArrow(T,b,"outline");return T}(c,k,m,h,b);var P=c.flowWidthGradient_?function buildTaperedMain(c,h,g,m,b,w,S){var M=taperedPolygonForLink(m,function(){return g},{startRatio:c.flowWidthGradientSettings_.startRatio,samples:c.flowWidthGradientSettings_.samples,minStartWidth:c.flowWidthGradientSettings_.minStartWidth,capEnd:c.flowArrows_},0);if(c.flowOutlines_){var k=taperedPolygonForLink(m,function(){return g},{startRatio:c.flowWidthGradientSettings_.startRatio,samples:c.flowWidthGradientSettings_.samples,minStartWidth:c.flowWidthGradientSettings_.minStartWidth,capEnd:c.flowArrows_},c.flowOutlineWidth_);h.append("path").attr("d",k).attr("fill",c.flowOutlineColor_).attr("class","em-flow-link-outline")}var T=h.append("path").attr("d",M).attr("fill",b).attr("class","em-flow-link em-flow-link-tapered").attr("data-color-key",w).attr("data-color",S);return T}(c,k,m,h,E,S,T):function buildSimpleMain(c,h,g,m,b,w,S,M){var k=getBackoffAndDash(c,m.width,g),T=k.dashVis,E=k.dashGap,I=h.append("path").attr("d",g).attr("fill","none").attr("class","em-flow-link").attr("stroke",b).attr("stroke-width",m.width).attr("stroke-linecap","butt").attr("stroke-dasharray",c.flowArrows_?"".concat(T," ").concat(E):null).attr("data-color-key",w).attr("data-color",M);c.flowArrows_&&applyArrow(I,S,"normal");return I}(c,k,m,h,E,S,b,T);!function sankey_addMouseEvents(c,h,g){g.usesGradient;var m=g.paint,b=g.link,w=g.arrowIds;h.on("mouseover",function(){c.flowWidthGradient_?src_select(this).attr("fill",c.hoverColor_):(src_select(this).attr("stroke",c.hoverColor_),c.flowArrows_&&setHoverArrow(src_select(this),w,!0)),c._tooltip&&c._tooltip.mouseover(c.tooltip_.textFunction(b,c))}).on("mousemove",function(h){c._tooltip&&c._tooltip.mousemove(h)}).on("mouseout",function(){c.flowWidthGradient_?src_select(this).attr("fill",m):(src_select(this).attr("stroke",m),c.flowArrows_&&setHoverArrow(src_select(this),w,!1)),c._tooltip&&c._tooltip.mouseout()})}(c,P,{usesGradient:M,paint:E,link:h,arrowIds:b})})}(c,h,M,k,T,I),function addNodeStems(c,h,g){var m=g.filter(function(c){return!c.isMidpoint});h.append("g").attr("class","em-flow-node-stems").selectAll("rect").data(m,function(c){return c.id}).join("rect").attr("x",function(c){return c.x0-.5}).attr("y",function(h){return c.flowStack_?h.y0:h.y}).attr("width",1).attr("height",function(h){return c.flowStack_?Math.max(0,h.y1-h.y0):0}).attr("fill","#000")}(c,h,M),g.node()}function getBackoffAndDash(c,h,g){var m=c.flowArrows_?function arrowBackoffPxForStroke(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,g=c*(3*h)*.9;return.85*g}(h,c.flowArrowScale_):0,b=slicedToArray_slicedToArray(function pathDashForBackoff(c,h){var g=Math.max(0,function pathLength(c){var h=document.createElementNS("http://www.w3.org/2000/svg","path");return h.setAttribute("d",c),h.getTotalLength()}(c)),m=Math.max(0,g-Math.min(h,g)),b=Math.min(h,g);return[m,b]}(g,m),2);return{backoff:m,dashVis:b[0],dashGap:b[1]}}function taperedPolygonForLink(c,h){for(var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},m=g.startRatio,b=void 0===m?.25:m,w=g.samples,S=void 0===w?48:w,M=g.minStartWidth,k=void 0===M?1.5:M,T=g.capEnd,E=void 0===T?!out.flowArrows_:T,I=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,P=function samplePathByLength(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:48,g=document.createElementNS("http://www.w3.org/2000/svg","path");g.setAttribute("d",c);for(var m=g.getTotalLength(),b=[],w=0;w<=h;w++){var S=g.getPointAtLength(m*w/h);b.push([S.x,S.y])}return b}(h(c),S),L=[],B=0;B<P.length;B++){var z=P[Math.max(0,B-1)],j=P[Math.min(P.length-1,B+1)],D=j[0]-z[0],N=j[1]-z[1],R=Math.hypot(D,N)||1;L.push([-N/R,D/R])}for(var G=Math.max(k,c.width*b),q=c.width,W=[],H=[],U=P.length-1,Y=0;Y<=U;Y++){var V=(G+(q-G)*(Y/U))/2+I,$=L[Y][0]*V,X=L[Y][1]*V;W.push([P[Y][0]+$,P[Y][1]+X]),H.push([P[Y][0]-$,P[Y][1]-X])}H.reverse(),E&&(W[U][1]=H[0][1]=(W[U][1]+H[0][1])/2);for(var K="M".concat(W[0][0],",").concat(W[0][1]),Z=1;Z<W.length;Z++)K+="L".concat(W[Z][0],",").concat(W[Z][1]);for(var J=0;J<H.length;J++)K+="L".concat(H[J][0],",").concat(H[J][1]);return K+="Z"}function getFlowStroke(c,h){var g,m,b="string"==typeof c.flowColor_?c.flowColor_:"#999999";if("function"==typeof c.flowColor_)try{var w=c.flowColor_(h);if(null!=w)return w}catch(c){console.log("flowColor_ threw in sankey getFlowStroke:",c)}return function colorByTopN(c,h,g,m){if(!c.topLocationKeys||!c.flowTopLocations_||!c.flowNodes_)return m;var b=c.flowTopLocationsType_||"sum";if("origin"===b)return c.topLocationKeys.has(h)?c.topLocationColorScale(h):m;if("destination"===b)return c.topLocationKeys.has(g)?c.topLocationColorScale(g):m;return c.topLocationKeys.has(g)?c.topLocationColorScale(g):c.topLocationKeys.has(h)?c.topLocationColorScale(h):m}(c,null!==(g=h.originId)&&void 0!==g?g:"object"===_typeof(h.source)?h.source.id:h.source,null!==(m=h.destId)&&void 0!==m?m:"object"===_typeof(h.target)?h.target.id:h.target,b)}function cubicSegment(c,h){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5,m=slicedToArray_slicedToArray(c,2),b=m[0],w=m[1],S=slicedToArray_slicedToArray(h,2),M=S[0],k=S[1],T=function xi(c){return b+(M-b)*c},E=T(g),I=T(1-g);return"C".concat(E,",").concat(w," ").concat(I,",").concat(k," ").concat(M,",").concat(k)}function link_index(c){return c.index}function link_find(c,h){var g=c.get(h);if(!g)throw new Error("node not found: "+h);return g}function curve_basis_point(c,h,g){c._context.bezierCurveTo((2*c._x0+c._x1)/3,(2*c._y0+c._y1)/3,(c._x0+2*c._x1)/3,(c._y0+2*c._y1)/3,(c._x0+4*c._x1+h)/6,(c._y0+4*c._y1+g)/6)}function basis_Basis(c){this._context=c}function bundle_Bundle(c,h){this._basis=new basis_Basis(c),this._beta=h}basis_Basis.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:curve_basis_point(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1,this._line?this._context.lineTo(c,h):this._context.moveTo(c,h);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:curve_basis_point(this,c,h)}this._x0=this._x1,this._x1=c,this._y0=this._y1,this._y1=h}},bundle_Bundle.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var c=this._x,h=this._y,g=c.length-1;if(g>0)for(var m,b=c[0],w=h[0],S=c[g]-b,M=h[g]-w,k=-1;++k<=g;)m=k/g,this._basis.point(this._beta*c[k]+(1-this._beta)*(b+m*S),this._beta*h[k]+(1-this._beta)*(w+m*M));this._x=this._y=null,this._basis.lineEnd()},point:function(c,h){this._x.push(+c),this._y.push(+h)}};const hc=function custom(c){function bundle(h){return 1===c?new basis_Basis(h):new bundle_Bundle(h,c)}return bundle.beta=function(c){return custom(+c)},bundle}(.85);function drawEdgeBundleLines(c,h){var g,m=c.width_||c.innerWidth_||1e3,b=c.height_||c.innerHeight_||800,w=Math.sqrt(m*m+b*b),S={segments:linear_linear().domain([0,w]).range([1,10]),nodes:c._nodeSizeScale||pow_sqrt().range([4,18])},M=function generateSegments(c,h,g){var m={nodes:[],links:[],paths:[]};return m.nodes=c.map(function(c){return c.fx=c.x,c.fy=c.y,c}),h.forEach(function(c){for(var h=function distance(c,h){var g=c.x-h.x,m=c.y-h.y;return Math.sqrt(g*g+m*m)}(c.source,c.target),b=Math.round(g.segments(h)),w=linear_linear().domain([0,b+1]).range([c.source.x,c.target.x]),S=linear_linear().domain([0,b+1]).range([c.source.y,c.target.y]),M=c.source,k=[M],T=1;T<=b;T++){var E={x:w(T),y:S(T)};k.push(E),m.nodes.push(E),m.links.push({source:M,target:E}),M=E}k.push(c.target),m.links.push({source:M,target:c.target}),m.paths.push(k)}),m}(c.flowGraph_.nodes,c.flowGraph_.links,S),k=c.flowArrows_?c._arrowIds||{}:null,T=d3_shape_src_line().curve(hc.beta(.85)).x(function(c){return c.x}).y(function(c){return c.y}),E=h.selectAll("path.em-flow-link").data(M.paths).enter().append("path").attr("d",T).attr("class","em-flow-link").attr("fill","none").style("cursor","pointer").style("pointer-events","auto").attr("stroke-linecap","butt").attr("stroke-opacity",null!==(g=c.flowOpacity_)&&void 0!==g?g:1).each(function(h,g){var m,b,w=h[0],S=h[h.length-1],M=w.id||w.code||w.iata,T=S.id||S.code||S.iata,E=null!==(m=null===(b=c.flowGraph_.links)||void 0===b||null===(b=b[g])||void 0===b?void 0:b.value)&&void 0!==m?m:1,I=straight_getFlowStroke(c,M,T,null,E),P=straight_computeColorKey(c,M,T),L=I,B=c.strokeWidthScale(E);src_select(this).attr("data-nb",E).attr("data-origin",M).attr("data-dest",T).attr("data-color",I).attr("data-color-key",P).attr("stroke",L).attr("stroke-width",B).attr("stroke-dasharray",c.flowArrows_?"5 5":null),c.flowArrows_&&applyArrow(src_select(this),k,"normal")});E.on("mouseover",function(h,g){var m,b,w=g[0],S=g[g.length-1],M=w.id||w.code||w.iata,T=S.id||S.code||S.iata,E=null!==(m=null===(b=c.flowGraph_.links)||void 0===b||null===(b=b.find(function(c){return(c.source.id||c.source.code)===M&&(c.target.id||c.target.code)===T}))||void 0===b?void 0:b.value)&&void 0!==m?m:1;onFlowLineMouseOver(c,M,T,E,k).call(this,h)}).on("mousemove",function(h){c._tooltip&&c._tooltip.mousemove(h)}).on("mouseout",function(h,g){var m=src_select(this).attr("data-color");onFlowLineMouseOut(c,m,k).call(this,h)});var I=simulation().alphaDecay(c.flowBundleSettings_.alphaDecay).force("charge",function manyBody(){var c,h,g,m,b,w=d3_force_src_constant(-30),S=1,M=1/0,k=.81;function force(g){var b,w=c.length,S=quadtree(c,x,y).visitAfter(accumulate);for(m=g,b=0;b<w;++b)h=c[b],S.visit(apply)}function initialize(){if(c){var h,g,m=c.length;for(b=new Array(m),h=0;h<m;++h)g=c[h],b[g.index]=+w(g,h,c)}}function accumulate(c){var h,g,m,w,S,M=0,k=0;if(c.length){for(m=w=S=0;S<4;++S)(h=c[S])&&(g=Math.abs(h.value))&&(M+=h.value,k+=g,m+=g*h.x,w+=g*h.y);c.x=m/k,c.y=w/k}else{(h=c).x=h.data.x,h.y=h.data.y;do{M+=b[h.data.index]}while(h=h.next)}c.value=M}function apply(c,w,T,E){if(!c.value)return!0;var I=c.x-h.x,P=c.y-h.y,L=E-w,B=I*I+P*P;if(L*L/k<B)return B<M&&(0===I&&(B+=(I=jiggle(g))*I),0===P&&(B+=(P=jiggle(g))*P),B<S&&(B=Math.sqrt(S*B)),h.vx+=I*c.value*m/B,h.vy+=P*c.value*m/B),!0;if(!(c.length||B>=M)){(c.data!==h||c.next)&&(0===I&&(B+=(I=jiggle(g))*I),0===P&&(B+=(P=jiggle(g))*P),B<S&&(B=Math.sqrt(S*B)));do{c.data!==h&&(L=b[c.data.index]*m/B,h.vx+=I*L,h.vy+=P*L)}while(c=c.next)}}return force.initialize=function(h,m){c=h,g=m,initialize()},force.strength=function(c){return arguments.length?(w="function"==typeof c?c:d3_force_src_constant(+c),initialize(),force):w},force.distanceMin=function(c){return arguments.length?(S=c*c,force):Math.sqrt(S)},force.distanceMax=function(c){return arguments.length?(M=c*c,force):Math.sqrt(M)},force.theta=function(c){return arguments.length?(k=c*c,force):Math.sqrt(k)},force}().strength(c.flowBundleSettings_.chargeStrength).distanceMax(c.flowBundleSettings_.distanceMax?c.flowBundleSettings_.distanceMax:2*S.nodes.range()[1])).force("link",function src_link(c){var h,g,m,b,w,S,M=link_index,k=function defaultStrength(c){return 1/Math.min(b[c.source.index],b[c.target.index])},T=d3_force_src_constant(30),E=1;function force(m){for(var b=0,M=c.length;b<E;++b)for(var k,T,I,P,L,B,z,j=0;j<M;++j)T=(k=c[j]).source,P=(I=k.target).x+I.vx-T.x-T.vx||jiggle(S),L=I.y+I.vy-T.y-T.vy||jiggle(S),P*=B=((B=Math.sqrt(P*P+L*L))-g[j])/B*m*h[j],L*=B,I.vx-=P*(z=w[j]),I.vy-=L*z,T.vx+=P*(z=1-z),T.vy+=L*z}function initialize(){if(m){var S,k,T=m.length,E=c.length,I=new Map(m.map((c,h)=>[M(c,h,m),c]));for(S=0,b=new Array(T);S<E;++S)(k=c[S]).index=S,"object"!=typeof k.source&&(k.source=link_find(I,k.source)),"object"!=typeof k.target&&(k.target=link_find(I,k.target)),b[k.source.index]=(b[k.source.index]||0)+1,b[k.target.index]=(b[k.target.index]||0)+1;for(S=0,w=new Array(E);S<E;++S)k=c[S],w[S]=b[k.source.index]/(b[k.source.index]+b[k.target.index]);h=new Array(E),initializeStrength(),g=new Array(E),initializeDistance()}}function initializeStrength(){if(m)for(var g=0,b=c.length;g<b;++g)h[g]=+k(c[g],g,c)}function initializeDistance(){if(m)for(var h=0,b=c.length;h<b;++h)g[h]=+T(c[h],h,c)}return null==c&&(c=[]),force.initialize=function(c,h){m=c,S=h,initialize()},force.links=function(h){return arguments.length?(c=h,initialize(),force):c},force.id=function(c){return arguments.length?(M=c,force):M},force.iterations=function(c){return arguments.length?(E=+c,force):E},force.strength=function(c){return arguments.length?(k="function"==typeof c?c:d3_force_src_constant(+c),initializeStrength(),force):k},force.distance=function(c){return arguments.length?(T="function"==typeof c?c:d3_force_src_constant(+c),initializeDistance(),force):T},force}().strength(c.flowBundleSettings_.linkStrength).distance(0).iterations(c.flowBundleSettings_.linkIterations)).on("tick",function(){return E.attr("d",T)}).on("end",function(){return console.log("layout complete")});I.nodes(M.nodes),I.force("link").links(M.links)}function straight_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function straight_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return straight_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?straight_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function straight_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function createFlowMap(c,h){!function drawStraightLinesByFlow(c,h){if(null==c||!c.flowGraph_)return;var g=c.svg_||h,m=c.flowArrows_?ensureArrowMarkers(g,{cacheKey:"straight",scale:c.flowArrowScale_||1,markerUnits:"strokeWidth",hoverColor:c.hoverColor_||"black",outlineColor:c.flowOutlineColor_||"#ffffff",useContextStroke:!0}):null,b=function buildSegments(c){var h=c.flowGraph_||{},g=h.nodes,m=void 0===g?[]:g,b=h.links,w=void 0===b?[]:b;c._nodeById=c._nodeById||new Map(m.map(function(c){return[c.id,c]}));var S=[];if(c.flowBidirectional_){var M,k=straight_createForOfIteratorHelper(buildBidirectionalRouteMap(m,w).values());try{for(k.s();!(M=k.n()).done;){var T=M.value,E=T.idA,I=T.idB,P=T.nodeA,L=T.nodeB,B=T.flowAB,z=T.flowBA,j=(P.x+L.x)/2,D=(P.y+L.y)/2;B>0&&z>0?(S.push({originId:E,destId:I,x1:j,y1:D,x2:L.x,y2:L.y,value:B,route:T,nodeA:P,nodeB:L,isHalf:!0}),S.push({originId:I,destId:E,x1:j,y1:D,x2:P.x,y2:P.y,value:z,route:T,nodeA:P,nodeB:L,isHalf:!0})):B>0?S.push({originId:E,destId:I,x1:P.x,y1:P.y,x2:L.x,y2:L.y,value:B,route:T,nodeA:P,nodeB:L}):z>0&&S.push({originId:I,destId:E,x1:L.x,y1:L.y,x2:P.x,y2:P.y,value:z,route:T,nodeA:P,nodeB:L})}}catch(c){k.e(c)}finally{k.f()}}else{var N,R=new Map,G=(c.flowGraph_||{}).links,q=void 0===G?[]:G,W=c._nodeById,H=straight_createForOfIteratorHelper(q);try{for(H.s();!(N=H.n()).done;){var U=N.value,Y=dc(U.source),V=dc(U.target);if(Y&&V&&Y!==V){var $=Y<V?"".concat(Y,"|").concat(V):"".concat(V,"|").concat(Y),X=+U.value||+U.nb||0;if(X>0){var K=W.get(Y)||("object"===_typeof(U.source)?U.source:null),Z=W.get(V)||("object"===_typeof(U.target)?U.target:null);if(K&&Z){var J=R.get($);J?J.value+=X:R.set($,{originId:Y,destId:V,nodeA:K,nodeB:Z,value:X,get x1(){return this.nodeA.x},get y1(){return this.nodeA.y},get x2(){return this.nodeB.x},get y2(){return this.nodeB.y}})}}}}}catch(c){H.e(c)}finally{H.f()}S.push.apply(S,toConsumableArray_toConsumableArray(R.values()))}return S}(c);!function assignWidths(c,h){var g,m=straight_createForOfIteratorHelper(h);try{for(m.s();!(g=m.n()).done;){var b=g.value,w="function"==typeof c.strokeWidthScale?c.strokeWidthScale(b.value):b.value||1;b.width=+(null==w?1:w).toFixed(1)}}catch(c){m.e(c)}finally{m.f()}}(c,b);var w=function prepareGradients(c,h,g){var m=c.flowColorGradient_||c.flowOpacityGradient_;if(!m)return null;for(var b=c.svg_||h,w=b.select("defs").empty()?b.append("defs"):b.select("defs"),S=new Map,M=new Array(g.length),k=0;k<g.length;k++){var T=g[k],E=straight_getFlowStroke(c,T.originId,T.destId,T.route,T.value),I="".concat(Math.round(T.x1),":").concat(Math.round(T.y1),":").concat(Math.round(T.x2),":").concat(Math.round(T.y2),":").concat(E,":").concat(c.flowOpacityGradient_?1:0),P=S.get(I);if(!P){var L,B;P=generateUniqueId("flowgrad"),S.set(I,P);var z=w.append("linearGradient").attr("id",P).attr("gradientUnits","userSpaceOnUse").attr("x1",T.x1).attr("y1",T.y1).attr("x2",T.x2).attr("y2",T.y2),j=c.flowColorGradient_&&null!==(L=null===(B=c.flowRegionColors_)||void 0===B?void 0:B[0])&&void 0!==L?L:E,D=c.flowOpacityGradient_?0:1,N=1;z.append("stop").attr("offset","0%").attr("stop-color",j).attr("stop-opacity",D),z.append("stop").attr("offset","100%").attr("stop-color",E).attr("stop-opacity",N)}M[k]=P}return M}(c,h,b);!function drawSegments(c,h,g,m,b){var w=h.select(".em-flow-lines").empty()?h.append("g").attr("class","em-flow-lines").attr("id","em-flow-lines"):h.select(".em-flow-lines"),S=!!m;if(c.flowEdgeBundling_)return void drawEdgeBundleLines(c,w);for(var M=0;M<g.length;M++){var k=g[M],T=straight_getFlowStroke(c,k.originId,k.destId,k.route,k.value),E=straight_computeColorKey(c,k.originId,k.destId),I=S&&m[M]?"url(#".concat(m[M],")"):T,P=void 0;if(c.flowWidthGradient_){var L,B,z,j,D,N=k.x2-k.x1,R=k.y2-k.y1,G=Math.hypot(N,R)||1,q=-R/G,W=N/G,H=null!==(L=null===(B=c.flowWidthGradientSettings_)||void 0===B?void 0:B.startRatio)&&void 0!==L?L:.25,U=null!==(z=null===(j=c.flowWidthGradientSettings_)||void 0===j?void 0:j.minStartWidth)&&void 0!==z?z:.25*k.width,Y=Math.max(U,k.width*H),V=k.width,$=k.x1+q*(Y/2),X=k.y1+W*(Y/2),K=k.x2+q*(V/2),Z=k.y2+W*(V/2),J=k.x2-q*(V/2),Q=k.y2-W*(V/2),tt=k.x1-q*(Y/2),et=k.y1-W*(Y/2),nt="M".concat($,",").concat(X,"L").concat(K,",").concat(Z,"L").concat(J,",").concat(Q,"L").concat(tt,",").concat(et,"Z");P=w.append("path").attr("d",nt).attr("class","em-flow-link em-flow-link-tapered").attr("fill",I).attr("data-color-key",E).attr("data-color",T).attr("data-nb",k.value).attr("data-origin",k.originId).attr("data-dest",k.destId).attr("opacity",null!==(D=c.flowOpacity_)&&void 0!==D?D:1),c.flowArrows_&&applyArrow(P,b,"normal")}else{var rt,ot=Math.hypot(k.x2-k.x1,k.y2-k.y1)||0,at=c.flowArrows_?straight_arrowBackoffPxForStroke(k.width):0,it=Math.max(0,ot-at),st=c.flowArrows_?Math.min(at,ot):null;P=w.append("line").datum(k).attr("x1",function(c){return c.x1}).attr("y1",function(c){return c.y1}).attr("x2",function(c){return c.x2}).attr("y2",function(c){return c.y2}).attr("class","em-flow-link").attr("data-nb",k.value).attr("data-origin",k.originId).attr("data-dest",k.destId).attr("stroke",I).attr("stroke-width",k.width).attr("stroke-opacity",null!==(rt=c.flowOpacity_)&&void 0!==rt?rt:1).attr("stroke-linecap","butt").attr("stroke-dasharray",c.flowArrows_?"".concat(it," ").concat(st):null).attr("data-color",T).attr("data-color-key",E)}P.on("mouseover",onFlowLineMouseOver(c,k.originId,k.destId,k.value,b)).on("mousemove",onFlowLineMouseMove(c)).on("mouseout",onFlowLineMouseOut(c,T,b)),c.flowArrows_&&applyArrow(P,b,"normal")}}(c,h,b,w,m)}(c,h)}var dc=function idFor(c){var h,g;return c&&"object"===_typeof(c)?null!==(h=null!==(g=c.id)&&void 0!==g?g:c.iata)&&void 0!==h?h:c.code:c};function straight_arrowBackoffPxForStroke(c){return.7*(c*(3*(out.flowArrowScale_||1))*.9)}function straight_getFlowStroke(c,h,g,m,b){var w="string"==typeof c.flowColor_?c.flowColor_:"#999999",S=c._nodeById||new Map(c.flowGraph_.nodes.map(function(c){return[c.id,c]})),M={source:S.get(h)||{id:h},target:S.get(g)||{id:g},value:b,route:m};if("function"==typeof c.flowColor_){var k;try{k=c.flowColor_(M)}catch(c){}if(null==k&&c.flowColor_.length>=3)try{k=c.flowColor_(h,g,m)}catch(c){}if(null!=k)return k}return function straight_colorByTopN(c,h,g,m){if(!c.topLocationKeys||!c.flowTopLocations_)return m;var b=c.flowTopLocationsType_||"sum";if("origin"===b)return c.topLocationKeys.has(h)?c.topLocationColorScale(h):m;if("destination"===b)return c.topLocationKeys.has(g)?c.topLocationColorScale(g):m;return c.topLocationKeys.has(g)?c.topLocationColorScale(g):c.topLocationKeys.has(h)?c.topLocationColorScale(h):m}(c,h,g,w)}function straight_computeColorKey(c,h,g){if(!c.topLocationKeys)return null;var m=c.flowTopLocationsType_||"sum";return"origin"===m?c.topLocationKeys.has(h)?h:"Other":"destination"===m?c.topLocationKeys.has(g)?g:"Other":c.topLocationKeys.has(g)?g:c.topLocationKeys.has(h)?h:"Other"}function onFlowLineMouseOver(c,h,g,m,b){return function(w){var S=c.hoverColor_||"black";if(src_select(this).attr("stroke",S).attr("stroke-opacity",1),c.flowArrows_&&setHoverArrow(src_select(this),b,!0),c._tooltip){var M=c.flowGraph_.nodes.find(function(c){return c.id===h}),k=c.flowGraph_.nodes.find(function(c){return c.id===g}),T={source:M,target:k,value:m};c._tooltip.mouseover(c.tooltip_.textFunction(T,c))}}}function onFlowLineMouseMove(c){return function(h){c._tooltip&&c._tooltip.mousemove(h)}}function onFlowLineMouseOut(c,h,g){return function(){src_select(this).attr("stroke",h).attr("stroke-opacity",c.flowOpacity_),c.flowArrows_&&setHoverArrow(src_select(this),g,!1),c._tooltip&&c._tooltip.mouseout()}}function donuts_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function donuts_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return donuts_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?donuts_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function donuts_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function drawNodeDonuts(c,h){!function computeDonutValues(c){var h,g=c.flowGraph_.nodes,m=c.topLocationKeys||new Set,b=(c.topLocationColorScale,c.flowTopLocationsType_),w=donuts_createForOfIteratorHelper(g);try{var S=function _loop(){var g,w=h.value,S=new Map,M=0,k=donuts_createForOfIteratorHelper(w.targetLinks);try{for(k.s();!(g=k.n()).done;){var T=g.value,E=T.source.id;if(E!==w.id){var I=void 0;I="origin"===b?m.has(E)?E:"Other":"destination"===b?m.has(w.id)?w.id:"Other":m.has(E)||m.has(w.id)?m.has(w.id)?w.id:E:"Other",S.set(I,(S.get(I)||0)+T.value)}else c.flowInternal_&&(M+=T.value)}}catch(c){k.e(c)}finally{k.f()}var P,L=donuts_createForOfIteratorHelper(w.sourceLinks);try{for(L.s();!(P=L.n()).done;){var B=P.value,z=B.target.id;if(z!==w.id){var j=void 0;j="origin"===b?m.has(w.id)?w.id:"Other":"destination"===b?m.has(z)?z:"Other":m.has(z)||m.has(w.id)?m.has(z)?z:w.id:"Other",S.set(j,(S.get(j)||0)+B.value)}else c.flowInternal_&&(M+=B.value)}}catch(c){L.e(c)}finally{L.f()}w.donutValues=Array.from(S.entries()).map(function(h){var g=slicedToArray_slicedToArray(h,2),m=g[0];return{label:m,value:g[1],color:getSegmentColor(m,w.id,c)}}),c.flowInternal_&&M>0&&w.donutValues.push({label:"Internal",value:M,color:"#999"})};for(w.s();!(h=w.n()).done;)S()}catch(c){w.e(c)}finally{w.f()}}(c),function computeDonutLocationStats(c){var h,g={},m=donuts_createForOfIteratorHelper(c.flowGraph_.nodes);try{for(m.s();!(h=m.n()).done;){var b=h.value;g[b.id]={x:b.x,y:b.y,incoming:0,outgoing:0,internal:0}}}catch(c){m.e(c)}finally{m.f()}var w,S=donuts_createForOfIteratorHelper(c.flowGraph_.links);try{for(S.s();!(w=S.n()).done;){var M=w.value,k=M.source.id,T=M.target.id;g[k]&&(g[k].outgoing+=M.value),g[T]&&(g[T].incoming+=M.value),k===T&&(g[k].internal+=M.value)}}catch(c){S.e(c)}finally{S.f()}c.locationStats=g}(c);var g=h.append("g").attr("class","donuts").attr("id","donuts"),m=max_max(c.flowGraph_.nodes,function(c){return sum_sum(c.donutValues,function(c){return c.value})});c._nodeSizeScale=c.flowNodeSizeScale_||pow_sqrt().domain([0,m]).range([3,10]);var b=src_arc().innerRadius(5),w=src_pie().value(function(c){return c.value}).sort(null);Object.entries(c.locationStats).forEach(function(h){var m=slicedToArray_slicedToArray(h,2),S=m[0],M=m[1],k=M.x,T=M.y,E=M.incoming,I=M.outgoing,P=M.internal,L=c.flowInternal_?E+I+P:E+I;if(0!==L){var B=getIncomingBreakdownByOrigin(S,c),z=getOutgoingBreakdownByDestination(S,c),j=[].concat(toConsumableArray_toConsumableArray(B),toConsumableArray_toConsumableArray(z)),D=new Map;j.forEach(function(c){var h=c.color;D.set(h,(D.get(h)||0)+c.value)});var N=Array.from(D,function(c){var h=slicedToArray_slicedToArray(c,2),g=h[0];return{label:g,value:h[1],color:g}}),R=w(N);R.forEach(function(h){h.data.parent={id:S,name:c.nodeNameMap.get(S)||S,donutValues:N}});var G=g.append("g").attr("class","donut-group").attr("transform","translate(".concat(k,",").concat(T,")")).attr("data-total",L),q=c.flowNodeMouseoverFunction_||donutMouseoverFunction;G.selectAll("path").data(R).join("path").attr("d",b.innerRadius(.4*c._nodeSizeScale(L)).outerRadius(c._nodeSizeScale(L))).attr("fill",function(c){return c.data.color}).attr("stroke","white").attr("stroke-width",.5).style("cursor","pointer").on("mouseover",function(h,g){c._tooltip&&c._tooltip.mouseover(q(g,c)),pc(h,c.svg_),donuts_highlightLines(S)}).on("mousemove",function(h,g){c._tooltip&&c._tooltip.mousemove(h)}).on("mouseout",function(h,g){c._tooltip&&c._tooltip.mouseout(),fc(h,c.svg_),donuts_unhighlightLines()}),G.append("circle").attr("r",.4*c._nodeSizeScale(L)).attr("fill","white").style("cursor","pointer").on("mouseover",function(h){var g=R[0];c._tooltip&&c._tooltip.mouseover(q(g,c)),pc(h,c.svg_),donuts_highlightLines(S)}).on("mousemove",function(h){c._tooltip&&c._tooltip.mousemove(h)}).on("mouseout",function(h){c._tooltip&&c._tooltip.mouseout(),fc(h,c.svg_),donuts_unhighlightLines()})}})}function donuts_highlightLines(c){c&&src_selectAll(".em-flow-link, .em-flow-link-bundled").classed("highlighted",function(){var h=this.getAttribute("data-origin"),g=this.getAttribute("data-dest");return h===c||g===c}).classed("dimmed",function(){var h=this.getAttribute("data-origin"),g=this.getAttribute("data-dest");return!(h===c||g===c)})}function donuts_unhighlightLines(){src_selectAll(".em-flow-link, .em-flow-link-bundled").classed("highlighted",!1).classed("dimmed",!1)}function donutMouseoverFunction(c,h){var g,m,b=_t(".0%"),w=c.data.parent,S=sum_sum(w.donutValues,function(c){return c.value}),M=null===(g=h.statData)||void 0===g?void 0:g.call(h),k=(null==M||null===(m=M.unitText)||void 0===m?void 0:m.call(M))||"",T=[];T.push('\n <div class="em-tooltip-bar">\n <b><span class="em-tooltip-label-text">'.concat(w.name||w.id||"Unknown location","</span></b>\n </div>\n ")),T.push('<div class="em-tooltip-text"><table class="em-tooltip-table em-donut-tooltip-table"><tbody>');var E=getIncomingBreakdownByOrigin(w.id,h),I=sum_sum(E,function(c){return c.value});if(I>0){var P=b(I/S);T.push('\n <tr class="em-donut-tooltip-section-header">\n <td>Incoming:</td>\n <td>'.concat(Ft(I)," (").concat(P,")</td>\n </tr>\n ")),E.forEach(function(c){var h=b(c.value/S);T.push('\n <tr class="em-donut-tooltip-row">\n <td class="em-donut-tooltip-label">\n <span class="em-donut-tooltip-colorchip" style="background:'.concat(c.color,'"></span>\n <span class="em-tooltip-label-text">').concat(c.name||c.key,'</span>\n </td>\n <td class="em-donut-tooltip-value">\n ').concat(Ft(c.value)," (").concat(h,")\n </td>\n </tr>\n "))})}var L=getOutgoingBreakdownByDestination(w.id,h),B=sum_sum(L,function(c){return c.value});if(B>0){var z=b(B/S);T.push('\n <tr class="em-donut-tooltip-section-header">\n <td>Outgoing:</td>\n <td>'.concat(Ft(B)," (").concat(z,")</td>\n </tr>\n ")),L.forEach(function(c){var h=b(c.value/S);T.push('\n <tr class="em-donut-tooltip-row">\n <td class="em-donut-tooltip-label">\n <span class="em-donut-tooltip-colorchip" style="background:'.concat(c.color,'"></span>\n <span class="em-tooltip-label-text">').concat(c.name||c.key,'</span>\n </td>\n <td class="em-donut-tooltip-value">\n ').concat(Ft(c.value)," (").concat(h,")\n </td>\n </tr>\n "))})}return T.push('\n <tr class="em-donut-tooltip-total">\n <td colspan="2">Total: '.concat(Ft(S)," ").concat(k,"</td>\n </tr>\n ")),T.push("</tbody></table></div>"),T.join("")}var pc=function highlightDonut(c,h){var g=+h.attr("data-zoom")||1;src_select(c.target.parentNode).selectAll("path").each(function(){var c=src_select(this),h=+c.attr("stroke-width")||0;c.attr("data-stroke-width",h)}).attr("stroke","black").attr("stroke-width",2/g)},fc=function unhighlightDonut(c,h){var g=+h.attr("data-zoom")||1;src_select(c.target.parentNode).selectAll("path").attr("stroke","white").attr("stroke-width",function(){return(+src_select(this).attr("data-stroke-width")||0)/g})};function getIncomingBreakdownByOrigin(c,h){var g,m=h.topLocationKeys,b=h.flowTopLocationsType_,w=h.flowInternal_,S={},M=donuts_createForOfIteratorHelper(h.flowGraph_.links);try{for(M.s();!(g=M.n()).done;){var k=g.value,T=k.source.id,E=k.target.id;if(E===c)if(T!==E){var I=void 0;S[I="destination"===b?c:"origin"===b?m.has(T)?T:"Other":m.has(T)||m.has(c)?m.has(T)?T:c:"Other"]=(S[I]||0)+k.value}else w&&(S.Internal=(S.Internal||0)+k.value)}}catch(c){M.e(c)}finally{M.f()}return sortBreakdown(Object.entries(S).map(function(g){var m,b=slicedToArray_slicedToArray(g,2),w=b[0],S=b[1];return{key:w,name:(null===(m=h.nodeNameMap)||void 0===m?void 0:m.get(w))||w,value:S,color:getSegmentColor(w,c,h)}}))}function getOutgoingBreakdownByDestination(c,h){var g,m=h.topLocationKeys,b=h.flowTopLocationsType_,w=h.flowInternal_,S={},M=donuts_createForOfIteratorHelper(h.flowGraph_.links);try{for(M.s();!(g=M.n()).done;){var k=g.value,T=k.source.id,E=k.target.id;if(T===c)if(T!==E){var I=void 0;S[I="origin"===b?c:"destination"===b?m.has(E)?E:"Other":m.has(E)||m.has(c)?m.has(E)?E:c:"Other"]=(S[I]||0)+k.value}else w&&(S.Internal=(S.Internal||0)+k.value)}}catch(c){M.e(c)}finally{M.f()}return sortBreakdown(Object.entries(S).map(function(g){var m,b=slicedToArray_slicedToArray(g,2),w=b[0],S=b[1];return{key:w,name:(null===(m=h.nodeNameMap)||void 0===m?void 0:m.get(w))||w,value:S,color:getSegmentColor(w,c,h)}}))}function sortBreakdown(c){return c.sort(function(c,h){return"Other"===c.key?1:"Other"===h.key?-1:h.value-c.value})}function getSegmentColor(c,h,g){var m=g.topLocationKeys||new Set,b=g.topLocationColorScale;return"Other"===c?"#666":"Internal"===c?m.has(h)?b(h):"#999":m.has(c)?b(c):"#666"}function circles_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function circles_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return circles_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?circles_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function circles_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function drawNodeCircles(c,h){c.locationStats||function computeCircleLocationStats(c){var h,g={},m=circles_createForOfIteratorHelper(c.flowGraph_.nodes);try{for(m.s();!(h=m.n()).done;){var b=h.value;g[b.id]={x:b.x,y:b.y,incoming:0,outgoing:0,internal:0}}}catch(c){m.e(c)}finally{m.f()}var w,S=circles_createForOfIteratorHelper(c.flowGraph_.links);try{for(S.s();!(w=S.n()).done;){var M=w.value,k=M.source.id,T=M.target.id,E=M.value||0;g[k]&&(g[k].outgoing+=E),g[T]&&(g[T].incoming+=E),k===T&&(g[k].internal+=E)}}catch(c){S.e(c)}finally{S.f()}c.locationStats=g}(c);var g=c.locationStats,m=c.flowInternal_,b=Object.values(g).map(function(c){return m?c.incoming+c.outgoing+c.internal:c.incoming+c.outgoing});max_max(b.length?b:[0]);c._nodeSizeScale=c.flowNodeSizeScale_||createSqrtScale(b,c.flowMaxNodeSize_||20,c.flowMinNodeSize_||0);var w=h.append("g").attr("class","em-node-circles");Object.entries(g).forEach(function(h){var b=slicedToArray_slicedToArray(h,2),S=b[0],M=b[1],k=m?M.incoming+M.outgoing+M.internal:M.incoming+M.outgoing;if(k){var T=w.append("g").attr("class","em-node-circle-group").attr("transform","translate(".concat(M.x,",").concat(M.y,")")).attr("data-id",S),E=c._nodeSizeScale(k);T.append("circle").attr("r",E).attr("class","em-node-circle").attr("fill",function nodeFill(h){var g;return null!==(g=c.topLocationKeys)&&void 0!==g&&g.has(h)?c.topLocationColorScale(h):"string"==typeof c.flowColor_?c.flowColor_:"#2d50a0"}(S)).attr("stroke","white").attr("stroke-width",.5).style("cursor","pointer").on("mouseover",function(h){src_select(this).attr("stroke-width",1.5),c._tooltip&&c._tooltip.mouseover(function makeTooltip(h){var b,w,S,M=g[h],k=M.incoming,T=M.outgoing,E=M.internal,I=m?k+T+E:k+T,P=(null===(b=c.statData)||void 0===b||null===(b=b.call(c))||void 0===b||null===(w=b.unitText)||void 0===w?void 0:w.call(b))||"";return'\n <div class="em-tooltip-bar"><b>'.concat((null===(S=c.nodeNameMap)||void 0===S?void 0:S.get(h))||h,'</b></div>\n <div class="em-tooltip-text">\n <table class="em-tooltip-table"><tbody>\n <tr><td>Incoming:</td><td style="text-align:right">').concat(Ft(k),'</td></tr>\n <tr><td>Outgoing:</td><td style="text-align:right">').concat(Ft(T),"</td></tr>\n ").concat(m?'<tr><td>Internal:</td><td style="text-align:right">'.concat(Ft(E),"</td></tr>"):"",'\n <tr class="em-tooltip-total">\n <td colspan="2" style="padding-top:4px;font-weight:bold;">\n Total: ').concat(Ft(I)," ").concat(P,"\n </td>\n </tr>\n </tbody></table>\n </div>\n ")}(S)),function circles_highlightLines(c){if(!c)return;src_selectAll(".em-flow-link, .em-flow-link-bundled").classed("highlighted",function(){var h=this.getAttribute("data-origin"),g=this.getAttribute("data-dest");return h===c||g===c}).classed("dimmed",function(){var h=this.getAttribute("data-origin"),g=this.getAttribute("data-dest");return!(h===c||g===c)})}(S)}).on("mouseout",function(h){src_select(this).attr("stroke-width",.5),c._tooltip&&c._tooltip.mouseout(h),function circles_unhighlightLines(){src_selectAll(".em-flow-link, .em-flow-link-bundled").classed("highlighted",!1).classed("dimmed",!1)}()}).on("mousemove",function(h){c._tooltip&&c._tooltip.mousemove(h)})}})}function map_flow_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function map_flow_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return map_flow_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?map_flow_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function map_flow_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}var gc=function map(c){var h=Ml(c,!0,"flow");h.strokeWidthScale=null,h.tooltip_.textFunction=_c,h.flowLineType_="curved",h.flowBidirectional_=!0,h.flowStack_=!0,h.flowEdgeBundling_=!1,h.flowCurvatureSettings_={gapX:10,padX:2,padY:2,bumpY:1,curvature:.5},h.flowColor_="#848484ff",h.flowRegionColors_=["#bbd7ee","#c7e3c6"],h.flowRegionLabels_=["Exporter","Importer"],h.flowMaxWidth_=30,h.flowMinWidth_=1,h.flowArrows_=!1,h.flowArrowScale_=.7,h.flowOutlines_=!0,h.flowOutlineWidth_=1.2,h.flowOutlineColor_="#ffffff",h.flowLabelOffsets_={x:3,y:0},h.flowOpacity_=.5,h.flowOrder_=function(c,h){var g,m,b,w,S=c.otherY-h.otherY;if(S)return S;if(c.at!==h.at)return"out"===c.at?-1:1;var M=(null!==(g=h.link.value)&&void 0!==g?g:0)-(null!==(m=c.link.value)&&void 0!==m?m:0);return M||String(null!==(b=c.link.id)&&void 0!==b?b:"").localeCompare(String(null!==(w=h.link.id)&&void 0!==w?w:""))},h.flowNodes_=!1,h.flowNodeType_="circle",h.flowMinNodeSize_=3,h.flowMaxNodeSize_=10,h.flowNodeSizeScale_=null,h.flowInternal_=!0,h.flowTopLocations_=0,h.flowTopLocationsType_="destination",h.flowColorGradient_=!1,h.flowOpacityGradient_=!1,h.flowWidthGradient_=!1,h.flowWidthGradientSettings_={startRatio:.25,samples:48,minStartWidth:1.5,capEnd:!0,curvatureFollow:!0},h.flowBundleSettings_={alphaDecay:.1,chargeStrength:10,distanceMax:null,linkStrength:.7,linkIterations:1};var g=["flowGraph_","flowColor_","flowRegionColors_","flowRegionLabels_","flowArrows_","flowArrowScale_","flowMaxWidth_","flowMinWidth_","flowOutlines_","flowOutlineWidth_","flowOutlineColor_","flowColorGradient_","flowStack_","flowNodes_","flowNodeType_","flowLabelOffsets_","flowLineType_","flowNodeSizeScale_","flowOpacity_","flowInternal_","flowTopLocations_","flowTopLocationsType_","flowCurvatureSettings_","flowOrder_","flowWidthGradient_","flowOpacityGradient_","flowWidthGradientSettings_","flowBidirectional_","flowEdgeBundling_","flowBundleSettings_"];return g.forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&g.forEach(function(g){var m=g.slice(0,-1);null!=c[m]&&h[m](c[m])}),h.updateStyle=function(){var c;h.flowNodes_&&"donut"===h.flowNodeType_&&0==h.flowTopLocations_&&(h.flowTopLocations_=4),function prepareFlowGraph(c){(function addCoordinatesToGraph(c){c.flowGraph_.nodes.forEach(function(h){if("number"!=typeof h.x||"number"!=typeof h.y)if(c.Geometries.centroidsFeatures){var g=c.Geometries.centroidsFeatures.find(function(c){return h.id==c.properties.id});if(g){var m=slicedToArray_slicedToArray(g.geometry.coordinates,2),b=m[0],w=m[1];h.x=b,h.y=w}else console.error("could not find coordinates for",h.id)}else{var S,M,k,T=null===(S=(M=c.Geometries).getRegionFeatures)||void 0===S?void 0:S.call(M),E=null==T?void 0:T.find(function(c){return c.properties.id===h.id}),I=slicedToArray_slicedToArray((null==E||null===(k=E.properties)||void 0===k?void 0:k.centroid)||c._pathFunction.centroid(E),2),P=I[0],L=I[1];h.x=P,h.y=L}})})(c),function projectAllNodeCoordinates(c){var h,g=c.flowGraph_.nodes,m=map_flow_createForOfIteratorHelper(g);try{for(m.s();!(h=m.n()).done;){var b=h.value,w=c._projection([b.x,b.y]);b.x=w[0],b.y=w[1]}}catch(c){m.e(c)}finally{m.f()}}(c),function calculateNodeTotals(c){var h=c.flowGraph_,g=h.nodes,m=h.links,b=new Map;m.forEach(function(c){b.set(c.source,(b.get(c.source)||0)+c.value),b.set(c.target,(b.get(c.target)||0)+c.value)}),g.forEach(function(c){c.value=b.get(c.id)||0})}(c),function computeNodeLinks(c){var h,g=c.flowGraph_.nodes,m=c.flowGraph_.links,b=function id(c){return c.id},w=map_flow_createForOfIteratorHelper(g.entries());try{for(w.s();!(h=w.n()).done;){var S=slicedToArray_slicedToArray(h.value,2),M=S[0],k=S[1];k.index=M,k.sourceLinks=[],k.targetLinks=[]}}catch(c){w.e(c)}finally{w.f()}var T,E=new Map(g.map(function(c,h){return[b(c,h,g),c]})),I=map_flow_createForOfIteratorHelper(m.entries());try{for(I.s();!(T=I.n()).done;){var P=slicedToArray_slicedToArray(T.value,2),L=P[0],B=P[1];B.index=L;var z=B.source,j=B.target;"object"!==_typeof(z)&&(z=B.source=map_flow_find(E,z)),"object"!==_typeof(j)&&(j=B.target=map_flow_find(E,j)),z.sourceLinks.push(B),j.targetLinks.push(B)}}catch(c){I.e(c)}finally{I.f()}}(c),c.flowTopLocations_&&function computeTopFlowLocations(c){var h=c.flowGraph_.nodes,g=c.flowTopLocations_,m=c.flowTopLocationsType_||"sum";h.forEach(function(c){var h=c.sourceLinks.reduce(function(c,h){return c+h.value},0),g=c.targetLinks.reduce(function(c,h){return c+h.value},0);c.topScore="origin"===m?h:"destination"===m?g:h+g});var b=toConsumableArray_toConsumableArray(h).sort(function(c,h){return h.topScore-c.topScore}).slice(0,g);c.topLocationKeys=new Set(b.map(function(c){return c.id})),c.topLocationColorScale=ordinal().domain(b.map(function(c){return c.id})).range(["#00B3E3","#FBBA00","#2BA966","#D23142","#005289","#93397F","#E73E11","#4E4084","#056731","#00667E","#B5B900"])}(c);(function computeMaxMinFlowCounts(c){var h=c.flowGraph_.links.map(function(c){return c.value}).filter(function(c){return c>0});c.maxFlowCount=h.length?max_max(h):0,c.minFlowCount=h.length?min_min(h):0})(c),c.nodeNameMap=new Map(c.flowGraph_.nodes.map(function(c){return[c.id,c.name||c.id]}))}(h),function defineWidthScale(c){var h=c.flowGraph_.links,g=h.map(function(c){return c.value}).filter(function(c){return c>0}),m=max_max(g),b=(min_min(g),Math.max(0,c.flowMinWidth_||0)),w=c.flowMaxWidth_,S=linear_linear().domain([0,m]).range([0,w]).clamp(!0),M=function strokeWidthScale(c){var h=+c;return!Number.isFinite(h)||h<=0?0:Math.max(b,S(h))};M.domain=function(){return arguments.length?(S.domain.apply(S,arguments),M):S.domain()},c.strokeWidthScale=M}(h);var g=src_select("#em-zoom-group-"+h.svgId_),m=g.select("#em-flow-container");m.empty()?m=g.append("g").attr("id","em-flow-container").attr("class","em-flow-container"):m.selectAll("*").remove();var b,w=m.node();w&&w.previousSibling&&(null===(b=w.parentNode)||void 0===b||b.insertBefore(w,w.previousSibling));if(function addOverlayPolygons(c){var h=c.flowGraph_,g=[],m=[],b=c.Geometries.getRegionFeatures();if(!b)return;if(h.nodes.forEach(function(c){var h=c.sourceLinks.reduce(function(c,h){return c+h.value},0),w=c.targetLinks.reduce(function(c,h){return c+h.value},0);b.find(function(h){return h.properties.id===c.id})?w>h?g.push(c.id):h>w&&m.push(c.id):console.log("could not find region geometry for",c.id)}),c.importerRegionIds=g,c.exporterRegionIds=m,0===g.length&&0===m.length)return void console.log("No importer or exporter regions found in the flow graph.");var w=zt(c),S=c.svg_.selectAll(w);S.each(function(){var h=this.__data__.properties.id;src_select(this).style("fill",function(){return g.includes(h)?c.flowRegionColors_[1]:m.includes(h)?c.flowRegionColors_[0]:null}).attr("class",function(){return g.includes(h)?"em-flow-importer":m.includes(h)?"em-flow-exporter":null})})}(h),"curved"===h.flowLineType_||"sankey"===h.flowLineType_?createSankeyFlowMap(h,m):createFlowMap(h,m),h.flowNodes_&&("donut"===h.flowNodeType_?drawNodeDonuts(h,m):drawNodeCircles(h,m)),null!==(c=h.labels_)&&void 0!==c&&c.values){var S=h.svg().select("#em-zoom-group-"+h.svgId_);!function addFlowValueLabels(c,h){var g,m=h.select("#em-labels"),b=m.empty()?h.append("g").attr("id","em-labels"):m,w=c.flowGraph_.nodes.filter(function(c){return c.targetLinks&&0===c.sourceLinks.length}),S=ensureGroup(b,"em-flow-labels");null!==(g=c.labels_)&&void 0!==g&&g.shadows&&S.append("g").attr("class","em-flow-label-shadow").selectAll("text").data(w).join("text").attr("text-anchor",function(c){return c.x>c.targetLinks[0].source.x?"start":"end"}).attr("x",function(h){return h.x>h.targetLinks[0].source.x?h.x+c.flowLabelOffsets_.x:h.x-c.flowLabelOffsets_.x}).attr("y",function(h){return h.y+c.flowLabelOffsets_.y}).text(function(h){return c._statLabelFormatter(h.value)});var M=S.append("g").attr("class","em-flow-label").selectAll("g").data(w).join("g").attr("transform",function(c){return"translate(".concat(c.x,", ").concat(c.y,")")});M.append("text").attr("class","em-label-text").attr("text-anchor",function(c){return c.x>c.targetLinks[0].source.x?"start":"end"}).attr("x",function(h){return h.x>h.targetLinks[0].source.x?c.flowLabelOffsets_.x:-c.flowLabelOffsets_.x}).attr("y",c.flowLabelOffsets_.y).text(function(h){return c._statLabelFormatter(h.value)}),c.labels_.backgrounds&&M.each(function(){var c=src_select(this).select("text").node().getBBox();src_select(this).insert("rect","text").attr("class","em-label-background").attr("x",c.x-5).attr("y",c.y-2).attr("width",c.width+10).attr("height",c.height+4)})}(h,S)}},h.updateClassification=function(){},h.getLegendConstructor=function(){return uc},h};function map_flow_find(c,h){var g=c.get(h);if(!g)throw new Error("missing: "+h);return g}var _c=function flowMapTooltipFunction(c,h){var g,m,b=[],w=h.statData().unitText()||"",S=null!==(g=c.originId)&&void 0!==g?g:c.source.isMidpoint?null:c.source.id,M=null!==(m=c.destId)&&void 0!==m?m:c.target.isMidpoint?null:c.target.id,k=h._nodeById||new Map,T=k.get(S)||{id:S,name:S},E=k.get(M)||{id:M,name:M},I=T.name||T.id,P=E.name||E.id,L="".concat(I," to ").concat(P);return b.push('\n <div class="em-tooltip-bar">\n <b>'.concat(L,"</b>\n </div>\n ")),b.push("\n <div class='em-tooltip-text'>\n <table class=\"em-tooltip-table\">\n <tbody>\n <tr><td>".concat(Ft(c.value)," ").concat(w,"</td></tr>\n </tbody>\n </table>\n </div>\n ")),b.join("")};function radial_square(c){return Math.sign(c)*c*c}function radial(){var c,h=continuous(),g=[0,1],m=!1;function scale(g){var b=function unsquare(c){return Math.sign(c)*Math.sqrt(Math.abs(c))}(h(g));return isNaN(b)?c:m?Math.round(b):b}return scale.invert=function(c){return h.invert(radial_square(c))},scale.domain=function(c){return arguments.length?(h.domain(c),scale):h.domain()},scale.range=function(c){return arguments.length?(h.range((g=Array.from(c,src_number_number)).map(radial_square)),scale):g.slice()},scale.rangeRound=function(c){return scale.range(c).round(!0)},scale.round=function(c){return arguments.length?(m=!!c,scale):m},scale.clamp=function(c){return arguments.length?(h.clamp(c),scale):h.clamp()},scale.unknown=function(h){return arguments.length?(c=h,scale):c},scale.copy=function(){return radial(h.domain(),g).round(m).clamp(h.clamp()).unknown(c)},initRange.apply(scale,arguments),linearish(scale)}function offset_none(c,h){if((b=c.length)>1)for(var g,m,b,w=1,S=c[h[0]],M=S.length;w<b;++w)for(m=S,S=c[h[w]],g=0;g<M;++g)S[g][1]+=S[g][0]=isNaN(m[g][1])?m[g][0]:m[g][1]}function order_none(c){for(var h=c.length,g=new Array(h);--h>=0;)g[h]=h;return g}function stack_stackValue(c,h){return c[h]}function stackSeries(c){const h=[];return h.key=c,h}function src_stack(){var c=node_modules_d3_shape_src_constant([]),h=order_none,g=offset_none,m=stack_stackValue;function stack(b){var w,S,M=Array.from(c.apply(this,arguments),stackSeries),k=M.length,T=-1;for(const c of b)for(w=0,++T;w<k;++w)(M[w][T]=[0,+m(c,M[w].key,T,b)]).data=c;for(w=0,S=d3_shape_src_array(h(M));w<k;++w)M[S[w]].index=w;return g(M,S),M}return stack.keys=function(h){return arguments.length?(c="function"==typeof h?h:node_modules_d3_shape_src_constant(Array.from(h)),stack):c},stack.value=function(c){return arguments.length?(m="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),stack):m},stack.order=function(c){return arguments.length?(h=null==c?order_none:"function"==typeof c?c:node_modules_d3_shape_src_constant(Array.from(c)),stack):h},stack.offset=function(c){return arguments.length?(g=null==c?offset_none:c,stack):g},stack}var mc=function legend(c,h){var g=wl(c);if(g.sizeLegend={title:null,titlePadding:15,values:null},g.colorLegend={title:null,titlePadding:15,marginTop:23,labelOffsets:{x:5,y:5},shapeWidth:25,shapeHeight:20,shapePadding:1,noData:!0,noDataText:"No data"},g.timeLegend={title:null,marginTop:20},g._sizeLegendHeight=0,h)for(var m in h)if("colorLegend"===m||"sizeLegend"===m||"timeLegend"===m)for(var b in g[m])void 0!==h[m][b]&&(g[m][b]=h[m][b]);else g[m]=h[m];function highlightRegions(c,h){var g=c.svg_.selectAll(".em-coxcomb-chart").selectAll("path[code]");g.style("fill","white"),g.filter("path[code='"+h+"']").each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}function unhighlightRegions(c){c.svg_.selectAll(".em-coxcomb-chart").selectAll("path[code]").each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}return g.update=function(){g.updateConfig(),g.updateContainer();var h=g.lgg;h.selectAll("*").remove(),g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle();var m=g.getBaseY(),b=g.getBaseX();if(c.classifierSize_){var w=h.append("g").attr("class","em-coxcomb-size-legend").attr("transform","translate(".concat(b,", ").concat(m,")"));g._sizeLegendContainer=w,drawCircleSizeLegend(g,w,g.sizeLegend.values,g.map.classifierSize_,g.sizeLegend.title,g.sizeLegend.titlePadding)}!function buildColorLegend(c,h,g){var m=c.map,b=c.colorLegend;c._colorLegendContainer=c.lgg.append("g").attr("class","em-coxcomb-color-legend");var w=0;c._sizeLegendContainer?(w=c._sizeLegendContainer.node().getBBox().height,c._colorLegendContainer.attr("transform","translate(".concat(h,",").concat(w+c.colorLegend.marginTop,")"))):c._colorLegendContainer.attr("transform","translate(".concat(h,",").concat(g,")"));b.title&&c._colorLegendContainer.append("text").attr("class","em-color-legend-title").attr("id","em-color-legend-title").attr("x",0).attr("y",c.titleFontSize).text(b.title);var S=0,M=m.catColors_,k=function _loop(h){var g=c.colorLegend.titlePadding+(b.title?c.titleFontSize:0)+S*(b.shapeHeight+b.shapePadding),w=m.catColors()[h]||"lightgray";c._colorLegendContainer.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",g).attr("width",b.shapeWidth).attr("height",b.shapeHeight).style("fill",w).on("mouseover",function(){highlightRegions(c.map,h),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,highlightRegions,h)}).on("mouseout",function(){unhighlightRegions(c.map),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,unhighlightRegions,h)}),c._colorLegendContainer.append("text").attr("class","em-legend-label").attr("x",b.shapeWidth+b.labelOffsets.x).attr("y",g+.5*b.shapeHeight).attr("dy","0.35em").text(m.catLabels_[h]||h),S++};for(var T in M)k(T);if(b.noData){var E=w+c.colorLegend.marginTop+c.colorLegend.titlePadding+(b.title?c.titleFontSize+c.boxPadding:0)+S*b.shapeHeight+S*b.shapePadding,I=c.lgg.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(c.boxPadding,",").concat(E,")"));c.appendNoDataLegend(I,c.noDataText,highlightRegions,unhighlightRegions)}}(g,b,m),function buildCoxcombTimeLegend(h,g,m){var b,w,S=h.map._coxTimes||[],M=40;if(!S.length)return;var k=m,T=g;h._sizeLegendContainer&&(k+=h._sizeLegendContainer.node().getBBox().height);h._colorLegendContainer&&(k+=h._colorLegendContainer.node().getBBox().height,k+=h.colorLegend.marginTop||0);k+=(null===(b=h.timeLegend)||void 0===b?void 0:b.marginTop)||0,k+=M;var E=18,I=2*Math.PI/S.length,P=(null===(w=h._colorLegendContainer)||void 0===w||null===(w=w.node())||void 0===w?void 0:w.getBBox().width)||0,L=T+P/2+E,B=h.lgg.append("g").attr("class","em-coxcomb-time-legend").attr("transform","translate(".concat(L,", ").concat(k+M,")")),z=src_arc().innerRadius(0).outerRadius(M).startAngle(function(c,h){return h*I}).endAngle(function(c,h){return(h+1)*I});B.selectAll("path").data(S).join("path").attr("d",function(c,h){return z(c,h)}).attr("fill","#ccc").attr("stroke","white").attr("stroke-width",.5).attr("class","em-coxcomb-legend-time-segment");var j=M+E,D=c._coxTimeLabels?c._coxTimeLabels:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];B.selectAll("text.em-coxcomb-legend-time-label").data(S).join("text").attr("class","em-legend-label em-coxcomb-legend-time-label").attr("x",function(c,h){return Math.sin(h*I+I/2)*j}).attr("y",function(c,h){return-Math.cos(h*I+I/2)*j}).attr("text-anchor","middle").attr("alignment-baseline","middle").text(function(c,h){return D[h]||c}),B.on("mouseleave",function(){(h.map.svg_||h.map.svg()).selectAll(".em-coxcomb-chart path").style("opacity",1),B.selectAll("path").style("stroke","white").style("stroke-width",.5).style("opacity",1)}),B.selectAll("path").on("mouseenter",function(c,g){var m=g;(h.map.svg_||h.map.svg()).selectAll(".em-coxcomb-chart path").style("opacity",function(c){return c&&c.data&&c.data.month===m?1:.1}),B.selectAll("path").style("opacity",.3).style("stroke","white").style("stroke-width",.5),src_select(this).style("stroke","#333").style("stroke-width",2).style("opacity",1)}).on("mouseleave",function(){src_select(this).style("stroke","white").style("stroke-width",.5).style("opacity",1)})}(g,b,m),g.setBoxDimension()},g},vc=function map(c){var h=Ml(c,!0,"coxcomb");h.coxcombMinRadius_=10,h.coxcombMaxRadius_=80,h.coxcombStrokeFill_="white",h.coxcombStrokeWidth_=.3,h.coxcombRings_=!0,h.coxcombOffsets_={x:0,y:0},h.hoverColor_="#ffa500",h.catColors_=void 0,h.catLabels_=void 0,h.classifierSize_=null;var g=["catColors_","catLabels_","noDataFillStyle_","coxcombMaxRadius_","coxcombMinRadius_","coxcombRings_","coxcombStrokeFill_","coxcombStrokeWidth_","hoverColor_","classifierSize_","coxcombOffsets_"];function applyClassificationToMap(c){if(!h.statCodes_){h.statCodes_=Object.keys(h.statData_);var g=h.statCodes_.indexOf("default");g>-1&&h.statCodes_.splice(g,1)}!function getTotals(c){var g={},m={};h.totalCode_?h._coxTimes.forEach(function(c){var b=h.statData("".concat(c,":").concat(h.totalCode_));if(b&&b._data_)for(var w in b._data_){var S,M=(null===(S=b._data_[w])||void 0===S?void 0:S.value)||0;m[w]=m[w]||{},m[w][c]=M,g[w]=(g[w]||0)+M}}):h._coxTimes.forEach(function(c){var b={};for(var w in h._coxCategoryCodes.forEach(function(g){var m=h.statData("".concat(c,":").concat(g));if(m&&m._data_)for(var w in m._data_){var S,M=(null===(S=m._data_[w])||void 0===S?void 0:S.value)||0;b[w]=(b[w]||0)+M}}),b)m[w]=m[w]||{},m[w][c]=b[w],g[w]=(g[w]||0)+b[w]});h.yearlyTotals=g,h.monthlyTotals=m}(),function computeCoxStatusMap(c){var g=h._coxTimes||[],m=h._coxCategoryCodes||[],b=!!h.totalCode_,w=new Map,S=new Set,M=function addIdsFrom(c){var g=h.statData(c);g&&g._data_&&Object.keys(g._data_).forEach(function(c){return S.add(c)})};g.forEach(function(c){b?M("".concat(c,":").concat(h.totalCode_)):m.forEach(function(h){return M("".concat(c,":").concat(h))})}),S.forEach(function(c){var S=!1,M=!1,k=!1;g.forEach(function(g){if(b){var w,T=null===(w=h.statData("".concat(g,":").concat(h.totalCode_)))||void 0===w?void 0:w.get(c);if(!T)return;S=!0,":"===T.value?M=!0:"number"==typeof T.value&&(k=!0)}else m.forEach(function(m){var b,w=null===(b=h.statData("".concat(g,":").concat(m)))||void 0===b?void 0:b.get(c);w&&(S=!0,":"===w.value?M=!0:"number"==typeof w.value&&(k=!0))})}),M?w.set(c,{value:":"}):S||k?w.set(c,{value:0}):w.set(c,null)}),h.coxStatus_=w}(),function defineSizeScales(c){var g=Object.values(h.yearlyTotals),m=h.coxcombMinRadius_||0,b=h.coxcombMaxRadius_||80,w=min_min(g)||0,S=max_max(g)||0,M=radial().domain([w,S]).range([m,b]);h.classifierChartSize_=function(c,g){var m=M(h.yearlyTotals[g]||0),b=c/Math.max.apply(Math,toConsumableArray_toConsumableArray(Object.values(h.monthlyTotals[g]||{0:1})));return Math.sqrt(b)*m},h.classifierSize_=M}()}function getRegionTotal(c){var g=h.yearlyTotals;return void 0!==g[c]?g[c]:void 0}function getCoxcombAnchors(c){return c.gridCartogram_?c.svg().selectAll("#em-grid-container .em-grid-cell"):c.getCentroidsGroup(c).selectAll("g.em-centroid")}function applyStyleToMap(c){if(h.catLabels_=h.catLabels_||{},h.svg_)if(c.gridCartogram_){!function applyStyleToGridCartogram(c,g){var m=[],b=getCoxcombAnchors(c);b.attr("id",function(c){return m.push(c.properties.id),"cox_"+c.properties.id}),function addCoxcombChartsToGridCartogram(c,g,m){var b=h._coxTimes,w=h._coxCategoryCodes,S=h.coxcombOffsets_||{x:0,y:0};"hexagon"===h.gridCartogramShape_&&(S.x-=h.coxcombWidth_-4,S.y-=h.coxcombHeight_+4);c.forEach(function(c){var g=h.svg().select("#cox_"+c);if(!g.empty()){var M=buildMonthData(c,b,w);if(M.length){var k=getActiveKeys(M,w),T=src_stack().keys(k)(M);g.selectAll(".em-coxcomb").remove();var E=g.node().getBBox(),I=E.width/2,P=E.height/2,L=g.append("g").attr("class","em-coxcomb").attr("transform","translate(".concat(I+S.x,", ").concat(P+S.y,")"));!function drawCoxcombInContainer(c,g,m,b,w,S){if(h.coxcombRings_){var M=h.yearlyTotals[g]||0,k=h.classifierSize_(M);c.append("circle").attr("class","em-coxcomb-max-outline").attr("r",0).attr("fill","none").attr("stroke","#000").attr("stroke-width",.3).attr("opacity",.5).attr("pointer-events","none").transition().duration(h.transitionDuration_/2).attr("r",k)}var T=src_arc().startAngle(function(c){return w(c.data.month)}).endAngle(function(c){return w(c.data.month)+w.bandwidth()}).padAngle(.01).padRadius(0);b.forEach(function(b,w){c.append("g").attr("class","em-coxcomb-chart").attr("stroke","#ffffff").attr("stroke-width",.3).selectAll("path").data(m[w]).join("path").attr("fill",h.catColors_[b]||("other"===b?"#FFCC80":"lightgray")).attr("code",b).attr("month",function(c){return c.data.month}).transition().delay(function(c,h){return 120*h}).duration(h.transitionDuration_).attrTween("d",function(c){var m=value(0,h.classifierChartSize_(c[0],g)),b=value(0,h.classifierChartSize_(c[1],g));return function(h){return T.innerRadius(m(h)).outerRadius(b(h))(c)}})})}(L,c,T,k,m);var B=g.select(".em-grid-shape, .em-grid-rect, .em-grid-hexagon").node();B&&B.nextSibling&&g.node().insertBefore(L.node(),B.nextSibling)}}})}(m,0,g),function addMouseEventsToGridCartogram(c){var g=h.svg().selectAll("#em-grid-container .em-grid-cell .em-grid-shape"),m=h.svg().selectAll("#em-grid-container .em-grid-cell .em-coxcomb"),b=function getRegionData(c){return src_select(c.closest(".em-grid-cell")).datum()},w=function getShapeForCell(c){return c.select(".em-grid-shape")},S=function handleMouseOver(c){var g=b(this);if(g&&getRegionTotal(g.properties.id)){var m=src_select(this.closest(".em-grid-cell")),S=w(m);S.attr("fill___",S.style("fill")),S.style("fill",h.hoverColor_);var M=h._lastZoomK||1;if(h.coxcombRings_){var k=m.select("circle.em-coxcomb-max-outline").node();k&&k.style.setProperty("stroke-width","".concat(2/M,"px"),"important")}else m.selectAll("g.em-coxcomb-chart").style("stroke",h.hoverColor_);h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(g,h))}},M=function handleMouseMove(c){var g=b(this);g&&(getRegionTotal(g.properties.id)&&h._tooltip&&h._tooltip.mousemove(c))},k=function handleMouseOut(c){var g=b(this);if(g&&getRegionTotal(g.properties.id)){var m=src_select(this.closest(".em-grid-cell")),S=w(m);S.style("fill",S.attr("fill___")||""),S.attr("fill___",null);var M=h._lastZoomK||1;if(h.coxcombRings_){var k=m.select("circle.em-coxcomb-max-outline").node();k&&k.style.setProperty("stroke-width","".concat(.3/M,"px"),"important")}else m.selectAll("g.em-coxcomb-chart").style("stroke","#ffffff");h._tooltip&&h._tooltip.mouseout()}};g.on("mouseover",S).on("mousemove",M).on("mouseout",k),m.style("pointer-events","all").on("mouseover",S).on("mousemove",M).on("mouseout",k)}()}(c,createAngleScale(h._coxTimes)),adjustGridCartogramTextLabels({map:c,getAnchors:getCoxcombAnchors,getRadius:function getRadius(c){return function getCoxcombTopRadius(c){var g=h._coxTimes;if(!g||0===g.length)return 0;var m=g[0],b=g[g.length-1],w=0;return[m,b].forEach(function(g){var m=0;if(h._coxCategoryCodes.forEach(function(b){var w,S=(null===(w=h.statData("".concat(g,":").concat(b)))||void 0===w||null===(w=w.get(c))||void 0===w?void 0:w.value)||0;m+=S}),h.totalCode_){var b,S=(null===(b=h.statData("".concat(g,":").concat(h.totalCode_)))||void 0===b||null===(b=b.get(c))||void 0===b?void 0:b.value)||0;S>m&&(m=S)}var M=h.classifierChartSize_(m,c);M>w&&(w=M)}),w}(c)},margin:2})}else{var g=c.getCentroidsGroup(c);if(g){var m=g.selectAll("g.em-centroid").data().filter(function(c){return void 0!==getRegionTotal(c.properties.id)});!function applyStyleToRegionPolygons(c){var g=zt(c),m=c.svg().selectAll(g),b=h.coxStatus_;"WORLD"!==c.geo_&&("mixed"==c.nutsLevel_&&function styleMixedNUTSRegions(c,g,m){m.style("display",function(c){if(!this.parentNode.classList.contains("em-cntrg"))return null==g.get(c.properties.id)?"none":"block"}),m.style("stroke",function(c){var h=src_select(this),m=h.attr("lvl"),b=g.get(c.properties.id);if(b&&null!=b.value)return"0"!==m?h.style("stroke")||"#777":void 0}).style("stroke-width",function(c){var m=src_select(this),b=m.attr("lvl"),w=g.get(c.properties.id);if(w&&null!=w.value&&"WORLD"!=h.geo_)return"0"!==b?m.style("stroke-width")||1:void 0})}(0,b,m),m.attr("ecl",function(c){var h=b.get(c.properties.id);return null==h?"ni":":"===(null==h?void 0:h.value)?"nd":null}),m.filter(function(c){var h;return":"===(null===(h=b.get(c.properties.id))||void 0===h?void 0:h.value)}).style("fill",h.noDataFillStyle()))}(c),function addMouseEventsToRegions(c){var g=function shouldOmit(h){var g;return null===(g=c.tooltip_.omitRegions)||void 0===g?void 0:g.includes(h)},m=zt(c),b=(c.svg().selectAll(m),c.svg().selectAll("g.em-centroid"));b.on("mouseover",function(c,m){if(!g(m.properties.id)&&getRegionTotal(m.properties.id)){var b=src_select(this);b.attr("fill___",b.style("fill")),b.style("fill",h.hoverColor_);var w=h._lastZoomK||1;h.coxcombRings_?b.select("circle.em-coxcomb-max-outline").node().style.setProperty("stroke-width","".concat(2/w,"px"),"important"):b.selectAll("g.em-coxcomb-chart").style("stroke",h.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(m,h))}}).on("mousemove",function(c,m){g(m.properties.id)||getRegionTotal(m.properties.id)&&h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(m,h))}).on("mouseout",function(c,m){if(!g(m.properties.id)&&getRegionTotal(m.properties.id)){var b=src_select(this);b.style("fill",b.attr("fill___")||""),b.attr("fill___",null);var w=h._lastZoomK||1;h.coxcombRings_?b.select("circle.em-coxcomb-max-outline").node().style.setProperty("stroke-width","".concat(.3/w,"px"),"important"):b.selectAll("g.em-coxcomb-chart").style("stroke","#ffffff"),h._tooltip&&h._tooltip.mouseout()}})}(c),function addCoxcombChartsToMap(c,g){var m=h._coxTimes,b=h._coxCategoryCodes,w=createAngleScale(m);c.forEach(function(c){var S=c.properties.id,M=buildMonthData(S,m,b);if(M.length){var k=getActiveKeys(M,b);!function drawCoxcomb(c,g,m,b,w){var S=w.svg().select("#ps"+c);if(S.empty())return;var M=S.selectAll("g.em-coxcomb").data([c],function(c){return c}).join(function(h){return h.append("g").attr("class","em-coxcomb").attr("id","cox_"+c)},function(c){return c},function(c){return c.remove()});if(M.selectAll("*").remove(),h.coxcombRings_){var k=h.yearlyTotals[c]||0,T=h.classifierSize_(k);M.append("circle").attr("class","em-coxcomb-max-outline").attr("r",0).attr("fill","none").attr("stroke","#000").attr("stroke-width",.3).attr("opacity",.5).attr("pointer-events","none").transition().duration(h.transitionDuration_/2).attr("r",T)}var E=src_arc().startAngle(function(c){return b(c.data.month)}).endAngle(function(c){return b(c.data.month)+b.bandwidth()}).padAngle(.01).padRadius(0);m.forEach(function(m,b){M.append("g").attr("class","em-coxcomb-chart").attr("stroke","#ffffff").attr("stroke-width",.3).selectAll("path").data(g[b]).join("path").attr("fill",h.catColors_[m]||("other"===m?"#FFCC80":"lightgray")).attr("code",m).attr("month",function(c){return c.data.month}).transition().delay(function(c,h){return 120*h}).duration(h.transitionDuration_).attrTween("d",function(g){var m=value(0,h.classifierChartSize_(g[0],c)),b=value(0,h.classifierChartSize_(g[1],c));return function(c){return E.innerRadius(m(c)).outerRadius(b(c))(g)}})})}(S,src_stack().keys(k)(M),k,w,g)}})}(m,c)}}}function getActiveKeys(c,h){var g=toConsumableArray_toConsumableArray(h);return c.some(function(c){return(c.other||0)>0})&&g.push("other"),g}function buildMonthData(c,g,m){var b=g.map(function(g){var b={month:g},w=0;if(m.forEach(function(m){var S,M=null===(S=h.statData("".concat(g,":").concat(m)))||void 0===S?void 0:S.get(c),k=(null==M?void 0:M.value)||0;b[m]=k,w+=k}),h.totalCode_){var S,M=null===(S=h.statData("".concat(g,":").concat(h.totalCode_)))||void 0===S?void 0:S.get(c),k=(null==M?void 0:M.value)||0,T=k>w?k-w:0;T>0&&(b.other=T)}return Object.values(b).some(function(c){return c&&c>0})?b:null}).filter(Boolean),w=b.some(function(c){return(c.other||0)>0});return w?h._anyRegionHasOther_=!0:b.forEach(function(c){return delete c.other}),b}function createAngleScale(c){return band().domain(c).range([0,2*Math.PI]).align(0)}return g.forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&g.forEach(function(g){var m=g.slice(0,-1);null!=c[m]&&h[m](c[m])}),h.statCodes_=void 0,h.totalCode_=void 0,h._anyRegionHasOther_=!1,h.statCoxcomb=function(c){return h._coxTimes=c.times,h._coxCategoryCodes=toConsumableArray_toConsumableArray(c.categoryCodes),h._coxTimeLabels=c.timeLabels,c.filters=c.filters||{},c.times.forEach(function(g){if(c.categoryCodes.forEach(function(m){c.stat.filters[c.timeParameter]=g,c.stat.filters[c.categoryParameter]=m;var b={};for(var w in c.stat)b[w]=c.stat[w];for(var S in b.filters={},c.stat.filters)b.filters[S]=c.stat.filters[S];var M="".concat(g,":").concat(m);h.stat(M,b),c.categoryColors&&(h.catColors_=h.catColors_||{},h.catColors_[m]=c.categoryColors[c.categoryCodes.indexOf(m)]),c.categoryLabels&&(h.catLabels_=h.catLabels_||{},h.catLabels_[m]=c.categoryLabels[c.categoryCodes.indexOf(m)])}),c.totalCode){c.stat.filters[c.timeParameter]=g,c.stat.filters[c.categoryParameter]=c.totalCode;var m={};for(var b in c.stat)m[b]=c.stat[b];for(var w in m.filters={},c.stat.filters)m.filters[w]=c.stat.filters[w];var S="".concat(g,":").concat(c.totalCode);h.stat(S,m)}}),c.totalCode&&(h.totalCode_=c.totalCode,h.catColors_.other="#FFCC80",h.catLabels_.other="Other"),h},h.updateClassification=function(){return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyClassificationToMap),applyClassificationToMap(),h},h.updateStyle=function(){if(h._anyRegionHasOther_=!1,!h.catColors_){h.catColors({});for(var c=0;c<h.statCodes_.length;c++)h.catColors_[h.statCodes_[c]]=nc[c%10]}try{var g,m;if(h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyStyleToMap),applyStyleToMap(h),h.totalCode_&&!h._anyRegionHasOther_)null===(g=h.catColors_)||void 0===g||delete g.other,null===(m=h.catLabels_)||void 0===m||delete m.other;return h.dorling_&&!h.gridCartogram_?runDorlingSimulation(h,function(c){var g=getRegionTotal(c.properties.id)||0;return h.classifierSize_(g)||0}):stopDorlingSimulation(h),h}catch(c){console.error("Error in updateStyle:",c.message),console.error(c)}return h},h.getLegendConstructor=function(){return mc},h.tooltip_.textFunction=function(c,g){var m,b=c.properties.na||c.properties.name,w=c.properties.id,S=h._coxTimes||[],M=toConsumableArray_toConsumableArray(h._coxCategoryCodes),k=S.some(function(c){var g,m=(null===(g=h.statData("".concat(c,":").concat(h.totalCode_)))||void 0===g||null===(g=g.get(w))||void 0===g?void 0:g.value)||0,b=h._coxCategoryCodes.reduce(function(g,m){var b;return g+((null===(b=h.statData("".concat(c,":").concat(m)))||void 0===b||null===(b=b.get(w))||void 0===b?void 0:b.value)||0)},0);return m>b});k&&M.push("other");var T='<div class="em-tooltip-bar">'.concat(b).concat(w?" (".concat(w,")"):"","</div>"),E=['<th class="em-breakdown-label">Month</th>'];M.forEach(function(c){var g=h.catLabels_[c]||c,m=h.catColors_[c]||("other"===c?"#FFCC80":"#999");E.push('<th class="em-breakdown-label" style="color:'.concat(m,'">').concat(g,"</th>"))}),E.push('<th class="em-breakdown-label">Total</th>');var I="<tr>".concat(E.join(""),"</tr>"),P=h.yearlyTotals||{},L=h.monthlyTotals||{},B=P[w]||0,z=S.map(function(c,g){var m,b=['<td class="em-breakdown-label">'.concat(h._coxTimeLabels?h._coxTimeLabels[g]:c,"</td>")],S=(null===(m=L[w])||void 0===m?void 0:m[c])||0;return M.forEach(function(g){var m=0;if("other"===g){var S,k=(null===(S=h.statData("".concat(c,":").concat(h.totalCode_)))||void 0===S||null===(S=S.get(w))||void 0===S?void 0:S.value)||0,T=M.filter(function(c){return"other"!==c}).reduce(function(g,m){var b;return g+((null===(b=h.statData("".concat(c,":").concat(m)))||void 0===b||null===(b=b.get(w))||void 0===b?void 0:b.value)||0)},0);m=Math.max(k-T,0)}else{var E;m=(null===(E=h.statData("".concat(c,":").concat(g)))||void 0===E||null===(E=E.get(w))||void 0===E?void 0:E.value)||0}b.push(m>0?'<td><span class="em-breakdown-value">'.concat(Ft(m),"</span></td>"):"<td></td>")}),b.push(S>0?'<td><span class="em-breakdown-value">'.concat(Ft(S),"</span></td>"):"<td></td>"),"<tr>".concat(b.join(""),"</tr>")}),j=(null===(m=h.statData(h.statCodes_[0]))||void 0===m?void 0:m.unitText())||"";return T+='<div class="em-tooltip-breakdown em-tooltip-cx"><table class="em-tooltip-cx-table">',T+=I+z.join(""),B>0&&(T+='\n <tr class="em-total">\n <td class="em-breakdown-label">Year total</td>\n <td colspan="'.concat(M.length,'"></td>\n <td>\n <span class="em-breakdown-value">').concat(Ft(B)," ").concat(j,"</span>\n </td>\n </tr>")),T+="</table></div>"},h};function map_mushroom_interactions_addMouseEvents(c,h){!function map_mushroom_interactions_addMouseEventsToSymbols(c,h){var g=c.svg().selectAll("g.em-centroid");g.on("mouseover",function(g,m){src_select(this).selectAll("path").each(function(){var c=src_select(this);c.attr("fill___",c.style("fill")),c.attr("stroke___",c.style("stroke")),c.attr("sw___",c.style("stroke-width")),c.style("fill",h.hoverColor_),c.style("stroke","black"),c.style("stroke-width",1)}),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(m,h)),h.onRegionMouseOver_&&h.onRegionMouseOver_(g,m,this,c)}).on("mousemove",function(g,m){h._tooltip&&h._tooltip.mousemove(g),h.onRegionMouseMove_&&h.onRegionMouseMove_(g,m,this,c)}).on("mouseout",function(g,m){src_select(this).selectAll("path").each(function(){var c=src_select(this),h=c.attr("fill___");h&&c.style("fill",h);var g=c.attr("sw___"),m=c.attr("stroke___");m&&c.style("stroke",m),g&&c.style("stroke-width",g)}),h._tooltip&&h._tooltip.mouseout(),h.onRegionMouseOut_&&h.onRegionMouseOut_(g,m,this,c)})}(c,h),function map_mushroom_interactions_addMouseEventsToRegions(c,h){var g=c.svg().selectAll(zt(c));g.on("mouseover",function(g,m){src_select(this).style("fill",c.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(m,h)),h.onRegionMouseOver_&&h.onRegionMouseOver_(g,m,this,c)}).on("mousemove",function(g,m){h._tooltip&&h._tooltip.mousemove(g),h.onRegionMouseMove_&&h.onRegionMouseMove_(g,m,this,c)}).on("mouseout",function(g,m){var b=src_select(this);b.style("fill",b.attr("fill___")),h._tooltip&&h._tooltip.mouseout(),h.onRegionMouseOut_&&h.onRegionMouseOut_(g,m,this,c)})}(c,h)}var yc=function legend(c,h){var g=wl(c);return g.sizeLegend={marginTop:15,values:void 0,valuesV1:void 0,valuesV2:void 0,labels:null,labelsV1:null,labelsV2:null,shapePadding:2,labelOffsets:{x:5,y:0}},g.colorLegend={marginTop:5,labelOffsets:{x:5,y:5}},null!=h&&h.sizeLegend&&Object.assign(g.sizeLegend,h.sizeLegend),null!=h&&h.colorLegend&&Object.assign(g.colorLegend,h.colorLegend),g.update=function(){if(g.updateConfig(),g.updateContainer(),g.lgg.node()){g.lgg.selectAll("*").remove(),g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle();var c=g.getBaseX(),h=g.getBaseY()+g.sizeLegend.marginTop,m=g.map.mushroomSizeScaleFunctionV1_&&g.map.mushroomSizeScaleFunctionV2_;if(m){var b=drawMushroomSizeLegend(g,c,h,"v1");drawSideLabel(g,c,b.bottom+5,"v1"),h=b.bottom;var w=drawMushroomSizeLegend(g,c,h,"v2");drawSideLabel(g,c,w.top+30,"v2")}else{var S;h=(null===(S=drawMushroomSizeLegend(g,c,h))||void 0===S?void 0:S.bottom)||g.getBaseY()+g.sizeLegend.marginTop}m||function drawColorKey(c,h,g){var m,b,w,S=c.map,M=S.mushroomColors(),k=S.mushroomCodes(),T=slicedToArray_slicedToArray(k,2),E=T[0],I=T[1],P=null!==(m=c.colorLegend.labels)&&void 0!==m?m:[(null===(b=S.statData(E))||void 0===b?void 0:b.label_)||E,(null===(w=S.statData(I))||void 0===w?void 0:w.label_)||I],L=c.lgg.append("g").attr("class","em-mushroom-color-legend").attr("transform","translate(".concat(h,", ").concat(g,")"));P.forEach(function(h,g){var m=L.append("g").attr("transform","translate(0, ".concat(g*c.shapeHeight,")")).style("cursor","pointer").on("mouseover",function(){highlightMushroomSide(S,g),S.insetTemplates_&&executeForAllInsets(S.insetTemplates_,S.svgId_,highlightMushroomSide,g)}).on("mouseout",function(){resetMushroomHighlight(S),S.insetTemplates_&&executeForAllInsets(S.insetTemplates_,S.svgId_,resetMushroomHighlight)});m.append("rect").attr("width",c.shapeWidth).attr("height",c.shapeHeight).attr("fill",M[g]).attr("class","em-legend-rect"),m.append("text").attr("x",c.shapeWidth+c.colorLegend.labelOffsets.x).attr("y",c.shapeHeight/2+c.colorLegend.labelOffsets.y).attr("class","em-legend-label").text(h)})}(g,c,h+g.colorLegend.marginTop),g.setBoxDimension()}},g};function drawSideLabel(c,h,g,m){var b,w,S=c.map,M=S.mushroomColors(),k=slicedToArray_slicedToArray(S.mushroomCodes(),2),T=k[0],E=k[1],I="v1"===m?(null===(b=S.statData(T))||void 0===b?void 0:b.label_)||T:(null===(w=S.statData(E))||void 0===w?void 0:w.label_)||E,P="v1"===m?M[0]:M[1];return c.lgg.append("text").attr("x",h).attr("y",g).style("fill",P).attr("font-weight","600").attr("dominant-baseline","hanging").attr("class","em-legend-label").text(I).node().getBBox()}function drawMushroomSizeLegend(c,h,g){var m,b,w,S,M,k=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,T=c.map,E=c.sizeLegend,I=T._mushroomScale_,P=T.mushroomSizeScaleFunctionV1_,L=T.mushroomSizeScaleFunctionV2_,B=P&&L,z=null;if("v1"===k?(M=P,z=0):"v2"===k?(M=L,z=1):M=I,!M)return g;var j=T.mushroomOrientation(),D=src_arc().innerRadius(0),N=function getSizeLegendArc(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("vertical"===c)return 0===h?{start:-Math.PI/2,end:Math.PI/2}:1===h?{start:Math.PI/2,end:3*Math.PI/2}:{start:-Math.PI/2,end:Math.PI/2};if(0===h)return{start:Math.PI,end:2*Math.PI};if(1===h)return{start:0,end:Math.PI};return{start:Math.PI,end:2*Math.PI}}(j,z),R=null!==(m=null===(b=E.labelOffsets)||void 0===b?void 0:b.x)&&void 0!==m?m:8,G=E.shapeStroke||"#000000",q=null!==(w=E.shapeStrokeWidth)&&void 0!==w?w:1,W=function getValues(c,h,g,m){var b;g?"v1"===m?b=c.valuesV1:"v2"===m&&(b=c.valuesV2):b=c.values;if(!b||!b.length){var w,S=null===(w=h.domain)||void 0===w?void 0:w.call(h);return!S||S.length<2?null:[Math.min(S[0],S[S.length-1]),Math.max(S[0],S[S.length-1])]}var M=Math.min.apply(Math,toConsumableArray_toConsumableArray(b)),k=Math.max.apply(Math,toConsumableArray_toConsumableArray(b));return b.length>1?b:[k,M]}(E,M,B,k);if(!W)return g;var H=toConsumableArray_toConsumableArray(W).sort(function(c,h){return M(h)-M(c)}),U=H.map(function(c){return M(c)}),Y=Math.max.apply(Math,toConsumableArray_toConsumableArray(U));if(!Number.isFinite(Y)||Y<=0)return g;var V=function getLabels(c,h,g,m){var b;g?"v1"===m?b=c.labelsV1:"v2"===m&&(b=c.labelsV2):b=c.labels;return b&&b.length>=h.length?b:null}(E,H,B,k),$=c.lgg.append("g").attr("class","em-mushroom-size-legend").attr("transform","translate(".concat(h,",").concat(g,")")),X=Y,K=Y,Z=T.mushroomColors(),J=B&&null!=z?Z[z]:"none";H.forEach(function(c,h){var g=M(c);if(g&&!(g<=0)){var m=$.append("g").attr("transform","translate(".concat(X,",").concat(K,")"));m.append("path").attr("d",D({startAngle:N.start,endAngle:N.end,outerRadius:g})).style("fill",J).attr("stroke",G).attr("stroke-width",q).attr("data-mushroom-side",z);var b="vertical"===j&&1===z?g:-g,w=Y+R;"horizontal"===j&&(w=10+R),m.append("line").attr("x1",0).attr("x2",w).attr("y1",b).attr("y2",b).attr("stroke",G).attr("stroke-width",.6).attr("stroke-dasharray","3,2"),m.append("text").attr("x",w+3).attr("y",b).attr("dy","0.35em").attr("dominant-baseline","middle").attr("class","em-legend-label").text(V?V[h]:Ft(c))}});var Q=null===(S=$.node())||void 0===S?void 0:S.getBBox();return Q?{top:g,bottom:g+Q.height}:{top:g,bottom:g}}function highlightMushroomSide(c,h){c.svg().selectAll("g.em-centroid path[data-mushroom-side]").style("opacity",function(){return this.getAttribute("data-mushroom-side")===String(h)?1:0})}function resetMushroomHighlight(c){c.svg().selectAll("g.em-centroid path[data-mushroom-side]").style("opacity",null)}function applyStyleToMap(c){if(c.svg()&&(c._mushroomScale_||c.mushroomSizeScaleFunctionV1_||c.mushroomSizeScaleFunctionV2_)){c.mushroomSizeScaleFunctionV1_&&c.mushroomSizeScaleFunctionV2_;var h=slicedToArray_slicedToArray(c.mushroomCodes(),2),g=h[0],m=h[1],b=c.mushroomColors(),w=c.mushroomOrientation_,S=c.statData(g),M=c.statData(m),k=src_arc().innerRadius(0),T=c.svg().selectAll("g.em-centroid");T.selectAll("*").remove(),T.each(function(h){var g,m,T=h.properties.id,E=+(null===(g=S.get(T))||void 0===g?void 0:g.value)||0,I=+(null===(m=M.get(T))||void 0===m?void 0:m.value)||0;if(0!==E||0!==I){var P,L;c.mushroomSizeScaleFunctionV1_&&c.mushroomSizeScaleFunctionV2_?(P=c.mushroomSizeScaleFunctionV1_(E),L=c.mushroomSizeScaleFunctionV2_(I)):(P=c._mushroomScale_(E),L=c._mushroomScale_(I));var B=src_select(this);"vertical"===w?(B.append("path").attr("d",k({startAngle:-Math.PI/2,endAngle:Math.PI/2,outerRadius:P})).attr("fill",b[0]).attr("class","em-mushroom-segment").attr("data-mushroom-side","0"),B.append("path").attr("d",k({startAngle:Math.PI/2,endAngle:3*Math.PI/2,outerRadius:L})).attr("fill",b[1]).attr("class","em-mushroom-segment").attr("data-mushroom-side","1")):(B.append("path").attr("d",k({startAngle:Math.PI,endAngle:2*Math.PI,outerRadius:P})).attr("fill",b[0]).attr("class","em-mushroom-segment").attr("data-mushroom-side","0"),B.append("path").attr("d",k({startAngle:0,endAngle:Math.PI,outerRadius:L})).attr("fill",b[1]).attr("class","em-mushroom-segment").attr("data-mushroom-side","1"))}}),map_mushroom_interactions_addMouseEvents(c,c)}}var Ac=function tooltipTextFunctionMushroom(c,h){var g,m,b,w,S=slicedToArray_slicedToArray(h.mushroomCodes(),2),M=S[0],k=S[1],T=c.properties.id,E=c.properties.na||"",I=h.statData(M).get(T),P=h.statData(k).get(T),L=(null===(g=(m=h.statData(M)).unitText)||void 0===g?void 0:g.call(m))||"",B=(null===(b=(w=h.statData(k)).unitText)||void 0===b?void 0:b.call(w))||"",z=function fmt(c,g){return":"===c||null==c?h.noDataText_||"No data":Ft(c)+(g?" "+g:"")};return'\n <div class="em-tooltip-bar">\n '.concat(E).concat(T?" (".concat(T,")"):"",'\n </div>\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>').concat(h.statData(M).label_||"","</td>\n <td>").concat(z(null==I?void 0:I.value,L),"</td>\n </tr>\n <tr>\n <td>").concat(h.statData(k).label_||"","</td>\n <td>").concat(z(null==P?void 0:P.value,B),"</td>\n </tr>\n </tbody>\n </table>\n </div>\n ").trim()};function legend_waffle_chart_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function legend_waffle_chart_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return legend_waffle_chart_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?legend_waffle_chart_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function legend_waffle_chart_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}var bc=function legend(c,h){var g=wl(c);if(g.sizeLegend={title:null,titlePadding:10,values:null,labelFormatter:void 0,gridSize:5,cellPadding:.5,noData:!1,noDataText:"No data"},g.colorLegend={title:null,titlePadding:10,marginTop:33,labelOffsets:{x:5,y:5},shapeWidth:25,shapeHeight:20,shapePadding:1,noData:!0,noDataText:"No data"},g._sizeLegendHeight=0,h)for(var m in h)if("colorLegend"==m||"sizeLegend"==m){for(var b in g[m])void 0!==h[m][b]&&(g[m][b]=h[m][b]);0==h.colorLegend&&(g.colorLegend=!1)}else g[m]=h[m];function highlightRegions(c,h){var g=c.svg_.selectAll(".wafflechart").selectAll("rect[code]");g.style("opacity",.2),g.filter("rect[code='"+h+"']").each(function(){src_select(this).style("opacity",1)})}function unhighlightRegions(c){c.svg_.selectAll(".wafflechart").selectAll("rect[code]").each(function(){src_select(this).style("opacity",1)})}function formatValue(c,h){return h?h(c):c>=1e6?_t(".1f")(c/1e6)+"M":c>=1e3?_t(".1f")(c/1e3)+"K":_t(".0f")(c)}return g.update=function(){g.updateConfig(),g.updateContainer();var c=g.map,h=g.lgg;h.selectAll("*").remove(),g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle();var m=g.getBaseY(),b=g.getBaseX();c.classifierSize_&&g.sizeLegend&&(g._sizeLegendContainer=h.append("g").attr("class","em-waffle-size-legend").attr("transform","translate(".concat(b,", ").concat(m,")")),function drawWaffleSizeLegend(c,h,g,m,b,w){var S=arguments.length>6&&void 0!==arguments[6]?arguments[6]:5,M=arguments.length>7&&void 0!==arguments[7]?arguments[7]:.5,k=m.domain(),T=g||[k[0],Math.round((k[0]+k[1])/2),k[1]],E=toConsumableArray_toConsumableArray(T).sort(function(c,h){return h-c}),I=0;b&&(h.append("text").attr("class","em-size-legend-title").attr("x",0).attr("y",I).attr("dominant-baseline","hanging").text(b),I+=c.titleFontSize+w);var P,L=m(E[0]),B=legend_waffle_chart_createForOfIteratorHelper(E);try{for(B.s();!(P=B.n()).done;){for(var z,j=P.value,D=m(j),N=(D-M*(S-1))/S,R=h.append("g").attr("transform","translate(0, ".concat(I,")")),G=0;G<S;G++)for(var q=0;q<S;q++)R.append("rect").attr("x",q*(N+M)).attr("y",G*(N+M)).attr("width",N).attr("height",N).attr("fill","#7f7f7f").attr("stroke","#fff").attr("stroke-width",.3).attr("rx",Math.min(1,.1*N)).attr("ry",Math.min(1,.1*N));var W=L+10,H=D/2;h.append("text").attr("class","em-legend-label").attr("x",W).attr("y",I+H).attr("dominant-baseline","middle").text(formatValue(j,null===(z=c.sizeLegend)||void 0===z?void 0:z.labelFormatter)),I+=D+8}}catch(c){B.e(c)}finally{B.f()}}(g,g._sizeLegendContainer,g.sizeLegend.values,c.classifierSize_,g.sizeLegend.title,g.sizeLegend.titlePadding,g.sizeLegend.gridSize,g.sizeLegend.cellPadding)),function buildColorLegend(c,h,g){var m=c.map,b=c.colorLegend;if(c._colorLegendContainer=c.lgg.append("g").attr("class","em-waffle-color-legend"),c._sizeLegendContainer){var w=c._sizeLegendContainer.node().getBBox().height;c._colorLegendContainer.attr("transform","translate(".concat(h,",").concat(w+c.colorLegend.marginTop,")"))}else c._colorLegendContainer.attr("transform","translate(".concat(h,",").concat(g,")"));b.title&&c._colorLegendContainer.append("text").attr("id","em-color-legend-title").attr("class","em-color-legend-title").attr("x",0).attr("y",c.titleFontSize).text(b.title);var S=0,M=m.catColors();if(Object.keys(M).reverse().forEach(function(h){var g=c.colorLegend.titlePadding+(b.title?c.titleFontSize:0)+S*(b.shapeHeight+b.shapePadding);c._colorLegendContainer.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",g).attr("width",b.shapeWidth).attr("height",b.shapeHeight).attr("rx",2).attr("ry",2).style("fill",M[h]).on("mouseover",function(){highlightRegions(c.map,h),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,highlightRegions,h)}).on("mouseout",function(){unhighlightRegions(c.map),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,unhighlightRegions,h)}),c._colorLegendContainer.append("text").attr("class","em-legend-label").attr("x",b.shapeWidth+b.labelOffsets.x).attr("y",g+.5*b.shapeHeight).attr("dy","0.35em").text(m.catLabels()[h]||h),S++}),b.noData){var k=0;c._sizeLegendContainer&&(k=c._sizeLegendContainer.node().getBBox().height);var T=k+c.colorLegend.marginTop+c.boxPadding+(b.title?c.titleFontSize+c.boxPadding:0)+S*(b.shapeHeight+b.shapePadding),E=c.lgg.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(c.boxPadding,",").concat(T,")"));c.appendNoDataLegend(E,c.noDataText,highlightRegions,unhighlightRegions)}}(g,b,m),g.setBoxDimension()},g};function map_waffle_charts_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function map_waffle_charts_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return map_waffle_charts_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?map_waffle_charts_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function map_waffle_charts_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function map_waffle_charts_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function map_waffle_charts_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?map_waffle_charts_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):map_waffle_charts_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}var xc=function map(c){var h=Ml(c,!0,"waffle");h.dorling_=(null==c?void 0:c.dorling)||!1,h.animateDorling_=!0,h.waffleMinSize_=10,h.waffleMaxSize_=30,h.waffleGridSize_=10,h.waffleCellPadding_=.5,h.waffleStrokeFill_="white",h.waffleStrokeWidth_=.2,h.waffleRoundedCorners_=1,h.waffleTooltipSize_=80,h.catColors_=void 0,h.catLabels_=void 0,h.waffleOtherColor_="#FFCC80",h.waffleOtherText_="Other",h.showOnlyWhenComplete_=!1,h.classifierSize_=null,h.statWaffle_=null,h.waffleTotalCode_=void 0,h.statCodes_=void 0,["catColors_","catLabels_","showOnlyWhenComplete_","noDataFillStyle_","waffleMaxSize_","waffleMinSize_","waffleGridSize_","waffleCellPadding_","waffleOtherColor_","waffleOtherText_","waffleStrokeFill_","waffleStrokeWidth_","waffleRoundedCorners_","waffleTooltipSize_","dorling_","animateDorling_","waffleTotalCode_","statCodes_"].forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&["catColors","catLabels","showOnlyWhenComplete","noDataFillStyle","waffleMaxSize","waffleMinSize","waffleGridSize","waffleCellPadding","waffleOtherColor","waffleOtherText","waffleStrokeFill","waffleStrokeWidth","waffleRoundedCorners","statCodes"].forEach(function(g){null!=c[g]&&h[g](c[g])}),h.statWaffle=function(c){var g=c.eurostatDatasetCode,m=c.filters,b=c.unitText,w=c.categoryParameter,S=c.categoryCodes,M=c.categoryLabels,k=c.categoryColors,T=c.totalCode;if(!g)return console.error("statWaffle: eurostatDatasetCode is required"),h;if(!w)return console.error("statWaffle: categoryParameter is required"),h;if(!S||!S.length)return console.error("statWaffle: categoryCodes array is required"),h;for(var E=m?map_waffle_charts_objectSpread({},m):{},I=0;I<S.length;I++){var P=S[I],L={eurostatDatasetCode:g,unitText:b,filters:map_waffle_charts_objectSpread(map_waffle_charts_objectSpread({},E),{},_defineProperty({},w,P))};h.stat(P,L),k&&k[I]&&(h.catColors_=h.catColors_||{},h.catColors_[P]=k[I]),M&&M[I]&&(h.catLabels_=h.catLabels_||{},h.catLabels_[P]=M[I])}if(h.statCodes_=S,T){h.waffleTotalCode_=T;var B={eurostatDatasetCode:g,unitText:b,filters:map_waffle_charts_objectSpread(map_waffle_charts_objectSpread({},E),{},_defineProperty({},w,T))};h.stat(T,B)}else h.waffleTotalCode_=void 0;return h},h.updateClassification=function(){return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,g),g(h),h};var g=function applyClassificationToMap(c){if(!h.statCodes_){h.statCodes_=Object.keys(h.statData_);var g=h.statCodes_.indexOf("default");g>-1&&h.statCodes_.splice(g,1)}var m=function getDatasetMaxMin(c){var g,m=[];g=c&&c.gridCartogram_?getWaffleAnchors(c).data():h.getCentroidsGroup(h).selectAll("g.em-centroid").data();return g.forEach(function(c){var h=c.properties.id,g=b(h);g&&m.push(g)}),[Math.min.apply(Math,m),Math.max.apply(Math,m)]}(c);return isNaN(m[0])||(h.classifierSize_=pow_sqrt().domain(m).range([h.waffleMinSize_,h.waffleMaxSize_])),h};function getWaffleAnchors(c){return c.gridCartogram_?c.svg().selectAll("#em-grid-container .em-grid-cell"):c.getCentroidsGroup(c).selectAll("g.em-centroid")}function applyStyleToMap(c){if(h.svg_)if(c.gridCartogram_)!function applyStyleToGridCartogram(c){var g=[],w=getWaffleAnchors(c);w.attr("id",function(c){return g.push(c.properties.id),"waffle_"+c.properties.id}),function addWaffleChartsToGridCartogram(c,g){var w=h.waffleGridSize_,S=h.waffleCellPadding_;c.forEach(function(c){var g=h.svg().select("#waffle_"+c);if(!g.empty()){var M=m(c);if(M){g.selectAll(".em-waffle").remove();var k=g.node().getBBox(),T="hexagon"==h.gridCartogramShape_?0:k.width/2,E="hexagon"==h.gridCartogramShape_?0:k.height/2,I=b(c),P=h.classifierSize_(I),L=(P-S*(w-1))/w,B=generateWaffleCells(M,w),z=g.append("g").attr("id","wafflechart_"+c).attr("class","em-waffle").attr("transform","translate(".concat(T-P/2,", ").concat(E-P/2,")"));z.append("g").attr("class","wafflechart").attr("stroke",h.waffleStrokeFill_).attr("stroke-width",h.waffleStrokeWidth_+"px").selectAll("rect").data(B).join("rect").attr("x",function(c){return c.col*(L+S)}).attr("y",function(c){return c.row*(L+S)}).attr("width",L).attr("height",L).attr("rx",h.waffleRoundedCorners_).attr("ry",h.waffleRoundedCorners_).attr("fill",function(c){return c.color}).attr("code",function(c){return c.code}).attr("opacity",0).transition().delay(function(c,h){return 5*h}).duration(h.transitionDuration_/2).attr("opacity",1);var j=g.select(".em-grid-shape, .em-grid-rect, .em-grid-hexagon").node();j&&j.nextSibling&&g.node().insertBefore(z.node(),j.nextSibling)}}})}(g),function addMouseEventsToGridCartogram(c){var g=h.svg().selectAll("#em-grid-container .em-grid-cell .em-grid-shape"),m=h.svg().selectAll("#em-grid-container .em-grid-cell .em-waffle"),w=function getRegionData(c){return src_select(c.closest(".em-grid-cell")).datum()},S=function getShapeForCell(c){return c.select(".em-grid-shape")},M=function getChartForCell(c){return c.select(".wafflechart")},k=function handleMouseOver(c){var g=w(this);if(g){var m=g.properties.id;if(b(m)){var k=src_select(this.closest(".em-grid-cell")),T=S(k),E=M(k);T.attr("fill___",T.style("fill")),T.style("fill",h.hoverColor_),E.empty()||E.style("stroke-width",h.waffleStrokeWidth_+.5).style("stroke","black"),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(g,h))}}},T=function handleMouseMove(c){var g=w(this);if(g){var m=g.properties.id;b(m)&&h._tooltip&&h._tooltip.mousemove(c)}},E=function handleMouseOut(c){var g=w(this);if(g){var m=g.properties.id;if(b(m)){var k=src_select(this.closest(".em-grid-cell")),T=S(k),E=M(k);T.style("fill",T.attr("fill___")||""),T.attr("fill___",null),E.empty()||E.style("stroke-width",h.waffleStrokeWidth_).style("stroke",h.waffleStrokeFill_),h._tooltip&&h._tooltip.mouseout()}}};g.on("mouseover",k).on("mousemove",T).on("mouseout",E),m.style("pointer-events","all").on("mouseover",k).on("mousemove",T).on("mouseout",E)}()}(c);else{var g=[],w=c.getCentroidsGroup(c);if(w){w.selectAll("g.em-centroid").append("g").attr("class","em-waffle").attr("id",function(c){return g.push(c),"waffle_"+c.properties.id});var S=zt(h),M=h.svg().selectAll(S);"WORLD"!==c.geo_&&"mixed"==c.nutsLevel_&&function styleMixedNUTSRegions(c,h){h.each(function(h){var g=src_select(this);if(!this.parentNode.classList.contains("em-cntrg")){var b=m(h.properties.id),w=b?"WORLD"===c.geo_?"block":null:"none",S=null,M=null;if(b)"0"!==g.attr("lvl")&&(S=g.style("stroke")||"#777","WORLD"===c.geo_&&(M=g.style("stroke-width")||"#777"));g.style("display",w).style("stroke",S).style("stroke-width",M)}})}(c,M),function addWaffleChartsToMap(c){var g=h.waffleGridSize_,w=h.waffleCellPadding_;c.forEach(function(c){var S=c.properties.id,M=m(S);if(M){var k=h.svg().selectAll("#waffle_"+S),T=b(S),E=h.classifierSize_(T),I=(E-w*(g-1))/g,P=generateWaffleCells(M,g),L=k.append("g").attr("class","wafflechart").attr("transform","translate(".concat(-E/2,", ").concat(-E/2,")")).attr("stroke",h.waffleStrokeFill_).attr("stroke-width",h.waffleStrokeWidth_+"px").style("pointer-events","none");L.selectAll("rect").data(P).join("rect").attr("x",function(c){return c.col*(I+w)}).attr("y",function(c){return c.row*(I+w)}).attr("width",I).attr("height",I).attr("rx",h.waffleRoundedCorners_).attr("ry",h.waffleRoundedCorners_).attr("fill",function(c){return c.color}).attr("code",function(c){return c.code}).attr("opacity",0).transition().delay(function(c,h){return 5*h}).duration(h.transitionDuration_/2).attr("opacity",1).on("end",function(){src_select(L.node()).style("pointer-events",null)}),L.on("mouseover",function(c,g){src_select(this).style("stroke-width",h.waffleStrokeWidth_+.5).style("stroke","black"),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(g,h))}).on("mousemove",function(c){h._tooltip&&h._tooltip.mousemove(c)}).on("mouseout",function(){src_select(this).style("stroke-width",h.waffleStrokeWidth_).style("stroke",h.waffleStrokeFill_),h._tooltip&&h._tooltip.mouseout()})}})}(g),function addMouseEventsToRegions(c,g){g.on("mouseover",function(c,g){var m=src_select(this);m.attr("fill___",m.style("fill")),m.style("fill",h.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(g,h))}).on("mousemove",function(c,g){h._tooltip&&h._tooltip.mousemove(c)}).on("mouseout",function(){var c=src_select(this);c.attr("fill___")&&(c.style("fill",c.attr("fill___")),h._tooltip&&h._tooltip.mouseout())})}(0,M)}}}function generateWaffleCells(c,g){for(var m=g*g,b=[],w=[],S=0,M=Object.keys(c),k=0;k<M.length;k++){var T=M[k],E=c[T],I=Math.round(E*m);k===M.length-1&&(I=m-S),I=Math.max(0,Math.min(I,m-S)),w.push({code:T,count:I}),S+=I}for(var P=0,L=0,B=w;L<B.length;L++)for(var z=B[L],j=z.code,D=z.count,N=0;N<D&&P<m;N++){var R=Math.floor(P/g),G=P%g;b.push({row:g-1-R,col:G,code:j,color:h.catColors_[j]||"lightgray"}),P++}return b}h.updateStyle=function(){try{if(!h.classifierSize_)return;if(!h.catColors_){h.catColors({});for(var c=0;c<h.statCodes_.length;c++)h.catColors_[h.statCodes_[c]]=nc[c%10]}return h.waffleTotalCode_&&(h.catColors_.other=h.waffleOtherColor_,h.catLabels_.other=h.waffleOtherText_),h.catLabels_=h.catLabels_||{},h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyStyleToMap),applyStyleToMap(h),h.dorling_&&!h.gridCartogram_?runDorlingSimulation(h,function(c){var g=b(c.properties.id)||0;return h.classifierSize_(g)/2||0}):stopDorlingSimulation(h),h}catch(c){console.error("Error in waffle chart styling: "+c.message),console.error(c)}};var m=function getComposition(c){for(var g={},m=0,b=h.statCodes_,w=0;w<b.length;w++){var S=b[w],M=h.statData(S).get(c),k=null==M?void 0:M.value;if(null==k||isNaN(k)){if(h.showOnlyWhenComplete())return}else g[S]=k,m+=k}if(h.waffleTotalCode_){var T=h.statData(h.waffleTotalCode_).get(c),E=null==T?void 0:T.value;m=null==E||isNaN(E)?0:E}if(m&&!isNaN(m)){var I,P=map_waffle_charts_createForOfIteratorHelper(b);try{for(P.s();!(I=P.n()).done;){var L=I.value;void 0!==g[L]&&(g[L]/=m)}}catch(c){P.e(c)}finally{P.f()}if(h.waffleTotalCode_){var B=Object.values(g).reduce(function(c,h){return c+h},0);g.other=Math.max(0,1-B)}return g}};var b=function getRegionTotal(c){var g,m=0;if(h.waffleTotalCode_)!(g=h.statData(h.waffleTotalCode_).get(c))||0!=g.value&&!g.value||isNaN(g.value)?h.showOnlyWhenComplete()&&(m=void 0):m=g.value;else for(var b=0;b<h.statCodes_.length;b++){var w=h.statCodes_[b];if(!(g=h.statData(w).get(c))||0!=g.value&&!g.value||isNaN(g.value)){if(h.showOnlyWhenComplete())return}else m+=g.value}if(0!=m)return m};h.getLegendConstructor=function(){return bc};return h.tooltip_.textFunction=function waffleChartTooltipFunction(c,g){var w=h.waffleTooltipSize_||100,S=c.properties.na||c.properties.name,M=c.properties.id,k=m(M),T="";if(T+='<div class="em-tooltip-bar">'.concat(S).concat(M?" (".concat(M,")"):"","</div>"),!k)return T+="<div>".concat(h.noDataText(),"</div>");var E,I=(w-9)/10,P="",L=map_waffle_charts_createForOfIteratorHelper(generateWaffleCells(k,10));try{for(L.s();!(E=L.n()).done;){var B=E.value,z=10+B.col*(I+1),j=10+B.row*(I+1);P+='<rect x="'.concat(z,'" y="').concat(j,'" width="').concat(I,'" height="').concat(I,'" \n fill="').concat(B.color,'" stroke="white" stroke-width="0.5" rx="1" ry="1"/>')}}catch(c){L.e(c)}finally{L.f()}var D=w+20;T+="\n <div class='em-tooltip-wafflechart-container'>\n <svg viewBox=\"0 0 ".concat(D," ").concat(D,'" width="').concat(w,'" style="display:block;">\n ').concat(P,"\n </svg>\n </div>\n "),T+='<div class="em-tooltip-breakdown">';var N,R=h.statCodes_.map(function(c){var g=h.statData(c).get(M);return g&&void 0!==g.value&&null!==g.value?{code:c,label:h.catLabels_[c],value:g.value,color:h.catColors()[c]||"#666"}:null}).filter(Boolean).sort(function(c,h){return h.value-c.value}),G=b(M)||R.reduce(function(c,h){return c+h.value},0),q=map_waffle_charts_createForOfIteratorHelper(R);try{for(q.s();!(N=q.n()).done;){var W=N.value,H=G?(W.value/G*100).toFixed(0):0;T+='\n <div class="em-breakdown-item">\n <span class="em-breakdown-color" style="background:'.concat(W.color,'"></span>\n <span class="em-breakdown-label">').concat(W.label,'</span>\n <span class="em-breakdown-value">').concat(Ft(W.value)," (").concat(isNaN(H)?0:H,"%)</span>\n </div>\n ")}}catch(c){q.e(c)}finally{q.f()}if(null!=G){var U=h.statData(h.statCodes_[0]).unitText()||"";T+='\n <div class="em-breakdown-item em-total">\n <span class="em-breakdown-label">Total</span>\n <span class="em-breakdown-value">'.concat(Ft(G)," ").concat(U,"</span>\n </div>\n ")}return T+="</div>"},h};var wc=function map(c,h){try{return"choropleth"==c||"ch"==c?Fl(h):"categorical"==c||"ct"==c?function map(c){var h=Ml(c,!1,"ct");h.classToFillStyle_=void 0,h.classToText_=void 0,h.tooltip_.textFunction=$l,h.classifier_=void 0;var g=["classToFillStyle_","classToText_","noDataFillStyle_","tooltipText_","classifier_"];g.forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&g.forEach(function(g){var m=g.slice(0,-1);null!=c[m]&&h[m](c[m])}),h.updateClassification=function(){return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,m),m(h),h};var m=function applyClassificationToMap(c){var g=h.statData().getUniqueValues(),m=toConsumableArray_toConsumableArray(Array(g.length).keys()),b=h.classToFillStyle_?h.classToFillStyle():void 0;if(b){var w=Object.keys(b);h.classifier(ordinal().domain(w).range(w.map(function(c,h){return h})))}else h.classifier(ordinal().domain(g).range(m));var S=function classifyRegions(c){c.attr("ecl",function(c){var g=h.statData().get(c.properties.id);if(g){var m=g.value;if(":"===m)return"nd";var b=isNaN(m)?m:+m;if(h.classifier().domain().includes(b))return h.classifier()(b)}})},M=zt(c);S(c.svg().selectAll(M)),"mixed"===c.nutsLevel_&&S(c.svg().selectAll("path.em-nutsrg0"))};function applyStyleToMap(c){if(c.svg_){var g=zt(c),m=c.svg().selectAll(g);m.style("pointer-events","none").transition().duration(h.transitionDuration()).style("fill",w).end().then(function(){m.style("pointer-events",null),m.each(function(){var c=src_select(this);c.attr("fill___",c.style("fill"))}),S(c,m),h.gridCartogram_&&c.svg().selectAll(".em-grid-text").each(function(){var c=src_select(this.parentNode).style("fill");src_select(this).attr("fill",Ot(c))})}).catch(function(c){}),"mixed"===h.nutsLevel_&&b(c),h.labels_&&h.labels_.values&&h.updateValuesLabels(c),h.patternFill_&&applyPatternFill(c,h.patternFill_)}}h.updateStyle=function(){if(!h.classToFillStyle()){for(var c={},g=h.classifier().domain(),m=0;m<g.length;m++)c[g[m]]=Yl[m%12];h.classToFillStyle(c)}return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyStyleToMap),applyStyleToMap(h),h};var b=function styleMixedNUTS(c){c.svg().selectAll(zt(c)).style("display",function(c){if(!this.parentNode.classList.contains("em-cntrg")){var h=src_select(this),g=h.attr("ecl"),m=h.attr("lvl");return g||"0"===m?"block":"none"}}).style("stroke",function(){var c=src_select(this),h=c.attr("lvl"),g=c.attr("ecl"),m=c.style("stroke");return g&&"0"!==h?m||"#777":null}).style("stroke-width",function(){var c=src_select(this),h=c.attr("lvl"),g=c.attr("ecl"),m=c.style("stroke-width");return g&&"0"!==h?m||.2:null})},w=function regionsFillFunction(c){var g=src_select(this).attr("ecl");return h.Geometries.userGeometries?g?"nd"===g?h.noDataFillStyle()||"gray":h.classToFillStyle_[h.classifier().domain()[g]]:Lt("em-nutsrg","fill"):"WORLD"===h.geo_?g?"nd"===g?h.noDataFillStyle()||"gray":h.classToFillStyle_[h.classifier().domain()[g]]||h.cntrgFillStyle_:h.cntrgFillStyle_:(c.properties.id.slice(0,2),g?"nd"===g?h.noDataFillStyle()||"gray":h.classToFillStyle_[h.classifier().domain()[g]]:Lt("em-nutsrg","fill"))},S=function addMouseEventsToRegions(c,g){var m=function shouldOmit(h){var g;return null===(g=c.tooltip_.omitRegions)||void 0===g?void 0:g.includes(h)};g.on("mouseover",function(g,b){m(b.properties.id)||(src_select(this).style("fill",c.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(b,h)),h.onRegionMouseOver_&&h.onRegionMouseOver_(g,b,this,c))}).on("mousemove",function(g,b){m(b.properties.id)||(h._tooltip&&h._tooltip.mousemove(g),h.onRegionMouseMove_&&h.onRegionMouseMove_(g,b,this,c))}).on("mouseout",function(g,b){if(!m(b.properties.id)){var w=src_select(this);w.style("fill",w.attr("fill___")),h._tooltip&&h._tooltip.mouseout(),h.onRegionMouseOut_&&h.onRegionMouseOut_(g,b,this,c)}})};return h.getLegendConstructor=function(){return Vl},h}(h):"proportionalSymbol"==c||"proportionalSymbols"==c||"ps"==c?Wl(h):"bivariateChoropleth"==c||"chbi"==c?function map(c){var h=Ml(c,!1,"chbi");h.numberOfClasses_=3,h.startColor_="#e8e8e8",h.color1_="#73ae80",h.color2_="#6c83b5",h.endColor_="#2a5a5b",h.classToFillStyle_=void 0,h.classifier1_=void 0,h.classifier2_=void 0,h.breaks1_=void 0,h.breaks2_=void 0,h.tooltip_.textFunction=Zl;var g=["numberOfClasses_","breaks1_","breaks2_","startColor_","color1_","color2_","endColor_","classToFillStyle_","noDataFillStyle_","classifier1_","classifier2_"].forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}});function applyClassificationToMap(c){var g=function classifyRegions(c){c.attr("ecl1",function(c){var g=h.statData("v1").get(c.properties.id);if(g){var m=g.value;return 0!=m&&!m||":"==m?"nd":+h.classifier1_(+m)}}).attr("ecl2",function(c){var g=h.statData("v2").get(c.properties.id);if(g){var m=g.value;return 0!=m&&!m||":"==m?"nd":+h.classifier2_(+m)}}).attr("nd",function(c){var g=h.statData("v1").get(c.properties.id),m=h.statData("v2").get(c.properties.id);if(g||m){var b=null==g?void 0:g.value;return 0!=b&&!b||":"==b||0!=(b=null==m?void 0:m.value)&&!b||":"==b?"nd":void 0}})};if(function setupClassifiers(){var c=h.statData("v1").getArray(),g=h.statData("v2").getArray(),m=toConsumableArray_toConsumableArray(Array(h.numberOfClasses()).keys());if(h.classifier1_||(h.breaks1_?h.classifier1(threshold().domain(h.breaks1_).range(m)):h.classifier1(quantile_quantile().domain(c).range(m))),h.classifier2_||(h.breaks2_?h.classifier2(threshold().domain(h.breaks2_).range(m)):h.classifier2(quantile_quantile().domain(g).range(m))),!h.classToFillStyle_){var b=Kl(h.numberOfClasses(),h.startColor(),h.color1(),h.color2(),h.endColor());h.classToFillStyle(b)}}(),c.svg_){var m=zt(c);g(c.svg().selectAll(m)),"mixed"===c.nutsLevel_&&g(c.svg().selectAll("path.em-nutsrg0"))}}function applyStyleToMap(c){if(c.svg()){var g=zt(c),w=c.svg().selectAll(g);w.style("pointer-events","none").transition().duration(h.transitionDuration()).style("fill",function(c){if(src_select(this).attr("nd"))return h.noDataFillStyle()||"gray";var g=src_select(this).attr("ecl1"),m=src_select(this).attr("ecl2");return g||m?"nd"===m?h.noDataFillStyle()||"gray":h.classToFillStyle_(+g,+m):Lt("em-nutsrg","fill")}).end().then(function(){w.style("pointer-events",null),w.each(function(){var c=src_select(this);c.attr("fill___",c.style("fill"))}),b(c,w),h.gridCartogram_&&c.svg().selectAll(".em-grid-text").each(function(){var c=src_select(this.parentNode).style("fill");src_select(this).attr("fill",Ot(c))})},function(c){}),"mixed"==h.nutsLevel_&&m(c)}}c&&g.forEach(function(g){var m=g.slice(0,-1);null!=c[m]&&h[g](c[m])}),h.updateClassification=function(){return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyClassificationToMap),applyClassificationToMap(h),h},h.updateStyle=function(){return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyStyleToMap),applyStyleToMap(h),h};var m=function styleMixedNUTS(c){c.svg().selectAll(zt(c)).each(function(){if(!this.parentNode.classList.contains("em-cntrg")){var c=src_select(this),h=c.attr("ecl1"),g=c.attr("ecl2"),m=c.attr("lvl"),b=h||g||"0"===m;if(c.style("display",b?"block":"none"),(h||g)&&"0"!==m){var w=c.style("stroke")||"#777",S=c.style("stroke-width")||.2;c.style("stroke",w).style("stroke-width",S)}}})},b=function addMouseEventsToRegions(c,g){var m=function shouldOmit(h){var g;return null===(g=c.tooltip_.omitRegions)||void 0===g?void 0:g.includes(h)};g.on("mouseover",function(g,b){var w;m(b.properties.id)||(src_select(this).style("fill",c.hoverColor_),null===(w=h._tooltip)||void 0===w||w.mouseover(h.tooltip_.textFunction(b,h)),h.onRegionMouseOver_&&h.onRegionMouseOver_(g,b,this,c))}).on("mousemove",function(g,b){var w;m(b.properties.id)||(null===(w=h._tooltip)||void 0===w||w.mousemove(g),h.onRegionMouseMove_&&h.onRegionMouseMove_(g,b,this,c))}).on("mouseout",function(g,b){if(!m(b.properties.id)){var w,S=src_select(this),M=S.attr("fill___");M&&(S.style("fill",M),null===(w=h._tooltip)||void 0===w||w.mouseout()),h.onRegionMouseOut_&&h.onRegionMouseOut_(g,b,this,c)}})};return h.getLegendConstructor=function(){return Xl},h}(h):"trivariateChoropleth"==c||"ternary"==c?tc(h):"stripeComposition"==c||"scomp"==c?function map(c){var h=Ml(c,!1,"scomp");h.stripeWidth_=50,h.stripeOrientation_=0,h.catColors_=void 0,h.catLabels_=void 0,h.showOnlyWhenComplete_=!1,h.pieChartRadius_=40,h.pieChartInnerRadius_=15;var g=["stripeWidth_","stripeOrientation_","catColors_","catLabels_","showOnlyWhenComplete_","noDataFillStyle_","pieChartRadius_","pieChartInnerRadius_"];g.forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&g.forEach(function(g){var m=g.slice(0,-1);null!=c[m]&&h[m](c[m])}),h.statComp=function(c,g,b,w,S){void 0!==g&&"string"==typeof g&&(c=map_stripe_composition_objectSpread(map_stripe_composition_objectSpread({},c),{},{categoryParameter:g,categoryCodes:b,categoryLabels:w,categoryColors:S})),c.stat&&delete(c=map_stripe_composition_objectSpread(map_stripe_composition_objectSpread({},c.stat),c)).stat;var M=c,k=M.eurostatDatasetCode,T=M.filters,E=M.unitText,I=M.categoryParameter,P=M.categoryCodes,L=M.categoryLabels,B=M.categoryColors;if(!k)return console.error("statComp: eurostatDatasetCode is required"),h;if(!I)return console.error("statComp: categoryParameter is required"),h;if(!P||!P.length)return console.error("statComp: categoryCodes array is required"),h;for(var z=T?map_stripe_composition_objectSpread({},T):{},j=0;j<P.length;j++){var D=P[j],N={eurostatDatasetCode:k,unitText:E,filters:map_stripe_composition_objectSpread(map_stripe_composition_objectSpread({},z),{},_defineProperty({},I,D))};h.stat(D,N),B&&B[j]&&(h.catColors_=h.catColors_||{},h.catColors_[D]=B[j]),L&&L[j]&&(h.catLabels_=h.catLabels_||{},h.catLabels_[D]=L[j])}return m=P,h};var m=void 0,b=function getComposition(c){for(var g={},b=0,w=0;w<m.length;w++){var S=m[w],M=h.statData(S).get(c);if(!M||0!=M.value&&!M.value||isNaN(M.value)){if(h.showOnlyWhenComplete())return}else g[S]=M.value,b+=M.value}if(0!=b){for(var k=0;k<m.length;k++)g[m[k]]/=b;return g}};return h.updateClassification=function(){if(!m){var c=(m=Object.keys(h.statData_)).indexOf("default");c>-1&&m.splice(c,1)}return h},h.updateStyle=function(){if(!h.catColors()){h.catColors({});for(var c=0;c<m.length;c++)h.catColors()[m[c]]=nc[c%10]}h.catLabels_=h.catLabels_||{},h.svg().selectAll(zt(h)).style("fill",function(c){if(!this.parentNode.classList.contains("em-cntrg")){var g=c.properties.id,m=b(g);if(!m)return h.noDataFillStyle()||"gray";var w=h.svg().append("pattern").attr("id","pattern_"+g).attr("x","0").attr("y","0").attr("width",h.stripeWidth()).attr("height",1).attr("patternUnits","userSpaceOnUse");h.stripeOrientation()&&w.attr("patternTransform","rotate("+h.stripeOrientation()+")"),w.append("rect").attr("x",0).attr("y",0).attr("width",h.stripeWidth()).attr("height",1).style("stroke","none").style("fill","lightgray");var S=0;for(var M in m){var k=m[M];if(k){k*=h.stripeWidth();var T=h.catColors()[M]||"lightgray";w.append("rect").attr("x",S).attr("y",0).attr("height",1).style("stroke","none").attr("code",M).style("fill",T).style("pointer-events","none").transition().duration(h.transitionDuration()).on("end",function(){src_select(this).style("pointer-events",null)}).attr("width",k),S+=k}}return"url(#pattern_"+g+")"}}).attr("nd",function(c){return b(c.properties.id)?"":"nd"});var g=zt(h);return h.svg().selectAll(g).on("mouseover",function(c,g){var m=src_select(this);m.attr("fill___",m.style("fill")),m.style("fill",h.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(g,h))}).on("mousemove",function(c,g){h._tooltip&&h._tooltip.mousemove(c)}).on("mouseout",function(){var c=src_select(this);c.style("fill"),c.attr("fill___")&&(c.style("fill",c.attr("fill___")),h._tooltip&&h._tooltip.mouseout())}),h},h.getLegendConstructor=function(){return rc},h.tooltip_.textFunction=function tooltipTextFunctionStripeComposition(c,g){var m=c.properties.na||c.properties.name,w=c.properties.id,S=b(w),M=[];for(var k in S)M.push({code:k,value:S[k]});var T="";if(T+='<div class="em-tooltip-bar">\n <b>'.concat(m,"</b>").concat(w?" (".concat(w,")"):"","\n </div>"),!M||0===M.length)return T+"<div>".concat(h.noDataText(),"</div>");var E,I=h.pieChartRadius(),P=h.pieChartInnerRadius(),L=src_pie().sort(null).value(function(c){return c.value}),B=src_arc().innerRadius(P).outerRadius(I),z="",j=map_stripe_composition_createForOfIteratorHelper(L(M));try{for(j.s();!(E=j.n()).done;){var D=E.value,N=h.catColors()[D.data.code]||"lightgray",R=B(D);z+='<path d="'.concat(R,'" fill="').concat(N,'" stroke="darkgray"></path>')}}catch(c){j.e(c)}finally{j.f()}return T+'\n <div style="display: flex; justify-content: center;">\n <svg viewBox="'.concat(-I," ").concat(-I," ").concat(2*I," ").concat(2*I,'" width="').concat(2*I,'">\n <g>').concat(z,"</g>\n </svg>\n </div>\n ")},h}(h):"pieChart"==c||"pie"==c?ac(h):"sparkline"==c||"spark"==c||"sparklines"==c?sc(h):"flow"==c||"flowmap"==c?gc(h):"coxcomb"==c||"polar"==c?vc(h):"alpha"==c||"valueByAlpha"==c?function map(c){var h=Fl(c);h.alphaData_=null,h.opacityScale_=null,h.opacityScale=function(c){return arguments.length?(h.opacityScale_=c,h):h.opacityScale_};var g=h.updateStatValues;h.updateStatValues=function(){var c=h.statData("alpha");if(!c||!c.isReady())return h.alphaData_=null,h;h.alphaData_=c;var m=c.getArray().filter(function(c){return null!=c&&":"!==c&&!isNaN(+c)});if(!h.opacityScale_){var b=min_min(m),w=max_max(m);h.opacityScale_=m.length>0?linear_linear().domain([b,w]).range([.1,1]):null}return g.call(h),h.updateStyle()};var m=h.updateStyle;return h.updateStyle=function(){if(!h.svg_||!h.opacityScale_)return h;h.svg_.classed("em--alpha",!0);var c=h.statData();if(!c||!c.isReady())return h;var g=h.statData("alpha");if(!g||!g.isReady())return h;var b=zt(h);return h.svg().selectAll(b).each(function(m){var b,w,S=src_select(this),M=null===(b=c.get(m.properties.id))||void 0===b?void 0:b.value,k=null===(w=g.get(m.properties.id))||void 0===w?void 0:w.value;if(null!=M&&":"!==M)if("nd"!==k&&null!=k)S.style("opacity",h.opacityScale_(+k));else{var T=h.noDataFillStyle_||"gray";S.attr("ecl","nd").attr("force-grey","1").style("fill",T).attr("fill","grey").attr("fill___",T).style("opacity",1)}}),m.call(h),h},h.getLegendConstructor=function(){return qs},h.tooltip_.textFunction=function(c,h){var g,m,b=[],w=c.properties.na||c.properties.name,S=c.properties.id;b.push('<div class="em-tooltip-bar"><b>'.concat(w,"</b>").concat(S?" (".concat(S,")"):"","</div>"));var M=h.statData(),k=h.alphaData_||h.statData("alpha"),T=M.get(S),E=null==k?void 0:k.get(S),I=(null===(g=M.unitText)||void 0===g?void 0:g.call(M))||"",P=(null==k||null===(m=k.unitText)||void 0===m?void 0:m.call(k))||"",L=M.label_?M.label_+": ":"",B=null!=k&&k.label_?(null==k?void 0:k.label_)+": ":"";return!T||0!==T.value&&!T.value||":"===T.value?(b.push('\n <div class="em-tooltip-text no-data">\n <table class="em-tooltip-table">\n <tbody>\n <tr><td>'.concat(h.noDataText_,"</td></tr>\n </tbody>\n </table>\n </div>\n ")),b.join("")):(b.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>'.concat(L).concat(Ft(T.value)," ").concat(I,"</td>\n </tr>\n <tr>\n <td>").concat(E&&":"!==E.value&&null!=E.value?"".concat(B).concat(Ft(E.value)," ").concat(P):"".concat(B).concat(h.noDataText_),"</td>\n </tr>\n </tbody>\n </table>\n </div>\n")),b.join(""))},h}(h):"mushroom"==c?function map(c){var h=Ml(c,!0,"mushroom");h.mushroomCodes_=["v1","v2"],h.mushroomMinSize_=4,h.mushroomMaxSize_=30,h.mushroomColors_=["#2c7bb6","#d7191c"],h.mushroomOrientation_="vertical",h.mushroomSizeScaleFunction_=null,h.mushroomSizeScaleFunctionV1_=null,h.mushroomSizeScaleFunctionV2_=null,h._mushroomScale_=null,h.tooltip_.textFunction=Ac;var g=["mushroomCodes_","mushroomMinSize_","mushroomMaxSize_","mushroomColors_","mushroomOrientation_","mushroomSizeScaleFunction_","mushroomSizeScaleFunctionV1_","mushroomSizeScaleFunctionV2_"];return g.forEach(function(c){var g=c.slice(0,-1);h[g]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&g.forEach(function(g){var m=g.slice(0,-1);void 0!==c[m]&&h[m](c[m])}),h.updateClassification=function(){if(h.mushroomSizeScaleFunction_)h._mushroomScale_=h.mushroomSizeScaleFunction_;else if(!h.mushroomSizeScaleFunctionV1_||!h.mushroomSizeScaleFunctionV2_){h._mushroomScale_=null;var c=slicedToArray_slicedToArray(h.mushroomCodes_,2),g=c[0],m=c[1],b=h.statData(g),w=h.statData(m);if(!b&&!w)return h;var S=[];if(null!=b&&b.getArray&&b.getArray().forEach(function(c){var h=+c;Number.isFinite(h)&&S.push(h)}),null!=w&&w.getArray&&w.getArray().forEach(function(c){var h=+c;Number.isFinite(h)&&S.push(h)}),!S.length)return h;var M=max_max(S)||0;return h._mushroomScale_=pow_sqrt().domain([0,M]).range([h.mushroomMinSize_,h.mushroomMaxSize_]),h}},h.updateStyle=function(){if(h.updateSymbolsDrawOrder(h),applyStyleToMap(h),h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyStyleToMap),h.dorling_&&(h._mushroomScale_||h.mushroomSizeScaleFunctionV1_&&h.mushroomSizeScaleFunctionV2_)){var c=slicedToArray_slicedToArray(h.mushroomCodes(),2),g=c[0],m=c[1],b=h.statData(g),w=h.statData(m);runDorlingSimulation(h,function(c){var g,m,S,M,k=c.properties.id,T=+(null===(g=b.get(k))||void 0===g?void 0:g.value)||0,E=+(null===(m=w.get(k))||void 0===m?void 0:m.value)||0;return h.mushroomSizeScaleFunctionV1_&&h.mushroomSizeScaleFunctionV2_?(S=h.mushroomSizeScaleFunctionV1_(T),M=h.mushroomSizeScaleFunctionV2_(E)):(S=h._mushroomScale_(T),M=h._mushroomScale_(E)),Math.sqrt((S*S+M*M)/2)})}else stopDorlingSimulation(h);return h},h.updateSymbolsDrawOrder=function(c){var g=h.getCentroidsGroup(c),m=slicedToArray_slicedToArray(h.mushroomCodes(),2),b=m[0],w=m[1],S=h.statData(b),M=h.statData(w);c.Geometries.centroidsFeatures&&c.Geometries.centroidsFeatures.length||(c.Geometries.centroidsFeatures=c.svg().selectAll("g.em-centroid").data().filter(function(c){var h;return null==c||null===(h=c.properties)||void 0===h?void 0:h.centroid}));var k=c.Geometries.centroidsFeatures.map(function(c){var g,m,b,w,k=c.properties.id,T=+(null===(g=S.get(k))||void 0===g?void 0:g.value)||0,E=+(null===(m=M.get(k))||void 0===m?void 0:m.value)||0;return h.mushroomSizeScaleFunctionV1_&&h.mushroomSizeScaleFunctionV2_?(b=h.mushroomSizeScaleFunctionV1_(T),w=h.mushroomSizeScaleFunctionV2_(E)):(b=h._mushroomScale_(T),w=h._mushroomScale_(E)),{d:c,r:Math.max(b,w)}}).filter(function(c){return c.r>0}).sort(function(c,h){return h.r-c.r}).map(function(c){return c.d});g.selectAll("g.em-centroid").remove(),g.selectAll("g.em-centroid").data(k,function(c){return c.properties.id}).enter().append("g").attr("class","em-centroid").attr("id",function(c){return"mushroom-"+c.properties.id}).attr("transform",function(c){return"translate(".concat(c.properties.centroid[0].toFixed(3),",").concat(c.properties.centroid[1].toFixed(3),")")})},h.getLegendConstructor=function(){return yc},h}(h):"waffle"==c?xc(h):(console.log("Unexpected map type: "+c),Ml(h,!0,c))}catch(c){console.error("Error in eurostat-map.map: "+c.message),console.error(c)}},Cc=function getFillPatternDefinitionFunction(c){(c=c||{}).shape=c.shape||"circle";var h=c.patternSize||5,g=c.minSize||1,m=c.maxSize||5.5;return c.bckColor=c.bckColor||"white",c.symbColor=c.symbColor||"black",function(b,w){b.selectAll(".em-fill-pattern").remove();for(var S=0;S<w;S++){var M=g+(m-g)*S/(w-1),k=b.append("pattern").attr("class","em-fill-pattern").attr("id","pattern_"+S).attr("x","0").attr("y","0").attr("width",h).attr("height",h).attr("patternUnits","userSpaceOnUse");k.append("rect").attr("x",0).attr("y",0).attr("width",h).attr("height",h).style("stroke","none").style("fill",c.bckColor),"square"==c.shape?k.append("rect").attr("x",0).attr("y",0).attr("width",M).attr("height",M).style("stroke","none").style("fill",c.symbColor):k.append("circle").attr("cx",.5*h).attr("cy",.5*h).attr("r",.5*M).style("stroke","none").style("fill",c.symbColor)}}},Sc=Cc,Mc=function getDefaultLabels(){return Hr},kc="4.3.42"})(),g})());
|
|
4
|
+
var h,g,b="function"==typeof Symbol?Symbol:{},w=b.iterator||"@@iterator",S=b.toStringTag||"@@toStringTag";function i(c,b,w,S){var k=b&&b.prototype instanceof Generator?b:Generator,T=Object.create(k.prototype);return m(T,"_invoke",function(c,m,b){var w,S,k,T=0,E=b||[],I=!1,P={p:0,n:0,v:h,a:d,f:d.bind(h,4),d:function d(c,g){return w=c,S=0,k=h,P.n=g,M}};function d(c,m){for(S=c,k=m,g=0;!I&&T&&!b&&g<E.length;g++){var b,w=E[g],L=P.p,B=w[2];c>3?(b=B===m)&&(k=w[(S=w[4])?5:(S=3,3)],w[4]=w[5]=h):w[0]<=L&&((b=c<2&&L<w[1])?(S=0,P.v=m,P.n=w[1]):L<B&&(b=c<3||w[0]>m||m>B)&&(w[4]=c,w[5]=m,P.n=B,S=0))}if(b||c>1)return M;throw I=!0,m}return function(b,E,L){if(T>1)throw TypeError("Generator is already running");for(I&&1===E&&d(E,L),S=E,k=L;(g=S<2?h:k)||!I;){w||(S?S<3?(S>1&&(P.n=-1),d(S,k)):P.n=k:P.v=k);try{if(T=2,w){if(S||(b="next"),g=w[b]){if(!(g=g.call(w,k)))throw TypeError("iterator result is not an object");if(!g.done)return g;k=g.value,S<2&&(S=0)}else 1===S&&(g=w.return)&&g.call(w),S<2&&(k=TypeError("The iterator does not provide a '"+b+"' method"),S=1);w=h}else if((g=(I=P.n<0)?k:c.call(m,P))!==M)break}catch(c){w=h,S=1,k=c}finally{T=1}}return{value:g,done:I}}}(c,w,S),!0),T}var M={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}g=Object.getPrototypeOf;var k=[][w]?g(g([][w]())):(m(g={},w,function(){return this}),g),T=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(k);function f(c){return Object.setPrototypeOf?Object.setPrototypeOf(c,GeneratorFunctionPrototype):(c.__proto__=GeneratorFunctionPrototype,m(c,S,"GeneratorFunction")),c.prototype=Object.create(T),c}return GeneratorFunction.prototype=GeneratorFunctionPrototype,m(T,"constructor",GeneratorFunctionPrototype),m(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",m(GeneratorFunctionPrototype,S,"GeneratorFunction"),m(T),m(T,S,"Generator"),m(T,w,function(){return this}),m(T,"toString",function(){return"[object Generator]"}),(c.exports=_regenerator=function _regenerator(){return{w:i,m:f}},c.exports.__esModule=!0,c.exports.default=c.exports)()}c.exports=_regenerator,c.exports.__esModule=!0,c.exports.default=c.exports},7211(c,h,g){"use strict";g.d(h,{A:()=>W});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w),M=g(2489),k=g(9666),T=g(4282),E=g(4470),I=g(4789),P=g(2991),L=g(2875),B=g(765),z=g(358),j=g(2476),D=g(3869),N=g(6923),R=g(781),G=g(654),q=S()(b());q.i(M.A),q.i(k.A),q.i(T.A),q.i(E.A),q.i(I.A),q.i(P.A),q.i(L.A),q.i(B.A),q.i(z.A),q.i(j.A),q.i(D.A),q.i(N.A),q.i(R.A),q.i(G.A),q.push([c.id,"\n","",{version:3,sources:[],names:[],mappings:"",sourceRoot:""}]);const W=q},7549(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,"/* Sparkline maps */\n\n/* muted country boundaries */\n.em--spark .em-cntbn {\n stroke: rgb(163, 163, 163);\n stroke-width: 0.5px;\n}\n\n.em--spark #em-cntbn-halo {\n stroke: none;\n}\n\n/* muted nuts boundaries */\n.em--spark .em-bn-1,\n.em--spark .em-bn-2,\n.em--spark .em-bn-3,\n.em--spark .em-nutsrg [lvl='3'],\n.em--spark .em-nutsrg [lvl='2'],\n.em--spark .em-nutsrg [lvl='1'],\n.em--spark .em-bn-co {\n stroke-width: 0.1px;\n}\n\n/* muted country fill */\n.em--spark .em-cntrg {\n fill: #f2f2f2;\n}\n\n/* nuts fill (regions with data) */\n.em--spark .em-nutsrg {\n fill: #fffeef;\n /*fill: #c9ffd524; very light green */\n /*fill: #fffee724; very light yellow */\n}\n\n/* regions without data input */\n.em--spark [ecl='ni'] {\n fill: #e9e9e9;\n}\n\n/* Hide non-nuts borders (country boundaries > that are 'other' and not coastal, not candidates, not eu and not efta) */\n/* .em--spark g#em-cntbn > .em-bn-oth:not(.em-bn-co):not(.em-bn-cc):not(.em-bn-eu):not(.em-bn-efta) {\n stroke-width: 0px;\n} */\n\n/* Coastlines should not be drawn for choropleths, however for prop symbol maps with white regions they can be necessary */\n.em--spark .em-bn-co {\n stroke: grey;\n stroke-width: 0.2px;\n}\n","",{version:3,sources:["webpack://./src/css/map-types/sparkline.css"],names:[],mappings:"AAAA,mBAAmB;;AAEnB,+BAA+B;AAC/B;IACI,0BAA0B;IAC1B,mBAAmB;AACvB;;AAEA;IACI,YAAY;AAChB;;AAEA,4BAA4B;AAC5B;;;;;;;IAOI,mBAAmB;AACvB;;AAEA,wBAAwB;AACxB;IACI,aAAa;AACjB;;AAEA,mCAAmC;AACnC;IACI,aAAa;IACb,sCAAsC;IACtC,uCAAuC;AAC3C;;AAEA,gCAAgC;AAChC;IACI,aAAa;AACjB;;AAEA,uHAAuH;AACvH;;GAEG;;AAEH,0HAA0H;AAC1H;IACI,YAAY;IACZ,mBAAmB;AACvB",sourcesContent:["/* Sparkline maps */\r\n\r\n/* muted country boundaries */\r\n.em--spark .em-cntbn {\r\n stroke: rgb(163, 163, 163);\r\n stroke-width: 0.5px;\r\n}\r\n\r\n.em--spark #em-cntbn-halo {\r\n stroke: none;\r\n}\r\n\r\n/* muted nuts boundaries */\r\n.em--spark .em-bn-1,\r\n.em--spark .em-bn-2,\r\n.em--spark .em-bn-3,\r\n.em--spark .em-nutsrg [lvl='3'],\r\n.em--spark .em-nutsrg [lvl='2'],\r\n.em--spark .em-nutsrg [lvl='1'],\r\n.em--spark .em-bn-co {\r\n stroke-width: 0.1px;\r\n}\r\n\r\n/* muted country fill */\r\n.em--spark .em-cntrg {\r\n fill: #f2f2f2;\r\n}\r\n\r\n/* nuts fill (regions with data) */\r\n.em--spark .em-nutsrg {\r\n fill: #fffeef;\r\n /*fill: #c9ffd524; very light green */\r\n /*fill: #fffee724; very light yellow */\r\n}\r\n\r\n/* regions without data input */\r\n.em--spark [ecl='ni'] {\r\n fill: #e9e9e9;\r\n}\r\n\r\n/* Hide non-nuts borders (country boundaries > that are 'other' and not coastal, not candidates, not eu and not efta) */\r\n/* .em--spark g#em-cntbn > .em-bn-oth:not(.em-bn-co):not(.em-bn-cc):not(.em-bn-eu):not(.em-bn-efta) {\r\n stroke-width: 0px;\r\n} */\r\n\r\n/* Coastlines should not be drawn for choropleths, however for prop symbol maps with white regions they can be necessary */\r\n.em--spark .em-bn-co {\r\n stroke: grey;\r\n stroke-width: 0.2px;\r\n}\r\n"],sourceRoot:""}]);const M=S},7659(c){"use strict";var h={};c.exports=function insertBySelector(c,g){var m=function getTarget(c){if(void 0===h[c]){var g=document.querySelector(c);if(window.HTMLIFrameElement&&g instanceof window.HTMLIFrameElement)try{g=g.contentDocument.head}catch(c){g=null}h[c]=g}return h[c]}(c);if(!m)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");m.appendChild(g)}},7825(c){"use strict";c.exports=function domAPI(c){if("undefined"==typeof document)return{update:function update(){},remove:function remove(){}};var h=c.insertStyleElement(c);return{update:function update(g){!function apply(c,h,g){var m="";g.supports&&(m+="@supports (".concat(g.supports,") {")),g.media&&(m+="@media ".concat(g.media," {"));var b=void 0!==g.layer;b&&(m+="@layer".concat(g.layer.length>0?" ".concat(g.layer):""," {")),m+=g.css,b&&(m+="}"),g.media&&(m+="}"),g.supports&&(m+="}");var w=g.sourceMap;w&&"undefined"!=typeof btoa&&(m+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(w))))," */")),h.styleTagTransform(m,c,h.options)}(h,c,g)},remove:function remove(){!function removeStyleElement(c){if(null===c.parentNode)return!1;c.parentNode.removeChild(c)}(h)}}}},9666(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,".em-tooltip {\n font-family: Arial;\n color: #383838;\n max-width: 300px;\n overflow: hidden;\n background: white;\n padding: 0px;\n border: 0px;\n border-radius: 0px;\n box-shadow:\n 0px 4px 6px rgba(0, 0, 0, 0.1),\n 0px 1px 3px rgba(0, 0, 0, 0.08);\n position: absolute;\n font-family: Helvetica, Arial, sans-serif;\n pointer-events: none;\n z-index: 99999999;\n}\n.em-tooltip-text {\n background: #ffffff;\n padding: 4px;\n font-size: 15px;\n}\n.em-tooltip-bar {\n background: #515560;\n color: #ffffff;\n padding: 6px;\n font-size: 16px;\n}\n\n.em-footnote-tooltip {\n background: #ffffff;\n padding: 4px;\n font-size: 12px;\n}\n.em-tooltip-table {\n margin: 0px;\n}\n.em-tooltip-piechart-container {\n text-align: center;\n fill: #383838;\n display: flex;\n justify-content: center;\n}\n.em-tooltip-breakdown {\n display: flex;\n flex-direction: column;\n gap: 2px;\n font-size: 13px;\n line-height: 1.2;\n padding: 10px;\n padding-top: 3px;\n}\n\n.em-breakdown-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.em-breakdown-color {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n display: inline-block;\n margin-right: 6px;\n flex-shrink: 0;\n}\n\n.em-breakdown-label {\n flex: 1;\n color: #333;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.em-breakdown-value {\n margin-left: 8px;\n font-weight: 500;\n color: #222;\n white-space: nowrap;\n}\n\n.em-breakdown-item.em-total {\n border-top: 1px solid #ccc;\n margin-top: 3px;\n padding-top: 3px;\n font-weight: bold;\n}\n\n.em-cx-breakdown-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.em-tooltip-cx {\n line-height: 1;\n padding: 0px;\n}\n\n.em-tooltip-cx .em-breakdown-value,\n.em-tooltip-cx .em-breakdown-label,\n.em-tooltip-cx .em-breakdown-color {\n margin: 0;\n font-size: 11px; /* Smaller text for compactness */\n white-space: nowrap;\n}\n\n.em-tooltip-cx-table {\n width: 100%;\n border-collapse: collapse;\n table-layout: fixed;\n}\n\n.em-tooltip-cx-table th,\n.em-tooltip-cx-table td {\n padding: 2px 4px; /* Minimal padding */\n border: 1px solid #eee;\n}\n\n.em-tooltip-cx-table th {\n background: #f7f7f7;\n font-weight: bold;\n font-size: 11px;\n}\n\n.em-tooltip-cx-table td {\n font-size: 11px;\n white-space: nowrap;\n}\n\n/* Make the Total value bold and right-aligned */\n.em-tooltip-cx-table .em-total td[colspan] {\n text-align: right;\n font-weight: bold !important;\n}\n\n/* Also make the inner number span bold */\n.em-tooltip-cx-table .em-total td[colspan] .em-breakdown-value {\n font-weight: bold !important;\n}\n.em-total {\n font-weight: bold !important;\n}\n","",{version:3,sources:["webpack://./src/css/tooltip.css"],names:[],mappings:"AAAA;IACI,kBAAkB;IAClB,cAAc;IACd,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB,YAAY;IACZ,WAAW;IACX,kBAAkB;IAClB;;uCAEmC;IACnC,kBAAkB;IAClB,yCAAyC;IACzC,oBAAoB;IACpB,iBAAiB;AACrB;AACA;IACI,mBAAmB;IACnB,YAAY;IACZ,eAAe;AACnB;AACA;IACI,mBAAmB;IACnB,cAAc;IACd,YAAY;IACZ,eAAe;AACnB;;AAEA;IACI,mBAAmB;IACnB,YAAY;IACZ,eAAe;AACnB;AACA;IACI,WAAW;AACf;AACA;IACI,kBAAkB;IAClB,aAAa;IACb,aAAa;IACb,uBAAuB;AAC3B;AACA;IACI,aAAa;IACb,sBAAsB;IACtB,QAAQ;IACR,eAAe;IACf,gBAAgB;IAChB,aAAa;IACb,gBAAgB;AACpB;;AAEA;IACI,aAAa;IACb,mBAAmB;IACnB,8BAA8B;AAClC;;AAEA;IACI,UAAU;IACV,WAAW;IACX,kBAAkB;IAClB,qBAAqB;IACrB,iBAAiB;IACjB,cAAc;AAClB;;AAEA;IACI,OAAO;IACP,WAAW;IACX,mBAAmB;IACnB,gBAAgB;IAChB,uBAAuB;AAC3B;;AAEA;IACI,gBAAgB;IAChB,gBAAgB;IAChB,WAAW;IACX,mBAAmB;AACvB;;AAEA;IACI,0BAA0B;IAC1B,eAAe;IACf,gBAAgB;IAChB,iBAAiB;AACrB;;AAEA;IACI,aAAa;IACb,mBAAmB;IACnB,8BAA8B;AAClC;;AAEA;IACI,cAAc;IACd,YAAY;AAChB;;AAEA;;;IAGI,SAAS;IACT,eAAe,EAAE,iCAAiC;IAClD,mBAAmB;AACvB;;AAEA;IACI,WAAW;IACX,yBAAyB;IACzB,mBAAmB;AACvB;;AAEA;;IAEI,gBAAgB,EAAE,oBAAoB;IACtC,sBAAsB;AAC1B;;AAEA;IACI,mBAAmB;IACnB,iBAAiB;IACjB,eAAe;AACnB;;AAEA;IACI,eAAe;IACf,mBAAmB;AACvB;;AAEA,gDAAgD;AAChD;IACI,iBAAiB;IACjB,4BAA4B;AAChC;;AAEA,yCAAyC;AACzC;IACI,4BAA4B;AAChC;AACA;IACI,4BAA4B;AAChC",sourcesContent:[".em-tooltip {\r\n font-family: Arial;\r\n color: #383838;\r\n max-width: 300px;\r\n overflow: hidden;\r\n background: white;\r\n padding: 0px;\r\n border: 0px;\r\n border-radius: 0px;\r\n box-shadow:\r\n 0px 4px 6px rgba(0, 0, 0, 0.1),\r\n 0px 1px 3px rgba(0, 0, 0, 0.08);\r\n position: absolute;\r\n font-family: Helvetica, Arial, sans-serif;\r\n pointer-events: none;\r\n z-index: 99999999;\r\n}\r\n.em-tooltip-text {\r\n background: #ffffff;\r\n padding: 4px;\r\n font-size: 15px;\r\n}\r\n.em-tooltip-bar {\r\n background: #515560;\r\n color: #ffffff;\r\n padding: 6px;\r\n font-size: 16px;\r\n}\r\n\r\n.em-footnote-tooltip {\r\n background: #ffffff;\r\n padding: 4px;\r\n font-size: 12px;\r\n}\r\n.em-tooltip-table {\r\n margin: 0px;\r\n}\r\n.em-tooltip-piechart-container {\r\n text-align: center;\r\n fill: #383838;\r\n display: flex;\r\n justify-content: center;\r\n}\r\n.em-tooltip-breakdown {\r\n display: flex;\r\n flex-direction: column;\r\n gap: 2px;\r\n font-size: 13px;\r\n line-height: 1.2;\r\n padding: 10px;\r\n padding-top: 3px;\r\n}\r\n\r\n.em-breakdown-item {\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n}\r\n\r\n.em-breakdown-color {\r\n width: 8px;\r\n height: 8px;\r\n border-radius: 50%;\r\n display: inline-block;\r\n margin-right: 6px;\r\n flex-shrink: 0;\r\n}\r\n\r\n.em-breakdown-label {\r\n flex: 1;\r\n color: #333;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n}\r\n\r\n.em-breakdown-value {\r\n margin-left: 8px;\r\n font-weight: 500;\r\n color: #222;\r\n white-space: nowrap;\r\n}\r\n\r\n.em-breakdown-item.em-total {\r\n border-top: 1px solid #ccc;\r\n margin-top: 3px;\r\n padding-top: 3px;\r\n font-weight: bold;\r\n}\r\n\r\n.em-cx-breakdown-item {\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n}\r\n\r\n.em-tooltip-cx {\r\n line-height: 1;\r\n padding: 0px;\r\n}\r\n\r\n.em-tooltip-cx .em-breakdown-value,\r\n.em-tooltip-cx .em-breakdown-label,\r\n.em-tooltip-cx .em-breakdown-color {\r\n margin: 0;\r\n font-size: 11px; /* Smaller text for compactness */\r\n white-space: nowrap;\r\n}\r\n\r\n.em-tooltip-cx-table {\r\n width: 100%;\r\n border-collapse: collapse;\r\n table-layout: fixed;\r\n}\r\n\r\n.em-tooltip-cx-table th,\r\n.em-tooltip-cx-table td {\r\n padding: 2px 4px; /* Minimal padding */\r\n border: 1px solid #eee;\r\n}\r\n\r\n.em-tooltip-cx-table th {\r\n background: #f7f7f7;\r\n font-weight: bold;\r\n font-size: 11px;\r\n}\r\n\r\n.em-tooltip-cx-table td {\r\n font-size: 11px;\r\n white-space: nowrap;\r\n}\r\n\r\n/* Make the Total value bold and right-aligned */\r\n.em-tooltip-cx-table .em-total td[colspan] {\r\n text-align: right;\r\n font-weight: bold !important;\r\n}\r\n\r\n/* Also make the inner number span bold */\r\n.em-tooltip-cx-table .em-total td[colspan] .em-breakdown-value {\r\n font-weight: bold !important;\r\n}\r\n.em-total {\r\n font-weight: bold !important;\r\n}\r\n"],sourceRoot:""}]);const M=S},9971(c,h,g){"use strict";g.d(h,{A:()=>M});var m=g(1354),b=g.n(m),w=g(6314),S=g.n(w)()(b());S.push([c.id,".em-tooltip-wafflechart-container {\n max-width: 150px;\n}\n","",{version:3,sources:["webpack://./src/css/map-types/waffle.css"],names:[],mappings:"AAAA;IACI,gBAAgB;AACpB",sourcesContent:[".em-tooltip-wafflechart-container {\r\n max-width: 150px;\r\n}\r\n"],sourceRoot:""}]);const M=S}},h={};function __webpack_require__(g){var m=h[g];if(void 0!==m)return m.exports;var b=h[g]={id:g,exports:{}};return c[g](b,b.exports,__webpack_require__),b.exports}__webpack_require__.m=c,__webpack_require__.n=c=>{var h=c&&c.__esModule?()=>c.default:()=>c;return __webpack_require__.d(h,{a:h}),h},__webpack_require__.d=(c,h)=>{for(var g in h)__webpack_require__.o(h,g)&&!__webpack_require__.o(c,g)&&Object.defineProperty(c,g,{enumerable:!0,get:h[g]})},__webpack_require__.u=c=>c+".eurostatmap.min.js",__webpack_require__.o=(c,h)=>Object.prototype.hasOwnProperty.call(c,h),__webpack_require__.r=c=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})},__webpack_require__.p="/build/",__webpack_require__.b="undefined"!=typeof document&&document.baseURI||self.location.href,__webpack_require__.nc=void 0;var g={};return(()=>{"use strict";__webpack_require__.r(g),__webpack_require__.d(g,{getDefaultLabels:()=>Mc,getFillPatternDefinitionFun:()=>Sc,getFillPatternDefinitionFunction:()=>Cc,map:()=>wc,version:()=>kc});var c=__webpack_require__(5072),h=__webpack_require__.n(c),m=__webpack_require__(7825),b=__webpack_require__.n(m),w=__webpack_require__(7659),S=__webpack_require__.n(w),M=__webpack_require__(5056),k=__webpack_require__.n(M),T=__webpack_require__(540),E=__webpack_require__.n(T),I=__webpack_require__(1113),P=__webpack_require__.n(I),L=__webpack_require__(7211),B={};B.styleTagTransform=P(),B.setAttributes=k(),B.insert=S().bind(null,"head"),B.domAPI=b(),B.insertStyleElement=E();h()(L.A,B);L.A&&L.A.locals&&L.A.locals;function _arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function _unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return _arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?_arrayLikeToArray(c,h):void 0}}function slicedToArray_slicedToArray(c,h){return function _arrayWithHoles(c){if(Array.isArray(c))return c}(c)||function _iterableToArrayLimit(c,h){var g=null==c?null:"undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(null!=g){var m,b,w,S,M=[],k=!0,T=!1;try{if(w=(g=g.call(c)).next,0===h){if(Object(g)!==g)return;k=!1}else for(;!(k=(m=w.call(g)).done)&&(M.push(m.value),M.length!==h);k=!0);}catch(c){T=!0,b=c}finally{try{if(!k&&null!=g.return&&(S=g.return(),Object(S)!==S))return}finally{if(T)throw b}}return M}}(c,h)||_unsupportedIterableToArray(c,h)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function toConsumableArray_toConsumableArray(c){return function _arrayWithoutHoles(c){if(Array.isArray(c))return _arrayLikeToArray(c)}(c)||function _iterableToArray(c){if("undefined"!=typeof Symbol&&null!=c[Symbol.iterator]||null!=c["@@iterator"])return Array.from(c)}(c)||_unsupportedIterableToArray(c)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function none(){}function selector(c){return null==c?none:function(){return this.querySelector(c)}}function array(c){return null==c?[]:Array.isArray(c)?c:Array.from(c)}function empty(){return[]}function selectorAll(c){return null==c?empty:function(){return this.querySelectorAll(c)}}function matcher(c){return function(){return this.matches(c)}}function childMatcher(c){return function(h){return h.matches(c)}}var z=Array.prototype.find;function childFirst(){return this.firstElementChild}var j=Array.prototype.filter;function children(){return Array.from(this.children)}function sparse(c){return new Array(c.length)}function EnterNode(c,h){this.ownerDocument=c.ownerDocument,this.namespaceURI=c.namespaceURI,this._next=null,this._parent=c,this.__data__=h}function bindIndex(c,h,g,m,b,w){for(var S,M=0,k=h.length,T=w.length;M<T;++M)(S=h[M])?(S.__data__=w[M],m[M]=S):g[M]=new EnterNode(c,w[M]);for(;M<k;++M)(S=h[M])&&(b[M]=S)}function bindKey(c,h,g,m,b,w,S){var M,k,T,E=new Map,I=h.length,P=w.length,L=new Array(I);for(M=0;M<I;++M)(k=h[M])&&(L[M]=T=S.call(k,k.__data__,M,h)+"",E.has(T)?b[M]=k:E.set(T,k));for(M=0;M<P;++M)T=S.call(c,w[M],M,w)+"",(k=E.get(T))?(m[M]=k,k.__data__=w[M],E.delete(T)):g[M]=new EnterNode(c,w[M]);for(M=0;M<I;++M)(k=h[M])&&E.get(L[M])===k&&(b[M]=k)}function datum(c){return c.__data__}function arraylike(c){return"object"==typeof c&&"length"in c?c:Array.from(c)}function ascending(c,h){return c<h?-1:c>h?1:c>=h?0:NaN}EnterNode.prototype={constructor:EnterNode,appendChild:function(c){return this._parent.insertBefore(c,this._next)},insertBefore:function(c,h){return this._parent.insertBefore(c,h)},querySelector:function(c){return this._parent.querySelector(c)},querySelectorAll:function(c){return this._parent.querySelectorAll(c)}};var D="http://www.w3.org/1999/xhtml";const N={svg:"http://www.w3.org/2000/svg",xhtml:D,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function namespace(c){var h=c+="",g=h.indexOf(":");return g>=0&&"xmlns"!==(h=c.slice(0,g))&&(c=c.slice(g+1)),N.hasOwnProperty(h)?{space:N[h],local:c}:c}function attrRemove(c){return function(){this.removeAttribute(c)}}function attrRemoveNS(c){return function(){this.removeAttributeNS(c.space,c.local)}}function attrConstant(c,h){return function(){this.setAttribute(c,h)}}function attrConstantNS(c,h){return function(){this.setAttributeNS(c.space,c.local,h)}}function attrFunction(c,h){return function(){var g=h.apply(this,arguments);null==g?this.removeAttribute(c):this.setAttribute(c,g)}}function attrFunctionNS(c,h){return function(){var g=h.apply(this,arguments);null==g?this.removeAttributeNS(c.space,c.local):this.setAttributeNS(c.space,c.local,g)}}function src_window(c){return c.ownerDocument&&c.ownerDocument.defaultView||c.document&&c||c.defaultView}function styleRemove(c){return function(){this.style.removeProperty(c)}}function styleConstant(c,h,g){return function(){this.style.setProperty(c,h,g)}}function styleFunction(c,h,g){return function(){var m=h.apply(this,arguments);null==m?this.style.removeProperty(c):this.style.setProperty(c,m,g)}}function styleValue(c,h){return c.style.getPropertyValue(h)||src_window(c).getComputedStyle(c,null).getPropertyValue(h)}function propertyRemove(c){return function(){delete this[c]}}function propertyConstant(c,h){return function(){this[c]=h}}function propertyFunction(c,h){return function(){var g=h.apply(this,arguments);null==g?delete this[c]:this[c]=g}}function classArray(c){return c.trim().split(/^|\s+/)}function classList(c){return c.classList||new ClassList(c)}function ClassList(c){this._node=c,this._names=classArray(c.getAttribute("class")||"")}function classedAdd(c,h){for(var g=classList(c),m=-1,b=h.length;++m<b;)g.add(h[m])}function classedRemove(c,h){for(var g=classList(c),m=-1,b=h.length;++m<b;)g.remove(h[m])}function classedTrue(c){return function(){classedAdd(this,c)}}function classedFalse(c){return function(){classedRemove(this,c)}}function classedFunction(c,h){return function(){(h.apply(this,arguments)?classedAdd:classedRemove)(this,c)}}function textRemove(){this.textContent=""}function textConstant(c){return function(){this.textContent=c}}function textFunction(c){return function(){var h=c.apply(this,arguments);this.textContent=null==h?"":h}}function htmlRemove(){this.innerHTML=""}function htmlConstant(c){return function(){this.innerHTML=c}}function htmlFunction(c){return function(){var h=c.apply(this,arguments);this.innerHTML=null==h?"":h}}function raise(){this.nextSibling&&this.parentNode.appendChild(this)}function lower(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function creatorInherit(c){return function(){var h=this.ownerDocument,g=this.namespaceURI;return g===D&&h.documentElement.namespaceURI===D?h.createElement(c):h.createElementNS(g,c)}}function creatorFixed(c){return function(){return this.ownerDocument.createElementNS(c.space,c.local)}}function src_creator(c){var h=namespace(c);return(h.local?creatorFixed:creatorInherit)(h)}function constantNull(){return null}function remove(){var c=this.parentNode;c&&c.removeChild(this)}function selection_cloneShallow(){var c=this.cloneNode(!1),h=this.parentNode;return h?h.insertBefore(c,this.nextSibling):c}function selection_cloneDeep(){var c=this.cloneNode(!0),h=this.parentNode;return h?h.insertBefore(c,this.nextSibling):c}function onRemove(c){return function(){var h=this.__on;if(h){for(var g,m=0,b=-1,w=h.length;m<w;++m)g=h[m],c.type&&g.type!==c.type||g.name!==c.name?h[++b]=g:this.removeEventListener(g.type,g.listener,g.options);++b?h.length=b:delete this.__on}}}function onAdd(c,h,g){return function(){var m,b=this.__on,w=function contextListener(c){return function(h){c.call(this,h,this.__data__)}}(h);if(b)for(var S=0,M=b.length;S<M;++S)if((m=b[S]).type===c.type&&m.name===c.name)return this.removeEventListener(m.type,m.listener,m.options),this.addEventListener(m.type,m.listener=w,m.options=g),void(m.value=h);this.addEventListener(c.type,w,g),m={type:c.type,name:c.name,value:h,listener:w,options:g},b?b.push(m):this.__on=[m]}}function dispatchEvent(c,h,g){var m=src_window(c),b=m.CustomEvent;"function"==typeof b?b=new b(h,g):(b=m.document.createEvent("Event"),g?(b.initEvent(h,g.bubbles,g.cancelable),b.detail=g.detail):b.initEvent(h,!1,!1)),c.dispatchEvent(b)}function dispatchConstant(c,h){return function(){return dispatchEvent(this,c,h)}}function dispatchFunction(c,h){return function(){return dispatchEvent(this,c,h.apply(this,arguments))}}ClassList.prototype={add:function(c){this._names.indexOf(c)<0&&(this._names.push(c),this._node.setAttribute("class",this._names.join(" ")))},remove:function(c){var h=this._names.indexOf(c);h>=0&&(this._names.splice(h,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(c){return this._names.indexOf(c)>=0}};var R=[null];function selection_Selection(c,h){this._groups=c,this._parents=h}function selection(){return new selection_Selection([[document.documentElement]],R)}selection_Selection.prototype=selection.prototype={constructor:selection_Selection,select:function selection_select(c){"function"!=typeof c&&(c=selector(c));for(var h=this._groups,g=h.length,m=new Array(g),b=0;b<g;++b)for(var w,S,M=h[b],k=M.length,T=m[b]=new Array(k),E=0;E<k;++E)(w=M[E])&&(S=c.call(w,w.__data__,E,M))&&("__data__"in w&&(S.__data__=w.__data__),T[E]=S);return new selection_Selection(m,this._parents)},selectAll:function selectAll(c){c="function"==typeof c?function arrayAll(c){return function(){return array(c.apply(this,arguments))}}(c):selectorAll(c);for(var h=this._groups,g=h.length,m=[],b=[],w=0;w<g;++w)for(var S,M=h[w],k=M.length,T=0;T<k;++T)(S=M[T])&&(m.push(c.call(S,S.__data__,T,M)),b.push(S));return new selection_Selection(m,b)},selectChild:function selectChild(c){return this.select(null==c?childFirst:function childFind(c){return function(){return z.call(this.children,c)}}("function"==typeof c?c:childMatcher(c)))},selectChildren:function selectChildren(c){return this.selectAll(null==c?children:function childrenFilter(c){return function(){return j.call(this.children,c)}}("function"==typeof c?c:childMatcher(c)))},filter:function selection_filter(c){"function"!=typeof c&&(c=matcher(c));for(var h=this._groups,g=h.length,m=new Array(g),b=0;b<g;++b)for(var w,S=h[b],M=S.length,k=m[b]=[],T=0;T<M;++T)(w=S[T])&&c.call(w,w.__data__,T,S)&&k.push(w);return new selection_Selection(m,this._parents)},data:function data(c,h){if(!arguments.length)return Array.from(this,datum);var g=h?bindKey:bindIndex,m=this._parents,b=this._groups;"function"!=typeof c&&(c=function src_constant(c){return function(){return c}}(c));for(var w=b.length,S=new Array(w),M=new Array(w),k=new Array(w),T=0;T<w;++T){var E=m[T],I=b[T],P=I.length,L=arraylike(c.call(E,E&&E.__data__,T,m)),B=L.length,z=M[T]=new Array(B),j=S[T]=new Array(B);g(E,I,z,j,k[T]=new Array(P),L,h);for(var D,N,R=0,G=0;R<B;++R)if(D=z[R]){for(R>=G&&(G=R+1);!(N=j[G])&&++G<B;);D._next=N||null}}return(S=new selection_Selection(S,m))._enter=M,S._exit=k,S},enter:function enter(){return new selection_Selection(this._enter||this._groups.map(sparse),this._parents)},exit:function exit(){return new selection_Selection(this._exit||this._groups.map(sparse),this._parents)},join:function join(c,h,g){var m=this.enter(),b=this,w=this.exit();return"function"==typeof c?(m=c(m))&&(m=m.selection()):m=m.append(c+""),null!=h&&(b=h(b))&&(b=b.selection()),null==g?w.remove():g(w),m&&b?m.merge(b).order():b},merge:function merge(c){for(var h=c.selection?c.selection():c,g=this._groups,m=h._groups,b=g.length,w=m.length,S=Math.min(b,w),M=new Array(b),k=0;k<S;++k)for(var T,E=g[k],I=m[k],P=E.length,L=M[k]=new Array(P),B=0;B<P;++B)(T=E[B]||I[B])&&(L[B]=T);for(;k<b;++k)M[k]=g[k];return new selection_Selection(M,this._parents)},selection:function selection_selection(){return this},order:function order(){for(var c=this._groups,h=-1,g=c.length;++h<g;)for(var m,b=c[h],w=b.length-1,S=b[w];--w>=0;)(m=b[w])&&(S&&4^m.compareDocumentPosition(S)&&S.parentNode.insertBefore(m,S),S=m);return this},sort:function sort(c){function compareNode(h,g){return h&&g?c(h.__data__,g.__data__):!h-!g}c||(c=ascending);for(var h=this._groups,g=h.length,m=new Array(g),b=0;b<g;++b){for(var w,S=h[b],M=S.length,k=m[b]=new Array(M),T=0;T<M;++T)(w=S[T])&&(k[T]=w);k.sort(compareNode)}return new selection_Selection(m,this._parents).order()},call:function call(){var c=arguments[0];return arguments[0]=this,c.apply(null,arguments),this},nodes:function nodes(){return Array.from(this)},node:function node(){for(var c=this._groups,h=0,g=c.length;h<g;++h)for(var m=c[h],b=0,w=m.length;b<w;++b){var S=m[b];if(S)return S}return null},size:function size(){let c=0;for(const h of this)++c;return c},empty:function selection_empty(){return!this.node()},each:function each(c){for(var h=this._groups,g=0,m=h.length;g<m;++g)for(var b,w=h[g],S=0,M=w.length;S<M;++S)(b=w[S])&&c.call(b,b.__data__,S,w);return this},attr:function attr(c,h){var g=namespace(c);if(arguments.length<2){var m=this.node();return g.local?m.getAttributeNS(g.space,g.local):m.getAttribute(g)}return this.each((null==h?g.local?attrRemoveNS:attrRemove:"function"==typeof h?g.local?attrFunctionNS:attrFunction:g.local?attrConstantNS:attrConstant)(g,h))},style:function style(c,h,g){return arguments.length>1?this.each((null==h?styleRemove:"function"==typeof h?styleFunction:styleConstant)(c,h,null==g?"":g)):styleValue(this.node(),c)},property:function property(c,h){return arguments.length>1?this.each((null==h?propertyRemove:"function"==typeof h?propertyFunction:propertyConstant)(c,h)):this.node()[c]},classed:function classed(c,h){var g=classArray(c+"");if(arguments.length<2){for(var m=classList(this.node()),b=-1,w=g.length;++b<w;)if(!m.contains(g[b]))return!1;return!0}return this.each(("function"==typeof h?classedFunction:h?classedTrue:classedFalse)(g,h))},text:function selection_text(c){return arguments.length?this.each(null==c?textRemove:("function"==typeof c?textFunction:textConstant)(c)):this.node().textContent},html:function html(c){return arguments.length?this.each(null==c?htmlRemove:("function"==typeof c?htmlFunction:htmlConstant)(c)):this.node().innerHTML},raise:function selection_raise(){return this.each(raise)},lower:function selection_lower(){return this.each(lower)},append:function append(c){var h="function"==typeof c?c:src_creator(c);return this.select(function(){return this.appendChild(h.apply(this,arguments))})},insert:function insert(c,h){var g="function"==typeof c?c:src_creator(c),m=null==h?constantNull:"function"==typeof h?h:selector(h);return this.select(function(){return this.insertBefore(g.apply(this,arguments),m.apply(this,arguments)||null)})},remove:function selection_remove(){return this.each(remove)},clone:function clone(c){return this.select(c?selection_cloneDeep:selection_cloneShallow)},datum:function selection_datum(c){return arguments.length?this.property("__data__",c):this.node().__data__},on:function on(c,h,g){var m,b,w=function parseTypenames(c){return c.trim().split(/^|\s+/).map(function(c){var h="",g=c.indexOf(".");return g>=0&&(h=c.slice(g+1),c=c.slice(0,g)),{type:c,name:h}})}(c+""),S=w.length;if(!(arguments.length<2)){for(M=h?onAdd:onRemove,m=0;m<S;++m)this.each(M(w[m],h,g));return this}var M=this.node().__on;if(M)for(var k,T=0,E=M.length;T<E;++T)for(m=0,k=M[T];m<S;++m)if((b=w[m]).type===k.type&&b.name===k.name)return k.value},dispatch:function dispatch(c,h){return this.each(("function"==typeof h?dispatchFunction:dispatchConstant)(c,h))},[Symbol.iterator]:function*iterator(){for(var c=this._groups,h=0,g=c.length;h<g;++h)for(var m,b=c[h],w=0,S=b.length;w<S;++w)(m=b[w])&&(yield m)}};const G=selection;function src_select(c){return"string"==typeof c?new selection_Selection([[document.querySelector(c)]],[document.documentElement]):new selection_Selection([[c]],R)}function min_min(c,h){let g;if(void 0===h)for(const h of c)null!=h&&(g>h||void 0===g&&h>=h)&&(g=h);else{let m=-1;for(let b of c)null!=(b=h(b,++m,c))&&(g>b||void 0===g&&b>=b)&&(g=b)}return g}function max_max(c,h){let g;if(void 0===h)for(const h of c)null!=h&&(g<h||void 0===g&&h>=h)&&(g=h);else{let m=-1;for(let b of c)null!=(b=h(b,++m,c))&&(g<b||void 0===g&&b>=b)&&(g=b)}return g}function number_number(c){return null===c?NaN:+c}function quantileSorted(c,h,g=number_number){if((m=c.length)&&!isNaN(h=+h)){if(h<=0||m<2)return+g(c[0],0,c);if(h>=1)return+g(c[m-1],m-1,c);var m,b=(m-1)*h,w=Math.floor(b),S=+g(c[w],w,c);return S+(+g(c[w+1],w+1,c)-S)*(b-w)}}function ascending_ascending(c,h){return null==c||null==h?NaN:c<h?-1:c>h?1:c>=h?0:NaN}function descending_descending(c,h){return null==c||null==h?NaN:h<c?-1:h>c?1:h>=c?0:NaN}function bisector(c){let h,g,m;function left(c,m,b=0,w=c.length){if(b<w){if(0!==h(m,m))return w;do{const h=b+w>>>1;g(c[h],m)<0?b=h+1:w=h}while(b<w)}return b}return 2!==c.length?(h=ascending_ascending,g=(h,g)=>ascending_ascending(c(h),g),m=(h,g)=>c(h)-g):(h=c===ascending_ascending||c===descending_descending?c:zero,g=c,m=c),{left,center:function center(c,h,g=0,b=c.length){const w=left(c,h,g,b-1);return w>g&&m(c[w-1],h)>-m(c[w],h)?w-1:w},right:function right(c,m,b=0,w=c.length){if(b<w){if(0!==h(m,m))return w;do{const h=b+w>>>1;g(c[h],m)<=0?b=h+1:w=h}while(b<w)}return b}}}function zero(){return 0}const q=bisector(ascending_ascending),W=q.right,H=(q.left,bisector(number_number).center,W);function initRange(c,h){switch(arguments.length){case 0:break;case 1:this.range(c);break;default:this.range(h).domain(c)}return this}function quantile_quantile(){var c,h=[],g=[],m=[];function rescale(){var c=0,b=Math.max(1,g.length);for(m=new Array(b-1);++c<b;)m[c-1]=quantileSorted(h,c/b);return scale}function scale(h){return null==h||isNaN(h=+h)?c:g[H(m,h)]}return scale.invertExtent=function(c){var b=g.indexOf(c);return b<0?[NaN,NaN]:[b>0?m[b-1]:h[0],b<m.length?m[b]:h[h.length-1]]},scale.domain=function(c){if(!arguments.length)return h.slice();h=[];for(let g of c)null==g||isNaN(g=+g)||h.push(g);return h.sort(ascending_ascending),rescale()},scale.range=function(c){return arguments.length?(g=Array.from(c),rescale()):g.slice()},scale.unknown=function(h){return arguments.length?(c=h,scale):c},scale.quantiles=function(){return m.slice()},scale.copy=function(){return quantile_quantile().domain(h).range(g).unknown(c)},initRange.apply(scale,arguments)}const U=Math.sqrt(50),Y=Math.sqrt(10),V=Math.sqrt(2);function tickSpec(c,h,g){const m=(h-c)/Math.max(0,g),b=Math.floor(Math.log10(m)),w=m/Math.pow(10,b),S=w>=U?10:w>=Y?5:w>=V?2:1;let M,k,T;return b<0?(T=Math.pow(10,-b)/S,M=Math.round(c*T),k=Math.round(h*T),M/T<c&&++M,k/T>h&&--k,T=-T):(T=Math.pow(10,b)*S,M=Math.round(c/T),k=Math.round(h/T),M*T<c&&++M,k*T>h&&--k),k<M&&.5<=g&&g<2?tickSpec(c,h,2*g):[M,k,T]}function tickIncrement(c,h,g){return tickSpec(c=+c,h=+h,g=+g)[2]}function src_define(c,h,g){c.prototype=h.prototype=g,g.constructor=c}function extend(c,h){var g=Object.create(c.prototype);for(var m in h)g[m]=h[m];return g}function Color(){}var $=.7,X=1/$,K="\\s*([+-]?\\d+)\\s*",Z="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",J="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Q=/^#([0-9a-f]{3,8})$/,tt=new RegExp(`^rgb\\(${K},${K},${K}\\)$`),et=new RegExp(`^rgb\\(${J},${J},${J}\\)$`),nt=new RegExp(`^rgba\\(${K},${K},${K},${Z}\\)$`),rt=new RegExp(`^rgba\\(${J},${J},${J},${Z}\\)$`),ot=new RegExp(`^hsl\\(${Z},${J},${J}\\)$`),at=new RegExp(`^hsla\\(${Z},${J},${J},${Z}\\)$`),it={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function color_formatHex(){return this.rgb().formatHex()}function color_formatRgb(){return this.rgb().formatRgb()}function color_color(c){var h,g;return c=(c+"").trim().toLowerCase(),(h=Q.exec(c))?(g=h[1].length,h=parseInt(h[1],16),6===g?rgbn(h):3===g?new Rgb(h>>8&15|h>>4&240,h>>4&15|240&h,(15&h)<<4|15&h,1):8===g?rgba(h>>24&255,h>>16&255,h>>8&255,(255&h)/255):4===g?rgba(h>>12&15|h>>8&240,h>>8&15|h>>4&240,h>>4&15|240&h,((15&h)<<4|15&h)/255):null):(h=tt.exec(c))?new Rgb(h[1],h[2],h[3],1):(h=et.exec(c))?new Rgb(255*h[1]/100,255*h[2]/100,255*h[3]/100,1):(h=nt.exec(c))?rgba(h[1],h[2],h[3],h[4]):(h=rt.exec(c))?rgba(255*h[1]/100,255*h[2]/100,255*h[3]/100,h[4]):(h=ot.exec(c))?hsla(h[1],h[2]/100,h[3]/100,1):(h=at.exec(c))?hsla(h[1],h[2]/100,h[3]/100,h[4]):it.hasOwnProperty(c)?rgbn(it[c]):"transparent"===c?new Rgb(NaN,NaN,NaN,0):null}function rgbn(c){return new Rgb(c>>16&255,c>>8&255,255&c,1)}function rgba(c,h,g,m){return m<=0&&(c=h=g=NaN),new Rgb(c,h,g,m)}function rgbConvert(c){return c instanceof Color||(c=color_color(c)),c?new Rgb((c=c.rgb()).r,c.g,c.b,c.opacity):new Rgb}function color_rgb(c,h,g,m){return 1===arguments.length?rgbConvert(c):new Rgb(c,h,g,null==m?1:m)}function Rgb(c,h,g,m){this.r=+c,this.g=+h,this.b=+g,this.opacity=+m}function rgb_formatHex(){return`#${hex(this.r)}${hex(this.g)}${hex(this.b)}`}function rgb_formatRgb(){const c=clampa(this.opacity);return`${1===c?"rgb(":"rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${1===c?")":`, ${c})`}`}function clampa(c){return isNaN(c)?1:Math.max(0,Math.min(1,c))}function clampi(c){return Math.max(0,Math.min(255,Math.round(c)||0))}function hex(c){return((c=clampi(c))<16?"0":"")+c.toString(16)}function hsla(c,h,g,m){return m<=0?c=h=g=NaN:g<=0||g>=1?c=h=NaN:h<=0&&(c=NaN),new Hsl(c,h,g,m)}function hslConvert(c){if(c instanceof Hsl)return new Hsl(c.h,c.s,c.l,c.opacity);if(c instanceof Color||(c=color_color(c)),!c)return new Hsl;if(c instanceof Hsl)return c;var h=(c=c.rgb()).r/255,g=c.g/255,m=c.b/255,b=Math.min(h,g,m),w=Math.max(h,g,m),S=NaN,M=w-b,k=(w+b)/2;return M?(S=h===w?(g-m)/M+6*(g<m):g===w?(m-h)/M+2:(h-g)/M+4,M/=k<.5?w+b:2-w-b,S*=60):M=k>0&&k<1?0:S,new Hsl(S,M,k,c.opacity)}function Hsl(c,h,g,m){this.h=+c,this.s=+h,this.l=+g,this.opacity=+m}function clamph(c){return(c=(c||0)%360)<0?c+360:c}function clampt(c){return Math.max(0,Math.min(1,c||0))}function hsl2rgb(c,h,g){return 255*(c<60?h+(g-h)*c/60:c<180?g:c<240?h+(g-h)*(240-c)/60:h)}function basis(c,h,g,m,b){var w=c*c,S=w*c;return((1-3*c+3*w-S)*h+(4-6*w+3*S)*g+(1+3*c+3*w-3*S)*m+S*b)/6}src_define(Color,color_color,{copy(c){return Object.assign(new this.constructor,this,c)},displayable(){return this.rgb().displayable()},hex:color_formatHex,formatHex:color_formatHex,formatHex8:function color_formatHex8(){return this.rgb().formatHex8()},formatHsl:function color_formatHsl(){return hslConvert(this).formatHsl()},formatRgb:color_formatRgb,toString:color_formatRgb}),src_define(Rgb,color_rgb,extend(Color,{brighter(c){return c=null==c?X:Math.pow(X,c),new Rgb(this.r*c,this.g*c,this.b*c,this.opacity)},darker(c){return c=null==c?$:Math.pow($,c),new Rgb(this.r*c,this.g*c,this.b*c,this.opacity)},rgb(){return this},clamp(){return new Rgb(clampi(this.r),clampi(this.g),clampi(this.b),clampa(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rgb_formatHex,formatHex:rgb_formatHex,formatHex8:function rgb_formatHex8(){return`#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:rgb_formatRgb,toString:rgb_formatRgb})),src_define(Hsl,function hsl(c,h,g,m){return 1===arguments.length?hslConvert(c):new Hsl(c,h,g,null==m?1:m)},extend(Color,{brighter(c){return c=null==c?X:Math.pow(X,c),new Hsl(this.h,this.s,this.l*c,this.opacity)},darker(c){return c=null==c?$:Math.pow($,c),new Hsl(this.h,this.s,this.l*c,this.opacity)},rgb(){var c=this.h%360+360*(this.h<0),h=isNaN(c)||isNaN(this.s)?0:this.s,g=this.l,m=g+(g<.5?g:1-g)*h,b=2*g-m;return new Rgb(hsl2rgb(c>=240?c-240:c+120,b,m),hsl2rgb(c,b,m),hsl2rgb(c<120?c+240:c-120,b,m),this.opacity)},clamp(){return new Hsl(clamph(this.h),clampt(this.s),clampt(this.l),clampa(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const c=clampa(this.opacity);return`${1===c?"hsl(":"hsla("}${clamph(this.h)}, ${100*clampt(this.s)}%, ${100*clampt(this.l)}%${1===c?")":`, ${c})`}`}}));const d3_interpolate_src_constant=c=>()=>c;function linear(c,h){return function(g){return c+g*h}}function gamma(c){return 1===(c=+c)?nogamma:function(h,g){return g-h?function exponential(c,h,g){return c=Math.pow(c,g),h=Math.pow(h,g)-c,g=1/g,function(m){return Math.pow(c+m*h,g)}}(h,g,c):d3_interpolate_src_constant(isNaN(h)?g:h)}}function nogamma(c,h){var g=h-c;return g?linear(c,g):d3_interpolate_src_constant(isNaN(c)?h:c)}const st=function rgbGamma(c){var h=gamma(c);function rgb(c,g){var m=h((c=color_rgb(c)).r,(g=color_rgb(g)).r),b=h(c.g,g.g),w=h(c.b,g.b),S=nogamma(c.opacity,g.opacity);return function(h){return c.r=m(h),c.g=b(h),c.b=w(h),c.opacity=S(h),c+""}}return rgb.gamma=rgbGamma,rgb}(1);function rgbSpline(c){return function(h){var g,m,b=h.length,w=new Array(b),S=new Array(b),M=new Array(b);for(g=0;g<b;++g)m=color_rgb(h[g]),w[g]=m.r||0,S[g]=m.g||0,M[g]=m.b||0;return w=c(w),S=c(S),M=c(M),m.opacity=1,function(c){return m.r=w(c),m.g=S(c),m.b=M(c),m+""}}}var lt=rgbSpline(function src_basis(c){var h=c.length-1;return function(g){var m=g<=0?g=0:g>=1?(g=1,h-1):Math.floor(g*h),b=c[m],w=c[m+1],S=m>0?c[m-1]:2*b-w,M=m<h-1?c[m+2]:2*w-b;return basis((g-m/h)*h,S,b,w,M)}});rgbSpline(function basisClosed(c){var h=c.length;return function(g){var m=Math.floor(((g%=1)<0?++g:g)*h),b=c[(m+h-1)%h],w=c[m%h],S=c[(m+1)%h],M=c[(m+2)%h];return basis((g-m/h)*h,b,w,S,M)}});function genericArray(c,h){var g,m=h?h.length:0,b=c?Math.min(m,c.length):0,w=new Array(b),S=new Array(m);for(g=0;g<b;++g)w[g]=value(c[g],h[g]);for(;g<m;++g)S[g]=h[g];return function(c){for(g=0;g<b;++g)S[g]=w[g](c);return S}}function date(c,h){var g=new Date;return c=+c,h=+h,function(m){return g.setTime(c*(1-m)+h*m),g}}function src_number(c,h){return c=+c,h=+h,function(g){return c*(1-g)+h*g}}function object(c,h){var g,m={},b={};for(g in null!==c&&"object"==typeof c||(c={}),null!==h&&"object"==typeof h||(h={}),h)g in c?m[g]=value(c[g],h[g]):b[g]=h[g];return function(c){for(g in m)b[g]=m[g](c);return b}}var ct=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ut=new RegExp(ct.source,"g");function string(c,h){var g,m,b,w=ct.lastIndex=ut.lastIndex=0,S=-1,M=[],k=[];for(c+="",h+="";(g=ct.exec(c))&&(m=ut.exec(h));)(b=m.index)>w&&(b=h.slice(w,b),M[S]?M[S]+=b:M[++S]=b),(g=g[0])===(m=m[0])?M[S]?M[S]+=m:M[++S]=m:(M[++S]=null,k.push({i:S,x:src_number(g,m)})),w=ut.lastIndex;return w<h.length&&(b=h.slice(w),M[S]?M[S]+=b:M[++S]=b),M.length<2?k[0]?function one(c){return function(h){return c(h)+""}}(k[0].x):function string_zero(c){return function(){return c}}(h):(h=k.length,function(c){for(var g,m=0;m<h;++m)M[(g=k[m]).i]=g.x(c);return M.join("")})}function src_numberArray(c,h){h||(h=[]);var g,m=c?Math.min(h.length,c.length):0,b=h.slice();return function(w){for(g=0;g<m;++g)b[g]=c[g]*(1-w)+h[g]*w;return b}}function value(c,h){var g,m=typeof h;return null==h||"boolean"===m?d3_interpolate_src_constant(h):("number"===m?src_number:"string"===m?(g=color_color(h))?(h=g,st):string:h instanceof color_color?st:h instanceof Date?date:function numberArray_isNumberArray(c){return ArrayBuffer.isView(c)&&!(c instanceof DataView)}(h)?src_numberArray:Array.isArray(h)?genericArray:"function"!=typeof h.valueOf&&"function"!=typeof h.toString||isNaN(h)?object:src_number)(c,h)}function round(c,h){return c=+c,h=+h,function(g){return Math.round(c*(1-g)+h*g)}}function src_number_number(c){return+c}var ht=[0,1];function continuous_identity(c){return c}function normalize(c,h){return(h-=c=+c)?function(g){return(g-c)/h}:function constants(c){return function(){return c}}(isNaN(h)?NaN:.5)}function bimap(c,h,g){var m=c[0],b=c[1],w=h[0],S=h[1];return b<m?(m=normalize(b,m),w=g(S,w)):(m=normalize(m,b),w=g(w,S)),function(c){return w(m(c))}}function polymap(c,h,g){var m=Math.min(c.length,h.length)-1,b=new Array(m),w=new Array(m),S=-1;for(c[m]<c[0]&&(c=c.slice().reverse(),h=h.slice().reverse());++S<m;)b[S]=normalize(c[S],c[S+1]),w[S]=g(h[S],h[S+1]);return function(h){var g=H(c,h,1,m)-1;return w[g](b[g](h))}}function copy(c,h){return h.domain(c.domain()).range(c.range()).interpolate(c.interpolate()).clamp(c.clamp()).unknown(c.unknown())}function transformer(){var c,h,g,m,b,w,S=ht,M=ht,k=value,T=continuous_identity;function rescale(){var c=Math.min(S.length,M.length);return T!==continuous_identity&&(T=function clamper(c,h){var g;return c>h&&(g=c,c=h,h=g),function(g){return Math.max(c,Math.min(h,g))}}(S[0],S[c-1])),m=c>2?polymap:bimap,b=w=null,scale}function scale(h){return null==h||isNaN(h=+h)?g:(b||(b=m(S.map(c),M,k)))(c(T(h)))}return scale.invert=function(g){return T(h((w||(w=m(M,S.map(c),src_number)))(g)))},scale.domain=function(c){return arguments.length?(S=Array.from(c,src_number_number),rescale()):S.slice()},scale.range=function(c){return arguments.length?(M=Array.from(c),rescale()):M.slice()},scale.rangeRound=function(c){return M=Array.from(c),k=round,rescale()},scale.clamp=function(c){return arguments.length?(T=!!c||continuous_identity,rescale()):T!==continuous_identity},scale.interpolate=function(c){return arguments.length?(k=c,rescale()):k},scale.unknown=function(c){return arguments.length?(g=c,scale):g},function(g,m){return c=g,h=m,rescale()}}function continuous(){return transformer()(continuous_identity,continuous_identity)}var dt,pt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(c){if(!(h=pt.exec(c)))throw new Error("invalid format: "+c);var h;return new FormatSpecifier({fill:h[1],align:h[2],sign:h[3],symbol:h[4],zero:h[5],width:h[6],comma:h[7],precision:h[8]&&h[8].slice(1),trim:h[9],type:h[10]})}function FormatSpecifier(c){this.fill=void 0===c.fill?" ":c.fill+"",this.align=void 0===c.align?">":c.align+"",this.sign=void 0===c.sign?"-":c.sign+"",this.symbol=void 0===c.symbol?"":c.symbol+"",this.zero=!!c.zero,this.width=void 0===c.width?void 0:+c.width,this.comma=!!c.comma,this.precision=void 0===c.precision?void 0:+c.precision,this.trim=!!c.trim,this.type=void 0===c.type?"":c.type+""}function formatDecimalParts(c,h){if((g=(c=h?c.toExponential(h-1):c.toExponential()).indexOf("e"))<0)return null;var g,m=c.slice(0,g);return[m.length>1?m[0]+m.slice(2):m,+c.slice(g+1)]}function exponent(c){return(c=formatDecimalParts(Math.abs(c)))?c[1]:NaN}function formatRounded(c,h){var g=formatDecimalParts(c,h);if(!g)return c+"";var m=g[0],b=g[1];return b<0?"0."+new Array(-b).join("0")+m:m.length>b+1?m.slice(0,b+1)+"."+m.slice(b+1):m+new Array(b-m.length+2).join("0")}formatSpecifier.prototype=FormatSpecifier.prototype,FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const ft={"%":(c,h)=>(100*c).toFixed(h),b:c=>Math.round(c).toString(2),c:c=>c+"",d:function formatDecimal(c){return Math.abs(c=Math.round(c))>=1e21?c.toLocaleString("en").replace(/,/g,""):c.toString(10)},e:(c,h)=>c.toExponential(h),f:(c,h)=>c.toFixed(h),g:(c,h)=>c.toPrecision(h),o:c=>Math.round(c).toString(8),p:(c,h)=>formatRounded(100*c,h),r:formatRounded,s:function formatPrefixAuto(c,h){var g=formatDecimalParts(c,h);if(!g)return c+"";var m=g[0],b=g[1],w=b-(dt=3*Math.max(-8,Math.min(8,Math.floor(b/3))))+1,S=m.length;return w===S?m:w>S?m+new Array(w-S+1).join("0"):w>0?m.slice(0,w)+"."+m.slice(w):"0."+new Array(1-w).join("0")+formatDecimalParts(c,Math.max(0,h+w-1))[0]},X:c=>Math.round(c).toString(16).toUpperCase(),x:c=>Math.round(c).toString(16)};function src_identity(c){return c}var gt,_t,mt,vt=Array.prototype.map,yt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function locale(c){var h=void 0===c.grouping||void 0===c.thousands?src_identity:function formatGroup(c,h){return function(g,m){for(var b=g.length,w=[],S=0,M=c[0],k=0;b>0&&M>0&&(k+M+1>m&&(M=Math.max(1,m-k)),w.push(g.substring(b-=M,b+M)),!((k+=M+1)>m));)M=c[S=(S+1)%c.length];return w.reverse().join(h)}}(vt.call(c.grouping,Number),c.thousands+""),g=void 0===c.currency?"":c.currency[0]+"",m=void 0===c.currency?"":c.currency[1]+"",b=void 0===c.decimal?".":c.decimal+"",w=void 0===c.numerals?src_identity:function formatNumerals(c){return function(h){return h.replace(/[0-9]/g,function(h){return c[+h]})}}(vt.call(c.numerals,String)),S=void 0===c.percent?"%":c.percent+"",M=void 0===c.minus?"−":c.minus+"",k=void 0===c.nan?"NaN":c.nan+"";function newFormat(c){var T=(c=formatSpecifier(c)).fill,E=c.align,I=c.sign,P=c.symbol,L=c.zero,B=c.width,z=c.comma,j=c.precision,D=c.trim,N=c.type;"n"===N?(z=!0,N="g"):ft[N]||(void 0===j&&(j=12),D=!0,N="g"),(L||"0"===T&&"="===E)&&(L=!0,T="0",E="=");var R="$"===P?g:"#"===P&&/[boxX]/.test(N)?"0"+N.toLowerCase():"",G="$"===P?m:/[%p]/.test(N)?S:"",q=ft[N],W=/[defgprs%]/.test(N);function format(c){var g,m,S,P=R,H=G;if("c"===N)H=q(c)+H,c="";else{var U=(c=+c)<0||1/c<0;if(c=isNaN(c)?k:q(Math.abs(c),j),D&&(c=function formatTrim(c){t:for(var h,g=c.length,m=1,b=-1;m<g;++m)switch(c[m]){case".":b=h=m;break;case"0":0===b&&(b=m),h=m;break;default:if(!+c[m])break t;b>0&&(b=0)}return b>0?c.slice(0,b)+c.slice(h+1):c}(c)),U&&0===+c&&"+"!==I&&(U=!1),P=(U?"("===I?I:M:"-"===I||"("===I?"":I)+P,H=("s"===N?yt[8+dt/3]:"")+H+(U&&"("===I?")":""),W)for(g=-1,m=c.length;++g<m;)if(48>(S=c.charCodeAt(g))||S>57){H=(46===S?b+c.slice(g+1):c.slice(g))+H,c=c.slice(0,g);break}}z&&!L&&(c=h(c,1/0));var Y=P.length+c.length+H.length,V=Y<B?new Array(B-Y+1).join(T):"";switch(z&&L&&(c=h(V+c,V.length?B-H.length:1/0),V=""),E){case"<":c=P+c+H+V;break;case"=":c=P+V+c+H;break;case"^":c=V.slice(0,Y=V.length>>1)+P+c+H+V.slice(Y);break;default:c=V+P+c+H}return w(c)}return j=void 0===j?6:/[gprs]/.test(N)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j)),format.toString=function(){return c+""},format}return{format:newFormat,formatPrefix:function formatPrefix(c,h){var g=newFormat(((c=formatSpecifier(c)).type="f",c)),m=3*Math.max(-8,Math.min(8,Math.floor(exponent(h)/3))),b=Math.pow(10,-m),w=yt[8+m/3];return function(c){return g(b*c)+w}}}}function defaultLocale(c){return gt=locale(c),_t=gt.format,mt=gt.formatPrefix,gt}function tickFormat(c,h,g,m){var b,w=function tickStep(c,h,g){g=+g;const m=(h=+h)<(c=+c),b=m?tickIncrement(h,c,g):tickIncrement(c,h,g);return(m?-1:1)*(b<0?1/-b:b)}(c,h,g);switch((m=formatSpecifier(null==m?",f":m)).type){case"s":var S=Math.max(Math.abs(c),Math.abs(h));return null!=m.precision||isNaN(b=function precisionPrefix(c,h){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(exponent(h)/3)))-exponent(Math.abs(c)))}(w,S))||(m.precision=b),mt(m,S);case"":case"e":case"g":case"p":case"r":null!=m.precision||isNaN(b=function precisionRound(c,h){return c=Math.abs(c),h=Math.abs(h)-c,Math.max(0,exponent(h)-exponent(c))+1}(w,Math.max(Math.abs(c),Math.abs(h))))||(m.precision=b-("e"===m.type));break;case"f":case"%":null!=m.precision||isNaN(b=function precisionFixed(c){return Math.max(0,-exponent(Math.abs(c)))}(w))||(m.precision=b-2*("%"===m.type))}return _t(m)}function linearish(c){var h=c.domain;return c.ticks=function(c){var g=h();return function ticks(c,h,g){if(!((g=+g)>0))return[];if((c=+c)===(h=+h))return[c];const m=h<c,[b,w,S]=m?tickSpec(h,c,g):tickSpec(c,h,g);if(!(w>=b))return[];const M=w-b+1,k=new Array(M);if(m)if(S<0)for(let c=0;c<M;++c)k[c]=(w-c)/-S;else for(let c=0;c<M;++c)k[c]=(w-c)*S;else if(S<0)for(let c=0;c<M;++c)k[c]=(b+c)/-S;else for(let c=0;c<M;++c)k[c]=(b+c)*S;return k}(g[0],g[g.length-1],null==c?10:c)},c.tickFormat=function(c,g){var m=h();return tickFormat(m[0],m[m.length-1],null==c?10:c,g)},c.nice=function(g){null==g&&(g=10);var m,b,w=h(),S=0,M=w.length-1,k=w[S],T=w[M],E=10;for(T<k&&(b=k,k=T,T=b,b=S,S=M,M=b);E-- >0;){if((b=tickIncrement(k,T,g))===m)return w[S]=k,w[M]=T,h(w);if(b>0)k=Math.floor(k/b)*b,T=Math.ceil(T/b)*b;else{if(!(b<0))break;k=Math.ceil(k*b)/b,T=Math.floor(T*b)/b}m=b}return c},c}function linear_linear(){var c=continuous();return c.copy=function(){return copy(c,linear_linear())},initRange.apply(c,arguments),linearish(c)}function quantize(){var c,h=0,g=1,m=1,b=[.5],w=[0,1];function scale(h){return null!=h&&h<=h?w[H(b,h,0,m)]:c}function rescale(){var c=-1;for(b=new Array(m);++c<m;)b[c]=((c+1)*g-(c-m)*h)/(m+1);return scale}return scale.domain=function(c){return arguments.length?([h,g]=c,h=+h,g=+g,rescale()):[h,g]},scale.range=function(c){return arguments.length?(m=(w=Array.from(c)).length-1,rescale()):w.slice()},scale.invertExtent=function(c){var S=w.indexOf(c);return S<0?[NaN,NaN]:S<1?[h,b[0]]:S>=m?[b[m-1],g]:[b[S-1],b[S]]},scale.unknown=function(h){return arguments.length?(c=h,scale):scale},scale.thresholds=function(){return b.slice()},scale.copy=function(){return quantize().domain([h,g]).range(w).unknown(c)},initRange.apply(linearish(scale),arguments)}function threshold(){var c,h=[.5],g=[0,1],m=1;function scale(b){return null!=b&&b<=b?g[H(h,b,0,m)]:c}return scale.domain=function(c){return arguments.length?(h=Array.from(c),m=Math.min(h.length,g.length-1),scale):h.slice()},scale.range=function(c){return arguments.length?(g=Array.from(c),m=Math.min(h.length,g.length-1),scale):g.slice()},scale.invertExtent=function(c){var m=g.indexOf(c);return[h[m-1],h[m]]},scale.unknown=function(h){return arguments.length?(c=h,scale):c},scale.copy=function(){return threshold().domain(h).range(g).unknown(c)},initRange.apply(scale,arguments)}function colors(c){for(var h=c.length/6|0,g=new Array(h),m=0;m<h;)g[m]="#"+c.slice(6*m,6*++m);return g}defaultLocale({thousands:",",grouping:[3],currency:["$",""]});const ramp=c=>lt(c[c.length-1]);const At=ramp(new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(colors));const bt=Math.PI/180,xt=180/Math.PI,wt=.96422,Ct=.82521,St=4/29,Mt=6/29,kt=3*Mt*Mt,Tt=Mt*Mt*Mt;function labConvert(c){if(c instanceof Lab)return new Lab(c.l,c.a,c.b,c.opacity);if(c instanceof Hcl)return hcl2lab(c);c instanceof Rgb||(c=rgbConvert(c));var h,g,m=rgb2lrgb(c.r),b=rgb2lrgb(c.g),w=rgb2lrgb(c.b),S=xyz2lab((.2225045*m+.7168786*b+.0606169*w)/1);return m===b&&b===w?h=g=S:(h=xyz2lab((.4360747*m+.3850649*b+.1430804*w)/wt),g=xyz2lab((.0139322*m+.0971045*b+.7141733*w)/Ct)),new Lab(116*S-16,500*(h-S),200*(S-g),c.opacity)}function lab(c,h,g,m){return 1===arguments.length?labConvert(c):new Lab(c,h,g,null==m?1:m)}function Lab(c,h,g,m){this.l=+c,this.a=+h,this.b=+g,this.opacity=+m}function xyz2lab(c){return c>Tt?Math.pow(c,1/3):c/kt+St}function lab2xyz(c){return c>Mt?c*c*c:kt*(c-St)}function lrgb2rgb(c){return 255*(c<=.0031308?12.92*c:1.055*Math.pow(c,1/2.4)-.055)}function rgb2lrgb(c){return(c/=255)<=.04045?c/12.92:Math.pow((c+.055)/1.055,2.4)}function hclConvert(c){if(c instanceof Hcl)return new Hcl(c.h,c.c,c.l,c.opacity);if(c instanceof Lab||(c=labConvert(c)),0===c.a&&0===c.b)return new Hcl(NaN,0<c.l&&c.l<100?0:NaN,c.l,c.opacity);var h=Math.atan2(c.b,c.a)*xt;return new Hcl(h<0?h+360:h,Math.sqrt(c.a*c.a+c.b*c.b),c.l,c.opacity)}function Hcl(c,h,g,m){this.h=+c,this.c=+h,this.l=+g,this.opacity=+m}function hcl2lab(c){if(isNaN(c.h))return new Lab(c.l,0,0,c.opacity);var h=c.h*bt;return new Lab(c.l,Math.cos(h)*c.c,Math.sin(h)*c.c,c.opacity)}function lab_lab(c,h){var g=nogamma((c=lab(c)).l,(h=lab(h)).l),m=nogamma(c.a,h.a),b=nogamma(c.b,h.b),w=nogamma(c.opacity,h.opacity);return function(h){return c.l=g(h),c.a=m(h),c.b=b(h),c.opacity=w(h),c+""}}function asyncGeneratorStep(c,h,g,m,b,w,S){try{var M=c[w](S),k=M.value}catch(c){return void g(c)}M.done?h(k):Promise.resolve(k).then(m,b)}function _asyncToGenerator(c){return function(){var h=this,g=arguments;return new Promise(function(m,b){var w=c.apply(h,g);function _next(c){asyncGeneratorStep(w,m,b,_next,_throw,"next",c)}function _throw(c){asyncGeneratorStep(w,m,b,_next,_throw,"throw",c)}_next(void 0)})}}src_define(Lab,lab,extend(Color,{brighter(c){return new Lab(this.l+18*(null==c?1:c),this.a,this.b,this.opacity)},darker(c){return new Lab(this.l-18*(null==c?1:c),this.a,this.b,this.opacity)},rgb(){var c=(this.l+16)/116,h=isNaN(this.a)?c:c+this.a/500,g=isNaN(this.b)?c:c-this.b/200;return new Rgb(lrgb2rgb(3.1338561*(h=wt*lab2xyz(h))-1.6168667*(c=1*lab2xyz(c))-.4906146*(g=Ct*lab2xyz(g))),lrgb2rgb(-.9787684*h+1.9161415*c+.033454*g),lrgb2rgb(.0719453*h-.2289914*c+1.4052427*g),this.opacity)}})),src_define(Hcl,function hcl(c,h,g,m){return 1===arguments.length?hclConvert(c):new Hcl(c,h,g,null==m?1:m)},extend(Color,{brighter(c){return new Hcl(this.h,this.c,this.l+18*(null==c?1:c),this.opacity)},darker(c){return new Hcl(this.h,this.c,this.l-18*(null==c?1:c),this.opacity)},rgb(){return hcl2lab(this).rgb()}}));var Et=__webpack_require__(4756),It=__webpack_require__.n(Et);function _createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function utils_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return utils_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?utils_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function utils_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function ensureGroup(c,h){var g=c.select("g.".concat(h));return g.empty()?g=c.append("g").attr("class",h):g.selectAll("*").remove(),g}function updateCSSRule(c,h,g){if(!c.startsWith(".")&&!c.startsWith("#"))throw new Error('Invalid selector: Must start with "." for classes or "#" for IDs.');for(var m=0,b=Array.from(document.styleSheets);m<b.length;m++){var w=b[m];try{var S,M=_createForOfIteratorHelper(w.cssRules||w.rules);try{for(M.s();!(S=M.n()).done;){var k=S.value;if(k.selectorText===c)return void(k.style[h]=g)}}catch(c){M.e(c)}finally{M.f()}}catch(c){}}var T=document.getElementById("custom-styles");T||((T=document.createElement("style")).id="custom-styles",document.head.appendChild(T));try{T.sheet.insertRule("".concat(c," { ").concat(h,": ").concat(g,"; }"),T.sheet.cssRules.length)}catch(m){console.error("Failed to insert rule: ".concat(c," { ").concat(h,": ").concat(g,"; }"),m)}}var Pt=function getFontSizeFromClass(c){var h=document.createElement("div");h.className=c,h.style.position="absolute",h.style.visibility="hidden",h.style.height="auto",h.style.width="auto",h.style.lineHeight="normal",h.style.fontSize="initial",document.body.appendChild(h);var g=parseFloat(window.getComputedStyle(h).fontSize);return document.body.removeChild(h),g||0},Lt=function getCSSPropertyFromClass(c,h){var g=document.createElement("div");g.className=c,g.style.position="absolute",g.style.visibility="hidden",g.style.height="auto",g.style.lineHeight="normal",document.body.appendChild(g);var m=window.getComputedStyle(g).getPropertyValue(h);return document.body.removeChild(g),m||null};function applyComputedStylesToSVG(c){if(c&&c instanceof SVGElement){var h=new Set(["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset"]),g=[].concat(toConsumableArray_toConsumableArray(Array.from(h)),["vector-effect","shape-rendering","text-anchor","dominant-baseline","font-family","font-size","font-style","font-weight","letter-spacing","word-spacing","line-height","opacity","visibility","display","mix-blend-mode","filter","marker-start","marker-mid","marker-end","transform"]);inlineComputedStyle(c),c.querySelectorAll("*").forEach(function(c){return inlineComputedStyle(c)})}function inlineComputedStyle(c){var m=window.getComputedStyle(c);if(g.forEach(function(g){try{var b=m.getPropertyValue(g);if(!b||""===b||"initial"===b)return;if("none"===b&&!h.has(g))return;if("0px"===b&&"stroke-width"!==g)return;c.style.getPropertyValue(g)||c.style.setProperty(g,b)}catch(c){}}),c.tagName&&"text"===c.tagName.toLowerCase()){var b=m.getPropertyValue("font-size");b&&!c.style.getPropertyValue("font-size")&&c.style.setProperty("font-size",b)}}}function ensureSvgSize(c){var h=c.getBoundingClientRect(),g=Math.round(h.width)||parseInt(c.getAttribute("width"))||800,m=Math.round(h.height)||parseInt(c.getAttribute("height"))||600;c.hasAttribute("viewBox")||c.setAttribute("viewBox","0 0 ".concat(g," ").concat(m)),c.setAttribute("width",g),c.setAttribute("height",m)}var Ft=function spaceAsThousandSeparator(c){return c.toLocaleString("en").replace(/,/gi," ")};function generateUniqueId(c){return"".concat(c,"-").concat(Math.random().toString(36).substr(2,9))}var Bt=function executeForAllInsets(c,h,g){var m=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,b=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;for(var w in c){var S=c[w];Array.isArray(S)?S.forEach(function(c){Array.isArray(c)?c.forEach(function(c){c.svgId_!==h&&g(c,m,b)}):c.svgId_!==h&&g(c,m,b)}):S.svgId_!==h&&g(S,m,b)}};function getParameterByName(c){c=c.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var h=new RegExp("[\\?&]"+c+"=([^&#]*)").exec(location.search);return h?decodeURIComponent(h[1].replace(/\+/g," ")):null}var Ot=function getTextColorForBackground(c){var h,g,m;if(!c.startsWith("rgb")&&!c.startsWith("#")){var b=document.createElement("div");b.style.color=c,document.body.appendChild(b);var w=window.getComputedStyle(b).color;document.body.removeChild(b),c=w}if(c.startsWith("#")){var S=c.replace("#","");3===S.length&&(S=S.split("").map(function(c){return c+c}).join("")),h=parseInt(S.substring(0,2),16),g=parseInt(S.substring(2,4),16),m=parseInt(S.substring(4,6),16)}else{var M=c.match(/\d+/g);h=parseInt(M[0]),g=parseInt(M[1]),m=parseInt(M[2])}return h/255*.2126+g/255*.7152+m/255*.0722>.5?"black":"white"},zt=function getRegionsSelector(c){return c.Geometries.userGeometries?"#em-user-regions path":c.gridCartogram_?"#em-grid-container .em-grid-cell":"WORLD"===c.geo_?"#em-worldrg path":"#em-nutsrg path:not(#em-cntrg-RS):not(#em-cntrg-EL), #em-cntrg path:not(#em-cntrg-RS):not(#em-cntrg-EL)"},jt=function getLegendRegionsSelector(c){return c.Geometries.userGeometries?"#em-user-regions":c.gridCartogram_?"#em-grid-container":"WORLD"===c.geo_?"#em-worldrg":"#em-nutsrg, #em-cntrg"};function _typeof(c){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},_typeof(c)}function toPropertyKey(c){var h=function toPrimitive(c,h){if("object"!=_typeof(c)||!c)return c;var g=c[Symbol.toPrimitive];if(void 0!==g){var m=g.call(c,h||"default");if("object"!=_typeof(m))return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===h?String:Number)(c)}(c,"string");return"symbol"==_typeof(h)?h:h+""}function _defineProperty(c,h,g){return(h=toPropertyKey(h))in c?Object.defineProperty(c,h,{value:g,enumerable:!0,configurable:!0,writable:!0}):c[h]=g,c}function src_selectAll(c){return"string"==typeof c?new selection_Selection([document.querySelectorAll(c)],[document.documentElement]):new selection_Selection([array(c)],R)}class Adder{constructor(){this._partials=new Float64Array(32),this._n=0}add(c){const h=this._partials;let g=0;for(let m=0;m<this._n&&m<32;m++){const b=h[m],w=c+b,S=Math.abs(c)<Math.abs(b)?c-(w-b):b-(w-c);S&&(h[g++]=S),c=w}return h[g]=c,this._n=g+1,this}valueOf(){const c=this._partials;let h,g,m,b=this._n,w=0;if(b>0){for(w=c[--b];b>0&&(h=w,g=c[--b],w=h+g,m=g-(w-h),!m););b>0&&(m<0&&c[b-1]<0||m>0&&c[b-1]>0)&&(g=2*m,h=w+g,g==h-w&&(w=h))}return w}}var Dt=1e-6,Nt=1e-12,Rt=Math.PI,Gt=Rt/2,qt=Rt/4,Wt=2*Rt,Ht=180/Rt,Ut=Rt/180,Yt=Math.abs,Vt=Math.atan,$t=Math.atan2,Xt=Math.cos,Kt=Math.ceil,Zt=(Math.exp,Math.floor,Math.hypot),Jt=(Math.log,Math.pow,Math.sin),Qt=Math.sign||function(c){return c>0?1:c<0?-1:0},te=Math.sqrt;Math.tan;function asin(c){return c>1?Gt:c<-1?-Gt:Math.asin(c)}function noop(){}function streamGeometry(c,h){c&&ve.hasOwnProperty(c.type)&&ve[c.type](c,h)}var ee,ne,re,oe,ae,ie,se,le,ce,ue,he,de,pe,fe,ge,_e,me={Feature:function(c,h){streamGeometry(c.geometry,h)},FeatureCollection:function(c,h){for(var g=c.features,m=-1,b=g.length;++m<b;)streamGeometry(g[m].geometry,h)}},ve={Sphere:function(c,h){h.sphere()},Point:function(c,h){c=c.coordinates,h.point(c[0],c[1],c[2])},MultiPoint:function(c,h){for(var g=c.coordinates,m=-1,b=g.length;++m<b;)c=g[m],h.point(c[0],c[1],c[2])},LineString:function(c,h){streamLine(c.coordinates,h,0)},MultiLineString:function(c,h){for(var g=c.coordinates,m=-1,b=g.length;++m<b;)streamLine(g[m],h,0)},Polygon:function(c,h){streamPolygon(c.coordinates,h)},MultiPolygon:function(c,h){for(var g=c.coordinates,m=-1,b=g.length;++m<b;)streamPolygon(g[m],h)},GeometryCollection:function(c,h){for(var g=c.geometries,m=-1,b=g.length;++m<b;)streamGeometry(g[m],h)}};function streamLine(c,h,g){var m,b=-1,w=c.length-g;for(h.lineStart();++b<w;)m=c[b],h.point(m[0],m[1],m[2]);h.lineEnd()}function streamPolygon(c,h){var g=-1,m=c.length;for(h.polygonStart();++g<m;)streamLine(c[g],h,1);h.polygonEnd()}function stream(c,h){c&&me.hasOwnProperty(c.type)?me[c.type](c,h):streamGeometry(c,h)}var ye={sphere:noop,point:centroidPoint,lineStart:centroidLineStart,lineEnd:centroidLineEnd,polygonStart:function(){ye.lineStart=centroidRingStart,ye.lineEnd=centroidRingEnd},polygonEnd:function(){ye.lineStart=centroidLineStart,ye.lineEnd=centroidLineEnd}};function centroidPoint(c,h){c*=Ut;var g=Xt(h*=Ut);centroidPointCartesian(g*Xt(c),g*Jt(c),Jt(h))}function centroidPointCartesian(c,h,g){++ee,re+=(c-re)/ee,oe+=(h-oe)/ee,ae+=(g-ae)/ee}function centroidLineStart(){ye.point=centroidLinePointFirst}function centroidLinePointFirst(c,h){c*=Ut;var g=Xt(h*=Ut);fe=g*Xt(c),ge=g*Jt(c),_e=Jt(h),ye.point=centroidLinePoint,centroidPointCartesian(fe,ge,_e)}function centroidLinePoint(c,h){c*=Ut;var g=Xt(h*=Ut),m=g*Xt(c),b=g*Jt(c),w=Jt(h),S=$t(te((S=ge*w-_e*b)*S+(S=_e*m-fe*w)*S+(S=fe*b-ge*m)*S),fe*m+ge*b+_e*w);ne+=S,ie+=S*(fe+(fe=m)),se+=S*(ge+(ge=b)),le+=S*(_e+(_e=w)),centroidPointCartesian(fe,ge,_e)}function centroidLineEnd(){ye.point=centroidPoint}function centroidRingStart(){ye.point=centroidRingPointFirst}function centroidRingEnd(){centroidRingPoint(de,pe),ye.point=centroidPoint}function centroidRingPointFirst(c,h){de=c,pe=h,c*=Ut,h*=Ut,ye.point=centroidRingPoint;var g=Xt(h);fe=g*Xt(c),ge=g*Jt(c),_e=Jt(h),centroidPointCartesian(fe,ge,_e)}function centroidRingPoint(c,h){c*=Ut;var g=Xt(h*=Ut),m=g*Xt(c),b=g*Jt(c),w=Jt(h),S=ge*w-_e*b,M=_e*m-fe*w,k=fe*b-ge*m,T=Zt(S,M,k),E=asin(T),I=T&&-E/T;ce.add(I*S),ue.add(I*M),he.add(I*k),ne+=E,ie+=E*(fe+(fe=m)),se+=E*(ge+(ge=b)),le+=E*(_e+(_e=w)),centroidPointCartesian(fe,ge,_e)}function centroid(c){ee=ne=re=oe=ae=ie=se=le=0,ce=new Adder,ue=new Adder,he=new Adder,stream(c,ye);var h=+ce,g=+ue,m=+he,b=Zt(h,g,m);return b<Nt&&(h=ie,g=se,m=le,ne<Dt&&(h=re,g=oe,m=ae),(b=Zt(h,g,m))<Nt)?[NaN,NaN]:[$t(g,h)*Ht,asin(m/b)*Ht]}function buffer(){var c,h=[];return{point:function(h,g,m){c.push([h,g,m])},lineStart:function(){h.push(c=[])},lineEnd:noop,rejoin:function(){h.length>1&&h.push(h.pop().concat(h.shift()))},result:function(){var g=h;return h=[],c=null,g}}}function pointEqual(c,h){return Yt(c[0]-h[0])<Dt&&Yt(c[1]-h[1])<Dt}function Intersection(c,h,g,m){this.x=c,this.z=h,this.o=g,this.e=m,this.v=!1,this.n=this.p=null}function rejoin(c,h,g,m,b){var w,S,M=[],k=[];if(c.forEach(function(c){if(!((h=c.length-1)<=0)){var h,g,m=c[0],S=c[h];if(pointEqual(m,S)){if(!m[2]&&!S[2]){for(b.lineStart(),w=0;w<h;++w)b.point((m=c[w])[0],m[1]);return void b.lineEnd()}S[0]+=2e-6}M.push(g=new Intersection(m,c,null,!0)),k.push(g.o=new Intersection(m,null,g,!1)),M.push(g=new Intersection(S,c,null,!1)),k.push(g.o=new Intersection(S,null,g,!0))}}),M.length){for(k.sort(h),rejoin_link(M),rejoin_link(k),w=0,S=k.length;w<S;++w)k[w].e=g=!g;for(var T,E,I=M[0];;){for(var P=I,L=!0;P.v;)if((P=P.n)===I)return;T=P.z,b.lineStart();do{if(P.v=P.o.v=!0,P.e){if(L)for(w=0,S=T.length;w<S;++w)b.point((E=T[w])[0],E[1]);else m(P.x,P.n.x,1,b);P=P.n}else{if(L)for(T=P.p.z,w=T.length-1;w>=0;--w)b.point((E=T[w])[0],E[1]);else m(P.x,P.p.x,-1,b);P=P.p}T=(P=P.o).z,L=!L}while(!P.v);b.lineEnd()}}}function rejoin_link(c){if(h=c.length){for(var h,g,m=0,b=c[0];++m<h;)b.n=g=c[m],g.p=b,b=g;b.n=g=c[0],g.p=b}}function merge_merge(c){return Array.from(function*flatten(c){for(const h of c)yield*h}(c))}var Ae=1e9,be=-Ae;function clipRectangle(c,h,g,m){function visible(b,w){return c<=b&&b<=g&&h<=w&&w<=m}function interpolate(b,w,S,M){var k=0,T=0;if(null==b||(k=corner(b,S))!==(T=corner(w,S))||comparePoint(b,w)<0^S>0)do{M.point(0===k||3===k?c:g,k>1?m:h)}while((k=(k+S+4)%4)!==T);else M.point(w[0],w[1])}function corner(m,b){return Yt(m[0]-c)<Dt?b>0?0:3:Yt(m[0]-g)<Dt?b>0?2:1:Yt(m[1]-h)<Dt?b>0?1:0:b>0?3:2}function compareIntersection(c,h){return comparePoint(c.x,h.x)}function comparePoint(c,h){var g=corner(c,1),m=corner(h,1);return g!==m?g-m:0===g?h[1]-c[1]:1===g?c[0]-h[0]:2===g?c[1]-h[1]:h[0]-c[0]}return function(b){var w,S,M,k,T,E,I,P,L,B,z,j=b,D=buffer(),N={point,lineStart:function lineStart(){N.point=linePoint,S&&S.push(M=[]);B=!0,L=!1,I=P=NaN},lineEnd:function lineEnd(){w&&(linePoint(k,T),E&&L&&D.rejoin(),w.push(D.result()));N.point=point,L&&j.lineEnd()},polygonStart:function polygonStart(){j=D,w=[],S=[],z=!0},polygonEnd:function polygonEnd(){var h=function polygonInside(){for(var h=0,g=0,b=S.length;g<b;++g)for(var w,M,k=S[g],T=1,E=k.length,I=k[0],P=I[0],L=I[1];T<E;++T)w=P,M=L,P=(I=k[T])[0],L=I[1],M<=m?L>m&&(P-w)*(m-M)>(L-M)*(c-w)&&++h:L<=m&&(P-w)*(m-M)<(L-M)*(c-w)&&--h;return h}(),g=z&&h,k=(w=merge_merge(w)).length;(g||k)&&(b.polygonStart(),g&&(b.lineStart(),interpolate(null,null,1,b),b.lineEnd()),k&&rejoin(w,compareIntersection,h,interpolate,b),b.polygonEnd());j=b,w=S=M=null}};function point(c,h){visible(c,h)&&j.point(c,h)}function linePoint(b,w){var D=visible(b,w);if(S&&M.push([b,w]),B)k=b,T=w,E=D,B=!1,D&&(j.lineStart(),j.point(b,w));else if(D&&L)j.point(b,w);else{var N=[I=Math.max(be,Math.min(Ae,I)),P=Math.max(be,Math.min(Ae,P))],R=[b=Math.max(be,Math.min(Ae,b)),w=Math.max(be,Math.min(Ae,w))];!function clip_line(c,h,g,m,b,w){var S,M=c[0],k=c[1],T=0,E=1,I=h[0]-M,P=h[1]-k;if(S=g-M,I||!(S>0)){if(S/=I,I<0){if(S<T)return;S<E&&(E=S)}else if(I>0){if(S>E)return;S>T&&(T=S)}if(S=b-M,I||!(S<0)){if(S/=I,I<0){if(S>E)return;S>T&&(T=S)}else if(I>0){if(S<T)return;S<E&&(E=S)}if(S=m-k,P||!(S>0)){if(S/=P,P<0){if(S<T)return;S<E&&(E=S)}else if(P>0){if(S>E)return;S>T&&(T=S)}if(S=w-k,P||!(S<0)){if(S/=P,P<0){if(S>E)return;S>T&&(T=S)}else if(P>0){if(S<T)return;S<E&&(E=S)}return T>0&&(c[0]=M+T*I,c[1]=k+T*P),E<1&&(h[0]=M+E*I,h[1]=k+E*P),!0}}}}}(N,R,c,h,g,m)?D&&(j.lineStart(),j.point(b,w),z=!1):(L||(j.lineStart(),j.point(N[0],N[1])),j.point(R[0],R[1]),D||j.lineEnd(),z=!1)}I=b,P=w,L=D}return N}}const d3_geo_src_identity=c=>c;function transform_transformer(c){return function(h){var g=new TransformStream;for(var m in c)g[m]=c[m];return g.stream=h,g}}function TransformStream(){}TransformStream.prototype={constructor:TransformStream,point:function(c,h){this.stream.point(c,h)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var xe=1/0,we=xe,Ce=-xe,Se=Ce,Me={point:function boundsPoint(c,h){c<xe&&(xe=c);c>Ce&&(Ce=c);h<we&&(we=h);h>Se&&(Se=h)},lineStart:noop,lineEnd:noop,polygonStart:noop,polygonEnd:noop,result:function(){var c=[[xe,we],[Ce,Se]];return Ce=Se=-(we=xe=1/0),c}};const ke=Me;function fit(c,h,g){var m=c.clipExtent&&c.clipExtent();return c.scale(150).translate([0,0]),null!=m&&c.clipExtent(null),stream(g,c.stream(ke)),h(ke.result()),null!=m&&c.clipExtent(m),c}function fitExtent(c,h,g){return fit(c,function(g){var m=h[1][0]-h[0][0],b=h[1][1]-h[0][1],w=Math.min(m/(g[1][0]-g[0][0]),b/(g[1][1]-g[0][1])),S=+h[0][0]+(m-w*(g[1][0]+g[0][0]))/2,M=+h[0][1]+(b-w*(g[1][1]+g[0][1]))/2;c.scale(150*w).translate([S,M])},g)}function fitSize(c,h,g){return fitExtent(c,[[0,0],h],g)}function fitWidth(c,h,g){return fit(c,function(g){var m=+h,b=m/(g[1][0]-g[0][0]),w=(m-b*(g[1][0]+g[0][0]))/2,S=-b*g[0][1];c.scale(150*b).translate([w,S])},g)}function fitHeight(c,h,g){return fit(c,function(g){var m=+h,b=m/(g[1][1]-g[0][1]),w=-b*g[0][0],S=(m-b*(g[1][1]+g[0][1]))/2;c.scale(150*b).translate([w,S])},g)}var Te,Ee,Ie,Pe,Le=new Adder,Fe=new Adder,Be={point:noop,lineStart:noop,lineEnd:noop,polygonStart:function(){Be.lineStart=areaRingStart,Be.lineEnd=areaRingEnd},polygonEnd:function(){Be.lineStart=Be.lineEnd=Be.point=noop,Le.add(Yt(Fe)),Fe=new Adder},result:function(){var c=Le/2;return Le=new Adder,c}};function areaRingStart(){Be.point=areaPointFirst}function areaPointFirst(c,h){Be.point=areaPoint,Te=Ie=c,Ee=Pe=h}function areaPoint(c,h){Fe.add(Pe*c-Ie*h),Ie=c,Pe=h}function areaRingEnd(){areaPoint(Te,Ee)}const Oe=Be;var ze,je,De,Ne,Re=0,Ge=0,qe=0,We=0,He=0,Ue=0,Ye=0,Ve=0,$e=0,Xe={point:centroid_centroidPoint,lineStart:centroid_centroidLineStart,lineEnd:centroid_centroidLineEnd,polygonStart:function(){Xe.lineStart=centroid_centroidRingStart,Xe.lineEnd=centroid_centroidRingEnd},polygonEnd:function(){Xe.point=centroid_centroidPoint,Xe.lineStart=centroid_centroidLineStart,Xe.lineEnd=centroid_centroidLineEnd},result:function(){var c=$e?[Ye/$e,Ve/$e]:Ue?[We/Ue,He/Ue]:qe?[Re/qe,Ge/qe]:[NaN,NaN];return Re=Ge=qe=We=He=Ue=Ye=Ve=$e=0,c}};function centroid_centroidPoint(c,h){Re+=c,Ge+=h,++qe}function centroid_centroidLineStart(){Xe.point=centroidPointFirstLine}function centroidPointFirstLine(c,h){Xe.point=centroidPointLine,centroid_centroidPoint(De=c,Ne=h)}function centroidPointLine(c,h){var g=c-De,m=h-Ne,b=te(g*g+m*m);We+=b*(De+c)/2,He+=b*(Ne+h)/2,Ue+=b,centroid_centroidPoint(De=c,Ne=h)}function centroid_centroidLineEnd(){Xe.point=centroid_centroidPoint}function centroid_centroidRingStart(){Xe.point=centroidPointFirstRing}function centroid_centroidRingEnd(){centroidPointRing(ze,je)}function centroidPointFirstRing(c,h){Xe.point=centroidPointRing,centroid_centroidPoint(ze=De=c,je=Ne=h)}function centroidPointRing(c,h){var g=c-De,m=h-Ne,b=te(g*g+m*m);We+=b*(De+c)/2,He+=b*(Ne+h)/2,Ue+=b,Ye+=(b=Ne*c-De*h)*(De+c),Ve+=b*(Ne+h),$e+=3*b,centroid_centroidPoint(De=c,Ne=h)}const Ke=Xe;function PathContext(c){this._context=c}PathContext.prototype={_radius:4.5,pointRadius:function(c){return this._radius=c,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(c,h){switch(this._point){case 0:this._context.moveTo(c,h),this._point=1;break;case 1:this._context.lineTo(c,h);break;default:this._context.moveTo(c+this._radius,h),this._context.arc(c,h,this._radius,0,Wt)}},result:noop};var Ze,Je,Qe,tn,en,nn=new Adder,rn={point:noop,lineStart:function(){rn.point=lengthPointFirst},lineEnd:function(){Ze&&lengthPoint(Je,Qe),rn.point=noop},polygonStart:function(){Ze=!0},polygonEnd:function(){Ze=null},result:function(){var c=+nn;return nn=new Adder,c}};function lengthPointFirst(c,h){rn.point=lengthPoint,Je=tn=c,Qe=en=h}function lengthPoint(c,h){tn-=c,en-=h,nn.add(te(tn*tn+en*en)),tn=c,en=h}const an=rn;let sn,ln,cn,un;class PathString{constructor(c){this._append=null==c?string_append:function appendRound(c){const h=Math.floor(c);if(!(h>=0))throw new RangeError(`invalid digits: ${c}`);if(h>15)return string_append;if(h!==sn){const c=10**h;sn=h,ln=function append(h){let g=1;this._+=h[0];for(const m=h.length;g<m;++g)this._+=Math.round(arguments[g]*c)/c+h[g]}}return ln}(c),this._radius=4.5,this._=""}pointRadius(c){return this._radius=+c,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(c,h){switch(this._point){case 0:this._append`M${c},${h}`,this._point=1;break;case 1:this._append`L${c},${h}`;break;default:if(this._append`M${c},${h}`,this._radius!==cn||this._append!==ln){const c=this._radius,h=this._;this._="",this._append`m0,${c}a${c},${c} 0 1,1 0,${-2*c}a${c},${c} 0 1,1 0,${2*c}z`,cn=c,ln=this._append,un=this._,this._=h}this._+=un}}result(){const c=this._;return this._="",c.length?c:null}}function string_append(c){let h=1;this._+=c[0];for(const g=c.length;h<g;++h)this._+=arguments[h]+c[h]}function src_path(c,h){let g,m,b=3,w=4.5;function path(c){return c&&("function"==typeof w&&m.pointRadius(+w.apply(this,arguments)),stream(c,g(m))),m.result()}return path.area=function(c){return stream(c,g(Oe)),Oe.result()},path.measure=function(c){return stream(c,g(an)),an.result()},path.bounds=function(c){return stream(c,g(ke)),ke.result()},path.centroid=function(c){return stream(c,g(Ke)),Ke.result()},path.projection=function(h){return arguments.length?(g=null==h?(c=null,d3_geo_src_identity):(c=h).stream,path):c},path.context=function(c){return arguments.length?(m=null==c?(h=null,new PathString(b)):new PathContext(h=c),"function"!=typeof w&&m.pointRadius(w),path):h},path.pointRadius=function(c){return arguments.length?(w="function"==typeof c?c:(m.pointRadius(+c),+c),path):w},path.digits=function(c){if(!arguments.length)return b;if(null==c)b=null;else{const h=Math.floor(c);if(!(h>=0))throw new RangeError(`invalid digits: ${c}`);b=h}return null===h&&(m=new PathString(b)),path},path.projection(c).digits(b).context(h)}function noop_noop(){}function clip_buffer(){var c,h=[];return{point:function(h,g,m){c.push([h,g,m])},lineStart:function(){h.push(c=[])},lineEnd:noop_noop,rejoin:function(){h.length>1&&h.push(h.pop().concat(h.shift()))},result:function(){var g=h;return h=[],c=null,g}}}var hn=1e-6,dn=Math.PI,pn=dn/2,fn=dn/4,gn=2*dn,_n=180/dn,mn=dn/180,vn=Math.abs,yn=Math.atan,An=Math.atan2,bn=Math.cos,xn=(Math.ceil,Math.exp,Math.floor,Math.hypot,Math.log,Math.pow,Math.sin),wn=Math.sign||function(c){return c>0?1:c<0?-1:0},Cn=Math.sqrt;Math.tan;function math_asin(c){return c>1?pn:c<-1?-pn:Math.asin(c)}function src_pointEqual(c,h){return vn(c[0]-h[0])<hn&&vn(c[1]-h[1])<hn}function rejoin_Intersection(c,h,g,m){this.x=c,this.z=h,this.o=g,this.e=m,this.v=!1,this.n=this.p=null}function clip_rejoin(c,h,g,m,b){var w,S,M=[],k=[];if(c.forEach(function(c){if(!((h=c.length-1)<=0)){var h,g,m=c[0],S=c[h];if(src_pointEqual(m,S)){if(!m[2]&&!S[2]){for(b.lineStart(),w=0;w<h;++w)b.point((m=c[w])[0],m[1]);return void b.lineEnd()}S[0]+=2e-6}M.push(g=new rejoin_Intersection(m,c,null,!0)),k.push(g.o=new rejoin_Intersection(m,null,g,!1)),M.push(g=new rejoin_Intersection(S,c,null,!1)),k.push(g.o=new rejoin_Intersection(S,null,g,!0))}}),M.length){for(k.sort(h),clip_rejoin_link(M),clip_rejoin_link(k),w=0,S=k.length;w<S;++w)k[w].e=g=!g;for(var T,E,I=M[0];;){for(var P=I,L=!0;P.v;)if((P=P.n)===I)return;T=P.z,b.lineStart();do{if(P.v=P.o.v=!0,P.e){if(L)for(w=0,S=T.length;w<S;++w)b.point((E=T[w])[0],E[1]);else m(P.x,P.n.x,1,b);P=P.n}else{if(L)for(T=P.p.z,w=T.length-1;w>=0;--w)b.point((E=T[w])[0],E[1]);else m(P.x,P.p.x,-1,b);P=P.p}T=(P=P.o).z,L=!L}while(!P.v);b.lineEnd()}}}function clip_rejoin_link(c){if(h=c.length){for(var h,g,m=0,b=c[0];++m<h;)b.n=g=c[m],g.p=b,b=g;b.n=g=c[0],g.p=b}}class fsum_Adder{constructor(){this._partials=new Float64Array(32),this._n=0}add(c){const h=this._partials;let g=0;for(let m=0;m<this._n&&m<32;m++){const b=h[m],w=c+b,S=Math.abs(c)<Math.abs(b)?c-(w-b):b-(w-c);S&&(h[g++]=S),c=w}return h[g]=c,this._n=g+1,this}valueOf(){const c=this._partials;let h,g,m,b=this._n,w=0;if(b>0){for(w=c[--b];b>0&&(h=w,g=c[--b],w=h+g,m=g-(w-h),!m););b>0&&(m<0&&c[b-1]<0||m>0&&c[b-1]>0)&&(g=2*m,h=w+g,g==h-w&&(w=h))}return w}}function spherical(c){return[An(c[1],c[0]),math_asin(c[2])]}function cartesian(c){var h=c[0],g=c[1],m=bn(g);return[m*bn(h),m*xn(h),xn(g)]}function cartesianDot(c,h){return c[0]*h[0]+c[1]*h[1]+c[2]*h[2]}function cartesianCross(c,h){return[c[1]*h[2]-c[2]*h[1],c[2]*h[0]-c[0]*h[2],c[0]*h[1]-c[1]*h[0]]}function cartesianAddInPlace(c,h){c[0]+=h[0],c[1]+=h[1],c[2]+=h[2]}function cartesianScale(c,h){return[c[0]*h,c[1]*h,c[2]*h]}function cartesianNormalizeInPlace(c){var h=Cn(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);c[0]/=h,c[1]/=h,c[2]/=h}function longitude(c){return vn(c[0])<=dn?c[0]:wn(c[0])*((vn(c[0])+dn)%gn-dn)}function src_merge_merge(c){return Array.from(function*merge_flatten(c){for(const h of c)yield*h}(c))}function clip(c,h,g,m){return function(b){var w,S,M,k=h(b),T=clip_buffer(),E=h(T),I=!1,P={point,lineStart,lineEnd,polygonStart:function(){P.point=pointRing,P.lineStart=ringStart,P.lineEnd=ringEnd,S=[],w=[]},polygonEnd:function(){P.point=point,P.lineStart=lineStart,P.lineEnd=lineEnd,S=src_merge_merge(S);var c=function polygonContains(c,h){var g=longitude(h),m=h[1],b=xn(m),w=[xn(g),-bn(g),0],S=0,M=0,k=new fsum_Adder;1===b?m=pn+hn:-1===b&&(m=-pn-hn);for(var T=0,E=c.length;T<E;++T)if(P=(I=c[T]).length)for(var I,P,L=I[P-1],B=longitude(L),z=L[1]/2+fn,j=xn(z),D=bn(z),N=0;N<P;++N,B=G,j=W,D=H,L=R){var R=I[N],G=longitude(R),q=R[1]/2+fn,W=xn(q),H=bn(q),U=G-B,Y=U>=0?1:-1,V=Y*U,$=V>dn,X=j*W;if(k.add(An(X*Y*xn(V),D*H+X*bn(V))),S+=$?U+Y*gn:U,$^B>=g^G>=g){var K=cartesianCross(cartesian(L),cartesian(R));cartesianNormalizeInPlace(K);var Z=cartesianCross(w,K);cartesianNormalizeInPlace(Z);var J=($^U>=0?-1:1)*math_asin(Z[2]);(m>J||m===J&&(K[0]||K[1]))&&(M+=$^U>=0?1:-1)}}return(S<-1e-6||S<hn&&k<-1e-12)^1&M}(w,m);S.length?(I||(b.polygonStart(),I=!0),clip_rejoin(S,compareIntersection,c,g,b)):c&&(I||(b.polygonStart(),I=!0),b.lineStart(),g(null,null,1,b),b.lineEnd()),I&&(b.polygonEnd(),I=!1),S=w=null},sphere:function(){b.polygonStart(),b.lineStart(),g(null,null,1,b),b.lineEnd(),b.polygonEnd()}};function point(h,g){c(h,g)&&b.point(h,g)}function pointLine(c,h){k.point(c,h)}function lineStart(){P.point=pointLine,k.lineStart()}function lineEnd(){P.point=point,k.lineEnd()}function pointRing(c,h){M.push([c,h]),E.point(c,h)}function ringStart(){E.lineStart(),M=[]}function ringEnd(){pointRing(M[0][0],M[0][1]),E.lineEnd();var c,h,g,m,k=E.clean(),P=T.result(),L=P.length;if(M.pop(),w.push(M),M=null,L)if(1&k){if((h=(g=P[0]).length-1)>0){for(I||(b.polygonStart(),I=!0),b.lineStart(),c=0;c<h;++c)b.point((m=g[c])[0],m[1]);b.lineEnd()}}else L>1&&2&k&&P.push(P.pop().concat(P.shift())),S.push(P.filter(validSegment))}return P}}function validSegment(c){return c.length>1}function compareIntersection(c,h){return((c=c.x)[0]<0?c[1]-pn-hn:pn-c[1])-((h=h.x)[0]<0?h[1]-pn-hn:pn-h[1])}const Sn=clip(function(){return!0},function clipAntimeridianLine(c){var h,g=NaN,m=NaN,b=NaN;return{lineStart:function(){c.lineStart(),h=1},point:function(w,S){var M=w>0?dn:-dn,k=vn(w-g);vn(k-dn)<hn?(c.point(g,m=(m+S)/2>0?pn:-pn),c.point(b,m),c.lineEnd(),c.lineStart(),c.point(M,m),c.point(w,m),h=0):b!==M&&k>=dn&&(vn(g-b)<hn&&(g-=b*hn),vn(w-M)<hn&&(w-=M*hn),m=function clipAntimeridianIntersect(c,h,g,m){var b,w,S=xn(c-g);return vn(S)>hn?yn((xn(h)*(w=bn(m))*xn(g)-xn(m)*(b=bn(h))*xn(c))/(b*w*S)):(h+m)/2}(g,m,w,S),c.point(b,m),c.lineEnd(),c.lineStart(),c.point(M,m),h=0),c.point(g=w,m=S),b=M},lineEnd:function(){c.lineEnd(),g=m=NaN},clean:function(){return 2-h}}},function clipAntimeridianInterpolate(c,h,g,m){var b;if(null==c)b=g*pn,m.point(-dn,b),m.point(0,b),m.point(dn,b),m.point(dn,0),m.point(dn,-b),m.point(0,-b),m.point(-dn,-b),m.point(-dn,0),m.point(-dn,b);else if(vn(c[0]-h[0])>hn){var w=c[0]<h[0]?dn:-dn;b=g*w/2,m.point(-w,b),m.point(0,b),m.point(w,b)}else m.point(h[0],h[1])},[-dn,-pn]);function circleStream(c,h,g,m,b,w){if(g){var S=bn(h),M=xn(h),k=m*g;null==b?(b=h+m*gn,w=h-k/2):(b=circleRadius(S,b),w=circleRadius(S,w),(m>0?b<w:b>w)&&(b+=m*gn));for(var T,E=b;m>0?E>w:E<w;E-=k)T=spherical([S,-M*bn(E),-M*xn(E)]),c.point(T[0],T[1])}}function circleRadius(c,h){(h=cartesian(h))[0]-=c,cartesianNormalizeInPlace(h);var g=function math_acos(c){return c>1?0:c<-1?dn:Math.acos(c)}(-h[1]);return((-h[2]<0?-g:g)+gn-hn)%gn}var Mn=1e9,kn=-1e9;function rectangle_clipRectangle(c,h,g,m){function visible(b,w){return c<=b&&b<=g&&h<=w&&w<=m}function interpolate(b,w,S,M){var k=0,T=0;if(null==b||(k=corner(b,S))!==(T=corner(w,S))||comparePoint(b,w)<0^S>0)do{M.point(0===k||3===k?c:g,k>1?m:h)}while((k=(k+S+4)%4)!==T);else M.point(w[0],w[1])}function corner(m,b){return vn(m[0]-c)<hn?b>0?0:3:vn(m[0]-g)<hn?b>0?2:1:vn(m[1]-h)<hn?b>0?1:0:b>0?3:2}function compareIntersection(c,h){return comparePoint(c.x,h.x)}function comparePoint(c,h){var g=corner(c,1),m=corner(h,1);return g!==m?g-m:0===g?h[1]-c[1]:1===g?c[0]-h[0]:2===g?c[1]-h[1]:h[0]-c[0]}return function(b){var w,S,M,k,T,E,I,P,L,B,z,j=b,D=clip_buffer(),N={point,lineStart:function lineStart(){N.point=linePoint,S&&S.push(M=[]);B=!0,L=!1,I=P=NaN},lineEnd:function lineEnd(){w&&(linePoint(k,T),E&&L&&D.rejoin(),w.push(D.result()));N.point=point,L&&j.lineEnd()},polygonStart:function polygonStart(){j=D,w=[],S=[],z=!0},polygonEnd:function polygonEnd(){var h=function polygonInside(){for(var h=0,g=0,b=S.length;g<b;++g)for(var w,M,k=S[g],T=1,E=k.length,I=k[0],P=I[0],L=I[1];T<E;++T)w=P,M=L,P=(I=k[T])[0],L=I[1],M<=m?L>m&&(P-w)*(m-M)>(L-M)*(c-w)&&++h:L<=m&&(P-w)*(m-M)<(L-M)*(c-w)&&--h;return h}(),g=z&&h,k=(w=src_merge_merge(w)).length;(g||k)&&(b.polygonStart(),g&&(b.lineStart(),interpolate(null,null,1,b),b.lineEnd()),k&&clip_rejoin(w,compareIntersection,h,interpolate,b),b.polygonEnd());j=b,w=S=M=null}};function point(c,h){visible(c,h)&&j.point(c,h)}function linePoint(b,w){var D=visible(b,w);if(S&&M.push([b,w]),B)k=b,T=w,E=D,B=!1,D&&(j.lineStart(),j.point(b,w));else if(D&&L)j.point(b,w);else{var N=[I=Math.max(kn,Math.min(Mn,I)),P=Math.max(kn,Math.min(Mn,P))],R=[b=Math.max(kn,Math.min(Mn,b)),w=Math.max(kn,Math.min(Mn,w))];!function src_clip_line(c,h,g,m,b,w){var S,M=c[0],k=c[1],T=0,E=1,I=h[0]-M,P=h[1]-k;if(S=g-M,I||!(S>0)){if(S/=I,I<0){if(S<T)return;S<E&&(E=S)}else if(I>0){if(S>E)return;S>T&&(T=S)}if(S=b-M,I||!(S<0)){if(S/=I,I<0){if(S>E)return;S>T&&(T=S)}else if(I>0){if(S<T)return;S<E&&(E=S)}if(S=m-k,P||!(S>0)){if(S/=P,P<0){if(S<T)return;S<E&&(E=S)}else if(P>0){if(S>E)return;S>T&&(T=S)}if(S=w-k,P||!(S<0)){if(S/=P,P<0){if(S>E)return;S>T&&(T=S)}else if(P>0){if(S<T)return;S<E&&(E=S)}return T>0&&(c[0]=M+T*I,c[1]=k+T*P),E<1&&(h[0]=M+E*I,h[1]=k+E*P),!0}}}}}(N,R,c,h,g,m)?D&&(j.lineStart(),j.point(b,w),z=!1):(L||(j.lineStart(),j.point(N[0],N[1])),j.point(R[0],R[1]),D||j.lineEnd(),z=!1)}I=b,P=w,L=D}return N}}function compose(c,h){function compose(g,m){return g=c(g,m),h(g[0],g[1])}return c.invert&&h.invert&&(compose.invert=function(g,m){return(g=h.invert(g,m))&&c.invert(g[0],g[1])}),compose}const node_modules_d3_geo_src_identity=c=>c;function rotationIdentity(c,h){return[vn(c)>dn?c+Math.round(-c/gn)*gn:c,h]}function rotation_rotateRadians(c,h,g){return(c%=gn)?h||g?compose(rotationLambda(c),rotationPhiGamma(h,g)):rotationLambda(c):h||g?rotationPhiGamma(h,g):rotationIdentity}function forwardRotationLambda(c){return function(h,g){return[(h+=c)>dn?h-gn:h<-dn?h+gn:h,g]}}function rotationLambda(c){var h=forwardRotationLambda(c);return h.invert=forwardRotationLambda(-c),h}function rotationPhiGamma(c,h){var g=bn(c),m=xn(c),b=bn(h),w=xn(h);function rotation(c,h){var S=bn(h),M=bn(c)*S,k=xn(c)*S,T=xn(h),E=T*g+M*m;return[An(k*b-E*w,M*g-T*m),math_asin(E*b+k*w)]}return rotation.invert=function(c,h){var S=bn(h),M=bn(c)*S,k=xn(c)*S,T=xn(h),E=T*b-k*w;return[An(k*b+T*w,M*g+E*m),math_asin(E*g-M*m)]},rotation}function src_transform_transformer(c){return function(h){var g=new transform_TransformStream;for(var m in c)g[m]=c[m];return g.stream=h,g}}function transform_TransformStream(){}function stream_streamGeometry(c,h){c&&En.hasOwnProperty(c.type)&&En[c.type](c,h)}rotationIdentity.invert=rotationIdentity,transform_TransformStream.prototype={constructor:transform_TransformStream,point:function(c,h){this.stream.point(c,h)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Tn={Feature:function(c,h){stream_streamGeometry(c.geometry,h)},FeatureCollection:function(c,h){for(var g=c.features,m=-1,b=g.length;++m<b;)stream_streamGeometry(g[m].geometry,h)}},En={Sphere:function(c,h){h.sphere()},Point:function(c,h){c=c.coordinates,h.point(c[0],c[1],c[2])},MultiPoint:function(c,h){for(var g=c.coordinates,m=-1,b=g.length;++m<b;)c=g[m],h.point(c[0],c[1],c[2])},LineString:function(c,h){stream_streamLine(c.coordinates,h,0)},MultiLineString:function(c,h){for(var g=c.coordinates,m=-1,b=g.length;++m<b;)stream_streamLine(g[m],h,0)},Polygon:function(c,h){stream_streamPolygon(c.coordinates,h)},MultiPolygon:function(c,h){for(var g=c.coordinates,m=-1,b=g.length;++m<b;)stream_streamPolygon(g[m],h)},GeometryCollection:function(c,h){for(var g=c.geometries,m=-1,b=g.length;++m<b;)stream_streamGeometry(g[m],h)}};function stream_streamLine(c,h,g){var m,b=-1,w=c.length-g;for(h.lineStart();++b<w;)m=c[b],h.point(m[0],m[1],m[2]);h.lineEnd()}function stream_streamPolygon(c,h){var g=-1,m=c.length;for(h.polygonStart();++g<m;)stream_streamLine(c[g],h,1);h.polygonEnd()}var In=1/0,Pn=In,Ln=-In,Fn=Ln,Bn={point:function bounds_boundsPoint(c,h){c<In&&(In=c);c>Ln&&(Ln=c);h<Pn&&(Pn=h);h>Fn&&(Fn=h)},lineStart:noop_noop,lineEnd:noop_noop,polygonStart:noop_noop,polygonEnd:noop_noop,result:function(){var c=[[In,Pn],[Ln,Fn]];return Ln=Fn=-(Pn=In=1/0),c}};const On=Bn;function fit_fit(c,h,g){var m=c.clipExtent&&c.clipExtent();return c.scale(150).translate([0,0]),null!=m&&c.clipExtent(null),function src_stream(c,h){c&&Tn.hasOwnProperty(c.type)?Tn[c.type](c,h):stream_streamGeometry(c,h)}(g,c.stream(On)),h(On.result()),null!=m&&c.clipExtent(m),c}function fit_fitExtent(c,h,g){return fit_fit(c,function(g){var m=h[1][0]-h[0][0],b=h[1][1]-h[0][1],w=Math.min(m/(g[1][0]-g[0][0]),b/(g[1][1]-g[0][1])),S=+h[0][0]+(m-w*(g[1][0]+g[0][0]))/2,M=+h[0][1]+(b-w*(g[1][1]+g[0][1]))/2;c.scale(150*w).translate([S,M])},g)}var zn=bn(30*mn);function resample(c,h){return+h?function resample_resample(c,h){function resampleLineTo(g,m,b,w,S,M,k,T,E,I,P,L,B,z){var j=k-g,D=T-m,N=j*j+D*D;if(N>4*h&&B--){var R=w+I,G=S+P,q=M+L,W=Cn(R*R+G*G+q*q),H=math_asin(q/=W),U=vn(vn(q)-1)<hn||vn(b-E)<hn?(b+E)/2:An(G,R),Y=c(U,H),V=Y[0],$=Y[1],X=V-g,K=$-m,Z=D*X-j*K;(Z*Z/N>h||vn((j*X+D*K)/N-.5)>.3||w*I+S*P+M*L<zn)&&(resampleLineTo(g,m,b,w,S,M,V,$,U,R/=W,G/=W,q,B,z),z.point(V,$),resampleLineTo(V,$,U,R,G,q,k,T,E,I,P,L,B,z))}}return function(h){var g,m,b,w,S,M,k,T,E,I,P,L,B={point,lineStart,lineEnd,polygonStart:function(){h.polygonStart(),B.lineStart=ringStart},polygonEnd:function(){h.polygonEnd(),B.lineStart=lineStart}};function point(g,m){g=c(g,m),h.point(g[0],g[1])}function lineStart(){T=NaN,B.point=linePoint,h.lineStart()}function linePoint(g,m){var b=cartesian([g,m]),w=c(g,m);resampleLineTo(T,E,k,I,P,L,T=w[0],E=w[1],k=g,I=b[0],P=b[1],L=b[2],16,h),h.point(T,E)}function lineEnd(){B.point=point,h.lineEnd()}function ringStart(){lineStart(),B.point=ringPoint,B.lineEnd=ringEnd}function ringPoint(c,h){linePoint(g=c,h),m=T,b=E,w=I,S=P,M=L,B.point=linePoint}function ringEnd(){resampleLineTo(T,E,k,I,P,L,m,b,g,w,S,M,16,h),B.lineEnd=lineEnd,lineEnd()}return B}}(c,h):function resampleNone(c){return src_transform_transformer({point:function(h,g){h=c(h,g),this.stream.point(h[0],h[1])}})}(c)}var jn=src_transform_transformer({point:function(c,h){this.stream.point(c*mn,h*mn)}});function scaleTranslateRotate(c,h,g,m,b,w){if(!w)return function scaleTranslate(c,h,g,m,b){function transform(w,S){return[h+c*(w*=m),g-c*(S*=b)]}return transform.invert=function(w,S){return[(w-h)/c*m,(g-S)/c*b]},transform}(c,h,g,m,b);var S=bn(w),M=xn(w),k=S*c,T=M*c,E=S/c,I=M/c,P=(M*g-S*h)/c,L=(M*h+S*g)/c;function transform(c,w){return[k*(c*=m)-T*(w*=b)+h,g-T*c-k*w]}return transform.invert=function(c,h){return[m*(E*c-I*h+P),b*(L-I*c-E*h)]},transform}function projection(c){return function projectionMutator(c){var h,g,m,b,w,S,M,k,T,E,I=150,P=480,L=250,B=0,z=0,j=0,D=0,N=0,R=0,G=1,q=1,W=null,H=Sn,U=null,Y=node_modules_d3_geo_src_identity,V=.5;function projection(c){return k(c[0]*mn,c[1]*mn)}function invert(c){return(c=k.invert(c[0],c[1]))&&[c[0]*_n,c[1]*_n]}function recenter(){var c=scaleTranslateRotate(I,0,0,G,q,R).apply(null,h(B,z)),m=scaleTranslateRotate(I,P-c[0],L-c[1],G,q,R);return g=rotation_rotateRadians(j,D,N),M=compose(h,m),k=compose(g,M),S=resample(M,V),reset()}function reset(){return T=E=null,projection}return projection.stream=function(c){return T&&E===c?T:T=jn(function transformRotate(c){return src_transform_transformer({point:function(h,g){var m=c(h,g);return this.stream.point(m[0],m[1])}})}(g)(H(S(Y(E=c)))))},projection.preclip=function(c){return arguments.length?(H=c,W=void 0,reset()):H},projection.postclip=function(c){return arguments.length?(Y=c,U=m=b=w=null,reset()):Y},projection.clipAngle=function(c){return arguments.length?(H=+c?function clip_circle(c){var h=bn(c),g=6*mn,m=h>0,b=vn(h)>hn;function visible(c,g){return bn(c)*bn(g)>h}function intersect(c,g,m){var b=[1,0,0],w=cartesianCross(cartesian(c),cartesian(g)),S=cartesianDot(w,w),M=w[0],k=S-M*M;if(!k)return!m&&c;var T=h*S/k,E=-h*M/k,I=cartesianCross(b,w),P=cartesianScale(b,T);cartesianAddInPlace(P,cartesianScale(w,E));var L=I,B=cartesianDot(P,L),z=cartesianDot(L,L),j=B*B-z*(cartesianDot(P,P)-1);if(!(j<0)){var D=Cn(j),N=cartesianScale(L,(-B-D)/z);if(cartesianAddInPlace(N,P),N=spherical(N),!m)return N;var R,G=c[0],q=g[0],W=c[1],H=g[1];q<G&&(R=G,G=q,q=R);var U=q-G,Y=vn(U-dn)<hn;if(!Y&&H<W&&(R=W,W=H,H=R),Y||U<hn?Y?W+H>0^N[1]<(vn(N[0]-G)<hn?W:H):W<=N[1]&&N[1]<=H:U>dn^(G<=N[0]&&N[0]<=q)){var V=cartesianScale(L,(-B+D)/z);return cartesianAddInPlace(V,P),[N,spherical(V)]}}}function code(h,g){var b=m?c:dn-c,w=0;return h<-b?w|=1:h>b&&(w|=2),g<-b?w|=4:g>b&&(w|=8),w}return clip(visible,function clipLine(c){var h,g,w,S,M;return{lineStart:function(){S=w=!1,M=1},point:function(k,T){var E,I=[k,T],P=visible(k,T),L=m?P?0:code(k,T):P?code(k+(k<0?dn:-dn),T):0;if(!h&&(S=w=P)&&c.lineStart(),P!==w&&(!(E=intersect(h,I))||src_pointEqual(h,E)||src_pointEqual(I,E))&&(I[2]=1),P!==w)M=0,P?(c.lineStart(),E=intersect(I,h),c.point(E[0],E[1])):(E=intersect(h,I),c.point(E[0],E[1],2),c.lineEnd()),h=E;else if(b&&h&&m^P){var B;L&g||!(B=intersect(I,h,!0))||(M=0,m?(c.lineStart(),c.point(B[0][0],B[0][1]),c.point(B[1][0],B[1][1]),c.lineEnd()):(c.point(B[1][0],B[1][1]),c.lineEnd(),c.lineStart(),c.point(B[0][0],B[0][1],3)))}!P||h&&src_pointEqual(h,I)||c.point(I[0],I[1]),h=I,w=P,g=L},lineEnd:function(){w&&c.lineEnd(),h=null},clean:function(){return M|(S&&w)<<1}}},function interpolate(h,m,b,w){circleStream(w,c,g,b,h,m)},m?[0,-c]:[-dn,c-dn])}(W=c*mn):(W=null,Sn),reset()):W*_n},projection.clipExtent=function(c){return arguments.length?(Y=null==c?(U=m=b=w=null,node_modules_d3_geo_src_identity):rectangle_clipRectangle(U=+c[0][0],m=+c[0][1],b=+c[1][0],w=+c[1][1]),reset()):null==U?null:[[U,m],[b,w]]},projection.scale=function(c){return arguments.length?(I=+c,recenter()):I},projection.translate=function(c){return arguments.length?(P=+c[0],L=+c[1],recenter()):[P,L]},projection.center=function(c){return arguments.length?(B=c[0]%360*mn,z=c[1]%360*mn,recenter()):[B*_n,z*_n]},projection.rotate=function(c){return arguments.length?(j=c[0]%360*mn,D=c[1]%360*mn,N=c.length>2?c[2]%360*mn:0,recenter()):[j*_n,D*_n,N*_n]},projection.angle=function(c){return arguments.length?(R=c%360*mn,recenter()):R*_n},projection.reflectX=function(c){return arguments.length?(G=c?-1:1,recenter()):G<0},projection.reflectY=function(c){return arguments.length?(q=c?-1:1,recenter()):q<0},projection.precision=function(c){return arguments.length?(S=resample(M,V=c*c),reset()):Cn(V)},projection.fitExtent=function(c,h){return fit_fitExtent(projection,c,h)},projection.fitSize=function(c,h){return function fit_fitSize(c,h,g){return fit_fitExtent(c,[[0,0],h],g)}(projection,c,h)},projection.fitWidth=function(c,h){return function fit_fitWidth(c,h,g){return fit_fit(c,function(g){var m=+h,b=m/(g[1][0]-g[0][0]),w=(m-b*(g[1][0]+g[0][0]))/2,S=-b*g[0][1];c.scale(150*b).translate([w,S])},g)}(projection,c,h)},projection.fitHeight=function(c,h){return function fit_fitHeight(c,h,g){return fit_fit(c,function(g){var m=+h,b=m/(g[1][1]-g[0][1]),w=-b*g[0][0],S=(m-b*(g[1][1]+g[0][1]))/2;c.scale(150*b).translate([w,S])},g)}(projection,c,h)},function(){return h=c.apply(this,arguments),projection.invert=h.invert&&invert,recenter()}}(function(){return c})()}var Dn=Math.abs,Nn=(Math.atan,Math.atan2,Math.ceil,Math.cos,Math.exp,Math.floor),Rn=(Math.log,Math.max),Gn=Math.min,qn=(Math.pow,Math.round,Math.sign,Math.sin,Math.tan,Math.PI),Wn=qn/2,Hn=(Math.SQRT1_2,src_math_sqrt(2),src_math_sqrt(qn),180/qn),Un=qn/180;function src_math_sqrt(c){return c>0?Math.sqrt(c):0}var Yn=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];function robinsonRaw(c,h){var g,m=Gn(18,36*Dn(h)/qn),b=Nn(m),w=m-b,S=(g=Yn[b])[0],M=g[1],k=(g=Yn[++b])[0],T=g[1],E=(g=Yn[Gn(19,++b)])[0],I=g[1];return[c*(k+w*(E-S)/2+w*w*(E-2*k+S)/2),(h>0?Wn:-Wn)*(T+w*(I-M)/2+w*w*(I-2*T+M)/2)]}Yn.forEach(function(c){c[1]*=1.0144}),robinsonRaw.invert=function(c,h){var g=h/Wn,m=90*g,b=Gn(18,Dn(m/5)),w=Rn(0,Nn(b));do{var S=Yn[w][1],M=Yn[w+1][1],k=Yn[Gn(19,w+2)][1],T=k-S,E=k-2*M+S,I=2*(Dn(g)-M)/T,P=E/T,L=I*(1-P*I*(1-2*P*I));if(L>=0||1===w){m=(h>=0?5:-5)*(L+b);var B,z=50;do{L=(b=Gn(18,Dn(m)/5))-(w=Nn(b)),S=Yn[w][1],M=Yn[w+1][1],k=Yn[Gn(19,w+2)][1],m-=(B=(h>=0?Wn:-Wn)*(M+L*(k-S)/2+L*L*(k-2*M+S)/2)-h)*Hn}while(Dn(B)>1e-12&&--z>0);break}}while(--w>=0);var j=Yn[w][0],D=Yn[w+1][0],N=Yn[Gn(19,w+2)][0];return[c/(D+L*(N-j)/2+L*L*(N-2*D+j)/2),m*Un]};var Vn="http://www.w3.org/1999/xhtml";const $n={svg:"http://www.w3.org/2000/svg",xhtml:Vn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function src_namespace(c){var h=c+="",g=h.indexOf(":");return g>=0&&"xmlns"!==(h=c.slice(0,g))&&(c=c.slice(g+1)),$n.hasOwnProperty(h)?{space:$n[h],local:c}:c}function creator_creatorInherit(c){return function(){var h=this.ownerDocument,g=this.namespaceURI;return g===Vn&&h.documentElement.namespaceURI===Vn?h.createElement(c):h.createElementNS(g,c)}}function creator_creatorFixed(c){return function(){return this.ownerDocument.createElementNS(c.space,c.local)}}function d3_selection_src_creator(c){var h=src_namespace(c);return(h.local?creator_creatorFixed:creator_creatorInherit)(h)}function selector_none(){}function src_selector(c){return null==c?selector_none:function(){return this.querySelector(c)}}function selectorAll_empty(){return[]}function selection_sparse(c){return new Array(c.length)}function enter_EnterNode(c,h){this.ownerDocument=c.ownerDocument,this.namespaceURI=c.namespaceURI,this._next=null,this._parent=c,this.__data__=h}enter_EnterNode.prototype={constructor:enter_EnterNode,appendChild:function(c){return this._parent.insertBefore(c,this._next)},insertBefore:function(c,h){return this._parent.insertBefore(c,h)},querySelector:function(c){return this._parent.querySelector(c)},querySelectorAll:function(c){return this._parent.querySelectorAll(c)}};function data_bindIndex(c,h,g,m,b,w){for(var S,M=0,k=h.length,T=w.length;M<T;++M)(S=h[M])?(S.__data__=w[M],m[M]=S):g[M]=new enter_EnterNode(c,w[M]);for(;M<k;++M)(S=h[M])&&(b[M]=S)}function data_bindKey(c,h,g,m,b,w,S){var M,k,T,E={},I=h.length,P=w.length,L=new Array(I);for(M=0;M<I;++M)(k=h[M])&&(L[M]=T="$"+S.call(k,k.__data__,M,h),T in E?b[M]=k:E[T]=k);for(M=0;M<P;++M)(k=E[T="$"+S.call(c,w[M],M,w)])?(m[M]=k,k.__data__=w[M],E[T]=null):g[M]=new enter_EnterNode(c,w[M]);for(M=0;M<I;++M)(k=h[M])&&E[L[M]]===k&&(b[M]=k)}function sort_ascending(c,h){return c<h?-1:c>h?1:c>=h?0:NaN}function attr_attrRemove(c){return function(){this.removeAttribute(c)}}function attr_attrRemoveNS(c){return function(){this.removeAttributeNS(c.space,c.local)}}function attr_attrConstant(c,h){return function(){this.setAttribute(c,h)}}function attr_attrConstantNS(c,h){return function(){this.setAttributeNS(c.space,c.local,h)}}function attr_attrFunction(c,h){return function(){var g=h.apply(this,arguments);null==g?this.removeAttribute(c):this.setAttribute(c,g)}}function attr_attrFunctionNS(c,h){return function(){var g=h.apply(this,arguments);null==g?this.removeAttributeNS(c.space,c.local):this.setAttributeNS(c.space,c.local,g)}}function d3_selection_src_window(c){return c.ownerDocument&&c.ownerDocument.defaultView||c.document&&c||c.defaultView}function style_styleRemove(c){return function(){this.style.removeProperty(c)}}function style_styleConstant(c,h,g){return function(){this.style.setProperty(c,h,g)}}function style_styleFunction(c,h,g){return function(){var m=h.apply(this,arguments);null==m?this.style.removeProperty(c):this.style.setProperty(c,m,g)}}function property_propertyRemove(c){return function(){delete this[c]}}function property_propertyConstant(c,h){return function(){this[c]=h}}function property_propertyFunction(c,h){return function(){var g=h.apply(this,arguments);null==g?delete this[c]:this[c]=g}}function classed_classArray(c){return c.trim().split(/^|\s+/)}function classed_classList(c){return c.classList||new classed_ClassList(c)}function classed_ClassList(c){this._node=c,this._names=classed_classArray(c.getAttribute("class")||"")}function classed_classedAdd(c,h){for(var g=classed_classList(c),m=-1,b=h.length;++m<b;)g.add(h[m])}function classed_classedRemove(c,h){for(var g=classed_classList(c),m=-1,b=h.length;++m<b;)g.remove(h[m])}function classed_classedTrue(c){return function(){classed_classedAdd(this,c)}}function classed_classedFalse(c){return function(){classed_classedRemove(this,c)}}function classed_classedFunction(c,h){return function(){(h.apply(this,arguments)?classed_classedAdd:classed_classedRemove)(this,c)}}function text_textRemove(){this.textContent=""}function text_textConstant(c){return function(){this.textContent=c}}function text_textFunction(c){return function(){var h=c.apply(this,arguments);this.textContent=null==h?"":h}}function html_htmlRemove(){this.innerHTML=""}function html_htmlConstant(c){return function(){this.innerHTML=c}}function html_htmlFunction(c){return function(){var h=c.apply(this,arguments);this.innerHTML=null==h?"":h}}function raise_raise(){this.nextSibling&&this.parentNode.appendChild(this)}function lower_lower(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function insert_constantNull(){return null}function remove_remove(){var c=this.parentNode;c&&c.removeChild(this)}function clone_selection_cloneShallow(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function clone_selection_cloneDeep(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}classed_ClassList.prototype={add:function(c){this._names.indexOf(c)<0&&(this._names.push(c),this._node.setAttribute("class",this._names.join(" ")))},remove:function(c){var h=this._names.indexOf(c);h>=0&&(this._names.splice(h,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(c){return this._names.indexOf(c)>=0}};var Xn={},Kn=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(Xn={mouseenter:"mouseover",mouseleave:"mouseout"}));function filterContextListener(c,h,g){return c=on_contextListener(c,h,g),function(h){var g=h.relatedTarget;g&&(g===this||8&g.compareDocumentPosition(this))||c.call(this,h)}}function on_contextListener(c,h,g){return function(m){var b=Kn;Kn=m;try{c.call(this,this.__data__,h,g)}finally{Kn=b}}}function on_onRemove(c){return function(){var h=this.__on;if(h){for(var g,m=0,b=-1,w=h.length;m<w;++m)g=h[m],c.type&&g.type!==c.type||g.name!==c.name?h[++b]=g:this.removeEventListener(g.type,g.listener,g.capture);++b?h.length=b:delete this.__on}}}function on_onAdd(c,h,g){var m=Xn.hasOwnProperty(c.type)?filterContextListener:on_contextListener;return function(b,w,S){var M,k=this.__on,T=m(h,w,S);if(k)for(var E=0,I=k.length;E<I;++E)if((M=k[E]).type===c.type&&M.name===c.name)return this.removeEventListener(M.type,M.listener,M.capture),this.addEventListener(M.type,M.listener=T,M.capture=g),void(M.value=h);this.addEventListener(c.type,T,g),M={type:c.type,name:c.name,value:h,listener:T,capture:g},k?k.push(M):this.__on=[M]}}function customEvent(c,h,g,m){var b=Kn;c.sourceEvent=Kn,Kn=c;try{return h.apply(g,m)}finally{Kn=b}}function dispatch_dispatchEvent(c,h,g){var m=d3_selection_src_window(c),b=m.CustomEvent;"function"==typeof b?b=new b(h,g):(b=m.document.createEvent("Event"),g?(b.initEvent(h,g.bubbles,g.cancelable),b.detail=g.detail):b.initEvent(h,!1,!1)),c.dispatchEvent(b)}function dispatch_dispatchConstant(c,h){return function(){return dispatch_dispatchEvent(this,c,h)}}function dispatch_dispatchFunction(c,h){return function(){return dispatch_dispatchEvent(this,c,h.apply(this,arguments))}}var Zn=[null];function src_selection_Selection(c,h){this._groups=c,this._parents=h}function src_selection_selection(){return new src_selection_Selection([[document.documentElement]],Zn)}src_selection_Selection.prototype=src_selection_selection.prototype={constructor:src_selection_Selection,select:function src_selection_select(c){"function"!=typeof c&&(c=src_selector(c));for(var h=this._groups,g=h.length,m=new Array(g),b=0;b<g;++b)for(var w,S,M=h[b],k=M.length,T=m[b]=new Array(k),E=0;E<k;++E)(w=M[E])&&(S=c.call(w,w.__data__,E,M))&&("__data__"in w&&(S.__data__=w.__data__),T[E]=S);return new src_selection_Selection(m,this._parents)},selectAll:function selection_selectAll(c){"function"!=typeof c&&(c=function src_selectorAll(c){return null==c?selectorAll_empty:function(){return this.querySelectorAll(c)}}(c));for(var h=this._groups,g=h.length,m=[],b=[],w=0;w<g;++w)for(var S,M=h[w],k=M.length,T=0;T<k;++T)(S=M[T])&&(m.push(c.call(S,S.__data__,T,M)),b.push(S));return new src_selection_Selection(m,b)},filter:function src_selection_filter(c){"function"!=typeof c&&(c=function src_matcher(c){return function(){return this.matches(c)}}(c));for(var h=this._groups,g=h.length,m=new Array(g),b=0;b<g;++b)for(var w,S=h[b],M=S.length,k=m[b]=[],T=0;T<M;++T)(w=S[T])&&c.call(w,w.__data__,T,S)&&k.push(w);return new src_selection_Selection(m,this._parents)},data:function selection_data(c,h){if(!c)return L=new Array(this.size()),T=-1,this.each(function(c){L[++T]=c}),L;var g=h?data_bindKey:data_bindIndex,m=this._parents,b=this._groups;"function"!=typeof c&&(c=function d3_selection_src_constant(c){return function(){return c}}(c));for(var w=b.length,S=new Array(w),M=new Array(w),k=new Array(w),T=0;T<w;++T){var E=m[T],I=b[T],P=I.length,L=c.call(E,E&&E.__data__,T,m),B=L.length,z=M[T]=new Array(B),j=S[T]=new Array(B);g(E,I,z,j,k[T]=new Array(P),L,h);for(var D,N,R=0,G=0;R<B;++R)if(D=z[R]){for(R>=G&&(G=R+1);!(N=j[G])&&++G<B;);D._next=N||null}}return(S=new src_selection_Selection(S,m))._enter=M,S._exit=k,S},enter:function selection_enter(){return new src_selection_Selection(this._enter||this._groups.map(selection_sparse),this._parents)},exit:function selection_exit(){return new src_selection_Selection(this._exit||this._groups.map(selection_sparse),this._parents)},join:function selection_join(c,h,g){var m=this.enter(),b=this,w=this.exit();return m="function"==typeof c?c(m):m.append(c+""),null!=h&&(b=h(b)),null==g?w.remove():g(w),m&&b?m.merge(b).order():b},merge:function selection_merge(c){for(var h=this._groups,g=c._groups,m=h.length,b=g.length,w=Math.min(m,b),S=new Array(m),M=0;M<w;++M)for(var k,T=h[M],E=g[M],I=T.length,P=S[M]=new Array(I),L=0;L<I;++L)(k=T[L]||E[L])&&(P[L]=k);for(;M<m;++M)S[M]=h[M];return new src_selection_Selection(S,this._parents)},order:function selection_order(){for(var c=this._groups,h=-1,g=c.length;++h<g;)for(var m,b=c[h],w=b.length-1,S=b[w];--w>=0;)(m=b[w])&&(S&&4^m.compareDocumentPosition(S)&&S.parentNode.insertBefore(m,S),S=m);return this},sort:function selection_sort(c){function compareNode(h,g){return h&&g?c(h.__data__,g.__data__):!h-!g}c||(c=sort_ascending);for(var h=this._groups,g=h.length,m=new Array(g),b=0;b<g;++b){for(var w,S=h[b],M=S.length,k=m[b]=new Array(M),T=0;T<M;++T)(w=S[T])&&(k[T]=w);k.sort(compareNode)}return new src_selection_Selection(m,this._parents).order()},call:function selection_call(){var c=arguments[0];return arguments[0]=this,c.apply(null,arguments),this},nodes:function selection_nodes(){var c=new Array(this.size()),h=-1;return this.each(function(){c[++h]=this}),c},node:function selection_node(){for(var c=this._groups,h=0,g=c.length;h<g;++h)for(var m=c[h],b=0,w=m.length;b<w;++b){var S=m[b];if(S)return S}return null},size:function selection_size(){var c=0;return this.each(function(){++c}),c},empty:function src_selection_empty(){return!this.node()},each:function selection_each(c){for(var h=this._groups,g=0,m=h.length;g<m;++g)for(var b,w=h[g],S=0,M=w.length;S<M;++S)(b=w[S])&&c.call(b,b.__data__,S,w);return this},attr:function selection_attr(c,h){var g=src_namespace(c);if(arguments.length<2){var m=this.node();return g.local?m.getAttributeNS(g.space,g.local):m.getAttribute(g)}return this.each((null==h?g.local?attr_attrRemoveNS:attr_attrRemove:"function"==typeof h?g.local?attr_attrFunctionNS:attr_attrFunction:g.local?attr_attrConstantNS:attr_attrConstant)(g,h))},style:function selection_style(c,h,g){return arguments.length>1?this.each((null==h?style_styleRemove:"function"==typeof h?style_styleFunction:style_styleConstant)(c,h,null==g?"":g)):function style_styleValue(c,h){return c.style.getPropertyValue(h)||d3_selection_src_window(c).getComputedStyle(c,null).getPropertyValue(h)}(this.node(),c)},property:function selection_property(c,h){return arguments.length>1?this.each((null==h?property_propertyRemove:"function"==typeof h?property_propertyFunction:property_propertyConstant)(c,h)):this.node()[c]},classed:function selection_classed(c,h){var g=classed_classArray(c+"");if(arguments.length<2){for(var m=classed_classList(this.node()),b=-1,w=g.length;++b<w;)if(!m.contains(g[b]))return!1;return!0}return this.each(("function"==typeof h?classed_classedFunction:h?classed_classedTrue:classed_classedFalse)(g,h))},text:function src_selection_text(c){return arguments.length?this.each(null==c?text_textRemove:("function"==typeof c?text_textFunction:text_textConstant)(c)):this.node().textContent},html:function selection_html(c){return arguments.length?this.each(null==c?html_htmlRemove:("function"==typeof c?html_htmlFunction:html_htmlConstant)(c)):this.node().innerHTML},raise:function src_selection_raise(){return this.each(raise_raise)},lower:function src_selection_lower(){return this.each(lower_lower)},append:function selection_append(c){var h="function"==typeof c?c:d3_selection_src_creator(c);return this.select(function(){return this.appendChild(h.apply(this,arguments))})},insert:function selection_insert(c,h){var g="function"==typeof c?c:d3_selection_src_creator(c),m=null==h?insert_constantNull:"function"==typeof h?h:src_selector(h);return this.select(function(){return this.insertBefore(g.apply(this,arguments),m.apply(this,arguments)||null)})},remove:function src_selection_remove(){return this.each(remove_remove)},clone:function selection_clone(c){return this.select(c?clone_selection_cloneDeep:clone_selection_cloneShallow)},datum:function src_selection_datum(c){return arguments.length?this.property("__data__",c):this.node().__data__},on:function selection_on(c,h,g){var m,b,w=function on_parseTypenames(c){return c.trim().split(/^|\s+/).map(function(c){var h="",g=c.indexOf(".");return g>=0&&(h=c.slice(g+1),c=c.slice(0,g)),{type:c,name:h}})}(c+""),S=w.length;if(!(arguments.length<2)){for(M=h?on_onAdd:on_onRemove,null==g&&(g=!1),m=0;m<S;++m)this.each(M(w[m],h,g));return this}var M=this.node().__on;if(M)for(var k,T=0,E=M.length;T<E;++T)for(m=0,k=M[T];m<S;++m)if((b=w[m]).type===k.type&&b.name===k.name)return k.value},dispatch:function selection_dispatch(c,h){return this.each(("function"==typeof h?dispatch_dispatchFunction:dispatch_dispatchConstant)(c,h))}};function d3_selection_src_select(c){return"string"==typeof c?new src_selection_Selection([[document.querySelector(c)]],[document.documentElement]):new src_selection_Selection([[c]],Zn)}var Jn=0;function Local(){this._="@"+(++Jn).toString(36)}function src_sourceEvent(){for(var c,h=Kn;c=h.sourceEvent;)h=c;return h}function src_point(c,h){var g=c.ownerSVGElement||c;if(g.createSVGPoint){var m=g.createSVGPoint();return m.x=h.clientX,m.y=h.clientY,[(m=m.matrixTransform(c.getScreenCTM().inverse())).x,m.y]}var b=c.getBoundingClientRect();return[h.clientX-b.left-c.clientLeft,h.clientY-b.top-c.clientTop]}function mouse(c){var h=src_sourceEvent();return h.changedTouches&&(h=h.changedTouches[0]),src_point(c,h)}function touch(c,h,g){arguments.length<3&&(g=h,h=src_sourceEvent().changedTouches);for(var m,b=0,w=h?h.length:0;b<w;++b)if((m=h[b]).identifier===g)return src_point(c,m);return null}Local.prototype=function local(){return new Local}.prototype={constructor:Local,get:function(c){for(var h=this._;!(h in c);)if(!(c=c.parentNode))return;return c[h]},set:function(c,h){return c[this._]=h},remove:function(c){return this._ in c&&delete c[this._]},toString:function(){return this._}};var Qn={value:function(){}};function dispatch_dispatch(){for(var c,h=0,g=arguments.length,m={};h<g;++h){if(!(c=arguments[h]+"")||c in m)throw new Error("illegal type: "+c);m[c]=[]}return new Dispatch(m)}function Dispatch(c){this._=c}function get(c,h){for(var g,m=0,b=c.length;m<b;++m)if((g=c[m]).name===h)return g.value}function set(c,h,g){for(var m=0,b=c.length;m<b;++m)if(c[m].name===h){c[m]=Qn,c=c.slice(0,m).concat(c.slice(m+1));break}return null!=g&&c.push({name:h,value:g}),c}Dispatch.prototype=dispatch_dispatch.prototype={constructor:Dispatch,on:function(c,h){var g,m=this._,b=function dispatch_parseTypenames(c,h){return c.trim().split(/^|\s+/).map(function(c){var g="",m=c.indexOf(".");if(m>=0&&(g=c.slice(m+1),c=c.slice(0,m)),c&&!h.hasOwnProperty(c))throw new Error("unknown type: "+c);return{type:c,name:g}})}(c+"",m),w=-1,S=b.length;if(!(arguments.length<2)){if(null!=h&&"function"!=typeof h)throw new Error("invalid callback: "+h);for(;++w<S;)if(g=(c=b[w]).type)m[g]=set(m[g],c.name,h);else if(null==h)for(g in m)m[g]=set(m[g],c.name,null);return this}for(;++w<S;)if((g=(c=b[w]).type)&&(g=get(m[g],c.name)))return g},copy:function(){var c={},h=this._;for(var g in h)c[g]=h[g].slice();return new Dispatch(c)},call:function(c,h){if((g=arguments.length-2)>0)for(var g,m,b=new Array(g),w=0;w<g;++w)b[w]=arguments[w+2];if(!this._.hasOwnProperty(c))throw new Error("unknown type: "+c);for(w=0,g=(m=this._[c]).length;w<g;++w)m[w].value.apply(h,b)},apply:function(c,h,g){if(!this._.hasOwnProperty(c))throw new Error("unknown type: "+c);for(var m=this._[c],b=0,w=m.length;b<w;++b)m[b].value.apply(h,g)}};const tr=dispatch_dispatch;function nopropagation(){Kn.stopImmediatePropagation()}function noevent(){Kn.preventDefault(),Kn.stopImmediatePropagation()}function d3_drag_src_constant(c){return function(){return c}}function DragEvent(c,h,g,m,b,w,S,M,k,T){this.target=c,this.type=h,this.subject=g,this.identifier=m,this.active=b,this.x=w,this.y=S,this.dx=M,this.dy=k,this._=T}function defaultFilter(){return!Kn.button}function defaultContainer(){return this.parentNode}function defaultSubject(c){return null==c?{x:Kn.x,y:Kn.y}:c}function defaultTouchable(){return"ontouchstart"in this}function drag(){var c,h,g,m,b=defaultFilter,w=defaultContainer,S=defaultSubject,M=defaultTouchable,k={},T=tr("start","drag","end"),E=0,I=0;function drag(c){c.on("mousedown.drag",mousedowned).filter(M).on("touchstart.drag",touchstarted).on("touchmove.drag",touchmoved).on("touchend.drag touchcancel.drag",touchended).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function mousedowned(){if(!m&&b.apply(this,arguments)){var S=beforestart("mouse",w.apply(this,arguments),mouse,this,arguments);S&&(d3_selection_src_select(Kn.view).on("mousemove.drag",mousemoved,!0).on("mouseup.drag",mouseupped,!0),function nodrag(c){var h=c.document.documentElement,g=d3_selection_src_select(c).on("dragstart.drag",noevent,!0);"onselectstart"in h?g.on("selectstart.drag",noevent,!0):(h.__noselect=h.style.MozUserSelect,h.style.MozUserSelect="none")}(Kn.view),nopropagation(),g=!1,c=Kn.clientX,h=Kn.clientY,S("start"))}}function mousemoved(){if(noevent(),!g){var m=Kn.clientX-c,b=Kn.clientY-h;g=m*m+b*b>I}k.mouse("drag")}function mouseupped(){d3_selection_src_select(Kn.view).on("mousemove.drag mouseup.drag",null),function yesdrag(c,h){var g=c.document.documentElement,m=d3_selection_src_select(c).on("dragstart.drag",null);h&&(m.on("click.drag",noevent,!0),setTimeout(function(){m.on("click.drag",null)},0)),"onselectstart"in g?m.on("selectstart.drag",null):(g.style.MozUserSelect=g.__noselect,delete g.__noselect)}(Kn.view,g),noevent(),k.mouse("end")}function touchstarted(){if(b.apply(this,arguments)){var c,h,g=Kn.changedTouches,m=w.apply(this,arguments),S=g.length;for(c=0;c<S;++c)(h=beforestart(g[c].identifier,m,touch,this,arguments))&&(nopropagation(),h("start"))}}function touchmoved(){var c,h,g=Kn.changedTouches,m=g.length;for(c=0;c<m;++c)(h=k[g[c].identifier])&&(noevent(),h("drag"))}function touchended(){var c,h,g=Kn.changedTouches,b=g.length;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),c=0;c<b;++c)(h=k[g[c].identifier])&&(nopropagation(),h("end"))}function beforestart(c,h,g,m,b){var w,M,I,P=g(h,c),L=T.copy();if(customEvent(new DragEvent(drag,"beforestart",w,c,E,P[0],P[1],0,0,L),function(){return null!=(Kn.subject=w=S.apply(m,b))&&(M=w.x-P[0]||0,I=w.y-P[1]||0,!0)}))return function gesture(S){var T,B=P;switch(S){case"start":k[c]=gesture,T=E++;break;case"end":delete k[c],--E;case"drag":P=g(h,c),T=E}customEvent(new DragEvent(drag,S,w,c,T,P[0]+M,P[1]+I,P[0]-B[0],P[1]-B[1],L),L.apply,L,[S,m,b])}}return drag.filter=function(c){return arguments.length?(b="function"==typeof c?c:d3_drag_src_constant(!!c),drag):b},drag.container=function(c){return arguments.length?(w="function"==typeof c?c:d3_drag_src_constant(c),drag):w},drag.subject=function(c){return arguments.length?(S="function"==typeof c?c:d3_drag_src_constant(c),drag):S},drag.touchable=function(c){return arguments.length?(M="function"==typeof c?c:d3_drag_src_constant(!!c),drag):M},drag.on=function(){var c=T.on.apply(T,arguments);return c===T?drag:c},drag.clickDistance=function(c){return arguments.length?(I=(c=+c)*c,drag):Math.sqrt(I)},drag}DragEvent.prototype.on=function(){var c=this._.on.apply(this._,arguments);return c===this._?this:c};var er=Math.PI,nr=2*er,rr=1e-6,or=nr-rr;function Path(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function path_path(){return new Path}Path.prototype=path_path.prototype={constructor:Path,moveTo:function(c,h){this._+="M"+(this._x0=this._x1=+c)+","+(this._y0=this._y1=+h)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(c,h){this._+="L"+(this._x1=+c)+","+(this._y1=+h)},quadraticCurveTo:function(c,h,g,m){this._+="Q"+ +c+","+ +h+","+(this._x1=+g)+","+(this._y1=+m)},bezierCurveTo:function(c,h,g,m,b,w){this._+="C"+ +c+","+ +h+","+ +g+","+ +m+","+(this._x1=+b)+","+(this._y1=+w)},arcTo:function(c,h,g,m,b){c=+c,h=+h,g=+g,m=+m,b=+b;var w=this._x1,S=this._y1,M=g-c,k=m-h,T=w-c,E=S-h,I=T*T+E*E;if(b<0)throw new Error("negative radius: "+b);if(null===this._x1)this._+="M"+(this._x1=c)+","+(this._y1=h);else if(I>rr)if(Math.abs(E*M-k*T)>rr&&b){var P=g-w,L=m-S,B=M*M+k*k,z=P*P+L*L,j=Math.sqrt(B),D=Math.sqrt(I),N=b*Math.tan((er-Math.acos((B+I-z)/(2*j*D)))/2),R=N/D,G=N/j;Math.abs(R-1)>rr&&(this._+="L"+(c+R*T)+","+(h+R*E)),this._+="A"+b+","+b+",0,0,"+ +(E*P>T*L)+","+(this._x1=c+G*M)+","+(this._y1=h+G*k)}else this._+="L"+(this._x1=c)+","+(this._y1=h);else;},arc:function(c,h,g,m,b,w){c=+c,h=+h,w=!!w;var S=(g=+g)*Math.cos(m),M=g*Math.sin(m),k=c+S,T=h+M,E=1^w,I=w?m-b:b-m;if(g<0)throw new Error("negative radius: "+g);null===this._x1?this._+="M"+k+","+T:(Math.abs(this._x1-k)>rr||Math.abs(this._y1-T)>rr)&&(this._+="L"+k+","+T),g&&(I<0&&(I=I%nr+nr),I>or?this._+="A"+g+","+g+",0,1,"+E+","+(c-S)+","+(h-M)+"A"+g+","+g+",0,1,"+E+","+(this._x1=k)+","+(this._y1=T):I>rr&&(this._+="A"+g+","+g+",0,"+ +(I>=er)+","+E+","+(this._x1=c+g*Math.cos(b))+","+(this._y1=h+g*Math.sin(b))))},rect:function(c,h,g,m){this._+="M"+(this._x0=this._x1=+c)+","+(this._y0=this._y1=+h)+"h"+ +g+"v"+ +m+"h"+-g+"Z"},toString:function(){return this._}};const ar=path_path;function d3_shape_src_constant(c){return function constant(){return c}}var ir=1e-12,sr=Math.PI,lr=sr/2,cr=2*sr;function arcInnerRadius(c){return c.innerRadius}function arcOuterRadius(c){return c.outerRadius}function arcStartAngle(c){return c.startAngle}function arcEndAngle(c){return c.endAngle}function arcPadAngle(c){return c&&c.padAngle}function arc_asin(c){return c>=1?lr:c<=-1?-lr:Math.asin(c)}function cornerTangents(c,h,g,m,b,w,S){var M=c-g,k=h-m,T=(S?w:-w)/Math.sqrt(M*M+k*k),E=T*k,I=-T*M,P=c+E,L=h+I,B=g+E,z=m+I,j=(P+B)/2,D=(L+z)/2,N=B-P,R=z-L,G=N*N+R*R,q=b-w,W=P*z-B*L,H=(R<0?-1:1)*Math.sqrt(Math.max(0,q*q*G-W*W)),U=(W*R-N*H)/G,Y=(-W*N-R*H)/G,V=(W*R+N*H)/G,$=(-W*N+R*H)/G,X=U-j,K=Y-D,Z=V-j,J=$-D;return X*X+K*K>Z*Z+J*J&&(U=V,Y=$),{cx:U,cy:Y,x01:-E,y01:-I,x11:U*(b/q-1),y11:Y*(b/q-1)}}function Linear(c){this._context=c}function curve_linear(c){return new Linear(c)}function point_x(c){return c[0]}function point_y(c){return c[1]}Linear.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1,this._line?this._context.lineTo(c,h):this._context.moveTo(c,h);break;case 1:this._point=2;default:this._context.lineTo(c,h)}}};(function radial_curveRadial(c){function radial(h){return new Radial(c(h))}return radial._curve=c,radial})(curve_linear);function Radial(c){this._curve=c}Radial.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(c,h){this._curve.point(h*Math.sin(c),h*-Math.cos(c))}};Math.sqrt(1/3);var ur=Math.sin(sr/10)/Math.sin(7*sr/10);Math.sin(cr/10),Math.cos(cr/10);Math.sqrt(3);Math.sqrt(3),Math.sqrt(12);function src_noop(){}function basis_point(c,h,g){c._context.bezierCurveTo((2*c._x0+c._x1)/3,(2*c._y0+c._y1)/3,(c._x0+2*c._x1)/3,(c._y0+2*c._y1)/3,(c._x0+4*c._x1+h)/6,(c._y0+4*c._y1+g)/6)}function Basis(c){this._context=c}function BasisClosed(c){this._context=c}function BasisOpen(c){this._context=c}function Bundle(c,h){this._basis=new Basis(c),this._beta=h}Basis.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:basis_point(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1,this._line?this._context.lineTo(c,h):this._context.moveTo(c,h);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:basis_point(this,c,h)}this._x0=this._x1,this._x1=c,this._y0=this._y1,this._y1=h}},BasisClosed.prototype={areaStart:src_noop,areaEnd:src_noop,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1,this._x2=c,this._y2=h;break;case 1:this._point=2,this._x3=c,this._y3=h;break;case 2:this._point=3,this._x4=c,this._y4=h,this._context.moveTo((this._x0+4*this._x1+c)/6,(this._y0+4*this._y1+h)/6);break;default:basis_point(this,c,h)}this._x0=this._x1,this._x1=c,this._y0=this._y1,this._y1=h}},BasisOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var g=(this._x0+4*this._x1+c)/6,m=(this._y0+4*this._y1+h)/6;this._line?this._context.lineTo(g,m):this._context.moveTo(g,m);break;case 3:this._point=4;default:basis_point(this,c,h)}this._x0=this._x1,this._x1=c,this._y0=this._y1,this._y1=h}},Bundle.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var c=this._x,h=this._y,g=c.length-1;if(g>0)for(var m,b=c[0],w=h[0],S=c[g]-b,M=h[g]-w,k=-1;++k<=g;)m=k/g,this._basis.point(this._beta*c[k]+(1-this._beta)*(b+m*S),this._beta*h[k]+(1-this._beta)*(w+m*M));this._x=this._y=null,this._basis.lineEnd()},point:function(c,h){this._x.push(+c),this._y.push(+h)}};(function custom(c){function bundle(h){return 1===c?new Basis(h):new Bundle(h,c)}return bundle.beta=function(c){return custom(+c)},bundle})(.85);function cardinal_point(c,h,g){c._context.bezierCurveTo(c._x1+c._k*(c._x2-c._x0),c._y1+c._k*(c._y2-c._y0),c._x2+c._k*(c._x1-h),c._y2+c._k*(c._y1-g),c._x2,c._y2)}function Cardinal(c,h){this._context=c,this._k=(1-h)/6}Cardinal.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:cardinal_point(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1,this._line?this._context.lineTo(c,h):this._context.moveTo(c,h);break;case 1:this._point=2,this._x1=c,this._y1=h;break;case 2:this._point=3;default:cardinal_point(this,c,h)}this._x0=this._x1,this._x1=this._x2,this._x2=c,this._y0=this._y1,this._y1=this._y2,this._y2=h}};(function custom(c){function cardinal(h){return new Cardinal(h,c)}return cardinal.tension=function(c){return custom(+c)},cardinal})(0);function CardinalClosed(c,h){this._context=c,this._k=(1-h)/6}CardinalClosed.prototype={areaStart:src_noop,areaEnd:src_noop,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1,this._x3=c,this._y3=h;break;case 1:this._point=2,this._context.moveTo(this._x4=c,this._y4=h);break;case 2:this._point=3,this._x5=c,this._y5=h;break;default:cardinal_point(this,c,h)}this._x0=this._x1,this._x1=this._x2,this._x2=c,this._y0=this._y1,this._y1=this._y2,this._y2=h}};(function custom(c){function cardinal(h){return new CardinalClosed(h,c)}return cardinal.tension=function(c){return custom(+c)},cardinal})(0);function CardinalOpen(c,h){this._context=c,this._k=(1-h)/6}CardinalOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:cardinal_point(this,c,h)}this._x0=this._x1,this._x1=this._x2,this._x2=c,this._y0=this._y1,this._y1=this._y2,this._y2=h}};(function custom(c){function cardinal(h){return new CardinalOpen(h,c)}return cardinal.tension=function(c){return custom(+c)},cardinal})(0);function catmullRom_point(c,h,g){var m=c._x1,b=c._y1,w=c._x2,S=c._y2;if(c._l01_a>ir){var M=2*c._l01_2a+3*c._l01_a*c._l12_a+c._l12_2a,k=3*c._l01_a*(c._l01_a+c._l12_a);m=(m*M-c._x0*c._l12_2a+c._x2*c._l01_2a)/k,b=(b*M-c._y0*c._l12_2a+c._y2*c._l01_2a)/k}if(c._l23_a>ir){var T=2*c._l23_2a+3*c._l23_a*c._l12_a+c._l12_2a,E=3*c._l23_a*(c._l23_a+c._l12_a);w=(w*T+c._x1*c._l23_2a-h*c._l12_2a)/E,S=(S*T+c._y1*c._l23_2a-g*c._l12_2a)/E}c._context.bezierCurveTo(m,b,w,S,c._x2,c._y2)}function CatmullRom(c,h){this._context=c,this._alpha=h}CatmullRom.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){if(c=+c,h=+h,this._point){var g=this._x2-c,m=this._y2-h;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(g*g+m*m,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(c,h):this._context.moveTo(c,h);break;case 1:this._point=2;break;case 2:this._point=3;default:catmullRom_point(this,c,h)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=c,this._y0=this._y1,this._y1=this._y2,this._y2=h}};const hr=function custom(c){function catmullRom(h){return c?new CatmullRom(h,c):new Cardinal(h,0)}return catmullRom.alpha=function(c){return custom(+c)},catmullRom}(.5);function CatmullRomClosed(c,h){this._context=c,this._alpha=h}CatmullRomClosed.prototype={areaStart:src_noop,areaEnd:src_noop,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(c,h){if(c=+c,h=+h,this._point){var g=this._x2-c,m=this._y2-h;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(g*g+m*m,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=c,this._y3=h;break;case 1:this._point=2,this._context.moveTo(this._x4=c,this._y4=h);break;case 2:this._point=3,this._x5=c,this._y5=h;break;default:catmullRom_point(this,c,h)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=c,this._y0=this._y1,this._y1=this._y2,this._y2=h}};(function custom(c){function catmullRom(h){return c?new CatmullRomClosed(h,c):new CardinalClosed(h,0)}return catmullRom.alpha=function(c){return custom(+c)},catmullRom})(.5);function CatmullRomOpen(c,h){this._context=c,this._alpha=h}CatmullRomOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){if(c=+c,h=+h,this._point){var g=this._x2-c,m=this._y2-h;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(g*g+m*m,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:catmullRom_point(this,c,h)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=c,this._y0=this._y1,this._y1=this._y2,this._y2=h}};(function custom(c){function catmullRom(h){return c?new CatmullRomOpen(h,c):new CardinalOpen(h,0)}return catmullRom.alpha=function(c){return custom(+c)},catmullRom})(.5);function LinearClosed(c){this._context=c}function monotone_sign(c){return c<0?-1:1}function slope3(c,h,g){var m=c._x1-c._x0,b=h-c._x1,w=(c._y1-c._y0)/(m||b<0&&-0),S=(g-c._y1)/(b||m<0&&-0),M=(w*b+S*m)/(m+b);return(monotone_sign(w)+monotone_sign(S))*Math.min(Math.abs(w),Math.abs(S),.5*Math.abs(M))||0}function slope2(c,h){var g=c._x1-c._x0;return g?(3*(c._y1-c._y0)/g-h)/2:h}function monotone_point(c,h,g){var m=c._x0,b=c._y0,w=c._x1,S=c._y1,M=(w-m)/3;c._context.bezierCurveTo(m+M,b+M*h,w-M,S-M*g,w,S)}function MonotoneX(c){this._context=c}function MonotoneY(c){this._context=new ReflectContext(c)}function ReflectContext(c){this._context=c}function Natural(c){this._context=c}function controlPoints(c){var h,g,m=c.length-1,b=new Array(m),w=new Array(m),S=new Array(m);for(b[0]=0,w[0]=2,S[0]=c[0]+2*c[1],h=1;h<m-1;++h)b[h]=1,w[h]=4,S[h]=4*c[h]+2*c[h+1];for(b[m-1]=2,w[m-1]=7,S[m-1]=8*c[m-1]+c[m],h=1;h<m;++h)g=b[h]/w[h-1],w[h]-=g,S[h]-=g*S[h-1];for(b[m-1]=S[m-1]/w[m-1],h=m-2;h>=0;--h)b[h]=(S[h]-b[h+1])/w[h];for(w[m-1]=(c[m]+b[m-1])/2,h=0;h<m-1;++h)w[h]=2*c[h+1]-b[h+1];return[b,w]}function Step(c,h){this._context=c,this._t=h}LinearClosed.prototype={areaStart:src_noop,areaEnd:src_noop,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(c,h){c=+c,h=+h,this._point?this._context.lineTo(c,h):(this._point=1,this._context.moveTo(c,h))}},MonotoneX.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:monotone_point(this,this._t0,slope2(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){var g=NaN;if(h=+h,(c=+c)!==this._x1||h!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(c,h):this._context.moveTo(c,h);break;case 1:this._point=2;break;case 2:this._point=3,monotone_point(this,slope2(this,g=slope3(this,c,h)),g);break;default:monotone_point(this,this._t0,g=slope3(this,c,h))}this._x0=this._x1,this._x1=c,this._y0=this._y1,this._y1=h,this._t0=g}}},(MonotoneY.prototype=Object.create(MonotoneX.prototype)).point=function(c,h){MonotoneX.prototype.point.call(this,h,c)},ReflectContext.prototype={moveTo:function(c,h){this._context.moveTo(h,c)},closePath:function(){this._context.closePath()},lineTo:function(c,h){this._context.lineTo(h,c)},bezierCurveTo:function(c,h,g,m,b,w){this._context.bezierCurveTo(h,c,m,g,w,b)}},Natural.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var c=this._x,h=this._y,g=c.length;if(g)if(this._line?this._context.lineTo(c[0],h[0]):this._context.moveTo(c[0],h[0]),2===g)this._context.lineTo(c[1],h[1]);else for(var m=controlPoints(c),b=controlPoints(h),w=0,S=1;S<g;++w,++S)this._context.bezierCurveTo(m[0][w],b[0][w],m[1][w],b[1][w],c[S],h[S]);(this._line||0!==this._line&&1===g)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(c,h){this._x.push(+c),this._y.push(+h)}},Step.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1,this._line?this._context.lineTo(c,h):this._context.moveTo(c,h);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,h),this._context.lineTo(c,h);else{var g=this._x*(1-this._t)+c*this._t;this._context.lineTo(g,this._y),this._context.lineTo(g,h)}}this._x=c,this._y=h}};Array.prototype.slice;var dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},classCallCheck=function(c,h){if(!(c instanceof h))throw new TypeError("Cannot call a class as a function")},pr=function(){function defineProperties(c,h){for(var g=0;g<h.length;g++){var m=h[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(c,m.key,m)}}return function(c,h,g){return h&&defineProperties(c.prototype,h),g&&defineProperties(c,g),c}}(),fr=Object.assign||function(c){for(var h=1;h<arguments.length;h++){var g=arguments[h];for(var m in g)Object.prototype.hasOwnProperty.call(g,m)&&(c[m]=g[m])}return c},gr=function get(c,h,g){null===c&&(c=Function.prototype);var m=Object.getOwnPropertyDescriptor(c,h);if(void 0===m){var b=Object.getPrototypeOf(c);return null===b?void 0:get(b,h,g)}if("value"in m)return m.value;var w=m.get;return void 0!==w?w.call(g):void 0},inherits=function(c,h){if("function"!=typeof h&&null!==h)throw new TypeError("Super expression must either be null or a function, not "+typeof h);c.prototype=Object.create(h&&h.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(c,h):c.__proto__=h)},possibleConstructorReturn=function(c,h){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!h||"object"!=typeof h&&"function"!=typeof h?c:h},_r=function(){function Annotation(c){var h=c.x,g=void 0===h?0:h,m=c.y,b=void 0===m?0:m,w=c.nx,S=c.ny,M=c.dy,k=void 0===M?0:M,T=c.dx,E=void 0===T?0:T,I=c.color,P=void 0===I?"grey":I,L=c.data,B=c.type,z=c.subject,j=c.connector,D=c.note,N=c.disable,R=c.id,G=c.className;classCallCheck(this,Annotation),this._dx=void 0!==w?w-g:E,this._dy=void 0!==S?S-b:k,this._x=g,this._y=b,this._color=P,this.id=R,this._className=G||"",this._type=B||"",this.data=L,this.note=D||{},this.connector=j||{},this.subject=z||{},this.disable=N||[]}return pr(Annotation,[{key:"updatePosition",value:function updatePosition(){this.type.setPosition&&(this.type.setPosition(),this.type.subject&&0!==this.type.subject.selectAll(":not(.handle)").nodes().length&&this.type.redrawSubject())}},{key:"clearComponents",value:function clearComponents(){this.type.clearComponents&&this.type.clearComponents()}},{key:"updateOffset",value:function updateOffset(){this.type.setOffset&&(this.type.setOffset(),0!==this.type.connector.selectAll(":not(.handle)").nodes().length&&this.type.redrawConnector(),this.type.redrawNote())}},{key:"className",get:function get$$1(){return this._className},set:function set$$1(c){this._className=c,this.type.setClassName&&this.type.setClassName()}},{key:"type",get:function get$$1(){return this._type},set:function set$$1(c){this._type=c,this.clearComponents()}},{key:"x",get:function get$$1(){return this._x},set:function set$$1(c){this._x=c,this.updatePosition()}},{key:"y",get:function get$$1(){return this._y},set:function set$$1(c){this._y=c,this.updatePosition()}},{key:"color",get:function get$$1(){return this._color},set:function set$$1(c){this._color=c,this.updatePosition()}},{key:"dx",get:function get$$1(){return this._dx},set:function set$$1(c){this._dx=c,this.updateOffset()}},{key:"dy",get:function get$$1(){return this._dy},set:function set$$1(c){this._dy=c,this.updateOffset()}},{key:"nx",set:function set$$1(c){this._dx=c-this._x,this.updateOffset()}},{key:"ny",set:function set$$1(c){this._dy=c-this._y,this.updateOffset()}},{key:"offset",get:function get$$1(){return{x:this._dx,y:this._dy}},set:function set$$1(c){var h=c.x,g=c.y;this._dx=h,this._dy=g,this.updateOffset()}},{key:"position",get:function get$$1(){return{x:this._x,y:this._y}},set:function set$$1(c){var h=c.x,g=c.y;this._x=h,this._y=g,this.updatePosition()}},{key:"translation",get:function get$$1(){return{x:this._x+this._dx,y:this._y+this._dy}}},{key:"json",get:function get$$1(){var c={x:this._x,y:this._y,dx:this._dx,dy:this._dy};return this.data&&Object.keys(this.data).length>0&&(c.data=this.data),this.type&&(c.type=this.type),this._className&&(c.className=this._className),Object.keys(this.connector).length>0&&(c.connector=this.connector),Object.keys(this.subject).length>0&&(c.subject=this.subject),Object.keys(this.note).length>0&&(c.note=this.note),c}}]),Annotation}(),mr=function(){function AnnotationCollection(c){var h=c.annotations,g=c.accessors,m=c.accessorsInverse;classCallCheck(this,AnnotationCollection),this.accessors=g,this.accessorsInverse=m,this.annotations=h}return pr(AnnotationCollection,[{key:"clearTypes",value:function clearTypes(c){this.annotations.forEach(function(h){h.type=void 0,h.subject=c&&c.subject||h.subject,h.connector=c&&c.connector||h.connector,h.note=c&&c.note||h.note})}},{key:"setPositionWithAccessors",value:function setPositionWithAccessors(){var c=this;this.annotations.forEach(function(h){h.type.setPositionWithAccessors(c.accessors)})}},{key:"editMode",value:function editMode(c){this.annotations.forEach(function(h){h.type&&(h.type.editMode=c,h.type.updateEditMode())})}},{key:"updateDisable",value:function updateDisable(c){this.annotations.forEach(function(h){h.disable=c,h.type&&c.forEach(function(c){h.type[c]&&(h.type[c].remove&&h.type[c].remove(),h.type[c]=void 0)})})}},{key:"updateTextWrap",value:function updateTextWrap(c){this.annotations.forEach(function(h){h.type&&h.type.updateTextWrap&&h.type.updateTextWrap(c)})}},{key:"updateText",value:function updateText(){this.annotations.forEach(function(c){c.type&&c.type.drawText&&c.type.drawText()})}},{key:"updateNotePadding",value:function updateNotePadding(c){this.annotations.forEach(function(h){h.type&&(h.type.notePadding=c)})}},{key:"json",get:function get$$1(){var c=this;return this.annotations.map(function(h){var g=h.json;return c.accessorsInverse&&h.data&&(g.data={},Object.keys(c.accessorsInverse).forEach(function(m){g.data[m]=c.accessorsInverse[m]({x:h.x,y:h.y})})),g})}},{key:"noteNodes",get:function get$$1(){return this.annotations.map(function(c){return fr({},c.type.getNoteBBoxOffset(),{positionX:c.x,positionY:c.y})})}}]),AnnotationCollection}(),vr=function leftRightDynamic(c,h){return"dynamic"!==c&&"left"!==c&&"right"!==c||(c=h<0?"top":"bottom"),c},yr=function topBottomDynamic(c,h){return"dynamic"!==c&&"top"!==c&&"bottom"!==c||(c=h<0?"right":"left"),c},Ar=["topBottom","top","bottom"],br=["leftRight","left","right"],xr=function lineBuilder(c){var h=c.data,g=c.curve,m=void 0===g?curve_linear:g,b=c.canvasContext,w=c.className,S=c.classID,M=function src_line(){var c=point_x,h=point_y,g=d3_shape_src_constant(!0),m=null,b=curve_linear,w=null;function line(S){var M,k,T,E=S.length,I=!1;for(null==m&&(w=b(T=ar())),M=0;M<=E;++M)!(M<E&&g(k=S[M],M,S))===I&&((I=!I)?w.lineStart():w.lineEnd()),I&&w.point(+c(k,M,S),+h(k,M,S));if(T)return w=null,T+""||null}return line.x=function(h){return arguments.length?(c="function"==typeof h?h:d3_shape_src_constant(+h),line):c},line.y=function(c){return arguments.length?(h="function"==typeof c?c:d3_shape_src_constant(+c),line):h},line.defined=function(c){return arguments.length?(g="function"==typeof c?c:d3_shape_src_constant(!!c),line):g},line.curve=function(c){return arguments.length?(b=c,null!=m&&(w=b(m)),line):b},line.context=function(c){return arguments.length?(null==c?m=w=null:w=b(m=c),line):m},line}().curve(m),k={type:"path",className:w,classID:S,data:h};return b?(M.context(b),k.pathMethods=M):k.attrs={d:M(h)},k},wr=function arcBuilder(c){var h=c.data,g=c.canvasContext,m={type:"path",className:c.className,classID:c.classID,data:h},b=function arc(){var c=arcInnerRadius,h=arcOuterRadius,g=d3_shape_src_constant(0),m=null,b=arcStartAngle,w=arcEndAngle,S=arcPadAngle,M=null;function arc(){var k,T,E=+c.apply(this,arguments),I=+h.apply(this,arguments),P=b.apply(this,arguments)-lr,L=w.apply(this,arguments)-lr,B=Math.abs(L-P),z=L>P;if(M||(M=k=ar()),I<E&&(T=I,I=E,E=T),I>ir)if(B>cr-ir)M.moveTo(I*Math.cos(P),I*Math.sin(P)),M.arc(0,0,I,P,L,!z),E>ir&&(M.moveTo(E*Math.cos(L),E*Math.sin(L)),M.arc(0,0,E,L,P,z));else{var j,D,N=P,R=L,G=P,q=L,W=B,H=B,U=S.apply(this,arguments)/2,Y=U>ir&&(m?+m.apply(this,arguments):Math.sqrt(E*E+I*I)),V=Math.min(Math.abs(I-E)/2,+g.apply(this,arguments)),$=V,X=V;if(Y>ir){var K=arc_asin(Y/E*Math.sin(U)),Z=arc_asin(Y/I*Math.sin(U));(W-=2*K)>ir?(G+=K*=z?1:-1,q-=K):(W=0,G=q=(P+L)/2),(H-=2*Z)>ir?(N+=Z*=z?1:-1,R-=Z):(H=0,N=R=(P+L)/2)}var J=I*Math.cos(N),Q=I*Math.sin(N),tt=E*Math.cos(q),et=E*Math.sin(q);if(V>ir){var nt=I*Math.cos(R),rt=I*Math.sin(R),ot=E*Math.cos(G),at=E*Math.sin(G);if(B<sr){var it=W>ir?function intersect(c,h,g,m,b,w,S,M){var k=g-c,T=m-h,E=S-b,I=M-w,P=(E*(h-w)-I*(c-b))/(I*k-E*T);return[c+P*k,h+P*T]}(J,Q,ot,at,nt,rt,tt,et):[tt,et],st=J-it[0],lt=Q-it[1],ct=nt-it[0],ut=rt-it[1],ht=1/Math.sin(Math.acos((st*ct+lt*ut)/(Math.sqrt(st*st+lt*lt)*Math.sqrt(ct*ct+ut*ut)))/2),dt=Math.sqrt(it[0]*it[0]+it[1]*it[1]);$=Math.min(V,(E-dt)/(ht-1)),X=Math.min(V,(I-dt)/(ht+1))}}H>ir?X>ir?(j=cornerTangents(ot,at,J,Q,I,X,z),D=cornerTangents(nt,rt,tt,et,I,X,z),M.moveTo(j.cx+j.x01,j.cy+j.y01),X<V?M.arc(j.cx,j.cy,X,Math.atan2(j.y01,j.x01),Math.atan2(D.y01,D.x01),!z):(M.arc(j.cx,j.cy,X,Math.atan2(j.y01,j.x01),Math.atan2(j.y11,j.x11),!z),M.arc(0,0,I,Math.atan2(j.cy+j.y11,j.cx+j.x11),Math.atan2(D.cy+D.y11,D.cx+D.x11),!z),M.arc(D.cx,D.cy,X,Math.atan2(D.y11,D.x11),Math.atan2(D.y01,D.x01),!z))):(M.moveTo(J,Q),M.arc(0,0,I,N,R,!z)):M.moveTo(J,Q),E>ir&&W>ir?$>ir?(j=cornerTangents(tt,et,nt,rt,E,-$,z),D=cornerTangents(J,Q,ot,at,E,-$,z),M.lineTo(j.cx+j.x01,j.cy+j.y01),$<V?M.arc(j.cx,j.cy,$,Math.atan2(j.y01,j.x01),Math.atan2(D.y01,D.x01),!z):(M.arc(j.cx,j.cy,$,Math.atan2(j.y01,j.x01),Math.atan2(j.y11,j.x11),!z),M.arc(0,0,E,Math.atan2(j.cy+j.y11,j.cx+j.x11),Math.atan2(D.cy+D.y11,D.cx+D.x11),z),M.arc(D.cx,D.cy,$,Math.atan2(D.y11,D.x11),Math.atan2(D.y01,D.x01),!z))):M.arc(0,0,E,q,G,z):M.lineTo(tt,et)}else M.moveTo(0,0);if(M.closePath(),k)return M=null,k+""||null}return arc.centroid=function(){var g=(+c.apply(this,arguments)+ +h.apply(this,arguments))/2,m=(+b.apply(this,arguments)+ +w.apply(this,arguments))/2-sr/2;return[Math.cos(m)*g,Math.sin(m)*g]},arc.innerRadius=function(h){return arguments.length?(c="function"==typeof h?h:d3_shape_src_constant(+h),arc):c},arc.outerRadius=function(c){return arguments.length?(h="function"==typeof c?c:d3_shape_src_constant(+c),arc):h},arc.cornerRadius=function(c){return arguments.length?(g="function"==typeof c?c:d3_shape_src_constant(+c),arc):g},arc.padRadius=function(c){return arguments.length?(m=null==c?null:"function"==typeof c?c:d3_shape_src_constant(+c),arc):m},arc.startAngle=function(c){return arguments.length?(b="function"==typeof c?c:d3_shape_src_constant(+c),arc):b},arc.endAngle=function(c){return arguments.length?(w="function"==typeof c?c:d3_shape_src_constant(+c),arc):w},arc.padAngle=function(c){return arguments.length?(S="function"==typeof c?c:d3_shape_src_constant(+c),arc):S},arc.context=function(c){return arguments.length?(M=null==c?null:c,arc):M},arc}().innerRadius(h.innerRadius||0).outerRadius(h.outerRadius||h.radius||2).startAngle(h.startAngle||0).endAngle(h.endAngle||2*Math.PI);return g?(b.context(g),m.pathMethods=lineGen):m.attrs={d:b()},m},Cr=function lineSetup(c){var h=c.type,g=c.subjectType,m=h.annotation,b=m.position,w=m.x-b.x,S=w+m.dx,M=m.y-b.y,k=M+m.dy,T=m.subject;if("circle"===g&&(T.outerRadius||T.radius)){var E=Math.sqrt((w-S)*(w-S)+(M-k)*(M-k)),I=Math.asin(-k/E),P=T.outerRadius||T.radius+(T.radiusPadding||0);w=Math.abs(Math.cos(I)*P)*(S<0?-1:1),M=Math.abs(Math.sin(I)*P)*(k<0?-1:1)}if("rect"===g){var L=T.width,B=T.height;(L>0&&m.dx>0||L<0&&m.dx<0)&&(w=Math.abs(L)>Math.abs(m.dx)?L/2:L),(B>0&&m.dy>0||B<0&&m.dy<0)&&(M=Math.abs(B)>Math.abs(m.dy)?B/2:B),w===L/2&&M===B/2&&(w=S,M=k)}return[[w,M],[S,k]]},connectorCurve=function(c){var h=c.type,g=c.connectorData,m=c.subjectType;g||(g={}),g.points&&"number"!=typeof g.points||(g.points=Sr(h.annotation.offset,g.points)),g.curve||(g.curve=hr);var b=[];if(h.editMode){var w=g.points.map(function(c,h){return fr({},function pointHandle(c){var h=c.cx,g=void 0===h?0:h,m=c.cy;return{move:{x:g,y:void 0===m?0:m}}}({cx:c[0],cy:c[1]}),{index:h})}),S=function updatePoint(c){g.points[c][0]+=Kn.dx,g.points[c][1]+=Kn.dy,h.redrawConnector()};b=h.mapHandles(w.map(function(c){return fr({},c.move,{drag:S.bind(h,c.index)})}))}var M=Cr({type:h,subjectType:m});return M=[M[0]].concat(function(c){if(Array.isArray(c)){for(var h=0,g=Array(c.length);h<c.length;h++)g[h]=c[h];return g}return Array.from(c)}(g.points),[M[1]]),{components:[xr({data:M,curve:g.curve,className:"connector"})],handles:b}},Sr=function createPoints(c){for(var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,g=c.x/(h+1),m=c.y/(h+1),b=[],w=1;w<=h;w++)b.push([g*w+w%2*20,m*w-w%2*20]);return b},subjectCircle=function(c){var h=c.subjectData,g=c.type;h.radius||h.outerRadius||(h.radius=20);var m=[],b=wr({data:h,className:"subject"});if(g.editMode){var w=function circleHandles(c){var h=c.cx,g=void 0===h?0:h,m=c.cy,b=void 0===m?0:m,w=c.r1,S=c.r2,M=c.padding,k={move:{x:g,y:b}};return void 0!==w&&(k.r1={x:g+w/Math.sqrt(2),y:b+w/Math.sqrt(2)}),void 0!==S&&(k.r2={x:g+S/Math.sqrt(2),y:b+S/Math.sqrt(2)}),void 0!==M&&(k.padding={x:g+w+M,y:b}),k}({r1:b.data.outerRadius||b.data.radius,r2:b.data.innerRadius,padding:h.radiusPadding}),S=function updateRadius(c){var m=h[c]+Kn.dx*Math.sqrt(2);h[c]=m,g.redrawSubject(),g.redrawConnector()},M=[fr({},w.r1,{drag:S.bind(g,void 0!==h.outerRadius?"outerRadius":"radius")})];h.innerRadius&&M.push(fr({},w.r2,{drag:S.bind(g,"innerRadius")})),m=g.mapHandles(M)}return b.attrs["fill-opacity"]=0,{components:[b],handles:m}},Mr=function(){function Type(c){var h=c.a,g=c.annotation,m=c.editMode,b=c.dispatcher,w=c.notePadding,S=c.accessors;if(classCallCheck(this,Type),this.a=h,this.note=-1===g.disable.indexOf("note")&&h.select("g.annotation-note"),this.noteContent=this.note&&h.select("g.annotation-note-content"),this.connector=-1===g.disable.indexOf("connector")&&h.select("g.annotation-connector"),this.subject=-1===g.disable.indexOf("subject")&&h.select("g.annotation-subject"),this.dispatcher=b,b){var M=zr.bind(null,b,g);M({component:this.note,name:"note"}),M({component:this.connector,name:"connector"}),M({component:this.subject,name:"subject"})}this.annotation=g,this.editMode=g.editMode||m,this.notePadding=void 0!==w?w:3,this.offsetCornerX=0,this.offsetCornerY=0,S&&g.data&&this.init(S)}return pr(Type,[{key:"init",value:function init(c){this.annotation.x||this.mapX(c),this.annotation.y||this.mapY(c)}},{key:"mapY",value:function mapY(c){c.y&&(this.annotation.y=c.y(this.annotation.data))}},{key:"mapX",value:function mapX(c){c.x&&(this.annotation.x=c.x(this.annotation.data))}},{key:"updateEditMode",value:function updateEditMode(){this.a.selectAll("circle.handle").remove()}},{key:"drawOnSVG",value:function drawOnSVG(c,h){var g=this;Array.isArray(h)||(h=[h]),h.filter(function(c){return c}).forEach(function(h){var m=h.type,b=h.className,w=h.attrs,S=h.handles,M=h.classID;if("handle"===m)!function addHandles(c){var h=c.group,g=c.handles,m=c.r,b=void 0===m?10:m,w=h.selectAll("circle.handle").data(g);w.enter().append("circle").attr("class","handle").attr("fill","grey").attr("fill-opacity",.1).attr("cursor","move").attr("stroke-dasharray",5).attr("stroke","grey").call(drag().container(d3_selection_src_select("g.annotations").node()).on("start",function(c){return c.start&&c.start(c)}).on("drag",function(c){return c.drag&&c.drag(c)}).on("end",function(c){return c.end&&c.end(c)})),h.selectAll("circle.handle").attr("cx",function(c){return c.x}).attr("cy",function(c){return c.y}).attr("r",function(c){return c.r||b}).attr("class",function(c){return"handle "+(c.className||"")}),w.exit().remove()}({group:c,r:w&&w.r,handles:S});else{Or(c,[g.annotation],m,b,M);for(var k=c.select(m+"."+(M||b)),T=Object.keys(w),E=[],I=k.node().attributes,P=I.length-1;P>=0;P--){var L=I[P].name;-1===T.indexOf(L)&&"class"!==L&&E.push(L)}T.forEach(function(c){"text"===c?k.text(w[c]):k.attr(c,w[c])}),E.forEach(function(c){return k.attr(c,null)})}})}},{key:"getNoteBBox",value:function getNoteBBox(){return Dr(this.note,".annotation-note-content text")}},{key:"getNoteBBoxOffset",value:function getNoteBBoxOffset(){var c=Dr(this.note,".annotation-note-content"),h=this.noteContent.attr("transform").split(/\(|\,|\)/g);return c.offsetCornerX=parseFloat(h[1])+this.annotation.dx,c.offsetCornerY=parseFloat(h[2])+this.annotation.dy,c.offsetX=this.annotation.dx,c.offsetY=this.annotation.dy,c}},{key:"drawSubject",value:function drawSubject(){var c=this,h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},g=this.annotation.subject,m=h.type,b={type:this,subjectData:g},w={};"circle"===m?w=subjectCircle(b):"rect"===m?w=function(c){var h=c.subjectData,g=c.type;h.width||(h.width=100),h.height||(h.height=100);var m=[],b=h.width,w=h.height,S=xr({data:[[0,0],[b,0],[b,w],[0,w],[0,0]],className:"subject"});if(g.editMode){var M=[{x:b,y:w/2,drag:function updateWidth(){h.width=Kn.x,g.redrawSubject(),g.redrawConnector()}.bind(g)},{x:b/2,y:w,drag:function updateHeight(){h.height=Kn.y,g.redrawSubject(),g.redrawConnector()}.bind(g)}];m=g.mapHandles(M)}return S.attrs["fill-opacity"]=.1,{components:[S],handles:m}}(b):"threshold"===m?w=function(c){var h=c.subjectData,g=c.type.annotation.position,m=(void 0!==h.x1?h.x1:g.x)-g.x,b=(void 0!==h.x2?h.x2:g.x)-g.x,w=(void 0!==h.y1?h.y1:g.y)-g.y,S=(void 0!==h.y2?h.y2:g.y)-g.y;return{components:[xr({data:[[m,w],[b,S]],className:"subject"})]}}(b):"badge"===m&&(w=function(c){var h=c.subjectData,g=void 0===h?{}:h,m=c.type,b=void 0===m?{}:m,w=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},S=b.typeSettings&&b.typeSettings.subject;g.radius||(S&&S.radius?g.radius=S.radius:g.radius=14),g.x||S&&S.x&&(g.x=S.x),g.y||S&&S.y&&(g.y=S.y);var M=[],k=[],T=g.radius,E=.7*T,I=0,P=0,L=Math.sqrt(2)*T,B={xleftcorner:-T,xrightcorner:T,ytopcorner:-T,ybottomcorner:T,xleft:-L,xright:L,ytop:-L,ybottom:L};g.x&&!g.y?I=B["x"+g.x]:g.y&&!g.x?P=B["y"+g.y]:g.x&&g.y&&(I=B["x"+g.x+"corner"],P=B["y"+g.y+"corner"]);var z="translate("+I+", "+P+")",j=wr({className:"subject",data:{radius:T}});j.attrs.transform=z,j.attrs.fill=w.color,j.attrs["stroke-linecap"]="round",j.attrs["stroke-width"]="3px";var D=wr({className:"subject-ring",data:{outerRadius:T,innerRadius:E}});D.attrs.transform=z,D.attrs["stroke-width"]="3px",D.attrs.fill="white";var N=void 0;if(I&&P||!I&&!P)N=xr({className:"subject-pointer",data:[[0,0],[I||0,0],[0,P||0],[0,0]]});else if(I||P){var R=function notCornerPointerXY(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return c&&c/Math.sqrt(2)/Math.sqrt(2)||h*T/Math.sqrt(2)};N=xr({className:"subject-pointer",data:[[0,0],[R(I),R(P)],[R(I,-1),R(P,-1)],[0,0]]})}if(N&&(N.attrs.fill=w.color,N.attrs["stroke-linecap"]="round",N.attrs["stroke-width"]="3px",k.push(N)),b.editMode){var G={x:2*I,y:2*P,drag:function dragBadge(){g.x=Kn.x<2*-T?"left":Kn.x>2*T?"right":void 0,g.y=Kn.y<2*-T?"top":Kn.y>2*T?"bottom":void 0,b.redrawSubject()}.bind(b)};G.x||G.y||(G.y=-T),M=b.mapHandles([G])}var q=void 0;return g.text&&(q={type:"text",className:"badge-text",attrs:{fill:"white",stroke:"none","font-size":".7em",text:g.text,"text-anchor":"middle",dy:".25em",x:I,y:P}}),k.push(j),k.push(D),k.push(q),{components:k,handles:M}}(b,this.annotation));var S=w,M=S.components,k=void 0===M?[]:M,T=S.handles,E=void 0===T?[]:T;return k.forEach(function(h){h&&h.attrs&&!h.attrs.stroke&&(h.attrs.stroke=c.annotation.color)}),this.editMode&&(E=E.concat(this.mapHandles([{drag:this.dragSubject.bind(this)}])),k.push({type:"handle",handles:E})),k}},{key:"drawConnector",value:function drawConnector(){var c=this,h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},g=this.annotation.connector,m=g.type||h.type,b={type:this,connectorData:g};b.subjectType=this.typeSettings&&this.typeSettings.subject&&this.typeSettings.subject.type;var w={};w="curve"===m?connectorCurve(b):"elbow"===m?function(c){var h=c.type,g=c.subjectType,m=h.annotation,b=m.position,w=m.x-b.x,S=w+m.dx,M=m.y-b.y,k=M+m.dy,T=m.subject;if("rect"===g){var E=T.width,I=T.height;(E>0&&m.dx>0||E<0&&m.dx<0)&&(w=Math.abs(E)>Math.abs(m.dx)?E/2:E),(I>0&&m.dy>0||I<0&&m.dy<0)&&(M=Math.abs(I)>Math.abs(m.dy)?I/2:I),w===E/2&&M===I/2&&(w=S,M=k)}var P=[[w,M],[S,k]],L=k-M,B=S-w,z=S,j=k,D=k<M&&S>w||S<w&&k>M?-1:1;if(Math.abs(B)<Math.abs(L)?(z=S,j=M+B*D):(j=k,z=w+L*D),"circle"===g&&(T.outerRadius||T.radius)){var N=(T.outerRadius||T.radius)+(T.radiusPadding||0),R=N/Math.sqrt(2);if(Math.abs(B)>R&&Math.abs(L)>R)P=[[w=R*(S<0?-1:1),M=R*(k<0?-1:1)],[z,j],[S,k]];else if(Math.abs(B)>Math.abs(L)){var G=Math.asin(-k/N);P=[[w=Math.abs(Math.cos(G)*N)*(S<0?-1:1),k],[S,k]]}else{var q=Math.acos(S/N);P=[[S,M=Math.abs(Math.sin(q)*N)*(k<0?-1:1)],[S,k]]}}else P=[[w,M],[z,j],[S,k]];return{components:[xr({data:P,className:"connector"})]}}(b):function(c){var h=Cr(c);return{components:[xr({data:h,className:"connector"})]}}(b);var S=w,M=S.components,k=void 0===M?[]:M,T=S.handles,E=void 0===T?[]:T,I=k[0];I&&(I.attrs.stroke=this.annotation.color,I.attrs.fill="none");var P=g.end||h.end,L={};if("arrow"===P){var B=I.data[1],z=I.data[0];Math.sqrt(Math.pow(B[0]-z[0],2)+Math.pow(B[1]-z[1],2))<5&&I.data[2]&&(B=I.data[2]),L=function(c){var h=c.annotation,g=c.start,m=c.end,b=c.scale,w=void 0===b?1:b,S=h.position;g=g?[-m[0]+g[0],-m[1]+g[1]]:[h.dx,h.dy],m||(m=[h.x-S.x,h.y-S.y]);var M=m[0],k=m[1],T=g[0],E=g[1],I=10*w,P=16/180*Math.PI,L=Math.atan(E/T);T<0&&(L+=Math.PI);var B=[[M,k],[Math.cos(L+P)*I+M,Math.sin(L+P)*I+k],[Math.cos(L-P)*I+M,Math.sin(L-P)*I+k],[M,k]];return{components:[xr({data:B,className:"connector-end connector-arrow",classID:"connector-end"})]}}({annotation:this.annotation,start:B,end:z,scale:g.endScale})}else"dot"===P?L=function(c){var h=c.line,g=c.scale,m=void 0===g?1:g,b=wr({className:"connector-end connector-dot",classID:"connector-end",data:{radius:3*Math.sqrt(m)}});return b.attrs.transform="translate("+h.data[0][0]+", "+h.data[0][1]+")",{components:[b]}}({line:I,scale:g.endScale}):P&&"none"!==P||this.connector&&this.connector.select(".connector-end").remove();return L.components&&(L.components.forEach(function(h){h.attrs.fill=c.annotation.color,h.attrs.stroke=c.annotation.color}),k=k.concat(L.components)),this.editMode&&0!==E.length&&k.push({type:"handle",handles:E}),k}},{key:"drawNote",value:function drawNote(){var c=this,h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},g=this.annotation.note,m=g.align||h.align||"dynamic",b={bbox:h.bbox,align:m,offset:this.annotation.offset},w=g.lineType||h.lineType,S={};"vertical"===w?S=function(c){var h=c.align,g=c.x,m=void 0===g?0:g,b=c.y,w=void 0===b?0:b,S=c.bbox,M=c.offset;"top"===(h=vr(h,M.y))?w-=S.height:"middle"===h&&(w-=S.height/2);var k=[[m,w],[m,w+S.height]];return{components:[xr({data:k,className:"note-line"})]}}(b):"horizontal"===w&&(S=function(c){var h=c.align,g=c.x,m=void 0===g?0:g,b=c.y,w=void 0===b?0:b,S=c.offset,M=c.bbox;"right"===(h=yr(h,S.x))?m-=M.width:"middle"===h&&(m-=M.width/2);var k=[[m,w],[m+M.width,w]];return{components:[xr({data:k,className:"note-line"})]}}(b));var M=S,k=M.components,T=void 0===k?[]:k,E=M.handles,I=void 0===E?[]:E;if(T.forEach(function(h){h.attrs.stroke=c.annotation.color}),this.editMode){I=this.mapHandles([{x:0,y:0,drag:this.dragNote.bind(this)}]),T.push({type:"handle",handles:I});var P=this.dragNote.bind(this),L=this.dragstarted.bind(this),B=this.dragended.bind(this);this.note.call(drag().container(d3_selection_src_select("g.annotations").node()).on("start",function(c){return L(c)}).on("drag",function(c){return P(c)}).on("end",function(c){return B(c)}))}else this.note.on("mousedown.drag",null);return T}},{key:"drawNoteContent",value:function drawNoteContent(c){var h=this.annotation.note,g=void 0!==h.padding?h.padding:this.notePadding,m=h.orientation||c.orientation||"topBottom",b=h.lineType||c.lineType,w=h.align||c.align||"dynamic";"vertical"===b?m="leftRight":"horizontal"===b&&(m="topBottom");var S=function(c){var h=c.padding,g=void 0===h?0:h,m=c.bbox,b=void 0===m?{x:0,y:0,width:0,height:0}:m,w=c.align,S=c.orientation,M=c.offset,k=void 0===M?{x:0,y:0}:M,T=-b.x,E=0;return-1!==Ar.indexOf(S)?(w=yr(w,k.x),k.y<0&&"topBottom"===S||"top"===S?E-=b.height+g:E+=g,"middle"===w?T-=b.width/2:"right"===w&&(T-=b.width)):-1!==br.indexOf(S)&&(w=vr(w,k.y),k.x<0&&"leftRight"===S||"left"===S?T-=b.width+g:T+=g,"middle"===w?E-=b.height/2:"top"===w&&(E-=b.height)),{x:T,y:E}}({padding:g,bbox:c.bbox,offset:this.annotation.offset,orientation:m,align:w}),M=S.x,k=S.y;return this.offsetCornerX=M+this.annotation.dx,this.offsetCornerY=k+this.annotation.dy,this.note&&this.noteContent.attr("transform","translate("+M+", "+k+")"),[]}},{key:"drawOnScreen",value:function drawOnScreen(c,h){return this.drawOnSVG(c,h)}},{key:"redrawSubject",value:function redrawSubject(){this.subject&&this.drawOnScreen(this.subject,this.drawSubject())}},{key:"redrawConnector",value:function redrawConnector(){this.connector&&this.drawOnScreen(this.connector,this.drawConnector())}},{key:"redrawNote",value:function redrawNote(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getNoteBBox();this.noteContent&&this.drawOnScreen(this.noteContent,this.drawNoteContent({bbox:c})),this.note&&this.drawOnScreen(this.note,this.drawNote({bbox:c}))}},{key:"setPosition",value:function setPosition(){var c=this.annotation.position;this.a.attr("transform","translate("+c.x+", "+c.y+")")}},{key:"clearComponents",value:function clearComponents(){this.subject&&this.subject.select("*").remove(),this.connector&&this.connector.select("*").remove()}},{key:"setOffset",value:function setOffset(){if(this.note){var c=this.annotation.offset;this.note.attr("transform","translate("+c.x+", "+c.y+")")}}},{key:"setPositionWithAccessors",value:function setPositionWithAccessors(c){c&&this.annotation.data&&(this.mapX(c),this.mapY(c)),this.setPosition()}},{key:"setClassName",value:function setClassName(){this.a.attr("class","annotation "+(this.className&&this.className())+" "+(this.editMode?"editable":"")+" "+(this.annotation.className||""))}},{key:"draw",value:function draw(){this.setClassName(),this.setPosition(),this.setOffset(),this.redrawSubject(),this.redrawConnector(),this.redrawNote()}},{key:"dragstarted",value:function dragstarted(){Kn.sourceEvent.stopPropagation(),this.dispatcher&&this.dispatcher.call("dragstart",this.a,this.annotation),this.a.classed("dragging",!0),this.a.selectAll("circle.handle").style("pointer-events","none")}},{key:"dragended",value:function dragended(){this.dispatcher&&this.dispatcher.call("dragend",this.a,this.annotation),this.a.classed("dragging",!1),this.a.selectAll("circle.handle").style("pointer-events","all")}},{key:"dragSubject",value:function dragSubject(){var c=this.annotation.position;c.x+=Kn.dx,c.y+=Kn.dy,this.annotation.position=c}},{key:"dragNote",value:function dragNote(){var c=this.annotation.offset;c.x+=Kn.dx,c.y+=Kn.dy,this.annotation.offset=c}},{key:"mapHandles",value:function mapHandles(c){var h=this;return c.map(function(c){return fr({},c,{start:h.dragstarted.bind(h),end:h.dragended.bind(h)})})}}]),Type}(),kr=function customType(c,h,g){return function(c){function customType(c){classCallCheck(this,customType);var g=possibleConstructorReturn(this,(customType.__proto__||Object.getPrototypeOf(customType)).call(this,c));return g.typeSettings=h,h.disable&&h.disable.forEach(function(c){g[c]&&g[c].remove(),g[c]=void 0,"note"===c&&(g.noteContent=void 0)}),g}return inherits(customType,c),pr(customType,[{key:"className",value:function className(){return""+(h.className||gr(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),"className",this)&&gr(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),"className",this).call(this)||"")}},{key:"drawSubject",value:function drawSubject(c){return this.typeSettings.subject=fr({},h.subject,this.typeSettings.subject),gr(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),"drawSubject",this).call(this,fr({},c,this.typeSettings.subject))}},{key:"drawConnector",value:function drawConnector(c){return this.typeSettings.connector=fr({},h.connector,this.typeSettings.connector),gr(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),"drawConnector",this).call(this,fr({},c,h.connector,this.typeSettings.connector))}},{key:"drawNote",value:function drawNote(c){return this.typeSettings.note=fr({},h.note,this.typeSettings.note),gr(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),"drawNote",this).call(this,fr({},c,h.note,this.typeSettings.note))}},{key:"drawNoteContent",value:function drawNoteContent(c){return gr(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),"drawNoteContent",this).call(this,fr({},c,h.note,this.typeSettings.note))}}],[{key:"init",value:function init(c,h){return gr(customType.__proto__||Object.getPrototypeOf(customType),"init",this).call(this,c,h),g&&(c=g(c,h)),c}}]),customType}(c)},Tr=function(c){function d3NoteText(c){classCallCheck(this,d3NoteText);var h=possibleConstructorReturn(this,(d3NoteText.__proto__||Object.getPrototypeOf(d3NoteText)).call(this,c));return h.textWrap=c.textWrap||120,h.drawText(),h}return inherits(d3NoteText,c),pr(d3NoteText,[{key:"updateTextWrap",value:function updateTextWrap(c){this.textWrap=c,this.drawText()}},{key:"drawText",value:function drawText(){if(this.note){Or(this.note,[this.annotation],"g","annotation-note-content");var c=this.note.select("g.annotation-note-content");Or(c,[this.annotation],"rect","annotation-note-bg"),Or(c,[this.annotation],"text","annotation-note-label"),Or(c,[this.annotation],"text","annotation-note-title");var h={height:0},g=this.a.select("text.annotation-note-label"),m=this.annotation.note&&this.annotation.note.wrap||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrap||this.textWrap,b=this.annotation.note&&this.annotation.note.wrapSplitter||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrapSplitter,w=this.annotation.note&&this.annotation.note.bgPadding||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.bgPadding,S={top:0,bottom:0,left:0,right:0};if("number"==typeof w?S={top:w,bottom:w,left:w,right:w}:w&&"object"===(void 0===w?"undefined":dr(w))&&(S=fr(S,w)),this.annotation.note.title){var M=this.a.select("text.annotation-note-title");M.text(this.annotation.note.title),M.attr("fill",this.annotation.color),M.attr("font-weight","bold"),M.call(jr,m,b),h=M.node().getBBox()}g.text(this.annotation.note.label).attr("dx","0"),g.call(jr,m,b),g.attr("y",1.1*h.height||0),g.attr("fill",this.annotation.color);var k=this.getNoteBBox();this.a.select("rect.annotation-note-bg").attr("width",k.width+S.left+S.right).attr("height",k.height+S.top+S.bottom).attr("x",k.x-S.left).attr("y",-S.top).attr("fill","white").attr("fill-opacity",0)}}}]),d3NoteText}(Mr),Er=kr(Tr,{className:"label",note:{align:"middle"}}),Ir=kr(Tr,{className:"callout",note:{lineType:"horizontal"}}),Pr=(kr(Ir,{className:"callout elbow",connector:{type:"elbow"}}),kr(Ir,{className:"callout curve",connector:{type:"curve"}}),kr(Mr,{className:"badge",subject:{type:"badge"},disable:["connector","note"]}),kr(Tr,{className:"callout circle",subject:{type:"circle"},note:{lineType:"horizontal"},connector:{type:"elbow"}})),Lr=kr(Tr,{className:"callout rect",subject:{type:"rect"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),Fr=function(c){function ThresholdMap(){return classCallCheck(this,ThresholdMap),possibleConstructorReturn(this,(ThresholdMap.__proto__||Object.getPrototypeOf(ThresholdMap)).apply(this,arguments))}return inherits(ThresholdMap,c),pr(ThresholdMap,[{key:"mapY",value:function mapY(c){gr(ThresholdMap.prototype.__proto__||Object.getPrototypeOf(ThresholdMap.prototype),"mapY",this).call(this,c);var h=this.annotation;(h.subject.x1||h.subject.x2)&&h.data&&c.y&&(h.y=c.y(h.data)),!h.subject.x1&&!h.subject.x2||h.x||(h.x=h.subject.x1||h.subject.x2)}},{key:"mapX",value:function mapX(c){gr(ThresholdMap.prototype.__proto__||Object.getPrototypeOf(ThresholdMap.prototype),"mapX",this).call(this,c);var h=this.annotation;(h.subject.y1||h.subject.y2)&&h.data&&c.x&&(h.x=c.x(h.data)),!h.subject.y1&&!h.subject.y2||h.y||(h.y=h.subject.y1||h.subject.y2)}}]),ThresholdMap}(Ir),Br=kr(Fr,{className:"callout xythreshold",subject:{type:"threshold"}}),Or=function newWithClass(c,h,g,m,b){var w=c.selectAll(g+"."+(b||m)).data(h);return w.enter().append(g).merge(w).attr("class",m),w.exit().remove(),c},zr=function addHandlers(c,h,g){var m=g.component,b=g.name;m&&m.on("mouseover.annotations",function(){c.call(b+"over",m,h)}).on("mouseout.annotations",function(){return c.call(b+"out",m,h)}).on("click.annotations",function(){return c.call(b+"click",m,h)})},jr=function wrap(c,h,g){var m=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1.2;c.each(function(){for(var c=d3_selection_src_select(this),b=c.text().split(g||/[ \t\r\n]+/).reverse().filter(function(c){return""!==c}),w=void 0,S=[],M=c.text(null).append("tspan").attr("x",0).attr("dy","0.8em");w=b.pop();)S.push(w),M.text(S.join(" ")),M.node().getComputedTextLength()>h&&S.length>1&&(S.pop(),M.text(S.join(" ")),S=[w],M=c.append("tspan").attr("x",0).attr("dy",m+"em").text(w))})},Dr=function bboxWithoutHandles(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:":not(.handle)";return c?c.selectAll(h).nodes().reduce(function(c,h){var g=h.getBBox();c.x=Math.min(c.x,g.x),c.y=Math.min(c.y,g.y),c.width=Math.max(c.width,g.width);var m=h&&h.attributes&&h.attributes.y;return c.height=Math.max(c.height,(m&&parseFloat(m.value)||0)+g.height),c},{x:0,y:0,width:0,height:0}):{x:0,y:0,width:0,height:0}};function annotation(){var c=[],h=void 0,g=void 0,m=[],b={},w={},S=!1,M=void 0,k=Ir,T=void 0,E=void 0,I=tr("subjectover","subjectout","subjectclick","connectorover","connectorout","connectorclick","noteover","noteout","noteclick","dragend","dragstart"),P=void 0,L=function annotation(g){P=g,S||g.selectAll("circle.handle").remove();var L=c.map(function(c){return c.type||(c.type=k),c.disable||(c.disable=m),new _r(c)});h=h||new mr({annotations:L,accessors:b,accessorsInverse:w,ids:M}),g.selectAll("g").data([h]).enter().append("g").attr("class","annotations");var B=g.select("g.annotations");Or(B,h.annotations,"g","annotation");var annotation=B.selectAll("g.annotation");annotation.each(function(c){var h=d3_selection_src_select(this);h.attr("class","annotation"),Or(h,[c],"g","annotation-connector"),Or(h,[c],"g","annotation-subject"),Or(h,[c],"g","annotation-note"),Or(h.select("g.annotation-note"),[c],"g","annotation-note-content"),c.type="[object Object]"===c.type.toString()?c.type:new c.type({a:h,annotation:c,textWrap:T,notePadding:E,editMode:S,dispatcher:I,accessors:b}),c.type.draw(),c.type.drawText&&c.type.drawText()})};return L.json=function(){return console.log("Annotations JSON was copied to your clipboard. Please note the annotation type is not JSON compatible. It appears in the objects array in the console, but not in the copied JSON.",h.json),window.copy(JSON.stringify(h.json.map(function(c){return delete c.type,c}))),L},L.update=function(){return c&&h&&(c=h.annotations.map(function(c){return c.type.draw(),c})),L},L.updateText=function(){return h&&(h.updateText(T),c=h.annotations),L},L.updatedAccessors=function(){return h.setPositionWithAccessors(),c=h.annotations,L},L.disable=function(g){return arguments.length?(m=g,h&&(h.updateDisable(m),c=h.annotations),L):m},L.textWrap=function(g){return arguments.length?(T=g,h&&(h.updateTextWrap(T),c=h.annotations),L):T},L.notePadding=function(g){return arguments.length?(E=g,h&&(h.updateNotePadding(E),c=h.annotations),L):E},L.type=function(g,m){return arguments.length?(k=g,h&&(h.annotations.map(function(c){c.type.note&&c.type.note.selectAll("*:not(.annotation-note-content)").remove(),c.type.noteContent&&c.type.noteContent.selectAll("*").remove(),c.type.subject&&c.type.subject.selectAll("*").remove(),c.type.connector&&c.type.connector.selectAll("*").remove(),c.type.typeSettings={},c.type=k,c.subject=m&&m.subject||c.subject,c.connector=m&&m.connector||c.connector,c.note=m&&m.note||c.note}),c=h.annotations),L):k},L.annotations=function(g){if(!arguments.length)return h&&h.annotations||c;(c=g,h&&h.annotations)&&(c.some(function(c){return!c.type||"[object Object]"!==c.type.toString()})?(h=null,L(P)):h.annotations=c);return L},L.context=function(c){return arguments.length?(g=c,L):g},L.accessors=function(c){return arguments.length?(b=c,L):b},L.accessorsInverse=function(c){return arguments.length?(w=c,L):w},L.ids=function(c){return arguments.length?(M=c,L):M},L.editMode=function(g){return arguments.length?(S=g,P&&P.selectAll("g.annotation").classed("editable",S),h&&(h.editMode(S),c=h.annotations),L):S},L.collection=function(c){return arguments.length?(h=c,L):h},L.on=function(){var c=I.on.apply(I,arguments);return c===I?L:c},L}function ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function _objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}function appendAnnotations(c){if(c.svg_){var h=c.svg_.select("#em-zoom-group-"+c.svgId_);h.selectAll(".em-annotations").remove();var g=c.annotations_;if(g){var m={annotationLabel:Er,annotationCallout:Ir,annotationCalloutRect:Lr,annotationCalloutCircle:Pr,annotationXYThreshold:Br},b=g.annotations.map(function(c){var h=m[c.type]||Er;return _objectSpread(_objectSpread({},c),{},{type:h})}),w=annotation().type(Er).annotations(b).editMode(g.editMode);h.append("g").attr("id","em-annotations").attr("class","em-annotations").call(w)}}}var Nr=function addLabelsToMap(c,h){var g,m;c.labels_.config||(c.labels_.config=Hr),c.labels_.statLabelsPositions||(c.labels_.statLabelsPositions=Ur),c._statLabelFormatter=c.labels_.valuesFormatter?c.labels_.valuesFormatter:Ft;var b=h.select("#em-labels"),w=b.empty()?h.append("g").attr("id","em-labels").attr("class","em-labels"):b;null!==(g=c.labels_)&&void 0!==g&&g.values&&"ps"!==c._mapType&&Wr(c,w);var S=(null===(m=c.labels_)||void 0===m?void 0:m.labels)||Hr["".concat(c.geo,"_").concat(c.proj_,".cc")];if(S){var M,k=ensureGroup(w,"em-label-shadows"),T=ensureGroup(w,"em-labels");if(null!==(M=c.labels_)&&void 0!==M&&M.shadows)k.selectAll("text").data(S).enter().append("text").attr("id",function(c){return"em-label-shadow-"+c.text.replace(/\s+/g,"-")}).attr("class",function(c){return"em-label-shadow em-label-shadow-"+c.class}).attr("x",function(h){return h.rotate?0:c._projection([h.x,h.y])[0]}).attr("y",function(h){return h.rotate?0:c._projection([h.x,h.y])[1]}).attr("dy",-7).attr("transform",function(h){if(h.rotate){var g=c._projection([h.x,h.y]),m=g[0],b=g[1];return"translate(".concat(m,",").concat(b,") rotate(").concat(h.rotate,")")}return"rotate(0)"}).text(function(c){return c.text});T.selectAll("text").data(S).enter().append("text").attr("id",function(c){return"em-label-"+c.text.replace(/\s+/g,"-")}).attr("class",function(c){return"em-label em-label-"+c.class}).attr("x",function(h){return h.rotate?0:c._projection([h.x,h.y])[0]}).attr("y",function(h){return h.rotate?0:c._projection([h.x,h.y])[1]}).attr("dy",-7).attr("transform",function(h){if(h.rotate){var g=c._projection([h.x,h.y]),m=g[0],b=g[1];return"translate(".concat(m,",").concat(b,") rotate(").concat(h.rotate,")")}return"rotate(0)"}).text(function(c){return c.text})}};var Rr=function updateValuesLabels(c){var h,g,m;if(c){c.svg_.selectAll("g.em-stat-label > *").remove(),c.svg_.selectAll("g.em-stat-label-shadow > *").remove();var b=c.svg_.selectAll("g.em-stat-label"),w=null!==(h=c.labels_)&&void 0!==h&&h.statLabelsFilterFunction?null===(g=c.labels_)||void 0===g?void 0:g.statLabelsFilterFunction:qr,S=c.statData();return b.filter(function(h){return w(h,c)}).each(function(h){var g=src_select(this),m=Gr(h,S,c);c.labels_.backgrounds&&function appendRect(c,h){var g=5,m=2,b=h.append("text").attr("visibility","hidden").text(c).node().getBBox(),w=b.width,S=b.height;h.select('text[visibility="hidden"]').remove();var M=-w/2-g,k=-S/2-m;h.append("rect").attr("x",M).attr("y",k).attr("width",w+2*g).attr("height",S+2*m).attr("class","em-label-background")}(m,g),g.append("text").text(m).attr("class","em-stat-label-text")}),null!==(m=c.labels_)&&void 0!==m&&m.shadows&&c.svg_.selectAll("g.em-stat-label-shadow").filter(function(h){return w(h,c)}).append("text").text(function(h){return Gr(h,S,c)}),c}console.warn("No map specified")},Gr=function statLabelsTextFunction(c,h,g){if(h&&null!=h&&h.get){var m=h.get(c.properties.id);if(!m||!m.value&&0!==m&&0!==m.value)return"";if(":"!==m.value)return g._statLabelFormatter?g._statLabelFormatter(m.value):Ft(m.value)}},qr=function defaultStatLabelFilter(c,h){var g=h.statData().get(c.properties.id);return!(!g||!g.value&&0!==g&&0!==g.value)},Wr=function appendStatLabelCentroidsToMap(c,h){var g,m=ensureGroup(h,"em-stat-labels-shadows"),b=ensureGroup(h,"em-stat-labels"),w=c.Geometries.getAllRegionFeatures(),S=w.filter(function(c,h,g){return h===g.findIndex(function(h){return h.properties.id===c.properties.id})});b.selectAll("g").data(S).enter().append("g").attr("transform",function(h){if(c.labels_.statLabelsPositions[h.properties.id]){var g=c.labels_.statLabelsPositions[h.properties.id],m=c._projection([g.x,g.y]),b=m[0].toFixed(3),w=m[1].toFixed(3);return"translate(".concat(b,",").concat(w,")")}var S=c._pathFunction.centroid(h);return c.labels_.processValueLabelCentroids&&(S=c.labels_.processValueLabelCentroids(h,S)),"translate("+S+")"}).attr("class","em-stat-label"),null!==(g=c.labels_)&&void 0!==g&&g.shadows&&m.selectAll("g").data(w).enter().append("g").attr("transform",function(h){if(c.labels_.statLabelsPositions[h.properties.id]){var g=c._projection([c.labels_.statLabelsPositions[h.properties.id].x,c.labels_.statLabelsPositions[h.properties.id].y]),m=g[0].toFixed(3),b=g[1].toFixed(3);return"translate(".concat(m,",").concat(b,")")}var w=c._pathFunction.centroid(h);return c.labels_.processValueLabelCentroids&&(w=c.labels_.processValueLabelCentroids(h,w)),"translate("+w+")"}).attr("class","em-stat-label-shadow")},Hr={EUR_3035:{cc:[{text:"AL",x:515e4,y:206e4,class:"cc",size:7},{text:"AT",x:467e4,y:269e4,class:"cc",size:18},{text:"BE",x:393e4,y:301e4,class:"cc",size:17},{text:"BG",x:5567e3,y:225e4,class:"cc",size:22},{text:"HR",x:484e4,y:248e4,class:"cc",size:10},{text:"CY",x:6426e3,y:148e4,class:"cc",size:10},{text:"CZ",x:4707e3,y:292e4,class:"cc",size:18},{text:"DK",x:4316e3,y:3621e3,class:"cc",size:20},{text:"EE",x:522e4,y:399e4,class:"cc",size:12},{text:"FI",x:515e4,y:4424e3,class:"cc",size:20},{text:"FR",x:3767740,y:2662817,class:"cc",size:22},{text:"DE",x:4347284,y:3093276,class:"cc",size:22},{text:"EL",x:537e4,y:175e4,class:"cc",size:22},{text:"HU",x:502e4,y:263e4,class:"cc",size:17},{text:"IS",x:304e4,y:4833e3,class:"cc",size:10},{text:"IE",x:3136e3,y:3394e3,class:"cc",size:17},{text:"IT",x:4469967,y:2181963,class:"cc",size:22},{text:"LV",x:529e4,y:38e5,class:"cc",size:12},{text:"LT",x:519e4,y:363e4,class:"cc",size:12},{text:"LU",x:412e4,y:294e4,class:"cc",size:12},{text:"MT",x:4731e3,y:13e5,class:"cc",size:10},{text:"ME",x:5073e3,y:2185e3,class:"cc",size:7},{text:"GE",x:6942680,y:266e4,class:"cc"},{text:"UA",x:589e4,y:305e4,class:"cc"},{text:"BA",x:4949262,y:2338688,class:"cc"},{text:"MD",x:574e4,y:279e4,class:"cc"},{text:"MK",x:53e5,y:208e4,class:"cc",size:10},{text:"NL",x:402e4,y:3208e3,class:"cc",size:17},{text:"NO",x:43e5,y:4147e3,class:"cc",size:20},{text:"PL",x:4964e3,y:32e5,class:"cc",size:22},{text:"PT",x:277e4,y:199e4,class:"cc",size:18},{text:"RO",x:5451e3,y:26e5,class:"cc",size:22},{text:"RS",x:52e5,y:235e4,class:"cc",size:10},{text:"SK",x:504e4,y:286e4,class:"cc",size:12},{text:"SI",x:4675e3,y:25e5,class:"cc",size:10},{text:"ES",x:3160096,y:19e5,class:"cc",size:22},{text:"SE",x:463e4,y:4e6,class:"cc",size:20},{text:"CH",x:417e4,y:26e5,class:"cc",size:16},{text:"TR",x:651e4,y:21e5,class:"cc",size:22},{text:"UK",x:3558e3,y:325e4,class:"cc",size:17}],en:[{text:"MEDITERRANEAN SEA",x:398e4,y:16e5,class:"seas",size:12,letterSpacing:7},{text:"ATLANTIC OCEAN",x:282e4,y:254e4,class:"seas",size:12,letterSpacing:2},{text:"NORTH SEA",x:3915e3,y:37e5,class:"seas",size:12},{text:"BALTIC SEA",x:49e5,y:373e4,class:"seas",size:10,rotate:-50},{text:"NORWEGIAN SEA",x:385e4,y:48e5,class:"seas",size:12,letterSpacing:1},{text:"BLACK SEA",x:63e5,y:25e5,class:"seas",size:12,letterSpacing:4},{text:"ALBANIA",cc:"AL",x:51e5,y:203e4,class:"countries",size:7,rotate:70},{text:"AUSTRIA",cc:"AT",x:467e4,y:2629e3,class:"countries",size:10},{text:"BELGIUM",cc:"BE",x:39e5,y:303e4,class:"countries",size:7,rotate:30},{text:"BULGARIA",cc:"BG",x:5567e3,y:2256e3,class:"countries",size:12},{text:"CROATIA",cc:"HR",x:4876e3,y:2455e3,class:"countries",size:7},{text:"CYPRUS",cc:"CY",x:6426e3,y:148e4,class:"countries",size:10},{text:"CZECHIA",cc:"CZ",x:4707e3,y:2885e3,class:"countries",size:12},{text:"DENMARK",cc:"DK",x:4316e3,y:3621e3,class:"countries",size:10},{text:"ESTONIA",cc:"EE",x:522e4,y:399e4,class:"countries",size:7},{text:"FINLAND",cc:"FI",x:515e4,y:4424e3,class:"countries",size:12},{text:"FRANCE",cc:"FR",x:3767740,y:2662817,class:"countries",size:12},{text:"GERMANY",cc:"DE",x:4347284,y:3093276,class:"countries",size:12},{text:"GREECE",cc:"EL",x:547e4,y:186e4,class:"countries",size:12},{text:"HUNGARY",cc:"HU",x:502e4,y:263e4,class:"countries",size:10},{text:"ICELAND",cc:"IS",x:304e4,y:4833e3,class:"countries",size:10},{text:"IRELAND",cc:"IE",x:3136e3,y:3394e3,class:"countries",size:10},{text:"ITALY",cc:"IT",x:4469967,y:2181963,class:"countries",size:12},{text:"LATVIA",cc:"LV",x:529e4,y:38e5,class:"countries",size:7},{text:"LITHUANIA",cc:"LT",x:519e4,y:363e4,class:"countries",size:7},{text:"LUX.",cc:"LU",x:416e4,y:291e4,class:"countries",size:7},{text:"MALTA",cc:"MT",x:4731e3,y:133e4,class:"countries",size:7},{text:"MONT.",cc:"ME",x:5073e3,y:2185e3,class:"countries",size:7},{text:"N. MACEDONIA",cc:"MK",x:54e5,y:2082e3,class:"countries",size:7},{text:"NETHERLANDS",cc:"NL",x:3977e3,y:3208e3,class:"countries",size:7},{text:"NORWAY",cc:"NO",x:433e4,y:4147e3,class:"countries",size:12,rotate:-75},{text:"POLAND",cc:"PL",x:4964e3,y:3269e3,class:"countries",size:12},{text:"PORTUGAL",cc:"PT",x:283e4,y:199e4,class:"countries",size:10,rotate:-75},{text:"ROMANIA",cc:"RO",x:5451e3,y:26e5,class:"countries",size:12},{text:"SERBIA",cc:"RS",x:52e5,y:23e5,class:"countries",size:7},{text:"SLOVAKIA",cc:"SK",x:504e4,y:2835e3,class:"countries",size:7,rotate:-30},{text:"SLOVENIA",cc:"SI",x:4735e3,y:2522e3,class:"countries",size:7,rotate:-30},{text:"SPAIN",cc:"ES",x:3160096,y:185e4,class:"countries",size:12},{text:"SWEDEN",cc:"SE",x:463e4,y:41e5,class:"countries",size:12,rotate:-75},{text:"SWITZERLAND",cc:"CH",x:42e5,y:2564e3,class:"countries",size:7},{text:"TÜRKIYE",cc:"TR",x:651e4,y:21e5,class:"countries",size:12},{text:"U.K.",cc:"UK",x:3558e3,y:325e4,class:"countries",size:12},{text:"UKRAINE",cc:"UA",x:589e4,y:305e4,class:"countries",size:12},{text:"MOLDOVA",class:"countries",cc:"MD",x:574e4,y:279e4,size:12},{text:"GEORGIA",class:"countries",cc:"GE",x:6942680,y:266e4,size:12}]},IC_32628:{cc:[{text:"ES",x:420468,y:3180647,class:"cc",size:12}],en:[{text:"Canary Islands",x:420468,y:3180647,class:"countries",size:12}]},GP_32620:{cc:[{text:"FR",x:667e3,y:174e4,class:"cc",size:12}],en:[{text:"Guadeloupe",x:7e5,y:181e4,class:"countries",size:12}]},MQ_32620:{cc:[{text:"FR",x:716521,y:1621322,class:"cc",size:12}],en:[{text:"Martinique",x:716521,y:1621322,class:"countries",size:12}]},GF_32622:{cc:[{text:"FR",x:266852,y:444074,class:"cc",size:12}],en:[{text:"Guyane",x:266852,y:444074,class:"countries",size:12}]},RE_32740:{cc:[{text:"FR",x:348011,y:768e4,class:"cc",size:10}],en:[{text:"Réunion",x:348011,y:768e4,class:"countries",size:10}]},YT_32738:{cc:[{text:"FR",x:516549,y:8593920,class:"cc",size:10}],en:[{text:"Mayotte",x:516549,y:8593920,class:"countries",size:10}]},MT_3035:{cc:[{text:"MT",x:4719755,y:1410701,class:"cc",size:10}],en:[{text:"Malta",x:4719755,y:1410701,class:"countries",size:10}]},PT20_32626:{cc:[{text:"PT",x:397418,y:432e4,class:"cc",size:10}],en:[{text:"Azores",x:397418,y:432e4,class:"countries",size:10}]},PT30_32628:{cc:[{text:"PT",x:333586,y:3624e3,class:"cc",size:10,rotate:30}],en:[{text:"Madeira",x:333586,y:3624e3,class:"countries",size:10,rotate:30}]},LI_3035:{cc:[{text:"LI",x:4287060,y:266e4,class:"cc",size:12}],en:[{text:"Liechtenstein",x:4287060,y:2679e3,class:"countries",size:7}]},IS_3035:{cc:[{text:"IS",x:3011804,y:496e4,class:"cc",size:12}],en:[{text:"Iceland",x:3011804,y:496e4,class:"countries",size:12}]},SJ_SV_3035:{cc:[{text:"NO",x:457e4,y:626e4,class:"cc",size:10}],en:[{text:"Svalbard",x:457e4,y:626e4,class:"countries",size:10}]},SJ_JM_3035:{cc:[{text:"NO",x:3647762,y:5420300,class:"cc",size:10}],en:[{text:"Jan Mayen",x:3647762,y:5420300,class:"countries",size:7}]},CARIB_32620:{cc:[{text:"FR",x:7e5,y:181e4,class:"cc",size:10},{text:"FR",x:64e4,y:159e4,class:"cc",size:10},{text:"FR",x:54e4,y:1962e3,class:"cc",size:7}],en:[{text:"Guadeloupe",x:7e5,y:181e4,class:"countries",size:10},{text:"Martinique",x:57e4,y:159e4,class:"countries",size:10},{text:"Saint Martin",x:597e3,y:1962e3,class:"countries",size:7}]},WORLD_54030:{en:[{text:"NORTH ATLANTIC",x:-45,y:25,class:"seas",size:10,letterSpacing:1},{text:"SOUTH ATLANTIC",x:-15,y:-25,class:"seas",size:10,letterSpacing:1},{text:"SOUTH PACIFIC",x:-126,y:-25,class:"seas",size:10,letterSpacing:1},{text:"NORTH",x:-136,y:25,class:"seas",size:10,letterSpacing:1},{text:"PACIFIC",x:-134,y:20,class:"seas",size:10,letterSpacing:1},{text:"INDIAN OCEAN",x:80,y:-25,class:"seas",size:10,letterSpacing:1},{text:"SOUTHERN OCEAN",x:-5,y:-67,class:"seas",size:10,letterSpacing:6}]}},Ur={AL:{x:515e4,y:2e6},AT:{x:467e4,y:274e4},BE:{x:393e4,y:306e4},BG:{x:5567e3,y:23e5},HR:{x:4657718,y:2400243},CY:{x:6426e3,y:157e4},CH:{x:417e4,y:26e5},CZ:{x:4707e3,y:295e4},DK:{x:4316e3,y:3621e3},EE:{x:522e4,y:405e4},FI:{x:515e4,y:4424e3},FR:{x:3767740,y:2662817},DE:{x:4347284,y:3093276},EL:{x:537e4,y:175e4},HU:{x:502e4,y:267e4},IS:{x:304e4,y:4833e3},IE:{x:3136e3,y:3394e3},IT:{x:45e5,y:2181963},LV:{x:529e4,y:384e4},LT:{x:519e4,y:367e4},LU:{x:412e4,y:294e4},MT:{x:488e4,y:148e4},GE:{x:6912680,y:2696554},UA:{x:5865507,y:3130158},BA:{x:4959262,y:2368688},MD:{x:5736016,y:2835957},ME:{x:5073e3,y:223e4},MK:{x:53e5,y:213e4},NL:{x:402e4,y:3208e3},NO:{x:43e5,y:4147e3},PL:{x:4964e3,y:32e5},PT:{x:276e4,y:199e4},RO:{x:5451e3,y:26e5},RS:{x:52e5,y:237e4},SK:{x:504e4,y:289e4},SI:{x:466e4,y:255e4},ES:{x:32e5,y:2e6},SE:{x:463e4,y:4e6},TR:{x:651e4,y:21e5},UK:{x:3558e3,y:325e4},RU:{x:6842086,y:3230517}};function responseJson(c){if(!c.ok)throw new Error(c.status+" "+c.statusText);if(204!==c.status&&205!==c.status)return c.json()}function json(c,h){return fetch(c,h).then(responseJson)}function topojson_client_src_identity(c){return c}function feature(c,h){return"string"==typeof h&&(h=c.objects[h]),"GeometryCollection"===h.type?{type:"FeatureCollection",features:h.geometries.map(function(h){return feature_feature(c,h)})}:feature_feature(c,h)}function feature_feature(c,h){var g=h.id,m=h.bbox,b=null==h.properties?{}:h.properties,w=function feature_object(c,h){var g=function topojson_client_src_transform(c){if(null==c)return topojson_client_src_identity;var h,g,m=c.scale[0],b=c.scale[1],w=c.translate[0],S=c.translate[1];return function(c,M){M||(h=g=0);var k=2,T=c.length,E=new Array(T);for(E[0]=(h+=c[0])*m+w,E[1]=(g+=c[1])*b+S;k<T;)E[k]=c[k],++k;return E}}(c.transform),m=c.arcs;function arc(c,h){h.length&&h.pop();for(var b=m[c<0?~c:c],w=0,S=b.length;w<S;++w)h.push(g(b[w],w));c<0&&function reverse(c,h){for(var g,m=c.length,b=m-h;b<--m;)g=c[b],c[b++]=c[m],c[m]=g}(h,S)}function point(c){return g(c)}function line(c){for(var h=[],g=0,m=c.length;g<m;++g)arc(c[g],h);return h.length<2&&h.push(h[0]),h}function ring(c){for(var h=line(c);h.length<4;)h.push(h[0]);return h}function polygon(c){return c.map(ring)}function geometry(c){var h,g=c.type;switch(g){case"GeometryCollection":return{type:g,geometries:c.geometries.map(geometry)};case"Point":h=point(c.coordinates);break;case"MultiPoint":h=c.coordinates.map(point);break;case"LineString":h=line(c.arcs);break;case"MultiLineString":h=c.arcs.map(line);break;case"Polygon":h=polygon(c.arcs);break;case"MultiPolygon":h=c.arcs.map(polygon);break;default:return null}return{type:g,coordinates:h}}return geometry(h)}(c,h);return null==g&&null==m?{type:"Feature",properties:b,geometry:w}:null==m?{type:"Feature",id:g,properties:b,geometry:w}:{type:"Feature",id:g,bbox:m,properties:b,geometry:w}}var Yr={2021:{3035:{"03M":{type:"Topology",arcs:[[[3061,1303],[-152,-59],[-32,-66],[-65,72],[-96,7],[-16,59],[-64,19],[-56,-39],[-120,39],[-184,-19],[-16,26],[32,52],[-16,72],[24,40],[8,183]],[[2885,0],[-8,46],[-65,85],[-40,-7],[-40,40],[0,111],[80,13],[25,46],[72,13],[40,98],[-56,118],[144,196],[-24,79],[88,59],[-24,98],[-8,20],[24,39],[8,52],[48,72],[-88,125]],[[825,2638],[-112,-98],[-72,-7],[-88,-118],[-176,-39],[56,-91],[88,-33],[24,-53],[56,-39],[24,-91],[-56,-46],[24,-105],[-56,-92],[-104,0],[-48,-104],[-16,-40],[-57,7],[-40,-53],[-16,-78],[113,-118],[-97,-65],[-88,-99],[-80,20],[-80,-39],[-24,-13]],[[1098,2304],[-193,66],[24,39],[-16,39],[65,13],[0,33],[-65,79],[-88,65]],[[2308,1689],[-153,-20],[-64,59],[-40,7],[-96,-27],[-104,138],[-8,92],[-32,78],[-64,26],[-32,-59],[-24,0],[-56,86],[-40,137],[-25,65],[-56,0],[-56,46],[-64,-72],[-120,53],[-88,-40],[-88,46]]],transform:{scale:[37.761044752777565,38.54734205626113],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:1000004,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:1000005,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:1000001,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:1000002,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:1000003,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"10M":{type:"Topology",arcs:[[[962,0],[-29,75],[48,131],[21,35],[11,38],[32,117],[-24,44]],[[1021,440],[-64,-29],[-70,36],[-120,2],[3,121]],[[770,570],[-126,16],[-40,91],[-45,4],[-51,93],[-142,4]],[[275,891],[-131,-99],[30,-36],[24,-31],[-6,-86],[-98,-86],[13,-64],[-27,-38],[-80,-31]],[[366,778],[-37,22],[-54,91]]],transform:{scale:[113.2099448513097,114.12782081303801],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:1000005,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[1],properties:{id:1000004,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[2],properties:{id:1000003,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[3],properties:{id:1000001,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[4],properties:{id:1000002,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}}]}}},"20M":{type:"Topology",arcs:[[[536,0],[-24,45],[15,30],[45,92],[-1,44],[-2,37]],[[569,248],[-130,9],[-10,64]],[[429,321],[-64,10],[-78,94],[-83,13]],[[153,502],[-73,-51],[26,-84],[-48,-53],[-3,-52],[-55,-25]],[[204,438],[-51,64]]],transform:{scale:[203.12309601494124,202.56551463031246],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:1000005,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[1],properties:{id:1000004,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[2],properties:{id:1000003,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[3],properties:{id:1000001,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[4],properties:{id:1000002,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}}]}}},"60M":{type:"Topology",arcs:[[[310,138],[-36,-2],[-40,42]],[[234,178],[-123,65]],[[84,278],[-84,-147]],[[111,243],[-27,35]],[[292,0],[18,138]]],transform:{scale:[372.84281730215633,364.87611898580536],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:1000004,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[1],properties:{id:1000003,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[2],properties:{id:1000001,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[3],properties:{id:1000002,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[4],properties:{id:1000005,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}}]}}}},4326:{"03M":{type:"Topology",arcs:[[[1900,1275],[-30,27],[-27,-13],[-34,23],[-87,6],[25,59],[1,70],[20,34],[24,167]],[[1792,1648],[-116,1],[-62,77],[-89,-8],[-60,148],[7,86],[-4,15],[-13,60],[-45,28],[-33,-48],[-26,4],[-31,142],[-11,53],[5,43],[-19,44],[-39,8],[-40,49],[-52,-59],[-93,71],[-38,-6],[-16,-26]],[[945,2388],[-54,27],[-20,28],[-22,-3],[-17,22],[-25,1],[-10,10],[4,17],[27,14],[-15,29],[1,16],[68,1],[-8,16],[-5,30],[-14,29],[-27,42],[-25,22],[-30,41]],[[773,2730],[-89,-69],[-64,-4],[-82,-92],[-133,-15],[27,-93],[64,-43],[16,-50],[38,-44],[9,-75],[-48,-51],[5,-41],[6,-50],[-52,-84],[-78,14],[-35,-66],[-33,-61],[-45,11],[-35,-42],[-18,-72],[33,-71],[48,-55]],[[1017,2330],[-72,58]],[[307,1677],[-36,-12],[-25,-21],[-26,-10],[-76,-90],[-17,4],[-30,31],[-52,-14],[-26,-23],[-19,1]],[[2319,1185],[-116,-32],[-39,-52],[-42,70],[-68,23],[-12,58],[-43,23],[-42,-23],[-57,23]],[[2044,0],[-4,43],[-38,82],[-34,9],[-24,43],[13,97],[61,4],[32,41],[49,0],[37,82],[-26,118],[130,167],[-8,73],[74,46],[-2,18],[-9,92],[24,35],[7,49],[48,52],[-55,134]]],transform:{scale:[.0006038339283908974,.00036983475567765975],translate:[20.35292839300007,42.26281764300006]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000002,co:"F",oth:"F"}},{type:"LineString",arcs:[1],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000001,co:"F",oth:"F"}},{type:"LineString",arcs:[2],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000003,co:"F",oth:"F"}},{type:"LineString",arcs:[3],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000004,co:"F",oth:"F"}},{type:"LineString",arcs:[4],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000005,co:"F",oth:"F"}},{type:"LineString",arcs:[5],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000006,co:"F",oth:"F"}},{type:"LineString",arcs:[6],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000007,co:"F",oth:"F"}},{type:"LineString",arcs:[7],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000008,co:"F",oth:"F"}}]}}},"10M":{type:"Topology",arcs:[[[659,439],[-54,17],[17,111]],[[622,567],[-93,31],[-25,92],[-36,11],[-29,97],[-23,1],[-63,3]],[[328,822],[-33,74],[-27,44]],[[268,940],[-72,-44],[-38,-31],[27,-86],[-14,-65],[-81,-78],[16,-58]],[[353,802],[-25,20]],[[106,578],[-41,-19],[-65,-28]],[[805,408],[-54,-21],[-92,52]],[[709,0],[-22,72],[0,17],[40,36],[18,67],[53,101],[16,64],[-9,51]]],transform:{scale:[.001740521547911524,.0010740945563829907],translate:[20.35292839300007,42.26281764300006]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000002,co:"F",oth:"F"}},{type:"LineString",arcs:[1],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000003,co:"F",oth:"F"}},{type:"LineString",arcs:[2],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000004,co:"F",oth:"F"}},{type:"LineString",arcs:[3],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000005,co:"F",oth:"F"}},{type:"LineString",arcs:[4],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000006,co:"F",oth:"F"}},{type:"LineString",arcs:[5],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000007,co:"F",oth:"F"}},{type:"LineString",arcs:[6],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000001,co:"F",oth:"F"}},{type:"LineString",arcs:[7],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000008,co:"F",oth:"F"}}]}}},"20M":{type:"Topology",arcs:[[[380,252],[-21,26],[0,48]],[[359,326],[-49,17],[-56,107],[-51,11]],[[189,472],[-34,68]],[[155,540],[-66,-39],[18,-66],[-54,-68],[8,-35]],[[61,332],[-21,-13],[-10,-12],[-13,5],[-17,-7]],[[464,234],[-84,18]],[[409,0],[-14,46],[61,110],[8,78]]],transform:{scale:[.003018276831896498,.0018697201537037245],translate:[20.35292839300007,42.26281764300006]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000002,co:"F",oth:"F"}},{type:"LineString",arcs:[1],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000003,co:"F",oth:"F"}},{type:"LineString",arcs:[2],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000004,co:"F",oth:"F"}},{type:"LineString",arcs:[3],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000005,co:"F",oth:"F"}},{type:"LineString",arcs:[4],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000007,co:"F",oth:"F"}},{type:"LineString",arcs:[5],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000001,co:"F",oth:"F"}},{type:"LineString",arcs:[6],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000008,co:"F",oth:"F"}}]}}},"60M":{type:"Topology",arcs:[[[235,156],[-13,46]],[[222,202],[-96,84]],[[117,293],[-21,42]],[[96,335],[-58,-129]],[[126,286],[-9,7]],[[38,206],[-38,-17]],[[287,145],[-52,11]],[[253,0],[34,145]]],transform:{scale:[.004879722822299564,.0030138772626866006],translate:[20.352928393000074,42.26281764300006]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000002,co:"F",oth:"F"}},{type:"LineString",arcs:[1],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000003,co:"F",oth:"F"}},{type:"LineString",arcs:[2],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000004,co:"F",oth:"F"}},{type:"LineString",arcs:[3],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000005,co:"F",oth:"F"}},{type:"LineString",arcs:[4],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000006,co:"F",oth:"F"}},{type:"LineString",arcs:[5],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000001,co:"F",oth:"F"}},{type:"LineString",arcs:[6],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000007,co:"F",oth:"F"}},{type:"LineString",arcs:[7],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000008,co:"F",oth:"F"}}]}}}}},2024:{3035:{"03M":{type:"Topology",arcs:[[[728,1508],[-48,12],[-22,18],[-15,-5],[-16,13],[-22,-4],[-10,8],[0,13],[21,13],[-16,17],[0,13],[58,9],[-5,8],[-10,22],[-16,17],[-27,25],[-21,13],[-32,26]],[[1912,0],[-6,30],[-42,51],[-32,0],[-21,30],[0,69],[53,8],[21,35],[43,4],[26,60],[-37,81],[96,129],[-16,51],[58,43],[0,9],[-21,64],[16,26],[5,34],[32,43],[-58,85]],[[250,942],[-27,-13],[-21,-17],[-21,-8],[-59,-73],[-16,0],[-26,17],[-43,-13],[-21,-21],[-16,0]],[[1657,861],[-27,13],[-21,-13],[-32,13],[-74,-9],[16,47],[-6,47],[11,26],[5,120]],[[1529,1105],[-100,-17],[-64,47],[-75,-17],[-63,94],[-6,60],[-5,13],[-16,38],[-42,13],[-22,-38],[-21,0],[-42,94],[-16,34],[0,30],[-21,30],[-32,0],[-38,30],[-42,-47],[-85,39],[-32,-9],[-10,-21]],[[547,1726],[-69,-60],[-53,-13],[-59,-73],[-111,-25],[32,-60],[58,-22],[16,-34],[37,-26],[16,-51],[-37,-39],[5,-30],[11,-34],[-37,-64],[-64,4],[-26,-51],[-22,-47],[-42,4],[-21,-34],[-11,-52],[37,-47],[43,-30]],[[797,1478],[-69,30]],[[2029,852],[-96,-38],[-32,-39],[-42,43],[-59,4],[-16,39],[-42,13],[-32,-22],[-53,9]]],transform:{scale:[56.97629608361119,58.91534666536319],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"10M":{type:"Topology",arcs:[[[242,508],[-33,47],[-27,27]],[[637,0],[-25,46],[-2,12],[30,29],[7,47],[34,75],[7,45],[-12,33]],[[83,318],[-32,-18],[-51,-26]],[[552,290],[-46,5],[3,78]],[[509,373],[-79,8],[-30,59],[-30,3],[-34,62],[-19,-1],[-52,-6]],[[182,582],[-55,-39],[-28,-25],[30,-56],[-5,-45],[-59,-62],[18,-37]],[[265,498],[-23,10]],[[676,287],[-43,-21],[-81,24]]],transform:{scale:[171.07449827433382,174.72145763645509],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"20M":{type:"Topology",arcs:[[[50,191],[-17,-11],[-8,-10],[-11,1],[-14,-6]],[[305,224],[-44,6],[-58,68],[-44,2]],[[109,350],[-52,-36],[21,-45],[-38,-54],[10,-24]],[[159,300],[-14,6]],[[145,306],[-36,44]],[[381,0],[-17,31],[41,85],[-1,57]],[[404,173],[-74,2]],[[330,175],[-20,15],[-5,34]]],transform:{scale:[286.13294356075795,290.536823841191],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"60M":{type:"Topology",arcs:[[[258,111],[-47,1]],[[32,123],[-32,-17]],[[211,112],[-16,32]],[[195,144],[-94,49]],[[70,225],[-38,-102]],[[101,193],[-8,4]],[[93,197],[-23,28]],[[243,0],[15,111]]],transform:{scale:[447.98943164212585,451.9461704196305],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}}},4326:{"03M":{type:"Topology",arcs:[[[1543,0],[-4,32],[-28,65],[-24,5],[-19,33],[10,70],[47,5],[23,33],[38,0],[28,59],[-19,92],[94,124],[-5,54],[56,37],[0,11],[-9,70],[19,27],[4,38],[38,38],[-42,102]],[[1750,895],[-85,-27],[-32,-37],[-29,54],[-56,16],[-5,43],[-32,16],[-33,-16],[-43,16]],[[1435,960],[-23,22],[-19,-11],[-28,16],[-66,5],[19,44],[0,54],[14,26],[19,125]],[[230,1262],[-24,-5],[-23,-16],[-19,-11],[-56,-65],[-14,0],[-24,27],[-37,-11],[-19,-21],[-14,5]],[[1351,1241],[-84,0],[-47,59],[-71,-6],[-42,114],[5,64],[-5,11],[-9,43],[-33,22],[-24,-38],[-23,6],[-23,108],[-5,37],[0,33],[-14,32],[-28,5],[-29,38],[-42,-43],[-70,54],[-28,-5],[-10,-22]],[[582,2055],[-66,-49],[-47,-5],[-61,-70],[-103,-11],[19,-70],[51,-32],[10,-38],[28,-32],[9,-54],[-37,-44],[4,-26],[5,-38],[-37,-65],[-61,11],[-29,-49],[-23,-48],[-33,11],[-28,-33],[-14,-54],[28,-54],[33,-43]],[[769,1753],[-56,48]],[[713,1801],[-42,17],[-14,21],[-19,0],[-9,16],[-19,0],[-10,6],[5,16],[19,11],[-9,21],[0,11],[51,0],[-5,11],[-4,22],[-10,26],[-23,27],[-19,22],[-23,27]]],transform:{scale:[.0007994261320208862,.0004913384355349169],translate:[20.35361768088405,42.262163108155406]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"10M":{type:"Topology",arcs:[[[539,0],[-17,52],[0,13],[30,27],[13,48],[41,74],[13,47],[-8,38]],[[611,299],[-41,-16],[-69,37]],[[501,320],[-41,13],[12,81]],[[80,421],[-31,-12],[-49,-20]],[[472,414],[-71,24],[-18,66],[-28,7],[-21,72],[-18,0],[-47,2]],[[203,686],[-54,-32],[-29,-22],[21,-63],[-12,-47],[-60,-57],[11,-44]],[[269,585],[-20,16]],[[249,601],[-25,53],[-21,32]]],transform:{scale:[.002290098349828638,.0014718665962452685],translate:[20.35361768088405,42.262163108155406]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"20M":{type:"Topology",arcs:[[[337,0],[-12,36],[51,84],[6,62]],[[382,182],[-69,13]],[[313,195],[-17,20],[-1,37]],[[50,256],[-17,-10],[-8,-8],[-11,3],[-14,-5]],[[295,252],[-40,13],[-46,82],[-41,9]],[[127,417],[-54,-30],[15,-51],[-44,-53],[6,-27]],[[168,356],[-12,10]],[[156,366],[-29,51]]],transform:{scale:[.0036618323062750017,.0024213440887871805],translate:[20.35361768088405,42.262163108155406]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"60M":{type:"Topology",arcs:[[[220,0],[29,116]],[[249,116],[-45,8]],[[204,124],[-12,37]],[[192,161],[-83,66]],[[109,227],[-8,6]],[[33,163],[-33,-12]],[[83,266],[-50,-103]],[[101,233],[-18,33]]],transform:{scale:[.005617750767056427,.003795866485053587],translate:[20.35361768088405,42.262163108155406]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}}}}};function range(c,h,g){c=+c,h=+h,g=(b=arguments.length)<2?(h=c,c=0,1):b<3?1:+g;for(var m=-1,b=0|Math.max(0,Math.ceil((h-c)/g)),w=new Array(b);++m<b;)w[m]=c+m*g;return w}function graticuleX(c,h,g){var m=range(c,h-Dt,g).concat(h);return function(c){return m.map(function(h){return[c,h]})}}function graticuleY(c,h,g){var m=range(c,h-Dt,g).concat(h);return function(c){return m.map(function(h){return[h,c]})}}function graticule(){var c,h,g,m,b,w,S,M,k,T,E,I,P=10,L=P,B=90,z=360,j=2.5;function graticule(){return{type:"MultiLineString",coordinates:lines()}}function lines(){return range(Kt(m/B)*B,g,B).map(E).concat(range(Kt(M/z)*z,S,z).map(I)).concat(range(Kt(h/P)*P,c,P).filter(function(c){return Yt(c%B)>Dt}).map(k)).concat(range(Kt(w/L)*L,b,L).filter(function(c){return Yt(c%z)>Dt}).map(T))}return graticule.lines=function(){return lines().map(function(c){return{type:"LineString",coordinates:c}})},graticule.outline=function(){return{type:"Polygon",coordinates:[E(m).concat(I(S).slice(1),E(g).reverse().slice(1),I(M).reverse().slice(1))]}},graticule.extent=function(c){return arguments.length?graticule.extentMajor(c).extentMinor(c):graticule.extentMinor()},graticule.extentMajor=function(c){return arguments.length?(m=+c[0][0],g=+c[1][0],M=+c[0][1],S=+c[1][1],m>g&&(c=m,m=g,g=c),M>S&&(c=M,M=S,S=c),graticule.precision(j)):[[m,M],[g,S]]},graticule.extentMinor=function(g){return arguments.length?(h=+g[0][0],c=+g[1][0],w=+g[0][1],b=+g[1][1],h>c&&(g=h,h=c,c=g),w>b&&(g=w,w=b,b=g),graticule.precision(j)):[[h,w],[c,b]]},graticule.step=function(c){return arguments.length?graticule.stepMajor(c).stepMinor(c):graticule.stepMinor()},graticule.stepMajor=function(c){return arguments.length?(B=+c[0],z=+c[1],graticule):[B,z]},graticule.stepMinor=function(c){return arguments.length?(P=+c[0],L=+c[1],graticule):[P,L]},graticule.precision=function(P){return arguments.length?(j=+P,k=graticuleX(w,b,90),T=graticuleY(h,c,j),E=graticuleX(M,S,90),I=graticuleY(m,g,j),graticule):j},graticule.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function promisifyRequest(c){return new Promise((h,g)=>{c.oncomplete=c.onsuccess=()=>h(c.result),c.onabort=c.onerror=()=>g(c.error)})}function createStore(c,h){let g;return(m,b)=>(()=>{if(g)return g;const m=indexedDB.open(c);return m.onupgradeneeded=()=>m.result.createObjectStore(h),g=promisifyRequest(m),g.then(c=>{c.onclose=()=>g=void 0},()=>{}),g})().then(c=>b(c.transaction(h,m).objectStore(h)))}let Vr;function defaultGetStore(){return Vr||(Vr=createStore("keyval-store","keyval")),Vr}function dist_get(c,h=defaultGetStore()){return h("readonly",h=>promisifyRequest(h.get(c)))}function dist_set(c,h,g=defaultGetStore()){return g("readwrite",g=>(g.put(h,c),promisifyRequest(g.transaction)))}var $r=new Map,Xr=864e5;function canUseIDB(){return"undefined"!=typeof window&&((!0===window.isSecureContext||"localhost"===location.hostname||"127.0.0.1"===location.hostname)&&"undefined"!=typeof indexedDB)}function safeGetIDB(c){return _safeGetIDB.apply(this,arguments)}function _safeGetIDB(){return _safeGetIDB=_asyncToGenerator(It().mark(function _callee2(c){var h;return It().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(canUseIDB()){g.next=1;break}return g.abrupt("return",null);case 1:return g.prev=1,g.next=2,dist_get(c);case 2:return g.abrupt("return",g.sent);case 3:return g.prev=3,h=g.catch(1),console.warn("[IDB] read skipped:",(null==h?void 0:h.name)||h),g.abrupt("return",null);case 4:case"end":return g.stop()}},_callee2,null,[[1,3]])})),_safeGetIDB.apply(this,arguments)}function safeSetIDB(c,h){return _safeSetIDB.apply(this,arguments)}function _safeSetIDB(){return _safeSetIDB=_asyncToGenerator(It().mark(function _callee3(c,h){var g;return It().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(canUseIDB()){m.next=1;break}return m.abrupt("return",!1);case 1:return m.prev=1,m.next=2,dist_set(c,h);case 2:return m.abrupt("return",!0);case 3:return m.prev=3,g=m.catch(1),console.warn("[IDB] write skipped:",(null==g?void 0:g.name)||g),m.abrupt("return",!1);case 4:case"end":return m.stop()}},_callee3,null,[[1,3]])})),_safeSetIDB.apply(this,arguments)}var Kr=function Geometries(c,h){var g={};return g.defaultGeoData=void 0,g.allNUTSGeoData=void 0,g.geoJSONs={mixed:{rg0:void 0,rg1:void 0,rg2:void 0,rg3:void 0},cntbn:void 0,cntrg:void 0,nutsbn:void 0,nutsrg:void 0,gra:void 0,worldrg:void 0,worldbn:void 0,kosovo:void 0},g.userGeometries=void 0,g.statisticalRegions=void 0,g.centroidsData=void 0,g.centroidsFeatures=void 0,g._allCentroidsFeatures=void 0,g.getRegionFeatures=function(){return"WORLD"==c.geo_?g.geoJSONs.worldrg:"mixed"===c.nutsLevel_?[g.geoJSONs.mixed.rg0,g.geoJSONs.mixed.rg1,g.geoJSONs.mixed.rg2,g.geoJSONs.mixed.rg3]:g.geoJSONs.nutsrg.concat(g.geoJSONs.cntrg)},g.getDefaultGeoData=function(c,m,b){var w=g.getDefaultGeoDataPromise();return Promise.all(w).then(function(w){var S="function"==typeof m?m(w):w;return g.allNUTSGeoData=S,g.defaultGeoData=S[0],h&&(g.centroidsData="mixed"===b?[S[4],S[5],S[6],S[7]]:S[1]),"WORLD"===c?(g.geoJSONs.worldrg=feature(g.defaultGeoData,g.defaultGeoData.objects.CNTR_RG_20M_2020_4326).features,g.geoJSONs.worldbn=feature(g.defaultGeoData,g.defaultGeoData.objects.CNTR_BN_20M_2020_4326).features,g.geoJSONs.kosovo=feature(g.defaultGeoData,g.defaultGeoData.objects.NUTS_BN_20M_2021_RS_XK_border).features,g.geoJSONs.graticule=[graticule().step([30,30])()]):(g.geoJSONs.graticule=feature(g.defaultGeoData,g.defaultGeoData.objects.gra).features,g.geoJSONs.nutsrg=feature(g.defaultGeoData,g.defaultGeoData.objects.nutsrg).features,g.geoJSONs.nutsbn=feature(g.defaultGeoData,g.defaultGeoData.objects.nutsbn).features,g.geoJSONs.cntrg=feature(g.defaultGeoData,g.defaultGeoData.objects.cntrg).features,g.geoJSONs.cntbn=feature(g.defaultGeoData,g.defaultGeoData.objects.cntbn).features),S}).catch(function(c){return Promise.reject(c)})},g.getDefaultGeoDataPromise=function(){var g=[0,1,2,3],m=[],b=function buildUrl(c,h,g,m,b,w){var S=arguments.length>6&&void 0!==arguments[6]&&arguments[6],M="".concat(c,"/").concat(h);return g&&"EUR"!==g&&"WORLD"!==g&&(M+="/".concat(g)),M+="/".concat("WORLD"==g?"4326":m),!S&&b&&(M+="/".concat(b)),M+="/".concat(S?"nutspt_":"").concat(w,".json")},w=function(){var c=_asyncToGenerator(It().mark(function _callee(c){var h,g,m,b,w;return It().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(h="geojson-cache:".concat(c),!((g=$r.get(h))&&Date.now()-g.timestamp<Xr)){S.next=1;break}return S.abrupt("return",g.data);case 1:return S.next=2,safeGetIDB(h);case 2:if(!((m=S.sent)&&Date.now()-m.timestamp<Xr)){S.next=3;break}return $r.set(h,m),S.abrupt("return",m.data);case 3:return S.next=4,json(c).catch(function(h){if(null!=m&&m.data)return m.data;throw new Error("Fetch failed for ".concat(c,": ").concat((null==h?void 0:h.message)||h))});case 4:return b=S.sent,w={timestamp:Date.now(),data:b},$r.set(h,w),S.next=5,safeSetIDB(h,w);case 5:return S.abrupt("return",b);case 6:case"end":return S.stop()}},_callee)}));return function fetchWithCache(h){return c.apply(this,arguments)}}();if(!c||!c.nuts2jsonBaseURL_)throw new Error("Missing required map context or configuration");if("mixed"===c.nutsLevel_&&"WORLD"!==c.geo_)g.forEach(function(h){var g=b(c.nuts2jsonBaseURL_,c.nutsYear_,c.geo_,c.proj_,c.scale_,h);m.push(w(g))}),h&&g.forEach(function(h){var g=b(c.nuts2jsonBaseURL_,c.nutsYear_,c.geo_,c.proj_,c.scale_,h,!0);m.push(w(g))});else if("WORLD"===c.geo_){var S=window.location.hostname.includes("ec.europa.eu")?"https://ec.europa.eu/assets/estat/E/E4/gisco/IMAGE/WORLD_4326.json":"https://raw.githubusercontent.com/eurostat/eurostat-map/master/src/assets/topojson/WORLD_4326.json";m.push(w(S))}else{var M=b(c.nuts2jsonBaseURL_,c.nutsYear_,c.geo_,c.proj_,c.scale_,c.nutsLevel_);if(m.push(w(M)),h){var k=b(c.nuts2jsonBaseURL_,c.nutsYear_,c.geo_,c.proj_,c.scale_,c.nutsLevel_,!0);m.push(w(k))}}return m},g.isGeoReady=function(){if(!g.defaultGeoData&&!g.userGeometries)return!1;var h=!0;return Bt(c.insetTemplates_,null,function(c){c.Geometries.isGeoReady()||(h=!1)}),h},g.setUserGeometries=function(c){var h=this;this.userGeometries=c,c.forEach(function(c){c.statisticalRegions&&(h.statisticalRegions=c)})},g.addDefaultGeometriesToMap=function(h,m,b,w,S,M,k,T){(this.geoJSONs.graticule&&m&&h.append("g").attr("id","em-graticule").attr("class","em-graticule").selectAll("path").data(this.geoJSONs.graticule).enter().append("path").attr("d",b),this.geoJSONs.cntrg&&h.append("g").attr("id","em-cntrg").attr("class","em-cntrg").selectAll("path").data(this.geoJSONs.cntrg).enter().append("path").attr("d",b).attr("id",function(c){var h=c.properties.id;if("RS"==h||"EL"==h)return"em-cntrg-"+h}),this.geoJSONs.worldrg&&h.append("g").attr("id","em-worldrg").attr("class","em-worldrg").selectAll("path").data(this.geoJSONs.worldrg).enter().append("path").attr("d",b),this.geoJSONs.nutsrg)&&("mixed"==w?(this.geoJSONs.mixed.rg0=this.geoJSONs.nutsrg,this.geoJSONs.mixed.rg1=feature(g.allNUTSGeoData[1],g.allNUTSGeoData[1].objects.nutsrg).features,this.geoJSONs.mixed.rg2=feature(g.allNUTSGeoData[2],g.allNUTSGeoData[2].objects.nutsrg).features,this.geoJSONs.mixed.rg3=feature(g.allNUTSGeoData[3],g.allNUTSGeoData[3].objects.nutsrg).features,[this.geoJSONs.mixed.rg0,this.geoJSONs.mixed.rg1,this.geoJSONs.mixed.rg2,this.geoJSONs.mixed.rg3].forEach(function(g,m){attachClickEventToRegions(h.append("g").attr("id","em-nutsrg").attr("class","em-nutsrg em-nutsrg-".concat(m)).selectAll("path").data(g).enter().append("path").attr("d",b).attr("lvl",m),c)}),"EUR"!=M||"3035"!=k&&"4326"!=k||function addKosovoBorder(c,h,g,m,b){var w=Yr[b]?Yr[b][g][m]:Yr[2024][g][m],S=feature(w,"nutsbn_1").features;c.append("g").attr("id","em-kosovo-bn").attr("class","em-kosovo-bn em-bn-cc").selectAll("path").data(S).enter().append("path").attr("d",h)}(h,b,k,T,S)):attachClickEventToRegions(h.append("g").attr("id","em-nutsrg").attr("class","em-nutsrg").selectAll("path").data(this.geoJSONs.nutsrg).enter().append("path").attr("d",b),c));this.geoJSONs.cntbn&&h.append("g").attr("id","em-cntbn-halo").attr("class","em-cntbn-halo").selectAll("path").data(this.geoJSONs.cntbn).enter().append("path").filter(function(c){return"T"==c.properties.eu||"T"==c.properties.efta||"T"==c.properties.cc||"T"==c.properties.oth||"T"==c.properties.co?c:void 0}).attr("d",b).attr("id",function(c){return"em-bn-"+c.properties.id+"-halo"}).attr("class",function(c){var h=[];return"T"===c.properties.eu&&h.push("em-bn-eu"),"T"===c.properties.efta&&h.push("em-bn-efta"),"T"===c.properties.cc&&h.push("em-bn-cc"),"T"===c.properties.oth&&h.push("em-bn-oth"),"T"===c.properties.co&&h.push("em-bn-co"),h.join(" ")}),this.geoJSONs.cntbn&&h.append("g").attr("id","em-cntbn").attr("class","em-cntbn").selectAll("path").data(this.geoJSONs.cntbn).enter().append("path").filter(function(c){return"T"==c.properties.eu||"T"==c.properties.efta||"T"==c.properties.cc||"T"==c.properties.oth||"T"==c.properties.co?c:void 0}).attr("d",b).attr("id",function(c){return"em-bn-"+c.properties.id}).attr("class",function(c){var h=[];return"T"===c.properties.eu&&h.push("em-bn-eu"),"T"===c.properties.efta&&h.push("em-bn-efta"),"T"===c.properties.cc&&h.push("em-bn-cc"),"T"===c.properties.oth&&h.push("em-bn-oth"),"T"===c.properties.co&&h.push("em-bn-co"),h.join(" ")}),this.geoJSONs.nutsbn&&"mixed"!==w&&(this.geoJSONs.nutsbn.sort(function(c,h){return h.properties.lvl-c.properties.lvl}),h.append("g").attr("id","em-nutsbn").attr("class","em-nutsbn").selectAll("path").data(this.geoJSONs.nutsbn).enter().filter(function(c){return"T"==c.properties.eu||"T"==c.properties.efta||"T"==c.properties.cc||"T"==c.properties.oth||"T"==c.properties.co?c:void 0}).append("path").attr("d",b).attr("class",function(c){var h=c.properties;return h.id>1e5?"em-kosovo-bn":"T"===h.co?"em-bn-co":["em-bn-"+h.lvl].join(" ")})),this.geoJSONs.worldbn&&(h.append("g").attr("id","em-worldbn-halo").attr("class","em-worldbn-halo").selectAll("path").data(this.geoJSONs.worldbn).enter().append("path").attr("d",b).attr("class",function(c){return c.properties.POL_STAT>0?"em-bn-d em-worldbn-halo":"T"===c.properties.COAS_FLAG?"em-bn-co":"em-worldbn-halo"}),h.append("g").attr("id","em-worldbn").attr("class","em-worldbn").selectAll("path").data(this.geoJSONs.worldbn).enter().append("path").attr("d",b).attr("class",function(c){return c.properties.POL_STAT>0?"em-bn-d":"T"===c.properties.COAS_FLAG?"em-bn-co":"em-worldbn"})),this.geoJSONs.kosovo&&h.append("g").attr("id","em-kosovo-bn").attr("class","em-kosovo-bn").selectAll("path").data(this.geoJSONs.kosovo).enter().append("path").attr("d",b)},g.addUserGeometriesToMap=function(c,h,g){c.forEach(function(c){var m=h.append("g").attr("id",c.statisticalRegions?"em-user-regions":"").attr("class",c.class?c.class:"").selectAll("path").data(c.features).enter().append("path").attr("d",g);"function"==typeof c.onEach&&c.onEach(m)})},g.getAllRegionFeatures=function(){var h=[];return g.geoJSONs.nutsrg?h="mixed"==c.nutsLevel_?g.geoJSONs.mixed.rg0.concat(g.geoJSONs.mixed.rg1,g.geoJSONs.mixed.rg2,g.geoJSONs.mixed.rg3,g.geoJSONs.cntrg):g.geoJSONs.nutsrg.concat(g.geoJSONs.cntrg):g.userGeometries&&(h=g.statisticalRegions.features),h},g};function attachClickEventToRegions(c,h){c.on("click",function(c,g){var m,b;null!==(m=h.tooltip_.omitRegions)&&void 0!==m&&m.includes(null===(b=g.properties)||void 0===b?void 0:b.id)||h.onRegionClick_&&h.onRegionClick_(c,g,this,h)})}var Zr=function buildInset(c,h,g,m){var b=zs(c,g,m);for(var w in(c=c||{}).proj=c.proj||Qr[c.geo],c.scale=c.scale||h.insetScale_,c.footnote=c.footnote||"",c.showSourceLink=c.showSourceLink||!1,c.zoomExtent=c.zoomExtent||h.insetZoomExtent_,c.width=c.width||h.insetBoxWidth_,c.height=c.height||h.insetBoxWidth_,c.insets=c.insets||[],c.insetTemplates=c.insetTemplates||{},c.callback=c.callback||h.callback_,["nutsLevel_","nutsYear_","hoverColor_","cntrgFillStyle_","cntbnStroke_","cntbnStrokeWidth_","seaFillStyle_","drawCoastalMargin_","coastalMarginColor_","coastalMarginWidth_","coastalMarginStdDev_","graticuleStroke_","graticuleStrokeWidth_","lg_","projectionFunction_","filterGeometriesFunction_","processCentroids_"].forEach(function(c){b[c]=h[c]}),["stat","statData","legend","legendObj","noDataText","language","transitionDuration","tooltip_","classToText_"].forEach(function(c){b[c]=h[c]}),c)b[w+"_"]=c[w];return b.isInset=!0,b},Jr=function defaultInsetConfig(c,h){for(var g=[{geo:"IC",x:0,y:0,width:c,height:.3*c},{geo:"CARIB",x:0,y:.3*c+h,width:.5*c,height:c},{geo:"GF",x:.5*c,y:.3*c+h,width:.5*c,height:.75*c},{geo:"YT",x:.5*c,y:1.05*c+h,width:.25*c,height:.25*c},{geo:"RE",x:.75*c,y:1.05*c+h,width:.25*c,height:.25*c},{geo:"PT20",x:0,y:1.3*c+2*h,width:.75*c,height:.25*c},{geo:"PT30",x:.75*c,y:1.3*c+2*h,width:.25*c,height:.25*c},{geo:"MT",x:0,y:1.55*c+3*h,width:.25*c,height:.25*c},{geo:"LI",x:.25*c,y:1.55*c+3*h,width:.25*c,height:.25*c},{geo:"SJ_SV",x:.5*c,y:1.55*c+3*h,width:.25*c,height:.25*c},{geo:"SJ_JM",x:.75*c,y:1.55*c+3*h,width:.25*c,height:.25*c}],m=0;m<g.length;m++)g[m].drawGraticule=!1;return g},Qr={EUR:"3035",IC:"32628",GP:"32620",MQ:"32620",GF:"32622",RE:"32740",YT:"32738",MT:"3035",PT20:"32626",PT30:"32628",LI:"3035",IS:"3035",SJ_SV:"3035",SJ_JM:"3035",CARIB:"32620",WORLD:"54030"},to=function appendStamp(c,h){if(h.svg_&&(h.svg_.select("#em-stamp").remove(),c)){var g=h.svg_.append("g").attr("id","em-stamp");c.size||(c.size=60),c.x||(c.x=230),c.y||(c.y=100),c.textColor||(c.textColor="#000"),c.stampColor||(c.stampColor="#000"),c.strokeWidth||(c.strokeWidth=1),c.lineHeight||(c.lineHeight=15),c.shape||(c.shape="circle"),void 0===c.padding&&(c.padding="rectangle"===c.shape?1:0);var m=c.text,b=Math.sqrt(no(m.trim())*c.lineHeight),w=oo(eo(m.trim()),b);if("rectangle"===c.shape){var S=Math.max.apply(Math,toConsumableArray_toConsumableArray(w.map(function(c){return c.width}))),M=w.length*c.lineHeight,k=c.size/M,T=S*k,E=c.size,I=T+2*c.padding,P=E+2*c.padding;g.append("rect").attr("width",I).attr("height",P).attr("x",c.x-I/2).attr("y",c.y-P/2).attr("id","em-stamp-shape").attr("fill","none").attr("stroke",c.stampColor).attr("stroke-width",c.strokeWidth),g.append("text").attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",c.textColor).attr("id","em-stamp-text").attr("transform","translate(".concat(c.x,",").concat(c.y,") scale(").concat(k,")")).selectAll("tspan").data(w).enter().append("tspan").attr("x",0).attr("y",function(h,g){return(g-w.length/2+.5)*c.lineHeight}).text(function(c){return c.text.replaceAll("~"," ").replaceAll("¶","")})}else{var L=ro(w,c.lineHeight),B=c.size/L;if("square"===c.shape){var z=2*(c.size+c.padding);g.append("rect").attr("width",z).attr("height",z).attr("x",c.x-c.size-c.padding).attr("y",c.y-c.size-c.padding).attr("id","em-stamp-shape").attr("fill","none").attr("stroke",c.stampColor).attr("stroke-width",c.strokeWidth)}else g.append("circle").attr("r",c.size+c.padding).attr("cx",c.x).attr("cy",c.y).attr("id","em-stamp-shape").attr("fill","none").attr("stroke",c.stampColor).attr("stroke-width",c.strokeWidth);g.append("text").attr("text-anchor","middle").attr("fill",c.textColor).attr("id","em-stamp-text").attr("transform","translate(".concat(c.x,",").concat(c.y,") scale(").concat(B,")")).selectAll("tspan").data(w).enter().append("tspan").attr("x",0).attr("y",function(h,g){return(g-w.length/2+.8)*c.lineHeight}).text(function(c){return c.text.replaceAll("~"," ").replaceAll("¶","")})}}},eo=function getWords(c){return c.split(/(?<=¶)|\s+/g).map(function(c){return c.trim()}).filter(function(c){return c.length>0})},no=function measureWidth(c){var h=document.createElementNS("http://www.w3.org/2000/svg","svg"),g=document.createElementNS("http://www.w3.org/2000/svg","text");g.textContent=c,h.appendChild(g),document.body.appendChild(h);var m=g.getComputedTextLength();return document.body.removeChild(h),m},ro=function getTextRadius(c,h){for(var g=0,m=0,b=c.length;m<b;++m){var w=(Math.abs(m-b/2+.5)+.5)*h,S=c[m].width/2;g=Math.max(g,Math.sqrt(Math.pow(S,2)+Math.pow(w,2)))}return g},oo=function getLines(c,h){for(var g=[],m={width:0,text:""},b=0,w=c.length;b<w;++b)if("¶"!==c[b]){var S=(m.text?m.text+" ":"")+c[b],M=no(S);(m.width+M)/2<h?(m.width=M,m.text=S):(m.text&&g.push(m),m={width:no(c[b]),text:c[b]})}else m.text&&g.push(m),m={width:0,text:""};return m.text&&g.push(m),g},ao={},io={};function objectConverter(c){return new Function("d","return {"+c.map(function(c,h){return JSON.stringify(c)+": d["+h+'] || ""'}).join(",")+"}")}function inferColumns(c){var h=Object.create(null),g=[];return c.forEach(function(c){for(var m in c)m in h||g.push(h[m]=m)}),g}function pad(c,h){var g=c+"",m=g.length;return m<h?new Array(h-m+1).join(0)+g:g}function formatDate(c){var h=c.getUTCHours(),g=c.getUTCMinutes(),m=c.getUTCSeconds(),b=c.getUTCMilliseconds();return isNaN(c)?"Invalid Date":function formatYear(c){return c<0?"-"+pad(-c,6):c>9999?"+"+pad(c,6):pad(c,4)}(c.getUTCFullYear())+"-"+pad(c.getUTCMonth()+1,2)+"-"+pad(c.getUTCDate(),2)+(b?"T"+pad(h,2)+":"+pad(g,2)+":"+pad(m,2)+"."+pad(b,3)+"Z":m?"T"+pad(h,2)+":"+pad(g,2)+":"+pad(m,2)+"Z":g||h?"T"+pad(h,2)+":"+pad(g,2)+"Z":"")}function dsv(c){var h=new RegExp('["'+c+"\n\r]"),g=c.charCodeAt(0);function parseRows(c,h){var m,b=[],w=c.length,S=0,M=0,k=w<=0,T=!1;function token(){if(k)return io;if(T)return T=!1,ao;var h,m,b=S;if(34===c.charCodeAt(b)){for(;S++<w&&34!==c.charCodeAt(S)||34===c.charCodeAt(++S););return(h=S)>=w?k=!0:10===(m=c.charCodeAt(S++))?T=!0:13===m&&(T=!0,10===c.charCodeAt(S)&&++S),c.slice(b+1,h-1).replace(/""/g,'"')}for(;S<w;){if(10===(m=c.charCodeAt(h=S++)))T=!0;else if(13===m)T=!0,10===c.charCodeAt(S)&&++S;else if(m!==g)continue;return c.slice(b,h)}return k=!0,c.slice(b,w)}for(10===c.charCodeAt(w-1)&&--w,13===c.charCodeAt(w-1)&&--w;(m=token())!==io;){for(var E=[];m!==ao&&m!==io;)E.push(m),m=token();h&&null==(E=h(E,M++))||b.push(E)}return b}function preformatBody(h,g){return h.map(function(h){return g.map(function(c){return formatValue(h[c])}).join(c)})}function formatRow(h){return h.map(formatValue).join(c)}function formatValue(c){return null==c?"":c instanceof Date?formatDate(c):h.test(c+="")?'"'+c.replace(/"/g,'""')+'"':c}return{parse:function parse(c,h){var g,m,b=parseRows(c,function(c,b){if(g)return g(c,b-1);m=c,g=h?function customConverter(c,h){var g=objectConverter(c);return function(m,b){return h(g(m),b,c)}}(c,h):objectConverter(c)});return b.columns=m||[],b},parseRows,format:function format(h,g){return null==g&&(g=inferColumns(h)),[g.map(formatValue).join(c)].concat(preformatBody(h,g)).join("\n")},formatBody:function formatBody(c,h){return null==h&&(h=inferColumns(c)),preformatBody(c,h).join("\n")},formatRows:function formatRows(c){return c.map(formatRow).join("\n")},formatRow,formatValue}}var so=dsv(","),lo=so.parse,co=so.parseRows,uo=(so.format,so.formatBody,so.formatRows,so.formatRow,so.formatValue,function getGridLayout(c){return c.gridCartogramPositions_||("hexagon"===c.gridCartogramShape_?"\n ,IS, , , , , , , , , , ,\n , , , ,NO,SE,FI,EE, , , , ,\n , , , , , , ,LV, , , , ,\n ,IE,UK, , ,DK, ,LT, , , , ,\n , , , ,NL,DE,PL, , , , , ,\n , , ,BE,LU,CZ,SK,UA, , , , ,\n , ,FR,CH,LI,AT,HU,RO,MD, , , ,\n ,PT,ES, ,IT,SI,HR,RS,BG, , , ,\n , , , , , ,BA,ME,MK, , , , \n , , , , , , ,AL,EL,TR,GE, , \n , , , ,MT, , , , ,CY, , , ":"\n ,IS, , ,NO,SE,FI, , , , , ,\n , , , , , , ,EE, , , , ,\n , , , , , , ,LV, , , , ,\n ,IE,UK, , ,DK, ,LT, , , , ,\n , , , ,NL,DE,PL, , , , , ,\n , , ,BE,LU,CZ,SK,UA, , , , ,\n , ,FR,CH,LI,AT,HU,RO,MD, , , ,\n ,PT,ES, ,IT,SI,HR,RS,BG, , , ,\n , , , , , ,BA,ME,MK, , , , \n , , , , , , ,AL,EL,TR,GE, , \n , , , ,MT, , , , ,CY, , , ")}),ho=function parseGridLayout(c){var h=new Map;return co(c.trim(),function(c,g){c.forEach(function(c,m){(c=c.trim())&&h.set(c,[m,g])})}),h},po=function getGridData(c,h){return Array.from(c,function(c){var g=slicedToArray_slicedToArray(c,2),m=g[0],b=slicedToArray_slicedToArray(g[1],2),w=b[0],S=b[1],M=h.Geometries.geoJSONs.nutsrg.find(function(c){return c.properties.id==m});return{id:m,col:w,row:S,properties:{id:m,name:M?M.properties.na:""}}})},fo=function drawSquareGrid(c,h,g){var m=Math.max.apply(Math,toConsumableArray_toConsumableArray(h.map(function(c){return c.col})))+1,b=Math.max.apply(Math,toConsumableArray_toConsumableArray(h.map(function(c){return c.row})))+1,w=g.gridCartogramMargins_,S=g.gridCartogramCellPadding_||0,M=(g.width_-w.left-w.right)/m-S,k=(g.height_-w.top-w.bottom)/b-S,T=Math.min(M,k);c.selectAll(".em-grid-cell").data(h).enter().append("g").attr("class","em-grid-cell").attr("transform",function(c){return"translate(".concat(c.col*(T+S)+w.left,", ").concat(c.row*(T+S)+w.top,")")}).each(function(c){src_select(this).append("rect").datum(c).attr("width",T).attr("height",T).attr("class","em-grid-rect em-grid-shape"),src_select(this).append("text").attr("id","em-grid-text-".concat(c.id)).attr("class","em-grid-text").attr("text-anchor","middle").style("font-size",_o(g._mapType)).style("transform",mo(g._mapType)).style("pointer-events","none").attr("fill","black").text(c.id).attr("x",T/2).attr("y",T/2+5)})},go=function drawHexagonGrid(c,h,g){var m=Math.max.apply(Math,toConsumableArray_toConsumableArray(h.map(function(c){return c.col})))+1,b=Math.max.apply(Math,toConsumableArray_toConsumableArray(h.map(function(c){return c.row})))+1,w=g.gridCartogramMargins_,S=g.gridCartogramCellPadding_||0,M=Math.min((g.width_-w.left-w.right)/(1.5*m),(g.height_-w.top-w.bottom)/(b*Math.sqrt(3))),k=Math.sqrt(3)*M;c.selectAll(".em-grid-cell").data(h).enter().append("g").attr("class","em-grid-cell").attr("transform",function(c){var h=c.col*(1.5*M+S)+w.left,g=c.row*(k+S)+(c.col%2==1?(k+S)/2:0)+w.top;return"translate(".concat(h,", ").concat(g,")")}).each(function(c){src_select(this).append("path").datum(c).attr("d",vo(M)).attr("class","em-grid-hexagon em-grid-shape"),src_select(this).append("text").attr("id","em-grid-text-".concat(c.id)).attr("class","em-grid-text").attr("text-anchor","middle").style("font-size",_o(g._mapType)).style("transform",mo(g._mapType)).style("pointer-events","none").attr("fill","black").text(c.id).attr("y",5)})},_o=function getFontSize(c){switch(c){case"sparkline":case"spark":default:return 12;case"proportionalSymbol":return 14;case"choropleth":return 15}},mo=function getLabelTranslate(c){switch(c){case"sparkline":case"spark":return"translate(0, -10px)";case"proportionalSymbol":return"translate(0, -12px)";default:return"translate(0, 0px)"}},vo=function drawHexagon(c){var h=Math.PI/3;return Array.from({length:6},function(g,m){var b=c*Math.cos(h*m),w=c*Math.sin(h*m);return"".concat(0===m?"M":"L").concat(b,",").concat(w)}).join(" ")+" Z"},yo=function centerGrid(c,h,g,m){c.each(function(){var b=this.getBBox(),w=(h-m.left-m.right-b.width)/2-b.x+m.left,S=(g-m.top-m.bottom-b.height)/2-b.y+m.top;c.attr("transform","translate(".concat(w,", ").concat(S,")"))})};function adjustGridCartogramTextLabels(c){var h=c.map,g=c.getAnchors,m=c.getRadius,b=c.margin,w=void 0===b?2:b,S="hexagon"===h.gridCartogramShape_;g(h).each(function(c){var h=src_select(this),g=h.select(".em-grid-text");if(!g.empty()){var b=c.properties.id,M=m(b,c);if(M&&!(M<=0)){var k=h.select(".em-grid-shape, .em-grid-rect, .em-grid-hexagon").node();if(k){var T=k.getBBox(),E=(S?0:T.height/2)-M-w;g.attr("y",E)}}}})}function cartesian_spherical(c){return[$t(c[1],c[0]),asin(c[2])]}function cartesian_cartesian(c){var h=c[0],g=c[1],m=Xt(g);return[m*Xt(h),m*Jt(h),Jt(g)]}function cartesian_cartesianDot(c,h){return c[0]*h[0]+c[1]*h[1]+c[2]*h[2]}function cartesian_cartesianCross(c,h){return[c[1]*h[2]-c[2]*h[1],c[2]*h[0]-c[0]*h[2],c[0]*h[1]-c[1]*h[0]]}function cartesian_cartesianAddInPlace(c,h){c[0]+=h[0],c[1]+=h[1],c[2]+=h[2]}function cartesian_cartesianScale(c,h){return[c[0]*h,c[1]*h,c[2]*h]}function cartesian_cartesianNormalizeInPlace(c){var h=te(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);c[0]/=h,c[1]/=h,c[2]/=h}function polygonContains_longitude(c){return Yt(c[0])<=Rt?c[0]:Qt(c[0])*((Yt(c[0])+Rt)%Wt-Rt)}function src_clip(c,h,g,m){return function(b){var w,S,M,k=h(b),T=buffer(),E=h(T),I=!1,P={point,lineStart,lineEnd,polygonStart:function(){P.point=pointRing,P.lineStart=ringStart,P.lineEnd=ringEnd,S=[],w=[]},polygonEnd:function(){P.point=point,P.lineStart=lineStart,P.lineEnd=lineEnd,S=merge_merge(S);var c=function src_polygonContains(c,h){var g=polygonContains_longitude(h),m=h[1],b=Jt(m),w=[Jt(g),-Xt(g),0],S=0,M=0,k=new Adder;1===b?m=Gt+Dt:-1===b&&(m=-Gt-Dt);for(var T=0,E=c.length;T<E;++T)if(P=(I=c[T]).length)for(var I,P,L=I[P-1],B=polygonContains_longitude(L),z=L[1]/2+qt,j=Jt(z),D=Xt(z),N=0;N<P;++N,B=G,j=W,D=H,L=R){var R=I[N],G=polygonContains_longitude(R),q=R[1]/2+qt,W=Jt(q),H=Xt(q),U=G-B,Y=U>=0?1:-1,V=Y*U,$=V>Rt,X=j*W;if(k.add($t(X*Y*Jt(V),D*H+X*Xt(V))),S+=$?U+Y*Wt:U,$^B>=g^G>=g){var K=cartesian_cartesianCross(cartesian_cartesian(L),cartesian_cartesian(R));cartesian_cartesianNormalizeInPlace(K);var Z=cartesian_cartesianCross(w,K);cartesian_cartesianNormalizeInPlace(Z);var J=($^U>=0?-1:1)*asin(Z[2]);(m>J||m===J&&(K[0]||K[1]))&&(M+=$^U>=0?1:-1)}}return(S<-Dt||S<Dt&&k<-1e-12)^1&M}(w,m);S.length?(I||(b.polygonStart(),I=!0),rejoin(S,clip_compareIntersection,c,g,b)):c&&(I||(b.polygonStart(),I=!0),b.lineStart(),g(null,null,1,b),b.lineEnd()),I&&(b.polygonEnd(),I=!1),S=w=null},sphere:function(){b.polygonStart(),b.lineStart(),g(null,null,1,b),b.lineEnd(),b.polygonEnd()}};function point(h,g){c(h,g)&&b.point(h,g)}function pointLine(c,h){k.point(c,h)}function lineStart(){P.point=pointLine,k.lineStart()}function lineEnd(){P.point=point,k.lineEnd()}function pointRing(c,h){M.push([c,h]),E.point(c,h)}function ringStart(){E.lineStart(),M=[]}function ringEnd(){pointRing(M[0][0],M[0][1]),E.lineEnd();var c,h,g,m,k=E.clean(),P=T.result(),L=P.length;if(M.pop(),w.push(M),M=null,L)if(1&k){if((h=(g=P[0]).length-1)>0){for(I||(b.polygonStart(),I=!0),b.lineStart(),c=0;c<h;++c)b.point((m=g[c])[0],m[1]);b.lineEnd()}}else L>1&&2&k&&P.push(P.pop().concat(P.shift())),S.push(P.filter(clip_validSegment))}return P}}function clip_validSegment(c){return c.length>1}function clip_compareIntersection(c,h){return((c=c.x)[0]<0?c[1]-Gt-Dt:Gt-c[1])-((h=h.x)[0]<0?h[1]-Gt-Dt:Gt-h[1])}const Ao=src_clip(function(){return!0},function antimeridian_clipAntimeridianLine(c){var h,g=NaN,m=NaN,b=NaN;return{lineStart:function(){c.lineStart(),h=1},point:function(w,S){var M=w>0?Rt:-Rt,k=Yt(w-g);Yt(k-Rt)<Dt?(c.point(g,m=(m+S)/2>0?Gt:-Gt),c.point(b,m),c.lineEnd(),c.lineStart(),c.point(M,m),c.point(w,m),h=0):b!==M&&k>=Rt&&(Yt(g-b)<Dt&&(g-=b*Dt),Yt(w-M)<Dt&&(w-=M*Dt),m=function antimeridian_clipAntimeridianIntersect(c,h,g,m){var b,w,S=Jt(c-g);return Yt(S)>Dt?Vt((Jt(h)*(w=Xt(m))*Jt(g)-Jt(m)*(b=Xt(h))*Jt(c))/(b*w*S)):(h+m)/2}(g,m,w,S),c.point(b,m),c.lineEnd(),c.lineStart(),c.point(M,m),h=0),c.point(g=w,m=S),b=M},lineEnd:function(){c.lineEnd(),g=m=NaN},clean:function(){return 2-h}}},function antimeridian_clipAntimeridianInterpolate(c,h,g,m){var b;if(null==c)b=g*Gt,m.point(-Rt,b),m.point(0,b),m.point(Rt,b),m.point(Rt,0),m.point(Rt,-b),m.point(0,-b),m.point(-Rt,-b),m.point(-Rt,0),m.point(-Rt,b);else if(Yt(c[0]-h[0])>Dt){var w=c[0]<h[0]?Rt:-Rt;b=g*w/2,m.point(-w,b),m.point(0,b),m.point(w,b)}else m.point(h[0],h[1])},[-Rt,-Gt]);function circle_circleStream(c,h,g,m,b,w){if(g){var S=Xt(h),M=Jt(h),k=m*g;null==b?(b=h+m*Wt,w=h-k/2):(b=circle_circleRadius(S,b),w=circle_circleRadius(S,w),(m>0?b<w:b>w)&&(b+=m*Wt));for(var T,E=b;m>0?E>w:E<w;E-=k)T=cartesian_spherical([S,-M*Xt(E),-M*Jt(E)]),c.point(T[0],T[1])}}function circle_circleRadius(c,h){(h=cartesian_cartesian(h))[0]-=c,cartesian_cartesianNormalizeInPlace(h);var g=function acos(c){return c>1?0:c<-1?Rt:Math.acos(c)}(-h[1]);return((-h[2]<0?-g:g)+Wt-Dt)%Wt}function src_compose(c,h){function compose(g,m){return g=c(g,m),h(g[0],g[1])}return c.invert&&h.invert&&(compose.invert=function(g,m){return(g=h.invert(g,m))&&c.invert(g[0],g[1])}),compose}function rotation_rotationIdentity(c,h){return Yt(c)>Rt&&(c-=Math.round(c/Wt)*Wt),[c,h]}function src_rotation_rotateRadians(c,h,g){return(c%=Wt)?h||g?src_compose(rotation_rotationLambda(c),rotation_rotationPhiGamma(h,g)):rotation_rotationLambda(c):h||g?rotation_rotationPhiGamma(h,g):rotation_rotationIdentity}function rotation_forwardRotationLambda(c){return function(h,g){return Yt(h+=c)>Rt&&(h-=Math.round(h/Wt)*Wt),[h,g]}}function rotation_rotationLambda(c){var h=rotation_forwardRotationLambda(c);return h.invert=rotation_forwardRotationLambda(-c),h}function rotation_rotationPhiGamma(c,h){var g=Xt(c),m=Jt(c),b=Xt(h),w=Jt(h);function rotation(c,h){var S=Xt(h),M=Xt(c)*S,k=Jt(c)*S,T=Jt(h),E=T*g+M*m;return[$t(k*b-E*w,M*g-T*m),asin(E*b+k*w)]}return rotation.invert=function(c,h){var S=Xt(h),M=Xt(c)*S,k=Jt(c)*S,T=Jt(h),E=T*b-k*w;return[$t(k*b+T*w,M*g+E*m),asin(E*g-M*m)]},rotation}rotation_rotationIdentity.invert=rotation_rotationIdentity;var bo=Xt(30*Ut);function projection_resample(c,h){return+h?function projection_resample_resample(c,h){function resampleLineTo(g,m,b,w,S,M,k,T,E,I,P,L,B,z){var j=k-g,D=T-m,N=j*j+D*D;if(N>4*h&&B--){var R=w+I,G=S+P,q=M+L,W=te(R*R+G*G+q*q),H=asin(q/=W),U=Yt(Yt(q)-1)<Dt||Yt(b-E)<Dt?(b+E)/2:$t(G,R),Y=c(U,H),V=Y[0],$=Y[1],X=V-g,K=$-m,Z=D*X-j*K;(Z*Z/N>h||Yt((j*X+D*K)/N-.5)>.3||w*I+S*P+M*L<bo)&&(resampleLineTo(g,m,b,w,S,M,V,$,U,R/=W,G/=W,q,B,z),z.point(V,$),resampleLineTo(V,$,U,R,G,q,k,T,E,I,P,L,B,z))}}return function(h){var g,m,b,w,S,M,k,T,E,I,P,L,B={point,lineStart,lineEnd,polygonStart:function(){h.polygonStart(),B.lineStart=ringStart},polygonEnd:function(){h.polygonEnd(),B.lineStart=lineStart}};function point(g,m){g=c(g,m),h.point(g[0],g[1])}function lineStart(){T=NaN,B.point=linePoint,h.lineStart()}function linePoint(g,m){var b=cartesian_cartesian([g,m]),w=c(g,m);resampleLineTo(T,E,k,I,P,L,T=w[0],E=w[1],k=g,I=b[0],P=b[1],L=b[2],16,h),h.point(T,E)}function lineEnd(){B.point=point,h.lineEnd()}function ringStart(){lineStart(),B.point=ringPoint,B.lineEnd=ringEnd}function ringPoint(c,h){linePoint(g=c,h),m=T,b=E,w=I,S=P,M=L,B.point=linePoint}function ringEnd(){resampleLineTo(T,E,k,I,P,L,m,b,g,w,S,M,16,h),B.lineEnd=lineEnd,lineEnd()}return B}}(c,h):function resample_resampleNone(c){return transform_transformer({point:function(h,g){h=c(h,g),this.stream.point(h[0],h[1])}})}(c)}var xo=transform_transformer({point:function(c,h){this.stream.point(c*Ut,h*Ut)}});function projection_scaleTranslateRotate(c,h,g,m,b,w){if(!w)return function projection_scaleTranslate(c,h,g,m,b){function transform(w,S){return[h+c*(w*=m),g-c*(S*=b)]}return transform.invert=function(w,S){return[(w-h)/c*m,(g-S)/c*b]},transform}(c,h,g,m,b);var S=Xt(w),M=Jt(w),k=S*c,T=M*c,E=S/c,I=M/c,P=(M*g-S*h)/c,L=(M*h+S*g)/c;function transform(c,w){return[k*(c*=m)-T*(w*=b)+h,g-T*c-k*w]}return transform.invert=function(c,h){return[m*(E*c-I*h+P),b*(L-I*c-E*h)]},transform}function projection_projection(c){return function projection_projectionMutator(c){var h,g,m,b,w,S,M,k,T,E,I=150,P=480,L=250,B=0,z=0,j=0,D=0,N=0,R=0,G=1,q=1,W=null,H=Ao,U=null,Y=d3_geo_src_identity,V=.5;function projection(c){return k(c[0]*Ut,c[1]*Ut)}function invert(c){return(c=k.invert(c[0],c[1]))&&[c[0]*Ht,c[1]*Ht]}function recenter(){var c=projection_scaleTranslateRotate(I,0,0,G,q,R).apply(null,h(B,z)),m=projection_scaleTranslateRotate(I,P-c[0],L-c[1],G,q,R);return g=src_rotation_rotateRadians(j,D,N),M=src_compose(h,m),k=src_compose(g,M),S=projection_resample(M,V),reset()}function reset(){return T=E=null,projection}return projection.stream=function(c){return T&&E===c?T:T=xo(function projection_transformRotate(c){return transform_transformer({point:function(h,g){var m=c(h,g);return this.stream.point(m[0],m[1])}})}(g)(H(S(Y(E=c)))))},projection.preclip=function(c){return arguments.length?(H=c,W=void 0,reset()):H},projection.postclip=function(c){return arguments.length?(Y=c,U=m=b=w=null,reset()):Y},projection.clipAngle=function(c){return arguments.length?(H=+c?function src_clip_circle(c){var h=Xt(c),g=2*Ut,m=h>0,b=Yt(h)>Dt;function visible(c,g){return Xt(c)*Xt(g)>h}function intersect(c,g,m){var b=[1,0,0],w=cartesian_cartesianCross(cartesian_cartesian(c),cartesian_cartesian(g)),S=cartesian_cartesianDot(w,w),M=w[0],k=S-M*M;if(!k)return!m&&c;var T=h*S/k,E=-h*M/k,I=cartesian_cartesianCross(b,w),P=cartesian_cartesianScale(b,T);cartesian_cartesianAddInPlace(P,cartesian_cartesianScale(w,E));var L=I,B=cartesian_cartesianDot(P,L),z=cartesian_cartesianDot(L,L),j=B*B-z*(cartesian_cartesianDot(P,P)-1);if(!(j<0)){var D=te(j),N=cartesian_cartesianScale(L,(-B-D)/z);if(cartesian_cartesianAddInPlace(N,P),N=cartesian_spherical(N),!m)return N;var R,G=c[0],q=g[0],W=c[1],H=g[1];q<G&&(R=G,G=q,q=R);var U=q-G,Y=Yt(U-Rt)<Dt;if(!Y&&H<W&&(R=W,W=H,H=R),Y||U<Dt?Y?W+H>0^N[1]<(Yt(N[0]-G)<Dt?W:H):W<=N[1]&&N[1]<=H:U>Rt^(G<=N[0]&&N[0]<=q)){var V=cartesian_cartesianScale(L,(-B+D)/z);return cartesian_cartesianAddInPlace(V,P),[N,cartesian_spherical(V)]}}}function code(h,g){var b=m?c:Rt-c,w=0;return h<-b?w|=1:h>b&&(w|=2),g<-b?w|=4:g>b&&(w|=8),w}return src_clip(visible,function clipLine(c){var h,g,w,S,M;return{lineStart:function(){S=w=!1,M=1},point:function(k,T){var E,I=[k,T],P=visible(k,T),L=m?P?0:code(k,T):P?code(k+(k<0?Rt:-Rt),T):0;if(!h&&(S=w=P)&&c.lineStart(),P!==w&&(!(E=intersect(h,I))||pointEqual(h,E)||pointEqual(I,E))&&(I[2]=1),P!==w)M=0,P?(c.lineStart(),E=intersect(I,h),c.point(E[0],E[1])):(E=intersect(h,I),c.point(E[0],E[1],2),c.lineEnd()),h=E;else if(b&&h&&m^P){var B;L&g||!(B=intersect(I,h,!0))||(M=0,m?(c.lineStart(),c.point(B[0][0],B[0][1]),c.point(B[1][0],B[1][1]),c.lineEnd()):(c.point(B[1][0],B[1][1]),c.lineEnd(),c.lineStart(),c.point(B[0][0],B[0][1],3)))}!P||h&&pointEqual(h,I)||c.point(I[0],I[1]),h=I,w=P,g=L},lineEnd:function(){w&&c.lineEnd(),h=null},clean:function(){return M|(S&&w)<<1}}},function interpolate(h,m,b,w){circle_circleStream(w,c,g,b,h,m)},m?[0,-c]:[-Rt,c-Rt])}(W=c*Ut):(W=null,Ao),reset()):W*Ht},projection.clipExtent=function(c){return arguments.length?(Y=null==c?(U=m=b=w=null,d3_geo_src_identity):clipRectangle(U=+c[0][0],m=+c[0][1],b=+c[1][0],w=+c[1][1]),reset()):null==U?null:[[U,m],[b,w]]},projection.scale=function(c){return arguments.length?(I=+c,recenter()):I},projection.translate=function(c){return arguments.length?(P=+c[0],L=+c[1],recenter()):[P,L]},projection.center=function(c){return arguments.length?(B=c[0]%360*Ut,z=c[1]%360*Ut,recenter()):[B*Ht,z*Ht]},projection.rotate=function(c){return arguments.length?(j=c[0]%360*Ut,D=c[1]%360*Ut,N=c.length>2?c[2]%360*Ut:0,recenter()):[j*Ht,D*Ht,N*Ht]},projection.angle=function(c){return arguments.length?(R=c%360*Ut,recenter()):R*Ht},projection.reflectX=function(c){return arguments.length?(G=c?-1:1,recenter()):G<0},projection.reflectY=function(c){return arguments.length?(q=c?-1:1,recenter()):q<0},projection.precision=function(c){return arguments.length?(S=projection_resample(M,V=c*c),reset()):te(V)},projection.fitExtent=function(c,h){return fitExtent(projection,c,h)},projection.fitSize=function(c,h){return fitSize(projection,c,h)},projection.fitWidth=function(c,h){return fitWidth(projection,c,h)},projection.fitHeight=function(c,h){return fitHeight(projection,c,h)},function(){return h=c.apply(this,arguments),projection.invert=h.invert&&invert,recenter()}}(function(){return c})()}function orthographicRaw(c,h){return[Xt(h)*Jt(c),Jt(h)]}orthographicRaw.invert=function azimuthalInvert(c){return function(h,g){var m=te(h*h+g*g),b=c(m),w=Jt(b),S=Xt(b);return[$t(h*w,m*S),asin(m&&g*w/m)]}}(asin);var wo=6378137,Co=.0066943799901413165,So=484813681109536e-20,Mo=Math.PI/2,ko=1e-10,To=.017453292519943295,Eo=57.29577951308232,Io=Math.PI/4,Po=2*Math.PI,Lo=3.14159265359,Fo={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};const Bo=Fo,Oo={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var zo=/[\s_\-\/\(\)]/g;function match(c,h){if(c[h])return c[h];for(var g,m=Object.keys(c),b=h.toLowerCase().replace(zo,""),w=-1;++w<m.length;)if((g=m[w]).toLowerCase().replace(zo,"")===b)return c[g]}function projString(c){var h,g,m,b={},w=c.split("+").map(function(c){return c.trim()}).filter(function(c){return c}).reduce(function(c,h){var g=h.split("=");return g.push(!0),c[g[0].toLowerCase()]=g[1],c},{}),S={proj:"projName",datum:"datumCode",rf:function(c){b.rf=parseFloat(c)},lat_0:function(c){b.lat0=c*To},lat_1:function(c){b.lat1=c*To},lat_2:function(c){b.lat2=c*To},lat_ts:function(c){b.lat_ts=c*To},lon_0:function(c){b.long0=c*To},lon_1:function(c){b.long1=c*To},lon_2:function(c){b.long2=c*To},alpha:function(c){b.alpha=parseFloat(c)*To},gamma:function(c){b.rectified_grid_angle=parseFloat(c)*To},lonc:function(c){b.longc=c*To},x_0:function(c){b.x0=parseFloat(c)},y_0:function(c){b.y0=parseFloat(c)},k_0:function(c){b.k0=parseFloat(c)},k:function(c){b.k0=parseFloat(c)},a:function(c){b.a=parseFloat(c)},b:function(c){b.b=parseFloat(c)},r:function(c){b.a=b.b=parseFloat(c)},r_a:function(){b.R_A=!0},zone:function(c){b.zone=parseInt(c,10)},south:function(){b.utmSouth=!0},towgs84:function(c){b.datum_params=c.split(",").map(function(c){return parseFloat(c)})},to_meter:function(c){b.to_meter=parseFloat(c)},units:function(c){b.units=c;var h=match(Oo,c);h&&(b.to_meter=h.to_meter)},from_greenwich:function(c){b.from_greenwich=c*To},pm:function(c){var h=match(Bo,c);b.from_greenwich=(h||parseFloat(c))*To},nadgrids:function(c){"@null"===c?b.datumCode="none":b.nadgrids=c},axis:function(c){var h="ewnsud";3===c.length&&-1!==h.indexOf(c.substr(0,1))&&-1!==h.indexOf(c.substr(1,1))&&-1!==h.indexOf(c.substr(2,1))&&(b.axis=c)},approx:function(){b.approx=!0},over:function(){b.over=!0}};for(h in w)g=w[h],h in S?"function"==typeof(m=S[h])?m(g):b[m]=g:b[h]=g;return"string"==typeof b.datumCode&&"WGS84"!==b.datumCode&&(b.datumCode=b.datumCode.toLowerCase()),b.projStr=c,b}const jo=class PROJJSONBuilderBase{static getId(c){const h=c.find(c=>Array.isArray(c)&&"ID"===c[0]);return h&&h.length>=3?{authority:h[1],code:parseInt(h[2],10)}:null}static convertUnit(c,h="unit"){if(!c||c.length<3)return{type:h,name:"unknown",conversion_factor:null};const g=c[1],m=parseFloat(c[2])||null,b=c.find(c=>Array.isArray(c)&&"ID"===c[0]);return{type:h,name:g,conversion_factor:m,id:b?{authority:b[1],code:parseInt(b[2],10)}:null}}static convertAxis(c){const h=c[1]||"Unknown";let g;const m=h.match(/^\((.)\)$/);if(m){const c=m[1].toUpperCase();if("E"===c)g="east";else if("N"===c)g="north";else{if("U"!==c)throw new Error(`Unknown axis abbreviation: ${c}`);g="up"}}else g=c[2]?c[2].toLowerCase():"unknown";const b=c.find(c=>Array.isArray(c)&&"ORDER"===c[0]),w=b?parseInt(b[1],10):null,S=c.find(c=>Array.isArray(c)&&("LENGTHUNIT"===c[0]||"ANGLEUNIT"===c[0]||"SCALEUNIT"===c[0]));return{name:h,direction:g,unit:this.convertUnit(S),order:w}}static extractAxes(c){return c.filter(c=>Array.isArray(c)&&"AXIS"===c[0]).map(c=>this.convertAxis(c)).sort((c,h)=>(c.order||0)-(h.order||0))}static convert(c,h={}){switch(c[0]){case"PROJCRS":h.type="ProjectedCRS",h.name=c[1],h.base_crs=c.find(c=>Array.isArray(c)&&"BASEGEOGCRS"===c[0])?this.convert(c.find(c=>Array.isArray(c)&&"BASEGEOGCRS"===c[0])):null,h.conversion=c.find(c=>Array.isArray(c)&&"CONVERSION"===c[0])?this.convert(c.find(c=>Array.isArray(c)&&"CONVERSION"===c[0])):null;const g=c.find(c=>Array.isArray(c)&&"CS"===c[0]);g&&(h.coordinate_system={type:g[1],axis:this.extractAxes(c)});const m=c.find(c=>Array.isArray(c)&&"LENGTHUNIT"===c[0]);if(m){const c=this.convertUnit(m);h.coordinate_system.unit=c}h.id=this.getId(c);break;case"BASEGEOGCRS":case"GEOGCRS":h.type="GeographicCRS",h.name=c[1];const b=c.find(c=>Array.isArray(c)&&("DATUM"===c[0]||"ENSEMBLE"===c[0]));if(b){const g=this.convert(b);"ENSEMBLE"===b[0]?h.datum_ensemble=g:h.datum=g;const m=c.find(c=>Array.isArray(c)&&"PRIMEM"===c[0]);m&&"Greenwich"!==m[1]&&(g.prime_meridian={name:m[1],longitude:parseFloat(m[2])})}h.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(c)},h.id=this.getId(c);break;case"DATUM":h.type="GeodeticReferenceFrame",h.name=c[1],h.ellipsoid=c.find(c=>Array.isArray(c)&&"ELLIPSOID"===c[0])?this.convert(c.find(c=>Array.isArray(c)&&"ELLIPSOID"===c[0])):null;break;case"ENSEMBLE":h.type="DatumEnsemble",h.name=c[1],h.members=c.filter(c=>Array.isArray(c)&&"MEMBER"===c[0]).map(c=>({type:"DatumEnsembleMember",name:c[1],id:this.getId(c)}));const w=c.find(c=>Array.isArray(c)&&"ENSEMBLEACCURACY"===c[0]);w&&(h.accuracy=parseFloat(w[1]));const S=c.find(c=>Array.isArray(c)&&"ELLIPSOID"===c[0]);S&&(h.ellipsoid=this.convert(S)),h.id=this.getId(c);break;case"ELLIPSOID":h.type="Ellipsoid",h.name=c[1],h.semi_major_axis=parseFloat(c[2]),h.inverse_flattening=parseFloat(c[3]);c.find(c=>Array.isArray(c)&&"LENGTHUNIT"===c[0])&&this.convert(c.find(c=>Array.isArray(c)&&"LENGTHUNIT"===c[0]),h);break;case"CONVERSION":h.type="Conversion",h.name=c[1],h.method=c.find(c=>Array.isArray(c)&&"METHOD"===c[0])?this.convert(c.find(c=>Array.isArray(c)&&"METHOD"===c[0])):null,h.parameters=c.filter(c=>Array.isArray(c)&&"PARAMETER"===c[0]).map(c=>this.convert(c));break;case"METHOD":h.type="Method",h.name=c[1],h.id=this.getId(c);break;case"PARAMETER":h.type="Parameter",h.name=c[1],h.value=parseFloat(c[2]),h.unit=this.convertUnit(c.find(c=>Array.isArray(c)&&("LENGTHUNIT"===c[0]||"ANGLEUNIT"===c[0]||"SCALEUNIT"===c[0]))),h.id=this.getId(c);break;case"BOUNDCRS":h.type="BoundCRS";const M=c.find(c=>Array.isArray(c)&&"SOURCECRS"===c[0]);if(M){const c=M.find(c=>Array.isArray(c));h.source_crs=c?this.convert(c):null}const k=c.find(c=>Array.isArray(c)&&"TARGETCRS"===c[0]);if(k){const c=k.find(c=>Array.isArray(c));h.target_crs=c?this.convert(c):null}const T=c.find(c=>Array.isArray(c)&&"ABRIDGEDTRANSFORMATION"===c[0]);h.transformation=T?this.convert(T):null;break;case"ABRIDGEDTRANSFORMATION":if(h.type="Transformation",h.name=c[1],h.method=c.find(c=>Array.isArray(c)&&"METHOD"===c[0])?this.convert(c.find(c=>Array.isArray(c)&&"METHOD"===c[0])):null,h.parameters=c.filter(c=>Array.isArray(c)&&("PARAMETER"===c[0]||"PARAMETERFILE"===c[0])).map(c=>"PARAMETER"===c[0]?this.convert(c):"PARAMETERFILE"===c[0]?{name:c[1],value:c[2],id:{authority:"EPSG",code:8656}}:void 0),7===h.parameters.length){const c=h.parameters[6];"Scale difference"===c.name&&(c.value=Math.round(1e12*(c.value-1))/1e6)}h.id=this.getId(c);break;case"AXIS":h.coordinate_system||(h.coordinate_system={type:"unspecified",axis:[]}),h.coordinate_system.axis.push(this.convertAxis(c));break;case"LENGTHUNIT":const E=this.convertUnit(c,"LinearUnit");h.coordinate_system&&h.coordinate_system.axis&&h.coordinate_system.axis.forEach(c=>{c.unit||(c.unit=E)}),E.conversion_factor&&1!==E.conversion_factor&&h.semi_major_axis&&(h.semi_major_axis={value:h.semi_major_axis,unit:E});break;default:h.keyword=c[0]}return h}};const Do=class PROJJSONBuilder2015 extends jo{static convert(c,h={}){return super.convert(c,h),h.coordinate_system&&"Cartesian"===h.coordinate_system.subtype&&delete h.coordinate_system,h.usage&&delete h.usage,h}};const No=class PROJJSONBuilder2019 extends jo{static convert(c,h={}){super.convert(c,h);const g=c.find(c=>Array.isArray(c)&&"CS"===c[0]);g&&(h.coordinate_system={subtype:g[1],axis:this.extractAxes(c)});const m=c.find(c=>Array.isArray(c)&&"USAGE"===c[0]);if(m){const c=m.find(c=>Array.isArray(c)&&"SCOPE"===c[0]),g=m.find(c=>Array.isArray(c)&&"AREA"===c[0]),b=m.find(c=>Array.isArray(c)&&"BBOX"===c[0]);h.usage={},c&&(h.usage.scope=c[1]),g&&(h.usage.area=g[1]),b&&(h.usage.bbox=b.slice(1))}return h}};function buildPROJJSON(c){const h=function detectWKT2Version(c){return c.find(c=>Array.isArray(c)&&"USAGE"===c[0])?"2019":(c.find(c=>Array.isArray(c)&&"CS"===c[0])||"BOUNDCRS"===c[0]||"PROJCRS"===c[0]||c[0],"2015")}(c);return("2019"===h?No:Do).convert(c)}const Ro=function parseString(c){var h=new Parser(c);return h.output()};var Go=1,qo=/\s/,Wo=/[A-Za-z]/,Ho=/[A-Za-z84_]/,Uo=/[,\]]/,Yo=/[\d\.E\-\+]/;function Parser(c){if("string"!=typeof c)throw new Error("not a string");this.text=c.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Go}function mapit(c,h,g){Array.isArray(h)&&(g.unshift(h),h=null);var m=h?{}:c,b=g.reduce(function(c,h){return sExpr(h,c),c},m);h&&(c[h]=b)}function sExpr(c,h){if(Array.isArray(c)){var g=c.shift();if("PARAMETER"===g&&(g=c.shift()),1===c.length)return Array.isArray(c[0])?(h[g]={},void sExpr(c[0],h[g])):void(h[g]=c[0]);if(c.length)if("TOWGS84"!==g){if("AXIS"===g)return g in h||(h[g]=[]),void h[g].push(c);var m;switch(Array.isArray(g)||(h[g]={}),g){case"UNIT":case"PRIMEM":case"VERT_DATUM":return h[g]={name:c[0].toLowerCase(),convert:c[1]},void(3===c.length&&sExpr(c[2],h[g]));case"SPHEROID":case"ELLIPSOID":return h[g]={name:c[0],a:c[1],rf:c[2]},void(4===c.length&&sExpr(c[3],h[g]));case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":return c[0]=["name",c[0]],void mapit(h,g,c);case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":return c[0]=["name",c[0]],mapit(h,g,c),void(h[g].type=g);default:for(m=-1;++m<c.length;)if(!Array.isArray(c[m]))return sExpr(c,h[g]);return mapit(h,g,c)}}else h[g]=c;else h[g]=!0}else h[c]=!0}Parser.prototype.readCharicter=function(){var c=this.text[this.place++];if(4!==this.state)for(;qo.test(c);){if(this.place>=this.text.length)return;c=this.text[this.place++]}switch(this.state){case Go:return this.neutral(c);case 2:return this.keyword(c);case 4:return this.quoted(c);case 5:return this.afterquote(c);case 3:return this.number(c);case-1:return}},Parser.prototype.afterquote=function(c){if('"'===c)return this.word+='"',void(this.state=4);if(Uo.test(c))return this.word=this.word.trim(),void this.afterItem(c);throw new Error("havn't handled \""+c+'" in afterquote yet, index '+this.place)},Parser.prototype.afterItem=function(c){return","===c?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=Go)):"]"===c?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=Go,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},Parser.prototype.number=function(c){if(!Yo.test(c)){if(Uo.test(c))return this.word=parseFloat(this.word),void this.afterItem(c);throw new Error("havn't handled \""+c+'" in number yet, index '+this.place)}this.word+=c},Parser.prototype.quoted=function(c){'"'!==c?this.word+=c:this.state=5},Parser.prototype.keyword=function(c){if(Ho.test(c))this.word+=c;else{if("["===c){var h=[];return h.push(this.word),this.level++,null===this.root?this.root=h:this.currentObject.push(h),this.stack.push(this.currentObject),this.currentObject=h,void(this.state=Go)}if(!Uo.test(c))throw new Error("havn't handled \""+c+'" in keyword yet, index '+this.place);this.afterItem(c)}},Parser.prototype.neutral=function(c){if(Wo.test(c))return this.word=c,void(this.state=2);if('"'===c)return this.word="",void(this.state=4);if(Yo.test(c))return this.word=c,void(this.state=3);if(!Uo.test(c))throw new Error("havn't handled \""+c+'" in neutral yet, index '+this.place);this.afterItem(c)},Parser.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function d2r(c){return.017453292519943295*c}function applyProjectionDefaults(c){const h=(c.projName||"").toLowerCase().replace(/_/g," ");c.long0||!c.longc||"albers conic equal area"!==h&&"lambert azimuthal equal area"!==h||(c.long0=c.longc),c.lat_ts||!c.lat1||"stereographic south pole"!==h&&"polar stereographic (variant b)"!==h?c.lat_ts||!c.lat0||"polar stereographic"!==h&&"polar stereographic (variant a)"!==h||(c.lat_ts=c.lat0,c.lat0=d2r(c.lat0>0?90:-90),delete c.lat1):(c.lat0=d2r(c.lat1>0?90:-90),c.lat_ts=c.lat1,delete c.lat1)}function processUnit(c){let h={units:null,to_meter:void 0};return"string"==typeof c?(h.units=c.toLowerCase(),"metre"===h.units&&(h.units="meter"),"meter"===h.units&&(h.to_meter=1)):c&&c.name&&(h.units=c.name.toLowerCase(),"metre"===h.units&&(h.units="meter"),h.to_meter=c.conversion_factor),h}function toValue(c){return"object"==typeof c?c.value*c.unit.conversion_factor:c}function calculateEllipsoid(c,h){c.ellipsoid.radius?(h.a=c.ellipsoid.radius,h.rf=0):(h.a=toValue(c.ellipsoid.semi_major_axis),void 0!==c.ellipsoid.inverse_flattening?h.rf=c.ellipsoid.inverse_flattening:void 0!==c.ellipsoid.semi_major_axis&&void 0!==c.ellipsoid.semi_minor_axis&&(h.rf=h.a/(h.a-toValue(c.ellipsoid.semi_minor_axis))))}function transformPROJJSON(c,h={}){return c&&"object"==typeof c?"BoundCRS"===c.type?(transformPROJJSON(c.source_crs,h),c.transformation&&(c.transformation.method&&"NTv2"===c.transformation.method.name?h.nadgrids=c.transformation.parameters[0].value:h.datum_params=c.transformation.parameters.map(c=>c.value)),h):(Object.keys(c).forEach(g=>{const m=c[g];if(null!==m)switch(g){case"name":if(h.srsCode)break;h.name=m,h.srsCode=m;break;case"type":"GeographicCRS"===m?h.projName="longlat":"ProjectedCRS"===m&&c.conversion&&c.conversion.method&&(h.projName=c.conversion.method.name);break;case"datum":case"datum_ensemble":m.ellipsoid&&(h.ellps=m.ellipsoid.name,calculateEllipsoid(m,h)),m.prime_meridian&&(h.from_greenwich=m.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":h.ellps=m.name,calculateEllipsoid(m,h);break;case"prime_meridian":h.long0=(m.longitude||0)*Math.PI/180;break;case"coordinate_system":if(m.axis)if(h.axis=m.axis.map(c=>{const h=c.direction;if("east"===h)return"e";if("north"===h)return"n";if("west"===h)return"w";if("south"===h)return"s";throw new Error(`Unknown axis direction: ${h}`)}).join("")+"u",m.unit){const{units:c,to_meter:g}=processUnit(m.unit);h.units=c,h.to_meter=g}else if(m.axis[0]&&m.axis[0].unit){const{units:c,to_meter:g}=processUnit(m.axis[0].unit);h.units=c,h.to_meter=g}break;case"id":m.authority&&m.code&&(h.title=m.authority+":"+m.code);break;case"conversion":m.method&&m.method.name&&(h.projName=m.method.name),m.parameters&&m.parameters.forEach(c=>{const g=c.name.toLowerCase().replace(/\s+/g,"_"),m=c.value;c.unit&&c.unit.conversion_factor?h[g]=m*c.unit.conversion_factor:"degree"===c.unit?h[g]=m*Math.PI/180:h[g]=m});break;case"unit":m.name&&(h.units=m.name.toLowerCase(),"metre"===h.units&&(h.units="meter")),m.conversion_factor&&(h.to_meter=m.conversion_factor);break;case"base_crs":transformPROJJSON(m,h),h.datumCode=m.id?m.id.authority+"_"+m.id.code:m.name}}),void 0!==h.latitude_of_false_origin&&(h.lat0=h.latitude_of_false_origin),void 0!==h.longitude_of_false_origin&&(h.long0=h.longitude_of_false_origin),void 0!==h.latitude_of_standard_parallel&&(h.lat0=h.latitude_of_standard_parallel,h.lat1=h.latitude_of_standard_parallel),void 0!==h.latitude_of_1st_standard_parallel&&(h.lat1=h.latitude_of_1st_standard_parallel),void 0!==h.latitude_of_2nd_standard_parallel&&(h.lat2=h.latitude_of_2nd_standard_parallel),void 0!==h.latitude_of_projection_centre&&(h.lat0=h.latitude_of_projection_centre),void 0!==h.longitude_of_projection_centre&&(h.longc=h.longitude_of_projection_centre),void 0!==h.easting_at_false_origin&&(h.x0=h.easting_at_false_origin),void 0!==h.northing_at_false_origin&&(h.y0=h.northing_at_false_origin),void 0!==h.latitude_of_natural_origin&&(h.lat0=h.latitude_of_natural_origin),void 0!==h.longitude_of_natural_origin&&(h.long0=h.longitude_of_natural_origin),void 0!==h.longitude_of_origin&&(h.long0=h.longitude_of_origin),void 0!==h.false_easting&&(h.x0=h.false_easting),h.easting_at_projection_centre&&(h.x0=h.easting_at_projection_centre),void 0!==h.false_northing&&(h.y0=h.false_northing),h.northing_at_projection_centre&&(h.y0=h.northing_at_projection_centre),void 0!==h.standard_parallel_1&&(h.lat1=h.standard_parallel_1),void 0!==h.standard_parallel_2&&(h.lat2=h.standard_parallel_2),void 0!==h.scale_factor_at_natural_origin&&(h.k0=h.scale_factor_at_natural_origin),void 0!==h.scale_factor_at_projection_centre&&(h.k0=h.scale_factor_at_projection_centre),void 0!==h.scale_factor_on_pseudo_standard_parallel&&(h.k0=h.scale_factor_on_pseudo_standard_parallel),void 0!==h.azimuth&&(h.alpha=h.azimuth),void 0!==h.azimuth_at_projection_centre&&(h.alpha=h.azimuth_at_projection_centre),h.angle_from_rectified_to_skew_grid&&(h.rectified_grid_angle=h.angle_from_rectified_to_skew_grid),applyProjectionDefaults(h),h):c}var Vo=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function cleanWKT(c){for(var h=Object.keys(c),g=0,m=h.length;g<m;++g){var b=h[g];-1!==Vo.indexOf(b)&&setPropertiesFromWkt(c[b]),"object"==typeof c[b]&&cleanWKT(c[b])}}function setPropertiesFromWkt(c){if(c.AUTHORITY){var h=Object.keys(c.AUTHORITY)[0];h&&h in c.AUTHORITY&&(c.title=h+":"+c.AUTHORITY[h])}if("GEOGCS"===c.type?c.projName="longlat":"LOCAL_CS"===c.type?(c.projName="identity",c.local=!0):"object"==typeof c.PROJECTION?c.projName=Object.keys(c.PROJECTION)[0]:c.projName=c.PROJECTION,c.AXIS){for(var g="",m=0,b=c.AXIS.length;m<b;++m){var w=[c.AXIS[m][0].toLowerCase(),c.AXIS[m][1].toLowerCase()];-1!==w[0].indexOf("north")||("y"===w[0]||"lat"===w[0])&&"north"===w[1]?g+="n":-1!==w[0].indexOf("south")||("y"===w[0]||"lat"===w[0])&&"south"===w[1]?g+="s":-1!==w[0].indexOf("east")||("x"===w[0]||"lon"===w[0])&&"east"===w[1]?g+="e":-1===w[0].indexOf("west")&&("x"!==w[0]&&"lon"!==w[0]||"west"!==w[1])||(g+="w")}2===g.length&&(g+="u"),3===g.length&&(c.axis=g)}c.UNIT&&(c.units=c.UNIT.name.toLowerCase(),"metre"===c.units&&(c.units="meter"),c.UNIT.convert&&("GEOGCS"===c.type?c.DATUM&&c.DATUM.SPHEROID&&(c.to_meter=c.UNIT.convert*c.DATUM.SPHEROID.a):c.to_meter=c.UNIT.convert));var S=c.GEOGCS;function toMeter(h){return h*(c.to_meter||1)}"GEOGCS"===c.type&&(S=c),S&&(S.DATUM?c.datumCode=S.DATUM.name.toLowerCase():c.datumCode=S.name.toLowerCase(),"d_"===c.datumCode.slice(0,2)&&(c.datumCode=c.datumCode.slice(2)),"new_zealand_1949"===c.datumCode&&(c.datumCode="nzgd49"),"wgs_1984"!==c.datumCode&&"world_geodetic_system_1984"!==c.datumCode||("Mercator_Auxiliary_Sphere"===c.PROJECTION&&(c.sphere=!0),c.datumCode="wgs84"),"belge_1972"===c.datumCode&&(c.datumCode="rnb72"),S.DATUM&&S.DATUM.SPHEROID&&(c.ellps=S.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===c.ellps.toLowerCase().slice(0,13)&&(c.ellps="intl"),c.a=S.DATUM.SPHEROID.a,c.rf=parseFloat(S.DATUM.SPHEROID.rf,10)),S.DATUM&&S.DATUM.TOWGS84&&(c.datum_params=S.DATUM.TOWGS84),~c.datumCode.indexOf("osgb_1936")&&(c.datumCode="osgb36"),~c.datumCode.indexOf("osni_1952")&&(c.datumCode="osni52"),(~c.datumCode.indexOf("tm65")||~c.datumCode.indexOf("geodetic_datum_of_1965"))&&(c.datumCode="ire65"),"ch1903+"===c.datumCode&&(c.datumCode="ch1903"),~c.datumCode.indexOf("israel")&&(c.datumCode="isr93")),c.b&&!isFinite(c.b)&&(c.b=c.a),c.rectified_grid_angle&&(c.rectified_grid_angle=d2r(c.rectified_grid_angle));[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",d2r],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",d2r],["x0","false_easting",toMeter],["y0","false_northing",toMeter],["long0","central_meridian",d2r],["lat0","latitude_of_origin",d2r],["lat0","standard_parallel_1",d2r],["lat1","standard_parallel_1",d2r],["lat2","standard_parallel_2",d2r],["azimuth","Azimuth"],["alpha","azimuth",d2r],["srsCode","name"]].forEach(function(h){return function rename(c,h){var g=h[0],m=h[1];!(g in c)&&m in c&&(c[g]=c[m],3===h.length&&(c[g]=h[2](c[g])))}(c,h)}),applyProjectionDefaults(c)}function wkt_parser(c){if("object"==typeof c)return transformPROJJSON(c);const h=function detectWKTVersion(c){const h=c.toUpperCase();return h.includes("PROJCRS")||h.includes("GEOGCRS")||h.includes("BOUNDCRS")||h.includes("VERTCRS")||h.includes("LENGTHUNIT")||h.includes("ANGLEUNIT")||h.includes("SCALEUNIT")?"WKT2":(h.includes("PROJCS")||h.includes("GEOGCS")||h.includes("LOCAL_CS")||h.includes("VERT_CS")||h.includes("UNIT"),"WKT1")}(c);var g=Ro(c);if("WKT2"===h){return transformPROJJSON(buildPROJJSON(g))}var m=g[0],b={};return sExpr(g,b),cleanWKT(b),b[m]}function defs(c){var h=this;if(2===arguments.length){var g=arguments[1];"string"==typeof g?"+"===g.charAt(0)?defs[c]=projString(arguments[1]):defs[c]=wkt_parser(arguments[1]):g&&"object"==typeof g&&!("projName"in g)?defs[c]=wkt_parser(arguments[1]):(defs[c]=g,g||delete defs[c])}else if(1===arguments.length){if(Array.isArray(c))return c.map(function(c){return Array.isArray(c)?defs.apply(h,c):defs(c)});if("string"==typeof c){if(c in defs)return defs[c]}else"EPSG"in c?defs["EPSG:"+c.EPSG]=c:"ESRI"in c?defs["ESRI:"+c.ESRI]=c:"IAU2000"in c?defs["IAU2000:"+c.IAU2000]=c:console.log(c);return}}!function global(c){c("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),c("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),c("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var h=1;h<=60;++h)c("EPSG:"+(32600+h),"+proj=utm +zone="+h+" +datum=WGS84 +units=m"),c("EPSG:"+(32700+h),"+proj=utm +zone="+h+" +south +datum=WGS84 +units=m");c("EPSG:5041","+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),c("EPSG:5042","+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),c.WGS84=c["EPSG:4326"],c["EPSG:3785"]=c["EPSG:3857"],c.GOOGLE=c["EPSG:3857"],c["EPSG:900913"]=c["EPSG:3857"],c["EPSG:102113"]=c["EPSG:3857"]}(defs);const $o=defs;var Xo=["3857","900913","3785","102113"];const Ko=function parse(c){if(!function testObj(c){return"string"==typeof c}(c))return"projName"in c?c:wkt_parser(c);if(function testDef(c){return c in $o}(c))return $o[c];if(function testWKT(c){return 0!==c.indexOf("+")&&-1!==c.indexOf("[")||"object"==typeof c&&!("srsCode"in c)}(c)){var h=wkt_parser(c);if(function checkMercator(c){var h=match(c,"authority");if(h){var g=match(h,"epsg");return g&&Xo.indexOf(g)>-1}}(h))return $o["EPSG:3857"];var g=function checkProjStr(c){var h=match(c,"extension");if(h)return match(h,"proj4")}(h);return g?projString(g):h}return function testProj(c){return"+"===c[0]}(c)?projString(c):void 0};function lib_extend(c,h){var g,m;if(c=c||{},!h)return c;for(m in h)void 0!==(g=h[m])&&(c[m]=g);return c}function msfnz(c,h,g){var m=c*h;return g/Math.sqrt(1-m*m)}function common_sign(c){return c<0?-1:1}function adjust_lon(c,h){return h||Math.abs(c)<=Lo?c:c-common_sign(c)*Po}function tsfnz(c,h,g){var m=c*g,b=.5*c;return m=Math.pow((1-m)/(1+m),b),Math.tan(.5*(Mo-h))/m}function phi2z(c,h){for(var g,m,b=.5*c,w=Mo-2*Math.atan(h),S=0;S<=15;S++)if(g=c*Math.sin(w),w+=m=Mo-2*Math.atan(h*Math.pow((1-g)/(1+g),b))-w,Math.abs(m)<=1e-10)return w;return-9999}const Zo={init:function init(){var c=this.b/this.a;this.es=1-c*c,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=msfnz(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function forward(c){var h,g,m=c.x,b=c.y;if(b*Eo>90&&b*Eo<-90&&m*Eo>180&&m*Eo<-180)return null;if(Math.abs(Math.abs(b)-Mo)<=ko)return null;if(this.sphere)h=this.x0+this.a*this.k0*adjust_lon(m-this.long0,this.over),g=this.y0+this.a*this.k0*Math.log(Math.tan(Io+.5*b));else{var w=Math.sin(b),S=tsfnz(this.e,b,w);h=this.x0+this.a*this.k0*adjust_lon(m-this.long0,this.over),g=this.y0-this.a*this.k0*Math.log(S)}return c.x=h,c.y=g,c},inverse:function inverse(c){var h,g,m=c.x-this.x0,b=c.y-this.y0;if(this.sphere)g=Mo-2*Math.atan(Math.exp(-b/(this.a*this.k0)));else{var w=Math.exp(-b/(this.a*this.k0));if(-9999===(g=phi2z(this.e,w)))return null}return h=adjust_lon(this.long0+m/(this.a*this.k0),this.over),c.x=h,c.y=g,c},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"]};function longlat_identity(c){return c}var Jo=["longlat","identity"];var Qo=[Zo,{init:function longlat_init(){},forward:longlat_identity,inverse:longlat_identity,names:Jo}],ta={},ea=[];function add(c,h){var g=ea.length;return c.names?(ea[g]=c,c.names.forEach(function(c){ta[c.toLowerCase()]=g}),this):(console.log(h),!0)}function getNormalizedProjName(c){return c.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}const na={start:function start(){Qo.forEach(add)},add,get:function projections_get(c){if(!c)return!1;var h=c.toLowerCase();return void 0!==ta[h]&&ea[ta[h]]||(h=getNormalizedProjName(h))in ta&&ea[ta[h]]?ea[ta[h]]:void 0}};const ra={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},oa=ra.WGS84;var aa={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-8.393,0.749,-10.276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"374,150,588"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"}};for(var ia in aa){var sa=aa[ia];sa.datumName&&(aa[sa.datumName]=sa)}const la=aa;const ca=function datum_datum(c,h,g,m,b,w,S){var M={};return M.datum_type=void 0===c||"none"===c?5:4,h&&(M.datum_params=h.map(parseFloat),0===M.datum_params[0]&&0===M.datum_params[1]&&0===M.datum_params[2]||(M.datum_type=1),M.datum_params.length>3&&(0===M.datum_params[3]&&0===M.datum_params[4]&&0===M.datum_params[5]&&0===M.datum_params[6]||(M.datum_type=2,M.datum_params[3]*=So,M.datum_params[4]*=So,M.datum_params[5]*=So,M.datum_params[6]=M.datum_params[6]/1e6+1))),S&&(M.datum_type=3,M.grids=S),M.a=g,M.b=m,M.es=b,M.ep2=w,M};var ua={};async function readGeotiffGrid(c,h){for(var g=[],m=await h.getImageCount(),b=m-1;b>=0;b--){var w=await h.getImage(b),S=await w.readRasters(),M=[w.getWidth(),w.getHeight()],k=w.getBoundingBox().map(degreesToRadians),T=[w.fileDirectory.ModelPixelScale[0],w.fileDirectory.ModelPixelScale[1]].map(degreesToRadians),E=k[0]+(M[0]-1)*T[0],I=k[3]-(M[1]-1)*T[1],P=S[0],L=S[1],B=[];for(let c=M[1]-1;c>=0;c--)for(let h=M[0]-1;h>=0;h--){var z=c*M[0]+h;B.push([-secondsToRadians(L[z]),secondsToRadians(P[z])])}g.push({del:T,lim:M,ll:[-E,I],cvs:B})}var j={header:{nSubgrids:m},subgrids:g};return ua[c]=j,j}function parseNadgridString(c){if(0===c.length)return null;var h="@"===c[0];return h&&(c=c.slice(1)),"null"===c?{name:"null",mandatory:!h,grid:null,isNull:!0}:{name:c,mandatory:!h,grid:ua[c]||null,isNull:!1}}function degreesToRadians(c){return c*Math.PI/180}function secondsToRadians(c){return c/3600*Math.PI/180}function decodeString(c,h,g){return String.fromCharCode.apply(null,new Uint8Array(c.buffer.slice(h,g)))}function mapNodes(c){return c.map(function(c){return[secondsToRadians(c.longitudeShift),secondsToRadians(c.latitudeShift)]})}function readGridHeader(c,h,g){return{name:decodeString(c,h+8,h+16).trim(),parent:decodeString(c,h+24,h+24+8).trim(),lowerLatitude:c.getFloat64(h+72,g),upperLatitude:c.getFloat64(h+88,g),lowerLongitude:c.getFloat64(h+104,g),upperLongitude:c.getFloat64(h+120,g),latitudeInterval:c.getFloat64(h+136,g),longitudeInterval:c.getFloat64(h+152,g),gridNodeCount:c.getInt32(h+168,g)}}function readGridNodes(c,h,g,m,b){var w=h+176,S=16;!1===b&&(S=8);for(var M=[],k=0;k<g.gridNodeCount;k++){var T={latitudeShift:c.getFloat32(w+k*S,m),longitudeShift:c.getFloat32(w+k*S+4,m)};!1!==b&&(T.latitudeAccuracy=c.getFloat32(w+k*S+8,m),T.longitudeAccuracy=c.getFloat32(w+k*S+12,m)),M.push(T)}return M}function Projection(c,h){if(!(this instanceof Projection))return new Projection(c);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,h=h||function(c){if(c)throw c};var g=Ko(c);if("object"==typeof g){var m=Projection.projections.get(g.projName);if(m){if(g.datumCode&&"none"!==g.datumCode){var b=match(la,g.datumCode);b&&(g.datum_params=g.datum_params||(b.towgs84?b.towgs84.split(","):null),g.ellps=b.ellipse,g.datumName=b.datumName?b.datumName:g.datumCode)}g.k0=g.k0||1,g.axis=g.axis||"enu",g.ellps=g.ellps||"wgs84",g.lat1=g.lat1||g.lat0;var w=function sphere(c,h,g,m,b){if(!c){var w=match(ra,m);w||(w=oa),c=w.a,h=w.b,g=w.rf}return g&&!h&&(h=(1-1/g)*c),(0===g||Math.abs(c-h)<ko)&&(b=!0,h=c),{a:c,b:h,rf:g,sphere:b}}(g.a,g.b,g.rf,g.ellps,g.sphere),S=function eccentricity(c,h,g,m){var b=c*c,w=h*h,S=(b-w)/b,M=0;return m?(b=(c*=1-S*(.16666666666666666+S*(.04722222222222222+.022156084656084655*S)))*c,S=0):M=Math.sqrt(S),{es:S,e:M,ep2:(b-w)/w}}(w.a,w.b,w.rf,g.R_A),M=function getNadgrids(c){return void 0===c?null:c.split(",").map(parseNadgridString)}(g.nadgrids),k=g.datum||ca(g.datumCode,g.datum_params,w.a,w.b,S.es,S.ep2,M);lib_extend(this,g),lib_extend(this,m),this.a=w.a,this.b=w.b,this.rf=w.rf,this.sphere=w.sphere,this.es=S.es,this.e=S.e,this.ep2=S.ep2,this.datum=k,"init"in this&&"function"==typeof this.init&&this.init(),h(null,this)}else h("Could not get projection name from: "+c)}else h("Could not parse to valid json: "+c)}Projection.projections=na,Projection.projections.start();const ha=Projection;function geodeticToGeocentric(c,h,g){var m,b,w,S,M=c.x,k=c.y,T=c.z?c.z:0;if(k<-Mo&&k>-1.001*Mo)k=-Mo;else if(k>Mo&&k<1.001*Mo)k=Mo;else{if(k<-Mo)return{x:-1/0,y:-1/0,z:c.z};if(k>Mo)return{x:1/0,y:1/0,z:c.z}}return M>Math.PI&&(M-=2*Math.PI),b=Math.sin(k),S=Math.cos(k),w=b*b,{x:((m=g/Math.sqrt(1-h*w))+T)*S*Math.cos(M),y:(m+T)*S*Math.sin(M),z:(m*(1-h)+T)*b}}function geocentricToGeodetic(c,h,g,m){var b,w,S,M,k,T,E,I,P,L,B,z,j,D,N,R=1e-12,G=c.x,q=c.y,W=c.z?c.z:0;if(b=Math.sqrt(G*G+q*q),w=Math.sqrt(G*G+q*q+W*W),b/g<R){if(D=0,w/g<R)return N=-m,{x:c.x,y:c.y,z:c.z}}else D=Math.atan2(q,G);S=W/w,I=(M=b/w)*(1-h)*(k=1/Math.sqrt(1-h*(2-h)*M*M)),P=S*k,j=0;do{j++,T=h*(E=g/Math.sqrt(1-h*P*P))/(E+(N=b*I+W*P-E*(1-h*P*P))),z=(B=S*(k=1/Math.sqrt(1-T*(2-T)*M*M)))*I-(L=M*(1-T)*k)*P,I=L,P=B}while(z*z>1e-24&&j<30);return{x:D,y:Math.atan(B/Math.abs(L)),z:N}}function checkParams(c){return 1===c||2===c}function datum_transform(c,h,g){if(function compareDatums(c,h){return c.datum_type===h.datum_type&&!(c.a!==h.a||Math.abs(c.es-h.es)>5e-11)&&(1===c.datum_type?c.datum_params[0]===h.datum_params[0]&&c.datum_params[1]===h.datum_params[1]&&c.datum_params[2]===h.datum_params[2]:2!==c.datum_type||c.datum_params[0]===h.datum_params[0]&&c.datum_params[1]===h.datum_params[1]&&c.datum_params[2]===h.datum_params[2]&&c.datum_params[3]===h.datum_params[3]&&c.datum_params[4]===h.datum_params[4]&&c.datum_params[5]===h.datum_params[5]&&c.datum_params[6]===h.datum_params[6])}(c,h))return g;if(5===c.datum_type||5===h.datum_type)return g;var m=c.a,b=c.es;if(3===c.datum_type){if(0!==applyGridShift(c,!1,g))return;m=wo,b=Co}var w=h.a,S=h.b,M=h.es;if(3===h.datum_type&&(w=wo,S=6356752.314,M=Co),b===M&&m===w&&!checkParams(c.datum_type)&&!checkParams(h.datum_type))return g;if((g=geodeticToGeocentric(g,b,m),checkParams(c.datum_type)&&(g=function geocentricToWgs84(c,h,g){if(1===h)return{x:c.x+g[0],y:c.y+g[1],z:c.z+g[2]};if(2===h){var m=g[0],b=g[1],w=g[2],S=g[3],M=g[4],k=g[5],T=g[6];return{x:T*(c.x-k*c.y+M*c.z)+m,y:T*(k*c.x+c.y-S*c.z)+b,z:T*(-M*c.x+S*c.y+c.z)+w}}}(g,c.datum_type,c.datum_params)),checkParams(h.datum_type)&&(g=function geocentricFromWgs84(c,h,g){if(1===h)return{x:c.x-g[0],y:c.y-g[1],z:c.z-g[2]};if(2===h){var m=g[0],b=g[1],w=g[2],S=g[3],M=g[4],k=g[5],T=g[6],E=(c.x-m)/T,I=(c.y-b)/T,P=(c.z-w)/T;return{x:E+k*I-M*P,y:-k*E+I+S*P,z:M*E-S*I+P}}}(g,h.datum_type,h.datum_params)),g=geocentricToGeodetic(g,M,w,S),3===h.datum_type)&&0!==applyGridShift(h,!0,g))return;return g}function applyGridShift(c,h,g){if(null===c.grids||0===c.grids.length)return console.log("Grid shift grids not found"),-1;var m={x:-g.x,y:g.y},b={x:Number.NaN,y:Number.NaN},w=[];t:for(var S=0;S<c.grids.length;S++){var M=c.grids[S];if(w.push(M.name),M.isNull){b=m;break}if(null!==M.grid)for(var k=M.grid.subgrids,T=0,E=k.length;T<E;T++){var I=k[T],P=(Math.abs(I.del[1])+Math.abs(I.del[0]))/1e4,L=I.ll[0]-P,B=I.ll[1]-P,z=I.ll[0]+(I.lim[0]-1)*I.del[0]+P,j=I.ll[1]+(I.lim[1]-1)*I.del[1]+P;if(!(B>m.y||L>m.x||j<m.y||z<m.x)&&(b=applySubgridShift(m,h,I),!isNaN(b.x)))break t}else if(M.mandatory)return console.log("Unable to find mandatory grid '"+M.name+"'"),-1}return isNaN(b.x)?(console.log("Failed to find a grid shift table for location '"+-m.x*Eo+" "+m.y*Eo+" tried: '"+w+"'"),-1):(g.x=-b.x,g.y=b.y,0)}function applySubgridShift(c,h,g){var m={x:Number.NaN,y:Number.NaN};if(isNaN(c.x))return m;var b={x:c.x,y:c.y};b.x-=g.ll[0],b.y-=g.ll[1],b.x=adjust_lon(b.x-Math.PI)+Math.PI;var w=nadInterpolate(b,g);if(h){if(isNaN(w.x))return m;w.x=b.x-w.x,w.y=b.y-w.y;var S,M,k=9;do{if(M=nadInterpolate(w,g),isNaN(M.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}S={x:b.x-(M.x+w.x),y:b.y-(M.y+w.y)},w.x+=S.x,w.y+=S.y}while(k--&&Math.abs(S.x)>1e-12&&Math.abs(S.y)>1e-12);if(k<0)return console.log("Inverse grid shift iterator failed to converge."),m;m.x=adjust_lon(w.x+g.ll[0]),m.y=w.y+g.ll[1]}else isNaN(w.x)||(m.x=c.x+w.x,m.y=c.y+w.y);return m}function nadInterpolate(c,h){var g,m={x:c.x/h.del[0],y:c.y/h.del[1]},b=Math.floor(m.x),w=Math.floor(m.y),S=m.x-1*b,M=m.y-1*w,k={x:Number.NaN,y:Number.NaN};if(b<0||b>=h.lim[0])return k;if(w<0||w>=h.lim[1])return k;g=w*h.lim[0]+b;var T=h.cvs[g][0],E=h.cvs[g][1];g++;var I=h.cvs[g][0],P=h.cvs[g][1];g+=h.lim[0];var L=h.cvs[g][0],B=h.cvs[g][1];g--;var z=h.cvs[g][0],j=h.cvs[g][1],D=S*M,N=S*(1-M),R=(1-S)*(1-M),G=(1-S)*M;return k.x=R*T+N*I+G*z+D*L,k.y=R*E+N*P+G*j+D*B,k}function adjust_axis(c,h,g){var m,b,w,S=g.x,M=g.y,k=g.z||0,T={};for(w=0;w<3;w++)if(!h||2!==w||void 0!==g.z)switch(0===w?(m=S,b=-1!=="ew".indexOf(c.axis[w])?"x":"y"):1===w?(m=M,b=-1!=="ns".indexOf(c.axis[w])?"y":"x"):(m=k,b="z"),c.axis[w]){case"e":case"n":T[b]=m;break;case"w":case"s":T[b]=-m;break;case"u":void 0!==g[b]&&(T.z=m);break;case"d":void 0!==g[b]&&(T.z=-m);break;default:return null}return T}function toPoint(c){var h={x:c[0],y:c[1]};return c.length>2&&(h.z=c[2]),c.length>3&&(h.m=c[3]),h}function checkCoord(c){if("function"==typeof Number.isFinite){if(Number.isFinite(c))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof c||c!=c||!isFinite(c))throw new TypeError("coordinates must be finite numbers")}function transform_transform(c,h,g,m){var b,w=void 0!==(g=Array.isArray(g)?toPoint(g):{x:g.x,y:g.y,z:g.z,m:g.m}).z;if(function checkSanity(c){checkCoord(c.x),checkCoord(c.y)}(g),c.datum&&h.datum&&function checkNotWGS(c,h){return(1===c.datum.datum_type||2===c.datum.datum_type||3===c.datum.datum_type)&&"WGS84"!==h.datumCode||(1===h.datum.datum_type||2===h.datum.datum_type||3===h.datum.datum_type)&&"WGS84"!==c.datumCode}(c,h)&&(g=transform_transform(c,b=new ha("WGS84"),g,m),c=b),m&&"enu"!==c.axis&&(g=adjust_axis(c,!1,g)),"longlat"===c.projName)g={x:g.x*To,y:g.y*To,z:g.z||0};else if(c.to_meter&&(g={x:g.x*c.to_meter,y:g.y*c.to_meter,z:g.z||0}),!(g=c.inverse(g)))return;if(c.from_greenwich&&(g.x+=c.from_greenwich),g=datum_transform(c.datum,h.datum,g))return h.from_greenwich&&(g={x:g.x-h.from_greenwich,y:g.y,z:g.z||0}),"longlat"===h.projName?g={x:g.x*Eo,y:g.y*Eo,z:g.z||0}:(g=h.forward(g),h.to_meter&&(g={x:g.x/h.to_meter,y:g.y/h.to_meter,z:g.z||0})),m&&"enu"!==h.axis?adjust_axis(h,!0,g):(g&&!w&&delete g.z,g)}var da=ha("WGS84");function core_transformer(c,h,g,m){var b,w,S;return Array.isArray(g)?(b=transform_transform(c,h,g,m)||{x:NaN,y:NaN},g.length>2?void 0!==c.name&&"geocent"===c.name||void 0!==h.name&&"geocent"===h.name?"number"==typeof b.z?[b.x,b.y,b.z].concat(g.slice(3)):[b.x,b.y,g[2]].concat(g.slice(3)):[b.x,b.y].concat(g.slice(2)):[b.x,b.y]):(w=transform_transform(c,h,g,m),2===(S=Object.keys(g)).length||S.forEach(function(m){if(void 0!==c.name&&"geocent"===c.name||void 0!==h.name&&"geocent"===h.name){if("x"===m||"y"===m||"z"===m)return}else if("x"===m||"y"===m)return;w[m]=g[m]}),w)}function checkProj(c){return c instanceof ha?c:"object"==typeof c&&"oProj"in c?c.oProj:ha(c)}const pa=function core_proj4(c,h,g){var m,b,w,S=!1;return void 0===h?(b=checkProj(c),m=da,S=!0):(void 0!==h.x||Array.isArray(h))&&(g=h,b=checkProj(c),m=da,S=!0),m||(m=checkProj(c)),b||(b=checkProj(h)),g?core_transformer(m,b,g):(w={forward:function(c,h){return core_transformer(m,b,c,h)},inverse:function(c,h){return core_transformer(b,m,c,h)}},S&&(w.oProj=b),w)};var fa="AJSAJS",ga="AFAFAF",_a=65,ma=73,va=79,ya=86,Aa=90;const ba={forward:mgrs_forward,inverse:function mgrs_inverse(c){var h=UTMtoLL(decode(c.toUpperCase()));if(h.lat&&h.lon)return[h.lon,h.lat,h.lon,h.lat];return[h.left,h.bottom,h.right,h.top]},toPoint:mgrs_toPoint};function mgrs_forward(c,h){return h=h||5,function encode(c,h){var g="00000"+c.easting,m="00000"+c.northing;return c.zoneNumber+c.zoneLetter+function get100kID(c,h,g){var m=get100kSetForZone(g),b=Math.floor(c/1e5),w=Math.floor(h/1e5)%20;return function getLetter100kID(c,h,g){var m=g-1,b=fa.charCodeAt(m),w=ga.charCodeAt(m),S=b+c-1,M=w+h,k=!1;S>Aa&&(S=S-Aa+_a-1,k=!0);(S===ma||b<ma&&S>ma||(S>ma||b<ma)&&k)&&S++;(S===va||b<va&&S>va||(S>va||b<va)&&k)&&++S===ma&&S++;S>Aa&&(S=S-Aa+_a-1);M>ya?(M=M-ya+_a-1,k=!0):k=!1;(M===ma||w<ma&&M>ma||(M>ma||w<ma)&&k)&&M++;(M===va||w<va&&M>va||(M>va||w<va)&&k)&&++M===ma&&M++;M>ya&&(M=M-ya+_a-1);return String.fromCharCode(S)+String.fromCharCode(M)}(b,w,m)}(c.easting,c.northing,c.zoneNumber)+g.substr(g.length-5,h)+m.substr(m.length-5,h)}(function LLtoUTM(c){var h,g,m,b,w,S,M,k,T=c.lat,E=c.lon,I=6378137,P=.00669438,L=.9996,B=degToRad(T),z=degToRad(E);k=Math.floor((E+180)/6)+1,180===E&&(k=60);T>=56&&T<64&&E>=3&&E<12&&(k=32);T>=72&&T<84&&(E>=0&&E<9?k=31:E>=9&&E<21?k=33:E>=21&&E<33?k=35:E>=33&&E<42&&(k=37));M=degToRad(6*(k-1)-180+3),h=P/(1-P),g=I/Math.sqrt(1-P*Math.sin(B)*Math.sin(B)),m=Math.tan(B)*Math.tan(B),b=h*Math.cos(B)*Math.cos(B),w=Math.cos(B)*(z-M),S=I*((1-P/4-3*P*P/64-5*P*P*P/256)*B-(3*P/8+3*P*P/32+45*P*P*P/1024)*Math.sin(2*B)+(15*P*P/256+45*P*P*P/1024)*Math.sin(4*B)-35*P*P*P/3072*Math.sin(6*B));var j=L*g*(w+(1-m+b)*w*w*w/6+(5-18*m+m*m+72*b-58*h)*w*w*w*w*w/120)+5e5,D=L*(S+g*Math.tan(B)*(w*w/2+(5-m+9*b+4*b*b)*w*w*w*w/24+(61-58*m+m*m+600*b-330*h)*w*w*w*w*w*w/720));T<0&&(D+=1e7);return{northing:Math.round(D),easting:Math.round(j),zoneNumber:k,zoneLetter:getLetterDesignator(T)}}({lat:c[1],lon:c[0]}),h)}function mgrs_toPoint(c){var h=UTMtoLL(decode(c.toUpperCase()));return h.lat&&h.lon?[h.lon,h.lat]:[(h.left+h.right)/2,(h.top+h.bottom)/2]}function degToRad(c){return c*(Math.PI/180)}function radToDeg(c){return c/Math.PI*180}function UTMtoLL(c){var h=c.northing,g=c.easting,m=c.zoneLetter,b=c.zoneNumber;if(b<0||b>60)return null;var w,S,M,k,T,E,I,P,L,B=.9996,z=6378137,j=.00669438,D=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),N=g-5e5,R=h;m<"N"&&(R-=1e7),I=6*(b-1)-180+3,w=.006739496752268451,L=(P=R/B/6367449.145945056)+(3*D/2-27*D*D*D/32)*Math.sin(2*P)+(21*D*D/16-55*D*D*D*D/32)*Math.sin(4*P)+151*D*D*D/96*Math.sin(6*P),S=z/Math.sqrt(1-j*Math.sin(L)*Math.sin(L)),M=Math.tan(L)*Math.tan(L),k=w*Math.cos(L)*Math.cos(L),T=.99330562*z/Math.pow(1-j*Math.sin(L)*Math.sin(L),1.5),E=N/(S*B);var G=L-S*Math.tan(L)/T*(E*E/2-(5+3*M+10*k-4*k*k-9*w)*E*E*E*E/24+(61+90*M+298*k+45*M*M-1.6983531815716497-3*k*k)*E*E*E*E*E*E/720);G=radToDeg(G);var q,W=(E-(1+2*M+k)*E*E*E/6+(5-2*k+28*M-3*k*k+8*w+24*M*M)*E*E*E*E*E/120)/Math.cos(L);if(W=I+radToDeg(W),c.accuracy){var H=UTMtoLL({northing:c.northing+c.accuracy,easting:c.easting+c.accuracy,zoneLetter:c.zoneLetter,zoneNumber:c.zoneNumber});q={top:H.lat,right:H.lon,bottom:G,left:W}}else q={lat:G,lon:W};return q}function getLetterDesignator(c){var h="Z";return 84>=c&&c>=72?h="X":72>c&&c>=64?h="W":64>c&&c>=56?h="V":56>c&&c>=48?h="U":48>c&&c>=40?h="T":40>c&&c>=32?h="S":32>c&&c>=24?h="R":24>c&&c>=16?h="Q":16>c&&c>=8?h="P":8>c&&c>=0?h="N":0>c&&c>=-8?h="M":-8>c&&c>=-16?h="L":-16>c&&c>=-24?h="K":-24>c&&c>=-32?h="J":-32>c&&c>=-40?h="H":-40>c&&c>=-48?h="G":-48>c&&c>=-56?h="F":-56>c&&c>=-64?h="E":-64>c&&c>=-72?h="D":-72>c&&c>=-80&&(h="C"),h}function get100kSetForZone(c){var h=c%6;return 0===h&&(h=6),h}function decode(c){if(c&&0===c.length)throw"MGRSPoint coverting from nothing";for(var h,g=c.length,m=null,b="",w=0;!/[A-Z]/.test(h=c.charAt(w));){if(w>=2)throw"MGRSPoint bad conversion from: "+c;b+=h,w++}var S=parseInt(b,10);if(0===w||w+3>g)throw"MGRSPoint bad conversion from: "+c;var M=c.charAt(w++);if(M<="A"||"B"===M||"Y"===M||M>="Z"||"I"===M||"O"===M)throw"MGRSPoint zone letter "+M+" not handled: "+c;m=c.substring(w,w+=2);for(var k=get100kSetForZone(S),T=function getEastingFromChar(c,h){var g=fa.charCodeAt(h-1),m=1e5,b=!1;for(;g!==c.charCodeAt(0);){if(++g===ma&&g++,g===va&&g++,g>Aa){if(b)throw"Bad character: "+c;g=_a,b=!0}m+=1e5}return m}(m.charAt(0),k),E=function getNorthingFromChar(c,h){if(c>"V")throw"MGRSPoint given invalid Northing "+c;var g=ga.charCodeAt(h-1),m=0,b=!1;for(;g!==c.charCodeAt(0);){if(++g===ma&&g++,g===va&&g++,g>ya){if(b)throw"Bad character: "+c;g=_a,b=!0}m+=1e5}return m}(m.charAt(1),k);E<getMinNorthing(M);)E+=2e6;var I=g-w;if(I%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+c;var P,L,B,z=I/2,j=0,D=0;return z>0&&(P=1e5/Math.pow(10,z),L=c.substring(w,w+z),j=parseFloat(L)*P,B=c.substring(w+z),D=parseFloat(B)*P),{easting:j+T,northing:D+E,zoneLetter:M,zoneNumber:S,accuracy:P}}function getMinNorthing(c){var h;switch(c){case"C":h=11e5;break;case"D":h=2e6;break;case"E":h=28e5;break;case"F":h=37e5;break;case"G":h=46e5;break;case"H":h=55e5;break;case"J":h=64e5;break;case"K":h=73e5;break;case"L":h=82e5;break;case"M":h=91e5;break;case"N":h=0;break;case"P":h=8e5;break;case"Q":h=17e5;break;case"R":h=26e5;break;case"S":h=35e5;break;case"T":h=44e5;break;case"U":h=53e5;break;case"V":h=62e5;break;case"W":h=7e6;break;case"X":h=79e5;break;default:h=-1}if(h>=0)return h;throw"Invalid zone letter: "+c}function Point(c,h,g){if(!(this instanceof Point))return new Point(c,h,g);if(Array.isArray(c))this.x=c[0],this.y=c[1],this.z=c[2]||0;else if("object"==typeof c)this.x=c.x,this.y=c.y,this.z=c.z||0;else if("string"==typeof c&&void 0===h){var m=c.split(",");this.x=parseFloat(m[0]),this.y=parseFloat(m[1]),this.z=parseFloat(m[2])||0}else this.x=c,this.y=h,this.z=g||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Point.fromMGRS=function(c){return new Point(mgrs_toPoint(c))},Point.prototype.toMGRS=function(c){return mgrs_forward([this.x,this.y],c)};const xa=Point;var wa=.046875,Ca=.01953125,Sa=.01068115234375;function pj_enfn(c){var h=[];h[0]=1-c*(.25+c*(wa+c*(Ca+c*Sa))),h[1]=c*(.75-c*(wa+c*(Ca+c*Sa)));var g=c*c;return h[2]=g*(.46875-c*(.013020833333333334+.007120768229166667*c)),g*=c,h[3]=g*(.3645833333333333-.005696614583333333*c),h[4]=g*c*.3076171875,h}function pj_mlfn(c,h,g,m){return g*=h,h*=h,m[0]*c-g*(m[1]+h*(m[2]+h*(m[3]+h*m[4])))}function pj_inv_mlfn(c,h,g){for(var m=1/(1-h),b=c,w=20;w;--w){var S=Math.sin(b),M=1-h*S*S;if(b-=M=(pj_mlfn(b,S,Math.cos(b),g)-c)*(M*Math.sqrt(M))*m,Math.abs(M)<ko)return b}return b}const Ma={init:function tmerc_init(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=pj_enfn(this.es),this.ml0=pj_mlfn(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function tmerc_forward(c){var h,g,m,b=c.x,w=c.y,S=adjust_lon(b-this.long0,this.over),M=Math.sin(w),k=Math.cos(w);if(this.es){var T=k*S,E=Math.pow(T,2),I=this.ep2*Math.pow(k,2),P=Math.pow(I,2),L=Math.abs(k)>ko?Math.tan(w):0,B=Math.pow(L,2),z=Math.pow(B,2);h=1-this.es*Math.pow(M,2),T/=Math.sqrt(h);var j=pj_mlfn(w,M,k,this.en);g=this.a*(this.k0*T*(1+E/6*(1-B+I+E/20*(5-18*B+z+14*I-58*B*I+E/42*(61+179*z-z*B-479*B)))))+this.x0,m=this.a*(this.k0*(j-this.ml0+M*S*T/2*(1+E/12*(5-B+9*I+4*P+E/30*(61+z-58*B+270*I-330*B*I+E/56*(1385+543*z-z*B-3111*B))))))+this.y0}else{var D=k*Math.sin(S);if(Math.abs(Math.abs(D)-1)<ko)return 93;if(g=.5*this.a*this.k0*Math.log((1+D)/(1-D))+this.x0,m=k*Math.cos(S)/Math.sqrt(1-Math.pow(D,2)),(D=Math.abs(m))>=1){if(D-1>ko)return 93;m=0}else m=Math.acos(m);w<0&&(m=-m),m=this.a*this.k0*(m-this.lat0)+this.y0}return c.x=g,c.y=m,c},inverse:function tmerc_inverse(c){var h,g,m,b,w=(c.x-this.x0)*(1/this.a),S=(c.y-this.y0)*(1/this.a);if(this.es)if(g=pj_inv_mlfn(h=this.ml0+S/this.k0,this.es,this.en),Math.abs(g)<Mo){var M=Math.sin(g),k=Math.cos(g),T=Math.abs(k)>ko?Math.tan(g):0,E=this.ep2*Math.pow(k,2),I=Math.pow(E,2),P=Math.pow(T,2),L=Math.pow(P,2);h=1-this.es*Math.pow(M,2);var B=w*Math.sqrt(h)/this.k0,z=Math.pow(B,2);m=g-(h*=T)*z/(1-this.es)*.5*(1-z/12*(5+3*P-9*E*P+E-4*I-z/30*(61+90*P-252*E*P+45*L+46*E-z/56*(1385+3633*P+4095*L+1574*L*P)))),b=adjust_lon(this.long0+B*(1-z/6*(1+2*P+E-z/20*(5+28*P+24*L+8*E*P+6*E-z/42*(61+662*P+1320*L+720*L*P))))/k,this.over)}else m=Mo*common_sign(S),b=0;else{var j=Math.exp(w/this.k0),D=.5*(j-1/j),N=this.lat0+S/this.k0,R=Math.cos(N);h=Math.sqrt((1-Math.pow(R,2))/(1+Math.pow(D,2))),m=Math.asin(h),S<0&&(m=-m),b=0===D&&0===R?0:adjust_lon(Math.atan2(D,R)+this.long0,this.over)}return c.x=b,c.y=m,c},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function common_sinh(c){var h=Math.exp(c);return h=(h-1/h)/2}function common_hypot(c,h){c=Math.abs(c),h=Math.abs(h);var g=Math.max(c,h),m=Math.min(c,h)/(g||1);return g*Math.sqrt(1+Math.pow(m,2))}function asinhy(c){var h=Math.abs(c);return h=function log1py(c){var h=1+c,g=h-1;return 0===g?c:c*Math.log(h)/g}(h*(1+h/(common_hypot(1,h)+1))),c<0?-h:h}function gatg(c,h){for(var g,m=2*Math.cos(2*h),b=c.length-1,w=c[b],S=0;--b>=0;)g=m*w-S+c[b],S=w,w=g;return h+g*Math.sin(2*h)}function clens_cmplx(c,h,g){for(var m,b,w=Math.sin(h),S=Math.cos(h),M=common_sinh(g),k=function common_cosh(c){var h=Math.exp(c);return(h+1/h)/2}(g),T=2*S*k,E=-2*w*M,I=c.length-1,P=c[I],L=0,B=0,z=0;--I>=0;)m=B,b=L,P=T*(B=P)-m-E*(L=z)+c[I],z=E*B-b+T*L;return[(T=w*k)*P-(E=S*M)*z,T*z+E*P]}const ka={init:function etmerc_init(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Ma.init.apply(this),this.forward=Ma.forward,this.inverse=Ma.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var c=this.es/(1+Math.sqrt(1-this.es)),h=c/(2-c),g=h;this.cgb[0]=h*(2+h*(-2/3+h*(h*(116/45+h*(26/45+h*(-2854/675)))-2))),this.cbg[0]=h*(h*(2/3+h*(4/3+h*(-82/45+h*(32/45+h*(4642/4725)))))-2),g*=h,this.cgb[1]=g*(7/3+h*(h*(-227/45+h*(2704/315+h*(2323/945)))-1.6)),this.cbg[1]=g*(5/3+h*(-16/15+h*(-13/9+h*(904/315+h*(-1522/945))))),g*=h,this.cgb[2]=g*(56/15+h*(-136/35+h*(-1262/105+h*(73814/2835)))),this.cbg[2]=g*(-26/15+h*(34/21+h*(1.6+h*(-12686/2835)))),g*=h,this.cgb[3]=g*(4279/630+h*(-332/35+h*(-399572/14175))),this.cbg[3]=g*(1237/630+h*(h*(-24832/14175)-2.4)),g*=h,this.cgb[4]=g*(4174/315+h*(-144838/6237)),this.cbg[4]=g*(-734/315+h*(109598/31185)),g*=h,this.cgb[5]=g*(601676/22275),this.cbg[5]=g*(444337/155925),g=Math.pow(h,2),this.Qn=this.k0/(1+h)*(1+g*(1/4+g*(1/64+g/256))),this.utg[0]=h*(h*(2/3+h*(-37/96+h*(1/360+h*(81/512+h*(-96199/604800)))))-.5),this.gtu[0]=h*(.5+h*(-2/3+h*(5/16+h*(41/180+h*(-127/288+h*(7891/37800)))))),this.utg[1]=g*(-1/48+h*(-1/15+h*(437/1440+h*(-46/105+h*(1118711/3870720))))),this.gtu[1]=g*(13/48+h*(h*(557/1440+h*(281/630+h*(-1983433/1935360)))-.6)),g*=h,this.utg[2]=g*(-17/480+h*(37/840+h*(209/4480+h*(-5569/90720)))),this.gtu[2]=g*(61/240+h*(-103/140+h*(15061/26880+h*(167603/181440)))),g*=h,this.utg[3]=g*(-4397/161280+h*(11/504+h*(830251/7257600))),this.gtu[3]=g*(49561/161280+h*(-179/168+h*(6601661/7257600))),g*=h,this.utg[4]=g*(-4583/161280+h*(108847/3991680)),this.gtu[4]=g*(34729/80640+h*(-3418889/1995840)),g*=h,this.utg[5]=g*(-20648693/638668800),this.gtu[5]=.6650675310896665*g;var m=gatg(this.cbg,this.lat0);this.Zb=-this.Qn*(m+function clens(c,h){for(var g,m=2*Math.cos(h),b=c.length-1,w=c[b],S=0;--b>=0;)g=m*w-S+c[b],S=w,w=g;return Math.sin(h)*g}(this.gtu,2*m))},forward:function etmerc_forward(c){var h=adjust_lon(c.x-this.long0,this.over),g=c.y;g=gatg(this.cbg,g);var m=Math.sin(g),b=Math.cos(g),w=Math.sin(h),S=Math.cos(h);g=Math.atan2(m,S*b),h=Math.atan2(w*b,common_hypot(m,b*S)),h=asinhy(Math.tan(h));var M,k,T=clens_cmplx(this.gtu,2*g,2*h);return g+=T[0],h+=T[1],Math.abs(h)<=2.623395162778?(M=this.a*(this.Qn*h)+this.x0,k=this.a*(this.Qn*g+this.Zb)+this.y0):(M=1/0,k=1/0),c.x=M,c.y=k,c},inverse:function etmerc_inverse(c){var h,g,m=(c.x-this.x0)*(1/this.a),b=(c.y-this.y0)*(1/this.a);if(b=(b-this.Zb)/this.Qn,m/=this.Qn,Math.abs(m)<=2.623395162778){var w=clens_cmplx(this.utg,2*b,2*m);b+=w[0],m+=w[1],m=Math.atan(common_sinh(m));var S=Math.sin(b),M=Math.cos(b),k=Math.sin(m),T=Math.cos(m);b=Math.atan2(S*T,common_hypot(k,T*M)),h=adjust_lon((m=Math.atan2(k,T*M))+this.long0,this.over),g=gatg(this.cgb,b)}else h=1/0,g=1/0;return c.x=h,c.y=g,c},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]};const Ta={init:function utm_init(){var c=function adjust_zone(c,h){if(void 0===c){if((c=Math.floor(30*(adjust_lon(h)+Math.PI)/Math.PI)+1)<0)return 0;if(c>60)return 60}return c}(this.zone,this.long0);if(void 0===c)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(c)-183)*To,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,ka.init.apply(this),this.forward=ka.forward,this.inverse=ka.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function srat(c,h){return Math.pow((1-c)/(1+c),h)}const Ea={init:function gauss_init(){var c=Math.sin(this.lat0),h=Math.cos(this.lat0);h*=h,this.rc=Math.sqrt(1-this.es)/(1-this.es*c*c),this.C=Math.sqrt(1+this.es*h*h/(1-this.es)),this.phic0=Math.asin(c/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Io)/(Math.pow(Math.tan(.5*this.lat0+Io),this.C)*srat(this.e*c,this.ratexp))},forward:function gauss_forward(c){var h=c.x,g=c.y;return c.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*g+Io),this.C)*srat(this.e*Math.sin(g),this.ratexp))-Mo,c.x=this.C*h,c},inverse:function gauss_inverse(c){for(var h=c.x/this.C,g=c.y,m=Math.pow(Math.tan(.5*g+Io)/this.K,1/this.C),b=20;b>0&&(g=2*Math.atan(m*srat(this.e*Math.sin(c.y),-.5*this.e))-Mo,!(Math.abs(g-c.y)<1e-14));--b)c.y=g;return b?(c.x=h,c.y=g,c):null},names:["gauss"]};const Ia={init:function sterea_init(){Ea.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function sterea_forward(c){var h,g,m,b;return c.x=adjust_lon(c.x-this.long0,this.over),Ea.forward.apply(this,[c]),h=Math.sin(c.y),g=Math.cos(c.y),m=Math.cos(c.x),b=this.k0*this.R2/(1+this.sinc0*h+this.cosc0*g*m),c.x=b*g*Math.sin(c.x),c.y=b*(this.cosc0*h-this.sinc0*g*m),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function sterea_inverse(c){var h,g,m,b,w;if(c.x=(c.x-this.x0)/this.a,c.y=(c.y-this.y0)/this.a,c.x/=this.k0,c.y/=this.k0,w=common_hypot(c.x,c.y)){var S=2*Math.atan2(w,this.R2);h=Math.sin(S),g=Math.cos(S),b=Math.asin(g*this.sinc0+c.y*h*this.cosc0/w),m=Math.atan2(c.x*h,w*this.cosc0*g-c.y*this.sinc0*h)}else b=this.phic0,m=0;return c.x=m,c.y=b,Ea.inverse.apply(this,[c]),c.x=adjust_lon(c.x+this.long0,this.over),c},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};function ssfn_(c,h,g){return h*=g,Math.tan(.5*(Mo+c))*Math.pow((1-h)/(1+h),.5*g)}const Pa={init:function stere_init(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=ko&&(this.k0=.5*(1+common_sign(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=ko&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=ko&&Math.abs(Math.cos(this.lat_ts))>ko&&(this.k0=.5*this.cons*msfnz(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/tsfnz(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=msfnz(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(ssfn_(this.lat0,this.sinlat0,this.e))-Mo,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function stere_forward(c){var h,g,m,b,w,S,M=c.x,k=c.y,T=Math.sin(k),E=Math.cos(k),I=adjust_lon(M-this.long0,this.over);return Math.abs(Math.abs(M-this.long0)-Math.PI)<=ko&&Math.abs(k+this.lat0)<=ko?(c.x=NaN,c.y=NaN,c):this.sphere?(h=2*this.k0/(1+this.sinlat0*T+this.coslat0*E*Math.cos(I)),c.x=this.a*h*E*Math.sin(I)+this.x0,c.y=this.a*h*(this.coslat0*T-this.sinlat0*E*Math.cos(I))+this.y0,c):(g=2*Math.atan(ssfn_(k,T,this.e))-Mo,b=Math.cos(g),m=Math.sin(g),Math.abs(this.coslat0)<=ko?(w=tsfnz(this.e,k*this.con,this.con*T),S=2*this.a*this.k0*w/this.cons,c.x=this.x0+S*Math.sin(M-this.long0),c.y=this.y0-this.con*S*Math.cos(M-this.long0),c):(Math.abs(this.sinlat0)<ko?(h=2*this.a*this.k0/(1+b*Math.cos(I)),c.y=h*m):(h=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*m+this.cosX0*b*Math.cos(I))),c.y=h*(this.cosX0*m-this.sinX0*b*Math.cos(I))+this.y0),c.x=h*b*Math.sin(I)+this.x0,c))},inverse:function stere_inverse(c){var h,g,m,b,w;c.x-=this.x0,c.y-=this.y0;var S=Math.sqrt(c.x*c.x+c.y*c.y);if(this.sphere){var M=2*Math.atan(S/(2*this.a*this.k0));return h=this.long0,g=this.lat0,S<=ko?(c.x=h,c.y=g,c):(g=Math.asin(Math.cos(M)*this.sinlat0+c.y*Math.sin(M)*this.coslat0/S),h=Math.abs(this.coslat0)<ko?this.lat0>0?adjust_lon(this.long0+Math.atan2(c.x,-1*c.y),this.over):adjust_lon(this.long0+Math.atan2(c.x,c.y),this.over):adjust_lon(this.long0+Math.atan2(c.x*Math.sin(M),S*this.coslat0*Math.cos(M)-c.y*this.sinlat0*Math.sin(M)),this.over),c.x=h,c.y=g,c)}if(Math.abs(this.coslat0)<=ko){if(S<=ko)return g=this.lat0,h=this.long0,c.x=h,c.y=g,c;c.x*=this.con,c.y*=this.con,m=S*this.cons/(2*this.a*this.k0),g=this.con*phi2z(this.e,m),h=this.con*adjust_lon(this.con*this.long0+Math.atan2(c.x,-1*c.y),this.over)}else b=2*Math.atan(S*this.cosX0/(2*this.a*this.k0*this.ms1)),h=this.long0,S<=ko?w=this.X0:(w=Math.asin(Math.cos(b)*this.sinX0+c.y*Math.sin(b)*this.cosX0/S),h=adjust_lon(this.long0+Math.atan2(c.x*Math.sin(b),S*this.cosX0*Math.cos(b)-c.y*this.sinX0*Math.sin(b)),this.over)),g=-1*phi2z(this.e,Math.tan(.5*(Mo+w)));return c.x=h,c.y=g,c},names:["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"],ssfn_};const La={init:function somerc_init(){var c=this.lat0;this.lambda0=this.long0;var h=Math.sin(c),g=this.a,m=1/this.rf,b=2*m-Math.pow(m,2),w=this.e=Math.sqrt(b);this.R=this.k0*g*Math.sqrt(1-b)/(1-b*Math.pow(h,2)),this.alpha=Math.sqrt(1+b/(1-b)*Math.pow(Math.cos(c),4)),this.b0=Math.asin(h/this.alpha);var S=Math.log(Math.tan(Math.PI/4+this.b0/2)),M=Math.log(Math.tan(Math.PI/4+c/2)),k=Math.log((1+w*h)/(1-w*h));this.K=S-this.alpha*M+this.alpha*w/2*k},forward:function somerc_forward(c){var h=Math.log(Math.tan(Math.PI/4-c.y/2)),g=this.e/2*Math.log((1+this.e*Math.sin(c.y))/(1-this.e*Math.sin(c.y))),m=-this.alpha*(h+g)+this.K,b=2*(Math.atan(Math.exp(m))-Math.PI/4),w=this.alpha*(c.x-this.lambda0),S=Math.atan(Math.sin(w)/(Math.sin(this.b0)*Math.tan(b)+Math.cos(this.b0)*Math.cos(w))),M=Math.asin(Math.cos(this.b0)*Math.sin(b)-Math.sin(this.b0)*Math.cos(b)*Math.cos(w));return c.y=this.R/2*Math.log((1+Math.sin(M))/(1-Math.sin(M)))+this.y0,c.x=this.R*S+this.x0,c},inverse:function somerc_inverse(c){for(var h=c.x-this.x0,g=c.y-this.y0,m=h/this.R,b=2*(Math.atan(Math.exp(g/this.R))-Math.PI/4),w=Math.asin(Math.cos(this.b0)*Math.sin(b)+Math.sin(this.b0)*Math.cos(b)*Math.cos(m)),S=Math.atan(Math.sin(m)/(Math.cos(this.b0)*Math.cos(m)-Math.sin(this.b0)*Math.tan(b))),M=this.lambda0+S/this.alpha,k=0,T=w,E=-1e3,I=0;Math.abs(T-E)>1e-7;){if(++I>20)return;k=1/this.alpha*(Math.log(Math.tan(Math.PI/4+w/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(T))/2)),E=T,T=2*Math.atan(Math.exp(k))-Math.PI/2}return c.x=M,c.y=T,c},names:["somerc"]};var Fa=1e-7;const Ba={init:function omerc_init(){var c,h,g,m,b,w,S,M,k,T,E,I=0,P=0,L=0,B=0,z=0,j=0,D=0;this.no_off=function isTypeA(c){var h=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],g="object"==typeof c.projName?Object.keys(c.projName)[0]:c.projName;return"no_uoff"in c||"no_off"in c||-1!==h.indexOf(g)||-1!==h.indexOf(getNormalizedProjName(g))}(this),this.no_rot="no_rot"in this;var N=!1;"alpha"in this&&(N=!0);var R=!1;if("rectified_grid_angle"in this&&(R=!0),N&&(D=this.alpha),R&&(I=this.rectified_grid_angle),N||R)P=this.longc;else if(L=this.long1,z=this.lat1,B=this.long2,j=this.lat2,Math.abs(z-j)<=Fa||(c=Math.abs(z))<=Fa||Math.abs(c-Mo)<=Fa||Math.abs(Math.abs(this.lat0)-Mo)<=Fa||Math.abs(Math.abs(j)-Mo)<=Fa)throw new Error;var G=1-this.es;h=Math.sqrt(G),Math.abs(this.lat0)>ko?(M=Math.sin(this.lat0),g=Math.cos(this.lat0),c=1-this.es*M*M,this.B=g*g,this.B=Math.sqrt(1+this.es*this.B*this.B/G),this.A=this.B*this.k0*h/c,(b=(m=this.B*h/(g*Math.sqrt(c)))*m-1)<=0?b=0:(b=Math.sqrt(b),this.lat0<0&&(b=-b)),this.E=b+=m,this.E*=Math.pow(tsfnz(this.e,this.lat0,M),this.B)):(this.B=1/h,this.A=this.k0,this.E=m=b=1),N||R?(N?(E=Math.asin(Math.sin(D)/m),R||(I=D)):(E=I,D=Math.asin(m*Math.sin(E))),this.lam0=P-Math.asin(.5*(b-1/b)*Math.tan(E))/this.B):(w=Math.pow(tsfnz(this.e,z,Math.sin(z)),this.B),S=Math.pow(tsfnz(this.e,j,Math.sin(j)),this.B),b=this.E/w,k=(S-w)/(S+w),T=((T=this.E*this.E)-S*w)/(T+S*w),(c=L-B)<-Math.PI?B-=Po:c>Math.PI&&(B+=Po),this.lam0=adjust_lon(.5*(L+B)-Math.atan(T*Math.tan(.5*this.B*(L-B))/k)/this.B,this.over),E=Math.atan(2*Math.sin(this.B*adjust_lon(L-this.lam0,this.over))/(b-1/b)),I=D=Math.asin(m*Math.sin(E))),this.singam=Math.sin(E),this.cosgam=Math.cos(E),this.sinrot=Math.sin(I),this.cosrot=Math.cos(I),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(m*m-1)/Math.cos(D))),this.lat0<0&&(this.u_0=-this.u_0)),b=.5*E,this.v_pole_n=this.ArB*Math.log(Math.tan(Io-b)),this.v_pole_s=this.ArB*Math.log(Math.tan(Io+b))},forward:function omerc_forward(c){var h,g,m,b,w,S,M,k,T={};if(c.x=c.x-this.lam0,Math.abs(Math.abs(c.y)-Mo)>ko){if(h=.5*((w=this.E/Math.pow(tsfnz(this.e,c.y,Math.sin(c.y)),this.B))-(S=1/w)),g=.5*(w+S),b=Math.sin(this.B*c.x),m=(h*this.singam-b*this.cosgam)/g,Math.abs(Math.abs(m)-1)<ko)throw new Error;k=.5*this.ArB*Math.log((1-m)/(1+m)),S=Math.cos(this.B*c.x),M=Math.abs(S)<Fa?this.A*c.x:this.ArB*Math.atan2(h*this.cosgam+b*this.singam,S)}else k=c.y>0?this.v_pole_n:this.v_pole_s,M=this.ArB*c.y;return this.no_rot?(T.x=M,T.y=k):(M-=this.u_0,T.x=k*this.cosrot+M*this.sinrot,T.y=M*this.cosrot-k*this.sinrot),T.x=this.a*T.x+this.x0,T.y=this.a*T.y+this.y0,T},inverse:function omerc_inverse(c){var h,g,m,b,w,S,M,k={};if(c.x=(c.x-this.x0)*(1/this.a),c.y=(c.y-this.y0)*(1/this.a),this.no_rot?(g=c.y,h=c.x):(g=c.x*this.cosrot-c.y*this.sinrot,h=c.y*this.cosrot+c.x*this.sinrot+this.u_0),b=.5*((m=Math.exp(-this.BrA*g))-1/m),w=.5*(m+1/m),M=((S=Math.sin(this.BrA*h))*this.cosgam+b*this.singam)/w,Math.abs(Math.abs(M)-1)<ko)k.x=0,k.y=M<0?-Mo:Mo;else{if(k.y=this.E/Math.sqrt((1+M)/(1-M)),k.y=phi2z(this.e,Math.pow(k.y,1/this.B)),k.y===1/0)throw new Error;k.x=-this.rB*Math.atan2(b*this.cosgam-S*this.singam,Math.cos(this.BrA*h))}return k.x+=this.lam0,k},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]};const Oa={init:function lcc_init(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<ko)){var c=this.b/this.a;this.e=Math.sqrt(1-c*c);var h=Math.sin(this.lat1),g=Math.cos(this.lat1),m=msfnz(this.e,h,g),b=tsfnz(this.e,this.lat1,h),w=Math.sin(this.lat2),S=Math.cos(this.lat2),M=msfnz(this.e,w,S),k=tsfnz(this.e,this.lat2,w),T=Math.abs(Math.abs(this.lat0)-Mo)<ko?0:tsfnz(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>ko?this.ns=Math.log(m/M)/Math.log(b/k):this.ns=h,isNaN(this.ns)&&(this.ns=h),this.f0=m/(this.ns*Math.pow(b,this.ns)),this.rh=this.a*this.f0*Math.pow(T,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function lcc_forward(c){var h=c.x,g=c.y;Math.abs(2*Math.abs(g)-Math.PI)<=ko&&(g=common_sign(g)*(Mo-2e-10));var m,b,w=Math.abs(Math.abs(g)-Mo);if(w>ko)m=tsfnz(this.e,g,Math.sin(g)),b=this.a*this.f0*Math.pow(m,this.ns);else{if((w=g*this.ns)<=0)return null;b=0}var S=this.ns*adjust_lon(h-this.long0,this.over);return c.x=this.k0*(b*Math.sin(S))+this.x0,c.y=this.k0*(this.rh-b*Math.cos(S))+this.y0,c},inverse:function lcc_inverse(c){var h,g,m,b,w,S=(c.x-this.x0)/this.k0,M=this.rh-(c.y-this.y0)/this.k0;this.ns>0?(h=Math.sqrt(S*S+M*M),g=1):(h=-Math.sqrt(S*S+M*M),g=-1);var k=0;if(0!==h&&(k=Math.atan2(g*S,g*M)),0!==h||this.ns>0){if(g=1/this.ns,m=Math.pow(h/(this.a*this.f0),g),-9999===(b=phi2z(this.e,m)))return null}else b=-Mo;return w=adjust_lon(k/this.ns+this.long0,this.over),c.x=w,c.y=b,c},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};const za={init:function krovak_init(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function krovak_forward(c){var h,g,m,b,w,S,M,k=c.x,T=c.y,E=adjust_lon(k-this.long0,this.over);return h=Math.pow((1+this.e*Math.sin(T))/(1-this.e*Math.sin(T)),this.alfa*this.e/2),g=2*(Math.atan(this.k*Math.pow(Math.tan(T/2+this.s45),this.alfa)/h)-this.s45),m=-E*this.alfa,b=Math.asin(Math.cos(this.ad)*Math.sin(g)+Math.sin(this.ad)*Math.cos(g)*Math.cos(m)),w=Math.asin(Math.cos(g)*Math.sin(m)/Math.cos(b)),S=this.n*w,M=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(b/2+this.s45),this.n),c.y=M*Math.cos(S)/1,c.x=M*Math.sin(S)/1,this.czech||(c.y*=-1,c.x*=-1),c},inverse:function krovak_inverse(c){var h,g,m,b,w,S,M,k=c.x;c.x=c.y,c.y=k,this.czech||(c.y*=-1,c.x*=-1),w=Math.sqrt(c.x*c.x+c.y*c.y),b=Math.atan2(c.y,c.x)/Math.sin(this.s0),m=2*(Math.atan(Math.pow(this.ro0/w,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),h=Math.asin(Math.cos(this.ad)*Math.sin(m)-Math.sin(this.ad)*Math.cos(m)*Math.cos(b)),g=Math.asin(Math.cos(m)*Math.sin(b)/Math.cos(h)),c.x=this.long0-g/this.alfa,S=h,M=0;var T=0;do{c.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(h/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(S))/(1-this.e*Math.sin(S)),this.e/2))-this.s45),Math.abs(S-c.y)<1e-10&&(M=1),S=c.y,T+=1}while(0===M&&T<15);return T>=15?null:c},names:["Krovak","krovak"]};function mlfn(c,h,g,m,b){return c*b-h*Math.sin(2*b)+g*Math.sin(4*b)-m*Math.sin(6*b)}function e0fn(c){return 1-.25*c*(1+c/16*(3+1.25*c))}function e1fn(c){return.375*c*(1+.25*c*(1+.46875*c))}function e2fn(c){return.05859375*c*c*(1+.75*c)}function e3fn(c){return c*c*c*(35/3072)}function gN(c,h,g){var m=h*g;return c/Math.sqrt(1-m*m)}function adjust_lat(c){return Math.abs(c)<Mo?c:c-common_sign(c)*Math.PI}function imlfn(c,h,g,m,b){var w,S;w=c/h;for(var M=0;M<15;M++)if(w+=S=(c-(h*w-g*Math.sin(2*w)+m*Math.sin(4*w)-b*Math.sin(6*w)))/(h-2*g*Math.cos(2*w)+4*m*Math.cos(4*w)-6*b*Math.cos(6*w)),Math.abs(S)<=1e-10)return w;return NaN}const ja={init:function cass_init(){this.sphere||(this.e0=e0fn(this.es),this.e1=e1fn(this.es),this.e2=e2fn(this.es),this.e3=e3fn(this.es),this.ml0=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function cass_forward(c){var h,g,m=c.x,b=c.y;if(m=adjust_lon(m-this.long0,this.over),this.sphere)h=this.a*Math.asin(Math.cos(b)*Math.sin(m)),g=this.a*(Math.atan2(Math.tan(b),Math.cos(m))-this.lat0);else{var w=Math.sin(b),S=Math.cos(b),M=gN(this.a,this.e,w),k=Math.tan(b)*Math.tan(b),T=m*Math.cos(b),E=T*T,I=this.es*S*S/(1-this.es);h=M*T*(1-E*k*(1/6-(8-k+8*I)*E/120)),g=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,b)-this.ml0+M*w/S*E*(.5+(5-k+6*I)*E/24)}return c.x=h+this.x0,c.y=g+this.y0,c},inverse:function cass_inverse(c){c.x-=this.x0,c.y-=this.y0;var h,g,m=c.x/this.a,b=c.y/this.a;if(this.sphere){var w=b+this.lat0;h=Math.asin(Math.sin(w)*Math.cos(m)),g=Math.atan2(Math.tan(m),Math.cos(w))}else{var S=imlfn(this.ml0/this.a+b,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(S)-Mo)<=ko)return c.x=this.long0,c.y=Mo,b<0&&(c.y*=-1),c;var M=gN(this.a,this.e,Math.sin(S)),k=M*M*M/this.a/this.a*(1-this.es),T=Math.pow(Math.tan(S),2),E=m*this.a/M,I=E*E;h=S-M*Math.tan(S)/k*E*E*(.5-(1+3*T)*E*E/24),g=E*(1-I*(T/3+(1+3*T)*T*I/15))/Math.cos(S)}return c.x=adjust_lon(g+this.long0,this.over),c.y=adjust_lat(h),c},names:["Cassini","Cassini_Soldner","cass"]};function qsfnz(c,h){var g;return c>1e-7?(1-c*c)*(h/(1-(g=c*h)*g)-.5/c*Math.log((1-g)/(1+g))):2*h}var Da=.3333333333333333,Na=.17222222222222222,Ra=.10257936507936508,Ga=.06388888888888888,qa=.0664021164021164,Wa=.016415012942191543;const Ha={init:function laea_init(){var c,h=Math.abs(this.lat0);if(Math.abs(h-Mo)<ko?this.mode=this.lat0<0?1:2:Math.abs(h)<ko?this.mode=3:this.mode=4,this.es>0)switch(this.qp=qsfnz(this.e,1),this.mmf=.5/(1-this.es),this.apa=function authset(c){var h,g=[];return g[0]=c*Da,h=c*c,g[0]+=h*Na,g[1]=h*Ga,h*=c,g[0]+=h*Ra,g[1]+=h*qa,g[2]=h*Wa,g}(this.es),this.mode){case 2:case 1:this.dd=1;break;case 3:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case 4:this.rq=Math.sqrt(.5*this.qp),c=Math.sin(this.lat0),this.sinb1=qsfnz(this.e,c)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*c*c)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else 4===this.mode&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function laea_forward(c){var h,g,m,b,w,S,M,k,T,E,I=c.x,P=c.y;if(I=adjust_lon(I-this.long0,this.over),this.sphere){if(w=Math.sin(P),E=Math.cos(P),m=Math.cos(I),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((g=this.mode===this.EQUIT?1+E*m:1+this.sinph0*w+this.cosph0*E*m)<=ko)return null;h=(g=Math.sqrt(2/g))*E*Math.sin(I),g*=this.mode===this.EQUIT?w:this.cosph0*w-this.sinph0*E*m}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(m=-m),Math.abs(P+this.lat0)<ko)return null;g=Io-.5*P,h=(g=2*(this.mode===this.S_POLE?Math.cos(g):Math.sin(g)))*Math.sin(I),g*=m}}else{switch(M=0,k=0,T=0,m=Math.cos(I),b=Math.sin(I),w=Math.sin(P),S=qsfnz(this.e,w),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(M=S/this.qp,k=Math.sqrt(1-M*M)),this.mode){case this.OBLIQ:T=1+this.sinb1*M+this.cosb1*k*m;break;case this.EQUIT:T=1+k*m;break;case this.N_POLE:T=Mo+P,S=this.qp-S;break;case this.S_POLE:T=P-Mo,S=this.qp+S}if(Math.abs(T)<ko)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:T=Math.sqrt(2/T),g=this.mode===this.OBLIQ?this.ymf*T*(this.cosb1*M-this.sinb1*k*m):(T=Math.sqrt(2/(1+k*m)))*M*this.ymf,h=this.xmf*T*k*b;break;case this.N_POLE:case this.S_POLE:S>=0?(h=(T=Math.sqrt(S))*b,g=m*(this.mode===this.S_POLE?T:-T)):h=g=0}}return c.x=this.a*h+this.x0,c.y=this.a*g+this.y0,c},inverse:function laea_inverse(c){c.x-=this.x0,c.y-=this.y0;var h,g,m,b,w,S,M,k=c.x/this.a,T=c.y/this.a;if(this.sphere){var E,I=0,P=0;if((g=.5*(E=Math.sqrt(k*k+T*T)))>1)return null;switch(g=2*Math.asin(g),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(P=Math.sin(g),I=Math.cos(g)),this.mode){case this.EQUIT:g=Math.abs(E)<=ko?0:Math.asin(T*P/E),k*=P,T=I*E;break;case this.OBLIQ:g=Math.abs(E)<=ko?this.lat0:Math.asin(I*this.sinph0+T*P*this.cosph0/E),k*=P*this.cosph0,T=(I-Math.sin(g)*this.sinph0)*E;break;case this.N_POLE:T=-T,g=Mo-g;break;case this.S_POLE:g-=Mo}h=0!==T||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(k,T):0}else{if(M=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(k/=this.dd,T*=this.dd,(S=Math.sqrt(k*k+T*T))<ko)return c.x=this.long0,c.y=this.lat0,c;b=2*Math.asin(.5*S/this.rq),m=Math.cos(b),k*=b=Math.sin(b),this.mode===this.OBLIQ?(M=m*this.sinb1+T*b*this.cosb1/S,w=this.qp*M,T=S*this.cosb1*m-T*this.sinb1*b):(M=T*b/S,w=this.qp*M,T=S*m)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(T=-T),!(w=k*k+T*T))return c.x=this.long0,c.y=this.lat0,c;M=1-w/this.qp,this.mode===this.S_POLE&&(M=-M)}h=Math.atan2(k,T),g=function authlat(c,h){var g=c+c;return c+h[0]*Math.sin(g)+h[1]*Math.sin(g+g)+h[2]*Math.sin(g+g+g)}(Math.asin(M),this.apa)}return c.x=adjust_lon(this.long0+h,this.over),c.y=g,c},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function asinz(c){return Math.abs(c)>1&&(c=c>1?1:-1),Math.asin(c)}const Ua={init:function aea_init(){Math.abs(this.lat1+this.lat2)<ko||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=msfnz(this.e3,this.sin_po,this.cos_po),this.qs1=qsfnz(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=msfnz(this.e3,this.sin_po,this.cos_po),this.qs2=qsfnz(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=qsfnz(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>ko?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function aea_forward(c){var h=c.x,g=c.y;this.sin_phi=Math.sin(g),this.cos_phi=Math.cos(g);var m=qsfnz(this.e3,this.sin_phi),b=this.a*Math.sqrt(this.c-this.ns0*m)/this.ns0,w=this.ns0*adjust_lon(h-this.long0,this.over),S=b*Math.sin(w)+this.x0,M=this.rh-b*Math.cos(w)+this.y0;return c.x=S,c.y=M,c},inverse:function aea_inverse(c){var h,g,m,b,w,S;return c.x-=this.x0,c.y=this.rh-c.y+this.y0,this.ns0>=0?(h=Math.sqrt(c.x*c.x+c.y*c.y),m=1):(h=-Math.sqrt(c.x*c.x+c.y*c.y),m=-1),b=0,0!==h&&(b=Math.atan2(m*c.x,m*c.y)),m=h*this.ns0/this.a,this.sphere?S=Math.asin((this.c-m*m)/(2*this.ns0)):(g=(this.c-m*m)/this.ns0,S=this.phi1z(this.e3,g)),w=adjust_lon(b/this.ns0+this.long0,this.over),c.x=w,c.y=S,c},names:["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"],phi1z:function phi1z(c,h){var g,m,b,w,S=asinz(.5*h);if(c<ko)return S;for(var M=c*c,k=1;k<=25;k++)if(S+=w=.5*(b=1-(m=c*(g=Math.sin(S)))*m)*b/Math.cos(S)*(h/(1-M)-g/b+.5/c*Math.log((1-m)/(1+m))),Math.abs(w)<=1e-7)return S;return null}};const Ya={init:function gnom_init(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function gnom_forward(c){var h,g,m,b,w,S,M,k=c.x,T=c.y;return m=adjust_lon(k-this.long0,this.over),h=Math.sin(T),g=Math.cos(T),b=Math.cos(m),(w=this.sin_p14*h+this.cos_p14*g*b)>0||Math.abs(w)<=ko?(S=this.x0+1*this.a*g*Math.sin(m)/w,M=this.y0+1*this.a*(this.cos_p14*h-this.sin_p14*g*b)/w):(S=this.x0+this.infinity_dist*g*Math.sin(m),M=this.y0+this.infinity_dist*(this.cos_p14*h-this.sin_p14*g*b)),c.x=S,c.y=M,c},inverse:function gnom_inverse(c){var h,g,m,b,w,S;return c.x=(c.x-this.x0)/this.a,c.y=(c.y-this.y0)/this.a,c.x/=this.k0,c.y/=this.k0,(h=Math.sqrt(c.x*c.x+c.y*c.y))?(b=Math.atan2(h,this.rc),g=Math.sin(b),S=asinz((m=Math.cos(b))*this.sin_p14+c.y*g*this.cos_p14/h),w=Math.atan2(c.x*g,h*this.cos_p14*m-c.y*this.sin_p14*g),w=adjust_lon(this.long0+w,this.over)):(S=this.phic0,w=0),c.x=w,c.y=S,c},names:["gnom"]};const Va={init:function cea_init(){this.sphere||(this.k0=msfnz(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function cea_forward(c){var h,g,m=c.x,b=c.y,w=adjust_lon(m-this.long0,this.over);if(this.sphere)h=this.x0+this.a*w*Math.cos(this.lat_ts),g=this.y0+this.a*Math.sin(b)/Math.cos(this.lat_ts);else{var S=qsfnz(this.e,Math.sin(b));h=this.x0+this.a*this.k0*w,g=this.y0+this.a*S*.5/this.k0}return c.x=h,c.y=g,c},inverse:function cea_inverse(c){var h,g;return c.x-=this.x0,c.y-=this.y0,this.sphere?(h=adjust_lon(this.long0+c.x/this.a/Math.cos(this.lat_ts),this.over),g=Math.asin(c.y/this.a*Math.cos(this.lat_ts))):(g=function iqsfnz(c,h){var g=1-(1-c*c)/(2*c)*Math.log((1-c)/(1+c));if(Math.abs(Math.abs(h)-g)<1e-6)return h<0?-1*Mo:Mo;for(var m,b,w,S,M=Math.asin(.5*h),k=0;k<30;k++)if(b=Math.sin(M),w=Math.cos(M),S=c*b,M+=m=Math.pow(1-S*S,2)/(2*w)*(h/(1-c*c)-b/(1-S*S)+.5/c*Math.log((1-S)/(1+S))),Math.abs(m)<=1e-10)return M;return NaN}(this.e,2*c.y*this.k0/this.a),h=adjust_lon(this.long0+c.x/(this.a*this.k0),this.over)),c.x=h,c.y=g,c},names:["cea"]};const $a={init:function eqc_init(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function eqc_forward(c){var h=c.x,g=c.y,m=adjust_lon(h-this.long0,this.over),b=adjust_lat(g-this.lat0);return c.x=this.x0+this.a*m*this.rc,c.y=this.y0+this.a*b,c},inverse:function eqc_inverse(c){var h=c.x,g=c.y;return c.x=adjust_lon(this.long0+(h-this.x0)/(this.a*this.rc),this.over),c.y=adjust_lat(this.lat0+(g-this.y0)/this.a),c},names:["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"]};const Xa={init:function poly_init(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=e0fn(this.es),this.e1=e1fn(this.es),this.e2=e2fn(this.es),this.e3=e3fn(this.es),this.ml0=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function poly_forward(c){var h,g,m,b=c.x,w=c.y,S=adjust_lon(b-this.long0,this.over);if(m=S*Math.sin(w),this.sphere)Math.abs(w)<=ko?(h=this.a*S,g=-1*this.a*this.lat0):(h=this.a*Math.sin(m)/Math.tan(w),g=this.a*(adjust_lat(w-this.lat0)+(1-Math.cos(m))/Math.tan(w)));else if(Math.abs(w)<=ko)h=this.a*S,g=-1*this.ml0;else{var M=gN(this.a,this.e,Math.sin(w))/Math.tan(w);h=M*Math.sin(m),g=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,w)-this.ml0+M*(1-Math.cos(m))}return c.x=h+this.x0,c.y=g+this.y0,c},inverse:function poly_inverse(c){var h,g,m,b,w,S,M,k,T;if(m=c.x-this.x0,b=c.y-this.y0,this.sphere)if(Math.abs(b+this.a*this.lat0)<=ko)h=adjust_lon(m/this.a+this.long0,this.over),g=0;else{var E;for(S=this.lat0+b/this.a,M=m*m/this.a/this.a+S*S,k=S,w=20;w;--w)if(k+=T=-1*(S*(k*(E=Math.tan(k))+1)-k-.5*(k*k+M)*E)/((k-S)/E-1),Math.abs(T)<=ko){g=k;break}h=adjust_lon(this.long0+Math.asin(m*Math.tan(k)/this.a)/Math.sin(g),this.over)}else if(Math.abs(b+this.ml0)<=ko)g=0,h=adjust_lon(this.long0+m/this.a,this.over);else{var I,P,L,B,z;for(S=(this.ml0+b)/this.a,M=m*m/this.a/this.a+S*S,k=S,w=20;w;--w)if(z=this.e*Math.sin(k),I=Math.sqrt(1-z*z)*Math.tan(k),P=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,k),L=this.e0-2*this.e1*Math.cos(2*k)+4*this.e2*Math.cos(4*k)-6*this.e3*Math.cos(6*k),k-=T=(S*(I*(B=P/this.a)+1)-B-.5*I*(B*B+M))/(this.es*Math.sin(2*k)*(B*B+M-2*S*B)/(4*I)+(S-B)*(I*L-2/Math.sin(2*k))-L),Math.abs(T)<=ko){g=k;break}I=Math.sqrt(1-this.es*Math.pow(Math.sin(g),2))*Math.tan(g),h=adjust_lon(this.long0+Math.asin(m*I/this.a)/Math.sin(g),this.over)}return c.x=h,c.y=g,c},names:["Polyconic","American_Polyconic","poly"]};const Ka={init:function nzmg_init(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function nzmg_forward(c){var h,g=c.x,m=c.y-this.lat0,b=g-this.long0,w=m/So*1e-5,S=b,M=1,k=0;for(h=1;h<=10;h++)M*=w,k+=this.A[h]*M;var T,E=k,I=S,P=1,L=0,B=0,z=0;for(h=1;h<=6;h++)T=L*E+P*I,P=P*E-L*I,L=T,B=B+this.B_re[h]*P-this.B_im[h]*L,z=z+this.B_im[h]*P+this.B_re[h]*L;return c.x=z*this.a+this.x0,c.y=B*this.a+this.y0,c},inverse:function nzmg_inverse(c){var h,g,m=c.x,b=c.y,w=m-this.x0,S=(b-this.y0)/this.a,M=w/this.a,k=1,T=0,E=0,I=0;for(h=1;h<=6;h++)g=T*S+k*M,k=k*S-T*M,T=g,E=E+this.C_re[h]*k-this.C_im[h]*T,I=I+this.C_im[h]*k+this.C_re[h]*T;for(var P=0;P<this.iterations;P++){var L,B=E,z=I,j=S,D=M;for(h=2;h<=6;h++)L=z*E+B*I,B=B*E-z*I,z=L,j+=(h-1)*(this.B_re[h]*B-this.B_im[h]*z),D+=(h-1)*(this.B_im[h]*B+this.B_re[h]*z);B=1,z=0;var N=this.B_re[1],R=this.B_im[1];for(h=2;h<=6;h++)L=z*E+B*I,B=B*E-z*I,z=L,N+=h*(this.B_re[h]*B-this.B_im[h]*z),R+=h*(this.B_im[h]*B+this.B_re[h]*z);var G=N*N+R*R;E=(j*N+D*R)/G,I=(D*N-j*R)/G}var q=E,W=I,H=1,U=0;for(h=1;h<=9;h++)H*=q,U+=this.D[h]*H;var Y=this.lat0+U*So*1e5,V=this.long0+W;return c.x=V,c.y=Y,c},names:["New_Zealand_Map_Grid","nzmg"]};const Za={init:function mill_init(){},forward:function mill_forward(c){var h=c.x,g=c.y,m=adjust_lon(h-this.long0,this.over),b=this.x0+this.a*m,w=this.y0+this.a*Math.log(Math.tan(Math.PI/4+g/2.5))*1.25;return c.x=b,c.y=w,c},inverse:function mill_inverse(c){c.x-=this.x0,c.y-=this.y0;var h=adjust_lon(this.long0+c.x/this.a,this.over),g=2.5*(Math.atan(Math.exp(.8*c.y/this.a))-Math.PI/4);return c.x=h,c.y=g,c},names:["Miller_Cylindrical","mill"]};const Ja={init:function sinu_init(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=pj_enfn(this.es)},forward:function sinu_forward(c){var h,g,m=c.x,b=c.y;if(m=adjust_lon(m-this.long0,this.over),this.sphere){if(this.m)for(var w=this.n*Math.sin(b),S=20;S;--S){var M=(this.m*b+Math.sin(b)-w)/(this.m+Math.cos(b));if(b-=M,Math.abs(M)<ko)break}else b=1!==this.n?Math.asin(this.n*Math.sin(b)):b;h=this.a*this.C_x*m*(this.m+Math.cos(b)),g=this.a*this.C_y*b}else{var k=Math.sin(b),T=Math.cos(b);g=this.a*pj_mlfn(b,k,T,this.en),h=this.a*m*T/Math.sqrt(1-this.es*k*k)}return c.x=h,c.y=g,c},inverse:function sinu_inverse(c){var h,g,m;return c.x-=this.x0,g=c.x/this.a,c.y-=this.y0,h=c.y/this.a,this.sphere?(h/=this.C_y,g/=this.C_x*(this.m+Math.cos(h)),this.m?h=asinz((this.m*h+Math.sin(h))/this.n):1!==this.n&&(h=asinz(Math.sin(h)/this.n)),g=adjust_lon(g+this.long0,this.over),h=adjust_lat(h)):(h=pj_inv_mlfn(c.y/this.a,this.es,this.en),(m=Math.abs(h))<Mo?(m=Math.sin(h),g=adjust_lon(this.long0+c.x*Math.sqrt(1-this.es*m*m)/(this.a*Math.cos(h)),this.over)):m-ko<Mo&&(g=this.long0)),c.x=g,c.y=h,c},names:["Sinusoidal","sinu"]};const Qa={init:function moll_init(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0},forward:function moll_forward(c){for(var h=c.x,g=c.y,m=adjust_lon(h-this.long0,this.over),b=g,w=Math.PI*Math.sin(g);;){var S=-(b+Math.sin(b)-w)/(1+Math.cos(b));if(b+=S,Math.abs(S)<ko)break}b/=2,Math.PI/2-Math.abs(g)<ko&&(m=0);var M=.900316316158*this.a*m*Math.cos(b)+this.x0,k=1.4142135623731*this.a*Math.sin(b)+this.y0;return c.x=M,c.y=k,c},inverse:function moll_inverse(c){var h,g;c.x-=this.x0,c.y-=this.y0,g=c.y/(1.4142135623731*this.a),Math.abs(g)>.999999999999&&(g=.999999999999),h=Math.asin(g);var m=adjust_lon(this.long0+c.x/(.900316316158*this.a*Math.cos(h)),this.over);m<-Math.PI&&(m=-Math.PI),m>Math.PI&&(m=Math.PI),g=(2*h+Math.sin(2*h))/Math.PI,Math.abs(g)>1&&(g=1);var b=Math.asin(g);return c.x=m,c.y=b,c},names:["Mollweide","moll"]};const ti={init:function eqdc_init(){Math.abs(this.lat1+this.lat2)<ko||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=e0fn(this.es),this.e1=e1fn(this.es),this.e2=e2fn(this.es),this.e3=e3fn(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=msfnz(this.e,this.sin_phi,this.cos_phi),this.ml1=mlfn(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<ko?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=msfnz(this.e,this.sin_phi,this.cos_phi),this.ml2=mlfn(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function eqdc_forward(c){var h,g=c.x,m=c.y;if(this.sphere)h=this.a*(this.g-m);else{var b=mlfn(this.e0,this.e1,this.e2,this.e3,m);h=this.a*(this.g-b)}var w=this.ns*adjust_lon(g-this.long0,this.over),S=this.x0+h*Math.sin(w),M=this.y0+this.rh-h*Math.cos(w);return c.x=S,c.y=M,c},inverse:function eqdc_inverse(c){var h,g,m,b;c.x-=this.x0,c.y=this.rh-c.y+this.y0,this.ns>=0?(g=Math.sqrt(c.x*c.x+c.y*c.y),h=1):(g=-Math.sqrt(c.x*c.x+c.y*c.y),h=-1);var w=0;return 0!==g&&(w=Math.atan2(h*c.x,h*c.y)),this.sphere?(b=adjust_lon(this.long0+w/this.ns,this.over),m=adjust_lat(this.g-g/this.a),c.x=b,c.y=m,c):(m=imlfn(this.g-g/this.a,this.e0,this.e1,this.e2,this.e3),b=adjust_lon(this.long0+w/this.ns,this.over),c.x=b,c.y=m,c)},names:["Equidistant_Conic","eqdc"]};const ei={init:function vandg_init(){this.R=this.a},forward:function vandg_forward(c){var h,g,m=c.x,b=c.y,w=adjust_lon(m-this.long0,this.over);Math.abs(b)<=ko&&(h=this.x0+this.R*w,g=this.y0);var S=asinz(2*Math.abs(b/Math.PI));(Math.abs(w)<=ko||Math.abs(Math.abs(b)-Mo)<=ko)&&(h=this.x0,g=b>=0?this.y0+Math.PI*this.R*Math.tan(.5*S):this.y0+Math.PI*this.R*-Math.tan(.5*S));var M=.5*Math.abs(Math.PI/w-w/Math.PI),k=M*M,T=Math.sin(S),E=Math.cos(S),I=E/(T+E-1),P=I*I,L=I*(2/T-1),B=L*L,z=Math.PI*this.R*(M*(I-B)+Math.sqrt(k*(I-B)*(I-B)-(B+k)*(P-B)))/(B+k);w<0&&(z=-z),h=this.x0+z;var j=k+I;return z=Math.PI*this.R*(L*j-M*Math.sqrt((B+k)*(k+1)-j*j))/(B+k),g=b>=0?this.y0+z:this.y0-z,c.x=h,c.y=g,c},inverse:function vandg_inverse(c){var h,g,m,b,w,S,M,k,T,E,I,P;return c.x-=this.x0,c.y-=this.y0,I=Math.PI*this.R,w=(m=c.x/I)*m+(b=c.y/I)*b,I=3*(b*b/(k=-2*(S=-Math.abs(b)*(1+w))+1+2*b*b+w*w)+(2*(M=S-2*b*b+m*m)*M*M/k/k/k-9*S*M/k/k)/27)/(T=(S-M*M/3/k)/k)/(E=2*Math.sqrt(-T/3)),Math.abs(I)>1&&(I=I>=0?1:-1),P=Math.acos(I)/3,g=c.y>=0?(-E*Math.cos(P+Math.PI/3)-M/3/k)*Math.PI:-(-E*Math.cos(P+Math.PI/3)-M/3/k)*Math.PI,h=Math.abs(m)<ko?this.long0:adjust_lon(this.long0+Math.PI*(w-1+Math.sqrt(1+2*(m*m-b*b)+w*w))/2/m,this.over),c.x=h,c.y=g,c},names:["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"]};const ni={init:function aeqd_init(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))},forward:function aeqd_forward(c){var h,g,m,b,w,S,M,k,T,E,I,P=c.x,L=c.y,B=Math.sin(c.y),z=Math.cos(c.y),j=adjust_lon(P-this.long0,this.over);return this.sphere?Math.abs(this.sin_p12-1)<=ko?(c.x=this.x0+this.a*(Mo-L)*Math.sin(j),c.y=this.y0-this.a*(Mo-L)*Math.cos(j),c):Math.abs(this.sin_p12+1)<=ko?(c.x=this.x0+this.a*(Mo+L)*Math.sin(j),c.y=this.y0+this.a*(Mo+L)*Math.cos(j),c):(T=this.sin_p12*B+this.cos_p12*z*Math.cos(j),k=(M=Math.acos(T))?M/Math.sin(M):1,c.x=this.x0+this.a*k*z*Math.sin(j),c.y=this.y0+this.a*k*(this.cos_p12*B-this.sin_p12*z*Math.cos(j)),c):(h=e0fn(this.es),g=e1fn(this.es),m=e2fn(this.es),b=e3fn(this.es),Math.abs(this.sin_p12-1)<=ko?(w=this.a*mlfn(h,g,m,b,Mo),S=this.a*mlfn(h,g,m,b,L),c.x=this.x0+(w-S)*Math.sin(j),c.y=this.y0-(w-S)*Math.cos(j),c):Math.abs(this.sin_p12+1)<=ko?(w=this.a*mlfn(h,g,m,b,Mo),S=this.a*mlfn(h,g,m,b,L),c.x=this.x0+(w+S)*Math.sin(j),c.y=this.y0+(w+S)*Math.cos(j),c):Math.abs(P)<ko&&Math.abs(L-this.lat0)<ko?(c.x=c.y=0,c):(E=function vincentyInverse(c,h,g,m,b,w){const S=m-h,M=Math.atan((1-w)*Math.tan(c)),k=Math.atan((1-w)*Math.tan(g)),T=Math.sin(M),E=Math.cos(M),I=Math.sin(k),P=Math.cos(k);let L,B,z,j,D,N,R,G,q,W,H,U,Y,V,$,X=S,K=100;do{if(B=Math.sin(X),z=Math.cos(X),j=Math.sqrt(P*B*(P*B)+(E*I-T*P*z)*(E*I-T*P*z)),0===j)return{azi1:0,s12:0};D=T*I+E*P*z,N=Math.atan2(j,D),R=E*P*B/j,G=1-R*R,q=0!==G?D-2*T*I/G:0,W=w/16*G*(4+w*(4-3*G)),L=X,X=S+(1-W)*w*R*(N+W*j*(q+W*D*(2*q*q-1)))}while(Math.abs(X-L)>1e-12&&--K>0);return 0===K?{azi1:NaN,s12:NaN}:(H=G*(b*b-b*(1-w)*(b*(1-w)))/(b*(1-w)*(b*(1-w))),U=1+H/16384*(4096+H*(H*(320-175*H)-768)),Y=H/1024*(256+H*(H*(74-47*H)-128)),V=Y*j*(q+Y/4*(D*(2*q*q-1)-Y/6*q*(4*j*j-3)*(4*q*q-3))),$=b*(1-w)*U*(N-V),{azi1:Math.atan2(P*B,E*I-T*P*z),s12:$})}(this.lat0,this.long0,L,P,this.a,this.f),I=E.azi1,c.x=E.s12*Math.sin(I),c.y=E.s12*Math.cos(I),c))},inverse:function aeqd_inverse(c){var h,g,m,b,w,S,M,k,T,E,I,P,L,B,z;if(c.x-=this.x0,c.y-=this.y0,this.sphere){if((h=Math.sqrt(c.x*c.x+c.y*c.y))>2*Mo*this.a)return;return g=h/this.a,m=Math.sin(g),b=Math.cos(g),w=this.long0,Math.abs(h)<=ko?S=this.lat0:(S=asinz(b*this.sin_p12+c.y*m*this.cos_p12/h),M=Math.abs(this.lat0)-Mo,w=Math.abs(M)<=ko?this.lat0>=0?adjust_lon(this.long0+Math.atan2(c.x,-c.y),this.over):adjust_lon(this.long0-Math.atan2(-c.x,c.y),this.over):adjust_lon(this.long0+Math.atan2(c.x*m,h*this.cos_p12*b-c.y*this.sin_p12*m),this.over)),c.x=w,c.y=S,c}return k=e0fn(this.es),T=e1fn(this.es),E=e2fn(this.es),I=e3fn(this.es),Math.abs(this.sin_p12-1)<=ko?(S=imlfn(((P=this.a*mlfn(k,T,E,I,Mo))-(h=Math.sqrt(c.x*c.x+c.y*c.y)))/this.a,k,T,E,I),w=adjust_lon(this.long0+Math.atan2(c.x,-1*c.y),this.over),c.x=w,c.y=S,c):Math.abs(this.sin_p12+1)<=ko?(P=this.a*mlfn(k,T,E,I,Mo),S=imlfn(((h=Math.sqrt(c.x*c.x+c.y*c.y))-P)/this.a,k,T,E,I),w=adjust_lon(this.long0+Math.atan2(c.x,c.y),this.over),c.x=w,c.y=S,c):(L=Math.atan2(c.x,c.y),B=Math.sqrt(c.x*c.x+c.y*c.y),z=function vincentyDirect(c,h,g,m,b,w){const S=Math.atan((1-w)*Math.tan(c)),M=Math.sin(S),k=Math.cos(S),T=Math.sin(g),E=Math.cos(g),I=Math.atan2(M,k*E),P=k*T,L=1-P*P,B=L*(b*b-b*(1-w)*(b*(1-w)))/(b*(1-w)*(b*(1-w))),z=1+B/16384*(4096+B*(B*(320-175*B)-768)),j=B/1024*(256+B*(B*(74-47*B)-128));let D,N,R,G,q,W=m/(b*(1-w)*z),H=100;do{N=Math.cos(2*I+W),R=Math.sin(W),G=Math.cos(W),q=j*R*(N+j/4*(G*(2*N*N-1)-j/6*N*(4*R*R-3)*(4*N*N-3))),D=W,W=m/(b*(1-w)*z)+q}while(Math.abs(W-D)>1e-12&&--H>0);if(0===H)return{lat2:NaN,lon2:NaN};const U=M*R-k*G*E,Y=w/16*L*(4+w*(4-3*L));return{lat2:Math.atan2(M*G+k*R*E,(1-w)*Math.sqrt(P*P+U*U)),lon2:h+(Math.atan2(R*T,k*G-M*R*E)-(1-Y)*w*P*(W+Y*R*(N+Y*G*(2*N*N-1))))}}(this.lat0,this.long0,L,B,this.a,this.f),c.x=z.lon2,c.y=z.lat2,c)},names:["Azimuthal_Equidistant","aeqd"]};const ri={init:function ortho_init(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function ortho_forward(c){var h,g,m,b,w,S,M,k=c.x,T=c.y;return m=adjust_lon(k-this.long0,this.over),h=Math.sin(T),g=Math.cos(T),b=Math.cos(m),((w=this.sin_p14*h+this.cos_p14*g*b)>0||Math.abs(w)<=ko)&&(S=1*this.a*g*Math.sin(m),M=this.y0+1*this.a*(this.cos_p14*h-this.sin_p14*g*b)),c.x=S,c.y=M,c},inverse:function ortho_inverse(c){var h,g,m,b,w,S,M;return c.x-=this.x0,c.y-=this.y0,g=asinz((h=Math.sqrt(c.x*c.x+c.y*c.y))/this.a),m=Math.sin(g),b=Math.cos(g),S=this.long0,Math.abs(h)<=ko?(M=this.lat0,c.x=S,c.y=M,c):(M=asinz(b*this.sin_p14+c.y*m*this.cos_p14/h),w=Math.abs(this.lat0)-Mo,Math.abs(w)<=ko?(S=this.lat0>=0?adjust_lon(this.long0+Math.atan2(c.x,-c.y),this.over):adjust_lon(this.long0-Math.atan2(-c.x,c.y),this.over),c.x=S,c.y=M,c):(S=adjust_lon(this.long0+Math.atan2(c.x*m,h*this.cos_p14*b-c.y*this.sin_p14*m),this.over),c.x=S,c.y=M,c))},names:["ortho"]};var oi=1,ai=2,ii=3,si=4,li=5,ci=6,ui=1,hi=2,di=3,pi=4;function qsc_fwd_equat_face_theta(c,h,g,m){var b;return c<ko?(m.value=ui,b=0):(b=Math.atan2(h,g),Math.abs(b)<=Io?m.value=ui:b>Io&&b<=Mo+Io?(m.value=hi,b-=Mo):b>Mo+Io||b<=-(Mo+Io)?(m.value=di,b=b>=0?b-Lo:b+Lo):(m.value=pi,b+=Mo)),b}function qsc_shift_lon_origin(c,h){var g=c+h;return g<-Lo?g+=Po:g>+Lo&&(g-=Po),g}const fi={init:function qsc_init(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Mo-Io/2?this.face=li:this.lat0<=-(Mo-Io/2)?this.face=ci:Math.abs(this.long0)<=Io?this.face=oi:Math.abs(this.long0)<=Mo+Io?this.face=this.long0>0?ai:si:this.face=ii,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function qsc_forward(c){var h,g,m,b,w,S,M={x:0,y:0},k={value:0};if(c.x-=this.long0,h=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(c.y)):c.y,g=c.x,this.face===li)b=Mo-h,g>=Io&&g<=Mo+Io?(k.value=ui,m=g-Mo):g>Mo+Io||g<=-(Mo+Io)?(k.value=hi,m=g>0?g-Lo:g+Lo):g>-(Mo+Io)&&g<=-Io?(k.value=di,m=g+Mo):(k.value=pi,m=g);else if(this.face===ci)b=Mo+h,g>=Io&&g<=Mo+Io?(k.value=ui,m=-g+Mo):g<Io&&g>=-Io?(k.value=hi,m=-g):g<-Io&&g>=-(Mo+Io)?(k.value=di,m=-g-Mo):(k.value=pi,m=g>0?-g+Lo:-g-Lo);else{var T,E,I,P,L,B;this.face===ai?g=qsc_shift_lon_origin(g,+Mo):this.face===ii?g=qsc_shift_lon_origin(g,+Lo):this.face===si&&(g=qsc_shift_lon_origin(g,-Mo)),P=Math.sin(h),L=Math.cos(h),B=Math.sin(g),T=L*Math.cos(g),E=L*B,I=P,this.face===oi?m=qsc_fwd_equat_face_theta(b=Math.acos(T),I,E,k):this.face===ai?m=qsc_fwd_equat_face_theta(b=Math.acos(E),I,-T,k):this.face===ii?m=qsc_fwd_equat_face_theta(b=Math.acos(-T),I,-E,k):this.face===si?m=qsc_fwd_equat_face_theta(b=Math.acos(-E),I,T,k):(b=m=0,k.value=ui)}return S=Math.atan(12/Lo*(m+Math.acos(Math.sin(m)*Math.cos(Io))-Mo)),w=Math.sqrt((1-Math.cos(b))/(Math.cos(S)*Math.cos(S))/(1-Math.cos(Math.atan(1/Math.cos(m))))),k.value===hi?S+=Mo:k.value===di?S+=Lo:k.value===pi&&(S+=1.5*Lo),M.x=w*Math.cos(S),M.y=w*Math.sin(S),M.x=M.x*this.a+this.x0,M.y=M.y*this.a+this.y0,c.x=M.x,c.y=M.y,c},inverse:function qsc_inverse(c){var h,g,m,b,w,S,M,k,T,E,I,P,L={lam:0,phi:0},B={value:0};if(c.x=(c.x-this.x0)/this.a,c.y=(c.y-this.y0)/this.a,g=Math.atan(Math.sqrt(c.x*c.x+c.y*c.y)),h=Math.atan2(c.y,c.x),c.x>=0&&c.x>=Math.abs(c.y)?B.value=ui:c.y>=0&&c.y>=Math.abs(c.x)?(B.value=hi,h-=Mo):c.x<0&&-c.x>=Math.abs(c.y)?(B.value=di,h=h<0?h+Lo:h-Lo):(B.value=pi,h+=Mo),T=Lo/12*Math.tan(h),w=Math.sin(T)/(Math.cos(T)-1/Math.sqrt(2)),S=Math.atan(w),(M=1-(m=Math.cos(h))*m*(b=Math.tan(g))*b*(1-Math.cos(Math.atan(1/Math.cos(S)))))<-1?M=-1:M>1&&(M=1),this.face===li)k=Math.acos(M),L.phi=Mo-k,B.value===ui?L.lam=S+Mo:B.value===hi?L.lam=S<0?S+Lo:S-Lo:B.value===di?L.lam=S-Mo:L.lam=S;else if(this.face===ci)k=Math.acos(M),L.phi=k-Mo,B.value===ui?L.lam=-S+Mo:B.value===hi?L.lam=-S:B.value===di?L.lam=-S-Mo:L.lam=S<0?-S-Lo:-S+Lo;else{var z,j,D;T=(z=M)*z,j=(T+=(D=T>=1?0:Math.sqrt(1-T)*Math.sin(S))*D)>=1?0:Math.sqrt(1-T),B.value===hi?(T=j,j=-D,D=T):B.value===di?(j=-j,D=-D):B.value===pi&&(T=j,j=D,D=-T),this.face===ai?(T=z,z=-j,j=T):this.face===ii?(z=-z,j=-j):this.face===si&&(T=z,z=j,j=-T),L.phi=Math.acos(-D)-Mo,L.lam=Math.atan2(j,z),this.face===ai?L.lam=qsc_shift_lon_origin(L.lam,-Mo):this.face===ii?L.lam=qsc_shift_lon_origin(L.lam,-Lo):this.face===si&&(L.lam=qsc_shift_lon_origin(L.lam,+Mo))}return 0!==this.es&&(E=L.phi<0?1:0,I=Math.tan(L.phi),P=this.b/Math.sqrt(I*I+this.one_minus_f_squared),L.phi=Math.atan(Math.sqrt(this.a*this.a-P*P)/(this.one_minus_f*P)),E&&(L.phi=-L.phi)),L.lam+=this.long0,c.x=L.lam,c.y=L.phi,c},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};var gi=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],_i=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],mi=.8487,vi=1.3523,yi=Eo/5,Ai=1/yi,bi=18,poly3_val=function(c,h){return c[0]+h*(c[1]+h*(c[2]+h*c[3]))};const wi={init:function robin_init(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function robin_forward(c){var h=adjust_lon(c.x-this.long0,this.over),g=Math.abs(c.y),m=Math.floor(g*yi);m<0?m=0:m>=bi&&(m=17);var b={x:poly3_val(gi[m],g=Eo*(g-Ai*m))*h,y:poly3_val(_i[m],g)};return c.y<0&&(b.y=-b.y),b.x=b.x*this.a*mi+this.x0,b.y=b.y*this.a*vi+this.y0,b},inverse:function robin_inverse(c){var h={x:(c.x-this.x0)/(this.a*mi),y:Math.abs(c.y-this.y0)/(this.a*vi)};if(h.y>=1)h.x/=gi[18][0],h.y=c.y<0?-Mo:Mo;else{var g=Math.floor(h.y*bi);for(g<0?g=0:g>=bi&&(g=17);;)if(_i[g][0]>h.y)--g;else{if(!(_i[g+1][0]<=h.y))break;++g}var m=_i[g],b=5*(h.y-m[0])/(_i[g+1][0]-m[0]);b=function newton_rapshon(c,h,g,m){for(var b=h;m;--m){var w=c(b);if(b-=w,Math.abs(w)<g)break}return b}(function(c){return(poly3_val(m,c)-h.y)/function(c,h){return c[1]+h*(2*c[2]+3*h*c[3])}(m,c)},b,ko,100),h.x/=poly3_val(gi[g],b),h.y=(5*g+b)*To,c.y<0&&(h.y=-h.y)}return h.x=adjust_lon(h.x+this.long0,this.over),h},names:["Robinson","robin"]};const Ci={init:function geocent_init(){this.name="geocent"},forward:function geocent_forward(c){return geodeticToGeocentric(c,this.es,this.a)},inverse:function geocent_inverse(c){return geocentricToGeodetic(c,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};var Si=0,Mi=1,ki=2,Ti=3,Ei={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};const Ii={init:function tpers_init(){if(Object.keys(Ei).forEach(function(c){if(void 0===this[c])this[c]=Ei[c].def;else{if(Ei[c].num&&isNaN(this[c]))throw new Error("Invalid parameter value, must be numeric "+c+" = "+this[c]);Ei[c].num&&(this[c]=parseFloat(this[c]))}Ei[c].degrees&&(this[c]=this[c]*To)}.bind(this)),Math.abs(Math.abs(this.lat0)-Mo)<ko?this.mode=this.lat0<0?Mi:Si:Math.abs(this.lat0)<ko?this.mode=ki:(this.mode=Ti,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var c=this.tilt,h=this.azi;this.cg=Math.cos(h),this.sg=Math.sin(h),this.cw=Math.cos(c),this.sw=Math.sin(c)},forward:function tpers_forward(c){c.x-=this.long0;var h,g,m,b,w=Math.sin(c.y),S=Math.cos(c.y),M=Math.cos(c.x);switch(this.mode){case Ti:g=this.sinph0*w+this.cosph0*S*M;break;case ki:g=S*M;break;case Mi:g=-w;break;case Si:g=w}switch(h=(g=this.pn1/(this.p-g))*S*Math.sin(c.x),this.mode){case Ti:g*=this.cosph0*w-this.sinph0*S*M;break;case ki:g*=w;break;case Si:g*=-S*M;break;case Mi:g*=S*M}return b=1/((m=g*this.cg+h*this.sg)*this.sw*this.h1+this.cw),h=(h*this.cg-g*this.sg)*this.cw*b,g=m*b,c.x=h*this.a,c.y=g*this.a,c},inverse:function tpers_inverse(c){c.x/=this.a,c.y/=this.a;var h,g,m,b={x:c.x,y:c.y};m=1/(this.pn1-c.y*this.sw),h=this.pn1*c.x*m,g=this.pn1*c.y*this.cw*m,c.x=h*this.cg+g*this.sg,c.y=g*this.cg-h*this.sg;var w=common_hypot(c.x,c.y);if(Math.abs(w)<ko)b.x=0,b.y=c.y;else{var S,M;switch(M=1-w*w*this.pfact,M=(this.p-Math.sqrt(M))/(this.pn1/w+w/this.pn1),S=Math.sqrt(1-M*M),this.mode){case Ti:b.y=Math.asin(S*this.sinph0+c.y*M*this.cosph0/w),c.y=(S-this.sinph0*Math.sin(b.y))*w,c.x*=M*this.cosph0;break;case ki:b.y=Math.asin(c.y*M/w),c.y=S*w,c.x*=M;break;case Si:b.y=Math.asin(S),c.y=-c.y;break;case Mi:b.y=-Math.asin(S)}b.x=Math.atan2(c.x,c.y)}return c.x=b.x+this.long0,c.y=b.y,c},names:["Tilted_Perspective","tpers"]};const Pi={init:function geos_init(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var c=1-this.es,h=1/c;this.radius_p=Math.sqrt(c),this.radius_p2=c,this.radius_p_inv2=h,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function geos_forward(c){var h,g,m,b,w=c.x,S=c.y;if(w-=this.long0,"ellipse"===this.shape){S=Math.atan(this.radius_p2*Math.tan(S));var M=this.radius_p/common_hypot(this.radius_p*Math.cos(S),Math.sin(S));if(g=M*Math.cos(w)*Math.cos(S),m=M*Math.sin(w)*Math.cos(S),b=M*Math.sin(S),(this.radius_g-g)*g-m*m-b*b*this.radius_p_inv2<0)return c.x=Number.NaN,c.y=Number.NaN,c;h=this.radius_g-g,this.flip_axis?(c.x=this.radius_g_1*Math.atan(m/common_hypot(b,h)),c.y=this.radius_g_1*Math.atan(b/h)):(c.x=this.radius_g_1*Math.atan(m/h),c.y=this.radius_g_1*Math.atan(b/common_hypot(m,h)))}else"sphere"===this.shape&&(h=Math.cos(S),g=Math.cos(w)*h,m=Math.sin(w)*h,b=Math.sin(S),h=this.radius_g-g,this.flip_axis?(c.x=this.radius_g_1*Math.atan(m/common_hypot(b,h)),c.y=this.radius_g_1*Math.atan(b/h)):(c.x=this.radius_g_1*Math.atan(m/h),c.y=this.radius_g_1*Math.atan(b/common_hypot(m,h))));return c.x=c.x*this.a,c.y=c.y*this.a,c},inverse:function geos_inverse(c){var h,g,m,b,w=-1,S=0,M=0;if(c.x=c.x/this.a,c.y=c.y/this.a,"ellipse"===this.shape){this.flip_axis?(M=Math.tan(c.y/this.radius_g_1),S=Math.tan(c.x/this.radius_g_1)*common_hypot(1,M)):(S=Math.tan(c.x/this.radius_g_1),M=Math.tan(c.y/this.radius_g_1)*common_hypot(1,S));var k=M/this.radius_p;if(h=S*S+k*k+w*w,(m=(g=2*this.radius_g*w)*g-4*h*this.C)<0)return c.x=Number.NaN,c.y=Number.NaN,c;b=(-g-Math.sqrt(m))/(2*h),w=this.radius_g+b*w,S*=b,M*=b,c.x=Math.atan2(S,w),c.y=Math.atan(M*Math.cos(c.x)/w),c.y=Math.atan(this.radius_p_inv2*Math.tan(c.y))}else if("sphere"===this.shape){if(this.flip_axis?(M=Math.tan(c.y/this.radius_g_1),S=Math.tan(c.x/this.radius_g_1)*Math.sqrt(1+M*M)):(S=Math.tan(c.x/this.radius_g_1),M=Math.tan(c.y/this.radius_g_1)*Math.sqrt(1+S*S)),h=S*S+M*M+w*w,(m=(g=2*this.radius_g*w)*g-4*h*this.C)<0)return c.x=Number.NaN,c.y=Number.NaN,c;b=(-g-Math.sqrt(m))/(2*h),w=this.radius_g+b*w,S*=b,M*=b,c.x=Math.atan2(S,w),c.y=Math.atan(M*Math.cos(c.x)/w)}return c.x=c.x+this.long0,c},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};var Li=1.340264,Fi=-.081106,Bi=893e-6,Oi=.003796,zi=Math.sqrt(3)/2;const ji={init:function eqearth_init(){this.es=0,this.long0=void 0!==this.long0?this.long0:0,this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0},forward:function eqearth_forward(c){var h=adjust_lon(c.x-this.long0,this.over),g=c.y,m=Math.asin(zi*Math.sin(g)),b=m*m,w=b*b*b;return c.x=h*Math.cos(m)/(zi*(Li+3*Fi*b+w*(7*Bi+9*Oi*b))),c.y=m*(Li+Fi*b+w*(Bi+Oi*b)),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function eqearth_inverse(c){c.x=(c.x-this.x0)/this.a,c.y=(c.y-this.y0)/this.a;var h,g,m,b,w=c.y;for(b=0;b<12&&(w-=m=(w*(Li+Fi*(h=w*w)+(g=h*h*h)*(Bi+Oi*h))-c.y)/(Li+3*Fi*h+g*(7*Bi+9*Oi*h)),!(Math.abs(m)<1e-9));++b);return g=(h=w*w)*h*h,c.x=zi*c.x*(Li+3*Fi*h+g*(7*Bi+9*Oi*h))/Math.cos(w),c.y=Math.asin(Math.sin(w)/zi),c.x=adjust_lon(c.x+this.long0,this.over),c},names:["eqearth","Equal Earth","Equal_Earth"]};var Di=1e-10;function e_fwd(c){var h,g,m,b=adjust_lon(c.x-(this.long0||0),this.over),w=c.y;return h=this.am1+this.m1-pj_mlfn(w,g=Math.sin(w),m=Math.cos(w),this.en),g=m*b/(h*Math.sqrt(1-this.es*g*g)),c.x=h*Math.sin(g),c.y=this.am1-h*Math.cos(g),c.x=this.a*c.x+(this.x0||0),c.y=this.a*c.y+(this.y0||0),c}function e_inv(c){var h,g,m,b;if(c.x=(c.x-(this.x0||0))/this.a,c.y=(c.y-(this.y0||0))/this.a,g=common_hypot(c.x,c.y=this.am1-c.y),b=pj_inv_mlfn(this.am1+this.m1-g,this.es,this.en),(h=Math.abs(b))<Mo)h=Math.sin(b),m=g*Math.atan2(c.x,c.y)*Math.sqrt(1-this.es*h*h)/Math.cos(b);else{if(!(Math.abs(h-Mo)<=Di))throw new Error;m=0}return c.x=adjust_lon(m+(this.long0||0),this.over),c.y=adjust_lat(b),c}function s_fwd(c){var h,g,m=adjust_lon(c.x-(this.long0||0),this.over),b=c.y;return g=this.cphi1+this.phi1-b,Math.abs(g)>Di?(c.x=g*Math.sin(h=m*Math.cos(b)/g),c.y=this.cphi1-g*Math.cos(h)):c.x=c.y=0,c.x=this.a*c.x+(this.x0||0),c.y=this.a*c.y+(this.y0||0),c}function s_inv(c){var h,g;c.x=(c.x-(this.x0||0))/this.a,c.y=(c.y-(this.y0||0))/this.a;var m=common_hypot(c.x,c.y=this.cphi1-c.y);if(g=this.cphi1+this.phi1-m,Math.abs(g)>Mo)throw new Error;return h=Math.abs(Math.abs(g)-Mo)<=Di?0:m*Math.atan2(c.x,c.y)/Math.cos(g),c.x=adjust_lon(h+(this.long0||0),this.over),c.y=adjust_lat(g),c}const Ni={init:function bonne_init(){var c;if(this.phi1=this.lat1,Math.abs(this.phi1)<Di)throw new Error;this.es?(this.en=pj_enfn(this.es),this.m1=pj_mlfn(this.phi1,this.am1=Math.sin(this.phi1),c=Math.cos(this.phi1),this.en),this.am1=c/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=e_inv,this.forward=e_fwd):(Math.abs(this.phi1)+Di>=Mo?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=s_inv,this.forward=s_fwd)},names:["bonne","Bonne (Werner lat_1=90)"]},Ri={OBLIQUE:{forward:function forwardOblique(c,h){let{x:g,y:m}=h;g+=c.long0;const b=Math.cos(g),w=Math.sin(m),S=Math.cos(m);h.x=adjust_lon(Math.atan2(S*Math.sin(g),c.sphip*S*b+c.cphip*w)+c.lamp),h.y=Math.asin(c.sphip*w-c.cphip*S*b);const M=c.obliqueProjection.forward(h);c.isIdentity&&(M.x*=Eo,M.y*=Eo);return M},inverse:function inverseOblique(c,h){c.isIdentity&&(h.x*=To,h.y*=To);const g=c.obliqueProjection.inverse(h);let{x:m,y:b}=g;if(m<Number.MAX_VALUE){m-=c.lamp;const g=Math.cos(m),w=Math.sin(b),S=Math.cos(b);h.x=Math.atan2(S*Math.sin(m),c.sphip*S*g-c.cphip*w),h.y=Math.asin(c.sphip*w+c.cphip*S*g)}return h.x=adjust_lon(h.x+c.long0),h}},TRANSVERSE:{forward:function forwardTransverse(c,h){let{x:g,y:m}=h;g+=c.long0;const b=Math.cos(m),w=Math.cos(g);h.x=adjust_lon(Math.atan2(b*Math.sin(g),Math.sin(m))+c.lamp),h.y=Math.asin(-1*b*w);const S=c.obliqueProjection.forward(h);c.isIdentity&&(S.x*=Eo,S.y*=Eo);return S},inverse:function inverseTransverse(c,h){c.isIdentity&&(h.x*=To,h.y*=To);const g=c.obliqueProjection.inverse(h);let{x:m,y:b}=g;if(m<Number.MAX_VALUE){const g=Math.cos(b);m-=c.lamp,h.x=Math.atan2(g*Math.sin(m),-1*Math.sin(b)),h.y=Math.asin(g*Math.cos(m))}return h.x=adjust_lon(h.x+c.long0),h}}},Gi={ROTATE:{o_alpha:"oAlpha",o_lon_c:"oLongC",o_lat_c:"oLatC"},NEW_POLE:{o_lat_p:"oLatP",o_lon_p:"oLongP"},NEW_EQUATOR:{o_lon_1:"oLong1",o_lat_1:"oLat1",o_lon_2:"oLong2",o_lat_2:"oLat2"}};const qi={init:function ob_tran_init(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||"General Oblique Transformation",this.isIdentity=Jo.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if("ob_tran"===this.o_proj)throw new Error("Invalid value for o_proj: "+this.o_proj);const c=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),h=ha(c);if(!h)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);let g;h.long0=0,this.obliqueProjection=h;const m=Object.keys(Gi),parseParam=c=>{if(void 0===this[c])return;const h=parseFloat(this[c])*To;if(isNaN(h))throw new Error("Invalid value for "+c+": "+this[c]);return h};for(let c=0;c<m.length;c++){const h=m[c],b=Gi[h],w=Object.entries(b);if(w.some(([c])=>void 0!==this[c])){g=b;for(let c=0;c<w.length;c++){const[h,g]=w[c],m=parseParam(h);if(void 0===m)throw new Error("Missing parameter: "+h+".");this[g]=m}break}}if(!g)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:b,phip:w}=function createRotation(c,h){let g,m;if(h===Gi.ROTATE){let h=c.oLongC,b=c.oLatC,w=c.oAlpha;if(Math.abs(Math.abs(b)-Mo)<=ko)throw new Error("Invalid value for o_lat_c: "+c.o_lat_c+" should be < 90°");m=h+Math.atan2(-1*Math.cos(w),-1*Math.sin(w)*Math.sin(b)),g=Math.asin(Math.cos(b)*Math.sin(w))}else if(h===Gi.NEW_POLE)m=c.oLongP,g=c.oLatP;else{let h=c.oLong1,b=c.oLat1,w=c.oLong2,S=c.oLat2,M=Math.abs(b);if(Math.abs(b)>Mo-ko)throw new Error("Invalid value for o_lat_1: "+c.o_lat_1+" should be < 90°");if(Math.abs(S)>Mo-ko)throw new Error("Invalid value for o_lat_2: "+c.o_lat_2+" should be < 90°");if(Math.abs(b-S)<ko)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(M<ko)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");m=Math.atan2(Math.cos(b)*Math.sin(S)*Math.cos(h)-Math.sin(b)*Math.cos(S)*Math.cos(w),Math.sin(b)*Math.cos(S)*Math.sin(w)-Math.cos(b)*Math.sin(S)*Math.sin(h)),g=Math.atan(-1*Math.cos(m-h)/Math.tan(b))}return{lamp:m,phip:g}}(this,g);this.lamp=b,Math.abs(w)>ko?(this.cphip=Math.cos(w),this.sphip=Math.sin(w),this.projectionType=Ri.OBLIQUE):this.projectionType=Ri.TRANSVERSE},forward:function ob_tran_forward(c){return this.projectionType.forward(this,c)},inverse:function ob_tran_inverse(c){return this.projectionType.inverse(this,c)},names:["General Oblique Transformation","General_Oblique_Transformation","ob_tran"]};const Wi=Object.assign(pa,{defaultDatum:"WGS84",Proj:ha,WGS84:new ha("WGS84"),Point:xa,toPoint,defs:$o,nadgrid:function nadgrid(c,h,g){return h instanceof ArrayBuffer?function readNTV2Grid(c,h,g){var m=!0;void 0!==g&&!1===g.includeErrorFields&&(m=!1);var b=new DataView(h),w=function detectLittleEndian(c){var h=c.getInt32(8,!1);if(11===h)return!1;h=c.getInt32(8,!0),11!==h&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian");return!0}(b),S=function readHeader(c,h){return{nFields:c.getInt32(8,h),nSubgridFields:c.getInt32(24,h),nSubgrids:c.getInt32(40,h),shiftType:decodeString(c,56,64).trim(),fromSemiMajorAxis:c.getFloat64(120,h),fromSemiMinorAxis:c.getFloat64(136,h),toSemiMajorAxis:c.getFloat64(152,h),toSemiMinorAxis:c.getFloat64(168,h)}}(b,w),M=function readSubgrids(c,h,g,m){for(var b=176,w=[],S=0;S<h.nSubgrids;S++){var M=readGridHeader(c,b,g),k=readGridNodes(c,b,M,g,m),T=Math.round(1+(M.upperLongitude-M.lowerLongitude)/M.longitudeInterval),E=Math.round(1+(M.upperLatitude-M.lowerLatitude)/M.latitudeInterval);w.push({ll:[secondsToRadians(M.lowerLongitude),secondsToRadians(M.lowerLatitude)],del:[secondsToRadians(M.longitudeInterval),secondsToRadians(M.latitudeInterval)],lim:[T,E],count:M.gridNodeCount,cvs:mapNodes(k)});var I=16;!1===m&&(I=8),b+=176+M.gridNodeCount*I}return w}(b,S,w,m),k={header:S,subgrids:M};return ua[c]=k,k}(c,h,g):{ready:readGeotiffGrid(c,h)}},transform:transform_transform,mgrs:ba,version:"__VERSION__"});!function proj4_projs(c){c.Proj.projections.add(Ma),c.Proj.projections.add(ka),c.Proj.projections.add(Ta),c.Proj.projections.add(Ia),c.Proj.projections.add(Pa),c.Proj.projections.add(La),c.Proj.projections.add(Ba),c.Proj.projections.add(Oa),c.Proj.projections.add(za),c.Proj.projections.add(ja),c.Proj.projections.add(Ha),c.Proj.projections.add(Ua),c.Proj.projections.add(Ya),c.Proj.projections.add(Va),c.Proj.projections.add($a),c.Proj.projections.add(Xa),c.Proj.projections.add(Ka),c.Proj.projections.add(Za),c.Proj.projections.add(Ja),c.Proj.projections.add(Qa),c.Proj.projections.add(ti),c.Proj.projections.add(ei),c.Proj.projections.add(ni),c.Proj.projections.add(ri),c.Proj.projections.add(fi),c.Proj.projections.add(wi),c.Proj.projections.add(Ci),c.Proj.projections.add(Ii),c.Proj.projections.add(Pi),c.Proj.projections.add(ji),c.Proj.projections.add(Ni),c.Proj.projections.add(qi)}(Wi);const Hi=Wi;var Ui=function appendMinimap(c){var h;if(c.svg_){if(c.minimap_.size||(c.minimap_.size=150),c.Geometries.geoJSONs.worldrg)$i(c);else json(window.location.hostname.includes("ec.europa.eu")?"https://ec.europa.eu/assets/estat/E/E4/gisco/eurostat-map/world-topo-2024-60M-4326.json":"https://raw.githubusercontent.com/eurostat/eurostat-map/master/src/assets/topojson/world-topo-60M.json").then(function(h){var g=feature(h,h.objects.CNTR_RG_60M_2024_4326).features;c.Geometries.geoJSONs.worldrg=g,$i(c)}).catch(function(c){return console.error("Failed to load world-topo-60M.json",c)});window.addEventListener("estatmap:zoomed-"+c.svgId_,function debounce(c,h){var g;return function(){for(var m=arguments.length,b=new Array(m),w=0;w<m;w++)b[w]=arguments[w];clearTimeout(g),g=setTimeout(function(){return c.apply(void 0,b)},h)}}(function(c){return Yi(c.detail)},(null===(h=c.minimap_)||void 0===h?void 0:h.debounce)||3))}},Yi=function onMiniUpdate(c){applyMinimapRotation(c),applyMinimapScale(c),c._minimapGlobe.selectAll("path").attr("d",c._minimapPath)};function normalizeLon(c){return(c+540)%360-180}function applyMinimapRotation(c){var h=function getLonLatFromMapPosition(c){var h,g,m=null===(h=c.position_)||void 0===h?void 0:h.x,b=null===(g=c.position_)||void 0===g?void 0:g.y;if(!Number.isFinite(m)||!Number.isFinite(b))return null;if("3035"===c.proj_){var w=slicedToArray_slicedToArray(Hi("EPSG:3035","EPSG:4326",[m,b]),2);m=w[0],b=w[1]}else if("54030"===c.proj_){var S=slicedToArray_slicedToArray(Hi("EPSG:54030","EPSG:4326",[m,b]),2);m=S[0],b=S[1]}return[m,b]}(c);if(h){var g=slicedToArray_slicedToArray(h,2),m=g[0],b=g[1];c._minimapProjection.rotate([-normalizeLon(m),-b,0])}}function applyMinimapScale(c){var h,g=c._minimapBaseScale||c._minimapProjection.scale(),m=c._lastZoomK||(null===(h=c.__lastTransform)||void 0===h?void 0:h.k)||1,b=g*Math.pow(m,.65)*.9,w=.35*g,S=5*g;c._minimapProjection.scale(Math.max(w,Math.min(S,b)))}var Vi=function defineMinimapProjection(c){var h,g=(null===(h=c.minimap_)||void 0===h?void 0:h.z)||160;c._minimapProjection=function orthographic(){return projection_projection(orthographicRaw).scale(249.5).clipAngle(90.000001)}().scale(g).translate([0,0]),c._minimapPath=src_path().projection(c._minimapProjection),c._minimapBaseScale=c._minimapProjection.scale(),applyMinimapRotation(c),applyMinimapScale(c)},$i=function drawMinimap(c){try{var h=c.minimap_||{},g=h.x||80,m=h.y||80,b=h.color||"#929292ff",w=h.size||160,S=c.Geometries.geoJSONs.worldrg;if(c._minimapContainer=c.svg_.append("g").attr("id","em-minimap").attr("transform","translate(".concat(g,",").concat(m,")")),c._minimapContainer.append("circle").attr("class","em-minimap-inner-circle").attr("r",w/2).attr("cx",0).attr("cy",0).attr("fill","white").attr("filter","url(#em-minimap-inner-shadow)"),Vi(c),function addDefsToMinimap(c,h){var g=c._minimapContainer.append("defs");(function addInnerShadowToDefs(c){var h=c.append("filter").attr("id","em-minimap-inner-shadow").attr("x","-50%").attr("y","-50%").attr("width","200%").attr("height","200%").attr("color-interpolation-filters","sRGB");h.append("feGaussianBlur").attr("in","SourceAlpha").attr("stdDeviation",3).attr("result","blur"),h.append("feOffset").attr("in","blur").attr("dx",0).attr("dy",0).attr("result","off"),h.append("feComposite").attr("in","SourceAlpha").attr("in2","off").attr("operator","arithmetic").attr("k2","1").attr("k3","-1").attr("result","inner"),h.append("feFlood").attr("flood-color","#000").attr("flood-opacity",.4),h.append("feComposite").attr("in2","inner").attr("operator","in").attr("result","shadow"),h.append("feBlend").attr("in","SourceGraphic").attr("in2","shadow").attr("mode","multiply")})(g),g.append("clipPath").attr("id","minimap-clip").append("circle").attr("r",h/2-3).attr("cx",0).attr("cy",0)}(c,w),c._minimapGlobe=c._minimapContainer.append("g").attr("class","em-minimap-globe").attr("clip-path","url(#minimap-clip)"),c._minimapGlobe.selectAll("path.country").data(S).enter().append("path").attr("d",c._minimapPath).attr("fill","#e0e0e0"),h.highlightIds&&Array.isArray(h.highlightIds)){var M=S.filter(function(c){return h.highlightIds.includes(c.id)});M.length&&M.forEach(function(h){c._minimapGlobe.append("path").datum(h).attr("d",c._minimapPath).attr("fill",b).attr("stroke",b).attr("stroke-width",.5)})}c._minimapContainer.append("circle").attr("class","em-minimap-outer-circle").attr("r",w/2).attr("cx",0).attr("cy",0).attr("fill","none").attr("stroke",b).attr("stroke-width",3),Yi(c)}catch(c){console.error("Error drawing minimap:",c)}};var Xi={value:()=>{}};function src_dispatch_dispatch(){for(var c,h=0,g=arguments.length,m={};h<g;++h){if(!(c=arguments[h]+"")||c in m||/[\s.]/.test(c))throw new Error("illegal type: "+c);m[c]=[]}return new dispatch_Dispatch(m)}function dispatch_Dispatch(c){this._=c}function dispatch_get(c,h){for(var g,m=0,b=c.length;m<b;++m)if((g=c[m]).name===h)return g.value}function dispatch_set(c,h,g){for(var m=0,b=c.length;m<b;++m)if(c[m].name===h){c[m]=Xi,c=c.slice(0,m).concat(c.slice(m+1));break}return null!=g&&c.push({name:h,value:g}),c}dispatch_Dispatch.prototype=src_dispatch_dispatch.prototype={constructor:dispatch_Dispatch,on:function(c,h){var g,m=this._,b=function src_dispatch_parseTypenames(c,h){return c.trim().split(/^|\s+/).map(function(c){var g="",m=c.indexOf(".");if(m>=0&&(g=c.slice(m+1),c=c.slice(0,m)),c&&!h.hasOwnProperty(c))throw new Error("unknown type: "+c);return{type:c,name:g}})}(c+"",m),w=-1,S=b.length;if(!(arguments.length<2)){if(null!=h&&"function"!=typeof h)throw new Error("invalid callback: "+h);for(;++w<S;)if(g=(c=b[w]).type)m[g]=dispatch_set(m[g],c.name,h);else if(null==h)for(g in m)m[g]=dispatch_set(m[g],c.name,null);return this}for(;++w<S;)if((g=(c=b[w]).type)&&(g=dispatch_get(m[g],c.name)))return g},copy:function(){var c={},h=this._;for(var g in h)c[g]=h[g].slice();return new dispatch_Dispatch(c)},call:function(c,h){if((g=arguments.length-2)>0)for(var g,m,b=new Array(g),w=0;w<g;++w)b[w]=arguments[w+2];if(!this._.hasOwnProperty(c))throw new Error("unknown type: "+c);for(w=0,g=(m=this._[c]).length;w<g;++w)m[w].value.apply(h,b)},apply:function(c,h,g){if(!this._.hasOwnProperty(c))throw new Error("unknown type: "+c);for(var m=this._[c],b=0,w=m.length;b<w;++b)m[b].value.apply(h,g)}};const Ki=src_dispatch_dispatch,Zi={capture:!0,passive:!1};function src_noevent(c){c.preventDefault(),c.stopImmediatePropagation()}function zoom_cosh(c){return((c=Math.exp(c))+1/c)/2}const Ji=function zoomRho(c,h,g){function zoom(m,b){var w,S,M=m[0],k=m[1],T=m[2],E=b[0],I=b[1],P=b[2],L=E-M,B=I-k,z=L*L+B*B;if(z<1e-12)S=Math.log(P/T)/c,w=function(h){return[M+h*L,k+h*B,T*Math.exp(c*h*S)]};else{var j=Math.sqrt(z),D=(P*P-T*T+g*z)/(2*T*h*j),N=(P*P-T*T-g*z)/(2*P*h*j),R=Math.log(Math.sqrt(D*D+1)-D),G=Math.log(Math.sqrt(N*N+1)-N);S=(G-R)/c,w=function(g){var m=g*S,b=zoom_cosh(R),w=T/(h*j)*(b*function zoom_tanh(c){return((c=Math.exp(2*c))-1)/(c+1)}(c*m+R)-function zoom_sinh(c){return((c=Math.exp(c))-1/c)/2}(R));return[M+w*L,k+w*B,T*b/zoom_cosh(c*m+R)]}}return w.duration=1e3*S*c/Math.SQRT2,w}return zoom.rho=function(c){var h=Math.max(.001,+c),g=h*h;return zoomRho(h,g,g*g)},zoom}(Math.SQRT2,2,4);function pointer(c,h){if(c=function d3_selection_src_sourceEvent(c){let h;for(;h=c.sourceEvent;)c=h;return c}(c),void 0===h&&(h=c.currentTarget),h){var g=h.ownerSVGElement||h;if(g.createSVGPoint){var m=g.createSVGPoint();return m.x=c.clientX,m.y=c.clientY,[(m=m.matrixTransform(h.getScreenCTM().inverse())).x,m.y]}if(h.getBoundingClientRect){var b=h.getBoundingClientRect();return[c.clientX-b.left-h.clientLeft,c.clientY-b.top-h.clientTop]}}return[c.pageX,c.pageY]}var Qi,ts,es=0,ns=0,rs=0,os=0,as=0,is=0,ss="object"==typeof performance&&performance.now?performance:Date,ls="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(c){setTimeout(c,17)};function now(){return as||(ls(clearNow),as=ss.now()+is)}function clearNow(){as=0}function Timer(){this._call=this._time=this._next=null}function timer(c,h,g){var m=new Timer;return m.restart(c,h,g),m}function wake(){as=(os=ss.now())+is,es=ns=0;try{!function timerFlush(){now(),++es;for(var c,h=Qi;h;)(c=as-h._time)>=0&&h._call.call(void 0,c),h=h._next;--es}()}finally{es=0,function nap(){var c,h,g=Qi,m=1/0;for(;g;)g._call?(m>g._time&&(m=g._time),c=g,g=g._next):(h=g._next,g._next=null,g=c?c._next=h:Qi=h);ts=c,sleep(m)}(),as=0}}function poke(){var c=ss.now(),h=c-os;h>1e3&&(is-=h,os=c)}function sleep(c){es||(ns&&(ns=clearTimeout(ns)),c-as>24?(c<1/0&&(ns=setTimeout(wake,c-ss.now()-is)),rs&&(rs=clearInterval(rs))):(rs||(os=ss.now(),rs=setInterval(poke,1e3)),es=1,ls(wake)))}function src_timeout(c,h,g){var m=new Timer;return h=null==h?0:+h,m.restart(g=>{m.stop(),c(g+h)},h,g),m}Timer.prototype=timer.prototype={constructor:Timer,restart:function(c,h,g){if("function"!=typeof c)throw new TypeError("callback is not a function");g=(null==g?now():+g)+(null==h?0:+h),this._next||ts===this||(ts?ts._next=this:Qi=this,ts=this),this._call=c,this._time=g,sleep()},stop:function(){this._call&&(this._call=null,this._time=1/0,sleep())}};var cs=Ki("start","end","cancel","interrupt"),us=[];function schedule(c,h,g,m,b,w){var S=c.__transition;if(S){if(g in S)return}else c.__transition={};!function schedule_create(c,h,g){var m,b=c.__transition;function schedule(c){g.state=1,g.timer.restart(start,g.delay,g.time),g.delay<=c&&start(c-g.delay)}function start(w){var S,M,k,T;if(1!==g.state)return stop();for(S in b)if((T=b[S]).name===g.name){if(3===T.state)return src_timeout(start);4===T.state?(T.state=6,T.timer.stop(),T.on.call("interrupt",c,c.__data__,T.index,T.group),delete b[S]):+S<h&&(T.state=6,T.timer.stop(),T.on.call("cancel",c,c.__data__,T.index,T.group),delete b[S])}if(src_timeout(function(){3===g.state&&(g.state=4,g.timer.restart(tick,g.delay,g.time),tick(w))}),g.state=2,g.on.call("start",c,c.__data__,g.index,g.group),2===g.state){for(g.state=3,m=new Array(k=g.tween.length),S=0,M=-1;S<k;++S)(T=g.tween[S].value.call(c,c.__data__,g.index,g.group))&&(m[++M]=T);m.length=M+1}}function tick(h){for(var b=h<g.duration?g.ease.call(null,h/g.duration):(g.timer.restart(stop),g.state=5,1),w=-1,S=m.length;++w<S;)m[w].call(c,b);5===g.state&&(g.on.call("end",c,c.__data__,g.index,g.group),stop())}function stop(){for(var m in g.state=6,g.timer.stop(),delete b[h],b)return;delete c.__transition}b[h]=g,g.timer=timer(schedule,0,g.time)}(c,g,{name:h,index:m,group:b,on:cs,tween:us,time:w.time,delay:w.delay,duration:w.duration,ease:w.ease,timer:null,state:0})}function schedule_init(c,h){var g=schedule_get(c,h);if(g.state>0)throw new Error("too late; already scheduled");return g}function schedule_set(c,h){var g=schedule_get(c,h);if(g.state>3)throw new Error("too late; already running");return g}function schedule_get(c,h){var g=c.__transition;if(!g||!(g=g[h]))throw new Error("transition not found");return g}function interrupt(c,h){var g,m,b,w=c.__transition,S=!0;if(w){for(b in h=null==h?null:h+"",w)(g=w[b]).name===h?(m=g.state>2&&g.state<5,g.state=6,g.timer.stop(),g.on.call(m?"interrupt":"cancel",c,c.__data__,g.index,g.group),delete w[b]):S=!1;S&&delete c.__transition}}var hs,ds=180/Math.PI,ps={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function decompose(c,h,g,m,b,w){var S,M,k;return(S=Math.sqrt(c*c+h*h))&&(c/=S,h/=S),(k=c*g+h*m)&&(g-=c*k,m-=h*k),(M=Math.sqrt(g*g+m*m))&&(g/=M,m/=M,k/=M),c*m<h*g&&(c=-c,h=-h,k=-k,S=-S),{translateX:b,translateY:w,rotate:Math.atan2(h,c)*ds,skewX:Math.atan(k)*ds,scaleX:S,scaleY:M}}function interpolateTransform(c,h,g,m){function pop(c){return c.length?c.pop()+" ":""}return function(b,w){var S=[],M=[];return b=c(b),w=c(w),function translate(c,m,b,w,S,M){if(c!==b||m!==w){var k=S.push("translate(",null,h,null,g);M.push({i:k-4,x:src_number(c,b)},{i:k-2,x:src_number(m,w)})}else(b||w)&&S.push("translate("+b+h+w+g)}(b.translateX,b.translateY,w.translateX,w.translateY,S,M),function rotate(c,h,g,b){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),b.push({i:g.push(pop(g)+"rotate(",null,m)-2,x:src_number(c,h)})):h&&g.push(pop(g)+"rotate("+h+m)}(b.rotate,w.rotate,S,M),function skewX(c,h,g,b){c!==h?b.push({i:g.push(pop(g)+"skewX(",null,m)-2,x:src_number(c,h)}):h&&g.push(pop(g)+"skewX("+h+m)}(b.skewX,w.skewX,S,M),function scale(c,h,g,m,b,w){if(c!==g||h!==m){var S=b.push(pop(b)+"scale(",null,",",null,")");w.push({i:S-4,x:src_number(c,g)},{i:S-2,x:src_number(h,m)})}else 1===g&&1===m||b.push(pop(b)+"scale("+g+","+m+")")}(b.scaleX,b.scaleY,w.scaleX,w.scaleY,S,M),b=w=null,function(c){for(var h,g=-1,m=M.length;++g<m;)S[(h=M[g]).i]=h.x(c);return S.join("")}}}var fs=interpolateTransform(function parseCss(c){const h=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(c+"");return h.isIdentity?ps:decompose(h.a,h.b,h.c,h.d,h.e,h.f)},"px, ","px)","deg)"),gs=interpolateTransform(function parseSvg(c){return null==c?ps:(hs||(hs=document.createElementNS("http://www.w3.org/2000/svg","g")),hs.setAttribute("transform",c),(c=hs.transform.baseVal.consolidate())?decompose((c=c.matrix).a,c.b,c.c,c.d,c.e,c.f):ps)},", ",")",")");function tweenRemove(c,h){var g,m;return function(){var b=schedule_set(this,c),w=b.tween;if(w!==g)for(var S=0,M=(m=g=w).length;S<M;++S)if(m[S].name===h){(m=m.slice()).splice(S,1);break}b.tween=m}}function tweenFunction(c,h,g){var m,b;if("function"!=typeof g)throw new Error;return function(){var w=schedule_set(this,c),S=w.tween;if(S!==m){b=(m=S).slice();for(var M={name:h,value:g},k=0,T=b.length;k<T;++k)if(b[k].name===h){b[k]=M;break}k===T&&b.push(M)}w.tween=b}}function tweenValue(c,h,g){var m=c._id;return c.each(function(){var c=schedule_set(this,m);(c.value||(c.value={}))[h]=g.apply(this,arguments)}),function(c){return schedule_get(c,m).value[h]}}function interpolate(c,h){var g;return("number"==typeof h?src_number:h instanceof color_color?st:(g=color_color(h))?(h=g,st):string)(c,h)}function transition_attr_attrRemove(c){return function(){this.removeAttribute(c)}}function transition_attr_attrRemoveNS(c){return function(){this.removeAttributeNS(c.space,c.local)}}function transition_attr_attrConstant(c,h,g){var m,b,w=g+"";return function(){var S=this.getAttribute(c);return S===w?null:S===m?b:b=h(m=S,g)}}function transition_attr_attrConstantNS(c,h,g){var m,b,w=g+"";return function(){var S=this.getAttributeNS(c.space,c.local);return S===w?null:S===m?b:b=h(m=S,g)}}function transition_attr_attrFunction(c,h,g){var m,b,w;return function(){var S,M,k=g(this);if(null!=k)return(S=this.getAttribute(c))===(M=k+"")?null:S===m&&M===b?w:(b=M,w=h(m=S,k));this.removeAttribute(c)}}function transition_attr_attrFunctionNS(c,h,g){var m,b,w;return function(){var S,M,k=g(this);if(null!=k)return(S=this.getAttributeNS(c.space,c.local))===(M=k+"")?null:S===m&&M===b?w:(b=M,w=h(m=S,k));this.removeAttributeNS(c.space,c.local)}}function attrTweenNS(c,h){var g,m;function tween(){var b=h.apply(this,arguments);return b!==m&&(g=(m=b)&&function attrInterpolateNS(c,h){return function(g){this.setAttributeNS(c.space,c.local,h.call(this,g))}}(c,b)),g}return tween._value=h,tween}function attrTween(c,h){var g,m;function tween(){var b=h.apply(this,arguments);return b!==m&&(g=(m=b)&&function attrInterpolate(c,h){return function(g){this.setAttribute(c,h.call(this,g))}}(c,b)),g}return tween._value=h,tween}function delayFunction(c,h){return function(){schedule_init(this,c).delay=+h.apply(this,arguments)}}function delayConstant(c,h){return h=+h,function(){schedule_init(this,c).delay=h}}function durationFunction(c,h){return function(){schedule_set(this,c).duration=+h.apply(this,arguments)}}function durationConstant(c,h){return h=+h,function(){schedule_set(this,c).duration=h}}var _s=G.prototype.constructor;function transition_style_styleRemove(c){return function(){this.style.removeProperty(c)}}var ms=0;function Transition(c,h,g,m){this._groups=c,this._parents=h,this._name=g,this._id=m}function newId(){return++ms}var vs=G.prototype;Transition.prototype=function transition_transition(c){return G().transition(c)}.prototype={constructor:Transition,select:function transition_select(c){var h=this._name,g=this._id;"function"!=typeof c&&(c=selector(c));for(var m=this._groups,b=m.length,w=new Array(b),S=0;S<b;++S)for(var M,k,T=m[S],E=T.length,I=w[S]=new Array(E),P=0;P<E;++P)(M=T[P])&&(k=c.call(M,M.__data__,P,T))&&("__data__"in M&&(k.__data__=M.__data__),I[P]=k,schedule(I[P],h,g,P,I,schedule_get(M,g)));return new Transition(w,this._parents,h,g)},selectAll:function transition_selectAll(c){var h=this._name,g=this._id;"function"!=typeof c&&(c=selectorAll(c));for(var m=this._groups,b=m.length,w=[],S=[],M=0;M<b;++M)for(var k,T=m[M],E=T.length,I=0;I<E;++I)if(k=T[I]){for(var P,L=c.call(k,k.__data__,I,T),B=schedule_get(k,g),z=0,j=L.length;z<j;++z)(P=L[z])&&schedule(P,h,g,z,L,B);w.push(L),S.push(k)}return new Transition(w,S,h,g)},selectChild:vs.selectChild,selectChildren:vs.selectChildren,filter:function transition_filter(c){"function"!=typeof c&&(c=matcher(c));for(var h=this._groups,g=h.length,m=new Array(g),b=0;b<g;++b)for(var w,S=h[b],M=S.length,k=m[b]=[],T=0;T<M;++T)(w=S[T])&&c.call(w,w.__data__,T,S)&&k.push(w);return new Transition(m,this._parents,this._name,this._id)},merge:function transition_merge(c){if(c._id!==this._id)throw new Error;for(var h=this._groups,g=c._groups,m=h.length,b=g.length,w=Math.min(m,b),S=new Array(m),M=0;M<w;++M)for(var k,T=h[M],E=g[M],I=T.length,P=S[M]=new Array(I),L=0;L<I;++L)(k=T[L]||E[L])&&(P[L]=k);for(;M<m;++M)S[M]=h[M];return new Transition(S,this._parents,this._name,this._id)},selection:function transition_selection(){return new _s(this._groups,this._parents)},transition:function transition(){for(var c=this._name,h=this._id,g=newId(),m=this._groups,b=m.length,w=0;w<b;++w)for(var S,M=m[w],k=M.length,T=0;T<k;++T)if(S=M[T]){var E=schedule_get(S,h);schedule(S,c,g,T,M,{time:E.time+E.delay+E.duration,delay:0,duration:E.duration,ease:E.ease})}return new Transition(m,this._parents,c,g)},call:vs.call,nodes:vs.nodes,node:vs.node,size:vs.size,empty:vs.empty,each:vs.each,on:function transition_on(c,h){var g=this._id;return arguments.length<2?schedule_get(this.node(),g).on.on(c):this.each(function onFunction(c,h,g){var m,b,w=function on_start(c){return(c+"").trim().split(/^|\s+/).every(function(c){var h=c.indexOf(".");return h>=0&&(c=c.slice(0,h)),!c||"start"===c})}(h)?schedule_init:schedule_set;return function(){var S=w(this,c),M=S.on;M!==m&&(b=(m=M).copy()).on(h,g),S.on=b}}(g,c,h))},attr:function transition_attr(c,h){var g=namespace(c),m="transform"===g?gs:interpolate;return this.attrTween(c,"function"==typeof h?(g.local?transition_attr_attrFunctionNS:transition_attr_attrFunction)(g,m,tweenValue(this,"attr."+c,h)):null==h?(g.local?transition_attr_attrRemoveNS:transition_attr_attrRemove)(g):(g.local?transition_attr_attrConstantNS:transition_attr_attrConstant)(g,m,h))},attrTween:function transition_attrTween(c,h){var g="attr."+c;if(arguments.length<2)return(g=this.tween(g))&&g._value;if(null==h)return this.tween(g,null);if("function"!=typeof h)throw new Error;var m=namespace(c);return this.tween(g,(m.local?attrTweenNS:attrTween)(m,h))},style:function transition_style(c,h,g){var m="transform"==(c+="")?fs:interpolate;return null==h?this.styleTween(c,function styleNull(c,h){var g,m,b;return function(){var w=styleValue(this,c),S=(this.style.removeProperty(c),styleValue(this,c));return w===S?null:w===g&&S===m?b:b=h(g=w,m=S)}}(c,m)).on("end.style."+c,transition_style_styleRemove(c)):"function"==typeof h?this.styleTween(c,function transition_style_styleFunction(c,h,g){var m,b,w;return function(){var S=styleValue(this,c),M=g(this),k=M+"";return null==M&&(this.style.removeProperty(c),k=M=styleValue(this,c)),S===k?null:S===m&&k===b?w:(b=k,w=h(m=S,M))}}(c,m,tweenValue(this,"style."+c,h))).each(function styleMaybeRemove(c,h){var g,m,b,w,S="style."+h,M="end."+S;return function(){var k=schedule_set(this,c),T=k.on,E=null==k.value[S]?w||(w=transition_style_styleRemove(h)):void 0;T===g&&b===E||(m=(g=T).copy()).on(M,b=E),k.on=m}}(this._id,c)):this.styleTween(c,function transition_style_styleConstant(c,h,g){var m,b,w=g+"";return function(){var S=styleValue(this,c);return S===w?null:S===m?b:b=h(m=S,g)}}(c,m,h),g).on("end.style."+c,null)},styleTween:function transition_styleTween(c,h,g){var m="style."+(c+="");if(arguments.length<2)return(m=this.tween(m))&&m._value;if(null==h)return this.tween(m,null);if("function"!=typeof h)throw new Error;return this.tween(m,function styleTween(c,h,g){var m,b;function tween(){var w=h.apply(this,arguments);return w!==b&&(m=(b=w)&&function styleInterpolate(c,h,g){return function(m){this.style.setProperty(c,h.call(this,m),g)}}(c,w,g)),m}return tween._value=h,tween}(c,h,null==g?"":g))},text:function transition_text(c){return this.tween("text","function"==typeof c?function transition_text_textFunction(c){return function(){var h=c(this);this.textContent=null==h?"":h}}(tweenValue(this,"text",c)):function transition_text_textConstant(c){return function(){this.textContent=c}}(null==c?"":c+""))},textTween:function transition_textTween(c){var h="text";if(arguments.length<1)return(h=this.tween(h))&&h._value;if(null==c)return this.tween(h,null);if("function"!=typeof c)throw new Error;return this.tween(h,function textTween(c){var h,g;function tween(){var m=c.apply(this,arguments);return m!==g&&(h=(g=m)&&function textInterpolate(c){return function(h){this.textContent=c.call(this,h)}}(m)),h}return tween._value=c,tween}(c))},remove:function transition_remove(){return this.on("end.remove",function removeFunction(c){return function(){var h=this.parentNode;for(var g in this.__transition)if(+g!==c)return;h&&h.removeChild(this)}}(this._id))},tween:function tween(c,h){var g=this._id;if(c+="",arguments.length<2){for(var m,b=schedule_get(this.node(),g).tween,w=0,S=b.length;w<S;++w)if((m=b[w]).name===c)return m.value;return null}return this.each((null==h?tweenRemove:tweenFunction)(g,c,h))},delay:function delay(c){var h=this._id;return arguments.length?this.each(("function"==typeof c?delayFunction:delayConstant)(h,c)):schedule_get(this.node(),h).delay},duration:function duration(c){var h=this._id;return arguments.length?this.each(("function"==typeof c?durationFunction:durationConstant)(h,c)):schedule_get(this.node(),h).duration},ease:function ease(c){var h=this._id;return arguments.length?this.each(function easeConstant(c,h){if("function"!=typeof h)throw new Error;return function(){schedule_set(this,c).ease=h}}(h,c)):schedule_get(this.node(),h).ease},easeVarying:function transition_easeVarying(c){if("function"!=typeof c)throw new Error;return this.each(function easeVarying(c,h){return function(){var g=h.apply(this,arguments);if("function"!=typeof g)throw new Error;schedule_set(this,c).ease=g}}(this._id,c))},end:function end(){var c,h,g=this,m=g._id,b=g.size();return new Promise(function(w,S){var M={value:S},k={value:function(){0===--b&&w()}};g.each(function(){var g=schedule_set(this,m),b=g.on;b!==c&&((h=(c=b).copy())._.cancel.push(M),h._.interrupt.push(M),h._.end.push(k)),g.on=h}),0===b&&w()})},[Symbol.iterator]:vs[Symbol.iterator]};var ys={time:null,delay:0,duration:250,ease:function cubicInOut(c){return((c*=2)<=1?c*c*c:(c-=2)*c*c+2)/2}};function inherit(c,h){for(var g;!(g=c.__transition)||!(g=g[h]);)if(!(c=c.parentNode))throw new Error(`transition ${h} not found`);return g}G.prototype.interrupt=function selection_interrupt(c){return this.each(function(){interrupt(this,c)})},G.prototype.transition=function selection_transition(c){var h,g;c instanceof Transition?(h=c._id,c=c._name):(h=newId(),(g=ys).time=now(),c=null==c?null:c+"");for(var m=this._groups,b=m.length,w=0;w<b;++w)for(var S,M=m[w],k=M.length,T=0;T<k;++T)(S=M[T])&&schedule(S,c,h,T,M,g||inherit(S,h));return new Transition(m,this._parents,c,h)};const d3_zoom_src_constant=c=>()=>c;function ZoomEvent(c,{sourceEvent:h,target:g,transform:m,dispatch:b}){Object.defineProperties(this,{type:{value:c,enumerable:!0,configurable:!0},sourceEvent:{value:h,enumerable:!0,configurable:!0},target:{value:g,enumerable:!0,configurable:!0},transform:{value:m,enumerable:!0,configurable:!0},_:{value:b}})}function Transform(c,h,g){this.k=c,this.x=h,this.y=g}Transform.prototype={constructor:Transform,scale:function(c){return 1===c?this:new Transform(this.k*c,this.x,this.y)},translate:function(c,h){return 0===c&0===h?this:new Transform(this.k,this.x+this.k*c,this.y+this.k*h)},apply:function(c){return[c[0]*this.k+this.x,c[1]*this.k+this.y]},applyX:function(c){return c*this.k+this.x},applyY:function(c){return c*this.k+this.y},invert:function(c){return[(c[0]-this.x)/this.k,(c[1]-this.y)/this.k]},invertX:function(c){return(c-this.x)/this.k},invertY:function(c){return(c-this.y)/this.k},rescaleX:function(c){return c.copy().domain(c.range().map(this.invertX,this).map(c.invert,c))},rescaleY:function(c){return c.copy().domain(c.range().map(this.invertY,this).map(c.invert,c))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var As=new Transform(1,0,0);function src_noevent_nopropagation(c){c.stopImmediatePropagation()}function d3_zoom_src_noevent(c){c.preventDefault(),c.stopImmediatePropagation()}function zoom_defaultFilter(c){return!(c.ctrlKey&&"wheel"!==c.type||c.button)}function defaultExtent(){var c=this;return c instanceof SVGElement?(c=c.ownerSVGElement||c).hasAttribute("viewBox")?[[(c=c.viewBox.baseVal).x,c.y],[c.x+c.width,c.y+c.height]]:[[0,0],[c.width.baseVal.value,c.height.baseVal.value]]:[[0,0],[c.clientWidth,c.clientHeight]]}function defaultTransform(){return this.__zoom||As}function defaultWheelDelta(c){return-c.deltaY*(1===c.deltaMode?.05:c.deltaMode?1:.002)*(c.ctrlKey?10:1)}function zoom_defaultTouchable(){return navigator.maxTouchPoints||"ontouchstart"in this}function defaultConstrain(c,h,g){var m=c.invertX(h[0][0])-g[0][0],b=c.invertX(h[1][0])-g[1][0],w=c.invertY(h[0][1])-g[0][1],S=c.invertY(h[1][1])-g[1][1];return c.translate(b>m?(m+b)/2:Math.min(0,m)||Math.max(0,b),S>w?(w+S)/2:Math.min(0,w)||Math.max(0,S))}function zoom(){var c,h,g,m=zoom_defaultFilter,b=defaultExtent,w=defaultConstrain,S=defaultWheelDelta,M=zoom_defaultTouchable,k=[0,1/0],T=[[-1/0,-1/0],[1/0,1/0]],E=250,I=Ji,P=Ki("start","zoom","end"),L=0,B=10;function zoom(c){c.property("__zoom",defaultTransform).on("wheel.zoom",wheeled,{passive:!1}).on("mousedown.zoom",mousedowned).on("dblclick.zoom",dblclicked).filter(M).on("touchstart.zoom",touchstarted).on("touchmove.zoom",touchmoved).on("touchend.zoom touchcancel.zoom",touchended).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function scale(c,h){return(h=Math.max(k[0],Math.min(k[1],h)))===c.k?c:new Transform(h,c.x,c.y)}function translate(c,h,g){var m=h[0]-g[0]*c.k,b=h[1]-g[1]*c.k;return m===c.x&&b===c.y?c:new Transform(c.k,m,b)}function centroid(c){return[(+c[0][0]+ +c[1][0])/2,(+c[0][1]+ +c[1][1])/2]}function schedule(c,h,g,m){c.on("start.zoom",function(){gesture(this,arguments).event(m).start()}).on("interrupt.zoom end.zoom",function(){gesture(this,arguments).event(m).end()}).tween("zoom",function(){var c=this,w=arguments,S=gesture(c,w).event(m),M=b.apply(c,w),k=null==g?centroid(M):"function"==typeof g?g.apply(c,w):g,T=Math.max(M[1][0]-M[0][0],M[1][1]-M[0][1]),E=c.__zoom,P="function"==typeof h?h.apply(c,w):h,L=I(E.invert(k).concat(T/E.k),P.invert(k).concat(T/P.k));return function(c){if(1===c)c=P;else{var h=L(c),g=T/h[2];c=new Transform(g,k[0]-h[0]*g,k[1]-h[1]*g)}S.zoom(null,c)}})}function gesture(c,h,g){return!g&&c.__zooming||new Gesture(c,h)}function Gesture(c,h){this.that=c,this.args=h,this.active=0,this.sourceEvent=null,this.extent=b.apply(c,h),this.taps=0}function wheeled(c,...h){if(m.apply(this,arguments)){var g=gesture(this,h).event(c),b=this.__zoom,M=Math.max(k[0],Math.min(k[1],b.k*Math.pow(2,S.apply(this,arguments)))),E=pointer(c);if(g.wheel)g.mouse[0][0]===E[0]&&g.mouse[0][1]===E[1]||(g.mouse[1]=b.invert(g.mouse[0]=E)),clearTimeout(g.wheel);else{if(b.k===M)return;g.mouse=[E,b.invert(E)],interrupt(this),g.start()}d3_zoom_src_noevent(c),g.wheel=setTimeout(function wheelidled(){g.wheel=null,g.end()},150),g.zoom("mouse",w(translate(scale(b,M),g.mouse[0],g.mouse[1]),g.extent,T))}}function mousedowned(c,...h){if(!g&&m.apply(this,arguments)){var b=c.currentTarget,S=gesture(this,h,!0).event(c),M=src_select(c.view).on("mousemove.zoom",function mousemoved(c){if(d3_zoom_src_noevent(c),!S.moved){var h=c.clientX-E,g=c.clientY-I;S.moved=h*h+g*g>L}S.event(c).zoom("mouse",w(translate(S.that.__zoom,S.mouse[0]=pointer(c,b),S.mouse[1]),S.extent,T))},!0).on("mouseup.zoom",function mouseupped(c){M.on("mousemove.zoom mouseup.zoom",null),function nodrag_yesdrag(c,h){var g=c.document.documentElement,m=src_select(c).on("dragstart.drag",null);h&&(m.on("click.drag",src_noevent,Zi),setTimeout(function(){m.on("click.drag",null)},0)),"onselectstart"in g?m.on("selectstart.drag",null):(g.style.MozUserSelect=g.__noselect,delete g.__noselect)}(c.view,S.moved),d3_zoom_src_noevent(c),S.event(c).end()},!0),k=pointer(c,b),E=c.clientX,I=c.clientY;!function src_nodrag(c){var h=c.document.documentElement,g=src_select(c).on("dragstart.drag",src_noevent,Zi);"onselectstart"in h?g.on("selectstart.drag",src_noevent,Zi):(h.__noselect=h.style.MozUserSelect,h.style.MozUserSelect="none")}(c.view),src_noevent_nopropagation(c),S.mouse=[k,this.__zoom.invert(k)],interrupt(this),S.start()}}function dblclicked(c,...h){if(m.apply(this,arguments)){var g=this.__zoom,S=pointer(c.changedTouches?c.changedTouches[0]:c,this),M=g.invert(S),k=g.k*(c.shiftKey?.5:2),I=w(translate(scale(g,k),S,M),b.apply(this,h),T);d3_zoom_src_noevent(c),E>0?src_select(this).transition().duration(E).call(schedule,I,S,c):src_select(this).call(zoom.transform,I,S,c)}}function touchstarted(g,...b){if(m.apply(this,arguments)){var w,S,M,k,T=g.touches,E=T.length,I=gesture(this,b,g.changedTouches.length===E).event(g);for(src_noevent_nopropagation(g),S=0;S<E;++S)k=[k=pointer(M=T[S],this),this.__zoom.invert(k),M.identifier],I.touch0?I.touch1||I.touch0[2]===k[2]||(I.touch1=k,I.taps=0):(I.touch0=k,w=!0,I.taps=1+!!c);c&&(c=clearTimeout(c)),w&&(I.taps<2&&(h=k[0],c=setTimeout(function(){c=null},500)),interrupt(this),I.start())}}function touchmoved(c,...h){if(this.__zooming){var g,m,b,S,M=gesture(this,h).event(c),k=c.changedTouches,E=k.length;for(d3_zoom_src_noevent(c),g=0;g<E;++g)b=pointer(m=k[g],this),M.touch0&&M.touch0[2]===m.identifier?M.touch0[0]=b:M.touch1&&M.touch1[2]===m.identifier&&(M.touch1[0]=b);if(m=M.that.__zoom,M.touch1){var I=M.touch0[0],P=M.touch0[1],L=M.touch1[0],B=M.touch1[1],z=(z=L[0]-I[0])*z+(z=L[1]-I[1])*z,j=(j=B[0]-P[0])*j+(j=B[1]-P[1])*j;m=scale(m,Math.sqrt(z/j)),b=[(I[0]+L[0])/2,(I[1]+L[1])/2],S=[(P[0]+B[0])/2,(P[1]+B[1])/2]}else{if(!M.touch0)return;b=M.touch0[0],S=M.touch0[1]}M.zoom("touch",w(translate(m,b,S),M.extent,T))}}function touchended(c,...m){if(this.__zooming){var b,w,S=gesture(this,m).event(c),M=c.changedTouches,k=M.length;for(src_noevent_nopropagation(c),g&&clearTimeout(g),g=setTimeout(function(){g=null},500),b=0;b<k;++b)w=M[b],S.touch0&&S.touch0[2]===w.identifier?delete S.touch0:S.touch1&&S.touch1[2]===w.identifier&&delete S.touch1;if(S.touch1&&!S.touch0&&(S.touch0=S.touch1,delete S.touch1),S.touch0)S.touch0[1]=this.__zoom.invert(S.touch0[0]);else if(S.end(),2===S.taps&&(w=pointer(w,this),Math.hypot(h[0]-w[0],h[1]-w[1])<B)){var T=src_select(this).on("dblclick.zoom");T&&T.apply(this,arguments)}}}return zoom.transform=function(c,h,g,m){var b=c.selection?c.selection():c;b.property("__zoom",defaultTransform),c!==b?schedule(c,h,g,m):b.interrupt().each(function(){gesture(this,arguments).event(m).start().zoom(null,"function"==typeof h?h.apply(this,arguments):h).end()})},zoom.scaleBy=function(c,h,g,m){zoom.scaleTo(c,function(){return this.__zoom.k*("function"==typeof h?h.apply(this,arguments):h)},g,m)},zoom.scaleTo=function(c,h,g,m){zoom.transform(c,function(){var c=b.apply(this,arguments),m=this.__zoom,S=null==g?centroid(c):"function"==typeof g?g.apply(this,arguments):g,M=m.invert(S),k="function"==typeof h?h.apply(this,arguments):h;return w(translate(scale(m,k),S,M),c,T)},g,m)},zoom.translateBy=function(c,h,g,m){zoom.transform(c,function(){return w(this.__zoom.translate("function"==typeof h?h.apply(this,arguments):h,"function"==typeof g?g.apply(this,arguments):g),b.apply(this,arguments),T)},null,m)},zoom.translateTo=function(c,h,g,m,S){zoom.transform(c,function(){var c=b.apply(this,arguments),S=this.__zoom,M=null==m?centroid(c):"function"==typeof m?m.apply(this,arguments):m;return w(As.translate(M[0],M[1]).scale(S.k).translate("function"==typeof h?-h.apply(this,arguments):-h,"function"==typeof g?-g.apply(this,arguments):-g),c,T)},m,S)},Gesture.prototype={event:function(c){return c&&(this.sourceEvent=c),this},start:function(){return 1===++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(c,h){return this.mouse&&"mouse"!==c&&(this.mouse[1]=h.invert(this.mouse[0])),this.touch0&&"touch"!==c&&(this.touch0[1]=h.invert(this.touch0[0])),this.touch1&&"touch"!==c&&(this.touch1[1]=h.invert(this.touch1[0])),this.that.__zoom=h,this.emit("zoom"),this},end:function(){return 0===--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(c){var h=src_select(this.that).datum();P.call(c,this.that,new ZoomEvent(c,{sourceEvent:this.sourceEvent,target:zoom,type:c,transform:this.that.__zoom,dispatch:P}),h)}},zoom.wheelDelta=function(c){return arguments.length?(S="function"==typeof c?c:d3_zoom_src_constant(+c),zoom):S},zoom.filter=function(c){return arguments.length?(m="function"==typeof c?c:d3_zoom_src_constant(!!c),zoom):m},zoom.touchable=function(c){return arguments.length?(M="function"==typeof c?c:d3_zoom_src_constant(!!c),zoom):M},zoom.extent=function(c){return arguments.length?(b="function"==typeof c?c:d3_zoom_src_constant([[+c[0][0],+c[0][1]],[+c[1][0],+c[1][1]]]),zoom):b},zoom.scaleExtent=function(c){return arguments.length?(k[0]=+c[0],k[1]=+c[1],zoom):[k[0],k[1]]},zoom.translateExtent=function(c){return arguments.length?(T[0][0]=+c[0][0],T[1][0]=+c[1][0],T[0][1]=+c[0][1],T[1][1]=+c[1][1],zoom):[[T[0][0],T[0][1]],[T[1][0],T[1][1]]]},zoom.constrain=function(c){return arguments.length?(w=c,zoom):w},zoom.duration=function(c){return arguments.length?(E=+c,zoom):E},zoom.interpolate=function(c){return arguments.length?(I=c,zoom):I},zoom.on=function(){var c=P.on.apply(P,arguments);return c===P?zoom:c},zoom.clickDistance=function(c){return arguments.length?(L=(c=+c)*c,zoom):Math.sqrt(L)},zoom.tapDistance=function(c){return arguments.length?(B=+c,zoom):B},zoom}Transform.prototype;var bs=function defineMapZoom(c){c.gridCartogram_?function defineGridCartogramZoom(c){var h=c.svg(),g=h.select("#em-zoom-group-"+c.svgId_);c.__zoomBehavior=zoom().scaleExtent(c.zoomExtent_||[1,8]).on("zoom",function(h){var m;g.attr("transform",h.transform),c.__lastTransform=h.transform,null===(m=c.onZoom_)||void 0===m||m.call(c,h,c)}).on("end",function(h){var g;null===(g=c.onZoomEnd_)||void 0===g||g.call(c,h,c)}),h.call(c.__zoomBehavior),h.call(c.__zoomBehavior.transform,As)}(c):xs(c)};var xs=function defineGeographicZoom(c){var h,g=src_select("#"+c.svgId()),m=As,b=!c.lockPanUntilZoom_,w=!1,S=c.zoomExtent_||[0,0],M=Math.max(S[0]||1,.01),k=M<1,T=null!==(h=c.panPadFactor_)&&void 0!==h?h:.1,E=k?T*(1/M-1)*c.width_:c.width_,I=k?T*(1/M-1)*c.height_:c.height_,P=c.translateExtent_?c.translateExtent_:k?[[-E,-I],[c.width_+E,c.height_+I]]:[[0,0],[c.width_,c.height_]];if(c.__zoomBehavior=zoom().filter(function(c){return!c.target.closest(".em-zoom-buttons")&&!c.target.closest(".em-button")}).extent([[0,0],[c.width_,c.height_]]).scaleExtent(S).translateExtent(P).on("start",function(c){c.sourceEvent&&"wheel"!==c.sourceEvent.type&&g.classed("em-dragging",!0)}).on("zoom",function(h){var S=h.transform,M=c.svg_.select("#em-zoom-group-"+c.svgId_);w?w=!1:(c.__lastTransform=S,S.k!==m.k?(c.lockPanUntilZoom_&&(b=!0),Cs(h,m,c),M.attr("data-zoom",S.k).attr("transform",S),m=S):!c.lockPanUntilZoom_||b?(ws(h,c),M.attr("transform",S),m=S):(w=!0,g.call(c.__zoomBehavior.transform,m)))}).on("end",function(h){var m;g.classed("em-dragging",!1),null===(m=c.onZoomEnd_)||void 0===m||m.call(c,h,c),window.dispatchEvent(new CustomEvent("estatmap:zoomend-"+c.svgId_,{detail:c}))}),c.__lastTransform=m,!c.__baseZ){var L=c.height_/2,B=slicedToArray_slicedToArray(c._projection.invert([0,L]),1)[0],z=slicedToArray_slicedToArray(c._projection.invert([c.width_,L]),1)[0];c.__baseZ=(z-B)/c.width_}g.call(c.__zoomBehavior)};var ws=function panHandler(c,h){var g=c.transform,m=(h.width_/2-g.x)/g.k,b=(h.height_/2-g.y)/g.k,w=slicedToArray_slicedToArray(h._projection.invert([m,b]),2),S=w[0],M=w[1];h.position_.x=S,h.position_.y=M,window.dispatchEvent(new CustomEvent("estatmap:zoomed-"+h.svgId_,{detail:h})),"function"==typeof h.onZoom_&&h.onZoom_(c,h)},Cs=function zoomHandler(c,h,g){var m,b,w=c.transform,S=(g.width_/2-w.x)/w.k,M=(g.height_/2-w.y)/w.k,k=slicedToArray_slicedToArray(g._projection.invert([S,M]),2),T=k[0],E=k[1];if(g.__programmaticZoom){var I=g.__programmaticZoom;g.position_.x=I.x,g.position_.y=I.y,g.position_.z=I.z,delete g.__programmaticZoom}else g.position_.x=T,g.position_.y=E,g.position_.z=g.__baseZ/w.k;g._lastZoomK=w.k,ks(w,g),!1!==(null===(m=g.labels_)||void 0===m?void 0:m.scaleOnZoom)&&Ms(w,g),null!==(b=g.labels_)&&void 0!==b&&b.backgrounds&&Ss(w,g),window.dispatchEvent(new CustomEvent("estatmap:zoomed-"+g.svgId_,{detail:g})),"function"==typeof g.onZoom_&&g.onZoom_(c,g)},Ss=function scaleLabelBackgrounds(c,h){var g=h.svg_.select("#em-zoom-group-"+h.svgId_).selectAll(".em-label-background"),m=c.k,b=[];g.each(function(){var c=src_select(this),h=parseFloat(c.attr("data-width"))||parseFloat(c.attr("width")),g=parseFloat(c.attr("data-height"))||parseFloat(c.attr("height")),w=parseFloat(c.attr("data-x"))||parseFloat(c.attr("x")),S=parseFloat(c.attr("data-y"))||parseFloat(c.attr("y"));if(h>0&&g>0&&!isNaN(w)&&!isNaN(S)){c.attr("data-width")||(c.attr("data-width",h),c.attr("data-height",g),c.attr("data-x",w),c.attr("data-y",S));var M=h*(1/m),k=g*(1/m),T=w*(1/m),E=S*(1/m);b.push({element:c,targetWidth:M,targetHeight:k,targetX:T,targetY:E})}}),b.forEach(function(c){var h=c.element,g=c.targetWidth,m=c.targetHeight,b=c.targetX,w=c.targetY;h.attr("width",g).attr("height",m).attr("x",b).attr("y",w)})},Ms=function scaleLabelTexts(c,h){var g=h.svg_.select("#em-zoom-group-"+h.svgId_).select("#em-labels").selectAll("*"),m=c.k,b=[];g.each(function(){var c=src_select(this),h=window.getComputedStyle(this),g=c.attr("font-size"),w=h.fontSize,S=g||w;if(S&&parseFloat(S)>0){var M=parseFloat(c.attr("data-fs"))||parseFloat(g)||parseFloat(w);c.attr("data-fs")||c.attr("data-fs",M);var k=M/m;b.push({element:this,targetFontSize:k})}}),b.forEach(function(c){var h=c.element,g=c.targetFontSize;h.style.setProperty("font-size","".concat(g,"px"),"important")})},ks=function scaleStrokeWidths(c,h){var g=h.svg_.select("#em-zoom-group-"+h.svgId_).selectAll("*"),m=c.k,b=[];g.each(function(){var c=src_select(this),h=window.getComputedStyle(this),g=c.attr("stroke-width"),w=h.strokeWidth,S=g||w;if(S&&parseFloat(S)>0){var M=parseFloat(c.attr("data-sw"))||parseFloat(g)||parseFloat(w);c.attr("data-sw")||c.attr("data-sw",M);var k=M/m;b.push({element:this,targetStrokeWidth:k})}}),b.forEach(function(c){var h=c.element,g=c.targetStrokeWidth;h.style.setProperty("stroke-width","".concat(g,"px"),"important")})};var Ts=dsv("\t"),Es=Ts.parse;Ts.parseRows,Ts.format,Ts.formatBody,Ts.formatRows,Ts.formatRow,Ts.formatValue;function responseText(c){if(!c.ok)throw new Error(c.status+" "+c.statusText);return c.text()}function dsvParse(c){return function(h,g,m){return 2===arguments.length&&"function"==typeof g&&(m=g,g=void 0),function src_text(c,h){return fetch(c,h).then(responseText)}(h,g).then(function(h){return c(h,m)})}}var Is=dsvParse(lo);dsvParse(Es);var Ps=function projectToMap(c,h,g){switch(c.proj_){case"3035":return Hi("EPSG:4326","EPSG:3035",[h,g]);case"54030":return Hi("EPSG:4326","EPSG:54030",[h,g]);default:return[h,g]}};function placenames_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function placenames_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?placenames_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):placenames_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}function placenames_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function placenames_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return placenames_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?placenames_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function placenames_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}var Ls=window.location.hostname.includes("ec.europa.eu")?"https://ec.europa.eu/assets/estat/E/E4/gisco/pub/euronym/v3/UTF_LATIN/50/EUR.csv":"https://raw.githubusercontent.com/eurostat/euronym/main/pub/v3/UTF_LATIN/50/EUR.csv";function loadPlacenames(c){return _loadPlacenames.apply(this,arguments)}function _loadPlacenames(){return _loadPlacenames=_asyncToGenerator(It().mark(function _callee(c){var h,g,m,b=arguments;return It().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return h=b.length>1&&void 0!==b[1]?b[1]:Ls,w.next=1,Is(h);case 1:return g=w.sent,m=g,c.placenamesFilter_&&(m=c.placenamesFilter_(g)),c._placenameLabels=m,w.abrupt("return",m);case 2:case"end":return w.stop()}},_callee)})),_loadPlacenames.apply(this,arguments)}function _addPlacenameLabels(){return _addPlacenameLabels=_asyncToGenerator(It().mark(function _callee2(c){return It().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(c._placenameLabels){h.next=1;break}return h.next=1,loadPlacenames(c);case 1:appendPlacenameLabels(c),window.addEventListener("estatmap:zoomend-"+c.svgId_,function(c){updatePlacenameLabels(c.detail,c.detail.__lastTransform)});case 2:case"end":return h.stop()}},_callee2)})),_addPlacenameLabels.apply(this,arguments)}function appendPlacenameLabels(c){var h,g=c.svg_,m=(null===(h=c.__lastTransform)||void 0===h?void 0:h.k)||1,b=Fs(c);console.log("Filtered ".concat(b.length," placenames for zoom level ").concat(m)),g.select("#em-placenames").remove();var w=g.select("#em-zoom-group-"+c.svgId_).append("g").attr("id","em-placenames").attr("class","em-placenames").attr("pointer-events","none");w.selectAll("text").data(b).join("text").attr("x",function(c){return c.screenX}).attr("y",function(c){return c.screenY}).text(function(c){return c.name}).attr("class","em-placename").attr("font-size",function(c){return"".concat(13*c.sizeFactor/m,"px")}).attr("font-weight",function(c){return c.sizeFactor>1?"bold":"normal"}).attr("dy","-0.35em").clone(!0).lower().attr("class","em-placename-halo").attr("stroke-width",3/m),c.placenameGroup_=w}var Fs=function getFilteredPlacenames(c){if(!c._placenameLabels)return[];var h,g=c._projection,m=c.width_,b=c.height_,w=c.position_.z,S=c.__lastTransform||{k:1,x:0,y:0},M=S.invertX(0)-30,k=S.invertY(0)-30,T=S.invertX(m)+30,E=S.invertY(b)+30,I=[],P=placenames_createForOfIteratorHelper(c._placenameLabels);try{for(P.s();!(h=P.n()).done;){var L=h.value,B=+L.rs,z=+L.r1;if(B&&!(w>B)){var j=+L.lon,D=+L.lat,N=slicedToArray_slicedToArray(Ps(c,j,D),2),R=slicedToArray_slicedToArray(g([N[0],N[1]]),2),G=R[0],q=R[1];if(!(G<M||G>T||q<k||q>E)&&(I.push(placenames_objectSpread(placenames_objectSpread({},L),{},{screenX:G,screenY:q,sizeFactor:w>z?1:1.1})),I.length>=500))break}}}catch(c){P.e(c)}finally{P.f()}return console.log("After filtering, ".concat(I.length," placenames remain.")),I};function updatePlacenameLabels(c,h){c._placenameLabels&&c._projection&&appendPlacenameLabels(c)}function appendCoastalMargin(c){if(c.svg_&&c._pathFunction){var h=function draw(c){var h=src_select("#em-zoom-group-"+c.svgId_);if(!h.empty()&&(h.select(".em-coastal-margin").remove(),c.drawCoastalMargin_)){!function ensureCoastalMarginFilter(c,h){var g,m=c.select("defs").empty()?c.append("defs"):c.select("defs");if(!m.select("#em-coastal-margin-filter").empty())return;var b=m.append("filter").attr("id","em-coastal-margin-filter").attr("x","-50%").attr("y","-50%").attr("width","200%").attr("height","200%");b.append("feGaussianBlur").attr("in","SourceGraphic").attr("stdDeviation",h.standardDeviation).attr("result","blur"),b.append("feColorMatrix").attr("in","blur").attr("type","matrix").attr("values","\n 1 0 0 0 0\n 0 1 0 0 0\n 0 0 1 0 0\n 0 0 0 ".concat(null!==(g=h.opacity)&&void 0!==g?g:.4," 0\n ")).attr("result","blurred");var w=b.append("feMerge");w.append("feMergeNode").attr("in","blurred"),w.append("feMergeNode").attr("in","SourceGraphic")}(c.svg_,c.coastalMarginSettings_);var g=h.append("g").attr("class","em-coastal-margin").attr("filter","url(#em-coastal-margin-filter)").attr("fill","none").style("stroke",c.coastalMarginSettings_.color).style("stroke-width",c.coastalMarginSettings_.strokeWidth).style("opacity",c.coastalMarginSettings_.opacity).attr("pointer-events","none"),m=function drawPaths(h,m,b){h&&g.append("g").attr("class",b).selectAll("path").data(h.filter(m)).enter().append("path").attr("d",c._pathFunction)};m(c.Geometries.geoJSONs.cntbn,function(c){return"T"===c.properties.co},"em-coastal-margin-cnt"),m(c.Geometries.geoJSONs.nutsbn,function(c){return"T"===c.properties.co},"em-coastal-margin-nuts"),m(c.Geometries.geoJSONs.worldbn,function(c){return"T"===c.properties.COAS_FLAG},"em-coastal-margin-world");var b=g.node().parentNode,w="WORLD"===c.geo_?3:1;b.childNodes[w]&&b.insertBefore(g.node(),b.childNodes[w])}};c.insetTemplates_&&Bt(c.insetTemplates_,c.svgId_,h),h(c)}}function texts_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function texts_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return texts_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?texts_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function texts_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}var Bs=function niceScaleBarLength(c){var h=Math.pow(10,Math.floor(Math.log(c)/Math.log(10)));return 5*h<=c?[5*h,5]:2*h<=c?[2*h,2]:[h,1]},Os=function getScalebarLabel(c){return c<.01?1e3*c+"mm":c<1?100*c+"cm":c<1e3?1*c+"m":c/1e3};function map_template_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}defaultLocale({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),function initProj4(){Hi.defs("EPSG:3035","+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs"),Hi.defs("EPSG:54030","+proj=robin +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs")}();var zs=function mapTemplate(c,h,g){var m={};m._mapType=g,m.updateValuesLabels=Rr,m.svgId_="map",m.svg_=void 0,m.width_=Math.min(795,window.innerWidth),m.height_=0,m.containerId_=void 0,m.nutsLevel_=3,m.nutsYear_=2024,m.geo_="EUR",m.proj_="3035",m.projectionFunction_=void 0,m.filterGeometriesFunction_=void 0,m.scale_="20M",m.position_={x:void 0,y:void 0,z:void 0},m.placenames_=!1,m.placenamesFilter_=void 0,m.gridCartogram_=!1,m.gridCartogramShape_="square",m.gridCartogramMargins_={top:80,right:50,bottom:80,left:150},m.gridCartogramCellPadding_=4,m.gridCartogramPositions_=void 0,m.zoomExtent_=void 0,m.translateExtent_=void 0,m.lockPanUntilZoom_=!0,m.onZoomEnd_=void 0,m.onZoom_=void 0,m.onRegionMouseOver_=void 0,m.onRegionMouseMove_=void 0,m.onRegionMouseOut_=void 0,m.onRegionClick_=void 0,m.geometries_=void 0,m.processCentroids_=void 0,m.dorling_=!1,m.animateDorling_=!0,m.dorlingStrength_={x:1,y:1},m.dorlingIterations_=1,m.onDorlingProgress_=void 0,m.dorlingWorker_=!1,m.dorlingWorkerD3URL_=void 0,m.header_=!1,m.footer_=!1,m.footerPadding_=void 0,m.headerPadding_=void 0,m.title_="",m.titlePosition_=void 0,m.subtitle_="",m.subtitlePosition_=void 0,m.showScalebar_=!1,m.scalebarPosition_=[],m.scalebarUnits_=" km",m.scalebarTextOffset_=[0,12],m.scalebarMaxWidth_=150,m.scalebarHeight_=90,m.scalebarStrokeWidth_=1,m.scalebarSegmentHeight_=6,m.scalebarTickHeight_=8,m.stamp_=void 0,m.minimap_=void 0,m.zoomButtons_=!0,m.zoomButtonsPosition_=void 0,m.insetsButton_=!1,m.insetsButtonPosition_=void 0,m.tooltip_={fontSize:"14px",transitionDuration:200,xOffset:0,yOffset:0,textFunction:null,showFlags:!1,omitRegions:[]},m.hoverColor_="red",m.drawCoastalMargin_=!1,m.coastalMarginSettings_={standardDeviation:.8,x:"-50%",y:"-50%",width:"150%",height:"150%",strokeWidth:.6,color:"rgb(0, 0, 0)",opacity:.1},m.drawGraticule_=!1,m.backgroundMap_=!0,m.labels_=void 0,m.annotations_=void 0,m.annotationsAdded=!1,m.patternFill_=void 0,m.showSourceLink_=!0,m.defaultFootnote_="Administrative boundaries: ©EuroGeographics ©OpenStreetMap",m.defaultFootnoteTooltipText_='<div class="em-footnote-tooltip">The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the European Union concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Kosovo*: This designation is without prejudice to positions on status, and is in line with UNSCR 1244/1999 and the ICJ Opinion on the Kosovo declaration of independence.</div>',m.footnote_=m.defaultFootnote_,m.footnoteTooltipText_=m.defaultFootnoteTooltipText_,m.footnoteWrap_=!1,m.footnotePosition_=void 0,m.showEstatLogo_=!1,m.showEstatRibbon_=!1,m.logoPosition_=void 0,m.ribbonPosition_=void 0,m.ribbonWidth_=void 0,m.ribbonHeight_=void 0,m.logoWidth_=void 0,m.logoHeight_=void 0,m.nuts2jsonBaseURL_=window.location.hostname.includes("ec.europa.eu")?"https://ec.europa.eu/assets/estat/E/E4/gisco/pub/nuts2json/v2":"https://raw.githubusercontent.com/eurostat/Nuts2json/master/pub/v2",m.noDataFillStyle_="#bcbcbc",m.insets_=[],m.insetTemplates_={},m.insetBoxPosition_=void 0,m.insetBoxPadding_=5,m.insetBoxWidth_=210,m.insetZoomExtent_=null,m.insetScale_="03M";var b=function _loop(c){m[c.substring(0,c.length-1)]=function(h){return arguments.length?(m[c]=h,m):m[c]}};for(var w in m)b(w);!function defineDeprecatedFunctions(c){c.showZoomButtons=function(h){return console.warn("showZoomButtons() is now DEPRECATED, please use zoomButtons() instead"),c.zoomButtons_=h,c},c.showInsetsButton=function(h){return console.warn("showInsetsButton() is now DEPRECATED, please use insetsButton() instead"),c.insetsButton_=h,c},c.seaFillStyle=function(h){return console.warn("seaFillStyle() is now DEPRECATED, please use the .em-sea CSS class"),updateCSSRule(".em-sea","fill",h),c},c.cntrgFillStyle=function(h){return console.warn("cntrgFillStyle() is now DEPRECATED, please use the .em-cntrg CSS class"),updateCSSRule(".em-cntrg","fill",h),c},c.nutsrgFillStyle=function(h){return console.warn("nutsrgFillStyle() is now DEPRECATED, please use the .em-nutsrg CSS class"),updateCSSRule(".em-nutsrg","fill",h),c},c.nutsbnStroke=function(h){return console.warn("nutsbnStroke() is now DEPRECATED, please use the .bn_0, .bn_1, .bn_2, .bn_3 CSS classes"),h[0]&&updateCSSRule(".bn_0","stroke",h[0]),h[1]&&updateCSSRule(".bn_1","stroke",h[1]),h[2]&&updateCSSRule(".bn_2","stroke",h[2]),h[3]&&updateCSSRule(".bn_3","stroke",h[3]),c},c.nutsbnStrokeWidth=function(h){return console.warn("nutsbnStrokeWidth() is now DEPRECATED, please use the .bn_0, .bn_1, .bn_2, .bn_3 CSS classes"),h[0]&&updateCSSRule(".bn_0","stroke-width",h[0]),h[1]&&updateCSSRule(".bn_1","stroke-width",h[1]),h[2]&&updateCSSRule(".bn_2","stroke-width",h[2]),h[3]&&updateCSSRule(".bn_3","stroke-width",h[3]),c},c.graticuleStroke=function(h){return console.warn("graticuleStroke() is now DEPRECATED, please use the .em-graticule CSS class"),updateCSSRule(".em-graticule","stroke",h),c},c.graticuleStrokeWidth=function(h){return console.warn("graticuleStrokeWidth() is now DEPRECATED, please use the .em-graticule CSS class"),updateCSSRule(".em-graticule","stroke-width",h),c},c.nutsrgSelFillSty=function(h){return console.warn("nutsrgSelFillSty() is now DEPRECATED, please use hoverColor() instead"),c.hoverColor_=h,c},c.titleFontSize=function(h){return console.warn("map.titleFontSize() is now DEPRECATED. please use the .em-title CSS class"),updateCSSRule(".em-title","font-size",h),c},c.subtitleFontSize=function(h){return console.warn("map.subtitleFontSize() is now DEPRECATED. please use the .em-subtitle CSS class"),updateCSSRule(".em-subtitle","font-size",h),c},c.subtitleFontWeight=function(h){return console.warn("map.subtitleFontWeight() is now DEPRECATED. please use the .em-subtitle CSS class"),updateCSSRule(".em-subtitle","font-weight",h),c},c.titleFill=function(h){return console.warn("map.titleFill() is now DEPRECATED. please use the .em-title CSS class"),updateCSSRule(".em-title","fill",h),c},c.subtitleFill=function(h){return console.warn("map.subtitleFill() is now DEPRECATED. please use the .em-subtitle CSS class"),updateCSSRule(".em-subtitle","fill",h),c},c.cntbnStroke=function(h){return console.warn("cntbnStroke() is now DEPRECATED, please use the .em-cntbn .em-bn-eu .em-bn-efta .em-bn-cc .em-bn-oth CSS classes"),h.eu&&updateCSSRule(".em-bn-eu","stroke",h.eu),h.efta&&updateCSSRule(".em-bn-efta","stroke",h.efta),h.cc&&updateCSSRule(".em-bn-cc","stroke",h.cc),h.oth&&updateCSSRule(".em-bn-oth","stroke",h.oth),h.co&&updateCSSRule(".em-bn-co","stroke",h.co),c},c.cntbnStrokeWidth=function(h){return console.warn("cntbnStrokeWidth() is now DEPRECATED, please use the .em-cntbn .em-worldbn .em-bn-eu .em-bn-efta .em-bn-cc .em-bn-oth CSS classes"),h.eu&&updateCSSRule(".em-bn-eu","stroke-width",h.eu),h.efta&&updateCSSRule(".em-bn-efta","stroke-width",h.efta),h.cc&&updateCSSRule(".em-bn-cc","stroke-width",h.cc),h.oth&&updateCSSRule(".em-bn-oth","stroke-width",h.oth),h.co&&updateCSSRule(".em-bn-co","stroke-width",h.co),c},c.worldStroke=function(h){return console.warn("map.worldStroke() is now DEPRECATED. please use the .em-worldbn .em-bn-co .em-bn-d CSS classes"),updateCSSRule(".em-worldbn","stroke",h),c},c.worldStrokeWidth=function(h){return console.warn("map.worldStrokeWidth() is now DEPRECATED. please use the .em-worldbn .em-bn-co .em-bn-d CSS classes"),updateCSSRule(".em-worldbn","stroke-width",h),c},c.worldCoastStroke=function(h){return console.warn("map.worldCoastStroke() is now DEPRECATED. please use the .em-bn-co CSS class"),updateCSSRule(".em-bn-co","stroke",h),c},c.worldCoastStrokeWidth=function(h){return console.warn("map.worldCoastStrokeWidth() is now DEPRECATED. please use the .em-bn-co CSS class"),updateCSSRule(".em-bn-co","stroke-width",h),c},c.worldFillStyle=function(h){return console.warn("map.worldFillStyle() is now DEPRECATED. please use the .em-worldrg CSS class"),updateCSSRule(".em-worldrg","fill",h),c},c.coastalMarginWidth=function(h){return console.warn("map.coastalMarginWidth() is now DEPRECATED. please use the #em-coast-margin CSS rule"),updateCSSRule("#em-coast-margin","stroke-width",h),c},c.coastalMarginColor=function(h){return console.warn("map.coastalMarginColor() is now DEPRECATED. please use the #em-coast-margin CSS rule"),updateCSSRule("#em-coast-margin","stroke",h),c},c.coastalMarginStdDev=function(h){return console.warn("map.coastalMarginStdDev() is now DEPRECATED. please use map.coastalMarginSettings.standardDeviation instead."),c.coastalMarginSettings.standardDeviation=h,c},c.fontFamily=function(h){return console.warn("map.fontFamily() is now DEPRECATED. please use the .em-map CSS class"),updateCSSRule(".em-map","font-family",h),c},c.botTxtFontSize=function(h){return console.warn("map.botTxtFontSize() is now DEPRECATED. please use the .em-footnote CSS class"),updateCSSRule(".em-footnote","font-size",h),c},c.botTxtFill=function(h){return console.warn("map.botTxtFill() is now DEPRECATED. please use the .em-footnote CSS class"),updateCSSRule(".em-footnote","fill",h),c},c.scalebarFontSize=function(h){return console.warn("map.scalebarFontSize() is now DEPRECATED. please use the .em-scalebar-label CSS class"),updateCSSRule(".em-scalebar-label","font-size",h),c},c.frameStroke=function(h){return console.warn("map.frameStroke() is now DEPRECATED. please use the .em-frame CSS class"),updateCSSRule(".em-frame","stroke",h),c},c.frameStrokeWidth=function(h){return console.warn("map.frameStrokeWidth() is now DEPRECATED. please use the .em-frame CSS class"),updateCSSRule(".em-frame","stroke-width",h),c},c.psClassifMethod=function(h){return console.warn("psClassifMethod() is now DEPRECATED. please use psClassificationMethod instead"),c.psClassificationMethod_=h,c},c.geoCenter=function(h){return console.warn("map.geoCenter() is now DEPRECATED. Please use map.position({x,y,z}) instead."),c.position_.x=h[0],c.position_.y=h[1],c},c.pixelSize=function(h){return console.warn("map.pixelSize() is now DEPRECATED. Please use the z property in map.position({x,y,z}) instead."),c.position_.z=h,c},c.pixSize=function(h){return console.warn("map.pixelSize() is now DEPRECATED. Please use the z property in map.position({x,y,z}) instead."),c.position_.z=h,c},c.tooltipText=function(h){return console.warn("map.tooltipText() is now DEPRECATED. Please use map.tooltip(config.textFunction) instead. See API reference for details."),c.tooltip_.textFunction=h,c},c.classifMethod=function(h){return console.warn("map.classifMethod() is now DEPRECATED. please use map.classificationMethod() instead."),c.classificationMethod_=h,c},c.threshold=function(h){return console.warn("map.threshold() is now DEPRECATED. please use map.thresholds() instead."),c.thresholds_=h,c},c.psThreshold=function(h){return console.warn("map.psThreshold() is now DEPRECATED. please use map.psThresholds() instead."),c.psThresholds_=h,c},c.clnb=function(h){return console.warn("map.clnb() is now DEPRECATED. please use map.numberOfClasses() instead."),c.numberOfClasses_=h,c},c.nutsLvl=function(h){return console.warn("map.nutsLvl() is now DEPRECATED. please use map.nutsLevel() instead."),c.nutsLevel_=h,c},c.lg=function(h){return console.warn("map.lg() is now DEPRECATED. please use map.language() instead."),c.language_=h,c},c.bottomText=function(h){return console.warn("bottomText is now DEPRECATED. Please use the footnote() method and em-footnote CSS class instead."),c.footnote_=h,c},c.botTxtFontSize=function(h){return console.warn("botTxtFontSize is now DEPRECATED. Please use the em-footnote CSS class instead."),c},c.botTxtFill=function(h){return console.warn("botTxtFill is now DEPRECATED. Please use the em-footnote CSS class instead."),c},c.botTxtPadding=function(h){return console.warn("botTxtPadding is now DEPRECATED. Please use the em-footnote CSS class instead."),c},c.botTxtTooltipTxt=function(h){return console.warn("botTxtTooltipTxt is now DEPRECATED. Please use footnoteTooltipText() instead."),c},c.tooltipShowFlags=function(h){return console.warn("tooltipShowFlags is now DEPRECATED. Please use out.tooltip({showFlags}) instead."),c.tooltip_.showFlags=h,c},c.colorFun=function(h){return console.warn("colorFun is now DEPRECATED. Please use out.colorFunction() instead."),c.colorFunction_=h,c},c.filtersDefinitionFun=function(h){return console.warn("filtersDefinitionFun is now DEPRECATED. Please use out.filtersDefinitionFunction() instead."),c.filtersDefinitionFunction_=h,c},c.labelling=function(h){return console.warn("labelling is now DEPRECATED. Please use out.labels({}) configuration object instead. See documentation for details."),c},c.labelsConfig=function(h){return console.warn("labelsConfig is now DEPRECATED. Please use out.labels({config:yourConfig}) configuration object instead. See documentation for details."),c.labels_=Object.assign(c.labels_||{},{config:h}),c},c.statLabelsPositions=function(h){return console.warn("statLabelsPositions is now DEPRECATED. Please use out.labels({statLabelsPositions:yourPositions}) instead. See documentation for details."),c.labels_=Object.assign(c.labels_||{},{statLabelsPositions:h}),c},c.labelsToShow=function(h){return console.warn("labelsToShow is now DEPRECATED. Please use out.labels({labelFilterFunction:yourFunction(region,map)}) function instead. See documentation for details."),c},c.labelShadowsToShow=function(h){return console.warn("labelShadowsToShow is now DEPRECATED. Please use out.labels({labelFilterFunction:yourFunction(region,map)}) function instead. See documentation for details."),c},c.labelShadow=function(h){return console.warn("labelShadow is now DEPRECATED. Please use out.labels({labelShadow:boolean}) instead. See documentation for details."),c},c.labelShadowWidth=function(h){return console.warn("labelShadow is now DEPRECATED. Please use out.labels({labelShadow:boolean}) instead. See documentation for details."),c},c.labelFilterFunction=function(h){return console.warn("labelFilterFunction is now DEPRECATED. Please use out.labels({labelFilterFunction:yourFunction(region,map)}) instead. See documentation for details."),c},c.labelFill=function(h){return console.warn("map.labelFill() is now DEPRECATED. please use the .em-stat-labels CSS class"),c},c.labelStroke=function(h){return console.warn("map.labelStroke() is now DEPRECATED. please use the .em-stat-labels CSS class"),c},c.labelStrokeWidth=function(h){return console.warn("map.labelStrokeWidth() is now DEPRECATED. please use the .em-stat-labels CSS class"),c},c.labelOpacity=function(h){return console.warn("map.labelOpacity() is now DEPRECATED. please use the .em-stat-labels CSS class"),c},c.labelValuesFontSize=function(h){return console.warn("map.labelValuesFontSize() is now DEPRECATED. please use the .em-stat-labels CSS class"),c},c.labelShadowWidth=function(h){return console.warn("map.labelShadowWidth() is now DEPRECATED. please use the .em-stat-labels-shadows CSS class"),c},c.labelShadowColor=function(h){return console.warn("map.labelShadowColor() is now DEPRECATED. please use the .em-stat-labels-shadows CSS class"),c},c.countriesToShow=function(h){return console.warn("map.countriesToShow() is now DEPRECATED. please use the map.filterGeometriesFunction() function if you wish to filter the default geometries."),c},c.bordersToShow=function(h){return console.warn("map.bordersToShow() is now DEPRECATED. please use the map.filterGeometriesFunction() function if you wish to filter the default geometries."),c},c.flowDonutSizeScale=function(h){return console.warn("map.flowDonutSizeScale() is now DEPRECATED. please use flowNodeSizeScale_() instead."),c.flowDonutSizeScale_=h,c},c.flowDonuts=function(h){return console.warn('map.flowDonuts() is now DEPRECATED. please use flowNodes(true).flowNodeType("donut") instead.'),c.flowNodeType_=h?"donut":"circle",c},c.flowMapType=function(h){return console.warn("map.flowMapType() is now DEPRECATED. please use flowLineType() instead."),c.flowLineType_=h,c},c.flowGradient=function(h){return console.warn("map.flowGradient() is now DEPRECATED. please use flowColorGradient() or flowWidthGradient() instead."),c.flowColorGradient_=h,c},c.flowOverlayColors=function(h){return console.warn("map.flowOverlayColors() is now DEPRECATED. please use flowRegionColors() instead."),c.flowRegionColors_=h,c},c.getFillPatternDefinitionFun=function(h){return console.warn("getFillPatternDefinitionFun is now DEPRECATED. please use fillPatternDefinitionFunction() instead."),c.fillPatternDefinitionFunction_=h,c}}(m),m.geo=function(c){return arguments.length?(m.geo_=c.toUpperCase(),m):m.geo_},["tooltip_","nuts2jsonBaseURL_","processCentroids_","coastalMarginSettings_"].forEach(function(c){m[c.substring(0,c.length-1)]=function(h){if(!arguments.length)return m[c];if("object"!==_typeof(h)||null===h||Array.isArray(h))m[c]=h;else for(var g in h)m[c][g]=h[g];return m.insetTemplates_&&Bt(m.insetTemplates_,m.svgId_,function(h,g){h[c.substring(0,c.length-1)](g)},h),m}}),m.title=function(c){return arguments.length?(m.title_=c,m.svg()&&m.svg().select("#title"+m.geo()).text(c),m):m.title_},m.subtitle=function(c){return arguments.length?(m.subtitle_=c,m.svg()&&m.svg().select("#subtitle"+m.geo()).text(c),m):m.subtitle_},m.insets=function(){return arguments.length?(1==arguments.length&&"default"===arguments[0]?m.insets_="default":1==arguments.length&&!1===arguments[0]?m.insets_=!1:1==arguments.length&&Array.isArray(arguments[0])?m.insets_=arguments[0]:m.insets_=arguments,m):m.insets_},m.drawGraticule=function(c){if(!arguments.length)return m.drawGraticule_;m.drawGraticule_=c;var h=m.svg_?m.svg().select("#em-graticule"):null,g=m.svg_?m.svg_.select("#em-zoom-group-"+m.svgId_):null;return h&&(h._groups[0][0]&&0==c?h.remove():m.Geometries.geoJSONs.graticule&&m._pathFunction&&g&&1==c&&(h.remove(),g.append("g").attr("id","em-graticule").selectAll("path").data(m.Geometries.geoJSONs.graticule).enter().append("path").attr("d",m._pathFunction).attr("class","em-graticule"),m.svg().select("#em-graticule").each(function(){"WORLD"==m.geo_?this.parentNode.insertBefore(this,this.parentNode.childNodes[3]):this.parentNode.insertBefore(this,this.parentNode.childNodes[1])}))),m},m.drawCoastalMargin=function(c){return arguments.length?(m.drawCoastalMargin_=c,appendCoastalMargin(m),m):m.drawCoastalMargin_},m.annotations=function(c){return arguments.length?(m.annotations_=c,appendAnnotations(m),m):m.annotations_},m.stamp=function(c){return arguments.length?(m.stamp_=c,to(m.stamp_,m),m):m.stamp_},m.minimap=function(c){return arguments.length?(m.minimap_=c,Ui(m),m):m.minimap_},m.labels=function(c){var h;return arguments.length?(m.labels_=c,m.labels_&&void 0===(null===(h=m.labels_)||void 0===h?void 0:h.scaleOnZoom)&&(m.labels_.scaleOnZoom=!0),function updateLabels(c){if(c.svg_){var h=c.svg_.selectAll("#em-labels > *");if(h&&h.remove(),c.labels_){var g=c.labels_,m=c.svg_.select("#em-zoom-group-"+c.svgId_);Nr(c,m),g.values&&c.updateValuesLabels&&c.updateValuesLabels(c),c.insetTemplates_&&Bt(c.insetTemplates_,c.svgId_,function applyLabelsCallback(c){if(g){var h=c.svg_.select("#em-zoom-group-"+c.svgId_);c.labels_&&Nr(c,h),g.values&&c.updateValuesLabels&&c.updateValuesLabels(c)}})}}}(m),m):m.labels_},m.position=function(c){return arguments.length?(m.position_=c,function setMapView(c,h){if(c.svg_&&c.__zoomBehavior){var g=c.svg_,m=g.select("#em-zoom-group-"+c.svgId_),b=c.__baseZ/h.z,w=slicedToArray_slicedToArray(c._projection([h.x,h.y]),2),S=w[0],M=w[1],k=c.width_/2-S*b,T=c.height_/2-M*b,E=As.translate(k,T).scale(b);c.__programmaticZoom={x:h.x,y:h.y,z:h.z},c.__lastTransform=E,g.call(c.__zoomBehavior.transform,E),m.attr("data-zoom",b),c.position_.x=h.x,c.position_.y=h.y,c.position_.z=h.z}}(m,c),m):m.position_},m.Geometries=Kr(m,h),m.updateGeoMapTemplate=function(c){return c||console.warn("⚠️ map.updateGeoMapTemplate called without callback function!"),m.Geometries.defaultGeoData=null,m.Geometries.allNUTSGeoData=null,m.Geometries.centroidsData=null,m.geometries_?(m.Geometries.setUserGeometries(m.geometries_),m.buildMapTemplate(),c&&c()):m.Geometries.getDefaultGeoData(m.geo_,m.filterGeometriesFunction_,m.nutsLevel_).then(function(){m.buildMapTemplate(),c&&c()}),Bt(m.insetTemplates_,m.svgId_,function(h){h.updateGeoMapTemplate(c)}),m};m.buildMapTemplateBase=function(){var c=function createMapSVG(c){var h=src_select("#"+c.svgId());return 0==h.size()&&(h=src_select("body").append("svg").attr("id",c.svgId())),h.attr("class","em-map"),h.classed("em--"+c._mapType,!0),"pie"!==c._mapType&&"coxcomb"!==c._mapType||h.classed("em--ps",!0),h}(m);m.svg_=c,m.isInset||(m._wrapper_=function wrapMapSvg(c){var h,g=c.node();if(g){var m=g.parentNode;if(m&&!(m instanceof SVGElement)){if(null!==(h=m.classList)&&void 0!==h&&h.contains("em-map-wrapper"))return m;var b=document.createElement("div");return b.className="em-map-wrapper",m.insertBefore(b,g),b.appendChild(g),b}}}(c)),m.containerId_||(m.containerId_=m.svgId_),m.tooltip_.containerId||(m.tooltip_.containerId=m.containerId_),src_selectAll("#"+m.svgId()+" > *").remove(),"WORLD"==m.geo_.toUpperCase()&&(m.height()||m.height(.55*m.width()),c.attr("width",m.width()).attr("height",m.height()),m.proj_=54030),m.height()||m.height(.85*m.width()),c.attr("width",m.width()).attr("height",m.height()),c.append("defs").attr("class","em-defs").append("clipPath").attr("id",m.svgId_+"-clip-path").append("rect").attr("x",0).attr("y",0).attr("width",m.width_).attr("height",m.height_),m.drawCoastalMargin_&&c.append("filter").attr("id","em-coastal-blur").attr("x",m.coastalMarginSettings_.x).attr("y",m.coastalMarginSettings_.y).attr("width",m.coastalMarginSettings_.width).attr("height",m.coastalMarginSettings_.height).append("feGaussianBlur").attr("in","SourceGraphic").attr("stdDeviation",m.coastalMarginSettings_.standardDeviation),c.append("g").attr("id","em-header-"+m.svgId_).attr("class","em-header");var g=c.append("g").attr("id","em-drawing-"+m.svgId_).attr("class","em-drawing-group").attr("clip-path","url(#".concat(m.svgId_,"-clip-path)"));(m.zoomExtent_||m.zoomButtons_)&&g.classed("em-draggable",!0);g.append("g").attr("id","em-zoom-group-"+m.svgId_).attr("class","em-zoom-group");return c.append("g").attr("id","em-footer-"+m.svgId_).attr("class","em-footer"),function removeInsets(c){if(c.insetTemplates_){for(var h in c.insetTemplates_){var g=src_select("#"+c.insetTemplates_[h].svgId_);g&&g.html("")}c.insetTemplates_={}}}(m),function buildInsets(c,h,g){if(!c.insets_||0===c.insets_.length)return c;c.insetBoxPosition_||(c.insetBoxPosition_=[c.width_-c.insetBoxWidth_-2*c.insetBoxPadding_,2*c.insetBoxPadding_]);var m=src_select("#"+c.svgId_).select("#em-drawing-"+c.svgId_).append("g").attr("id","em-insets-group").attr("class","em-insets").attr("transform","translate("+c.insetBoxPosition_[0]+","+c.insetBoxPosition_[1]+")");"default"===c.insets_&&(c.insets_=Jr(c.insetBoxWidth_,c.insetBoxPadding_));for(var b=0;b<c.insets_.length;b++){var w=c.insets_[b];if(w.svgId=w.svgId||"inset"+w.geo+Math.random().toString(36).substring(7),0==src_select("#"+w.svgId).size()){var S=null==w.x?c.insetBoxPadding_:w.x,M=null==w.y?c.insetBoxPadding_+b*(c.insetBoxPadding_+c.insetBoxWidth_):w.y;m.append("g").attr("id","em-inset-"+w.svgId).attr("class","em-inset").attr("transform","translate("+S+","+M+")").append("svg").attr("id",w.svgId)}if(c.insetTemplates_[w.geo]){var k=Zr(w,c,h,g);k.buildMapTemplateBase(),c.insetTemplates_[w.geo]=[c.insetTemplates_[w.geo],k]}else{var T=Zr(w,c,h,g).buildMapTemplateBase();c.insetTemplates_[w.geo]=T}}}(m,h,m._mapType),g.append("rect").attr("id","em-frame-"+m.geo_).attr("class","em-frame").attr("x",0).attr("y",0).attr("width",m.width_).attr("height",m.height_),m.stamp_&&to(m.stamp_,m),m},m.buildMapTemplate=function(){var c=m.svg().select("#em-zoom-group-"+m.svgId_);return c.selectAll("*").remove(),1==m.gridCartogram_?(!function buildGridCartogramBase(c){var h=src_select("#em-zoom-group-".concat(c.svgId_)).append("g").attr("id","em-grid-container");c.gridCartogramMargins_=c.gridCartogramMargins_||{top:80,right:80,bottom:80,left:80};var g=uo(c),m=ho(g),b=po(m,c);"hexagon"===c.gridCartogramShape_?go(h,b,c):fo(h,b,c),yo(h,c.width_,c.height_,c.gridCartogramMargins_)}(m),m.footnote_==m.defaultFootnote_&&(m.footnote_=!1),m.footnoteTooltipText_==m.defaultFootnoteTooltipText_&&(m.footnoteTooltipText_=!1)):(m.position_.x&&m.position_.y||T(),m.position_.z=m.position_.z||E(),I(),P(),m.backgroundMap_&&k(m)),(m.zoomExtent_||m.zoomButtons_)&&(m.zoomExtent_||(m.zoomExtent_=[1,10]),bs(m)),h&&!m.gridCartogram_&&S(m),m.labels_&&!m.gridCartogram_&&Nr(m,c),m.annotations_&&(appendAnnotations(m),m.annotationsAdded=!0),m.placenames_&&!m.gridCartogram_&&function addPlacenameLabels(c){return _addPlacenameLabels.apply(this,arguments)}(m),m.title()&&function addTitle(c){var h=c.isInset?"em-inset-title":"em-title";c.titlePosition()||c.titlePosition([10,Pt(h)+(c.isInset?0:10)]),c.header_&&!c.isInset&&c.svg().select("#em-header-"+c.svgId_).empty()&&c.svg().append("g").attr("id","em-header-"+c.svgId_).attr("class","em-header");var g=c.header_&&!c.isInset?c.svg().select("#em-header-"+c.svgId_):c.svg();g.select("#title"+c.geo_).remove(),g.append("text").attr("id","title"+c.geo_).attr("class",h).attr("x",c.titlePosition()[0]).attr("y",c.titlePosition()[1]).html(c.title())}(m),m.subtitle()&&function addSubtitle(c){if(c.subtitle()){var h=c.isInset?"em-inset-subtitle":"em-subtitle",g=c.isInset?"em-inset-title":"em-title";c.subtitlePosition()||c.subtitlePosition([10,Pt(g)+Pt(h)+15]),c.header_&&!c.isInset&&c.svg().select("#em-header-"+c.svgId_).empty()&&c.svg().append("g").attr("id","em-header-"+c.svgId_).attr("class","em-header");var m=c.header_&&!c.isInset?c.svg().select("#em-header-"+c.svgId_):c.svg();m.select("#subtitle"+c.geo_).remove(),m.append("text").attr("id","subtitle"+c.geo_).attr("class",h).attr("x",c.subtitlePosition()[0]).attr("y",c.subtitlePosition()[1]).html(c.subtitle())}}(m),m.footnote_&&function addFootnote(c){var h,g=c.footnoteWrap_||1/0,m=c.footnote_||"";h=c.footer_&&!c.isInset?c.footnotePosition_?[c.footnotePosition_[0],c.footnotePosition_[1]]:[5,10]:c.footnotePosition_?c.footnotePosition_:[10,c.height_];var b,w=c.svg();c.footer_&&!c.isInset?(b=w.select("#em-footer-"+c.svgId_)).empty()&&(b=w.append("g").attr("id","em-footer-"+c.svgId_).attr("class","em-footer")):b=w,b.select("#em-footnote").remove();var S,M=b.append("text").attr("id","em-footnote").attr("class","em-footnote").attr("x",h[0]).attr("y",h[1]),k="",T=0,E=texts_createForOfIteratorHelper(m.split(/(\s+)/));try{for(E.s();!(S=E.n()).done;){var I=S.value;(k+I).length>g&&k.length>0?(M.append("tspan").attr("x",h[0]).attr("dy",0===T?0:"1.2em").html(k.trim()),k=I,T++):k+=I}}catch(c){E.e(c)}finally{E.f()}k.trim().length>0&&M.append("tspan").attr("x",h[0]).attr("dy",0===T?0:"1.2em").html(k.trim()),M.on("mouseover",function(){c._tooltip.mw___=c._tooltip.style("max-width"),c._tooltip.style("max-width","400px"),c.footnoteTooltipText_&&c._tooltip.mouseover(c.footnoteTooltipText_)}).on("mousemove",function(h){c.footnoteTooltipText_&&c._tooltip.mousemove(h)}).on("mouseout",function(){c.footnoteTooltipText_&&c._tooltip.mouseout(),c._tooltip.style("max-width",c._tooltip.mw___)})}(m),m.showEstatLogo_&&function addEurostatLogo(c){var h=c.svg(),g=h.select("#em-logo-group");g.empty()&&(g=h.append("g").attr("id","em-logo-group").attr("class","em-logo-group"));var m=c.logoWidth_||200,b=c.logoHeight_||40,w=c.logoPosition_?c.logoPosition_[0]:c.width_-m-10,S=c.logoPosition_?c.logoPosition_[1]:c.height_-b-10;g.selectAll(".em-eurostat-logo").remove(),g.append("image").attr("href","data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20%20%20%20%20viewBox%3D%22317.6%20263.7%20206.4%2067.9%22%20%20%20%20%20preserveAspectRatio%3D%22xMinYMid%20meet%22%20%20%20%20%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20%20%20%20%20xml%3Aspace%3D%22preserve%22%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E.st0%7Bfill%3Anone%3B%7D.st1%7Bfill%3A%23164194%3B%7D.st2%7Bfill%3A%23FFED00%3B%7D.st3%7Bfill%3A%237C7C7B%3B%7D%3C%2Fstyle%3E%3Crect%20x%3D%22317.6%22%20y%3D%22263.7%22%20class%3D%22st0%22%20width%3D%22206.4%22%20height%3D%2267.9%22%2F%3E%3Cg%3E%3Cg%3E%3Cg%20id%3D%22EUflag_16_%22%3E%3Cpolygon%20class%3D%22st1%22%20points%3D%22501.4%2C309%20501.4%2C286.3%20467.4%2C286.3%20467.4%2C309%20501.4%2C309%20%22%2F%3E%3C%2Fg%3E%3Cg%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22485%2C289.8%20486.1%2C289.8%20485.2%2C290.5%20485.6%2C291.6%20484.6%2C290.9%20483.7%2C291.6%20484.1%2C290.5%20483.2%2C289.8%20484.3%2C289.8%20484.6%2C288.7%20485%2C289.8%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22485%2C304.9%20486.2%2C304.9%20485.2%2C305.6%20485.6%2C306.7%20484.7%2C306%20483.8%2C306.7%20484.1%2C305.6%20483.2%2C304.9%20484.3%2C304.9%20484.7%2C303.8%20485%2C304.9%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22488.8%2C303.9%20489.9%2C303.9%20489%2C304.6%20489.3%2C305.7%20488.4%2C305%20487.5%2C305.7%20487.9%2C304.6%20486.9%2C303.9%20488.1%2C303.9%20488.4%2C302.8%20488.8%2C303.9%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22488.8%2C290.8%20489.9%2C290.8%20489%2C291.5%20489.3%2C292.6%20488.4%2C291.9%20487.5%2C292.6%20487.9%2C291.5%20486.9%2C290.8%20488.1%2C290.8%20488.4%2C289.7%20488.8%2C290.8%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22491.5%2C293.6%20492.7%2C293.6%20491.8%2C294.3%20492.1%2C295.4%20491.2%2C294.7%20490.3%2C295.4%20490.6%2C294.3%20489.7%2C293.6%20490.9%2C293.6%20491.2%2C292.5%20491.5%2C293.6%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22491.5%2C301.2%20492.7%2C301.2%20491.8%2C301.9%20492.1%2C302.9%20491.2%2C302.3%20490.3%2C302.9%20490.6%2C301.9%20489.7%2C301.2%20490.9%2C301.2%20491.2%2C300.1%20491.5%2C301.2%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22492.6%2C297.3%20493.7%2C297.3%20492.8%2C298%20493.1%2C299.1%20492.2%2C298.4%20491.3%2C299.1%20491.7%2C298%20490.8%2C297.3%20491.9%2C297.3%20492.2%2C296.3%20492.6%2C297.3%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22481.2%2C290.8%20482.3%2C290.8%20481.4%2C291.5%20481.7%2C292.6%20480.8%2C291.9%20479.9%2C292.6%20480.3%2C291.5%20479.4%2C290.8%20480.5%2C290.8%20480.8%2C289.7%20481.2%2C290.8%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22478.5%2C293.6%20479.6%2C293.6%20478.7%2C294.3%20479%2C295.4%20478.1%2C294.7%20477.2%2C295.4%20477.6%2C294.3%20476.7%2C293.6%20477.8%2C293.6%20478.1%2C292.5%20478.5%2C293.6%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22477.5%2C297.3%20478.6%2C297.3%20477.7%2C298%20478%2C299.1%20477.1%2C298.4%20476.2%2C299.1%20476.6%2C298%20475.7%2C297.3%20476.8%2C297.3%20477.1%2C296.3%20477.5%2C297.3%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22478.5%2C301.2%20479.6%2C301.2%20478.7%2C301.9%20479%2C303%20478.1%2C302.3%20477.2%2C303%20477.6%2C301.9%20476.7%2C301.2%20477.8%2C301.2%20478.1%2C300.1%20478.5%2C301.2%20%22%2F%3E%3Cpolygon%20class%3D%22st2%22%20points%3D%22481.2%2C303.9%20482.3%2C303.9%20481.4%2C304.6%20481.8%2C305.7%20480.9%2C305%20480%2C305.7%20480.3%2C304.6%20479.4%2C303.9%20480.5%2C303.9%20480.9%2C302.9%20481.2%2C303.9%20%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%3E%3Cpath%20class%3D%22st3%22%20d%3D%22M337.3%2C304.5c0.7%2C0.7%2C1.8%2C1.1%2C3.1%2C1.1c1%2C0%2C1.8-0.2%2C2.5-0.7s1.1-1%2C1.3-1.5h4.2c-0.7%2C2.1-1.7%2C3.6-3.1%2C4.5c-1.4%2C0.9-3.1%2C1.4-5.1%2C1.4c-1.4%2C0-2.6-0.2-3.7-0.7c-1.1-0.4-2-1.1-2.8-1.9s-1.4-1.8-1.8-2.9c-0.4-1.1-0.6-2.4-0.6-3.7c0-1.3%2C0.2-2.5%2C0.6-3.7c0.4-1.1%2C1-2.1%2C1.8-2.9c0.8-0.8%2C1.7-1.5%2C2.8-1.9c1.1-0.5%2C2.3-0.7%2C3.6-0.7c1.5%2C0%2C2.8%2C0.3%2C3.9%2C0.9s2%2C1.4%2C2.7%2C2.3c0.7%2C1%2C1.2%2C2.1%2C1.5%2C3.3c0.3%2C1.2%2C0.4%2C2.5%2C0.3%2C3.9h-12.6C336.2%2C302.7%2C336.6%2C303.8%2C337.3%2C304.5z%20M342.8%2C295.3c-0.6-0.6-1.5-0.9-2.6-0.9c-0.8%2C0-1.4%2C0.1-1.9%2C0.4c-0.5%2C0.3-0.9%2C0.6-1.2%2C1c-0.3%2C0.4-0.5%2C0.8-0.6%2C1.2c-0.1%2C0.4-0.2%2C0.8-0.2%2C1.2h7.8C343.7%2C296.9%2C343.3%2C296%2C342.8%2C295.3z%20M462.6%2C291v3.9h-3.1v8.2c0%2C0.8%2C0%2C1.4%2C0.3%2C1.6c0.3%2C0.3%2C0.8%2C0.4%2C1.6%2C0.4c0.3%2C0%2C0.4%2C0%2C0.7%2C0c0.2%2C0%2C0.6-0.1%2C0.6-0.1v3.7c0%2C0.1-0.8%2C0.1-1.3%2C0.1c-0.5%2C0-0.9%2C0-1.4%2C0c-0.7%2C0-1.4%2C0-2.1-0.2c-0.7-0.1-1.2-0.3-1.7-0.6c-0.5-0.3-0.8-0.7-1.1-1.2c-0.3-0.5-0.3-1.2-0.3-2.1V295h-3.1V291h3.1v-4.7h4.7v4.7H462.6z%20M443.9%2C300.7c-0.3%2C0.1-0.6%2C0.2-0.9%2C0.2c-0.3%2C0.1-0.7%2C0.1-1.1%2C0.2c-0.4%2C0.1-0.8%2C0.1-1.1%2C0.2c-0.4%2C0.1-0.7%2C0.1-1%2C0.3c-0.4%2C0.1-0.7%2C0.3-0.9%2C0.5c-0.3%2C0.2-0.5%2C0.4-0.6%2C0.7c-0.2%2C0.3-0.2%2C0.7-0.2%2C1.1c0%2C0.4%2C0.1%2C0.8%2C0.2%2C1.1c0.2%2C0.3%2C0.4%2C0.5%2C0.6%2C0.7c0.3%2C0.2%2C0.6%2C0.3%2C0.9%2C0.4c0.4%2C0.1%2C0.7%2C0.1%2C1.1%2C0.1c0.9%2C0%2C1.7-0.1%2C2.2-0.5c0.5-0.3%2C0.9-0.7%2C1.1-1.1c0.2-0.4%2C0.3-0.9%2C0.4-1.3c0.1-0.5%2C0-0.8%2C0-1.1v-1.8C444.6%2C300.4%2C444.2%2C300.6%2C443.9%2C300.7%20M434.6%2C293.8c0.5-0.7%2C1.1-1.3%2C1.9-1.7c0.8-0.5%2C1.6-0.7%2C2.6-0.9c0.9-0.2%2C1.9-0.3%2C2.9-0.3c0.9%2C0%2C1.8%2C0.1%2C2.7%2C0.2c0.9%2C0.1%2C1.7%2C0.4%2C2.5%2C0.7c0.7%2C0.4%2C1.2%2C0.9%2C1.7%2C1.5c0.5%2C0.6%2C0.6%2C1.5%2C0.6%2C2.5v9.1c0%2C0.8%2C0.2%2C1.5%2C0.3%2C2.2c0.1%2C0.7%2C0.3%2C1.3%2C0.5%2C1.6l-4.8%2C0c-0.1-0.3-0.1-0.5-0.2-0.8c-0.1-0.3-0.1-0.6-0.1-0.9c-0.8%2C0.8-1.7%2C1.3-2.7%2C1.6c-1%2C0.3-2.1%2C0.5-3.2%2C0.5c-0.8%2C0-1.6-0.1-2.3-0.3c-0.7-0.2-1.3-0.5-1.9-0.9c-0.5-0.4-1-1-1.3-1.6c-0.3-0.7-0.4-1.4-0.4-2.3c0-1%2C0.2-1.8%2C0.5-2.4c0.3-0.6%2C0.8-1.2%2C1.3-1.5c0.5-0.4%2C1.2-0.7%2C1.9-0.9c0.7-0.2%2C1.4-0.3%2C2.1-0.5c0.7-0.1%2C1.4-0.2%2C2.1-0.3c0.7-0.1%2C1.3-0.2%2C1.9-0.3c0.5-0.1%2C1-0.3%2C1.3-0.6c0.3-0.3%2C0.5-0.6%2C0.4-1.1c0-0.5-0.1-0.9-0.3-1.2c-0.2-0.3-0.4-0.5-0.7-0.7c-0.3-0.2-0.6-0.3-1-0.3c-0.4-0.1-0.8-0.1-1.2-0.1c-0.9%2C0-1.7%2C0.1-2.2%2C0.5c-0.5%2C0.4-0.8%2C1.1-0.9%2C1.9h-4.8C433.9%2C295.7%2C434.1%2C294.6%2C434.6%2C293.8%20M431.3%2C291v3.9h-3.9v8.2c0%2C0.8%2C0.3%2C1.4%2C0.5%2C1.6c0.3%2C0.3%2C0.9%2C0.4%2C1.7%2C0.4c0.3%2C0%2C0.6%2C0%2C0.9%2C0c0.3%2C0%2C0.8-0.1%2C0.8-0.1v3.7c-0.8%2C0.1-0.9%2C0.1-1.4%2C0.1c-0.5%2C0-1%2C0-1.5%2C0c-0.7%2C0-1.5%2C0-2.1-0.2c-0.7-0.1-1.3-0.3-1.8-0.6c-0.5-0.3-1-0.7-1.3-1.2c-0.3-0.5-0.5-1.2-0.5-2.1V295h-2.3V291h2.3v-4.7h4.7v4.7H431.3z%20M407.5%2C304.3c0.2%2C0.4%2C0.5%2C0.8%2C0.8%2C1c0.3%2C0.2%2C0.7%2C0.5%2C1.2%2C0.6c0.4%2C0.1%2C0.9%2C0.2%2C1.3%2C0.2c0.3%2C0%2C0.7%2C0%2C1.1-0.1c0.4-0.1%2C0.7-0.2%2C1-0.4c0.3-0.2%2C0.6-0.4%2C0.8-0.7c0.2-0.3%2C0.3-0.6%2C0.3-1.1c0-0.7-0.5-1.3-1.4-1.6c-1-0.4-2.3-0.7-4-1.1c-0.7-0.2-1.4-0.4-2-0.6c-0.7-0.2-1.2-0.5-1.8-0.8c-0.5-0.4-0.9-0.8-1.2-1.3c-0.3-0.5-0.5-1.2-0.5-1.9c0-1.1%2C0.2-2%2C0.7-2.7c0.4-0.7%2C1-1.3%2C1.7-1.7c0.7-0.4%2C1.5-0.7%2C2.4-0.9c0.9-0.2%2C1.8-0.2%2C2.8-0.2c0.9%2C0%2C1.9%2C0.1%2C2.7%2C0.3c0.9%2C0.2%2C1.7%2C0.5%2C2.4%2C0.9c0.7%2C0.4%2C1.3%2C1%2C1.7%2C1.7c0.5%2C0.7%2C0.7%2C1.9%2C0.8%2C2.7h-4.5c-0.1-0.8-0.4-1.6-1-1.9c-0.6-0.3-1.4-0.5-2.2-0.5c-0.3%2C0-0.6%2C0-0.9%2C0c-0.3%2C0-0.6%2C0.1-0.9%2C0.2c-0.3%2C0.1-0.5%2C0.3-0.7%2C0.5c-0.2%2C0.2-0.3%2C0.5-0.3%2C0.9c0%2C0.4%2C0.2%2C0.8%2C0.5%2C1c0.3%2C0.3%2C0.7%2C0.5%2C1.2%2C0.7c0.5%2C0.2%2C1.1%2C0.3%2C1.7%2C0.5c0.6%2C0.1%2C1.3%2C0.3%2C2%2C0.4c0.7%2C0.2%2C1.4%2C0.3%2C2%2C0.6c0.7%2C0.2%2C1.2%2C0.5%2C1.8%2C0.9c0.5%2C0.4%2C0.9%2C0.8%2C1.2%2C1.4c0.3%2C0.6%2C0.5%2C1.2%2C0.5%2C2c0%2C1.1-0.2%2C2.1-0.7%2C2.9c-0.5%2C0.8-1.1%2C1.4-1.8%2C1.9c-0.7%2C0.5-1.6%2C0.8-2.5%2C1c-1%2C0.2-1.9%2C0.3-2.9%2C0.3c-1%2C0-2-0.1-2.9-0.3c-1-0.2-1.8-0.5-2.6-1c-0.7-0.5-1.4-1.3-1.8-2c-0.5-0.8-0.7-1.5-0.8-3.1h4.5C407.2%2C303.6%2C407.3%2C303.9%2C407.5%2C304.3%20M383.7%2C296.3c0.4-1.1%2C1-2.1%2C1.8-2.9c0.8-0.8%2C1.7-1.4%2C2.8-1.8c1.1-0.4%2C2.3-0.6%2C3.7-0.6c1.4%2C0%2C2.6%2C0.2%2C3.7%2C0.6c1.1%2C0.4%2C2%2C1.1%2C2.8%2C1.8c0.8%2C0.8%2C1.4%2C1.8%2C1.8%2C2.9c0.4%2C1.1%2C0.6%2C2.4%2C0.6%2C3.8c0%2C1.4-0.2%2C2.6-0.6%2C3.8c-0.4%2C1.1-1%2C2.1-1.8%2C2.9c-0.8%2C0.8-1.7%2C1.4-2.8%2C1.8c-1.1%2C0.4-2.4%2C0.6-3.7%2C0.6c-1.4%2C0-2.6-0.2-3.7-0.6c-1.1-0.4-2-1-2.8-1.8c-0.8-0.8-1.4-1.8-1.8-2.9c-0.4-1.1-0.6-2.4-0.6-3.8C383.1%2C298.7%2C383.3%2C297.4%2C383.7%2C296.3%20M388.1%2C302.1c0.1%2C0.7%2C0.4%2C1.3%2C0.7%2C1.8c0.3%2C0.5%2C0.8%2C0.9%2C1.3%2C1.3c0.5%2C0.3%2C1.2%2C0.5%2C2%2C0.5c0.8%2C0%2C1.5-0.2%2C2-0.5c0.5-0.3%2C1-0.7%2C1.3-1.3c0.3-0.5%2C0.6-1.1%2C0.7-1.8c0.1-0.7%2C0.2-1.3%2C0.2-2c0-0.7-0.1-1.4-0.2-2.1c-0.1-0.7-0.4-1.3-0.7-1.8c-0.3-0.5-0.8-0.9-1.3-1.3c-0.6-0.3-1.2-0.5-2-0.5c-0.8%2C0-1.5%2C0.2-2%2C0.5c-0.5%2C0.3-1%2C0.8-1.3%2C1.3c-0.3%2C0.5-0.5%2C1.1-0.7%2C1.8c-0.1%2C0.7-0.2%2C1.4-0.2%2C2.1C387.9%2C300.8%2C387.9%2C301.5%2C388.1%2C302.1%20M376.5%2C291v3.9h-0.1c0.2-0.8%2C0.5-1.2%2C0.9-1.7c0.4-0.5%2C0.8-0.9%2C1.3-1.3c0.5-0.3%2C1-0.6%2C1.6-0.8c0.6-0.2%2C1.1-0.3%2C1.6-0.3c0.3%2C0%2C0.9%2C0%2C0.9%2C0.1v4.4c0%2C0-0.4-0.1-0.7-0.1c-0.3%2C0-0.6%2C0-0.9%2C0c-0.9%2C0-1.6%2C0.1-2.2%2C0.4c-0.6%2C0.3-1.1%2C0.7-1.4%2C1.2c-0.4%2C0.5-0.6%2C1.1-0.8%2C1.8c-0.2%2C0.7-0.2%2C1.4-0.2%2C2.2v8.1h-4.7v-18H376.5z%20M363.2%2C309v-2.3h0c-0.6%2C0.8-1.4%2C1.6-2.4%2C2c-1%2C0.4-1.9%2C0.6-3%2C0.6c-1.3%2C0-2.3-0.2-3.1-0.5c-0.8-0.3-1.5-0.8-1.9-1.4c-0.5-0.6-0.8-1.4-1-2.3c-0.2-0.9-0.3-1.9-0.3-3V291h4.7v10.2c0%2C1.4%2C0.3%2C2.5%2C0.8%2C3.2c0.5%2C0.7%2C1.3%2C1.1%2C2.4%2C1.1c1.3%2C0%2C2.3-0.4%2C2.9-1.2c0.6-0.8%2C1-2.1%2C1-3.8V291h4.7v18H363.2z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E").attr("width",m).attr("height",b).attr("x",w).attr("y",S).attr("class","em-eurostat-logo")}(m),m.showEstatRibbon_&&function addEurostatRibbon(c){var h=c.svg(),g=h.select("#em-logo-group");g.empty()&&(g=h.append("g").attr("id","em-logo-group").attr("class","em-logo-group"));var m=c.ribbonWidth_||200,b=c.ribbonHeight_||40,w=c.ribbonPosition_?c.ribbonPosition_[0]:c.width_-m-10,S=c.ribbonPosition_?c.ribbonPosition_[1]:c.height_-b-10;c.footer&&!c.ribbonPosition_&&(S+=80),g.selectAll(".em-eurostat-ribbon").remove(),g.append("image").attr("href","data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNDAiIGhlaWdodD0iNjMiIHZpZXdCb3g9IjAgMCAxNDAgNjMiPgogIDxkZWZzPgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQiIHgxPSIwLjE1NSIgeTE9IjEiIHgyPSIwLjgzNyIgeTI9IjAuMDExIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iIzA4MmI3YSIgLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIwLjUiIHN0b3AtY29sb3I9IiMwZTQ3Y2IiIC8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQtMiIgeDE9IjAuNzU5IiB5MT0iMC45OTEiIHgyPSIwLjI0MyIgeTI9IjAuMDEzIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2Y0ZjVmNSIgLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjN2Q4MDg4IiAvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0ibGluZWFyLWdyYWRpZW50LTMiIHgxPSIwLjE3IiB5MT0iMC45NzkiIHgyPSIwLjg0MyIgeTI9IjAuMDAyIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2ZmZmNmMiIgLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIwLjUiIHN0b3AtY29sb3I9IiNmYzAiIC8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KCiAgPGcgaWQ9ImV1cm9zdGF0LXJpYmJvbiI+CiAgICA8cGF0aCBkPSJNMTA2LjUyMiA0Ljk4MUw5MC42MjggNC45ODFMNTUuMjUyIDQ3LjEzN0w3MS4xNDYgNDcuMTM3TDEwNi41MjIgNC45ODFaIgogICAgICAgICAgZmlsbD0idXJsKCNsaW5lYXItZ3JhZGllbnQpIiAvPgogICAgPHBhdGggZD0iTTM3LjU2MyAyNi4wNkw1My40NTkgMjYuMDZMNzEuMTQ2IDQ3LjEzOEw1NS4yNTIgNDcuMTM4TDM3LjU2MyAyNi4wNloiCiAgICAgICAgICBmaWxsPSJ1cmwoI2xpbmVhci1ncmFkaWVudC0yKSIgLz4KICAgIDxwYXRoIGQ9Ik01My40NTYgMjYuMDZMMzcuNTYgMjYuMDZMMi4xODQgNjguMjE2TDE4LjA3OSA2OC4yMTZMNTMuNDU2IDI2LjA2WiIKICAgICAgICAgIGZpbGw9InVybCgjbGluZWFyLWdyYWRpZW50LTMpIiAvPgogICAgPHBhdGggZD0iTTQ1LjQ5MSAzNS40ODlMNTYuOTc1IDQ5LjE5MkwzNC4wMDYgNDkuMTkyTDQ1LjQ5MSAzNS40ODlaIgogICAgICAgICAgY2xhc3M9ImxvZ28tcmliYm9uLWN1dC1maWxsIgogICAgICAgICAgZmlsbD0iI2ZmZiIgLz4KICAgIDxwYXRoIGQ9Ik0xMDYuNDkxIDQuOTgzTDE0Mi4xODQgNDcuNTI5TDcwLjc5NyA0Ny41MjlMMTA2LjQ5MSA0Ljk4M1oiCiAgICAgICAgICBmaWxsPSIjZmZmIiAvPgogIDwvZz4KPC9zdmc+Cg==").attr("width",m).attr("height",b).attr("x",w).attr("y",S).attr("class","em-eurostat-ribbon")}(m),m.showSourceLink_&&function addSourceLink(c,h){var g,m=c.svg();c.footer_&&!c.isInset?(g=m.select("#em-footer-"+c.svgId_)).empty()&&(g=m.append("g").attr("id","em-footer-"+c.svgId_).attr("class","em-footer")):g=m,g.selectAll("#em-source-link, .em-source-dataset-link, .em-source-pretext").remove();var b=c._primaryDataset_||c.stat();if(b&&b.eurostatDatasetCode){var w=b.eurostatDatasetCode,S="https://ec.europa.eu/eurostat/databrowser/view/".concat(w,"/default/table?lang=en"),M=c.footer_&&!c.isInset?10:c.height_,k=g.append("a").attr("class","em-source-dataset-link").attr("href",S).attr("target","_blank").append("text").attr("class","em-source-dataset-link-text").attr("x",c.width_-10).attr("y",M).text("EUROSTAT").attr("text-anchor","end").node().getComputedTextLength();g.append("text").attr("id","em-source-link").attr("class","em-source-pretext").attr("x",c.width_-k-10-6).attr("y",M).text("Source:").attr("text-anchor","end")}}(m),m.showScalebar_&&!m.gridCartogram_&&(2!==m.scalebarPosition_.length&&(m.scalebarPosition_[0]=15,m.scalebarPosition_[1]=m.height_-50),function addScalebarToMap(c){var h=c.scalebarMaxWidth_,g=c.scalebarTextOffset_[0],m=c.scalebarTextOffset_[1],b=c.position_.z,w=Bs(h*b),S=w[0]/b,M=w[1],k=c.svg().append("g").attr("class","em-scalebar").attr("transform","translate(".concat(c.scalebarPosition_[0],",").concat(c.scalebarPosition_[1],")")).attr("width",h+20).attr("height",c.scalebarHeight_);k.append("line").attr("class","em-scalebar-line").attr("x1",5).attr("y1",1).attr("x2",5).attr("y2",c.scalebarTickHeight_),k.append("text").attr("class","em-scalebar-label").attr("x",5+g).attr("y",c.scalebarTickHeight_+m).text("0");var T={1:4,2:2,5:5}[M],E=S/T,I=c.scalebarSegmentHeight_/2+1;if(E>=15){for(var P=1;P<T;P++)if(k.append("line").attr("class","em-scalebar-line").attr("x1",5+c.scalebarStrokeWidth_/2+P*E).attr("y1",1).attr("x2",5+c.scalebarStrokeWidth_/2+P*E).attr("y2",c.scalebarTickHeight_),k.append("text").attr("class","em-scalebar-label").attr("x",5+g+P*E).attr("y",c.scalebarTickHeight_+m).text(Os(w[0]/T*P)),1==P)k.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",5+c.scalebarStrokeWidth_-1).attr("y1",I).attr("x2",5+c.scalebarStrokeWidth_/2+P*E).attr("y2",I);else{var L=5+c.scalebarStrokeWidth_/2+(P-1)*E;L>0&&k.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",L).attr("y1",I).attr("x2",5+c.scalebarStrokeWidth_/2+P*E).attr("y2",I)}E>=15&&k.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",5+(T-1)*E).attr("y1",I).attr("x2",5+T*E).attr("y2",I)}else k.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",5+c.scalebarStrokeWidth_-1).attr("y1",I).attr("x2",5+c.scalebarStrokeWidth_/2+E*T).attr("y2",I);k.append("line").attr("class","em-scalebar-line").attr("x1",S+5).attr("y1",1).attr("x2",S+5).attr("y2",c.scalebarTickHeight_),k.append("text").attr("class","em-scalebar-label").attr("x",S+5+g).attr("y",c.scalebarTickHeight_+m).text(Os(w[0])+c.scalebarUnits_)}(m)),m.minimap_&&Ui(m),m.zoomButtons_&&!m.gridCartogram_&&function appendZoomButtons(c){var h=src_select("#"+c.svgId()).append("g").attr("class","em-zoom-buttons").style("pointer-events","all");if(c.zoomButtonsPosition_){var g=c.zoomButtonsPosition_;h.attr("transform","translate(".concat(g[0],", ").concat(g[1],")"))}else{var m=parseInt(Lt("em-button","width"))||30;h.attr("transform","translate(".concat(c.width_-m-10,", ").concat(10,")"))}var b=parseInt(Lt("em-button","width"))||30,w=h.append("g").attr("class","em-zoom-in em-button").style("cursor","pointer");w.append("title").text("Zoom in"),w.append("rect").attr("width",b).attr("height",b),w.append("text").attr("x",b/2).attr("y",b/2+7).text("+");var S=h.append("g").attr("class","em-zoom-out em-button").style("cursor","pointer").attr("transform","translate(0, ".concat(b,")")).style("cursor","pointer");S.append("title").text("Zoom out"),S.append("rect").attr("width",b).attr("height",b),S.append("text").attr("x",b/2).attr("y",b/2+7).text("−"),w.on("click",function(h){h.preventDefault(),h.stopPropagation(),function zoomIn(c){c.svg_.transition().call(c.__zoomBehavior.scaleBy,2)}(c)}),S.on("click",function(h){h.preventDefault(),h.stopPropagation(),function zoomOut(c){c.svg_.transition().call(c.__zoomBehavior.scaleBy,.5)}(c)})}(m),m.insetsButton_&&function appendInsetsButton(c){var h=src_select("#"+c.svgId()),g=parseInt(Lt("em-button","width"))||30,m=h.append("g").attr("class","em-insets-button em-button").attr("id","em-insets-button");if(c.insetsButtonPosition_){var b=c.insetsButtonPosition_;m.attr("transform","translate(".concat(b[0],", ").concat(b[1],")"))}else m.attr("transform","translate(".concat(c.width_-g-10,", ").concat(2*g+20,")"));m.append("title").text("Show/hide inset maps"),m.append("rect").attr("width",g).attr("height",g);var w=document.createComment("!Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.");m.node().appendChild(w);var S=g/700;m.append("path").attr("d","M266.3 48.3L232.5 73.6c-5.4 4-8.5 10.4-8.5 17.1l0 9.1c0 6.8 5.5 12.3 12.3 12.3c2.4 0 4.8-.7 6.8-2.1l41.8-27.9c2-1.3 4.4-2.1 6.8-2.1l1 0c6.2 0 11.3 5.1 11.3 11.3c0 3-1.2 5.9-3.3 8l-19.9 19.9c-5.8 5.8-12.9 10.2-20.7 12.8l-26.5 8.8c-5.8 1.9-9.6 7.3-9.6 13.4c0 3.7-1.5 7.3-4.1 10l-17.9 17.9c-6.4 6.4-9.9 15-9.9 24l0 4.3c0 16.4 13.6 29.7 29.9 29.7c11 0 21.2-6.2 26.1-16l4-8.1c2.4-4.8 7.4-7.9 12.8-7.9c4.5 0 8.7 2.1 11.4 5.7l16.3 21.7c2.1 2.9 5.5 4.5 9.1 4.5c8.4 0 13.9-8.9 10.1-16.4l-1.1-2.3c-3.5-7 0-15.5 7.5-18l21.2-7.1c7.6-2.5 12.7-9.6 12.7-17.6c0-10.3 8.3-18.6 18.6-18.6l29.4 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-20.7 0c-7.2 0-14.2 2.9-19.3 8l-4.7 4.7c-2.1 2.1-3.3 5-3.3 8c0 6.2 5.1 11.3 11.3 11.3l11.3 0c6 0 11.8 2.4 16 6.6l6.5 6.5c1.8 1.8 2.8 4.3 2.8 6.8s-1 5-2.8 6.8l-7.5 7.5C386 262 384 266.9 384 272s2 10 5.7 13.7L408 304c10.2 10.2 24.1 16 38.6 16l7.3 0c6.5-20.2 10-41.7 10-64c0-111.4-87.6-202.4-197.7-207.7zm172 307.9c-3.7-2.6-8.2-4.1-13-4.1c-6 0-11.8-2.4-16-6.6L396 332c-7.7-7.7-18-12-28.9-12c-9.7 0-19.2-3.5-26.6-9.8L314 287.4c-11.6-9.9-26.4-15.4-41.7-15.4l-20.9 0c-12.6 0-25 3.7-35.5 10.7L188.5 301c-17.8 11.9-28.5 31.9-28.5 53.3l0 3.2c0 17 6.7 33.3 18.7 45.3l16 16c8.5 8.5 20 13.3 32 13.3l21.3 0c13.3 0 24 10.7 24 24c0 2.5 .4 5 1.1 7.3c71.3-5.8 132.5-47.6 165.2-107.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM187.3 100.7c-6.2-6.2-16.4-6.2-22.6 0l-32 32c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l32-32c6.2-6.2 6.2-16.4 0-22.6z").attr("transform","translate(".concat(g/2,", ").concat(g/2,") scale(").concat(S,") translate(").concat(-256,", ").concat(-256,")")).attr("fill","#333").attr("pointer-events","none"),m.on("click",function(c){c.preventDefault(),c.stopPropagation();var g=h.select("#em-insets-group");"none"===g.style("display")||""===g.style("display")?g.style("display","block"):g.style("display","none")})}(m),m.drawCoastalMargin_&&!m.gridCartogram_&&appendCoastalMargin(m),setTimeout(function(){return m.recalculateLayout()},20),m};var S=function addCentroidsToMap(c){var h;c.Geometries.centroidsData?h="mixed"==c.nutsLevel_?[].concat(toConsumableArray_toConsumableArray(c.Geometries.centroidsData[0].features),toConsumableArray_toConsumableArray(c.Geometries.centroidsData[1].features),toConsumableArray_toConsumableArray(c.Geometries.centroidsData[2].features),toConsumableArray_toConsumableArray(c.Geometries.centroidsData[3].features)):c.Geometries.centroidsData.features:"WORLD"==c.geo_&&(h=[],c.Geometries.geoJSONs.worldrg.forEach(function(c){var g=function map_template_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?map_template_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):map_template_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}({},c);"FR"==c.properties.id?g.geometry={coordinates:[2.2,46.2],type:"Point"}:g.geometry={coordinates:centroid(c),type:"Point"},h.push(g)})),c.processCentroids_&&(h=c.processCentroids_(h));var g=h.map(function(h){var g=c._projection(h.geometry.coordinates);return h.properties.centroid=g,h});c.Geometries._allCentroidsFeatures=toConsumableArray_toConsumableArray(g),c.Geometries.centroidsFeatures=g.filter(function(h){return M(h.properties.id,c)}),(m.getCentroidsGroup(c).empty()?c.svg().select("#em-zoom-group-"+c.svgId_).append("g").attr("id","em-centroids-".concat(c.svgId_)).attr("class","em-centroids"):m.getCentroidsGroup(c)).selectAll("g.em-centroid").data(c.Geometries.centroidsFeatures,function(c){return c.properties.id}).join(function(c){return c.append("g").attr("class","em-centroid").attr("id",function(c){return"ps"+c.properties.id}).attr("transform",function(c){return"translate(".concat(c.properties.centroid[0].toFixed(3),",").concat(c.properties.centroid[1].toFixed(3),")")})},function(c){return c},function(c){return c.remove()})};m.getCentroidsGroup=function(c){return c.svg().select("#em-centroids-".concat(c.svgId_))},m.refreshCentroids=function(c){if(c.gridCartogram_)return c;var h=c.Geometries._allCentroidsFeatures;return h?(c.Geometries.centroidsFeatures=h.filter(function(h){return M(h.properties.id,c)}),m.getCentroidsGroup(c).selectAll("g.em-centroid").data(c.Geometries.centroidsFeatures,function(c){return c.properties.id}).join(function(c){return c.append("g").attr("class","em-centroid").attr("id",function(c){return"ps"+c.properties.id}).attr("transform",function(c){return"translate(".concat(c.properties.centroid[0].toFixed(3),",").concat(c.properties.centroid[1].toFixed(3),")")})},function(c){return c},function(c){return c.remove()}),c):void 0};var M=function hasStatData(c,h){return!h.statCodes_||h.statCodes_.some(function(g){var m,b=null===(m=h.statData(g))||void 0===m?void 0:m.get(c);return b&&!isNaN(b.value)&&0!==b.value})},k=function drawBackgroundMap(c){var h=c.svg().select("#em-zoom-group-"+c.svgId_);h.append("rect").attr("id","sea").attr("class","em-sea").attr("x",-5*c.width_).attr("y",-5*c.height_).attr("width",11*c.width_).attr("height",11*c.height_),"WORLD"==c.geo_&&h.append("path").datum({type:"Sphere"}).attr("id","sphere").attr("d",c._pathFunction).attr("class","em-graticule"),c.geometries_?c.Geometries.addUserGeometriesToMap(c.geometries_,h,c._pathFunction):c.Geometries.addDefaultGeometriesToMap(h,c.drawGraticule_,c._pathFunction,c.nutsLevel_,c.nutsYear_,c.geo_,c.proj_,c.scale_)},T=function defineDefaultPosition(){if(m.projectionFunction_){if("function"==typeof m.projectionFunction_.rotate){var c=m.projectionFunction_.rotate();if(Array.isArray(c)&&c.length>=2){var h,g,b=-c[0],w=-c[1];m.position_.x=null!==(h=m.position_.x)&&void 0!==h?h:b,m.position_.y=null!==(g=m.position_.y)&&void 0!==g?g:w}}else if("function"==typeof m.projectionFunction_.center){var S,M,k=m.projectionFunction_.center();if(Array.isArray(k)&&2===k.length)m.position_.x=null!==(S=m.position_.x)&&void 0!==S?S:k[0],m.position_.y=null!==(M=m.position_.y)&&void 0!==M?M:k[1]}}else{var T,E=js[m.geo_+"_"+m.proj_];E?(m.position_.x=m.position_.x||E.geoCenter[0],m.position_.y=m.position_.y||E.geoCenter[1]):null!==(T=m.Geometries.defaultGeoData)&&void 0!==T&&T.bbox&&(m.position_.x=m.position_.x||.5*(m.Geometries.defaultGeoData.bbox[0]+m.Geometries.defaultGeoData.bbox[2]),m.position_.y=m.position_.y||.5*(m.Geometries.defaultGeoData.bbox[1]+m.Geometries.defaultGeoData.bbox[3]))}L()},E=function getDefaultZ(){var c,h=js[m.geo_+"_"+m.proj_];return h?800*h.pixelSize/m.width_:null!==(c=m.Geometries.defaultGeoData)&&void 0!==c&&c.bbox?Math.min((m.Geometries.defaultGeoData.bbox[2]-m.Geometries.defaultGeoData.bbox[0])/m.width_,(m.Geometries.defaultGeoData.bbox[3]-m.Geometries.defaultGeoData.bbox[1])/m.height_):100},I=function defineProjection(){"WORLD"===m.geo_?m._projection=m.projectionFunction_||function robinson(){return projection(robinsonRaw).scale(152.63)}().translate([m.width_/2,m.height_/2]).scale((m.width_-20)/(2*Math.PI)):m._projection=m.projectionFunction_||function projection_identity(){var c,h,g,m,b,w,S,M=1,k=0,T=0,E=1,I=1,P=0,L=null,B=1,z=1,j=transform_transformer({point:function(c,h){var g=projection([c,h]);this.stream.point(g[0],g[1])}}),D=d3_geo_src_identity;function reset(){return B=M*E,z=M*I,w=S=null,projection}function projection(g){var m=g[0]*B,b=g[1]*z;if(P){var w=b*c-m*h;m=m*c+b*h,b=w}return[m+k,b+T]}return projection.invert=function(g){var m=g[0]-k,b=g[1]-T;if(P){var w=b*c+m*h;m=m*c-b*h,b=w}return[m/B,b/z]},projection.stream=function(c){return w&&S===c?w:w=j(D(S=c))},projection.postclip=function(c){return arguments.length?(D=c,L=g=m=b=null,reset()):D},projection.clipExtent=function(c){return arguments.length?(D=null==c?(L=g=m=b=null,d3_geo_src_identity):clipRectangle(L=+c[0][0],g=+c[0][1],m=+c[1][0],b=+c[1][1]),reset()):null==L?null:[[L,g],[m,b]]},projection.scale=function(c){return arguments.length?(M=+c,reset()):M},projection.translate=function(c){return arguments.length?(k=+c[0],T=+c[1],reset()):[k,T]},projection.angle=function(g){return arguments.length?(h=Jt(P=g%360*Ut),c=Xt(P),reset()):P*Ht},projection.reflectX=function(c){return arguments.length?(E=c?-1:1,reset()):E<0},projection.reflectY=function(c){return arguments.length?(I=c?-1:1,reset()):I<0},projection.fitExtent=function(c,h){return fitExtent(projection,c,h)},projection.fitSize=function(c,h){return fitSize(projection,c,h)},projection.fitWidth=function(c,h){return fitWidth(projection,c,h)},projection.fitHeight=function(c,h){return fitHeight(projection,c,h)},projection}().reflectY(!0).fitSize([m.width_,m.height_],function getBBOXAsGeoJSON(c){return{type:"Feature",geometry:{type:"MultiPoint",coordinates:[[c[0],c[1]],[c[2],c[3]]]}}}(function getApproxCurrentGeoBbox(c){var h=.5*c.position_.z*c.width_,g=.5*c.position_.z*c.height_;return[c.position_.x-h,c.position_.y-g,c.position_.x+h,c.position_.y+g]}(m)))},P=function definePathFunction(){m._pathFunction=src_path().projection(m._projection)},L=function setViewFromURL(){var c=getParameterByName("x"),h=getParameterByName("y"),g=getParameterByName("z");null==c||null==c||isNaN(+c)||(m.position_.x=+c),null==h||null==h||isNaN(+h)||(m.position_.y=+h),null==g||null==g||isNaN(+g)||(m.position_.z=+g)};return m.recalculateLayout=function(){var c=m.svg(),h=c.select("#em-header-"+m.svgId_),g=c.select("#em-drawing-"+m.svgId_),b=c.select("#em-footer-"+m.svgId_),w=g.select("#em-frame-"+m.geo_),S=c.select("#".concat(m.svgId_,"-clip-path rect")),M=0,k=0,T=m.headerPadding_?m.headerPadding_:20,E=m.footerPadding_?m.footerPadding_:10;if(m.header_&&!h.empty()){var I,P,L=null===(I=h.node())||void 0===I||null===(P=I.getBBox)||void 0===P?void 0:P.call(I);L&&(M=L.height+T)}if(m.footer_&&!b.empty()){var B,z,j=null===(B=b.node())||void 0===B||null===(z=B.getBBox)||void 0===z?void 0:z.call(B);j&&(k=j.height+E)}g.attr("transform","translate(0, ".concat(M,")")),b.attr("transform","translate(0, ".concat(M+m.height_+E,")")),w.attr("x",0).attr("y",0).attr("width",m.width_).attr("height",m.height_),S.attr("x",0).attr("y",0).attr("width",m.width_).attr("height",m.height_);var D=m.height_+M+k+E;c.attr("width",m.width_).attr("height",D)},m},js={EUR_3035:{geoCenter:[479e4,342e4],pixelSize:6400},IC_32628:{geoCenter:[443468,3145647],pixelSize:1e3},GP_32620:{geoCenter:[669498,1784552],pixelSize:130},MQ_32620:{geoCenter:[716521,1621322],pixelSize:130},GF_32622:{geoCenter:[266852,444074],pixelSize:500},RE_32740:{geoCenter:[348011,7661627],pixelSize:130},YT_32738:{geoCenter:[516549,8583920],pixelSize:70},MT_3035:{geoCenter:[4719755,1441701],pixelSize:70},PT20_32626:{geoCenter:[397418,4271471],pixelSize:1500},PT30_32628:{geoCenter:[333586,3622706],pixelSize:150},LI_3035:{geoCenter:[4287060,2672e3],pixelSize:40},IS_3035:{geoCenter:[3011804,496e4],pixelSize:700},SJ_SV_3035:{geoCenter:[457e4,6160156],pixelSize:800},SJ_JM_3035:{geoCenter:[3647762,5408300],pixelSize:100},CARIB_32620:{geoCenter:[636345,1669439],pixelSize:500},WORLD_54030:{geoCenter:[14,17],pixelSize:9e3}};function t(c,h){var g,m,b,w,u=function(c,h,g){if(0===Object.entries(c).length)return null;var m,b=[];if(g&&!n(g.name)&&(g=null),"string"==typeof c&&(c=[c]),Array.isArray(c)||e(c)){if(c.length===h)return g&&-1===c.findIndex(function(c){return null==c})?g.from(c):c;if(1===c.length){for(m=0;m<h;m++)b.push(c[0]);return b}}for(m=0;m<h;m++){var w=void 0===c[m]?null:c[m];b.push(w)}return b};if(this.length=0,this.id=[],null!=c)switch(this.class=c.class||"bundle",this.class){case"bundle":var S=[],M=0;if(this.error=null,this.length=0,null===c||"object"!=typeof c)return void(this.class=null);if(c.hasOwnProperty("error"))return void(this.error=c.error);if("dataset"===c.class||"collection"===c.class||"dimension"===c.class)return new t(c);for(m in c)M++,S.push(m);this.__tree__=c,this.length=M,this.id=S;break;case"dataset":c.hasOwnProperty("__tree__")?this.__tree__=g=c.__tree__:this.__tree__=g=c,this.label=g.label||null,this.note=g.note||null,this.link=g.link||null,this.href=g.href||null,this.updated=g.updated||null,this.source=g.source||null,this.extension=g.extension||null;var k,T=0,E=g.size||g.dimension&&g.dimension.size;if(this.size=E,this.value=g.hasOwnProperty("value")&&null!==g.value&&0!==g.value.length?g.value:{},Array.isArray(this.value)||e(this.value))T=this.value.length;else{var I=1;for(k=E.length;k--;)I*=E[k];T=I}if(this.value=u(this.value,T,h),this.status=g.hasOwnProperty("status")&&null!==g.status?u(g.status,T):null,g.hasOwnProperty("dimension")){var P=g.dimension,L=g.role||!g.version&&P.role||null,B=g.id||P.id,z=E.length,_=function(c){L.hasOwnProperty(c)||(L[c]=null)};if(!Array.isArray(B)||!Array.isArray(E)||B.length!=z)return;if(this.length=z,this.id=B,L&&(_("time"),_("geo"),_("metric"),_("classification")),L&&null===L.classification){var j=[],D=["time","geo","metric"],A=function(c,h){for(var g=h.length;g--;)if(c===h[g])return!0;return!1};for(k=0;k<3;k++){var N=L[D[k]];null!==N&&(j=j.concat(N))}for(L.classification=[],k=0;k<z;k++)A(B[k],j)||L.classification.push(B[k]);0===L.classification.length&&(L.classification=null)}this.role=L,this.n=T;for(var R=0,G=this.length;R<G;R++)if(P[B[R]].category.hasOwnProperty("index")){if(Array.isArray(P[B[R]].category.index)){var q={},W=P[B[R]].category.index;for(b=W.length,w=0;w<b;w++)q[W[w]]=w;P[B[R]].category.index=q}}else{var H=0;for(m in P[B[R]].category.index={},P[B[R]].category.label)P[B[R]].category.index[m]=H++}}else this.length=0;break;case"dimension":if(!c.hasOwnProperty("__tree__"))return new t({version:"2.0",class:"dataset",dimension:{d:c},id:["d"],size:[function(c){var h=void 0===c.index?c.label:c.index;return Array.isArray(h)?h.length:Object.keys(h).length}(c.category)],value:[null]}).Dimension(0);var U=[],Y=(g=c.__tree__).category;if(!g.hasOwnProperty("category"))return;if(!Y.hasOwnProperty("label"))for(m in Y.label={},Y.index)Y.label[m]=m;for(m in Y.index)U[Y.index[m]]=m;this.__tree__=g,this.label=g.label||null,this.note=g.note||null,this.link=g.link||null,this.href=g.href||null,this.id=U,this.length=U.length,this.role=c.role,this.hierarchy=Y.hasOwnProperty("child"),this.extension=g.extension||null;break;case"category":var V=c.child;this.id=V,this.length=null===V?0:V.length,this.index=c.index,this.label=c.label,this.note=c.note||null,this.unit=c.unit,this.coordinates=c.coord;break;case"collection":if(this.length=0,this.label=c.label||null,this.note=c.note||null,this.link=c.link||null,this.href=c.href||null,this.updated=c.updated||null,this.source=c.source||null,this.extension=c.extension||null,null!==this.link&&c.link.item){var $=c.link.item;if(this.length=Array.isArray($)?$.length:0,this.length)for(w=0;w<this.length;w++)this.id[w]=$[w].href}}}function e(c){return"[object ArrayBuffer]"===Object.prototype.toString.call(c.buffer)}function n(c){return-1!==["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"].indexOf(c)}function i(c){if(!c.ok)throw new Error(c.status+" "+c.statusText);return c.json()}t.prototype.Item=function(c){if(null===this||"collection"!==this.class||!this.length)return null;if("number"==typeof c)return c>this.length||c<0?null:this.link.item[c];var h,g=[];if("object"==typeof c){if(!c.class&&!c.follow)return null;c.class&&(h="dataset"===c.class&&"boolean"==typeof c.embedded?!0===c.embedded?function(c,h,m){var b=c.link.item[h];m.class===b.class&&b.id&&b.size&&b.dimension&&g.push(b)}:function(c,h,m){var b=c.link.item[h];m.class!==b.class||b.id&&b.size&&b.dimension||g.push(b)}:function(c,h,m){m.class===c.link.item[h].class&&g.push(c.link.item[h])})}else h=function(c,h){g.push(c.link.item[h])};for(var m=0;m<this.length;m++)h(this,m,c);return g},t.prototype.Dataset=function(c){if(null===this)return null;if("dataset"===this.class)return void 0!==c?this:[this];var h,g=[],m=0;if("collection"===this.class){var b=this.Item({class:"dataset",embedded:!0});if(void 0===c){for(h=b.length;m<h;m++)g.push(new t(b[m]));return g}if("number"==typeof c&&c>=0&&c<b.length)return new t(b[c]);if("string"==typeof c)for(h=b.length;m<h;m++)if(b[m].href===c)return new t(b[m]);return null}if("bundle"!==this.class)return null;if(void 0===c){for(h=this.id.length;m<h;m++)g.push(this.Dataset(this.id[m]));return g}if("number"==typeof c){var w=this.id[c];return void 0!==w?this.Dataset(w):null}var S=this.__tree__[c];return void 0===S?null:new t({class:"dataset",__tree__:S})},t.prototype.Dimension=function(c,h){h="boolean"!=typeof h||h;var g,m=[],b=this.id.length,s=function(c,h){if(null!==c)for(var g in c)for(var m=null!==c[g]?c[g].length:0;m--;)if(c[g][m]===h)return g;return null};if(null===this||"dataset"!==this.class)return null;if(void 0===c){for(g=0;g<b;g++)m.push(this.Dimension(this.id[g]));return m}if("number"==typeof c){var w=this.id[c];return void 0!==w?this.Dimension(w,h):null}var S=this.role;if("object"==typeof c){if(c.hasOwnProperty("role")){for(g=0;g<b;g++){var M=this.id[g];s(S,M)===c.role&&m.push(this.Dimension(M,h))}return void 0===m[0]?null:m}return null}var k=this.__tree__.dimension;if(void 0===k)return null;var T=k[c];return void 0===T?null:h?new t({class:"dimension",__tree__:T,role:s(S,c)}):function(c,h){var g=[];for(var m in c)g[c[m]]=h[m];return g}(T.category.index,T.category.label)},t.prototype.Category=function(c){if(null===this||"dimension"!==this.class)return null;if(void 0===c){for(var h=[],g=0,m=this.id.length;g<m;g++)h.push(this.Category(this.id[g]));return h}if("number"==typeof c){var b=this.id[c];return void 0!==b?this.Category(b):null}var w=this.__tree__.category;if(void 0===w)return null;var S=w.index[c];if(void 0===S)return null;var M=w.unit&&w.unit[c]||null,k=w.coordinates&&w.coordinates[c]||null,T=w.child&&w.child[c]||null,E=w.note&&w.note[c]||null;return new t({class:"category",index:S,label:w.label[c],note:E,child:T,unit:M,coord:k})},t.prototype.Dice=function(c,h,g){var m,b,w,S,u=function(c,h){return c.hasOwnProperty(h)&&!!c[h]};if(null===this||"dataset"!==this.class||null===this.value)return null;if("object"!=typeof c)return this;"object"!=typeof h?("boolean"==typeof h&&!0===h&&(m=!0),"boolean"==typeof g&&!0===g||(g=!1)):(m=u(h,"clone"),g=u(h,"drop"),b=u(h,"stringify"),w=u(h,"ovalue"),S=u(h,"ostatus"));var M,k=this.value,T=m?new t(JSON.parse(JSON.stringify(this))):this,E=T.status,I=[],P=[],p=function(c,h){var g,m,b,w=(g=c,m=h,b={},Array.isArray(g[m])?(g[m].forEach(function(c,h){null!==c&&(b[String(h)]=c)}),b):g[m]);delete c[h],c[h]=w};Array.isArray(c)&&(c=function(c){var h={};return c.forEach(function(c){h[c[0]]=c[1]}),h}(c)),null===c&&(c={});var L=Object.keys(c);return L.length>0&&(L.forEach(function(h){var g=c[h];Array.isArray(g)||(c[h]=[g]),0===c[h].length&&delete c[h]}),g&&(c=function(c){var h={};return Object.keys(c).forEach(function(g){h[g]=T.Dimension(g).id.filter(function(h){return-1===c[g].indexOf(h)})}),h}(c)),T.toTable({type:"arrobj",content:"id",status:!0}).forEach(function(h,g){var m=[];L.forEach(function(g){var b=c[g],w=[];b.forEach(function(c){w.push(h[g]===c)}),m.push(-1!==w.indexOf(!0))}),-1===m.indexOf(!1)&&(I.push(h.value),P.push(h.status))}),L.forEach(function(h){var g=T.Dimension(h).id,m=0,b={};T.size[T.id.indexOf(h)]=c[h].length,g.forEach(function(g){-1!==c[h].indexOf(g)&&(b[g]=m,m++)}),T.__tree__.dimension[h].category.index=b}),T.n=I.length,T.value=T.__tree__.value=e(k)?function(c,h){return h.from(c)}(I,k.constructor):I,T.status=T.__tree__.status=null!==E?P:null),b?((M=T.__tree__).hasOwnProperty("id")||(M.version="2.0",M.hasOwnProperty("class")||(M.class="dataset"),M.id=M.dimension.id,M.size=M.dimension.size,delete M.dimension.id,delete M.dimension.size,M.dimension.hasOwnProperty("role")&&(M.role=M.dimension.role,delete M.dimension.role)),M.hasOwnProperty("status")&&-1!==["null","{}","[]"].indexOf(JSON.stringify(M.status))&&delete M.status,M.hasOwnProperty("role")&&(delete M.role.classification,["geo","time","metric"].forEach(function(c){null===M.role[c]&&delete M.role[c]})),w&&p(M,"value"),S&&M.hasOwnProperty("status")&&p(M,"status"),JSON.stringify(M)):T},t.prototype.Slice=function(c){if(null===this||"dataset"!==this.class||0===Object.entries(this.value).length)return null;if(void 0===c)return this;if(!Array.isArray(c)){var h,g=[];for(h in c)g.push([h,c[h]]);c=g}return this.Dice(c.map(function(c){return[c[0],[c[1]]]}))},t.prototype.Data=function(c,h){var g,m,b=[],l=function(c){for(var h in c)if(c.hasOwnProperty(h))return h};if(null===this||"dataset"!==this.class||null===this.value)return null;if(void 0===c){for(m=this.value.length,g=0;g<m;g++)b.push(this.Data(g));return b}if("boolean"!=typeof h&&(h=!0),"number"==typeof c){var w=this.value[c];return void 0===w?null:h?{value:w,status:this.status?this.status[c]:null}:w}var S="object",M=this.__tree__,k=M.size||M.dimension&&M.dimension.size,T=k.length;if(Array.isArray(c)){if(!Array.isArray(c[0])){if(this.length!==c.length)return null;var E=1,I=0,P=[],L=[];for(g=0;g<T;g++)if(void 0!==c[g]){if("number"!=typeof c[g]||c[g]>=k[g])return null;I+=(E*=g>0?k[T-g]:1)*c[T-g-1]}else P.push(g),L.push(k[g]);if(P.length>1)return null;if(1===P.length){for(var B=0,z=L[0];B<z;B++){var j=[];for(g=0;g<T;g++)g!==P[0]?j.push(c[g]):j.push(B);b.push(this.Data(j,h))}return b}return h?{value:this.value[I],status:this.status?this.status[I]:null}:this.value[I]}S="array"}var D=function(c,h,g){var m,b=[],w={},S=c.dimension,M=c.id||S.id,k=c.size||S&&S.size;if("array"===g){for(m=h.length;m--;)w[h[m][0]]=h[m][1];h=w}for(var T=0,E=M.length;T<E;T++){var I=M[T],P=h[I];b.push("string"==typeof P?P:1===k[T]?l(S[I].category.index):null)}return b}(M,c,S),N=[],R=M.dimension,G=M.id||R.id;for(g=0,m=D.length;g<m;g++)N.push(R[G[g]].category.index[D[g]]);return this.Data(N,h)},t.prototype.toTable=function(c,h){if(null===this||"dataset"!==this.class||null===this.value)return null;1==arguments.length&&"function"==typeof c&&(h=c,c=null),"arrobj"!==(c=c||{field:"label",content:"label",vlabel:"Value",slabel:"Status",type:"array",status:!1,unit:!1,by:null,prefix:"",drop:[],meta:!1,comma:!1,bylabel:!1}).type&&"objarr"!==c.type||void 0!==c.field||(c.field="id");var g,m,b,w,S,M,k,T,E,I="id"===c.field,d=function(c){return(I?"value":c)||"Value"},v=function(c){return(I?"status":c)||"Status"},P=this.__tree__,L=!0===c.status;if("function"==typeof h){g=this.toTable(c);var B=[],z="array"!==c.type?0:1;for(S=(nt="object"!==c.type?g.slice(z):g.rows.slice(0)).length,m=0;m<S;m++){var j=h.call(this,nt[m],m);void 0!==j&&B.push(j)}return"object"===c.type?{cols:g.cols,rows:B}:("array"===c.type&&B.unshift(g[0]),B)}if("arrobj"===c.type||"objarr"===c.type){var D=[],N=P.role&&P.role.metric,O=function(){},R={},G=this,q=G.id,W=c.by&&-1!==q.indexOf(c.by)?c.by:null,H=!0===c.meta,U=void 0!==c.drop&&Array.isArray(c.drop)?c.drop:[],Y=!0===c.comma,V=!0===c.bylabel,$=G.value.constructor,C=function(h){var g,m={},b=d(c.vlabel);return"objarr"===c.type&&(g=null===W&&n($.name)?function(c){m[c]=c===b?$.from(h,function(h){return h[c]}):h.map(function(h){return h[c]})}:function(c){m[c]=h.map(function(h){return h[c]})},Object.keys(h[0]).forEach(g),h=m),H?(m={},q.forEach(function(c){var h=G.Dimension(c);m[c]={label:h.label,role:h.role,categories:{id:h.id,label:G.Dimension(c,!1)}}}),{meta:{label:G.label,source:G.source,updated:G.updated,id:q,status:L,unit:c.unit,by:W,bylabel:V,drop:null!==W&&U.length>0?U:null,prefix:null!==W?ot||"":null,comma:Y,dimensions:m},data:h}):h};W&&(c.field="id");var X=(g=this.toTable({field:c.field,vlabel:c.vlabel,slabel:c.slabel,content:c.content,status:L})).shift();if(null===W&&c.unit&&N){if("id"!==c.content)for(var K=N.length;K--;){var Z=this.Dimension(N[K]);R[N[K]]={};for(var J=Z.length;J--;)R[N[K]][Z.Category(J).label]=Z.id[J]}O=function(h,g){if(-1!==N.indexOf(h)){var m=P.dimension[h].category;m.unit?Q.unit=m.unit["id"!==c.content?R[h][g]:g]:Q.unit=null}},c.unit=!0}else c.unit=!1;for(S=g.length,m=0;m<S;m++){var Q={};for(b=g[m].length;b--;)Q[X[b]]=g[m][b],O(X[b],g[m][b]);D.push(Q)}if(Y&&D.forEach(function(c){null!==c.value&&(c.value=(""+c.value).replace(".",","))}),null!==W){var tt,et={},nt=[],rt={},ot=void 0!==c.prefix?c.prefix:"";U.forEach(function(c,h){(!G.Dimension(c)||G.Dimension(c).length>1)&&(U[h]="")});var at=q.filter(function(c){return c!==W&&-1===U.indexOf(c)}),it=G.Dimension(W);for(var st in"id"!==c.content?V?tt=function(c,h,g){c[h][ot+g[W]]=g.value}:(it.Category().forEach(function(c,h){rt[c.label]=it.id[h]}),tt=function(c,h,g){c[h][ot+rt[g[W]]]=g.value}):tt=function(c,h,g){c[h][ot+g[W]]=g.value},D.forEach(function(c){var h=function(c,h){var g=[];return h.forEach(function(h){g.push(c[h])}),g.join("\t")}(c,at);void 0===et[h]&&(et[h]=function(c,h){var g={};return h.forEach(function(h){g[h]=c[h]}),g}(c,at)),tt(et,h,c,W)}),et)nt.push(et[st]);return L=!1,C(nt)}return C(D)}if("object"===c.type){var lt="number"==typeof this.value[0]||null===this.value[0]?"number":"string";M=function(c,h){var g=I&&c||h||c;yt.push({id:c,label:g,type:"string"})},k=function(c,h,g){var m=d(c),b=v(h);g&&yt.push({id:"status",label:b,type:"string"}),yt.push({id:"value",label:m,type:lt})},T=function(c){Pt.push({v:c})},E=function(c){Pt.push({v:c}),At.push({c:Pt})}}else M=function(c,h){var g=I&&c||h||c;yt.push(g)},k=function(c,h,g){var m=d(c),b=v(h);g&&yt.push(b),yt.push(m),vt.push(yt)},T=function(c){Pt.push(c)},E=function(c){Pt.push(c),vt.push(Pt)};var ct=P.dimension,ut=P.id||ct.id,ht=P.size||ct.size,dt=ut.length;if(dt!=ht.length)return!1;var pt=[],ft=1,gt=(K=1,[]),_t=[],mt=[],vt=[],yt=[],At=[];for(m=0;m<dt;m++){var bt=ut[m];M(bt,ct[bt].label),ft*=ht[m],K*=ht[m];var xt=[];for(b=0;b<ht[m];b++)for(var wt in ct[ut[m]].category.index)if(ct[ut[m]].category.index[wt]===b){var Ct="id"!==c.content&&ct[ut[m]].category.label?ct[ut[m]].category.label[wt]:wt;xt.push(Ct)}pt.push(xt),gt.push(K)}for(k(c.vlabel,c.slabel,L),S=pt.length,m=0;m<S;m++){for(var St=[],Mt=0,kt=pt[m].length;Mt<kt;Mt++)for(var Tt=0;Tt<ft/gt[m];Tt++)St.push(pt[m][Mt]);_t.push(St)}for(S=_t.length,m=0;m<S;m++){var Et=[],It=0;for(w=0;w<ft;w++)Et.push(_t[m][It]),++It===_t[m].length&&(It=0);mt.push(Et)}for(w=0;w<ft;w++){var Pt=[];S=_t.length;for(var Lt=0;Lt<S;Lt++)T(mt[Lt][w]);L&&T(this.status?this.status[w]:null),E(this.value[w])}return"object"===c.type?{cols:yt,rows:At}:vt},t.prototype.node=function(){return this.__tree__},t.prototype.toString=function(){return this.class},t.prototype.Unflatten=function(c){if(null===this||"dataset"!==this.class||null===this.value||"function"!=typeof c)return null;const h=this.id,g=this.size,m=[];for(let b=0;b<this.n;b++){const w=this.Data(b),S={};let M=b;for(let c=h.length-1;c>=0;c--){const h=this.Dimension(c),m=this.id[c],b=g[c],w=M%b;h.Category(w);const k=h.id[w];M=Math.floor(M/b),S[m]=k}const k=c(S,w,b,m);void 0!==k&&m.push(k)}return m};var Ds=function statData(c){var h={__data:void 0,_data_:void 0,get:function(c){return c?h._data_?h._data_[c]:void 0:h._data_},getValue:function(c){var g=h.get(c);return g?g.value:void 0},set:function(c,g){h._data_=h._data_||{};var m=h._data_[c];return m?g.value?(m.value=g.value,m.status=g.status):m.value=g:h._data_[c]=g.value?g:{value:g},h},setData:function(c){return h.__data=c,h._data_={},Object.keys(c).forEach(function(g){return h.set(g,c[g])}),h},setManualMultiDate:function(c){for(var g in h._data_=h._data_||{},c){var m=c[g];for(var b in h._data_[g]={},m){var w=m[b];h._data_[g][b]={value:w}}}return h},hasData:function(){return null!=h._data_&&Object.keys(h._data_).length>0},hasNumericData:function(){return!!h._data_&&Object.values(h._data_).some(function(c){return Number.isFinite(+c.value)})},getArray:function(){if(h.hasData())return Object.values(h._data_).map(function(c){return c.value}).filter(function(c){return 0==c||c})},getUniqueValues:function(){if(h.hasData())return Object.values(h._data_).map(function(c){return c.value}).filter(function(c,h,g){return g.indexOf(c)===h})},getMin:function(){if(h.hasNumericData())return Object.values(h._data_).map(function(c){return c.value}).filter(function(c){return 0==c||c&&":"!==c}).reduce(function(c,h){return Math.min(c,h)})},getMax:function(){if(h.hasNumericData())return Object.values(h._data_).map(function(c){return c.value}).filter(function(c){return 0==c||c&&":"!==c}).reduce(function(c,h){return Math.max(c,h)})},getMaxRegionId:function(){if(h.hasNumericData()){var c=-1/0,g=null;for(var m in h._data_){var b=h._data_[m].value;null!=b&&":"!==b&&b>c&&(c=b,g=m)}return g}},getMinRegionId:function(){if(h.hasNumericData()){var c=1/0,g=null;for(var m in h._data_){var b=h._data_[m].value;null!=b&&":"!==b&&b<c&&(c=b,g=m)}return g}},isReady:function(){return h.hasData()},metadata:void 0,unitText_:void 0,retrieveFromRemote:function(c,g,w){return h.eurostatDatasetCode_?m(c,g,w):h.csvURL_&&b(w),h},eurostatDatasetCode_:void 0,filters_:{lastTimePeriod:1},precision_:2,label_:void 0},g=function getEurobasePromise(c,g){return h.filters_.geo||(h.filters_.geoLevel=c+""=="0"?"country":"nuts"+c),json(function getEstatDataURL(c,h,g,m){g=g||"en",m=m||"json";var b=[];if(b.push("https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data/",c,"?","format=",m,"&lang=",g),h)for(var w in h){var S=h[w];if(Array.isArray(S))for(var M=0;M<S.length;M++)b.push("&",w,"=",S[M]);else b.push("&",w,"=",S)}return b.join("")}(h.eurostatDatasetCode_,h.filters_,g))},m=function updateEurobase(c,m,b){h._data_=null,g(c,m).then(function(c){var g;if(c.error)return console.error("Error retrieving Eurostat data: "+(null===(g=c.error[0])||void 0===g?void 0:g.label));var m=function r(c,h,g){var m="object"==typeof h?h:null;return"function"!=typeof g&&(g=null),g||"function"!=typeof h||(g=h),"object"==typeof c?new t(c,g):"version"===c?"1.6.0":fetch?fetch(c,m).then(i).then(function(c){return new t(c,g)}):void 0}(c);h.metadata={label:m.label,href:m.href,source:m.source,updated:m.updated,extension:m.extension},h.metadata.time=m.Dimension("time").id[0],h._data_=function jsonstatToIndex(c){for(var h={},g=c.Dimension("geo").id,m=0;m<g.length;m++)h[g[m]]=c.Data(m);return h}(m),Object.keys(h._data_).forEach(function(c){null===h._data_[c]?h._data_[c]={value:":"}:null===h._data_[c].value&&(h._data_[c].value=":")}),b&&b()})};h.getTime=function(){var c=h.filters_.time;return c||(h._data_?h.metadata.time:void 0)},h.csvURL_=void 0,h.geoCol_="geo",h.valueCol_="value";var b=function updateCSV(c){h._data_=null,function getCSVPromise(){return Is(h.csvURL_)}().then(function(g){h._data_=function csvToIndex(c,h,g){for(var m={},b=0;b<c.length;b++){var w=c[b],S=w[g];m[w[h]]=S?{value:isNaN(+S)?S:+S,status:""}:{value:":",status:""}}return m}(g,h.geoCol_,h.valueCol_),h.metadata={href:h.csvURL_},c&&c()})};if(["unitText_"].forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c)for(var w in c)h[w+"_"]=c[w];return h};function appendPatternFillLegend(c,h){var g=c.map;g.patternFill_&&g.patternFill_.forEach(function(m,b){if(m.legendLabel){var w=b*c.shapeHeight+b*c.shapePadding+15,S=h.append("g").attr("class","em-legend-item em-pattern-legend-item"),M=m.color||"#000";("#fff"===M.toLowerCase()||"white"===M.toLowerCase())&&S.append("rect").attr("x",0).attr("y",w).attr("width",c.shapeWidth).attr("height",c.shapeHeight).attr("fill","#ddd"),S.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",w).attr("width",c.shapeWidth).attr("height",c.shapeHeight).attr("fill","url(#".concat(m.patternId||m.pattern,")")).on("mouseover",function(){highlightPatternFillRegions(g,m.patternId||m.pattern),g.insetTemplates_&&Bt(g.insetTemplates_,g.svgId,highlightPatternFillRegions,m.patternId||m.pattern)}).on("mouseout",function(){unhighlightPatternFillRegions(g),g.insetTemplates_&&Bt(g.insetTemplates_,g.svgId,unhighlightPatternFillRegions)}),S.append("text").attr("class","em-legend-label").attr("x",c.shapeWidth+c.labelOffsets.x).attr("y",w+c.shapeHeight/2).attr("dominant-baseline","middle").attr("dy","0.35em").text(m.legendLabel)}})}function highlightPatternFillRegions(c,h){var g="url(#".concat(h,")"),m=jt(c);c.svg_.selectAll(m).selectAll("[ecl]").filter(function(){return!src_select(this).classed("pattern-fill-overlay")}).style("fill","white"),c.svg_.selectAll(".pattern-fill-overlay").style("opacity",0),c.svg_.selectAll(".pattern-fill-overlay").filter(function(){return src_select(this).attr("fill")===g}).style("opacity",1)}function unhighlightPatternFillRegions(c){c.svg_.selectAll(".pattern-fill-overlay").style("opacity",1);var h=jt(c);c.svg_.selectAll(h).selectAll("[ecl]").filter(function(){return!src_select(this).classed("pattern-fill-overlay")}).each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}class InternMap extends Map{constructor(c,h=keyof){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:h}}),null!=c)for(const[h,g]of c)this.set(h,g)}get(c){return super.get(intern_get(this,c))}has(c){return super.has(intern_get(this,c))}set(c,h){return super.set(intern_set(this,c),h)}delete(c){return super.delete(intern_delete(this,c))}}Set;function intern_get({_intern:c,_key:h},g){const m=h(g);return c.has(m)?c.get(m):g}function intern_set({_intern:c,_key:h},g){const m=h(g);return c.has(m)?c.get(m):(c.set(m,g),g)}function intern_delete({_intern:c,_key:h},g){const m=h(g);return c.has(m)&&(g=c.get(m),c.delete(m)),g}function keyof(c){return null!==c&&"object"==typeof c?c.valueOf():c}const Ns=Symbol("implicit");function ordinal(){var c=new InternMap,h=[],g=[],m=Ns;function scale(b){let w=c.get(b);if(void 0===w){if(m!==Ns)return m;c.set(b,w=h.push(b)-1)}return g[w%g.length]}return scale.domain=function(g){if(!arguments.length)return h.slice();h=[],c=new InternMap;for(const m of g)c.has(m)||c.set(m,h.push(m)-1);return scale},scale.range=function(c){return arguments.length?(g=Array.from(c),scale):g.slice()},scale.unknown=function(c){return arguments.length?(m=c,scale):m},scale.copy=function(){return ordinal(h,g).unknown(m)},initRange.apply(scale,arguments),scale}function band(){var c,h,g=ordinal().unknown(void 0),m=g.domain,b=g.range,w=0,S=1,M=!1,k=0,T=0,E=.5;function rescale(){var g=m().length,I=S<w,P=I?S:w,L=I?w:S;c=(L-P)/Math.max(1,g-k+2*T),M&&(c=Math.floor(c)),P+=(L-P-c*(g-k))*E,h=c*(1-k),M&&(P=Math.round(P),h=Math.round(h));var B=range(g).map(function(h){return P+c*h});return b(I?B.reverse():B)}return delete g.unknown,g.domain=function(c){return arguments.length?(m(c),rescale()):m()},g.range=function(c){return arguments.length?([w,S]=c,w=+w,S=+S,rescale()):[w,S]},g.rangeRound=function(c){return[w,S]=c,w=+w,S=+S,M=!0,rescale()},g.bandwidth=function(){return h},g.step=function(){return c},g.round=function(c){return arguments.length?(M=!!c,rescale()):M},g.padding=function(c){return arguments.length?(k=Math.min(1,T=+c),rescale()):k},g.paddingInner=function(c){return arguments.length?(k=Math.min(1,c),rescale()):k},g.paddingOuter=function(c){return arguments.length?(T=+c,rescale()):T},g.align=function(c){return arguments.length?(E=Math.max(0,Math.min(1,c)),rescale()):E},g.copy=function(){return band(m(),[w,S]).round(M).paddingInner(k).paddingOuter(T).align(E)},initRange.apply(rescale(),arguments)}function d3_axis_src_identity(c){return c}var Rs=1e-6;function translateX(c){return"translate("+c+",0)"}function translateY(c){return"translate(0,"+c+")"}function axis_number(c){return h=>+c(h)}function center(c,h){return h=Math.max(0,c.bandwidth()-2*h)/2,c.round()&&(h=Math.round(h)),g=>+c(g)+h}function entering(){return!this.__axis}function axis(c,h){var g=[],m=null,b=null,w=6,S=6,M=3,k="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,T=1===c||4===c?-1:1,E=4===c||2===c?"x":"y",I=1===c||3===c?translateX:translateY;function axis(P){var L=null==m?h.ticks?h.ticks.apply(h,g):h.domain():m,B=null==b?h.tickFormat?h.tickFormat.apply(h,g):d3_axis_src_identity:b,z=Math.max(w,0)+M,j=h.range(),D=+j[0]+k,N=+j[j.length-1]+k,R=(h.bandwidth?center:axis_number)(h.copy(),k),G=P.selection?P.selection():P,q=G.selectAll(".domain").data([null]),W=G.selectAll(".tick").data(L,h).order(),H=W.exit(),U=W.enter().append("g").attr("class","tick"),Y=W.select("line"),V=W.select("text");q=q.merge(q.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),W=W.merge(U),Y=Y.merge(U.append("line").attr("stroke","currentColor").attr(E+"2",T*w)),V=V.merge(U.append("text").attr("fill","currentColor").attr(E,T*z).attr("dy",1===c?"0em":3===c?"0.71em":"0.32em")),P!==G&&(q=q.transition(P),W=W.transition(P),Y=Y.transition(P),V=V.transition(P),H=H.transition(P).attr("opacity",Rs).attr("transform",function(c){return isFinite(c=R(c))?I(c+k):this.getAttribute("transform")}),U.attr("opacity",Rs).attr("transform",function(c){var h=this.parentNode.__axis;return I((h&&isFinite(h=h(c))?h:R(c))+k)})),H.remove(),q.attr("d",4===c||2===c?S?"M"+T*S+","+D+"H"+k+"V"+N+"H"+T*S:"M"+k+","+D+"V"+N:S?"M"+D+","+T*S+"V"+k+"H"+N+"V"+T*S:"M"+D+","+k+"H"+N),W.attr("opacity",1).attr("transform",function(c){return I(R(c)+k)}),Y.attr(E+"2",T*w),V.attr(E,T*z).text(B),G.filter(entering).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===c?"start":4===c?"end":"middle"),G.each(function(){this.__axis=R})}return axis.scale=function(c){return arguments.length?(h=c,axis):h},axis.ticks=function(){return g=Array.from(arguments),axis},axis.tickArguments=function(c){return arguments.length?(g=null==c?[]:Array.from(c),axis):g.slice()},axis.tickValues=function(c){return arguments.length?(m=null==c?null:Array.from(c),axis):m&&m.slice()},axis.tickFormat=function(c){return arguments.length?(b=c,axis):b},axis.tickSize=function(c){return arguments.length?(w=S=+c,axis):w},axis.tickSizeInner=function(c){return arguments.length?(w=+c,axis):w},axis.tickSizeOuter=function(c){return arguments.length?(S=+c,axis):S},axis.tickPadding=function(c){return arguments.length?(M=+c,axis):M},axis.offset=function(c){return arguments.length?(k=+c,axis):k},axis}function axisBottom(c){return axis(3,c)}function axisLeft(c){return axis(4,c)}var Gs=function createHistogramLegend(c,h,g){var m=c.histogram.orientation||"horizontal",b=c.histogram.showCounts,w=c.histogram.showPercentages,S=c.histogram.labelRotation||0,M=c.histogram.margin||{top:0,right:0,bottom:0,left:0},k=c.histogram.height||200,T=c.histogram.width||270,E=c.getNumberOfClasses(c),I=c.getLabelFormatter(c),P=c.getColorClassifier(c),L=new Array(E).fill(0),B=function getData(c){var h=c.map;return Object.values(h.statData()._data_).map(function(c){return c.value})}(c),z=function getColors(c){var h=c.map;return h.colors_?h.colors_:Array.from({length:h.numberOfClasses_}).map(function(c,g){return h.classToFillStyle()(g,h.numberOfClasses_)})}(c),j=getThresholds(c);B.forEach(function(c){var h=P(c);"number"==typeof h&&h>=0&&h<L.length&&L[h]++});var D=L.reduce(function(c,h){return c+h},0),N=c.lgg.append("g").attr("class","em-legend-histogram").attr("transform","translate(".concat(h,", ").concat(g,")"));function handleMouseOver(h,g){var m=src_select(this).style("stroke","black").attr("ecl"),b=z.length-1-parseInt(m,10);legend_choropleth_highlightRegions(c.map,b),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,legend_choropleth_highlightRegions,m)}function handleMouseOut(h,g){src_select(this).style("stroke","none");legend_choropleth_unhighlightRegions(c.map),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,legend_choropleth_unhighlightRegions)}"vertical"===m?function drawVerticalHistogram(h){var g=L.slice().reverse(),m=g.map(function(c){return D>0?c/D*100:0}),S=j.slice().reverse(),E=band().domain(g.map(function(c,h){return h})).range([M.top,k-M.bottom]).padding(.1),P=linear_linear().domain([0,max_max(g)]).nice().range([M.left,T-M.right]);h.selectAll("rect").data(g).join("rect").attr("class","em-legend-histogram-bar").attr("y",function(c,h){return E(h)}).attr("x",M.left).attr("height",E.bandwidth()).attr("width",function(c){return P(c)-M.left}).attr("fill",function(c,h){return z[z.length-h-1]}).attr("ecl",function(c,h){return h}).on("mouseover",handleMouseOver).on("mouseout",handleMouseOut),(b||w)&&h.selectAll("text.em-histogram-label").data(g).join("text").attr("class","em-legend-label em-histogram-label").attr("x",function(c){return P(c)+5}).attr("y",function(c,h){return E(h)+E.bandwidth()/2}).attr("alignment-baseline","middle").text(function(c,h){return w?"".concat(m[h].toFixed(1),"%"):g[h]});var B=h.append("g").attr("id","em-legend-histogram-y-axis").attr("transform","translate(".concat(M.left,",0)"));if("thresholds"===c.labelType){for(var N=[],R=0;R<S.length;R++){var G=E(R);void 0!==G&&N.push(G+E.bandwidth())}var q=linear_linear().domain([0,k]).range([0,k]);B.call(axisLeft(q).tickValues(N).tickFormat(function(c,h){return I?I(S[h],h):S[h]}).tickSize(4).tickSizeOuter(0))}else"ranges"===c.labelType&&B.call(axisLeft(E).tickSizeOuter(0).tickSize(0).tickFormat(function(c,h){return I?I(S[h],h):S[h]}));B.selectAll("text").attr("class","em-legend-label em-tick-label").attr("text-anchor","end")}(N):function drawHorizontalHistogram(h){var g=L.slice().reverse(),m=g.map(function(c){return D>0?c/D*100:0}),E=z.slice().reverse(),P=band().domain(g.map(function(c,h){return h})).range([M.left,T-M.right]).padding(.1),B=linear_linear().domain([0,max_max(g)]).nice().range([k-M.bottom,M.top]);h.selectAll("rect").data(g).join("rect").attr("class","em-legend-histogram-bar").attr("x",function(c,h){return P(h)}).attr("y",function(c){return B(c)}).attr("width",P.bandwidth()).attr("height",function(c){return k-M.bottom-B(c)}).attr("fill",function(c,h){return E[h]}).attr("ecl",function(c,h){return h}).on("mouseover",handleMouseOver).on("mouseout",handleMouseOut),(b||w)&&h.selectAll("text.em-histogram-label").data(g).join("text").attr("class","em-legend-label em-histogram-label").attr("x",function(c,h){return P(h)+P.bandwidth()/2}).attr("y",function(c){return B(c)-5}).attr("text-anchor","middle").text(function(c,h){return w?"".concat(m[h].toFixed(1),"%"):c});var N=h.append("g").attr("id","em-legend-histogram-x-axis").attr("transform","translate(0, ".concat(k-M.bottom,")"));if("thresholds"===c.labelType){for(var R=[],G=0;G<j.length;G++){var q=j.length-G-1,W=P(q);void 0!==W&&R.push(W+P.bandwidth())}var H=linear_linear().domain([0,T]).range([0,T]);N.call(axisBottom(H).tickValues(R).tickFormat(function(c,h){return I?I(j[h],h):j[h]}).tickSize(4).tickSizeOuter(0)),N.selectAll("text").attr("class","em-legend-label em-tick-label").attr("text-anchor","end").attr("dy","0em").attr("dx","-0.45em").attr("transform","rotate(-".concat(S,")"))}else"ranges"===c.labelType&&(N.call(axisBottom(P).tickSizeOuter(0).tickSize(0).tickFormat(function(c,h){return I?I(j[h],h):j[h]})),N.selectAll("text").attr("class","em-legend-label em-tick-label").attr("text-anchor","end").attr("dy","0.35em").attr("dx","-0.35em").attr("transform","rotate(-".concat(S,")")))}(N)};function createContinuousLegend(c,h,g){c.map;c._continuousLegendContainer=c.lgg.append("g").attr("class","em-continuous-legend").attr("id","em-continuous-legend").attr("transform","translate(".concat(h,", ").concat(g,")"));var m="ps"==c.map._mapType?c.colorLegend:c,b="vertical"===m.orientation,w="legend-gradient-"+Math.random().toString(36).substr(2,5),S=c.width||6*c.shapeWidth,M=b?c.shapeWidth:c.shapeHeight;if(function createLegendGradient(c,h,g){for(var m,b=c.map,w="function"==typeof(null===(m=b.colorFunction_)||void 0===m?void 0:m.domain),S=20,M=function getTransformedDomain(c){var h=c.valueTransform_||function(c){return c},g=getUntransformedDomain(c);return g.map(h)}(b),k=slicedToArray_slicedToArray(3===M.length?M:[M[0],null,M[1]],3),T=k[0],E=k[1],I=k[2],P=c._continuousLegendContainer.append("defs").append("linearGradient").attr("id",h).attr("x1","0%").attr("x2",g?"0%":"100%").attr("y1",g?"100%":"0%").attr("y2","0%"),L=0;L<=S;L++){var B=L/S,z=void 0;z=3===M.length?B<.5?T+2*B*(E-T):E+2*(B-.5)*(I-E):T+B*(I-T);var j=b.colorFunction_(w?z:B);P.append("stop").attr("offset","".concat(100*B,"%")).attr("stop-color",j)}}(c,w,b),function drawLegendRect(c,h,g,m,b){var w=getTitlePadding(h),S=h._continuousLegendContainer.append("rect").attr("class","em-legend-gradient").attr("id","em-legend-gradient").attr("x",0).attr("y",w).attr("width",b?m:g).attr("height",b?g:m).style("fill","url(#".concat(c,")"));!function addMouseEvents(c,h,g,m){var b=h.map,w=getUntransformedDomain(b),S=b.valueUntransform_||function(c){return c},M=h._continuousLegendContainer,k=getTitlePadding(h),T=function getHighlightFunction(c){return"ps"==c._mapType?highlightPsSymbols:highlightRegions}(b),E=function getUnHighlightFunction(c){return"ps"==c._mapType?unhighlightPsSymbols:unhighlightRegions}(b);c.on("mousemove",function(c){var E,I=slicedToArray_slicedToArray(pointer(c,this),2),P=I[0],L=I[1],B=m?L-k:P,z=Math.max(0,Math.min(g,B)),j=z/g,D=m?1-j:j;if(3===w.length){var N=slicedToArray_slicedToArray(w,3),R=N[0],G=N[1],q=N[2];if(D<.5)E=R+(G-R)*(D/.5);else E=G+(q-G)*((D-.5)/.5)}else{var W=slicedToArray_slicedToArray(w,2),H=W[0];E=H+D*(W[1]-H)}E=S(E),M.selectAll(".em-hover-line, .em-hover-tick, .em-hover-label").remove();var U=m?0:z,Y=m?z+k:0;M.append("line").attr("class","em-hover-line").attr("x1",U).attr("y1",Y).attr("x2",m?U+h.shapeWidth:U).attr("y2",m?Y:Y+h.shapeHeight).attr("stroke","black").attr("stroke-width",1).attr("pointer-events","none"),M.append("circle").attr("class","em-hover-tick").attr("cx",m?U+h.shapeWidth:U).attr("cy",m?Y:Y+h.shapeHeight).attr("r",3).attr("fill","black").attr("pointer-events","none");var V=getChoroplethLabelFormatter(h);M.append("text").attr("class","em-hover-label").attr("x",m?U+h.shapeWidth+5:U).attr("y",m?Y:Y+h.shapeHeight+12).attr("text-anchor",m?"start":"middle").attr("alignment-baseline","middle").attr("pointer-events","none").text(V(E)),T(b,E)}),c.on("mouseout",function(){M.selectAll(".em-hover-line, .em-hover-tick, .em-hover-label").remove(),E(b)})}(S,h,g,b)}(w,c,S,M,b),!function hasTicks(c){return c.ticks>1||c.tickValues}(c)?function drawLowHighLabels(c,h,g,m){var b=getTitlePadding(c),w=c.lowLabel,S=c.highLabel,M=c.pointOfDivergenceLabel,k=c._continuousLegendContainer;if(m){var T=h,E=g+5;w&&k.append("text").attr("class","em-legend-label").attr("x",E).attr("y",b+T).attr("dy","-0.2em").attr("text-anchor","start").text(w),S&&k.append("text").attr("class","em-legend-label").attr("x",E).attr("y",b).attr("dy","0.8em").attr("text-anchor","start").text(S),M&&k.append("text").attr("class","em-legend-label").attr("x",E).attr("y",b+T/2).attr("dy","0.35em").attr("text-anchor","start").text(M)}else{var I=g+b+10;w&&k.append("text").attr("class","em-legend-label").attr("x",0).attr("y",I).attr("text-anchor","start").text(w),S&&k.append("text").attr("class","em-legend-label").attr("x",h).attr("y",I).attr("text-anchor","end").text(S),M&&k.append("text").attr("class","em-legend-label").attr("x",h/2).attr("y",I).attr("text-anchor","middle").text(M)}}(c,S,M,b):function drawTickLabels(c,h,g,m){var b=c.map,w=getUntransformedDomain(b),S=c._continuousLegendContainer.append("g").attr("class","em-legend-ticks"),M=getChoroplethLabelFormatter(c),k=b.valueTransform_||function(c){return c},T=getTitlePadding(c),E=Array.isArray(c.tickValues)&&c.tickValues?c.tickValues.map(k):function generateTickValues(c,h){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(c){return c};if(Array.isArray(c)&&3===c.length){var m=slicedToArray_slicedToArray(c,3),b=m[0],w=m[1],S=m[2];return Array.from({length:h},function(c,m){var M=m/(h-1);return g(M<.5?b+2*M*(w-b):w+2*(M-.5)*(S-w))})}var M=slicedToArray_slicedToArray(c,2),k=M[0],T=M[1];return Array.from({length:h},function(c,m){return g(k+m/(h-1)*(T-k))})}(w,c.ticks,k);E.forEach(function(k,I){var P=function computeNormalizedTickPosition(c,h){if(3===h.length){var g=slicedToArray_slicedToArray(h,3),m=g[0],b=g[1],w=g[2];return c<b?.5*(c-m)/(b-m):.5+.5*(c-b)/(w-b)}return(c-h[0])/(h[1]-h[0])}(k,w);if(m){var L=g,B=h-P*h+T;S.append("line").attr("class","em-legend-tick").attr("x1",L).attr("y1",B).attr("x2",L+c.tickLength).attr("y2",B);var z=Array.isArray(c.tickLabels)&&null!=c.tickLabels[I]?c.tickLabels[I]:b.valueUntransform_?M(b.valueUntransform_(k)):M(k);S.append("text").attr("class","em-legend-label em-legend-ticklabel").attr("x",L+c.tickLength+3).attr("y",B).attr("dy","0.35em").attr("text-anchor","start").text(z)}else{var j=P*h,D=g+T;S.append("line").attr("class","em-legend-tick").attr("x1",j).attr("y1",D).attr("x2",j).attr("y2",D+c.tickLength);var N=Array.isArray(c.tickLabels)&&null!=c.tickLabels[I]?c.tickLabels[I]:b.valueUntransform_?M(b.valueUntransform_(k)):M(k);S.append("text").attr("class","em-legend-label em-legend-ticklabel").attr("x",j).attr("y",D+c.tickLength+10).attr("dy","0").attr("text-anchor",0===I?"start":I===E.length-1?"end":"middle").text(N)}})}(c,S,M,b),c.noData){var k=(b?c.width+5:M+30)+getTitlePadding(c);m.pointOfDivergence&&m.pointOfDivergencePadding&&(k+=m.pointOfDivergencePadding);var T=c._continuousLegendContainer.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(0,",").concat(k,")"));c.appendNoDataLegend(T,m.noDataText,highlightRegions,unhighlightRegions)}}function getUntransformedDomain(c){var h;return"function"==typeof(null===(h=c.colorFunction_)||void 0===h?void 0:h.domain)?c.colorFunction_.domain():c.domain_||[0,1]}function getTitlePadding(c){return"ps"==c.map._mapType?c.colorLegend.titlePadding:c.titlePadding}function getHighlightTolerance(c){var h,g,m;return c&&c.legend_&&null!==(h=null!==(g=c.legend_.highlightTolerance)&&void 0!==g?g:null===(m=c.legend_.colorLegend)||void 0===m?void 0:m.highlightTolerance)&&void 0!==h?h:1}function highlightRegions(c,h){var g=getHighlightTolerance(c),m=jt(c),b=c.svg_.selectAll(m).selectAll("[ecl]");b&&b.each(function(){var c=src_select(this),m=c.attr("ecl");if(m&&"nd"!==m){var b=+m;b>=h-g&&b<=h+g?c.style("fill",src_select(this).attr("fill___")):c.style("fill","white")}else{if("nd"===h)return;c.style("fill","white")}})}function unhighlightRegions(c){var h=jt(c);c.svg_.selectAll(h).selectAll("[ecl]").each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}function highlightPsSymbols(c,h){var g=getHighlightTolerance(c);c.getCentroidsGroup(c).selectAll("[ecl]").each(function(){var m=src_select(this),b=m.attr("ecl");if(!b||"nd"===b)return"nd"===h?void m.style("opacity",c.psFillOpacity_):void m.style("opacity",0);var w=+b;w>=h-g&&w<=h+g?m.style("opacity",c.psFillOpacity_):m.style("opacity",0)})}function unhighlightPsSymbols(c){c.getCentroidsGroup(c).selectAll("[ecl]").each(function(){src_select(this).style("opacity",c.psFillOpacity_)})}function drawDiscreteLegend(c,h,g){var m,b;c._discreteLegendContainer=c.lgg.append("g").attr("class","em-discrete-legend-container").attr("transform","translate(".concat(h,",").concat(g,")")),null!==(m=c.colorLegend)&&void 0!==m&&m.title&&c._discreteLegendContainer.append("text").attr("class","em-legend-title em-color-legend-title").attr("id","em-color-legend-title").attr("x",0).attr("y",0).text(c.colorLegend.title);var w="ps"==c.map._mapType?c.colorLegend:c;if("ranges"===c.labelType||"ranges"===(null===(b=c.colorLegend)||void 0===b?void 0:b.labelType)?function createRangesLegend(c,h){for(var g=c.map,m=c._discreteLegendContainer,b=c.getLabelFormatter(c),w=c.getNumberOfClasses(c),S=c.getHighlightFunction(g),M=c.getUnHighlightFunction(g),k=c.getClassToFillStyle(c),T=c.getColorClassifier(c),E=legend_discrete_getTitlePadding(c),I=function _loop2(){var g=P*h.shapeHeight+E,I=0,L=c.ascending?w-P-1:P,B=k(L,w),z=m.append("g").attr("class","em-legend-item");h.pointOfDivergenceLabel&&P>=h.pointOfDivergence&&(g+=h.pointOfDivergencePadding),z.append("rect").attr("class","em-legend-rect").attr("x",I).attr("y",g).attr("width",h.shapeWidth).attr("height",h.shapeHeight).style("fill",B).on("mouseover",function(){src_select(this).raise(),S(c.map,L),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,S,L)}).on("mouseout",function(){M(c.map),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,M,L)}),P>0&&z.append("line").attr("class","em-legend-separator").attr("x1",0).attr("y1",g).attr("x2",h.sepLineLength).attr("y2",g),z.append("text").attr("class","em-legend-label").attr("x",Math.max(h.shapeWidth,h.sepLineLength+h.tickLength)+(h.labelOffsets.x||0)).attr("y",g+h.shapeHeight/2).attr("dy","0.3em").text(h.labels?h.labels[P]:b(T.invertExtent(L)[c.ascending?0:1],P))},P=0;P<w;P++)I();if(h.pointOfDivergenceLabel)for(var L=0;L<w;L++){var B=L*h.shapeHeight+E;L==h.pointOfDivergence&&drawDivergingLine(c,B,h)}}(c,w):function createThresholdsLegend(c,h){var g,m,b,w,S,M,k=c.map,T=c._discreteLegendContainer,E=c.getNumberOfClasses(c),I=legend_discrete_getTitlePadding(c),P=c.getHighlightFunction(k),L=c.getUnHighlightFunction(k),B=c.getColorClassifier(c),z=c.getClassToFillStyle(c),j=c.getColorStats(c),D=c.getLabelFormatter(c);if((c.maxMin||h.maxMin)&&j){if(null!=j&&j.getMin&&null!=j&&j.getMax)if(null!=B&&B.invertExtent){var N=c.ascending?0:E-1,R=c.ascending?E-1:0,G=B.invertExtent(N),q=B.invertExtent(R);g=null==G?void 0:G[0],m=null==q?void 0:q[1]}else g=j.getMin(),m=j.getMax();if(null!=j&&j.getMaxRegionId&&null!=j&&j.getMinRegionId){var W,H,U,Y;b=j.getMinRegionId(),w=j.getMaxRegionId();var V=k.Geometries.getAllRegionFeatures(),$=V.find(function(c){return c.properties.id===b}),X=V.find(function(c){return c.properties.id===w});$&&(S=(null===(W=$.properties)||void 0===W?void 0:W.na)||(null===(H=$.properties)||void 0===H?void 0:H.na)||b),X&&(M=(null===(U=X.properties)||void 0===U?void 0:U.na)||(null===(Y=X.properties)||void 0===Y?void 0:Y.na)||w)}}for(var K=function _loop(g){var m=g*h.shapeHeight+I,b=0,w=c.ascending?E-g-1:g,S=z(w,E),M=T.append("g").attr("class","em-legend-item");if(M.append("rect").attr("class","em-legend-rect").attr("x",b).attr("y",m).attr("width",h.shapeWidth).attr("height",h.shapeHeight).style("fill",S).on("mouseover",function(){src_select(this).raise(),P(k,w),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,P,w)}).on("mouseout",function(){L(k),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,L,w)}),g>0&&M.append("line").attr("class","em-legend-separator").attr("x1",0).attr("y1",m).attr("x2",c.sepLineLength).attr("y2",m),g>0&&M.append("line").attr("class","em-legend-tick").attr("x1",h.sepLineLength).attr("y1",m).attr("x2",h.sepLineLength+h.tickLength).attr("y2",m),g<E-1){var j=M.append("text").attr("class","em-legend-label").attr("x",Math.max(h.shapeWidth,h.sepLineLength+h.tickLength)+(h.labelOffsets.x||0)).attr("y",m+h.shapeHeight).attr("dy","0.3em").text(function(){if(h.labels)return h.labels[g];if(null!=B&&B.invertExtent){var m=B.invertExtent(w);return D(m[c.ascending?0:1])}return k.noDataText_||""});h.pointOfDivergenceLabel&&g==h.pointOfDivergence-1&&j.attr("class","em-legend-label em-legend-label-divergence")}},Z=0;Z<E;Z++)K(Z);if((c.maxMin||h.maxMin)&&Number.isFinite(g)&&Number.isFinite(m)){var J=!0,Q=!0;if(null!=B&&B.invertExtent){var tt=c.ascending?E-1:0,et=c.ascending?0:E-1,nt=B.invertExtent(tt),rt=B.invertExtent(et);!nt||nt[0]!==nt[1]&&nt[0]!==m||(J=!1),!rt||rt[0]!==rt[1]&&rt[1]!==g||(Q=!1)}var ot=0,at=h.maxMinTickLength?h.sepLineLength+h.maxMinTickLength:h.sepLineLength+h.tickLength,it=h.maxMinTickLength?Math.max(h.shapeWidth,h.sepLineLength+h.maxMinTickLength)+(h.labelOffsets.x||0):Math.max(h.shapeWidth,h.sepLineLength+h.tickLength)+(h.labelOffsets.x||0),st=D(m)+(h.maxMinLabels?h.maxMinLabels[1]:""),lt=D(g)+(h.maxMinLabels?h.maxMinLabels[0]:"");h.maxMinRegionLabels&&(st="".concat(D(m)," (").concat(M,")"),lt="".concat(D(g)," (").concat(S,")"));var ct=T.append("g").attr("class","em-legend-max-min-group");if(J){var ut=I;ct.append("line").attr("class","em-legend-tick em-legend-tick-max").attr("x1",ot).attr("y1",ut).attr("x2",at).attr("y2",ut),ct.append("text").style("pointer-events","all").style("cursor","pointer").on("mouseover",function(){var h=c.getNumberOfClasses(c);!function highlightMaxRegion(c,h,g){var m=jt(c),b=h-1,w=c.svg_.selectAll(m).selectAll("[ecl]");w.style("fill","white"),w.filter("[ecl='"+b+"']").each(function(h){h.properties.id===g&&src_select(this).style("fill",c.hoverColor_)})}(k,h,w)}).on("mouseout",function(){legend_choropleth_unhighlightRegions(k)}).attr("class","em-legend-label em-legend-label-max").attr("x",it).attr("y",ut).attr("dy","0.3em").text(st)}if(Q){var ht=E*h.shapeHeight+I;ct.append("line").attr("class","em-legend-tick em-legend-tick-min").attr("x1",ot).attr("y1",ht).attr("x2",at).attr("y2",ht),ct.append("text").style("pointer-events","all").style("cursor","pointer").on("mouseover",function(){!function highlightMinRegion(c,h){var g=jt(c),m=0,b=c.svg_.selectAll(g).selectAll("[ecl]");b.style("fill","white"),b.filter("[ecl='"+m+"']").each(function(g){g.properties.id===h&&src_select(this).style("fill",c.hoverColor_)})}(k,b)}).on("mouseout",function(){legend_choropleth_unhighlightRegions(k)}).attr("class","em-legend-label em-legend-label-min").attr("x",it).attr("y",ht).attr("dy","0.3em").text(lt)}}if(h.pointOfDivergenceLabel)for(var dt=0;dt<E;dt++){var pt=dt*h.shapeHeight+I;dt==h.pointOfDivergence&&drawDivergingLine(c,pt,h)}}(c,w),w.noData){var S=c.getNumberOfClasses(c)*w.shapeHeight+legend_discrete_getTitlePadding(c)+3;w.pointOfDivergence&&w.pointOfDivergencePadding&&(S+=w.pointOfDivergencePadding);var M=c._discreteLegendContainer.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(0,",").concat(S,")")),k=c.getHighlightFunction(c.map),T=c.getUnHighlightFunction(c.map);c.appendNoDataLegend(M,w.noDataText,k,T)}}function legend_discrete_getTitlePadding(c){var h="ps"==c.map._mapType?c.colorLegend.titlePadding:c.titlePadding||0;return c.maxMin&&(h+=10),h}function drawDivergingLine(c,h,g){var m,b,w,S=c._discreteLegendContainer.append("g").attr("class","em-legend-divergence-container");"ranges"==g.labelType&&(h+=g.pointOfDivergencePadding/2);var M=c._discreteLegendContainer.selectAll(".em-legend-label").filter(function(){return!this.classList.contains("em-legend-label-max")&&!this.classList.contains("em-legend-label-min")}).nodes().reduce(function(c,h){return Math.max(c,h.getBBox().width)},0),k=c.divergingLineLength||c.shapeWidth+(null===(m=c.labelOffsets)||void 0===m?void 0:m.x)+M+(null===(b=c.labelOffsets)||void 0===b?void 0:b.x)+15;S.append("line").attr("x1",0).attr("y1",h).attr("x2",0+k).attr("y2",h).attr("class","em-legend-diverging-line");var T=c.pointOfDivergenceLabel.split("|");if(T.length>1){var E=c.divergingArrowLength||30,I=0+k;S.append("defs").append("marker").attr("id","arrowhead").attr("markerWidth",6).attr("markerHeight",6).attr("refX",0).attr("refY",3).attr("orient","auto").append("polygon").attr("points","0 0, ".concat(6," ").concat(3,", 0 ").concat(6)).attr("fill","black"),S.append("line").attr("class","em-legend-diverging-line").attr("x1",I).attr("y1",h).attr("x2",I).attr("y2",h-E).attr("marker-end","url(#arrowhead)"),S.append("line").attr("class","em-legend-diverging-line").attr("x1",I).attr("y1",h).attr("x2",I).attr("y2",h+E).attr("marker-end","url(#arrowhead)"),S.append("text").attr("class","em-legend-label").attr("x",I+10).attr("y",h-E+10).attr("dy","0.3em").text(T[0]),S.append("text").attr("class","em-legend-label").attr("x",I+10).attr("y",h+E-10).attr("dy","0.3em").text(T[1])}else S.append("text").attr("class","em-legend-diverging-label em-legend-label").attr("x",0+k+5).attr("y",h).attr("dy","0.3em").text(c.pointOfDivergenceLabel);"thresholds"!=c.labelType&&"thresholds"!=(null===(w=c.colorLegend)||void 0===w?void 0:w.labelType)||(T.length>1?c._discreteLegendContainer.selectAll(".em-legend-label-divergence").attr("x",0+k+10):c._discreteLegendContainer.selectAll(".em-legend-label-divergence").remove())}function legend_choropleth_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function legend_choropleth_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return legend_choropleth_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?legend_choropleth_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function legend_choropleth_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function legend_choropleth_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function legend_choropleth_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?legend_choropleth_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):legend_choropleth_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}var qs=function legend(c,h){var g=wl(c);if(g.labelType="thresholds",g.sepLineLength=g.shapeWidth,g.tickLength=4,g.decimals=0,g.labelOffsets={x:3,y:0},g.labels=null,g.histogram=null,g.pointOfDivergenceLabel=void 0,g.pointOfDivergence=void 0,g.pointOfDivergencePadding=7,g.divergingLineLength=void 0,g.divergingArrowLength=void 0,g.lowLabel="Low",g.highLabel="High",g.ticks=0,g.tickValues=void 0,g.tickLabels=void 0,g.orientation="vertical",h)for(var m in h)"histogram"===m&&"object"===_typeof(h[m])?g.histogram=legend_choropleth_objectSpread({orientation:"horizontal",showCounts:!1,showPercentages:!1,labelRotation:0},h.histogram):g[m]=h[m];return g.update=function(){if(g.updateConfig(),g.updateContainer(),g.lgg.node()){var c=g.map;if(g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle(),!c.classToFillStyle())return;g.pointOfDivergenceLabel&&!g.pointOfDivergence&&(g.pointOfDivergence=c.numberOfClasses_/2);var h=g.getBaseY(),m=g.getBaseX();if(g.histogram?Gs(g,m,h):"continuous"===c.colorSchemeType_?createContinuousLegend(g,m,h):drawDiscreteLegend(g,m,h),c.opacityScale_){var b=g.lgg.node().getBBox().height+10;!function createAlphaLegend(c,h,g){var m,b=c.map,w=b.statData("alpha");if(w&&w.isReady()){var S=b.opacityScale_,M=S.domain()[0],k=S.domain()[1],T=getChoroplethLabelFormatter(c);c._alphaLegendContainer=c.lgg.append("g").attr("class","alpha-legend-container").attr("transform","translate(".concat(h,",").concat(g,")"));for(var E=0;E<40;E++){var I=M+(k-M)*E/40;c._alphaLegendContainer.append("rect").attr("x",3*E).attr("y",0).attr("width",3).attr("height",10).style("fill","#000").style("opacity",S(I))}c._alphaLegendContainer.append("text").attr("x",0).attr("y",22).attr("class","em-legend-label").text(T(M)),c._alphaLegendContainer.append("text").attr("x",120).attr("y",22).attr("text-anchor","end").attr("class","em-legend-label").text(T(k)),c._alphaLegendContainer.append("text").attr("x",60).attr("y",-5).attr("text-anchor","middle").attr("class","em-legend-label").text((null===(m=w.unitText)||void 0===m?void 0:m.call(w))||"Transparency")}}(g,m,h+b)}if(g.map.patternFill_){var w=g.lgg.node().getBBox().height,S=g.lgg.append("g").attr("class","pattern-fill-legend").attr("transform","translate(".concat(g.getBaseX(),", ").concat(w+g.boxPadding+5,")"));appendPatternFillLegend(g,S)}g.setBoxDimension()}},g.labelDecNb=function(c){return console.warn("labelDecNb is now DEPRECATED. Please use decimals instead."),g},g};function getThresholds(c){var h=c.map,g=h.thresholds_.length>1?h.thresholds_:Array.from({length:h.numberOfClasses_}).map(function(g,m){return h.classifier().invertExtent(m)[c.ascending?0:1]}).slice(1);return g}function getChoroplethLabelFormatter(c){var h=c.getColorStats(c),g="number"==typeof c.decimals?c.decimals:function detectDatasetPrecision(c){if(null==c||!c.getArray)return 0;var h=c.getArray().filter(function(c){return Number.isFinite(c)});if(!h.length)return 0;var g,m=0,b=legend_choropleth_createForOfIteratorHelper(h);try{for(b.s();!(g=b.n()).done;){var w=g.value.toString();if(w.includes(".")){var S=w.split(".")[1].length;m=Math.max(m,S)}}}catch(c){b.e(c)}finally{b.f()}return m}(h),m=_t(".".concat(g,"f"));if("ranges"==c.labelType){var b=getThresholds(c);return c.labelFormatter||function defaultLabeller(c,h){return 0===h?"> ".concat(m(b[b.length-1])):h===b.length?"< ".concat(m(b[0])):"".concat(m(b[b.length-h-1])," - < ").concat(m(b[b.length-h]))}}return c.labelFormatter||function(c){return Ft(m(c))}}function legend_choropleth_highlightRegions(c,h){var g=jt(c),m=c.svg_.selectAll(g).selectAll("[ecl]");m.style("fill","white"),m.filter("[ecl='"+h+"']").each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}function legend_choropleth_unhighlightRegions(c){var h=jt(c);c.svg_.selectAll(h).selectAll("[ecl]").each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}function node_modules_d3_shape_src_constant(c){return function constant(){return c}}const Ws=Math.PI,Hs=2*Ws,Us=1e-6,Ys=Hs-Us;function path_append(c){this._+=c[0];for(let h=1,g=c.length;h<g;++h)this._+=arguments[h]+c[h]}class path_Path{constructor(c){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==c?path_append:function path_appendRound(c){let h=Math.floor(c);if(!(h>=0))throw new Error(`invalid digits: ${c}`);if(h>15)return path_append;const g=10**h;return function(c){this._+=c[0];for(let h=1,m=c.length;h<m;++h)this._+=Math.round(arguments[h]*g)/g+c[h]}}(c)}moveTo(c,h){this._append`M${this._x0=this._x1=+c},${this._y0=this._y1=+h}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(c,h){this._append`L${this._x1=+c},${this._y1=+h}`}quadraticCurveTo(c,h,g,m){this._append`Q${+c},${+h},${this._x1=+g},${this._y1=+m}`}bezierCurveTo(c,h,g,m,b,w){this._append`C${+c},${+h},${+g},${+m},${this._x1=+b},${this._y1=+w}`}arcTo(c,h,g,m,b){if(c=+c,h=+h,g=+g,m=+m,(b=+b)<0)throw new Error(`negative radius: ${b}`);let w=this._x1,S=this._y1,M=g-c,k=m-h,T=w-c,E=S-h,I=T*T+E*E;if(null===this._x1)this._append`M${this._x1=c},${this._y1=h}`;else if(I>Us)if(Math.abs(E*M-k*T)>Us&&b){let P=g-w,L=m-S,B=M*M+k*k,z=P*P+L*L,j=Math.sqrt(B),D=Math.sqrt(I),N=b*Math.tan((Ws-Math.acos((B+I-z)/(2*j*D)))/2),R=N/D,G=N/j;Math.abs(R-1)>Us&&this._append`L${c+R*T},${h+R*E}`,this._append`A${b},${b},0,0,${+(E*P>T*L)},${this._x1=c+G*M},${this._y1=h+G*k}`}else this._append`L${this._x1=c},${this._y1=h}`;else;}arc(c,h,g,m,b,w){if(c=+c,h=+h,w=!!w,(g=+g)<0)throw new Error(`negative radius: ${g}`);let S=g*Math.cos(m),M=g*Math.sin(m),k=c+S,T=h+M,E=1^w,I=w?m-b:b-m;null===this._x1?this._append`M${k},${T}`:(Math.abs(this._x1-k)>Us||Math.abs(this._y1-T)>Us)&&this._append`L${k},${T}`,g&&(I<0&&(I=I%Hs+Hs),I>Ys?this._append`A${g},${g},0,1,${E},${c-S},${h-M}A${g},${g},0,1,${E},${this._x1=k},${this._y1=T}`:I>Us&&this._append`A${g},${g},0,${+(I>=Ws)},${E},${this._x1=c+g*Math.cos(b)},${this._y1=h+g*Math.sin(b)}`)}rect(c,h,g,m){this._append`M${this._x0=this._x1=+c},${this._y0=this._y1=+h}h${g=+g}v${+m}h${-g}Z`}toString(){return this._}}function withPath(c){let h=3;return c.digits=function(g){if(!arguments.length)return h;if(null==g)h=null;else{const c=Math.floor(g);if(!(c>=0))throw new RangeError(`invalid digits: ${g}`);h=c}return c},()=>new path_Path(h)}const Vs=Math.abs,$s=Math.atan2,Xs=Math.cos,Ks=Math.max,Zs=Math.min,Js=Math.sin,Qs=Math.sqrt,tl=1e-12,el=Math.PI,nl=el/2,rl=2*el;function d3_shape_src_math_asin(c){return c>=1?nl:c<=-1?-nl:Math.asin(c)}Qs(3);const ol={draw(c,h){const g=Qs(h/el);c.moveTo(g,0),c.arc(0,0,g,0,rl)}},al={draw(c,h){const g=Qs(h/5)/2;c.moveTo(-3*g,-g),c.lineTo(-g,-g),c.lineTo(-g,-3*g),c.lineTo(g,-3*g),c.lineTo(g,-g),c.lineTo(3*g,-g),c.lineTo(3*g,g),c.lineTo(g,g),c.lineTo(g,3*g),c.lineTo(-g,3*g),c.lineTo(-g,g),c.lineTo(-3*g,g),c.closePath()}},il=Qs(1/3),sl=2*il,ll={draw(c,h){const g=Qs(h/sl),m=g*il;c.moveTo(0,-g),c.lineTo(m,0),c.lineTo(0,g),c.lineTo(-m,0),c.closePath()}},cl={draw(c,h){const g=Qs(h),m=-g/2;c.rect(m,m,g,g)}},ul=Js(el/10)/Js(7*el/10),hl=Js(rl/10)*ul,dl=-Xs(rl/10)*ul,pl={draw(c,h){const g=Qs(.8908130915292852*h),m=hl*g,b=dl*g;c.moveTo(0,-g),c.lineTo(m,b);for(let h=1;h<5;++h){const w=rl*h/5,S=Xs(w),M=Js(w);c.lineTo(M*g,-S*g),c.lineTo(S*m-M*b,M*m+S*b)}c.closePath()}},fl=Qs(3),gl={draw(c,h){const g=-Qs(h/(3*fl));c.moveTo(0,2*g),c.lineTo(-fl*g,-g),c.lineTo(fl*g,-g),c.closePath()}},_l=(Qs(3),-.5),ml=Qs(3)/2,vl=1/Qs(12),yl=3*(vl/2+1),Al={draw(c,h){const g=Qs(h/yl),m=g/2,b=g*vl,w=m,S=g*vl+g,M=-w,k=S;c.moveTo(m,b),c.lineTo(w,S),c.lineTo(M,k),c.lineTo(_l*m-ml*b,ml*m+_l*b),c.lineTo(_l*w-ml*S,ml*w+_l*S),c.lineTo(_l*M-ml*k,ml*M+_l*k),c.lineTo(_l*m+ml*b,_l*b-ml*m),c.lineTo(_l*w+ml*S,_l*S-ml*w),c.lineTo(_l*M+ml*k,_l*k-ml*M),c.closePath()}};function symbol_Symbol(c,h){let g=null,m=withPath(symbol);function symbol(){let b;if(g||(g=b=m()),c.apply(this,arguments).draw(g,+h.apply(this,arguments)),b)return g=null,b+""||null}return c="function"==typeof c?c:node_modules_d3_shape_src_constant(c||ol),h="function"==typeof h?h:node_modules_d3_shape_src_constant(void 0===h?64:+h),symbol.type=function(h){return arguments.length?(c="function"==typeof h?h:node_modules_d3_shape_src_constant(h),symbol):c},symbol.size=function(c){return arguments.length?(h="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),symbol):h},symbol.context=function(c){return arguments.length?(g=null==c?null:c,symbol):g},symbol}function drawCircleSizeLegend(c,h,g,m,b){var w,S,M,k,T=arguments.length>5&&void 0!==arguments[5]?arguments[5]:16;if(b){var E=Pt("em-size-legend-title");T+=E,h.append("text").attr("class","em-size-legend-title").attr("id","em-size-legend-title").attr("x",0).attr("y",E).text(b)}var I=m.domain();if(!g){var P,L=I[0],B=I[1];0===L&&null!==(P=m._values)&&void 0!==P&&P.length&&(L=Math.min.apply(Math,toConsumableArray_toConsumableArray(m._values.filter(function(c){return c>0})))),g=[B,L]}var z=m(max_max(g)),j=z,D=2*z+T,N=h.append("g").attr("transform","translate(".concat(j,",").concat(D,")")).attr("class","em-circle-size-legend").attr("id","em-circle-size-legend").attr("text-anchor","right").style("fill","black").selectAll("g").data(g.filter(function(c){return m(c)})).join("g").attr("class","em-legend-item");N.append("circle").attr("class","em-legend-circle").style("fill","none").attr("stroke","black").attr("cy",function(c){return-m(c)}).attr("r",m);var R=(null===(w=c.sizeLegend)||void 0===w?void 0:w.labelFormatter)||Ft;null!==(S=c.nodeSizeLegend)&&void 0!==S&&S.labelFormatter&&(R=c.nodeSizeLegend.labelFormatter);var G=(null===(M=c.sizeLegend)||void 0===M?void 0:M.labels)||(null===(k=c.nodeSizeLegend)||void 0===k?void 0:k.labels);return N.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("y",function(c,h){return-1-2*m(c)}).attr("x",z+5).text(function(c,h){return G&&G[h]?G[h]:R(c)}),N.append("line").style("stroke-dasharray",2).style("stroke","grey").attr("x1",2).attr("y1",function(c,h){return-1-2*m(c)}).attr("x2",z+5).attr("y2",function(c,h){return-1-2*m(c)}),c}function buildSpikeLegend(c){var h,g=c.map,m=(null===(h=c.sizeLegend)||void 0===h?void 0:h.labelFormatter)||Ft,b=g.classifierSize_.domain(),w=b[1],S=b[0],M=g.classifierSize_(w),k=c.sizeLegend.values||[w,S],T=Pt("em-legend-label"),E=c.sizeLegend.title?Pt("em-size-legend-title"):0,I=T+2,P=c._sizeLegendContainer.append("g").attr("id","em-spike-legend"),L=0;c.sizeLegend.title&&(P.append("text").attr("class","em-legend-title em-spike-legend-title").attr("id","em-size-legend-title").attr("x",0).attr("y",E).text(c.sizeLegend.title),L+=E+8);var B=k.map(function(c){return String(m(c))}),z=Math.max.apply(Math,toConsumableArray_toConsumableArray(B.map(function(c){return c.length}))),j=z*T*.45+5,D=P.append("g").attr("id","em-spike-legend-items").attr("transform","translate(".concat(c.boxPadding+T,",").concat(L+M,")")).attr("text-anchor","middle").style("font-size","".concat(T,"px")).selectAll("g").data(k).join("g").attr("transform",function(c,h){return"translate(".concat(h*j,",0)")});D.append("path").attr("d",function(c){return function spike(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.psSpikeWidth_;return"M".concat(-h/2,",0L0,").concat(-c,"L").concat(h/2,",0")}(g.classifierSize_(c))}).attr("fill",g.psFill_).attr("fill-opacity",g.psFillOpacity_).attr("stroke",g.psStroke_).attr("stroke-width",g.psStrokeWidth_),D.append("text").attr("class","em-legend-label em-spike-legend-label").attr("dy",I).text(function(c){return m(c)})}var bl={cross:al,square:cl,diamond:ll,triangle:gl,star:pl,wye:Al,circle:ol};function buildD3SymbolItem(c,h,g,m,b){var w=c.map;null==c.sizeLegend._cursorY&&(c.sizeLegend._cursorY=c.boxPadding+(c.sizeLegend.title?c.sizeLegend.titlePadding:0));var S=w.classifierSize_(w.classifierSize_.domain()[1]),M=S,k=c.sizeLegend._cursorY+c.sizeLegend.shapePadding,T=c._sizeLegendContainer.append("g").attr("class","em-size-legend-item").attr("transform","translate(".concat(M,",").concat(k,")")),E=function getShape(c){var h,g=c.map;if(g.psCustomSVG_)h=g.psCustomSVG_;else if(g.psCustomShape_)h=g.psCustomShape_;else if("bar"==g.psShape_)h=symbol_Symbol().type({draw:function drawRectangle(c,h){var m=Math.sqrt(h);c.moveTo(0,0),c.lineTo(0,m),c.lineTo(g.psBarWidth_,m),c.lineTo(g.psBarWidth_,0),c.lineTo(0,0),c.closePath()}});else{var m=bl[g.psShape_]||bl.circle;h=symbol_Symbol().type(m)}return h}(c),I=E.size(g*g)(),P=T.append("g").style("fill",w.classifierColor_?c.sizeLegend.shapeFill:w.psFill_).style("fill-opacity",w.psFillOpacity()).style("stroke",c.sizeLegend.shapeStroke||w.psStroke()).style("stroke-width",c.sizeLegend.shapeStrokeWidth||w.psStrokeWidth()).append("path").attr("d",I),L=P.node().getBBox();P.attr("transform","translate(".concat(c.sizeLegend.shapeOffsets.x,",").concat(c.sizeLegend.shapeOffsets.y+L.height/2,")"));var B=S/2+c.sizeLegend.labelOffsets.x+c.boxPadding;T.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("x",B).attr("y",L.height/2).text(b(h));var z=T.node().getBBox().height;c.sizeLegend._cursorY+=z+c.sizeLegend.shapePadding}function drawSizeLegend(c,h,g){var m=c.map;if(c._sizeLegendContainer=c.lgg.append("g").attr("class","em-size-legend-container").attr("id","em-size-legend-container").attr("transform","translate(".concat(h,",").concat(g,")")),c.sizeLegend._cursorY=null,m.psCustomSVG_||"circle"!==m.psShape_)if("spike"===m.psShape_)buildSpikeLegend(c);else{var b,w=c._sizeLegendContainer;if(c.sizeLegend.title){var S=Pt("em-size-legend-title");w.append("text").attr("class","em-legend-title em-size-legend-title").attr("id","em-size-legend-title").attr("x",0).attr("y",S).text(c.sizeLegend.title)}var M=(null===(b=c.sizeLegend)||void 0===b?void 0:b.labelFormatter)||Ft,k=m.classifierSize_.domain();m.customSymbols={nodeHeights:0},c.sizeLegend.values||(c.sizeLegend.values=[k[1],k[0]]);var T=c.sizeLegend.values.length;(!T||T<2)&&(console.warn("eurostat-map: sizeLegend.values length must be at least 2"),T=2);for(var E=1;E<T+1;E++){var I=c.sizeLegend.values[E-1],P=m.classifierSize_(I);"bar"===m.psShape_?buildBarsItem(c,I,P,E,M):"custom"===m.psShape_||m.psCustomSVG_?buildCustomSVGItem(c,I,P,E,M):buildD3SymbolItem(c,I,P,0,M)}}else drawCircleSizeLegend(c,c._sizeLegendContainer,c.sizeLegend.values,m.classifierSize_,c.sizeLegend.title,c.sizeLegend.titlePadding);c.sizeLegend.noData&&function addNoDataLegend(c){var h=c._sizeLegendContainer.node().getBBox(),g={default:20,bar:35,spike:1,circle:1,square:20},m=g[c.map.psShape_]||g.default,b=c.noDataShapeHeight,w=h.height+m+b/2,S=0,M=c._sizeLegendContainer.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(S,",").concat(w,")"));c.appendNoDataLegend(M,c.sizeLegend.noDataText,highlightPsRegions,unhighlightPsRegions)}(c)}function buildCustomSVGItem(c,h,g,m,b){var w=c.map;null==c.sizeLegend._cursorY&&(c.sizeLegend._cursorY=c.boxPadding+(c.sizeLegend.title?c.sizeLegend.titlePadding:0));var S=w.classifierSize_(w.classifierSize_.domain()[1]),M=c.boxPadding+S,k=c.sizeLegend._cursorY,T=c._sizeLegendContainer.append("g").attr("class","em-size-legend-item").attr("transform","translate(".concat(M,",").concat(k,")")),E=T.append("g").attr("class","em-size-legend-symbol").style("fill",w.classifierColor_?c.sizeLegend.shapeFill:w.psFill_).style("fill-opacity",w.psFillOpacity()).style("stroke",c.sizeLegend.shapeStroke||w.psStroke()).style("stroke-width",c.sizeLegend.shapeStrokeWidth||w.psStrokeWidth()).append("g").html(w.psCustomSVG_).attr("transform","scale(".concat(g,")")),I=E.node().getBBox();E.attr("transform","translate(".concat(-I.x-I.width/2,",").concat(-I.y-I.height/2,") scale(").concat(g,")"));var P=M+w.classifierSize_(w.classifierSize_.domain()[0])+c.sizeLegend.labelOffsets.x;T.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("x",P).attr("y",0).text(b(h));var L=T.node().getBBox().height;c.sizeLegend._cursorY+=L+c.sizeLegend.shapePadding}function buildBarsItem(c,h,g,m,b){var w=c.map;null==c.sizeLegend._cursorY&&(c.sizeLegend._cursorY=c.boxPadding+(c.sizeLegend.title?c.sizeLegend.titlePadding:0));var S=c.boxPadding,M=c.sizeLegend._cursorY+c.sizeLegend.shapePadding,k=function legend_symbol_size_getShape(c){var h,g=c.map;if(g.psCustomSVG_)h=g.psCustomSVG_;else if(g.psCustomShape_)h=g.psCustomShape_;else if("bar"==g.psShape_){var m=function drawRectangle(c,h){var m=Math.sqrt(h);c.moveTo(0,0),c.lineTo(0,m),c.lineTo(g.psBarWidth_,m),c.lineTo(g.psBarWidth_,0),c.lineTo(0,0),c.closePath()};h=symbol_Symbol().type({draw:m})}else{var b=bl[g.psShape_]||bl.circle;h=symbol_Symbol().type(b)}return h}(c),T=k.size(g*g)(),E=c._sizeLegendContainer.append("g").attr("class","em-size-legend-item").attr("transform","translate(".concat(S,",").concat(M,")"));E.append("g").style("fill",w.classifierColor_?c.sizeLegend.shapeFill:w.psFill_).style("fill-opacity",w.psFillOpacity()).style("stroke",c.sizeLegend.shapeStroke?c.sizeLegend.shapeStroke:w.psStroke()).style("stroke-width",c.sizeLegend.shapeStrokeWidth||w.psStrokeWidth()).append("path").attr("d",T).attr("transform","translate(".concat(c.sizeLegend.shapeOffsets.x,",").concat(c.sizeLegend.shapeOffsets.y,")"));var I=S+w.psBarWidth_+c.sizeLegend.labelOffsets.x,P=g/2+c.sizeLegend.labelOffsets.y;E.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("x",I).attr("y",P).text(b(h));var L=E.node().getBBox().height;c.sizeLegend._cursorY+=L+c.sizeLegend.shapePadding}function highlightPsRegions(c,h){var g=c.getCentroidsGroup(c).selectAll("[ecl]");g.each(function(c,h){src_select(this).style("opacity","0")}),g.filter("[ecl='"+h+"']").each(function(h,g){src_select(this).style("opacity",c.psFillOpacity_)})}function unhighlightPsRegions(c){c.getCentroidsGroup(c).selectAll("[ecl]").each(function(h,g){src_select(this).style("opacity",c.psFillOpacity_)})}var xl=function legend(c,h){var g=wl(c);if(g.sizeLegend={title:null,titlePadding:15,values:void 0,cellNb:3,shapePadding:15,shapeOffsets:{x:0,y:0},shapeFill:"white",shapeStroke:null,shapeStrokeWidth:null,labelOffsets:{x:10,y:0},decimals:0,labelFormatter:void 0,labels:null,noData:!1,noDataText:"No data",_totalBarsHeight:0,_totalD3SymbolsHeight:0},g.colorLegend={title:null,titlePadding:10,marginTop:30,shapeWidth:25,shapeHeight:20,shapePadding:1,labelOffsets:{x:5,y:0},decimals:0,labelFormatter:void 0,labelType:"thresholds",labels:null,noData:!0,noDataText:"No data",sepLineLength:24,sepLineStroke:"black",sepLineStrokeWidth:1,tickLength:5,pointOfDivergenceLabel:void 0,pointOfDivergence:void 0,pointOfDivergencePadding:7,divergingLineLength:void 0,divergingArrowLength:void 0},h)for(var m in h)if("colorLegend"==m||"sizeLegend"==m){for(var b in g[m])void 0!==h[m][b]&&(g[m][b]=h[m][b]);0==h.colorLegend&&(g.colorLegend=!1)}else g[m]=h[m];return g.update=function(){if(g.updateConfig(),g.updateContainer(),g.lgg.node()){g.lgg.selectAll("*").remove(),g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle(),g.sizeLegend._totalBarsHeight=0,g.sizeLegend._totalD3SymbolsHeight=0;var h=g.getBaseY(),m=g.getBaseX();if(c.classifierSize_&&drawSizeLegend(g,m,h),c.classifierColor_&&g.colorLegend){var b=m,w=h;g._sizeLegendContainer&&(w+=g._sizeLegendContainer.node().getBBox().height+g.colorLegend.marginTop),drawDiscreteLegend(g,b,w)}if(g.map.patternFill_){var S=g.lgg.node().getBBox().height,M=g.lgg.append("g").attr("class","pattern-fill-legend").attr("transform","translate(".concat(m,", ").concat(S+g.boxPadding+5,")"));appendPatternFillLegend(g,M)}g.setBoxDimension()}},g};function getPropSymbolColorLabelFormatter(c){if("ranges"==c.colorLegend.labelType){var h=function getColorThresholds(c){var h=c.map,g=h.psThresholds_.length>1?h.psThresholds_:Array.from({length:h.psClasses_}).map(function(g,m){return h.classifier().invertExtent(m)[c.ascending?0:1]}).slice(1);return g}(c);return c.colorLegend.labelFormatter||function defaultLabeller(g,m){var b=_t(".".concat(c.decimals,"f"));return 0===m?"> ".concat(b(h[h.length-1])):m===h.length?"< ".concat(b(h[0])):"".concat(b(h[h.length-m-1])," - < ").concat(b(h[h.length-m])," ")}}return c.colorLegend.labelType,c.colorLegend.labelFormatter||_t(".".concat(c.decimals,"f"))}function legend_proportional_symbols_highlightPsSymbols(c,h){var g=c.getCentroidsGroup(c).selectAll("[ecl]");g.each(function(c,h){src_select(this).style("opacity","0")}),g.filter("[ecl='"+h+"']").each(function(h,g){src_select(this).style("opacity",c.psFillOpacity_)})}function legend_proportional_symbols_unhighlightPsSymbols(c){c.getCentroidsGroup(c).selectAll("[ecl]").each(function(h,g){src_select(this).style("opacity",c.psFillOpacity_)})}var wl=function legend(c){var h={};function deepMergeExistingKeys(c,h){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},m=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new WeakSet,b=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,w=g.maxDepth||100;if(m.has(c))return c;if(m.add(c),b>w)return console.warn("Max recursion depth (".concat(w,") reached.")),c;for(var S in h)if(h.hasOwnProperty(S)&&c.hasOwnProperty(S)){var M=h[S],k=c[S];"function"==typeof M?c[S]=M:isPlainObject(M)&&isPlainObject(k)?deepMergeExistingKeys(k,M,g,m,b+1):Array.isArray(M)&&Array.isArray(k)?c[S]=g.mergeArrays?toConsumableArray_toConsumableArray(new Set([].concat(toConsumableArray_toConsumableArray(k),toConsumableArray_toConsumableArray(M)))):toConsumableArray_toConsumableArray(M):M instanceof Date?c[S]=new Date(M.getTime()):M instanceof RegExp?c[S]=new RegExp(M):M instanceof Map?c[S]=new Map(M):M instanceof Set?c[S]=new Set(M):c[S]=M}return c}function isPlainObject(c){return"[object Object]"===Object.prototype.toString.call(c)}return h.map=c,h.svgId="em-legend-container-"+Math.round(1e5*Math.random()),h.svg=void 0,h.lgg=void 0,h.x=void 0,h.y=void 0,h.boxPadding=7,h.boxOpacity=.7,h.title="",h.titleFontSize=Pt("em-legend-title"),h.width=150,h.titlePadding=5,h.shapeWidth=25,h.shapeHeight=20,h.shapePadding=5,h.labelFontSize=Pt("em-legend-label"),h.labelOffsets={x:5,y:5},h.labelFormatter=null,defaultLocale({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),h.noData=!0,h.noDataText="No data",h.noDataPadding=5,h.noDataShapeWidth=25,h.noDataShapeHeight=20,h.ascending=!0,h.decimals=void 0,h.maxMin=!0,h.maxMinLabels=["",""],h.build=function(){h.svg=src_select("#"+h.svgId),h.svg.selectAll("*").remove(),h.lgg=h.svg.attr("class","em-legend")},h.update=function(){return console.log("Legend update function not implemented"),h},h.updateContainer=function(){var c=h.map,g=h.lgg,m=h.svg;if(g.selectAll("*").remove(),c&&g&&(!m||m.attr("id")!==c.legend_.svgId)&&h.build(),(null!=h.x||null!=h.y)&&g){var b,w,S=null!==(b=h.x)&&void 0!==b?b:c.width()-h.width-h.boxPadding,M=null!==(w=h.y)&&void 0!==w?w:h.boxPadding;g.attr("transform","translate(".concat(S,",").concat(M,")"))}},h.updateConfig=function(){var c=h.map;c.legend_&&deepMergeExistingKeys(h,c.legend_)},h.makeBackgroundBox=function(){h.lgg.append("rect").attr("id","em-legend-background").attr("class","em-legend-background").style("opacity",h.boxOpacity)},h.addTitle=function(){if(h.title){var c=h.lgg.append("g").attr("id","em-legend-titles"),g=Pt("em-legend-title");c.append("text").attr("class","em-legend-title").attr("x",h.boxPadding).attr("y",h.boxPadding+g).text(h.title)}},h.addSubtitle=function(){if(h.subtitle){var c=h.lgg.select("#em-legend-titles"),g=Pt("em-legend-title"),m=Pt("em-legend-subtitle");c.append("text").attr("class","em-legend-subtitle").attr("x",h.boxPadding).attr("y",h.boxPadding+g+m+3).html(h.subtitle)}},h.getBaseY=function(){return h.boxPadding+(h.title?Pt("em-legend-title"):0)+(h.subtitle?Pt("em-legend-subtitle"):0)+10},h.getBaseX=function(){return h.boxPadding},h.setBoxDimension=function(){if(h.lgg.node()){var c=h.lgg.node().getBBox({stroke:!0}),g=h.boxPadding;h.svg.select("#em-legend-background").attr("x",c.x-g).attr("y",c.y-g).attr("width",c.width+2*g).attr("height",c.height+2*g)}},h.appendNoDataLegend=function(c,g,m,b){var w=h.map;c.append("rect").attr("class","em-legend-rect").style("fill",w.noDataFillStyle()).attr("y",h.noDataPadding).attr("width",h.noDataShapeWidth).attr("height",h.noDataShapeHeight).on("mouseover",function(){m(w,"nd"),w.insetTemplates_&&Bt(w.insetTemplates_,w.svgId,m,"nd")}).on("mouseout",function(){b(w),w.insetTemplates_&&Bt(w.insetTemplates_,w.svgId,b,"nd")}),c.append("text").attr("class","em-legend-label em-legend-label-no-data").attr("dy","0.35em").attr("x",h.noDataShapeWidth+5).attr("y",h.noDataShapeHeight/2+h.noDataPadding).style("pointer-events","all").style("cursor","pointer").on("mouseover",function(){m(w,"nd"),w.insetTemplates_&&Bt(w.insetTemplates_,w.svgId,m,"nd")}).on("mouseout",function(){b(w),w.insetTemplates_&&Bt(w.insetTemplates_,w.svgId,b,"nd")}).text(g)},h.getNumberOfClasses=function(c){var h=c.map;return"ps"===h._mapType?h.psClasses_:h.numberOfClasses_},h.getLabelFormatter=function(c){return"ps"===c.map._mapType?getPropSymbolColorLabelFormatter(c):getChoroplethLabelFormatter(c)},h.getClassToFillStyle=function(c){var h=c.map;return"ps"===h._mapType?h.psClassToFillStyle_:h.classToFillStyle_},h.getColorClassifier=function(c){var h=c.map;return"ps"===h._mapType?h.classifierColor_:h.classifier_},h.getColorStats=function(c){var h=c.map;return"ps"===h._mapType?h.statData("color"):h.statData()},h.getHighlightFunction=function(c){return"ps"==c._mapType?legend_proportional_symbols_highlightPsSymbols:legend_choropleth_highlightRegions},h.getUnHighlightFunction=function(c){return"ps"==c._mapType?legend_proportional_symbols_unhighlightPsSymbols:legend_choropleth_unhighlightRegions},h},Cl=function tooltip(c){var h,g,tooltip;function my(){tooltip=src_select("#"+c.id),tooltip.empty()&&(tooltip=src_select("body").append("div").attr("id",c.id)),tooltip.attr("class","em-tooltip")}return(c=c||{}).containerId=c.containerId||c.svgId||"map",c.id=c.id||"em-tooltip-".concat(c.containerId),c.offset={x:(null===(h=c.offset)||void 0===h?void 0:h.x)||c.xOffset||30,y:(null===(g=c.offset)||void 0===g?void 0:g.y)||c.yOffset||20},c.transitionDuration=0,c.opacity=c.opacity||1,my.mouseover=function(h){if(tooltip.html(h),h){var g=event.pageX,m=event.pageY;my.ensureTooltipOnScreen(g,m),tooltip.interrupt().transition().duration(c.transitionDuration).style("opacity",c.opacity)}},my.mousemove=function(c){var h=c.pageX,g=c.pageY;this.ensureTooltipOnScreen(h,g)},my.mouseout=function(){tooltip.interrupt().transition().duration(c.transitionDuration).style("opacity",0)},my.style=function(c,h){return 1==arguments.length?tooltip.style(c):(tooltip.style(c,h),my)},my.attr=function(c,h){return 1==arguments.length?tooltip.attr(c):(tooltip.attr(c,h),my)},my.ensureTooltipOnScreen=function(h,g){var m=tooltip.node();m.style.left=h+c.offset.x+"px",m.style.top=g-c.offset.y+"px";var b=document.getElementById(c.containerId).getBoundingClientRect(),w=b.width,S=b.height;if(m.offsetLeft>b.left+w-m.clientWidth){var M=h-m.clientWidth-c.offset.x;if(m.style.left=M+"px",m.offsetLeft+m.clientWidth>h){var k=h-m.clientWidth-c.offset.x;m.style.left=k+"px"}}m.offsetTop+m.clientHeight>b.top+S&&(m.style.top=m.offsetTop-m.clientHeight+"px")},my(),my},Sl="em-loading-overlay";function showSpinner(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Loading…",g=function createOverlay(c){if(!c)return null;var h=c.querySelector("#".concat(Sl));return h||((h=document.createElement("div")).id=Sl,h.classList.add("is-hidden"),h.setAttribute("aria-hidden","true"),h.innerHTML='\n <div class="em-spinner-stack" role="status" aria-live="polite">\n <div class="em-loading-spinner" aria-hidden="true"></div>\n <div class="em-loading-label">Loading…</div>\n </div>\n ',c.appendChild(h),h)}(c);if(g){var m=g.querySelector(".em-loading-label");m&&(m.textContent=h),g.classList.remove("is-hidden"),g.setAttribute("aria-hidden","false")}}var Ml=function statMap(c,h,g){var m=zs(c,h,g);m._geoDone_=!1,m._statDone_=!1,m._finalized_=!1;var b=function tryFinalize(){m._finalized_||m._geoDone_&&m._statDone_&&(m._finalized_=!0,m.callback()&&m.callback()(m))},w=!1;if(m._loadingStatCount_=0,m.stat_={default:void 0},m.stat=function(c,h){return arguments.length?2==arguments.length?(m.stat_[c]=h,m):"string"==typeof c||c instanceof String?m.stat_[c]:(m.stat_=c.default?c:{default:c},m):m.stat_.default},m.statData_={default:Ds(),color:Ds(),size:Ds(),v1:Ds(),v2:Ds(),v3:Ds()},m.statData=function(c,h){return arguments.length?1===arguments.length?(m.statData_[c]||(m.statData_[c]=Ds()),m.statData_[c]):(m.statData_[c]=h,m):m.statData_.default},m.noDataText_="No data available",m.language_="en",m.transitionDuration_=500,m.tooltip_.textFunction=void 0,m.filtersDefinitionFunction_=void 0,m.callback_=void 0,m.legend_=void 0,m.legendObj_=void 0,["legend_","legendObj_","noDataText_","language_","transitionDuration_","tooltipText_","filtersDefinitionFunction_","callback_"].forEach(function(c){m[c.substring(0,c.length-1)]=function(h){return arguments.length?(m[c]=h,m):m[c]}}),c)for(var S in c)m[S]&&null!=c[S]&&m[S](c[S]);m.legend=function(c){if(!arguments.length)return m.legend_;if(0==c){var h=m.legendObj();if(h){var g=src_select("#"+h.svgId);g.size()>0&&g.selectAll("*").remove()}return m.legend_=c,m}return m.legend_=c,m.legendObj_&&m.updateLegend(),m},m.updateLegend=function(c){return m.legendObj_&&m.legendObj().update(),m},m.build=function(){return m._geoDone_=!1,m._statDone_=!1,m._finalized_=!1,w=!1,m.projectionFunction_&&m.proj("4326"),m.buildMapTemplateBase(),m.filtersDefinitionFunction_&&m.filtersDefinitionFunction_(m.svg(),m.numberOfClasses_),m.legend()&&m.buildLegend(),m.tooltip_||m.tooltip_||(m.tooltip_={id:m.svgId()}),m._tooltip=Cl(m.tooltip_),m.updateGeoData(),m.updateStatData(),m},m.updateLoader=function(){if(!m.isInset){if(!m._wrapper_){var c,h,g=null===(c=m.svg)||void 0===c?void 0:c.call(m);if(!g||g.empty())return;m._wrapper_=null!==(h=g.node().parentNode)&&void 0!==h&&null!==(h=h.classList)&&void 0!==h&&h.contains("em-map-wrapper")?g.node().parentNode:null}m._wrapper_&&(m._loadingGeo_||m._loadingStatCount_>0?showSpinner(m._wrapper_,"Loading…"):function hideSpinner(c){if(c){var h=c.querySelector("#".concat(Sl));h&&(h.classList.add("is-hidden"),h.setAttribute("aria-hidden","true"))}}(m._wrapper_))}},m.buildLegend=function(){m.legendObj(m.getLegendConstructor()(m,m.legend()));var c=m.legendObj();if(0==src_select("#"+c.svgId).size()){null==c.x?(m.width(),c.boxPadding):c.x,null==c.y?c.boxPadding:c.y;m.svg().append("g").attr("id",c.svgId).attr("class","em-legend")}c.build()};var M=function isStatDataReady(){for(var c in m.statData_){var h=!!m.stat_[c],g=!(!m.statData_[c]||!m.statData_[c].get());if((h||g)&&!m.statData_[c].isReady())return!1}return!0};function escapeHtml(c){return c.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}return m.updateGeoData=function(){return m._loadingGeo_=!0,m.updateLoader(),m.updateGeoMapTemplate(function(){m._loadingGeo_=!1,m.updateLoader(),m.Geometries.isGeoReady()&&(m._geoDone_=!0,M()&&(m._statDone_=!0,m.updateStatValues()),b())}),m},m.updateStatData=function(){var c=function _loop(){var c,g,S=m.stat(h),k=null===(c=(g=m.statData(h)).get)||void 0===c?void 0:c.call(g);if(!S&&!k)return 1;if(S){var T=Ds(S);m.statData(h,T);var E=!!T.eurostatDatasetCode_||!!T.csvURL_;E&&(m._loadingStatCount_++,m.updateLoader());var I=m.nutsLevel_;"mixed"===I&&(I=0),T.retrieveFromRemote(I,m.language(),function(){E&&(m._loadingStatCount_=Math.max(0,m._loadingStatCount_-1),m.updateLoader()),M()&&(m._statDone_=!0,m.Geometries.isGeoReady()&&(w?b():(w=!0,Promise.resolve().then(function(){w=!1,m.updateStatValues(),b()}))))})}};for(var h in m.stat_)c();return m},m.updateStatValues=function(){return h&&(m.insetTemplates_&&Bt(m.insetTemplates_,m.svgId_,m.refreshCentroids),m.refreshCentroids(m)),m.updateClassification(),m.updateStyle(),m.legend_&&m.legendObj()&&m.legendObj().update(),m},m.updateClassification=function(){return console.log("Map updateClassification function not implemented"),m},m.updateStyle=function(){return console.log("Map updateStyle function not implemented"),m},m.getLegendConstructor=function(){return console.log("Map getLegendConstructor function not implemented"),wl},m.getTime=function(){return m.statData("default").getTime()},m.setFromURL=function(){var c=kl();return c.w&&m.width(c.w),c.h&&m.height(c.h),c.x&&c.y&&m.geoCenter([c.x,c.y]),c.z&&m.pixelSize(c.z),c.s&&m.scale(c.s),c.lvl&&m.nutsLevel(c.lvl),c.time&&(m.filters_.time=c.time,delete m.filters_.lastTimePeriod),c.proj&&m.proj(c.proj),c.geo&&m.geo(c.geo),c.ny&&m.nutsYear(c.ny),c.language&&m.language(c.language),c.numberOfClasses&&m.numberOfClasses(+c.numberOfClasses),m},m.exportMapToSVG=function(){var c=m.svg_.node().cloneNode(!0);c.hasAttribute("xmlns")||c.setAttribute("xmlns","http://www.w3.org/2000/svg"),c.hasAttribute("xmlns:xlink")||c.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),document.body.appendChild(c),applyComputedStylesToSVG(c),ensureSvgSize(c),document.body.removeChild(c);var h=function getDownloadURL(c){var h='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'+c.outerHTML;h=h.replace(/ /g," ").replace(/©/g,"©").replace(/®/g,"®").replace(/×/g,"×").replace(/°/g,"°");var g=new Blob([h],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(g)}(c),g=document.createElement("a");return g.href=h,g.download="eurostatmap.svg",document.body.appendChild(g),g.click(),document.body.removeChild(g),m},m.exportMapToPNG=function(){var c=_asyncToGenerator(It().mark(function _callee(c,h){var g,b,w,S,M,k,T,E,I,P,L,B,z;return It().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:if((g=m.svg_.node().cloneNode(!0)).hasAttribute("xmlns")||g.setAttribute("xmlns","http://www.w3.org/2000/svg"),g.hasAttribute("xmlns:xlink")||g.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),document.body.appendChild(g),!document.fonts||!document.fonts.ready){j.next=4;break}return j.prev=1,j.next=2,document.fonts.ready;case 2:j.next=4;break;case 3:j.prev=3,z=j.catch(1),console.warn("document.fonts.ready failed",z);case 4:return applyComputedStylesToSVG(g),ensureSvgSize(g),g.querySelector("rect[data-export-background]")||(b=g.getAttribute("width")||g.viewBox.baseVal.width||g.getBoundingClientRect().width,w=g.getAttribute("height")||g.viewBox.baseVal.height||g.getBoundingClientRect().height,(S=document.createElementNS("http://www.w3.org/2000/svg","rect")).setAttribute("x",0),S.setAttribute("y",0),S.setAttribute("width",String(b)),S.setAttribute("height",String(w)),S.setAttribute("fill","#ffffff"),S.setAttribute("data-export-background","true"),g.insertBefore(S,g.firstElementChild)),M=new XMLSerializer,k=M.serializeToString(g),document.body.removeChild(g),T=new Blob([k],{type:"image/svg+xml;charset=utf-8"}),E=URL.createObjectURL(T),I=Math.round(c||parseFloat(g.getAttribute("width"))||800),P=Math.round(h||parseFloat(g.getAttribute("height"))||600),(L=new Image).crossOrigin="anonymous",B=function cleanup(c){try{URL.revokeObjectURL(E)}catch(c){}if(c)try{URL.revokeObjectURL(c)}catch(c){}},L.onload=function(){try{var c=document.createElement("canvas");c.width=I,c.height=P;var h=c.getContext("2d");h.fillStyle="#ffffff",h.fillRect(0,0,I,P),h.drawImage(L,0,0,I,P),c.toBlob(function(c){if(!c)return console.error("canvas.toBlob returned null — likely CORS/taint issue."),window.open().document.write("<pre>"+escapeHtml(k)+"</pre>"),void B();var h=URL.createObjectURL(c),g=document.createElement("a");g.href=h,g.download="eurostat-map.png",document.body.appendChild(g),g.click(),document.body.removeChild(g),B(h)},"image/png")}catch(c){console.error("Error drawing SVG to canvas:",c),window.open().document.write("<pre>"+escapeHtml(k)+"</pre>"),B()}},L.onerror=function(c){console.error("Image failed to load for export. Likely CORS or invalid SVG. Error:",c),window.open().document.write("<pre>"+escapeHtml(k)+"</pre>"),B()},L.src=E,j.abrupt("return",m);case 5:case"end":return j.stop()}},_callee,null,[[1,3]])}));return function(h,g){return c.apply(this,arguments)}}(),m},kl=function getURLParameters(){for(var c={},h=["w","h","x","y","z","s","lvl","time","proj","geo","ny","language","sl","numberOfClasses"],g=0;g<h.length;g++)c[h[g]]=getURLParameterByName(h[g]);return c};function numericSort(c){return c.slice().sort(function(c,h){return c-h})}function makeMatrix(c,h){for(var g=[],m=0;m<c;m++){for(var b=[],w=0;w<h;w++)b.push(0);g.push(b)}return g}function ssq(c,h,g,m){var b;if(c>0){var w=(g[h]-g[c-1])/(h-c+1);b=m[h]-m[c-1]-(h-c+1)*w*w}else b=m[h]-g[h]*g[h]/(h+1);return b<0?0:b}function fillMatrixColumn(c,h,g,m,b,w,S){if(!(c>h)){var M=Math.floor((c+h)/2);m[g][M]=m[g-1][M-1],b[g][M]=M;var k=g;c>g&&(k=Math.max(k,b[g][c-1]||0)),k=Math.max(k,b[g-1][M]||0);var T,E,I,P=M-1;h<m[0].length-1&&(P=Math.min(P,b[g][h+1]||0));for(var L=P;L>=k&&!((T=ssq(L,M,w,S))+m[g-1][k-1]>=m[g][M]);--L)(E=ssq(k,M,w,S)+m[g-1][k-1])<m[g][M]&&(m[g][M]=E,b[g][M]=k),k++,(I=T+m[g-1][L-1])<m[g][M]&&(m[g][M]=I,b[g][M]=L);fillMatrixColumn(c,M-1,g,m,b,w,S),fillMatrixColumn(M+1,h,g,m,b,w,S)}}function ckmeans(c,h){if(h>c.length)throw new Error("cannot generate more classes than there are data values");var g=numericSort(c),m=function uniqueCountSorted(c){for(var h,g=0,m=0;m<c.length;m++)0!==m&&c[m]===h||(h=c[m],g++);return g}(g);if(1===m)return[g];var b=makeMatrix(h,g.length),w=makeMatrix(h,g.length);!function fillMatrices(c,h,g){for(var m=h[0].length,b=c[Math.floor(m/2)],w=[],S=[],M=0,k=void 0;M<m;++M)k=c[M]-b,0===M?(w.push(k),S.push(k*k)):(w.push(w[M-1]+k),S.push(S[M-1]+k*k)),h[0][M]=ssq(0,M,w,S),g[0][M]=0;for(var T=1;T<h.length;++T)fillMatrixColumn(T<h.length-1?T:m-1,m-1,T,h,g,w,S)}(g,b,w);for(var S=[],M=w[0].length-1,k=w.length-1;k>=0;k--){var T=w[k][M];S[k]=g.slice(T,M+1),k>0&&(M=T-1)}return S}function jenks(c,h){if(h>c.length)return null;c=c.slice().sort(function(c,h){return c-h});var g=function jenksMatrices(c,h){var g,m,b=[],w=[],S=0;for(g=0;g<c.length+1;g++){var M=[],k=[];for(m=0;m<h+1;m++)M.push(0),k.push(0);b.push(M),w.push(k)}for(g=1;g<h+1;g++)for(b[1][g]=1,w[1][g]=0,m=2;m<c.length+1;m++)w[m][g]=Number.POSITIVE_INFINITY;for(var T=2;T<c.length+1;T++){for(var E=0,I=0,P=0,L=0,B=1;B<T+1;B++){var z=T-B+1,j=c[z-1];if(S=(I+=j*j)-(E+=j)*E/++P,0!=(L=z-1))for(m=2;m<h+1;m++)w[T][m]>=S+w[L][m-1]&&(b[T][m]=z,w[T][m]=S+w[L][m-1])}b[T][1]=1,w[T][1]=S}return{lowerClassLimits:b,varianceCombinations:w}}(c,h);return function jenksBreaks(c,h,g){var m=c.length,b=[],w=g;for(b[g]=c[c.length-1];w>0;)b[w-1]=c[h[m][w]-1],m=h[m][w]-1,w--;return b}(c,g.lowerClassLimits,h)}var Tl=function BayesianClassifier(){this.totalCount=0,this.data={}};Tl.prototype.train=function train(c,h){for(var g in this.data[h]||(this.data[h]={}),c){var m=c[g];void 0===this.data[h][g]&&(this.data[h][g]={}),void 0===this.data[h][g][m]&&(this.data[h][g][m]=0),this.data[h][g][m]++}this.totalCount++},Tl.prototype.score=function score(c){var h,g={};for(var m in c){var b=c[m];for(h in this.data)g[h]={},this.data[h][m]?g[h][m+"_"+b]=(this.data[h][m][b]||0)/this.totalCount:g[h][m+"_"+b]=0}var w={};for(h in g)for(var S in w[h]=0,g[h])w[h]+=g[h][S];return w};var El=function PerceptronModel(){this.weights=[],this.bias=0};El.prototype.predict=function predict(c){if(c.length!==this.weights.length)return null;for(var h=0,g=0;g<this.weights.length;g++)h+=this.weights[g]*c[g];return(h+=this.bias)>0?1:0},El.prototype.train=function train(c,h){if(0!==h&&1!==h)return null;c.length!==this.weights.length&&(this.weights=c,this.bias=1);var g=this.predict(c);if("number"==typeof g&&g!==h){for(var m=h-g,b=0;b<this.weights.length;b++)this.weights[b]+=m*c[b];this.bias+=m}return this};Math.log(Math.sqrt(2*Math.PI));Math.sqrt(2*Math.PI);var Il=Math.sqrt(2*Math.PI);function cumulativeDistribution(c){for(var h=c,g=c,m=1;m<15;m++)h+=g*=c*c/(2*m+1);return Math.round(1e4*(.5+h/Il*Math.exp(-c*c/2)))/1e4}for(var Pl=[],Ll=0;Ll<=3.09;Ll+=.01)Pl.push(cumulativeDistribution(Ll));function applyPatternFill(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(Array.isArray(h)){var g=c.svg().select("defs");g.empty()&&(g=c.svg().append("defs"));var m={};h.forEach(function(h){var b,w=h.pattern,S=void 0===w?"hatching":w,M=h.regionIds,k=void 0===M?[]:M,T=h.color,E=void 0===T?"#000":T,I=h.strokeWidth,P=void 0===I?1:I,L=h.customPattern,B=h.spacing;if(L){var z=L.match(/id=['"]([^'"]+)['"]/);if(!z)return void console.warn("customPattern must include an id attribute.");b=z[1],c.svg().select("#".concat(b)).empty()&&g.node().insertAdjacentHTML("beforeend",L)}else{var j=E.replace("#","").toLowerCase();b="".concat(S,"-").concat(j,"-sw").concat(P),function definePattern(c,h,g,m,b){var w=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8,S=c.svg().select("defs");if(c.svg().select("#".concat(CSS.escape(h))).empty()){var M=S.append("pattern").attr("id",h).attr("patternUnits","userSpaceOnUse").attr("width",w).attr("height",w);"hatching"===g?M.append("path").attr("d","M-".concat(w/8,",").concat(w/8," l").concat(w/4,",-").concat(w/4," M0,").concat(w," l").concat(w,",-").concat(w," M").concat(w-w/8,",").concat(w+w/8," l").concat(w/4,",-").concat(w/4)).attr("stroke",m).attr("stroke-width",b):"crosshatch"===g?M.append("path").attr("d","M0,0 l".concat(w,",").concat(w," M").concat(w,",0 l-").concat(w,",").concat(w)).attr("stroke",m).attr("stroke-width",b):"dots"===g?M.append("circle").attr("cx",w/2).attr("cy",w/2).attr("r",b).attr("fill",m):(console.warn('Unknown pattern "'.concat(g,'", defaulting to hatching.')),M.append("path").attr("d","M-".concat(w/8,",").concat(w/8," l").concat(w/4,",-").concat(w/4," M0,").concat(w," l").concat(w,",-").concat(w," M").concat(w-w/8,",").concat(w+w/8," l").concat(w/4,",-").concat(w/4)).attr("stroke",m).attr("stroke-width",b))}}(c,b,S,E,P,B)}h.patternId=b,k.forEach(function(c){m[c]||(m[c]=[]),m[c].push(b)})}),c.svg().selectAll(zt(c)).each(function(c){var h,g=this,b=null==c||null===(h=c.properties)||void 0===h?void 0:h.id,w=m[b];if(w&&w.length){var S=src_select(this);w.forEach(function(c){var h=S.node().cloneNode(!0);src_select(h).attr("fill","url(#".concat(c,")")).attr("pointer-events","none").attr("class",(S.attr("class")||"")+"pattern-fill-overlay"),src_select(g.parentNode).append(function(){return h})})}})}else console.warn("patternFill expects an array of configs")}var Fl=function map(c){var h=Ml(c,!1,"ch");h.numberOfClasses_=7,h.classificationMethod_="quantile",h.thresholds_=[0],h.colors_=null,h.makeClassifNice_=!0;var g=["#D4DAF0","#C1C9EB","#A8B4E6","#93A2DC","#7C90D6","#677CD2","#5169BE","#3C57B0","#2644A7","#15246B"];h.colorFunction_=function(c){return function piecewise(c,h){void 0===h&&(h=c,c=value);for(var g=0,m=h.length-1,b=h[0],w=new Array(m<0?0:m);g<m;)w[g]=c(b,b=h[++g]);return function(c){var h=Math.max(0,Math.min(m-1,Math.floor(c*=m)));return w[h](c-h)}}(lab_lab,g)(Math.min(Math.max(0,c),1))},h.classToFillStyle_=void 0,h.classifier_=void 0,h.tooltip_.textFunction=zl,h.colorSchemeType_="discrete",h.valueTransform_=function(c){return c},h.valueUntransform_=function(c){return c},h.skipNormalization_=!1,h.pointOfDivergence_=null;var m=["numberOfClasses_","classificationMethod_","thresholds_","makeClassifNice_","colorFunction_","classToFillStyle_","noDataFillStyle_","classifier_","colors_","colorFunction_","colorSchemeType_","valueTransform_","valueUntransform_","pointOfDivergence_","skipNormalization_"];function applyClassificationToMap(c){var g=function generateRange(c){return toConsumableArray_toConsumableArray(Array(c).keys())},m=h.statData().getArray();if(m){var b=function classifyRegions(c){c.attr("ecl",function(c){var g=h.statData().get(c.properties.id);if(g){var m=g.value;return":"===m||null===m?"nd":"continuous"===h.colorSchemeType_?m:null!=m?+h.classifier_(m):void 0}})};if(function setupClassifier(){var c=g(h.numberOfClasses_);if("continuous"===h.colorSchemeType_){var b=h.valueTransform_||function(c){return c};if(h.skipNormalization_)h.domain_=null;else{var w,S=m.map(b),M=min_min(S),k=max_max(S),T=function checkIfDiverging(c){return null!==c.pointOfDivergence_}(h);if(!("function"==typeof(null===(w=h.colorFunction_)||void 0===w?void 0:w.domain)))if(T){var E,I=b(null!==(E=h.pointOfDivergence_)&&void 0!==E?E:0);h.domain_=[M,I,k]}else h.domain_=[M,k]}h.classifier(function(c){return c})}var P=toConsumableArray_toConsumableArray(m).filter(function(c){return!isNaN(parseFloat(c))&&isFinite(c)});switch(h.classificationMethod_){case"quantile":h.classifier(quantile_quantile().domain(m).range(c));break;case"equal-interval":case"equinter":h.classifier(quantize().domain([min_min(m),max_max(m)]).range(c)),h.makeClassifNice_&&h.classifier().nice();break;case"threshold":h.numberOfClasses(h.thresholds_.length+1),h.classifier(threshold().domain(h.thresholds_).range(g(h.numberOfClasses_)));break;case"jenks":var L=jenks(P,h.numberOfClasses_).slice(1,-1);h.classifier(threshold().domain(L).range(c));break;case"ckmeans":var B=ckmeans(P,h.numberOfClasses_).map(function(c){return c.pop()}).slice(0,-1);h.classifier(threshold().domain(B).range(c))}}(),c.svg_){var w=zt(c);if(b(c.svg().selectAll(w)),"mixed"===c.nutsLevel_)b(c.svg().selectAll("path.em-nutsrg0"))}}}function applyStyleToMap(c){if(h.filtersDefinitionFunction_?h.classToFillStyle(Ol()):h.classToFillStyle(Bl(h.colorFunction_,h.colors_)),c.svg_){var g=zt(c),m=c.svg().selectAll(g);m.style("pointer-events","none").transition().duration(h.transitionDuration()).style("fill",w).end().then(function(){m.style("pointer-events",null),m.each(function(){var c=src_select(this);c.attr("fill___",c.style("fill"))}),S(c,m),h.gridCartogram_&&c.svg().selectAll(".em-grid-text").each(function(){var c=src_select(this.parentNode).style("fill");src_select(this).attr("fill",Ot(c))})}).catch(function(c){}),"mixed"===h.nutsLevel_&&b(c),h.labels_&&h.labels_.values&&h.updateValuesLabels(c),h.patternFill_&&applyPatternFill(c,h.patternFill_)}}m.forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&m.forEach(function(g){var m=g.slice(0,-1);null!=c[m]&&h[m](c[m])}),h.colorFunction=function(c){if(!arguments.length)return h.colorFunction_;if(h.colorFunction_=c,h.filtersDefinitionFunction_)h.classToFillStyle(Ol());else{var g=Bl(h.colorFunction_,h.colors_,h.colorSchemeType_);h.classToFillStyle(g)}return h},h.threshold=function(c){return arguments.length?(h.thresholds_=c,h.numberOfClasses(c.length+1),h):h.thresholds_},h.filtersDefinitionFunction=function(c){return arguments.length?(h.filtersDefinitionFunction_=c,h.svg()&&h.filtersDefinitionFunction_(h.svg(),h.numberOfClasses_),h):h.filtersDefinitionFunction_},h.updateClassification=function(){try{return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyClassificationToMap),applyClassificationToMap(h),h}catch(c){console.error("Error in updateClassification:",c.message),console.error(c)}},h.updateStyle=function(){try{return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyStyleToMap),applyStyleToMap(h),h}catch(c){console.error("Error in updateStyle:",c.message),console.error(c)}},h.getLegendConstructor=function(){return qs};var b=function styleMixedNUTS(c){c.svg().selectAll(zt(c)).each(function(){if(!this.parentNode.classList.contains("em-cntrg")){var c=src_select(this),h=c.attr("ecl"),g=c.attr("lvl"),m=h||"0"===g;if(c.style("display",m?"block":"none"),h&&"0"!==g){var b=c.style("stroke")||"#777",w=c.style("stroke-width")||.2;c.style("stroke",b).style("stroke-width",w)}}})};var w=function regionsFillFunction(c){var g,m=src_select(this).attr("ecl"),b=h.colorSchemeType_||"discrete";if(m||"0"===m)return"nd"===m?h.noDataFillStyle_||"gray":h.filtersDefinitionFunction_?h.classToFillStyle_(m):"continuous"===b?function getContinuousColor(c,h){var g=h.colorFunction_,m=h.valueTransform_||function(c){return c},b=m(c);if(isNaN(b))return h.noDataFillStyle_||"gray";if(h.skipNormalization_)return g(Math.min(Math.max(b,0),1));var w,S=h.domain_||[0,1];if("function"==typeof(null==g?void 0:g.domain))return g(b);if(3===S.length){var M,k=slicedToArray_slicedToArray(S,3),T=k[0],E=k[2],I=m(null!==(M=h.pointOfDivergence_)&&void 0!==M?M:0);w=b<I?.5*(b-T)/(I-T):.5+.5*(b-I)/(E-I)}else{var P=slicedToArray_slicedToArray(S,2),L=P[0];w=(b-L)/(P[1]-L)}return g(Math.min(Math.max(w,0),1))}(+m,h):null!==(g=h.Geometries)&&void 0!==g&&g.userGeometries?h.classToFillStyle_(m,h.numberOfClasses_||1):"WORLD"===h.geo_?h.classToFillStyle_(m,h.numberOfClasses_||1)||h.cntrgFillStyle_:h.classToFillStyle_(m,h.numberOfClasses_||1)},S=function addMouseEventsToRegions(c,g){var m=function shouldOmit(h){var g;return null===(g=c.tooltip_.omitRegions)||void 0===g?void 0:g.includes(h)};g.on("mouseover",function(g,b){m(b.properties.id)||(src_select(this).style("fill",c.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(b,h)),h.onRegionMouseOver_&&h.onRegionMouseOver_(g,b,this,c))}).on("mousemove",function(g,b){m(b.properties.id)||(h._tooltip&&h._tooltip.mousemove(g),h.onRegionMouseMove_&&h.onRegionMouseMove_(g,b,this,c))}).on("mouseout",function(g,b){if(!m(b.properties.id)){var w=src_select(this);w.style("fill",w.attr("fill___")),h._tooltip&&h._tooltip.mouseout(),h.onRegionMouseOut_&&h.onRegionMouseOut_(g,b,this,c)}})};return h.highlightRegion=function(c){if(!h.svg_)return h;var g=zt(h),m=h.svg().selectAll(g).filter(function(h){return h.properties.id===c});if(!m.empty()){var b=m.datum();if(m.style("fill",h.hoverColor_||"orange"),h._tooltip){var w=h.tooltip_.textFunction(b,h);h._tooltip.mouseover(w);var S=m.node().getBBox(),M=h.__lastTransform||{x:0,y:0,k:1},k=(S.x+S.width/2)*M.k+M.x,T=(S.y+S.height/2)*M.k+M.y,E=h.svg().node().getBoundingClientRect(),I=E.left+k,P=E.top+T;h._tooltip.ensureTooltipOnScreen(I,P)}h.onRegionMouseOver_&&h.onRegionMouseOver_(null,b,m.node(),h)}return h},h.clearHighlight=function(){if(!h.svg_)return h;var c=zt(h);return h.svg().selectAll(c).each(function(){var c=src_select(this),h=c.attr("fill___");h&&c.style("fill",h)}),h._tooltip&&h._tooltip.mouseout(),h},h},Bl=function getColorFunction(c,h){return c=c||At,"continuous"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"discrete")?function(h){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,1],m=(h-g[0])/(g[1]-g[0]);return c(Math.min(Math.max(m,0),1))}:h?function(c,g){return h[c]}:function(h,g){return c(h/(g-1))}},Ol=function getFillPatternLegend(){return function(c){return"url(#pattern_"+c+")"}},zl=function choroplethTooltipFunction(c,h){if(h.tooltip_.omitRegions&&h.tooltip_.omitRegions.includes(c.properties.id))return"";var g=[],m=c.properties.na||c.properties.name,b=c.properties.id;g.push('\n <div class="em-tooltip-bar">\n <b>'.concat(m,"</b>").concat(b?" (".concat(b,")"):"","\n </div>\n "));var w=h.statData(),S=w.get(b),M=w.unitText()||"";if(!S||0!==S.value&&!S.value||":"===S.value)return g.push('\n <div class="em-tooltip-text no-data">\n <table class="em-tooltip-table">\n <tbody>\n <tr><td>'.concat(h.noDataText_,"</td></tr>\n </tbody>\n </table>\n </div>\n ")),g.join("");g.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr><td>'.concat(Ft(S.value)," ").concat(M,"</td></tr>\n </tbody>\n </table>\n </div>\n "));var k=S.status;if(k&&h.tooltip_.showFlags){var T="short"===h.tooltip_.showFlags?k:flags[k]||k;g.push(' <span class="status-flag">'.concat(T,"</span>"))}return g.join("")};const jl=ramp(new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(colors)),Dl=4294967296;function x(c){return c.x}function y(c){return c.y}var Nl=Math.PI*(3-Math.sqrt(5));function simulation(c){var h,g=1,m=.001,b=1-Math.pow(m,1/300),w=0,S=.6,M=new Map,k=timer(step),T=Ki("tick","end"),E=function lcg(){let c=1;return()=>(c=(1664525*c+1013904223)%Dl)/Dl}();function step(){tick(),T.call("tick",h),g<m&&(k.stop(),T.call("end",h))}function tick(m){var k,T,E=c.length;void 0===m&&(m=1);for(var I=0;I<m;++I)for(g+=(w-g)*b,M.forEach(function(c){c(g)}),k=0;k<E;++k)null==(T=c[k]).fx?T.x+=T.vx*=S:(T.x=T.fx,T.vx=0),null==T.fy?T.y+=T.vy*=S:(T.y=T.fy,T.vy=0);return h}function initializeNodes(){for(var h,g=0,m=c.length;g<m;++g){if((h=c[g]).index=g,null!=h.fx&&(h.x=h.fx),null!=h.fy&&(h.y=h.fy),isNaN(h.x)||isNaN(h.y)){var b=10*Math.sqrt(.5+g),w=g*Nl;h.x=b*Math.cos(w),h.y=b*Math.sin(w)}(isNaN(h.vx)||isNaN(h.vy))&&(h.vx=h.vy=0)}}function initializeForce(h){return h.initialize&&h.initialize(c,E),h}return null==c&&(c=[]),initializeNodes(),h={tick,restart:function(){return k.restart(step),h},stop:function(){return k.stop(),h},nodes:function(g){return arguments.length?(c=g,initializeNodes(),M.forEach(initializeForce),h):c},alpha:function(c){return arguments.length?(g=+c,h):g},alphaMin:function(c){return arguments.length?(m=+c,h):m},alphaDecay:function(c){return arguments.length?(b=+c,h):+b},alphaTarget:function(c){return arguments.length?(w=+c,h):w},velocityDecay:function(c){return arguments.length?(S=1-c,h):1-S},randomSource:function(c){return arguments.length?(E=c,M.forEach(initializeForce),h):E},force:function(c,g){return arguments.length>1?(null==g?M.delete(c):M.set(c,initializeForce(g)),h):M.get(c)},find:function(h,g,m){var b,w,S,M,k,T=0,E=c.length;for(null==m?m=1/0:m*=m,T=0;T<E;++T)(S=(b=h-(M=c[T]).x)*b+(w=g-M.y)*w)<m&&(k=M,m=S);return k},on:function(c,g){return arguments.length>1?(T.on(c,g),h):T.on(c)}}}function d3_force_src_constant(c){return function(){return c}}function src_x(c){var h,g,m,b=d3_force_src_constant(.1);function force(c){for(var b,w=0,S=h.length;w<S;++w)(b=h[w]).vx+=(m[w]-b.x)*g[w]*c}function initialize(){if(h){var w,S=h.length;for(g=new Array(S),m=new Array(S),w=0;w<S;++w)g[w]=isNaN(m[w]=+c(h[w],w,h))?0:+b(h[w],w,h)}}return"function"!=typeof c&&(c=d3_force_src_constant(null==c?0:+c)),force.initialize=function(c){h=c,initialize()},force.strength=function(c){return arguments.length?(b="function"==typeof c?c:d3_force_src_constant(+c),initialize(),force):b},force.x=function(h){return arguments.length?(c="function"==typeof h?h:d3_force_src_constant(+h),initialize(),force):c},force}function src_y(c){var h,g,m,b=d3_force_src_constant(.1);function force(c){for(var b,w=0,S=h.length;w<S;++w)(b=h[w]).vy+=(m[w]-b.y)*g[w]*c}function initialize(){if(h){var w,S=h.length;for(g=new Array(S),m=new Array(S),w=0;w<S;++w)g[w]=isNaN(m[w]=+c(h[w],w,h))?0:+b(h[w],w,h)}}return"function"!=typeof c&&(c=d3_force_src_constant(null==c?0:+c)),force.initialize=function(c){h=c,initialize()},force.strength=function(c){return arguments.length?(b="function"==typeof c?c:d3_force_src_constant(+c),initialize(),force):b},force.y=function(h){return arguments.length?(c="function"==typeof h?h:d3_force_src_constant(+h),initialize(),force):c},force}function add_add(c,h,g,m){if(isNaN(h)||isNaN(g))return c;var b,w,S,M,k,T,E,I,P,L=c._root,B={data:m},z=c._x0,j=c._y0,D=c._x1,N=c._y1;if(!L)return c._root=B,c;for(;L.length;)if((T=h>=(w=(z+D)/2))?z=w:D=w,(E=g>=(S=(j+N)/2))?j=S:N=S,b=L,!(L=L[I=E<<1|T]))return b[I]=B,c;if(M=+c._x.call(null,L.data),k=+c._y.call(null,L.data),h===M&&g===k)return B.next=L,b?b[I]=B:c._root=B,c;do{b=b?b[I]=new Array(4):c._root=new Array(4),(T=h>=(w=(z+D)/2))?z=w:D=w,(E=g>=(S=(j+N)/2))?j=S:N=S}while((I=E<<1|T)==(P=(k>=S)<<1|M>=w));return b[P]=L,b[I]=B,c}function quad(c,h,g,m,b){this.node=c,this.x0=h,this.y0=g,this.x1=m,this.y1=b}function defaultX(c){return c[0]}function defaultY(c){return c[1]}function quadtree(c,h,g){var m=new Quadtree(null==h?defaultX:h,null==g?defaultY:g,NaN,NaN,NaN,NaN);return null==c?m:m.addAll(c)}function Quadtree(c,h,g,m,b,w){this._x=c,this._y=h,this._x0=g,this._y0=m,this._x1=b,this._y1=w,this._root=void 0}function leaf_copy(c){for(var h={data:c.data},g=h;c=c.next;)g=g.next={data:c.data};return h}var Rl=quadtree.prototype=Quadtree.prototype;function jiggle(c){return 1e-6*(c()-.5)}function collide_x(c){return c.x+c.vx}function collide_y(c){return c.y+c.vy}function collide(c){var h,g,m,b=1,w=1;function force(){for(var c,S,M,k,T,E,I,P=h.length,L=0;L<w;++L)for(S=quadtree(h,collide_x,collide_y).visitAfter(prepare),c=0;c<P;++c)M=h[c],E=g[M.index],I=E*E,k=M.x+M.vx,T=M.y+M.vy,S.visit(apply);function apply(c,h,g,w,S){var P=c.data,L=c.r,B=E+L;if(!P)return h>k+B||w<k-B||g>T+B||S<T-B;if(P.index>M.index){var z=k-P.x-P.vx,j=T-P.y-P.vy,D=z*z+j*j;D<B*B&&(0===z&&(D+=(z=jiggle(m))*z),0===j&&(D+=(j=jiggle(m))*j),D=(B-(D=Math.sqrt(D)))/D*b,M.vx+=(z*=D)*(B=(L*=L)/(I+L)),M.vy+=(j*=D)*B,P.vx-=z*(B=1-B),P.vy-=j*B)}}}function prepare(c){if(c.data)return c.r=g[c.data.index];for(var h=c.r=0;h<4;++h)c[h]&&c[h].r>c.r&&(c.r=c[h].r)}function initialize(){if(h){var m,b,w=h.length;for(g=new Array(w),m=0;m<w;++m)b=h[m],g[b.index]=+c(b,m,h)}}return"function"!=typeof c&&(c=d3_force_src_constant(null==c?1:+c)),force.initialize=function(c,g){h=c,m=g,initialize()},force.iterations=function(c){return arguments.length?(w=+c,force):w},force.strength=function(c){return arguments.length?(b=+c,force):b},force.radius=function(h){return arguments.length?(c="function"==typeof h?h:d3_force_src_constant(+h),initialize(),force):c},force}function dorling_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function dorling_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function dorling_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return dorling_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?dorling_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function dorling_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function runDorlingSimulation(c,h){var g=function runSim(g){var m,b,w,S,M,k=g.Geometries.centroidsFeatures||[];if(k.length){stopDorlingSimulation(g);var T,E=null!==(m=null===(b=g.dorlingStrength_)||void 0===b?void 0:b.x)&&void 0!==m?m:1,I=null!==(w=null===(S=g.dorlingStrength_)||void 0===S?void 0:S.y)&&void 0!==w?w:1,P=null!==(M=g.dorlingIterations_)&&void 0!==M?M:1,L=!1!==g.dorlingWorker_,B=g.dorlingWorkerD3URL_||"https://unpkg.com/d3@7/dist/d3.min.js",z=dorling_createForOfIteratorHelper(k);try{for(z.s();!(T=z.n()).done;){var j,D=T.value,N=null===(j=g._projection)||void 0===j?void 0:j.call(g,D.geometry.coordinates);N?(D.x=N[0],D.y=N[1]):(D.x=NaN,D.y=NaN)}}catch(c){z.e(c)}finally{z.f()}var R=c.getCentroidsGroup(g).selectAll("g.em-centroid"),G=function tickTransform(c){c.attr("transform",function(c){return!c||isNaN(c.x)||isNaN(c.y)?null:"translate(".concat(c.x,",").concat(c.y,")")})};if(!1===g.animateDorling_){if(L){console.log("Running Dorling simulation asynchronously in a Web Worker");var q=new Worker(new URL(__webpack_require__.p+__webpack_require__.u(215),__webpack_require__.b),{type:void 0});return q.postMessage({nodes:k.map(function(c){return function dorling_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?dorling_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):dorling_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}({},c)}),radii:k.map(function(c){return h(c)}),strengthX:E,strengthY:I,iterations:P,d3URL:B}),void(q.onmessage=function(c){var h=c.data,m=h.type,b=h.nodes,w=h.progress,S=h.total;"progress"!==m?"end"===m&&b&&(k.forEach(function(c,h){c.x=b[h].x,c.y=b[h].y}),G(R),updateDorlingProgress(1,g),q.terminate()):updateDorlingProgress(w/S,g)})}for(var W=simulation(k).force("x",src_x(function(c){return c.properties.centroid[0]}).strength(E)).force("y",src_y(function(c){return c.properties.centroid[1]}).strength(I)).force("collide",collide(function(c){return h(c)}).iterations(P)).stop(),H=Math.ceil(Math.log(W.alphaMin())/Math.log(1-W.alphaDecay())),U=0;U<H;U++)W.tick(),U%10==0&&G(R);return G(R),updateDorlingProgress(1,g),W}return g.simulation=simulation(k).force("x",src_x(function(c){return c.properties.centroid[0]}).strength(E)).force("y",src_y(function(c){return c.properties.centroid[1]}).strength(I)).force("collide",collide(function(c){return h(c)}).iterations(P)).on("tick",function(){return G(R)}),g.simulation}};g(c),c.insetTemplates_&&Bt(c.insetTemplates_,c.svgId_,function(c){g(c)})}function updateDorlingProgress(c,h){h.onDorlingProgress_&&h.onDorlingProgress_(c,h)}function stopDorlingSimulation(c){c.simulation&&(c.simulation.stop(),c.simulation.on("tick",null),c.simulation=null)}function transformPow(c){return function(h){return h<0?-Math.pow(-h,c):Math.pow(h,c)}}function transformSqrt(c){return c<0?-Math.sqrt(-c):Math.sqrt(c)}function transformSquare(c){return c<0?-c*c:c*c}function powish(c){var h=c(continuous_identity,continuous_identity),g=1;return h.exponent=function(h){return arguments.length?(g=+h,function rescale(){return 1===g?c(continuous_identity,continuous_identity):.5===g?c(transformSqrt,transformSquare):c(transformPow(g),transformPow(1/g))}()):g},linearish(h)}function pow_pow(){var c=powish(transformer());return c.copy=function(){return copy(c,pow_pow()).exponent(c.exponent())},initRange.apply(c,arguments),c}function pow_sqrt(){return pow_pow.apply(null,arguments).exponent(.5)}function createSqrtScale(){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,g=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(Number).filter(function(c){return Number.isFinite(c)&&c>0}),m=max_max(g),b=min_min(g);(!Number.isFinite(m)||m<=0)&&(m=1),(!Number.isFinite(b)||b<=0)&&(b=m);var w=Math.max(0,h),S=pow_sqrt().domain([0,m]).range([0,c]).clamp(!0);function scale(c){var h=+c;return!Number.isFinite(h)||h<=0?0:Math.max(w,S(h))}return scale.domain=function(){return[b,m]},scale.maxSize=function(){return c},scale.minSize=function(){return w},scale.baseScale=function(){return S},scale}function defineClassifiers(c){!function defineSizeClassifier(c){var h,g,m,b,w=null!==(h=null!==(g=null===(m=c.statData("size"))||void 0===m?void 0:m.getArray())&&void 0!==g?g:null===(b=c.statData())||void 0===b?void 0:b.getArray())&&void 0!==h?h:[],S="spike"===c.psShape_||"bar"===c.psShape_||"line"===c.psShape_,M=S?function createLinearScale(){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,g=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(Number).filter(function(c){return Number.isFinite(c)&&c>0}),m=max_max(g),b=min_min(g);(!Number.isFinite(m)||m<=0)&&(m=1),(!Number.isFinite(b)||b<=0)&&(b=m);var w=Math.max(0,h),S=linear_linear().domain([0,m]).range([0,c]).clamp(!0);function scale(c){var h=+c;return!Number.isFinite(h)||h<=0?0:Math.max(w,S(h))}return scale.domain=function(){return[b,m]},scale.maxSize=function(){return c},scale.minSize=function(){return w},scale.baseScale=function(){return S},scale}(w,c.psMaxSize_,c.psMinSize_||0):createSqrtScale(w,c.psMaxSize_,c.psMinSize_||0);c.classifierSize(M)}(c),c.statData("color").getArray()&&function defineColorClassifier(c){var h=function getA(c){return toConsumableArray_toConsumableArray(Array(c).keys())};if("quantile"===c.psClassificationMethod_){var g=c.statData("color").getArray(),m=h(c.psClasses_);c.classifierColor(quantile_quantile().domain(g).range(m))}else if("equinter"===c.psClassificationMethod_){var b=c.statData("color").getArray(),w=h(c.psClasses_);c.classifierColor(quantize().domain([min(b),max(b)]).range(w)),c.makeClassifNice_&&c.classifierColor().nice()}else if("threshold"===c.psClassificationMethod_){c.psClasses(c.psThresholds().length+1);var S=h(c.psClasses_);c.classifierColor(threshold().domain(c.psThresholds()).range(S))}}(c)}function applyClassificationToMap(c,h){if(null!=c&&c.svg_){var g=c.classifierColor_||(null==h?void 0:h.classifierColor_);if("function"==typeof g){var m=c.statData("color");m&&c.svg_.selectAll(".em-centroid").attr("ecl",function(c){var h=m.get(c.properties.id);if(!h)return"nd";var b=h.value;return 0!==b&&!b||":"===b?"nd":+g(+b)})}}}function updateBackgroundColor(c,h){var g=color_color(h||"#ffffff"),m=g?g.formatHex():"#ffffff",b=c.svgId_||"",w=function getBackgroundColor(c,h){return function brightenHex(c,h){var g=h;c=c.replace(/^#/,""),3===c.length&&(c=c.split("").map(function(c){return c+c}).join(""));var m=parseInt(c,16),b=m>>16&255,w=m>>8&255,S=255&m;return b=Math.min(255,Math.round(b+(255-b)*g)),w=Math.min(255,Math.round(w+(255-w)*g)),S=Math.min(255,Math.round(S+(255-S)*g)),"#".concat((1<<24|b<<16|w<<8|S).toString(16).slice(1))}(c,h)}(m,c.psBrightenFactor_||.9);updateCSSRule("#".concat(b,".em--ps .em-nutsrg"),"fill",w)}function ps_interactions_addMouseEvents(c,h){!function clearMouseEvents(c){c.svg().selectAll("g.em-centroid").on("mouseover",null).on("mousemove",null).on("mouseout",null),c.svg().selectAll(zt(c)).on("mouseover",null).on("mousemove",null).on("mouseout",null)}(c),ql(c,h),Gl(c,h)}Rl.copy=function(){var c,h,g=new Quadtree(this._x,this._y,this._x0,this._y0,this._x1,this._y1),m=this._root;if(!m)return g;if(!m.length)return g._root=leaf_copy(m),g;for(c=[{source:m,target:g._root=new Array(4)}];m=c.pop();)for(var b=0;b<4;++b)(h=m.source[b])&&(h.length?c.push({source:h,target:m.target[b]=new Array(4)}):m.target[b]=leaf_copy(h));return g},Rl.add=function src_add(c){const h=+this._x.call(null,c),g=+this._y.call(null,c);return add_add(this.cover(h,g),h,g,c)},Rl.addAll=function addAll(c){var h,g,m,b,w=c.length,S=new Array(w),M=new Array(w),k=1/0,T=1/0,E=-1/0,I=-1/0;for(g=0;g<w;++g)isNaN(m=+this._x.call(null,h=c[g]))||isNaN(b=+this._y.call(null,h))||(S[g]=m,M[g]=b,m<k&&(k=m),m>E&&(E=m),b<T&&(T=b),b>I&&(I=b));if(k>E||T>I)return this;for(this.cover(k,T).cover(E,I),g=0;g<w;++g)add_add(this,S[g],M[g],c[g]);return this},Rl.cover=function cover(c,h){if(isNaN(c=+c)||isNaN(h=+h))return this;var g=this._x0,m=this._y0,b=this._x1,w=this._y1;if(isNaN(g))b=(g=Math.floor(c))+1,w=(m=Math.floor(h))+1;else{for(var S,M,k=b-g||1,T=this._root;g>c||c>=b||m>h||h>=w;)switch(M=(h<m)<<1|c<g,(S=new Array(4))[M]=T,T=S,k*=2,M){case 0:b=g+k,w=m+k;break;case 1:g=b-k,w=m+k;break;case 2:b=g+k,m=w-k;break;case 3:g=b-k,m=w-k}this._root&&this._root.length&&(this._root=T)}return this._x0=g,this._y0=m,this._x1=b,this._y1=w,this},Rl.data=function src_data(){var c=[];return this.visit(function(h){if(!h.length)do{c.push(h.data)}while(h=h.next)}),c},Rl.extent=function src_extent(c){return arguments.length?this.cover(+c[0][0],+c[0][1]).cover(+c[1][0],+c[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},Rl.find=function src_find(c,h,g){var m,b,w,S,M,k,T,E=this._x0,I=this._y0,P=this._x1,L=this._y1,B=[],z=this._root;for(z&&B.push(new quad(z,E,I,P,L)),null==g?g=1/0:(E=c-g,I=h-g,P=c+g,L=h+g,g*=g);k=B.pop();)if(!(!(z=k.node)||(b=k.x0)>P||(w=k.y0)>L||(S=k.x1)<E||(M=k.y1)<I))if(z.length){var j=(b+S)/2,D=(w+M)/2;B.push(new quad(z[3],j,D,S,M),new quad(z[2],b,D,j,M),new quad(z[1],j,w,S,D),new quad(z[0],b,w,j,D)),(T=(h>=D)<<1|c>=j)&&(k=B[B.length-1],B[B.length-1]=B[B.length-1-T],B[B.length-1-T]=k)}else{var N=c-+this._x.call(null,z.data),R=h-+this._y.call(null,z.data),G=N*N+R*R;if(G<g){var q=Math.sqrt(g=G);E=c-q,I=h-q,P=c+q,L=h+q,m=z.data}}return m},Rl.remove=function src_remove(c){if(isNaN(w=+this._x.call(null,c))||isNaN(S=+this._y.call(null,c)))return this;var h,g,m,b,w,S,M,k,T,E,I,P,L=this._root,B=this._x0,z=this._y0,j=this._x1,D=this._y1;if(!L)return this;if(L.length)for(;;){if((T=w>=(M=(B+j)/2))?B=M:j=M,(E=S>=(k=(z+D)/2))?z=k:D=k,h=L,!(L=L[I=E<<1|T]))return this;if(!L.length)break;(h[I+1&3]||h[I+2&3]||h[I+3&3])&&(g=h,P=I)}for(;L.data!==c;)if(m=L,!(L=L.next))return this;return(b=L.next)&&delete L.next,m?(b?m.next=b:delete m.next,this):h?(b?h[I]=b:delete h[I],(L=h[0]||h[1]||h[2]||h[3])&&L===(h[3]||h[2]||h[1]||h[0])&&!L.length&&(g?g[P]=L:this._root=L),this):(this._root=b,this)},Rl.removeAll=function removeAll(c){for(var h=0,g=c.length;h<g;++h)this.remove(c[h]);return this},Rl.root=function src_root(){return this._root},Rl.size=function src_size(){var c=0;return this.visit(function(h){if(!h.length)do{++c}while(h=h.next)}),c},Rl.visit=function visit(c){var h,g,m,b,w,S,M=[],k=this._root;for(k&&M.push(new quad(k,this._x0,this._y0,this._x1,this._y1));h=M.pop();)if(!c(k=h.node,m=h.x0,b=h.y0,w=h.x1,S=h.y1)&&k.length){var T=(m+w)/2,E=(b+S)/2;(g=k[3])&&M.push(new quad(g,T,E,w,S)),(g=k[2])&&M.push(new quad(g,m,E,T,S)),(g=k[1])&&M.push(new quad(g,T,b,w,E)),(g=k[0])&&M.push(new quad(g,m,b,T,E))}return this},Rl.visitAfter=function visitAfter(c){var h,g=[],m=[];for(this._root&&g.push(new quad(this._root,this._x0,this._y0,this._x1,this._y1));h=g.pop();){var b=h.node;if(b.length){var w,S=h.x0,M=h.y0,k=h.x1,T=h.y1,E=(S+k)/2,I=(M+T)/2;(w=b[0])&&g.push(new quad(w,S,M,E,I)),(w=b[1])&&g.push(new quad(w,E,M,k,I)),(w=b[2])&&g.push(new quad(w,S,I,E,T)),(w=b[3])&&g.push(new quad(w,E,I,k,T))}m.push(h)}for(;h=m.pop();)c(h.node,h.x0,h.y0,h.x1,h.y1);return this},Rl.x=function d3_quadtree_src_x(c){return arguments.length?(this._x=c,this):this._x},Rl.y=function d3_quadtree_src_y(c){return arguments.length?(this._y=c,this):this._y};var Gl=function addMouseEventsToRegions(c,h){var g=c.svg().selectAll(zt(c)),m=getSizeStatData(c);g.on("mouseover",function(g,b){var w=m.get(b.properties.id);w&&void 0!==w.value&&null!==w.value&&(src_select(this).style("fill",c.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(b,h)),h.onRegionMouseOver_&&h.onRegionMouseOver_(g,b,this,c))}).on("mousemove",function(g,b){var w=m.get(b.properties.id);w&&void 0!==w.value&&null!==w.value&&(h._tooltip&&h._tooltip.mousemove(g),h.onRegionMouseMove_&&h.onRegionMouseMove_(g,b,this,c))}).on("mouseout",function(g,b){var w=m.get(b.properties.id);if(w&&void 0!==w.value&&null!==w.value){var S=src_select(this);S.style("fill",S.attr("fill___")),h._tooltip&&h._tooltip.mouseout(),h.onRegionMouseOut_&&h.onRegionMouseOut_(g,b,this,c)}})},ql=function addMouseEventsToSymbols(c,h){c.svg().selectAll("g.em-centroid").on("mouseover",function(g,m){var b=src_select(this.childNodes[0]);b.attr("fill___",b.style("fill")),b.style("fill",h.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(m,h)),h.onRegionMouseOver_&&h.onRegionMouseOver_(g,m,this,c)}).on("mousemove",function(g,m){h._tooltip&&h._tooltip.mousemove(g),h.onRegionMouseMove_&&h.onRegionMouseMove_(g,m,this,c)}).on("mouseout",function(g,m){var b=src_select(this.childNodes[0]),w=b.attr("fill___");w&&(b.style("fill",w),h._tooltip&&h._tooltip.mouseout()),h.onRegionMouseOut_&&h.onRegionMouseOut_(g,m,this,c)})};function appendSpikesToMap(c,h,g){var m=c.svg().selectAll("g.em-centroid").append("path").attr("d",function(c){var m=h.get(c.properties.id),b=function spike(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.psSpikeWidth_;return"M".concat(-h/2,",0L0,").concat(-c,"L").concat(h/2,",0")}(m?g.classifierSize_(+m.value):0);return b}).style("fill",function(c){return c.color||"steelblue"}).attr("fill-opacity",c.psFillOpacity_).attr("stroke",c.psStroke_).attr("stroke-width",c.psStrokeWidth_);return m}var Wl=function map(c){var h=Ml(c,!0,"ps");h.psShape_="circle",h.psCustomShape_,h.psCustomSVG_,h.psSpikeWidth_=7,h.psOffset_={x:0,y:0},h.psMaxSize_=30,h.psMinSize_=5,h.psBarWidth_=10,h.psMaxValue_=void 0,h.psMinValue_=void 0,h.psSizeScale_=void 0,h.psFill_="#009569",h.psFillOpacity_=1,h.psStroke_="#ffffff",h.psStrokeWidth_=.2,h.psStrokeOpacity_=1,h.psClasses_=5,h.psColors_=null,h.psColorFun_=jl,h.psClassToFillStyle_=void 0,h.psBrightenFactor_=.9,h.psThresholds_=[0],h.psClassificationMethod_="quantile",h.makeClassifNice_=!0,h.classifierSize_=void 0,h.classifierColor_=void 0,h.tooltip_.textFunction=Ul,h.psCodeLabels_=!1;var g=["psMaxSize_","psMinSize_","psMaxValue_","psMinValue_","psFill_","psFillOpacity_","psStrokeOpacity_","psStroke_","psStrokeWidth_","classifierSize_","classifierColor_","psShape_","psCustomShape_","psBarWidth_","psClassToFillStyle_","psColorFun_","psSizeScale_","noDataFillStyle_","psThresholds_","psColors_","psCustomSVG_","psOffset_","psClassificationMethod_","psClasses_","dorling_","dorlingStrength_","dorlingIterations_","animateDorling_","psSpikeWidth_","psCodeLabels_","psBrightenFactor_"];function applyStyleToMap(c){updateBackgroundColor(c,h.psFill_),h.psClassToFillStyle()||h.psClassToFillStyle(Hl(h.psColorFun_,h.psColors_));var g=getSizeStatData(c);if(c.svg_){var w,S;c.svg_.selectAll(":not(#em-insets-group) g.em-centroid > *").remove(),h.updateSymbolsDrawOrder(c),S=h.psCustomSVG_?function appendCustomSymbolsToMap(c,h,g){return c.getCentroidsGroup(c).selectAll("g.em-centroid").append("g").filter(function(c){var g=h.get(c.properties.id);if(g&&":"!==g.value)return c}).attr("class","ps").html(g.psCustomSVG_).attr("transform",function(c){var m=h.get(c.properties.id),b=g.classifierSize_(+m.value);if(b)return"translate(".concat(g.psOffset_.x*b,",").concat(g.psOffset_.y*b,") scale(").concat(b,")")})}(c,g,h):"bar"==h.psShape_?function appendBarsToMap(c,h,g){return c.getCentroidsGroup(c).selectAll("g.em-centroid").append("rect").filter(function(c){var g=h.get(c.properties.id);if(g&&":"!==g.value)return c}).attr("width",g.psBarWidth_).attr("height",function(c){var m=h.get(c.properties.id);return m&&m.value?g.classifierSize_(+m.value):0}).attr("transform",function(){return this.getBoundingClientRect(),"translate(".concat(-this.getAttribute("width")/2)+", -".concat(this.getAttribute("height"),")")})}(c,g,h):"circle"==h.psShape_?function appendCirclesToMap(c,h,g){c.svg().selectAll("g.em-centroid").style("pointer-events","none");var m=c.svg().selectAll("g.em-centroid").filter(function(c){var g=h.get(c.properties.id);return g&&":"!==g.value&&g.value}).append("circle").attr("stroke-width",g.psStrokeWidth_).attr("stroke",g.psStroke_).attr("fill-opacity",g.psFillOpacity_).attr("stroke-opacity",g.psStrokeOpacity_).transition().duration(g.transitionDuration_).attr("r",function(c){var m=h.get(c.properties.id),b=g.classifierSize_(+m.value);return b<0&&console.error("Negative radius for circle:",c.properties.id),isNaN(b)&&console.error("NaN radius for circle:",c.properties.id),b}).on("end",function(){src_select(this.parentNode).style("pointer-events",null)});return m}(c,g,h):"spike"==h.psShape_?appendSpikesToMap(c,g,h):function appendD3SymbolsToMap(c,h,g){return c.svg().selectAll("g.em-centroid").append("path").filter(function(c){var g=h.get(c.properties.id);if(g&&":"!==g.value)return c}).attr("class","ps").attr("d",function(c){if(h){var m=h.get(c.properties.id);if(0==m||m){var b=g.classifierSize_(+m.value)||0;if(g.psCustomShape_)return g.psCustomShape_.size(b*b)();var w=bl[g.psShape_]||bl.circle;return symbol_Symbol().type(w).size(b*b)()}}})}(c,g,h),m(c,g),function setSymbolStyles(c){c.attr("fill-opacity",h.psFillOpacity()).attr("stroke-opacity",h.psStrokeOpacity()).attr("stroke",h.psStroke()).attr("stroke-width",h.psStrokeWidth()).style("fill",function(){if(h.classifierColor_){var c=src_select(this.parentNode).attr("ecl");return c&&"nd"!==c?h.psClassToFillStyle_(c,h.psClasses_):h.noDataFillStyle_||"gray"}return h.psFill_}).attr("fill___",function(){if(h.classifierColor_){var c=src_select(this.parentNode).attr("ecl");return c&&"nd"!==c?h.psClassToFillStyle_(c,h.psClasses_):h.noDataFillStyle_||"gray"}return h.psFill_})}(S),b(c,g);var M=h.transitionDuration_||0;M>0?setTimeout(function(){ps_interactions_addMouseEvents(c,h)},M+100):ps_interactions_addMouseEvents(c,h),null!==(w=h.labels_)&&void 0!==w&&w.values&&h.updateValuesLabels(c),h.patternFill_&&applyPatternFill(c,h.patternFill_)}return c}g.forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&g.forEach(function(g){var m=g.slice(0,-1);null!=c[m]&&h[m](c[m])}),h.psColorFun=function(c){return arguments.length?(h.psColorFun_=c,h.psClassToFillStyle_=Hl(h.psColorFun_,h.psColors_),h):h.psColorFun_},h.psThresholds=function(c){return arguments.length?(h.psThresholds_=c,h.psClasses(c.length+1),h):h.psThresholds_},h.updateClassification=function(){try{return defineClassifiers(h),h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,function(c){return applyClassificationToMap(c,h)}),applyClassificationToMap(h),h}catch(c){console.error("Error in proportional symbols classification: "+c.message),console.error(c)}};var m=function setRegionStyles(c,g){var m=zt(c),b=c.svg().selectAll(m);if("WORLD"!==c.geo_){if("mixed"==c.nutsLevel_){!function styleMixedNUTSRegions(c,g,m){m.style("display",function(h){if(!this.parentNode.classList.contains("em-cntrg")){var m=g.get(h.properties.id);return!m||!m.value&&0!==m&&0!==m.value&&"0"!==m.value?"none":"WORLD"==c.geo_?"block":void 0}}),m.style("stroke",function(c){var h=src_select(this),m=h.attr("lvl"),b=h.style("stroke"),w=g.get(c.properties.id);if(w&&w.value)return"0"!==m?b||"#777":void 0}).style("stroke-width",function(c){var m=src_select(this),b=m.attr("lvl"),w=m.style("stroke-width"),S=g.get(c.properties.id);if(S&&S.value)return"WORLD"==h.geo_&&"0"!==b?w||"#777":void 0})}(c,g,b);var w=[];c.svg().selectAll("g.em-centroid").each(function(c){var h;null!==(h=c.properties)&&void 0!==h&&h.centroid&&w.push(c)}),c.Geometries.centroidsFeatures=w}b.attr("ecl",function(c){var h=g.get(c.properties.id);return!h||!h.value&&0!==h&&0!==h.value&&"0"!==h.value?"ni":h&&h.value&&":"==h.value?"nd":void 0}),b.style("fill",null),b.filter(function(c){var h=g.get(c.properties.id);return h&&":"===h.value}).style("fill",h.noDataFillStyle()).attr("fill___",h.noDataFillStyle())}},b=function appendLabelsToSymbols(c,g){var m,b=c.svg().selectAll("g.em-centroid");if(h.psCodeLabels_)b.filter(function(c){var h=g.get(c.properties.id);return":"!==(null==h?void 0:h.value)&&null!=(null==h?void 0:h.value)}).append("text").attr("class","em-circle-code-label").text(function(c){var h=g.get(c.properties.id);return":"===(null==h?void 0:h.value)?"":c.properties.id}).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","sans-serif").style("font-size",function(c){var m,b,w=g.get(c.properties.id),S=w?h.classifierSize_(+w.value):0,M=null!==(m=h.labels_)&&void 0!==m&&m.values&&null!==(b=g.get(c.properties.id))&&void 0!==b&&b.value?.8:.9;return"square"===h.psShape_&&(M-=.4),"".concat(S*M,"px")}).attr("fill",function(){var c,h=null===(c=window.getComputedStyle(this.parentNode.firstChild))||void 0===c?void 0:c.fill;return Ot(h)}).attr("dy",function(c){var m,b;return null!==(m=h.labels_)&&void 0!==m&&m.values&&null!==(b=g.get(c.properties.id))&&void 0!==b&&b.value?"-0.3em":"0"});if(null!==(m=h.labels_)&&void 0!==m&&m.values)b.filter(function(c){var h=g.get(c.properties.id);return":"!==(null==h?void 0:h.value)&&null!=(null==h?void 0:h.value)}).append("text").attr("class","em-circle-stat-label").text(function(c){var h=g.get(c.properties.id);if(null!=h&&h.value)return h.value}).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","sans-serif").style("font-size",function(c){var m=g.get(c.properties.id),b=m?h.classifierSize_(+m.value):0;return"".concat(.4*b,"px")}).attr("fill",function(){var c,g=(null===(c=window.getComputedStyle(this.parentNode.firstChild))||void 0===c?void 0:c.fill)||h.psFill_;return Ot(g)}).attr("dy",function(c){return h.psCodeLabels_?"0.8em":"0"})};return h.updateSymbolsDrawOrder=function(c){var g=h.getCentroidsGroup(c),m=getSizeStatData(c);c.Geometries.centroidsFeatures&&c.Geometries.centroidsFeatures.length||(c.Geometries.centroidsFeatures=c.svg().selectAll("g.em-centroid").data().filter(function(c){var h;return null==c||null===(h=c.properties)||void 0===h?void 0:h.centroid}));var b=c.Geometries.centroidsFeatures.filter(function(c){var h,g=null===(h=m.get)||void 0===h||null===(h=h.call(m,c.properties.id))||void 0===h?void 0:h.value;return null!=g&&":"!==g}).sort(function(c,h){return m.get(h.properties.id).value-m.get(c.properties.id).value});g.selectAll("g.em-centroid").remove(),g.selectAll("g.em-centroid").data(b,function(c){return c.properties.id}).enter().append("g").attr("class","em-centroid").attr("id",function(c){return"ps"+c.properties.id}).attr("transform",function(c){return"translate(".concat(c.properties.centroid[0].toFixed(3),",").concat(c.properties.centroid[1].toFixed(3),")")}),applyClassificationToMap(c,h)},h.updateStyle=function(){try{if(applyStyleToMap(h),h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyStyleToMap),h.dorling_){var c=getSizeStatData(h);runDorlingSimulation(h,function(g){var m=c.get(g.properties.id),b=m?h.classifierSize_(+m.value):0;return"square"===h.psShape_?b/2*Math.SQRT2:b})}else stopDorlingSimulation(h);return h}catch(c){console.error("Error in proportional symbols styling: "+c.message),console.error(c)}},h.getLegendConstructor=function(){return xl},h},Hl=function getColorLegend(c,h){return c=c||jl,h?function(c,g){return h[c]}:function(h,g){return c(h/(g-1))}};function getSizeStatData(c){return c.statData("size").getArray()?c.statData("size"):c.statData()}var Ul=function tooltipTextFunPs(c,h){var g,m;if(h.tooltip_.omitRegions&&h.tooltip_.omitRegions.includes(c.properties.id))return"";var b=c.properties.na,w=c.properties.id,S=function formatValue(c,h,g){return":"===c?g||"Data not available":Ft(c)+(h?" "+h:"")},M=h.statData("size").getArray()?h.statData("size"):h.statData(),k=M.get(c.properties.id),T=(null===(g=M.unitText)||void 0===g?void 0:g.call(M))||"",E="<tr><td>".concat(S(null==k?void 0:k.value,T,h.noDataText_),"</td></tr>"),I="",P=null!==(m=h.statData("color"))&&void 0!==m&&m.getArray()?h.statData("color"):null;if(P){var L,B=P.get(c.properties.id),z=(null===(L=P.unitText)||void 0===L?void 0:L.call(P))||"";I="<tr><td>".concat(S(null==B?void 0:B.value,z,h.noDataText_),"</td></tr>")}return'\n <div class="em-tooltip-bar">\n <b>'.concat(b,"</b>").concat(w?" (".concat(w,")"):"",'\n </div>\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n ').concat(E,"\n ").concat(I,"\n </tbody>\n </table>\n </div>\n ").trim()};const Yl=colors("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");var Vl=function legend(c,h){var g=wl(c);if(g.order=void 0,h)for(var m in h)g[m]=h[m];function highlightRegions(c,h){var g=jt(c),m=c.svg_.selectAll(g).selectAll("[ecl]");m.style("fill","white"),m.filter("[ecl='"+h+"']").each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}function unhighlightRegions(c){var h=jt(c);c.svg_.selectAll(h).selectAll("[ecl]").each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}return g.update=function(){if(g.updateConfig(),g.updateContainer(),g.lgg.node()&&g.map.classifier_){g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle();var c=g.getBaseY(),h=g.getBaseX();if(g._categoricalContainer=g.lgg.append("g").attr("class","em-legend-categorical").attr("transform","translate(".concat(h,", ").concat(c,")")),function createCategoricalLegend(c){for(var h=c._categoricalContainer,g=c.map,m=g.classToFillStyle()?Object.keys(g.classToFillStyle()):g.classifier_.domain(),b=c.order?c.order:m,w=function _loop(){var m=b[S],w=g.classifier_(m),M=g.classToFillStyle_[m],k=c.titlePadding+S*(c.shapeHeight+c.shapePadding);h.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",k).attr("width",c.shapeWidth).attr("height",c.shapeHeight).style("fill",M).on("mouseover",function(){highlightRegions(c.map,w),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.svgId_,highlightRegions,w)}).on("mouseout",function(){unhighlightRegions(c.map),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.svgId_,unhighlightRegions,w)}),h.append("text").attr("class","em-legend-label").attr("x",c.shapeWidth+c.labelOffsets.x).attr("y",k+.5*c.shapeHeight).attr("dy","0.35em").text(g.classToText()?g.classToText()[m]:m)},S=0;S<b.length;S++)w()}(g),g.map.patternFill_){var m=g.lgg.node().getBBox().height,b=g.lgg.append("g").attr("class","pattern-fill-legend").attr("transform","translate(".concat(h,", ").concat(m+15,")"));appendPatternFillLegend(g,b)}if(g.noData){var w=g.lgg.node().getBBox().height+10,S=h,M=g.lgg.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(S,",").concat(w+15,")"));g.appendNoDataLegend(M,g.noDataText,highlightRegions,unhighlightRegions)}g.setBoxDimension()}},g},$l=function tooltipTextFunCat(c,h){var g=[];c.properties.id?g.push('<div class="em-tooltip-bar">'+c.properties.na+" ("+c.properties.id+") </div>"):g.push('<div class="em-tooltip-bar">'+c.properties.na+"</div>");var m=h.statData().get(c.properties.id);if(!m||0!=m.value&&!m.value)return g.push(h.noDataText_),g.join("");var b=m.value;if(h.classToText_){var w=h.classToText_[b];return g.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>\n '.concat(w||b,"\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n")),g.join("")}return g.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>\n '.concat(b,"\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n")),g.join("")};Array.prototype.slice;function d3_shape_src_array(c){return"object"==typeof c&&"length"in c?c:Array.from(c)}function linear_Linear(c){this._context=c}function src_curve_linear(c){return new linear_Linear(c)}function src_point_x(c){return c[0]}function src_point_y(c){return c[1]}function d3_shape_src_line(c,h){var g=node_modules_d3_shape_src_constant(!0),m=null,b=src_curve_linear,w=null,S=withPath(line);function line(M){var k,T,E,I=(M=d3_shape_src_array(M)).length,P=!1;for(null==m&&(w=b(E=S())),k=0;k<=I;++k)!(k<I&&g(T=M[k],k,M))===P&&((P=!P)?w.lineStart():w.lineEnd()),P&&w.point(+c(T,k,M),+h(T,k,M));if(E)return w=null,E+""||null}return c="function"==typeof c?c:void 0===c?src_point_x:node_modules_d3_shape_src_constant(c),h="function"==typeof h?h:void 0===h?src_point_y:node_modules_d3_shape_src_constant(h),line.x=function(h){return arguments.length?(c="function"==typeof h?h:node_modules_d3_shape_src_constant(+h),line):c},line.y=function(c){return arguments.length?(h="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),line):h},line.defined=function(c){return arguments.length?(g="function"==typeof c?c:node_modules_d3_shape_src_constant(!!c),line):g},line.curve=function(c){return arguments.length?(b=c,null!=m&&(w=b(m)),line):b},line.context=function(c){return arguments.length?(null==c?m=w=null:w=b(m=c),line):m},line}linear_Linear.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1,this._line?this._context.lineTo(c,h):this._context.moveTo(c,h);break;case 1:this._point=2;default:this._context.lineTo(c,h)}}};var Xl=function legend(c,h){var g=wl(c);if(g.squareSize=100,g.rotation=0,g.label1="Variable 1",g.label2="Variable 2",g.axisTitleFontSize=Pt("em-bivariate-axis-title"),g.breaks1=void 0,g.breaks2=void 0,g.showBreaks=!1,g.tickLength=5,g.yAxisLabelsOffset={x:0,y:0},g.xAxisLabelsOffset={x:0,y:0},g.yAxisTitleOffset={x:0,y:0},g.xAxisTitleOffset={x:0,y:0},g.boxPadding=g.labelFontSize,g.noDataYOffset=30,g.axisArrows=!0,g.arrowHeight=15,g.arrowWidth=14,g.arrowPadding=10,h)for(var m in h)g[m]=h[m];function highlightRegions(c,h,g){var m=jt(c),b=c.svg_.selectAll(m).selectAll("[ecl1],[ecl2]");b.style("fill","white"),b.filter("[ecl1='".concat(h,"']")).filter("[ecl2='".concat(g,"']")).filter(":not([nd])").each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}function unhighlightRegions(c){var h=jt(c);c.svg_.selectAll(h).selectAll("[ecl1],[ecl2]").each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}return g.update=function(){if(g.updateConfig(),g.updateContainer(),g._horizontalOffset=g.axisTitleFontSize+g.arrowPadding,g.lgg.selectAll("*").remove(),g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle(),g._y=g.boxPadding+(g.title?g.titleFontSize+g.boxPadding:0),function addSquares(){for(var c=g.lgg,h=g.map.numberOfClasses(),m=g.squareSize/h,b=0===g.rotation?0:.7071*g.squareSize+g.boxPadding,w=0,S=c.append("g").attr("class","bivariate-squares-chart").attr("transform","translate(".concat(g.boxPadding+g._horizontalOffset,",").concat(b+g._y,") rotate(").concat(g.rotation,") translate(").concat(g.boxPadding,",0)")),M=0;M<h;M++)for(var k=function _loop(){var c=h-M-1,b=h-T-1,k=g.map.classToFillStyle()(c,b);S.append("rect").attr("class","em-bivariate-square").attr("x",w+(h-1-M)*m).attr("y",T*m).attr("width",m).attr("height",m).style("fill",k).on("mouseover",function(){highlightRegions(g.map,c,b),g.map.insetTemplates_&&Bt(g.map.insetTemplates_,g.map.svgId,highlightRegions,c,b),src_select(this).raise()}).on("mouseout",function(){unhighlightRegions(g.map),g.map.insetTemplates_&&Bt(g.map.insetTemplates_,g.map.svgId,unhighlightRegions,c,b)})},T=0;T<h;T++)k();S.append("rect").attr("class","em-bivariate-frame").attr("x",w).attr("y",0).attr("width",g.squareSize).attr("height",g.squareSize).attr("stroke-width",.7)}(),!g.breaks1&&!g.breaks2&&g.showBreaks){var h=c.classifier1_;"function"==typeof h.quantiles?g.breaks1=h.quantiles().map(function(c){return parseFloat(c.toFixed(0))}):h.domain&&(g.breaks1=h.domain().map(function(c){return parseFloat(c.toFixed(0))}));var m=c.classifier2_;"function"==typeof m.quantiles?g.breaks2=m.quantiles().map(function(c){return parseFloat(c.toFixed(0))}):m.domain&&(g.breaks2=m.domain().map(function(c){return parseFloat(c.toFixed(0))}))}!function addBreakLabels(){var c=0===g.rotation?0:.7071*g.squareSize+g.boxPadding,h=0,m=g.map.numberOfClasses(),b=g.squareSize/m,w=g.lgg.append("g").attr("class","bivariate-break-labels").attr("transform","translate(".concat(g.boxPadding+g._horizontalOffset,",").concat(c+g._y,") rotate(").concat(g.rotation,") translate(").concat(g.boxPadding,",0)"));if(g.breaks1)for(var S=0;S<g.breaks1.length;S++){var M=h+b*(S+1),k=g.squareSize+Pt("em-bivariate-tick-label");w.append("text").attr("class","em-bivariate-tick-label").attr("x",M+g.xAxisLabelsOffset.x).attr("y",k+g.xAxisLabelsOffset.y).text(g.breaks1[S]),w.append("line").attr("class","em-bivariate-tick").attr("x1",M).attr("x2",M).attr("y1",g.squareSize).attr("y2",g.squareSize+g.tickLength)}if(g.breaks2)for(var T=0;T<g.breaks2.length;T++){var E=h,I=b*(T+2)-b;w.append("text").attr("class","em-bivariate-tick-label").attr("x",E+g.yAxisLabelsOffset.x).attr("y",I-g.yAxisLabelsOffset.y-(g.tickLength+2)).text(toConsumableArray_toConsumableArray(g.breaks2).reverse()[T]).attr("text-anchor","middle").attr("transform","rotate(-90, ".concat(E,", ").concat(I,")")),w.append("line").attr("class","em-bivariate-tick").attr("x1",E).attr("x2",E-g.tickLength).attr("y1",I).attr("y2",I)}}(),g._xAxisArrowY=0,g._yAxisArrowX=0,g.axisArrows&&function addAxisArrows(){var c=0===g.rotation?0:.7071*g.squareSize+g.boxPadding,h=0,m=g.lgg.append("g").attr("class","bivariate-axis-arrows").attr("transform","translate(".concat(g.boxPadding+g._horizontalOffset,",").concat(c+g._y,") rotate(").concat(g.rotation,") translate(").concat(g.boxPadding,",0)"));g._xAxisArrowY=g.squareSize+g.tickLength+g.arrowPadding,(g.showBreaks||g.breaks1&&g.breaks2)&&(g._xAxisArrowY+=Pt("em-bivariate-tick-label")/1.5);m.append("path").attr("class","em-bivariate-axis-arrow").attr("d",d3_shape_src_line()([[h,g._xAxisArrowY],[h+g.squareSize,g._xAxisArrowY]])).attr("stroke","black").attr("marker-end","url(#arrowhead)"),g._yAxisArrowX=-g.tickLength-g.arrowPadding,(g.showBreaks||g.breaks1&&g.breaks2)&&(g._yAxisArrowX-=g.labelFontSize/2);m.append("path").attr("class","em-bivariate-axis-arrow").attr("d",d3_shape_src_line()([[g._yAxisArrowX,g.squareSize],[g._yAxisArrowX,0]])).attr("stroke","black").attr("marker-end","url(#arrowhead)")}(),function addAxisTitles(){var c=0===g.rotation?0:.7071*g.squareSize+g.boxPadding,h=0,m=g.lgg.append("g").attr("class","bivariate-axis-titles").attr("transform","translate(".concat(g.boxPadding+g._horizontalOffset,",").concat(c+g._y,") rotate(").concat(g.rotation,") translate(").concat(g.boxPadding,",0)")),b=g.squareSize+g.xAxisLabelsOffset.y+(g.axisArrows?g.arrowPadding+g.arrowHeight:7),w=h;(g.showBreaks||g.breaks1&&g.breaks2)&&(b+=Pt("em-bivariate-tick-label"));g.xAxisTitleOffset&&(b+=g.xAxisTitleOffset.y);g.xAxisTitleOffset&&(w+=g.xAxisTitleOffset.x);m.append("text").attr("class","em-bivariate-axis-title em-bivariate-axis-title-x").attr("x",w).attr("y",b).text(g.label1).attr("dominant-baseline","hanging").attr("alignment-baseline","hanging");var S=(g.axisArrows?g._yAxisArrowX-g.arrowPadding:7)+(-45==g.rotation?-4:-10);(g.showBreaks||g.breaks1&&g.breaks2)&&(b+=Pt("em-bivariate-tick-label"));var M=-g.squareSize;g.yAxisTitleOffset&&(S+=g.yAxisTitleOffset.y);g.yAxisTitleOffset&&(M+=g.yAxisTitleOffset.x);m.append("text").attr("class","em-bivariate-axis-title em-bivariate-axis-title-y").attr("x",M).attr("y",S).text(g.label2).style("transform",g.rotation<0?"translate(".concat(g.axisArrows?-51:-15,"px, 95px) rotate(90deg)"):"rotate(-90deg)")}(),g.lgg.append("defs").append("marker").attr("viewBox","0 0 ".concat(g.arrowWidth," ").concat(g.arrowHeight)).attr("id","arrowhead").attr("refX",0).attr("refY",5).attr("markerWidth",g.arrowWidth).attr("markerHeight",g.arrowHeight).attr("orient","auto").append("path").attr("d","M 0 0 L 5 5 L 0 10").attr("marker-units","strokeWidth"),g.noData&&function addNoDataElement(){var c=0===g.rotation?g.noDataYOffset+g.squareSize/g.map.numberOfClasses_+g.arrowHeight/2:g.noDataYOffset,h=0===g.rotation?g._y+g.squareSize+c:g._y+1.4142*g.squareSize+2*g.boxPadding+c;g.lgg.append("rect").attr("class","em-bivariate-nodata").attr("x",g.boxPadding+g.noDataShapeWidth/2).attr("y",h+(0==g.rotation?0:-10)).attr("width",g.noDataShapeWidth).attr("height",g.noDataShapeHeight).style("fill",g.map.noDataFillStyle()).on("mouseover",function(){("mixed"==g.map.nutsLevel_?src_selectAll("#em-nutsrg"):src_select("#em-nutsrg")).selectAll("[nd='nd']").style("fill","red")}).on("mouseout",function(){("mixed"==g.map.nutsLevel_?src_selectAll("#em-nutsrg"):src_select("#em-nutsrg")).selectAll("[nd='nd']").style("fill",function(){return src_select(this).attr("fill___")}),src_select(this).style("fill",g.map.noDataFillStyle())}),g.lgg.append("text").attr("class","em-bivariate-nodata-label").attr("x",g.boxPadding+g.noDataShapeWidth+(g.noDataShapeWidth/2+5)).attr("y",h+.5*g.noDataShapeHeight+1+(0==g.rotation?0:-10)).text(g.noDataText)}(),g.setBoxDimension()},g},Kl=function scaleBivariate(c,h,g,m,b){for(var w=[],S=st(h,g),M=st(m,b),k=0;k<c;k++){for(var T=k/(c-1),E=st(S(T),M(T)),I=[],P=0;P<c;P++)I.push(E(P/(c-1)));w.push(I)}return function(c,h){return w[c][h]}},Zl=function tooltipTextFunBiv(c,h){var g=[],m=c.properties.na||c.properties.name;c.properties.id?g.push('<div class="em-tooltip-bar" >'+m+" ("+c.properties.id+") </div>"):g.push('<div class="em-tooltip-bar" >'+m+"</div>");var b=h.statData("v1").get(c.properties.id),w=h.statData("v1").unitText(),S=h.statData("v2").get(c.properties.id),M=h.statData("v2").unitText();return g.push('\n <div class="em-tooltip-text" style="background: #ffffff;color: #171a22;padding: 4px;font-size:15px;">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>\n '.concat(b&&b.value?Ft(b.value):""," ").concat(w&&b&&b.value?w:"","\n ").concat(!b||0!=b.value&&!b.value?h.noDataText_:"","\n </td>\n </tr>\n <tr>\n <td>\n ").concat(S&&S.value?Ft(S.value):""," ").concat(M&&S&&S.value?M:"","\n ").concat(!S||0!=S.value&&!S.value?h.noDataText_:"","\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n ")),g.join("")};class TernaryGeometry{static ternaryMeshCentroids(c){const h=c*c,g=[];for(let m=1;m<=h;m++){const b=Math.floor(Math.sqrt(h-m)),w=b*b,S=((-h+m+b*(b+2)+1)%2-3*w-3*m+3*h+1)/(6*c),M=-((-h+w+m+2*b+1)%2+3*b-3*c+1)/(3*c),k=((-h+w+m+2*b+1)%2+3*w+6*b+3*m-3*h+1)/(6*c);g.push({id:m,p1:S,p2:M,p3:k})}return g}static ternaryMeshVertices(c){const h=Math.sqrt(c.length),g=[];return c.forEach(c=>{const m=h-Math.floor(Math.sqrt(h*h-c.id)),b=c.id-(m-1)*(2*h-m+1),w=2*Math.pow(-1,b%2)/(3*h),S=Math.pow(-1,b%2)/(3*h);g.push({id:c.id,vertex:1,p1:c.p1-w,p2:c.p2+S,p3:c.p3+S}),g.push({id:c.id,vertex:2,p1:c.p1+S,p2:c.p2-w,p3:c.p3+S}),g.push({id:c.id,vertex:3,p1:c.p1+S,p2:c.p2+S,p3:c.p3-w})}),g}static ternaryDistance(c,h){return h.map(h=>{const g=c[0]-h[0],m=c[1]-h[1],b=c[2]-h[2];return-(m*b+b*g+g*m)})}static ternaryNearest(c,h){return c.map(c=>{if(!c)return null;const g=this.ternaryDistance(c,h),m=g.indexOf(Math.min(...g));return h[m]})}static ternarySextantVertices(c){const h=[],g=[c[0],1-c[0],0],m=[c[0],0,1-c[0]],b=[0,c[1],1-c[1]],w=[1-c[1],c[1],0],S=[1-c[2],0,c[2]],M=[0,1-c[2],c[2]],k=[[c,S,[1,0,0],w,c],[c,w,g,c],[c,g,[0,1,0],M,c],[c,M,b,c],[c,b,[0,0,1],m,c],[c,m,S,c]];for(let c=1;c<=6;c++){const g=k[c-1];for(let m=0;m<g.length;m++)h.push({id:c,vertex:m+1,p1:g[m][0],p2:g[m][1],p3:g[m][2]})}return h}static ternarySurroundingSextant(c,h){return c.map(c=>{if(!c)return null;const g=[c[0]>h[0],c[1]>h[1],c[2]>h[2]];return!g[0]||g[1]||g[2]?g[0]&&g[1]&&!g[2]?2:g[0]||!g[1]||g[2]?!g[0]&&g[1]&&g[2]?4:g[0]||g[1]||!g[2]?g[0]&&!g[1]&&g[2]?6:null:5:3:1})}static ternaryToCartesian(c){return[.5*(2*c[2]+c[1]),Math.sqrt(3)/2*c[1]]}static cartesianToTernary(c,h){const g=2*h/Math.sqrt(3),m=c-g/2;return[1-g-m,g,m]}static ternaryLimits(c){const h=[1,1,1],g=[0,0,0];return c.forEach(c=>{h[0]=Math.min(h[0],c[0]),h[1]=Math.min(h[1],c[1]),h[2]=Math.min(h[2],c[2]),g[0]=Math.max(g[0],c[0]),g[1]=Math.max(g[1],c[1]),g[2]=Math.max(g[2],c[2])}),{lower:h,upper:g}}}class CompositionUtils{static geometricMean(c,h=!0){const g=h?c.filter(c=>0!==c):c;return 0===g.length?0:Math.exp(g.reduce((c,h)=>c+Math.log(h),0)/g.length)}static centre(c){const h=this.geometricMean(c.map(c=>c[0])),g=this.geometricMean(c.map(c=>c[1])),m=this.geometricMean(c.map(c=>c[2])),b=h+g+m;return[h/b,g/b,m/b]}static perturbe(c,h=[1/3,1/3,1/3]){return c.map(c=>{if(!c)return null;const g=[c[0]*h[0],c[1]*h[1],c[2]*h[2]],m=g.reduce((c,h)=>c+h,0);return[g[0]/m,g[1]/m,g[2]/m]})}static powerScale(c,h=1){return c.map(c=>{if(!c)return null;const g=[Math.pow(c[0],h),Math.pow(c[1],h),Math.pow(c[2],h)],m=g.reduce((c,h)=>c+h,0);return[g[0]/m,g[1]/m,g[2]/m]})}static close(c){return c.map(c=>{if(!this.isValidTernary(c))return null;const h=c[0]+c[1]+c[2];return[c[0]/h,c[1]/h,c[2]/h]})}static validateTernaryPoints(c){for(let h=0;h<c.length;h++){const g=c[h];if(!g)continue;if(3!==g.length)throw new Error(`Ternary point must have exactly 3 components, got ${g.length}`);if(g.some(c=>c<0))throw new Error(`Ternary point contains negative values: [${g}]`);const m=g[0]+g[1]+g[2];if(Math.abs(m-1)>1e-9)throw new Error(`Ternary point components must sum to 1, got ${m}: [${g}]`)}}static isValidTernary(c){return Array.isArray(c)&&3===c.length&&c.every(c=>"number"==typeof c&&!Number.isNaN(c))}}class colorMapping_ColorMapping{static colorMapTricolore(c,h=[1/3,1/3,1/3],g=4,m=80,b=140,w=80,S=.4,M=1){const k=CompositionUtils.close([...c]);let T=CompositionUtils.close([...c]);if(Number.isFinite(g)&&g<100){const c=TernaryGeometry.ternaryMeshCentroids(g).map(c=>[c.p1,c.p2,c.p3]);T=TernaryGeometry.ternaryNearest(T,c)}const E=CompositionUtils.perturbe(T,[1/h[0],1/h[1],1/h[2]]);return CompositionUtils.powerScale(E,M).map((h,g)=>{if(!h)return{p1:c[g][0],p2:c[g][1],p3:c[g][2],h:null,c:null,l:null,rgb:null};const M=h.map(c=>c*b),T=[m,m+120,m+240].map(c=>c*Math.PI/180),E=T.map((c,h)=>({re:M[h]*Math.cos(c),im:M[h]*Math.sin(c)})).reduce((c,h)=>({re:c.re+h.re,im:c.im+h.im}),{re:0,im:0}),I=(180*Math.atan2(E.im,E.re)/Math.PI+360)%360,P=Math.sqrt(E.re*E.re+E.im*E.im),L=P*S/b+1-S,B=L*w,z=L*P,j=this.hclToHex(I,z,B);return{p1:k[g][0],p2:k[g][1],p3:k[g][2],h:I,c:z,l:B,rgb:j}})}static colorMapSextant(c,h=[1/3,1/3,1/3],g=["#FFFF00","#B3DCC3","#01A0C6","#B8B3D8","#F11D8C","#FFB3B3"]){if(6!==g.length)throw new Error("Sextant values array must have exactly 6 elements");const m=CompositionUtils.close([...c]),b=TernaryGeometry.ternarySurroundingSextant(m,h);return m.map((h,m)=>{if(!h)return{p1:c[m][0],p2:c[m][1],p3:c[m][2],sextant:null,rgb:null};const w=b[m],S=null!==w?g[w-1]:null;return{p1:h[0],p2:h[1],p3:h[2],sextant:w,rgb:S}})}static hclToHex(c,h,g){(c%=360)<0&&(c+=360),h=Math.max(0,Math.min(h,230)),g=Math.max(0,Math.min(g,100));const m=c*Math.PI/180,b=(g+16)/116,w=Math.cos(m)*h/500+b,S=b-Math.sin(m)*h/200,M=.95047*(w>.206893034?w**3:(w-16/116)/7.787),k=1*(b>.206893034?b**3:(b-16/116)/7.787),T=1.08883*(S>.206893034?S**3:(S-16/116)/7.787);let E=3.2406*M-1.5372*k-.4986*T,I=-.9689*M+1.8758*k+.0415*T,P=.0557*M-.204*k+1.057*T;const gamma=c=>c>.0031308?1.055*c**(1/2.4)-.055:12.92*c;E=gamma(E),I=gamma(I),P=gamma(P);const to8bit=c=>Math.round(255*(c=>Math.max(0,Math.min(1,c)))(c)),toHex=c=>{const h=to8bit(c).toString(16);return 1===h.length?"0"+h:h};return`#${toHex(E)}${toHex(I)}${toHex(P)}`}}function identity_identity(c){return c}function group(c,...h){return nest(c,identity_identity,identity_identity,h)}function nest(c,h,g,m){return function regroup(c,b){if(b>=m.length)return g(c);const w=new InternMap,S=m[b++];let M=-1;for(const h of c){const g=S(h,++M,c),m=w.get(g);m?m.push(h):w.set(g,[h])}for(const[c,h]of w)w.set(c,regroup(h,b));return h(w)}(c,0)}class TricoloreViz{constructor(c,h=650,g=520,m={top:20,right:60,bottom:50,left:60}){this.canvas=null,this.ctx=null,this.container=src_select(c),this.width=h,this.height=g,this.margin=m,this.svg=this.container.append("svg").attr("width",h).attr("height",g),this.triangle=this.svg.append("g").attr("transform",`translate(${m.left},${m.top})`).attr("class","em-tricolore-triangle"),this.legend=this.svg.append("g").attr("transform",`translate(${m.left},${m.top})`).attr("class","em-tricolore-legend-labels"),this.circles=this.svg.append("g").attr("transform",`translate(${m.left},${m.top})`).attr("class","em-tricolore-data-points")}createContinuousPlot(c=[],h={}){var g,m;const{center:b=[1/3,1/3,1/3],hue:w=80,chroma:S=140,lightness:M=80,contrast:k=.4,spread:T=1,showData:E=!0,showCenter:I=!0,showLines:P=!0,labels:L=["p₁","p₂","p₃"],labelPosition:B="corner",colorTarget:z="triangles"}=h,j=this.width-this.margin.left-this.margin.right,D=this.height-this.margin.top-this.margin.bottom,N=Math.min(j,D);if(this.canvas&&src_select(this.canvas).remove(),this.triangle.selectAll("*").remove(),this.legend.selectAll("*").remove(),this.circles.selectAll("*").remove(),this.canvas=document.createElement("canvas"),this.canvas.width=N,this.canvas.height=N,this.ctx=this.canvas.getContext("2d"),this.ctx){if(this.drawContinuousTriangle(N,b,w,S,M,k,T),this.triangle.append("image").attr("x",0).attr("y",0).attr("width",N).attr("height",N).attr("href",this.canvas.toDataURL()),this.drawTriangleFrame(N,L,b,I,P,B,z),E&&c.length>0){const m=null!==(g=h.colorTarget)&&void 0!==g?g:"triangles";this.addDataPoints(c,N,h.dataPointHandlers,I,b,void 0,m)}I&&this.addCenterAnnotation(N,b,null!==(m=h.centerLabel)&&void 0!==m?m:"Average value",h.centerAnnotationOffsets)}}createDiscretePlot(c=[],h={}){var g;const{center:m=[1/3,1/3,1/3],breaks:b=4,hue:w=80,chroma:S=140,lightness:M=80,contrast:k=.4,spread:T=1,showData:E=!0,showCenter:I=!0,showLines:P=!0,labels:L=["p₁","p₂","p₃"],labelPosition:B="corner",colorTarget:z="triangles"}=h,j=this.width-this.margin.left-this.margin.right,D=this.height-this.margin.top-this.margin.bottom,N=Math.min(j,D);this.triangle.selectAll("*").remove(),this.legend.selectAll("*").remove(),this.circles.selectAll("*").remove();const R=TernaryGeometry.ternaryMeshCentroids(b),G=TernaryGeometry.ternaryMeshVertices(R),q=R.map(c=>[c.p1,c.p2,c.p3]),W=colorMapping_ColorMapping.colorMapTricolore(q,m,b,w,S,M,k,T);if(group(G,c=>c.id).forEach((c,g)=>{const m=c.map(c=>{const[h,g]=this.ternaryToSvgCoords([c.p1,c.p2,c.p3],N);return`${h},${g}`}).join(" "),b=W[Number(g)-1].rgb,w=Number(g)-1,S=this.triangle.append("polygon").attr("points",m).attr("stroke","none").attr("classIndex",w).attr("class","em-ternary-discrete-polygon");"triangles"===z?S.attr("fill",b):S.attr("fill","#fffefe");const M=h.triangleHandlers;(null==M?void 0:M.mouseover)&&S.on("mouseover",c=>M.mouseover(c,b)),(null==M?void 0:M.mouseout)&&S.on("mouseout",c=>M.mouseout(c))}),this.drawTriangleFrame(N,L,m,I,P,B,z,b),E&&c.length>0){const g="points"===z?colorMapping_ColorMapping.colorMapTricolore(c,m,b,w,S,M,k,T):void 0;this.addDataPoints(c,N,h.dataPointHandlers,I,m,"points"===z?g:void 0,z)}I&&this.addCenterAnnotation(N,m,null!==(g=h.centerLabel)&&void 0!==g?g:"Average value",h.centerAnnotationOffsets)}createSextantPlot(c=[],h={}){var g,m;const{center:b=[1/3,1/3,1/3],values:w=["#FFFF00","#B3DCC3","#01A0C6","#B8B3D8","#F11D8C","#FFB3B3"],showData:S=!0,showCenter:M=!0,showLines:k=!0,labels:T=["p₁","p₂","p₃"],labelPosition:E="corner",colorTarget:I="triangles"}=h;if(6!==w.length)throw new Error("Sextant plot requires exactly 6 color values");const P=this.width-this.margin.left-this.margin.right,L=this.height-this.margin.top-this.margin.bottom,B=Math.min(P,L);this.triangle.selectAll("*").remove(),this.legend.selectAll("*").remove(),this.circles.selectAll("*").remove();if(group(TernaryGeometry.ternarySextantVertices(b),c=>c.id).forEach((c,g)=>{c.sort((c,h)=>c.vertex-h.vertex);const m=c.map(c=>{const[h,g]=this.ternaryToSvgCoords([c.p1,c.p2,c.p3],B);return`${h},${g}`}).join(" "),b=Number(g)-1,S=Number(g)-1,M=this.triangle.append("polygon").attr("points",m).attr("fill",w[b]).attr("stroke","none").attr("data-ecl",S),k=h.triangleHandlers;(null==k?void 0:k.mouseover)&&M.on("mouseover",c=>k.mouseover(c,w[b])),(null==k?void 0:k.mouseout)&&M.on("mouseout",c=>k.mouseout(c))}),this.drawTriangleFrame(B,T,b,M,k,E,I),S&&c.length>0){const m=null!==(g=h.colorTarget)&&void 0!==g?g:"triangles";this.addDataPoints(c,B,h.dataPointHandlers,M,b,void 0,m)}M&&this.addCenterAnnotation(B,b,null!==(m=h.centerLabel)&&void 0!==m?m:"Average value",h.centerAnnotationOffsets)}drawContinuousTriangle(c,h,g,m,b,w,S){if(!this.ctx)return;const M=c,k=this.ctx.createImageData(M,M);for(let c=0;c<M;c++)for(let T=0;T<M;T++){const[E,I,P]=this.svgToTernaryCoords([T,c],M);if(E<0||I<0||P<0||E>1||I>1||P>1)continue;const L=colorMapping_ColorMapping.colorMapTricolore([[E,I,P]],h,100,g,m,b,w,S)[0],B=parseInt(L.rgb.slice(1,3),16),z=parseInt(L.rgb.slice(3,5),16),j=parseInt(L.rgb.slice(5,7),16),D=4*(c*M+T);k.data[D]=B,k.data[D+1]=z,k.data[D+2]=j,k.data[D+3]=255}this.ctx.putImageData(k,0,0)}drawTriangleFrame(c,h,g,m,b,w="corner",S="triangles",M=4){const k=[[1,0,0],[0,1,0],[0,0,1]].map(h=>this.ternaryToSvgCoords(h,c)),T=k.map(c=>c.join(",")).join(" ");if(this.triangle.append("polygon").attr("points",T).attr("fill","none").attr("stroke","black").attr("stroke-width",1),"edge"===w){const c=[[(k[0][0]+k[1][0])/2-35,(k[0][1]+k[1][1])/2-14],[(k[1][0]+k[2][0])/2+35,(k[1][1]+k[2][1])/2-14],[(k[0][0]+k[2][0])/2,(k[0][1]+k[2][1])/2+35]],g=[-60,60,0];h.forEach((h,m)=>{this.legend.append("text").attr("x",c[m][0]).attr("y",c[m][1]).attr("class","em-ternary-axis-title em-legend-label em-ternary-legend-label").attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",`rotate(${g[m]},${c[m][0]},${c[m][1]})`).text(h)})}else{const c=[[k[0][0],k[0][1]+25],[k[1][0],k[1][1]-15],[k[2][0],k[2][1]+25]];h.forEach((h,g)=>{this.legend.append("text").attr("class","em-ternary-axis-title em-legend-label em-ternary-legend-label").attr("x",c[g][0]).attr("y",c[g][1]).attr("text-anchor","middle").text(h)})}const E="number"==typeof M&&M>1?Array.from({length:M-1},(c,h)=>(h+1)/M):[],I=[];for(let c=0;c<E.length;c++){const h=0===c?0:E[c-1],g=(E[c]-h)/5;for(let c=1;c<5;c++)I.push(h+c*g)}const drawGridLine=(h,g,m)=>{const[b,w]=this.ternaryToSvgCoords(h,c),[S,M]=this.ternaryToSvgCoords(g,c);this.legend.append("line").attr("x1",b).attr("y1",w).attr("x2",S).attr("y2",M).attr("stroke","#555").attr("stroke-width",m?1:.2).attr("opacity",m?.4:.25).attr("class",m?"em-ternary-grid-line":"em-ternary-grid-line-minor")};b&&(I.forEach(c=>{drawGridLine([c,0,1-c],[c,1-c,0],!1),drawGridLine([0,c,1-c],[1-c,c,0],!1),drawGridLine([1-c,0,c],[0,1-c,c],!1)}),E.forEach(h=>{const g=[h,0,1-h];drawGridLine(g,[h,1-h,0],!0),this.drawAxisTick(g,[0,-1,1],c);const m=[1-h,h,0];drawGridLine([0,h,1-h],m,!0),this.drawAxisTick(m,[1,0,-1],c);const b=[0,1-h,h];drawGridLine([1-h,0,h],b,!0),this.drawAxisTick(b,[-1,1,0],c)}));const P=this.computeLabelStride(E.length+1),L=E.filter((c,h)=>h%P===0);L.forEach(h=>{const g=[this.ternaryToSvgCoords([h,1-h,0],c),this.ternaryToSvgCoords([h,0,1-h],c)];this.legend.append("text").attr("x",g[0][0]-10).attr("y",g[0][1]+3).attr("text-anchor","end").attr("font-size","10px").attr("class","em-ternary-axis-tick-label").text(`${(100*h).toFixed(0)}%`)}),L.forEach(h=>{const g=[this.ternaryToSvgCoords([0,h,1-h],c),this.ternaryToSvgCoords([1-h,h,0],c)];this.legend.append("text").attr("x",g[0][0]+5).attr("y",g[0][1]-10).attr("text-anchor","start").attr("font-size","10px").attr("class","em-ternary-axis-tick-label").text(`${(100*h).toFixed(0)}%`)}),L.forEach(h=>{const g=[this.ternaryToSvgCoords([1-h,0,h],c),this.ternaryToSvgCoords([0,1-h,h],c)];this.legend.append("text").attr("x",g[0][0]+10).attr("y",g[0][1]+18).attr("text-anchor","middle").attr("font-size","10px").attr("class","em-ternary-axis-tick-label").text(`${(100*h).toFixed(0)}%`)})}computeLabelStride(c){return c<=7?1:c<=10?2:c<=15?3:Math.ceil(c/4)}drawAxisTick(c,h,g,m=8){const[b,w]=this.ternaryToSvgCoords(c,g),S=[c[0]+h[0]*(m/g),c[1]+h[1]*(m/g),c[2]+h[2]*(m/g)],[M,k]=this.ternaryToSvgCoords(S,g);this.legend.append("line").attr("x1",b).attr("y1",w).attr("x2",M).attr("y2",k).attr("stroke-width",1).attr("opacity",.4).attr("class","em-ternary-axis-tick")}addDataPoints(c,h,g,m,b,w,S="triangles"){const M=CompositionUtils.close([...c]);if(CompositionUtils.validateTernaryPoints(M),M.forEach((c,m)=>{if(c){const[b,M]=this.ternaryToSvgCoords(c,h),k="points"===S&&w&&w[m]&&w[m].rgb?w[m].rgb:"black",T=this.circles.append("circle").datum({point:c,index:m}).attr("cx",b).attr("cy",M).attr("r",2).attr("fill",k).attr("opacity","points"===S?1:.7).attr("class","em-ternary-legend-data-point");(null==g?void 0:g.mouseover)&&T.on("mouseover",c=>g.mouseover(c,T.datum())),(null==g?void 0:g.mousemove)&&T.on("mousemove",c=>g.mousemove(c,T.datum())),(null==g?void 0:g.mouseout)&&T.on("mouseout",c=>g.mouseout(c,T.datum()))}}),m){const c=this.ternaryToSvgCoords(b,h),[g,m]=c;[[[b[0],0,1-b[0]],b],[[1-b[1],b[1],0],b],[[0,1-b[2],b[2]],b]].forEach(([c,g],m)=>{const[w,M]=this.ternaryToSvgCoords(c,h),[k,T]=this.ternaryToSvgCoords(g,h);this.circles.append("line").attr("x1",w).attr("y1",M).attr("x2",k).attr("y2",T).attr("stroke","triangles"===S?"white":"#000").attr("stroke-width",1).attr("opacity","triangles"===S?.9:1).attr("class","em-ternary-center-line");const E=Math.round(100*b[m]),I=w,P=M,L=Math.atan2(T-M,k-w)*(180/Math.PI);let B=L;const z=0===m?25:15;let j=z*Math.cos(L*Math.PI/180),D=z*Math.sin(L*Math.PI/180);1===m&&(j+=-5,D+=8),0===m&&(B=L+180,j+=14,D+=10),2===m&&(B=L+180,j+=5,D+=10),this.circles.append("text").attr("x",I+j).attr("y",P+D).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("fill","triangles"===S?"white":"#000").attr("transform",`rotate(${B}, ${I+j}, ${P+D})`).attr("class","em-ternary-center-line-label").text(`${E}%`)}),this.circles.append("circle").attr("cx",g).attr("cy",m).attr("r",3).attr("fill","black").attr("stroke","white").attr("class","em-ternary-center-point")}}addCenterAnnotation(c,h,g="Average value",m={labelX:70,labelY:20,curveX:10,curveY:0}){const[b,w]=this.ternaryToSvgCoords(h,c),S=b+m.labelX,M=35+m.labelY,k=`\n M ${b},${w}\n Q ${b+m.curveX},${w-m.curveY} ${S},${M}\n `,T=this.circles.append("g").attr("class","em-ternary-center-annotation");T.append("path").attr("d",k).attr("fill","none").attr("class","em-ternary-annotation-line"),T.append("text").attr("x",S).attr("y",M-6).attr("class","em-ternary-center-annotation-label").text(g)}ternaryToSvgCoords(c,h){const[g,m]=TernaryGeometry.ternaryToCartesian(c);return[g*h,h-m*h]}svgToTernaryCoords(c,h){return TernaryGeometry.cartesianToTernary(c[0]/h,1-c[1]/h)}}var Jl=null,Ql=function legend(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},g=wl(c);return g.width=160,g.height=160,g.padding={top:50,right:50,bottom:10,left:50},g.type="continuous",g.showCenter=!0,g.centerLabel="Average",g.showLines=!1,g.labels=["Variable 1","Variable 2","Variable 3"],g.labelPosition="edge",g.colorTarget="points",g.showData=!0,g.centerAnnotationOffsets={labelX:70,labelY:10,curveX:-20,curveY:-20},Object.assign(g,h),g.update=function(){return g.updateConfig(),g.updateContainer(),g.lgg.node()?(g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle(),function drawTricoloreLegend(){var h=g.getBaseY(),m=g.getBaseX(),b=g.lgg.append("g").attr("class","em-ternary-legend").attr("transform","translate(".concat(m,",").concat(h,")"));b.selectAll("*").remove();var w=b.append("foreignObject").attr("x",0).attr("y",0).attr("width",g.width).attr("height",g.height).append("xhtml:div").style("width","".concat(g.width,"px")).style("height","".concat(g.height,"px")),S=new TricoloreViz(w.node(),g.width,g.height,g.padding),M={center:c._ternaryCenter_,hue:c.ternarySettings_.hue,chroma:c.ternarySettings_.chroma,lightness:c.ternarySettings_.lightness,contrast:c.ternarySettings_.contrast,spread:c.ternarySettings_.spread,labels:g.labels,labelPosition:g.labelPosition,showCenter:g.showCenter,centerLabel:g.centerLabel,showLines:g.showLines,breaks:c.ternarySettings_.breaks,colorTarget:g.colorTarget,showData:g.showData,centerAnnotationOffsets:g.centerAnnotationOffsets,dataPointHandlers:{mouseover:function mouseover(h,g){var m=src_select(h.currentTarget);Jl&&Jl.node()!==m.node()&&Jl.attr("stroke",null).attr("stroke-width",null).lower(),Jl=m,g.index,highlightRegionsByClass(c,g.index),c.insetTemplates_&&Bt(c.insetTemplates_,c.svgId,highlightRegionsByClass,g.index);var b,w=function getRegionByClassIndex(c,h){var g,m,b=c._ternaryIdByClass_?c._ternaryIdByClass_.get(h):null===(g=toConsumableArray_toConsumableArray(c._ternaryClassById_.entries()).find(function(c){return slicedToArray_slicedToArray(c,2)[1]===h}))||void 0===g?void 0:g[0];return b&&(null===(m=c.Geometries.getRegionFeatures())||void 0===m?void 0:m.find(function(c){return c.properties.id===b}))||null}(c,g.index);w&&(null===(b=c._tooltip)||void 0===b||b.mouseover(c.tooltip_.textFunction(w,c)));m.attr("stroke","red").attr("stroke-width",2).raise()},mousemove:function mousemove(h){var g;null===(g=c._tooltip)||void 0===g||g.mousemove(h)},mouseout:function mouseout(h){var g,m=src_select(h.currentTarget);Jl&&Jl.node()===m.node()&&(m.attr("stroke",null).attr("stroke-width",null).lower(),Jl=null,resetRegions(c),c.insetTemplates_&&Bt(c.insetTemplates_,c.svgId,resetRegions),null===(g=c._tooltip)||void 0===g||g.mouseout())}},triangleHandlers:{mouseover:function mouseover(h,g){var m=src_select(h.currentTarget);Jl&&Jl.node()!==m.node()&&Jl.attr("stroke",null).attr("stroke-width",null).lower(),Jl=m,highlightRegionsByColor(c,g),c.insetTemplates_&&Bt(c.insetTemplates_,c.svgId,highlightRegionsByColor,g),m.attr("stroke","red").attr("stroke-width",2).raise()},mouseout:function mouseout(h){var g=src_select(h.currentTarget);Jl&&Jl.node()===g.node()&&(g.attr("stroke",null).attr("stroke-width",null).lower(),Jl=null,resetRegions(c),c.insetTemplates_&&Bt(c.insetTemplates_,c.svgId,resetRegions))}}};c.ternarySettings_.breaks<30?S.createDiscretePlot(c._ternaryData_,M):S.createContinuousPlot(c._ternaryData_,M)}(),g.setBoxDimension(),g):g},g};function highlightRegionsByClass(c,h){var g=jt(c);c.svg_.selectAll(g).selectAll("[ecl]").each(function(){var c=src_select(this),g=+c.attr("ecl");c.style("opacity",g===h?1:.15)})}function highlightRegionsByColor(c,h){var g=jt(c),m=c.svg_.selectAll(g).selectAll("[ecl]"),b=normalizeColor(h);m.each(function(){var c=src_select(this),h=normalizeColor(c.attr("fill___"));c.style("opacity",h===b?1:.15)})}function resetRegions(c){var h=jt(c);c.svg_.selectAll(h).selectAll("[ecl]").style("opacity",1)}function normalizeColor(c){if(!c)return null;var h=document.createElement("canvas").getContext("2d");return h.fillStyle=c,h.fillStyle.toLowerCase()}function map_choropleth_trivariate_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function map_choropleth_trivariate_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?map_choropleth_trivariate_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):map_choropleth_trivariate_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}var tc=function map(c){var h=Ml(c,!1,"chtri");h.ternaryCodes_=["v1","v2","v3"],h.noDataFillStyle_="#ccc",h.ternarySettings_={hue:10,chroma:120,lightness:70,contrast:.2,spread:.8,breaks:5,meanCentering:!0},h._ternaryColors_=null,h._ternaryData_=null,h._ternaryCenter_=null,h.tooltip_.textFunction=ec;var g=["ternaryCodes_","noDataFillStyle_","ternarySettings_"];function regionsFillFunction(c){var g=c.properties.id,m=h._ternaryColorById_.get(g),b=h._ternaryClassById_.get(g);return src_select(this).attr("ecl",null!=b?b:null),null!=m?m:tc.noDataFillStyle_}function styleRegions(c){if(c.svg()&&c._ternaryColorById_){var g=zt(c),m=c.svg().selectAll(g);m.style("pointer-events","none").transition().duration(h.transitionDuration()).style("fill",regionsFillFunction).end().then(function(){m.style("pointer-events",null),m.each(function(){var c=src_select(this);c.attr("fill___",c.style("fill"))}),addMouseEventsToRegions(c,m),h.gridCartogram_&&c.svg().selectAll(".em-grid-text").each(function(){var c=src_select(this.parentNode).style("fill");src_select(this).attr("fill",getTextColorForBackground(c))})}).catch(function(c){})}}function addMouseEventsToRegions(c,g){var m=function shouldOmit(h){var g;return null===(g=c.tooltip_.omitRegions)||void 0===g?void 0:g.includes(h)};g.on("mouseover",function(g,b){m(b.properties.id)||(src_select(this).style("fill",c.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(b,h)),h.onRegionMouseOver_&&h.onRegionMouseOver_(g,b,this,c))}).on("mousemove",function(g,b){m(b.properties.id)||(h._tooltip&&h._tooltip.mousemove(g),h.onRegionMouseMove_&&h.onRegionMouseMove_(g,b,this,c))}).on("mouseout",function(g,b){if(!m(b.properties.id)){var w=src_select(this);w.style("fill",w.attr("fill___")),h._tooltip&&h._tooltip.mouseout(),h.onRegionMouseOut_&&h.onRegionMouseOut_(g,b,this,c)}})}return g.forEach(function(c){var g=c.slice(0,-1);h[g]=function(g){return arguments.length?("ternarySettings_"===c?h.ternarySettings_=map_choropleth_trivariate_objectSpread(map_choropleth_trivariate_objectSpread({},h.ternarySettings_),g):h[c]=g,h):h[c]}}),c&&g.forEach(function(g){var m=g.slice(0,-1);null!=c[m]&&h[m](c[m])}),h.updateClassification=function(){h._ternaryData_=[],h._ternaryColorById_=new Map,h._ternaryCenter_=null;var c=h.Geometries.getRegionFeatures();if(!c||0===c.length)return h;var g=slicedToArray_slicedToArray(h.ternaryCodes_,3),m=g[0],b=g[1],w=g[2],S=[],M=h.statData(m),k=h.statData(b),T=h.statData(w);c.forEach(function(c){var h=c.properties.id,g=M.get(h),m=k.get(h),b=T.get(h),w=+(null==g?void 0:g.value),E=+(null==m?void 0:m.value),I=+(null==b?void 0:b.value);Number.isFinite(w)&&Number.isFinite(E)&&Number.isFinite(I)&&w+E+I>0&&S.push({id:h,values:[w,E,I]})}),h._ternaryData_=S.map(function(c){return c.values}),h._ternaryCenter_=h.ternarySettings_.meanCentering?CompositionUtils.centre(h._ternaryData_):[1/3,1/3,1/3];var E=function tricolore(c,h={}){const{center:g=[1/3,1/3,1/3],breaks:m=4,hue:b=80,chroma:w=140,lightness:S=80,contrast:M=.4,spread:k=1}=h;return colorMapping_ColorMapping.colorMapTricolore(c,g,m,b,w,S,M,k).map(c=>c.rgb)}(h._ternaryData_,{center:h._ternaryCenter_,breaks:h.ternarySettings_.breaks,hue:h.ternarySettings_.hue,chroma:h.ternarySettings_.chroma,lightness:h.ternarySettings_.lightness,contrast:h.ternarySettings_.contrast,spread:h.ternarySettings_.spread});return h._ternaryColorById_=new Map,h._ternaryClassById_=new Map,S.forEach(function(c,g){var m=E[g];null!=m&&(h._ternaryColorById_.set(c.id,m),h._ternaryClassById_.set(c.id,g))}),h},h.updateStyle=function(){return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,styleRegions),styleRegions(h),addMouseEventsToRegions(h,h.svg().selectAll(zt(h))),h},h.getLegendConstructor=function(){return Ql},h},ec=function tooltipTextFunctionTrivariate(c,h){var g=[],m=c.properties.na||"",b=c.properties.id||"";g.push('<div class="em-tooltip-bar">'.concat(m).concat(b?" (".concat(b,")"):"","</div>"));var w=slicedToArray_slicedToArray(h.ternaryCodes_,3),S=w[0],M=w[1],k=w[2],T=h.statData(S).get(b),E=h.statData(M).get(b),I=h.statData(k).get(b),P=h.statData(S).unitText()||h.statData(M).unit_||h.statData(k).unit_||"";return g.push('<div class="em-tooltip-text" style="background:#fff;color:#171a22;padding:4px;font-size:15px;">\n <table class="em-tooltip-table"><tbody>\n <tr><td>'.concat(h.statData(S).label_||S,": ").concat(null!=T&&T.value?Ft(T.value)+P:"","</td></tr>\n <tr><td>").concat(h.statData(M).label_||M,": ").concat(null!=E&&E.value?Ft(E.value)+P:"","</td></tr>\n <tr><td>").concat(h.statData(k).label_||k,": ").concat(null!=I&&I.value?Ft(I.value)+P:"","</td></tr>\n </tbody></table></div>")),g.join("")};function src_descending(c,h){return h<c?-1:h>c?1:h>=c?0:NaN}function d3_shape_src_identity(c){return c}function src_pie(){var c=d3_shape_src_identity,h=src_descending,g=null,m=node_modules_d3_shape_src_constant(0),b=node_modules_d3_shape_src_constant(rl),w=node_modules_d3_shape_src_constant(0);function pie(S){var M,k,T,E,I,P=(S=d3_shape_src_array(S)).length,L=0,B=new Array(P),z=new Array(P),j=+m.apply(this,arguments),D=Math.min(rl,Math.max(-rl,b.apply(this,arguments)-j)),N=Math.min(Math.abs(D)/P,w.apply(this,arguments)),R=N*(D<0?-1:1);for(M=0;M<P;++M)(I=z[B[M]=M]=+c(S[M],M,S))>0&&(L+=I);for(null!=h?B.sort(function(c,g){return h(z[c],z[g])}):null!=g&&B.sort(function(c,h){return g(S[c],S[h])}),M=0,T=L?(D-P*R)/L:0;M<P;++M,j=E)k=B[M],E=j+((I=z[k])>0?I*T:0)+R,z[k]={data:S[k],index:M,value:I,startAngle:j,endAngle:E,padAngle:N};return z}return pie.value=function(h){return arguments.length?(c="function"==typeof h?h:node_modules_d3_shape_src_constant(+h),pie):c},pie.sortValues=function(c){return arguments.length?(h=c,g=null,pie):h},pie.sort=function(c){return arguments.length?(g=c,h=null,pie):g},pie.startAngle=function(c){return arguments.length?(m="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),pie):m},pie.endAngle=function(c){return arguments.length?(b="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),pie):b},pie.padAngle=function(c){return arguments.length?(w="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),pie):w},pie}function arc_arcInnerRadius(c){return c.innerRadius}function arc_arcOuterRadius(c){return c.outerRadius}function arc_arcStartAngle(c){return c.startAngle}function arc_arcEndAngle(c){return c.endAngle}function arc_arcPadAngle(c){return c&&c.padAngle}function arc_cornerTangents(c,h,g,m,b,w,S){var M=c-g,k=h-m,T=(S?w:-w)/Qs(M*M+k*k),E=T*k,I=-T*M,P=c+E,L=h+I,B=g+E,z=m+I,j=(P+B)/2,D=(L+z)/2,N=B-P,R=z-L,G=N*N+R*R,q=b-w,W=P*z-B*L,H=(R<0?-1:1)*Qs(Ks(0,q*q*G-W*W)),U=(W*R-N*H)/G,Y=(-W*N-R*H)/G,V=(W*R+N*H)/G,$=(-W*N+R*H)/G,X=U-j,K=Y-D,Z=V-j,J=$-D;return X*X+K*K>Z*Z+J*J&&(U=V,Y=$),{cx:U,cy:Y,x01:-E,y01:-I,x11:U*(b/q-1),y11:Y*(b/q-1)}}function src_arc(){var c=arc_arcInnerRadius,h=arc_arcOuterRadius,g=node_modules_d3_shape_src_constant(0),m=null,b=arc_arcStartAngle,w=arc_arcEndAngle,S=arc_arcPadAngle,M=null,k=withPath(arc);function arc(){var T,E,I=+c.apply(this,arguments),P=+h.apply(this,arguments),L=b.apply(this,arguments)-nl,B=w.apply(this,arguments)-nl,z=Vs(B-L),j=B>L;if(M||(M=T=k()),P<I&&(E=P,P=I,I=E),P>tl)if(z>rl-tl)M.moveTo(P*Xs(L),P*Js(L)),M.arc(0,0,P,L,B,!j),I>tl&&(M.moveTo(I*Xs(B),I*Js(B)),M.arc(0,0,I,B,L,j));else{var D,N,R=L,G=B,q=L,W=B,H=z,U=z,Y=S.apply(this,arguments)/2,V=Y>tl&&(m?+m.apply(this,arguments):Qs(I*I+P*P)),$=Zs(Vs(P-I)/2,+g.apply(this,arguments)),X=$,K=$;if(V>tl){var Z=d3_shape_src_math_asin(V/I*Js(Y)),J=d3_shape_src_math_asin(V/P*Js(Y));(H-=2*Z)>tl?(q+=Z*=j?1:-1,W-=Z):(H=0,q=W=(L+B)/2),(U-=2*J)>tl?(R+=J*=j?1:-1,G-=J):(U=0,R=G=(L+B)/2)}var Q=P*Xs(R),tt=P*Js(R),et=I*Xs(W),nt=I*Js(W);if($>tl){var rt,ot=P*Xs(G),at=P*Js(G),it=I*Xs(q),st=I*Js(q);if(z<el)if(rt=function arc_intersect(c,h,g,m,b,w,S,M){var k=g-c,T=m-h,E=S-b,I=M-w,P=I*k-E*T;if(!(P*P<tl))return[c+(P=(E*(h-w)-I*(c-b))/P)*k,h+P*T]}(Q,tt,it,st,ot,at,et,nt)){var lt=Q-rt[0],ct=tt-rt[1],ut=ot-rt[0],ht=at-rt[1],dt=1/Js(function d3_shape_src_math_acos(c){return c>1?0:c<-1?el:Math.acos(c)}((lt*ut+ct*ht)/(Qs(lt*lt+ct*ct)*Qs(ut*ut+ht*ht)))/2),pt=Qs(rt[0]*rt[0]+rt[1]*rt[1]);X=Zs($,(I-pt)/(dt-1)),K=Zs($,(P-pt)/(dt+1))}else X=K=0}U>tl?K>tl?(D=arc_cornerTangents(it,st,Q,tt,P,K,j),N=arc_cornerTangents(ot,at,et,nt,P,K,j),M.moveTo(D.cx+D.x01,D.cy+D.y01),K<$?M.arc(D.cx,D.cy,K,$s(D.y01,D.x01),$s(N.y01,N.x01),!j):(M.arc(D.cx,D.cy,K,$s(D.y01,D.x01),$s(D.y11,D.x11),!j),M.arc(0,0,P,$s(D.cy+D.y11,D.cx+D.x11),$s(N.cy+N.y11,N.cx+N.x11),!j),M.arc(N.cx,N.cy,K,$s(N.y11,N.x11),$s(N.y01,N.x01),!j))):(M.moveTo(Q,tt),M.arc(0,0,P,R,G,!j)):M.moveTo(Q,tt),I>tl&&H>tl?X>tl?(D=arc_cornerTangents(et,nt,ot,at,I,-X,j),N=arc_cornerTangents(Q,tt,it,st,I,-X,j),M.lineTo(D.cx+D.x01,D.cy+D.y01),X<$?M.arc(D.cx,D.cy,X,$s(D.y01,D.x01),$s(N.y01,N.x01),!j):(M.arc(D.cx,D.cy,X,$s(D.y01,D.x01),$s(D.y11,D.x11),!j),M.arc(0,0,I,$s(D.cy+D.y11,D.cx+D.x11),$s(N.cy+N.y11,N.cx+N.x11),j),M.arc(N.cx,N.cy,X,$s(N.y11,N.x11),$s(N.y01,N.x01),!j))):M.arc(0,0,I,W,q,j):M.lineTo(et,nt)}else M.moveTo(0,0);if(M.closePath(),T)return M=null,T+""||null}return arc.centroid=function(){var g=(+c.apply(this,arguments)+ +h.apply(this,arguments))/2,m=(+b.apply(this,arguments)+ +w.apply(this,arguments))/2-el/2;return[Xs(m)*g,Js(m)*g]},arc.innerRadius=function(h){return arguments.length?(c="function"==typeof h?h:node_modules_d3_shape_src_constant(+h),arc):c},arc.outerRadius=function(c){return arguments.length?(h="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),arc):h},arc.cornerRadius=function(c){return arguments.length?(g="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),arc):g},arc.padRadius=function(c){return arguments.length?(m=null==c?null:"function"==typeof c?c:node_modules_d3_shape_src_constant(+c),arc):m},arc.startAngle=function(c){return arguments.length?(b="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),arc):b},arc.endAngle=function(c){return arguments.length?(w="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),arc):w},arc.padAngle=function(c){return arguments.length?(S="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),arc):S},arc.context=function(c){return arguments.length?(M=null==c?null:c,arc):M},arc}const nc=colors("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");var rc=function legend(c,h){var g=wl(c);if(h)for(var m in h)g[m]=h[m];function highlightRegions(c,h){c.svg_.selectAll("pattern").selectAll("rect").each(function(){var c=src_select(this);c.attr("data-original-fill")||c.attr("data-original-fill",c.style("fill")),c.style("fill","white")}),c.svg_.selectAll("pattern").selectAll("rect[code='"+h+"']").each(function(){var c=src_select(this);c.style("fill",c.attr("data-original-fill"))})}function unhighlightRegions(c){c.svg_.selectAll("pattern").selectAll("rect").each(function(){var c=src_select(this),h=c.attr("data-original-fill");h&&c.style("fill",h)})}return g.update=function(){g.updateConfig(),g.updateContainer();var c=g.map,h=c.svg(),m=g.lgg;m.selectAll("*").remove(),g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle();var b=0,w=c.catColors(),S=function _loop(S){var M=g.boxPadding+(g.title?g.titleFontSize+g.boxPadding:0)+b*(g.shapeHeight+g.shapePadding);c.catColors()[S];m.append("rect").attr("class","em-legend-rect").attr("x",g.boxPadding).attr("y",M).attr("width",g.shapeWidth).attr("height",g.shapeHeight).style("fill",w[S]).attr("stroke","black").attr("stroke-width",.5).on("mouseover",function(){src_select(this).raise(),highlightRegions(g.map,S),g.map.insetTemplates_&&Bt(g.map.insetTemplates_,g.map.svgId,highlightRegions,S)}).on("mouseout",function(){unhighlightRegions(g.map),g.map.insetTemplates_&&Bt(g.map.insetTemplates_,g.map.svgId,unhighlightRegions)}),m.append("text").attr("class","em-legend-label").attr("x",g.boxPadding+g.shapeWidth+g.labelOffsets.x).attr("y",M+.5*g.shapeHeight).attr("dy","0.35em").text(c.catLabels()[S]||S).on("mouseover",function(){h.selectAll("pattern").selectAll("rect[code='"+S+"']").style("fill",c.hoverColor())}).on("mouseout",function(){var g=c.catColors()[S]||"lightgray";h.selectAll("pattern").selectAll("rect[code='"+S+"']").style("fill",g)}),b++};for(var M in w)S(M);if(g.noData){var k=g.boxPadding+(g.title?g.titleFontSize+g.boxPadding:0)+b*(g.shapeHeight+g.shapePadding);m.append("rect").attr("class","em-legend-rect").attr("x",g.boxPadding).attr("y",k).attr("width",g.shapeWidth).attr("height",g.shapeHeight).style("fill",c.noDataFillStyle()).on("mouseover",function(){h.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",c.hoverColor()),src_select(this).style("fill",c.hoverColor())}).on("mouseout",function(){h.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",function(h){c.noDataFillStyle()});src_select(this).style("fill",c.noDataFillStyle())}),m.append("text").attr("class","em-legend-label").attr("x",g.boxPadding+g.shapeWidth+g.labelOffsets.x).attr("y",k+.5*g.shapeHeight).text(g.noDataText).on("mouseover",function(){h.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",c.hoverColor())}).on("mouseout",function(){h.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",function(h){c.noDataFillStyle()})})}g.setBoxDimension()},g};function map_stripe_composition_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function map_stripe_composition_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return map_stripe_composition_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?map_stripe_composition_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function map_stripe_composition_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function map_stripe_composition_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function map_stripe_composition_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?map_stripe_composition_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):map_stripe_composition_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}var oc=function legend(c,h){var g=wl(c);if(g.sizeLegend={title:null,titlePadding:10,values:null,labelFormatter:void 0,noData:!1,noDataText:"No data"},g.colorLegend={title:null,titlePadding:10,marginTop:33,labelOffsets:{x:5,y:5},shapeWidth:25,shapeHeight:20,shapePadding:1,noData:!0,noDataText:"No data"},g._sizeLegendHeight=0,h)for(var m in h)if("colorLegend"==m||"sizeLegend"==m){for(var b in g[m])void 0!==h[m][b]&&(g[m][b]=h[m][b]);0==h.colorLegend&&(g.colorLegend=!1)}else g[m]=h[m];function highlightRegions(c,h){var g=c.svg_.selectAll(".piechart").selectAll("path[code]");g.style("opacity",0),g.filter("path[code='"+h+"']").each(function(){src_select(this).style("opacity",1)})}function unhighlightRegions(c){c.svg_.selectAll(".piechart").selectAll("path[code]").each(function(){src_select(this).style("opacity",1)})}return g.update=function(){g.updateConfig(),g.updateContainer();var c=g.map,h=g.lgg;h.selectAll("*").remove(),g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle();var m=g.getBaseY(),b=g.getBaseX();c.classifierSize_&&(g._sizeLegendContainer=h.append("g").attr("class","em-pie-size-legend").attr("transform","translate(".concat(b,", ").concat(m,")")),drawCircleSizeLegend(g,g._sizeLegendContainer,g.sizeLegend.values,c.classifierSize_,g.sizeLegend.title,g.sizeLegend.titlePadding)),function buildColorLegend(c,h,g){var m=c.map,b=c.colorLegend;if(c._colorLegendContainer=c.lgg.append("g").attr("class","em-pie-color-legend"),c._sizeLegendContainer){var w=c._sizeLegendContainer.node().getBBox().height;c._colorLegendContainer.attr("transform","translate(".concat(h,",").concat(w+c.colorLegend.marginTop,")"))}else c._colorLegendContainer.attr("transform","translate(".concat(h,",").concat(g,")"));b.title&&c._colorLegendContainer.append("text").attr("id","em-color-legend-title").attr("class","em-color-legend-title").attr("x",0).attr("y",c.titleFontSize).text(b.title);var S=0,M=m.catColors(),k=function _loop(h){var g=c.colorLegend.titlePadding+(b.title?c.titleFontSize:0)+S*(b.shapeHeight+b.shapePadding);m.catColors()[h];c._colorLegendContainer.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",g).attr("width",b.shapeWidth).attr("height",b.shapeHeight).style("fill",M[h]).on("mouseover",function(){highlightRegions(c.map,h),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,highlightRegions,h)}).on("mouseout",function(){unhighlightRegions(c.map),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,unhighlightRegions,h)}),c._colorLegendContainer.append("text").attr("class","em-legend-label").attr("x",b.shapeWidth+b.labelOffsets.x).attr("y",g+.5*b.shapeHeight).attr("dy","0.35em").text(m.catLabels()[h]||h),S++};for(var T in M)k(T);if(b.noData){var E=0;c._sizeLegendContainer&&(E=c._sizeLegendContainer.node().getBBox().height);var I=E+c.colorLegend.marginTop+c.boxPadding+(b.title?c.titleFontSize+c.boxPadding:0)+S*(b.shapeHeight+b.shapePadding),P=c.lgg.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(c.boxPadding,",").concat(I,")"));c.appendNoDataLegend(P,c.noDataText,highlightRegions,unhighlightRegions)}}(g,b,m),g.setBoxDimension()},g};function map_pie_charts_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function map_pie_charts_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return map_pie_charts_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?map_pie_charts_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function map_pie_charts_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function map_pie_charts_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function map_pie_charts_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?map_pie_charts_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):map_pie_charts_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}var ac=function map(c){var h=Ml(c,!0,"pie");h.dorling_=(null==c?void 0:c.dorling)||!1,h.animateDorling_=!0,h.pieMinRadius_=5,h.pieMaxRadius_=15,h.pieChartInnerRadius_=0,h.pieStrokeFill_="white",h.pieStrokeWidth_=.3,h.tooltipPieRadius_=40,h.tooltipPieInnerRadius_=0,h.catColors_=void 0,h.catLabels_=void 0,h.pieOtherColor_="#FFCC80",h.pieOtherText_="Other",h.showOnlyWhenComplete_=!1,h.classifierSize_=null,h.statPie_=null,h.pieTotalCode_=void 0,h.statCodes_=void 0,["catColors_","catLabels_","showOnlyWhenComplete_","noDataFillStyle_","pieMaxRadius_","pieMinRadius_","pieChartInnerRadius_","pieOtherColor_","pieOtherText_","pieStrokeFill_","pieStrokeWidth_","dorling_","animateDorling_","pieTotalCode_","statCodes_"].forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&["catColors","catLabels","showOnlyWhenComplete","noDataFillStyle","pieMaxRadius","pieMinRadius","pieChartInnerRadius","pieOtherColor","pieOtherText","pieStrokeFill","pieStrokeWidth","statCodes"].forEach(function(g){null!=c[g]&&h[g](c[g])}),h.statPie=function(c,g,m,b,w,S){void 0!==g&&"string"==typeof g&&(c=map_pie_charts_objectSpread(map_pie_charts_objectSpread({},c),{},{categoryParameter:g,categoryCodes:m,categoryLabels:b,categoryColors:w,totalCode:S})),c.stat&&delete(c=map_pie_charts_objectSpread(map_pie_charts_objectSpread({},c.stat),c)).stat;var M=c,k=M.eurostatDatasetCode,T=M.filters,E=M.unitText,I=M.categoryParameter,P=M.categoryCodes,L=M.categoryLabels,B=M.categoryColors,z=M.totalCode;if(!k)return console.error("statPie: eurostatDatasetCode is required"),h;if(!I)return console.error("statPie: categoryParameter is required"),h;if(!P||!P.length)return console.error("statPie: categoryCodes array is required"),h;for(var j=T?map_pie_charts_objectSpread({},T):{},D=0;D<P.length;D++){var N=P[D],R={eurostatDatasetCode:k,unitText:E,filters:map_pie_charts_objectSpread(map_pie_charts_objectSpread({},j),{},_defineProperty({},I,N))};h.stat(N,R),B&&B[D]&&(h.catColors_=h.catColors_||{},h.catColors_[N]=B[D]),L&&L[D]&&(h.catLabels_=h.catLabels_||{},h.catLabels_[N]=L[D])}if(h.statCodes_=P,z){h.pieTotalCode_=z;var G={eurostatDatasetCode:k,unitText:E,filters:map_pie_charts_objectSpread(map_pie_charts_objectSpread({},j),{},_defineProperty({},I,z))};h.stat(z,G)}else h.pieTotalCode_=void 0;return h},h.updateClassification=function(){return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,g),g(h),h};var g=function applyClassificationToMap(c){if(!h.statCodes_){h.statCodes_=Object.keys(h.statData_);var g=h.statCodes_.indexOf("default");g>-1&&h.statCodes_.splice(g,1)}var m=function getDatasetMaxMin(c){var g,m=[];g=c&&c.gridCartogram_?getPieAnchors(c).data():h.getCentroidsGroup(h).selectAll("g.em-centroid").data();return g.forEach(function(c){var h=c.properties.id,g=b(h);g&&m.push(g)}),function extent_extent(c,h){let g,m;if(void 0===h)for(const h of c)null!=h&&(void 0===g?h>=h&&(g=m=h):(g>h&&(g=h),m<h&&(m=h)));else{let b=-1;for(let w of c)null!=(w=h(w,++b,c))&&(void 0===g?w>=w&&(g=m=w):(g>w&&(g=w),m<w&&(m=w)))}return[g,m]}(m)}(c);return isNaN(m[0])||(h.classifierSize_=pow_sqrt().domain(m).range([h.pieMinRadius_,h.pieMaxRadius_])),h};function getPieAnchors(c){return c.gridCartogram_?c.svg().selectAll("#em-grid-container .em-grid-cell"):c.getCentroidsGroup(c).selectAll("g.em-centroid")}function applyStyleToMap(c){if(h.svg_)if(c.gridCartogram_)!function applyStyleToGridCartogram(c){var g=[],w=getPieAnchors(c);w.attr("id",function(c){return g.push(c.properties.id),"pie_"+c.properties.id}),function addPieChartsToGridCartogram(c,g){c.forEach(function(c){var g=h.svg().select("#pie_"+c);if(!g.empty()){var w=m(c);if(w){var S=[];for(var M in w)S.push({code:M,value:w[M]});if(S&&0!==S.length){g.selectAll(".em-pie").remove();var k=g.node().getBBox(),T="hexagon"==h.gridCartogramShape_?0:k.width/2,E="hexagon"==h.gridCartogramShape_?0:k.height/2,I=h.classifierSize_(b(c)),P=h.pieChartInnerRadius_,L=g.append("g").attr("id","piechart_"+c).attr("class","em-pie").attr("transform","translate(".concat(T,", ").concat(E,")")),B=src_pie().sort(null).value(function(c){return c.value}),z=src_arc().innerRadius(P).outerRadius(I),j=L.append("g").attr("class","piechart").attr("stroke",h.pieStrokeFill_).attr("stroke-width",h.pieStrokeWidth_+"px"),D=B(S);j.selectAll("path").data(D).join("path").attr("fill",function(c){return h.catColors_[c.data.code]||"lightgray"}).attr("code",function(c){return c.data.code}).each(function(c){this._current={startAngle:c.startAngle,endAngle:c.startAngle}}).transition().delay(function(c,h){return 150*h}).duration(h.transitionDuration_).attrTween("d",function(c){var h=value(this._current,c);return this._current=h(1),function(c){return z(h(c))}});var N=g.select(".em-grid-shape, .em-grid-rect, .em-grid-hexagon").node();N&&N.nextSibling&&g.node().insertBefore(L.node(),N.nextSibling)}}}}),adjustGridCartogramTextLabels({map:g,getAnchors:getPieAnchors,getRadius:function getRadius(c){var g=b(c);return g?h.classifierSize_(g):0}})}(g,c),function addMouseEventsToGridCartogram(c){var g=h.svg().selectAll("#em-grid-container .em-grid-cell .em-grid-shape"),m=h.svg().selectAll("#em-grid-container .em-grid-cell .em-pie"),w=function getRegionData(c){return src_select(c.closest(".em-grid-cell")).datum()},S=function getShapeForCell(c){return c.select(".em-grid-shape")},M=function getChartForCell(c){return c.select(".piechart")},k=function handleMouseOver(c){var g=w(this);if(g){var m=g.properties.id;if(b(m)){var k=src_select(this.closest(".em-grid-cell")),T=S(k),E=M(k);T.attr("fill___",T.style("fill")),T.style("fill",h.hoverColor_),E.empty()||E.style("stroke-width",h.pieStrokeWidth_+1).style("stroke","black"),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(g,h))}}},T=function handleMouseMove(c){var g=w(this);if(g){var m=g.properties.id;b(m)&&h._tooltip&&h._tooltip.mousemove(c)}},E=function handleMouseOut(c){var g=w(this);if(g){var m=g.properties.id;if(b(m)){var k=src_select(this.closest(".em-grid-cell")),T=S(k),E=M(k);T.style("fill",T.attr("fill___")||""),T.attr("fill___",null),E.empty()||E.style("stroke-width",h.pieStrokeWidth_).style("stroke",h.pieStrokeFill_),h._tooltip&&h._tooltip.mouseout()}}};g.on("mouseover",k).on("mousemove",T).on("mouseout",E),m.style("pointer-events","all").on("mouseover",k).on("mousemove",T).on("mouseout",E)}()}(c);else{var g=[],w=c.getCentroidsGroup(c);if(w){w.selectAll("g.em-centroid").append("g").attr("class","em-pie").attr("id",function(c){return g.push(c),"pie_"+c.properties.id});var S=zt(h),M=h.svg().selectAll(S);"WORLD"!==c.geo_&&"mixed"==c.nutsLevel_&&function styleMixedNUTSRegions(c,h){h.each(function(h){var g=src_select(this);if(!this.parentNode.classList.contains("em-cntrg")){var b=g.attr("lvl"),w=m(h.properties.id),S=w?"WORLD"===c.geo_?"block":null:"none",M=null,k=null;w&&"0"!==b&&(M=g.style("stroke")||"#777","WORLD"===c.geo_&&(k=g.style("stroke-width")||"#777")),g.style("display",S).style("stroke",M).style("stroke-width",k)}})}(c,M),function addPieChartsToMap(c){c.forEach(function(c){var g=c.properties.id,w=[],S=m(g);for(var M in S)w.push({code:M,value:S[M]});if(w&&0!=w.length){var k=h.svg().selectAll("#pie_"+g),T=h.classifierSize_(b(g)),E=h.pieChartInnerRadius_,I=src_pie().sort(null).value(function(c){return c.value}),P=src_arc().innerRadius(E).outerRadius(T),L=k.append("g").attr("class","piechart").attr("stroke",h.pieStrokeFill_).attr("stroke-width",h.pieStrokeWidth_+"px").style("pointer-events","none"),B=I(w);L.selectAll("path").data(B).join("path").attr("fill",function(c){return h.catColors_[c.data.code]||"lightgray"}).attr("code",function(c){return c.data.code}).each(function(c){this._current={startAngle:c.startAngle,endAngle:c.startAngle}}).transition().delay(function(c,h){return 150*h}).duration(h.transitionDuration_).attrTween("d",function(c){var h=value(this._current,c);return this._current=h(1),function(c){return P(h(c))}}).on("end",function(){src_select(L.node()).style("pointer-events",null)});L.on("mouseover",function(c,g){src_select(this).style("stroke-width",h.pieStrokeWidth_+1).style("stroke","black"),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(g,h))}).on("mousemove",function(c){h._tooltip&&h._tooltip.mousemove(c)}).on("mouseout",function(){src_select(this).style("stroke-width",h.pieStrokeWidth_).style("stroke",h.pieStrokeFill_),h._tooltip&&h._tooltip.mouseout()})}})}(g),function addMouseEventsToRegions(c,g){g.on("mouseover",function(c,g){var m=src_select(this);m.attr("fill___",m.style("fill")),m.style("fill",h.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(g,h))}).on("mousemove",function(c,g){h._tooltip&&h._tooltip.mousemove(c)}).on("mouseout",function(){var c=src_select(this);c.attr("fill___")&&(c.style("fill",c.attr("fill___")),h._tooltip&&h._tooltip.mouseout())})}(0,M)}}}h.updateStyle=function(){try{if(!h.classifierSize_)return;if(!h.catColors_){h.catColors({});for(var c=0;c<h.statCodes_.length;c++)h.catColors_[h.statCodes_[c]]=nc[c%10]}return h.pieTotalCode_&&(h.catColors_.other=h.pieOtherColor_,h.catLabels_.other=h.pieOtherText_),h.catLabels_=h.catLabels_||{},h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyStyleToMap),applyStyleToMap(h),h.dorling_&&!h.gridCartogram_?runDorlingSimulation(h,function(c){var g=b(c.properties.id)||0;return h.classifierSize_(g)||0}):stopDorlingSimulation(h),h}catch(c){console.error("Error in pie symbols styling: "+c.message),console.error(c)}};var m=function getComposition(c){for(var g={},m=0,b=h.statCodes_,w=0;w<b.length;w++){var S=b[w],M=h.statData(S).get(c),k=null==M?void 0:M.value;if(null==k||isNaN(k)){if(h.showOnlyWhenComplete())return}else g[S]=k,m+=k}if(h.pieTotalCode_){var T=h.statData(h.pieTotalCode_).get(c),E=null==T?void 0:T.value;m=null==E||isNaN(E)?0:E}if(m&&!isNaN(m)){var I,P=map_pie_charts_createForOfIteratorHelper(b);try{for(P.s();!(I=P.n()).done;){var L=I.value;void 0!==g[L]&&(g[L]/=m)}}catch(c){P.e(c)}finally{P.f()}if(h.pieTotalCode_){var B=Object.values(g).reduce(function(c,h){return c+h},0);g.other=Math.max(0,1-B)}return g}};var b=function getRegionTotal(c){var g,m=0;if(h.pieTotalCode_)!(g=h.statData(h.pieTotalCode_).get(c))||0!=g.value&&!g.value||isNaN(g.value)?h.showOnlyWhenComplete()&&(m=void 0):m=g.value;else for(var b=0;b<h.statCodes_.length;b++){var w=h.statCodes_[b];if(!(g=h.statData(w).get(c))||0!=g.value&&!g.value||isNaN(g.value)){if(h.showOnlyWhenComplete())return}else m+=g.value}if(0!=m)return m};h.getLegendConstructor=function(){return oc};var w=150,S=120,M=Math.min(w,S)/2-10,k=src_pie().sort(null).value(function(c){return c.value}),T=src_arc().innerRadius(0).outerRadius(.8*M),E=src_arc().innerRadius(.9*M).outerRadius(.9*M);return h.tooltip_.textFunction=function pieChartTooltipFunction(c,g){var I=c.properties.na||c.properties.name,P=c.properties.id,L=m(P),B=[];for(var z in L)B.push({code:z,value:L[z]});var j="";if(j+='<div class="em-tooltip-bar">'.concat(I).concat(P?" (".concat(P,")"):"","</div>"),!B||0===B.length)return j+="<div>".concat(h.noDataText(),"</div>");var D,N="",R="",G="",q=map_pie_charts_createForOfIteratorHelper(k(B));try{for(q.s();!(D=q.n()).done;){var W=D.value,H=h.catColors()[W.data.code]||"lightgray",U=T(W);if(N+='<path d="'.concat(U,'" fill="').concat(H,'" stroke="white" stroke-width="1" opacity="0.7"></path>'),W.data.value>.1){var Y=T.centroid(W),V=E.centroid(W),$=E.centroid(W),X=W.startAngle+(W.endAngle-W.startAngle)/2;$[0]=.95*M*(X<Math.PI?1:-1),R+='<polyline points="'.concat(Y.join(",")," ").concat(V.join(",")," ").concat($.join(","),'"\n stroke="black" fill="none" stroke-width="1" />');var K=E.centroid(W);K[0]=.99*M*(X<Math.PI?1:-1);var Z=X<Math.PI?"start":"end",J=(100*W.data.value).toFixed();isNaN(J)||(G+='<text x="'.concat(K[0],'" y="').concat(K[1],'" text-anchor="').concat(Z,'" font-size="12px">\n ').concat(J,"%\n </text>"))}}}catch(c){q.e(c)}finally{q.f()}j+="\n <div class='em-tooltip-piechart-container'>\n <svg viewBox=\"".concat(-75," ").concat(-60," ").concat(w," ").concat(S,'" width="').concat(w,'" height="').concat(115,'">\n <g transform="translate(0,0)">\n ').concat(N,"\n ").concat(R,"\n ").concat(G,"\n </g>\n </svg>\n </div>\n "),j+='<div class="em-tooltip-breakdown">';var Q,tt=h.statCodes_.map(function(c){var g=h.statData(c).get(P);return g&&void 0!==g.value&&null!==g.value?{code:c,label:h.catLabels_[c],value:g.value,color:h.catColors()[c]||"#666"}:null}).filter(Boolean).sort(function(c,h){return h.value-c.value}),et=b(P)||tt.reduce(function(c,h){return c+h.value},0),nt=map_pie_charts_createForOfIteratorHelper(tt);try{for(nt.s();!(Q=nt.n()).done;){var rt,ot=Q.value,at=et?(ot.value/et*100).toFixed(0):0;j+='\n <div class="em-breakdown-item">\n <span class="em-breakdown-color" style="background:'.concat(ot.color,'"></span>\n <span class="em-breakdown-label">').concat(ot.label,'</span>\n <span class="em-breakdown-value">').concat(null!==(rt=ot.value)&&void 0!==rt&&rt.toFixed?Ft(ot.value):0," (").concat(isNaN(at)?0:at,"%)</span>\n </div>\n ")}}catch(c){nt.e(c)}finally{nt.f()}if(null!=et){var it=h.statData(h.statCodes_[0]).unitText()||"";j+='\n <div class="em-breakdown-item em-total">\n <span class="em-breakdown-label">Total</span>\n <span class="em-breakdown-value">'.concat(Ft(et)," ").concat(it,"</span>\n </div>\n ")}return j+="</div>"},h};const src_linear_linear=c=>+c;var ic=function legend(c,h){var g=wl(c);if(g.scaleLegend={title:null,titlePadding:5,showExampleChart:!1,showMaxRegion:!0,exampleData:null,tickCount:5,tickFormat:null,showXAxis:!0,xAxisRotation:-45,xAxisTickStep:1,margin:c.sparkTooltipChart_.margin,lineOpacity:.5,lineStrokeWidth:1},g.noDataLegend={show:!0,text:"No data"},g._scaleLegendHeight=0,g._maxRegionId=null,h)for(var m in h)if("scaleLegend"===m)for(var b in g.scaleLegend)void 0!==h.scaleLegend[b]&&(g.scaleLegend[b]=h.scaleLegend[b]);else if("noDataLegend"===m){if(!1===h.noDataLegend)g.noDataLegend.show=!1;else if("object"===_typeof(h.noDataLegend))for(var w in g.noDataLegend)void 0!==h.noDataLegend[w]&&(g.noDataLegend[w]=h.noDataLegend[w])}else"noData"===m?g.noDataLegend.show=h.noData:"width"===m?g.width=h.width:g[m]=h[m];return g.update=function(){g.updateConfig(),g.updateContainer();var c=g.map,h=g.lgg;h.selectAll("*").remove(),g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle();var m=g.getBaseY(),b=g.getBaseX();c.sparkYScale_&&(g._scaleLegendContainer=h.append("g").attr("class","em-spark-scale-legend em-grid-cell").attr("transform","translate(".concat(b,", ").concat(m,")")),function drawScaleLegend(c,h){var g=c.map,m=c.scaleLegend,b=m.margin,w=g._statDates||[];if(!w.length)return;var S=g.sparkLineWidth_||30,M=g.sparkLineHeight_||20,k=M/S,T=c.width-b.left-b.right,E=T*k,I=function getRegionIds(c){var h=[],g=c.svg_||c.svg();if(!g)return h;if(c.gridCartogram_)g.selectAll("#em-grid-container .em-grid-cell").each(function(c){c&&c.properties&&c.properties.id&&h.push(c.properties.id)});else{var m=c.getCentroidsGroup?c.getCentroidsGroup(c):null;m&&m.selectAll("g.em-centroid").each(function(c){c&&c.properties&&c.properties.id&&h.push(c.properties.id)})}return h}(g),P=I.map(function(c){for(var h=[],m=0;m<w.length;m++){var b=g.statData(w[m]);if(b){var S=b.get(c);S&&null!=S.value&&!isNaN(S.value)&&h.push({x:m,y:S.value})}}return h.length?{id:c,series:h}:null}).filter(Boolean),L=linear_linear().domain([0,w.length-1]).range([0,T]),B=slicedToArray_slicedToArray(function getLegendYDomain(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.05,g=1/0,m=-1/0;if(c.forEach(function(c){c.series.forEach(function(c){null==c.y||isNaN(c.y)||(g=Math.min(g,c.y),m=Math.max(m,c.y))})}),!isFinite(g)||!isFinite(m))return[0,1];if(g===m){var b=0===g?1:.1*Math.abs(g);return[g-b,m+b]}var w=(m-g)*h;return[g-w,m+w]}(P),2),z=B[0],j=B[1],D=linear_linear().domain([z,j]).range([E,0]),N=h.append("g").attr("transform","translate(".concat(b.left,", ").concat(b.top,")"));N.append("g").attr("class","em-spark-legend-y-axis").call(axisLeft(D).ticks(m.tickCount));var R=Math.max(1,m.xAxisTickStep||1),G=w.map(function(c,h){return h}).filter(function(c){return c%R===0});N.append("g").attr("class","em-spark-legend-x-axis").attr("transform","translate(0, ".concat(E,")")).call(axisBottom(L).tickValues(G).tickFormat(function(c){var h,m=w[c];return(null===(h=g.catLabels_)||void 0===h?void 0:h[m])||m})).selectAll("text").style("text-anchor","end").attr("dx","-.8em").attr("dy",".15em").attr("transform","rotate(".concat(m.xAxisRotation||-45,")"));var q=d3_shape_src_line().x(function(c){return L(c.x)}).y(function(c){return D(c.y)}),W=N.append("g").attr("class","em-spark-legend-series"),H=W.selectAll("path").data(P).enter().append("path").attr("d",function(c){return q(c.series)}).attr("fill","none").attr("stroke",g.sparkLineColor_||"#000").attr("stroke-width",m.lineStrokeWidth||1).attr("opacity",m.lineOpacity).style("cursor","pointer");H.on("mouseover",function(c,h){var m,b;H.attr("opacity",.1).attr("stroke-width",.6),src_select(this).attr("opacity",1).attr("stroke-width",1.4).raise();var w=function getRegionById(c,h){var g=c.svg_||c.svg(),m=null;return c.gridCartogram_?g.selectAll("#em-grid-container .em-grid-cell").each(function(c){var g;(null==c||null===(g=c.properties)||void 0===g?void 0:g.id)===h&&(m=c)}):g.selectAll("path").each(function(c){var g;(null==c||null===(g=c.properties)||void 0===g?void 0:g.id)===h&&(m=c)}),m}(g,h.id),S=(null==w||null===(m=w.properties)||void 0===m?void 0:m.na)||(null==w||null===(b=w.properties)||void 0===b?void 0:b.name)||h.id;g._tooltip&&(g._tooltip.mouseover('\n <div class="em-tooltip-bar">\n <b>'.concat(S,"</b> (").concat(h.id,")\n </div>\n ")),g._tooltip.mousemove(c))}).on("mousemove",function(c){g._tooltip&&g._tooltip.mousemove(c)}).on("mouseout",function(){H.attr("opacity",m.lineOpacity).attr("stroke-width",m.lineStrokeWidth),g._tooltip&&g._tooltip.mouseout()}),c._scaleLegendHeight=b.top+E+b.bottom}(g,g._scaleLegendContainer)),g.setBoxDimension()},g};function map_sparklines_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function map_sparklines_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?map_sparklines_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):map_sparklines_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}var sc=function map(c){var h=Ml(c,!0,"spark");h.sparkLineColor_="black",h.sparkAreaColor_="#41afaa",h.sparkLineWidth_=30,h.sparkLineHeight_=20,h.sparkLineStrokeWidth_=.4,h.sparkLineOpacity_=.6,h.sparkType_="line",h.sparkLineCircleRadius_=0,h.sparkTooltipChart_={width:150,height:80,margin:{left:40,right:20,top:10,bottom:40},circleRadius:1.5},h.sparkLineOffsets_={x:0,y:0},h.showOnlyWhenComplete_=!1,h.sparkLineChartFunction_=void 0,h.sparkYScale_=void 0,h.statSpark_=null;var g=["sparkLineColor_","showOnlyWhenComplete_","sparkType_","sparkLineWidth_","sparkLineHeight_","sparkLineStrokeWidth_","sparkLineOpacity_","sparkLineCircleRadius_","sparkLineAreaColor_","sparkTooltipChart_","sparkLineChartFunction_","sparkLineOffsets_"];g.forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&g.forEach(function(g){var m=g.slice(0,-1);null!=c[m]&&h[m](c[m])}),h.sparklineData_=void 0,h.sparklineData=function(c){var g=Object.keys(c[Object.keys(c)[0]]);return h._statDates=g,g.forEach(function(g){var m=Ds(),b={};for(var w in c){var S=c[w];b[w]=S[g]}m.setData(b),h.statData(g,m)}),h},h.statSpark=function(c,g,m){void 0!==g&&Array.isArray(g)&&(c=map_sparklines_objectSpread(map_sparklines_objectSpread({},c),{},{dates:g,labels:m})),c.stat&&delete(c=map_sparklines_objectSpread(map_sparklines_objectSpread({},c.stat),c)).stat;var b=c,w=b.eurostatDatasetCode,S=b.filters,M=b.unitText,k=b.dates,T=b.labels;if(!w)return console.error("statSpark: eurostatDatasetCode is required"),h;if(!k||!k.length)return console.error("statSpark: dates array is required"),h;var E=S?map_sparklines_objectSpread({},S):{};h._primaryDataset_={eurostatDatasetCode:w,filters:E,type:"statSpark"};for(var I=0;I<k.length;I++){var P=k[I],L={eurostatDatasetCode:w,unitText:M,filters:map_sparklines_objectSpread(map_sparklines_objectSpread({},E),{},{time:P})};h.stat(P,L),T&&T[I]&&(h.catLabels_=h.catLabels_||{},h.catLabels_[P]=T[I])}return h._statDates=k,h},h._statDates=void 0;var m=function getComposition(c){for(var g=[],m=0,b=0;b<h._statDates.length;b++){var w=h._statDates[b],S=h.statData(w).get(c);if(!S||0!=S.value&&!S.value||isNaN(S.value)){if(h.showOnlyWhenComplete())return}else g.push({date:w,value:S.value}),m+=S.value}if(0!=m){for(var M=1;M<g.length;M++){var k=g[M-1].value,T=g[M].value;g[M].percentageChange=0===k?.001:(T-k)/k*100}return g}};function applyStyleToMap(c){var g=[];return getSparkAnchors(c).attr("id",function(c){return g.push(c.properties.id),"spark_"+c.properties.id}),function addSparkLinesToMap(c){var g=h.sparkLineOffsets_||{x:0,y:0};"hexagon"===h.gridCartogramShape_&&(g.x-=h.sparkLineWidth_-4,g.y-=h.sparkLineHeight_+4);"square"===h.gridCartogramShape_&&(g.y+=10);c.forEach(function(c){var g=h.svg().select("#spark_"+c),b=m(c);if(b){g.selectAll(".em-sparkline-chart").remove();var w=g.append("g").attr("class","em-sparkline-chart").style("pointer-events","none"),S=h.sparkLineOffsets_||{x:0,y:0},M=0,k=0;if(h.gridCartogram_){var T=g.node().getBBox();M=T.width/2,k=T.height/2;var E=g.select(".em-grid-shape, .em-grid-rect, .em-grid-hexagon").node();E&&E.nextSibling&&g.node().insertBefore(w.node(),E.nextSibling),w.attr("transform","translate(\n ".concat(M+S.x-h.sparkLineWidth_/2,",\n ").concat(k+S.y-h.sparkLineHeight_/2,"\n )"))}createSparkLineChart(w,b,h.sparkLineWidth_,h.sparkLineHeight_)}})}(g),function addMouseEventsToRegions(c){var g;if(c.gridCartogram_)g=h.svg().selectAll("#em-grid-container .em-grid-cell .em-grid-shape");else{var b=zt(c);g=h.svg().selectAll(b)}g.on("mouseover",function(c,g){if(m(g.properties.id)){var b=src_select(this);b.attr("fill___",b.style("fill")),b.style("fill",h.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(g,h))}}).on("mousemove",function(c,g){m(g.properties.id)&&h._tooltip&&h._tooltip.mousemove(c)}).on("mouseout",function(){var c=src_select(this);c.style("fill");c.attr("fill___")&&(c.style("fill",c.attr("fill___")),h._tooltip&&h._tooltip.mouseout())})}(c),c}function getSparkAnchors(c){return c.gridCartogram_?c.svg().selectAll("#em-grid-container .em-grid-cell"):c.getCentroidsGroup(c).selectAll("g.em-centroid")}function createSparkLineChart(c,g,m,b){var w=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return h.sparkLineChartFunction_&&h.sparkLineChartFunction_!==createSparkLineChart?h.sparkLineChartFunction_(c,g,m,b,w):"bar"===h.sparkType_?function createSparkBarChart(c,g,m,b,w){var S=linear_linear().domain([0,g.length-1]).range([.5,m-.5]),M=h.sparkYScale_.range([b,0]),k=slicedToArray_slicedToArray(h.sparkYScale_.domain(),2),T=k[0],E=k[1],I=m/g.length,P=M(0),L=g.length*I,B=(m-L)/2;w&&(c.append("g").attr("class","axis-x").attr("transform","translate(0, ".concat(b,")")).call(axisBottom(S).tickValues(g.map(function(c,h){return h})).tickFormat(function(c){var h;return(null===(h=g[c])||void 0===h?void 0:h.date)||""})).selectAll("text").style("text-anchor","end").attr("dx","-.8em").attr("dy",".15em").attr("transform","rotate(-65)"),c.append("g").attr("class","axis-y").call(axisLeft(M).ticks(5)));var z,j=function getBarColor(c,m){return"function"==typeof h.sparkLineColor_?h.sparkLineColor_(c.value,m,g):h.sparkLineColor_};z=T>=0?b:E<=0?0:P;var D=c.selectAll("rect.spark-bar").data(g).enter().append("rect").attr("class","spark-bar").attr("x",function(c,h){return B+h*I+.05*I}).attr("width",.9*I).attr("fill",function(c,h){return j(c,h)}).attr("opacity",h.sparkLineOpacity_);w?D.attr("y",function(c){return T>=0?M(c.value):E<=0?0:c.value>=0?M(c.value):P}).attr("height",function(c){return T>=0?b-M(c.value):E<=0?M(c.value):Math.abs(M(c.value)-P)}):D.attr("y",z).attr("height",0).transition().duration(h.transitionDuration()).attr("y",function(c){return T>=0?M(c.value):E<=0?0:c.value>=0?M(c.value):P}).attr("height",function(c){return T>=0?b-M(c.value):E<=0?M(c.value):Math.abs(M(c.value)-P)});w&&T<0&&E>0&&c.append("line").attr("x1",0).attr("x2",m).attr("y1",P).attr("y2",P).attr("stroke","gray").attr("stroke-dasharray","2,2").attr("stroke-width",1)}(c,g,m,b,w):function createSparkLineOrAreaChart(c,g,m,b,w){var S=linear_linear().domain([0,g.length-1]).range([.5,m-.5]),M=h.sparkYScale_.range([b,0]),k=slicedToArray_slicedToArray(h.sparkYScale_.domain(),2),T=k[0],E=k[1],I=g.map(function(c,h){return map_sparklines_objectSpread(map_sparklines_objectSpread({},c),{},{scaledXValue:S(h),scaledYValue:M(c.value)})}),P=M(0);w&&(c.append("g").attr("class","axis-x").attr("transform","translate(0, ".concat(b,")")).call(axisBottom(S).tickValues(g.map(function(c,h){return h})).tickFormat(function(c){var h;return(null===(h=g[c])||void 0===h?void 0:h.date)||""})).selectAll("text").style("text-anchor","end").attr("dx","-.8em").attr("dy",".15em").attr("transform","rotate(-65)"),c.append("g").attr("class","axis-y").call(axisLeft(M).ticks(5)),T<0&&E>0&&c.append("line").attr("x1",0).attr("x2",m).attr("y1",P).attr("y2",P).attr("stroke","#999").attr("stroke-dasharray","2,2").attr("stroke-width",1));if("area"===h.sparkType_){var L,B=function getAreaColor(c,m){return"function"==typeof h.sparkAreaColor_?h.sparkAreaColor_(c.value,m,g):h.sparkAreaColor_};L=T>=0?b:E<=0?0:P,c.append("path").datum(I).attr("fill",B).attr("opacity",h.sparkLineOpacity_).attr("fill-opacity",.4).attr("d",function d3_shape_src_area(c,h,g){var m=null,b=node_modules_d3_shape_src_constant(!0),w=null,S=src_curve_linear,M=null,k=withPath(area);function area(T){var E,I,P,L,B,z=(T=d3_shape_src_array(T)).length,j=!1,D=new Array(z),N=new Array(z);for(null==w&&(M=S(B=k())),E=0;E<=z;++E){if(!(E<z&&b(L=T[E],E,T))===j)if(j=!j)I=E,M.areaStart(),M.lineStart();else{for(M.lineEnd(),M.lineStart(),P=E-1;P>=I;--P)M.point(D[P],N[P]);M.lineEnd(),M.areaEnd()}j&&(D[E]=+c(L,E,T),N[E]=+h(L,E,T),M.point(m?+m(L,E,T):D[E],g?+g(L,E,T):N[E]))}if(B)return M=null,B+""||null}function arealine(){return d3_shape_src_line().defined(b).curve(S).context(w)}return c="function"==typeof c?c:void 0===c?src_point_x:node_modules_d3_shape_src_constant(+c),h="function"==typeof h?h:node_modules_d3_shape_src_constant(void 0===h?0:+h),g="function"==typeof g?g:void 0===g?src_point_y:node_modules_d3_shape_src_constant(+g),area.x=function(h){return arguments.length?(c="function"==typeof h?h:node_modules_d3_shape_src_constant(+h),m=null,area):c},area.x0=function(h){return arguments.length?(c="function"==typeof h?h:node_modules_d3_shape_src_constant(+h),area):c},area.x1=function(c){return arguments.length?(m=null==c?null:"function"==typeof c?c:node_modules_d3_shape_src_constant(+c),area):m},area.y=function(c){return arguments.length?(h="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),g=null,area):h},area.y0=function(c){return arguments.length?(h="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),area):h},area.y1=function(c){return arguments.length?(g=null==c?null:"function"==typeof c?c:node_modules_d3_shape_src_constant(+c),area):g},area.lineX0=area.lineY0=function(){return arealine().x(c).y(h)},area.lineY1=function(){return arealine().x(c).y(g)},area.lineX1=function(){return arealine().x(m).y(h)},area.defined=function(c){return arguments.length?(b="function"==typeof c?c:node_modules_d3_shape_src_constant(!!c),area):b},area.curve=function(c){return arguments.length?(S=c,null!=w&&(M=S(w)),area):S},area.context=function(c){return arguments.length?(null==c?w=M=null:M=S(w=c),area):w},area}().x(function(c){return c.scaledXValue}).y0(L).y1(function(c){return c.scaledYValue}))}var z=I.slice(1).map(function(c,h){return{from:I[h],to:c,index:h,value:c.value}}),j=function getSegmentColor(c){return"function"==typeof h.sparkLineColor_?h.sparkLineColor_(c.value,c.index,g):h.sparkLineColor_},D=d3_shape_src_line().x(function(c){return c.scaledXValue}).y(function(c){return c.scaledYValue}),N=c.selectAll("path.spark-line-segment").data(z).enter().append("path").attr("class","spark-line-segment").attr("fill","none").attr("opacity",h.sparkLineOpacity_).attr("stroke-width",h.sparkLineStrokeWidth_+"px").attr("stroke",function(c){return j(c)}).attr("d",function(c){return D([c.from,c.to])});if(!w){var R=h.transitionDuration()/z.length;N.each(function(c,h){var g=src_select(this),m=this.getTotalLength();g.attr("stroke-dasharray",m).attr("stroke-dashoffset",m).transition().delay(h*R).duration(R).ease(src_linear_linear).attr("stroke-dashoffset",0)})}}(c,g,m,b,w)}return h.updateClassification=function(){if(!h._statDates){h._statDates=Object.keys(h.statData_);var c=h._statDates.indexOf("default");c>-1&&h._statDates.splice(c,1)}h.domain=function getDatasetExtent(){var c=1/0,g=-1/0;if(getSparkAnchors(h).data().forEach(function(m){for(var b=m.properties.id,w=0;w<h._statDates.length;w++){var S=h._statDates[w],M=h.statData(S);if(M){var k=M.get(b);k&&!isNaN(k.value)&&(c=Math.min(c,k.value),g=Math.max(g,k.value))}}}),!isFinite(c)||!isFinite(g))return[0,1];return[c,g]}(),h.sparkXScale_=linear_linear().domain([0,h._statDates.length-1]);var g,m,b=slicedToArray_slicedToArray(h.domain,2),w=b[0],S=b[1];if(w>=0)g=0,m=S;else if(S<=0)g=w,m=0;else{var M=Math.max(Math.abs(w),Math.abs(S));g=-M,m=M}var k=.05*(m-g);return g-=k,m+=k,h.sparkYScale_=h.sparkYScale_||linear_linear().domain([g,m]),h},h.updateStyle=function(){try{return applyStyleToMap(h),h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyStyleToMap),h}catch(c){console.error("Error in sparkline styling: "+c.message),console.error(c)}return h},h.tooltip_.textFunction=function(c,g){var b=[],w=c.properties.na||c.properties.name||"",S=c.properties.id;b.push('\n <div class="em-tooltip-bar">\n <b>'.concat(w,"</b>").concat(S?" (".concat(S,")"):"","\n </div>\n "));var M=h.sparkTooltipChart_.height,k=h.sparkTooltipChart_.width,T=h.sparkTooltipChart_.margin,E=m(c.properties.id);if(E){var I=k+T.left+T.right,P=M+T.top+T.bottom,L=function src_create(c){return src_select(src_creator(c).call(document.documentElement))}("div").attr("class","em-tooltip-chart-container");createSparkLineChart(L.append("svg").attr("class","em-tooltip-chart-svg").attr("width",I).attr("height",P).append("g").attr("class","em-tooltip-chart-group").attr("transform","translate(".concat(T.left,", ").concat(T.top,")")),E,k,M,!0),b.push(L.node().outerHTML)}return b.join("")},h.getLegendConstructor=function(){return ic},h},lc=_t?_t(".2s"):function(c){return String(c)},cc=_t?_t(","):function(c){return String(c)};function drawFlowColorLegend(c,h,g){var m,b=c.map;null===(m=c._flowColorContainer)||void 0===m||m.remove(),c._flowColorContainer=c.lgg.append("g").attr("class","em-flow-color-legend").attr("transform","translate(".concat(h,", ").concat(g,")"));var w=c._flowColorContainer.append("text").attr("class","em-color-legend-title").attr("id","em-color-legend-title").attr("dy","0.35em").text(c.flowColorLegend.title||"Destination"),S=[];if("function"==typeof b.flowColor_)S=c.flowColorLegend.items&&c.flowColorLegend.items.length>0?c.flowColorLegend.items.map(function(c){var h;return{label:c.label,color:c.color,key:null!==(h=c.key)&&void 0!==h?h:null}}):[{label:"please specify legend items ...",color:"#888",key:null}];else{var M=b.topLocationColorScale;S=Array.from(b.topLocationKeys||[]).map(function(c){return{key:c,label:b.nodeNameMap.get(c)||c,color:M(c)}}),S.push({key:"Other",label:"Other",color:b.flowColor_})}var k=w.node().getBBox().height+c.flowColorLegend.titlePadding;c.itemHeight;S.forEach(function(h,g){var m=c._flowColorContainer.append("g").attr("class","em-color-legend-item").attr("transform","translate(0, ".concat(22*g+k,")")).style("cursor","pointer").on("mouseover",function(){!function highlightLines(c){if(!c)return;src_selectAll(".em-flow-link, .em-flow-link-bundled").classed("highlighted",function(){return this.getAttribute("data-dest")===c}).classed("dimmed",function(){return!(this.getAttribute("data-dest")===c)})}(h.key),src_select(this).select("text").style("font-weight","bold"),src_select(this).select("rect").attr("stroke","black").attr("stroke-width",2)}).on("mouseout",function(){!function unhighlightLines(){src_selectAll(".em-flow-link, .em-flow-link-bundled").classed("highlighted",!1).classed("dimmed",!1)}(),src_select(this).select("text").style("font-weight","normal"),src_select(this).select("rect").attr("stroke","none")});m.append("rect").attr("width",18).attr("height",22).attr("fill",h.color),m.append("text").attr("x",25).attr("y",14).attr("class","em-legend-label").text(h.label)})}var uc=function legend(c,h){var g=wl(c);if(g.flowWidthLegend={title:null,titlePadding:17,values:null,marginTop:15,labelFormatter:void 0,labels:null,color:"#616161",orientation:"horizontal",segments:3,width:150,maxMin:!1},g.nodeSizeLegend={title:null,titlePadding:25,values:null,labels:null,marginTop:20,labelFormatter:void 0},g.flowColorLegend={title:null,titlePadding:0,marginTop:50,items:[],ticks:!1},g.regionColorLegend={title:null,titlePadding:15,marginTop:30,labels:["Exporter","Importer"]},h)for(var m in h)if("colorLegend"==m||"flowWidthLegend"==m||"nodeSizeLegend"==m||"flowColorLegend"==m||"regionColorLegend"==m){for(var b in g[m])void 0!==h[m][b]&&(g[m][b]=h[m][b]);0==h.colorLegend&&(g.colorLegend=!1)}else g[m]=h[m];return g.update=function(){g.updateConfig(),g.updateContainer();var c=g.map,h=g.lgg;if(c.legend_)for(var m in c.legend_)if("colorLegend"==m||"flowWidthLegend"==m||"nodeSizeLegend"==m||"flowColorLegend"==m||"regionColorLegend"==m)for(var b in g[m])void 0!==c.legend_[m][b]&&(g[m][b]=c.legend_[m][b]);else g[m]=c.legend_[m];h.selectAll("*").remove(),g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle(),function buildFlowLegend(c){var h=c.map,g=c.getBaseX(),m=c.getBaseY();c.flowWidthLegend&&("vertical"==c.flowWidthLegend.orientation?function drawVerticalFlowWidthLegend(c,h,g){var m,b=c.map;if(b.strokeWidthScale){c._flowWidthContainer=c.lgg.append("g").attr("class","em-flow-width-legend").attr("transform","translate(".concat(h,", ").concat(g,")"));var w=c.flowWidthLegend,S=null!==(m=w.segments)&&void 0!==m?m:5;w.title&&c._flowWidthContainer.append("text").attr("class","em-width-legend-title").text(w.title||"Flow width");for(var M=[],k=c.map.maxFlowCount,T=c.map.minFlowCount,E=0;E<S;E++){var I=1===S?.5:E/(S-1);M.push(T+I*(k-T))}var P=w.values||M,L=w.titlePadding||10,B=b.strokeWidthScale;P.forEach(function(h,g){var m=B(h);if(g>0){var b=B(P[g-1]);L+=b/2+m/g+7}var S=w.labelFormatter?w.labelFormatter(h):Ft(h);w.labels&&w.labels[g]&&(S=w.labels[g]),c._flowWidthContainer.append("line").attr("x1",0).attr("x2",40).attr("y1",L).attr("y2",L).attr("stroke",w.color?w.color:"#6b6b6b").attr("stroke-width",m),c._flowWidthContainer.append("text").attr("x",50).attr("y",L).attr("dy","0.35em").attr("class","em-legend-label").text(S)})}}(c,g,m+c.flowWidthLegend.marginTop):function drawHorizontalFlowWidthLegend(c,h,g){var m,b,w,S;if(!c)return null;var M=c.map||c;if(!M||!M.strokeWidthScale)return null;c._flowWidthContainer&&c._flowWidthContainer.remove();var k=c.flowWidthLegend;c._flowWidthContainer=c.lgg.append("g").attr("class","em-flow-width-legend-horizontal").attr("transform","translate(".concat(h,", ").concat(g,")")),k.title&&c._flowWidthContainer.append("text").attr("class","em-width-legend-title").text(k.title||"Flow width");for(var T=null!==(m=k.x)&&void 0!==m?m:0,E=k.width||c.width,I=null!==(b=k.segments)&&void 0!==b?b:5,P=null!==(w=k.labelOffset)&&void 0!==w?w:12,L=null!==(S=k.pad)&&void 0!==S?S:0,B=T+L,z=T+E-L,j=Math.max(0,z-B),D=[],N=c.map.maxFlowCount,R=c.map.minFlowCount,G=0;G<I+1;G++){var q=1===I?.5:G/(I-1);D.push(R+q*(N-R))}var W=k.values||D,H=Math.max(1,W.length-1),U=j/H,Y=W.map(function(c){return Math.max(.5,M.strokeWidthScale(c))}),V=Math.max.apply(Math,toConsumableArray_toConsumableArray(Y)),$=M.strokeWidthScale(N)+k.titlePadding,X=c._flowWidthContainer.append("g").attr("class","em-flow-legend-texts"),K=c._flowWidthContainer.append("g").attr("class","em-flow-legend-lines");K.append("line").attr("class","em-flow-legend-baseline").attr("x1",B).attr("x2",z).attr("y1",$).attr("y2",$).attr("stroke","#eee").attr("stroke-width",1);for(var Z=0;Z<H;Z++){var J,Q,tt=B+Z*U,et=Z===H-1?z:B+(Z+1)*U,nt=Y[Z],rt=W[Z];K.append("line").style("stroke-width",nt).attr("x1",tt).attr("x2",et).attr("y1",$).attr("y2",$).style("stroke",null!==(J=k.color)&&void 0!==J?J:"#000").style("stroke-opacity",null!==(Q=k.strokeOpacity)&&void 0!==Q?Q:1);var ot=(tt+et)/2;X.append("text").attr("x",ot).attr("y",$-P).attr("dy","-0.35em").attr("class","em-legend-label em-flow-legend-label em-flow-width-horizontal-label").text(lc(rt))}k.maxMin&&(X.append("text").attr("x",B).attr("y",$+V+6).attr("class","em-legend-label em-flow-legend-min-label").attr("dy","0.5em").text(cc(Math.round(R))),X.append("text").attr("x",z).attr("y",$+V+6).attr("class","em-legend-label em-flow-legend-max-label").attr("dy","0.5em").text(cc(Math.round(N))))}(c,g,m+c.flowWidthLegend.marginTop));var b=c._flowWidthContainer.node(),w=b.getBBox().height;h.flowNodes_&&h._nodeSizeScale&&(c._nodeLegendContainer=c.lgg.append("g").attr("class","em-node-color-legend").attr("transform","translate(".concat(g,", ").concat(m+w,")")),c._nodeSizeContainer=c._nodeLegendContainer.append("g").attr("class","em-node-size-legend").attr("transform","translate(".concat(0,", ",c.nodeSizeLegend.marginTop,")")),drawCircleSizeLegend(c,c._nodeSizeContainer,c.nodeSizeLegend.values,h._nodeSizeScale,c.nodeSizeLegend.title,c.nodeSizeLegend.titlePadding));if(c.flowColorLegend&&(h.flowNodes_&&h._nodeSizeScale||"function"==typeof h.flowColor_)){var S=c.lgg.node().getBBox().height+c.flowColorLegend.marginTop;drawFlowColorLegend(c,g,S)}if((h.importerRegionIds.length>0||h.exporterRegionIds.length>0)&&c.regionColorLegend){var M=c.lgg.node().getBBox().height+c.regionColorLegend.marginTop;!function drawRegionColorLegend(c,h,g){var m;null===(m=c._regionColorContainer)||void 0===m||m.remove(),c._regionColorContainer=c.lgg.append("g").attr("class","em-flow-region-color-legend").attr("transform","translate(".concat(h,", ").concat(g,")"));c._regionColorContainer.append("text").attr("class","em-color-legend-title").attr("id","em-color-legend-title").attr("dy","0.35em").text(c.regionColorLegend.title||"Region fill colors");var b=c.map,w=_defineProperty(_defineProperty({},c.regionColorLegend.labels[0],b.flowRegionColors_[0]),c.regionColorLegend.labels[1],b.flowRegionColors_[1]),S=c.regionColorLegend.titlePadding;Object.entries(w).forEach(function(h,g){var m=slicedToArray_slicedToArray(h,2),b=m[0],w=m[1];c._regionColorContainer.append("rect").attr("x",0).attr("y",S+20*g).attr("width",c.shapeWidth).attr("height",c.shapeHeight).attr("fill",w),c._regionColorContainer.append("text").attr("x",c.shapeWidth+5).attr("y",S+20*g+15).attr("class","em-legend-label").text(b)})}(c,g,M)}}(g),g.setBoxDimension()},g};function sum_sum(c,h){let g=0;if(void 0===h)for(let h of c)(h=+h)&&(g+=h);else{let m=-1;for(let b of c)(b=+h(b,++m,c))&&(g+=b)}return g}function ensureArrowMarkers(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},g=h.cacheKey,m=void 0===g?"default":g,b=h.scale,w=void 0===b?1:b,S=h.markerUnits,M=void 0===S?"strokeWidth":S,k=h.hoverColor,T=void 0===k?"black":k,E=h.outlineColor,I=void 0===E?"#ffffff":E,P=h.idBase,L=void 0===P?function uid(){return"".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"arrow","-").concat(Math.random().toString(36).slice(2))}("arrow"):P,B=h.useContextStroke,z=void 0===B||B,j=c.node();if(j._arrowCache||(j._arrowCache=new Map),j._arrowCache.has(m))return j._arrowCache.get(m);var D,N=function ensureDefs(c){var h=c.select("defs");return h.empty()&&(h=c.append("defs")),h}(c),R={normal:"".concat(L),hover:"".concat(L,"-hover"),outline:"".concat(L,"-outline")};(N.select("#".concat(R.normal)).empty()&&createMarker(N,R.normal,{markerUnits:M,scale:w,fill:z?"context-stroke":T,out:h.out}),N.select("#".concat(R.hover)).empty()&&createMarker(N,R.hover,{markerUnits:M,scale:w,fill:T,out:h.out}),N.select("#".concat(R.outline)).empty())&&createMarker(N,R.outline,{markerUnits:M,scale:w,fill:(null===(D=h.out)||void 0===D?void 0:D.flowOutlineColor_)||I,out:h.out});return j._arrowCache.set(m,R),R}function applyArrow(c,h){if(!h)return c;var g=h[arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal"];return c.attr("marker-end",g?"url(#".concat(g,")"):null)}function setHoverArrow(c,h,g){return applyArrow(c,h,g?"hover":"normal")}function createMarker(c,h,g){var m=g.markerUnits,b=void 0===m?"strokeWidth":m,w=g.scale,S=void 0===w?1:w,M=g.fill,k=void 0===M?"context-stroke":M,T=10,E=3*S;c.append("marker").attr("id",h).attr("markerUnits",b).attr("markerWidth",E).attr("markerHeight",E).attr("viewBox","0 0 ".concat(T," ").concat(T)).attr("refX",9.9).attr("refY",5).attr("orient","auto").append("path").attr("fill",k).attr("d","M0,0 L".concat(9.9,",").concat(5," L0,").concat(T," L").concat(2.2,",").concat(5," Z"))}function flow_bidirectional_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function flow_bidirectional_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?flow_bidirectional_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):flow_bidirectional_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}function flow_bidirectional_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function flow_bidirectional_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return flow_bidirectional_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?flow_bidirectional_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function flow_bidirectional_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function buildBidirectionalRouteMap(c,h){var g,m=new Map(c.map(function(c){return[c.id,c]})),b=new Map,w=flow_bidirectional_createForOfIteratorHelper(h);try{for(w.s();!(g=w.n()).done;){var S=g.value,M="object"===_typeof(S.source)?S.source.id:S.source,k="object"===_typeof(S.target)?S.target.id:S.target,T=m.get(M),E=m.get(k);if(T&&E){var I=M<k?"".concat(M,"|").concat(k):"".concat(k,"|").concat(M);if(!b.has(I)){var P=M<k?T:E,L=M<k?E:T;b.set(I,{key:I,idA:P.id,idB:L.id,nodeA:P,nodeB:L,coordsA:[P.x,P.y],coordsB:[L.x,L.y],flowAB:0,flowBA:0,sampleAB:null,sampleBA:null})}var B=b.get(I),z=+S.value||0;M===B.idA&&k===B.idB?(B.flowAB+=z,B.sampleAB||(B.sampleAB=S)):(B.flowBA+=z,B.sampleBA||(B.sampleBA=S))}}}catch(c){w.e(c)}finally{w.f()}return b}function sankey_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function sankey_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return sankey_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?sankey_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function sankey_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function sankey_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function sankey_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?sankey_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):sankey_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}function createSankeyFlowMap(c,h){var g=c.svg_,m=c.flowGraph_,b=c.flowColorGradient_||c.flowOpacityGradient_;c._nodeById=c._nodeById||new Map(m.nodes.map(function(c){return[c.id,c]}));var w=function expandRoutesToSankeyMidpointGraph(c,h){var g,m=buildBidirectionalRouteMap(c,h),b=new Map(c.map(function(c){return[c.id,c]})),w=c.map(function(c){return flow_bidirectional_objectSpread({},c)}),S=[],M=0,k=flow_bidirectional_createForOfIteratorHelper(m.values());try{for(k.s();!(g=k.n()).done;){var T=g.value,E=T.idA,I=T.idB,P=T.coordsA,L=T.coordsB,B=T.flowAB,z=T.flowBA,j=T.sampleAB,D=T.sampleBA,N=b.get(E),R=b.get(I);if(N&&R){var G=j?flow_bidirectional_objectSpread({},j):{},q=D?flow_bidirectional_objectSpread({},D):{};if(delete G.source,delete G.target,delete G.value,delete q.source,delete q.target,delete q.value,B>0&&z>0){var W="__mid__".concat(E,"__").concat(I,"__").concat(M++),H={id:W,x:(P[0]+L[0])/2,y:(P[1]+L[1])/2,isMidpoint:!0};w.push(H),S.push(flow_bidirectional_objectSpread(flow_bidirectional_objectSpread({},G),{},{source:W,target:I,value:B,route:T,originId:E,destId:I,dir:"AtoB"})),S.push(flow_bidirectional_objectSpread(flow_bidirectional_objectSpread({},q),{},{source:W,target:E,value:z,route:T,originId:I,destId:E,dir:"BtoA"}))}else B>0?S.push(flow_bidirectional_objectSpread(flow_bidirectional_objectSpread({},G),{},{source:E,target:I,value:B,route:T,originId:E,destId:I,dir:"AtoB"})):z>0&&S.push(flow_bidirectional_objectSpread(flow_bidirectional_objectSpread({},q),{},{source:I,target:E,value:z,route:T,originId:I,destId:E,dir:"BtoA"}))}}}catch(c){k.e(c)}finally{k.f()}return{nodes:w,links:S}}(m.nodes,m.links),S=function sankey(c,h){var g=function cloneGraph(c){var h=c.nodes,g=c.links;return{nodes:h.map(function(c){return sankey_objectSpread({},c)}),links:g.map(function(c){return sankey_objectSpread({},c)})}}(h);return function initGraphLinks(c){var h,g=c.nodes,m=c.links,b=function id(c){return c.id},w=sankey_createForOfIteratorHelper(g.entries());try{for(w.s();!(h=w.n()).done;){var S=slicedToArray_slicedToArray(h.value,2),M=S[0],k=S[1];k.index=M,k.sourceLinks=[],k.targetLinks=[]}}catch(c){w.e(c)}finally{w.f()}var T,E=new Map(g.map(function(c,h){return[b(c,h,g),c]})),I=sankey_createForOfIteratorHelper(m.entries());try{for(I.s();!(T=I.n()).done;){var P=slicedToArray_slicedToArray(T.value,2),L=P[0],B=P[1];B.index=L;var z=B.source,j=B.target;"object"!==_typeof(z)&&(z=B.source=E.get(z)),"object"!==_typeof(j)&&(j=B.target=E.get(j)),z&&j&&(z.sourceLinks.push(B),j.targetLinks.push(B))}}catch(c){I.e(c)}finally{I.f()}}(g),function computeNodeValues(c){var h,g=c.nodes,m=sankey_createForOfIteratorHelper(g);try{for(m.s();!(h=m.n()).done;){var b=h.value;b.value=Math.max(sum_sum(b.sourceLinks,function(c){return c.value}),sum_sum(b.targetLinks,function(c){return c.value}))}}catch(c){m.e(c)}finally{m.f()}}(g),function computeNodeDepths(c){var h=c.nodes,g=h.length,m=new Set(h),b=new Set,w=0;for(;m.size;){var S,M=sankey_createForOfIteratorHelper(m);try{for(M.s();!(S=M.n()).done;){var k=S.value;k.depth=w;var T,E=sankey_createForOfIteratorHelper(k.sourceLinks);try{for(E.s();!(T=E.n()).done;){var I=T.value.target;b.add(I)}}catch(c){E.e(c)}finally{E.f()}}}catch(c){M.e(c)}finally{M.f()}if(++w>g){console.log("Detected circular link(s); continuing layout.");break}m=b,b=new Set}}(g),function computeNodeHeights(c){var h=c.nodes,g=new Set,m=[];function visit(c){var h,b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(g.has(c))return null!==(h=c.height)&&void 0!==h?h:0;g.add(c),m.push(c);var w,S=0,M=sankey_createForOfIteratorHelper(c.targetLinks);try{for(M.s();!(w=M.n()).done;){var k=w.value.source;if(m.includes(k))console.log("Circular link detected between ".concat(k.id," and ").concat(c.id));else{var T=visit(k,b+1);T+1>S&&(S=T+1)}}}catch(c){M.e(c)}finally{M.f()}return c.height=S,m.pop(),S}var b,w=sankey_createForOfIteratorHelper(h);try{for(w.s();!(b=w.n()).done;){visit(b.value)}}catch(c){w.e(c)}finally{w.f()}var S,M=Math.min.apply(Math,toConsumableArray_toConsumableArray(h.map(function(c){var h;return null!==(h=c.height)&&void 0!==h?h:0}))),k=sankey_createForOfIteratorHelper(h);try{for(k.s();!(S=k.n()).done;){var T,E=S.value;E.height=(null!==(T=E.height)&&void 0!==T?T:0)-M}}catch(c){k.e(c)}finally{k.f()}}(g),function computeNodeBreadths(c,h){var g,m=h.nodes,b=sankey_createForOfIteratorHelper(m);try{for(b.s();!(g=b.n()).done;){var w=g.value;w.sourceLinks.forEach(function(h){return h.width=c.strokeWidthScale(h.value)}),w.targetLinks.forEach(function(h){return h.width=c.strokeWidthScale(h.value)});var S=Math.max(sum_sum(w.sourceLinks,function(c){return c.width}),sum_sum(w.targetLinks,function(c){return c.width}));w.x0=w.x1=w.x,w.y0=w.y-S/2,w.y1=w.y+S/2}}catch(c){b.e(c)}finally{b.f()}!function reorderLinks(c){var h,g=sankey_createForOfIteratorHelper(c);try{for(g.s();!(h=g.n()).done;){var m=h.value,b=m.sourceLinks,w=m.targetLinks;b.sort(function(c,h){return c.target.y-h.target.y}),w.sort(function(c,h){return c.source.y-h.source.y})}}catch(c){g.e(c)}finally{g.f()}}(m)}(c,g),function computeLinkBreadths(c,h){var g,m=h.nodes,b=sankey_createForOfIteratorHelper(m);try{for(b.s();!(g=b.n()).done;){var w=g.value,S=w.y;if(w.isMidpoint){var M,k=sankey_createForOfIteratorHelper(w.sourceLinks);try{for(k.s();!(M=k.n()).done;){M.value.y0=S}}catch(c){k.e(c)}finally{k.f()}var T,E=sankey_createForOfIteratorHelper(w.targetLinks);try{for(E.s();!(T=E.n()).done;){T.value.y1=S}}catch(c){E.e(c)}finally{E.f()}w.y0=S,w.y1=S}else if(c.flowStack_){var I,P=[],L=[],B=sankey_createForOfIteratorHelper(w.sourceLinks);try{for(B.s();!(I=B.n()).done;){var z=I.value,j=z.target,D={link:z,width:z.width,otherY:j.y,at:"out"};(j.x<w.x?P:L).push(D)}}catch(c){B.e(c)}finally{B.f()}var N,R=sankey_createForOfIteratorHelper(w.targetLinks);try{for(R.s();!(N=R.n()).done;){var G=N.value,q=G.source,W={link:G,width:G.width,otherY:q.y,at:"in"};(q.x<w.x?P:L).push(W)}}catch(c){R.e(c)}finally{R.f()}var H=P.reduce(function(c,h){return c+h.width},0),U=L.reduce(function(c,h){return c+h.width},0);P.sort(c.flowOrder_),L.sort(c.flowOrder_);for(var Y=S-H/2,V=0,$=P;V<$.length;V++){var X=$[V],K=Y+X.width/2;"out"===X.at?X.link.y0=K:X.link.y1=K,Y+=X.width}for(var Z=S-U/2,J=0,Q=L;J<Q.length;J++){var tt=Q[J],et=Z+tt.width/2;"out"===tt.at?tt.link.y0=et:tt.link.y1=et,Z+=tt.width}var nt=Math.max(H,U);w.y0=S-nt/2,w.y1=S+nt/2}else{var rt,ot=sankey_createForOfIteratorHelper(w.sourceLinks);try{for(ot.s();!(rt=ot.n()).done;){rt.value.y0=S}}catch(c){ot.e(c)}finally{ot.f()}var at,it=sankey_createForOfIteratorHelper(w.targetLinks);try{for(it.s();!(at=it.n()).done;){at.value.y1=S}}catch(c){it.e(c)}finally{it.f()}w.y0=S,w.y1=S}}}catch(c){b.e(c)}finally{b.f()}}(c,g),function adjustMidpointNodes(c){var h,g=c.nodes,m=sankey_createForOfIteratorHelper(g);try{for(m.s();!(h=m.n()).done;){var b=h.value;if(b.isMidpoint){var w=[].concat(toConsumableArray_toConsumableArray(b.sourceLinks||[]),toConsumableArray_toConsumableArray(b.targetLinks||[]));if(2===w.length){var S,M=[],k=sankey_createForOfIteratorHelper(w);try{for(k.s();!(S=k.n()).done;){var T=S.value;T.source===b?M.push({x:T.target.x0,y:T.y1}):T.target===b&&M.push({x:T.source.x1,y:T.y0})}}catch(c){k.e(c)}finally{k.f()}if(2===M.length){var E=(M[0].y+M[1].y)/2;b.y=E,b.y0=E,b.y1=E;var I,P=sankey_createForOfIteratorHelper(w);try{for(P.s();!(I=P.n()).done;){var L=I.value;L.source===b&&(L.y0=E),L.target===b&&(L.y1=E)}}catch(c){P.e(c)}finally{P.f()}}}}}}catch(c){m.e(c)}finally{m.f()}}(g),g}(c,w),M=S.nodes,k=S.links,T=c.flowArrows_?ensureArrowMarkers(g,{cacheKey:"sankey",scale:c.flowArrowScale_||1,markerUnits:"strokeWidth",hoverColor:c.hoverColor_||"black",outlineColor:c.flowOutlineColor_||"#ffffff",useContextStroke:!0}):null,E=g.select("defs").empty()?g.append("defs"):g.select("defs"),I=k.map(function(){return generateUniqueId("gradient")});return b&&function addFlowGradients(c,h,g,m){h.selectAll("linearGradient").data(m).join("linearGradient").attr("id",function(c,h){return g[h]}).attr("gradientUnits","userSpaceOnUse").attr("x1",function(c){var h,g,m,b;return null!==(h=null!==(g=null==c||null===(m=c.source)||void 0===m?void 0:m.x1)&&void 0!==g?g:null==c||null===(b=c.target)||void 0===b?void 0:b.x0)&&void 0!==h?h:0}).attr("x2",function(c){var h,g,m,b;return null!==(h=null!==(g=null==c||null===(m=c.target)||void 0===m?void 0:m.x0)&&void 0!==g?g:null==c||null===(b=c.source)||void 0===b?void 0:b.x1)&&void 0!==h?h:0}).attr("y1",function(c){var h,g;return null!==(h=null!==(g=null==c?void 0:c.y0)&&void 0!==g?g:null==c?void 0:c.y1)&&void 0!==h?h:0}).attr("y2",function(c){var h,g;return null!==(h=null!==(g=null==c?void 0:c.y1)&&void 0!==g?g:null==c?void 0:c.y0)&&void 0!==h?h:0}).each(function(h){var g,m,b=src_select(this);b.selectAll("stop").remove();var w=c.flowColorGradient_&&null!==(g=null===(m=c.flowRegionColors_)||void 0===m?void 0:m[0])&&void 0!==g?g:getFlowStroke(c,h),S=c.flowColorGradient_?"function"==typeof c.flowColor_?c.flowColor_(h):c.flowColor_:getFlowStroke(c,h),M=c.flowOpacityGradient_?0:1,k=1;b.append("stop").attr("offset","0%").attr("stop-color",w).attr("stop-opacity",M),b.append("stop").attr("offset","100%").attr("stop-color",S).attr("stop-opacity",k)})}(c,E,I,k),function addSankeyFlows(c,h,g,m,b,w){var S,M=c.flowColorGradient_||c.flowOpacityGradient_,k=function buildFlowsGroup(c,h){return c.append("g").attr("class","em-flow-lines").attr("id","em-flow-lines").style("opacity",h.flowOpacity_)}(h,c),T=c.flowCurvatureSettings_||{},E=null!==(S=T.curvature)&&void 0!==S?S:.5,I=function sankeyLinkAvoidingNodes(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},g=h.gapX,m=void 0===g?10:g,b=h.padX,w=void 0===b?2:b,S=h.padY,M=void 0===S?2:S,k=h.bumpY,T=void 0===k?0:k,E=h.curvature,I=void 0===E?.5:E;return function(h){var g=h.source.x1,b=h.y0,S=h.target.x0,k=h.y1;if(g===S)return"M".concat(g,",").concat(b,"L").concat(S,",").concat(k);var E,P=g>S,L=P?S:g,B=P?k:b,z=P?g:S,j=P?b:k,D=[[L,B]],N=function yAt(c){return B+(j-B)*(z===L?0:(c-L)/(z-L))},R=[],G=sankey_createForOfIteratorHelper(c);try{for(G.s();!(E=G.n()).done;){var q,W,H=E.value;if(H!==h.source&&H!==h.target){var U=H.x0;if(!(U<=L||U>=z)){var Y=null!==(q=H.y0)&&void 0!==q?q:H.y,V=null!==(W=H.y1)&&void 0!==W?W:H.y,$=(Y+V)/2,X=U-w,K=U+w,Z=N(U),J=Z>=$,Q=Y-(J?0:M),tt=V+(J?M:0);if(Z>=Q&&Z<=tt){var et=J?tt+T:Q-T,nt=Math.max(L,X-m),rt=Math.min(z,K+m);if(rt<nt)continue;R.push({x1:nt,x2:rt,y:et})}}}}}catch(c){G.e(c)}finally{G.f()}if(R.length){R.sort(function(c,h){return c.x1-h.x1});var ot,at=[],it=sankey_createForOfIteratorHelper(R);try{for(it.s();!(ot=it.n()).done;){var st=ot.value;if(!at.length||st.x1>at[at.length-1].x2)at.push(sankey_objectSpread({},st));else{var lt=at[at.length-1];lt.x2=Math.max(lt.x2,st.x2),lt.y=st.y}}}catch(c){it.e(c)}finally{it.f()}for(var ct=0,ut=at;ct<ut.length;ct++){var ht=ut[ct],dt=Math.max(L,ht.x1),pt=Math.min(z,ht.x2),ft=D[D.length-1][0];dt>ft&&(D.push([dt,ht.y]),ft=dt),pt>ft&&D.push([pt,ht.y])}}D.push([z,j]),P&&D.reverse();for(var gt="function"==typeof I?I(h):I,_t="M".concat(D[0][0],",").concat(D[0][1]),mt=1;mt<D.length;mt++)_t+=cubicSegment(D[mt-1],D[mt],gt);return _t}}(g,sankey_objectSpread(sankey_objectSpread({},T),{},{curvature:"function"==typeof T.curvature?T.curvature:function(c){return c.source&&c.source.isMidpoint?.5*E:E}}));m.forEach(function(h,g){var m=I(h),S=function computeColorKey(c,h){var g,m,b,w,S,M,k;return c.topLocationKeys&&null!==(g=(m=c.topLocationKeys).has)&&void 0!==g&&g.call(m,null==h||null===(b=h.target)||void 0===b?void 0:b.id)?h.target.id:null!==(w=null!==(S=null==h||null===(M=h.target)||void 0===M?void 0:M.id)&&void 0!==S?S:null==h||null===(k=h.source)||void 0===k?void 0:k.id)&&void 0!==w?w:"Other"}(c,h),T=getFlowStroke(c,h),E=M?"url(#".concat(w[g],")"):T;c.flowOutlines_&&!c.flowWidthGradient_&&function buildOutlinePath(c,h,g,m,b){var w=m.width+c.flowOutlineWidth_,S=getBackoffAndDash(c,w,g),M=S.dashVis,k=S.dashGap,T=h.append("path").attr("d",g).attr("fill","none").attr("class","em-flow-link-outline").attr("stroke",c.flowOutlineColor_).attr("stroke-width",w).attr("stroke-dasharray",c.flowArrows_?"".concat(M," ").concat(k):null).style("pointer-events","none");c.flowArrows_&&applyArrow(T,b,"outline");return T}(c,k,m,h,b);var P=c.flowWidthGradient_?function buildTaperedMain(c,h,g,m,b,w,S){var M=taperedPolygonForLink(m,function(){return g},{startRatio:c.flowWidthGradientSettings_.startRatio,samples:c.flowWidthGradientSettings_.samples,minStartWidth:c.flowWidthGradientSettings_.minStartWidth,capEnd:c.flowArrows_},0);if(c.flowOutlines_){var k=taperedPolygonForLink(m,function(){return g},{startRatio:c.flowWidthGradientSettings_.startRatio,samples:c.flowWidthGradientSettings_.samples,minStartWidth:c.flowWidthGradientSettings_.minStartWidth,capEnd:c.flowArrows_},c.flowOutlineWidth_);h.append("path").attr("d",k).attr("fill",c.flowOutlineColor_).attr("class","em-flow-link-outline")}var T=h.append("path").attr("d",M).attr("fill",b).attr("class","em-flow-link em-flow-link-tapered").attr("data-color-key",w).attr("data-color",S);return T}(c,k,m,h,E,S,T):function buildSimpleMain(c,h,g,m,b,w,S,M){var k=getBackoffAndDash(c,m.width,g),T=k.dashVis,E=k.dashGap,I=h.append("path").attr("d",g).attr("fill","none").attr("class","em-flow-link").attr("stroke",b).attr("stroke-width",m.width).attr("stroke-linecap","butt").attr("stroke-dasharray",c.flowArrows_?"".concat(T," ").concat(E):null).attr("data-color-key",w).attr("data-color",M);c.flowArrows_&&applyArrow(I,S,"normal");return I}(c,k,m,h,E,S,b,T);!function sankey_addMouseEvents(c,h,g){g.usesGradient;var m=g.paint,b=g.link,w=g.arrowIds;h.on("mouseover",function(){c.flowWidthGradient_?src_select(this).attr("fill",c.hoverColor_):(src_select(this).attr("stroke",c.hoverColor_),c.flowArrows_&&setHoverArrow(src_select(this),w,!0)),c._tooltip&&c._tooltip.mouseover(c.tooltip_.textFunction(b,c))}).on("mousemove",function(h){c._tooltip&&c._tooltip.mousemove(h)}).on("mouseout",function(){c.flowWidthGradient_?src_select(this).attr("fill",m):(src_select(this).attr("stroke",m),c.flowArrows_&&setHoverArrow(src_select(this),w,!1)),c._tooltip&&c._tooltip.mouseout()})}(c,P,{usesGradient:M,paint:E,link:h,arrowIds:b})})}(c,h,M,k,T,I),function addNodeStems(c,h,g){var m=g.filter(function(c){return!c.isMidpoint});h.append("g").attr("class","em-flow-node-stems").selectAll("rect").data(m,function(c){return c.id}).join("rect").attr("x",function(c){return c.x0-.5}).attr("y",function(h){return c.flowStack_?h.y0:h.y}).attr("width",1).attr("height",function(h){return c.flowStack_?Math.max(0,h.y1-h.y0):0}).attr("fill","#000")}(c,h,M),g.node()}function getBackoffAndDash(c,h,g){var m=c.flowArrows_?function arrowBackoffPxForStroke(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,g=c*(3*h)*.9;return.85*g}(h,c.flowArrowScale_):0,b=slicedToArray_slicedToArray(function pathDashForBackoff(c,h){var g=Math.max(0,function pathLength(c){var h=document.createElementNS("http://www.w3.org/2000/svg","path");return h.setAttribute("d",c),h.getTotalLength()}(c)),m=Math.max(0,g-Math.min(h,g)),b=Math.min(h,g);return[m,b]}(g,m),2);return{backoff:m,dashVis:b[0],dashGap:b[1]}}function taperedPolygonForLink(c,h){for(var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},m=g.startRatio,b=void 0===m?.25:m,w=g.samples,S=void 0===w?48:w,M=g.minStartWidth,k=void 0===M?1.5:M,T=g.capEnd,E=void 0===T?!out.flowArrows_:T,I=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,P=function samplePathByLength(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:48,g=document.createElementNS("http://www.w3.org/2000/svg","path");g.setAttribute("d",c);for(var m=g.getTotalLength(),b=[],w=0;w<=h;w++){var S=g.getPointAtLength(m*w/h);b.push([S.x,S.y])}return b}(h(c),S),L=[],B=0;B<P.length;B++){var z=P[Math.max(0,B-1)],j=P[Math.min(P.length-1,B+1)],D=j[0]-z[0],N=j[1]-z[1],R=Math.hypot(D,N)||1;L.push([-N/R,D/R])}for(var G=Math.max(k,c.width*b),q=c.width,W=[],H=[],U=P.length-1,Y=0;Y<=U;Y++){var V=(G+(q-G)*(Y/U))/2+I,$=L[Y][0]*V,X=L[Y][1]*V;W.push([P[Y][0]+$,P[Y][1]+X]),H.push([P[Y][0]-$,P[Y][1]-X])}H.reverse(),E&&(W[U][1]=H[0][1]=(W[U][1]+H[0][1])/2);for(var K="M".concat(W[0][0],",").concat(W[0][1]),Z=1;Z<W.length;Z++)K+="L".concat(W[Z][0],",").concat(W[Z][1]);for(var J=0;J<H.length;J++)K+="L".concat(H[J][0],",").concat(H[J][1]);return K+="Z"}function getFlowStroke(c,h){var g,m,b="string"==typeof c.flowColor_?c.flowColor_:"#999999";if("function"==typeof c.flowColor_)try{var w=c.flowColor_(h);if(null!=w)return w}catch(c){console.log("flowColor_ threw in sankey getFlowStroke:",c)}return function colorByTopN(c,h,g,m){if(!c.topLocationKeys||!c.flowTopLocations_||!c.flowNodes_)return m;var b=c.flowTopLocationsType_||"sum";if("origin"===b)return c.topLocationKeys.has(h)?c.topLocationColorScale(h):m;if("destination"===b)return c.topLocationKeys.has(g)?c.topLocationColorScale(g):m;return c.topLocationKeys.has(g)?c.topLocationColorScale(g):c.topLocationKeys.has(h)?c.topLocationColorScale(h):m}(c,null!==(g=h.originId)&&void 0!==g?g:"object"===_typeof(h.source)?h.source.id:h.source,null!==(m=h.destId)&&void 0!==m?m:"object"===_typeof(h.target)?h.target.id:h.target,b)}function cubicSegment(c,h){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5,m=slicedToArray_slicedToArray(c,2),b=m[0],w=m[1],S=slicedToArray_slicedToArray(h,2),M=S[0],k=S[1],T=function xi(c){return b+(M-b)*c},E=T(g),I=T(1-g);return"C".concat(E,",").concat(w," ").concat(I,",").concat(k," ").concat(M,",").concat(k)}function link_index(c){return c.index}function link_find(c,h){var g=c.get(h);if(!g)throw new Error("node not found: "+h);return g}function curve_basis_point(c,h,g){c._context.bezierCurveTo((2*c._x0+c._x1)/3,(2*c._y0+c._y1)/3,(c._x0+2*c._x1)/3,(c._y0+2*c._y1)/3,(c._x0+4*c._x1+h)/6,(c._y0+4*c._y1+g)/6)}function basis_Basis(c){this._context=c}function bundle_Bundle(c,h){this._basis=new basis_Basis(c),this._beta=h}basis_Basis.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:curve_basis_point(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(c,h){switch(c=+c,h=+h,this._point){case 0:this._point=1,this._line?this._context.lineTo(c,h):this._context.moveTo(c,h);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:curve_basis_point(this,c,h)}this._x0=this._x1,this._x1=c,this._y0=this._y1,this._y1=h}},bundle_Bundle.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var c=this._x,h=this._y,g=c.length-1;if(g>0)for(var m,b=c[0],w=h[0],S=c[g]-b,M=h[g]-w,k=-1;++k<=g;)m=k/g,this._basis.point(this._beta*c[k]+(1-this._beta)*(b+m*S),this._beta*h[k]+(1-this._beta)*(w+m*M));this._x=this._y=null,this._basis.lineEnd()},point:function(c,h){this._x.push(+c),this._y.push(+h)}};const hc=function custom(c){function bundle(h){return 1===c?new basis_Basis(h):new bundle_Bundle(h,c)}return bundle.beta=function(c){return custom(+c)},bundle}(.85);function drawEdgeBundleLines(c,h){var g,m=c.width_||c.innerWidth_||1e3,b=c.height_||c.innerHeight_||800,w=Math.sqrt(m*m+b*b),S={segments:linear_linear().domain([0,w]).range([1,10]),nodes:c._nodeSizeScale||pow_sqrt().range([4,18])},M=function generateSegments(c,h,g){var m={nodes:[],links:[],paths:[]};return m.nodes=c.map(function(c){return c.fx=c.x,c.fy=c.y,c}),h.forEach(function(c){for(var h=function distance(c,h){var g=c.x-h.x,m=c.y-h.y;return Math.sqrt(g*g+m*m)}(c.source,c.target),b=Math.round(g.segments(h)),w=linear_linear().domain([0,b+1]).range([c.source.x,c.target.x]),S=linear_linear().domain([0,b+1]).range([c.source.y,c.target.y]),M=c.source,k=[M],T=1;T<=b;T++){var E={x:w(T),y:S(T)};k.push(E),m.nodes.push(E),m.links.push({source:M,target:E}),M=E}k.push(c.target),m.links.push({source:M,target:c.target}),m.paths.push(k)}),m}(c.flowGraph_.nodes,c.flowGraph_.links,S),k=c.flowArrows_?c._arrowIds||{}:null,T=d3_shape_src_line().curve(hc.beta(.85)).x(function(c){return c.x}).y(function(c){return c.y}),E=h.selectAll("path.em-flow-link").data(M.paths).enter().append("path").attr("d",T).attr("class","em-flow-link").attr("fill","none").style("cursor","pointer").style("pointer-events","auto").attr("stroke-linecap","butt").attr("stroke-opacity",null!==(g=c.flowOpacity_)&&void 0!==g?g:1).each(function(h,g){var m,b,w=h[0],S=h[h.length-1],M=w.id||w.code||w.iata,T=S.id||S.code||S.iata,E=null!==(m=null===(b=c.flowGraph_.links)||void 0===b||null===(b=b[g])||void 0===b?void 0:b.value)&&void 0!==m?m:1,I=straight_getFlowStroke(c,M,T,null,E),P=straight_computeColorKey(c,M,T),L=I,B=c.strokeWidthScale(E);src_select(this).attr("data-nb",E).attr("data-origin",M).attr("data-dest",T).attr("data-color",I).attr("data-color-key",P).attr("stroke",L).attr("stroke-width",B).attr("stroke-dasharray",c.flowArrows_?"5 5":null),c.flowArrows_&&applyArrow(src_select(this),k,"normal")});E.on("mouseover",function(h,g){var m,b,w=g[0],S=g[g.length-1],M=w.id||w.code||w.iata,T=S.id||S.code||S.iata,E=null!==(m=null===(b=c.flowGraph_.links)||void 0===b||null===(b=b.find(function(c){return(c.source.id||c.source.code)===M&&(c.target.id||c.target.code)===T}))||void 0===b?void 0:b.value)&&void 0!==m?m:1;onFlowLineMouseOver(c,M,T,E,k).call(this,h)}).on("mousemove",function(h){c._tooltip&&c._tooltip.mousemove(h)}).on("mouseout",function(h,g){var m=src_select(this).attr("data-color");onFlowLineMouseOut(c,m,k).call(this,h)});var I=simulation().alphaDecay(c.flowBundleSettings_.alphaDecay).force("charge",function manyBody(){var c,h,g,m,b,w=d3_force_src_constant(-30),S=1,M=1/0,k=.81;function force(g){var b,w=c.length,S=quadtree(c,x,y).visitAfter(accumulate);for(m=g,b=0;b<w;++b)h=c[b],S.visit(apply)}function initialize(){if(c){var h,g,m=c.length;for(b=new Array(m),h=0;h<m;++h)g=c[h],b[g.index]=+w(g,h,c)}}function accumulate(c){var h,g,m,w,S,M=0,k=0;if(c.length){for(m=w=S=0;S<4;++S)(h=c[S])&&(g=Math.abs(h.value))&&(M+=h.value,k+=g,m+=g*h.x,w+=g*h.y);c.x=m/k,c.y=w/k}else{(h=c).x=h.data.x,h.y=h.data.y;do{M+=b[h.data.index]}while(h=h.next)}c.value=M}function apply(c,w,T,E){if(!c.value)return!0;var I=c.x-h.x,P=c.y-h.y,L=E-w,B=I*I+P*P;if(L*L/k<B)return B<M&&(0===I&&(B+=(I=jiggle(g))*I),0===P&&(B+=(P=jiggle(g))*P),B<S&&(B=Math.sqrt(S*B)),h.vx+=I*c.value*m/B,h.vy+=P*c.value*m/B),!0;if(!(c.length||B>=M)){(c.data!==h||c.next)&&(0===I&&(B+=(I=jiggle(g))*I),0===P&&(B+=(P=jiggle(g))*P),B<S&&(B=Math.sqrt(S*B)));do{c.data!==h&&(L=b[c.data.index]*m/B,h.vx+=I*L,h.vy+=P*L)}while(c=c.next)}}return force.initialize=function(h,m){c=h,g=m,initialize()},force.strength=function(c){return arguments.length?(w="function"==typeof c?c:d3_force_src_constant(+c),initialize(),force):w},force.distanceMin=function(c){return arguments.length?(S=c*c,force):Math.sqrt(S)},force.distanceMax=function(c){return arguments.length?(M=c*c,force):Math.sqrt(M)},force.theta=function(c){return arguments.length?(k=c*c,force):Math.sqrt(k)},force}().strength(c.flowBundleSettings_.chargeStrength).distanceMax(c.flowBundleSettings_.distanceMax?c.flowBundleSettings_.distanceMax:2*S.nodes.range()[1])).force("link",function src_link(c){var h,g,m,b,w,S,M=link_index,k=function defaultStrength(c){return 1/Math.min(b[c.source.index],b[c.target.index])},T=d3_force_src_constant(30),E=1;function force(m){for(var b=0,M=c.length;b<E;++b)for(var k,T,I,P,L,B,z,j=0;j<M;++j)T=(k=c[j]).source,P=(I=k.target).x+I.vx-T.x-T.vx||jiggle(S),L=I.y+I.vy-T.y-T.vy||jiggle(S),P*=B=((B=Math.sqrt(P*P+L*L))-g[j])/B*m*h[j],L*=B,I.vx-=P*(z=w[j]),I.vy-=L*z,T.vx+=P*(z=1-z),T.vy+=L*z}function initialize(){if(m){var S,k,T=m.length,E=c.length,I=new Map(m.map((c,h)=>[M(c,h,m),c]));for(S=0,b=new Array(T);S<E;++S)(k=c[S]).index=S,"object"!=typeof k.source&&(k.source=link_find(I,k.source)),"object"!=typeof k.target&&(k.target=link_find(I,k.target)),b[k.source.index]=(b[k.source.index]||0)+1,b[k.target.index]=(b[k.target.index]||0)+1;for(S=0,w=new Array(E);S<E;++S)k=c[S],w[S]=b[k.source.index]/(b[k.source.index]+b[k.target.index]);h=new Array(E),initializeStrength(),g=new Array(E),initializeDistance()}}function initializeStrength(){if(m)for(var g=0,b=c.length;g<b;++g)h[g]=+k(c[g],g,c)}function initializeDistance(){if(m)for(var h=0,b=c.length;h<b;++h)g[h]=+T(c[h],h,c)}return null==c&&(c=[]),force.initialize=function(c,h){m=c,S=h,initialize()},force.links=function(h){return arguments.length?(c=h,initialize(),force):c},force.id=function(c){return arguments.length?(M=c,force):M},force.iterations=function(c){return arguments.length?(E=+c,force):E},force.strength=function(c){return arguments.length?(k="function"==typeof c?c:d3_force_src_constant(+c),initializeStrength(),force):k},force.distance=function(c){return arguments.length?(T="function"==typeof c?c:d3_force_src_constant(+c),initializeDistance(),force):T},force}().strength(c.flowBundleSettings_.linkStrength).distance(0).iterations(c.flowBundleSettings_.linkIterations)).on("tick",function(){return E.attr("d",T)}).on("end",function(){return console.log("layout complete")});I.nodes(M.nodes),I.force("link").links(M.links)}function straight_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function straight_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return straight_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?straight_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function straight_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function createFlowMap(c,h){!function drawStraightLinesByFlow(c,h){if(null==c||!c.flowGraph_)return;var g=c.svg_||h,m=c.flowArrows_?ensureArrowMarkers(g,{cacheKey:"straight",scale:c.flowArrowScale_||1,markerUnits:"strokeWidth",hoverColor:c.hoverColor_||"black",outlineColor:c.flowOutlineColor_||"#ffffff",useContextStroke:!0}):null,b=function buildSegments(c){var h=c.flowGraph_||{},g=h.nodes,m=void 0===g?[]:g,b=h.links,w=void 0===b?[]:b;c._nodeById=c._nodeById||new Map(m.map(function(c){return[c.id,c]}));var S=[];if(c.flowBidirectional_){var M,k=straight_createForOfIteratorHelper(buildBidirectionalRouteMap(m,w).values());try{for(k.s();!(M=k.n()).done;){var T=M.value,E=T.idA,I=T.idB,P=T.nodeA,L=T.nodeB,B=T.flowAB,z=T.flowBA,j=(P.x+L.x)/2,D=(P.y+L.y)/2;B>0&&z>0?(S.push({originId:E,destId:I,x1:j,y1:D,x2:L.x,y2:L.y,value:B,route:T,nodeA:P,nodeB:L,isHalf:!0}),S.push({originId:I,destId:E,x1:j,y1:D,x2:P.x,y2:P.y,value:z,route:T,nodeA:P,nodeB:L,isHalf:!0})):B>0?S.push({originId:E,destId:I,x1:P.x,y1:P.y,x2:L.x,y2:L.y,value:B,route:T,nodeA:P,nodeB:L}):z>0&&S.push({originId:I,destId:E,x1:L.x,y1:L.y,x2:P.x,y2:P.y,value:z,route:T,nodeA:P,nodeB:L})}}catch(c){k.e(c)}finally{k.f()}}else{var N,R=new Map,G=(c.flowGraph_||{}).links,q=void 0===G?[]:G,W=c._nodeById,H=straight_createForOfIteratorHelper(q);try{for(H.s();!(N=H.n()).done;){var U=N.value,Y=dc(U.source),V=dc(U.target);if(Y&&V&&Y!==V){var $=Y<V?"".concat(Y,"|").concat(V):"".concat(V,"|").concat(Y),X=+U.value||+U.nb||0;if(X>0){var K=W.get(Y)||("object"===_typeof(U.source)?U.source:null),Z=W.get(V)||("object"===_typeof(U.target)?U.target:null);if(K&&Z){var J=R.get($);J?J.value+=X:R.set($,{originId:Y,destId:V,nodeA:K,nodeB:Z,value:X,get x1(){return this.nodeA.x},get y1(){return this.nodeA.y},get x2(){return this.nodeB.x},get y2(){return this.nodeB.y}})}}}}}catch(c){H.e(c)}finally{H.f()}S.push.apply(S,toConsumableArray_toConsumableArray(R.values()))}return S}(c);!function assignWidths(c,h){var g,m=straight_createForOfIteratorHelper(h);try{for(m.s();!(g=m.n()).done;){var b=g.value,w="function"==typeof c.strokeWidthScale?c.strokeWidthScale(b.value):b.value||1;b.width=+(null==w?1:w).toFixed(1)}}catch(c){m.e(c)}finally{m.f()}}(c,b);var w=function prepareGradients(c,h,g){var m=c.flowColorGradient_||c.flowOpacityGradient_;if(!m)return null;for(var b=c.svg_||h,w=b.select("defs").empty()?b.append("defs"):b.select("defs"),S=new Map,M=new Array(g.length),k=0;k<g.length;k++){var T=g[k],E=straight_getFlowStroke(c,T.originId,T.destId,T.route,T.value),I="".concat(Math.round(T.x1),":").concat(Math.round(T.y1),":").concat(Math.round(T.x2),":").concat(Math.round(T.y2),":").concat(E,":").concat(c.flowOpacityGradient_?1:0),P=S.get(I);if(!P){var L,B;P=generateUniqueId("flowgrad"),S.set(I,P);var z=w.append("linearGradient").attr("id",P).attr("gradientUnits","userSpaceOnUse").attr("x1",T.x1).attr("y1",T.y1).attr("x2",T.x2).attr("y2",T.y2),j=c.flowColorGradient_&&null!==(L=null===(B=c.flowRegionColors_)||void 0===B?void 0:B[0])&&void 0!==L?L:E,D=c.flowOpacityGradient_?0:1,N=1;z.append("stop").attr("offset","0%").attr("stop-color",j).attr("stop-opacity",D),z.append("stop").attr("offset","100%").attr("stop-color",E).attr("stop-opacity",N)}M[k]=P}return M}(c,h,b);!function drawSegments(c,h,g,m,b){var w=h.select(".em-flow-lines").empty()?h.append("g").attr("class","em-flow-lines").attr("id","em-flow-lines"):h.select(".em-flow-lines"),S=!!m;if(c.flowEdgeBundling_)return void drawEdgeBundleLines(c,w);for(var M=0;M<g.length;M++){var k=g[M],T=straight_getFlowStroke(c,k.originId,k.destId,k.route,k.value),E=straight_computeColorKey(c,k.originId,k.destId),I=S&&m[M]?"url(#".concat(m[M],")"):T,P=void 0;if(c.flowWidthGradient_){var L,B,z,j,D,N=k.x2-k.x1,R=k.y2-k.y1,G=Math.hypot(N,R)||1,q=-R/G,W=N/G,H=null!==(L=null===(B=c.flowWidthGradientSettings_)||void 0===B?void 0:B.startRatio)&&void 0!==L?L:.25,U=null!==(z=null===(j=c.flowWidthGradientSettings_)||void 0===j?void 0:j.minStartWidth)&&void 0!==z?z:.25*k.width,Y=Math.max(U,k.width*H),V=k.width,$=k.x1+q*(Y/2),X=k.y1+W*(Y/2),K=k.x2+q*(V/2),Z=k.y2+W*(V/2),J=k.x2-q*(V/2),Q=k.y2-W*(V/2),tt=k.x1-q*(Y/2),et=k.y1-W*(Y/2),nt="M".concat($,",").concat(X,"L").concat(K,",").concat(Z,"L").concat(J,",").concat(Q,"L").concat(tt,",").concat(et,"Z");P=w.append("path").attr("d",nt).attr("class","em-flow-link em-flow-link-tapered").attr("fill",I).attr("data-color-key",E).attr("data-color",T).attr("data-nb",k.value).attr("data-origin",k.originId).attr("data-dest",k.destId).attr("opacity",null!==(D=c.flowOpacity_)&&void 0!==D?D:1),c.flowArrows_&&applyArrow(P,b,"normal")}else{var rt,ot=Math.hypot(k.x2-k.x1,k.y2-k.y1)||0,at=c.flowArrows_?straight_arrowBackoffPxForStroke(k.width):0,it=Math.max(0,ot-at),st=c.flowArrows_?Math.min(at,ot):null;P=w.append("line").datum(k).attr("x1",function(c){return c.x1}).attr("y1",function(c){return c.y1}).attr("x2",function(c){return c.x2}).attr("y2",function(c){return c.y2}).attr("class","em-flow-link").attr("data-nb",k.value).attr("data-origin",k.originId).attr("data-dest",k.destId).attr("stroke",I).attr("stroke-width",k.width).attr("stroke-opacity",null!==(rt=c.flowOpacity_)&&void 0!==rt?rt:1).attr("stroke-linecap","butt").attr("stroke-dasharray",c.flowArrows_?"".concat(it," ").concat(st):null).attr("data-color",T).attr("data-color-key",E)}P.on("mouseover",onFlowLineMouseOver(c,k.originId,k.destId,k.value,b)).on("mousemove",onFlowLineMouseMove(c)).on("mouseout",onFlowLineMouseOut(c,T,b)),c.flowArrows_&&applyArrow(P,b,"normal")}}(c,h,b,w,m)}(c,h)}var dc=function idFor(c){var h,g;return c&&"object"===_typeof(c)?null!==(h=null!==(g=c.id)&&void 0!==g?g:c.iata)&&void 0!==h?h:c.code:c};function straight_arrowBackoffPxForStroke(c){return.7*(c*(3*(out.flowArrowScale_||1))*.9)}function straight_getFlowStroke(c,h,g,m,b){var w="string"==typeof c.flowColor_?c.flowColor_:"#999999",S=c._nodeById||new Map(c.flowGraph_.nodes.map(function(c){return[c.id,c]})),M={source:S.get(h)||{id:h},target:S.get(g)||{id:g},value:b,route:m};if("function"==typeof c.flowColor_){var k;try{k=c.flowColor_(M)}catch(c){}if(null==k&&c.flowColor_.length>=3)try{k=c.flowColor_(h,g,m)}catch(c){}if(null!=k)return k}return function straight_colorByTopN(c,h,g,m){if(!c.topLocationKeys||!c.flowTopLocations_)return m;var b=c.flowTopLocationsType_||"sum";if("origin"===b)return c.topLocationKeys.has(h)?c.topLocationColorScale(h):m;if("destination"===b)return c.topLocationKeys.has(g)?c.topLocationColorScale(g):m;return c.topLocationKeys.has(g)?c.topLocationColorScale(g):c.topLocationKeys.has(h)?c.topLocationColorScale(h):m}(c,h,g,w)}function straight_computeColorKey(c,h,g){if(!c.topLocationKeys)return null;var m=c.flowTopLocationsType_||"sum";return"origin"===m?c.topLocationKeys.has(h)?h:"Other":"destination"===m?c.topLocationKeys.has(g)?g:"Other":c.topLocationKeys.has(g)?g:c.topLocationKeys.has(h)?h:"Other"}function onFlowLineMouseOver(c,h,g,m,b){return function(w){var S=c.hoverColor_||"black";if(src_select(this).attr("stroke",S).attr("stroke-opacity",1),c.flowArrows_&&setHoverArrow(src_select(this),b,!0),c._tooltip){var M=c.flowGraph_.nodes.find(function(c){return c.id===h}),k=c.flowGraph_.nodes.find(function(c){return c.id===g}),T={source:M,target:k,value:m};c._tooltip.mouseover(c.tooltip_.textFunction(T,c))}}}function onFlowLineMouseMove(c){return function(h){c._tooltip&&c._tooltip.mousemove(h)}}function onFlowLineMouseOut(c,h,g){return function(){src_select(this).attr("stroke",h).attr("stroke-opacity",c.flowOpacity_),c.flowArrows_&&setHoverArrow(src_select(this),g,!1),c._tooltip&&c._tooltip.mouseout()}}function donuts_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function donuts_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return donuts_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?donuts_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function donuts_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function drawNodeDonuts(c,h){!function computeDonutValues(c){var h,g=c.flowGraph_.nodes,m=c.topLocationKeys||new Set,b=(c.topLocationColorScale,c.flowTopLocationsType_),w=donuts_createForOfIteratorHelper(g);try{var S=function _loop(){var g,w=h.value,S=new Map,M=0,k=donuts_createForOfIteratorHelper(w.targetLinks);try{for(k.s();!(g=k.n()).done;){var T=g.value,E=T.source.id;if(E!==w.id){var I=void 0;I="origin"===b?m.has(E)?E:"Other":"destination"===b?m.has(w.id)?w.id:"Other":m.has(E)||m.has(w.id)?m.has(w.id)?w.id:E:"Other",S.set(I,(S.get(I)||0)+T.value)}else c.flowInternal_&&(M+=T.value)}}catch(c){k.e(c)}finally{k.f()}var P,L=donuts_createForOfIteratorHelper(w.sourceLinks);try{for(L.s();!(P=L.n()).done;){var B=P.value,z=B.target.id;if(z!==w.id){var j=void 0;j="origin"===b?m.has(w.id)?w.id:"Other":"destination"===b?m.has(z)?z:"Other":m.has(z)||m.has(w.id)?m.has(z)?z:w.id:"Other",S.set(j,(S.get(j)||0)+B.value)}else c.flowInternal_&&(M+=B.value)}}catch(c){L.e(c)}finally{L.f()}w.donutValues=Array.from(S.entries()).map(function(h){var g=slicedToArray_slicedToArray(h,2),m=g[0];return{label:m,value:g[1],color:getSegmentColor(m,w.id,c)}}),c.flowInternal_&&M>0&&w.donutValues.push({label:"Internal",value:M,color:"#999"})};for(w.s();!(h=w.n()).done;)S()}catch(c){w.e(c)}finally{w.f()}}(c),function computeDonutLocationStats(c){var h,g={},m=donuts_createForOfIteratorHelper(c.flowGraph_.nodes);try{for(m.s();!(h=m.n()).done;){var b=h.value;g[b.id]={x:b.x,y:b.y,incoming:0,outgoing:0,internal:0}}}catch(c){m.e(c)}finally{m.f()}var w,S=donuts_createForOfIteratorHelper(c.flowGraph_.links);try{for(S.s();!(w=S.n()).done;){var M=w.value,k=M.source.id,T=M.target.id;g[k]&&(g[k].outgoing+=M.value),g[T]&&(g[T].incoming+=M.value),k===T&&(g[k].internal+=M.value)}}catch(c){S.e(c)}finally{S.f()}c.locationStats=g}(c);var g=h.append("g").attr("class","donuts").attr("id","donuts"),m=max_max(c.flowGraph_.nodes,function(c){return sum_sum(c.donutValues,function(c){return c.value})});c._nodeSizeScale=c.flowNodeSizeScale_||pow_sqrt().domain([0,m]).range([3,10]);var b=src_arc().innerRadius(5),w=src_pie().value(function(c){return c.value}).sort(null);Object.entries(c.locationStats).forEach(function(h){var m=slicedToArray_slicedToArray(h,2),S=m[0],M=m[1],k=M.x,T=M.y,E=M.incoming,I=M.outgoing,P=M.internal,L=c.flowInternal_?E+I+P:E+I;if(0!==L){var B=getIncomingBreakdownByOrigin(S,c),z=getOutgoingBreakdownByDestination(S,c),j=[].concat(toConsumableArray_toConsumableArray(B),toConsumableArray_toConsumableArray(z)),D=new Map;j.forEach(function(c){var h=c.color;D.set(h,(D.get(h)||0)+c.value)});var N=Array.from(D,function(c){var h=slicedToArray_slicedToArray(c,2),g=h[0];return{label:g,value:h[1],color:g}}),R=w(N);R.forEach(function(h){h.data.parent={id:S,name:c.nodeNameMap.get(S)||S,donutValues:N}});var G=g.append("g").attr("class","donut-group").attr("transform","translate(".concat(k,",").concat(T,")")).attr("data-total",L),q=c.flowNodeMouseoverFunction_||donutMouseoverFunction;G.selectAll("path").data(R).join("path").attr("d",b.innerRadius(.4*c._nodeSizeScale(L)).outerRadius(c._nodeSizeScale(L))).attr("fill",function(c){return c.data.color}).attr("stroke","white").attr("stroke-width",.5).style("cursor","pointer").on("mouseover",function(h,g){c._tooltip&&c._tooltip.mouseover(q(g,c)),pc(h,c.svg_),donuts_highlightLines(S)}).on("mousemove",function(h,g){c._tooltip&&c._tooltip.mousemove(h)}).on("mouseout",function(h,g){c._tooltip&&c._tooltip.mouseout(),fc(h,c.svg_),donuts_unhighlightLines()}),G.append("circle").attr("r",.4*c._nodeSizeScale(L)).attr("fill","white").style("cursor","pointer").on("mouseover",function(h){var g=R[0];c._tooltip&&c._tooltip.mouseover(q(g,c)),pc(h,c.svg_),donuts_highlightLines(S)}).on("mousemove",function(h){c._tooltip&&c._tooltip.mousemove(h)}).on("mouseout",function(h){c._tooltip&&c._tooltip.mouseout(),fc(h,c.svg_),donuts_unhighlightLines()})}})}function donuts_highlightLines(c){c&&src_selectAll(".em-flow-link, .em-flow-link-bundled").classed("highlighted",function(){var h=this.getAttribute("data-origin"),g=this.getAttribute("data-dest");return h===c||g===c}).classed("dimmed",function(){var h=this.getAttribute("data-origin"),g=this.getAttribute("data-dest");return!(h===c||g===c)})}function donuts_unhighlightLines(){src_selectAll(".em-flow-link, .em-flow-link-bundled").classed("highlighted",!1).classed("dimmed",!1)}function donutMouseoverFunction(c,h){var g,m,b=_t(".0%"),w=c.data.parent,S=sum_sum(w.donutValues,function(c){return c.value}),M=null===(g=h.statData)||void 0===g?void 0:g.call(h),k=(null==M||null===(m=M.unitText)||void 0===m?void 0:m.call(M))||"",T=[];T.push('\n <div class="em-tooltip-bar">\n <b><span class="em-tooltip-label-text">'.concat(w.name||w.id||"Unknown location","</span></b>\n </div>\n ")),T.push('<div class="em-tooltip-text"><table class="em-tooltip-table em-donut-tooltip-table"><tbody>');var E=getIncomingBreakdownByOrigin(w.id,h),I=sum_sum(E,function(c){return c.value});if(I>0){var P=b(I/S);T.push('\n <tr class="em-donut-tooltip-section-header">\n <td>Incoming:</td>\n <td>'.concat(Ft(I)," (").concat(P,")</td>\n </tr>\n ")),E.forEach(function(c){var h=b(c.value/S);T.push('\n <tr class="em-donut-tooltip-row">\n <td class="em-donut-tooltip-label">\n <span class="em-donut-tooltip-colorchip" style="background:'.concat(c.color,'"></span>\n <span class="em-tooltip-label-text">').concat(c.name||c.key,'</span>\n </td>\n <td class="em-donut-tooltip-value">\n ').concat(Ft(c.value)," (").concat(h,")\n </td>\n </tr>\n "))})}var L=getOutgoingBreakdownByDestination(w.id,h),B=sum_sum(L,function(c){return c.value});if(B>0){var z=b(B/S);T.push('\n <tr class="em-donut-tooltip-section-header">\n <td>Outgoing:</td>\n <td>'.concat(Ft(B)," (").concat(z,")</td>\n </tr>\n ")),L.forEach(function(c){var h=b(c.value/S);T.push('\n <tr class="em-donut-tooltip-row">\n <td class="em-donut-tooltip-label">\n <span class="em-donut-tooltip-colorchip" style="background:'.concat(c.color,'"></span>\n <span class="em-tooltip-label-text">').concat(c.name||c.key,'</span>\n </td>\n <td class="em-donut-tooltip-value">\n ').concat(Ft(c.value)," (").concat(h,")\n </td>\n </tr>\n "))})}return T.push('\n <tr class="em-donut-tooltip-total">\n <td colspan="2">Total: '.concat(Ft(S)," ").concat(k,"</td>\n </tr>\n ")),T.push("</tbody></table></div>"),T.join("")}var pc=function highlightDonut(c,h){var g=+h.attr("data-zoom")||1;src_select(c.target.parentNode).selectAll("path").each(function(){var c=src_select(this),h=+c.attr("stroke-width")||0;c.attr("data-stroke-width",h)}).attr("stroke","black").attr("stroke-width",2/g)},fc=function unhighlightDonut(c,h){var g=+h.attr("data-zoom")||1;src_select(c.target.parentNode).selectAll("path").attr("stroke","white").attr("stroke-width",function(){return(+src_select(this).attr("data-stroke-width")||0)/g})};function getIncomingBreakdownByOrigin(c,h){var g,m=h.topLocationKeys,b=h.flowTopLocationsType_,w=h.flowInternal_,S={},M=donuts_createForOfIteratorHelper(h.flowGraph_.links);try{for(M.s();!(g=M.n()).done;){var k=g.value,T=k.source.id,E=k.target.id;if(E===c)if(T!==E){var I=void 0;S[I="destination"===b?c:"origin"===b?m.has(T)?T:"Other":m.has(T)||m.has(c)?m.has(T)?T:c:"Other"]=(S[I]||0)+k.value}else w&&(S.Internal=(S.Internal||0)+k.value)}}catch(c){M.e(c)}finally{M.f()}return sortBreakdown(Object.entries(S).map(function(g){var m,b=slicedToArray_slicedToArray(g,2),w=b[0],S=b[1];return{key:w,name:(null===(m=h.nodeNameMap)||void 0===m?void 0:m.get(w))||w,value:S,color:getSegmentColor(w,c,h)}}))}function getOutgoingBreakdownByDestination(c,h){var g,m=h.topLocationKeys,b=h.flowTopLocationsType_,w=h.flowInternal_,S={},M=donuts_createForOfIteratorHelper(h.flowGraph_.links);try{for(M.s();!(g=M.n()).done;){var k=g.value,T=k.source.id,E=k.target.id;if(T===c)if(T!==E){var I=void 0;S[I="origin"===b?c:"destination"===b?m.has(E)?E:"Other":m.has(E)||m.has(c)?m.has(E)?E:c:"Other"]=(S[I]||0)+k.value}else w&&(S.Internal=(S.Internal||0)+k.value)}}catch(c){M.e(c)}finally{M.f()}return sortBreakdown(Object.entries(S).map(function(g){var m,b=slicedToArray_slicedToArray(g,2),w=b[0],S=b[1];return{key:w,name:(null===(m=h.nodeNameMap)||void 0===m?void 0:m.get(w))||w,value:S,color:getSegmentColor(w,c,h)}}))}function sortBreakdown(c){return c.sort(function(c,h){return"Other"===c.key?1:"Other"===h.key?-1:h.value-c.value})}function getSegmentColor(c,h,g){var m=g.topLocationKeys||new Set,b=g.topLocationColorScale;return"Other"===c?"#666":"Internal"===c?m.has(h)?b(h):"#999":m.has(c)?b(c):"#666"}function circles_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function circles_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return circles_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?circles_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function circles_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function drawNodeCircles(c,h){c.locationStats||function computeCircleLocationStats(c){var h,g={},m=circles_createForOfIteratorHelper(c.flowGraph_.nodes);try{for(m.s();!(h=m.n()).done;){var b=h.value;g[b.id]={x:b.x,y:b.y,incoming:0,outgoing:0,internal:0}}}catch(c){m.e(c)}finally{m.f()}var w,S=circles_createForOfIteratorHelper(c.flowGraph_.links);try{for(S.s();!(w=S.n()).done;){var M=w.value,k=M.source.id,T=M.target.id,E=M.value||0;g[k]&&(g[k].outgoing+=E),g[T]&&(g[T].incoming+=E),k===T&&(g[k].internal+=E)}}catch(c){S.e(c)}finally{S.f()}c.locationStats=g}(c);var g=c.locationStats,m=c.flowInternal_,b=Object.values(g).map(function(c){return m?c.incoming+c.outgoing+c.internal:c.incoming+c.outgoing});max_max(b.length?b:[0]);c._nodeSizeScale=c.flowNodeSizeScale_||createSqrtScale(b,c.flowMaxNodeSize_||20,c.flowMinNodeSize_||0);var w=h.append("g").attr("class","em-node-circles");Object.entries(g).forEach(function(h){var b=slicedToArray_slicedToArray(h,2),S=b[0],M=b[1],k=m?M.incoming+M.outgoing+M.internal:M.incoming+M.outgoing;if(k){var T=w.append("g").attr("class","em-node-circle-group").attr("transform","translate(".concat(M.x,",").concat(M.y,")")).attr("data-id",S),E=c._nodeSizeScale(k);T.append("circle").attr("r",E).attr("class","em-node-circle").attr("fill",function nodeFill(h){var g;return null!==(g=c.topLocationKeys)&&void 0!==g&&g.has(h)?c.topLocationColorScale(h):"string"==typeof c.flowColor_?c.flowColor_:"#2d50a0"}(S)).attr("stroke","white").attr("stroke-width",.5).style("cursor","pointer").on("mouseover",function(h){src_select(this).attr("stroke-width",1.5),c._tooltip&&c._tooltip.mouseover(function makeTooltip(h){var b,w,S,M=g[h],k=M.incoming,T=M.outgoing,E=M.internal,I=m?k+T+E:k+T,P=(null===(b=c.statData)||void 0===b||null===(b=b.call(c))||void 0===b||null===(w=b.unitText)||void 0===w?void 0:w.call(b))||"";return'\n <div class="em-tooltip-bar"><b>'.concat((null===(S=c.nodeNameMap)||void 0===S?void 0:S.get(h))||h,'</b></div>\n <div class="em-tooltip-text">\n <table class="em-tooltip-table"><tbody>\n <tr><td>Incoming:</td><td style="text-align:right">').concat(Ft(k),'</td></tr>\n <tr><td>Outgoing:</td><td style="text-align:right">').concat(Ft(T),"</td></tr>\n ").concat(m?'<tr><td>Internal:</td><td style="text-align:right">'.concat(Ft(E),"</td></tr>"):"",'\n <tr class="em-tooltip-total">\n <td colspan="2" style="padding-top:4px;font-weight:bold;">\n Total: ').concat(Ft(I)," ").concat(P,"\n </td>\n </tr>\n </tbody></table>\n </div>\n ")}(S)),function circles_highlightLines(c){if(!c)return;src_selectAll(".em-flow-link, .em-flow-link-bundled").classed("highlighted",function(){var h=this.getAttribute("data-origin"),g=this.getAttribute("data-dest");return h===c||g===c}).classed("dimmed",function(){var h=this.getAttribute("data-origin"),g=this.getAttribute("data-dest");return!(h===c||g===c)})}(S)}).on("mouseout",function(h){src_select(this).attr("stroke-width",.5),c._tooltip&&c._tooltip.mouseout(h),function circles_unhighlightLines(){src_selectAll(".em-flow-link, .em-flow-link-bundled").classed("highlighted",!1).classed("dimmed",!1)}()}).on("mousemove",function(h){c._tooltip&&c._tooltip.mousemove(h)})}})}function map_flow_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function map_flow_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return map_flow_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?map_flow_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function map_flow_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}var gc=function map(c){var h=Ml(c,!0,"flow");h.strokeWidthScale=null,h.tooltip_.textFunction=_c,h.flowLineType_="curved",h.flowBidirectional_=!0,h.flowStack_=!0,h.flowEdgeBundling_=!1,h.flowCurvatureSettings_={gapX:10,padX:2,padY:2,bumpY:1,curvature:.5},h.flowColor_="#848484ff",h.flowRegionColors_=["#bbd7ee","#c7e3c6"],h.flowRegionLabels_=["Exporter","Importer"],h.flowMaxWidth_=30,h.flowMinWidth_=1,h.flowArrows_=!1,h.flowArrowScale_=.7,h.flowOutlines_=!0,h.flowOutlineWidth_=1.2,h.flowOutlineColor_="#ffffff",h.flowLabelOffsets_={x:3,y:0},h.flowOpacity_=.5,h.flowOrder_=function(c,h){var g,m,b,w,S=c.otherY-h.otherY;if(S)return S;if(c.at!==h.at)return"out"===c.at?-1:1;var M=(null!==(g=h.link.value)&&void 0!==g?g:0)-(null!==(m=c.link.value)&&void 0!==m?m:0);return M||String(null!==(b=c.link.id)&&void 0!==b?b:"").localeCompare(String(null!==(w=h.link.id)&&void 0!==w?w:""))},h.flowNodes_=!1,h.flowNodeType_="circle",h.flowMinNodeSize_=3,h.flowMaxNodeSize_=10,h.flowNodeSizeScale_=null,h.flowInternal_=!0,h.flowTopLocations_=0,h.flowTopLocationsType_="destination",h.flowColorGradient_=!1,h.flowOpacityGradient_=!1,h.flowWidthGradient_=!1,h.flowWidthGradientSettings_={startRatio:.25,samples:48,minStartWidth:1.5,capEnd:!0,curvatureFollow:!0},h.flowBundleSettings_={alphaDecay:.1,chargeStrength:10,distanceMax:null,linkStrength:.7,linkIterations:1};var g=["flowGraph_","flowColor_","flowRegionColors_","flowRegionLabels_","flowArrows_","flowArrowScale_","flowMaxWidth_","flowMinWidth_","flowOutlines_","flowOutlineWidth_","flowOutlineColor_","flowColorGradient_","flowStack_","flowNodes_","flowNodeType_","flowLabelOffsets_","flowLineType_","flowNodeSizeScale_","flowOpacity_","flowInternal_","flowTopLocations_","flowTopLocationsType_","flowCurvatureSettings_","flowOrder_","flowWidthGradient_","flowOpacityGradient_","flowWidthGradientSettings_","flowBidirectional_","flowEdgeBundling_","flowBundleSettings_"];return g.forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&g.forEach(function(g){var m=g.slice(0,-1);null!=c[m]&&h[m](c[m])}),h.updateStyle=function(){var c;h.flowNodes_&&"donut"===h.flowNodeType_&&0==h.flowTopLocations_&&(h.flowTopLocations_=4),function prepareFlowGraph(c){(function addCoordinatesToGraph(c){c.flowGraph_.nodes.forEach(function(h){if("number"!=typeof h.x||"number"!=typeof h.y)if(c.Geometries.centroidsFeatures){var g=c.Geometries.centroidsFeatures.find(function(c){return h.id==c.properties.id});if(g){var m=slicedToArray_slicedToArray(g.geometry.coordinates,2),b=m[0],w=m[1];h.x=b,h.y=w}else console.error("could not find coordinates for",h.id)}else{var S,M,k,T=null===(S=(M=c.Geometries).getRegionFeatures)||void 0===S?void 0:S.call(M),E=null==T?void 0:T.find(function(c){return c.properties.id===h.id}),I=slicedToArray_slicedToArray((null==E||null===(k=E.properties)||void 0===k?void 0:k.centroid)||c._pathFunction.centroid(E),2),P=I[0],L=I[1];h.x=P,h.y=L}})})(c),function projectAllNodeCoordinates(c){var h,g=c.flowGraph_.nodes,m=map_flow_createForOfIteratorHelper(g);try{for(m.s();!(h=m.n()).done;){var b=h.value,w=c._projection([b.x,b.y]);b.x=w[0],b.y=w[1]}}catch(c){m.e(c)}finally{m.f()}}(c),function calculateNodeTotals(c){var h=c.flowGraph_,g=h.nodes,m=h.links,b=new Map;m.forEach(function(c){b.set(c.source,(b.get(c.source)||0)+c.value),b.set(c.target,(b.get(c.target)||0)+c.value)}),g.forEach(function(c){c.value=b.get(c.id)||0})}(c),function computeNodeLinks(c){var h,g=c.flowGraph_.nodes,m=c.flowGraph_.links,b=function id(c){return c.id},w=map_flow_createForOfIteratorHelper(g.entries());try{for(w.s();!(h=w.n()).done;){var S=slicedToArray_slicedToArray(h.value,2),M=S[0],k=S[1];k.index=M,k.sourceLinks=[],k.targetLinks=[]}}catch(c){w.e(c)}finally{w.f()}var T,E=new Map(g.map(function(c,h){return[b(c,h,g),c]})),I=map_flow_createForOfIteratorHelper(m.entries());try{for(I.s();!(T=I.n()).done;){var P=slicedToArray_slicedToArray(T.value,2),L=P[0],B=P[1];B.index=L;var z=B.source,j=B.target;"object"!==_typeof(z)&&(z=B.source=map_flow_find(E,z)),"object"!==_typeof(j)&&(j=B.target=map_flow_find(E,j)),z.sourceLinks.push(B),j.targetLinks.push(B)}}catch(c){I.e(c)}finally{I.f()}}(c),c.flowTopLocations_&&function computeTopFlowLocations(c){var h=c.flowGraph_.nodes,g=c.flowTopLocations_,m=c.flowTopLocationsType_||"sum";h.forEach(function(c){var h=c.sourceLinks.reduce(function(c,h){return c+h.value},0),g=c.targetLinks.reduce(function(c,h){return c+h.value},0);c.topScore="origin"===m?h:"destination"===m?g:h+g});var b=toConsumableArray_toConsumableArray(h).sort(function(c,h){return h.topScore-c.topScore}).slice(0,g);c.topLocationKeys=new Set(b.map(function(c){return c.id})),c.topLocationColorScale=ordinal().domain(b.map(function(c){return c.id})).range(["#00B3E3","#FBBA00","#2BA966","#D23142","#005289","#93397F","#E73E11","#4E4084","#056731","#00667E","#B5B900"])}(c);(function computeMaxMinFlowCounts(c){var h=c.flowGraph_.links.map(function(c){return c.value}).filter(function(c){return c>0});c.maxFlowCount=h.length?max_max(h):0,c.minFlowCount=h.length?min_min(h):0})(c),c.nodeNameMap=new Map(c.flowGraph_.nodes.map(function(c){return[c.id,c.name||c.id]}))}(h),function defineWidthScale(c){var h=c.flowGraph_.links,g=h.map(function(c){return c.value}).filter(function(c){return c>0}),m=max_max(g),b=(min_min(g),Math.max(0,c.flowMinWidth_||0)),w=c.flowMaxWidth_,S=linear_linear().domain([0,m]).range([0,w]).clamp(!0),M=function strokeWidthScale(c){var h=+c;return!Number.isFinite(h)||h<=0?0:Math.max(b,S(h))};M.domain=function(){return arguments.length?(S.domain.apply(S,arguments),M):S.domain()},c.strokeWidthScale=M}(h);var g=src_select("#em-zoom-group-"+h.svgId_),m=g.select("#em-flow-container");m.empty()?m=g.append("g").attr("id","em-flow-container").attr("class","em-flow-container"):m.selectAll("*").remove();var b,w=m.node();w&&w.previousSibling&&(null===(b=w.parentNode)||void 0===b||b.insertBefore(w,w.previousSibling));if(function addOverlayPolygons(c){var h=c.flowGraph_,g=[],m=[],b=c.Geometries.getRegionFeatures();if(!b)return;if(h.nodes.forEach(function(c){var h=c.sourceLinks.reduce(function(c,h){return c+h.value},0),w=c.targetLinks.reduce(function(c,h){return c+h.value},0);b.find(function(h){return h.properties.id===c.id})?w>h?g.push(c.id):h>w&&m.push(c.id):console.log("could not find region geometry for",c.id)}),c.importerRegionIds=g,c.exporterRegionIds=m,0===g.length&&0===m.length)return void console.log("No importer or exporter regions found in the flow graph.");var w=zt(c),S=c.svg_.selectAll(w);S.each(function(){var h=this.__data__.properties.id;src_select(this).style("fill",function(){return g.includes(h)?c.flowRegionColors_[1]:m.includes(h)?c.flowRegionColors_[0]:null}).attr("class",function(){return g.includes(h)?"em-flow-importer":m.includes(h)?"em-flow-exporter":null})})}(h),"curved"===h.flowLineType_||"sankey"===h.flowLineType_?createSankeyFlowMap(h,m):createFlowMap(h,m),h.flowNodes_&&("donut"===h.flowNodeType_?drawNodeDonuts(h,m):drawNodeCircles(h,m)),null!==(c=h.labels_)&&void 0!==c&&c.values){var S=h.svg().select("#em-zoom-group-"+h.svgId_);!function addFlowValueLabels(c,h){var g,m=h.select("#em-labels"),b=m.empty()?h.append("g").attr("id","em-labels"):m,w=c.flowGraph_.nodes.filter(function(c){return c.targetLinks&&0===c.sourceLinks.length}),S=ensureGroup(b,"em-flow-labels");null!==(g=c.labels_)&&void 0!==g&&g.shadows&&S.append("g").attr("class","em-flow-label-shadow").selectAll("text").data(w).join("text").attr("text-anchor",function(c){return c.x>c.targetLinks[0].source.x?"start":"end"}).attr("x",function(h){return h.x>h.targetLinks[0].source.x?h.x+c.flowLabelOffsets_.x:h.x-c.flowLabelOffsets_.x}).attr("y",function(h){return h.y+c.flowLabelOffsets_.y}).text(function(h){return c._statLabelFormatter(h.value)});var M=S.append("g").attr("class","em-flow-label").selectAll("g").data(w).join("g").attr("transform",function(c){return"translate(".concat(c.x,", ").concat(c.y,")")});M.append("text").attr("class","em-label-text").attr("text-anchor",function(c){return c.x>c.targetLinks[0].source.x?"start":"end"}).attr("x",function(h){return h.x>h.targetLinks[0].source.x?c.flowLabelOffsets_.x:-c.flowLabelOffsets_.x}).attr("y",c.flowLabelOffsets_.y).text(function(h){return c._statLabelFormatter(h.value)}),c.labels_.backgrounds&&M.each(function(){var c=src_select(this).select("text").node().getBBox();src_select(this).insert("rect","text").attr("class","em-label-background").attr("x",c.x-5).attr("y",c.y-2).attr("width",c.width+10).attr("height",c.height+4)})}(h,S)}},h.updateClassification=function(){},h.getLegendConstructor=function(){return uc},h};function map_flow_find(c,h){var g=c.get(h);if(!g)throw new Error("missing: "+h);return g}var _c=function flowMapTooltipFunction(c,h){var g,m,b=[],w=h.statData().unitText()||"",S=null!==(g=c.originId)&&void 0!==g?g:c.source.isMidpoint?null:c.source.id,M=null!==(m=c.destId)&&void 0!==m?m:c.target.isMidpoint?null:c.target.id,k=h._nodeById||new Map,T=k.get(S)||{id:S,name:S},E=k.get(M)||{id:M,name:M},I=T.name||T.id,P=E.name||E.id,L="".concat(I," to ").concat(P);return b.push('\n <div class="em-tooltip-bar">\n <b>'.concat(L,"</b>\n </div>\n ")),b.push("\n <div class='em-tooltip-text'>\n <table class=\"em-tooltip-table\">\n <tbody>\n <tr><td>".concat(Ft(c.value)," ").concat(w,"</td></tr>\n </tbody>\n </table>\n </div>\n ")),b.join("")};function radial_square(c){return Math.sign(c)*c*c}function radial(){var c,h=continuous(),g=[0,1],m=!1;function scale(g){var b=function unsquare(c){return Math.sign(c)*Math.sqrt(Math.abs(c))}(h(g));return isNaN(b)?c:m?Math.round(b):b}return scale.invert=function(c){return h.invert(radial_square(c))},scale.domain=function(c){return arguments.length?(h.domain(c),scale):h.domain()},scale.range=function(c){return arguments.length?(h.range((g=Array.from(c,src_number_number)).map(radial_square)),scale):g.slice()},scale.rangeRound=function(c){return scale.range(c).round(!0)},scale.round=function(c){return arguments.length?(m=!!c,scale):m},scale.clamp=function(c){return arguments.length?(h.clamp(c),scale):h.clamp()},scale.unknown=function(h){return arguments.length?(c=h,scale):c},scale.copy=function(){return radial(h.domain(),g).round(m).clamp(h.clamp()).unknown(c)},initRange.apply(scale,arguments),linearish(scale)}function offset_none(c,h){if((b=c.length)>1)for(var g,m,b,w=1,S=c[h[0]],M=S.length;w<b;++w)for(m=S,S=c[h[w]],g=0;g<M;++g)S[g][1]+=S[g][0]=isNaN(m[g][1])?m[g][0]:m[g][1]}function order_none(c){for(var h=c.length,g=new Array(h);--h>=0;)g[h]=h;return g}function stack_stackValue(c,h){return c[h]}function stackSeries(c){const h=[];return h.key=c,h}function src_stack(){var c=node_modules_d3_shape_src_constant([]),h=order_none,g=offset_none,m=stack_stackValue;function stack(b){var w,S,M=Array.from(c.apply(this,arguments),stackSeries),k=M.length,T=-1;for(const c of b)for(w=0,++T;w<k;++w)(M[w][T]=[0,+m(c,M[w].key,T,b)]).data=c;for(w=0,S=d3_shape_src_array(h(M));w<k;++w)M[S[w]].index=w;return g(M,S),M}return stack.keys=function(h){return arguments.length?(c="function"==typeof h?h:node_modules_d3_shape_src_constant(Array.from(h)),stack):c},stack.value=function(c){return arguments.length?(m="function"==typeof c?c:node_modules_d3_shape_src_constant(+c),stack):m},stack.order=function(c){return arguments.length?(h=null==c?order_none:"function"==typeof c?c:node_modules_d3_shape_src_constant(Array.from(c)),stack):h},stack.offset=function(c){return arguments.length?(g=null==c?offset_none:c,stack):g},stack}var mc=function legend(c,h){var g=wl(c);if(g.sizeLegend={title:null,titlePadding:15,values:null},g.colorLegend={title:null,titlePadding:15,marginTop:23,labelOffsets:{x:5,y:5},shapeWidth:25,shapeHeight:20,shapePadding:1,noData:!0,noDataText:"No data"},g.timeLegend={title:null,marginTop:20},g._sizeLegendHeight=0,h)for(var m in h)if("colorLegend"===m||"sizeLegend"===m||"timeLegend"===m)for(var b in g[m])void 0!==h[m][b]&&(g[m][b]=h[m][b]);else g[m]=h[m];function highlightRegions(c,h){var g=c.svg_.selectAll(".em-coxcomb-chart").selectAll("path[code]");g.style("fill","white"),g.filter("path[code='"+h+"']").each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}function unhighlightRegions(c){c.svg_.selectAll(".em-coxcomb-chart").selectAll("path[code]").each(function(){src_select(this).style("fill",src_select(this).attr("fill___"))})}return g.update=function(){g.updateConfig(),g.updateContainer();var h=g.lgg;h.selectAll("*").remove(),g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle();var m=g.getBaseY(),b=g.getBaseX();if(c.classifierSize_){var w=h.append("g").attr("class","em-coxcomb-size-legend").attr("transform","translate(".concat(b,", ").concat(m,")"));g._sizeLegendContainer=w,drawCircleSizeLegend(g,w,g.sizeLegend.values,g.map.classifierSize_,g.sizeLegend.title,g.sizeLegend.titlePadding)}!function buildColorLegend(c,h,g){var m=c.map,b=c.colorLegend;c._colorLegendContainer=c.lgg.append("g").attr("class","em-coxcomb-color-legend");var w=0;c._sizeLegendContainer?(w=c._sizeLegendContainer.node().getBBox().height,c._colorLegendContainer.attr("transform","translate(".concat(h,",").concat(w+c.colorLegend.marginTop,")"))):c._colorLegendContainer.attr("transform","translate(".concat(h,",").concat(g,")"));b.title&&c._colorLegendContainer.append("text").attr("class","em-color-legend-title").attr("id","em-color-legend-title").attr("x",0).attr("y",c.titleFontSize).text(b.title);var S=0,M=m.catColors_,k=function _loop(h){var g=c.colorLegend.titlePadding+(b.title?c.titleFontSize:0)+S*(b.shapeHeight+b.shapePadding),w=m.catColors()[h]||"lightgray";c._colorLegendContainer.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",g).attr("width",b.shapeWidth).attr("height",b.shapeHeight).style("fill",w).on("mouseover",function(){highlightRegions(c.map,h),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,highlightRegions,h)}).on("mouseout",function(){unhighlightRegions(c.map),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,unhighlightRegions,h)}),c._colorLegendContainer.append("text").attr("class","em-legend-label").attr("x",b.shapeWidth+b.labelOffsets.x).attr("y",g+.5*b.shapeHeight).attr("dy","0.35em").text(m.catLabels_[h]||h),S++};for(var T in M)k(T);if(b.noData){var E=w+c.colorLegend.marginTop+c.colorLegend.titlePadding+(b.title?c.titleFontSize+c.boxPadding:0)+S*b.shapeHeight+S*b.shapePadding,I=c.lgg.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(c.boxPadding,",").concat(E,")"));c.appendNoDataLegend(I,c.noDataText,highlightRegions,unhighlightRegions)}}(g,b,m),function buildCoxcombTimeLegend(h,g,m){var b,w,S=h.map._coxTimes||[],M=40;if(!S.length)return;var k=m,T=g;h._sizeLegendContainer&&(k+=h._sizeLegendContainer.node().getBBox().height);h._colorLegendContainer&&(k+=h._colorLegendContainer.node().getBBox().height,k+=h.colorLegend.marginTop||0);k+=(null===(b=h.timeLegend)||void 0===b?void 0:b.marginTop)||0,k+=M;var E=18,I=2*Math.PI/S.length,P=(null===(w=h._colorLegendContainer)||void 0===w||null===(w=w.node())||void 0===w?void 0:w.getBBox().width)||0,L=T+P/2+E,B=h.lgg.append("g").attr("class","em-coxcomb-time-legend").attr("transform","translate(".concat(L,", ").concat(k+M,")")),z=src_arc().innerRadius(0).outerRadius(M).startAngle(function(c,h){return h*I}).endAngle(function(c,h){return(h+1)*I});B.selectAll("path").data(S).join("path").attr("d",function(c,h){return z(c,h)}).attr("fill","#ccc").attr("stroke","white").attr("stroke-width",.5).attr("class","em-coxcomb-legend-time-segment");var j=M+E,D=c._coxTimeLabels?c._coxTimeLabels:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];B.selectAll("text.em-coxcomb-legend-time-label").data(S).join("text").attr("class","em-legend-label em-coxcomb-legend-time-label").attr("x",function(c,h){return Math.sin(h*I+I/2)*j}).attr("y",function(c,h){return-Math.cos(h*I+I/2)*j}).attr("text-anchor","middle").attr("alignment-baseline","middle").text(function(c,h){return D[h]||c}),B.on("mouseleave",function(){(h.map.svg_||h.map.svg()).selectAll(".em-coxcomb-chart path").style("opacity",1),B.selectAll("path").style("stroke","white").style("stroke-width",.5).style("opacity",1)}),B.selectAll("path").on("mouseenter",function(c,g){var m=g;(h.map.svg_||h.map.svg()).selectAll(".em-coxcomb-chart path").style("opacity",function(c){return c&&c.data&&c.data.month===m?1:.1}),B.selectAll("path").style("opacity",.3).style("stroke","white").style("stroke-width",.5),src_select(this).style("stroke","#333").style("stroke-width",2).style("opacity",1)}).on("mouseleave",function(){src_select(this).style("stroke","white").style("stroke-width",.5).style("opacity",1)})}(g,b,m),g.setBoxDimension()},g},vc=function map(c){var h=Ml(c,!0,"coxcomb");h.coxcombMinRadius_=10,h.coxcombMaxRadius_=80,h.coxcombStrokeFill_="white",h.coxcombStrokeWidth_=.3,h.coxcombRings_=!0,h.coxcombOffsets_={x:0,y:0},h.hoverColor_="#ffa500",h.catColors_=void 0,h.catLabels_=void 0,h.classifierSize_=null;var g=["catColors_","catLabels_","noDataFillStyle_","coxcombMaxRadius_","coxcombMinRadius_","coxcombRings_","coxcombStrokeFill_","coxcombStrokeWidth_","hoverColor_","classifierSize_","coxcombOffsets_"];function applyClassificationToMap(c){if(!h.statCodes_){h.statCodes_=Object.keys(h.statData_);var g=h.statCodes_.indexOf("default");g>-1&&h.statCodes_.splice(g,1)}!function getTotals(c){var g={},m={};h.totalCode_?h._coxTimes.forEach(function(c){var b=h.statData("".concat(c,":").concat(h.totalCode_));if(b&&b._data_)for(var w in b._data_){var S,M=(null===(S=b._data_[w])||void 0===S?void 0:S.value)||0;m[w]=m[w]||{},m[w][c]=M,g[w]=(g[w]||0)+M}}):h._coxTimes.forEach(function(c){var b={};for(var w in h._coxCategoryCodes.forEach(function(g){var m=h.statData("".concat(c,":").concat(g));if(m&&m._data_)for(var w in m._data_){var S,M=(null===(S=m._data_[w])||void 0===S?void 0:S.value)||0;b[w]=(b[w]||0)+M}}),b)m[w]=m[w]||{},m[w][c]=b[w],g[w]=(g[w]||0)+b[w]});h.yearlyTotals=g,h.monthlyTotals=m}(),function computeCoxStatusMap(c){var g=h._coxTimes||[],m=h._coxCategoryCodes||[],b=!!h.totalCode_,w=new Map,S=new Set,M=function addIdsFrom(c){var g=h.statData(c);g&&g._data_&&Object.keys(g._data_).forEach(function(c){return S.add(c)})};g.forEach(function(c){b?M("".concat(c,":").concat(h.totalCode_)):m.forEach(function(h){return M("".concat(c,":").concat(h))})}),S.forEach(function(c){var S=!1,M=!1,k=!1;g.forEach(function(g){if(b){var w,T=null===(w=h.statData("".concat(g,":").concat(h.totalCode_)))||void 0===w?void 0:w.get(c);if(!T)return;S=!0,":"===T.value?M=!0:"number"==typeof T.value&&(k=!0)}else m.forEach(function(m){var b,w=null===(b=h.statData("".concat(g,":").concat(m)))||void 0===b?void 0:b.get(c);w&&(S=!0,":"===w.value?M=!0:"number"==typeof w.value&&(k=!0))})}),M?w.set(c,{value:":"}):S||k?w.set(c,{value:0}):w.set(c,null)}),h.coxStatus_=w}(),function defineSizeScales(c){var g=Object.values(h.yearlyTotals),m=h.coxcombMinRadius_||0,b=h.coxcombMaxRadius_||80,w=min_min(g)||0,S=max_max(g)||0,M=radial().domain([w,S]).range([m,b]);h.classifierChartSize_=function(c,g){var m=M(h.yearlyTotals[g]||0),b=c/Math.max.apply(Math,toConsumableArray_toConsumableArray(Object.values(h.monthlyTotals[g]||{0:1})));return Math.sqrt(b)*m},h.classifierSize_=M}()}function getRegionTotal(c){var g=h.yearlyTotals;return void 0!==g[c]?g[c]:void 0}function getCoxcombAnchors(c){return c.gridCartogram_?c.svg().selectAll("#em-grid-container .em-grid-cell"):c.getCentroidsGroup(c).selectAll("g.em-centroid")}function applyStyleToMap(c){if(h.catLabels_=h.catLabels_||{},h.svg_)if(c.gridCartogram_){!function applyStyleToGridCartogram(c,g){var m=[],b=getCoxcombAnchors(c);b.attr("id",function(c){return m.push(c.properties.id),"cox_"+c.properties.id}),function addCoxcombChartsToGridCartogram(c,g,m){var b=h._coxTimes,w=h._coxCategoryCodes,S=h.coxcombOffsets_||{x:0,y:0};"hexagon"===h.gridCartogramShape_&&(S.x-=h.coxcombWidth_-4,S.y-=h.coxcombHeight_+4);c.forEach(function(c){var g=h.svg().select("#cox_"+c);if(!g.empty()){var M=buildMonthData(c,b,w);if(M.length){var k=getActiveKeys(M,w),T=src_stack().keys(k)(M);g.selectAll(".em-coxcomb").remove();var E=g.node().getBBox(),I=E.width/2,P=E.height/2,L=g.append("g").attr("class","em-coxcomb").attr("transform","translate(".concat(I+S.x,", ").concat(P+S.y,")"));!function drawCoxcombInContainer(c,g,m,b,w,S){if(h.coxcombRings_){var M=h.yearlyTotals[g]||0,k=h.classifierSize_(M);c.append("circle").attr("class","em-coxcomb-max-outline").attr("r",0).attr("fill","none").attr("stroke","#000").attr("stroke-width",.3).attr("opacity",.5).attr("pointer-events","none").transition().duration(h.transitionDuration_/2).attr("r",k)}var T=src_arc().startAngle(function(c){return w(c.data.month)}).endAngle(function(c){return w(c.data.month)+w.bandwidth()}).padAngle(.01).padRadius(0);b.forEach(function(b,w){c.append("g").attr("class","em-coxcomb-chart").attr("stroke","#ffffff").attr("stroke-width",.3).selectAll("path").data(m[w]).join("path").attr("fill",h.catColors_[b]||("other"===b?"#FFCC80":"lightgray")).attr("code",b).attr("month",function(c){return c.data.month}).transition().delay(function(c,h){return 120*h}).duration(h.transitionDuration_).attrTween("d",function(c){var m=value(0,h.classifierChartSize_(c[0],g)),b=value(0,h.classifierChartSize_(c[1],g));return function(h){return T.innerRadius(m(h)).outerRadius(b(h))(c)}})})}(L,c,T,k,m);var B=g.select(".em-grid-shape, .em-grid-rect, .em-grid-hexagon").node();B&&B.nextSibling&&g.node().insertBefore(L.node(),B.nextSibling)}}})}(m,0,g),function addMouseEventsToGridCartogram(c){var g=h.svg().selectAll("#em-grid-container .em-grid-cell .em-grid-shape"),m=h.svg().selectAll("#em-grid-container .em-grid-cell .em-coxcomb"),b=function getRegionData(c){return src_select(c.closest(".em-grid-cell")).datum()},w=function getShapeForCell(c){return c.select(".em-grid-shape")},S=function handleMouseOver(c){var g=b(this);if(g&&getRegionTotal(g.properties.id)){var m=src_select(this.closest(".em-grid-cell")),S=w(m);S.attr("fill___",S.style("fill")),S.style("fill",h.hoverColor_);var M=h._lastZoomK||1;if(h.coxcombRings_){var k=m.select("circle.em-coxcomb-max-outline").node();k&&k.style.setProperty("stroke-width","".concat(2/M,"px"),"important")}else m.selectAll("g.em-coxcomb-chart").style("stroke",h.hoverColor_);h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(g,h))}},M=function handleMouseMove(c){var g=b(this);g&&(getRegionTotal(g.properties.id)&&h._tooltip&&h._tooltip.mousemove(c))},k=function handleMouseOut(c){var g=b(this);if(g&&getRegionTotal(g.properties.id)){var m=src_select(this.closest(".em-grid-cell")),S=w(m);S.style("fill",S.attr("fill___")||""),S.attr("fill___",null);var M=h._lastZoomK||1;if(h.coxcombRings_){var k=m.select("circle.em-coxcomb-max-outline").node();k&&k.style.setProperty("stroke-width","".concat(.3/M,"px"),"important")}else m.selectAll("g.em-coxcomb-chart").style("stroke","#ffffff");h._tooltip&&h._tooltip.mouseout()}};g.on("mouseover",S).on("mousemove",M).on("mouseout",k),m.style("pointer-events","all").on("mouseover",S).on("mousemove",M).on("mouseout",k)}()}(c,createAngleScale(h._coxTimes)),adjustGridCartogramTextLabels({map:c,getAnchors:getCoxcombAnchors,getRadius:function getRadius(c){return function getCoxcombTopRadius(c){var g=h._coxTimes;if(!g||0===g.length)return 0;var m=g[0],b=g[g.length-1],w=0;return[m,b].forEach(function(g){var m=0;if(h._coxCategoryCodes.forEach(function(b){var w,S=(null===(w=h.statData("".concat(g,":").concat(b)))||void 0===w||null===(w=w.get(c))||void 0===w?void 0:w.value)||0;m+=S}),h.totalCode_){var b,S=(null===(b=h.statData("".concat(g,":").concat(h.totalCode_)))||void 0===b||null===(b=b.get(c))||void 0===b?void 0:b.value)||0;S>m&&(m=S)}var M=h.classifierChartSize_(m,c);M>w&&(w=M)}),w}(c)},margin:2})}else{var g=c.getCentroidsGroup(c);if(g){var m=g.selectAll("g.em-centroid").data().filter(function(c){return void 0!==getRegionTotal(c.properties.id)});!function applyStyleToRegionPolygons(c){var g=zt(c),m=c.svg().selectAll(g),b=h.coxStatus_;"WORLD"!==c.geo_&&("mixed"==c.nutsLevel_&&function styleMixedNUTSRegions(c,g,m){m.style("display",function(c){if(!this.parentNode.classList.contains("em-cntrg"))return null==g.get(c.properties.id)?"none":"block"}),m.style("stroke",function(c){var h=src_select(this),m=h.attr("lvl"),b=g.get(c.properties.id);if(b&&null!=b.value)return"0"!==m?h.style("stroke")||"#777":void 0}).style("stroke-width",function(c){var m=src_select(this),b=m.attr("lvl"),w=g.get(c.properties.id);if(w&&null!=w.value&&"WORLD"!=h.geo_)return"0"!==b?m.style("stroke-width")||1:void 0})}(0,b,m),m.attr("ecl",function(c){var h=b.get(c.properties.id);return null==h?"ni":":"===(null==h?void 0:h.value)?"nd":null}),m.filter(function(c){var h;return":"===(null===(h=b.get(c.properties.id))||void 0===h?void 0:h.value)}).style("fill",h.noDataFillStyle()))}(c),function addMouseEventsToRegions(c){var g=function shouldOmit(h){var g;return null===(g=c.tooltip_.omitRegions)||void 0===g?void 0:g.includes(h)},m=zt(c),b=(c.svg().selectAll(m),c.svg().selectAll("g.em-centroid"));b.on("mouseover",function(c,m){if(!g(m.properties.id)&&getRegionTotal(m.properties.id)){var b=src_select(this);b.attr("fill___",b.style("fill")),b.style("fill",h.hoverColor_);var w=h._lastZoomK||1;h.coxcombRings_?b.select("circle.em-coxcomb-max-outline").node().style.setProperty("stroke-width","".concat(2/w,"px"),"important"):b.selectAll("g.em-coxcomb-chart").style("stroke",h.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(m,h))}}).on("mousemove",function(c,m){g(m.properties.id)||getRegionTotal(m.properties.id)&&h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(m,h))}).on("mouseout",function(c,m){if(!g(m.properties.id)&&getRegionTotal(m.properties.id)){var b=src_select(this);b.style("fill",b.attr("fill___")||""),b.attr("fill___",null);var w=h._lastZoomK||1;h.coxcombRings_?b.select("circle.em-coxcomb-max-outline").node().style.setProperty("stroke-width","".concat(.3/w,"px"),"important"):b.selectAll("g.em-coxcomb-chart").style("stroke","#ffffff"),h._tooltip&&h._tooltip.mouseout()}})}(c),function addCoxcombChartsToMap(c,g){var m=h._coxTimes,b=h._coxCategoryCodes,w=createAngleScale(m);c.forEach(function(c){var S=c.properties.id,M=buildMonthData(S,m,b);if(M.length){var k=getActiveKeys(M,b);!function drawCoxcomb(c,g,m,b,w){var S=w.svg().select("#ps"+c);if(S.empty())return;var M=S.selectAll("g.em-coxcomb").data([c],function(c){return c}).join(function(h){return h.append("g").attr("class","em-coxcomb").attr("id","cox_"+c)},function(c){return c},function(c){return c.remove()});if(M.selectAll("*").remove(),h.coxcombRings_){var k=h.yearlyTotals[c]||0,T=h.classifierSize_(k);M.append("circle").attr("class","em-coxcomb-max-outline").attr("r",0).attr("fill","none").attr("stroke","#000").attr("stroke-width",.3).attr("opacity",.5).attr("pointer-events","none").transition().duration(h.transitionDuration_/2).attr("r",T)}var E=src_arc().startAngle(function(c){return b(c.data.month)}).endAngle(function(c){return b(c.data.month)+b.bandwidth()}).padAngle(.01).padRadius(0);m.forEach(function(m,b){M.append("g").attr("class","em-coxcomb-chart").attr("stroke","#ffffff").attr("stroke-width",.3).selectAll("path").data(g[b]).join("path").attr("fill",h.catColors_[m]||("other"===m?"#FFCC80":"lightgray")).attr("code",m).attr("month",function(c){return c.data.month}).transition().delay(function(c,h){return 120*h}).duration(h.transitionDuration_).attrTween("d",function(g){var m=value(0,h.classifierChartSize_(g[0],c)),b=value(0,h.classifierChartSize_(g[1],c));return function(c){return E.innerRadius(m(c)).outerRadius(b(c))(g)}})})}(S,src_stack().keys(k)(M),k,w,g)}})}(m,c)}}}function getActiveKeys(c,h){var g=toConsumableArray_toConsumableArray(h);return c.some(function(c){return(c.other||0)>0})&&g.push("other"),g}function buildMonthData(c,g,m){var b=g.map(function(g){var b={month:g},w=0;if(m.forEach(function(m){var S,M=null===(S=h.statData("".concat(g,":").concat(m)))||void 0===S?void 0:S.get(c),k=(null==M?void 0:M.value)||0;b[m]=k,w+=k}),h.totalCode_){var S,M=null===(S=h.statData("".concat(g,":").concat(h.totalCode_)))||void 0===S?void 0:S.get(c),k=(null==M?void 0:M.value)||0,T=k>w?k-w:0;T>0&&(b.other=T)}return Object.values(b).some(function(c){return c&&c>0})?b:null}).filter(Boolean),w=b.some(function(c){return(c.other||0)>0});return w?h._anyRegionHasOther_=!0:b.forEach(function(c){return delete c.other}),b}function createAngleScale(c){return band().domain(c).range([0,2*Math.PI]).align(0)}return g.forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&g.forEach(function(g){var m=g.slice(0,-1);null!=c[m]&&h[m](c[m])}),h.statCodes_=void 0,h.totalCode_=void 0,h._anyRegionHasOther_=!1,h.statCoxcomb=function(c){return h._coxTimes=c.times,h._coxCategoryCodes=toConsumableArray_toConsumableArray(c.categoryCodes),h._coxTimeLabels=c.timeLabels,c.filters=c.filters||{},c.times.forEach(function(g){if(c.categoryCodes.forEach(function(m){c.stat.filters[c.timeParameter]=g,c.stat.filters[c.categoryParameter]=m;var b={};for(var w in c.stat)b[w]=c.stat[w];for(var S in b.filters={},c.stat.filters)b.filters[S]=c.stat.filters[S];var M="".concat(g,":").concat(m);h.stat(M,b),c.categoryColors&&(h.catColors_=h.catColors_||{},h.catColors_[m]=c.categoryColors[c.categoryCodes.indexOf(m)]),c.categoryLabels&&(h.catLabels_=h.catLabels_||{},h.catLabels_[m]=c.categoryLabels[c.categoryCodes.indexOf(m)])}),c.totalCode){c.stat.filters[c.timeParameter]=g,c.stat.filters[c.categoryParameter]=c.totalCode;var m={};for(var b in c.stat)m[b]=c.stat[b];for(var w in m.filters={},c.stat.filters)m.filters[w]=c.stat.filters[w];var S="".concat(g,":").concat(c.totalCode);h.stat(S,m)}}),c.totalCode&&(h.totalCode_=c.totalCode,h.catColors_.other="#FFCC80",h.catLabels_.other="Other"),h},h.updateClassification=function(){return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyClassificationToMap),applyClassificationToMap(),h},h.updateStyle=function(){if(h._anyRegionHasOther_=!1,!h.catColors_){h.catColors({});for(var c=0;c<h.statCodes_.length;c++)h.catColors_[h.statCodes_[c]]=nc[c%10]}try{var g,m;if(h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyStyleToMap),applyStyleToMap(h),h.totalCode_&&!h._anyRegionHasOther_)null===(g=h.catColors_)||void 0===g||delete g.other,null===(m=h.catLabels_)||void 0===m||delete m.other;return h.dorling_&&!h.gridCartogram_?runDorlingSimulation(h,function(c){var g=getRegionTotal(c.properties.id)||0;return h.classifierSize_(g)||0}):stopDorlingSimulation(h),h}catch(c){console.error("Error in updateStyle:",c.message),console.error(c)}return h},h.getLegendConstructor=function(){return mc},h.tooltip_.textFunction=function(c,g){var m,b=c.properties.na||c.properties.name,w=c.properties.id,S=h._coxTimes||[],M=toConsumableArray_toConsumableArray(h._coxCategoryCodes),k=S.some(function(c){var g,m=(null===(g=h.statData("".concat(c,":").concat(h.totalCode_)))||void 0===g||null===(g=g.get(w))||void 0===g?void 0:g.value)||0,b=h._coxCategoryCodes.reduce(function(g,m){var b;return g+((null===(b=h.statData("".concat(c,":").concat(m)))||void 0===b||null===(b=b.get(w))||void 0===b?void 0:b.value)||0)},0);return m>b});k&&M.push("other");var T='<div class="em-tooltip-bar">'.concat(b).concat(w?" (".concat(w,")"):"","</div>"),E=['<th class="em-breakdown-label">Month</th>'];M.forEach(function(c){var g=h.catLabels_[c]||c,m=h.catColors_[c]||("other"===c?"#FFCC80":"#999");E.push('<th class="em-breakdown-label" style="color:'.concat(m,'">').concat(g,"</th>"))}),E.push('<th class="em-breakdown-label">Total</th>');var I="<tr>".concat(E.join(""),"</tr>"),P=h.yearlyTotals||{},L=h.monthlyTotals||{},B=P[w]||0,z=S.map(function(c,g){var m,b=['<td class="em-breakdown-label">'.concat(h._coxTimeLabels?h._coxTimeLabels[g]:c,"</td>")],S=(null===(m=L[w])||void 0===m?void 0:m[c])||0;return M.forEach(function(g){var m=0;if("other"===g){var S,k=(null===(S=h.statData("".concat(c,":").concat(h.totalCode_)))||void 0===S||null===(S=S.get(w))||void 0===S?void 0:S.value)||0,T=M.filter(function(c){return"other"!==c}).reduce(function(g,m){var b;return g+((null===(b=h.statData("".concat(c,":").concat(m)))||void 0===b||null===(b=b.get(w))||void 0===b?void 0:b.value)||0)},0);m=Math.max(k-T,0)}else{var E;m=(null===(E=h.statData("".concat(c,":").concat(g)))||void 0===E||null===(E=E.get(w))||void 0===E?void 0:E.value)||0}b.push(m>0?'<td><span class="em-breakdown-value">'.concat(Ft(m),"</span></td>"):"<td></td>")}),b.push(S>0?'<td><span class="em-breakdown-value">'.concat(Ft(S),"</span></td>"):"<td></td>"),"<tr>".concat(b.join(""),"</tr>")}),j=(null===(m=h.statData(h.statCodes_[0]))||void 0===m?void 0:m.unitText())||"";return T+='<div class="em-tooltip-breakdown em-tooltip-cx"><table class="em-tooltip-cx-table">',T+=I+z.join(""),B>0&&(T+='\n <tr class="em-total">\n <td class="em-breakdown-label">Year total</td>\n <td colspan="'.concat(M.length,'"></td>\n <td>\n <span class="em-breakdown-value">').concat(Ft(B)," ").concat(j,"</span>\n </td>\n </tr>")),T+="</table></div>"},h};function map_mushroom_interactions_addMouseEvents(c,h){!function map_mushroom_interactions_addMouseEventsToSymbols(c,h){var g=c.svg().selectAll("g.em-centroid");g.on("mouseover",function(g,m){src_select(this).selectAll("path").each(function(){var c=src_select(this);c.attr("fill___",c.style("fill")),c.attr("stroke___",c.style("stroke")),c.attr("sw___",c.style("stroke-width")),c.style("fill",h.hoverColor_),c.style("stroke","black"),c.style("stroke-width",1)}),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(m,h)),h.onRegionMouseOver_&&h.onRegionMouseOver_(g,m,this,c)}).on("mousemove",function(g,m){h._tooltip&&h._tooltip.mousemove(g),h.onRegionMouseMove_&&h.onRegionMouseMove_(g,m,this,c)}).on("mouseout",function(g,m){src_select(this).selectAll("path").each(function(){var c=src_select(this),h=c.attr("fill___");h&&c.style("fill",h);var g=c.attr("sw___"),m=c.attr("stroke___");m&&c.style("stroke",m),g&&c.style("stroke-width",g)}),h._tooltip&&h._tooltip.mouseout(),h.onRegionMouseOut_&&h.onRegionMouseOut_(g,m,this,c)})}(c,h),function map_mushroom_interactions_addMouseEventsToRegions(c,h){var g=c.svg().selectAll(zt(c));g.on("mouseover",function(g,m){src_select(this).style("fill",c.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(m,h)),h.onRegionMouseOver_&&h.onRegionMouseOver_(g,m,this,c)}).on("mousemove",function(g,m){h._tooltip&&h._tooltip.mousemove(g),h.onRegionMouseMove_&&h.onRegionMouseMove_(g,m,this,c)}).on("mouseout",function(g,m){var b=src_select(this);b.style("fill",b.attr("fill___")),h._tooltip&&h._tooltip.mouseout(),h.onRegionMouseOut_&&h.onRegionMouseOut_(g,m,this,c)})}(c,h)}var yc=function legend(c,h){var g=wl(c);return g.sizeLegend={marginTop:15,values:void 0,valuesV1:void 0,valuesV2:void 0,labels:null,labelsV1:null,labelsV2:null,shapePadding:2,labelOffsets:{x:5,y:0}},g.colorLegend={marginTop:5,labelOffsets:{x:5,y:5}},null!=h&&h.sizeLegend&&Object.assign(g.sizeLegend,h.sizeLegend),null!=h&&h.colorLegend&&Object.assign(g.colorLegend,h.colorLegend),g.update=function(){if(g.updateConfig(),g.updateContainer(),g.lgg.node()){g.lgg.selectAll("*").remove(),g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle();var c=g.getBaseX(),h=g.getBaseY()+g.sizeLegend.marginTop,m=g.map.mushroomSizeScaleFunctionV1_&&g.map.mushroomSizeScaleFunctionV2_;if(m){var b=drawMushroomSizeLegend(g,c,h,"v1");drawSideLabel(g,c,b.bottom+5,"v1"),h=b.bottom;var w=drawMushroomSizeLegend(g,c,h,"v2");drawSideLabel(g,c,w.top+30,"v2")}else{var S;h=(null===(S=drawMushroomSizeLegend(g,c,h))||void 0===S?void 0:S.bottom)||g.getBaseY()+g.sizeLegend.marginTop}m||function drawColorKey(c,h,g){var m,b,w,S=c.map,M=S.mushroomColors(),k=S.mushroomCodes(),T=slicedToArray_slicedToArray(k,2),E=T[0],I=T[1],P=null!==(m=c.colorLegend.labels)&&void 0!==m?m:[(null===(b=S.statData(E))||void 0===b?void 0:b.label_)||E,(null===(w=S.statData(I))||void 0===w?void 0:w.label_)||I],L=c.lgg.append("g").attr("class","em-mushroom-color-legend").attr("transform","translate(".concat(h,", ").concat(g,")"));P.forEach(function(h,g){var m=L.append("g").attr("transform","translate(0, ".concat(g*c.shapeHeight,")")).style("cursor","pointer").on("mouseover",function(){highlightMushroomSide(S,g),S.insetTemplates_&&executeForAllInsets(S.insetTemplates_,S.svgId_,highlightMushroomSide,g)}).on("mouseout",function(){resetMushroomHighlight(S),S.insetTemplates_&&executeForAllInsets(S.insetTemplates_,S.svgId_,resetMushroomHighlight)});m.append("rect").attr("width",c.shapeWidth).attr("height",c.shapeHeight).attr("fill",M[g]).attr("class","em-legend-rect"),m.append("text").attr("x",c.shapeWidth+c.colorLegend.labelOffsets.x).attr("y",c.shapeHeight/2+c.colorLegend.labelOffsets.y).attr("class","em-legend-label").text(h)})}(g,c,h+g.colorLegend.marginTop),g.setBoxDimension()}},g};function drawSideLabel(c,h,g,m){var b,w,S=c.map,M=S.mushroomColors(),k=slicedToArray_slicedToArray(S.mushroomCodes(),2),T=k[0],E=k[1],I="v1"===m?(null===(b=S.statData(T))||void 0===b?void 0:b.label_)||T:(null===(w=S.statData(E))||void 0===w?void 0:w.label_)||E,P="v1"===m?M[0]:M[1];return c.lgg.append("text").attr("x",h).attr("y",g).style("fill",P).attr("font-weight","600").attr("dominant-baseline","hanging").attr("class","em-legend-label").text(I).node().getBBox()}function drawMushroomSizeLegend(c,h,g){var m,b,w,S,M,k=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,T=c.map,E=c.sizeLegend,I=T._mushroomScale_,P=T.mushroomSizeScaleFunctionV1_,L=T.mushroomSizeScaleFunctionV2_,B=P&&L,z=null;if("v1"===k?(M=P,z=0):"v2"===k?(M=L,z=1):M=I,!M)return g;var j=T.mushroomOrientation(),D=src_arc().innerRadius(0),N=function getSizeLegendArc(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("vertical"===c)return 0===h?{start:-Math.PI/2,end:Math.PI/2}:1===h?{start:Math.PI/2,end:3*Math.PI/2}:{start:-Math.PI/2,end:Math.PI/2};if(0===h)return{start:Math.PI,end:2*Math.PI};if(1===h)return{start:0,end:Math.PI};return{start:Math.PI,end:2*Math.PI}}(j,z),R=null!==(m=null===(b=E.labelOffsets)||void 0===b?void 0:b.x)&&void 0!==m?m:8,G=E.shapeStroke||"#000000",q=null!==(w=E.shapeStrokeWidth)&&void 0!==w?w:1,W=function getValues(c,h,g,m){var b;g?"v1"===m?b=c.valuesV1:"v2"===m&&(b=c.valuesV2):b=c.values;if(!b||!b.length){var w,S=null===(w=h.domain)||void 0===w?void 0:w.call(h);return!S||S.length<2?null:[Math.min(S[0],S[S.length-1]),Math.max(S[0],S[S.length-1])]}var M=Math.min.apply(Math,toConsumableArray_toConsumableArray(b)),k=Math.max.apply(Math,toConsumableArray_toConsumableArray(b));return b.length>1?b:[k,M]}(E,M,B,k);if(!W)return g;var H=toConsumableArray_toConsumableArray(W).sort(function(c,h){return M(h)-M(c)}),U=H.map(function(c){return M(c)}),Y=Math.max.apply(Math,toConsumableArray_toConsumableArray(U));if(!Number.isFinite(Y)||Y<=0)return g;var V=function getLabels(c,h,g,m){var b;g?"v1"===m?b=c.labelsV1:"v2"===m&&(b=c.labelsV2):b=c.labels;return b&&b.length>=h.length?b:null}(E,H,B,k),$=c.lgg.append("g").attr("class","em-mushroom-size-legend").attr("transform","translate(".concat(h,",").concat(g,")")),X=Y,K=Y,Z=T.mushroomColors(),J=B&&null!=z?Z[z]:"none";H.forEach(function(c,h){var g=M(c);if(g&&!(g<=0)){var m=$.append("g").attr("transform","translate(".concat(X,",").concat(K,")"));m.append("path").attr("d",D({startAngle:N.start,endAngle:N.end,outerRadius:g})).style("fill",J).attr("stroke",G).attr("stroke-width",q).attr("data-mushroom-side",z);var b="vertical"===j&&1===z?g:-g,w=Y+R;"horizontal"===j&&(w=10+R),m.append("line").attr("x1",0).attr("x2",w).attr("y1",b).attr("y2",b).attr("stroke",G).attr("stroke-width",.6).attr("stroke-dasharray","3,2"),m.append("text").attr("x",w+3).attr("y",b).attr("dy","0.35em").attr("dominant-baseline","middle").attr("class","em-legend-label").text(V?V[h]:Ft(c))}});var Q=null===(S=$.node())||void 0===S?void 0:S.getBBox();return Q?{top:g,bottom:g+Q.height}:{top:g,bottom:g}}function highlightMushroomSide(c,h){c.svg().selectAll("g.em-centroid path[data-mushroom-side]").style("opacity",function(){return this.getAttribute("data-mushroom-side")===String(h)?1:0})}function resetMushroomHighlight(c){c.svg().selectAll("g.em-centroid path[data-mushroom-side]").style("opacity",null)}function applyStyleToMap(c){if(c.svg()&&(c._mushroomScale_||c.mushroomSizeScaleFunctionV1_||c.mushroomSizeScaleFunctionV2_)){c.mushroomSizeScaleFunctionV1_&&c.mushroomSizeScaleFunctionV2_;var h=slicedToArray_slicedToArray(c.mushroomCodes(),2),g=h[0],m=h[1],b=c.mushroomColors(),w=c.mushroomOrientation_,S=c.statData(g),M=c.statData(m),k=src_arc().innerRadius(0),T=c.svg().selectAll("g.em-centroid");T.selectAll("*").remove(),T.each(function(h){var g,m,T=h.properties.id,E=+(null===(g=S.get(T))||void 0===g?void 0:g.value)||0,I=+(null===(m=M.get(T))||void 0===m?void 0:m.value)||0;if(0!==E||0!==I){var P,L;c.mushroomSizeScaleFunctionV1_&&c.mushroomSizeScaleFunctionV2_?(P=c.mushroomSizeScaleFunctionV1_(E),L=c.mushroomSizeScaleFunctionV2_(I)):(P=c._mushroomScale_(E),L=c._mushroomScale_(I));var B=src_select(this);"vertical"===w?(B.append("path").attr("d",k({startAngle:-Math.PI/2,endAngle:Math.PI/2,outerRadius:P})).attr("fill",b[0]).attr("class","em-mushroom-segment").attr("data-mushroom-side","0"),B.append("path").attr("d",k({startAngle:Math.PI/2,endAngle:3*Math.PI/2,outerRadius:L})).attr("fill",b[1]).attr("class","em-mushroom-segment").attr("data-mushroom-side","1")):(B.append("path").attr("d",k({startAngle:Math.PI,endAngle:2*Math.PI,outerRadius:P})).attr("fill",b[0]).attr("class","em-mushroom-segment").attr("data-mushroom-side","0"),B.append("path").attr("d",k({startAngle:0,endAngle:Math.PI,outerRadius:L})).attr("fill",b[1]).attr("class","em-mushroom-segment").attr("data-mushroom-side","1"))}}),map_mushroom_interactions_addMouseEvents(c,c)}}var Ac=function tooltipTextFunctionMushroom(c,h){var g,m,b,w,S=slicedToArray_slicedToArray(h.mushroomCodes(),2),M=S[0],k=S[1],T=c.properties.id,E=c.properties.na||"",I=h.statData(M).get(T),P=h.statData(k).get(T),L=(null===(g=(m=h.statData(M)).unitText)||void 0===g?void 0:g.call(m))||"",B=(null===(b=(w=h.statData(k)).unitText)||void 0===b?void 0:b.call(w))||"",z=function fmt(c,g){return":"===c||null==c?h.noDataText_||"No data":Ft(c)+(g?" "+g:"")};return'\n <div class="em-tooltip-bar">\n '.concat(E).concat(T?" (".concat(T,")"):"",'\n </div>\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>').concat(h.statData(M).label_||"","</td>\n <td>").concat(z(null==I?void 0:I.value,L),"</td>\n </tr>\n <tr>\n <td>").concat(h.statData(k).label_||"","</td>\n <td>").concat(z(null==P?void 0:P.value,B),"</td>\n </tr>\n </tbody>\n </table>\n </div>\n ").trim()};function legend_waffle_chart_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function legend_waffle_chart_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return legend_waffle_chart_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?legend_waffle_chart_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function legend_waffle_chart_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}var bc=function legend(c,h){var g=wl(c);if(g.sizeLegend={title:null,titlePadding:10,values:null,labelFormatter:void 0,gridSize:5,cellPadding:.5,noData:!1,noDataText:"No data"},g.colorLegend={title:null,titlePadding:10,marginTop:33,labelOffsets:{x:5,y:5},shapeWidth:25,shapeHeight:20,shapePadding:1,noData:!0,noDataText:"No data"},g._sizeLegendHeight=0,h)for(var m in h)if("colorLegend"==m||"sizeLegend"==m){for(var b in g[m])void 0!==h[m][b]&&(g[m][b]=h[m][b]);0==h.colorLegend&&(g.colorLegend=!1)}else g[m]=h[m];function highlightRegions(c,h){var g=c.svg_.selectAll(".wafflechart").selectAll("rect[code]");g.style("opacity",.2),g.filter("rect[code='"+h+"']").each(function(){src_select(this).style("opacity",1)})}function unhighlightRegions(c){c.svg_.selectAll(".wafflechart").selectAll("rect[code]").each(function(){src_select(this).style("opacity",1)})}function formatValue(c,h){return h?h(c):c>=1e6?_t(".1f")(c/1e6)+"M":c>=1e3?_t(".1f")(c/1e3)+"K":_t(".0f")(c)}return g.update=function(){g.updateConfig(),g.updateContainer();var c=g.map,h=g.lgg;h.selectAll("*").remove(),g.makeBackgroundBox(),g.title&&g.addTitle(),g.subtitle&&g.addSubtitle();var m=g.getBaseY(),b=g.getBaseX();c.classifierSize_&&g.sizeLegend&&(g._sizeLegendContainer=h.append("g").attr("class","em-waffle-size-legend").attr("transform","translate(".concat(b,", ").concat(m,")")),function drawWaffleSizeLegend(c,h,g,m,b,w){var S=arguments.length>6&&void 0!==arguments[6]?arguments[6]:5,M=arguments.length>7&&void 0!==arguments[7]?arguments[7]:.5,k=m.domain(),T=g||[k[0],Math.round((k[0]+k[1])/2),k[1]],E=toConsumableArray_toConsumableArray(T).sort(function(c,h){return h-c}),I=0;b&&(h.append("text").attr("class","em-size-legend-title").attr("x",0).attr("y",I).attr("dominant-baseline","hanging").text(b),I+=c.titleFontSize+w);var P,L=m(E[0]),B=legend_waffle_chart_createForOfIteratorHelper(E);try{for(B.s();!(P=B.n()).done;){for(var z,j=P.value,D=m(j),N=(D-M*(S-1))/S,R=h.append("g").attr("transform","translate(0, ".concat(I,")")),G=0;G<S;G++)for(var q=0;q<S;q++)R.append("rect").attr("x",q*(N+M)).attr("y",G*(N+M)).attr("width",N).attr("height",N).attr("fill","#7f7f7f").attr("stroke","#fff").attr("stroke-width",.3).attr("rx",Math.min(1,.1*N)).attr("ry",Math.min(1,.1*N));var W=L+10,H=D/2;h.append("text").attr("class","em-legend-label").attr("x",W).attr("y",I+H).attr("dominant-baseline","middle").text(formatValue(j,null===(z=c.sizeLegend)||void 0===z?void 0:z.labelFormatter)),I+=D+8}}catch(c){B.e(c)}finally{B.f()}}(g,g._sizeLegendContainer,g.sizeLegend.values,c.classifierSize_,g.sizeLegend.title,g.sizeLegend.titlePadding,g.sizeLegend.gridSize,g.sizeLegend.cellPadding)),function buildColorLegend(c,h,g){var m=c.map,b=c.colorLegend;if(c._colorLegendContainer=c.lgg.append("g").attr("class","em-waffle-color-legend"),c._sizeLegendContainer){var w=c._sizeLegendContainer.node().getBBox().height;c._colorLegendContainer.attr("transform","translate(".concat(h,",").concat(w+c.colorLegend.marginTop,")"))}else c._colorLegendContainer.attr("transform","translate(".concat(h,",").concat(g,")"));b.title&&c._colorLegendContainer.append("text").attr("id","em-color-legend-title").attr("class","em-color-legend-title").attr("x",0).attr("y",c.titleFontSize).text(b.title);var S=0,M=m.catColors();if(Object.keys(M).reverse().forEach(function(h){var g=c.colorLegend.titlePadding+(b.title?c.titleFontSize:0)+S*(b.shapeHeight+b.shapePadding);c._colorLegendContainer.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",g).attr("width",b.shapeWidth).attr("height",b.shapeHeight).attr("rx",2).attr("ry",2).style("fill",M[h]).on("mouseover",function(){highlightRegions(c.map,h),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,highlightRegions,h)}).on("mouseout",function(){unhighlightRegions(c.map),c.map.insetTemplates_&&Bt(c.map.insetTemplates_,c.map.svgId,unhighlightRegions,h)}),c._colorLegendContainer.append("text").attr("class","em-legend-label").attr("x",b.shapeWidth+b.labelOffsets.x).attr("y",g+.5*b.shapeHeight).attr("dy","0.35em").text(m.catLabels()[h]||h),S++}),b.noData){var k=0;c._sizeLegendContainer&&(k=c._sizeLegendContainer.node().getBBox().height);var T=k+c.colorLegend.marginTop+c.boxPadding+(b.title?c.titleFontSize+c.boxPadding:0)+S*(b.shapeHeight+b.shapePadding),E=c.lgg.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(c.boxPadding,",").concat(T,")"));c.appendNoDataLegend(E,c.noDataText,highlightRegions,unhighlightRegions)}}(g,b,m),g.setBoxDimension()},g};function map_waffle_charts_createForOfIteratorHelper(c,h){var g="undefined"!=typeof Symbol&&c[Symbol.iterator]||c["@@iterator"];if(!g){if(Array.isArray(c)||(g=function map_waffle_charts_unsupportedIterableToArray(c,h){if(c){if("string"==typeof c)return map_waffle_charts_arrayLikeToArray(c,h);var g={}.toString.call(c).slice(8,-1);return"Object"===g&&c.constructor&&(g=c.constructor.name),"Map"===g||"Set"===g?Array.from(c):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?map_waffle_charts_arrayLikeToArray(c,h):void 0}}(c))||h&&c&&"number"==typeof c.length){g&&(c=g);var m=0,b=function F(){};return{s:b,n:function n(){return m>=c.length?{done:!0}:{done:!1,value:c[m++]}},e:function e(c){throw c},f:b}}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 w,S=!0,M=!1;return{s:function s(){g=g.call(c)},n:function n(){var c=g.next();return S=c.done,c},e:function e(c){M=!0,w=c},f:function f(){try{S||null==g.return||g.return()}finally{if(M)throw w}}}}function map_waffle_charts_arrayLikeToArray(c,h){(null==h||h>c.length)&&(h=c.length);for(var g=0,m=Array(h);g<h;g++)m[g]=c[g];return m}function map_waffle_charts_ownKeys(c,h){var g=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);h&&(m=m.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),g.push.apply(g,m)}return g}function map_waffle_charts_objectSpread(c){for(var h=1;h<arguments.length;h++){var g=null!=arguments[h]?arguments[h]:{};h%2?map_waffle_charts_ownKeys(Object(g),!0).forEach(function(h){_defineProperty(c,h,g[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):map_waffle_charts_ownKeys(Object(g)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(g,h))})}return c}var xc=function map(c){var h=Ml(c,!0,"waffle");h.dorling_=(null==c?void 0:c.dorling)||!1,h.animateDorling_=!0,h.waffleMinSize_=10,h.waffleMaxSize_=30,h.waffleGridSize_=10,h.waffleCellPadding_=.5,h.waffleStrokeFill_="white",h.waffleStrokeWidth_=.2,h.waffleRoundedCorners_=1,h.waffleTooltipSize_=80,h.catColors_=void 0,h.catLabels_=void 0,h.waffleOtherColor_="#FFCC80",h.waffleOtherText_="Other",h.showOnlyWhenComplete_=!1,h.classifierSize_=null,h.statWaffle_=null,h.waffleTotalCode_=void 0,h.statCodes_=void 0,["catColors_","catLabels_","showOnlyWhenComplete_","noDataFillStyle_","waffleMaxSize_","waffleMinSize_","waffleGridSize_","waffleCellPadding_","waffleOtherColor_","waffleOtherText_","waffleStrokeFill_","waffleStrokeWidth_","waffleRoundedCorners_","waffleTooltipSize_","dorling_","animateDorling_","waffleTotalCode_","statCodes_"].forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&["catColors","catLabels","showOnlyWhenComplete","noDataFillStyle","waffleMaxSize","waffleMinSize","waffleGridSize","waffleCellPadding","waffleOtherColor","waffleOtherText","waffleStrokeFill","waffleStrokeWidth","waffleRoundedCorners","statCodes"].forEach(function(g){null!=c[g]&&h[g](c[g])}),h.statWaffle=function(c){var g=c.eurostatDatasetCode,m=c.filters,b=c.unitText,w=c.categoryParameter,S=c.categoryCodes,M=c.categoryLabels,k=c.categoryColors,T=c.totalCode;if(!g)return console.error("statWaffle: eurostatDatasetCode is required"),h;if(!w)return console.error("statWaffle: categoryParameter is required"),h;if(!S||!S.length)return console.error("statWaffle: categoryCodes array is required"),h;for(var E=m?map_waffle_charts_objectSpread({},m):{},I=0;I<S.length;I++){var P=S[I],L={eurostatDatasetCode:g,unitText:b,filters:map_waffle_charts_objectSpread(map_waffle_charts_objectSpread({},E),{},_defineProperty({},w,P))};h.stat(P,L),k&&k[I]&&(h.catColors_=h.catColors_||{},h.catColors_[P]=k[I]),M&&M[I]&&(h.catLabels_=h.catLabels_||{},h.catLabels_[P]=M[I])}if(h.statCodes_=S,T){h.waffleTotalCode_=T;var B={eurostatDatasetCode:g,unitText:b,filters:map_waffle_charts_objectSpread(map_waffle_charts_objectSpread({},E),{},_defineProperty({},w,T))};h.stat(T,B)}else h.waffleTotalCode_=void 0;return h},h.updateClassification=function(){return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,g),g(h),h};var g=function applyClassificationToMap(c){if(!h.statCodes_){h.statCodes_=Object.keys(h.statData_);var g=h.statCodes_.indexOf("default");g>-1&&h.statCodes_.splice(g,1)}var m=function getDatasetMaxMin(c){var g,m=[];g=c&&c.gridCartogram_?getWaffleAnchors(c).data():h.getCentroidsGroup(h).selectAll("g.em-centroid").data();return g.forEach(function(c){var h=c.properties.id,g=b(h);g&&m.push(g)}),[Math.min.apply(Math,m),Math.max.apply(Math,m)]}(c);return isNaN(m[0])||(h.classifierSize_=pow_sqrt().domain(m).range([h.waffleMinSize_,h.waffleMaxSize_])),h};function getWaffleAnchors(c){return c.gridCartogram_?c.svg().selectAll("#em-grid-container .em-grid-cell"):c.getCentroidsGroup(c).selectAll("g.em-centroid")}function applyStyleToMap(c){if(h.svg_)if(c.gridCartogram_)!function applyStyleToGridCartogram(c){var g=[],w=getWaffleAnchors(c);w.attr("id",function(c){return g.push(c.properties.id),"waffle_"+c.properties.id}),function addWaffleChartsToGridCartogram(c,g){var w=h.waffleGridSize_,S=h.waffleCellPadding_;c.forEach(function(c){var g=h.svg().select("#waffle_"+c);if(!g.empty()){var M=m(c);if(M){g.selectAll(".em-waffle").remove();var k=g.node().getBBox(),T="hexagon"==h.gridCartogramShape_?0:k.width/2,E="hexagon"==h.gridCartogramShape_?0:k.height/2,I=b(c),P=h.classifierSize_(I),L=(P-S*(w-1))/w,B=generateWaffleCells(M,w),z=g.append("g").attr("id","wafflechart_"+c).attr("class","em-waffle").attr("transform","translate(".concat(T-P/2,", ").concat(E-P/2,")"));z.append("g").attr("class","wafflechart").attr("stroke",h.waffleStrokeFill_).attr("stroke-width",h.waffleStrokeWidth_+"px").selectAll("rect").data(B).join("rect").attr("x",function(c){return c.col*(L+S)}).attr("y",function(c){return c.row*(L+S)}).attr("width",L).attr("height",L).attr("rx",h.waffleRoundedCorners_).attr("ry",h.waffleRoundedCorners_).attr("fill",function(c){return c.color}).attr("code",function(c){return c.code}).attr("opacity",0).transition().delay(function(c,h){return 5*h}).duration(h.transitionDuration_/2).attr("opacity",1);var j=g.select(".em-grid-shape, .em-grid-rect, .em-grid-hexagon").node();j&&j.nextSibling&&g.node().insertBefore(z.node(),j.nextSibling)}}})}(g),function addMouseEventsToGridCartogram(c){var g=h.svg().selectAll("#em-grid-container .em-grid-cell .em-grid-shape"),m=h.svg().selectAll("#em-grid-container .em-grid-cell .em-waffle"),w=function getRegionData(c){return src_select(c.closest(".em-grid-cell")).datum()},S=function getShapeForCell(c){return c.select(".em-grid-shape")},M=function getChartForCell(c){return c.select(".wafflechart")},k=function handleMouseOver(c){var g=w(this);if(g){var m=g.properties.id;if(b(m)){var k=src_select(this.closest(".em-grid-cell")),T=S(k),E=M(k);T.attr("fill___",T.style("fill")),T.style("fill",h.hoverColor_),E.empty()||E.style("stroke-width",h.waffleStrokeWidth_+.5).style("stroke","black"),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(g,h))}}},T=function handleMouseMove(c){var g=w(this);if(g){var m=g.properties.id;b(m)&&h._tooltip&&h._tooltip.mousemove(c)}},E=function handleMouseOut(c){var g=w(this);if(g){var m=g.properties.id;if(b(m)){var k=src_select(this.closest(".em-grid-cell")),T=S(k),E=M(k);T.style("fill",T.attr("fill___")||""),T.attr("fill___",null),E.empty()||E.style("stroke-width",h.waffleStrokeWidth_).style("stroke",h.waffleStrokeFill_),h._tooltip&&h._tooltip.mouseout()}}};g.on("mouseover",k).on("mousemove",T).on("mouseout",E),m.style("pointer-events","all").on("mouseover",k).on("mousemove",T).on("mouseout",E)}()}(c);else{var g=[],w=c.getCentroidsGroup(c);if(w){w.selectAll("g.em-centroid").append("g").attr("class","em-waffle").attr("id",function(c){return g.push(c),"waffle_"+c.properties.id});var S=zt(h),M=h.svg().selectAll(S);"WORLD"!==c.geo_&&"mixed"==c.nutsLevel_&&function styleMixedNUTSRegions(c,h){h.each(function(h){var g=src_select(this);if(!this.parentNode.classList.contains("em-cntrg")){var b=m(h.properties.id),w=b?"WORLD"===c.geo_?"block":null:"none",S=null,M=null;if(b)"0"!==g.attr("lvl")&&(S=g.style("stroke")||"#777","WORLD"===c.geo_&&(M=g.style("stroke-width")||"#777"));g.style("display",w).style("stroke",S).style("stroke-width",M)}})}(c,M),function addWaffleChartsToMap(c){var g=h.waffleGridSize_,w=h.waffleCellPadding_;c.forEach(function(c){var S=c.properties.id,M=m(S);if(M){var k=h.svg().selectAll("#waffle_"+S),T=b(S),E=h.classifierSize_(T),I=(E-w*(g-1))/g,P=generateWaffleCells(M,g),L=k.append("g").attr("class","wafflechart").attr("transform","translate(".concat(-E/2,", ").concat(-E/2,")")).attr("stroke",h.waffleStrokeFill_).attr("stroke-width",h.waffleStrokeWidth_+"px").style("pointer-events","none");L.selectAll("rect").data(P).join("rect").attr("x",function(c){return c.col*(I+w)}).attr("y",function(c){return c.row*(I+w)}).attr("width",I).attr("height",I).attr("rx",h.waffleRoundedCorners_).attr("ry",h.waffleRoundedCorners_).attr("fill",function(c){return c.color}).attr("code",function(c){return c.code}).attr("opacity",0).transition().delay(function(c,h){return 5*h}).duration(h.transitionDuration_/2).attr("opacity",1).on("end",function(){src_select(L.node()).style("pointer-events",null)}),L.on("mouseover",function(c,g){src_select(this).style("stroke-width",h.waffleStrokeWidth_+.5).style("stroke","black"),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(g,h))}).on("mousemove",function(c){h._tooltip&&h._tooltip.mousemove(c)}).on("mouseout",function(){src_select(this).style("stroke-width",h.waffleStrokeWidth_).style("stroke",h.waffleStrokeFill_),h._tooltip&&h._tooltip.mouseout()})}})}(g),function addMouseEventsToRegions(c,g){g.on("mouseover",function(c,g){var m=src_select(this);m.attr("fill___",m.style("fill")),m.style("fill",h.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(g,h))}).on("mousemove",function(c,g){h._tooltip&&h._tooltip.mousemove(c)}).on("mouseout",function(){var c=src_select(this);c.attr("fill___")&&(c.style("fill",c.attr("fill___")),h._tooltip&&h._tooltip.mouseout())})}(0,M)}}}function generateWaffleCells(c,g){for(var m=g*g,b=[],w=[],S=0,M=Object.keys(c),k=0;k<M.length;k++){var T=M[k],E=c[T],I=Math.round(E*m);k===M.length-1&&(I=m-S),I=Math.max(0,Math.min(I,m-S)),w.push({code:T,count:I}),S+=I}for(var P=0,L=0,B=w;L<B.length;L++)for(var z=B[L],j=z.code,D=z.count,N=0;N<D&&P<m;N++){var R=Math.floor(P/g),G=P%g;b.push({row:g-1-R,col:G,code:j,color:h.catColors_[j]||"lightgray"}),P++}return b}h.updateStyle=function(){try{if(!h.classifierSize_)return;if(!h.catColors_){h.catColors({});for(var c=0;c<h.statCodes_.length;c++)h.catColors_[h.statCodes_[c]]=nc[c%10]}return h.waffleTotalCode_&&(h.catColors_.other=h.waffleOtherColor_,h.catLabels_.other=h.waffleOtherText_),h.catLabels_=h.catLabels_||{},h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyStyleToMap),applyStyleToMap(h),h.dorling_&&!h.gridCartogram_?runDorlingSimulation(h,function(c){var g=b(c.properties.id)||0;return h.classifierSize_(g)/2||0}):stopDorlingSimulation(h),h}catch(c){console.error("Error in waffle chart styling: "+c.message),console.error(c)}};var m=function getComposition(c){for(var g={},m=0,b=h.statCodes_,w=0;w<b.length;w++){var S=b[w],M=h.statData(S).get(c),k=null==M?void 0:M.value;if(null==k||isNaN(k)){if(h.showOnlyWhenComplete())return}else g[S]=k,m+=k}if(h.waffleTotalCode_){var T=h.statData(h.waffleTotalCode_).get(c),E=null==T?void 0:T.value;m=null==E||isNaN(E)?0:E}if(m&&!isNaN(m)){var I,P=map_waffle_charts_createForOfIteratorHelper(b);try{for(P.s();!(I=P.n()).done;){var L=I.value;void 0!==g[L]&&(g[L]/=m)}}catch(c){P.e(c)}finally{P.f()}if(h.waffleTotalCode_){var B=Object.values(g).reduce(function(c,h){return c+h},0);g.other=Math.max(0,1-B)}return g}};var b=function getRegionTotal(c){var g,m=0;if(h.waffleTotalCode_)!(g=h.statData(h.waffleTotalCode_).get(c))||0!=g.value&&!g.value||isNaN(g.value)?h.showOnlyWhenComplete()&&(m=void 0):m=g.value;else for(var b=0;b<h.statCodes_.length;b++){var w=h.statCodes_[b];if(!(g=h.statData(w).get(c))||0!=g.value&&!g.value||isNaN(g.value)){if(h.showOnlyWhenComplete())return}else m+=g.value}if(0!=m)return m};h.getLegendConstructor=function(){return bc};return h.tooltip_.textFunction=function waffleChartTooltipFunction(c,g){var w=h.waffleTooltipSize_||100,S=c.properties.na||c.properties.name,M=c.properties.id,k=m(M),T="";if(T+='<div class="em-tooltip-bar">'.concat(S).concat(M?" (".concat(M,")"):"","</div>"),!k)return T+="<div>".concat(h.noDataText(),"</div>");var E,I=(w-9)/10,P="",L=map_waffle_charts_createForOfIteratorHelper(generateWaffleCells(k,10));try{for(L.s();!(E=L.n()).done;){var B=E.value,z=10+B.col*(I+1),j=10+B.row*(I+1);P+='<rect x="'.concat(z,'" y="').concat(j,'" width="').concat(I,'" height="').concat(I,'" \n fill="').concat(B.color,'" stroke="white" stroke-width="0.5" rx="1" ry="1"/>')}}catch(c){L.e(c)}finally{L.f()}var D=w+20;T+="\n <div class='em-tooltip-wafflechart-container'>\n <svg viewBox=\"0 0 ".concat(D," ").concat(D,'" width="').concat(w,'" style="display:block;">\n ').concat(P,"\n </svg>\n </div>\n "),T+='<div class="em-tooltip-breakdown">';var N,R=h.statCodes_.map(function(c){var g=h.statData(c).get(M);return g&&void 0!==g.value&&null!==g.value?{code:c,label:h.catLabels_[c],value:g.value,color:h.catColors()[c]||"#666"}:null}).filter(Boolean).sort(function(c,h){return h.value-c.value}),G=b(M)||R.reduce(function(c,h){return c+h.value},0),q=map_waffle_charts_createForOfIteratorHelper(R);try{for(q.s();!(N=q.n()).done;){var W=N.value,H=G?(W.value/G*100).toFixed(0):0;T+='\n <div class="em-breakdown-item">\n <span class="em-breakdown-color" style="background:'.concat(W.color,'"></span>\n <span class="em-breakdown-label">').concat(W.label,'</span>\n <span class="em-breakdown-value">').concat(Ft(W.value)," (").concat(isNaN(H)?0:H,"%)</span>\n </div>\n ")}}catch(c){q.e(c)}finally{q.f()}if(null!=G){var U=h.statData(h.statCodes_[0]).unitText()||"";T+='\n <div class="em-breakdown-item em-total">\n <span class="em-breakdown-label">Total</span>\n <span class="em-breakdown-value">'.concat(Ft(G)," ").concat(U,"</span>\n </div>\n ")}return T+="</div>"},h};var wc=function map(c,h){try{return"choropleth"==c||"ch"==c?Fl(h):"categorical"==c||"ct"==c?function map(c){var h=Ml(c,!1,"ct");h.classToFillStyle_=void 0,h.classToText_=void 0,h.tooltip_.textFunction=$l,h.classifier_=void 0;var g=["classToFillStyle_","classToText_","noDataFillStyle_","tooltipText_","classifier_"];g.forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&g.forEach(function(g){var m=g.slice(0,-1);null!=c[m]&&h[m](c[m])}),h.updateClassification=function(){return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,m),m(h),h};var m=function applyClassificationToMap(c){var g=h.statData().getUniqueValues(),m=toConsumableArray_toConsumableArray(Array(g.length).keys()),b=h.classToFillStyle_?h.classToFillStyle():void 0;if(b){var w=Object.keys(b);h.classifier(ordinal().domain(w).range(w.map(function(c,h){return h})))}else h.classifier(ordinal().domain(g).range(m));var S=function classifyRegions(c){c.attr("ecl",function(c){var g=h.statData().get(c.properties.id);if(g){var m=g.value;if(":"===m)return"nd";var b=isNaN(m)?m:+m;if(h.classifier().domain().includes(b))return h.classifier()(b)}})},M=zt(c);S(c.svg().selectAll(M)),"mixed"===c.nutsLevel_&&S(c.svg().selectAll("path.em-nutsrg0"))};function applyStyleToMap(c){if(c.svg_){var g=zt(c),m=c.svg().selectAll(g);m.style("pointer-events","none").transition().duration(h.transitionDuration()).style("fill",w).end().then(function(){m.style("pointer-events",null),m.each(function(){var c=src_select(this);c.attr("fill___",c.style("fill"))}),S(c,m),h.gridCartogram_&&c.svg().selectAll(".em-grid-text").each(function(){var c=src_select(this.parentNode).style("fill");src_select(this).attr("fill",Ot(c))})}).catch(function(c){}),"mixed"===h.nutsLevel_&&b(c),h.labels_&&h.labels_.values&&h.updateValuesLabels(c),h.patternFill_&&applyPatternFill(c,h.patternFill_)}}h.updateStyle=function(){if(!h.classToFillStyle()){for(var c={},g=h.classifier().domain(),m=0;m<g.length;m++)c[g[m]]=Yl[m%12];h.classToFillStyle(c)}return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyStyleToMap),applyStyleToMap(h),h};var b=function styleMixedNUTS(c){c.svg().selectAll(zt(c)).style("display",function(c){if(!this.parentNode.classList.contains("em-cntrg")){var h=src_select(this),g=h.attr("ecl"),m=h.attr("lvl");return g||"0"===m?"block":"none"}}).style("stroke",function(){var c=src_select(this),h=c.attr("lvl"),g=c.attr("ecl"),m=c.style("stroke");return g&&"0"!==h?m||"#777":null}).style("stroke-width",function(){var c=src_select(this),h=c.attr("lvl"),g=c.attr("ecl"),m=c.style("stroke-width");return g&&"0"!==h?m||.2:null})},w=function regionsFillFunction(c){var g=src_select(this).attr("ecl");return h.Geometries.userGeometries?g?"nd"===g?h.noDataFillStyle()||"gray":h.classToFillStyle_[h.classifier().domain()[g]]:Lt("em-nutsrg","fill"):"WORLD"===h.geo_?g?"nd"===g?h.noDataFillStyle()||"gray":h.classToFillStyle_[h.classifier().domain()[g]]||h.cntrgFillStyle_:h.cntrgFillStyle_:(c.properties.id.slice(0,2),g?"nd"===g?h.noDataFillStyle()||"gray":h.classToFillStyle_[h.classifier().domain()[g]]:Lt("em-nutsrg","fill"))},S=function addMouseEventsToRegions(c,g){var m=function shouldOmit(h){var g;return null===(g=c.tooltip_.omitRegions)||void 0===g?void 0:g.includes(h)};g.on("mouseover",function(g,b){m(b.properties.id)||(src_select(this).style("fill",c.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(b,h)),h.onRegionMouseOver_&&h.onRegionMouseOver_(g,b,this,c))}).on("mousemove",function(g,b){m(b.properties.id)||(h._tooltip&&h._tooltip.mousemove(g),h.onRegionMouseMove_&&h.onRegionMouseMove_(g,b,this,c))}).on("mouseout",function(g,b){if(!m(b.properties.id)){var w=src_select(this);w.style("fill",w.attr("fill___")),h._tooltip&&h._tooltip.mouseout(),h.onRegionMouseOut_&&h.onRegionMouseOut_(g,b,this,c)}})};return h.getLegendConstructor=function(){return Vl},h}(h):"proportionalSymbol"==c||"proportionalSymbols"==c||"ps"==c?Wl(h):"bivariateChoropleth"==c||"chbi"==c?function map(c){var h=Ml(c,!1,"chbi");h.numberOfClasses_=3,h.startColor_="#e8e8e8",h.color1_="#73ae80",h.color2_="#6c83b5",h.endColor_="#2a5a5b",h.classToFillStyle_=void 0,h.classifier1_=void 0,h.classifier2_=void 0,h.breaks1_=void 0,h.breaks2_=void 0,h.tooltip_.textFunction=Zl;var g=["numberOfClasses_","breaks1_","breaks2_","startColor_","color1_","color2_","endColor_","classToFillStyle_","noDataFillStyle_","classifier1_","classifier2_"].forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}});function applyClassificationToMap(c){var g=function classifyRegions(c){c.attr("ecl1",function(c){var g=h.statData("v1").get(c.properties.id);if(g){var m=g.value;return 0!=m&&!m||":"==m?"nd":+h.classifier1_(+m)}}).attr("ecl2",function(c){var g=h.statData("v2").get(c.properties.id);if(g){var m=g.value;return 0!=m&&!m||":"==m?"nd":+h.classifier2_(+m)}}).attr("nd",function(c){var g=h.statData("v1").get(c.properties.id),m=h.statData("v2").get(c.properties.id);if(g||m){var b=null==g?void 0:g.value;return 0!=b&&!b||":"==b||0!=(b=null==m?void 0:m.value)&&!b||":"==b?"nd":void 0}})};if(function setupClassifiers(){var c=h.statData("v1").getArray(),g=h.statData("v2").getArray(),m=toConsumableArray_toConsumableArray(Array(h.numberOfClasses()).keys());if(h.classifier1_||(h.breaks1_?h.classifier1(threshold().domain(h.breaks1_).range(m)):h.classifier1(quantile_quantile().domain(c).range(m))),h.classifier2_||(h.breaks2_?h.classifier2(threshold().domain(h.breaks2_).range(m)):h.classifier2(quantile_quantile().domain(g).range(m))),!h.classToFillStyle_){var b=Kl(h.numberOfClasses(),h.startColor(),h.color1(),h.color2(),h.endColor());h.classToFillStyle(b)}}(),c.svg_){var m=zt(c);g(c.svg().selectAll(m)),"mixed"===c.nutsLevel_&&g(c.svg().selectAll("path.em-nutsrg0"))}}function applyStyleToMap(c){if(c.svg()){var g=zt(c),w=c.svg().selectAll(g);w.style("pointer-events","none").transition().duration(h.transitionDuration()).style("fill",function(c){if(src_select(this).attr("nd"))return h.noDataFillStyle()||"gray";var g=src_select(this).attr("ecl1"),m=src_select(this).attr("ecl2");return g||m?"nd"===m?h.noDataFillStyle()||"gray":h.classToFillStyle_(+g,+m):Lt("em-nutsrg","fill")}).end().then(function(){w.style("pointer-events",null),w.each(function(){var c=src_select(this);c.attr("fill___",c.style("fill"))}),b(c,w),h.gridCartogram_&&c.svg().selectAll(".em-grid-text").each(function(){var c=src_select(this.parentNode).style("fill");src_select(this).attr("fill",Ot(c))})},function(c){}),"mixed"==h.nutsLevel_&&m(c)}}c&&g.forEach(function(g){var m=g.slice(0,-1);null!=c[m]&&h[g](c[m])}),h.updateClassification=function(){return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyClassificationToMap),applyClassificationToMap(h),h},h.updateStyle=function(){return h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyStyleToMap),applyStyleToMap(h),h};var m=function styleMixedNUTS(c){c.svg().selectAll(zt(c)).each(function(){if(!this.parentNode.classList.contains("em-cntrg")){var c=src_select(this),h=c.attr("ecl1"),g=c.attr("ecl2"),m=c.attr("lvl"),b=h||g||"0"===m;if(c.style("display",b?"block":"none"),(h||g)&&"0"!==m){var w=c.style("stroke")||"#777",S=c.style("stroke-width")||.2;c.style("stroke",w).style("stroke-width",S)}}})},b=function addMouseEventsToRegions(c,g){var m=function shouldOmit(h){var g;return null===(g=c.tooltip_.omitRegions)||void 0===g?void 0:g.includes(h)};g.on("mouseover",function(g,b){var w;m(b.properties.id)||(src_select(this).style("fill",c.hoverColor_),null===(w=h._tooltip)||void 0===w||w.mouseover(h.tooltip_.textFunction(b,h)),h.onRegionMouseOver_&&h.onRegionMouseOver_(g,b,this,c))}).on("mousemove",function(g,b){var w;m(b.properties.id)||(null===(w=h._tooltip)||void 0===w||w.mousemove(g),h.onRegionMouseMove_&&h.onRegionMouseMove_(g,b,this,c))}).on("mouseout",function(g,b){if(!m(b.properties.id)){var w,S=src_select(this),M=S.attr("fill___");M&&(S.style("fill",M),null===(w=h._tooltip)||void 0===w||w.mouseout()),h.onRegionMouseOut_&&h.onRegionMouseOut_(g,b,this,c)}})};return h.getLegendConstructor=function(){return Xl},h}(h):"trivariateChoropleth"==c||"ternary"==c?tc(h):"stripeComposition"==c||"scomp"==c?function map(c){var h=Ml(c,!1,"scomp");h.stripeWidth_=50,h.stripeOrientation_=0,h.catColors_=void 0,h.catLabels_=void 0,h.showOnlyWhenComplete_=!1,h.pieChartRadius_=40,h.pieChartInnerRadius_=15;var g=["stripeWidth_","stripeOrientation_","catColors_","catLabels_","showOnlyWhenComplete_","noDataFillStyle_","pieChartRadius_","pieChartInnerRadius_"];g.forEach(function(c){h[c.substring(0,c.length-1)]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&g.forEach(function(g){var m=g.slice(0,-1);null!=c[m]&&h[m](c[m])}),h.statComp=function(c,g,b,w,S){void 0!==g&&"string"==typeof g&&(c=map_stripe_composition_objectSpread(map_stripe_composition_objectSpread({},c),{},{categoryParameter:g,categoryCodes:b,categoryLabels:w,categoryColors:S})),c.stat&&delete(c=map_stripe_composition_objectSpread(map_stripe_composition_objectSpread({},c.stat),c)).stat;var M=c,k=M.eurostatDatasetCode,T=M.filters,E=M.unitText,I=M.categoryParameter,P=M.categoryCodes,L=M.categoryLabels,B=M.categoryColors;if(!k)return console.error("statComp: eurostatDatasetCode is required"),h;if(!I)return console.error("statComp: categoryParameter is required"),h;if(!P||!P.length)return console.error("statComp: categoryCodes array is required"),h;for(var z=T?map_stripe_composition_objectSpread({},T):{},j=0;j<P.length;j++){var D=P[j],N={eurostatDatasetCode:k,unitText:E,filters:map_stripe_composition_objectSpread(map_stripe_composition_objectSpread({},z),{},_defineProperty({},I,D))};h.stat(D,N),B&&B[j]&&(h.catColors_=h.catColors_||{},h.catColors_[D]=B[j]),L&&L[j]&&(h.catLabels_=h.catLabels_||{},h.catLabels_[D]=L[j])}return m=P,h};var m=void 0,b=function getComposition(c){for(var g={},b=0,w=0;w<m.length;w++){var S=m[w],M=h.statData(S).get(c);if(!M||0!=M.value&&!M.value||isNaN(M.value)){if(h.showOnlyWhenComplete())return}else g[S]=M.value,b+=M.value}if(0!=b){for(var k=0;k<m.length;k++)g[m[k]]/=b;return g}};return h.updateClassification=function(){if(!m){var c=(m=Object.keys(h.statData_)).indexOf("default");c>-1&&m.splice(c,1)}return h},h.updateStyle=function(){if(!h.catColors()){h.catColors({});for(var c=0;c<m.length;c++)h.catColors()[m[c]]=nc[c%10]}h.catLabels_=h.catLabels_||{},h.svg().selectAll(zt(h)).style("fill",function(c){if(!this.parentNode.classList.contains("em-cntrg")){var g=c.properties.id,m=b(g);if(!m)return h.noDataFillStyle()||"gray";var w=h.svg().append("pattern").attr("id","pattern_"+g).attr("x","0").attr("y","0").attr("width",h.stripeWidth()).attr("height",1).attr("patternUnits","userSpaceOnUse");h.stripeOrientation()&&w.attr("patternTransform","rotate("+h.stripeOrientation()+")"),w.append("rect").attr("x",0).attr("y",0).attr("width",h.stripeWidth()).attr("height",1).style("stroke","none").style("fill","lightgray");var S=0;for(var M in m){var k=m[M];if(k){k*=h.stripeWidth();var T=h.catColors()[M]||"lightgray";w.append("rect").attr("x",S).attr("y",0).attr("height",1).style("stroke","none").attr("code",M).style("fill",T).style("pointer-events","none").transition().duration(h.transitionDuration()).on("end",function(){src_select(this).style("pointer-events",null)}).attr("width",k),S+=k}}return"url(#pattern_"+g+")"}}).attr("nd",function(c){return b(c.properties.id)?"":"nd"});var g=zt(h);return h.svg().selectAll(g).on("mouseover",function(c,g){var m=src_select(this);m.attr("fill___",m.style("fill")),m.style("fill",h.hoverColor_),h._tooltip&&h._tooltip.mouseover(h.tooltip_.textFunction(g,h))}).on("mousemove",function(c,g){h._tooltip&&h._tooltip.mousemove(c)}).on("mouseout",function(){var c=src_select(this);c.style("fill"),c.attr("fill___")&&(c.style("fill",c.attr("fill___")),h._tooltip&&h._tooltip.mouseout())}),h},h.getLegendConstructor=function(){return rc},h.tooltip_.textFunction=function tooltipTextFunctionStripeComposition(c,g){var m=c.properties.na||c.properties.name,w=c.properties.id,S=b(w),M=[];for(var k in S)M.push({code:k,value:S[k]});var T="";if(T+='<div class="em-tooltip-bar">\n <b>'.concat(m,"</b>").concat(w?" (".concat(w,")"):"","\n </div>"),!M||0===M.length)return T+"<div>".concat(h.noDataText(),"</div>");var E,I=h.pieChartRadius(),P=h.pieChartInnerRadius(),L=src_pie().sort(null).value(function(c){return c.value}),B=src_arc().innerRadius(P).outerRadius(I),z="",j=map_stripe_composition_createForOfIteratorHelper(L(M));try{for(j.s();!(E=j.n()).done;){var D=E.value,N=h.catColors()[D.data.code]||"lightgray",R=B(D);z+='<path d="'.concat(R,'" fill="').concat(N,'" stroke="darkgray"></path>')}}catch(c){j.e(c)}finally{j.f()}return T+'\n <div style="display: flex; justify-content: center;">\n <svg viewBox="'.concat(-I," ").concat(-I," ").concat(2*I," ").concat(2*I,'" width="').concat(2*I,'">\n <g>').concat(z,"</g>\n </svg>\n </div>\n ")},h}(h):"pieChart"==c||"pie"==c?ac(h):"sparkline"==c||"spark"==c||"sparklines"==c?sc(h):"flow"==c||"flowmap"==c?gc(h):"coxcomb"==c||"polar"==c?vc(h):"alpha"==c||"valueByAlpha"==c?function map(c){var h=Fl(c);h.alphaData_=null,h.opacityScale_=null,h.opacityScale=function(c){return arguments.length?(h.opacityScale_=c,h):h.opacityScale_};var g=h.updateStatValues;h.updateStatValues=function(){var c=h.statData("alpha");if(!c||!c.isReady())return h.alphaData_=null,h;h.alphaData_=c;var m=c.getArray().filter(function(c){return null!=c&&":"!==c&&!isNaN(+c)});if(!h.opacityScale_){var b=min_min(m),w=max_max(m);h.opacityScale_=m.length>0?linear_linear().domain([b,w]).range([.1,1]):null}return g.call(h),h.updateStyle()};var m=h.updateStyle;return h.updateStyle=function(){if(!h.svg_||!h.opacityScale_)return h;h.svg_.classed("em--alpha",!0);var c=h.statData();if(!c||!c.isReady())return h;var g=h.statData("alpha");if(!g||!g.isReady())return h;var b=zt(h);return h.svg().selectAll(b).each(function(m){var b,w,S=src_select(this),M=null===(b=c.get(m.properties.id))||void 0===b?void 0:b.value,k=null===(w=g.get(m.properties.id))||void 0===w?void 0:w.value;if(null!=M&&":"!==M)if("nd"!==k&&null!=k)S.style("opacity",h.opacityScale_(+k));else{var T=h.noDataFillStyle_||"gray";S.attr("ecl","nd").attr("force-grey","1").style("fill",T).attr("fill","grey").attr("fill___",T).style("opacity",1)}}),m.call(h),h},h.getLegendConstructor=function(){return qs},h.tooltip_.textFunction=function(c,h){var g,m,b=[],w=c.properties.na||c.properties.name,S=c.properties.id;b.push('<div class="em-tooltip-bar"><b>'.concat(w,"</b>").concat(S?" (".concat(S,")"):"","</div>"));var M=h.statData(),k=h.alphaData_||h.statData("alpha"),T=M.get(S),E=null==k?void 0:k.get(S),I=(null===(g=M.unitText)||void 0===g?void 0:g.call(M))||"",P=(null==k||null===(m=k.unitText)||void 0===m?void 0:m.call(k))||"",L=M.label_?M.label_+": ":"",B=null!=k&&k.label_?(null==k?void 0:k.label_)+": ":"";return!T||0!==T.value&&!T.value||":"===T.value?(b.push('\n <div class="em-tooltip-text no-data">\n <table class="em-tooltip-table">\n <tbody>\n <tr><td>'.concat(h.noDataText_,"</td></tr>\n </tbody>\n </table>\n </div>\n ")),b.join("")):(b.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>'.concat(L).concat(Ft(T.value)," ").concat(I,"</td>\n </tr>\n <tr>\n <td>").concat(E&&":"!==E.value&&null!=E.value?"".concat(B).concat(Ft(E.value)," ").concat(P):"".concat(B).concat(h.noDataText_),"</td>\n </tr>\n </tbody>\n </table>\n </div>\n")),b.join(""))},h}(h):"mushroom"==c?function map(c){var h=Ml(c,!0,"mushroom");h.mushroomCodes_=["v1","v2"],h.mushroomMinSize_=4,h.mushroomMaxSize_=30,h.mushroomColors_=["#2c7bb6","#d7191c"],h.mushroomOrientation_="vertical",h.mushroomSizeScaleFunction_=null,h.mushroomSizeScaleFunctionV1_=null,h.mushroomSizeScaleFunctionV2_=null,h._mushroomScale_=null,h.tooltip_.textFunction=Ac;var g=["mushroomCodes_","mushroomMinSize_","mushroomMaxSize_","mushroomColors_","mushroomOrientation_","mushroomSizeScaleFunction_","mushroomSizeScaleFunctionV1_","mushroomSizeScaleFunctionV2_"];return g.forEach(function(c){var g=c.slice(0,-1);h[g]=function(g){return arguments.length?(h[c]=g,h):h[c]}}),c&&g.forEach(function(g){var m=g.slice(0,-1);void 0!==c[m]&&h[m](c[m])}),h.updateClassification=function(){if(h.mushroomSizeScaleFunction_)h._mushroomScale_=h.mushroomSizeScaleFunction_;else if(!h.mushroomSizeScaleFunctionV1_||!h.mushroomSizeScaleFunctionV2_){h._mushroomScale_=null;var c=slicedToArray_slicedToArray(h.mushroomCodes_,2),g=c[0],m=c[1],b=h.statData(g),w=h.statData(m);if(!b&&!w)return h;var S=[];if(null!=b&&b.getArray&&b.getArray().forEach(function(c){var h=+c;Number.isFinite(h)&&S.push(h)}),null!=w&&w.getArray&&w.getArray().forEach(function(c){var h=+c;Number.isFinite(h)&&S.push(h)}),!S.length)return h;var M=max_max(S)||0;return h._mushroomScale_=pow_sqrt().domain([0,M]).range([h.mushroomMinSize_,h.mushroomMaxSize_]),h}},h.updateStyle=function(){if(h.updateSymbolsDrawOrder(h),applyStyleToMap(h),h.insetTemplates_&&Bt(h.insetTemplates_,h.svgId_,applyStyleToMap),h.dorling_&&(h._mushroomScale_||h.mushroomSizeScaleFunctionV1_&&h.mushroomSizeScaleFunctionV2_)){var c=slicedToArray_slicedToArray(h.mushroomCodes(),2),g=c[0],m=c[1],b=h.statData(g),w=h.statData(m);runDorlingSimulation(h,function(c){var g,m,S,M,k=c.properties.id,T=+(null===(g=b.get(k))||void 0===g?void 0:g.value)||0,E=+(null===(m=w.get(k))||void 0===m?void 0:m.value)||0;return h.mushroomSizeScaleFunctionV1_&&h.mushroomSizeScaleFunctionV2_?(S=h.mushroomSizeScaleFunctionV1_(T),M=h.mushroomSizeScaleFunctionV2_(E)):(S=h._mushroomScale_(T),M=h._mushroomScale_(E)),Math.sqrt((S*S+M*M)/2)})}else stopDorlingSimulation(h);return h},h.updateSymbolsDrawOrder=function(c){var g=h.getCentroidsGroup(c),m=slicedToArray_slicedToArray(h.mushroomCodes(),2),b=m[0],w=m[1],S=h.statData(b),M=h.statData(w);c.Geometries.centroidsFeatures&&c.Geometries.centroidsFeatures.length||(c.Geometries.centroidsFeatures=c.svg().selectAll("g.em-centroid").data().filter(function(c){var h;return null==c||null===(h=c.properties)||void 0===h?void 0:h.centroid}));var k=c.Geometries.centroidsFeatures.map(function(c){var g,m,b,w,k=c.properties.id,T=+(null===(g=S.get(k))||void 0===g?void 0:g.value)||0,E=+(null===(m=M.get(k))||void 0===m?void 0:m.value)||0;return h.mushroomSizeScaleFunctionV1_&&h.mushroomSizeScaleFunctionV2_?(b=h.mushroomSizeScaleFunctionV1_(T),w=h.mushroomSizeScaleFunctionV2_(E)):(b=h._mushroomScale_(T),w=h._mushroomScale_(E)),{d:c,r:Math.max(b,w)}}).filter(function(c){return c.r>0}).sort(function(c,h){return h.r-c.r}).map(function(c){return c.d});g.selectAll("g.em-centroid").remove(),g.selectAll("g.em-centroid").data(k,function(c){return c.properties.id}).enter().append("g").attr("class","em-centroid").attr("id",function(c){return"mushroom-"+c.properties.id}).attr("transform",function(c){return"translate(".concat(c.properties.centroid[0].toFixed(3),",").concat(c.properties.centroid[1].toFixed(3),")")})},h.getLegendConstructor=function(){return yc},h}(h):"waffle"==c?xc(h):(console.log("Unexpected map type: "+c),Ml(h,!0,c))}catch(c){console.error("Error in eurostat-map.map: "+c.message),console.error(c)}},Cc=function getFillPatternDefinitionFunction(c){(c=c||{}).shape=c.shape||"circle";var h=c.patternSize||5,g=c.minSize||1,m=c.maxSize||5.5;return c.bckColor=c.bckColor||"white",c.symbColor=c.symbColor||"black",function(b,w){b.selectAll(".em-fill-pattern").remove();for(var S=0;S<w;S++){var M=g+(m-g)*S/(w-1),k=b.append("pattern").attr("class","em-fill-pattern").attr("id","pattern_"+S).attr("x","0").attr("y","0").attr("width",h).attr("height",h).attr("patternUnits","userSpaceOnUse");k.append("rect").attr("x",0).attr("y",0).attr("width",h).attr("height",h).style("stroke","none").style("fill",c.bckColor),"square"==c.shape?k.append("rect").attr("x",0).attr("y",0).attr("width",M).attr("height",M).style("stroke","none").style("fill",c.symbColor):k.append("circle").attr("cx",.5*h).attr("cy",.5*h).attr("r",.5*M).style("stroke","none").style("fill",c.symbColor)}}},Sc=Cc,Mc=function getDefaultLabels(){return Hr},kc="4.3.44"})(),g})());
|
|
5
5
|
//# sourceMappingURL=eurostatmap.min.js.map
|