<fim-prefix><fim-middle>  .                             .o8                     oooo
 *    .o8                             "888                     `888
 *  .o888oo oooo d8b oooo  oooo   .oooo888   .ooooo.   .oooo.o  888  oo<fix-suffix>oo
 *    888   `888""8P `888  `888  d88' `888  d88' `88b d88(  "8  888 .8P'
 *    888    888      888   888  888   888  888ooo888 `"Y88b.   888888.
 *    888 .  888      888   888  888   888  888    .o o.  )88b  888 `88b.
 *    "888" d888b     `V88V"V8P' `Y8bod88P" `Y8bod8P' 8""888P' o888o o888o
 *  ========================================================================
 *  Author:     Chris Brame
 *  Updated:    1/20/19 4:43 PM
 *  Copyright (c) 2014-2019. All rights reserved.
 */

define([
  'angular',
  'underscore',
  'jquery',
  'modules/helpers',
  'uikit',
  'qrcode',
  'history',
  'angularjs/services/session'
], function (angular, _, $, helpers, UIKit) {
  return angular
    .module('trudesk.controllers.profile', ['trudesk.services.session'])
    .controller('profileCtrl', function (SessionService, $scope, $window, $document, $http, $log, $timeout) {
      var otpEnabled = false
      $scope.init = function () {
        // Fix Inputs if input is preloaded with a value
        fixInputLabels()
        otpEnabled = $scope.otpEnabled
      }

      function fixInputLabels () {
        $timeout(function () {
          $('input.md-input').each(function () {
            var vm = this
            var self = $(vm)
            if (!_.isEmpty(self.val())) {
              var s = self.parent('.md-input-wrapper')
              if (s.length > 0) {
                s.addClass('md-input-filled')
              }
            }
          })
        }, 0)
      }

      function valida<|endoftext|>