(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/pu1l3T3dR');
  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 = [
      ];

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

  var options = {"title":{"text":"Aggregate and Continuing Employment Declines","align":"left","x":10,"style":{"fontFamily":"Default","color":"#333333","fontSize":"20px","fontWeight":"bold","fontStyle":"normal","fill":"#333333","width":"1058px"},"useHTML":true},"subtitle":{"text":"","align":"left","x":10},"colors":["#357d96","#DD495E","#2A2383","#ff9800"],"legend":{"align":"left","verticalAlign":"top","itemMarginBottom":10,"x":0,"symbolRadius":2,"useHTML":true,"layout":"horizontal","floating":false,"backgroundColor":"#ffffff","borderWidth":0,"borderColor":"#b0bec5","labelFormat":"{name}"},"plotOptions":{"series":{"marker":{"enabled":false},"lineWidth":3,"allowPointSelect":true,"states":{"select":{"color":"#EFFFEF","borderColor":"black","dashStyle":"dot"},"inactive":{"opacity":0.8}},"events":{},"enableMouseTracking":true,"shadow":false,"visible":true},"line":{"dataLabels":{"allowOverlap":false},"allowPointSelect":false,"lineWidth":4,"showInLegend":true,"showCheckbox":false,"shadow":true,"selected":false,"softThreshold":true,"opacity":1,"visible":true,"animationLimit":0,"clip":true,"color":""}},"chart":{"type":"line","shadow":false,"polar":false},"credits":{"text":"Becker Friedman Institute at UChicago","href":"https://bfi.uchicago.edu"},"series":[{"data":[],"turboThreshold":0,"type":"line","marker":{"enabled":false,"symbol":"circle"},"dashStyle":"Solid","color":"#ffa319","name":"Paid Employment"},{"data":[],"turboThreshold":0,"type":"line","color":"#155f83","marker":{"enabled":false},"name":"Active Employment"},{"data":[],"turboThreshold":0,"type":"line","color":"#fcca76","marker":{"enabled":false},"name":"Paid Employment at Continuers"},{"data":[],"turboThreshold":0,"type":"line","color":"#8ab8c9","name":"Active Employment at Continuers"}],"tooltip":{"shared":true,"enabled":true,"headerFormat":"<span style=\"font-size: 12px\">{point.key}</span><br/>","split":false,"valuePrefix":"","dateTimeLabelFormats":{"day":"%b %e, %Y"},"nullFormat":"","snap":10,"useHTML":true,"valueDecimals":2},"yAxis":{"title":{"useHTML":true,"text":"U.S. Employment Relative to February 15th (%)"},"min":0.7,"max":1.05,"maxPadding":0.01,"minTickInterval":0,"pane":0,"showLastLabel":true,"showFirstLabel":true,"startOnTick":false},"caption":{"text":"This figure shows the trend in employment within the ADP business-level sample through the April 18th/April 25th pay periods. Employment changes are relative to February 15th. The dark yellow line shows the trend in aggregate payroll employment. The dark blue line shows the trend in aggregate active employment. The light yellow line shows the trend in payroll employment at businesses which were operating both on the reference date and February 15th, the light blue line shows active employment for the same group. Aggregate series end one week earlier than the continuer series because late-arriving payrolls render the most recent weeks too noisy to be informative. All trends are weighted such that the ADP sample is representative by business size crossed with 2-digit NAICS industry.","style":{"fontFamily":"Default","color":"#666666","fontSize":"12px","fontWeight":"normal","fontStyle":"normal","fill":"#666666","width":"1102px"},"useHTML":true},"stockTools":{"gui":{"enabled":false}},"navigation":{"events":{},"bindingsClassName":"tools-container"},"labels":{"items":[]},"pane":{"background":[]},"responsive":{"rules":[]},"mapNavigation":{"enableMouseWheelZoom":true,"enabled":false},"xAxis":{"dateTimeLabelFormats":{"day":{"main":"%b. %e"},"week":{"main":" %b. %e"}},"showEmpty":true,"showFirstLabel":true,"tickLength":10,"visible":true,"minorTickLength":2,"tickWidth":"0","showLastLabel":true,"startOfWeek":-1,"alignTicks":true},"annotations":[],"data":{"csv":"Week End Date;Paid Employment;Active Employment;Paid Employment at Continuers;Active Employment at Continuers\n2/15/20;1;1;1;1\n2/22/20;1.003;1;1.003;1\n2/29/20;0.995;1.001;0.995;1\n3/7/20;0.998;0.997;1;1\n3/14/20;0.98;0.989;0.983;0.994\n3/21/20;0.927;0.962;0.936;0.978\n3/28/20;0.843;0.928;0.859;0.958\n4/4/20;0.811;0.901;0.827;0.934\n4/11/20;0.807;0.889;0.818;0.917\n4/18/20;0.779;0.865;0.807;0.912\n4/25/20;;;0.799;0.919","seriesMapping":[{"x":0,"y":1},{"x":0,"y":2},{"x":0,"y":3},{"x":0,"y":4}]}};
  
  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 && (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-pu1l3T3dR', 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();
  }

}());
