;(function() {
"use strict";

"use strict";var _exports=window.CAULDRON||{};function getNoCacheString(){var t=new Date;return[t.getUTCMilliseconds(),t.getUTCSeconds(),t.getUTCMinutes(),t.getUTCHours(),t.getUTCDay(),t.getUTCMonth(),t.getUTCFullYear()].join("-")}function capitalize(t){return t.replace(/(?:^|\s)\S/g,function(t){return t.toUpperCase()})}function toDisplayNumber(t,e){function r(t){return(.01*Math.round(100*t)).toFixed(2)}return r(t)+" &#177; "+r(e)}(window.CAULDRON=_exports).getNoCacheString=getNoCacheString,_exports.capitalize=capitalize,_exports.toDisplayNumber=toDisplayNumber;
}());

;(function() {
"use strict";

"use strict";var _exports=window.CAULDRON||{};function fakeRequire(o,e){var r=[];o.forEach(function(o){"plotly"===o&&r.push(window.Plotly)}),e.apply(this,r)}function getDataDirectory(){if(window.PROJECT_DIRECTORY)return window.PROJECT_DIRECTORY;if(_exports.PARAMS.data_root)return _exports.PARAMS.data_root;var o=_exports.PARAMS.id||window.PROJECT_ID,e=_exports.PARAMS.sid;return["reports",o||"",e?"snapshots":"latest",e||""].filter(function(o){return 0<o.length}).join("/")}function addSnapshotBar(){var o=_exports.PARAMS.sid,e=$("body");return!!o&&($("<div></div>").addClass("snapshot-bar").text("Snapshot: "+o).prependTo(e),$("<div></div>").addClass("snapshot-bar").addClass("snapshot-bar-overlay").text("Snapshot: "+_exports.PARAMS.sid).prependTo(e),_exports.TITLE="{"+o+"} "+_exports.TITLE,!0)}function loadProjectData(){return window.RESULTS?Promise.resolve():window.RESULTS_FILENAME?_exports.loadSourceFile({name:"cauldron-project",src:":"+window.RESULTS_FILENAME}):_exports.loadSourceFile({name:"cauldron-project",src:"/results.js"})}function loadIncludes(){return window.COMBINED_INCLUDES?_exports.loadSourceFiles(window.COMBINED_INCLUDES):_exports.loadSourceFiles(window.RESULTS.includes).then(function(){return _exports.loadStepIncludes(_exports.RESULTS.steps)})}function preload(){return _exports.PARAMS.preload_url,Promise.resolve()}function initialize(){return _exports.DATA_DIRECTORY=getDataDirectory(),preload().then(function(){return loadProjectData()}).then(function(){return window.CAULDRON_VERSION=window.RESULTS.cauldron_version,_exports.RESULTS=window.RESULTS,_exports.DATA=window.RESULTS.data,_exports.SETTINGS=window.RESULTS.settings,_exports.TITLE=_exports.SETTINGS.title||_exports.SETTINGS.id,loadIncludes()}).then(function(){var r=$(".body-wrapper");return window.RESULTS.steps.forEach(function(o){var e=_exports.prepareStepBody(o);e&&r.append(e)}),$(window).trigger("resize"),_exports.DATA})}(window.CAULDRON=_exports).notebookVersion=1,_exports.resizeCallbacks=[],window.require=fakeRequire,_exports.addSnapshotBar=addSnapshotBar,_exports.initialize=initialize;
}());

;(function() {
"use strict";

"use strict";var _exports=window.CAULDRON||{};window.CAULDRON=_exports;var headerDom=['<div class="cd-body-header">','<div class="menu-icon"></div>','<div class="project-title"></div>','<div class="spacer"></div>','<div class="buttons"></div>',"</div>"];function createHeader(){var e=$(headerDom.join("")).prependTo($(".body-wrapper"));_exports.RESULTS.has_error&&e.addClass("project-error")}_exports.createHeader=createHeader;
}());

