PageSourceSearch

https://www.sentaracareers.com/wp-content/plugins/xcloud/dist/global-files.js?ver=0.95-309

js sentaracareers.com collected 2026-10-05 00:57:27 UTC 84,642 bytes, 1,597 lines download raw bytes

1
2// Custom configuration items on a per system basis: local, cert, prod
3//Client details
4var clientName = _XC_CONFIG && _XC_CONFIG.org ? _XC_CONFIG.org : 'choc';
5// var maxSessionStorageTime = 2 * 60 * 1000; // 2 minutes;
6var maxSessionStorageTime = 20 * 60 * 1000; // 20 minutes;
7var maxFileSizeforResume = 2048000;
8// The default options for the ckEditor to be used for any site.
9var ckEditorOptions = {};
10var ATS_INSTANCE = '/ats-v2';
11var ATSREPORTING_INSTANCE = "/atsreporting";
12var DEBUG = _XC_CONFIG && _XC_CONFIG.env !== "prod";
13var ATS_URL = "https://atscore.app.smashfly.io";
14var PAGE_TEMPLATES = {
15    'thank_you': '/wp-content/plugins/xcloud/app/components/apply/thank-you.html'
16};
17var DASHBOARD_TABS = ['activity', 'edit', 'applications'];
18
19var CUSTOM_FIELD_MANAGEMENT_SETTINGS = {
20    stream             : {
21        apply      : {
22            enabled     : false,
23            controller  : 'applyController',
24            templateFlag: 'apply'
25        },
26        leadCapture: {
27            enabled     : false,
28            controller  : 'applyController',
29            templateFlag: 'join'
30        }
31    },
32    navigation         : {
33        url   : "",
34        params: {}
35    },
36    resumeDataParseRule: {
37        includeMandatoryFieldCheck: false
38    }
39};
40
41var DYNAMIC_PAGE_SETTINGS = {
42    RESET_PASSWORD_TEMPLATE_FLAG: 'reset'
43};
44
45var WCAG_COMPLIANCE_SETTINGS;
46
47var EMAIL_PASSWORD_RESET_NAME = 'Password Reset';
48var EMAIL_PASSWORD_RESET_TYPE = 'System';
49var EMAIL_ACTIVATION_LINK_NAME = 'Activation Link';
50var EMAIL_ACTIVATION_LINK_TYPE = 'System';
51var ACTIVE_LANGUAGE_CODE_ID = 1;
52var LANGUAGE_COLLECTION = [];
53var CALENDAR_SCHEDULING_API_URL = 'https://fpndu7ifx1.execute-api.us-east-1.amazonaws.com/api/v1';
54
55if(_XC_CONFIG) {
56    if (_XC_CONFIG.env === 'stg') {
57        ATS_URL = "https://pub-cert-atscore.app.smashfly.io";
58        CALENDAR_SCHEDULING_API_URL = "https://3vvmvpb589.execute-api.us-east-1.amazonaws.com/api/v1";
59    }
60    else if (_XC_CONFIG.env === 'dev') {
61        ATS_URL = "https://pub-dev-atscore.app.smashfly.io"
62        CALENDAR_SCHEDULING_API_URL = "https://ua9b8w3qa5.execute-api.us-east-1.amazonaws.com/api/v1";
63    }
64    else if(_XC_CONFIG.env === 'stage'){
65        ATS_URL = "https://pub-stage-atscore.app.smashfly.io";
66        CALENDAR_SCHEDULING_API_URL = "https://knjfsepqfk.execute-api.us-east-1.amazonaws.com/api/v1";
67    }
68    else if(_XC_CONFIG.env === 'perf'){
69        ATS_URL = "https://pub-perf-atscore.app.smashfly.io";
70        CALENDAR_SCHEDULING_API_URL = "https://knjfsepqfk.execute-api.us-east-1.amazonaws.com/api/v1";
71    }
72
73    //Get Session Time out from settings
74    if (!isNaN(parseInt(_XC_CONFIG.session_time_out))){
75        maxSessionStorageTime = parseInt(_XC_CONFIG.session_time_out) * 60 * 1000;
76    }
77
78    WCAG_COMPLIANCE_SETTINGS = (_XC_CONFIG.wCAGCompliance);
79    CUSTOM_FIELD_MANAGEMENT_SETTINGS.stream.apply.enabled = (_XC_CONFIG.custom_field_management.stream.apply.enabled === 'true');
80    CUSTOM_FIELD_MANAGEMENT_SETTINGS.stream.leadCapture.enabled = (_XC_CONFIG.custom_field_management.stream.leadCapture.enabled === 'true');
81    if(CUSTOM_FIELD_MANAGEMENT_SETTINGS.stream.apply.enabled) CUSTOM_FIELD_MANAGEMENT_SETTINGS.stream.apply.controller = 'candidatePoolController';
82    if(CUSTOM_FIELD_MANAGEMENT_SETTINGS.stream.leadCapture.enabled) CUSTOM_FIELD_MANAGEMENT_SETTINGS.stream.leadCapture.controller = 'candidatePoolController';
83    
84    (function() {
85        // Didn't want to add this var to a global level so I'm putting it in a self-calling function
86        var content_proxy = '/?xccp=';
87        if (_XC_CONFIG.lang && _XC_CONFIG.lang !== 'en') {
88            content_proxy = '/' + _XC_CONFIG.lang + content_proxy;
89        }
90
91        PAGE_TEMPLATES['apply'] = _XC_CONFIG.pages['apply'] ? content_proxy + _XC_CONFIG.pages['apply'] : '';
92        PAGE_TEMPLATES['profile'] = _XC_CONFIG.pages['profile'] ? content_proxy + _XC_CONFIG.pages['profile'] : '';
93        PAGE_TEMPLATES['join'] = _XC_CONFIG.pages['join'] ? content_proxy + _XC_CONFIG.pages['join'] : '';
94        PAGE_TEMPLATES['reset'] = _XC_CONFIG.pages['reset'] ? content_proxy + _XC_CONFIG.pages['reset'] : '';
95        PAGE_TEMPLATES['forgot'] = _XC_CONFIG.pages['forgot'] ? content_proxy + _XC_CONFIG.pages['forgot'] : '';
96        PAGE_TEMPLATES['login'] = _XC_CONFIG.pages['login'] ? content_proxy + _XC_CONFIG.pages['login'] : '';
97        PAGE_TEMPLATES['thank_you'] = _XC_CONFIG.pages['thank_you'] ? content_proxy + _XC_CONFIG.pages['thank_you'] : '';
98        PAGE_TEMPLATES['thank_you_apply'] = _XC_CONFIG.pages['thank_you_apply'] ? content_proxy + _XC_CONFIG.pages['thank_you_apply'] : '';
99        PAGE_TEMPLATES['apply_join'] = _XC_CONFIG.pages['apply_join'] ? content_proxy + _XC_CONFIG.pages['apply_join'] : '';
100        PAGE_TEMPLATES['job_alert'] = _XC_CONFIG.pages['job_alert'] ? content_proxy + _XC_CONFIG.pages['job_alert'] : '';
101        PAGE_TEMPLATES['alert_thank_you'] = _XC_CONFIG.pages['alert_thank_you'] ? content_proxy + _XC_CONFIG.pages['alert_thank_you'] : '';
102        PAGE_TEMPLATES['assessment_apply'] = _XC_CONFIG.pages['assessment_apply'] ? content_proxy + _XC_CONFIG.pages['assessment_apply'] : '';
103        PAGE_TEMPLATES['microsite'] = '/wp-content/plugins/xcloud/app/apply/apply.html';
104        PAGE_TEMPLATES['optin_confirmation'] = '/wp-content/plugins/xcloud/app/components/optin_confirmation/optin-confirmation.html';
105        PAGE_TEMPLATES['cognito_callback'] = '/wp-content/plugins/xcloud/app/components/cognito_callback/cognito-callback.html';
106        PAGE_TEMPLATES['slot_booking'] = '/wp-content/plugins/xcloud/app/components/slot_booking/slot-booking.html';
107        PAGE_TEMPLATES['unsubscribe'] = _XC_CONFIG.pages['unsubscribe'] ? content_proxy + _XC_CONFIG.pages['unsubscribe'] : '';
108        PAGE_TEMPLATES['auth0_authentication'] = _XC_CONFIG.pages['auth0_authentication'] ? content_proxy + _XC_CONFIG.pages['auth0_authentication'] : '';
109        if(CUSTOM_FIELD_MANAGEMENT_SETTINGS.stream.leadCapture.enabled){
110            PAGE_TEMPLATES['microsite'] = '/wp-content/plugins/xcloud/app/components/candidate_pool/candidate-pool.html';
111        }
112    })();
113
114    DASHBOARD_TABS = _XC_CONFIG.tabs;
115    DYNAMIC_PAGE_SETTINGS.RESET_PASSWORD_TEMPLATE_FLAG =  (_XC_CONFIG.login_modal.disabled === false) ? 'profile' : DYNAMIC_PAGE_SETTINGS.RESET_PASSWORD_TEMPLATE_FLAG;
116}
117
118var JOBSAPI_ORG = 1806;
119if(cws_opts && cws_opts.org){
120    JOBSAPI_ORG = cws_opts.org;
121}
122
123// Reverse this for multilingual
124if( _XC_CONFIG && !_XC_CONFIG.context ){
125    _XC_CONFIG.context = {};
126    _XC_CONFIG.context.continue = 'Save and Continue';
127    _XC_CONFIG.context.submit = 'Submit Application';
128}
129
130if( typeof _SFXR_CONFIG !== 'undefined') {
131    EMAIL_PASSWORD_RESET_NAME = 'Password Reset Referrals';
132    EMAIL_ACTIVATION_LINK_NAME = 'Referee Activation Link';
133}
134
135var ATSREPORTING_URL = "https://cert-data.hrapply.com";
136var LEGACY_URL = "https://cert.hrapply.com/" + clientName;
137
138var APPLY_STREAMS = {
139    lcp      : _XC_CONFIG && _XC_CONFIG.streams.lcp ? _XC_CONFIG.streams.lcp : 35,
140    lcp_short: _XC_CONFIG && _XC_CONFIG.streams.lcp_short ? _XC_CONFIG.streams.lcp_short : 35
141};
142
143// Client specific Java Script.  Mainly used to define clientName.
144var clientName = clientName;
145var ATS_INSTANCE = ATS_INSTANCE;
146var ATSREPORTING_INSTANCE = ATSREPORTING_INSTANCE;
147
148var maxLocalStorageTime = maxLocalStorageTime; // One Day = 24 hours * 60 minutes * 60 seconds * 1000 milliseconds.
149var maxSessionStorageTime = maxSessionStorageTime; // 30 minutes;
150
151// The default options for the ckEditor to be used for any site.
152var ckEditorOptions = ckEditorOptions;
153// Common Options:
154// uiColor: "#00A0CC"
155// skin: 'kama' - installed values: moono, moonocolor, moono-dark (doesn't work iwth uiColor), kama, office2013
156
157'use strict';
158
159// Global Variables & Functions
160
161var GLOBAL_TIMEOUT = 1000;
162var ROOT_SCOPE = null;
163
164var MODULE_NAME_UTILS = "st.utils";
165var MODULE_NAME_UTILS_ARRAY = "st.utils.ArrayUtil";
166var MODULE_NAME_UTILS_LIST = "st.utils.ListService";
167var MODULE_NAME_UTILS_LOCAL_STORAGE = "st.utils.LocalStorage";
168var MODULE_NAME_UTILS_META = "st.utils.MetaService";
169var MODULE_NAME_UTILS_OPTIONS = "st.utils.OptionsService";
170var MODULE_NAME_UTILS_SESSION = "st.utils.SessionStorage";
171var MODULE_NAME_UTILS_TABLE = "st.utils.TableService";
172var MODULE_NAME_UTILS_PAGE = "st.utils.PageService";
173var MODULE_NAME_UTILS_GLOBAL_STATE = "st.model.dependency.ModelDependencyFactory";
174
175var MODULE_NAME_USER_AUTH = "st.user.auth.Auth";
176var MODULE_NAME_USER_AUTH_BUFFER = "st.user.auth.AuthBuffer";
177
178var MODULE_NAME_SERVICES = "st.services";
179var MODULE_NAME_SERVICES_AI = "st.services.AIService";
180var MODULE_NAME_SERVICES_APPLICATION = "st.services.ApplicationService";
181var MODULE_NAME_SERVICES_HIERARCHY = "st.services.HierarchyService";
182var MODULE_NAME_SERVICES_PEOPLE = "st.services.PeopleService";
183var MODULE_NAME_SERVICES_REQUISITION = "st.services.RequisitionService";
184var MODULE_NAME_SERVICES_USER = "st.services.UserService";
185var MODULE_NAME_SERVICES_DATA_SOURCE = "st.services.DataSourceService";
186var MODULE_NAME_SERVICES_CHECKIN = "st.services.CheckinService";
187
188
189var MODULE_NAME_CONTROLLERS_USER_SITE = "st.controllers.user.site";
190var MODULE_NAME_CONTROLLERS_USER_SITE_BASE = "st.controllers.user.site.BaseController";
191var MODULE_NAME_CONTROLLERS_USER_SITE_MAIN = "st.controllers.user.site.MainController";
192var MODULE_NAME_CONTROLLERS_USER_SITE_DASHBOARD = "st.controllers.user.site.DashboardController";
193var MODULE_NAME_CONTROLLERS_USER_SITE_LOGIN = "st.controllers.user.site.LoginController";
194
195var MODULE_NAME_CONTROLLERS_USER_SITE_ANALYTICS = "st.controllers.user.site.AnalyticsController";
196var MODULE_NAME_CONTROLLERS_USER_SITE_MANAGE_JOBS = "st.controllers.user.site.ManageJobsController";
197var MODULE_NAME_CONTROLLERS_USER_SITE_REQUISITION_SCREEN = "st.controllers.user.site.RequisitionScreen";
198var MODULE_NAME_CONTROLLERS_USER_SITE_APPLICATION_VIEW = "st.controllers.user.site.ApplicationViewController";
199var MODULE_NAME_CONTROLLERS_USER_SITE_REQUISITION_PROFILE = "st.controllers.user.site.RequisitionProfileController";
200var MODULE_NAME_CONTROLLERS_USER_SITE_REQUISITION_EDIT = "st.controllers.user.site.RequisitionEditController";
201var MODULE_NAME_CONTROLLERS_USER_SITE_SEARCH_APPLICATIONS = "st.controllers.user.site.SearchApplicationsController";
202var MODULE_NAME_CONTROLLERS_USER_SITE_ADD_CANDIDATE = "st.controllers.user.site.AddCandidateController";
203
204var MODULE_NAME_CONTROLLERS_USER_SITE_TEMPLATES_EDIT = "st.controllers.user.site.TemplatesEditController";
205
206var MODULE_NAME_APPLY_AUTH = 'st.candidate.auth.AuthService';
207
208var MODULE_NAME_CONTROLLERS_APPLY_SITE_BASE = "st.controllers.apply.site.BaseController";
209var MODULE_NAME_CONTROLLERS_APPLY_SITE_MAIN = "st.controllers.apply.site.MainController";
210var MODULE_NAME_CONTROLLERS_APPLY_SITE_APPLY = "st.controllers.apply.site.applyController";
211var MODULE_NAME_CONTROLLERS_APPLY_SITE_LOGIN = "st.controllers.apply.site.LoginController";
212var MODULE_NAME_CONTROLLERS_APPLY_SITE_AUTH0_LOGIN = "st.controllers.apply.site.auth0AuthenticationController";
213var MODULE_NAME_CONTROLLERS_APPLY_SITE_SEARCH = "st.controllers.apply.site.SearchController";
214var MODULE_NAME_CONTROLLERS_APPLY_SITE_SCREENING_QUESTIONS = "st.controllers.apply.site.ScreeningQuestionsController";
215var MODULE_NAME_CONTROLLERS_APPLY_SITE_SCREEN_QUESTION = "st.controllers.apply.site.QuestionController";
216var MODULE_NAME_CONTROLLERS_APPLY_SITE_ACCOUNT = "st.controllers.apply.site.AccountController";
217var MODULE_NAME_CONTROLLERS_APPLY_SITE_CANDIDATE_ACTIVITY = "st.controllers.apply.site.candidateActivityController";
218var MODULE_NAME_CONTROLLERS_APPLY_SITE_SCHEMA = "st.controllers.apply.site.candidateSchemaFormController";
219var MODULE_NAME_CONTROLLERS_APPLY_SITE_ACCOUNT_NAV = "st.controllers.apply.site.NavigationController";
220var MODULE_NAME_CONTROLLERS_APPLY_SITE_CONFIRMATION = "st.controllers.apply.site.confirmationController";
221var MODULE_NAME_CONTROLLERS_APPLY_SITE_SLOT_BOOKING = "st.controllers.apply.site.slotBookingController";
222
223var MODULE_NAME_CONTROLLERS_DASHBOARD_ATTACHMENT_ACCOUNT = "st.candidate.activity.dashboardAttachmentController";
224
225var MODULE_NAME_CONTROLLERS_APPLY_SITE_APPLY_FLOW = "st.controllers.apply.site.ApplyFlow";
226var MODULE_NAME_CONTROLLERS_APPLY_SITE_APPLY_FLOW_FORMS = "st.controllers.apply.site.ApplyFlowForms";
227var MODULE_NAME_CONTROLLERS_APPLY_SITE_APPLY_FLOW_FORM = "st.controllers.apply.site.ApplyFlowForms";
228var MODULE_NAME_CONTROLLERS_APPLY_SITE_APPLY_FLOW_CONTAINERS = "st.controllers.apply.site.ApplyFlowContainers";
229
230
231var MODULE_NAME_CONTROLLERS_APPLY_SITE_APPLY_FLOW_FORMS_PERSONAL_INFO = "st.controllers.apply.site.personalInformationFormController";
232var MODULE_NAME_CONTROLLERS_APPLY_SITE_APPLY_FLOW_FORMS_LEAD_CAPTURE = "st.controllers.apply.site.leadCaptureFormController";
233var MODULE_NAME_CONTROLLERS_APPLY_SITE_APPLY_FLOW_FORMS_WORK_HISTORY = "st.controllers.apply.site.workHistoryFormController";
234var MODULE_NAME_CONTROLLERS_APPLY_SITE_APPLY_FLOW_FORMS_EDUCATION = "st.controllers.apply.site.educationHistoryFormController";
235var MODULE_NAME_CONTROLLERS_APPLY_SITE_APPLY_FLOW_FORMS_EEO = "st.controllers.apply.site.eeoFormController";
236
237var loginStatus = {loginFailed: false, loginAttempted: false};
238
239
240function isPromise(deferred) {
241
242    if (angular.isObject(deferred) &&
243        angular.isObject(deferred.promise) &&
244        deferred.promise.then instanceof Function &&
245        deferred.promise["catch"] instanceof Function &&
246        deferred.promise["finally"] instanceof Function) {
247        //This is a simple Promise
248        return true;
249    }
250    return false;
251}
252
253function toggleDebug(rootScope, routeParam) {
254
255    if (ROOT_SCOPE === null) {
256        ROOT_SCOPE = rootScope;
257    }
258
259    if (routeParam.debug !== undefined) {
260        if (routeParam.debug === 'true') {
261            rootScope.debugOption = '?debug=true';
262            rootScope.showDebug = true;
263            DEBUG = true;
264        } else {
265            rootScope.debugOption = '';
266            rootScope.showDebug = false;
267            DEBUG = false;
268        }
269    } else {
270        rootScope.debugOption = '';
271        rootScope.showDebug = false;
272        DEBUG = false;
273    }
274}
275
276function normalizeObjects(dirty) {
277    return angular.fromJson(angular.toJson(dirty));
278}
279
280function reOrderFiltered(filter, grouping, orderColumn) {
281    var reOrders = filter('orderBy')(grouping, orderColumn);
282    var index = 0;
283    for (var key in reOrders) {
284        reOrders[key][orderColumn] = index++;
285    }
286}
287
288function reOrder(list, orderColumn) {
289    var index = 1;
290    for (var key in list) {
291        list[key][orderColumn] = index++;
292    }
293}
294
295function selectAllByName(textName) {
296    var textElement = document.getElementById(textName);
297    selectAll(textElement);
298}
299
300function selectAll(text) {
301    text.select();
302}
303
304function findLabelByValue(list, value) {
305    for (var key in list) {
306        if (list[key].value === value) {
307            return list[key].label;
308        }
309    }
310    return '';
311}
312
313function findActionByValue(list, value) {
314    for (var key in list) {
315        if (list[key].value === value) {
316            return list[key].action;
317        }
318    }
319    return '';
320}
321
322function findObjectById(list, id) {
323    for (var key in list) {
324        if (list[key].id === id) {
325            return list[key];
326        }
327    }
328    return null;
329}
330
331function findObjectByField(list, field, value) {
332    for (var key in list) {
333        if (list[key][field] === value) {
334            return list[key];
335        }
336    }
337    return null;
338}
339
340function length(field) {
341    if (field === undefined) {
342        return 0;
343    }
344    return field.length;
345
346}
347
348
349// Date time functions
350function formatDateTime(milliseconds) { // 01/01/2015 1:30 PM
351
352    var formatted = '';
353    var offset = 0; // new Date().getTimezoneOffset();
354
355    if (milliseconds !== null) {
356        var date = new Date(milliseconds - (offset * 60 * 1000));
357        var day = date.getDate();
358        var month = date.getMonth() + 1;
359        var year = date.getFullYear();
360        var hour24 = date.getHours();
361        var minutes = date.getMinutes();
362        var seconds = date.getSeconds();
363        var hour = (hour24 > 12 ? hour24 - 12 : hour24);
364        var ampm = (hour24 < 12 ? ' AM' : ' PM');
365        if (hour === 0)
366            hour = 12;
367        return (month < 10 ? '0' : '') + month + '/' + (day < 10 ? '0' : '') + day + '/' + year + ' ' +
368            hour + ':' + (minutes < 10 ? '0' : '') + minutes + ':' + (seconds < 10 ? '0' : '') + seconds + ampm;
369    }
370
371    return formatted;
372}
373
374function formatDate(milliseconds) {
375
376    var formatted = '';
377    var offset = 0;  // new Date().getTimezoneOffset();
378
379    if (milliseconds !== null) {
380        var date = new Date(milliseconds - (offset * 60 * 1000));
381        var day = date.getDate();
382        var month = date.getMonth() + 1;
383        var year = date.getFullYear();
384        return (month < 10 ? '0' : '') + month + '/' + (day < 10 ? '0' : '') + day + '/' + year;
385    }
386    return formatted;
387}
388
389function formatTime(milliseconds) { // 01/01/2015 1:30 PM
390
391    var formatted = '';
392    var offset = 0; // new Date().getTimezoneOffset();
393
394    if (milliseconds !== null) {
395        var date = new Date(milliseconds - (offset * 60 * 1000));
396        var day = date.getDate();
397        var month = date.getMonth() + 1;
398        var year = date.getFullYear();
399        var hour24 = date.getHours();
400        var minutes = date.getMinutes();
401        var seconds = date.getSeconds();
402        var hour = (hour24 > 12 ? hour24 - 12 : hour24);
403        var ampm = (hour24 < 12 ? ' AM' : ' PM');
404        if (hour === 0)
405            hour = 12;
406        return hour + ':' + (minutes < 10 ? '0' : '') + minutes + ':' + (seconds < 10 ? '0' : '') + seconds + ampm;
407    }
408
409    return formatted;
410}
411
412
413// Uses JQuery and a modal dialog with the id: errorModal
414function handleError(reason, errorMsg) {
415    if (DEBUG) {
416        // console.log(errorMsg);
417    }
418
419    if (ROOT_SCOPE !== null) {
420        var atsMessage = null;
421
422        if (reason !== undefined && reason !== null) {
423            if (reason.data !== undefined && reason.data.message !== undefined) {
424                atsMessage = reason.data.message;
425            }
426        }
427
428        ROOT_SCOPE.errorMessage = errorMsg;
429        ROOT_SCOPE.atsMessage = (atsMessage === null ? "" : atsMessage);
430        $('#errorModal').modal({backdrop: 'static', keyboard: false, show: true});
431    }
432}
433
434function hasSuccess(message) {
435
436    if (DEBUG) {
437        // console.log('Success: ' + message);
438    }
439
440    if (ROOT_SCOPE !== null) {
441        ROOT_SCOPE.hasSuccess = true;
442        ROOT_SCOPE.successMessage = message;
443    }
444}
445
446function clearSuccess() {
447
448    if (DEBUG) {
449        // console.log('Clearning Success.');
450    }
451
452    if (ROOT_SCOPE !== null) {
453        ROOT_SCOPE.hasSuccess = false;
454    }
455}
456
457
458// Uses hasError t/f toggle to allow ng-show to determine
459// the error display method
460function hasError(reason, errorMsg) {
461    if (ROOT_SCOPE !== null) {
462        var atsMessage = null;
463        var atsDetail = null;
464
465        if (reason !== undefined && reason !== null) {
466            if (reason.data !== undefined && reason.data !== null) {
467                if (reason.data.message !== undefined && reason.data.message !== null) {
468                    atsMessage = reason.data.message;
469                }
470                if (reason.data.detail !== undefined && reason.data.detail !== null) {
471                    atsDetail = reason.data.detail;
472                }
473
474                if (DEBUG) {
475                    // console.log(errorMsg + ' AtsMessage: ' + (atsMessage === null ? "" : atsMessage) + '\n - Detail: ' + (atsDetail === null ? "" : atsDetail));
476                }
477            }
478        } else {
479            if (DEBUG) {
480                // console.log(errorMsg);
481            }
482        }
483
484        ROOT_SCOPE.errorMessage = errorMsg;
485        ROOT_SCOPE.atsMessage = (atsMessage === null ? "" : atsMessage);
486        ROOT_SCOPE.atsDetail = (atsDetail === null ? "" : atsDetail);
487        ROOT_SCOPE.hasError = true;
488    }
489}
490
491function htmlDecode(input) {
492    if (input === undefined || input === null) {
493        input = "&nbsp;";
494    }
495    var element = document.createElement('div');
496    element.innerHTML = input;
497    return element.childNodes[0].nodeValue;
498}
499
500function singleSignOn(navigateTo, currentUser) {
501    var form = document.createElement("form");
502    form.setAttribute("method", 'POST');
503    form.setAttribute("action", LEGACY_URL + '/Login.ats');
504
505    var hiddenField = document.createElement("input");
506    hiddenField.setAttribute("type", "hidden");
507    hiddenField.setAttribute("name", 'uname');
508    hiddenField.setAttribute("value", currentUser.username);
509    form.appendChild(hiddenField);
510
511    hiddenField = document.createElement("input");
512    hiddenField.setAttribute("type", "hidden");
513    hiddenField.setAttribute("name", 'password');
514    hiddenField.setAttribute("value", currentUser.password);
515    form.appendChild(hiddenField);
516
517    hiddenField = document.createElement("input");
518    hiddenField.setAttribute("type", "hidden");
519    hiddenField.setAttribute("name", 'errPage');
520    hiddenField.setAttribute("value", 'Setup.ats');
521    form.appendChild(hiddenField);
522
523    hiddenField = document.createElement("input");
524    hiddenField.setAttribute("type", "hidden");
525    hiddenField.setAttribute("name", 'nextPage');
526    hiddenField.setAttribute("value", navigateTo);
527    form.appendChild(hiddenField);
528
529    document.body.appendChild(form);
530    form.submit();
531}
532
533function lowerCaseFirst(string) {
534    if (string === undefined) {
535        return string;
536    }
537
538    // Lower the first letter always
539    var result = string.charAt(0).toLowerCase();
540    var lastPart = string.slice(1);
541
542    // if the next value is lowercase, we're done
543    if (lastPart.charAt(0) !== lastPart.charAt(0).toLowerCase()) {
544
545        for (var key = 0; key < lastPart.length; key++) {
546            if (lastPart[key] === lastPart[key].toUpperCase()) {
547                var nextKey = key + 1;
548                if (lastPart.charAt(nextKey) !== undefined && lastPart.charAt(nextKey) !== lastPart.charAt(nextKey).toLowerCase()) {
549                    lastPart = lastPart.charAt(key).toLowerCase() + lastPart.slice(key + 1);
550                } else {
551                    break;
552                }
553            } else {
554                break;
555            }
556        }
557    }
558
559    return result + lastPart;
560}
561
562function upperCaseFirst(string) {
563    if (string === undefined) {
564        return string;
565    }
566
567    var result = string.charAt(0).toUpperCase();
568    var lastPart = string.slice(1);
569
570    return result + lastPart;
571}
572
573function normalizeFieldName(fieldName) {
574
575    var normalized = '';
576
577    for (var x = 0; x < fieldName.length; x++) {
578        if (fieldName.charAt(x) === fieldName.charAt(x).toUpperCase() && isChar(fieldName.charAt(x))) {
579            normalized = normalized + ' ';
580        }
581        normalized = normalized + fieldName.charAt(x);
582    }
583
584    return upperCaseFirst(normalized);
585}
586
587function isChar(str) {
588    return /^[a-zA-Z]+$/.test(str);
589}
590
591// cleans a json objec of its unknown paramters (ie, extra labels)
592// scrub - the object to scrub
593// name - the ATS Core name of the object
594// metadata - a reference to the metadata angular.service
595function scrubObject(scrub, name, metadata) {
596
597    if (scrub === null || scrub === undefined ||
598        name === null || name === undefined ||
599        metadata === null || metadata === undefined) {
600
601        if (DEBUG) {
602            // console.log("scrubObject called with null/undefined parameters!");
603        }
604        return;
605    }
606
607    metadata.getTableMetadata({table: name}).$promise.then(function (result) {
608
609        var tableData = normalizeObjects(result);
610
611        for (var field in scrub) {
612            var found = false;
613
614            for (var key in tableData) {
615                if (field === tableData[key].fieldName) {
616                    found = true;
617                    break;
618                }
619            }
620
621            if (!found) {
622                delete scrub[field];
623                if (DEBUG) {
624                    // console.log("Scrub - Deleted field: " + field);
625                }
626            }
627        }
628
629    }, function (reason) {
630        handleError(reason, "Unable to scrub object: " + name);
631    });
632}
633
634/* Taken from: http://www.movable-type.co.uk/scripts/latlong.html
635 *
636 * This uses the ‘haversine’ formula to calculate the great-circle distance between
637 * two points – that is, the shortest distance over the earth’s surface – giving an
638 * ‘as-the-crow-flies’ distance between the points (ignoring any hills they fly
639 * over, of course!).
640 *
641 * Haversine
642 * formula:	a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)
643 * c = 2 ⋅ atan2( √a, √(1−a) )
644 * d = R ⋅ c
645 * where φ is latitude, λ is longitude, R is earth’s radius (mean radius = 6,371km);
646 * note that angles need to be in radians to pass to trig functions!
647 *
648 */
649var METERS_PER_MILE = 1609.34;
650
651function Location(latitude, longitude) {
652    this.latitude = Number(latitude);
653    this.longitude = Number(longitude);
654}
655
656function calculateDistance(locationA, locationB) {
657
658    if (!(locationA instanceof Location) || !(locationB instanceof Location)) {
659        return -1;
660    }
661
662    var R = 6371e3; // metres
663
664    var φ1 = locationA.latitude * Math.PI / 180;
665    var φ2 = locationB.latitude * Math.PI / 180;
666
667    var Δφ = (locationB.latitude - locationA.latitude) * Math.PI / 180;
668    var Δλ = (locationB.longitude - locationA.longitude) * Math.PI / 180;
669
670    var a = Math.sin(Δφ / 2) * Math.sin(Δφ / 2) +
671        Math.cos(φ1) * Math.cos(φ2) *
672        Math.sin(Δλ / 2) * Math.sin(Δλ / 2);
673
674    var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
675
676    var d = R * c;
677
678    return Number(d / METERS_PER_MILE).toFixed(2);
679}
680
681function isValidJSObject(objectToValidate) {
682    return objectToValidate !== undefined && objectToValidate !== null;
683}
684
685function triggerScroll(elementIdentity,selectorPrefix) {
686    try {
687        var selector = '#';
688        if (selectorPrefix !== undefined) {
689            selector = selectorPrefix;
690        }
691        selector = selector + elementIdentity;
692        var selectorElement = jQuery(selector);
693        var scrollPX = XCLOUD.apply_filter('thank_you_section_scroll', selectorElement.offset().top + 'px');
694        $('html, body').animate({
695            scrollTop: scrollPX
696        }, 'fast');
697
698    }catch (reason){
699
700    }
701}
702
703function setFocus(elementIdentity,selectOnFocus,selectorPrefix,elementPositionIndex){
704    try {
705
706        var selector = '#';
707        if (selectorPrefix !== undefined) {
708            selector = selectorPrefix;
709        }
710        selector = selector + elementIdentity;
711
712        var selectorElement = jQuery(selector);
713        if (elementPositionIndex !== undefined && isNaN(elementPositionIndex) === false) {
714            selectorElement = selectorElement[elementPositionIndex];
715        }
716
717        if(selectorElement.focus !== undefined) {
718            selectorElement.focus();
719            if (selectOnFocus !== undefined && selectOnFocus === true) {
720                selectorElement.select();
721            }
722        }
723    }catch (reason){
724
725    }
726}
727
728// sync between cookie and DB to persist favorite locations
729function getHost() {
730    var ATS_URL = "https://atscore.app.smashfly.io";
731    var ATS_INSTANCE = '/ats-v2';
732    if (_XC_CONFIG) {
733        if (_XC_CONFIG.env === 'stg') {
734            ATS_URL = "https://pub-cert-atscore.app.smashfly.io";
735        }
736        else if (_XC_CONFIG.env === 'dev') {
737            ATS_URL = "https://pub-dev-atscore.app.smashfly.io";
738        }
739        else if(_XC_CONFIG.env === 'perf'){
740            ATS_URL = "https://pub-perf-atscore.app.smashfly.io";
741        }
742    }
743    return ATS_URL + ATS_INSTANCE;
744}
745
746function getFavoriteLocationsInCookie() {
747    //returns the array of favorite location objects from cookie
748    var name = 'location_favorite';
749    var cookieData = document.cookie;
750    var ca = cookieData.split(';');
751    for(var i = 0; i <ca.length; i++) {
752        var c = ca[i];
753        while (c.charAt(0) === ' ') {
754            c = c.substring(1);
755        }
756        if (c.indexOf(name) === 0) {
757            var x =c.substring(name.length+1, c.length);
758            return JSON.parse(x);
759        }
760    }
761    return [];
762}
763
764function findIfItsThere(cookieEntry) {
765    try{
766        var returnValue = {"Exists": false, "Data":[]};
767        var filteredEntry = dbData.filter(function (value) {
768            return JSON.parse(value.filters).id === JSON.parse(cookieEntry.filters).id;
769        });
770        if(filteredEntry.length > 0){
771            returnValue.Exists = true;
772            if(filteredEntry[0].active === 1 || filteredEntry[0].active === "1"){
773                // exists and active, block add call
774                return returnValue;
775            }else{
776                // exists but not active, update the entry,
777                returnValue.Data = filteredEntry;
778                return returnValue;
779            }
780        }else{
781            return returnValue;
782        }
783    }catch (e) {
784        console.log(e);
785    }
786}
787
788var dbData = [];
789function syncFavoriteLocations() {
790    try{
791        var cookieData = getFavoriteLocationsInCookie();
792        if(cookieData.length > 0){
793            if (localStorage.getItem('xcloud.credentials') !== null) {
794                var credentials = JSON.parse(atob(JSON.parse(localStorage.getItem('xcloud.credentials')).data));
795                var host = getHost();
796                var token = 'Basic ' + btoa('candidate/' + _XC_CONFIG.org + '/' + credentials.username + ':' + credentials.password);
797                var ajaxURLCurrent = host + '/rest/private/candidate/' + _XC_CONFIG.org + '/current';
798                jQuery.ajax(ajaxURLCurrent, {
799                    beforeSend: function (xhr) {
800                        xhr.setRequestHeader("Authorization", token);
801                    },
802                    success   : function (candidateObj) {
803                        var caId = candidateObj.candidateId;
804                        if(caId){
805                            var ajaxGetFavLocationsURL = host + '/rest/private/candidate/' + _XC_CONFIG.org + '/savesearch/candidate/' + caId;
806                            jQuery.ajax(ajaxGetFavLocationsURL,{
807                                beforeSend: function (xhr) {
808                                    xhr.setRequestHeader("Authorization", token);
809                                },
810                                success : function (resultData) {
811                                    // add filter to flterout locations
812                                    dbData = resultData.filter(function (value) {
813                                       return value.type === 'location_favorite';
814                                    });
815                                    for(var i = 0; i <cookieData.length; i++) {
816                                        var ExistenceCheck = findIfItsThere(cookieData[i]);
817                                        if(!ExistenceCheck.Exists){
818                                            // do not exists in DB. So go ahead and add.
819                                            cookieData[i].candidateId = caId;
820                                            cookieData[i].active = 1;
821                                            cookieData[i].frequency = "";
822                                            cookieData[i].deliveryMethod = "";
823                                            cookieData[i].type = "location_favorite";
824                                            var ajaxURL_Add = host + '/rest/private/candidate/' + _XC_CONFIG.org + '/savesearch/add';
825                                            jQuery.ajax(ajaxURL_Add, {
826                                                beforeSend: function (xhr) {
827                                                    xhr.setRequestHeader("Authorization", token);
828                                                },
829                                                headers   : {
830                                                    'Accept'      : 'application/json',
831                                                    'Content-Type': 'application/json'
832                                                },
833                                                data      : JSON.stringify(cookieData[i]),
834                                                // data      : data,
835                                                datatype  : 'json',
836                                                method    : "PUT",
837                                                success   : function (data) {
838                                                    // added successfully.
839                                                },
840                                                error     : function (e) {
841                                                    console.log(e);
842                                                }
843                                            });
844
845                                        }else if(ExistenceCheck.Data.length > 0){
846                                            // Entry Exists in DB but not active, Go ahead and Update the existing entry
847                                            var dataTOUpdate = ExistenceCheck.Data[0];
848                                            dataTOUpdate.active = 1;
849                                            var ajaxURL_Update = host + '/rest/private/candidate/' + _XC_CONFIG.org + '/savesearch/update';
850                                            jQuery.ajax(ajaxURL_Update, {
851                                                beforeSend: function (xhr) {
852                                                    xhr.setRequestHeader("Authorization", token);
853                                                },
854                                                headers   : {
855                                                    'Accept'      : 'application/json',
856                                                    'Content-Type': 'application/json'
857                                                },
858                                                data      : JSON.stringify(dataTOUpdate),
859                                                // data      : data,
860                                                datatype  : 'json',
861                                                method    : "POST",
862                                                success   : function (data) {
863                                                    // Updated successfully.
864                                                },
865                                                error     : function (e) {
866                                                    console.log(e);
867                                                }
868                                            });
869                                        }
870                                    }
871                                    document.cookie = "location_favorite =" + JSON.stringify([]) + ";" + 0 +";path=/";
872                                },
873                                error : function (e) {
874                                    console.log(e);
875                                }
876                            });
877                        }
878                    }, error  : function (e) {
879                        console.log(e);
880                    }
881                });
882            }
883        }
884    }catch (e) {
885        console.log(e);
886    }
887}
888
889
890/**
891 * Created by TDadam on 4/27/2018.
892 */
893var E_MODAL_POPUP_SIZE = {
894    LARGE: 'lg',
895    NONE : '',
896    SMALL: 'sm'
897};
898
899var E_COMMUNICATION_TYPE = {
900    MARKETING: "marketing",
901    SYSTEM   : "system",
902    SMS      : "marketing",
903    JOBALERT : "job_alert"
904};
905
906var E_COMMUNICATION_CHANNEL = {
907    EMAIL: "email",
908    SMS  : "sms",
909};
910
911var EBOOLEAN_TYPE = {
912    TRUE : 't',
913    FALSE: 'f'
914};
915
916var E_WORK_FLOW = {
917    APPLY          : 3,
918    APPLY_LCP      : 4,
919    ALERT_LCP      : 6,
920    CREATE_PASSWORD: 0,
921    DASHBOARD      : 2,
922    JOIN_LCP       : 5,
923    MODIFY_PASSWORD: 1,
924    MICROSITE_LCP  : 7,
925    EVENT_LCP  : 8,
926    NONE           : -1
927};
928var ANGULAR_SCHEMA_FORMATTER = {
929    LOOK_UP: {
930        DEFAULT  : {
931            LABEL_FIELD: "name",
932            SOURCE     : "titleMap",
933            VALUE_FIELD: "value"
934        },
935        DROP_DOWN: {
936            LABEL_FIELD: "name",
937            SOURCE     : "titleMap",
938            VALUE_FIELD: "value"
939        },
940        TYPES    : {
941            SELECT         : "select",
942            UI_MULTI_SELECT: "uimultiselect",
943            UI_SELECT      : "uiuiselect",
944            MULTI_SELECT_DROPDOWN : "multiselectdropdown",
945        },
946        UI_SELECT: {
947            LABEL_FIELD: "label",
948            SOURCE     : "items",
949            VALUE_FIELD: "value",
950            LIST_ID_FIELD: "listId"
951        }
952    }
953};
954
955
956var E_BOOTSTRAP_ALERT = {
957    CLASS: {
958        DANGER : "alert alert-danger",
959        INFO   : "alert alert-info",
960        SUCCESS: "alert alert-success",
961        WARNING: "alert alert-warning"
962    }
963};
964
965var E_TEMPLATE_FLAG_TYPE = {
966    PROFILE       : 'profile',
967    RESET_PASSWORD: 'reset'
968};
969
970/**
971 * Created by TDadam on 12/17/2017.
972 */
973// Wrapping this in a self-calling function so that functions/variables in here aren't global
974var TEMPLATE_CONSTANTS = (function () {
975    function TEMPLATE_STRING(str, context) {
976        this.str = str;
977        this.context = context;
978    }
979
980    // This prototype will make "TEMPLATE_CONSTANTS.TITLE.ACTIONS.CLOSE" return a string rather than [object Object]
981    TEMPLATE_STRING.prototype.toString = function () {
982        return this.str;
983    };
984
985    var _FIELD_TYPES = {
986        BUTTON    : "buttons",
987        DASHBOARD : "dashboard",
988        LABELS    : "labels",
989        TITLES    : "titles",
990        TEXT      : "text",
991        VALIDATION: "validation"
992    };
993    var _PREFIX = {
994        SCHEMA_HELP_BLOCK          : 'SchemaStatus',
995        ON_BOARDING_FORM_COMPLETION: "onBoardingFormCompletion"
996    };
997    var _TITLE = {
998        ACTIONS           : {
999            ACTION             : new TEMPLATE_STRING("Action", _FIELD_TYPES.TEXT),
1000            CANCEL             : new TEMPLATE_STRING("Cancel", _FIELD_TYPES.BUTTON),
1001            CLOSE              : new TEMPLATE_STRING("Close window", _FIELD_TYPES.BUTTON),
1002            CLICK_HERE         : new TEMPLATE_STRING("click here.", _FIELD_TYPES.BUTTON),
1003            DOWNLOAD_PROFILE   : new TEMPLATE_STRING("Download Profile", _FIELD_TYPES.BUTTON),
1004            CREATE_ONE         : new TEMPLATE_STRING("Create one", _FIELD_TYPES.BUTTON),
1005            CONTINUE           : new TEMPLATE_STRING("Continue", _FIELD_TYPES.BUTTON),
1006            SUBMIT             : new TEMPLATE_STRING("Submit", _FIELD_TYPES.BUTTON),
1007            DELETE             : new TEMPLATE_STRING("Delete", _FIELD_TYPES.TEXT),
1008            DELETE_ACCOUNT     : new TEMPLATE_STRING("Delete Account", _FIELD_TYPES.BUTTON),
1009            EDIT               : new TEMPLATE_STRING("Edit", _FIELD_TYPES.BUTTON),
1010            NO                 : new TEMPLATE_STRING("No", _FIELD_TYPES.BUTTON),
1011            OK                 : new TEMPLATE_STRING("OK", _FIELD_TYPES.BUTTON),
1012            REMOVE_ATTACHMENT  : new TEMPLATE_STRING("Remove Attachment", _FIELD_TYPES.TEXT),
1013            DOWNLOAD_ATTACHMENT: new TEMPLATE_STRING("Download Attachment", _FIELD_TYPES.TEXT),
1014            REMOVE_ACTIVITY    : new TEMPLATE_STRING("Remove Activity", _FIELD_TYPES.TEXT),
1015            RETURN_TO_HOME     : new TEMPLATE_STRING(" Return to Homepage", _FIELD_TYPES.BUTTON),
1016            SAVE               : new TEMPLATE_STRING("SAVE", _FIELD_TYPES.BUTTON),
1017            SKIP               : new TEMPLATE_STRING("SKIP", _FIELD_TYPES.BUTTON),
1018            SIGN_IN            : new TEMPLATE_STRING("Sign In", _FIELD_TYPES.BUTTON),
1019            TRY_AGAIN          : new TEMPLATE_STRING("Try again", _FIELD_TYPES.BUTTON),
1020            VIEW_APPLICATIONS  : new TEMPLATE_STRING("View Applications", _FIELD_TYPES.BUTTON),
1021            YES_DELETE         : new TEMPLATE_STRING("Yes, Delete", _FIELD_TYPES.BUTTON),
1022            START              : new TEMPLATE_STRING("Start", _FIELD_TYPES.BUTTON),
1023            YES                : new TEMPLATE_STRING("Yes", _FIELD_TYPES.BUTTON),
1024            UPLOAD_FILE        : new TEMPLATE_STRING("Upload File", _FIELD_TYPES.BUTTON),
1025            UPLOAD_RESUME      : new TEMPLATE_STRING("Upload Resume", _FIELD_TYPES.BUTTON),
1026            DISMISS            : new TEMPLATE_STRING("Dismiss", _FIELD_TYPES.BUTTON),
1027            LOGIN              : new TEMPLATE_STRING("Login", _FIELD_TYPES.BUTTON),
1028            SAVE_DISABLED      : new TEMPLATE_STRING("Save disabled", _FIELD_TYPES.BUTTON),
1029            ADD                : new TEMPLATE_STRING("Add", _FIELD_TYPES.BUTTON),
1030            REMOVE_NOTIFICATION: new TEMPLATE_STRING("Remove Notification", _FIELD_TYPES.BUTTON)
1031        },
1032        FORMS             : {
1033            BACKGROUND_INFO   : new TEMPLATE_STRING("Background Information", _FIELD_TYPES.TEXT),
1034            CONFIRMATION      : new TEMPLATE_STRING("Confirmation", _FIELD_TYPES.TEXT),
1035            CANDIDATE_INFO    : new TEMPLATE_STRING("Candidate Information", _FIELD_TYPES.TEXT),
1036            CERTIFICATIONS    : new TEMPLATE_STRING("Certifications", _FIELD_TYPES.TEXT),
1037            CREATE_PASSWORD   : new TEMPLATE_STRING("CREATE PASSWORD", _FIELD_TYPES.TEXT),
1038            EEO_INFO          : new TEMPLATE_STRING("EEO Information", _FIELD_TYPES.TEXT),
1039            EDUCATION_HISTORY : new TEMPLATE_STRING("Education History", _FIELD_TYPES.TEXT),
1040            EMPLOYMENT_HISTORY: new TEMPLATE_STRING("Employment History", _FIELD_TYPES.TEXT),
1041            FORGOT_PASSWORD   : new TEMPLATE_STRING("Forgot Password", _FIELD_TYPES.TEXT),
1042            ON_BOARDING       : new TEMPLATE_STRING("Onboarding", _FIELD_TYPES.TEXT),
1043            PROFILE_DOWNLOAD  : new TEMPLATE_STRING("Profile Download", _FIELD_TYPES.TEXT),
1044            RESET_PASSWORD    : new TEMPLATE_STRING("Reset Password", _FIELD_TYPES.TEXT),
1045            SCREENING         : new TEMPLATE_STRING("Screening", _FIELD_TYPES.TEXT)
1046        },
1047        LABELS            : {
1048            CONFIRMATION                     : new TEMPLATE_STRING("Do you want to close this form?", _FIELD_TYPES.TITLES),
1049            YOUR_ACCOUNT                     : new TEMPLATE_STRING("Your Account", _FIELD_TYPES.TITLES),
1050            DELETE_YOUR_ACCOUNT              : new TEMPLATE_STRING("Delete Your Account?", _FIELD_TYPES.TITLES),
1051            DUE_TITLE                        : new TEMPLATE_STRING("Due by", _FIELD_TYPES.TITLES),
1052            DO_NOT_HAVE_PROFILE              : new TEMPLATE_STRING("Don't have a talent profile?", _FIELD_TYPES.TITLES),
1053            FIELDS_ACCESSIBILITY             : {
1054                DATE_FIELD_YYYY_MM_DD: new TEMPLATE_STRING("Please enter date in YYYY-DD-MM Format", _FIELD_TYPES.TEXT)
1055            },
1056            OR                               : new TEMPLATE_STRING("OR", _FIELD_TYPES.TITLES),
1057            PROGRESS_SAVE                    : new TEMPLATE_STRING("Your progress will not be saved.", _FIELD_TYPES.TITLES),
1058            IMPORTANT                        : new TEMPLATE_STRING("Saving Form.", _FIELD_TYPES.TITLES),
1059            FINAL_SAVE_ALERT                 : new TEMPLATE_STRING("This is your last form. If you submit it now, you will not be able to edit it or any of your previous forms.", _FIELD_TYPES.TITLES),
1060            OF                               : new TEMPLATE_STRING("of", _FIELD_TYPES.TITLES),
1061            PAGE                             : new TEMPLATE_STRING("Page", _FIELD_TYPES.TITLES),
1062            SAVING                           : new TEMPLATE_STRING("Saving", _FIELD_TYPES.TITLES),
1063            PASSWORD                         : new TEMPLATE_STRING("Password", _FIELD_TYPES.LABELS),
1064            USER_NAME_EMAIL                  : new TEMPLATE_STRING("User Name/Email", _FIELD_TYPES.LABELS),
1065            EMAIL_ADDRESS                    : new TEMPLATE_STRING("Email address", _FIELD_TYPES.LABELS),
1066            ALLOW_RESUME_DASHBOARD           : new TEMPLATE_STRING("Want to use your resume to fill out your profile automatically?", _FIELD_TYPES.LABELS),
1067            YES_PARSE                        : new TEMPLATE_STRING("Yes Please", _FIELD_TYPES.TITLES),
1068            NO_PARSE                         : new TEMPLATE_STRING("No Thanks", _FIELD_TYPES.TITLES),
1069            DELETE_ATTACHMENT_CONFIRMATION   : new TEMPLATE_STRING("Are you sure you want to delete this attachment?", _FIELD_TYPES.TITLES),
1070            DOCUMENT_UPLOAD_CONFIRMATION     : new TEMPLATE_STRING("Attachment uploaded successfully", _FIELD_TYPES.TITLES),
1071            DOCUMENT_UPLOAD_ERROR            : new TEMPLATE_STRING("Error in uploading Document!!. Please try again after some time.", _FIELD_TYPES.TITLES),
1072            DOCUMENT_DELETE_ERROR            : new TEMPLATE_STRING("Error in deleting Document!!. Please try again after some time.", _FIELD_TYPES.TITLES),
1073            DOCUMENT_DELETED_CONFIRMATION    : new TEMPLATE_STRING("Document deleted successfully", _FIELD_TYPES.TITLES),
1074            ATTACHMENT_DELETED_CONFIRMATION  : new TEMPLATE_STRING("Attachment deleted successfully", _FIELD_TYPES.TITLES),
1075            RESUME_PARSED_UPLOAD_CONFIRMATION: new TEMPLATE_STRING("Resume parsed and uploaded successfully", _FIELD_TYPES.TITLES),
1076            RESUME_PARSED_UPLOAD_ERROR       : new TEMPLATE_STRING("Resume parsed Successfully, but Error in uploading Resume!!. Please try again after some time.", _FIELD_TYPES.TITLES),
1077            RESUME_DELETED_CONFIRMATION      : new TEMPLATE_STRING("Resume deleted successfully", _FIELD_TYPES.TITLES),
1078            RESUME_UPLOAD_CONFIRMATION       : new TEMPLATE_STRING("Resume uploaded successfully", _FIELD_TYPES.TITLES),
1079            RESUME_UPLOAD_ERROR              : new TEMPLATE_STRING("Error in uploading Resume!!. Please try again after some time.", _FIELD_TYPES.TITLES),
1080            PREFERRED_JOB_TITLE              : new TEMPLATE_STRING("Preferred Job Title", _FIELD_TYPES.LABELS),
1081            ENTER_JOB_TITLE                  : new TEMPLATE_STRING("Enter Job Title(s)", _FIELD_TYPES.LABELS),
1082            PREFERRED_LOCATIONS              : new TEMPLATE_STRING("Preferred Locations", _FIELD_TYPES.LABELS),
1083            ENTER_PREFERRED_LOCATIONS        : new TEMPLATE_STRING("Enter Location(s)", _FIELD_TYPES.LABELS),
1084            AREA_OF_INTEREST                 : new TEMPLATE_STRING("Area of Interest", _FIELD_TYPES.LABELS),
1085            COMMUNICATIONS                   : new TEMPLATE_STRING("C
1085ommunications", _FIELD_TYPES.LABELS),
1086            ENTER_AREA_OF_INTEREST           : new TEMPLATE_STRING("Enter Area(s) of Interest", _FIELD_TYPES.LABELS),
1087            COGNITO_SOCIAL_LOGIN_LABEL       : new TEMPLATE_STRING("Use your social account to continue: LinkedIn, Facebook, or Google", _FIELD_TYPES.LABELS)
1088        },
1089        BANNER            : {
1090            AND                                   : new TEMPLATE_STRING("and", _FIELD_TYPES.TEXT),
1091            PREFERENCE_NOTIFICATION_TEXT          : new TEMPLATE_STRING("Please provide Job Title, Area of Interest and Location preferences to enhance our automated job matching.", _FIELD_TYPES.TEXT),
1092            PREFERENCE_NOTIFICATION_TEXT_2        : new TEMPLATE_STRING("Type your preference and Hit Enter to record entries.", _FIELD_TYPES.TEXT),
1093            APPLY_ASSESSMENT_HEADER               : new TEMPLATE_STRING("You need to complete the following assessments as part of your application. You can also find these assessments in the To-Do section of your profile.", _FIELD_TYPES.TEXT),
1094            UNSUBSCRIBE_HEADING                   : new TEMPLATE_STRING("Thank you. Your subscription preferences have been updated.", _FIELD_TYPES.TEXT),
1095            UNSUBSCRIBE_SUCCESS_HEADER            : new TEMPLATE_STRING("Access <b><u><a href='/profile/'>your profile</a></u></b> to manage your profile further.", _FIELD_TYPES.TEXT),
1096            UNSUBSCRIBE_FAILED_HEADER             : new TEMPLATE_STRING("We are unable to authenticate this request and cannot unsubscribe you at this time. <br><br> Please access your profile <b><u><a href='/profile/'>here</a></u></b> and manage your Subscription Settings.", _FIELD_TYPES.TEXT),
1097            UNSUBSCRIBE_FAILED_HEADER_LOGINLESS   : new TEMPLATE_STRING("The email unsubscribe link has expired. <br> Please use a more recent e-mail to unsubscribe.", _FIELD_TYPES.TEXT),
1098            UNSUBSCRIBE_EMAIL_INVALID             : new TEMPLATE_STRING("We are unable to validate your User Name` / Email Address information.​", _FIELD_TYPES.TEXT),
1099            SUBSCRIPTION_SETTINGS_HEADING         : new TEMPLATE_STRING("You are in control of the types of emails that you'd like us to send.​", _FIELD_TYPES.TEXT),
1100            SUBSCRIPTION_SETTINGS_SUBHEADING         : new TEMPLATE_STRING("Check the boxes you want to keep and uncheck the ones you want to unsubscribe.​", _FIELD_TYPES.TEXT),
1101            DOWNLOADING                           : new TEMPLATE_STRING("Downloading", _FIELD_TYPES.TEXT),
1102            DOWNLOAD_INSTRUCTION_CSV              : new TEMPLATE_STRING("If your profile does not start downloading within 10 seconds, activate ", _FIELD_TYPES.TEXT),
1103            DOWNLOAD_INSTRUCTION_END             : new TEMPLATE_STRING(" to save it to your computer.", _FIELD_TYPES.TEXT),
1104            DOWNLOAD_INSTRUCTION_CSV_FILE_TYPE    : new TEMPLATE_STRING("profiles are downloaded as CSV files.", _FIELD_TYPES.TEXT),
1105            DELETE_ACCOUNT_INFORMATION            : new TEMPLATE_STRING("If you proceed, your account with all your saved information will be erased. This action cannot be undone.", _FIELD_TYPES.TEXT),
1106            DELETE_ACCOUNT_CAPTCHA                : new TEMPLATE_STRING("Type the word DELETE in upper case to confirm.", _FIELD_TYPES.TEXT),
1107            DELETE_ACCOUNT_CONFIRMATION_TEXT      : new TEMPLATE_STRING("Your account has been deleted. Click OK to continue.", _FIELD_TYPES.TEXT),
1108            INTERVIEW_SLOT_UNAVAILABLE_TEXT       : new TEMPLATE_STRING("Sorry, that time slot was just booked. Please refresh your browser to view available times. ", _FIELD_TYPES.TEXT),
1109            NEW_USER_APPLY_THANK_YOU_MESSAGE      : new TEMPLATE_STRING("Welcome to Candidate Experience. Thank you for your application! Please check your email for an activation link to see the status of your application.", _FIELD_TYPES.TEXT),
1110            ON_BOARDING_SUB_HEADER                : new TEMPLATE_STRING("PLEASE NOTE: After starting a form, you must complete it. You will not be able to save your progress or come back to finish it. All incomplete form data will be deleted.", _FIELD_TYPES.TEXT),
1111            RETURNING_USER_APPLY_THANK_YOU_MESSAGE: new TEMPLATE_STRING("Your application was received. A recruiter will c
1111ontact you if your qualifications and experience align with an open position", _FIELD_TYPES.TEXT),
1112            RESET_PASSWORD_NON_COMPLIANCE         : new TEMPLATE_STRING("Sorry, we need a password to activate your profile.", _FIELD_TYPES.TEXT),
1113            GDPR_NON_COMPLIANCE                   : new TEMPLATE_STRING("in accordance with our Privacy Policy we need you to accept this terms to allow us to maintain your profile.", _FIELD_TYPES.TEXT),
1114            SIGNATURE_PLACEHOLDER                 : new TEMPLATE_STRING("Please type your full name here as per your Profile", _FIELD_TYPES.TEXT),
1115            TERMS_POLICY_LEFT_TITLE_START         : new TEMPLATE_STRING("Yes, I agree to the", _FIELD_TYPES.TEXT),
1116            SUBSCRIPTION_TITLE_START              : new TEMPLATE_STRING("I would like to be contacted with marketing and job alerts from", _FIELD_TYPES.TEXT),
1117            SUBSCRIPTION_SOFT_OPT_IN_TITLE        : new TEMPLATE_STRING("No, I do not wish to be contacted with marketing and job alerts from", _FIELD_TYPES.TEXT),
1118            SUBSCRIPTION_TITLE_END                : new TEMPLATE_STRING("I know I can unsubscribe at any time.", _FIELD_TYPES.TEXT),
1119            SUBSCRIPTION_TITLE_EMAIL              : new TEMPLATE_STRING("Emails", _FIELD_TYPES.TEXT),
1120            SUBSCRIPTION_TITLE_ALL_EMAILS         : new TEMPLATE_STRING("All Marketing Emails", _FIELD_TYPES.TEXT),
1121            SUBSCRIPTION_TITLE_MARKETING_EMAIL    : new TEMPLATE_STRING("Marketing Emails", _FIELD_TYPES.TEXT),
1122            SUBSCRIPTION_TITLE_SMS                : new TEMPLATE_STRING("SMS Text", _FIELD_TYPES.TEXT),
1123            SUBSCRIPTION_TITLE_JOB_ALERTS         : new TEMPLATE_STRING("Job Alert Emails", _FIELD_TYPES.TEXT),
1124            UNSUBSCRIBE_EMAIL                     : new TEMPLATE_STRING("Profile updated, You are successfully unsubscribed form email alerts", _FIELD_TYPES.TEXT),
1125            SUBSCRIBE_EMAIL                       : new TEMPLATE_STRING("Profile updated, You are successfully subscribed to email alerts", _FIELD_TYPES.TEXT),
1126            UNSUBSCRIBE_EMAIL_SMS                 : new TEMPLATE_STRING("Profile updated, You are successfully unsubscribed form marketing, job alerts and SMS Text", _FIELD_TYPES.TEXT),
1127            UNSUBSCRIBE_EMAIL_SUBSCRIBE_SMS       : new TEMPLATE_STRING("Profile updated, You are successfully subscribed to SMS Text and successfully unsubscribed form marketing, job alerts", _FIELD_TYPES.TEXT),
1128            UNSUBSCRIBE_SMS_SUBSCRIBE_EMAIL       : new TEMPLATE_STRING("Profile updated, You are successfully subscribed to marketing, job alerts and successfully unsubscribed form SMS Text", _FIELD_TYPES.TEXT),
1129            SUBSCRIBE_EMAIL_SMS                   : new TEMPLATE_STRING("Profile updated, You are successfully subscribed to marketing, job alerts and SMS Text", _FIELD_TYPES.TEXT),
1130            TERMS_OF_USE                          : new TEMPLATE_STRING("Terms of Use", _FIELD_TYPES.TEXT),
1131            PRIVACY_POLICY                        : new TEMPLATE_STRING("Privacy Policy", _FIELD_TYPES.TEXT),
1132            REQUIRED_FIELD                        : new TEMPLATE_STRING("* Required Fields", _FIELD_TYPES.TEXT),
1133            SCHOOL_DETAILS                        : new TEMPLATE_STRING("School Details", _FIELD_TYPES.TEXT),
1134            JOB_DETAILS                           : new TEMPLATE_STRING("Job Details", _FIELD_TYPES.TEXT),
1135            CERTIFICATE_LICENSE_DETAILS           : new TEMPLATE_STRING("Certificate / License Details", _FIELD_TYPES.TEXT),
1136            ARE_YOU_SURE_YOU_WANT_TO_DELETE_THE   : new TEMPLATE_STRING("Are you sure you want to delete the", _FIELD_TYPES.TEXT),
1137            RECORD_SUCCESSFULLY_UPDATED           : new TEMPLATE_STRING("record successfully updated ", _FIELD_TYPES.TEXT),
1138            HISTORY                               : new TEMPLATE_STRING("history?", _FIELD_TYPES.TEXT),
1139            PASSWORD_RESET_HAS_BEEN_SUCCESSFUL    : new TEMPLATE_STRING("Password reset has been successful.", _FIELD_TYPES.TEXT),
1140            WORK_HISTORY_MSG                      : new TEMPLATE_STRING("What work experience do you have?", _FIELD_TYPES.TEXT),
1141            EDUCATION_HISTORY_MSG                 : new TEMPLATE_STRING("Where did you go to school?", _FIELD_TYPES.TEXT),
1142            SLOT_BOOKING_ERROR                    : new TEMPLATE_STRING("Sorry, that time slot is no longer available", _FIELD_TYPES.TEXT),
1143            SLOT_SELECT_TIME                      : new TEMPLATE_STRING("Select a time for your interview session", _FIELD_TYPES.TEXT),
1144            CANCEL_SLOT_TEXT                      : new TEMPLATE_STRING("You're session is cancelled.", _FIELD_TYPES.TEXT),
1145            DIFFERENT_SLOT_TEXT                   : new TEMPLATE_STRING("Need a different time?", _FIELD_TYPES.TEXT),
1146            SLOT_INVITE_TEXT_START                : new TEMPLATE_STRING("You're invited to an interview session at  ", _FIELD_TYPES.TEXT),
1147            SLOT_INVITE_TEXT_END                  : new TEMPLATE_STRING(". We encourage you to bring a friend, more the merrier!", _FIELD_TYPES.TEXT),
1148            SLOT_RESERVE_TEXT                     : new TEMPLATE_STRING("Your spot has been reserved", _FIELD_TYPES.TEXT),
1149            EMAIL_RECEIVE_TEXT                    : new TEMPLATE_STRING("You will receive an email with all the information you need for your group session.", _FIELD_TYPES.TEXT),
1150            INTERVIEW_SESSION_TEXT_START          : new TEMPLATE_STRING("Interview Session - ", _FIELD_TYPES.TEXT),
1151            INTERVIEW_SESSION_TEXT_END            : new TEMPLATE_STRING(" careers", _FIELD_TYPES.TEXT),
1152            CONFIRMATION_BUTTON_TEXT              : new TEMPLATE_STRING("Reserve My Spot", _FIELD_TYPES.TEXT),
1153            ERROR_MESSAGE_TEXT                    : new TEMPLATE_STRING("Something went wrong. Please try again later!", _FIELD_TYPES.TEXT)
1154        },
1155        DASHBOARD         : {
1156            ATTACHMENT                       : new TEMPLATE_STRING("Attachments", _FIELD_TYPES.LABELS),
1157            UPDATE_SOCIAL_PROFILE_HEADER     : new TEMPLATE_STRING("Would you like to <span class=\"caps\">Update your profile with your</span> {{socialProvider}} ?", _FIELD_TYPES.TEXT),
1158            UPDATE_SOCIAL_PROFILE_DESCRIPTION: new TEMPLATE_STRING("Please note that this will over
1158write any profile data with profile information from <b>{{socialProvider}}.</b>", _FIELD_TYPES.TEXT),
1159            DOCUMENTS                        : new TEMPLATE_STRING("Documents", _FIELD_TYPES.LABELS),
1160            FILE                             : new TEMPLATE_STRING("File", _FIELD_TYPES.LABELS),
1161            ACTION                           : new TEMPLATE_STRING("Action", _FIELD_TYPES.LABELS),
1162            ATTACHMENT_TYPE                  : new TEMPLATE_STRING("Type", _FIELD_TYPES.LABELS),
1163            CHOOSE_A_FILE                    : new TEMPLATE_STRING("Choose a file", _FIELD_TYPES.LABELS),
1164            CHOOSE_A_DOCUMENT_FILE           : new TEMPLATE_STRING("Choose your file and upload it here. The following file types are supported. (.rtf, .doc, .docx, .txt, .pdf files with a 2MB maximum file size are supported)", _FIELD_TYPES.TEXT),
1165            CHOOSE_A_IMAGE_OR_DOCUMENT_FILE  : new TEMPLATE_STRING("Choose your file and upload it here. The following file types are supported. (.rtf, .doc, .docx, .txt, .pdf, .png, .jpeg, .jpg files with a 2MB maximum file size are supported)", _FIELD_TYPES.TEXT),
1166            CHOOSE_A_RESUME_FILE             : new TEMPLATE_STRING("Choose your resume and upload to your profile. (.rtf, .doc, .docx, .txt, .pdf files with a 2MB maximum file size are supported)", _FIELD_TYPES.TEXT),
1167        },
1168        CANDIDATE_ACTIVITY: {
1169            PREFERENCE_ALERT_TEXT : new TEMPLATE_STRING("Keep your Profile Preferences current to enhance automated job matching.", _FIELD_TYPES.TEXT),
1170            PREFERENCE_LINK_TEXT  : new TEMPLATE_STRING("Manage Preferences", _FIELD_TYPES.TEXT),
1171            NO_RECENT_ACTIVITY    : new TEMPLATE_STRING("There are no recent activity to show.", _FIELD_TYPES.TEXT),
1172            NO_ACTIVITY_FOR_FILTER: new TEMPLATE_STRING("No activities for this filter.", _FIELD_TYPES.TEXT),
1173            NO_RECENT_NOTIFICATION: new TEMPLATE_STRING("There are no recent notification to show.", _FIELD_TYPES.TEXT),
1174            GO_TO                 : new TEMPLATE_STRING("go to", _FIELD_TYPES.TEXT),
1175            MY_PROFILE            : new TEMPLATE_STRING("My Profile", _FIELD_TYPES.TEXT),
1176            SHOW_ACCOUNT_LINK     : window.location.pathname.indexOf('/profile/') === -1,
1177            RECENT                : new TEMPLATE_STRING("recent", _FIELD_TYPES.DASHBOARD),
1178            RECENT_ACTIVITY       : new TEMPLATE_STRING("Recent Activity", _FIELD_TYPES.DASHBOARD),
1179            ACTION                : new TEMPLATE_STRING("action", _FIELD_TYPES.DASHBOARD),
1180            REMINDER              : new TEMPLATE_STRING("reminder", _FIELD_TYPES.DASHBOARD),
1181            SUMMARY               : new TEMPLATE_STRING("summary", _FIELD_TYPES.DASHBOARD),
1182            NOTIFICATION          : new TEMPLATE_STRING("notification", _FIELD_TYPES.DASHBOARD),
1183            STATUS                : new TEMPLATE_STRING("Status", _FIELD_TYPES.DASHBOARD),
1184            SUGGESTION            : new TEMPLATE_STRING("suggestion", _FIELD_TYPES.DASHBOARD),
1185            VIEW_MORE             : new TEMPLATE_STRING("View more", _FIELD_TYPES.DASHBOARD),
1186            VIEW_LESS             : new TEMPLATE_STRING("View less", _FIELD_TYPES.DASHBOARD),
1187        },
1188        HEADER            : {
1189            GDPR_MIGRATION           : new TEMPLATE_STRING("We Have Updated our Terms of Use and Privacy Policy", _FIELD_TYPES.TEXT),
1190            REVIEW_AND_COMPLETE      : new TEMPLATE_STRING("Please review and complete", _FIELD_TYPES.TEXT),
1191            THANK_YOU_ACKNOWLEDGEMENT: new TEMPLATE_STRING("Thank You for Your Acknowledgement.", _FIELD_TYPES.TEXT),
1192            OPTIN_CONFIRMATION: new TEMPLATE_STRING("Thanks For Your Confirmation.", _FIELD_TYPES.TEXT)
1193        }
1194    };
1195    var _VALIDATION = {
1196        PREVENT_LOGIN_START           : new TEMPLATE_STRING("Please complete your application to login.", _FIELD_TYPES.VALIDATION),
1197        PREVENT_LOGIN_LINK            : new TEMPLATE_STRING("Click here to complete your application", _FIELD_TYPES.VALIDATION),
1198        GDPR_UPDATE_FAILURE           : new TEMPLATE_STRING("Something went wrong! Failed to update preferences.", _FIELD_TYPES.VALIDATION),
1199        INCOMPLETE                    : new TEMPLATE_STRING("Please complete following forms to continue", _FIELD_TYPES.VALIDATION),
1200        INVALID_CONTENT               : new TEMPLATE_STRING("Attachment content type is invali
1200d", _FIELD_TYPES.VALIDATION),
1201        IN_COMPATIBLE_FILE_FORMAT     : new TEMPLATE_STRING("Unsupported file format", _FIELD_TYPES.VALIDATION),
1202        FILE_SIZE_EXCEED              : new TEMPLATE_STRING("Exceeded file size", _FIELD_TYPES.VALIDATION),
1203        MAX_UPLOAD_REACHED_START      : new TEMPLATE_STRING("You can only upload ", _FIELD_TYPES.VALIDATION),
1204        MAX_UPLOAD_REACHED_END        : new TEMPLATE_STRING(" attachments", _FIELD_TYPES.VALIDATION),
1205        INVALID_CURRENT_PASS          : new TEMPLATE_STRING("Current password is invalid", _FIELD_TYPES.TEXT),
1206        REUSED_NEW_PASSWORD           : new TEMPLATE_STRING("Your new password cannot be the same as a previously used password. Please enter a different password.", _FIELD_TYPES.TEXT),
1207        DELETE_MISMATCH               : new TEMPLATE_STRING("Entered keyword does not match the word \"DELETE\" in upper case.", _FIELD_TYPES.VALIDATION),
1208        INVALID_EMAIL_PASSWORD        : new TEMPLATE_STRING("Invalid email or password entered.", _FIELD_TYPES.VALIDATION),
1209        ACTIVATE_ACCOUNT              : new TEMPLATE_STRING("Please check your mailbox to activate your Talent Profile account and login. If you do not see activation email please check your spam or junk folder.", _FIELD_TYPES.VALIDATION),
1210        REQUIRED_FIELDS_NEEDED        : new TEMPLATE_STRING("Please edit your records and provide information for the required fields.", _FIELD_TYPES.VALIDATION),
1211        REGISTRATION_FAIL             : new TEMPLATE_STRING("Registration Failure: Something went wrong and we could not register with your social profile. Please try again later.", _FIELD_TYPES.VALIDATION),
1212        WITHOUT_EMAIL_ID              : new TEMPLATE_STRING("To create a new talent profile, please add a valid email address in your social profile and try again.", _FIELD_TYPES.VALIDATION),
1213        LOGIN_FAIL                    : new TEMPLATE_STRING("Login Failure: Something went wrong and we failed to connect to your social network. Please try again later.", _FIELD_TYPES.VALIDATION),
1214        UNSUPPORTED_ACTIVITY          : new TEMPLATE_STRING("Unsupported Activity.", _FIELD_TYPES.VALIDATION),
1215        GENERAL_EXCEPTION             : new TEMPLATE_STRING("General Exception: Something went wrong while trying to access your social profile. Please try again later.", _FIELD_TYPES.VALIDATION),
1216        DEACTIVATED_MESSAGE           : new TEMPLATE_STRING("Sorry, this account has been deleted at the user's request.", _FIELD_TYPES.VALIDATION),
1217        FORGOT_PASSWORD_TEXT          : new TEMPLATE_STRING("If an account matches the e-mail address supplied, an e-mail has been sent to the address with reset instructions.", _FIELD_TYPES.VALIDATION),
1218        FORGOT_PASSWORDERROR_TEXT     : new TEMPLATE_STRING("Please enter a valid email address (e.g., [email protected]).", _FIELD_TYPES.VALIDATION),
1219        MAX_RECORD_PERMITTED          : new TEMPLATE_STRING("Maximum of {{max_record}} records permitted.", _FIELD_TYPES.VALIDATION),
1220        MIN_RECORD_PERMITTED          : new TEMPLATE_STRING("Please provide at least {{min_record}}", _FIELD_TYPES.VALIDATION),
1221        MIN_MAX_RECORD_PERMITTED      : new TEMPLATE_STRING("and no more than {{max_record}} records.", _FIELD_TYPES.VALIDATION),
1222        SSN_HRLOGIX_VALIDATION_MESSAGE: new TEMPLATE_STRING("This SSN or email address is already in use on a different account. Please send an email to [email protected], which includes your first and last name along with the last 4 digits of your SSN for assistance.", _FIELD_TYPES.VALIDATION),
1223        CREATE_CANDIDATE_ERROR        : new TEMPLATE_STRING("At this time, we are unable to process your profile creation. Please try again later.", _FIELD_TYPES.TEXT),
1224        SUCCESSFUL_EMAIL              : new TEMPLATE_STRING("User Name/Email entered successfully", _FIELD_TYPES.TEXT),
1225        SUCCESSFUL_PASSWORD           : new TEMPLATE_STRING("Password entered successfully", _FIELD_TYPES.TEXT),
1226        PASSWORDS_MATCHED             : new TEMPLATE_STRING("Passwords Matched", _FIELD_TYPES.TEXT),
1227        PASSWORD_STRENGTH_VERY_WEAK   : new TEMPLATE_STRING("Password strength: Very weak", _FIELD_TYPES.VALIDATION),
1228        PASSWORD_STRENGTH_WEAK        : new TEMPLATE_STRING("Password strength: Weak", _FIELD_TYPES.VALIDATION),
1229        PASSWORD_STRENGTH_MEDIUM      : new TEMPLATE_STRING("Password strength: Medium", _FIELD_TYPES.VALIDATION),
1230        PASSWORD_STRENGTH_STRONG      : new TEMPLATE_STRING("Password strength: Strong", _FIELD_TYPES.VALIDATION),
1231        RECAPTCHA_ERROR               : new TEMPLATE_STRING("We were unable to verify your submission due to possible automated traffic. Please re-submit the form to try again.",_FIELD_TYPES.VALIDATION)
1232    };
1233
1234    if (_XC_CONFIG.context.applyThankYouMessageForNewUser && _XC_CONFIG.context.applyThankYouMessageForNewUser.length > 0) {
1235        _TITLE.BANNER.NEW_USER_APPLY_THANK_YOU_MESSAGE = new TEMPLATE_STRING(_XC_CONFIG.context.applyThankYouMessageForNewUser, _FIELD_TYPES.TEXT);
1236    }
1237
1238    if (_XC_CONFIG.context.applyThankYouMessageForReturningUser && _XC_CONFIG.context.applyThankYouMessageForReturningUser.length > 0) {
1239        _TITLE.BANNER.RETURNING_USER_APPLY_THANK_YOU_MESSAGE = new TEMPLATE_STRING(_XC_CONFIG.context.applyThankYouMessageForReturningUser, _FIELD_TYPES.TEXT);
1240    }
1241
1242    if (_XC_CONFIG.context.applyAssessmentHeader && _XC_CONFIG.context.applyAssessmentHeader.length > 0) {
1243        _TITLE.BANNER.APPLY_ASSESSMENT_HEADER = new TEMPLATE_STRING(_XC_CONFIG.context.applyAssessmentHeader, _FIELD_TYPES.TEXT);
1244    }
1245
1246    // This is the object the browser will see
1247    return {
1248        FIELD_TYPES: _FIELD_TYPES,
1249        PREFIX     : _PREFIX,
1250        TITLE      : _TITLE,
1251        VALIDATION : _VALIDATION,
1252        RUNTIME    : {}
1253    };
1254})();
1255window.TEMPLATE_CONSTANTS = TEMPLATE_CONSTANTS;
1256
1257initializeReadOnlyProperties();
1258initializeElementConstant();
1259
1260function initializeReadOnlyProperties() {
1261
1262    // Org name should never need to be translated
1263    //_XC_CONFIG.org_name = XCLOUD.i18n(_XC_CONFIG.org_name, TEMPLATE_CONSTANTS.FIELD_TYPES.TEXT);
1264
1265    for (var titles in TEMPLATE_CONSTANTS.TITLE) {
1266        for (var section in TEMPLATE_CONSTANTS.TITLE[titles]) {
1267            TEMPLATE_CONSTANTS.TITLE[titles][section].str = XCLOUD.i18n(TEMPLATE_CONSTANTS.TITLE[titles][section].str, TEMPLATE_CONSTANTS.TITLE[titles][section].context);
1268        }
1269    }
1270    for (var validations in TEMPLATE_CONSTANTS.VALIDATION) {
1271        TEMPLATE_CONSTANTS.VALIDATION[validations].str = XCLOUD.i18n(TEMPLATE_CONSTANTS.VALIDATION[validations].str, TEMPLATE_CONSTANTS.VALIDATION[validations].context);
1272    }
1273
1274    if (_XC_CONFIG.login_modal.header === '') {
1275        _XC_CONFIG.login_modal.header = TEMPLATE_CONSTANTS.TITLE.ACTIONS.SIGN_IN.str;
1276    }
1277
1278    if (_XC_CONFIG.login_modal.signInCaption === '') {
1279        _XC_CONFIG.login_modal.signInCaption = TEMPLATE_CONSTANTS.TITLE.ACTIONS.SIGN_IN.str;
1280    }
1281
1282    if (_XC_CONFIG.login_modal.separator === '') {
1283        _XC_CONFIG.login_modal.separator = TEMPLATE_CONSTANTS.TITLE.LABELS.OR.str;
1284    }
1285
1286    _XC_CONFIG.login_modal.passwordInModal = (_XC_CONFIG.login_modal.disabled === false);
1287
1288    _XC_CONFIG.login_modal.header = XCLOUD.i18n(_XC_CONFIG.login_modal.header, TEMPLATE_CONSTANTS.FIELD_TYPES.TITLES);
1289    _XC_CONFIG.login_modal.signInCaption = XCLOUD.i18n(_XC_CONFIG.login_modal.signInCaption, TEMPLATE_CONSTANTS.FIELD_TYPES.BUTTON);
1290    _XC_CONFIG.login_modal.subHeader = XCLOUD.i18n(_XC_CONFIG.login_modal.subHeader, TEMPLATE_CONSTANTS.FIELD_TYPES.TITLES);
1291    if (_XC_CONFIG.context.onBoarding) {
1292        if (_XC_CONFIG.context.onBoarding.subHeader && _XC_CONFIG.context.onBoarding.subHeader.length > 0) {
1293            TEMPLATE_CONSTANTS.TITLE.BANNER.ON_BOARDING_SUB_HEADER = _XC_CONFIG.context.onBoarding.subHeader;
1294        }
1295        if (_XC_CONFIG.context.onBoarding.header && _XC_CONFIG.context.onBoarding.header.length > 0) {
1296            TEMPLATE_CONSTANTS.TITLE.BANNER.ON_BOARDING_HEADER = _XC_CONFIG.context.onBoarding.header;
1297        }
1298    }
1299}
1300
1301function initializeElementConstant() {
1302    TEMPLATE_CONSTANTS.ELEMENT_ID = {
1303        UNAME              : 'uname',
1304        UNAME_LOGIN_LINK_ID: 'unameLoginLink',
1305        SIGNATURE          : 'signature'
1306    };
1307
1308    if (_XC_CONFIG.terms_condition_text === undefined || _XC_CONFIG.terms_condition_text === null || _XC_CONFIG.terms_condition_text === "" || _XC_CONFIG.terms_condition_text.trim() === "") {
1309        TEMPLATE_CONSTANTS.TITLE.BANNER.TERMS_POLICY_TITLE = TEMPLATE_CONSTANTS.TITLE.BANNER.TERMS_POLICY_LEFT_TITLE_START.str;
1310        TEMPLATE_CONSTANTS.TITLE.BANNER.TERMS_POLICY_TITLE += " <u><a  href =" + _XC_CONFIG.copyright.TandC_url + " target=\"_blank\">" + TEMPLATE_CONSTANTS.TITLE.BANNER.TERMS_OF_USE.str + "</a> </u>" + TEMPLATE_CONSTANTS.TITLE.BANNER.AND.str + " <u><a href =" + _XC_CONFIG.copyright.privacyPolicyUrl + " target=\"_blank\">" + TEMPLATE_CONSTANTS.TITLE.BANNER.PRIVACY_POLICY.str + "</a></u>";
1311    } else {
1312        TEMPLATE_CONSTANTS.TITLE.BANNER.TERMS_POLICY_TITLE = XCLOUD.i18n(_XC_CONFIG.terms_condition_text, 'text');
1313    }
1314    //check if subscription title is present in admin or JSON. If not, use default message
1315    //priority of subscription title : Json > admin > code
1316    if (_XC_CONFIG.marketing_subscription_text === undefined || _XC_CONFIG.marketing_subscription_text === null || _XC_CONFIG.marketing_subscription_text === "" || _XC_CONFIG.marketing_subscription_text.trim() === "") {
1317        // if Soft opt in enabled from admin use different title
1318        // if (!_XC_CONFIG.GDPR.softOptinEnabled) {
1319            TEMPLATE_CONSTANTS.TITLE.BANNER.SUBSCRIPTION_TITLE = "<span class='sub-title-start'>" + TEMPLATE_CONSTANTS.TITLE.BANNER.SUBSCRIPTION_TITLE_START.str + "</span>";
1320            TEMPLATE_CONSTANTS.TITLE.BANNER.SUBSCRIPTION_TITLE += " <b>" + _XC_CONFIG.org_name + "</b>. ";
1321            TEMPLATE_CONSTANTS.TITLE.BANNER.SUBSCRIPTION_TITLE += "<span class='sub-title-end'>" + TEMPLATE_CONSTANTS.TITLE.BANNER.SUBSCRIPTION_TITLE_END.str + "</span>";
1322            TEMPLATE_CONSTANTS.TITLE.BANNER.SUBSCRIPTION_TITLE = XCLOUD.i18n(TEMPLATE_CONSTANTS.TITLE.BANNER.SUBSCRIPTION_TITLE, 'text');
1323        // } else {
1324        //     TEMPLATE_CONSTANTS.TITLE.BANNER.SUBSCRIPTION_TITLE = "<span class='sub-title-start'>" + TEMPLATE_CONSTANTS.TITLE.BANNER.SUBSCRIPTION_SOFT_OPT_IN_TITLE.str + "</span>";
1325        //     TEMPLATE_CONSTANTS.TITLE.BANNER.SUBSCRIPTION_TITLE += " <b>" + _XC_CONFIG.org_name + "</b>. ";
1326        // }
1327    } else {
1328        TEMPLATE_CONSTANTS.TITLE.BANNER.SUBSCRIPTION_TITLE = XCLOUD.i18n(_XC_CONFIG.marketing_subscription_text, 'text');
1329    }
1330
1331    TEMPLATE_CONSTANTS.TITLE.BANNER.INTERVIEW_SESSION_TEXT = TEMPLATE_CONSTANTS.TITLE.BANNER.INTERVIEW_SESSION_TEXT_START.str;
1332    TEMPLATE_CONSTANTS.TITLE.BANNER.INTERVIEW_SESSION_TEXT += "<strong>" +_XC_CONFIG.org_name + "</strong>";
1333    TEMPLATE_CONSTANTS.TITLE.BANNER.INTERVIEW_SESSION_TEXT += TEMPLATE_CONSTANTS.TITLE.BANNER.INTERVIEW_SESSION_TEXT_END.str;
1334
1335    TEMPLATE_CONSTANTS.TITLE.BANNER.SLOT_INVITE_TEXT = TEMPLATE_CONSTANTS.TITLE.BANNER.SLOT_INVITE_TEXT_START.str;
1336    TEMPLATE_CONSTANTS.TITLE.BANNER.SLOT_INVITE_TEXT += "<strong>" +_XC_CONFIG.org_name + "</strong>";
1337    TEMPLATE_CONSTANTS.TITLE.BANNER.SLOT_INVITE_TEXT += TEMPLATE_CONSTANTS.TITLE.BANNER.SLOT_INVITE_TEXT_END.str;
1338
1339    TEMPLATE_CONSTANTS.VALIDATION.PREVENT_LOGIN = TEMPLATE_CONSTANTS.VALIDATION.PREVENT_LOGIN_START.str;
1340    var applicationLink = localStorage.getItem(_XC_CONFIG.org + '.' + 'applicationURL');
1341    if (applicationLink !== null) {
1342        TEMPLATE_CONSTANTS.VALIDATION.PREVENT_LOGIN += " <br><u><a  href =" + applicationLink + ">" + TEMPLATE_CONSTANTS.VALIDATION.PREVENT_LOGIN_LINK.str + " </a> </u>";
1343    }
1344
1345    //unsubscribe
1346    if (_XC_CONFIG.unsubscribe_heading) {
1347        TEMPLATE_CONSTANTS.TITLE.BANNER.UNSUBSCRIBE_HEADING.str = XCLOUD.i18n(_XC_CONFIG.unsubscribe_heading, 'text')
1348    }
1349    if (_XC_CONFIG.unsubscribe_successful !== null && _XC_CONFIG.unsubscribe_successful !== "" && _XC_CONFIG.unsubscribe_successful.length > 0) {
1350        TEMPLATE_CONSTANTS.TITLE.BANNER.UNSUBSCRIBE_SUCCESS_HEADER.str = XCLOUD.i18n(_XC_CONFIG.unsubscribe_successful, 'text')
1351    }
1352    if (_XC_CONFIG.unsubscribe_failed_valid_email !== null && _XC_CONFIG.unsubscribe_failed_valid_email !== "" && _XC_CONFIG.unsubscribe_failed_valid_email.length > 0) {
1353        TEMPLATE_CONSTANTS.TITLE.BANNER.UNSUBSCRIBE_FAILED_HEADER.str = XCLOUD.i18n(_XC_CONFIG.unsubscribe_failed_valid_email, 'text')
1354        TEMPLATE_CONSTANTS.TITLE.BANNER.UNSUBSCRIBE_FAILED_HEADER_LOGINLESS.str = XCLOUD.i18n(_XC_CONFIG.unsubscribe_failed_valid_email, 'text')
1355    }
1356    if (_XC_CONFIG.unsubscribe_invalid_email !== null && _XC_CONFIG.unsubscribe_invalid_email !== "" && _XC_CONFIG.unsubscribe_invalid_email.length > 0) {
1357        TEMPLATE_CONSTANTS.TITLE.BANNER.UNSUBSCRIBE_EMAIL_INVALID.str = XCLOUD.i18n(_XC_CONFIG.unsubscribe_invalid_email, 'text')
1358    }
1359    if (_XC_CONFIG.candidate_creation_failed_msg !== null && _XC_CONFIG.candidate_creation_failed_msg !== "" && _XC_CONFIG.candidate_creation_failed_msg.length > 0) {
1360        TEMPLATE_CONSTANTS.VALIDATION.CREATE_CANDIDATE_ERROR.str = XCLOUD.i18n(_XC_CONFIG.candidate_creation_failed_msg, 'text')
1361    }
1362    if (_XC_CONFIG.subscription_settings_heading !== null && _XC_CONFIG.subscription_settings_heading !== undefined && _XC_CONFIG.subscription_settings_heading !== "" && _XC_CONFIG.subscription_settings_heading.length > 0) {
1363        TEMPLATE_CONSTANTS.TITLE.BANNER.SUBSCRIPTION_SETTINGS_HEADING.str = XCLOUD.i18n(_XC_CONFIG.subscription_settings_heading, 'text') 
1364    }
1365    if (_XC_CONFIG.subscription_settings_subheading !== null && _XC_CONFIG.subscription_settings_subheading !== undefined && _XC_CONFIG.subscription_settings_subheading !== "" && _XC_CONFIG.subscription_settings_subheading.length > 0) {
1366        TEMPLATE_CONSTANTS.TITLE.BANNER.SUBSCRIPTION_SETTINGS_SUBHEADING.str = XCLOUD.i18n(_XC_CONFIG.subscription_settings_subheading, 'text')
1367    }
1368
1369    if(typeof _XC_CONFIG.context.confirmation !== 'undefined') {
1370        if (_XC_CONFIG.context.confirmation.trim() === '') {
1371            _XC_CONFIG.context.confirmation = '<p>By selecting the \'Submit Application\' button, I agree to the following:</p>' +
1372                '<p>I certify that the information contained in this application is true and complete to the best of my knowledge and understand that any misrepresentation, omission of facts, or misleading information is ground for refusal to hire, or if hired, dismissal.</p>' +
1373                '<p>I understand that every aspect of my employment with Symphony Talent, LLC ("the Company") shall be on an "at will" basis, meaning that I or the Company may terminate my employment at any time, or any reason, with or without cause. I also understand that the Company expressly reserves its inherent authority to manage and control the business enterprise and to exercise its sole discretion to determine all issues pertaining to my employment, including all matters pertaining to promotion, job assignment, and the size of the workforce, demotion, transfer and discipline. I further understand and agree that no one other than the President of the Company may modify or change the "at-will" nature of my employment relationship. Any such modifications must be in 
1373writing and signed by the President of the Company and me to be effective.</p>' +
1374                '<p>It is my understanding that my employment at the Company is contingent upon completion of a satisfactory background investigation, reference checks and verification of proof of work eligibility. A negative reference or report may or may not prevent me from working at the Company. However, the reference or report will be evaluated as to its effect upon my employment.</p>';
1375        }
1376    }
1377
1378    if (_XC_CONFIG.context.confirmation && _XC_CONFIG.context.confirmation.length > 0) {
1379        _XC_CONFIG.context.confirmation = XCLOUD.i18n(_XC_CONFIG.context.confirmation, 'text');
1380    }
1381
1382    if (_XC_CONFIG.context.conviction && _XC_CONFIG.context.conviction.length > 0) {
1383        _XC_CONFIG.context.conviction = XCLOUD.i18n(_XC_CONFIG.context.conviction, 'text');
1384    }
1385
1386    if (_XC_CONFIG.context.eeo && _XC_CONFIG.context.conviction.eeo > 0) {
1387        _XC_CONFIG.context.eeo = XCLOUD.i18n(_XC_CONFIG.context.eeo, 'text');
1388    }
1389
1390    if (_XC_CONFIG.context.noThanks && _XC_CONFIG.context.conviction.noThanks > 0) {
1391        _XC_CONFIG.context.noThanks = XCLOUD.i18n(_XC_CONFIG.context.noThanks, 'text');
1392    }
1393
1394    if (typeof (XCLOUD) !== 'undefined') {
1395        if (typeof (XCLOUD.apply_filter) === 'function') {
1396            // Apply filter
1397            TEMPLATE_CONSTANTS = XCLOUD.apply_filter('xcc_template_constant', TEMPLATE_CONSTANTS, _XC_CONFIG);
1398
1399            /*Add filter can be used in wordpress script as below
1400            XCLOUD.add_filter('xcc_template_constant', function (tpl_const, xcc_config) { // code goes here.... });*/
1401        }
1402    }
1403}
1404
1405/**
1406 * Created by TDadam on 12/21/2017.
1407 */
1408window.BROAD_CAST_NAMESPACE = {
1409        SCHEMA_FORM_VALIDATE : 'schemaFormValidate',
1410        CURRENT_CANDIDATE_FETCHED: 'CurrentCandidateDetailsFetched',
1411        UPDATE_CANDIDATE_SCOPE: 'UpdateCandidateScope',
1412        GET_CANDIDATE_ACTIVITY: 'getCandidateActivityViewModel',
1413        CANDIDATE_ACTIVITY_VM_REFRESH:'refreshCandidateActivityViewModel',
1414        SCHEMA_UI_SELECT_NGMODEL_PROPAGATION:'schema.ui.multi.select.ngModelPropagation',
1415        SCHEMA_MULTISELECT_DROPDOWN_NGMODEL_PROPAGATION:'schema.multi.select.dropdown.ngModelPropagation',
1416        DASHBOARD_ATTACHMENT_VM_REFRESH:'refreshDashboardAttachmentViewModalService',
1417        PROFILE_UPDATED:'profileUpdated',
1418        UNUPLOADED_ATTACHMENT_CLEAR:'applyClearUnuploadedAttachment'
1419    };
1420/**
1421 * Created by TDadam on 12/21/2017.
1422 */
1423var ERROR_CONFIGURATION = {};
1424
1425initializeErrorCodes();
1426initializeErrorPrefix();
1427initializeErrorDescription();
1428
1429function initializeErrorCodes() {
1430    ERROR_CONFIGURATION.CODES = {
1431        VALIDATION: {
1432            EMAIL_EXISTENCE: '9001',
1433            ZIP_LOOKUP     : '9002',
1434            SIGNATURE_MATCH: '9003'
1435        }
1436    };
1437}
1438
1439function initializeErrorPrefix() {
1440    ERROR_CONFIGURATION.PREFIX = {
1441        VALIDATION : {
1442            SCHEMA_ERROR         : 'schemaForm.error.'
1443        }
1444    };
1445    ERROR_CONFIGURATION.PREFIX.VALIDATION.UNAME_EMAIL_EXISTENCE = ERROR_CONFIGURATION.PREFIX.VALIDATION.SCHEMA_ERROR + TEMPLATE_CONSTANTS.ELEMENT_ID.UNAME;
1446    ERROR_CONFIGURATION.PREFIX.VALIDATION.SIGNATURE_MATCH = ERROR_CONFIGURATION.PREFIX.VALIDATION.SCHEMA_ERROR + TEMPLATE_CONSTANTS.ELEMENT_ID.SIGNATURE;
1447}
1448
1449function initializeErrorDescription() {
1450    /*ERROR_CONFIGURATION.DESCRIPTION = {
1451        VALIDATION : {
1452            RESUME: {
1453                INVALID_CONTENT          : XCLOUD.i18n("Attachment content type is invalid", TEMPLATE_CONSTANTS.FIELD_TYPES.VALIDATION),
1454                IN_COMPATIBLE_FILE_FORMAT: XCLOUD.i18n("Unsupported file format", TEMPLATE_CONSTANTS.FIELD_TYPES.VALIDATION),
1455                FILE_SIZE_EXCEED         : XCLOUD.i18n("Exceeded file size", TEMPLATE_CONSTANTS.FIELD_TYPES.VALIDATION)
1456            },
1457            FORMS : {
1458                INCOMPLETE : XCLOUD.i18n("Please complete following forms to continue", TEMPLATE_CONSTANTS.FIELD_TYPES.VALIDATION)
1459            }
1460        }
1461    }*/
1462}
1463/**
1464 * Created by TDadam on 12/21/2017.
1465 */
1466var STORAGE_KEY = {};
1467var STORAGE_TYPE_ENUM = {
1468    IN_MEMORY: 0,
1469    LOCAL    : 1,
1470    SESSION  : 2
1471};
1472
1473initializeStorageKey();
1474
1475function initializeStorageKey() {
1476    STORAGE_KEY.SCHEMA_LOGIN_REDIRECT = 'schemaLoginRedirect'
1477}
1478
1479/**
1480 * Created by TDadam on 12/17/2017.
1481 */
1482
1483/**
1484 *@name Parser Helper
1485 * @type {{isStringEmpty: Parser.isStringEmpty}}
1486 */
1487var PARSER_HELPER = {
1488    /**
1489     *
1490     * @param object
1491     * @returns {boolean} returns true in case string is empty
1492     */
1493    isStringEmpty : function (object) {
1494        return (object === undefined || object === null || object.length === 0);
1495    }
1496};
1497'use strict';
1498
1499var CUSTOM_FIELDS_TEMPLATES = '/wp-content/plugins/xcloud/app/templates/';
1500
1501// Define our directive
1502angular.module('com.hrlogix.ats.customfields', [ 'com.hrlogix.ats.global.services',
1503                                                 'com.hrlogix.ats.public.services' ])
1504
1505    .controller('customFieldMainController', ['$scope', 'metadata', function ($scope, metadata) {
1506              
1507    initialize();
1508
1509    function initialize() {
1510        
1511        $scope.customFields = [];
1512
1513        if ($scope.type !== undefined && $scope.type !== null && $scope.type !== "") {
1514            
1515            metadata.getTableMetadata({table: $scope.type}).$promise.then(function(results) {
1516                
1517                $scope.customFields = normalizeObjects(results);
1518
1519                for (var key in $scope.customFields) {
1520                    $scope.customFields[key].visualPrefs = angular.fromJson($scope.customFields[key].visualPrefs);
1521                }
1522
1523                for (var key in $scope.ngModel) {
1524                    for (var innerKey in $scope.customFields) {
1525                        if (key === $scope.customFields[innerKey].columnName) {
1526                            $scope.customFields[innerKey].result = $scope.ngModel[key];
1527                        }
1528                    }
1529                }
1530
1531                $scope.results = $scope.customFields;
1532
1533            }, function(reason) {
1534                hasError(reason.statusText);
1535            });
1536        }
1537
1538    }   
1539
1540}]).controller('customFieldController', ['$scope', 'lists', function ($scope, lists) {
1541        
1542    initialize();
1543    
1544    $scope.getTemplateUrl = function() { 
1545
1546        switch($scope.field.visualPrefs.type) {
1547            case 'radio':
1548                return CUSTOM_FIELDS_TEMPLATES + 'radio.html';
1549            case 'textarea':
1550                return CUSTOM_FIELDS_TEMPLATES + 'textarea.html';
1551            case 'text':
1552            case 'textbox':
1553                return CUSTOM_FIELDS_TEMPLATES + 'text.html';
1554            default:
1555                return CUSTOM_FIELDS_TEMPLATES + 'blank.html';
1556        }
1557    };
1558
1559    function initialize() {
1560        if ($scope.field.visualPrefs.list !== undefined 
1561            && $scope.field.visualPrefs.list !== null 
1562            && $scope.field.visualPrefs.list !== '') {
1563            
1564            lists.getActiveListByName({ name: $scope.field.visualPrefs.list }).$promise.then(function(results) {
1565                $scope.field.list = normalizeObjects(results);
1566            }, function(reason) {           
1567                hasError(reason.statusText); 
1568            });
1569        }  
1570
1571    }   
1572
1573}]).directive('customFields', function () {
1574    return {
1575        restrict: 'E',
1576        scope: {
1577            type: "=",
1578            ngModel: "=",
1579            results: "="
1580        },
1581        replace: true,
1582        transclude: true,
1583        controller: 'customFieldMainController',
1584        templateUrl: CUSTOM_FIELDS_TEMPLATES + 'custom-fields.html'
1585    };
1586}).directive('customField', function() {  
1587    return {
1588        restrict: 'E',
1589        scope: { 
1590           field: '='
1591        },
1592        replace: true,
1593        transclude: false,
1594        controller: 'customFieldController',
1595        template: '<ng-include src="getTemplateUrl()"/>'
1596    };
1597});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.