(function () {
  //Inject code v3.0.1

  var highcharts = document.createElement('script');

  var cdn = 'https://code.highcharts.com/';
  var loaded = 0;  
  var encodedUrl = encodeURI('https://https://app.everviz.com//show/_6JWJ-t2O');
  var chartCreated = false;
  var scripts = [
    "highcharts.js",
    "modules/stock.js",
    "highcharts-more.js",
    "highcharts-3d.js",
    "modules/data.js",
    "modules/exporting.js",
    "modules/funnel.js",
    "modules/solid-gauge.js",
    "modules/export-data.js",
    "modules/accessibility.js"
    /* "modules/series-label.js" */
  ];

  var externalCSS = [
     
    "https://app.everviz.com/fonts/4p5RZJGrg/font.css"
 ,
    "https://app.everviz.com/fonts/Fa1k_zRqT/font.css"
 ,
    "https://app.everviz.com/fonts/R3oTVDf9l/font.css"
 ,
    "https://app.everviz.com/fonts/h97SBtExb/font.css"
  ];

  var extraScripts = [
  "https://code.highcharts.com/modules/annotations.js"
  ,"https://code.highcharts.com/modules/annotations-advanced.js"
  ];

  var options = {"title":{"text":"Employment Change by Initial Wage Quintile","align":"left","x":10,"useHTML":true,"style":{"fontFamily":"Default","color":"#333333","fontSize":"22px","fontWeight":"bold","fontStyle":"normal"}},"subtitle":{"text":"","align":"left","x":10},"colors":["#235A61","#DD495E","#2A2383","#F2C60E","#24CBE5","#64E572","#FF9655","#FFF263","#6AF9C4"],"legend":{"align":"left","verticalAlign":"top","itemMarginBottom":10,"x":0,"symbolRadius":2,"useHTML":true,"floating":false},"plotOptions":{"series":{"marker":{"enabled":false},"lineWidth":3,"allowPointSelect":true,"states":{"select":{"color":"#EFFFEF","borderColor":"black","dashStyle":"dot"},"inactive":{"opacity":0.2}},"selected":false,"connectEnds":false,"getExtremesFromAll":false,"pointInterval":1,"pointIntervalUnit":"","shadow":false,"animation":false},"column":{"borderWidth":0,"borderRadius":0,"connectEnds":false,"connectNulls":false,"crisp":true,"depth":25,"edgeWidth":1,"getExtremesFromAll":false,"grouping":true,"groupPadding":0.2,"groupZPadding":1,"pointIntervalUnit":"","shadow":false,"showInLegend":true,"softThreshold":true,"pointWidth":80,"pointStart":0}},"chart":{"type":"column","polar":false,"parallelAxes":{"crosshair":{"color":"#cccccc","dashStyle":"Solid"},"gridLineWidth":1,"gridZIndex":1,"lineWidth":1,"uniqueNames":true},"style":{"fontFamily":"\"Lucida Grande\", \"Lucida Sans Unicode\", Verdana, Arial, Helvetica, sans-serif","fontSize":"12px"},"height":715},"credits":{"text":"Becker Friedman Institute at UChicago","href":"https://bfi.uchicago.edu"},"series":[{"data":[],"turboThreshold":0,"_symbolIndex":0,"type":"column","color":"#993536"}],"yAxis":{"title":{"useHTML":true,"text":"Employment Decline Relative to February 15th (%) ","align":"middle","textAlign":"center","style":{"color":"#666666","fontFamily":"\"Lucida Grande\", \"Lucida Sans Unicode\", Verdana, Arial, Helvetica, sans-serif","fontSize":"14px"}},"type":"linear","labels":{"overflow":"center","align":"center"},"gridLineWidth":1,"minTickInterval":5,"softMin":-55},"caption":{"text":"Figure shows decline in employment for workers in different initial wage quintiles through April 17th, 2020. Employment declines measured relative to February 15th. Data for this figure use the employee sample. All data are weighted such that the sample matches aggregate employment by 2-digit NAICS cross business size. First quintile represents hourly wages of less than $13.50, second represents $13.50 - $16.41, third represents $16.41 - $24.52, fourth represents $24.53 - $32.45, and fifth more than $32.45, all per hour.","useHTML":true,"style":{"color":"#666666","fontFamily":"\"Lucida Grande\", \"Lucida Sans Unicode\", Verdana, Arial, Helvetica, sans-serif","fontSize":"14px"}},"tooltip":{"valueSuffix":"%","shared":true,"borderWidth":1,"followPointer":false,"headerFormat":"Employment Decline in <span style=\"font-size: 13px\">{point.key}</span><br/>","pointFormat":"<span style=\"color:{point.color}\">●</span> {series.name}: <b>{point.y}</b><br/>","valuePrefix":"","valueDecimals":0},"stockTools":{"gui":{"enabled":false}},"navigation":{"bindingsClassName":"tools-container"},"labels":{"items":[]},"pane":{"background":[]},"responsive":{"rules":[]},"xAxis":{"type":"category"},"annotations":[],"data":{"csv":"null;Through April 17th\nQuintile 1;-35\nQuintile 2;-22\nQuintile 3;-17\nQuintile 4;-14\nQuintile 5;-10","seriesMapping":[{"x":0,"y":1}]}};
  
  var templateDataSettings = {};

  var pluginCode = {};;

  options.data.complete = function(options) {
    const keys = Object.keys(templateDataSettings || {});
    keys.forEach(function(key) {
      const serie = options.series[key];
      (serie.data || []).forEach(function(d, i) {
        if (templateDataSettings[key].data && templateDataSettings[key].data[i]) {
          merge(d, templateDataSettings[key].data[i]);
        }
      })
    })  
    return options;
  }

  merge(options, pluginCode);

  function isNull(what){return(typeof what==='undefined'||what===null)}
  function isStr(what){return(typeof what==='string'||what instanceof String)}
  function isNum(what){return!isNaN(parseFloat(what))&&isFinite(what)}
  function isFn(what){return(what&&(typeof what==='function')||(what instanceof Function))}
  function isArr(what){return(!isNull(what)&&what.constructor.toString().indexOf('Array')>-1)}
  function isBool(what){return(what===!0||what===!1)}
  function isBasic(what){return!isArr(what)&&(isStr(what)||isNum(what)||isBool(what)||isFn(what))}
  function isObj(what){return what&&what.constructor.toString().indexOf('Object')>-1}
  function isEmptyObjectArray(arr){return isObj(arr[0])&&arr.some(function(b){return Object.keys(b).length===0})}
  function merge(a,b){if(!a||!b)return a||b;Object.keys(b).forEach(function(bk){if(isNull(b[bk])||isBasic(b[bk])){a[bk]=b[bk]}else if(isArr(b[bk])){if(isEmptyObjectArray(b[bk]))return;a[bk]=[];b[bk].forEach(function(i){if(isNull(i)||isBasic(i)){a[bk].push(i)}else{a[bk].push(merge(isArr(i)?[]:{},i))}})}else{a[bk]=a[bk]||{};merge(a[bk],b[bk])}});return a}

  function isScriptAlreadyIncluded(src){
    var scripts = document.getElementsByTagName("script");
    for (var i = 0; i < scripts.length; i++) {
      if (scripts[i].hasAttribute('src')) {
        const scriptTag = scripts[i].getAttribute('src') || '';
        if ((scriptTag.indexOf(src) >= 0) || 
            (scriptTag.indexOf('highcharts.src.js') > -1 && src === 'highcharts.js') ||
            ((scriptTag.indexOf('stock/highstock.js') > -1) && src === 'modules/highstock.js')) {
          return true;
        }
      }
    }
    return false;
  }

  function loadCSS() {
    var cssLength = externalCSS.length;
    for(var i=0; i < cssLength; i++) {
      var css = document.createElement('link');
      css.rel  = 'stylesheet';
      css.type = "text/css";
      css.href = externalCSS[i];
      document.body.appendChild(css);
    }
  }

  function createChart() {
    if(chartCreated) return;

    if (typeof window['Highcharts'] !== 'undefined') {
      

    if (options.yAxis && options.yAxis.length === 1) options.yAxis = options.yAxis[0];
    if (options.xAxis && options.xAxis.length === 1) options.xAxis = options.xAxis[0];
    if (options.zAxis && options.zAxis.length === 1) options.zAxis = options.zAxis[0];

    /*
// Sample of extending options:
Highcharts.merge(true, options, {
    chart: {
        backgroundColor: "#bada55"
    },
    plotOptions: {
        series: {
            cursor: "pointer",
            events: {
                click: function(event) {
                    alert(this.name + " clicked\n" +
                          "Alt: " + event.altKey + "\n" +
                          "Control: " + event.ctrlKey + "\n" +
                          "Shift: " + event.shiftKey + "\n");
                }
            }
        }
    }
});
*/


      if (options && (options.lang || options.global)) {
        Highcharts.setOptions({
          global: options.global || {},
          lang: options.lang || {}
        });
      }

      if (Highcharts.Annotation) {
        Highcharts.Annotation.ControlPoint.prototype.redraw = function (animation) {
          this.graphic[animation ? 'animate' : 'attr'](
              this.options.positioner ? this.options.positioner.call(this, this.target) : null
          );
        };
      }
      
      chartCreated = true;
      window.HighchartsCloud.hasLoaded = true;
      new Highcharts.Chart('highcharts-_6JWJ-t2O', options);
    }
  }

  function check(scripts, cb) {
    if (loaded === scripts.length) {
      if (cb) {
        cb();
      } else {
        for (var i = 0; i < window.HighchartsCloud.ondone.length; i++) {
          try {
            window.HighchartsCloud.ondone[i]();
          } catch(e) {
            console.error(e);
          }
        }
      }
    }
  }

  function loadScript(s, scripts, cb) {
    if (!s) next();
    
    function next() {
      ++loaded;
      if (loaded < scripts.length) {
        loadScript(scripts[loaded], scripts, cb);
      }
      check(scripts, cb);
    }

    if (isScriptAlreadyIncluded(s)) {
      return next();
    }

    var n = document.createElement('script');

    n.onload = function () {
      next();
    };

    if (s.indexOf('https') >= 0) {
      n.src = s;
    } else {
      n.src = cdn + s;
    }
    document.body.appendChild(n);
  }

  function loadExtraScripts(){
    if (extraScripts.length > 0) {
      loaded = 0;
      loadScript(extraScripts[0], extraScripts);
    } else {
      check(scripts);
    }
  }

  function loadExtraScriptsAndMakeChart(){
    loaded = 0;
    if (extraScripts.length > 0) {
      loadScript(extraScripts[0], extraScripts, createChart);
    } else {
      check(extraScripts);
    }
  }

  if (typeof window['HighchartsCloud'] === 'undefined') {
    window.HighchartsCloud = {
      ondone: [createChart],
      hasWrapped: false,
      hasLoaded: false
    };

    loadScript(scripts[0], scripts, loadExtraScripts);
    loadCSS();

  } else {
    if (!window.HighchartsCloud.hasLoaded) window.HighchartsCloud.ondone.push(loadExtraScriptsAndMakeChart);
    else loadExtraScriptsAndMakeChart();
  }

}());
