{"version":3,"file":"sm.portal.vm.applicationinformation.min.js","names":["jQuery","sm","window","portal","extend","vm","ApplicationInformationViewModel","self","this","utility","isUKFeatureEnabled","CommunicationTypes","ko","observableArray","HeardAboutInstituteFrom","validatedObservable","InstituteCoursesPreviouslyTaken","InterviewViaSkype","InterviewSkypeNameOrEmail","InterviewViaPhone","InterviewPhoneNumber","InterviewInPerson","PreferredCommunicationTypeID","InstituteRelationship","InstituteRelationshipName","InstituteRelationshipDescription","PersonalStatement","UpdateTemplateProperties","HideHeardAboutInstituteFrom","observable","HideInstituteRelationship","InterviewPreferencesTemplate","HideInterviewPreferences","HideInterviewViaPhone","HidePreferredCommunicationType","HidePersonalStatement","custom","setCustomLocalizeKey","DataLoaded","DataLoading","DataContainer","Touched","DataLoadErrorCount","isPersonalStatementValid","callCustomization","AnythingPopulated","computed","isNullOrEmpty","response","ShowInterviewSkypeNameOrEmail","ShowInterviewPhoneNumber","ShowInstituteRelationshipDetails","LoadModel","container","Payload","Config","viewModel","SetSectionsConfigData","customData","ListData","smapi","access","loadListItemModels","ApplicationInformation","constant","applicationDebugFlag","console","log","GetModelData","blockui","applicationMID","personMID","callback","allCustomData","blockUI","url","_baseApiUri","formatString","ajax","type","dataType","contentType","headers","processData","crossDomain","xhrFields","withCredentials","success","data","textStatus","jqXHR","page","application","modelDataResponseHandler","error","exception","modelErrorHandler","handleErrorWithMessages","BlockContainer","block","message","getResourceValue","UnBlockContainer","unblock","SetFocus","ProcessOnServer","ExtractATO","stdApplicationInformation","admissions","AdmissionsAttemptUKAdditionalInfoModel","AdmissionsAttemptUKPersonalStatementModel","maxLength","params","validate_0CharactersOrLess_Key","min","validate_MustBeNumeric_Key","max","number","checkLengthPersonal","length","match","ModelErrors","validation","group","IsVMValid","Completed","isCompletedCustom"],"sources":["assets/js/viewmodels/admissions/sm.portal.vm.applicationinformation.js"],"mappings":"CAGA,SAAWA,GACP,IAAIC,EAAKC,OAAOD,GAAKC,OAAOD,IAAM,CAAC,OAIV,IAA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,UAAS,WAEzB,IAAI0C,EAAM,CACN3C,kBAAoBrC,KAAKqC,oBACzBJ,QAAUjC,KAAKiC,WAEfqF,EAAoBtH,KAAKoH,aAAe3H,EAAGE,OAAOE,GAAG+B,OAAOQ,kBAAkB,kBAAmB4C,GACrG,OAAIvF,EAAGE,OAAOM,QAAQsC,cAAc+E,GAGlBtH,KAAKoH,cAAgBpH,KAAKqC,qBAAuBrC,KAAKiC,WAF7DqF,CAKf,GAAGtH,MAGID,CACX,GAMH,CAxVD,CAwVGP","ignoreList":[],"sourcesContent":["/// \r\n\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 // Application Information Data View Model\r\n // Holds additional application information information for an applicant\r\n /**************************************/\r\n function ApplicationInformationViewModel() {\r\n\r\n // Self-Identification\r\n var self = this;\r\n var ukFeatureEnabled = sm.portal.utility.isUKFeatureEnabled();\r\n /*** LIST DATA PROPERTIES ***/\r\n this.CommunicationTypes = ko.observableArray();\r\n /*** LIST DATA PROPERTIES ***/\r\n\r\n /*** PROPERTIES ***/\r\n this.HeardAboutInstituteFrom = ko.validatedObservable();\r\n this.InstituteCoursesPreviouslyTaken = ko.validatedObservable();\r\n this.InterviewViaSkype = ko.validatedObservable();\r\n this.InterviewSkypeNameOrEmail = ko.validatedObservable();\r\n this.InterviewViaPhone = ko.validatedObservable();\r\n this.InterviewPhoneNumber = ko.validatedObservable();\r\n this.InterviewInPerson = ko.validatedObservable();\r\n this.PreferredCommunicationTypeID = ko.validatedObservable();\r\n this.InstituteRelationship = ko.validatedObservable();\r\n this.InstituteRelationshipName = ko.validatedObservable();\r\n this.InstituteRelationshipDescription = ko.validatedObservable();\r\n this.PersonalStatement = ko.validatedObservable();\r\n\r\n this.UpdateTemplateProperties = {\r\n HideHeardAboutInstituteFrom : ko.observable(false),\r\n HideInstituteRelationship : ko.observable(false),\r\n InterviewPreferencesTemplate : ko.observable(''),\r\n HideInterviewPreferences : ko.observable(false),\r\n HideInterviewViaPhone : ko.observable(false),\r\n HidePreferredCommunicationType : ko.observable(false),\r\n HidePersonalStatement : ko.observable(false)\r\n }\r\n\r\n sm.portal.vm.custom.setCustomLocalizeKey(self.UpdateTemplateProperties);\r\n\r\n /*** PROPERTIES ***/\r\n\r\n /*** SECTION PROPERTIES ***/\r\n this.DataLoaded = ko.observable(false);\r\n this.DataLoading = ko.observable(false);\r\n this.DataContainer = ko.observable(\"ApplicationInformationContainer\");\r\n this.Touched = ko.observable(false);\r\n this.DataLoadErrorCount = ko.observable(0);\r\n this.isPersonalStatementValid = ko.observable(true);\r\n /*** SECTION PROPERTIES ***/\r\n\r\n sm.portal.vm.custom.callCustomization('UpdateApplicationInfoProperties', self);\r\n /*** SUBSECTION PROPERTIES ***/\r\n\r\n /*** SUBSECTION PROPERTIES ***/\r\n\r\n /*** COMPUTED PROPERTIES ***/\r\n this.AnythingPopulated = ko.computed(function () {\r\n\r\n if (!sm.portal.utility.isNullOrEmpty(this.HeardAboutInstituteFrom())) return true;\r\n if (!sm.portal.utility.isNullOrEmpty(this.InstituteRelationship())) return true;\r\n if (!sm.portal.utility.isNullOrEmpty(this.InstituteRelationshipName())) return true;\r\n if (!sm.portal.utility.isNullOrEmpty(this.InstituteRelationshipDescription())) return true;\r\n if (!sm.portal.utility.isNullOrEmpty(this.InstituteCoursesPreviouslyTaken())) return true;\r\n if (!sm.portal.utility.isNullOrEmpty(this.InterviewViaSkype())) return true;\r\n if (!sm.portal.utility.isNullOrEmpty(this.InterviewSkypeNameOrEmail())) return true;\r\n if (!sm.portal.utility.isNullOrEmpty(this.InterviewViaPhone())) return true;\r\n if (!sm.portal.utility.isNullOrEmpty(this.InterviewPhoneNumber())) return true;\r\n if (!sm.portal.utility.isNullOrEmpty(this.InterviewInPerson())) return true;\r\n if (!sm.portal.utility.isNullOrEmpty(this.PreferredCommunicationTypeID())) return true;\r\n if (!sm.portal.utility.isNullOrEmpty(this.PersonalStatement())) return true;\r\n\r\n var response = sm.portal.vm.custom.callCustomization('PopulateCustomAppInfoData', self);\r\n if (response != undefined) {\r\n return response;\r\n }\r\n\r\n return false;\r\n\r\n }, this);\r\n this.ShowInterviewSkypeNameOrEmail = ko.computed(function () {\r\n if (!this.InterviewViaSkype()) {\r\n this.InterviewSkypeNameOrEmail(null);\r\n };\r\n\r\n return this.InterviewViaSkype();\r\n }, this);\r\n this.ShowInterviewPhoneNumber = ko.computed(function () {\r\n if (!this.InterviewViaPhone()) {\r\n this.InterviewPhoneNumber(null);\r\n };\r\n\r\n return this.InterviewViaPhone();\r\n }, this);\r\n this.ShowInstituteRelationshipDetails = ko.computed(function () {\r\n if (!this.InstituteRelationship()) {\r\n this.InstituteRelationshipName(null);\r\n this.InstituteRelationshipDescription(null);\r\n };\r\n\r\n return this.InstituteRelationship();\r\n }, this);\r\n\r\n /*** COMPUTED PROPERTIES ***/\r\n\r\n /*** SECTION METHODS ***/\r\n this.LoadModel = function (container) {\r\n // update application section configurations\r\n if(container && container.Payload && container.Payload.Config){\r\n viewModel.SetSectionsConfigData(\"ApplicationInformation\", container.Payload.Config);\r\n var customData = {\r\n container : container, \r\n self: self\r\n };\r\n sm.portal.vm.custom.callCustomization('LoadAdditionalDataForAppInfo', customData);\r\n }\r\n\r\n if(container.Payload.ListData){\r\n this.CommunicationTypes = smapi.access.loadListItemModels(container.Payload.ListData.CommunicationTypes, this.CommunicationTypes);\r\n }\r\n if (container.Payload.ApplicationInformation != null) {\r\n this.HeardAboutInstituteFrom(container.Payload.ApplicationInformation.HeardAboutInstituteFrom);\r\n this.InstituteCoursesPreviouslyTaken(container.Payload.ApplicationInformation.InstituteCoursesPreviouslyTaken);\r\n this.InstituteRelationship(container.Payload.ApplicationInformation.InstituteRelationship);\r\n this.InstituteRelationshipName(container.Payload.ApplicationInformation.InstituteRelationshipName);\r\n this.InstituteRelationshipDescription(container.Payload.ApplicationInformation.InstituteRelationshipDescription);\r\n this.InterviewViaSkype(container.Payload.ApplicationInformation.InterviewViaSkype);\r\n this.InterviewSkypeNameOrEmail(container.Payload.ApplicationInformation.InterviewSkypeNameOrEmail);\r\n this.InterviewViaPhone(container.Payload.ApplicationInformation.InterviewViaPhone);\r\n this.InterviewPhoneNumber(container.Payload.ApplicationInformation.InterviewPhoneNumber);\r\n this.InterviewInPerson(container.Payload.ApplicationInformation.InterviewInPerson);\r\n this.PreferredCommunicationTypeID(container.Payload.ApplicationInformation.PreferredCommunicationTypeID);\r\n this.PersonalStatement(container.Payload.ApplicationInformation.PersonalStatement);\r\n }\r\n\r\n var customData = {\r\n container: container,\r\n self: self\r\n }\r\n sm.portal.vm.custom.callCustomization('PopulateHeardAboutInstituteFrom', customData);\r\n\r\n this.DataLoading(false);\r\n this.DataLoaded(true);\r\n if (smapi.constant.applicationDebugFlag) { console.log('[ApplicationInformationVM] Data Loaded'); }\r\n };\r\n this.GetModelData = function (blockui, applicationMID, personMID, callback) {\r\n \r\n if (!this.DataLoaded() && !this.DataLoading()) {\r\n\r\n this.DataLoading(true);\r\n if(!sm.portal.utility.isNullOrEmpty(viewModel.allCustomData())) {\r\n self.LoadModel(viewModel.allCustomData().ApplicationInformation);\r\n callback && callback(viewModel.allCustomData().ApplicationInformation);\r\n return;\r\n }\r\n if (blockui) { jQuery.blockUI(); }\r\n var url = _baseApiUri + sm.portal.utility.formatString('api/studentportal/getapplicationsection?sectionName=applicationinformation&attemptmid={0}', applicationMID);\r\n\r\n jQuery.ajax({\r\n url: url,\r\n type: 'GET',\r\n dataType: 'json',\r\n contentType: 'application/json; charset=utf-8',\r\n headers: {\r\n \"x-api-version\": '1' //,\r\n },\r\n processData: false,\r\n crossDomain: true,\r\n\r\n xhrFields: {\r\n withCredentials: true\r\n },\r\n success: function (data, textStatus, jqXHR) {\r\n sm.portal.page.application.modelDataResponseHandler(self, data, applicationMID, personMID);\r\n callback && callback(data);\r\n },\r\n error: function (jqXHR, exception) {\r\n sm.portal.page.application.modelErrorHandler(self, jqXHR);\r\n sm.portal.page.application.handleErrorWithMessages(self, jqXHR, 'fetch');\r\n callback && callback();\r\n }\r\n });\r\n } else {\r\n callback && callback();\r\n }\r\n };\r\n this.BlockContainer = function () {\r\n jQuery(\"#\" + self.DataContainer()).block({ message: sm.portal.utility.getResourceValue('Loading') });\r\n };\r\n this.UnBlockContainer = function () {\r\n jQuery(\"#\" + self.DataContainer()).unblock();\r\n viewModel.SetFocus();\r\n };\r\n this.ProcessOnServer = function () {\r\n return true;\r\n };\r\n this.ExtractATO = function () {\r\n var stdApplicationInformation = new smapi.admissions.AdmissionsAttemptUKAdditionalInfoModel({\r\n HeardAboutInstituteFrom: self.HeardAboutInstituteFrom(),\r\n InstituteCoursesPreviouslyTaken: self.InstituteCoursesPreviouslyTaken(),\r\n InstituteRelationship: self.InstituteRelationship(),\r\n InstituteRelationshipName: self.InstituteRelationshipName(),\r\n InstituteRelationshipDescription: self.InstituteRelationshipDescription(),\r\n InterviewViaSkype: self.InterviewViaSkype(),\r\n InterviewSkypeNameOrEmail: self.InterviewSkypeNameOrEmail(),\r\n InterviewViaPhone: self.InterviewViaPhone(),\r\n InterviewPhoneNumber: self.InterviewPhoneNumber(),\r\n InterviewInPerson: self.InterviewInPerson(),\r\n PreferredCommunicationTypeID: self.PreferredCommunicationTypeID()\r\n });\r\n var customData = {\r\n stdApplicationInformation: stdApplicationInformation,\r\n self: self\r\n }\r\n sm.portal.vm.custom.callCustomization('ExtractApplicationInfoATO', customData);\r\n\r\n var stdPersonalStatement = new smapi.admissions.AdmissionsAttemptUKPersonalStatementModel({\r\n PersonalStatement: self.PersonalStatement\r\n });\r\n return {\r\n ApplicationInformation: stdApplicationInformation,\r\n PersonalStatement: stdPersonalStatement\r\n };\r\n\r\n };\r\n /*** SECTION METHODS ***/\r\n\r\n /*** VALIDATION METHODS ***/\r\n sm.portal.vm.custom.callCustomization('OverrideAppInfoValidation', self);\r\n\r\n this.HeardAboutInstituteFrom.extend({\r\n maxLength: {\r\n params: 255,\r\n message: sm.portal.utility.formatString(sm.portal.utility.getResourceValue(smapi.constant.validate_0CharactersOrLess_Key), '255')\r\n }\r\n });\r\n this.InstituteCoursesPreviouslyTaken.extend({\r\n maxLength: {\r\n params: 1000,\r\n message: sm.portal.utility.formatString(sm.portal.utility.getResourceValue(smapi.constant.validate_0CharactersOrLess_Key), '1000')\r\n }\r\n });\r\n this.InstituteRelationshipName.extend({\r\n maxLength: {\r\n params: 60,\r\n message: sm.portal.utility.formatString(sm.portal.utility.getResourceValue(smapi.constant.validate_0CharactersOrLess_Key), '60')\r\n }\r\n });\r\n this.InstituteRelationshipDescription.extend({\r\n maxLength: {\r\n params: 255,\r\n message: sm.portal.utility.formatString(sm.portal.utility.getResourceValue(smapi.constant.validate_0CharactersOrLess_Key), '255')\r\n }\r\n });\r\n this.InterviewSkypeNameOrEmail.extend({\r\n maxLength: {\r\n params: 255,\r\n message: sm.portal.utility.formatString(sm.portal.utility.getResourceValue(smapi.constant.validate_0CharactersOrLess_Key), '255')\r\n }\r\n });\r\n this.InterviewPhoneNumber.extend({\r\n maxLength: {\r\n params: 20,\r\n message: sm.portal.utility.formatString(sm.portal.utility.getResourceValue(smapi.constant.validate_0CharactersOrLess_Key), '255')\r\n }\r\n });\r\n this.PreferredCommunicationTypeID.extend({\r\n min: {\r\n params: -9223372036854775808,\r\n message: sm.portal.utility.getResourceValue(smapi.constant.validate_MustBeNumeric_Key)\r\n },\r\n max: {\r\n params: 9223372036854775807,\r\n message: sm.portal.utility.getResourceValue(smapi.constant.validate_MustBeNumeric_Key)\r\n },\r\n number: {\r\n params: true,\r\n message: sm.portal.utility.getResourceValue(smapi.constant.validate_MustBeNumeric_Key)\r\n }\r\n });\r\n\r\n // this is to ensure maximum length is not greater than 4000 and every line break is counted as 2 characters \r\n this.checkLengthPersonal = function () {\r\n var totalLength = 4000;\r\n if (!sm.portal.utility.isNullOrEmpty(self.PersonalStatement())) {\r\n var textLength = self.PersonalStatement().length;\r\n var lineBreakCount = self.PersonalStatement().match(/(\\r\\n|\\n|\\r)/g) ? self.PersonalStatement().match(/(\\r\\n|\\n|\\r)/g).length : 0;\r\n var len = textLength + lineBreakCount;\r\n if (len <= totalLength)\r\n self.isPersonalStatementValid(true);\r\n else\r\n self.isPersonalStatementValid(false);\r\n }\r\n else\r\n self.isPersonalStatementValid(true);\r\n }\r\n\r\n // Set Model Grouping for validation\r\n this.ModelErrors = ko.validation.group(this);\r\n // Check if Model is valid \r\n // (will NOT validate attached models, unless we\r\n // init that in ui.js - currently it has performance problems)\r\n this.IsVMValid = function () {\r\n if (this.ModelErrors().length == 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n };\r\n \r\n this.Completed = ko.computed(function () {\r\n // No Required Fields\r\n var data ={\r\n AnythingPopulated : this.AnythingPopulated(),\r\n Touched : this.Touched()\r\n }\r\n var isCompletedCustom = this.IsVMValid() && sm.portal.vm.custom.callCustomization('CompletedCustom', data);\r\n if(!sm.portal.utility.isNullOrEmpty(isCompletedCustom)){\r\n return isCompletedCustom;\r\n }\r\n var isCompleted = this.IsVMValid() && (this.AnythingPopulated() || this.Touched());\r\n return isCompleted;\r\n\r\n }, this);\r\n /*** VALIDATION METHODS ***/\r\n\r\n return self;\r\n };\r\n\r\n jQuery.extend(true, sm.portal.vm, {\r\n ApplicationInformationViewModel: ApplicationInformationViewModel\r\n });\r\n\r\n})(jQuery);"]}