function catalogSearchSubjectsViewModel(){var n=this;this.subjects=ko.observableArray();this.filter=ko.observable("");this.filteredSubjects=ko.computed(function(){return ko.utils.arrayFilter(n.subjects(),function(t){return t.Description().toUpperCase().indexOf(n.filter().toUpperCase())!==-1})});this.isLoaded=ko.observable(!1);this.catalogResultsDisplayed=ko.observable(!1).subscribeTo("catalogResultDisplayed")}function subjectModel(n,t,i){ko.mapping.fromJS(n,{},this);var r=this;this.searchUrl=ko.observable(t+"?subjects="+encodeURIComponent(r.Code()));this.searchAsync=ko.observable(i).publishOn("searchAsync");this.catalogResult=ko.observable(null).publishOn("catalogResult",!0);this.catalogResultsDisplayed=ko.observable(!1).publishOn("catalogResultDisplayed",!0);this.clickHandler=function(){var n,t;return r.searchAsync()==!1?!0:(n="",window.location.href.indexOf("?")!==-1&&(n=window.location.href.slice(window.location.href.indexOf("?"))),t=r.searchUrl()+n,$.ajax({url:t,type:"GET",contentType:jsonContentType,dataType:"json",success:function(n){account.handleInvalidSessionResponse(n)||(r.catalogResult(n),r.catalogResultsDisplayed()!==!0?r.catalogResultsDisplayed(!0):r.catalogResultsDisplayed.valueHasMutated())},error:function(n){n.status!=0&&$("#notificationHost").notificationCenter("addNotification",{message:"Unable to retrieve search results.",type:"error"})},complete:function(){}}),!1)}}var Ellucian=Ellucian||{},BaseViewModel,advancedSearchMapping;Ellucian.ScreenSizes=Ellucian.ScreenSizes||{};Ellucian.ScreenSizes=Object.freeze({xxsmall:320,xsmall:420,small:768,medium:992,tablets:1025,large:1200,xlarge:1440,xxlarge:2e3});BaseViewModel=function(n){var t=this,i;this.mobileScreenWidth=n||480;this.isMobile=ko.observable(!1);i=ko.observable(0);this.screenIsSmallerThan=function(n){var t=!1,r,u;for(r in Ellucian.ScreenSizes)if(n===r){t=!0;break}if(!t)throw"Please provide a valid screen query size from Ellucian.ScreenSizes";return(u=Ellucian.ScreenSizes[n],i()<Ellucian.ScreenSizes[n])?!0:!1};this.checkForMobile=function(n,r){var f=n,e="inner",u;"innerWidth"in n||(e="client",f=r.documentElement||r.body);u=f[e+"Width"];u<t.mobileScreenWidth?t.isMobile(!0):t.isMobile(!1);i(u)};this.isMobile.subscribe(function(n){n===!0?t.changeToMobile():t.changeToDesktop()});this.changeToMobile=function(){};this.changeToDesktop=function(){};t.loadingMessage=ko.observable(personProxyLoadingThrobberMessage);t.proxySelectionDialogIsLoading=ko.observable(!1);t.proxySelectionDialogIsDisplayed=ko.observable(!1);this.ProxySubjects=ko.observableArray();t.selectedProxySubject=ko.observable(null);t.changeProxySubject=function(){hideProxyDialog=!1;t.getProxySubjects()};t.updateProxyBanner=ko.observable(!1).subscribeTo("UPDATE.PROXY.BANNER");t.updateViewModelWithProxySubjectData=function(){t.proxySelectionDialogIsLoading(!1);t.proxySelectionDialogIsDisplayed(!hideProxyDialog&&t.ProxySubjects().length>1);showOrHideElement(t.ProxySubjects(),$("#changeProxyUser-link"));showOrHideElement(t.ProxySubjects(),$("#changeProxyUser-opsLink"));t.proxySelectionDialogIsDisplayed()?setFocus("input.buttonless"):setFocus("#topOfForm")};this.getProxySubjects=function(){var n=Ellucian.Storage.session.getItem("Ellucian.proxySubjects");n?(ko.mapping.fromJS(n,{},t.ProxySubjects),t.updateViewModelWithProxySubjectData()):$.ajax({url:getProxySubjectsActionUrl,type:"GET",contentType:jsonContentType,dataType:"json",beforeSend:function(){t.proxySelectionDialogIsLoading(!0)},success:function(n){account.handleInvalidSessionResponse(n)||(Ellucian.Storage.session.setItem("Ellucian.proxySubjects",n.ProxySubjects),ko.mapping.fromJS(n,{},t))},error:function(n){n.status!=0&&$("#notificationHost").notificationCenter("addNotification",{message:proxySelectionUnableToLoadSubjectsMessage,type:"error"})},complete:function(){t.updateViewModelWithProxySubjectData()}})};t.cancelProxySelectionDialog=function(){t.proxySelectionDialogIsDisplayed(!1);t.selectedProxySubject(null)};t.changingUserMessage=ko.observable(personProxyChangingThrobberMessage);t.changingProxyUsers=ko.observable(!1);t.saveProxySelectionDialog=function(){var i={subjectJson:ko.toJSON(t.selectedProxySubject())},n=homeUrl;t.selectedProxySubject().Id()==currentUserId&&(n+="?hideProxyDialog=true");$.ajax({url:setProxySubjectActionUrl,type:"PUT",contentType:jsonContentType,data:JSON.stringify(i),dataType:"json",beforeSend:function(){t.changingProxyUsers(!0)},success:function(){},error:function(){console.log("Error setting proxy subject.")},complete:function(){window.location.href=n}})};t.saveProxySelectionEnabled=ko.computed(function(){return t.selectedProxySubject()});t.selectedProxySubject.subscribe(function(){t.selectedProxySubject()&&makeAnnouncement(proxySelectionUserSelectedMessage.format(t.selectedProxySubject().FullName()))});t.verifyingPasswordMessage=ko.observable(verifyingPasswordMessage);t.verifyingPasswordAltText=ko.observable(verifyingPasswordAltText);t.verifyingPassword=ko.observable(!1);t.userPassword=ko.observable();t.verifyPasswordMessage=ko.observable();t.verifyPasswordDialogIsDisplayed=ko.observable(!1);t.showVerifyPasswordDialog=function(){t.verifyPasswordDialogIsDisplayed(!0)};t.cancelVerifyPasswordDialog=function(){t.verifyPasswordDialogIsDisplayed(!1);t.verifyPasswordMessage(null);t.userPassword(null)};t.verifyPasswordButtonEnabled=ko.computed(function(){return t.userPassword()&&t.userPassword()!==""});t.submitVerifyPasswordDialog=function(){var n={passwordJson:ko.toJSON(t.userPassword())};$.ajax({url:reauthenticateUrl,type:"POST",contentType:jsonContentType,data:JSON.stringify(n),dataType:"json",beforeSend:function(){t.verifyPasswordDialogIsDisplayed(!1);t.verifyingPassword(!0)},success:function(n){account.handleInvalidSessionResponse(n)||(t.verifyingPassword(!1),t.verifyingPasswordSuccessFunction(),t.verifyPasswordMessage(null),t.userPassword(null))},error:function(n){n.status!=0&&t.verifyPasswordMessage(JSON.parse(n.responseText));t.verifyingPassword(!1);t.verifyPasswordDialogIsDisplayed(!0)},complete:function(){}})};t.verifyingPasswordSuccessFunction=function(){};t.saveProxySelectionButton={id:"save-proxy-selection-dialog-button",isPrimary:!0,title:Ellucian.Proxy.ButtonLabels.saveProxySelectionDialogButtonLabel,callback:t.saveProxySelectionDialog,enabled:t.saveProxySelectionEnabled};t.cancelProxySelectionButton={id:"cancel-proxy-selection-dialog-button",isPrimary:!1,title:Ellucian.Proxy.ButtonLabels.cancelProxySelectionDialogButtonLabel,callback:t.cancelProxySelectionDialog};t.verifyPasswordDialogButton={id:"verify-password-dialog-button",isPrimary:!0,title:Ellucian.SharedComponents.ButtonLabels.buttonTextVerifyPassword,callback:t.submitVerifyPasswordDialog,enabled:t.verifyPasswordButtonEnabled};t.cancelPasswordDialogButton={id:"cancel-dialog-button",title:Ellucian.SharedComponents.ButtonLabels.buttonTextCancel,callback:t.cancelVerifyPasswordDialog};$(document).ready(function(){var n=0;$(window).on("resize",function(){clearTimeout(n);n=setTimeout(function(){t.checkForMobile(window,document)},100)})})};Ellucian=Ellucian||{};Ellucian.InstantEnrollment=Ellucian.InstantEnrollment||{};Ellucian.InstantEnrollment.DataCollectorModel=function(){var n=this;n.SelectedClasses=ko.observableArray([]);n.PersonInformation=ko.observable(null);n.AdditionalInformation=ko.observable(null)};Ellucian=Ellucian||{};Ellucian.InstantEnrollment=Ellucian.InstantEnrollment||{};Ellucian.InstantEnrollment.SessionStorage=function(n){var t=this;t.keysReference={"instant-enrollment_classes-to-register":n.SelectedClasses,"instant-enrollment_person-info":n.PersonInformation,"instant-enrollment_additional-info":n.AdditionalInformation};t.getItem=function(n){return ko.mapping.toJS(t.keysReference[n])};t.removeItem=function(n){t.keysReference[n](null)};t.setItem=function(n,i){t.keysReference[n](i)}};Ellucian=Ellucian||{};Ellucian.InstantEnrollment=Ellucian.InstantEnrollment||{};Ellucian.InstantEnrollment.dataCollectorInstance=new Ellucian.InstantEnrollment.DataCollectorModel;Ellucian.InstantEnrollment.instantEnrollmentSessionStorage=new Ellucian.InstantEnrollment.SessionStorage(Ellucian.InstantEnrollment.dataCollectorInstance);Ellucian=Ellucian||{};Ellucian.InstantEnrollment=Ellucian.InstantEnrollment||{};Ellucian.InstantEnrollment.instantEnrollmentRepository=function(){var n=Ellucian.InstantEnrollment.instantEnrollmentSessionStorage,t=Ellucian.Storage.session;return{addSectionToCartStorage:function(t,i){return new Promise(function(r,u){var e,f,o;t||u(Ellucian.InstantEnrollment.Resources.UnableToProcessSectionAddMessage);classesKey="instant-enrollment_classes-to-register";e=n.getItem(classesKey);f=[];e?(f=e,f&&(o=f.find(function(n){return n.Id===t.Id}),o?r({data:Ellucian.InstantEnrollment.Resources.SectionAlreadyInCartMessage.replace("{0}",t.SectionNameDisplay),type:"warning"}):f.push({Id:t.Id,ClassName:t.FullTitleDisplay,CreditsSelected:i}))):f.push({Id:t.Id,ClassName:t.FullTitleDisplay,CreditsSelected:i});n.removeItem(classesKey);n.setItem(classesKey,f);r({data:Ellucian.InstantEnrollment.Resources.SectionAddedToCartSuccessMessage.replace("{0}",t.SectionNameDisplay),type:"success"})})},deleteSectionFromCartStorage:function(t){return new Promise(function(i,r){var e,f,u;t||r(Ellucian.InstantEnrollment.Resources.UnableToProcessSectionDeleteMessage);classesKey="instant-enrollment_classes-to-register";e=n.getItem(classesKey);u=[];e?(f=e,f&&f.length>0?(u=f.filter(function(n){return n.Id!==t.Id}),u.length<f.length?(n.removeItem(classesKey),u&&n.setItem(classesKey,u),i({data:Ellucian.InstantEnrollment.Resources.SectionDeletedFromCartSuccessMessage.replace("{0}",t.SectionNameDisplay),type:"success"})):r({data:Ellucian.InstantEnrollment.Resources.SectionDeletedFromCartFailureMessage.replace("{0}",t.SectionNameDisplay),type:"warning"})):r({data:Ellucian.InstantEnrollment.Resources.CartIsEmptyMessage,type:"error"})):r({data:Ellucian.InstantEnrollment.Resources.CartIsEmptyMessage,type:"error"})})},getSelectedClasses:function(){return new Promise(function(t){classesKey="instant-enrollment_classes-to-register";var i=n.getItem(classesKey);t(i)})},updateSectionsInCartStorage:function(t){return new Promise(function(i){var u,r;classesKey="instant-enrollment_classes-to-register";r=n.getItem(classesKey);n.removeItem(classesKey);u=[];ko.utils.arrayForEach(t,function(n){u.push({Id:n.Id,ClassName:n.ClassName,CreditsSelected:n.CreditsSelected,MarketingSource:n.MarketingSource,RegistrationReason:n.RegistrationReason,Cost:n.Cost})});n.setItem(classesKey,u);r=n.getItem(classesKey);i(r)})},cleanSectionsInCartStorage:function(){return new Promise(function(t){classesKey="instant-enrollment_classes-to-register";n.removeItem(classesKey);t([])})},getPersonIdentificationModel:function(){return new Promise(function(n,t){$.ajax({url:Ellucian.InstantEnrollment.ActionUrls.GetPersonIdentificationModelAsync,type:"GET",contentType:jsonContentType,dataType:"json"}).done(function(i){var r=account.handleInvalidSessionResponseSkipGuest(i,!0);r||n(i);t(Ellucian.InstantEnrollment.Resources.UnableToLoadPersonalIdentificationFormMessage)}).fail(function(){t(Ellucian.InstantEnrollment.Resources.UnableToLoadPersonalIdentificationFormMessage)}).always(function(){})})},updatePersonIdentificationInfo:function(t){return new Promise(function(i,r){t||r(Ellucian.InstantEnrollment.Resources.UnableToProcessPersonalIdentificationInformationMessage);personInfoKey="instant-enrollment_person-info";n.removeItem(personInfoKey);n.setItem(personInfoKey,t);i(t)})},getAdditionalInformationModel:function(n){var t={personInformation:n!==null?ko.toJSON(n):null};return new Promise(function(n,i){$.ajax({url:Ellucian.InstantEnrollment.ActionUrls.GetAdditionalInformationModelAsync,type:"POST",data:JSON.stringify(t),contentType:jsonContentType,dataType:"json"}).done(function(t){var r=account.handleInvalidSessionResponseSkipGuest(t,!0);r||n(t);i(Ellucian.InstantEnrollment.Resources.UnableToLoadAdditionalInformationFormMessage)}).fail(function(){i(Ellucian.InstantEnrollment.Resources.UnableToLoadAdditionalInformationFormMessage)}).always(function(){})})},getSavedAdditionalInformation:function(){return new Promise(function(t){additionalInfoKey="instant-enrollment_additional-info";var i=n.getItem(additionalInfoKey);t(i)})},getSavedPersonIdentificationInfo:function(){return new Promise(function(t){personInfoKey="instant-enrollment_person-info";var i=n.getItem(personInfoKey);t(i)})},updateAdditionalDetails:function(t){return new Promise(function(i,r){t||r(Ellucian.InstantEnrollment.Resources.UnableToProcessAdditionalInformationFormMessage);additionalInfoKey="instant-enrollment_additional-info";n.removeItem(additionalInfoKey);n.setItem(additionalInfoKey,t);i(t)})},updateSectionInfo:function(t){return new Promise(function(i,r){t||r(Ellucian.InstantEnrollment.Resources.UnableToProcessAdditionalInformationFormMessage);classesKey="instant-enrollment_classes-to-register";n.removeItem(classesKey);n.setItem(classesKey,t);i(t)})},getPayForClassesModel:function(n,t,i){var r={sectionsToPay:ko.toJSON(n),personInformation:t!==null?ko.toJSON(t):null,additionalInformation:ko.toJSON(i)};return new Promise(function(n,t){$.ajax({url:Ellucian.InstantEnrollment.ActionUrls.GetPayForClassesModelAsync,type:"POST",data:JSON.stringify(r),contentType:jsonContentType,dataType:"json"}).done(function(i){var r=account.handleInvalidSessionResponseSkipGuest(i,!0);r||n(i);t(Ellucian.InstantEnrollment.Resources.UnableToRetrieveSectionsForPaymentMessage)}).fail(function(){t(Ellucian.InstantEnrollment.Resources.UnableToRetrieveSectionsForPaymentMessage)}).always(function(){})})},getPaymentReviewModel:function(n,t,i){var r=!1,u={sectionsToPay:ko.toJSON(n),paymentMethod:ko.toJSON(t),personInfo:i!==null?ko.toJSON(i):null};return new Promise(function(n,t){$.ajax({url:Ellucian.InstantEnrollment.ActionUrls.GetPaymentReviewModelAsync,type:"POST",data:JSON.stringify(u),contentType:jsonContentType,dataType:"json"}).done(function(i){var u=account.handleInvalidSessionResponseSkipGuest(i,!0);u?i.InvalidSession&&(r=!0):n(i);r?($("#notificationHost").notificationCenter("addNotification",{message:studentFinanceSessionExpiredMessage,type:"error",flash:!0}),window.location=Ellucian.InstantEnrollment.ActionUrls.Index):t(Ellucian.InstantEnrollment.Resources.UnableToLoadPaymentReviewFormMessage)}).fail(function(){t(Ellucian.InstantEnrollment.Resources.UnableToLoadPaymentReviewFormMessage)}).always(function(){})})},processZeroCostRegistrationForClasses:function(n,t,i){var r={sectionsToRegister:ko.toJSON(n),personInformation:t!==null?ko.toJSON(t):null,additionalInformation:ko.toJSON(i)};return new Promise(function(n,t){$.ajax({url:Ellucian.InstantEnrollment.ActionUrls.ProcessZeroCostRegistrationForClassesAsync,type:"POST",data:JSON.stringify(r),contentType:jsonContentType,dataType:"json"}).done(function(i){var r=account.handleInvalidSessionResponseSkipGuest(i,!0);r||n(i);t(Ellucian.InstantEnrollment.Resources.ProcessingZeroCostRegistrationErrorMessage)}).fail(function(){t(Ellucian.InstantEnrollment.Resources.ProcessingZeroCostRegistrationErrorMessage)}).always(function(){})})},getClassAcknowledgementModel:function(n,i){var r={registrationResult:n,sectionsToRegister:i};return t.removeItem("instant-enrollment_advanced-search-criteria"),new Promise(function(n,t){$.ajax({url:Ellucian.InstantEnrollment.ActionUrls.GetClassAcknowledgementModelAsync,type:"POST",data:JSON.stringify(r),contentType:jsonContentType,dataType:"json"}).done(function(i){var r=account.handleInvalidSessionResponseSkipGuest(i,!0);r||n(i);t(Ellucian.InstantEnrollment.Resources.UnableToRetrieveRegistrationResultsMessage)}).fail(function(){t(Ellucian.InstantEnrollment.Resources.UnableToRetrieveRegistrationResultsMessage)}).always(function(){})})},processECheckRegistrationForClasses:function(n,t,i,r){var u={sectionsToRegister:ko.toJSON(n),personInformation:t!==null?ko.toJSON(t):null,additionalInformation:ko.toJSON(i),echeckPaymentInformation:ko.toJSON(r)};return new Promise(function(n,t){$.ajax({url:Ellucian.InstantEnrollment.ActionUrls.ProcessECheckRegistrationForClassesAsync,type:"POST",data:JSON.stringify(u),contentType:jsonContentType,dataType:"json"}).done(function(i){var r=account.handleInvalidSessionResponseSkipGuest(i,!0);r||n(i);t(Ellucian.InstantEnrollment.Resources.ProcessingECheckRegistrationErrorMessage)}).fail(function(){t(Ellucian.InstantEnrollment.Resources.ProcessingECheckRegistrationErrorMessage)}).always(function(){})})},processPaymentGatewayRegistrationForClasses:function(n,t,i,r){var u={sectionsToRegister:ko.toJSON(n),personInformation:t!==null?ko.toJSON(t):null,additionalInformation:ko.toJSON(i),paymentReviewModel:ko.toJSON(r)};return new Promise(function(n,t){$.ajax({url:Ellucian.InstantEnrollment.ActionUrls.ProcessPaymentGatewayRegistrationForClassesAsync,type:"POST",data:JSON.stringify(u),contentType:jsonContentType,dataType:"json"}).done(function(i){var r=account.handleInvalidSessionResponseSkipGuest(i,!0);r||n(i);t(Ellucian.InstantEnrollment.Resources.ProcessingPaymentGatewayRegistrationErrorMessage)}).fail(function(){t(Ellucian.InstantEnrollment.Resources.ProcessingPaymentGatewayRegistrationErrorMessage)}).always(function(){})})},addAdvancedSearchCriteriaToStorage:function(n){key="instant-enrollment_advanced-search-criteria";t.removeItem(key);t.setItem(key,n)},retrieveAdvancedSearchCriteriaFromStorage:function(){key="instant-enrollment_advanced-search-criteria";return t.getItem(key)},removeAdvancedSearchCriteriaFromStorage:function(){key="instant-enrollment_advanced-search-criteria";t.removeItem(key)}}}();Ellucian.CatalogAdvancedSearch=Ellucian.CatalogAdvancedSearch||{};Ellucian.CatalogAdvancedSearch.catalogAdvancedSearchKeywordComponentsModel=function(){var n=this;this.synonym=ko.observable("");this.synonym.ErrorMessage=ko.observable("");this.synonym.isValid=ko.computed(function(){n.synonym.ErrorMessage("");var t=Globalize.parseInt(n.synonym());return isNaN(t)&&!isNullOrEmpty(n.synonym())?(n.synonym.ErrorMessage(Ellucian.CatalogAdvancedSearch.MarkupLabels.invalidSynonymFormatErrorMessage),!1):!0});this.subject=ko.observable("");this.subject.isEnabled=ko.computed(function(){return isNullOrEmpty(n.synonym())?!0:(n.subject(""),!1)});this.courseNumber=ko.observable("");this.courseNumber.isEnabled=ko.computed(function(){return isNullOrEmpty(n.subject())?(n.courseNumber(""),!1):!0});this.section=ko.observable("");this.section.isEnabled=ko.computed(function(){return isNullOrEmpty(n.courseNumber())?(n.section(""),!1):!0});this.isNullOrEmpty=function(){return isNullOrEmpty(n.subject())&&isNullOrEmpty(n.courseNumber())&&isNullOrEmpty(n.section())&&isNullOrEmpty(n.synonym())?!0:!1};this.isValid=ko.computed(function(){return n.synonym.isValid()===!1?!1:!0})};Ellucian=Ellucian||{};Ellucian.InstantEnrollment=Ellucian.InstantEnrollment||{};advancedSearchMapping={ignore:["isValid"],include:["location","topicCode"]};Ellucian.InstantEnrollment.catalogAdvancedSearchViewModel=function(n){var t=this;BaseViewModel.call(t,768);t.checkForMobile(window,document);this.TopicCodes=ko.observableArray();this.Terms=ko.observableArray();this.Locations=ko.observableArray();this.TimeRanges=ko.observableArray();this.DaysOfWeek=ko.observableArray();this.LatestSearchDate=ko.observable(null);this.EarliestSearchDate=ko.observable(null);this.catalogAdvancedSearchDataModelInstance=new Ellucian.InstantEnrollment.IEAdvancedSearchDataModel;this.isLoaded=ko.observable(!1);this.isSubmissionInProgress=ko.observable(!1);this.dirtyFlag=new ko.dirtyFlag(t.catalogAdvancedSearchDataModelInstance,!1);this.areDaysSelected=ko.computed(function(){for(var n=0;n<t.DaysOfWeek().length;n++)if(t.DaysOfWeek()[n].Item3()==!0)return!0;return!1});this.isSearchEnabled=ko.computed(function(){return t.dirtyFlag.isDirty()||t.areDaysSelected()});this.submit=function(){var i,r;try{for(t.isSubmissionInProgress(!0),t.catalogAdvancedSearchDataModelInstance.days=[],i=0;i<t.DaysOfWeek().length;i++)t.DaysOfWeek()[i].Item3()==!0&&t.catalogAdvancedSearchDataModelInstance.days.push(t.DaysOfWeek()[i].Item2());r=ko.toJS(t.catalogAdvancedSearchDataModelInstance);delete r.isValid;Ellucian.InstantEnrollment.instantEnrollmentRepository.addAdvancedSearchCriteriaToStorage(r);ko.utils.postJson(n,{model:r,dataCollectorModelJson:ko.toJS(Ellucian.InstantEnrollment.dataCollectorInstance),__IsGuestUser:isGuest,__RequestVerificationToken:$('input[name="__RequestVerificationToken"]').val()})}catch(u){t.isSubmissionInProgress(!1);console.error(u.message);$("#notificationHost").notificationCenter("addNotification",{message:"advanced search failed",type:"error"})}};this.clear=function(){for(var n=0;n<t.DaysOfWeek().length;n++)t.DaysOfWeek()[n].Item3(!1);return t.catalogAdvancedSearchDataModelInstance.clear()}};Ellucian.InstantEnrollment.IEAdvancedSearchDataModel=function(){var n=this;n.topicCode=ko.observable("");n.location=ko.observable("");n.courseCodeNumber=ko.observable("");n.startDate=ko.observable(null);n.startDate.isValid=ko.observable(!0);n.startDateValueEntry=ko.pureComputed({read:function(){return n.startDate()},write:function(t){n.startDate.isValid(!0);n.startDate(t);n.endDate()&&n.startDate()&&moment(n.endDate())>moment(n.startDate())&&n.endDate.isValid(!0)},owner:n});n.endDate=ko.observable(null);n.endDate.isValid=ko.observable(!0);n.endDateValueEntry=ko.pureComputed({read:function(){return n.endDate()},write:function(t){n.endDate.isValid(!0);n.endDate(t)},owner:n});n.days=ko.observableArray();n.timeRange=ko.observable();n.isValid=ko.computed(function(){return n.startDate.isValid()&&n.endDate.isValid()?!0:!1});n.clear=function(){n.topicCode(undefined);n.location(undefined);n.startDate(null);n.endDate(null);n.days([]);n.timeRange(null);n.courseCodeNumber("");Ellucian.InstantEnrollment.instantEnrollmentRepository.removeAdvancedSearchCriteriaFromStorage();return};n.startDateEntryError=function(){n.startDate.isValid(!1)};n.endDateEntryError=function(){n.endDate.isValid(!1)};n.mapToJS=function(){var n=this;return ko.mapping.toJS(n)}};Ellucian=Ellucian||{};Ellucian.InstantEnrollment=Ellucian.InstantEnrollment||{};Ellucian.InstantEnrollment.IECatalogSearchViewModel=function(){var n=this;n.catalogAdvancedSearchViewModelInstance=new Ellucian.InstantEnrollment.catalogAdvancedSearchViewModel(Ellucian.InstantEnrollment.ActionUrls.postAdvancedSearchUrl);n.initialization=function(){$.ajax({url:Ellucian.InstantEnrollment.ActionUrls.getAdvancedSearchUrl,type:"GET",contentType:jsonContentType,dataType:"json",success:function(t){if(!account.handleInvalidSessionResponse(t)){ko.mapping.fromJS(t,{},n.catalogAdvancedSearchViewModelInstance);var i=Ellucian.InstantEnrollment.instantEnrollmentRepository.retrieveAdvancedSearchCriteriaFromStorage();i!==null&&i!==undefined?(n.catalogAdvancedSearchViewModelInstance.catalogAdvancedSearchDataModelInstance.startDate(null),n.catalogAdvancedSearchViewModelInstance.catalogAdvancedSearchDataModelInstance.endDate(null),ko.mapping.fromJS(i,{ignore:["startDate","endDate","startDateValueEntry","endDateValueEntry"]},n.catalogAdvancedSearchViewModelInstance.catalogAdvancedSearchDataModelInstance),i.timeRange&&ko.utils.arrayFirstDeprecated(n.catalogAdvancedSearchViewModelInstance.TimeRanges(),function(t){if(t.Item1()===i.timeRange.Item1){n.catalogAdvancedSearchViewModelInstance.catalogAdvancedSearchDataModelInstance.timeRange(t);return}}),i.days&&i.days.length>0&&i.days.forEach(function(t){n.catalogAdvancedSearchViewModelInstance.DaysOfWeek()[t].Item3(!0)}),i.startDate&&n.catalogAdvancedSearchViewModelInstance.catalogAdvancedSearchDataModelInstance.startDate(new Date(i.startDate)),i.endDate&&n.catalogAdvancedSearchViewModelInstance.catalogAdvancedSearchDataModelInstance.endDate(new Date(i.endDate))):n.catalogAdvancedSearchViewModelInstance.catalogAdvancedSearchDataModelInstance.startDate(n.catalogAdvancedSearchViewModelInstance.EarliestSearchDate())}},error:function(n){n.status!=0&&$("#notificationHost").notificationCenter("addNotification",{message:"Unable to retrieve search options.",type:"error"})},complete:function(){ko.applyBindings(Ellucian.InstantEnrollment.catalogSearchViewInstance,document.getElementById("main-content"));n.catalogAdvancedSearchViewModelInstance.isLoaded(!0)}})}};$(document).ready(function(){Ellucian.InstantEnrollment.catalogSearchViewInstance=new Ellucian.InstantEnrollment.IECatalogSearchViewModel;Ellucian.InstantEnrollment.catalogSearchViewInstance.initialization()})