;(function() {
"use strict";

"use strict";var _exports=window.CAULDRON||{};function scrollToAnchor(e,o,t){var s=$(window).height(),a=$(".body-wrapper").find(".cd-project-step[data-step-name='"+e+"']"),n=a.height()<s-100,r=o&&!n?e+"--"+o:e;var i=$("body"),l=a.find("a[name='"+r+"']").offset().top-function(){if(n)return 0;switch(o){case"end":return s-100;default:return 0}}();i.stop(!0).animate({scrollTop:l},t||"slow")}function toggleVisible(e){$(e).toggle()}function collapse(e){var t=$("#"+e),s=t.hasClass("closed"),o=t.attr("data-"+(s?"opens":"closes")),a=(t.attr("data-marks-"+(s?"opened":"closed"))||"").split("|").map(function(e){return $(e)});a.push(t),a.forEach(function(e){s?e.removeClass("closed").addClass("opened"):e.removeClass("opened").addClass("closed")}),o?(o.split("|").forEach(function(e){var o=$(e);s?(o.show(),t.removeClass("closed")):(o.hide(),o.addClass("closed"))}),setTimeout(function(){return $(window).resize()},100)):$(window).resize()}function changeFontSize(e,o){var t=$(e);var s=function(){if(!o)return parseFloat(t.attr("data-font-size-default"));var e=parseFloat(t.attr("data-font-size"));return Math.max(.1,e+.1*o)}();t.attr("data-font-size",s).css("font-size",s+"em")}(window.CAULDRON=_exports).scrollToAnchor=scrollToAnchor,_exports.toggleVisible=toggleVisible,_exports.collapse=collapse,_exports.changeFontSize=changeFontSize;
}());

;(function() {
"use strict";

"use strict";var _exports=window.CAULDRON||{};function loadSourceFile(o){var n=void 0,t="?nocache="+_exports.getNoCacheString();if(n=o.src.startsWith(":")?o.src.slice(1):_exports.DATA_DIRECTORY+o.src,window.document.getElementById(o.name))return Promise.resolve();function i(e,r){setTimeout(function(){return e(r)},250)}return/.*\.css$/.test(n)?new Promise(function(e){var r=document.createElement("link");r.rel="stylesheet",r.onload=i.bind(null,e,r),r.href=n+t,r.id=o.name,document.head.appendChild(r)}):/.*\.js$/.test(n)?new Promise(function(e){var r=document.createElement("script");r.onload=i.bind(null,e,r),r.src=n+t,r.id=o.name,document.head.appendChild(r)}):Promise.reject()}function loadSourceFiles(e){if(!e)return Promise.resolve([]);var r=e.map(function(e){return _exports.loadSourceFile(e)});return Promise.all(r)}function loadStepIncludes(e){if(!e)return Promise.resolve([]);var r=e.filter(function(e){return e}).map(function(e){return _exports.loadSourceFiles(e.includes)});return Promise.all(r)}(window.CAULDRON=_exports).loadSourceFile=loadSourceFile,_exports.loadSourceFiles=loadSourceFiles,_exports.loadStepIncludes=loadStepIncludes;
}());

;(function() {
"use strict";

"use strict";var _exports=window.CAULDRON||{};window.CAULDRON=_exports;var previousWidth=-100,resizePaused=!1;function onWindowResize(){if(_exports.RUNNING&&!resizePaused){var e=$(window).width();Math.abs(e-previousWidth)<10||(previousWidth=e,_exports.resizeCallbacks.forEach(function(e){return e()}),_exports.resizePlotly())}}function resizePlotlyBox(e){var i=$(e),o=i.parent(),s=i.parents(".cd-project-step-body").hasClass("closed"),t=i.parents(".cd-plotly-box-v2");s||resizePaused||window.Plotly.relayout(i[0],{width:(t||o).width(),height:(t||o).height()})}function resizePlotly(){window.Plotly&&$(".cd-plotly-box, .cd-plotly-box-v2").each(function(e,i){var o=$(i).find(".plotly-graph-div");_exports.resizePlotlyBox(o)})}function pauseResizing(){resizePaused=!0}function resumeResizing(){resizePaused=!1,setTimeout(onWindowResize,100)}window.onresize=onWindowResize,_exports.resizePlotlyBox=resizePlotlyBox,_exports.resizePlotly=resizePlotly,_exports.pauseResizing=pauseResizing,_exports.resumeResizing=resumeResizing;
}());

