{"version":3,"file":"sm.portal.vm.applicationSection.min.js","names":["jQuery","sm","window","portal","extend","vm","ApplicationSectionModel","options","settings","AppearanceOrder","SectionName","SectionTitle","SectionNavTitle","Applied","Required","Completed","SectionModel","SectionTemplate","Active","self","this","ko","observable","computed","utility","isNullOrEmpty","smapi","constant","applicationDebugFlag","console","log","custom","callCustomization","NavigationClass","classes","acctModel","viewModel","GetSectionModel","beforeTermsModel","AllowNext","IsLoggedIn","cusData","isAPASFeatureEnabled","getResourceValue","required","Boolean","IsPermanentResident","HaveStudyPermit","HaveWorkPermit","AriaCurrent","SectionIndex","thisIndex","i","AppliedSections","length","toString","FormName","formatString","AllowNextCustom","e","SectionNavClicked","loadSection","SubmitAvailable","retcus","page","application","beforeTermsAccepted","params","ActiveSectionChanged","SectionNavSidebarClicked","regularExpressionString","PasswordRegex","regularExpression","RegExp","minNumberofChars","PasswordMinLength","newPassword","val","newPasswordConfirm","NewAccountPassword","NewAccountConfirmPassword","test","CanAdvanceAfterTerms","CurrentSection","allOtherLi","not","li","titleBar","find","displayTitle","css","hasClass","removeClass","addClass","each","customData","retParams","Activate","DataLoaded","DataLoading","BlockContainer","UnBlockContainer","GetModelData","ApplicationMID","PersonMID","Initialize","message","IsRequired","Touched","ui","readyPage","revealAppContent","fieldHelp","addDetailedListItem","additionalFieldsToggle","SetSectionsConfigData","configData","isDynamicSection","isNullEmptyOrNothing","ShowSection"],"sources":["assets/js/viewmodels/admissions/sm.portal.vm.applicationSection.js"],"mappings":"CAEA,SAAWA,GACP,IAAIC,EAAKC,OAAOD,GAAKC,OAAOD,IAAM,CAAC,OAIV,IAAdA,EAAGE,QACVH,EAAOI,OAAOH,EAAI,CAAEE,OAAQ,CAAC,SAEL,IAAjBF,EAAGE,OAAOE,IACjBL,EAAOI,OAAOH,EAAGE,OAAQ,CAAEE,GAAI,CAAC,IA2SpCL,EAAOI,QAAO,EAAMH,EAAGE,OAAOE,GAAI,CAC9BC,wBAtSJ,SAAiCC,GAE7B,IAYIC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,KAAKJ,eAAeyF,WAAWrF,KACnC,CAAE,MAAOuC,GAASjC,MAAMC,SAASC,sBAAwBC,QAAQC,IAAI,gCAAkC6B,EAAE+C,QAAY,CAGrH,IACItF,KAAKJ,eAAe2F,WAAWxF,EAAKL,WACxC,CAAE,MAAO6C,GAAK,CAGdvC,KAAKF,QAAO,GAEZE,KAAKJ,eAAe4F,SAAQ,GAG5B3G,EAAGE,OAAO0G,GAAGC,YACb7G,EAAGE,OAAO6D,KAAKC,YAAY8C,mBAC3B9G,EAAGE,OAAO6D,KAAKC,YAAY+C,YAG3B/G,EAAGE,OAAO6D,KAAKC,YAAYgD,sBAC3BhH,EAAGE,OAAO6D,KAAKC,YAAYiD,wBAC/B,EAEA9F,KAAK+F,sBAAwB,SAASC,EAAYC,GAE1CpH,EAAGE,OAAOqB,QAAQ8F,qBAAqBF,KAEnCnH,EAAGE,OAAOqB,QAAQC,cAAc2F,EAAWG,cAAiBF,IAC5DjG,KAAKP,QAAQuG,EAAWG,cACvBH,EAAWG,aAAenG,KAAKN,UAAS,IAGzCsG,EAAW1G,cACXU,KAAKR,gBAAgBwG,EAAW1G,aAChCU,KAAKT,aAAayG,EAAW1G,cAG7B0G,EAAW3G,iBACXW,KAAKX,gBAAgB2G,EAAW3G,iBAG5C,EAEOU,CACX,GAMH,CAxTD,CAwTGnB","ignoreList":[],"sourcesContent":["/// \r\n\r\n(function (jQuery, undefined) {\r\n var sm = window.sm = window.sm || {};\r\n var windowProxy;\r\n var actionQueue = [];\r\n\r\n if (typeof sm.portal === \"undefined\") {\r\n jQuery.extend(sm, { portal: {} });\r\n }\r\n if (typeof sm.portal.vm === \"undefined\") {\r\n jQuery.extend(sm.portal, { vm: {} });\r\n }\r\n\r\n /************************************************/\r\n /* Section View Model */\r\n /************************************************/\r\n function ApplicationSectionModel(options) {\r\n\r\n var defaults = {\r\n AppearanceOrder: 0,\r\n SectionName: '',\r\n SectionTitle: '',\r\n SectionNavTitle: '',\r\n Applied: false,\r\n Required: false,\r\n Completed: false,\r\n SectionModel: null,\r\n SectionTemplate: null,\r\n Active: false\r\n };\r\n var settings = jQuery.extend({}, defaults, options);\r\n\r\n // Self-Identification\r\n var self = this;\r\n\r\n this.AppearanceOrder = ko.observable(settings.AppearanceOrder);\r\n this.SectionName = ko.observable(settings.SectionName);\r\n this.SectionTitle = ko.observable(settings.SectionTitle);\r\n this.SectionNavTitle = ko.observable(settings.SectionNavTitle);\r\n this.Applied = ko.observable(settings.Applied);\r\n this.Required = ko.observable(settings.Required);\r\n this.Active = ko.observable(settings.Active);\r\n this.SectionModel = ko.observable(settings.SectionModel);\r\n this.SectionTemplate = ko.observable(settings.SectionTemplate);\r\n\r\n // Computed\r\n this.Completed = ko.computed(function () {\r\n if (sm.portal.utility.isNullOrEmpty(this.SectionModel())) {\r\n return false;\r\n }\r\n if (smapi.constant.applicationDebugFlag) { console.log('Section Completed [' + this.SectionName() + ']: ' + this.SectionModel().Completed()); }\r\n return this.SectionModel().Completed();\r\n }, this);\r\n \r\n sm.portal.vm.custom.callCustomization('UpdateApplicationSectionProps', self);\r\n this.NavigationClass = ko.computed(function () {\r\n var classes = 'appsecItem';\r\n\r\n var acctModel = viewModel.GetSectionModel('Account');\r\n var beforeTermsModel = viewModel.GetSectionModel('BeforeTerms');\r\n var curModel = viewModel;\r\n\r\n if (this.Active()) {\r\n classes += ' active';\r\n }\r\n else if (!acctModel.AllowNext() && !acctModel.IsLoggedIn()) {\r\n classes += ' disabled';\r\n }\r\n else if ( beforeTermsModel && !beforeTermsModel.Completed() && this.SectionName() !== 'BeforeTerms') {\r\n classes += ' disabled';\r\n }\r\n var cusData = {\r\n self: self,\r\n classes: classes\r\n }\r\n\r\n sm.portal.vm.custom.callCustomization('UpdateNavigationClass', cusData);\r\n\r\n if(sm.portal.utility.isAPASFeatureEnabled() && this.SectionTitle() === sm.portal.utility.getResourceValue('DemographicInformation')){\r\n let required = Boolean(this.SectionModel().IsPermanentResident() || this.SectionModel().HaveStudyPermit() || this.SectionModel().HaveWorkPermit());\r\n this.Required(required);\r\n }\r\n\r\n classes += ' appsecReq' + this.Required() + 'Com' + this.Completed();\r\n\r\n return classes;\r\n }, self);\r\n\r\n this.AriaCurrent = ko.computed(function () {\r\n if (this.Active()) {\r\n var currentSection = this.SectionTitle;\r\n return currentSection;\r\n }\r\n else {\r\n return null;\r\n }\r\n \r\n }, self);\r\n\r\n this.SectionIndex = ko.computed(function () {\r\n\r\n var thisIndex = 0;\r\n for (var i = 0; i < viewModel.AppliedSections().length; i++) {\r\n if (viewModel.AppliedSections()[i].SectionName() == this.SectionName()) {\r\n thisIndex = i + 1;\r\n }\r\n }\r\n\r\n return thisIndex.toString();\r\n }, self);\r\n this.FormName = ko.computed(function () {\r\n return sm.portal.utility.formatString('{0}Form', self.SectionName());\r\n }, this);\r\n this.AllowNext = ko.computed(function () {\r\n try {\r\n var AllowNextCustom = sm.portal.vm.custom.callCustomization('AllowNextCustom', self); \r\n if(!sm.portal.utility.isNullOrEmpty(AllowNextCustom)){\r\n return AllowNextCustom;\r\n }\r\n return this.SectionModel().AllowNext();\r\n } catch (e) {\r\n return true; // If it's not overwritten, assume it's ok to continue.\r\n }\r\n }, this);\r\n\r\n // Methods\r\n this.SectionNavClicked = function () {\r\n\r\n var loadSection = true;\r\n if (this.SectionName() == 'Summary' && !viewModel.SubmitAvailable()) {\r\n loadSection = false;\r\n }\r\n\r\n var retcus = sm.portal.vm.custom.callCustomization(\"CustomDisableNavigtion\",self);\r\n if(!sm.portal.utility.isNullOrEmpty(retcus)){\r\n var beforeTermsAccepted = sm.portal.utility.isNullOrEmpty(sm.portal.page.application.beforeTermsAccepted) ? false : sm.portal.page.application.beforeTermsAccepted;\r\n if(!beforeTermsAccepted && (this.SectionName()!==\"Account\" && this.SectionName()!==\"BeforeTerms\")){\r\n return;\r\n }\r\n }\r\n\r\n var params = {\r\n self: self,\r\n loadSection: loadSection,\r\n viewModel: viewModel\r\n }\r\n\r\n sm.portal.vm.custom.callCustomization('UpdateSectionNavClicked', params);\r\n\r\n if (loadSection) {\r\n this.Active(true);\r\n viewModel.ActiveSectionChanged(self);\r\n if(this.SectionName() == 'HighSchool' && sm.portal.utility.isAPASFeatureEnabled()){\r\n this.SectionModel().Completed(true);\r\n }\r\n }\r\n };\r\n this.SectionNavSidebarClicked = function () {\r\n\r\n // Are we in Sidebar or Sidebar Collapsed mode?\r\n \r\n //Business rule: must be logged in or have passwords to navigate off account section.\r\n var acctModel = viewModel.GetSectionModel('Account');\r\n // - check if logged in.\r\n if (!acctModel.IsLoggedIn())\r\n {\r\n var regularExpressionString = acctModel.PasswordRegex();\r\n var regularExpression = new RegExp(regularExpressionString);\r\n var minNumberofChars = acctModel.PasswordMinLength();;\r\n\r\n // - if not logged in, check if passwords are available\r\n var newPassword = jQuery(\"#NewAccountPassword\").val();\r\n var newPasswordConfirm = jQuery(\"#NewAccountConfirmPassword\").val();\r\n\r\n //if passwords are not in the dom find them in the view model.\r\n if (sm.portal.utility.isNullOrEmpty(newPassword)) {\r\n newPassword = acctModel.NewAccountPassword();\r\n }\r\n if (sm.portal.utility.isNullOrEmpty(newPasswordConfirm)) {\r\n newPasswordConfirm = acctModel.NewAccountConfirmPassword();\r\n }\r\n\r\n // Are the password account fields filled in?\r\n if (sm.portal.utility.isNullOrEmpty(newPassword) || sm.portal.utility.isNullOrEmpty(newPasswordConfirm)) {\r\n return; // don't navigate away\r\n }\r\n else if (!sm.portal.utility.isNullOrEmpty(newPassword) && !sm.portal.utility.isNullOrEmpty(newPasswordConfirm)) {\r\n if (newPassword.length < minNumberofChars) {\r\n return; // don't navigate away\r\n }\r\n if (!regularExpression.test(newPassword)) {\r\n return; // don't navigate away\r\n }\r\n if (newPassword != newPasswordConfirm) {\r\n return; // don't navigate away\r\n }\r\n }\r\n }\r\n\r\n if (sm.portal.utility.isNullOrEmpty(sm.portal.vm.custom.callCustomization(\"CanAdvanceAfterTermsHide\")) && !viewModel.CanAdvanceAfterTerms(viewModel.CurrentSection())) {\r\n return;\r\n }\r\n\r\n var allOtherLi = jQuery(\".applicationSidebar li\").not(this);\r\n var li = jQuery(\".applicationSidebar li[datasectionname='\" + this.SectionName() + \"']\");\r\n var titleBar = jQuery(li).find('span.appsecTitle');\r\n var displayTitle = titleBar.css('display');\r\n\r\n if (smapi.constant.applicationDebugFlag) {\r\n console.log('Display Title: ' + displayTitle);\r\n console.log('Has Expanded Class: ' + li.hasClass('expanded'));\r\n }\r\n\r\n if (displayTitle == 'none') {\r\n\r\n allOtherLi.removeClass('expanded');\r\n allOtherLi.find('span.appsecTitle').removeClass('expanded');\r\n // In Compacted View, needs to expand\r\n li.addClass('expanded');\r\n titleBar.addClass('expanded');\r\n\r\n } else {\r\n if (li.hasClass('expanded')) {\r\n // In Compacted View, but already expanded\r\n li.removeClass('expanded');\r\n titleBar.removeClass('expanded');\r\n }\r\n\r\n // Close any Expanded on other LIs when navigating away\r\n var allLIs = jQuery(\".applicationSidebar li\").each(function () {\r\n jQuery(this).removeClass('expanded')\r\n var titleBar = jQuery(this).find('span.appsecTitle').removeClass('expanded');\r\n });\r\n\r\n // Navigate\r\n var customData = {\r\n self: self,\r\n li: li\r\n }\r\n var retParams = sm.portal.vm.custom.callCustomization('CustomListItem',customData);\r\n if(sm.portal.utility.isNullOrEmpty(retParams)){\r\n this.SectionNavClicked();\r\n }\r\n\r\n }\r\n };\r\n this.Activate = function () {\r\n\r\n if (smapi.constant.applicationDebugFlag) { console.log('[SectionModel.Activate] Activating ' + this.SectionName()); }\r\n if (smapi.constant.applicationDebugFlag) { console.log('[SectionModel.Activate] Data Loaded? ' + this.SectionModel().DataLoaded()); }\r\n if (smapi.constant.applicationDebugFlag) { console.log('[SectionModel.Activate] Data Loading? ' + this.SectionModel().DataLoading()); }\r\n\r\n // If Data Is not loaded, block UI and load data\r\n if (!this.SectionModel().DataLoaded() && !this.SectionModel().DataLoading()) {\r\n this.SectionModel().GetModelData(true, viewModel.ApplicationMID(), viewModel.PersonMID());\r\n } else if (!this.SectionModel().DataLoaded() && this.SectionModel().DataLoading()) {\r\n self.SectionModel().BlockContainer();\r\n } else if (this.SectionModel().DataLoaded() && !this.SectionModel().DataLoading()) {\r\n self.SectionModel().UnBlockContainer();\r\n }\r\n\r\n // Attempt to initialize the model, some may not have this method\r\n try {\r\n this.SectionModel().Initialize(this);\r\n } catch (e) { if (smapi.constant.applicationDebugFlag) { console.log('No Initialize on this model: ' + e.message); } }\r\n\r\n // Attempt to trigger any child properties for IsRequired\r\n try {\r\n this.SectionModel().IsRequired(self.Required());\r\n } catch (e) { }\r\n\r\n // Set the Active Flag\r\n this.Active(true);\r\n // Set the Touched Flag\r\n this.SectionModel().Touched(true);\r\n\r\n // Ready Page\r\n sm.portal.ui.readyPage();\r\n sm.portal.page.application.revealAppContent();\r\n sm.portal.page.application.fieldHelp();\r\n\r\n // GENERIC PROTYTPE SCRIPTS \r\n sm.portal.page.application.addDetailedListItem();\r\n sm.portal.page.application.additionalFieldsToggle();\r\n };\r\n // Method to update section configurations from admin portal\r\n this.SetSectionsConfigData = function(configData, isDynamicSection){\r\n // If ConfigData has keys, update it\r\n if(!sm.portal.utility.isNullEmptyOrNothing(configData)) {\r\n // section show/hide\r\n if(!sm.portal.utility.isNullOrEmpty(configData.ShowSection) && !isDynamicSection){\r\n this.Applied(configData.ShowSection);\r\n !configData.ShowSection && this.Required(false); // If it's not applied, it's not required\r\n }\r\n //section name change\r\n if (configData.SectionName) {\r\n this.SectionNavTitle(configData.SectionName);\r\n this.SectionTitle(configData.SectionName);\r\n }\r\n // Appearance order\r\n if (configData.AppearanceOrder) {\r\n this.AppearanceOrder(configData.AppearanceOrder);\r\n }\r\n }\r\n };\r\n \r\n return self;\r\n };\r\n\r\n jQuery.extend(true, sm.portal.vm, {\r\n ApplicationSectionModel: ApplicationSectionModel,\r\n });\r\n\r\n})(jQuery);"]}