import angular from 'angular';
import angularSvgRoundProgressBar from 'angular-svg-round-progressbar';

// Polyfills for ES6 stuff required by autonumeric 4.
// Really these should be peer deps. But until we are
// no longer consumed using bower we have to make sure
// our bundle includes the functionality.
import 'core-js/es6/map';
import 'core-js/es6/weak-map';

import './index.scss';

import filterModule from './filters';
import formModule from './form';
import formattingModule from './formatting';
import layoutModule from './layout';
import progressCheckmarkModule from './progress-checkmark';
import twoPartAllocationBarModule from './two-part-allocation-bar';
import translationsModule from './translations';
import signaturePad from './signature-pad';

const injectorName = 'ws.common';
export default injectorName;

angular.module(injectorName, [
  'ngAnimate',
  'pascalprecht.translate',
  angularSvgRoundProgressBar,
  translationsModule,
  filterModule,
  formModule,
  formattingModule,
  layoutModule,
  progressCheckmarkModule,
  twoPartAllocationBarModule,
  signaturePad,
])
.config(WsCommonModuleConfig);

WsCommonModuleConfig.$inject = ['$translateProvider'];
function WsCommonModuleConfig($translateProvider) {
  $translateProvider.preferredLanguage('en_CA');
  $translateProvider.useSanitizeValueStrategy('escapeParameters');
}
