eurostat-map 4.3.39 → 4.3.41

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.
@@ -1,4 +1,5 @@
1
- /*! /*! eurostat-map v4.3.39 | 2026 Eurostat | EUPL License. See https://github.com/eurostat/eurostat-map/blob/master/LICENSE * / */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.eurostatmap=e():t.eurostatmap=e()}(self,()=>(()=>{var t={6:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.id,"/* 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{padding-top:6px;font-weight:600;color:#222}\n.em-donut-tooltip-row td{padding-top:2px}\n.em-donut-tooltip-total td{padding-top:6px;font-weight:700;border-top:1px solid #ddd}\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 */",""]);const s=o},56:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},72:t=>{"use strict";var e=[];function n(t){for(var n=-1,r=0;r<e.length;r++)if(e[r].identifier===t){n=r;break}return n}function r(t,r){for(var a={},o=[],s=0;s<t.length;s++){var l=t[s],c=r.base?l[0]+r.base:l[0],u=a[c]||0,h="".concat(c," ").concat(u);a[c]=u+1;var f=n(h),d={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==f)e[f].references++,e[f].updater(d);else{var p=i(d,r);r.byIndex=s,e.splice(s,0,{identifier:h,updater:p,references:1})}o.push(h)}return o}function i(t,e){var n=e.domAPI(e);n.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,i){var a=r(t=t||[],i=i||{});return function(t){t=t||[];for(var o=0;o<a.length;o++){var s=n(a[o]);e[s].references--}for(var l=r(t,i),c=0;c<a.length;c++){var u=n(a[c]);0===e[u].references&&(e[u].updater(),e.splice(u,1))}a=l}}},113:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},144:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.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",""]);const s=o},172:t=>{t.exports=function(t,e){this.v=t,this.k=e},t.exports.__esModule=!0,t.exports.default=t.exports},176:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.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}",""]);const s=o},206:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.id,".em-flow-width-horizontal-label {\n text-anchor: middle;\n font-size: 13px;\n /* fill: #3a3a3a */\n}",""]);const s=o},211:(t,e,n)=>{"use strict";n.d(e,{A:()=>y});var r=n(601),i=n.n(r),a=n(314),o=n.n(a),s=n(489),l=n(666),c=n(282),u=n(470),h=n(789),f=n(991),d=n(875),p=n(765),g=n(358),m=n(476),v=n(869),_=o()(i());_.i(s.A),_.i(l.A),_.i(c.A),_.i(u.A),_.i(h.A),_.i(f.A),_.i(d.A),_.i(p.A),_.i(g.A),_.i(m.A),_.i(v.A),_.push([t.id,"\n",""]);const y=_},250:(t,e,n)=>{var r=n(887);t.exports=function(t,e,n,i,a){var o=r(t,e,n,i,a);return o.next().then(function(t){return t.done?t.value:o.next()})},t.exports.__esModule=!0,t.exports.default=t.exports},262:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.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}",""]);const s=o},275:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.id,".em-legend-label.em-spike-legend-label {\n font-size:12px;\n}",""]);const s=o},282:(t,e,n)=>{"use strict";n.d(e,{A:()=>p});var r=n(601),i=n.n(r),a=n(314),o=n.n(a),s=n(477),l=n(924),c=n(206),u=n(399),h=n(275),f=n(176),d=o()(i());d.i(s.A),d.i(l.A),d.i(c.A),d.i(u.A),d.i(h.A),d.i(f.A),d.push([t.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}",""]);const p=d},314:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n}).join("")},e.i=function(t,n,r,i,a){"string"==typeof t&&(t=[[null,t,void 0]]);var o={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(o[l]=!0)}for(var c=0;c<t.length;c++){var u=[].concat(t[c]);r&&o[u[0]]||(void 0!==a&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=a),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),e.push(u))}},e}},358:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.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",""]);const s=o},373:t=>{t.exports=function(t){var e=Object(t),n=[];for(var r in e)n.unshift(r);return function t(){for(;n.length;)if((r=n.pop())in e)return t.value=r,t.done=!1,t;return t.done=!0,t}},t.exports.__esModule=!0,t.exports.default=t.exports},399:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.id,".em-pie-size-legend-line {\n stroke-dasharray: 2;\n stroke: grey;\n}",""]);const s=o},429:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.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}',""]);const s=o},470:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.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",""]);const s=o},476:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.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}",""]);const s=o},477:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.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}",""]);const s=o},489:(t,e,n)=>{"use strict";n.d(e,{A:()=>p});var r=n(601),i=n.n(r),a=n(314),o=n.n(a),s=n(262),l=n(429),c=n(768),u=n(6),h=n(774),f=n(549),d=o()(i());d.i(s.A),d.i(l.A),d.i(c.A),d.i(u.A),d.i(h.A),d.i(f.A),d.push([t.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\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-inset-title {\n font-size: 11px;\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-inset-subtitle {\n font-size: 12px;\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.em-insets .em-frame {\n /* this will give a frame to inset maps */\n stroke: grey;\n stroke-width: 0.3px !important;\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, .em-coxcomb g {\n cursor: pointer !important;\n}\n\n/* Graticule styling */\n.em-graticule {\n stroke: lightgray;\n stroke-width: 1;\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}",""]);const p=d},540:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},546:t=>{function e(n,r,i,a){var o=Object.defineProperty;try{o({},"",{})}catch(n){o=0}t.exports=e=function(t,n,r,i){function a(n,r){e(t,n,function(t){return this._invoke(n,r,t)})}n?o?o(t,n,{value:r,enumerable:!i,configurable:!i,writable:!i}):t[n]=r:(a("next",0),a("throw",1),a("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,e(n,r,i,a)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},549:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.id,"/* Sparkline maps */\n\n/* muted country boundaries */\n.em--spark .em-cntbn {\n stroke: grey;\n stroke-width: 0.2px;\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.07px;\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.1px;\n}",""]);const s=o},579:(t,e,n)=>{var r=n(738).default;t.exports=function(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(r(t)+" is not iterable")},t.exports.__esModule=!0,t.exports.default=t.exports},601:t=>{"use strict";t.exports=function(t){return t[1]}},633:(t,e,n)=>{var r=n(172),i=n(993),a=n(250),o=n(887),s=n(791),l=n(373),c=n(579);function u(){"use strict";var e=i(),n=e.m(u),h=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function f(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))}var d={throw:1,return:2,break:3,continue:3};function p(t){var e,n;return function(r){e||(e={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(t,e){return n(r.a,d[t],e)},delegateYield:function(t,i,a){return e.resultName=i,n(r.d,c(t),a)},finish:function(t){return n(r.f,t)}},n=function(t,n,i){r.p=e.prev,r.n=e.next;try{return t(n,i)}finally{e.next=r.n}}),e.resultName&&(e[e.resultName]=r.v,e.resultName=void 0),e.sent=r.v,e.next=r.n;try{return t.call(this,e)}finally{r.p=e.prev,r.n=e.next}}}return(t.exports=u=function(){return{wrap:function(t,n,r,i){return e.w(p(t),n,r,i&&i.reverse())},isGeneratorFunction:f,mark:e.m,awrap:function(t,e){return new r(t,e)},AsyncIterator:s,async:function(t,e,n,r,i){return(f(e)?o:a)(p(t),e,n,r,i)},keys:l,values:c}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=u,t.exports.__esModule=!0,t.exports.default=t.exports},659:t=>{"use strict";var e={};t.exports=function(t,n){var r=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},666:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.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",""]);const s=o},738:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},756:(t,e,n)=>{var r=n(633)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},765:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var r=n(601),i=n.n(r),a=n(314),o=n.n(a),s=n(144),l=o()(i());l.i(s.A),l.push([t.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}",""]);const c=l},768:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.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",""]);const s=o},774:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.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}",""]);const s=o},789:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.id,".em-annotations {\n /* pointer-events: none; */\n}\n",""]);const s=o},791:(t,e,n)=>{var r=n(172),i=n(546);t.exports=function t(e,n){function a(t,i,o,s){try{var l=e[t](i),c=l.value;return c instanceof r?n.resolve(c.v).then(function(t){a("next",t,o,s)},function(t){a("throw",t,o,s)}):n.resolve(c).then(function(t){l.value=t,o(l)},function(t){return a("throw",t,o,s)})}catch(t){s(t)}}var o;this.next||(i(t.prototype),i(t.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),i(this,"_invoke",function(t,e,r){function i(){return new n(function(e,n){a(t,r,e,n)})}return o=o?o.then(i,i):i()},!0)},t.exports.__esModule=!0,t.exports.default=t.exports},825:t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleTagTransform(r,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},869:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.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",""]);const s=o},875:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.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",""]);const s=o},887:(t,e,n)=>{var r=n(993),i=n(791);t.exports=function(t,e,n,a,o){return new i(r().w(t,e,n,a),o||Promise)},t.exports.__esModule=!0,t.exports.default=t.exports},924:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.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}",""]);const s=o},991:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([t.id,"/* STYLING OF NUTS REGIONS AND BOUNDARIES */\n/* Default region fill */\n.em-cntrg,\n.em-nutsrg,\n.em-grid-cell {\n fill: #e1e1e1;\n}\n\n.em-nutsrg,\n.em-cntrg,\n.em-grid-cell,\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 boudnaries and regions linecap/linejoin */\n#em-nutsbn,\n.em-cntbn,\n.em-cntbn-halo,\n.em-bn-0,\n.em-bn-1,\n.em-bn-2,\n.em-bn-3,\n.em-kosovo-bn,\n.em-bn-co,\n.em-nutsrg [lvl='3'],\n.em-nutsrg [lvl='2'],\n.em-nutsrg [lvl='1'],\n.em-cntrg,\n.em-nutsrg,\n.em-grid-cell {\n stroke-linecap: round;\n stroke-linejoin: round;\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: rgba(216, 216, 216, 0.4);\n stroke-width: 3px;\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/* coastal boundaries */\n.em-bn-co {\n stroke: white;\n}\n\n/* kosovo */\n.em-kosovo-bn {\n stroke: #000;\n stroke-width: 0.15;\n}\n\n/* dont fill certain elements */\n.em-frame,\n.em-graticule,\n.em-cntbn,\n.em-cntbn-halo,\n.em-bn-0,\n.em-bn-1,\n.em-bn-2,\n.em-bn-3,\n.em-kosovo-bn,\n.em-bn-co {\n fill: none;\n pointer-events: none;\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",""]);const s=o},993:(t,e,n)=>{var r=n(546);function i(){
1
+ /*! /*! eurostat-map v4.3.41 | 2026 Eurostat | EUPL License. See https://github.com/eurostat/eurostat-map/blob/master/LICENSE * / */
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,YAAY;AAChB;;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 e,n,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.toStringTag||"@@toStringTag";function l(t,i,a,o){var s=i&&i.prototype instanceof u?i:u,l=Object.create(s.prototype);return r(l,"_invoke",function(t,r,i){var a,o,s,l=0,u=i||[],h=!1,f={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return a=t,o=0,s=e,f.n=n,c}};function d(t,r){for(o=t,s=r,n=0;!h&&l&&!i&&n<u.length;n++){var i,a=u[n],d=f.p,p=a[2];t>3?(i=p===r)&&(s=a[(o=a[4])?5:(o=3,3)],a[4]=a[5]=e):a[0]<=d&&((i=t<2&&d<a[1])?(o=0,f.v=r,f.n=a[1]):d<p&&(i=t<3||a[0]>r||r>p)&&(a[4]=t,a[5]=r,f.n=p,o=0))}if(i||t>1)return c;throw h=!0,r}return function(i,u,p){if(l>1)throw TypeError("Generator is already running");for(h&&1===u&&d(u,p),o=u,s=p;(n=o<2?e:s)||!h;){a||(o?o<3?(o>1&&(f.n=-1),d(o,s)):f.n=s:f.v=s);try{if(l=2,a){if(o||(i="next"),n=a[i]){if(!(n=n.call(a,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,o<2&&(o=0)}else 1===o&&(n=a.return)&&n.call(a),o<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),o=1);a=e}else if((n=(h=f.n<0)?s:t.call(r,f))!==c)break}catch(t){a=e,o=1,s=t}finally{l=1}}return{value:n,done:h}}}(t,a,o),!0),l}var c={};function u(){}function h(){}function f(){}n=Object.getPrototypeOf;var d=[][o]?n(n([][o]())):(r(n={},o,function(){return this}),n),p=f.prototype=u.prototype=Object.create(d);function g(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,r(t,s,"GeneratorFunction")),t.prototype=Object.create(p),t}return h.prototype=f,r(p,"constructor",f),r(f,"constructor",h),h.displayName="GeneratorFunction",r(f,s,"GeneratorFunction"),r(p),r(p,s,"Generator"),r(p,o,function(){return this}),r(p,"toString",function(){return"[object Generator]"}),(t.exports=i=function(){return{w:l,m:g}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var a=e[r]={id:r,exports:{}};return t[r](a,a.exports,n),a.exports}n.m=t,n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.u=t=>t+".eurostatmap.min.js",n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.p="/build/",n.b=document.baseURI||self.location.href,n.nc=void 0;var r={};return(()=>{"use strict";n.r(r),n.d(r,{getDefaultLabels:()=>TM,getFillPatternDefinitionFun:()=>AM,getFillPatternDefinitionFunction:()=>kM,map:()=>EM,version:()=>PM});var t=n(72),e=n.n(t),i=n(825),a=n.n(i),o=n(659),s=n.n(o),l=n(56),c=n.n(l),u=n(540),h=n.n(u),f=n(113),d=n.n(f),p=n(211),g={};g.styleTagTransform=d(),g.setAttributes=c(),g.insert=s().bind(null,"head"),g.domAPI=a(),g.insertStyleElement=h();e()(p.A,g);p.A&&p.A.locals&&p.A.locals;function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function v(t,e){if(t){if("string"==typeof t)return m(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(t,e):void 0}}function _(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],l=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(t,e)||v(t,e)||function(){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 y(t){return function(t){if(Array.isArray(t))return m(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||v(t)||function(){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 x(){}function b(t){return null==t?x:function(){return this.querySelector(t)}}function w(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function M(){return[]}function S(t){return null==t?M:function(){return this.querySelectorAll(t)}}function C(t){return function(){return this.matches(t)}}function E(t){return function(e){return e.matches(t)}}var k=Array.prototype.find;function A(){return this.firstElementChild}var T=Array.prototype.filter;function P(){return Array.from(this.children)}function F(t){return new Array(t.length)}function L(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function N(t,e,n,r,i,a){for(var o,s=0,l=e.length,c=a.length;s<c;++s)(o=e[s])?(o.__data__=a[s],r[s]=o):n[s]=new L(t,a[s]);for(;s<l;++s)(o=e[s])&&(i[s]=o)}function O(t,e,n,r,i,a,o){var s,l,c,u=new Map,h=e.length,f=a.length,d=new Array(h);for(s=0;s<h;++s)(l=e[s])&&(d[s]=c=o.call(l,l.__data__,s,e)+"",u.has(c)?i[s]=l:u.set(c,l));for(s=0;s<f;++s)c=o.call(t,a[s],s,a)+"",(l=u.get(c))?(r[s]=l,l.__data__=a[s],u.delete(c)):n[s]=new L(t,a[s]);for(s=0;s<h;++s)(l=e[s])&&u.get(d[s])===l&&(i[s]=l)}function D(t){return t.__data__}function z(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function I(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}L.prototype={constructor:L,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var G="http://www.w3.org/1999/xhtml";const j={svg:"http://www.w3.org/2000/svg",xhtml:G,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function R(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),j.hasOwnProperty(e)?{space:j[e],local:t}:t}function B(t){return function(){this.removeAttribute(t)}}function W(t){return function(){this.removeAttributeNS(t.space,t.local)}}function q(t,e){return function(){this.setAttribute(t,e)}}function U(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function H(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function V(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Y(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function $(t){return function(){this.style.removeProperty(t)}}function X(t,e,n){return function(){this.style.setProperty(t,e,n)}}function J(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Z(t,e){return t.style.getPropertyValue(e)||Y(t).getComputedStyle(t,null).getPropertyValue(e)}function K(t){return function(){delete this[t]}}function Q(t,e){return function(){this[t]=e}}function tt(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function et(t){return t.trim().split(/^|\s+/)}function nt(t){return t.classList||new rt(t)}function rt(t){this._node=t,this._names=et(t.getAttribute("class")||"")}function it(t,e){for(var n=nt(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function at(t,e){for(var n=nt(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function ot(t){return function(){it(this,t)}}function st(t){return function(){at(this,t)}}function lt(t,e){return function(){(e.apply(this,arguments)?it:at)(this,t)}}function ct(){this.textContent=""}function ut(t){return function(){this.textContent=t}}function ht(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function ft(){this.innerHTML=""}function dt(t){return function(){this.innerHTML=t}}function pt(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function gt(){this.nextSibling&&this.parentNode.appendChild(this)}function mt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function vt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===G&&e.documentElement.namespaceURI===G?e.createElement(t):e.createElementNS(n,t)}}function _t(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function yt(t){var e=R(t);return(e.local?_t:vt)(e)}function xt(){return null}function bt(){var t=this.parentNode;t&&t.removeChild(this)}function wt(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Mt(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function St(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r<a;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.options);++i?e.length=i:delete this.__on}}}function Ct(t,e,n){return function(){var r,i=this.__on,a=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(i)for(var o=0,s=i.length;o<s;++o)if((r=i[o]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=a,r.options=n),void(r.value=e);this.addEventListener(t.type,a,n),r={type:t.type,name:t.name,value:e,listener:a,options:n},i?i.push(r):this.__on=[r]}}function Et(t,e,n){var r=Y(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function kt(t,e){return function(){return Et(this,t,e)}}function At(t,e){return function(){return Et(this,t,e.apply(this,arguments))}}rt.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Tt=[null];function Pt(t,e){this._groups=t,this._parents=e}function Ft(){return new Pt([[document.documentElement]],Tt)}Pt.prototype=Ft.prototype={constructor:Pt,select:function(t){"function"!=typeof t&&(t=b(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,o,s=e[i],l=s.length,c=r[i]=new Array(l),u=0;u<l;++u)(a=s[u])&&(o=t.call(a,a.__data__,u,s))&&("__data__"in a&&(o.__data__=a.__data__),c[u]=o);return new Pt(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return w(t.apply(this,arguments))}}(t):S(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o,s=e[a],l=s.length,c=0;c<l;++c)(o=s[c])&&(r.push(t.call(o,o.__data__,c,s)),i.push(o));return new Pt(r,i)},selectChild:function(t){return this.select(null==t?A:function(t){return function(){return k.call(this.children,t)}}("function"==typeof t?t:E(t)))},selectChildren:function(t){return this.selectAll(null==t?P:function(t){return function(){return T.call(this.children,t)}}("function"==typeof t?t:E(t)))},filter:function(t){"function"!=typeof t&&(t=C(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,o=e[i],s=o.length,l=r[i]=[],c=0;c<s;++c)(a=o[c])&&t.call(a,a.__data__,c,o)&&l.push(a);return new Pt(r,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,D);var n=e?O:N,r=this._parents,i=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var a=i.length,o=new Array(a),s=new Array(a),l=new Array(a),c=0;c<a;++c){var u=r[c],h=i[c],f=h.length,d=z(t.call(u,u&&u.__data__,c,r)),p=d.length,g=s[c]=new Array(p),m=o[c]=new Array(p);n(u,h,g,m,l[c]=new Array(f),d,e);for(var v,_,y=0,x=0;y<p;++y)if(v=g[y]){for(y>=x&&(x=y+1);!(_=m[x])&&++x<p;);v._next=_||null}}return(o=new Pt(o,r))._enter=s,o._exit=l,o},enter:function(){return new Pt(this._enter||this._groups.map(F),this._parents)},exit:function(){return new Pt(this._exit||this._groups.map(F),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,a=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=e&&(i=e(i))&&(i=i.selection()),null==n?a.remove():n(a),r&&i?r.merge(i).order():i},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,a=r.length,o=Math.min(i,a),s=new Array(i),l=0;l<o;++l)for(var c,u=n[l],h=r[l],f=u.length,d=s[l]=new Array(f),p=0;p<f;++p)(c=u[p]||h[p])&&(d[p]=c);for(;l<i;++l)s[l]=n[l];return new Pt(s,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],a=i.length-1,o=i[a];--a>=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=I);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o,s=n[a],l=s.length,c=i[a]=new Array(l),u=0;u<l;++u)(o=s[u])&&(c[u]=o);c.sort(e)}return new Pt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,a=e[n],o=0,s=a.length;o<s;++o)(i=a[o])&&t.call(i,i.__data__,o,a);return this},attr:function(t,e){var n=R(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?W:B:"function"==typeof e?n.local?V:H:n.local?U:q)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?$:"function"==typeof e?J:X)(t,e,null==n?"":n)):Z(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?K:"function"==typeof e?tt:Q)(t,e)):this.node()[t]},classed:function(t,e){var n=et(t+"");if(arguments.length<2){for(var r=nt(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?lt:e?ot:st)(n,e))},text:function(t){return arguments.length?this.each(null==t?ct:("function"==typeof t?ht:ut)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?ft:("function"==typeof t?pt:dt)(t)):this.node().innerHTML},raise:function(){return this.each(gt)},lower:function(){return this.each(mt)},append:function(t){var e="function"==typeof t?t:yt(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var n="function"==typeof t?t:yt(t),r=null==e?xt:"function"==typeof e?e:b(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(bt)},clone:function(t){return this.select(t?Mt:wt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,a=function(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}(t+""),o=a.length;if(!(arguments.length<2)){for(s=e?Ct:St,r=0;r<o;++r)this.each(s(a[r],e,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(r=0,l=s[c];r<o;++r)if((i=a[r]).type===l.type&&i.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?At:kt)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r,i=t[e],a=0,o=i.length;a<o;++a)(r=i[a])&&(yield r)}};const Lt=Ft;function Nt(t){return"string"==typeof t?new Pt([[document.querySelector(t)]],[document.documentElement]):new Pt([[t]],Tt)}function Ot(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function Dt(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function zt(t){return null===t?NaN:+t}function It(t,e,n=zt){if((r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,a=Math.floor(i),o=+n(t[a],a,t);return o+(+n(t[a+1],a+1,t)-o)*(i-a)}}function Gt(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function jt(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Rt(t){let e,n,r;function i(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<0?i=e+1:a=e}while(i<a)}return i}return 2!==t.length?(e=Gt,n=(e,n)=>Gt(t(e),n),r=(e,n)=>t(e)-n):(e=t===Gt||t===jt?t:Bt,n=t,r=t),{left:i,center:function(t,e,n=0,a=t.length){const o=i(t,e,n,a-1);return o>n&&r(t[o-1],e)>-r(t[o],e)?o-1:o},right:function(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<=0?i=e+1:a=e}while(i<a)}return i}}}function Bt(){return 0}const Wt=Rt(Gt),qt=Wt.right,Ut=(Wt.left,Rt(zt).center,qt);function Ht(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Vt(){var t,e=[],n=[],r=[];function i(){var t=0,i=Math.max(1,n.length);for(r=new Array(i-1);++t<i;)r[t-1]=It(e,t/i);return a}function a(e){return null==e||isNaN(e=+e)?t:n[Ut(r,e)]}return a.invertExtent=function(t){var i=n.indexOf(t);return i<0?[NaN,NaN]:[i>0?r[i-1]:e[0],i<r.length?r[i]:e[e.length-1]]},a.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)null==n||isNaN(n=+n)||e.push(n);return e.sort(Gt),i()},a.range=function(t){return arguments.length?(n=Array.from(t),i()):n.slice()},a.unknown=function(e){return arguments.length?(t=e,a):t},a.quantiles=function(){return r.slice()},a.copy=function(){return Vt().domain(e).range(n).unknown(t)},Ht.apply(a,arguments)}const Yt=Math.sqrt(50),$t=Math.sqrt(10),Xt=Math.sqrt(2);function Jt(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=Yt?10:a>=$t?5:a>=Xt?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/o,s=Math.round(t*c),l=Math.round(e*c),s/c<t&&++s,l/c>e&&--l,c=-c):(c=Math.pow(10,i)*o,s=Math.round(t/c),l=Math.round(e/c),s*c<t&&++s,l*c>e&&--l),l<s&&.5<=n&&n<2?Jt(t,e,2*n):[s,l,c]}function Zt(t,e,n){return Jt(t=+t,e=+e,n=+n)[2]}function Kt(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Qt(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function te(){}var ee=.7,ne=1/ee,re="\\s*([+-]?\\d+)\\s*",ie="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ae="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",oe=/^#([0-9a-f]{3,8})$/,se=new RegExp(`^rgb\\(${re},${re},${re}\\)$`),le=new RegExp(`^rgb\\(${ae},${ae},${ae}\\)$`),ce=new RegExp(`^rgba\\(${re},${re},${re},${ie}\\)$`),ue=new RegExp(`^rgba\\(${ae},${ae},${ae},${ie}\\)$`),he=new RegExp(`^hsl\\(${ie},${ae},${ae}\\)$`),fe=new RegExp(`^hsla\\(${ie},${ae},${ae},${ie}\\)$`),de={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 pe(){return this.rgb().formatHex()}function ge(){return this.rgb().formatRgb()}function me(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=oe.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ve(e):3===n?new be(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?_e(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?_e(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=se.exec(t))?new be(e[1],e[2],e[3],1):(e=le.exec(t))?new be(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ce.exec(t))?_e(e[1],e[2],e[3],e[4]):(e=ue.exec(t))?_e(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=he.exec(t))?ke(e[1],e[2]/100,e[3]/100,1):(e=fe.exec(t))?ke(e[1],e[2]/100,e[3]/100,e[4]):de.hasOwnProperty(t)?ve(de[t]):"transparent"===t?new be(NaN,NaN,NaN,0):null}function ve(t){return new be(t>>16&255,t>>8&255,255&t,1)}function _e(t,e,n,r){return r<=0&&(t=e=n=NaN),new be(t,e,n,r)}function ye(t){return t instanceof te||(t=me(t)),t?new be((t=t.rgb()).r,t.g,t.b,t.opacity):new be}function xe(t,e,n,r){return 1===arguments.length?ye(t):new be(t,e,n,null==r?1:r)}function be(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function we(){return`#${Ee(this.r)}${Ee(this.g)}${Ee(this.b)}`}function Me(){const t=Se(this.opacity);return`${1===t?"rgb(":"rgba("}${Ce(this.r)}, ${Ce(this.g)}, ${Ce(this.b)}${1===t?")":`, ${t})`}`}function Se(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ce(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ee(t){return((t=Ce(t))<16?"0":"")+t.toString(16)}function ke(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Te(t,e,n,r)}function Ae(t){if(t instanceof Te)return new Te(t.h,t.s,t.l,t.opacity);if(t instanceof te||(t=me(t)),!t)return new Te;if(t instanceof Te)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,l=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new Te(o,s,l,t.opacity)}function Te(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Pe(t){return(t=(t||0)%360)<0?t+360:t}function Fe(t){return Math.max(0,Math.min(1,t||0))}function Le(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Ne(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}Kt(te,me,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:pe,formatHex:pe,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ae(this).formatHsl()},formatRgb:ge,toString:ge}),Kt(be,xe,Qt(te,{brighter(t){return t=null==t?ne:Math.pow(ne,t),new be(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?ee:Math.pow(ee,t),new be(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new be(Ce(this.r),Ce(this.g),Ce(this.b),Se(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:we,formatHex:we,formatHex8:function(){return`#${Ee(this.r)}${Ee(this.g)}${Ee(this.b)}${Ee(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Me,toString:Me})),Kt(Te,function(t,e,n,r){return 1===arguments.length?Ae(t):new Te(t,e,n,null==r?1:r)},Qt(te,{brighter(t){return t=null==t?ne:Math.pow(ne,t),new Te(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?ee:Math.pow(ee,t),new Te(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new be(Le(t>=240?t-240:t+120,i,r),Le(t,i,r),Le(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Te(Pe(this.h),Fe(this.s),Fe(this.l),Se(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 t=Se(this.opacity);return`${1===t?"hsl(":"hsla("}${Pe(this.h)}, ${100*Fe(this.s)}%, ${100*Fe(this.l)}%${1===t?")":`, ${t})`}`}}));const Oe=t=>()=>t;function De(t,e){return function(n){return t+n*e}}function ze(t){return 1===(t=+t)?Ie:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Oe(isNaN(e)?n:e)}}function Ie(t,e){var n=e-t;return n?De(t,n):Oe(isNaN(t)?e:t)}const Ge=function t(e){var n=ze(e);function r(t,e){var r=n((t=xe(t)).r,(e=xe(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=Ie(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);function je(t){return function(e){var n,r,i=e.length,a=new Array(i),o=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=xe(e[n]),a[n]=r.r||0,o[n]=r.g||0,s[n]=r.b||0;return a=t(a),o=t(o),s=t(s),r.opacity=1,function(t){return r.r=a(t),r.g=o(t),r.b=s(t),r+""}}}var Re=je(function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],o=r>0?t[r-1]:2*i-a,s=r<e-1?t[r+2]:2*a-i;return Ne((n-r/e)*e,o,i,a,s)}});je(function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],a=t[r%e],o=t[(r+1)%e],s=t[(r+2)%e];return Ne((n-r/e)*e,i,a,o,s)}});function Be(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,a=new Array(i),o=new Array(r);for(n=0;n<i;++n)a[n]=Xe(t[n],e[n]);for(;n<r;++n)o[n]=e[n];return function(t){for(n=0;n<i;++n)o[n]=a[n](t);return o}}function We(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function qe(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Ue(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=Xe(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}var He=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ve=new RegExp(He.source,"g");function Ye(t,e){var n,r,i,a=He.lastIndex=Ve.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(n=He.exec(t))&&(r=Ve.exec(e));)(i=r.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,l.push({i:o,x:qe(n,r)})),a=Ve.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,r=0;r<e;++r)s[(n=l[r]).i]=n.x(t);return s.join("")})}function $e(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(a){for(n=0;n<r;++n)i[n]=t[n]*(1-a)+e[n]*a;return i}}function Xe(t,e){var n,r=typeof e;return null==e||"boolean"===r?Oe(e):("number"===r?qe:"string"===r?(n=me(e))?(e=n,Ge):Ye:e instanceof me?Ge:e instanceof Date?We:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(e)?$e:Array.isArray(e)?Be:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Ue:qe)(t,e)}function Je(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Ze(t){return+t}var Ke=[0,1];function Qe(t){return t}function tn(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:function(t){return function(){return t}}(isNaN(e)?NaN:.5)}function en(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i<r?(r=tn(i,r),a=n(o,a)):(r=tn(r,i),a=n(a,o)),function(t){return a(r(t))}}function nn(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<r;)i[o]=tn(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(e){var n=Ut(t,e,1,r)-1;return a[n](i[n](e))}}function rn(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function an(){var t,e,n,r,i,a,o=Ke,s=Ke,l=Xe,c=Qe;function u(){var t=Math.min(o.length,s.length);return c!==Qe&&(c=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(o[0],o[t-1])),r=t>2?nn:en,i=a=null,h}function h(e){return null==e||isNaN(e=+e)?n:(i||(i=r(o.map(t),s,l)))(t(c(e)))}return h.invert=function(n){return c(e((a||(a=r(s,o.map(t),qe)))(n)))},h.domain=function(t){return arguments.length?(o=Array.from(t,Ze),u()):o.slice()},h.range=function(t){return arguments.length?(s=Array.from(t),u()):s.slice()},h.rangeRound=function(t){return s=Array.from(t),l=Je,u()},h.clamp=function(t){return arguments.length?(c=!!t||Qe,u()):c!==Qe},h.interpolate=function(t){return arguments.length?(l=t,u()):l},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,r){return t=n,e=r,u()}}function on(){return an()(Qe,Qe)}var sn,ln=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function cn(t){if(!(e=ln.exec(t)))throw new Error("invalid format: "+t);var e;return new un({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function un(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function hn(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function fn(t){return(t=hn(Math.abs(t)))?t[1]:NaN}function dn(t,e){var n=hn(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}cn.prototype=un.prototype,un.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 pn={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>dn(100*t,e),r:dn,s:function(t,e){var n=hn(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(sn=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+hn(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function gn(t){return t}var mn,vn,_n,yn=Array.prototype.map,xn=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function bn(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?gn:(e=yn.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?gn:function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(yn.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=cn(t)).fill,n=t.align,h=t.sign,f=t.symbol,d=t.zero,p=t.width,g=t.comma,m=t.precision,v=t.trim,_=t.type;"n"===_?(g=!0,_="g"):pn[_]||(void 0===m&&(m=12),v=!0,_="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var y="$"===f?i:"#"===f&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",x="$"===f?a:/[%p]/.test(_)?l:"",b=pn[_],w=/[defgprs%]/.test(_);function M(t){var i,a,l,f=y,M=x;if("c"===_)M=b(t)+M,t="";else{var S=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:b(Math.abs(t),m),v&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),S&&0===+t&&"+"!==h&&(S=!1),f=(S?"("===h?h:c:"-"===h||"("===h?"":h)+f,M=("s"===_?xn[8+sn/3]:"")+M+(S&&"("===h?")":""),w)for(i=-1,a=t.length;++i<a;)if(48>(l=t.charCodeAt(i))||l>57){M=(46===l?o+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var C=f.length+t.length+M.length,E=C<p?new Array(p-C+1).join(e):"";switch(g&&d&&(t=r(E+t,E.length?p-M.length:1/0),E=""),n){case"<":t=f+t+M+E;break;case"=":t=f+E+t+M;break;case"^":t=E.slice(0,C=E.length>>1)+f+t+M+E.slice(C);break;default:t=E+f+t+M}return s(t)}return m=void 0===m?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),M.toString=function(){return t+""},M}return{format:h,formatPrefix:function(t,e){var n=h(((t=cn(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(fn(e)/3))),i=Math.pow(10,-r),a=xn[8+r/3];return function(t){return n(i*t)+a}}}}function wn(t){return mn=bn(t),vn=mn.format,_n=mn.formatPrefix,mn}function Mn(t,e,n,r){var i,a=function(t,e,n){n=+n;const r=(e=+e)<(t=+t),i=r?Zt(e,t,n):Zt(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}(t,e,n);switch((r=cn(null==r?",f":r)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(fn(e)/3)))-fn(Math.abs(t)))}(a,o))||(r.precision=i),_n(r,o);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,fn(e)-fn(t))+1}(a,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-fn(Math.abs(t)))}(a))||(r.precision=i-2*("%"===r.type))}return vn(r)}function Sn(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)===(e=+e))return[t];const r=e<t,[i,a,o]=r?Jt(e,t,n):Jt(t,e,n);if(!(a>=i))return[];const s=a-i+1,l=new Array(s);if(r)if(o<0)for(let t=0;t<s;++t)l[t]=(a-t)/-o;else for(let t=0;t<s;++t)l[t]=(a-t)*o;else if(o<0)for(let t=0;t<s;++t)l[t]=(i+t)/-o;else for(let t=0;t<s;++t)l[t]=(i+t)*o;return l}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Mn(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,a=e(),o=0,s=a.length-1,l=a[o],c=a[s],u=10;for(c<l&&(i=l,l=c,c=i,i=o,o=s,s=i);u-- >0;){if((i=Zt(l,c,n))===r)return a[o]=l,a[s]=c,e(a);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return t},t}function Cn(){var t=on();return t.copy=function(){return rn(t,Cn())},Ht.apply(t,arguments),Sn(t)}function En(){var t,e=0,n=1,r=1,i=[.5],a=[0,1];function o(e){return null!=e&&e<=e?a[Ut(i,e,0,r)]:t}function s(){var t=-1;for(i=new Array(r);++t<r;)i[t]=((t+1)*n-(t-r)*e)/(r+1);return o}return o.domain=function(t){return arguments.length?([e,n]=t,e=+e,n=+n,s()):[e,n]},o.range=function(t){return arguments.length?(r=(a=Array.from(t)).length-1,s()):a.slice()},o.invertExtent=function(t){var o=a.indexOf(t);return o<0?[NaN,NaN]:o<1?[e,i[0]]:o>=r?[i[r-1],n]:[i[o-1],i[o]]},o.unknown=function(e){return arguments.length?(t=e,o):o},o.thresholds=function(){return i.slice()},o.copy=function(){return En().domain([e,n]).range(a).unknown(t)},Ht.apply(Sn(o),arguments)}function kn(){var t,e=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[Ut(e,i,0,r)]:t}return i.domain=function(t){return arguments.length?(e=Array.from(t),r=Math.min(e.length,n.length-1),i):e.slice()},i.range=function(t){return arguments.length?(n=Array.from(t),r=Math.min(e.length,n.length-1),i):n.slice()},i.invertExtent=function(t){var r=n.indexOf(t);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(t=e,i):t},i.copy=function(){return kn().domain(e).range(n).unknown(t)},Ht.apply(i,arguments)}function An(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}wn({thousands:",",grouping:[3],currency:["$",""]});const Tn=t=>Re(t[t.length-1]);const Pn=Tn(new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(An));const Fn=Math.PI/180,Ln=180/Math.PI,Nn=.96422,On=.82521,Dn=4/29,zn=6/29,In=3*zn*zn,Gn=zn*zn*zn;function jn(t){if(t instanceof Bn)return new Bn(t.l,t.a,t.b,t.opacity);if(t instanceof Yn)return $n(t);t instanceof be||(t=ye(t));var e,n,r=Hn(t.r),i=Hn(t.g),a=Hn(t.b),o=Wn((.2225045*r+.7168786*i+.0606169*a)/1);return r===i&&i===a?e=n=o:(e=Wn((.4360747*r+.3850649*i+.1430804*a)/Nn),n=Wn((.0139322*r+.0971045*i+.7141733*a)/On)),new Bn(116*o-16,500*(e-o),200*(o-n),t.opacity)}function Rn(t,e,n,r){return 1===arguments.length?jn(t):new Bn(t,e,n,null==r?1:r)}function Bn(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function Wn(t){return t>Gn?Math.pow(t,1/3):t/In+Dn}function qn(t){return t>zn?t*t*t:In*(t-Dn)}function Un(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Hn(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Vn(t){if(t instanceof Yn)return new Yn(t.h,t.c,t.l,t.opacity);if(t instanceof Bn||(t=jn(t)),0===t.a&&0===t.b)return new Yn(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Ln;return new Yn(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Yn(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function $n(t){if(isNaN(t.h))return new Bn(t.l,0,0,t.opacity);var e=t.h*Fn;return new Bn(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function Xn(t,e){var n=Ie((t=Rn(t)).l,(e=Rn(e)).l),r=Ie(t.a,e.a),i=Ie(t.b,e.b),a=Ie(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=a(e),t+""}}function Jn(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function Zn(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var a=t.apply(e,n);function o(t){Jn(a,r,i,o,s,"next",t)}function s(t){Jn(a,r,i,o,s,"throw",t)}o(void 0)})}}Kt(Bn,Rn,Qt(te,{brighter(t){return new Bn(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new Bn(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new be(Un(3.1338561*(e=Nn*qn(e))-1.6168667*(t=1*qn(t))-.4906146*(n=On*qn(n))),Un(-.9787684*e+1.9161415*t+.033454*n),Un(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),Kt(Yn,function(t,e,n,r){return 1===arguments.length?Vn(t):new Yn(t,e,n,null==r?1:r)},Qt(te,{brighter(t){return new Yn(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new Yn(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return $n(this).rgb()}}));var Kn=n(756),Qn=n.n(Kn),tr={value:()=>{}};function er(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new nr(r)}function nr(t){this._=t}function rr(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function ir(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=tr,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}nr.prototype=er.prototype={constructor:nr,on:function(t,e){var n,r,i=this._,a=(r=i,(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=a[o]).type)i[n]=ir(i[n],t.name,e);else if(null==e)for(n in i)i[n]=ir(i[n],t.name,null);return this}for(;++o<s;)if((n=(t=a[o]).type)&&(n=rr(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new nr(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(r=this._[t]).length;a<n;++a)r[a].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};const ar=er;var or,sr,lr=0,cr=0,ur=0,hr=0,fr=0,dr=0,pr="object"==typeof performance&&performance.now?performance:Date,gr="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function mr(){return fr||(gr(vr),fr=pr.now()+dr)}function vr(){fr=0}function _r(){this._call=this._time=this._next=null}function yr(t,e,n){var r=new _r;return r.restart(t,e,n),r}function xr(){fr=(hr=pr.now())+dr,lr=cr=0;try{!function(){mr(),++lr;for(var t,e=or;e;)(t=fr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--lr}()}finally{lr=0,function(){var t,e,n=or,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:or=e);sr=t,wr(r)}(),fr=0}}function br(){var t=pr.now(),e=t-hr;e>1e3&&(dr-=e,hr=t)}function wr(t){lr||(cr&&(cr=clearTimeout(cr)),t-fr>24?(t<1/0&&(cr=setTimeout(xr,t-pr.now()-dr)),ur&&(ur=clearInterval(ur))):(ur||(hr=pr.now(),ur=setInterval(br,1e3)),lr=1,gr(xr)))}function Mr(t,e,n){var r=new _r;return e=null==e?0:+e,r.restart(n=>{r.stop(),t(n+e)},e,n),r}_r.prototype=yr.prototype={constructor:_r,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?mr():+n)+(null==e?0:+e),this._next||sr===this||(sr?sr._next=this:or=this,sr=this),this._call=t,this._time=n,wr()},stop:function(){this._call&&(this._call=null,this._time=1/0,wr())}};var Sr=ar("start","end","cancel","interrupt"),Cr=[];function Er(t,e,n,r,i,a){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function a(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}function o(a){var c,u,h,f;if(1!==n.state)return l();for(c in i)if((f=i[c]).name===n.name){if(3===f.state)return Mr(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[c]):+c<e&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[c])}if(Mr(function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(h=n.tween.length),c=0,u=-1;c<h;++c)(f=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(r[++u]=f);r.length=u+1}}function s(e){for(var i=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(l),n.state=5,1),a=-1,o=r.length;++a<o;)r[a].call(t,i);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){for(var r in n.state=6,n.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=n,n.timer=yr(a,0,n.time)}(t,n,{name:e,index:r,group:i,on:Sr,tween:Cr,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function kr(t,e){var n=Tr(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function Ar(t,e){var n=Tr(t,e);if(n.state>3)throw new Error("too late; already running");return n}function Tr(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Pr(t,e){var n,r,i,a=t.__transition,o=!0;if(a){for(i in e=null==e?null:e+"",a)(n=a[i]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete a[i]):o=!1;o&&delete t.__transition}}var Fr,Lr=180/Math.PI,Nr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Or(t,e,n,r,i,a){var o,s,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),t*r<e*n&&(t=-t,e=-e,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*Lr,skewX:Math.atan(l)*Lr,scaleX:o,scaleY:s}}function Dr(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(a,o){var s=[],l=[];return a=t(a),o=t(o),function(t,r,i,a,o,s){if(t!==i||r!==a){var l=o.push("translate(",null,e,null,n);s.push({i:l-4,x:qe(t,i)},{i:l-2,x:qe(r,a)})}else(i||a)&&o.push("translate("+i+e+a+n)}(a.translateX,a.translateY,o.translateX,o.translateY,s,l),function(t,e,n,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:qe(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(a.rotate,o.rotate,s,l),function(t,e,n,a){t!==e?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:qe(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(a.skewX,o.skewX,s,l),function(t,e,n,r,a,o){if(t!==n||e!==r){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:qe(t,n)},{i:s-2,x:qe(e,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,n=-1,r=l.length;++n<r;)s[(e=l[n]).i]=e.x(t);return s.join("")}}}var zr=Dr(function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Nr:Or(e.a,e.b,e.c,e.d,e.e,e.f)},"px, ","px)","deg)"),Ir=Dr(function(t){return null==t?Nr:(Fr||(Fr=document.createElementNS("http://www.w3.org/2000/svg","g")),Fr.setAttribute("transform",t),(t=Fr.transform.baseVal.consolidate())?Or((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Nr)},", ",")",")");function Gr(t,e){var n,r;return function(){var i=Ar(this,t),a=i.tween;if(a!==n)for(var o=0,s=(r=n=a).length;o<s;++o)if(r[o].name===e){(r=r.slice()).splice(o,1);break}i.tween=r}}function jr(t,e,n){var r,i;if("function"!=typeof n)throw new Error;return function(){var a=Ar(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:e,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===e){i[l]=s;break}l===c&&i.push(s)}a.tween=i}}function Rr(t,e,n){var r=t._id;return t.each(function(){var t=Ar(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)}),function(t){return Tr(t,r).value[e]}}function Br(t,e){var n;return("number"==typeof e?qe:e instanceof me?Ge:(n=me(e))?(e=n,Ge):Ye)(t,e)}function Wr(t){return function(){this.removeAttribute(t)}}function qr(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ur(t,e,n){var r,i,a=n+"";return function(){var o=this.getAttribute(t);return o===a?null:o===r?i:i=e(r=o,n)}}function Hr(t,e,n){var r,i,a=n+"";return function(){var o=this.getAttributeNS(t.space,t.local);return o===a?null:o===r?i:i=e(r=o,n)}}function Vr(t,e,n){var r,i,a;return function(){var o,s,l=n(this);if(null!=l)return(o=this.getAttribute(t))===(s=l+"")?null:o===r&&s===i?a:(i=s,a=e(r=o,l));this.removeAttribute(t)}}function Yr(t,e,n){var r,i,a;return function(){var o,s,l=n(this);if(null!=l)return(o=this.getAttributeNS(t.space,t.local))===(s=l+"")?null:o===r&&s===i?a:(i=s,a=e(r=o,l));this.removeAttributeNS(t.space,t.local)}}function $r(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,i)),n}return i._value=e,i}function Xr(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,i)),n}return i._value=e,i}function Jr(t,e){return function(){kr(this,t).delay=+e.apply(this,arguments)}}function Zr(t,e){return e=+e,function(){kr(this,t).delay=e}}function Kr(t,e){return function(){Ar(this,t).duration=+e.apply(this,arguments)}}function Qr(t,e){return e=+e,function(){Ar(this,t).duration=e}}var ti=Lt.prototype.constructor;function ei(t){return function(){this.style.removeProperty(t)}}var ni=0;function ri(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function ii(){return++ni}var ai=Lt.prototype;ri.prototype=function(t){return Lt().transition(t)}.prototype={constructor:ri,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=b(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var s,l,c=r[o],u=c.length,h=a[o]=new Array(u),f=0;f<u;++f)(s=c[f])&&(l=t.call(s,s.__data__,f,c))&&("__data__"in s&&(l.__data__=s.__data__),h[f]=l,Er(h[f],e,n,f,h,Tr(s,n)));return new ri(a,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=S(t));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var l,c=r[s],u=c.length,h=0;h<u;++h)if(l=c[h]){for(var f,d=t.call(l,l.__data__,h,c),p=Tr(l,n),g=0,m=d.length;g<m;++g)(f=d[g])&&Er(f,e,n,g,d,p);a.push(d),o.push(l)}return new ri(a,o,e,n)},selectChild:ai.selectChild,selectChildren:ai.selectChildren,filter:function(t){"function"!=typeof t&&(t=C(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,o=e[i],s=o.length,l=r[i]=[],c=0;c<s;++c)(a=o[c])&&t.call(a,a.__data__,c,o)&&l.push(a);return new ri(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),s=0;s<a;++s)for(var l,c=e[s],u=n[s],h=c.length,f=o[s]=new Array(h),d=0;d<h;++d)(l=c[d]||u[d])&&(f[d]=l);for(;s<r;++s)o[s]=e[s];return new ri(o,this._parents,this._name,this._id)},selection:function(){return new ti(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=ii(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o,s=r[a],l=s.length,c=0;c<l;++c)if(o=s[c]){var u=Tr(o,e);Er(o,t,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new ri(r,this._parents,t,n)},call:ai.call,nodes:ai.nodes,node:ai.node,size:ai.size,empty:ai.empty,each:ai.each,on:function(t,e){var n=this._id;return arguments.length<2?Tr(this.node(),n).on.on(t):this.each(function(t,e,n){var r,i,a=function(t){return(t+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t})}(e)?kr:Ar;return function(){var o=a(this,t),s=o.on;s!==r&&(i=(r=s).copy()).on(e,n),o.on=i}}(n,t,e))},attr:function(t,e){var n=R(t),r="transform"===n?Ir:Br;return this.attrTween(t,"function"==typeof e?(n.local?Yr:Vr)(n,r,Rr(this,"attr."+t,e)):null==e?(n.local?qr:Wr)(n):(n.local?Hr:Ur)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=R(t);return this.tween(n,(r.local?$r:Xr)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?zr:Br;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var a=Z(this,t),o=(this.style.removeProperty(t),Z(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}(t,r)).on("end.style."+t,ei(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,a;return function(){var o=Z(this,t),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(t),l=s=Z(this,t)),o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,s))}}(t,r,Rr(this,"style."+t,e))).each(function(t,e){var n,r,i,a,o="style."+e,s="end."+o;return function(){var l=Ar(this,t),c=l.on,u=null==l.value[o]?a||(a=ei(e)):void 0;c===n&&i===u||(r=(n=c).copy()).on(s,i=u),l.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,a=n+"";return function(){var o=Z(this,t);return o===a?null:o===r?i:i=e(r=o,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,i;function a(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&function(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}(t,a,n)),r}return a._value=e,a}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Rr(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){return function(e){this.textContent=t.call(this,e)}}(r)),e}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=Tr(this.node(),n).tween,a=0,o=i.length;a<o;++a)if((r=i[a]).name===t)return r.value;return null}return this.each((null==e?Gr:jr)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Jr:Zr)(e,t)):Tr(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Kr:Qr)(e,t)):Tr(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){Ar(this,t).ease=e}}(e,t)):Tr(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;Ar(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},l={value:function(){0===--i&&a()}};n.each(function(){var n=Ar(this,r),i=n.on;i!==t&&((e=(t=i).copy())._.cancel.push(s),e._.interrupt.push(s),e._.end.push(l)),n.on=e}),0===i&&a()})},[Symbol.iterator]:ai[Symbol.iterator]};var oi={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function si(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}Lt.prototype.interrupt=function(t){return this.each(function(){Pr(this,t)})},Lt.prototype.transition=function(t){var e,n;t instanceof ri?(e=t._id,t=t._name):(e=ii(),(n=oi).time=mr(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o,s=r[a],l=s.length,c=0;c<l;++c)(o=s[c])&&Er(o,t,e,c,s,n||si(o,e));return new ri(r,this._parents,t,e)};const{abs:li,max:ci,min:ui}=Math;function hi(t){return[+t[0],+t[1]]}function fi(t){return[hi(t[0]),hi(t[1])]}["w","e"].map(di),["n","s"].map(di),["n","w","e","s","nw","ne","sw","se"].map(di);function di(t){return{type:t}}const pi={capture:!0,passive:!1};function gi(t){t.preventDefault(),t.stopImmediatePropagation()}function mi(t){return((t=Math.exp(t))+1/t)/2}const vi=function t(e,n,r){function i(t,i){var a,o,s=t[0],l=t[1],c=t[2],u=i[0],h=i[1],f=i[2],d=u-s,p=h-l,g=d*d+p*p;if(g<1e-12)o=Math.log(f/c)/e,a=function(t){return[s+t*d,l+t*p,c*Math.exp(e*t*o)]};else{var m=Math.sqrt(g),v=(f*f-c*c+r*g)/(2*c*n*m),_=(f*f-c*c-r*g)/(2*f*n*m),y=Math.log(Math.sqrt(v*v+1)-v),x=Math.log(Math.sqrt(_*_+1)-_);o=(x-y)/e,a=function(t){var r=t*o,i=mi(y),a=c/(n*m)*(i*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(e*r+y)-function(t){return((t=Math.exp(t))-1/t)/2}(y));return[s+a*d,l+a*p,c*i/mi(e*r+y)]}}return a.duration=1e3*o*e/Math.SQRT2,a}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4);function _i(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}const yi=t=>()=>t;function xi(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function bi(t,e,n){this.k=t,this.x=e,this.y=n}bi.prototype={constructor:bi,scale:function(t){return 1===t?this:new bi(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new bi(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var wi=new bi(1,0,0);function Mi(t){t.stopImmediatePropagation()}function Si(t){t.preventDefault(),t.stopImmediatePropagation()}function Ci(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Ei(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function ki(){return this.__zoom||wi}function Ai(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Ti(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pi(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],a=t.invertY(e[0][1])-n[0][1],o=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function Fi(){var t,e,n,r=Ci,i=Ei,a=Pi,o=Ai,s=Ti,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,h=vi,f=ar("start","zoom","end"),d=0,p=10;function g(t){t.property("__zoom",ki).on("wheel.zoom",w,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",S).filter(s).on("touchstart.zoom",C).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",k).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(t,e){return(e=Math.max(l[0],Math.min(l[1],e)))===t.k?t:new bi(e,t.x,t.y)}function v(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new bi(t.k,r,i)}function _(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function y(t,e,n,r){t.on("start.zoom",function(){x(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){x(this,arguments).event(r).end()}).tween("zoom",function(){var t=this,a=arguments,o=x(t,a).event(r),s=i.apply(t,a),l=null==n?_(s):"function"==typeof n?n.apply(t,a):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=t.__zoom,f="function"==typeof e?e.apply(t,a):e,d=h(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(t){if(1===t)t=f;else{var e=d(t),n=c/e[2];t=new bi(n,l[0]-e[0]*n,l[1]-e[1]*n)}o.zoom(null,t)}})}function x(t,e,n){return!n&&t.__zooming||new b(t,e)}function b(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,e),this.taps=0}function w(t,...e){if(r.apply(this,arguments)){var n=x(this,e).event(t),i=this.__zoom,s=Math.max(l[0],Math.min(l[1],i.k*Math.pow(2,o.apply(this,arguments)))),u=_i(t);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=i.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(i.k===s)return;n.mouse=[u,i.invert(u)],Pr(this),n.start()}Si(t),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",a(v(m(i,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function M(t,...e){if(!n&&r.apply(this,arguments)){var i=t.currentTarget,o=x(this,e,!0).event(t),s=Nt(t.view).on("mousemove.zoom",function(t){if(Si(t),!o.moved){var e=t.clientX-u,n=t.clientY-h;o.moved=e*e+n*n>d}o.event(t).zoom("mouse",a(v(o.that.__zoom,o.mouse[0]=_i(t,i),o.mouse[1]),o.extent,c))},!0).on("mouseup.zoom",function(t){s.on("mousemove.zoom mouseup.zoom",null),function(t,e){var n=t.document.documentElement,r=Nt(t).on("dragstart.drag",null);e&&(r.on("click.drag",gi,pi),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(t.view,o.moved),Si(t),o.event(t).end()},!0),l=_i(t,i),u=t.clientX,h=t.clientY;!function(t){var e=t.document.documentElement,n=Nt(t).on("dragstart.drag",gi,pi);"onselectstart"in e?n.on("selectstart.drag",gi,pi):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.view),Mi(t),o.mouse=[l,this.__zoom.invert(l)],Pr(this),o.start()}}function S(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,o=_i(t.changedTouches?t.changedTouches[0]:t,this),s=n.invert(o),l=n.k*(t.shiftKey?.5:2),h=a(v(m(n,l),o,s),i.apply(this,e),c);Si(t),u>0?Nt(this).transition().duration(u).call(y,h,o,t):Nt(this).call(g.transform,h,o,t)}}function C(n,...i){if(r.apply(this,arguments)){var a,o,s,l,c=n.touches,u=c.length,h=x(this,i,n.changedTouches.length===u).event(n);for(Mi(n),o=0;o<u;++o)l=[l=_i(s=c[o],this),this.__zoom.invert(l),s.identifier],h.touch0?h.touch1||h.touch0[2]===l[2]||(h.touch1=l,h.taps=0):(h.touch0=l,a=!0,h.taps=1+!!t);t&&(t=clearTimeout(t)),a&&(h.taps<2&&(e=l[0],t=setTimeout(function(){t=null},500)),Pr(this),h.start())}}function E(t,...e){if(this.__zooming){var n,r,i,o,s=x(this,e).event(t),l=t.changedTouches,u=l.length;for(Si(t),n=0;n<u;++n)i=_i(r=l[n],this),s.touch0&&s.touch0[2]===r.identifier?s.touch0[0]=i:s.touch1&&s.touch1[2]===r.identifier&&(s.touch1[0]=i);if(r=s.that.__zoom,s.touch1){var h=s.touch0[0],f=s.touch0[1],d=s.touch1[0],p=s.touch1[1],g=(g=d[0]-h[0])*g+(g=d[1]-h[1])*g,_=(_=p[0]-f[0])*_+(_=p[1]-f[1])*_;r=m(r,Math.sqrt(g/_)),i=[(h[0]+d[0])/2,(h[1]+d[1])/2],o=[(f[0]+p[0])/2,(f[1]+p[1])/2]}else{if(!s.touch0)return;i=s.touch0[0],o=s.touch0[1]}s.zoom("touch",a(v(r,i,o),s.extent,c))}}function k(t,...r){if(this.__zooming){var i,a,o=x(this,r).event(t),s=t.changedTouches,l=s.length;for(Mi(t),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),i=0;i<l;++i)a=s[i],o.touch0&&o.touch0[2]===a.identifier?delete o.touch0:o.touch1&&o.touch1[2]===a.identifier&&delete o.touch1;if(o.touch1&&!o.touch0&&(o.touch0=o.touch1,delete o.touch1),o.touch0)o.touch0[1]=this.__zoom.invert(o.touch0[0]);else if(o.end(),2===o.taps&&(a=_i(a,this),Math.hypot(e[0]-a[0],e[1]-a[1])<p)){var c=Nt(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return g.transform=function(t,e,n,r){var i=t.selection?t.selection():t;i.property("__zoom",ki),t!==i?y(t,e,n,r):i.interrupt().each(function(){x(this,arguments).event(r).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()})},g.scaleBy=function(t,e,n,r){g.scaleTo(t,function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)},n,r)},g.scaleTo=function(t,e,n,r){g.transform(t,function(){var t=i.apply(this,arguments),r=this.__zoom,o=null==n?_(t):"function"==typeof n?n.apply(this,arguments):n,s=r.invert(o),l="function"==typeof e?e.apply(this,arguments):e;return a(v(m(r,l),o,s),t,c)},n,r)},g.translateBy=function(t,e,n,r){g.transform(t,function(){return a(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),i.apply(this,arguments),c)},null,r)},g.translateTo=function(t,e,n,r,o){g.transform(t,function(){var t=i.apply(this,arguments),o=this.__zoom,s=null==r?_(t):"function"==typeof r?r.apply(this,arguments):r;return a(wi.translate(s[0],s[1]).scale(o.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,c)},r,o)},b.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1===++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0===--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var e=Nt(this.that).datum();f.call(t,this.that,new xi(t,{sourceEvent:this.sourceEvent,target:g,type:t,transform:this.that.__zoom,dispatch:f}),e)}},g.wheelDelta=function(t){return arguments.length?(o="function"==typeof t?t:yi(+t),g):o},g.filter=function(t){return arguments.length?(r="function"==typeof t?t:yi(!!t),g):r},g.touchable=function(t){return arguments.length?(s="function"==typeof t?t:yi(!!t),g):s},g.extent=function(t){return arguments.length?(i="function"==typeof t?t:yi([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),g):i},g.scaleExtent=function(t){return arguments.length?(l[0]=+t[0],l[1]=+t[1],g):[l[0],l[1]]},g.translateExtent=function(t){return arguments.length?(c[0][0]=+t[0][0],c[1][0]=+t[1][0],c[0][1]=+t[0][1],c[1][1]=+t[1][1],g):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},g.constrain=function(t){return arguments.length?(a=t,g):a},g.duration=function(t){return arguments.length?(u=+t,g):u},g.interpolate=function(t){return arguments.length?(h=t,g):h},g.on=function(){var t=f.on.apply(f,arguments);return t===f?g:t},g.clickDistance=function(t){return arguments.length?(d=(t=+t)*t,g):Math.sqrt(d)},g.tapDistance=function(t){return arguments.length?(p=+t,g):p},g}function Li(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ni(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ni(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Ni(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Oi(t,e){var n=t.select("g.".concat(e));return n.empty()?n=t.append("g").attr("class",e):n.selectAll("*").remove(),n}function Di(t,e,n){if(!t.startsWith(".")&&!t.startsWith("#"))throw new Error('Invalid selector: Must start with "." for classes or "#" for IDs.');for(var r=0,i=Array.from(document.styleSheets);r<i.length;r++){var a=i[r];try{var o,s=Li(a.cssRules||a.rules);try{for(s.s();!(o=s.n()).done;){var l=o.value;if(l.selectorText===t)return void(l.style[e]=n)}}catch(t){s.e(t)}finally{s.f()}}catch(t){}}var c=document.getElementById("custom-styles");c||((c=document.createElement("style")).id="custom-styles",document.head.appendChild(c));try{c.sheet.insertRule("".concat(t," { ").concat(e,": ").concat(n,"; }"),c.sheet.cssRules.length)}catch(r){console.error("Failed to insert rule: ".concat(t," { ").concat(e,": ").concat(n,"; }"),r)}}bi.prototype;var zi=function(t){var e=document.createElement("div");e.className=t,e.style.position="absolute",e.style.visibility="hidden",e.style.height="auto",e.style.width="auto",e.style.lineHeight="normal",e.style.fontSize="initial",document.body.appendChild(e);var n=parseFloat(window.getComputedStyle(e).fontSize);return document.body.removeChild(e),n||0},Ii=function(t,e){var n=document.createElement("div");n.className=t,n.style.position="absolute",n.style.visibility="hidden",n.style.height="auto",n.style.lineHeight="normal",document.body.appendChild(n);var r=window.getComputedStyle(n).getPropertyValue(e);return document.body.removeChild(n),r||null};function Gi(t){if(t&&t instanceof SVGElement){var e=new Set(["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset"]),n=[].concat(y(Array.from(e)),["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"]);r(t),t.querySelectorAll("*").forEach(function(t){return r(t)})}function r(t){var r=window.getComputedStyle(t);if(n.forEach(function(n){try{var i=r.getPropertyValue(n);if(!i||""===i||"initial"===i)return;if("none"===i&&!e.has(n))return;if("0px"===i&&"stroke-width"!==n)return;t.style.getPropertyValue(n)||t.style.setProperty(n,i)}catch(t){}}),t.tagName&&"text"===t.tagName.toLowerCase()){var i=r.getPropertyValue("font-size");i&&!t.style.getPropertyValue("font-size")&&t.style.setProperty("font-size",i)}}}function ji(t){var e=t.getBoundingClientRect(),n=Math.round(e.width)||parseInt(t.getAttribute("width"))||800,r=Math.round(e.height)||parseInt(t.getAttribute("height"))||600;t.hasAttribute("viewBox")||t.setAttribute("viewBox","0 0 ".concat(n," ").concat(r)),t.setAttribute("width",n),t.setAttribute("height",r)}var Ri=function(t){return t.toLocaleString("en").replace(/,/gi," ")};function Bi(t){return"".concat(t,"-").concat(Math.random().toString(36).substr(2,9))}var Wi=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;for(var a in t){var o=t[a];Array.isArray(o)?o.forEach(function(t){Array.isArray(t)?t.forEach(function(t){t.svgId_!==e&&n(t,r,i)}):t.svgId_!==e&&n(t,r,i)}):o.svgId_!==e&&n(o,r,i)}};function qi(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(location.search);return e?decodeURIComponent(e[1].replace(/\+/g," ")):null}var Ui=function(t){var e,n,r;if(!t.startsWith("rgb")&&!t.startsWith("#")){var i=document.createElement("div");i.style.color=t,document.body.appendChild(i);var a=window.getComputedStyle(i).color;document.body.removeChild(i),t=a}if(t.startsWith("#")){var o=t.replace("#","");3===o.length&&(o=o.split("").map(function(t){return t+t}).join("")),e=parseInt(o.substring(0,2),16),n=parseInt(o.substring(2,4),16),r=parseInt(o.substring(4,6),16)}else{var s=t.match(/\d+/g);e=parseInt(s[0]),n=parseInt(s[1]),r=parseInt(s[2])}return e/255*.2126+n/255*.7152+r/255*.0722>.5?"black":"white"},Hi=function(t){return t.Geometries.userGeometries?"#em-user-regions path":t.gridCartogram_?"#em-grid-container .em-grid-cell":"WORLD"===t.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)"},Vi=function(t){return t.Geometries.userGeometries?"#em-user-regions":t.gridCartogram_?"#em-grid-container":"WORLD"===t.geo_?"#em-worldrg":"#em-nutsrg, #em-cntrg"},Yi=function(t){var e=.5*t.position_.z*t.width_,n=.5*t.position_.z*t.height_;return[t.position_.x-e,t.position_.y-n,t.position_.x+e,t.position_.y+n]};function $i(t){return $i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$i(t)}function Xi(t){var e=function(t,e){if("object"!=$i(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=$i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==$i(e)?e:e+""}function Ji(t,e,n){return(e=Xi(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zi(t){return"string"==typeof t?new Pt([document.querySelectorAll(t)],[document.documentElement]):new Pt([w(t)],Tt)}class Ki{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const i=e[r],a=t+i,o=Math.abs(t)<Math.abs(i)?t-(a-i):i-(a-t);o&&(e[n++]=o),t=a}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,i=this._n,a=0;if(i>0){for(a=t[--i];i>0&&(e=a,n=t[--i],a=e+n,r=n-(a-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=a+n,n==e-a&&(a=e))}return a}}var Qi=1e-6,ta=1e-12,ea=Math.PI,na=ea/2,ra=ea/4,ia=2*ea,aa=180/ea,oa=ea/180,sa=Math.abs,la=Math.atan,ca=Math.atan2,ua=Math.cos,ha=Math.ceil,fa=(Math.exp,Math.floor,Math.hypot),da=(Math.log,Math.pow,Math.sin),pa=Math.sign||function(t){return t>0?1:t<0?-1:0},ga=Math.sqrt;Math.tan;function ma(t){return t>1?na:t<-1?-na:Math.asin(t)}function va(){}function _a(t,e){t&&za.hasOwnProperty(t.type)&&za[t.type](t,e)}var ya,xa,ba,wa,Ma,Sa,Ca,Ea,ka,Aa,Ta,Pa,Fa,La,Na,Oa,Da={Feature:function(t,e){_a(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)_a(n[r].geometry,e)}},za={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Ia(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Ia(n[r],e,0)},Polygon:function(t,e){Ga(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Ga(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)_a(n[r],e)}};function Ia(t,e,n){var r,i=-1,a=t.length-n;for(e.lineStart();++i<a;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function Ga(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Ia(t[n],e,1);e.polygonEnd()}function ja(t,e){t&&Da.hasOwnProperty(t.type)?Da[t.type](t,e):_a(t,e)}var Ra={sphere:va,point:Ba,lineStart:qa,lineEnd:Va,polygonStart:function(){Ra.lineStart=Ya,Ra.lineEnd=$a},polygonEnd:function(){Ra.lineStart=qa,Ra.lineEnd=Va}};function Ba(t,e){t*=oa;var n=ua(e*=oa);Wa(n*ua(t),n*da(t),da(e))}function Wa(t,e,n){++ya,ba+=(t-ba)/ya,wa+=(e-wa)/ya,Ma+=(n-Ma)/ya}function qa(){Ra.point=Ua}function Ua(t,e){t*=oa;var n=ua(e*=oa);La=n*ua(t),Na=n*da(t),Oa=da(e),Ra.point=Ha,Wa(La,Na,Oa)}function Ha(t,e){t*=oa;var n=ua(e*=oa),r=n*ua(t),i=n*da(t),a=da(e),o=ca(ga((o=Na*a-Oa*i)*o+(o=Oa*r-La*a)*o+(o=La*i-Na*r)*o),La*r+Na*i+Oa*a);xa+=o,Sa+=o*(La+(La=r)),Ca+=o*(Na+(Na=i)),Ea+=o*(Oa+(Oa=a)),Wa(La,Na,Oa)}function Va(){Ra.point=Ba}function Ya(){Ra.point=Xa}function $a(){Ja(Pa,Fa),Ra.point=Ba}function Xa(t,e){Pa=t,Fa=e,t*=oa,e*=oa,Ra.point=Ja;var n=ua(e);La=n*ua(t),Na=n*da(t),Oa=da(e),Wa(La,Na,Oa)}function Ja(t,e){t*=oa;var n=ua(e*=oa),r=n*ua(t),i=n*da(t),a=da(e),o=Na*a-Oa*i,s=Oa*r-La*a,l=La*i-Na*r,c=fa(o,s,l),u=ma(c),h=c&&-u/c;ka.add(h*o),Aa.add(h*s),Ta.add(h*l),xa+=u,Sa+=u*(La+(La=r)),Ca+=u*(Na+(Na=i)),Ea+=u*(Oa+(Oa=a)),Wa(La,Na,Oa)}function Za(t){ya=xa=ba=wa=Ma=Sa=Ca=Ea=0,ka=new Ki,Aa=new Ki,Ta=new Ki,ja(t,Ra);var e=+ka,n=+Aa,r=+Ta,i=fa(e,n,r);return i<ta&&(e=Sa,n=Ca,r=Ea,xa<Qi&&(e=ba,n=wa,r=Ma),(i=fa(e,n,r))<ta)?[NaN,NaN]:[ca(n,e)*aa,ma(r/i)*aa]}function Ka(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:va,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Qa(t,e){return sa(t[0]-e[0])<Qi&&sa(t[1]-e[1])<Qi}function to(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function eo(t,e,n,r,i){var a,o,s=[],l=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],o=t[e];if(Qa(r,o)){if(!r[2]&&!o[2]){for(i.lineStart(),a=0;a<e;++a)i.point((r=t[a])[0],r[1]);return void i.lineEnd()}o[0]+=2e-6}s.push(n=new to(r,t,null,!0)),l.push(n.o=new to(r,null,n,!1)),s.push(n=new to(o,t,null,!1)),l.push(n.o=new to(o,null,n,!0))}}),s.length){for(l.sort(e),no(s),no(l),a=0,o=l.length;a<o;++a)l[a].e=n=!n;for(var c,u,h=s[0];;){for(var f=h,d=!0;f.v;)if((f=f.n)===h)return;c=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(d)for(a=0,o=c.length;a<o;++a)i.point((u=c[a])[0],u[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(d)for(c=f.p.z,a=c.length-1;a>=0;--a)i.point((u=c[a])[0],u[1]);else r(f.x,f.p.x,-1,i);f=f.p}c=(f=f.o).z,d=!d}while(!f.v);i.lineEnd()}}}function no(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function ro(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}var io=1e9,ao=-io;function oo(t,e,n,r){function i(i,a){return t<=i&&i<=n&&e<=a&&a<=r}function a(i,a,s,c){var u=0,h=0;if(null==i||(u=o(i,s))!==(h=o(a,s))||l(i,a)<0^s>0)do{c.point(0===u||3===u?t:n,u>1?r:e)}while((u=(u+s+4)%4)!==h);else c.point(a[0],a[1])}function o(r,i){return sa(r[0]-t)<Qi?i>0?0:3:sa(r[0]-n)<Qi?i>0?2:1:sa(r[1]-e)<Qi?i>0?1:0:i>0?3:2}function s(t,e){return l(t.x,e.x)}function l(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var l,c,u,h,f,d,p,g,m,v,_,y=o,x=Ka(),b={point:w,lineStart:function(){b.point=M,c&&c.push(u=[]);v=!0,m=!1,p=g=NaN},lineEnd:function(){l&&(M(h,f),d&&m&&x.rejoin(),l.push(x.result()));b.point=w,m&&y.lineEnd()},polygonStart:function(){y=x,l=[],c=[],_=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=c.length;n<i;++n)for(var a,o,s=c[n],l=1,u=s.length,h=s[0],f=h[0],d=h[1];l<u;++l)a=f,o=d,f=(h=s[l])[0],d=h[1],o<=r?d>r&&(f-a)*(r-o)>(d-o)*(t-a)&&++e:d<=r&&(f-a)*(r-o)<(d-o)*(t-a)&&--e;return e}(),n=_&&e,i=(l=ro(l)).length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),i&&eo(l,s,e,a,o),o.polygonEnd());y=o,l=c=u=null}};function w(t,e){i(t,e)&&y.point(t,e)}function M(a,o){var s=i(a,o);if(c&&u.push([a,o]),v)h=a,f=o,d=s,v=!1,s&&(y.lineStart(),y.point(a,o));else if(s&&m)y.point(a,o);else{var l=[p=Math.max(ao,Math.min(io,p)),g=Math.max(ao,Math.min(io,g))],x=[a=Math.max(ao,Math.min(io,a)),o=Math.max(ao,Math.min(io,o))];!function(t,e,n,r,i,a){var o,s=t[0],l=t[1],c=0,u=1,h=e[0]-s,f=e[1]-l;if(o=n-s,h||!(o>0)){if(o/=h,h<0){if(o<c)return;o<u&&(u=o)}else if(h>0){if(o>u)return;o>c&&(c=o)}if(o=i-s,h||!(o<0)){if(o/=h,h<0){if(o>u)return;o>c&&(c=o)}else if(h>0){if(o<c)return;o<u&&(u=o)}if(o=r-l,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<u&&(u=o)}else if(f>0){if(o>u)return;o>c&&(c=o)}if(o=a-l,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<u&&(u=o)}return c>0&&(t[0]=s+c*h,t[1]=l+c*f),u<1&&(e[0]=s+u*h,e[1]=l+u*f),!0}}}}}(l,x,t,e,n,r)?s&&(y.lineStart(),y.point(a,o),_=!1):(m||(y.lineStart(),y.point(l[0],l[1])),y.point(x[0],x[1]),s||y.lineEnd(),_=!1)}p=a,g=o,m=s}return b}}const so=t=>t;function lo(t){return function(e){var n=new co;for(var r in t)n[r]=t[r];return n.stream=e,n}}function co(){}co.prototype={constructor:co,point:function(t,e){this.stream.point(t,e)},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 uo=1/0,ho=uo,fo=-uo,po=fo,go={point:function(t,e){t<uo&&(uo=t);t>fo&&(fo=t);e<ho&&(ho=e);e>po&&(po=e)},lineStart:va,lineEnd:va,polygonStart:va,polygonEnd:va,result:function(){var t=[[uo,ho],[fo,po]];return fo=po=-(ho=uo=1/0),t}};const mo=go;function vo(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),ja(n,t.stream(mo)),e(mo.result()),null!=r&&t.clipExtent(r),t}function _o(t,e,n){return vo(t,function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),o=+e[0][0]+(r-a*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-a*(n[1][1]+n[0][1]))/2;t.scale(150*a).translate([o,s])},n)}function yo(t,e,n){return _o(t,[[0,0],e],n)}function xo(t,e,n){return vo(t,function(n){var r=+e,i=r/(n[1][0]-n[0][0]),a=(r-i*(n[1][0]+n[0][0]))/2,o=-i*n[0][1];t.scale(150*i).translate([a,o])},n)}function bo(t,e,n){return vo(t,function(n){var r=+e,i=r/(n[1][1]-n[0][1]),a=-i*n[0][0],o=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([a,o])},n)}var wo,Mo,So,Co,Eo=new Ki,ko=new Ki,Ao={point:va,lineStart:va,lineEnd:va,polygonStart:function(){Ao.lineStart=To,Ao.lineEnd=Lo},polygonEnd:function(){Ao.lineStart=Ao.lineEnd=Ao.point=va,Eo.add(sa(ko)),ko=new Ki},result:function(){var t=Eo/2;return Eo=new Ki,t}};function To(){Ao.point=Po}function Po(t,e){Ao.point=Fo,wo=So=t,Mo=Co=e}function Fo(t,e){ko.add(Co*t-So*e),So=t,Co=e}function Lo(){Fo(wo,Mo)}const No=Ao;var Oo,Do,zo,Io,Go=0,jo=0,Ro=0,Bo=0,Wo=0,qo=0,Uo=0,Ho=0,Vo=0,Yo={point:$o,lineStart:Xo,lineEnd:Ko,polygonStart:function(){Yo.lineStart=Qo,Yo.lineEnd=ts},polygonEnd:function(){Yo.point=$o,Yo.lineStart=Xo,Yo.lineEnd=Ko},result:function(){var t=Vo?[Uo/Vo,Ho/Vo]:qo?[Bo/qo,Wo/qo]:Ro?[Go/Ro,jo/Ro]:[NaN,NaN];return Go=jo=Ro=Bo=Wo=qo=Uo=Ho=Vo=0,t}};function $o(t,e){Go+=t,jo+=e,++Ro}function Xo(){Yo.point=Jo}function Jo(t,e){Yo.point=Zo,$o(zo=t,Io=e)}function Zo(t,e){var n=t-zo,r=e-Io,i=ga(n*n+r*r);Bo+=i*(zo+t)/2,Wo+=i*(Io+e)/2,qo+=i,$o(zo=t,Io=e)}function Ko(){Yo.point=$o}function Qo(){Yo.point=es}function ts(){ns(Oo,Do)}function es(t,e){Yo.point=ns,$o(Oo=zo=t,Do=Io=e)}function ns(t,e){var n=t-zo,r=e-Io,i=ga(n*n+r*r);Bo+=i*(zo+t)/2,Wo+=i*(Io+e)/2,qo+=i,Uo+=(i=Io*t-zo*e)*(zo+t),Ho+=i*(Io+e),Vo+=3*i,$o(zo=t,Io=e)}const rs=Yo;function is(t){this._context=t}is.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,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(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,ia)}},result:va};var as,os,ss,ls,cs,us=new Ki,hs={point:va,lineStart:function(){hs.point=fs},lineEnd:function(){as&&ds(os,ss),hs.point=va},polygonStart:function(){as=!0},polygonEnd:function(){as=null},result:function(){var t=+us;return us=new Ki,t}};function fs(t,e){hs.point=ds,os=ls=t,ss=cs=e}function ds(t,e){ls-=t,cs-=e,us.add(ga(ls*ls+cs*cs)),ls=t,cs=e}const ps=hs;let gs,ms,vs,_s;class ys{constructor(t){this._append=null==t?xs:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return xs;if(e!==gs){const t=10**e;gs=e,ms=function(e){let n=1;this._+=e[0];for(const r=e.length;n<r;++n)this._+=Math.round(arguments[n]*t)/t+e[n]}}return ms}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:this._append`M${t},${e}`,this._point=1;break;case 1:this._append`L${t},${e}`;break;default:if(this._append`M${t},${e}`,this._radius!==vs||this._append!==ms){const t=this._radius,e=this._;this._="",this._append`m0,${t}a${t},${t} 0 1,1 0,${-2*t}a${t},${t} 0 1,1 0,${2*t}z`,vs=t,ms=this._append,_s=this._,this._=e}this._+=_s}}result(){const t=this._;return this._="",t.length?t:null}}function xs(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function bs(t,e){let n,r,i=3,a=4.5;function o(t){return t&&("function"==typeof a&&r.pointRadius(+a.apply(this,arguments)),ja(t,n(r))),r.result()}return o.area=function(t){return ja(t,n(No)),No.result()},o.measure=function(t){return ja(t,n(ps)),ps.result()},o.bounds=function(t){return ja(t,n(mo)),mo.result()},o.centroid=function(t){return ja(t,n(rs)),rs.result()},o.projection=function(e){return arguments.length?(n=null==e?(t=null,so):(t=e).stream,o):t},o.context=function(t){return arguments.length?(r=null==t?(e=null,new ys(i)):new is(e=t),"function"!=typeof a&&r.pointRadius(a),o):e},o.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(r.pointRadius(+t),+t),o):a},o.digits=function(t){if(!arguments.length)return i;if(null==t)i=null;else{const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);i=e}return null===e&&(r=new ys(i)),o},o.projection(t).digits(i).context(e)}function ws(){}function Ms(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:ws,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}var Ss=1e-6,Cs=Math.PI,Es=Cs/2,ks=Cs/4,As=2*Cs,Ts=180/Cs,Ps=Cs/180,Fs=Math.abs,Ls=Math.atan,Ns=Math.atan2,Os=Math.cos,Ds=(Math.ceil,Math.exp,Math.floor,Math.hypot,Math.log,Math.pow,Math.sin),zs=Math.sign||function(t){return t>0?1:t<0?-1:0},Is=Math.sqrt;Math.tan;function Gs(t){return t>1?Es:t<-1?-Es:Math.asin(t)}function js(t,e){return Fs(t[0]-e[0])<Ss&&Fs(t[1]-e[1])<Ss}function Rs(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Bs(t,e,n,r,i){var a,o,s=[],l=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],o=t[e];if(js(r,o)){if(!r[2]&&!o[2]){for(i.lineStart(),a=0;a<e;++a)i.point((r=t[a])[0],r[1]);return void i.lineEnd()}o[0]+=2e-6}s.push(n=new Rs(r,t,null,!0)),l.push(n.o=new Rs(r,null,n,!1)),s.push(n=new Rs(o,t,null,!1)),l.push(n.o=new Rs(o,null,n,!0))}}),s.length){for(l.sort(e),Ws(s),Ws(l),a=0,o=l.length;a<o;++a)l[a].e=n=!n;for(var c,u,h=s[0];;){for(var f=h,d=!0;f.v;)if((f=f.n)===h)return;c=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(d)for(a=0,o=c.length;a<o;++a)i.point((u=c[a])[0],u[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(d)for(c=f.p.z,a=c.length-1;a>=0;--a)i.point((u=c[a])[0],u[1]);else r(f.x,f.p.x,-1,i);f=f.p}c=(f=f.o).z,d=!d}while(!f.v);i.lineEnd()}}}function Ws(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}class qs{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const i=e[r],a=t+i,o=Math.abs(t)<Math.abs(i)?t-(a-i):i-(a-t);o&&(e[n++]=o),t=a}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,i=this._n,a=0;if(i>0){for(a=t[--i];i>0&&(e=a,n=t[--i],a=e+n,r=n-(a-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=a+n,n==e-a&&(a=e))}return a}}function Us(t){return[Ns(t[1],t[0]),Gs(t[2])]}function Hs(t){var e=t[0],n=t[1],r=Os(n);return[r*Os(e),r*Ds(e),Ds(n)]}function Vs(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ys(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function $s(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Xs(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Js(t){var e=Is(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Zs(t){return Fs(t[0])<=Cs?t[0]:zs(t[0])*((Fs(t[0])+Cs)%As-Cs)}function Ks(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function Qs(t,e,n,r){return function(i){var a,o,s,l=e(i),c=Ms(),u=e(c),h=!1,f={point:d,lineStart:g,lineEnd:m,polygonStart:function(){f.point=v,f.lineStart=_,f.lineEnd=y,o=[],a=[]},polygonEnd:function(){f.point=d,f.lineStart=g,f.lineEnd=m,o=Ks(o);var t=function(t,e){var n=Zs(e),r=e[1],i=Ds(r),a=[Ds(n),-Os(n),0],o=0,s=0,l=new qs;1===i?r=Es+Ss:-1===i&&(r=-Es-Ss);for(var c=0,u=t.length;c<u;++c)if(f=(h=t[c]).length)for(var h,f,d=h[f-1],p=Zs(d),g=d[1]/2+ks,m=Ds(g),v=Os(g),_=0;_<f;++_,p=x,m=w,v=M,d=y){var y=h[_],x=Zs(y),b=y[1]/2+ks,w=Ds(b),M=Os(b),S=x-p,C=S>=0?1:-1,E=C*S,k=E>Cs,A=m*w;if(l.add(Ns(A*C*Ds(E),v*M+A*Os(E))),o+=k?S+C*As:S,k^p>=n^x>=n){var T=Ys(Hs(d),Hs(y));Js(T);var P=Ys(a,T);Js(P);var F=(k^S>=0?-1:1)*Gs(P[2]);(r>F||r===F&&(T[0]||T[1]))&&(s+=k^S>=0?1:-1)}}return(o<-1e-6||o<Ss&&l<-1e-12)^1&s}(a,r);o.length?(h||(i.polygonStart(),h=!0),Bs(o,el,t,n,i)):t&&(h||(i.polygonStart(),h=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),h&&(i.polygonEnd(),h=!1),o=a=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(e,n){t(e,n)&&i.point(e,n)}function p(t,e){l.point(t,e)}function g(){f.point=p,l.lineStart()}function m(){f.point=d,l.lineEnd()}function v(t,e){s.push([t,e]),u.point(t,e)}function _(){u.lineStart(),s=[]}function y(){v(s[0][0],s[0][1]),u.lineEnd();var t,e,n,r,l=u.clean(),f=c.result(),d=f.length;if(s.pop(),a.push(s),s=null,d)if(1&l){if((e=(n=f[0]).length-1)>0){for(h||(i.polygonStart(),h=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else d>1&&2&l&&f.push(f.pop().concat(f.shift())),o.push(f.filter(tl))}return f}}function tl(t){return t.length>1}function el(t,e){return((t=t.x)[0]<0?t[1]-Es-Ss:Es-t[1])-((e=e.x)[0]<0?e[1]-Es-Ss:Es-e[1])}const nl=Qs(function(){return!0},function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?Cs:-Cs,l=Fs(a-n);Fs(l-Cs)<Ss?(t.point(n,r=(r+o)/2>0?Es:-Es),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(a,r),e=0):i!==s&&l>=Cs&&(Fs(n-i)<Ss&&(n-=i*Ss),Fs(a-s)<Ss&&(a-=s*Ss),r=function(t,e,n,r){var i,a,o=Ds(t-n);return Fs(o)>Ss?Ls((Ds(e)*(a=Os(r))*Ds(n)-Ds(r)*(i=Os(e))*Ds(t))/(i*a*o)):(e+r)/2}(n,r,a,o),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=a,r=o),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var i;if(null==t)i=n*Es,r.point(-Cs,i),r.point(0,i),r.point(Cs,i),r.point(Cs,0),r.point(Cs,-i),r.point(0,-i),r.point(-Cs,-i),r.point(-Cs,0),r.point(-Cs,i);else if(Fs(t[0]-e[0])>Ss){var a=t[0]<e[0]?Cs:-Cs;i=n*a/2,r.point(-a,i),r.point(0,i),r.point(a,i)}else r.point(e[0],e[1])},[-Cs,-Es]);function rl(t,e,n,r,i,a){if(n){var o=Os(e),s=Ds(e),l=r*n;null==i?(i=e+r*As,a=e-l/2):(i=il(o,i),a=il(o,a),(r>0?i<a:i>a)&&(i+=r*As));for(var c,u=i;r>0?u>a:u<a;u-=l)c=Us([o,-s*Os(u),-s*Ds(u)]),t.point(c[0],c[1])}}function il(t,e){(e=Hs(e))[0]-=t,Js(e);var n=function(t){return t>1?0:t<-1?Cs:Math.acos(t)}(-e[1]);return((-e[2]<0?-n:n)+As-Ss)%As}var al=1e9,ol=-1e9;function sl(t,e,n,r){function i(i,a){return t<=i&&i<=n&&e<=a&&a<=r}function a(i,a,s,c){var u=0,h=0;if(null==i||(u=o(i,s))!==(h=o(a,s))||l(i,a)<0^s>0)do{c.point(0===u||3===u?t:n,u>1?r:e)}while((u=(u+s+4)%4)!==h);else c.point(a[0],a[1])}function o(r,i){return Fs(r[0]-t)<Ss?i>0?0:3:Fs(r[0]-n)<Ss?i>0?2:1:Fs(r[1]-e)<Ss?i>0?1:0:i>0?3:2}function s(t,e){return l(t.x,e.x)}function l(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var l,c,u,h,f,d,p,g,m,v,_,y=o,x=Ms(),b={point:w,lineStart:function(){b.point=M,c&&c.push(u=[]);v=!0,m=!1,p=g=NaN},lineEnd:function(){l&&(M(h,f),d&&m&&x.rejoin(),l.push(x.result()));b.point=w,m&&y.lineEnd()},polygonStart:function(){y=x,l=[],c=[],_=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=c.length;n<i;++n)for(var a,o,s=c[n],l=1,u=s.length,h=s[0],f=h[0],d=h[1];l<u;++l)a=f,o=d,f=(h=s[l])[0],d=h[1],o<=r?d>r&&(f-a)*(r-o)>(d-o)*(t-a)&&++e:d<=r&&(f-a)*(r-o)<(d-o)*(t-a)&&--e;return e}(),n=_&&e,i=(l=Ks(l)).length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),i&&Bs(l,s,e,a,o),o.polygonEnd());y=o,l=c=u=null}};function w(t,e){i(t,e)&&y.point(t,e)}function M(a,o){var s=i(a,o);if(c&&u.push([a,o]),v)h=a,f=o,d=s,v=!1,s&&(y.lineStart(),y.point(a,o));else if(s&&m)y.point(a,o);else{var l=[p=Math.max(ol,Math.min(al,p)),g=Math.max(ol,Math.min(al,g))],x=[a=Math.max(ol,Math.min(al,a)),o=Math.max(ol,Math.min(al,o))];!function(t,e,n,r,i,a){var o,s=t[0],l=t[1],c=0,u=1,h=e[0]-s,f=e[1]-l;if(o=n-s,h||!(o>0)){if(o/=h,h<0){if(o<c)return;o<u&&(u=o)}else if(h>0){if(o>u)return;o>c&&(c=o)}if(o=i-s,h||!(o<0)){if(o/=h,h<0){if(o>u)return;o>c&&(c=o)}else if(h>0){if(o<c)return;o<u&&(u=o)}if(o=r-l,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<u&&(u=o)}else if(f>0){if(o>u)return;o>c&&(c=o)}if(o=a-l,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<u&&(u=o)}return c>0&&(t[0]=s+c*h,t[1]=l+c*f),u<1&&(e[0]=s+u*h,e[1]=l+u*f),!0}}}}}(l,x,t,e,n,r)?s&&(y.lineStart(),y.point(a,o),_=!1):(m||(y.lineStart(),y.point(l[0],l[1])),y.point(x[0],x[1]),s||y.lineEnd(),_=!1)}p=a,g=o,m=s}return b}}function ll(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}const cl=t=>t;function ul(t,e){return[Fs(t)>Cs?t+Math.round(-t/As)*As:t,e]}function hl(t,e,n){return(t%=As)?e||n?ll(dl(t),pl(e,n)):dl(t):e||n?pl(e,n):ul}function fl(t){return function(e,n){return[(e+=t)>Cs?e-As:e<-Cs?e+As:e,n]}}function dl(t){var e=fl(t);return e.invert=fl(-t),e}function pl(t,e){var n=Os(t),r=Ds(t),i=Os(e),a=Ds(e);function o(t,e){var o=Os(e),s=Os(t)*o,l=Ds(t)*o,c=Ds(e),u=c*n+s*r;return[Ns(l*i-u*a,s*n-c*r),Gs(u*i+l*a)]}return o.invert=function(t,e){var o=Os(e),s=Os(t)*o,l=Ds(t)*o,c=Ds(e),u=c*i-l*a;return[Ns(l*i+c*a,s*n+u*r),Gs(u*n-s*r)]},o}function gl(t){return function(e){var n=new ml;for(var r in t)n[r]=t[r];return n.stream=e,n}}function ml(){}function vl(t,e){t&&yl.hasOwnProperty(t.type)&&yl[t.type](t,e)}ul.invert=ul,ml.prototype={constructor:ml,point:function(t,e){this.stream.point(t,e)},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 _l={Feature:function(t,e){vl(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)vl(n[r].geometry,e)}},yl={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){xl(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)xl(n[r],e,0)},Polygon:function(t,e){bl(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)bl(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)vl(n[r],e)}};function xl(t,e,n){var r,i=-1,a=t.length-n;for(e.lineStart();++i<a;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function bl(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)xl(t[n],e,1);e.polygonEnd()}var wl=1/0,Ml=wl,Sl=-wl,Cl=Sl,El={point:function(t,e){t<wl&&(wl=t);t>Sl&&(Sl=t);e<Ml&&(Ml=e);e>Cl&&(Cl=e)},lineStart:ws,lineEnd:ws,polygonStart:ws,polygonEnd:ws,result:function(){var t=[[wl,Ml],[Sl,Cl]];return Sl=Cl=-(Ml=wl=1/0),t}};const kl=El;function Al(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),function(t,e){t&&_l.hasOwnProperty(t.type)?_l[t.type](t,e):vl(t,e)}(n,t.stream(kl)),e(kl.result()),null!=r&&t.clipExtent(r),t}function Tl(t,e,n){return Al(t,function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),o=+e[0][0]+(r-a*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-a*(n[1][1]+n[0][1]))/2;t.scale(150*a).translate([o,s])},n)}var Pl=Os(30*Ps);function Fl(t,e){return+e?function(t,e){function n(r,i,a,o,s,l,c,u,h,f,d,p,g,m){var v=c-r,_=u-i,y=v*v+_*_;if(y>4*e&&g--){var x=o+f,b=s+d,w=l+p,M=Is(x*x+b*b+w*w),S=Gs(w/=M),C=Fs(Fs(w)-1)<Ss||Fs(a-h)<Ss?(a+h)/2:Ns(b,x),E=t(C,S),k=E[0],A=E[1],T=k-r,P=A-i,F=_*T-v*P;(F*F/y>e||Fs((v*T+_*P)/y-.5)>.3||o*f+s*d+l*p<Pl)&&(n(r,i,a,o,s,l,k,A,C,x/=M,b/=M,w,g,m),m.point(k,A),n(k,A,C,x,b,w,c,u,h,f,d,p,g,m))}}return function(e){var r,i,a,o,s,l,c,u,h,f,d,p,g={point:m,lineStart:v,lineEnd:y,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=v}};function m(n,r){n=t(n,r),e.point(n[0],n[1])}function v(){u=NaN,g.point=_,e.lineStart()}function _(r,i){var a=Hs([r,i]),o=t(r,i);n(u,h,c,f,d,p,u=o[0],h=o[1],c=r,f=a[0],d=a[1],p=a[2],16,e),e.point(u,h)}function y(){g.point=m,e.lineEnd()}function x(){v(),g.point=b,g.lineEnd=w}function b(t,e){_(r=t,e),i=u,a=h,o=f,s=d,l=p,g.point=_}function w(){n(u,h,c,f,d,p,i,a,r,o,s,l,16,e),g.lineEnd=y,y()}return g}}(t,e):function(t){return gl({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Ll=gl({point:function(t,e){this.stream.point(t*Ps,e*Ps)}});function Nl(t,e,n,r,i,a){if(!a)return function(t,e,n,r,i){function a(a,o){return[e+t*(a*=r),n-t*(o*=i)]}return a.invert=function(a,o){return[(a-e)/t*r,(n-o)/t*i]},a}(t,e,n,r,i);var o=Os(a),s=Ds(a),l=o*t,c=s*t,u=o/t,h=s/t,f=(s*n-o*e)/t,d=(s*e+o*n)/t;function p(t,a){return[l*(t*=r)-c*(a*=i)+e,n-c*t-l*a]}return p.invert=function(t,e){return[r*(u*t-h*e+f),i*(d-h*t-u*e)]},p}function Ol(t){return function(t){var e,n,r,i,a,o,s,l,c,u,h=150,f=480,d=250,p=0,g=0,m=0,v=0,_=0,y=0,x=1,b=1,w=null,M=nl,S=null,C=cl,E=.5;function k(t){return l(t[0]*Ps,t[1]*Ps)}function A(t){return(t=l.invert(t[0],t[1]))&&[t[0]*Ts,t[1]*Ts]}function T(){var t=Nl(h,0,0,x,b,y).apply(null,e(p,g)),r=Nl(h,f-t[0],d-t[1],x,b,y);return n=hl(m,v,_),s=ll(e,r),l=ll(n,s),o=Fl(s,E),P()}function P(){return c=u=null,k}return k.stream=function(t){return c&&u===t?c:c=Ll(function(t){return gl({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(M(o(C(u=t)))))},k.preclip=function(t){return arguments.length?(M=t,w=void 0,P()):M},k.postclip=function(t){return arguments.length?(C=t,S=r=i=a=null,P()):C},k.clipAngle=function(t){return arguments.length?(M=+t?function(t){var e=Os(t),n=6*Ps,r=e>0,i=Fs(e)>Ss;function a(t,n){return Os(t)*Os(n)>e}function o(t,n,r){var i=[1,0,0],a=Ys(Hs(t),Hs(n)),o=Vs(a,a),s=a[0],l=o-s*s;if(!l)return!r&&t;var c=e*o/l,u=-e*s/l,h=Ys(i,a),f=Xs(i,c);$s(f,Xs(a,u));var d=h,p=Vs(f,d),g=Vs(d,d),m=p*p-g*(Vs(f,f)-1);if(!(m<0)){var v=Is(m),_=Xs(d,(-p-v)/g);if($s(_,f),_=Us(_),!r)return _;var y,x=t[0],b=n[0],w=t[1],M=n[1];b<x&&(y=x,x=b,b=y);var S=b-x,C=Fs(S-Cs)<Ss;if(!C&&M<w&&(y=w,w=M,M=y),C||S<Ss?C?w+M>0^_[1]<(Fs(_[0]-x)<Ss?w:M):w<=_[1]&&_[1]<=M:S>Cs^(x<=_[0]&&_[0]<=b)){var E=Xs(d,(-p+v)/g);return $s(E,f),[_,Us(E)]}}}function s(e,n){var i=r?t:Cs-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}return Qs(a,function(t){var e,n,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(h,f){var d,p=[h,f],g=a(h,f),m=r?g?0:s(h,f):g?s(h+(h<0?Cs:-Cs),f):0;if(!e&&(c=l=g)&&t.lineStart(),g!==l&&(!(d=o(e,p))||js(e,d)||js(p,d))&&(p[2]=1),g!==l)u=0,g?(t.lineStart(),d=o(p,e),t.point(d[0],d[1])):(d=o(e,p),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(i&&e&&r^g){var v;m&n||!(v=o(p,e,!0))||(u=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!g||e&&js(e,p)||t.point(p[0],p[1]),e=p,l=g,n=m},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return u|(c&&l)<<1}}},function(e,r,i,a){rl(a,t,n,i,e,r)},r?[0,-t]:[-Cs,t-Cs])}(w=t*Ps):(w=null,nl),P()):w*Ts},k.clipExtent=function(t){return arguments.length?(C=null==t?(S=r=i=a=null,cl):sl(S=+t[0][0],r=+t[0][1],i=+t[1][0],a=+t[1][1]),P()):null==S?null:[[S,r],[i,a]]},k.scale=function(t){return arguments.length?(h=+t,T()):h},k.translate=function(t){return arguments.length?(f=+t[0],d=+t[1],T()):[f,d]},k.center=function(t){return arguments.length?(p=t[0]%360*Ps,g=t[1]%360*Ps,T()):[p*Ts,g*Ts]},k.rotate=function(t){return arguments.length?(m=t[0]%360*Ps,v=t[1]%360*Ps,_=t.length>2?t[2]%360*Ps:0,T()):[m*Ts,v*Ts,_*Ts]},k.angle=function(t){return arguments.length?(y=t%360*Ps,T()):y*Ts},k.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},k.reflectY=function(t){return arguments.length?(b=t?-1:1,T()):b<0},k.precision=function(t){return arguments.length?(o=Fl(s,E=t*t),P()):Is(E)},k.fitExtent=function(t,e){return Tl(k,t,e)},k.fitSize=function(t,e){return function(t,e,n){return Tl(t,[[0,0],e],n)}(k,t,e)},k.fitWidth=function(t,e){return function(t,e,n){return Al(t,function(n){var r=+e,i=r/(n[1][0]-n[0][0]),a=(r-i*(n[1][0]+n[0][0]))/2,o=-i*n[0][1];t.scale(150*i).translate([a,o])},n)}(k,t,e)},k.fitHeight=function(t,e){return function(t,e,n){return Al(t,function(n){var r=+e,i=r/(n[1][1]-n[0][1]),a=-i*n[0][0],o=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([a,o])},n)}(k,t,e)},function(){return e=t.apply(this,arguments),k.invert=e.invert&&A,T()}}(function(){return t})()}var Dl=Math.abs,zl=(Math.atan,Math.atan2,Math.ceil,Math.cos,Math.exp,Math.floor),Il=(Math.log,Math.max),Gl=Math.min,jl=(Math.pow,Math.round,Math.sign,Math.sin,Math.tan,Math.PI),Rl=jl/2,Bl=(Math.SQRT1_2,ql(2),ql(jl),180/jl),Wl=jl/180;function ql(t){return t>0?Math.sqrt(t):0}var Ul=[[.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 Hl(t,e){var n,r=Gl(18,36*Dl(e)/jl),i=zl(r),a=r-i,o=(n=Ul[i])[0],s=n[1],l=(n=Ul[++i])[0],c=n[1],u=(n=Ul[Gl(19,++i)])[0],h=n[1];return[t*(l+a*(u-o)/2+a*a*(u-2*l+o)/2),(e>0?Rl:-Rl)*(c+a*(h-s)/2+a*a*(h-2*c+s)/2)]}Ul.forEach(function(t){t[1]*=1.0144}),Hl.invert=function(t,e){var n=e/Rl,r=90*n,i=Gl(18,Dl(r/5)),a=Il(0,zl(i));do{var o=Ul[a][1],s=Ul[a+1][1],l=Ul[Gl(19,a+2)][1],c=l-o,u=l-2*s+o,h=2*(Dl(n)-s)/c,f=u/c,d=h*(1-f*h*(1-2*f*h));if(d>=0||1===a){r=(e>=0?5:-5)*(d+i);var p,g=50;do{d=(i=Gl(18,Dl(r)/5))-(a=zl(i)),o=Ul[a][1],s=Ul[a+1][1],l=Ul[Gl(19,a+2)][1],r-=(p=(e>=0?Rl:-Rl)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*Bl}while(Dl(p)>1e-12&&--g>0);break}}while(--a>=0);var m=Ul[a][0],v=Ul[a+1][0],_=Ul[Gl(19,a+2)][0];return[t/(v+d*(_-m)/2+d*d*(_-2*v+m)/2),r*Wl]};var Vl="http://www.w3.org/1999/xhtml";const Yl={svg:"http://www.w3.org/2000/svg",xhtml:Vl,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function $l(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),Yl.hasOwnProperty(e)?{space:Yl[e],local:t}:t}function Xl(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Vl&&e.documentElement.namespaceURI===Vl?e.createElement(t):e.createElementNS(n,t)}}function Jl(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Zl(t){var e=$l(t);return(e.local?Jl:Xl)(e)}function Kl(){}function Ql(t){return null==t?Kl:function(){return this.querySelector(t)}}function tc(){return[]}function ec(t){return new Array(t.length)}function nc(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}nc.prototype={constructor:nc,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function rc(t,e,n,r,i,a){for(var o,s=0,l=e.length,c=a.length;s<c;++s)(o=e[s])?(o.__data__=a[s],r[s]=o):n[s]=new nc(t,a[s]);for(;s<l;++s)(o=e[s])&&(i[s]=o)}function ic(t,e,n,r,i,a,o){var s,l,c,u={},h=e.length,f=a.length,d=new Array(h);for(s=0;s<h;++s)(l=e[s])&&(d[s]=c="$"+o.call(l,l.__data__,s,e),c in u?i[s]=l:u[c]=l);for(s=0;s<f;++s)(l=u[c="$"+o.call(t,a[s],s,a)])?(r[s]=l,l.__data__=a[s],u[c]=null):n[s]=new nc(t,a[s]);for(s=0;s<h;++s)(l=e[s])&&u[d[s]]===l&&(i[s]=l)}function ac(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function oc(t){return function(){this.removeAttribute(t)}}function sc(t){return function(){this.removeAttributeNS(t.space,t.local)}}function lc(t,e){return function(){this.setAttribute(t,e)}}function cc(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function uc(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function hc(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function fc(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function dc(t){return function(){this.style.removeProperty(t)}}function pc(t,e,n){return function(){this.style.setProperty(t,e,n)}}function gc(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function mc(t){return function(){delete this[t]}}function vc(t,e){return function(){this[t]=e}}function _c(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function yc(t){return t.trim().split(/^|\s+/)}function xc(t){return t.classList||new bc(t)}function bc(t){this._node=t,this._names=yc(t.getAttribute("class")||"")}function wc(t,e){for(var n=xc(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Mc(t,e){for(var n=xc(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Sc(t){return function(){wc(this,t)}}function Cc(t){return function(){Mc(this,t)}}function Ec(t,e){return function(){(e.apply(this,arguments)?wc:Mc)(this,t)}}function kc(){this.textContent=""}function Ac(t){return function(){this.textContent=t}}function Tc(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function Pc(){this.innerHTML=""}function Fc(t){return function(){this.innerHTML=t}}function Lc(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function Nc(){this.nextSibling&&this.parentNode.appendChild(this)}function Oc(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Dc(){return null}function zc(){var t=this.parentNode;t&&t.removeChild(this)}function Ic(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function Gc(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}bc.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var jc={},Rc=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(jc={mouseenter:"mouseover",mouseleave:"mouseout"}));function Bc(t,e,n){return t=Wc(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function Wc(t,e,n){return function(r){var i=Rc;Rc=r;try{t.call(this,this.__data__,e,n)}finally{Rc=i}}}function qc(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r<a;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.capture);++i?e.length=i:delete this.__on}}}function Uc(t,e,n){var r=jc.hasOwnProperty(t.type)?Bc:Wc;return function(i,a,o){var s,l=this.__on,c=r(e,a,o);if(l)for(var u=0,h=l.length;u<h;++u)if((s=l[u]).type===t.type&&s.name===t.name)return this.removeEventListener(s.type,s.listener,s.capture),this.addEventListener(s.type,s.listener=c,s.capture=n),void(s.value=e);this.addEventListener(t.type,c,n),s={type:t.type,name:t.name,value:e,listener:c,capture:n},l?l.push(s):this.__on=[s]}}function Hc(t,e,n,r){var i=Rc;t.sourceEvent=Rc,Rc=t;try{return e.apply(n,r)}finally{Rc=i}}function Vc(t,e,n){var r=fc(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Yc(t,e){return function(){return Vc(this,t,e)}}function $c(t,e){return function(){return Vc(this,t,e.apply(this,arguments))}}var Xc=[null];function Jc(t,e){this._groups=t,this._parents=e}function Zc(){return new Jc([[document.documentElement]],Xc)}Jc.prototype=Zc.prototype={constructor:Jc,select:function(t){"function"!=typeof t&&(t=Ql(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,o,s=e[i],l=s.length,c=r[i]=new Array(l),u=0;u<l;++u)(a=s[u])&&(o=t.call(a,a.__data__,u,s))&&("__data__"in a&&(o.__data__=a.__data__),c[u]=o);return new Jc(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=function(t){return null==t?tc:function(){return this.querySelectorAll(t)}}(t));for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o,s=e[a],l=s.length,c=0;c<l;++c)(o=s[c])&&(r.push(t.call(o,o.__data__,c,s)),i.push(o));return new Jc(r,i)},filter:function(t){"function"!=typeof t&&(t=function(t){return function(){return this.matches(t)}}(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,o=e[i],s=o.length,l=r[i]=[],c=0;c<s;++c)(a=o[c])&&t.call(a,a.__data__,c,o)&&l.push(a);return new Jc(r,this._parents)},data:function(t,e){if(!t)return d=new Array(this.size()),c=-1,this.each(function(t){d[++c]=t}),d;var n=e?ic:rc,r=this._parents,i=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var a=i.length,o=new Array(a),s=new Array(a),l=new Array(a),c=0;c<a;++c){var u=r[c],h=i[c],f=h.length,d=t.call(u,u&&u.__data__,c,r),p=d.length,g=s[c]=new Array(p),m=o[c]=new Array(p);n(u,h,g,m,l[c]=new Array(f),d,e);for(var v,_,y=0,x=0;y<p;++y)if(v=g[y]){for(y>=x&&(x=y+1);!(_=m[x])&&++x<p;);v._next=_||null}}return(o=new Jc(o,r))._enter=s,o._exit=l,o},enter:function(){return new Jc(this._enter||this._groups.map(ec),this._parents)},exit:function(){return new Jc(this._exit||this._groups.map(ec),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,a=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=e&&(i=e(i)),null==n?a.remove():n(a),r&&i?r.merge(i).order():i},merge:function(t){for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),s=0;s<a;++s)for(var l,c=e[s],u=n[s],h=c.length,f=o[s]=new Array(h),d=0;d<h;++d)(l=c[d]||u[d])&&(f[d]=l);for(;s<r;++s)o[s]=e[s];return new Jc(o,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],a=i.length-1,o=i[a];--a>=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=ac);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o,s=n[a],l=s.length,c=i[a]=new Array(l),u=0;u<l;++u)(o=s[u])&&(c[u]=o);c.sort(e)}return new Jc(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),e=-1;return this.each(function(){t[++e]=this}),t},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null},size:function(){var t=0;return this.each(function(){++t}),t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,a=e[n],o=0,s=a.length;o<s;++o)(i=a[o])&&t.call(i,i.__data__,o,a);return this},attr:function(t,e){var n=$l(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?sc:oc:"function"==typeof e?n.local?hc:uc:n.local?cc:lc)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?dc:"function"==typeof e?gc:pc)(t,e,null==n?"":n)):function(t,e){return t.style.getPropertyValue(e)||fc(t).getComputedStyle(t,null).getPropertyValue(e)}(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?mc:"function"==typeof e?_c:vc)(t,e)):this.node()[t]},classed:function(t,e){var n=yc(t+"");if(arguments.length<2){for(var r=xc(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?Ec:e?Sc:Cc)(n,e))},text:function(t){return arguments.length?this.each(null==t?kc:("function"==typeof t?Tc:Ac)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Pc:("function"==typeof t?Lc:Fc)(t)):this.node().innerHTML},raise:function(){return this.each(Nc)},lower:function(){return this.each(Oc)},append:function(t){var e="function"==typeof t?t:Zl(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var n="function"==typeof t?t:Zl(t),r=null==e?Dc:"function"==typeof e?e:Ql(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(zc)},clone:function(t){return this.select(t?Gc:Ic)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,a=function(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}(t+""),o=a.length;if(!(arguments.length<2)){for(s=e?Uc:qc,null==n&&(n=!1),r=0;r<o;++r)this.each(s(a[r],e,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(r=0,l=s[c];r<o;++r)if((i=a[r]).type===l.type&&i.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?$c:Yc)(t,e))}};function Kc(t){return"string"==typeof t?new Jc([[document.querySelector(t)]],[document.documentElement]):new Jc([[t]],Xc)}var Qc=0;function tu(){this._="@"+(++Qc).toString(36)}function eu(){for(var t,e=Rc;t=e.sourceEvent;)e=t;return e}function nu(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}function ru(t){var e=eu();return e.changedTouches&&(e=e.changedTouches[0]),nu(t,e)}function iu(t,e,n){arguments.length<3&&(n=e,e=eu().changedTouches);for(var r,i=0,a=e?e.length:0;i<a;++i)if((r=e[i]).identifier===n)return nu(t,r);return null}tu.prototype=function(){return new tu}.prototype={constructor:tu,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var au={value:function(){}};function ou(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new su(r)}function su(t){this._=t}function lu(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function cu(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=au,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}su.prototype=ou.prototype={constructor:su,on:function(t,e){var n,r,i=this._,a=(r=i,(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=a[o]).type)i[n]=cu(i[n],t.name,e);else if(null==e)for(n in i)i[n]=cu(i[n],t.name,null);return this}for(;++o<s;)if((n=(t=a[o]).type)&&(n=lu(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new su(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(r=this._[t]).length;a<n;++a)r[a].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};const uu=ou;function hu(){Rc.stopImmediatePropagation()}function fu(){Rc.preventDefault(),Rc.stopImmediatePropagation()}function du(t){return function(){return t}}function pu(t,e,n,r,i,a,o,s,l,c){this.target=t,this.type=e,this.subject=n,this.identifier=r,this.active=i,this.x=a,this.y=o,this.dx=s,this.dy=l,this._=c}function gu(){return!Rc.button}function mu(){return this.parentNode}function vu(t){return null==t?{x:Rc.x,y:Rc.y}:t}function _u(){return"ontouchstart"in this}function yu(){var t,e,n,r,i=gu,a=mu,o=vu,s=_u,l={},c=uu("start","drag","end"),u=0,h=0;function f(t){t.on("mousedown.drag",d).filter(s).on("touchstart.drag",m).on("touchmove.drag",v).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(){if(!r&&i.apply(this,arguments)){var o=y("mouse",a.apply(this,arguments),ru,this,arguments);o&&(Kc(Rc.view).on("mousemove.drag",p,!0).on("mouseup.drag",g,!0),function(t){var e=t.document.documentElement,n=Kc(t).on("dragstart.drag",fu,!0);"onselectstart"in e?n.on("selectstart.drag",fu,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(Rc.view),hu(),n=!1,t=Rc.clientX,e=Rc.clientY,o("start"))}}function p(){if(fu(),!n){var r=Rc.clientX-t,i=Rc.clientY-e;n=r*r+i*i>h}l.mouse("drag")}function g(){Kc(Rc.view).on("mousemove.drag mouseup.drag",null),function(t,e){var n=t.document.documentElement,r=Kc(t).on("dragstart.drag",null);e&&(r.on("click.drag",fu,!0),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(Rc.view,n),fu(),l.mouse("end")}function m(){if(i.apply(this,arguments)){var t,e,n=Rc.changedTouches,r=a.apply(this,arguments),o=n.length;for(t=0;t<o;++t)(e=y(n[t].identifier,r,iu,this,arguments))&&(hu(),e("start"))}}function v(){var t,e,n=Rc.changedTouches,r=n.length;for(t=0;t<r;++t)(e=l[n[t].identifier])&&(fu(),e("drag"))}function _(){var t,e,n=Rc.changedTouches,i=n.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<i;++t)(e=l[n[t].identifier])&&(hu(),e("end"))}function y(t,e,n,r,i){var a,s,h,d=n(e,t),p=c.copy();if(Hc(new pu(f,"beforestart",a,t,u,d[0],d[1],0,0,p),function(){return null!=(Rc.subject=a=o.apply(r,i))&&(s=a.x-d[0]||0,h=a.y-d[1]||0,!0)}))return function o(c){var g,m=d;switch(c){case"start":l[t]=o,g=u++;break;case"end":delete l[t],--u;case"drag":d=n(e,t),g=u}Hc(new pu(f,c,a,t,g,d[0]+s,d[1]+h,d[0]-m[0],d[1]-m[1],p),p.apply,p,[c,r,i])}}return f.filter=function(t){return arguments.length?(i="function"==typeof t?t:du(!!t),f):i},f.container=function(t){return arguments.length?(a="function"==typeof t?t:du(t),f):a},f.subject=function(t){return arguments.length?(o="function"==typeof t?t:du(t),f):o},f.touchable=function(t){return arguments.length?(s="function"==typeof t?t:du(!!t),f):s},f.on=function(){var t=c.on.apply(c,arguments);return t===c?f:t},f.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,f):Math.sqrt(h)},f}pu.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var xu=Math.PI,bu=2*xu,wu=1e-6,Mu=bu-wu;function Su(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Cu(){return new Su}Su.prototype=Cu.prototype={constructor:Su,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,a){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,s=n-t,l=r-e,c=a-t,u=o-e,h=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>wu)if(Math.abs(u*s-l*c)>wu&&i){var f=n-a,d=r-o,p=s*s+l*l,g=f*f+d*d,m=Math.sqrt(p),v=Math.sqrt(h),_=i*Math.tan((xu-Math.acos((p+h-g)/(2*m*v)))/2),y=_/v,x=_/m;Math.abs(y-1)>wu&&(this._+="L"+(t+y*c)+","+(e+y*u)),this._+="A"+i+","+i+",0,0,"+ +(u*f>c*d)+","+(this._x1=t+x*s)+","+(this._y1=e+x*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,a){t=+t,e=+e,a=!!a;var o=(n=+n)*Math.cos(r),s=n*Math.sin(r),l=t+o,c=e+s,u=1^a,h=a?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>wu||Math.abs(this._y1-c)>wu)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%bu+bu),h>Mu?this._+="A"+n+","+n+",0,1,"+u+","+(t-o)+","+(e-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>wu&&(this._+="A"+n+","+n+",0,"+ +(h>=xu)+","+u+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};const Eu=Cu;function ku(t){return function(){return t}}var Au=1e-12,Tu=Math.PI,Pu=Tu/2,Fu=2*Tu;function Lu(t){return t.innerRadius}function Nu(t){return t.outerRadius}function Ou(t){return t.startAngle}function Du(t){return t.endAngle}function zu(t){return t&&t.padAngle}function Iu(t){return t>=1?Pu:t<=-1?-Pu:Math.asin(t)}function Gu(t,e,n,r,i,a,o){var s=t-n,l=e-r,c=(o?a:-a)/Math.sqrt(s*s+l*l),u=c*l,h=-c*s,f=t+u,d=e+h,p=n+u,g=r+h,m=(f+p)/2,v=(d+g)/2,_=p-f,y=g-d,x=_*_+y*y,b=i-a,w=f*g-p*d,M=(y<0?-1:1)*Math.sqrt(Math.max(0,b*b*x-w*w)),S=(w*y-_*M)/x,C=(-w*_-y*M)/x,E=(w*y+_*M)/x,k=(-w*_+y*M)/x,A=S-m,T=C-v,P=E-m,F=k-v;return A*A+T*T>P*P+F*F&&(S=E,C=k),{cx:S,cy:C,x01:-u,y01:-h,x11:S*(i/b-1),y11:C*(i/b-1)}}function ju(t){this._context=t}function Ru(t){return new ju(t)}function Bu(t){return t[0]}function Wu(t){return t[1]}ju.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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};!function(t){function e(e){return new qu(t(e))}e._curve=t}(Ru);function qu(t){this._curve=t}qu.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};Math.sqrt(1/3);var Uu=Math.sin(Tu/10)/Math.sin(7*Tu/10);Math.sin(Fu/10),Math.cos(Fu/10);Math.sqrt(3);Math.sqrt(3),Math.sqrt(12);function Hu(){}function Vu(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Yu(t){this._context=t}function $u(t){this._context=t}function Xu(t){this._context=t}function Ju(t,e){this._basis=new Yu(t),this._beta=e}Yu.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:Vu(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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);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:Vu(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},$u.prototype={areaStart:Hu,areaEnd:Hu,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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Vu(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Xu.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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Vu(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Ju.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],a=e[0],o=t[n]-i,s=e[n]-a,l=-1;++l<=n;)r=l/n,this._basis.point(this._beta*t[l]+(1-this._beta)*(i+r*o),this._beta*e[l]+(1-this._beta)*(a+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};(function t(e){function n(t){return 1===e?new Yu(t):new Ju(t,e)}return n.beta=function(e){return t(+e)},n})(.85);function Zu(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Ku(t,e){this._context=t,this._k=(1-e)/6}Ku.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:Zu(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Zu(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new Ku(t,e)}return n.tension=function(e){return t(+e)},n})(0);function Qu(t,e){this._context=t,this._k=(1-e)/6}Qu.prototype={areaStart:Hu,areaEnd:Hu,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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Zu(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new Qu(t,e)}return n.tension=function(e){return t(+e)},n})(0);function th(t,e){this._context=t,this._k=(1-e)/6}th.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(t,e){switch(t=+t,e=+e,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:Zu(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new th(t,e)}return n.tension=function(e){return t(+e)},n})(0);function eh(t,e,n){var r=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>Au){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Au){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*c+t._x1*t._l23_2a-e*t._l12_2a)/u,o=(o*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,a,o,t._x2,t._y2)}function nh(t,e){this._context=t,this._alpha=e}nh.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(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:eh(this,t,e)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const rh=function t(e){function n(t){return e?new nh(t,e):new Ku(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function ih(t,e){this._context=t,this._alpha=e}ih.prototype={areaStart:Hu,areaEnd:Hu,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(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:eh(this,t,e)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return e?new ih(t,e):new Qu(t,0)}return n.alpha=function(e){return t(+e)},n})(.5);function ah(t,e){this._context=t,this._alpha=e}ah.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(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:eh(this,t,e)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return e?new ah(t,e):new th(t,0)}return n.alpha=function(e){return t(+e)},n})(.5);function oh(t){this._context=t}function sh(t){return t<0?-1:1}function lh(t,e,n){var r=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(r||i<0&&-0),o=(n-t._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(sh(a)+sh(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function ch(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function uh(t,e,n){var r=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-r)/3;t._context.bezierCurveTo(r+s,i+s*e,a-s,o-s*n,a,o)}function hh(t){this._context=t}function fh(t){this._context=new dh(t)}function dh(t){this._context=t}function ph(t){this._context=t}function gh(t){var e,n,r=t.length-1,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,a[e]=4,o[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,a[r-1]=7,o[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/a[e-1],a[e]-=n,o[e]-=n*o[e-1];for(i[r-1]=o[r-1]/a[r-1],e=r-2;e>=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)a[e]=2*t[e+1]-i[e+1];return[i,a]}function mh(t,e){this._context=t,this._t=e}oh.prototype={areaStart:Hu,areaEnd:Hu,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},hh.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:uh(this,this._t0,ch(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,uh(this,ch(this,n=lh(this,t,e)),n);break;default:uh(this,this._t0,n=lh(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(fh.prototype=Object.create(hh.prototype)).point=function(t,e){hh.prototype.point.call(this,e,t)},dh.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,a){this._context.bezierCurveTo(e,t,r,n,a,i)}},ph.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var r=gh(t),i=gh(e),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],t[o],e[o]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},mh.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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};Array.prototype.slice;var vh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_h=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},yh=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),xh=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},bh=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,n,r)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(r):void 0},wh=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},Mh=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},Sh=function(){function t(e){var n=e.x,r=void 0===n?0:n,i=e.y,a=void 0===i?0:i,o=e.nx,s=e.ny,l=e.dy,c=void 0===l?0:l,u=e.dx,h=void 0===u?0:u,f=e.color,d=void 0===f?"grey":f,p=e.data,g=e.type,m=e.subject,v=e.connector,_=e.note,y=e.disable,x=e.id,b=e.className;_h(this,t),this._dx=void 0!==o?o-r:h,this._dy=void 0!==s?s-a:c,this._x=r,this._y=a,this._color=d,this.id=x,this._className=b||"",this._type=g||"",this.data=p,this.note=_||{},this.connector=v||{},this.subject=m||{},this.disable=y||[]}return yh(t,[{key:"updatePosition",value:function(){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(){this.type.clearComponents&&this.type.clearComponents()}},{key:"updateOffset",value:function(){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(){return this._className},set:function(t){this._className=t,this.type.setClassName&&this.type.setClassName()}},{key:"type",get:function(){return this._type},set:function(t){this._type=t,this.clearComponents()}},{key:"x",get:function(){return this._x},set:function(t){this._x=t,this.updatePosition()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this.updatePosition()}},{key:"color",get:function(){return this._color},set:function(t){this._color=t,this.updatePosition()}},{key:"dx",get:function(){return this._dx},set:function(t){this._dx=t,this.updateOffset()}},{key:"dy",get:function(){return this._dy},set:function(t){this._dy=t,this.updateOffset()}},{key:"nx",set:function(t){this._dx=t-this._x,this.updateOffset()}},{key:"ny",set:function(t){this._dy=t-this._y,this.updateOffset()}},{key:"offset",get:function(){return{x:this._dx,y:this._dy}},set:function(t){var e=t.x,n=t.y;this._dx=e,this._dy=n,this.updateOffset()}},{key:"position",get:function(){return{x:this._x,y:this._y}},set:function(t){var e=t.x,n=t.y;this._x=e,this._y=n,this.updatePosition()}},{key:"translation",get:function(){return{x:this._x+this._dx,y:this._y+this._dy}}},{key:"json",get:function(){var t={x:this._x,y:this._y,dx:this._dx,dy:this._dy};return this.data&&Object.keys(this.data).length>0&&(t.data=this.data),this.type&&(t.type=this.type),this._className&&(t.className=this._className),Object.keys(this.connector).length>0&&(t.connector=this.connector),Object.keys(this.subject).length>0&&(t.subject=this.subject),Object.keys(this.note).length>0&&(t.note=this.note),t}}]),t}(),Ch=function(){function t(e){var n=e.annotations,r=e.accessors,i=e.accessorsInverse;_h(this,t),this.accessors=r,this.accessorsInverse=i,this.annotations=n}return yh(t,[{key:"clearTypes",value:function(t){this.annotations.forEach(function(e){e.type=void 0,e.subject=t&&t.subject||e.subject,e.connector=t&&t.connector||e.connector,e.note=t&&t.note||e.note})}},{key:"setPositionWithAccessors",value:function(){var t=this;this.annotations.forEach(function(e){e.type.setPositionWithAccessors(t.accessors)})}},{key:"editMode",value:function(t){this.annotations.forEach(function(e){e.type&&(e.type.editMode=t,e.type.updateEditMode())})}},{key:"updateDisable",value:function(t){this.annotations.forEach(function(e){e.disable=t,e.type&&t.forEach(function(t){e.type[t]&&(e.type[t].remove&&e.type[t].remove(),e.type[t]=void 0)})})}},{key:"updateTextWrap",value:function(t){this.annotations.forEach(function(e){e.type&&e.type.updateTextWrap&&e.type.updateTextWrap(t)})}},{key:"updateText",value:function(){this.annotations.forEach(function(t){t.type&&t.type.drawText&&t.type.drawText()})}},{key:"updateNotePadding",value:function(t){this.annotations.forEach(function(e){e.type&&(e.type.notePadding=t)})}},{key:"json",get:function(){var t=this;return this.annotations.map(function(e){var n=e.json;return t.accessorsInverse&&e.data&&(n.data={},Object.keys(t.accessorsInverse).forEach(function(r){n.data[r]=t.accessorsInverse[r]({x:e.x,y:e.y})})),n})}},{key:"noteNodes",get:function(){return this.annotations.map(function(t){return xh({},t.type.getNoteBBoxOffset(),{positionX:t.x,positionY:t.y})})}}]),t}(),Eh=function(t,e){return"dynamic"!==t&&"left"!==t&&"right"!==t||(t=e<0?"top":"bottom"),t},kh=function(t,e){return"dynamic"!==t&&"top"!==t&&"bottom"!==t||(t=e<0?"right":"left"),t},Ah=["topBottom","top","bottom"],Th=["leftRight","left","right"],Ph=function(t){var e=t.data,n=t.curve,r=void 0===n?Ru:n,i=t.canvasContext,a=t.className,o=t.classID,s=function(){var t=Bu,e=Wu,n=ku(!0),r=null,i=Ru,a=null;function o(o){var s,l,c,u=o.length,h=!1;for(null==r&&(a=i(c=Eu())),s=0;s<=u;++s)!(s<u&&n(l=o[s],s,o))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+t(l,s,o),+e(l,s,o));if(c)return a=null,c+""||null}return o.x=function(e){return arguments.length?(t="function"==typeof e?e:ku(+e),o):t},o.y=function(t){return arguments.length?(e="function"==typeof t?t:ku(+t),o):e},o.defined=function(t){return arguments.length?(n="function"==typeof t?t:ku(!!t),o):n},o.curve=function(t){return arguments.length?(i=t,null!=r&&(a=i(r)),o):i},o.context=function(t){return arguments.length?(null==t?r=a=null:a=i(r=t),o):r},o}().curve(r),l={type:"path",className:a,classID:o,data:e};return i?(s.context(i),l.pathMethods=s):l.attrs={d:s(e)},l},Fh=function(t){var e=t.data,n=t.canvasContext,r={type:"path",className:t.className,classID:t.classID,data:e},i=function(){var t=Lu,e=Nu,n=ku(0),r=null,i=Ou,a=Du,o=zu,s=null;function l(){var l,c,u=+t.apply(this,arguments),h=+e.apply(this,arguments),f=i.apply(this,arguments)-Pu,d=a.apply(this,arguments)-Pu,p=Math.abs(d-f),g=d>f;if(s||(s=l=Eu()),h<u&&(c=h,h=u,u=c),h>Au)if(p>Fu-Au)s.moveTo(h*Math.cos(f),h*Math.sin(f)),s.arc(0,0,h,f,d,!g),u>Au&&(s.moveTo(u*Math.cos(d),u*Math.sin(d)),s.arc(0,0,u,d,f,g));else{var m,v,_=f,y=d,x=f,b=d,w=p,M=p,S=o.apply(this,arguments)/2,C=S>Au&&(r?+r.apply(this,arguments):Math.sqrt(u*u+h*h)),E=Math.min(Math.abs(h-u)/2,+n.apply(this,arguments)),k=E,A=E;if(C>Au){var T=Iu(C/u*Math.sin(S)),P=Iu(C/h*Math.sin(S));(w-=2*T)>Au?(x+=T*=g?1:-1,b-=T):(w=0,x=b=(f+d)/2),(M-=2*P)>Au?(_+=P*=g?1:-1,y-=P):(M=0,_=y=(f+d)/2)}var F=h*Math.cos(_),L=h*Math.sin(_),N=u*Math.cos(b),O=u*Math.sin(b);if(E>Au){var D=h*Math.cos(y),z=h*Math.sin(y),I=u*Math.cos(x),G=u*Math.sin(x);if(p<Tu){var j=w>Au?function(t,e,n,r,i,a,o,s){var l=n-t,c=r-e,u=o-i,h=s-a,f=(u*(e-a)-h*(t-i))/(h*l-u*c);return[t+f*l,e+f*c]}(F,L,I,G,D,z,N,O):[N,O],R=F-j[0],B=L-j[1],W=D-j[0],q=z-j[1],U=1/Math.sin(Math.acos((R*W+B*q)/(Math.sqrt(R*R+B*B)*Math.sqrt(W*W+q*q)))/2),H=Math.sqrt(j[0]*j[0]+j[1]*j[1]);k=Math.min(E,(u-H)/(U-1)),A=Math.min(E,(h-H)/(U+1))}}M>Au?A>Au?(m=Gu(I,G,F,L,h,A,g),v=Gu(D,z,N,O,h,A,g),s.moveTo(m.cx+m.x01,m.cy+m.y01),A<E?s.arc(m.cx,m.cy,A,Math.atan2(m.y01,m.x01),Math.atan2(v.y01,v.x01),!g):(s.arc(m.cx,m.cy,A,Math.atan2(m.y01,m.x01),Math.atan2(m.y11,m.x11),!g),s.arc(0,0,h,Math.atan2(m.cy+m.y11,m.cx+m.x11),Math.atan2(v.cy+v.y11,v.cx+v.x11),!g),s.arc(v.cx,v.cy,A,Math.atan2(v.y11,v.x11),Math.atan2(v.y01,v.x01),!g))):(s.moveTo(F,L),s.arc(0,0,h,_,y,!g)):s.moveTo(F,L),u>Au&&w>Au?k>Au?(m=Gu(N,O,D,z,u,-k,g),v=Gu(F,L,I,G,u,-k,g),s.lineTo(m.cx+m.x01,m.cy+m.y01),k<E?s.arc(m.cx,m.cy,k,Math.atan2(m.y01,m.x01),Math.atan2(v.y01,v.x01),!g):(s.arc(m.cx,m.cy,k,Math.atan2(m.y01,m.x01),Math.atan2(m.y11,m.x11),!g),s.arc(0,0,u,Math.atan2(m.cy+m.y11,m.cx+m.x11),Math.atan2(v.cy+v.y11,v.cx+v.x11),g),s.arc(v.cx,v.cy,k,Math.atan2(v.y11,v.x11),Math.atan2(v.y01,v.x01),!g))):s.arc(0,0,u,b,x,g):s.lineTo(N,O)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Tu/2;return[Math.cos(r)*n,Math.sin(r)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:ku(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:ku(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:ku(+t),l):n},l.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:ku(+t),l):r},l.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:ku(+t),l):i},l.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:ku(+t),l):a},l.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:ku(+t),l):o},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}().innerRadius(e.innerRadius||0).outerRadius(e.outerRadius||e.radius||2).startAngle(e.startAngle||0).endAngle(e.endAngle||2*Math.PI);return n?(i.context(n),r.pathMethods=lineGen):r.attrs={d:i()},r},Lh=function(t){var e=t.type,n=t.subjectType,r=e.annotation,i=r.position,a=r.x-i.x,o=a+r.dx,s=r.y-i.y,l=s+r.dy,c=r.subject;if("circle"===n&&(c.outerRadius||c.radius)){var u=Math.sqrt((a-o)*(a-o)+(s-l)*(s-l)),h=Math.asin(-l/u),f=c.outerRadius||c.radius+(c.radiusPadding||0);a=Math.abs(Math.cos(h)*f)*(o<0?-1:1),s=Math.abs(Math.sin(h)*f)*(l<0?-1:1)}if("rect"===n){var d=c.width,p=c.height;(d>0&&r.dx>0||d<0&&r.dx<0)&&(a=Math.abs(d)>Math.abs(r.dx)?d/2:d),(p>0&&r.dy>0||p<0&&r.dy<0)&&(s=Math.abs(p)>Math.abs(r.dy)?p/2:p),a===d/2&&s===p/2&&(a=o,s=l)}return[[a,s],[o,l]]},Nh=function(t){var e=t.type,n=t.connectorData,r=t.subjectType;n||(n={}),n.points&&"number"!=typeof n.points||(n.points=Oh(e.annotation.offset,n.points)),n.curve||(n.curve=rh);var i=[];if(e.editMode){var a=n.points.map(function(t,e){return xh({},function(t){var e=t.cx,n=void 0===e?0:e,r=t.cy;return{move:{x:n,y:void 0===r?0:r}}}({cx:t[0],cy:t[1]}),{index:e})}),o=function(t){n.points[t][0]+=Rc.dx,n.points[t][1]+=Rc.dy,e.redrawConnector()};i=e.mapHandles(a.map(function(t){return xh({},t.move,{drag:o.bind(e,t.index)})}))}var s=Lh({type:e,subjectType:r});return s=[s[0]].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}(n.points),[s[1]]),{components:[Ph({data:s,curve:n.curve,className:"connector"})],handles:i}},Oh=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=t.x/(e+1),r=t.y/(e+1),i=[],a=1;a<=e;a++)i.push([n*a+a%2*20,r*a-a%2*20]);return i},Dh=function(t){var e=t.subjectData,n=t.type;e.radius||e.outerRadius||(e.radius=20);var r=[],i=Fh({data:e,className:"subject"});if(n.editMode){var a=function(t){var e=t.cx,n=void 0===e?0:e,r=t.cy,i=void 0===r?0:r,a=t.r1,o=t.r2,s=t.padding,l={move:{x:n,y:i}};return void 0!==a&&(l.r1={x:n+a/Math.sqrt(2),y:i+a/Math.sqrt(2)}),void 0!==o&&(l.r2={x:n+o/Math.sqrt(2),y:i+o/Math.sqrt(2)}),void 0!==s&&(l.padding={x:n+a+s,y:i}),l}({r1:i.data.outerRadius||i.data.radius,r2:i.data.innerRadius,padding:e.radiusPadding}),o=function(t){var r=e[t]+Rc.dx*Math.sqrt(2);e[t]=r,n.redrawSubject(),n.redrawConnector()},s=[xh({},a.r1,{drag:o.bind(n,void 0!==e.outerRadius?"outerRadius":"radius")})];e.innerRadius&&s.push(xh({},a.r2,{drag:o.bind(n,"innerRadius")})),r=n.mapHandles(s)}return i.attrs["fill-opacity"]=0,{components:[i],handles:r}},zh=function(){function t(e){var n=e.a,r=e.annotation,i=e.editMode,a=e.dispatcher,o=e.notePadding,s=e.accessors;if(_h(this,t),this.a=n,this.note=-1===r.disable.indexOf("note")&&n.select("g.annotation-note"),this.noteContent=this.note&&n.select("g.annotation-note-content"),this.connector=-1===r.disable.indexOf("connector")&&n.select("g.annotation-connector"),this.subject=-1===r.disable.indexOf("subject")&&n.select("g.annotation-subject"),this.dispatcher=a,a){var l=Vh.bind(null,a,r);l({component:this.note,name:"note"}),l({component:this.connector,name:"connector"}),l({component:this.subject,name:"subject"})}this.annotation=r,this.editMode=r.editMode||i,this.notePadding=void 0!==o?o:3,this.offsetCornerX=0,this.offsetCornerY=0,s&&r.data&&this.init(s)}return yh(t,[{key:"init",value:function(t){this.annotation.x||this.mapX(t),this.annotation.y||this.mapY(t)}},{key:"mapY",value:function(t){t.y&&(this.annotation.y=t.y(this.annotation.data))}},{key:"mapX",value:function(t){t.x&&(this.annotation.x=t.x(this.annotation.data))}},{key:"updateEditMode",value:function(){this.a.selectAll("circle.handle").remove()}},{key:"drawOnSVG",value:function(t,e){var n=this;Array.isArray(e)||(e=[e]),e.filter(function(t){return t}).forEach(function(e){var r=e.type,i=e.className,a=e.attrs,o=e.handles,s=e.classID;if("handle"===r)!function(t){var e=t.group,n=t.handles,r=t.r,i=void 0===r?10:r,a=e.selectAll("circle.handle").data(n);a.enter().append("circle").attr("class","handle").attr("fill","grey").attr("fill-opacity",.1).attr("cursor","move").attr("stroke-dasharray",5).attr("stroke","grey").call(yu().container(Kc("g.annotations").node()).on("start",function(t){return t.start&&t.start(t)}).on("drag",function(t){return t.drag&&t.drag(t)}).on("end",function(t){return t.end&&t.end(t)})),e.selectAll("circle.handle").attr("cx",function(t){return t.x}).attr("cy",function(t){return t.y}).attr("r",function(t){return t.r||i}).attr("class",function(t){return"handle "+(t.className||"")}),a.exit().remove()}({group:t,r:a&&a.r,handles:o});else{Hh(t,[n.annotation],r,i,s);for(var l=t.select(r+"."+(s||i)),c=Object.keys(a),u=[],h=l.node().attributes,f=h.length-1;f>=0;f--){var d=h[f].name;-1===c.indexOf(d)&&"class"!==d&&u.push(d)}c.forEach(function(t){"text"===t?l.text(a[t]):l.attr(t,a[t])}),u.forEach(function(t){return l.attr(t,null)})}})}},{key:"getNoteBBox",value:function(){return $h(this.note,".annotation-note-content text")}},{key:"getNoteBBoxOffset",value:function(){var t=$h(this.note,".annotation-note-content"),e=this.noteContent.attr("transform").split(/\(|\,|\)/g);return t.offsetCornerX=parseFloat(e[1])+this.annotation.dx,t.offsetCornerY=parseFloat(e[2])+this.annotation.dy,t.offsetX=this.annotation.dx,t.offsetY=this.annotation.dy,t}},{key:"drawSubject",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.annotation.subject,r=e.type,i={type:this,subjectData:n},a={};"circle"===r?a=Dh(i):"rect"===r?a=function(t){var e=t.subjectData,n=t.type;e.width||(e.width=100),e.height||(e.height=100);var r=[],i=e.width,a=e.height,o=Ph({data:[[0,0],[i,0],[i,a],[0,a],[0,0]],className:"subject"});if(n.editMode){var s=[{x:i,y:a/2,drag:function(){e.width=Rc.x,n.redrawSubject(),n.redrawConnector()}.bind(n)},{x:i/2,y:a,drag:function(){e.height=Rc.y,n.redrawSubject(),n.redrawConnector()}.bind(n)}];r=n.mapHandles(s)}return o.attrs["fill-opacity"]=.1,{components:[o],handles:r}}(i):"threshold"===r?a=function(t){var e=t.subjectData,n=t.type.annotation.position,r=(void 0!==e.x1?e.x1:n.x)-n.x,i=(void 0!==e.x2?e.x2:n.x)-n.x,a=(void 0!==e.y1?e.y1:n.y)-n.y,o=(void 0!==e.y2?e.y2:n.y)-n.y;return{components:[Ph({data:[[r,a],[i,o]],className:"subject"})]}}(i):"badge"===r&&(a=function(t){var e=t.subjectData,n=void 0===e?{}:e,r=t.type,i=void 0===r?{}:r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.typeSettings&&i.typeSettings.subject;n.radius||(o&&o.radius?n.radius=o.radius:n.radius=14),n.x||o&&o.x&&(n.x=o.x),n.y||o&&o.y&&(n.y=o.y);var s=[],l=[],c=n.radius,u=.7*c,h=0,f=0,d=Math.sqrt(2)*c,p={xleftcorner:-c,xrightcorner:c,ytopcorner:-c,ybottomcorner:c,xleft:-d,xright:d,ytop:-d,ybottom:d};n.x&&!n.y?h=p["x"+n.x]:n.y&&!n.x?f=p["y"+n.y]:n.x&&n.y&&(h=p["x"+n.x+"corner"],f=p["y"+n.y+"corner"]);var g="translate("+h+", "+f+")",m=Fh({className:"subject",data:{radius:c}});m.attrs.transform=g,m.attrs.fill=a.color,m.attrs["stroke-linecap"]="round",m.attrs["stroke-width"]="3px";var v=Fh({className:"subject-ring",data:{outerRadius:c,innerRadius:u}});v.attrs.transform=g,v.attrs["stroke-width"]="3px",v.attrs.fill="white";var _=void 0;if(h&&f||!h&&!f)_=Ph({className:"subject-pointer",data:[[0,0],[h||0,0],[0,f||0],[0,0]]});else if(h||f){var y=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t&&t/Math.sqrt(2)/Math.sqrt(2)||e*c/Math.sqrt(2)};_=Ph({className:"subject-pointer",data:[[0,0],[y(h),y(f)],[y(h,-1),y(f,-1)],[0,0]]})}if(_&&(_.attrs.fill=a.color,_.attrs["stroke-linecap"]="round",_.attrs["stroke-width"]="3px",l.push(_)),i.editMode){var x={x:2*h,y:2*f,drag:function(){n.x=Rc.x<2*-c?"left":Rc.x>2*c?"right":void 0,n.y=Rc.y<2*-c?"top":Rc.y>2*c?"bottom":void 0,i.redrawSubject()}.bind(i)};x.x||x.y||(x.y=-c),s=i.mapHandles([x])}var b=void 0;return n.text&&(b={type:"text",className:"badge-text",attrs:{fill:"white",stroke:"none","font-size":".7em",text:n.text,"text-anchor":"middle",dy:".25em",x:h,y:f}}),l.push(m),l.push(v),l.push(b),{components:l,handles:s}}(i,this.annotation));var o=a,s=o.components,l=void 0===s?[]:s,c=o.handles,u=void 0===c?[]:c;return l.forEach(function(e){e&&e.attrs&&!e.attrs.stroke&&(e.attrs.stroke=t.annotation.color)}),this.editMode&&(u=u.concat(this.mapHandles([{drag:this.dragSubject.bind(this)}])),l.push({type:"handle",handles:u})),l}},{key:"drawConnector",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.annotation.connector,r=n.type||e.type,i={type:this,connectorData:n};i.subjectType=this.typeSettings&&this.typeSettings.subject&&this.typeSettings.subject.type;var a={};a="curve"===r?Nh(i):"elbow"===r?function(t){var e=t.type,n=t.subjectType,r=e.annotation,i=r.position,a=r.x-i.x,o=a+r.dx,s=r.y-i.y,l=s+r.dy,c=r.subject;if("rect"===n){var u=c.width,h=c.height;(u>0&&r.dx>0||u<0&&r.dx<0)&&(a=Math.abs(u)>Math.abs(r.dx)?u/2:u),(h>0&&r.dy>0||h<0&&r.dy<0)&&(s=Math.abs(h)>Math.abs(r.dy)?h/2:h),a===u/2&&s===h/2&&(a=o,s=l)}var f=[[a,s],[o,l]],d=l-s,p=o-a,g=o,m=l,v=l<s&&o>a||o<a&&l>s?-1:1;if(Math.abs(p)<Math.abs(d)?(g=o,m=s+p*v):(m=l,g=a+d*v),"circle"===n&&(c.outerRadius||c.radius)){var _=(c.outerRadius||c.radius)+(c.radiusPadding||0),y=_/Math.sqrt(2);if(Math.abs(p)>y&&Math.abs(d)>y)f=[[a=y*(o<0?-1:1),s=y*(l<0?-1:1)],[g,m],[o,l]];else if(Math.abs(p)>Math.abs(d)){var x=Math.asin(-l/_);f=[[a=Math.abs(Math.cos(x)*_)*(o<0?-1:1),l],[o,l]]}else{var b=Math.acos(o/_);f=[[o,s=Math.abs(Math.sin(b)*_)*(l<0?-1:1)],[o,l]]}}else f=[[a,s],[g,m],[o,l]];return{components:[Ph({data:f,className:"connector"})]}}(i):function(t){var e=Lh(t);return{components:[Ph({data:e,className:"connector"})]}}(i);var o=a,s=o.components,l=void 0===s?[]:s,c=o.handles,u=void 0===c?[]:c,h=l[0];h&&(h.attrs.stroke=this.annotation.color,h.attrs.fill="none");var f=n.end||e.end,d={};if("arrow"===f){var p=h.data[1],g=h.data[0];Math.sqrt(Math.pow(p[0]-g[0],2)+Math.pow(p[1]-g[1],2))<5&&h.data[2]&&(p=h.data[2]),d=function(t){var e=t.annotation,n=t.start,r=t.end,i=t.scale,a=void 0===i?1:i,o=e.position;n=n?[-r[0]+n[0],-r[1]+n[1]]:[e.dx,e.dy],r||(r=[e.x-o.x,e.y-o.y]);var s=r[0],l=r[1],c=n[0],u=n[1],h=10*a,f=16/180*Math.PI,d=Math.atan(u/c);c<0&&(d+=Math.PI);var p=[[s,l],[Math.cos(d+f)*h+s,Math.sin(d+f)*h+l],[Math.cos(d-f)*h+s,Math.sin(d-f)*h+l],[s,l]];return{components:[Ph({data:p,className:"connector-end connector-arrow",classID:"connector-end"})]}}({annotation:this.annotation,start:p,end:g,scale:n.endScale})}else"dot"===f?d=function(t){var e=t.line,n=t.scale,r=void 0===n?1:n,i=Fh({className:"connector-end connector-dot",classID:"connector-end",data:{radius:3*Math.sqrt(r)}});return i.attrs.transform="translate("+e.data[0][0]+", "+e.data[0][1]+")",{components:[i]}}({line:h,scale:n.endScale}):f&&"none"!==f||this.connector&&this.connector.select(".connector-end").remove();return d.components&&(d.components.forEach(function(e){e.attrs.fill=t.annotation.color,e.attrs.stroke=t.annotation.color}),l=l.concat(d.components)),this.editMode&&0!==u.length&&l.push({type:"handle",handles:u}),l}},{key:"drawNote",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.annotation.note,r=n.align||e.align||"dynamic",i={bbox:e.bbox,align:r,offset:this.annotation.offset},a=n.lineType||e.lineType,o={};"vertical"===a?o=function(t){var e=t.align,n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i,o=t.bbox,s=t.offset;"top"===(e=Eh(e,s.y))?a-=o.height:"middle"===e&&(a-=o.height/2);var l=[[r,a],[r,a+o.height]];return{components:[Ph({data:l,className:"note-line"})]}}(i):"horizontal"===a&&(o=function(t){var e=t.align,n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i,o=t.offset,s=t.bbox;"right"===(e=kh(e,o.x))?r-=s.width:"middle"===e&&(r-=s.width/2);var l=[[r,a],[r+s.width,a]];return{components:[Ph({data:l,className:"note-line"})]}}(i));var s=o,l=s.components,c=void 0===l?[]:l,u=s.handles,h=void 0===u?[]:u;if(c.forEach(function(e){e.attrs.stroke=t.annotation.color}),this.editMode){h=this.mapHandles([{x:0,y:0,drag:this.dragNote.bind(this)}]),c.push({type:"handle",handles:h});var f=this.dragNote.bind(this),d=this.dragstarted.bind(this),p=this.dragended.bind(this);this.note.call(yu().container(Kc("g.annotations").node()).on("start",function(t){return d(t)}).on("drag",function(t){return f(t)}).on("end",function(t){return p(t)}))}else this.note.on("mousedown.drag",null);return c}},{key:"drawNoteContent",value:function(t){var e=this.annotation.note,n=void 0!==e.padding?e.padding:this.notePadding,r=e.orientation||t.orientation||"topBottom",i=e.lineType||t.lineType,a=e.align||t.align||"dynamic";"vertical"===i?r="leftRight":"horizontal"===i&&(r="topBottom");var o=function(t){var e=t.padding,n=void 0===e?0:e,r=t.bbox,i=void 0===r?{x:0,y:0,width:0,height:0}:r,a=t.align,o=t.orientation,s=t.offset,l=void 0===s?{x:0,y:0}:s,c=-i.x,u=0;return-1!==Ah.indexOf(o)?(a=kh(a,l.x),l.y<0&&"topBottom"===o||"top"===o?u-=i.height+n:u+=n,"middle"===a?c-=i.width/2:"right"===a&&(c-=i.width)):-1!==Th.indexOf(o)&&(a=Eh(a,l.y),l.x<0&&"leftRight"===o||"left"===o?c-=i.width+n:c+=n,"middle"===a?u-=i.height/2:"top"===a&&(u-=i.height)),{x:c,y:u}}({padding:n,bbox:t.bbox,offset:this.annotation.offset,orientation:r,align:a}),s=o.x,l=o.y;return this.offsetCornerX=s+this.annotation.dx,this.offsetCornerY=l+this.annotation.dy,this.note&&this.noteContent.attr("transform","translate("+s+", "+l+")"),[]}},{key:"drawOnScreen",value:function(t,e){return this.drawOnSVG(t,e)}},{key:"redrawSubject",value:function(){this.subject&&this.drawOnScreen(this.subject,this.drawSubject())}},{key:"redrawConnector",value:function(){this.connector&&this.drawOnScreen(this.connector,this.drawConnector())}},{key:"redrawNote",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getNoteBBox();this.noteContent&&this.drawOnScreen(this.noteContent,this.drawNoteContent({bbox:t})),this.note&&this.drawOnScreen(this.note,this.drawNote({bbox:t}))}},{key:"setPosition",value:function(){var t=this.annotation.position;this.a.attr("transform","translate("+t.x+", "+t.y+")")}},{key:"clearComponents",value:function(){this.subject&&this.subject.select("*").remove(),this.connector&&this.connector.select("*").remove()}},{key:"setOffset",value:function(){if(this.note){var t=this.annotation.offset;this.note.attr("transform","translate("+t.x+", "+t.y+")")}}},{key:"setPositionWithAccessors",value:function(t){t&&this.annotation.data&&(this.mapX(t),this.mapY(t)),this.setPosition()}},{key:"setClassName",value:function(){this.a.attr("class","annotation "+(this.className&&this.className())+" "+(this.editMode?"editable":"")+" "+(this.annotation.className||""))}},{key:"draw",value:function(){this.setClassName(),this.setPosition(),this.setOffset(),this.redrawSubject(),this.redrawConnector(),this.redrawNote()}},{key:"dragstarted",value:function(){Rc.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(){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(){var t=this.annotation.position;t.x+=Rc.dx,t.y+=Rc.dy,this.annotation.position=t}},{key:"dragNote",value:function(){var t=this.annotation.offset;t.x+=Rc.dx,t.y+=Rc.dy,this.annotation.offset=t}},{key:"mapHandles",value:function(t){var e=this;return t.map(function(t){return xh({},t,{start:e.dragstarted.bind(e),end:e.dragended.bind(e)})})}}]),t}(),Ih=function(t,e,n){return function(t){function r(t){_h(this,r);var n=Mh(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t));return n.typeSettings=e,e.disable&&e.disable.forEach(function(t){n[t]&&n[t].remove(),n[t]=void 0,"note"===t&&(n.noteContent=void 0)}),n}return wh(r,t),yh(r,[{key:"className",value:function(){return""+(e.className||bh(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"className",this)&&bh(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"className",this).call(this)||"")}},{key:"drawSubject",value:function(t){return this.typeSettings.subject=xh({},e.subject,this.typeSettings.subject),bh(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"drawSubject",this).call(this,xh({},t,this.typeSettings.subject))}},{key:"drawConnector",value:function(t){return this.typeSettings.connector=xh({},e.connector,this.typeSettings.connector),bh(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"drawConnector",this).call(this,xh({},t,e.connector,this.typeSettings.connector))}},{key:"drawNote",value:function(t){return this.typeSettings.note=xh({},e.note,this.typeSettings.note),bh(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"drawNote",this).call(this,xh({},t,e.note,this.typeSettings.note))}},{key:"drawNoteContent",value:function(t){return bh(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"drawNoteContent",this).call(this,xh({},t,e.note,this.typeSettings.note))}}],[{key:"init",value:function(t,e){return bh(r.__proto__||Object.getPrototypeOf(r),"init",this).call(this,t,e),n&&(t=n(t,e)),t}}]),r}(t)},Gh=function(t){function e(t){_h(this,e);var n=Mh(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.textWrap=t.textWrap||120,n.drawText(),n}return wh(e,t),yh(e,[{key:"updateTextWrap",value:function(t){this.textWrap=t,this.drawText()}},{key:"drawText",value:function(){if(this.note){Hh(this.note,[this.annotation],"g","annotation-note-content");var t=this.note.select("g.annotation-note-content");Hh(t,[this.annotation],"rect","annotation-note-bg"),Hh(t,[this.annotation],"text","annotation-note-label"),Hh(t,[this.annotation],"text","annotation-note-title");var e={height:0},n=this.a.select("text.annotation-note-label"),r=this.annotation.note&&this.annotation.note.wrap||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrap||this.textWrap,i=this.annotation.note&&this.annotation.note.wrapSplitter||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrapSplitter,a=this.annotation.note&&this.annotation.note.bgPadding||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.bgPadding,o={top:0,bottom:0,left:0,right:0};if("number"==typeof a?o={top:a,bottom:a,left:a,right:a}:a&&"object"===(void 0===a?"undefined":vh(a))&&(o=xh(o,a)),this.annotation.note.title){var s=this.a.select("text.annotation-note-title");s.text(this.annotation.note.title),s.attr("fill",this.annotation.color),s.attr("font-weight","bold"),s.call(Yh,r,i),e=s.node().getBBox()}n.text(this.annotation.note.label).attr("dx","0"),n.call(Yh,r,i),n.attr("y",1.1*e.height||0),n.attr("fill",this.annotation.color);var l=this.getNoteBBox();this.a.select("rect.annotation-note-bg").attr("width",l.width+o.left+o.right).attr("height",l.height+o.top+o.bottom).attr("x",l.x-o.left).attr("y",-o.top).attr("fill","white").attr("fill-opacity",0)}}}]),e}(zh),jh=Ih(Gh,{className:"label",note:{align:"middle"}}),Rh=Ih(Gh,{className:"callout",note:{lineType:"horizontal"}}),Bh=(Ih(Rh,{className:"callout elbow",connector:{type:"elbow"}}),Ih(Rh,{className:"callout curve",connector:{type:"curve"}}),Ih(zh,{className:"badge",subject:{type:"badge"},disable:["connector","note"]}),Ih(Gh,{className:"callout circle",subject:{type:"circle"},note:{lineType:"horizontal"},connector:{type:"elbow"}})),Wh=Ih(Gh,{className:"callout rect",subject:{type:"rect"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),qh=function(t){function e(){return _h(this,e),Mh(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return wh(e,t),yh(e,[{key:"mapY",value:function(t){bh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"mapY",this).call(this,t);var n=this.annotation;(n.subject.x1||n.subject.x2)&&n.data&&t.y&&(n.y=t.y(n.data)),!n.subject.x1&&!n.subject.x2||n.x||(n.x=n.subject.x1||n.subject.x2)}},{key:"mapX",value:function(t){bh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"mapX",this).call(this,t);var n=this.annotation;(n.subject.y1||n.subject.y2)&&n.data&&t.x&&(n.x=t.x(n.data)),!n.subject.y1&&!n.subject.y2||n.y||(n.y=n.subject.y1||n.subject.y2)}}]),e}(Rh),Uh=Ih(qh,{className:"callout xythreshold",subject:{type:"threshold"}}),Hh=function(t,e,n,r,i){var a=t.selectAll(n+"."+(i||r)).data(e);return a.enter().append(n).merge(a).attr("class",r),a.exit().remove(),t},Vh=function(t,e,n){var r=n.component,i=n.name;r&&r.on("mouseover.annotations",function(){t.call(i+"over",r,e)}).on("mouseout.annotations",function(){return t.call(i+"out",r,e)}).on("click.annotations",function(){return t.call(i+"click",r,e)})},Yh=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1.2;t.each(function(){for(var t=Kc(this),i=t.text().split(n||/[ \t\r\n]+/).reverse().filter(function(t){return""!==t}),a=void 0,o=[],s=t.text(null).append("tspan").attr("x",0).attr("dy","0.8em");a=i.pop();)o.push(a),s.text(o.join(" ")),s.node().getComputedTextLength()>e&&o.length>1&&(o.pop(),s.text(o.join(" ")),o=[a],s=t.append("tspan").attr("x",0).attr("dy",r+"em").text(a))})},$h=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:":not(.handle)";return t?t.selectAll(e).nodes().reduce(function(t,e){var n=e.getBBox();t.x=Math.min(t.x,n.x),t.y=Math.min(t.y,n.y),t.width=Math.max(t.width,n.width);var r=e&&e.attributes&&e.attributes.y;return t.height=Math.max(t.height,(r&&parseFloat(r.value)||0)+n.height),t},{x:0,y:0,width:0,height:0}):{x:0,y:0,width:0,height:0}};function Xh(){var t=[],e=void 0,n=void 0,r=[],i={},a={},o=!1,s=void 0,l=Rh,c=void 0,u=void 0,h=uu("subjectover","subjectout","subjectclick","connectorover","connectorout","connectorclick","noteover","noteout","noteclick","dragend","dragstart"),f=void 0,d=function(n){f=n,o||n.selectAll("circle.handle").remove();var d=t.map(function(t){return t.type||(t.type=l),t.disable||(t.disable=r),new Sh(t)});e=e||new Ch({annotations:d,accessors:i,accessorsInverse:a,ids:s}),n.selectAll("g").data([e]).enter().append("g").attr("class","annotations");var p=n.select("g.annotations");Hh(p,e.annotations,"g","annotation");var g=p.selectAll("g.annotation");g.each(function(t){var e=Kc(this);e.attr("class","annotation"),Hh(e,[t],"g","annotation-connector"),Hh(e,[t],"g","annotation-subject"),Hh(e,[t],"g","annotation-note"),Hh(e.select("g.annotation-note"),[t],"g","annotation-note-content"),t.type="[object Object]"===t.type.toString()?t.type:new t.type({a:e,annotation:t,textWrap:c,notePadding:u,editMode:o,dispatcher:h,accessors:i}),t.type.draw(),t.type.drawText&&t.type.drawText()})};return d.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.",e.json),window.copy(JSON.stringify(e.json.map(function(t){return delete t.type,t}))),d},d.update=function(){return t&&e&&(t=e.annotations.map(function(t){return t.type.draw(),t})),d},d.updateText=function(){return e&&(e.updateText(c),t=e.annotations),d},d.updatedAccessors=function(){return e.setPositionWithAccessors(),t=e.annotations,d},d.disable=function(n){return arguments.length?(r=n,e&&(e.updateDisable(r),t=e.annotations),d):r},d.textWrap=function(n){return arguments.length?(c=n,e&&(e.updateTextWrap(c),t=e.annotations),d):c},d.notePadding=function(n){return arguments.length?(u=n,e&&(e.updateNotePadding(u),t=e.annotations),d):u},d.type=function(n,r){return arguments.length?(l=n,e&&(e.annotations.map(function(t){t.type.note&&t.type.note.selectAll("*:not(.annotation-note-content)").remove(),t.type.noteContent&&t.type.noteContent.selectAll("*").remove(),t.type.subject&&t.type.subject.selectAll("*").remove(),t.type.connector&&t.type.connector.selectAll("*").remove(),t.type.typeSettings={},t.type=l,t.subject=r&&r.subject||t.subject,t.connector=r&&r.connector||t.connector,t.note=r&&r.note||t.note}),t=e.annotations),d):l},d.annotations=function(n){if(!arguments.length)return e&&e.annotations||t;(t=n,e&&e.annotations)&&(t.some(function(t){return!t.type||"[object Object]"!==t.type.toString()})?(e=null,d(f)):e.annotations=t);return d},d.context=function(t){return arguments.length?(n=t,d):n},d.accessors=function(t){return arguments.length?(i=t,d):i},d.accessorsInverse=function(t){return arguments.length?(a=t,d):a},d.ids=function(t){return arguments.length?(s=t,d):s},d.editMode=function(n){return arguments.length?(o=n,f&&f.selectAll("g.annotation").classed("editable",o),e&&(e.editMode(o),t=e.annotations),d):o},d.collection=function(t){return arguments.length?(e=t,d):e},d.on=function(){var t=h.on.apply(h,arguments);return t===h?d:t},d}function Jh(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Zh(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Jh(Object(n),!0).forEach(function(e){Ji(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Jh(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Kh(t){if(t.svg_){var e=t.svg_.select("#em-zoom-group-"+t.svgId_);e.selectAll(".em-annotations").remove();var n=t.annotations_;if(n){var r={annotationLabel:jh,annotationCallout:Rh,annotationCalloutRect:Wh,annotationCalloutCircle:Bh,annotationXYThreshold:Uh},i=n.annotations.map(function(t){var e=r[t.type]||jh;return Zh(Zh({},t),{},{type:e})}),a=Xh().type(jh).annotations(i).editMode(n.editMode);e.append("g").attr("id","em-annotations").attr("class","em-annotations").call(a)}}}var Qh=function(t,e){var n,r;t.labels_.config||(t.labels_.config=af),t.labels_.statLabelsPositions||(t.labels_.statLabelsPositions=of),t._statLabelFormatter=t.labels_.valuesFormatter?t.labels_.valuesFormatter:Ri;var i=e.select("#em-labels"),a=i.empty()?e.append("g").attr("id","em-labels").attr("class","em-labels"):i;null!==(n=t.labels_)&&void 0!==n&&n.values&&"ps"!==t._mapType&&rf(t,a);var o=(null===(r=t.labels_)||void 0===r?void 0:r.labels)||af["".concat(t.geo,"_").concat(t.proj_,".cc")];if(o){var s,l=Oi(a,"em-label-shadows"),c=Oi(a,"em-labels");if(null!==(s=t.labels_)&&void 0!==s&&s.shadows)l.selectAll("text").data(o).enter().append("text").attr("id",function(t){return"em-label-shadow-"+t.text.replace(/\s+/g,"-")}).attr("class",function(t){return"em-label-shadow em-label-shadow-"+t.class}).attr("x",function(e){return e.rotate?0:t._projection([e.x,e.y])[0]}).attr("y",function(e){return e.rotate?0:t._projection([e.x,e.y])[1]}).attr("dy",-7).attr("transform",function(e){if(e.rotate){var n=t._projection([e.x,e.y]),r=n[0],i=n[1];return"translate(".concat(r,",").concat(i,") rotate(").concat(e.rotate,")")}return"rotate(0)"}).text(function(t){return t.text});c.selectAll("text").data(o).enter().append("text").attr("id",function(t){return"em-label-"+t.text.replace(/\s+/g,"-")}).attr("class",function(t){return"em-label em-label-"+t.class}).attr("x",function(e){return e.rotate?0:t._projection([e.x,e.y])[0]}).attr("y",function(e){return e.rotate?0:t._projection([e.x,e.y])[1]}).attr("dy",-7).attr("transform",function(e){if(e.rotate){var n=t._projection([e.x,e.y]),r=n[0],i=n[1];return"translate(".concat(r,",").concat(i,") rotate(").concat(e.rotate,")")}return"rotate(0)"}).text(function(t){return t.text})}};var tf=function(t){var e,n,r;if(t){t.svg_.selectAll("g.em-stat-label > *").remove(),t.svg_.selectAll("g.em-stat-label-shadow > *").remove();var i=t.svg_.selectAll("g.em-stat-label"),a=null!==(e=t.labels_)&&void 0!==e&&e.statLabelsFilterFunction?null===(n=t.labels_)||void 0===n?void 0:n.statLabelsFilterFunction:nf,o=t.statData();return i.filter(function(e){return a(e,t)}).each(function(e){var n=Nt(this),r=ef(e,o,t);t.labels_.backgrounds&&function(t,e){var n=5,r=2,i=e.append("text").attr("visibility","hidden").text(t).node().getBBox(),a=i.width,o=i.height;e.select('text[visibility="hidden"]').remove();var s=-a/2-n,l=-o/2-r;e.append("rect").attr("x",s).attr("y",l).attr("width",a+2*n).attr("height",o+2*r).attr("class","em-label-background")}(r,n),n.append("text").text(r).attr("class","em-stat-label-text")}),null!==(r=t.labels_)&&void 0!==r&&r.shadows&&t.svg_.selectAll("g.em-stat-label-shadow").filter(function(e){return a(e,t)}).append("text").text(function(e){return ef(e,o,t)}),t}console.warn("No map specified")},ef=function(t,e,n){if(e&&null!=e&&e.get){var r=e.get(t.properties.id);if(!r||!r.value&&0!==r&&0!==r.value)return"";if(":"!==r.value)return n._statLabelFormatter?n._statLabelFormatter(r.value):Ri(r.value)}},nf=function(t,e){var n=e.statData().get(t.properties.id);return!(!n||!n.value&&0!==n&&0!==n.value)},rf=function(t,e){var n,r=Oi(e,"em-stat-labels-shadows"),i=Oi(e,"em-stat-labels"),a=t.Geometries.getAllRegionFeatures(),o=a.filter(function(t,e,n){return e===n.findIndex(function(e){return e.properties.id===t.properties.id})});i.selectAll("g").data(o).enter().append("g").attr("transform",function(e){if(t.labels_.statLabelsPositions[e.properties.id]){var n=t.labels_.statLabelsPositions[e.properties.id],r=t._projection([n.x,n.y]),i=r[0].toFixed(3),a=r[1].toFixed(3);return"translate(".concat(i,",").concat(a,")")}var o=t._pathFunction.centroid(e);return t.labels_.processValueLabelCentroids&&(o=t.labels_.processValueLabelCentroids(e,o)),"translate("+o+")"}).attr("class","em-stat-label"),null!==(n=t.labels_)&&void 0!==n&&n.shadows&&r.selectAll("g").data(a).enter().append("g").attr("transform",function(e){if(t.labels_.statLabelsPositions[e.properties.id]){var n=t._projection([t.labels_.statLabelsPositions[e.properties.id].x,t.labels_.statLabelsPositions[e.properties.id].y]),r=n[0].toFixed(3),i=n[1].toFixed(3);return"translate(".concat(r,",").concat(i,")")}var a=t._pathFunction.centroid(e);return t.labels_.processValueLabelCentroids&&(a=t.labels_.processValueLabelCentroids(e,a)),"translate("+a+")"}).attr("class","em-stat-label-shadow")},af={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:206e4,class:"countries",size:7,rotate:80},{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:412e4,y:294e4,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:53e5,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"}],fr:[{text:"MER MÉDITERRANÉE",x:5472e3,y:1242e3,class:"seas",size:12},{text:"OCÈAN ATLANTIQUE",x:282e4,y:254e4,class:"seas",size:12},{text:"MER DU NORD",x:3915e3,y:37e5,class:"seas",size:12},{text:"MER BALTIQUE",x:49e5,y:3672e3,class:"seas",size:10,rotate:-50},{text:"MER DE NORVÈGE",x:385e4,y:48e5,class:"seas",size:12},{text:"MER NOIRE",x:6265e3,y:2472e3,class:"seas",size:12},{text:"ALBANIE",x:51e5,y:206e4,class:"countries",size:7,rotate:80},{text:"AUTRICHE",x:467e4,y:2629e3,class:"countries",size:10},{text:"BELGIQUE",x:39e5,y:303e4,class:"countries",size:7,rotate:30},{text:"BULGARIE",x:5567e3,y:2256e3,class:"countries",size:12},{text:"CROATIE",x:4876e3,y:2455e3,class:"countries",size:7},{text:"CHYPRE",x:6426e3,y:148e4,class:"countries",size:10},{text:"TCHÉQUIE",x:4707e3,y:2885e3,class:"countries",size:12},{text:"DANEMARK",x:4316e3,y:3621e3,class:"countries",size:10},{text:"ESTONIE",x:522e4,y:399e4,class:"countries",size:10},{text:"FINLANDE",x:5125e3,y:4424e3,class:"countries",size:12},{text:"FRANCE",x:3767740,y:2662817,class:"countries",size:12},{text:"ALLEMAGNE",x:4347284,y:3093276,class:"countries",size:12},{text:"GRÈCE",x:542e4,y:186e4,class:"countries",size:12},{text:"HONGRIE",x:502e4,y:2654e3,class:"countries",size:10},{text:"ISLANDE",x:304e4,y:4833e3,class:"countries",size:10},{text:"IRLANDE",x:3136e3,y:3394e3,class:"countries",size:10},{text:"ITALIE",x:45e5,y:2181963,class:"countries",size:12},{text:"LETTONIE",x:529e4,y:3776e3,class:"countries",size:10},{text:"LITUANIE",x:519e4,y:363e4,class:"countries",size:10},{text:"LUX.",x:412e4,y:294e4,class:"countries",size:7},{text:"MALTE",x:4731e3,y:1335e3,class:"countries",size:7},{text:"MONT.",x:5073e3,y:2185e3,class:"countries",size:7},{text:"MAC. DU NORD",x:53e5,y:2082e3,class:"countries",size:7},{text:"PAYS-BAS",x:3977e3,y:3208e3,class:"countries",size:7},{text:"NORVEGE",x:433e4,y:4147e3,class:"countries",size:12,rotate:-75},{text:"POLOGNE",x:4964e3,y:3269e3,class:"countries",size:12},{text:"PORTUGAL",x:2836136,y:1956179,class:"countries",size:10,rotate:-75},{text:"ROUMANIE",x:5451e3,y:26e5,class:"countries",size:12},{text:"SERBIE",x:52e5,y:23e5,class:"countries",size:7},{text:"SLOVAQUIE",x:504e4,y:2835e3,class:"countries",size:7,rotate:-30},{text:"SLOVÉNIE",x:4735e3,y:2522e3,class:"countries",size:7,rotate:-35},{text:"ESPAGNE",x:3160096,y:185e4,class:"countries",size:12},{text:"SUÈDE",x:47e5,y:4401e3,class:"countries",size:12,rotate:-75},{text:"SUISSE",x:42e5,y:2564e3,class:"countries",size:7},{text:"TURQUIE",x:651e4,y:21e5,class:"countries",size:12},{text:"ROYAUME-UNI",x:3558e3,y:325e4,class:"countries",size:10}],de:[{text:"MITTELMEER",x:5472e3,y:12e5,class:"seas",size:12,letterSpacing:7},{text:"ATLANTISCHER OZEAN",x:282e4,y:254e4,class:"seas",size:12},{text:"NORDSEE",x:3915e3,y:37e5,class:"seas",size:12},{text:"OSTSEE",x:49e5,y:3672e3,class:"seas",size:10,rotate:-50},{text:"NORWEGISCHE MEER",x:385e4,y:48e5,class:"seas",size:12},{text:"SCHWARZE MEER",x:63e5,y:25e5,class:"seas",size:12,letterSpacing:1},{text:"ALBANIEN",x:51e5,y:206e4,class:"countries",size:7,rotate:80},{text:"ÖSTERREICH",x:465e4,y:2629e3,class:"countries",size:7},{text:"BELGIEN",x:39e5,y:303e4,class:"countries",size:7,rotate:30},{text:"BULGARIEN",x:5567e3,y:2256e3,class:"countries",size:10},{text:"KROATIEN",x:4876e3,y:2455e3,class:"countries",size:7},{text:"ZYPERN",x:6426e3,y:148e4,class:"countries",size:10},{text:"TSCHECHIEN",x:4707e3,y:2885e3,class:"countries",size:7},{text:"DÄNEMARK",x:4316e3,y:3621e3,class:"countries",size:10},{text:"ESTLAND",x:522e4,y:399e4,class:"countries",size:7},{text:"FINNLAND",x:515e4,y:4424e3,class:"countries",size:12},{text:"FRANKREICH",x:3767740,y:2662817,class:"countries",size:12},{text:"DEUTSCHLAND",x:4347284,y:3093276,class:"countries",size:10},{text:"GRIECHENLAND",x:555e4,y:15e5,class:"countries",size:10},{text:"UNGARN",x:502e4,y:263e4,class:"countries",size:10},{text:"ISLAND",x:304e4,y:4833e3,class:"countries",size:10},{text:"IRLAND",x:3136e3,y:3394e3,class:"countries",size:10},{text:"ITALIEN",x:4469967,y:2181963,class:"countries",size:12,rotate:35},{text:"LETTLAND",x:529e4,y:38e5,class:"countries",size:7},{text:"LITAUEN",x:519e4,y:363e4,class:"countries",size:7},{text:"LUX.",x:412e4,y:294e4,class:"countries",size:7},{text:"MALTA",x:4731e3,y:133e4,class:"countries",size:7},{text:"MONT.",x:5073e3,y:2185e3,class:"countries",size:7},{text:"NORDMAZEDONIEN",x:535e4,y:2082e3,class:"countries",size:7},{text:"NIEDERLANDE",x:3977e3,y:3208e3,class:"countries",size:7},{text:"NORWEGEN",x:433e4,y:4147e3,class:"countries",size:12,rotate:-75},{text:"POLEN",x:4964e3,y:3269e3,class:"countries",size:12},{text:"PORTUGAL",x:2836136,y:1956179,class:"countries",size:10,rotate:-75},{text:"RUMÄNIEN",x:5451e3,y:26e5,class:"countries",size:12},{text:"SERBIEN",x:52e5,y:23e5,class:"countries",size:7},{text:"SLOWAKEI",x:504e4,y:2835e3,class:"countries",size:7,rotate:-30},{text:"SLOWENIEN",x:4735e3,y:2522e3,class:"countries",size:7,rotate:-30},{text:"SPANIEN",x:3160096,y:185e4,class:"countries",size:12},{text:"SCHWEDEN",x:467e4,y:418e4,class:"countries",size:12,rotate:-75},{text:"SCHWEIZ",x:42e5,y:2564e3,class:"countries",size:7},{text:"TRUTHAHN",x:651e4,y:21e5,class:"countries",size:12},{text:"VEREINIGTES",x:355e4,y:352e4,class:"countries",size:10},{text:"KÖNIGREICH",x:355e4,y:342e4,class:"countries",size:10}]},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}],fr:[{text:"Les îles Canaries",x:420468,y:3180647,class:"countries",size:12}],de:[{text:"Kanarische Inseln",x:41e4,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}],de:[{text:"Guayana",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}],fr:[{text:"Açores",x:397418,y:4271471,class:"countries",size:10}],de:[{text:"Azoren",x:397418,y:4271471,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}],fr:[{text:"Madère",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}],fr:[{text:"Islande",x:3011804,y:496e4,class:"countries",size:12}],de:[{text:"Island",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}],de:[{text:"Spitzbergen",x:457e4,y:626e4,class:"countries",size:7}]},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}]}},of={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 sf(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function lf(t,e){return fetch(t,e).then(sf)}function cf(t){return t}function uf(t,e){return"string"==typeof e&&(e=t.objects[e]),"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map(function(e){return hf(t,e)})}:hf(t,e)}function hf(t,e){var n=e.id,r=e.bbox,i=null==e.properties?{}:e.properties,a=function(t,e){var n=function(t){if(null==t)return cf;var e,n,r=t.scale[0],i=t.scale[1],a=t.translate[0],o=t.translate[1];return function(t,s){s||(e=n=0);var l=2,c=t.length,u=new Array(c);for(u[0]=(e+=t[0])*r+a,u[1]=(n+=t[1])*i+o;l<c;)u[l]=t[l],++l;return u}}(t.transform),r=t.arcs;function i(t,e){e.length&&e.pop();for(var i=r[t<0?~t:t],a=0,o=i.length;a<o;++a)e.push(n(i[a],a));t<0&&function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n}(e,o)}function a(t){return n(t)}function o(t){for(var e=[],n=0,r=t.length;n<r;++n)i(t[n],e);return e.length<2&&e.push(e[0]),e}function s(t){for(var e=o(t);e.length<4;)e.push(e[0]);return e}function l(t){return t.map(s)}function c(t){var e,n=t.type;switch(n){case"GeometryCollection":return{type:n,geometries:t.geometries.map(c)};case"Point":e=a(t.coordinates);break;case"MultiPoint":e=t.coordinates.map(a);break;case"LineString":e=o(t.arcs);break;case"MultiLineString":e=t.arcs.map(o);break;case"Polygon":e=l(t.arcs);break;case"MultiPolygon":e=t.arcs.map(l);break;default:return null}return{type:n,coordinates:e}}return c(e)}(t,e);return null==n&&null==r?{type:"Feature",properties:i,geometry:a}:null==r?{type:"Feature",id:n,properties:i,geometry:a}:{type:"Feature",id:n,bbox:r,properties:i,geometry:a}}var ff={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 df(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a}function pf(t,e,n){var r=df(t,e-Qi,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function gf(t,e,n){var r=df(t,e-Qi,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function mf(){var t,e,n,r,i,a,o,s,l,c,u,h,f=10,d=f,p=90,g=360,m=2.5;function v(){return{type:"MultiLineString",coordinates:_()}}function _(){return df(ha(r/p)*p,n,p).map(u).concat(df(ha(s/g)*g,o,g).map(h)).concat(df(ha(e/f)*f,t,f).filter(function(t){return sa(t%p)>Qi}).map(l)).concat(df(ha(a/d)*d,i,d).filter(function(t){return sa(t%g)>Qi}).map(c))}return v.lines=function(){return _().map(function(t){return{type:"LineString",coordinates:t}})},v.outline=function(){return{type:"Polygon",coordinates:[u(r).concat(h(o).slice(1),u(n).reverse().slice(1),h(s).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],r>n&&(t=r,r=n,n=t),s>o&&(t=s,s=o,o=t),v.precision(m)):[[r,s],[n,o]]},v.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],a=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),a>i&&(n=a,a=i,i=n),v.precision(m)):[[e,a],[t,i]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],v):[p,g]},v.stepMinor=function(t){return arguments.length?(f=+t[0],d=+t[1],v):[f,d]},v.precision=function(f){return arguments.length?(m=+f,l=pf(a,i,90),c=gf(e,t,m),u=pf(s,o,90),h=gf(r,n,m),v):m},v.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function vf(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function _f(t,e){let n;return(r,i)=>(()=>{if(n)return n;const r=indexedDB.open(t);return r.onupgradeneeded=()=>r.result.createObjectStore(e),n=vf(r),n.then(t=>{t.onclose=()=>n=void 0},()=>{}),n})().then(t=>i(t.transaction(e,r).objectStore(e)))}let yf;function xf(){return yf||(yf=_f("keyval-store","keyval")),yf}function bf(t,e=xf()){return e("readonly",e=>vf(e.get(t)))}function wf(t,e,n=xf()){return n("readwrite",n=>(n.put(e,t),vf(n.transaction)))}var Mf=new Map,Sf=864e5;function Cf(){return"undefined"!=typeof window&&((!0===window.isSecureContext||"localhost"===location.hostname||"127.0.0.1"===location.hostname)&&"undefined"!=typeof indexedDB)}function Ef(t){return kf.apply(this,arguments)}function kf(){return kf=Zn(Qn().mark(function t(e){var n;return Qn().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(Cf()){t.next=1;break}return t.abrupt("return",null);case 1:return t.prev=1,t.next=2,bf(e);case 2:return t.abrupt("return",t.sent);case 3:return t.prev=3,n=t.catch(1),console.warn("[IDB] read skipped:",(null==n?void 0:n.name)||n),t.abrupt("return",null);case 4:case"end":return t.stop()}},t,null,[[1,3]])})),kf.apply(this,arguments)}function Af(t,e){return Tf.apply(this,arguments)}function Tf(){return Tf=Zn(Qn().mark(function t(e,n){var r;return Qn().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(Cf()){t.next=1;break}return t.abrupt("return",!1);case 1:return t.prev=1,t.next=2,wf(e,n);case 2:return t.abrupt("return",!0);case 3:return t.prev=3,r=t.catch(1),console.warn("[IDB] write skipped:",(null==r?void 0:r.name)||r),t.abrupt("return",!1);case 4:case"end":return t.stop()}},t,null,[[1,3]])})),Tf.apply(this,arguments)}var Pf=function(t,e){var n={};return n.defaultGeoData=void 0,n.allNUTSGeoData=void 0,n.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},n.userGeometries=void 0,n.statisticalRegions=void 0,n.centroidsData=void 0,n.centroidsFeatures=void 0,n._allCentroidsFeatures=void 0,n.getRegionFeatures=function(){return"WORLD"==t.geo_?n.geoJSONs.worldrg:"mixed"===t.nutsLevel_?[n.geoJSONs.mixed.rg0,n.geoJSONs.mixed.rg1,n.geoJSONs.mixed.rg2,n.geoJSONs.mixed.rg3]:n.geoJSONs.nutsrg.concat(n.geoJSONs.cntrg)},n.getDefaultGeoData=function(t,r,i){var a=n.getDefaultGeoDataPromise();return Promise.all(a).then(function(a){var o="function"==typeof r?r(a):a;return n.allNUTSGeoData=o,n.defaultGeoData=o[0],e&&(n.centroidsData="mixed"===i?[o[4],o[5],o[6],o[7]]:o[1]),"WORLD"===t?(n.geoJSONs.worldrg=uf(n.defaultGeoData,n.defaultGeoData.objects.CNTR_RG_20M_2020_4326).features,n.geoJSONs.worldbn=uf(n.defaultGeoData,n.defaultGeoData.objects.CNTR_BN_20M_2020_4326).features,n.geoJSONs.kosovo=uf(n.defaultGeoData,n.defaultGeoData.objects.NUTS_BN_20M_2021_RS_XK_border).features,n.geoJSONs.graticule=[mf().step([30,30])()]):(n.geoJSONs.graticule=uf(n.defaultGeoData,n.defaultGeoData.objects.gra).features,n.geoJSONs.nutsrg=uf(n.defaultGeoData,n.defaultGeoData.objects.nutsrg).features,n.geoJSONs.nutsbn=uf(n.defaultGeoData,n.defaultGeoData.objects.nutsbn).features,n.geoJSONs.cntrg=uf(n.defaultGeoData,n.defaultGeoData.objects.cntrg).features,n.geoJSONs.cntbn=uf(n.defaultGeoData,n.defaultGeoData.objects.cntbn).features),o}).catch(function(t){return Promise.reject(t)})},n.getDefaultGeoDataPromise=function(){var n=[0,1,2,3],r=[],i=function(t,e,n,r,i,a){var o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],s="".concat(t,"/").concat(e);return n&&"EUR"!==n&&"WORLD"!==n&&(s+="/".concat(n)),s+="/".concat("WORLD"==n?"4326":r),!o&&i&&(s+="/".concat(i)),s+="/".concat(o?"nutspt_":"").concat(a,".json")},a=function(){var t=Zn(Qn().mark(function t(e){var n,r,i,a,o;return Qn().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n="geojson-cache:".concat(e),!((r=Mf.get(n))&&Date.now()-r.timestamp<Sf)){t.next=1;break}return t.abrupt("return",r.data);case 1:return t.next=2,Ef(n);case 2:if(!((i=t.sent)&&Date.now()-i.timestamp<Sf)){t.next=3;break}return Mf.set(n,i),t.abrupt("return",i.data);case 3:return t.next=4,lf(e).catch(function(t){if(null!=i&&i.data)return i.data;throw new Error("Fetch failed for ".concat(e,": ").concat((null==t?void 0:t.message)||t))});case 4:return a=t.sent,o={timestamp:Date.now(),data:a},Mf.set(n,o),t.next=5,Af(n,o);case 5:return t.abrupt("return",a);case 6:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}();if(!t||!t.nuts2jsonBaseURL_)throw new Error("Missing required map context or configuration");if("mixed"===t.nutsLevel_&&"WORLD"!==t.geo_)n.forEach(function(e){var n=i(t.nuts2jsonBaseURL_,t.nutsYear_,t.geo_,t.proj_,t.scale_,e);r.push(a(n))}),e&&n.forEach(function(e){var n=i(t.nuts2jsonBaseURL_,t.nutsYear_,t.geo_,t.proj_,t.scale_,e,!0);r.push(a(n))});else if("WORLD"===t.geo_){var o=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";r.push(a(o))}else{var s=i(t.nuts2jsonBaseURL_,t.nutsYear_,t.geo_,t.proj_,t.scale_,t.nutsLevel_);if(r.push(a(s)),e){var l=i(t.nuts2jsonBaseURL_,t.nutsYear_,t.geo_,t.proj_,t.scale_,t.nutsLevel_,!0);r.push(a(l))}}return r},n.isGeoReady=function(){if(!n.defaultGeoData&&!n.userGeometries)return!1;var e=!0;return Wi(t.insetTemplates_,null,function(t){t.Geometries.isGeoReady()||(e=!1)}),e},n.setUserGeometries=function(t){var e=this;this.userGeometries=t,t.forEach(function(t){t.statisticalRegions&&(e.statisticalRegions=t)})},n.addDefaultGeometriesToMap=function(e,r,i,a,o,s,l,c){(this.geoJSONs.graticule&&r&&e.append("g").attr("id","em-graticule").attr("class","em-graticule").selectAll("path").data(this.geoJSONs.graticule).enter().append("path").attr("d",i),this.geoJSONs.cntrg&&e.append("g").attr("id","em-cntrg").attr("class","em-cntrg").selectAll("path").data(this.geoJSONs.cntrg).enter().append("path").attr("d",i).attr("id",function(t){var e=t.properties.id;if("RS"==e||"EL"==e)return"em-cntrg-"+e}),this.geoJSONs.worldrg&&e.append("g").attr("id","em-worldrg").attr("class","em-worldrg").selectAll("path").data(this.geoJSONs.worldrg).enter().append("path").attr("d",i),this.geoJSONs.nutsrg)&&("mixed"==a?(this.geoJSONs.mixed.rg0=this.geoJSONs.nutsrg,this.geoJSONs.mixed.rg1=uf(n.allNUTSGeoData[1],n.allNUTSGeoData[1].objects.nutsrg).features,this.geoJSONs.mixed.rg2=uf(n.allNUTSGeoData[2],n.allNUTSGeoData[2].objects.nutsrg).features,this.geoJSONs.mixed.rg3=uf(n.allNUTSGeoData[3],n.allNUTSGeoData[3].objects.nutsrg).features,[this.geoJSONs.mixed.rg0,this.geoJSONs.mixed.rg1,this.geoJSONs.mixed.rg2,this.geoJSONs.mixed.rg3].forEach(function(n,r){Ff(e.append("g").attr("id","em-nutsrg").attr("class","em-nutsrg em-nutsrg-".concat(r)).selectAll("path").data(n).enter().append("path").attr("d",i).attr("lvl",r),t)}),"EUR"!=s||"3035"!=l&&"4326"!=l||function(t,e,n,r,i){var a=ff[i]?ff[i][n][r]:ff[2024][n][r],o=uf(a,"nutsbn_1").features;t.append("g").attr("id","em-kosovo-bn").attr("class","em-kosovo-bn em-bn-cc").selectAll("path").data(o).enter().append("path").attr("d",e)}(e,i,l,c,o)):Ff(e.append("g").attr("id","em-nutsrg").attr("class","em-nutsrg").selectAll("path").data(this.geoJSONs.nutsrg).enter().append("path").attr("d",i),t));this.geoJSONs.cntbn&&e.append("g").attr("id","em-cntbn-halo").attr("class","em-cntbn-halo").selectAll("path").data(this.geoJSONs.cntbn).enter().append("path").filter(function(t){return"T"==t.properties.eu||"T"==t.properties.efta||"T"==t.properties.cc||"T"==t.properties.oth||"T"==t.properties.co?t:void 0}).attr("d",i).attr("id",function(t){return"em-bn-"+t.properties.id+"-halo"}).attr("class",function(t){var e=[];return"T"===t.properties.eu&&e.push("em-bn-eu"),"T"===t.properties.efta&&e.push("em-bn-efta"),"T"===t.properties.cc&&e.push("em-bn-cc"),"T"===t.properties.oth&&e.push("em-bn-oth"),"T"===t.properties.co&&e.push("em-bn-co"),e.join(" ")}),this.geoJSONs.cntbn&&e.append("g").attr("id","em-cntbn").attr("class","em-cntbn").selectAll("path").data(this.geoJSONs.cntbn).enter().append("path").filter(function(t){return"T"==t.properties.eu||"T"==t.properties.efta||"T"==t.properties.cc||"T"==t.properties.oth||"T"==t.properties.co?t:void 0}).attr("d",i).attr("id",function(t){return"em-bn-"+t.properties.id}).attr("class",function(t){var e=[];return"T"===t.properties.eu&&e.push("em-bn-eu"),"T"===t.properties.efta&&e.push("em-bn-efta"),"T"===t.properties.cc&&e.push("em-bn-cc"),"T"===t.properties.oth&&e.push("em-bn-oth"),"T"===t.properties.co&&e.push("em-bn-co"),e.join(" ")}),this.geoJSONs.nutsbn&&"mixed"!==a&&(this.geoJSONs.nutsbn.sort(function(t,e){return e.properties.lvl-t.properties.lvl}),e.append("g").attr("id","em-nutsbn").attr("class","em-nutsbn").selectAll("path").data(this.geoJSONs.nutsbn).enter().filter(function(t){return"T"==t.properties.eu||"T"==t.properties.efta||"T"==t.properties.cc||"T"==t.properties.oth||"T"==t.properties.co?t:void 0}).append("path").attr("d",i).attr("class",function(t){var e=t.properties;return e.id>1e5?"em-kosovo-bn":"T"===e.co?"em-bn-co":["em-bn-"+e.lvl].join(" ")})),this.geoJSONs.worldbn&&(e.append("g").attr("id","em-worldbn-halo").attr("class","em-worldbn-halo").selectAll("path").data(this.geoJSONs.worldbn).enter().append("path").attr("d",i).attr("class",function(t){return t.properties.POL_STAT>0?"em-bn-d em-worldbn-halo":"T"===t.properties.COAS_FLAG?"em-bn-co":"em-worldbn-halo"}),e.append("g").attr("id","em-worldbn").attr("class","em-worldbn").selectAll("path").data(this.geoJSONs.worldbn).enter().append("path").attr("d",i).attr("class",function(t){return t.properties.POL_STAT>0?"em-bn-d":"T"===t.properties.COAS_FLAG?"em-bn-co":"em-worldbn"})),this.geoJSONs.kosovo&&e.append("g").attr("id","em-kosovo-bn").attr("class","em-kosovo-bn").selectAll("path").data(this.geoJSONs.kosovo).enter().append("path").attr("d",i)},n.addUserGeometriesToMap=function(t,e,n){t.forEach(function(t){var r=e.append("g").attr("id",t.statisticalRegions?"em-user-regions":"").attr("class",t.class?t.class:"").selectAll("path").data(t.features).enter().append("path").attr("d",n);"function"==typeof t.onEach&&t.onEach(r)})},n.getAllRegionFeatures=function(){var e=[];return n.geoJSONs.nutsrg?e="mixed"==t.nutsLevel_?n.geoJSONs.mixed.rg0.concat(n.geoJSONs.mixed.rg1,n.geoJSONs.mixed.rg2,n.geoJSONs.mixed.rg3,n.geoJSONs.cntrg):n.geoJSONs.nutsrg.concat(n.geoJSONs.cntrg):n.userGeometries&&(e=n.statisticalRegions.features),e},n};function Ff(t,e){t.on("click",function(t,n){var r,i;null!==(r=e.tooltip_.omitRegions)&&void 0!==r&&r.includes(null===(i=n.properties)||void 0===i?void 0:i.id)||e.onRegionClick_&&e.onRegionClick_(t,n,this,e)})}var Lf=function(t,e,n,r){var i=m_(t,n,r);for(var a in(t=t||{}).proj=t.proj||Of[t.geo],t.scale=t.scale||e.insetScale_,t.footnote=t.footnote||"",t.showSourceLink=t.showSourceLink||!1,t.zoomExtent=t.zoomExtent||e.insetZoomExtent_,t.width=t.width||e.insetBoxWidth_,t.height=t.height||e.insetBoxWidth_,t.insets=t.insets||[],t.insetTemplates=t.insetTemplates||{},t.callback=t.callback||e.callback_,["nutsLevel_","nutsYear_","hoverColor_","cntrgFillStyle_","cntbnStroke_","cntbnStrokeWidth_","seaFillStyle_","drawCoastalMargin_","coastalMarginColor_","coastalMarginWidth_","coastalMarginStdDev_","graticuleStroke_","graticuleStrokeWidth_","lg_","projectionFunction_","filterGeometriesFunction_","processCentroids_"].forEach(function(t){i[t]=e[t]}),["stat","statData","legend","legendObj","noDataText","language","transitionDuration","tooltip_","classToText_"].forEach(function(t){i[t]=e[t]}),t)i[a+"_"]=t[a];return i.isInset=!0,i},Nf=function(t,e){for(var n=[{geo:"IC",x:0,y:0,width:t,height:.3*t},{geo:"CARIB",x:0,y:.3*t+e,width:.5*t,height:t},{geo:"GF",x:.5*t,y:.3*t+e,width:.5*t,height:.75*t},{geo:"YT",x:.5*t,y:1.05*t+e,width:.25*t,height:.25*t},{geo:"RE",x:.75*t,y:1.05*t+e,width:.25*t,height:.25*t},{geo:"PT20",x:0,y:1.3*t+2*e,width:.75*t,height:.25*t},{geo:"PT30",x:.75*t,y:1.3*t+2*e,width:.25*t,height:.25*t},{geo:"MT",x:0,y:1.55*t+3*e,width:.25*t,height:.25*t},{geo:"LI",x:.25*t,y:1.55*t+3*e,width:.25*t,height:.25*t},{geo:"SJ_SV",x:.5*t,y:1.55*t+3*e,width:.25*t,height:.25*t},{geo:"SJ_JM",x:.75*t,y:1.55*t+3*e,width:.25*t,height:.25*t}],r=0;r<n.length;r++)n[r].drawGraticule=!1;return n},Of={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"},Df=function(t,e){if(e.svg_&&(e.svg_.select("#em-stamp").remove(),t)){var n=e.svg_.append("g").attr("id","em-stamp");t.size||(t.size=60),t.x||(t.x=230),t.y||(t.y=100),t.textColor||(t.textColor="#000"),t.stampColor||(t.stampColor="#000"),t.strokeWidth||(t.strokeWidth=1),t.lineHeight||(t.lineHeight=15),n.append("circle").attr("r",t.size).attr("cx",t.x).attr("cy",t.y).attr("id","em-stamp-circle").attr("fill","none").attr("stroke",t.stampColor).attr("stroke-width",t.strokeWidth);var r=t.text,i=Math.sqrt(If(r.trim())*t.lineHeight),a=jf(zf(r.trim()),i),o=Gf(a,t.lineHeight);n.append("text").attr("text-anchor","middle").attr("fill",t.textColor).attr("id","em-stamp-text").attr("transform","translate(".concat(t.x,",").concat(t.y,") scale(").concat(t.size/o,")")).selectAll("tspan").data(a).enter().append("tspan").attr("x",0).attr("y",function(e,n){return(n-a.length/2+.8)*t.lineHeight}).text(function(t){return t.text.replaceAll("~"," ").replaceAll("¶","")})}},zf=function(t){return t.split(/(?<=¶)|\s+/g).map(function(t){return t.trim()}).filter(function(t){return t.length>0})},If=function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","svg"),n=document.createElementNS("http://www.w3.org/2000/svg","text");n.textContent=t,e.appendChild(n),document.body.appendChild(e);var r=n.getComputedTextLength();return document.body.removeChild(e),r+10},Gf=function(t,e){for(var n=0,r=0,i=t.length;r<i;++r){var a=(Math.abs(r-i/2+.5)+.5)*e,o=t[r].width/2;n=Math.max(n,Math.sqrt(Math.pow(o,2)+Math.pow(a,2)))}return n},jf=function(t,e){for(var n=[],r={width:0,text:""},i=0,a=t.length;i<a;++i)if("¶"!==t[i]){var o=(r.text?r.text+" ":"")+t[i],s=If(o);(r.width+s)/2<e?(r.width=s,r.text=o):(n.push(r),r={width:If(t[i]),text:t[i]})}else r.text&&n.push(r),r={width:0,text:""};return r.text&&n.push(r),n},Rf={},Bf={};function Wf(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function qf(t){var e=Object.create(null),n=[];return t.forEach(function(t){for(var r in t)r in e||n.push(e[r]=r)}),n}function Uf(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function Hf(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+Uf(-e,6):e>9999?"+"+Uf(e,6):Uf(e,4))+"-"+Uf(t.getUTCMonth()+1,2)+"-"+Uf(t.getUTCDate(),2)+(a?"T"+Uf(n,2)+":"+Uf(r,2)+":"+Uf(i,2)+"."+Uf(a,3)+"Z":i?"T"+Uf(n,2)+":"+Uf(r,2)+":"+Uf(i,2)+"Z":r||n?"T"+Uf(n,2)+":"+Uf(r,2)+"Z":"")}function Vf(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],a=t.length,o=0,s=0,l=a<=0,c=!1;function u(){if(l)return Bf;if(c)return c=!1,Rf;var e,r,i=o;if(34===t.charCodeAt(i)){for(;o++<a&&34!==t.charCodeAt(o)||34===t.charCodeAt(++o););return(e=o)>=a?l=!0:10===(r=t.charCodeAt(o++))?c=!0:13===r&&(c=!0,10===t.charCodeAt(o)&&++o),t.slice(i+1,e-1).replace(/""/g,'"')}for(;o<a;){if(10===(r=t.charCodeAt(e=o++)))c=!0;else if(13===r)c=!0,10===t.charCodeAt(o)&&++o;else if(r!==n)continue;return t.slice(i,e)}return l=!0,t.slice(i,a)}for(10===t.charCodeAt(a-1)&&--a,13===t.charCodeAt(a-1)&&--a;(r=u())!==Bf;){for(var h=[];r!==Rf&&r!==Bf;)h.push(r),r=u();e&&null==(h=e(h,s++))||i.push(h)}return i}function i(e,n){return e.map(function(e){return n.map(function(t){return o(e[t])}).join(t)})}function a(e){return e.map(o).join(t)}function o(t){return null==t?"":t instanceof Date?Hf(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,a=r(t,function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=Wf(t);return function(r,i){return e(n(r),i,t)}}(t,e):Wf(t)});return a.columns=i||[],a},parseRows:r,format:function(e,n){return null==n&&(n=qf(e)),[n.map(o).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=qf(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}var Yf=Vf(","),$f=Yf.parse,Xf=Yf.parseRows,Jf=(Yf.format,Yf.formatBody,Yf.formatRows,Yf.formatRow,Yf.formatValue,function(t){return t.gridCartogramPositions_||("hexagon"===t.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, , , ")}),Zf=function(t){var e=new Map;return Xf(t.trim(),function(t,n){t.forEach(function(t,r){(t=t.trim())&&e.set(t,[r,n])})}),e},Kf=function(t,e){return Array.from(t,function(t){var n=_(t,2),r=n[0],i=_(n[1],2),a=i[0],o=i[1],s=e.Geometries.geoJSONs.nutsrg.find(function(t){return t.properties.id==r});return{id:r,col:a,row:o,properties:{id:r,name:s?s.properties.na:""}}})},Qf=function(t,e,n){var r=Math.max.apply(Math,y(e.map(function(t){return t.col})))+1,i=Math.max.apply(Math,y(e.map(function(t){return t.row})))+1,a=n.gridCartogramMargins_,o=n.gridCartogramCellPadding_||0,s=(n.width_-a.left-a.right)/r-o,l=(n.height_-a.top-a.bottom)/i-o,c=Math.min(s,l);t.selectAll(".em-grid-cell").data(e).enter().append("g").attr("class","em-grid-cell").attr("transform",function(t){return"translate(".concat(t.col*(c+o)+a.left,", ").concat(t.row*(c+o)+a.top,")")}).each(function(t){Nt(this).append("rect").attr("width",c).attr("height",c).attr("class","em-grid-rect"),Nt(this).append("text").attr("class","em-grid-text").attr("text-anchor","middle").attr("font-size",15).style("pointer-events","none").attr("fill","black").text(t.id).attr("x",c/2).attr("y",c/2+5)})},td=function(t,e,n){var r=Math.max.apply(Math,y(e.map(function(t){return t.col})))+1,i=Math.max.apply(Math,y(e.map(function(t){return t.row})))+1,a=n.gridCartogramMargins_,o=n.gridCartogramCellPadding_||0,s=Math.min((n.width_-a.left-a.right)/(1.5*r),(n.height_-a.top-a.bottom)/(i*Math.sqrt(3))),l=Math.sqrt(3)*s;t.selectAll(".em-grid-cell").data(e).enter().append("g").attr("class","em-grid-cell").attr("transform",function(t){var e=t.col*(1.5*s+o)+a.left,n=t.row*(l+o)+(t.col%2==1?(l+o)/2:0)+a.top;return"translate(".concat(e,", ").concat(n,")")}).each(function(t){Nt(this).append("path").attr("d",ed(s)).attr("class","em-grid-hexagon"),Nt(this).append("text").attr("class","em-grid-text").attr("text-anchor","middle").attr("font-size",15).style("pointer-events","none").attr("fill","black").text(t.id).attr("y",5)})},ed=function(t){var e=Math.PI/3;return Array.from({length:6},function(n,r){var i=t*Math.cos(e*r),a=t*Math.sin(e*r);return"".concat(0===r?"M":"L").concat(i,",").concat(a)}).join(" ")+" Z"},nd=function(t,e,n,r){t.each(function(){var i=this.getBBox(),a=(e-r.left-r.right-i.width)/2-i.x+r.left,o=(n-r.top-r.bottom-i.height)/2-i.y+r.top;t.attr("transform","translate(".concat(a,", ").concat(o,")"))})};function rd(t){return[ca(t[1],t[0]),ma(t[2])]}function id(t){var e=t[0],n=t[1],r=ua(n);return[r*ua(e),r*da(e),da(n)]}function ad(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function od(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function sd(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function ld(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function cd(t){var e=ga(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function ud(t){return sa(t[0])<=ea?t[0]:pa(t[0])*((sa(t[0])+ea)%ia-ea)}function hd(t,e,n,r){return function(i){var a,o,s,l=e(i),c=Ka(),u=e(c),h=!1,f={point:d,lineStart:g,lineEnd:m,polygonStart:function(){f.point=v,f.lineStart=_,f.lineEnd=y,o=[],a=[]},polygonEnd:function(){f.point=d,f.lineStart=g,f.lineEnd=m,o=ro(o);var t=function(t,e){var n=ud(e),r=e[1],i=da(r),a=[da(n),-ua(n),0],o=0,s=0,l=new Ki;1===i?r=na+Qi:-1===i&&(r=-na-Qi);for(var c=0,u=t.length;c<u;++c)if(f=(h=t[c]).length)for(var h,f,d=h[f-1],p=ud(d),g=d[1]/2+ra,m=da(g),v=ua(g),_=0;_<f;++_,p=x,m=w,v=M,d=y){var y=h[_],x=ud(y),b=y[1]/2+ra,w=da(b),M=ua(b),S=x-p,C=S>=0?1:-1,E=C*S,k=E>ea,A=m*w;if(l.add(ca(A*C*da(E),v*M+A*ua(E))),o+=k?S+C*ia:S,k^p>=n^x>=n){var T=od(id(d),id(y));cd(T);var P=od(a,T);cd(P);var F=(k^S>=0?-1:1)*ma(P[2]);(r>F||r===F&&(T[0]||T[1]))&&(s+=k^S>=0?1:-1)}}return(o<-Qi||o<Qi&&l<-1e-12)^1&s}(a,r);o.length?(h||(i.polygonStart(),h=!0),eo(o,dd,t,n,i)):t&&(h||(i.polygonStart(),h=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),h&&(i.polygonEnd(),h=!1),o=a=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(e,n){t(e,n)&&i.point(e,n)}function p(t,e){l.point(t,e)}function g(){f.point=p,l.lineStart()}function m(){f.point=d,l.lineEnd()}function v(t,e){s.push([t,e]),u.point(t,e)}function _(){u.lineStart(),s=[]}function y(){v(s[0][0],s[0][1]),u.lineEnd();var t,e,n,r,l=u.clean(),f=c.result(),d=f.length;if(s.pop(),a.push(s),s=null,d)if(1&l){if((e=(n=f[0]).length-1)>0){for(h||(i.polygonStart(),h=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else d>1&&2&l&&f.push(f.pop().concat(f.shift())),o.push(f.filter(fd))}return f}}function fd(t){return t.length>1}function dd(t,e){return((t=t.x)[0]<0?t[1]-na-Qi:na-t[1])-((e=e.x)[0]<0?e[1]-na-Qi:na-e[1])}const pd=hd(function(){return!0},function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?ea:-ea,l=sa(a-n);sa(l-ea)<Qi?(t.point(n,r=(r+o)/2>0?na:-na),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(a,r),e=0):i!==s&&l>=ea&&(sa(n-i)<Qi&&(n-=i*Qi),sa(a-s)<Qi&&(a-=s*Qi),r=function(t,e,n,r){var i,a,o=da(t-n);return sa(o)>Qi?la((da(e)*(a=ua(r))*da(n)-da(r)*(i=ua(e))*da(t))/(i*a*o)):(e+r)/2}(n,r,a,o),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=a,r=o),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var i;if(null==t)i=n*na,r.point(-ea,i),r.point(0,i),r.point(ea,i),r.point(ea,0),r.point(ea,-i),r.point(0,-i),r.point(-ea,-i),r.point(-ea,0),r.point(-ea,i);else if(sa(t[0]-e[0])>Qi){var a=t[0]<e[0]?ea:-ea;i=n*a/2,r.point(-a,i),r.point(0,i),r.point(a,i)}else r.point(e[0],e[1])},[-ea,-na]);function gd(t,e,n,r,i,a){if(n){var o=ua(e),s=da(e),l=r*n;null==i?(i=e+r*ia,a=e-l/2):(i=md(o,i),a=md(o,a),(r>0?i<a:i>a)&&(i+=r*ia));for(var c,u=i;r>0?u>a:u<a;u-=l)c=rd([o,-s*ua(u),-s*da(u)]),t.point(c[0],c[1])}}function md(t,e){(e=id(e))[0]-=t,cd(e);var n=function(t){return t>1?0:t<-1?ea:Math.acos(t)}(-e[1]);return((-e[2]<0?-n:n)+ia-Qi)%ia}function vd(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function _d(t,e){return sa(t)>ea&&(t-=Math.round(t/ia)*ia),[t,e]}function yd(t,e,n){return(t%=ia)?e||n?vd(bd(t),wd(e,n)):bd(t):e||n?wd(e,n):_d}function xd(t){return function(e,n){return sa(e+=t)>ea&&(e-=Math.round(e/ia)*ia),[e,n]}}function bd(t){var e=xd(t);return e.invert=xd(-t),e}function wd(t,e){var n=ua(t),r=da(t),i=ua(e),a=da(e);function o(t,e){var o=ua(e),s=ua(t)*o,l=da(t)*o,c=da(e),u=c*n+s*r;return[ca(l*i-u*a,s*n-c*r),ma(u*i+l*a)]}return o.invert=function(t,e){var o=ua(e),s=ua(t)*o,l=da(t)*o,c=da(e),u=c*i-l*a;return[ca(l*i+c*a,s*n+u*r),ma(u*n-s*r)]},o}_d.invert=_d;var Md=ua(30*oa);function Sd(t,e){return+e?function(t,e){function n(r,i,a,o,s,l,c,u,h,f,d,p,g,m){var v=c-r,_=u-i,y=v*v+_*_;if(y>4*e&&g--){var x=o+f,b=s+d,w=l+p,M=ga(x*x+b*b+w*w),S=ma(w/=M),C=sa(sa(w)-1)<Qi||sa(a-h)<Qi?(a+h)/2:ca(b,x),E=t(C,S),k=E[0],A=E[1],T=k-r,P=A-i,F=_*T-v*P;(F*F/y>e||sa((v*T+_*P)/y-.5)>.3||o*f+s*d+l*p<Md)&&(n(r,i,a,o,s,l,k,A,C,x/=M,b/=M,w,g,m),m.point(k,A),n(k,A,C,x,b,w,c,u,h,f,d,p,g,m))}}return function(e){var r,i,a,o,s,l,c,u,h,f,d,p,g={point:m,lineStart:v,lineEnd:y,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=v}};function m(n,r){n=t(n,r),e.point(n[0],n[1])}function v(){u=NaN,g.point=_,e.lineStart()}function _(r,i){var a=id([r,i]),o=t(r,i);n(u,h,c,f,d,p,u=o[0],h=o[1],c=r,f=a[0],d=a[1],p=a[2],16,e),e.point(u,h)}function y(){g.point=m,e.lineEnd()}function x(){v(),g.point=b,g.lineEnd=w}function b(t,e){_(r=t,e),i=u,a=h,o=f,s=d,l=p,g.point=_}function w(){n(u,h,c,f,d,p,i,a,r,o,s,l,16,e),g.lineEnd=y,y()}return g}}(t,e):function(t){return lo({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Cd,Ed=lo({point:function(t,e){this.stream.point(t*oa,e*oa)}});function kd(t,e,n,r,i,a){if(!a)return function(t,e,n,r,i){function a(a,o){return[e+t*(a*=r),n-t*(o*=i)]}return a.invert=function(a,o){return[(a-e)/t*r,(n-o)/t*i]},a}(t,e,n,r,i);var o=ua(a),s=da(a),l=o*t,c=s*t,u=o/t,h=s/t,f=(s*n-o*e)/t,d=(s*e+o*n)/t;function p(t,a){return[l*(t*=r)-c*(a*=i)+e,n-c*t-l*a]}return p.invert=function(t,e){return[r*(u*t-h*e+f),i*(d-h*t-u*e)]},p}function Ad(t){return function(t){var e,n,r,i,a,o,s,l,c,u,h=150,f=480,d=250,p=0,g=0,m=0,v=0,_=0,y=0,x=1,b=1,w=null,M=pd,S=null,C=so,E=.5;function k(t){return l(t[0]*oa,t[1]*oa)}function A(t){return(t=l.invert(t[0],t[1]))&&[t[0]*aa,t[1]*aa]}function T(){var t=kd(h,0,0,x,b,y).apply(null,e(p,g)),r=kd(h,f-t[0],d-t[1],x,b,y);return n=yd(m,v,_),s=vd(e,r),l=vd(n,s),o=Sd(s,E),P()}function P(){return c=u=null,k}return k.stream=function(t){return c&&u===t?c:c=Ed(function(t){return lo({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(M(o(C(u=t)))))},k.preclip=function(t){return arguments.length?(M=t,w=void 0,P()):M},k.postclip=function(t){return arguments.length?(C=t,S=r=i=a=null,P()):C},k.clipAngle=function(t){return arguments.length?(M=+t?function(t){var e=ua(t),n=2*oa,r=e>0,i=sa(e)>Qi;function a(t,n){return ua(t)*ua(n)>e}function o(t,n,r){var i=[1,0,0],a=od(id(t),id(n)),o=ad(a,a),s=a[0],l=o-s*s;if(!l)return!r&&t;var c=e*o/l,u=-e*s/l,h=od(i,a),f=ld(i,c);sd(f,ld(a,u));var d=h,p=ad(f,d),g=ad(d,d),m=p*p-g*(ad(f,f)-1);if(!(m<0)){var v=ga(m),_=ld(d,(-p-v)/g);if(sd(_,f),_=rd(_),!r)return _;var y,x=t[0],b=n[0],w=t[1],M=n[1];b<x&&(y=x,x=b,b=y);var S=b-x,C=sa(S-ea)<Qi;if(!C&&M<w&&(y=w,w=M,M=y),C||S<Qi?C?w+M>0^_[1]<(sa(_[0]-x)<Qi?w:M):w<=_[1]&&_[1]<=M:S>ea^(x<=_[0]&&_[0]<=b)){var E=ld(d,(-p+v)/g);return sd(E,f),[_,rd(E)]}}}function s(e,n){var i=r?t:ea-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}return hd(a,function(t){var e,n,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(h,f){var d,p=[h,f],g=a(h,f),m=r?g?0:s(h,f):g?s(h+(h<0?ea:-ea),f):0;if(!e&&(c=l=g)&&t.lineStart(),g!==l&&(!(d=o(e,p))||Qa(e,d)||Qa(p,d))&&(p[2]=1),g!==l)u=0,g?(t.lineStart(),d=o(p,e),t.point(d[0],d[1])):(d=o(e,p),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(i&&e&&r^g){var v;m&n||!(v=o(p,e,!0))||(u=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!g||e&&Qa(e,p)||t.point(p[0],p[1]),e=p,l=g,n=m},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return u|(c&&l)<<1}}},function(e,r,i,a){gd(a,t,n,i,e,r)},r?[0,-t]:[-ea,t-ea])}(w=t*oa):(w=null,pd),P()):w*aa},k.clipExtent=function(t){return arguments.length?(C=null==t?(S=r=i=a=null,so):oo(S=+t[0][0],r=+t[0][1],i=+t[1][0],a=+t[1][1]),P()):null==S?null:[[S,r],[i,a]]},k.scale=function(t){return arguments.length?(h=+t,T()):h},k.translate=function(t){return arguments.length?(f=+t[0],d=+t[1],T()):[f,d]},k.center=function(t){return arguments.length?(p=t[0]%360*oa,g=t[1]%360*oa,T()):[p*aa,g*aa]},k.rotate=function(t){return arguments.length?(m=t[0]%360*oa,v=t[1]%360*oa,_=t.length>2?t[2]%360*oa:0,T()):[m*aa,v*aa,_*aa]},k.angle=function(t){return arguments.length?(y=t%360*oa,T()):y*aa},k.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},k.reflectY=function(t){return arguments.length?(b=t?-1:1,T()):b<0},k.precision=function(t){return arguments.length?(o=Sd(s,E=t*t),P()):ga(E)},k.fitExtent=function(t,e){return _o(k,t,e)},k.fitSize=function(t,e){return yo(k,t,e)},k.fitWidth=function(t,e){return xo(k,t,e)},k.fitHeight=function(t,e){return bo(k,t,e)},function(){return e=t.apply(this,arguments),k.invert=e.invert&&A,T()}}(function(){return t})()}function Td(t,e){return[ua(e)*da(t),da(e)]}Td.invert=(Cd=ma,function(t,e){var n=ga(t*t+e*e),r=Cd(n),i=da(r),a=ua(r);return[ca(t*i,n*a),ma(n&&e*i/n)]});var Pd=6378137,Fd=.0066943799901413165,Ld=484813681109536e-20,Nd=Math.PI/2,Od=1e-10,Dd=.017453292519943295,zd=57.29577951308232,Id=Math.PI/4,Gd=2*Math.PI,jd=3.14159265359,Rd={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 Bd=Rd,Wd={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 qd=/[\s_\-\/\(\)]/g;function Ud(t,e){if(t[e])return t[e];for(var n,r=Object.keys(t),i=e.toLowerCase().replace(qd,""),a=-1;++a<r.length;)if((n=r[a]).toLowerCase().replace(qd,"")===i)return t[n]}function Hd(t){var e,n,r,i={},a=t.split("+").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,e){var n=e.split("=");return n.push(!0),t[n[0].toLowerCase()]=n[1],t},{}),o={proj:"projName",datum:"datumCode",rf:function(t){i.rf=parseFloat(t)},lat_0:function(t){i.lat0=t*Dd},lat_1:function(t){i.lat1=t*Dd},lat_2:function(t){i.lat2=t*Dd},lat_ts:function(t){i.lat_ts=t*Dd},lon_0:function(t){i.long0=t*Dd},lon_1:function(t){i.long1=t*Dd},lon_2:function(t){i.long2=t*Dd},alpha:function(t){i.alpha=parseFloat(t)*Dd},gamma:function(t){i.rectified_grid_angle=parseFloat(t)*Dd},lonc:function(t){i.longc=t*Dd},x_0:function(t){i.x0=parseFloat(t)},y_0:function(t){i.y0=parseFloat(t)},k_0:function(t){i.k0=parseFloat(t)},k:function(t){i.k0=parseFloat(t)},a:function(t){i.a=parseFloat(t)},b:function(t){i.b=parseFloat(t)},r:function(t){i.a=i.b=parseFloat(t)},r_a:function(){i.R_A=!0},zone:function(t){i.zone=parseInt(t,10)},south:function(){i.utmSouth=!0},towgs84:function(t){i.datum_params=t.split(",").map(function(t){return parseFloat(t)})},to_meter:function(t){i.to_meter=parseFloat(t)},units:function(t){i.units=t;var e=Ud(Wd,t);e&&(i.to_meter=e.to_meter)},from_greenwich:function(t){i.from_greenwich=t*Dd},pm:function(t){var e=Ud(Bd,t);i.from_greenwich=(e||parseFloat(t))*Dd},nadgrids:function(t){"@null"===t?i.datumCode="none":i.nadgrids=t},axis:function(t){var e="ewnsud";3===t.length&&-1!==e.indexOf(t.substr(0,1))&&-1!==e.indexOf(t.substr(1,1))&&-1!==e.indexOf(t.substr(2,1))&&(i.axis=t)},approx:function(){i.approx=!0}};for(e in a)n=a[e],e in o?"function"==typeof(r=o[e])?r(n):i[r]=n:i[e]=n;return"string"==typeof i.datumCode&&"WGS84"!==i.datumCode&&(i.datumCode=i.datumCode.toLowerCase()),i}const Vd=class{static getId(t){const e=t.find(t=>Array.isArray(t)&&"ID"===t[0]);return e&&e.length>=3?{authority:e[1],code:parseInt(e[2],10)}:null}static convertUnit(t,e="unit"){if(!t||t.length<3)return{type:e,name:"unknown",conversion_factor:null};const n=t[1],r=parseFloat(t[2])||null,i=t.find(t=>Array.isArray(t)&&"ID"===t[0]);return{type:e,name:n,conversion_factor:r,id:i?{authority:i[1],code:parseInt(i[2],10)}:null}}static convertAxis(t){const e=t[1]||"Unknown";let n;const r=e.match(/^\((.)\)$/);if(r){const t=r[1].toUpperCase();if("E"===t)n="east";else if("N"===t)n="north";else{if("U"!==t)throw new Error(`Unknown axis abbreviation: ${t}`);n="up"}}else n=t[2]?t[2].toLowerCase():"unknown";const i=t.find(t=>Array.isArray(t)&&"ORDER"===t[0]),a=i?parseInt(i[1],10):null,o=t.find(t=>Array.isArray(t)&&("LENGTHUNIT"===t[0]||"ANGLEUNIT"===t[0]||"SCALEUNIT"===t[0]));return{name:e,direction:n,unit:this.convertUnit(o),order:a}}static extractAxes(t){return t.filter(t=>Array.isArray(t)&&"AXIS"===t[0]).map(t=>this.convertAxis(t)).sort((t,e)=>(t.order||0)-(e.order||0))}static convert(t,e={}){switch(t[0]){case"PROJCRS":e.type="ProjectedCRS",e.name=t[1],e.base_crs=t.find(t=>Array.isArray(t)&&"BASEGEOGCRS"===t[0])?this.convert(t.find(t=>Array.isArray(t)&&"BASEGEOGCRS"===t[0])):null,e.conversion=t.find(t=>Array.isArray(t)&&"CONVERSION"===t[0])?this.convert(t.find(t=>Array.isArray(t)&&"CONVERSION"===t[0])):null;const n=t.find(t=>Array.isArray(t)&&"CS"===t[0]);n&&(e.coordinate_system={type:n[1],axis:this.extractAxes(t)});const r=t.find(t=>Array.isArray(t)&&"LENGTHUNIT"===t[0]);if(r){const t=this.convertUnit(r);e.coordinate_system.unit=t}e.id=this.getId(t);break;case"BASEGEOGCRS":case"GEOGCRS":e.type="GeographicCRS",e.name=t[1];const i=t.find(t=>Array.isArray(t)&&("DATUM"===t[0]||"ENSEMBLE"===t[0]));if(i){const n=this.convert(i);"ENSEMBLE"===i[0]?e.datum_ensemble=n:e.datum=n;const r=t.find(t=>Array.isArray(t)&&"PRIMEM"===t[0]);r&&"Greenwich"!==r[1]&&(n.prime_meridian={name:r[1],longitude:parseFloat(r[2])})}e.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(t)},e.id=this.getId(t);break;case"DATUM":e.type="GeodeticReferenceFrame",e.name=t[1],e.ellipsoid=t.find(t=>Array.isArray(t)&&"ELLIPSOID"===t[0])?this.convert(t.find(t=>Array.isArray(t)&&"ELLIPSOID"===t[0])):null;break;case"ENSEMBLE":e.type="DatumEnsemble",e.name=t[1],e.members=t.filter(t=>Array.isArray(t)&&"MEMBER"===t[0]).map(t=>({type:"DatumEnsembleMember",name:t[1],id:this.getId(t)}));const a=t.find(t=>Array.isArray(t)&&"ENSEMBLEACCURACY"===t[0]);a&&(e.accuracy=parseFloat(a[1]));const o=t.find(t=>Array.isArray(t)&&"ELLIPSOID"===t[0]);o&&(e.ellipsoid=this.convert(o)),e.id=this.getId(t);break;case"ELLIPSOID":e.type="Ellipsoid",e.name=t[1],e.semi_major_axis=parseFloat(t[2]),e.inverse_flattening=parseFloat(t[3]);t.find(t=>Array.isArray(t)&&"LENGTHUNIT"===t[0])&&this.convert(t.find(t=>Array.isArray(t)&&"LENGTHUNIT"===t[0]),e);break;case"CONVERSION":e.type="Conversion",e.name=t[1],e.method=t.find(t=>Array.isArray(t)&&"METHOD"===t[0])?this.convert(t.find(t=>Array.isArray(t)&&"METHOD"===t[0])):null,e.parameters=t.filter(t=>Array.isArray(t)&&"PARAMETER"===t[0]).map(t=>this.convert(t));break;case"METHOD":e.type="Method",e.name=t[1],e.id=this.getId(t);break;case"PARAMETER":e.type="Parameter",e.name=t[1],e.value=parseFloat(t[2]),e.unit=this.convertUnit(t.find(t=>Array.isArray(t)&&("LENGTHUNIT"===t[0]||"ANGLEUNIT"===t[0]||"SCALEUNIT"===t[0]))),e.id=this.getId(t);break;case"BOUNDCRS":e.type="BoundCRS";const s=t.find(t=>Array.isArray(t)&&"SOURCECRS"===t[0]);if(s){const t=s.find(t=>Array.isArray(t));e.source_crs=t?this.convert(t):null}const l=t.find(t=>Array.isArray(t)&&"TARGETCRS"===t[0]);if(l){const t=l.find(t=>Array.isArray(t));e.target_crs=t?this.convert(t):null}const c=t.find(t=>Array.isArray(t)&&"ABRIDGEDTRANSFORMATION"===t[0]);e.transformation=c?this.convert(c):null;break;case"ABRIDGEDTRANSFORMATION":if(e.type="Transformation",e.name=t[1],e.method=t.find(t=>Array.isArray(t)&&"METHOD"===t[0])?this.convert(t.find(t=>Array.isArray(t)&&"METHOD"===t[0])):null,e.parameters=t.filter(t=>Array.isArray(t)&&("PARAMETER"===t[0]||"PARAMETERFILE"===t[0])).map(t=>"PARAMETER"===t[0]?this.convert(t):"PARAMETERFILE"===t[0]?{name:t[1],value:t[2],id:{authority:"EPSG",code:8656}}:void 0),7===e.parameters.length){const t=e.parameters[6];"Scale difference"===t.name&&(t.value=Math.round(1e12*(t.value-1))/1e6)}e.id=this.getId(t);break;case"AXIS":e.coordinate_system||(e.coordinate_system={type:"unspecified",axis:[]}),e.coordinate_system.axis.push(this.convertAxis(t));break;case"LENGTHUNIT":const u=this.convertUnit(t,"LinearUnit");e.coordinate_system&&e.coordinate_system.axis&&e.coordinate_system.axis.forEach(t=>{t.unit||(t.unit=u)}),u.conversion_factor&&1!==u.conversion_factor&&e.semi_major_axis&&(e.semi_major_axis={value:e.semi_major_axis,unit:u});break;default:e.keyword=t[0]}return e}};const Yd=class extends Vd{static convert(t,e={}){return super.convert(t,e),e.coordinate_system&&"Cartesian"===e.coordinate_system.subtype&&delete e.coordinate_system,e.usage&&delete e.usage,e}};const $d=class extends Vd{static convert(t,e={}){super.convert(t,e);const n=t.find(t=>Array.isArray(t)&&"CS"===t[0]);n&&(e.coordinate_system={subtype:n[1],axis:this.extractAxes(t)});const r=t.find(t=>Array.isArray(t)&&"USAGE"===t[0]);if(r){const t=r.find(t=>Array.isArray(t)&&"SCOPE"===t[0]),n=r.find(t=>Array.isArray(t)&&"AREA"===t[0]),i=r.find(t=>Array.isArray(t)&&"BBOX"===t[0]);e.usage={},t&&(e.usage.scope=t[1]),n&&(e.usage.area=n[1]),i&&(e.usage.bbox=i.slice(1))}return e}};function Xd(t){const e=function(t){return t.find(t=>Array.isArray(t)&&"USAGE"===t[0])?"2019":(t.find(t=>Array.isArray(t)&&"CS"===t[0])||"BOUNDCRS"===t[0]||"PROJCRS"===t[0]||t[0],"2015")}(t);return("2019"===e?$d:Yd).convert(t)}const Jd=function(t){var e=new rp(t);return e.output()};var Zd=1,Kd=/\s/,Qd=/[A-Za-z]/,tp=/[A-Za-z84_]/,ep=/[,\]]/,np=/[\d\.E\-\+]/;function rp(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Zd}function ip(t,e,n){Array.isArray(e)&&(n.unshift(e),e=null);var r=e?{}:t,i=n.reduce(function(t,e){return ap(e,t),t},r);e&&(t[e]=i)}function ap(t,e){if(Array.isArray(t)){var n=t.shift();if("PARAMETER"===n&&(n=t.shift()),1===t.length)return Array.isArray(t[0])?(e[n]={},void ap(t[0],e[n])):void(e[n]=t[0]);if(t.length)if("TOWGS84"!==n){if("AXIS"===n)return n in e||(e[n]=[]),void e[n].push(t);var r;switch(Array.isArray(n)||(e[n]={}),n){case"UNIT":case"PRIMEM":case"VERT_DATUM":return e[n]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&ap(t[2],e[n]));case"SPHEROID":case"ELLIPSOID":return e[n]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&ap(t[3],e[n]));case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":return t[0]=["name",t[0]],void ip(e,n,t);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 t[0]=["name",t[0]],ip(e,n,t),void(e[n].type=n);default:for(r=-1;++r<t.length;)if(!Array.isArray(t[r]))return ap(t,e[n]);return ip(e,n,t)}}else e[n]=t;else e[n]=!0}else e[t]=!0}rp.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;Kd.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case Zd:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},rp.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(ep.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},rp.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=Zd)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=Zd,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},rp.prototype.number=function(t){if(!np.test(t)){if(ep.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},rp.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},rp.prototype.keyword=function(t){if(tp.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=Zd)}if(!ep.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},rp.prototype.neutral=function(t){if(Qd.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(np.test(t))return this.word=t,void(this.state=3);if(!ep.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},rp.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 op(t){return.017453292519943295*t}function sp(t){const e=(t.projName||"").toLowerCase().replace(/_/g," ");t.long0||!t.longc||"albers conic equal area"!==e&&"lambert azimuthal equal area"!==e||(t.long0=t.longc),t.lat_ts||!t.lat1||"stereographic south pole"!==e&&"polar stereographic (variant b)"!==e?t.lat_ts||!t.lat0||"polar stereographic"!==e&&"polar stereographic (variant a)"!==e||(t.lat_ts=t.lat0,t.lat0=op(t.lat0>0?90:-90),delete t.lat1):(t.lat0=op(t.lat1>0?90:-90),t.lat_ts=t.lat1,delete t.lat1)}function lp(t){let e={units:null,to_meter:void 0};return"string"==typeof t?(e.units=t.toLowerCase(),"metre"===e.units&&(e.units="meter"),"meter"===e.units&&(e.to_meter=1)):t&&t.name&&(e.units=t.name.toLowerCase(),"metre"===e.units&&(e.units="meter"),e.to_meter=t.conversion_factor),e}function cp(t){return"object"==typeof t?t.value*t.unit.conversion_factor:t}function up(t,e){t.ellipsoid.radius?(e.a=t.ellipsoid.radius,e.rf=0):(e.a=cp(t.ellipsoid.semi_major_axis),void 0!==t.ellipsoid.inverse_flattening?e.rf=t.ellipsoid.inverse_flattening:void 0!==t.ellipsoid.semi_major_axis&&void 0!==t.ellipsoid.semi_minor_axis&&(e.rf=e.a/(e.a-cp(t.ellipsoid.semi_minor_axis))))}function hp(t,e={}){return t&&"object"==typeof t?"BoundCRS"===t.type?(hp(t.source_crs,e),t.transformation&&(t.transformation.method&&"NTv2"===t.transformation.method.name?e.nadgrids=t.transformation.parameters[0].value:e.datum_params=t.transformation.parameters.map(t=>t.value)),e):(Object.keys(t).forEach(n=>{const r=t[n];if(null!==r)switch(n){case"name":if(e.srsCode)break;e.name=r,e.srsCode=r;break;case"type":"GeographicCRS"===r?e.projName="longlat":"ProjectedCRS"===r&&t.conversion&&t.conversion.method&&(e.projName=t.conversion.method.name);break;case"datum":case"datum_ensemble":r.ellipsoid&&(e.ellps=r.ellipsoid.name,up(r,e)),r.prime_meridian&&(e.from_greenwich=r.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=r.name,up(r,e);break;case"prime_meridian":e.long0=(r.longitude||0)*Math.PI/180;break;case"coordinate_system":if(r.axis)if(e.axis=r.axis.map(t=>{const e=t.direction;if("east"===e)return"e";if("north"===e)return"n";if("west"===e)return"w";if("south"===e)return"s";throw new Error(`Unknown axis direction: ${e}`)}).join("")+"u",r.unit){const{units:t,to_meter:n}=lp(r.unit);e.units=t,e.to_meter=n}else if(r.axis[0]&&r.axis[0].unit){const{units:t,to_meter:n}=lp(r.axis[0].unit);e.units=t,e.to_meter=n}break;case"id":r.authority&&r.code&&(e.title=r.authority+":"+r.code);break;case"conversion":r.method&&r.method.name&&(e.projName=r.method.name),r.parameters&&r.parameters.forEach(t=>{const n=t.name.toLowerCase().replace(/\s+/g,"_"),r=t.value;t.unit&&t.unit.conversion_factor?e[n]=r*t.unit.conversion_factor:"degree"===t.unit?e[n]=r*Math.PI/180:e[n]=r});break;case"unit":r.name&&(e.units=r.name.toLowerCase(),"metre"===e.units&&(e.units="meter")),r.conversion_factor&&(e.to_meter=r.conversion_factor);break;case"base_crs":hp(r,e),e.datumCode=r.id?r.id.authority+"_"+r.id.code:r.name}}),void 0!==e.latitude_of_false_origin&&(e.lat0=e.latitude_of_false_origin),void 0!==e.longitude_of_false_origin&&(e.long0=e.longitude_of_false_origin),void 0!==e.latitude_of_standard_parallel&&(e.lat0=e.latitude_of_standard_parallel,e.lat1=e.latitude_of_standard_parallel),void 0!==e.latitude_of_1st_standard_parallel&&(e.lat1=e.latitude_of_1st_standard_parallel),void 0!==e.latitude_of_2nd_standard_parallel&&(e.lat2=e.latitude_of_2nd_standard_parallel),void 0!==e.latitude_of_projection_centre&&(e.lat0=e.latitude_of_projection_centre),void 0!==e.longitude_of_projection_centre&&(e.longc=e.longitude_of_projection_centre),void 0!==e.easting_at_false_origin&&(e.x0=e.easting_at_false_origin),void 0!==e.northing_at_false_origin&&(e.y0=e.northing_at_false_origin),void 0!==e.latitude_of_natural_origin&&(e.lat0=e.latitude_of_natural_origin),void 0!==e.longitude_of_natural_origin&&(e.long0=e.longitude_of_natural_origin),void 0!==e.longitude_of_origin&&(e.long0=e.longitude_of_origin),void 0!==e.false_easting&&(e.x0=e.false_easting),e.easting_at_projection_centre&&(e.x0=e.easting_at_projection_centre),void 0!==e.false_northing&&(e.y0=e.false_northing),e.northing_at_projection_centre&&(e.y0=e.northing_at_projection_centre),void 0!==e.standard_parallel_1&&(e.lat1=e.standard_parallel_1),void 0!==e.standard_parallel_2&&(e.lat2=e.standard_parallel_2),void 0!==e.scale_factor_at_natural_origin&&(e.k0=e.scale_factor_at_natural_origin),void 0!==e.scale_factor_at_projection_centre&&(e.k0=e.scale_factor_at_projection_centre),void 0!==e.scale_factor_on_pseudo_standard_parallel&&(e.k0=e.scale_factor_on_pseudo_standard_parallel),void 0!==e.azimuth&&(e.alpha=e.azimuth),void 0!==e.azimuth_at_projection_centre&&(e.alpha=e.azimuth_at_projection_centre),e.angle_from_rectified_to_skew_grid&&(e.rectified_grid_angle=e.angle_from_rectified_to_skew_grid),sp(e),e):t}var fp=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function dp(t){for(var e=Object.keys(t),n=0,r=e.length;n<r;++n){var i=e[n];-1!==fp.indexOf(i)&&pp(t[i]),"object"==typeof t[i]&&dp(t[i])}}function pp(t){if(t.AUTHORITY){var e=Object.keys(t.AUTHORITY)[0];e&&e in t.AUTHORITY&&(t.title=e+":"+t.AUTHORITY[e])}if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var n="",r=0,i=t.AXIS.length;r<i;++r){var a=[t.AXIS[r][0].toLowerCase(),t.AXIS[r][1].toLowerCase()];-1!==a[0].indexOf("north")||("y"===a[0]||"lat"===a[0])&&"north"===a[1]?n+="n":-1!==a[0].indexOf("south")||("y"===a[0]||"lat"===a[0])&&"south"===a[1]?n+="s":-1!==a[0].indexOf("east")||("x"===a[0]||"lon"===a[0])&&"east"===a[1]?n+="e":-1===a[0].indexOf("west")&&("x"!==a[0]&&"lon"!==a[0]||"west"!==a[1])||(n+="w")}2===n.length&&(n+="u"),3===n.length&&(t.axis=n)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var o=t.GEOGCS;function s(e){return e*(t.to_meter||1)}"GEOGCS"===t.type&&(o=t),o&&(o.DATUM?t.datumCode=o.DATUM.name.toLowerCase():t.datumCode=o.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_1949"===t.datumCode&&(t.datumCode="nzgd49"),"wgs_1984"!==t.datumCode&&"world_geodetic_system_1984"!==t.datumCode||("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"belge_1972"===t.datumCode&&(t.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(t.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=o.DATUM.SPHEROID.a,t.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(t.datum_params=o.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),t.rectified_grid_angle&&(t.rectified_grid_angle=op(t.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",op],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",op],["x0","false_easting",s],["y0","false_northing",s],["long0","central_meridian",op],["lat0","latitude_of_origin",op],["lat0","standard_parallel_1",op],["lat1","standard_parallel_1",op],["lat2","standard_parallel_2",op],["azimuth","Azimuth"],["alpha","azimuth",op],["srsCode","name"]].forEach(function(e){return function(t,e){var n=e[0],r=e[1];!(n in t)&&r in t&&(t[n]=t[r],3===e.length&&(t[n]=e[2](t[n])))}(t,e)}),sp(t)}function gp(t){if("object"==typeof t)return hp(t);const e=function(t){const e=t.toUpperCase();return e.includes("PROJCRS")||e.includes("GEOGCRS")||e.includes("BOUNDCRS")||e.includes("VERTCRS")||e.includes("LENGTHUNIT")||e.includes("ANGLEUNIT")||e.includes("SCALEUNIT")?"WKT2":(e.includes("PROJCS")||e.includes("GEOGCS")||e.includes("LOCAL_CS")||e.includes("VERT_CS")||e.includes("UNIT"),"WKT1")}(t);var n=Jd(t);if("WKT2"===e){return hp(Xd(n))}var r=n[0],i={};return ap(n,i),dp(i),i[r]}function mp(t){var e=this;if(2===arguments.length){var n=arguments[1];"string"==typeof n?"+"===n.charAt(0)?mp[t]=Hd(arguments[1]):mp[t]=gp(arguments[1]):mp[t]=n}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){return Array.isArray(t)?mp.apply(e,t):mp(t)});if("string"==typeof t){if(t in mp)return mp[t]}else"EPSG"in t?mp["EPSG:"+t.EPSG]=t:"ESRI"in t?mp["ESRI:"+t.ESRI]=t:"IAU2000"in t?mp["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("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 e=1;e<=60;++e)t("EPSG:"+(32600+e),"+proj=utm +zone="+e+" +datum=WGS84 +units=m"),t("EPSG:"+(32700+e),"+proj=utm +zone="+e+" +south +datum=WGS84 +units=m");t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(mp);const vp=mp;var _p=["3857","900913","3785","102113"];const yp=function(t){if(!function(t){return"string"==typeof t}(t))return"projName"in t?t:gp(t);if(function(t){return t in vp}(t))return vp[t];if(function(t){return 0!==t.indexOf("+")&&-1!==t.indexOf("[")||"object"==typeof t&&!("srsCode"in t)}(t)){var e=gp(t);if(function(t){var e=Ud(t,"authority");if(e){var n=Ud(e,"epsg");return n&&_p.indexOf(n)>-1}}(e))return vp["EPSG:3857"];var n=function(t){var e=Ud(t,"extension");if(e)return Ud(e,"proj4")}(e);return n?Hd(n):e}return function(t){return"+"===t[0]}(t)?Hd(t):void 0};function xp(t,e){var n,r;if(t=t||{},!e)return t;for(r in e)void 0!==(n=e[r])&&(t[r]=n);return t}function bp(t,e,n){var r=t*e;return n/Math.sqrt(1-r*r)}function wp(t){return t<0?-1:1}function Mp(t){return Math.abs(t)<=jd?t:t-wp(t)*Gd}function Sp(t,e,n){var r=t*n,i=.5*t;return r=Math.pow((1-r)/(1+r),i),Math.tan(.5*(Nd-e))/r}function Cp(t,e){for(var n,r,i=.5*t,a=Nd-2*Math.atan(e),o=0;o<=15;o++)if(n=t*Math.sin(a),a+=r=Nd-2*Math.atan(e*Math.pow((1-n)/(1+n),i))-a,Math.abs(r)<=1e-10)return a;return-9999}const Ep={init:function(){var t=this.b/this.a;this.es=1-t*t,"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=bp(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(t){var e,n,r=t.x,i=t.y;if(i*zd>90&&i*zd<-90&&r*zd>180&&r*zd<-180)return null;if(Math.abs(Math.abs(i)-Nd)<=Od)return null;if(this.sphere)e=this.x0+this.a*this.k0*Mp(r-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan(Id+.5*i));else{var a=Math.sin(i),o=Sp(this.e,i,a);e=this.x0+this.a*this.k0*Mp(r-this.long0),n=this.y0-this.a*this.k0*Math.log(o)}return t.x=e,t.y=n,t},inverse:function(t){var e,n,r=t.x-this.x0,i=t.y-this.y0;if(this.sphere)n=Nd-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var a=Math.exp(-i/(this.a*this.k0));if(-9999===(n=Cp(this.e,a)))return null}return e=Mp(this.long0+r/(this.a*this.k0)),t.x=e,t.y=n,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"]};function kp(t){return t}var Ap=[Ep,{init:function(){},forward:kp,inverse:kp,names:["longlat","identity"]}],Tp={},Pp=[];function Fp(t,e){var n=Pp.length;return t.names?(Pp[n]=t,t.names.forEach(function(t){Tp[t.toLowerCase()]=n}),this):(console.log(e),!0)}function Lp(t){return t.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}const Np={start:function(){Ap.forEach(Fp)},add:Fp,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==Tp[e]&&Pp[Tp[e]]||(e=Lp(e))in Tp&&Pp[Tp[e]]?Pp[Tp[e]]:void 0}};const Op={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)"}},Dp=Op.WGS84;var zp={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 Ip in zp){var Gp=zp[Ip];Gp.datumName&&(zp[Gp.datumName]=Gp)}const jp=zp;const Rp=function(t,e,n,r,i,a,o){var s={};return s.datum_type=void 0===t||"none"===t?5:4,e&&(s.datum_params=e.map(parseFloat),0===s.datum_params[0]&&0===s.datum_params[1]&&0===s.datum_params[2]||(s.datum_type=1),s.datum_params.length>3&&(0===s.datum_params[3]&&0===s.datum_params[4]&&0===s.datum_params[5]&&0===s.datum_params[6]||(s.datum_type=2,s.datum_params[3]*=Ld,s.datum_params[4]*=Ld,s.datum_params[5]*=Ld,s.datum_params[6]=s.datum_params[6]/1e6+1))),o&&(s.datum_type=3,s.grids=o),s.a=n,s.b=r,s.es=i,s.ep2=a,s};var Bp={};async function Wp(t,e){for(var n=[],r=await e.getImageCount(),i=r-1;i>=0;i--){var a=await e.getImage(i),o=await a.readRasters(),s=[a.getWidth(),a.getHeight()],l=a.getBoundingBox().map(Up),c=[a.fileDirectory.ModelPixelScale[0],a.fileDirectory.ModelPixelScale[1]].map(Up),u=l[0]+(s[0]-1)*c[0],h=l[3]-(s[1]-1)*c[1],f=o[0],d=o[1],p=[];for(let t=s[1]-1;t>=0;t--)for(let e=s[0]-1;e>=0;e--){var g=t*s[0]+e;p.push([-Hp(d[g]),Hp(f[g])])}n.push({del:c,lim:s,ll:[-u,h],cvs:p})}var m={header:{nSubgrids:r},subgrids:n};return Bp[t]=m,m}function qp(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:Bp[t]||null,isNull:!1}}function Up(t){return t*Math.PI/180}function Hp(t){return t/3600*Math.PI/180}function Vp(t,e,n){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,n)))}function Yp(t){return t.map(function(t){return[Hp(t.longitudeShift),Hp(t.latitudeShift)]})}function $p(t,e,n){return{name:Vp(t,e+8,e+16).trim(),parent:Vp(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,n),upperLatitude:t.getFloat64(e+88,n),lowerLongitude:t.getFloat64(e+104,n),upperLongitude:t.getFloat64(e+120,n),latitudeInterval:t.getFloat64(e+136,n),longitudeInterval:t.getFloat64(e+152,n),gridNodeCount:t.getInt32(e+168,n)}}function Xp(t,e,n,r,i){var a=e+176,o=16;!1===i&&(o=8);for(var s=[],l=0;l<n.gridNodeCount;l++){var c={latitudeShift:t.getFloat32(a+l*o,r),longitudeShift:t.getFloat32(a+l*o+4,r)};!1!==i&&(c.latitudeAccuracy=t.getFloat32(a+l*o+8,r),c.longitudeAccuracy=t.getFloat32(a+l*o+12,r)),s.push(c)}return s}function Jp(t,e){if(!(this instanceof Jp))return new Jp(t);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,e=e||function(t){if(t)throw t};var n=yp(t);if("object"==typeof n){var r=Jp.projections.get(n.projName);if(r){if(n.datumCode&&"none"!==n.datumCode){var i=Ud(jp,n.datumCode);i&&(n.datum_params=n.datum_params||(i.towgs84?i.towgs84.split(","):null),n.ellps=i.ellipse,n.datumName=i.datumName?i.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||"enu",n.ellps=n.ellps||"wgs84",n.lat1=n.lat1||n.lat0;var a=function(t,e,n,r,i){if(!t){var a=Ud(Op,r);a||(a=Dp),t=a.a,e=a.b,n=a.rf}return n&&!e&&(e=(1-1/n)*t),(0===n||Math.abs(t-e)<Od)&&(i=!0,e=t),{a:t,b:e,rf:n,sphere:i}}(n.a,n.b,n.rf,n.ellps,n.sphere),o=function(t,e,n,r){var i=t*t,a=e*e,o=(i-a)/i,s=0;return r?(i=(t*=1-o*(.16666666666666666+o*(.04722222222222222+.022156084656084655*o)))*t,o=0):s=Math.sqrt(o),{es:o,e:s,ep2:(i-a)/a}}(a.a,a.b,a.rf,n.R_A),s=function(t){return void 0===t?null:t.split(",").map(qp)}(n.nadgrids),l=n.datum||Rp(n.datumCode,n.datum_params,a.a,a.b,o.es,o.ep2,s);xp(this,n),xp(this,r),this.a=a.a,this.b=a.b,this.rf=a.rf,this.sphere=a.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=l,"init"in this&&"function"==typeof this.init&&this.init(),e(null,this)}else e("Could not get projection name from: "+t)}else e("Could not parse to valid json: "+t)}Jp.projections=Np,Jp.projections.start();const Zp=Jp;function Kp(t,e,n){var r,i,a,o,s=t.x,l=t.y,c=t.z?t.z:0;if(l<-Nd&&l>-1.001*Nd)l=-Nd;else if(l>Nd&&l<1.001*Nd)l=Nd;else{if(l<-Nd)return{x:-1/0,y:-1/0,z:t.z};if(l>Nd)return{x:1/0,y:1/0,z:t.z}}return s>Math.PI&&(s-=2*Math.PI),i=Math.sin(l),o=Math.cos(l),a=i*i,{x:((r=n/Math.sqrt(1-e*a))+c)*o*Math.cos(s),y:(r+c)*o*Math.sin(s),z:(r*(1-e)+c)*i}}function Qp(t,e,n,r){var i,a,o,s,l,c,u,h,f,d,p,g,m,v,_,y=1e-12,x=t.x,b=t.y,w=t.z?t.z:0;if(i=Math.sqrt(x*x+b*b),a=Math.sqrt(x*x+b*b+w*w),i/n<y){if(v=0,a/n<y)return _=-r,{x:t.x,y:t.y,z:t.z}}else v=Math.atan2(b,x);o=w/a,h=(s=i/a)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*s*s)),f=o*l,m=0;do{m++,c=e*(u=n/Math.sqrt(1-e*f*f))/(u+(_=i*h+w*f-u*(1-e*f*f))),g=(p=o*(l=1/Math.sqrt(1-c*(2-c)*s*s)))*h-(d=s*(1-c)*l)*f,h=d,f=p}while(g*g>1e-24&&m<30);return{x:v,y:Math.atan(p/Math.abs(d)),z:_}}function tg(t){return 1===t||2===t}function eg(t,e,n){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return n;if(5===t.datum_type||5===e.datum_type)return n;var r=t.a,i=t.es;if(3===t.datum_type){if(0!==ng(t,!1,n))return;r=Pd,i=Fd}var a=e.a,o=e.b,s=e.es;if(3===e.datum_type&&(a=Pd,o=6356752.314,s=Fd),i===s&&r===a&&!tg(t.datum_type)&&!tg(e.datum_type))return n;if((n=Kp(n,i,r),tg(t.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x+n[0],y:t.y+n[1],z:t.z+n[2]};if(2===e){var r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],c=n[6];return{x:c*(t.x-l*t.y+s*t.z)+r,y:c*(l*t.x+t.y-o*t.z)+i,z:c*(-s*t.x+o*t.y+t.z)+a}}}(n,t.datum_type,t.datum_params)),tg(e.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x-n[0],y:t.y-n[1],z:t.z-n[2]};if(2===e){var r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],c=n[6],u=(t.x-r)/c,h=(t.y-i)/c,f=(t.z-a)/c;return{x:u+l*h-s*f,y:-l*u+h+o*f,z:s*u-o*h+f}}}(n,e.datum_type,e.datum_params)),n=Qp(n,s,a,o),3===e.datum_type)&&0!==ng(e,!0,n))return;return n}function ng(t,e,n){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var r={x:-n.x,y:n.y},i={x:Number.NaN,y:Number.NaN},a=[];t:for(var o=0;o<t.grids.length;o++){var s=t.grids[o];if(a.push(s.name),s.isNull){i=r;break}if(null!==s.grid)for(var l=s.grid.subgrids,c=0,u=l.length;c<u;c++){var h=l[c],f=(Math.abs(h.del[1])+Math.abs(h.del[0]))/1e4,d=h.ll[0]-f,p=h.ll[1]-f,g=h.ll[0]+(h.lim[0]-1)*h.del[0]+f,m=h.ll[1]+(h.lim[1]-1)*h.del[1]+f;if(!(p>r.y||d>r.x||m<r.y||g<r.x)&&(i=rg(r,e,h),!isNaN(i.x)))break t}else if(s.mandatory)return console.log("Unable to find mandatory grid '"+s.name+"'"),-1}return isNaN(i.x)?(console.log("Failed to find a grid shift table for location '"+-r.x*zd+" "+r.y*zd+" tried: '"+a+"'"),-1):(n.x=-i.x,n.y=i.y,0)}function rg(t,e,n){var r={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return r;var i={x:t.x,y:t.y};i.x-=n.ll[0],i.y-=n.ll[1],i.x=Mp(i.x-Math.PI)+Math.PI;var a=ig(i,n);if(e){if(isNaN(a.x))return r;a.x=i.x-a.x,a.y=i.y-a.y;var o,s,l=9;do{if(s=ig(a,n),isNaN(s.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}o={x:i.x-(s.x+a.x),y:i.y-(s.y+a.y)},a.x+=o.x,a.y+=o.y}while(l--&&Math.abs(o.x)>1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=Mp(a.x+n.ll[0]),r.y=a.y+n.ll[1]}else isNaN(a.x)||(r.x=t.x+a.x,r.y=t.y+a.y);return r}function ig(t,e){var n,r={x:t.x/e.del[0],y:t.y/e.del[1]},i=Math.floor(r.x),a=Math.floor(r.y),o=r.x-1*i,s=r.y-1*a,l={x:Number.NaN,y:Number.NaN};if(i<0||i>=e.lim[0])return l;if(a<0||a>=e.lim[1])return l;n=a*e.lim[0]+i;var c=e.cvs[n][0],u=e.cvs[n][1];n++;var h=e.cvs[n][0],f=e.cvs[n][1];n+=e.lim[0];var d=e.cvs[n][0],p=e.cvs[n][1];n--;var g=e.cvs[n][0],m=e.cvs[n][1],v=o*s,_=o*(1-s),y=(1-o)*(1-s),x=(1-o)*s;return l.x=y*c+_*h+x*g+v*d,l.y=y*u+_*f+x*m+v*p,l}function ag(t,e,n){var r,i,a,o=n.x,s=n.y,l=n.z||0,c={};for(a=0;a<3;a++)if(!e||2!==a||void 0!==n.z)switch(0===a?(r=o,i=-1!=="ew".indexOf(t.axis[a])?"x":"y"):1===a?(r=s,i=-1!=="ns".indexOf(t.axis[a])?"y":"x"):(r=l,i="z"),t.axis[a]){case"e":case"n":c[i]=r;break;case"w":case"s":c[i]=-r;break;case"u":void 0!==n[i]&&(c.z=r);break;case"d":void 0!==n[i]&&(c.z=-r);break;default:return null}return c}function og(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function sg(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function lg(t,e,n,r){var i,a=void 0!==(n=Array.isArray(n)?og(n):{x:n.x,y:n.y,z:n.z,m:n.m}).z;if(function(t){sg(t.x),sg(t.y)}(n),t.datum&&e.datum&&function(t,e){return(1===t.datum.datum_type||2===t.datum.datum_type||3===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type||3===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(n=lg(t,i=new Zp("WGS84"),n,r),t=i),r&&"enu"!==t.axis&&(n=ag(t,!1,n)),"longlat"===t.projName)n={x:n.x*Dd,y:n.y*Dd,z:n.z||0};else if(t.to_meter&&(n={x:n.x*t.to_meter,y:n.y*t.to_meter,z:n.z||0}),!(n=t.inverse(n)))return;if(t.from_greenwich&&(n.x+=t.from_greenwich),n=eg(t.datum,e.datum,n))return e.from_greenwich&&(n={x:n.x-e.from_greenwich,y:n.y,z:n.z||0}),"longlat"===e.projName?n={x:n.x*zd,y:n.y*zd,z:n.z||0}:(n=e.forward(n),e.to_meter&&(n={x:n.x/e.to_meter,y:n.y/e.to_meter,z:n.z||0})),r&&"enu"!==e.axis?ag(e,!0,n):(n&&!a&&delete n.z,n)}var cg=Zp("WGS84");function ug(t,e,n,r){var i,a,o;return Array.isArray(n)?(i=lg(t,e,n,r)||{x:NaN,y:NaN},n.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof i.z?[i.x,i.y,i.z].concat(n.slice(3)):[i.x,i.y,n[2]].concat(n.slice(3)):[i.x,i.y].concat(n.slice(2)):[i.x,i.y]):(a=lg(t,e,n,r),2===(o=Object.keys(n)).length||o.forEach(function(r){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===r||"y"===r||"z"===r)return}else if("x"===r||"y"===r)return;a[r]=n[r]}),a)}function hg(t){return t instanceof Zp?t:"object"==typeof t&&"oProj"in t?t.oProj:Zp(t)}const fg=function(t,e,n){var r,i,a,o=!1;return void 0===e?(i=hg(t),r=cg,o=!0):(void 0!==e.x||Array.isArray(e))&&(n=e,i=hg(t),r=cg,o=!0),r||(r=hg(t)),i||(i=hg(e)),n?ug(r,i,n):(a={forward:function(t,e){return ug(r,i,t,e)},inverse:function(t,e){return ug(i,r,t,e)}},o&&(a.oProj=i),a)};var dg="AJSAJS",pg="AFAFAF",gg=65,mg=73,vg=79,_g=86,yg=90;const xg={forward:bg,inverse:function(t){var e=Cg(Ag(t.toUpperCase()));if(e.lat&&e.lon)return[e.lon,e.lat,e.lon,e.lat];return[e.left,e.bottom,e.right,e.top]},toPoint:wg};function bg(t,e){return e=e||5,function(t,e){var n="00000"+t.easting,r="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(i=t.easting,a=t.northing,o=t.zoneNumber,s=kg(o),l=Math.floor(i/1e5),c=Math.floor(a/1e5)%20,function(t,e,n){var r=n-1,i=dg.charCodeAt(r),a=pg.charCodeAt(r),o=i+t-1,s=a+e,l=!1;return o>yg&&(o=o-yg+gg-1,l=!0),(o===mg||i<mg&&o>mg||(o>mg||i<mg)&&l)&&o++,(o===vg||i<vg&&o>vg||(o>vg||i<vg)&&l)&&++o===mg&&o++,o>yg&&(o=o-yg+gg-1),s>_g?(s=s-_g+gg-1,l=!0):l=!1,(s===mg||a<mg&&s>mg||(s>mg||a<mg)&&l)&&s++,(s===vg||a<vg&&s>vg||(s>vg||a<vg)&&l)&&++s===mg&&s++,s>_g&&(s=s-_g+gg-1),String.fromCharCode(o)+String.fromCharCode(s)}(l,c,s))+n.substr(n.length-5,e)+r.substr(r.length-5,e);var i,a,o,s,l,c}(function(t){var e,n,r,i,a,o,s,l,c=t.lat,u=t.lon,h=6378137,f=.00669438,d=.9996,p=Mg(c),g=Mg(u);l=Math.floor((u+180)/6)+1,180===u&&(l=60);c>=56&&c<64&&u>=3&&u<12&&(l=32);c>=72&&c<84&&(u>=0&&u<9?l=31:u>=9&&u<21?l=33:u>=21&&u<33?l=35:u>=33&&u<42&&(l=37));s=Mg(6*(l-1)-180+3),e=f/(1-f),n=h/Math.sqrt(1-f*Math.sin(p)*Math.sin(p)),r=Math.tan(p)*Math.tan(p),i=e*Math.cos(p)*Math.cos(p),a=Math.cos(p)*(g-s),o=h*((1-f/4-3*f*f/64-5*f*f*f/256)*p-(3*f/8+3*f*f/32+45*f*f*f/1024)*Math.sin(2*p)+(15*f*f/256+45*f*f*f/1024)*Math.sin(4*p)-35*f*f*f/3072*Math.sin(6*p));var m=d*n*(a+(1-r+i)*a*a*a/6+(5-18*r+r*r+72*i-58*e)*a*a*a*a*a/120)+5e5,v=d*(o+n*Math.tan(p)*(a*a/2+(5-r+9*i+4*i*i)*a*a*a*a/24+(61-58*r+r*r+600*i-330*e)*a*a*a*a*a*a/720));c<0&&(v+=1e7);return{northing:Math.round(v),easting:Math.round(m),zoneNumber:l,zoneLetter:Eg(c)}}({lat:t[1],lon:t[0]}),e)}function wg(t){var e=Cg(Ag(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Mg(t){return t*(Math.PI/180)}function Sg(t){return t/Math.PI*180}function Cg(t){var e=t.northing,n=t.easting,r=t.zoneLetter,i=t.zoneNumber;if(i<0||i>60)return null;var a,o,s,l,c,u,h,f,d,p=.9996,g=6378137,m=.00669438,v=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),_=n-5e5,y=e;r<"N"&&(y-=1e7),h=6*(i-1)-180+3,a=.006739496752268451,d=(f=y/p/6367449.145945056)+(3*v/2-27*v*v*v/32)*Math.sin(2*f)+(21*v*v/16-55*v*v*v*v/32)*Math.sin(4*f)+151*v*v*v/96*Math.sin(6*f),o=g/Math.sqrt(1-m*Math.sin(d)*Math.sin(d)),s=Math.tan(d)*Math.tan(d),l=a*Math.cos(d)*Math.cos(d),c=.99330562*g/Math.pow(1-m*Math.sin(d)*Math.sin(d),1.5),u=_/(o*p);var x=d-o*Math.tan(d)/c*(u*u/2-(5+3*s+10*l-4*l*l-9*a)*u*u*u*u/24+(61+90*s+298*l+45*s*s-1.6983531815716497-3*l*l)*u*u*u*u*u*u/720);x=Sg(x);var b,w=(u-(1+2*s+l)*u*u*u/6+(5-2*l+28*s-3*l*l+8*a+24*s*s)*u*u*u*u*u/120)/Math.cos(d);if(w=h+Sg(w),t.accuracy){var M=Cg({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});b={top:M.lat,right:M.lon,bottom:x,left:w}}else b={lat:x,lon:w};return b}function Eg(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function kg(t){var e=t%6;return 0===e&&(e=6),e}function Ag(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,n=t.length,r=null,i="",a=0;!/[A-Z]/.test(e=t.charAt(a));){if(a>=2)throw"MGRSPoint bad conversion from: "+t;i+=e,a++}var o=parseInt(i,10);if(0===a||a+3>n)throw"MGRSPoint bad conversion from: "+t;var s=t.charAt(a++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+t;r=t.substring(a,a+=2);for(var l=kg(o),c=function(t,e){var n=dg.charCodeAt(e-1),r=1e5,i=!1;for(;n!==t.charCodeAt(0);){if(++n===mg&&n++,n===vg&&n++,n>yg){if(i)throw"Bad character: "+t;n=gg,i=!0}r+=1e5}return r}(r.charAt(0),l),u=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var n=pg.charCodeAt(e-1),r=0,i=!1;for(;n!==t.charCodeAt(0);){if(++n===mg&&n++,n===vg&&n++,n>_g){if(i)throw"Bad character: "+t;n=gg,i=!0}r+=1e5}return r}(r.charAt(1),l);u<Tg(s);)u+=2e6;var h=n-a;if(h%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"+t;var f,d,p,g=h/2,m=0,v=0;return g>0&&(f=1e5/Math.pow(10,g),d=t.substring(a,a+g),m=parseFloat(d)*f,p=t.substring(a+g),v=parseFloat(p)*f),{easting:m+c,northing:v+u,zoneLetter:s,zoneNumber:o,accuracy:f}}function Tg(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function Pg(t,e,n){if(!(this instanceof Pg))return new Pg(t,e,n);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var r=t.split(",");this.x=parseFloat(r[0]),this.y=parseFloat(r[1]),this.z=parseFloat(r[2])||0}else this.x=t,this.y=e,this.z=n||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Pg.fromMGRS=function(t){return new Pg(wg(t))},Pg.prototype.toMGRS=function(t){return bg([this.x,this.y],t)};const Fg=Pg;var Lg=.046875,Ng=.01953125,Og=.01068115234375;function Dg(t){var e=[];e[0]=1-t*(.25+t*(Lg+t*(Ng+t*Og))),e[1]=t*(.75-t*(Lg+t*(Ng+t*Og)));var n=t*t;return e[2]=n*(.46875-t*(.013020833333333334+.007120768229166667*t)),n*=t,e[3]=n*(.3645833333333333-.005696614583333333*t),e[4]=n*t*.3076171875,e}function zg(t,e,n,r){return n*=e,e*=e,r[0]*t-n*(r[1]+e*(r[2]+e*(r[3]+e*r[4])))}function Ig(t,e,n){for(var r=1/(1-e),i=t,a=20;a;--a){var o=Math.sin(i),s=1-e*o*o;if(i-=s=(zg(i,o,Math.cos(i),n)-t)*(s*Math.sqrt(s))*r,Math.abs(s)<Od)return i}return i}const Gg={init:function(){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=Dg(this.es),this.ml0=zg(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var e,n,r,i=t.x,a=t.y,o=Mp(i-this.long0),s=Math.sin(a),l=Math.cos(a);if(this.es){var c=l*o,u=Math.pow(c,2),h=this.ep2*Math.pow(l,2),f=Math.pow(h,2),d=Math.abs(l)>Od?Math.tan(a):0,p=Math.pow(d,2),g=Math.pow(p,2);e=1-this.es*Math.pow(s,2),c/=Math.sqrt(e);var m=zg(a,s,l,this.en);n=this.a*(this.k0*c*(1+u/6*(1-p+h+u/20*(5-18*p+g+14*h-58*p*h+u/42*(61+179*g-g*p-479*p)))))+this.x0,r=this.a*(this.k0*(m-this.ml0+s*o*c/2*(1+u/12*(5-p+9*h+4*f+u/30*(61+g-58*p+270*h-330*p*h+u/56*(1385+543*g-g*p-3111*p))))))+this.y0}else{var v=l*Math.sin(o);if(Math.abs(Math.abs(v)-1)<Od)return 93;if(n=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,r=l*Math.cos(o)/Math.sqrt(1-Math.pow(v,2)),(v=Math.abs(r))>=1){if(v-1>Od)return 93;r=0}else r=Math.acos(r);a<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return t.x=n,t.y=r,t},inverse:function(t){var e,n,r,i,a=(t.x-this.x0)*(1/this.a),o=(t.y-this.y0)*(1/this.a);if(this.es)if(n=Ig(e=this.ml0+o/this.k0,this.es,this.en),Math.abs(n)<Nd){var s=Math.sin(n),l=Math.cos(n),c=Math.abs(l)>Od?Math.tan(n):0,u=this.ep2*Math.pow(l,2),h=Math.pow(u,2),f=Math.pow(c,2),d=Math.pow(f,2);e=1-this.es*Math.pow(s,2);var p=a*Math.sqrt(e)/this.k0,g=Math.pow(p,2);r=n-(e*=c)*g/(1-this.es)*.5*(1-g/12*(5+3*f-9*u*f+u-4*h-g/30*(61+90*f-252*u*f+45*d+46*u-g/56*(1385+3633*f+4095*d+1574*d*f)))),i=Mp(this.long0+p*(1-g/6*(1+2*f+u-g/20*(5+28*f+24*d+8*u*f+6*u-g/42*(61+662*f+1320*d+720*d*f))))/l)}else r=Nd*wp(o),i=0;else{var m=Math.exp(a/this.k0),v=.5*(m-1/m),_=this.lat0+o/this.k0,y=Math.cos(_);e=Math.sqrt((1-Math.pow(y,2))/(1+Math.pow(v,2))),r=Math.asin(e),o<0&&(r=-r),i=0===v&&0===y?0:Mp(Math.atan2(v,y)+this.long0)}return t.x=i,t.y=r,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function jg(t){var e=Math.exp(t);return e=(e-1/e)/2}function Rg(t,e){t=Math.abs(t),e=Math.abs(e);var n=Math.max(t,e),r=Math.min(t,e)/(n||1);return n*Math.sqrt(1+Math.pow(r,2))}function Bg(t){var e=Math.abs(t);return e=function(t){var e=1+t,n=e-1;return 0===n?t:t*Math.log(e)/n}(e*(1+e/(Rg(1,e)+1))),t<0?-e:e}function Wg(t,e){for(var n,r=2*Math.cos(2*e),i=t.length-1,a=t[i],o=0;--i>=0;)n=r*a-o+t[i],o=a,a=n;return e+n*Math.sin(2*e)}function qg(t,e,n){for(var r,i,a=Math.sin(e),o=Math.cos(e),s=jg(n),l=function(t){var e=Math.exp(t);return(e+1/e)/2}(n),c=2*o*l,u=-2*a*s,h=t.length-1,f=t[h],d=0,p=0,g=0;--h>=0;)r=p,i=d,f=c*(p=f)-r-u*(d=g)+t[h],g=u*p-i+c*d;return[(c=a*l)*f-(u=o*s)*g,c*g+u*f]}const Ug={init:function(){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&&(Gg.init.apply(this),this.forward=Gg.forward,this.inverse=Gg.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 t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),n=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),n*=e,this.cgb[1]=n*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=n*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),n*=e,this.cgb[2]=n*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=n*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),n*=e,this.cgb[3]=n*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=n*(1237/630+e*(e*(-24832/14175)-2.4)),n*=e,this.cgb[4]=n*(4174/315+e*(-144838/6237)),this.cbg[4]=n*(-734/315+e*(109598/31185)),n*=e,this.cgb[5]=n*(601676/22275),this.cbg[5]=n*(444337/155925),n=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=n*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=n*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),n*=e,this.utg[2]=n*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=n*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),n*=e,this.utg[3]=n*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=n*(49561/161280+e*(-179/168+e*(6601661/7257600))),n*=e,this.utg[4]=n*(-4583/161280+e*(108847/3991680)),this.gtu[4]=n*(34729/80640+e*(-3418889/1995840)),n*=e,this.utg[5]=n*(-20648693/638668800),this.gtu[5]=.6650675310896665*n;var r=Wg(this.cbg,this.lat0);this.Zb=-this.Qn*(r+function(t,e){for(var n,r=2*Math.cos(e),i=t.length-1,a=t[i],o=0;--i>=0;)n=r*a-o+t[i],o=a,a=n;return Math.sin(e)*n}(this.gtu,2*r))},forward:function(t){var e=Mp(t.x-this.long0),n=t.y;n=Wg(this.cbg,n);var r=Math.sin(n),i=Math.cos(n),a=Math.sin(e),o=Math.cos(e);n=Math.atan2(r,o*i),e=Math.atan2(a*i,Rg(r,i*o)),e=Bg(Math.tan(e));var s,l,c=qg(this.gtu,2*n,2*e);return n+=c[0],e+=c[1],Math.abs(e)<=2.623395162778?(s=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*n+this.Zb)+this.y0):(s=1/0,l=1/0),t.x=s,t.y=l,t},inverse:function(t){var e,n,r=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);if(i=(i-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var a=qg(this.utg,2*i,2*r);i+=a[0],r+=a[1],r=Math.atan(jg(r));var o=Math.sin(i),s=Math.cos(i),l=Math.sin(r),c=Math.cos(r);i=Math.atan2(o*c,Rg(l,c*s)),e=Mp((r=Math.atan2(l,c*s))+this.long0),n=Wg(this.cgb,i)}else e=1/0,n=1/0;return t.x=e,t.y=n,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]};const Hg={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(Mp(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*Dd,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Ug.init.apply(this),this.forward=Ug.forward,this.inverse=Ug.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function Vg(t,e){return Math.pow((1-t)/(1+t),e)}const Yg={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Id)/(Math.pow(Math.tan(.5*this.lat0+Id),this.C)*Vg(this.e*t,this.ratexp))},forward:function(t){var e=t.x,n=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+Id),this.C)*Vg(this.e*Math.sin(n),this.ratexp))-Nd,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,n=t.y,r=Math.pow(Math.tan(.5*n+Id)/this.K,1/this.C),i=20;i>0&&(n=2*Math.atan(r*Vg(this.e*Math.sin(t.y),-.5*this.e))-Nd,!(Math.abs(n-t.y)<1e-14));--i)t.y=n;return i?(t.x=e,t.y=n,t):null},names:["gauss"]};const $g={init:function(){Yg.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(t){var e,n,r,i;return t.x=Mp(t.x-this.long0),Yg.forward.apply(this,[t]),e=Math.sin(t.y),n=Math.cos(t.y),r=Math.cos(t.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*n*r),t.x=i*n*Math.sin(t.x),t.y=i*(this.cosc0*e-this.sinc0*n*r),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,n,r,i,a;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,a=Rg(t.x,t.y)){var o=2*Math.atan2(a,this.R2);e=Math.sin(o),n=Math.cos(o),i=Math.asin(n*this.sinc0+t.y*e*this.cosc0/a),r=Math.atan2(t.x*e,a*this.cosc0*n-t.y*this.sinc0*e)}else i=this.phic0,r=0;return t.x=r,t.y=i,Yg.inverse.apply(this,[t]),t.x=Mp(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};function Xg(t,e,n){return e*=n,Math.tan(.5*(Nd+t))*Math.pow((1-e)/(1+e),.5*n)}const Jg={init:function(){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)<=Od&&(this.k0=.5*(1+wp(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=Od&&(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)<=Od&&Math.abs(Math.cos(this.lat_ts))>Od&&(this.k0=.5*this.cons*bp(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Sp(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=bp(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(Xg(this.lat0,this.sinlat0,this.e))-Nd,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,n,r,i,a,o,s=t.x,l=t.y,c=Math.sin(l),u=Math.cos(l),h=Mp(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=Od&&Math.abs(l+this.lat0)<=Od?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*c+this.coslat0*u*Math.cos(h)),t.x=this.a*e*u*Math.sin(h)+this.x0,t.y=this.a*e*(this.coslat0*c-this.sinlat0*u*Math.cos(h))+this.y0,t):(n=2*Math.atan(Xg(l,c,this.e))-Nd,i=Math.cos(n),r=Math.sin(n),Math.abs(this.coslat0)<=Od?(a=Sp(this.e,l*this.con,this.con*c),o=2*this.a*this.k0*a/this.cons,t.x=this.x0+o*Math.sin(s-this.long0),t.y=this.y0-this.con*o*Math.cos(s-this.long0),t):(Math.abs(this.sinlat0)<Od?(e=2*this.a*this.k0/(1+i*Math.cos(h)),t.y=e*r):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*i*Math.cos(h))),t.y=e*(this.cosX0*r-this.sinX0*i*Math.cos(h))+this.y0),t.x=e*i*Math.sin(h)+this.x0,t))},inverse:function(t){var e,n,r,i,a;t.x-=this.x0,t.y-=this.y0;var o=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var s=2*Math.atan(o/(2*this.a*this.k0));return e=this.long0,n=this.lat0,o<=Od?(t.x=e,t.y=n,t):(n=Math.asin(Math.cos(s)*this.sinlat0+t.y*Math.sin(s)*this.coslat0/o),e=Math.abs(this.coslat0)<Od?this.lat0>0?Mp(this.long0+Math.atan2(t.x,-1*t.y)):Mp(this.long0+Math.atan2(t.x,t.y)):Mp(this.long0+Math.atan2(t.x*Math.sin(s),o*this.coslat0*Math.cos(s)-t.y*this.sinlat0*Math.sin(s))),t.x=e,t.y=n,t)}if(Math.abs(this.coslat0)<=Od){if(o<=Od)return n=this.lat0,e=this.long0,t.x=e,t.y=n,t;t.x*=this.con,t.y*=this.con,r=o*this.cons/(2*this.a*this.k0),n=this.con*Cp(this.e,r),e=this.con*Mp(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else i=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o<=Od?a=this.X0:(a=Math.asin(Math.cos(i)*this.sinX0+t.y*Math.sin(i)*this.cosX0/o),e=Mp(this.long0+Math.atan2(t.x*Math.sin(i),o*this.cosX0*Math.cos(i)-t.y*this.sinX0*Math.sin(i)))),n=-1*Cp(this.e,Math.tan(.5*(Nd+a)));return t.x=e,t.y=n,t},names:["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"],ssfn_:Xg};const Zg={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),n=this.a,r=1/this.rf,i=2*r-Math.pow(r,2),a=this.e=Math.sqrt(i);this.R=this.k0*n*Math.sqrt(1-i)/(1-i*Math.pow(e,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+a*e)/(1-a*e));this.K=o-this.alpha*s+this.alpha*a/2*l},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),r=-this.alpha*(e+n)+this.K,i=2*(Math.atan(Math.exp(r))-Math.PI/4),a=this.alpha*(t.x-this.lambda0),o=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(a))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(a));return t.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,t.x=this.R*o+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,n=t.y-this.y0,r=e/this.R,i=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(r)),o=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+o/this.alpha,l=0,c=a,u=-1e3,h=0;Math.abs(c-u)>1e-7;){if(++h>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),u=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=s,t.y=c,t},names:["somerc"]};var Kg=1e-7;const Qg={init:function(){var t,e,n,r,i,a,o,s,l,c,u,h,f,d,p=0,g=0,m=0,v=0,_=0,y=0,x=0;this.no_off=(f=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],d="object"==typeof(h=this).projName?Object.keys(h.projName)[0]:h.projName,"no_uoff"in h||"no_off"in h||-1!==f.indexOf(d)||-1!==f.indexOf(Lp(d))),this.no_rot="no_rot"in this;var b=!1;"alpha"in this&&(b=!0);var w=!1;if("rectified_grid_angle"in this&&(w=!0),b&&(x=this.alpha),w&&(p=this.rectified_grid_angle),b||w)g=this.longc;else if(m=this.long1,_=this.lat1,v=this.long2,y=this.lat2,Math.abs(_-y)<=Kg||(t=Math.abs(_))<=Kg||Math.abs(t-Nd)<=Kg||Math.abs(Math.abs(this.lat0)-Nd)<=Kg||Math.abs(Math.abs(y)-Nd)<=Kg)throw new Error;var M=1-this.es;e=Math.sqrt(M),Math.abs(this.lat0)>Od?(s=Math.sin(this.lat0),n=Math.cos(this.lat0),t=1-this.es*s*s,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/M),this.A=this.B*this.k0*e/t,(i=(r=this.B*e/(n*Math.sqrt(t)))*r-1)<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=r,this.E*=Math.pow(Sp(this.e,this.lat0,s),this.B)):(this.B=1/e,this.A=this.k0,this.E=r=i=1),b||w?(b?(u=Math.asin(Math.sin(x)/r),w||(p=x)):(u=p,x=Math.asin(r*Math.sin(u))),this.lam0=g-Math.asin(.5*(i-1/i)*Math.tan(u))/this.B):(a=Math.pow(Sp(this.e,_,Math.sin(_)),this.B),o=Math.pow(Sp(this.e,y,Math.sin(y)),this.B),i=this.E/a,l=(o-a)/(o+a),c=((c=this.E*this.E)-o*a)/(c+o*a),(t=m-v)<-Math.PI?v-=Gd:t>Math.PI&&(v+=Gd),this.lam0=Mp(.5*(m+v)-Math.atan(c*Math.tan(.5*this.B*(m-v))/l)/this.B),u=Math.atan(2*Math.sin(this.B*Mp(m-this.lam0))/(i-1/i)),p=x=Math.asin(r*Math.sin(u))),this.singam=Math.sin(u),this.cosgam=Math.cos(u),this.sinrot=Math.sin(p),this.cosrot=Math.cos(p),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(r*r-1)/Math.cos(x))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan(Id-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(Id+i))},forward:function(t){var e,n,r,i,a,o,s,l,c={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-Nd)>Od){if(e=.5*((a=this.E/Math.pow(Sp(this.e,t.y,Math.sin(t.y)),this.B))-(o=1/a)),n=.5*(a+o),i=Math.sin(this.B*t.x),r=(e*this.singam-i*this.cosgam)/n,Math.abs(Math.abs(r)-1)<Od)throw new Error;l=.5*this.ArB*Math.log((1-r)/(1+r)),o=Math.cos(this.B*t.x),s=Math.abs(o)<Kg?this.A*t.x:this.ArB*Math.atan2(e*this.cosgam+i*this.singam,o)}else l=t.y>0?this.v_pole_n:this.v_pole_s,s=this.ArB*t.y;return this.no_rot?(c.x=s,c.y=l):(s-=this.u_0,c.x=l*this.cosrot+s*this.sinrot,c.y=s*this.cosrot-l*this.sinrot),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function(t){var e,n,r,i,a,o,s,l={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(n=t.y,e=t.x):(n=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),i=.5*((r=Math.exp(-this.BrA*n))-1/r),a=.5*(r+1/r),s=((o=Math.sin(this.BrA*e))*this.cosgam+i*this.singam)/a,Math.abs(Math.abs(s)-1)<Od)l.x=0,l.y=s<0?-Nd:Nd;else{if(l.y=this.E/Math.sqrt((1+s)/(1-s)),l.y=Cp(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(i*this.cosgam-o*this.singam,Math.cos(this.BrA*e))}return l.x+=this.lam0,l},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 tm={init:function(){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)<Od)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),n=Math.cos(this.lat1),r=bp(this.e,e,n),i=Sp(this.e,this.lat1,e),a=Math.sin(this.lat2),o=Math.cos(this.lat2),s=bp(this.e,a,o),l=Sp(this.e,this.lat2,a),c=Math.abs(Math.abs(this.lat0)-Nd)<Od?0:Sp(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>Od?this.ns=Math.log(r/s)/Math.log(i/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=r/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,n=t.y;Math.abs(2*Math.abs(n)-Math.PI)<=Od&&(n=wp(n)*(Nd-2e-10));var r,i,a=Math.abs(Math.abs(n)-Nd);if(a>Od)r=Sp(this.e,n,Math.sin(n)),i=this.a*this.f0*Math.pow(r,this.ns);else{if((a=n*this.ns)<=0)return null;i=0}var o=this.ns*Mp(e-this.long0);return t.x=this.k0*(i*Math.sin(o))+this.x0,t.y=this.k0*(this.rh-i*Math.cos(o))+this.y0,t},inverse:function(t){var e,n,r,i,a,o=(t.x-this.x0)/this.k0,s=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+s*s),n=1):(e=-Math.sqrt(o*o+s*s),n=-1);var l=0;if(0!==e&&(l=Math.atan2(n*o,n*s)),0!==e||this.ns>0){if(n=1/this.ns,r=Math.pow(e/(this.a*this.f0),n),-9999===(i=Cp(this.e,r)))return null}else i=-Nd;return a=Mp(l/this.ns+this.long0),t.x=a,t.y=i,t},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 em={init:function(){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(t){var e,n,r,i,a,o,s,l=t.x,c=t.y,u=Mp(l-this.long0);return e=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/e)-this.s45),r=-u*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),a=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),o=this.n*a,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),t.y=s*Math.cos(o)/1,t.x=s*Math.sin(o)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,n,r,i,a,o,s,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),a=Math.sqrt(t.x*t.x+t.y*t.y),i=Math.atan2(t.y,t.x)/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),n=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(e)),t.x=this.long0-n/this.alfa,o=e,s=0;var c=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-t.y)<1e-10&&(s=1),o=t.y,c+=1}while(0===s&&c<15);return c>=15?null:t},names:["Krovak","krovak"]};function nm(t,e,n,r,i){return t*i-e*Math.sin(2*i)+n*Math.sin(4*i)-r*Math.sin(6*i)}function rm(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function im(t){return.375*t*(1+.25*t*(1+.46875*t))}function am(t){return.05859375*t*t*(1+.75*t)}function om(t){return t*t*t*(35/3072)}function sm(t,e,n){var r=e*n;return t/Math.sqrt(1-r*r)}function lm(t){return Math.abs(t)<Nd?t:t-wp(t)*Math.PI}function cm(t,e,n,r,i){var a,o;a=t/e;for(var s=0;s<15;s++)if(a+=o=(t-(e*a-n*Math.sin(2*a)+r*Math.sin(4*a)-i*Math.sin(6*a)))/(e-2*n*Math.cos(2*a)+4*r*Math.cos(4*a)-6*i*Math.cos(6*a)),Math.abs(o)<=1e-10)return a;return NaN}const um={init:function(){this.sphere||(this.e0=rm(this.es),this.e1=im(this.es),this.e2=am(this.es),this.e3=om(this.es),this.ml0=this.a*nm(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(t){var e,n,r=t.x,i=t.y;if(r=Mp(r-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(i)*Math.sin(r)),n=this.a*(Math.atan2(Math.tan(i),Math.cos(r))-this.lat0);else{var a=Math.sin(i),o=Math.cos(i),s=sm(this.a,this.e,a),l=Math.tan(i)*Math.tan(i),c=r*Math.cos(i),u=c*c,h=this.es*o*o/(1-this.es);e=s*c*(1-u*l*(1/6-(8-l+8*h)*u/120)),n=this.a*nm(this.e0,this.e1,this.e2,this.e3,i)-this.ml0+s*a/o*u*(.5+(5-l+6*h)*u/24)}return t.x=e+this.x0,t.y=n+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,n,r=t.x/this.a,i=t.y/this.a;if(this.sphere){var a=i+this.lat0;e=Math.asin(Math.sin(a)*Math.cos(r)),n=Math.atan2(Math.tan(r),Math.cos(a))}else{var o=cm(this.ml0/this.a+i,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-Nd)<=Od)return t.x=this.long0,t.y=Nd,i<0&&(t.y*=-1),t;var s=sm(this.a,this.e,Math.sin(o)),l=s*s*s/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(o),2),u=r*this.a/s,h=u*u;e=o-s*Math.tan(o)/l*u*u*(.5-(1+3*c)*u*u/24),n=u*(1-h*(c/3+(1+3*c)*c*h/15))/Math.cos(o)}return t.x=Mp(n+this.long0),t.y=lm(e),t},names:["Cassini","Cassini_Soldner","cass"]};function hm(t,e){var n;return t>1e-7?(1-t*t)*(e/(1-(n=t*e)*n)-.5/t*Math.log((1-n)/(1+n))):2*e}var fm=.3333333333333333,dm=.17222222222222222,pm=.10257936507936508,gm=.06388888888888888,mm=.0664021164021164,vm=.016415012942191543;const _m={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-Nd)<Od?this.mode=this.lat0<0?1:2:Math.abs(e)<Od?this.mode=3:this.mode=4,this.es>0)switch(this.qp=hm(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,n=[];return n[0]=t*fm,e=t*t,n[0]+=e*dm,n[1]=e*gm,e*=t,n[0]+=e*pm,n[1]+=e*mm,n[2]=e*vm,n}(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),t=Math.sin(this.lat0),this.sinb1=hm(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*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(t){var e,n,r,i,a,o,s,l,c,u,h=t.x,f=t.y;if(h=Mp(h-this.long0),this.sphere){if(a=Math.sin(f),u=Math.cos(f),r=Math.cos(h),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((n=this.mode===this.EQUIT?1+u*r:1+this.sinph0*a+this.cosph0*u*r)<=Od)return null;e=(n=Math.sqrt(2/n))*u*Math.sin(h),n*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*u*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(f+this.lat0)<Od)return null;n=Id-.5*f,e=(n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)))*Math.sin(h),n*=r}}else{switch(s=0,l=0,c=0,r=Math.cos(h),i=Math.sin(h),a=Math.sin(f),o=hm(this.e,a),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(s=o/this.qp,l=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:c=1+this.sinb1*s+this.cosb1*l*r;break;case this.EQUIT:c=1+l*r;break;case this.N_POLE:c=Nd+f,o=this.qp-o;break;case this.S_POLE:c=f-Nd,o=this.qp+o}if(Math.abs(c)<Od)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:c=Math.sqrt(2/c),n=this.mode===this.OBLIQ?this.ymf*c*(this.cosb1*s-this.sinb1*l*r):(c=Math.sqrt(2/(1+l*r)))*s*this.ymf,e=this.xmf*c*l*i;break;case this.N_POLE:case this.S_POLE:o>=0?(e=(c=Math.sqrt(o))*i,n=r*(this.mode===this.S_POLE?c:-c)):e=n=0}}return t.x=this.a*e+this.x0,t.y=this.a*n+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,n,r,i,a,o,s,l=t.x/this.a,c=t.y/this.a;if(this.sphere){var u,h=0,f=0;if((n=.5*(u=Math.sqrt(l*l+c*c)))>1)return null;switch(n=2*Math.asin(n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(f=Math.sin(n),h=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(u)<=Od?0:Math.asin(c*f/u),l*=f,c=h*u;break;case this.OBLIQ:n=Math.abs(u)<=Od?this.lat0:Math.asin(h*this.sinph0+c*f*this.cosph0/u),l*=f*this.cosph0,c=(h-Math.sin(n)*this.sinph0)*u;break;case this.N_POLE:c=-c,n=Nd-n;break;case this.S_POLE:n-=Nd}e=0!==c||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(l,c):0}else{if(s=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(l/=this.dd,c*=this.dd,(o=Math.sqrt(l*l+c*c))<Od)return t.x=this.long0,t.y=this.lat0,t;i=2*Math.asin(.5*o/this.rq),r=Math.cos(i),l*=i=Math.sin(i),this.mode===this.OBLIQ?(s=r*this.sinb1+c*i*this.cosb1/o,a=this.qp*s,c=o*this.cosb1*r-c*this.sinb1*i):(s=c*i/o,a=this.qp*s,c=o*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(c=-c),!(a=l*l+c*c))return t.x=this.long0,t.y=this.lat0,t;s=1-a/this.qp,this.mode===this.S_POLE&&(s=-s)}e=Math.atan2(l,c),n=function(t,e){var n=t+t;return t+e[0]*Math.sin(n)+e[1]*Math.sin(n+n)+e[2]*Math.sin(n+n+n)}(Math.asin(s),this.apa)}return t.x=Mp(this.long0+e),t.y=n,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function ym(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}const xm={init:function(){Math.abs(this.lat1+this.lat2)<Od||(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=bp(this.e3,this.sin_po,this.cos_po),this.qs1=hm(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=bp(this.e3,this.sin_po,this.cos_po),this.qs2=hm(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=hm(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>Od?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(t){var e=t.x,n=t.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var r=hm(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,a=this.ns0*Mp(e-this.long0),o=i*Math.sin(a)+this.x0,s=this.rh-i*Math.cos(a)+this.y0;return t.x=o,t.y=s,t},inverse:function(t){var e,n,r,i,a,o;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),r=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1),i=0,0!==e&&(i=Math.atan2(r*t.x,r*t.y)),r=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-r*r)/(2*this.ns0)):(n=(this.c-r*r)/this.ns0,o=this.phi1z(this.e3,n)),a=Mp(i/this.ns0+this.long0),t.x=a,t.y=o,t},names:["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"],phi1z:function(t,e){var n,r,i,a,o=ym(.5*e);if(t<Od)return o;for(var s=t*t,l=1;l<=25;l++)if(o+=a=.5*(i=1-(r=t*(n=Math.sin(o)))*r)*i/Math.cos(o)*(e/(1-s)-n/i+.5/t*Math.log((1-r)/(1+r))),Math.abs(a)<=1e-7)return o;return null}};const bm={init:function(){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(t){var e,n,r,i,a,o,s,l=t.x,c=t.y;return r=Mp(l-this.long0),e=Math.sin(c),n=Math.cos(c),i=Math.cos(r),(a=this.sin_p14*e+this.cos_p14*n*i)>0||Math.abs(a)<=Od?(o=this.x0+1*this.a*n*Math.sin(r)/a,s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*i)/a):(o=this.x0+this.infinity_dist*n*Math.sin(r),s=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*n*i)),t.x=o,t.y=s,t},inverse:function(t){var e,n,r,i,a,o;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(i=Math.atan2(e,this.rc),n=Math.sin(i),o=ym((r=Math.cos(i))*this.sin_p14+t.y*n*this.cos_p14/e),a=Math.atan2(t.x*n,e*this.cos_p14*r-t.y*this.sin_p14*n),a=Mp(this.long0+a)):(o=this.phic0,a=0),t.x=a,t.y=o,t},names:["gnom"]};const wm={init:function(){this.sphere||(this.k0=bp(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,n,r=t.x,i=t.y,a=Mp(r-this.long0);if(this.sphere)e=this.x0+this.a*a*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var o=hm(this.e,Math.sin(i));e=this.x0+this.a*this.k0*a,n=this.y0+this.a*o*.5/this.k0}return t.x=e,t.y=n,t},inverse:function(t){var e,n;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=Mp(this.long0+t.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(n=function(t,e){var n=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-n)<1e-6)return e<0?-1*Nd:Nd;for(var r,i,a,o,s=Math.asin(.5*e),l=0;l<30;l++)if(i=Math.sin(s),a=Math.cos(s),o=t*i,s+=r=Math.pow(1-o*o,2)/(2*a)*(e/(1-t*t)-i/(1-o*o)+.5/t*Math.log((1-o)/(1+o))),Math.abs(r)<=1e-10)return s;return NaN}(this.e,2*t.y*this.k0/this.a),e=Mp(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=n,t},names:["cea"]};const Mm={init:function(){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(t){var e=t.x,n=t.y,r=Mp(e-this.long0),i=lm(n-this.lat0);return t.x=this.x0+this.a*r*this.rc,t.y=this.y0+this.a*i,t},inverse:function(t){var e=t.x,n=t.y;return t.x=Mp(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=lm(this.lat0+(n-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"]};const Sm={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=rm(this.es),this.e1=im(this.es),this.e2=am(this.es),this.e3=om(this.es),this.ml0=this.a*nm(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,n,r,i=t.x,a=t.y,o=Mp(i-this.long0);if(r=o*Math.sin(a),this.sphere)Math.abs(a)<=Od?(e=this.a*o,n=-1*this.a*this.lat0):(e=this.a*Math.sin(r)/Math.tan(a),n=this.a*(lm(a-this.lat0)+(1-Math.cos(r))/Math.tan(a)));else if(Math.abs(a)<=Od)e=this.a*o,n=-1*this.ml0;else{var s=sm(this.a,this.e,Math.sin(a))/Math.tan(a);e=s*Math.sin(r),n=this.a*nm(this.e0,this.e1,this.e2,this.e3,a)-this.ml0+s*(1-Math.cos(r))}return t.x=e+this.x0,t.y=n+this.y0,t},inverse:function(t){var e,n,r,i,a,o,s,l,c;if(r=t.x-this.x0,i=t.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=Od)e=Mp(r/this.a+this.long0),n=0;else{var u;for(o=this.lat0+i/this.a,s=r*r/this.a/this.a+o*o,l=o,a=20;a;--a)if(l+=c=-1*(o*(l*(u=Math.tan(l))+1)-l-.5*(l*l+s)*u)/((l-o)/u-1),Math.abs(c)<=Od){n=l;break}e=Mp(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(n))}else if(Math.abs(i+this.ml0)<=Od)n=0,e=Mp(this.long0+r/this.a);else{var h,f,d,p,g;for(o=(this.ml0+i)/this.a,s=r*r/this.a/this.a+o*o,l=o,a=20;a;--a)if(g=this.e*Math.sin(l),h=Math.sqrt(1-g*g)*Math.tan(l),f=this.a*nm(this.e0,this.e1,this.e2,this.e3,l),d=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=c=(o*(h*(p=f/this.a)+1)-p-.5*h*(p*p+s))/(this.es*Math.sin(2*l)*(p*p+s-2*o*p)/(4*h)+(o-p)*(h*d-2/Math.sin(2*l))-d),Math.abs(c)<=Od){n=l;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),e=Mp(this.long0+Math.asin(r*h/this.a)/Math.sin(n))}return t.x=e,t.y=n,t},names:["Polyconic","American_Polyconic","poly"]};const Cm={init:function(){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(t){var e,n=t.x,r=t.y-this.lat0,i=n-this.long0,a=r/Ld*1e-5,o=i,s=1,l=0;for(e=1;e<=10;e++)s*=a,l+=this.A[e]*s;var c,u=l,h=o,f=1,d=0,p=0,g=0;for(e=1;e<=6;e++)c=d*u+f*h,f=f*u-d*h,d=c,p=p+this.B_re[e]*f-this.B_im[e]*d,g=g+this.B_im[e]*f+this.B_re[e]*d;return t.x=g*this.a+this.x0,t.y=p*this.a+this.y0,t},inverse:function(t){var e,n,r=t.x,i=t.y,a=r-this.x0,o=(i-this.y0)/this.a,s=a/this.a,l=1,c=0,u=0,h=0;for(e=1;e<=6;e++)n=c*o+l*s,l=l*o-c*s,c=n,u=u+this.C_re[e]*l-this.C_im[e]*c,h=h+this.C_im[e]*l+this.C_re[e]*c;for(var f=0;f<this.iterations;f++){var d,p=u,g=h,m=o,v=s;for(e=2;e<=6;e++)d=g*u+p*h,p=p*u-g*h,g=d,m+=(e-1)*(this.B_re[e]*p-this.B_im[e]*g),v+=(e-1)*(this.B_im[e]*p+this.B_re[e]*g);p=1,g=0;var _=this.B_re[1],y=this.B_im[1];for(e=2;e<=6;e++)d=g*u+p*h,p=p*u-g*h,g=d,_+=e*(this.B_re[e]*p-this.B_im[e]*g),y+=e*(this.B_im[e]*p+this.B_re[e]*g);var x=_*_+y*y;u=(m*_+v*y)/x,h=(v*_-m*y)/x}var b=u,w=h,M=1,S=0;for(e=1;e<=9;e++)M*=b,S+=this.D[e]*M;var C=this.lat0+S*Ld*1e5,E=this.long0+w;return t.x=E,t.y=C,t},names:["New_Zealand_Map_Grid","nzmg"]};const Em={init:function(){},forward:function(t){var e=t.x,n=t.y,r=Mp(e-this.long0),i=this.x0+this.a*r,a=this.y0+this.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return t.x=i,t.y=a,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e=Mp(this.long0+t.x/this.a),n=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=n,t},names:["Miller_Cylindrical","mill"]};const km={init:function(){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=Dg(this.es)},forward:function(t){var e,n,r=t.x,i=t.y;if(r=Mp(r-this.long0),this.sphere){if(this.m)for(var a=this.n*Math.sin(i),o=20;o;--o){var s=(this.m*i+Math.sin(i)-a)/(this.m+Math.cos(i));if(i-=s,Math.abs(s)<Od)break}else i=1!==this.n?Math.asin(this.n*Math.sin(i)):i;e=this.a*this.C_x*r*(this.m+Math.cos(i)),n=this.a*this.C_y*i}else{var l=Math.sin(i),c=Math.cos(i);n=this.a*zg(i,l,c,this.en),e=this.a*r*c/Math.sqrt(1-this.es*l*l)}return t.x=e,t.y=n,t},inverse:function(t){var e,n,r;return t.x-=this.x0,n=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,n/=this.C_x*(this.m+Math.cos(e)),this.m?e=ym((this.m*e+Math.sin(e))/this.n):1!==this.n&&(e=ym(Math.sin(e)/this.n)),n=Mp(n+this.long0),e=lm(e)):(e=Ig(t.y/this.a,this.es,this.en),(r=Math.abs(e))<Nd?(r=Math.sin(e),n=Mp(this.long0+t.x*Math.sqrt(1-this.es*r*r)/(this.a*Math.cos(e)))):r-Od<Nd&&(n=this.long0)),t.x=n,t.y=e,t},names:["Sinusoidal","sinu"]};const Am={init:function(){},forward:function(t){for(var e=t.x,n=t.y,r=Mp(e-this.long0),i=n,a=Math.PI*Math.sin(n);;){var o=-(i+Math.sin(i)-a)/(1+Math.cos(i));if(i+=o,Math.abs(o)<Od)break}i/=2,Math.PI/2-Math.abs(n)<Od&&(r=0);var s=.900316316158*this.a*r*Math.cos(i)+this.x0,l=1.4142135623731*this.a*Math.sin(i)+this.y0;return t.x=s,t.y=l,t},inverse:function(t){var e,n;t.x-=this.x0,t.y-=this.y0,n=t.y/(1.4142135623731*this.a),Math.abs(n)>.999999999999&&(n=.999999999999),e=Math.asin(n);var r=Mp(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),n=(2*e+Math.sin(2*e))/Math.PI,Math.abs(n)>1&&(n=1);var i=Math.asin(n);return t.x=r,t.y=i,t},names:["Mollweide","moll"]};const Tm={init:function(){Math.abs(this.lat1+this.lat2)<Od||(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=rm(this.es),this.e1=im(this.es),this.e2=am(this.es),this.e3=om(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=bp(this.e,this.sin_phi,this.cos_phi),this.ml1=nm(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<Od?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=bp(this.e,this.sin_phi,this.cos_phi),this.ml2=nm(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=nm(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var e,n=t.x,r=t.y;if(this.sphere)e=this.a*(this.g-r);else{var i=nm(this.e0,this.e1,this.e2,this.e3,r);e=this.a*(this.g-i)}var a=this.ns*Mp(n-this.long0),o=this.x0+e*Math.sin(a),s=this.y0+this.rh-e*Math.cos(a);return t.x=o,t.y=s,t},inverse:function(t){var e,n,r,i;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(n=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(n=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var a=0;return 0!==n&&(a=Math.atan2(e*t.x,e*t.y)),this.sphere?(i=Mp(this.long0+a/this.ns),r=lm(this.g-n/this.a),t.x=i,t.y=r,t):(r=cm(this.g-n/this.a,this.e0,this.e1,this.e2,this.e3),i=Mp(this.long0+a/this.ns),t.x=i,t.y=r,t)},names:["Equidistant_Conic","eqdc"]};const Pm={init:function(){this.R=this.a},forward:function(t){var e,n,r=t.x,i=t.y,a=Mp(r-this.long0);Math.abs(i)<=Od&&(e=this.x0+this.R*a,n=this.y0);var o=ym(2*Math.abs(i/Math.PI));(Math.abs(a)<=Od||Math.abs(Math.abs(i)-Nd)<=Od)&&(e=this.x0,n=i>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var s=.5*Math.abs(Math.PI/a-a/Math.PI),l=s*s,c=Math.sin(o),u=Math.cos(o),h=u/(c+u-1),f=h*h,d=h*(2/c-1),p=d*d,g=Math.PI*this.R*(s*(h-p)+Math.sqrt(l*(h-p)*(h-p)-(p+l)*(f-p)))/(p+l);a<0&&(g=-g),e=this.x0+g;var m=l+h;return g=Math.PI*this.R*(d*m-s*Math.sqrt((p+l)*(l+1)-m*m))/(p+l),n=i>=0?this.y0+g:this.y0-g,t.x=e,t.y=n,t},inverse:function(t){var e,n,r,i,a,o,s,l,c,u,h,f;return t.x-=this.x0,t.y-=this.y0,h=Math.PI*this.R,a=(r=t.x/h)*r+(i=t.y/h)*i,h=3*(i*i/(l=-2*(o=-Math.abs(i)*(1+a))+1+2*i*i+a*a)+(2*(s=o-2*i*i+r*r)*s*s/l/l/l-9*o*s/l/l)/27)/(c=(o-s*s/3/l)/l)/(u=2*Math.sqrt(-c/3)),Math.abs(h)>1&&(h=h>=0?1:-1),f=Math.acos(h)/3,n=t.y>=0?(-u*Math.cos(f+Math.PI/3)-s/3/l)*Math.PI:-(-u*Math.cos(f+Math.PI/3)-s/3/l)*Math.PI,e=Math.abs(r)<Od?this.long0:Mp(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(r*r-i*i)+a*a))/2/r),t.x=e,t.y=n,t},names:["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"]};const Fm={init:function(){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(t){var e,n,r,i,a,o,s,l,c,u,h,f=t.x,d=t.y,p=Math.sin(t.y),g=Math.cos(t.y),m=Mp(f-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=Od?(t.x=this.x0+this.a*(Nd-d)*Math.sin(m),t.y=this.y0-this.a*(Nd-d)*Math.cos(m),t):Math.abs(this.sin_p12+1)<=Od?(t.x=this.x0+this.a*(Nd+d)*Math.sin(m),t.y=this.y0+this.a*(Nd+d)*Math.cos(m),t):(c=this.sin_p12*p+this.cos_p12*g*Math.cos(m),l=(s=Math.acos(c))?s/Math.sin(s):1,t.x=this.x0+this.a*l*g*Math.sin(m),t.y=this.y0+this.a*l*(this.cos_p12*p-this.sin_p12*g*Math.cos(m)),t):(e=rm(this.es),n=im(this.es),r=am(this.es),i=om(this.es),Math.abs(this.sin_p12-1)<=Od?(a=this.a*nm(e,n,r,i,Nd),o=this.a*nm(e,n,r,i,d),t.x=this.x0+(a-o)*Math.sin(m),t.y=this.y0-(a-o)*Math.cos(m),t):Math.abs(this.sin_p12+1)<=Od?(a=this.a*nm(e,n,r,i,Nd),o=this.a*nm(e,n,r,i,d),t.x=this.x0+(a+o)*Math.sin(m),t.y=this.y0+(a+o)*Math.cos(m),t):Math.abs(f)<Od&&Math.abs(d-this.lat0)<Od?(t.x=t.y=0,t):(u=function(t,e,n,r,i,a){const o=r-e,s=Math.atan((1-a)*Math.tan(t)),l=Math.atan((1-a)*Math.tan(n)),c=Math.sin(s),u=Math.cos(s),h=Math.sin(l),f=Math.cos(l);let d,p,g,m,v,_,y,x,b,w,M,S,C,E,k,A=o,T=100;do{if(p=Math.sin(A),g=Math.cos(A),m=Math.sqrt(f*p*(f*p)+(u*h-c*f*g)*(u*h-c*f*g)),0===m)return{azi1:0,s12:0};v=c*h+u*f*g,_=Math.atan2(m,v),y=u*f*p/m,x=1-y*y,b=0!==x?v-2*c*h/x:0,w=a/16*x*(4+a*(4-3*x)),d=A,A=o+(1-w)*a*y*(_+w*m*(b+w*v*(2*b*b-1)))}while(Math.abs(A-d)>1e-12&&--T>0);return 0===T?{azi1:NaN,s12:NaN}:(M=x*(i*i-i*(1-a)*(i*(1-a)))/(i*(1-a)*(i*(1-a))),S=1+M/16384*(4096+M*(M*(320-175*M)-768)),C=M/1024*(256+M*(M*(74-47*M)-128)),E=C*m*(b+C/4*(v*(2*b*b-1)-C/6*b*(4*m*m-3)*(4*b*b-3))),k=i*(1-a)*S*(_-E),{azi1:Math.atan2(f*p,u*h-c*f*g),s12:k})}(this.lat0,this.long0,d,f,this.a,this.f),h=u.azi1,t.x=u.s12*Math.sin(h),t.y=u.s12*Math.cos(h),t))},inverse:function(t){var e,n,r,i,a,o,s,l,c,u,h,f,d,p,g;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*Nd*this.a)return;return n=e/this.a,r=Math.sin(n),i=Math.cos(n),a=this.long0,Math.abs(e)<=Od?o=this.lat0:(o=ym(i*this.sin_p12+t.y*r*this.cos_p12/e),s=Math.abs(this.lat0)-Nd,a=Math.abs(s)<=Od?this.lat0>=0?Mp(this.long0+Math.atan2(t.x,-t.y)):Mp(this.long0-Math.atan2(-t.x,t.y)):Mp(this.long0+Math.atan2(t.x*r,e*this.cos_p12*i-t.y*this.sin_p12*r))),t.x=a,t.y=o,t}return l=rm(this.es),c=im(this.es),u=am(this.es),h=om(this.es),Math.abs(this.sin_p12-1)<=Od?(o=cm(((f=this.a*nm(l,c,u,h,Nd))-(e=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,l,c,u,h),a=Mp(this.long0+Math.atan2(t.x,-1*t.y)),t.x=a,t.y=o,t):Math.abs(this.sin_p12+1)<=Od?(f=this.a*nm(l,c,u,h,Nd),o=cm(((e=Math.sqrt(t.x*t.x+t.y*t.y))-f)/this.a,l,c,u,h),a=Mp(this.long0+Math.atan2(t.x,t.y)),t.x=a,t.y=o,t):(d=Math.atan2(t.x,t.y),p=Math.sqrt(t.x*t.x+t.y*t.y),g=function(t,e,n,r,i,a){const o=Math.atan((1-a)*Math.tan(t)),s=Math.sin(o),l=Math.cos(o),c=Math.sin(n),u=Math.cos(n),h=Math.atan2(s,l*u),f=l*c,d=1-f*f,p=d*(i*i-i*(1-a)*(i*(1-a)))/(i*(1-a)*(i*(1-a))),g=1+p/16384*(4096+p*(p*(320-175*p)-768)),m=p/1024*(256+p*(p*(74-47*p)-128));let v,_,y,x,b,w=r/(i*(1-a)*g),M=100;do{_=Math.cos(2*h+w),y=Math.sin(w),x=Math.cos(w),b=m*y*(_+m/4*(x*(2*_*_-1)-m/6*_*(4*y*y-3)*(4*_*_-3))),v=w,w=r/(i*(1-a)*g)+b}while(Math.abs(w-v)>1e-12&&--M>0);if(0===M)return{lat2:NaN,lon2:NaN};const S=s*y-l*x*u,C=a/16*d*(4+a*(4-3*d));return{lat2:Math.atan2(s*x+l*y*u,(1-a)*Math.sqrt(f*f+S*S)),lon2:e+(Math.atan2(y*c,l*x-s*y*u)-(1-C)*a*f*(w+C*y*(_+C*x*(2*_*_-1))))}}(this.lat0,this.long0,d,p,this.a,this.f),t.x=g.lon2,t.y=g.lat2,t)},names:["Azimuthal_Equidistant","aeqd"]};const Lm={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,n,r,i,a,o,s,l=t.x,c=t.y;return r=Mp(l-this.long0),e=Math.sin(c),n=Math.cos(c),i=Math.cos(r),((a=this.sin_p14*e+this.cos_p14*n*i)>0||Math.abs(a)<=Od)&&(o=1*this.a*n*Math.sin(r),s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*i)),t.x=o,t.y=s,t},inverse:function(t){var e,n,r,i,a,o,s;return t.x-=this.x0,t.y-=this.y0,n=ym((e=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),r=Math.sin(n),i=Math.cos(n),o=this.long0,Math.abs(e)<=Od?(s=this.lat0,t.x=o,t.y=s,t):(s=ym(i*this.sin_p14+t.y*r*this.cos_p14/e),a=Math.abs(this.lat0)-Nd,Math.abs(a)<=Od?(o=this.lat0>=0?Mp(this.long0+Math.atan2(t.x,-t.y)):Mp(this.long0-Math.atan2(-t.x,t.y)),t.x=o,t.y=s,t):(o=Mp(this.long0+Math.atan2(t.x*r,e*this.cos_p14*i-t.y*this.sin_p14*r)),t.x=o,t.y=s,t))},names:["ortho"]};var Nm=1,Om=2,Dm=3,zm=4,Im=5,Gm=6,jm=1,Rm=2,Bm=3,Wm=4;function qm(t,e,n,r){var i;return t<Od?(r.value=jm,i=0):(i=Math.atan2(e,n),Math.abs(i)<=Id?r.value=jm:i>Id&&i<=Nd+Id?(r.value=Rm,i-=Nd):i>Nd+Id||i<=-(Nd+Id)?(r.value=Bm,i=i>=0?i-jd:i+jd):(r.value=Wm,i+=Nd)),i}function Um(t,e){var n=t+e;return n<-jd?n+=Gd:n>+jd&&(n-=Gd),n}const Hm={init:function(){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>=Nd-Id/2?this.face=Im:this.lat0<=-(Nd-Id/2)?this.face=Gm:Math.abs(this.long0)<=Id?this.face=Nm:Math.abs(this.long0)<=Nd+Id?this.face=this.long0>0?Om:zm:this.face=Dm,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(t){var e,n,r,i,a,o,s={x:0,y:0},l={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,n=t.x,this.face===Im)i=Nd-e,n>=Id&&n<=Nd+Id?(l.value=jm,r=n-Nd):n>Nd+Id||n<=-(Nd+Id)?(l.value=Rm,r=n>0?n-jd:n+jd):n>-(Nd+Id)&&n<=-Id?(l.value=Bm,r=n+Nd):(l.value=Wm,r=n);else if(this.face===Gm)i=Nd+e,n>=Id&&n<=Nd+Id?(l.value=jm,r=-n+Nd):n<Id&&n>=-Id?(l.value=Rm,r=-n):n<-Id&&n>=-(Nd+Id)?(l.value=Bm,r=-n-Nd):(l.value=Wm,r=n>0?-n+jd:-n-jd);else{var c,u,h,f,d,p;this.face===Om?n=Um(n,+Nd):this.face===Dm?n=Um(n,+jd):this.face===zm&&(n=Um(n,-Nd)),f=Math.sin(e),d=Math.cos(e),p=Math.sin(n),c=d*Math.cos(n),u=d*p,h=f,this.face===Nm?r=qm(i=Math.acos(c),h,u,l):this.face===Om?r=qm(i=Math.acos(u),h,-c,l):this.face===Dm?r=qm(i=Math.acos(-c),h,-u,l):this.face===zm?r=qm(i=Math.acos(-u),h,c,l):(i=r=0,l.value=jm)}return o=Math.atan(12/jd*(r+Math.acos(Math.sin(r)*Math.cos(Id))-Nd)),a=Math.sqrt((1-Math.cos(i))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(r))))),l.value===Rm?o+=Nd:l.value===Bm?o+=jd:l.value===Wm&&(o+=1.5*jd),s.x=a*Math.cos(o),s.y=a*Math.sin(o),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,t.x=s.x,t.y=s.y,t},inverse:function(t){var e,n,r,i,a,o,s,l,c,u,h,f,d={lam:0,phi:0},p={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,n=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?p.value=jm:t.y>=0&&t.y>=Math.abs(t.x)?(p.value=Rm,e-=Nd):t.x<0&&-t.x>=Math.abs(t.y)?(p.value=Bm,e=e<0?e+jd:e-jd):(p.value=Wm,e+=Nd),c=jd/12*Math.tan(e),a=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),o=Math.atan(a),(s=1-(r=Math.cos(e))*r*(i=Math.tan(n))*i*(1-Math.cos(Math.atan(1/Math.cos(o)))))<-1?s=-1:s>1&&(s=1),this.face===Im)l=Math.acos(s),d.phi=Nd-l,p.value===jm?d.lam=o+Nd:p.value===Rm?d.lam=o<0?o+jd:o-jd:p.value===Bm?d.lam=o-Nd:d.lam=o;else if(this.face===Gm)l=Math.acos(s),d.phi=l-Nd,p.value===jm?d.lam=-o+Nd:p.value===Rm?d.lam=-o:p.value===Bm?d.lam=-o-Nd:d.lam=o<0?-o-jd:-o+jd;else{var g,m,v;c=(g=s)*g,m=(c+=(v=c>=1?0:Math.sqrt(1-c)*Math.sin(o))*v)>=1?0:Math.sqrt(1-c),p.value===Rm?(c=m,m=-v,v=c):p.value===Bm?(m=-m,v=-v):p.value===Wm&&(c=m,m=v,v=-c),this.face===Om?(c=g,g=-m,m=c):this.face===Dm?(g=-g,m=-m):this.face===zm&&(c=g,g=m,m=-c),d.phi=Math.acos(-v)-Nd,d.lam=Math.atan2(m,g),this.face===Om?d.lam=Um(d.lam,-Nd):this.face===Dm?d.lam=Um(d.lam,-jd):this.face===zm&&(d.lam=Um(d.lam,+Nd))}return 0!==this.es&&(u=d.phi<0?1:0,h=Math.tan(d.phi),f=this.b/Math.sqrt(h*h+this.one_minus_f_squared),d.phi=Math.atan(Math.sqrt(this.a*this.a-f*f)/(this.one_minus_f*f)),u&&(d.phi=-d.phi)),d.lam+=this.long0,t.x=d.lam,t.y=d.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};var Vm=[[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]],Ym=[[-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]],$m=.8487,Xm=1.3523,Jm=zd/5,Zm=1/Jm,Km=18,Qm=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};const tv={init:function(){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(t){var e=Mp(t.x-this.long0),n=Math.abs(t.y),r=Math.floor(n*Jm);r<0?r=0:r>=Km&&(r=17);var i={x:Qm(Vm[r],n=zd*(n-Zm*r))*e,y:Qm(Ym[r],n)};return t.y<0&&(i.y=-i.y),i.x=i.x*this.a*$m+this.x0,i.y=i.y*this.a*Xm+this.y0,i},inverse:function(t){var e={x:(t.x-this.x0)/(this.a*$m),y:Math.abs(t.y-this.y0)/(this.a*Xm)};if(e.y>=1)e.x/=Vm[18][0],e.y=t.y<0?-Nd:Nd;else{var n=Math.floor(e.y*Km);for(n<0?n=0:n>=Km&&(n=17);;)if(Ym[n][0]>e.y)--n;else{if(!(Ym[n+1][0]<=e.y))break;++n}var r=Ym[n],i=5*(e.y-r[0])/(Ym[n+1][0]-r[0]);i=function(t,e,n,r){for(var i=e;r;--r){var a=t(i);if(i-=a,Math.abs(a)<n)break}return i}(function(t){return(Qm(r,t)-e.y)/function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])}(r,t)},i,Od,100),e.x/=Qm(Vm[n],i),e.y=(5*n+i)*Dd,t.y<0&&(e.y=-e.y)}return e.x=Mp(e.x+this.long0),e},names:["Robinson","robin"]};const ev={init:function(){this.name="geocent"},forward:function(t){return Kp(t,this.es,this.a)},inverse:function(t){return Qp(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};var nv=0,rv=1,iv=2,av=3,ov={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 sv={init:function(){if(Object.keys(ov).forEach(function(t){if(void 0===this[t])this[t]=ov[t].def;else{if(ov[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);ov[t].num&&(this[t]=parseFloat(this[t]))}ov[t].degrees&&(this[t]=this[t]*Dd)}.bind(this)),Math.abs(Math.abs(this.lat0)-Nd)<Od?this.mode=this.lat0<0?rv:nv:Math.abs(this.lat0)<Od?this.mode=iv:(this.mode=av,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 t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var e,n,r,i,a=Math.sin(t.y),o=Math.cos(t.y),s=Math.cos(t.x);switch(this.mode){case av:n=this.sinph0*a+this.cosph0*o*s;break;case iv:n=o*s;break;case rv:n=-a;break;case nv:n=a}switch(e=(n=this.pn1/(this.p-n))*o*Math.sin(t.x),this.mode){case av:n*=this.cosph0*a-this.sinph0*o*s;break;case iv:n*=a;break;case nv:n*=-o*s;break;case rv:n*=o*s}return i=1/((r=n*this.cg+e*this.sg)*this.sw*this.h1+this.cw),e=(e*this.cg-n*this.sg)*this.cw*i,n=r*i,t.x=e*this.a,t.y=n*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var e,n,r,i={x:t.x,y:t.y};r=1/(this.pn1-t.y*this.sw),e=this.pn1*t.x*r,n=this.pn1*t.y*this.cw*r,t.x=e*this.cg+n*this.sg,t.y=n*this.cg-e*this.sg;var a=Rg(t.x,t.y);if(Math.abs(a)<Od)i.x=0,i.y=t.y;else{var o,s;switch(s=1-a*a*this.pfact,s=(this.p-Math.sqrt(s))/(this.pn1/a+a/this.pn1),o=Math.sqrt(1-s*s),this.mode){case av:i.y=Math.asin(o*this.sinph0+t.y*s*this.cosph0/a),t.y=(o-this.sinph0*Math.sin(i.y))*a,t.x*=s*this.cosph0;break;case iv:i.y=Math.asin(t.y*s/a),t.y=o*a,t.x*=s;break;case nv:i.y=Math.asin(o),t.y=-t.y;break;case rv:i.y=-Math.asin(o)}i.x=Math.atan2(t.x,t.y)}return t.x=i.x+this.long0,t.y=i.y,t},names:["Tilted_Perspective","tpers"]};const lv={init:function(){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 t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,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(t){var e,n,r,i,a=t.x,o=t.y;if(a-=this.long0,"ellipse"===this.shape){o=Math.atan(this.radius_p2*Math.tan(o));var s=this.radius_p/Rg(this.radius_p*Math.cos(o),Math.sin(o));if(n=s*Math.cos(a)*Math.cos(o),r=s*Math.sin(a)*Math.cos(o),i=s*Math.sin(o),(this.radius_g-n)*n-r*r-i*i*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/Rg(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(r/e),t.y=this.radius_g_1*Math.atan(i/Rg(r,e)))}else"sphere"===this.shape&&(e=Math.cos(o),n=Math.cos(a)*e,r=Math.sin(a)*e,i=Math.sin(o),e=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/Rg(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(r/e),t.y=this.radius_g_1*Math.atan(i/Rg(r,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,n,r,i,a=-1,o=0,s=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),o=Math.tan(t.x/this.radius_g_1)*Rg(1,s)):(o=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Rg(1,o));var l=s/this.radius_p;if(e=o*o+l*l+a*a,(r=(n=2*this.radius_g*a)*n-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-n-Math.sqrt(r))/(2*e),a=this.radius_g+i*a,o*=i,s*=i,t.x=Math.atan2(o,a),t.y=Math.atan(s*Math.cos(t.x)/a),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),o=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+s*s)):(o=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+o*o)),e=o*o+s*s+a*a,(r=(n=2*this.radius_g*a)*n-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-n-Math.sqrt(r))/(2*e),a=this.radius_g+i*a,o*=i,s*=i,t.x=Math.atan2(o,a),t.y=Math.atan(s*Math.cos(t.x)/a)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};var cv=1.340264,uv=-.081106,hv=893e-6,fv=.003796,dv=Math.sqrt(3)/2;const pv={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0},forward:function(t){var e=Mp(t.x-this.long0),n=t.y,r=Math.asin(dv*Math.sin(n)),i=r*r,a=i*i*i;return t.x=e*Math.cos(r)/(dv*(cv+3*uv*i+a*(7*hv+9*fv*i))),t.y=r*(cv+uv*i+a*(hv+fv*i)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var e,n,r,i,a=t.y;for(i=0;i<12&&(a-=r=(a*(cv+uv*(e=a*a)+(n=e*e*e)*(hv+fv*e))-t.y)/(cv+3*uv*e+n*(7*hv+9*fv*e)),!(Math.abs(r)<1e-9));++i);return n=(e=a*a)*e*e,t.x=dv*t.x*(cv+3*uv*e+n*(7*hv+9*fv*e))/Math.cos(a),t.y=Math.asin(Math.sin(a)/dv),t.x=Mp(t.x+this.long0),t},names:["eqearth","Equal Earth","Equal_Earth"]};var gv=1e-10;function mv(t){var e,n,r,i=Mp(t.x-(this.long0||0)),a=t.y;return e=this.am1+this.m1-zg(a,n=Math.sin(a),r=Math.cos(a),this.en),n=r*i/(e*Math.sqrt(1-this.es*n*n)),t.x=e*Math.sin(n),t.y=this.am1-e*Math.cos(n),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function vv(t){var e,n,r,i;if(t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a,n=Rg(t.x,t.y=this.am1-t.y),i=Ig(this.am1+this.m1-n,this.es,this.en),(e=Math.abs(i))<Nd)e=Math.sin(i),r=n*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*e*e)/Math.cos(i);else{if(!(Math.abs(e-Nd)<=gv))throw new Error;r=0}return t.x=Mp(r+(this.long0||0)),t.y=lm(i),t}function _v(t){var e,n,r=Mp(t.x-(this.long0||0)),i=t.y;return n=this.cphi1+this.phi1-i,Math.abs(n)>gv?(t.x=n*Math.sin(e=r*Math.cos(i)/n),t.y=this.cphi1-n*Math.cos(e)):t.x=t.y=0,t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function yv(t){var e,n;t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var r=Rg(t.x,t.y=this.cphi1-t.y);if(n=this.cphi1+this.phi1-r,Math.abs(n)>Nd)throw new Error;return e=Math.abs(Math.abs(n)-Nd)<=gv?0:r*Math.atan2(t.x,t.y)/Math.cos(n),t.x=Mp(e+(this.long0||0)),t.y=lm(n),t}const xv={init:function(){var t;if(this.phi1=this.lat1,Math.abs(this.phi1)<gv)throw new Error;this.es?(this.en=Dg(this.es),this.m1=zg(this.phi1,this.am1=Math.sin(this.phi1),t=Math.cos(this.phi1),this.en),this.am1=t/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=vv,this.forward=mv):(Math.abs(this.phi1)+gv>=Nd?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=yv,this.forward=_v)},names:["bonne","Bonne (Werner lat_1=90)"]};const bv=Object.assign(fg,{defaultDatum:"WGS84",Proj:Zp,WGS84:new Zp("WGS84"),Point:Fg,toPoint:og,defs:vp,nadgrid:function(t,e,n){return e instanceof ArrayBuffer?function(t,e,n){var r=!0;void 0!==n&&!1===n.includeErrorFields&&(r=!1);var i=new DataView(e),a=function(t){var e=t.getInt32(8,!1);if(11===e)return!1;e=t.getInt32(8,!0),11!==e&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian");return!0}(i),o=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:Vp(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(i,a),s=function(t,e,n,r){for(var i=176,a=[],o=0;o<e.nSubgrids;o++){var s=$p(t,i,n),l=Xp(t,i,s,n,r),c=Math.round(1+(s.upperLongitude-s.lowerLongitude)/s.longitudeInterval),u=Math.round(1+(s.upperLatitude-s.lowerLatitude)/s.latitudeInterval);a.push({ll:[Hp(s.lowerLongitude),Hp(s.lowerLatitude)],del:[Hp(s.longitudeInterval),Hp(s.latitudeInterval)],lim:[c,u],count:s.gridNodeCount,cvs:Yp(l)});var h=16;!1===r&&(h=8),i+=176+s.gridNodeCount*h}return a}(i,o,a,r),l={header:o,subgrids:s};return Bp[t]=l,l}(t,e,n):{ready:Wp(t,e)}},transform:lg,mgrs:xg,version:"__VERSION__"});!function(t){t.Proj.projections.add(Gg),t.Proj.projections.add(Ug),t.Proj.projections.add(Hg),t.Proj.projections.add($g),t.Proj.projections.add(Jg),t.Proj.projections.add(Zg),t.Proj.projections.add(Qg),t.Proj.projections.add(tm),t.Proj.projections.add(em),t.Proj.projections.add(um),t.Proj.projections.add(_m),t.Proj.projections.add(xm),t.Proj.projections.add(bm),t.Proj.projections.add(wm),t.Proj.projections.add(Mm),t.Proj.projections.add(Sm),t.Proj.projections.add(Cm),t.Proj.projections.add(Em),t.Proj.projections.add(km),t.Proj.projections.add(Am),t.Proj.projections.add(Tm),t.Proj.projections.add(Pm),t.Proj.projections.add(Fm),t.Proj.projections.add(Lm),t.Proj.projections.add(Hm),t.Proj.projections.add(tv),t.Proj.projections.add(ev),t.Proj.projections.add(sv),t.Proj.projections.add(lv),t.Proj.projections.add(pv),t.Proj.projections.add(xv)}(bv);const wv=bv;var Mv=function(t){var e;if(t.svg_){if(t.minimap_.size||(t.minimap_.size=150),t.Geometries.geoJSONs.worldrg)Tv(t);else lf(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(e){var n=uf(e,e.objects.CNTR_RG_60M_2024_4326).features;t.Geometries.geoJSONs.worldrg=n,Tv(t)}).catch(function(t){return console.error("Failed to load world-topo-60M.json",t)});window.addEventListener("estatmap:zoomed-"+t.svgId_,function(t,e){var n;return function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];clearTimeout(n),n=setTimeout(function(){return t.apply(void 0,i)},e)}}(function(t){return Sv(t.detail)},(null===(e=t.minimap_)||void 0===e?void 0:e.debounce)||3))}},Sv=function(t){Ev(t),kv(t),t._minimapGlobe.selectAll("path").attr("d",t._minimapPath)};function Cv(t){return(t+540)%360-180}function Ev(t){var e=function(t){var e,n,r=null===(e=t.position_)||void 0===e?void 0:e.x,i=null===(n=t.position_)||void 0===n?void 0:n.y;if(!Number.isFinite(r)||!Number.isFinite(i))return null;if("3035"===t.proj_){var a=_(wv("EPSG:3035","EPSG:4326",[r,i]),2);r=a[0],i=a[1]}else if("54030"===t.proj_){var o=_(wv("EPSG:54030","EPSG:4326",[r,i]),2);r=o[0],i=o[1]}return[r,i]}(t);if(e){var n=_(e,2),r=n[0],i=n[1];t._minimapProjection.rotate([-Cv(r),-i,0])}}function kv(t){var e,n=t._minimapBaseScale||t._minimapProjection.scale(),r=t._lastZoomK||(null===(e=t.__lastTransform)||void 0===e?void 0:e.k)||1,i=n*Math.pow(r,.65)*.9,a=.35*n,o=5*n;t._minimapProjection.scale(Math.max(a,Math.min(o,i)))}var Av=function(t){var e,n=(null===(e=t.minimap_)||void 0===e?void 0:e.z)||160;t._minimapProjection=Ad(Td).scale(249.5).clipAngle(90.000001).scale(n).translate([0,0]),t._minimapPath=bs().projection(t._minimapProjection),t._minimapBaseScale=t._minimapProjection.scale(),Ev(t),kv(t)},Tv=function(t){try{var e=t.minimap_||{},n=e.x||80,r=e.y||80,i=e.color||"#929292ff",a=e.size||160,o=t.Geometries.geoJSONs.worldrg;if(t._minimapContainer=t.svg_.append("g").attr("id","em-minimap").attr("transform","translate(".concat(n,",").concat(r,")")),t._minimapContainer.append("circle").attr("class","em-minimap-inner-circle").attr("r",a/2).attr("cx",0).attr("cy",0).attr("fill","white").attr("filter","url(#em-minimap-inner-shadow)"),Av(t),function(t,e){var n=t._minimapContainer.append("defs");(function(t){var e=t.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");e.append("feGaussianBlur").attr("in","SourceAlpha").attr("stdDeviation",3).attr("result","blur"),e.append("feOffset").attr("in","blur").attr("dx",0).attr("dy",0).attr("result","off"),e.append("feComposite").attr("in","SourceAlpha").attr("in2","off").attr("operator","arithmetic").attr("k2","1").attr("k3","-1").attr("result","inner"),e.append("feFlood").attr("flood-color","#000").attr("flood-opacity",.4),e.append("feComposite").attr("in2","inner").attr("operator","in").attr("result","shadow"),e.append("feBlend").attr("in","SourceGraphic").attr("in2","shadow").attr("mode","multiply")})(n),n.append("clipPath").attr("id","minimap-clip").append("circle").attr("r",e/2-3).attr("cx",0).attr("cy",0)}(t,a),t._minimapGlobe=t._minimapContainer.append("g").attr("class","em-minimap-globe").attr("clip-path","url(#minimap-clip)"),t._minimapGlobe.selectAll("path.country").data(o).enter().append("path").attr("d",t._minimapPath).attr("fill","#e0e0e0"),e.highlightIds&&Array.isArray(e.highlightIds)){var s=o.filter(function(t){return e.highlightIds.includes(t.id)});s.length&&s.forEach(function(e){t._minimapGlobe.append("path").datum(e).attr("d",t._minimapPath).attr("fill",i).attr("stroke",i).attr("stroke-width",.5)})}t._minimapContainer.append("circle").attr("class","em-minimap-outer-circle").attr("r",a/2).attr("cx",0).attr("cy",0).attr("fill","none").attr("stroke",i).attr("stroke-width",3),Sv(t)}catch(t){console.error("Error drawing minimap:",t)}};var Pv=function(t,e){var n=t.transform,r=(e.width_/2-n.x)/n.k,i=(e.height_/2-n.y)/n.k,a=_(e._projection.invert([r,i]),2),o=a[0],s=a[1];e.position_.x=o,e.position_.y=s,window.dispatchEvent(new CustomEvent("estatmap:zoomed-"+e.svgId_,{detail:e})),"function"==typeof e.onZoom_&&e.onZoom_(t,e)},Fv=function(t,e,n){var r,i,a=t.transform,o=(n.width_/2-a.x)/a.k,s=(n.height_/2-a.y)/a.k,l=_(n._projection.invert([o,s]),2),c=l[0],u=l[1];if(n.__programmaticZoom){var h=n.__programmaticZoom;n.position_.x=h.x,n.position_.y=h.y,n.position_.z=h.z,delete n.__programmaticZoom}else n.position_.x=c,n.position_.y=u,n.position_.z=n.__baseZ/a.k;n._lastZoomK=a.k,Ov(a,n),null!==(r=n.labels_)&&void 0!==r&&r.values&&Nv(a,n),null!==(i=n.labels_)&&void 0!==i&&i.backgrounds&&Lv(a,n),window.dispatchEvent(new CustomEvent("estatmap:zoomed-"+n.svgId_,{detail:n})),"function"==typeof n.onZoom_&&n.onZoom_(t,n)},Lv=function(t,e){var n=e.svg_.select("#em-zoom-group-"+e.svgId_).selectAll(".em-label-background"),r=t.k,i=[];n.each(function(){var t=Nt(this),e=parseFloat(t.attr("data-width"))||parseFloat(t.attr("width")),n=parseFloat(t.attr("data-height"))||parseFloat(t.attr("height")),a=parseFloat(t.attr("data-x"))||parseFloat(t.attr("x")),o=parseFloat(t.attr("data-y"))||parseFloat(t.attr("y"));if(e>0&&n>0&&!isNaN(a)&&!isNaN(o)){t.attr("data-width")||(t.attr("data-width",e),t.attr("data-height",n),t.attr("data-x",a),t.attr("data-y",o));var s=e*(1/r),l=n*(1/r),c=a*(1/r),u=o*(1/r);i.push({element:t,targetWidth:s,targetHeight:l,targetX:c,targetY:u})}}),i.forEach(function(t){var e=t.element,n=t.targetWidth,r=t.targetHeight,i=t.targetX,a=t.targetY;e.attr("width",n).attr("height",r).attr("x",i).attr("y",a)})},Nv=function(t,e){var n=e.svg_.select("#em-zoom-group-"+e.svgId_).select("#em-labels").selectAll("*"),r=t.k,i=[];n.each(function(){var t=Nt(this),e=window.getComputedStyle(this),n=t.attr("font-size"),a=e.fontSize,o=n||a;if(o&&parseFloat(o)>0){var s=parseFloat(t.attr("data-fs"))||parseFloat(n)||parseFloat(a);t.attr("data-fs")||t.attr("data-fs",s);var l=s/r;i.push({element:this,targetFontSize:l})}}),i.forEach(function(t){var e=t.element,n=t.targetFontSize;e.style.setProperty("font-size","".concat(n,"px"),"important")})},Ov=function(t,e){var n=e.svg_.select("#em-zoom-group-"+e.svgId_).selectAll("*"),r=t.k,i=[];n.each(function(){var t=Nt(this),e=window.getComputedStyle(this),n=t.attr("stroke-width"),a=e.strokeWidth,o=n||a;if(o&&parseFloat(o)>0){var s=parseFloat(t.attr("data-sw"))||parseFloat(n)||parseFloat(a);t.attr("data-sw")||t.attr("data-sw",s);var l=s/r;i.push({element:this,targetStrokeWidth:l})}}),i.forEach(function(t){var e=t.element,n=t.targetStrokeWidth;e.style.setProperty("stroke-width","".concat(n,"px"),"important")})};var Dv=Vf("\t"),zv=Dv.parse;Dv.parseRows,Dv.format,Dv.formatBody,Dv.formatRows,Dv.formatRow,Dv.formatValue;function Iv(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function Gv(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=void 0),function(t,e){return fetch(t,e).then(Iv)}(e,n).then(function(e){return t(e,r)})}}var jv=Gv($f);Gv(zv);var Rv=function(t,e,n){switch(t.proj_){case"3035":return wv("EPSG:4326","EPSG:3035",[e,n]);case"54030":return wv("EPSG:4326","EPSG:54030",[e,n]);default:return[e,n]}};function Bv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Wv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Bv(Object(n),!0).forEach(function(e){Ji(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bv(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function qv(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Uv(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Uv(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Uv(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var Hv=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 Vv(t){return Yv.apply(this,arguments)}function Yv(){return Yv=Zn(Qn().mark(function t(e){var n,r,i,a=arguments;return Qn().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:Hv,t.next=1,jv(n);case 1:return r=t.sent,i=r,e.placenamesFilter_&&(i=e.placenamesFilter_(r)),e._placenameLabels=i,t.abrupt("return",i);case 2:case"end":return t.stop()}},t)})),Yv.apply(this,arguments)}function $v(){return $v=Zn(Qn().mark(function t(e){return Qn().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e._placenameLabels){t.next=1;break}return t.next=1,Vv(e);case 1:Xv(e),window.addEventListener("estatmap:zoomend-"+e.svgId_,function(t){Zv(t.detail,t.detail.__lastTransform)});case 2:case"end":return t.stop()}},t)})),$v.apply(this,arguments)}function Xv(t){var e,n=t.svg_,r=(null===(e=t.__lastTransform)||void 0===e?void 0:e.k)||1,i=Jv(t);console.log("Filtered ".concat(i.length," placenames for zoom level ").concat(r)),n.select("#em-placenames").remove();var a=n.select("#em-zoom-group-"+t.svgId_).append("g").attr("id","em-placenames").attr("class","em-placenames").attr("pointer-events","none");a.selectAll("text").data(i).join("text").attr("x",function(t){return t.screenX}).attr("y",function(t){return t.screenY}).text(function(t){return t.name}).attr("class","em-placename").attr("font-size",function(t){return"".concat(13*t.sizeFactor/r,"px")}).attr("font-weight",function(t){return t.sizeFactor>1?"bold":"normal"}).attr("dy","-0.35em").clone(!0).lower().attr("class","em-placename-halo").attr("stroke-width",3/r),t.placenameGroup_=a}var Jv=function(t){if(!t._placenameLabels)return[];var e,n=t._projection,r=t.width_,i=t.height_,a=t.position_.z,o=t.__lastTransform||{k:1,x:0,y:0},s=o.invertX(0)-30,l=o.invertY(0)-30,c=o.invertX(r)+30,u=o.invertY(i)+30,h=[],f=qv(t._placenameLabels);try{for(f.s();!(e=f.n()).done;){var d=e.value,p=+d.rs,g=+d.r1;if(p&&!(a>p)){var m=+d.lon,v=+d.lat,y=_(Rv(t,m,v),2),x=_(n([y[0],y[1]]),2),b=x[0],w=x[1];if(!(b<s||b>c||w<l||w>u)&&(h.push(Wv(Wv({},d),{},{screenX:b,screenY:w,sizeFactor:a>g?1:1.1})),h.length>=500))break}}}catch(t){f.e(t)}finally{f.f()}return console.log("After filtering, ".concat(h.length," placenames remain.")),h};function Zv(t,e){t._placenameLabels&&t._projection&&Xv(t)}function Kv(t){if(t.svg_&&t._pathFunction){var e=function(t){var e=Nt("#em-zoom-group-"+t.svgId_);if(!e.empty()&&(e.select(".em-coastal-margin").remove(),t.drawCoastalMargin_)){!function(t,e){var n,r=t.select("defs").empty()?t.append("defs"):t.select("defs");if(!r.select("#em-coastal-margin-filter").empty())return;var i=r.append("filter").attr("id","em-coastal-margin-filter").attr("x","-50%").attr("y","-50%").attr("width","200%").attr("height","200%");i.append("feGaussianBlur").attr("in","SourceGraphic").attr("stdDeviation",e.standardDeviation).attr("result","blur"),i.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!==(n=e.opacity)&&void 0!==n?n:.4," 0\n ")).attr("result","blurred");var a=i.append("feMerge");a.append("feMergeNode").attr("in","blurred"),a.append("feMergeNode").attr("in","SourceGraphic")}(t.svg_,t.coastalMarginSettings_);var n=e.append("g").attr("class","em-coastal-margin").attr("filter","url(#em-coastal-margin-filter)").attr("fill","none").style("stroke",t.coastalMarginSettings_.color).style("stroke-width",t.coastalMarginSettings_.strokeWidth).style("opacity",t.coastalMarginSettings_.opacity).attr("pointer-events","none"),r=function(e,r,i){e&&n.append("g").attr("class",i).selectAll("path").data(e.filter(r)).enter().append("path").attr("d",t._pathFunction)};r(t.Geometries.geoJSONs.cntbn,function(t){return"T"===t.properties.co},"em-coastal-margin-cnt"),r(t.Geometries.geoJSONs.nutsbn,function(t){return"T"===t.properties.co},"em-coastal-margin-nuts"),r(t.Geometries.geoJSONs.worldbn,function(t){return"T"===t.properties.COAS_FLAG},"em-coastal-margin-world");var i=n.node().parentNode,a="WORLD"===t.geo_?3:1;i.childNodes[a]&&i.insertBefore(n.node(),i.childNodes[a])}};t.insetTemplates_&&Wi(t.insetTemplates_,t.svgId_,e),e(t)}}function Qv(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return t_(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t_(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function t_(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var e_=function(t){var e=Math.pow(10,Math.floor(Math.log(t)/Math.log(10)));return 5*e<=t?[5*e,5]:2*e<=t?[2*e,2]:[e,1]},n_=function(t){return t<.01?1e3*t+"mm":t<1?100*t+"cm":t<1e3?1*t+"m":t/1e3};function r_(t){return t.slice().sort(function(t,e){return t-e})}function i_(t,e){for(var n=[],r=0;r<t;r++){for(var i=[],a=0;a<e;a++)i.push(0);n.push(i)}return n}function a_(t,e,n,r){var i;if(t>0){var a=(n[e]-n[t-1])/(e-t+1);i=r[e]-r[t-1]-(e-t+1)*a*a}else i=r[e]-n[e]*n[e]/(e+1);return i<0?0:i}function o_(t,e,n,r,i,a,o){if(!(t>e)){var s=Math.floor((t+e)/2);r[n][s]=r[n-1][s-1],i[n][s]=s;var l=n;t>n&&(l=Math.max(l,i[n][t-1]||0)),l=Math.max(l,i[n-1][s]||0);var c,u,h,f=s-1;e<r[0].length-1&&(f=Math.min(f,i[n][e+1]||0));for(var d=f;d>=l&&!((c=a_(d,s,a,o))+r[n-1][l-1]>=r[n][s]);--d)(u=a_(l,s,a,o)+r[n-1][l-1])<r[n][s]&&(r[n][s]=u,i[n][s]=l),l++,(h=c+r[n-1][d-1])<r[n][s]&&(r[n][s]=h,i[n][s]=d);o_(t,s-1,n,r,i,a,o),o_(s+1,e,n,r,i,a,o)}}function s_(t,e){if(e>t.length)throw new Error("cannot generate more classes than there are data values");var n=r_(t),r=function(t){for(var e,n=0,r=0;r<t.length;r++)0!==r&&t[r]===e||(e=t[r],n++);return n}(n);if(1===r)return[n];var i=i_(e,n.length),a=i_(e,n.length);!function(t,e,n){for(var r=e[0].length,i=t[Math.floor(r/2)],a=[],o=[],s=0,l=void 0;s<r;++s)l=t[s]-i,0===s?(a.push(l),o.push(l*l)):(a.push(a[s-1]+l),o.push(o[s-1]+l*l)),e[0][s]=a_(0,s,a,o),n[0][s]=0;for(var c=1;c<e.length;++c)o_(c<e.length-1?c:r-1,r-1,c,e,n,a,o)}(n,i,a);for(var o=[],s=a[0].length-1,l=a.length-1;l>=0;l--){var c=a[l][s];o[l]=n.slice(c,s+1),l>0&&(s=c-1)}return o}function l_(t,e){if(e>t.length)return null;t=t.slice().sort(function(t,e){return t-e});var n=function(t,e){var n,r,i=[],a=[],o=0;for(n=0;n<t.length+1;n++){var s=[],l=[];for(r=0;r<e+1;r++)s.push(0),l.push(0);i.push(s),a.push(l)}for(n=1;n<e+1;n++)for(i[1][n]=1,a[1][n]=0,r=2;r<t.length+1;r++)a[r][n]=Number.POSITIVE_INFINITY;for(var c=2;c<t.length+1;c++){for(var u=0,h=0,f=0,d=0,p=1;p<c+1;p++){var g=c-p+1,m=t[g-1];if(o=(h+=m*m)-(u+=m)*u/++f,0!=(d=g-1))for(r=2;r<e+1;r++)a[c][r]>=o+a[d][r-1]&&(i[c][r]=g,a[c][r]=o+a[d][r-1])}i[c][1]=1,a[c][1]=o}return{lowerClassLimits:i,varianceCombinations:a}}(t,e);return function(t,e,n){var r=t.length,i=[],a=n;for(i[n]=t[t.length-1];a>0;)i[a-1]=t[e[r][a]-1],r=e[r][a]-1,a--;return i}(t,n.lowerClassLimits,e)}var c_=function(){this.totalCount=0,this.data={}};c_.prototype.train=function(t,e){for(var n in this.data[e]||(this.data[e]={}),t){var r=t[n];void 0===this.data[e][n]&&(this.data[e][n]={}),void 0===this.data[e][n][r]&&(this.data[e][n][r]=0),this.data[e][n][r]++}this.totalCount++},c_.prototype.score=function(t){var e,n={};for(var r in t){var i=t[r];for(e in this.data)n[e]={},this.data[e][r]?n[e][r+"_"+i]=(this.data[e][r][i]||0)/this.totalCount:n[e][r+"_"+i]=0}var a={};for(e in n)for(var o in a[e]=0,n[e])a[e]+=n[e][o];return a};var u_=function(){this.weights=[],this.bias=0};u_.prototype.predict=function(t){if(t.length!==this.weights.length)return null;for(var e=0,n=0;n<this.weights.length;n++)e+=this.weights[n]*t[n];return(e+=this.bias)>0?1:0},u_.prototype.train=function(t,e){if(0!==e&&1!==e)return null;t.length!==this.weights.length&&(this.weights=t,this.bias=1);var n=this.predict(t);if("number"==typeof n&&n!==e){for(var r=e-n,i=0;i<this.weights.length;i++)this.weights[i]+=r*t[i];this.bias+=r}return this};Math.log(Math.sqrt(2*Math.PI));Math.sqrt(2*Math.PI);var h_=Math.sqrt(2*Math.PI);function f_(t){for(var e=t,n=t,r=1;r<15;r++)e+=n*=t*t/(2*r+1);return Math.round(1e4*(.5+e/h_*Math.exp(-t*t/2)))/1e4}for(var d_=[],p_=0;p_<=3.09;p_+=.01)d_.push(f_(p_));function g_(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}wn({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),wv.defs("EPSG:3035","+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs"),wv.defs("EPSG:54030","+proj=robin +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs");var m_=function(t,e,n){var r={};r._mapType=n,r.updateValuesLabels=tf,r.svgId_="map",r.svg_=void 0,r.width_=Math.min(795,window.innerWidth),r.height_=0,r.containerId_=void 0,r.gridCartogram_=!1,r.gridCartogramShape_="square",r.gridCartogramMargins_={top:80,right:50,bottom:80,left:150},r.gridCartogramCellPadding_=4,r.gridCartogramPositions_=void 0,r.nutsLevel_=3,r.nutsYear_=2024,r.geo_="EUR",r.proj_="3035",r.projectionFunction_=void 0,r.filterGeometriesFunction_=void 0,r.scale_="20M",r.position_={x:void 0,y:void 0,z:void 0},r.placenames_=!1,r.placenamesFilter_=void 0,r.zoomExtent_=void 0,r.translateExtent_=void 0,r.lockPanUntilZoom_=!0,r.onZoomEnd_=void 0,r.onZoom_=void 0,r.onRegionMouseOver_=void 0,r.onRegionMouseMove_=void 0,r.onRegionMouseOut_=void 0,r.onRegionClick_=void 0,r.geometries_=void 0,r.processCentroids_=void 0,r.dorling_=!1,r.animateDorling_=!0,r.dorlingStrength_={x:1,y:1},r.dorlingIterations_=1,r.onDorlingProgress_=void 0,r.dorlingWorker_=!1,r.dorlingWorkerD3URL_=void 0,r.header_=!1,r.footer_=!1,r.footerPadding_=void 0,r.headerPadding_=void 0,r.title_="",r.titlePosition_=void 0,r.subtitle_="",r.subtitlePosition_=void 0,r.showScalebar_=!1,r.scalebarPosition_=[],r.scalebarUnits_=" km",r.scalebarTextOffset_=[0,12],r.scalebarMaxWidth_=150,r.scalebarHeight_=90,r.scalebarStrokeWidth_=1,r.scalebarSegmentHeight_=6,r.scalebarTickHeight_=8,r.stamp_=void 0,r.minimap_=void 0,r.zoomButtons_=!0,r.insetsButton_=!1,r.tooltip_={fontSize:"14px",transitionDuration:200,xOffset:0,yOffset:0,textFunction:null,showFlags:!1,omitRegions:[]},r.hoverColor_="red",r.drawCoastalMargin_=!1,r.coastalMarginSettings_={standardDeviation:1,x:"-100%",y:"-100%",width:"200%",height:"200%",strokeWidth:2,color:"rgb(0, 0, 0)",opacity:.8},r.drawGraticule_=!1,r.backgroundMap_=!0,r.labels_=void 0,r.annotations_=void 0,r.annotationsAdded=!1,r.patternFill_=void 0,r.showSourceLink_=!0,r.footnote_="Administrative boundaries: ©EuroGeographics ©OpenStreetMap",r.footnoteTooltipText_='<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>',r.footnoteWrap_=!1,r.footnotePosition_=void 0,r.showEstatLogo_=!1,r.showEstatRibbon_=!1,r.logoPosition_=void 0,r.ribbonPosition_=void 0,r.ribbonWidth_=void 0,r.ribbonHeight_=void 0,r.logoWidth_=void 0,r.logoHeight_=void 0,r.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",r.noDataFillStyle_="#bcbcbc",r.insets_=[],r.insetTemplates_={},r.insetBoxPosition_=void 0,r.insetBoxPadding_=5,r.insetBoxWidth_=210,r.insetZoomExtent_=null,r.insetScale_="03M";var i=function(t){r[t.substring(0,t.length-1)]=function(e){return arguments.length?(r[t]=e,r):r[t]}};for(var a in r)i(a);!function(t){t.showZoomButtons=function(e){return console.warn("showZoomButtons() is now DEPRECATED, please use zoomButtons() instead"),t.zoomButtons_=e,t},t.showInsetsButton=function(e){return console.warn("showInsetsButton() is now DEPRECATED, please use insetsButton() instead"),t.insetsButton_=e,t},t.seaFillStyle=function(e){return console.warn("seaFillStyle() is now DEPRECATED, please use the .em-sea CSS class"),Di(".em-sea","fill",e),t},t.cntrgFillStyle=function(e){return console.warn("cntrgFillStyle() is now DEPRECATED, please use the .em-cntrg CSS class"),Di(".em-cntrg","fill",e),t},t.nutsrgFillStyle=function(e){return console.warn("nutsrgFillStyle() is now DEPRECATED, please use the .em-nutsrg CSS class"),Di(".em-nutsrg","fill",e),t},t.nutsbnStroke=function(e){return console.warn("nutsbnStroke() is now DEPRECATED, please use the .bn_0, .bn_1, .bn_2, .bn_3 CSS classes"),e[0]&&Di(".bn_0","stroke",e[0]),e[1]&&Di(".bn_1","stroke",e[1]),e[2]&&Di(".bn_2","stroke",e[2]),e[3]&&Di(".bn_3","stroke",e[3]),t},t.nutsbnStrokeWidth=function(e){return console.warn("nutsbnStrokeWidth() is now DEPRECATED, please use the .bn_0, .bn_1, .bn_2, .bn_3 CSS classes"),e[0]&&Di(".bn_0","stroke-width",e[0]),e[1]&&Di(".bn_1","stroke-width",e[1]),e[2]&&Di(".bn_2","stroke-width",e[2]),e[3]&&Di(".bn_3","stroke-width",e[3]),t},t.graticuleStroke=function(e){return console.warn("graticuleStroke() is now DEPRECATED, please use the .em-graticule CSS class"),Di(".em-graticule","stroke",e),t},t.graticuleStrokeWidth=function(e){return console.warn("graticuleStrokeWidth() is now DEPRECATED, please use the .em-graticule CSS class"),Di(".em-graticule","stroke-width",e),t},t.nutsrgSelFillSty=function(e){return console.warn("nutsrgSelFillSty() is now DEPRECATED, please use hoverColor() instead"),t.hoverColor_=e,t},t.titleFontSize=function(e){return console.warn("map.titleFontSize() is now DEPRECATED. please use the .em-title CSS class"),Di(".em-title","font-size",e),t},t.subtitleFontSize=function(e){return console.warn("map.subtitleFontSize() is now DEPRECATED. please use the .em-subtitle CSS class"),Di(".em-subtitle","font-size",e),t},t.subtitleFontWeight=function(e){return console.warn("map.subtitleFontWeight() is now DEPRECATED. please use the .em-subtitle CSS class"),Di(".em-subtitle","font-weight",e),t},t.titleFill=function(e){return console.warn("map.titleFill() is now DEPRECATED. please use the .em-title CSS class"),Di(".em-title","fill",e),t},t.subtitleFill=function(e){return console.warn("map.subtitleFill() is now DEPRECATED. please use the .em-subtitle CSS class"),Di(".em-subtitle","fill",e),t},t.cntbnStroke=function(e){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"),e.eu&&Di(".em-bn-eu","stroke",e.eu),e.efta&&Di(".em-bn-efta","stroke",e.efta),e.cc&&Di(".em-bn-cc","stroke",e.cc),e.oth&&Di(".em-bn-oth","stroke",e.oth),e.co&&Di(".em-bn-co","stroke",e.co),t},t.cntbnStrokeWidth=function(e){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"),e.eu&&Di(".em-bn-eu","stroke-width",e.eu),e.efta&&Di(".em-bn-efta","stroke-width",e.efta),e.cc&&Di(".em-bn-cc","stroke-width",e.cc),e.oth&&Di(".em-bn-oth","stroke-width",e.oth),e.co&&Di(".em-bn-co","stroke-width",e.co),t},t.worldStroke=function(e){return console.warn("map.worldStroke() is now DEPRECATED. please use the .em-worldbn .em-bn-co .em-bn-d CSS classes"),Di(".em-worldbn","stroke",e),t},t.worldStrokeWidth=function(e){return console.warn("map.worldStrokeWidth() is now DEPRECATED. please use the .em-worldbn .em-bn-co .em-bn-d CSS classes"),Di(".em-worldbn","stroke-width",e),t},t.worldCoastStroke=function(e){return console.warn("map.worldCoastStroke() is now DEPRECATED. please use the .em-bn-co CSS class"),Di(".em-bn-co","stroke",e),t},t.worldCoastStrokeWidth=function(e){return console.warn("map.worldCoastStrokeWidth() is now DEPRECATED. please use the .em-bn-co CSS class"),Di(".em-bn-co","stroke-width",e),t},t.worldFillStyle=function(e){return console.warn("map.worldFillStyle() is now DEPRECATED. please use the .em-worldrg CSS class"),Di(".em-worldrg","fill",e),t},t.coastalMarginWidth=function(e){return console.warn("map.coastalMarginWidth() is now DEPRECATED. please use the #em-coast-margin CSS rule"),Di("#em-coast-margin","stroke-width",e),t},t.coastalMarginColor=function(e){return console.warn("map.coastalMarginColor() is now DEPRECATED. please use the #em-coast-margin CSS rule"),Di("#em-coast-margin","stroke",e),t},t.coastalMarginStdDev=function(e){return console.warn("map.coastalMarginStdDev() is now DEPRECATED. please use map.coastalMarginSettings.standardDeviation instead."),t.coastalMarginSettings.standardDeviation=e,t},t.fontFamily=function(e){return console.warn("map.fontFamily() is now DEPRECATED. please use the .em-map CSS class"),Di(".em-map","font-family",e),t},t.botTxtFontSize=function(e){return console.warn("map.botTxtFontSize() is now DEPRECATED. please use the .em-footnote CSS class"),Di(".em-footnote","font-size",e),t},t.botTxtFill=function(e){return console.warn("map.botTxtFill() is now DEPRECATED. please use the .em-footnote CSS class"),Di(".em-footnote","fill",e),t},t.scalebarFontSize=function(e){return console.warn("map.scalebarFontSize() is now DEPRECATED. please use the .em-scalebar-label CSS class"),Di(".em-scalebar-label","font-size",e),t},t.frameStroke=function(e){return console.warn("map.frameStroke() is now DEPRECATED. please use the .em-frame CSS class"),Di(".em-frame","stroke",e),t},t.frameStrokeWidth=function(e){return console.warn("map.frameStrokeWidth() is now DEPRECATED. please use the .em-frame CSS class"),Di(".em-frame","stroke-width",e),t},t.psClassifMethod=function(e){return console.warn("psClassifMethod() is now DEPRECATED. please use psClassificationMethod instead"),t.psClassificationMethod_=e,t},t.geoCenter=function(e){return console.warn("map.geoCenter() is now DEPRECATED. Please use map.position({x,y,z}) instead."),t.position_.x=e[0],t.position_.y=e[1],t},t.pixelSize=function(e){return console.warn("map.pixelSize() is now DEPRECATED. Please use the z property in map.position({x,y,z}) instead."),t.position_.z=e,t},t.pixSize=function(e){return console.warn("map.pixelSize() is now DEPRECATED. Please use the z property in map.position({x,y,z}) instead."),t.position_.z=e,t},t.tooltipText=function(e){return console.warn("map.tooltipText() is now DEPRECATED. Please use map.tooltip(config.textFunction) instead. See API reference for details."),t.tooltip_.textFunction=e,t},t.classifMethod=function(e){return console.warn("map.classifMethod() is now DEPRECATED. please use map.classificationMethod() instead."),t.classificationMethod_=e,t},t.threshold=function(e){return console.warn("map.threshold() is now DEPRECATED. please use map.thresholds() instead."),t.thresholds_=e,t},t.psThreshold=function(e){return console.warn("map.psThreshold() is now DEPRECATED. please use map.psThresholds() instead."),t.psThresholds_=e,t},t.clnb=function(e){return console.warn("map.clnb() is now DEPRECATED. please use map.numberOfClasses() instead."),t.numberOfClasses_=e,t},t.nutsLvl=function(e){return console.warn("map.nutsLvl() is now DEPRECATED. please use map.nutsLevel() instead."),t.nutsLevel_=e,t},t.lg=function(e){return console.warn("map.lg() is now DEPRECATED. please use map.language() instead."),t.language_=e,t},t.bottomText=function(e){return console.warn("bottomText is now DEPRECATED. Please use the footnote() method and em-footnote CSS class instead."),t.footnote_=e,t},t.botTxtFontSize=function(e){return console.warn("botTxtFontSize is now DEPRECATED. Please use the em-footnote CSS class instead."),t},t.botTxtFill=function(e){return console.warn("botTxtFill is now DEPRECATED. Please use the em-footnote CSS class instead."),t},t.botTxtPadding=function(e){return console.warn("botTxtPadding is now DEPRECATED. Please use the em-footnote CSS class instead."),t},t.botTxtTooltipTxt=function(e){return console.warn("botTxtTooltipTxt is now DEPRECATED. Please use footnoteTooltipText() instead."),t},t.tooltipShowFlags=function(e){return console.warn("tooltipShowFlags is now DEPRECATED. Please use out.tooltip({showFlags}) instead."),t.tooltip_.showFlags=e,t},t.colorFun=function(e){return console.warn("colorFun is now DEPRECATED. Please use out.colorFunction() instead."),t.colorFunction_=e,t},t.filtersDefinitionFun=function(e){return console.warn("filtersDefinitionFun is now DEPRECATED. Please use out.filtersDefinitionFunction() instead."),t.filtersDefinitionFunction_=e,t},t.labelling=function(e){return console.warn("labelling is now DEPRECATED. Please use out.labels({}) configuration object instead. See documentation for details."),t},t.labelsConfig=function(e){return console.warn("labelsConfig is now DEPRECATED. Please use out.labels({config:yourConfig}) configuration object instead. See documentation for details."),t.labels_=Object.assign(t.labels_||{},{config:e}),t},t.statLabelsPositions=function(e){return console.warn("statLabelsPositions is now DEPRECATED. Please use out.labels({statLabelsPositions:yourPositions}) instead. See documentation for details."),t.labels_=Object.assign(t.labels_||{},{statLabelsPositions:e}),t},t.labelsToShow=function(e){return console.warn("labelsToShow is now DEPRECATED. Please use out.labels({labelFilterFunction:yourFunction(region,map)}) function instead. See documentation for details."),t},t.labelShadowsToShow=function(e){return console.warn("labelShadowsToShow is now DEPRECATED. Please use out.labels({labelFilterFunction:yourFunction(region,map)}) function instead. See documentation for details."),t},t.labelShadow=function(e){return console.warn("labelShadow is now DEPRECATED. Please use out.labels({labelShadow:boolean}) instead. See documentation for details."),t},t.labelShadowWidth=function(e){return console.warn("labelShadow is now DEPRECATED. Please use out.labels({labelShadow:boolean}) instead. See documentation for details."),t},t.labelFilterFunction=function(e){return console.warn("labelFilterFunction is now DEPRECATED. Please use out.labels({labelFilterFunction:yourFunction(region,map)}) instead. See documentation for details."),t},t.labelFill=function(e){return console.warn("map.labelFill() is now DEPRECATED. please use the .em-stat-labels CSS class"),t},t.labelStroke=function(e){return console.warn("map.labelStroke() is now DEPRECATED. please use the .em-stat-labels CSS class"),t},t.labelStrokeWidth=function(e){return console.warn("map.labelStrokeWidth() is now DEPRECATED. please use the .em-stat-labels CSS class"),t},t.labelOpacity=function(e){return console.warn("map.labelOpacity() is now DEPRECATED. please use the .em-stat-labels CSS class"),t},t.labelValuesFontSize=function(e){return console.warn("map.labelValuesFontSize() is now DEPRECATED. please use the .em-stat-labels CSS class"),t},t.labelShadowWidth=function(e){return console.warn("map.labelShadowWidth() is now DEPRECATED. please use the .em-stat-labels-shadows CSS class"),t},t.labelShadowColor=function(e){return console.warn("map.labelShadowColor() is now DEPRECATED. please use the .em-stat-labels-shadows CSS class"),t},t.countriesToShow=function(e){return console.warn("map.countriesToShow() is now DEPRECATED. please use the map.filterGeometriesFunction() function if you wish to filter the default geometries."),t},t.bordersToShow=function(e){return console.warn("map.bordersToShow() is now DEPRECATED. please use the map.filterGeometriesFunction() function if you wish to filter the default geometries."),t},t.flowDonutSizeScale=function(e){return console.warn("map.flowDonutSizeScale() is now DEPRECATED. please use flowNodeSizeScale_() instead."),t.flowDonutSizeScale_=e,t},t.flowDonuts=function(e){return console.warn('map.flowDonuts() is now DEPRECATED. please use flowNodes(true).flowNodeType("donut") instead.'),t.flowNodeType_=e?"donut":"circle",t},t.flowMapType=function(e){return console.warn("map.flowMapType() is now DEPRECATED. please use flowLineType() instead."),t.flowLineType_=e,t},t.flowGradient=function(e){return console.warn("map.flowGradient() is now DEPRECATED. please use flowColorGradient() or flowWidthGradient() instead."),t.flowColorGradient_=e,t},t.flowOverlayColors=function(e){return console.warn("map.flowOverlayColors() is now DEPRECATED. please use flowRegionColors() instead."),t.flowRegionColors_=e,t},t.getFillPatternDefinitionFun=function(e){return console.warn("getFillPatternDefinitionFun is now DEPRECATED. please use fillPatternDefinitionFunction() instead."),t.fillPatternDefinitionFunction_=e,t}}(r),r.geo=function(t){return arguments.length?(r.geo_=t.toUpperCase(),r):r.geo_},["tooltip_","nuts2jsonBaseURL_","processCentroids_","coastalMarginSettings_"].forEach(function(t){r[t.substring(0,t.length-1)]=function(e){if(!arguments.length)return r[t];if("object"!==$i(e)||null===e||Array.isArray(e))r[t]=e;else for(var n in e)r[t][n]=e[n];return r.insetTemplates_&&Wi(r.insetTemplates_,r.svgId_,function(e,n){e[t.substring(0,t.length-1)](n)},e),r}}),r.title=function(t){return arguments.length?(r.title_=t,r.svg()&&r.svg().select("#title"+r.geo()).text(t),r):r.title_},r.subtitle=function(t){return arguments.length?(r.subtitle_=t,r.svg()&&r.svg().select("#subtitle"+r.geo()).text(t),r):r.subtitle_},r.insets=function(){return arguments.length?(1==arguments.length&&"default"===arguments[0]?r.insets_="default":1==arguments.length&&!1===arguments[0]?r.insets_=!1:1==arguments.length&&Array.isArray(arguments[0])?r.insets_=arguments[0]:r.insets_=arguments,r):r.insets_},r.drawGraticule=function(t){if(!arguments.length)return r.drawGraticule_;r.drawGraticule_=t;var e=r.svg_?r.svg().select("#em-graticule"):null,n=r.svg_?r.svg_.select("#em-zoom-group-"+r.svgId_):null;return e&&(e._groups[0][0]&&0==t?e.remove():r.Geometries.geoJSONs.graticule&&r._pathFunction&&n&&1==t&&(e.remove(),n.append("g").attr("id","em-graticule").selectAll("path").data(r.Geometries.geoJSONs.graticule).enter().append("path").attr("d",r._pathFunction).attr("class","em-graticule"),r.svg().select("#em-graticule").each(function(){"WORLD"==r.geo_?this.parentNode.insertBefore(this,this.parentNode.childNodes[3]):this.parentNode.insertBefore(this,this.parentNode.childNodes[1])}))),r},r.drawCoastalMargin=function(t){return arguments.length?(r.drawCoastalMargin_=t,Kv(r),r):r.drawCoastalMargin_},r.annotations=function(t){return arguments.length?(r.annotations_=t,Kh(r),r):r.annotations_},r.stamp=function(t){return arguments.length?(r.stamp_=t,Df(r.stamp_,r),r):r.stamp_},r.minimap=function(t){return arguments.length?(r.minimap_=t,Mv(r),r):r.minimap_},r.labels=function(t){return arguments.length?(r.labels_=t,function(t){if(t.svg_){var e=t.svg_.selectAll("#em-labels > *");if(e&&e.remove(),t.labels_){var n=t.labels_,r=t.svg_.select("#em-zoom-group-"+t.svgId_);Qh(t,r),n.values&&t.updateValuesLabels&&t.updateValuesLabels(t),t.insetTemplates_&&Wi(t.insetTemplates_,t.svgId_,function(t){if(n){var e=t.svg_.select("#em-zoom-group-"+t.svgId_);t.labels_&&Qh(t,e),n.values&&t.updateValuesLabels&&t.updateValuesLabels(t)}})}}}(r),r):r.labels_},r.position=function(t){return arguments.length?(r.position_=t,function(t,e){if(t.svg_&&t.__zoomBehavior){var n=t.svg_,r=n.select("#em-zoom-group-"+t.svgId_),i=t.__baseZ/e.z,a=_(t._projection([e.x,e.y]),2),o=a[0],s=a[1],l=t.width_/2-o*i,c=t.height_/2-s*i,u=wi.translate(l,c).scale(i);t.__programmaticZoom={x:e.x,y:e.y,z:e.z},t.__lastTransform=u,n.call(t.__zoomBehavior.transform,u),r.attr("data-zoom",i),t.position_.x=e.x,t.position_.y=e.y,t.position_.z=e.z}}(r,t),r):r.position_},r.Geometries=Pf(r,e),r.updateGeoMapTemplate=function(t){return t||console.warn("⚠️ map.updateGeoMapTemplate called without callback function!"),r.Geometries.defaultGeoData=null,r.Geometries.allNUTSGeoData=null,r.Geometries.centroidsData=null,r.geometries_?(r.Geometries.setUserGeometries(r.geometries_),r.buildMapTemplate(),t&&t()):r.Geometries.getDefaultGeoData(r.geo_,r.filterGeometriesFunction_,r.nutsLevel_).then(function(){r.buildMapTemplate(),t&&t()}),Wi(r.insetTemplates_,r.svgId_,function(e){e.updateGeoMapTemplate(t)}),r};r.buildMapTemplateBase=function(){var t=function(t){var e=Nt("#"+t.svgId());return 0==e.size()&&(e=Nt("body").append("svg").attr("id",t.svgId())),e.attr("class","em-map"),e.classed("em--"+t._mapType,!0),"pie"!==t._mapType&&"coxcomb"!==t._mapType||e.classed("em--ps",!0),e}(r);r.svg_=t,r.isInset||(r._wrapper_=function(t){var e,n=t.node();if(n){var r=n.parentNode;if(r&&!(r instanceof SVGElement)){if(null!==(e=r.classList)&&void 0!==e&&e.contains("em-map-wrapper"))return r;var i=document.createElement("div");return i.className="em-map-wrapper",r.insertBefore(i,n),i.appendChild(n),i}}}(t)),r.containerId_||(r.containerId_=r.svgId_),r.tooltip_.containerId||(r.tooltip_.containerId=r.containerId_),Zi("#"+r.svgId()+" > *").remove(),"WORLD"==r.geo_.toUpperCase()&&(r.height()||r.height(.55*r.width()),t.attr("width",r.width()).attr("height",r.height()),r.proj_=54030),r.height()||r.height(.85*r.width()),t.attr("width",r.width()).attr("height",r.height()),t.append("defs").attr("class","em-defs").append("clipPath").attr("id",r.svgId_+"-clip-path").append("rect").attr("x",0).attr("y",0).attr("width",r.width_).attr("height",r.height_),r.drawCoastalMargin_&&t.append("filter").attr("id","em-coastal-blur").attr("x",r.coastalMarginSettings_.x).attr("y",r.coastalMarginSettings_.y).attr("width",r.coastalMarginSettings_.width).attr("height",r.coastalMarginSettings_.height).append("feGaussianBlur").attr("in","SourceGraphic").attr("stdDeviation",r.coastalMarginSettings_.standardDeviation),t.append("g").attr("id","em-header-"+r.svgId_).attr("class","em-header");var n=t.append("g").attr("id","em-drawing-"+r.svgId_).attr("class","em-drawing-group").attr("clip-path","url(#".concat(r.svgId_,"-clip-path)"));(r.zoomExtent_||r.zoomButtons_)&&n.classed("em-draggable",!0);n.append("g").attr("id","em-zoom-group-"+r.svgId_).attr("class","em-zoom-group");return t.append("g").attr("id","em-footer-"+r.svgId_).attr("class","em-footer"),function(t){if(t.insetTemplates_){for(var e in t.insetTemplates_){var n=Nt("#"+t.insetTemplates_[e].svgId_);n&&n.html("")}t.insetTemplates_={}}}(r),function(t,e,n){if(!t.insets_||0===t.insets_.length)return t;t.insetBoxPosition_||(t.insetBoxPosition_=[t.width_-t.insetBoxWidth_-2*t.insetBoxPadding_,2*t.insetBoxPadding_]);var r=Nt("#"+t.svgId_).select("#em-drawing-"+t.svgId_).append("g").attr("id","em-insets-group").attr("class","em-insets").attr("transform","translate("+t.insetBoxPosition_[0]+","+t.insetBoxPosition_[1]+")");"default"===t.insets_&&(t.insets_=Nf(t.insetBoxWidth_,t.insetBoxPadding_));for(var i=0;i<t.insets_.length;i++){var a=t.insets_[i];if(a.svgId=a.svgId||"inset"+a.geo+Math.random().toString(36).substring(7),0==Nt("#"+a.svgId).size()){var o=null==a.x?t.insetBoxPadding_:a.x,s=null==a.y?t.insetBoxPadding_+i*(t.insetBoxPadding_+t.insetBoxWidth_):a.y;r.append("g").attr("id","em-inset-"+a.svgId).attr("class","em-inset").attr("transform","translate("+o+","+s+")").append("svg").attr("id",a.svgId)}if(t.insetTemplates_[a.geo]){var l=Lf(a,t,e,n);l.buildMapTemplateBase(),t.insetTemplates_[a.geo]=[t.insetTemplates_[a.geo],l]}else{var c=Lf(a,t,e,n).buildMapTemplateBase();t.insetTemplates_[a.geo]=c}}}(r,e,r._mapType),n.append("rect").attr("id","em-frame-"+r.geo_).attr("class","em-frame").attr("x",0).attr("y",0).attr("width",r.width_).attr("height",r.height_),r.stamp_&&Df(r.stamp_,r),r},r.buildMapTemplate=function(){var t=r.svg().select("#em-zoom-group-"+r.svgId_);return t.selectAll("*").remove(),1==r.gridCartogram_?(!function(t){var e=Nt("#em-zoom-group-".concat(t.svgId_)).append("g").attr("id","em-grid-container");t.gridCartogramMargins_=t.gridCartogramMargins_||{top:80,right:80,bottom:80,left:80};var n=Jf(t),r=Zf(n),i=Kf(r,t);"hexagon"===t.gridCartogramShape_?td(e,i,t):Qf(e,i,t),nd(e,t.width_,t.height_,t.gridCartogramMargins_)}(r),r.footnote_=!1):(r.position_.x&&r.position_.y||c(),r.position_.z=r.position_.z||u(),h(),f(),(r.zoomExtent()||r.zoomButtons_)&&(r.zoomExtent_||(console.log("Zoom buttons are enabled, but no zoom extent is defined. Setting default extent to map.zoomExtent([1,10])."),r.zoomExtent_=[1,10]),function(t){var e,n=Nt("#"+t.svgId()),r=wi,i=!t.lockPanUntilZoom_,a=!1,o=t.zoomExtent_||[0,0],s=Math.max(o[0]||1,.01),l=s<1,c=null!==(e=t.panPadFactor_)&&void 0!==e?e:.1,u=l?c*(1/s-1)*t.width_:t.width_,h=l?c*(1/s-1)*t.height_:t.height_,f=t.translateExtent_?t.translateExtent_:l?[[-u,-h],[t.width_+u,t.height_+h]]:[[0,0],[t.width_,t.height_]];if(t.__zoomBehavior=Fi().filter(function(t){return!t.target.closest(".em-zoom-buttons")&&!t.target.closest(".em-button")}).extent([[0,0],[t.width_,t.height_]]).scaleExtent(o).translateExtent(f).on("start",function(t){t.sourceEvent&&"wheel"!==t.sourceEvent.type&&n.classed("em-dragging",!0)}).on("zoom",function(e){var o=e.transform,s=t.svg_.select("#em-zoom-group-"+t.svgId_);a?a=!1:(t.__lastTransform=o,o.k!==r.k?(t.lockPanUntilZoom_&&(i=!0),Fv(e,r,t),s.attr("data-zoom",o.k).attr("transform",o),r=o):!t.lockPanUntilZoom_||i?(Pv(e,t),s.attr("transform",o),r=o):(a=!0,n.call(t.__zoomBehavior.transform,r)))}).on("end",function(e){var r;n.classed("em-dragging",!1),null===(r=t.onZoomEnd_)||void 0===r||r.call(t,e,t),window.dispatchEvent(new CustomEvent("estatmap:zoomend-"+t.svgId_,{detail:t}))}),t.__lastTransform=r,!t.__baseZ){var d=t.height_/2,p=_(t._projection.invert([0,d]),1)[0],g=_(t._projection.invert([t.width_,d]),1)[0];t.__baseZ=(g-p)/t.width_}n.call(t.__zoomBehavior)}(r)),r.backgroundMap_&&l(r)),e&&o(r),r.labels_&&Qh(r,t),r.annotations_&&(Kh(r),r.annotationsAdded=!0),r.placenames_&&function(t){$v.apply(this,arguments)}(r),r.title()&&function(t){var e=t.isInset?"em-inset-title":"em-title";t.titlePosition()||t.titlePosition([10,zi(e)+(t.isInset?0:10)]),t.header_&&!t.isInset&&t.svg().select("#em-header-"+t.svgId_).empty()&&t.svg().append("g").attr("id","em-header-"+t.svgId_).attr("class","em-header");var n=t.header_&&!t.isInset?t.svg().select("#em-header-"+t.svgId_):t.svg();n.select("#title"+t.geo_).remove(),n.append("text").attr("id","title"+t.geo_).attr("class",e).attr("x",t.titlePosition()[0]).attr("y",t.titlePosition()[1]).html(t.title())}(r),r.subtitle()&&function(t){if(t.subtitle()){var e=t.isInset?"em-inset-subtitle":"em-subtitle",n=t.isInset?"em-inset-title":"em-title";t.subtitlePosition()||t.subtitlePosition([10,zi(n)+zi(e)+15]),t.header_&&!t.isInset&&t.svg().select("#em-header-"+t.svgId_).empty()&&t.svg().append("g").attr("id","em-header-"+t.svgId_).attr("class","em-header");var r=t.header_&&!t.isInset?t.svg().select("#em-header-"+t.svgId_):t.svg();r.select("#subtitle"+t.geo_).remove(),r.append("text").attr("id","subtitle"+t.geo_).attr("class",e).attr("x",t.subtitlePosition()[0]).attr("y",t.subtitlePosition()[1]).html(t.subtitle())}}(r),r.footnote_&&function(t){var e,n=t.footnoteWrap_||1/0,r=t.footnote_||"";e=t.footer_&&!t.isInset?t.footnotePosition_?[t.footnotePosition_[0],t.footnotePosition_[1]]:[5,10]:t.footnotePosition_?t.footnotePosition_:[10,t.height_];var i,a=t.svg();t.footer_&&!t.isInset?(i=a.select("#em-footer-"+t.svgId_)).empty()&&(i=a.append("g").attr("id","em-footer-"+t.svgId_).attr("class","em-footer")):i=a,i.select("#em-footnote").remove();var o,s=i.append("text").attr("id","em-footnote").attr("class","em-footnote").attr("x",e[0]).attr("y",e[1]),l="",c=0,u=Qv(r.split(/(\s+)/));try{for(u.s();!(o=u.n()).done;){var h=o.value;(l+h).length>n&&l.length>0?(s.append("tspan").attr("x",e[0]).attr("dy",0===c?0:"1.2em").html(l.trim()),l=h,c++):l+=h}}catch(t){u.e(t)}finally{u.f()}l.trim().length>0&&s.append("tspan").attr("x",e[0]).attr("dy",0===c?0:"1.2em").html(l.trim()),s.on("mouseover",function(){t._tooltip.mw___=t._tooltip.style("max-width"),t._tooltip.style("max-width","400px"),t.footnoteTooltipText_&&t._tooltip.mouseover(t.footnoteTooltipText_)}).on("mousemove",function(e){t.footnoteTooltipText_&&t._tooltip.mousemove(e)}).on("mouseout",function(){t.footnoteTooltipText_&&t._tooltip.mouseout(),t._tooltip.style("max-width",t._tooltip.mw___)})}(r),r.showEstatLogo_&&function(t){var e=t.svg(),n=e.select("#em-logo-group");n.empty()&&(n=e.append("g").attr("id","em-logo-group").attr("class","em-logo-group"));var r=t.logoWidth_||200,i=t.logoHeight_||40,a=t.logoPosition_?t.logoPosition_[0]:t.width_-r-10,o=t.logoPosition_?t.logoPosition_[1]:t.height_-i-10;n.selectAll(".em-eurostat-logo").remove(),n.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",r).attr("height",i).attr("x",a).attr("y",o).attr("class","em-eurostat-logo")}(r),r.showEstatRibbon_&&function(t){var e=t.svg(),n=e.select("#em-logo-group");n.empty()&&(n=e.append("g").attr("id","em-logo-group").attr("class","em-logo-group"));var r=t.ribbonWidth_||200,i=t.ribbonHeight_||40,a=t.ribbonPosition_?t.ribbonPosition_[0]:t.width_-r-10,o=t.ribbonPosition_?t.ribbonPosition_[1]:t.height_-i-10;t.footer&&!t.ribbonPosition_&&(o+=80),n.selectAll(".em-eurostat-ribbon").remove(),n.append("image").attr("href","data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNDAiIGhlaWdodD0iNjMiIHZpZXdCb3g9IjAgMCAxNDAgNjMiPgogIDxkZWZzPgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQiIHgxPSIwLjE1NSIgeTE9IjEiIHgyPSIwLjgzNyIgeTI9IjAuMDExIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iIzA4MmI3YSIgLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIwLjUiIHN0b3AtY29sb3I9IiMwZTQ3Y2IiIC8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQtMiIgeDE9IjAuNzU5IiB5MT0iMC45OTEiIHgyPSIwLjI0MyIgeTI9IjAuMDEzIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2Y0ZjVmNSIgLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjN2Q4MDg4IiAvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0ibGluZWFyLWdyYWRpZW50LTMiIHgxPSIwLjE3IiB5MT0iMC45NzkiIHgyPSIwLjg0MyIgeTI9IjAuMDAyIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2ZmZmNmMiIgLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIwLjUiIHN0b3AtY29sb3I9IiNmYzAiIC8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KCiAgPGcgaWQ9ImV1cm9zdGF0LXJpYmJvbiI+CiAgICA8cGF0aCBkPSJNMTA2LjUyMiA0Ljk4MUw5MC42MjggNC45ODFMNTUuMjUyIDQ3LjEzN0w3MS4xNDYgNDcuMTM3TDEwNi41MjIgNC45ODFaIgogICAgICAgICAgZmlsbD0idXJsKCNsaW5lYXItZ3JhZGllbnQpIiAvPgogICAgPHBhdGggZD0iTTM3LjU2MyAyNi4wNkw1My40NTkgMjYuMDZMNzEuMTQ2IDQ3LjEzOEw1NS4yNTIgNDcuMTM4TDM3LjU2MyAyNi4wNloiCiAgICAgICAgICBmaWxsPSJ1cmwoI2xpbmVhci1ncmFkaWVudC0yKSIgLz4KICAgIDxwYXRoIGQ9Ik01My40NTYgMjYuMDZMMzcuNTYgMjYuMDZMMi4xODQgNjguMjE2TDE4LjA3OSA2OC4yMTZMNTMuNDU2IDI2LjA2WiIKICAgICAgICAgIGZpbGw9InVybCgjbGluZWFyLWdyYWRpZW50LTMpIiAvPgogICAgPHBhdGggZD0iTTQ1LjQ5MSAzNS40ODlMNTYuOTc1IDQ5LjE5MkwzNC4wMDYgNDkuMTkyTDQ1LjQ5MSAzNS40ODlaIgogICAgICAgICAgY2xhc3M9ImxvZ28tcmliYm9uLWN1dC1maWxsIgogICAgICAgICAgZmlsbD0iI2ZmZiIgLz4KICAgIDxwYXRoIGQ9Ik0xMDYuNDkxIDQuOTgzTDE0Mi4xODQgNDcuNTI5TDcwLjc5NyA0Ny41MjlMMTA2LjQ5MSA0Ljk4M1oiCiAgICAgICAgICBmaWxsPSIjZmZmIiAvPgogIDwvZz4KPC9zdmc+Cg==").attr("width",r).attr("height",i).attr("x",a).attr("y",o).attr("class","em-eurostat-ribbon")}(r),r.showSourceLink_&&function(t,e){var n,r=t.svg();t.footer_&&!t.isInset?(n=r.select("#em-footer-"+t.svgId_)).empty()&&(n=r.append("g").attr("id","em-footer-"+t.svgId_).attr("class","em-footer")):n=r,n.selectAll("#em-source-link, .em-source-dataset-link, .em-source-pretext").remove();var i=e?t.stat("size"):t.stat();if(i&&i.eurostatDatasetCode){var a=i.eurostatDatasetCode,o="https://ec.europa.eu/eurostat/databrowser/view/".concat(a,"/default/table?lang=en"),s=t.footer_&&!t.isInset?10:t.height_,l=n.append("a").attr("class","em-source-dataset-link").attr("href",o).attr("target","_blank").append("text").attr("class","em-source-dataset-link-text").attr("x",t.width_-10).attr("y",s).text("EUROSTAT").attr("text-anchor","end").node().getComputedTextLength();n.append("text").attr("id","em-source-link").attr("class","em-source-pretext").attr("x",t.width_-l-10-6).attr("y",s).text("Source:").attr("text-anchor","end")}}(r,e),r.showScalebar_&&(2!==r.scalebarPosition_.length&&(r.scalebarPosition_[0]=15,r.scalebarPosition_[1]=r.height_-50),function(t){var e=t.scalebarMaxWidth_,n=t.scalebarTextOffset_[0],r=t.scalebarTextOffset_[1],i=t.position_.z,a=e_(e*i),o=a[0]/i,s=a[1],l=t.svg().append("g").attr("class","em-scalebar").attr("transform","translate(".concat(t.scalebarPosition_[0],",").concat(t.scalebarPosition_[1],")")).attr("width",e+20).attr("height",t.scalebarHeight_);l.append("line").attr("class","em-scalebar-line").attr("x1",5).attr("y1",1).attr("x2",5).attr("y2",t.scalebarTickHeight_),l.append("text").attr("class","em-scalebar-label").attr("x",5+n).attr("y",t.scalebarTickHeight_+r).text("0");var c={1:4,2:2,5:5}[s],u=o/c,h=t.scalebarSegmentHeight_/2+1;if(u>=15){for(var f=1;f<c;f++)if(l.append("line").attr("class","em-scalebar-line").attr("x1",5+t.scalebarStrokeWidth_/2+f*u).attr("y1",1).attr("x2",5+t.scalebarStrokeWidth_/2+f*u).attr("y2",t.scalebarTickHeight_),l.append("text").attr("class","em-scalebar-label").attr("x",5+n+f*u).attr("y",t.scalebarTickHeight_+r).text(n_(a[0]/c*f)),1==f)l.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",5+t.scalebarStrokeWidth_-1).attr("y1",h).attr("x2",5+t.scalebarStrokeWidth_/2+f*u).attr("y2",h);else{var d=5+t.scalebarStrokeWidth_/2+(f-1)*u;d>0&&l.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",d).attr("y1",h).attr("x2",5+t.scalebarStrokeWidth_/2+f*u).attr("y2",h)}u>=15&&l.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",5+(c-1)*u).attr("y1",h).attr("x2",5+c*u).attr("y2",h)}else l.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",5+t.scalebarStrokeWidth_-1).attr("y1",h).attr("x2",5+t.scalebarStrokeWidth_/2+u*c).attr("y2",h);l.append("line").attr("class","em-scalebar-line").attr("x1",o+5).attr("y1",1).attr("x2",o+5).attr("y2",t.scalebarTickHeight_),l.append("text").attr("class","em-scalebar-label").attr("x",o+5+n).attr("y",t.scalebarTickHeight_+r).text(n_(a[0])+t.scalebarUnits_)}(r)),r.minimap_&&Mv(r),r.zoomButtons_&&function(t){var e=Nt("#"+t.svgId()).append("g").attr("class","em-zoom-buttons").style("pointer-events","all"),n=parseInt(Ii("em-button","width"))||30,r=e.append("g").attr("class","em-zoom-in em-button").style("cursor","pointer");r.append("title").text("Zoom in"),r.append("rect").attr("width",n).attr("height",n),r.append("text").attr("x",n/2).attr("y",n/2+7).text("+");var i=e.append("g").attr("class","em-zoom-out em-button").style("cursor","pointer").attr("transform","translate(0, ".concat(n,")")).style("cursor","pointer");i.append("title").text("Zoom out"),i.append("rect").attr("width",n).attr("height",n),i.append("text").attr("x",n/2).attr("y",n/2+7).text("−"),r.on("click",function(e){e.preventDefault(),e.stopPropagation(),function(t){t.svg_.transition().call(t.__zoomBehavior.scaleBy,2)}(t)}),i.on("click",function(e){e.preventDefault(),e.stopPropagation(),function(t){t.svg_.transition().call(t.__zoomBehavior.scaleBy,.5)}(t)})}(r),r.insetsButton_&&function(t){var e=Nt("#"+t.svgId()),n=parseInt(Ii("em-button","width"))||30,r=e.append("g").attr("class","em-insets-button em-button").attr("id","em-insets-button");r.append("title").text("Show/hide inset maps"),r.append("rect").attr("width",n).attr("height",n);var i=document.createComment("!Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.");r.node().appendChild(i);var a=n/700;r.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(n/2,", ").concat(n/2,") scale(").concat(a,") translate(").concat(-256,", ").concat(-256,")")).attr("fill","#333").attr("pointer-events","none"),r.on("click",function(t){t.preventDefault(),t.stopPropagation();var n=e.select("#em-insets-group");"none"===n.style("display")||""===n.style("display")?n.style("display","block"):n.style("display","none")})}(r),r.drawCoastalMargin_&&Kv(r),setTimeout(function(){return r.recalculateLayout()},20),r};var o=function(t){var e;t.Geometries.centroidsData?e="mixed"==t.nutsLevel_?[].concat(y(t.Geometries.centroidsData[0].features),y(t.Geometries.centroidsData[1].features),y(t.Geometries.centroidsData[2].features),y(t.Geometries.centroidsData[3].features)):t.Geometries.centroidsData.features:"WORLD"==t.geo_&&(e=[],t.Geometries.geoJSONs.worldrg.forEach(function(t){var n=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?g_(Object(n),!0).forEach(function(e){Ji(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g_(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},t);"FR"==t.properties.id?n.geometry={coordinates:[2.2,46.2],type:"Point"}:n.geometry={coordinates:Za(t),type:"Point"},e.push(n)})),t.processCentroids_&&(e=t.processCentroids_(e));var n=e.map(function(e){var n=t._projection(e.geometry.coordinates);return e.properties.centroid=n,e});t.Geometries._allCentroidsFeatures=y(n),t.Geometries.centroidsFeatures=n.filter(function(e){return s(e.properties.id,t)}),(r.getCentroidsGroup(t).empty()?t.svg().select("#em-zoom-group-"+t.svgId_).append("g").attr("id","em-centroids-".concat(t.svgId_)).attr("class","em-centroids"):r.getCentroidsGroup(t)).selectAll("g.em-centroid").data(t.Geometries.centroidsFeatures,function(t){return t.properties.id}).join(function(t){return t.append("g").attr("class","em-centroid").attr("id",function(t){return"ps"+t.properties.id}).attr("transform",function(t){return"translate(".concat(t.properties.centroid[0].toFixed(3),",").concat(t.properties.centroid[1].toFixed(3),")")})},function(t){return t},function(t){return t.remove()})};r.getCentroidsGroup=function(t){return t.svg().select("#em-centroids-".concat(t.svgId_))},r.refreshCentroids=function(t){var e=t.Geometries._allCentroidsFeatures;if(e)return t.Geometries.centroidsFeatures=e.filter(function(e){return s(e.properties.id,t)}),r.getCentroidsGroup(t).selectAll("g.em-centroid").data(t.Geometries.centroidsFeatures,function(t){return t.properties.id}).join(function(t){return t.append("g").attr("class","em-centroid").attr("id",function(t){return"ps"+t.properties.id}).attr("transform",function(t){return"translate(".concat(t.properties.centroid[0].toFixed(3),",").concat(t.properties.centroid[1].toFixed(3),")")})},function(t){return t},function(t){return t.remove()}),t};var s=function(t,e){return!e.statCodes_||e.statCodes_.some(function(n){var r,i=null===(r=e.statData(n))||void 0===r?void 0:r.get(t);return i&&!isNaN(i.value)&&0!==i.value})},l=function(t){var e=t.svg().select("#em-zoom-group-"+t.svgId_);e.append("rect").attr("id","sea").attr("class","em-sea").attr("x",-5*t.width_).attr("y",-5*t.height_).attr("width",11*t.width_).attr("height",11*t.height_),"WORLD"==t.geo_&&e.append("path").datum({type:"Sphere"}).attr("id","sphere").attr("d",t._pathFunction).attr("class","em-graticule"),t.geometries_?t.Geometries.addUserGeometriesToMap(t.geometries_,e,t._pathFunction):t.Geometries.addDefaultGeometriesToMap(e,t.drawGraticule_,t._pathFunction,t.nutsLevel_,t.nutsYear_,t.geo_,t.proj_,t.scale_)},c=function(){if(r.projectionFunction_){if("function"==typeof r.projectionFunction_.rotate){var t=r.projectionFunction_.rotate();if(Array.isArray(t)&&t.length>=2){var e,n,i=-t[0],a=-t[1];r.position_.x=null!==(e=r.position_.x)&&void 0!==e?e:i,r.position_.y=null!==(n=r.position_.y)&&void 0!==n?n:a}}else if("function"==typeof r.projectionFunction_.center){var o,s,l=r.projectionFunction_.center();if(Array.isArray(l)&&2===l.length)r.position_.x=null!==(o=r.position_.x)&&void 0!==o?o:l[0],r.position_.y=null!==(s=r.position_.y)&&void 0!==s?s:l[1]}}else{var c,u=v_[r.geo_+"_"+r.proj_];u?(r.position_.x=r.position_.x||u.geoCenter[0],r.position_.y=r.position_.y||u.geoCenter[1]):null!==(c=r.Geometries.defaultGeoData)&&void 0!==c&&c.bbox&&(r.position_.x=r.position_.x||.5*(r.Geometries.defaultGeoData.bbox[0]+r.Geometries.defaultGeoData.bbox[2]),r.position_.y=r.position_.y||.5*(r.Geometries.defaultGeoData.bbox[1]+r.Geometries.defaultGeoData.bbox[3]))}d()},u=function(){var t,e=v_[r.geo_+"_"+r.proj_];return e?800*e.pixelSize/r.width_:null!==(t=r.Geometries.defaultGeoData)&&void 0!==t&&t.bbox?Math.min((r.Geometries.defaultGeoData.bbox[2]-r.Geometries.defaultGeoData.bbox[0])/r.width_,(r.Geometries.defaultGeoData.bbox[3]-r.Geometries.defaultGeoData.bbox[1])/r.height_):100},h=function(){var t;"WORLD"===r.geo_?r._projection=r.projectionFunction_||Ol(Hl).scale(152.63).translate([r.width_/2,r.height_/2]).scale((r.width_-20)/(2*Math.PI)):r._projection=r.projectionFunction_||function(){var t,e,n,r,i,a,o,s=1,l=0,c=0,u=1,h=1,f=0,d=null,p=1,g=1,m=lo({point:function(t,e){var n=y([t,e]);this.stream.point(n[0],n[1])}}),v=so;function _(){return p=s*u,g=s*h,a=o=null,y}function y(n){var r=n[0]*p,i=n[1]*g;if(f){var a=i*t-r*e;r=r*t+i*e,i=a}return[r+l,i+c]}return y.invert=function(n){var r=n[0]-l,i=n[1]-c;if(f){var a=i*t+r*e;r=r*t-i*e,i=a}return[r/p,i/g]},y.stream=function(t){return a&&o===t?a:a=m(v(o=t))},y.postclip=function(t){return arguments.length?(v=t,d=n=r=i=null,_()):v},y.clipExtent=function(t){return arguments.length?(v=null==t?(d=n=r=i=null,so):oo(d=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),_()):null==d?null:[[d,n],[r,i]]},y.scale=function(t){return arguments.length?(s=+t,_()):s},y.translate=function(t){return arguments.length?(l=+t[0],c=+t[1],_()):[l,c]},y.angle=function(n){return arguments.length?(e=da(f=n%360*oa),t=ua(f),_()):f*aa},y.reflectX=function(t){return arguments.length?(u=t?-1:1,_()):u<0},y.reflectY=function(t){return arguments.length?(h=t?-1:1,_()):h<0},y.fitExtent=function(t,e){return _o(y,t,e)},y.fitSize=function(t,e){return yo(y,t,e)},y.fitWidth=function(t,e){return xo(y,t,e)},y.fitHeight=function(t,e){return bo(y,t,e)},y}().reflectY(!0).fitSize([r.width_,r.height_],{type:"Feature",geometry:{type:"MultiPoint",coordinates:[[(t=Yi(r))[0],t[1]],[t[2],t[3]]]}})},f=function(){r._pathFunction=bs().projection(r._projection)},d=function(){var t=qi("x"),e=qi("y"),n=qi("z");null==t||null==t||isNaN(+t)||(r.position_.x=+t),null==e||null==e||isNaN(+e)||(r.position_.y=+e),null==n||null==n||isNaN(+n)||(r.position_.z=+n)};return r.recalculateLayout=function(){var t=r.svg(),e=t.select("#em-header-"+r.svgId_),n=t.select("#em-drawing-"+r.svgId_),i=t.select("#em-footer-"+r.svgId_),a=n.select("#em-frame-"+r.geo_),o=t.select("#".concat(r.svgId_,"-clip-path rect")),s=0,l=0,c=r.headerPadding_?r.headerPadding_:20,u=r.footerPadding_?r.footerPadding_:10;if(r.header_&&!e.empty()){var h,f,d=null===(h=e.node())||void 0===h||null===(f=h.getBBox)||void 0===f?void 0:f.call(h);d&&(s=d.height+c)}if(r.footer_&&!i.empty()){var p,g,m=null===(p=i.node())||void 0===p||null===(g=p.getBBox)||void 0===g?void 0:g.call(p);m&&(l=m.height+u)}n.attr("transform","translate(0, ".concat(s,")")),i.attr("transform","translate(0, ".concat(s+r.height_+u,")")),a.attr("x",0).attr("y",0).attr("width",r.width_).attr("height",r.height_),o.attr("x",0).attr("y",0).attr("width",r.width_).attr("height",r.height_);var v=r.height_+s+l+u;t.attr("width",r.width_).attr("height",v)},r},v_={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,e){var n,r,i,a,o=function(t,e,n){if(0===Object.entries(t).length)return null;var r,i=[];if(n&&!x_(n.name)&&(n=null),"string"==typeof t&&(t=[t]),Array.isArray(t)||y_(t)){if(t.length===e)return n&&-1===t.findIndex(function(t){return null==t})?n.from(t):t;if(1===t.length){for(r=0;r<e;r++)i.push(t[0]);return i}}for(r=0;r<e;r++){var a=void 0===t[r]?null:t[r];i.push(a)}return i};if(this.length=0,this.id=[],null!=t)switch(this.class=t.class||"bundle",this.class){case"bundle":var s=[],l=0;if(this.error=null,this.length=0,null===t||"object"!=typeof t)return void(this.class=null);if(t.hasOwnProperty("error"))return void(this.error=t.error);if("dataset"===t.class||"collection"===t.class||"dimension"===t.class)return new __(t);for(r in t)l++,s.push(r);this.__tree__=t,this.length=l,this.id=s;break;case"dataset":t.hasOwnProperty("__tree__")?this.__tree__=n=t.__tree__:this.__tree__=n=t,this.label=n.label||null,this.note=n.note||null,this.link=n.link||null,this.href=n.href||null,this.updated=n.updated||null,this.source=n.source||null,this.extension=n.extension||null;var c,u=0,h=n.size||n.dimension&&n.dimension.size;if(this.size=h,this.value=n.hasOwnProperty("value")&&null!==n.value&&0!==n.value.length?n.value:{},Array.isArray(this.value)||y_(this.value))u=this.value.length;else{var f=1;for(c=h.length;c--;)f*=h[c];u=f}if(this.value=o(this.value,u,e),this.status=n.hasOwnProperty("status")&&null!==n.status?o(n.status,u):null,n.hasOwnProperty("dimension")){var d=n.dimension,p=n.role||!n.version&&d.role||null,g=n.id||d.id,m=h.length,v=function(t){p.hasOwnProperty(t)||(p[t]=null)};if(!Array.isArray(g)||!Array.isArray(h)||g.length!=m)return;if(this.length=m,this.id=g,p&&(v("time"),v("geo"),v("metric"),v("classification")),p&&null===p.classification){var _=[],y=["time","geo","metric"],x=function(t,e){for(var n=e.length;n--;)if(t===e[n])return!0;return!1};for(c=0;c<3;c++){var b=p[y[c]];null!==b&&(_=_.concat(b))}for(p.classification=[],c=0;c<m;c++)x(g[c],_)||p.classification.push(g[c]);0===p.classification.length&&(p.classification=null)}this.role=p,this.n=u;for(var w=0,M=this.length;w<M;w++)if(d[g[w]].category.hasOwnProperty("index")){if(Array.isArray(d[g[w]].category.index)){var S={},C=d[g[w]].category.index;for(i=C.length,a=0;a<i;a++)S[C[a]]=a;d[g[w]].category.index=S}}else{var E=0;for(r in d[g[w]].category.index={},d[g[w]].category.label)d[g[w]].category.index[r]=E++}}else this.length=0;break;case"dimension":if(!t.hasOwnProperty("__tree__"))return new __({version:"2.0",class:"dataset",dimension:{d:t},id:["d"],size:[function(t){var e=void 0===t.index?t.label:t.index;return Array.isArray(e)?e.length:Object.keys(e).length}(t.category)],value:[null]}).Dimension(0);var k=[],A=(n=t.__tree__).category;if(!n.hasOwnProperty("category"))return;if(!A.hasOwnProperty("label"))for(r in A.label={},A.index)A.label[r]=r;for(r in A.index)k[A.index[r]]=r;this.__tree__=n,this.label=n.label||null,this.note=n.note||null,this.link=n.link||null,this.href=n.href||null,this.id=k,this.length=k.length,this.role=t.role,this.hierarchy=A.hasOwnProperty("child"),this.extension=n.extension||null;break;case"category":var T=t.child;this.id=T,this.length=null===T?0:T.length,this.index=t.index,this.label=t.label,this.note=t.note||null,this.unit=t.unit,this.coordinates=t.coord;break;case"collection":if(this.length=0,this.label=t.label||null,this.note=t.note||null,this.link=t.link||null,this.href=t.href||null,this.updated=t.updated||null,this.source=t.source||null,this.extension=t.extension||null,null!==this.link&&t.link.item){var P=t.link.item;if(this.length=Array.isArray(P)?P.length:0,this.length)for(a=0;a<this.length;a++)this.id[a]=P[a].href}}}function y_(t){return"[object ArrayBuffer]"===Object.prototype.toString.call(t.buffer)}function x_(t){return-1!==["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"].indexOf(t)}function b_(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.json()}__.prototype.Item=function(t){if(null===this||"collection"!==this.class||!this.length)return null;if("number"==typeof t)return t>this.length||t<0?null:this.link.item[t];var e,n=[];if("object"==typeof t){if(!t.class&&!t.follow)return null;t.class&&(e="dataset"===t.class&&"boolean"==typeof t.embedded?!0===t.embedded?function(t,e,r){var i=t.link.item[e];r.class===i.class&&i.id&&i.size&&i.dimension&&n.push(i)}:function(t,e,r){var i=t.link.item[e];r.class!==i.class||i.id&&i.size&&i.dimension||n.push(i)}:function(t,e,r){r.class===t.link.item[e].class&&n.push(t.link.item[e])})}else e=function(t,e){n.push(t.link.item[e])};for(var r=0;r<this.length;r++)e(this,r,t);return n},__.prototype.Dataset=function(t){if(null===this)return null;if("dataset"===this.class)return void 0!==t?this:[this];var e,n=[],r=0;if("collection"===this.class){var i=this.Item({class:"dataset",embedded:!0});if(void 0===t){for(e=i.length;r<e;r++)n.push(new __(i[r]));return n}if("number"==typeof t&&t>=0&&t<i.length)return new __(i[t]);if("string"==typeof t)for(e=i.length;r<e;r++)if(i[r].href===t)return new __(i[r]);return null}if("bundle"!==this.class)return null;if(void 0===t){for(e=this.id.length;r<e;r++)n.push(this.Dataset(this.id[r]));return n}if("number"==typeof t){var a=this.id[t];return void 0!==a?this.Dataset(a):null}var o=this.__tree__[t];return void 0===o?null:new __({class:"dataset",__tree__:o})},__.prototype.Dimension=function(t,e){e="boolean"!=typeof e||e;var n,r=[],i=this.id.length,a=function(t,e){if(null!==t)for(var n in t)for(var r=null!==t[n]?t[n].length:0;r--;)if(t[n][r]===e)return n;return null};if(null===this||"dataset"!==this.class)return null;if(void 0===t){for(n=0;n<i;n++)r.push(this.Dimension(this.id[n]));return r}if("number"==typeof t){var o=this.id[t];return void 0!==o?this.Dimension(o,e):null}var s=this.role;if("object"==typeof t){if(t.hasOwnProperty("role")){for(n=0;n<i;n++){var l=this.id[n];a(s,l)===t.role&&r.push(this.Dimension(l,e))}return void 0===r[0]?null:r}return null}var c=this.__tree__.dimension;if(void 0===c)return null;var u=c[t];return void 0===u?null:e?new __({class:"dimension",__tree__:u,role:a(s,t)}):function(t,e){var n=[];for(var r in t)n[t[r]]=e[r];return n}(u.category.index,u.category.label)},__.prototype.Category=function(t){if(null===this||"dimension"!==this.class)return null;if(void 0===t){for(var e=[],n=0,r=this.id.length;n<r;n++)e.push(this.Category(this.id[n]));return e}if("number"==typeof t){var i=this.id[t];return void 0!==i?this.Category(i):null}var a=this.__tree__.category;if(void 0===a)return null;var o=a.index[t];if(void 0===o)return null;var s=a.unit&&a.unit[t]||null,l=a.coordinates&&a.coordinates[t]||null,c=a.child&&a.child[t]||null,u=a.note&&a.note[t]||null;return new __({class:"category",index:o,label:a.label[t],note:u,child:c,unit:s,coord:l})},__.prototype.Dice=function(t,e,n){var r,i,a,o,s=function(t,e){return t.hasOwnProperty(e)&&!!t[e]};if(null===this||"dataset"!==this.class||null===this.value)return null;if("object"!=typeof t)return this;"object"!=typeof e?("boolean"==typeof e&&!0===e&&(r=!0),"boolean"==typeof n&&!0===n||(n=!1)):(r=s(e,"clone"),n=s(e,"drop"),i=s(e,"stringify"),a=s(e,"ovalue"),o=s(e,"ostatus"));var l,c=this.value,u=r?new __(JSON.parse(JSON.stringify(this))):this,h=u.status,f=[],d=[],p=function(t,e){var n,r,i,a=(n=t,r=e,i={},Array.isArray(n[r])?(n[r].forEach(function(t,e){null!==t&&(i[String(e)]=t)}),i):n[r]);delete t[e],t[e]=a};Array.isArray(t)&&(t=function(t){var e={};return t.forEach(function(t){e[t[0]]=t[1]}),e}(t)),null===t&&(t={});var g=Object.keys(t);return g.length>0&&(g.forEach(function(e){var n=t[e];Array.isArray(n)||(t[e]=[n]),0===t[e].length&&delete t[e]}),n&&(t=function(t){var e={};return Object.keys(t).forEach(function(n){e[n]=u.Dimension(n).id.filter(function(e){return-1===t[n].indexOf(e)})}),e}(t)),u.toTable({type:"arrobj",content:"id",status:!0}).forEach(function(e,n){var r=[];g.forEach(function(n){var i=t[n],a=[];i.forEach(function(t){a.push(e[n]===t)}),r.push(-1!==a.indexOf(!0))}),-1===r.indexOf(!1)&&(f.push(e.value),d.push(e.status))}),g.forEach(function(e){var n=u.Dimension(e).id,r=0,i={};u.size[u.id.indexOf(e)]=t[e].length,n.forEach(function(n){-1!==t[e].indexOf(n)&&(i[n]=r,r++)}),u.__tree__.dimension[e].category.index=i}),u.n=f.length,u.value=u.__tree__.value=y_(c)?function(t,e){return e.from(t)}(f,c.constructor):f,u.status=u.__tree__.status=null!==h?d:null),i?((l=u.__tree__).hasOwnProperty("id")||(l.version="2.0",l.hasOwnProperty("class")||(l.class="dataset"),l.id=l.dimension.id,l.size=l.dimension.size,delete l.dimension.id,delete l.dimension.size,l.dimension.hasOwnProperty("role")&&(l.role=l.dimension.role,delete l.dimension.role)),l.hasOwnProperty("status")&&-1!==["null","{}","[]"].indexOf(JSON.stringify(l.status))&&delete l.status,l.hasOwnProperty("role")&&(delete l.role.classification,["geo","time","metric"].forEach(function(t){null===l.role[t]&&delete l.role[t]})),a&&p(l,"value"),o&&l.hasOwnProperty("status")&&p(l,"status"),JSON.stringify(l)):u},__.prototype.Slice=function(t){if(null===this||"dataset"!==this.class||0===Object.entries(this.value).length)return null;if(void 0===t)return this;if(!Array.isArray(t)){var e,n=[];for(e in t)n.push([e,t[e]]);t=n}return this.Dice(t.map(function(t){return[t[0],[t[1]]]}))},__.prototype.Data=function(t,e){var n,r,i=[],a=function(t){for(var e in t)if(t.hasOwnProperty(e))return e};if(null===this||"dataset"!==this.class||null===this.value)return null;if(void 0===t){for(r=this.value.length,n=0;n<r;n++)i.push(this.Data(n));return i}if("boolean"!=typeof e&&(e=!0),"number"==typeof t){var o=this.value[t];return void 0===o?null:e?{value:o,status:this.status?this.status[t]:null}:o}var s="object",l=this.__tree__,c=l.size||l.dimension&&l.dimension.size,u=c.length;if(Array.isArray(t)){if(!Array.isArray(t[0])){if(this.length!==t.length)return null;var h=1,f=0,d=[],p=[];for(n=0;n<u;n++)if(void 0!==t[n]){if("number"!=typeof t[n]||t[n]>=c[n])return null;f+=(h*=n>0?c[u-n]:1)*t[u-n-1]}else d.push(n),p.push(c[n]);if(d.length>1)return null;if(1===d.length){for(var g=0,m=p[0];g<m;g++){var v=[];for(n=0;n<u;n++)n!==d[0]?v.push(t[n]):v.push(g);i.push(this.Data(v,e))}return i}return e?{value:this.value[f],status:this.status?this.status[f]:null}:this.value[f]}s="array"}var _=function(t,e,n){var r,i=[],o={},s=t.dimension,l=t.id||s.id,c=t.size||s&&s.size;if("array"===n){for(r=e.length;r--;)o[e[r][0]]=e[r][1];e=o}for(var u=0,h=l.length;u<h;u++){var f=l[u],d=e[f];i.push("string"==typeof d?d:1===c[u]?a(s[f].category.index):null)}return i}(l,t,s),y=[],x=l.dimension,b=l.id||x.id;for(n=0,r=_.length;n<r;n++)y.push(x[b[n]].category.index[_[n]]);return this.Data(y,e)},__.prototype.toTable=function(t,e){if(null===this||"dataset"!==this.class||null===this.value)return null;1==arguments.length&&"function"==typeof t&&(e=t,t=null),"arrobj"!==(t=t||{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"!==t.type||void 0!==t.field||(t.field="id");var n,r,i,a,o,s,l,c,u,h="id"===t.field,f=function(t){return(h?"value":t)||"Value"},d=function(t){return(h?"status":t)||"Status"},p=this.__tree__,g=!0===t.status;if("function"==typeof e){n=this.toTable(t);var m=[],v="array"!==t.type?0:1;for(o=(j="object"!==t.type?n.slice(v):n.rows.slice(0)).length,r=0;r<o;r++){var _=e.call(this,j[r],r);void 0!==_&&m.push(_)}return"object"===t.type?{cols:n.cols,rows:m}:("array"===t.type&&m.unshift(n[0]),m)}if("arrobj"===t.type||"objarr"===t.type){var y=[],x=p.role&&p.role.metric,b=function(){},w={},M=this,S=M.id,C=t.by&&-1!==S.indexOf(t.by)?t.by:null,E=!0===t.meta,k=void 0!==t.drop&&Array.isArray(t.drop)?t.drop:[],A=!0===t.comma,T=!0===t.bylabel,P=M.value.constructor,F=function(e){var n,r={},i=f(t.vlabel);return"objarr"===t.type&&(n=null===C&&x_(P.name)?function(t){r[t]=t===i?P.from(e,function(e){return e[t]}):e.map(function(e){return e[t]})}:function(t){r[t]=e.map(function(e){return e[t]})},Object.keys(e[0]).forEach(n),e=r),E?(r={},S.forEach(function(t){var e=M.Dimension(t);r[t]={label:e.label,role:e.role,categories:{id:e.id,label:M.Dimension(t,!1)}}}),{meta:{label:M.label,source:M.source,updated:M.updated,id:S,status:g,unit:t.unit,by:C,bylabel:T,drop:null!==C&&k.length>0?k:null,prefix:null!==C?B||"":null,comma:A,dimensions:r},data:e}):e};C&&(t.field="id");var L=(n=this.toTable({field:t.field,vlabel:t.vlabel,slabel:t.slabel,content:t.content,status:g})).shift();if(null===C&&t.unit&&x){if("id"!==t.content)for(var N=x.length;N--;){var O=this.Dimension(x[N]);w[x[N]]={};for(var D=O.length;D--;)w[x[N]][O.Category(D).label]=O.id[D]}b=function(e,n){if(-1!==x.indexOf(e)){var r=p.dimension[e].category;r.unit?z.unit=r.unit["id"!==t.content?w[e][n]:n]:z.unit=null}},t.unit=!0}else t.unit=!1;for(o=n.length,r=0;r<o;r++){var z={};for(i=n[r].length;i--;)z[L[i]]=n[r][i],b(L[i],n[r][i]);y.push(z)}if(A&&y.forEach(function(t){null!==t.value&&(t.value=(""+t.value).replace(".",","))}),null!==C){var I,G={},j=[],R={},B=void 0!==t.prefix?t.prefix:"";k.forEach(function(t,e){(!M.Dimension(t)||M.Dimension(t).length>1)&&(k[e]="")});var W=S.filter(function(t){return t!==C&&-1===k.indexOf(t)}),q=M.Dimension(C);for(var U in"id"!==t.content?T?I=function(t,e,n){t[e][B+n[C]]=n.value}:(q.Category().forEach(function(t,e){R[t.label]=q.id[e]}),I=function(t,e,n){t[e][B+R[n[C]]]=n.value}):I=function(t,e,n){t[e][B+n[C]]=n.value},y.forEach(function(t){var e=function(t,e){var n=[];return e.forEach(function(e){n.push(t[e])}),n.join("\t")}(t,W);void 0===G[e]&&(G[e]=function(t,e){var n={};return e.forEach(function(e){n[e]=t[e]}),n}(t,W)),I(G,e,t,C)}),G)j.push(G[U]);return g=!1,F(j)}return F(y)}if("object"===t.type){var H="number"==typeof this.value[0]||null===this.value[0]?"number":"string";s=function(t,e){var n=h&&t||e||t;nt.push({id:t,label:n,type:"string"})},l=function(t,e,n){var r=f(t),i=d(e);n&&nt.push({id:"status",label:i,type:"string"}),nt.push({id:"value",label:r,type:H})},c=function(t){pt.push({v:t})},u=function(t){pt.push({v:t}),rt.push({c:pt})}}else s=function(t,e){var n=h&&t||e||t;nt.push(n)},l=function(t,e,n){var r=f(t),i=d(e);n&&nt.push(i),nt.push(r),et.push(nt)},c=function(t){pt.push(t)},u=function(t){pt.push(t),et.push(pt)};var V=p.dimension,Y=p.id||V.id,$=p.size||V.size,X=Y.length;if(X!=$.length)return!1;var J=[],Z=1,K=(N=1,[]),Q=[],tt=[],et=[],nt=[],rt=[];for(r=0;r<X;r++){var it=Y[r];s(it,V[it].label),Z*=$[r],N*=$[r];var at=[];for(i=0;i<$[r];i++)for(var ot in V[Y[r]].category.index)if(V[Y[r]].category.index[ot]===i){var st="id"!==t.content&&V[Y[r]].category.label?V[Y[r]].category.label[ot]:ot;at.push(st)}J.push(at),K.push(N)}for(l(t.vlabel,t.slabel,g),o=J.length,r=0;r<o;r++){for(var lt=[],ct=0,ut=J[r].length;ct<ut;ct++)for(var ht=0;ht<Z/K[r];ht++)lt.push(J[r][ct]);Q.push(lt)}for(o=Q.length,r=0;r<o;r++){var ft=[],dt=0;for(a=0;a<Z;a++)ft.push(Q[r][dt]),++dt===Q[r].length&&(dt=0);tt.push(ft)}for(a=0;a<Z;a++){var pt=[];o=Q.length;for(var gt=0;gt<o;gt++)c(tt[gt][a]);g&&c(this.status?this.status[a]:null),u(this.value[a])}return"object"===t.type?{cols:nt,rows:rt}:et},__.prototype.node=function(){return this.__tree__},__.prototype.toString=function(){return this.class},__.prototype.Unflatten=function(t){if(null===this||"dataset"!==this.class||null===this.value||"function"!=typeof t)return null;const e=this.id,n=this.size,r=[];for(let i=0;i<this.n;i++){const a=this.Data(i),o={};let s=i;for(let t=e.length-1;t>=0;t--){const e=this.Dimension(t),r=this.id[t],i=n[t],a=s%i;e.Category(a);const l=e.id[a];s=Math.floor(s/i),o[r]=l}const l=t(o,a,i,r);void 0!==l&&r.push(l)}return r};var w_=function(t){var e={__data:void 0,_data_:void 0,get:function(t){return t?e._data_?e._data_[t]:void 0:e._data_},getValue:function(t){var n=e.get(t);return n?n.value:void 0},set:function(t,n){e._data_=e._data_||{};var r=e._data_[t];return r?n.value?(r.value=n.value,r.status=n.status):r.value=n:e._data_[t]=n.value?n:{value:n},e},setData:function(t){return e.__data=t,e._data_={},Object.keys(t).forEach(function(n){return e.set(n,t[n])}),e},setManualMultiDate:function(t){for(var n in e._data_=e._data_||{},t){var r=t[n];for(var i in e._data_[n]={},r){var a=r[i];e._data_[n][i]={value:a}}}return e},hasData:function(){return null!=e._data_&&Object.keys(e._data_).length>0},hasNumericData:function(){return!!e._data_&&Object.values(e._data_).some(function(t){return Number.isFinite(+t.value)})},getArray:function(){if(e.hasData())return Object.values(e._data_).map(function(t){return t.value}).filter(function(t){return 0==t||t})},getUniqueValues:function(){if(e.hasData())return Object.values(e._data_).map(function(t){return t.value}).filter(function(t,e,n){return n.indexOf(t)===e})},getMin:function(){if(e.hasNumericData())return Object.values(e._data_).map(function(t){return t.value}).filter(function(t){return 0==t||t&&":"!==t}).reduce(function(t,e){return Math.min(t,e)})},getMax:function(){if(e.hasNumericData())return Object.values(e._data_).map(function(t){return t.value}).filter(function(t){return 0==t||t&&":"!==t}).reduce(function(t,e){return Math.max(t,e)})},getMaxRegionId:function(){if(e.hasNumericData()){var t=-1/0,n=null;for(var r in e._data_){var i=e._data_[r].value;null!=i&&":"!==i&&i>t&&(t=i,n=r)}return n}},getMinRegionId:function(){if(e.hasNumericData()){var t=1/0,n=null;for(var r in e._data_){var i=e._data_[r].value;null!=i&&":"!==i&&i<t&&(t=i,n=r)}return n}},isReady:function(){return e.hasData()},metadata:void 0,unitText_:void 0,retrieveFromRemote:function(t,n,a){return e.eurostatDatasetCode_?r(t,n,a):e.csvURL_&&i(a),e},eurostatDatasetCode_:void 0,filters_:{lastTimePeriod:1},precision_:2,label_:void 0},n=function(t,n){return e.filters_.geo||(e.filters_.geoLevel=t+""=="0"?"country":"nuts"+t),lf(function(t,e,n,r){n=n||"en",r=r||"json";var i=[];if(i.push("https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data/",t,"?","format=",r,"&lang=",n),e)for(var a in e){var o=e[a];if(Array.isArray(o))for(var s=0;s<o.length;s++)i.push("&",a,"=",o[s]);else i.push("&",a,"=",o)}return i.join("")}(e.eurostatDatasetCode_,e.filters_,n))},r=function(t,r,i){e._data_=null,n(t,r).then(function(t){var n;if(t.error)return console.error("Error retrieving Eurostat data: "+(null===(n=t.error[0])||void 0===n?void 0:n.label));var r=function(t,e,n){var r="object"==typeof e?e:null;return"function"!=typeof n&&(n=null),n||"function"!=typeof e||(n=e),"object"==typeof t?new __(t,n):"version"===t?"1.6.0":fetch?fetch(t,r).then(b_).then(function(t){return new __(t,n)}):void 0}(t);e.metadata={label:r.label,href:r.href,source:r.source,updated:r.updated,extension:r.extension},e.metadata.time=r.Dimension("time").id[0],e._data_=function(t){for(var e={},n=t.Dimension("geo").id,r=0;r<n.length;r++)e[n[r]]=t.Data(r);return e}(r),Object.keys(e._data_).forEach(function(t){null===e._data_[t].value&&(e._data_[t].value=":")}),i&&i()})};e.getTime=function(){var t=e.filters_.time;return t||(e._data_?e.metadata.time:void 0)},e.csvURL_=void 0,e.geoCol_="geo",e.valueCol_="value";var i=function(t){e._data_=null,jv(e.csvURL_).then(function(n){e._data_=function(t,e,n){for(var r={},i=0;i<t.length;i++){var a=t[i],o=a[n];r[a[e]]=o?{value:isNaN(+o)?o:+o,status:""}:{value:":",status:""}}return r}(n,e.geoCol_,e.valueCol_),e.metadata={href:e.csvURL_},t&&t()})};if(["unitText_"].forEach(function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}}),t)for(var a in t)e[a+"_"]=t[a];return e};function M_(t,e){var n=t.map;n.patternFill_&&n.patternFill_.forEach(function(r,i){if(r.legendLabel){var a=i*t.shapeHeight+i*t.shapePadding+15,o=e.append("g").attr("class","em-legend-item em-pattern-legend-item"),s=r.color||"#000";("#fff"===s.toLowerCase()||"white"===s.toLowerCase())&&o.append("rect").attr("x",0).attr("y",a).attr("width",t.shapeWidth).attr("height",t.shapeHeight).attr("fill","#ddd"),o.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",a).attr("width",t.shapeWidth).attr("height",t.shapeHeight).attr("fill","url(#".concat(r.patternId||r.pattern,")")).on("mouseover",function(){S_(n,r.patternId||r.pattern),n.insetTemplates_&&Wi(n.insetTemplates_,n.svgId,S_,r.patternId||r.pattern)}).on("mouseout",function(){C_(n),n.insetTemplates_&&Wi(n.insetTemplates_,n.svgId,C_)}),o.append("text").attr("class","em-legend-label").attr("x",t.shapeWidth+t.labelOffsets.x).attr("y",a+t.shapeHeight/2).attr("dominant-baseline","middle").attr("dy","0.35em").text(r.legendLabel)}})}function S_(t,e){var n="url(#".concat(e,")"),r=Vi(t);t.svg_.selectAll(r).selectAll("[ecl]").filter(function(){return!Nt(this).classed("pattern-fill-overlay")}).style("fill","white"),t.svg_.selectAll(".pattern-fill-overlay").style("opacity",0),t.svg_.selectAll(".pattern-fill-overlay").filter(function(){return Nt(this).attr("fill")===n}).style("opacity",1)}function C_(t){t.svg_.selectAll(".pattern-fill-overlay").style("opacity",1);var e=Vi(t);t.svg_.selectAll(e).selectAll("[ecl]").filter(function(){return!Nt(this).classed("pattern-fill-overlay")}).each(function(){Nt(this).style("fill",Nt(this).attr("fill___"))})}class E_ extends Map{constructor(t,e=P_){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(k_(this,t))}has(t){return super.has(k_(this,t))}set(t,e){return super.set(A_(this,t),e)}delete(t){return super.delete(T_(this,t))}}Set;function k_({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function A_({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function T_({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function P_(t){return null!==t&&"object"==typeof t?t.valueOf():t}const F_=Symbol("implicit");function L_(){var t=new E_,e=[],n=[],r=F_;function i(i){let a=t.get(i);if(void 0===a){if(r!==F_)return r;t.set(i,a=e.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new E_;for(const r of n)t.has(r)||t.set(r,e.push(r)-1);return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return L_(e,n).unknown(r)},Ht.apply(i,arguments),i}function N_(){var t,e,n=L_().unknown(void 0),r=n.domain,i=n.range,a=0,o=1,s=!1,l=0,c=0,u=.5;function h(){var n=r().length,h=o<a,f=h?o:a,d=h?a:o;t=(d-f)/Math.max(1,n-l+2*c),s&&(t=Math.floor(t)),f+=(d-f-t*(n-l))*u,e=t*(1-l),s&&(f=Math.round(f),e=Math.round(e));var p=df(n).map(function(e){return f+t*e});return i(h?p.reverse():p)}return delete n.unknown,n.domain=function(t){return arguments.length?(r(t),h()):r()},n.range=function(t){return arguments.length?([a,o]=t,a=+a,o=+o,h()):[a,o]},n.rangeRound=function(t){return[a,o]=t,a=+a,o=+o,s=!0,h()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(s=!!t,h()):s},n.padding=function(t){return arguments.length?(l=Math.min(1,c=+t),h()):l},n.paddingInner=function(t){return arguments.length?(l=Math.min(1,t),h()):l},n.paddingOuter=function(t){return arguments.length?(c=+t,h()):c},n.align=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),h()):u},n.copy=function(){return N_(r(),[a,o]).round(s).paddingInner(l).paddingOuter(c).align(u)},Ht.apply(h(),arguments)}function O_(t){return t}var D_=1e-6;function z_(t){return"translate("+t+",0)"}function I_(t){return"translate(0,"+t+")"}function G_(t){return e=>+t(e)}function j_(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function R_(){return!this.__axis}function B_(t,e){var n=[],r=null,i=null,a=6,o=6,s=3,l="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,c=1===t||4===t?-1:1,u=4===t||2===t?"x":"y",h=1===t||3===t?z_:I_;function f(f){var d=null==r?e.ticks?e.ticks.apply(e,n):e.domain():r,p=null==i?e.tickFormat?e.tickFormat.apply(e,n):O_:i,g=Math.max(a,0)+s,m=e.range(),v=+m[0]+l,_=+m[m.length-1]+l,y=(e.bandwidth?j_:G_)(e.copy(),l),x=f.selection?f.selection():f,b=x.selectAll(".domain").data([null]),w=x.selectAll(".tick").data(d,e).order(),M=w.exit(),S=w.enter().append("g").attr("class","tick"),C=w.select("line"),E=w.select("text");b=b.merge(b.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),w=w.merge(S),C=C.merge(S.append("line").attr("stroke","currentColor").attr(u+"2",c*a)),E=E.merge(S.append("text").attr("fill","currentColor").attr(u,c*g).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),f!==x&&(b=b.transition(f),w=w.transition(f),C=C.transition(f),E=E.transition(f),M=M.transition(f).attr("opacity",D_).attr("transform",function(t){return isFinite(t=y(t))?h(t+l):this.getAttribute("transform")}),S.attr("opacity",D_).attr("transform",function(t){var e=this.parentNode.__axis;return h((e&&isFinite(e=e(t))?e:y(t))+l)})),M.remove(),b.attr("d",4===t||2===t?o?"M"+c*o+","+v+"H"+l+"V"+_+"H"+c*o:"M"+l+","+v+"V"+_:o?"M"+v+","+c*o+"V"+l+"H"+_+"V"+c*o:"M"+v+","+l+"H"+_),w.attr("opacity",1).attr("transform",function(t){return h(y(t)+l)}),C.attr(u+"2",c*a),E.attr(u,c*g).text(p),x.filter(R_).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),x.each(function(){this.__axis=y})}return f.scale=function(t){return arguments.length?(e=t,f):e},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),f):n.slice()},f.tickValues=function(t){return arguments.length?(r=null==t?null:Array.from(t),f):r&&r.slice()},f.tickFormat=function(t){return arguments.length?(i=t,f):i},f.tickSize=function(t){return arguments.length?(a=o=+t,f):a},f.tickSizeInner=function(t){return arguments.length?(a=+t,f):a},f.tickSizeOuter=function(t){return arguments.length?(o=+t,f):o},f.tickPadding=function(t){return arguments.length?(s=+t,f):s},f.offset=function(t){return arguments.length?(l=+t,f):l},f}function W_(t){return B_(3,t)}function q_(t){return B_(4,t)}var U_=function(t,e,n){var r=t.histogram.orientation||"horizontal",i=t.histogram.showCounts,a=t.histogram.showPercentages,o=t.histogram.labelRotation||0,s=t.histogram.margin||{top:0,right:0,bottom:0,left:0},l=t.histogram.height||200,c=t.histogram.width||270,u=t.getNumberOfClasses(t),h=t.getLabelFormatter(t),f=t.getColorClassifier(t),d=new Array(u).fill(0),p=function(t){var e=t.map;return Object.values(e.statData()._data_).map(function(t){return t.value})}(t),g=function(t){var e=t.map;return e.colors_?e.colors_:Array.from({length:e.numberOfClasses_}).map(function(t,n){return e.classToFillStyle()(n,e.numberOfClasses_)})}(t),m=ay(t);p.forEach(function(t){var e=f(t);"number"==typeof e&&e>=0&&e<d.length&&d[e]++});var v=d.reduce(function(t,e){return t+e},0),_=t.lgg.append("g").attr("class","em-legend-histogram").attr("transform","translate(".concat(e,", ").concat(n,")"));function y(e,n){var r=Nt(this).style("stroke","black").attr("ecl"),i=g.length-1-parseInt(r,10);sy(t.map,i),t.map.insetTemplates_&&Wi(t.map.insetTemplates_,t.map.svgId,sy,r)}function x(e,n){Nt(this).style("stroke","none");ly(t.map),t.map.insetTemplates_&&Wi(t.map.insetTemplates_,t.map.svgId,ly)}"vertical"===r?function(e){var n=d.slice().reverse(),r=n.map(function(t){return v>0?t/v*100:0}),o=m.slice().reverse(),u=N_().domain(n.map(function(t,e){return e})).range([s.top,l-s.bottom]).padding(.1),f=Cn().domain([0,Dt(n)]).nice().range([s.left,c-s.right]);e.selectAll("rect").data(n).join("rect").attr("class","em-legend-histogram-bar").attr("y",function(t,e){return u(e)}).attr("x",s.left).attr("height",u.bandwidth()).attr("width",function(t){return f(t)-s.left}).attr("fill",function(t,e){return g[g.length-e-1]}).attr("ecl",function(t,e){return e}).on("mouseover",y).on("mouseout",x),(i||a)&&e.selectAll("text.em-histogram-label").data(n).join("text").attr("class","em-legend-label em-histogram-label").attr("x",function(t){return f(t)+5}).attr("y",function(t,e){return u(e)+u.bandwidth()/2}).attr("alignment-baseline","middle").text(function(t,e){return a?"".concat(r[e].toFixed(1),"%"):n[e]});var p=e.append("g").attr("id","em-legend-histogram-y-axis").attr("transform","translate(".concat(s.left,",0)"));if("thresholds"===t.labelType){for(var _=[],b=0;b<o.length;b++){var w=u(b);void 0!==w&&_.push(w+u.bandwidth())}var M=Cn().domain([0,l]).range([0,l]);p.call(q_(M).tickValues(_).tickFormat(function(t,e){return h?h(o[e],e):o[e]}).tickSize(4).tickSizeOuter(0))}else"ranges"===t.labelType&&p.call(q_(u).tickSizeOuter(0).tickSize(0).tickFormat(function(t,e){return h?h(o[e],e):o[e]}));p.selectAll("text").attr("class","em-legend-label em-tick-label").attr("text-anchor","end")}(_):function(e){var n=d.slice().reverse(),r=n.map(function(t){return v>0?t/v*100:0}),u=g.slice().reverse(),f=N_().domain(n.map(function(t,e){return e})).range([s.left,c-s.right]).padding(.1),p=Cn().domain([0,Dt(n)]).nice().range([l-s.bottom,s.top]);e.selectAll("rect").data(n).join("rect").attr("class","em-legend-histogram-bar").attr("x",function(t,e){return f(e)}).attr("y",function(t){return p(t)}).attr("width",f.bandwidth()).attr("height",function(t){return l-s.bottom-p(t)}).attr("fill",function(t,e){return u[e]}).attr("ecl",function(t,e){return e}).on("mouseover",y).on("mouseout",x),(i||a)&&e.selectAll("text.em-histogram-label").data(n).join("text").attr("class","em-legend-label em-histogram-label").attr("x",function(t,e){return f(e)+f.bandwidth()/2}).attr("y",function(t){return p(t)-5}).attr("text-anchor","middle").text(function(t,e){return a?"".concat(r[e].toFixed(1),"%"):t});var _=e.append("g").attr("id","em-legend-histogram-x-axis").attr("transform","translate(0, ".concat(l-s.bottom,")"));if("thresholds"===t.labelType){for(var b=[],w=0;w<m.length;w++){var M=m.length-w-1,S=f(M);void 0!==S&&b.push(S+f.bandwidth())}var C=Cn().domain([0,c]).range([0,c]);_.call(W_(C).tickValues(b).tickFormat(function(t,e){return h?h(m[e],e):m[e]}).tickSize(4).tickSizeOuter(0)),_.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(o,")"))}else"ranges"===t.labelType&&(_.call(W_(f).tickSizeOuter(0).tickSize(0).tickFormat(function(t,e){return h?h(m[e],e):m[e]})),_.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(o,")")))}(_)};function H_(t,e,n){t.map;t._continuousLegendContainer=t.lgg.append("g").attr("class","em-continuous-legend").attr("id","em-continuous-legend").attr("transform","translate(".concat(e,", ").concat(n,")"));var r="ps"==t.map._mapType?t.colorLegend:t,i="vertical"===r.orientation,a="legend-gradient-"+Math.random().toString(36).substr(2,5),o=t.width||6*t.shapeWidth,s=i?t.shapeWidth:t.shapeHeight;if(function(t,e,n){for(var r,i=t.map,a="function"==typeof(null===(r=i.colorFunction_)||void 0===r?void 0:r.domain),o=20,s=function(t){var e=t.valueTransform_||function(t){return t},n=V_(t);return n.map(e)}(i),l=_(3===s.length?s:[s[0],null,s[1]],3),c=l[0],u=l[1],h=l[2],f=t._continuousLegendContainer.append("defs").append("linearGradient").attr("id",e).attr("x1","0%").attr("x2",n?"0%":"100%").attr("y1",n?"100%":"0%").attr("y2","0%"),d=0;d<=o;d++){var p=d/o,g=void 0;g=3===s.length?p<.5?c+2*p*(u-c):u+2*(p-.5)*(h-u):c+p*(h-c);var m=i.colorFunction_(a?g:p);f.append("stop").attr("offset","".concat(100*p,"%")).attr("stop-color",m)}}(t,a,i),function(t,e,n,r,i){var a=Y_(e),o=e._continuousLegendContainer.append("rect").attr("class","em-legend-gradient").attr("id","em-legend-gradient").attr("x",0).attr("y",a).attr("width",i?r:n).attr("height",i?n:r).style("fill","url(#".concat(t,")"));!function(t,e,n,r){var i=e.map,a=V_(i),o=i.valueUntransform_||function(t){return t},s=e._continuousLegendContainer,l=Y_(e),c=function(t){return"ps"==t._mapType?Z_:X_}(i),u=function(t){return"ps"==t._mapType?K_:J_}(i);t.on("mousemove",function(t){var u,h=_(_i(t,this),2),f=h[0],d=h[1],p=r?d-l:f,g=Math.max(0,Math.min(n,p)),m=g/n,v=r?1-m:m;if(3===a.length){var y=_(a,3),x=y[0],b=y[1],w=y[2];if(v<.5)u=x+(b-x)*(v/.5);else u=b+(w-b)*((v-.5)/.5)}else{var M=_(a,2),S=M[0];u=S+v*(M[1]-S)}u=o(u),s.selectAll(".em-hover-line, .em-hover-tick, .em-hover-label").remove();var C=r?0:g,E=r?g+l:0;s.append("line").attr("class","em-hover-line").attr("x1",C).attr("y1",E).attr("x2",r?C+e.shapeWidth:C).attr("y2",r?E:E+e.shapeHeight).attr("stroke","black").attr("stroke-width",1).attr("pointer-events","none"),s.append("circle").attr("class","em-hover-tick").attr("cx",r?C+e.shapeWidth:C).attr("cy",r?E:E+e.shapeHeight).attr("r",3).attr("fill","black").attr("pointer-events","none");var k=oy(e);s.append("text").attr("class","em-hover-label").attr("x",r?C+e.shapeWidth+5:C).attr("y",r?E:E+e.shapeHeight+12).attr("text-anchor",r?"start":"middle").attr("alignment-baseline","middle").attr("pointer-events","none").text(k(u)),c(i,u)}),t.on("mouseout",function(){s.selectAll(".em-hover-line, .em-hover-tick, .em-hover-label").remove(),u(i)})}(o,e,n,i)}(a,t,o,s,i),function(t){return t.ticks>1||t.tickValues}(t)?function(t,e,n,r){var i=t.map,a=V_(i),o=t._continuousLegendContainer.append("g").attr("class","em-legend-ticks"),s=oy(t),l=i.valueTransform_||function(t){return t},c=Y_(t),u=Array.isArray(t.tickValues)&&t.tickValues?t.tickValues.map(l):function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(t){return t};if(Array.isArray(t)&&3===t.length){var r=_(t,3),i=r[0],a=r[1],o=r[2];return Array.from({length:e},function(t,r){var s=r/(e-1);return n(s<.5?i+2*s*(a-i):a+2*(s-.5)*(o-a))})}var s=_(t,2),l=s[0],c=s[1];return Array.from({length:e},function(t,r){return n(l+r/(e-1)*(c-l))})}(a,t.ticks,l);u.forEach(function(l,h){var f=function(t,e){if(3===e.length){var n=_(e,3),r=n[0],i=n[1],a=n[2];return t<i?.5*(t-r)/(i-r):.5+.5*(t-i)/(a-i)}return(t-e[0])/(e[1]-e[0])}(l,a);if(r){var d=n,p=e-f*e+c;o.append("line").attr("class","em-legend-tick").attr("x1",d).attr("y1",p).attr("x2",d+t.tickLength).attr("y2",p);var g=Array.isArray(t.tickLabels)&&null!=t.tickLabels[h]?t.tickLabels[h]:i.valueUntransform_?s(i.valueUntransform_(l)):s(l);o.append("text").attr("class","em-legend-label em-legend-ticklabel").attr("x",d+t.tickLength+3).attr("y",p).attr("dy","0.35em").attr("text-anchor","start").text(g)}else{var m=f*e,v=n+c;o.append("line").attr("class","em-legend-tick").attr("x1",m).attr("y1",v).attr("x2",m).attr("y2",v+t.tickLength);var y=Array.isArray(t.tickLabels)&&null!=t.tickLabels[h]?t.tickLabels[h]:i.valueUntransform_?s(i.valueUntransform_(l)):s(l);o.append("text").attr("class","em-legend-label em-legend-ticklabel").attr("x",m).attr("y",v+t.tickLength+10).attr("dy","0").attr("text-anchor",0===h?"start":h===u.length-1?"end":"middle").text(y)}})}(t,o,s,i):function(t,e,n,r){var i=Y_(t),a=t.lowLabel,o=t.highLabel,s=t.pointOfDivergenceLabel,l=t._continuousLegendContainer;if(r){var c=e,u=n+5;a&&l.append("text").attr("class","em-legend-label").attr("x",u).attr("y",i+c).attr("dy","-0.2em").attr("text-anchor","start").text(a),o&&l.append("text").attr("class","em-legend-label").attr("x",u).attr("y",i).attr("dy","0.8em").attr("text-anchor","start").text(o),s&&l.append("text").attr("class","em-legend-label").attr("x",u).attr("y",i+c/2).attr("dy","0.35em").attr("text-anchor","start").text(s)}else{var h=n+i+10;a&&l.append("text").attr("class","em-legend-label").attr("x",0).attr("y",h).attr("text-anchor","start").text(a),o&&l.append("text").attr("class","em-legend-label").attr("x",e).attr("y",h).attr("text-anchor","end").text(o),s&&l.append("text").attr("class","em-legend-label").attr("x",e/2).attr("y",h).attr("text-anchor","middle").text(s)}}(t,o,s,i),t.noData){var l=(i?t.width+5:s+30)+Y_(t);r.pointOfDivergence&&r.pointOfDivergencePadding&&(l+=r.pointOfDivergencePadding);var c=t._continuousLegendContainer.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(0,",").concat(l,")"));t.appendNoDataLegend(c,r.noDataText,X_,J_)}}function V_(t){var e;return"function"==typeof(null===(e=t.colorFunction_)||void 0===e?void 0:e.domain)?t.colorFunction_.domain():t.domain_||[0,1]}function Y_(t){return"ps"==t.map._mapType?t.colorLegend.titlePadding:t.titlePadding}function $_(t){var e,n,r;return t&&t.legend_&&null!==(e=null!==(n=t.legend_.highlightTolerance)&&void 0!==n?n:null===(r=t.legend_.colorLegend)||void 0===r?void 0:r.highlightTolerance)&&void 0!==e?e:1}function X_(t,e){var n=$_(t),r=Vi(t),i=t.svg_.selectAll(r).selectAll("[ecl]");i&&i.each(function(){var t=Nt(this),r=t.attr("ecl");if(r&&"nd"!==r){var i=+r;i>=e-n&&i<=e+n?t.style("fill",Nt(this).attr("fill___")):t.style("fill","white")}else{if("nd"===e)return;t.style("fill","white")}})}function J_(t){var e=Vi(t);t.svg_.selectAll(e).selectAll("[ecl]").each(function(){Nt(this).style("fill",Nt(this).attr("fill___"))})}function Z_(t,e){var n=$_(t);t.getCentroidsGroup(t).selectAll("[ecl]").each(function(){var r=Nt(this),i=r.attr("ecl");if(!i||"nd"===i)return"nd"===e?void r.style("opacity",t.psFillOpacity_):void r.style("opacity",0);var a=+i;a>=e-n&&a<=e+n?r.style("opacity",t.psFillOpacity_):r.style("opacity",0)})}function K_(t){t.getCentroidsGroup(t).selectAll("[ecl]").each(function(){Nt(this).style("opacity",t.psFillOpacity_)})}function Q_(t,e,n){var r,i;t._discreteLegendContainer=t.lgg.append("g").attr("class","em-discrete-legend-container").attr("transform","translate(".concat(e,",").concat(n,")")),null!==(r=t.colorLegend)&&void 0!==r&&r.title&&t._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(t.colorLegend.title);var a="ps"==t.map._mapType?t.colorLegend:t;if("ranges"===t.labelType||"ranges"===(null===(i=t.colorLegend)||void 0===i?void 0:i.labelType)?function(t,e){for(var n=t.map,r=t._discreteLegendContainer,i=t.getLabelFormatter(t),a=t.getNumberOfClasses(t),o=t.getHighlightFunction(n),s=t.getUnHighlightFunction(n),l=t.getClassToFillStyle(t),c=t.getColorClassifier(t),u=ty(t),h=function(){var n=f*e.shapeHeight+u,h=0,d=t.ascending?a-f-1:f,p=l(d,a),g=r.append("g").attr("class","em-legend-item");e.pointOfDivergenceLabel&&f>=e.pointOfDivergence&&(n+=e.pointOfDivergencePadding),g.append("rect").attr("class","em-legend-rect").attr("x",h).attr("y",n).attr("width",e.shapeWidth).attr("height",e.shapeHeight).style("fill",p).on("mouseover",function(){Nt(this).raise(),o(t.map,d),t.map.insetTemplates_&&Wi(t.map.insetTemplates_,t.map.svgId,o,d)}).on("mouseout",function(){s(t.map),t.map.insetTemplates_&&Wi(t.map.insetTemplates_,t.map.svgId,s,d)}),f>0&&g.append("line").attr("class","em-legend-separator").attr("x1",0).attr("y1",n).attr("x2",e.sepLineLength).attr("y2",n),g.append("text").attr("class","em-legend-label").attr("x",Math.max(e.shapeWidth,e.sepLineLength+e.tickLength)+(e.labelOffsets.x||0)).attr("y",n+e.shapeHeight/2).attr("dy","0.3em").text(e.labels?e.labels[f]:i(c.invertExtent(d)[t.ascending?0:1],f))},f=0;f<a;f++)h();if(e.pointOfDivergenceLabel)for(var d=0;d<a;d++){var p=d*e.shapeHeight+u;d==e.pointOfDivergence&&ey(t,p,e)}}(t,a):function(t,e){var n,r,i,a,o,s,l=t.map,c=t._discreteLegendContainer,u=t.getNumberOfClasses(t),h=ty(t),f=t.getHighlightFunction(l),d=t.getUnHighlightFunction(l),p=t.getColorClassifier(t),g=t.getClassToFillStyle(t),m=t.getColorStats(t),v=t.getLabelFormatter(t);if((t.maxMin||e.maxMin)&&m&&(null!=m&&m.getMin&&null!=m&&m.getMax&&(n=m.getMin(),r=m.getMax()),null!=m&&m.getMaxRegionId&&null!=m&&m.getMinRegionId)){var _,y,x,b;i=m.getMinRegionId(),a=m.getMaxRegionId();var w=l.Geometries.getAllRegionFeatures(),M=w.find(function(t){return t.properties.id===i}),S=w.find(function(t){return t.properties.id===a});M&&(o=(null===(_=M.properties)||void 0===_?void 0:_.na)||(null===(y=M.properties)||void 0===y?void 0:y.na)||i),S&&(s=(null===(x=S.properties)||void 0===x?void 0:x.na)||(null===(b=S.properties)||void 0===b?void 0:b.na)||a)}for(var C=function(n){var r=n*e.shapeHeight+h,i=0,a=t.ascending?u-n-1:n,o=g(a,u),s=c.append("g").attr("class","em-legend-item");if(s.append("rect").attr("class","em-legend-rect").attr("x",i).attr("y",r).attr("width",e.shapeWidth).attr("height",e.shapeHeight).style("fill",o).on("mouseover",function(){Nt(this).raise(),f(l,a),t.map.insetTemplates_&&Wi(t.map.insetTemplates_,t.map.svgId,f,a)}).on("mouseout",function(){d(l),t.map.insetTemplates_&&Wi(t.map.insetTemplates_,t.map.svgId,d,a)}),n>0&&s.append("line").attr("class","em-legend-separator").attr("x1",0).attr("y1",r).attr("x2",t.sepLineLength).attr("y2",r),n>0&&s.append("line").attr("class","em-legend-tick").attr("x1",e.sepLineLength).attr("y1",r).attr("x2",e.sepLineLength+e.tickLength).attr("y2",r),n<u-1){var m=s.append("text").attr("class","em-legend-label").attr("x",Math.max(e.shapeWidth,e.sepLineLength+e.tickLength)+(e.labelOffsets.x||0)).attr("y",r+e.shapeHeight).attr("dy","0.3em").text(function(){if(e.labels)return e.labels[n];if(null!=p&&p.invertExtent){var r=p.invertExtent(a);return v(r[t.ascending?0:1])}return l.noDataText_||""});e.pointOfDivergenceLabel&&n==e.pointOfDivergence-1&&m.attr("class","em-legend-label em-legend-label-divergence")}},E=0;E<u;E++)C(E);if((t.maxMin||e.maxMin)&&Number.isFinite(n)&&Number.isFinite(r)){var k=0,A=e.maxMinTickLength?e.sepLineLength+e.maxMinTickLength:e.sepLineLength+e.tickLength,T=e.maxMinTickLength?Math.max(e.shapeWidth,e.sepLineLength+e.maxMinTickLength)+(e.labelOffsets.x||0):Math.max(e.shapeWidth,e.sepLineLength+e.tickLength)+(e.labelOffsets.x||0),P=v(r)+(e.maxMinLabels?e.maxMinLabels[1]:""),F=v(n)+(e.maxMinLabels?e.maxMinLabels[0]:"");e.maxMinRegionLabels&&(P="".concat(v(r)," (").concat(s,")"),F="".concat(v(n)," (").concat(o,")"));var L=c.append("g").attr("class","em-legend-max-min-group"),N=h;L.append("line").attr("class","em-legend-tick em-legend-tick-max").attr("x1",k).attr("y1",N).attr("x2",A).attr("y2",N),L.append("text").style("pointer-events","all").style("cursor","pointer").on("mouseover",function(){var e=t.getNumberOfClasses(t);!function(t,e,n){var r=Vi(t),i=e-1,a=t.svg_.selectAll(r).selectAll("[ecl]");a.style("fill","white"),a.filter("[ecl='"+i+"']").each(function(e){e.properties.id===n&&Nt(this).style("fill",t.hoverColor_)})}(l,e,a)}).on("mouseout",function(){ly(l)}).attr("class","em-legend-label em-legend-label-max").attr("x",T).attr("y",N).attr("dy","0.3em").text(P);var O=u*e.shapeHeight+h;L.append("line").attr("class","em-legend-tick em-legend-tick-min").attr("x1",k).attr("y1",O).attr("x2",A).attr("y2",O),L.append("text").style("pointer-events","all").style("cursor","pointer").on("mouseover",function(){!function(t,e){var n=Vi(t),r=0,i=t.svg_.selectAll(n).selectAll("[ecl]");i.style("fill","white"),i.filter("[ecl='"+r+"']").each(function(n){n.properties.id===e&&Nt(this).style("fill",t.hoverColor_)})}(l,i)}).on("mouseout",function(){ly(l)}).attr("class","em-legend-label em-legend-label-min").attr("x",T).attr("y",O).attr("dy","0.3em").text(F)}if(e.pointOfDivergenceLabel)for(var D=0;D<u;D++){var z=D*e.shapeHeight+h;D==e.pointOfDivergence&&ey(t,z,e)}}(t,a),a.noData){var o=t.getNumberOfClasses(t)*a.shapeHeight+ty(t)+3;a.pointOfDivergence&&a.pointOfDivergencePadding&&(o+=a.pointOfDivergencePadding);var s=t._discreteLegendContainer.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(0,",").concat(o,")")),l=t.getHighlightFunction(t.map),c=t.getUnHighlightFunction(t.map);t.appendNoDataLegend(s,a.noDataText,l,c)}}function ty(t){var e="ps"==t.map._mapType?t.colorLegend.titlePadding:0;return t.maxMin&&(e+=10),e}function ey(t,e,n){var r,i,a,o=t._discreteLegendContainer.append("g").attr("class","em-legend-divergence-container");"ranges"==n.labelType&&(e+=n.pointOfDivergencePadding/2);var s=t._discreteLegendContainer.selectAll(".em-legend-label").nodes().reduce(function(t,e){return Math.max(t,e.getBBox().width)},0),l=t.divergingLineLength||t.shapeWidth+(null===(r=t.labelOffsets)||void 0===r?void 0:r.x)+s+(null===(i=t.labelOffsets)||void 0===i?void 0:i.x)+15;o.append("line").attr("x1",0).attr("y1",e).attr("x2",0+l).attr("y2",e).attr("class","em-legend-diverging-line");var c=t.pointOfDivergenceLabel.split("|");if(c.length>1){var u=t.divergingArrowLength||30,h=0+l;o.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"),o.append("line").attr("class","em-legend-diverging-line").attr("x1",h).attr("y1",e).attr("x2",h).attr("y2",e-u).attr("marker-end","url(#arrowhead)"),o.append("line").attr("class","em-legend-diverging-line").attr("x1",h).attr("y1",e).attr("x2",h).attr("y2",e+u).attr("marker-end","url(#arrowhead)"),o.append("text").attr("class","em-legend-label").attr("x",h+10).attr("y",e-u+10).attr("dy","0.3em").text(c[0]),o.append("text").attr("class","em-legend-label").attr("x",h+10).attr("y",e+u-10).attr("dy","0.3em").text(c[1])}else o.append("text").attr("class","em-legend-diverging-label em-legend-label").attr("x",0+l+5).attr("y",e).attr("dy","0.3em").text(t.pointOfDivergenceLabel);"thresholds"!=t.labelType&&"thresholds"!=(null===(a=t.colorLegend)||void 0===a?void 0:a.labelType)||(c.length>1?t._discreteLegendContainer.selectAll(".em-legend-label-divergence").attr("x",0+l+10):t._discreteLegendContainer.selectAll(".em-legend-label-divergence").remove())}function ny(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function ry(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ny(Object(n),!0).forEach(function(e){Ji(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ny(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var iy=function(t,e){var n=ox(t);if(n.labelType="thresholds",n.sepLineLength=n.shapeWidth,n.tickLength=4,n.decimals=0,n.labelOffsets={x:3,y:0},n.labels=null,n.histogram=null,n.pointOfDivergenceLabel=void 0,n.pointOfDivergence=void 0,n.pointOfDivergencePadding=7,n.divergingLineLength=void 0,n.divergingArrowLength=void 0,n.lowLabel="Low",n.highLabel="High",n.ticks=0,n.tickValues=void 0,n.tickLabels=void 0,n.orientation="vertical",e)for(var r in e)"histogram"===r&&"object"===$i(e[r])?n.histogram=ry({orientation:"horizontal",showCounts:!1,showPercentages:!1,labelRotation:0},e.histogram):n[r]=e[r];return n.update=function(){if(n.updateConfig(),n.updateContainer(),n.lgg.node()){var t=n.map;if(n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle(),!t.classToFillStyle())return;n.pointOfDivergenceLabel&&!n.pointOfDivergence&&(n.pointOfDivergence=t.numberOfClasses_/2);var e=n.getBaseY(),r=n.getBaseX();if(n.histogram?U_(n,r,e):"continuous"===t.colorSchemeType_?H_(n,r,e):Q_(n,r,e),t.opacityScale_){var i=n.lgg.node().getBBox().height+10;!function(t,e,n){var r,i=t.map,a=i.statData("alpha");if(a&&a.isReady()){var o=i.opacityScale_,s=o.domain()[0],l=o.domain()[1],c=oy(t);t._alphaLegendContainer=t.lgg.append("g").attr("class","alpha-legend-container").attr("transform","translate(".concat(e,",").concat(n,")"));for(var u=0;u<40;u++){var h=s+(l-s)*u/40;t._alphaLegendContainer.append("rect").attr("x",3*u).attr("y",0).attr("width",3).attr("height",10).style("fill","#000").style("opacity",o(h))}t._alphaLegendContainer.append("text").attr("x",0).attr("y",22).attr("class","em-legend-label").text(c(s)),t._alphaLegendContainer.append("text").attr("x",120).attr("y",22).attr("text-anchor","end").attr("class","em-legend-label").text(c(l)),t._alphaLegendContainer.append("text").attr("x",60).attr("y",-5).attr("text-anchor","middle").attr("class","em-legend-label").text((null===(r=a.unitText)||void 0===r?void 0:r.call(a))||"Transparency")}}(n,r,e+i)}if(n.map.patternFill_){var a=n.lgg.node().getBBox().height,o=n.lgg.append("g").attr("class","pattern-fill-legend").attr("transform","translate(".concat(n.getBaseX(),", ").concat(a+n.boxPadding+5,")"));M_(n,o)}n.setBoxDimension()}},n.labelDecNb=function(t){return console.warn("labelDecNb is now DEPRECATED. Please use decimals instead."),n},n};function ay(t){var e=t.map,n=e.thresholds_.length>1?e.thresholds_:Array.from({length:e.numberOfClasses_}).map(function(n,r){return e.classifier().invertExtent(r)[t.ascending?0:1]}).slice(1);return n}function oy(t){if("ranges"==t.labelType){var e=ay(t);return t.labelFormatter||function(n,r){var i=vn(".".concat(t.decimals,"f"));return 0===r?"> ".concat(i(e[e.length-1])):r===e.length?"< ".concat(i(e[0])):"".concat(i(e[e.length-r-1])," - < ").concat(i(e[e.length-r])," ")}}return t.labelType,t.labelFormatter||vn(".".concat(t.decimals,"f"))}function sy(t,e){var n=Vi(t),r=t.svg_.selectAll(n).selectAll("[ecl]");r.style("fill","white"),r.filter("[ecl='"+e+"']").each(function(){Nt(this).style("fill",Nt(this).attr("fill___"))})}function ly(t){var e=Vi(t);t.svg_.selectAll(e).selectAll("[ecl]").each(function(){Nt(this).style("fill",Nt(this).attr("fill___"))})}function cy(t){return function(){return t}}const uy=Math.PI,hy=2*uy,fy=1e-6,dy=hy-fy;function py(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class gy{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?py:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return py;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,a){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-t,l=r-e,c=a-t,u=o-e,h=c*c+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(h>fy)if(Math.abs(u*s-l*c)>fy&&i){let f=n-a,d=r-o,p=s*s+l*l,g=f*f+d*d,m=Math.sqrt(p),v=Math.sqrt(h),_=i*Math.tan((uy-Math.acos((p+h-g)/(2*m*v)))/2),y=_/v,x=_/m;Math.abs(y-1)>fy&&this._append`L${t+y*c},${e+y*u}`,this._append`A${i},${i},0,0,${+(u*f>c*d)},${this._x1=t+x*s},${this._y1=e+x*l}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,r,i,a){if(t=+t,e=+e,a=!!a,(n=+n)<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),l=t+o,c=e+s,u=1^a,h=a?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>fy||Math.abs(this._y1-c)>fy)&&this._append`L${l},${c}`,n&&(h<0&&(h=h%hy+hy),h>dy?this._append`A${n},${n},0,1,${u},${t-o},${e-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:h>fy&&this._append`A${n},${n},0,${+(h>=uy)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function my(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new gy(e)}const vy=Math.abs,_y=Math.atan2,yy=Math.cos,xy=Math.max,by=Math.min,wy=Math.sin,My=Math.sqrt,Sy=1e-12,Cy=Math.PI,Ey=Cy/2,ky=2*Cy;function Ay(t){return t>=1?Ey:t<=-1?-Ey:Math.asin(t)}My(3);const Ty={draw(t,e){const n=My(e/Cy);t.moveTo(n,0),t.arc(0,0,n,0,ky)}},Py={draw(t,e){const n=My(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},Fy=My(1/3),Ly=2*Fy,Ny={draw(t,e){const n=My(e/Ly),r=n*Fy;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},Oy={draw(t,e){const n=My(e),r=-n/2;t.rect(r,r,n,n)}},Dy=wy(Cy/10)/wy(7*Cy/10),zy=wy(ky/10)*Dy,Iy=-yy(ky/10)*Dy,Gy={draw(t,e){const n=My(.8908130915292852*e),r=zy*n,i=Iy*n;t.moveTo(0,-n),t.lineTo(r,i);for(let e=1;e<5;++e){const a=ky*e/5,o=yy(a),s=wy(a);t.lineTo(s*n,-o*n),t.lineTo(o*r-s*i,s*r+o*i)}t.closePath()}},jy=My(3),Ry={draw(t,e){const n=-My(e/(3*jy));t.moveTo(0,2*n),t.lineTo(-jy*n,-n),t.lineTo(jy*n,-n),t.closePath()}},By=(My(3),-.5),Wy=My(3)/2,qy=1/My(12),Uy=3*(qy/2+1),Hy={draw(t,e){const n=My(e/Uy),r=n/2,i=n*qy,a=r,o=n*qy+n,s=-a,l=o;t.moveTo(r,i),t.lineTo(a,o),t.lineTo(s,l),t.lineTo(By*r-Wy*i,Wy*r+By*i),t.lineTo(By*a-Wy*o,Wy*a+By*o),t.lineTo(By*s-Wy*l,Wy*s+By*l),t.lineTo(By*r+Wy*i,By*i-Wy*r),t.lineTo(By*a+Wy*o,By*o-Wy*a),t.lineTo(By*s+Wy*l,By*l-Wy*s),t.closePath()}};function Vy(t,e){let n=null,r=my(i);function i(){let i;if(n||(n=i=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),i)return n=null,i+""||null}return t="function"==typeof t?t:cy(t||Ty),e="function"==typeof e?e:cy(void 0===e?64:+e),i.type=function(e){return arguments.length?(t="function"==typeof e?e:cy(e),i):t},i.size=function(t){return arguments.length?(e="function"==typeof t?t:cy(+t),i):e},i.context=function(t){return arguments.length?(n=null==t?null:t,i):n},i}function Yy(t,e,n,r,i){var a,o,s,l,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:16;if(i){var u=zi("em-size-legend-title");c+=u,e.append("text").attr("class","em-size-legend-title").attr("id","em-size-legend-title").attr("x",0).attr("y",u).text(i)}var h=r.domain();if(!n){var f,d=h[0],p=h[1];0===d&&null!==(f=r._values)&&void 0!==f&&f.length&&(d=Math.min.apply(Math,y(r._values.filter(function(t){return t>0})))),n=[p,d]}var g=r(Dt(n)),m=g,v=2*g+c,_=e.append("g").attr("transform","translate(".concat(m,",").concat(v,")")).attr("class","em-circle-size-legend").attr("id","em-circle-size-legend").attr("text-anchor","right").style("fill","black").selectAll("g").data(n.filter(function(t){return r(t)})).join("g").attr("class","em-legend-item");_.append("circle").attr("class","em-legend-circle").style("fill","none").attr("stroke","black").attr("cy",function(t){return-r(t)}).attr("r",r);var x=(null===(a=t.sizeLegend)||void 0===a?void 0:a.labelFormatter)||Ri;null!==(o=t.nodeSizeLegend)&&void 0!==o&&o.labelFormatter&&(x=t.nodeSizeLegend.labelFormatter);var b=(null===(s=t.sizeLegend)||void 0===s?void 0:s.labels)||(null===(l=t.nodeSizeLegend)||void 0===l?void 0:l.labels);return _.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("y",function(t,e){return-1-2*r(t)}).attr("x",g+5).text(function(t,e){return b&&b[e]?b[e]:x(t)}),_.append("line").style("stroke-dasharray",2).style("stroke","grey").attr("x1",2).attr("y1",function(t,e){return-1-2*r(t)}).attr("x2",g+5).attr("y2",function(t,e){return-1-2*r(t)}),t}function $y(t){var e,n=t.map,r=(null===(e=t.sizeLegend)||void 0===e?void 0:e.labelFormatter)||Ri,i=n.classifierSize_.domain(),a=i[1],o=i[0],s=n.classifierSize_(a),l=t.sizeLegend.values||[a,o],c=zi("em-legend-label"),u=t.sizeLegend.title?zi("em-size-legend-title"):0,h=c+2,f=t._sizeLegendContainer.append("g").attr("id","em-spike-legend"),d=0;t.sizeLegend.title&&(f.append("text").attr("class","em-legend-title em-spike-legend-title").attr("id","em-size-legend-title").attr("x",0).attr("y",u).text(t.sizeLegend.title),d+=u+8);var p=l.map(function(t){return String(r(t))}),g=Math.max.apply(Math,y(p.map(function(t){return t.length}))),m=g*c*.45+5,v=f.append("g").attr("id","em-spike-legend-items").attr("transform","translate(".concat(t.boxPadding+c,",").concat(d+s,")")).attr("text-anchor","middle").style("font-size","".concat(c,"px")).selectAll("g").data(l).join("g").attr("transform",function(t,e){return"translate(".concat(e*m,",0)")});v.append("path").attr("d",function(t){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.psSpikeWidth_;return"M".concat(-e/2,",0L0,").concat(-t,"L").concat(e/2,",0")}(n.classifierSize_(t))}).attr("fill",n.psFill_).attr("fill-opacity",n.psFillOpacity_).attr("stroke",n.psStroke_).attr("stroke-width",n.psStrokeWidth_),v.append("text").attr("class","em-legend-label em-spike-legend-label").attr("dy",h).text(function(t){return r(t)})}var Xy={cross:Py,square:Oy,diamond:Ny,triangle:Ry,star:Gy,wye:Hy,circle:Ty};function Jy(t,e,n,r,i){var a=t.map;null==t.sizeLegend._cursorY&&(t.sizeLegend._cursorY=t.boxPadding+(t.sizeLegend.title?t.sizeLegend.titlePadding:0));var o=a.classifierSize_(a.classifierSize_.domain()[1]),s=o,l=t.sizeLegend._cursorY+t.sizeLegend.shapePadding,c=t._sizeLegendContainer.append("g").attr("class","em-size-legend-item").attr("transform","translate(".concat(s,",").concat(l,")")),u=function(t){var e,n=t.map;if(n.psCustomSVG_)e=n.psCustomSVG_;else if(n.psCustomShape_)e=n.psCustomShape_;else if("bar"==n.psShape_)e=Vy().type({draw:function(t,e){var r=Math.sqrt(e);t.moveTo(0,0),t.lineTo(0,r),t.lineTo(n.psBarWidth_,r),t.lineTo(n.psBarWidth_,0),t.lineTo(0,0),t.closePath()}});else{var r=Xy[n.psShape_]||Xy.circle;e=Vy().type(r)}return e}(t),h=u.size(n*n)(),f=c.append("g").style("fill",a.classifierColor_?t.sizeLegend.shapeFill:a.psFill_).style("fill-opacity",a.psFillOpacity()).style("stroke",t.sizeLegend.shapeStroke||a.psStroke()).style("stroke-width",t.sizeLegend.shapeStrokeWidth||a.psStrokeWidth()).append("path").attr("d",h),d=f.node().getBBox();f.attr("transform","translate(".concat(t.sizeLegend.shapeOffsets.x,",").concat(t.sizeLegend.shapeOffsets.y+d.height/2,")"));var p=o/2+t.sizeLegend.labelOffsets.x+t.boxPadding;c.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("x",p).attr("y",d.height/2).text(i(e));var g=c.node().getBBox().height;t.sizeLegend._cursorY+=g+t.sizeLegend.shapePadding}function Zy(t,e,n){var r=t.map;if(t._sizeLegendContainer=t.lgg.append("g").attr("class","em-size-legend-container").attr("id","em-size-legend-container").attr("transform","translate(".concat(e,",").concat(n,")")),t.sizeLegend._cursorY=null,r.psCustomSVG_||"circle"!==r.psShape_)if("spike"===r.psShape_)$y(t);else{var i,a=t._sizeLegendContainer;if(t.sizeLegend.title){var o=zi("em-size-legend-title");a.append("text").attr("class","em-legend-title em-size-legend-title").attr("id","em-size-legend-title").attr("x",0).attr("y",o).text(t.sizeLegend.title)}var s=(null===(i=t.sizeLegend)||void 0===i?void 0:i.labelFormatter)||Ri,l=r.classifierSize_.domain();r.customSymbols={nodeHeights:0},t.sizeLegend.values||(t.sizeLegend.values=[l[1],l[0]]);var c=t.sizeLegend.values.length;(!c||c<2)&&(console.warn("eurostat-map: sizeLegend.values length must be at least 2"),c=2);for(var u=1;u<c+1;u++){var h=t.sizeLegend.values[u-1],f=r.classifierSize_(h);"bar"===r.psShape_?Qy(t,h,f,u,s):"custom"===r.psShape_||r.psCustomSVG_?Ky(t,h,f,u,s):Jy(t,h,f,0,s)}}else Yy(t,t._sizeLegendContainer,t.sizeLegend.values,r.classifierSize_,t.sizeLegend.title,t.sizeLegend.titlePadding);t.sizeLegend.noData&&function(t){var e=t._sizeLegendContainer.node().getBBox(),n={default:20,bar:35,spike:1,circle:1,square:20},r=n[t.map.psShape_]||n.default,i=t.noDataShapeHeight,a=e.height+r+i/2,o=0,s=t._sizeLegendContainer.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(o,",").concat(a,")"));t.appendNoDataLegend(s,t.sizeLegend.noDataText,tx,ex)}(t)}function Ky(t,e,n,r,i){var a=t.map;null==t.sizeLegend._cursorY&&(t.sizeLegend._cursorY=t.boxPadding+(t.sizeLegend.title?t.sizeLegend.titlePadding:0));var o=a.classifierSize_(a.classifierSize_.domain()[1]),s=t.boxPadding+o,l=t.sizeLegend._cursorY,c=t._sizeLegendContainer.append("g").attr("class","em-size-legend-item").attr("transform","translate(".concat(s,",").concat(l,")")),u=c.append("g").attr("class","em-size-legend-symbol").style("fill",a.classifierColor_?t.sizeLegend.shapeFill:a.psFill_).style("fill-opacity",a.psFillOpacity()).style("stroke",t.sizeLegend.shapeStroke||a.psStroke()).style("stroke-width",t.sizeLegend.shapeStrokeWidth||a.psStrokeWidth()).append("g").html(a.psCustomSVG_).attr("transform","scale(".concat(n,")")),h=u.node().getBBox();u.attr("transform","translate(".concat(-h.x-h.width/2,",").concat(-h.y-h.height/2,") scale(").concat(n,")"));var f=s+a.classifierSize_(a.classifierSize_.domain()[0])+t.sizeLegend.labelOffsets.x;c.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("x",f).attr("y",0).text(i(e));var d=c.node().getBBox().height;t.sizeLegend._cursorY+=d+t.sizeLegend.shapePadding}function Qy(t,e,n,r,i){var a=t.map;null==t.sizeLegend._cursorY&&(t.sizeLegend._cursorY=t.boxPadding+(t.sizeLegend.title?t.sizeLegend.titlePadding:0));var o=t.boxPadding,s=t.sizeLegend._cursorY+t.sizeLegend.shapePadding,l=function(t){var e,n=t.map;if(n.psCustomSVG_)e=n.psCustomSVG_;else if(n.psCustomShape_)e=n.psCustomShape_;else if("bar"==n.psShape_){var r=function(t,e){var r=Math.sqrt(e);t.moveTo(0,0),t.lineTo(0,r),t.lineTo(n.psBarWidth_,r),t.lineTo(n.psBarWidth_,0),t.lineTo(0,0),t.closePath()};e=Vy().type({draw:r})}else{var i=Xy[n.psShape_]||Xy.circle;e=Vy().type(i)}return e}(t),c=l.size(n*n)(),u=t._sizeLegendContainer.append("g").attr("class","em-size-legend-item").attr("transform","translate(".concat(o,",").concat(s,")"));u.append("g").style("fill",a.classifierColor_?t.sizeLegend.shapeFill:a.psFill_).style("fill-opacity",a.psFillOpacity()).style("stroke",t.sizeLegend.shapeStroke?t.sizeLegend.shapeStroke:a.psStroke()).style("stroke-width",t.sizeLegend.shapeStrokeWidth||a.psStrokeWidth()).append("path").attr("d",c).attr("transform","translate(".concat(t.sizeLegend.shapeOffsets.x,",").concat(t.sizeLegend.shapeOffsets.y,")"));var h=o+a.psBarWidth_+t.sizeLegend.labelOffsets.x,f=n/2+t.sizeLegend.labelOffsets.y;u.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("x",h).attr("y",f).text(i(e));var d=u.node().getBBox().height;t.sizeLegend._cursorY+=d+t.sizeLegend.shapePadding}function tx(t,e){var n=t.getCentroidsGroup(t).selectAll("[ecl]");n.each(function(t,e){Nt(this).style("opacity","0")}),n.filter("[ecl='"+e+"']").each(function(e,n){Nt(this).style("opacity",t.psFillOpacity_)})}function ex(t){t.getCentroidsGroup(t).selectAll("[ecl]").each(function(e,n){Nt(this).style("opacity",t.psFillOpacity_)})}var nx=function(t,e){var n=ox(t);if(n.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},n.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},e)for(var r in e)if("colorLegend"==r||"sizeLegend"==r){for(var i in n[r])void 0!==e[r][i]&&(n[r][i]=e[r][i]);0==e.colorLegend&&(n.colorLegend=!1)}else n[r]=e[r];return n.update=function(){if(n.updateConfig(),n.updateContainer(),n.lgg.node()){n.lgg.selectAll("*").remove(),n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle(),n.sizeLegend._totalBarsHeight=0,n.sizeLegend._totalD3SymbolsHeight=0;var e=n.getBaseY(),r=n.getBaseX();if(t.classifierSize_&&Zy(n,r,e),t.classifierColor_&&n.colorLegend){var i=r,a=e;n._sizeLegendContainer&&(a+=n._sizeLegendContainer.node().getBBox().height+n.colorLegend.marginTop),Q_(n,i,a)}if(n.map.patternFill_){var o=n.lgg.node().getBBox().height,s=n.lgg.append("g").attr("class","pattern-fill-legend").attr("transform","translate(".concat(r,", ").concat(o+n.boxPadding+5,")"));M_(n,s)}n.setBoxDimension()}},n};function rx(t){if("ranges"==t.colorLegend.labelType){var e=function(t){var e=t.map,n=e.psThresholds_.length>1?e.psThresholds_:Array.from({length:e.psClasses_}).map(function(n,r){return e.classifier().invertExtent(r)[t.ascending?0:1]}).slice(1);return n}(t);return t.colorLegend.labelFormatter||function(n,r){var i=vn(".".concat(t.decimals,"f"));return 0===r?"> ".concat(i(e[e.length-1])):r===e.length?"< ".concat(i(e[0])):"".concat(i(e[e.length-r-1])," - < ").concat(i(e[e.length-r])," ")}}return t.colorLegend.labelType,t.colorLegend.labelFormatter||vn(".".concat(t.decimals,"f"))}function ix(t,e){var n=t.getCentroidsGroup(t).selectAll("[ecl]");n.each(function(t,e){Nt(this).style("opacity","0")}),n.filter("[ecl='"+e+"']").each(function(e,n){Nt(this).style("opacity",t.psFillOpacity_)})}function ax(t){t.getCentroidsGroup(t).selectAll("[ecl]").each(function(e,n){Nt(this).style("opacity",t.psFillOpacity_)})}var ox=function(t){var e={};function n(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new WeakSet,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=i.maxDepth||100;if(a.has(t))return t;if(a.add(t),o>s)return console.warn("Max recursion depth (".concat(s,") reached.")),t;for(var l in e)if(e.hasOwnProperty(l)&&t.hasOwnProperty(l)){var c=e[l],u=t[l];"function"==typeof c?t[l]=c:r(c)&&r(u)?n(u,c,i,a,o+1):Array.isArray(c)&&Array.isArray(u)?t[l]=i.mergeArrays?y(new Set([].concat(y(u),y(c)))):y(c):c instanceof Date?t[l]=new Date(c.getTime()):c instanceof RegExp?t[l]=new RegExp(c):c instanceof Map?t[l]=new Map(c):c instanceof Set?t[l]=new Set(c):t[l]=c}return t}function r(t){return"[object Object]"===Object.prototype.toString.call(t)}return e.map=t,e.svgId="em-legend-container-"+Math.round(1e5*Math.random()),e.svg=void 0,e.lgg=void 0,e.x=void 0,e.y=void 0,e.boxPadding=7,e.boxOpacity=.7,e.title="",e.titleFontSize=zi("em-legend-title"),e.width=150,e.titlePadding=5,e.shapeWidth=25,e.shapeHeight=20,e.shapePadding=5,e.labelFontSize=zi("em-legend-label"),e.labelOffsets={x:5,y:5},e.labelFormatter=null,wn({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),e.noData=!0,e.noDataText="No data",e.noDataPadding=5,e.noDataShapeWidth=25,e.noDataShapeHeight=20,e.ascending=!0,e.decimals=0,e.maxMin=!0,e.maxMinLabels=["",""],e.build=function(){e.svg=Nt("#"+e.svgId),e.svg.selectAll("*").remove(),e.lgg=e.svg.attr("class","em-legend")},e.update=function(){return console.log("Legend update function not implemented"),e},e.updateContainer=function(){var t=e.map,n=e.lgg;n.selectAll("*").remove();var r=e.svg;if(t&&n&&r&&(null==r?void 0:r.attr("id"))!==t.legend_.svgId&&e.build(),null!=e.x||null!=e.y){var i,a,o=null!==(i=e.x)&&void 0!==i?i:t.width()-e.width-e.boxPadding,s=null!==(a=e.y)&&void 0!==a?a:e.boxPadding;e.lgg.attr("transform","translate(".concat(o,",").concat(s,")"))}},e.updateConfig=function(){var t=e.map;t.legend_&&n(e,t.legend_)},e.makeBackgroundBox=function(){e.lgg.append("rect").attr("id","em-legend-background").attr("class","em-legend-background").style("opacity",e.boxOpacity)},e.addTitle=function(){if(e.title){var t=e.lgg.append("g").attr("id","em-legend-titles"),n=zi("em-legend-title");t.append("text").attr("class","em-legend-title").attr("x",e.boxPadding).attr("y",e.boxPadding+n).text(e.title)}},e.addSubtitle=function(){if(e.subtitle){var t=e.lgg.select("#em-legend-titles"),n=zi("em-legend-title"),r=zi("em-legend-subtitle");t.append("text").attr("class","em-legend-subtitle").attr("x",e.boxPadding).attr("y",e.boxPadding+n+r+3).html(e.subtitle)}},e.getBaseY=function(){return e.boxPadding+(e.title?zi("em-legend-title"):0)+(e.subtitle?zi("em-legend-subtitle"):0)+10},e.getBaseX=function(){return e.boxPadding},e.setBoxDimension=function(){if(e.lgg.node()){var t=e.lgg.node().getBBox({stroke:!0}),n=e.boxPadding;e.svg.select("#em-legend-background").attr("x",t.x-n).attr("y",t.y-n).attr("width",t.width+2*n).attr("height",t.height+2*n)}},e.appendNoDataLegend=function(t,n,r,i){var a=e.map;t.append("rect").attr("class","em-legend-rect").style("fill",a.noDataFillStyle()).attr("y",e.noDataPadding).attr("width",e.noDataShapeWidth).attr("height",e.noDataShapeHeight).on("mouseover",function(){r(a,"nd"),a.insetTemplates_&&Wi(a.insetTemplates_,a.svgId,r,"nd")}).on("mouseout",function(){i(a),a.insetTemplates_&&Wi(a.insetTemplates_,a.svgId,i,"nd")}),t.append("text").attr("class","em-legend-label em-legend-label-no-data").attr("dy","0.35em").attr("x",e.noDataShapeWidth+5).attr("y",e.noDataShapeHeight/2+e.noDataPadding).style("pointer-events","all").style("cursor","pointer").on("mouseover",function(){r(a,"nd"),a.insetTemplates_&&Wi(a.insetTemplates_,a.svgId,r,"nd")}).on("mouseout",function(){i(a),a.insetTemplates_&&Wi(a.insetTemplates_,a.svgId,i,"nd")}).text(n)},e.getNumberOfClasses=function(t){var e=t.map;return"ps"===e._mapType?e.psClasses_:e.numberOfClasses_},e.getLabelFormatter=function(t){return"ps"===t.map._mapType?rx(t):oy(t)},e.getClassToFillStyle=function(t){var e=t.map;return"ps"===e._mapType?e.psClassToFillStyle_:e.classToFillStyle_},e.getColorClassifier=function(t){var e=t.map;return"ps"===e._mapType?e.classifierColor_:e.classifier_},e.getColorStats=function(t){var e=t.map;return"ps"===e._mapType?e.statData("color"):e.statData()},e.getHighlightFunction=function(t){return"ps"==t._mapType?ix:sy},e.getUnHighlightFunction=function(t){return"ps"==t._mapType?ax:ly},e},sx=function(t){var e,n,r;function i(){r=Nt("#"+t.id),r.empty()&&(r=Nt("body").append("div").attr("id",t.id)),r.attr("class","em-tooltip")}return(t=t||{}).containerId=t.containerId||t.svgId||"map",t.id=t.id||"em-tooltip-".concat(t.containerId),t.offset={x:(null===(e=t.offset)||void 0===e?void 0:e.x)||t.xOffset||30,y:(null===(n=t.offset)||void 0===n?void 0:n.y)||t.yOffset||20},t.transitionDuration=0,t.opacity=t.opacity||1,i.mouseover=function(e){if(r.html(e),e){var n=event.pageX,a=event.pageY;i.ensureTooltipOnScreen(n,a),r.interrupt().transition().duration(t.transitionDuration).style("opacity",t.opacity)}},i.mousemove=function(t){var e=t.pageX,n=t.pageY;this.ensureTooltipOnScreen(e,n)},i.mouseout=function(){r.interrupt().transition().duration(t.transitionDuration).style("opacity",0)},i.style=function(t,e){return 1==arguments.length?r.style(t):(r.style(t,e),i)},i.attr=function(t,e){return 1==arguments.length?r.attr(t):(r.attr(t,e),i)},i.ensureTooltipOnScreen=function(e,n){var i=r.node();i.style.left=e+t.offset.x+"px",i.style.top=n-t.offset.y+"px";var a=document.getElementById(t.containerId).getBoundingClientRect(),o=a.width,s=a.height;if(i.offsetLeft>a.left+o-i.clientWidth){var l=e-i.clientWidth-t.offset.x;if(i.style.left=l+"px",i.offsetLeft+i.clientWidth>e){var c=e-i.clientWidth-t.offset.x;i.style.left=c+"px"}}i.offsetTop+i.clientHeight>a.top+s&&(i.style.top=i.offsetTop-i.clientHeight+"px")},i(),i},lx="em-loading-overlay";function cx(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Loading…",n=function(t){if(!t)return null;var e=t.querySelector("#".concat(lx));return e||((e=document.createElement("div")).id=lx,e.classList.add("is-hidden"),e.setAttribute("aria-hidden","true"),e.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 ',t.appendChild(e),e)}(t);if(n){var r=n.querySelector(".em-loading-label");r&&(r.textContent=e),n.classList.remove("is-hidden"),n.setAttribute("aria-hidden","false")}}var ux=function(t,e,n){var r=m_(t,e,n);r._geoDone_=!1,r._statDone_=!1,r._finalized_=!1;var i=function(){r._finalized_||r._geoDone_&&r._statDone_&&(r._finalized_=!0,r.callback()&&r.callback()(r))},a=!1;if(r._loadingStatCount_=0,r.stat_={default:void 0},r.stat=function(t,e){return arguments.length?2==arguments.length?(r.stat_[t]=e,r):"string"==typeof t||t instanceof String?r.stat_[t]:(r.stat_=t.default?t:{default:t},r):r.stat_.default},r.statData_={default:w_(),color:w_(),size:w_(),v1:w_(),v2:w_(),v3:w_()},r.statData=function(t,e){return arguments.length?1===arguments.length?(r.statData_[t]||(r.statData_[t]=w_()),r.statData_[t]):(r.statData_[t]=e,r):r.statData_.default},r.noDataText_="No data available",r.language_="en",r.transitionDuration_=500,r.tooltip_.textFunction=void 0,r.filtersDefinitionFunction_=void 0,r.callback_=void 0,r.legend_=void 0,r.legendObj_=void 0,["legend_","legendObj_","noDataText_","language_","transitionDuration_","tooltipText_","filtersDefinitionFunction_","callback_"].forEach(function(t){r[t.substring(0,t.length-1)]=function(e){return arguments.length?(r[t]=e,r):r[t]}}),t)for(var o in t)r[o]&&null!=t[o]&&r[o](t[o]);r.legend=function(t){if(!arguments.length)return r.legend_;if(0==t){var e=r.legendObj();if(e){var n=Nt("#"+e.svgId);n.size()>0&&n.selectAll("*").remove()}return r.legend_=t,r}return r.legend_=t,r.legendObj_&&r.updateLegend(),r},r.updateLegend=function(t){return r.legendObj_&&r.legendObj().update(),r},r.build=function(){return r._geoDone_=!1,r._statDone_=!1,r._finalized_=!1,a=!1,r.projectionFunction_&&r.proj("4326"),r.buildMapTemplateBase(),r.filtersDefinitionFunction_&&r.filtersDefinitionFunction_(r.svg(),r.numberOfClasses_),r.legend()&&r.buildLegend(),r.tooltip_||r.tooltip_||(r.tooltip_={id:r.svgId()}),r._tooltip=sx(r.tooltip_),r.updateGeoData(),r.updateStatData(),r},r.updateLoader=function(){if(!r.isInset){if(!r._wrapper_){var t,e,n=null===(t=r.svg)||void 0===t?void 0:t.call(r);if(!n||n.empty())return;r._wrapper_=null!==(e=n.node().parentNode)&&void 0!==e&&null!==(e=e.classList)&&void 0!==e&&e.contains("em-map-wrapper")?n.node().parentNode:null}r._wrapper_&&(r._loadingGeo_||r._loadingStatCount_>0?cx(r._wrapper_,"Loading…"):function(t){if(t){var e=t.querySelector("#".concat(lx));e&&(e.classList.add("is-hidden"),e.setAttribute("aria-hidden","true"))}}(r._wrapper_))}},r.buildLegend=function(){r.legendObj(r.getLegendConstructor()(r,r.legend()));var t=r.legendObj();if(0==Nt("#"+t.svgId).size()){null==t.x?(r.width(),t.boxPadding):t.x,null==t.y?t.boxPadding:t.y;r.svg().append("g").attr("id",t.svgId).attr("class","em-legend")}t.build()};var s=function(){for(var t in r.statData_){var e=!!r.stat_[t],n=!(!r.statData_[t]||!r.statData_[t].get());if((e||n)&&!r.statData_[t].isReady())return!1}return!0};function l(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}return r.updateGeoData=function(){return r._loadingGeo_=!0,r.updateLoader(),r.updateGeoMapTemplate(function(){r._loadingGeo_=!1,r.updateLoader(),r.Geometries.isGeoReady()&&(r._geoDone_=!0,s()&&(r._statDone_=!0,r.updateStatValues()),i())}),r},r.updateStatData=function(){var t=function(){var t,n,o=r.stat(e),l=null===(t=(n=r.statData(e)).get)||void 0===t?void 0:t.call(n);if(!o&&!l)return 1;if(o){var c=w_(o);r.statData(e,c);var u=!!c.eurostatDatasetCode_||!!c.csvURL_;u&&(r._loadingStatCount_++,r.updateLoader());var h=r.nutsLevel_;"mixed"===h&&(h=0),c.retrieveFromRemote(h,r.language(),function(){u&&(r._loadingStatCount_=Math.max(0,r._loadingStatCount_-1),r.updateLoader()),s()&&(r._statDone_=!0,r.Geometries.isGeoReady()&&(a||(a=!0,Promise.resolve().then(function(){a=!1,r.updateStatValues(),i()}))))})}};for(var e in r.stat_)t();return r},r.updateStatValues=function(){return e&&(r.insetTemplates_&&Wi(r.insetTemplates_,r.svgId_,r.refreshCentroids),r.refreshCentroids(r)),r.updateClassification(),r.updateStyle(),r.legend_&&r.legendObj()&&r.legendObj().update(),r},r.updateClassification=function(){return console.log("Map updateClassification function not implemented"),r},r.updateStyle=function(){return console.log("Map updateStyle function not implemented"),r},r.getLegendConstructor=function(){return console.log("Map getLegendConstructor function not implemented"),ox},r.getTime=function(){return r.statData("default").getTime()},r.setFromURL=function(){var t=hx();return t.w&&r.width(t.w),t.h&&r.height(t.h),t.x&&t.y&&r.geoCenter([t.x,t.y]),t.z&&r.pixelSize(t.z),t.s&&r.scale(t.s),t.lvl&&r.nutsLevel(t.lvl),t.time&&(r.filters_.time=t.time,delete r.filters_.lastTimePeriod),t.proj&&r.proj(t.proj),t.geo&&r.geo(t.geo),t.ny&&r.nutsYear(t.ny),t.language&&r.language(t.language),t.numberOfClasses&&r.numberOfClasses(+t.numberOfClasses),r},r.exportMapToSVG=function(){var t=r.svg_.node().cloneNode(!0);t.hasAttribute("xmlns")||t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.hasAttribute("xmlns:xlink")||t.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),document.body.appendChild(t),Gi(t),ji(t),document.body.removeChild(t);var e=function(t){var e='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'+t.outerHTML;e=e.replace(/&nbsp;/g,"&#160;").replace(/&copy;/g,"&#169;").replace(/&reg;/g,"&#174;").replace(/&times;/g,"&#215;").replace(/&deg;/g,"&#176;");var n=new Blob([e],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(n)}(t),n=document.createElement("a");return n.href=e,n.download="eurostatmap.svg",document.body.appendChild(n),n.click(),document.body.removeChild(n),r},r.exportMapToPNG=function(){var t=Zn(Qn().mark(function t(e,n){var i,a,o,s,c,u,h,f,d,p,g,m,v;return Qn().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if((i=r.svg_.node().cloneNode(!0)).hasAttribute("xmlns")||i.setAttribute("xmlns","http://www.w3.org/2000/svg"),i.hasAttribute("xmlns:xlink")||i.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),document.body.appendChild(i),!document.fonts||!document.fonts.ready){t.next=4;break}return t.prev=1,t.next=2,document.fonts.ready;case 2:t.next=4;break;case 3:t.prev=3,v=t.catch(1),console.warn("document.fonts.ready failed",v);case 4:return Gi(i),ji(i),i.querySelector("rect[data-export-background]")||(a=i.getAttribute("width")||i.viewBox.baseVal.width||i.getBoundingClientRect().width,o=i.getAttribute("height")||i.viewBox.baseVal.height||i.getBoundingClientRect().height,(s=document.createElementNS("http://www.w3.org/2000/svg","rect")).setAttribute("x",0),s.setAttribute("y",0),s.setAttribute("width",String(a)),s.setAttribute("height",String(o)),s.setAttribute("fill","#ffffff"),s.setAttribute("data-export-background","true"),i.insertBefore(s,i.firstElementChild)),c=new XMLSerializer,u=c.serializeToString(i),document.body.removeChild(i),h=new Blob([u],{type:"image/svg+xml;charset=utf-8"}),f=URL.createObjectURL(h),d=Math.round(e||parseFloat(i.getAttribute("width"))||800),p=Math.round(n||parseFloat(i.getAttribute("height"))||600),(g=new Image).crossOrigin="anonymous",m=function(t){try{URL.revokeObjectURL(f)}catch(t){}if(t)try{URL.revokeObjectURL(t)}catch(t){}},g.onload=function(){try{var t=document.createElement("canvas");t.width=d,t.height=p;var e=t.getContext("2d");e.fillStyle="#ffffff",e.fillRect(0,0,d,p),e.drawImage(g,0,0,d,p),t.toBlob(function(t){if(!t)return console.error("canvas.toBlob returned null — likely CORS/taint issue."),window.open().document.write("<pre>"+l(u)+"</pre>"),void m();var e=URL.createObjectURL(t),n=document.createElement("a");n.href=e,n.download="eurostat-map.png",document.body.appendChild(n),n.click(),document.body.removeChild(n),m(e)},"image/png")}catch(t){console.error("Error drawing SVG to canvas:",t),window.open().document.write("<pre>"+l(u)+"</pre>"),m()}},g.onerror=function(t){console.error("Image failed to load for export. Likely CORS or invalid SVG. Error:",t),window.open().document.write("<pre>"+l(u)+"</pre>"),m()},g.src=f,t.abrupt("return",r);case 5:case"end":return t.stop()}},t,null,[[1,3]])}));return function(e,n){return t.apply(this,arguments)}}(),r},hx=function(){for(var t={},e=["w","h","x","y","z","s","lvl","time","proj","geo","ny","language","sl","numberOfClasses"],n=0;n<e.length;n++)t[e[n]]=getURLParameterByName(e[n]);return t};function fx(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(Array.isArray(e)){var n=t.svg().select("defs");n.empty()&&(n=t.svg().append("defs"));var r={};e.forEach(function(e){var i,a=e.pattern,o=void 0===a?"hatching":a,s=e.regionIds,l=void 0===s?[]:s,c=e.color,u=void 0===c?"#000":c,h=e.strokeWidth,f=void 0===h?1:h,d=e.customPattern,p=e.spacing;if(d){var g=d.match(/id=['"]([^'"]+)['"]/);if(!g)return void console.warn("customPattern must include an id attribute.");i=g[1],t.svg().select("#".concat(i)).empty()&&n.node().insertAdjacentHTML("beforeend",d)}else{var m=u.replace("#","").toLowerCase();i="".concat(o,"-").concat(m,"-sw").concat(f),function(t,e,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8,o=t.svg().select("defs");if(t.svg().select("#".concat(CSS.escape(e))).empty()){var s=o.append("pattern").attr("id",e).attr("patternUnits","userSpaceOnUse").attr("width",a).attr("height",a);"hatching"===n?s.append("path").attr("d","M-".concat(a/8,",").concat(a/8," l").concat(a/4,",-").concat(a/4," M0,").concat(a," l").concat(a,",-").concat(a," M").concat(a-a/8,",").concat(a+a/8," l").concat(a/4,",-").concat(a/4)).attr("stroke",r).attr("stroke-width",i):"crosshatch"===n?s.append("path").attr("d","M0,0 l".concat(a,",").concat(a," M").concat(a,",0 l-").concat(a,",").concat(a)).attr("stroke",r).attr("stroke-width",i):"dots"===n?s.append("circle").attr("cx",a/2).attr("cy",a/2).attr("r",i).attr("fill",r):(console.warn('Unknown pattern "'.concat(n,'", defaulting to hatching.')),s.append("path").attr("d","M-".concat(a/8,",").concat(a/8," l").concat(a/4,",-").concat(a/4," M0,").concat(a," l").concat(a,",-").concat(a," M").concat(a-a/8,",").concat(a+a/8," l").concat(a/4,",-").concat(a/4)).attr("stroke",r).attr("stroke-width",i))}}(t,i,o,u,f,p)}e.patternId=i,l.forEach(function(t){r[t]||(r[t]=[]),r[t].push(i)})}),t.svg().selectAll(Hi(t)).each(function(t){var e,n=this,i=null==t||null===(e=t.properties)||void 0===e?void 0:e.id,a=r[i];if(a&&a.length){var o=Nt(this);a.forEach(function(t){var e=o.node().cloneNode(!0);Nt(e).attr("fill","url(#".concat(t,")")).attr("pointer-events","none").attr("class",(o.attr("class")||"")+"pattern-fill-overlay"),Nt(n.parentNode).append(function(){return e})})}})}else console.warn("patternFill expects an array of configs")}var dx=function(t){var e=ux(t,!1,"ch");e.numberOfClasses_=7,e.classificationMethod_="quantile",e.thresholds_=[0],e.colors_=null,e.makeClassifNice_=!0;var n=["#D4DAF0","#C1C9EB","#A8B4E6","#93A2DC","#7C90D6","#677CD2","#5169BE","#3C57B0","#2644A7","#15246B"];e.colorFunction_=function(t){return function(t,e){void 0===e&&(e=t,t=Xe);for(var n=0,r=e.length-1,i=e[0],a=new Array(r<0?0:r);n<r;)a[n]=t(i,i=e[++n]);return function(t){var e=Math.max(0,Math.min(r-1,Math.floor(t*=r)));return a[e](t-e)}}(Xn,n)(Math.min(Math.max(0,t),1))},e.classToFillStyle_=void 0,e.classifier_=void 0,e.tooltip_.textFunction=mx,e.colorSchemeType_="discrete",e.valueTransform_=function(t){return t},e.valueUntransform_=function(t){return t},e.pointOfDivergence_=null;var r=["numberOfClasses_","classificationMethod_","thresholds_","makeClassifNice_","colorFunction_","classToFillStyle_","noDataFillStyle_","classifier_","colors_","colorFunction_","colorSchemeType_","valueTransform_","valueUntransform_","pointOfDivergence_"];function i(t){var n=function(t){return y(Array(t).keys())},r=e.statData().getArray(),i=function(t){t.attr("ecl",function(t){var n=e.statData().get(t.properties.id);if(n){var r=n.value;return":"===r||null===r?"nd":"continuous"===e.colorSchemeType_?r:null!=r?+e.classifier_(r):void 0}})};if(function(){var t=n(e.numberOfClasses_);if("continuous"===e.colorSchemeType_){var i,a=e.valueTransform_||function(t){return t},o=r.map(a),s=Ot(o),l=Dt(o),c=function(t){return null!==t.pointOfDivergence_}(e);if(!("function"==typeof(null===(i=e.colorFunction_)||void 0===i?void 0:i.domain)))if(c){var u,h=a(null!==(u=e.pointOfDivergence_)&&void 0!==u?u:0);e.domain_=[s,h,l]}else e.domain_=[s,l];e.classifier(function(t){return t})}var f=y(r).filter(function(t){return!isNaN(parseFloat(t))&&isFinite(t)});switch(e.classificationMethod_){case"quantile":e.classifier(Vt().domain(r).range(t));break;case"equal-interval":case"equinter":e.classifier(En().domain([Ot(r),Dt(r)]).range(t)),e.makeClassifNice_&&e.classifier().nice();break;case"threshold":e.numberOfClasses(e.thresholds_.length+1),e.classifier(kn().domain(e.thresholds_).range(n(e.numberOfClasses_)));break;case"jenks":var d=l_(f,e.numberOfClasses_).slice(1,-1);e.classifier(kn().domain(d).range(t));break;case"ckmeans":var p=s_(f,e.numberOfClasses_).map(function(t){return t.pop()}).slice(0,-1);e.classifier(kn().domain(p).range(t))}}(),t.svg_){var a=Hi(t);if(i(t.svg().selectAll(a)),"mixed"===t.nutsLevel_)i(t.svg().selectAll("path.em-nutsrg0"))}}function a(t){if(e.filtersDefinitionFunction_?e.classToFillStyle(gx()):e.classToFillStyle(px(e.colorFunction_,e.colors_)),t.svg_){var n=Hi(t),r=t.svg().selectAll(n);r.style("pointer-events","none").transition().duration(e.transitionDuration()).style("fill",s).end().then(function(){r.style("pointer-events",null),r.each(function(){var t=Nt(this);t.attr("fill___",t.style("fill"))}),l(t,r),e.gridCartogram_&&t.svg().selectAll(".em-grid-text").each(function(){var t=Nt(this.parentNode).style("fill");Nt(this).attr("fill",Ui(t))})}).catch(function(t){}),"mixed"===e.nutsLevel_&&o(t),e.labels_&&e.labels_.values&&e.updateValuesLabels(t),e.patternFill_&&fx(t,e.patternFill_)}}r.forEach(function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}}),t&&r.forEach(function(n){var r=n.slice(0,-1);null!=t[r]&&e[r](t[r])}),e.colorFunction=function(t){if(!arguments.length)return e.colorFunction_;if(e.colorFunction_=t,e.filtersDefinitionFunction_)e.classToFillStyle(gx());else{var n=px(e.colorFunction_,e.colors_,e.colorSchemeType_);e.classToFillStyle(n)}return e},e.threshold=function(t){return arguments.length?(e.thresholds_=t,e.numberOfClasses(t.length+1),e):e.thresholds_},e.filtersDefinitionFunction=function(t){return arguments.length?(e.filtersDefinitionFunction_=t,e.svg()&&e.filtersDefinitionFunction_(e.svg(),e.numberOfClasses_),e):e.filtersDefinitionFunction_},e.updateClassification=function(){try{return e.insetTemplates_&&Wi(e.insetTemplates_,e.svgId_,i),i(e),e}catch(t){console.error("Error in updateClassification:",t.message),console.error(t)}},e.updateStyle=function(){try{return e.insetTemplates_&&Wi(e.insetTemplates_,e.svgId_,a),a(e),e}catch(t){console.error("Error in updateStyle:",t.message),console.error(t)}},e.getLegendConstructor=function(){return iy};var o=function(t){t.svg().selectAll(Hi(t)).each(function(){if(!this.parentNode.classList.contains("em-cntrg")){var t=Nt(this),e=t.attr("ecl"),n=t.attr("lvl"),r=e||"0"===n;if(t.style("display",r?"block":"none"),e&&"0"!==n){var i=t.style("stroke")||"#777",a=t.style("stroke-width")||.2;t.style("stroke",i).style("stroke-width",a)}}})};var s=function(t){var n,r=Nt(this).attr("ecl"),i=e.colorSchemeType_||"discrete";if(r||"0"===r)return"nd"===r?e.noDataFillStyle_||"gray":e.filtersDefinitionFunction_?e.classToFillStyle_(r):"continuous"===i?function(t,e){var n,r=e.colorFunction_,i=e.domain_||[0,1],a="function"==typeof(null==r?void 0:r.domain),o=e.valueTransform_||function(t){return t},s=o(t);if(isNaN(s))return e.noDataFillStyle_||"gray";if(a)return r(s);if(3===i.length){var l,c=_(i,3),u=c[0],h=c[2],f=o(null!==(l=e.pointOfDivergence_)&&void 0!==l?l:0);n=s<f?.5*(s-u)/(f-u):.5+.5*(s-f)/(h-f)}else{var d=_(i,2),p=d[0];n=(s-p)/(d[1]-p)}return r(Math.min(Math.max(n,0),1))}(+r,e):null!==(n=e.Geometries)&&void 0!==n&&n.userGeometries?e.classToFillStyle_(r,e.numberOfClasses_||1):"WORLD"===e.geo_?e.classToFillStyle_(r,e.numberOfClasses_||1)||e.cntrgFillStyle_:e.classToFillStyle_(r,e.numberOfClasses_||1)},l=function(t,n){var r=function(e){var n;return null===(n=t.tooltip_.omitRegions)||void 0===n?void 0:n.includes(e)};n.on("mouseover",function(n,i){r(i.properties.id)||(Nt(this).style("fill",t.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(i,e)),e.onRegionMouseOver_&&e.onRegionMouseOver_(n,i,this,t))}).on("mousemove",function(n,i){r(i.properties.id)||(e._tooltip&&e._tooltip.mousemove(n),e.onRegionMouseMove_&&e.onRegionMouseMove_(n,i,this,t))}).on("mouseout",function(n,i){if(!r(i.properties.id)){var a=Nt(this);a.style("fill",a.attr("fill___")),e._tooltip&&e._tooltip.mouseout(),e.onRegionMouseOut_&&e.onRegionMouseOut_(n,i,this,t)}})};return e.highlightRegion=function(t){if(!e.svg_)return e;var n=Hi(e),r=e.svg().selectAll(n).filter(function(e){return e.properties.id===t});if(!r.empty()){var i=r.datum();if(r.style("fill",e.hoverColor_||"orange"),e._tooltip){var a=e.tooltip_.textFunction(i,e);e._tooltip.mouseover(a);var o=r.node().getBBox(),s=e.__lastTransform||{x:0,y:0,k:1},l=(o.x+o.width/2)*s.k+s.x,c=(o.y+o.height/2)*s.k+s.y,u=e.svg().node().getBoundingClientRect(),h=u.left+l,f=u.top+c;e._tooltip.ensureTooltipOnScreen(h,f)}e.onRegionMouseOver_&&e.onRegionMouseOver_(null,i,r.node(),e)}return e},e.clearHighlight=function(){if(!e.svg_)return e;var t=Hi(e);return e.svg().selectAll(t).each(function(){var t=Nt(this),e=t.attr("fill___");e&&t.style("fill",e)}),e._tooltip&&e._tooltip.mouseout(),e},e},px=function(t,e){return t=t||Pn,"continuous"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"discrete")?function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,1],r=(e-n[0])/(n[1]-n[0]);return t(Math.min(Math.max(r,0),1))}:e?function(t,n){return e[t]}:function(e,n){return t(e/(n-1))}},gx=function(){return function(t){return"url(#pattern_"+t+")"}},mx=function(t,e){if(e.tooltip_.omitRegions&&e.tooltip_.omitRegions.includes(t.properties.id))return"";var n=[],r=t.properties.na||t.properties.name,i=t.properties.id;n.push('\n <div class="em-tooltip-bar">\n <b>'.concat(r,"</b>").concat(i?" (".concat(i,")"):"","\n </div>\n "));var a=e.statData(),o=a.get(i),s=a.unitText()||"";if(!o||0!==o.value&&!o.value||":"===o.value)return n.push('\n <div class="em-tooltip-text no-data">\n <table class="em-tooltip-table">\n <tbody>\n <tr><td>'.concat(e.noDataText_,"</td></tr>\n </tbody>\n </table>\n </div>\n ")),n.join("");n.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr><td>'.concat(Ri(o.value)," ").concat(s,"</td></tr>\n </tbody>\n </table>\n </div>\n "));var l=o.status;if(l&&e.tooltip_.showFlags){var c="short"===e.tooltip_.showFlags?l:flags[l]||l;n.push(' <span class="status-flag">'.concat(c,"</span>"))}return n.join("")};const vx=Tn(new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(An)),_x=4294967296;function yx(t){return t.x}function xx(t){return t.y}var bx=Math.PI*(3-Math.sqrt(5));function wx(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),a=0,o=.6,s=new Map,l=yr(h),c=ar("tick","end"),u=function(){let t=1;return()=>(t=(1664525*t+1013904223)%_x)/_x}();function h(){f(),c.call("tick",e),n<r&&(l.stop(),c.call("end",e))}function f(r){var l,c,u=t.length;void 0===r&&(r=1);for(var h=0;h<r;++h)for(n+=(a-n)*i,s.forEach(function(t){t(n)}),l=0;l<u;++l)null==(c=t[l]).fx?c.x+=c.vx*=o:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=o:(c.y=c.fy,c.vy=0);return e}function d(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),a=n*bx;e.x=i*Math.cos(a),e.y=i*Math.sin(a)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,u),e}return null==t&&(t=[]),d(),e={tick:f,restart:function(){return l.restart(h),e},stop:function(){return l.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),s.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(a=+t,e):a},velocityDecay:function(t){return arguments.length?(o=1-t,e):1-o},randomSource:function(t){return arguments.length?(u=t,s.forEach(p),e):u},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,r){var i,a,o,s,l,c=0,u=t.length;for(null==r?r=1/0:r*=r,c=0;c<u;++c)(o=(i=e-(s=t[c]).x)*i+(a=n-s.y)*a)<r&&(l=s,r=o);return l},on:function(t,n){return arguments.length>1?(c.on(t,n),e):c.on(t)}}}function Mx(t){return function(){return t}}function Sx(t){var e,n,r,i=Mx(.1);function a(t){for(var i,a=0,o=e.length;a<o;++a)(i=e[a]).vx+=(r[a]-i.x)*n[a]*t}function o(){if(e){var a,o=e.length;for(n=new Array(o),r=new Array(o),a=0;a<o;++a)n[a]=isNaN(r[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return"function"!=typeof t&&(t=Mx(null==t?0:+t)),a.initialize=function(t){e=t,o()},a.strength=function(t){return arguments.length?(i="function"==typeof t?t:Mx(+t),o(),a):i},a.x=function(e){return arguments.length?(t="function"==typeof e?e:Mx(+e),o(),a):t},a}function Cx(t){var e,n,r,i=Mx(.1);function a(t){for(var i,a=0,o=e.length;a<o;++a)(i=e[a]).vy+=(r[a]-i.y)*n[a]*t}function o(){if(e){var a,o=e.length;for(n=new Array(o),r=new Array(o),a=0;a<o;++a)n[a]=isNaN(r[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return"function"!=typeof t&&(t=Mx(null==t?0:+t)),a.initialize=function(t){e=t,o()},a.strength=function(t){return arguments.length?(i="function"==typeof t?t:Mx(+t),o(),a):i},a.y=function(e){return arguments.length?(t="function"==typeof e?e:Mx(+e),o(),a):t},a}function Ex(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,a,o,s,l,c,u,h,f,d=t._root,p={data:r},g=t._x0,m=t._y0,v=t._x1,_=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((c=e>=(a=(g+v)/2))?g=a:v=a,(u=n>=(o=(m+_)/2))?m=o:_=o,i=d,!(d=d[h=u<<1|c]))return i[h]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&n===l)return p.next=d,i?i[h]=p:t._root=p,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(g+v)/2))?g=a:v=a,(u=n>=(o=(m+_)/2))?m=o:_=o}while((h=u<<1|c)==(f=(l>=o)<<1|s>=a));return i[f]=d,i[h]=p,t}function kx(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function Ax(t){return t[0]}function Tx(t){return t[1]}function Px(t,e,n){var r=new Fx(null==e?Ax:e,null==n?Tx:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Fx(t,e,n,r,i,a){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function Lx(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Nx=Px.prototype=Fx.prototype;function Ox(t){return 1e-6*(t()-.5)}function Dx(t){return t.x+t.vx}function zx(t){return t.y+t.vy}function Ix(t){var e,n,r,i=1,a=1;function o(){for(var t,o,l,c,u,h,f,d=e.length,p=0;p<a;++p)for(o=Px(e,Dx,zx).visitAfter(s),t=0;t<d;++t)l=e[t],h=n[l.index],f=h*h,c=l.x+l.vx,u=l.y+l.vy,o.visit(g);function g(t,e,n,a,o){var s=t.data,d=t.r,p=h+d;if(!s)return e>c+p||a<c-p||n>u+p||o<u-p;if(s.index>l.index){var g=c-s.x-s.vx,m=u-s.y-s.vy,v=g*g+m*m;v<p*p&&(0===g&&(v+=(g=Ox(r))*g),0===m&&(v+=(m=Ox(r))*m),v=(p-(v=Math.sqrt(v)))/v*i,l.vx+=(g*=v)*(p=(d*=d)/(f+d)),l.vy+=(m*=v)*p,s.vx-=g*(p=1-p),s.vy-=m*p)}}}function s(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function l(){if(e){var r,i,a=e.length;for(n=new Array(a),r=0;r<a;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=Mx(null==t?1:+t)),o.initialize=function(t,n){e=t,r=n,l()},o.iterations=function(t){return arguments.length?(a=+t,o):a},o.strength=function(t){return arguments.length?(i=+t,o):i},o.radius=function(e){return arguments.length?(t="function"==typeof e?e:Mx(+e),l(),o):t},o}function Gx(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function jx(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Rx(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rx(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Rx(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Bx(t,e){var r=function(r){var i,a,o,s,l,c=r.Geometries.centroidsFeatures||[];if(c.length){qx(r);var u,h=null!==(i=null===(a=r.dorlingStrength_)||void 0===a?void 0:a.x)&&void 0!==i?i:1,f=null!==(o=null===(s=r.dorlingStrength_)||void 0===s?void 0:s.y)&&void 0!==o?o:1,d=null!==(l=r.dorlingIterations_)&&void 0!==l?l:1,p=!1!==r.dorlingWorker_,g=r.dorlingWorkerD3URL_||"https://unpkg.com/d3@7/dist/d3.min.js",m=jx(c);try{for(m.s();!(u=m.n()).done;){var v,_=u.value,y=null===(v=r._projection)||void 0===v?void 0:v.call(r,_.geometry.coordinates);y?(_.x=y[0],_.y=y[1]):(_.x=NaN,_.y=NaN)}}catch(t){m.e(t)}finally{m.f()}var x=t.getCentroidsGroup(r).selectAll("g.em-centroid"),b=function(t){t.attr("transform",function(t){return!t||isNaN(t.x)||isNaN(t.y)?null:"translate(".concat(t.x,",").concat(t.y,")")})};if(!1===r.animateDorling_){if(p){console.log("Running Dorling simulation asynchronously in a Web Worker");var w=new Worker(new URL(n.p+n.u(215),n.b),{type:void 0});return w.postMessage({nodes:c.map(function(t){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Gx(Object(n),!0).forEach(function(e){Ji(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Gx(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},t)}),radii:c.map(function(t){return e(t)}),strengthX:h,strengthY:f,iterations:d,d3URL:g}),void(w.onmessage=function(t){var e=t.data,n=e.type,i=e.nodes,a=e.progress,o=e.total;"progress"!==n?"end"===n&&i&&(c.forEach(function(t,e){t.x=i[e].x,t.y=i[e].y}),b(x),Wx(1,r),w.terminate()):Wx(a/o,r)})}for(var M=wx(c).force("x",Sx(function(t){return t.properties.centroid[0]}).strength(h)).force("y",Cx(function(t){return t.properties.centroid[1]}).strength(f)).force("collide",Ix(function(t){return e(t)}).iterations(d)).stop(),S=Math.ceil(Math.log(M.alphaMin())/Math.log(1-M.alphaDecay())),C=0;C<S;C++)M.tick(),C%10==0&&b(x);return b(x),Wx(1,r),M}return r.simulation=wx(c).force("x",Sx(function(t){return t.properties.centroid[0]}).strength(h)).force("y",Cx(function(t){return t.properties.centroid[1]}).strength(f)).force("collide",Ix(function(t){return e(t)}).iterations(d)).on("tick",function(){return b(x)}),r.simulation}};r(t),t.insetTemplates_&&Wi(t.insetTemplates_,t.svgId_,function(t){r(t)})}function Wx(t,e){e.onDorlingProgress_&&e.onDorlingProgress_(t,e)}function qx(t){t.simulation&&(t.simulation.stop(),t.simulation.on("tick",null),t.simulation=null)}function Ux(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Hx(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Vx(t){return t<0?-t*t:t*t}function Yx(t){var e=t(Qe,Qe),n=1;return e.exponent=function(e){return arguments.length?1===(n=+e)?t(Qe,Qe):.5===n?t(Hx,Vx):t(Ux(n),Ux(1/n)):n},Sn(e)}function $x(){var t=Yx(an());return t.copy=function(){return rn(t,$x()).exponent(t.exponent())},Ht.apply(t,arguments),t}function Xx(){return $x.apply(null,arguments).exponent(.5)}function Jx(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(Number).filter(function(t){return Number.isFinite(t)&&t>0}),r=Dt(n),i=Ot(n);(!Number.isFinite(r)||r<=0)&&(r=1),(!Number.isFinite(i)||i<=0)&&(i=r);var a=Math.max(0,e),o=Xx().domain([0,r]).range([0,t]).clamp(!0);function s(t){var e=+t;return!Number.isFinite(e)||e<=0?0:Math.max(a,o(e))}return s.domain=function(){return[i,r]},s.maxSize=function(){return t},s.minSize=function(){return a},s.baseScale=function(){return o},s}function Zx(t){!function(t){var e,n,r,i,a=null!==(e=null!==(n=null===(r=t.statData("size"))||void 0===r?void 0:r.getArray())&&void 0!==n?n:null===(i=t.statData())||void 0===i?void 0:i.getArray())&&void 0!==e?e:[],o="spike"===t.psShape_||"bar"===t.psShape_||"line"===t.psShape_,s=o?function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(Number).filter(function(t){return Number.isFinite(t)&&t>0}),r=Dt(n),i=Ot(n);(!Number.isFinite(r)||r<=0)&&(r=1),(!Number.isFinite(i)||i<=0)&&(i=r);var a=Math.max(0,e),o=Cn().domain([0,r]).range([0,t]).clamp(!0);function s(t){var e=+t;return!Number.isFinite(e)||e<=0?0:Math.max(a,o(e))}return s.domain=function(){return[i,r]},s.maxSize=function(){return t},s.minSize=function(){return a},s.baseScale=function(){return o},s}(a,t.psMaxSize_,t.psMinSize_||0):Jx(a,t.psMaxSize_,t.psMinSize_||0);t.classifierSize(s)}(t),t.statData("color").getArray()&&function(t){var e=function(t){return y(Array(t).keys())};if("quantile"===t.psClassificationMethod_){var n=t.statData("color").getArray(),r=e(t.psClasses_);t.classifierColor(Vt().domain(n).range(r))}else if("equinter"===t.psClassificationMethod_){var i=t.statData("color").getArray(),a=e(t.psClasses_);t.classifierColor(En().domain([min(i),max(i)]).range(a)),t.makeClassifNice_&&t.classifierColor().nice()}else if("threshold"===t.psClassificationMethod_){t.psClasses(t.psThresholds().length+1);var o=e(t.psClasses_);t.classifierColor(kn().domain(t.psThresholds()).range(o))}}(t)}function Kx(t){if(t.svg_&&t.classifierColor_){var e=t.statData("color");t.svg_.selectAll(".em-centroid").attr("ecl",function(n){var r=e.get(n.properties.id);if(!r)return"nd";var i=r.value;return 0!==i&&!i||":"==i?"nd":+t.classifierColor_(+i)})}}function Qx(t,e){var n=me(e||"#ffffff"),r=n?n.formatHex():"#ffffff",i=t.svgId_||"",a=function(t,e){return function(t,e){var n=e;t=t.replace(/^#/,""),3===t.length&&(t=t.split("").map(function(t){return t+t}).join(""));var r=parseInt(t,16),i=r>>16&255,a=r>>8&255,o=255&r;return i=Math.min(255,Math.round(i+(255-i)*n)),a=Math.min(255,Math.round(a+(255-a)*n)),o=Math.min(255,Math.round(o+(255-o)*n)),"#".concat((1<<24|i<<16|a<<8|o).toString(16).slice(1))}(t,e)}(r,t.psBrightenFactor_||.9);Di("#".concat(i,".em--ps .em-nutsrg"),"fill",a)}Nx.copy=function(){var t,e,n=new Fx(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=Lx(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=Lx(e));return n},Nx.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return Ex(this.cover(e,n),e,n,t)},Nx.addAll=function(t){var e,n,r,i,a=t.length,o=new Array(a),s=new Array(a),l=1/0,c=1/0,u=-1/0,h=-1/0;for(n=0;n<a;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(o[n]=r,s[n]=i,r<l&&(l=r),r>u&&(u=r),i<c&&(c=i),i>h&&(h=i));if(l>u||c>h)return this;for(this.cover(l,c).cover(u,h),n=0;n<a;++n)Ex(this,o[n],s[n],t[n]);return this},Nx.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,a=(r=Math.floor(e))+1;else{for(var o,s,l=i-n||1,c=this._root;n>t||t>=i||r>e||e>=a;)switch(s=(e<r)<<1|t<n,(o=new Array(4))[s]=c,c=o,l*=2,s){case 0:i=n+l,a=r+l;break;case 1:n=i-l,a=r+l;break;case 2:i=n+l,r=a-l;break;case 3:n=i-l,r=a-l}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._x1=i,this._y1=a,this},Nx.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},Nx.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},Nx.find=function(t,e,n){var r,i,a,o,s,l,c,u=this._x0,h=this._y0,f=this._x1,d=this._y1,p=[],g=this._root;for(g&&p.push(new kx(g,u,h,f,d)),null==n?n=1/0:(u=t-n,h=e-n,f=t+n,d=e+n,n*=n);l=p.pop();)if(!(!(g=l.node)||(i=l.x0)>f||(a=l.y0)>d||(o=l.x1)<u||(s=l.y1)<h))if(g.length){var m=(i+o)/2,v=(a+s)/2;p.push(new kx(g[3],m,v,o,s),new kx(g[2],i,v,m,s),new kx(g[1],m,a,o,v),new kx(g[0],i,a,m,v)),(c=(e>=v)<<1|t>=m)&&(l=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=l)}else{var _=t-+this._x.call(null,g.data),y=e-+this._y.call(null,g.data),x=_*_+y*y;if(x<n){var b=Math.sqrt(n=x);u=t-b,h=e-b,f=t+b,d=e+b,r=g.data}}return r},Nx.remove=function(t){if(isNaN(a=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,n,r,i,a,o,s,l,c,u,h,f,d=this._root,p=this._x0,g=this._y0,m=this._x1,v=this._y1;if(!d)return this;if(d.length)for(;;){if((c=a>=(s=(p+m)/2))?p=s:m=s,(u=o>=(l=(g+v)/2))?g=l:v=l,e=d,!(d=d[h=u<<1|c]))return this;if(!d.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(n=e,f=h)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[h]=i:delete e[h],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[f]=d:this._root=d),this):(this._root=i,this)},Nx.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},Nx.root=function(){return this._root},Nx.size=function(){var t=0;return this.visit(function(e){if(!e.length)do{++t}while(e=e.next)}),t},Nx.visit=function(t){var e,n,r,i,a,o,s=[],l=this._root;for(l&&s.push(new kx(l,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(l=e.node,r=e.x0,i=e.y0,a=e.x1,o=e.y1)&&l.length){var c=(r+a)/2,u=(i+o)/2;(n=l[3])&&s.push(new kx(n,c,u,a,o)),(n=l[2])&&s.push(new kx(n,r,u,c,o)),(n=l[1])&&s.push(new kx(n,c,i,a,u)),(n=l[0])&&s.push(new kx(n,r,i,c,u))}return this},Nx.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new kx(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var a,o=e.x0,s=e.y0,l=e.x1,c=e.y1,u=(o+l)/2,h=(s+c)/2;(a=i[0])&&n.push(new kx(a,o,s,u,h)),(a=i[1])&&n.push(new kx(a,u,s,l,h)),(a=i[2])&&n.push(new kx(a,o,h,u,c)),(a=i[3])&&n.push(new kx(a,u,h,l,c))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},Nx.x=function(t){return arguments.length?(this._x=t,this):this._x},Nx.y=function(t){return arguments.length?(this._y=t,this):this._y};var tb=function(t,e){var n=t.svg().selectAll(Hi(t)),r=ab(t);n.on("mouseover",function(n,i){var a=r.get(i.properties.id);0!==(null==a?void 0:a.value)&&":"!==(null==a?void 0:a.value)&&"0"!==(null==a?void 0:a.value)||(Nt(this).style("fill",t.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(i,e)),e.onRegionMouseOver_&&e.onRegionMouseOver_(n,i,this,t))}).on("mousemove",function(n,i){var a=r.get(i.properties.id);0!==(null==a?void 0:a.value)&&":"!==(null==a?void 0:a.value)&&"0"!==(null==a?void 0:a.value)||(e._tooltip&&e._tooltip.mousemove(n),e.onRegionMouseMove_&&e.onRegionMouseMove_(n,i,this,t))}).on("mouseout",function(n,i){var a=r.get(i.properties.id);if(0===(null==a?void 0:a.value)||":"===(null==a?void 0:a.value)||"0"===(null==a?void 0:a.value)){var o=Nt(this);o.style("fill",o.attr("fill___")),e._tooltip&&e._tooltip.mouseout(),e.onRegionMouseOut_&&e.onRegionMouseOut_(n,i,this,t)}})},eb=function(t,e){t.svg().selectAll("g.em-centroid").on("mouseover",function(n,r){var i=Nt(this.childNodes[0]);i.attr("fill___",i.style("fill")),i.style("fill",e.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(r,e)),e.onRegionMouseOver_&&e.onRegionMouseOver_(n,r,this,t)}).on("mousemove",function(n,r){e._tooltip&&e._tooltip.mousemove(n),e.onRegionMouseMove_&&e.onRegionMouseMove_(n,r,this,t)}).on("mouseout",function(n,r){var i=Nt(this.childNodes[0]),a=i.attr("fill___");a&&(i.style("fill",a),e._tooltip&&e._tooltip.mouseout()),e.onRegionMouseOut_&&e.onRegionMouseOut_(n,r,this,t)})};function nb(t,e,n){var r=t.svg().selectAll("g.em-centroid").append("path").attr("d",function(t){var r=e.get(t.properties.id),i=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.psSpikeWidth_;return"M".concat(-e/2,",0L0,").concat(-t,"L").concat(e/2,",0")}(r?n.classifierSize_(+r.value):0);return i}).style("fill",function(t){return t.color||"steelblue"}).attr("fill-opacity",t.psFillOpacity_).attr("stroke",t.psStroke_).attr("stroke-width",t.psStrokeWidth_);return r}var rb=function(t){var e=ux(t,!0,"ps");e.psShape_="circle",e.psCustomShape_,e.psCustomSVG_,e.psSpikeWidth_=7,e.psOffset_={x:0,y:0},e.psMaxSize_=30,e.psMinSize_=5,e.psBarWidth_=10,e.psMaxValue_=void 0,e.psMinValue_=void 0,e.psSizeScale_=void 0,e.psFill_="#009569",e.psFillOpacity_=1,e.psStroke_="#ffffff",e.psStrokeWidth_=.2,e.psStrokeOpacity_=1,e.psClasses_=5,e.psColors_=null,e.psColorFun_=vx,e.psClassToFillStyle_=void 0,e.psBrightenFactor_=.9,e.psThresholds_=[0],e.psClassificationMethod_="quantile",e.makeClassifNice_=!0,e.classifierSize_=void 0,e.classifierColor_=void 0,e.tooltip_.textFunction=ob,e.psCodeLabels_=!1;var n=["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 r(t){Qx(t,e.psFill_),e.psClassToFillStyle()||e.psClassToFillStyle(ib(e.psColorFun_,e.psColors_));var n,r,o=ab(t);t.svg_&&(t.svg_.selectAll(":not(#em-insets-group) g.em-centroid > *").remove(),e.updateSymbolsDrawOrder(t),r=e.psCustomSVG_?function(t,e,n){return t.getCentroidsGroup(t).selectAll("g.em-centroid").append("g").filter(function(t){var n=e.get(t.properties.id);if(n&&":"!==n.value)return t}).attr("class","ps").html(n.psCustomSVG_).attr("transform",function(t){var r=e.get(t.properties.id),i=n.classifierSize_(+r.value);if(i)return"translate(".concat(n.psOffset_.x*i,",").concat(n.psOffset_.y*i,") scale(").concat(i,")")})}(t,o,e):"bar"==e.psShape_?function(t,e,n){return t.getCentroidsGroup(t).selectAll("g.em-centroid").append("rect").filter(function(t){var n=e.get(t.properties.id);if(n&&":"!==n.value)return t}).attr("width",n.psBarWidth_).attr("height",function(t){var r=e.get(t.properties.id);return r&&r.value?n.classifierSize_(+r.value):0}).attr("transform",function(){return this.getBoundingClientRect(),"translate(".concat(-this.getAttribute("width")/2)+", -".concat(this.getAttribute("height"),")")})}(t,o,e):"circle"==e.psShape_?function(t,e,n){var r=t.svg().selectAll("g.em-centroid").filter(function(t){var n=e.get(t.properties.id);return n&&":"!==n.value&&n.value}).append("circle").attr("stroke-width",n.psStrokeWidth_).attr("stroke",n.psStroke_).attr("fill-opacity",n.psFillOpacity_).attr("stroke-opacity",n.psStrokeOpacity_).style("pointer-events","none").transition().duration(n.transitionDuration_).attr("r",function(t){var r=e.get(t.properties.id),i=n.classifierSize_(+r.value);return i<0&&console.error("Negative radius for circle:",t.properties.id),isNaN(i)&&console.error("NaN radius for circle:",t.properties.id),i}).on("end",function(){Nt(this).style("pointer-events",null)});return r}(t,o,e):"spike"==e.psShape_?nb(t,o,e):function(t,e,n){return t.svg().selectAll("g.em-centroid").append("path").filter(function(t){var n=e.get(t.properties.id);if(n&&":"!==n.value)return t}).attr("class","ps").attr("d",function(t){if(e){var r=e.get(t.properties.id);if(0==r||r){var i=n.classifierSize_(+r.value)||0;if(n.psCustomShape_)return n.psCustomShape_.size(i*i)();var a=Xy[n.psShape_]||Xy.circle;return Vy().type(a).size(i*i)()}}})}(t,o,e),i(t,o),function(t){t.attr("fill-opacity",e.psFillOpacity()).attr("stroke-opacity",e.psStrokeOpacity()).attr("stroke",e.psStroke()).attr("stroke-width",e.psStrokeWidth()).style("fill",function(){if(e.classifierColor_){var t=Nt(this.parentNode).attr("ecl");return t&&"nd"!==t?e.psClassToFillStyle_(t,e.psClasses_):e.noDataFillStyle_||"gray"}return e.psFill_}).attr("fill___",function(){return Nt(this).style("fill")})}(r),a(t,o),function(t,e){eb(t,e),tb(t,e)}(t,e),null!==(n=e.labels_)&&void 0!==n&&n.values&&e.updateValuesLabels(t),e.patternFill_&&fx(t,e.patternFill_));return t}n.forEach(function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}}),t&&n.forEach(function(n){var r=n.slice(0,-1);null!=t[r]&&e[r](t[r])}),e.psColorFun=function(t){return arguments.length?(e.psColorFun_=t,e.psClassToFillStyle_=ib(e.psColorFun_,e.psColors_),e):e.psColorFun_},e.psThresholds=function(t){return arguments.length?(e.psThresholds_=t,e.psClasses(t.length+1),e):e.psThresholds_},e.updateClassification=function(){try{return Zx(e),e.insetTemplates_&&Wi(e.insetTemplates_,e.svgId_,Kx),Kx(e),e}catch(t){console.error("Error in proportional symbols classification: "+t.message),console.error(t)}};var i=function(t,n){var r=Hi(t),i=t.svg().selectAll(r);if("WORLD"!==t.geo_){if("mixed"==t.nutsLevel_){!function(t,n,r){r.style("display",function(e){if(!this.parentNode.classList.contains("em-cntrg")){var r=n.get(e.properties.id);return!r||!r.value&&0!==r&&0!==r.value&&"0"!==r.value?"none":"WORLD"==t.geo_?"block":void 0}}),r.style("stroke",function(t){var e=Nt(this),r=e.attr("lvl"),i=e.style("stroke"),a=n.get(t.properties.id);if(a&&a.value)return"0"!==r?i||"#777":void 0}).style("stroke-width",function(t){var r=Nt(this),i=r.attr("lvl"),a=r.style("stroke-width"),o=n.get(t.properties.id);if(o&&o.value)return"WORLD"==e.geo_&&"0"!==i?a||"#777":void 0})}(t,n,i);var a=[];t.svg().selectAll("g.em-centroid").each(function(t){var e;null!==(e=t.properties)&&void 0!==e&&e.centroid&&a.push(t)}),t.Geometries.centroidsFeatures=a}i.attr("ecl",function(t){var e=n.get(t.properties.id);return!e||!e.value&&0!==e&&0!==e.value&&"0"!==e.value?"ni":e&&e.value&&":"==e.value?"nd":void 0}),i.style("fill",null),i.filter(function(t){var e=n.get(t.properties.id);return e&&":"===e.value}).style("fill",e.noDataFillStyle()).attr("fill___",e.noDataFillStyle())}},a=function(t,n){var r,i=t.svg().selectAll("g.em-centroid");if(e.psCodeLabels_)i.filter(function(t){var e=n.get(t.properties.id);return":"!==(null==e?void 0:e.value)&&null!=(null==e?void 0:e.value)}).append("text").attr("class","em-circle-code-label").text(function(t){var e=n.get(t.properties.id);return":"===(null==e?void 0:e.value)?"":t.properties.id}).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","sans-serif").style("font-size",function(t){var r,i,a=n.get(t.properties.id),o=a?e.classifierSize_(+a.value):0,s=null!==(r=e.labels_)&&void 0!==r&&r.values&&null!==(i=n.get(t.properties.id))&&void 0!==i&&i.value?.8:.9;return"square"===e.psShape_&&(s-=.4),"".concat(o*s,"px")}).attr("fill",function(){var t,e=null===(t=window.getComputedStyle(this.parentNode.firstChild))||void 0===t?void 0:t.fill;return Ui(e)}).attr("dy",function(t){var r,i;return null!==(r=e.labels_)&&void 0!==r&&r.values&&null!==(i=n.get(t.properties.id))&&void 0!==i&&i.value?"-0.3em":"0"});if(null!==(r=e.labels_)&&void 0!==r&&r.values)i.filter(function(t){var e=n.get(t.properties.id);return":"!==(null==e?void 0:e.value)&&null!=(null==e?void 0:e.value)}).append("text").attr("class","em-circle-stat-label").text(function(t){var e=n.get(t.properties.id);if(null!=e&&e.value)return e.value}).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","sans-serif").style("font-size",function(t){var r=n.get(t.properties.id),i=r?e.classifierSize_(+r.value):0;return"".concat(.4*i,"px")}).attr("fill",function(){var t,n=(null===(t=window.getComputedStyle(this.parentNode.firstChild))||void 0===t?void 0:t.fill)||e.psFill_;return Ui(n)}).attr("dy",function(t){return e.psCodeLabels_?"0.8em":"0"})};return e.updateSymbolsDrawOrder=function(t){var n=e.getCentroidsGroup(t),r=ab(t);t.Geometries.centroidsFeatures&&t.Geometries.centroidsFeatures.length||(t.Geometries.centroidsFeatures=t.svg().selectAll("g.em-centroid").data().filter(function(t){var e;return null==t||null===(e=t.properties)||void 0===e?void 0:e.centroid}));var i=t.Geometries.centroidsFeatures.filter(function(t){var e,n=null===(e=r.get)||void 0===e||null===(e=e.call(r,t.properties.id))||void 0===e?void 0:e.value;return null!=n&&":"!==n}).sort(function(t,e){return r.get(e.properties.id).value-r.get(t.properties.id).value});n.selectAll("g.em-centroid").remove(),n.selectAll("g.em-centroid").data(i,function(t){return t.properties.id}).enter().append("g").attr("class","em-centroid").attr("id",function(t){return"ps"+t.properties.id}).attr("transform",function(t){return"translate(".concat(t.properties.centroid[0].toFixed(3),",").concat(t.properties.centroid[1].toFixed(3),")")}),Kx(t)},e.updateStyle=function(){try{if(r(e),e.insetTemplates_&&Wi(e.insetTemplates_,e.svgId_,r),e.dorling_){var t=ab(e);Bx(e,function(n){var r=t.get(n.properties.id),i=r?e.classifierSize_(+r.value):0;return"square"===e.psShape_?i/2*Math.SQRT2:i})}else qx(e);return e}catch(t){console.error("Error in proportional symbols styling: "+t.message),console.error(t)}},e.getLegendConstructor=function(){return nx},e},ib=function(t,e){return t=t||vx,e?function(t,n){return e[t]}:function(e,n){return t(e/(n-1))}};function ab(t){return t.statData("size").getArray()?t.statData("size"):t.statData()}var ob=function(t,e){var n,r;if(e.tooltip_.omitRegions&&e.tooltip_.omitRegions.includes(t.properties.id))return"";var i=t.properties.na,a=t.properties.id,o=function(t,e,n){return":"===t?n||"Data not available":Ri(t)+(e?" "+e:"")},s=e.statData("size").getArray()?e.statData("size"):e.statData(),l=s.get(t.properties.id),c=(null===(n=s.unitText)||void 0===n?void 0:n.call(s))||"",u="<tr><td>".concat(o(null==l?void 0:l.value,c,e.noDataText_),"</td></tr>"),h="",f=null!==(r=e.statData("color"))&&void 0!==r&&r.getArray()?e.statData("color"):null;if(f){var d,p=f.get(t.properties.id),g=(null===(d=f.unitText)||void 0===d?void 0:d.call(f))||"";h="<tr><td>".concat(o(null==p?void 0:p.value,g,e.noDataText_),"</td></tr>")}return'\n <div class="em-tooltip-bar">\n <b>'.concat(i,"</b>").concat(a?" (".concat(a,")"):"",'\n </div>\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n ').concat(u,"\n ").concat(h,"\n </tbody>\n </table>\n </div>\n ").trim()};const sb=An("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");var lb=function(t,e){var n=ox(t);if(n.order=void 0,e)for(var r in e)n[r]=e[r];function i(t,e){var n=Vi(t),r=t.svg_.selectAll(n).selectAll("[ecl]");r.style("fill","white"),r.filter("[ecl='"+e+"']").each(function(){Nt(this).style("fill",Nt(this).attr("fill___"))})}function a(t){var e=Vi(t);t.svg_.selectAll(e).selectAll("[ecl]").each(function(){Nt(this).style("fill",Nt(this).attr("fill___"))})}return n.update=function(){if(n.updateConfig(),n.updateContainer(),n.lgg.node()&&n.map.classifier_){n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle();var t=n.getBaseY(),e=n.getBaseX();if(n._categoricalContainer=n.lgg.append("g").attr("class","em-legend-categorical").attr("transform","translate(".concat(e,", ").concat(t,")")),function(t){for(var e=t._categoricalContainer,n=t.map,r=n.classToFillStyle()?Object.keys(n.classToFillStyle()):n.classifier_.domain(),o=t.order?t.order:r,s=function(){var r=o[l],s=n.classifier_(r),c=n.classToFillStyle_[r],u=t.titlePadding+l*(t.shapeHeight+t.shapePadding);e.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",u).attr("width",t.shapeWidth).attr("height",t.shapeHeight).style("fill",c).on("mouseover",function(){i(t.map,s),t.map.insetTemplates_&&Wi(t.map.insetTemplates_,t.svgId_,i,s)}).on("mouseout",function(){a(t.map),t.map.insetTemplates_&&Wi(t.map.insetTemplates_,t.svgId_,a,s)}),e.append("text").attr("class","em-legend-label").attr("x",t.shapeWidth+t.labelOffsets.x).attr("y",u+.5*t.shapeHeight).attr("dy","0.35em").text(n.classToText()?n.classToText()[r]:r)},l=0;l<o.length;l++)s()}(n),n.map.patternFill_){var r=n.lgg.node().getBBox().height,o=n.lgg.append("g").attr("class","pattern-fill-legend").attr("transform","translate(".concat(e,", ").concat(r+15,")"));M_(n,o)}if(n.noData){var s=n.lgg.node().getBBox().height+10,l=e,c=n.lgg.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(l,",").concat(s+15,")"));n.appendNoDataLegend(c,n.noDataText,i,a)}n.setBoxDimension()}},n},cb=function(t,e){var n=[];t.properties.id?n.push('<div class="em-tooltip-bar">'+t.properties.na+" ("+t.properties.id+") </div>"):n.push('<div class="em-tooltip-bar">'+t.properties.na+"</div>");var r=e.statData().get(t.properties.id);if(!r||0!=r.value&&!r.value)return n.push(e.noDataText_),n.join("");var i=r.value;if(e.classToText_){var a=e.classToText_[i];return n.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>\n '.concat(a||i,"\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n")),n.join("")}return n.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>\n '.concat(i,"\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n")),n.join("")};Array.prototype.slice;function ub(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function hb(t){this._context=t}function fb(t){return new hb(t)}function db(t){return t[0]}function pb(t){return t[1]}function gb(t,e){var n=cy(!0),r=null,i=fb,a=null,o=my(s);function s(s){var l,c,u,h=(s=ub(s)).length,f=!1;for(null==r&&(a=i(u=o())),l=0;l<=h;++l)!(l<h&&n(c=s[l],l,s))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&a.point(+t(c,l,s),+e(c,l,s));if(u)return a=null,u+""||null}return t="function"==typeof t?t:void 0===t?db:cy(t),e="function"==typeof e?e:void 0===e?pb:cy(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:cy(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:cy(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:cy(!!t),s):n},s.curve=function(t){return arguments.length?(i=t,null!=r&&(a=i(r)),s):i},s.context=function(t){return arguments.length?(null==t?r=a=null:a=i(r=t),s):r},s}hb.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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var mb=function(t,e){var n=ox(t);if(n.squareSize=100,n.rotation=0,n.label1="Variable 1",n.label2="Variable 2",n.axisTitleFontSize=zi("em-bivariate-axis-title"),n.breaks1=void 0,n.breaks2=void 0,n.showBreaks=!1,n.tickLength=5,n.yAxisLabelsOffset={x:0,y:0},n.xAxisLabelsOffset={x:0,y:0},n.yAxisTitleOffset={x:0,y:0},n.xAxisTitleOffset={x:0,y:0},n.boxPadding=n.labelFontSize,n.noDataYOffset=30,n.axisArrows=!0,n.arrowHeight=15,n.arrowWidth=14,n.arrowPadding=10,e)for(var r in e)n[r]=e[r];function i(t,e,n){var r=Vi(t),i=t.svg_.selectAll(r).selectAll("[ecl1],[ecl2]");i.style("fill","white"),i.filter("[ecl1='".concat(e,"']")).filter("[ecl2='".concat(n,"']")).filter(":not([nd])").each(function(){Nt(this).style("fill",Nt(this).attr("fill___"))})}function a(t){var e=Vi(t);t.svg_.selectAll(e).selectAll("[ecl1],[ecl2]").each(function(){Nt(this).style("fill",Nt(this).attr("fill___"))})}return n.update=function(){if(n.updateConfig(),n.updateContainer(),n._horizontalOffset=n.axisTitleFontSize+n.arrowPadding,n.lgg.selectAll("*").remove(),n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle(),n._y=n.boxPadding+(n.title?n.titleFontSize+n.boxPadding:0),function(){for(var t=n.lgg,e=n.map.numberOfClasses(),r=n.squareSize/e,o=0===n.rotation?0:.7071*n.squareSize+n.boxPadding,s=0,l=t.append("g").attr("class","bivariate-squares-chart").attr("transform","translate(".concat(n.boxPadding+n._horizontalOffset,",").concat(o+n._y,") rotate(").concat(n.rotation,") translate(").concat(n.boxPadding,",0)")),c=0;c<e;c++)for(var u=function(){var t=e-c-1,o=e-h-1,u=n.map.classToFillStyle()(t,o);l.append("rect").attr("class","em-bivariate-square").attr("x",s+(e-1-c)*r).attr("y",h*r).attr("width",r).attr("height",r).style("fill",u).on("mouseover",function(){i(n.map,t,o),n.map.insetTemplates_&&Wi(n.map.insetTemplates_,n.map.svgId,i,t,o),Nt(this).raise()}).on("mouseout",function(){a(n.map),n.map.insetTemplates_&&Wi(n.map.insetTemplates_,n.map.svgId,a,t,o)})},h=0;h<e;h++)u();l.append("rect").attr("class","em-bivariate-frame").attr("x",s).attr("y",0).attr("width",n.squareSize).attr("height",n.squareSize).attr("stroke-width",.7)}(),!n.breaks1&&!n.breaks2&&n.showBreaks){var e=t.classifier1_;"function"==typeof e.quantiles?n.breaks1=e.quantiles().map(function(t){return parseFloat(t.toFixed(0))}):e.domain&&(n.breaks1=e.domain().map(function(t){return parseFloat(t.toFixed(0))}));var r=t.classifier2_;"function"==typeof r.quantiles?n.breaks2=r.quantiles().map(function(t){return parseFloat(t.toFixed(0))}):r.domain&&(n.breaks2=r.domain().map(function(t){return parseFloat(t.toFixed(0))}))}var o,s;!function(){var t=0===n.rotation?0:.7071*n.squareSize+n.boxPadding,e=0,r=n.map.numberOfClasses(),i=n.squareSize/r,a=n.lgg.append("g").attr("class","bivariate-break-labels").attr("transform","translate(".concat(n.boxPadding+n._horizontalOffset,",").concat(t+n._y,") rotate(").concat(n.rotation,") translate(").concat(n.boxPadding,",0)"));if(n.breaks1)for(var o=0;o<n.breaks1.length;o++){var s=e+i*(o+1),l=n.squareSize+zi("em-bivariate-tick-label");a.append("text").attr("class","em-bivariate-tick-label").attr("x",s+n.xAxisLabelsOffset.x).attr("y",l+n.xAxisLabelsOffset.y).text(n.breaks1[o]),a.append("line").attr("class","em-bivariate-tick").attr("x1",s).attr("x2",s).attr("y1",n.squareSize).attr("y2",n.squareSize+n.tickLength)}if(n.breaks2)for(var c=0;c<n.breaks2.length;c++){var u=e,h=i*(c+2)-i;a.append("text").attr("class","em-bivariate-tick-label").attr("x",u+n.yAxisLabelsOffset.x).attr("y",h-n.yAxisLabelsOffset.y-(n.tickLength+2)).text(y(n.breaks2).reverse()[c]).attr("text-anchor","middle").attr("transform","rotate(-90, ".concat(u,", ").concat(h,")")),a.append("line").attr("class","em-bivariate-tick").attr("x1",u).attr("x2",u-n.tickLength).attr("y1",h).attr("y2",h)}}(),n._xAxisArrowY=0,n._yAxisArrowX=0,n.axisArrows&&function(){var t=0===n.rotation?0:.7071*n.squareSize+n.boxPadding,e=0,r=n.lgg.append("g").attr("class","bivariate-axis-arrows").attr("transform","translate(".concat(n.boxPadding+n._horizontalOffset,",").concat(t+n._y,") rotate(").concat(n.rotation,") translate(").concat(n.boxPadding,",0)"));n._xAxisArrowY=n.squareSize+n.tickLength+n.arrowPadding,(n.showBreaks||n.breaks1&&n.breaks2)&&(n._xAxisArrowY+=zi("em-bivariate-tick-label")/1.5);r.append("path").attr("class","em-bivariate-axis-arrow").attr("d",gb()([[e,n._xAxisArrowY],[e+n.squareSize,n._xAxisArrowY]])).attr("stroke","black").attr("marker-end","url(#arrowhead)"),n._yAxisArrowX=-n.tickLength-n.arrowPadding,(n.showBreaks||n.breaks1&&n.breaks2)&&(n._yAxisArrowX-=n.labelFontSize/2);r.append("path").attr("class","em-bivariate-axis-arrow").attr("d",gb()([[n._yAxisArrowX,n.squareSize],[n._yAxisArrowX,0]])).attr("stroke","black").attr("marker-end","url(#arrowhead)")}(),function(){var t=0===n.rotation?0:.7071*n.squareSize+n.boxPadding,e=0,r=n.lgg.append("g").attr("class","bivariate-axis-titles").attr("transform","translate(".concat(n.boxPadding+n._horizontalOffset,",").concat(t+n._y,") rotate(").concat(n.rotation,") translate(").concat(n.boxPadding,",0)")),i=n.squareSize+n.xAxisLabelsOffset.y+(n.axisArrows?n.arrowPadding+n.arrowHeight:7),a=e;(n.showBreaks||n.breaks1&&n.breaks2)&&(i+=zi("em-bivariate-tick-label"));n.xAxisTitleOffset&&(i+=n.xAxisTitleOffset.y);n.xAxisTitleOffset&&(a+=n.xAxisTitleOffset.x);r.append("text").attr("class","em-bivariate-axis-title em-bivariate-axis-title-x").attr("x",a).attr("y",i).text(n.label1).attr("dominant-baseline","hanging").attr("alignment-baseline","hanging");var o=(n.axisArrows?n._yAxisArrowX-n.arrowPadding:7)+(-45==n.rotation?-4:-10);(n.showBreaks||n.breaks1&&n.breaks2)&&(i+=zi("em-bivariate-tick-label"));var s=-n.squareSize;n.yAxisTitleOffset&&(o+=n.yAxisTitleOffset.y);n.yAxisTitleOffset&&(s+=n.yAxisTitleOffset.x);r.append("text").attr("class","em-bivariate-axis-title em-bivariate-axis-title-y").attr("x",s).attr("y",o).text(n.label2).style("transform",n.rotation<0?"translate(".concat(n.axisArrows?-51:-15,"px, 95px) rotate(90deg)"):"rotate(-90deg)")}(),n.lgg.append("defs").append("marker").attr("viewBox","0 0 ".concat(n.arrowWidth," ").concat(n.arrowHeight)).attr("id","arrowhead").attr("refX",0).attr("refY",5).attr("markerWidth",n.arrowWidth).attr("markerHeight",n.arrowHeight).attr("orient","auto").append("path").attr("d","M 0 0 L 5 5 L 0 10").attr("marker-units","strokeWidth"),n.noData&&(o=0===n.rotation?n.noDataYOffset+n.squareSize/n.map.numberOfClasses_+n.arrowHeight/2:n.noDataYOffset,s=0===n.rotation?n._y+n.squareSize+o:n._y+1.4142*n.squareSize+2*n.boxPadding+o,n.lgg.append("rect").attr("class","em-bivariate-nodata").attr("x",n.boxPadding+n.noDataShapeWidth/2).attr("y",s+(0==n.rotation?0:-10)).attr("width",n.noDataShapeWidth).attr("height",n.noDataShapeHeight).style("fill",n.map.noDataFillStyle()).on("mouseover",function(){("mixed"==n.map.nutsLevel_?Zi("#em-nutsrg"):Nt("#em-nutsrg")).selectAll("[nd='nd']").style("fill","red")}).on("mouseout",function(){("mixed"==n.map.nutsLevel_?Zi("#em-nutsrg"):Nt("#em-nutsrg")).selectAll("[nd='nd']").style("fill",function(){return Nt(this).attr("fill___")}),Nt(this).style("fill",n.map.noDataFillStyle())}),n.lgg.append("text").attr("class","em-bivariate-nodata-label").attr("x",n.boxPadding+n.noDataShapeWidth+(n.noDataShapeWidth/2+5)).attr("y",s+.5*n.noDataShapeHeight+1+(0==n.rotation?0:-10)).text(n.noDataText)),n.setBoxDimension()},n},vb=function(t,e,n,r,i){for(var a=[],o=Ge(e,n),s=Ge(r,i),l=0;l<t;l++){for(var c=l/(t-1),u=Ge(o(c),s(c)),h=[],f=0;f<t;f++)h.push(u(f/(t-1)));a.push(h)}return function(t,e){return a[t][e]}},_b=function(t,e){var n=[],r=t.properties.na||t.properties.name;t.properties.id?n.push('<div class="em-tooltip-bar" >'+r+" ("+t.properties.id+") </div>"):n.push('<div class="em-tooltip-bar" >'+r+"</div>");var i=e.statData("v1").get(t.properties.id),a=e.statData("v1").unitText(),o=e.statData("v2").get(t.properties.id),s=e.statData("v2").unitText();return n.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(i&&i.value?Ri(i.value):""," ").concat(a&&i&&i.value?a:"","\n ").concat(!i||0!=i.value&&!i.value?e.noDataText_:"","\n </td>\n </tr>\n <tr>\n <td>\n ").concat(o&&o.value?Ri(o.value):""," ").concat(s&&o&&o.value?s:"","\n ").concat(!o||0!=o.value&&!o.value?e.noDataText_:"","\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n ")),n.join("")};class yb{static ternaryMeshCentroids(t){const e=t*t,n=[];for(let r=1;r<=e;r++){const i=Math.floor(Math.sqrt(e-r)),a=i*i,o=((-e+r+i*(i+2)+1)%2-3*a-3*r+3*e+1)/(6*t),s=-((-e+a+r+2*i+1)%2+3*i-3*t+1)/(3*t),l=((-e+a+r+2*i+1)%2+3*a+6*i+3*r-3*e+1)/(6*t);n.push({id:r,p1:o,p2:s,p3:l})}return n}static ternaryMeshVertices(t){const e=Math.sqrt(t.length),n=[];return t.forEach(t=>{const r=e-Math.floor(Math.sqrt(e*e-t.id)),i=t.id-(r-1)*(2*e-r+1),a=2*Math.pow(-1,i%2)/(3*e),o=Math.pow(-1,i%2)/(3*e);n.push({id:t.id,vertex:1,p1:t.p1-a,p2:t.p2+o,p3:t.p3+o}),n.push({id:t.id,vertex:2,p1:t.p1+o,p2:t.p2-a,p3:t.p3+o}),n.push({id:t.id,vertex:3,p1:t.p1+o,p2:t.p2+o,p3:t.p3-a})}),n}static ternaryDistance(t,e){return e.map(e=>{const n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return-(r*i+i*n+n*r)})}static ternaryNearest(t,e){return t.map(t=>{if(!t)return null;const n=this.ternaryDistance(t,e),r=n.indexOf(Math.min(...n));return e[r]})}static ternarySextantVertices(t){const e=[],n=[t[0],1-t[0],0],r=[t[0],0,1-t[0]],i=[0,t[1],1-t[1]],a=[1-t[1],t[1],0],o=[1-t[2],0,t[2]],s=[0,1-t[2],t[2]],l=[[t,o,[1,0,0],a,t],[t,a,n,t],[t,n,[0,1,0],s,t],[t,s,i,t],[t,i,[0,0,1],r,t],[t,r,o,t]];for(let t=1;t<=6;t++){const n=l[t-1];for(let r=0;r<n.length;r++)e.push({id:t,vertex:r+1,p1:n[r][0],p2:n[r][1],p3:n[r][2]})}return e}static ternarySurroundingSextant(t,e){return t.map(t=>{if(!t)return null;const n=[t[0]>e[0],t[1]>e[1],t[2]>e[2]];return!n[0]||n[1]||n[2]?n[0]&&n[1]&&!n[2]?2:n[0]||!n[1]||n[2]?!n[0]&&n[1]&&n[2]?4:n[0]||n[1]||!n[2]?n[0]&&!n[1]&&n[2]?6:null:5:3:1})}static ternaryToCartesian(t){return[.5*(2*t[2]+t[1]),Math.sqrt(3)/2*t[1]]}static cartesianToTernary(t,e){const n=2*e/Math.sqrt(3),r=t-n/2;return[1-n-r,n,r]}static ternaryLimits(t){const e=[1,1,1],n=[0,0,0];return t.forEach(t=>{e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),n[0]=Math.max(n[0],t[0]),n[1]=Math.max(n[1],t[1]),n[2]=Math.max(n[2],t[2])}),{lower:e,upper:n}}}class xb{static geometricMean(t,e=!0){const n=e?t.filter(t=>0!==t):t;return 0===n.length?0:Math.exp(n.reduce((t,e)=>t+Math.log(e),0)/n.length)}static centre(t){const e=this.geometricMean(t.map(t=>t[0])),n=this.geometricMean(t.map(t=>t[1])),r=this.geometricMean(t.map(t=>t[2])),i=e+n+r;return[e/i,n/i,r/i]}static perturbe(t,e=[1/3,1/3,1/3]){return t.map(t=>{if(!t)return null;const n=[t[0]*e[0],t[1]*e[1],t[2]*e[2]],r=n.reduce((t,e)=>t+e,0);return[n[0]/r,n[1]/r,n[2]/r]})}static powerScale(t,e=1){return t.map(t=>{if(!t)return null;const n=[Math.pow(t[0],e),Math.pow(t[1],e),Math.pow(t[2],e)],r=n.reduce((t,e)=>t+e,0);return[n[0]/r,n[1]/r,n[2]/r]})}static close(t){return t.map(t=>{if(!this.isValidTernary(t))return null;const e=t[0]+t[1]+t[2];return[t[0]/e,t[1]/e,t[2]/e]})}static validateTernaryPoints(t){for(let e=0;e<t.length;e++){const n=t[e];if(!n)continue;if(3!==n.length)throw new Error(`Ternary point must have exactly 3 components, got ${n.length}`);if(n.some(t=>t<0))throw new Error(`Ternary point contains negative values: [${n}]`);const r=n[0]+n[1]+n[2];if(Math.abs(r-1)>1e-9)throw new Error(`Ternary point components must sum to 1, got ${r}: [${n}]`)}}static isValidTernary(t){return Array.isArray(t)&&3===t.length&&t.every(t=>"number"==typeof t&&!Number.isNaN(t))}}class bb{static colorMapTricolore(t,e=[1/3,1/3,1/3],n=4,r=80,i=140,a=80,o=.4,s=1){const l=xb.close([...t]);let c=xb.close([...t]);if(Number.isFinite(n)&&n<100){const t=yb.ternaryMeshCentroids(n).map(t=>[t.p1,t.p2,t.p3]);c=yb.ternaryNearest(c,t)}const u=xb.perturbe(c,[1/e[0],1/e[1],1/e[2]]);return xb.powerScale(u,s).map((e,n)=>{if(!e)return{p1:t[n][0],p2:t[n][1],p3:t[n][2],h:null,c:null,l:null,rgb:null};const s=e.map(t=>t*i),c=[r,r+120,r+240].map(t=>t*Math.PI/180),u=c.map((t,e)=>({re:s[e]*Math.cos(t),im:s[e]*Math.sin(t)})),h=u.reduce((t,e)=>({re:t.re+e.re,im:t.im+e.im}),{re:0,im:0}),f=(180*Math.atan2(h.im,h.re)/Math.PI+360)%360,d=Math.sqrt(h.re*h.re+h.im*h.im),p=d*o/i+1-o,g=p*a,m=p*d,v=this.hclToHex(f,m,g);return{p1:l[n][0],p2:l[n][1],p3:l[n][2],h:f,c:m,l:g,rgb:v}})}static colorMapSextant(t,e=[1/3,1/3,1/3],n=["#FFFF00","#B3DCC3","#01A0C6","#B8B3D8","#F11D8C","#FFB3B3"]){if(6!==n.length)throw new Error("Sextant values array must have exactly 6 elements");const r=xb.close([...t]),i=yb.ternarySurroundingSextant(r,e);return r.map((e,r)=>{if(!e)return{p1:t[r][0],p2:t[r][1],p3:t[r][2],sextant:null,rgb:null};const a=i[r],o=null!==a?n[a-1]:null;return{p1:e[0],p2:e[1],p3:e[2],sextant:a,rgb:o}})}static hclToHex(t,e,n){(t%=360)<0&&(t+=360),e=Math.max(0,Math.min(e,230)),n=Math.max(0,Math.min(n,100));const r=t*Math.PI/180,i=(n+16)/116,a=Math.cos(r)*e/500+i,o=i-Math.sin(r)*e/200,s=.95047*(a>.206893034?a**3:(a-16/116)/7.787),l=1*(i>.206893034?i**3:(i-16/116)/7.787),c=1.08883*(o>.206893034?o**3:(o-16/116)/7.787);let u=3.2406*s-1.5372*l-.4986*c,h=-.9689*s+1.8758*l+.0415*c,f=.0557*s-.204*l+1.057*c;const d=t=>t>.0031308?1.055*t**(1/2.4)-.055:12.92*t;u=d(u),h=d(h),f=d(f);const p=t=>Math.round(255*(t=>Math.max(0,Math.min(1,t)))(t)),g=t=>{const e=p(t).toString(16);return 1===e.length?"0"+e:e};return`#${g(u)}${g(h)}${g(f)}`}}function wb(t){return t}function Mb(t,...e){return Sb(t,wb,wb,e)}function Sb(t,e,n,r){return function t(i,a){if(a>=r.length)return n(i);const o=new E_,s=r[a++];let l=-1;for(const t of i){const e=s(t,++l,i),n=o.get(e);n?n.push(t):o.set(e,[t])}for(const[e,n]of o)o.set(e,t(n,a));return e(o)}(t,0)}class Cb{constructor(t,e=650,n=520,r={top:20,right:60,bottom:50,left:60}){this.canvas=null,this.ctx=null,this.container=Nt(t),this.width=e,this.height=n,this.margin=r,this.svg=this.container.append("svg").attr("width",e).attr("height",n),this.triangle=this.svg.append("g").attr("transform",`translate(${r.left},${r.top})`).attr("class","em-tricolore-triangle"),this.legend=this.svg.append("g").attr("transform",`translate(${r.left},${r.top})`).attr("class","em-tricolore-legend-labels"),this.circles=this.svg.append("g").attr("transform",`translate(${r.left},${r.top})`).attr("class","em-tricolore-data-points")}createContinuousPlot(t=[],e={}){var n,r;const{center:i=[1/3,1/3,1/3],hue:a=80,chroma:o=140,lightness:s=80,contrast:l=.4,spread:c=1,showData:u=!0,showCenter:h=!0,showLines:f=!0,labels:d=["p₁","p₂","p₃"],labelPosition:p="corner",colorTarget:g="triangles"}=e,m=this.width-this.margin.left-this.margin.right,v=this.height-this.margin.top-this.margin.bottom,_=Math.min(m,v);if(this.canvas&&Nt(this.canvas).remove(),this.triangle.selectAll("*").remove(),this.legend.selectAll("*").remove(),this.circles.selectAll("*").remove(),this.canvas=document.createElement("canvas"),this.canvas.width=_,this.canvas.height=_,this.ctx=this.canvas.getContext("2d"),this.ctx){if(this.drawContinuousTriangle(_,i,a,o,s,l,c),this.triangle.append("image").attr("x",0).attr("y",0).attr("width",_).attr("height",_).attr("href",this.canvas.toDataURL()),this.drawTriangleFrame(_,d,i,h,f,p,g),u&&t.length>0){const r=null!==(n=e.colorTarget)&&void 0!==n?n:"triangles";this.addDataPoints(t,_,e.dataPointHandlers,h,i,void 0,r)}h&&this.addCenterAnnotation(_,i,null!==(r=e.centerLabel)&&void 0!==r?r:"Average value",e.centerAnnotationOffsets)}}createDiscretePlot(t=[],e={}){var n;const{center:r=[1/3,1/3,1/3],breaks:i=4,hue:a=80,chroma:o=140,lightness:s=80,contrast:l=.4,spread:c=1,showData:u=!0,showCenter:h=!0,showLines:f=!0,labels:d=["p₁","p₂","p₃"],labelPosition:p="corner",colorTarget:g="triangles"}=e,m=this.width-this.margin.left-this.margin.right,v=this.height-this.margin.top-this.margin.bottom,_=Math.min(m,v);this.triangle.selectAll("*").remove(),this.legend.selectAll("*").remove(),this.circles.selectAll("*").remove();const y=yb.ternaryMeshCentroids(i),x=yb.ternaryMeshVertices(y),b=y.map(t=>[t.p1,t.p2,t.p3]),w=bb.colorMapTricolore(b,r,i,a,o,s,l,c);if(Mb(x,t=>t.id).forEach((t,n)=>{const r=t.map(t=>{const[e,n]=this.ternaryToSvgCoords([t.p1,t.p2,t.p3],_);return`${e},${n}`}).join(" "),i=w[Number(n)-1].rgb,a=Number(n)-1,o=this.triangle.append("polygon").attr("points",r).attr("stroke","none").attr("classIndex",a).attr("class","em-ternary-discrete-polygon");"triangles"===g?o.attr("fill",i):o.attr("fill","#fffefe");const s=e.triangleHandlers;(null==s?void 0:s.mouseover)&&o.on("mouseover",t=>s.mouseover(t,i)),(null==s?void 0:s.mouseout)&&o.on("mouseout",t=>s.mouseout(t))}),this.drawTriangleFrame(_,d,r,h,f,p,g,i),u&&t.length>0){const n="points"===g?bb.colorMapTricolore(t,r,i,a,o,s,l,c):void 0;this.addDataPoints(t,_,e.dataPointHandlers,h,r,"points"===g?n:void 0,g)}h&&this.addCenterAnnotation(_,r,null!==(n=e.centerLabel)&&void 0!==n?n:"Average value",e.centerAnnotationOffsets)}createSextantPlot(t=[],e={}){var n,r;const{center:i=[1/3,1/3,1/3],values:a=["#FFFF00","#B3DCC3","#01A0C6","#B8B3D8","#F11D8C","#FFB3B3"],showData:o=!0,showCenter:s=!0,showLines:l=!0,labels:c=["p₁","p₂","p₃"],labelPosition:u="corner",colorTarget:h="triangles"}=e;if(6!==a.length)throw new Error("Sextant plot requires exactly 6 color values");const f=this.width-this.margin.left-this.margin.right,d=this.height-this.margin.top-this.margin.bottom,p=Math.min(f,d);this.triangle.selectAll("*").remove(),this.legend.selectAll("*").remove(),this.circles.selectAll("*").remove();if(Mb(yb.ternarySextantVertices(i),t=>t.id).forEach((t,n)=>{t.sort((t,e)=>t.vertex-e.vertex);const r=t.map(t=>{const[e,n]=this.ternaryToSvgCoords([t.p1,t.p2,t.p3],p);return`${e},${n}`}).join(" "),i=Number(n)-1,o=Number(n)-1,s=this.triangle.append("polygon").attr("points",r).attr("fill",a[i]).attr("stroke","none").attr("data-ecl",o),l=e.triangleHandlers;(null==l?void 0:l.mouseover)&&s.on("mouseover",t=>l.mouseover(t,a[i])),(null==l?void 0:l.mouseout)&&s.on("mouseout",t=>l.mouseout(t))}),this.drawTriangleFrame(p,c,i,s,l,u,h),o&&t.length>0){const r=null!==(n=e.colorTarget)&&void 0!==n?n:"triangles";this.addDataPoints(t,p,e.dataPointHandlers,s,i,void 0,r)}s&&this.addCenterAnnotation(p,i,null!==(r=e.centerLabel)&&void 0!==r?r:"Average value",e.centerAnnotationOffsets)}drawContinuousTriangle(t,e,n,r,i,a,o){if(!this.ctx)return;const s=t,l=this.ctx.createImageData(s,s);for(let t=0;t<s;t++)for(let c=0;c<s;c++){const[u,h,f]=this.svgToTernaryCoords([c,t],s);if(u<0||h<0||f<0||u>1||h>1||f>1)continue;const d=bb.colorMapTricolore([[u,h,f]],e,100,n,r,i,a,o)[0],p=parseInt(d.rgb.slice(1,3),16),g=parseInt(d.rgb.slice(3,5),16),m=parseInt(d.rgb.slice(5,7),16),v=4*(t*s+c);l.data[v]=p,l.data[v+1]=g,l.data[v+2]=m,l.data[v+3]=255}this.ctx.putImageData(l,0,0)}drawTriangleFrame(t,e,n,r,i,a="corner",o="triangles",s=4){const l=[[1,0,0],[0,1,0],[0,0,1]].map(e=>this.ternaryToSvgCoords(e,t)),c=l.map(t=>t.join(",")).join(" ");if(this.triangle.append("polygon").attr("points",c).attr("fill","none").attr("stroke","black").attr("stroke-width",1),"edge"===a){const t=[[(l[0][0]+l[1][0])/2-35,(l[0][1]+l[1][1])/2-14],[(l[1][0]+l[2][0])/2+35,(l[1][1]+l[2][1])/2-14],[(l[0][0]+l[2][0])/2,(l[0][1]+l[2][1])/2+35]],n=[-60,60,0];e.forEach((e,r)=>{this.legend.append("text").attr("x",t[r][0]).attr("y",t[r][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(${n[r]},${t[r][0]},${t[r][1]})`).text(e)})}else{const t=[[l[0][0],l[0][1]+25],[l[1][0],l[1][1]-15],[l[2][0],l[2][1]+25]];e.forEach((e,n)=>{this.legend.append("text").attr("class","em-ternary-axis-title em-legend-label em-ternary-legend-label").attr("x",t[n][0]).attr("y",t[n][1]).attr("text-anchor","middle").text(e)})}const u="number"==typeof s&&s>1?Array.from({length:s-1},(t,e)=>(e+1)/s):[],h=[];for(let t=0;t<u.length;t++){const e=0===t?0:u[t-1],n=(u[t]-e)/5;for(let t=1;t<5;t++)h.push(e+t*n)}const f=(e,n,r)=>{const[i,a]=this.ternaryToSvgCoords(e,t),[o,s]=this.ternaryToSvgCoords(n,t);this.legend.append("line").attr("x1",i).attr("y1",a).attr("x2",o).attr("y2",s).attr("stroke","#555").attr("stroke-width",r?1:.2).attr("opacity",r?.4:.25).attr("class",r?"em-ternary-grid-line":"em-ternary-grid-line-minor")};i&&(h.forEach(t=>{f([t,0,1-t],[t,1-t,0],!1),f([0,t,1-t],[1-t,t,0],!1),f([1-t,0,t],[0,1-t,t],!1)}),u.forEach(e=>{const n=[e,0,1-e];f(n,[e,1-e,0],!0),this.drawAxisTick(n,[0,-1,1],t);const r=[1-e,e,0];f([0,e,1-e],r,!0),this.drawAxisTick(r,[1,0,-1],t);const i=[0,1-e,e];f([1-e,0,e],i,!0),this.drawAxisTick(i,[-1,1,0],t)}));const d=this.computeLabelStride(u.length+1),p=u.filter((t,e)=>e%d===0);p.forEach(e=>{const n=[this.ternaryToSvgCoords([e,1-e,0],t),this.ternaryToSvgCoords([e,0,1-e],t)];this.legend.append("text").attr("x",n[0][0]-10).attr("y",n[0][1]+3).attr("text-anchor","end").attr("font-size","10px").attr("class","em-ternary-axis-tick-label").text(`${(100*e).toFixed(0)}%`)}),p.forEach(e=>{const n=[this.ternaryToSvgCoords([0,e,1-e],t),this.ternaryToSvgCoords([1-e,e,0],t)];this.legend.append("text").attr("x",n[0][0]+5).attr("y",n[0][1]-10).attr("text-anchor","start").attr("font-size","10px").attr("class","em-ternary-axis-tick-label").text(`${(100*e).toFixed(0)}%`)}),p.forEach(e=>{const n=[this.ternaryToSvgCoords([1-e,0,e],t),this.ternaryToSvgCoords([0,1-e,e],t)];this.legend.append("text").attr("x",n[0][0]+10).attr("y",n[0][1]+18).attr("text-anchor","middle").attr("font-size","10px").attr("class","em-ternary-axis-tick-label").text(`${(100*e).toFixed(0)}%`)})}computeLabelStride(t){return t<=7?1:t<=10?2:t<=15?3:Math.ceil(t/4)}drawAxisTick(t,e,n,r=8){const[i,a]=this.ternaryToSvgCoords(t,n),o=[t[0]+e[0]*(r/n),t[1]+e[1]*(r/n),t[2]+e[2]*(r/n)],[s,l]=this.ternaryToSvgCoords(o,n);this.legend.append("line").attr("x1",i).attr("y1",a).attr("x2",s).attr("y2",l).attr("stroke-width",1).attr("opacity",.4).attr("class","em-ternary-axis-tick")}addDataPoints(t,e,n,r,i,a,o="triangles"){const s=xb.close([...t]);if(xb.validateTernaryPoints(s),s.forEach((t,r)=>{if(t){const[i,s]=this.ternaryToSvgCoords(t,e),l="points"===o&&a&&a[r]&&a[r].rgb?a[r].rgb:"black",c=this.circles.append("circle").datum({point:t,index:r}).attr("cx",i).attr("cy",s).attr("r",2).attr("fill",l).attr("opacity","points"===o?1:.7).attr("class","em-ternary-legend-data-point");(null==n?void 0:n.mouseover)&&c.on("mouseover",t=>n.mouseover(t,c.datum())),(null==n?void 0:n.mousemove)&&c.on("mousemove",t=>n.mousemove(t,c.datum())),(null==n?void 0:n.mouseout)&&c.on("mouseout",t=>n.mouseout(t,c.datum()))}}),r){const t=this.ternaryToSvgCoords(i,e),[n,r]=t;[[[i[0],0,1-i[0]],i],[[1-i[1],i[1],0],i],[[0,1-i[2],i[2]],i]].forEach(([t,n],r)=>{const[a,s]=this.ternaryToSvgCoords(t,e),[l,c]=this.ternaryToSvgCoords(n,e);this.circles.append("line").attr("x1",a).attr("y1",s).attr("x2",l).attr("y2",c).attr("stroke","triangles"===o?"white":"#000").attr("stroke-width",1).attr("opacity","triangles"===o?.9:1).attr("class","em-ternary-center-line");const u=Math.round(100*i[r]),h=a,f=s,d=Math.atan2(c-s,l-a)*(180/Math.PI);let p=d;const g=0===r?25:15;let m=g*Math.cos(d*Math.PI/180),v=g*Math.sin(d*Math.PI/180);1===r&&(m+=-5,v+=8),0===r&&(p=d+180,m+=14,v+=10),2===r&&(p=d+180,m+=5,v+=10),this.circles.append("text").attr("x",h+m).attr("y",f+v).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("fill","triangles"===o?"white":"#000").attr("transform",`rotate(${p}, ${h+m}, ${f+v})`).attr("class","em-ternary-center-line-label").text(`${u}%`)}),this.circles.append("circle").attr("cx",n).attr("cy",r).attr("r",3).attr("fill","black").attr("stroke","white").attr("class","em-ternary-center-point")}}addCenterAnnotation(t,e,n="Average value",r={labelX:70,labelY:20,curveX:10,curveY:0}){const[i,a]=this.ternaryToSvgCoords(e,t),o=i+r.labelX,s=35+r.labelY,l=`\n M ${i},${a}\n Q ${i+r.curveX},${a-r.curveY} ${o},${s}\n `,c=this.circles.append("g").attr("class","em-ternary-center-annotation");c.append("path").attr("d",l).attr("fill","none").attr("class","em-ternary-annotation-line"),c.append("text").attr("x",o).attr("y",s-6).attr("class","em-ternary-center-annotation-label").text(n)}ternaryToSvgCoords(t,e){const[n,r]=yb.ternaryToCartesian(t);return[n*e,e-r*e]}svgToTernaryCoords(t,e){return yb.cartesianToTernary(t[0]/e,1-t[1]/e)}}var Eb=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=ox(t);return n.width=160,n.height=160,n.padding={top:50,right:50,bottom:10,left:50},n.type="continuous",n.showCenter=!0,n.centerLabel="Average",n.showLines=!1,n.labels=["Variable 1","Variable 2","Variable 3"],n.labelPosition="edge",n.colorTarget="points",n.showData=!0,n.centerAnnotationOffsets={labelX:70,labelY:10,curveX:-20,curveY:-20},Object.assign(n,e),n.update=function(){return n.updateConfig(),n.updateContainer(),n.lgg.node()?(n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle(),function(){var e=n.getBaseY(),r=n.getBaseX(),i=n.lgg.append("g").attr("class","em-ternary-legend").attr("transform","translate(".concat(r,",").concat(e,")"));i.selectAll("*").remove();var a=i.append("foreignObject").attr("x",0).attr("y",0).attr("width",n.width).attr("height",n.height).append("xhtml:div").style("width","".concat(n.width,"px")).style("height","".concat(n.height,"px")),o=new Cb(a.node(),n.width,n.height,n.padding),s={center:t._ternaryCenter_,hue:t.ternarySettings_.hue,chroma:t.ternarySettings_.chroma,lightness:t.ternarySettings_.lightness,contrast:t.ternarySettings_.contrast,spread:t.ternarySettings_.spread,labels:n.labels,labelPosition:n.labelPosition,showCenter:n.showCenter,centerLabel:n.centerLabel,showLines:n.showLines,breaks:t.ternarySettings_.breaks,colorTarget:n.colorTarget,showData:n.showData,centerAnnotationOffsets:n.centerAnnotationOffsets,dataPointHandlers:{mouseover:function(e,n){var r=Nt(e.currentTarget);r.attr("fill___")||r.attr("fill___",r.attr("fill")),r.attr("opacity___")||r.attr("opacity___",r.attr("opacity")),r.attr("fill","red").attr("opacity",1).raise(),Pb(t,n.index),t.insetTemplates_&&Wi(t.insetTemplates_,t.svgId,Pb,n.index);var i,a=function(t,e){var n,r,i=t._ternaryIdByClass_?t._ternaryIdByClass_.get(e):null===(n=y(t._ternaryClassById_.entries()).find(function(t){return _(t,2)[1]===e}))||void 0===n?void 0:n[0];if(!i)return null;var a=null===(r=t.Geometries.getRegionFeatures())||void 0===r?void 0:r.find(function(t){return t.properties.id===i});return a||null}(t,n.index);a&&(null===(i=t._tooltip)||void 0===i||i.mouseover(t.tooltip_.textFunction(a,t)))},mousemove:function(e){var n;null===(n=t._tooltip)||void 0===n||n.mousemove(e)},mouseout:function(e,n){var r,i=Nt(e.currentTarget);i.attr("fill",i.attr("fill___")).attr("opacity",i.attr("opacity___")).lower(),Fb(t),t.insetTemplates_&&Wi(t.insetTemplates_,t.svgId,Fb),null===(r=t._tooltip)||void 0===r||r.mouseout()}},triangleHandlers:{mouseover:function(e,n){Nt(e.currentTarget).attr("stroke-width",2).attr("stroke","red").raise(),kb(t,n),t.insetTemplates_&&Wi(t.insetTemplates_,t.svgId,kb,n)},mouseout:function(e){Nt(e.currentTarget).attr("stroke","none").lower(),Tb(t),t.insetTemplates_&&Wi(t.insetTemplates_,t.svgId,Tb)}}};t.ternarySettings_.breaks<30?o.createDiscretePlot(t._ternaryData_,s):o.createContinuousPlot(t._ternaryData_,s)}(),n.setBoxDimension(),n):n},n};function kb(t,e){var n=Vi(t),r=t.svg_.selectAll(n).selectAll("[ecl]"),i=Ab(e);r.each(function(){var t=Nt(this);Ab(t.attr("fill___"))===i?t.style("fill",t.attr("fill___")):t.style("fill","#fff")})}function Ab(t){if(!t)return null;var e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,e.fillStyle.toLowerCase()}function Tb(t){var e=Vi(t);t.svg_.selectAll(e).selectAll("[ecl]").each(function(){Nt(this).style("fill",Nt(this).attr("fill___"))})}function Pb(t,e){var n=Vi(t);t.svg_.selectAll(n).selectAll("[ecl]").each(function(){var t=Nt(this);+t.attr("ecl")===e?t.style("fill",t.attr("fill___")):t.style("fill","#fff")})}function Fb(t){var e=Vi(t);t.svg_.selectAll(e).selectAll("[ecl]").each(function(){var t=Nt(this);t.style("fill",t.attr("fill___"))})}function Lb(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Nb(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Lb(Object(n),!0).forEach(function(e){Ji(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Lb(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var Ob=function(t){var e=ux(t,!1,"chtri");e.ternaryCodes_=["v1","v2","v3"],e.noDataFillStyle_="#ccc",e.ternarySettings_={hue:10,chroma:120,lightness:70,contrast:.2,spread:.8,breaks:5,meanCentering:!0},e._ternaryColors_=null,e._ternaryData_=null,e._ternaryCenter_=null,e.tooltip_.textFunction=Db;var n=["ternaryCodes_","noDataFillStyle_","ternarySettings_"];function r(t){var n=t.properties.id,r=e._ternaryColorById_.get(n),i=e._ternaryClassById_.get(n);return Nt(this).attr("ecl",null!=i?i:null),null!=r?r:Ob.noDataFillStyle_}function i(t){if(t.svg()&&t._ternaryColorById_){var n=Hi(t),i=t.svg().selectAll(n);i.style("pointer-events","none").transition().duration(e.transitionDuration()).style("fill",r).end().then(function(){i.style("pointer-events",null),i.each(function(){var t=Nt(this);t.attr("fill___",t.style("fill"))}),a(t,i),e.gridCartogram_&&t.svg().selectAll(".em-grid-text").each(function(){var t=Nt(this.parentNode).style("fill");Nt(this).attr("fill",getTextColorForBackground(t))})}).catch(function(t){})}}function a(t,n){var r=function(e){var n;return null===(n=t.tooltip_.omitRegions)||void 0===n?void 0:n.includes(e)};n.on("mouseover",function(n,i){r(i.properties.id)||(Nt(this).style("fill",t.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(i,e)),e.onRegionMouseOver_&&e.onRegionMouseOver_(n,i,this,t))}).on("mousemove",function(n,i){r(i.properties.id)||(e._tooltip&&e._tooltip.mousemove(n),e.onRegionMouseMove_&&e.onRegionMouseMove_(n,i,this,t))}).on("mouseout",function(n,i){if(!r(i.properties.id)){var a=Nt(this);a.style("fill",a.attr("fill___")),e._tooltip&&e._tooltip.mouseout(),e.onRegionMouseOut_&&e.onRegionMouseOut_(n,i,this,t)}})}return n.forEach(function(t){var n=t.slice(0,-1);e[n]=function(n){return arguments.length?("ternarySettings_"===t?e.ternarySettings_=Nb(Nb({},e.ternarySettings_),n):e[t]=n,e):e[t]}}),t&&n.forEach(function(n){var r=n.slice(0,-1);null!=t[r]&&e[r](t[r])}),e.updateClassification=function(){e._ternaryData_=[],e._ternaryColorById_=new Map,e._ternaryCenter_=null;var t=e.Geometries.getRegionFeatures();if(!t||0===t.length)return e;var n=_(e.ternaryCodes_,3),r=n[0],i=n[1],a=n[2],o=[],s=e.statData(r),l=e.statData(i),c=e.statData(a);t.forEach(function(t){var e=t.properties.id,n=s.get(e),r=l.get(e),i=c.get(e),a=+(null==n?void 0:n.value),u=+(null==r?void 0:r.value),h=+(null==i?void 0:i.value);Number.isFinite(a)&&Number.isFinite(u)&&Number.isFinite(h)&&a+u+h>0&&o.push({id:e,values:[a,u,h]})}),e._ternaryData_=o.map(function(t){return t.values}),e._ternaryCenter_=e.ternarySettings_.meanCentering?xb.centre(e._ternaryData_):[1/3,1/3,1/3];var u=function(t,e={}){const{center:n=[1/3,1/3,1/3],breaks:r=4,hue:i=80,chroma:a=140,lightness:o=80,contrast:s=.4,spread:l=1}=e;return bb.colorMapTricolore(t,n,r,i,a,o,s,l).map(t=>t.rgb)}(e._ternaryData_,{center:e._ternaryCenter_,breaks:e.ternarySettings_.breaks,hue:e.ternarySettings_.hue,chroma:e.ternarySettings_.chroma,lightness:e.ternarySettings_.lightness,contrast:e.ternarySettings_.contrast,spread:e.ternarySettings_.spread});return e._ternaryColorById_=new Map,e._ternaryClassById_=new Map,o.forEach(function(t,n){var r=u[n];null!=r&&(e._ternaryColorById_.set(t.id,r),e._ternaryClassById_.set(t.id,n))}),e},e.updateStyle=function(){return e.insetTemplates_&&Wi(e.insetTemplates_,e.svgId_,i),i(e),a(e,e.svg().selectAll(Hi(e))),e},e.getLegendConstructor=function(){return Eb},e},Db=function(t,e){var n=[],r=t.properties.na||"",i=t.properties.id||"";n.push('<div class="em-tooltip-bar">'.concat(r).concat(i?" (".concat(i,")"):"","</div>"));var a=_(e.ternaryCodes_,3),o=a[0],s=a[1],l=a[2],c=e.statData(o).get(i),u=e.statData(s).get(i),h=e.statData(l).get(i),f=e.statData(o).unitText()||e.statData(s).unit_||e.statData(l).unit_||"";return n.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(e.statData(o).label_||o,": ").concat(null!=c&&c.value?Ri(c.value)+f:"","</td></tr>\n <tr><td>").concat(e.statData(s).label_||s,": ").concat(null!=u&&u.value?Ri(u.value)+f:"","</td></tr>\n <tr><td>").concat(e.statData(l).label_||l,": ").concat(null!=h&&h.value?Ri(h.value)+f:"","</td></tr>\n </tbody></table></div>")),n.join("")};function zb(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function Ib(t){return t}function Gb(){var t=Ib,e=zb,n=null,r=cy(0),i=cy(ky),a=cy(0);function o(o){var s,l,c,u,h,f=(o=ub(o)).length,d=0,p=new Array(f),g=new Array(f),m=+r.apply(this,arguments),v=Math.min(ky,Math.max(-ky,i.apply(this,arguments)-m)),_=Math.min(Math.abs(v)/f,a.apply(this,arguments)),y=_*(v<0?-1:1);for(s=0;s<f;++s)(h=g[p[s]=s]=+t(o[s],s,o))>0&&(d+=h);for(null!=e?p.sort(function(t,n){return e(g[t],g[n])}):null!=n&&p.sort(function(t,e){return n(o[t],o[e])}),s=0,c=d?(v-f*y)/d:0;s<f;++s,m=u)l=p[s],u=m+((h=g[l])>0?h*c:0)+y,g[l]={data:o[l],index:s,value:h,startAngle:m,endAngle:u,padAngle:_};return g}return o.value=function(e){return arguments.length?(t="function"==typeof e?e:cy(+e),o):t},o.sortValues=function(t){return arguments.length?(e=t,n=null,o):e},o.sort=function(t){return arguments.length?(n=t,e=null,o):n},o.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:cy(+t),o):r},o.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:cy(+t),o):i},o.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:cy(+t),o):a},o}function jb(t){return t.innerRadius}function Rb(t){return t.outerRadius}function Bb(t){return t.startAngle}function Wb(t){return t.endAngle}function qb(t){return t&&t.padAngle}function Ub(t,e,n,r,i,a,o){var s=t-n,l=e-r,c=(o?a:-a)/My(s*s+l*l),u=c*l,h=-c*s,f=t+u,d=e+h,p=n+u,g=r+h,m=(f+p)/2,v=(d+g)/2,_=p-f,y=g-d,x=_*_+y*y,b=i-a,w=f*g-p*d,M=(y<0?-1:1)*My(xy(0,b*b*x-w*w)),S=(w*y-_*M)/x,C=(-w*_-y*M)/x,E=(w*y+_*M)/x,k=(-w*_+y*M)/x,A=S-m,T=C-v,P=E-m,F=k-v;return A*A+T*T>P*P+F*F&&(S=E,C=k),{cx:S,cy:C,x01:-u,y01:-h,x11:S*(i/b-1),y11:C*(i/b-1)}}function Hb(){var t=jb,e=Rb,n=cy(0),r=null,i=Bb,a=Wb,o=qb,s=null,l=my(c);function c(){var c,u,h=+t.apply(this,arguments),f=+e.apply(this,arguments),d=i.apply(this,arguments)-Ey,p=a.apply(this,arguments)-Ey,g=vy(p-d),m=p>d;if(s||(s=c=l()),f<h&&(u=f,f=h,h=u),f>Sy)if(g>ky-Sy)s.moveTo(f*yy(d),f*wy(d)),s.arc(0,0,f,d,p,!m),h>Sy&&(s.moveTo(h*yy(p),h*wy(p)),s.arc(0,0,h,p,d,m));else{var v,_,y=d,x=p,b=d,w=p,M=g,S=g,C=o.apply(this,arguments)/2,E=C>Sy&&(r?+r.apply(this,arguments):My(h*h+f*f)),k=by(vy(f-h)/2,+n.apply(this,arguments)),A=k,T=k;if(E>Sy){var P=Ay(E/h*wy(C)),F=Ay(E/f*wy(C));(M-=2*P)>Sy?(b+=P*=m?1:-1,w-=P):(M=0,b=w=(d+p)/2),(S-=2*F)>Sy?(y+=F*=m?1:-1,x-=F):(S=0,y=x=(d+p)/2)}var L=f*yy(y),N=f*wy(y),O=h*yy(w),D=h*wy(w);if(k>Sy){var z,I=f*yy(x),G=f*wy(x),j=h*yy(b),R=h*wy(b);if(g<Cy)if(z=function(t,e,n,r,i,a,o,s){var l=n-t,c=r-e,u=o-i,h=s-a,f=h*l-u*c;if(!(f*f<Sy))return[t+(f=(u*(e-a)-h*(t-i))/f)*l,e+f*c]}(L,N,j,R,I,G,O,D)){var B=L-z[0],W=N-z[1],q=I-z[0],U=G-z[1],H=1/wy(function(t){return t>1?0:t<-1?Cy:Math.acos(t)}((B*q+W*U)/(My(B*B+W*W)*My(q*q+U*U)))/2),V=My(z[0]*z[0]+z[1]*z[1]);A=by(k,(h-V)/(H-1)),T=by(k,(f-V)/(H+1))}else A=T=0}S>Sy?T>Sy?(v=Ub(j,R,L,N,f,T,m),_=Ub(I,G,O,D,f,T,m),s.moveTo(v.cx+v.x01,v.cy+v.y01),T<k?s.arc(v.cx,v.cy,T,_y(v.y01,v.x01),_y(_.y01,_.x01),!m):(s.arc(v.cx,v.cy,T,_y(v.y01,v.x01),_y(v.y11,v.x11),!m),s.arc(0,0,f,_y(v.cy+v.y11,v.cx+v.x11),_y(_.cy+_.y11,_.cx+_.x11),!m),s.arc(_.cx,_.cy,T,_y(_.y11,_.x11),_y(_.y01,_.x01),!m))):(s.moveTo(L,N),s.arc(0,0,f,y,x,!m)):s.moveTo(L,N),h>Sy&&M>Sy?A>Sy?(v=Ub(O,D,I,G,h,-A,m),_=Ub(L,N,j,R,h,-A,m),s.lineTo(v.cx+v.x01,v.cy+v.y01),A<k?s.arc(v.cx,v.cy,A,_y(v.y01,v.x01),_y(_.y01,_.x01),!m):(s.arc(v.cx,v.cy,A,_y(v.y01,v.x01),_y(v.y11,v.x11),!m),s.arc(0,0,h,_y(v.cy+v.y11,v.cx+v.x11),_y(_.cy+_.y11,_.cx+_.x11),m),s.arc(_.cx,_.cy,A,_y(_.y11,_.x11),_y(_.y01,_.x01),!m))):s.arc(0,0,h,w,b,m):s.lineTo(O,D)}else s.moveTo(0,0);if(s.closePath(),c)return s=null,c+""||null}return c.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Cy/2;return[yy(r)*n,wy(r)*n]},c.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:cy(+e),c):t},c.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:cy(+t),c):e},c.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:cy(+t),c):n},c.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:cy(+t),c):r},c.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:cy(+t),c):i},c.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:cy(+t),c):a},c.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:cy(+t),c):o},c.context=function(t){return arguments.length?(s=null==t?null:t,c):s},c}const Vb=An("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");var Yb=function(t,e){var n=ox(t);if(e)for(var r in e)n[r]=e[r];function i(t,e){t.svg_.selectAll("pattern").selectAll("rect").each(function(){var t=Nt(this);t.attr("data-original-fill")||t.attr("data-original-fill",t.style("fill")),t.style("fill","white")}),t.svg_.selectAll("pattern").selectAll("rect[code='"+e+"']").each(function(){var t=Nt(this);t.style("fill",t.attr("data-original-fill"))})}function a(t){t.svg_.selectAll("pattern").selectAll("rect").each(function(){var t=Nt(this),e=t.attr("data-original-fill");e&&t.style("fill",e)})}return n.update=function(){n.updateConfig(),n.updateContainer();var t=n.map,e=t.svg(),r=n.lgg;r.selectAll("*").remove(),n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle();var o=0,s=t.catColors(),l=function(l){var c=n.boxPadding+(n.title?n.titleFontSize+n.boxPadding:0)+o*(n.shapeHeight+n.shapePadding);t.catColors()[l];r.append("rect").attr("class","em-legend-rect").attr("x",n.boxPadding).attr("y",c).attr("width",n.shapeWidth).attr("height",n.shapeHeight).style("fill",s[l]).attr("stroke","black").attr("stroke-width",.5).on("mouseover",function(){Nt(this).raise(),i(n.map,l),n.map.insetTemplates_&&Wi(n.map.insetTemplates_,n.map.svgId,i,l)}).on("mouseout",function(){a(n.map),n.map.insetTemplates_&&Wi(n.map.insetTemplates_,n.map.svgId,a)}),r.append("text").attr("class","em-legend-label").attr("x",n.boxPadding+n.shapeWidth+n.labelOffsets.x).attr("y",c+.5*n.shapeHeight).attr("dy","0.35em").text(t.catLabels()[l]||l).on("mouseover",function(){e.selectAll("pattern").selectAll("rect[code='"+l+"']").style("fill",t.hoverColor())}).on("mouseout",function(){var n=t.catColors()[l]||"lightgray";e.selectAll("pattern").selectAll("rect[code='"+l+"']").style("fill",n)}),o++};for(var c in s)l(c);if(n.noData){var u=n.boxPadding+(n.title?n.titleFontSize+n.boxPadding:0)+o*(n.shapeHeight+n.shapePadding);r.append("rect").attr("class","em-legend-rect").attr("x",n.boxPadding).attr("y",u).attr("width",n.shapeWidth).attr("height",n.shapeHeight).style("fill",t.noDataFillStyle()).on("mouseover",function(){e.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",t.hoverColor()),Nt(this).style("fill",t.hoverColor())}).on("mouseout",function(){e.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",function(e){t.noDataFillStyle()});Nt(this).style("fill",t.noDataFillStyle())}),r.append("text").attr("class","em-legend-label").attr("x",n.boxPadding+n.shapeWidth+n.labelOffsets.x).attr("y",u+.5*n.shapeHeight).text(n.noDataText).on("mouseover",function(){e.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",t.hoverColor())}).on("mouseout",function(){e.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",function(e){t.noDataFillStyle()})})}n.setBoxDimension()},n};function $b(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Xb(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xb(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Xb(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Jb(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&(void 0===n?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)))}return[n,r]}var Zb=function(t,e){var n=ox(t);if(n.sizeLegend={title:null,titlePadding:10,values:null,labelFormatter:void 0,noData:!1,noDataText:"No data"},n.colorLegend={title:null,titlePadding:10,marginTop:33,labelOffsets:{x:5,y:5},shapeWidth:25,shapeHeight:20,shapePadding:1,noData:!0,noDataText:"No data"},n._sizeLegendHeight=0,e)for(var r in e)if("colorLegend"==r||"sizeLegend"==r){for(var i in n[r])void 0!==e[r][i]&&(n[r][i]=e[r][i]);0==e.colorLegend&&(n.colorLegend=!1)}else n[r]=e[r];function a(t,e){var n=t.svg_.selectAll(".piechart").selectAll("path[code]");n.style("opacity",0),n.filter("path[code='"+e+"']").each(function(){Nt(this).style("opacity",1)})}function o(t){t.svg_.selectAll(".piechart").selectAll("path[code]").each(function(){Nt(this).style("opacity",1)})}return n.update=function(){n.updateConfig(),n.updateContainer();var t=n.map,e=n.lgg;e.selectAll("*").remove(),n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle();var r=n.getBaseY(),i=n.getBaseX();t.classifierSize_&&(n._sizeLegendContainer=e.append("g").attr("class","em-pie-size-legend").attr("transform","translate(".concat(i,", ").concat(r,")")),Yy(n,n._sizeLegendContainer,n.sizeLegend.values,t.classifierSize_,n.sizeLegend.title,n.sizeLegend.titlePadding)),function(t,e,n){var r=t.map,i=t.colorLegend;if(t._colorLegendContainer=t.lgg.append("g").attr("class","em-pie-color-legend"),t._sizeLegendContainer){var s=t._sizeLegendContainer.node().getBBox().height;t._colorLegendContainer.attr("transform","translate(".concat(e,",").concat(s+t.colorLegend.marginTop,")"))}else t._colorLegendContainer.attr("transform","translate(".concat(e,",").concat(n,")"));i.title&&t._colorLegendContainer.append("text").attr("id","em-color-legend-title").attr("class","em-color-legend-title").attr("x",0).attr("y",t.titleFontSize).text(i.title);var l=0,c=r.catColors(),u=function(e){var n=t.colorLegend.titlePadding+(i.title?t.titleFontSize:0)+l*(i.shapeHeight+i.shapePadding);r.catColors()[e];t._colorLegendContainer.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",n).attr("width",i.shapeWidth).attr("height",i.shapeHeight).style("fill",c[e]).on("mouseover",function(){a(t.map,e),t.map.insetTemplates_&&Wi(t.map.insetTemplates_,t.map.svgId,a,e)}).on("mouseout",function(){o(t.map),t.map.insetTemplates_&&Wi(t.map.insetTemplates_,t.map.svgId,o,e)}),t._colorLegendContainer.append("text").attr("class","em-legend-label").attr("x",i.shapeWidth+i.labelOffsets.x).attr("y",n+.5*i.shapeHeight).attr("dy","0.35em").text(r.catLabels()[e]||e),l++};for(var h in c)u(h);if(i.noData){var f=0;t._sizeLegendContainer&&(f=t._sizeLegendContainer.node().getBBox().height);var d=f+t.colorLegend.marginTop+t.boxPadding+(i.title?t.titleFontSize+t.boxPadding:0)+l*(i.shapeHeight+i.shapePadding),p=t.lgg.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(t.boxPadding,",").concat(d,")"));t.appendNoDataLegend(p,t.noDataText,a,o)}}(n,i,r),n.setBoxDimension()},n};function Kb(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Qb(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qb(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Qb(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var tw=function(t){var e=ux(t,!0,"pie");e.dorling_=(null==t?void 0:t.dorling)||!1,e.animateDorling_=!0,e.pieMinRadius_=5,e.pieMaxRadius_=15,e.pieChartInnerRadius_=0,e.pieStrokeFill_="white",e.pieStrokeWidth_=.3,e.tooltipPieRadius_=40,e.tooltipPieInnerRadius_=0,e.catColors_=void 0,e.catLabels_=void 0,e.pieOtherColor_="#FFCC80",e.pieOtherText_="Other",e.showOnlyWhenComplete_=!1,e.classifierSize_=null,e.statPie_=null,e.pieTotalCode_=void 0,e.statCodes_=void 0,["catColors_","catLabels_","showOnlyWhenComplete_","noDataFillStyle_","pieMaxRadius_","pieMinRadius_","pieChartInnerRadius_","pieOtherColor_","pieOtherText_","pieStrokeFill_","pieStrokeWidth_","dorling_","animateDorling_","pieTotalCode_","statCodes_"].forEach(function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}}),t&&["catColors","catLabels","showOnlyWhenComplete","noDataFillStyle","pieMaxRadius","pieMinRadius","pieChartInnerRadius","pieOtherColor","pieOtherText","pieStrokeFill","pieStrokeWidth","statCodes"].forEach(function(n){null!=t[n]&&e[n](t[n])}),e.statPie=function(t,n,r,i,a,o){t.filters=t.filters||{};for(var s=0;s<r.length;s++){var l=r[s];t.filters[n]=l;var c={};for(var u in t)c[u]=t[u];for(var h in c.filters={},t.filters)c.filters[h]=t.filters[h];e.stat(l,c),a&&(e.catColors_=e.catColors_||{},e.catColors_[l]=a[s]),i&&(e.catLabels_=e.catLabels_||{},e.catLabels_[l]=i[s])}if(e.statCodes_=r,o){e.pieTotalCode_=o,t.filters[n]=o;var f={};for(var d in t)f[d]=t[d];for(var p in f.filters={},t.filters)f.filters[p]=t.filters[p];e.stat(o,f)}else e.pieTotalCode_=void 0;return e},e.updateClassification=function(){return e.insetTemplates_&&Wi(e.insetTemplates_,e.svgId_,n),n(e),e};var n=function(t){if(!e.statCodes_){e.statCodes_=Object.keys(e.statData_);var n=e.statCodes_.indexOf("default");n>-1&&e.statCodes_.splice(n,1)}var r,i=(r=[],e.getCentroidsGroup(e).selectAll("g.em-centroid").data().forEach(function(t){var e=t.properties.id,n=a(e);n&&r.push(n)}),Jb(r));return isNaN(i[0])||(e.classifierSize_=Xx().domain(i).range([e.pieMinRadius_,e.pieMaxRadius_])),e};function r(t){var n=[];if(e.svg_){var r=t.getCentroidsGroup(t);if(r){r.selectAll("g.em-centroid").append("g").attr("class","em-pie").attr("id",function(t){return n.push(t),"pie_"+t.properties.id});var o=Hi(e),s=e.svg().selectAll(o);"WORLD"!==t.geo_&&"mixed"==t.nutsLevel_&&function(t,e){e.each(function(e){var n=Nt(this);if(!this.parentNode.classList.contains("em-cntrg")){var r=n.attr("lvl"),a=i(e.properties.id),o=a?"WORLD"===t.geo_?"block":null:"none",s=null,l=null;a&&"0"!==r&&(s=n.style("stroke")||"#777","WORLD"===t.geo_&&(l=n.style("stroke-width")||"#777")),n.style("display",o).style("stroke",s).style("stroke-width",l)}})}(t,s),function(t){t.forEach(function(t){var n=t.properties.id,r=[],o=i(n);for(var s in o)r.push({code:s,value:o[s]});if(r&&0!=r.length){var l=e.svg().selectAll("#pie_"+n),c=e.classifierSize_(a(n)),u=e.pieChartInnerRadius_,h=Gb().sort(null).value(function(t){return t.value}),f=Hb().innerRadius(u).outerRadius(c),d=l.append("g").attr("class","piechart").attr("stroke",e.pieStrokeFill_).attr("stroke-width",e.pieStrokeWidth_+"px").style("pointer-events","none"),p=h(r);d.selectAll("path").data(p).join("path").attr("fill",function(t){return e.catColors_[t.data.code]||"lightgray"}).attr("code",function(t){return t.data.code}).each(function(t){this._current={startAngle:t.startAngle,endAngle:t.startAngle}}).transition().delay(function(t,e){return 150*e}).duration(e.transitionDuration_).attrTween("d",function(t){var e=Xe(this._current,t);return this._current=e(1),function(t){return f(e(t))}}).on("end",function(){Nt(d.node()).style("pointer-events",null)});d.on("mouseover",function(t,n){Nt(this).style("stroke-width",e.pieStrokeWidth_+1).style("stroke","black"),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(n,e))}).on("mousemove",function(t){e._tooltip&&e._tooltip.mousemove(t)}).on("mouseout",function(){Nt(this).style("stroke-width",e.pieStrokeWidth_).style("stroke",e.pieStrokeFill_),e._tooltip&&e._tooltip.mouseout()})}})}(n),function(t,n){n.on("mouseover",function(t,n){var r=Nt(this);r.attr("fill___",r.style("fill")),r.style("fill",e.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(n,e))}).on("mousemove",function(t,n){e._tooltip&&e._tooltip.mousemove(t)}).on("mouseout",function(){var t=Nt(this);t.attr("fill___")&&(t.style("fill",t.attr("fill___")),e._tooltip&&e._tooltip.mouseout())})}(0,s)}}}e.updateStyle=function(){try{if(!e.classifierSize_)return;if(!e.catColors_){e.catColors({});for(var t=0;t<e.statCodes_.length;t++)e.catColors_[e.statCodes_[t]]=Vb[t%10]}return e.pieTotalCode_&&(e.catColors_.other=e.pieOtherColor_,e.catLabels_.other=e.pieOtherText_),e.catLabels_=e.catLabels_||{},e.insetTemplates_&&Wi(e.insetTemplates_,e.svgId_,r),r(e),e.dorling_?Bx(e,function(t){var n=a(t.properties.id)||0;return e.classifierSize_(n)||0}):qx(e),e}catch(t){console.error("Error in pie symbols styling: "+t.message),console.error(t)}};var i=function(t){for(var n={},r=0,i=e.statCodes_,a=0;a<i.length;a++){var o=i[a],s=e.statData(o).get(t),l=null==s?void 0:s.value;if(null==l||isNaN(l)){if(e.showOnlyWhenComplete())return}else n[o]=l,r+=l}if(e.pieTotalCode_){var c=e.statData(e.pieTotalCode_).get(t),u=null==c?void 0:c.value;r=null==u||isNaN(u)?0:u}if(r&&!isNaN(r)){var h,f=Kb(i);try{for(f.s();!(h=f.n()).done;){var d=h.value;void 0!==n[d]&&(n[d]/=r)}}catch(t){f.e(t)}finally{f.f()}if(e.pieTotalCode_){var p=Object.values(n).reduce(function(t,e){return t+e},0);n.other=Math.max(0,1-p)}return n}};var a=function(t){var n,r=0;if(e.pieTotalCode_)!(n=e.statData(e.pieTotalCode_).get(t))||0!=n.value&&!n.value||isNaN(n.value)?e.showOnlyWhenComplete()&&(r=void 0):r=n.value;else for(var i=0;i<e.statCodes_.length;i++){var a=e.statCodes_[i];if(!(n=e.statData(a).get(t))||0!=n.value&&!n.value||isNaN(n.value)){if(e.showOnlyWhenComplete())return}else r+=n.value}if(0!=r)return r};e.getLegendConstructor=function(){return Zb};var o=150,s=120,l=Math.min(o,s)/2-10,c=Gb().sort(null).value(function(t){return t.value}),u=Hb().innerRadius(0).outerRadius(.8*l),h=Hb().innerRadius(.9*l).outerRadius(.9*l);return e.tooltip_.textFunction=function(t,n){var r=t.properties.na||t.properties.name,f=t.properties.id,d=i(f),p=[];for(var g in d)p.push({code:g,value:d[g]});var m="";if(m+='<div class="em-tooltip-bar">'.concat(r).concat(f?" (".concat(f,")"):"","</div>"),!p||0===p.length)return m+="<div>".concat(e.noDataText(),"</div>");var v,_="",y="",x="",b=Kb(c(p));try{for(b.s();!(v=b.n()).done;){var w=v.value,M=e.catColors()[w.data.code]||"lightgray",S=u(w);if(_+='<path d="'.concat(S,'" fill="').concat(M,'" stroke="white" stroke-width="1" opacity="0.7"></path>'),w.data.value>.1){var C=u.centroid(w),E=h.centroid(w),k=h.centroid(w),A=w.startAngle+(w.endAngle-w.startAngle)/2;k[0]=.95*l*(A<Math.PI?1:-1),y+='<polyline points="'.concat(C.join(",")," ").concat(E.join(",")," ").concat(k.join(","),'"\n stroke="black" fill="none" stroke-width="1" />');var T=h.centroid(w);T[0]=.99*l*(A<Math.PI?1:-1);var P=A<Math.PI?"start":"end",F=(100*w.data.value).toFixed();isNaN(F)||(x+='<text x="'.concat(T[0],'" y="').concat(T[1],'" text-anchor="').concat(P,'" font-size="12px">\n ').concat(F,"%\n </text>"))}}}catch(t){b.e(t)}finally{b.f()}m+="\n <div class='em-tooltip-piechart-container'>\n <svg viewBox=\"".concat(-75," ").concat(-60," ").concat(o," ").concat(s,'" width="').concat(o,'" height="').concat(115,'">\n <g transform="translate(0,0)">\n ').concat(_,"\n ").concat(y,"\n ").concat(x,"\n </g>\n </svg>\n </div>\n "),m+='<div class="em-tooltip-breakdown">';var L,N=e.statCodes_.map(function(t){var n=e.statData(t).get(f);return n&&void 0!==n.value&&null!==n.value?{code:t,label:e.catLabels_[t],value:n.value,color:e.catColors()[t]||"#666"}:null}).filter(Boolean).sort(function(t,e){return e.value-t.value}),O=a(f)||N.reduce(function(t,e){return t+e.value},0),D=Kb(N);try{for(D.s();!(L=D.n()).done;){var z,I=L.value,G=O?(I.value/O*100).toFixed(0):0;m+='\n <div class="em-breakdown-item">\n <span class="em-breakdown-color" style="background:'.concat(I.color,'"></span>\n <span class="em-breakdown-label">').concat(I.label,'</span>\n <span class="em-breakdown-value">').concat(null!==(z=I.value)&&void 0!==z&&z.toFixed?Ri(I.value):0," (").concat(isNaN(G)?0:G,"%)</span>\n </div>\n ")}}catch(t){D.e(t)}finally{D.f()}if(null!=O){var j=e.statData(e.statCodes_[0]).unitText()||"";m+='\n <div class="em-breakdown-item em-total">\n <span class="em-breakdown-label">Total</span>\n <span class="em-breakdown-value">'.concat(Ri(O)," ").concat(j,"</span>\n </div>\n ")}return m+="</div>"},e};function ew(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function nw(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ew(Object(n),!0).forEach(function(e){Ji(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ew(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var rw=function(t){var e=ux(t,!0,"spark");e.sparkLineColor_="black",e.sparkAreaColor_="#41afaa",e.sparkLineWidth_=30,e.sparkLineHeight_=20,e.sparkLineStrokeWidth_=.4,e.sparkLineOpacity_=.6,e.sparkType_="line",e.sparkLineCircleRadius_=0,e.sparkTooltipChart_={width:100,height:50,margin:{left:60,right:40,top:40,bottom:40},circleRadius:1.5},e.showOnlyWhenComplete_=!1,e.sparkLineChartFunction_=void 0,e.statSpark_=null,e.sparkHeightClassifier_=null;var n=["sparkLineColor_","showOnlyWhenComplete_","sparkType_","sparkLineWidth_","sparkLineHeight_","sparkLineStrokeWidth_","sparkLineOpacity_","sparkLineCircleRadius_","sparkLineAreaColor_","sparkTooltipChart_","sparkLineChartFunction_"];n.forEach(function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}}),t&&n.forEach(function(n){var r=n.slice(0,-1);null!=t[r]&&e[r](t[r])}),e.sparklineData_=void 0,e.sparklineData=function(t){var n=Object.keys(t[Object.keys(t)[0]]);return e._statDates=n,n.forEach(function(n){var r=w_(),i={};for(var a in t){var o=t[a];i[a]=o[n]}r.setData(i),e.statData(n,r)}),e},e.statSpark=function(t,n,r){t.filters=t.filters||{};for(var i=0;i<n.length;i++){var a=n[i];t.filters.time=a;var o={};for(var s in t)o[s]=t[s];for(var l in o.filters={},t.filters)o.filters[l]=t.filters[l];e.stat(a,o),r&&(e.catLabels_=e.catLabels_||{},e.catLabels_[a]=r[i])}return e._statDates=n,e},e._statDates=void 0;var r=function(t){for(var n=[],r=0,i=0;i<e._statDates.length;i++){var a=e._statDates[i],o=e.statData(a).get(t);if(!o||0!=o.value&&!o.value||isNaN(o.value)){if(e.showOnlyWhenComplete())return}else n.push({date:a,value:o.value}),r+=o.value}if(0!=r){for(var s=1;s<n.length;s++){var l=n[s-1].value,c=n[s].value;n[s].percentageChange=0===l?.001:(c-l)/l*100}return n}};function i(t){var n=[];t.getCentroidsGroup(t).selectAll("g.em-centroid").attr("id",function(t){return n.push(t.properties.id),"spark_"+t.properties.id});return n.forEach(function(t){var n=e.svg().select("#spark_"+t),i=r(t);i&&a(n,i,e.sparkLineWidth_,e.sparkLineHeight_)}),function(t){var n=Hi(t),i=e.svg().selectAll(n);i.on("mouseover",function(t,n){if(r(n.properties.id)){var i=Nt(this);i.attr("fill___",i.style("fill")),i.style("fill",e.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(n,e))}}).on("mousemove",function(t,n){r(n.properties.id)&&e._tooltip&&e._tooltip.mousemove(t)}).on("mouseout",function(){var t=Nt(this);t.style("fill");t.attr("fill___")&&(t.style("fill",t.attr("fill___")),e._tooltip&&e._tooltip.mouseout())})}(t),t}function a(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(e.sparkLineChartFunction_&&e.sparkLineChartFunction_!==a)return e.sparkLineChartFunction_(t,n,r,i,o);var s=Cn().domain([0,e._statDates.length-1]).range([.5,r-.5]),l=Ot(n.map(function(t){return t.value}))||0,c=Dt(n.map(function(t){return t.value}))||1,u=Cn().domain([l,c]).range([i,0]),h=n.map(function(t,e){return nw(nw({},t),{},{scaledXValue:s(e),scaledYValue:u(t.value)})}),f=u(0);o&&(t.append("g").attr("class","axis-x").attr("transform","translate(0, ".concat(i,")")).call(W_(s).ticks(e._statDates.length).tickFormat(function(t,n){return e._statDates[n]})).selectAll("text").style("text-anchor","end").attr("dx","-.8em").attr("dy",".15em").attr("transform","rotate(-65)"),t.append("g").attr("class","axis-y").call(q_(u).ticks(5)),l<0&&c>0&&t.append("line").attr("x1",0).attr("x2",r).attr("y1",f).attr("y2",f).attr("stroke","gray").attr("stroke-dasharray","2,2").attr("stroke-width",1));var d=gb().x(function(t){return t.scaledXValue}).y(function(t){return t.scaledYValue});"area"===e.sparkType_&&t.append("path").datum(h).attr("fill","function"==typeof e.sparkAreaColor_?function(t,n){return e.sparkAreaColor_(t,n)}:e.sparkAreaColor_).attr("stroke","none").attr("opacity",e.sparkLineOpacity_).attr("fill-opacity",.3).attr("d",function(t,e,n){var r=null,i=cy(!0),a=null,o=fb,s=null,l=my(c);function c(c){var u,h,f,d,p,g=(c=ub(c)).length,m=!1,v=new Array(g),_=new Array(g);for(null==a&&(s=o(p=l())),u=0;u<=g;++u){if(!(u<g&&i(d=c[u],u,c))===m)if(m=!m)h=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=h;--f)s.point(v[f],_[f]);s.lineEnd(),s.areaEnd()}m&&(v[u]=+t(d,u,c),_[u]=+e(d,u,c),s.point(r?+r(d,u,c):v[u],n?+n(d,u,c):_[u]))}if(p)return s=null,p+""||null}function u(){return gb().defined(i).curve(o).context(a)}return t="function"==typeof t?t:void 0===t?db:cy(+t),e="function"==typeof e?e:cy(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?pb:cy(+n),c.x=function(e){return arguments.length?(t="function"==typeof e?e:cy(+e),r=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:cy(+e),c):t},c.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:cy(+t),c):r},c.y=function(t){return arguments.length?(e="function"==typeof t?t:cy(+t),n=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:cy(+t),c):e},c.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:cy(+t),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(r).y(e)},c.defined=function(t){return arguments.length?(i="function"==typeof t?t:cy(!!t),c):i},c.curve=function(t){return arguments.length?(o=t,null!=a&&(s=o(a)),c):o},c.context=function(t){return arguments.length?(null==t?a=s=null:s=o(a=t),c):a},c}().x(function(t){return t.scaledXValue}).y0(f).y1(function(t){return t.scaledYValue}));var p=t.append("path").datum(h).attr("fill","none").attr("opacity",e.sparkLineOpacity_).attr("stroke","function"==typeof e.sparkLineColor_?function(t,n){return e.sparkLineColor_(t,n)}:e.sparkLineColor_).attr("stroke-width","function"==typeof e.sparkLineStrokeWidth_?function(t,n){return e.sparkLineStrokeWidth_(t,n)}:e.sparkLineStrokeWidth_+"px").attr("d",d);if(!o){var g=p.node().getTotalLength();p.attr("stroke-dasharray",g).attr("stroke-dashoffset",g).transition().duration(e.transitionDuration()).attr("stroke-dashoffset",0)}t.selectAll("circle").data(h).enter().append("circle").attr("cx",function(t){return t.scaledXValue}).attr("cy",function(t){return t.scaledYValue}).attr("r",e.sparkLineCircleRadius_).attr("fill","red").attr("stroke","none")}e.updateClassification=function(){if(!e._statDates){e._statDates=Object.keys(e.statData_);var t=e._statDates.indexOf("default");t>-1&&e._statDates.splice(t,1)}return e.domain=function(){var t=[];if(e.getCentroidsGroup(e).selectAll("g.em-centroid").data().forEach(function(e){var n=e.properties.id,r=o(n);void 0!==r&&t.push(r)}),0===t.length)return[0,1];return Jb(t)}(),e.widthClassifier_=Xx().domain(e.domain).range([0,e.sparkLineWidth_]),e.heightClassifier_=Xx().domain(e.domain).range([0,e.sparkLineHeight_]),e},e.updateStyle=function(){try{return i(e),e.insetTemplates_&&Wi(e.insetTemplates_,e.svgId_,i),e}catch(t){console.error("Error in proportional symbols styling: "+t.message),console.error(t)}return e},e.tooltip_.textFunction=function(t,n){var i=[],o=t.properties.na,s=t.properties.id;i.push('\n <div class="em-tooltip-bar">\n <b>'.concat(o,"</b>").concat(s?" (".concat(s,")"):"","\n </div>\n "));var l,c=e.sparkTooltipChart_.height,u=e.sparkTooltipChart_.width,h=e.sparkTooltipChart_.margin,f=r(t.properties.id);if(f){var d=u+h.left+h.right,p=c+h.top+h.bottom,g=(l="div",Nt(yt(l).call(document.documentElement))).attr("class","em-tooltip-chart-container");a(g.append("svg").attr("class","em-tooltip-chart-svg").attr("width",d).attr("height",p).append("g").attr("transform","translate(".concat(h.left,", ").concat(h.top,")")),f,u,c,!0),i.push(g.node().outerHTML)}return i.join("")};var o=function(t){for(var n=0,r=0;r<e._statDates.length;r++){var i=e._statDates[r],a=e.statData(i);if(a&&"function"==typeof a.get){var o=a.get(t);if(!o||0!==o.value&&!o.value||isNaN(o.value)){if(e.showOnlyWhenComplete())return}else o.value>n&&(n=o.value)}}if(0!==n)return n};return e.getLegendConstructor=function(){return iy},e},iw=vn?vn(".2s"):function(t){return String(t)},aw=vn?vn(","):function(t){return String(t)};function ow(t,e,n){var r,i=t.map;null===(r=t._flowColorContainer)||void 0===r||r.remove(),t._flowColorContainer=t.lgg.append("g").attr("class","em-flow-color-legend").attr("transform","translate(".concat(e,", ").concat(n,")"));var a=t._flowColorContainer.append("text").attr("class","em-color-legend-title").attr("id","em-color-legend-title").attr("dy","0.35em").text(t.flowColorLegend.title||"Destination"),o=[];if("function"==typeof i.flowColor_)o=t.flowColorLegend.items&&t.flowColorLegend.items.length>0?t.flowColorLegend.items.map(function(t){var e;return{label:t.label,color:t.color,key:null!==(e=t.key)&&void 0!==e?e:null}}):[{label:"please specify legend items ...",color:"#888",key:null}];else{var s=i.topLocationColorScale;o=Array.from(i.topLocationKeys||[]).map(function(t){return{key:t,label:i.nodeNameMap.get(t)||t,color:s(t)}}),o.push({key:"Other",label:"Other",color:i.flowColor_})}var l=a.node().getBBox().height+t.flowColorLegend.titlePadding;t.itemHeight;o.forEach(function(e,n){var r=t._flowColorContainer.append("g").attr("class","em-color-legend-item").attr("transform","translate(0, ".concat(22*n+l,")")).style("cursor","pointer").on("mouseover",function(){!function(t){if(!t)return;Zi(".em-flow-link, .em-flow-link-bundled").classed("highlighted",function(){return this.getAttribute("data-dest")===t}).classed("dimmed",function(){return!(this.getAttribute("data-dest")===t)})}(e.key),Nt(this).select("text").style("font-weight","bold"),Nt(this).select("rect").attr("stroke","black").attr("stroke-width",2)}).on("mouseout",function(){Zi(".em-flow-link, .em-flow-link-bundled").classed("highlighted",!1).classed("dimmed",!1),Nt(this).select("text").style("font-weight","normal"),Nt(this).select("rect").attr("stroke","none")});r.append("rect").attr("width",18).attr("height",22).attr("fill",e.color),r.append("text").attr("x",25).attr("y",14).attr("class","em-legend-label").text(e.label)})}var sw=function(t,e){var n=ox(t);if(n.flowWidthLegend={title:null,titlePadding:17,values:null,marginTop:15,labelFormatter:void 0,labels:null,color:"#333",orientation:"horizontal",segments:3,width:150,maxMin:!1},n.nodeSizeLegend={title:null,titlePadding:25,values:null,labels:null,marginTop:20,labelFormatter:void 0},n.flowColorLegend={title:null,titlePadding:0,marginTop:50,items:[],ticks:!1},n.regionColorLegend={title:null,titlePadding:15,marginTop:30,labels:["Exporter","Importer"]},e)for(var r in e)if("colorLegend"==r||"flowWidthLegend"==r||"nodeSizeLegend"==r||"flowColorLegend"==r||"regionColorLegend"==r){for(var i in n[r])void 0!==e[r][i]&&(n[r][i]=e[r][i]);0==e.colorLegend&&(n.colorLegend=!1)}else n[r]=e[r];return n.update=function(){n.updateConfig(),n.updateContainer();var t=n.map,e=n.lgg;if(t.legend_)for(var r in t.legend_)if("colorLegend"==r||"flowWidthLegend"==r||"nodeSizeLegend"==r||"flowColorLegend"==r||"regionColorLegend"==r)for(var i in n[r])void 0!==t.legend_[r][i]&&(n[r][i]=t.legend_[r][i]);else n[r]=t.legend_[r];e.selectAll("*").remove(),n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle(),function(t){var e=t.map,n=t.getBaseX(),r=t.getBaseY();t.flowWidthLegend&&("vertical"==t.flowWidthLegend.orientation?function(t,e,n){var r,i=t.map;if(i.strokeWidthScale){t._flowWidthContainer=t.lgg.append("g").attr("class","em-flow-width-legend").attr("transform","translate(".concat(e,", ").concat(n,")"));var a=t.flowWidthLegend,o=null!==(r=a.segments)&&void 0!==r?r:5;a.title&&t._flowWidthContainer.append("text").attr("class","em-width-legend-title").text(a.title||"Flow width");for(var s=[],l=t.map.maxFlowCount,c=t.map.minFlowCount,u=0;u<o;u++){var h=1===o?.5:u/(o-1);s.push(c+h*(l-c))}var f=a.values||s,d=a.titlePadding||10,p=i.strokeWidthScale;f.forEach(function(e,n){var r=p(e);if(n>0){var i=p(f[n-1]);d+=i/2+r/n+7}var o=a.labelFormatter?a.labelFormatter(e):Ri(e);a.labels&&a.labels[n]&&(o=a.labels[n]),t._flowWidthContainer.append("line").attr("x1",0).attr("x2",40).attr("y1",d).attr("y2",d).attr("stroke",a.color?a.color:"#6b6b6b").attr("stroke-width",r),t._flowWidthContainer.append("text").attr("x",50).attr("y",d).attr("dy","0.35em").attr("class","em-legend-label").text(o)})}}(t,n,r+t.flowWidthLegend.marginTop):function(t,e,n){var r,i,a,o;if(!t)return null;var s=t.map||t;if(!s||!s.strokeWidthScale)return null;t._flowWidthContainer&&t._flowWidthContainer.remove();var l=t.flowWidthLegend;t._flowWidthContainer=t.lgg.append("g").attr("class","em-flow-width-legend-horizontal").attr("transform","translate(".concat(e,", ").concat(n,")")),l.title&&t._flowWidthContainer.append("text").attr("class","em-width-legend-title").text(l.title||"Flow width");for(var c=null!==(r=l.x)&&void 0!==r?r:0,u=l.width||t.width,h=null!==(i=l.segments)&&void 0!==i?i:5,f=null!==(a=l.labelOffset)&&void 0!==a?a:12,d=null!==(o=l.pad)&&void 0!==o?o:0,p=c+d,g=c+u-d,m=Math.max(0,g-p),v=[],_=t.map.maxFlowCount,x=t.map.minFlowCount,b=0;b<h+1;b++){var w=1===h?.5:b/(h-1);v.push(x+w*(_-x))}var M=l.values||v,S=Math.max(1,M.length-1),C=m/S,E=M.map(function(t){return Math.max(.5,s.strokeWidthScale(t))}),k=Math.max.apply(Math,y(E)),A=s.strokeWidthScale(_)+l.titlePadding,T=t._flowWidthContainer.append("g").attr("class","em-flow-legend-texts"),P=t._flowWidthContainer.append("g").attr("class","em-flow-legend-lines");P.append("line").attr("class","em-flow-legend-baseline").attr("x1",p).attr("x2",g).attr("y1",A).attr("y2",A).attr("stroke","#eee").attr("stroke-width",1);for(var F=0;F<S;F++){var L,N,O=p+F*C,D=F===S-1?g:p+(F+1)*C,z=E[F],I=M[F];P.append("line").style("stroke-width",z).attr("x1",O).attr("x2",D).attr("y1",A).attr("y2",A).style("stroke",null!==(L=l.color)&&void 0!==L?L:"#000").style("stroke-opacity",null!==(N=l.strokeOpacity)&&void 0!==N?N:1);var G=(O+D)/2;T.append("text").attr("x",G).attr("y",A-f).attr("dy","-0.35em").attr("class","em-legend-label em-flow-legend-label em-flow-width-horizontal-label").text(iw(I))}l.maxMin&&(T.append("text").attr("x",p).attr("y",A+k+6).attr("class","em-legend-label em-flow-legend-min-label").attr("dy","0.5em").text(aw(Math.round(x))),T.append("text").attr("x",g).attr("y",A+k+6).attr("class","em-legend-label em-flow-legend-max-label").attr("dy","0.5em").text(aw(Math.round(_))))}(t,n,r+t.flowWidthLegend.marginTop));var i=t._flowWidthContainer.node(),a=i.getBBox().height;e.flowNodes_&&e._nodeSizeScale&&(t._nodeLegendContainer=t.lgg.append("g").attr("class","em-node-color-legend").attr("transform","translate(".concat(n,", ").concat(r+a,")")),t._nodeSizeContainer=t._nodeLegendContainer.append("g").attr("class","em-node-size-legend").attr("transform","translate(".concat(0,", ",t.nodeSizeLegend.marginTop,")")),Yy(t,t._nodeSizeContainer,t.nodeSizeLegend.values,e._nodeSizeScale,t.nodeSizeLegend.title,t.nodeSizeLegend.titlePadding));if(t.flowColorLegend&&(e.flowNodes_&&e._nodeSizeScale||"function"==typeof e.flowColor_)){var o=t.lgg.node().getBBox().height+t.flowColorLegend.marginTop;ow(t,n,o)}if((e.importerRegionIds.length>0||e.exporterRegionIds.length>0)&&t.regionColorLegend){var s=t.lgg.node().getBBox().height+t.regionColorLegend.marginTop;!function(t,e,n){var r;null===(r=t._regionColorContainer)||void 0===r||r.remove(),t._regionColorContainer=t.lgg.append("g").attr("class","em-flow-region-color-legend").attr("transform","translate(".concat(e,", ").concat(n,")"));t._regionColorContainer.append("text").attr("class","em-color-legend-title").attr("id","em-color-legend-title").attr("dy","0.35em").text(t.regionColorLegend.title||"Region fill colors");var i=t.map,a=Ji(Ji({},t.regionColorLegend.labels[0],i.flowRegionColors_[0]),t.regionColorLegend.labels[1],i.flowRegionColors_[1]),o=t.regionColorLegend.titlePadding;Object.entries(a).forEach(function(e,n){var r=_(e,2),i=r[0],a=r[1];t._regionColorContainer.append("rect").attr("x",0).attr("y",o+20*n).attr("width",t.shapeWidth).attr("height",t.shapeHeight).attr("fill",a),t._regionColorContainer.append("text").attr("x",t.shapeWidth+5).attr("y",o+20*n+15).attr("class","em-legend-label").text(i)})}(t,n,s)}}(n),n.setBoxDimension()},n};function lw(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function cw(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.cacheKey,r=void 0===n?"default":n,i=e.scale,a=void 0===i?1:i,o=e.markerUnits,s=void 0===o?"strokeWidth":o,l=e.hoverColor,c=void 0===l?"black":l,u=e.outlineColor,h=void 0===u?"#ffffff":u,f=e.idBase,d=void 0===f?function(){return"".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"arrow","-").concat(Math.random().toString(36).slice(2))}("arrow"):f,p=e.useContextStroke,g=void 0===p||p,m=t.node();if(m._arrowCache||(m._arrowCache=new Map),m._arrowCache.has(r))return m._arrowCache.get(r);var v,_=function(t){var e=t.select("defs");return e.empty()&&(e=t.append("defs")),e}(t),y={normal:"".concat(d),hover:"".concat(d,"-hover"),outline:"".concat(d,"-outline")};(_.select("#".concat(y.normal)).empty()&&fw(_,y.normal,{markerUnits:s,scale:a,fill:g?"context-stroke":c,out:e.out}),_.select("#".concat(y.hover)).empty()&&fw(_,y.hover,{markerUnits:s,scale:a,fill:c,out:e.out}),_.select("#".concat(y.outline)).empty())&&fw(_,y.outline,{markerUnits:s,scale:a,fill:(null===(v=e.out)||void 0===v?void 0:v.flowOutlineColor_)||h,out:e.out});return m._arrowCache.set(r,y),y}function uw(t,e){if(!e)return t;var n=e[arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal"];return t.attr("marker-end",n?"url(#".concat(n,")"):null)}function hw(t,e,n){return uw(t,e,n?"hover":"normal")}function fw(t,e,n){var r=n.markerUnits,i=void 0===r?"strokeWidth":r,a=n.scale,o=void 0===a?1:a,s=n.fill,l=void 0===s?"context-stroke":s,c=10,u=3*o;t.append("marker").attr("id",e).attr("markerUnits",i).attr("markerWidth",u).attr("markerHeight",u).attr("viewBox","0 0 ".concat(c," ").concat(c)).attr("refX",9.9).attr("refY",5).attr("orient","auto").append("path").attr("fill",l).attr("d","M0,0 L".concat(9.9,",").concat(5," L0,").concat(c," L").concat(2.2,",").concat(5," Z"))}function dw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function pw(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?dw(Object(n),!0).forEach(function(e){Ji(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dw(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function gw(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return mw(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mw(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function mw(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function vw(t,e){var n,r=new Map(t.map(function(t){return[t.id,t]})),i=new Map,a=gw(e);try{for(a.s();!(n=a.n()).done;){var o=n.value,s="object"===$i(o.source)?o.source.id:o.source,l="object"===$i(o.target)?o.target.id:o.target,c=r.get(s),u=r.get(l);if(c&&u){var h=s<l?"".concat(s,"|").concat(l):"".concat(l,"|").concat(s);if(!i.has(h)){var f=s<l?c:u,d=s<l?u:c;i.set(h,{key:h,idA:f.id,idB:d.id,nodeA:f,nodeB:d,coordsA:[f.x,f.y],coordsB:[d.x,d.y],flowAB:0,flowBA:0,sampleAB:null,sampleBA:null})}var p=i.get(h),g=+o.value||0;s===p.idA&&l===p.idB?(p.flowAB+=g,p.sampleAB||(p.sampleAB=o)):(p.flowBA+=g,p.sampleBA||(p.sampleBA=o))}}}catch(t){a.e(t)}finally{a.f()}return i}function _w(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return yw(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yw(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function yw(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function xw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function bw(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?xw(Object(n),!0).forEach(function(e){Ji(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xw(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function ww(t,e){var n=t.svg_,r=t.flowGraph_,i=t.flowColorGradient_||t.flowOpacityGradient_;t._nodeById=t._nodeById||new Map(r.nodes.map(function(t){return[t.id,t]}));var a=function(t,e){var n,r=vw(t,e),i=new Map(t.map(function(t){return[t.id,t]})),a=t.map(function(t){return pw({},t)}),o=[],s=0,l=gw(r.values());try{for(l.s();!(n=l.n()).done;){var c=n.value,u=c.idA,h=c.idB,f=c.coordsA,d=c.coordsB,p=c.flowAB,g=c.flowBA,m=c.sampleAB,v=c.sampleBA,_=i.get(u),y=i.get(h);if(_&&y){var x=m?pw({},m):{},b=v?pw({},v):{};if(delete x.source,delete x.target,delete x.value,delete b.source,delete b.target,delete b.value,p>0&&g>0){var w="__mid__".concat(u,"__").concat(h,"__").concat(s++),M={id:w,x:(f[0]+d[0])/2,y:(f[1]+d[1])/2,isMidpoint:!0};a.push(M),o.push(pw(pw({},x),{},{source:w,target:h,value:p,route:c,originId:u,destId:h,dir:"AtoB"})),o.push(pw(pw({},b),{},{source:w,target:u,value:g,route:c,originId:h,destId:u,dir:"BtoA"}))}else p>0?o.push(pw(pw({},x),{},{source:u,target:h,value:p,route:c,originId:u,destId:h,dir:"AtoB"})):g>0&&o.push(pw(pw({},b),{},{source:h,target:u,value:g,route:c,originId:h,destId:u,dir:"BtoA"}))}}}catch(t){l.e(t)}finally{l.f()}return{nodes:a,links:o}}(r.nodes,r.links),o=function(t,e){var n=function(t){var e=t.nodes,n=t.links;return{nodes:e.map(function(t){return bw({},t)}),links:n.map(function(t){return bw({},t)})}}(e);return function(t){var e,n=t.nodes,r=t.links,i=function(t){return t.id},a=_w(n.entries());try{for(a.s();!(e=a.n()).done;){var o=_(e.value,2),s=o[0],l=o[1];l.index=s,l.sourceLinks=[],l.targetLinks=[]}}catch(t){a.e(t)}finally{a.f()}var c,u=new Map(n.map(function(t,e){return[i(t,e,n),t]})),h=_w(r.entries());try{for(h.s();!(c=h.n()).done;){var f=_(c.value,2),d=f[0],p=f[1];p.index=d;var g=p.source,m=p.target;"object"!==$i(g)&&(g=p.source=u.get(g)),"object"!==$i(m)&&(m=p.target=u.get(m)),g&&m&&(g.sourceLinks.push(p),m.targetLinks.push(p))}}catch(t){h.e(t)}finally{h.f()}}(n),function(t){var e,n=t.nodes,r=_w(n);try{for(r.s();!(e=r.n()).done;){var i=e.value;i.value=Math.max(lw(i.sourceLinks,function(t){return t.value}),lw(i.targetLinks,function(t){return t.value}))}}catch(t){r.e(t)}finally{r.f()}}(n),function(t){var e=t.nodes,n=e.length,r=new Set(e),i=new Set,a=0;for(;r.size;){var o,s=_w(r);try{for(s.s();!(o=s.n()).done;){var l=o.value;l.depth=a;var c,u=_w(l.sourceLinks);try{for(u.s();!(c=u.n()).done;){var h=c.value.target;i.add(h)}}catch(t){u.e(t)}finally{u.f()}}}catch(t){s.e(t)}finally{s.f()}if(++a>n){console.log("Detected circular link(s); continuing layout.");break}r=i,i=new Set}}(n),function(t){var e=t.nodes,n=new Set,r=[];function i(t){var e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(n.has(t))return null!==(e=t.height)&&void 0!==e?e:0;n.add(t),r.push(t);var o,s=0,l=_w(t.targetLinks);try{for(l.s();!(o=l.n()).done;){var c=o.value.source;if(r.includes(c))console.log("Circular link detected between ".concat(c.id," and ").concat(t.id));else{var u=i(c,a+1);u+1>s&&(s=u+1)}}}catch(t){l.e(t)}finally{l.f()}return t.height=s,r.pop(),s}var a,o=_w(e);try{for(o.s();!(a=o.n()).done;){i(a.value)}}catch(t){o.e(t)}finally{o.f()}var s,l=Math.min.apply(Math,y(e.map(function(t){var e;return null!==(e=t.height)&&void 0!==e?e:0}))),c=_w(e);try{for(c.s();!(s=c.n()).done;){var u,h=s.value;h.height=(null!==(u=h.height)&&void 0!==u?u:0)-l}}catch(t){c.e(t)}finally{c.f()}}(n),function(t,e){var n,r=e.nodes,i=_w(r);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.sourceLinks.forEach(function(e){return e.width=t.strokeWidthScale(e.value)}),a.targetLinks.forEach(function(e){return e.width=t.strokeWidthScale(e.value)});var o=Math.max(lw(a.sourceLinks,function(t){return t.width}),lw(a.targetLinks,function(t){return t.width}));a.x0=a.x1=a.x,a.y0=a.y-o/2,a.y1=a.y+o/2}}catch(t){i.e(t)}finally{i.f()}!function(t){var e,n=_w(t);try{for(n.s();!(e=n.n()).done;){var r=e.value,i=r.sourceLinks,a=r.targetLinks;i.sort(function(t,e){return t.target.y-e.target.y}),a.sort(function(t,e){return t.source.y-e.source.y})}}catch(t){n.e(t)}finally{n.f()}}(r)}(t,n),function(t,e){var n,r=e.nodes,i=_w(r);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=a.y;if(a.isMidpoint){var s,l=_w(a.sourceLinks);try{for(l.s();!(s=l.n()).done;){s.value.y0=o}}catch(t){l.e(t)}finally{l.f()}var c,u=_w(a.targetLinks);try{for(u.s();!(c=u.n()).done;){c.value.y1=o}}catch(t){u.e(t)}finally{u.f()}a.y0=o,a.y1=o}else if(t.flowStack_){var h,f=[],d=[],p=_w(a.sourceLinks);try{for(p.s();!(h=p.n()).done;){var g=h.value,m=g.target,v={link:g,width:g.width,otherY:m.y,at:"out"};(m.x<a.x?f:d).push(v)}}catch(t){p.e(t)}finally{p.f()}var _,y=_w(a.targetLinks);try{for(y.s();!(_=y.n()).done;){var x=_.value,b=x.source,w={link:x,width:x.width,otherY:b.y,at:"in"};(b.x<a.x?f:d).push(w)}}catch(t){y.e(t)}finally{y.f()}var M=f.reduce(function(t,e){return t+e.width},0),S=d.reduce(function(t,e){return t+e.width},0);f.sort(t.flowOrder_),d.sort(t.flowOrder_);for(var C=o-M/2,E=0,k=f;E<k.length;E++){var A=k[E],T=C+A.width/2;"out"===A.at?A.link.y0=T:A.link.y1=T,C+=A.width}for(var P=o-S/2,F=0,L=d;F<L.length;F++){var N=L[F],O=P+N.width/2;"out"===N.at?N.link.y0=O:N.link.y1=O,P+=N.width}var D=Math.max(M,S);a.y0=o-D/2,a.y1=o+D/2}else{var z,I=_w(a.sourceLinks);try{for(I.s();!(z=I.n()).done;){z.value.y0=o}}catch(t){I.e(t)}finally{I.f()}var G,j=_w(a.targetLinks);try{for(j.s();!(G=j.n()).done;){G.value.y1=o}}catch(t){j.e(t)}finally{j.f()}a.y0=o,a.y1=o}}}catch(t){i.e(t)}finally{i.f()}}(t,n),function(t){var e,n=t.nodes,r=_w(n);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(i.isMidpoint){var a=[].concat(y(i.sourceLinks||[]),y(i.targetLinks||[]));if(2===a.length){var o,s=[],l=_w(a);try{for(l.s();!(o=l.n()).done;){var c=o.value;c.source===i?s.push({x:c.target.x0,y:c.y1}):c.target===i&&s.push({x:c.source.x1,y:c.y0})}}catch(t){l.e(t)}finally{l.f()}if(2===s.length){var u=(s[0].y+s[1].y)/2;i.y=u,i.y0=u,i.y1=u;var h,f=_w(a);try{for(f.s();!(h=f.n()).done;){var d=h.value;d.source===i&&(d.y0=u),d.target===i&&(d.y1=u)}}catch(t){f.e(t)}finally{f.f()}}}}}}catch(t){r.e(t)}finally{r.f()}}(n),n}(t,a),s=o.nodes,l=o.links,c=t.flowArrows_?cw(n,{cacheKey:"sankey",scale:t.flowArrowScale_||1,markerUnits:"strokeWidth",hoverColor:t.hoverColor_||"black",outlineColor:t.flowOutlineColor_||"#ffffff",useContextStroke:!0}):null,u=n.select("defs").empty()?n.append("defs"):n.select("defs"),h=l.map(function(){return Bi("gradient")});return i&&function(t,e,n,r){e.selectAll("linearGradient").data(r).join("linearGradient").attr("id",function(t,e){return n[e]}).attr("gradientUnits","userSpaceOnUse").attr("x1",function(t){var e,n,r,i;return null!==(e=null!==(n=null==t||null===(r=t.source)||void 0===r?void 0:r.x1)&&void 0!==n?n:null==t||null===(i=t.target)||void 0===i?void 0:i.x0)&&void 0!==e?e:0}).attr("x2",function(t){var e,n,r,i;return null!==(e=null!==(n=null==t||null===(r=t.target)||void 0===r?void 0:r.x0)&&void 0!==n?n:null==t||null===(i=t.source)||void 0===i?void 0:i.x1)&&void 0!==e?e:0}).attr("y1",function(t){var e,n;return null!==(e=null!==(n=null==t?void 0:t.y0)&&void 0!==n?n:null==t?void 0:t.y1)&&void 0!==e?e:0}).attr("y2",function(t){var e,n;return null!==(e=null!==(n=null==t?void 0:t.y1)&&void 0!==n?n:null==t?void 0:t.y0)&&void 0!==e?e:0}).each(function(e){var n,r,i=Nt(this);i.selectAll("stop").remove();var a=t.flowColorGradient_&&null!==(n=null===(r=t.flowRegionColors_)||void 0===r?void 0:r[0])&&void 0!==n?n:Cw(t,e),o=t.flowColorGradient_?"function"==typeof t.flowColor_?t.flowColor_(e):t.flowColor_:Cw(t,e),s=t.flowOpacityGradient_?0:1,l=1;i.append("stop").attr("offset","0%").attr("stop-color",a).attr("stop-opacity",s),i.append("stop").attr("offset","100%").attr("stop-color",o).attr("stop-opacity",l)})}(t,u,h,l),function(t,e,n,r,i,a){var o,s=t.flowColorGradient_||t.flowOpacityGradient_,l=function(t,e){return t.append("g").attr("class","em-flow-lines").attr("id","em-flow-lines").style("opacity",e.flowOpacity_)}(e,t),c=t.flowCurvatureSettings_||{},u=null!==(o=c.curvature)&&void 0!==o?o:.5,h=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.gapX,r=void 0===n?10:n,i=e.padX,a=void 0===i?2:i,o=e.padY,s=void 0===o?2:o,l=e.bumpY,c=void 0===l?0:l,u=e.curvature,h=void 0===u?.5:u;return function(e){var n=e.source.x1,i=e.y0,o=e.target.x0,l=e.y1;if(n===o)return"M".concat(n,",").concat(i,"L").concat(o,",").concat(l);var u,f=n>o,d=f?o:n,p=f?l:i,g=f?n:o,m=f?i:l,v=[[d,p]],_=function(t){return p+(m-p)*(g===d?0:(t-d)/(g-d))},y=[],x=_w(t);try{for(x.s();!(u=x.n()).done;){var b,w,M=u.value;if(M!==e.source&&M!==e.target){var S=M.x0;if(!(S<=d||S>=g)){var C=null!==(b=M.y0)&&void 0!==b?b:M.y,E=null!==(w=M.y1)&&void 0!==w?w:M.y,k=(C+E)/2,A=S-a,T=S+a,P=_(S),F=P>=k,L=C-(F?0:s),N=E+(F?s:0);if(P>=L&&P<=N){var O=F?N+c:L-c,D=Math.max(d,A-r),z=Math.min(g,T+r);if(z<D)continue;y.push({x1:D,x2:z,y:O})}}}}}catch(t){x.e(t)}finally{x.f()}if(y.length){y.sort(function(t,e){return t.x1-e.x1});var I,G=[],j=_w(y);try{for(j.s();!(I=j.n()).done;){var R=I.value;if(!G.length||R.x1>G[G.length-1].x2)G.push(bw({},R));else{var B=G[G.length-1];B.x2=Math.max(B.x2,R.x2),B.y=R.y}}}catch(t){j.e(t)}finally{j.f()}for(var W=0,q=G;W<q.length;W++){var U=q[W],H=Math.max(d,U.x1),V=Math.min(g,U.x2),Y=v[v.length-1][0];H>Y&&(v.push([H,U.y]),Y=H),V>Y&&v.push([V,U.y])}}v.push([g,m]),f&&v.reverse();for(var $="function"==typeof h?h(e):h,X="M".concat(v[0][0],",").concat(v[0][1]),J=1;J<v.length;J++)X+=Ew(v[J-1],v[J],$);return X}}(n,bw(bw({},c),{},{curvature:"function"==typeof c.curvature?c.curvature:function(t){return t.source&&t.source.isMidpoint?.5*u:u}}));r.forEach(function(e,n){var r=h(e),o=function(t,e){var n,r,i,a,o,s,l;return t.topLocationKeys&&null!==(n=(r=t.topLocationKeys).has)&&void 0!==n&&n.call(r,null==e||null===(i=e.target)||void 0===i?void 0:i.id)?e.target.id:null!==(a=null!==(o=null==e||null===(s=e.target)||void 0===s?void 0:s.id)&&void 0!==o?o:null==e||null===(l=e.source)||void 0===l?void 0:l.id)&&void 0!==a?a:"Other"}(t,e),c=Cw(t,e),u=s?"url(#".concat(a[n],")"):c;t.flowOutlines_&&!t.flowWidthGradient_&&function(t,e,n,r,i){var a=r.width+t.flowOutlineWidth_,o=Mw(t,a,n),s=o.dashVis,l=o.dashGap,c=e.append("path").attr("d",n).attr("fill","none").attr("class","em-flow-link-outline").attr("stroke",t.flowOutlineColor_).attr("stroke-width",a).attr("stroke-dasharray",t.flowArrows_?"".concat(s," ").concat(l):null).style("pointer-events","none");t.flowArrows_&&uw(c,i,"outline")}(t,l,r,e,i);var f=t.flowWidthGradient_?function(t,e,n,r,i,a,o){var s=Sw(r,function(){return n},{startRatio:t.flowWidthGradientSettings_.startRatio,samples:t.flowWidthGradientSettings_.samples,minStartWidth:t.flowWidthGradientSettings_.minStartWidth,capEnd:t.flowArrows_},0);if(t.flowOutlines_){var l=Sw(r,function(){return n},{startRatio:t.flowWidthGradientSettings_.startRatio,samples:t.flowWidthGradientSettings_.samples,minStartWidth:t.flowWidthGradientSettings_.minStartWidth,capEnd:t.flowArrows_},t.flowOutlineWidth_);e.append("path").attr("d",l).attr("fill",t.flowOutlineColor_).attr("class","em-flow-link-outline")}var c=e.append("path").attr("d",s).attr("fill",i).attr("class","em-flow-link em-flow-link-tapered").attr("data-color-key",a).attr("data-color",o);return c}(t,l,r,e,u,o,c):function(t,e,n,r,i,a,o,s){var l=Mw(t,r.width,n),c=l.dashVis,u=l.dashGap,h=e.append("path").attr("d",n).attr("fill","none").attr("class","em-flow-link").attr("stroke",i).attr("stroke-width",r.width).attr("stroke-linecap","butt").attr("stroke-dasharray",t.flowArrows_?"".concat(c," ").concat(u):null).attr("data-color-key",a).attr("data-color",s);t.flowArrows_&&uw(h,o,"normal");return h}(t,l,r,e,u,o,i,c);!function(t,e,n){n.usesGradient;var r=n.paint,i=n.link,a=n.arrowIds;e.on("mouseover",function(){t.flowWidthGradient_?Nt(this).attr("fill",t.hoverColor_):(Nt(this).attr("stroke",t.hoverColor_),t.flowArrows_&&hw(Nt(this),a,!0)),t._tooltip&&t._tooltip.mouseover(t.tooltip_.textFunction(i,t))}).on("mousemove",function(e){t._tooltip&&t._tooltip.mousemove(e)}).on("mouseout",function(){t.flowWidthGradient_?Nt(this).attr("fill",r):(Nt(this).attr("stroke",r),t.flowArrows_&&hw(Nt(this),a,!1)),t._tooltip&&t._tooltip.mouseout()})}(t,f,{usesGradient:s,paint:u,link:e,arrowIds:i})})}(t,e,s,l,c,h),function(t,e,n){var r=n.filter(function(t){return!t.isMidpoint});e.append("g").attr("class","em-flow-node-stems").selectAll("rect").data(r,function(t){return t.id}).join("rect").attr("x",function(t){return t.x0-.5}).attr("y",function(e){return t.flowStack_?e.y0:e.y}).attr("width",1).attr("height",function(e){return t.flowStack_?Math.max(0,e.y1-e.y0):0}).attr("fill","#000")}(t,e,s),n.node()}function Mw(t,e,n){var r,i,a,o,s,l=t.flowArrows_?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=t*(3*e)*.9;return.85*n}(e,t.flowArrowScale_):0,c=_((r=n,i=l,a=Math.max(0,function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","path");return e.setAttribute("d",t),e.getTotalLength()}(r)),o=Math.max(0,a-Math.min(i,a)),s=Math.min(i,a),[o,s]),2);return{backoff:l,dashVis:c[0],dashGap:c[1]}}function Sw(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.startRatio,i=void 0===r?.25:r,a=n.samples,o=void 0===a?48:a,s=n.minStartWidth,l=void 0===s?1.5:s,c=n.capEnd,u=void 0===c?!out.flowArrows_:c,h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,f=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:48,n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d",t);for(var r=n.getTotalLength(),i=[],a=0;a<=e;a++){var o=n.getPointAtLength(r*a/e);i.push([o.x,o.y])}return i}(e(t),o),d=[],p=0;p<f.length;p++){var g=f[Math.max(0,p-1)],m=f[Math.min(f.length-1,p+1)],v=m[0]-g[0],_=m[1]-g[1],y=Math.hypot(v,_)||1;d.push([-_/y,v/y])}for(var x=Math.max(l,t.width*i),b=t.width,w=[],M=[],S=f.length-1,C=0;C<=S;C++){var E=(x+(b-x)*(C/S))/2+h,k=d[C][0]*E,A=d[C][1]*E;w.push([f[C][0]+k,f[C][1]+A]),M.push([f[C][0]-k,f[C][1]-A])}M.reverse(),u&&(w[S][1]=M[0][1]=(w[S][1]+M[0][1])/2);for(var T="M".concat(w[0][0],",").concat(w[0][1]),P=1;P<w.length;P++)T+="L".concat(w[P][0],",").concat(w[P][1]);for(var F=0;F<M.length;F++)T+="L".concat(M[F][0],",").concat(M[F][1]);return T+="Z"}function Cw(t,e){var n,r,i="string"==typeof t.flowColor_?t.flowColor_:"#999999";if("function"==typeof t.flowColor_)try{var a=t.flowColor_(e);if(null!=a)return a}catch(t){console.log("flowColor_ threw in sankey getFlowStroke:",t)}return function(t,e,n,r){if(!t.topLocationKeys||!t.flowTopLocations_||!t.flowNodes_)return r;var i=t.flowTopLocationsType_||"sum";if("origin"===i)return t.topLocationKeys.has(e)?t.topLocationColorScale(e):r;if("destination"===i)return t.topLocationKeys.has(n)?t.topLocationColorScale(n):r;return t.topLocationKeys.has(n)?t.topLocationColorScale(n):t.topLocationKeys.has(e)?t.topLocationColorScale(e):r}(t,null!==(n=e.originId)&&void 0!==n?n:"object"===$i(e.source)?e.source.id:e.source,null!==(r=e.destId)&&void 0!==r?r:"object"===$i(e.target)?e.target.id:e.target,i)}function Ew(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5,r=_(t,2),i=r[0],a=r[1],o=_(e,2),s=o[0],l=o[1],c=function(t){return i+(s-i)*t},u=c(n),h=c(1-n);return"C".concat(u,",").concat(a," ").concat(h,",").concat(l," ").concat(s,",").concat(l)}function kw(t){return t.index}function Aw(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function Tw(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Pw(t){this._context=t}function Fw(t,e){this._basis=new Pw(t),this._beta=e}Pw.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:Tw(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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);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:Tw(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Fw.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],a=e[0],o=t[n]-i,s=e[n]-a,l=-1;++l<=n;)r=l/n,this._basis.point(this._beta*t[l]+(1-this._beta)*(i+r*o),this._beta*e[l]+(1-this._beta)*(a+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const Lw=function t(e){function n(t){return 1===e?new Pw(t):new Fw(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function Nw(t,e){var n,r=t.width_||t.innerWidth_||1e3,i=t.height_||t.innerHeight_||800,a=Math.sqrt(r*r+i*i),o={segments:Cn().domain([0,a]).range([1,10]),nodes:t._nodeSizeScale||Xx().range([4,18])},s=function(t,e,n){var r={nodes:[],links:[],paths:[]};return r.nodes=t.map(function(t){return t.fx=t.x,t.fy=t.y,t}),e.forEach(function(t){for(var e=function(t,e){var n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}(t.source,t.target),i=Math.round(n.segments(e)),a=Cn().domain([0,i+1]).range([t.source.x,t.target.x]),o=Cn().domain([0,i+1]).range([t.source.y,t.target.y]),s=t.source,l=[s],c=1;c<=i;c++){var u={x:a(c),y:o(c)};l.push(u),r.nodes.push(u),r.links.push({source:s,target:u}),s=u}l.push(t.target),r.links.push({source:s,target:t.target}),r.paths.push(l)}),r}(t.flowGraph_.nodes,t.flowGraph_.links,o),l=t.flowArrows_?t._arrowIds||{}:null,c=gb().curve(Lw.beta(.85)).x(function(t){return t.x}).y(function(t){return t.y}),u=e.selectAll("path.em-flow-link").data(s.paths).enter().append("path").attr("d",c).attr("class","em-flow-link").attr("fill","none").style("cursor","pointer").style("pointer-events","auto").attr("stroke-linecap","butt").attr("stroke-opacity",null!==(n=t.flowOpacity_)&&void 0!==n?n:1).each(function(e,n){var r,i,a=e[0],o=e[e.length-1],s=a.id||a.code||a.iata,c=o.id||o.code||o.iata,u=null!==(r=null===(i=t.flowGraph_.links)||void 0===i||null===(i=i[n])||void 0===i?void 0:i.value)&&void 0!==r?r:1,h=jw(t,s,c,null,u),f=Rw(t,s,c),d=h,p=t.strokeWidthScale(u);Nt(this).attr("data-nb",u).attr("data-origin",s).attr("data-dest",c).attr("data-color",h).attr("data-color-key",f).attr("stroke",d).attr("stroke-width",p).attr("stroke-dasharray",t.flowArrows_?"5 5":null),t.flowArrows_&&uw(Nt(this),l,"normal")});u.on("mouseover",function(e,n){var r,i,a=n[0],o=n[n.length-1],s=a.id||a.code||a.iata,c=o.id||o.code||o.iata,u=null!==(r=null===(i=t.flowGraph_.links)||void 0===i||null===(i=i.find(function(t){return(t.source.id||t.source.code)===s&&(t.target.id||t.target.code)===c}))||void 0===i?void 0:i.value)&&void 0!==r?r:1;Bw(t,s,c,u,l).call(this,e)}).on("mousemove",function(e){t._tooltip&&t._tooltip.mousemove(e)}).on("mouseout",function(e,n){var r=Nt(this).attr("data-color");qw(t,r,l).call(this,e)});var h=wx().alphaDecay(t.flowBundleSettings_.alphaDecay).force("charge",function(){var t,e,n,r,i,a=Mx(-30),o=1,s=1/0,l=.81;function c(n){var i,a=t.length,o=Px(t,yx,xx).visitAfter(h);for(r=n,i=0;i<a;++i)e=t[i],o.visit(f)}function u(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+a(n,e,t)}}function h(t){var e,n,r,a,o,s=0,l=0;if(t.length){for(r=a=o=0;o<4;++o)(e=t[o])&&(n=Math.abs(e.value))&&(s+=e.value,l+=n,r+=n*e.x,a+=n*e.y);t.x=r/l,t.y=a/l}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function f(t,a,c,u){if(!t.value)return!0;var h=t.x-e.x,f=t.y-e.y,d=u-a,p=h*h+f*f;if(d*d/l<p)return p<s&&(0===h&&(p+=(h=Ox(n))*h),0===f&&(p+=(f=Ox(n))*f),p<o&&(p=Math.sqrt(o*p)),e.vx+=h*t.value*r/p,e.vy+=f*t.value*r/p),!0;if(!(t.length||p>=s)){(t.data!==e||t.next)&&(0===h&&(p+=(h=Ox(n))*h),0===f&&(p+=(f=Ox(n))*f),p<o&&(p=Math.sqrt(o*p)));do{t.data!==e&&(d=i[t.data.index]*r/p,e.vx+=h*d,e.vy+=f*d)}while(t=t.next)}}return c.initialize=function(e,r){t=e,n=r,u()},c.strength=function(t){return arguments.length?(a="function"==typeof t?t:Mx(+t),u(),c):a},c.distanceMin=function(t){return arguments.length?(o=t*t,c):Math.sqrt(o)},c.distanceMax=function(t){return arguments.length?(s=t*t,c):Math.sqrt(s)},c.theta=function(t){return arguments.length?(l=t*t,c):Math.sqrt(l)},c}().strength(t.flowBundleSettings_.chargeStrength).distanceMax(t.flowBundleSettings_.distanceMax?t.flowBundleSettings_.distanceMax:2*o.nodes.range()[1])).force("link",function(t){var e,n,r,i,a,o,s=kw,l=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},c=Mx(30),u=1;function h(r){for(var i=0,s=t.length;i<u;++i)for(var l,c,h,f,d,p,g,m=0;m<s;++m)c=(l=t[m]).source,f=(h=l.target).x+h.vx-c.x-c.vx||Ox(o),d=h.y+h.vy-c.y-c.vy||Ox(o),f*=p=((p=Math.sqrt(f*f+d*d))-n[m])/p*r*e[m],d*=p,h.vx-=f*(g=a[m]),h.vy-=d*g,c.vx+=f*(g=1-g),c.vy+=d*g}function f(){if(r){var o,l,c=r.length,u=t.length,h=new Map(r.map((t,e)=>[s(t,e,r),t]));for(o=0,i=new Array(c);o<u;++o)(l=t[o]).index=o,"object"!=typeof l.source&&(l.source=Aw(h,l.source)),"object"!=typeof l.target&&(l.target=Aw(h,l.target)),i[l.source.index]=(i[l.source.index]||0)+1,i[l.target.index]=(i[l.target.index]||0)+1;for(o=0,a=new Array(u);o<u;++o)l=t[o],a[o]=i[l.source.index]/(i[l.source.index]+i[l.target.index]);e=new Array(u),d(),n=new Array(u),p()}}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+l(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+c(t[e],e,t)}return null==t&&(t=[]),h.initialize=function(t,e){r=t,o=e,f()},h.links=function(e){return arguments.length?(t=e,f(),h):t},h.id=function(t){return arguments.length?(s=t,h):s},h.iterations=function(t){return arguments.length?(u=+t,h):u},h.strength=function(t){return arguments.length?(l="function"==typeof t?t:Mx(+t),d(),h):l},h.distance=function(t){return arguments.length?(c="function"==typeof t?t:Mx(+t),p(),h):c},h}().strength(t.flowBundleSettings_.linkStrength).distance(0).iterations(t.flowBundleSettings_.linkIterations)).on("tick",function(){return u.attr("d",c)}).on("end",function(){return console.log("layout complete")});h.nodes(s.nodes),h.force("link").links(s.links)}function Ow(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Dw(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dw(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Dw(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function zw(t,e){!function(t,e){if(null==t||!t.flowGraph_)return;var n=t.svg_||e,r=t.flowArrows_?cw(n,{cacheKey:"straight",scale:t.flowArrowScale_||1,markerUnits:"strokeWidth",hoverColor:t.hoverColor_||"black",outlineColor:t.flowOutlineColor_||"#ffffff",useContextStroke:!0}):null,i=function(t){var e=t.flowGraph_||{},n=e.nodes,r=void 0===n?[]:n,i=e.links,a=void 0===i?[]:i;t._nodeById=t._nodeById||new Map(r.map(function(t){return[t.id,t]}));var o=[];if(t.flowBidirectional_){var s,l=Ow(vw(r,a).values());try{for(l.s();!(s=l.n()).done;){var c=s.value,u=c.idA,h=c.idB,f=c.nodeA,d=c.nodeB,p=c.flowAB,g=c.flowBA,m=(f.x+d.x)/2,v=(f.y+d.y)/2;p>0&&g>0?(o.push({originId:u,destId:h,x1:m,y1:v,x2:d.x,y2:d.y,value:p,route:c,nodeA:f,nodeB:d,isHalf:!0}),o.push({originId:h,destId:u,x1:m,y1:v,x2:f.x,y2:f.y,value:g,route:c,nodeA:f,nodeB:d,isHalf:!0})):p>0?o.push({originId:u,destId:h,x1:f.x,y1:f.y,x2:d.x,y2:d.y,value:p,route:c,nodeA:f,nodeB:d}):g>0&&o.push({originId:h,destId:u,x1:d.x,y1:d.y,x2:f.x,y2:f.y,value:g,route:c,nodeA:f,nodeB:d})}}catch(t){l.e(t)}finally{l.f()}}else{var _,x=new Map,b=(t.flowGraph_||{}).links,w=void 0===b?[]:b,M=t._nodeById,S=Ow(w);try{for(S.s();!(_=S.n()).done;){var C=_.value,E=Iw(C.source),k=Iw(C.target);if(E&&k&&E!==k){var A=E<k?"".concat(E,"|").concat(k):"".concat(k,"|").concat(E),T=+C.value||+C.nb||0;if(T>0){var P=M.get(E)||("object"===$i(C.source)?C.source:null),F=M.get(k)||("object"===$i(C.target)?C.target:null);if(P&&F){var L=x.get(A);L?L.value+=T:x.set(A,{originId:E,destId:k,nodeA:P,nodeB:F,value:T,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(t){S.e(t)}finally{S.f()}o.push.apply(o,y(x.values()))}return o}(t);!function(t,e){var n,r=Ow(e);try{for(r.s();!(n=r.n()).done;){var i=n.value,a="function"==typeof t.strokeWidthScale?t.strokeWidthScale(i.value):i.value||1;i.width=+(null==a?1:a).toFixed(1)}}catch(t){r.e(t)}finally{r.f()}}(t,i);var a=function(t,e,n){var r=t.flowColorGradient_||t.flowOpacityGradient_;if(!r)return null;for(var i=t.svg_||e,a=i.select("defs").empty()?i.append("defs"):i.select("defs"),o=new Map,s=new Array(n.length),l=0;l<n.length;l++){var c=n[l],u=jw(t,c.originId,c.destId,c.route,c.value),h="".concat(Math.round(c.x1),":").concat(Math.round(c.y1),":").concat(Math.round(c.x2),":").concat(Math.round(c.y2),":").concat(u,":").concat(t.flowOpacityGradient_?1:0),f=o.get(h);if(!f){var d,p;f=Bi("flowgrad"),o.set(h,f);var g=a.append("linearGradient").attr("id",f).attr("gradientUnits","userSpaceOnUse").attr("x1",c.x1).attr("y1",c.y1).attr("x2",c.x2).attr("y2",c.y2),m=t.flowColorGradient_&&null!==(d=null===(p=t.flowRegionColors_)||void 0===p?void 0:p[0])&&void 0!==d?d:u,v=t.flowOpacityGradient_?0:1,_=1;g.append("stop").attr("offset","0%").attr("stop-color",m).attr("stop-opacity",v),g.append("stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",_)}s[l]=f}return s}(t,e,i);!function(t,e,n,r,i){var a=e.select(".em-flow-lines").empty()?e.append("g").attr("class","em-flow-lines").attr("id","em-flow-lines"):e.select(".em-flow-lines"),o=!!r;if(t.flowEdgeBundling_)return void Nw(t,a);for(var s=0;s<n.length;s++){var l=n[s],c=jw(t,l.originId,l.destId,l.route,l.value),u=Rw(t,l.originId,l.destId),h=o&&r[s]?"url(#".concat(r[s],")"):c,f=void 0;if(t.flowWidthGradient_){var d,p,g,m,v,_=l.x2-l.x1,y=l.y2-l.y1,x=Math.hypot(_,y)||1,b=-y/x,w=_/x,M=null!==(d=null===(p=t.flowWidthGradientSettings_)||void 0===p?void 0:p.startRatio)&&void 0!==d?d:.25,S=null!==(g=null===(m=t.flowWidthGradientSettings_)||void 0===m?void 0:m.minStartWidth)&&void 0!==g?g:.25*l.width,C=Math.max(S,l.width*M),E=l.width,k=l.x1+b*(C/2),A=l.y1+w*(C/2),T=l.x2+b*(E/2),P=l.y2+w*(E/2),F=l.x2-b*(E/2),L=l.y2-w*(E/2),N=l.x1-b*(C/2),O=l.y1-w*(C/2),D="M".concat(k,",").concat(A,"L").concat(T,",").concat(P,"L").concat(F,",").concat(L,"L").concat(N,",").concat(O,"Z");f=a.append("path").attr("d",D).attr("class","em-flow-link em-flow-link-tapered").attr("fill",h).attr("data-color-key",u).attr("data-color",c).attr("data-nb",l.value).attr("data-origin",l.originId).attr("data-dest",l.destId).attr("opacity",null!==(v=t.flowOpacity_)&&void 0!==v?v:1),t.flowArrows_&&uw(f,i,"normal")}else{var z,I=Math.hypot(l.x2-l.x1,l.y2-l.y1)||0,G=t.flowArrows_?Gw(l.width):0,j=Math.max(0,I-G),R=t.flowArrows_?Math.min(G,I):null;f=a.append("line").datum(l).attr("x1",function(t){return t.x1}).attr("y1",function(t){return t.y1}).attr("x2",function(t){return t.x2}).attr("y2",function(t){return t.y2}).attr("class","em-flow-link").attr("data-nb",l.value).attr("data-origin",l.originId).attr("data-dest",l.destId).attr("stroke",h).attr("stroke-width",l.width).attr("stroke-opacity",null!==(z=t.flowOpacity_)&&void 0!==z?z:1).attr("stroke-linecap","butt").attr("stroke-dasharray",t.flowArrows_?"".concat(j," ").concat(R):null).attr("data-color",c).attr("data-color-key",u)}f.on("mouseover",Bw(t,l.originId,l.destId,l.value,i)).on("mousemove",Ww(t)).on("mouseout",qw(t,c,i)),t.flowArrows_&&uw(f,i,"normal")}}(t,e,i,a,r)}(t,e)}var Iw=function(t){var e,n;return t&&"object"===$i(t)?null!==(e=null!==(n=t.id)&&void 0!==n?n:t.iata)&&void 0!==e?e:t.code:t};function Gw(t){return.7*(t*(3*(out.flowArrowScale_||1))*.9)}function jw(t,e,n,r,i){var a="string"==typeof t.flowColor_?t.flowColor_:"#999999",o=t._nodeById||new Map(t.flowGraph_.nodes.map(function(t){return[t.id,t]})),s={source:o.get(e)||{id:e},target:o.get(n)||{id:n},value:i,route:r};if("function"==typeof t.flowColor_){var l;try{l=t.flowColor_(s)}catch(t){}if(null==l&&t.flowColor_.length>=3)try{l=t.flowColor_(e,n,r)}catch(t){}if(null!=l)return l}return function(t,e,n,r){if(!t.topLocationKeys||!t.flowTopLocations_)return r;var i=t.flowTopLocationsType_||"sum";if("origin"===i)return t.topLocationKeys.has(e)?t.topLocationColorScale(e):r;if("destination"===i)return t.topLocationKeys.has(n)?t.topLocationColorScale(n):r;return t.topLocationKeys.has(n)?t.topLocationColorScale(n):t.topLocationKeys.has(e)?t.topLocationColorScale(e):r}(t,e,n,a)}function Rw(t,e,n){if(!t.topLocationKeys)return null;var r=t.flowTopLocationsType_||"sum";return"origin"===r?t.topLocationKeys.has(e)?e:"Other":"destination"===r?t.topLocationKeys.has(n)?n:"Other":t.topLocationKeys.has(n)?n:t.topLocationKeys.has(e)?e:"Other"}function Bw(t,e,n,r,i){return function(a){var o=t.hoverColor_||"black";if(Nt(this).attr("stroke",o).attr("stroke-opacity",1),t.flowArrows_&&hw(Nt(this),i,!0),t._tooltip){var s=t.flowGraph_.nodes.find(function(t){return t.id===e}),l=t.flowGraph_.nodes.find(function(t){return t.id===n}),c={source:s,target:l,value:r};t._tooltip.mouseover(t.tooltip_.textFunction(c,t))}}}function Ww(t){return function(e){t._tooltip&&t._tooltip.mousemove(e)}}function qw(t,e,n){return function(){Nt(this).attr("stroke",e).attr("stroke-opacity",t.flowOpacity_),t.flowArrows_&&hw(Nt(this),n,!1),t._tooltip&&t._tooltip.mouseout()}}function Uw(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Hw(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hw(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Hw(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Vw(t,e){!function(t){var e,n=t.flowGraph_.nodes,r=t.topLocationKeys||new Set,i=(t.topLocationColorScale,t.flowTopLocationsType_),a=Uw(n);try{var o=function(){var n,a=e.value,o=new Map,s=0,l=Uw(a.targetLinks);try{for(l.s();!(n=l.n()).done;){var c=n.value,u=c.source.id;if(u!==a.id){var h=void 0;h="origin"===i?r.has(u)?u:"Other":"destination"===i?r.has(a.id)?a.id:"Other":r.has(u)||r.has(a.id)?r.has(a.id)?a.id:u:"Other",o.set(h,(o.get(h)||0)+c.value)}else t.flowInternal_&&(s+=c.value)}}catch(t){l.e(t)}finally{l.f()}var f,d=Uw(a.sourceLinks);try{for(d.s();!(f=d.n()).done;){var p=f.value,g=p.target.id;if(g!==a.id){var m=void 0;m="origin"===i?r.has(a.id)?a.id:"Other":"destination"===i?r.has(g)?g:"Other":r.has(g)||r.has(a.id)?r.has(g)?g:a.id:"Other",o.set(m,(o.get(m)||0)+p.value)}else t.flowInternal_&&(s+=p.value)}}catch(t){d.e(t)}finally{d.f()}a.donutValues=Array.from(o.entries()).map(function(e){var n=_(e,2),r=n[0];return{label:r,value:n[1],color:eM(r,a.id,t)}}),t.flowInternal_&&s>0&&a.donutValues.push({label:"Internal",value:s,color:"#999"})};for(a.s();!(e=a.n()).done;)o()}catch(t){a.e(t)}finally{a.f()}}(t),function(t){var e,n={},r=Uw(t.flowGraph_.nodes);try{for(r.s();!(e=r.n()).done;){var i=e.value;n[i.id]={x:i.x,y:i.y,incoming:0,outgoing:0,internal:0}}}catch(t){r.e(t)}finally{r.f()}var a,o=Uw(t.flowGraph_.links);try{for(o.s();!(a=o.n()).done;){var s=a.value,l=s.source.id,c=s.target.id;n[l]&&(n[l].outgoing+=s.value),n[c]&&(n[c].incoming+=s.value),l===c&&(n[l].internal+=s.value)}}catch(t){o.e(t)}finally{o.f()}t.locationStats=n}(t);var n=e.append("g").attr("class","donuts").attr("id","donuts"),r=Dt(t.flowGraph_.nodes,function(t){return lw(t.donutValues,function(t){return t.value})});t._nodeSizeScale=t.flowNodeSizeScale_||Xx().domain([0,r]).range([3,10]);var i=Hb().innerRadius(5),a=Gb().value(function(t){return t.value}).sort(null);Object.entries(t.locationStats).forEach(function(e){var r=_(e,2),o=r[0],s=r[1],l=s.x,c=s.y,u=s.incoming,h=s.outgoing,f=s.internal,d=t.flowInternal_?u+h+f:u+h;if(0!==d){var p=Kw(o,t),g=Qw(o,t),m=[].concat(y(p),y(g)),v=new Map;m.forEach(function(t){var e=t.color;v.set(e,(v.get(e)||0)+t.value)});var x=Array.from(v,function(t){var e=_(t,2),n=e[0];return{label:n,value:e[1],color:n}}),b=a(x);b.forEach(function(e){e.data.parent={id:o,name:t.nodeNameMap.get(o)||o,donutValues:x}});var w=n.append("g").attr("class","donut-group").attr("transform","translate(".concat(l,",").concat(c,")")).attr("data-total",d),M=t.flowNodeMouseoverFunction_||Xw;w.selectAll("path").data(b).join("path").attr("d",i.innerRadius(.4*t._nodeSizeScale(d)).outerRadius(t._nodeSizeScale(d))).attr("fill",function(t){return t.data.color}).attr("stroke","white").attr("stroke-width",.5).style("cursor","pointer").on("mouseover",function(e,n){t._tooltip&&t._tooltip.mouseover(M(n,t)),Jw(e,t.svg_),Yw(o)}).on("mousemove",function(e,n){t._tooltip&&t._tooltip.mousemove(e)}).on("mouseout",function(e,n){t._tooltip&&t._tooltip.mouseout(),Zw(e,t.svg_),$w()}),w.append("circle").attr("r",.4*t._nodeSizeScale(d)).attr("fill","white").style("cursor","pointer").on("mouseover",function(e){var n=b[0];t._tooltip&&t._tooltip.mouseover(M(n,t)),Jw(e,t.svg_),Yw(o)}).on("mousemove",function(e){t._tooltip&&t._tooltip.mousemove(e)}).on("mouseout",function(e){t._tooltip&&t._tooltip.mouseout(),Zw(e,t.svg_),$w()})}})}function Yw(t){t&&Zi(".em-flow-link, .em-flow-link-bundled").classed("highlighted",function(){var e=this.getAttribute("data-origin"),n=this.getAttribute("data-dest");return e===t||n===t}).classed("dimmed",function(){var e=this.getAttribute("data-origin"),n=this.getAttribute("data-dest");return!(e===t||n===t)})}function $w(){Zi(".em-flow-link, .em-flow-link-bundled").classed("highlighted",!1).classed("dimmed",!1)}function Xw(t,e){var n,r,i=vn(".0%"),a=t.data.parent,o=lw(a.donutValues,function(t){return t.value}),s=null===(n=e.statData)||void 0===n?void 0:n.call(e),l=(null==s||null===(r=s.unitText)||void 0===r?void 0:r.call(s))||"",c=[];c.push('\n <div class="em-tooltip-bar">\n <b><span class="em-tooltip-label-text">'.concat(a.name||a.id||"Unknown location","</span></b>\n </div>\n ")),c.push('<div class="em-tooltip-text"><table class="em-tooltip-table em-donut-tooltip-table"><tbody>');var u=Kw(a.id,e),h=lw(u,function(t){return t.value});if(h>0){var f=i(h/o);c.push('\n <tr class="em-donut-tooltip-section-header">\n <td>Incoming:</td>\n <td>'.concat(Ri(h)," (").concat(f,")</td>\n </tr>\n ")),u.forEach(function(t){var e=i(t.value/o);c.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(t.color,'"></span>\n <span class="em-tooltip-label-text">').concat(t.name||t.key,'</span>\n </td>\n <td class="em-donut-tooltip-value">\n ').concat(Ri(t.value)," (").concat(e,")\n </td>\n </tr>\n "))})}var d=Qw(a.id,e),p=lw(d,function(t){return t.value});if(p>0){var g=i(p/o);c.push('\n <tr class="em-donut-tooltip-section-header">\n <td>Outgoing:</td>\n <td>'.concat(Ri(p)," (").concat(g,")</td>\n </tr>\n ")),d.forEach(function(t){var e=i(t.value/o);c.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(t.color,'"></span>\n <span class="em-tooltip-label-text">').concat(t.name||t.key,'</span>\n </td>\n <td class="em-donut-tooltip-value">\n ').concat(Ri(t.value)," (").concat(e,")\n </td>\n </tr>\n "))})}return c.push('\n <tr class="em-donut-tooltip-total">\n <td colspan="2">Total: '.concat(Ri(o)," ").concat(l,"</td>\n </tr>\n ")),c.push("</tbody></table></div>"),c.join("")}var Jw=function(t,e){var n=+e.attr("data-zoom")||1;Nt(t.target.parentNode).selectAll("path").each(function(){var t=Nt(this),e=+t.attr("stroke-width")||0;t.attr("data-stroke-width",e)}).attr("stroke","black").attr("stroke-width",2/n)},Zw=function(t,e){var n=+e.attr("data-zoom")||1;Nt(t.target.parentNode).selectAll("path").attr("stroke","white").attr("stroke-width",function(){return(+Nt(this).attr("data-stroke-width")||0)/n})};function Kw(t,e){var n,r=e.topLocationKeys,i=e.flowTopLocationsType_,a=e.flowInternal_,o={},s=Uw(e.flowGraph_.links);try{for(s.s();!(n=s.n()).done;){var l=n.value,c=l.source.id,u=l.target.id;if(u===t)if(c!==u){var h=void 0;o[h="destination"===i?t:"origin"===i?r.has(c)?c:"Other":r.has(c)||r.has(t)?r.has(c)?c:t:"Other"]=(o[h]||0)+l.value}else a&&(o.Internal=(o.Internal||0)+l.value)}}catch(t){s.e(t)}finally{s.f()}return tM(Object.entries(o).map(function(n){var r,i=_(n,2),a=i[0],o=i[1];return{key:a,name:(null===(r=e.nodeNameMap)||void 0===r?void 0:r.get(a))||a,value:o,color:eM(a,t,e)}}))}function Qw(t,e){var n,r=e.topLocationKeys,i=e.flowTopLocationsType_,a=e.flowInternal_,o={},s=Uw(e.flowGraph_.links);try{for(s.s();!(n=s.n()).done;){var l=n.value,c=l.source.id,u=l.target.id;if(c===t)if(c!==u){var h=void 0;o[h="origin"===i?t:"destination"===i?r.has(u)?u:"Other":r.has(u)||r.has(t)?r.has(u)?u:t:"Other"]=(o[h]||0)+l.value}else a&&(o.Internal=(o.Internal||0)+l.value)}}catch(t){s.e(t)}finally{s.f()}return tM(Object.entries(o).map(function(n){var r,i=_(n,2),a=i[0],o=i[1];return{key:a,name:(null===(r=e.nodeNameMap)||void 0===r?void 0:r.get(a))||a,value:o,color:eM(a,t,e)}}))}function tM(t){return t.sort(function(t,e){return"Other"===t.key?1:"Other"===e.key?-1:e.value-t.value})}function eM(t,e,n){var r=n.topLocationKeys||new Set,i=n.topLocationColorScale;return"Other"===t?"#666":"Internal"===t?r.has(e)?i(e):"#999":r.has(t)?i(t):"#666"}function nM(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return rM(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rM(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function rM(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function iM(t,e){t.locationStats||function(t){var e,n={},r=nM(t.flowGraph_.nodes);try{for(r.s();!(e=r.n()).done;){var i=e.value;n[i.id]={x:i.x,y:i.y,incoming:0,outgoing:0,internal:0}}}catch(t){r.e(t)}finally{r.f()}var a,o=nM(t.flowGraph_.links);try{for(o.s();!(a=o.n()).done;){var s=a.value,l=s.source.id,c=s.target.id,u=s.value||0;n[l]&&(n[l].outgoing+=u),n[c]&&(n[c].incoming+=u),l===c&&(n[l].internal+=u)}}catch(t){o.e(t)}finally{o.f()}t.locationStats=n}(t);var n=t.locationStats,r=t.flowInternal_,i=Object.values(n).map(function(t){return r?t.incoming+t.outgoing+t.internal:t.incoming+t.outgoing});Dt(i.length?i:[0]);t._nodeSizeScale=t.flowNodeSizeScale_||Jx(i,t.flowMaxNodeSize_||20,t.flowMinNodeSize_||0);var a=e.append("g").attr("class","em-node-circles");Object.entries(n).forEach(function(e){var i=_(e,2),o=i[0],s=i[1],l=r?s.incoming+s.outgoing+s.internal:s.incoming+s.outgoing;if(l){var c=a.append("g").attr("class","em-node-circle-group").attr("transform","translate(".concat(s.x,",").concat(s.y,")")).attr("data-id",o),u=t._nodeSizeScale(l);c.append("circle").attr("r",u).attr("class","em-node-circle").attr("fill",function(e){var n;return null!==(n=t.topLocationKeys)&&void 0!==n&&n.has(e)?t.topLocationColorScale(e):"string"==typeof t.flowColor_?t.flowColor_:"#2d50a0"}(o)).attr("stroke","white").attr("stroke-width",.5).style("cursor","pointer").on("mouseover",function(e){Nt(this).attr("stroke-width",1.5),t._tooltip&&t._tooltip.mouseover(function(e){var i,a,o,s=n[e],l=s.incoming,c=s.outgoing,u=s.internal,h=r?l+c+u:l+c,f=(null===(i=t.statData)||void 0===i||null===(i=i.call(t))||void 0===i||null===(a=i.unitText)||void 0===a?void 0:a.call(i))||"";return'\n <div class="em-tooltip-bar"><b>'.concat((null===(o=t.nodeNameMap)||void 0===o?void 0:o.get(e))||e,'</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(Ri(l),'</td></tr>\n <tr><td>Outgoing:</td><td style="text-align:right">').concat(Ri(c),"</td></tr>\n ").concat(r?'<tr><td>Internal:</td><td style="text-align:right">'.concat(Ri(u),"</td></tr>"):"",'\n <tr class="em-tooltip-total">\n <td colspan="2" style="padding-top:4px;font-weight:bold;">\n Total: ').concat(Ri(h)," ").concat(f,"\n </td>\n </tr>\n </tbody></table>\n </div>\n ")}(o)),function(t){if(!t)return;Zi(".em-flow-link, .em-flow-link-bundled").classed("highlighted",function(){var e=this.getAttribute("data-origin"),n=this.getAttribute("data-dest");return e===t||n===t}).classed("dimmed",function(){var e=this.getAttribute("data-origin"),n=this.getAttribute("data-dest");return!(e===t||n===t)})}(o)}).on("mouseout",function(e){Nt(this).attr("stroke-width",.5),t._tooltip&&t._tooltip.mouseout(e),Zi(".em-flow-link, .em-flow-link-bundled").classed("highlighted",!1).classed("dimmed",!1)}).on("mousemove",function(e){t._tooltip&&t._tooltip.mousemove(e)})}})}function aM(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return oM(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?oM(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function oM(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var sM=function(t){var e=ux(t,!0,"flow");e.strokeWidthScale=null,e.tooltip_.textFunction=cM,e.flowLineType_="curved",e.flowBidirectional_=!0,e.flowStack_=!0,e.flowEdgeBundling_=!1,e.flowCurvatureSettings_={gapX:10,padX:2,padY:2,bumpY:1,curvature:.5},e.flowColor_="#848484ff",e.flowRegionColors_=["#bbd7ee","#c7e3c6"],e.flowRegionLabels_=["Exporter","Importer"],e.flowMaxWidth_=30,e.flowMinWidth_=1,e.flowArrows_=!0,e.flowArrowScale_=.7,e.flowOutlines_=!0,e.flowOutlineWidth_=1.2,e.flowOutlineColor_="#ffffff",e.flowLabelOffsets_={x:3,y:0},e.flowOpacity_=.5,e.flowOrder_=function(t,e){var n,r,i,a,o=t.otherY-e.otherY;if(o)return o;if(t.at!==e.at)return"out"===t.at?-1:1;var s=(null!==(n=e.link.value)&&void 0!==n?n:0)-(null!==(r=t.link.value)&&void 0!==r?r:0);return s||String(null!==(i=t.link.id)&&void 0!==i?i:"").localeCompare(String(null!==(a=e.link.id)&&void 0!==a?a:""))},e.flowNodes_=!1,e.flowNodeType_="circle",e.flowMinNodeSize_=3,e.flowMaxNodeSize_=10,e.flowNodeSizeScale_=null,e.flowInternal_=!0,e.flowTopLocations_=0,e.flowTopLocationsType_="destination",e.flowColorGradient_=!1,e.flowOpacityGradient_=!1,e.flowWidthGradient_=!1,e.flowWidthGradientSettings_={startRatio:.25,samples:48,minStartWidth:1.5,capEnd:!0,curvatureFollow:!0},e.flowBundleSettings_={alphaDecay:.1,chargeStrength:10,distanceMax:null,linkStrength:.7,linkIterations:1};var n=["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 n.forEach(function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}}),t&&n.forEach(function(n){var r=n.slice(0,-1);null!=t[r]&&e[r](t[r])}),e.updateStyle=function(){var t;e.flowNodes_&&"donut"===e.flowNodeType_&&0==e.flowTopLocations_&&(e.flowTopLocations_=4),function(t){(function(t){t.flowGraph_.nodes.forEach(function(e){if("number"!=typeof e.x||"number"!=typeof e.y)if(t.Geometries.centroidsFeatures){var n=t.Geometries.centroidsFeatures.find(function(t){return e.id==t.properties.id});if(n){var r=_(n.geometry.coordinates,2),i=r[0],a=r[1];e.x=i,e.y=a}else console.error("could not find coordinates for",e.id)}else{var o,s,l,c=null===(o=(s=t.Geometries).getRegionFeatures)||void 0===o?void 0:o.call(s),u=null==c?void 0:c.find(function(t){return t.properties.id===e.id}),h=_((null==u||null===(l=u.properties)||void 0===l?void 0:l.centroid)||t._pathFunction.centroid(u),2),f=h[0],d=h[1];e.x=f,e.y=d}})})(t),function(t){var e,n=t.flowGraph_.nodes,r=aM(n);try{for(r.s();!(e=r.n()).done;){var i=e.value,a=t._projection([i.x,i.y]);i.x=a[0],i.y=a[1]}}catch(t){r.e(t)}finally{r.f()}}(t),function(t){var e=t.flowGraph_,n=e.nodes,r=e.links,i=new Map;r.forEach(function(t){i.set(t.source,(i.get(t.source)||0)+t.value),i.set(t.target,(i.get(t.target)||0)+t.value)}),n.forEach(function(t){t.value=i.get(t.id)||0})}(t),function(t){var e,n=t.flowGraph_.nodes,r=t.flowGraph_.links,i=function(t){return t.id},a=aM(n.entries());try{for(a.s();!(e=a.n()).done;){var o=_(e.value,2),s=o[0],l=o[1];l.index=s,l.sourceLinks=[],l.targetLinks=[]}}catch(t){a.e(t)}finally{a.f()}var c,u=new Map(n.map(function(t,e){return[i(t,e,n),t]})),h=aM(r.entries());try{for(h.s();!(c=h.n()).done;){var f=_(c.value,2),d=f[0],p=f[1];p.index=d;var g=p.source,m=p.target;"object"!==$i(g)&&(g=p.source=lM(u,g)),"object"!==$i(m)&&(m=p.target=lM(u,m)),g.sourceLinks.push(p),m.targetLinks.push(p)}}catch(t){h.e(t)}finally{h.f()}}(t),t.flowTopLocations_&&function(t){var e=t.flowGraph_.nodes,n=t.flowTopLocations_,r=t.flowTopLocationsType_||"sum";e.forEach(function(t){var e=t.sourceLinks.reduce(function(t,e){return t+e.value},0),n=t.targetLinks.reduce(function(t,e){return t+e.value},0);t.topScore="origin"===r?e:"destination"===r?n:e+n});var i=y(e).sort(function(t,e){return e.topScore-t.topScore}).slice(0,n);t.topLocationKeys=new Set(i.map(function(t){return t.id})),t.topLocationColorScale=L_().domain(i.map(function(t){return t.id})).range(["#00B3E3","#FBBA00","#2BA966","#D23142","#005289","#93397F","#E73E11","#4E4084","#056731","#00667E","#B5B900"])}(t);(function(t){var e=t.flowGraph_.links.map(function(t){return t.value}).filter(function(t){return t>0});t.maxFlowCount=e.length?Dt(e):0,t.minFlowCount=e.length?Ot(e):0})(t),t.nodeNameMap=new Map(t.flowGraph_.nodes.map(function(t){return[t.id,t.name||t.id]}))}(e),function(t){var e=t.flowGraph_.links,n=e.map(function(t){return t.value}).filter(function(t){return t>0}),r=Dt(n),i=(Ot(n),Math.max(0,t.flowMinWidth_||0)),a=t.flowMaxWidth_,o=Cn().domain([0,r]).range([0,a]).clamp(!0),s=function(t){var e=+t;return!Number.isFinite(e)||e<=0?0:Math.max(i,o(e))};s.domain=function(){return arguments.length?(o.domain.apply(o,arguments),s):o.domain()},t.strokeWidthScale=s}(e);var n=Nt("#em-zoom-group-"+e.svgId_),r=n.select("#em-flow-container");r.empty()?r=n.append("g").attr("id","em-flow-container").attr("class","em-flow-container"):r.selectAll("*").remove();var i,a=r.node();a&&a.previousSibling&&(null===(i=a.parentNode)||void 0===i||i.insertBefore(a,a.previousSibling));if(function(t){var e=t.flowGraph_,n=[],r=[],i=t.Geometries.getRegionFeatures();if(!i)return;if(e.nodes.forEach(function(t){var e=t.sourceLinks.reduce(function(t,e){return t+e.value},0),a=t.targetLinks.reduce(function(t,e){return t+e.value},0);i.find(function(e){return e.properties.id===t.id})?a>e?n.push(t.id):e>a&&r.push(t.id):console.log("could not find region geometry for",t.id)}),t.importerRegionIds=n,t.exporterRegionIds=r,0===n.length&&0===r.length)return void console.log("No importer or exporter regions found in the flow graph.");var a=Hi(t),o=t.svg_.selectAll(a);o.each(function(){var e=this.__data__.properties.id;Nt(this).style("fill",function(){return n.includes(e)?t.flowRegionColors_[1]:r.includes(e)?t.flowRegionColors_[0]:null}).attr("class",function(){return n.includes(e)?"em-flow-importer":r.includes(e)?"em-flow-exporter":null})})}(e),"curved"===e.flowLineType_||"sankey"===e.flowLineType_?ww(e,r):zw(e,r),e.flowNodes_&&("donut"===e.flowNodeType_?Vw(e,r):iM(e,r)),null!==(t=e.labels_)&&void 0!==t&&t.values){var o=e.svg().select("#em-zoom-group-"+e.svgId_);!function(t,e){var n,r=e.select("#em-labels"),i=r.empty()?e.append("g").attr("id","em-labels"):r,a=t.flowGraph_.nodes.filter(function(t){return t.targetLinks&&0===t.sourceLinks.length}),o=Oi(i,"em-flow-labels");null!==(n=t.labels_)&&void 0!==n&&n.shadows&&o.append("g").attr("class","em-flow-label-shadow").selectAll("text").data(a).join("text").attr("text-anchor",function(t){return t.x>t.targetLinks[0].source.x?"start":"end"}).attr("x",function(e){return e.x>e.targetLinks[0].source.x?e.x+t.flowLabelOffsets_.x:e.x-t.flowLabelOffsets_.x}).attr("y",function(e){return e.y+t.flowLabelOffsets_.y}).text(function(e){return t._statLabelFormatter(e.value)});var s=o.append("g").attr("class","em-flow-label").selectAll("g").data(a).join("g").attr("transform",function(t){return"translate(".concat(t.x,", ").concat(t.y,")")});s.append("text").attr("class","em-label-text").attr("text-anchor",function(t){return t.x>t.targetLinks[0].source.x?"start":"end"}).attr("x",function(e){return e.x>e.targetLinks[0].source.x?t.flowLabelOffsets_.x:-t.flowLabelOffsets_.x}).attr("y",t.flowLabelOffsets_.y).text(function(e){return t._statLabelFormatter(e.value)}),t.labels_.backgrounds&&s.each(function(){var t=Nt(this).select("text").node().getBBox();Nt(this).insert("rect","text").attr("class","em-label-background").attr("x",t.x-5).attr("y",t.y-2).attr("width",t.width+10).attr("height",t.height+4)})}(e,o)}},e.updateClassification=function(){},e.getLegendConstructor=function(){return sw},e};function lM(t,e){var n=t.get(e);if(!n)throw new Error("missing: "+e);return n}var cM=function(t,e){var n,r,i=[],a=e.statData().unitText()||"",o=null!==(n=t.originId)&&void 0!==n?n:t.source.isMidpoint?null:t.source.id,s=null!==(r=t.destId)&&void 0!==r?r:t.target.isMidpoint?null:t.target.id,l=e._nodeById||new Map,c=l.get(o)||{id:o,name:o},u=l.get(s)||{id:s,name:s},h=c.name||c.id,f=u.name||u.id,d="".concat(h," to ").concat(f);return i.push('\n <div class="em-tooltip-bar">\n <b>'.concat(d,"</b>\n </div>\n ")),i.push("\n <div class='em-tooltip-text'>\n <table class=\"em-tooltip-table\">\n <tbody>\n <tr><td>".concat(Ri(t.value)," ").concat(a,"</td></tr>\n </tbody>\n </table>\n </div>\n ")),i.join("")};function uM(t){return Math.sign(t)*t*t}function hM(){var t,e=on(),n=[0,1],r=!1;function i(n){var i=function(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}(e(n));return isNaN(i)?t:r?Math.round(i):i}return i.invert=function(t){return e.invert(uM(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(t){return arguments.length?(e.range((n=Array.from(t,Ze)).map(uM)),i):n.slice()},i.rangeRound=function(t){return i.range(t).round(!0)},i.round=function(t){return arguments.length?(r=!!t,i):r},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(t=e,i):t},i.copy=function(){return hM(e.domain(),n).round(r).clamp(e.clamp()).unknown(t)},Ht.apply(i,arguments),Sn(i)}function fM(t,e){if((i=t.length)>1)for(var n,r,i,a=1,o=t[e[0]],s=o.length;a<i;++a)for(r=o,o=t[e[a]],n=0;n<s;++n)o[n][1]+=o[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function dM(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function pM(t,e){return t[e]}function gM(t){const e=[];return e.key=t,e}var mM=function(t,e){var n=ox(t);if(n.sizeLegend={title:null,titlePadding:15,values:null},n.colorLegend={title:null,titlePadding:15,marginTop:23,labelOffsets:{x:5,y:5},shapeWidth:25,shapeHeight:20,shapePadding:1,noData:!0,noDataText:"No data"},n.timeLegend={title:null,marginTop:20},n._sizeLegendHeight=0,e)for(var r in e)if("colorLegend"===r||"sizeLegend"===r||"timeLegend"===r)for(var i in n[r])void 0!==e[r][i]&&(n[r][i]=e[r][i]);else n[r]=e[r];function a(t,e){var n=t.svg_.selectAll(".em-coxcomb-chart").selectAll("path[code]");n.style("fill","white"),n.filter("path[code='"+e+"']").each(function(){Nt(this).style("fill",Nt(this).attr("fill___"))})}function o(t){t.svg_.selectAll(".em-coxcomb-chart").selectAll("path[code]").each(function(){Nt(this).style("fill",Nt(this).attr("fill___"))})}return n.update=function(){n.updateConfig(),n.updateContainer();var e=n.lgg;e.selectAll("*").remove(),n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle();var r=n.getBaseY(),i=n.getBaseX();if(t.classifierSize_){var s=e.append("g").attr("class","em-coxcomb-size-legend").attr("transform","translate(".concat(i,", ").concat(r,")"));n._sizeLegendContainer=s,Yy(n,s,n.sizeLegend.values,n.map.classifierSize_,n.sizeLegend.title,n.sizeLegend.titlePadding)}!function(t,e,n){var r=t.map,i=t.colorLegend;t._colorLegendContainer=t.lgg.append("g").attr("class","em-coxcomb-color-legend");var s=0;t._sizeLegendContainer?(s=t._sizeLegendContainer.node().getBBox().height,t._colorLegendContainer.attr("transform","translate(".concat(e,",").concat(s+t.colorLegend.marginTop,")"))):t._colorLegendContainer.attr("transform","translate(".concat(e,",").concat(n,")"));i.title&&t._colorLegendContainer.append("text").attr("class","em-color-legend-title").attr("id","em-color-legend-title").attr("x",0).attr("y",t.titleFontSize).text(i.title);var l=0,c=r.catColors(),u=function(e){var n=t.colorLegend.titlePadding+(i.title?t.titleFontSize:0)+l*(i.shapeHeight+i.shapePadding),s=r.catColors()[e]||"lightgray";t._colorLegendContainer.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",n).attr("width",i.shapeWidth).attr("height",i.shapeHeight).style("fill",s).on("mouseover",function(){a(t.map,e),t.map.insetTemplates_&&Wi(t.map.insetTemplates_,t.map.svgId,a,e)}).on("mouseout",function(){o(t.map),t.map.insetTemplates_&&Wi(t.map.insetTemplates_,t.map.svgId,o,e)}),t._colorLegendContainer.append("text").attr("class","em-legend-label").attr("x",i.shapeWidth+i.labelOffsets.x).attr("y",n+.5*i.shapeHeight).attr("dy","0.35em").text(r.catLabels()[e]||e),l++};for(var h in c)u(h);if(i.noData){var f=s+t.colorLegend.marginTop+t.colorLegend.titlePadding+(i.title?t.titleFontSize+t.boxPadding:0)+l*i.shapeHeight+l*i.shapePadding,d=t.lgg.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(t.boxPadding,",").concat(f,")"));t.appendNoDataLegend(d,t.noDataText,a,o)}}(n,i,r),function(e,n,r){var i,a,o=e.map._coxTimes||[],s=40;if(!o.length)return;var l=r,c=n;e._sizeLegendContainer&&(l+=e._sizeLegendContainer.node().getBBox().height);e._colorLegendContainer&&(l+=e._colorLegendContainer.node().getBBox().height,l+=e.colorLegend.marginTop||0);l+=(null===(i=e.timeLegend)||void 0===i?void 0:i.marginTop)||0,l+=s;var u=18,h=2*Math.PI/o.length,f=(null===(a=e._colorLegendContainer)||void 0===a||null===(a=a.node())||void 0===a?void 0:a.getBBox().width)||0,d=c+f/2+u,p=e.lgg.append("g").attr("class","em-coxcomb-time-legend").attr("transform","translate(".concat(d,", ").concat(l+s,")")),g=Hb().innerRadius(0).outerRadius(s).startAngle(function(t,e){return e*h}).endAngle(function(t,e){return(e+1)*h});p.selectAll("path").data(o).join("path").attr("d",function(t,e){return g(t,e)}).attr("fill","#ccc").attr("class","em-coxcomb-legend-time-segment");var m=s+u,v=t._coxTimeLabels?t._coxTimeLabels:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];p.selectAll("text.em-coxcomb-legend-time-label").data(o).join("text").attr("class","em-legend-label em-coxcomb-legend-time-label").attr("x",function(t,e){return Math.sin(e*h+h/2)*m}).attr("y",function(t,e){return-Math.cos(e*h+h/2)*m}).attr("text-anchor","middle").attr("alignment-baseline","middle").text(function(t,e){return v[e]||t}),p.selectAll("path").on("mouseover",function(t,n){var r=n;(e.map.svg_||e.map.svg()).selectAll(".em-coxcomb-chart path").style("opacity",function(t){return t.data.month===r?1:0}),Nt(this).style("stroke-width",3).style("opacity",.8).raise()}).on("mouseout",function(){(e.map.svg_||e.map.svg()).selectAll(".em-coxcomb-chart path").style("opacity",1),Nt(this).style("stroke-width",.5).style("opacity",.4).raise()})}(n,i,r),n.setBoxDimension()},n},vM=function(t){var e=ux(t,!0,"coxcomb");e.coxcombMinRadius_=10,e.coxcombMaxRadius_=80,e.coxcombStrokeFill_="white",e.coxcombStrokeWidth_=.3,e.coxcombRings_=!0,e.hoverColor_="#000",e.catColors_=void 0,e.catLabels_=void 0,e.classifierSize_=null;var n=["catColors_","catLabels_","noDataFillStyle_","coxcombMaxRadius_","coxcombMinRadius_","coxcombRings_","coxcombStrokeFill_","coxcombStrokeWidth_","hoverColor_","classifierSize_"];function r(t){if(!e.statCodes_){e.statCodes_=Object.keys(e.statData_);var n=e.statCodes_.indexOf("default");n>-1&&e.statCodes_.splice(n,1)}var r,i,a,o,s,l,c,u,h,f,d,p;!function(){var t={},n={};e.totalCode_?e._coxTimes.forEach(function(r){var i=e.statData("".concat(r,":").concat(e.totalCode_));if(i&&i._data_)for(var a in i._data_){var o,s=(null===(o=i._data_[a])||void 0===o?void 0:o.value)||0;n[a]=n[a]||{},n[a][r]=s,t[a]=(t[a]||0)+s}}):e._coxTimes.forEach(function(r){var i={};for(var a in e._coxCategoryCodes.forEach(function(t){var n=e.statData("".concat(r,":").concat(t));if(n&&n._data_)for(var a in n._data_){var o,s=(null===(o=n._data_[a])||void 0===o?void 0:o.value)||0;i[a]=(i[a]||0)+s}}),i)n[a]=n[a]||{},n[a][r]=i[a],t[a]=(t[a]||0)+i[a]});e.yearlyTotals=t,e.monthlyTotals=n}(),r=e._coxTimes||[],i=e._coxCategoryCodes||[],a=!!e.totalCode_,o=new Map,s=new Set,l=function(t){var n=e.statData(t);n&&n._data_&&Object.keys(n._data_).forEach(function(t){return s.add(t)})},r.forEach(function(t){a?l("".concat(t,":").concat(e.totalCode_)):i.forEach(function(e){return l("".concat(t,":").concat(e))})}),s.forEach(function(t){var n=!1,s=!1,l=!1;r.forEach(function(r){if(a){var o,c=null===(o=e.statData("".concat(r,":").concat(e.totalCode_)))||void 0===o?void 0:o.get(t);if(!c)return;n=!0,":"===c.value?s=!0:"number"==typeof c.value&&(l=!0)}else i.forEach(function(i){var a,o=null===(a=e.statData("".concat(r,":").concat(i)))||void 0===a?void 0:a.get(t);o&&(n=!0,":"===o.value?s=!0:"number"==typeof o.value&&(l=!0))})}),s?o.set(t,{value:":"}):n||l?o.set(t,{value:0}):o.set(t,null)}),e.coxStatus_=o,c=Object.values(e.yearlyTotals),u=e.coxcombMinRadius_||0,h=e.coxcombMaxRadius_||80,f=Ot(c)||0,d=Dt(c)||0,p=hM().domain([f,d]).range([u,h]),e.classifierChartSize_=function(t,n){var r=p(e.yearlyTotals[n]||0),i=t/Math.max.apply(Math,y(Object.values(e.monthlyTotals[n]||{0:1})));return Math.sqrt(i)*r},e.classifierSize_=p}function i(t){var n=e.yearlyTotals;return void 0!==n[t]?n[t]:void 0}function a(t){if(e.catLabels_=e.catLabels_||{},e.svg_){var n=t.getCentroidsGroup(t);if(n){var r=n.selectAll("g.em-centroid").data().filter(function(t){return void 0!==i(t.properties.id)});!function(t){var n=Hi(t),r=t.svg().selectAll(n),i=e.coxStatus_;"WORLD"!==t.geo_&&("mixed"==t.nutsLevel_&&function(t,n,r){r.style("display",function(t){if(!this.parentNode.classList.contains("em-cntrg"))return null==n.get(t.properties.id)?"none":"block"}),r.style("stroke",function(t){var e=Nt(this),r=e.attr("lvl"),i=n.get(t.properties.id);if(i&&null!=i.value)return"0"!==r?e.style("stroke")||"#777":void 0}).style("stroke-width",function(t){var r=Nt(this),i=r.attr("lvl"),a=n.get(t.properties.id);if(a&&null!=a.value&&"WORLD"!=e.geo_)return"0"!==i?r.style("stroke-width")||1:void 0})}(0,i,r),r.attr("ecl",function(t){var e=i.get(t.properties.id);return null==e?"ni":":"===(null==e?void 0:e.value)?"nd":null}),r.filter(function(t){var e;return":"===(null===(e=i.get(t.properties.id))||void 0===e?void 0:e.value)}).style("fill",e.noDataFillStyle()))}(t),function(t){var n=function(e){var n;return null===(n=t.tooltip_.omitRegions)||void 0===n?void 0:n.includes(e)},r=Hi(t),a=(t.svg().selectAll(r),t.svg().selectAll("g.em-centroid"));a.on("mouseover",function(t,r){if(!n(r.properties.id)&&i(r.properties.id)){var a=Nt(this);a.attr("fill___",a.style("fill")),a.style("fill",e.hoverColor_);var o=e._lastZoomK||1;e.coxcombRings_?a.select("circle.em-coxcomb-max-outline").node().style.setProperty("stroke-width","".concat(2/o,"px"),"important"):a.selectAll("g.em-coxcomb-chart").style("stroke",e.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(r,e))}}).on("mousemove",function(t,r){n(r.properties.id)||i(r.properties.id)&&e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(r,e))}).on("mouseout",function(t,r){if(!n(r.properties.id)&&i(r.properties.id)){var a=Nt(this);a.style("fill",a.attr("fill___")||""),a.attr("fill___",null);var o=e._lastZoomK||1;e.coxcombRings_?a.select("circle.em-coxcomb-max-outline").node().style.setProperty("stroke-width","".concat(.3/o,"px"),"important"):a.selectAll("g.em-coxcomb-chart").style("stroke","#ffffff"),e._tooltip&&e._tooltip.mouseout()}})}(t),function(t,n){var r=e._coxTimes,i=e._coxCategoryCodes,a=function(t){return N_().domain(t).range([0,2*Math.PI]).align(0)}(r);t.forEach(function(t){var o=t.properties.id,s=function(t,n,r){var i=n.map(function(n){var i={month:n},a=0;if(r.forEach(function(r){var o,s=null===(o=e.statData("".concat(n,":").concat(r)))||void 0===o?void 0:o.get(t),l=(null==s?void 0:s.value)||0;i[r]=l,a+=l}),e.totalCode_){var o,s=null===(o=e.statData("".concat(n,":").concat(e.totalCode_)))||void 0===o?void 0:o.get(t),l=(null==s?void 0:s.value)||0,c=l>a?l-a:0;c>0&&(i.other=c)}return Object.values(i).some(function(t){return t&&t>0})?i:null}).filter(Boolean),a=i.some(function(t){return(t.other||0)>0});if(!a){var o,s;i.forEach(function(t){return delete t.other}),null===(o=e.catColors_)||void 0===o||delete o.other,null===(s=e.catLabels_)||void 0===s||delete s.other}return i}(o,r,i);if(s.length){var l=function(t,e){var n=y(e);t.some(function(t){return(t.other||0)>0})&&n.push("other");return n}(s,i),c=function(){var t=cy([]),e=dM,n=fM,r=pM;function i(i){var a,o,s=Array.from(t.apply(this,arguments),gM),l=s.length,c=-1;for(const t of i)for(a=0,++c;a<l;++a)(s[a][c]=[0,+r(t,s[a].key,c,i)]).data=t;for(a=0,o=ub(e(s));a<l;++a)s[o[a]].index=a;return n(s,o),s}return i.keys=function(e){return arguments.length?(t="function"==typeof e?e:cy(Array.from(e)),i):t},i.value=function(t){return arguments.length?(r="function"==typeof t?t:cy(+t),i):r},i.order=function(t){return arguments.length?(e=null==t?dM:"function"==typeof t?t:cy(Array.from(t)),i):e},i.offset=function(t){return arguments.length?(n=null==t?fM:t,i):n},i}().keys(l);!function(t,n,r,i,a){var o=a.svg().select("#ps"+t);if(o.empty())return;var s=o.selectAll("g.em-coxcomb").data([t],function(t){return t}).join(function(e){return e.append("g").attr("class","em-coxcomb").attr("id","cox_"+t)},function(t){return t},function(t){return t.remove()});if(s.selectAll("*").remove(),e.coxcombRings_){var l=e.yearlyTotals[t]||0,c=e.classifierSize_(l);s.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(e.transitionDuration_/2).attr("r",c)}var u=Hb().startAngle(function(t){return i(t.data.month)}).endAngle(function(t){return i(t.data.month)+i.bandwidth()}).padAngle(.01).padRadius(0);r.forEach(function(r,i){s.append("g").attr("class","em-coxcomb-chart").attr("stroke","#ffffff").attr("stroke-width",.3).selectAll("path").data(n[i]).join("path").attr("fill",e.catColors_[r]||("other"===r?"#FFCC80":"lightgray")).attr("code",r).attr("month",function(t){return t.data.month}).transition().delay(function(t,e){return 120*e}).duration(e.transitionDuration_).attrTween("d",function(n){var r=Xe(0,e.classifierChartSize_(n[0],t)),i=Xe(0,e.classifierChartSize_(n[1],t));return function(t){return u.innerRadius(r(t)).outerRadius(i(t))(n)}})})}(o,c(s),l,a,n)}})}(r,t)}}}return n.forEach(function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}}),t&&n.forEach(function(n){var r=n.slice(0,-1);null!=t[r]&&e[r](t[r])}),e.statCodes_=void 0,e.totalCode_=void 0,e.statCoxcomb=function(t){return e._coxTimes=t.times,e._coxCategoryCodes=y(t.categoryCodes),e._coxTimeLabels=t.timeLabels,t.filters=t.filters||{},t.times.forEach(function(n){if(t.categoryCodes.forEach(function(r){t.stat.filters[t.timeParameter]=n,t.stat.filters[t.categoryParameter]=r;var i={};for(var a in t.stat)i[a]=t.stat[a];for(var o in i.filters={},t.stat.filters)i.filters[o]=t.stat.filters[o];var s="".concat(n,":").concat(r);e.stat(s,i),t.categoryColors&&(e.catColors_=e.catColors_||{},e.catColors_[r]=t.categoryColors[t.categoryCodes.indexOf(r)]),t.categoryLabels&&(e.catLabels_=e.catLabels_||{},e.catLabels_[r]=t.categoryLabels[t.categoryCodes.indexOf(r)])}),t.totalCode){t.stat.filters[t.timeParameter]=n,t.stat.filters[t.categoryParameter]=t.totalCode;var r={};for(var i in t.stat)r[i]=t.stat[i];for(var a in r.filters={},t.stat.filters)r.filters[a]=t.stat.filters[a];var o="".concat(n,":").concat(t.totalCode);e.stat(o,r)}}),t.totalCode&&(e.totalCode_=t.totalCode,e.catColors_.other="#FFCC80",e.catLabels_.other="Other"),e},e.updateClassification=function(){return e.insetTemplates_&&Wi(e.insetTemplates_,e.svgId_,r),r(),e},e.updateStyle=function(){if(!e.catColors_){e.catColors({});for(var t=0;t<e.statCodes_.length;t++)e.catColors_[e.statCodes_[t]]=Vb[t%10]}try{return e.insetTemplates_&&Wi(e.insetTemplates_,e.svgId_,a),a(e),e.dorling_?Bx(e,function(t){var n=i(t.properties.id)||0;return e.classifierSize_(n)||0}):qx(e),e}catch(t){console.error("Error in updateStyle:",t.message),console.error(t)}return e},e.getLegendConstructor=function(){return mM},e.tooltip_.textFunction=function(t,n){var r,i=t.properties.na||t.properties.name,a=t.properties.id,o=e._coxTimes||[],s=y(e._coxCategoryCodes),l=o.some(function(t){var n,r=(null===(n=e.statData("".concat(t,":").concat(e.totalCode_)))||void 0===n||null===(n=n.get(a))||void 0===n?void 0:n.value)||0,i=e._coxCategoryCodes.reduce(function(n,r){var i;return n+((null===(i=e.statData("".concat(t,":").concat(r)))||void 0===i||null===(i=i.get(a))||void 0===i?void 0:i.value)||0)},0);return r>i});l&&s.push("other");var c='<div class="em-tooltip-bar">'.concat(i).concat(a?" (".concat(a,")"):"","</div>"),u=['<th class="em-breakdown-label">Month</th>'];s.forEach(function(t){var n=e.catLabels_[t]||t,r=e.catColors_[t]||("other"===t?"#FFCC80":"#999");u.push('<th class="em-breakdown-label" style="color:'.concat(r,'">').concat(n,"</th>"))}),u.push('<th class="em-breakdown-label">Total</th>');var h="<tr>".concat(u.join(""),"</tr>"),f=e.yearlyTotals||{},d=e.monthlyTotals||{},p=f[a]||0,g=o.map(function(t,n){var r,i=['<td class="em-breakdown-label">'.concat(e._coxTimeLabels?e._coxTimeLabels[n]:t,"</td>")],o=(null===(r=d[a])||void 0===r?void 0:r[t])||0;return s.forEach(function(n){var r=0;if("other"===n){var o,l=(null===(o=e.statData("".concat(t,":").concat(e.totalCode_)))||void 0===o||null===(o=o.get(a))||void 0===o?void 0:o.value)||0,c=s.filter(function(t){return"other"!==t}).reduce(function(n,r){var i;return n+((null===(i=e.statData("".concat(t,":").concat(r)))||void 0===i||null===(i=i.get(a))||void 0===i?void 0:i.value)||0)},0);r=Math.max(l-c,0)}else{var u;r=(null===(u=e.statData("".concat(t,":").concat(n)))||void 0===u||null===(u=u.get(a))||void 0===u?void 0:u.value)||0}i.push(r>0?'<td><span class="em-breakdown-value">'.concat(Ri(r),"</span></td>"):"<td></td>")}),i.push(o>0?'<td><span class="em-breakdown-value">'.concat(Ri(o),"</span></td>"):"<td></td>"),"<tr>".concat(i.join(""),"</tr>")}),m=(null===(r=e.statData(e.statCodes_[0]))||void 0===r?void 0:r.unitText())||"";return c+='<div class="em-tooltip-breakdown em-tooltip-cx"><table class="em-tooltip-cx-table">',c+=h+g.join(""),p>0&&(c+='\n <tr class="em-total">\n <td class="em-breakdown-label">Year total</td>\n <td colspan="'.concat(s.length,'"></td>\n <td>\n <span class="em-breakdown-value">').concat(Ri(p)," ").concat(m,"</span>\n </td>\n </tr>")),c+="</table></div>"},e};function _M(t,e){!function(t,e){var n=t.svg().selectAll("g.em-centroid");n.on("mouseover",function(n,r){Nt(this).selectAll("path").each(function(){var t=Nt(this);t.attr("fill___",t.style("fill")),t.attr("stroke___",t.style("stroke")),t.attr("sw___",t.style("stroke-width")),t.style("fill",e.hoverColor_),t.style("stroke","black"),t.style("stroke-width",1)}),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(r,e)),e.onRegionMouseOver_&&e.onRegionMouseOver_(n,r,this,t)}).on("mousemove",function(n,r){e._tooltip&&e._tooltip.mousemove(n),e.onRegionMouseMove_&&e.onRegionMouseMove_(n,r,this,t)}).on("mouseout",function(n,r){Nt(this).selectAll("path").each(function(){var t=Nt(this),e=t.attr("fill___");e&&t.style("fill",e);var n=t.attr("sw___"),r=t.attr("stroke___");r&&t.style("stroke",r),n&&t.style("stroke-width",n)}),e._tooltip&&e._tooltip.mouseout(),e.onRegionMouseOut_&&e.onRegionMouseOut_(n,r,this,t)})}(t,e),function(t,e){var n=t.svg().selectAll(Hi(t));n.on("mouseover",function(n,r){Nt(this).style("fill",t.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(r,e)),e.onRegionMouseOver_&&e.onRegionMouseOver_(n,r,this,t)}).on("mousemove",function(n,r){e._tooltip&&e._tooltip.mousemove(n),e.onRegionMouseMove_&&e.onRegionMouseMove_(n,r,this,t)}).on("mouseout",function(n,r){var i=Nt(this);i.style("fill",i.attr("fill___")),e._tooltip&&e._tooltip.mouseout(),e.onRegionMouseOut_&&e.onRegionMouseOut_(n,r,this,t)})}(t,e)}var yM=function(t,e){var n=ox(t);return n.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}},n.colorLegend={marginTop:5,labelOffsets:{x:5,y:5}},null!=e&&e.sizeLegend&&Object.assign(n.sizeLegend,e.sizeLegend),null!=e&&e.colorLegend&&Object.assign(n.colorLegend,e.colorLegend),n.update=function(){if(n.updateConfig(),n.updateContainer(),n.lgg.node()){n.lgg.selectAll("*").remove(),n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle();var t=n.getBaseX(),e=n.getBaseY()+n.sizeLegend.marginTop,r=n.map.mushroomSizeScaleFunctionV1_&&n.map.mushroomSizeScaleFunctionV2_;if(r){var i=bM(n,t,e,"v1");xM(n,t,i.bottom+5,"v1"),e=i.bottom;var a=bM(n,t,e,"v2");xM(n,t,a.top+30,"v2")}else e=bM(n,t,e);r||function(t,e,n){var r,i,a,o=t.map,s=o.mushroomColors(),l=o.mushroomCodes(),c=_(l,2),u=c[0],h=c[1],f=null!==(r=t.colorLegend.labels)&&void 0!==r?r:[(null===(i=o.statData(u))||void 0===i?void 0:i.label_)||u,(null===(a=o.statData(h))||void 0===a?void 0:a.label_)||h],d=t.lgg.append("g").attr("class","em-mushroom-color-legend").attr("transform","translate(".concat(e,", ").concat(n,")"));f.forEach(function(e,n){var r=d.append("g").attr("transform","translate(0, ".concat(n*t.shapeHeight,")")).style("cursor","pointer").on("mouseover",function(){wM(o,n),o.insetTemplates_&&executeForAllInsets(o.insetTemplates_,o.svgId_,wM,n)}).on("mouseout",function(){MM(o),o.insetTemplates_&&executeForAllInsets(o.insetTemplates_,o.svgId_,MM)});r.append("rect").attr("width",t.shapeWidth).attr("height",t.shapeHeight).attr("fill",s[n]).attr("class","em-legend-rect"),r.append("text").attr("x",t.shapeWidth+t.colorLegend.labelOffsets.x).attr("y",t.shapeHeight/2+t.colorLegend.labelOffsets.y).attr("class","em-legend-label").text(e)})}(n,t,e+n.colorLegend.marginTop),n.setBoxDimension()}},n};function xM(t,e,n,r){var i,a,o=t.map,s=o.mushroomColors(),l=_(o.mushroomCodes(),2),c=l[0],u=l[1],h="v1"===r?(null===(i=o.statData(c))||void 0===i?void 0:i.label_)||c:(null===(a=o.statData(u))||void 0===a?void 0:a.label_)||u,f="v1"===r?s[0]:s[1];return t.lgg.append("text").attr("x",e).attr("y",n).style("fill",f).attr("font-weight","600").attr("dominant-baseline","hanging").attr("class","em-legend-label").text(h).node().getBBox()}function bM(t,e,n){var r,i,a,o,s,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,c=t.map,u=t.sizeLegend,h=c._mushroomScale_,f=c.mushroomSizeScaleFunctionV1_,d=c.mushroomSizeScaleFunctionV2_,p=f&&d,g=null;if("v1"===l?(s=f,g=0):"v2"===l?(s=d,g=1):s=h,!s)return n;var m=c.mushroomOrientation(),v=Hb().innerRadius(0),_=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("vertical"===t)return 0===e?{start:-Math.PI/2,end:Math.PI/2}:1===e?{start:Math.PI/2,end:3*Math.PI/2}:{start:-Math.PI/2,end:Math.PI/2};if(0===e)return{start:Math.PI,end:2*Math.PI};if(1===e)return{start:0,end:Math.PI};return{start:Math.PI,end:2*Math.PI}}(m,g),x=null!==(r=null===(i=u.labelOffsets)||void 0===i?void 0:i.x)&&void 0!==r?r:8,b=u.shapeStroke||"#000000",w=null!==(a=u.shapeStrokeWidth)&&void 0!==a?a:1,M=function(t,e,n,r){var i;n?"v1"===r?i=t.valuesV1:"v2"===r&&(i=t.valuesV2):i=t.values;if(!i||!i.length){var a,o=null===(a=e.domain)||void 0===a?void 0:a.call(e);return!o||o.length<2?null:[Math.min(o[0],o[o.length-1]),Math.max(o[0],o[o.length-1])]}var s=Math.min.apply(Math,y(i)),l=Math.max.apply(Math,y(i));return i.length>1?[l,s]:[i[0]]}(u,s,p,l);if(!M)return n;var S=y(M).sort(function(t,e){return s(e)-s(t)}),C=S.map(function(t){return s(t)}),E=Math.max.apply(Math,y(C));if(!Number.isFinite(E)||E<=0)return n;var k=function(t,e,n,r){var i;n?"v1"===r?i=t.labelsV1:"v2"===r&&(i=t.labelsV2):i=t.labels;return i&&i.length>=e.length?i:null}(u,S,p,l),A=t.lgg.append("g").attr("class","em-mushroom-size-legend").attr("transform","translate(".concat(e,",").concat(n,")")),T=E,P=E,F=c.mushroomColors(),L=p&&null!=g?F[g]:"none";S.forEach(function(t,e){var n=s(t);if(n&&!(n<=0)){var r=A.append("g").attr("transform","translate(".concat(T,",").concat(P,")"));r.append("path").attr("d",v({startAngle:_.start,endAngle:_.end,outerRadius:n})).style("fill",L).attr("stroke",b).attr("stroke-width",w).attr("data-mushroom-side",g);var i="vertical"===m&&1===g?n:-n,a=E+x;"horizontal"===m&&(a=10+x),r.append("line").attr("x1",0).attr("x2",a).attr("y1",i).attr("y2",i).attr("stroke",b).attr("stroke-width",.6).attr("stroke-dasharray","3,2"),r.append("text").attr("x",a+3).attr("y",i).attr("dy","0.35em").attr("dominant-baseline","middle").attr("class","em-legend-label").text(k?k[e]:Ri(t))}});var N=null===(o=A.node())||void 0===o?void 0:o.getBBox();return N?{top:n,bottom:n+N.height}:{top:n,bottom:n}}function wM(t,e){t.svg().selectAll("g.em-centroid path[data-mushroom-side]").style("opacity",function(){return this.getAttribute("data-mushroom-side")===String(e)?1:0})}function MM(t){t.svg().selectAll("g.em-centroid path[data-mushroom-side]").style("opacity",null)}function SM(t){if(t.svg()&&(t._mushroomScale_||t.mushroomSizeScaleFunctionV1_||t.mushroomSizeScaleFunctionV2_)){t.mushroomSizeScaleFunctionV1_&&t.mushroomSizeScaleFunctionV2_;var e=_(t.mushroomCodes(),2),n=e[0],r=e[1],i=t.mushroomColors(),a=t.mushroomOrientation_,o=t.statData(n),s=t.statData(r),l=Hb().innerRadius(0),c=t.svg().selectAll("g.em-centroid");c.selectAll("*").remove(),c.each(function(e){var n,r,c=e.properties.id,u=+(null===(n=o.get(c))||void 0===n?void 0:n.value)||0,h=+(null===(r=s.get(c))||void 0===r?void 0:r.value)||0;if(0!==u||0!==h){var f,d;t.mushroomSizeScaleFunctionV1_&&t.mushroomSizeScaleFunctionV2_?(f=t.mushroomSizeScaleFunctionV1_(u),d=t.mushroomSizeScaleFunctionV2_(h)):(f=t._mushroomScale_(u),d=t._mushroomScale_(h));var p=Nt(this);"vertical"===a?(p.append("path").attr("d",l({startAngle:-Math.PI/2,endAngle:Math.PI/2,outerRadius:f})).attr("fill",i[0]).attr("class","em-mushroom-segment").attr("data-mushroom-side","0"),p.append("path").attr("d",l({startAngle:Math.PI/2,endAngle:3*Math.PI/2,outerRadius:d})).attr("fill",i[1]).attr("class","em-mushroom-segment").attr("data-mushroom-side","1")):(p.append("path").attr("d",l({startAngle:Math.PI,endAngle:2*Math.PI,outerRadius:f})).attr("fill",i[0]).attr("class","em-mushroom-segment").attr("data-mushroom-side","0"),p.append("path").attr("d",l({startAngle:0,endAngle:Math.PI,outerRadius:d})).attr("fill",i[1]).attr("class","em-mushroom-segment").attr("data-mushroom-side","1"))}}),_M(t,t)}}var CM=function(t,e){var n,r,i,a,o=_(e.mushroomCodes(),2),s=o[0],l=o[1],c=t.properties.id,u=t.properties.na||"",h=e.statData(s).get(c),f=e.statData(l).get(c),d=(null===(n=(r=e.statData(s)).unitText)||void 0===n?void 0:n.call(r))||"",p=(null===(i=(a=e.statData(l)).unitText)||void 0===i?void 0:i.call(a))||"",g=function(t,n){return":"===t||null==t?e.noDataText_||"No data":Ri(t)+(n?" "+n:"")};return'\n <div class="em-tooltip-bar">\n '.concat(u).concat(c?" (".concat(c,")"):"",'\n </div>\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>').concat(e.statData(s).label_||"","</td>\n <td>").concat(g(null==h?void 0:h.value,d),"</td>\n </tr>\n <tr>\n <td>").concat(e.statData(l).label_||"","</td>\n <td>").concat(g(null==f?void 0:f.value,p),"</td>\n </tr>\n </tbody>\n </table>\n </div>\n ").trim()};var EM=function(t,e){try{return"choropleth"==t||"ch"==t?dx(e):"categorical"==t||"ct"==t?function(t){var e=ux(t,!1,"ct");e.classToFillStyle_=void 0,e.classToText_=void 0,e.tooltip_.textFunction=cb,e.classifier_=void 0;var n=["classToFillStyle_","classToText_","noDataFillStyle_","tooltipText_","classifier_"];n.forEach(function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}}),t&&n.forEach(function(n){var r=n.slice(0,-1);null!=t[r]&&e[r](t[r])}),e.updateClassification=function(){return e.insetTemplates_&&Wi(e.insetTemplates_,e.svgId_,r),r(e),e};var r=function(t){var n=e.statData().getUniqueValues(),r=y(Array(n.length).keys()),i=e.classToFillStyle_?e.classToFillStyle():void 0;if(i){var a=Object.keys(i);e.classifier(L_().domain(a).range(a.map(function(t,e){return e})))}else e.classifier(L_().domain(n).range(r));var o=function(t){t.attr("ecl",function(t){var n=e.statData().get(t.properties.id);if(n){var r=n.value;if(":"===r)return"nd";var i=isNaN(r)?r:+r;if(e.classifier().domain().includes(i))return e.classifier()(i)}})},s=Hi(t);o(t.svg().selectAll(s)),"mixed"===t.nutsLevel_&&o(t.svg().selectAll("path.em-nutsrg0"))};function i(t){if(t.svg_){var n=Hi(t),r=t.svg().selectAll(n);r.style("pointer-events","none").transition().duration(e.transitionDuration()).style("fill",o).end().then(function(){r.style("pointer-events",null),r.each(function(){var t=Nt(this);t.attr("fill___",t.style("fill"))}),s(t,r),e.gridCartogram_&&t.svg().selectAll(".em-grid-text").each(function(){var t=Nt(this.parentNode).style("fill");Nt(this).attr("fill",Ui(t))})}).catch(function(t){}),"mixed"===e.nutsLevel_&&a(t),e.labels_&&e.labels_.values&&e.updateValuesLabels(t),e.patternFill_&&fx(t,e.patternFill_)}}e.updateStyle=function(){if(!e.classToFillStyle()){for(var t={},n=e.classifier().domain(),r=0;r<n.length;r++)t[n[r]]=sb[r%12];e.classToFillStyle(t)}return e.insetTemplates_&&Wi(e.insetTemplates_,e.svgId_,i),i(e),e};var a=function(t){t.svg().selectAll(Hi(t)).style("display",function(t){if(!this.parentNode.classList.contains("em-cntrg")){var e=Nt(this),n=e.attr("ecl"),r=e.attr("lvl");return n||"0"===r?"block":"none"}}).style("stroke",function(){var t=Nt(this),e=t.attr("lvl"),n=t.attr("ecl"),r=t.style("stroke");return n&&"0"!==e?r||"#777":null}).style("stroke-width",function(){var t=Nt(this),e=t.attr("lvl"),n=t.attr("ecl"),r=t.style("stroke-width");return n&&"0"!==e?r||.2:null})},o=function(t){var n=Nt(this).attr("ecl");return e.Geometries.userGeometries?n?"nd"===n?e.noDataFillStyle()||"gray":e.classToFillStyle_[e.classifier().domain()[n]]:Ii("em-nutsrg","fill"):"WORLD"===e.geo_?n?"nd"===n?e.noDataFillStyle()||"gray":e.classToFillStyle_[e.classifier().domain()[n]]||e.cntrgFillStyle_:e.cntrgFillStyle_:(t.properties.id.slice(0,2),n?"nd"===n?e.noDataFillStyle()||"gray":e.classToFillStyle_[e.classifier().domain()[n]]:Ii("em-nutsrg","fill"))},s=function(t,n){var r=function(e){var n;return null===(n=t.tooltip_.omitRegions)||void 0===n?void 0:n.includes(e)};n.on("mouseover",function(n,i){r(i.properties.id)||(Nt(this).style("fill",t.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(i,e)),e.onRegionMouseOver_&&e.onRegionMouseOver_(n,i,this,t))}).on("mousemove",function(n,i){r(i.properties.id)||(e._tooltip&&e._tooltip.mousemove(n),e.onRegionMouseMove_&&e.onRegionMouseMove_(n,i,this,t))}).on("mouseout",function(n,i){if(!r(i.properties.id)){var a=Nt(this);a.style("fill",a.attr("fill___")),e._tooltip&&e._tooltip.mouseout(),e.onRegionMouseOut_&&e.onRegionMouseOut_(n,i,this,t)}})};return e.getLegendConstructor=function(){return lb},e}(e):"proportionalSymbol"==t||"proportionalSymbols"==t||"ps"==t?rb(e):"bivariateChoropleth"==t||"chbi"==t?function(t){var e=ux(t,!1,"chbi");e.numberOfClasses_=3,e.startColor_="#e8e8e8",e.color1_="#73ae80",e.color2_="#6c83b5",e.endColor_="#2a5a5b",e.classToFillStyle_=void 0,e.classifier1_=void 0,e.classifier2_=void 0,e.breaks1_=void 0,e.breaks2_=void 0,e.tooltip_.textFunction=_b;var n=["numberOfClasses_","breaks1_","breaks2_","startColor_","color1_","color2_","endColor_","classToFillStyle_","noDataFillStyle_","classifier1_","classifier2_"].forEach(function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}});function r(t){var n=function(t){t.attr("ecl1",function(t){var n=e.statData("v1").get(t.properties.id);if(n){var r=n.value;return 0!=r&&!r||":"==r?"nd":+e.classifier1_(+r)}}).attr("ecl2",function(t){var n=e.statData("v2").get(t.properties.id);if(n){var r=n.value;return 0!=r&&!r||":"==r?"nd":+e.classifier2_(+r)}}).attr("nd",function(t){var n=e.statData("v1").get(t.properties.id),r=e.statData("v2").get(t.properties.id);if(n||r){var i=null==n?void 0:n.value;return 0!=i&&!i||":"==i||0!=(i=null==r?void 0:r.value)&&!i||":"==i?"nd":void 0}})};if(function(){var t=e.statData("v1").getArray(),n=e.statData("v2").getArray(),r=y(Array(e.numberOfClasses()).keys());if(e.classifier1_||(e.breaks1_?e.classifier1(kn().domain(e.breaks1_).range(r)):e.classifier1(Vt().domain(t).range(r))),e.classifier2_||(e.breaks2_?e.classifier2(kn().domain(e.breaks2_).range(r)):e.classifier2(Vt().domain(n).range(r))),!e.classToFillStyle_){var i=vb(e.numberOfClasses(),e.startColor(),e.color1(),e.color2(),e.endColor());e.classToFillStyle(i)}}(),t.svg_){var r=Hi(t);n(t.svg().selectAll(r)),"mixed"===t.nutsLevel_&&n(t.svg().selectAll("path.em-nutsrg0"))}}function i(t){if(t.svg()){var n=Hi(t),r=t.svg().selectAll(n);r.style("pointer-events","none").transition().duration(e.transitionDuration()).style("fill",function(t){if(Nt(this).attr("nd"))return e.noDataFillStyle()||"gray";var n=Nt(this).attr("ecl1"),r=Nt(this).attr("ecl2");return n||r?"nd"===r?e.noDataFillStyle()||"gray":e.classToFillStyle_(+n,+r):Ii("em-nutsrg","fill")}).end().then(function(){r.style("pointer-events",null),r.each(function(){var t=Nt(this);t.attr("fill___",t.style("fill"))}),o(t,r),e.gridCartogram_&&t.svg().selectAll(".em-grid-text").each(function(){var t=Nt(this.parentNode).style("fill");Nt(this).attr("fill",Ui(t))})},function(t){}),"mixed"==e.nutsLevel_&&a(t)}}t&&n.forEach(function(n){var r=n.slice(0,-1);null!=t[r]&&e[n](t[r])}),e.updateClassification=function(){return e.insetTemplates_&&Wi(e.insetTemplates_,e.svgId_,r),r(e),e},e.updateStyle=function(){return e.insetTemplates_&&Wi(e.insetTemplates_,e.svgId_,i),i(e),e};var a=function(t){t.svg().selectAll(Hi(t)).each(function(){if(!this.parentNode.classList.contains("em-cntrg")){var t=Nt(this),e=t.attr("ecl1"),n=t.attr("ecl2"),r=t.attr("lvl"),i=e||n||"0"===r;if(t.style("display",i?"block":"none"),(e||n)&&"0"!==r){var a=t.style("stroke")||"#777",o=t.style("stroke-width")||.2;t.style("stroke",a).style("stroke-width",o)}}})},o=function(t,n){var r=function(e){var n;return null===(n=t.tooltip_.omitRegions)||void 0===n?void 0:n.includes(e)};n.on("mouseover",function(n,i){var a;r(i.properties.id)||(Nt(this).style("fill",t.hoverColor_),null===(a=e._tooltip)||void 0===a||a.mouseover(e.tooltip_.textFunction(i,e)),e.onRegionMouseOver_&&e.onRegionMouseOver_(n,i,this,t))}).on("mousemove",function(n,i){var a;r(i.properties.id)||(null===(a=e._tooltip)||void 0===a||a.mousemove(n),e.onRegionMouseMove_&&e.onRegionMouseMove_(n,i,this,t))}).on("mouseout",function(n,i){if(!r(i.properties.id)){var a,o=Nt(this),s=o.attr("fill___");s&&(o.style("fill",s),null===(a=e._tooltip)||void 0===a||a.mouseout()),e.onRegionMouseOut_&&e.onRegionMouseOut_(n,i,this,t)}})};return e.getLegendConstructor=function(){return mb},e}(e):"trivariateChoropleth"==t||"ternary"==t?Ob(e):"stripeComposition"==t||"scomp"==t?function(t){var e=ux(t,!1,"scomp");e.stripeWidth_=50,e.stripeOrientation_=0,e.catColors_=void 0,e.catLabels_=void 0,e.showOnlyWhenComplete_=!1,e.pieChartRadius_=40,e.pieChartInnerRadius_=15;var n=["stripeWidth_","stripeOrientation_","catColors_","catLabels_","showOnlyWhenComplete_","noDataFillStyle_","pieChartRadius_","pieChartInnerRadius_"];n.forEach(function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}}),t&&n.forEach(function(n){var r=n.slice(0,-1);null!=t[r]&&e[r](t[r])}),e.statComp=function(t,n,i,a,o){t.filters=t.filters||{};for(var s=0;s<i.length;s++){var l=i[s];t.filters[n]=l;var c={};for(var u in t)c[u]=t[u];for(var h in c.filters={},t.filters)c.filters[h]=t.filters[h];e.stat(l,c),o&&(e.catColors_=e.catColors_||{},e.catColors_[l]=o[s]),a&&(e.catLabels_=e.catLabels_||{},e.catLabels_[l]=a[s])}return r=i,e};var r=void 0,i=function(t){for(var n={},i=0,a=0;a<r.length;a++){var o=r[a],s=e.statData(o).get(t);if(!s||0!=s.value&&!s.value||isNaN(s.value)){if(e.showOnlyWhenComplete())return}else n[o]=s.value,i+=s.value}if(0!=i){for(var l=0;l<r.length;l++)n[r[l]]/=i;return n}};return e.updateClassification=function(){if(!r){var t=(r=Object.keys(e.statData_)).indexOf("default");t>-1&&r.splice(t,1)}return e},e.updateStyle=function(){if(!e.catColors()){e.catColors({});for(var t=0;t<r.length;t++)e.catColors()[r[t]]=Vb[t%10]}e.catLabels_=e.catLabels_||{},e.svg().selectAll(Hi(e)).style("fill",function(t){if(!this.parentNode.classList.contains("em-cntrg")){var n=t.properties.id,r=i(n);if(!r)return e.noDataFillStyle()||"gray";var a=e.svg().append("pattern").attr("id","pattern_"+n).attr("x","0").attr("y","0").attr("width",e.stripeWidth()).attr("height",1).attr("patternUnits","userSpaceOnUse");e.stripeOrientation()&&a.attr("patternTransform","rotate("+e.stripeOrientation()+")"),a.append("rect").attr("x",0).attr("y",0).attr("width",e.stripeWidth()).attr("height",1).style("stroke","none").style("fill","lightgray");var o=0;for(var s in r){var l=r[s];if(l){l*=e.stripeWidth();var c=e.catColors()[s]||"lightgray";a.append("rect").attr("x",o).attr("y",0).attr("height",1).style("stroke","none").attr("code",s).style("fill",c).style("pointer-events","none").transition().duration(e.transitionDuration()).on("end",function(){Nt(this).style("pointer-events",null)}).attr("width",l),o+=l}}return"url(#pattern_"+n+")"}}).attr("nd",function(t){return i(t.properties.id)?"":"nd"});var n=Hi(e);return e.svg().selectAll(n).on("mouseover",function(t,n){var r=Nt(this);r.attr("fill___",r.style("fill")),r.style("fill",e.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(n,e))}).on("mousemove",function(t,n){e._tooltip&&e._tooltip.mousemove(t)}).on("mouseout",function(){var t=Nt(this);t.style("fill"),t.attr("fill___")&&(t.style("fill",t.attr("fill___")),e._tooltip&&e._tooltip.mouseout())}),e},e.getLegendConstructor=function(){return Yb},e.tooltip_.textFunction=function(t,n){var r=t.properties.na||t.properties.name,a=t.properties.id,o=i(a),s=[];for(var l in o)s.push({code:l,value:o[l]});var c="";if(c+='<div class="em-tooltip-bar">\n <b>'.concat(r,"</b>").concat(a?" (".concat(a,")"):"","\n </div>"),!s||0===s.length)return c+"<div>".concat(e.noDataText(),"</div>");var u,h=e.pieChartRadius(),f=e.pieChartInnerRadius(),d=Gb().sort(null).value(function(t){return t.value}),p=Hb().innerRadius(f).outerRadius(h),g="",m=$b(d(s));try{for(m.s();!(u=m.n()).done;){var v=u.value,_=e.catColors()[v.data.code]||"lightgray",y=p(v);g+='<path d="'.concat(y,'" fill="').concat(_,'" stroke="darkgray"></path>')}}catch(t){m.e(t)}finally{m.f()}return c+'\n <div style="display: flex; justify-content: center;">\n <svg viewBox="'.concat(-h," ").concat(-h," ").concat(2*h," ").concat(2*h,'" width="').concat(2*h,'">\n <g>').concat(g,"</g>\n </svg>\n </div>\n ")},e}(e):"pieChart"==t||"pie"==t?tw(e):"sparkline"==t||"spark"==t||"sparklines"==t?rw(e):"flow"==t||"flowmap"==t?sM(e):"coxcomb"==t||"polar"==t?vM(e):"alpha"==t||"valueByAlpha"==t?function(t){var e=dx(t);e.alphaData_=null,e.opacityScale_=null,e.opacityScale=function(t){return arguments.length?(e.opacityScale_=t,e):e.opacityScale_};var n=e.updateStatValues;e.updateStatValues=function(){var t=e.statData("alpha");if(!t||!t.isReady())return e.alphaData_=null,e;e.alphaData_=t;var r=t.getArray().filter(function(t){return null!=t&&":"!==t&&!isNaN(+t)});if(!e.opacityScale_){var i=Ot(r),a=Dt(r);e.opacityScale_=r.length>0?Cn().domain([i,a]).range([.1,1]):null}return n.call(e),e.updateStyle()};var r=e.updateStyle;return e.updateStyle=function(){if(!e.svg_||!e.opacityScale_)return e;e.svg_.classed("em--alpha",!0);var t=e.statData();if(!t||!t.isReady())return e;var n=e.statData("alpha");if(!n||!n.isReady())return e;var i=Hi(e);return e.svg().selectAll(i).each(function(r){var i,a,o=Nt(this),s=null===(i=t.get(r.properties.id))||void 0===i?void 0:i.value,l=null===(a=n.get(r.properties.id))||void 0===a?void 0:a.value;if(null!=s&&":"!==s)if("nd"!==l&&null!=l)o.style("opacity",e.opacityScale_(+l));else{var c=e.noDataFillStyle_||"gray";o.attr("ecl","nd").attr("force-grey","1").style("fill",c).attr("fill","grey").attr("fill___",c).style("opacity",1)}}),r.call(e),e},e.getLegendConstructor=function(){return iy},e.tooltip_.textFunction=function(t,e){var n,r,i=[],a=t.properties.na||t.properties.name,o=t.properties.id;i.push('<div class="em-tooltip-bar"><b>'.concat(a,"</b>").concat(o?" (".concat(o,")"):"","</div>"));var s=e.statData(),l=e.alphaData_||e.statData("alpha"),c=s.get(o),u=null==l?void 0:l.get(o),h=(null===(n=s.unitText)||void 0===n?void 0:n.call(s))||"",f=(null==l||null===(r=l.unitText)||void 0===r?void 0:r.call(l))||"",d=s.label_?s.label_+": ":"",p=null!=l&&l.label_?(null==l?void 0:l.label_)+": ":"";return!c||0!==c.value&&!c.value||":"===c.value?(i.push('\n <div class="em-tooltip-text no-data">\n <table class="em-tooltip-table">\n <tbody>\n <tr><td>'.concat(e.noDataText_,"</td></tr>\n </tbody>\n </table>\n </div>\n ")),i.join("")):(i.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>'.concat(d).concat(Ri(c.value)," ").concat(h,"</td>\n </tr>\n <tr>\n <td>").concat(u&&":"!==u.value&&null!=u.value?"".concat(p).concat(Ri(u.value)," ").concat(f):"".concat(p).concat(e.noDataText_),"</td>\n </tr>\n </tbody>\n </table>\n </div>\n")),i.join(""))},e}(e):"mushroom"==t?function(t){var e=ux(t,!0,"mushroom");e.mushroomCodes_=["v1","v2"],e.mushroomMinSize_=4,e.mushroomMaxSize_=30,e.mushroomColors_=["#2c7bb6","#d7191c"],e.mushroomOrientation_="vertical",e.mushroomSizeScaleFunction_=null,e.mushroomSizeScaleFunctionV1_=null,e.mushroomSizeScaleFunctionV2_=null,e._mushroomScale_=null,e.tooltip_.textFunction=CM;var n=["mushroomCodes_","mushroomMinSize_","mushroomMaxSize_","mushroomColors_","mushroomOrientation_","mushroomSizeScaleFunction_","mushroomSizeScaleFunctionV1_","mushroomSizeScaleFunctionV2_"];return n.forEach(function(t){var n=t.slice(0,-1);e[n]=function(n){return arguments.length?(e[t]=n,e):e[t]}}),t&&n.forEach(function(n){var r=n.slice(0,-1);void 0!==t[r]&&e[r](t[r])}),e.updateClassification=function(){if(e.mushroomSizeScaleFunction_)e._mushroomScale_=e.mushroomSizeScaleFunction_;else if(!e.mushroomSizeScaleFunctionV1_||!e.mushroomSizeScaleFunctionV2_){e._mushroomScale_=null;var t=_(e.mushroomCodes_,2),n=t[0],r=t[1],i=e.statData(n),a=e.statData(r);if(!i&&!a)return e;var o=[];if(null!=i&&i.getArray&&i.getArray().forEach(function(t){var e=+t;Number.isFinite(e)&&o.push(e)}),null!=a&&a.getArray&&a.getArray().forEach(function(t){var e=+t;Number.isFinite(e)&&o.push(e)}),!o.length)return e;var s=Dt(o)||0;return e._mushroomScale_=Xx().domain([0,s]).range([e.mushroomMinSize_,e.mushroomMaxSize_]),e}},e.updateStyle=function(){if(e.updateSymbolsDrawOrder(e),SM(e),e.insetTemplates_&&Wi(e.insetTemplates_,e.svgId_,SM),e.dorling_&&(e._mushroomScale_||e.mushroomSizeScaleFunctionV1_&&e.mushroomSizeScaleFunctionV2_)){var t=_(e.mushroomCodes(),2),n=t[0],r=t[1],i=e.statData(n),a=e.statData(r);Bx(e,function(t){var n,r,o,s,l=t.properties.id,c=+(null===(n=i.get(l))||void 0===n?void 0:n.value)||0,u=+(null===(r=a.get(l))||void 0===r?void 0:r.value)||0;return e.mushroomSizeScaleFunctionV1_&&e.mushroomSizeScaleFunctionV2_?(o=e.mushroomSizeScaleFunctionV1_(c),s=e.mushroomSizeScaleFunctionV2_(u)):(o=e._mushroomScale_(c),s=e._mushroomScale_(u)),Math.sqrt((o*o+s*s)/2)})}else qx(e);return e},e.updateSymbolsDrawOrder=function(t){var n=e.getCentroidsGroup(t),r=_(e.mushroomCodes(),2),i=r[0],a=r[1],o=e.statData(i),s=e.statData(a);t.Geometries.centroidsFeatures&&t.Geometries.centroidsFeatures.length||(t.Geometries.centroidsFeatures=t.svg().selectAll("g.em-centroid").data().filter(function(t){var e;return null==t||null===(e=t.properties)||void 0===e?void 0:e.centroid}));var l=t.Geometries.centroidsFeatures.map(function(t){var n,r,i,a,l=t.properties.id,c=+(null===(n=o.get(l))||void 0===n?void 0:n.value)||0,u=+(null===(r=s.get(l))||void 0===r?void 0:r.value)||0;return e.mushroomSizeScaleFunctionV1_&&e.mushroomSizeScaleFunctionV2_?(i=e.mushroomSizeScaleFunctionV1_(c),a=e.mushroomSizeScaleFunctionV2_(u)):(i=e._mushroomScale_(c),a=e._mushroomScale_(u)),{d:t,r:Math.max(i,a)}}).filter(function(t){return t.r>0}).sort(function(t,e){return e.r-t.r}).map(function(t){return t.d});n.selectAll("g.em-centroid").remove(),n.selectAll("g.em-centroid").data(l,function(t){return t.properties.id}).enter().append("g").attr("class","em-centroid").attr("id",function(t){return"mushroom-"+t.properties.id}).attr("transform",function(t){return"translate(".concat(t.properties.centroid[0].toFixed(3),",").concat(t.properties.centroid[1].toFixed(3),")")})},e.getLegendConstructor=function(){return yM},e}(e):(console.log("Unexpected map type: "+t),ux(e,!0,t))}catch(t){console.error("Error in eurostat-map.map: "+t.message),console.error(t)}},kM=function(t){(t=t||{}).shape=t.shape||"circle";var e=t.patternSize||5,n=t.minSize||1,r=t.maxSize||5.5;return t.bckColor=t.bckColor||"white",t.symbColor=t.symbColor||"black",function(i,a){i.selectAll(".em-fill-pattern").remove();for(var o=0;o<a;o++){var s=n+(r-n)*o/(a-1),l=i.append("pattern").attr("class","em-fill-pattern").attr("id","pattern_"+o).attr("x","0").attr("y","0").attr("width",e).attr("height",e).attr("patternUnits","userSpaceOnUse");l.append("rect").attr("x",0).attr("y",0).attr("width",e).attr("height",e).style("stroke","none").style("fill",t.bckColor),"square"==t.shape?l.append("rect").attr("x",0).attr("y",0).attr("width",s).attr("height",s).style("stroke","none").style("fill",t.symbColor):l.append("circle").attr("cx",.5*e).attr("cy",.5*e).attr("r",.5*s).style("stroke","none").style("fill",t.symbColor)}}},AM=kM,TM=function(){return af},PM="4.3.39"})(),r})());
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),D=g(2476),N=g(3869),j=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(D.A),q.i(N.A),q.i(j.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=document.baseURI||self.location.href,__webpack_require__.nc=void 0;var g={};return(()=>{"use strict";__webpack_require__.r(g),__webpack_require__.d(g,{getDefaultLabels:()=>xc,getFillPatternDefinitionFun:()=>bc,getFillPatternDefinitionFunction:()=>Ac,map:()=>yc,version:()=>wc});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 D=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 N="http://www.w3.org/1999/xhtml";const j={svg:"http://www.w3.org/2000/svg",xhtml:N,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)),j.hasOwnProperty(h)?{space:j[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===N&&h.documentElement.namespaceURI===N?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 D.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),D=S[T]=new Array(B);g(E,I,z,D,k[T]=new Array(P),L,h);for(var N,j,R=0,G=0;R<B;++R)if(N=z[R]){for(R>=G&&(G=R+1);!(j=D[G])&&++G<B;);N._next=j||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*",J="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Z="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Q=/^#([0-9a-f]{3,8})$/,tt=new RegExp(`^rgb\\(${K},${K},${K}\\)$`),et=new RegExp(`^rgb\\(${Z},${Z},${Z}\\)$`),nt=new RegExp(`^rgba\\(${K},${K},${K},${J}\\)$`),rt=new RegExp(`^rgba\\(${Z},${Z},${Z},${J}\\)$`),at=new RegExp(`^hsl\\(${J},${Z},${Z}\\)$`),ot=new RegExp(`^hsla\\(${J},${Z},${Z},${J}\\)$`),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=at.exec(c))?hsla(h[1],h[2]/100,h[3]/100,1):(h=ot.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,mt,_t,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,D=c.precision,N=c.trim,j=c.type;"n"===j?(z=!0,j="g"):ft[j]||(void 0===D&&(D=12),N=!0,j="g"),(L||"0"===T&&"="===E)&&(L=!0,T="0",E="=");var R="$"===P?g:"#"===P&&/[boxX]/.test(j)?"0"+j.toLowerCase():"",G="$"===P?m:/[%p]/.test(j)?S:"",q=ft[j],W=/[defgprs%]/.test(j);function format(c){var g,m,S,P=R,H=G;if("c"===j)H=q(c)+H,c="";else{var U=(c=+c)<0||1/c<0;if(c=isNaN(c)?k:q(Math.abs(c),D),N&&(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"===j?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 D=void 0===D?6:/[gprs]/.test(j)?Math.max(1,Math.min(21,D)):Math.max(0,Math.min(20,D)),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),mt=gt.format,_t=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),_t(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 mt(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},Ft=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 Lt=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)"},Dt=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 Nt=1e-6,jt=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,Jt=(Math.exp,Math.floor,Math.hypot),Zt=(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,ae,oe,ie,se,le,ce,ue,he,de,pe,fe,ge,me,_e={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&&_e.hasOwnProperty(c.type)?_e[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*Zt(c),Zt(h))}function centroidPointCartesian(c,h,g){++ee,re+=(c-re)/ee,ae+=(h-ae)/ee,oe+=(g-oe)/ee}function centroidLineStart(){ye.point=centroidLinePointFirst}function centroidLinePointFirst(c,h){c*=Ut;var g=Xt(h*=Ut);fe=g*Xt(c),ge=g*Zt(c),me=Zt(h),ye.point=centroidLinePoint,centroidPointCartesian(fe,ge,me)}function centroidLinePoint(c,h){c*=Ut;var g=Xt(h*=Ut),m=g*Xt(c),b=g*Zt(c),w=Zt(h),S=$t(te((S=ge*w-me*b)*S+(S=me*m-fe*w)*S+(S=fe*b-ge*m)*S),fe*m+ge*b+me*w);ne+=S,ie+=S*(fe+(fe=m)),se+=S*(ge+(ge=b)),le+=S*(me+(me=w)),centroidPointCartesian(fe,ge,me)}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*Zt(c),me=Zt(h),centroidPointCartesian(fe,ge,me)}function centroidRingPoint(c,h){c*=Ut;var g=Xt(h*=Ut),m=g*Xt(c),b=g*Zt(c),w=Zt(h),S=ge*w-me*b,M=me*m-fe*w,k=fe*b-ge*m,T=Jt(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*(me+(me=w)),centroidPointCartesian(fe,ge,me)}function centroid(c){ee=ne=re=ae=oe=ie=se=le=0,ce=new Adder,ue=new Adder,he=new Adder,stream(c,ye);var h=+ce,g=+ue,m=+he,b=Jt(h,g,m);return b<jt&&(h=ie,g=se,m=le,ne<Nt&&(h=re,g=ae,m=oe),(b=Jt(h,g,m))<jt)?[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])<Nt&&Yt(c[1]-h[1])<Nt}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)<Nt?b>0?0:3:Yt(m[0]-g)<Nt?b>0?2:1:Yt(m[1]-h)<Nt?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,D=b,N=buffer(),j={point,lineStart:function lineStart(){j.point=linePoint,S&&S.push(M=[]);B=!0,L=!1,I=P=NaN},lineEnd:function lineEnd(){w&&(linePoint(k,T),E&&L&&N.rejoin(),w.push(N.result()));j.point=point,L&&D.lineEnd()},polygonStart:function polygonStart(){D=N,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());D=b,w=S=M=null}};function point(c,h){visible(c,h)&&D.point(c,h)}function linePoint(b,w){var N=visible(b,w);if(S&&M.push([b,w]),B)k=b,T=w,E=N,B=!1,N&&(D.lineStart(),D.point(b,w));else if(N&&L)D.point(b,w);else{var j=[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}}}}}(j,R,c,h,g,m)?N&&(D.lineStart(),D.point(b,w),z=!1):(L||(D.lineStart(),D.point(j[0],j[1])),D.point(R[0],R[1]),N||D.lineEnd(),z=!1)}I=b,P=w,L=N}return j}}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,Fe=new Adder,Le=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,Fe.add(Yt(Le)),Le=new Adder},result:function(){var c=Fe/2;return Fe=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){Le.add(Pe*c-Ie*h),Ie=c,Pe=h}function areaRingEnd(){areaPoint(Te,Ee)}const Oe=Be;var ze,De,Ne,je,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(Ne=c,je=h)}function centroidPointLine(c,h){var g=c-Ne,m=h-je,b=te(g*g+m*m);We+=b*(Ne+c)/2,He+=b*(je+h)/2,Ue+=b,centroid_centroidPoint(Ne=c,je=h)}function centroid_centroidLineEnd(){Xe.point=centroid_centroidPoint}function centroid_centroidRingStart(){Xe.point=centroidPointFirstRing}function centroid_centroidRingEnd(){centroidPointRing(ze,De)}function centroidPointFirstRing(c,h){Xe.point=centroidPointRing,centroid_centroidPoint(ze=Ne=c,De=je=h)}function centroidPointRing(c,h){var g=c-Ne,m=h-je,b=te(g*g+m*m);We+=b*(Ne+c)/2,He+=b*(je+h)/2,Ue+=b,Ye+=(b=je*c-Ne*h)*(Ne+c),Ve+=b*(je+h),$e+=3*b,centroid_centroidPoint(Ne=c,je=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 Je,Ze,Qe,tn,en,nn=new Adder,rn={point:noop,lineStart:function(){rn.point=lengthPointFirst},lineEnd:function(){Je&&lengthPoint(Ze,Qe),rn.point=noop},polygonStart:function(){Je=!0},polygonEnd:function(){Je=null},result:function(){var c=+nn;return nn=new Adder,c}};function lengthPointFirst(c,h){rn.point=lengthPoint,Ze=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,mn=180/dn,_n=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,D=xn(z),N=bn(z),j=0;j<P;++j,B=G,D=W,N=H,L=R){var R=I[j],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=D*W;if(k.add(An(X*Y*xn(V),N*H+X*bn(V))),S+=$?U+Y*gn:U,$^B>=g^G>=g){var K=cartesianCross(cartesian(L),cartesian(R));cartesianNormalizeInPlace(K);var J=cartesianCross(w,K);cartesianNormalizeInPlace(J);var Z=($^U>=0?-1:1)*math_asin(J[2]);(m>Z||m===Z&&(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,D=b,N=clip_buffer(),j={point,lineStart:function lineStart(){j.point=linePoint,S&&S.push(M=[]);B=!0,L=!1,I=P=NaN},lineEnd:function lineEnd(){w&&(linePoint(k,T),E&&L&&N.rejoin(),w.push(N.result()));j.point=point,L&&D.lineEnd()},polygonStart:function polygonStart(){D=N,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());D=b,w=S=M=null}};function point(c,h){visible(c,h)&&D.point(c,h)}function linePoint(b,w){var N=visible(b,w);if(S&&M.push([b,w]),B)k=b,T=w,E=N,B=!1,N&&(D.lineStart(),D.point(b,w));else if(N&&L)D.point(b,w);else{var j=[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}}}}}(j,R,c,h,g,m)?N&&(D.lineStart(),D.point(b,w),z=!1):(L||(D.lineStart(),D.point(j[0],j[1])),D.point(R[0],R[1]),N||D.lineEnd(),z=!1)}I=b,P=w,L=N}return j}}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,Fn=-In,Ln=Fn,Bn={point:function bounds_boundsPoint(c,h){c<In&&(In=c);c>Fn&&(Fn=c);h<Pn&&(Pn=h);h>Ln&&(Ln=h)},lineStart:noop_noop,lineEnd:noop_noop,polygonStart:noop_noop,polygonEnd:noop_noop,result:function(){var c=[[In,Pn],[Fn,Ln]];return Fn=Ln=-(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*_n);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 D=k-g,N=T-m,j=D*D+N*N;if(j>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,J=N*X-D*K;(J*J/j>h||vn((D*X+N*K)/j-.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 Dn=src_transform_transformer({point:function(c,h){this.stream.point(c*_n,h*_n)}});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,D=0,N=0,j=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]*_n,c[1]*_n)}function invert(c){return(c=k.invert(c[0],c[1]))&&[c[0]*mn,c[1]*mn]}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(D,N,j),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=Dn(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*_n,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),D=B*B-z*(cartesianDot(P,P)-1);if(!(D<0)){var N=Cn(D),j=cartesianScale(L,(-B-N)/z);if(cartesianAddInPlace(j,P),j=spherical(j),!m)return j;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^j[1]<(vn(j[0]-G)<hn?W:H):W<=j[1]&&j[1]<=H:U>dn^(G<=j[0]&&j[0]<=q)){var V=cartesianScale(L,(-B+N)/z);return cartesianAddInPlace(V,P),[j,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*_n):(W=null,Sn),reset()):W*mn},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*_n,z=c[1]%360*_n,recenter()):[B*mn,z*mn]},projection.rotate=function(c){return arguments.length?(D=c[0]%360*_n,N=c[1]%360*_n,j=c.length>2?c[2]%360*_n:0,recenter()):[D*mn,N*mn,j*mn]},projection.angle=function(c){return arguments.length?(R=c%360*_n,recenter()):R*mn},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 Nn=Math.abs,jn=(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*Nn(h)/qn),b=jn(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,Nn(m/5)),w=Rn(0,jn(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*(Nn(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,Nn(m)/5))-(w=jn(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(Nn(B)>1e-12&&--z>0);break}}while(--w>=0);var D=Yn[w][0],N=Yn[w+1][0],j=Yn[Gn(19,w+2)][0];return[c/(N+L*(j-D)/2+L*L*(j-2*N+D)/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 Jn=[null];function src_selection_Selection(c,h){this._groups=c,this._parents=h}function src_selection_selection(){return new src_selection_Selection([[document.documentElement]],Jn)}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),D=S[T]=new Array(B);g(E,I,z,D,k[T]=new Array(P),L,h);for(var N,j,R=0,G=0;R<B;++R)if(N=z[R]){for(R>=G&&(G=R+1);!(j=D[G])&&++G<B;);N._next=j||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]],Jn)}var Zn=0;function Local(){this._="@"+(++Zn).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,ar=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,D=Math.sqrt(B),N=Math.sqrt(I),j=b*Math.tan((er-Math.acos((B+I-z)/(2*D*N)))/2),R=j/N,G=j/D;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>ar?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 or=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,D=(P+B)/2,N=(L+z)/2,j=B-P,R=z-L,G=j*j+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-j*H)/G,Y=(-W*j-R*H)/G,V=(W*R+j*H)/G,$=(-W*j+R*H)/G,X=U-D,K=Y-N,J=V-D,Z=$-N;return X*X+K*K>J*J+Z*Z&&(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},mr=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,D=c.connector,N=c.note,j=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=N||{},this.connector=D||{},this.subject=z||{},this.disable=j||[]}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}(),_r=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=or())),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=or()),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 D,N,j=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)),J=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*J)>ir?(j+=J*=z?1:-1,R-=J):(H=0,j=R=(P+L)/2)}var Z=I*Math.cos(j),Q=I*Math.sin(j),tt=E*Math.cos(q),et=E*Math.sin(q);if(V>ir){var nt=I*Math.cos(R),rt=I*Math.sin(R),at=E*Math.cos(G),ot=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]}(Z,Q,at,ot,nt,rt,tt,et):[tt,et],st=Z-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?(D=cornerTangents(at,ot,Z,Q,I,X,z),N=cornerTangents(nt,rt,tt,et,I,X,z),M.moveTo(D.cx+D.x01,D.cy+D.y01),X<V?M.arc(D.cx,D.cy,X,Math.atan2(D.y01,D.x01),Math.atan2(N.y01,N.x01),!z):(M.arc(D.cx,D.cy,X,Math.atan2(D.y01,D.x01),Math.atan2(D.y11,D.x11),!z),M.arc(0,0,I,Math.atan2(D.cy+D.y11,D.cx+D.x11),Math.atan2(N.cy+N.y11,N.cx+N.x11),!z),M.arc(N.cx,N.cy,X,Math.atan2(N.y11,N.x11),Math.atan2(N.y01,N.x01),!z))):(M.moveTo(Z,Q),M.arc(0,0,I,j,R,!z)):M.moveTo(Z,Q),E>ir&&W>ir?$>ir?(D=cornerTangents(tt,et,nt,rt,E,-$,z),N=cornerTangents(Z,Q,at,ot,E,-$,z),M.lineTo(D.cx+D.x01,D.cy+D.y01),$<V?M.arc(D.cx,D.cy,$,Math.atan2(D.y01,D.x01),Math.atan2(N.y01,N.x01),!z):(M.arc(D.cx,D.cy,$,Math.atan2(D.y01,D.x01),Math.atan2(D.y11,D.x11),!z),M.arc(0,0,E,Math.atan2(D.cy+D.y11,D.cx+D.x11),Math.atan2(N.cy+N.y11,N.cx+N.x11),z),M.arc(N.cx,N.cy,$,Math.atan2(N.y11,N.x11),Math.atan2(N.y01,N.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 Nr(this.note,".annotation-note-content text")}},{key:"getNoteBBoxOffset",value:function getNoteBBoxOffset(){var c=Nr(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+")",D=wr({className:"subject",data:{radius:T}});D.attrs.transform=z,D.attrs.fill=w.color,D.attrs["stroke-linecap"]="round",D.attrs["stroke-width"]="3px";var N=wr({className:"subject-ring",data:{outerRadius:T,innerRadius:E}});N.attrs.transform=z,N.attrs["stroke-width"]="3px",N.attrs.fill="white";var j=void 0;if(I&&P||!I&&!P)j=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)};j=xr({className:"subject-pointer",data:[[0,0],[R(I),R(P)],[R(I,-1),R(P,-1)],[0,0]]})}if(j&&(j.attrs.fill=w.color,j.attrs["stroke-linecap"]="round",j.attrs["stroke-width"]="3px",k.push(j)),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(D),k.push(N),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,D=k,N=k<M&&S>w||S<w&&k>M?-1:1;if(Math.abs(B)<Math.abs(L)?(z=S,D=M+B*N):(D=k,z=w+L*N),"circle"===g&&(T.outerRadius||T.radius)){var j=(T.outerRadius||T.radius)+(T.radiusPadding||0),R=j/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,D],[S,k]];else if(Math.abs(B)>Math.abs(L)){var G=Math.asin(-k/j);P=[[w=Math.abs(Math.cos(G)*j)*(S<0?-1:1),k],[S,k]]}else{var q=Math.acos(S/j);P=[[S,M=Math.abs(Math.sin(q)*j)*(k<0?-1:1)],[S,k]]}}else P=[[w,M],[z,D],[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(Dr,m,b),h=M.node().getBBox()}g.text(this.annotation.note.label).attr("dx","0"),g.call(Dr,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"}})),Fr=kr(Tr,{className:"callout rect",subject:{type:"rect"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),Lr=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(Lr,{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)})},Dr=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))})},Nr=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 mr(c)});h=h||new _r({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:Fr,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 jr=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:Lt;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):Lt(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:206e4,class:"countries",size:7,rotate:80},{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:412e4,y:294e4,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:53e5,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"}]},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-Nt,g).concat(h);return function(c){return m.map(function(h){return[c,h]})}}function graticuleY(c,h,g){var m=range(c,h-Nt,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,D=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)>Nt}).map(k)).concat(range(Kt(w/L)*L,b,L).filter(function(c){return Yt(c%z)>Nt}).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(D)):[[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(D)):[[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?(D=+P,k=graticuleX(w,b,90),T=graticuleY(h,c,D),E=graticuleX(M,S,90),I=graticuleY(m,g,D),graticule):D},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 Jr=function buildInset(c,h,g,m){var b=Fs(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},Zr=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"},ta=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?5:0);var m=c.text,b=Math.sqrt(na(m.trim())*c.lineHeight),w=aa(ea(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+2*c.padding,E=c.size+2*c.padding;g.append("rect").attr("width",T).attr("height",E).attr("x",c.x-T/2).attr("y",c.y-E/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("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+.8)*c.lineHeight}).text(function(c){return c.text.replaceAll("~"," ").replaceAll("¶","")})}else{var I=ra(w,c.lineHeight),P=c.size/I;if("square"===c.shape){var L=2*(c.size+c.padding);g.append("rect").attr("width",L).attr("height",L).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(P,")")).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("¶","")})}}},ea=function getWords(c){return c.split(/(?<=¶)|\s+/g).map(function(c){return c.trim()}).filter(function(c){return c.length>0})},na=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},ra=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},aa=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=na(S);(m.width+M)/2<h?(m.width=M,m.text=S):(m.text&&g.push(m),m={width:na(c[b]),text:c[b]})}else m.text&&g.push(m),m={width:0,text:""};return m.text&&g.push(m),g},oa={},ia={};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 ia;if(T)return T=!1,oa;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())!==ia;){for(var E=[];m!==oa&&m!==ia;)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 sa=dsv(","),la=sa.parse,ca=sa.parseRows,ua=(sa.format,sa.formatBody,sa.formatRows,sa.formatRow,sa.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, , , ")}),ha=function parseGridLayout(c){var h=new Map;return ca(c.trim(),function(c,g){c.forEach(function(c,m){(c=c.trim())&&h.set(c,[m,g])})}),h},da=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:""}}})},pa=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",ga(g._mapType)).style("transform",ma(g._mapType)).style("pointer-events","none").attr("fill","black").text(c.id).attr("x",T/2).attr("y",T/2+5)})},fa=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",_a(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",ga(g._mapType)).style("transform",ma(g._mapType)).style("pointer-events","none").attr("fill","black").text(c.id).attr("y",5)})},ga=function getFontSize(c){switch(c){case"sparkline":case"spark":default:return 12;case"proportionalSymbol":return 14;case"choropleth":return 15}},ma=function getLabelTranslate(c){switch(c){case"sparkline":case"spark":return"translate(0, -10px)";case"proportionalSymbol":return"translate(0, -12px)";default:return"translate(0, 0px)"}},_a=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"},va=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*Zt(h),Zt(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=Zt(m),w=[Zt(g),-Xt(g),0],S=0,M=0,k=new Adder;1===b?m=Gt+Nt:-1===b&&(m=-Gt-Nt);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,D=Zt(z),N=Xt(z),j=0;j<P;++j,B=G,D=W,N=H,L=R){var R=I[j],G=polygonContains_longitude(R),q=R[1]/2+qt,W=Zt(q),H=Xt(q),U=G-B,Y=U>=0?1:-1,V=Y*U,$=V>Rt,X=D*W;if(k.add($t(X*Y*Zt(V),N*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 J=cartesian_cartesianCross(w,K);cartesian_cartesianNormalizeInPlace(J);var Z=($^U>=0?-1:1)*asin(J[2]);(m>Z||m===Z&&(K[0]||K[1]))&&(M+=$^U>=0?1:-1)}}return(S<-Nt||S<Nt&&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-Nt:Gt-c[1])-((h=h.x)[0]<0?h[1]-Gt-Nt:Gt-h[1])}const ya=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)<Nt?(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)<Nt&&(g-=b*Nt),Yt(w-M)<Nt&&(w-=M*Nt),m=function antimeridian_clipAntimeridianIntersect(c,h,g,m){var b,w,S=Zt(c-g);return Yt(S)>Nt?Vt((Zt(h)*(w=Xt(m))*Zt(g)-Zt(m)*(b=Xt(h))*Zt(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])>Nt){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=Zt(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*Zt(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-Nt)%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=Zt(c),b=Xt(h),w=Zt(h);function rotation(c,h){var S=Xt(h),M=Xt(c)*S,k=Zt(c)*S,T=Zt(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=Zt(c)*S,T=Zt(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 Aa=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 D=k-g,N=T-m,j=D*D+N*N;if(j>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)<Nt||Yt(b-E)<Nt?(b+E)/2:$t(G,R),Y=c(U,H),V=Y[0],$=Y[1],X=V-g,K=$-m,J=N*X-D*K;(J*J/j>h||Yt((D*X+N*K)/j-.5)>.3||w*I+S*P+M*L<Aa)&&(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 ba=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=Zt(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,D=0,N=0,j=0,R=0,G=1,q=1,W=null,H=ya,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(D,N,j),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=ba(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)>Nt;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),D=B*B-z*(cartesian_cartesianDot(P,P)-1);if(!(D<0)){var N=te(D),j=cartesian_cartesianScale(L,(-B-N)/z);if(cartesian_cartesianAddInPlace(j,P),j=cartesian_spherical(j),!m)return j;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)<Nt;if(!Y&&H<W&&(R=W,W=H,H=R),Y||U<Nt?Y?W+H>0^j[1]<(Yt(j[0]-G)<Nt?W:H):W<=j[1]&&j[1]<=H:U>Rt^(G<=j[0]&&j[0]<=q)){var V=cartesian_cartesianScale(L,(-B+N)/z);return cartesian_cartesianAddInPlace(V,P),[j,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,ya),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?(D=c[0]%360*Ut,N=c[1]%360*Ut,j=c.length>2?c[2]%360*Ut:0,recenter()):[D*Ht,N*Ht,j*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)*Zt(c),Zt(h)]}orthographicRaw.invert=function azimuthalInvert(c){return function(h,g){var m=te(h*h+g*g),b=c(m),w=Zt(b),S=Xt(b);return[$t(h*w,m*S),asin(m&&g*w/m)]}}(asin);var xa=6378137,wa=.0066943799901413165,Ca=484813681109536e-20,Sa=Math.PI/2,Ma=1e-10,ka=.017453292519943295,Ta=57.29577951308232,Ea=Math.PI/4,Ia=2*Math.PI,Pa=3.14159265359,Fa={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 La=Fa,Ba={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 Oa=/[\s_\-\/\(\)]/g;function match(c,h){if(c[h])return c[h];for(var g,m=Object.keys(c),b=h.toLowerCase().replace(Oa,""),w=-1;++w<m.length;)if((g=m[w]).toLowerCase().replace(Oa,"")===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*ka},lat_1:function(c){b.lat1=c*ka},lat_2:function(c){b.lat2=c*ka},lat_ts:function(c){b.lat_ts=c*ka},lon_0:function(c){b.long0=c*ka},lon_1:function(c){b.long1=c*ka},lon_2:function(c){b.long2=c*ka},alpha:function(c){b.alpha=parseFloat(c)*ka},gamma:function(c){b.rectified_grid_angle=parseFloat(c)*ka},lonc:function(c){b.longc=c*ka},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(Ba,c);h&&(b.to_meter=h.to_meter)},from_greenwich:function(c){b.from_greenwich=c*ka},pm:function(c){var h=match(La,c);b.from_greenwich=(h||parseFloat(c))*ka},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}};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}const za=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 Da=class PROJJSONBuilder2015 extends za{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 Na=class PROJJSONBuilder2019 extends za{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?Na:Da).convert(c)}const ja=function parseString(c){var h=new Parser(c);return h.output()};var Ra=1,Ga=/\s/,qa=/[A-Za-z]/,Wa=/[A-Za-z84_]/,Ha=/[,\]]/,Ua=/[\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=Ra}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(;Ga.test(c);){if(this.place>=this.text.length)return;c=this.text[this.place++]}switch(this.state){case Ra: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(Ha.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=Ra)):"]"===c?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=Ra,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},Parser.prototype.number=function(c){if(!Ua.test(c)){if(Ha.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(Wa.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=Ra)}if(!Ha.test(c))throw new Error("havn't handled \""+c+'" in keyword yet, index '+this.place);this.afterItem(c)}},Parser.prototype.neutral=function(c){if(qa.test(c))return this.word=c,void(this.state=2);if('"'===c)return this.word="",void(this.state=4);if(Ua.test(c))return this.word=c,void(this.state=3);if(!Ha.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 Ya=["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!==Ya.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=ja(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]):defs[c]=g}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.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 Va=defs;var $a=["3857","900913","3785","102113"];const Xa=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 Va}(c))return Va[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&&$a.indexOf(g)>-1}}(h))return Va["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){return Math.abs(c)<=Pa?c:c-common_sign(c)*Ia}function tsfnz(c,h,g){var m=c*g,b=.5*c;return m=Math.pow((1-m)/(1+m),b),Math.tan(.5*(Sa-h))/m}function phi2z(c,h){for(var g,m,b=.5*c,w=Sa-2*Math.atan(h),S=0;S<=15;S++)if(g=c*Math.sin(w),w+=m=Sa-2*Math.atan(h*Math.pow((1-g)/(1+g),b))-w,Math.abs(m)<=1e-10)return w;return-9999}const Ka={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*Ta>90&&b*Ta<-90&&m*Ta>180&&m*Ta<-180)return null;if(Math.abs(Math.abs(b)-Sa)<=Ma)return null;if(this.sphere)h=this.x0+this.a*this.k0*adjust_lon(m-this.long0),g=this.y0+this.a*this.k0*Math.log(Math.tan(Ea+.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),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=Sa-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)),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 Ja=[Ka,{init:function longlat_init(){},forward:longlat_identity,inverse:longlat_identity,names:["longlat","identity"]}],Za={},Qa=[];function add(c,h){var g=Qa.length;return c.names?(Qa[g]=c,c.names.forEach(function(c){Za[c.toLowerCase()]=g}),this):(console.log(h),!0)}function getNormalizedProjName(c){return c.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}const to={start:function start(){Ja.forEach(add)},add,get:function projections_get(c){if(!c)return!1;var h=c.toLowerCase();return void 0!==Za[h]&&Qa[Za[h]]||(h=getNormalizedProjName(h))in Za&&Qa[Za[h]]?Qa[Za[h]]:void 0}};const eo={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)"}},no=eo.WGS84;var ro={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 ao in ro){var oo=ro[ao];oo.datumName&&(ro[oo.datumName]=oo)}const io=ro;const so=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]*=Ca,M.datum_params[4]*=Ca,M.datum_params[5]*=Ca,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 lo={};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 D={header:{nSubgrids:m},subgrids:g};return lo[c]=D,D}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:lo[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=Xa(c);if("object"==typeof g){var m=Projection.projections.get(g.projName);if(m){if(g.datumCode&&"none"!==g.datumCode){var b=match(io,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(eo,m);w||(w=no),c=w.a,h=w.b,g=w.rf}return g&&!h&&(h=(1-1/g)*c),(0===g||Math.abs(c-h)<Ma)&&(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||so(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=to,Projection.projections.start();const co=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<-Sa&&k>-1.001*Sa)k=-Sa;else if(k>Sa&&k<1.001*Sa)k=Sa;else{if(k<-Sa)return{x:-1/0,y:-1/0,z:c.z};if(k>Sa)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,D,N,j,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(N=0,w/g<R)return j=-m,{x:c.x,y:c.y,z:c.z}}else N=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,D=0;do{D++,T=h*(E=g/Math.sqrt(1-h*P*P))/(E+(j=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&&D<30);return{x:N,y:Math.atan(B/Math.abs(L)),z:j}}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=xa,b=wa}var w=h.a,S=h.b,M=h.es;if(3===h.datum_type&&(w=xa,S=6356752.314,M=wa),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,D=I.ll[1]+(I.lim[1]-1)*I.del[1]+P;if(!(B>m.y||L>m.x||D<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*Ta+" "+m.y*Ta+" 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],D=h.cvs[g][1],N=S*M,j=S*(1-M),R=(1-S)*(1-M),G=(1-S)*M;return k.x=R*T+j*I+G*z+N*L,k.y=R*E+j*P+G*D+N*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 co("WGS84"),g,m),c=b),m&&"enu"!==c.axis&&(g=adjust_axis(c,!1,g)),"longlat"===c.projName)g={x:g.x*ka,y:g.y*ka,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*Ta,y:g.y*Ta,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 uo=co("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 co?c:"object"==typeof c&&"oProj"in c?c.oProj:co(c)}const ho=function core_proj4(c,h,g){var m,b,w,S=!1;return void 0===h?(b=checkProj(c),m=uo,S=!0):(void 0!==h.x||Array.isArray(h))&&(g=h,b=checkProj(c),m=uo,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 po="AJSAJS",fo="AFAFAF",go=65,mo=73,_o=79,vo=86,yo=90;const Ao={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=po.charCodeAt(m),w=fo.charCodeAt(m),S=b+c-1,M=w+h,k=!1;S>yo&&(S=S-yo+go-1,k=!0);(S===mo||b<mo&&S>mo||(S>mo||b<mo)&&k)&&S++;(S===_o||b<_o&&S>_o||(S>_o||b<_o)&&k)&&++S===mo&&S++;S>yo&&(S=S-yo+go-1);M>vo?(M=M-vo+go-1,k=!0):k=!1;(M===mo||w<mo&&M>mo||(M>mo||w<mo)&&k)&&M++;(M===_o||w<_o&&M>_o||(M>_o||w<_o)&&k)&&++M===mo&&M++;M>vo&&(M=M-vo+go-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 D=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,N=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&&(N+=1e7);return{northing:Math.round(N),easting:Math.round(D),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,D=.00669438,N=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),j=g-5e5,R=h;m<"N"&&(R-=1e7),I=6*(b-1)-180+3,w=.006739496752268451,L=(P=R/B/6367449.145945056)+(3*N/2-27*N*N*N/32)*Math.sin(2*P)+(21*N*N/16-55*N*N*N*N/32)*Math.sin(4*P)+151*N*N*N/96*Math.sin(6*P),S=z/Math.sqrt(1-D*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-D*Math.sin(L)*Math.sin(L),1.5),E=j/(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=po.charCodeAt(h-1),m=1e5,b=!1;for(;g!==c.charCodeAt(0);){if(++g===mo&&g++,g===_o&&g++,g>yo){if(b)throw"Bad character: "+c;g=go,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=fo.charCodeAt(h-1),m=0,b=!1;for(;g!==c.charCodeAt(0);){if(++g===mo&&g++,g===_o&&g++,g>vo){if(b)throw"Bad character: "+c;g=go,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,D=0,N=0;return z>0&&(P=1e5/Math.pow(10,z),L=c.substring(w,w+z),D=parseFloat(L)*P,B=c.substring(w+z),N=parseFloat(B)*P),{easting:D+T,northing:N+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 bo=Point;var xo=.046875,wo=.01953125,Co=.01068115234375;function pj_enfn(c){var h=[];h[0]=1-c*(.25+c*(xo+c*(wo+c*Co))),h[1]=c*(.75-c*(xo+c*(wo+c*Co)));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)<Ma)return b}return b}const So={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),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)>Ma?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 D=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*(D-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 N=k*Math.sin(S);if(Math.abs(Math.abs(N)-1)<Ma)return 93;if(g=.5*this.a*this.k0*Math.log((1+N)/(1-N))+this.x0,m=k*Math.cos(S)/Math.sqrt(1-Math.pow(N,2)),(N=Math.abs(m))>=1){if(N-1>Ma)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)<Sa){var M=Math.sin(g),k=Math.cos(g),T=Math.abs(k)>Ma?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)}else m=Sa*common_sign(S),b=0;else{var D=Math.exp(w/this.k0),N=.5*(D-1/D),j=this.lat0+S/this.k0,R=Math.cos(j);h=Math.sqrt((1-Math.pow(R,2))/(1+Math.pow(N,2))),m=Math.asin(h),S<0&&(m=-m),b=0===N&&0===R?0:adjust_lon(Math.atan2(N,R)+this.long0)}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 Mo={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&&(So.init.apply(this),this.forward=So.forward,this.inverse=So.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),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),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 ko={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)*ka,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Mo.init.apply(this),this.forward=Mo.forward,this.inverse=Mo.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function srat(c,h){return Math.pow((1-c)/(1+c),h)}const To={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+Ea)/(Math.pow(Math.tan(.5*this.lat0+Ea),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+Ea),this.C)*srat(this.e*Math.sin(g),this.ratexp))-Sa,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+Ea)/this.K,1/this.C),b=20;b>0&&(g=2*Math.atan(m*srat(this.e*Math.sin(c.y),-.5*this.e))-Sa,!(Math.abs(g-c.y)<1e-14));--b)c.y=g;return b?(c.x=h,c.y=g,c):null},names:["gauss"]};const Eo={init:function sterea_init(){To.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),To.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,To.inverse.apply(this,[c]),c.x=adjust_lon(c.x+this.long0),c},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};function ssfn_(c,h,g){return h*=g,Math.tan(.5*(Sa+c))*Math.pow((1-h)/(1+h),.5*g)}const Io={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)<=Ma&&(this.k0=.5*(1+common_sign(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=Ma&&(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)<=Ma&&Math.abs(Math.cos(this.lat_ts))>Ma&&(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))-Sa,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);return Math.abs(Math.abs(M-this.long0)-Math.PI)<=Ma&&Math.abs(k+this.lat0)<=Ma?(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))-Sa,b=Math.cos(g),m=Math.sin(g),Math.abs(this.coslat0)<=Ma?(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)<Ma?(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<=Ma?(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)<Ma?this.lat0>0?adjust_lon(this.long0+Math.atan2(c.x,-1*c.y)):adjust_lon(this.long0+Math.atan2(c.x,c.y)):adjust_lon(this.long0+Math.atan2(c.x*Math.sin(M),S*this.coslat0*Math.cos(M)-c.y*this.sinlat0*Math.sin(M))),c.x=h,c.y=g,c)}if(Math.abs(this.coslat0)<=Ma){if(S<=Ma)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))}else b=2*Math.atan(S*this.cosX0/(2*this.a*this.k0*this.ms1)),h=this.long0,S<=Ma?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)))),g=-1*phi2z(this.e,Math.tan(.5*(Sa+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 Po={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 Fo=1e-7;const Lo={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,D=0,N=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 j=!1;"alpha"in this&&(j=!0);var R=!1;if("rectified_grid_angle"in this&&(R=!0),j&&(N=this.alpha),R&&(I=this.rectified_grid_angle),j||R)P=this.longc;else if(L=this.long1,z=this.lat1,B=this.long2,D=this.lat2,Math.abs(z-D)<=Fo||(c=Math.abs(z))<=Fo||Math.abs(c-Sa)<=Fo||Math.abs(Math.abs(this.lat0)-Sa)<=Fo||Math.abs(Math.abs(D)-Sa)<=Fo)throw new Error;var G=1-this.es;h=Math.sqrt(G),Math.abs(this.lat0)>Ma?(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),j||R?(j?(E=Math.asin(Math.sin(N)/m),R||(I=N)):(E=I,N=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,D,Math.sin(D)),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-=Ia:c>Math.PI&&(B+=Ia),this.lam0=adjust_lon(.5*(L+B)-Math.atan(T*Math.tan(.5*this.B*(L-B))/k)/this.B),E=Math.atan(2*Math.sin(this.B*adjust_lon(L-this.lam0))/(b-1/b)),I=N=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(N))),this.lat0<0&&(this.u_0=-this.u_0)),b=.5*E,this.v_pole_n=this.ArB*Math.log(Math.tan(Ea-b)),this.v_pole_s=this.ArB*Math.log(Math.tan(Ea+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)-Sa)>Ma){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)<Ma)throw new Error;k=.5*this.ArB*Math.log((1-m)/(1+m)),S=Math.cos(this.B*c.x),M=Math.abs(S)<Fo?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)<Ma)k.x=0,k.y=M<0?-Sa:Sa;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 Bo={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)<Ma)){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)-Sa)<Ma?0:tsfnz(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>Ma?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)<=Ma&&(g=common_sign(g)*(Sa-2e-10));var m,b,w=Math.abs(Math.abs(g)-Sa);if(w>Ma)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);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=-Sa;return w=adjust_lon(k/this.ns+this.long0),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 Oo={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);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)<Sa?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 zo={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.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)-Sa)<=Ma)return c.x=this.long0,c.y=Sa,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),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 Do=.3333333333333333,No=.17222222222222222,jo=.10257936507936508,Ro=.06388888888888888,Go=.0664021164021164,qo=.016415012942191543;const Wo={init:function laea_init(){var c,h=Math.abs(this.lat0);if(Math.abs(h-Sa)<Ma?this.mode=this.lat0<0?1:2:Math.abs(h)<Ma?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*Do,h=c*c,g[0]+=h*No,g[1]=h*Ro,h*=c,g[0]+=h*jo,g[1]+=h*Go,g[2]=h*qo,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.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)<=Ma)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)<Ma)return null;g=Ea-.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=Sa+P,S=this.qp-S;break;case this.S_POLE:T=P-Sa,S=this.qp+S}if(Math.abs(T)<Ma)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)<=Ma?0:Math.asin(T*P/E),k*=P,T=I*E;break;case this.OBLIQ:g=Math.abs(E)<=Ma?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=Sa-g;break;case this.S_POLE:g-=Sa}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))<Ma)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),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 Ho={init:function aea_init(){Math.abs(this.lat1+this.lat2)<Ma||(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)>Ma?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),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),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<Ma)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 Uo={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),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)<=Ma?(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)):(S=this.phic0,w=0),c.x=w,c.y=S,c},names:["gnom"]};const Yo={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);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)),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*Sa:Sa;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))),c.x=h,c.y=g,c},names:["cea"]};const Vo={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),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)),c.y=adjust_lat(this.lat0+(g-this.y0)/this.a),c},names:["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"]};const $o={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);if(m=S*Math.sin(w),this.sphere)Math.abs(w)<=Ma?(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)<=Ma)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)<=Ma)h=adjust_lon(m/this.a+this.long0),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)<=Ma){g=k;break}h=adjust_lon(this.long0+Math.asin(m*Math.tan(k)/this.a)/Math.sin(g))}else if(Math.abs(b+this.ml0)<=Ma)g=0,h=adjust_lon(this.long0+m/this.a);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)<=Ma){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))}return c.x=h,c.y=g,c},names:["Polyconic","American_Polyconic","poly"]};const Xo={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/Ca*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,D=S,N=M;for(h=2;h<=6;h++)L=z*E+B*I,B=B*E-z*I,z=L,D+=(h-1)*(this.B_re[h]*B-this.B_im[h]*z),N+=(h-1)*(this.B_im[h]*B+this.B_re[h]*z);B=1,z=0;var j=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,j+=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=j*j+R*R;E=(D*j+N*R)/G,I=(N*j-D*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*Ca*1e5,V=this.long0+W;return c.x=V,c.y=Y,c},names:["New_Zealand_Map_Grid","nzmg"]};const Ko={init:function mill_init(){},forward:function mill_forward(c){var h=c.x,g=c.y,m=adjust_lon(h-this.long0),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),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 Jo={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.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)<Ma)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),h=adjust_lat(h)):(h=pj_inv_mlfn(c.y/this.a,this.es,this.en),(m=Math.abs(h))<Sa?(m=Math.sin(h),g=adjust_lon(this.long0+c.x*Math.sqrt(1-this.es*m*m)/(this.a*Math.cos(h)))):m-Ma<Sa&&(g=this.long0)),c.x=g,c.y=h,c},names:["Sinusoidal","sinu"]};const Zo={init:function moll_init(){},forward:function moll_forward(c){for(var h=c.x,g=c.y,m=adjust_lon(h-this.long0),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)<Ma)break}b/=2,Math.PI/2-Math.abs(g)<Ma&&(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)));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 Qo={init:function eqdc_init(){Math.abs(this.lat1+this.lat2)<Ma||(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)<Ma?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),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),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),c.x=b,c.y=m,c)},names:["Equidistant_Conic","eqdc"]};const ti={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);Math.abs(b)<=Ma&&(h=this.x0+this.R*w,g=this.y0);var S=asinz(2*Math.abs(b/Math.PI));(Math.abs(w)<=Ma||Math.abs(Math.abs(b)-Sa)<=Ma)&&(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 D=k+I;return z=Math.PI*this.R*(L*D-M*Math.sqrt((B+k)*(k+1)-D*D))/(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)<Ma?this.long0:adjust_lon(this.long0+Math.PI*(w-1+Math.sqrt(1+2*(m*m-b*b)+w*w))/2/m),c.x=h,c.y=g,c},names:["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"]};const ei={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),D=adjust_lon(P-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=Ma?(c.x=this.x0+this.a*(Sa-L)*Math.sin(D),c.y=this.y0-this.a*(Sa-L)*Math.cos(D),c):Math.abs(this.sin_p12+1)<=Ma?(c.x=this.x0+this.a*(Sa+L)*Math.sin(D),c.y=this.y0+this.a*(Sa+L)*Math.cos(D),c):(T=this.sin_p12*B+this.cos_p12*z*Math.cos(D),k=(M=Math.acos(T))?M/Math.sin(M):1,c.x=this.x0+this.a*k*z*Math.sin(D),c.y=this.y0+this.a*k*(this.cos_p12*B-this.sin_p12*z*Math.cos(D)),c):(h=e0fn(this.es),g=e1fn(this.es),m=e2fn(this.es),b=e3fn(this.es),Math.abs(this.sin_p12-1)<=Ma?(w=this.a*mlfn(h,g,m,b,Sa),S=this.a*mlfn(h,g,m,b,L),c.x=this.x0+(w-S)*Math.sin(D),c.y=this.y0-(w-S)*Math.cos(D),c):Math.abs(this.sin_p12+1)<=Ma?(w=this.a*mlfn(h,g,m,b,Sa),S=this.a*mlfn(h,g,m,b,L),c.x=this.x0+(w+S)*Math.sin(D),c.y=this.y0+(w+S)*Math.cos(D),c):Math.abs(P)<Ma&&Math.abs(L-this.lat0)<Ma?(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,D,N,j,R,G,q,W,H,U,Y,V,$,X=S,K=100;do{if(B=Math.sin(X),z=Math.cos(X),D=Math.sqrt(P*B*(P*B)+(E*I-T*P*z)*(E*I-T*P*z)),0===D)return{azi1:0,s12:0};N=T*I+E*P*z,j=Math.atan2(D,N),R=E*P*B/D,G=1-R*R,q=0!==G?N-2*T*I/G:0,W=w/16*G*(4+w*(4-3*G)),L=X,X=S+(1-W)*w*R*(j+W*D*(q+W*N*(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*D*(q+Y/4*(N*(2*q*q-1)-Y/6*q*(4*D*D-3)*(4*q*q-3))),$=b*(1-w)*U*(j-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*Sa*this.a)return;return g=h/this.a,m=Math.sin(g),b=Math.cos(g),w=this.long0,Math.abs(h)<=Ma?S=this.lat0:(S=asinz(b*this.sin_p12+c.y*m*this.cos_p12/h),M=Math.abs(this.lat0)-Sa,w=Math.abs(M)<=Ma?this.lat0>=0?adjust_lon(this.long0+Math.atan2(c.x,-c.y)):adjust_lon(this.long0-Math.atan2(-c.x,c.y)):adjust_lon(this.long0+Math.atan2(c.x*m,h*this.cos_p12*b-c.y*this.sin_p12*m))),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)<=Ma?(S=imlfn(((P=this.a*mlfn(k,T,E,I,Sa))-(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)),c.x=w,c.y=S,c):Math.abs(this.sin_p12+1)<=Ma?(P=this.a*mlfn(k,T,E,I,Sa),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)),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)),D=B/1024*(256+B*(B*(74-47*B)-128));let N,j,R,G,q,W=m/(b*(1-w)*z),H=100;do{j=Math.cos(2*I+W),R=Math.sin(W),G=Math.cos(W),q=D*R*(j+D/4*(G*(2*j*j-1)-D/6*j*(4*R*R-3)*(4*j*j-3))),N=W,W=m/(b*(1-w)*z)+q}while(Math.abs(W-N)>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*(j+Y*G*(2*j*j-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 ni={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),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)<=Ma)&&(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)<=Ma?(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)-Sa,Math.abs(w)<=Ma?(S=this.lat0>=0?adjust_lon(this.long0+Math.atan2(c.x,-c.y)):adjust_lon(this.long0-Math.atan2(-c.x,c.y)),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)),c.x=S,c.y=M,c))},names:["ortho"]};var ri=1,ai=2,oi=3,ii=4,si=5,li=6,ci=1,ui=2,hi=3,di=4;function qsc_fwd_equat_face_theta(c,h,g,m){var b;return c<Ma?(m.value=ci,b=0):(b=Math.atan2(h,g),Math.abs(b)<=Ea?m.value=ci:b>Ea&&b<=Sa+Ea?(m.value=ui,b-=Sa):b>Sa+Ea||b<=-(Sa+Ea)?(m.value=hi,b=b>=0?b-Pa:b+Pa):(m.value=di,b+=Sa)),b}function qsc_shift_lon_origin(c,h){var g=c+h;return g<-Pa?g+=Ia:g>+Pa&&(g-=Ia),g}const pi={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>=Sa-Ea/2?this.face=si:this.lat0<=-(Sa-Ea/2)?this.face=li:Math.abs(this.long0)<=Ea?this.face=ri:Math.abs(this.long0)<=Sa+Ea?this.face=this.long0>0?ai:ii:this.face=oi,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===si)b=Sa-h,g>=Ea&&g<=Sa+Ea?(k.value=ci,m=g-Sa):g>Sa+Ea||g<=-(Sa+Ea)?(k.value=ui,m=g>0?g-Pa:g+Pa):g>-(Sa+Ea)&&g<=-Ea?(k.value=hi,m=g+Sa):(k.value=di,m=g);else if(this.face===li)b=Sa+h,g>=Ea&&g<=Sa+Ea?(k.value=ci,m=-g+Sa):g<Ea&&g>=-Ea?(k.value=ui,m=-g):g<-Ea&&g>=-(Sa+Ea)?(k.value=hi,m=-g-Sa):(k.value=di,m=g>0?-g+Pa:-g-Pa);else{var T,E,I,P,L,B;this.face===ai?g=qsc_shift_lon_origin(g,+Sa):this.face===oi?g=qsc_shift_lon_origin(g,+Pa):this.face===ii&&(g=qsc_shift_lon_origin(g,-Sa)),P=Math.sin(h),L=Math.cos(h),B=Math.sin(g),T=L*Math.cos(g),E=L*B,I=P,this.face===ri?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===oi?m=qsc_fwd_equat_face_theta(b=Math.acos(-T),I,-E,k):this.face===ii?m=qsc_fwd_equat_face_theta(b=Math.acos(-E),I,T,k):(b=m=0,k.value=ci)}return S=Math.atan(12/Pa*(m+Math.acos(Math.sin(m)*Math.cos(Ea))-Sa)),w=Math.sqrt((1-Math.cos(b))/(Math.cos(S)*Math.cos(S))/(1-Math.cos(Math.atan(1/Math.cos(m))))),k.value===ui?S+=Sa:k.value===hi?S+=Pa:k.value===di&&(S+=1.5*Pa),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=ci:c.y>=0&&c.y>=Math.abs(c.x)?(B.value=ui,h-=Sa):c.x<0&&-c.x>=Math.abs(c.y)?(B.value=hi,h=h<0?h+Pa:h-Pa):(B.value=di,h+=Sa),T=Pa/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===si)k=Math.acos(M),L.phi=Sa-k,B.value===ci?L.lam=S+Sa:B.value===ui?L.lam=S<0?S+Pa:S-Pa:B.value===hi?L.lam=S-Sa:L.lam=S;else if(this.face===li)k=Math.acos(M),L.phi=k-Sa,B.value===ci?L.lam=-S+Sa:B.value===ui?L.lam=-S:B.value===hi?L.lam=-S-Sa:L.lam=S<0?-S-Pa:-S+Pa;else{var z,D,N;T=(z=M)*z,D=(T+=(N=T>=1?0:Math.sqrt(1-T)*Math.sin(S))*N)>=1?0:Math.sqrt(1-T),B.value===ui?(T=D,D=-N,N=T):B.value===hi?(D=-D,N=-N):B.value===di&&(T=D,D=N,N=-T),this.face===ai?(T=z,z=-D,D=T):this.face===oi?(z=-z,D=-D):this.face===ii&&(T=z,z=D,D=-T),L.phi=Math.acos(-N)-Sa,L.lam=Math.atan2(D,z),this.face===ai?L.lam=qsc_shift_lon_origin(L.lam,-Sa):this.face===oi?L.lam=qsc_shift_lon_origin(L.lam,-Pa):this.face===ii&&(L.lam=qsc_shift_lon_origin(L.lam,+Sa))}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 fi=[[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]],gi=[[-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,_i=1.3523,vi=Ta/5,yi=1/vi,Ai=18,poly3_val=function(c,h){return c[0]+h*(c[1]+h*(c[2]+h*c[3]))};const bi={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),g=Math.abs(c.y),m=Math.floor(g*vi);m<0?m=0:m>=Ai&&(m=17);var b={x:poly3_val(fi[m],g=Ta*(g-yi*m))*h,y:poly3_val(gi[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*_i+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*_i)};if(h.y>=1)h.x/=fi[18][0],h.y=c.y<0?-Sa:Sa;else{var g=Math.floor(h.y*Ai);for(g<0?g=0:g>=Ai&&(g=17);;)if(gi[g][0]>h.y)--g;else{if(!(gi[g+1][0]<=h.y))break;++g}var m=gi[g],b=5*(h.y-m[0])/(gi[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,Ma,100),h.x/=poly3_val(fi[g],b),h.y=(5*g+b)*ka,c.y<0&&(h.y=-h.y)}return h.x=adjust_lon(h.x+this.long0),h},names:["Robinson","robin"]};const wi={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 Ci=0,Si=1,Mi=2,ki=3,Ti={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 Ei={init:function tpers_init(){if(Object.keys(Ti).forEach(function(c){if(void 0===this[c])this[c]=Ti[c].def;else{if(Ti[c].num&&isNaN(this[c]))throw new Error("Invalid parameter value, must be numeric "+c+" = "+this[c]);Ti[c].num&&(this[c]=parseFloat(this[c]))}Ti[c].degrees&&(this[c]=this[c]*ka)}.bind(this)),Math.abs(Math.abs(this.lat0)-Sa)<Ma?this.mode=this.lat0<0?Si:Ci:Math.abs(this.lat0)<Ma?this.mode=Mi:(this.mode=ki,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 ki:g=this.sinph0*w+this.cosph0*S*M;break;case Mi:g=S*M;break;case Si:g=-w;break;case Ci:g=w}switch(h=(g=this.pn1/(this.p-g))*S*Math.sin(c.x),this.mode){case ki:g*=this.cosph0*w-this.sinph0*S*M;break;case Mi:g*=w;break;case Ci:g*=-S*M;break;case Si: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)<Ma)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 ki: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 Mi:b.y=Math.asin(c.y*M/w),c.y=S*w,c.x*=M;break;case Ci:b.y=Math.asin(S),c.y=-c.y;break;case Si: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 Ii={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 Pi=1.340264,Fi=-.081106,Li=893e-6,Bi=.003796,Oi=Math.sqrt(3)/2;const zi={init:function eqearth_init(){this.es=0,this.long0=void 0!==this.long0?this.long0:0},forward:function eqearth_forward(c){var h=adjust_lon(c.x-this.long0),g=c.y,m=Math.asin(Oi*Math.sin(g)),b=m*m,w=b*b*b;return c.x=h*Math.cos(m)/(Oi*(Pi+3*Fi*b+w*(7*Li+9*Bi*b))),c.y=m*(Pi+Fi*b+w*(Li+Bi*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*(Pi+Fi*(h=w*w)+(g=h*h*h)*(Li+Bi*h))-c.y)/(Pi+3*Fi*h+g*(7*Li+9*Bi*h)),!(Math.abs(m)<1e-9));++b);return g=(h=w*w)*h*h,c.x=Oi*c.x*(Pi+3*Fi*h+g*(7*Li+9*Bi*h))/Math.cos(w),c.y=Math.asin(Math.sin(w)/Oi),c.x=adjust_lon(c.x+this.long0),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)),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))<Sa)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-Sa)<=Di))throw new Error;m=0}return c.x=adjust_lon(m+(this.long0||0)),c.y=adjust_lat(b),c}function s_fwd(c){var h,g,m=adjust_lon(c.x-(this.long0||0)),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)>Sa)throw new Error;return h=Math.abs(Math.abs(g)-Sa)<=Di?0:m*Math.atan2(c.x,c.y)/Math.cos(g),c.x=adjust_lon(h+(this.long0||0)),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>=Sa?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)"]};const ji=Object.assign(ho,{defaultDatum:"WGS84",Proj:co,WGS84:new co("WGS84"),Point:bo,toPoint,defs:Va,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 lo[c]=k,k}(c,h,g):{ready:readGeotiffGrid(c,h)}},transform:transform_transform,mgrs:Ao,version:"__VERSION__"});!function proj4_projs(c){c.Proj.projections.add(So),c.Proj.projections.add(Mo),c.Proj.projections.add(ko),c.Proj.projections.add(Eo),c.Proj.projections.add(Io),c.Proj.projections.add(Po),c.Proj.projections.add(Lo),c.Proj.projections.add(Bo),c.Proj.projections.add(Oo),c.Proj.projections.add(zo),c.Proj.projections.add(Wo),c.Proj.projections.add(Ho),c.Proj.projections.add(Uo),c.Proj.projections.add(Yo),c.Proj.projections.add(Vo),c.Proj.projections.add($o),c.Proj.projections.add(Xo),c.Proj.projections.add(Ko),c.Proj.projections.add(Jo),c.Proj.projections.add(Zo),c.Proj.projections.add(Qo),c.Proj.projections.add(ti),c.Proj.projections.add(ei),c.Proj.projections.add(ni),c.Proj.projections.add(pi),c.Proj.projections.add(bi),c.Proj.projections.add(wi),c.Proj.projections.add(Ei),c.Proj.projections.add(Ii),c.Proj.projections.add(zi),c.Proj.projections.add(Ni)}(ji);const Ri=ji;var Gi=function appendMinimap(c){var h;if(c.svg_){if(c.minimap_.size||(c.minimap_.size=150),c.Geometries.geoJSONs.worldrg)Hi(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,Hi(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 qi(c.detail)},(null===(h=c.minimap_)||void 0===h?void 0:h.debounce)||3))}},qi=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(Ri("EPSG:3035","EPSG:4326",[m,b]),2);m=w[0],b=w[1]}else if("54030"===c.proj_){var S=slicedToArray_slicedToArray(Ri("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 Wi=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)},Hi=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)"),Wi(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),qi(c)}catch(c){console.error("Error drawing minimap:",c)}};var Ui={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]=Ui,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 Yi=src_dispatch_dispatch,Vi={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 $i=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 D=Math.sqrt(z),N=(P*P-T*T+g*z)/(2*T*h*D),j=(P*P-T*T-g*z)/(2*P*h*D),R=Math.log(Math.sqrt(N*N+1)-N),G=Math.log(Math.sqrt(j*j+1)-j);S=(G-R)/c,w=function(g){var m=g*S,b=zoom_cosh(R),w=T/(h*D)*(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 Xi,Ki,Ji=0,Zi=0,Qi=0,ts=0,es=0,ns=0,rs="object"==typeof performance&&performance.now?performance:Date,as="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(c){setTimeout(c,17)};function now(){return es||(as(clearNow),es=rs.now()+ns)}function clearNow(){es=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(){es=(ts=rs.now())+ns,Ji=Zi=0;try{!function timerFlush(){now(),++Ji;for(var c,h=Xi;h;)(c=es-h._time)>=0&&h._call.call(void 0,c),h=h._next;--Ji}()}finally{Ji=0,function nap(){var c,h,g=Xi,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:Xi=h);Ki=c,sleep(m)}(),es=0}}function poke(){var c=rs.now(),h=c-ts;h>1e3&&(ns-=h,ts=c)}function sleep(c){Ji||(Zi&&(Zi=clearTimeout(Zi)),c-es>24?(c<1/0&&(Zi=setTimeout(wake,c-rs.now()-ns)),Qi&&(Qi=clearInterval(Qi))):(Qi||(ts=rs.now(),Qi=setInterval(poke,1e3)),Ji=1,as(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||Ki===this||(Ki?Ki._next=this:Xi=this,Ki=this),this._call=c,this._time=g,sleep()},stop:function(){this._call&&(this._call=null,this._time=1/0,sleep())}};var os=Yi("start","end","cancel","interrupt"),is=[];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:os,tween:is,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 ss,ls=180/Math.PI,cs={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)*ls,skewX:Math.atan(k)*ls,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 us=interpolateTransform(function parseCss(c){const h=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(c+"");return h.isIdentity?cs:decompose(h.a,h.b,h.c,h.d,h.e,h.f)},"px, ","px)","deg)"),hs=interpolateTransform(function parseSvg(c){return null==c?cs:(ss||(ss=document.createElementNS("http://www.w3.org/2000/svg","g")),ss.setAttribute("transform",c),(c=ss.transform.baseVal.consolidate())?decompose((c=c.matrix).a,c.b,c.c,c.d,c.e,c.f):cs)},", ",")",")");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 ds=G.prototype.constructor;function transition_style_styleRemove(c){return function(){this.style.removeProperty(c)}}var ps=0;function Transition(c,h,g,m){this._groups=c,this._parents=h,this._name=g,this._id=m}function newId(){return++ps}var fs=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,D=L.length;z<D;++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:fs.selectChild,selectChildren:fs.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 ds(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:fs.call,nodes:fs.nodes,node:fs.node,size:fs.size,empty:fs.empty,each:fs.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?hs: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+="")?us: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]:fs[Symbol.iterator]};var gs={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=gs).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 ms=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||ms}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=$i,P=Yi("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,Vi),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,Vi);"onselectstart"in h?g.on("selectstart.drag",src_noevent,Vi):(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,D=(D=B[0]-P[0])*D+(D=B[1]-P[1])*D;m=scale(m,Math.sqrt(z/D)),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(ms.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 _s=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,ms)}(c):vs(c)};var vs=function defineGeographicZoom(c){var h,g=src_select("#"+c.svgId()),m=ms,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),As(h,m,c),M.attr("data-zoom",S.k).attr("transform",S),m=S):!c.lockPanUntilZoom_||b?(ys(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 ys=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)},As=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,ws(w,g),null!==(m=g.labels_)&&void 0!==m&&m.values&&xs(w,g),null!==(b=g.labels_)&&void 0!==b&&b.backgrounds&&bs(w,g),window.dispatchEvent(new CustomEvent("estatmap:zoomed-"+g.svgId_,{detail:g})),"function"==typeof g.onZoom_&&g.onZoom_(c,g)},bs=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)})},xs=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")})},ws=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 Cs=dsv("\t"),Ss=Cs.parse;Cs.parseRows,Cs.format,Cs.formatBody,Cs.formatRows,Cs.formatRow,Cs.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 Ms=dsvParse(la);dsvParse(Ss);var ks=function projectToMap(c,h,g){switch(c.proj_){case"3035":return Ri("EPSG:4326","EPSG:3035",[h,g]);case"54030":return Ri("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 Ts=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]:Ts,w.next=1,Ms(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=Es(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 Es=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 D=+L.lon,N=+L.lat,j=slicedToArray_slicedToArray(ks(c,D,N),2),R=slicedToArray_slicedToArray(g([j[0],j[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 Is=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]},Ps=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(){Ri.defs("EPSG:3035","+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs"),Ri.defs("EPSG:54030","+proj=robin +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs")}();var Fs=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,ta(m.stamp_,m),m):m.stamp_},m.minimap=function(c){return arguments.length?(m.minimap_=c,Gi(m),m):m.minimap_},m.labels=function(c){return arguments.length?(m.labels_=c,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_);jr(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_&&jr(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=ms.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_=Zr(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=Jr(w,c,h,g);k.buildMapTemplateBase(),c.insetTemplates_[w.geo]=[c.insetTemplates_[w.geo],k]}else{var T=Jr(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_&&ta(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=ua(c),m=ha(g),b=da(m,c);"hexagon"===c.gridCartogramShape_?fa(h,b,c):pa(h,b,c),va(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]),_s(m)),h&&!m.gridCartogram_&&S(m),m.labels_&&!m.gridCartogram_&&jr(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=Is(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(Ps(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(Ps(w[0])+c.scalebarUnits_)}(m)),m.minimap_&&Gi(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(Ft("em-button","width"))||30;h.attr("transform","translate(".concat(c.width_-m-10,", ").concat(10,")"))}var b=parseInt(Ft("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(Ft("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=Ls[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=Ls[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,D=transform_transformer({point:function(c,h){var g=projection([c,h]);this.stream.point(g[0],g[1])}}),N=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=D(N(S=c))},projection.postclip=function(c){return arguments.length?(N=c,L=g=m=b=null,reset()):N},projection.clipExtent=function(c){return arguments.length?(N=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=Zt(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,D=null===(B=b.node())||void 0===B||null===(z=B.getBBox)||void 0===z?void 0:z.call(B);D&&(k=D.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 N=m.height_+M+k+E;c.attr("width",m.width_).attr("height",N)},m},Ls={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 D=[],N=["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 j=L[N[k]];null!==j&&(D=D.concat(j))}for(L.classification=[],k=0;k<z;k++)A(B[k],D)||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 D=[];for(g=0;g<T;g++)g!==P[0]?D.push(c[g]):D.push(B);b.push(this.Data(D,h))}return b}return h?{value:this.value[I],status:this.status?this.status[I]:null}:this.value[I]}S="array"}var N=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),j=[],R=M.dimension,G=M.id||R.id;for(g=0,m=N.length;g<m;g++)j.push(R[G[g]].category.index[N[g]]);return this.Data(j,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 D=h.call(this,nt[m],m);void 0!==D&&B.push(D)}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 N=[],j=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?at||"":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&&j){if("id"!==c.content)for(var K=j.length;K--;){var J=this.Dimension(j[K]);R[j[K]]={};for(var Z=J.length;Z--;)R[j[K]][J.Category(Z).label]=J.id[Z]}O=function(h,g){if(-1!==j.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]);N.push(Q)}if(Y&&N.forEach(function(c){null!==c.value&&(c.value=(""+c.value).replace(".",","))}),null!==W){var tt,et={},nt=[],rt={},at=void 0!==c.prefix?c.prefix:"";U.forEach(function(c,h){(!G.Dimension(c)||G.Dimension(c).length>1)&&(U[h]="")});var ot=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][at+g[W]]=g.value}:(it.Category().forEach(function(c,h){rt[c.label]=it.id[h]}),tt=function(c,h,g){c[h][at+rt[g[W]]]=g.value}):tt=function(c,h,g){c[h][at+g[W]]=g.value},N.forEach(function(c){var h=function(c,h){var g=[];return h.forEach(function(h){g.push(c[h])}),g.join("\t")}(c,ot);void 0===et[h]&&(et[h]=function(c,h){var g={};return h.forEach(function(h){g[h]=c[h]}),g}(c,ot)),tt(et,h,c,W)}),et)nt.push(et[st]);return L=!1,C(nt)}return C(N)}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,[]),mt=[],_t=[],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]);mt.push(St)}for(S=mt.length,m=0;m<S;m++){var Et=[],It=0;for(w=0;w<ft;w++)Et.push(mt[m][It]),++It===mt[m].length&&(It=0);_t.push(Et)}for(w=0;w<ft;w++){var Pt=[];S=mt.length;for(var Ft=0;Ft<S;Ft++)T(_t[Ft][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 Bs=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 Ms(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=Dt(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=Dt(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 Os=Symbol("implicit");function ordinal(){var c=new InternMap,h=[],g=[],m=Os;function scale(b){let w=c.get(b);if(void 0===w){if(m!==Os)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 zs=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,D=h.range(),N=+D[0]+k,j=+D[D.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",zs).attr("transform",function(c){return isFinite(c=R(c))?I(c+k):this.getAttribute("transform")}),U.attr("opacity",zs).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+","+N+"H"+k+"V"+j+"H"+T*S:"M"+k+","+N+"V"+j:S?"M"+N+","+T*S+"V"+k+"H"+j+"V"+T*S:"M"+N+","+k+"H"+j),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 Ds=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),D=getThresholds(c);B.forEach(function(c){var h=P(c);"number"==typeof h&&h>=0&&h<L.length&&L[h]++});var N=L.reduce(function(c,h){return c+h},0),j=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 N>0?c/N*100:0}),S=D.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 j=[],R=0;R<S.length;R++){var G=E(R);void 0!==G&&j.push(G+E.bandwidth())}var q=linear_linear().domain([0,k]).range([0,k]);B.call(axisLeft(q).tickValues(j).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")}(j):function drawHorizontalHistogram(h){var g=L.slice().reverse(),m=g.map(function(c){return N>0?c/N*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 j=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<D.length;G++){var q=D.length-G-1,W=P(q);void 0!==W&&R.push(W+P.bandwidth())}var H=linear_linear().domain([0,T]).range([0,T]);j.call(axisBottom(H).tickValues(R).tickFormat(function(c,h){return I?I(D[h],h):D[h]}).tickSize(4).tickSizeOuter(0)),j.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&&(j.call(axisBottom(P).tickSizeOuter(0).tickSize(0).tickFormat(function(c,h){return I?I(D[h],h):D[h]})),j.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,")")))}(j)};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 D=b.colorFunction_(w?z:B);P.append("stop").attr("offset","".concat(100*B,"%")).attr("stop-color",D)}}(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)),D=z/g,N=m?1-D:D;if(3===w.length){var j=slicedToArray_slicedToArray(w,3),R=j[0],G=j[1],q=j[2];if(N<.5)E=R+(G-R)*(N/.5);else E=G+(q-G)*((N-.5)/.5)}else{var W=slicedToArray_slicedToArray(w,2),H=W[0];E=H+N*(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 D=P*h,N=g+T;S.append("line").attr("class","em-legend-tick").attr("x1",D).attr("y1",N).attr("x2",D).attr("y2",N+c.tickLength);var j=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",D).attr("y",N+c.tickLength+10).attr("dy","0").attr("text-anchor",0===I?"start":I===E.length-1?"end":"middle").text(j)}})}(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=Dt(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=Dt(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),D=c.getColorStats(c),N=c.getLabelFormatter(c);if((c.maxMin||h.maxMin)&&D&&(null!=D&&D.getMin&&null!=D&&D.getMax&&(g=D.getMin(),m=D.getMax()),null!=D&&D.getMaxRegionId&&null!=D&&D.getMinRegionId)){var j,R,G,q;b=D.getMinRegionId(),w=D.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===(j=H.properties)||void 0===j?void 0:j.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 D=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 N(m[c.ascending?0:1])}return k.noDataText_||""});h.pointOfDivergenceLabel&&g==h.pointOfDivergence-1&&D.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=h.maxMinTickLength?h.sepLineLength+h.maxMinTickLength:h.sepLineLength+h.tickLength,K=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),J=N(m)+(h.maxMinLabels?h.maxMinLabels[1]:""),Z=N(g)+(h.maxMinLabels?h.maxMinLabels[0]:"");h.maxMinRegionLabels&&(J="".concat(N(m)," (").concat(M,")"),Z="".concat(N(g)," (").concat(S,")"));var Q=T.append("g").attr("class","em-legend-max-min-group"),tt=I;Q.append("line").attr("class","em-legend-tick em-legend-tick-max").attr("x1",$).attr("y1",tt).attr("x2",X).attr("y2",tt),Q.append("text").style("pointer-events","all").style("cursor","pointer").on("mouseover",function(){var h=c.getNumberOfClasses(c);!function highlightMaxRegion(c,h,g){var m=Dt(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",K).attr("y",tt).attr("dy","0.3em").text(J);var et=E*h.shapeHeight+I;Q.append("line").attr("class","em-legend-tick em-legend-tick-min").attr("x1",$).attr("y1",et).attr("x2",X).attr("y2",et),Q.append("text").style("pointer-events","all").style("cursor","pointer").on("mouseover",function(){!function highlightMinRegion(c,h){var g=Dt(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",K).attr("y",et).attr("dy","0.3em").text(Z)}if(h.pointOfDivergenceLabel)for(var nt=0;nt<E;nt++){var rt=nt*h.shapeHeight+I;nt==h.pointOfDivergence&&drawDivergingLine(c,rt,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 Ns=function legend(c,h){var g=yl(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?Ds(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=mt(".".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.labelType,c.labelFormatter||mt(".".concat(c.decimals,"f"))}function legend_choropleth_highlightRegions(c,h){var g=Dt(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=Dt(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 js=Math.PI,Rs=2*js,Gs=1e-6,qs=Rs-Gs;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>Gs)if(Math.abs(E*M-k*T)>Gs&&b){let P=g-w,L=m-S,B=M*M+k*k,z=P*P+L*L,D=Math.sqrt(B),N=Math.sqrt(I),j=b*Math.tan((js-Math.acos((B+I-z)/(2*D*N)))/2),R=j/N,G=j/D;Math.abs(R-1)>Gs&&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)>Gs||Math.abs(this._y1-T)>Gs)&&this._append`L${k},${T}`,g&&(I<0&&(I=I%Rs+Rs),I>qs?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>Gs&&this._append`A${g},${g},0,${+(I>=js)},${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 Ws=Math.abs,Hs=Math.atan2,Us=Math.cos,Ys=Math.max,Vs=Math.min,$s=Math.sin,Xs=Math.sqrt,Ks=1e-12,Js=Math.PI,Zs=Js/2,Qs=2*Js;function d3_shape_src_math_asin(c){return c>=1?Zs:c<=-1?-Zs:Math.asin(c)}Xs(3);const tl={draw(c,h){const g=Xs(h/Js);c.moveTo(g,0),c.arc(0,0,g,0,Qs)}},el={draw(c,h){const g=Xs(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()}},nl=Xs(1/3),rl=2*nl,al={draw(c,h){const g=Xs(h/rl),m=g*nl;c.moveTo(0,-g),c.lineTo(m,0),c.lineTo(0,g),c.lineTo(-m,0),c.closePath()}},ol={draw(c,h){const g=Xs(h),m=-g/2;c.rect(m,m,g,g)}},il=$s(Js/10)/$s(7*Js/10),sl=$s(Qs/10)*il,ll=-Us(Qs/10)*il,cl={draw(c,h){const g=Xs(.8908130915292852*h),m=sl*g,b=ll*g;c.moveTo(0,-g),c.lineTo(m,b);for(let h=1;h<5;++h){const w=Qs*h/5,S=Us(w),M=$s(w);c.lineTo(M*g,-S*g),c.lineTo(S*m-M*b,M*m+S*b)}c.closePath()}},ul=Xs(3),hl={draw(c,h){const g=-Xs(h/(3*ul));c.moveTo(0,2*g),c.lineTo(-ul*g,-g),c.lineTo(ul*g,-g),c.closePath()}},dl=(Xs(3),-.5),pl=Xs(3)/2,fl=1/Xs(12),gl=3*(fl/2+1),ml={draw(c,h){const g=Xs(h/gl),m=g/2,b=g*fl,w=m,S=g*fl+g,M=-w,k=S;c.moveTo(m,b),c.lineTo(w,S),c.lineTo(M,k),c.lineTo(dl*m-pl*b,pl*m+dl*b),c.lineTo(dl*w-pl*S,pl*w+dl*S),c.lineTo(dl*M-pl*k,pl*M+dl*k),c.lineTo(dl*m+pl*b,dl*b-pl*m),c.lineTo(dl*w+pl*S,dl*S-pl*w),c.lineTo(dl*M+pl*k,dl*k-pl*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||tl),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)),D=z,N=2*z+T,j=h.append("g").attr("transform","translate(".concat(D,",").concat(N,")")).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");j.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)||Lt;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 j.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)}),j.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)||Lt,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}))),D=z*T*.45+5,N=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*D,",0)")});N.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_),N.append("text").attr("class","em-legend-label em-spike-legend-label").attr("dy",I).text(function(c){return m(c)})}var _l={cross:el,square:ol,diamond:al,triangle:hl,star:cl,wye:ml,circle:tl};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=_l[g.psShape_]||_l.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)||Lt,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=_l[g.psShape_]||_l.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 vl=function legend(c,h){var g=yl(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=mt(".".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||mt(".".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 yl=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;g.selectAll("*").remove();var m=h.svg;if(c&&g&&m&&(null==m?void 0:m.attr("id"))!==c.legend_.svgId&&h.build(),null!=h.x||null!=h.y){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;h.lgg.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},Al=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},bl="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(bl));return h||((h=document.createElement("div")).id=bl,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 xl=function statMap(c,h,g){var m=Fs(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:Bs(),color:Bs(),size:Bs(),v1:Bs(),v2:Bs(),v3:Bs()},m.statData=function(c,h){return arguments.length?1===arguments.length?(m.statData_[c]||(m.statData_[c]=Bs()),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=Al(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(bl));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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}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=Bs(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"),yl},m.getTime=function(){return m.statData("default").getTime()},m.setFromURL=function(){var c=wl();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(/&nbsp;/g,"&#160;").replace(/&copy;/g,"&#169;").replace(/&reg;/g,"&#174;").replace(/&times;/g,"&#215;").replace(/&deg;/g,"&#176;");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(D){for(;;)switch(D.prev=D.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){D.next=4;break}return D.prev=1,D.next=2,document.fonts.ready;case 2:D.next=4;break;case 3:D.prev=3,z=D.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,D.abrupt("return",m);case 5:case"end":return D.stop()}},_callee,null,[[1,3]])}));return function(h,g){return c.apply(this,arguments)}}(),m},wl=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,D=c[z-1];if(S=(I+=D*D)-(E+=D)*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 Cl=function BayesianClassifier(){this.totalCount=0,this.data={}};Cl.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++},Cl.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 Sl=function PerceptronModel(){this.weights=[],this.bias=0};Sl.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},Sl.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 Ml=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/Ml*Math.exp(-c*c/2)))/1e4}for(var kl=[],Tl=0;Tl<=3.09;Tl+=.01)kl.push(cumulativeDistribution(Tl));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 D=E.replace("#","").toLowerCase();b="".concat(S,"-").concat(D,"-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 El=function map(c){var h=xl(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=Fl,h.colorSchemeType_="discrete",h.valueTransform_=function(c){return c},h.valueUntransform_=function(c){return c},h.pointOfDivergence_=null;var m=["numberOfClasses_","classificationMethod_","thresholds_","makeClassifNice_","colorFunction_","classToFillStyle_","noDataFillStyle_","classifier_","colors_","colorFunction_","colorSchemeType_","valueTransform_","valueUntransform_","pointOfDivergence_"];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,w=h.valueTransform_||function(c){return c},S=m.map(w),M=min_min(S),k=max_max(S),T=function checkIfDiverging(c){return null!==c.pointOfDivergence_}(h);if(!("function"==typeof(null===(b=h.colorFunction_)||void 0===b?void 0:b.domain)))if(T){var E,I=w(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(Pl()):h.classToFillStyle(Il(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(Pl());else{var g=Il(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 Ns};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,m=h.colorFunction_,b=h.domain_||[0,1],w="function"==typeof(null==m?void 0:m.domain),S=h.valueTransform_||function(c){return c},M=S(c);if(isNaN(M))return h.noDataFillStyle_||"gray";if(w)return m(M);if(3===b.length){var k,T=slicedToArray_slicedToArray(b,3),E=T[0],I=T[2],P=S(null!==(k=h.pointOfDivergence_)&&void 0!==k?k:0);g=M<P?.5*(M-E)/(P-E):.5+.5*(M-P)/(I-P)}else{var L=slicedToArray_slicedToArray(b,2),B=L[0];g=(M-B)/(L[1]-B)}return m(Math.min(Math.max(g,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},Il=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))}},Pl=function getFillPatternLegend(){return function(c){return"url(#pattern_"+c+")"}},Fl=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(Lt(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 Ll=ramp(new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(colors)),Bl=4294967296;function x(c){return c.x}function y(c){return c.y}var Ol=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=Yi("tick","end"),E=function lcg(){let c=1;return()=>(c=(1664525*c+1013904223)%Bl)/Bl}();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*Ol;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,D=c._y0,N=c._x1,j=c._y1;if(!L)return c._root=B,c;for(;L.length;)if((T=h>=(w=(z+N)/2))?z=w:N=w,(E=g>=(S=(D+j)/2))?D=S:j=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+N)/2))?z=w:N=w,(E=g>=(S=(D+j)/2))?D=S:j=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 zl=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,D=T-P.y-P.vy,N=z*z+D*D;N<B*B&&(0===z&&(N+=(z=jiggle(m))*z),0===D&&(N+=(D=jiggle(m))*D),N=(B-(N=Math.sqrt(N)))/N*b,M.vx+=(z*=N)*(B=(L*=L)/(I+L)),M.vy+=(D*=N)*B,P.vx-=z*(B=1-B),P.vy-=D*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 D,N=T.value,j=null===(D=g._projection)||void 0===D?void 0:D.call(g,N.geometry.coordinates);j?(N.x=j[0],N.y=j[1]):(N.x=NaN,N.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){if(c.svg_&&c.classifierColor_){var h=c.statData("color");c.svg_.selectAll(".em-centroid").attr("ecl",function(g){var m=h.get(g.properties.id);if(!m)return"nd";var b=m.value;return 0!==b&&!b||":"==b?"nd":+c.classifierColor_(+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),Nl(c,h),Dl(c,h)}zl.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},zl.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)},zl.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},zl.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},zl.data=function src_data(){var c=[];return this.visit(function(h){if(!h.length)do{c.push(h.data)}while(h=h.next)}),c},zl.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]]},zl.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 D=(b+S)/2,N=(w+M)/2;B.push(new quad(z[3],D,N,S,M),new quad(z[2],b,N,D,M),new quad(z[1],D,w,S,N),new quad(z[0],b,w,D,N)),(T=(h>=N)<<1|c>=D)&&(k=B[B.length-1],B[B.length-1]=B[B.length-1-T],B[B.length-1-T]=k)}else{var j=c-+this._x.call(null,z.data),R=h-+this._y.call(null,z.data),G=j*j+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},zl.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,D=this._x1,N=this._y1;if(!L)return this;if(L.length)for(;;){if((T=w>=(M=(B+D)/2))?B=M:D=M,(E=S>=(k=(z+N)/2))?z=k:N=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)},zl.removeAll=function removeAll(c){for(var h=0,g=c.length;h<g;++h)this.remove(c[h]);return this},zl.root=function src_root(){return this._root},zl.size=function src_size(){var c=0;return this.visit(function(h){if(!h.length)do{++c}while(h=h.next)}),c},zl.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},zl.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},zl.x=function d3_quadtree_src_x(c){return arguments.length?(this._x=c,this):this._x},zl.y=function d3_quadtree_src_y(c){return arguments.length?(this._y=c,this):this._y};var Dl=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)}})},Nl=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 jl=function map(c){var h=xl(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_=Ll,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=Gl,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(Rl(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=_l[g.psShape_]||_l.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_=Rl(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_,applyClassificationToMap),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.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 vl},h},Rl=function getColorLegend(c,h){return c=c||Ll,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 Gl=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":Lt(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 ql=colors("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");var Wl=function legend(c,h){var g=yl(c);if(g.order=void 0,h)for(var m in h)g[m]=h[m];function highlightRegions(c,h){var g=Dt(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=Dt(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},Hl=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 Ul=function legend(c,h){var g=yl(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=Dt(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=Dt(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},Yl=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]}},Vl=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?Lt(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?Lt(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,D=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:D}})}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,D=this.width-this.margin.left-this.margin.right,N=this.height-this.margin.top-this.margin.bottom,j=Math.min(D,N);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=j,this.canvas.height=j,this.ctx=this.canvas.getContext("2d"),this.ctx){if(this.drawContinuousTriangle(j,b,w,S,M,k,T),this.triangle.append("image").attr("x",0).attr("y",0).attr("width",j).attr("height",j).attr("href",this.canvas.toDataURL()),this.drawTriangleFrame(j,L,b,I,P,B,z),E&&c.length>0){const m=null!==(g=h.colorTarget)&&void 0!==g?g:"triangles";this.addDataPoints(c,j,h.dataPointHandlers,I,b,void 0,m)}I&&this.addCenterAnnotation(j,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,D=this.width-this.margin.left-this.margin.right,N=this.height-this.margin.top-this.margin.bottom,j=Math.min(D,N);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],j);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(j,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,j,h.dataPointHandlers,I,m,"points"===z?g:void 0,z)}I&&this.addCenterAnnotation(j,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),D=parseInt(L.rgb.slice(5,7),16),N=4*(c*M+T);k.data[N]=B,k.data[N+1]=z,k.data[N+2]=D,k.data[N+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 D=z*Math.cos(L*Math.PI/180),N=z*Math.sin(L*Math.PI/180);1===m&&(D+=-5,N+=8),0===m&&(B=L+180,D+=14,N+=10),2===m&&(B=L+180,D+=5,N+=10),this.circles.append("text").attr("x",I+D).attr("y",P+N).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("fill","triangles"===S?"white":"#000").attr("transform",`rotate(${B}, ${I+D}, ${P+N})`).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 $l=null,Xl=function legend(c){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},g=yl(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);$l&&$l.node()!==m.node()&&$l.attr("stroke",null).attr("stroke-width",null).lower(),$l=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);$l&&$l.node()===m.node()&&(m.attr("stroke",null).attr("stroke-width",null).lower(),$l=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);$l&&$l.node()!==m.node()&&$l.attr("stroke",null).attr("stroke-width",null).lower(),$l=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);$l&&$l.node()===g.node()&&(g.attr("stroke",null).attr("stroke-width",null).lower(),$l=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=Dt(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=Dt(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=Dt(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 Kl=function map(c){var h=xl(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=Jl;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:Kl.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 Xl},h},Jl=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?Lt(T.value)+P:"","</td></tr>\n <tr><td>").concat(h.statData(M).label_||M,": ").concat(null!=E&&E.value?Lt(E.value)+P:"","</td></tr>\n <tr><td>").concat(h.statData(k).label_||k,": ").concat(null!=I&&I.value?Lt(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(Qs),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),D=+m.apply(this,arguments),N=Math.min(Qs,Math.max(-Qs,b.apply(this,arguments)-D)),j=Math.min(Math.abs(N)/P,w.apply(this,arguments)),R=j*(N<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?(N-P*R)/L:0;M<P;++M,D=E)k=B[M],E=D+((I=z[k])>0?I*T:0)+R,z[k]={data:S[k],index:M,value:I,startAngle:D,endAngle:E,padAngle:j};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)/Xs(M*M+k*k),E=T*k,I=-T*M,P=c+E,L=h+I,B=g+E,z=m+I,D=(P+B)/2,N=(L+z)/2,j=B-P,R=z-L,G=j*j+R*R,q=b-w,W=P*z-B*L,H=(R<0?-1:1)*Xs(Ys(0,q*q*G-W*W)),U=(W*R-j*H)/G,Y=(-W*j-R*H)/G,V=(W*R+j*H)/G,$=(-W*j+R*H)/G,X=U-D,K=Y-N,J=V-D,Z=$-N;return X*X+K*K>J*J+Z*Z&&(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)-Zs,B=w.apply(this,arguments)-Zs,z=Ws(B-L),D=B>L;if(M||(M=T=k()),P<I&&(E=P,P=I,I=E),P>Ks)if(z>Qs-Ks)M.moveTo(P*Us(L),P*$s(L)),M.arc(0,0,P,L,B,!D),I>Ks&&(M.moveTo(I*Us(B),I*$s(B)),M.arc(0,0,I,B,L,D));else{var N,j,R=L,G=B,q=L,W=B,H=z,U=z,Y=S.apply(this,arguments)/2,V=Y>Ks&&(m?+m.apply(this,arguments):Xs(I*I+P*P)),$=Vs(Ws(P-I)/2,+g.apply(this,arguments)),X=$,K=$;if(V>Ks){var J=d3_shape_src_math_asin(V/I*$s(Y)),Z=d3_shape_src_math_asin(V/P*$s(Y));(H-=2*J)>Ks?(q+=J*=D?1:-1,W-=J):(H=0,q=W=(L+B)/2),(U-=2*Z)>Ks?(R+=Z*=D?1:-1,G-=Z):(U=0,R=G=(L+B)/2)}var Q=P*Us(R),tt=P*$s(R),et=I*Us(W),nt=I*$s(W);if($>Ks){var rt,at=P*Us(G),ot=P*$s(G),it=I*Us(q),st=I*$s(q);if(z<Js)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<Ks))return[c+(P=(E*(h-w)-I*(c-b))/P)*k,h+P*T]}(Q,tt,it,st,at,ot,et,nt)){var lt=Q-rt[0],ct=tt-rt[1],ut=at-rt[0],ht=ot-rt[1],dt=1/$s(function d3_shape_src_math_acos(c){return c>1?0:c<-1?Js:Math.acos(c)}((lt*ut+ct*ht)/(Xs(lt*lt+ct*ct)*Xs(ut*ut+ht*ht)))/2),pt=Xs(rt[0]*rt[0]+rt[1]*rt[1]);X=Vs($,(I-pt)/(dt-1)),K=Vs($,(P-pt)/(dt+1))}else X=K=0}U>Ks?K>Ks?(N=arc_cornerTangents(it,st,Q,tt,P,K,D),j=arc_cornerTangents(at,ot,et,nt,P,K,D),M.moveTo(N.cx+N.x01,N.cy+N.y01),K<$?M.arc(N.cx,N.cy,K,Hs(N.y01,N.x01),Hs(j.y01,j.x01),!D):(M.arc(N.cx,N.cy,K,Hs(N.y01,N.x01),Hs(N.y11,N.x11),!D),M.arc(0,0,P,Hs(N.cy+N.y11,N.cx+N.x11),Hs(j.cy+j.y11,j.cx+j.x11),!D),M.arc(j.cx,j.cy,K,Hs(j.y11,j.x11),Hs(j.y01,j.x01),!D))):(M.moveTo(Q,tt),M.arc(0,0,P,R,G,!D)):M.moveTo(Q,tt),I>Ks&&H>Ks?X>Ks?(N=arc_cornerTangents(et,nt,at,ot,I,-X,D),j=arc_cornerTangents(Q,tt,it,st,I,-X,D),M.lineTo(N.cx+N.x01,N.cy+N.y01),X<$?M.arc(N.cx,N.cy,X,Hs(N.y01,N.x01),Hs(j.y01,j.x01),!D):(M.arc(N.cx,N.cy,X,Hs(N.y01,N.x01),Hs(N.y11,N.x11),!D),M.arc(0,0,I,Hs(N.cy+N.y11,N.cx+N.x11),Hs(j.cy+j.y11,j.cx+j.x11),D),M.arc(j.cx,j.cy,X,Hs(j.y11,j.x11),Hs(j.y01,j.x01),!D))):M.arc(0,0,I,W,q,D):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-Js/2;return[Us(m)*g,$s(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 Zl=colors("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");var Ql=function legend(c,h){var g=yl(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 tc=function legend(c,h){var g=yl(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 ec=function map(c){var h=xl(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 D=T?map_pie_charts_objectSpread({},T):{},N=0;N<P.length;N++){var j=P[N],R={eurostatDatasetCode:k,unitText:E,filters:map_pie_charts_objectSpread(map_pie_charts_objectSpread({},D),{},_defineProperty({},I,j))};h.stat(j,R),B&&B[N]&&(h.catColors_=h.catColors_||{},h.catColors_[j]=B[N]),L&&L[N]&&(h.catLabels_=h.catLabels_||{},h.catLabels_[j]=L[N])}if(h.statCodes_=P,z){h.pieTotalCode_=z;var G={eurostatDatasetCode:k,unitText:E,filters:map_pie_charts_objectSpread(map_pie_charts_objectSpread({},D),{},_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),D=L.append("g").attr("class","piechart").attr("stroke",h.pieStrokeFill_).attr("stroke-width",h.pieStrokeWidth_+"px"),N=B(S);D.selectAll("path").data(N).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 j=g.select(".em-grid-shape, .em-grid-rect, .em-grid-hexagon").node();j&&j.nextSibling&&g.node().insertBefore(L.node(),j.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]]=Zl[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 tc};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 D="";if(D+='<div class="em-tooltip-bar">'.concat(I).concat(P?" (".concat(P,")"):"","</div>"),!B||0===B.length)return D+="<div>".concat(h.noDataText(),"</div>");var N,j="",R="",G="",q=map_pie_charts_createForOfIteratorHelper(k(B));try{for(q.s();!(N=q.n()).done;){var W=N.value,H=h.catColors()[W.data.code]||"lightgray",U=T(W);if(j+='<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 J=X<Math.PI?"start":"end",Z=(100*W.data.value).toFixed();isNaN(Z)||(G+='<text x="'.concat(K[0],'" y="').concat(K[1],'" text-anchor="').concat(J,'" font-size="12px">\n ').concat(Z,"%\n </text>"))}}}catch(c){q.e(c)}finally{q.f()}D+="\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(j,"\n ").concat(R,"\n ").concat(G,"\n </g>\n </svg>\n </div>\n "),D+='<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,at=Q.value,ot=et?(at.value/et*100).toFixed(0):0;D+='\n <div class="em-breakdown-item">\n <span class="em-breakdown-color" style="background:'.concat(at.color,'"></span>\n <span class="em-breakdown-label">').concat(at.label,'</span>\n <span class="em-breakdown-value">').concat(null!==(rt=at.value)&&void 0!==rt&&rt.toFixed?Lt(at.value):0," (").concat(isNaN(ot)?0:ot,"%)</span>\n </div>\n ")}}catch(c){nt.e(c)}finally{nt.f()}if(null!=et){var it=h.statData(h.statCodes_[0]).unitText()||"";D+='\n <div class="em-breakdown-item em-total">\n <span class="em-breakdown-label">Total</span>\n <span class="em-breakdown-value">'.concat(Lt(et)," ").concat(it,"</span>\n </div>\n ")}return D+="</div>"},h};const src_linear_linear=c=>+c;var nc=function legend(c,h){var g=yl(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],D=B[1],N=linear_linear().domain([z,D]).range([E,0]),j=h.append("g").attr("transform","translate(".concat(b.left,", ").concat(b.top,")"));j.append("g").attr("class","em-spark-legend-y-axis").call(axisLeft(N).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});j.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 N(c.y)}),W=j.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 rc=function map(c){var h=xl(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=Bs(),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,D=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 N=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 D(c,h)}).attr("opacity",h.sparkLineOpacity_);w?N.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)}):N.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,D=!1,N=new Array(z),j=new Array(z);for(null==w&&(M=S(B=k())),E=0;E<=z;++E){if(!(E<z&&b(L=T[E],E,T))===D)if(D=!D)I=E,M.areaStart(),M.lineStart();else{for(M.lineEnd(),M.lineStart(),P=E-1;P>=I;--P)M.point(N[P],j[P]);M.lineEnd(),M.areaEnd()}D&&(N[E]=+c(L,E,T),j[E]=+h(L,E,T),M.point(m?+m(L,E,T):N[E],g?+g(L,E,T):j[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}}),D=function getSegmentColor(c){return"function"==typeof h.sparkLineColor_?h.sparkLineColor_(c.value,c.index,g):h.sparkLineColor_},N=d3_shape_src_line().x(function(c){return c.scaledXValue}).y(function(c){return c.scaledYValue}),j=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 D(c)}).attr("d",function(c){return N([c.from,c.to])});if(!w){var R=h.transitionDuration()/z.length;j.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 nc},h},ac=mt?mt(".2s"):function(c){return String(c)},oc=mt?mt(","):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 ic=function legend(c,h){var g=yl(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):Lt(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,D=Math.max(0,z-B),N=[],j=c.map.maxFlowCount,R=c.map.minFlowCount,G=0;G<I+1;G++){var q=1===I?.5:G/(I-1);N.push(R+q*(j-R))}var W=k.values||N,H=Math.max(1,W.length-1),U=D/H,Y=W.map(function(c){return Math.max(.5,M.strokeWidthScale(c))}),V=Math.max.apply(Math,toConsumableArray_toConsumableArray(Y)),$=M.strokeWidthScale(j)+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 J=0;J<H;J++){var Z,Q,tt=B+J*U,et=J===H-1?z:B+(J+1)*U,nt=Y[J],rt=W[J];K.append("line").style("stroke-width",nt).attr("x1",tt).attr("x2",et).attr("y1",$).attr("y2",$).style("stroke",null!==(Z=k.color)&&void 0!==Z?Z:"#000").style("stroke-opacity",null!==(Q=k.strokeOpacity)&&void 0!==Q?Q:1);var at=(tt+et)/2;X.append("text").attr("x",at).attr("y",$-P).attr("dy","-0.35em").attr("class","em-legend-label em-flow-legend-label em-flow-width-horizontal-label").text(ac(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(oc(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(oc(Math.round(j))))}(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,D=c.node();if(D._arrowCache||(D._arrowCache=new Map),D._arrowCache.has(m))return D._arrowCache.get(m);var N,j=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")};(j.select("#".concat(R.normal)).empty()&&createMarker(j,R.normal,{markerUnits:M,scale:w,fill:z?"context-stroke":T,out:h.out}),j.select("#".concat(R.hover)).empty()&&createMarker(j,R.hover,{markerUnits:M,scale:w,fill:T,out:h.out}),j.select("#".concat(R.outline)).empty())&&createMarker(j,R.outline,{markerUnits:M,scale:w,fill:(null===(N=h.out)||void 0===N?void 0:N.flowOutlineColor_)||I,out:h.out});return D._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,D=T.sampleAB,N=T.sampleBA,j=b.get(E),R=b.get(I);if(j&&R){var G=D?flow_bidirectional_objectSpread({},D):{},q=N?flow_bidirectional_objectSpread({},N):{};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,D=B.target;"object"!==_typeof(z)&&(z=B.source=E.get(z)),"object"!==_typeof(D)&&(D=B.target=E.get(D)),z&&D&&(z.sourceLinks.push(B),D.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,D=z.target,N={link:z,width:z.width,otherY:D.y,at:"out"};(D.x<w.x?P:L).push(N)}}catch(c){B.e(c)}finally{B.f()}var j,R=sankey_createForOfIteratorHelper(w.targetLinks);try{for(R.s();!(j=R.n()).done;){var G=j.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 J=S-U/2,Z=0,Q=L;Z<Q.length;Z++){var tt=Q[Z],et=J+tt.width/2;"out"===tt.at?tt.link.y0=et:tt.link.y1=et,J+=tt.width}var nt=Math.max(H,U);w.y0=S-nt/2,w.y1=S+nt/2}else{var rt,at=sankey_createForOfIteratorHelper(w.sourceLinks);try{for(at.s();!(rt=at.n()).done;){rt.value.y0=S}}catch(c){at.e(c)}finally{at.f()}var ot,it=sankey_createForOfIteratorHelper(w.targetLinks);try{for(it.s();!(ot=it.n()).done;){ot.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,D=P?b:k,N=[[L,B]],j=function yAt(c){return B+(D-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,J=j(U),Z=J>=$,Q=Y-(Z?0:M),tt=V+(Z?M:0);if(J>=Q&&J<=tt){var et=Z?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 at,ot=[],it=sankey_createForOfIteratorHelper(R);try{for(it.s();!(at=it.n()).done;){var st=at.value;if(!ot.length||st.x1>ot[ot.length-1].x2)ot.push(sankey_objectSpread({},st));else{var lt=ot[ot.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=ot;ct<ut.length;ct++){var ht=ut[ct],dt=Math.max(L,ht.x1),pt=Math.min(z,ht.x2),ft=N[N.length-1][0];dt>ft&&(N.push([dt,ht.y]),ft=dt),pt>ft&&N.push([pt,ht.y])}}N.push([z,D]),P&&N.reverse();for(var gt="function"==typeof I?I(h):I,mt="M".concat(N[0][0],",").concat(N[0][1]),_t=1;_t<N.length;_t++)mt+=cubicSegment(N[_t-1],N[_t],gt);return mt}}(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)],D=P[Math.min(P.length-1,B+1)],N=D[0]-z[0],j=D[1]-z[1],R=Math.hypot(N,j)||1;L.push([-j/R,N/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]),J=1;J<W.length;J++)K+="L".concat(W[J][0],",").concat(W[J][1]);for(var Z=0;Z<H.length;Z++)K+="L".concat(H[Z][0],",").concat(H[Z][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 sc=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(sc.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,D=0;D<M;++D)T=(k=c[D]).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[D])/B*m*h[D],L*=B,I.vx-=P*(z=w[D]),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,D=(P.x+L.x)/2,N=(P.y+L.y)/2;B>0&&z>0?(S.push({originId:E,destId:I,x1:D,y1:N,x2:L.x,y2:L.y,value:B,route:T,nodeA:P,nodeB:L,isHalf:!0}),S.push({originId:I,destId:E,x1:D,y1:N,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 j,R=new Map,G=(c.flowGraph_||{}).links,q=void 0===G?[]:G,W=c._nodeById,H=straight_createForOfIteratorHelper(q);try{for(H.s();!(j=H.n()).done;){var U=j.value,Y=lc(U.source),V=lc(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),J=W.get(V)||("object"===_typeof(U.target)?U.target:null);if(K&&J){var Z=R.get($);Z?Z.value+=X:R.set($,{originId:Y,destId:V,nodeA:K,nodeB:J,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),D=c.flowColorGradient_&&null!==(L=null===(B=c.flowRegionColors_)||void 0===B?void 0:B[0])&&void 0!==L?L:E,N=c.flowOpacityGradient_?0:1,j=1;z.append("stop").attr("offset","0%").attr("stop-color",D).attr("stop-opacity",N),z.append("stop").attr("offset","100%").attr("stop-color",E).attr("stop-opacity",j)}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,D,N,j=k.x2-k.x1,R=k.y2-k.y1,G=Math.hypot(j,R)||1,q=-R/G,W=j/G,H=null!==(L=null===(B=c.flowWidthGradientSettings_)||void 0===B?void 0:B.startRatio)&&void 0!==L?L:.25,U=null!==(z=null===(D=c.flowWidthGradientSettings_)||void 0===D?void 0:D.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),J=k.y2+W*(V/2),Z=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(J,"L").concat(Z,",").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!==(N=c.flowOpacity_)&&void 0!==N?N:1),c.flowArrows_&&applyArrow(P,b,"normal")}else{var rt,at=Math.hypot(k.x2-k.x1,k.y2-k.y1)||0,ot=c.flowArrows_?straight_arrowBackoffPxForStroke(k.width):0,it=Math.max(0,at-ot),st=c.flowArrows_?Math.min(ot,at):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 lc=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 D=void 0;D="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(D,(S.get(D)||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),D=[].concat(toConsumableArray_toConsumableArray(B),toConsumableArray_toConsumableArray(z)),N=new Map;D.forEach(function(c){var h=c.color;N.set(h,(N.get(h)||0)+c.value)});var j=Array.from(N,function(c){var h=slicedToArray_slicedToArray(c,2),g=h[0];return{label:g,value:h[1],color:g}}),R=w(j);R.forEach(function(h){h.data.parent={id:S,name:c.nodeNameMap.get(S)||S,donutValues:j}});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)),cc(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(),uc(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)),cc(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(),uc(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=mt(".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(Lt(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(Lt(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(Lt(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(Lt(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(Lt(S)," ").concat(k,"</td>\n </tr>\n ")),T.push("</tbody></table></div>"),T.join("")}var cc=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)},uc=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(Lt(k),'</td></tr>\n <tr><td>Outgoing:</td><td style="text-align:right">').concat(Lt(T),"</td></tr>\n ").concat(m?'<tr><td>Internal:</td><td style="text-align:right">'.concat(Lt(E),"</td></tr>"):"",'\n <tr class="em-tooltip-total">\n <td colspan="2" style="padding-top:4px;font-weight:bold;">\n Total: ').concat(Lt(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 hc=function map(c){var h=xl(c,!0,"flow");h.strokeWidthScale=null,h.tooltip_.textFunction=dc,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,D=B.target;"object"!==_typeof(z)&&(z=B.source=map_flow_find(E,z)),"object"!==_typeof(D)&&(D=B.target=map_flow_find(E,D)),z.sourceLinks.push(B),D.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 ic},h};function map_flow_find(c,h){var g=c.get(h);if(!g)throw new Error("missing: "+h);return g}var dc=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(Lt(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 pc=function legend(c,h){var g=yl(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 D=M+E,N=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)*D}).attr("y",function(c,h){return-Math.cos(h*I+I/2)*D}).attr("text-anchor","middle").attr("alignment-baseline","middle").text(function(c,h){return N[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},fc=function map(c){var h=xl(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]]=Zl[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 pc},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(Lt(m),"</span></td>"):"<td></td>")}),b.push(S>0?'<td><span class="em-breakdown-value">'.concat(Lt(S),"</span></td>"):"<td></td>"),"<tr>".concat(b.join(""),"</tr>")}),D=(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(Lt(B)," ").concat(D,"</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 gc=function legend(c,h){var g=yl(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 D=T.mushroomOrientation(),N=src_arc().innerRadius(0),j=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}}(D,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,J=T.mushroomColors(),Z=B&&null!=z?J[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",N({startAngle:j.start,endAngle:j.end,outerRadius:g})).style("fill",Z).attr("stroke",G).attr("stroke-width",q).attr("data-mushroom-side",z);var b="vertical"===D&&1===z?g:-g,w=Y+R;"horizontal"===D&&(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]:Lt(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 mc=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":Lt(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 _c=function legend(c,h){var g=yl(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?mt(".1f")(c/1e6)+"M":c>=1e3?mt(".1f")(c/1e3)+"K":mt(".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,D=P.value,N=m(D),j=(N-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*(j+M)).attr("y",G*(j+M)).attr("width",j).attr("height",j).attr("fill","#7f7f7f").attr("stroke","#fff").attr("stroke-width",.3).attr("rx",Math.min(1,.1*j)).attr("ry",Math.min(1,.1*j));var W=L+10,H=N/2;h.append("text").attr("class","em-legend-label").attr("x",W).attr("y",I+H).attr("dominant-baseline","middle").text(formatValue(D,null===(z=c.sizeLegend)||void 0===z?void 0:z.labelFormatter)),I+=N+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 vc=function map(c){var h=xl(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 D=g.select(".em-grid-shape, .em-grid-rect, .em-grid-hexagon").node();D&&D.nextSibling&&g.node().insertBefore(z.node(),D.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],D=z.code,N=z.count,j=0;j<N&&P<m;j++){var R=Math.floor(P/g),G=P%g;b.push({row:g-1-R,col:G,code:D,color:h.catColors_[D]||"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]]=Zl[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 _c};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),D=10+B.row*(I+1);P+='<rect x="'.concat(z,'" y="').concat(D,'" 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 N=w+20;T+="\n <div class='em-tooltip-wafflechart-container'>\n <svg viewBox=\"0 0 ".concat(N," ").concat(N,'" width="').concat(w,'" style="display:block;">\n ').concat(P,"\n </svg>\n </div>\n "),T+='<div class="em-tooltip-breakdown">';var j,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();!(j=q.n()).done;){var W=j.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(Lt(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(Lt(G)," ").concat(U,"</span>\n </div>\n ")}return T+="</div>"},h};var yc=function map(c,h){try{return"choropleth"==c||"ch"==c?El(h):"categorical"==c||"ct"==c?function map(c){var h=xl(c,!1,"ct");h.classToFillStyle_=void 0,h.classToText_=void 0,h.tooltip_.textFunction=Hl,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]]=ql[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]]:Ft("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]]:Ft("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 Wl},h}(h):"proportionalSymbol"==c||"proportionalSymbols"==c||"ps"==c?jl(h):"bivariateChoropleth"==c||"chbi"==c?function map(c){var h=xl(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=Vl;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=Yl(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):Ft("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 Ul},h}(h):"trivariateChoropleth"==c||"ternary"==c?Kl(h):"stripeComposition"==c||"scomp"==c?function map(c){var h=xl(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):{},D=0;D<P.length;D++){var N=P[D],j={eurostatDatasetCode:k,unitText:E,filters:map_stripe_composition_objectSpread(map_stripe_composition_objectSpread({},z),{},_defineProperty({},I,N))};h.stat(N,j),B&&B[D]&&(h.catColors_=h.catColors_||{},h.catColors_[N]=B[D]),L&&L[D]&&(h.catLabels_=h.catLabels_||{},h.catLabels_[N]=L[D])}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]]=Zl[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 Ql},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="",D=map_stripe_composition_createForOfIteratorHelper(L(M));try{for(D.s();!(E=D.n()).done;){var N=E.value,j=h.catColors()[N.data.code]||"lightgray",R=B(N);z+='<path d="'.concat(R,'" fill="').concat(j,'" stroke="darkgray"></path>')}}catch(c){D.e(c)}finally{D.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?ec(h):"sparkline"==c||"spark"==c||"sparklines"==c?rc(h):"flow"==c||"flowmap"==c?hc(h):"coxcomb"==c||"polar"==c?fc(h):"alpha"==c||"valueByAlpha"==c?function map(c){var h=El(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 Ns},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(Lt(T.value)," ").concat(I,"</td>\n </tr>\n <tr>\n <td>").concat(E&&":"!==E.value&&null!=E.value?"".concat(B).concat(Lt(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=xl(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=mc;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 gc},h}(h):"waffle"==c?vc(h):(console.log("Unexpected map type: "+c),xl(h,!0,c))}catch(c){console.error("Error in eurostat-map.map: "+c.message),console.error(c)}},Ac=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)}}},bc=Ac,xc=function getDefaultLabels(){return Hr},wc="4.3.41"})(),g})());
5
+ //# sourceMappingURL=eurostatmap.min.js.map