;(function() {
"use strict";

"use strict";var _slicedToArray=function(r,e){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return function(r,e){var t=[],n=!0,a=!1,i=void 0;try{for(var o,u=r[Symbol.iterator]();!(n=(o=u.next()).done)&&(t.push(o.value),!e||t.length!==e);n=!0);}catch(r){a=!0,i=r}finally{try{!n&&u.return&&u.return()}finally{if(a)throw i}}return t}(r,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},_exports=window.CAULDRON||{};function isNumeric(r){return!(!r||/[^0-9.-]+/.test(r))&&(!(1<(r.match(/\.+/g)||[]).length)&&-1===r.slice(1).indexOf("-"))}function parseUrlValue(r){return isNumeric(r)?-1===r.indexOf(".")?parseInt(r,10):parseFloat(r):"true"===r.toLowerCase()||"false"!==r.toLowerCase()&&decodeURIComponent(r)}function parseUrlParameters(){return document.location.search.replace(/(^\?)/,"").split("&").map(function(r){return r.split("=")}).filter(function(r){return 2===r.length}).reduce(function(r,e){var t=_slicedToArray(e,2),n=t[0],a=t[1],i=r;return i[n]=parseUrlValue(a),i},{})}(window.CAULDRON=_exports).parseUrlParameters=parseUrlParameters;
}());

;(function() {
"use strict";

"use strict";var _exports=window.CAULDRON||{};window.CAULDRON=_exports;var processingPromise=void 0;function addRenameAttribute(e,t,r){var n=t[r],a=e.find('[data-step-name="'+r+'"]');a.attr("data-step-rename",n.name),a.find(".cd-step-title").html(n.title||n.name)}function renameStep(e){var t=$(e),n=t.attr("data-step-rename");t.attr("data-step-rename",null).attr("data-step-name",n).find(".step-anchor").each(function(e,t){var r=$(t);r.attr("name",""+n+r.attr("data-type"))})}function onProcessingReady(t){var r=$(".body-wrapper");return Object.keys(t).forEach(function(e){return addRenameAttribute(r,t,e)}),r.find("[data-step-rename]").each(function(e,t){return renameStep(t)}),Promise.resolve(t)}function processStepRenames(e){return e?(processingPromise||(processingPromise=window.CD.on.ready),processingPromise=processingPromise.then(function(){return onProcessingReady(e)})):Promise.resolve(e)}_exports.processStepRenames=processStepRenames;
}());

;(function() {
"use strict";

"use strict";var _exports=window.CAULDRON||{};window.CAULDRON=_exports;var selectedStep=void 0,selectionTimeout=void 0,processingPromise=void 0;function setSelected(e){if(e&&!e.hasClass("cd-project-step--selected")){e.addClass("cd-project-step--selected");var t=e.find(".cd-project-step__header");t.addClass("cd-project-step__header--selected").removeClass(t.attr("data-default-modifier"))}}function removeSelected(e){e.removeClass("cd-project-step--selected");var t=e.find(".cd-project-step__header");t.removeClass("cd-project-step__header--selected").addClass(t.attr("data-default-modifier"))}function doSelectionUpdate(){var s=selectedStep;selectionTimeout=null,s&&$(".body-wrapper").find(".cd-project-step").each(function(e,t){var r=$(t);r.attr("data-step-name")===s.name?setSelected(r):removeSelected(r)})}function updateSelectedStep(e){return e&&(selectedStep=e),selectionTimeout?Promise.resolve(selectedStep):new Promise(function(e){selectionTimeout=setTimeout(function(){doSelectionUpdate(),e(selectedStep)},10)})}function prepareStepBody(e){if(!e||!e.body)return null;var t=$(e.body);return t.find("[data-src]").each(function(e,t){var r,s=$(t),d=(r=s.attr("data-src"))&&r.startsWith("/")?r.slice(1):r;s.attr("src",_exports.DATA_DIRECTORY+"/"+d+"?nocache="+_exports.getNoCacheString()),s.attr("data-src",null)}),t}function onReadyToProcess(e){var s=$(".body-wrapper"),d=void 0;e.forEach(function(e){var t=$('[data-step-name="'+e.name+'"]');if("removed"!==e.action){var r=_exports.prepareStepBody(e.step);selectedStep&&e.name===selectedStep.name&&setSelected(r),"updated"!==e.action?("modified"===e.action&&((r=s.find('[data-step-name="'+e.name+'"]')).find(".cd-step-title").html(e.title||e.name),r.detach()),(d=e.after?s.find('[data-step-name="'+e.after+'"]'):s.find(".cd-body-header").after(r))&&0<d.length?d.after(r):e.after?s.append(r):s.prepend(r)):t.replaceWith(r)}else t.remove()}),$(window).trigger("resize"),_exports.updateSelectedStep()}function processStepUpdates(e,t){if(!e)return Promise.resolve();processingPromise||(processingPromise=window.CD.on.ready),t&&(selectedStep=t);var r=e.map(function(e){return e.step});return processingPromise=processingPromise.then(function(){return _exports.loadStepIncludes(r)}).then(function(){return onReadyToProcess(e)})}_exports.updateSelectedStep=updateSelectedStep,_exports.prepareStepBody=prepareStepBody,_exports.processStepUpdates=processStepUpdates;
}());

;(function() {
"use strict";

"use strict";var _exports=window.CAULDRON||{};function populateDom(){_exports.addSnapshotBar(),$("title").text(_exports.TITLE),_exports.SETTINGS.headerless||(_exports.createHeader(),$(".cd-body-header").find(".project-title").text(_exports.TITLE))}function start(){_exports.RUNNING=!0,_exports.__on__.ready(),$(window).resize()}(window.CAULDRON=_exports).RUNNING=!1,$(function(){_exports.PARAMS=_exports.parseUrlParameters(),_exports.initialize().then(populateDom).then(start)});
}());
