How to use getFromENV method in Playwright Internal

Best JavaScript code snippet using playwright-internal

fusioncharts.maps.js

Source:fusioncharts.maps.js Github

copy

Full Screen

1!function(e) {2 "object" == typeof module && "undefined" != typeof module.exports ? module.exports = e : e()3}((function() {4 (window.webpackJsonpFusionCharts = window.webpackJsonpFusionCharts || []).push([[14], {5 1193: function(e, t, o) {6 "use strict";7 var r = o(187);8 t.__esModule = !0,9 t["default"] = void 0;10 var a = r(o(1194));11 t.Maps = a["default"];12 var n = {13 name: "maps",14 type: "package",15 requiresFusionCharts: !0,16 extension: function(e) {17 return e.addDep(a["default"])18 }19 };20 t["default"] = n21 },22 1194: function(e, t, o) {23 "use strict";24 var r = o(191)25 , a = o(187);26 t.__esModule = !0,27 t["default"] = void 0;28 var n = a(o(207))29 , l = a(o(519))30 , i = o(208)31 , s = r(o(431))32 , c = a(o(195))33 , h = o(200)34 , d = o(193)35 , u = a(o(1195))36 , p = a(o(420))37 , g = a(o(1006))38 , f = a(o(1010))39 , m = (0,40 d.extend2)({41 foregroundcolor: "333333",42 foregroundalpha: "100",43 foregrounddarkcolor: "111111",44 foregrounddarkalpha: "100",45 foregroundlightcolor: "666666",46 foregroundlightalpha: "100",47 backgroundlightcolor: "FFFFFF",48 backgroundlightalpha: "100",49 backgroundlightangle: 90,50 backgroundlightratio: "",51 backgroundcolor: "FFFFCC",52 backgroundalpha: "100",53 backgrounddarkcolor: "ffcc66",54 backgrounddarkalpha: "100",55 backgrounddarkangle: 270,56 backgrounddarkratio: "",57 shadow: 158 }, s)59 , b = {60 basefontcolor: "foregroundcolor",61 bordercolor: "foregrounddarkcolor",62 borderalpha: "foregrounddarkalpha",63 bgcolor: "backgroundlightcolor",64 bgalpha: "backgroundlightalpha",65 bgangle: "backgroundlightangle",66 bgratio: "backgroundlightratio",67 canvasbordercolor: "foregrounddarkcolor",68 canvasborderalpha: "foregrounddarkalpha",69 canvasbgcolor: "backgroundlightcolor",70 canvasbgalpha: "backgroundlightalpha",71 canvasbgangle: "backgroundlightangle",72 canvasbgratio: "backgroundlightratio",73 tooltipbordercolor: "foregrounddarkcolor",74 tooltipborderalpha: "foregrounddarkalpha",75 tooltipbgcolor: "backgroundlightcolor",76 tooltipbgalpha: "backgroundlightalpha",77 tooltipfontcolor: "foregroundcolor",78 legendbordercolor: "foregrounddarkcolor",79 legendborderalpha: "foregrounddarkalpha",80 markerbordercolor: "foregroundlightcolor",81 markerborderalpha: "foregroundlightalpha",82 markerfillcolor: "backgrounddarkcolor",83 markerfillalpha: "backgrounddarkalpha",84 markerfillangle: "backgrounddarkangle",85 markerfillratio: "backgrounddarkratio",86 plotfillcolor: "backgroundcolor",87 plotfillalpha: "backgroundalpha",88 plotfillangle: "backgroundangle",89 plotfillratio: "backgroundratio",90 plothoverfillcolor: "backgrounddarkcolor",91 plothoverfillalpha: "backgrounddarkalpha",92 plothoverfillangle: "backgrounddarkangle",93 plothoverfillratio: "backgrounddarkratio",94 plotbordercolor: "foregroundcolor",95 plotborderalpha: "foregroundalpha",96 shadow: "shadow"97 }98 , k = {99 getMapName: function() {100 return this.jsVars.instanceAPI.getName().toLowerCase()101 },102 getEntityList: function() {103 var e, t, o, r, a, n = this.jsVars.instanceAPI.getDatasets() || [], l = n.length, i = [];104 for (e = 0; e < l; e++)105 if ("entities" === (o = n[e] || []).getName()) {106 t = o;107 break108 }109 for (e in l = (r = t.components.data).length,110 r)111 r.hasOwnProperty(e) && (a = (r[e] || {}).config || {},112 i.push({113 id: a.id,114 originalId: a.originalId || a.id,115 label: a.label,116 shortlabel: a.shortLabel,117 value: a.value,118 formattedValue: a.formattedValue,119 toolText: a.toolText120 }));121 return i122 },123 getMapAttribute: function() {124 var e = this;125 return (0,126 h.raiseWarning)(this, "12061210581", "run", "JavaScriptRenderer~getMapAttribute()", 'Use of deprecated "getMapAttribute()". Replace with "getChartAttribute()".'),127 e.getChartAttribute.apply(e, arguments)128 },129 exportMap: function() {130 var e = this;131 return (0,132 h.raiseWarning)(this, "12061210581", "run", "JavaScriptRenderer~exportMap()", 'Use of deprecated "exportMap()". Replace with "exportChart()".'),133 e.exportChart && e.exportChart.apply(e, arguments)134 },135 addMarker: function(e) {136 var t, o, r, a = this.jsVars.instanceAPI.getDatasets() || [], n = a.length;137 for (t = 0; t < n; t++)138 if ("markers" === (o = a[t] || []).getName()) {139 r = o;140 break141 }142 r && !r.addMarkerItem(e) && (0,143 h.raiseWarning)(this, "1309264086", "run", "MapsRenderer~addMarker()", "Failed to add marker. Check the options and try again.")144 },145 updateMarker: function(e, t) {146 var o, r, a, n, l = this.jsVars.instanceAPI.getDatasets() || [], i = l.length;147 for (r = 0; r < i; r++)148 if ("markers" === (a = l[r] || []).getName()) {149 n = a;150 break151 }152 n && e && (o = (e + v).toLowerCase(),153 n.updateMarkerItem(o, t))154 },155 removeMarker: function(e) {156 var t, o, r, a, n = this.jsVars.instanceAPI.getDatasets() || [], l = n.length;157 for (o = 0; o < l; o++)158 if ("markers" === (r = n[o] || []).getName()) {159 a = r;160 break161 }162 e && (t = (e + v).toLowerCase(),163 a._removeMarkerItem(t))164 }165 }166 , v = ""167 , C = window.Math168 , y = C.min169 , F = C.max170 , w = function(e) {171 function t(t, o) {172 var r, a;173 for (a in (r = e.call(this) || this).subpalette = d.BLANKSTRING,174 r.key = d.BLANKSTRING,175 r.index = o,176 t)177 r.subpalette = m[t[a]],178 r[a] = r.subpalette instanceof Array ? r.subpalette[o] : r.subpalette,179 r.key = a;180 return r181 }182 return (0,183 n["default"])(t, e),184 t185 }(i.ComponentInterface)186 , A = function(e) {187 function t() {188 var t;189 return (t = e.call(this) || this).friendlyName = "Map",190 t.revision = 1,191 t.hasCanvas = !0,192 t.standaloneInit = !1,193 t.defaultDatasetType = "maps",194 t.defaultSeriesType = "geo",195 t.fireGroupEvent = !0,196 t.legendposition = "right",197 t.hasGradientLegend = !0,198 t.isMap = !0,199 t.defaultPaletteOptions = {200 paletteColors: [["A6A6A6", "CCCCCC", "E1E1E1", "F0F0F0"], ["A7AA95", "C4C6B7", "DEDFD7", "F2F2EE"], ["04C2E3", "66E7FD", "9CEFFE", "CEF8FF"], ["FA9101", "FEB654", "FED7A0", "FFEDD5"], ["FF2B60", "FF6C92", "FFB9CB", "FFE8EE"]],201 bgColor: ["FFFFFF", "CFD4BE,F3F5DD", "C5DADD,EDFBFE", "A86402,FDC16D", "FF7CA0,FFD1DD"],202 bgAngle: [270, 270, 270, 270, 270],203 bgRatio: ["0,100", "0,100", "0,100", "0,100", "0,100"],204 bgAlpha: ["100", "60,50", "40,20", "20,10", "30,30"],205 toolTipBgColor: ["FFFFFF", "FFFFFF", "FFFFFF", "FFFFFF", "FFFFFF"],206 toolTipBorderColor: ["545454", "545454", "415D6F", "845001", "68001B"],207 baseFontColor: ["555555", "60634E", "025B6A", "A15E01", "68001B"],208 tickColor: ["333333", "60634E", "025B6A", "A15E01", "68001B"],209 trendColor: ["545454", "60634E", "415D6F", "845001", "68001B"],210 plotFillColor: ["545454", "60634E", "415D6F", "845001", "68001B"],211 borderColor: ["767575", "545454", "415D6F", "845001", "68001B"],212 borderAlpha: [50, 50, 50, 50, 50]213 },214 t.colorPaletteMap = b,215 t.eiMethods = k,216 t.registerFactory("legend", f["default"], ["canvas"]),217 t.registerFactory("axis", d.stubFN, ["canvas"]),218 t.registerFactory("colormanager-decider", g["default"], ["legend"]),219 t.registerFactory("dataset", u["default"], ["colormanager-decider"]),220 t.registerFactory("canvas", p["default"]),221 t222 }223 (0,224 n["default"])(t, e);225 var o = t.prototype;226 return o._checkInvalidSpecificData = function() {227 return this.config.invalid = !1,228 !1229 }230 ,231 o.__setDefaultConfig = function() {232 e.prototype.__setDefaultConfig.call(this);233 var t = this.config;234 !t.baseWidth && (t.baseWidth = 400),235 !t.baseHeight && (t.baseHeight = 300),236 !t.baseScaleFactor && (t.baseScaleFactor = 1)237 }238 ,239 t.getName = function() {240 return "maps"241 }242 ,243 t.getType = function() {244 return "chartAPI"245 }246 ,247 o.getName = function() {248 return this.config.name || "GEO"249 }250 ,251 o.getType = function() {252 return "chartAPI"253 }254 ,255 o.configureAttributes = function(t) {256 var o, r = this.getChildren("colorPalette") && this.getChildren("colorPalette")[0];257 o = t.chart = t.chart || t.graph || t.map || {},258 this.jsonData = t,259 r || (r = new w(this.colorPaletteMap,(o.palette > 0 && o.palette < 6 ? o.palette : (0,260 d.pluckNumber)(this.paletteIndex, 1)) - 1),261 this.attachChild(r, "colorPalette")),262 this.config.skipCanvasDrawing = !0,263 e.prototype.configureAttributes.call(this, t),264 this._parseBackgroundCosmetics()265 }266 ,267 o.parseChartAttr = function(t) {268 var o, r, a, n, l, i = this.jsonData, s = i.chart || i.map, c = i.markers, h = new w(this.colorPaletteMap,(s.palette > 0 && s.palette < 6 ? s.palette : (0,269 d.pluckNumber)(this.paletteIndex, 1)) - 1), u = (0,270 d.pluck)(s.entitybordercolor, s.bordercolor, h.plotbordercolor), p = (0,271 d.pluck)(s.entityfillcolor, s.fillcolor, h.plotfillcolor), g = (0,272 d.pluck)(s.entityfillalpha, s.fillalpha, h.plotfillalpha), f = (0,273 d.pluck)(s.entityfillratio, s.fillratio, h.plotfillratio), m = (0,274 d.pluck)(s.entityfillangle, s.fillangle, h.plotfillangle), b = (0,275 d.pluck)(s.nullentityfillcolor, s.nullentitycolor, p), k = (0,276 d.pluckNumber)(s.usevaluesformarkers, i.markers && i.markers.items && i.markers.items.length, !(i.markers && i.markers.application && i.markers.application.length && i.markers.definition && i.markers.definition.length));277 e.prototype.parseChartAttr.call(this, t),278 (o = this.config).origMarginTop = (0,279 d.pluckNumber)(s.charttopmargin, s.maptopmargin, 11),280 o.origMarginLeft = (0,281 d.pluckNumber)(s.chartleftmargin, s.mapleftmargin, 11),282 o.origMarginBottom = (0,283 d.pluckNumber)(s.chartbottommargin, s.mapbottommargin, 11),284 o.origMarginRight = (0,285 d.pluckNumber)(s.chartrightmargin, s.maprightmargin, 11),286 o.labelsOnTop = (0,287 d.pluckNumber)(s.entitylabelsontop, 1),288 r = (l = o.style).inCancolor,289 a = l.inCanfontFamily,290 n = l.inCanfontSize,291 o.entityOpts = {292 baseScaleFactor: o.baseScaleFactor,293 dataLabels: {294 style: {295 fontFamily: a,296 fontSize: n,297 lineHeight: l.inCanLineHeight,298 color: (0,299 d.pluck)(s.entitylabelcolor, l.inCancolor),300 bgColor: (0,301 d.pluck)(s.entitylabelbgcolor) || v,302 borderColor: (0,303 d.pluck)(s.entitylabelbordercolor) || v304 }305 },306 fillColor: p,307 fillAlpha: g,308 fillRatio: f,309 fillAngle: m,310 borderColor: u,311 borderAlpha: (0,312 d.pluck)(s.entityborderalpha, s.borderalpha, this.borderAlpha, "100"),313 borderThickness: (0,314 d.pluckNumber)(s.showentityborder, s.showborder, 1) ? (0,315 d.pluckNumber)(s.entityborderthickness, s.borderthickness, 1) : 0,316 scaleBorder: (0,317 d.pluckNumber)(s.scaleentityborder, s.scaleborder, 0),318 hoverFillColor: (0,319 d.pluck)(s.entityfillhovercolor, s.hoverfillcolor, s.hovercolor, h.plothoverfillcolor),320 hoverFillAlpha: (0,321 d.pluck)(s.entityfillhoveralpha, s.hoverfillalpha, s.hoveralpha, h.plothoverfillalpha),322 hoverFillRatio: (0,323 d.pluck)(s.entityfillhoverratio, s.hoverfillratio, s.hoverratio, h.plothoverfillratio),324 hoverFillAngle: (0,325 d.pluck)(s.entityfillhoverangle, s.hoverfillangle, s.hoverangle, h.plothoverfillangle),326 hoverBorderThickness: (0,327 d.pluck)(s.entityborderhoverthickness, s.hoverborderthickness),328 hoverBorderColor: (0,329 d.pluck)(s.entityborderhovercolor, u, h.plotbordercolor),330 hoverBorderAlpha: (0,331 d.pluck)(s.entityborderhoveralpha, h.plotborderalpha),332 nullEntityColor: b,333 nullEntityAlpha: (0,334 d.pluck)(s.nullentityfillalpha, s.nullentityalpha, g),335 nullEntityRatio: (0,336 d.pluck)(s.nullentityfillratio, s.nullentityratio, f),337 nullEntityAngle: (0,338 d.pluck)(s.nullentityfillangle, s.nullentityangle, m),339 connectorColor: (0,340 d.pluck)(s.labelconnectorcolor, s.connectorcolor, r),341 connectorAlpha: (0,342 d.pluck)(s.labelconnectoralpha, s.connectoralpha, "100"),343 connectorThickness: (0,344 d.pluckNumber)(s.labelconnectorthickness, s.borderthickness, 1),345 showHoverEffect: (0,346 d.pluckNumber)(s.showentityhovereffect, s.usehovercolor, s.showhovereffect, 1),347 hoverOnNull: (0,348 d.pluckNumber)(s.hoveronnull, s.entityhoveronnull, 1),349 labelPadding: (0,350 d.pluckNumber)(s.labelpadding, 5),351 showLabels: (0,352 d.pluckNumber)(s.showlabels, 1),353 labelsOnTop: (0,354 d.pluckNumber)(s.entitylabelsontop, 1),355 includeNameInLabels: (0,356 d.pluckNumber)(s.includenameinlabels, 1),357 includeValueInLabels: (0,358 d.pluckNumber)(s.includevalueinlabels, 0),359 useSNameInTooltip: (0,360 d.pluckNumber)(s.usesnameintooltip, 0),361 useShortName: (0,362 d.pluckNumber)(s.usesnameinlabels, 1),363 labelSepChar: (0,364 d.pluck)(s.labelsepchar, ", "),365 showTooltip: (0,366 d.pluckNumber)(s.showentitytooltip, s.showtooltip, 1),367 tooltipSepChar: (0,368 d.pluck)(s.tooltipsepchar, ", "),369 tooltext: s.entitytooltext,370 hideNullEntities: (0,371 d.pluckNumber)(s.hidenullentities, 0),372 showHiddenEntityBorder: (0,373 d.pluckNumber)(s.showhiddenentityborder, 1),374 showNullEntityBorder: (0,375 d.pluckNumber)(s.shownullentityborder, 1),376 hiddenEntityColor: (0,377 d.pluck)(s.hiddenentitycolor, s.hiddenentityfillcolor, s.hiddenentityalpha || s.hiddenentityfillalpha ? b : "ffffff"),378 hiddenEntityAlpha: (0,379 d.pluck)(s.hiddenentityalpha, s.hiddenentityfillalpha, .001),380 shadow: (0,381 d.pluckNumber)(s.showshadow, this.defaultPlotShadow, h.shadow)382 },383 o.markerOpts = {384 dataLabels: {385 style: {386 fontFamily: (0,387 d.pluck)(s.markerfont, a),388 fontSize: (0,389 d.pluckNumber)(s.markerfontsize, parseInt(n, 10)),390 fontColor: (0,391 d.pluck)(s.markerlabelcolor, s.markerfontcolor, r),392 labelBgColor: (0,393 d.pluck)(s.markerlabelbgcolor) || v,394 labelBorderColor: (0,395 d.pluck)(s.markerlabelbordercolor) || v396 }397 },398 showTooltip: (0,399 d.pluckNumber)(s.showmarkertooltip, s.showtooltip, 1),400 showLabels: (0,401 d.pluckNumber)(s.showmarkerlabels, s.showlabels, 1),402 showHoverEffect: (0,403 d.pluckNumber)(s.showmarkerhovereffect, 1),404 labelPadding: (0,405 d.pluck)(s.markerlabelpadding, "5"),406 labelWrapWidth: (0,407 d.pluckNumber)(s.markerlabelwrapwidth, 0),408 labelWrapHeight: (0,409 d.pluckNumber)(s.markerlabelwrapheight, 0),410 fillColor: (0,411 d.pluck)(s.markerfillcolor, s.markerbgcolor, h.markerfillcolor),412 fillAlpha: (0,413 d.pluck)(s.markerfillalpha, h.markerfillalpha),414 fillAngle: (0,415 d.pluck)(s.markerfillangle, h.markerfillangle),416 fillRatio: (0,417 d.pluck)(s.markerfillratio, h.markerfillratio),418 fillPattern: (0,419 d.pluck)(s.markerfillpattern, h.markerbgpattern),420 hoverFillColor: s.markerfillhovercolor,421 hoverFillAlpha: s.markerfillhoveralpha,422 hoverFillRatio: s.markerfillhoverratio,423 hoverFillAngle: s.markerfillhoverangle,424 borderThickness: (0,425 d.pluck)(s.markerborderthickness, 1),426 borderColor: (0,427 d.pluck)(s.markerbordercolor, h.markerbordercolor),428 borderAlpha: (0,429 d.pluckNumber)(s.markerborderalpha, h.markerborderalpha),430 hoverBorderThickness: s.markerborderhoverthickness,431 hoverBorderColor: s.markerborderhovercolor,432 hoverBorderAlpha: s.markerborderhoveralpha,433 radius: (0,434 d.pluckNumber)(s.markerradius && (0,435 d.trimString)(s.markerradius), 7),436 shapeId: (0,437 d.pluck)(s.defaultmarkershape, "circle"),438 labelSepChar: (0,439 d.pluck)(s.labelsepchar, ", "),440 tooltipSepChar: (0,441 d.pluck)(s.tooltipsepchar, ", "),442 autoScale: (0,443 d.pluckNumber)(s.autoscalemarkers, 0),444 tooltext: (0,445 d.pluck)(c && c.tooltext, s.markertooltext),446 dataEnabled: k,447 valueToRadius: (0,448 d.pluckNumber)(s.markerradiusfromvalue, 1),449 valueMarkerAlpha: (0,450 d.pluck)(s.valuemarkeralpha, "75"),451 hideNull: (0,452 d.pluckNumber)(s.hidenullmarkers, 0),453 nullRadius: (0,454 d.pluckNumber)(s.nullmarkerradius, s.markerradius, 7),455 adjustViewPort: (0,456 d.pluckNumber)(s.adjustviewportformarkers, 0),457 startAngle: (0,458 d.pluckNumber)(s.markerstartangle, 90),459 maxRadius: (0,460 d.pluckNumber)(s.maxmarkerradius, 0),461 minRadius: (0,462 d.pluckNumber)(s.minmarkerradius, 0),463 applyAll: (0,464 d.pluckNumber)(s.applyallmarkers, 0),465 shadow: (0,466 d.pluckNumber)(s.showmarkershadow, s.showshadow, 0)467 },468 o.connectorOpts = {469 showHoverEffect: (0,470 d.pluckNumber)(s.showconnectorhovereffect, 1),471 thickness: (0,472 d.pluckNumber)(s.connectorthickness, s.markerconnthickness, "2"),473 color: (0,474 d.pluck)(s.connectorcolor, s.markerconncolor, h.markerbordercolor),475 alpha: (0,476 d.pluck)(s.connectoralpha, s.markerconnalpha, "100"),477 hoverThickness: (0,478 d.pluckNumber)(s.connectorhoverthickness, s.connectorthickness, s.markerconnthickness, "2"),479 hoverColor: (0,480 d.pluck)(s.connectorhovercolor, s.connectorcolor, s.markerconncolor, h.markerbordercolor),481 hoverAlpha: (0,482 d.pluck)(s.connectorhoveralpha, s.connectoralpha, s.markerconnalpha, "100"),483 dashed: (0,484 d.pluckNumber)(s.connectordashed, s.markerconndashed, 0),485 dashLen: (0,486 d.pluckNumber)(s.connectordashlen, s.markerconndashlen, 3),487 dashGap: (0,488 d.pluckNumber)(s.connectordashgap, s.markerconndashgap, 2),489 font: (0,490 d.pluck)(s.connectorfont, s.markerconnfont, a),491 fontColor: (0,492 d.pluck)(s.connectorlabelcolor, s.connectorfontcolor, s.markerconnfontcolor, r),493 fontSize: (0,494 d.pluckNumber)(s.connectorfontsize, s.markerconnfontsize, parseInt(n, 10)),495 showLabels: (0,496 d.pluckNumber)(s.showconnectorlabels, s.showmarkerlabels, s.showlabels, 1),497 labelBgColor: (0,498 d.pluck)(s.connectorlabelbgcolor, s.markerconnlabelbgcolor, h.plotfillcolor),499 labelBorderColor: (0,500 d.pluck)(s.connectorlabelbordercolor, s.markerconnlabelbordercolor, h.markerbordercolor),501 shadow: (0,502 d.pluckNumber)(s.showconnectorshadow, s.showmarkershadow, s.showshadow, 0),503 showTooltip: (0,504 d.pluckNumber)(s.showconnectortooltip, s.showmarkertooltip, s.showtooltip, 1),505 tooltext: (0,506 d.pluck)(c && c.connectortooltext, s.connectortooltext),507 hideOpen: (0,508 d.pluckNumber)(s.hideopenconnectors, 1)509 },510 o.adjustViewPortForMarkers = (0,511 d.pluckNumber)(s.adjustviewportformarkers, k)512 }513 ,514 o._attachMouseEvents = function() {515 var e = this.getFromEnv("eventListeners")516 , o = this.getFromEnv("chart-container");517 e.push(c["default"].listen(o, d.hasTouch ? "touchstart" : "click", t.searchMouseMove, this)),518 e.push(c["default"].listen(window.document, d.hasTouch ? "touchstart" : "mousemove", t.searchMouseMove, this))519 }520 ,521 o._dispose = function() {522 var o = this.getFromEnv("chart-container");523 d.hasTouch && (c["default"].unlisten(o, "touchstart", t.searchMouseMove),524 c["default"].unlisten(window.document, "touchstart", t.searchMouseMove)),525 c["default"].unlisten(o, "click", t.searchMouseMove),526 c["default"].unlisten(window.document, "mousemove", t.searchMouseMove),527 e.prototype._dispose.call(this)528 }529 ,530 t.searchMouseMove = function(e) {531 var t, o = e.data, r = o.config, a = o.getDatasets()[1], n = a && a.getFromEnv("toolTipController"), l = a && a.config.currentToolTip, i = o.config.lastHoveredPoint, s = {};532 o.getFromEnv("chart-container") && o.config.lastInteractionEvent !== e.originalEvent && (o.config.lastInteractionEvent = e.originalEvent,533 (t = function(e, t) {534 var o = (0,535 d.getMouseCoordinate)(t.getFromEnv("chart-container"), e, t)536 , r = o.chartX537 , a = o.chartY538 , n = t.config539 , l = n.canvasLeft540 , i = n.canvasTop541 , s = n.canvasLeft + n.canvasWidth542 , c = n.canvasHeight + n.canvasTop;543 return o.insideCanvas = !1,544 o.originalEvent = e,545 r > l && r < s && a > i && a < c && (o.insideCanvas = !0),546 o547 }(e, o)) && t.insideCanvas ? (r.lastMouseEvent = e,548 s = {549 x: t.chartX,550 y: t.chartY551 },552 o._searchNearestNeighbour(s, e)) : (i && a && a.hoverOutFn(i.element),553 o.config.lastHoveredPoint = null,554 n && n.hide(l)))555 }556 ,557 o._searchNearestNeighbour = function(e, t) {558 var o, r = this.getDatasets()[1];559 if (r) {560 if (!r.components.kDTree)561 return;562 (o = r.getElement(e)) ? r.highlightPoint(o, t) : r.highlightPoint(!1, t)563 }564 }565 ,566 o._createLayers = function() {567 e.prototype._createLayers.call(this),568 this._attachMouseEvents()569 }570 ,571 o._parseBackgroundCosmetics = function() {572 var e, t = this.getChildren("background")[0].config, o = this.getChildren("colorPalette")[0], r = this.getFromEnv("chart-attrib");573 e = t.showBorder = (0,574 d.pluckNumber)(r.showcanvasborder, 1),575 t.borderWidth = e ? (0,576 d.pluckNumber)(r.canvasborderthickness, 1) : 0,577 t.borderRadius = t.borderRadius = (0,578 d.pluckNumber)(r.canvasborderradius, 0),579 t.borderDashStyle = t.borderDashStyle = (0,580 d.pluckNumber)(r.borderdashed, 0) ? (0,581 d.getDashStyle)((0,582 d.pluckNumber)(r.borderdashlen, 4), (0,583 d.pluckNumber)(r.borderdashgap, 2)) : "none",584 t.borderAlpha = (0,585 d.pluck)(r.canvasborderalpha, o.borderAlpha),586 t.borderColor = t.borderColor = (0,587 d.convertColor)((0,588 d.pluck)(r.canvasbordercolor, o && o.borderColor), t.borderAlpha)589 }590 ,591 o._getBackgroundCosmetics = function() {592 var e = this.getFromEnv("chart-attrib") || this.jsonData.map593 , t = this.getChildren("colorPalette")[0];594 return {595 FCcolor: {596 color: (0,597 d.pluck)(e.bgcolor, e.canvasbgcolor, t.bgcolor),598 alpha: (0,599 d.pluck)(e.bgalpha, e.canvasbgalpha, t.bgalpha),600 angle: (0,601 d.pluck)(e.bgangle, e.canvasbgangle, t.bgangle),602 ratio: (0,603 d.pluck)(e.bgratio, e.canvasbgratio, t.bgratio)604 }605 }606 }607 ,608 o._parseCanvasCosmetics = function() {609 e.prototype._parseCanvasCosmetics.call(this);610 var t = this.config611 , o = this.getFromEnv("chart-attrib") || this.jsonData.map612 , r = this.getChildren("canvas")[0].config;613 t.origMarginTop = (0,614 d.pluckNumber)(o.maptopmargin, 11),615 t.origMarginLeft = (0,616 d.pluckNumber)(o.mapleftmargin, 11),617 t.origMarginBottom = (0,618 d.pluckNumber)(o.mapbottommargin, 11),619 t.origMarginRight = (0,620 d.pluckNumber)(o.maprightmargin, 11),621 t.origCanvasLeftMargin = (0,622 d.pluckNumber)(o.canvasleftmargin, 0),623 t.origCanvasRightMargin = (0,624 d.pluckNumber)(o.canvasrightmargin, 0),625 t.origCanvasTopMargin = (0,626 d.pluckNumber)(o.canvastopmargin, 0),627 t.origCanvasBottomMargin = (0,628 d.pluckNumber)(o.canvasbottommargin, 0),629 r.canvasBorderRadius = (0,630 d.pluckNumber)(o.canvasborderradius, 0),631 r.origCanvasTopPad = (0,632 d.pluckNumber)(o.canvastoppadding, 0),633 r.origCanvasBottomPad = (0,634 d.pluckNumber)(o.canvasbottompadding, 0),635 r.origCanvasLeftPad = (0,636 d.pluckNumber)(o.canvasleftpadding, 0),637 r.origCanvasRightPad = (0,638 d.pluckNumber)(o.canvasrightpadding, 0)639 }640 ,641 o.preliminaryScaling = function() {642 for (var e, t, o, r = this.jsonData, a = r.markers && r.markers.items || [], n = a && a.length || 0, l = Infinity, i = Infinity, s = -Infinity, c = -Infinity; n--; )643 o = a[n],644 e = Number(o.x),645 t = Number(o.y),646 l = y(l, e),647 i = y(i, t),648 s = F(s, e),649 c = F(c, t);650 return {651 x: l,652 y: i,653 x1: s,654 y1: c655 }656 }657 ,658 o.getScalingParameters = function(e, t, o, r) {659 var a, n, l = e / t, i = o / (e * this.config.baseScaleFactor), s = r / (t * this.config.baseScaleFactor), c = 0, h = 0;660 return i > s ? (c += (o - r * l) / 2,661 n = 200 / (t * (a = s))) : (h += (r - o / l) / 2,662 n = 200 / (e * (a = i))),663 {664 scaleFactor: a,665 strokeWidth: n,666 translateX: c,667 translateY: h668 }669 }670 ,671 o.calculateMarkerBounds = function(e, t, o) {672 var r, a, n, l, i, s, c, h, d, u, p, g, f = this.config, m = f.markerOpts, b = this.getDatasets(), k = this.getDataLimits(), v = k.dataMin, C = k.dataMax, w = m.hideNull, A = m.nullRadius, E = m.valueToRadius, L = Infinity, x = Infinity, N = -Infinity, S = -Infinity;673 for (s = 0,674 h = b.length; s < h; s++)675 "markers" === (c = b[s]).getName() && (r = c);676 if (r)677 for (s in r.calculateMarkerRadiusLimits(),678 n = (a = r.config || {}).minRadius,679 l = a.maxRadius,680 i = r.components && r.components.markerObjs || {})681 g = (f = i[s].config).definition || {},682 null !== f.cleanValue ? (E && void 0 === g.radius && (f.radius = n + (l - n) * (f.cleanValue - v) / (C - v)),683 p = Number(f.radius),684 d = (Number(g.x) + t) * e,685 u = (Number(g.y) + o) * e,686 L = y(L, d - p),687 x = y(x, u - p),688 N = F(N, d + p),689 S = F(S, u + p)) : w ? f.__hideMarker = !0 : null === f.radius && (f.radius = A);690 return {691 x: L,692 y: x,693 x1: N,694 y1: S695 }696 }697 ,698 o._spaceManager = function() {699 var e, t, o, r, a, n, l, i, s, c, h = this.config, u = this.getChildren("legend") && this.getChildren("legend")[0], p = this.getChildren("gLegend") && this.getChildren("gLegend")[0], g = u && u.config.legendPos ? u.config.legendPos.split("-") : p && p.conf.legendPosition ? p.conf.legendPosition.split("-") : [], f = this.getFromEnv("chart-attrib"), m = h.showBorder, b = h.origMarginLeft, k = h.origMarginTop, v = this.config.baseWidth, C = this.config.baseHeight, y = {}, F = 0, w = 0, A = h.markerOpts, E = h.borderWidth = m ? (0,700 d.pluckNumber)(f.borderthickness, 1) : 0;701 this._allocateSpace({702 top: E,703 bottom: E,704 left: E,705 right: E706 }),707 this._allocateSpace(this._manageActionBarSpace && this._manageActionBarSpace(.225 * h.availableHeight) || {}),708 s = "right" === g[0] || "left" === g[0] ? .3 * h.canvasWidth : .3 * h.canvasHeight,709 t = g[0] === d.POSITION_TOP || "bottom" === g[0] ? h.canvasHeight : h.canvasWidth,710 h.showLegend && this._manageLegendSpace(s),711 e = "bottom" === g[0] || g[0] === d.POSITION_TOP ? .225 * h.canvasHeight : .225 * h.canvasWidth,712 "top" === g[0] && (k += t - h.canvasHeight),713 c = this._manageChartMenuBar(e),714 "left" === g[0] && (b += t - h.canvasWidth),715 r = h.canvasWidth,716 a = h.canvasHeight,717 A.dataEnabled ? (h.adjustViewPortForMarkers ? ((y = this.preliminaryScaling()).x1 > v && (v = y.x1),718 y.x < 0 && (v += -y.x,719 F = -y.x),720 y.y1 > C && (C = y.y1),721 y.y < 0 && (C += -y.y,722 w = -y.y),723 o = this.getScalingParameters(v, C, r, a),724 l = a,725 i = r,726 (y = this.calculateMarkerBounds(o.scaleFactor * this.config.baseScaleFactor, F, w)).x < 0 && (b += -y.x,727 r += y.x),728 y.y < 0 && (k += -y.y,729 a += y.y),730 y.x1 > i && (r -= y.x1 - i),731 y.y1 > l && (a -= y.y1 - l)) : (o = this.getScalingParameters(v, C, r, a),732 this.calculateMarkerBounds(o.scaleFactor * this.config.baseScaleFactor, F, w)),733 b += F * (o = this.getScalingParameters(v, C, r, a)).scaleFactor * this.config.baseScaleFactor,734 k += w * o.scaleFactor * this.config.baseScaleFactor) : o = this.getScalingParameters(v, C, r, a),735 this.config.scalingParams = o,736 n = o.scaleFactor,737 o.translateX = o.translateX + b,738 o.translateY = o.translateY + k + c.top || 0,739 o.sFactor = n * this.config.baseScaleFactor * 100 / 100,740 o.transformStr = ["t", o.translateX, ",", o.translateY, "s", n, ",", n, ",0,0"].join(""),741 this.config.annotationConfig = {742 id: "Geo",743 showbelow: 0,744 autoscale: 0,745 grpxshift: o.translateX ? o.translateX : 0,746 grpyshift: o.translateY ? o.translateY : 0,747 xscale: 100 * (n ? n * this.config.baseScaleFactor : 1),748 yscale: 100 * (n ? n * this.config.baseScaleFactor : 1),749 scaletext: 1,750 options: {751 useTracker: !0752 }753 }754 }755 ,756 o.getDataLimits = function() {757 var e, t, o = this.getDatasets(), r = o.length, a = +Infinity, n = -Infinity;758 for (t = 0; t < r; t++)759 e = o[t].getDataLimits(),760 a = y(a, e.min),761 n = F(n, e.max);762 return {763 dataMin: a,764 dataMax: n765 }766 }767 ,768 o.getEntityPaths = function(e) {769 var t, o = {}, r = this.config.entities;770 if (e) {771 for (t in r)772 o[t] = r[t];773 return o774 }775 return r776 }777 ,778 o.checkComplete = function() {779 this.config.entityFlag && this.config.entitiesReady && (this.config.entityFlag = !1,780 this.config.markersDrawn = !0,781 this.fireChartInstanceEvent("internal.mapdrawingcomplete", {782 renderer: this783 }))784 }785 ,786 t787 }(l["default"]);788 t["default"] = A789 },790 1195: function(e, t, o) {791 "use strict";792 var r = o(187);793 t.__esModule = !0,794 t["default"] = function(e) {795 var t, o = e.getFromEnv("dataSource"), r = o.data || {}, s = o.markers;796 (0,797 a.componentFactory)(e, i["default"], "mapGroup"),798 t = e.getChildren("mapGroup")[0],799 (0,800 a.datasetFactory)(t, n["default"], "entities", 1, [r]),801 s ? (0,802 a.datasetFactory)(t, l["default"], "markers", 1, [s]) : e.getDatasets()[1] && e.getDatasets()[1].remove()803 }804 ;805 var a = o(193)806 , n = r(o(1196))807 , l = r(o(1198))808 , i = r(o(1199))809 },810 1196: function(e, t, o) {811 "use strict";812 var r = o(187);813 t.__esModule = !0,814 t["default"] = void 0;815 var a, n = r(o(207)), l = o(208), i = r(o(269)), s = o(201), c = r(o(1197)), h = o(193), d = o(205), u = r(o(552)), p = (0,816 s.getDep)("redraphael", "plugin"), g = window.navigator.userAgent, f = /msie/i.test(g) && !window.opera, m = window.Math, b = m.min, k = m.max, v = /stroke/gi, C = /AppleWebKit/.test(g), y = m.ceil, F = function(e, t) {817 var o = t ? (0,818 h.extend2)(e.FCcolor, t, !1, !0) : {819 FCcolor: e820 };821 return o.toString = h.toRaphaelColor,822 o823 }, w = function(e, t) {824 var o, r, a = {};825 if (r = t || 1,826 !e || "object" != typeof e)827 return a;828 for (o in e)829 v.test(o) || ("stroke-width" === o ? (a[o] = Number(e[o]) / r,830 C && (a[o] = a[o] && y(a[o]) || 0)) : a[o] = e[o]);831 return a832 }, A = {833 right: function() {834 return arguments[1]835 },836 left: function(e, t) {837 return e - t838 },839 center: function(e, t) {840 return 2 * b(t, e - t)841 }842 }, E = {843 top: function() {844 return arguments[1]845 },846 middle: function(e, t) {847 return 2 * b(t, e - t)848 },849 bottom: function(e, t) {850 return e - t851 }852 }, L = function(e, t) {853 e && e.graphics.outlines.attr(t)854 };855 (0,856 s.addDep)({857 name: "mapsAnimation",858 type: "animationRule",859 extension: c["default"]860 }),861 (0,862 u["default"])(p);863 var x = function(e) {864 function t() {865 var t;866 return (t = e.call(this) || this).components = {},867 t868 }869 (0,870 n["default"])(t, e);871 var o = t.prototype;872 return o.getName = function() {873 return "entities"874 }875 ,876 o.getType = function() {877 return "dataset"878 }879 ,880 o.configureAttributes = function(e) {881 if (e) {882 this.JSONData = {883 data: e884 };885 var o, r, n, l, i, s, c, d, u = this, p = u.getFromEnv("chart").jsonData, g = u.config, f = p.map || p.chart, m = [], b = u.getFromEnv("colorManager"), k = p.entitydef || [];886 for (i in !g.attachEvent && b && (u.addExtEventListener("legendUpdate", (function() {887 if ("legend" === (d = arguments[1]).component)888 u.legendInteractivity(d.legendItem, d.colorObj);889 else890 for (m = d.maxMinArray,891 s = m.length,892 c = 0; c < s; c++)893 u.updateEntityColors(m[c].min, m[c].max)894 }895 ), b),896 g.attachEvent = !0),897 o = p.data && p.data[0] && p.data[0].data ? u.JSONData = p.data[0].data || [] : u.JSONData = p.data || [],898 g.useSNameAsId = (0,899 h.pluckNumber)(f.usesnameasid, 0),900 this._redefineEntities(k),901 r = u.components.data,902 g.showTooltip = (0,903 h.pluckNumber)(f.showtooltip, 1),904 g.showHoverEffect = (0,905 h.pluckNumber)(f.showhovereffect, 0),906 o = function(e) {907 for (var t, o = e && e.length || 0, r = {}; o--; )908 (t = e[o]).id !== a && (r[t.id.toLowerCase()] = t);909 return r910 }(o),911 u.calculateDataLimits(),912 !p.colorrange && u._detachChild(u.getChildren("colorRange") && u.getChildren("colorRange")[0]),913 r)914 n = o[i],915 l = r[i],916 n ? this._configureEntity(i, l, (0,917 h.imprint)(t._sanitizeEntityOptions((0,918 h.extend2)({}, n)), l.config)) : this._configureEntity(i, l, l.config)919 }920 }921 ,922 o.updateEntityColors = function(e, t) {923 var o, r, a, n, l, i = this.components.data, s = this.getFromEnv("chart").config.entityOpts, c = s.nullEntityAlpha, h = s.nullEntityColor, d = F({924 fill: h,925 alpha: c926 }), u = {927 "fill-opacity": 0928 };929 for (n in i)930 i.hasOwnProperty(n) && (a = (r = (o = i[n]).config).cleanValue,931 l = {932 "fill-opacity": (r.alphaArr || [])[0] / 100 || 1933 },934 null == a ? (L(o, d),935 o.hidden = !1) : a < e || a > t ? (L(o, u),936 o.hidden = !0) : (L(o, l),937 o.hidden = !1))938 }939 ,940 o.legendInteractivity = function(e, t) {941 var o, r, a, n, l, i, s = this.getFromEnv("chart"), c = this.components.data, h = e.config, d = e.hasState("hidden"), u = this.getFromEnv("colorManager"), p = {}, g = {942 "fill-opacity": 0943 };944 for (o in s.getFromEnv("animationManager").setAnimationState("legendInteraction"),945 c)946 c.hasOwnProperty(o) && (a = (h = (r = c[o]).config).cleanValue,947 i = u.getColorObj(a),948 n = h.visibleEntityAttr,949 p["fill-opacity"] = n["fill-opacity"],950 l = d ? p : g,951 t.code === (!i.outOfRange && i.code) && (r.hidden = !d,952 L(r, l),953 d ? e && e.removeLegendState("hidden") : e.setLegendState("hidden")))954 }955 ,956 o.calculateDataLimits = function() {957 var e, t, o, r, a = this.getFromEnv("chart"), n = this.config, l = a.jsonData.data || [], i = this.getFromEnv("number-formatter"), s = +Infinity, c = -Infinity;958 for (r = 0,959 o = l.length; r < o; r++)960 t = l[r].value,961 e = i.getCleanValue(t),962 s = b(s, e),963 c = k(c, e);964 n.max = c,965 n.min = s966 }967 ,968 o._configureEntity = function(e, t, o) {969 var r, n, l, i, s, c, d, u, p, g, f, m, b, k, v, C, y, w, A, E, L, x, N = this.getFromEnv("chart"), S = this.config, _ = this.getFromEnv("number-formatter"), T = N.config.entityOpts, I = t.config, M = t.labelConfig, O = o.value, B = I.cleanValue = _.getCleanValue(O), P = I.formattedValue = B !== a ? _.dataLabels(B) : a, D = (0,970 h.pluckNumber)(o.showtooltip, T.showTooltip), R = this._getDefaultTooltip(t, o, this), j = {971 formattedValue: P,972 sName: o.shortLabel,973 lName: o.label974 }, V = T.dataLabels.style, G = I.toolText = D ? (0,975 h.parseUnsafeString)((0,976 h.pluck)((0,977 h.parseTooltext)((0,978 h.pluck)(o.tooltext, T.tooltext, R), [1, 2, 7, 38, 39], j, o)), !1) : "", H = I.borderColor = (0,979 h.pluck)(o.bordercolor, T.borderColor), W = I.borderAlpha = (0,980 h.pluck)(o.borderalpha, T.borderAlpha), z = I.borderThickness = (0,981 h.pluckNumber)(o.borderthickness, T.borderThickness), X = T.hoverOnNull, Y = I.useHoverColor = (0,982 h.pluckNumber)(o.showhovereffect, o.usehovercolor, X ? T.showHoverEffect : isNaN(O) ? 0 : T.showHoverEffect), K = I.labelAlignment, J = this.getFromEnv("colorManager");983 if (t.hidden = !1,984 I.showLabel = (0,985 h.pluckNumber)(o.showlabel, T.showLabels),986 I.labelPadding = (0,987 h.pluckNumber)(o.labelpadding, T.labelPadding),988 I.fontFamily = (0,989 h.pluck)(o.font, V.fontFamily),990 I.fontSize = (0,991 h.pluckNumber)(parseInt(o.fontsize, 10), parseInt(V.fontSize, 10)),992 I.fontBold = (0,993 h.pluckNumber)(o.fontbold, 0),994 I.fontColor = (0,995 h.pluck)(o.labelcolor, o.fontcolor, V.color),996 I.labelBgColor = (0,997 h.pluck)(o.labelbgcolor, V.bgColor) || "",998 I.labelBorderColor = (0,999 h.pluck)(o.labelbordercolor, V.borderColor) || "",1000 I.connectorColor = (0,1001 h.pluck)(o.labelconnectorcolor, T.connectorColor),1002 I.connectorAlpha = (0,1003 h.pluck)(o.labelconnectoralpha, T.connectorAlpha),1004 I.hoverBorderThickness = (0,1005 h.pluckNumber)(o.borderhoverthickness, o.hoverborderthickness, T.hoverBorderThickness),1006 I.hoverBorderColor = (0,1007 h.pluck)(o.borderhovercolor, o.hoverbordercolor, T.hoverBorderColor, I.borderColor),1008 I.hoverBorderAlpha = (0,1009 h.pluck)(o.borderhoveralpha, o.hoverborderalpha, T.hoverBorderAlpha, I.borderAlpha),1010 I.connectorThickness = (0,1011 h.pluckNumber)(o.labelconnectorthickness, T.connectorThickness),1012 I.origConnectorThickness = I.connectorThickness,1013 I.borderThickness = z,1014 I.link = o.link,1015 I.isVisible = !0,1016 I.id = e,1017 I.originalId = o.origId,1018 null !== B && (r = J && J.getColor(B)) && !r.outOfRange && (C = r.code,1019 r.oriAlpha !== a && (y = r.oriAlpha + "")),1020 (0,1021 h.pluck)(o.color, o.alpha, o.angle, o.ratio) !== a ? (s = (0,1022 h.pluck)(o.color, C, T.fillColor),1023 c = (0,1024 h.pluck)(o.alpha, y, T.fillAlpha),1025 d = (0,1026 h.pluck)(o.angle, T.fillAngle),1027 u = (0,1028 h.pluck)(o.ratio, T.fillRatio),1029 p = F({1030 color: s,1031 alpha: c,1032 angle: d,1033 ratio: u1034 })) : (k = F({1035 color: (0,1036 h.pluck)(C, T.fillColor),1037 alpha: (0,1038 h.pluck)(y, T.fillAlpha),1039 angle: (0,1040 h.pluck)(T.fillAngle),1041 ratio: (0,1042 h.pluck)(T.fillRatio)1043 }),1044 b = F({1045 color: (0,1046 h.pluck)(T.nullEntityColor),1047 alpha: (0,1048 h.pluck)(T.nullEntityAlpha),1049 angle: (0,1050 h.pluck)(T.nullEntityAngle),1051 ratio: (0,1052 h.pluck)(T.nullEntityRatio)1053 }),1054 s = (p = null === B ? b : k).FCcolor.color,1055 c = p.FCcolor.alpha,1056 d = p.FCcolor.angle,1057 u = p.FCcolor.ratio),1058 "" === G && (S.showTooltip = 0),1059 I.visibleEntityAttr = {1060 stroke: (0,1061 h.convertColor)(H, W),1062 fill: (I.fillColor = p).toString(),1063 "fill-opacity": c / 1001064 },1065 x = c.split(","),1066 I.alphaArr = x,1067 Y && ((0,1068 h.pluck)(o.fillhovercolor, o.fillhoveralpha, o.fillhoverangle, o.fillhoverratio, o.hoverfillcolor, o.hoverfillalpha, o.hoverfillratio, o.hoverfillangle) !== a ? (s = (0,1069 h.pluck)(o.fillhovercolor, o.hoverfillcolor, T.hoverFillColor),1070 c = (0,1071 h.pluck)(o.fillhoveralpha, o.hoverfillalpha, T.hoverFillAlpha),1072 d = (0,1073 h.pluck)(o.fillhoverangle, o.hoverfillangle, T.hoverFillAngle),1074 u = (0,1075 h.pluck)(o.fillhoverratio, o.hoverfillratio, T.hoverFillRatio),1076 v = F({1077 color: s,1078 alpha: c,1079 angle: d,1080 ratio: u1081 })) : (T.hoverColorObject || (T.hoverColorObject = F({1082 color: T.hoverFillColor,1083 alpha: T.hoverFillAlpha,1084 angle: T.hoverFillAngle,1085 ratio: T.hoverFillRatio1086 })),1087 v = T.hoverColorObject),1088 I.hoverColor = v),1089 !M && (M = t.labelConfig = {}),1090 g = I.fontColor,1091 f = I.fontFamily,1092 m = I.fontBold,1093 G = I.toolText,1094 n = I.link,1095 K ? (l = K[0],1096 i = K[1]) : (l = "center",1097 i = "middle"),1098 M.align = l,1099 M.vAlign = i,1100 M.fontColor = g,1101 M.bgColor = I.labelBgColor,1102 M.borderColor = I.labelBorderColor,1103 M.fontFamily = f,1104 M.fontBold = m,1105 M.toolText = G,1106 M.link = n,1107 "object" == typeof I.options)1108 for (w = I.entityLabels = I.entityLabels || [],1109 L = (E = I.labels || []).length; L--; )1110 w[L] || (w[L] = {1111 config: {}1112 }),1113 M = w[L].config,1114 (K = E[L].labelAlignment) ? (l = K[0],1115 i = K[1]) : (l = "center",1116 i = "middle"),1117 M.align = l,1118 M.vAlign = i,1119 M.displayValue = this.getDisplayValue(t, E[L], I.options.isDataEnabled, !L, o),1120 M.toolText = G,1121 M.align = l,1122 M.vAlign = i,1123 M.bgColor = I.labelBgColor,1124 M.borderColor = I.labelBorderColor,1125 M.fontColor = g,1126 M.fontFamily = f,1127 M.fontBold = m,1128 M.toolText = G;1129 else1130 A = {1131 shortText: I.shortLabel,1132 text: I.label1133 },1134 M.displayValue = this.getDisplayValue(t, A, !0, !0, o)1135 }1136 ,1137 o.getDisplayValue = function(e, t, o, r, n) {1138 var l, i = this.getFromEnv("chart").config.entityOpts, s = e.config, c = s.cleanValue, d = s.formattedValue, u = i.labelSepChar;1139 return o ? r && "undefined" != typeof n.displayvalue ? l = n.displayvalue : (l = (0,1140 h.pluck)(i.includeNameInLabels ? i.useShortName ? t.shortText : t.text : ""),1141 i.includeValueInLabels && null !== c && (l = l === a ? d : l + u + d)) : l = s.label,1142 l1143 }1144 ,1145 t._sanitizeEntityOptions = function(e) {1146 return delete e.outlines,1147 delete e.label,1148 delete e.shortlabel,1149 delete e.labelposition,1150 delete e.labelalignment,1151 delete e.labelconnectors,1152 e1153 }1154 ,1155 o._redefineEntities = function(e) {1156 var t, o, r, a, n, l, i, s, c, d, u, p, g = this.config, f = {}, m = {}, b = this.getFromEnv("chart").config.entities, k = g.useSNameAsId, v = 0;1157 for (t = e.length; t--; )1158 if (r = (o = e[t]).internalid,1159 a = o.newid ? o.newid : r,1160 n = o.sname,1161 l = o.lname,1162 p = b[r],1163 r = (0,1164 h.trimString)(r),1165 a = (a = (0,1166 h.trimString)(a)) && a.toLowerCase(),1167 p) {1168 for (u in f[a] = s = {1169 origId: r1170 },1171 m[r] = !0,1172 p)1173 s[u] = p[u];1174 s.shortLabel = n || p.shortLabel,1175 s.label = l || p.label,1176 s.showhovereffect = o.showhovereffect,1177 s.fillhovercolor = o.fillhovercolor,1178 s.fillhoveralpha = o.fillhoveralpha,1179 s.fillhoverangle = o.fillhoverangle,1180 s.fillhoverratio = o.fillhoverratio,1181 s.borderhoverthickness = o.borderhoverthickness1182 }1183 for (i in (d = this.components.data) || (d = this.components.data = {}),1184 f)1185 d[i = i.toLowerCase()] || (d[i] = {1186 config: {}1187 }),1188 d[i].config = f[i],1189 v += 1;1190 for (i in c = d,1191 b)1192 if (s = b[i],1193 !m[i = (0,1194 h.trimString)(i)]) {1195 for (u in k ? ((p = c[s.shortLabel.toLowerCase()]) || (p = c[s.shortLabel.toLowerCase()] = {}),1196 p.config = {},1197 p.origId = s.shortLabel) : ((p = c[i.toLowerCase()]) || (p = c[i.toLowerCase()] = {}),1198 p.config = {},1199 p.config.origId = i),1200 s)1201 p.config[u] = s[u];1202 v += 11203 }1204 g.entityCount = v1205 }1206 ,1207 o.draw = function() {1208 var e = this.config1209 , t = this.getFromEnv("chart")1210 , o = h.hasSVG ? 200 : 10;1211 this.createContainer(),1212 this.config.ready = !1,1213 e.BATCH_SIZE = o,1214 e.labelBatchSize = h.hasSVG ? 200 : 20,1215 this._batchRender()(0),1216 t.config.entityFlag = !0,1217 t.checkComplete()1218 }1219 ,1220 o._batchRender = function() {1221 var e, t, o, r, n, l = this, i = l.config, s = l.getFromEnv("chart").config.entities.firstEntity, c = l.components.data, h = i.BATCH_SIZE, u = i.entityKeys = s ? l._getKeys(s, c) : Object.keys(c), p = i.entityLength = u.length;1222 return function g(i) {1223 for (e = i,1224 o = 0; u[e] !== a; )1225 if (t = c[u[e]],1226 n = l.drawEntity(t, h),1227 o += n,1228 t.config.drawn && ((r = e === p - 1 ? t : c[u[e - 1]]) && (r.config.drawn = !1,1229 r.config.outlineStartIndex = a),1230 e++),1231 o >= h) {1232 l.addJob("entityDraw", g.bind(l, e), d.priorityList.entitydraw);1233 break1234 }1235 e === p && (l._addEventListenersToEntities(0),1236 l.initComplete())1237 }1238 }1239 ,1240 o._addEventListenersToEntities = function(e) {1241 var t, o, r, a = this.components.data, n = this.config, l = n.BATCH_SIZE, i = n.entityKeys, s = n.entityLength, c = 0;1242 for (t = e; t < s; t++)1243 if ((r = (o = a[i[t]]).config.options) && !1 === r.isDataEnabled || this.addMouseGestures(o),1244 ++c === l) {1245 this.addJob("_addEventListenersToEntities", this._addEventListenersToEntities.bind(this, t), d.priorityList.entitydraw);1246 break1247 }1248 }1249 ,1250 t._getKeys = function(e, t) {1251 for (var o = [e], r = e; t[r]; )1252 r = t[r].nextId,1253 o.push(r);1254 return o1255 }1256 ,1257 o._getDefaultTooltip = function(e, t) {1258 var o, r, n = e.config.cleanValue, l = e.config.formattedValue, i = this.getFromEnv("chart").config.entityOpts;1259 if ("object" == typeof e.config.options) {1260 if (!(r = t.labels && t.labels[0]))1261 return a;1262 o = (i.useSNameInTooltip ? r.shortText : r.text) + (null === n ? "" : i.tooltipSepChar + l)1263 } else1264 o = (i.useSNameInTooltip ? t.shortLabel : t.label) + (null === n ? "" : i.tooltipSepChar + l);1265 return o1266 }1267 ,1268 o.drawEntity = function(e, t) {1269 var o, r, n, l, i, s, c, d, u = this.getFromEnv("chart"), p = u.getFromEnv("animationManager"), g = e.config, m = h.hasSVG || !f ? "litepath" : "path", b = u.config.entityOpts, k = g.outlines, v = this.getFromEnv("toolTipController"), C = this.getLinkedParent().getChildContainer("plot"), y = this.getLinkedParent().getChildContainer("plotShadow"), F = g.toolText, A = b.shadow, E = [], L = {};1270 if (this._configureEntityDrawingParams(e),1271 r = (g = e.config).visibleEntityAttr,1272 d = g.shadowOptions,1273 o = g.outlineStartIndex === a ? k.length : g.outlineStartIndex,1274 e.graphics || (e.graphics = {}),1275 s = 0,1276 E = g.outlinePath || (g.outlinePath = []),1277 c = g.customStrokeWidthModifier,1278 "object" == typeof g.options) {1279 for (; o--; )1280 if (E = k[o].outline,1281 n = !0 === g.options.isDataEnabled ? r : (0,1282 h.extend2)((0,1283 h.extend2)({}, r), w(k[o].style, c)),1284 (l = e.graphics.outlines) || (l = e.graphics.outlines = []),1285 !l[o] && (l[o] = {}),1286 i = l[o].outline,1287 n[m] = E,1288 (i = l[o].outline = p.setAnimation({1289 el: m,1290 container: C,1291 attr: n,1292 component: this,1293 label: "path"1294 })).shadow(!!A && d, y),1295 v.enableToolTip(i, F),1296 s++,1297 g.outlineStartIndex = o,1298 s === t)1299 return s;1300 return g.drawn = !0,1301 s1302 }1303 for (; o--; )1304 if (E = k[o].concat(E),1305 s++,1306 g.outlineStartIndex = o,1307 s === t)1308 return g.outlinePath = E,1309 s;1310 return !e.graphics.outlines && (r[m] = E),1311 Object.assign(L, r, e.hidden && {1312 "fill-opacity": 01313 } || {}),1314 e.graphics.outlines = p.setAnimation({1315 el: e.graphics.outlines || m,1316 container: C,1317 attr: L,1318 component: this,1319 label: "path"1320 }),1321 g.drawn = !0,1322 g.outlineStartIndex = 0,1323 g.outlinePath = [],1324 e.graphics.outlines.shadow(!!A && d, y),1325 v.enableToolTip(e.graphics.outlines, F),1326 s1327 }1328 ,1329 o._configureEntityDrawingParams = function(e) {1330 var t, o = this.getFromEnv("chart"), r = e.config, a = o.config.entityOpts, n = o.config.scalingParams, l = !f || h.hasSVG, i = n.scaleFactor, s = n.strokeWidth, c = (l ? o.baseScaleFactor : 1) * s, d = 1 === a.scaleBorder, u = r.borderThickness, p = r.alphaArr, g = r.origConnectorThickness, b = r.hoverBorderThickness, v = r.visibleEntityAttr, C = v["fill-opacity"];1331 r.shadowOptions = {1332 scalefactor: [i, i * o.config.baseScaleFactor],1333 opacity: k.apply(m, p) / 100,1334 useFilter: 01335 },1336 r.fillOpacity = e.hidden ? 0 : C,1337 l ? (u = r.entityBorderThickness = d ? u * c : u / i,1338 g /= i,1339 t = d ? i : n.sFactor,1340 b && (b = r.hoverBorderThickness = d ? b * c : b / i)) : (u = d ? u * s : u,1341 t = d ? n.scaleFactor : o.baseScaleFactor),1342 r.entityBorderThickness = u,1343 r.connectorThickness = g,1344 r.customStrokeWidthModifier = t,1345 v["stroke-width"] = u,1346 v.transform = h.hasSVG || !f ? "" : n.transformStr1347 }1348 ,1349 o.drawLabels = function(e) {1350 var t, o, r, a, n = e, l = this.getFromEnv("chart"), s = this.config, c = s.labelBatchSize, h = s.entityLength, d = [], u = l.getChildContainer("upperAnnotationGroup"), p = 0, g = this.getChildren("mapLabelAnnotations") && this.getChildren("mapLabelAnnotations")[p], f = 0, m = 0, b = l.config.annotationConfig;1351 for (t in g || (a = new i["default"],1352 this.attachChild(a, "mapLabelAnnotations"),1353 (g = this.getChildren("mapLabelAnnotations")[p]).addCustomGroup(u)),1354 g.destroy(),1355 g._renderer && (g._renderer = null),1356 b.showbelow = 0,1357 n) {1358 if (this.drawLabel(n[t], d),1359 ++f === c) {1360 for (o = 0; o < d.length; o++)1361 d[o].animationLabel = "entityLabel";1362 for (r = g.addGroup(Object.assign(b, {1363 id: "entityLabels" + p,1364 items: d,1365 animationLabel: "entityLabelGroup"1366 }), this),1367 o = 0; o < r.items.length; o++)1368 r.items[o].addEventListener("fc-mouseover", d[o].onmouseover),1369 r.items[o].addEventListener("fc-mouseout", d[o].onmouseout),1370 r.items[o].addEventListener("fc-click", d[o].onclick);1371 p++,1372 (g = this.getChildren("mapLabelAnnotations") && this.getChildren("mapLabelAnnotations")[p]) || (a = new i["default"],1373 this.attachChild(a, "mapLabelAnnotations"),1374 (g = this.getChildren("mapLabelAnnotations")[p]).addCustomGroup(u)),1375 g.destroy(),1376 g._renderer && (g._renderer = null),1377 f = 0,1378 d = []1379 } else if (m === h - 1) {1380 for (o = 0; o < d.length; o++)1381 d[o].animationLabel = "entityLabel";1382 for (r = g.addGroup(Object.assign(b, {1383 id: "entityLabels" + p,1384 items: d,1385 animationLabel: "entityLabelGroup"1386 }), this),1387 o = 0; o < r.items.length; o++)1388 r.items[o].addEventListener("fc-mouseover", d[o].onmouseover),1389 r.items[o].addEventListener("fc-mouseout", d[o].onmouseout),1390 r.items[o].addEventListener("fc-click", d[o].onclick)1391 }1392 m++1393 }1394 this.drawLabelConnFn(0)1395 }1396 ,1397 o.drawLabelConnFn = function(e) {1398 var t, o, r, a, n, l = this.config, i = this.components.data, s = l.BATCH_SIZE, c = l.entityKeys, h = c.length, u = 0;1399 for (o = e; o < h; o++) {1400 if ("object" == typeof (a = (n = i[c[o]]).config).options)1401 for (t = (r = a.labels) && r.length || 0; t--; )1402 r[t].labelConnectors && (this.drawLabelConnectors(n, r[t].labelConnectors, this),1403 u++);1404 else1405 a.labelConnectors && (this.drawLabelConnectors(n, a.labelConnectors, this),1406 u++);1407 if (u === s) {1408 this.addJob("drawLabelConnectors", this.drawLabelConnFn.bind(this, o), d.priorityList.entitydraw);1409 break1410 }1411 }1412 }1413 ,1414 o._getLabelObject = function(e, t, o) {1415 var r, n, l, i, s, c, d, u, p, g, f, m = this, b = m.getFromEnv("chart"), k = m.getFromEnv("chart-attrib"), v = e.config, C = b.config.scalingParams, y = e.graphics && e.graphics.outlines, F = v.fontSize, w = v.labelPadding, L = v.labels || [], x = v.entityLabels || [];1416 return t !== a ? (f = L[t],1417 i = (r = x[t].config).style = f.style,1418 n = f.labelPosition,1419 l = f.labelAlignment) : (r = e.labelConfig,1420 n = v.labelPosition,1421 l = v.labelAlignment),1422 n ? (s = n[0],1423 c = n[1]) : (s = (d = y.getBBox()).x + d.width / 2,1424 c = d.y + d.height / 2),1425 l ? ("right" === (u = l[0]) ? s -= w : "left" === u && (s += w),1426 "top" === (p = l[1]) ? c -= w : "bottom" === p && (c += w)) : (u = "center",1427 p = "middle"),1428 g = parseFloat(F) / C.sFactor,1429 !o && i && (i.color && (r.fontColor = i.color),1430 i["font-size"] && (g = parseFloat(i["font-size"]) / C.sFactor),1431 i["font-family"] && (r.fontFamily = i["font-family"]),1432 i["font-weight"] !== a && (r.fontBold = "bold" === i["font-weight"])),1433 r.x = s.toString(),1434 r.y = c.toString(),1435 r.wrap = 1,1436 r.type = "text",1437 r.fontSize = g,1438 {1439 x: s.toString(),1440 y: c.toString(),1441 wrapwidth: A[u](void 0, s + void 0) - w,1442 wrapheight: E[p](void 0, c + void 0) - w,1443 wrap: 1,1444 type: "text",1445 align: r.align,1446 valign: r.vAlign,1447 text: r.displayValue,1448 tooltext: r.toolText,1449 outlineText: (0,1450 h.pluckNumber)(k.textoutline, 0),1451 css: r.link !== a && {1452 cursor: "pointer",1453 _cursor: "hand"1454 },1455 bgcolor: r.bgColor,1456 bordercolor: r.borderColor,1457 fillcolor: r.fontColor,1458 fontsize: r.fontSize,1459 font: r.fontFamily,1460 bold: r.fontBold,1461 onclick: function(t) {1462 var o, r, a = e.graphics.outlines;1463 if (a instanceof Array)1464 for (o = 0,1465 r = a.length; o < r; o++)1466 m.entityClick(a[o].outline, t);1467 else1468 m.entityClick(a, t)1469 },1470 onmouseover: function(t) {1471 var o, r, a = e.graphics.outlines;1472 if (a instanceof Array)1473 for (o = 0,1474 r = a.length; o < r; o++)1475 m.entityRollOver(a[o].outline, t);1476 else1477 m.entityRollOver(a, t)1478 },1479 onmouseout: function(t) {1480 var o, r, a = e.graphics.outlines;1481 if (a instanceof Array)1482 for (o = 0,1483 r = a.length; o < r; o++)1484 m.entityRollOut(a[o].outline, t);1485 else1486 m.entityRollOut(a, t)1487 },1488 ontouchstart: function(t) {1489 var o, r, a = e.graphics.outlines;1490 if (a instanceof Array)1491 for (o = 0,1492 r = a.length; o < r; o++)1493 m.entityRollOver(a[o].outline, t);1494 else1495 m.entityRollOver(a, t);1496 m.entityRollOver(a, t)1497 }1498 }1499 }1500 ,1501 o.drawLabel = function(e, t) {1502 var o, r, n, l = e.config;1503 if (l.showLabel)1504 if ("object" == typeof l.options)1505 for (r = (n = l.labels) && n.length || 0,1506 o = l.options.isDataEnabled; r--; )1507 t.push(this._getLabelObject(e, r, o, !r));1508 else1509 t.push(this._getLabelObject(e, a, !0, !0))1510 }1511 ,1512 o.drawLabelConnectors = function(e, t, o) {1513 for (var r, a, n = e.config, l = this.getFromEnv("chart"), i = l.getFromEnv("animationManager"), s = l.config.scalingParams, c = o.getLinkedParent().getChildContainer("plot"), d = t && t.length || 0, u = n.showLabel; d--; )1514 a = t[d],1515 r = e.graphics.connectorElem,1516 u ? e.graphics.connectorElem = r = i.setAnimation({1517 el: e.graphics.connectorElem || "path",1518 attr: {1519 path: a,1520 opacity: 1,1521 transform: h.hasSVG || !f ? "" : s.transformStr,1522 stroke: (0,1523 h.convertColor)(n.connectorColor, n.connectorAlpha),1524 "shape-rendering": "crisp",1525 "stroke-width": n.connectorThickness1526 },1527 container: c,1528 component: this,1529 label: "labelConnectors"1530 }) : r && r.hide()1531 }1532 ,1533 o.entityClick = function(e, t) {1534 var o = e.node.__entity1535 , r = this.getFromEnv("chart")1536 , n = r.config.scalingParams1537 , l = e.getBBox()1538 , i = r.getFromEnv("linkClickFN")1539 , s = o.config1540 , c = s.link;1541 l.width = l.width * n.scaleFactor,1542 l.height = l.height * n.scaleFactor,1543 l.x = l.x * n.scaleFactor + n.translateX,1544 l.y = l.y * n.scaleFactor + n.translateY,1545 l.x2 = l.x + l.width,1546 l.y2 = l.y + l.height,1547 r.fireChartInstanceEvent("entityclick", s.eventArgs, t),1548 c !== a && i.call({1549 link: c,1550 entity: o,1551 entityBox: l1552 }, !0)1553 }1554 ,1555 o.entityRollOver = function(e, t) {1556 var o = e.node.__entity1557 , r = o.config1558 , a = this.getFromEnv("chart")1559 , n = a.getFromEnv("animationManager")1560 , l = r.hoverAttr;1561 a.plotEventHandler(e, t, "entityRollOver"),1562 e.data("hovered") ? clearTimeout(o.config.timer) : r.useHoverColor && r.isVisible && !o.hidden && l && (a.config.hoverEntity = e,1563 n.setAnimation({1564 el: e,1565 attr: l,1566 component: this,1567 state: "updating",1568 label: "path"1569 }),1570 e.data("hovered", !0))1571 }1572 ,1573 o.entityRollOut = function(e, t) {1574 var o = e.node.__entity1575 , r = this1576 , a = r.getFromEnv("chart")1577 , n = a.getFromEnv("animationManager")1578 , l = o.config.revertAttr;1579 a.plotEventHandler(e, t, "entityRollOut"),1580 o.config.timer = setTimeout((function() {1581 !0 !== o.hidden && l && (n.setAnimation({1582 el: e,1583 attr: l,1584 component: r,1585 state: "updating",1586 label: "path"1587 }),1588 e.data("hovered", !1))1589 }1590 ), 100)1591 }1592 ,1593 o.addMouseGestures = function(e) {1594 var t, o, r, n, l = e.config, i = l.originalId, s = this, c = e.graphics, d = l.useHoverColor, u = l.hoverBorderThickness, p = l.hoverBorderColor, g = l.hoverBorderAlpha, f = l.entityBorderThickness, m = l.borderColor, b = l.borderAlpha, k = l.link, v = l.visibleEntityAttr, C = "groupId" + i, y = function(t) {1595 k !== a && t.css({1596 cursor: "pointer",1597 _cursor: "hand"1598 }),1599 t.data("eventArgs", l.eventArgs),1600 t.data("groupId", C),1601 t.node.__entity = e,1602 e._listenersBinded || t.on("fc-click", s.entityClick.bind(s, t)).hover(s.entityRollOver.bind(s, t), s.entityRollOut.bind(s, t))1603 };1604 for (t in l.eventArgs = {1605 value: l.cleanValue,1606 label: l.label,1607 shortLabel: l.shortLabel,1608 originalId: l.origId,1609 id: l.id || l.origId1610 },1611 l.legacyEventArgs = {1612 value: l.value,1613 lName: l.label,1614 sName: l.shortLabel,1615 id: l.originalId || l.id1616 },1617 d && (l.hoverAttr = {1618 fill: (0,1619 h.toRaphaelColor)(l.hoverColor)1620 },1621 l.revertAttr = {1622 fill: (0,1623 h.toRaphaelColor)(l.fillColor),1624 stroke: (0,1625 h.toRaphaelColor)(l.borderColor, l.borderAlpha)1626 },1627 l.revertAttr["fill-opacity"] = v["fill-opacity"],1628 u !== f && (l.hoverAttr["stroke-width"] = (0,1629 h.pluckNumber)(u, f),1630 l.revertAttr["stroke-width"] = f),1631 p === m && g === b || (l.hoverAttr.stroke = (0,1632 h.convertColor)(p, g),1633 l.revertAttr.stroke = (0,1634 h.convertColor)(m, b))),1635 c)1636 if (c.hasOwnProperty(t))1637 if (c[t]instanceof Array) {1638 for (o = 0,1639 r = (n = c[t]).length; o < r; o++)1640 y(n[o].outline);1641 e._listenersBinded = !01642 } else1643 y(c[t]),1644 e._listenersBinded = !01645 }1646 ,1647 o.getDataLimits = function() {1648 var e = this.config;1649 return {1650 max: e.max,1651 min: e.min1652 }1653 }1654 ,1655 o.createContainer = function() {1656 var e = this.getLinkedParent()1657 , t = this.getFromEnv("animationManager")1658 , o = e.getChildContainer("layer0");1659 !this.getChildContainer("abovePlotGroup") && this.addChildContainer("abovePlotGroup", t.setAnimation({1660 el: "group",1661 attr: {1662 name: "abovePlotGroup",1663 opacity: 11664 },1665 container: o,1666 component: this,1667 label: "group"1668 })),1669 !this.getChildContainer("belowPlotGroup") && this.addChildContainer("belowPlotGroup", t.setAnimation({1670 el: "group",1671 attr: {1672 name: "belowPlotGroup",1673 opacity: 11674 },1675 container: o,1676 component: this,1677 label: "group"1678 }))1679 }1680 ,1681 o.initComplete = function() {1682 var e = this.getFromEnv("chart")1683 , t = this.components.data;1684 this.drawLabels(t),1685 e.config.entitiesReady = !0,1686 e.checkComplete()1687 }1688 ,1689 t1690 }(l.ComponentInterface);1691 t["default"] = x1692 },1693 1197: function(e, t, o) {1694 "use strict";1695 t.__esModule = !0,1696 t["default"] = void 0;1697 var r = [{1698 initialAttr: function() {1699 return {1700 opacity: 01701 }1702 },1703 finalAttr: function() {1704 return {1705 opacity: 11706 }1707 }1708 }]1709 , a = function() {1710 return r[0].slot = "plot",1711 r1712 }1713 , n = function(e) {1714 return [{1715 finalAttr: function() {1716 return e.finalAttr1717 }1718 }]1719 }1720 , l = function() {1721 return r[0].slot = "final",1722 r1723 }1724 , i = function() {1725 return [{1726 initialAttr: {1727 opacity: 01728 },1729 finalAttr: {1730 opacity: 11731 },1732 slot: "final"1733 }]1734 }1735 , s = function() {1736 return r[0].slot = "final",1737 r1738 }1739 , c = function(e) {1740 return [{1741 finalAttr: function() {1742 return e.finalAttr1743 }1744 }]1745 }1746 , h = function(e) {1747 return [{1748 initialAttr: function() {1749 return Object.assign({1750 opacity: 01751 }, e.attr)1752 },1753 finalAttr: function() {1754 return e.attr1755 },1756 slot: "plot"1757 }]1758 }1759 , d = function(e) {1760 return [{1761 initialAttr: function() {1762 return Object.assign({1763 opacity: 01764 }, e.attr)1765 },1766 finalAttr: function() {1767 return e.attr1768 },1769 slot: "plot"1770 }]1771 }1772 , u = {1773 "initial.dataset.entities": function() {1774 return {1775 "path.appearing": a,1776 "path.updating": n,1777 "labelConnectors.appearing": l,1778 "labelConnectors.updating": null,1779 "entityLabel.appearing": i,1780 "*": null1781 }1782 },1783 "initial.dataset.markers": function() {1784 return {1785 markers: null,1786 "markerItem.appearing": s,1787 "markerItem.updating": c1788 }1789 },1790 "initial.group.mapGroup": function() {1791 return {1792 "group.appearing": h,1793 "group.updating": d,1794 "*": null1795 }1796 }1797 };1798 t["default"] = u1799 },1800 1198: function(e, t, o) {1801 "use strict";1802 var r = o(187);1803 t.__esModule = !0,1804 t["default"] = void 0;1805 var a, n = r(o(207)), l = r(o(1196)), i = r(o(617)), s = r(o(269)), c = o(201), h = r(o(1197)), d = o(193), u = o(200), p = o(205), g = window.Math, f = g.min, m = g.max, b = function(e) {1806 var t, o = this.getFromEnv("chart"), r = this.getChildren("mapAnnotations")[0], n = e.markerShape, l = n.groupConfig, i = n.data("unfilteredConfig"), s = i._markerEventArgs, c = e.config;1807 i.hovereffect && ("circle" === n.config.type && (t = (0,1808 d.extend2)({1809 fillcolor: i.hoverfillcolor,1810 fillalpha: i.hoverfillalpha,1811 fillangle: i.hoverfillangle,1812 fillratio: i.hoverfillratio,1813 gradientUnits: "objectBoundingBox",1814 radialGradient: 11815 }, i._hoverattrs)),1816 t = (0,1817 d.extend2)({}, i._hoverattrs),1818 r.update(n.getId(), t)),1819 s || (s = i._markerEventArgs = {1820 x: +i.x,1821 y: +i.y,1822 scaledX: i.x * l.scaleX,1823 scaledY: i.y * l.scaleY,1824 chartX: i.x * l.scaleX + l.grpXShift,1825 chartY: i.y * l.scaleY + l.grpYShift,1826 id: i.id,1827 label: i.label1828 }),1829 (0,1830 u.raiseEventGroup)(c.options.id, "markerRollOver", s, o.getFromEnv("chartInstance"), c, a, a, a)1831 }, k = function(e) {1832 var t, o = this.getFromEnv("chart"), r = this.getChildren("mapAnnotations")[0], n = e.markerShape, l = n.getElement(), i = e.config, s = n.data("unfilteredConfig");1833 l && s.hovereffect && ("circle" === n.config.type && (t = (0,1834 d.extend2)({1835 fillcolor: n.config.rawColor,1836 fillalpha: n.config.rawAlpha,1837 fillangle: n.config.rawAngle,1838 fillratio: n.config.rawRatio,1839 gradientUnits: "objectBoundingBox",1840 radialGradient: "radial" === n.config.rawFillPattern1841 }, s._defaultattrs)),1842 t = (0,1843 d.extend2)({}, s._defaultattrs),1844 r.update(n.getId(), t)),1845 (0,1846 u.raiseEventGroup)(i.id, "markerRollOut", s._markerEventArgs, o.getFromEnv("chartInstance"), a, a, a)1847 }, v = function(e, t) {1848 var o = t.config.options1849 , r = this.getFromEnv("chart")1850 , a = t.markerShape1851 , n = a.config1852 , l = a.groupConfig1853 , i = this.getFromEnv("linkClickFN")1854 , s = a.config.link1855 , c = n._markerEventArgs;1856 s && i && i.call({1857 link: s1858 }, !0),1859 c || (c = n._markerEventArgs = {1860 x: +n.x,1861 y: +n.y,1862 scaledX: n.x * l.scaleX,1863 scaledY: n.y * l.scaleY,1864 chartX: n.x * l.scaleX + l.grpXShift,1865 chartY: n.y * l.scaleY + l.grpYShift,1866 id: o.id,1867 label: o.label1868 }),1869 r.fireChartInstanceEvent("markerClick", c, e)1870 }, C = function(e, t) {1871 var o, r = e && e.length || !1, n = t || "id", l = {};1872 if (!e)1873 return e;1874 for (; r--; )1875 (o = e[r])[n] !== a && (l[o[n].toLowerCase()] = o);1876 return l1877 }, y = function(e, t, o) {1878 return {1879 x: e.toString(),1880 y: (t - o).toString(),1881 align: "center",1882 valign: "top"1883 }1884 }, F = function(e, t, o) {1885 return {1886 x: (e - o).toString(),1887 y: t.toString(),1888 align: "right",1889 valign: "middle"1890 }1891 }, w = function(e, t, o) {1892 return {1893 x: (e + o).toString(),1894 y: t.toString(),1895 align: "left",1896 valign: "middle"1897 }1898 }, A = function(e, t, o) {1899 return {1900 x: e.toString(),1901 y: (t + o).toString(),1902 align: "center",1903 valign: "bottom"1904 }1905 }, E = function(e, t) {1906 return {1907 x: e.toString(),1908 y: t.toString(),1909 align: "center",1910 valign: "middle"1911 }1912 }, L = function() {1913 return arguments[1]1914 }, x = function(e, t) {1915 return e - t1916 }, N = function(e, t) {1917 return 2 * f(t, e - t)1918 }, S = function() {1919 return arguments[1]1920 }, _ = function(e, t) {1921 return 2 * f(t, e - t)1922 }, T = function(e, t) {1923 return e - t1924 };1925 (0,1926 c.addDep)({1927 name: "mapsAnimation",1928 type: "animationRule",1929 extension: h["default"]1930 });1931 var I = function(e) {1932 function t() {1933 var t;1934 return (t = e.call(this) || this).components = {},1935 t.getLabelAlignment = {1936 top: y,1937 left: F,1938 right: w,1939 bottom: A,1940 center: E1941 },1942 t.getWrapWidth = {1943 right: L,1944 left: x,1945 center: N1946 },1947 t.getWrapHeight = {1948 top: S,1949 middle: _,1950 bottom: T1951 },1952 t.hoverFn = b,1953 t.hoverOutFn = k,1954 t.clickFn = v,1955 t1956 }1957 (0,1958 n["default"])(t, e);1959 var o = t.prototype;1960 return o.getName = function() {1961 return "markers"1962 }1963 ,1964 o.getType = function() {1965 return "dataset"1966 }1967 ,1968 o.configureAttributes = function(e) {1969 if (e) {1970 this.JSONData = e;1971 var t, o = this.getChildren("mapAnnotations") && this.getChildren("mapAnnotations")[0], r = this.getFromEnv("chart").config.markerOpts;1972 o || (t = new s["default"],1973 this.attachChild(t, "mapAnnotations"),1974 o = this.getChildren("mapAnnotations")[0]),1975 o.destroy(),1976 this.calculateDataLimits(),1977 r.dataEnabled ? this._parseMarkers() : this.defineMarkersNShapes(),1978 this.configureConnectors()1979 }1980 }1981 ,1982 o.calculateMarkerRadiusLimits = function() {1983 if (this.JSONData) {1984 var e = this.JSONData1985 , o = this.config1986 , r = this.getFromEnv("chart")1987 , a = r.config.width1988 , n = r.config.height1989 , l = e.markermaxradius1990 , i = e.markerminradius1991 , s = t.getMarkerRadiusLimits(a, n, l, i);1992 o.minRadius = s.min,1993 o.maxRadius = s.max1994 }1995 }1996 ,1997 o.calculateDataLimits = function() {1998 var e, t, o, r, a = this.getFromEnv("chart"), n = this.config, l = (a.jsonData.markers || {}).items || [], i = this.getFromEnv("number-formatter"), s = +Infinity, c = -Infinity;1999 for (r = 0,2000 t = l.length; r < t; r++)2001 o = l[r].value,2002 null !== (e = i.getCleanValue(o)) && (s = f(e, s),2003 c = m(e, c));2004 n.min = s,2005 n.max = c2006 }2007 ,2008 o._parseMarkers = function() {2009 var e, o, r, n, l, i, s, c, h = this.getFromEnv("chart"), u = h.jsonData.markers, p = u.items, g = u.shapes, f = h.config.markerOpts, m = f.dataLabels.style, b = this.getFromEnv("number-formatter"), k = this.components.shapeObjs = {}, v = this.components.markerObjs = {};2010 if (p && p.length) {2011 if (g && g.length)2012 for (o = g.length; o; o -= 1)2013 (c = (n = g[o - 1]).id.toLowerCase()) && (k[c] = n);2014 for (o = p.length; o--; )2015 (c = (n = p[o]).id && n.id.toLowerCase()) && ((e = n.value) !== a && "" !== e && (e = parseFloat(e)),2016 (l = (r = t._initializeMarkerItem(c, n, null, h)).config.options.shapeid) && "string" == typeof l && (l = l.toLowerCase()),2017 s = (i = r.config).options,2018 i.cleanValue = b.getCleanValue(e),2019 null !== i.cleanValue ? i.formattedValue = b.dataLabels(e) : i.formattedValue = a,2020 i.fillColor = (0,2021 d.pluck)(s.fillcolor, s.color, f.fillColor),2022 i.fillAlpha = (0,2023 d.pluck)(s.fillalpha, s.alpha, f.fillAlpha),2024 i.fillRatio = (0,2025 d.pluck)(s.fillratio, f.fillRatio),2026 i.fillAngle = (0,2027 d.pluck)(s.fillangle, f.fillAngle),2028 i.borderThickness = (0,2029 d.pluckNumber)(s.borderthickness, f.borderThickness),2030 i.borderColor = (0,2031 d.pluck)(s.bordercolor, f.borderColor),2032 i.borderAlpha = (0,2033 d.pluck)(s.borderalpha, f.borderAlpha),2034 i.labelPadding = s.labelpadding || f.labelPadding,2035 i.fontColor = (0,2036 d.pluck)(s.labelcolor, m.fontColor),2037 i.labelBgColor = (0,2038 d.pluck)(s.labelbgcolor, m.labelBgColor) || "",2039 i.labelBorderColor = (0,2040 d.pluck)(s.labelbordercolor, m.labelBorderColor) || "",2041 n.__hideMarker && (r._isHidden = !0),2042 l && (r.shapeObj = k[l]),2043 v[c] = r)2044 }2045 }2046 ,2047 o.defineMarkersNShapes = function() {2048 var e, o, r, n, l, i, s, c, h = this.getFromEnv("chart"), u = h.jsonData.markers, p = u.definition, g = this.getFromEnv("number-formatter"), f = h.config.markerOpts, m = f.dataLabels.style, b = C(p) || {}, k = C(u.application) || {}, v = u.shapes, y = this.components.shapeObjs = this.components.shapeObjs || (this.components.shapeObjs = {}), F = this.components.markerObjs = this.components.markerObjs || (this.components.markerObjs = {}), w = {}, A = {};2049 if (p && p.length) {2050 for (n in y)2051 w[n] = !1;2052 for (n in F)2053 A[n] = !1;2054 if (v && v.length)2055 for (n = v.length; n; n -= 1)2056 (c = (i = v[n - 1]).id.toLowerCase()) && (y[c] = i,2057 w[c] = !0);2058 for (c in b)2059 i = b[c],2060 l = F[c] = t._initializeMarkerItem(c, i, k[c], h),2061 A[c] = !0,2062 s = l.config.options.shapeid,2063 o = l.config,2064 r = i.value,2065 o.cleanValue = g.getCleanValue(r),2066 e = o.options,2067 null !== o.cleanValue ? o.formattedValue = g.dataLabels(r) : o.formattedValue = a,2068 o.fillColor = (0,2069 d.pluck)(e.fillcolor, e.color, f.fillColor),2070 o.fontColor = (0,2071 d.pluck)(e.labelcolor, m.fontColor),2072 o.fillAlpha = (0,2073 d.pluck)(e.fillalpha, e.alpha, f.fillAlpha),2074 o.fillRatio = (0,2075 d.pluck)(e.fillratio, f.fillRatio),2076 o.fillAngle = (0,2077 d.pluck)(e.fillangle, f.fillAngle),2078 o.borderThickness = (0,2079 d.pluckNumber)(e.borderthickness, f.borderThickness),2080 o.borderColor = (0,2081 d.pluck)(e.bordercolor, f.borderColor),2082 o.borderAlpha = (0,2083 d.pluck)(e.borderalpha, f.borderAlpha),2084 o.labelPadding = e.labelpadding || f.labelPadding,2085 o.options.tooltext = (0,2086 d.pluck)(e.tooltext, f.tooltext),2087 o.link = e.link,2088 s && (l.shapeObj = y[s.toLowerCase()]);2089 for (n in w)2090 w[n] || delete y[n];2091 for (n in F)2092 A[n] || delete F[n]2093 }2094 }2095 ,2096 t.getMarkerRadiusLimits = function(e, t, o, r) {2097 var a, n, l = f(e, t), i = .02 * l, s = .07 * l;2098 return a = parseFloat(r),2099 n = parseFloat(o),2100 isNaN(a) || isNaN(n) ? isNaN(a) ? isNaN(n) ? {2101 min: i,2102 max: s2103 } : {2104 min: parseInt(n / 10, 10),2105 max: n2106 } : {2107 min: a,2108 max: 10 * a2109 } : a < n ? {2110 min: a,2111 max: n2112 } : {2113 min: n,2114 max: a2115 }2116 }2117 ,2118 o.getDataLimits = function() {2119 var e = this.config;2120 return {2121 min: e.min,2122 max: e.max2123 }2124 }2125 ,2126 t._initializeMarkerItem = function(e, t, o) {2127 var r, a = {}, n = a.config;2128 return n || (n = a.config = {}),2129 n.id = e,2130 n.definition = t,2131 n.application = o,2132 n.hasValue = null,2133 n.value = null,2134 n.options = null,2135 n.label = null,2136 n.markerShape = null,2137 n.markerLabel = null,2138 n.drawOptions = {2139 shape: null,2140 label: null2141 },2142 n.drawComplete = !1,2143 r = a.config.options = (0,2144 d.extend2)({}, n.definition),2145 n.dataEnabled ? isNaN(r.value) || "" === r.value || (a.value = parseFloat(r.value),2146 a.hasValue = !0) : n.applyAll ? n.options = (0,2147 d.extend2)(r, n.application) : o && (n.options = (0,2148 d.extend2)(r, n.application)),2149 a2150 }2151 ,2152 o.configureConnectors = function() {2153 var e, t, o, r, a, n, l, i, s, c, h, u, p, g, f = this.getFromEnv("chart"), m = this.getChildren("mapAnnotations")[0], b = f.jsonData, k = this.components, v = b.markers || {}, C = v.connector || v.connectors || [], y = k.markerObjs, F = C.length, w = this.components.connectors, A = function(e) {2154 return function(t) {2155 var o = this.data("unfilteredConfig");2156 o.hoverEffect && m.update(this.getId(), o._hoverAttrs),2157 f.fireChartInstanceEvent("connectorrollover", e, t)2158 }2159 }, E = function(e) {2160 return function(t) {2161 var o = this.data("unfilteredConfig");2162 o.hoverEffect && m.update(this.getId(), o._defaultAttrs),2163 f.fireChartInstanceEvent("connectorrollout", e, t)2164 }2165 }, L = function(e) {2166 return function(t) {2167 f.fireChartInstanceEvent("connectorClick", e, t)2168 }2169 }, x = f.config.connectorOpts, N = {};2170 for (w = this.components.connectors = [],2171 g = 0; g < F; g++)2172 ((p = C[g]).from || p.to) && (t = y[p.from.toLowerCase()],2173 o = y[p.to.toLowerCase()],2174 t && o && (r = C[g].label,2175 !(N = w[g]) && (N = w[g] = {}),2176 !N.config && (e = N.config = {}),2177 !N.graphics && (N.graphics = {}),2178 (e = N.config = (0,2179 d.extend2)({}, p)).fromMarker = t,2180 e.toMarker = o,2181 e.link = p.link,2182 e.showTooltip = (0,2183 d.pluckNumber)(p.showtooltip, x.showTooltip),2184 a = e.tooltext = e.showTooltip ? (0,2185 d.pluck)(p.tooltext, x.tooltext) : "",2186 n = e.thickness = (0,2187 d.pluck)(p.thickness, x.thickness),2188 l = e.color = (0,2189 d.pluck)(p.color, x.color),2190 i = e.alpha = (0,2191 d.pluck)(p.alpha, x.alpha),2192 e.hoverEffect = (0,2193 d.pluckNumber)(p.showhovereffect, x.showHoverEffect),2194 s = (0,2195 d.pluck)(p.hovercolor, x.hoverColor, l),2196 c = (0,2197 d.pluck)(p.hoveralpha, x.hoverAlpha, i),2198 h = (0,2199 d.pluck)(p.hoverthickness, x.hoverThickness, n),2200 e.dashed = (0,2201 d.pluck)(p.dashed, x.dashed),2202 e.dashLen = (0,2203 d.pluckNumber)(p.dashlen, x.dashlen),2204 e.dashGap = (0,2205 d.pluckNumber)(p.dashgap, x.dashgap),2206 a && (e.tooltext = a = (0,2207 d.parseUnsafeString)((0,2208 d.parseTooltext)(a, [3, 40, 41, 42, 43], {2209 label: r,2210 fromId: t.config.definition.id,2211 toId: o.config.definition.id,2212 fromLabel: t.config.definition.label,2213 toLabel: o.config.definition.label2214 }, void 0), !1)),2215 e.eventArgs = {2216 fromMarkerId: t.config.id,2217 toMarkerId: o.config.id,2218 label: r2219 },2220 e._hoverAttrs = {2221 color: s,2222 alpha: c,2223 thickness: h2224 },2225 e._defaultAttrs = {2226 color: l,2227 alpha: i,2228 thickness: n2229 },2230 e.type = "line",2231 e.onclick = L(e.eventArgs),2232 e.onmouseover = A(e.eventArgs),2233 e.onmouseout = E(e.eventArgs),2234 r && (!(u = N.labelConfig) && (u = N.labelConfig = {}),2235 u.type = "text",2236 u.text = r,2237 u.align = "center",2238 u.valign = "middle",2239 u.font = x.font,2240 u.fillcolor = (0,2241 d.pluck)(p.labelcolor, x.fontColor),2242 u.bgcolor = (0,2243 d.pluck)(p.labelbgcolor, x.labelBgColor),2244 u.bordercolor = (0,2245 d.pluck)(p.labelbordercolor, x.labelBorderColor),2246 u.tooltext = e.tooltext)))2247 }2248 ,2249 o.draw = function() {2250 var e, t, o, r, a, n, l, i, s = this.getFromEnv("chart"), c = this.config, h = this.getChildren("mapAnnotations")[0], d = this.components.markerObjs, u = s.config, g = u.markerOpts, f = u.scalingParams, m = s.config.annotationConfig, b = [], k = [], v = {}, C = {};2251 for (a in h.destroy(),2252 this.createContainer(),2253 this._drawConnectors(),2254 this.imageLoadCount = 0,2255 this.imageCount = 0,2256 c.autoScale = g.autoScale ? f.sFactor : 1,2257 d)2258 e = null,2259 (r = (t = d[a]).config).conIsHidden || (e = this._drawMarkerItem(t)),2260 e && (C[a] = e,2261 r._annotationIndex = b.length,2262 v[a] = t,2263 e.markerShape && (o = Object.assign({2264 align: "center",2265 valign: "middle",2266 animationLabel: "markerItem",2267 autoscale: "image" === e.markerShape.type ? 0 : 12268 }, e.markerShape),2269 b.push(o)),2270 e.markerLabel && (o = Object.assign({2271 animationLabel: "markerItem",2272 id: e.markerShape.id2273 }, e.markerLabel),2274 k.push(o)));2275 for (a in i = h.addGroup(Object.assign(m, {2276 id: "markers",2277 fillalpha: "100",2278 items: b,2279 scaleimages: 12280 }), this),2281 l = h.addGroup(Object.assign(m, {2282 id: "markerLabels",2283 items: k,2284 scaleimages: 12285 }), this),2286 this.components.markerGroup = i,2287 this.components.markerLabelGroup = l,2288 n = 0,2289 d)2290 C[a] && ((t = d[a]).markerShape = i.retrieveItem(b[n].id),2291 t.markerShape.data("unfilteredConfig", b[n]),2292 C[a].markerLabel && (t.markerLabel = l.retrieveItem(b[n].id),2293 t.markerLabel.data("unfilteredConfig", k[n])),2294 n++);2295 this.addJob("buildKdtree", this._buildKdTree.bind(this), p.priorityList.kdTree)2296 }2297 ,2298 o._buildKdTree = function() {2299 var e, t, o = this.components.kdArrayMap, r = this.components.markerGroup, a = [], n = r && r.items, l = n && n.length || 0;2300 for (t = 0; t < l; t++)2301 o[e = n[t].config.id] && a.push(o[e]);2302 this.components.kDTree || (this.components.kDTree = new i["default"](!0)),2303 this.components.kDTree._setSearchLimit(Infinity, Infinity),2304 this.components.kDTree.buildKdTree(a)2305 }2306 ,2307 o._drawMarkerItem = function(e) {2308 var t, o, r, n, l, i, s, c, h, u, p, g, f, m, b, k, v, C, y = this, F = y.getFromEnv("chart"), w = F.config, A = y.config, E = w.scalingParams, L = e.config, x = L.options, N = L.definition, S = w.markerOpts, _ = S.dataLabels.style, T = x.shapeid, I = x.scale || 1, M = x.label || "", O = F.config.scalingParams.scaleFactor * F.config.baseScaleFactor, B = (x.labelpos || "top").toLowerCase(), P = L.formattedValue === a ? a : L.formattedValue, D = x.tooltext || S.tooltext, R = (0,2309 d.pluckNumber)(N.radius, L.radius, S.radius) * I * A.autoScale || 1e-4, j = L.fillColor, V = L.fillAlpha, G = L.fillRatio, H = L.fillAngle, W = L.borderThickness, z = L.borderColor, X = L.borderAlpha, Y = y.getChildren("mapAnnotations")[0], K = y.components.kdArrayMap || (y.components.kdArrayMap = {}), J = e.config.id;2310 if (L.autoScale = S.autoScale ? O : 1,2311 T)2312 return D = D ? (0,2313 d.parseUnsafeString)((0,2314 d.parseTooltext)(D, [1, 2, 3], {2315 formattedValue: P,2316 label: M2317 }, x), !1) : P ? M + S.tooltipSepChar + P : M,2318 P !== a && null !== P ? M = M + S.labelSepChar + P : isNaN(I) ? I = 1 : I < 0 ? I = 0 : I > 5 && (I = 5),2319 (0,2320 d.extend2)(x, {2321 x: x.x && x.x.toString(),2322 y: x.y && x.y.toString(),2323 fillcolor: j,2324 fillalpha: V,2325 fillratio: G,2326 fillangle: H,2327 borderthickness: W,2328 bordercolor: z,2329 borderalpha: X,2330 hovereffect: (0,2331 d.pluck)(S.showHoverEffect),2332 radius: R && R.toString(),2333 link: x.link,2334 showshadow: (0,2335 d.pluckNumber)(x.showshadow, L.shadow),2336 _markerLabel: M,2337 _markerId: x.id,2338 id: (x.id + "").toLowerCase()2339 }),2340 delete x.tooltext,2341 L.tooltext = !!S.showTooltip && D,2342 f = Number(x.x) * E.sFactor + E.translateX,2343 m = Number(x.y) * E.sFactor + E.translateY,2344 R = x.radius,2345 "triangle" === T ? ((0,2346 d.extend2)(x, {2347 type: "polygon",2348 sides: 3,2349 startangle: S.startAngle2350 }),2351 C = "polygon",2352 v = 3) : "diamond" === T ? ((0,2353 d.extend2)(x, {2354 type: "polygon",2355 sides: 4,2356 startangle: S.startAngle2357 }),2358 C = "polygon",2359 v = 4) : "arc" === T ? (k = .6 * R,2360 (0,2361 d.extend2)(x, {2362 type: "arc",2363 startangle: 0,2364 endangle: 360,2365 innerradius: k2366 }),2367 C = "arc") : "circle" === T ? (x.type = "circle",2368 C = "circle") : (p = y.getShapeArgs.call(e),2369 S.dataEnabled && S.valueToRadius && x.radius !== a ? delete p.radius : (!p.radius && (p.radius = S.radius),2370 p.radius *= I * L.autoScale),2371 (0,2372 d.extend2)(x, p),2373 x.id = x._markerId && x._markerId.toLowerCase(),2374 k = p.innerradius,2375 p.radius && (R = p.radius),2376 C = p.type && p.type.toLowerCase(),2377 v = p.sides,2378 (R = Number(R)) && k && R < k && (g = R,2379 x.radius = R = k,2380 x.innerradius = k = g)),2381 x.type = x.type && x.type.toLowerCase(),2382 (0,2383 d.extend2)(x, {2384 hoverfillcolor: (0,2385 d.pluck)(x.fillhovercolor, S.hoverFillColor, x.fillcolor),2386 hoverfillalpha: (0,2387 d.pluck)(x.fillhoveralpha, S.hoverFillAlpha, x.fillalpha),2388 hoverfillratio: (0,2389 d.pluck)(x.fillhoverratio, S.hoverFillRatio, x.fillratio),2390 hoverfillangle: (0,2391 d.pluck)(x.fillhoverangle, S.hoverFillAngle, x.fillangle),2392 hoverborderthickness: (0,2393 d.pluckNumber)(x.borderhoverthickness, S.hoverBorderThickness, x.borderthickness),2394 hoverbordercolor: (0,2395 d.pluck)(x.borderhovercolor, S.hoverBorderColor, x.bordercolor),2396 hoverborderalpha: (0,2397 d.pluck)(x.borderhoveralpha, S.hoverBorderAlpha, x.borderalpha)2398 }),2399 x._hoverattrs = {2400 fillalpha: x.hoverfillalpha,2401 fillcolor: x.hoverfillcolor,2402 fillangle: x.hoverfillangle,2403 fillratio: x.hoverfillratio,2404 borderThickness: "0" !== x.showborder ? x.hoverborderthickness : 0,2405 borderColor: x.hoverbordercolor,2406 borderAlpha: x.hoverborderalpha2407 },2408 x._defaultattrs = {2409 fillalpha: x.fillalpha,2410 fillcolor: x.fillcolor,2411 fillangle: x.fillangle,2412 fillratio: x.fillratio,2413 borderThickness: "0" !== x.showborder ? x.borderthickness : 0,2414 borderColor: x.bordercolor,2415 borderAlpha: x.borderalpha2416 },2417 "image" === x.type ? (x.borderthickness = x.borderthickness || 0,2418 x.onload = function(t) {2419 var o = t.width2420 , r = t.height;2421 b = {},2422 x = this.config,2423 f = (Number(x.derivedX) - o / (2 * E.sFactor)) * E.sFactor,2424 m = (Number(x.derivedY) - r / (2 * E.sFactor)) * E.sFactor,2425 (b = K[J] || (K[J] = {})).x = f + E.translateX,2426 b.y = m + E.translateY,2427 b.element = e,2428 b.shapeInfo = {2429 type: "rect",2430 width: o,2431 height: r2432 },2433 o && r && Y.update(this.getId(), {2434 x: f,2435 y: m,2436 width: o,2437 height: r,2438 autoscale: 02439 }),2440 y.imageLoadCount++,2441 y.imageLoadCount === y.imageCount && y._buildKdTree()2442 }2443 ,2444 x.onerror = function() {2445 y.imageLoadCount++,2446 y.imageLoadCount === y.imageCount && y._buildKdTree()2447 }2448 ,2449 y.imageCount++) : ((b = K[J] || (K[J] = {})).x = f,2450 b.y = m,2451 b.element = e,2452 b.shapeInfo = {2453 type: C,2454 sides: v,2455 radius: Number(R) + x.borderthickness / 2,2456 innerradius: k2457 }),2458 L.drawOptions.shape = x,2459 S.showLabels ? (u = x.labelpadding || S.labelPadding,2460 o = (t = y._getLabelOptions(B, u, x)).align,2461 r = t.valign,2462 n = L._labelBaseWidth,2463 l = L._labelBaseHeight,2464 i = L._labelXOffset,2465 s = L._labelYOffset,2466 (c = S.labelWrapWidth ? S.labelWrapWidth : y.getWrapWidth[o](n, Number(t.x) + i)) > u && (c -= u),2467 (h = S.labelWrapHeight ? S.labelWrapHeight : y.getWrapHeight[r](l, Number(t.y) + s)) > u && (h -= u),2468 L.drawOptions.label = (0,2469 d.extend2)({2470 type: "text"2471 }, {2472 text: M,2473 tooltext: x.tooltext,2474 x: t.x,2475 y: t.y,2476 align: o,2477 valign: t.valign,2478 wrap: 1,2479 wrapwidth: c,2480 wrapheight: h,2481 fontsize: _.fontSize / E.sFactor,2482 font: _.fontFamily,2483 color: L.fontColor,2484 bgcolor: L.labelBgColor || "",2485 bordercolor: L.labelBorderColor || ""2486 }),2487 {2488 markerShape: x,2489 markerLabel: L.drawOptions.label2490 }) : {2491 markerShape: x2492 }2493 }2494 ,2495 o.highlightPoint = function(e, t) {2496 var o = e.element2497 , r = t.originalEvent2498 , a = this.getFromEnv("chart")2499 , n = this.getFromEnv("toolTipController")2500 , l = this.config.currentToolTip2501 , i = a.config.lastHoveredPoint;2502 i && i !== e && (i && this.hoverOutFn(i.element),2503 a.config.lastHoveredPoint = null,2504 n.hide(l)),2505 !1 !== e && ("click" === t.type || "touchstart" === t.type ? (a.config.lastHoveredPoint !== e && this.hoverFn(o),2506 this.clickFn(t, o)) : "mousemove" === t.type && a.config.lastHoveredPoint !== e && this.hoverFn(o),2507 o.config.tooltext && (l ? n.draw(r, o.config.tooltext, l) : l = this.config.currentToolTip = n.draw(r, o.config.tooltext)),2508 a.config.lastHoveredPoint = e)2509 }2510 ,2511 o._drawConnectors = function() {2512 var e, t, o, r, a, n, l, i, s, c, h, d, u, p = this.getFromEnv("chart"), g = p.config.annotationConfig, f = this.components.connectors || (this.components.connectors = []), m = f.length, b = p.config.scalingParams, k = p.config.connectorOpts, v = k.showLabels, C = this.getChildren("mapAnnotations")[0], y = [], F = [], w = [], A = {};2513 for (w.push({2514 id: "connectorLabels",2515 fillalpha: "100",2516 items: F2517 }),2518 w.push({2519 id: "connectors",2520 fillalpha: "100",2521 items: y2522 }),2523 o = 0; o < m; o++)2524 f[o] && (A[o] = !0,2525 s = f[o].config.fromMarker.config,2526 c = f[o].config.toMarker.config,2527 a = s.options.x,2528 n = s.options.y,2529 l = c.options.x,2530 i = c.options.y,2531 f[o].config.x = a,2532 f[o].config.y = n,2533 f[o].config.tox = l,2534 f[o].config.toy = i,2535 u = Object.assign({2536 animationLabel: "markerItem"2537 }, f[o].config),2538 y.push(u),2539 f[o].labelConfig && v && (f[o].labelConfig.x = ((Number(a) + Number(l)) / 2).toString(),2540 f[o].labelConfig.y = ((Number(n) + Number(i)) / 2).toString(),2541 f[o].labelConfig.fontsize = k.fontSize / (b.scaleFactor * p.config.baseScaleFactor),2542 u = Object.assign({2543 animationLabel: "markerItem"2544 }, f[o].labelConfig),2545 F.push(u)));2546 for (h = C.addGroup(Object.assign(g, w[1]), this),2547 d = C.addGroup(Object.assign(g, w[0]), this),2548 o = 0,2549 r = 0; o < m; o++)2550 A[o] && ((e = h.items[r]) && (e.data("unfilteredConfig", y[r]),2551 e.addEventListener("fc-mouseover", f[o].config.onmouseover),2552 e.addEventListener("fc-mouseout", f[o].config.onmouseout),2553 e.addEventListener("fc-click", f[o].config.onclick)),2554 f[o].labelConfig && v && (t = d.items[r]) && t.data("unfilteredConfig"),2555 r++)2556 }2557 ,2558 o.getShapeArgs = function() {2559 var e, t = this.config, o = (0,2560 d.extend2)({}, this.shapeObj);2561 return t.autoScale = 1,2562 o ? ("polygon" === o.type ? o.sides < 3 ? o.type = "circle" : o.startangle = t.startAngle : "arc" === o.type && (e = (o.radius || t.markerRadius) * t.autoScale,2563 o.radius = e,2564 o.innerradius = o.innerradius && o.innerradius * t.autoScale || .6 * e),2565 o) : null2566 }2567 ,2568 o._getLabelOptions = function(e, t, o, r, n) {2569 var l, i, s, c = e && e.toLowerCase();2570 return this.getLabelAlignment[c] || (c = "center"),2571 i = Number(o.x),2572 s = Number(o.y),2573 l = r === a || n === a ? o.radius || 0 : /^(top|bottom)$/gi.test(c) && .5 * n || /^(left|right)$/gi.test(c) && .5 * r || 0,2574 l = Number(l) + Number(t),2575 this.getLabelAlignment[c](i, s, l)2576 }2577 ,2578 o.addMarkerItem = function(e) {2579 var o, r, n, l, i, s, c, h, u = this.getFromEnv("chart"), p = e, g = this.components.markerObjs, f = this.components.shapeObjs, m = this.components.markerGroup, b = this.components.markerLabelGroup, k = this.getChildren("mapAnnotations")[0], v = this.getFromEnv("number-formatter"), C = u.config.markerOpts;2580 if (h = p.id.toLowerCase()) {2581 if (g[h])2582 return;2583 delete p.value,2584 this.imageLoadCount = 0,2585 (o = t._initializeMarkerItem(h, p, null)).dataset = this,2586 c = o.config.options.shapeid,2587 l = o.config,2588 s = p.value,2589 l.cleanValue = v.getCleanValue(s),2590 r = l.options,2591 null !== l.cleanValue ? l.formattedValue = v.dataLabels(s) : l.formattedValue = a,2592 l.fillColor = (0,2593 d.pluck)(r.fillcolor, r.color, C.fillColor),2594 l.fillAlpha = (0,2595 d.pluck)(r.fillalpha, r.alpha, C.fillAlpha),2596 l.fillRatio = (0,2597 d.pluck)(r.fillratio, C.fillRatio),2598 l.fillAngle = (0,2599 d.pluck)(r.fillangle, C.fillAngle),2600 l.borderThickness = (0,2601 d.pluckNumber)(r.borderthickness, C.borderThickness),2602 l.borderColor = (0,2603 d.pluck)(r.bordercolor, C.borderColor),2604 l.borderAlpha = (0,2605 d.pluck)(r.borderalpha, C.borderAlpha),2606 l.labelPadding = r.labelpadding || C.labelPadding,2607 l.options.tooltext = (0,2608 d.pluck)(r.tooltext, C.tooltext),2609 l.link = r.link,2610 c && (o.shapeObj = f[c && c.toLowerCase()]),2611 g[h] = o,2612 n = this._drawMarkerItem(o),2613 m && b && (n.markerShape && (i = Object.assign({2614 align: "center",2615 valign: "middle",2616 animationLabel: "markerItem",2617 autoscale: "image" === n.markerShape.type ? 0 : 12618 }, n.markerShape),2619 o.markerShape = k.addItem(m.getId(), i, this),2620 o.markerShape.data("unfilteredConfig", i)),2621 n.markerLabel && (i = Object.assign({2622 animationLabel: "markerItem"2623 }, n.markerLabel),2624 o.markerLabel = k.addItem(b.getId(), i, this),2625 o.markerLabel.data("unfilteredConfig", i))),2626 this._buildKdTree()2627 }2628 }2629 ,2630 o.updateMarkerItem = function(e, t) {2631 var o, r, a, n, l = this.getFromEnv("chart"), i = this.getChildren("mapAnnotations")[0], s = this.components.markerObjs, c = l.config.markerOpts, h = {}, u = s[e];2632 if (u) {2633 for (r in o = u.config.options,2634 (0,2635 d.extend2)(o, t),2636 this.imageLoadCount = 0,2637 a = u.config,2638 t)2639 h[r.toLowerCase()] = t[r] && t[r].toString();2640 a.fillColor = (0,2641 d.pluck)(h.fillcolor, h.color, c.fillColor),2642 a.fillAlpha = (0,2643 d.pluck)(h.fillalpha, h.alpha, c.fillAlpha),2644 a.fillRatio = (0,2645 d.pluck)(h.fillratio, c.fillRatio),2646 a.fillAngle = (0,2647 d.pluck)(h.fillangle, c.fillAngle),2648 a.borderThickness = (0,2649 d.pluckNumber)(h.borderthickness, c.borderThickness),2650 a.borderColor = (0,2651 d.pluck)(h.bordercolor, c.borderColor),2652 a.borderAlpha = (0,2653 d.pluck)(h.borderalpha, c.borderAlpha),2654 a.labelPadding = h.labelpadding || c.labelPadding,2655 a.options.tooltext = (0,2656 d.pluck)(h.tooltext, c.tooltext),2657 a.link = h.link,2658 n = this._drawMarkerItem(u).markerShape,2659 this._buildKdTree(),2660 i.update(e, n)2661 }2662 }2663 ,2664 o.createContainer = function() {2665 var e = this.getLinkedParent()2666 , t = this.getFromEnv("animationManager")2667 , o = e.getChildContainer("layer1");2668 !this.getChildContainer("abovePlotGroup") && this.addChildContainer("abovePlotGroup", t.setAnimation({2669 el: "group",2670 attr: {2671 name: "abovePlotGroup",2672 opacity: 12673 },2674 container: o,2675 component: this,2676 label: "group"2677 })),2678 !this.getChildContainer("belowPlotGroup") && this.addChildContainer("belowPlotGroup", t.setAnimation({2679 el: "group",2680 attr: {2681 name: "belowPlotGroup",2682 opacity: 12683 },2684 container: o,2685 component: this,2686 label: "group"2687 }))2688 }2689 ,2690 o._removeMarkerItem = function(e) {2691 var t, o, r = this.components, a = r.markerObjs, n = a[e], l = r.kdArrayMap, i = this.getChildren("mapAnnotations")[0];2692 n && (t = n.markerShape,2693 o = n.markerLabel,2694 t && i.destroy(t.getId()),2695 o && i.destroy(o.getId()),2696 delete l[e],2697 this._buildKdTree()),2698 delete a[e]2699 }2700 ,2701 o.getElement = function(e) {2702 if (this.components.kDTree)2703 return this.components.kDTree.getNeighbour(e)2704 }2705 ,2706 t2707 }(l["default"]);2708 t["default"] = I2709 },2710 1199: function(e, t, o) {2711 "use strict";2712 var r = o(187);2713 t.__esModule = !0,2714 t["default"] = void 0;2715 var a = r(o(207))2716 , n = o(208)2717 , l = o(193)2718 , i = o(201)2719 , s = r(o(1197))2720 , c = function(e) {2721 e.configure && e.configure()2722 };2723 (0,2724 i.addDep)({2725 name: "mapsAnimation",2726 type: "animationRule",2727 extension: s["default"]2728 });2729 var h = function(e) {2730 function t() {2731 return e.apply(this, arguments) || this2732 }2733 (0,2734 a["default"])(t, e);2735 var o = t.prototype;2736 return o.getType = function() {2737 return "group"2738 }2739 ,2740 o.getName = function() {2741 return "mapGroup"2742 }2743 ,2744 o.configure = function() {2745 this._mapChildren(c)2746 }2747 ,2748 o.createContainer = function() {2749 var e, t = this.getLinkedParent(), o = this.getFromEnv("animationManager"), r = t.getChildContainer();2750 e = r.plotGroup,2751 !this.getChildContainer("plotShadow") && this.addChildContainer("plotShadow", o.setAnimation({2752 el: "group",2753 attr: {2754 name: "manager-plot-shadow",2755 opacity: 12756 },2757 container: e,2758 component: this,2759 label: "group"2760 })),2761 !this.getChildContainer("plot") && this.addChildContainer("plot", o.setAnimation({2762 el: "group",2763 attr: {2764 name: "manager-plot",2765 opacity: 12766 },2767 container: e,2768 component: this,2769 label: "group"2770 })),2771 !this.getChildContainer("layer0") && this.addChildContainer("layer0", o.setAnimation({2772 el: "group",2773 attr: {2774 name: "ann-layer0",2775 opacity: 12776 },2777 container: r.abovePlotGroup,2778 component: this,2779 label: "group"2780 })),2781 !this.getChildContainer("layer1") && this.addChildContainer("layer1", o.setAnimation({2782 el: "group",2783 attr: {2784 name: "ann-layer1",2785 opacity: 12786 },2787 container: r.abovePlotGroup,2788 component: this,2789 label: "group"2790 })),2791 t.config.labelsOnTop ? this.getChildContainer("layer0").toFront() : this.getChildContainer("layer0").toBack()2792 }2793 ,2794 o._transformGroup = function() {2795 var e = this2796 , t = this.getFromEnv("chart")2797 , o = t.getFromEnv("chartInstance")2798 , r = e.getFromEnv("animationManager")2799 , a = t.jsonData2800 , n = e.getChildContainer("plot")2801 , i = e.getChildContainer("plotShadow")2802 , s = t.config.scalingParams;2803 n.hide(),2804 i.hide(),2805 t.config.entitiesReady = !1,2806 o.addEventListener("internal.mapdrawingcomplete", (function(t) {2807 t.detachHandler(),2808 l.hasSVG && (o.args.link && o.args.clickedEntityBox && a.chart.linkedcharttransition,2809 n && r.setAnimation({2810 el: n,2811 attr: {2812 transform: s.transformStr2813 },2814 component: e,2815 label: "group"2816 }),2817 i && r.setAnimation({2818 el: i,2819 attr: {2820 transform: s.transformStr2821 },2822 component: e,2823 label: "group"2824 })),2825 n.show(),2826 i.show()2827 }2828 )),2829 t.checkComplete()2830 }2831 ,2832 o.draw = function() {2833 this.createContainer(),2834 this._transformGroup()2835 }2836 ,2837 o.getDataLimits = function(e) {2838 var t, o = +Infinity, r = -Infinity, a = 0, n = function(e) {2839 r = Math.max(r, e.max),2840 o = Math.min(o, e.min)2841 };2842 return this._mapChildren((function(o) {2843 o.getState("removed") || !1 === o.getState("visible") ? e && (t = o.getDataLimits(e),2844 n(t)) : (a++,2845 t = o.getDataLimits(e),2846 n(t))2847 }2848 )),2849 a ? this.setState("visible", !0) : this.setState("visible", !1),2850 this.config.range || (this.config.range = {},2851 this.config.range.min = this.config.dataMin,2852 this.config.range.max = this.config.dataMax),2853 {2854 max: r,2855 min: o2856 }2857 }2858 ,2859 t2860 }(n.ComponentInterface);2861 t["default"] = h2862 }2863 }])2864}...

Full Screen

Full Screen

juno_utils.js

Source:juno_utils.js Github

copy

Full Screen

1const axios = require("axios");2const process = require("process");3const { Buffer } = require("buffer");4const { Fauna } = require("./fauna_utils");5const IS_SANDBOX = false;6function getFromEnv(variable, useSandbox) {7 if (useSandbox) {8 return process.env["SANDBOX_" + variable];9 }10 return process.env[variable];11}12class Juno {13 constructor() {14 this.api = axios.create({15 baseURL: IS_SANDBOX16 ? "https://sandbox.boletobancario.com/api-integration"17 : "https://api.juno.com.br",18 });19 this.fauna = new Fauna();20 }21 async initHeaders() {22 // Produce access hash23 const hash = Buffer.from(24 getFromEnv("CLIENT_ID", IS_SANDBOX) +25 ":" +26 getFromEnv("CLIENT_SECRET", IS_SANDBOX)27 ).toString("base64");28 // Acquire access token29 const { data, status } = await axios.post(30 IS_SANDBOX31 ? "https://sandbox.boletobancario.com/authorization-server/oauth/token"32 : "https://api.juno.com.br/authorization-server/oauth/token",33 "grant_type=client_credentials",34 {35 headers: {36 "Content-Type": "application/x-www-form-urlencoded",37 Authorization: `Basic ${hash}`,38 },39 }40 );41 if (status !== 200) {42 console.log("Authorization error: " + status);43 return;44 }45 // Set headers46 this.headers = {47 "X-Api-Version": 2,48 "X-Resource-Token": getFromEnv("PRIVATE_TOKEN", IS_SANDBOX),49 Authorization: `Bearer ${data.access_token}`,50 };51 }52 async createCardCharge(charge, billing) {53 try {54 const { data } = await this.api.post(55 "/charges",56 { charge: { ...charge, paymentTypes: ["CREDIT_CARD"] }, billing },57 { headers: this.headers }58 );59 const recordedCharge = data._embedded.charges[0];60 // Save charge to FaunaDB61 await this.fauna.recordCharge({62 chargeCode: recordedCharge.code,63 email: billing.email,64 name: billing.name,65 amount: charge.amount,66 paymentType: "CREDIT_CARD",67 status: "PENDING",68 });69 return recordedCharge;70 } catch (e) {71 console.log("Failed to create charge!");72 console.log(e.response.data);73 return null;74 }75 }76 async processCharge(chargeId, chargeCode, creditCardHash, email, address) {77 const body = {78 chargeId,79 creditCardDetails: { creditCardHash },80 billing: { email, address },81 };82 try {83 await this.api.post("/payments", body, {84 headers: this.headers,85 });86 } catch (e) {87 const error = e.response.data.details[0].errorCode;88 // Record charge as rejected89 if (error == 289999) {90 await this.fauna.updateCharge(chargeCode, "chargeCode", {91 status: "DENIED",92 });93 }94 return error;95 }96 }97 async createPixCharge(charge, billing) {98 const body = {99 devedor: {100 cpf: billing.document,101 nome: billing.name,102 },103 valor: {104 original: charge.amount + ".00",105 },106 chave: getFromEnv("PIX_KEY", IS_SANDBOX),107 solicitacaoPagador: charge.description,108 };109 try {110 // Create charge111 const response = await this.api.post("/pix-api/v2/cob", body, {112 headers: this.headers,113 });114 // Fetch qrcode115 const txid = response.data.txid;116 const qrResponse = await this.api.get(117 "/pix-api/qrcode/v2/" + txid + "/imagem",118 { headers: this.headers }119 );120 // Save charge to FaunaDB with temporary pix code121 await this.fauna.recordCharge({122 pixCode: txid,123 email: billing.email,124 name: billing.name,125 amount: charge.amount,126 paymentType: "PIX",127 status: "PENDING",128 });129 return { ...qrResponse.data, txid };130 } catch (e) {131 console.log("Failed to create charge!");132 console.log(e.response.data);133 return null;134 }135 }136}...

Full Screen

Full Screen

server.js

Source:server.js Github

copy

Full Screen

1var restify = require('restify');2var Logger = require('bunyan');3var log = new Logger({4 name: 'stripe-donation-processor'5});6var isTestMode = (getFromEnv('STRIPE_TEST_MODE') === 'true');7var keys = {8 private_test: getFromEnv('STRIPE_KEY_PRIVATE_TEST'),9 private_live: getFromEnv('STRIPE_KEY_PRIVATE_LIVE')10};11var port = getFromEnv('PORT') || '8080';12var stripe = require('stripe')((isTestMode ? keys.private_test : keys.private_live));13function charge(req, res, next) {14 var opts = {15 amount: req.params.amount || throwError('400', 'E_MISSING_REQUIRED_PARAM', 'amount'),16 currency: 'usd',17 source: req.params.token || throwError('400', 'E_MISSING_REQUIRED_PARAM', 'token'),18 description: 'Donation - ' + req.params.email,19 capture: true,20 receipt_email: req.params.email || throwError('400', 'E_MISSING_REQUIRED_PARAM', 'email'),21 statement_descriptor: 'AKPWebDesign Donation'22 };23 stripe.charges.create(opts, (err, charge) => {24 if(err) {25 switch (err.type) {26 case 'StripeCardError':27 // A declined card error28 throwError('400', 'E_STRIPE_CARD_ERROR', err.message);29 break;30 case 'RateLimitError':31 case 'StripeInvalidRequestError':32 case 'StripeAPIError':33 case 'StripeConnectionError':34 case 'StripeAuthenticationError':35 throwError('400', 'E_STRIPE_ERROR', 'null');36 break;37 default:38 // Handle any other types of unexpected errors39 throwError('400', 'E_STRIPE_ERROR', 'null');40 break;41 }42 next(new restify.errors.BadRequestError(err.message || null));43 } else {44 res.json({success: true});45 log.info({charge: charge}, 'Successfully charged card.');46 next();47 }48 });49}50function getFromEnv(key) {51 return process.env[key] || null;52}53function throwError(http_status, e_code, message) {54 log.error({http_status: http_status, e_code: e_code, message: message}, 'Error while processing charge!');55}56var server = restify.createServer({57 name: 'Stripe Donation Processor',58 log: log59});60server.use(restify.gzipResponse());61server.get('/charge/:email/:token/:amount', charge);62server.listen(port, function() {63 log.info('%s listening at %s', server.name, server.url);64 log.info('Stripe using key \'%s\' in %s mode.', isTestMode ? keys.private_test : keys.private_live, isTestMode ? 'test': 'live');...

Full Screen

Full Screen

post_create.js

Source:post_create.js Github

copy

Full Screen

1#!/usr/bin/env node2/* This Source Code Form is subject to the terms of the Mozilla Public3 * License, v. 2.0. If a copy of the MPL was not distributed with this4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */5const fs = require('fs'),6 temp = require('temp'),7 scp = require('./scp').scp,8 defaultPlatform = require('../../automation-tests/config/sauce-platforms').defaultPlatform;9function getFromEnv(name, defaultValue) {10 var envValue = process.env[name];11 if (typeof defaultValue === "undefined" && typeof envValue === "undefined")12 throw new Error(name + " must be defined as an environment variable");13 return typeof envValue === "undefined" ? defaultValue : envValue;14}15var host = getFromEnv('AWS_IP_ADDRESS'),16 user = 'app@' + host,17 target = user + ':sauce.json';18function copyConfig(done) {19 temp.open({}, function(err, temp_file) {20 if (err) throw err;21 try {22 var config = {23 persona_sauce_user: getFromEnv("PERSONA_SAUCE_USER"),24 persona_sauce_api_key: getFromEnv("PERSONA_SAUCE_APIKEY"),25 persona_sauce_pass: getFromEnv("PERSONA_SAUCE_PASS"),26 persona_browser: getFromEnv("PERSONA_BROWSER", defaultPlatform),27 runners: parseInt(getFromEnv("RUNNERS", 30), 10)28 };29 fs.writeFileSync(temp_file.path, JSON.stringify(config), 'utf8');30 console.log(" >> Copying sauce credentials to instance");31 scp(temp_file.path, target, done);32 } catch(e) {33 // suppress errors with missing sauce creds34 done(null, 0);35 }36 });37}38copyConfig(function(err, status) {39 if (err) throw err;40 process.exit(status);...

Full Screen

Full Screen

index.js

Source:index.js Github

copy

Full Screen

1const {2 START,3} = require('./static').PROCESS_KEY;4const { getFromEnv } = require('../util/index');5module.exports = function (path) {6 if (path) {7 return getFromEnv(`${START}${path.replace('.', '_')}`);8 }9 const config = {};10 Object.keys(process.env).filter(v => v.startsWith(START)).forEach((k) => {11 const matches = k.replace(START, '').match(/([A-Z]+)_(.*)/);12 if (!matches) return;13 const [, name, key] = matches;14 config[name] = config[name] || {};15 config[name][key] = getFromEnv(k);16 });17 return config;...

Full Screen

Full Screen

config.js

Source:config.js Github

copy

Full Screen

1const host = getFromEnv("HOST", "localhost");2const port = getFromEnv("PORT", 3000);3const postfixHost = getFromEnv("POSTFIX_HOST", "localhost");4const postfixPort = getFromEnv("POSTFIX_PORT", 1337);56module.exports = {7 host,8 port,9 postfixHost,10 postfixPort,11};1213function getFromEnv(prop, defaultValue = null) {14 const override = process.env && process.env[prop];15 return override || defaultValue; ...

Full Screen

Full Screen

electron-is-dev.js

Source:electron-is-dev.js Github

copy

Full Screen

1// Source: https://github.com/sindresorhus/electron-is-dev2// TODO: how to include non-electron dependencies?3import electron from 'electron';4const app = electron.app || electron.remote.app;5const isEnvSet = 'ELECTRON_IS_DEV' in process.env;6const getFromEnv = parseInt(process.env.ELECTRON_IS_DEV, 10) === 1;...

Full Screen

Full Screen

isdev.js

Source:isdev.js Github

copy

Full Screen

1'use strict'2const getFromEnv = parseInt(process.env.ELECTRON_IS_DEV, 10) === 13const isEnvSet = 'ELECTRON_IS_DEV' in process.env...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const { getFromENV } = require('playwright/lib/utils/utils');2const { chromium } = require('playwright');3(async () => {4 const browser = await chromium.launch({ headless: false });5 const context = await browser.newContext();6 const page = await context.newPage();7 const proxy = await getFromENV('https_proxy');8 await page.screenshot({ path: `example.png` });9 await browser.close();10})();11const { chromium } = require('playwright');12(async () => {13 const browser = await chromium.launch({ headless: false });14 const context = await browser.newContext();15 const page = await context.newPage();16 const proxy = process.env['https_proxy'];17 await page.screenshot({ path: `example.png` });18 await browser.close();19})();20const { chromium } = require('playwright');21const ProxyChain = require('proxy-chain');22(async () => {23 const browser = await chromium.launch({24 proxy: {25 },26 });27 const context = await browser.newContext();28 const page = await context.newPage();29 await page.screenshot({ path: `example.png` });30 await browser.close();31})();32const { chromium } = require('playwright');33(async () => {34 const browser = await chromium.launch({35 proxy: {36 },37 });38 const context = await browser.newContext();39 const page = await context.newPage();40 await page.screenshot({ path: `example.png` });41 await browser.close();42})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const { getFromENV } = require('playwright/lib/utils/utils');2const { chromium } = require('playwright');3const browser = await chromium.launch({ headless: false });4const context = await browser.newContext();5const page = await context.newPage();6await page.goto(getFromENV('TEST_URL'));7await browser.close();

Full Screen

Using AI Code Generation

copy

Full Screen

1const { getFromENV } = require('@playwright/test/lib/utils/environment');2const browserName = getFromENV('BROWSER');3console.log(browserName);4const { test } = require('@playwright/test');5test('test', async ({}, testInfo) => {6 const browserName = testInfo.config.testDir;7 console.log(browserName);8});

Full Screen

Using AI Code Generation

copy

Full Screen

1const { getFromENV } = require('playwright-core/lib/utils/utils');2const browserName = getFromENV('BROWSER');3console.log(browserName);4import { getFromENV } from 'playwright-core/lib/utils/utils';5const browserName = getFromENV('BROWSER');6console.log(browserName);

Full Screen

Using AI Code Generation

copy

Full Screen

1const { getFromENV } = require('playwright/lib/utils/utils');2const browserName = getFromENV('BROWSER');3console.log(browserName);4const { getFromENV } = require('playwright/lib/utils/utils');5const browserName = getFromENV('BROWSER');6console.log(browserName);7const { getFromENV } = require('playwright/lib/utils/utils');8const browserName = getFromENV('BROWSER');9console.log(browserName);10const { getFromENV } = require('playwright/lib/utils/utils');11const browserName = getFromENV('BROWSER');12console.log(browserName);13const { getFromENV } = require('playwright/lib/utils/utils');14const browserName = getFromENV('BROWSER');15console.log(browserName);16const { getFromENV } = require('playwright/lib/utils/utils');17const browserName = getFromENV('BROWSER');18console.log(browserName);19const { getFromENV } = require('playwright/lib/utils/utils');20const browserName = getFromENV('BROWSER');21console.log(browserName);22const { getFromENV } = require('playwright/lib/utils/utils');23const browserName = getFromENV('BROWSER');24console.log(browserName);25const { getFromENV } = require('playwright/lib/utils/utils');26const browserName = getFromENV('BROWSER');27console.log(browserName);28const { getFromENV } = require('playwright/lib/utils/utils');29const browserName = getFromENV('BROWSER');30console.log(browserName);

Full Screen

Using AI Code Generation

copy

Full Screen

1const { getFromENV } = require('playwright-core/lib/utils/utils');2const { chromium } = require('playwright-core');3const { expect } = require('chai');4const { getTestState } = require('./utils');5describe('Test', function () {6 it('should work', async function () {7 const { browserName } = getTestState(this);8 const browser = await chromium.launch({9 headless: getFromENV('HEADLESS') === 'true',10 });11 const context = await browser.newContext();12 const page = await context.newPage();13 const title = await page.title();14 expect(title).to.equal('Playwright');15 await browser.close();16 });17});18![Test Results](./test-results.png)19- [Playwright Internal API](

Full Screen

Playwright tutorial

LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.

Chapters:

  1. What is Playwright : Playwright is comparatively new but has gained good popularity. Get to know some history of the Playwright with some interesting facts connected with it.
  2. How To Install Playwright : Learn in detail about what basic configuration and dependencies are required for installing Playwright and run a test. Get a step-by-step direction for installing the Playwright automation framework.
  3. Playwright Futuristic Features: Launched in 2020, Playwright gained huge popularity quickly because of some obliging features such as Playwright Test Generator and Inspector, Playwright Reporter, Playwright auto-waiting mechanism and etc. Read up on those features to master Playwright testing.
  4. What is Component Testing: Component testing in Playwright is a unique feature that allows a tester to test a single component of a web application without integrating them with other elements. Learn how to perform Component testing on the Playwright automation framework.
  5. Inputs And Buttons In Playwright: Every website has Input boxes and buttons; learn about testing inputs and buttons with different scenarios and examples.
  6. Functions and Selectors in Playwright: Learn how to launch the Chromium browser with Playwright. Also, gain a better understanding of some important functions like “BrowserContext,” which allows you to run multiple browser sessions, and “newPage” which interacts with a page.
  7. Handling Alerts and Dropdowns in Playwright : Playwright interact with different types of alerts and pop-ups, such as simple, confirmation, and prompt, and different types of dropdowns, such as single selector and multi-selector get your hands-on with handling alerts and dropdown in Playright testing.
  8. Playwright vs Puppeteer: Get to know about the difference between two testing frameworks and how they are different than one another, which browsers they support, and what features they provide.
  9. Run Playwright Tests on LambdaTest: Playwright testing with LambdaTest leverages test performance to the utmost. You can run multiple Playwright tests in Parallel with the LammbdaTest test cloud. Get a step-by-step guide to run your Playwright test on the LambdaTest platform.
  10. Playwright Python Tutorial: Playwright automation framework support all major languages such as Python, JavaScript, TypeScript, .NET and etc. However, there are various advantages to Python end-to-end testing with Playwright because of its versatile utility. Get the hang of Playwright python testing with this chapter.
  11. Playwright End To End Testing Tutorial: Get your hands on with Playwright end-to-end testing and learn to use some exciting features such as TraceViewer, Debugging, Networking, Component testing, Visual testing, and many more.
  12. Playwright Video Tutorial: Watch the video tutorials on Playwright testing from experts and get a consecutive in-depth explanation of Playwright automation testing.

Run Playwright Internal automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful