text: !function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="public/js/",n(n.s=5)}({4:function(e,t,n){"use strict";var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(e){for(var t=e+"=",n=document.cookie.split(";"),a=0;a<n.length;a++){for(var r=n[a];" "===r.charAt(0);)r=r.substring(1);if(0===r.indexOf(t))return r.substring(t.length,r.length)}return""},s=function(e,t){var n=null;return t+="",n=e<12?"AM":"PM",0===e&&(e=12),e>12&&(e-=12),1===t.length&&(t="0"+t),e+":"+t+" "+n},i=function(e,t){var n=parseInt(e,10)%60,a=Math.floor(parseInt(e,10)/60)%24,r=parseInt(t,10)%60,i=Math.floor(parseInt(t,10)/60)%24;return s(a,n)+" - "+s(i,r)},o=function(e){var t=e.slider("values",0),n=e.slider("values",1);e.parent().children().last().text(i(t,n))};window.setSpanTime=o;var l=function(e,t){var n=t.values[0],a=t.values[1];$(e.target).parent().children().last().text(i(n,a))};window.slideTime=l,$(document).ready(function(){var e="",t=$("#crns");void 0!==t.val()&&t.val().length>0&&(e=t.val().replace(/[,]+/g,"").replace(/ +(?= )/g,"").split(" "));var n={ACCT:"Accounting",AMST:"American Studies",ANTH:"Anthropology",ARAB:"Arabic",ARTH:"Art History",BIOL:"Biology",BMB:"Biochemistry",BUAD:"Business Administration",CHEM:"Chemistry",CHIN:"Chinese Program",CJ:"Criminal Justice",CLAC:"Cultures and Languages Across the Curriculum",CLCV:"Classical Studies",CLSC:"Classical Studies",CMSC:"Computer Science",CRWR:"Creative Writing",DANC:"Dance",ECON:"Economics",EDUC:"Education",ENGL:"English",ENVR:"Environmental Studies",FIN:"Finance",FMST:"Film Studies",FREN:"French Program",FYS:"First Year Seminar",GEOG:"Geography",GERM:"German Studies Program",GREK:"Greek",GS:"Global Studies",HCS:"Healthcare Studies",HIST:"History",IBUS:"International Business",IDST:"Interdisciplinary Studies",ITAL:"Italian Studies Program",JAPN:"Japanese Program",JOUR:"Journalism",JWST:"Jewish Studies",LAIS:"Latin American, Latino and Iberian Studies",LATN:"Latin",LDST:"Leadership Studies",LLC:"Languages, Literatures and Cultures",MATH:"Mathematics",MGMT:"Management",MKT:"Marketing",MSAP:"Music-Applied",MSCL:"Military Science and Leadership",MSEN:"Music-Ensemble",MUS:"Music",PHIL:"Philosophy",PHYS:"Physics",PLSC:"Political Science",PPEL:"Philosophy Politics Economics and Law",PSYC:"Psychology",RELG:"Religious Studies",RHCS:"Rhetoric and Communication Studies",RUSN:"Russian Studies Program",SDLC:"Languages, Literatures and Cultures",SOC:"Sociology",SPCS:"School of Professional and Continuing Studies",SWAH:"Languages, Literatures and Cultures",THTR:"Theatre",UNIV:"University Seminar",VMAP:"Visual and Media Arts Practice",WELL:"Wellness Program",WGSS:"Women, Gender and Sexuality Studies"},s=$("#searchResultTemplate"),i=$("#addedTemplate"),o=$("#basket-remove"),l=[],c=function(t,n,a,r){var s=n.substring(n.indexOf("</span>"+a.FOS+" "+r)),i=s.substring(0,s.indexOf("\x3c!--close inner-content-wrap")),o=i.substring(a.FOS.length+9+a["Course Number"].length,i.indexOf("</a>")),l=i.substring(i.indexOf("Description</div>")+17);l=l.substring(0,l.indexOf("</div>"));var c=i.substring(i.indexOf("Units: ")+7,i.indexOf("</div>")),d=!0;o.indexOf("Print Courses")>-1&&(d=!1,o=a.Title,l="Course has no description",c="units are unknown");var u="";i.indexOf("Prerequisites</div>")>-1&&(u=(u=i.substring(i.indexOf("Prerequisites</div>")+19)).substring(0,u.indexOf("</div>"))),a.Title.indexOf("ST:")>-1||a.Title.indexOf("SP:")>-1||"FYS"===a.FOS||"WELL"===a.FOS||"HIST"===a.FOS&&"199"===a["Course Number"]||"HIST"===a.FOS&&"299"===a["Course Number"]||"ENGL"===a.FOS&&"299"===a["Course Number"]||"BIOL"===a.FOS&&"199"===a["Course Number"]||d&&(a.Title=o),"FYS"===a.FOS&&"description"in a?(o=a.displayTitle,l=a.description):"description"in a||(o=a.Title);var p="<h4>"+o+"</h4><p>"+l+"</p><p>Units: "+c+"</p>";""!==u&&(p=p+"<p>Prerequisites: "+u+"</p>"),t.find("#title").text(a.FOS+" "+a["Course Number"]+" | "+o),t.find(".panel-body").html(p),t.find("#button").attr("data-fos",a.FOS).attr("data-coursenum",a["Course Number"]).attr("data-coursename",a.Title).attr("data-displayTitle",a.displayTitle);var m=!1;return a.crns.forEach(function(t){e.indexOf(t)>-1&&(m=!0)}),a.Available?m&&t.find("#button").removeClass("btn-success").removeClass("btn-add-course").removeClass("glyphicon-plus").addClass("btn-disable").text("Preregistered"):t.find("#button").removeClass("btn-success").removeClass("btn-add-course").removeClass("glyphicon-plus").addClass("btn-disable").text("Course Not Available"),$("#course-basket, #course-basket-required").find("li").toArray().forEach(function(e){(e=$(e)).data("fos")===a.FOS&&e.data("coursenum")===parseInt(a["Course Number"])&&e.data("coursename")===a.Title&&t.find("#button").removeClass("glyphicon-plus").removeClass("btn-success").removeClass("btn-add-course").addClass("btn-danger").addClass("glyphicon-minus").addClass("btn-remove-course")}),t},d=function(e,t,n,a){var r=!0;if($("#course-basket li, #course-basket-required li").toArray().forEach(function(a){(a=$(a)).data("fos")===e&&a.data("coursenum")===t&&a.data("coursename")===n&&(r=!1)}),r){var s=function(a){(a=$(a)).data("fos")===e&&a.data("coursenum")===t&&a.data("coursename")===n&&a.removeClass("glyphicon-plus").removeClass("btn-success").removeClass("btn-add-course").addClass("btn-danger").addClass("glyphicon-minus").addClass("btn-remove-course")};$("#search-results button").toArray().forEach(s),$(".panel .panel-default button").toArray().forEach(s);var l=i.clone(),c=o.clone().removeClass("hide");l.removeClass("hide").attr("id","").text(e+" "+t+" | "+n).append("&nbsp; &nbsp; &nbsp; &nbsp;",c).attr("data-fos",e).attr("data-coursenum",t).attr("data-coursename",n).attr("data-displayTitle",a),$("#course-basket").append(l)}};if($(document).on("click",".collapse-btn",function(e){for(e=$(e.target);!e.attr("class").includes("subj-");)e=e.parent();var t,n=e.attr("class").split(" ");n=n[n.length-1].split("-")[1],-1===l.indexOf(n)&&(t=n,$.ajax({url:"richmondAPI.php",jsonp:"callback",dataType:"jsonp",data:{subj:t},success:function(e){e=e.response,$.getJSON("richmondAPI.php?catalog-subj="+t+"&callback=?",function(n){n=n.courses,e.forEach(function(e){var a=$("#subj-list-template2").clone().removeAttr("id"),r=e["Course Number"];r<=99&&(r="0"+r),a=c(a,n,e,r).removeClass("hide"),$("#subj-list").find(".subj-"+t).find(".main-body").append(a)})})}}),l.push(n)),e.find(".panel-collapse:not(.subj-list-collapse)").collapse("toggle")}),$(document).on("click",".collapse-btn-subj",function(e){for(e=$(e.target);!e.attr("class").includes("collapse-btn-subj");)e=e.parent();e.parent().parent().find(".panel-collapse").collapse("toggle")}),$(document).on("keyup","#searchField",function(){var e=$("#searchField").val(),t=$("#search-results");""===e&&t.empty(),e.length<3||$.ajax({url:"richmondAPI.php",jsonp:"callback",dataType:"jsonp",data:{search:e},success:function(e){(e=e.response).forEach(function(e,n){var a=s.clone(),r=e["Course Number"],i=r;r<=99&&(r="0"+r),r>99&&(i=i.substr(0,1)+"00"),$.getJSON("richmondAPI.php?catalog-subj="+e.FOS+"&catalog-level="+i+"&callback=?",function(s){s=s.courses,a=c(a,s,e,r).removeAttr("id").removeClass("hide"),0===n&&t.empty(),t.append(a)})})}})}),$(document).on("click",".btn-generate",function(){var e=function(e){return{CourseNum:$(e).data("coursenum"),FOS:$(e).data("fos"),Title:$(e).data("coursename"),displayTitle:$(e).data("displaytitle"),requiredCourse:!1}},t=[],n=$("#course-basket").find("li"),a=n.size();t=t.concat(n.toArray().map(e)),a+=(n=$("#course-basket-required").find("li")).size(),t=t.concat(n.toArray().map(e).map(function(e){return e.requiredCourse=!0,e}));var r=$("#block").find(".blocked-time").toArray().map(function(e){return $(e).find("input, .time-display").toArray().reduce(function(e,t){if(void 0!==(t=$(t)).text()&&""!==t.text()){var n=t.text().split(" - ");e.startTime=n[0],e.endTime=n[1]}return t.is(":checked")&&(e[t.attr("name")]=t.attr("name")),e},{})}),s=$("#crns").val().replace(/\D+/g,",").split(",");t={allCourses:t,timePref:$("#time-pref").prop("checked"),fullClasses:$("#full-classes").prop("checked"),preregistered:s,startTime:$("#restrict-slider").text().split(" - ")[0],endTime:$("#restrict-slider").text().split(" - ")[1],unwantedTimes:r},a>5&&window.alert("Trying to generate schedules with this many courses may take a long time, but I will try.\n\nThe calculation is allowed take up to 5 minutes, if it takes longer, it will fail."),window.location.assign("makeSchedule.php?i="+encodeURIComponent(JSON.stringify(t)))}),$(document).on("click",".btn-jumbo-close",function(){$(".jumbotron").hide(),document.cookie="jumbotron=hidden"}),$(document).on("click",".btn-add-course",function(e){var t=$(e.target);d(t.data("fos"),t.data("coursenum"),t.data("coursename"),t.data("displaytitle"))}),$(document).on("click",".btn-load-history",function(e){var t=r("history");t=(t=JSON.parse(decodeURIComponent(t)))[$(e.target).data("history-id")],$.each(t,function(e,t){"object"===(void 0===t?"undefined":a(t))&&"Title"in t&&("displayTitle"in t&&(t.displayTitle=t.displayTitle.replace(/\+/g," ")),d(t.FOS,t.CourseNum,t.Title.replace(/\+/g," "),t.displayTitle))})}),$(document).on("click","#adv",function(e){e.preventDefault(),$("#advanced").is(":visible")?($("#advanced").hide(500),$("#adv").text("Show Advanced Options"),$("#arrow").removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-right")):($("#advanced").show(500),$("#adv").text("Hide Advanced Options"),$("#arrow").removeClass("glyphicon-chevron-right").addClass("glyphicon-chevron-down"))}),$(document).on("click",".btn-remove-block-time",function(e){$(e.target).closest(".blocked-time").remove()}),$(document).on("click",".btn-remove-course",function(e){var t=$(e.target);void 0===t.data("fos")&&(t=t.parent());var n=t.data("fos"),a=t.data("coursenum"),r=t.data("coursename"),s=function(e){(e=$(e)).data("fos")===n&&e.data("coursenum")===a&&e.data("coursename")===r&&e.addClass("glyphicon-plus").addClass("btn-success").addClass("btn-add-course").removeClass("btn-danger").removeClass("glyphicon-minus").removeClass("btn-remove-course")};$("#search-results").find("button").toArray().forEach(s),$(".panel .panel-default button").toArray().forEach(s),$("#course-basket li, #course-basket-required li").toArray().forEach(function(e){(e=$(e)).data("fos")===n&&e.data("coursenum")===a&&e.data("coursename")===r&&e.remove()})}),$("#advanced").hide(),$("#time-pref").bootstrapToggle({on:"Morning",off:"Afternoon",offstyle:"warning"}),$("#full-classes").bootstrapToggle({on:"Yes",off:"No",offstyle:"danger",onstyle:"success"}),r("history").length>0){var u=r("history");(u=JSON.parse(decodeURIComponent(u))).forEach(function(e,t){var n=$("#history-template").clone().removeClass("hide").removeAttr("id");n.find(".panel-title").text(e.schedules+" Schedules");var r="<ul class='list-group'>";Object.keys(e).forEach(function(t){var n=e[t];"object"===(void 0===n?"undefined":a(n))&&"Title"in n&&(r=r+"<li class='list-group-item'>"+n.Title.replace(/\+/g," ")+"</li>")}),r+="</ul>",n.find(".panel-body").html(r),n.find(".btn-load-history").attr("data-history-id",t),$("#history").prepend(n)})}"hidden"!==r("jumbotron")&&$(".jumbotron").removeClass("hide"),Object.keys(n).forEach(function(e){var t=n[e],a=$("#subj-list-template").clone().removeClass("hide").removeAttr("id").addClass("subj-"+e);a.find(".panel-title").text(t+" ("+e+")"),$("#subj-list").append(a)})});window.initialSetSliders=function(e,t){$(document).on("click","#add-block-time",function(){var n=$("#block-time-template").clone().removeClass("hide").removeAttr("id");n.find(".time-slider").slider({range:!0,min:e,max:t,step:15,values:[e,600],slide:l}),o(n.find(".time-slider")),$("#block").append(n)}),$(document).ready(function(){var n=function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"":null}("i");if(null!==n&&""!==n&&function(e){try{JSON.parse(e)}catch(e){return!1}return!0}(n)){var a=function(e){var t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0),a=e.split(" ")[0].split(":"),r=e.split(" ")[1];return t.setHours(parseInt(a[0])+("PM"===r?12:0)),t.setMinutes(parseInt(a[1])||0),Math.floor((t-n)/6e4)};JSON.parse(n).unwantedTimes.forEach(function(n){var r=$("#block-time-template").clone().removeClass("hide").removeAttr("id");n.startTime=a(n.startTime),n.endTime=a(n.endTime),r.find(".time-slider").slider({range:!0,min:e,max:t,step:15,values:[n.startTime,n.endTime],slide:l}),o(r.find(".time-slider")),["Su","M","T","W","R","F","S"].forEach(function(e){var t,a;e in n&&(t=e,(a=r).find("input[name='"+t+"']").parent().addClass("active"),a.find("input[name='"+t+"']").prop("checked",!0))}),$("#block").append(r)})}})}},5:function(e,t,n){function a(){n(4)}if(function(){return!("includes"in String.prototype)}.call(window)){var r=document.createElement("script");r.src="public/js/polyfills-b8cb5355df550485afe0b4a8025564db.min.js",r.onload=a,r.onerror=function(e){console.error("Could not load the polyfills: "+e)},document.head.appendChild(r)}else a()}});
  //# sourceMappingURL=homepageFunctions-ed147ab9dd20b26ebc9a.min.js.map