Free javascript Hosting


everfi-sdk.js

Uploaded on Apr 04 2022 04:48 by test

(function() {
'use strict';

var globals = typeof global === 'undefined' ? self : global;
if (typeof globals.require === 'function') return;

var modules = {};
var cache = {};
var aliases = {};
var has = {}.hasOwnProperty;

var expRe = /^\.\.?(\/|$)/;
var expand = function(root, name) {
var results = [], part;
var parts = (expRe.test(name) ? root + '/' + name : name).split('/');
for (var i = 0, length = parts.length; i < length; i++) {
part = parts[i];
if (part === '..') {
results.pop();
} else if (part !== '.' && part !== '') {
results.push(part);
}
}
return results.join('/');
};

var dirname = function(path) {
return path.split('/').slice(0, -1).join('/');
};

var localRequire = function(path) {
return function expanded(name) {
var absolute = expand(dirname(path), name);
return globals.require(absolute, path);
};
};

var initModule = function(name, definition) {
var hot = hmr && hmr.createHot(name);
var module = {id: name, exports: {}, hot: hot};
cache[name] = module;
definition(module.exports, localRequire(name), module);
return module.exports;
};

var expandAlias = function(name) {
var val = aliases[name];
return (val && name !== val) ? expandAlias(val) : name;
};

var _resolve = function(name, dep) {
return expandAlias(expand(dirname(name), dep));
};

var require = function(name, loaderPath) {
if (loaderPath == null) loaderPath = '/';
var path = expandAlias(name);

if (has.call(cache, path)) return cache[path].exports;
if (has.call(modules, path)) return initModule(path, modules[path]);

throw new Error("Cannot find module '" + name + "' from '" + loaderPath + "'");
};

require.alias = function(from, to) {
aliases[to] = from;
};

var extRe = /\.[^.\/]+$/;
var indexRe = /\/index(\.[^\/]+)?$/;
var addExtensions = function(bundle) {
if (extRe.test(bundle)) {
var alias = bundle.replace(extRe, '');
if (!has.call(aliases, alias) || aliases[alias].replace(extRe, '') === alias + '/index') {
aliases[alias] = bundle;
}
}

if (indexRe.test(bundle)) {
var iAlias = bundle.replace(indexRe, '');
if (!has.call(aliases, iAlias)) {
aliases[iAlias] = bundle;
}
}
};

require.register = require.define = function(bundle, fn) {
if (bundle && typeof bundle === 'object') {
for (var key in bundle) {
if (has.call(bundle, key)) {
require.register(key, bundle[key]);
}
}
} else {
modules[bundle] = fn;
delete cache[bundle];
addExtensions(bundle);
}
};

require.list = function() {
var list = [];
for (var item in modules) {
if (has.call(modules, item)) {
list.push(item);
}
}
return list;
};

var hmr = globals._hmr && new globals._hmr(_resolve, require, modules, cache);
require._cache = cache;
require.hmr = hmr && hmr.wrap;
require.brunch = true;
globals.require = require;
})();

(function() {
var global = typeof window === 'undefined' ? this : window;
var __makeRelativeRequire = function(require, mappings, pref) {
var none = {};
var tryReq = function(name, pref) {
var val;
try {
val = require(pref + '/node_modules/' + name);
return val;
} catch (e) {
if (e.toString().indexOf('Cannot find module') === -1) {
throw e;
}

if (pref.indexOf('node_modules') !== -1) {
var s = pref.split('/');
var i = s.lastIndexOf('node_modules');
var newPref = s.slice(0, i).join('/');
return tryReq(name, newPref);
}
}
return none;
};
return function(name) {
if (name in mappings) name = mappings[name];
if (!name) return;
if (name[0] !== '.' && pref) {
var val = tryReq(name, pref);
if (val !== none) return val;
}
return require(name);
}
};
require.register("collections/block_collection.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _block = _interopRequireDefault(require("models/block"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var BlocksCollection = _chaplin.default.Collection.extend({
model: _block.default
});

var _default = BlocksCollection;
exports.default = _default;
});

require.register("controllers/base/controller.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _siteView = _interopRequireDefault(require("views/site/site-view"));

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _ef = _interopRequireDefault(require("ef/ef"));

/**
* Chaplin create the route controller as a new object, based on a class,
* EsModules add the default property to the exported class, making the instansiation of the Controller
* inaccesible
* @see https://github.com/chaplinjs/chaplin/blob/49bc7d6a325f7d0d9c4ba2a497773c0cf40be5b1/src/chaplin/dispatcher.coffee#L96
*
* please keep controllers as requirejs modules
*/
var _default = _chaplin.default.Controller.extend({
// Place your application-specific controller features here.
beforeAction: function beforeAction(params, route, options) {
var model = _courseSettingsService.default.getModel();

model.set('showDev', _ef.default.options.local || options.query.showDev);
model.set('controller', route.controller);
var view = this.reuse('site', _siteView.default, {
model: model,
container: _courseSettingsService.default.get('container') || 'body'
});
(view.refresh || Function).call(view);
}
});

exports.default = _default;
});

require.register("controllers/index.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _controller = _interopRequireDefault(require("controllers/base/controller"));

var _menuController = _interopRequireDefault(require("controllers/menu-controller"));

var _pageController = _interopRequireDefault(require("controllers/page-controller"));

var _reloadController = _interopRequireDefault(require("controllers/reload-controller"));

var _default = {
BaseController: _controller.default,
MenuController: _menuController.default,
PageController: _pageController.default,
ReloadControler: _reloadController.default
};
exports.default = _default;
});

require.register("controllers/menu-controller.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _menu = _interopRequireDefault(require("models/menu"));

var _menuView = _interopRequireDefault(require("views/menu/menu-view"));

var _contentService = _interopRequireDefault(require("services/loader-handler-services/content-service"));

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var _menuService = _interopRequireDefault(require("services/course-handler-services/menu-service"));

var _webStorageService = require("services/data-handler-services/web-storage-service");

var _utils = _interopRequireDefault(require("lib/utils"));

var _controller = _interopRequireDefault(require("./base/controller"));

var _lodash = _interopRequireDefault(require("lodash"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _default = _controller.default.extend({
show: function show(params, route, options) {
var _this = this;

_webStorageService.SessionStorageService.setItem('queryParams', options.query);

var defaults = {
homePage: 'home',
type: 'module',
//module menu
groups: false // forces order at the group level.

};

var menuSettings = _courseSettingsService.default.get('menu');

_lodash.default.defaults(menuSettings, defaults);

if (options.query.group) {
_menuService.default.currentGroup = _ef.default.groups.find({
id: parseInt(options.query.group)
});
} else {
_menuService.default.currentGroup = null;
}

var page = params.page || menuSettings.homePage;
var onHomePage = page === menuSettings.homePage;

if (_courseSettingsService.default.get('menuOverride') && onHomePage) {
var menuOverride = _courseSettingsService.default.get('menuOverride');

if (menuOverride && menuOverride.postMessage) {
window.postMessage({
event_type: menuOverride.postMessage
}, '*');
} else {
window.location = menuOverride;
}

return;
}

var menu = new _menu.default(menuSettings);

if (onHomePage) {
menu.set('dialog', true);
}

if (menu.get('skip')) {
var firstIncomplete = _ef.default.modules.getFirstAvailable(menuSettings);

if (!firstIncomplete && _ef.default.module === _ef.default.modules.last()) {
window.postMessage({
event_type: 'close-content'
}, '*');
} else {
_utils.default.redirectToModule(firstIncomplete);
}
} else {
menu.set('key', page);

_contentService.default.applyContentAndLocale(menu, "menu.".concat(page)).then(function () {
_contentService.default.addForgePathsToPage(menu, ".menu.".concat(page));

if (menu.get('groups') && !_ef.default.enrollment.get('demoMode')) {
_ef.default.groups.lockGroups(menu.get('lockPastGroups'), _menuService.default.getUnlockDay());
}

_menuService.default.autoPlay();

if (Object.isExtensible(_this)) {
_this.view = new _menuView.default({
className: "menu ".concat(page),
model: menu,
region: 'main'
});
} else {
return;
}
});
}
}
});

exports.default = _default;
});

require.register("controllers/page-controller.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _pageView = _interopRequireDefault(require("views/page/page-view"));

var _pageService = _interopRequireDefault(require("services/page-service"));

var _webStorageService = require("services/data-handler-services/web-storage-service");

var _localeService = _interopRequireDefault(require("services/loader-handler-services/locale-service"));

var _controller = _interopRequireDefault(require("controllers/base/controller"));

var _jquery = _interopRequireDefault(require("jquery"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _default = _controller.default.extend({
show: function show(params, route, options) {
var _this = this;

if (params.module && _jquery.default.isNumeric(params.module.charAt(0))) {
// eslint-disable-next-line no-console
console.warn('Module names cannot begin with a number. Rename the module such that the first character is not a number');
}

_pageService.default.loadPage(params.module, params.activity, params.page).then(function (page) {
_webStorageService.SessionStorageService.setItem('queryParams', options.query);

if (_pageService.default.preventSkippingPages(page, params)) {
var linkedPage = page.get('link');
var previouslyCompleted = page.get('completed') ? 'previously-completed' : '';
var userSpecifiedClass = page.get('class') || '';
var className = linkedPage ? "".concat(linkedPage.page, " ").concat(linkedPage.activity, " ").concat(linkedPage.module, " ").concat(previouslyCompleted, " ").concat(userSpecifiedClass, " ").concat(_localeService.default.getLanguage()) : "".concat(page.get('key'), " ").concat(page.get('activityKey'), " ").concat(page.get('moduleKey'), " ").concat(previouslyCompleted, " ").concat(userSpecifiedClass, " ").concat(_localeService.default.getLanguage());

if (page.get('transition') && !page.get('transition-in')) {
//console.log(`rendering ${page.get('key')} without transition-in; setting transition-in to ${page.get('transition-in')}`);
page.set('transition-in', 'forward');
}

if (Object.isExtensible(_this)) {
_this.view = new _pageView.default({
region: 'main',
model: page,
className: className
}); //TODO: revisit trying to reuse the actionbarview, was moved to the page-view.play
//this.reuse('actionbar', ActionBarView, {region: 'actionbar'});

_chaplin.default.mediator.subscribeOnce('page:initialized', function () {
_this.view.play();
});
} else {
return;
}
}
});
}
});

exports.default = _default;
});

require.register("controllers/reload-controller.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _webStorageService = require("services/data-handler-services/web-storage-service");

var _controller = _interopRequireDefault(require("controllers/base/controller"));

var _backbone = _interopRequireDefault(require("backbone"));

var _default = _controller.default.extend({
index: function index() {
var originFragment = _webStorageService.LocalStorageService.getItem('originFragment');

if (originFragment) {
this.redirectTo({
url: originFragment
});
} else {
this.redirectTo({
url: ''
});
}

_backbone.default.history.start(); // stopped by navigation-service so the reload route is not in the history


_webStorageService.LocalStorageService.removeItem('originFragment');
}
});

exports.default = _default;
});

require.register("developer/views/toolbar/assessment-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _ef = _interopRequireDefault(require("ef/ef"));

var _view = _interopRequireDefault(require("views/base/view"));

var _assessmentService = _interopRequireDefault(require("services/data-handler-services/assessment-service"));

var _progressService = _interopRequireDefault(require("services/course-handler-services/progress-service"));

var _assessment = _interopRequireDefault(require("./templates/assessment"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _lodash = _interopRequireDefault(require("lodash"));

var AssessmentView = _view.default.extend({
autoRender: true,
autoAttach: true,
template: _assessment.default,
className: 'panel panel-default',
listen: {
addedToDOM: 'loaded'
},
render: function render() {
var model = {
assessments: []
};
model.assessments = _ef.default.modules.reduce(function (memo, mod) {
if (mod.get('assessment_slug')) {
var aps = _assessmentService.default.getActivityProgressForSlug(mod.get('assessment_slug'), true);

memo.push({
slug: mod.get('assessment_slug'),
moduleKey: mod.get('key'),
progress: aps.length > 0,
passed: aps ? _lodash.default.some(aps, function (ap) {
return ap.get('passed');
}) : false
});
}

if (mod.get('pre_assessment_slug')) {
var _aps = _assessmentService.default.getActivityProgressForSlug(mod.get('pre_assessment_slug'), true);

memo.push({
slug: mod.get('pre_assessment_slug'),
moduleKey: mod.get('key'),
progress: _aps.length > 0,
passed: _aps ? _lodash.default.some(_aps, function (ap) {
return ap.get('passed');
}) : false
});
}

return memo;
}, []);
this.model = new _chaplin.default.Model(model);

_view.default.prototype.render.apply(this, arguments);
},
loaded: function loaded() {
var self = this;
this.delegate('click', '.btn-assess.bg-color-error-base', function (e) {
var button = e.currentTarget;
var slug = button.attributes['data-slug'].value;
var moduleKey = button.attributes['data-module'].value;

_progressService.default.removeLocalActivityProgress(slug, moduleKey).done(function () {
self.render();

_ef.default.activityProgresses.fetch();
});
});
this.delegate('click', '.btn-assess.btn-success', function (e) {
var button = e.currentTarget;
var moduleKey = button.attributes['data-module'].value;
var passed = !!button.attributes['data-pass'];

_progressService.default.saveLocalActivityProgress({
attempt: 1,
enrollment_id: _ef.default.enrollment.get('id'),
grade: passed ? 100 : 10,
passed: passed,
slug: button.attributes['data-slug'].value
}, moduleKey).done(function () {
self.render();

_ef.default.activityProgresses.fetch();
});
});
}
});

var _default = AssessmentView;
exports.default = _default;
});

require.register("developer/views/toolbar/course-map-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _ef = _interopRequireDefault(require("ef/ef"));

var _collectionView = _interopRequireDefault(require("views/base/collection-view"));

var _courseMap = _interopRequireDefault(require("./templates/course-map"));

var _courseModuleView = _interopRequireDefault(require("developer/views/toolbar/course-module-view"));

var _surveyView = _interopRequireDefault(require("developer/views/toolbar/survey-view"));

var _assessmentView = _interopRequireDefault(require("developer/views/toolbar/assessment-view"));

var CourseMapView = _collectionView.default.extend({
template: _courseMap.default,
itemView: _courseModuleView.default,
listSelector: '#accordion',
autoRender: true,
regions: {
survey: '#survey_pane',
assessment: '#assessment_pane'
},
listen: {
addedToDOM: 'loaded'
},
loaded: function loaded() {
if (_ef.default.options.local) {
var surveyView = new _surveyView.default({
region: 'survey'
});
this.subview('survey', surveyView);
var assessmentView = new _assessmentView.default({
region: 'assessment'
});
this.subview('assessment', assessmentView);
}
},
getTemplateData: function getTemplateData() {
return {
local: _ef.default.options.local
};
}
});

var _default = CourseMapView;
exports.default = _default;
});

require.register("developer/views/toolbar/course-module-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _ef = _interopRequireDefault(require("ef/ef"));

var _view = _interopRequireDefault(require("views/base/view"));

var _courseModule = _interopRequireDefault(require("./templates/course-module"));

var GRANT_MODIFIER = 'grant';
var REMOVE_MODIFIER = 'remove';

var CourseModuleView = _view.default.extend({
template: _courseModule.default,
className: 'panel panel-default',
listen: {
addedToParent: 'loaded'
},
loaded: function loaded() {
var _this = this;

var pageProgressHandler = function pageProgressHandler(event, modifier) {
var button = event.currentTarget;

var mod = _ef.default.modules.find({
key: button.attributes['data-module'].value
});

var act = mod.activities.find({
key: button.attributes['data-activity'].value
});
var page = act.pages.find({
key: button.attributes['data-page'].value
});

if (modifier === GRANT_MODIFIER) {
page.set('completed', true);
}

if (modifier === REMOVE_MODIFIER) {
mod.currentActivity = act;
var prevPage = mod.getPreviousPageByKey(page.get('key'));
mod.clearProgress();

if (prevPage) {
prevPage.set('completed', true);
}
}

_this.wasOpen = true;

_ef.default.ContentProvider.CourseModuleService.saveModuleProgress(_this, page, mod);
};

var moduleProgressHandler = function moduleProgressHandler(event, modifier) {
_this.wasOpen = _this.$('.collapse').hasClass('in');

var mod = _ef.default.modules.find({
key: event.currentTarget.attributes['data-module'].value
});

if (modifier === GRANT_MODIFIER) {
mod.completeAllPages();

_ef.default.ContentProvider.CourseModuleService.saveModule(mod);
}

if (modifier === REMOVE_MODIFIER) {
mod.clearProgress();
mod.save();
}

_this.render();
};

this.delegate('click', '.btn-progress.bg-color-success-base', function (e) {
pageProgressHandler(e, GRANT_MODIFIER);
});
this.delegate('click', '.btn-progress.bg-color-error-base', function (e) {
pageProgressHandler(e, REMOVE_MODIFIER);
});
this.delegate('click', '.progress-grant-all', function (e) {
moduleProgressHandler(e, GRANT_MODIFIER);
});
this.delegate('click', '.progress-remove-all', function (e) {
moduleProgressHandler(e, REMOVE_MODIFIER);
});
},
getTemplateData: function getTemplateData() {
var data = this.model.serialize();
data.wasOpen = this.wasOpen;
data.local = _ef.default.options.local;
return data;
}
});

var _default = CourseModuleView;
exports.default = _default;
});

require.register("developer/views/toolbar/guides-overlay-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));

var _view = _interopRequireDefault(require("views/base/view"));

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var _webStorageService = require("services/data-handler-services/web-storage-service");

var _guidesOverlay = _interopRequireDefault(require("./templates/guides-overlay"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _jquery = _interopRequireDefault(require("jquery"));

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

var GuidesOverlayView = /*#__PURE__*/function (_View) {
(0, _inherits2.default)(GuidesOverlayView, _View);

var _super = _createSuper(GuidesOverlayView);

function GuidesOverlayView(options) {
var _this;

(0, _classCallCheck2.default)(this, GuidesOverlayView);
_this = _super.call(this, options);
_this.autoRender = false;
_this.noWrap = true;

if (_courseSettingsService.default.get('guides')) {
var guides = _courseSettingsService.default.get('guides').filter(function (g) {
return g.enabled === true;
}).map(function (g) {
var clone = Object.assign({}, g);
delete clone.enabled;
return clone;
});

_this.model = new _chaplin.default.Model({
guides: guides
});
}

_this.subscribeEvent('addedToDOM', _this.load);

_webStorageService.SessionStorageService.setItem('overlayEnabled', true);

return _this;
}

(0, _createClass2.default)(GuidesOverlayView, [{
key: "load",
value: function load() {
var _this2 = this;

this.delegate('click', '.guides-close', function () {
_webStorageService.SessionStorageService.removeItem('overlayEnabled');

_this2.dispose();
});
}
}, {
key: "render",
value: function render() {
if (this.model) {
var template = _guidesOverlay.default;
this.$el = (0, _jquery.default)(template(this.model.attributes));
}
}
}, {
key: "attach",
value: function attach() {
(0, _jquery.default)('body').prepend(this.$el);
this.publishEvent('addedToDOM');
}
}]);
return GuidesOverlayView;
}(_view.default);

exports.default = GuidesOverlayView;
});

;require.register("developer/views/toolbar/survey-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _ef = _interopRequireDefault(require("ef/ef"));

var _view = _interopRequireDefault(require("views/base/view"));

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var _surveyService = _interopRequireDefault(require("services/data-handler-services/survey-service"));

var _progressService = _interopRequireDefault(require("services/course-handler-services/progress-service"));

var _survey = _interopRequireDefault(require("./templates/survey"));

var SurveyView = _view.default.extend({
autoRender: true,
autoAttach: true,
template: _survey.default,
className: 'panel panel-default',
listen: {
addedToDOM: 'loaded'
},
loaded: function loaded() {
var self = this;
this.delegate('click', '.btn-survey.bg-color-error-base', function (e) {
var button = e.currentTarget;
var surveySlug = button.attributes['data-survey'].value;

_progressService.default.removeLocalActivityProgress(surveySlug).done(function () {
return self.render();
});
});
this.delegate('click', '.btn-survey.bg-color-success-base', function (e) {
var button = e.currentTarget;

_progressService.default.saveLocalActivityProgress({
attempt: 1,
enrollment_id: _ef.default.enrollment.get('id'),
grade: null,
passed: true,
slug: button.attributes['data-survey'].value
}).done(function () {
return self.render();
});
});
},
getTemplateData: function getTemplateData() {
var model = {
surveys: []
};

if (_courseSettingsService.default.get('surveys')) {
_courseSettingsService.default.get('surveys').forEach(function (survey) {
model.surveys.push({
slug: survey,
progress: _surveyService.default.getActivityProgressForSlug(survey)
});
});
}

return model;
}
});

var _default = SurveyView;
exports.default = _default;
});

require.register("developer/views/toolbar/templates/assessment.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"1":function(container,depth0,helpers,partials,data) {
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <tr class=\"table__row\">\n <td class=\"table__cell\">"
+ alias4(((helper = (helper = lookupProperty(helpers,"slug") || (depth0 != null ? lookupProperty(depth0,"slug") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"slug","hash":{},"data":data,"loc":{"start":{"line":11,"column":34},"end":{"line":11,"column":42}}}) : helper)))
+ "</td>\n <td class=\"table__cell\">"
+ alias4(((helper = (helper = lookupProperty(helpers,"passed") || (depth0 != null ? lookupProperty(depth0,"passed") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"passed","hash":{},"data":data,"loc":{"start":{"line":12,"column":34},"end":{"line":12,"column":44}}}) : helper)))
+ "</td>\n <td class=\"table__cell\">\n"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"progress") : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.program(4, data, 0),"data":data,"loc":{"start":{"line":14,"column":12},"end":{"line":19,"column":19}}})) != null ? stack1 : "")
+ " </td>\n </tr>\n";
},"2":function(container,depth0,helpers,partials,data) {
var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <button class=\"btn btn-primary btn-compact btn-assess bg-color-error-base\" data-slug=\""
+ alias4(((helper = (helper = lookupProperty(helpers,"slug") || (depth0 != null ? lookupProperty(depth0,"slug") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"slug","hash":{},"data":data,"loc":{"start":{"line":15,"column":100},"end":{"line":15,"column":108}}}) : helper)))
+ "\" data-module=\""
+ alias4(((helper = (helper = lookupProperty(helpers,"moduleKey") || (depth0 != null ? lookupProperty(depth0,"moduleKey") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"moduleKey","hash":{},"data":data,"loc":{"start":{"line":15,"column":123},"end":{"line":15,"column":136}}}) : helper)))
+ "\">Remove</button>\n";
},"4":function(container,depth0,helpers,partials,data) {
var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <button class=\"btn btn-primary btn-compact btn-assess btn-success\" data-slug=\""
+ alias4(((helper = (helper = lookupProperty(helpers,"slug") || (depth0 != null ? lookupProperty(depth0,"slug") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"slug","hash":{},"data":data,"loc":{"start":{"line":17,"column":92},"end":{"line":17,"column":100}}}) : helper)))
+ "\" data-module=\""
+ alias4(((helper = (helper = lookupProperty(helpers,"moduleKey") || (depth0 != null ? lookupProperty(depth0,"moduleKey") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"moduleKey","hash":{},"data":data,"loc":{"start":{"line":17,"column":115},"end":{"line":17,"column":128}}}) : helper)))
+ "\" data-pass=\"true\">Pass</button>\n <button class=\"btn btn-primary btn-compact btn-assess btn-success\" data-slug=\""
+ alias4(((helper = (helper = lookupProperty(helpers,"slug") || (depth0 != null ? lookupProperty(depth0,"slug") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"slug","hash":{},"data":data,"loc":{"start":{"line":18,"column":92},"end":{"line":18,"column":100}}}) : helper)))
+ "\" data-module=\""
+ alias4(((helper = (helper = lookupProperty(helpers,"moduleKey") || (depth0 != null ? lookupProperty(depth0,"moduleKey") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"moduleKey","hash":{},"data":data,"loc":{"start":{"line":18,"column":115},"end":{"line":18,"column":128}}}) : helper)))
+ "\">Fail</button>\n";
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "<div id=\"panel_assessments\" class=\"panel-collapse collapse in\" role=\"tabpanel\" aria-labelledby=\"heading_assessments\">\n <div class=\"panel-body table-container\">\n <table class=\"table\">\n <tr class=\"table__row\">\n <th class=\"table__header\">Assessment Slug</th>\n <th class=\"table__header\">Passed</th>\n <th class=\"table__header\"></th>\n </tr>\n"
+ ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"assessments") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":9,"column":6},"end":{"line":22,"column":15}}})) != null ? stack1 : "")
+ " </table>\n </div>\n</div>\n";
},"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("developer/views/toolbar/templates/course-map.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"1":function(container,depth0,helpers,partials,data) {
return "\n <button href=\"#survey_pane\" id=\"survey_tab\" role=\"tab\" data-toggle=\"tab\" class=\"tabs__tab-bar-button\">\n <p class=\"tabs__tab-bar-button__text\">Surveys</p></button>\n\n\n <button href=\"#assessment_pane\" id=\"assessment_tab\" role=\"tab\" data-toggle=\"tab\" class=\"tabs__tab-bar-button\">\n <p class=\"tabs__tab-bar-button__text\">Assessments</p></button>\n\n\n <button href=\"#action_plan_pane\" id=\"action_plan_tab\" role=\"tab\" data-toggle=\"tab\" class=\"tabs__tab-bar-button\">\n <p class=\"tabs__tab-bar-button__text\">Action Plan</p></button>\n\n";
},"3":function(container,depth0,helpers,partials,data) {
return " <div role=\"tabpanel\" class=\"tabs__tab-content__tab-pane\" id=\"survey_pane\"></div>\n <div role=\"tabpanel\" class=\"tabs__tab-content__tab-pane\" id=\"assessment_pane\"></div>\n <div role=\"tabpanel\" class=\"tabs__tab-content__tab-pane\" id=\"action_plan_pane\"></div>\n";
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "<div class=\"tabs tab-vertical\">\n <div class=\"tabs__tab-bar tab-card has-4tabs\" role=\"tablist\">\n\n <button href=\"#page_pane\" id=\"page_tab\" role=\"tab\" data-toggle=\"tab\" class=\"tabs__tab-bar-button tabs__tab-bar-button--active\">\n <p class=\"tabs__tab-bar-button__text\">Page Progress</p></button>\n\n"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"local") : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":8,"column":6},"end":{"line":21,"column":13}}})) != null ? stack1 : "")
+ " </div>\n <div class=\"tabs__tab-content bg-color-neutral-200 border-width-sm\">\n <div role=\"tabpanel\" class=\"tabs__tab-content__tab-pane active\" id=\"page_pane\">\n <div class=\"panel-group\" id=\"accordion\" role=\"tablist\" aria-multiselectable=\"true\"></div>\n </div>\n"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"local") : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":28,"column":6},"end":{"line":32,"column":13}}})) != null ? stack1 : "")
+ " </div>\n </div>\n";
},"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("developer/views/toolbar/templates/course-module.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"1":function(container,depth0,helpers,partials,data) {
return " <button class=\"btn btn-compact btn-primary\" disabled=\"disabled\">Module Complete</button>\n";
},"3":function(container,depth0,helpers,partials,data) {
var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <button class=\"btn btn-primary btn-compact bg-color-success-base progress-grant-all\" data-module=\""
+ container.escapeExpression(((helper = (helper = lookupProperty(helpers,"key") || (depth0 != null ? lookupProperty(depth0,"key") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"key","hash":{},"data":data,"loc":{"start":{"line":11,"column":104},"end":{"line":11,"column":111}}}) : helper)))
+ "\">Grant Progress</button>\n";
},"5":function(container,depth0,helpers,partials,data) {
var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <button class=\"btn btn-primary btn-compact bg-color-error-base progress-remove-all\" data-module=\""
+ container.escapeExpression(((helper = (helper = lookupProperty(helpers,"key") || (depth0 != null ? lookupProperty(depth0,"key") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"key","hash":{},"data":data,"loc":{"start":{"line":14,"column":103},"end":{"line":14,"column":110}}}) : helper)))
+ "\">Clear Progress</button>\n";
},"7":function(container,depth0,helpers,partials,data) {
return "in";
},"9":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"pages") : depth0),{"name":"each","hash":{},"fn":container.program(10, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":28,"column":8},"end":{"line":47,"column":17}}})) != null ? stack1 : "");
},"10":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1, helper, alias1=container.lambda, alias2=container.escapeExpression, alias3=depth0 != null ? depth0 : (container.nullContext || {}), alias4=container.hooks.helperMissing, alias5="function", lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <tr class=\"table__row\">\n <td class=\"table__cell p-inset-xs\">"
+ alias2(alias1((depths[1] != null ? lookupProperty(depths[1],"key") : depths[1]), depth0))
+ "</td>\n <td class=\"table__cell p-inset-xs\"><a href=\"#"
+ alias2(alias1((depths[2] != null ? lookupProperty(depths[2],"key") : depths[2]), depth0))
+ "/"
+ alias2(alias1((depths[1] != null ? lookupProperty(depths[1],"key") : depths[1]), depth0))
+ "/"
+ alias2(((helper = (helper = lookupProperty(helpers,"key") || (depth0 != null ? lookupProperty(depth0,"key") : depth0)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"key","hash":{},"data":data,"loc":{"start":{"line":31,"column":82},"end":{"line":31,"column":89}}}) : helper)))
+ "\" data-close=\"true\" class=\"link\">"
+ alias2(((helper = (helper = lookupProperty(helpers,"key") || (depth0 != null ? lookupProperty(depth0,"key") : depth0)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"key","hash":{},"data":data,"loc":{"start":{"line":31,"column":122},"end":{"line":31,"column":129}}}) : helper)))
+ "</a></td>\n <td class=\"table__cell p-inset-xs\">"
+ alias2(((helper = (helper = lookupProperty(helpers,"completed") || (depth0 != null ? lookupProperty(depth0,"completed") : depth0)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"completed","hash":{},"data":data,"loc":{"start":{"line":32,"column":47},"end":{"line":32,"column":60}}}) : helper)))
+ "</td>\n <td class=\"table__cell p-inset-xs\">\n"
+ ((stack1 = lookupProperty(helpers,"if").call(alias3,(depth0 != null ? lookupProperty(depth0,"completed") : depth0),{"name":"if","hash":{},"fn":container.program(11, data, 0, blockParams, depths),"inverse":container.program(16, data, 0, blockParams, depths),"data":data,"loc":{"start":{"line":34,"column":14},"end":{"line":44,"column":21}}})) != null ? stack1 : "")
+ " </td>\n </tr>\n";
},"11":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return ((stack1 = lookupProperty(helpers,"if").call(depth0 != null ? depth0 : (container.nullContext || {}),(depths[2] != null ? lookupProperty(depths[2],"local") : depths[2]),{"name":"if","hash":{},"fn":container.program(12, data, 0, blockParams, depths),"inverse":container.program(14, data, 0, blockParams, depths),"data":data,"loc":{"start":{"line":35,"column":16},"end":{"line":40,"column":23}}})) != null ? stack1 : "");
},"12":function(container,depth0,helpers,partials,data,blockParams,depths) {
var helper, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <button class=\"btn btn-primary btn-compact btn-progress bg-color-error-base\" data-module=\""
+ alias2(alias1((depths[2] != null ? lookupProperty(depths[2],"key") : depths[2]), depth0))
+ "\" data-activity=\""
+ alias2(alias1((depths[1] != null ? lookupProperty(depths[1],"key") : depths[1]), depth0))
+ "\"\n data-page=\""
+ alias2(((helper = (helper = lookupProperty(helpers,"key") || (depth0 != null ? lookupProperty(depth0,"key") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"key","hash":{},"data":data,"loc":{"start":{"line":37,"column":37},"end":{"line":37,"column":44}}}) : helper)))
+ "\">Remove</button>\n";
},"14":function(container,depth0,helpers,partials,data) {
return " <button class=\"btn btn-primary btn-compact btn-primary\" disabled=\"disabled\">Complete</button>\n";
},"16":function(container,depth0,helpers,partials,data,blockParams,depths) {
var helper, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <button class=\"btn btn-primary btn-compact btn-progress bg-color-success-base\" data-module=\""
+ alias2(alias1((depths[2] != null ? lookupProperty(depths[2],"key") : depths[2]), depth0))
+ "\" data-activity=\""
+ alias2(alias1((depths[1] != null ? lookupProperty(depths[1],"key") : depths[1]), depth0))
+ "\"\n data-page=\""
+ alias2(((helper = (helper = lookupProperty(helpers,"key") || (depth0 != null ? lookupProperty(depth0,"key") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"key","hash":{},"data":data,"loc":{"start":{"line":43,"column":35},"end":{"line":43,"column":42}}}) : helper)))
+ "\">Add</button>\n";
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "<div class=\"panel-heading elevation-1 p-inset-squish-xs bg-color-neutral-200 border-width-sm border-color-neutral-300\" role=\"tab\" id=\"heading_"
+ alias4(((helper = (helper = lookupProperty(helpers,"key") || (depth0 != null ? lookupProperty(depth0,"key") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"key","hash":{},"data":data,"loc":{"start":{"line":1,"column":142},"end":{"line":1,"column":149}}}) : helper)))
+ "\">\n <h4 class=\"panel-title\">\n <a role=\"button\" class=\"link p1 no-underline\" id=\"collapse_"
+ alias4(((helper = (helper = lookupProperty(helpers,"key") || (depth0 != null ? lookupProperty(depth0,"key") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"key","hash":{},"data":data,"loc":{"start":{"line":3,"column":63},"end":{"line":3,"column":70}}}) : helper)))
+ "\" data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#panel_"
+ alias4(((helper = (helper = lookupProperty(helpers,"key") || (depth0 != null ? lookupProperty(depth0,"key") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"key","hash":{},"data":data,"loc":{"start":{"line":3,"column":133},"end":{"line":3,"column":140}}}) : helper)))
+ "\" aria-expanded=\"true\" aria-controls=\"collapse_"
+ alias4(((helper = (helper = lookupProperty(helpers,"key") || (depth0 != null ? lookupProperty(depth0,"key") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"key","hash":{},"data":data,"loc":{"start":{"line":3,"column":187},"end":{"line":3,"column":194}}}) : helper)))
+ "\">\n "
+ alias4((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"title") : depth0),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":17}}}))
+ "\n </a>\n </h4>\n <div class=\"progress-buttons\">\n"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"completed") : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0, blockParams, depths),"inverse":container.program(3, data, 0, blockParams, depths),"data":data,"loc":{"start":{"line":8,"column":4},"end":{"line":12,"column":11}}})) != null ? stack1 : "")
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"local") : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":13,"column":4},"end":{"line":15,"column":11}}})) != null ? stack1 : "")
+ " </div>\n</div>\n<div id=\"panel_"
+ alias4(((helper = (helper = lookupProperty(helpers,"key") || (depth0 != null ? lookupProperty(depth0,"key") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"key","hash":{},"data":data,"loc":{"start":{"line":18,"column":15},"end":{"line":18,"column":22}}}) : helper)))
+ "\" class=\"module-panel panel-collapse collapse "
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"wasOpen") : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":18,"column":68},"end":{"line":18,"column":92}}})) != null ? stack1 : "")
+ "\" role=\"tabpanel\" aria-labelledby=\"heading_"
+ alias4(((helper = (helper = lookupProperty(helpers,"key") || (depth0 != null ? lookupProperty(depth0,"key") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"key","hash":{},"data":data,"loc":{"start":{"line":18,"column":135},"end":{"line":18,"column":142}}}) : helper)))
+ "\">\n <div class=\"panel-body table-container m-stack-md\">\n <table class=\"table\">\n <tr class=\"table__row text-left\">\n <th class=\"table__cell bold p-inset-xs\">Activity Key</th>\n <th class=\"table__cell bold p-inset-xs\">Page Key</th>\n <th class=\"table__cell bold p-inset-xs\">Complete</th>\n <th class=\"table__cell bold p-inset-xs\"></th>\n </tr>\n"
+ ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"activities") : depth0),{"name":"each","hash":{},"fn":container.program(9, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":27,"column":6},"end":{"line":48,"column":15}}})) != null ? stack1 : "")
+ " </table>\n </div>\n</div>\n";
},"useData":true,"useDepths":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("developer/views/toolbar/templates/guides-overlay.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"1":function(container,depth0,helpers,partials,data) {
var lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <div class=\"guide\" style=\"position: absolute; opacity: 0.3; z-index: 10; left: 50%;transform: translateX(-50%);"
+ container.escapeExpression((lookupProperty(helpers,"style")||(depth0 && lookupProperty(depth0,"style"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"style","hash":{},"data":data,"loc":{"start":{"line":9,"column":117},"end":{"line":9,"column":131}}}))
+ "\"></div>\n";
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "<div id=\"guides-overlay\" class=\"guides-overlay\">\n <div class=\"controls\">\n <button type=\"button\" class=\"btn-secondary guides-close\" data-close=\"true\" data-dismiss=\"modal\" aria-label=\""
+ container.escapeExpression((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||container.hooks.helperMissing).call(alias1,"closeModal",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":3,"column":112},"end":{"line":3,"column":130}}}))
+ "\">\n <span>&times;</span>\n </button>\n </div>\n <div class=\"guides\">\n"
+ ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"guides") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":8,"column":4},"end":{"line":10,"column":13}}})) != null ? stack1 : "")
+ " </div>\n</div>\n";
},"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("developer/views/toolbar/templates/survey.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"1":function(container,depth0,helpers,partials,data) {
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <tr class=\"table__row\">\n <td class=\"table__cell p-inset-sm\">"
+ container.escapeExpression(((helper = (helper = lookupProperty(helpers,"slug") || (depth0 != null ? lookupProperty(depth0,"slug") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"slug","hash":{},"data":data,"loc":{"start":{"line":11,"column":45},"end":{"line":11,"column":53}}}) : helper)))
+ "</td>\n <td class=\"table__cell p-inset-sm\">"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"progress") : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.program(4, data, 0),"data":data,"loc":{"start":{"line":12,"column":45},"end":{"line":12,"column":85}}})) != null ? stack1 : "")
+ "</td>\n <td class=\"table__cell p-inset-sm\">\n"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"progress") : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.program(8, data, 0),"data":data,"loc":{"start":{"line":14,"column":12},"end":{"line":18,"column":19}}})) != null ? stack1 : "")
+ " </td>\n </tr>\n";
},"2":function(container,depth0,helpers,partials,data) {
return "true";
},"4":function(container,depth0,helpers,partials,data) {
return "false";
},"6":function(container,depth0,helpers,partials,data) {
var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <button class=\"btn btn-survey btn-primary btn-compact btn-progress bg-color-error-base\" data-survey=\""
+ container.escapeExpression(((helper = (helper = lookupProperty(helpers,"slug") || (depth0 != null ? lookupProperty(depth0,"slug") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"slug","hash":{},"data":data,"loc":{"start":{"line":15,"column":115},"end":{"line":15,"column":123}}}) : helper)))
+ "\">Remove</button>\n";
},"8":function(container,depth0,helpers,partials,data) {
var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <button class=\"btn btn-survey btn-primary btn-compact btn-progress bg-color-success-base\" data-survey=\""
+ container.escapeExpression(((helper = (helper = lookupProperty(helpers,"slug") || (depth0 != null ? lookupProperty(depth0,"slug") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"slug","hash":{},"data":data,"loc":{"start":{"line":17,"column":117},"end":{"line":17,"column":125}}}) : helper)))
+ "\">Add</button>\n";
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "<div id=\"panel_surveys\" class=\"panel-collapse collapse in\" role=\"tabpanel\" aria-labelledby=\"heading_surveys\">\n <div class=\"panel-body\">\n <table class=\"table table-container\">\n <tr class=\"table__row\">\n <th class=\"table__header\">Survey Slug</th>\n <th class=\"table__header\">Complete</th>\n <th class=\"table__header\"></th>\n </tr>\n"
+ ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"surveys") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":9,"column":6},"end":{"line":21,"column":15}}})) != null ? stack1 : "")
+ " </table>\n </div>\n</div>\n";
},"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("developer/views/toolbar/templates/toolbar.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"1":function(container,depth0,helpers,partials,data) {
return "active";
},"3":function(container,depth0,helpers,partials,data) {
return "checked";
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "<div role=\"tabpanel\" class=\"tabs\">\n <div class=\"tabs-header\">\n <div class=\"nav nav-tabs tabs__tab-bar has-2-tabs\" role=\"tablist\">\n <button class=\"tabs__tab-bar-button tabs__tab-bar-button--active\" href=\"#course_map_pane\" id=\"course_map\" role=\"tab\" data-toggle=\"tab\">\n <p class=\"tabs__tab-bar-button__text\">Course Map</p>\n </button>\n <button class=\"tabs__tab-bar-button\" href=\"#accessibility_pane\" id=\"accessibility\" role=\"tab\" data-toggle=\"tab\">\n <p class=\"tabs__tab-bar-button__text\">Accessibility</p>\n </button>\n </div>\n <div class=\"tabs-header-buttons inline-block\">\n <button type=\"button\" id=\"guides-overlay-button\" class=\"btn btn-secondary btn-compact guides-overlay-button disableMargin\" data-close=\"true\">Enable Guides Overlay</button>\n <a href=\"#\" class=\"pull-right btn btn-secondary btn-compact home-button\" data-close=\"true\">Home</a>\n <div class=\"page-skipping-container text-right inline-block\">\n <p class=\"p3 bold inline-block\">Page Skipping:</p>\n <div class=\"btn-group inline-block\" data-toggle=\"buttons\">\n <label class=\"btn btn-tertiary btn-compact disableMargin "
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"pageSkipping") : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":17,"column":67},"end":{"line":17,"column":100}}})) != null ? stack1 : "")
+ "\">\n <input type=\"radio\" name=\"page-skipping\" id=\"allowed\" autocomplete=\"off\" "
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"pageSkipping") : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":18,"column":85},"end":{"line":18,"column":119}}})) != null ? stack1 : "")
+ " value=\"true\">Allow\n </label>\n <label class=\"btn btn-tertiary btn-compact disableMargin "
+ ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"pageSkipping") : depth0),{"name":"unless","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":20,"column":67},"end":{"line":20,"column":108}}})) != null ? stack1 : "")
+ "\">\n <input type=\"radio\" name=\"page-skipping\" id=\"prevented\" autocomplete=\"off\" "
+ ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"pageSkipping") : depth0),{"name":"unless","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":21,"column":87},"end":{"line":21,"column":129}}})) != null ? stack1 : "")
+ " value=\"false\">Prevent\n </label>\n </div>\n </div>\n <button type=\"button\" class=\"btn btn-tertiary\" data-close=\"true\">\n"
+ ((stack1 = container.invokePartial(lookupProperty(partials,"icon"),depth0,{"name":"icon","hash":{"size":"fa-lg","icon":"fal fa-times","uuid":(depth0 != null ? lookupProperty(depth0,"cid") : depth0)},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "")
+ " <span class=\"sr-only\">Close</span>\n </button>\n </div>\n </div>\n <div class=\"tabs__tab-content p-inset-none\">\n <div role=\"tabpanel\" class=\"tabs__tab-content__tab-pane disablePadding active\" id=\"course_map_pane\"></div>\n <div role=\"tabpanel\" class=\"tabs__tab-content__tab-pane\" id=\"accessibility_pane\">\n <div class=\"ef-layout-grid\">\n <div class=\"ef-layout-grid__cell--span-12 iframe__component\">\n\n <div class=\"iframe__top-bar\">\n <a class=\"btn btn-primary btn-compact\" href=\"#developer/accessibility\">Full Course Accessibility Report</a>\n <a class=\"btn btn-primary btn-compact\" href=\"https://chrome.google.com/webstore/detail/accessibility-developer-t/fpkknkljclfencbdbgkenhalefipecmb?hl=en\" target=\"_blank\">Google Audit Extension</a>\n <a class=\"btn btn-primary btn-compact\" href=\"https://chrome.google.com/webstore/detail/wave-evaluation-tool/jbbplnpkjmmeebjpijfedlgcdilocofh?hl=en\" target=\"_blank\">WAVE Extension</a>\n <button class=\"btn btn-primary btn-compact\" id=\"refresh_achecker\">Refresh AChecker</button>\n </div>\n <div class=\"achecker-report iframe__container\">\n\n <form action=\"http://achecker.ca/checker/index.php\" method=\"post\" id=\"achecker_form\" target=\"achecker-output\">\n <input type=\"hidden\" name=\"pastehtml\" id=\"achecker_html\"/>\n <input type=\"hidden\" name=\"enable_html_validation\" value=\"1\"/>\n <input type=\"hidden\" name=\"radio_gid[]\" value=\"8\"/>\n <input type=\"hidden\" name=\"checkbox_gid[]\" value=\"8\"/>\n <input type=\"hidden\" name=\"rpt_format\" value=\"1\"/>\n <input type=\"hidden\" name=\"validate_paste\" value=\"Check It\"/>\n </form>\n <iframe id=\"achecker-output\" name=\"achecker-output\" class=\"iframe__element\"></iframe>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n";
},"usePartial":true,"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("developer/views/toolbar/toolbar-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _ef = _interopRequireDefault(require("ef/ef"));

var _view = _interopRequireDefault(require("views/base/view"));

var _courseMapView = _interopRequireDefault(require("./course-map-view"));

var _guidesOverlayView = _interopRequireDefault(require("./guides-overlay-view"));

var _toolbar = _interopRequireDefault(require("./templates/toolbar"));

var _iconLoadService = _interopRequireDefault(require("services/loader-handler-services/icon-load-service"));

var _jquery = _interopRequireDefault(require("jquery"));

var ToolBarView = _view.default.extend({
autoRender: true,
autoAttach: true,
className: 'col-md-12',
template: _toolbar.default,
regions: {
achecker: 'achecker-report',
course_map: '#course_map_pane'
},
initialize: function initialize() {
this.on('addedToDOM', function () {
var _this = this;

this.delegate('click', '#refresh_achecker', this.submitAChecker);
this.delegate('click', '#guides-overlay-button', this.openGuidesOverlay);
this.$('#accessibility').on('shown.bs.tab', function () {
return _this.submitAChecker();
});
this.delegate('click', '.page-skipping-container .btn', this.setPageSkipping);
this.delegate('click', '.tabs-header .tabs__tab-bar-button', function (e) {
_this.$el.find('.tabs-header .tabs__tab-bar-button').removeClass('tabs__tab-bar-button--active');

(0, _jquery.default)(e.currentTarget).addClass('tabs__tab-bar-button--active');
});
this.delegate('click', '.tabs.tab-vertical .tabs__tab-bar-button', function (e) {
_this.$el.find('.tabs.tab-vertical .tabs__tab-bar-button').removeClass('tabs__tab-bar-button--active');

(0, _jquery.default)(e.currentTarget).addClass('tabs__tab-bar-button--active');
});

_iconLoadService.default.applyIcon('fal fa-times', '', 'fa-lg');

var courseMap = new _courseMapView.default({
collection: _ef.default.modules,
region: 'course_map'
});
this.subview('course_map', courseMap);
});

_view.default.prototype.initialize.apply(this, arguments);
},
submitAChecker: function submitAChecker() {
var html = "<!DOCTYPE>".concat(document.documentElement.outerHTML);
(0, _jquery.default)('#achecker_html').val(html);
(0, _jquery.default)('#achecker_form').submit();
},
openGuidesOverlay: function openGuidesOverlay() {
var guidesOverlayView = new _guidesOverlayView.default();
guidesOverlayView.render();
},
setPageSkipping: function setPageSkipping(e) {
_ef.default.options.pageSkipping = e.currentTarget.querySelector('input').value === 'true';
localStorage.setItem('pageSkipping', _ef.default.options.pageSkipping);
},
getTemplateData: function getTemplateData() {
return {
pageSkipping: _ef.default.options.pageSkipping
};
}
});

var _default = ToolBarView;
exports.default = _default;
});

require.register("ef_sdk.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _typeof = require("@babel/runtime/helpers/typeof");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _ef = _interopRequireDefault(require("ef/ef"));

require("initialize");

require("lib/view-helper");

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var _portfolioService = _interopRequireDefault(require("services/data-handler-services/portfolio-service"));

var _navigationService = _interopRequireDefault(require("services/course-handler-services/navigation-service"));

var _iconLoadService = _interopRequireDefault(require("services/loader-handler-services/icon-load-service"));

var _utils = _interopRequireDefault(require("lib/utils"));

var _servicesInitializer = _interopRequireDefault(require("services/services-initializer"));

var _partials = _interopRequireDefault(require("views/partials"));

var _timerService = require("services/course-handler-services/timer-service");

var _courseTimerService = _interopRequireDefault(require("services/timer/course-timer-service"));

var _customization = _interopRequireDefault(require("ef/models/customization"));

var _modules_collection = _interopRequireDefault(require("ef/collections/modules_collection"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _jquery = _interopRequireDefault(require("jquery"));

var _lodash = _interopRequireDefault(require("lodash"));

var _i18next = _interopRequireDefault(require("i18next"));

var _runtime = _interopRequireDefault(require("handlebars/runtime"));

var _controllers = _interopRequireDefault(require("controllers"));

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

var _default = _chaplin.default.Application.extend({
title: 'EverFi SDK',
initialize: function initialize(options) {
_chaplin.default.Dispatcher.prototype.loadController = function (name, handler) {
var moduleName = "".concat(_lodash.default.startCase(name.split('/').pop()), "Controller");
return setTimeout(function () {
return handler(_controllers.default[moduleName]);
});
};

var params = new URLSearchParams(window.location.search);
var urlOptions = params.get('options') ? JSON.parse(atob(params.get('options'))) : {};

_lodash.default.defaultsDeep(options, urlOptions, _utils.default.tryRequire('local-data/config.json'), {
config: {
settings: {
local: true,
env: 'dev' // fullSCORM: true // left as an example

},
enrollment: {
id: 1,
name: 'Charles Xavier',
schoolName: 'EverFi Institute',
className: 'Spring 2013',
certified: false,
autoPlay: false
},
i18n: {}
}
}); // HR config passed here


var config = _lodash.default.defaultsDeep(options.config, {
learnerProfile: _objectSpread({}, options.learnerProfile)
});

this.config = config;

if (this.config.i18n.lngs) {
this.config.settings.available_languages = this.config.i18n.lngs;
}

if (window.location.search.indexOf('setLng') >= 0) {
this.config.i18n.lng = null;
} // if the config decides to send the app elsewhere replace the hash now
// this prevents the router from routing to the menu and then to the page
// if the menu was loaded and then quickly switched to another page
// the menu would dispose itself before it was done loading and cause some undefined errors


if (this.config && this.config.other && this.config.other.start) {
window.location.replace("#".concat(this.config.other.start));
}

this.setRequestHeaders();

_utils.default.initialize(this.config.settings);

_navigationService.default.initialize(this.config.settings);

_chaplin.default.Application.prototype.initialize.apply(this, arguments);
},
start: function start() {
this.setCSRFToken();

_servicesInitializer.default.start(this.config);

_ef.default.on('ready', _lodash.default.bind(function () {
var args = Array.prototype.slice.call(arguments);

if (_courseSettingsService.default.get('portfolio')) {
_portfolioService.default.initialize();
}

if (_ef.default.options.local) {
_ef.default.activityProgresses.fetch();

_ef.default.customizations.fetch();
}

var customModules = _ef.default.customizations.get('content-module-customization');

if (!customModules && this.config.settings.module_keys) {
var attributes = Object.assign({
customization_type: 'content-module-customization'
}, this.config.settings.module_keys);
var options = {
enrollment: this.config.enrollment
};
customModules = new _customization.default(attributes, options);

_ef.default.customizations.add(customModules);
}

if (customModules) {
var newModules = _ef.default.modules.filter(function (mod) {
return customModules.get('modules').indexOf(mod.get('key')) > -1;
});

customModules.get('modules').forEach(function (mod, i) {
var module = _ef.default.modules.find({
key: mod
});

if (module) {
module.set('index', i);
} else {
// eslint-disable-next-line no-console
console.log("couldn't find module with key ".concat(mod, " in "), _ef.default.modules);
}
});
_ef.default.modules = new _modules_collection.default(newModules);

_ef.default.modules.sort();

customModules.set('force_order', customModules.get('force_order') === 'true');

_ef.default.groups.each(function (g) {
g.modules.sort();
g.modules.forEach(function (m) {
if (m && m.get('key') !== undefined && _ef.default.modules.find({
key: m.get('key')
}) === undefined) {
// Inconsistency, this module is in groups but not in EF.modules
// Get rid of it so it doesn't get in the way of unlocking the next module
g.modules.remove(m);
}
});

if (g.get('custom_in_order')) {
g.set('in_order', customModules.get('force_order'));
}
});
}

_chaplin.default.Application.prototype.start.apply(this, args);

var startUpScript = _courseSettingsService.default.get('startupScript');

if (startUpScript) {
Promise.resolve("".concat(startUpScript)).then(function (s) {
return _interopRequireWildcard(require(s));
});
}

if (_courseSettingsService.default.get('menu') && _courseSettingsService.default.get('menu').skip && !window.location.hash) {
var firstIncomplete = _ef.default.modules.getFirstAvailable(_courseSettingsService.default.get('menu'));

if (!firstIncomplete) {
firstIncomplete = _ef.default.modules.first();
}

this.router.route({
url: firstIncomplete.get('key')
}, {
replace: true
});
}

if (_courseSettingsService.default.get('defaultConfigs')) {
_courseSettingsService.default.setDefaultConfigs();
} // Register hbs partials


this.registerPartials();

_iconLoadService.default.configFontAwesome({
autoReplaceSvg: false,
observeMutations: false,
showMissingIcons: false
});

_ef.default.timerService = _timerService.timerService;
_ef.default.courseTimerService = _courseTimerService.default.initialize();
}, this));

this.onOrientationChange();
this.router.subscribeEvent('router:match', this.trackPageView);
this.router.subscribeEvent('router:match', this.postMessageNewUrl);
},
trackPageView: function trackPageView(route) {
if (window.ga && typeof window.ga.getAll === 'function') {
var url = "".concat(location.pathname, "#").concat(route.path);
window.ga.getAll().forEach(function (tracker) {
tracker.send('pageview', url.replace(/^!/, ''));
});
}
},
postMessageNewUrl: function postMessageNewUrl(route) {
window.postMessage({
event_type: 'url-change',
new_url: "".concat(location.origin, "/").concat(location.pathname, "#").concat(route.path)
}, '*');
},
registerPartials: function registerPartials() {
Object.entries(_partials.default).forEach(function (_ref) {
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
name = _ref2[0],
partial = _ref2[1];

_runtime.default.registerPartial(name, partial);
});
},
setCSRFToken: function setCSRFToken() {
var funcs = {
csrfToken: function csrfToken() {
return (0, _jquery.default)('meta[name=csrf-token]').attr('content');
},
// Make sure that every Ajax request sends the CSRF token
CSRFProtection: function CSRFProtection(xhr) {
var token = funcs.csrfToken();

if (token) {
xhr.setRequestHeader('X-CSRF-Token', token);
}
}
};

_jquery.default.ajaxPrefilter(function (options, originalOptions, xhr) {
if (!options.crossDomain) {
funcs.CSRFProtection(xhr);
}
});
},
setRequestHeaders: function setRequestHeaders() {
_jquery.default.ajaxSetup({
beforeSend: function beforeSend(xhr) {
xhr.setRequestHeader('accept', 'application/json');

if (_i18next.default.language) {
// also see app/extentions for the fetch shim
xhr.setRequestHeader('Accept-Language', "".concat(_i18next.default.language, ";q=1.0"));
}
}
});
},
onOrientationChange: function onOrientationChange() {
if (window.addEventListener && _ef.default && _ef.default.config) {
if (window.top !== window) {
window.addEventListener('message', function (message) {
var originMatch = message.origin === _ef.default.config.get('basePath');

if (originMatch && message.data.type === 'orientationchange') {
_ef.default.orientation = message.data.orientation;

_ef.default.trigger('orientationchange', message.data.orientation);
}
}, false);
} else {
window.addEventListener('orientationchange', function () {
_ef.default.orientation = window.orientation;

_ef.default.trigger('orientationchange', window.orientation);
}, false);
}
}
},
// listens for window focus changing
// if activeElement is an iframe, it'll treat the window like it has focus
onWindowFocusChange: function onWindowFocusChange(callback) {
var visible = true;

var focused = function focused() {
if (!visible) {
callback(visible = true);
}
};

var unfocused = function unfocused() {
if (visible) {
callback(visible = false);
}
};

var activeElement = window.document.activeElement;

if (activeElement && activeElement.tagName.toLowerCase() === 'iframe') {
focused;
}

if ('hidden' in document) {
document.addEventListener('visibilitychange', function () {
document.hidden ? unfocused : focused;
});
}

if ('mozHidden' in document) {
document.addEventListener('mozvisibilitychange', function () {
document.mozHidden ? unfocused : focused;
});
}

if ('webkitHidden' in document) {
document.addEventListener('webkitvisibilitychange', function () {
document.webkitHidden ? unfocused : focused;
});
}

if ('msHidden' in document) {
document.addEventListener('msvisibilitychange', function () {
document.msHidden ? unfocused : focused;
});
} // IE 9 and lower:


if ('onfocusin' in document) {
document.onfocusin = focused;
document.onfocusout = unfocused;
} // All others:


window.onpageshow = window.onfocus = focused;
window.onpagehide = window.onblur = unfocused;
}
});

exports.default = _default;
});

require.register("extensions.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _i18next = _interopRequireDefault(require("i18next"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _jquery = _interopRequireDefault(require("jquery"));

var Extensions = function Extensions() {
_chaplin.default.Model.prototype.property = function (value, callback) {
if (this.has(value)) {
return callback(this.get(value));
}
};

(0, _jquery.default)(document).ajaxError(function (e, xhr) {
window.postMessage({
event_type: 'request:failed',
status: xhr.status,
location: xhr.getResponseHeader('location')
}, '*');
});
/**
* Shim fetch to add the language code as an Accept-Language header from i18next
* also see app/lib/utils.js for similar jQuery shim
**/

window.fetch = function (original) {
var ACCEPT_LANG_HEADER = 'Accept-Language';
return function () {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}

if (_i18next.default.language) {
if (args[1] && args[1].headers) {
// if a config object with headers is found
var formatLangString = function formatLangString(lang) {
return lang ? ",".concat(lang) : '';
};

if (args[1].headers instanceof Headers) {
var acceptLanguage = args[1].headers.get(ACCEPT_LANG_HEADER);
args[1].headers.set( // merge the language code from i18next with the existing Accept-Language header
ACCEPT_LANG_HEADER, "".concat(_i18next.default.language, ";q=1.0").concat(formatLangString(acceptLanguage)));
} else {
var _acceptLanguage = args[1].headers[ACCEPT_LANG_HEADER];
args[1].headers[ACCEPT_LANG_HEADER] = "".concat(_i18next.default.language, ";q=1.0").concat(formatLangString(_acceptLanguage));
}
} else {
// if no config object is found
var headers = new Headers();
headers.set(ACCEPT_LANG_HEADER, "".concat(_i18next.default.language, ";q=1.0"));
var config = args[1] ? args[1] : {};
config.headers = headers;
var arg = args.shift(); // preserve the first argument

args.unshift(config); // add new/updated config object

args.unshift(arg); // restore the first argument so headers is the second argument
}
}

return original.apply(this, args).then(function (response) {
if (response.status !== undefined && response.status !== 200) {
window.postMessage({
event_type: 'request:failed',
status: response.status,
location: response.headers.get('location')
}, '*');
}

return response;
});
};
}(window.fetch);
};

var _default = Extensions;
exports.default = _default;
});

require.register("imports.js", function(exports, require, module) {
"use strict";

require("bootstrap");

require("ef/models/survey");

require("lib/languages");

require("views/block");

require("services");

require("views/atoms");
});

require.register("initialize.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

require("polyfills");

var _ef_sdk = _interopRequireDefault(require("ef_sdk"));

var _routes = _interopRequireDefault(require("routes"));

var _extensions = _interopRequireDefault(require("extensions"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _lodash = _interopRequireDefault(require("lodash"));

require("imports");

var _runtime = _interopRequireDefault(require("handlebars/runtime"));

// The handlebars compiler in handlebars-brunch adds a call to window.Handlebars.
// This is shimmed in the SDK in brunch-config, but components still need it
// To remove this global, make sure the components don't call it, then remove this next line
window.Handlebars = _runtime.default; // Foundry, and Scorm packages rely on window.Chaplin, there is a ticket to remove this: CS-3916

window.Chaplin = _chaplin.default;

if (_extensions.default !== undefined) {
(0, _extensions.default)();
}

var initialize = {
configure: function configure(options) {
options = options || {};
var appConfig = {
routes: _routes.default,
controllerPath: '',
controllerSuffix: '-controller',
pushState: false
};
options = _lodash.default.extend(appConfig, options);
var app = new _ef_sdk.default(options);

window.onerror = function () {
_chaplin.default.mediator.publish('application:error', app);
};

return app;
}
};
module.exports = initialize;
});

require.register("lib/fa-metadata.js", function(exports, require, module) {
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var faMetadata = {
"far": ["abacus", "acorn", "ad", "address-book", "address-card", "adjust", "air-conditioner", "air-freshener", "alarm-clock", "alarm-exclamation", "alarm-plus", "alarm-snooze", "album", "album-collection", "alicorn", "alien", "alien-monster", "align-center", "align-justify", "align-left", "align-right", "align-slash", "allergies", "ambulance", "american-sign-language-interpreting", "amp-guitar", "analytics", "anchor", "angel", "angle-double-down", "angle-double-left", "angle-double-right", "angle-double-up", "angle-down", "angle-left", "angle-right", "angle-up", "angry", "ankh", "apple-alt", "apple-crate", "archive", "archway", "arrow-alt-circle-down", "arrow-alt-circle-left", "arrow-alt-circle-right", "arrow-alt-circle-up", "arrow-alt-down", "arrow-alt-from-bottom", "arrow-alt-from-left", "arrow-alt-from-right", "arrow-alt-from-top", "arrow-alt-left", "arrow-alt-right", "arrow-alt-square-down", "arrow-alt-square-left", "arrow-alt-square-right", "arrow-alt-square-up", "arrow-alt-to-bottom", "arrow-alt-to-left", "arrow-alt-to-right", "arrow-alt-to-top", "arrow-alt-up", "arrow-circle-down", "arrow-circle-left", "arrow-circle-right", "arrow-circle-up", "arrow-down", "arrow-from-bottom", "arrow-from-left", "arrow-from-right", "arrow-from-top", "arrow-left", "arrow-right", "arrow-square-down", "arrow-square-left", "arrow-square-right", "arrow-square-up", "arrow-to-bottom", "arrow-to-left", "arrow-to-right", "arrow-to-top", "arrow-up", "arrows", "arrows-alt", "arrows-alt-h", "arrows-alt-v", "arrows-h", "arrows-v", "assistive-listening-systems", "asterisk", "at", "atlas", "atom", "atom-alt", "audio-description", "award", "axe", "axe-battle", "baby", "baby-carriage", "backpack", "backspace", "backward", "bacon", "bacteria", "bacterium", "badge", "badge-check", "badge-dollar", "badge-percent", "badge-sheriff", "badger-honey", "bags-shopping", "bahai", "balance-scale", "balance-scale-left", "balance-scale-right", "ball-pile", "ballot", "ballot-check", "ban", "band-aid", "banjo", "barcode", "barcode-alt", "barcode-read", "barcode-scan", "bars", "baseball", "baseball-ball", "basketball-ball", "basketball-hoop", "bat", "bath", "battery-bolt", "battery-empty", "battery-full", "battery-half", "battery-quarter", "battery-slash", "battery-three-quarters", "bed", "bed-alt", "bed-bunk", "bed-empty", "beer", "bell", "bell-exclamation", "bell-on", "bell-plus", "bell-school", "bell-school-slash", "bell-slash", "bells", "betamax", "bezier-curve", "bible", "bicycle", "biking", "biking-mountain", "binoculars", "biohazard", "birthday-cake", "blanket", "blender", "blender-phone", "blind", "blinds", "blinds-open", "blinds-raised", "blog", "bold", "bolt", "bomb", "bone", "bone-break", "bong", "book", "book-alt", "book-dead", "book-heart", "book-medical", "book-open", "book-reader", "book-spells", "book-user", "bookmark", "books", "books-medical", "boombox", "boot", "booth-curtain", "border-all", "border-bottom", "border-center-h", "border-center-v", "border-inner", "border-left", "border-none", "border-outer", "border-right", "border-style", "border-style-alt", "border-top", "bow-arrow", "bowling-ball", "bowling-pins", "box", "box-alt", "box-ballot", "box-check", "box-fragile", "box-full", "box-heart", "box-open", "box-tissue", "box-up", "box-usd", "boxes", "boxes-alt", "boxing-glove", "brackets", "brackets-curly", "braille", "brain", "bread-loaf", "bread-slice", "briefcase", "briefcase-medical", "bring-forward", "bring-front", "broadcast-tower", "broom", "browser", "brush", "bug", "building", "bullhorn", "bullseye", "bullseye-arrow", "bullseye-pointer", "burger-soda", "burn", "burrito", "bus", "bus-alt", "bus-school", "business-time", "cabinet-filing", "cactus", "calculator", "calculator-alt", "calendar", "calendar-alt", "calendar-check", "calendar-day", "calendar-edit", "calendar-exclamation", "calendar-minus", "calendar-plus", "calendar-star", "calendar-times", "calendar-week", "camcorder", "camera", "camera-alt", "camera-home", "camera-movie", "camera-polaroid", "camera-retro", "campfire", "campground", "candle-holder", "candy-cane", "candy-corn", "cannabis", "capsules", "car", "car-alt", "car-battery", "car-building", "car-bump", "car-bus", "car-crash", "car-garage", "car-mechanic", "car-side", "car-tilt", "car-wash", "caravan", "caravan-alt", "caret-circle-down", "caret-circle-left", "caret-circle-right", "caret-circle-up", "caret-down", "caret-left", "caret-right", "caret-square-down", "caret-square-left", "caret-square-right", "caret-square-up", "caret-up", "carrot", "cars", "cart-arrow-down", "cart-plus", "cash-register", "cassette-tape", "cat", "cat-space", "cauldron", "cctv", "certificate", "chair", "chair-office", "chalkboard", "chalkboard-teacher", "charging-station", "chart-area", "chart-bar", "chart-line", "chart-line-down", "chart-network", "chart-pie", "chart-pie-alt", "chart-scatter", "check", "check-circle", "check-double", "check-square", "cheese", "cheese-swiss", "cheeseburger", "chess", "chess-bishop", "chess-bishop-alt", "chess-board", "chess-clock", "chess-clock-alt", "chess-king", "chess-king-alt", "chess-knight", "chess-knight-alt", "chess-pawn", "chess-pawn-alt", "chess-queen", "chess-queen-alt", "chess-rook", "chess-rook-alt", "chevron-circle-down", "chevron-circle-left", "chevron-circle-right", "chevron-circle-up", "chevron-double-down", "chevron-double-left", "chevron-double-right", "chevron-double-up", "chevron-down", "chevron-left", "chevron-right", "chevron-square-down", "chevron-square-left", "chevron-square-right", "chevron-square-up", "chevron-up", "child", "chimney", "church", "circle", "circle-notch", "city", "clarinet", "claw-marks", "clinic-medical", "clipboard", "clipboard-check", "clipboard-list", "clipboard-list-check", "clipboard-prescription", "clipboard-user", "clock", "clone", "closed-captioning", "cloud", "cloud-download", "cloud-download-alt", "cloud-drizzle", "cloud-hail", "cloud-hail-mixed", "cloud-meatball", "cloud-moon", "cloud-moon-rain", "cloud-music", "cloud-rain", "cloud-rainbow", "cloud-showers", "cloud-showers-heavy", "cloud-sleet", "cloud-snow", "cloud-sun", "cloud-sun-rain", "cloud-upload", "cloud-upload-alt", "clouds", "clouds-moon", "clouds-sun", "club", "cocktail", "code", "code-branch", "code-commit", "code-merge", "coffee", "coffee-pot", "coffee-togo", "coffin", "coffin-cross", "cog", "cogs", "coin", "coins", "columns", "comet", "comment", "comment-alt", "comment-alt-check", "comment-alt-dollar", "comment-alt-dots", "comment-alt-edit", "comment-alt-exclamation", "comment-alt-lines", "comment-alt-medical", "comment-alt-minus", "comment-alt-music", "comment-alt-plus", "comment-alt-slash", "comment-alt-smile", "comment-alt-times", "comment-check", "comment-dollar", "comment-dots", "comment-edit", "comment-exclamation", "comment-lines", "comment-medical", "comment-minus", "comment-music", "comment-plus", "comment-slash", "comment-smile", "comment-times", "comments", "comments-alt", "comments-alt-dollar", "comments-dollar", "compact-disc", "compass", "compass-slash", "compress", "compress-alt", "compress-arrows-alt", "compress-wide", "computer-classic", "computer-speaker", "concierge-bell", "construction", "container-storage", "conveyor-belt", "conveyor-belt-alt", "cookie", "cookie-bite", "copy", "copyright", "corn", "couch", "cow", "cowbell", "cowbell-more", "credit-card", "credit-card-blank", "credit-card-front", "cricket", "croissant", "crop", "crop-alt", "cross", "crosshairs", "crow", "crown", "crutch", "crutches", "cube", "cubes", "curling", "cut", "dagger", "database", "deaf", "debug", "deer", "deer-rudolph", "democrat", "desktop", "desktop-alt", "dewpoint", "dharmachakra", "diagnoses", "diamond", "dice", "dice-d10", "dice-d12", "dice-d20", "dice-d4", "dice-d6", "dice-d8", "dice-five", "dice-four", "dice-one", "dice-six", "dice-three", "dice-two", "digging", "digital-tachograph", "diploma", "directions", "disc-drive", "disease", "divide", "dizzy", "dna", "do-not-enter", "dog", "dog-leashed", "dollar-sign", "dolly", "dolly-empty", "dolly-flatbed", "dolly-flatbed-alt", "dolly-flatbed-empty", "donate", "door-closed", "door-open", "dot-circle", "dove", "download", "drafting-compass", "dragon", "draw-circle", "draw-polygon", "draw-square", "dreidel", "drone", "drone-alt", "drum", "drum-steelpan", "drumstick", "drumstick-bite", "dryer", "dryer-alt", "duck", "dumbbell", "dumpster", "dumpster-fire", "dungeon", "ear", "ear-muffs", "eclipse", "eclipse-alt", "edit", "egg", "egg-fried", "eject", "elephant", "ellipsis-h", "ellipsis-h-alt", "ellipsis-v", "ellipsis-v-alt", "empty-set", "engine-warning", "envelope", "envelope-open", "envelope-open-dollar", "envelope-open-text", "envelope-square", "equals", "eraser", "ethernet", "euro-sign", "exchange", "exchange-alt", "exclamation", "exclamation-circle", "exclamation-square", "exclamation-triangle", "expand", "expand-alt", "expand-arrows", "expand-arrows-alt", "expand-wide", "external-link", "external-link-alt", "external-link-square", "external-link-square-alt", "eye", "eye-dropper", "eye-evil", "eye-slash", "fan", "fan-table", "farm", "fast-backward", "fast-forward", "faucet", "faucet-drip", "fax", "feather", "feather-alt", "female", "field-hockey", "fighter-jet", "file", "file-alt", "file-archive", "file-audio", "file-certificate", "file-chart-line", "file-chart-pie", "file-check", "file-code", "file-contract", "file-csv", "file-download", "file-edit", "file-excel", "file-exclamation", "file-export", "file-image", "file-import", "file-invoice", "file-invoice-dollar", "file-medical", "file-medical-alt", "file-minus", "file-music", "file-pdf", "file-plus", "file-powerpoint", "file-prescription", "file-search", "file-signature", "file-spreadsheet", "file-times", "file-upload", "file-user", "file-video", "file-word", "files-medical", "fill", "fill-drip", "film", "film-alt", "film-canister", "filter", "fingerprint", "fire", "fire-alt", "fire-extinguisher", "fire-smoke", "fireplace", "first-aid", "fish", "fish-cooked", "fist-raised", "flag", "flag-alt", "flag-checkered", "flag-usa", "flame", "flashlight", "flask", "flask-poison", "flask-potion", "flower", "flower-daffodil", "flower-tulip", "flushed", "flute", "flux-capacitor", "fog", "folder", "folder-download", "folder-minus", "folder-open", "folder-plus", "folder-times", "folder-tree", "folder-upload", "folders", "font", "font-awesome-logo-full", "font-case", "football-ball", "football-helmet", "forklift", "forward", "fragile", "french-fries", "frog", "frosty-head", "frown", "frown-open", "function", "funnel-dollar", "futbol", "galaxy", "game-board", "game-board-alt", "game-console-handheld", "gamepad", "gamepad-alt", "garage", "garage-car", "garage-open", "gas-pump", "gas-pump-slash", "gavel", "gem", "genderless", "ghost", "gift", "gift-card", "gifts", "gingerbread-man", "glass", "glass-champagne", "glass-cheers", "glass-citrus", "glass-martini", "glass-martini-alt", "glass-whiskey", "glass-whiskey-rocks", "glasses", "glasses-alt", "globe", "globe-africa", "globe-americas", "globe-asia", "globe-europe", "globe-snow", "globe-stand", "golf-ball", "golf-club", "gopuram", "graduation-cap", "gramophone", "greater-than", "greater-than-equal", "grimace", "grin", "grin-alt", "grin-beam", "grin-beam-sweat", "grin-hearts", "grin-squint", "grin-squint-tears", "grin-stars", "grin-tears", "grin-tongue", "grin-tongue-squint", "grin-tongue-wink", "grin-wink", "grip-horizontal", "grip-lines", "grip-lines-vertical", "grip-vertical", "guitar", "guitar-electric", "guitars", "h-square", "h1", "h2", "h3", "h4", "hamburger", "hammer", "hammer-war", "hamsa", "hand-heart", "hand-holding", "hand-holding-box", "hand-holding-heart", "hand-holding-magic", "hand-holding-medical", "hand-holding-seedling", "hand-holding-usd", "hand-holding-water", "hand-lizard", "hand-middle-finger", "hand-paper", "hand-peace", "hand-point-down", "hand-point-left", "hand-point-right", "hand-point-up", "hand-pointer", "hand-receiving", "hand-rock", "hand-scissors", "hand-sparkles", "hand-spock", "hands", "hands-heart", "hands-helping", "hands-usd", "hands-wash", "handshake", "handshake-alt", "handshake-alt-slash", "handshake-slash", "hanukiah", "hard-hat", "hashtag", "hat-chef", "hat-cowboy", "hat-cowboy-side", "hat-santa", "hat-winter", "hat-witch", "hat-wizard", "hdd", "head-side", "head-side-brain", "head-side-cough", "head-side-cough-slash", "head-side-headphones", "head-side-mask", "head-side-medical", "head-side-virus", "head-vr", "heading", "headphones", "headphones-alt", "headset", "heart", "heart-broken", "heart-circle", "heart-rate", "heart-square", "heartbeat", "heat", "helicopter", "helmet-battle", "hexagon", "highlighter", "hiking", "hippo", "history", "hockey-mask", "hockey-puck", "hockey-sticks", "holly-berry", "home", "home-alt", "home-heart", "home-lg", "home-lg-alt", "hood-cloak", "horizontal-rule", "horse", "horse-head", "horse-saddle", "hospital", "hospital-alt", "hospital-symbol", "hospital-user", "hospitals", "hot-tub", "hotdog", "hotel", "hourglass", "hourglass-end", "hourglass-half", "hourglass-start", "house", "house-damage", "house-day", "house-flood", "house-leave", "house-night", "house-return", "house-signal", "house-user", "hryvnia", "humidity", "hurricane", "i-cursor", "ice-cream", "ice-skate", "icicles", "icons", "icons-alt", "id-badge", "id-card", "id-card-alt", "igloo", "image", "image-polaroid", "images", "inbox", "inbox-in", "inbox-out", "indent", "industry", "industry-alt", "infinity", "info", "info-circle", "info-square", "inhaler", "integral", "intersection", "inventory", "island-tropical", "italic", "jack-o-lantern", "jedi", "joint", "journal-whills", "joystick", "jug", "kaaba", "kazoo", "kerning", "key", "key-skeleton", "keyboard", "keynote", "khanda", "kidneys", "kiss", "kiss-beam", "kiss-wink-heart", "kite", "kiwi-bird", "knife-kitchen", "lambda", "lamp", "lamp-desk", "lamp-floor", "landmark", "landmark-alt", "language", "laptop", "laptop-code", "laptop-house", "laptop-medical", "lasso", "laugh", "laugh-beam", "laugh-squint", "laugh-wink", "layer-group", "layer-minus", "layer-plus", "leaf", "leaf-heart", "leaf-maple", "leaf-oak", "lemon", "less-than", "less-than-equal", "level-down", "level-down-alt", "level-up", "level-up-alt", "life-ring", "light-ceiling", "light-switch", "light-switch-off", "light-switch-on", "lightbulb", "lightbulb-dollar", "lightbulb-exclamation", "lightbulb-on", "lightbulb-slash", "lights-holiday", "line-columns", "line-height", "link", "lips", "lira-sign", "list", "list-alt", "list-music", "list-ol", "list-ul", "location", "location-arrow", "location-circle", "location-slash", "lock", "lock-alt", "lock-open", "lock-open-alt", "long-arrow-alt-down", "long-arrow-alt-left", "long-arrow-alt-right", "long-arrow-alt-up", "long-arrow-down", "long-arrow-left", "long-arrow-right", "long-arrow-up", "loveseat", "low-vision", "luchador", "luggage-cart", "lungs", "lungs-virus", "mace", "magic", "magnet", "mail-bulk", "mailbox", "male", "mandolin", "map", "map-marked", "map-marked-alt", "map-marker", "map-marker-alt", "map-marker-alt-slash", "map-marker-check", "map-marker-edit", "map-marker-exclamation", "map-marker-minus", "map-marker-plus", "map-marker-question", "map-marker-slash", "map-marker-smile", "map-marker-times", "map-pin", "map-signs", "marker", "mars", "mars-double", "mars-stroke", "mars-stroke-h", "mars-stroke-v", "mask", "meat", "medal", "medkit", "megaphone", "meh", "meh-blank", "meh-rolling-eyes", "memory", "menorah", "mercury", "meteor", "microchip", "microphone", "microphone-alt", "microphone-alt-slash", "microphone-slash", "microphone-stand", "microscope", "microwave", "mind-share", "minus", "minus-circle", "minus-hexagon", "minus-octagon", "minus-square", "mistletoe", "mitten", "mobile", "mobile-alt", "mobile-android", "mobile-android-alt", "money-bill", "money-bill-alt", "money-bill-wave", "money-bill-wave-alt", "money-check", "money-check-alt", "money-check-edit", "money-check-edit-alt", "monitor-heart-rate", "monkey", "monument", "moon", "moon-cloud", "moon-stars", "mortar-pestle", "mosque", "motorcycle", "mountain", "mountains", "mouse", "mouse-alt", "mouse-pointer", "mp3-player", "mug", "mug-hot", "mug-marshmallows", "mug-tea", "music", "music-alt", "music-alt-slash", "music-slash", "narwhal", "network-wired", "neuter", "newspaper", "not-equal", "notes-medical", "object-group", "object-ungroup", "octagon", "oil-can", "oil-temp", "om", "omega", "ornament", "otter", "outdent", "outlet", "oven", "overline", "page-break", "pager", "paint-brush", "paint-brush-alt", "paint-roller", "palette", "pallet", "pallet-alt", "paper-plane", "paperclip", "parachute-box", "paragraph", "paragraph-rtl", "parking", "parking-circle", "parking-circle-slash", "parking-slash", "passport", "pastafarianism", "paste", "pause", "pause-circle", "paw", "paw-alt", "paw-claws", "peace", "pegasus", "pen", "pen-alt", "pen-fancy", "pen-nib", "pen-square", "pencil", "pencil-alt", "pencil-paintbrush", "pencil-ruler", "pennant", "people-arrows", "people-carry", "pepper-hot", "percent", "percentage", "person-booth", "person-carry", "person-dolly", "person-dolly-empty", "person-sign", "phone", "phone-alt", "phone-laptop", "phone-office", "phone-plus", "phone-rotary", "phone-slash", "phone-square", "phone-square-alt", "phone-volume", "photo-video", "pi", "piano", "piano-keyboard", "pie", "pig", "piggy-bank", "pills", "pizza", "pizza-slice", "place-of-worship", "plane", "plane-alt", "plane-arrival", "plane-departure", "plane-slash", "planet-moon", "planet-ringed", "play", "play-circle", "plug", "plus", "plus-circle", "plus-hexagon", "plus-octagon", "plus-square", "podcast", "podium", "podium-star", "police-box", "poll", "poll-h", "poll-people", "poo", "poo-storm", "poop", "popcorn", "portal-enter", "portal-exit", "portrait", "pound-sign", "power-off", "pray", "praying-hands", "prescription", "prescription-bottle", "prescription-bottle-alt", "presentation", "print", "print-search", "print-slash", "procedures", "project-diagram", "projector", "pump-medical", "pump-soap", "pumpkin", "puzzle-piece", "qrcode", "question", "question-circle", "question-square", "quidditch", "quote-left", "quote-right", "quran", "rabbit", "rabbit-fast", "racquet", "radar", "radiation", "radiation-alt", "radio", "radio-alt", "rainbow", "raindrops", "ram", "ramp-loading", "random", "raygun", "receipt", "record-vinyl", "rectangle-landscape", "rectangle-portrait", "rectangle-wide", "recycle", "redo", "redo-alt", "refrigerator", "registered", "remove-format", "repeat", "repeat-1", "repeat-1-alt", "repeat-alt", "reply", "reply-all", "republican", "restroom", "retweet", "retweet-alt", "ribbon", "ring", "rings-wedding", "road", "robot", "rocket", "rocket-launch", "route", "route-highway", "route-interstate", "router", "rss", "rss-square", "ruble-sign", "ruler", "ruler-combined", "ruler-horizontal", "ruler-triangle", "ruler-vertical", "running", "rupee-sign", "rv", "sack", "sack-dollar", "sad-cry", "sad-tear", "salad", "sandwich", "satellite", "satellite-dish", "sausage", "save", "sax-hot", "saxophone", "scalpel", "scalpel-path", "scanner", "scanner-image", "scanner-keyboard", "scanner-touchscreen", "scarecrow", "scarf", "school", "screwdriver", "scroll", "scroll-old", "scrubber", "scythe", "sd-card", "search", "search-dollar", "search-location", "search-minus", "search-plus", "seedling", "send-back", "send-backward", "sensor", "sensor-alert", "sensor-fire", "sensor-on", "sensor-smoke", "server", "shapes", "share", "share-all", "share-alt", "share-alt-square", "share-square", "sheep", "shekel-sign", "shield", "shield-alt", "shield-check", "shield-cross", "shield-virus", "ship", "shipping-fast", "shipping-timed", "shish-kebab", "shoe-prints", "shopping-bag", "shopping-basket", "shopping-cart", "shovel", "shovel-snow", "shower", "shredder", "shuttle-van", "shuttlecock", "sickle", "sigma", "sign", "sign-in", "sign-in-alt", "sign-language", "sign-out", "sign-out-alt", "signal", "signal-1", "signal-2", "signal-3", "signal-4", "signal-alt", "signal-alt-1", "signal-alt-2", "signal-alt-3", "signal-alt-slash", "signal-slash", "signal-stream", "signature", "sim-card", "sink", "siren", "siren-on", "sitemap", "skating", "skeleton", "ski-jump", "ski-lift", "skiing", "skiing-nordic", "skull", "skull-cow", "skull-crossbones", "slash", "sledding", "sleigh", "sliders-h", "sliders-h-square", "sliders-v", "sliders-v-square", "smile", "smile-beam", "smile-plus", "smile-wink", "smog", "smoke", "smoking", "smoking-ban", "sms", "snake", "snooze", "snow-blowing", "snowboarding", "snowflake", "snowflakes", "snowman", "snowmobile", "snowplow", "soap", "socks", "solar-panel", "solar-system", "sort", "sort-alpha-down", "sort-alpha-down-alt", "sort-alpha-up", "sort-alpha-up-alt", "sort-alt", "sort-amount-down", "sort-amount-down-alt", "sort-amount-up", "sort-amount-up-alt", "sort-circle", "sort-circle-down", "sort-circle-up", "sort-down", "sort-numeric-down", "sort-numeric-down-alt", "sort-numeric-up", "sort-numeric-up-alt", "sort-shapes-down", "sort-shapes-down-alt", "sort-shapes-up", "sort-shapes-up-alt", "sort-size-down", "sort-size-down-alt", "sort-size-up", "sort-size-up-alt", "sort-up", "soup", "spa", "space-shuttle", "space-station-moon", "space-station-moon-alt", "spade", "sparkles", "speaker", "speakers", "spell-check", "spider", "spider-black-widow", "spider-web", "spinner", "spinner-third", "splotch", "spray-can", "sprinkler", "square", "square-full", "square-root", "square-root-alt", "squirrel", "staff", "stamp", "star", "star-and-crescent", "star-christmas", "star-exclamation", "star-half", "star-half-alt", "star-of-david", "star-of-life", "star-shooting", "starfighter", "starfighter-alt", "stars", "starship", "starship-freighter", "steak", "steering-wheel", "step-backward", "step-forward", "stethoscope", "sticky-note", "stocking", "stomach", "stop", "stop-circle", "stopwatch", "stopwatch-20", "store", "store-alt", "store-alt-slash", "store-slash", "stream", "street-view", "stretcher", "strikethrough", "stroopwafel", "subscript", "subway", "suitcase", "suitcase-rolling", "sun", "sun-cloud", "sun-dust", "sun-haze", "sunglasses", "sunrise", "sunset", "superscript", "surprise", "swatchbook", "swimmer", "swimming-pool", "sword", "sword-laser", "sword-laser-alt", "swords", "swords-laser", "synagogue", "sync", "sync-alt", "syringe", "table", "table-tennis", "tablet", "tablet-alt", "tablet-android", "tablet-android-alt", "tablet-rugged", "tablets", "tachometer", "tachometer-alt", "tachometer-alt-average", "tachometer-alt-fast", "tachometer-alt-fastest", "tachometer-alt-slow", "tachometer-alt-slowest", "tachometer-average", "tachometer-fast", "tachometer-fastest", "tachometer-slow", "tachometer-slowest", "taco", "tag", "tags", "tally", "tanakh", "tape", "tasks", "tasks-alt", "taxi", "teeth", "teeth-open", "telescope", "temperature-down", "temperature-frigid", "temperature-high", "temperature-hot", "temperature-low", "temperature-up", "tenge", "tennis-ball", "terminal", "text", "text-height", "text-size", "text-width", "th", "th-large", "th-list", "theater-masks", "thermometer", "thermometer-empty", "thermometer-full", "thermometer-half", "thermometer-quarter", "thermometer-three-quarters", "theta", "thumbs-down", "thumbs-up", "thumbtack", "thunderstorm", "thunderstorm-moon", "thunderstorm-sun", "ticket", "ticket-alt", "tilde", "times", "times-circle", "times-hexagon", "times-octagon", "times-square", "tint", "tint-slash", "tire", "tire-flat", "tire-pressure-warning", "tire-rugged", "tired", "toggle-off", "toggle-on", "toilet", "toilet-paper", "toilet-paper-alt", "toilet-paper-slash", "tombstone", "tombstone-alt", "toolbox", "tools", "tooth", "toothbrush", "torah", "torii-gate", "tornado", "tractor", "trademark", "traffic-cone", "traffic-light", "traffic-light-go", "traffic-light-slow", "traffic-light-stop", "trailer", "train", "tram", "transgender", "transgender-alt", "transporter", "transporter-1", "transporter-2", "transporter-3", "transporter-empty", "trash", "trash-alt", "trash-restore", "trash-restore-alt", "trash-undo", "trash-undo-alt", "treasure-chest", "tree", "tree-alt", "tree-christmas", "tree-decorated", "tree-large", "tree-palm", "trees", "triangle", "triangle-music", "trophy", "trophy-alt", "truck", "truck-container", "truck-couch", "truck-loading", "truck-monster", "truck-moving", "truck-pickup", "truck-plow", "truck-ramp", "trumpet", "tshirt", "tty", "turkey", "turntable", "turtle", "tv", "tv-alt", "tv-music", "tv-retro", "typewriter", "ufo", "ufo-beam", "umbrella", "umbrella-beach", "underline", "undo", "undo-alt", "unicorn", "union", "universal-access", "university", "unlink", "unlock", "unlock-alt", "upload", "usb-drive", "usd-circle", "usd-square", "user", "user-alien", "user-alt", "user-alt-slash", "user-astronaut", "user-chart", "user-check", "user-circle", "user-clock", "user-cog", "user-cowboy", "user-crown", "user-edit", "user-friends", "user-graduate", "user-hard-hat", "user-headset", "user-injured", "user-lock", "user-md", "user-md-chat", "user-minus", "user-music", "user-ninja", "user-nurse", "user-plus", "user-robot", "user-secret", "user-shield", "user-slash", "user-tag", "user-tie", "user-times", "user-unlock", "user-visor", "users", "users-class", "users-cog", "users-crown", "users-medical", "users-slash", "utensil-fork", "utensil-knife", "utensil-spoon", "utensils", "utensils-alt", "vacuum", "vacuum-robot", "value-absolute", "vector-square", "venus", "venus-double", "venus-mars", "vest", "vest-patches", "vhs", "vial", "vials", "video", "video-plus", "video-slash", "vihara", "violin", "virus", "virus-slash", "viruses", "voicemail", "volcano", "volleyball-ball", "volume", "volume-down", "volume-mute", "volume-off", "volume-slash", "volume-up", "vote-nay", "vote-yea", "vr-cardboard", "wagon-covered", "walker", "walkie-talkie", "walking", "wallet", "wand", "wand-magic", "warehouse", "warehouse-alt", "washer", "watch", "watch-calculator", "watch-fitness", "water", "water-lower", "water-rise", "wave-sine", "wave-square", "wave-triangle", "waveform", "waveform-path", "webcam", "webcam-slash", "weight", "weight-hanging", "whale", "wheat", "wheelchair", "whistle", "wifi", "wifi-1", "wifi-2", "wifi-slash", "wind", "wind-turbine", "wind-warning", "window", "window-alt", "window-close", "window-frame", "window-frame-open", "window-maximize", "window-minimize", "window-restore", "windsock", "wine-bottle", "wine-glass", "wine-glass-alt", "won-sign", "wreath", "wrench", "x-ray", "yen-sign", "yin-yang"],
"fal": ["abacus", "acorn", "ad", "address-book", "address-card", "adjust", "air-conditioner", "air-freshener", "alarm-clock", "alarm-exclamation", "alarm-plus", "alarm-snooze", "album", "album-collection", "alicorn", "alien", "alien-monster", "align-center", "align-justify", "align-left", "align-right", "align-slash", "allergies", "ambulance", "american-sign-language-interpreting", "amp-guitar", "analytics", "anchor", "angel", "angle-double-down", "angle-double-left", "angle-double-right", "angle-double-up", "angle-down", "angle-left", "angle-right", "angle-up", "angry", "ankh", "apple-alt", "apple-crate", "archive", "archway", "arrow-alt-circle-down", "arrow-alt-circle-left", "arrow-alt-circle-right", "arrow-alt-circle-up", "arrow-alt-down", "arrow-alt-from-bottom", "arrow-alt-from-left", "arrow-alt-from-right", "arrow-alt-from-top", "arrow-alt-left", "arrow-alt-right", "arrow-alt-square-down", "arrow-alt-square-left", "arrow-alt-square-right", "arrow-alt-square-up", "arrow-alt-to-bottom", "arrow-alt-to-left", "arrow-alt-to-right", "arrow-alt-to-top", "arrow-alt-up", "arrow-circle-down", "arrow-circle-left", "arrow-circle-right", "arrow-circle-up", "arrow-down", "arrow-from-bottom", "arrow-from-left", "arrow-from-right", "arrow-from-top", "arrow-left", "arrow-right", "arrow-square-down", "arrow-square-left", "arrow-square-right", "arrow-square-up", "arrow-to-bottom", "arrow-to-left", "arrow-to-right", "arrow-to-top", "arrow-up", "arrows", "arrows-alt", "arrows-alt-h", "arrows-alt-v", "arrows-h", "arrows-v", "assistive-listening-systems", "asterisk", "at", "atlas", "atom", "atom-alt", "audio-description", "award", "axe", "axe-battle", "baby", "baby-carriage", "backpack", "backspace", "backward", "bacon", "bacteria", "bacterium", "badge", "badge-check", "badge-dollar", "badge-percent", "badge-sheriff", "badger-honey", "bags-shopping", "bahai", "balance-scale", "balance-scale-left", "balance-scale-right", "ball-pile", "ballot", "ballot-check", "ban", "band-aid", "banjo", "barcode", "barcode-alt", "barcode-read", "barcode-scan", "bars", "baseball", "baseball-ball", "basketball-ball", "basketball-hoop", "bat", "bath", "battery-bolt", "battery-empty", "battery-full", "battery-half", "battery-quarter", "battery-slash", "battery-three-quarters", "bed", "bed-alt", "bed-bunk", "bed-empty", "beer", "bell", "bell-exclamation", "bell-on", "bell-plus", "bell-school", "bell-school-slash", "bell-slash", "bells", "betamax", "bezier-curve", "bible", "bicycle", "biking", "biking-mountain", "binoculars", "biohazard", "birthday-cake", "blanket", "blender", "blender-phone", "blind", "blinds", "blinds-open", "blinds-raised", "blog", "bold", "bolt", "bomb", "bone", "bone-break", "bong", "book", "book-alt", "book-dead", "book-heart", "book-medical", "book-open", "book-reader", "book-spells", "book-user", "bookmark", "books", "books-medical", "boombox", "boot", "booth-curtain", "border-all", "border-bottom", "border-center-h", "border-center-v", "border-inner", "border-left", "border-none", "border-outer", "border-right", "border-style", "border-style-alt", "border-top", "bow-arrow", "bowling-ball", "bowling-pins", "box", "box-alt", "box-ballot", "box-check", "box-fragile", "box-full", "box-heart", "box-open", "box-tissue", "box-up", "box-usd", "boxes", "boxes-alt", "boxing-glove", "brackets", "brackets-curly", "braille", "brain", "bread-loaf", "bread-slice", "briefcase", "briefcase-medical", "bring-forward", "bring-front", "broadcast-tower", "broom", "browser", "brush", "bug", "building", "bullhorn", "bullseye", "bullseye-arrow", "bullseye-pointer", "burger-soda", "burn", "burrito", "bus", "bus-alt", "bus-school", "business-time", "cabinet-filing", "cactus", "calculator", "calculator-alt", "calendar", "calendar-alt", "calendar-check", "calendar-day", "calendar-edit", "calendar-exclamation", "calendar-minus", "calendar-plus", "calendar-star", "calendar-times", "calendar-week", "camcorder", "camera", "camera-alt", "camera-home", "camera-movie", "camera-polaroid", "camera-retro", "campfire", "campground", "candle-holder", "candy-cane", "candy-corn", "cannabis", "capsules", "car", "car-alt", "car-battery", "car-building", "car-bump", "car-bus", "car-crash", "car-garage", "car-mechanic", "car-side", "car-tilt", "car-wash", "caravan", "caravan-alt", "caret-circle-down", "caret-circle-left", "caret-circle-right", "caret-circle-up", "caret-down", "caret-left", "caret-right", "caret-square-down", "caret-square-left", "caret-square-right", "caret-square-up", "caret-up", "carrot", "cars", "cart-arrow-down", "cart-plus", "cash-register", "cassette-tape", "cat", "cat-space", "cauldron", "cctv", "certificate", "chair", "chair-office", "chalkboard", "chalkboard-teacher", "charging-station", "chart-area", "chart-bar", "chart-line", "chart-line-down", "chart-network", "chart-pie", "chart-pie-alt", "chart-scatter", "check", "check-circle", "check-double", "check-square", "cheese", "cheese-swiss", "cheeseburger", "chess", "chess-bishop", "chess-bishop-alt", "chess-board", "chess-clock", "chess-clock-alt", "chess-king", "chess-king-alt", "chess-knight", "chess-knight-alt", "chess-pawn", "chess-pawn-alt", "chess-queen", "chess-queen-alt", "chess-rook", "chess-rook-alt", "chevron-circle-down", "chevron-circle-left", "chevron-circle-right", "chevron-circle-up", "chevron-double-down", "chevron-double-left", "chevron-double-right", "chevron-double-up", "chevron-down", "chevron-left", "chevron-right", "chevron-square-down", "chevron-square-left", "chevron-square-right", "chevron-square-up", "chevron-up", "child", "chimney", "church", "circle", "circle-notch", "city", "clarinet", "claw-marks", "clinic-medical", "clipboard", "clipboard-check", "clipboard-list", "clipboard-list-check", "clipboard-prescription", "clipboard-user", "clock", "clone", "closed-captioning", "cloud", "cloud-download", "cloud-download-alt", "cloud-drizzle", "cloud-hail", "cloud-hail-mixed", "cloud-meatball", "cloud-moon", "cloud-moon-rain", "cloud-music", "cloud-rain", "cloud-rainbow", "cloud-showers", "cloud-showers-heavy", "cloud-sleet", "cloud-snow", "cloud-sun", "cloud-sun-rain", "cloud-upload", "cloud-upload-alt", "clouds", "clouds-moon", "clouds-sun", "club", "cocktail", "code", "code-branch", "code-commit", "code-merge", "coffee", "coffee-pot", "coffee-togo", "coffin", "coffin-cross", "cog", "cogs", "coin", "coins", "columns", "comet", "comment", "comment-alt", "comment-alt-check", "comment-alt-dollar", "comment-alt-dots", "comment-alt-edit", "comment-alt-exclamation", "comment-alt-lines", "comment-alt-medical", "comment-alt-minus", "comment-alt-music", "comment-alt-plus", "comment-alt-slash", "comment-alt-smile", "comment-alt-times", "comment-check", "comment-dollar", "comment-dots", "comment-edit", "comment-exclamation", "comment-lines", "comment-medical", "comment-minus", "comment-music", "comment-plus", "comment-slash", "comment-smile", "comment-times", "comments", "comments-alt", "comments-alt-dollar", "comments-dollar", "compact-disc", "compass", "compass-slash", "compress", "compress-alt", "compress-arrows-alt", "compress-wide", "computer-classic", "computer-speaker", "concierge-bell", "construction", "container-storage", "conveyor-belt", "conveyor-belt-alt", "cookie", "cookie-bite", "copy", "copyright", "corn", "couch", "cow", "cowbell", "cowbell-more", "credit-card", "credit-card-blank", "credit-card-front", "cricket", "croissant", "crop", "crop-alt", "cross", "crosshairs", "crow", "crown", "crutch", "crutches", "cube", "cubes", "curling", "cut", "dagger", "database", "deaf", "debug", "deer", "deer-rudolph", "democrat", "desktop", "desktop-alt", "dewpoint", "dharmachakra", "diagnoses", "diamond", "dice", "dice-d10", "dice-d12", "dice-d20", "dice-d4", "dice-d6", "dice-d8", "dice-five", "dice-four", "dice-one", "dice-six", "dice-three", "dice-two", "digging", "digital-tachograph", "diploma", "directions", "disc-drive", "disease", "divide", "dizzy", "dna", "do-not-enter", "dog", "dog-leashed", "dollar-sign", "dolly", "dolly-empty", "dolly-flatbed", "dolly-flatbed-alt", "dolly-flatbed-empty", "donate", "door-closed", "door-open", "dot-circle", "dove", "download", "drafting-compass", "dragon", "draw-circle", "draw-polygon", "draw-square", "dreidel", "drone", "drone-alt", "drum", "drum-steelpan", "drumstick", "drumstick-bite", "dryer", "dryer-alt", "duck", "dumbbell", "dumpster", "dumpster-fire", "dungeon", "ear", "ear-muffs", "eclipse", "eclipse-alt", "edit", "egg", "egg-fried", "eject", "elephant", "ellipsis-h", "ellipsis-h-alt", "ellipsis-v", "ellipsis-v-alt", "empty-set", "engine-warning", "envelope", "envelope-open", "envelope-open-dollar", "envelope-open-text", "envelope-square", "equals", "eraser", "ethernet", "euro-sign", "exchange", "exchange-alt", "exclamation", "exclamation-circle", "exclamation-square", "exclamation-triangle", "expand", "expand-alt", "expand-arrows", "expand-arrows-alt", "expand-wide", "external-link", "external-link-alt", "external-link-square", "external-link-square-alt", "eye", "eye-dropper", "eye-evil", "eye-slash", "fan", "fan-table", "farm", "fast-backward", "fast-forward", "faucet", "faucet-drip", "fax", "feather", "feather-alt", "female", "field-hockey", "fighter-jet", "file", "file-alt", "file-archive", "file-audio", "file-certificate", "file-chart-line", "file-chart-pie", "file-check", "file-code", "file-contract", "file-csv", "file-download", "file-edit", "file-excel", "file-exclamation", "file-export", "file-image", "file-import", "file-invoice", "file-invoice-dollar", "file-medical", "file-medical-alt", "file-minus", "file-music", "file-pdf", "file-plus", "file-powerpoint", "file-prescription", "file-search", "file-signature", "file-spreadsheet", "file-times", "file-upload", "file-user", "file-video", "file-word", "files-medical", "fill", "fill-drip", "film", "film-alt", "film-canister", "filter", "fingerprint", "fire", "fire-alt", "fire-extinguisher", "fire-smoke", "fireplace", "first-aid", "fish", "fish-cooked", "fist-raised", "flag", "flag-alt", "flag-checkered", "flag-usa", "flame", "flashlight", "flask", "flask-poison", "flask-potion", "flower", "flower-daffodil", "flower-tulip", "flushed", "flute", "flux-capacitor", "fog", "folder", "folder-download", "folder-minus", "folder-open", "folder-plus", "folder-times", "folder-tree", "folder-upload", "folders", "font", "font-awesome-logo-full", "font-case", "football-ball", "football-helmet", "forklift", "forward", "fragile", "french-fries", "frog", "frosty-head", "frown", "frown-open", "function", "funnel-dollar", "futbol", "galaxy", "game-board", "game-board-alt", "game-console-handheld", "gamepad", "gamepad-alt", "garage", "garage-car", "garage-open", "gas-pump", "gas-pump-slash", "gavel", "gem", "genderless", "ghost", "gift", "gift-card", "gifts", "gingerbread-man", "glass", "glass-champagne", "glass-cheers", "glass-citrus", "glass-martini", "glass-martini-alt", "glass-whiskey", "glass-whiskey-rocks", "glasses", "glasses-alt", "globe", "globe-africa", "globe-americas", "globe-asia", "globe-europe", "globe-snow", "globe-stand", "golf-ball", "golf-club", "gopuram", "graduation-cap", "gramophone", "greater-than", "greater-than-equal", "grimace", "grin", "grin-alt", "grin-beam", "grin-beam-sweat", "grin-hearts", "grin-squint", "grin-squint-tears", "grin-stars", "grin-tears", "grin-tongue", "grin-tongue-squint", "grin-tongue-wink", "grin-wink", "grip-horizontal", "grip-lines", "grip-lines-vertical", "grip-vertical", "guitar", "guitar-electric", "guitars", "h-square", "h1", "h2", "h3", "h4", "hamburger", "hammer", "hammer-war", "hamsa", "hand-heart", "hand-holding", "hand-holding-box", "hand-holding-heart", "hand-holding-magic", "hand-holding-medical", "hand-holding-seedling", "hand-holding-usd", "hand-holding-water", "hand-lizard", "hand-middle-finger", "hand-paper", "hand-peace", "hand-point-down", "hand-point-left", "hand-point-right", "hand-point-up", "hand-pointer", "hand-receiving", "hand-rock", "hand-scissors", "hand-sparkles", "hand-spock", "hands", "hands-heart", "hands-helping", "hands-usd", "hands-wash", "handshake", "handshake-alt", "handshake-alt-slash", "handshake-slash", "hanukiah", "hard-hat", "hashtag", "hat-chef", "hat-cowboy", "hat-cowboy-side", "hat-santa", "hat-winter", "hat-witch", "hat-wizard", "hdd", "head-side", "head-side-brain", "head-side-cough", "head-side-cough-slash", "head-side-headphones", "head-side-mask", "head-side-medical", "head-side-virus", "head-vr", "heading", "headphones", "headphones-alt", "headset", "heart", "heart-broken", "heart-circle", "heart-rate", "heart-square", "heartbeat", "heat", "helicopter", "helmet-battle", "hexagon", "highlighter", "hiking", "hippo", "history", "hockey-mask", "hockey-puck", "hockey-sticks", "holly-berry", "home", "home-alt", "home-heart", "home-lg", "home-lg-alt", "hood-cloak", "horizontal-rule", "horse", "horse-head", "horse-saddle", "hospital", "hospital-alt", "hospital-symbol", "hospital-user", "hospitals", "hot-tub", "hotdog", "hotel", "hourglass", "hourglass-end", "hourglass-half", "hourglass-start", "house", "house-damage", "house-day", "house-flood", "house-leave", "house-night", "house-return", "house-signal", "house-user", "hryvnia", "humidity", "hurricane", "i-cursor", "ice-cream", "ice-skate", "icicles", "icons", "icons-alt", "id-badge", "id-card", "id-card-alt", "igloo", "image", "image-polaroid", "images", "inbox", "inbox-in", "inbox-out", "indent", "industry", "industry-alt", "infinity", "info", "info-circle", "info-square", "inhaler", "integral", "intersection", "inventory", "island-tropical", "italic", "jack-o-lantern", "jedi", "joint", "journal-whills", "joystick", "jug", "kaaba", "kazoo", "kerning", "key", "key-skeleton", "keyboard", "keynote", "khanda", "kidneys", "kiss", "kiss-beam", "kiss-wink-heart", "kite", "kiwi-bird", "knife-kitchen", "lambda", "lamp", "lamp-desk", "lamp-floor", "landmark", "landmark-alt", "language", "laptop", "laptop-code", "laptop-house", "laptop-medical", "lasso", "laugh", "laugh-beam", "laugh-squint", "laugh-wink", "layer-group", "layer-minus", "layer-plus", "leaf", "leaf-heart", "leaf-maple", "leaf-oak", "lemon", "less-than", "less-than-equal", "level-down", "level-down-alt", "level-up", "level-up-alt", "life-ring", "light-ceiling", "light-switch", "light-switch-off", "light-switch-on", "lightbulb", "lightbulb-dollar", "lightbulb-exclamation", "lightbulb-on", "lightbulb-slash", "lights-holiday", "line-columns", "line-height", "link", "lips", "lira-sign", "list", "list-alt", "list-music", "list-ol", "list-ul", "location", "location-arrow", "location-circle", "location-slash", "lock", "lock-alt", "lock-open", "lock-open-alt", "long-arrow-alt-down", "long-arrow-alt-left", "long-arrow-alt-right", "long-arrow-alt-up", "long-arrow-down", "long-arrow-left", "long-arrow-right", "long-arrow-up", "loveseat", "low-vision", "luchador", "luggage-cart", "lungs", "lungs-virus", "mace", "magic", "magnet", "mail-bulk", "mailbox", "male", "mandolin", "map", "map-marked", "map-marked-alt", "map-marker", "map-marker-alt", "map-marker-alt-slash", "map-marker-check", "map-marker-edit", "map-marker-exclamation", "map-marker-minus", "map-marker-plus", "map-marker-question", "map-marker-slash", "map-marker-smile", "map-marker-times", "map-pin", "map-signs", "marker", "mars", "mars-double", "mars-stroke", "mars-stroke-h", "mars-stroke-v", "mask", "meat", "medal", "medkit", "megaphone", "meh", "meh-blank", "meh-rolling-eyes", "memory", "menorah", "mercury", "meteor", "microchip", "microphone", "microphone-alt", "microphone-alt-slash", "microphone-slash", "microphone-stand", "microscope", "microwave", "mind-share", "minus", "minus-circle", "minus-hexagon", "minus-octagon", "minus-square", "mistletoe", "mitten", "mobile", "mobile-alt", "mobile-android", "mobile-android-alt", "money-bill", "money-bill-alt", "money-bill-wave", "money-bill-wave-alt", "money-check", "money-check-alt", "money-check-edit", "money-check-edit-alt", "monitor-heart-rate", "monkey", "monument", "moon", "moon-cloud", "moon-stars", "mortar-pestle", "mosque", "motorcycle", "mountain", "mountains", "mouse", "mouse-alt", "mouse-pointer", "mp3-player", "mug", "mug-hot", "mug-marshmallows", "mug-tea", "music", "music-alt", "music-alt-slash", "music-slash", "narwhal", "network-wired", "neuter", "newspaper", "not-equal", "notes-medical", "object-group", "object-ungroup", "octagon", "oil-can", "oil-temp", "om", "omega", "ornament", "otter", "outdent", "outlet", "oven", "overline", "page-break", "pager", "paint-brush", "paint-brush-alt", "paint-roller", "palette", "pallet", "pallet-alt", "paper-plane", "paperclip", "parachute-box", "paragraph", "paragraph-rtl", "parking", "parking-circle", "parking-circle-slash", "parking-slash", "passport", "pastafarianism", "paste", "pause", "pause-circle", "paw", "paw-alt", "paw-claws", "peace", "pegasus", "pen", "pen-alt", "pen-fancy", "pen-nib", "pen-square", "pencil", "pencil-alt", "pencil-paintbrush", "pencil-ruler", "pennant", "people-arrows", "people-carry", "pepper-hot", "percent", "percentage", "person-booth", "person-carry", "person-dolly", "person-dolly-empty", "person-sign", "phone", "phone-alt", "phone-laptop", "phone-office", "phone-plus", "phone-rotary", "phone-slash", "phone-square", "phone-square-alt", "phone-volume", "photo-video", "pi", "piano", "piano-keyboard", "pie", "pig", "piggy-bank", "pills", "pizza", "pizza-slice", "place-of-worship", "plane", "plane-alt", "plane-arrival", "plane-departure", "plane-slash", "planet-moon", "planet-ringed", "play", "play-circle", "plug", "plus", "plus-circle", "plus-hexagon", "plus-octagon", "plus-square", "podcast", "podium", "podium-star", "police-box", "poll", "poll-h", "poll-people", "poo", "poo-storm", "poop", "popcorn", "portal-enter", "portal-exit", "portrait", "pound-sign", "power-off", "pray", "praying-hands", "prescription", "prescription-bottle", "prescription-bottle-alt", "presentation", "print", "print-search", "print-slash", "procedures", "project-diagram", "projector", "pump-medical", "pump-soap", "pumpkin", "puzzle-piece", "qrcode", "question", "question-circle", "question-square", "quidditch", "quote-left", "quote-right", "quran", "rabbit", "rabbit-fast", "racquet", "radar", "radiation", "radiation-alt", "radio", "radio-alt", "rainbow", "raindrops", "ram", "ramp-loading", "random", "raygun", "receipt", "record-vinyl", "rectangle-landscape", "rectangle-portrait", "rectangle-wide", "recycle", "redo", "redo-alt", "refrigerator", "registered", "remove-format", "repeat", "repeat-1", "repeat-1-alt", "repeat-alt", "reply", "reply-all", "republican", "restroom", "retweet", "retweet-alt", "ribbon", "ring", "rings-wedding", "road", "robot", "rocket", "rocket-launch", "route", "route-highway", "route-interstate", "router", "rss", "rss-square", "ruble-sign", "ruler", "ruler-combined", "ruler-horizontal", "ruler-triangle", "ruler-vertical", "running", "rupee-sign", "rv", "sack", "sack-dollar", "sad-cry", "sad-tear", "salad", "sandwich", "satellite", "satellite-dish", "sausage", "save", "sax-hot", "saxophone", "scalpel", "scalpel-path", "scanner", "scanner-image", "scanner-keyboard", "scanner-touchscreen", "scarecrow", "scarf", "school", "screwdriver", "scroll", "scroll-old", "scrubber", "scythe", "sd-card", "search", "search-dollar", "search-location", "search-minus", "search-plus", "seedling", "send-back", "send-backward", "sensor", "sensor-alert", "sensor-fire", "sensor-on", "sensor-smoke", "server", "shapes", "share", "share-all", "share-alt", "share-alt-square", "share-square", "sheep", "shekel-sign", "shield", "shield-alt", "shield-check", "shield-cross", "shield-virus", "ship", "shipping-fast", "shipping-timed", "shish-kebab", "shoe-prints", "shopping-bag", "shopping-basket", "shopping-cart", "shovel", "shovel-snow", "shower", "shredder", "shuttle-van", "shuttlecock", "sickle", "sigma", "sign", "sign-in", "sign-in-alt", "sign-language", "sign-out", "sign-out-alt", "signal", "signal-1", "signal-2", "signal-3", "signal-4", "signal-alt", "signal-alt-1", "signal-alt-2", "signal-alt-3", "signal-alt-slash", "signal-slash", "signal-stream", "signature", "sim-card", "sink", "siren", "siren-on", "sitemap", "skating", "skeleton", "ski-jump", "ski-lift", "skiing", "skiing-nordic", "skull", "skull-cow", "skull-crossbones", "slash", "sledding", "sleigh", "sliders-h", "sliders-h-square", "sliders-v", "sliders-v-square", "smile", "smile-beam", "smile-plus", "smile-wink", "smog", "smoke", "smoking", "smoking-ban", "sms", "snake", "snooze", "snow-blowing", "snowboarding", "snowflake", "snowflakes", "snowman", "snowmobile", "snowplow", "soap", "socks", "solar-panel", "solar-system", "sort", "sort-alpha-down", "sort-alpha-down-alt", "sort-alpha-up", "sort-alpha-up-alt", "sort-alt", "sort-amount-down", "sort-amount-down-alt", "sort-amount-up", "sort-amount-up-alt", "sort-circle", "sort-circle-down", "sort-circle-up", "sort-down", "sort-numeric-down", "sort-numeric-down-alt", "sort-numeric-up", "sort-numeric-up-alt", "sort-shapes-down", "sort-shapes-down-alt", "sort-shapes-up", "sort-shapes-up-alt", "sort-size-down", "sort-size-down-alt", "sort-size-up", "sort-size-up-alt", "sort-up", "soup", "spa", "space-shuttle", "space-station-moon", "space-station-moon-alt", "spade", "sparkles", "speaker", "speakers", "spell-check", "spider", "spider-black-widow", "spider-web", "spinner", "spinner-third", "splotch", "spray-can", "sprinkler", "square", "square-full", "square-root", "square-root-alt", "squirrel", "staff", "stamp", "star", "star-and-crescent", "star-christmas", "star-exclamation", "star-half", "star-half-alt", "star-of-david", "star-of-life", "star-shooting", "starfighter", "starfighter-alt", "stars", "starship", "starship-freighter", "steak", "steering-wheel", "step-backward", "step-forward", "stethoscope", "sticky-note", "stocking", "stomach", "stop", "stop-circle", "stopwatch", "stopwatch-20", "store", "store-alt", "store-alt-slash", "store-slash", "stream", "street-view", "stretcher", "strikethrough", "stroopwafel", "subscript", "subway", "suitcase", "suitcase-rolling", "sun", "sun-cloud", "sun-dust", "sun-haze", "sunglasses", "sunrise", "sunset", "superscript", "surprise", "swatchbook", "swimmer", "swimming-pool", "sword", "sword-laser", "sword-laser-alt", "swords", "swords-laser", "synagogue", "sync", "sync-alt", "syringe", "table", "table-tennis", "tablet", "tablet-alt", "tablet-android", "tablet-android-alt", "tablet-rugged", "tablets", "tachometer", "tachometer-alt", "tachometer-alt-average", "tachometer-alt-fast", "tachometer-alt-fastest", "tachometer-alt-slow", "tachometer-alt-slowest", "tachometer-average", "tachometer-fast", "tachometer-fastest", "tachometer-slow", "tachometer-slowest", "taco", "tag", "tags", "tally", "tanakh", "tape", "tasks", "tasks-alt", "taxi", "teeth", "teeth-open", "telescope", "temperature-down", "temperature-frigid", "temperature-high", "temperature-hot", "temperature-low", "temperature-up", "tenge", "tennis-ball", "terminal", "text", "text-height", "text-size", "text-width", "th", "th-large", "th-list", "theater-masks", "thermometer", "thermometer-empty", "thermometer-full", "thermometer-half", "thermometer-quarter", "thermometer-three-quarters", "theta", "thumbs-down", "thumbs-up", "thumbtack", "thunderstorm", "thunderstorm-moon", "thunderstorm-sun", "ticket", "ticket-alt", "tilde", "times", "times-circle", "times-hexagon", "times-octagon", "times-square", "tint", "tint-slash", "tire", "tire-flat", "tire-pressure-warning", "tire-rugged", "tired", "toggle-off", "toggle-on", "toilet", "toilet-paper", "toilet-paper-alt", "toilet-paper-slash", "tombstone", "tombstone-alt", "toolbox", "tools", "tooth", "toothbrush", "torah", "torii-gate", "tornado", "tractor", "trademark", "traffic-cone", "traffic-light", "traffic-light-go", "traffic-light-slow", "traffic-light-stop", "trailer", "train", "tram", "transgender", "transgender-alt", "transporter", "transporter-1", "transporter-2", "transporter-3", "transporter-empty", "trash", "trash-alt", "trash-restore", "trash-restore-alt", "trash-undo", "trash-undo-alt", "treasure-chest", "tree", "tree-alt", "tree-christmas", "tree-decorated", "tree-large", "tree-palm", "trees", "triangle", "triangle-music", "trophy", "trophy-alt", "truck", "truck-container", "truck-couch", "truck-loading", "truck-monster", "truck-moving", "truck-pickup", "truck-plow", "truck-ramp", "trumpet", "tshirt", "tty", "turkey", "turntable", "turtle", "tv", "tv-alt", "tv-music", "tv-retro", "typewriter", "ufo", "ufo-beam", "umbrella", "umbrella-beach", "underline", "undo", "undo-alt", "unicorn", "union", "universal-access", "university", "unlink", "unlock", "unlock-alt", "upload", "usb-drive", "usd-circle", "usd-square", "user", "user-alien", "user-alt", "user-alt-slash", "user-astronaut", "user-chart", "user-check", "user-circle", "user-clock", "user-cog", "user-cowboy", "user-crown", "user-edit", "user-friends", "user-graduate", "user-hard-hat", "user-headset", "user-injured", "user-lock", "user-md", "user-md-chat", "user-minus", "user-music", "user-ninja", "user-nurse", "user-plus", "user-robot", "user-secret", "user-shield", "user-slash", "user-tag", "user-tie", "user-times", "user-unlock", "user-visor", "users", "users-class", "users-cog", "users-crown", "users-medical", "users-slash", "utensil-fork", "utensil-knife", "utensil-spoon", "utensils", "utensils-alt", "vacuum", "vacuum-robot", "value-absolute", "vector-square", "venus", "venus-double", "venus-mars", "vest", "vest-patches", "vhs", "vial", "vials", "video", "video-plus", "video-slash", "vihara", "violin", "virus", "virus-slash", "viruses", "voicemail", "volcano", "volleyball-ball", "volume", "volume-down", "volume-mute", "volume-off", "volume-slash", "volume-up", "vote-nay", "vote-yea", "vr-cardboard", "wagon-covered", "walker", "walkie-talkie", "walking", "wallet", "wand", "wand-magic", "warehouse", "warehouse-alt", "washer", "watch", "watch-calculator", "watch-fitness", "water", "water-lower", "water-rise", "wave-sine", "wave-square", "wave-triangle", "waveform", "waveform-path", "webcam", "webcam-slash", "weight", "weight-hanging", "whale", "wheat", "wheelchair", "whistle", "wifi", "wifi-1", "wifi-2", "wifi-slash", "wind", "wind-turbine", "wind-warning", "window", "window-alt", "window-close", "window-frame", "window-frame-open", "window-maximize", "window-minimize", "window-restore", "windsock", "wine-bottle", "wine-glass", "wine-glass-alt", "won-sign", "wreath", "wrench", "x-ray", "yen-sign", "yin-yang"],
"fas": ["abacus", "acorn", "ad", "address-book", "address-card", "adjust", "air-conditioner", "air-freshener", "alarm-clock", "alarm-exclamation", "alarm-plus", "alarm-snooze", "album", "album-collection", "alicorn", "alien", "alien-monster", "align-center", "align-justify", "align-left", "align-right", "align-slash", "allergies", "ambulance", "american-sign-language-interpreting", "amp-guitar", "analytics", "anchor", "angel", "angle-double-down", "angle-double-left", "angle-double-right", "angle-double-up", "angle-down", "angle-left", "angle-right", "angle-up", "angry", "ankh", "apple-alt", "apple-crate", "archive", "archway", "arrow-alt-circle-down", "arrow-alt-circle-left", "arrow-alt-circle-right", "arrow-alt-circle-up", "arrow-alt-down", "arrow-alt-from-bottom", "arrow-alt-from-left", "arrow-alt-from-right", "arrow-alt-from-top", "arrow-alt-left", "arrow-alt-right", "arrow-alt-square-down", "arrow-alt-square-left", "arrow-alt-square-right", "arrow-alt-square-up", "arrow-alt-to-bottom", "arrow-alt-to-left", "arrow-alt-to-right", "arrow-alt-to-top", "arrow-alt-up", "arrow-circle-down", "arrow-circle-left", "arrow-circle-right", "arrow-circle-up", "arrow-down", "arrow-from-bottom", "arrow-from-left", "arrow-from-right", "arrow-from-top", "arrow-left", "arrow-right", "arrow-square-down", "arrow-square-left", "arrow-square-right", "arrow-square-up", "arrow-to-bottom", "arrow-to-left", "arrow-to-right", "arrow-to-top", "arrow-up", "arrows", "arrows-alt", "arrows-alt-h", "arrows-alt-v", "arrows-h", "arrows-v", "assistive-listening-systems", "asterisk", "at", "atlas", "atom", "atom-alt", "audio-description", "award", "axe", "axe-battle", "baby", "baby-carriage", "backpack", "backspace", "backward", "bacon", "bacteria", "bacterium", "badge", "badge-check", "badge-dollar", "badge-percent", "badge-sheriff", "badger-honey", "bags-shopping", "bahai", "balance-scale", "balance-scale-left", "balance-scale-right", "ball-pile", "ballot", "ballot-check", "ban", "band-aid", "banjo", "barcode", "barcode-alt", "barcode-read", "barcode-scan", "bars", "baseball", "baseball-ball", "basketball-ball", "basketball-hoop", "bat", "bath", "battery-bolt", "battery-empty", "battery-full", "battery-half", "battery-quarter", "battery-slash", "battery-three-quarters", "bed", "bed-alt", "bed-bunk", "bed-empty", "beer", "bell", "bell-exclamation", "bell-on", "bell-plus", "bell-school", "bell-school-slash", "bell-slash", "bells", "betamax", "bezier-curve", "bible", "bicycle", "biking", "biking-mountain", "binoculars", "biohazard", "birthday-cake", "blanket", "blender", "blender-phone", "blind", "blinds", "blinds-open", "blinds-raised", "blog", "bold", "bolt", "bomb", "bone", "bone-break", "bong", "book", "book-alt", "book-dead", "book-heart", "book-medical", "book-open", "book-reader", "book-spells", "book-user", "bookmark", "books", "books-medical", "boombox", "boot", "booth-curtain", "border-all", "border-bottom", "border-center-h", "border-center-v", "border-inner", "border-left", "border-none", "border-outer", "border-right", "border-style", "border-style-alt", "border-top", "bow-arrow", "bowling-ball", "bowling-pins", "box", "box-alt", "box-ballot", "box-check", "box-fragile", "box-full", "box-heart", "box-open", "box-tissue", "box-up", "box-usd", "boxes", "boxes-alt", "boxing-glove", "brackets", "brackets-curly", "braille", "brain", "bread-loaf", "bread-slice", "briefcase", "briefcase-medical", "bring-forward", "bring-front", "broadcast-tower", "broom", "browser", "brush", "bug", "building", "bullhorn", "bullseye", "bullseye-arrow", "bullseye-pointer", "burger-soda", "burn", "burrito", "bus", "bus-alt", "bus-school", "business-time", "cabinet-filing", "cactus", "calculator", "calculator-alt", "calendar", "calendar-alt", "calendar-check", "calendar-day", "calendar-edit", "calendar-exclamation", "calendar-minus", "calendar-plus", "calendar-star", "calendar-times", "calendar-week", "camcorder", "camera", "camera-alt", "camera-home", "camera-movie", "camera-polaroid", "camera-retro", "campfire", "campground", "candle-holder", "candy-cane", "candy-corn", "cannabis", "capsules", "car", "car-alt", "car-battery", "car-building", "car-bump", "car-bus", "car-crash", "car-garage", "car-mechanic", "car-side", "car-tilt", "car-wash", "caravan", "caravan-alt", "caret-circle-down", "caret-circle-left", "caret-circle-right", "caret-circle-up", "caret-down", "caret-left", "caret-right", "caret-square-down", "caret-square-left", "caret-square-right", "caret-square-up", "caret-up", "carrot", "cars", "cart-arrow-down", "cart-plus", "cash-register", "cassette-tape", "cat", "cat-space", "cauldron", "cctv", "certificate", "chair", "chair-office", "chalkboard", "chalkboard-teacher", "charging-station", "chart-area", "chart-bar", "chart-line", "chart-line-down", "chart-network", "chart-pie", "chart-pie-alt", "chart-scatter", "check", "check-circle", "check-double", "check-square", "cheese", "cheese-swiss", "cheeseburger", "chess", "chess-bishop", "chess-bishop-alt", "chess-board", "chess-clock", "chess-clock-alt", "chess-king", "chess-king-alt", "chess-knight", "chess-knight-alt", "chess-pawn", "chess-pawn-alt", "chess-queen", "chess-queen-alt", "chess-rook", "chess-rook-alt", "chevron-circle-down", "chevron-circle-left", "chevron-circle-right", "chevron-circle-up", "chevron-double-down", "chevron-double-left", "chevron-double-right", "chevron-double-up", "chevron-down", "chevron-left", "chevron-right", "chevron-square-down", "chevron-square-left", "chevron-square-right", "chevron-square-up", "chevron-up", "child", "chimney", "church", "circle", "circle-notch", "city", "clarinet", "claw-marks", "clinic-medical", "clipboard", "clipboard-check", "clipboard-list", "clipboard-list-check", "clipboard-prescription", "clipboard-user", "clock", "clone", "closed-captioning", "cloud", "cloud-download", "cloud-download-alt", "cloud-drizzle", "cloud-hail", "cloud-hail-mixed", "cloud-meatball", "cloud-moon", "cloud-moon-rain", "cloud-music", "cloud-rain", "cloud-rainbow", "cloud-showers", "cloud-showers-heavy", "cloud-sleet", "cloud-snow", "cloud-sun", "cloud-sun-rain", "cloud-upload", "cloud-upload-alt", "clouds", "clouds-moon", "clouds-sun", "club", "cocktail", "code", "code-branch", "code-commit", "code-merge", "coffee", "coffee-pot", "coffee-togo", "coffin", "coffin-cross", "cog", "cogs", "coin", "coins", "columns", "comet", "comment", "comment-alt", "comment-alt-check", "comment-alt-dollar", "comment-alt-dots", "comment-alt-edit", "comment-alt-exclamation", "comment-alt-lines", "comment-alt-medical", "comment-alt-minus", "comment-alt-music", "comment-alt-plus", "comment-alt-slash", "comment-alt-smile", "comment-alt-times", "comment-check", "comment-dollar", "comment-dots", "comment-edit", "comment-exclamation", "comment-lines", "comment-medical", "comment-minus", "comment-music", "comment-plus", "comment-slash", "comment-smile", "comment-times", "comments", "comments-alt", "comments-alt-dollar", "comments-dollar", "compact-disc", "compass", "compass-slash", "compress", "compress-alt", "compress-arrows-alt", "compress-wide", "computer-classic", "computer-speaker", "concierge-bell", "construction", "container-storage", "conveyor-belt", "conveyor-belt-alt", "cookie", "cookie-bite", "copy", "copyright", "corn", "couch", "cow", "cowbell", "cowbell-more", "credit-card", "credit-card-blank", "credit-card-front", "cricket", "croissant", "crop", "crop-alt", "cross", "crosshairs", "crow", "crown", "crutch", "crutches", "cube", "cubes", "curling", "cut", "dagger", "database", "deaf", "debug", "deer", "deer-rudolph", "democrat", "desktop", "desktop-alt", "dewpoint", "dharmachakra", "diagnoses", "diamond", "dice", "dice-d10", "dice-d12", "dice-d20", "dice-d4", "dice-d6", "dice-d8", "dice-five", "dice-four", "dice-one", "dice-six", "dice-three", "dice-two", "digging", "digital-tachograph", "diploma", "directions", "disc-drive", "disease", "divide", "dizzy", "dna", "do-not-enter", "dog", "dog-leashed", "dollar-sign", "dolly", "dolly-empty", "dolly-flatbed", "dolly-flatbed-alt", "dolly-flatbed-empty", "donate", "door-closed", "door-open", "dot-circle", "dove", "download", "drafting-compass", "dragon", "draw-circle", "draw-polygon", "draw-square", "dreidel", "drone", "drone-alt", "drum", "drum-steelpan", "drumstick", "drumstick-bite", "dryer", "dryer-alt", "duck", "dumbbell", "dumpster", "dumpster-fire", "dungeon", "ear", "ear-muffs", "eclipse", "eclipse-alt", "edit", "egg", "egg-fried", "eject", "elephant", "ellipsis-h", "ellipsis-h-alt", "ellipsis-v", "ellipsis-v-alt", "empty-set", "engine-warning", "envelope", "envelope-open", "envelope-open-dollar", "envelope-open-text", "envelope-square", "equals", "eraser", "ethernet", "euro-sign", "exchange", "exchange-alt", "exclamation", "exclamation-circle", "exclamation-square", "exclamation-triangle", "expand", "expand-alt", "expand-arrows", "expand-arrows-alt", "expand-wide", "external-link", "external-link-alt", "external-link-square", "external-link-square-alt", "eye", "eye-dropper", "eye-evil", "eye-slash", "fan", "fan-table", "farm", "fast-backward", "fast-forward", "faucet", "faucet-drip", "fax", "feather", "feather-alt", "female", "field-hockey", "fighter-jet", "file", "file-alt", "file-archive", "file-audio", "file-certificate", "file-chart-line", "file-chart-pie", "file-check", "file-code", "file-contract", "file-csv", "file-download", "file-edit", "file-excel", "file-exclamation", "file-export", "file-image", "file-import", "file-invoice", "file-invoice-dollar", "file-medical", "file-medical-alt", "file-minus", "file-music", "file-pdf", "file-plus", "file-powerpoint", "file-prescription", "file-search", "file-signature", "file-spreadsheet", "file-times", "file-upload", "file-user", "file-video", "file-word", "files-medical", "fill", "fill-drip", "film", "film-alt", "film-canister", "filter", "fingerprint", "fire", "fire-alt", "fire-extinguisher", "fire-smoke", "fireplace", "first-aid", "fish", "fish-cooked", "fist-raised", "flag", "flag-alt", "flag-checkered", "flag-usa", "flame", "flashlight", "flask", "flask-poison", "flask-potion", "flower", "flower-daffodil", "flower-tulip", "flushed", "flute", "flux-capacitor", "fog", "folder", "folder-download", "folder-minus", "folder-open", "folder-plus", "folder-times", "folder-tree", "folder-upload", "folders", "font", "font-awesome-logo-full", "font-case", "football-ball", "football-helmet", "forklift", "forward", "fragile", "french-fries", "frog", "frosty-head", "frown", "frown-open", "function", "funnel-dollar", "futbol", "galaxy", "game-board", "game-board-alt", "game-console-handheld", "gamepad", "gamepad-alt", "garage", "garage-car", "garage-open", "gas-pump", "gas-pump-slash", "gavel", "gem", "genderless", "ghost", "gift", "gift-card", "gifts", "gingerbread-man", "glass", "glass-champagne", "glass-cheers", "glass-citrus", "glass-martini", "glass-martini-alt", "glass-whiskey", "glass-whiskey-rocks", "glasses", "glasses-alt", "globe", "globe-africa", "globe-americas", "globe-asia", "globe-europe", "globe-snow", "globe-stand", "golf-ball", "golf-club", "gopuram", "graduation-cap", "gramophone", "greater-than", "greater-than-equal", "grimace", "grin", "grin-alt", "grin-beam", "grin-beam-sweat", "grin-hearts", "grin-squint", "grin-squint-tears", "grin-stars", "grin-tears", "grin-tongue", "grin-tongue-squint", "grin-tongue-wink", "grin-wink", "grip-horizontal", "grip-lines", "grip-lines-vertical", "grip-vertical", "guitar", "guitar-electric", "guitars", "h-square", "h1", "h2", "h3", "h4", "hamburger", "hammer", "hammer-war", "hamsa", "hand-heart", "hand-holding", "hand-holding-box", "hand-holding-heart", "hand-holding-magic", "hand-holding-medical", "hand-holding-seedling", "hand-holding-usd", "hand-holding-water", "hand-lizard", "hand-middle-finger", "hand-paper", "hand-peace", "hand-point-down", "hand-point-left", "hand-point-right", "hand-point-up", "hand-pointer", "hand-receiving", "hand-rock", "hand-scissors", "hand-sparkles", "hand-spock", "hands", "hands-heart", "hands-helping", "hands-usd", "hands-wash", "handshake", "handshake-alt", "handshake-alt-slash", "handshake-slash", "hanukiah", "hard-hat", "hashtag", "hat-chef", "hat-cowboy", "hat-cowboy-side", "hat-santa", "hat-winter", "hat-witch", "hat-wizard", "hdd", "head-side", "head-side-brain", "head-side-cough", "head-side-cough-slash", "head-side-headphones", "head-side-mask", "head-side-medical", "head-side-virus", "head-vr", "heading", "headphones", "headphones-alt", "headset", "heart", "heart-broken", "heart-circle", "heart-rate", "heart-square", "heartbeat", "heat", "helicopter", "helmet-battle", "hexagon", "highlighter", "hiking", "hippo", "history", "hockey-mask", "hockey-puck", "hockey-sticks", "holly-berry", "home", "home-alt", "home-heart", "home-lg", "home-lg-alt", "hood-cloak", "horizontal-rule", "horse", "horse-head", "horse-saddle", "hospital", "hospital-alt", "hospital-symbol", "hospital-user", "hospitals", "hot-tub", "hotdog", "hotel", "hourglass", "hourglass-end", "hourglass-half", "hourglass-start", "house", "house-damage", "house-day", "house-flood", "house-leave", "house-night", "house-return", "house-signal", "house-user", "hryvnia", "humidity", "hurricane", "i-cursor", "ice-cream", "ice-skate", "icicles", "icons", "icons-alt", "id-badge", "id-card", "id-card-alt", "igloo", "image", "image-polaroid", "images", "inbox", "inbox-in", "inbox-out", "indent", "industry", "industry-alt", "infinity", "info", "info-circle", "info-square", "inhaler", "integral", "intersection", "inventory", "island-tropical", "italic", "jack-o-lantern", "jedi", "joint", "journal-whills", "joystick", "jug", "kaaba", "kazoo", "kerning", "key", "key-skeleton", "keyboard", "keynote", "khanda", "kidneys", "kiss", "kiss-beam", "kiss-wink-heart", "kite", "kiwi-bird", "knife-kitchen", "lambda", "lamp", "lamp-desk", "lamp-floor", "landmark", "landmark-alt", "language", "laptop", "laptop-code", "laptop-house", "laptop-medical", "lasso", "laugh", "laugh-beam", "laugh-squint", "laugh-wink", "layer-group", "layer-minus", "layer-plus", "leaf", "leaf-heart", "leaf-maple", "leaf-oak", "lemon", "less-than", "less-than-equal", "level-down", "level-down-alt", "level-up", "level-up-alt", "life-ring", "light-ceiling", "light-switch", "light-switch-off", "light-switch-on", "lightbulb", "lightbulb-dollar", "lightbulb-exclamation", "lightbulb-on", "lightbulb-slash", "lights-holiday", "line-columns", "line-height", "link", "lips", "lira-sign", "list", "list-alt", "list-music", "list-ol", "list-ul", "location", "location-arrow", "location-circle", "location-slash", "lock", "lock-alt", "lock-open", "lock-open-alt", "long-arrow-alt-down", "long-arrow-alt-left", "long-arrow-alt-right", "long-arrow-alt-up", "long-arrow-down", "long-arrow-left", "long-arrow-right", "long-arrow-up", "loveseat", "low-vision", "luchador", "luggage-cart", "lungs", "lungs-virus", "mace", "magic", "magnet", "mail-bulk", "mailbox", "male", "mandolin", "map", "map-marked", "map-marked-alt", "map-marker", "map-marker-alt", "map-marker-alt-slash", "map-marker-check", "map-marker-edit", "map-marker-exclamation", "map-marker-minus", "map-marker-plus", "map-marker-question", "map-marker-slash", "map-marker-smile", "map-marker-times", "map-pin", "map-signs", "marker", "mars", "mars-double", "mars-stroke", "mars-stroke-h", "mars-stroke-v", "mask", "meat", "medal", "medkit", "megaphone", "meh", "meh-blank", "meh-rolling-eyes", "memory", "menorah", "mercury", "meteor", "microchip", "microphone", "microphone-alt", "microphone-alt-slash", "microphone-slash", "microphone-stand", "microscope", "microwave", "mind-share", "minus", "minus-circle", "minus-hexagon", "minus-octagon", "minus-square", "mistletoe", "mitten", "mobile", "mobile-alt", "mobile-android", "mobile-android-alt", "money-bill", "money-bill-alt", "money-bill-wave", "money-bill-wave-alt", "money-check", "money-check-alt", "money-check-edit", "money-check-edit-alt", "monitor-heart-rate", "monkey", "monument", "moon", "moon-cloud", "moon-stars", "mortar-pestle", "mosque", "motorcycle", "mountain", "mountains", "mouse", "mouse-alt", "mouse-pointer", "mp3-player", "mug", "mug-hot", "mug-marshmallows", "mug-tea", "music", "music-alt", "music-alt-slash", "music-slash", "narwhal", "network-wired", "neuter", "newspaper", "not-equal", "notes-medical", "object-group", "object-ungroup", "octagon", "oil-can", "oil-temp", "om", "omega", "ornament", "otter", "outdent", "outlet", "oven", "overline", "page-break", "pager", "paint-brush", "paint-brush-alt", "paint-roller", "palette", "pallet", "pallet-alt", "paper-plane", "paperclip", "parachute-box", "paragraph", "paragraph-rtl", "parking", "parking-circle", "parking-circle-slash", "parking-slash", "passport", "pastafarianism", "paste", "pause", "pause-circle", "paw", "paw-alt", "paw-claws", "peace", "pegasus", "pen", "pen-alt", "pen-fancy", "pen-nib", "pen-square", "pencil", "pencil-alt", "pencil-paintbrush", "pencil-ruler", "pennant", "people-arrows", "people-carry", "pepper-hot", "percent", "percentage", "person-booth", "person-carry", "person-dolly", "person-dolly-empty", "person-sign", "phone", "phone-alt", "phone-laptop", "phone-office", "phone-plus", "phone-rotary", "phone-slash", "phone-square", "phone-square-alt", "phone-volume", "photo-video", "pi", "piano", "piano-keyboard", "pie", "pig", "piggy-bank", "pills", "pizza", "pizza-slice", "place-of-worship", "plane", "plane-alt", "plane-arrival", "plane-departure", "plane-slash", "planet-moon", "planet-ringed", "play", "play-circle", "plug", "plus", "plus-circle", "plus-hexagon", "plus-octagon", "plus-square", "podcast", "podium", "podium-star", "police-box", "poll", "poll-h", "poll-people", "poo", "poo-storm", "poop", "popcorn", "portal-enter", "portal-exit", "portrait", "pound-sign", "power-off", "pray", "praying-hands", "prescription", "prescription-bottle", "prescription-bottle-alt", "presentation", "print", "print-search", "print-slash", "procedures", "project-diagram", "projector", "pump-medical", "pump-soap", "pumpkin", "puzzle-piece", "qrcode", "question", "question-circle", "question-square", "quidditch", "quote-left", "quote-right", "quran", "rabbit", "rabbit-fast", "racquet", "radar", "radiation", "radiation-alt", "radio", "radio-alt", "rainbow", "raindrops", "ram", "ramp-loading", "random", "raygun", "receipt", "record-vinyl", "rectangle-landscape", "rectangle-portrait", "rectangle-wide", "recycle", "redo", "redo-alt", "refrigerator", "registered", "remove-format", "repeat", "repeat-1", "repeat-1-alt", "repeat-alt", "reply", "reply-all", "republican", "restroom", "retweet", "retweet-alt", "ribbon", "ring", "rings-wedding", "road", "robot", "rocket", "rocket-launch", "route", "route-highway", "route-interstate", "router", "rss", "rss-square", "ruble-sign", "ruler", "ruler-combined", "ruler-horizontal", "ruler-triangle", "ruler-vertical", "running", "rupee-sign", "rv", "sack", "sack-dollar", "sad-cry", "sad-tear", "salad", "sandwich", "satellite", "satellite-dish", "sausage", "save", "sax-hot", "saxophone", "scalpel", "scalpel-path", "scanner", "scanner-image", "scanner-keyboard", "scanner-touchscreen", "scarecrow", "scarf", "school", "screwdriver", "scroll", "scroll-old", "scrubber", "scythe", "sd-card", "search", "search-dollar", "search-location", "search-minus", "search-plus", "seedling", "send-back", "send-backward", "sensor", "sensor-alert", "sensor-fire", "sensor-on", "sensor-smoke", "server", "shapes", "share", "share-all", "share-alt", "share-alt-square", "share-square", "sheep", "shekel-sign", "shield", "shield-alt", "shield-check", "shield-cross", "shield-virus", "ship", "shipping-fast", "shipping-timed", "shish-kebab", "shoe-prints", "shopping-bag", "shopping-basket", "shopping-cart", "shovel", "shovel-snow", "shower", "shredder", "shuttle-van", "shuttlecock", "sickle", "sigma", "sign", "sign-in", "sign-in-alt", "sign-language", "sign-out", "sign-out-alt", "signal", "signal-1", "signal-2", "signal-3", "signal-4", "signal-alt", "signal-alt-1", "signal-alt-2", "signal-alt-3", "signal-alt-slash", "signal-slash", "signal-stream", "signature", "sim-card", "sink", "siren", "siren-on", "sitemap", "skating", "skeleton", "ski-jump", "ski-lift", "skiing", "skiing-nordic", "skull", "skull-cow", "skull-crossbones", "slash", "sledding", "sleigh", "sliders-h", "sliders-h-square", "sliders-v", "sliders-v-square", "smile", "smile-beam", "smile-plus", "smile-wink", "smog", "smoke", "smoking", "smoking-ban", "sms", "snake", "snooze", "snow-blowing", "snowboarding", "snowflake", "snowflakes", "snowman", "snowmobile", "snowplow", "soap", "socks", "solar-panel", "solar-system", "sort", "sort-alpha-down", "sort-alpha-down-alt", "sort-alpha-up", "sort-alpha-up-alt", "sort-alt", "sort-amount-down", "sort-amount-down-alt", "sort-amount-up", "sort-amount-up-alt", "sort-circle", "sort-circle-down", "sort-circle-up", "sort-down", "sort-numeric-down", "sort-numeric-down-alt", "sort-numeric-up", "sort-numeric-up-alt", "sort-shapes-down", "sort-shapes-down-alt", "sort-shapes-up", "sort-shapes-up-alt", "sort-size-down", "sort-size-down-alt", "sort-size-up", "sort-size-up-alt", "sort-up", "soup", "spa", "space-shuttle", "space-station-moon", "space-station-moon-alt", "spade", "sparkles", "speaker", "speakers", "spell-check", "spider", "spider-black-widow", "spider-web", "spinner", "spinner-third", "splotch", "spray-can", "sprinkler", "square", "square-full", "square-root", "square-root-alt", "squirrel", "staff", "stamp", "star", "star-and-crescent", "star-christmas", "star-exclamation", "star-half", "star-half-alt", "star-of-david", "star-of-life", "star-shooting", "starfighter", "starfighter-alt", "stars", "starship", "starship-freighter", "steak", "steering-wheel", "step-backward", "step-forward", "stethoscope", "sticky-note", "stocking", "stomach", "stop", "stop-circle", "stopwatch", "stopwatch-20", "store", "store-alt", "store-alt-slash", "store-slash", "stream", "street-view", "stretcher", "strikethrough", "stroopwafel", "subscript", "subway", "suitcase", "suitcase-rolling", "sun", "sun-cloud", "sun-dust", "sun-haze", "sunglasses", "sunrise", "sunset", "superscript", "surprise", "swatchbook", "swimmer", "swimming-pool", "sword", "sword-laser", "sword-laser-alt", "swords", "swords-laser", "synagogue", "sync", "sync-alt", "syringe", "table", "table-tennis", "tablet", "tablet-alt", "tablet-android", "tablet-android-alt", "tablet-rugged", "tablets", "tachometer", "tachometer-alt", "tachometer-alt-average", "tachometer-alt-fast", "tachometer-alt-fastest", "tachometer-alt-slow", "tachometer-alt-slowest", "tachometer-average", "tachometer-fast", "tachometer-fastest", "tachometer-slow", "tachometer-slowest", "taco", "tag", "tags", "tally", "tanakh", "tape", "tasks", "tasks-alt", "taxi", "teeth", "teeth-open", "telescope", "temperature-down", "temperature-frigid", "temperature-high", "temperature-hot", "temperature-low", "temperature-up", "tenge", "tennis-ball", "terminal", "text", "text-height", "text-size", "text-width", "th", "th-large", "th-list", "theater-masks", "thermometer", "thermometer-empty", "thermometer-full", "thermometer-half", "thermometer-quarter", "thermometer-three-quarters", "theta", "thumbs-down", "thumbs-up", "thumbtack", "thunderstorm", "thunderstorm-moon", "thunderstorm-sun", "ticket", "ticket-alt", "tilde", "times", "times-circle", "times-hexagon", "times-octagon", "times-square", "tint", "tint-slash", "tire", "tire-flat", "tire-pressure-warning", "tire-rugged", "tired", "toggle-off", "toggle-on", "toilet", "toilet-paper", "toilet-paper-alt", "toilet-paper-slash", "tombstone", "tombstone-alt", "toolbox", "tools", "tooth", "toothbrush", "torah", "torii-gate", "tornado", "tractor", "trademark", "traffic-cone", "traffic-light", "traffic-light-go", "traffic-light-slow", "traffic-light-stop", "trailer", "train", "tram", "transgender", "transgender-alt", "transporter", "transporter-1", "transporter-2", "transporter-3", "transporter-empty", "trash", "trash-alt", "trash-restore", "trash-restore-alt", "trash-undo", "trash-undo-alt", "treasure-chest", "tree", "tree-alt", "tree-christmas", "tree-decorated", "tree-large", "tree-palm", "trees", "triangle", "triangle-music", "trophy", "trophy-alt", "truck", "truck-container", "truck-couch", "truck-loading", "truck-monster", "truck-moving", "truck-pickup", "truck-plow", "truck-ramp", "trumpet", "tshirt", "tty", "turkey", "turntable", "turtle", "tv", "tv-alt", "tv-music", "tv-retro", "typewriter", "ufo", "ufo-beam", "umbrella", "umbrella-beach", "underline", "undo", "undo-alt", "unicorn", "union", "universal-access", "university", "unlink", "unlock", "unlock-alt", "upload", "usb-drive", "usd-circle", "usd-square", "user", "user-alien", "user-alt", "user-alt-slash", "user-astronaut", "user-chart", "user-check", "user-circle", "user-clock", "user-cog", "user-cowboy", "user-crown", "user-edit", "user-friends", "user-graduate", "user-hard-hat", "user-headset", "user-injured", "user-lock", "user-md", "user-md-chat", "user-minus", "user-music", "user-ninja", "user-nurse", "user-plus", "user-robot", "user-secret", "user-shield", "user-slash", "user-tag", "user-tie", "user-times", "user-unlock", "user-visor", "users", "users-class", "users-cog", "users-crown", "users-medical", "users-slash", "utensil-fork", "utensil-knife", "utensil-spoon", "utensils", "utensils-alt", "vacuum", "vacuum-robot", "value-absolute", "vector-square", "venus", "venus-double", "venus-mars", "vest", "vest-patches", "vhs", "vial", "vials", "video", "video-plus", "video-slash", "vihara", "violin", "virus", "virus-slash", "viruses", "voicemail", "volcano", "volleyball-ball", "volume", "volume-down", "volume-mute", "volume-off", "volume-slash", "volume-up", "vote-nay", "vote-yea", "vr-cardboard", "wagon-covered", "walker", "walkie-talkie", "walking", "wallet", "wand", "wand-magic", "warehouse", "warehouse-alt", "washer", "watch", "watch-calculator", "watch-fitness", "water", "water-lower", "water-rise", "wave-sine", "wave-square", "wave-triangle", "waveform", "waveform-path", "webcam", "webcam-slash", "weight", "weight-hanging", "whale", "wheat", "wheelchair", "whistle", "wifi", "wifi-1", "wifi-2", "wifi-slash", "wind", "wind-turbine", "wind-warning", "window", "window-alt", "window-close", "window-frame", "window-frame-open", "window-maximize", "window-minimize", "window-restore", "windsock", "wine-bottle", "wine-glass", "wine-glass-alt", "won-sign", "wreath", "wrench", "x-ray", "yen-sign", "yin-yang"]
};
var _default = faMetadata;
exports.default = _default;
});

require.register("lib/keep-alive.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var _ef = _interopRequireDefault(require("ef/ef"));

var KeepAlive = function KeepAlive() {
if (!_ef.default.options.local) {
setTimeout(function () {
var portalBasePath = _courseSettingsService.default.get('portalBasePath');

if (portalBasePath) {
var headers = new Headers();
headers.set('Accept', 'application/json');
fetch("".concat(portalBasePath, "/heartbeat"), {
headers: headers,
credentials: 'include'
});
}
}, 0);
}
};

var _default = KeepAlive;
exports.default = _default;
});

require.register("lib/languages.js", function(exports, require, module) {
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var Languages = {
'ar-AE': 'عربى',
'bg-BG': 'Bulgarian',
'cs-CZ': 'Češtině',
'da-DK': 'Dansk',
bg: 'Bulgarian',
cs: 'Češtině',
da: 'Dansk',
de: 'Deutsche',
'el-GR': 'Greek',
'en-GB': 'English (UK)',
el: 'Greek',
en: 'English (US)',
'es-ES': 'Español (España)',
es: 'Español (Latinoamérica)',
'fi-FI': 'suomi',
'fr-CA': 'Français (Canada)',
'fr-FR': 'Français (France)',
'hi-IN': 'हिन्दी',
'he-IL': 'עִברִית',
'hu-HU': 'Magyar',
'id-ID': 'Indonesian',
fi: 'suomi',
fr: 'Français',
hi: 'हिन्दी',
he: 'עִברִית',
hu: 'Magyar',
id: 'Indonesian',
it: 'Italiano',
ja: '日本語',
ko: '한국어',
'ms-MY': 'Bahasa Melayu',
'nl-NL': 'Nederlanda',
'pl-PL': 'Polskie',
'pt-BR': 'Português (Brasil)',
'ro-RO': 'Romanian',
ms: 'Bahasa Melayu',
nl: 'Nederlanda',
pl: 'Polskie',
pt: 'Português',
ro: 'Romanian',
ru: 'Русский',
'sk-SK': 'Slovak',
'sl-SI': 'Slovenian',
'sr-RS': 'Serbian',
'sv-SE': 'Svenska',
'th-TH': 'ไทย',
'tl-PH': 'Tagalog',
'tr-TR': 'Türkçe (Türkiye)',
'uk-UA': 'украї́нська мо́ва',
'vi-VN': 'Tiếng Việt',
'zh-CN': '中文简体 (普通话)',
'zh-TW': '中文繁體(普通話)',
sk: 'Slovak',
sl: 'Slovenian',
sr: 'Serbian',
sv: 'Svenska',
th: 'ไทย',
tl: 'Tagalog',
tr: 'Türkçe (Türkiye)',
uk: 'украї́нська мо́ва',
vi: 'Tiếng Việt',
zh: '中文简体'
};
var _default = Languages;
exports.default = _default;
});

require.register("lib/to-promise.js", function(exports, require, module) {
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var ToPromise = function ToPromise($promise) {
return new Promise(function (resolve, reject) {
$promise.then(resolve, reject);
});
};

var _default = ToPromise;
exports.default = _default;
});

require.register("lib/url-helper.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _enrollment = require("ef/models/enrollment");

var _ef = _interopRequireDefault(require("ef/ef"));

var _lodash = _interopRequireDefault(require("lodash"));

var getParams = function getParams() {
var match;

var params = {},
pl = /\+/g,
search = /([^&=]+)=?([^&]*)/g,
decode = function decode(s) {
return decodeURIComponent(s.replace(pl, ' '));
},
query = window.location.search.substring(1),
parse = function parse(val) {
try {
val = JSON.parse(val);
} catch (e) {
// eslint-disable-next-line
val = val;
}

return val;
};

while (match = search.exec(query)) {
var key = decode(match[1]);
var value = parse(decode(match[2]));
params[key] = value;
}

return params;
};

var UrlHelper = /*#__PURE__*/function () {
function UrlHelper() {
(0, _classCallCheck2.default)(this, UrlHelper);
this.params = getParams();
}

(0, _createClass2.default)(UrlHelper, [{
key: "getParam",
value: function getParam(key, defaultKey) {
return this.params[key] || defaultKey;
}
}, {
key: "buildEnrollment",
value: function buildEnrollment(enrollmentHash) {
var attrs = ['id', 'userId', 'cohortId', 'schoolId', 'name', 'schoolName', 'className', 'state', 'certified'];
enrollmentHash = _lodash.default.defaults(_lodash.default.pick(this.params, attrs), enrollmentHash);
return new _enrollment.Enrollment(enrollmentHash);
}
}, {
key: "buildConfig",
value: function buildConfig(moreAttrs) {
var attrs = ['assessmentEndpoint', 'basePath', 'stage', 'demoMode'];

var config = _lodash.default.defaults(_lodash.default.pick(this.params, attrs), moreAttrs);

return new _ef.default.Config(config);
}
}, {
key: "buildOptions",
value: function buildOptions(moreAttrs) {
var attrs = ['pmMode', 'local', 'apiOnly', 'loadCustomizationsRemote'];
return _lodash.default.defaults(_lodash.default.pick(this.params, attrs), moreAttrs);
}
}]);
return UrlHelper;
}();

exports.default = UrlHelper;
});

;require.register("lib/utils.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
exports.isFloat = isFloat;

var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _localeService = _interopRequireDefault(require("services/loader-handler-services/locale-service"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _marked = require("marked");

var _lodash = _interopRequireDefault(require("lodash"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _jquery = _interopRequireDefault(require("jquery"));

var _runtime = _interopRequireDefault(require("handlebars/runtime"));

var _backbone = _interopRequireDefault(require("backbone"));

var _alertService = _interopRequireDefault(require("services/course-handler-services/alert-service"));

/* eslint-disable no-useless-escape */
// Application-specific utilities
// ------------------------------
// Delegate to Chaplin’s utils module
var utils = _chaplin.default.utils.beget(_chaplin.default.utils); // Add additional application-specific properties and methods


_lodash.default.extend(utils, {
initialize: function initialize(options) {
options = options || {};
this.options = _lodash.default.defaults(options, {
courseUrl: ''
});
},
redirectToPage: function redirectToPage(page) {
_chaplin.default.utils.redirectTo({
url: page.path()
});
},
redirectToModule: function redirectToModule(module) {
_chaplin.default.utils.redirectTo({
url: module.get('key')
});
},
tryRequire: function tryRequire(path) {
try {
return require(path);
} catch (e) {
if (_ef.default.options.local) {
//console.trace();
if (e.message.indexOf('Cannot find module') === -1) {
// eslint-disable-next-line no-console
console.error("Can't load ".concat(path, ": ").concat(e.message));
} else {
// eslint-disable-next-line no-console
console.debug("Can't load ".concat(path, ", but that's probably OK"));
}
}

return undefined;
}
},
dotStringToObject: function dotStringToObject(dotNotation, object) {
return dotNotation.split('.').reduce(function (obj, i) {
if (obj) {
return obj[i];
}
}, object);
},
getByDotString: function getByDotString(dotString, getter) {
var rawData = dotString.split('.');
var key = rawData.shift();
var obj = getter(key);

if (obj) {
return rawData.length === 0 ? obj : utils.dotStringToObject(rawData.join('.'), obj);
}
},
tryParseJson: function tryParseJson(value) {
var result;

try {
result = JSON.parse(value);
} catch (e) {
result = value;
}

return result;
},
coursePath: function coursePath(path) {
if (path.substring(0, 4) === 'http' || path.substring(0, 2) === '//') {
return path;
} else if (path.substring(0, 1) === '/') {
path = path.substring(1, path.length);
}

path = path.replace('{{lang}}', _localeService.default.getLanguage());
return (this.options ? this.options.courseUrl : '') + path;
},
// Cache bust a path. Assumes path has no parameters.
bust: function bust(path) {
return "".concat(path, "?_=").concat(Date.now());
},
isEmpty: function isEmpty(obj) {
if (typeof obj === 'undefined') {
return true;
}

return Object.keys(obj).length === 0;
},
renderMarkdown: function renderMarkdown(value) {
return _marked.marked.parse(value);
},
slugify: function slugify(text) {
return text.toString().toLowerCase().replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
},
treatAsUTC: function treatAsUTC(date) {
date.setMinutes(date.getMinutes() - date.getTimezoneOffset());
return date;
},
daysFromToday: function daysFromToday(startDate) {
if (startDate.includes('-')) {
startDate = startDate.split('-').join('/');
}

return this.daysDiff(startDate, new Date());
},
daysDiff: function daysDiff(startDate, endDate) {
startDate = startDate instanceof Date ? startDate : new Date(startDate);
endDate = endDate instanceof Date ? endDate : new Date(endDate);
var millisecondsPerDay = 24 * 60 * 60 * 1000;
return (this.treatAsUTC(endDate) - this.treatAsUTC(startDate)) / millisecondsPerDay;
},
sanifyJsonApiObject: function sanifyJsonApiObject(insaneObject, includes) {
var _this2 = this;

if (!insaneObject) {
return;
}

if (Array.isArray(insaneObject)) {
return insaneObject.map(function (obj) {
return _this2.sanifyJsonApiObject(obj, includes);
});
}

if (!insaneObject.attributes && includes) {
var includedObject = includes.find(function (incl) {
return incl.id === insaneObject.id && incl.type === insaneObject.type;
});

if (!includedObject) {
return insaneObject;
} else {
insaneObject = includedObject;
}
}

var saneObject = Object.assign({}, insaneObject, insaneObject.attributes);
delete saneObject.attributes;

if (saneObject.relationships) {
Object.entries(saneObject.relationships).forEach(function (_ref) {
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
key = _ref2[0],
value = _ref2[1];

if (value.data) {
if (Array.isArray(value.data)) {
saneObject[key] = [];
value.data.forEach(function (val) {
return saneObject[key].push(_this2.sanifyJsonApiObject(val, includes));
});
} else {
saneObject[key] = _this2.sanifyJsonApiObject(value.data, includes);
}
}
});
delete saneObject.relationships;
}

return saneObject;
},
failProofPromise: function failProofPromise(promise) {
var failResult = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
return promise.then(function (data) {
return data;
}, function () {
return _jquery.default.Deferred().resolve(failResult).promise();
});
},
parentElements: function parentElements(element, stepUp) {
var elementGrandParent = element;

while (stepUp > 0) {
elementGrandParent = elementGrandParent.parentElement;
stepUp--;
}

return elementGrandParent;
},
focusableElements: function focusableElements() {
return 'a[href]:not([tabindex="-1"]):not([disabled]),area[href]:not([tabindex="-1"]),input:not([disabled]):not([tabindex="-1"]),select:not([disabled]):not([tabindex="-1"]),textarea:not([disabled]):not([tabindex="-1"]),button:not([disabled]):not([tabindex="-1"]),iframe:not([tabindex="-1"]),[tabindex]:not([tabindex="-1"]),[contentEditable=true]:not([tabindex="-1"])';
},
isDevEnv: function isDevEnv() {
return _ef.default.config.get('env') === 'dev' && window != null;
},
devLog: function devLog(msg) {
var lvl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'debug';

if (utils.isDevEnv()) {
console[lvl](msg);
}
},
getLastArrayElement: function getLastArrayElement(array) {
return array[array.length - 1];
},
createSafeString: function createSafeString(safeString, unsafeString) {
return new _runtime.default.SafeString(safeString + _runtime.default.Utils.escapeExpression(unsafeString));
},
getMediaBasePath: function getMediaBasePath(options, courseSettingsService) {
var basePath;

if (_ef.default.options.local) {
if (options.mediaType === 'audio') {
basePath = courseSettingsService.get('media_host');
} else {
basePath = options.customMediaHost ? courseSettingsService.get('custom_media_host') : courseSettingsService.get('media_host');
}
} else {
try {
var url = new URL(utils.coursePath(''), location);
basePath = url.protocol.concat('//', url.hostname);
} catch (error) {
console.log('Something went wrong with the base path', error);
}
}

return basePath.replace(/\/$/, '');
},
renderDataAttributes: function renderDataAttributes(selector) {
var dataset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var el = document.querySelector(selector);

if (el) {
Object.keys(dataset).forEach(function (key) {
el.dataset[key] = dataset[key];
});
}
},
watchAttributeChanges: function watchAttributeChanges(element, attrs, callback) {
var observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
if (mutation.type === 'attributes') {
callback(mutation);
}
});
});
observer.observe(element, {
attributeFilter: (0, _toConsumableArray2.default)(attrs),
attributeOldValue: true,
subtree: true
});
},
setHeadingLevel: function setHeadingLevel(model, headingLevel, defaultLevel) {
var _ref3;

model === null || model === void 0 ? void 0 : model.set('heading_level', (_ref3 = headingLevel !== null && headingLevel !== void 0 ? headingLevel : defaultLevel) !== null && _ref3 !== void 0 ? _ref3 : 'h2');
},
getPlatformHeaderHeight: function getPlatformHeaderHeight() {
var _document$querySelect, _document$querySelect2;

return ((_document$querySelect = document.querySelector('#site-container')) === null || _document$querySelect === void 0 ? void 0 : (_document$querySelect2 = _document$querySelect.getBoundingClientRect()) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.top) + window.scrollY;
},
// Grabbed this from the view helpers
math: function math(lvalue, operator, rvalue) {
lvalue = parseFloat(lvalue);
rvalue = parseFloat(rvalue);
return {
'+': lvalue + rvalue,
'-': lvalue - rvalue,
'*': lvalue * rvalue,
'/': lvalue / rvalue,
'%': lvalue % rvalue
}[operator];
},
pixelMath: function pixelMath(pixel1, operation, pixel2) {
var pixel1Val = 0,
pixel2Val = 0;

if (typeof pixel1 === 'string') {
pixel1Val = parseInt(pixel1.replace(/px/, ''));
} else if (typeof pixel1 === 'number') {
pixel1Val = parseInt(pixel1);
}

if (typeof pixel2 === 'string') {
pixel2Val = parseInt(pixel2.replace(/px/, ''));
} else if (typeof pixel2 === 'number') {
pixel2Val = parseInt(pixel2);
}

return "".concat(this.math(pixel1Val, operation, pixel2Val), "px");
},
subAriaHiddenOnDialog: function subAriaHiddenOnDialog(_this, selector) {
_this.subscribeEvent('dialog:show', function () {
(0, _jquery.default)(selector).attr('aria-hidden', true);
});

_this.subscribeEvent('dialog:hide', function () {
(0, _jquery.default)(selector).attr('aria-hidden', false);
});
},
backboneSync: function backboneSync(_this, _args) {
//if in local mode just do nothing
if (_ef.default.options.local && !_ef.default.options.loadCustomizationsRemote) {
return;
}

return _backbone.default.sync.apply(_this, _args);
},
getEnrollmentsUrl: function getEnrollmentsUrl(enrollmentId, fileName) {
return _ef.default.url("/sdk/enrollments/".concat(enrollmentId, "/").concat(fileName));
},
fetch: function (_fetch) {
function fetch(_x, _x2) {
return _fetch.apply(this, arguments);
}

fetch.toString = function () {
return _fetch.toString();
};

return fetch;
}(function (url, params) {
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
return _regenerator.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
return _context.abrupt("return", fetch(url, params));

case 1:
case "end":
return _context.stop();
}
}
}, _callee);
}))();
}),
applyAnimationProperty: function applyAnimationProperty(_this) {
if (_this.model.get('animation')) {
_this.$el.attr('data-anijs', _this.model.get('animation'));
}

if (!_this.model.get('onscroll')) {
return;
}

var scrollParams = _this.model.get('onscroll');

for (var prop in scrollParams) {
if (!Object.prototype.hasOwnProperty.call(scrollParams, prop)) {
continue;
}

_this.$el.attr(prop === 'animation' ? 'data-aos' : "data-aos-".concat(prop), scrollParams[prop]);
}
},
//[TODO]: move this to error handling service one refactored
httpErrorHandler: function httpErrorHandler(response) {
var showSuccess = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;

if (_ef.default.options.local || response.status >= 200 && response.status < 300) {
if (showSuccess) {
_alertService.default.showSuccessAlert();
}

return Promise.resolve(response);
} else {
_alertService.default.showFailureAlert();

return Promise.reject(new Error("".concat(response.status, " : ").concat(response.statusText)));
}
},
setSectionsData: function setSectionsData(data) {
data.sections = _lodash.default.orderBy(data.sections, 'position');
data.sections.forEach(function (section) {
section.questions = _lodash.default.orderBy(section.questions, 'position');
section.questions.forEach(function (question) {
question.answers = _lodash.default.orderBy(question.answers, 'position');
});
});
},
loadPageSRText: function loadPageSRText(title) {
var pageTitle = title ? title : '';
(0, _jquery.default)('#page-loading').text("".concat(_localeService.default.t('defaultPageTitle'), " ").concat(pageTitle));
requestAnimationFrame(function () {
(0, _jquery.default)('#page-loading').attr('aria-hidden', false);
(0, _jquery.default)('#page-loading').attr('tabindex', -1).focus();
});
}
});

function isFloat(n) {
if (typeof n !== 'number') {
throw Error('isFloat Error: param should be number type');
}

return Number(n) === n && n % 1 !== 0;
}

var _default = utils;
exports.default = _default;
});

require.register("lib/view-helper.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));

var _marked = require("marked");

var _jsYaml = _interopRequireDefault(require("js-yaml"));

var _runtime = _interopRequireDefault(require("handlebars/runtime"));

var _jquery = _interopRequireDefault(require("jquery"));

var _utils = _interopRequireDefault(require("lib/utils"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _localeService = _interopRequireDefault(require("services/loader-handler-services/locale-service"));

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

// Application-specific Handlebars helpers
// -------------------------------------------
// TODO: revisit this helper - conflicts with resources.url property
// Get Chaplin-declared named routes. {{#url "like" "105"}}{{/url}}.
//Handlebars.registerHelper('url', function(routeName) {
// var params = [].slice.call(arguments, 1);
// var options = params.pop();
// return utils.reverse(routeName, params);
//});
var HandlebarsExtensions = {
_blocks: [],
helpers: {
partial: function partial(name, ctx, options) {
var ps = _runtime.default.partials;

if (typeof ps[name] !== 'function') {
ps[name] = _runtime.default.compile(ps[name]);
}

if (options.hash) {
ctx = _jquery.default.extend({}, ctx, options.hash);
}

return new _runtime.default.SafeString(ps[name](ctx, options));
},
block: function block(name) {
var blocks = HandlebarsExtensions._blocks;
var content = blocks && blocks[name];

if (content) {
content = new _runtime.default.SafeString(content.join('\n'));
} else {
content = null;
}

return content;
},
content_for: function content_for(name, options) {
var blocks = HandlebarsExtensions._blocks;
var block = blocks[name] || (blocks[name] = []);
block.push(options.fn(this));
},

/**
** Warning! **
* This exposes an XSS vulnerability that was fixed in this PR
* https://github.com/EverFi/ContentPartnerAPI/pull/140
* SafeString will not HTML encode the result and as a consequence will execute script in the translation files
*
* Several of the views inject HTML tags to style things or add other content, so this was reverted
*
* To mitigate this one of two things can be done:
* * Don't call SafeString and just return the result of LocalService.t(key). Handlebars will HTML encode the result.
* * Handle the HTML encoding yourself and use SafeString since the result is already encoded
*
**/
t: function t(key, options) {
var result = _localeService.default.t(key, options.hash);

if (_ef.default.forgeMode) {
var gotResult = result === key ? 'no' : 'yes';
return new _runtime.default.SafeString("<span data-forgeaction='editlocale' data-key='".concat(key, "' data-translated='").concat(gotResult, "'>").concat(result, "</span>"));
}

return new _runtime.default.SafeString(result);
},
pt: function pt(key) {
// translates 'plain text only' fields (avoids forge-mode)
var result = _localeService.default.t(key);

return new _runtime.default.SafeString(result);
},
f: function f(action, key, cid, forge_path, label) {
// returns a forge-mode 'action' tag for a field 'key' that is tied to its parent 'block' CID code and objpath
if (_ef.default.forgeMode) {
var result = _localeService.default.t(key);

var gotResult = result === key ? 'no' : 'yes';
return new _runtime.default.SafeString("<span data-forgeaction='".concat(action, "' data-key='").concat(key, "' data-sdkcid='").concat(cid, "' data-objpath='").concat(forge_path, "' data-label='").concat(label, "' data-translated='").concat(gotResult, "'></span>"));
}

return null;
},
m: function m(content) {
return new _runtime.default.SafeString(_marked.marked.parse(content));
},
tm: function tm(key) {
var result = _marked.marked.parse(_localeService.default.t(key));

return new _runtime.default.SafeString(result);
},
indexToCount: function indexToCount(i) {
var sum = i + 1;
return _localeService.default.t(sum.toString());
},
indexFromOne: function indexFromOne(index) {
return parseInt(index) + 1;
},
assetPath: function assetPath(path) {
var fullPath = _utils.default.coursePath(path);

return new _runtime.default.SafeString(fullPath);
},
times: function times(n, block) {
return (0, _toConsumableArray2.default)(new Array(n).keys()).reduce(function (result, index) {
var data;

if (block.data) {
data = _runtime.default.createFrame(block.data);
}

if (data) {
data.index = index;
}

return result += block.fn(index, {
data: data
});
}, '');
},
style: function style(value) {
return Object.keys(value).map(function (e) {
return "".concat(e, ": ").concat(value[e]);
}).join(';');
},
yamlize: function yamlize(value, indent) {
var yamlized = _jsYaml.default.dump(value, {
indent: indent
});

return indent === undefined ? yamlized : yamlized.replace(/\n/g, "\n".concat(' '.repeat(indent)));
},
jsonize: function jsonize(value) {
return JSON.stringify(value);
},
equal: function equal(first, second) {
return first === second;
},
subIf: function subIf(v1, success, fail, operator, v2) {
var conditions = _objectSpread(_objectSpread({}, HandlebarsExtensions.helpers.getExpOperators()), {}, {
undefined: function undefined() {
return false;
}
});

var isOperatorString = typeof operator === 'string' || operator instanceof String;
return isOperatorString ? conditions[operator](v1, v2) ? success : fail : v1 ? success : fail;
},

/**
* Helper that checks if element exists in an array. Like `.find` in js
* @param {*} elem the value that we want to check
* @param {*} list the array where we want to check for the value
*/
ifIn: function ifIn(elem, list, options) {
if (list.indexOf(elem) > -1) {
return options.fn(this);
}

return options.inverse(this);
},

/** This helper can be used to convert values into array.
* can be used as (arr 1 2 3 4) and will return [1,2,3,4]
*/
arr: function arr() {
return Array.prototype.slice.call(arguments, 0, -1);
},
compare: function compare(v1, operator, v2, options) {
var _this = this;

var conditions = _objectSpread(_objectSpread({}, HandlebarsExtensions.helpers.getExpOperators()), {}, {
undefined: function undefined() {
return options.inverse(_this);
}
});

return conditions[operator](v1, v2) ? options.fn(this) : options.inverse(this);
},
getExpOperators: function getExpOperators() {
return {
'===': function _(v1, v2) {
return v1 === v2;
},
'!==': function _(v1, v2) {
return v1 !== v2;
},
'<': function _(v1, v2) {
return v1 < v2;
},
'<=': function _(v1, v2) {
return v1 <= v2;
},
'>': function _(v1, v2) {
return v1 > v2;
},
'>=': function _(v1, v2) {
return v1 >= v2;
},
'&&': function _(v1, v2) {
return v1 && v2;
},
'||': function _(v1, v2) {
return v1 || v2;
}
};
},
defined: function defined() {
return !Array.from(arguments).some(function (argument) {
return argument === undefined;
});
},

/**
* Concats N items together
* Usage: <div>{{ (concat 'one ' 'two ' 'three ', 'N') }}</div> => <div>one two three N</div>
*/
concat: function concat() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}

// slice to throw away last object since it contains handlebars configuration
return args.slice(0, -1).reduce(function (result, arg) {
return result += arg;
}, '');
},
math: function math(lvalue, operator, rvalue) {
return _utils.default.math(lvalue, operator, rvalue);
}
},
finish_blocks: function finish_blocks(template) {
//TODO: review this code and see if it should be removed
for (var b in HandlebarsExtensions._blocks) {
var content = HandlebarsExtensions._blocks[b].join('\n');

template = template.replace("{{block:".concat(b, "}}"), content);
}

HandlebarsExtensions._blocks = [];
return template;
}
};

for (var helper in HandlebarsExtensions.helpers) {
if (Object.prototype.hasOwnProperty.call(HandlebarsExtensions.helpers, helper) && typeof HandlebarsExtensions.helpers[helper] === 'function') {
_runtime.default.registerHelper(helper, HandlebarsExtensions.helpers[helper]);
}
}

var _default = HandlebarsExtensions;
exports.default = _default;
});

require.register("models/block.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _chaplin = _interopRequireDefault(require("chaplin"));

var Block = _chaplin.default.Model.extend({});

var _default = Block;
exports.default = _default;
});

require.register("models/feedback.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _chaplin = _interopRequireDefault(require("chaplin"));

var _jquery = _interopRequireDefault(require("jquery"));

var Feedback = _chaplin.default.Model.extend({
initialize: function initialize() {
var overrides = this.get(this.get('feedbackState'));

var newAttributes = _jquery.default.extend(true, this.serialize(), overrides);

this.set(newAttributes);
}
});

var _default = Feedback;
exports.default = _default;
});

require.register("models/menu.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _chaplin = _interopRequireDefault(require("chaplin"));

var Menu = _chaplin.default.Model.extend({
path: function path() {
return this.get('key');
}
});

var _default = Menu;
exports.default = _default;
});

require.register("models/portfolio.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _chaplin = _interopRequireDefault(require("chaplin"));

var Portfolio = _chaplin.default.Model.extend({});

var _default = Portfolio;
exports.default = _default;
});

require.register("polyfills.js", function(exports, require, module) {
"use strict";

require("core-js/modules/es.symbol");

require("core-js/modules/es.symbol.async-iterator");

require("core-js/modules/es.symbol.description");

require("core-js/modules/es.symbol.has-instance");

require("core-js/modules/es.symbol.is-concat-spreadable");

require("core-js/modules/es.symbol.iterator");

require("core-js/modules/es.symbol.match");

require("core-js/modules/es.symbol.match-all");

require("core-js/modules/es.symbol.replace");

require("core-js/modules/es.symbol.search");

require("core-js/modules/es.symbol.species");

require("core-js/modules/es.symbol.split");

require("core-js/modules/es.symbol.to-primitive");

require("core-js/modules/es.symbol.to-string-tag");

require("core-js/modules/es.symbol.unscopables");

require("core-js/modules/es.object.assign");

require("core-js/modules/es.object.create");

require("core-js/modules/es.object.define-property");

require("core-js/modules/es.object.define-properties");

require("core-js/modules/es.object.entries");

require("core-js/modules/es.object.freeze");

require("core-js/modules/es.object.from-entries");

require("core-js/modules/es.object.get-own-property-descriptor");

require("core-js/modules/es.object.get-own-property-descriptors");

require("core-js/modules/es.object.get-own-property-names");

require("core-js/modules/es.object.get-prototype-of");

require("core-js/modules/es.object.is");

require("core-js/modules/es.object.is-extensible");

require("core-js/modules/es.object.is-frozen");

require("core-js/modules/es.object.is-sealed");

require("core-js/modules/es.object.keys");

require("core-js/modules/es.object.prevent-extensions");

require("core-js/modules/es.object.seal");

require("core-js/modules/es.object.set-prototype-of");

require("core-js/modules/es.object.values");

require("core-js/modules/es.object.to-string");

require("core-js/modules/es.object.define-getter");

require("core-js/modules/es.object.define-setter");

require("core-js/modules/es.object.lookup-getter");

require("core-js/modules/es.object.lookup-setter");

require("core-js/modules/es.function.bind");

require("core-js/modules/es.function.name");

require("core-js/modules/es.function.has-instance");

require("core-js/modules/es.global-this");

require("core-js/modules/es.array.from");

require("core-js/modules/es.array.is-array");

require("core-js/modules/es.array.of");

require("core-js/modules/es.array.concat");

require("core-js/modules/es.array.copy-within");

require("core-js/modules/es.array.every");

require("core-js/modules/es.array.fill");

require("core-js/modules/es.array.filter");

require("core-js/modules/es.array.find");

require("core-js/modules/es.array.find-index");

require("core-js/modules/es.array.flat");

require("core-js/modules/es.array.flat-map");

require("core-js/modules/es.array.for-each");

require("core-js/modules/es.array.includes");

require("core-js/modules/es.array.index-of");

require("core-js/modules/es.array.join");

require("core-js/modules/es.array.last-index-of");

require("core-js/modules/es.array.map");

require("core-js/modules/es.array.reduce");

require("core-js/modules/es.array.reduce-right");

require("core-js/modules/es.array.reverse");

require("core-js/modules/es.array.slice");

require("core-js/modules/es.array.some");

require("core-js/modules/es.array.sort");

require("core-js/modules/es.array.splice");

require("core-js/modules/es.array.species");

require("core-js/modules/es.array.unscopables.flat");

require("core-js/modules/es.array.unscopables.flat-map");

require("core-js/modules/es.array.iterator");

require("core-js/modules/es.string.from-code-point");

require("core-js/modules/es.string.raw");

require("core-js/modules/es.string.code-point-at");

require("core-js/modules/es.string.ends-with");

require("core-js/modules/es.string.includes");

require("core-js/modules/es.string.match");

require("core-js/modules/es.string.match-all");

require("core-js/modules/es.string.pad-end");

require("core-js/modules/es.string.pad-start");

require("core-js/modules/es.string.repeat");

require("core-js/modules/es.string.replace");

require("core-js/modules/es.string.search");

require("core-js/modules/es.string.split");

require("core-js/modules/es.string.starts-with");

require("core-js/modules/es.string.trim");

require("core-js/modules/es.string.trim-start");

require("core-js/modules/es.string.trim-end");

require("core-js/modules/es.string.iterator");

require("core-js/modules/es.string.anchor");

require("core-js/modules/es.string.big");

require("core-js/modules/es.string.blink");

require("core-js/modules/es.string.bold");

require("core-js/modules/es.string.fixed");

require("core-js/modules/es.string.fontcolor");

require("core-js/modules/es.string.fontsize");

require("core-js/modules/es.string.italics");

require("core-js/modules/es.string.link");

require("core-js/modules/es.string.small");

require("core-js/modules/es.string.strike");

require("core-js/modules/es.string.sub");

require("core-js/modules/es.string.sup");

require("core-js/modules/es.regexp.constructor");

require("core-js/modules/es.regexp.exec");

require("core-js/modules/es.regexp.flags");

require("core-js/modules/es.regexp.sticky");

require("core-js/modules/es.regexp.test");

require("core-js/modules/es.regexp.to-string");

require("core-js/modules/es.parse-int");

require("core-js/modules/es.parse-float");

require("core-js/modules/es.number.constructor");

require("core-js/modules/es.number.epsilon");

require("core-js/modules/es.number.is-finite");

require("core-js/modules/es.number.is-integer");

require("core-js/modules/es.number.is-nan");

require("core-js/modules/es.number.is-safe-integer");

require("core-js/modules/es.number.max-safe-integer");

require("core-js/modules/es.number.min-safe-integer");

require("core-js/modules/es.number.parse-float");

require("core-js/modules/es.number.parse-int");

require("core-js/modules/es.number.to-fixed");

require("core-js/modules/es.number.to-precision");

require("core-js/modules/es.math.acosh");

require("core-js/modules/es.math.asinh");

require("core-js/modules/es.math.atanh");

require("core-js/modules/es.math.cbrt");

require("core-js/modules/es.math.clz32");

require("core-js/modules/es.math.cosh");

require("core-js/modules/es.math.expm1");

require("core-js/modules/es.math.fround");

require("core-js/modules/es.math.hypot");

require("core-js/modules/es.math.imul");

require("core-js/modules/es.math.log10");

require("core-js/modules/es.math.log1p");

require("core-js/modules/es.math.log2");

require("core-js/modules/es.math.sign");

require("core-js/modules/es.math.sinh");

require("core-js/modules/es.math.tanh");

require("core-js/modules/es.math.to-string-tag");

require("core-js/modules/es.math.trunc");

require("core-js/modules/es.date.now");

require("core-js/modules/es.date.to-json");

require("core-js/modules/es.date.to-iso-string");

require("core-js/modules/es.date.to-string");

require("core-js/modules/es.date.to-primitive");

require("core-js/modules/es.promise");

require("core-js/modules/es.promise.all-settled");

require("core-js/modules/es.promise.finally");

require("core-js/modules/es.map");

require("core-js/modules/es.set");

require("core-js/modules/es.weak-map");

require("core-js/modules/es.weak-set");

require("core-js/modules/es.array-buffer.constructor");

require("core-js/modules/es.array-buffer.is-view");

require("core-js/modules/es.array-buffer.slice");

require("core-js/modules/es.data-view");

require("core-js/modules/es.typed-array.int8-array");

require("core-js/modules/es.typed-array.uint8-array");

require("core-js/modules/es.typed-array.uint8-clamped-array");

require("core-js/modules/es.typed-array.int16-array");

require("core-js/modules/es.typed-array.uint16-array");

require("core-js/modules/es.typed-array.int32-array");

require("core-js/modules/es.typed-array.uint32-array");

require("core-js/modules/es.typed-array.float32-array");

require("core-js/modules/es.typed-array.float64-array");

require("core-js/modules/es.typed-array.from");

require("core-js/modules/es.typed-array.of");

require("core-js/modules/es.typed-array.copy-within");

require("core-js/modules/es.typed-array.every");

require("core-js/modules/es.typed-array.fill");

require("core-js/modules/es.typed-array.filter");

require("core-js/modules/es.typed-array.find");

require("core-js/modules/es.typed-array.find-index");

require("core-js/modules/es.typed-array.for-each");

require("core-js/modules/es.typed-array.includes");

require("core-js/modules/es.typed-array.index-of");

require("core-js/modules/es.typed-array.iterator");

require("core-js/modules/es.typed-array.join");

require("core-js/modules/es.typed-array.last-index-of");

require("core-js/modules/es.typed-array.map");

require("core-js/modules/es.typed-array.reduce");

require("core-js/modules/es.typed-array.reduce-right");

require("core-js/modules/es.typed-array.reverse");

require("core-js/modules/es.typed-array.set");

require("core-js/modules/es.typed-array.slice");

require("core-js/modules/es.typed-array.some");

require("core-js/modules/es.typed-array.sort");

require("core-js/modules/es.typed-array.subarray");

require("core-js/modules/es.typed-array.to-locale-string");

require("core-js/modules/es.typed-array.to-string");

require("core-js/modules/es.reflect.apply");

require("core-js/modules/es.reflect.construct");

require("core-js/modules/es.reflect.define-property");

require("core-js/modules/es.reflect.delete-property");

require("core-js/modules/es.reflect.get");

require("core-js/modules/es.reflect.get-own-property-descriptor");

require("core-js/modules/es.reflect.get-prototype-of");

require("core-js/modules/es.reflect.has");

require("core-js/modules/es.reflect.is-extensible");

require("core-js/modules/es.reflect.own-keys");

require("core-js/modules/es.reflect.prevent-extensions");

require("core-js/modules/es.reflect.set");

require("core-js/modules/es.reflect.set-prototype-of");

require("core-js/web");

require("regenerator-runtime/runtime");
});

require.register("routes.js", function(exports, require, module) {
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

// The routes for the application. This module returns a function.
// `match` is match method of the Router
var _default = function _default(match) {
match('', 'controllers/menu#show');
match('menu(/:page)', 'controllers/menu#show');
match('developer/accessibility', 'developer/controllers/accessibility#report');
match('reload', 'controllers/reload#index');
match('page', 'controllers/page#show');
match(':module(/:activity)(/:page)', 'controllers/page#show');
};

exports.default = _default;
});

require.register("services/browser-handler-services/timeout-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

// class for timeouts with play and pause functionality
var TimeoutService = /*#__PURE__*/function () {
function TimeoutService(delay, callback) {
(0, _classCallCheck2.default)(this, TimeoutService);
this.set(delay, callback);
}

(0, _createClass2.default)(TimeoutService, [{
key: "pause",
value: function pause() {
clearTimeout(this.timerId);
this.remaining -= new Date() - this.start;
}
}, {
key: "play",
value: function play() {
this.start = new Date();
clearTimeout(this.timerId);
this.timerId = setTimeout(this.callback, this.remaining);
}
}, {
key: "set",
value: function set(delay, callback) {
this.timerId = this.start = this.remaining = delay;
this.callback = callback;
}
}, {
key: "clear",
value: function clear() {
clearTimeout(this.timerId);
this.timerId = this.start = this.remaining = this.callback = null;
}
}]);
return TimeoutService;
}();

var _default = TimeoutService;
exports.default = _default;
});

require.register("services/browser-handler-services/user-agent-service.js", function(exports, require, module) {
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var UserAgentService = {
/**
* Detects if the client is mobile based on the unreliable User Agent String
* Uses a Regex from https://gist.github.com/dalethedeveloper/1503252 which should detect even obscure mobile user agents
* @return {Boolean} true if the current device has a known mobile User Agent String
*/
isMobile: function isMobile() {
return /Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/.test(navigator.userAgent);
},
isIPad: function isIPad() {
var ua = window.navigator.userAgent.toLowerCase();
return ua.indexOf('ipad') > -1 || ua.indexOf('macintosh') > -1 && 'ontouchend' in document;
},
isIE9: function isIE9() {
return document.all && !window.atob;
},
matchMobileScreens: function matchMobileScreens() {
return window.matchMedia('only screen and (max-width: 768px)');
},
isIOS: function isIOS() {
return ['iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone', 'iPod'].includes(navigator.platform) || // iPad on iOS 13 detection
navigator.userAgent.includes('Mac') && 'ontouchend' in document;
}
};
var _default = UserAgentService;
exports.default = _default;
});

require.register("services/content-provider.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var _contentServiceProvider = _interopRequireDefault(require("services/content-service/content-service-provider"));

var _homeroomProvider = _interopRequireDefault(require("services/homeroom/homeroom-provider"));

/**
* Provides the content based upon the environment.
*
* Note that this is sensitive to initialization order. initialize is called in ef.js before others import it
* This service will not work alone with import because the singleton pattern would be evaluated before the
* settings service is initialized.
*/
function ContentProvider() {}

ContentProvider.prototype.initialize = function () {
if (_courseSettingsService.default.get('progressProvider') === 'content-service') {
Object.setPrototypeOf(this, _contentServiceProvider.default);
} else {
Object.setPrototypeOf(this, _homeroomProvider.default);
}

return this;
};

var _default = new ContentProvider();

exports.default = _default;
});

require.register("services/content-service/assessment-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

var _evaluationService = _interopRequireDefault(require("services/data-handler-services/evaluation-service"));

var _utils = _interopRequireDefault(require("lib/utils"));

var _attempt = _interopRequireDefault(require("ef/models/assessments/attempt"));

var _questions_collection = _interopRequireDefault(require("ef/collections/questions_collection"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _jquery = _interopRequireDefault(require("jquery"));

var AssessmentService = function AssessmentService() {
this.savePartialAttempts = true;

this.getRedirectUrlForCurrentPage = function () {
var currentPage = _ef.default.module.currentActivity.currentPage;
return "#".concat(currentPage.path(), "?assessmentTaken=true");
};

this.triggerAssessment = function (blockView) {
var redirectUrl = this.getRedirectUrlForCurrentPage();
var data = {
event_type: 'assessment-initialized',
redirectUrl: redirectUrl,
slug: blockView.model.get('assessment_slug')
};
/**
* Vulnerability: (Cross-Site Scripting (XSS))
* Authors should not use the wildcard keyword ( *) in the targetOrigin
* argument in messages that contain any confidential information,
* as otherwise there is no way to guarantee that the message is only
* delivered to the recipient to which it was intended.
*/

window.postMessage(data, '*');
};

this.userHasCompletedAssessment = function (courseSlug) {
return _evaluationService.default.userHasPassedEvaluation(courseSlug).then(function (gradingStatus) {
return gradingStatus;
});
};

this.getBestScore = function (courseSlug) {
return _evaluationService.default.bestScore(courseSlug);
};

this.loadCourseAssessment = /*#__PURE__*/function () {
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(view) {
var evaluation, responseSet, sections, questions, attempt;
return _regenerator.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return _evaluationService.default.expandedResponseSet(view.model.get('assessment_slug')).catch(function (err) {
return console.error(err);
});

case 2:
_context.next = 4;
return _evaluationService.default.findEvaluationBySlug(view.model.get('assessment_slug')).catch(function (err) {
return console.error(err);
});

case 4:
evaluation = _context.sent;
_context.next = 7;
return _evaluationService.default.getResponseSetFromModel(view.model.get('assessment_slug')).catch(function (err) {
return console.error(err);
});

case 7:
responseSet = _context.sent;
sections = evaluation.get('sections');
questions = new _questions_collection.default(sections.reduce(function (result, section) {
return result.concat(section.questions);
}, [])); // Foundry json workaround

questions.each(function (q) {
if (!q.has('response_type') && q.has('type')) {
var foundryResponseType = {
'Questions::MultipleResponse': 'multiple_selection',
'Questions::MultipleChoice': 'single_selection'
};
q.set('response_type', foundryResponseType[q.get('type')]);
}
});
view.assessment.set('questions', questions);
view.assessment.set('original_questions', questions);
view.assessment.set('response_set', responseSet);
view.assessment.set('subtext', view.model.get('subtext'));
attempt = new _attempt.default(1, {
assessment: view.assessment
});
attempt.set({
id: responseSet.id,
token: _evaluationService.default.findEvaluationTokenBySlug(view.model.get('assessment_slug'))
});
view.assessment.set('attempt', attempt);
return _context.abrupt("return", view);

case 19:
case "end":
return _context.stop();
}
}
}, _callee);
}));

return function (_x) {
return _ref.apply(this, arguments);
};
}();

this.getUrl = function (assessment, isSaving) {
var includes = isSaving ? '' : '?include=evaluation,sections.questions.answers';
return "".concat(assessment.get('response_set').endpoint, "/response_sets/").concat(assessment.get('response_set').id, ".json").concat(includes);
};

this.isAttemptCorrect = function (results, questionId) {
if (Array.isArray(results.incorrect_answers)) {
return !results.incorrect_answers.some(function (ia) {
return ia.question_id === questionId;
});
}
};

this.getAssessmentStatus = function (courseSlug) {
var attempts = this.getResponseSetForSlug(courseSlug);

if (attempts.length === 0) {
return 'not-attempted';
}

if (attempts.every(function (attempt) {
return !attempt.get('passed');
})) {
return 'failed';
}

if (attempts.some(function (attempt) {
return attempt.get('passed');
})) {
return 'passed';
}
};

this.getResponseSetId = function (courseSlug, mapping) {
var response = mapping[courseSlug];

if (response) {
return response;
}

console.warn('Invalid assessment mapping for slug: ', courseSlug); //eslint-disable-line no-console

console.warn('Here are the configured assessment mappings for reference: ', mapping); //eslint-disable-line no-console

return {}; // trigger something special...
};

this.getResponseSetForSlug = function (courseSlug) {
var mapping = _evaluationService.default.mapping || {};
var response = this.getResponseSetId(courseSlug, mapping);
return _ef.default.responseSet.filter(function (rs) {
return rs.get('id') === response.id;
});
};

this.getActivityProgressForSlug = function () {};

this.isAttemptComplete = function (attempt) {
var answers = _jquery.default.map(attempt.get('answers'), function (answer) {
return String(answer.question_id);
});

var questions = attempt.assessment.get('original_questions') || attempt.assessment.get('questions');
return questions.every(function (question) {
return _jquery.default.inArray(question.get('id'), answers) >= 0;
});
};

this.isAttemptFinished = function (attempt) {
return attempt.get('status') === 'completed';
};

this.parseAttempt = function (data) {
if (data && data.data) {
return _utils.default.sanifyJsonApiObject(data.data, data.included);
} else {
return data;
}
};

this.refreshActivityProgress = function () {};

this.getAttemptJSON = function (thisAttempt) {
var _this = this;

var questions = thisAttempt.assessment.get('questions');
var answers = thisAttempt.get('answers').map(function (ans) {
var _this$getResponseType;

var answer_id = ans.answer_id,
question_id = ans.question_id;

if (!answer_id || !question_id) {
return;
}

return {
value: answer_id.toString(),
question_id: question_id,
response_type: (_this$getResponseType = _this.getResponseType(questions, question_id)) !== null && _this$getResponseType !== void 0 ? _this$getResponseType : 'single_selection'
};
});
return {
data: {
id: thisAttempt.get('id'),
type: 'response_sets',
attributes: {
answers: answers
}
}
};
};

this.getResponseType = function (questions, question_id) {
var question = (0, _toConsumableArray2.default)(questions.models).find(function (question) {
return Number(question.id) === Number(question_id);
});
return question === null || question === void 0 ? void 0 : question.get('response_type');
};
};

var _default = new AssessmentService();

exports.default = _default;
});

require.register("services/content-service/content-service-provider.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _assessmentService = _interopRequireDefault(require("./assessment-service"));

var _courseModuleService = _interopRequireDefault(require("./course-module-service"));

var _customizationService = _interopRequireDefault(require("./customization-service"));

var _enrollmentService = _interopRequireDefault(require("./enrollment-service"));

var _initializationService = _interopRequireDefault(require("./initialization-service"));

var _moduleService = _interopRequireDefault(require("./module-service"));

var _modulesCollectionService = _interopRequireDefault(require("./modules-collection-service"));

var _pageService = _interopRequireDefault(require("./page-service"));

var _pollService = _interopRequireDefault(require("./poll-service"));

var _progressService = _interopRequireDefault(require("./progress-service"));

var _siteService = _interopRequireDefault(require("./site-service"));

var _surveyService = _interopRequireDefault(require("./survey-service"));

var _resourceService = _interopRequireDefault(require("./resource-service"));

var _default = {
AssessmentService: _assessmentService.default,
CourseModuleService: _courseModuleService.default,
CustomizationService: _customizationService.default,
EnrollmentService: _enrollmentService.default,
InitializationService: _initializationService.default,
ModuleService: _moduleService.default,
ModulesCollectionService: _modulesCollectionService.default,
PageService: _pageService.default,
PollService: _pollService.default,
ProgressService: _progressService.default,
SiteService: _siteService.default,
SurveyService: _surveyService.default,
ResourceService: _resourceService.default
};
exports.default = _default;
});

require.register("services/content-service/course-module-service.js", function(exports, require, module) {
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var CourseModuleService = function CourseModuleService() {
this.saveModuleProgress = function (view, page, mod) {
mod.progress.save(page, view.render);
};

this.saveModule = function (mod) {};
};

var _default = new CourseModuleService();

exports.default = _default;
});

require.register("services/content-service/customization-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _utils = _interopRequireDefault(require("lib/utils"));

var _backbone = _interopRequireDefault(require("backbone"));

var _ef = _interopRequireDefault(require("ef/ef"));

var CustomizationService = function CustomizationService() {
this.typeMapping = {
'text-content-customization': {
customization_type: 'text',
fieldMapping: {
custom_text: 'text'
}
},
'video-content-customization': {
customization_type: 'video',
fieldMapping: {
video_id: 'youtube_url'
},
fieldValues: {
provider: 'youtube'
}
},
'image-content-customization': {
customization_type: 'image'
},
'page-content-customization': {
customization_type: 'page'
},
'data-option': {
customization_type: 'data_option'
}
};

this.load = function () {
return _utils.default.failProofPromise(_ef.default.customizations.fetch({
parse: true,
headers: {
Authorization: "Bearer ".concat(_ef.default.config.get('jwt'))
}
}));
};

this.getCustomizationCollectionUrl = function (self, ef) {
// why one uses ef as a param and other from imported EF ????
return "".concat(ef.config.get('portalBasePath'), "/customizations.json?filter[content_id]=").concat(_ef.default.enrollment.get('contentId'));
};

this.parseCustomizationCollection = function (response, _options) {
return _utils.default.sanifyJsonApiObject(response.data, response.included);
};

this.getById = function (customizationCollection, id) {
return _backbone.default.Collection.prototype.get.call(customizationCollection, id);
};

this.findByType = function (customizationCollection, type) {
var typeMap = this.typeMapping[type];
var typeValue = typeMap && typeMap.customization_type || type;
return customizationCollection.findWhere(function (customization) {
return customization.get('customization_type') === typeValue;
});
};

this.getCustomizationByKeyAndSlug = function (customizationCollection, type, slug) {
var typeMap = this.typeMapping[type];
var customizations = customizationCollection.filter(function (customization) {
// typeMap.customization_type will crash since typeMap can be undefined
return customization.get('customization_type') === typeMap.customization_type && customization.get('slug') === slug;
}); // what if there are many more ??

if (customizations[0]) {
var customization = customizations[0].toJSON();

if (typeMap.fieldMapping) {
Object.entries(typeMap.fieldMapping).forEach(function (_ref) {
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
key = _ref2[0],
value = _ref2[1];

customization[key] = customization[value];
});
}

if (typeMap.fieldValues) {
Object.entries(typeMap.fieldValues).forEach(function (_ref3) {
var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
key = _ref4[0],
value = _ref4[1];

if (key === 'provider' && !customization[key] && type === 'video-content-customization') {
var VIMEO_REGEX = /(?:http|https)?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^/]*)\/videos\/|)(\d+)(?:|\/\?)/;
customization[key] = VIMEO_REGEX.test(customization.video_url) ? 'vimeo' : 'youtube';
} else {
customization[key] = value;
}
});
}

return customization;
}
};

this.getByKeyAndPage = function (customizationCollection, type, moduleKey, activityKey, pageKey) {
var typeMap = this.typeMapping[type];
var customizations = customizationCollection.filter(function (customization) {
return customization.get('customization_type') === typeMap.customization_type;
});
var moduleDefault = customizations.find(function (customization) {
return customization.get('data').module_key === moduleKey && !customization.get('data').activity_key;
});
return customizations.reduce(function (results, c) {
var data = c.get('data');

if (data.module_key === moduleKey && data.activity_key === activityKey && data.page_key === pageKey) {
results.push({
content_type: data.content_type,
// why the need to check against a string?
content: data.use_module_default === 'true' ? moduleDefault.get('text') : c.get('text')
});
}

return results;
}, []);
};
};

var _default = new CustomizationService();

exports.default = _default;
});

require.register("services/content-service/enrollment-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _utils = _interopRequireDefault(require("lib/utils"));

var _lodash = require("lodash");

var EnrollmentService = function EnrollmentService() {
this.parseEnrollment = function (model, response) {
var enrollment = _utils.default.sanifyJsonApiObject(response.data, response.included); //ensure that enrollment data is defined and not empty


var enrollmentData = enrollment.enrollment_data;

if (enrollmentData && Array.isArray(enrollmentData) && enrollmentData.length > 0) {
model.data.set(enrollment.enrollment_data);
delete enrollment.enrollment_data;
}

return enrollment;
};

this.saveData = (0, _lodash.debounce)(function (model, options, dataObj) {
if (dataObj.hasChanged()) {
model.save(null, options);
}
}, 2000);
};

var _default = new EnrollmentService();

exports.default = _default;
});

require.register("services/content-service/initialization-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _initializationService = _interopRequireDefault(require("services/course-handler-services/initialization-service"));

var InitializationService = /*#__PURE__*/function () {
function InitializationService() {
(0, _classCallCheck2.default)(this, InitializationService);
}

(0, _createClass2.default)(InitializationService, null, [{
key: "preload",
value: function preload() {
return _ef.default.enrollment.fetch();
}
}, {
key: "load",
value: function load() {
return [Promise.resolve()];
}
}, {
key: "applyTransformations",
value: function applyTransformations(modulesJSON, modulesContentJson, groupsJSON) {
return _initializationService.default.applyTransformations(modulesJSON, modulesContentJson, groupsJSON);
}
}]);
return InitializationService;
}();

exports.default = InitializationService;
});

;require.register("services/content-service/module-service.js", function(exports, require, module) {
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var ModuleService = function ModuleService() {
this.completePages = function (model) {
var self = model;
model.activities.each(function (act) {
act.pages.each(function (page) {
if (!page.get('completed')) {
page.set('completed', true);
self.progress.save(page);
}
});
});
};

this.markComplete = function (model) {
model.progress.markComplete();
};
};

var _default = new ModuleService();

exports.default = _default;
});

require.register("services/content-service/modules-collection-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _ef = _interopRequireDefault(require("ef/ef"));

var ModulesCollectionService = function ModulesCollectionService() {
this.getModuleCollectionResponseData = function (response) {
return response.data ? [response.data] : [];
};

this.getModuleCollectionModuleStatusByKey = function (modStatuses, key) {
if (modStatuses[0] && modStatuses[0].attributes.data.modules) {
return modStatuses[0].attributes.data.modules[key];
} else if (modStatuses[0] && modStatuses[0].attributes.data.module_key === key) {
return modStatuses[0].attributes.data;
}
};

this.getModuleCollectionUrl = function () {
return _ef.default.url("/progress/".concat(_ef.default.enrollment.get('id'), "?filter[content_id]=").concat(_ef.default.enrollment.get('contentId')));
};
};

var _default = new ModulesCollectionService();

exports.default = _default;
});

require.register("services/content-service/page-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _ef = _interopRequireDefault(require("ef/ef"));

var PageService = function PageService() {
this.saveProgress = function (blockView) {
_ef.default.module.progress.save(blockView.model);
};
};

var _default = new PageService();

exports.default = _default;
});

require.register("services/content-service/poll-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _evaluationService = _interopRequireDefault(require("services/data-handler-services/evaluation-service"));

var _utils = _interopRequireDefault(require("lib/utils"));

var _backbone = _interopRequireDefault(require("backbone"));

var PollService = function PollService() {
this.renderPoll = function (blockView) {
blockView.poll.set('response_set', _evaluationService.default.getResponseSet(blockView.model.get('slug')));
var options = {
parse: true,
headers: {
Authorization: "Bearer ".concat(blockView.poll.get('response_set').token)
}
};
blockView.poll.fetch(options).done(function () {
blockView.model.set('translate', false);
blockView.model.set('text', blockView.poll.get('text'));
blockView.model.set('id', blockView.poll.get('id'));
blockView.model.set('answers', blockView.poll.get('answers'));
blockView.render();
});
};

this.getUrl = function (model) {
return "".concat(model.get('response_set').endpoint, "/response_sets/").concat(model.get('response_set').id, ".json?include=evaluation,sections.questions.answers");
};

this.parse = function (model, response) {
if (!(response && response.data)) {
return;
}

var pollData = _utils.default.sanifyJsonApiObject(response.data, response.included);

_utils.default.setSectionsData(pollData); //SDK polls expect only one section/question for now


var sectionIndex = model.get('sectionIndex') || 0;
var questionIndex = model.get('questionIndex') || 0; //return question

return pollData.sections[sectionIndex].questions[questionIndex];
};

this.save = function (model, options) {
options = options || {};
options.headers = {
Authorization: "Bearer ".concat(model.get('response_set').token)
};
var answers = Array.isArray(model.get('response_id')) ? [{
question_id: model.get('id'),
value: model.get('response_id'),
response_type: 'multiple_selection'
}] : [{
question_id: model.get('id'),
value: model.get('response_id'),
user_supplied_text: model.get('user_supplied_text'),
response_type: 'single_selection'
}];
options.attrs = {
data: {
id: model.get('response_set').id,
type: 'response_sets',
attributes: {
answers: answers
}
}
};
return new Promise(function (resolve, reject) {
return _backbone.default.Model.prototype.save.call(model, options.attrs, options).then(function () {
var headers = new Headers();
headers.set('Authorization', "Bearer ".concat(model.get('response_set').token));
return fetch("".concat(model.get('response_set').endpoint, "/response_sets/").concat(model.get('response_set').id, "/poll_results"), {
headers: headers
}).then(function (resp) {
return resp.json();
}).then(function (response) {
var sectionIndex = model.get('sectionIndex') || 0;
var questionIndex = model.get('questionIndex') || 0;
var answers = {
totals: response.data.attributes.results.sections[sectionIndex].questions[questionIndex].answers
};
resolve(answers);
});
});
});
};
};

var _default = new PollService();

exports.default = _default;
});

require.register("services/content-service/progress-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _keepAlive = _interopRequireDefault(require("lib/keep-alive"));

var _content_page = _interopRequireDefault(require("ef/models/content_page"));

var _page = _interopRequireDefault(require("ef/models/page"));

var _ef = _interopRequireDefault(require("ef/ef"));

var ProgressService = function ProgressService() {
this.saveProgress = function (model, page, cb) {
var data;

cb = cb || function () {};

if (page instanceof _content_page.default) {
data = {
key: page.key,
page_key: page.key,
completed: page.completed,
data: page.pageData,
activity_key: page.activityKey,
module_key: page.moduleKey,
date: new Date()
};
} else if (page instanceof _page.default) {
data = {
key: page.get('key'),
page_key: page.get('key'),
completed: page.get('completed'),
data: page.pageData,
activity_key: page.activity.get('key'),
module_key: page.activity.module.get('key'),
date: new Date()
};
}

if (data) {
data.content_id = _ef.default.enrollment.get('contentId');
model.savePage(page, data, cb);
}

(0, _keepAlive.default)();
};

this.getPath = function (eid) {
return "/progress/".concat(eid, "/page_progress");
};

this.getRequestOptions = function (request) {
var data = {
data: {
type: 'page_progress',
attributes: request.data
}
};
return {
type: 'POST',
url: request.url,
headers: {
Authorization: "Bearer ".concat(_ef.default.config.get('accessToken')),
'Content-Type': 'application/vnd.api+json'
},
processData: false,
data: JSON.stringify(data)
};
};

this.saveActivityProgress = function (model, grade, attempt, slug) {};

this.saveCourseTimeProgress = function (_ref) {
var intervalSeconds = _ref.intervalSeconds;

if (!(_ef.default.enrollment && _ef.default.enrollment.get('id')) || !(_ef.default.config && _ef.default.config.get('basePath')) || !(_ef.default.enrollment && _ef.default.enrollment.get('contentId'))) {
return;
}

var progressId = _ef.default.enrollment.get('id');

var basePath = _ef.default.config.get('basePath');

var contentId = _ef.default.enrollment.get('contentId');

var url = "".concat(basePath, "/progress/").concat(progressId, "/time_log");
return fetch(url, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
Cache: 'no-cache',
Authorization: "Bearer ".concat(_ef.default.config.get('accessToken'))
},
body: JSON.stringify({
data: {
id: progressId,
type: 'progress',
attributes: {
type: 'content',
content_id: contentId,
duration: "PT".concat(intervalSeconds, "S")
}
}
})
});
};
};

var _default = new ProgressService();

exports.default = _default;
});

require.register("services/content-service/resource-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _utils = _interopRequireDefault(require("lib/utils"));

var _resources_collection = _interopRequireDefault(require("ef/collections/resources_collection"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _handler = _interopRequireDefault(require("services/error-handler-service/handler"));

var ResourceService = function ResourceService() {
this.getResources = function (resourceType, resourceSubType) {
var _this = this;

var withoutFiltering = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;

var contentId = _ef.default.enrollment.get('contentId'); //business_resource_contents => include business_resource
//content_business_policies => include business_policy


var urls = {
resource: withoutFiltering ? "".concat(_ef.default.config.get('portalBasePath'), "/business_resources.json?filter[content_id]=").concat(encodeURIComponent(contentId)) : "".concat(_ef.default.config.get('basePath'), "/contents/").concat(encodeURIComponent(contentId), "/business_resource_contents.json?include=business_resource&filter[content_id]=").concat(encodeURIComponent(contentId)),
policyresource: withoutFiltering ? "".concat(_ef.default.config.get('portalBasePath'), "/business_policies.json?filter[content_id]=").concat(encodeURIComponent(contentId)) : "".concat(_ef.default.config.get('basePath'), "/contents/").concat(encodeURIComponent(contentId), "/content_business_policies.json?include=business_policy&filter[content_id]=").concat(encodeURIComponent(contentId))
};
urls.nationalresource = urls.resource;

if (resourceType) {
var _EF$resources;

if ((_EF$resources = _ef.default.resources) !== null && _EF$resources !== void 0 && _EF$resources.length) {
this.setSigned();
return new Promise(function (resolve) {
return resolve(_ef.default.resources.byTypeSync(resourceType, resourceSubType));
});
} else {
return this.fetch(urls[resourceType.toLowerCase()]).then(function (resources) {
if (_ef.default.resources) {
_ef.default.resources.add(new _resources_collection.default(resources, {
enrollment: _ef.default.enrollment
}).models);
} else {
_ef.default.resources = new _resources_collection.default(resources, {
enrollment: _ef.default.enrollment
});
}
}).then(function () {
_this.setSigned();

return new Promise(function (resolve) {
return resolve(_ef.default.resources.byTypeSync(resourceType, resourceSubType));
});
});
}
} else {
return new Promise(function (_resolve, reject) {
return reject();
});
}
};

this.loadResources = function (withoutFiltering) {
return Promise.all([this.getResources('PolicyResource', null, withoutFiltering), this.getResources('Resource', null, withoutFiltering)]).then(function () {
return Promise.resolve(_ef.default.resources);
});
};

this.setSigned = function () {
var _EF$enrollment$get, _EF$enrollment$get$fi;

var signedPolicies = (_EF$enrollment$get = _ef.default.enrollment.get('signed_business_policies')) === null || _EF$enrollment$get === void 0 ? void 0 : (_EF$enrollment$get$fi = _EF$enrollment$get.filter(function (p) {
return p.signed_at;
})) === null || _EF$enrollment$get$fi === void 0 ? void 0 : _EF$enrollment$get$fi.map(function (x) {
return x.id;
});

if (signedPolicies && signedPolicies.length > 0) {
_ef.default.resources.forEach(function (resource) {
var id = resource.get('id');
var policyId = parseInt(id.replace("".concat(resource.get('type'), "-"), ''));
var signed = signedPolicies.find(function (x) {
return x === policyId;
});
resource.set('signed', signed ? true : false);
});
}
};

this.fetch = function (url) {
return fetch(url, {
credentials: 'include',
headers: {
Authorization: "Bearer ".concat(_ef.default.config.get('jwt'))
}
}).then(function (response) {
return response.json();
}).then(function (data) {
return _utils.default.sanifyJsonApiObject(data.data, data.included);
});
};

this.save = function (resourceItem) {
return fetch("".concat(_ef.default.config.get('basePath'), "/progress/").concat(_ef.default.enrollment.id, "/policy_signatures.json"), {
body: JSON.stringify({
data: {
type: 'policy_signature',
attributes: {
// split on first occurance of - to remove the type added for uniqueness
policy_id: resourceItem.get('id').substring(resourceItem.get('id').indexOf('-') + 1),
resource_type: 'PolicyResource'
}
}
}),
credentials: 'include',
headers: {
Authorization: "Bearer ".concat(_ef.default.config.get('accessToken')),
'Content-Type': 'application/vnd.api+json'
},
method: 'POST',
mode: 'cors'
}).then(function (response) {
return _utils.default.httpErrorHandler(response, _ef.default.resources.checkIfAllResourcesSigned(resourceItem === null || resourceItem === void 0 ? void 0 : resourceItem.get('sub_type')));
}).then(jsonParser).catch(function (err) {
_handler.default.handle(err, 'warn');

resourceItem.set('signed', false);
});
};

var jsonParser = function jsonParser(response) {
return response.json();
};
};

var _default = new ResourceService();

exports.default = _default;
});

require.register("services/content-service/site-service.js", function(exports, require, module) {
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var SiteService = function SiteService() {
this.addSponsorClass = function () {};
};

var _default = new SiteService();

exports.default = _default;
});

require.register("services/content-service/survey-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

var _evaluationService = _interopRequireDefault(require("services/data-handler-services/evaluation-service"));

var _backbone = _interopRequireDefault(require("backbone"));

var _ef = _interopRequireDefault(require("ef/ef"));

var SurveyService = function SurveyService() {
this.getRedirectUrlForCurrentPage = function () {
var currentPage = _ef.default.module.currentActivity.currentPage ? _ef.default.module.currentActivity.currentPage.path() : '';
return "#".concat(currentPage, "?surveyTaken=true");
};

this.triggerSurvey = function (blockView) {
var redirectUrl = this.getRedirectUrlForCurrentPage();
var data = {
event_type: 'survey-initialized',
redirectUrl: redirectUrl,
slug: blockView.model.get('slug')
};
window.postMessage(data, '*');
};

this.userHasCompletedSurvey = function (courseSlug) {
return _evaluationService.default.userHasCompletedEvaluation(courseSlug);
};

this.getSurvey = function (blockView) {
var _this = this;

return _evaluationService.default.expandedResponseSet(blockView.model.get('slug')).then(function () {
return _this.getSurveyResponseModel(blockView);
}).then(function (surveyResponseModel) {
var foundryAllowAnswerChange = surveyResponseModel.get('evaluation').allow_changing_answers;

if (foundryAllowAnswerChange !== undefined) {
surveyResponseModel.set('allow_answer_change', foundryAllowAnswerChange);
}

blockView.model.set('responseSet', surveyResponseModel); // sections is not set on the survey model for some reason
// this has to be handled here or in the template

blockView.model.set('translate', false);
blockView.model.get('survey').set('sections', surveyResponseModel.get('sections'));
blockView.render();
});
};

this.saveSurveyResponse = /*#__PURE__*/function () {
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(blockView, dataset, opts) {
var surveyResponseModel, options;
return _regenerator.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return this.getSurveyResponseModel(blockView);

case 2:
surveyResponseModel = _context.sent;

if (opts && opts.multipleQuestion) {
options = surveyResponseModel.save(dataset);
} else {
options = surveyResponseModel.save([{
question_id: dataset.questionId,
answer_id: dataset.answerId
}]);
}

return _context.abrupt("return", _backbone.default.Model.prototype.save.call(surveyResponseModel, options.attrs, options));

case 5:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));

return function (_x, _x2, _x3) {
return _ref.apply(this, arguments);
};
}();

this.refreshResponseSet = function (slug) {
return _evaluationService.default.refreshResponseSet(slug);
};

this.getSurveyResponseModel = function (blockView) {
return _evaluationService.default.findEvaluationBySlug(blockView.model.get('slug'));
};
};

var _default = new SurveyService();

exports.default = _default;
});

require.register("services/course-handler-services/alert-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _chaplin = _interopRequireDefault(require("chaplin"));

var AlertService = function AlertService() {
var _this = this;

this.showSuccessAlert = function () {
var successConfig = {
type: 'alertBox.alertSuccess',
title: 'alertBox.alertSuccessHeader',
icon: '',
visible: true,
message: 'alertBox.alertSuccessText',
timeout: 5000
};

_this.showAlert(successConfig);
};

this.showFailureAlert = function () {
var failureConfig = {
type: 'alertBox.alertFailure',
title: 'alertBox.alertFailureHeader',
icon: '',
visible: true,
message: 'alertBox.alertFailureText',
timeout: 5000
};

_this.showAlert(failureConfig);
};

this.showAlert = function (alertConfig) {
if (!alertConfig) {
return;
}

var type = alertConfig.type,
title = alertConfig.title,
icon = alertConfig.icon,
visible = alertConfig.visible,
message = alertConfig.message,
timeout = alertConfig.timeout;

_chaplin.default.mediator.publish('action:alert', type, title, message, icon, visible, timeout);
};
};

var _default = new AlertService();

exports.default = _default;
});

require.register("services/course-handler-services/audio-service-base.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _backbone = _interopRequireDefault(require("backbone"));

var _utils = _interopRequireDefault(require("lib/utils"));

var _localeService = _interopRequireDefault(require("services/loader-handler-services/locale-service"));

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var AudioServiceBase = /*#__PURE__*/function () {
function AudioServiceBase(view) {
(0, _classCallCheck2.default)(this, AudioServiceBase);
Object.assign(this, _backbone.default.Events);
this.audioView = view; //This has to initialize with model view so that we attach events

this.playlist = []; // Array of sound objects
}

(0, _createClass2.default)(AudioServiceBase, [{
key: "loadAudio",
value: function () {
var _loadAudio = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(sources) {
var _this = this;

var i, allSources;
return _regenerator.default.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
if (!(sources !== null && sources !== void 0 && sources.length && Array.isArray(sources))) {
_context2.next = 6;
break;
}

i = 0;
_context2.next = 4;
return Promise.all(sources.map(function (source, index) {
source.path = _this.getCoursePath(source.path);

var id = _this.getIdFromPath(source.path);

if (id) {
// uses the last source path as the id. sources could have different file names
// but this is good enough for use as an id in the events
_this.audioView.model.set('id', id);
}

return _utils.default.fetch(source.path).then( /*#__PURE__*/function () {
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(response) {
var _source$playOrder;

var responseClone, responseText, isLFSFile;
return _regenerator.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
if (!(response.status !== 200)) {
_context.next = 2;
break;
}

return _context.abrupt("return", Promise.reject(response));

case 2:
/**
* Here we are updating the index because howler service plays the audio in incremental order.
* Also we wanted to exclude the audios that were not resolved.
*/
source.index = i++;
/**
* Response body interface methods can be used once.
* Using them twice throws a TypeError indicating that the stream has already been read.
* Therefore, allow multiple uses of response.
*/

/**
* Response body interface methods can be used once.
* Using them twice throws a TypeError indicating that the stream has already been read.
* Therefore, allow multiple uses of response.
*/
responseClone = response.clone();
/**
* reads stream to completion and resolves with a usvstring
* (first use of response body interface method)
*/

_context.next = 6;
return response.text();

case 6:
responseText = _context.sent;

if (!(response.headers.get('Content-Type') === 'application/vnd.git-lfs+json')) {
_context.next = 11;
break;
}

_this.setLFSsrc(responseText, source);

_context.next = 22;
break;

case 11:
/**
* For some audio, for some cleanup reason, it seems response headers return audio/mpeg content-type
* even though under the hood the files are Git LFS file. Therefore,
* ensure that the file is a git lfs file
*/
isLFSFile = responseText === null || responseText === void 0 ? void 0 : responseText.includes('https://git-lfs.github.com/spec/v1');

if (!isLFSFile) {
_context.next = 16;
break;
}

_this.setLFSsrc(responseText, source);

_context.next = 22;
break;

case 16:
_context.t0 = _this;
_context.next = 19;
return responseClone.blob();

case 19:
_context.t1 = _context.sent;
_context.t2 = source;

_context.t0.setBlobSrc.call(_context.t0, _context.t1, _context.t2);

case 22:
source.id = id;
source.isReady = true;
_this.howls = [id, source.index, source.path, !!source.autoplay, !!(source.selector || source.on || source.component), (_source$playOrder = source.playOrder) !== null && _source$playOrder !== void 0 ? _source$playOrder : false, source.selector || source.on || source.component];
return _context.abrupt("return", Promise.resolve(source));

case 26:
case "end":
return _context.stop();
}
}
}, _callee);
}));

return function (_x2) {
return _ref.apply(this, arguments);
};
}()).catch(function (error) {
_this.audioView.readyToGo();

console.error("Could not load audio: ".concat(id), error); //eslint-disable-line no-console
});
}));

case 4:
allSources = _context2.sent;
return _context2.abrupt("return", allSources.filter(function (source) {
return source;
}));

case 6:
case "end":
return _context2.stop();
}
}
}, _callee2);
}));

function loadAudio(_x) {
return _loadAudio.apply(this, arguments);
}

return loadAudio;
}()
/**
* Build sound object and add it to playlist ({id, src, howl}).
* by default howl is null until we can attach events
* @param {Array} source Array of audio id and source path
*/

}, {
key: "howls",
set: function set(source) {
var _source = (0, _slicedToArray2.default)(source, 7),
id = _source[0],
index = _source[1],
path = _source[2],
autoplay = _source[3],
trigger = _source[4],
order = _source[5],
eventTarget = _source[6];

this.playlist.push({
id: id,
index: index,
src: path,
autoplay: autoplay,
howl: null,
hasTrigger: trigger,
playOrder: order,
eventTarget: eventTarget
});
}
}, {
key: "getOID",
value: function getOID(lfs) {
var lfsData = lfs.split('\n');
return lfsData[1].split(' ')[1].replace('sha256:', '');
}
}, {
key: "setBlobSrc",
value: function setBlobSrc(blob, src) {
src.path = URL.createObjectURL(blob);
}
}, {
key: "setLFSsrc",
value: function setLFSsrc(lfs, src) {
var oidSha = this.getOID(lfs);

var name = _courseSettingsService.default.get('name');

var language = _localeService.default.getLanguage();

var basePath = _courseSettingsService.default.get('media_host');

src.path = "".concat(basePath, "/curriculums/").concat(name, "/media/audio/").concat(language, "/").concat(oidSha, ".mp3");
src.isReady = true;
}
}, {
key: "getCoursePath",
value: function getCoursePath(path) {
return _utils.default.coursePath("audio/".concat(_localeService.default.getLanguage(), "/").concat(path));
}
}, {
key: "getIdFromPath",
value: function getIdFromPath(path) {
return path.split('/').pop().split('.').shift();
}
}, {
key: "formatTime",
value: function formatTime(secs) {
var minutes = Math.floor(secs / 60) || 0;
var seconds = secs - minutes * 60 || 0;
return "".concat(minutes, ":").concat((seconds < 10 ? '0' : '') + seconds);
}
}]);
return AudioServiceBase;
}();

exports.default = AudioServiceBase;
});

;require.register("services/course-handler-services/audio-service-howler.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));

var _howler = require("howler");

var _localeService = _interopRequireDefault(require("services/loader-handler-services/locale-service"));

var _audioServiceBase = _interopRequireDefault(require("services/course-handler-services/audio-service-base"));

var _iconAtomView = _interopRequireDefault(require("views/atoms/icon-atom/icon-atom-view"));

var _webStorageService = require("services/data-handler-services/web-storage-service");

var _chaplin = _interopRequireDefault(require("chaplin"));

var _utils = _interopRequireDefault(require("lib/utils"));

var _jquery = _interopRequireDefault(require("jquery"));

var _userAgentService = _interopRequireDefault(require("services/browser-handler-services/user-agent-service"));

var _enrollmentDataService = _interopRequireDefault(require("services/data-handler-services/enrollment-data-service"));

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

_howler.Howler.autoUnlock = true; // Howler will automatically attempt to enable audio.

var AudioServiceHowler = /*#__PURE__*/function (_AudioServiceBase) {
(0, _inherits2.default)(AudioServiceHowler, _AudioServiceBase);

var _super = _createSuper(AudioServiceHowler);

function AudioServiceHowler(view) {
var _this;

(0, _classCallCheck2.default)(this, AudioServiceHowler);
_this = _super.call(this, view);
_this.index = 0; // Index of sounds in the playlist. initially 0 to start playing on the first sound in the list

_this.blockCID = view.model.get('cid');
_this.lastVolumeLevel = NaN;
_this.audioMute = _webStorageService.webStorage.getItem('audio_mute') || _this.getEnrollmentDataMute(); // Audio mute setting can be set from a localStorage key or enrollment data setting

_this.soundPlaying = false;
_this.defaultVolumeLevel = 0.25; // Default volume level. Will be used when unmuting on '0' volume

_howler.Howler.volume(_this.defaultVolumeLevel); //Setting default volume level globally


return _this;
}

(0, _createClass2.default)(AudioServiceHowler, [{
key: "queueAudio",
value: function queueAudio(index) {
this.index = index;
this.playAudio();
this.stop();
}
/**
* Gets the audio from the playlist by index.
* When the index is empty it gets the first or current audio.
* However rail guards are in place to throw an error when trying trying to get an audio that is not in the playlist.
* @param {Number} index Audio index in the playlist
*/

}, {
key: "getAudioByIndex",
value: function getAudioByIndex() {
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;

try {
if (isNaN(index)) {
index = this.index;
}

if (index < 0 || index > this.playlist.length) {
throw Error("Incorrect index: ".concat(index, " is not in the playlist"));
}

return this.playlist.find(function (audio) {
return audio.index === index;
});
} catch (e) {
throw Error("Could not get audio by index ".concat(index, ": ").concat(e));
}
}
/**
* Plays audio from playlist.
* When the index is undefined it gets the first or current audio.
* @param {Number} index Audio index in the playlist
*/

}, {
key: "play",
value: function play(index) {
// set current audio if index is not defined
if (isNaN(index)) {
index = this.index;
}

this.stopCurrent(); // avoids multiple audios playing at once

var listItem = this.getAudioByIndex(index);
var sound = listItem.howl;
this.duration = sound.duration(); // update player duration display

sound.play(); // begin playing the audio
// Update player play/pause button

if (sound.state() === 'loaded' || sound.state() === 'loading') {
this.audioTimer(sound); // update player audio timer and progress bar

this.playBtn.style.display = 'none';
this.pauseBtn.style.display = 'block';
this.playStateBtn.textContent = _localeService.default.t('audio.playStatus');

_chaplin.default.mediator.publish('audio:playing', {
index: index,
eventTarget: listItem.eventTarget
});

this.soundPlaying = true;
} else {
this.playStateBtn.textContent = _localeService.default.t('audio.stopStatus');
this.playBtn.style.display = 'block';
this.pauseBtn.style.display = 'none';
this.audioTimer(sound);

_chaplin.default.mediator.publish('audio:stopped');
}

this.volume(this.audioMute ? 0 : _howler.Howler.volume()); // update player volume range slider and/or mute/unmute button

this.index = index; // keep track of the current audio playing
}
/**
* Pauses audio
* When the index is undefined it gets the first or current audio.
* @param {Number} index Audio index in the playlist
*/

}, {
key: "pause",
value: function pause() {
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
var sound = this.getAudioByIndex(index);

if (sound.howl.playing()) {
sound.howl.pause();
this.playStateBtn.textContent = _localeService.default.t('audio.pauseStatus');
this.playBtn.style.display = 'block';
this.pauseBtn.style.display = 'none';

_chaplin.default.mediator.publish('audio:paused');

this.soundPlaying = false;
}
}
/**
* Stops specified or current audio
* @param {Number} index Audio index in the playlist
*/

}, {
key: "stop",
value: function stop() {
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
var sound = this.getAudioByIndex(index).howl;

if (sound !== null && sound !== void 0 && sound.playing() || this.soundPlaying) {
sound.stop();
this.playStateBtn.textContent = _localeService.default.t('audio.stopStatus');

_chaplin.default.mediator.publish('audio:stopped');

this.soundPlaying = false;
this.hidePlayer();
}
}
}, {
key: "stopCurrent",
value: function stopCurrent() {
var sound = this.playlist[this.index].howl;

if (sound !== null && sound !== void 0 && sound.playing()) {
sound.stop();
}
}
/**
* Sets audio volume and updated volume bar.
* When the index is not defined it sets global audio volume.
* @param {Number} val Volume level 0 to 1
* @param {Number} index Audio index in the playlist
*/

}, {
key: "volume",
value: function volume() {
var val = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _howler.Howler.volume();
var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
var level = val;

if (level > 1) {
level = parseInt(val) / 100;
}

this.volumeBar.value = level * 100;
this.lastVolumeLevel = this.volumeBar.value;
this.mute(parseFloat(level) === 0);

if (index) {
var sound = this.getAudioByIndex(index);
sound.howl.volume(level);
} else {
_howler.Howler.volume(level);
}
}
/**
* Mutes audio.
* @param {Boolean} muteState
*/

}, {
key: "mute",
value: function mute(muteState) {
var volumeLevel = muteState ? 0 : this.lastVolumeLevel;

if (!muteState && parseInt(this.lastVolumeLevel) === 0) {
this.lastVolumeLevel = this.defaultVolumeLevel;
volumeLevel = this.lastVolumeLevel * 100;
}

_howler.Howler.mute(muteState);

_howler.Howler.volume(this.lastVolumeLevel);

this.audioMute = muteState; // Update volume bar and mute buttons

if (muteState) {
this.volumeBar.value = volumeLevel;
this.mutedBtn.style.display = 'block';
this.unmutedBtn.style.display = 'none';
} else {
this.volumeBar.value = volumeLevel;
this.mutedBtn.style.display = 'none';
this.unmutedBtn.style.display = 'block';
}
}
/**
* Skips to the next or previous audio
* @param {String} direction Direction to skip to (prev and next)
*/

}, {
key: "skip",
value: function skip(direction) {
var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;

if (index) {
this.skipTo(index);
} else {
if (direction === 'prev') {
index = this.index - 1;

if (index < 0) {
index = this.playlist.length - 1;
}
} else {
index = this.index + 1;

if (index >= this.playlist.length) {
index = 0;
}
}

this.skipTo(index);
}
}
}, {
key: "skipTo",
value: function skipTo(index) {
this.stopCurrent();
this.play(index);
}
/**
* Seek to a new position in the currently playing track.
* At the moment we will seek fixed steps
* TODO: In future we might want to use the progress bar to seek
* @param {String} direction Direction to seek in
*/

}, {
key: "seek",
value: function seek(direction) {
// Get the Howl we want to manipulate.
var sound = this.playlist[this.index].howl;
var seekPosition;
var seekStep = 0.15;
var currentPos = sound.seek() / sound.duration();

if (currentPos === 0) {
return;
}

if (direction === 'backward') {
seekPosition = currentPos - seekStep;
} else if (direction === 'forward') {
seekPosition = currentPos + seekStep;
}

if (sound.playing()) {
sound.seek(sound.duration() * Math.max(seekPosition, 0));

if (_userAgentService.default.isIOS()) {
this.audioTimer(sound);
}
}
}
/**
* Sets the duration display
*/

}, {
key: "duration",
set: function set(audioDuration) {
var time = (0, _get2.default)((0, _getPrototypeOf2.default)(AudioServiceHowler.prototype), "formatTime", this).call(this, Math.round(audioDuration !== null && audioDuration !== void 0 ? audioDuration : 0));
this.durationElement.textContent = _localeService.default.t(time);
}
/**
* Attaches additional audio events from the audio view to audios in the playlist
* available media events: https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events
*
* @param {Object} events media events
*/

}, {
key: "attachMediaEvents",
value: function attachMediaEvents(events) {
var _this2 = this;

_howler.Howler.html5PoolSize = 100;
_howler.Howler.autoUnlock = true;
_howler.Howler.usingWebAudio = true; //const autoplay = !!this.audioView.model.get('autoplay');
// sort playlist by index

this.playlist.sort(function (a, b) {
return a.index - b.index;
}); // audios in the playlist initially have null hows, thus we want to attach howls and events

this.playlist.forEach(function (sound) {
if (!sound.howl) {
sound.howl = new _howler.Howl(_objectSpread({
src: sound.src,
html5: true,
format: 'mp3',
preload: true,
onplay: function onplay(index) {
var id = _this2.audioView.model.get('id');

var a11yStatus = _localeService.default.t('audio.playStatus');

if (_this2.audioView.model.has('transcript')) {
var transcript = _this2.audioView.model.get('transcript');

_this2.audioView.publishEvent('media:narration', _localeService.default.t(transcript.text));
}

_this2.audioView.publishEvent('media:status:changed', 'playing', id, 'audio', a11yStatus);

_this2.playBtn.style.display = 'none';
_this2.pauseBtn.style.display = 'block';
var duration = sound.howl.duration(id);

if (duration) {
_this2.audioTimer(sound.howl);
}

if (sound.howl.volume() === 0 || _this2.audioMute) {
_this2.mute(true);
}
},
onload: function onload() {
if (sound.howl.state() === 'loaded') {
// block autoplay trumps source level autoplay
if (!_this2.blockAutoplay) {
return;
}

if (sound.autoplay && sound.playOrder === 0 && _enrollmentDataService.default.getByDotString('settings.audio.autoplay')) {
_this2.play(sound.index);

_this2.showPlayer();
}
}
},
onloaderror: function onloaderror() {
// False positive for auto play audio - check sound howl first
if (sound.howl) {
_howler.Howler.autoUnlock = true;

if (sound.autoplay && !_this2.soundPlaying) {
_this2.soundPlaying = true;

_this2.play();
}
} else {
sound.howl.once('loaderror', function () {
sound.howl.unload();
});
}
},
onplayerror: function onplayerror() {
if (_this2.playerError) {
return;
}

_this2.playerError = true;
_this2.statusBar.style.display = 'flex'; // TODO: howler will start playing on any user interaction on a page, because it attempts to unblock itself.
// If a more defined user interaction is required, uncomment the following line
//this.audioView.publishEvent('audio:play:blocked');

sound.howl.once('unlock', function () {
_this2.statusBar.style.display = 'none';
_howler.Howler.autoUnlock = true; // Prevent playing autoplay audio if a user triggers an interaction

if (!_this2.playTriggeredAudio) {
_this2.play(sound.index);
}

_this2.playerError = false;
});
},
onend: function onend() {
/**
* for audio with autoplay and if the audio block is set to autoplay, we should play the next sound.
* However audios triggered by events will not play next audio.
*/
var canPlay = false;
var nextSound = '';

if (sound.playOrder !== false) {
var orderedPlay = [];
orderedPlay = _this2.autoplayableAudio;

var _orderedPlay$slice = orderedPlay.slice(-1),
_orderedPlay$slice2 = (0, _slicedToArray2.default)(_orderedPlay$slice, 1),
lastSound = _orderedPlay$slice2[0];

if (lastSound.index !== sound.index) {
nextSound = orderedPlay[sound.playOrder + 1];
canPlay = nextSound && nextSound.playOrder !== false && nextSound.autoplay;
}
}

if (canPlay) {
_this2.skipTo(nextSound.index);
} else {
_this2.playBtn.style.display = 'block';
_this2.pauseBtn.style.display = 'none';
_this2.playStateBtn.textContent = _localeService.default.t('audio.stopStatus');

_chaplin.default.mediator.publish('audio:stopped');
}
},
onpaused: function onpaused() {},
onseek: function onseek() {}
}, events));
}
});
}
/**
* Set up available player controls and attach events on them
* This should be fired when the block has rendered so that we have the controls available for manipulation in the DOM.
*/

}, {
key: "setupControls",
value: function setupControls() {
var _this3 = this;

this.audioElement = this.audioView.el.querySelector(".audio__player");
this.audioView.model.set('audioElement', this.audioElement);
this.playBtn = this.audioElement.querySelector(".audio__btn--play");
this.pauseBtn = this.audioElement.querySelector(".audio__btn--pause");
this.nextBtn = this.audioElement.querySelector(".audio__btn--next");
this.prevBtn = this.audioElement.querySelector(".audio__btn--prev");
this.timeElement = this.audioElement.querySelector(".audio__playback-time");
this.durationElement = this.audioElement.querySelector(".audio__duration");
this.progressElem = this.audioElement.querySelector(".audio__progress");
this.progressPlayElem = this.audioElement.querySelector(".audio__progress--play");
this.volumeBar = this.audioElement.querySelector('.audio__btn--volume'); // iOS and Android don't support JS-driven volume changes

if (_userAgentService.default.isIOS() || _userAgentService.default.isMobile()) {
this.volumeBar.style.display = 'none';
}

this.mutedBtn = this.audioElement.querySelector('.audio__btn--muted');
this.unmutedBtn = this.audioElement.querySelector('.audio__btn--unmuted'); // TODO: Unhide playlist button once we have a go ahead

this.playlistBtn = this.audioElement.querySelector(".audio__btn--playlist");
this.collapseBtn = this.audioElement.querySelector(".audio__btn--collapse");
this.uncollapseBtn = this.audioElement.querySelector(".audio__btn--uncollapse");
this.collpseText = this.audioElement.querySelector(".audio__collapse-text");
this.collpseControl = this.audioElement.querySelector(".audio__collapse-controls");
this.expandBtn = this.audioElement.querySelector(".audio__btn--expand");
this.playerResize = this.audioElement.querySelector(".audio__player--resize");
this.seekForwardBtn = this.audioElement.querySelector(".audio__btn--seek-forward");
this.seekBackwardBtn = this.audioElement.querySelector(".audio__btn--seek-backward");
this.playStateBtn = this.audioElement.querySelector(".audio__state");
this.statusBar = this.audioElement.querySelector(".audio__status-bar");
this.statusBar.style.display = 'none';
this.createPlaylist();
var btnSelectors = this.getIconSelectors();
this.registerIcons(btnSelectors);

var mobileScreens = _userAgentService.default.matchMobileScreens();

mobileScreens === null || mobileScreens === void 0 ? void 0 : mobileScreens.addEventListener('change', this.mediaQueryChange);
this.playBtn.addEventListener('click', function () {
_this3.play();
});
this.pauseBtn.addEventListener('click', function () {
_this3.pause();
});
this.nextBtn.addEventListener('click', function () {
_this3.skip('next');
});
this.prevBtn.addEventListener('click', function () {
_this3.skip('prev');
});
this.volumeBar.addEventListener('click', function (event) {
var val = event.currentTarget.value;

if (val) {
_this3.lastVolumeLevel = val;

_this3.volume(val);
}
});
this.mutedBtn.addEventListener('click', function () {
_this3.mute(false);
});
this.unmutedBtn.addEventListener('click', function () {
_this3.mute(true);
});
this.collpseControl.addEventListener('click', function () {
_this3.audioElement.classList.toggle('collapsed');

_this3.collpseText.textContent = _localeService.default.t(_this3.audioElement.classList.contains('collapsed') ? 'Audio' : 'Hide');
});
this.playerResize.addEventListener('click', function () {
_this3.audioElement.classList.toggle('expanded');

_this3.mediaQueryChange(mobileScreens);
});
this.seekForwardBtn.addEventListener('click', function () {
_this3.seek('forward');
});
this.seekBackwardBtn.addEventListener('click', function () {
_this3.seek('backward');
});
this.playBtn.style.display = 'block';
this.pauseBtn.style.display = 'none'; // playlist with not more than one audio file do not need next or prev controls

if (this.playlist.length === 1) {
this.nextBtn.style.display = 'none';
this.prevBtn.style.display = 'none';
} //by default the player should be uncollapsed


this.collpseText.textContent = _localeService.default.t('audio.hideStatus');
this.playStateBtn.textContent = _localeService.default.t('audio.stopStatus');
this.playerOffset = this.audioElement;
}
/**
* Stop, unload and destroy howler object
*/

}, {
key: "dispose",
value: function dispose() {
this.playlist.forEach(function (sound) {
if (sound.howl) {
sound.howl.stop(); // Stop playback
}
});
this.playlist = [];
}
/**
* Updates audio timer display based on audio playback progression.
* TODO: Switch to requestAnimationFrame https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame, it is much smoother.
* @param {Object} audio Audio howl object
*/

}, {
key: "audioTimer",
value: function audioTimer(audio) {
var _this4 = this;

var timer = setInterval(function () {
var seek = (audio === null || audio === void 0 ? void 0 : audio.seek()) || 0;
var duration = (audio === null || audio === void 0 ? void 0 : audio.duration()) || 0;
var progress = seek / duration * 100;
var percentageProgress = isNaN(progress) ? 0 : progress;
_this4.timeElement.textContent = _this4.formatTime(Math.round(seek));

_this4.progressElem.setAttribute('aria-valuenow', Math.ceil(percentageProgress));

_this4.progressPlayElem.style.width = "".concat(percentageProgress, "%");

if (!audio.playing()) {
clearInterval(timer);
}
}, 75);
}
/**
* Creates a playlist UI and attached play events based on audio files in this.playlist
*/

}, {
key: "createPlaylist",
value: function createPlaylist() {
var _this5 = this;

var listContainer = this.audioElement.querySelector(".audio__playlist");
this.playlist.forEach(function (audio, index) {
var listItem = document.createElement('li');
listItem.classList.add('audio__track');
listItem.textContent = audio.id;
listItem.addEventListener('click', function () {
_this5.skipTo(index);

listContainer.classList.remove('active');
});
listContainer.appendChild(listItem);
});
this.playlistBtn.addEventListener('click', function () {
listContainer.classList.toggle('active');
});
}
/**
* Register player control button regions
* @param {Object} buttons Array of button icon regions
*/

}, {
key: "registerIcons",
value: function registerIcons(buttons) {
var _this6 = this;

buttons.forEach(function (button) {
var region = button.selector.substring(1);

_this6.audioView.registerRegion(region, button.selector);

var atom = _this6.getIconAtom(region, _this6.getIconModel(button.icon));

_this6.audioView.subview(region, atom);
});
}
/**
* Gets a new icon model.
* The default prefix is `fas`
* @param {String} iconName Icon name
*/

}, {
key: "getIconModel",
value: function getIconModel(iconName) {
return new _chaplin.default.Model({
prefix: 'fas',
icon: "fas ".concat(iconName),
classes: 'fa-fw'
});
}
/**
* Generates an icon
* @param {String} region Region class to display the icon
* @param {*} iconModel
*/

}, {
key: "getIconAtom",
value: function getIconAtom(region, iconModel) {
return new _iconAtomView.default({
region: region,
model: iconModel
});
}
/**
* Gets a static Array of icons required for the audio player controls
* TODO: have a dynamic list based on the audio control hbs
*/

}, {
key: "getIconSelectors",
value: function getIconSelectors() {
return [{
selector: ".audio__btn--play",
icon: 'fa-play'
}, {
selector: ".audio__btn--pause",
icon: 'fa-pause'
}, {
selector: ".audio__btn--next",
icon: 'fa-step-forward'
}, {
selector: ".audio__btn--prev",
icon: 'fa-step-backward'
}, {
selector: ".audio__btn--playlist",
icon: 'fa-list'
}, {
selector: '.audio__btn--muted',
icon: 'fa-volume-mute'
}, {
selector: '.audio__btn--unmuted',
icon: 'fa-volume-up'
}, {
selector: '.audio__btn--uncollapse',
icon: 'fa-chevron-circle-left'
}, {
selector: '.audio__btn--collapse',
icon: 'fa-chevron-circle-right'
}, {
selector: '.audio__btn--expand',
icon: 'fa-expand-alt'
}, {
selector: '.audio__btn--compress',
icon: 'fa-compress-alt'
}, {
selector: '.audio__btn--seek-forward',
icon: 'fa-redo'
}, {
selector: '.audio__btn--seek-backward',
icon: 'fa-undo'
}];
}
/**
* Gets the muted state from enrollment data.
* This is just a normalizer.
*/

}, {
key: "getEnrollmentDataMute",
value: function getEnrollmentDataMute() {
return this.audioView.model.get('muted');
}
/**
* Set the player top offset based the platform header
*/

}, {
key: "playerOffset",
set: function set(player) {
var platformHeight = _utils.default.getPlatformHeaderHeight();

var computedStyles = window.getComputedStyle(player);
var playerOffset = computedStyles.getPropertyValue('top');

var topOffset = _utils.default.pixelMath(platformHeight, '+', playerOffset);

player.style.top = topOffset;
}
}, {
key: "mediaQueryChange",
value: function mediaQueryChange(e) {
var container = (0, _jquery.default)('#page-container');
var audioWrapper = (0, _jquery.default)('.audioWrapper');

if (e.matches && audioWrapper.hasClass('playerActive')) {
var audioPlayerHeight = (0, _jquery.default)('.audio__player').outerHeight(true) + 10; // add 10 more pixels to give the player some space

container.css({
'padding-bottom': audioPlayerHeight
});
} else {
container.css({
'padding-bottom': 'initial'
});
}
}
}, {
key: "showPlayer",
value: function showPlayer() {
if (!this.audioView.hasControls) {
return;
}

var wrapper = this.audioView.$el.find('.audioWrapper');

if (!wrapper.hasClass('playerActive')) {
wrapper.addClass('playerActive');

var mobileScreens = _userAgentService.default.matchMobileScreens();

this.mediaQueryChange(mobileScreens);
}
}
}, {
key: "hidePlayer",
value: function hidePlayer() {
if (!this.audioView.hasControls) {
return;
}

var wrapper = this.audioView.$el.find('.audioWrapper');
wrapper.toggleClass('playerActive');
}
}, {
key: "autoplayableAudio",
get: function get() {
return this.playlist.filter(function (audio) {
return audio.playOrder !== false;
}).sort(function (a, b) {
return a.playOrder - b.playOrder;
});
}
}, {
key: "blockAutoplay",
get: function get() {
var _this$audioView, _this$audioView$model;

return !!((_this$audioView = this.audioView) !== null && _this$audioView !== void 0 && (_this$audioView$model = _this$audioView.model) !== null && _this$audioView$model !== void 0 && _this$audioView$model.get('autoplay'));
}
}]);
return AudioServiceHowler;
}(_audioServiceBase.default);

exports.default = AudioServiceHowler;
});

;require.register("services/course-handler-services/block-order-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _chaplin = _interopRequireDefault(require("chaplin"));

function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

var BlockOrderService = function BlockOrderService() {
var _this = this;

this.orderMap = {
blocks: [],
order: 'default'
};

this.reset = function () {
_this.orderMap = {
blocks: [],
order: 'default'
};
};

this.generateOrderMap = function (bv) {
var blocks = [];

_this.getNestedModelOrderData(bv, blocks);

var orderMap = {
blocks: blocks,
order: _this.setCurrentOrder(blocks)
};

if (orderMap.order === 'end') {
orderMap.order = 'default';
}

_this.orderMap = orderMap;
};

this.getNestedModelOrderData = function (bv, output) {
if (bv.subviews.length > 0) {
bv.subviews.forEach(function (s) {
return _this.getNestedModelOrderData(s, output);
});
}

if (bv.model && output.findIndex(function (o) {
return o.cid === bv.model.get('cid');
}) === -1) {
output.push({
cid: bv.model.get('cid'),
order: bv.model.get('order') || 'default',
state: bv.model.get('state')
});
}
};

this.setCurrentOrder = function (blocks) {
var sorted = blocks.filter(function (b) {
return b.state !== 'completed' && b.order !== 'default';
}).sort(function (a, b) {
var aOrder = a.order === 'end' ? Number.MAX_VALUE : a.order;
var bOrder = b.order === 'end' ? Number.MAX_VALUE : b.order;
return aOrder - bOrder;
});
return sorted.length === 0 ? 'complete' : sorted[0].order;
};

this.getCurrentOrder = function () {
return _this.orderMap.order;
};

this.checkOrderMapComplete = function () {
var blocks = _this.orderMap.blocks;
var filtered = blocks.filter(function (b) {
return b.order !== 'end' && b.state && b.state !== 'completed';
});
return filtered.length === 0;
};

this.hasOrderedBlocks = function () {
var blocks = _this.orderMap.blocks;

for (var i = 0; i < blocks.length; i++) {
if (blocks[i].order !== 'default') {
return true;
}
}

return false;
};

this.updateOrderMap = function (block, pageView) {
var orderMap = _this.orderMap;
var blockIndex = orderMap.blocks.findIndex(function (b) {
return b.cid === block.model.get('cid');
});

if (blockIndex < 0) {
return;
}

orderMap.blocks[blockIndex].state = block.model.get('state');
var prevOrder = orderMap.order;

var newOrder = _this.setCurrentOrder(orderMap.blocks);

if (prevOrder !== newOrder) {
var checkEndComplete = newOrder === 'end' && _this.checkOrderMapComplete();

if (checkEndComplete || newOrder !== 'end') {
orderMap.order = newOrder;

if (prevOrder !== 'default') {
_chaplin.default.mediator.publish('block:order:completed', prevOrder);

_chaplin.default.mediator.publish("block:order-".concat(prevOrder, ":completed"));
}

if (newOrder !== 'complete') {
pageView.trigger('page:state:change', pageView);
}
}
}
};

this.addDefaultBlockOrder = function (blocks) {
var _iterator = _createForOfIteratorHelper(blocks),
_step;

try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var block = _step.value;

if (!block.type) {
continue;
}

block.order = 'default'; // Add default order for nested blocks

Object.entries(block).forEach(function (_ref) {
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
key = _ref2[0],
value = _ref2[1];

if (Array.isArray(value)) {
key = _this.addDefaultBlockOrder(value);
}
});
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}

return blocks;
};
};

var _default = new BlockOrderService();

exports.default = _default;
});

require.register("services/course-handler-services/course-settings-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _loadService = _interopRequireDefault(require("services/loader-handler-services/load-service"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _lodash = _interopRequireDefault(require("lodash"));

var _enrollmentDataService = _interopRequireDefault(require("services/data-handler-services/enrollment-data-service"));

var courseSettings;

var CourseSettingsService = function CourseSettingsService() {
var _this = this;

if (CourseSettingsService.prototype._singleton) {
return CourseSettingsService.prototype._singleton;
}

CourseSettingsService.prototype._singleton = this;
this.files = {
courseSettings: './content/course-settings.json'
};

this.initialize = function (settings) {
return _loadService.default.load(this.files).then(function (data) {
var course = data.courseSettings;

if (settings.env && course[settings.env]) {
course = _lodash.default.extend(course, course[settings.env]);
}

course = _lodash.default.extend(course, settings);

if (settings.available_languages) {
var availableFallbackLanguages = course.supported_languages.filter(function (lang) {
return lang.length === 2;
});
course.supported_languages = _lodash.default.uniq(settings.available_languages.reduce(function (langs, lang) {
if (course.supported_languages.includes(lang)) {
langs.push(lang);
} else if (availableFallbackLanguages.includes(lang.substring(0, 2))) {
langs.push(lang.substring(0, 2));
}

return langs;
}, []));
course.supported_languages.sort();
}

courseSettings = new _chaplin.default.Model(course);
}).catch(function (err) {
return console.info(err);
});
};

this.get = function (key) {
return courseSettings && courseSettings.get(key);
};

this.getModel = function () {
return courseSettings;
};

this.setDefaultConfigs = function () {
var settings = {
audio: {
'audio-mute': this.getDefaultConfigs('settings.audio.audio-mute', 'audio-mute-default'),
autoplay: this.getDefaultConfigs('settings.audio.autoplay', 'audio-autoPlay-default')
},
video: {
'video-mute': this.getDefaultConfigs('settings.video.video-mute', 'video-mute-default'),
captions: this.getDefaultConfigs('settings.video.captions', 'video-captions-default')
}
};

_enrollmentDataService.default.saveData('settings', settings);
};

this.getDefaultConfigs = function (setting, fallback) {
var _ref, _EnrollmentDataServic;

return (_ref = (_EnrollmentDataServic = _enrollmentDataService.default.getByDotString(setting)) !== null && _EnrollmentDataServic !== void 0 ? _EnrollmentDataServic : _this.get('defaultConfigs')[fallback]) !== null && _ref !== void 0 ? _ref : false;
};
};

var _default = new CourseSettingsService();

exports.default = _default;
});

require.register("services/course-handler-services/custom-page-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));

var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var _localeService = _interopRequireDefault(require("services/loader-handler-services/locale-service"));

var _jsYaml = _interopRequireDefault(require("js-yaml"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _lodash = _interopRequireDefault(require("lodash"));

var _utils = _interopRequireDefault(require("lib/utils"));

/*
* CustomPageService provides a mechanism for injecting or replacing pages via a customization.
*
* The customization response can replace pages by providing a response like this:
* {
* "type": "page-content-customization",
* "customizations_map": {
* "some-module": {
* "some-activity": {
* "some-page": "https://everfi.github.io/course-customizations/customizations/Skeletor/example-page"
* }
* }
* }
* }
*
* The customization response can inject pages before or after a certain page key like this:
* {
* "type": "page-content-customization",
* "customizations_map": {
* "some-module": {
* "some-activity": {
* "injected-before": {
* "url": "https://everfi.github.io/course-customizations/customizations/Skeletor/example-page",
* "before": "some-page-key"
* },
* "injected-after": {
* "url": "https://everfi.github.io/course-customizations/customizations/Skeletor/example-page",
* "after": "some-page-key"
* }
* }
* }
* }
* }
*
* The customization response can pull in a set of blocks to a page like this:
* {
* "type": "page-content-customization",
* "customizations_map": {
* "some-module": {
* "some-activity": {
* "some-page": {
* "some-slug": "https://everfi.github.io/course-customizations/customizations/Skeletor/example-page"
* }
* }
* }
* }
* }
*
* Then `some-page` and only `some-page` can use the custom-page block like this
* - type: custom-page
* slug: some-slug
* Note that the page could use other blocks in conjunction with this block, including another custom-page block
*
* The customization response can also skip pages with a null in the customizations_map
* {
* "type": "page-content-customization",
* "customizations_map": {
* "some-module": {
* "some-activity": {
* "some-skipped-page": null
* }
* }
* }
* }
*
* The URL in those examples is the base url for a file called metadata.json which describes the other files to fetch
* {
* "locales": [ "en", "es" ],
* "format": "yaml"
* }
* Will fetch content.yml, locales/en.json, and locales/es.json
*
*
* Note About Loading page-n.js Files
* ==================================
*
* Custom pages currently do not include the page-n.js script file. To include these, they can be pushed into
* the pageQueue like all of the other resources for each page. Then call `response.text()` and eval it
* with the common js wrapper inline. It'll look something like this for the current namespace:
* ```
* fetch(`url-to-script-file`).then(r => r.text()).then(scriptBody => {
* eval(`
* window.require.register('modules/${EF.module.currentActivity.currentPage.get('moduleKey')}/${EF.module.currentActivity.currentPage.get('activityKey')}/${EF.module.currentActivity.currentPage.get('key')}/${EF.module.currentActivity.currentPage.get('key')}', function(exports, require, module) {
* ${scriptBody}
* });
* `);
* });
* ```
* eval is very dangerous, if this is implemented, make sure the script comes from a trusted source
* the risk for XSS is very high here since this more or less intentionally injects a raw
* script file on the fly. Double, triple check the security of such a feature before moving forward with it
*/
var CustomPageService = /*#__PURE__*/function () {
function CustomPageService() {
(0, _classCallCheck2.default)(this, CustomPageService);
}

(0, _createClass2.default)(CustomPageService, null, [{
key: "loadPage",
value:
/*
* Loads a single page on the fly after everything is initialized.
* The localizations are added to the current LocaleService namespace.
* Used by app/views/block/custom-page/custom-page-view.js
*
* @returns {Promise} Promise object where the result has the blocks for the page and the locales
* @example
* CustomPageService.loadPage('some-slug').then(({blocks, locales}) => {
* // blocks is an array of renderable blocks
* // locales is an object like this:
* // { en: { someKey: 'some translation', es: { someKey: 'Spanish translation' } }}
* });
*/
function loadPage(slug, module, activity, page) {
if (!CustomPageService.hasPageCustomization(slug, module, activity, page)) {
return CustomPageService.emptyValue();
}

var url = CustomPageService.customizationUrl(slug, module, activity, page);
return fetch("".concat(url, "/metadata.json")).then(function (r) {
return r.json();
}).then(function (metadata) {
var queue = [];

if (['yaml', 'yml', 'json'].includes(metadata.format)) {
metadata.format = metadata.format === 'yaml' ? 'yml' : metadata.format;
queue.push(fetch("".concat(url, "/content.").concat(metadata.format)).then(function (r) {
return r.text().then(function (data) {
return Promise.resolve(metadata.format === 'json' ? JSON.parse(data) : _jsYaml.default.load(data));
});
}));
}

if (metadata.locales && Array.isArray(metadata.locales)) {
queue.push.apply(queue, (0, _toConsumableArray2.default)(metadata.locales.map(function (locale) {
return CustomPageService.getLocale(locale, url);
})));
}

return Promise.all(queue).then(function (_ref) {
var _ref2 = (0, _toArray2.default)(_ref),
page = _ref2[0],
locales = _ref2.slice(1);

return {
blocks: page.blocks,
locales: locales.reduce(function (result, locale) {
Object.assign(result, locale);
return result;
}, {})
};
});
});
}
}, {
key: "hasPageCustomization",
value: function hasPageCustomization(slug, module, activity, page) {
if (!slug) {
return false;
}

return CustomPageService.customizationUrl(slug, module, activity, page) !== null;
}
}, {
key: "customizationUrl",
value: function customizationUrl(slug, module, activity, page) {
var customization = _ef.default.customizations.findByType('page-content-customization');

if (customization && customization.has('customizations_map')) {
var map = customization.get('customizations_map');
var url = [module, activity, page, slug].reduce(function (result, key) {
return result !== null && Object.prototype.hasOwnProperty.call(result, key) ? result[key] : null;
}, map);
return url !== null ? url.replace(/{{courseUrl}}/, _courseSettingsService.default.get('courseUrl')) : null;
}

return null;
}
}, {
key: "modulePaths",
value: function modulePaths() {
return {
module: _ef.default.module.get('key'),
activity: _ef.default.module.currentActivity.get('key'),
page: _ef.default.module.currentActivity.currentPage.get('key')
};
}
}, {
key: "emptyValue",
value: function emptyValue() {
console.warn('CustomPageService: could not resolve a customization. Check that the slug is correct and the customization exists'); //eslint-disable-line no-console

return new Promise(function (resolve) {
return resolve({
blocks: [],
locales: []
});
});
}
/*
* This is responsible for injecting the page metadata into the module structure object before initialization
*
* @param {Array} modules - Raw serialized json from before initialization. This will be mutated in place.
* @param {Object} info - Contains before and after page keys to figure out where to inject the page
*/

}, {
key: "injectPageMetaData",
value: function injectPageMetaData(modules, info, moduleKey, activityKey, pageKey, pageTitle) {
var module = modules.find(function (m) {
return m.key === moduleKey;
});

if (module) {
var activity = module.activities.find(function (a) {
return a.key === activityKey;
});

if (activity && activity.pages && Array.isArray(activity.pages)) {
// sort pages by the index property
activity.pages.sort(CustomPageService.compareByIndex);
var injectedPage = {
title: pageTitle,
key: pageKey,
script: false,
custom: true // one way of marking injected pages

}; // inject the page before or after the page key

var beforeIndex = activity.pages.findIndex(function (page) {
return page.key === info.before;
});
var afterIndex = activity.pages.findIndex(function (page) {
return page.key === info.after;
});

if (beforeIndex >= 0) {
activity.pages.splice(beforeIndex, 0, injectedPage);
} else if (afterIndex >= 0) {
injectedPage.index = afterIndex + 1;
activity.pages.splice(afterIndex + 1, 0, injectedPage);
} // since it was sorted by index and then the pages were injected, this normalizes all of the
// page indices and makes them sequential


activity.pages.forEach(function (page, index) {
page.index = index;
});
}
}
}
}, {
key: "orderPagesByIndexReducer",
value: function orderPagesByIndexReducer(result, module) {
if (Array.isArray(module.activities)) {
// sort all of the activities and pages by the index property, so that later the
// next page index can be determined even if the index is misordered
module.activities.sort(CustomPageService.compareByIndex);
module.activities.forEach(function (activity) {
if (Array.isArray(activity.pages)) {
activity.pages = CustomPageService.markLastPageOfModuleActivity(activity.pages);
result = result.concat(activity.pages);
}
});
}

return result;
}
}, {
key: "compareByIndex",
value: function compareByIndex(obj1, obj2) {
return obj1.index < obj2.index ? -1 : 1;
}
/*
* This is responsible for loading n pages and normalizing the data so that it can be merged into
* the raw JSON before initialization
*
* @param {Array} customizations_map - Array of all of the customizations with their urls
* @param {Object} modules - The module structure object from before course initialization.
* This will be mutated in place to add the injected and replaced pages
*/

}, {
key: "loadPages",
value: function loadPages(customizations_map, modules) {
// The main queue for each page, each promise will resolve when the page is fully loaded
var queue = [];
Object.entries(customizations_map).forEach(function (_ref3) {
var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
moduleKey = _ref4[0],
activities = _ref4[1];

Object.entries(activities).forEach(function (_ref5, activityIndex) {
var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
activityKey = _ref6[0],
pages = _ref6[1];

var isLastActivity = Object.entries(activities).length - 1 === activityIndex;
Object.entries(pages).forEach(function (_ref7, pageIndex) {
var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
pageKey = _ref8[0],
info = _ref8[1];

if (info === null || info === undefined || info === '') {
// null, undefined, or empty string means the page is to be skipped, it will be removed before init
queue.push(Promise.all([new Promise(function (resolve) {
return resolve(function (modulesRef, moduleContentRef) {
// modulesRef and moduleContentRef are the references to the final module and module content objects
// they are here so that they can be mutated in place, in this case we found a null replacement
// which needs to be removed
var moduleRef = modules.find(function (m) {
return m.key === moduleKey;
});

if (moduleRef && Array.isArray(moduleRef.activities)) {
var activityRef = moduleRef.activities.find(function (a) {
return a.key === activityKey;
});

if (activityRef && activityRef.pages) {
activityRef.pages.sort(CustomPageService.compareByIndex);
var activityRefPageIndex = activityRef.pages.findIndex(function (p) {
return p.key === pageKey;
});
activityRef.pages = activityRef.pages.filter(function (elem, i) {
return i !== activityRefPageIndex;
});
moduleContentRef[moduleKey][activityKey] = Object.keys(moduleContentRef[moduleKey][activityKey]).reduce(function (object, key) {
if (key !== pageKey) {
object[key] = moduleContentRef[moduleKey][activityKey][key];
}

return object;
}, {});
}
} // set skippedLastPage on the moduleRef


var isLastPage = Object.entries(pages).length - 1 === pageIndex;

if (isLastPage && isLastActivity) {
var foundModule = modulesRef.find(function (module) {
return module.key === moduleKey;
});
foundModule.skippedLastPage = {
module_key: moduleKey,
activity_key: activityKey,
key: pageKey,
page_key: pageKey,
index: pageIndex
};
}
});
})]));
} else if (Object.keys(info).includes('url')) {
var url = typeof info === 'string' ? info : info.url;
queue.push(fetch("".concat(url, "/metadata.json")).then(function (response) {
return response.json();
}).then(function (metadata) {
// a sub queue for all of the files for each page, each promise will resolve when
// each part is loaded like content.yml and each of the locale files
var pageQueue = [];

if (['yaml', 'yml', 'json'].includes(metadata.format)) {
metadata.format = metadata.format === 'yaml' ? 'yml' : metadata.format;
pageQueue.push(fetch("".concat(url, "/content.").concat(metadata.format)).then(function (r) {
return r.text();
}).then(function (data) {
var content = metadata.format === 'json' ? JSON.parse(data) : _jsYaml.default.load(data);
var mergable = (0, _defineProperty2.default)({}, moduleKey, (0, _defineProperty2.default)({}, activityKey, (0, _defineProperty2.default)({}, pageKey, content)));

if (info.after || info.before) {
// this is adding a new page in the module
CustomPageService.injectPageMetaData(modules, info, moduleKey, activityKey, pageKey, metadata.title || '');
return Promise.resolve(mergable);
} else {
//this is a page replacement in the module
return new Promise(function (resolve) {
resolve(function (modules, moduleContentRef) {
CustomPageService.replacePage(moduleContentRef, mergable, moduleKey, activityKey, pageKey);
return mergable;
});
});
}
}));
}

if (metadata.locales && Array.isArray(metadata.locales)) {
pageQueue.push.apply(pageQueue, (0, _toConsumableArray2.default)(metadata.locales.map(function (locale) {
return CustomPageService.getLocale(locale, url);
})));
}

return Promise.all(pageQueue);
}));
}
});
});
});
return Promise.all(queue);
}
}, {
key: "getLocale",
value: function getLocale(locale, url) {
return fetch("".concat(url, "/locales/").concat(locale, ".json")).then(function (r) {
return r.json();
}).then(function (data) {
return Promise.resolve((0, _defineProperty2.default)({}, locale, data));
});
}
}, {
key: "replacePage",
value: function replacePage(moduleContentRef, mergable, moduleKey, activityKey, pageKey) {
if (moduleContentRef[moduleKey][activityKey][pageKey]) {
moduleContentRef[moduleKey][activityKey][pageKey] = mergable[moduleKey][activityKey][pageKey];
}
}
/*
* This is the entry point for injecting pages before initialization.
* Note: it mutates the parameters
*
* @param {Object} moduleContent - the raw serialized json for the module including all
* of the blocks for each page
* @param {Object} modules - the raw serialized json containing only the structure of
* the module without the blocks for each page
*/

}, {
key: "replaceCustomPages",
value: function replaceCustomPages(modules, moduleContent, groupsJSON) {
var customizations = _ef.default.customizations.findByType('page-content-customization');

if (customizations && customizations.has('customizations_map')) {
var customizations_map = customizations.get('customizations_map');
return CustomPageService.loadPages(customizations_map, modules).then(function (bundles) {
bundles.forEach(function (_ref9) {
var _ref10 = (0, _toArray2.default)(_ref9),
mergable = _ref10[0],
locales = _ref10.slice(1);

// mergable is a full object with the module, activity, and page keys like this:
// {
// someModule: { someActivity: { somePage: { blocks: [ ... ] } } }
// }
// It may also be a function, which means a null replacement was found
if (typeof mergable === 'function') {
// found a callback which means the page has been removed or replaced, call it
// and let the callback mutate modules and moduleContent to remove the page or replace the blocks
// if it's a replacement, will also return the mergable page data so locales are added correctly below
mergable = mergable(modules, moduleContent);
} else if (mergable) {
_lodash.default.merge(moduleContent, mergable);
} // traverse down to each page and inject the locales with the right namespace


if (mergable && locales && Array.isArray(locales)) {
Object.entries(mergable).forEach(function (_ref11) {
var _ref12 = (0, _slicedToArray2.default)(_ref11, 2),
moduleKey = _ref12[0],
activities = _ref12[1];

Object.entries(activities).forEach(function (_ref13) {
var _ref14 = (0, _slicedToArray2.default)(_ref13, 2),
activityKey = _ref14[0],
pages = _ref14[1];

Object.entries(pages).forEach(function (_ref15) {
var _ref16 = (0, _slicedToArray2.default)(_ref15, 1),
pageKey = _ref16[0];

locales.forEach(function (locale) {
if (locale) {
Object.entries(locale).forEach(function (_ref17) {
var _ref18 = (0, _slicedToArray2.default)(_ref17, 2),
code = _ref18[0],
data = _ref18[1];

_localeService.default.addResource(code, "".concat(moduleKey, ".").concat(activityKey, ".").concat(pageKey), (0, _defineProperty2.default)({}, moduleKey, (0, _defineProperty2.default)({}, activityKey, (0, _defineProperty2.default)({}, pageKey, data))));
});
}
});
});
});
});
}
});
return Promise.resolve([modules, moduleContent, groupsJSON]);
});
} else {
return new Promise(function (resolve) {
return resolve([modules, moduleContent, groupsJSON]);
});
}
}
}, {
key: "markLastPageOfModuleActivity",
value: function markLastPageOfModuleActivity(pages) {
var orderedPages = CustomPageService.orderPagesByIndex(pages);

if (orderedPages.length > 0) {
_utils.default.getLastArrayElement(orderedPages).lastPageOfModule = true;
}

return orderedPages;
}
}, {
key: "orderPagesByIndex",
value: function orderPagesByIndex(pages) {
return pages.filter(function (p) {
return p !== undefined;
}).sort(function (currentPage, nextPage) {
return currentPage.index < nextPage.index ? -1 : 1;
});
}
}]);
return CustomPageService;
}();

exports.default = CustomPageService;
});

;require.register("services/course-handler-services/feedback-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _feedback = _interopRequireDefault(require("models/feedback"));

var _feedbackView = _interopRequireDefault(require("views/feedback/feedback-view"));

var _lodash = _interopRequireDefault(require("lodash"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _jquery = _interopRequireDefault(require("jquery"));

var FeedbackService = function FeedbackService() {
this.matchFeedback = function (feedbacks, value) {
if (!feedbacks) {
return null;
}

return _lodash.default.find(feedbacks, function (feedback) {
return _lodash.default.isEqual(feedback.match, value);
});
}; // when more than 2 or 3 params we should use an object {feedback, feedbackElement, feedbackState, possibleStates, callbacks}


this.renderFeedbackWithElementState = function (feedback, feedbackElement, feedbackState, possibleStates, callbacks) {
callbacks = callbacks || {};
this.triggerElement = feedbackElement;
feedbackElement.removeClass(possibleStates.join(' '));
feedbackElement.addClass(feedbackState);

if (!feedback) {
if (typeof callbacks.noFeedback === 'function') {
callbacks.noFeedback();
}

return;
}

feedback = new _feedback.default(_lodash.default.merge({}, feedback, {
feedbackState: feedbackState
}));

if (!feedback.get('blocks')) {
if (typeof callbacks.noFeedback === 'function') {
callbacks.noFeedback();
}

return;
}

feedbackElement.addClass("".concat(feedbackState, "-feedback-showing"));

if (callbacks.unloading) {
callbacks.origUnloading = callbacks.unloading;
}

callbacks.unloading = function () {
feedbackElement.removeClass("".concat(feedbackState, "-feedback-showing"));

if (typeof callbacks.origUnloading === 'function') {
callbacks.origUnloading();
}
};

this.renderFeedback(feedback, callbacks);
};

this.renderFeedback = function (feedback, callbacks) {
_chaplin.default.mediator.publish('block:feedback', feedback, callbacks);
};

this.removeFeedback = function (view, feedback) {
var subviewsByName = view.pageView.subviewsByName;
var feedbackRegion;

if (feedback.inline) {
feedbackRegion = 'inline-feedback';
view.pageView.removeSubview(subviewsByName[feedbackRegion]); // inline-feedback creates a wrapper class that needs to be removed too.

(0, _jquery.default)(".".concat(feedbackRegion)).remove();
} else {
feedbackRegion = feedback.region || 'feedback';
view.pageView.removeSubview(subviewsByName[feedbackRegion]);
}
};

this.displayFeedback = function (view, feedback, callbacks) {
var viewOptions = {
model: feedback,
pageView: view,
script: view.script ? view.script.feedback : undefined,
callbacks: callbacks,
containerMethod: feedback.get('replace') ? 'html' : 'append'
};
var inlineFB = 'inline-feedback';

if (feedback.get('region')) {
view.registerRegion(feedback.get('region'), ".".concat(feedback.get('region')));
viewOptions.region = feedback.get('region');
} else if (feedback.get('inline') && this.triggerElement) {
var inlineFeedback = view.subviewsByName[inlineFB];

if (inlineFeedback !== undefined) {
inlineFeedback.$el.parent().detach().appendTo(this.triggerElement);
} else {
(0, _jquery.default)("<div class=\"".concat(inlineFB, "\"></div>")).appendTo(this.triggerElement);
view.registerRegion(inlineFB, ".".concat(inlineFB));
}

viewOptions.region = inlineFB;
}

var feedbackView = new _feedbackView.default(viewOptions);
view.subview(feedbackView.region, feedbackView);
view.listenTo(feedbackView, 'feedback:close', function (subview) {
subview.container.attr('role', '');
view.removeSubview(subview);

if (callbacks && callbacks.afterRemoved) {
callbacks.afterRemoved();
}
});
view.listenTo(feedback, 'change:state', function (model, state) {
if (state === 'loaded') {
feedbackView.play();
}
});
};
};

var _default = new FeedbackService();

exports.default = _default;
});

require.register("services/course-handler-services/initialization-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _customPageService = _interopRequireDefault(require("services/course-handler-services/custom-page-service"));

var _localeService = _interopRequireDefault(require("services/loader-handler-services/locale-service"));

var _pageService = _interopRequireDefault(require("services/page-service"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _lodash = _interopRequireDefault(require("lodash"));

var _i18next = _interopRequireDefault(require("i18next"));

var _utils = _interopRequireDefault(require("lib/utils"));

var InitializationService = /*#__PURE__*/function () {
function InitializationService() {
(0, _classCallCheck2.default)(this, InitializationService);
}

(0, _createClass2.default)(InitializationService, null, [{
key: "applyTransformations",
value: function applyTransformations(modulesJSON, modulesContentJson, groupsJSON) {
// this deep merges a customization to replace locale strings
// The customization object is shaped like this
// {
// "type": "locale-content-customization",
// "en": {
// "library": {
// "atoms": {
// "accordion-atom": {
// "pageDescription": "BINGO BANGO"
// }
// }
// }
// }
// }
var localeCustomization = _ef.default.customizations.findByType('locale-content-customization');

if (localeCustomization && localeCustomization.has(_i18next.default.language)) {
var mergable = localeCustomization.get(_i18next.default.language);

if (mergable) {
_lodash.default.merge(_localeService.default.langContent, mergable);

if (_i18next.default.store && _i18next.default.store.data && _i18next.default.store.data[_i18next.default.language]) {
_lodash.default.merge(_i18next.default.store.data[_i18next.default.language], mergable);
}
}
}

var customLocaleCustomization = _ef.default.customizations.findByType('page-content-customization');

if (customLocaleCustomization && customLocaleCustomization.has('custom_locales_url')) {
var customLocalesUrl = customLocaleCustomization.get('custom_locales_url');

if (customLocalesUrl) {
fetch(customLocalesUrl).then(function (r) {
return r.json();
}).then(function (map) {
if (map !== null && (0, _typeof2.default)(map) === 'object') {
var currentLocale = _localeService.default.getLanguage();

Object.entries(map).forEach(function (_ref) {
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
locale = _ref2[0],
mergable = _ref2[1];

if (locale === currentLocale && mergable) {
_lodash.default.merge(_localeService.default.langContent, mergable);
}
});
}
});
}
}

return _customPageService.default.replaceCustomPages(modulesJSON, modulesContentJson, groupsJSON).then(function (_ref3) {
var _ref4 = (0, _slicedToArray2.default)(_ref3, 3),
modulesJSON = _ref4[0],
modulesContentJson = _ref4[1],
groupsJSON = _ref4[2];

// this removes any activities where
// a) all of the pages are setup to skip if a customization doesn't exist
// b) the customizations do not exist, so the entire activity would be skipped
// this also removes modules where all activities meet the above condition as well
modulesJSON.forEach(function (module) {
// We'll need to store the page that is skipped at the end of the last activity in a module
if (module.activities) {
var lastActivity = _utils.default.getLastArrayElement(module.activities);

module.activities.forEach(function (activity) {
var pages = activity.pages;

if (pages) {
try {
pages.slice().forEach(function (page, index) {
if (modulesContentJson[module.key][activity.key][page.key]) {
var skip = modulesContentJson[module.key][activity.key][page.key].skip;

if (skip) {
var customizationType = skip.customization,
slug = skip.slug;
var customization;

if (customizationType) {
customization = _ef.default.customizations.getByKeyAndSlug(customizationType, slug);
}

if (!customization) {
customization = _ef.default.customizations.find(function (c) {
if ((c.get('type') === 'page-content-customization' || c.get('type') === 'customization-page_content_customizations') && c.has('customizations_map')) {
var map = c.get('customizations_map'); // return true if the inner most object of `map` has a key that matches the slug

return function traverse(obj) {
return Object.entries(obj).reduce(function (result, _ref5) {
var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
key = _ref6[0],
value = _ref6[1];

if (result) {
return result;
}

if (value !== null && (0, _typeof2.default)(value) === 'object') {
return traverse(value);
}

return key === slug;
}, false);
}(map);
}
});
} // Remove from course map pages marked for skip in full scorm


var skip_fullSCORM = false;

if (_ef.default.config.get('fullSCORM')) {
skip_fullSCORM = skip.fullSCORM;
} // Remove from course map if learner profile setting don't match the student


var skip_learner = false;

if (skip.learner_profile) {
skip_learner = _pageService.default.shouldSkipLearner(skip);
} // This logic is a bit tricky, here are the conditions enumerated
// if skip.when === present - remove page if the customization is present
// - do not remove page if customization is absent
// if skip.when !== present - remove page if the customization is absent
// - do not remove page if the customization is present


var skip_customization = false;

if (customizationType && slug) {
skip_customization = skip.when !== 'present' && (customization === undefined || customization === null) || skip.when === 'present' && customization !== undefined && customization !== null;
}

var skipResource = false;

if (skip.resource_type) {
skipResource = _ef.default.resources.byTypeSync(skip.resource_type, skip.resource_sub_type).length === 0;
}

if (skipResource || skip_customization || skip_learner || skip_fullSCORM) {
/**
* when the final page of the module is skipped, it causes module completion issues on the platform.
* We’re generally going to prevent using skipped pages at the end of modules,
* but this would also cause problems with course mod if someone skipped the last page of a module.
*
* Thus we need to check if the skipped page is the last page of the module. If it is,
* save the page progress when the module completes.
*/
// Order pages by index. This is the index defined in the module.json, not an array index
// Note: before ordering moduleJSON pages by index, the index used to delete skipped pages was an array index;
activity.pages = _customPageService.default.orderPagesByIndex(activity.pages); // then check if the last page is the page being skipped.

var lastPage = _utils.default.getLastArrayElement(activity.pages);

if (page.index === lastPage.index && lastActivity.key === activity.key) {
// get the necessary data for the skipped page
var skippedPageData = {
module_key: module.key,
activity_key: activity.key,
key: page.key,
page_key: page.key,
index: page.index
}; // store the skipped page so that we use them later in module progress

module.skippedLastPage = skippedPageData;
}

var deletionIndex = activity.pages.findIndex(function (p) {
return p.key === page.key;
});

if (deletionIndex !== -1) {
// remove the page from both collections
activity.pages.splice(deletionIndex, 1);
delete modulesContentJson[module.key][activity.key][page.key];
}
}
}
}

return false;
});
} catch (e) {
console.warn('Initaliation service warning:', e); //eslint-disable-line no-console
}

if (activity.pages.length <= 0) {
module.activities = module.activities.filter(function (a) {
return a.key !== activity.key;
});
delete modulesContentJson[module.key][activity.key];
}
}
});

if (module.activities.length <= 0) {
modulesJSON = modulesJSON.filter(function (m) {
return m.key !== module.key;
});
delete modulesContentJson[module.key];
}
}
});
return Promise.resolve([modulesJSON, modulesContentJson, groupsJSON]);
});
}
}]);
return InitializationService;
}();

exports.default = InitializationService;
});

;require.register("services/course-handler-services/learner-profile-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _utils = _interopRequireDefault(require("lib/utils"));

var LearnerProfileService = /*#__PURE__*/function () {
function LearnerProfileService() {
(0, _classCallCheck2.default)(this, LearnerProfileService);
}

(0, _createClass2.default)(LearnerProfileService, null, [{
key: "initialize",
value: function initialize(profile) {
this.data = profile;
}
}, {
key: "get",
value: function get(key) {
if (this.data) {
return this.data[key];
}
}
}, {
key: "getByDotString",
value: function getByDotString(dotString) {
return _utils.default.getByDotString(dotString, LearnerProfileService.get.bind(this));
}
}]);
return LearnerProfileService;
}();

exports.default = LearnerProfileService;
});

;require.register("services/course-handler-services/menu-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var _webStorageService = require("services/data-handler-services/web-storage-service");

var _utils = _interopRequireDefault(require("lib/utils"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _lodash = _interopRequireDefault(require("lodash"));

var MenuService = {
autoPlay: function autoPlay() {
var menu = _courseSettingsService.default.get('menu');

var options = Object.assign({}, menu.autoplay);

if (_ef.default.enrollment.get('demoMode') && menu.auto_play_demo) {
Object.assign(options, menu.auto_play_demo);
}

var lastInProgress = _lodash.default.find(options.modules, function (moduleKey) {
var module = _ef.default.modules.getModuleByKey(moduleKey);

var plays = _webStorageService.MemoryStorageService.getItem("".concat(moduleKey, ":plays")) || 0;
return module && !module.get('locked') && module.get('completed') === false && (options.limit === undefined || plays < options.limit);
});

if (lastInProgress) {
var plays = (_webStorageService.MemoryStorageService.getItem("".concat(lastInProgress, ":plays")) || 0) + 1;

_webStorageService.MemoryStorageService.setItem("".concat(lastInProgress, ":plays"), plays);

_utils.default.redirectToModule(_ef.default.modules.getModuleByKey(lastInProgress));
}
},
getUnlockDay: function getUnlockDay() {
var startDateCustomization = _courseSettingsService.default.get('start_date');

if (startDateCustomization) {
return _utils.default.daysFromToday(startDateCustomization);
}
}
};
var _default = MenuService;
exports.default = _default;
});

require.register("services/course-handler-services/navigation-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _pageService = _interopRequireDefault(require("services/page-service"));

var _utils = _interopRequireDefault(require("lib/utils"));

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var _webStorageService = require("services/data-handler-services/web-storage-service");

var _backbone = _interopRequireDefault(require("backbone"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _ef = _interopRequireDefault(require("ef/ef"));

var NavigationService = {
initialize: function initialize() {
var _this = this;

_chaplin.default.mediator.subscribe('page:navigate', this.navigatePage, this);

_chaplin.default.mediator.subscribe('window:navigate', this.navigateWindow, this);

_chaplin.default.mediator.subscribe('twine:navigate', function (evt) {
_this.navigatePage(evt.destination);
}, this);
},
navigatePage: function navigatePage(destination) {
var _EF$module, _EF$module$currentAct;

//TODO: figure out another/better way of managing this information
// pageNavigation posts what the current page is and what
// the intended destination is to a globally accessible value
var currPage = (_EF$module = _ef.default.module) === null || _EF$module === void 0 ? void 0 : (_EF$module$currentAct = _EF$module.currentActivity) === null || _EF$module$currentAct === void 0 ? void 0 : _EF$module$currentAct.currentPage;

if (destination && currPage && currPage.get('navigation') && currPage.get('navigation')[destination]) {
var newDestination = currPage.get('navigation')[destination];

if (destination === 'back') {
if (newDestination === 'browser') {
this.navigateWindow(destination);
return;
} else {
destination = newDestination;
}
}
}

var page;

if (destination === 'skip') {
destination = this.direction || 'forward';
}

this.direction = null;

switch (destination) {
//TODO: not sure this logic is complete - need to discuss more scenarios
case 'back':
this.direction = 'back';
page = _pageService.default.getPreviousPage();

if (!page && _courseSettingsService.default.get('menu').allowModuleBack) {
// if first page in a module, let's go back to prev module
var currentModuleId = _ef.default.module.id;

var currentModuleIdx = _ef.default.modules.models.map(function (x) {
return x.id;
}).indexOf(currentModuleId);

if (currentModuleIdx === 0 && _courseSettingsService.default.get('menu').skip) {
// if it is a first page in first module and menu is disabled, let's exit the course
window.postMessage({
event_type: 'close-content'
}, '*');
return;
} else if (currentModuleIdx > 0) {
var prevModule = _ef.default.modules.models[currentModuleIdx - 1];
var prevModuleLastActivity = prevModule.activities.models.slice(-1)[0];
var prevModuleLastPage = prevModuleLastActivity.pages.models.slice(-1)[0];

_pageService.default.loadPage(prevModule.id, prevModuleLastActivity.id, prevModuleLastPage.id);

page = prevModuleLastPage;
}
}

break;

case 'forward':
if (!currPage.get('completed') && !currPage.get('optional') && !_courseSettingsService.default.get('preventPageSkipping') === false) {
_chaplin.default.mediator.publish('action:alert', 'skippingPrevented.messageType', 'skippingPrevented.title', 'skippingPrevented.message', '', true);

return false;
}

this.direction = 'forward';
page = _pageService.default.getNextPage();

if (!page && _courseSettingsService.default.get('menu').skip) {
// if last page in a module, let's go to the first page of the next module
var _currentModuleIdx = _ef.default.modules.indexOf(_ef.default.module);

var nextModule = _ef.default.modules.at(_currentModuleIdx + 1);

var currentModuleLastActivity = _ef.default.module.activities.at(_ef.default.module.activities.length - 1);

var currentModuleLastPage = currentModuleLastActivity.pages.at(currentModuleLastActivity.pages.length - 1);
var islastPage = currentModuleLastPage.id === _ef.default.module.currentActivity.currentPage.id;

if (nextModule && islastPage) {
var nextModuleFirstActivity = nextModule.activities.at(0);
var nextModuleFirstPage = nextModuleFirstActivity.pages.at(0);

_pageService.default.loadPage(nextModule.id, nextModuleFirstActivity.id, nextModuleFirstPage.id);

page = nextModuleFirstPage;
}
}

break;

case 'home':
page = null;
break;

default:
page = _pageService.default.getPageByKey(destination);
}

_ef.default.module.currentActivity.originPage = currPage.get('key');
_ef.default.module.currentActivity.destinationPage = page ? page.get('key') : null;

if (currPage && (currPage.get('transition') || _courseSettingsService.default.get('transitionAll'))) {
currPage.set('transition-out', destination === 'back' ? 'back' : 'forward'); //console.log(`navigating away from ${currPage.get('key')}; setting transition-out to ${currPage.get('transition-out')}`);
}

if (page && (page.get('transition') || _courseSettingsService.default.get('transitionAll'))) {
page.set('transition-in', destination === 'back' ? 'back' : 'forward'); //console.log(`navigating to ${page.get('key')}; setting transition-in to ${page.get('transition-in')}`);
}

var navigate = function navigate() {
if (page) {
_utils.default.redirectToPage(page);
} else {
if (_ef.default.module && _courseSettingsService.default.get('menu').type === 'group') {
var group = _ef.default.groups.find(function (group) {
return group.get('id') === _ef.default.module.get('group');
});

_utils.default.redirectTo('controllers/menu#show', {
type: group.get('key')
});
} else {
_utils.default.redirectTo('controllers/menu#show');
}
}
}; //console.log('publishing action:unload in navigation-service');


if (page && page.get('transition-in')) {
_chaplin.default.mediator.once('page:state:unloaded', navigate);

_chaplin.default.mediator.publish('action:unload');
} else {
navigate();
}
},
navigateWindow: function navigateWindow(destination) {
if (destination === 'back') {
window.history.back();
} else {
window.location.assign(destination);
}
},
reload: function reload(view) {
_backbone.default.history.stop(); // will be restarted by controllers/reload-controller


_webStorageService.LocalStorageService.setItem('originFragment', _backbone.default.history.fragment);

_chaplin.default.utils.redirectTo({
url: 'reload'
});
}
};
var _default = NavigationService;
exports.default = _default;
});

require.register("services/course-handler-services/page-timer-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _TimerPage = _interopRequireDefault(require("views/timer/decorators/TimerPage"));

var _TimerSession = _interopRequireDefault(require("views/timer/decorators/TimerSession"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _jquery = _interopRequireDefault(require("jquery"));

// import TimerPage from '../views/timer/decorators/TimerPage';
// import TimerSession from '../views/timer/decorators/TimerSession';

/**
* this will be refactored with new timer service.
*/
var PageTimerService = /*#__PURE__*/function () {
function PageTimerService() {
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'page';
var $domEl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
var countdown = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
(0, _classCallCheck2.default)(this, PageTimerService);

// if domEl is undefined, it will be a background timer like the legacy timer.
// countdown; if 0 it will countup.
if (type === 'page') {
this.timer = new _TimerPage.default(countdown, $domEl);
}

if (type === 'session') {
this.timer = new _TimerSession.default(countdown, $domEl);
}
}

(0, _createClass2.default)(PageTimerService, [{
key: "start",
value: function start() {
if (this.timer) {
this.timer.startTimer();
}
}
}, {
key: "clear",
value: function clear() {
this.timer.resetTimer();
}
}, {
key: "save",
value: function save(data) {
var _this = this;

_jquery.default.post("/sdk/enrollments/".concat(_ef.default.enrollment.id, "/events"), {
event: {
name: 'Page Completion Time',
data: Object.assign({
time: this.timer.currentTime
}, data)
}
}).always(function () {
_this.timer.resetTimer();
});
}
}]);
return PageTimerService;
}();

var _default = PageTimerService;
exports.default = _default;
});

require.register("services/course-handler-services/progress-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _ef = _interopRequireDefault(require("ef/ef"));

var _progress_tracker = _interopRequireDefault(require("ef/models/progress_tracker"));

var ProgressService = function ProgressService() {
if (ProgressService.prototype._singleton) {
return ProgressService.prototype._singleton;
}

ProgressService.prototype._singleton = this;
var progress = new _progress_tracker.default({
module_key: 'course'
}, {});

this.saveLocalActivityProgress = function (activityProgress, moduleKey) {
if (moduleKey) {
var mod = _ef.default.modules.find({
key: moduleKey
});

mod.progress.saveLocalActivityProgress(activityProgress);
} else {
progress.saveLocalActivityProgress(activityProgress);
}

return _ef.default.activityProgresses.fetch();
};

this.getLocalActivityProgresses = function () {
var progresses = _ef.default.modules.reduce(function (memo, mod) {
var prog = mod.progress.getLocalActivityProgress();

if (prog) {
memo = memo.concat(prog);
}

return memo;
}, []);

var courseProg = progress.getLocalActivityProgress();

if (courseProg) {
progresses = progresses.concat(progress.getLocalActivityProgress());
}

return progresses;
};

this.removeLocalActivityProgress = function (slug, moduleKey) {
if (moduleKey) {
var mod = _ef.default.modules.find({
key: moduleKey
});

mod.progress.removeLocalActivityProgress(slug);
} else {
progress.removeLocalActivityProgress(slug);
}

return _ef.default.activityProgresses.fetch();
};
};

var _default = new ProgressService();

exports.default = _default;
});

require.register("services/course-handler-services/score-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _enrollmentDataService = _interopRequireDefault(require("services/data-handler-services/enrollment-data-service"));

var _timeoutService = _interopRequireDefault(require("services/browser-handler-services/timeout-service"));

var _jquery = _interopRequireDefault(require("jquery"));

var _lodash = _interopRequireDefault(require("lodash"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var ScoreService = {
// Service for scoring game block games
// Scoring Algo: Base + (Base * Timing Bonus) * (Chain Multiplier)
defaultSettings: {
base_value: 1,
time_bonus_intervals: 5,
time_bonus_time_array: [],
time_bonus_time: 1000,
time_bonus_value: 1,
chain_multiplier_value: 1,
chain_multiplier_max: 10,
cancel_chain_with_time: false
},
scoringSettings: {},
scoreVars: {
currentScore: 0,
currentChainBonus: 0,
currentTimeBonus: 0
},
time_bonus_timeout: null,
// initialize the score service settings
init: function init(settings) {
this.resetFull();
this.scoringSettings = _lodash.default.defaults(settings, this.defaultSettings); // there is the possibility that time bonuses are not conferred with a static time

for (var i = 0; i < this.scoringSettings.time_bonus_intervals; i++) {
if (this.scoringSettings.time_bonus_time_array[i]) {
this.scoringSettings.time_bonus_time_array.push(this.scoringSettings.time_bonus_time_array[i]);
} else {
this.scoringSettings.time_bonus_time_array.push(this.scoringSettings.time_bonus_time);
}
}

this.publishScore('init');
},
// kick off a timer
start: function start() {
this.clearTimer();
this.resetTimeBonus();
this.time_bonus_timeout = new _timeoutService.default(this.scoringSettings.time_bonus_time_array[this.scoreVars.currentTimeBonus - 1], this.decrementTimeBonus.bind(this));
this.time_bonus_timeout.play();
this.publishScore();
},
// update the score service based on player answer info (correct/incorrect)
update: function update(params) {
if (params.correct) {
var points = this.calcPoints();
this.scoreVars.currentScore += points;
this.scoreVars.currentChainBonus = this.scoreVars.currentChainBonus + 1 > this.scoringSettings.chain_multiplier_max ? this.scoringSettings.chain_multiplier_max : this.scoreVars.currentChainBonus + 1;
} else {
this.resetChainBonus();
}

this.reportScore({
type: params.type,
level: params.level,
score: this.scoreVars.currentScore
});
this.setElementValues();
this.publishScore('update');
},
// pause the score service timer
pause: function pause() {
this.time_bonus_timeout.pause();
},
// play/resume the score service timer
play: function play() {
this.time_bonus_timeout.play();
},
// report score data to backend/local storage
// saving level score to key 'assessment_slug_level_#'
reportScore: function reportScore(params) {
var id = "".concat(params.type, "_level_").concat(params.level);

_enrollmentDataService.default.saveData(id, params.score);
},
// algorithim to determine points for correct answer
calcPoints: function calcPoints() {
var s = this.scoringSettings;
var v = this.scoreVars;
return s.base_value + s.time_bonus_value * v.currentTimeBonus * (s.chain_multiplier_value * v.currentChainBonus);
},
// decrement the time bonus
decrementTimeBonus: function decrementTimeBonus() {
// decrement the time bonus
this.scoreVars.currentTimeBonus--; // if the time bonus is over

if (this.scoreVars.currentTimeBonus === 0 && this.scoringSettings.cancel_chain_with_time) {
this.resetChainBonus();
} else {
this.time_bonus_timeout.set(this.scoringSettings.time_bonus_time_array[this.scoreVars.currentTimeBonus - 1], this.decrementTimeBonus.bind(this));
this.time_bonus_timeout.play();
}

this.setElementValues();
},
getScore: function getScore() {
return this.scoreVars;
},
publishScore: function publishScore(tag) {
_chaplin.default.mediator.publish("score:".concat(tag), this.scoreVars);
},
// full reset of score service variables and timer
resetFull: function resetFull() {
this.scoringSettings.time_bonus_time_array = [];
this.scoreVars.currentScore = 0;
this.resetTimeBonus();
this.resetChainBonus();
this.clearTimer();
this.publishScore('reset');
},
// reset just the time bonus
resetTimeBonus: function resetTimeBonus() {
this.scoreVars.currentTimeBonus = this.scoringSettings.time_bonus_intervals;
this.publishScore();
},
// reset just the chain bonus
resetChainBonus: function resetChainBonus() {
this.scoreVars.currentChainBonus = 0;
this.publishScore('chain:reset');
},
// clear out the timer
clearTimer: function clearTimer() {
if (this.time_bonus_timeout !== null) {
this.time_bonus_timeout.clear();
this.time_bonus_timeout = null;
}
},
// set element values (if they exist)
setElementValues: function setElementValues(lvl) {
(0, _jquery.default)('#score-container .current-level .data').html(lvl);
(0, _jquery.default)('#score-container .current-score .data').html(this.scoreVars.currentScore);
(0, _jquery.default)('#score-container .current-chain .data').html(this.scoreVars.currentChainBonus);
(0, _jquery.default)('#score-container .current-time .data').html(this.scoreVars.currentTimeBonus);
},
setSubscribe: function setSubscribe() {
var _this = this;

_chaplin.default.mediator.subscribe('score:get', function () {
_this.publishScore('get:return');
});
},
clearSubscribe: function clearSubscribe() {
_chaplin.default.mediator.unsubscribe('score:get');
}
};
var _default = ScoreService;
exports.default = _default;
});

require.register("services/course-handler-services/timer-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.timerService = exports.TimerService = void 0;

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var TimerService = /*#__PURE__*/(0, _createClass2.default)(function TimerService() {
var _this = this;

(0, _classCallCheck2.default)(this, TimerService);
var timers = [];

this.timers = function () {
return timers;
};

this.getTimerById = function (timerId) {
return timers.find(function (_ref) {
var id = _ref.id;
return timerId === id;
});
};

this.registerTimer = function (timer) {
timers = timers.concat(timer);
return _this;
};

this.registerTimers = function (timer) {
return _this.registerTimer(timer);
};

this.disposeTimerById = function (timerId) {
timers = timers.filter(function (_ref2) {
var id = _ref2.id;
return id !== timerId;
});
return _this;
};

this.disposeTimers = function () {
timers = [];
};
});
exports.TimerService = TimerService;
var timerService = new TimerService();
exports.timerService = timerService;
});

require.register("services/data-handler-services/ahoy-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _ef = _interopRequireDefault(require("ef/ef"));

var AhoyService = {
initialize: function initialize() {},
track: function track(name, properties) {
var defaults = {
metadata: {
user_content_id: _ef.default.enrollment.id,
type: name,
lang: _ef.default.language
}
};

if (_ef.default.module) {
defaults.metadata.module = _ef.default.module.attributes.key;

if (_ef.default.module.currentActivity) {
defaults.metadata.activity = _ef.default.module.currentActivity.attributes.key;

if (_ef.default.module.currentActivity.currentPage) {
defaults.metadata.page = _ef.default.module.currentActivity.currentPage.attributes.key;
}
}
} // const data = Object.assign({}, defaults, properties);
// TTD - need to actually hook this up to ahoy

}
};
var _default = AhoyService;
exports.default = _default;
});

require.register("services/data-handler-services/assessment-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _contentProvider = _interopRequireDefault(require("services/content-provider"));

var _assessment = _interopRequireDefault(require("ef/models/assessments/assessment"));

var AssessmentService = {
initialize: function initialize() {
var assessmentMap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
this.mapping = assessmentMap;
this.ContentProvider = _contentProvider.default;
},
getAssessment: function getAssessment(courseSlug) {
var slug;

try {
slug = _ef.default.options.local ? courseSlug : this.getAssessmentActivity(courseSlug).slug;
} catch (e) {
slug = courseSlug;
}

return new _assessment.default({
slug: slug
});
},
getUrl: function getUrl(courseSlug) {
var activity = this.getAssessmentActivity(courseSlug);
var redirectPath = "".concat(window.location.pathname, "#").concat(_ef.default.module.currentActivity.currentPage.path(), "?assessmentTaken=true");
var url = '/assessments/attempts/:assessment_slug?redirect_url=:redirect_url';
url = url.replace(':assessment_slug', activity.slug);
url = url.replace(':redirect_url', encodeURIComponent(redirectPath));
return url;
},
getBestScore: function () {
var _getBestScore = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(courseSlug) {
return _regenerator.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
if (!_ef.default.options.local) {
_context.next = 4;
break;
}

return _context.abrupt("return", this.ContentProvider.AssessmentService.getBestScore(courseSlug, this.mapping));

case 4:
_context.next = 6;
return this.ContentProvider.AssessmentService.getBestScore(courseSlug, this.mapping);

case 6:
return _context.abrupt("return", _context.sent);

case 7:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));

function getBestScore(_x) {
return _getBestScore.apply(this, arguments);
}

return getBestScore;
}(),
getAssessmentStatus: function getAssessmentStatus(courseSlug) {
return this.ContentProvider.AssessmentService.getAssessmentStatus(courseSlug, this.mapping);
},
getAssessmentActivity: function getAssessmentActivity(courseSlug) {
return this.ContentProvider.AssessmentService.getAssessmentActivity(courseSlug, this.mapping);
},
userHasCompletedAssessment: function userHasCompletedAssessment(courseSlug) {
return this.ContentProvider.AssessmentService.userHasCompletedAssessment(courseSlug, this.mapping);
},
getActivityProgressForSlug: function getActivityProgressForSlug(courseSlug) {
return this.ContentProvider.AssessmentService.getActivityProgressForSlug(courseSlug, null, this.mapping);
}
};
var _default = AssessmentService;
exports.default = _default;
});

require.register("services/data-handler-services/enrollment-data-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _utils = _interopRequireDefault(require("lib/utils"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _lodash = _interopRequireDefault(require("lodash"));

var EnrollmentDataService = {
saveData: function saveData(key, data) {
var _this = this;

var retries = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3;
var wait = 2000;
var options = {
success: function success() {
_chaplin.default.mediator.publish("enrollment-data-saved:".concat(key), data);

_chaplin.default.mediator.publish('enrollment-data-saved', data);
},
error: function error(model, response) {
_chaplin.default.mediator.publish("enrollment-data-failed:".concat(key), data); // for now all we really care about is conflicts


if (response.status !== 409 && retries <= 0) {
return;
}

setTimeout(function () {
// grab data since last save attempt, it might have changed.
var updatedData = _ef.default.enrollment.getData(key); //update retries left


retries--; // attempt another save

_this.saveData(key, updatedData, retries);
}, wait);
}
};

_ef.default.enrollment.setData(key, data, options);
},
saveDataByDotString: function saveDataByDotString(dotString, data) {
var parentKey = dotString.split('.')[0];
var relativeKey = dotString.split('.').slice(1).join('.');
var oldValue = this.getData(parentKey) || {};

var newValue = _lodash.default.set(oldValue, relativeKey, data);

this.saveData(parentKey, newValue);
},
getByDotString: function getByDotString(dotString) {
return _utils.default.getByDotString(dotString, this.getData);
},
getData: function getData(key) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var data;

if (_ef.default.enrollment && _ef.default.enrollment.attributes) {
data = _ef.default.enrollment.getData(key);
}

_chaplin.default.mediator.publish("enrollment-data-loaded:".concat(key), data);

if (data !== undefined && data !== null) {
return data;
} else if (options.defaultValue !== undefined) {
return options.defaultValue;
}
/* istanbul ignore next: deprecated */
else if (options.page) {
this.redirectForData(key, options);
}
},

/* istanbul ignore next: deprecated */
redirectForData: function redirectForData(key, options) {
options.redirectBack = options.redirectBack === undefined ? true : options.redirectBack;
var path = _ef.default.module ? _ef.default.module.currentActivity.currentPage.path() : window.location.hash.replace('#');

if (options.redirectBack) {
_chaplin.default.mediator.subscribeOnce("enrollment-data-saved:".concat(key), function () {
_utils.default.redirectTo({
url: path
});
});
}

_utils.default.redirectTo({
url: options.page
});
}
};
var _default = EnrollmentDataService;
exports.default = _default;
});

require.register("services/data-handler-services/evaluation-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _response_set = _interopRequireDefault(require("ef/models/evaluations/response_set"));

var _utils = _interopRequireDefault(require("lib/utils"));

var _handler = _interopRequireDefault(require("services/error-handler-service/handler"));

var _error = require("services/error-handler-service/error");

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

var EvaluationService = {
initialize: function initialize(evaluationMap) {
evaluationMap = evaluationMap || {};
this.mapping = evaluationMap;
},
getResponseSet: function getResponseSet(courseSlug) {
var fakeResponseSet = {
id: 'local',
token: 'not-real',
endpoint: 'http://nowhere.dev'
};

if (this.mapping && this.mapping[courseSlug]) {
return this.mapping[courseSlug];
} else {
return fakeResponseSet;
}
},
userHasPassedEvaluation: function () {
var _userHasPassedEvaluation = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(courseSlug) {
var responseSet;
return _regenerator.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return this.findEvaluationBySlug(courseSlug);

case 2:
responseSet = _context.sent;

if (!responseSet) {
_context.next = 5;
break;
}

return _context.abrupt("return", responseSet.get('grading_status') === 'passed');

case 5:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));

function userHasPassedEvaluation(_x) {
return _userHasPassedEvaluation.apply(this, arguments);
}

return userHasPassedEvaluation;
}(),
userHasCompletedEvaluation: function () {
var _userHasCompletedEvaluation = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(courseSlug) {
var responseSet, completed;
return _regenerator.default.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return this.findEvaluationBySlug(courseSlug);

case 2:
responseSet = _context2.sent;

if (!responseSet) {
_context2.next = 7;
break;
}

completed = responseSet.get('has_been_completed') || responseSet.get('status') === 'completed' || this.mapping[courseSlug].status === 'skipped';

if (completed) {
this.refreshResponseSet(courseSlug);
}

return _context2.abrupt("return", completed);

case 7:
case "end":
return _context2.stop();
}
}
}, _callee2, this);
}));

function userHasCompletedEvaluation(_x2) {
return _userHasCompletedEvaluation.apply(this, arguments);
}

return userHasCompletedEvaluation;
}(),
shouldSkip: function shouldSkip(slug) {
var responseSet = this.getResponseSet(slug);
return responseSet && responseSet.status && responseSet.status === 'skipped';
},
getResponseSetFromModel: function () {
var _getResponseSetFromModel = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(courseSlug) {
var evaluation, responseSet;
return _regenerator.default.wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
_context3.next = 2;
return this.findEvaluationBySlug(courseSlug);

case 2:
evaluation = _context3.sent;
responseSet = evaluation ? evaluation.get('responseSet') : null;

if (responseSet) {
responseSet.endpoint = evaluation.get('endpoint');
responseSet.id = evaluation.get('id');
}

return _context3.abrupt("return", responseSet);

case 6:
case "end":
return _context3.stop();
}
}
}, _callee3, this);
}));

function getResponseSetFromModel(_x3) {
return _getResponseSetFromModel.apply(this, arguments);
}

return getResponseSetFromModel;
}(),
findEvaluationBySlug: function () {
var _findEvaluationBySlug = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(slug) {
var evalufiId;
return _regenerator.default.wrap(function _callee4$(_context4) {
while (1) {
switch (_context4.prev = _context4.next) {
case 0:
evalufiId = this.mapping[slug] && !this.isResponseSetScrubbed(slug) ? this.mapping[slug].id : null;
_context4.prev = 1;

if (!evalufiId) {
_context4.next = 8;
break;
}

_context4.next = 5;
return this.getEvaluationModel(evalufiId);

case 5:
_context4.t0 = _context4.sent;
_context4.next = 11;
break;

case 8:
_context4.next = 10;
return this.handleMissingResponseSet(slug);

case 10:
_context4.t0 = _context4.sent;

case 11:
return _context4.abrupt("return", _context4.t0);

case 14:
_context4.prev = 14;
_context4.t1 = _context4["catch"](1);

// Something went wrong
_handler.default.handle(_context4.t1, 'warn');

return _context4.abrupt("return", null);

case 18:
case "end":
return _context4.stop();
}
}
}, _callee4, this, [[1, 14]]);
}));

function findEvaluationBySlug(_x4) {
return _findEvaluationBySlug.apply(this, arguments);
}

return findEvaluationBySlug;
}(),
isResponseSetScrubbed: function isResponseSetScrubbed(slug) {
return !this.mapping[slug].evalufi_id;
},
getEvaluationModel: function () {
var _getEvaluationModel = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(evalufiId) {
return _regenerator.default.wrap(function _callee5$(_context5) {
while (1) {
switch (_context5.prev = _context5.next) {
case 0:
return _context5.abrupt("return", _ef.default.responseSet.models.find(function (model) {
return model.get('id') === evalufiId;
}));

case 1:
case "end":
return _context5.stop();
}
}
}, _callee5);
}));

function getEvaluationModel(_x5) {
return _getEvaluationModel.apply(this, arguments);
}

return getEvaluationModel;
}(),
handleMissingResponseSet: function () {
var _handleMissingResponseSet = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(courseSlug) {
var _this = this;

var progressId, basePath, endPoint, timeoutInterval, GET, POST, tries, foundResponseSet, fetchResponseSet;
return _regenerator.default.wrap(function _callee7$(_context7) {
while (1) {
switch (_context7.prev = _context7.next) {
case 0:
progressId = _ef.default.enrollment.get('id');
basePath = _ef.default.config.get('basePath');
endPoint = "".concat(basePath, "/progress/").concat(progressId, "/response_sets");
timeoutInterval = 1000;
GET = 'GET';
POST = 'POST';
tries = 3;

fetchResponseSet = /*#__PURE__*/function () {
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(url, method, slug) {
var getParams, response, results, responseSet;
return _regenerator.default.wrap(function _callee6$(_context6) {
while (1) {
switch (_context6.prev = _context6.next) {
case 0:
_context6.prev = 0;

getParams = function getParams(httpMethod) {
var body = httpMethod !== GET ? {
body: JSON.stringify({
data: {
type: 'response_sets',
attributes: {
course_evaluation_slug: slug
}
}
})
} : {};
return _objectSpread({
method: httpMethod,
headers: {
Accept: 'application/vnd.api+json',
'Content-Type': 'application/vnd.api+json',
Cache: 'no-cache',
Authorization: "Bearer ".concat(_ef.default.config.get('accessToken'))
}
}, body);
};

_context6.next = 4;
return _utils.default.fetch(method === GET ? "".concat(endPoint, "/").concat(slug) : url, getParams(method));

case 4:
response = _context6.sent;
tries--;

if (!(tries === 0)) {
_context6.next = 8;
break;
}

throw new _error.HTTPError('Re-tried and failed to get response set ', response.status);

case 8:
if (!(response.status === 404 || response.status >= 500)) {
_context6.next = 17;
break;
}

_context6.t0 = setTimeout;
_context6.next = 12;
return fetchResponseSet(url, POST, slug);

case 12:
_context6.t1 = _context6.sent;
_context6.t2 = timeoutInterval;
(0, _context6.t0)(_context6.t1, _context6.t2);
_context6.next = 34;
break;

case 17:
if (!(response.status === 409)) {
_context6.next = 26;
break;
}

_context6.t3 = setTimeout;
_context6.next = 21;
return fetchResponseSet(url, GET, slug);

case 21:
_context6.t4 = _context6.sent;
_context6.t5 = timeoutInterval;
(0, _context6.t3)(_context6.t4, _context6.t5);
_context6.next = 34;
break;

case 26:
if (!(response.status >= 200 && response.status < 300)) {
_context6.next = 33;
break;
}

_context6.next = 29;
return response.json();

case 29:
results = _context6.sent;

if (results.data.id) {
responseSet = _utils.default.sanifyJsonApiObject(results.data);
responseSet.id = responseSet.evalufi_id;
_this.mapping[slug] = responseSet;
foundResponseSet = new _response_set.default(responseSet);

_ef.default.responseSet.add(foundResponseSet);
}

_context6.next = 34;
break;

case 33:
throw new _error.HTTPError('Failed to get response set for slug ', response.status);

case 34:
_context6.next = 40;
break;

case 36:
_context6.prev = 36;
_context6.t6 = _context6["catch"](0);

_handler.default.handle(_context6.t6);

return _context6.abrupt("return", null);

case 40:
case "end":
return _context6.stop();
}
}
}, _callee6, null, [[0, 36]]);
}));

return function fetchResponseSet(_x7, _x8, _x9) {
return _ref.apply(this, arguments);
};
}();

_context7.next = 10;
return fetchResponseSet(endPoint, GET, courseSlug);

case 10:
return _context7.abrupt("return", foundResponseSet);

case 11:
case "end":
return _context7.stop();
}
}
}, _callee7);
}));

function handleMissingResponseSet(_x6) {
return _handleMissingResponseSet.apply(this, arguments);
}

return handleMissingResponseSet;
}(),
findEvaluationTokenBySlug: function findEvaluationTokenBySlug(slug) {
return this.mapping[slug].token;
},
expandedResponseSet: function () {
var _expandedResponseSet = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(slug) {
var responseSet, options;
return _regenerator.default.wrap(function _callee8$(_context8) {
while (1) {
switch (_context8.prev = _context8.next) {
case 0:
_context8.next = 2;
return this.findEvaluationBySlug(slug);

case 2:
responseSet = _context8.sent;

if (responseSet) {
_context8.next = 5;
break;
}

return _context8.abrupt("return", null);

case 5:
options = this.getResponseSetOptions(responseSet);
responseSet.includes = 'evaluation,sections.questions.answers,classifications';
_context8.next = 9;
return responseSet.fetch(options);

case 9:
case "end":
return _context8.stop();
}
}
}, _callee8, this);
}));

function expandedResponseSet(_x10) {
return _expandedResponseSet.apply(this, arguments);
}

return expandedResponseSet;
}(),
updateResponseSet: function () {
var _updateResponseSet = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(slug, newResponseSet) {
var responseSet;
return _regenerator.default.wrap(function _callee9$(_context9) {
while (1) {
switch (_context9.prev = _context9.next) {
case 0:
_context9.next = 2;
return this.findEvaluationBySlug(slug);

case 2:
responseSet = _context9.sent;

if (responseSet && responseSet.id !== newResponseSet.id) {
this.mapping[slug] = newResponseSet;
responseSet.id = newResponseSet.id;
responseSet.token = newResponseSet.token;
responseSet.set('id', newResponseSet.id);
responseSet.set('token', newResponseSet.token);
}

this.refreshResponseSet(slug);

case 5:
case "end":
return _context9.stop();
}
}
}, _callee9, this);
}));

function updateResponseSet(_x11, _x12) {
return _updateResponseSet.apply(this, arguments);
}

return updateResponseSet;
}(),
refreshResponseSet: function () {
var _refreshResponseSet = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(slug) {
var responseSet, options;
return _regenerator.default.wrap(function _callee10$(_context10) {
while (1) {
switch (_context10.prev = _context10.next) {
case 0:
_context10.next = 2;
return this.findEvaluationBySlug(slug);

case 2:
responseSet = _context10.sent;

if (responseSet) {
_context10.next = 5;
break;
}

return _context10.abrupt("return", new Promise(function (resolve) {
return resolve();
}));

case 5:
options = this.getResponseSetOptions(responseSet);
responseSet.includes = 'classifications';
return _context10.abrupt("return", responseSet.fetch(options));

case 8:
case "end":
return _context10.stop();
}
}
}, _callee10, this);
}));

function refreshResponseSet(_x13) {
return _refreshResponseSet.apply(this, arguments);
}

return refreshResponseSet;
}(),
getResponseSetOptions: function getResponseSetOptions(responseSet) {
return _ef.default.options.local ? {} : {
parse: true,
headers: {
Authorization: "Bearer ".concat(responseSet.get('token'))
}
};
},
bestScore: function () {
var _bestScore = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(courseSlug) {
var responseSet;
return _regenerator.default.wrap(function _callee11$(_context11) {
while (1) {
switch (_context11.prev = _context11.next) {
case 0:
_context11.next = 2;
return this.findEvaluationBySlug(courseSlug);

case 2:
responseSet = _context11.sent;
return _context11.abrupt("return", responseSet && responseSet.has('best_grade') ? responseSet.get('best_grade') : 0);

case 4:
case "end":
return _context11.stop();
}
}
}, _callee11, this);
}));

function bestScore(_x14) {
return _bestScore.apply(this, arguments);
}

return bestScore;
}(),
showAlert:
/* istanbul ignore next: moved to alert service */
function showAlert(alertConfig) {
if (!alertConfig || alertConfig.length !== 5) {
return;
}

var _alertConfig = (0, _slicedToArray2.default)(alertConfig, 5),
alertType = _alertConfig[0],
alertTitle = _alertConfig[1],
icon = _alertConfig[2],
visibility = _alertConfig[3],
alertMsg = _alertConfig[4];

_chaplin.default.mediator.publish('action:alert', alertType, alertTitle, alertMsg, icon, visibility);
}
};
var _default = EvaluationService;
exports.default = _default;
});

require.register("services/data-handler-services/portfolio-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _portfolio = _interopRequireDefault(require("models/portfolio"));

var _enrollmentDataService = _interopRequireDefault(require("services/data-handler-services/enrollment-data-service"));

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var _contentService = _interopRequireDefault(require("services/loader-handler-services/content-service"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _lodash = _interopRequireDefault(require("lodash"));

var _ef = _interopRequireDefault(require("ef/ef"));

var PortfolioService = function PortfolioService() {
if (PortfolioService.prototype._singleton) {
return PortfolioService.prototype._singleton;
}

PortfolioService.prototype._singleton = this;

this.initialize = function () {
var _this = this;

this.portfolio = new _portfolio.default();
this.portfolio.set(_courseSettingsService.default.get('portfolio'));

_contentService.default.applyContent(this.portfolio, 'portfolio').then(function () {
_lodash.default.each(_this.portfolio.get('contents'), function (item) {
if (item.type === 'checklist') {
var items = [];

_lodash.default.each(item.items, function (moduleItems, moduleKey) {
_lodash.default.each(moduleItems, function (moduleItem) {
moduleItem.module_key = moduleKey;
});

items = items.concat(moduleItems);
});

item.items = items;
}
});

var userData = _enrollmentDataService.default.getData('portfolio_data') || {};
var self = _this;

if (_enrollmentDataService.default.getData('portfolio_data')) {
_lodash.default.each(userData, function (data, key) {
var content = self.portfolio.get('contents')[key];

if (content && content.type === 'checklist') {
_lodash.default.each(data, function (value, item) {
if (item === 'custom_items' && content.allow_custom) {
content.items = content.items.concat(value);
} else if (item === 'other-field') {
content.other_item = value;
} else {
var contentItem = _lodash.default.find(content.items, {
key: item
});

if (contentItem) {
contentItem.checked = value;
}
}
});
}
});
}

_this.portfolio.set('user_data', userData);
});
};

this.getPortfolioViewOptions = function (defaults) {
var contents = _lodash.default.map(this.portfolio.get('contents'), function (item, key) {
item.key = key;
return item;
});

var options = {
model: this.portfolio,
collection: new _chaplin.default.Collection(contents)
};
return _lodash.default.defaults(options, defaults);
};

this.getChecklist = function (checklistKey) {
return this.portfolio.get('contents')[checklistKey];
};

this.setChecklistItemValue = function (checklistKey, itemKey, value) {
var userData = this.portfolio.get('user_data');

if (!userData[checklistKey]) {
userData[checklistKey] = {};
}

userData[checklistKey][itemKey] = value;

var item = _lodash.default.find(this.portfolio.get('contents')[checklistKey].items, {
key: itemKey
});

if (item !== undefined) {
item.checked = value;
}

_enrollmentDataService.default.saveData('portfolio_data', userData);
};

this.addCustomChecklistItem = function (checklistKey, text) {
var userData = this.portfolio.get('user_data');

if (!userData[checklistKey]) {
userData[checklistKey] = {};
}

var id = 0;

if (!userData[checklistKey].custom_items) {
userData[checklistKey].custom_items = [];
} else {
var items = userData[checklistKey].custom_items;

if (items.length > 0) {
id = items[items.length - 1].id + 1;
}
}

var item = {
checked: true,
custom: true,
id: id,
key: "custom-item-".concat(id),
module_key: _ef.default.module.get('key'),
page_key: _ef.default.module.currentActivity.currentPage.get('key'),
action_tip: 'User Created Item',
//TODO: translate this....
text: text
};
userData[checklistKey].custom_items.push(item);
this.portfolio.get('contents')[checklistKey].items.push(item);

_enrollmentDataService.default.saveData('portfolio_data', userData);
};

this.addOtherChecklistItem = function (checklistKey, text) {
var userData = this.portfolio.get('user_data');

if (!userData[checklistKey]) {
userData[checklistKey] = {};
}

var item = {
checked: true,
other: true,
key: 'other-item',
module_key: _ef.default.module.get('key'),
page_key: _ef.default.module.currentActivity.currentPage.get('key'),
text: text
};
userData[checklistKey]['other-field'] = item;
var checklist = this.getChecklist(checklistKey);
checklist.other_item = item;

_enrollmentDataService.default.saveData('portfolio_data', userData);
};

this.deleteCustomChecklistItem = function (checklistKey, itemKey) {
var userData = this.portfolio.get('user_data');
userData[checklistKey].custom_items = _lodash.default.reject(userData[checklistKey].custom_items, {
key: itemKey
});
this.portfolio.get('contents')[checklistKey].items = _lodash.default.reject(this.portfolio.get('contents')[checklistKey].items, {
key: itemKey
});

_enrollmentDataService.default.saveData('portfolio_data', userData);
};
};

var _default = new PortfolioService();

exports.default = _default;
});

require.register("services/data-handler-services/survey-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _ef = _interopRequireDefault(require("ef/ef"));

var _contentProvider = _interopRequireDefault(require("services/content-provider"));

var SurveyService = {
initialize: function initialize(mapping) {
mapping = mapping || {};
this.mapping = mapping;
this.ContentProvider = _contentProvider.default;
},
surveyUrl: function surveyUrl(courseSlug, returnHash) {
var settings = this.mapping[courseSlug];

if (!settings) {
console.warn('Invalid survey mapping for slug: ', courseSlug);
console.warn('Here are the survey mappings for reference: ', this.mapping); // trigger something special...

return null;
} //var redirectPath = window.location.pathname + "#" + EF.module.currentActivity.currentPage.path();


var hash = returnHash || window.location.hash;

if (!returnHash && _ef.default.module && _ef.default.module.currentActivity && _ef.default.module.currentActivity.currentPage) {
hash = "#".concat(_ef.default.module.currentActivity.currentPage.path());
}

var redirectPath = window.location.pathname + hash;
var url = '/student/redirect_to_survey?survey_id=:survey_id&module_redirect_url=:redirect_url';
url = url.replace(':survey_id', settings.survey_id);
url = url.replace(':redirect_url', encodeURIComponent(redirectPath));
return url;
},
userHasCompletedSurvey: function userHasCompletedSurvey(courseSlug) {
return this.ContentProvider.SurveyService.userHasCompletedSurvey(courseSlug);
},
getActivityProgressForSlug: function getActivityProgressForSlug(courseSlug) {
var settings = this.mapping[courseSlug];
return _ef.default.activityProgresses.find(function (ap) {
if (_ef.default.options.local) {
return ap.get('slug') === courseSlug;
} else {
return ap.get('activity_id') === settings.id;
}
});
}
};
var _default = SurveyService;
exports.default = _default;
});

require.register("services/data-handler-services/sync-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _utils = _interopRequireDefault(require("lib/utils"));

var _progressService = _interopRequireDefault(require("services/course-handler-services/progress-service"));

var _backbone = _interopRequireDefault(require("backbone"));

var _backbone2 = require("backbone.localstorage");

var _webStorageService = require("services/data-handler-services/web-storage-service");

var _jquery = _interopRequireDefault(require("jquery"));

var _lodash = _interopRequireDefault(require("lodash"));

var _ef = require("ef");

var localSync = {
read: function read(method, model, options) {
var deferred = _jquery.default.Deferred();

if (typeof model.fileName === 'function') {
model.fileName = model.fileName();
}

var localData = _utils.default.tryRequire("/local-data/".concat(model.fileName));

if (localData) {
options.success(localData);

if (options.parse) {
model.parse(localData, options);
}
}

return deferred.resolve();
}
};
var customLocalSyncs = {
ActivityProgressesCollection: {
read: function read(method, model, options) {
var d = _jquery.default.Deferred();

var progresses = _progressService.default.getLocalActivityProgresses();

options.success(progresses);
return d.resolve();
}
},
Poll: {
read: localSync.read,
create: function create(method, model, options) {
var d = _jquery.default.Deferred();

var totals = [];
model.get('answers').forEach(function (a) {
totals.push({
id: a.id,
count: Math.floor(Math.random() * (500 - 1) + 1)
});
});
model.set('totals', totals);
options.success({
totals: totals
});
return d.resolve({
totals: totals
});
}
},
Module: {
read: _backbone.default.localSync
},
ModulesCollection: {
read: _backbone.default.localSync
}
};
var SyncService = {
initialize: function initialize() {
var self = this;

var overrideSync = function overrideSync(model, name) {
if (customLocalSyncs[name] && model.prototype) {
model.prototype.syncMethods = customLocalSyncs[name];
self.storageFallback(model, name);
model.prototype.sync = self.sync;
} else if (model.prototype) {
model.prototype.syncMethods = localSync;
self.storageFallback(model, name);
model.prototype.sync = self.sync;
} else {
_lodash.default.each(model, overrideSync);
}
};

_lodash.default.each(_ef.Models, overrideSync);

_lodash.default.each(_ef.Collections, overrideSync);
},
sync: function sync(method, model, options) {
if (this.syncMethods[method]) {
return this.syncMethods[method](method, model, options);
} else {
return _backbone.default.sync(method, model, options);
}
},
storageFallback: function storageFallback(model, name) {
try {
model.prototype.localStorage = new _backbone2.LocalStorage(name);
} catch (e) {
model.prototype.localStorage = _webStorageService.webStorage;
}
}
};
var _default = SyncService;
exports.default = _default;
});

require.register("services/data-handler-services/web-storage-service/index.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.LocalStorageService = void 0;
Object.defineProperty(exports, "MemoryStorageService", {
enumerable: true,
get: function get() {
return _memoryStorageService.default;
}
});
exports.webStorage = exports.checkStorage = exports.SessionStorageService = void 0;

var _localStorageService = _interopRequireDefault(require("services/data-handler-services/web-storage-service/local-storage-service"));

var _memoryStorageService = _interopRequireDefault(require("services/data-handler-services/web-storage-service/memory-storage-service"));

var _sessionStorageService = _interopRequireDefault(require("services/data-handler-services/web-storage-service/session-storage-service"));

var LOCAL_STORAGE = 'localStorage';
var SESSION_STORAGE = 'sessionStorage';
var MEMORY_STORAGE = 'memoryStorage';
var webStorage = null;
exports.webStorage = webStorage;

var checkStorage = function checkStorage(storageName) {
try {
var storage = window[storageName];
storage.setItem('ls-support', 1);
storage.removeItem('ls-support');
return true;
} catch (e) {
/**
* TODO: 1. Warn user to use non-private mode if possible (a toaster or fading alert). 2. Recover from QUOTA_EXCEEDED_ERR
* https://developer.apple.com/library/archive/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/Name-ValueStorage/Name-ValueStorage.html
*
*/
console.warn("".concat(storageName, " is unavailable"), e);
return false;
}
};

exports.checkStorage = checkStorage;

var isSupported = function isSupported() {
var storage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : LOCAL_STORAGE;

if (storage === LOCAL_STORAGE || storage === SESSION_STORAGE) {
return checkStorage(storage);
} else if (storage === MEMORY_STORAGE) {
return true;
} else {
throw new Error("".concat(storage, " name not supported. "));
}
};
/**
* Use a fallback if localStorage or sessionStorage are not supported
*/


var LocalStorageService = isSupported(LOCAL_STORAGE) ? _localStorageService.default : _memoryStorageService.default;
/**
* Note: Data in sessionStorage is cleared when the page session ends.
* A page session lasts as long as the browser is open, and survives over page reloads and restores.
* https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage
*/

exports.LocalStorageService = LocalStorageService;
var SessionStorageService = isSupported(SESSION_STORAGE) ? _sessionStorageService.default : _memoryStorageService.default;
/**
* Use webStorage if it doesn't really matter what storage to use,
*/

exports.SessionStorageService = SessionStorageService;

if (isSupported(LOCAL_STORAGE)) {
exports.webStorage = webStorage = _localStorageService.default;
} else if (isSupported(SESSION_STORAGE)) {
exports.webStorage = webStorage = _sessionStorageService.default;
} else {
exports.webStorage = webStorage = _memoryStorageService.default;
}
/**
* Extra precaution to Shim local storage for
* `DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document` error
*/


if (!isSupported(LOCAL_STORAGE)) {
Object.defineProperty(window, 'localStorage', {
value: webStorage,
configurable: true,
enumerable: true,
writable: true
});
}
});

require.register("services/data-handler-services/web-storage-service/local-storage-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));

var _utils = _interopRequireDefault(require("lib/utils"));

var LocalStorageService = {
getItem: function ls_getItem(key) {
return _utils.default.tryParseJson(localStorage.getItem(key));
},
getByDotString: function getByDotString(dotString) {
return _utils.default.getByDotString(dotString, this.getItem);
},
setItem: function ls_setItem(key, value) {
try {
if ((0, _typeof2.default)(value) === 'object' || Array.isArray(value)) {
localStorage.setItem(key, JSON.stringify(value));
} else {
localStorage.setItem(key, value);
}
} catch (e) {
console.warn('Caught and ignored exception: failed to set item in localStorage:', e);
}
},
removeItem: function ls_removeItem(key) {
return localStorage.removeItem(key);
},
clear: function ls_clear() {
localStorage.clear();
}
};
var _default = LocalStorageService;
exports.default = _default;
});

require.register("services/data-handler-services/web-storage-service/memory-storage-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _utils = _interopRequireDefault(require("lib/utils"));

var MemoryStorageService = function MemoryStorageService() {
if (MemoryStorageService.prototype._singleton) {
return MemoryStorageService.prototype._singleton;
}

MemoryStorageService.prototype._singleton = this;
this.data = {};

this.getItem = function (key) {
return this.data[key];
};

this.setItem = function (key, value) {
if (key === undefined) {
throw new Error('Cannot store an item in session with an undefined key.');
}

this.data[key] = value;
};

this.removeItem = function (key) {
return delete this.data[key];
};

this.clear = function () {
return this.data = {};
};

this.getByDotString = function (dotString) {
return _utils.default.getByDotString(dotString, this.getItem.bind(this));
};

this.getAll = function () {};
};

var _default = new MemoryStorageService();

exports.default = _default;
});

require.register("services/data-handler-services/web-storage-service/session-storage-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));

var _utils = _interopRequireDefault(require("lib/utils"));

var SessionStorageService = function SessionStorageService() {
if (SessionStorageService.prototype._singleton) {
return SessionStorageService.prototype._singleton;
}

SessionStorageService.prototype._singleton = this;

this.getItem = function (key) {
return _utils.default.tryParseJson(sessionStorage.getItem(key));
};

this.getByDotString = function (dotString) {
return _utils.default.getByDotString(dotString, this.getItem);
};

this.setItem = function (key, item) {
if (key === undefined) {
throw new Error('Cannot store an item in session with an undefined key.');
}

if ((0, _typeof2.default)(item) === 'object' || Array.isArray(item)) {
sessionStorage.setItem(key, JSON.stringify(item));
} else {
sessionStorage.setItem(key, item);
}
};

this.removeItem = function (key) {
sessionStorage.removeItem(key);
};
/* Returns key/value pair object that maps to sessionStorage */


this.getAll = function () {
return Object.keys(sessionStorage).reduce(function (result, key) {
if (key !== undefined) {
result[key] = _utils.default.tryParseJson(sessionStorage.getItem(key));
return result;
}
}, {});
};

this.clear = function () {
sessionStorage.clear();
};
};

var _default = new SessionStorageService();

exports.default = _default;
});

require.register("services/error-handler-service/base-error.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));

var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

var BaseError = /*#__PURE__*/function (_Error) {
(0, _inherits2.default)(BaseError, _Error);

var _super = _createSuper(BaseError);

function BaseError(message) {
var _this;

(0, _classCallCheck2.default)(this, BaseError);
_this = _super.call(this, message);

if (Error.captureStackTrace) {
Error.captureStackTrace((0, _assertThisInitialized2.default)(_this), BaseError);
}

_this.name = 'Error';
_this.message = message;
return _this;
}

return (0, _createClass2.default)(BaseError);
}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));

exports.default = BaseError;
});

;require.register("services/error-handler-service/error.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PropertyError = exports.HTTPError = exports.FeatureError = void 0;

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));

var _baseError = _interopRequireDefault(require("services/error-handler-service/base-error"));

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

var HTTPError = /*#__PURE__*/function (_BaseError) {
(0, _inherits2.default)(HTTPError, _BaseError);

var _super = _createSuper(HTTPError);

function HTTPError(message, httpStatus) {
var _this;

(0, _classCallCheck2.default)(this, HTTPError);

for (var _len = arguments.length, params = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
params[_key - 2] = arguments[_key];
}

_this = _super.call.apply(_super, [this].concat(params));
_this.message = message;
_this.httpStatus = httpStatus;
_this.name = _this.httpStatus > 499 ? 'ServerError' : 'ClientError';
return _this;
}

return (0, _createClass2.default)(HTTPError);
}(_baseError.default); // property exceptions


exports.HTTPError = HTTPError;

var PropertyError = /*#__PURE__*/function (_BaseError2) {
(0, _inherits2.default)(PropertyError, _BaseError2);

var _super2 = _createSuper(PropertyError);

function PropertyError(message, property) {
var _this2;

(0, _classCallCheck2.default)(this, PropertyError);

for (var _len2 = arguments.length, params = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
params[_key2 - 2] = arguments[_key2];
}

_this2 = _super2.call.apply(_super2, [this].concat(params));
_this2.message = message;
_this2.name = 'PropertyError';
_this2.property = property;
return _this2;
}

return (0, _createClass2.default)(PropertyError);
}(_baseError.default); // exceptions for homeroom features


exports.PropertyError = PropertyError;

var FeatureError = /*#__PURE__*/function (_BaseError3) {
(0, _inherits2.default)(FeatureError, _BaseError3);

var _super3 = _createSuper(FeatureError);

function FeatureError(message, feature) {
var _this3;

(0, _classCallCheck2.default)(this, FeatureError);

for (var _len3 = arguments.length, params = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
params[_key3 - 2] = arguments[_key3];
}

_this3 = _super3.call.apply(_super3, [this].concat(params));
_this3.message = message;
_this3.name = 'FeatureError';
_this3.feature = feature;
return _this3;
}

return (0, _createClass2.default)(FeatureError);
}(_baseError.default);

exports.FeatureError = FeatureError;
});

;require.register("services/error-handler-service/handler.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _stacktraceJs = _interopRequireDefault(require("stacktrace-js"));

var _logger = _interopRequireDefault(require("services/error-handler-service/logger"));

var _localeService = _interopRequireDefault(require("services/loader-handler-services/locale-service"));

var ErrorHandler = /*#__PURE__*/function () {
function ErrorHandler(errorType, code) {
(0, _classCallCheck2.default)(this, ErrorHandler);

if (!ErrorHandler.instance) {
this.type = errorType || '';
this.code = code || '';
this.stack = '';
this.logLevel = 'info';
ErrorHandler.instance = this;
}

return ErrorHandler.instance;
}

(0, _createClass2.default)(ErrorHandler, [{
key: "handle",
value: function handle(error) {
var loggerLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'info';
this.type = error.name;
this.logLevel = loggerLevel;

switch (this.type) {
case 'ClientError':
this.clientError(error);
break;

case 'ServerError':
this.serverError(error);
break;

case 'PropertyError':
this.PropertyError(error);
break;

default:
this.catchAll(error);
}
}
}, {
key: "clientError",
value: function clientError(error) {
var configs = ['responseSetAlert.alertFailure', 'responseSetAlert.alertFailureHeader', '', true, 'responseSetAlert.alertFailureText'];
this.showAlert(configs);
this.logError(error, this.logLevel);
}
}, {
key: "serverError",
value: function serverError(error) {
var text;
var code = error.httpStatus; // timeout

if (code >= 598) {
text = _localeService.default.t('Network timeout retry later');
} else {
text = 'responseSetAlert.alertFailureText';
}

var configs = ['responseSetAlert.alertFailure', 'responseSetAlert.alertFailureHeader', '', true, text];
this.showAlert(configs);
this.logError(error, this.logLevel);
}
}, {
key: "catchAll",
value: function catchAll(error) {
this.logError(error, this.logLevel);
}
}, {
key: "showAlert",
value: function showAlert(config) {
if (!config || config.length !== 5) {
return;
}

var _config = (0, _slicedToArray2.default)(config, 5),
alertType = _config[0],
alertTitle = _config[1],
icon = _config[2],
visibility = _config[3],
alertMsg = _config[4];

_chaplin.default.mediator.publish('action:alert', alertType, alertTitle, alertMsg, icon, visibility);
}
}, {
key: "logError",
value: function logError(error) {
var loggerLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'info';

var errorCallback = function errorCallback(err) {
_logger.default.logToConsole(err.message, loggerLevel);
};

_stacktraceJs.default.fromError(error).then(function (frames) {
var errorObj = {
error: error,
StackFrame: frames
}; //TODO: use StackTraceGPS for granular logging

_logger.default.logToConsole(errorObj, loggerLevel);
}).catch(errorCallback);
}
}]);
return ErrorHandler;
}();

var instance = new ErrorHandler();
var _default = instance;
exports.default = _default;
});

require.register("services/error-handler-service/logger.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _loglevel = _interopRequireDefault(require("loglevel"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _lodash = _interopRequireDefault(require("lodash"));

var ConsoleLogger = /*#__PURE__*/function () {
function ConsoleLogger() {
(0, _classCallCheck2.default)(this, ConsoleLogger);

if (!ConsoleLogger.instance) {
this.isWebPage = (typeof window === "undefined" ? "undefined" : (0, _typeof2.default)(window)) != undefined;
this.levels = {
TRACE: 0,
DEBUG: 1,
INFO: 2,
WARN: 3,
ERROR: 4,
SILENT: 5
};
ConsoleLogger.instance = this;
}

return ConsoleLogger.instance;
}

(0, _createClass2.default)(ConsoleLogger, [{
key: "info",
value: function info(message) {
return _loglevel.default.info(message);
}
}, {
key: "debug",
value: function debug(message) {
return _loglevel.default.debug(message);
}
}, {
key: "warn",
value: function warn(message) {
return _loglevel.default.warn(message);
}
}, {
key: "error",
value: function error(message) {
return _loglevel.default.error(message);
}
}, {
key: "trace",
value: function trace(message) {
return _loglevel.default.trace(message);
}
}, {
key: "logToConsole",
value: function logToConsole(msg) {
var logLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'warn';

if (!msg) {
this.error('message is not defined');
return;
}

var level = this.getLogLevel(logLevel);
var message = this.envLog(msg);

if (!message) {
this.error('Will not log is not on a webpage');
return;
} // TODO: Send error object to a remote logger (TBD);


switch (level) {
case this.levels.TRACE:
return this.trace(message);

case this.levels.DEBUG:
return this.debug(message);

case this.levels.INFO:
return this.info(message);

case this.levels.WARN:
return this.warn(message);

case this.levels.ERROR:
return this.error(message);
}
}
}, {
key: "envLog",
value: function envLog(msg) {
if (this.isWebPage) {
if (this.getEnvironment() === 'dev') {
return msg;
} else {
if (_lodash.default.isObjectLike(msg) && msg.error) {
return msg.error;
}

return msg;
}
}
}
}, {
key: "getEnvironment",
value: function getEnvironment() {
return _ef.default.config.get('env');
}
}, {
key: "getLogLevel",
value: function getLogLevel(level) {
if (typeof level === 'number') {
return level;
}

level = typeof level === 'string' && level.toUpperCase();

if (!this.levels[level]) {
this.info("".concat(level, " is not part of the logger facade. Defaulting to error"));
return this.levels.ERROR;
}

return this.levels[level];
}
}]);
return ConsoleLogger;
}();

var instance = new ConsoleLogger();
var _default = instance;
exports.default = _default;
});

require.register("services/event-handler-services/animation-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));

var _jquery = _interopRequireDefault(require("jquery"));

var AnimationService = {
// Generalized animation queue
// This parses a class selector of type `.queue-animationStyle-indexInQueue .queue`
// .e.g. : queue-fadeIn-1 .queue .delay-1-second
queueAnimationsRun: function queueAnimationsRun() {
var queue = (0, _toConsumableArray2.default)((0, _jquery.default)('.queue'));
var selectorRegExp = /\.?queue-([a-zA-Z]+)-(\d+)/;

if (!queue.length) {
return;
}

queue.sort(function (a, b) {
a = a.attributes.class.value.split(' ').filter(function (e) {
return e.match(selectorRegExp);
});
b = b.attributes.class.value.split(' ').filter(function (e) {
return e.match(selectorRegExp);
});
return selectorRegExp.exec(a)[2] - selectorRegExp.exec(b)[2];
});
var start = selectorRegExp.exec(queue[0].attributes.class.value.split(' ').filter(function (e) {
return e.match(selectorRegExp);
}))[1];
(0, _jquery.default)(queue[0]).addClass("".concat(start, " animated"));
queue.forEach(function (e, i) {
var $e = (0, _jquery.default)(e);

if (i < queue.length - 1) {
var selected = selectorRegExp.exec(queue[i + 1].attributes.class.value.split(' ').filter(function (e) {
return e.match(selectorRegExp);
}));
var animation = selected[1];
$e.one(['transitionend webkitTransitionEnd oTransitionEnd', 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'].join(' '), function () {
(0, _jquery.default)(queue[i + 1]).addClass("".concat(animation, " animated"));
});
}
});
}
};
var _default = AnimationService;
exports.default = _default;
});

require.register("services/event-handler-services/drag-and-drop-keyboard-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _localeService = _interopRequireDefault(require("services/loader-handler-services/locale-service"));

var _keybindingService = require("services/event-handler-services/keybinding-service");

var _jquery = _interopRequireDefault(require("jquery"));

var Enter = _keybindingService.keys.Enter;

var DragAndDropKeyboard = function DragAndDropKeyboard($page, draggersSelector, droppersSelector, callback) {
var self = this;
self.draggersSelector = draggersSelector;
self.droppersSelector = droppersSelector;
self.$page = $page;
self.callback = callback;
self.$curDragger = null;
/**
* Call this to initilize the keyboard handler. the only 'public' method you need to call
*/

self.init = function (model) {
// Prevent the event from being attached multiple times
self.$page.off('keydown', draggersSelector);
self.$page.on('keydown', draggersSelector, function (e) {
_keybindingService.KeybindingService.with(e).bind(Enter, function () {
var lastDropSlot = $page.find(self.droppersSelector).length - 1;
var startChar = 65;
var lastChar = startChar + lastDropSlot;
var optionsText = '';
$page.find(self.droppersSelector).each(function (idx, val) {
var choices = _localeService.default.t('drag-and-drop.kbtext', {
keyChar: String.fromCharCode(65 + idx),
text: (0, _jquery.default)(val).children().first().text()
});

optionsText += "<p>".concat(choices, "</p>");
});

var instructions = _localeService.default.t('drag-and-drop.kbInstructions', {
firstChar: String.fromCharCode(startChar),
lastChar: String.fromCharCode(lastChar)
});

self.$page.find('.srInstructions').html(instructions);
self.$page.find('.srText').html(optionsText);
var $item = (0, _jquery.default)(e.target); //filter not events for non draggables, like the text box on communication strengths activity

if ($item.hasClass('ui-draggable')) {
self.$curDragger = (0, _jquery.default)(e.target); // usualy drag-n-drops with only one drop spot should have this flag,
// pressing enter alone will move the focused drag element

if (model.attributes.a11y_info && model.attributes.a11y_info.remove_keyboard_options) {
callback(self.$curDragger, (0, _jquery.default)(droppersSelector));
} else {
self.createKeyboardShortcuts();
self.attachKeyboardHandler();
e.preventDefault();
}
}
});
});
};
/**
* Listens to the document using live binding, this way it works with draggers as they get cloned
*/


self.attachKeyboardHandler = function () {
self.$page.on('keydown.globalShortcut', function (e) {
_keybindingService.KeybindingService.with(e).bind(/[a-zA-Z]/, function () {
var $destination = self.$page.find("div.keyboardShortcut[data-char='".concat(e.key.toUpperCase(), "']"));

if (callback) {
callback(self.$curDragger, $destination.parent());
}
});

var answer = self.$page.find('.srCorrectIncorrectAnswer');

if (self.$curDragger.hasClass('correct')) {
answer.text(_localeService.default.t('drag-and-drop.correct'));
} else {
answer.text(_localeService.default.t('drag-and-drop.incorrect'));
}

self.stopKeyboardShortcuts();
});
};
/**
* cancel the listener that is attached after you press Enter on a dragger
*/


self.stopKeyboardShortcuts = function () {
//only listen to the next key event
self.$page.off('keydown.globalShortcut');
self.$page.find('div.keyboardShortcut').remove();
self.$page.find('div.srInstructions').empty();
self.$page.find('div.srText').empty();
self.$curDragger = null;
};
/**
* Create the temporary visual keyboard short cut labels
*/


self.createKeyboardShortcuts = function () {
self.$page.find('.srCorrectIncorrectAnswer').empty();
var $dropSlots = $page.find(self.droppersSelector);
var startChar = 65;
$dropSlots.each(function () {
var $this = (0, _jquery.default)(this);
var correctDrop = self.$curDragger[0].dataset.correct === 'true' ? true : false;

if (!$this.droppable('option', 'disabled') && !correctDrop) {
//TODO: limit to 26 chars
var newChar = String.fromCharCode(startChar++);
$this.append("<div class='keyboardShortcut' data-char='".concat(newChar, "'> ").concat(newChar, "</div>"));
}
});
};
};

var _default = DragAndDropKeyboard;
exports.default = _default;
});

require.register("services/event-handler-services/focus-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _utils = _interopRequireDefault(require("lib/utils"));

var _keybindingService = require("services/event-handler-services/keybinding-service");

var Tab = _keybindingService.keys.Tab;

var FocusService = function FocusService() {
var _this = this;

var focusNodes = [];
var inertNodes = [];
/**
* Traps keyboard focus within a specified element given a selector
* @param {*} view the view itself
* @param {*} trapSelector the selector for the container where we want the keyboard to trap
* @param {*} containerSelector the container selector where we want to ignore the focus
*/

this.trapFocus = function (view, trapSelector) {
var containerSelector = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '#site-container';

var inertSelector = _utils.default.focusableElements();

var el = view.el;
focusNodes = _this.getFocusNodes(el, inertSelector);

var _this$getFirstLastNod = _this.getFirstLastNodes(focusNodes),
first = _this$getFirstLastNod.first,
last = _this$getFirstLastNod.last;

_this.inert(inertSelector, containerSelector, focusNodes, el);

_this.trapKeyboard(view, trapSelector, first, last);
};
/**
* Gets the first and last nodes given a node list
* @param {*} nodeList list of the nodes
* @returns returns first and last node in the node list
*/


this.getFirstLastNodes = function (nodeList) {
var firstNode = nodeList[0];
var tentativeLastNode = nodeList[nodeList.length - 1]; // if there is only 1 focusable node, then the last node is the first node

var lastNode = tentativeLastNode !== null && tentativeLastNode !== void 0 ? tentativeLastNode : firstNode;
return {
first: firstNode,
last: lastNode
};
};
/**
* Returns elements within a given element and selector
* @param {*} el DOM element in which elements are needed
* @param {*} selector Selector for the nodes that we want to find
* @returns
*/


this.getFocusNodes = function (el, selector) {
var focusableElements = el.querySelectorAll(selector); // grab focusable nodes within a modal

return Array.from(focusableElements);
};
/**
* Inert makes keyboard navigation ignore focusable elements outside of a modal when a modal is open
* TODO: look into using the actual inert polyfill
* Inspired by - https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert
* - https://zellwk.com/blog/keyboard-focusable-elements/
*
* @param {*} iSelector Focusable elements selector
* @param {*} containerSelector the container selector where we want to ignore the focus
* @param {*} fNodes Focusable nodes
* @param {*} el Element
* @returns
*/


this.inert = function (iSelector) {
var containerSelector = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '#site-container';
var fNodes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
var el = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];

/**
* Grab all focusable elements in the site-container.
* We need to store the nodes so that they to be used when the modal is closed to reset the focus.
*/
var nodesToInert = _this.getNodesToInert(containerSelector, el, iSelector, fNodes); // Using for loop for performance


for (var i = 0; i < nodesToInert.length; i++) {
var node = nodesToInert[i];

if (!inertNodes.includes(node)) {
node.prevTabindex = node.getAttribute('tabindex');
node.setAttribute('tabindex', -1);
node.style.outline = 'none';
inertNodes.push(node);
}
}

return nodesToInert;
};
/**
* Return nodes to ignore during keyboard trap
* @param {*} containerSelector the container selector where we want to ignore the focus
* @param {*} el Element
* @param {*} iSelector Focusable elements selector
* @param {*} fNodes Focusable nodes
* @returns
*/


this.getNodesToInert = function (containerSelector, el, iSelector, fNodes) {
var _document$querySelect;

var container = (_document$querySelect = document.querySelector(containerSelector)) !== null && _document$querySelect !== void 0 ? _document$querySelect : el;
return Array.from(container.querySelectorAll(iSelector)).filter(function (node) {
return !fNodes.includes(node);
});
};

this.releaseFocus = function () {
if (!inertNodes.length) {
return;
}

var nodesToReset = inertNodes;

for (var i = 0; i < nodesToReset.length; i++) {
var node = nodesToReset[i];

if (node.prevTabindex) {
node.setAttribute('tabindex', node.prevTabindex);
node.prevTabindex = null;
} else {
node.removeAttribute('tabindex');
}

node.style.outline = null;
}

inertNodes = [];
};

this.trapKeyboard = function (view, trapSelector, firstFocusableEl, lastFocusableEl) {
var selector = view.$el.find(trapSelector).selector;
setTimeout(function () {
firstFocusableEl === null || firstFocusableEl === void 0 ? void 0 : firstFocusableEl.focus();
}, 0);

if (_this.keyboardTrap) {
view.undelegate('keydown', _this.keyboardTrap);
}

_this.keyboardTrap = view.delegate('keydown', selector, function (e) {
_keybindingService.KeybindingService.with(e).bind(Tab, function () {
if (e.shiftKey && document.activeElement === firstFocusableEl) {
lastFocusableEl === null || lastFocusableEl === void 0 ? void 0 : lastFocusableEl.focus();
e.preventDefault();
} else {
var checkLastFocusable = function checkLastFocusable(element) {
// check if element exists
if (!element) {
return;
}

var lastElement = focusNodes[focusNodes.length - 1]; // check if the current focusNodes element is hidden

if (element.clientWidth === 0 && element.clientHeight === 0) {
var index = focusNodes.indexOf(element);
var prevElement = focusNodes[index - 1];
checkLastFocusable(prevElement);
} else if (!e.shiftKey && document.activeElement === lastElement) {
firstFocusableEl === null || firstFocusableEl === void 0 ? void 0 : firstFocusableEl.focus();
e.preventDefault();
}
};

checkLastFocusable(lastFocusableEl);
} // for modal nav buttons and other buttons nested in containers


if (!e.shiftKey && document.activeElement.id && document.activeElement.id === lastFocusableEl.id) {
firstFocusableEl === null || firstFocusableEl === void 0 ? void 0 : firstFocusableEl.focus();
e.preventDefault();
}
});
});
};
};

var _default = new FocusService();

exports.default = _default;
});

require.register("services/event-handler-services/hyperlink-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.hyperlinkService = exports.HyperlinkService = void 0;

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _jquery = _interopRequireDefault(require("jquery"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _localeService = _interopRequireDefault(require("services/loader-handler-services/locale-service"));

var HyperlinkService = /*#__PURE__*/function () {
function HyperlinkService() {
(0, _classCallCheck2.default)(this, HyperlinkService);
this.data = {};
this.blocks = [];

_chaplin.default.mediator.subscribe('link:clicked', this.clickHandler, this);

_chaplin.default.mediator.subscribe('button:clicked', this.clickHandler, this);

_chaplin.default.mediator.subscribe('page:state:initialized', this.reset, this);
}

(0, _createClass2.default)(HyperlinkService, [{
key: "reset",
value: function reset() {
this.blocks.length = 0;
}
}, {
key: "clickHandler",
value: function clickHandler(attrs, blockView) {
var data = attrs.data,
id = attrs.id;

if (!data) {
return false;
}

switch (data.actiontype) {
case 'navigate':
this.navigate(data, blockView);
break;

case 'execute':
this.execute(data, blockView);
break;

case 'open_modal':
this.openModal(data, blockView);
break;

case 'action':
this.dispatchAction(id, data, blockView);
break;

case 'close_content':
this.closeContent(data);
break;

case 'scroll':
this.scrollTo(data);
break;

case 'audio_playback':
this.handleAudio(blockView);
break;

default:
console.warn("Action type: ".concat(data.actiontype, " is currently not supported"));
break;
}
}
}, {
key: "registerBlock",
value: function registerBlock(block) {
this.blocks.push(block);
}
}, {
key: "closeContent",
value: function closeContent(data) {
if (data.safeExit) {
window.postMessage({
event_type: 'safety-exit',
redirectUrl: data.redirect || ''
}, '*');
} else {
window.postMessage({
event_type: 'close-content'
}, '*');
}
}
}, {
key: "execute",
value: function execute(data, blockView) {
blockView.script[data.target]();
}
}, {
key: "handleAudio",
value: function handleAudio(blockView) {
var action = blockView.$el.find('[data-actiontype="audio_playback"]').attr('data-action');
var audio_id = document.querySelector('.audio__player').id;

if (action === 'play') {
blockView.publishEvent("audio:play:".concat(audio_id), {
user_initiated: true
});
} else {
blockView.publishEvent('audio:stop', {
user_initiated: true
});
}
}
}, {
key: "updateAudioButtonState",
value: function updateAudioButtonState(blockView, state) {
var $button = blockView.$el.find('[data-actiontype="audio_playback"]');
var $description = blockView.$el.find('.description');
var $icon_play = blockView.$el.find('.qs-icon-play');
var $icon_stop = blockView.$el.find('.qs-icon-stop');

if (state === 'play') {
var stop_text = blockView.model.get('stop_text') || 'playing';
$button.attr('data-action', 'stop');
$description.html(_localeService.default.t(stop_text));
$icon_play.hide();
$icon_stop.show();
$button.attr('aria-label', "".concat(_localeService.default.t('audio.aria-playing'), ", ").concat(_localeService.default.t(stop_text)));
} else {
var play_text = blockView.model.get('play_text') || 'listen';
$button.attr('data-action', 'play');
$description.html(_localeService.default.t(play_text));
$button.attr('aria-label', "".concat(_localeService.default.t('audio.aria-stopped'), ", ").concat(_localeService.default.t(play_text)));
$icon_stop.hide();
$icon_play.show();
}
}
}, {
key: "dispatchAction",
value: function dispatchAction(id, data, blockView) {
_chaplin.default.mediator.publish("button:clicked:".concat(data.target), {
buttonId: id,
target: data.target,
action: data.action
}, blockView, blockView.pageView);
}
}, {
key: "openModal",
value: function openModal(data, blockView) {
_chaplin.default.mediator.publish("button:clicked:".concat(data.target), {
target: data.target,
action: data.action
}, blockView, blockView.pageView);
}
}, {
key: "navigate",
value: function navigate(data, blockView) {
var navigateType = data.navigate;

switch (navigateType) {
case 'complete':
_chaplin.default.mediator.publish('page:complete', {
direction: 'forward'
});

break;

case 'completeme':
if (!blockView.completed) {
blockView.completed = true;
blockView.readyToGo();
}

break;

case 'window':
_chaplin.default.mediator.publish('window:navigate', data.windowNavigate);

break;

default:
_chaplin.default.mediator.publish('page:navigate', navigateType);

break;
}
}
}, {
key: "scrollTo",
value: function scrollTo(data) {
var $scrollPane = (0, _jquery.default)(data.scrollPane);
var $scrollTarget = (0, _jquery.default)(data.target);
var offsetTop = Number.parseInt(data.offsetTop);
var result = $scrollTarget.offset().top + offsetTop;
$scrollPane.animate({
scrollTop: result
}, 500);
}
}]);
return HyperlinkService;
}();

exports.HyperlinkService = HyperlinkService;
var hyperlinkService = new HyperlinkService();
exports.hyperlinkService = hyperlinkService;
});

require.register("services/event-handler-services/keybinding-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.modifiers = exports.keys = exports.KeybindingService = void 0;

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

/**
* Commonly Used keys. There are many more, like a-z which can be used as plain strings
*/
var keys = {
Enter: 'Enter',
ArrowUp: 'ArrowUp',
ArrowDown: 'ArrowDown',
ArrowLeft: 'ArrowLeft',
ArrowRight: 'ArrowRight',
Home: 'Home',
End: 'End',
PageUp: 'PageUp',
PageDown: 'PageDown',
Space: ' ',
Escape: 'Escape',
Tab: 'Tab',
NotMatched: 'NotMatched',
AnyMatched: 'AnyMatched'
};
exports.keys = keys;
var modifiers = {
Meta: 'metaKey',
Control: 'ctrlKey',
Shift: 'shiftKey'
};
/**
* Service that allows for handling keypresses in an event handlers
* Normalizes a few cross browser differences
*
* @example
* import { KeybindingService, keys } from 'services/event-handler-services/keybinding-service';
*
* const { ArrowUp, ArrowDown, ArrowLeft, ArrowRight } = keys;
*
* document.querySelector('input').addEventHandler('keydown', function(e) {
* KeybindingService.with(e).bind(
* Enter, () => { // do something }, // bind a single key
* [ ArrowUp, ArrowRight ], () => { // do something }, // bind many keys,
* /[a-zA-Z]/, () => { // do something with letters }, // can take a single or many regexes
* ['c', 'C'], () => { // do something }, // bind the c key with a string
* NotMatched, () => { // nothing matched }, // callback for none of the keys matching
* AnyMatched, () => { // some key was matched } // callback for any single key matching
* );
* }, false);
*/

exports.modifiers = modifiers;
var KeybindingService = {
/**
* Sets the event object to use with `bind`
* @returns {KeybindingService} Returns itself
*/
with: function _with(e) {
var property = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key';
this.e = e;
this.property = property;
delete this.matchedAction;
delete this.notMatchedAction;
return this;
},

/**
* Runs a set of callbacks if the given key matches
*
* The arguments are dynamic, so it can take n keys and n callbacks
* Each argument is a pair of keys or an array of keys and the callback associated with those keys
* bind(
* Enter, () => {}, // callback bound to the Enter key
* [ArrowUp, ArrowRight], () => {}, // callback bound to ArrowUp and ArrowRight
* [/[a-zA-Z]/], () => {}, // callback bound to e.key matching any number of regexes
* NotMatched, () => {}, // callback if no key matched
* AnyMatched, () => {} // callback if any key was matched
* )
*/
bind: function bind() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}

args.forEach(function (argument, index) {
var keysValidation = [Array.isArray(argument), typeof argument === 'string', argument instanceof RegExp];

if (index % 2 === 0 && !keysValidation.some(function (v) {
return v === true;
}) || index % 2 === 1 && typeof argument !== 'function') {
throw new Error("Argument validation failed: strings, array of strings, regexs, or array of regexes must be followed by their associated callback. Like this KeybindingService.with(e).bind(['c'], () => { // do something })");
}
});
return this.execute(args.reduce(function (result, _, index, array) {
// transforms the arguments into key and callback pairs like [ [[...keys], callback] ]
return index % 2 === 0 ? result.concat([array.slice(index, index + 2)]) : result;
}, []));
},
execute: function execute(args) {
var _this = this;

return function (values) {
// normalizes the return type so that multiple callbacks
return values.filter(function (v) {
return v !== undefined;
}).reduce(function (result, _ref, index, array) {
var matched = _ref.matched,
value = _ref.value;

if (matched) {
result.push(value);
}

if (index + 1 === array.length) {
// last item?
if (result.length > 0) {
// got some results, run the first AnyMatched
var action = array.find(function (v) {
return typeof v.matchedAction === 'function';
});

if (action) {
action.matchedAction(_this.e);
}
} else {
// got no results, run the first NotMatched
var _action = array.find(function (v) {
return typeof v.notMatchedAction === 'function';
});

if (_action) {
_action.notMatchedAction(_this.e);
}
}

if (result.length === 1) {
// normalize something like [ false ] to just false
result = result[0];
}
}

return result;
}, []);
}(args.map(function (_ref2, index, array) {
var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
keyCodes = _ref3[0],
action = _ref3[1];

if (!Array.isArray(keyCodes)) {
keyCodes = [keyCodes]; // if there's a single keycode make it into an array so it can be iterated
}

if (_this.property === 'key') {
var _Object$entries;

// normalize Internet Explorer specific values to W3C values
Object.entries((_Object$entries = {}, (0, _defineProperty2.default)(_Object$entries, keys.ArrowUp, 'Up'), (0, _defineProperty2.default)(_Object$entries, keys.ArrowDown, 'Down'), (0, _defineProperty2.default)(_Object$entries, keys.ArrowLeft, 'Left'), (0, _defineProperty2.default)(_Object$entries, keys.ArrowRight, 'Right'), (0, _defineProperty2.default)(_Object$entries, keys.Space, 'Spacebar'), _Object$entries)).forEach(function (_ref4) {
var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
key = _ref5[0],
internetExplorerKey = _ref5[1];

if (keyCodes.includes(key)) {
keyCodes.push(internetExplorerKey);
}
});
}

return keyCodes.reduce(function (result, code) {
if (code instanceof RegExp && code.test(_this.e[_this.property])) {
result = action(_this.e);
} else if (Array.isArray(code)) {
if (code.every(function (subcode) {
return subcode === _this.e[_this.property] || Object.values(modifiers).includes(subcode) && _this.e[subcode] === true;
})) {
result.matched = true;
result.value = action(_this.e);
}
} else if (code === _this.e[_this.property]) {
result.matched = true;
result.value = action(_this.e);
} else if (code === keys.NotMatched) {
result.notMatchedAction = action;
} else if (code === keys.AnyMatched) {
result.matchedAction = action;
}

return result;
}, {
matched: false
});
}));
}
};
exports.KeybindingService = KeybindingService;
});

require.register("services/event-handler-services/sizing-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _jquery = _interopRequireDefault(require("jquery"));

function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

var SizingService = {
initialize: function initialize() {},
setMinHeight: function setMinHeight($element, config) {
var minHeight = 0;

if (config.override) {
$element.addClass('override-min-height');
}

if (config.value) {
minHeight = this.getDimensionValueParsed(config.value, 'outerHeight');
} else if (config.calculate) {
minHeight = this.getDimensionValueCalculated(config.calculate, 'outerHeight');
}

$element.css({
'min-height': minHeight
});
},
getTotalForADimension: function getTotalForADimension(dimensionsArray, type) {
var totalForADimension = 0;

var _iterator = _createForOfIteratorHelper(dimensionsArray),
_step;

try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var item = _step.value;

if (typeof item === 'number') {
totalForADimension += item;
} else if ((0, _jquery.default)(item).length) {
totalForADimension += (0, _jquery.default)(item)[type](true);
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}

return totalForADimension;
},
getDimensionValueParsed: function getDimensionValueParsed(value, type) {
return Array.isArray(value) ? "".concat(this.getTotalForADimension(value, type), "px") : value;
},
getDimensionValueCalculated: function getDimensionValueCalculated(config, type) {
var valueA = this.getDimensionValueParsed(config.valueA, type);
var valueB = this.getDimensionValueParsed(config.valueB, type);
var operations = {
subtract: '-',
add: '+'
};
return "calc(".concat(valueA, " ").concat(operations[config.operation], " ").concat(valueB, ")");
}
};
var _default = SizingService;
exports.default = _default;
});

require.register("services/homeroom/assessment-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _assessmentService = _interopRequireDefault(require("services/data-handler-services/assessment-service"));

var _backbone = _interopRequireDefault(require("backbone"));

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _lodash = _interopRequireDefault(require("lodash"));

var _ef = _interopRequireDefault(require("ef/ef"));

var AssessmentService = function AssessmentService() {
this.savePartialAttempts = false;

this.triggerAssessment = function (blockView) {
var url = _assessmentService.default.getUrl(blockView.model.get('assessment_slug'));

if (url === undefined) {
blockView.readyToGo();

_chaplin.default.mediator.publish('page:navigate', 'forward');
} else {
setTimeout(_lodash.default.bind(function () {
_chaplin.default.mediator.publish('window:navigate', url);
}, this), 2000);
}
};

this.loadCourseAssessment = function (view) {
view.assessment = _assessmentService.default.getAssessment(view.model.get('assessment_slug'));

var failToLocal = _courseSettingsService.default.get('loadLocalAssessments');

view.assessment.set('subtext', view.model.get('subtext'));
return view.assessment.loadAssessment({
split_questions: Boolean(view.model.get('split_questions')),
failToLocal: failToLocal
});
};

this.userHasCompletedAssessment = function (courseSlug, mapping) {
return this.getActivityProgressForSlug(courseSlug, false, mapping).length > 0;
};

this.getBestScore = function (courseSlug, mapping) {
var attempts = this.getActivityProgressForSlug(courseSlug, true, mapping);

if (attempts.length === 0) {
return null;
} else {
return _lodash.default.max(attempts.map(function (attempt) {
return attempt.get('grade');
}));
}
};

this.getUrl = function (assessment) {
return _ef.default.url("/sdk/enrollments/".concat(_ef.default.enrollment.get('id'), "/assessments/").concat(assessment.get('slug'), ".json"));
};

this.isAttemptCorrect = function (results) {
return results.last_answer_correct;
};

this.isAttemptComplete = function (attempt) {
var questions = attempt.assessment.get('original_questions') || attempt.assessment.get('questions');
return questions.every(function (q) {
return !!attempt.get(q.get('id'));
});
};

this.isAttemptFinished = function (attempt) {
return attempt.get('state') === 'passed' || attempt.get('state') === 'failed';
};

this.parseAttempt = function (data) {
return data;
};

this.refreshActivityProgress = function () {
_ef.default.activityProgresses.fetch();
};

this.getAssessmentStatus = function (courseSlug, mapping) {
var attempts = this.getActivityProgressForSlug(courseSlug, true, mapping);

if (attempts.length === 0) {
return 'not-attempted';
}

if (_lodash.default.every(attempts, function (ap) {
return !ap.get('passed');
})) {
return 'failed';
}

if (_lodash.default.some(attempts, function (ap) {
return ap.get('passed');
})) {
return 'passed';
}
};

this.getAssessmentActivity = function (courseSlug, mapping) {
var activity = mapping[courseSlug];

if (activity) {
return activity;
} else {
console.warn('Invalid assessment mapping for slug: ', courseSlug); //eslint-disable-line no-console

console.warn('Here are the configured assessment mappings for reference: ', mapping); //eslint-disable-line no-console
}
};

this.getActivityProgressForSlug = function (courseSlug, includeFailed, mapping) {
if (_ef.default.options.local) {
return _ef.default.activityProgresses.filter(function (ap) {
return ap.get('slug') === courseSlug && (ap.get('passed') || includeFailed);
});
} else {
var activity = this.getAssessmentActivity(courseSlug, mapping);
return _ef.default.activityProgresses.filter(function (ap) {
return ap.get('activity_id') === activity.id && (ap.get('passed') || includeFailed);
});
}
};

this.getAttemptJSON = function (thisAttempt) {
return {
attempt: _backbone.default.Model.prototype.toJSON.apply(thisAttempt),
force_grading: thisAttempt.get('force_grading'),
data: {
id: thisAttempt.get('id'),
type: 'response_sets',
attributes: {
answers: [{
question_id: thisAttempt.get('current_question_id'),
value: thisAttempt.get(thisAttempt.get('current_question_id')),
response_type: 'single_selection'
}]
}
}
};
};
};

var _default = new AssessmentService();

exports.default = _default;
});

require.register("services/homeroom/course-module-service.js", function(exports, require, module) {
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var CourseModuleService = function CourseModuleService() {
this.saveModuleProgress = function (view, page, mod) {
this.saveModule(mod);
view.render();
};

this.saveModule = function (mod) {
mod.save();
};
};

var _default = new CourseModuleService();

exports.default = _default;
});

require.register("services/homeroom/customization-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _ef = _interopRequireDefault(require("ef/ef"));

var CustomizationService = function CustomizationService() {
this.getEFInitLoads = function (ef) {
return [ef.enrollment.loadData(), ef.customizations.fetch(), ef.program.fetch()];
};

this.getCustomizationCollectionUrl = function (self, ef) {
return ef.url("/sdk/enrollments/".concat(self.enrollment.get('id'), "/").concat(self.fileName));
};

this.parseCustomizationCollection = function (response) {
if (response) {
response.forEach(function (model) {
if (model) {
model.idAttribute = 'type';
}
});
}

return response;
};

this.load = function () {
return _ef.default.customizations.fetch();
};

this.getById = function (customizationCollection, id) {
var type = id.type || id;
return customizationCollection.findWhere(function (c) {
return c.get('type') === type;
});
};

this.findByType = function (customizationCollection, type) {
return customizationCollection.findWhere(function (c) {
return c.get('type') === type;
});
};

this.getCustomizationByKeyAndSlug = function (customizationCollection, key, slug) {
var collection = customizationCollection.findWhere(function (c) {
return c.get('type') === key;
});

if (collection) {
return collection.getBySlug(slug);
}
};

this.getByKeyAndPage = function (customizations, key, moduleKey, activityKey, pageKey) {
var collection = customizations.get(key);

if (collection) {
return collection.getByPage(moduleKey, activityKey, pageKey);
}
};
};

var _default = new CustomizationService();

exports.default = _default;
});

require.register("services/homeroom/enrollment-service.js", function(exports, require, module) {
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var EnrollmentService = function EnrollmentService() {
this.parseEnrollment = function (model, response) {
return response;
};

this.saveData = function (model, options, dataObj) {
if (dataObj.hasChanged()) {
dataObj.save(null, options);
}
};
};

var _default = new EnrollmentService();

exports.default = _default;
});

require.register("services/homeroom/homeroom-provider.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _assessmentService = _interopRequireDefault(require("./assessment-service"));

var _courseModuleService = _interopRequireDefault(require("./course-module-service"));

var _customizationService = _interopRequireDefault(require("./customization-service"));

var _enrollmentService = _interopRequireDefault(require("./enrollment-service"));

var _initializationService = _interopRequireDefault(require("./initialization-service"));

var _moduleService = _interopRequireDefault(require("./module-service"));

var _modulesCollectionService = _interopRequireDefault(require("./modules-collection-service"));

var _pageService = _interopRequireDefault(require("./page-service"));

var _pollService = _interopRequireDefault(require("./poll-service"));

var _progressService = _interopRequireDefault(require("./progress-service"));

var _siteService = _interopRequireDefault(require("./site-service"));

var _surveyService = _interopRequireDefault(require("./survey-service"));

var _resourceService = _interopRequireDefault(require("./resource-service"));

var HomeRoomProvider = {
AssessmentService: _assessmentService.default,
CourseModuleService: _courseModuleService.default,
CustomizationService: _customizationService.default,
EnrollmentService: _enrollmentService.default,
InitializationService: _initializationService.default,
ModuleService: _moduleService.default,
ModulesCollectionService: _modulesCollectionService.default,
PageService: _pageService.default,
PollService: _pollService.default,
ProgressService: _progressService.default,
SiteService: _siteService.default,
SurveyService: _surveyService.default,
ResourceService: _resourceService.default
};
var _default = HomeRoomProvider;
exports.default = _default;
});

require.register("services/homeroom/initialization-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _initializationService = _interopRequireDefault(require("services/course-handler-services/initialization-service"));

var InitializationService = /*#__PURE__*/function () {
function InitializationService() {
(0, _classCallCheck2.default)(this, InitializationService);
}

(0, _createClass2.default)(InitializationService, null, [{
key: "preload",
value: function preload() {
return Promise.resolve();
}
}, {
key: "load",
value: function load() {
return [_ef.default.enrollment.loadData(), _ef.default.program.fetch()];
}
}, {
key: "applyTransformations",
value: function applyTransformations(modulesJSON, modulesContentJson, groupsJSON) {
return _initializationService.default.applyTransformations(modulesJSON, modulesContentJson, groupsJSON);
}
}]);
return InitializationService;
}();

exports.default = InitializationService;
});

;require.register("services/homeroom/module-service.js", function(exports, require, module) {
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var ModuleService = function ModuleService() {
this.completePages = function (model) {
var lastPage = model.activities.last().pages.last();
model.setLastCompletedPage(lastPage);
model.applyModuleStatus();
model.set('completed', true);
};

this.markComplete = function (model) {
model.progress.markComplete();
};
};

var _default = new ModuleService();

exports.default = _default;
});

require.register("services/homeroom/modules-collection-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _ef = _interopRequireDefault(require("ef/ef"));

var _lodash = _interopRequireDefault(require("lodash"));

var ModulesCollectionService = function ModulesCollectionService() {
this.getModuleCollectionResponseData = function (response) {
return response;
};

this.getModuleCollectionModuleStatusByKey = function (modStatuses, key) {
return _lodash.default.find(modStatuses, {
module_key: key
});
};

this.getModuleCollectionUrl = function () {
return _ef.default.url("/sdk/enrollments/".concat(_ef.default.enrollment.get('id'), "/module_statuses.json"));
};
};

var _default = new ModulesCollectionService();

exports.default = _default;
});

require.register("services/homeroom/page-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _ef = _interopRequireDefault(require("ef/ef"));

var PageService = function PageService() {
this.saveProgress = function (blockView) {
_ef.default.module.save();
};
};

var _default = new PageService();

exports.default = _default;
});

require.register("services/homeroom/poll-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _toPromise = _interopRequireDefault(require("lib/to-promise"));

var _backbone = _interopRequireDefault(require("backbone"));

var _ef = _interopRequireDefault(require("ef/ef"));

var PollService = function PollService() {
this.renderPoll = function (blockView) {
if (_ef.default.options.local) {
var options = {
parse: true
};
blockView.poll.fetch(options).done(function () {
setProperties(blockView);
blockView.render();
});
} else {
blockView.render();
}
};

this.getUrl = function (model) {
var enrollmentId = _ef.default.enrollment.get('id');

return _ef.default.url("/sdk/enrollments/".concat(enrollmentId, "/poll.json"));
};

this.parse = function (response) {
return response;
};

this.save = function (model, options) {
if (_ef.default.options.local) {
return new Promise(function (resolve) {
var totals = getTotals(model);
model.set('totals', totals);

if (options && options.success) {
options.success({
totals: totals
});
}

resolve({
totals: totals
});
});
} else {
return (0, _toPromise.default)(_backbone.default.Model.prototype.save.apply(model));
}
};

var getTotals = function getTotals(model) {
return model.get('answers').map(function (a) {
return {
id: a.id,
count: Math.floor(Math.random() * (500 - 1) + 1)
};
});
};

var setProperties = function setProperties(blockView) {
blockView.poll.property('text', function () {
blockView.model.set('text', blockView.poll.get('text'));
});
blockView.poll.property('id', function () {
blockView.model.set('id', blockView.poll.get('id'));
});
blockView.poll.property('answers', function () {
blockView.model.set('answers', blockView.poll.get('answers'));
});
};
};

var _default = new PollService();

exports.default = _default;
});

require.register("services/homeroom/progress-service.js", function(exports, require, module) {
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var ProgressService = function ProgressService() {
this.saveProgress = function (model, page, cb) {
var act = typeof page.activity !== 'undefined';
var ind = typeof page.get('index') !== 'undefined';
var key = typeof page.get('key') !== 'undefined';

if (act && ind && key) {
model.get('module').setLastCompletedPage(page);
}

if (cb) {
cb();
}
};

this.getPath = function (eid) {
return "/sdk/enrollments/".concat(eid, "/page_progresses.json");
};

this.getRequestOptions = function (request) {
return {
dataType: 'json',
type: 'POST',
url: request.url,
data: request.data
};
};

this.saveActivityProgress = function (model, grade, attempt, slug) {
model.saveActivityProgress(grade, attempt, slug);
};
};

var _default = new ProgressService();

exports.default = _default;
});

require.register("services/homeroom/resource-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _toPromise = _interopRequireDefault(require("lib/to-promise"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _webStorageService = require("services/data-handler-services/web-storage-service");

var _utils = _interopRequireDefault(require("lib/utils"));

var ResourceService = function ResourceService() {
this.getResources = function (resourceType, resourceSubType) {
// note resourceSubType is actually the slug
_ef.default.resources.forEach(function (resource) {
if (!resource.get('signed')) {
var id = resource.get('id');
var policyId = parseInt(id.substr(id.indexOf('-') + 1));

var signed = _webStorageService.LocalStorageService.getItem("".concat(policyId, "---signed"));

resource.set('signed', signed ? true : false);
}
});

return (0, _toPromise.default)(_ef.default.resources.byType(resourceType, resourceSubType));
};

this.loadResources = function () {
return (0, _toPromise.default)(_ef.default.resources.fetch());
};

this.save = function (resourceItem) {
_webStorageService.LocalStorageService.setItem("".concat(resourceItem.id, "---signed"), true);

return resourceItem.save().then(function (response) {
return _utils.default.httpErrorHandler(response, _ef.default.resources.checkIfAllResourcesSigned(resourceItem === null || resourceItem === void 0 ? void 0 : resourceItem.get('sub_type')));
});
};
};

var _default = new ResourceService();

exports.default = _default;
});

require.register("services/homeroom/site-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _ef = _interopRequireDefault(require("ef/ef"));

var _lodash = _interopRequireDefault(require("lodash"));

var _jquery = _interopRequireDefault(require("jquery"));

var SiteService = function SiteService() {
this.addSponsorClass = function () {
_ef.default.program.fetch().done(function () {
_lodash.default.each(_ef.default.program.get('sponsorships'), function (sponsor) {
(0, _jquery.default)('body').addClass(sponsor.slug);
});
});
};
};

var _default = new SiteService();

exports.default = _default;
});

require.register("services/homeroom/survey-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _surveyService = _interopRequireDefault(require("services/data-handler-services/survey-service"));

var _lodash = _interopRequireDefault(require("lodash"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var SurveyService = function SurveyService() {
this.triggerSurvey = function (blockView) {
var url = _surveyService.default.surveyUrl(blockView.model.get('slug'), blockView.model.get('return_hash'));

if (url === undefined) {
console.warn('No Survey url');
} else {
setTimeout(_lodash.default.bind(function () {
_chaplin.default.mediator.publish('window:navigate', url);
}, this), 2000);
}
};

this.userHasCompletedSurvey = function (courseSlug) {
return !!_surveyService.default.getActivityProgressForSlug(courseSlug);
};

this.getSurvey = function (blockView) {
return blockView.model.get('survey').fetch({
error: function error(err) {
console.error('Error fetching survey: ', err);
},
success: function success() {
setSections(blockView.model);
blockView.model.get('survey').initResponseSet({
success: function success(responseSet) {
blockView.model.set('responseSet', responseSet);
blockView.render();
}
});
}
});
};

this.saveSurveyResponse = function (blockView, dataset, options) {
var responseSet = blockView.model.get('responseSet');

if (options && options.multipleQuestion) {
responseSet.answerQuestions(dataset);
} else {
responseSet.answerQuestion(dataset.questionId, dataset.answerId);
}

return responseSet.save();
};

this.refreshResponseSet = function () {};

var setSections = function setSections(model) {
var survey = model.get('survey');
var sections = survey.sections.models;
sections.forEach(function (section) {
section.questions = section.get('questions');
});
survey.set('sections', sections);
};
};

var _default = new SurveyService();

exports.default = _default;
});

require.register("services/index.js", function(exports, require, module) {
"use strict";

require("services/browser-handler-services/timeout-service");

require("services/browser-handler-services/user-agent-service");

require("services/content-provider");

require("services/content-service/assessment-service");

require("services/content-service/content-service-provider");

require("services/content-service/course-module-service");

require("services/content-service/customization-service");

require("services/content-service/enrollment-service");

require("services/content-service/initialization-service");

require("services/content-service/module-service");

require("services/content-service/modules-collection-service");

require("services/content-service/page-service");

require("services/content-service/poll-service");

require("services/content-service/progress-service");

require("services/content-service/resource-service");

require("services/content-service/site-service");

require("services/content-service/survey-service");

require("services/course-handler-services/course-settings-service");

require("services/course-handler-services/custom-page-service");

require("services/course-handler-services/feedback-service");

require("services/course-handler-services/initialization-service");

require("services/course-handler-services/learner-profile-service");

require("services/course-handler-services/menu-service");

require("services/course-handler-services/navigation-service");

require("services/course-handler-services/page-timer-service");

require("services/course-handler-services/progress-service");

require("services/course-handler-services/score-service");

require("services/course-handler-services/timer-service");

require("services/course-handler-services/audio-service-howler");

require("services/data-handler-services/ahoy-service");

require("services/data-handler-services/assessment-service");

require("services/data-handler-services/enrollment-data-service");

require("services/data-handler-services/evaluation-service");

require("services/data-handler-services/web-storage-service");

require("services/data-handler-services/portfolio-service");

require("services/data-handler-services/survey-service");

require("services/data-handler-services/sync-service");

require("services/event-handler-services/animation-service");

require("services/event-handler-services/hyperlink-service");

require("services/event-handler-services/drag-and-drop-keyboard-service");

require("services/event-handler-services/keybinding-service");

require("services/event-handler-services/sizing-service");

require("services/event-handler-services/focus-service");

require("services/homeroom/assessment-service");

require("services/homeroom/course-module-service");

require("services/homeroom/customization-service");

require("services/homeroom/enrollment-service");

require("services/homeroom/homeroom-provider");

require("services/homeroom/initialization-service");

require("services/homeroom/module-service");

require("services/homeroom/modules-collection-service");

require("services/homeroom/page-service");

require("services/homeroom/poll-service");

require("services/homeroom/progress-service");

require("services/homeroom/resource-service");

require("services/homeroom/site-service");

require("services/homeroom/survey-service");

require("services/loader-handler-services/tippy-loader-service");

require("services/loader-handler-services/async-block-service");

require("services/loader-handler-services/async-script-service");

require("services/loader-handler-services/atom-loader");

require("services/loader-handler-services/content-service");

require("services/loader-handler-services/icon-load-service");

require("services/loader-handler-services/load-service");

require("services/loader-handler-services/locale-service");

require("services/loader-handler-services/html-import-service");

require("services/page-service");

require("services/services-initializer");

require("services/timer/countdown-timer");

require("services/timer/course-timer-service");

require("services/timer/event-manager");

require("services/timer/timer");

require("services/error-handler-service/error");

require("services/error-handler-service/handler");

require("services/error-handler-service/logger");
});

require.register("services/loader-handler-services/async-block-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _asyncScriptService = _interopRequireDefault(require("services/loader-handler-services/async-script-service"));

var _utils = _interopRequireDefault(require("lib/utils"));

var AsyncBlockService = /*#__PURE__*/function () {
function AsyncBlockService() {
(0, _classCallCheck2.default)(this, AsyncBlockService);
}

(0, _createClass2.default)(AsyncBlockService, null, [{
key: "load",
value: function load(names, requireables) {
if (!Array.isArray(names) && names) {
names = [names];
}

return _asyncScriptService.default.load(names.map(function (name) {
return {
http: _utils.default.coursePath("javascripts/blocks/".concat(name, ".js")),
require: "views/block/".concat(name, "/").concat(name, "-view")
};
}), requireables);
}
}]);
return AsyncBlockService;
}();

exports.default = AsyncBlockService;
});

;require.register("services/loader-handler-services/async-script-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var promises = {};

var AsyncScriptService = /*#__PURE__*/function () {
function AsyncScriptService() {
(0, _classCallCheck2.default)(this, AsyncScriptService);
}

(0, _createClass2.default)(AsyncScriptService, null, [{
key: "load",
value: function load(paths, requirables) {
var pathsArr = paths && [].concat(paths);
var requirablesArr = requirables && [].concat(requirables);

var requireable = window.require.list();

var queue = [];
pathsArr.forEach(function (path) {
// path example: { http: 'javascripts/blocks/modal.js', require: 'views/block/modal-view'}
var scriptTag = document.querySelector("script[src=\"".concat(path.http, "\"]"));

if (requireable.includes(path.require)) {
// Note: this fake promise must be here to preserve the order of the arguments
return queue.push(Promise.resolve(path));
}

if (scriptTag === null) {
var script = document.createElement('script');
script.src = path.http;
script.async = path.async || false;
promises[path.http] = new Promise(function (resolve) {
script.onload = function (e) {
path.event = e;
resolve(path);
};
});
queue.push(promises[path.http]);
document.body.appendChild(script);
} else {
//if script tag is present, we should have a promise available
queue.push(promises[path.http]);
}
}); // Note Promise.all preserves order, this is important for the arguments to line up

return Promise.all(queue).then(function (loaded) {
var hasRequirables = requirablesArr && requirablesArr.length;
var pathArr = hasRequirables ? requirablesArr : loaded;
return Promise.resolve(pathArr.map(function (path) {
var required = window.require(hasRequirables ? path : path.require);

return required.default ? required.default : required;
}));
});
}
}]);
return AsyncScriptService;
}();

exports.default = AsyncScriptService;
});

;require.register("services/loader-handler-services/atom-loader.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));

var _atomsModule = _interopRequireDefault(require("views/atoms/atoms-module"));

var _runtime = _interopRequireDefault(require("handlebars/runtime"));

var _lodash = _interopRequireDefault(require("lodash"));

var AtomLoader = {
atoms: _atomsModule.default,
configWhitelist: ['cid', 'atom', 'classes', 'txt', 'beforeContent', 'afterContent', 'required', 'disabled', 'blocksRegion', 'iconBefore', 'iconAfter', 'contentInjection'],
loadAtomRegions: function loadAtomRegions(el) {
var _this = this;

var r = [];
var atomElements = el.querySelectorAll('[data-atom]');
(0, _toConsumableArray2.default)(atomElements).forEach(function (element) {
var config = element.dataset || {};
r = [].concat((0, _toConsumableArray2.default)(r), [{
get: function get() {
return Object.assign(config, {
cid: element.id
});
},
clean: function clean() {
_this.cleanDataAtom(element, config);
}
}]);
});
return r;
},
cleanDataAtom: function cleanDataAtom(el) {
var dataAttrs = ['data-aria-label', 'data-content', 'data-close'];

for (var _i = 0, _dataAttrs = dataAttrs; _i < _dataAttrs.length; _i++) {
var dataAttr = _dataAttrs[_i];

if (el.hasAttribute(dataAttr)) {
el.removeAttribute(dataAttr);
}
}
},
setAtomConfig: function setAtomConfig(c, el) {
var _this2 = this;

var config = {};
Object.keys(c).filter(function (key) {
return _this2.configWhitelist.indexOf(key) !== -1;
}).forEach(function (key) {
config[key] = c[key];
});

if (config.contentInjection === 'true') {
this.setcontentInjection(config, el);
}

return config;
},
setAtomAttributes: function setAtomAttributes(a) {
var _this3 = this;

var att = '';
Object.keys(a).filter(function (key) {
return _this3.configWhitelist.indexOf(key) === -1;
}).forEach(function (k) {
att += "".concat(_lodash.default.kebabCase(k), "=\"").concat(a[k], "\" ");
});
return new _runtime.default.SafeString(att);
},
setcontentInjection: function setcontentInjection(config, el) {
var injectionElement = el.querySelector("#".concat(config.cid));
config.injectedContent = injectionElement.innerHTML.toString();
var nodes = injectionElement.childNodes;

for (var n = nodes.length - 1; n > -1; n--) {
nodes[n].parentElement.removeChild(nodes[n]);
}
}
};
var _default = AtomLoader;
exports.default = _default;
});

require.register("services/loader-handler-services/content-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));

var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _asyncBlockService = _interopRequireDefault(require("services/loader-handler-services/async-block-service"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _backbone = _interopRequireDefault(require("backbone"));

var _block = _interopRequireDefault(require("models/block"));

var _block_collection = _interopRequireDefault(require("collections/block_collection"));

var _utils = _interopRequireDefault(require("lib/utils"));

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var _loadService = _interopRequireDefault(require("services/loader-handler-services/load-service"));

var _localeService = _interopRequireDefault(require("services/loader-handler-services/locale-service"));

var _lodash = _interopRequireDefault(require("lodash"));

var ContentService = function ContentService() {
var _this7 = this;

if (ContentService.prototype._singleton) {
return ContentService.prototype._singleton;
}

ContentService.prototype._singleton = this;
this.files = {
_groups: './content/groups.json',
_modules: './content/modules.json',
_moduleContent: './content/module-content.json'
};

this.initialize = function () {
var _this = this;

var split = _courseSettingsService.default.get('split_module');

if (split) {
this.files._modules = "./modules/".concat(split, "/content/module.json");
this.files._moduleContent = "./modules/".concat(split, "/content/module-content.json");
}

return _loadService.default.load(this.files).then(function (data) {
Object.defineProperty(_this, 'groups', {
get: function get() {
return data._groups;
}
});
Object.defineProperty(_this, 'modules', {
get: function get() {
return data._modules;
}
});
Object.defineProperty(_this, 'moduleContent', {
get: function get() {
return data._moduleContent;
}
});
});
};

this.applyPageContent = function (page) {
var _this2 = this;

var m, a, p;
var linkedPage = page.get('link');

if (linkedPage) {
var _ref = [linkedPage.module, linkedPage.activity, linkedPage.page];
m = _ref[0];
a = _ref[1];
p = _ref[2];
} else {
var _ref2 = [page.module.get('key'), page.activity.get('key'), page.get('key')];
m = _ref2[0];
a = _ref2[1];
p = _ref2[2];
}

return this.applyContentAndLocale(page, "".concat(m, ".").concat(a, ".").concat(p)).then(function () {
_this2.addForgePathsToPage(page);

return Promise.resolve(page);
});
};

this.addForgePathsToContentRegion = function (regionName, region) {
var _this3 = this;

if (_ef.default.forgeMode && region) {
// Precaution for deeply nested region objects
Object.entries(region).forEach(function (_ref3) {
var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
key = _ref4[0],
value = _ref4[1];

if (key === 'blocks') {
return _this3.addPaths(regionName, region);
}

_this3.addForgePathsToContentRegion(regionName, value);
});
}
};

this.traverseBlocks = function (obj, path, contentRegion) {
for (var i in obj) {
if (obj[i] !== null && (0, _typeof2.default)(obj[i]) === 'object') {
if (path[path.length - 1] === 'blocks') {
obj[i].forge_path = "".concat(path.join(), ",").concat(i);
obj[i].content_region = contentRegion;
}

var newpath = !_utils.default.isEmpty(path) ? (0, _toConsumableArray2.default)(path) : [];
newpath.push(i);

if (i === 'blocks') {
obj[i].forge_path = newpath.join();
}

this.traverseBlocks(obj[i], newpath, contentRegion);
}
}
};

this.addForgePathsToPage = function (page) {
var _this4 = this;

var contentRegion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '#page-container';

if (_ef.default.forgeMode && page) {
page.get('blocks').forge_path = 'blocks';
page.get('blocks').models.forEach(function (pageBlock, idx) {
pageBlock.attributes.forge_path = "blocks,".concat(idx);
pageBlock.attributes.content_region = contentRegion;

_this4.traverseBlocks(pageBlock.attributes, ['blocks', idx], contentRegion);
});
}
};

this.applyContentAndLocale = function (container, path) {
var subView = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
return this.applyContent(container, path).then(function (containerParam) {
_localeService.default.addDefaultResources(path, subView);

return Promise.resolve(containerParam);
});
};

this.applyDirectPageContent = function (page, content) {
var _this5 = this;

return this.buildBlockCollection(content && content.blocks).then(function (blocks) {
if (content && content.blocks) {
content.blocks = blocks;
}

page.set(content);

_this5.reloadPageContentInPlace(page);
});
};

this.reloadPageContentInPlace = function (page) {
if (_ef.default.forgeMode) {
this.addForgePathsToPage(page);
}
};

this.applyContent = function (container, path) {
// Deep clone, so that the original source is not mutated
// This was causing some of the translations, to get translated twice and spit out error text
var content = _lodash.default.cloneDeep(_utils.default.dotStringToObject(path, this.moduleContent));

return this.buildBlockCollection(content && content.blocks).then(function (blocks) {
if (content && content.blocks) {
content.blocks = blocks;
}

container.set(content);
return Promise.resolve(container);
});
};

this.buildBlockCollection = function (rawBlocks) {
var _this6 = this;

if (!rawBlocks) {
return new Promise(function (resolve) {
return resolve();
});
}

return _asyncBlockService.default.load(rawBlocks.map(function (b) {
return b.type || b.get('type');
})).then(function () {
return Promise.resolve(rawBlocks instanceof _backbone.default.Collection ? rawBlocks : new _block_collection.default(rawBlocks.map(function (block) {
if (typeof block === 'string' && _this6.moduleContent['base-blocks'] !== undefined) {
block = _this6.moduleContent['base-blocks'][block];
}

if (_this6.blockAvailable(block)) {
return new _block.default(block);
}
}).filter(function (b) {
return b !== undefined;
})));
});
};

this.blockAvailable = function (block) {
var available = true;

if (block.completed_modules_required) {
available = block.completed_modules_required <= _ef.default.modules.completedModuleCount();
}

if (available && block.certified !== undefined) {
available = block.certified === Boolean(_ef.default.enrollment.get('certified'));
}

if (available && block.fullSCORM !== undefined) {
available = block.fullSCORM === Boolean(_ef.default.config.get('fullSCORM'));
}

return available;
};

this.addPaths = function (regionName, region) {
region.blocks.forEach(function (block, index) {
block.forge_path = "blocks,".concat(index);
block.content_region = regionName;

_this7.traverseBlocks(block, ['blocks', index], regionName);
});
};
};

var _default = new ContentService();

exports.default = _default;
});

require.register("services/loader-handler-services/html-import-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _localeService = _interopRequireDefault(require("services/loader-handler-services/locale-service"));

var _learnerProfileService = _interopRequireDefault(require("services/course-handler-services/learner-profile-service"));

var _urlSearchParams = _interopRequireDefault(require("url-search-params"));

require("@webcomponents/html-imports");

var HtmlImportService = /*#__PURE__*/function () {
function HtmlImportService() {
(0, _classCallCheck2.default)(this, HtmlImportService);
}

(0, _createClass2.default)(HtmlImportService, [{
key: "getHtml",
value: function getHtml(_ref) {
var path = _ref.path,
url = _ref.url;

if (!path) {
return Promise.reject('No Path provided');
}

var finalUrl = this.parsePath({
path: path,
url: url
});
return fetch(finalUrl).then(function (data) {
return data.text();
});
}
}, {
key: "parsePath",
value: function parsePath(_ref2) {
var path = _ref2.path,
url = _ref2.url;
var finalUrl = url;

if (path && !finalUrl) {
finalUrl = "https://s3.amazonaws.com/everfi-curriculums/content/{{version}}/".concat(path);
}

var params = new _urlSearchParams.default(window.location);
/* istanbul ignore if: can't modify window location */

if (params && params.get('html_import_version')) {
finalUrl = finalUrl.replace(/{{version}}/, params.get('html_import_version'));
} else if (_ef.default.options.local) {
finalUrl = finalUrl.replace(/{{version}}/, 'develop');
} else {
finalUrl = finalUrl.replace(/{{version}}/, 'master');
}

finalUrl = finalUrl.replace(/{{language}}/, _localeService.default.getLanguage());

var isoCode = _learnerProfileService.default.get('learner_location_iso_code');

if (isoCode && isoCode.includes('-')) {
var _isoCode$split = isoCode.split('-'),
_isoCode$split2 = (0, _slicedToArray2.default)(_isoCode$split, 2),
country = _isoCode$split2[0],
region = _isoCode$split2[1];

if (country) {
finalUrl = finalUrl.replace(/{{country}}/, country.toLowerCase());
}

if (region) {
finalUrl = finalUrl.replace(/{{region}}/, region.toLowerCase());
}
}

return finalUrl;
}
}]);
return HtmlImportService;
}();

var _default = new HtmlImportService();

exports.default = _default;
});

require.register("services/loader-handler-services/icon-load-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _asyncScriptService = _interopRequireDefault(require("services/loader-handler-services/async-script-service"));

var _utils = _interopRequireDefault(require("lib/utils"));

var _fontawesomeSvgCore = require("@fortawesome/fontawesome-svg-core");

var _lodash = require("lodash");

var _faMetadata = _interopRequireDefault(require("lib/fa-metadata"));

/*
This service is the place where fontAwesome icons are suggested to be called in a Async way and loaded via the
fontAwesome API
more info : https://fontawesome.com/how-to-use/with-the-api/

methods:
the configFontAwesome method add aply th configs passed in a dinamyc way,
applying the properties that the svg-core
use: https://fontawesome.com/how-to-use/with-the-api/setup/configuration
*/
var IconLoadService = {
// Basic fontAwesomeApi config
defaultStyle: 'far',
configFontAwesome: function configFontAwesome(properties) {
for (var key in properties) {
if (Object.prototype.hasOwnProperty.call(_fontawesomeSvgCore.config, key)) {
_fontawesomeSvgCore.config[key] = properties[key];
} else {
console.error("the property ".concat(key, " is not available as a fontAwesomeAPI property check it at \n https://fontawesome.com/how-to-use/with-the-api/setup/configuration"));
}
}
},
formatIconUrl: function formatIconUrl(prefix, iconName) {
var packIconName = iconName && iconName.startsWith('fa-') ? iconName.replace(/^fa-/, '') : iconName;
var icon = _faMetadata.default[prefix].includes(packIconName) || _faMetadata.default['far'].includes(packIconName) || _faMetadata.default['fal'].includes(packIconName) || _faMetadata.default['fas'].includes(packIconName) || undefined;

if (!icon) {
console.error("error with ".concat(prefix, ", only available properties are Solid(fas), \n regular(far), \n light(fal) \n and brand(fab),"));
return;
}

var faIconDirs = {
far: 'pro-regular-svg-icons',
fal: 'pro-light-svg-icons',
fas: 'pro-solid-svg-icons'
};
var curatedIconName = (0, _lodash.camelCase)(iconName);
return {
http: _utils.default.coursePath("javascripts/fontawesome/".concat(faIconDirs[prefix], "/").concat(curatedIconName, ".js")),
require: "@fortawesome/".concat(faIconDirs[prefix], "/").concat(curatedIconName, ".js")
};
},
returnIconAsString: function returnIconAsString(iconPrefix, iconName) {
var urlIcon = this.formatIconUrl(iconPrefix, iconName);
return _asyncScriptService.default.load(urlIcon).then(function (_ref) {
var _ref2 = (0, _slicedToArray2.default)(_ref, 1),
iconElem = _ref2[0];

var iconSvg = (0, _fontawesomeSvgCore.icon)(iconElem.definition);
return iconSvg.node[0];
}).catch(function (err) {
return console.error(err);
});
},
applyIconList: function applyIconList(iconArr) {
var _this = this;

iconArr.forEach(function (_ref3) {
var icon_prefix = _ref3.icon_prefix,
icon_name = _ref3.icon_name,
index_id = _ref3.index_id,
icon_class = _ref3.icon_class;

_this.applyIcon(icon_name, index_id, icon_class, icon_prefix);
});
},
applyIcon: function applyIcon(iconName, iconId, customClasses) {
var _this2 = this;

var optionalPrefix = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;

var _this$setPrefixAndNam = this.setPrefixAndName(iconName, optionalPrefix),
name = _this$setPrefixAndNam.name,
prefix = _this$setPrefixAndNam.prefix;

try {
var urlIcon = this.formatIconUrl(prefix, name);

_asyncScriptService.default.load(urlIcon).then(function (_ref4) {
var _ref5 = (0, _slicedToArray2.default)(_ref4, 1),
iconElem = _ref5[0];

var propsIcon = {
classes: []
};

if (customClasses) {
if (typeof customClasses === 'string') {
propsIcon.classes.push(customClasses);
} else if (Array.isArray(customClasses)) {
customClasses.forEach(function (element) {
propsIcon.classes.push(element);
});
}
}

var iconSvg = (0, _fontawesomeSvgCore.icon)(iconElem.definition, propsIcon);

try {
var iconParent = document.querySelector("[data-icon=\"".concat(iconId, "-").concat(prefix, " ").concat(name, "\"]"));

if (iconParent && _this2.isIconParentEmpty(iconParent)) {
iconParent.appendChild(iconSvg.node[0]);
}
} catch (e) {
console.error("Could not apply icon \"".concat(iconId, "-").concat(prefix, " ").concat(name, "\" by id"), e);
}
});
} catch (ex) {
console.error('Icon could not be loaded', ex);
}
},
isIconParentEmpty: function isIconParentEmpty(iconParent) {
// to prevent adding multiple icons in the same parent container
var children = iconParent.children,
childElementCount = iconParent.childElementCount;
var srContent = childElementCount === 1 && children[0].classList.contains('screen-reader-content');
return childElementCount === 0 || srContent;
},
stackIcons: function stackIcons(icons, iconId) {
var _this3 = this;

var iconsUrl = [];
var iconsClasses = {};
var iconTransforms = {};
icons.forEach(function (elem) {
iconsUrl.push(_this3.formatIconUrl(elem.prefix, elem.name));

if (Object.prototype.hasOwnProperty.call(elem, 'classes')) {
iconsClasses["".concat(elem.prefix, "-").concat(elem.name)] = elem.classes.split(' ');
}

if (Object.prototype.hasOwnProperty.call(elem, 'transforms')) {
iconTransforms["".concat(elem.prefix, "-").concat(elem.name)] = _fontawesomeSvgCore.parse.transform(elem.transforms);
}
});

_asyncScriptService.default.load(iconsUrl).then(function (response) {
var htmlElem = (0, _fontawesomeSvgCore.layer)(function (push) {
response.forEach(function (elem) {
var classMapper = "".concat(elem.definition.prefix, "-fa-").concat(elem.definition.iconName);
var classes = Object.prototype.hasOwnProperty.call(iconsClasses, classMapper) ? iconsClasses[classMapper] : [];
var transforms = Object.prototype.hasOwnProperty.call(iconTransforms, classMapper) ? iconTransforms[classMapper] : {};
push((0, _fontawesomeSvgCore.icon)(elem.definition, {
classes: classes,
transform: transforms
}));
});
});

try {
var iconParent = document.getElementById(iconId);

if (iconParent && _this3.isIconParentEmpty(iconParent)) {
iconParent.appendChild(htmlElem.node[0]);
}
} catch (e) {
console.warn('Could not load icon by id', e);
}
});
},
setPrefixAndName: function setPrefixAndName(iconName) {
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

if (prefix) {
if (iconName.indexOf(' ') !== -1) {
iconName = iconName.split(' ').pop();
}

return {
prefix: prefix,
name: iconName
};
} else {
var _ref6 = iconName.split(' ').length > 1 ? iconName.split(' ') : [this.defaultStyle, iconName],
_ref7 = (0, _slicedToArray2.default)(_ref6, 2),
_prefix = _ref7[0],
name = _ref7[1];

return {
prefix: _prefix,
name: name
};
}
}
};
var _default = IconLoadService;
exports.default = _default;
});

require.register("services/loader-handler-services/load-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _utils = _interopRequireDefault(require("lib/utils"));

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

var LoadService = /*#__PURE__*/function () {
function LoadService() {
(0, _classCallCheck2.default)(this, LoadService);
}

(0, _createClass2.default)(LoadService, null, [{
key: "load",
value: function () {
var _load = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(files) {
var fileEntries, _fileEntries$, key, path, promises;

return _regenerator.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.prev = 0;
fileEntries = Object.entries(files);

if (!(fileEntries.length === 1)) {
_context.next = 5;
break;
}

_fileEntries$ = (0, _slicedToArray2.default)(fileEntries[0], 2), key = _fileEntries$[0], path = _fileEntries$[1];
return _context.abrupt("return", LoadService.getRequestFromPath(path, key));

case 5:
promises = [];
fileEntries.forEach(function (_ref) {
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
key = _ref2[0],
path = _ref2[1];

var request = LoadService.getRequestFromPath(path, key);
promises.push(request);
});
return _context.abrupt("return", Promise.all(promises).then(function (resolvedPromises) {
return resolvedPromises.reduce(function (prev, data) {
return _objectSpread(_objectSpread({}, prev), data);
}, {});
}));

case 10:
_context.prev = 10;
_context.t0 = _context["catch"](0);
console.error(_context.t0);

case 13:
case "end":
return _context.stop();
}
}
}, _callee, null, [[0, 10]]);
}));

function load(_x) {
return _load.apply(this, arguments);
}

return load;
}()
}, {
key: "getRequestFromPath",
value: function getRequestFromPath(path, key) {
var url = _utils.default.coursePath(path);

return fetch(url).then(function (v) {
return v.json();
}).then(function (data) {
return key ? (0, _defineProperty2.default)({}, key, data) : data;
}).catch(function (err) {
console.error("Load Service failed at fetch: ".concat(err)); // Returning key undefined to show unsuccessful result

return (0, _defineProperty2.default)({}, key, undefined);
});
}
}]);
return LoadService;
}();

var _default = LoadService;
exports.default = _default;
});

require.register("services/loader-handler-services/locale-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _loadService = _interopRequireDefault(require("services/loader-handler-services/load-service"));

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var _enrollmentDataService = _interopRequireDefault(require("services/data-handler-services/enrollment-data-service"));

var _webStorageService = require("services/data-handler-services/web-storage-service");

var _utils = _interopRequireDefault(require("lib/utils"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _pseudoLocalization = require("pseudo-localization");

var _i18next = _interopRequireDefault(require("i18next"));

var _i18nextBrowserLanguagedetector = _interopRequireDefault(require("i18next-browser-languagedetector"));

var _lodash = _interopRequireDefault(require("lodash"));

var LocaleService = function LocaleService() {
if (LocaleService.prototype._singleton) {
return LocaleService.prototype._singleton;
}

LocaleService.prototype._singleton = this;
this.files = {
_localeContent: './content/locales/{{locale}}.json',
_langContent: './content/locales/{{lang}}.json'
};
this.fallbackNSes = ['course', 'sdk'];
this.moduleNS = null;

this.initialize = function (options) {
var _this = this;

return new Promise(function (resolve, reject) {
var split = _courseSettingsService.default.get('split_module');

_this.courseSupLanguages = _courseSettingsService.default.get('supported_languages');
_this.fallbackLng = 'en';
_this.files = {};
_this.filePaths = {
_localeContent: split ? "./modules/".concat(split, "/locales/{{locale}}.json") : './content/locales/{{locale}}.json',
_langContent: split ? "./modules/".concat(split, "/locales/{{lang}}.json") : './content/locales/{{lang}}.json'
}; // Check if the options language is set up, format it if it is declared with other nomenclature
// otherwise it will be undefined and use the fallback declared on the i18next object

if (options.lng && !_this.courseSupLanguages.includes(options.lng)) {
if (options.lng.indexOf('-') === 2) {
options.lng = _this.courseSupLanguages.includes(options.lng.substring(0, 2)) ? options.lng.substring(0, 2) : undefined;
} else {
options.lng = undefined;
}
}

var i18nextOptions = _lodash.default.defaults({
fallbackLng: _this.fallbackLng,
fallbackNS: _this.fallbackNSes,
keySeparator: '.',
nsSeparator: '<|>',
detection: {
order: ['querystring', 'cookie', 'localStorage', 'navigator', 'htmlTag'],
lookupQuerystring: 'setLng',
lookupCookie: 'i18next',
lookupLocalStorage: 'i18nextLng'
},
supportedLngs: _this.courseSupLanguages,
interpolationPrefix: '{{',
interpolationSuffix: '}}',
customLoad: function customLoad(lng, ns, options, loadComplete) {
//we're loading the files ourselves, don't need i18next to do it;
// can't find another way of turning this off...
loadComplete(null, null);
}
}, options);

_i18next.default.use(_i18nextBrowserLanguagedetector.default).init(i18nextOptions, function () {
var i18nextLang = _i18next.default.language;

_this.setFileConfigData(i18nextLang);

_this.loadLanguageFileData(_this.files).then(resolve).catch(function () {
_this.setFileConfigData(_this.fallbackLng);

_this.loadLanguageFileData(_this.files).then(function () {
// eslint-disable-next-line no-console
console.info('Fallback language loaded successfully');
resolve();
}).catch(function () {
var errMessage = "Couldn't load the fallback language"; // eslint-disable-next-line no-console

console.info(errMessage);
reject(errMessage);
});

throw Error("Couldn't load the desired language");
}).catch(function (_ref) {
var message = _ref.message;
// eslint-disable-next-line no-console
console.info(message);
});
});
});
};

this.setFileConfigData = function (i18nextLang) {
if (i18nextLang.indexOf('-') === 2) {
this.lang = i18nextLang.substring(0, 2);
this.locale = i18nextLang;
this.files._localeContent = this.filePaths._localeContent.replace('{{locale}}', this.locale);
} else {
this.lang = i18nextLang;
this.locale = undefined;
delete this.files._localeContent;
}

this.files._langContent = this.filePaths._langContent.replace('{{lang}}', this.lang);

if (i18nextLang !== 'en') {
this.files._enContent = './content/locales/en.json';
}
};

this.loadLanguageFileData = function (filesConfig) {
var _this2 = this;

return _loadService.default.load(filesConfig).then(function (data) {
Object.defineProperty(_this2, 'localeContent', {
get: function get() {
return data._localeContent;
}
});
Object.defineProperty(_this2, 'langContent', {
get: function get() {
return data._langContent;
}
});
Object.defineProperty(_this2, 'enContent', {
get: function get() {
return data._enContent;
}
});

_lodash.default.each(_this2.fallbackNSes, function (ns) {
_this2.addResources(ns);
});
});
};

this.addDefaultResources = function (namespace, subView) {
var prefix = _enrollmentDataService.default.getData('locale:namespace:prefix');

var prefixedNameSpace = prefix ? "".concat(prefix, "|").concat(namespace) : namespace;
this.addResources(namespace);

if (prefix) {
this.addResources(prefixedNameSpace);
}

if (this.moduleNS) {
if (!subView) {
if (prefix) {
_i18next.default.options.fallbackNS = [prefixedNameSpace, namespace].concat([this.moduleNS].concat(this.fallbackNSes));
} else {
_i18next.default.options.fallbackNS = [namespace].concat([this.moduleNS].concat(this.fallbackNSes));
}
} else if (_i18next.default.options.fallbackNS.indexOf(namespace) === -1) {
_i18next.default.options.fallbackNS = [namespace].concat(_i18next.default.options.fallbackNS);
}
}

if (!subView) {
_i18next.default.setDefaultNamespace(prefixedNameSpace);
}
};

this.setLocaleNamespacePrefix = function (prefix) {
_enrollmentDataService.default.saveData('locale:namespace:prefix', prefix);
};

this.setModuleResources = function (moduleKey) {
var ns = "".concat(moduleKey, ".defaults");
this.addResources(ns);
this.moduleNS = ns; //overwrite other fallbacks when starting a new module

_i18next.default.options.fallbackNS = [ns].concat(this.fallbackNSes);
};

this.addResources = function (namespace) {
//en should always be present
if (!_i18next.default.hasResourceBundle('en', namespace)) {
this.addResource(this.lang, namespace, this.langContent);

if (this.locale) {
this.addResource(this.locale, namespace, this.localeContent);
}

if (_i18next.default.language !== 'en') {
this.addResource('en', namespace, this.enContent);
}
}
};

this.currentNamespace = function () {
return _i18next.default.options.defaultNS;
};

this.addResource = function (lang, namespace, content) {
var resource = _utils.default.dotStringToObject(namespace, content);

_i18next.default.addResourceBundle(lang, namespace, resource);
};

this.shouldPseudoLocalize = function (key, data) {
if (_lodash.default.isNil(key) || !_ef.default.urlHelper) {
return false;
}

return _ef.default.urlHelper.getParam('pseudoLocalize', false) && _i18next.default.exists(String(key), data);
};

this.t = function (key, options) {
var sessionData = _webStorageService.SessionStorageService.getAll();

var model = _courseSettingsService.default.getModel();

var courseData = model ? model.toJSON() : {};

var data = _lodash.default.extend(sessionData, courseData, options);

var string = _i18next.default.t(key, data);

return this.shouldPseudoLocalize(key, data) ? (0, _pseudoLocalization.localize)(string) : string;
};

this.getLanguage = function () {
return _i18next.default.language;
};

this.isRTL = function () {
switch (_i18next.default.language) {
case 'ar': // Arabic

case 'he': // Hebrew

case 'ur':
// Urdu
return true;

default:
return false;
}
};
};

var _default = new LocaleService();

exports.default = _default;
});

require.register("services/loader-handler-services/tippy-loader-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _typeof = require("@babel/runtime/helpers/typeof");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _tippy = _interopRequireWildcard(require("tippy.js"));

var _localeService = _interopRequireDefault(require("services/loader-handler-services/locale-service"));

var _jquery = _interopRequireDefault(require("jquery"));

var _chaplin = _interopRequireDefault(require("chaplin"));

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

var hideOnEsc = {
name: 'hideOnEsc',
defaultValue: true,
fn: function fn(_ref) {
var hide = _ref.hide;
var previousFocusedElem = null;

function onKeyDown(event) {
if (event.keyCode === 27) {
previousFocusedElem.focus();
hide();
}
}

return {
onShow: function onShow() {
previousFocusedElem = document.activeElement;
document.addEventListener('keydown', onKeyDown);
},
onHide: function onHide() {
document.removeEventListener('keydown', onKeyDown);
}
};
}
};
var hideOnBlur = {
name: 'hideOnBlur',
fn: function fn(instance) {
function onBlur(event) {
var focusToReference = event.relatedTarget === instance.reference;
var isFocusInside = instance.popper.contains(event.relatedTarget);

if (!(isFocusInside || focusToReference)) {
instance.hide();
}
}

return {
onShow: function onShow() {
instance.popper.addEventListener('blur', onBlur, true);
instance.reference.addEventListener('blur', onBlur, true);
},
onHide: function onHide() {
instance.popper.removeEventListener('blur', onBlur, true);
instance.reference.removeEventListener('blur', onBlur, true);
}
};
}
};

var checkSoundOrTippy = function checkSoundOrTippy(instance, eventTarget) {
var action = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'audio';
var event = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};

if (!eventTarget) {
return false;
}

var audioControls = (0, _jquery.default)(event.target).parents('.audio__controls').length;
return document.querySelector(eventTarget) === instance.reference && action === 'tippy' ? audioControls : !audioControls;
};

var ignoreList = function ignoreList() {
var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var ignoreList = ['navbar-audio-button'];
return ignoreList.includes((0, _jquery.default)(event.target).attr('id'));
};

var stopAudio = function stopAudio() {
//As there can only be one audio playing at a time. so it seems safe to use general audio:stop event
_chaplin.default.mediator.publish("audio:stop", {
disableTemporaryAutoplay: false
});
};

var checkSoundAndTippy = function checkSoundAndTippy(instance, eventTarget, event) {
/**
* We do not want to explicitly stop the audio with 'audio:stop' when the traget is the audioPlay button.
* The audio will be taken care by audioPlay back's handler itself.
*/
if (checkSoundOrTippy(instance, eventTarget, 'audio', event) && !ignoreList(event)) {
stopAudio();
}

instance.setProps({
preventClose: checkSoundOrTippy(instance, eventTarget, 'tippy', event)
});
};

var defaultConfig = {
allowHTML: true,
aria: {
content: 'describedby'
},
animation: 'scale',
arrow: true,
content: '',
delay: 0,
duration: [275, 250],
hideOnClick: true,
ignoreAttributes: false,
inertia: false,
interactive: false,
interactiveBorder: 4,
interactiveDebounce: 50,
maxWidth: 320,
placement: 'top',
plugins: [_tippy.followCursor, hideOnEsc, hideOnBlur],
role: 'tooltip',
onClickOutside: function onClickOutside(instance, event) {
var _this$audioData;

checkSoundAndTippy(instance, (_this$audioData = this.audioData) === null || _this$audioData === void 0 ? void 0 : _this$audioData.eventTarget, event);
},
onTrigger: function onTrigger(instance) {
var _this = this;

if (instance.props.allowHTML) {
instance.reference.setAttribute('aria-expanded', 'true');
}

instance.popper.ariaLive = 'polite';
instance.popper.setAttribute('role', 'tooltip');
instance.popper.setAttribute('data-popover-tippy', instance.props.placement);

_chaplin.default.mediator.subscribe("audio:playing", function (data) {
_this.audioData = data || {};
});
},
onUntrigger: function onUntrigger(instance, event) {
var _this$audioData2;

event.stopImmediatePropagation();
checkSoundAndTippy(instance, (_this$audioData2 = this.audioData) === null || _this$audioData2 === void 0 ? void 0 : _this$audioData2.eventTarget, event);
},
onHide: function onHide(instance) {
if (instance.props.preventClose) {
return false;
}
}
};
var tooltipConfig = {
allowHTML: false,
interactive: false,
trigger: 'mouseenter focus',
theme: 'custom-tooltip',
hideOnClick: true
};
var popoverConfig = {
allowHTML: true,
aria: {
content: 'describedby',
expanded: false
},
interactive: true,
trigger: 'click',
theme: 'custom-light-border'
};
Object.freeze(defaultConfig);

var TippyService = function TippyService() {
this.add = function (element, config) {
var allowHTML = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var settings = allowHTML ? popoverConfig : tooltipConfig;

if (!allowHTML) {
this.getLocaleString(config);
} else {
config.allowHTML = true;
config.interactive = true;
}

settings.onCreate = function (instance) {
if (instance.props.allowHTML) {
instance.reference.setAttribute('aria-expanded', 'false'); //to have expanded false initially when tippy is created.
}
};

settings.onHidden = function (instance) {
if (allowHTML) {
instance.reference.setAttribute('aria-expanded', 'false');
instance.reference.setAttribute('aria-label', 'completed'); // markig complete when tippy is hidden.
}

instance.popper.ariaLive = 'false';
};

this.getReferenceElement(config);
(0, _tippy.default)(element, Object.assign({}, defaultConfig, settings, config));
};

this.getLocaleString = function (config) {
if (config.content) {
config.content = _localeService.default.t(config.content);
}
};

this.getReferenceElement = function (config) {
var reference = config.appendTo || '#site-container';

if (reference && reference !== 'parent') {
config.appendTo = document.querySelector(reference) || document.body;
}
};

this.updateContent = function (element, content) {
if (element._tippy) {
element._tippy.setContent(_localeService.default.t(content));
}
};
};

var _default = new TippyService();

exports.default = _default;
});

require.register("services/page-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

var _contentService = _interopRequireDefault(require("services/loader-handler-services/content-service"));

var _customPageService = _interopRequireDefault(require("services/course-handler-services/custom-page-service"));

var _localeService = _interopRequireDefault(require("services/loader-handler-services/locale-service"));

var _utils = _interopRequireDefault(require("lib/utils"));

var _surveyService = _interopRequireDefault(require("services/data-handler-services/survey-service"));

var _evaluationService = _interopRequireDefault(require("services/data-handler-services/evaluation-service"));

var _assessmentService = _interopRequireDefault(require("services/data-handler-services/assessment-service"));

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var _learnerProfileService = _interopRequireDefault(require("services/course-handler-services/learner-profile-service"));

var _enrollmentDataService = _interopRequireDefault(require("services/data-handler-services/enrollment-data-service"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _jquery = _interopRequireDefault(require("jquery"));

//TODO: do we need a base service class?
var PageService = {
loadPage: function loadPage(moduleKey, activityKey, pageKey) {
//TODO: figure out when to 'unload' the current page
var pagePresent = pageKey !== undefined && pageKey !== null && pageKey !== '';
var activityPresent = activityKey !== undefined && activityKey !== null && activityKey !== '';

if (!_ef.default.module || moduleKey !== _ef.default.module.get('key')) {
_ef.default.setModuleByKey(moduleKey);

_localeService.default.setModuleResources(moduleKey);
}

if (!_ef.default.module.currentActivity || activityKey !== _ef.default.module.currentActivity.get('key')) {
if (activityPresent) {
_ef.default.module.setActivityByKey(activityKey);
} else {
_ef.default.module.getStartingActivity();
}

if (!_ef.default.module.currentActivity) {
_ef.default.module.currentActivity = _ef.default.module.activities.head();
}

if (_ef.default.module.currentActivity.isComplete()) {
_ef.default.module.currentActivity.set('redo', true);
}
}

if (!_ef.default.module.currentActivity.currentPage || pageKey !== _ef.default.module.currentActivity.currentPage.get('key')) {
if (pagePresent) {
_ef.default.module.currentActivity.setPageByKey(pageKey);
} else {
_ef.default.module.currentActivity.getStartingPage();
}

if (!_ef.default.module.currentActivity.currentPage) {
_ef.default.module.currentActivity.currentPage = _ef.default.module.currentActivity.pages.head();
} //TODO: check why progress was being set during page load

}

_contentService.default.addForgePathsToContentRegion('.before-content', _contentService.default.moduleContent.modules); //TODO: should we use the content service here instead of in the page controller?


return _contentService.default.applyPageContent(_ef.default.module.currentActivity.currentPage);
},
getNextPage: function getNextPage() {
//TODO: this method uses the autoNextActivity option, do we need an autoNextModule option?
// specifically thinking about the NHL course which may have multiple modules in a 'group'
return _ef.default.module.getNextPageByKey(_ef.default.module.currentActivity.currentPage.get('key'));
},
getPageByKey: function getPageByKey(key) {
var activity = {};

if (key.indexOf('/') > -1) {
var split = key.split('/');

if (split.length > 2) {
var moduleName = split[0];

var module = _ef.default.modules.find(function (m) {
return m.get('key') === moduleName;
});

var activityName = split[1];
activity = module.activities.find(function (acc) {
return acc.get('key') === activityName;
});
key = split[2];
} else {
var _activityName = split[0];
activity = _ef.default.module.activities.find(function (acc) {
return acc.get('key') === _activityName;
});
key = split[1];
}
} else {
activity = _ef.default.module.currentActivity;
}

return activity.pages.find(function (page) {
return page.get('key') === key;
});
},
getPreviousPage: function getPreviousPage() {
return _ef.default.module.getPreviousPageByKey(_ef.default.module.currentActivity.currentPage.get('key'));
},
shouldPreventPageSkipping: function shouldPreventPageSkipping() {
return _courseSettingsService.default.get('preventPageSkipping') !== undefined ? Boolean(_courseSettingsService.default.get('preventPageSkipping')) : true;
},
preventSkippingPages: function preventSkippingPages(page, params) {
var localSkipping = _ef.default.options.local ? _ef.default.options.pageSkipping : false;

if (params.page && !localSkipping && !_ef.default.enrollment.get('demoMode') && !_ef.default.module.isComplete() && this.shouldPreventPageSkipping()) {
// prevent skipping incomplete pages
var lastCompleted = _ef.default.module.currentActivity.pages.lastCompleted();

var key = lastCompleted.get('key');

var next = _ef.default.module.currentActivity.nextPageByKey(key);

while (next && next.get('optional')) {
next = _ef.default.module.currentActivity.nextPageByKey(next.get('key'));
}

if (next && page.get('index') > next.get('index')) {
_utils.default.redirectToPage(lastCompleted);

return false;
}
}

return true;
},
shouldSkipLearner: function shouldSkipLearner(skipJSON) {
// Allow for specifying page-skipping based on parameters in the learner_profile
// or the enrollment data. Enrollment data accepts dot-string keys.
//
// Usage Example:
// # Hide the page for Corporate users AND users in either Alaska OR California
// skip:
// learner_profile:
// - key: learner_location_iso_code
// show:
// - US-AK
// - US-CA
// - key: org_type
// hide:
// - CO
//
// # Show the page for users who chose the "APAC" region on a form set up
// # using a custom set of regions.
// skip:
// learner_profile:
// - key: customLearnerProfile.region
// show:
// - APAC
var findMatches = function findMatches(arr, value, fallback) {
if (arr && Array.isArray(arr)) {
return arr.map(function (criterion) {
return value === criterion;
}).some(function (i) {
return i;
});
} else {
return fallback;
}
};

var checkHideShow = function checkHideShow(hide, show, value) {
var hidden = findMatches(hide, value, false);
var shown = findMatches(show, value, true);
return hidden || !shown;
};

var skipLearnerProfile = false;
var skipEnrollmentData = false;

if (skipJSON.learner_profile) {
skipLearnerProfile = skipJSON.learner_profile.map(function (_ref) {
var hide = _ref.hide,
show = _ref.show,
key = _ref.key;
return checkHideShow(hide, show, _learnerProfileService.default.get(key));
}).find(function (i) {
return i;
});
}

if (skipJSON.enrollment_data) {
skipEnrollmentData = skipJSON.enrollment_data.map(function (_ref2) {
var hide = _ref2.hide,
show = _ref2.show,
key = _ref2.key;
return checkHideShow(hide, show, _enrollmentDataService.default.getByDotString(key));
}).find(function (i) {
return i;
});
}

return skipLearnerProfile || skipEnrollmentData;
},
shouldBeSkipped: function () {
var _shouldBeSkipped = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(page) {
var skipCallback, skipJSON, evaluationShouldBeSkipped, customizationAbsent, _CustomPageService$mo, module, activity, _page;

return _regenerator.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
skipCallback = page.script.skip;
skipJSON = page.model.get('skip');
evaluationShouldBeSkipped = _evaluationService.default.shouldSkip();

if (!_ef.default.forgeMode) {
_context.next = 5;
break;
}

return _context.abrupt("return", false);

case 5:
if (!skipCallback) {
_context.next = 9;
break;
}

return _context.abrupt("return", skipCallback(page));

case 9:
if (!skipJSON) {
_context.next = 39;
break;
}

if (!skipJSON.customization) {
_context.next = 15;
break;
}

_CustomPageService$mo = _customPageService.default.modulePaths(), module = _CustomPageService$mo.module, activity = _CustomPageService$mo.activity, _page = _CustomPageService$mo.page;
customizationAbsent = !_customPageService.default.hasPageCustomization(skipJSON.slug, module, activity, _page) && _ef.default.customizations.getByKeyAndSlug(skipJSON.customization, skipJSON.slug) === undefined;
_context.next = 38;
break;

case 15:
if (!skipJSON.resource_type) {
_context.next = 19;
break;
}

customizationAbsent = _ef.default.resources.byTypeSync(skipJSON.resource_type, skipJSON.resource_sub_type).length === 0;
_context.next = 38;
break;

case 19:
if (!skipJSON.survey_slug) {
_context.next = 28;
break;
}

_context.next = 22;
return _surveyService.default.userHasCompletedSurvey(skipJSON.survey_slug);

case 22:
_context.t0 = _context.sent;

if (_context.t0) {
_context.next = 25;
break;
}

_context.t0 = evaluationShouldBeSkipped;

case 25:
customizationAbsent = _context.t0;
_context.next = 38;
break;

case 28:
if (!skipJSON.assessment_slug) {
_context.next = 37;
break;
}

_context.next = 31;
return _assessmentService.default.userHasCompletedAssessment(skipJSON.assessment_slug);

case 31:
_context.t1 = _context.sent;

if (_context.t1) {
_context.next = 34;
break;
}

_context.t1 = evaluationShouldBeSkipped;

case 34:
customizationAbsent = _context.t1;
_context.next = 38;
break;

case 37:
if (skipJSON.learner_profile || skipJSON.enrollment_data) {
customizationAbsent = this.shouldSkipLearner(skipJSON);
}

case 38:
return _context.abrupt("return", skipJSON.when === 'present' ? !customizationAbsent : customizationAbsent);

case 39:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));

function shouldBeSkipped(_x) {
return _shouldBeSkipped.apply(this, arguments);
}

return shouldBeSkipped;
}(),
setPageOptional: function setPageOptional(page) {
var currentPage = _ef.default.module.currentActivity.currentPage;

_ef.default.module.currentActivity.pages.each(function (p) {
if (p.get('index') >= currentPage.get('index') && p.get('index') <= page.get('index')) {
page.set('optional', true);
}
});
},
setScrollToElement: function setScrollToElement($element, $scrollPane) {
var _this = this;

var scroll = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'y';

if ($element && $scrollPane) {
setTimeout(function () {
// As of now it only supports 'vertical scroll',
// TODO: Can be extended to support 'horizontal scroll' as when will be required
if (scroll === 'y') {
$scrollPane.animate({
scrollTop: _this.getElementScrollPos($element, $scrollPane)
}, 500);
}
}, 500);
}
},
getElementScrollPos: function getElementScrollPos($element, $scrollPane) {
var scroll = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'y';
var scrollPos = 0;

if ($element && $scrollPane) {
var $siteContainer = (0, _jquery.default)('#site-container'); // As of now it only returns 'vertical scroll position' for '$element',
// TODO: Can be extended to return 'horizontal scroll position' for '$element' as when will be required

if (scroll === 'y') {
var $siteContainerPosY = $siteContainer.offset().top - parseInt($siteContainer.css('margin-top').replace('px', ''));
var scrollPaneBoundingClientRectTop = $scrollPane.selector === 'html, body' ? $siteContainerPosY : $scrollPane.get(0).getBoundingClientRect().top;
var scrollPaneScrollTop = $scrollPane.scrollTop();
var elementBoundingClientRectTop = $element.get(0).getBoundingClientRect().top;
scrollPos = elementBoundingClientRectTop - scrollPaneBoundingClientRectTop + scrollPaneScrollTop;
}
}

return scrollPos;
}
};
var _default = PageService;
exports.default = _default;
});

require.register("services/services-initializer.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var _contentService = _interopRequireDefault(require("services/loader-handler-services/content-service"));

var _localeService = _interopRequireDefault(require("services/loader-handler-services/locale-service"));

var _surveyService = _interopRequireDefault(require("services/data-handler-services/survey-service"));

var _syncService = _interopRequireDefault(require("services/data-handler-services/sync-service"));

var _assessmentService = _interopRequireDefault(require("services/data-handler-services/assessment-service"));

var _evaluationService = _interopRequireDefault(require("services/data-handler-services/evaluation-service"));

var _learnerProfileService = _interopRequireDefault(require("services/course-handler-services/learner-profile-service"));

var _ef = _interopRequireDefault(require("ef/ef"));

var ServicesInitializer = /*#__PURE__*/function () {
function ServicesInitializer() {
(0, _classCallCheck2.default)(this, ServicesInitializer);
}

(0, _createClass2.default)(ServicesInitializer, null, [{
key: "start",
value: function start(config) {
_courseSettingsService.default.initialize(config.settings).then(function () {
Promise.all([_contentService.default.initialize(), _localeService.default.initialize(config.i18n)]).then(function () {
var groupsJson = _contentService.default.groups;
var modulesJson = _contentService.default.modules;
var modulesContentJson = _contentService.default.moduleContent;
var enrollment = config.enrollment;

_ef.default.init(groupsJson, modulesJson, modulesContentJson, enrollment, {
local: config.settings.local,
apiOnly: true,
autoNextActivity: true,
loadActivityProgresses: config.settings.progressProvider !== 'content-service',
evaluations: config.evaluations
}, config.settings);

_surveyService.default.initialize(config.surveys);

_assessmentService.default.initialize(config.assessments);

_evaluationService.default.initialize(config.evaluations);

_learnerProfileService.default.initialize(config.learnerProfile);

window.addEventListener('message', /*#__PURE__*/function () {
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(event) {
return _regenerator.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
if (!(event.data.event_type === 'reload-evaluation')) {
_context.next = 3;
break;
}

_context.next = 3;
return _evaluationService.default.updateResponseSet(event.data.slug, event.data.response_set);

case 3:
case "end":
return _context.stop();
}
}
}, _callee);
}));

return function (_x) {
return _ref.apply(this, arguments);
};
}(), false);
}).catch(function (err) {
console.log("Content Loading Failed! Maybe you have an error in your JSON? ".concat(err));
});
});

if (config.settings.local) {
_syncService.default.initialize(config.settings);
}
}
}]);
return ServicesInitializer;
}();

var _default = ServicesInitializer;
exports.default = _default;
});

require.register("services/timer/countdown-timer.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _typeof = require("@babel/runtime/helpers/typeof");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CountDownTimerWithEvents = exports.CountDownTimer = void 0;

var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));

var _addHours = _interopRequireDefault(require("date-fns/addHours"));

var _addMinutes = _interopRequireDefault(require("date-fns/addMinutes"));

var _addSeconds = _interopRequireDefault(require("date-fns/addSeconds"));

var _eventManager = _interopRequireDefault(require("services/timer/event-manager"));

var _timer = _interopRequireWildcard(require("services/timer/timer"));

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

var CountDownTimer = /*#__PURE__*/function (_Timer) {
(0, _inherits2.default)(CountDownTimer, _Timer);

var _super = _createSuper(CountDownTimer);

function CountDownTimer(config) {
var _this;

(0, _classCallCheck2.default)(this, CountDownTimer);

var _ref = config || {
duration: '00:00:00'
},
duration = _ref.duration;

_this = _super.call(this, config);
_this.duration = duration;
_this.timerStates.completed = 'COMPLETED';
return _this;
}

(0, _createClass2.default)(CountDownTimer, [{
key: "getDateFromDuration",
value: function getDateFromDuration(date, duration) {
if (typeof duration !== 'string' || !(date instanceof Date)) {
throw Error('getDateFromDuration: duration must be string and needs a Date object.');
}

var _duration$split$map = duration.split(':').map(function (v) {
return parseInt(v, 10);
}),
_duration$split$map2 = (0, _slicedToArray2.default)(_duration$split$map, 3),
hours = _duration$split$map2[0],
minutes = _duration$split$map2[1],
seconds = _duration$split$map2[2];

return (0, _addSeconds.default)((0, _addMinutes.default)((0, _addHours.default)(date, hours || 0), minutes || 0), seconds || 0);
}
}, {
key: "getTimeLeftInMillisec",
value: function getTimeLeftInMillisec() {
var now = new Date();
var durationDate = this.getDateFromDuration(now, this.duration).getTime();
var currentTimeDate = (0, _addSeconds.default)(now, this.time).getTime();
return durationDate - currentTimeDate;
}
}, {
key: "tick",
value: function tick() {
if (this.getCurrentState() === this.timerStates.completed) {
return;
}

this.timeLeft = this.getTimeLeftInMillisec() / 1000;

if (this.timeLeft <= 0) {
this.stop();
this.setState(this.timerStates.completed);
}

(0, _get2.default)((0, _getPrototypeOf2.default)(CountDownTimer.prototype), "tick", this).call(this);
}
}]);
return CountDownTimer;
}(_timer.default);

exports.CountDownTimer = CountDownTimer;

var CountDownTimerWithEvents = /*#__PURE__*/function (_CountDownTimer) {
(0, _inherits2.default)(CountDownTimerWithEvents, _CountDownTimer);

var _super2 = _createSuper(CountDownTimerWithEvents);

function CountDownTimerWithEvents(config) {
var _this2;

(0, _classCallCheck2.default)(this, CountDownTimerWithEvents);
var _config$eventPrefix = config.eventPrefix,
eventPrefix = _config$eventPrefix === void 0 ? 'countdownTimer' : _config$eventPrefix;
_this2 = _super2.call(this, config);

_timer.withEvents.bind((0, _assertThisInitialized2.default)(_this2))(new _eventManager.default(eventPrefix));

return _this2;
}

return (0, _createClass2.default)(CountDownTimerWithEvents);
}(CountDownTimer);

exports.CountDownTimerWithEvents = CountDownTimerWithEvents;
});

require.register("services/timer/course-timer-service.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var _learnerProfileService = _interopRequireDefault(require("services/course-handler-services/learner-profile-service"));

var _enrollmentDataService = _interopRequireDefault(require("services/data-handler-services/enrollment-data-service"));

var _timerService = require("services/course-handler-services/timer-service");

var _progressService = _interopRequireDefault(require("services/content-service/progress-service"));

var _countdownTimer = require("services/timer/countdown-timer");

var _timer = require("services/timer/timer");

var _ef = _interopRequireDefault(require("ef/ef"));

function CourseTimerService(courseSettingsService, learnerProfileService, enrollmentDataService, timerService) {
var _this = this;

if (!courseSettingsService || !learnerProfileService || !enrollmentDataService) {
throw Error('CourseTimerService: No courseSettings, learnerProfile or enrollmentDataService provided');
}

var courseTimerConfig;

this.initialize = function () {
this.courseTimers = {};

try {
if (courseTimerConfig || !courseSettingsService.get('timerConfig')) {
return this.courseTimers;
}

var courseCountdownTimerStoredData = this.getTimerConfigForProfile('courseCountdownTimer');
var courseTimerStoredData = this.getTimerConfigForProfile('courseTimer');
this.courseTimers.courseCountdownTimer = new _countdownTimer.CountDownTimerWithEvents(courseCountdownTimerStoredData);
this.courseTimers.courseCountdownTimer.setTickEventPeriod(10);
this.courseTimers.courseTimer = new _timer.TimerWithEvents(courseTimerStoredData);
timerService.registerTimers([this.courseTimers.courseCountdownTimer, this.courseTimers.courseTimer]);
this.courseTimers.courseTimer.setTickEventPeriod(10);
this.registerEnrollmentDataEvents();
return this.courseTimers;
} catch (err) {
// eslint-disable-next-line no-console
console.error("CourseTimerService: ".concat(err));
return {};
}
}; // Get the configuratin from course-settings


this.getTimerConfigForProfile = function (timerKey) {
var profileType = learnerProfileService.get('learner_type');
var profileLocation = learnerProfileService.get('learner_location_iso_code');
var enrollmentData = enrollmentDataService.getData('courseLevelTimer');
courseTimerConfig = courseSettingsService.get('timerConfig').courseLevelTimers; // go through current type durations to find a location match. if no match or location is null, set it to default

if (profileLocation) {
var thisLocation = 'default';

for (var duration in courseTimerConfig[profileType].durations) {
if (profileLocation === duration) {
thisLocation = profileLocation;
}
}

profileLocation = thisLocation;
} else {
profileLocation = 'default';
}

if (!courseTimerConfig || !profileType || !profileLocation) {
throw Error('getTimerConfigForProfile: no timerConfig or learnerType configuration');
}

var enrollmentTimerData = enrollmentData ? enrollmentData[timerKey] || {} : {};
var timerConfigProfile = courseTimerConfig[profileType];
var timerConfig = timerConfigProfile ? timerConfigProfile.durations[profileLocation] : {};
return Object.assign({}, timerConfig, enrollmentTimerData);
}; // Register callbacks to save the data to enrollment data => local storage


this.registerEnrollmentDataEvents = function () {
Object.entries(_this.courseTimers).forEach(function (_ref) {
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
key = _ref2[0],
timer = _ref2[1];

if (timer.eventManager) {
timer.on('tick', function () {
_this.storeCourseTimer({
key: key,
timer: timer
});
});
timer.on('completed', function () {
_this.storeCourseTimer({
key: key,
timer: timer
});
});
}
});
};

this.storeCourseTimer = function (_ref3) {
var key = _ref3.key,
timer = _ref3.timer;

try {
var prevCourseTimerData = enrollmentDataService.getData('courseLevelTimer');
enrollmentDataService.saveData('courseLevelTimer', Object.assign({}, prevCourseTimerData, (0, _defineProperty2.default)({}, key, timer)));

if (!_ef.default.options.local && key === 'courseTimer') {
_progressService.default.saveCourseTimeProgress({
intervalSeconds: timer.tickEventPeriod
});
}
} catch (err) {
console.error("Couldn't save data, error: ".concat(err));
}
};
}

var courseTimerService = new CourseTimerService(_courseSettingsService.default, _learnerProfileService.default, _enrollmentDataService.default, _timerService.timerService);
var _default = courseTimerService;
exports.default = _default;
});

require.register("services/timer/event-manager.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var EventManager = /*#__PURE__*/(0, _createClass2.default)(function EventManager(prefix) {
var _this = this;

(0, _classCallCheck2.default)(this, EventManager);

if (typeof prefix !== 'string') {
throw Error('EventManager: prefix must be a string');
}

this.prefix = "".concat(prefix, ":");

if (!_chaplin.default || !_chaplin.default.mediator) {
throw Error('EventManager: Chaplin doesnt exists');
}

function checkParams(event, cb) {
if (typeof cb !== 'function') {
throw Error('EventManager: callback must be a function');
}

if (typeof event !== 'string') {
throw Error('EventManager: event must be a string');
}
}

this.on = function (event, cb, ctx) {
checkParams(event, cb);
return _chaplin.default.mediator.subscribe("".concat(_this.prefix).concat(event), cb, ctx);
};

this.off = function (event, cb, ctx) {
checkParams(event, cb);
return _chaplin.default.mediator.unsubscribe("".concat(_this.prefix).concat(event), cb, ctx);
};

this.trigger = function (event) {
var _Chaplin$mediator;

for (var _len = arguments.length, data = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
data[_key - 1] = arguments[_key];
}

return (_Chaplin$mediator = _chaplin.default.mediator).publish.apply(_Chaplin$mediator, ["".concat(_this.prefix).concat(event)].concat(data));
};
});
var _default = EventManager;
exports.default = _default;
});

require.register("services/timer/timer.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.TimerWithEvents = void 0;
exports.withEvents = withEvents;

var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _eventManager = _interopRequireDefault(require("services/timer/event-manager"));

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

/**
* @param {Object} - timer configuration { autoplay, step, id, time }.
* @return {Timer} Timer object.
*/
var Timer = /*#__PURE__*/function () {
function Timer(timerConfig) {
(0, _classCallCheck2.default)(this, Timer);

var _ref = timerConfig || {},
autoplay = _ref.autoplay,
step = _ref.step,
id = _ref.id,
time = _ref.time,
startTime = _ref.startTime,
stoppedTime = _ref.stoppedTime;

this.timerStates = {
stopped: 'STOPPED',
ticking: 'TICKING'
};
this.id = id || Math.random().toString(36).substring(7);
this.autoplay = autoplay != null ? autoplay : true;
this.time = parseInt(time) || 0;
this.step = step ? step : 1;
this.startTime = startTime ? new Date(startTime) : undefined;
this.stoppedTime = stoppedTime ? new Date(stoppedTime) : undefined;
this.setState(this.timerStates.stopped);

if (this.autoplay) {
this.startTime ? this.resume() : this.start();
}
}

(0, _createClass2.default)(Timer, [{
key: "start",
value: function start() {
var _this = this;

if (this.intervalId) {
console.log('Timer: Already started timer');
return;
}

if (this.startTime) {
return this.resume();
}

this.startTime = new Date();
this.intervalId = setInterval(function () {
return _this.tick();
}, this.step * 1000);
this.setState(this.timerStates.ticking);
return this;
}
}, {
key: "tick",
value: function tick() {
this.time++;
}
}, {
key: "stop",
value: function stop() {
if (this.state === this.timerStates.stopped) {
return this;
}

clearInterval(this.intervalId);
this.intervalId = null;
this.stoppedTime = new Date();
this.setState(this.timerStates.stopped);
return this;
}
}, {
key: "resume",
value: function resume() {
var _this2 = this;

if (!this.startTime) {
return this.start();
}

this.intervalId = setInterval(function () {
return _this2.tick();
}, this.step * 1000);
this.setState(this.timerStates.ticking);
return this;
}
}, {
key: "reset",
value: function reset() {
this.startTime = null;
this.time = 0;
return this.stop();
}
}, {
key: "getCurrentTime",
value: function getCurrentTime() {
return this.time;
}
}, {
key: "getCurrentState",
value: function getCurrentState() {
return this.state;
}
}, {
key: "setState",
value: function setState(state) {
this.state = state;
}
}]);
return Timer;
}();

function withEvents(eventManager) {
this.tickCount = 0;
this.eventManager = eventManager;
this.on = this.eventManager.on;
this.off = this.eventManager.off;
this.trigger = this.eventManager.trigger;
this.superTick = this.tick;
this.superSetState = this.setState;

this.tick = function () {
this.superTick();
this.tickCount++;

if (this.tickCount === this.tickEventPeriod) {
this.trigger && this.trigger('tick');
this.tickCount = 0;
}
}; // Time to wait to trigger the tick event this is relevant when you want to perform an action every x seconds.


this.setTickEventPeriod = function (eventPeriod) {
this.tickEventPeriod = eventPeriod;
return this;
};

this.setState = function (state) {
this.superSetState(state);
this.trigger && this.trigger(state.toLowerCase());
};

return this;
}

var TimerWithEvents = /*#__PURE__*/function (_Timer) {
(0, _inherits2.default)(TimerWithEvents, _Timer);

var _super = _createSuper(TimerWithEvents);

function TimerWithEvents(config) {
var _this3;

(0, _classCallCheck2.default)(this, TimerWithEvents);
var _config$eventPrefix = config.eventPrefix,
eventPrefix = _config$eventPrefix === void 0 ? 'timer' : _config$eventPrefix;
_this3 = _super.call(this, config);
withEvents.bind((0, _assertThisInitialized2.default)(_this3))(new _eventManager.default(eventPrefix));
return _this3;
}

return (0, _createClass2.default)(TimerWithEvents);
}(Timer);

exports.TimerWithEvents = TimerWithEvents;
var _default = Timer;
exports.default = _default;
});

require.register("stylesheets/custom.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"1":function(container,depth0,helpers,partials,data) {
var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "\n#site-container .bg-color-brand-primary,\n#site-container .bg-color-interactive-500 {\n background-color: "
+ alias4(((helper = (helper = lookupProperty(helpers,"primary_color") || (depth0 != null ? lookupProperty(depth0,"primary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"primary_color","hash":{},"data":data,"loc":{"start":{"line":10,"column":20},"end":{"line":10,"column":37}}}) : helper)))
+ " !important;\n}\n\n#site-container .font-color-brand-primary,\n#site-container .font-color-brand-primary > *,\n#site-container .font-color-interactive-500,\n#site-container .font-color-interactive-500 > * {\n color: "
+ alias4(((helper = (helper = lookupProperty(helpers,"primary_color") || (depth0 != null ? lookupProperty(depth0,"primary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"primary_color","hash":{},"data":data,"loc":{"start":{"line":17,"column":9},"end":{"line":17,"column":26}}}) : helper)))
+ " !important;\n}\n#site-container .border-color-brand-primary {\n border-color: "
+ alias4(((helper = (helper = lookupProperty(helpers,"primary_color") || (depth0 != null ? lookupProperty(depth0,"primary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"primary_color","hash":{},"data":data,"loc":{"start":{"line":20,"column":16},"end":{"line":20,"column":33}}}) : helper)))
+ " !important;\n}\n\n.branding-primary {\n fill: "
+ alias4(((helper = (helper = lookupProperty(helpers,"primary_color") || (depth0 != null ? lookupProperty(depth0,"primary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"primary_color","hash":{},"data":data,"loc":{"start":{"line":24,"column":8},"end":{"line":24,"column":25}}}) : helper)))
+ " !important;\n}\n\nbutton:hover:not(:disabled),\na:hover {\n opacity: 0.8 !important;\n}\n\n\n#site-container .btn-primary:not(:disabled), \n.navigation-bar .navbar,\n.timeline__interval__dot,\n#site-container .hotspot-container .hotspot:not(.clicked),\n#site-container .btn-hotspot,\n#site-container .module-container .course-hub-module-progress-bar,\n#site-container .progression__bar {\n background-color: "
+ alias4(((helper = (helper = lookupProperty(helpers,"primary_color") || (depth0 != null ? lookupProperty(depth0,"primary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"primary_color","hash":{},"data":data,"loc":{"start":{"line":41,"column":20},"end":{"line":41,"column":37}}}) : helper)))
+ " !important;\n color: #fff !important;\n}\n\n.progression__circle--progress {\n stroke: "
+ alias4(((helper = (helper = lookupProperty(helpers,"primary_color") || (depth0 != null ? lookupProperty(depth0,"primary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"primary_color","hash":{},"data":data,"loc":{"start":{"line":46,"column":10},"end":{"line":46,"column":27}}}) : helper)))
+ " !important;\n}\n\n.bellow__bullet-step,\n.btn-secondary:not(:disabled),\n.label__theme--secondary,\n.timeline__event__dot,\n#site-container .draggable:hover,\n#site-container .activities .activity__list__item--active {\n background-color: "
+ alias4(((helper = (helper = lookupProperty(helpers,"secondary_color") || (depth0 != null ? lookupProperty(depth0,"secondary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"secondary_color","hash":{},"data":data,"loc":{"start":{"line":56,"column":20},"end":{"line":56,"column":39}}}) : helper)))
+ " !important;\n color: #000 !important;\n border-color: "
+ alias4(((helper = (helper = lookupProperty(helpers,"primary_color") || (depth0 != null ? lookupProperty(depth0,"primary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"primary_color","hash":{},"data":data,"loc":{"start":{"line":58,"column":16},"end":{"line":58,"column":33}}}) : helper)))
+ " !important;\n}\n\n\n#site-container a,\n#site-container a:visited,\n#site-container .activity a, \n#site-container .bellow__icon-principal,\n#site-container .bellow__icon-secondary,\n.btn-tertiary:not(:disabled), \n.link,\n.link .link__text {\n color: "
+ alias4(((helper = (helper = lookupProperty(helpers,"primary_color") || (depth0 != null ? lookupProperty(depth0,"primary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"primary_color","hash":{},"data":data,"loc":{"start":{"line":71,"column":9},"end":{"line":71,"column":26}}}) : helper)))
+ " !important;\n background: transparent;\n}\n\n.callout--generic .callout__icon svg,\n#site-container .activities .activity__list__item--active svg,\n#site-container .flipcard-container .flipcard__face__arrow-icon div {\n color: "
+ alias4(((helper = (helper = lookupProperty(helpers,"primary_color") || (depth0 != null ? lookupProperty(depth0,"primary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"primary_color","hash":{},"data":data,"loc":{"start":{"line":79,"column":9},"end":{"line":79,"column":26}}}) : helper)))
+ " !important;\n}\n\n.video__container .seek__container .seekbar--play {\n background-color: "
+ alias4(((helper = (helper = lookupProperty(helpers,"primary_color") || (depth0 != null ? lookupProperty(depth0,"primary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"primary_color","hash":{},"data":data,"loc":{"start":{"line":83,"column":20},"end":{"line":83,"column":37}}}) : helper)))
+ " !important;\n\n}\n\n\n\n.choices__label:hover .choices__custom-input-radio,\n.choices__label:hover .choices__custom-input-checkbox,\n.choices--choice-card .choices__label:hover,\n.choices--choice-card .choices__label:active,\n.choices--choice-card .choices__label--checked,\n.field:hover,\n.field:active,\n.field:focus,\n.tabs__tab-bar-button:hover, \n.tabs__tab-bar-button:active,\n.tabs__tab-bar-button--active,\n.callout--generic {\n border-color: "
+ alias4(((helper = (helper = lookupProperty(helpers,"primary_color") || (depth0 != null ? lookupProperty(depth0,"primary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"primary_color","hash":{},"data":data,"loc":{"start":{"line":105,"column":16},"end":{"line":105,"column":33}}}) : helper)))
+ " !important;\n}\n\n.choices__label--checked .choices__custom-input-radio, \n.choices__label--checked .choices__custom-input-checkbox, \n.choices__label--checked:hover .choices__custom-input-radio, \n.choices__label--checked:hover .choices__custom-input-checkbox {\n background-color: "
+ alias4(((helper = (helper = lookupProperty(helpers,"primary_color") || (depth0 != null ? lookupProperty(depth0,"primary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"primary_color","hash":{},"data":data,"loc":{"start":{"line":112,"column":20},"end":{"line":112,"column":37}}}) : helper)))
+ " !important;\n border-color: "
+ alias4(((helper = (helper = lookupProperty(helpers,"primary_color") || (depth0 != null ? lookupProperty(depth0,"primary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"primary_color","hash":{},"data":data,"loc":{"start":{"line":113,"column":16},"end":{"line":113,"column":33}}}) : helper)))
+ " !important;\n box-shadow: inset 0 0 0 4px "
+ alias4(((helper = (helper = lookupProperty(helpers,"primary_color") || (depth0 != null ? lookupProperty(depth0,"primary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"primary_color","hash":{},"data":data,"loc":{"start":{"line":114,"column":30},"end":{"line":114,"column":47}}}) : helper)))
+ " !important;\n}\n\n.choices__label:hover .choices__custom-input-radio, \n.choices__label:hover .choices__custom-input-checkbox,\nchoices--choice-card .choices__label:hover, \n.choices--choice-card .choices__label:active, \n.choices--choice-card .choices__label--checked,\n.field:hover,\n.tabs.tab-card .tabs__tab-bar-button:hover, \n.tabs.tab-card .tabs__tab-bar-button--hover {\n box-shadow: inset 0 0 0 1px "
+ alias4(((helper = (helper = lookupProperty(helpers,"primary_color") || (depth0 != null ? lookupProperty(depth0,"primary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"primary_color","hash":{},"data":data,"loc":{"start":{"line":125,"column":30},"end":{"line":125,"column":47}}}) : helper)))
+ " !important;\n}\n\n.tabs.tab-card .tabs__tab-bar-button--active,\n.tabs.tab-card .tabs__tab-bar-button:focus,\n.field:active,\n.field:focus,\n.choices--choice-card .choices__label:active,\n.choices--choice-card .choices__label--checked {\n box-shadow: inset 0 0 0 2px "
+ alias4(((helper = (helper = lookupProperty(helpers,"primary_color") || (depth0 != null ? lookupProperty(depth0,"primary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"primary_color","hash":{},"data":data,"loc":{"start":{"line":134,"column":30},"end":{"line":134,"column":47}}}) : helper)))
+ " !important;\n}\n\n.tabs__tab-bar-button:hover, .tabs__tab-bar-button--hover {\n box-shadow: inset 0 -2px 0 0 "
+ alias4(((helper = (helper = lookupProperty(helpers,"primary_color") || (depth0 != null ? lookupProperty(depth0,"primary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"primary_color","hash":{},"data":data,"loc":{"start":{"line":138,"column":31},"end":{"line":138,"column":48}}}) : helper)))
+ " !important;\n}\n\n.tabs__tab-bar-button:active, \n.tabs__tab-bar-button--active, \n.tabs__tab-bar-button:focus, \n.tabs__tab-bar-button--focus {\n box-shadow: inset 0 -4px 0 0 "
+ alias4(((helper = (helper = lookupProperty(helpers,"primary_color") || (depth0 != null ? lookupProperty(depth0,"primary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"primary_color","hash":{},"data":data,"loc":{"start":{"line":145,"column":31},"end":{"line":145,"column":48}}}) : helper)))
+ " !important;\n}\n\n";
},"3":function(container,depth0,helpers,partials,data) {
var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "\n#site-container .bg-color-brand-secondary,\n#site-container .bg-color-interactive-300 {\n background-color: "
+ alias4(((helper = (helper = lookupProperty(helpers,"secondary_color") || (depth0 != null ? lookupProperty(depth0,"secondary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"secondary_color","hash":{},"data":data,"loc":{"start":{"line":154,"column":20},"end":{"line":154,"column":39}}}) : helper)))
+ " !important;\n}\n#site-container .font-color-brand-secondary,\n#site-container .font-color-brand-secondary > * {\n color: "
+ alias4(((helper = (helper = lookupProperty(helpers,"secondary_color") || (depth0 != null ? lookupProperty(depth0,"secondary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"secondary_color","hash":{},"data":data,"loc":{"start":{"line":158,"column":9},"end":{"line":158,"column":28}}}) : helper)))
+ " !important;\n}\n#site-container .border-color-brand-secondary {\n border-color: "
+ alias4(((helper = (helper = lookupProperty(helpers,"secondary_color") || (depth0 != null ? lookupProperty(depth0,"secondary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"secondary_color","hash":{},"data":data,"loc":{"start":{"line":161,"column":16},"end":{"line":161,"column":35}}}) : helper)))
+ " !important;\n}\n\n.branding-secondary {\n background: "
+ alias4(((helper = (helper = lookupProperty(helpers,"secondary_color") || (depth0 != null ? lookupProperty(depth0,"secondary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"secondary_color","hash":{},"data":data,"loc":{"start":{"line":165,"column":14},"end":{"line":165,"column":33}}}) : helper)))
+ " !important;\n color: #000;\n fill: "
+ alias4(((helper = (helper = lookupProperty(helpers,"secondary_color") || (depth0 != null ? lookupProperty(depth0,"secondary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"secondary_color","hash":{},"data":data,"loc":{"start":{"line":167,"column":8},"end":{"line":167,"column":27}}}) : helper)))
+ " !important;\n}\n\n#site-container a:focus,\n#site-container .link:focus,\n#site-container .link:focus .link__text,\n#site-container .activity a:focus {\n background-color: "
+ alias4(((helper = (helper = lookupProperty(helpers,"secondary_color") || (depth0 != null ? lookupProperty(depth0,"secondary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"secondary_color","hash":{},"data":data,"loc":{"start":{"line":174,"column":20},"end":{"line":174,"column":39}}}) : helper)))
+ " !important;\n color: #000 !important;\n}\n\n.choices__label:hover,\n.choices__label:active,\n.choices--choice-card .choices__label:active,\n.choices--choice-card .choices__label--checked,\n.bellow__button__vertical:hover,\n.bellow--header__vertical:hover,\n.bellow__article__vertical,\n.bellow--header__vertical.active .bellow__button__vertical,\n.tabs__tab-bar-button:hover,\n.tabs__tab-bar-button:active,\n.tabs__tab-bar-button--active,\n.link:hover,\n.link:hover .link__text,\n.btn-tertiary:active,\n.btn-tertiary:focus,\n.callout--generic {\n background-color: "
+ alias4(((helper = (helper = lookupProperty(helpers,"secondary_color") || (depth0 != null ? lookupProperty(depth0,"secondary_color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"secondary_color","hash":{},"data":data,"loc":{"start":{"line":194,"column":20},"end":{"line":194,"column":39}}}) : helper)))
+ " !important;\n color: #000 !important;\n}\n\n";
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "\n"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"primary_color") : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":6,"column":0},"end":{"line":148,"column":7}}})) != null ? stack1 : "")
+ "\n"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"secondary_color") : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":150,"column":0},"end":{"line":198,"column":7}}})) != null ? stack1 : "");
},"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/actionbar/actionbar-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _ef = _interopRequireDefault(require("ef/ef"));

var _view = _interopRequireDefault(require("views/base/view"));

var _navigationService = _interopRequireDefault(require("services/course-handler-services/navigation-service"));

var _webStorageService = require("services/data-handler-services/web-storage-service");

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var _i18next = _interopRequireDefault(require("i18next"));

var _localeService = _interopRequireDefault(require("services/loader-handler-services/locale-service"));

var _actionbar = _interopRequireDefault(require("views/actionbar/templates/actionbar"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _lodash = _interopRequireDefault(require("lodash"));

var _jquery = _interopRequireDefault(require("jquery"));

var ActionbarView = _view.default.extend({
template: _actionbar.default,
autoRender: true,
className: 'row',
listen: {
'page:state:completed mediator': 'completed',
'media:status:changed mediator': 'mediaStateChanged',
'media:play mediator': 'mediaPlay',
'media:narration mediator': 'narrationChanged',
'media:mute:change mediator': 'muteChange',
'button:disabled mediator': 'disableButton',
'button:enabled mediator': 'enableButton'
},
setElemId: function setElemId(event) {
if (event) {
this.focusedElemId = (0, _jquery.default)(event.target).attr('id');
}
},
initialize: function initialize() {
//TODO: figure out what to do with page templates that don't use some of the buttons
this.model.set('narration', _ef.default.enrollment.getData('narration'));
this.model.set('mute', _ef.default.enrollment.getData('muted') === 'on');
this.model.set('media_status_text', _localeService.default.t('mediaAccessibility.none'));

if (_courseSettingsService.default.get('transcript')) {
this.model.set('transcript', true);
}

this.on('addedToDOM', this.addEventDelegates);

var queryParams = _webStorageService.SessionStorageService.getItem('queryParams');

if (queryParams && queryParams.next && queryParams.next === 'disabled') {
this.model.set('nextDisabled', true);
}

if (!_ef.default.module.currentActivity.currentPage.get('completed') && !_ef.default.enrollment.get('demoMode')) {
this.model.set('nextDisabled', true);
}

var actionBarConfig = _courseSettingsService.default.get('actionBar');

if (actionBarConfig !== undefined && actionBarConfig.localeSwitcher !== undefined) {
this.model.set('localeSwitcher', Boolean(actionBarConfig.localeSwitcher));
this.model.set('languages', _courseSettingsService.default.get('supported_languages').filter(function (l) {
return l !== 'cimode';
}));
this.model.set('language', _i18next.default.language);
}

_view.default.prototype.initialize.apply(this, arguments);
},
addEventDelegates: function addEventDelegates() {
// focus selected actionbar button after render
this.render = _lodash.default.wrap(this.render, function (render) {
render();

if (this.focusedElemId) {
this.$("#".concat(this.focusedElemId)).focus();
}
});
this.subscribeEvent('action:unload', function () {
if (this.model) {
this.model.set('nextDisabled', false);
this.render();
}
});
this.delegate('click', '#play_button', function (e) {
this.setElemId(e);

if (this.model.get('media_status') === 'completed') {
_chaplin.default.mediator.publish("media:play:".concat(this.model.get('mediaId')));
} else {
_chaplin.default.mediator.publish("action:".concat(this.model.get('playing') ? 'pause' : 'resume'));
}
});
this.delegate('click', '#mute_button', function (e) {
this.setElemId(e);
var currentState = (0, _jquery.default)(e.target).attr('data-mute-state');

_chaplin.default.mediator.publish("action:".concat(currentState === 'on' ? 'unmute' : 'mute'));
});
this.delegate('click', '#narration_toggle', function (e) {
this.setElemId(e);
var narration = !this.model.get('narration');

_ef.default.enrollment.setData('narration', narration);

this.model.set('narration', narration);
this.model.set('showNarration', narration && this.model.get('narrationText'));

_chaplin.default.mediator.publish('media:captions:change');

this.render();
});
this.delegate('change', '#locale-switcher', function (e) {
if (this.model.has('languages') && this.model.get('languages').includes(e.target.value)) {
_i18next.default.changeLanguage(e.target.value);

_localeService.default.initialize().done(function () {
_navigationService.default.reload();
});
}
});
this.delegate('click', '[data-navigate]', function (e) {
e.preventDefault();
var navigateTo = (0, _jquery.default)(e.target).attr('data-navigate');

if (this.model.get('nextDisabled') && navigateTo === 'forward') {
return;
}

_chaplin.default.mediator.publish('page:navigate', navigateTo);
});
this.delegate('click', '[data-close]', function (e) {
e.preventDefault();

_chaplin.default.mediator.publish('feedback:all:close');
});
},
mediaPlay: function mediaPlay(mediaId, isBackground) {
if (!isBackground) {
this.model.set('mediaId', mediaId);
}
},
disableButton: function disableButton(buttonId) {
this.model.set("disable_".concat(buttonId), true);
},
enableButton: function enableButton(buttonId) {
this.model.set("disable_".concat(buttonId), false);
},
mediaStateChanged: function mediaStateChanged(status, mediaId) {
if (this.model.get('mediaId') === mediaId) {
this.model.set('media_status', status);

if (status === 'playing') {
this.model.set('playing', true);
} else {
this.model.set('playing', false);
}

this.model.set('media_status_text', _localeService.default.t("mediaAccessibility.".concat(this.model.get('media_status'))));
this.render();
}
},
completed: function completed() {
this.model.set('nextDisabled', false);
this.render();
},
narrationChanged: function narrationChanged(narrationText) {
this.model.set('narrationText', narrationText);
this.model.set('showNarration', narrationText && this.model.get('narration'));
this.render();
},
muteChange: function muteChange(muted) {
_ef.default.enrollment.setData('muted', muted);

this.model.set('mute', muted === 'on');
this.render();
}
});

var _default = ActionbarView;
exports.default = _default;
});

require.register("views/actionbar/templates/actionbar.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"1":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"navigation") : depth0)) != null ? lookupProperty(stack1,"back") : stack1), depth0));
},"3":function(container,depth0,helpers,partials,data) {
return "back";
},"5":function(container,depth0,helpers,partials,data) {
return "disabled";
},"7":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"navigation") : depth0)) != null ? lookupProperty(stack1,"forward") : stack1), depth0));
},"9":function(container,depth0,helpers,partials,data) {
return "forward";
},"11":function(container,depth0,helpers,partials,data) {
return "aria-disabled=\"disabled\" disabled";
},"13":function(container,depth0,helpers,partials,data) {
var lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return container.escapeExpression((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"hideNarration",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":15,"column":162},"end":{"line":15,"column":183}}}));
},"15":function(container,depth0,helpers,partials,data) {
var lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return container.escapeExpression((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"showNarration",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":15,"column":191},"end":{"line":15,"column":212}}}));
},"17":function(container,depth0,helpers,partials,data) {
return "style=\"display:none;\" ";
},"19":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <select class=\"form-control\" id=\"locale-switcher\" >\n"
+ ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"languages") : depth0),{"name":"each","hash":{},"fn":container.program(20, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":19,"column":8},"end":{"line":21,"column":17}}})) != null ? stack1 : "")
+ " </select>\n";
},"20":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1, alias1=container.escapeExpression, alias2=depth0 != null ? depth0 : (container.nullContext || {}), alias3=container.hooks.helperMissing, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <option value=\""
+ alias1(container.lambda(depth0, depth0))
+ "\" "
+ ((stack1 = lookupProperty(helpers,"if").call(alias2,(lookupProperty(helpers,"equal")||(depth0 && lookupProperty(depth0,"equal"))||alias3).call(alias2,depth0,(depths[1] != null ? lookupProperty(depths[1],"language") : depths[1]),{"name":"equal","hash":{},"data":data,"loc":{"start":{"line":20,"column":41},"end":{"line":20,"column":65}}}),{"name":"if","hash":{},"fn":container.program(21, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":20,"column":35},"end":{"line":20,"column":82}}})) != null ? stack1 : "")
+ ">"
+ alias1((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias3).call(alias2,(lookupProperty(helpers,"concat")||(depth0 && lookupProperty(depth0,"concat"))||alias3).call(alias2,"languages.",depth0,{"name":"concat","hash":{},"data":data,"loc":{"start":{"line":20,"column":87},"end":{"line":20,"column":113}}}),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":20,"column":83},"end":{"line":20,"column":116}}}))
+ "</option>\n";
},"21":function(container,depth0,helpers,partials,data) {
return "selected";
},"23":function(container,depth0,helpers,partials,data) {
return "mute-on";
},"25":function(container,depth0,helpers,partials,data) {
return "mute-off";
},"27":function(container,depth0,helpers,partials,data) {
return "on";
},"29":function(container,depth0,helpers,partials,data) {
return "off";
},"31":function(container,depth0,helpers,partials,data) {
var lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return container.escapeExpression((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"muteOn",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":30,"column":75},"end":{"line":30,"column":89}}}));
},"33":function(container,depth0,helpers,partials,data) {
var lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return container.escapeExpression((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"muteOff",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":30,"column":97},"end":{"line":30,"column":112}}}));
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data,blockParams,depths) {
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, alias4="function", alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "<div class=\"col-md-12 text-right\">\n <div id=\"action_bar\">\n <div class=\"action-buttons\" role=\"navigation\" aria-label=\""
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"secondaryNavigationLabel",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":3,"column":62},"end":{"line":3,"column":94}}}))
+ "\">\n <button class=\"btn btn-default\" id=\"ok_button\" data-close=\"true\">"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"okButton",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":5,"column":71},"end":{"line":5,"column":87}}}))
+ "</button>\n <button class=\"btn btn-default\" data-navigate=\""
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"navigation") : depth0)) != null ? lookupProperty(stack1,"back") : stack1),{"name":"if","hash":{},"fn":container.program(1, data, 0, blockParams, depths),"inverse":container.program(3, data, 0, blockParams, depths),"data":data,"loc":{"start":{"line":6,"column":53},"end":{"line":6,"column":114}}})) != null ? stack1 : "")
+ "\" id=\"back_button\">"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"backButton",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":6,"column":133},"end":{"line":6,"column":151}}}))
+ "</button>\n <button class=\"btn btn-default "
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"nextDisabled") : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":7,"column":37},"end":{"line":7,"column":72}}})) != null ? stack1 : "")
+ "\" data-navigate=\""
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"navigation") : depth0)) != null ? lookupProperty(stack1,"forward") : stack1),{"name":"if","hash":{},"fn":container.program(7, data, 0, blockParams, depths),"inverse":container.program(9, data, 0, blockParams, depths),"data":data,"loc":{"start":{"line":7,"column":89},"end":{"line":7,"column":159}}})) != null ? stack1 : "")
+ "\" id=\"forward_button\" data-trigger=\"manual\" data-toggle=\"popover\"\n data-container=\"body\" data-placement=\"top\" data-content=\""
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"forwardPopover",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":8,"column":71},"end":{"line":8,"column":93}}}))
+ "\" "
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"nextDisabled") : depth0),{"name":"if","hash":{},"fn":container.program(11, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":8,"column":95},"end":{"line":8,"column":155}}})) != null ? stack1 : "")
+ ">"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"forwardButton",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":8,"column":156},"end":{"line":8,"column":177}}}))
+ "</button>\n </div>\n\n <button data-navigate=\"home\" id=\"home_button\" class=\"btn btn-default\">"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"home",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":12,"column":74},"end":{"line":12,"column":86}}}))
+ "</button>\n\n <button class=\"btn btn-default actionbar-buttons "
+ alias3(((helper = (helper = lookupProperty(helpers,"media_status") || (depth0 != null ? lookupProperty(depth0,"media_status") : depth0)) != null ? helper : alias2),(typeof helper === alias4 ? helper.call(alias1,{"name":"media_status","hash":{},"data":data,"loc":{"start":{"line":15,"column":53},"end":{"line":15,"column":69}}}) : helper)))
+ "\" id=\"narration_toggle\" "
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"disable_narration_toggle") : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":15,"column":93},"end":{"line":15,"column":140}}})) != null ? stack1 : "")
+ ">"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"showNarration") : depth0),{"name":"if","hash":{},"fn":container.program(13, data, 0, blockParams, depths),"inverse":container.program(15, data, 0, blockParams, depths),"data":data,"loc":{"start":{"line":15,"column":141},"end":{"line":15,"column":219}}})) != null ? stack1 : "")
+ "</button>\n <span id=\"narration\" "
+ ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"showNarration") : depth0),{"name":"unless","hash":{},"fn":container.program(17, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":16,"column":25},"end":{"line":16,"column":83}}})) != null ? stack1 : "")
+ " tabindex=\"0\">"
+ alias3(((helper = (helper = lookupProperty(helpers,"narrationText") || (depth0 != null ? lookupProperty(depth0,"narrationText") : depth0)) != null ? helper : alias2),(typeof helper === alias4 ? helper.call(alias1,{"name":"narrationText","hash":{},"data":data,"loc":{"start":{"line":16,"column":97},"end":{"line":16,"column":114}}}) : helper)))
+ "</span>\n"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"localeSwitcher") : depth0),{"name":"if","hash":{},"fn":container.program(19, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":17,"column":4},"end":{"line":23,"column":11}}})) != null ? stack1 : "")
+ " <button class=\"btn btn-default actionbar-buttons "
+ alias3(((helper = (helper = lookupProperty(helpers,"media_status") || (depth0 != null ? lookupProperty(depth0,"media_status") : depth0)) != null ? helper : alias2),(typeof helper === alias4 ? helper.call(alias1,{"name":"media_status","hash":{},"data":data,"loc":{"start":{"line":25,"column":53},"end":{"line":25,"column":69}}}) : helper)))
+ "\" "
+ ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"mediaId") : depth0),{"name":"unless","hash":{},"fn":container.program(5, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":25,"column":71},"end":{"line":25,"column":109}}})) != null ? stack1 : "")
+ " id=\"play_button\" "
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"disable_play_button") : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":25,"column":127},"end":{"line":25,"column":169}}})) != null ? stack1 : "")
+ ">"
+ alias3(((helper = (helper = lookupProperty(helpers,"media_status_text") || (depth0 != null ? lookupProperty(depth0,"media_status_text") : depth0)) != null ? helper : alias2),(typeof helper === alias4 ? helper.call(alias1,{"name":"media_status_text","hash":{},"data":data,"loc":{"start":{"line":25,"column":170},"end":{"line":25,"column":191}}}) : helper)))
+ "</button>\n <button class=\"btn btn-default actionbar-buttons "
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"mute") : depth0),{"name":"if","hash":{},"fn":container.program(23, data, 0, blockParams, depths),"inverse":container.program(25, data, 0, blockParams, depths),"data":data,"loc":{"start":{"line":27,"column":53},"end":{"line":27,"column":95}}})) != null ? stack1 : "")
+ "\" id=\"mute_button\" "
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"disable_mute_button") : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":27,"column":114},"end":{"line":27,"column":156}}})) != null ? stack1 : "")
+ "\n "
+ ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"mediaId") : depth0),{"name":"unless","hash":{},"fn":container.program(5, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":28,"column":12},"end":{"line":28,"column":50}}})) != null ? stack1 : "")
+ "\n data-mute-off-text=\""
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"muteOff",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":29,"column":32},"end":{"line":29,"column":47}}}))
+ "\" data-mute-on-text=\""
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"muteOn",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":29,"column":68},"end":{"line":29,"column":82}}}))
+ "\"\n data-mute-state=\""
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"mute") : depth0),{"name":"if","hash":{},"fn":container.program(27, data, 0, blockParams, depths),"inverse":container.program(29, data, 0, blockParams, depths),"data":data,"loc":{"start":{"line":30,"column":29},"end":{"line":30,"column":61}}})) != null ? stack1 : "")
+ "\">"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"mute") : depth0),{"name":"if","hash":{},"fn":container.program(31, data, 0, blockParams, depths),"inverse":container.program(33, data, 0, blockParams, depths),"data":data,"loc":{"start":{"line":30,"column":63},"end":{"line":30,"column":119}}})) != null ? stack1 : "")
+ "</button>\n\n <!--<button class=\"btn btn-default\" data-back id=\"skip_button\">Skip</button>-->\n <div class=\"breadcrumbs\">\n <span class=\"home\">\n <a href=\"#menu\">"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"home",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":36,"column":24},"end":{"line":36,"column":36}}}))
+ "</a>\n </span>\n <span class=\"group\">\n "
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"groupTitle") : depth0),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":39,"column":8},"end":{"line":39,"column":24}}}))
+ "\n </span>\n <span class=\"module\">\n "
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"moduleTitle") : depth0),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":42,"column":8},"end":{"line":42,"column":25}}}))
+ "\n </span>\n <span class=\"page\">\n "
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"pageTitle") : depth0),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":45,"column":8},"end":{"line":45,"column":23}}}))
+ "\n </span>\n </div>\n <div class=\"progress\">\n <div class=\"progress-bar\" role=\"progressbar\" style=\"width:"
+ alias3(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"pageProgress") : depth0)) != null ? lookupProperty(stack1,"progressPercentage") : stack1), depth0))
+ "%;\" aria-valuenow=\""
+ alias3(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"pageProgress") : depth0)) != null ? lookupProperty(stack1,"progressPercentage") : stack1), depth0))
+ "\" aria-valuemin=\"0\" aria-valuemax=\"100\">\n <div class=\"steps-completed\">"
+ alias3(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"pageProgress") : depth0)) != null ? lookupProperty(stack1,"pagesCompleted") : stack1), depth0))
+ "/"
+ alias3(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"pageProgress") : depth0)) != null ? lookupProperty(stack1,"totalPages") : stack1), depth0))
+ "</div>\n </div>\n </div>\n\n </div>\n</div>\n";
},"useData":true,"useDepths":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/alert/alert-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AudioStarterAlertView = exports.AlertView = void 0;

var _view = _interopRequireDefault(require("views/base/view"));

var _alert = _interopRequireDefault(require("./templates/alert"));

var _audioStarterAlert = _interopRequireDefault(require("./templates/audio-starter-alert"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _iconLoadService = _interopRequireDefault(require("services/loader-handler-services/icon-load-service"));

/*
Use:
this.renderAlert(
'error', << alert type will add this to the alert container as a class for style overrides
'alert title',
'alert body text. For accessibility, include an id in the text and be clear what the user is to do for next steps',
'alert-icon fas icon-for-alert' << icon class name
);
*/
var AlertView = _view.default.extend({
template: _alert.default,
autoRender: true,
className: 'content__container',
attach: function attach() {
var _this$model;

this.timeoutId = setTimeout(function () {
_chaplin.default.mediator.publish('alert:close');
}, (_this$model = this.model) !== null && _this$model !== void 0 && _this$model.has('timeout') ? this.model.get('timeout') : 5000);

_view.default.prototype.attach.apply(this, arguments);
}
});

exports.AlertView = AlertView;

var AudioStarterAlertView = _view.default.extend({
template: _audioStarterAlert.default,
autoRender: true,
region: 'audio-starter-alert',
className: 'content__container',
attach: function attach() {
_iconLoadService.default.applyIcon('fas fa-exclamation-circle', 'audio-starter__icon');

this.delegate('click', '.alert__closeBtn, #start_audio', function () {
_chaplin.default.mediator.publish('audio:unblock');

_chaplin.default.mediator.publish('audio-starter-alert:close');
});

_view.default.prototype.attach.apply(this, arguments);
}
});

exports.AudioStarterAlertView = AudioStarterAlertView;
});

require.register("views/alert/templates/alert.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"1":function(container,depth0,helpers,partials,data) {
return "hidden-accessible-text";
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <div class=\"alert-default clearfix "
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"type") : depth0),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":47}}}))
+ " "
+ ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"visibility") : depth0),{"name":"unless","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":103}}})) != null ? stack1 : "")
+ "\">\n"
+ ((stack1 = container.invokePartial(lookupProperty(partials,"icon"),depth0,{"name":"icon","hash":{"icon_class":(depth0 != null ? lookupProperty(depth0,"ico") : depth0)},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "")
+ " <span class=\"alert__container\">\n <p class=\"alert__container__title\">"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"title") : depth0),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":4,"column":42},"end":{"line":4,"column":53}}}))
+ "</p>\n <p class=\"alert__container__message\">"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"body") : depth0),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":5,"column":44},"end":{"line":5,"column":54}}}))
+ "</p>\n </span>\n </div>\n";
},"usePartial":true,"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/alert/templates/audio-starter-alert.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <div class=\"alert-default clearfix error\" role=\"alert\">\n"
+ ((stack1 = container.invokePartial(lookupProperty(partials,"icon"),depth0,{"name":"icon","hash":{"classes":"audio-starter__icon","icon":"fas fa-exclamation-circle","uuid":"audio-starter__icon"},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "")
+ " <div class=\"alert__container\">\n <p class=\"alert__container__title\">"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"audioFailedAlertTitle",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":4,"column":42},"end":{"line":4,"column":71}}}))
+ "</p>\n <p class=\"alert__container__message\">"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"audioFailedAlertBody",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":5,"column":44},"end":{"line":5,"column":72}}}))
+ "</p>\n <button class=\"btn btn-compact btn-overlay\" id=\"start_audio\">"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"startAudioButton",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":6,"column":68},"end":{"line":6,"column":92}}}))
+ "</button>\n </div>\n <button type=\"button\" class=\"alert__closeBtn close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n";
},"usePartial":true,"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/atoms/atoms-module.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _iconAtomView = _interopRequireDefault(require("views/atoms/icon-atom/icon-atom-view"));

var _linkAtomView = _interopRequireDefault(require("views/atoms/link-atom/link-atom-view"));

var _buttonAtomView = _interopRequireDefault(require("views/atoms/button-atom/button-atom-view"));

var atoms = {
IconAtomView: _iconAtomView.default,
LinkAtomView: _linkAtomView.default,
ButtonAtomView: _buttonAtomView.default
};
var _default = atoms;
exports.default = _default;
});

require.register("views/atoms/base-atom-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _view = _interopRequireDefault(require("views/base/view"));

var _iconLoadService = _interopRequireDefault(require("services/loader-handler-services/icon-load-service"));

var BaseAtomView = _view.default.extend({
autoRender: true,
listen: {
'dialog:show mediator': 'loadIcons'
},
initialize: function initialize() {
this.loadIcons();
},
getTemplateData: function getTemplateData() {
return this.model;
},
getTemplateFunction: function getTemplateFunction() {
return this.template;
},
loadIcons: function loadIcons() {
if (this.model.has('iconBefore')) {
_iconLoadService.default.applyIcon(this.model.get('iconBefore'), this.model.get('cid'));
}

if (this.model.has('iconAfter')) {
_iconLoadService.default.applyIcon(this.model.get('iconAfter'), this.model.get('cid'));
}
}
});

var _default = BaseAtomView;
exports.default = _default;
});

require.register("views/atoms/button-atom/button-atom-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _baseAtomView = _interopRequireDefault(require("views/atoms/base-atom-view"));

var _buttonAtom = _interopRequireDefault(require("./templates/button-atom"));

var ButtonAtomView = _baseAtomView.default.extend({
template: _buttonAtom.default,
initialize: function initialize() {
_baseAtomView.default.prototype.initialize.apply(this, arguments);
}
});

var _default = ButtonAtomView;
exports.default = _default;
});

require.register("views/atoms/button-atom/templates/button-atom.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"1":function(container,depth0,helpers,partials,data) {
return "disabled";
},"3":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return ((stack1 = container.invokePartial(lookupProperty(partials,"icon"),depth0,{"name":"icon","hash":{"icon":((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"iconBefore") : stack1),"uuid":((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"cid") : stack1)},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "");
},"5":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return container.escapeExpression((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"txt") : stack1),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":7,"column":26},"end":{"line":7,"column":46}}}));
},"7":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return ((stack1 = container.invokePartial(lookupProperty(partials,"icon"),depth0,{"name":"icon","hash":{"icon":((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"iconAfter") : stack1),"uuid":((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"cid") : stack1)},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "");
},"9":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " "
+ ((stack1 = container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"afterContent") : stack1), depth0)) != null ? stack1 : "")
+ "\n";
},"11":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <div style=\"pointer-events:none;\" data-region=\""
+ container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"blocksRegion") : stack1), depth0))
+ "\"></div>\n";
},"13":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " "
+ ((stack1 = container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"injectedContent") : stack1), depth0)) != null ? stack1 : "")
+ "\n";
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, alias1=container.lambda, alias2=container.escapeExpression, alias3=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "<button\n "
+ alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"attributes") : stack1), depth0))
+ "\n class=\""
+ alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"classes") : stack1), depth0))
+ " "
+ ((stack1 = lookupProperty(helpers,"if").call(alias3,(lookupProperty(helpers,"equal")||(depth0 && lookupProperty(depth0,"equal"))||container.hooks.helperMissing).call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"disabled") : stack1),"disabled",{"name":"equal","hash":{},"data":data,"loc":{"start":{"line":3,"column":40},"end":{"line":3,"column":78}}}),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":34},"end":{"line":3,"column":95}}})) != null ? stack1 : "")
+ "\">"
+ ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"iconBefore") : stack1),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":4,"column":4},"end":{"line":6,"column":12}}})) != null ? stack1 : "")
+ ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"txt") : stack1),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":53}}})) != null ? stack1 : "")
+ ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"iconAfter") : stack1),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":8,"column":4},"end":{"line":10,"column":12}}})) != null ? stack1 : "")
+ ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"afterContent") : stack1),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":11,"column":4},"end":{"line":13,"column":12}}})) != null ? stack1 : "")
+ ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"blocksRegion") : stack1),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":14,"column":4},"end":{"line":16,"column":12}}})) != null ? stack1 : "")
+ ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"contentInjection") : stack1),{"name":"if","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":17,"column":4},"end":{"line":19,"column":12}}})) != null ? stack1 : "")
+ "</button>\n";
},"usePartial":true,"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/atoms/icon-atom/icon-atom-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _baseAtomView = _interopRequireDefault(require("views/atoms/base-atom-view"));

var _iconAtom = _interopRequireDefault(require("./templates/icon-atom"));

var _iconLoadService = _interopRequireDefault(require("services/loader-handler-services/icon-load-service"));

var IconAtomView = _baseAtomView.default.extend({
template: _iconAtom.default,
render: function render() {
var _this$model$attribute = this.model.attributes,
icon = _this$model$attribute.icon,
_this$model$attribute2 = _this$model$attribute.classes,
classes = _this$model$attribute2 === void 0 ? null : _this$model$attribute2,
_this$model$attribute3 = _this$model$attribute.prefix,
prefix = _this$model$attribute3 === void 0 ? null : _this$model$attribute3;

if (icon) {
var icontParams = _iconLoadService.default.setPrefixAndName(icon, prefix);

this.model.set('icon', icontParams.name);
this.model.set('prefix', icontParams.prefix);

_iconLoadService.default.applyIcon(icontParams.name, this.model.cid, classes, icontParams.prefix);

_baseAtomView.default.prototype.render.apply(this, arguments);
}
}
});

var _default = IconAtomView;
exports.default = _default;
});

require.register("views/atoms/icon-atom/templates/icon-atom.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return ((stack1 = container.invokePartial(lookupProperty(partials,"icon"),depth0,{"name":"icon","hash":{"name":((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"icon") : stack1),"sr_caption":((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"caption") : stack1),"classes":((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"classes") : stack1),"prefix":((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"prefix") : stack1),"uuid":(depth0 != null ? lookupProperty(depth0,"cid") : depth0)},"data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "");
},"usePartial":true,"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/atoms/index.js", function(exports, require, module) {
"use strict";

require("views/atoms/atoms-module");

require("views/atoms/base-atom-view");

require("views/atoms/button-atom/button-atom-view");

require("views/atoms/icon-atom/icon-atom-view");

require("views/atoms/link-atom/link-atom-view");
});

require.register("views/atoms/link-atom/link-atom-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _baseAtomView = _interopRequireDefault(require("views/atoms/base-atom-view"));

var _linkAtom = _interopRequireDefault(require("./templates/link-atom"));

var LinkAtomView = _baseAtomView.default.extend({
template: _linkAtom.default,
initialize: function initialize() {
_baseAtomView.default.prototype.initialize.apply(this, arguments);
}
});

var _default = LinkAtomView;
exports.default = _default;
});

require.register("views/atoms/link-atom/templates/link-atom.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"1":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return ((stack1 = container.invokePartial(lookupProperty(partials,"icon"),depth0,{"name":"icon","hash":{"icon":((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"iconBefore") : stack1),"uuid":((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"cid") : stack1)},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "");
},"3":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return ((stack1 = container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"beforeContent") : stack1), depth0)) != null ? stack1 : "");
},"5":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return ((stack1 = container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"afterContent") : stack1), depth0)) != null ? stack1 : "");
},"7":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return ((stack1 = container.invokePartial(lookupProperty(partials,"icon"),depth0,{"name":"icon","hash":{"icon":((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"iconAfter") : stack1),"uuid":((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"cid") : stack1)},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "");
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, alias1=container.lambda, alias2=container.escapeExpression, alias3=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "<a\n"
+ alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"attributes") : stack1), depth0))
+ "\nclass=\""
+ alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"classes") : stack1), depth0))
+ "\">"
+ ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"iconBefore") : stack1),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":4,"column":0},"end":{"line":6,"column":9}}})) != null ? stack1 : "")
+ ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"beforeContent") : stack1),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":7,"column":0},"end":{"line":9,"column":9}}})) != null ? stack1 : "")
+ alias2((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||container.hooks.helperMissing).call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"txt") : stack1),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":22}}}))
+ ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"afterContent") : stack1),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":11,"column":0},"end":{"line":13,"column":9}}})) != null ? stack1 : "")
+ ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"attributes") : depth0)) != null ? lookupProperty(stack1,"iconAfter") : stack1),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":14,"column":0},"end":{"line":16,"column":9}}})) != null ? stack1 : "")
+ "</a>";
},"usePartial":true,"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/base/collection-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _view = _interopRequireDefault(require("views/base/view"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _lodash = _interopRequireDefault(require("lodash"));

var _default = _chaplin.default.CollectionView.extend({
listen: {
addedToDOM: 'collectionAddedToDOM'
},
// This class doesn’t inherit from the application-specific View class,
// so we need to borrow the method from the View prototype:
getTemplateFunction: _view.default.prototype.getTemplateFunction,
collectionAddedToDOM: function collectionAddedToDOM() {
_lodash.default.each(this.subviews, function (s) {
return s.trigger('parentAddedToDOM');
});
},
keepSubviews: function keepSubviews(keep) {
if (this.subviews && Array.isArray(this.subviews)) {
this.subviews.forEach(function (subview) {
subview.keepElement = keep;

if (subview.keepSubviews) {
subview.keepSubviews(keep);
}
});
}
}
});

exports.default = _default;
});

require.register("views/base/view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

require("lib/view-helper");

var _chaplin = _interopRequireDefault(require("chaplin"));

var _runtime = _interopRequireDefault(require("handlebars/runtime"));

var View = _chaplin.default.View.extend({
getTemplateFunction: function getTemplateFunction() {
//TODO: Review this in regards to non-page views
// Template compilation
// --------------------
// This demo uses Handlebars templates to render views.
// The template is loaded with Require.JS and stored as string on
// the view prototype. On rendering, it is compiled on the
// client-side. The compiled template function replaces the string
// on the view prototype.
//
// In the end you might want to precompile the templates to JavaScript
// functions on the server-side and just load the JavaScript code.
// Several precompilers create a global JST hash which stores the
//
// template functions. You can get the function by the template name:
// templateFunc = JST[@templateName];
var template = this.template;
var templateFunc = null;

if (typeof template === 'string') {
// Compile the template string to a function and save it
// on the prototype. This is a workaround since an instance
// shouldn’t change its prototype normally.
templateFunc = _runtime.default.compile(template);
this.constructor.prototype.template = templateFunc;
} else {
templateFunc = template;
}

return templateFunc;
},

/**
* This is an exact copy of the default Chaplin render method with one exception. allowProtoPropertiesByDefault is flipped to true
* https://github.com/chaplinjs/chaplin/blob/master/src/chaplin/views/view.coffee#L422
*
* This is needed for 3 reasons:
* Handlebars changed how it iterates over properties, so that the prototype properties were not included.
* Chaplin will not be updated, and it copies properties on to the prototype.
* Chaplin does not have an api to send Handlebars options into the template
*
* Handlebars added an option `allowProtoPropertiesByDefault` to allow this behavior. This is false by default because it
* has security implications. See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access
*/
render: function render() {
var el, html;

if (this.disposed) {
return false;
}

var templateFunc = this.getTemplateFunction();

if (typeof templateFunc === 'function') {
html = templateFunc(this.getTemplateData(), {
allowProtoPropertiesByDefault: true
});

if (this.noWrap) {
el = document.createElement('div');
el.innerHTML = html;

if (el.children.length > 1) {
throw new Error('There must be a single top-level element when ' + 'using `noWrap`.');
}

this.undelegateEvents();
this.setElement(el.firstChild, true);
} else {
this.el.innerHTML = html;
}
}

return this;
},
keepSubviews: function keepSubviews(keep) {
if (this.subviews && Array.isArray(this.subviews)) {
this.subviews.forEach(function (subview) {
// prevents: TypeError "Cannot add property keepElement, object is not extensible"
subview = Object.assign({}, subview, {
keepElement: keep
});

if (subview.keepSubviews) {
subview.keepSubviews(keep);
}
});
}
}
});

var _default = View;
exports.default = _default;
});

require.register("views/block/base-block-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _view = _interopRequireDefault(require("views/base/view"));

var _blockCollectionView = _interopRequireDefault(require("views/block/block-collection-view"));

var _localeService = _interopRequireDefault(require("services/loader-handler-services/locale-service"));

var _contentService = _interopRequireDefault(require("services/loader-handler-services/content-service"));

var _blockOrderService = _interopRequireDefault(require("services/course-handler-services/block-order-service"));

var _atomLoader = _interopRequireDefault(require("services/loader-handler-services/atom-loader"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _lodash = _interopRequireDefault(require("lodash"));

var _utils = _interopRequireDefault(require("lib/utils"));

/***
* @View
*
* @name common
* @type common
* @description Common (Base Block) - Properties and objects that apply to all blocks.
* @maturing
* @content
* @prop @hidden @required @readonly type type={string} title="Type"
* @prop class type={string} title="Class" description="This class is for the main block."
* @prop @advanced tabindex type={string} title="Tab Index" description="Attribute that is used to manage keyboard focus as well as the sequential keyboard navigation (tab order)."
* @prop @advanced order type={integer} title="Order" description="Sets the order of the blocks and keeps them in a loaded state until their order comes up. Ordered blocks can be specified out of order and in any numbered sequence. They can also be nested inside unordered blocks. Note: An ordered block will still propagate its order to its children. A special order state, 'end', only activates once all ordered/unordered blocks are completed."
* @prop @advanced disable_order_on_replay type={boolean} title="Disable Order on Replay - Disables the previous assigned block order when returning to a completed page."
* @prop @advanced animation type={string} title="Animation" description="Click and mouseover animation javascript (AniJS) options." @allow animationPicker
* @contains @advanced @object_of 'onscroll' with:
* @prop [animation] type={string} title="Scroll Animation Style" description="Choose one of several options to either fade, flip, slide or zoom for the scroll animation."
* "fade"
* "fade-up"
* "fade-down"
* "fade-left"
* "fade-right"
* "fade-up-right"
* "fade-up-left"
* "fade-down-right"
* "fade-down-left"
* "flip-up"
* "flip-down"
* "flip-left"
* "flip-right"
* "slide-up"
* "slide-down"
* "slide-left"
* "slide-right"
* "zoom-in"
* "zoom-in-up"
* "zoom-in-down"
* "zoom-in-left"
* "zoom-in-right"
* "zoom-out"
* "zoom-out-up"
* "zoom-out-down"
* "zoom-out-left"
* "zoom-out-right"
* @prop duration type={string} title="Scroll Animation Duration" description="Milliseconds (e.g., '500'); value from 0 to 3000, with step 50ms." pattern="^[1-3]?[0-9]?[50]?0$"
* @prop delay type={string} title="Scroll Animation Delay" description="Milliseconds (e.g., '500'); value from 0 to 3000, with step 50ms." pattern="^[1-3]?[0-9]?[50]?0$"
* @prop offset type={string} title="Scroll Animation Offset" description="Pixels offset from the original trigger point (e.g., '50')" pattern="^[0-9]*$"
* @prop mirror type={boolean} title="Scroll Animation Mirror - Reverse the scroll animation properties."
* @prop once type={boolean} title="Scroll Animation Once - Animation only occurs one time."
* @prop [easing] type={string} title="Scroll Animation Easing" description="Choose the acceleration or deceleration style for the scroll animation."
* "ease"
* "ease-in"
* "ease-out"
* "ease-in-out"
* "ease-in-back"
* "ease-out-back"
* "ease-in-out-back"
* "ease-in-sine"
* "ease-out-sine"
* "ease-in-out-sine"
* "ease-in-quad"
* "ease-out-quad"
* "ease-in-out-quad"
* "ease-in-cubic"
* "ease-out-cubic"
* "ease-in-out-cubic"
* "ease-in-quart"
* "ease-out-quart"
* "ease-in-out-quart"
* @end
* @contains @advanced @object_of 'aria' with:
* @prop [role] type={string} title="Role" description="Defines a user interface element like a button or a tooltip. Roles are categorized as abstract, widget, document structure and landmark roles."
* "alert"
* "alertdialog"
* "button"
* "checkbox"
* "dialog"
* "gridcell"
* "ink"
* "log"
* "marquee"
* "menuitem"
* "menuitemcheckbox"
* "menuitemradio"
* "option"
* "progressbar"
* "radio"
* "scrollbar"
* "slider"
* "spinbutton"
* "status"
* "tab"
* "tabpanel"
* "textbox"
* "timer"
* "tooltip"
* "treeitem"
* "combobox"
* "grid"
* "listbox"
* "menu"
* "menubar"
* "radiogroup"
* "tablist"
* "tree"
* "treegrid"
* "article"
* "columnheader"
* "definition"
* "directory"
* "document"
* "group"
* "heading"
* "img"
* "list"
* "listitem"
* "math"
* "note"
* "presentation"
* "region"
* "row"
* "rowgroup"
* "rowheader"
* "separator"
* "toolbar"
* "application"
* "banner"
* "complementary"
* "contentinfo"
* "form"
* "main"
* "navigation"
* "search"
* @prop [live] type={string} title="Aria-Live" description="Choose the value that defines how the screen-reader will present dynamically changing content of an element. It’s value can be set to off (the same as not using it at all), assertive (interrupts user actions to announce changes; example would be to recite the text for a hover link or button as it will recite and stop on and off hover), and polite (tells the screen reader to wait until the user is done to announce updates; example would be reciting the back of a flipcard so it waits until the user flips before reciting)."
* "assertive"
* "off"
* "polite"
* @prop label type={string} title="Aria-Label" description="Used to add accessible help or a description to an element. It will also override an element that already has a label assigned to it like a button. A use case would be adding a label when you have some kind of visual indication of an element's purpose, such as a button that uses a graphic instead of text."
* @prop labelledby type={string} title="Aria-Labelledby" description="Specifies the ID of another element in the DOM as an element's label. May also be used on any element, not just labelable elements. It overrides all other name sources for an element"
* @prop describedby type={string} title="Aria-Describedby" description="Use when there is some extra explanatory text that a user might need, whether it applies only to users of assistive technology or all users. Example is a password input field that is accompanied by some descriptive text explaining the minimum password requirements. It is a great way to communicate supplementary, but not essential, information and yet, it won't get in the way of more critical information such as the element's role."
* @end
* @prop @ignore additionalProperties type={string}
*/
// # BlockView
//
// Base view to be used with all views that will render a page.
// All blocks have the following properties:
// * type: defines which type of block to load
// * class: a class to apply to the div that will wrap around the block
//
// Conventions:
// * page.type: used to define file paths
// ** the page views themselves should be located at /views/page/*TYPE*/*TYPE*-view
// ** all templates that might be rendered by the view should be located at /views/page/*TYPE*/templates/
// ** the default template is expected at /views/page/*TYPE*/templates/*TYPE*
// * page.template (optional): a template name other than the default
// ** if left undefined, the default template will be used
// ** must correspond to the name of another template in the templates folder for the view
// Initialization Flow and State Transitions:
// * Chaplin will call `initialize` where we hook `prePlay` to the `addedToDOM` event; `state: initialized`
// * `prePlay` calls load, which should be used by the page to add in DOM elements and such, but not to start anything playing; `state: loaded`
// * `prePlay` will also display the instructions, if available for the page. Once the user is finished with them, `autoPlay` will be called.
// If instructions are not available, `autoPlay` is called immediately. `state: playing`
// * `play` should be on the pages themselves and is for actions when the page starts
// Methods for Inheriting Objects
// * load, play, mute, unmute, pause, resume, replay
var BlockView = _view.default.extend({
autoRender: true,
listen: {
'action:pause mediator': 'pause',
'action:resume mediator': 'resume',
'action:mute mediator': 'mute',
'action:unmute mediator': 'unmute'
},
initialize: function initialize(options) {
_lodash.default.bindAll(this, 'readyToGo');

this.parent = options.parent;
this.script = options.script;
this.pageView = options.pageView;
this.nestedLoads = [];

if (this.pageView) {
this.pageView.nested = [];
}

if (_ef.default.forgeMode) {
this.setForgeEvts();
} // Allow Atoms ?


this.atomsAllowed = false; //TODO: using this when rendering nested views; want this value available in hbs templates

this.model.set('cid', this.model.cid);
var self = this; //TODO: we're kinda tied to blocks never being rendered outside of a collection, confirm that's OK

if (this.model.get('order') && this.pageView.model.get('completed') && this.model.get('disable_order_on_replay')) {
this.model.unset('order');
}

this.listenTo(this.parent, 'addedToDOM', function () {
if (self.model.get('tabindex') || self.model.get('tabindex') === 0) {
self.$el.attr('tabindex', self.model.get('tabindex'));
}

if (self.atomsAllowed && !self.atomsRendered) {
self.renderAtomsFromTemplate();
}

self.load();
self.applyAnimationProperty();
self.applyAriaProperties();
self.applyAttributeProperties();
self.applyTabIndex();

if (self.nestedLoads.length === 0) {
if (self.model.get('state') === 'initialized') {
self.setState('loaded');
}

self.trigger('block:state:loaded', self);
} else {
Promise.all(self.nestedLoads).then(function () {
if (self.model.get('state') === 'initialized') {
self.setState('loaded');
}

self.trigger('block:state:loaded', self);
});
}
});
this.listenTo(this.parent, 'page:state:change', this.onStateChange);
this.setState('initialized');

_view.default.prototype.initialize.apply(this, arguments);
},
setForgeEvts: function setForgeEvts() {
var _this = this;

var forgePath = this.model.get('forge_path');

if (!forgePath) {
forgePath = this.model.get('objpath');
}

if (this.model.get('content_region')) {
this.$el[0].setAttribute('data-content-region', this.model.get('content_region'));
}

this.$el[0].setAttribute('data-forge-path', forgePath);

if (this.model.get('type') === 'component') {
this.$el[0].setAttribute('data-forge-type', this.model.get('path').split('/').reverse()[0]);
} else {
this.$el[0].setAttribute('data-forge-type', this.model.get('type'));
}

this.$el.on('mouseenter mouseleave mousedown mouseup contextmenu', function (evt) {
if (_this.model.get('type') === 'browser-course-editor') {
evt.stopPropagation();
} else {
evt.preventDefault();

_this.publishEvent("forge:block:".concat(evt.type), {
forgeId: _this.model.get('forgeId'),
blockEvt: evt,
$el: _this.$el,
modelObj: _this.model.attributes,
pageX: evt.pageX,
pageY: evt.pageY
});
}
});
},
renderMultipleNestedBlocks: function renderMultipleNestedBlocks(arrayName) {
var self = this; // add the nested item type to array for this page

if (this.pageView && !this.pageView.nested.includes(arrayName)) {
this.pageView.nested.push(arrayName);
}

_lodash.default.each(this.model.get(arrayName), function (item, index) {
self.renderNestedBlocks("".concat(self.model.get('cid'), "-").concat(arrayName, "-").concat(index, "-blocks"), item.blocks);
});
},
renderNestedBlocks: function renderNestedBlocks(blockRegionName, blocks, templateData) {
var _this2 = this;

if (!blocks) {
return;
}

this.registerRegion(blockRegionName, "[data-region=\"".concat(blockRegionName, "\"]"));

var nestedBlockPromise = _contentService.default.buildBlockCollection(blocks).then(function (blockCollection) {
blockCollection.each(function (b) {
if (_this2.model.get('order')) {
var disableOrderOnReplay = _this2.pageView.model.get('completed') && _this2.model.get('disable_order_on_replay');

if (!disableOrderOnReplay) {
b.set('order', _this2.model.get('order'));
}
}
});
var blocksViewOptions = {
collection: blockCollection,
region: blockRegionName,
parent: _this2,
autoAttach: _this2.autoAttach,
script: _this2.script,
pageView: _this2.pageView,
templateData: templateData
};

if (blocks.forge_path) {
blocksViewOptions.collection.forge_path = blocks.forge_path;
}

var blocksView = new _blockCollectionView.default(blocksViewOptions);

_this2.listenTo(blocksView, 'block:state:loaded', function (block) {
this.trigger('block:state:loaded', block);
});

_this2.listenTo(blocksView, 'block:state:completed', function (block) {
this.trigger('block:state:completed', block);

if (this.$el && _lodash.default.every(this.subviews, function (sv) {
return !(sv instanceof _blockCollectionView.default) || sv.isComplete();
})) {
this.$el.addClass('all-completed');
}
});

_this2.subview(blockRegionName, blocksView);
});

this.nestedLoads.push(nestedBlockPromise);
return nestedBlockPromise;
},
render: function render() {
this.atomsRendered = false;

_view.default.prototype.render.apply(this, arguments);
},
reRender: function reRender() {
this.render();

if (this.script && this.script.reRender) {
this.script.reRender();
}
},
onStateChange: function onStateChange(parent) {
var parentState = parent.model.get('state');
var order = this.model.get('order');
var state = this.model.get('state'); // don't push completed parent state on children
// and prevent collisions of triggered events

if (parentState !== 'completed' && state !== 'completed') {
if (parentState === 'playing' && order) {
if (order === _blockOrderService.default.getCurrentOrder()) {
this.setState(parentState);
}
} else {
this.setState(parentState);
}
} else if (parentState === 'completed' && state === 'loaded' && order === _blockOrderService.default.getCurrentOrder()) {
this.setState('playing');
}

this.trigger('page:state:change', parent);
},
// Atoms render utilities
createAtomRegion: function createAtomRegion(region) {
var regionId = "atom-".concat(region.atom, "-").concat(region.cid);
this.registerRegion(regionId, "#".concat(region.cid));
return regionId;
},
createAtomForRegion: function createAtomForRegion(config, regionId) {
var atomConfig = _atomLoader.default.setAtomConfig(config, this.el);

var atomClass = config.atom;
atomConfig.attributes = _atomLoader.default.setAtomAttributes(config);
var AtomView = new _atomLoader.default.atoms[atomClass]({
region: regionId,
model: new _chaplin.default.Model(atomConfig)
});
this.subview(regionId, AtomView);
},
renderAtomsFromTemplate: function renderAtomsFromTemplate() {
var regions = _atomLoader.default.loadAtomRegions(this.el);

if (regions.length > 0) {
for (var r = 0; r < regions.length; r++) {
var region = regions[r].get();
var regionId = this.createAtomRegion(region);
this.createAtomForRegion(region, regionId);
regions[r].clean();
}

this.atomsRendered = true;
} else {
throw new Error('There are not [data-atom] elements. Consider to disallow Atoms on your block');
}
},
//TODO: figure out how these interact with the page-view and actionbar
load: function load() {},
play: function play() {
if (_ef.default.options.local) {
throw new Error('Play method should be implemented for all blocks');
}
},
pause: function pause() {},
resume: function resume() {},
replay: function replay() {},
reload: function reload() {},
complete: function complete() {
this.trigger('block:state:completed', this);
},
unload: function unload() {},
mute: function mute() {},
unmute: function unmute() {},
getTemplateFunction: function getTemplateFunction() {
if (this.model.get('customTemplate')) {
return require(this.model.get('customTemplate'));
} else {
return this.template;
}
},
readyToGo: function readyToGo() {
this.setState('completed');
},
setState: function setState(newState) {
if (!this.model) {
return;
}

var oldState = this.model.get('state');
this.model.set('state', newState);
this.$el.removeClass(oldState).addClass(newState);
var stateListeners = {
playing: this.play,
paused: this.pause,
completed: this.complete,
unloading: this.unload
};

if (newState === 'playing' && oldState === 'paused') {
this.resume();
} else if (stateListeners[newState]) {
_lodash.default.bind(stateListeners[newState], this).call();
}

if (newState === 'playing' && oldState === 'loaded' && _ef.default.enrollment.get('demoMode')) {
this.readyToGo();
}
},
isLoaded: function isLoaded() {
var selfLoaded = this.model.get('state') && this.model.get('state') !== 'initialized';

if (selfLoaded && this.subviews) {
return _lodash.default.every(this.subviews, function (subview) {
if (subview instanceof _blockCollectionView.default) {
return subview.isLoaded();
} else {
return true;
}
});
} else {
return selfLoaded;
}
},
isComplete: function isComplete() {
if (!this.model) {
return;
}

var selfComplete = this.model.get('state') === 'completed';

if (selfComplete && this.subviews) {
return _lodash.default.every(this.subviews, function (subview) {
if (subview instanceof _blockCollectionView.default) {
return subview.isComplete();
} else {
return true;
}
});
} else {
return selfComplete;
}
},
applyAnimationProperty: function applyAnimationProperty() {
_utils.default.applyAnimationProperty(this);
},
applyAriaProperties: function applyAriaProperties() {
var _this3 = this;

if (this.model.get('aria')) {
Object.keys(this.model.get('aria')).forEach(function (key) {
var value = _this3.model.get('aria')[key];

var prefix = '';

if (key !== 'role') {
prefix = 'aria-';
}

_this3.$el.attr(prefix + key, _localeService.default.t(value));
});
}
},
renderChildAriaProperties: function renderChildAriaProperties(childItem, i) {
var parentEl = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.$el;

if (Object.prototype.hasOwnProperty.call(childItem, 'aria')) {
Object.keys(childItem.aria).forEach(function (itemKey) {
var keyVal = childItem.aria[itemKey];
var prefix = 'aria-';

if (itemKey === 'role') {
prefix = '';
}

parentEl.children().eq(i).attr(prefix + itemKey, _localeService.default.t(keyVal));
});
}
},

/**
* Applies an arbitrary collection of attributes to any block
*
* Notes:
* A value can be provided and the selector to find the element will default to [data-attributable]
*
* An object containing a selector and a value can be provided for more control
*
* The keys that describe the attribute name can be deeply nested and will be separated by dashes
* Example: { data: { test: { one: { two: 2}}} => data-test-one-two="2"
*
* Example:
* - type: text
* items:
* - description: some text
* attributes:
* data:
* value: 10 #=> yields data-value="10" with selector [data-attributable]
* info:
* - selector: '.item' #=> yields data-info="10" with selector .item
* value: 10
* aria:
* label: some text #=> yields aria-label="some text" with selector [data-attributable]
*/
applyAttributeProperties: function applyAttributeProperties() {
var _this4 = this;

var attributes; // attributes in fields are deeply nested, that's why we are doing this

if (this.subviewsByName.field && this.subviewsByName.field.model) {
var fieldModel = this.subviewsByName.field.model; // this is for choice fields

var optionAttributes = _lodash.default.find(fieldModel.get('options'), 'attributes'); // all other fields


var fieldAttributes = fieldModel.get('attributes');
attributes = optionAttributes ? _lodash.default.get(optionAttributes, 'attributes') : fieldAttributes;
} else {
attributes = this.model.get('attributes');
}

if (attributes) {
attributes = _lodash.default.cloneDeep(attributes);

var attrArray = function flatten(attrs, path) {
var _Array$prototype;

return (_Array$prototype = Array.prototype).concat.apply(_Array$prototype, (0, _toConsumableArray2.default)(Object.entries(attrs).map(function (_ref) {
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
key = _ref2[0],
value = _ref2[1];

if (Array.isArray(value)) {
return value.map(function (v) {
return {
attribute: "".concat(path, "-").concat(key),
value: _lodash.default.get(v, 'value'),
selector: _lodash.default.get(v, 'selector')
};
});
} else if ((0, _typeof2.default)(value) === 'object') {
return flatten(value, path ? "".concat(path, "-").concat(key) : key);
} else {
return {
attribute: path ? "".concat(path, "-").concat(key) : "".concat(key),
value: value,
selector: '[data-attributable]'
};
}
})));
}(attributes);

attrArray.forEach(function (info) {
var selector = info.selector,
attribute = info.attribute,
value = info.value;

if (selector && attribute && value) {
_this4.$el.find(selector).attr(attribute, value);
}
});
this.$el.find('*').removeAttr('data-attributable');
}
},
applyTabIndex: function applyTabIndex() {
if (this.model.get('tabindex')) {
this.$el.attr('tabindex', this.model.get('tabindex'));
}
}
});

var _default = BlockView;
exports.default = _default;
});

require.register("views/block/block-collection-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _collectionView = _interopRequireDefault(require("views/base/collection-view"));

var _blocks = _interopRequireDefault(require("./templates/blocks"));

var _lodash = _interopRequireDefault(require("lodash"));

var BlocksView = _collectionView.default.extend({
animationDuration: 0,
autoRender: true,
noWrap: true,
template: _blocks.default,
listen: {
addedToDOM: 'loaded'
},
initialize: function initialize(options) {
this.parent = options.parent;
this.options = options;
this.templateData = options.templateData;
this.pageView = options.pageView;
this.listenTo(this.parent, 'page:state:change', this.stateChange);
this.listenTo(this.parent, 'block:state:completed', this.stateChange);

_collectionView.default.prototype.initialize.apply(this, arguments);
},
getTemplateData: function getTemplateData() {
return this.templateData;
},
stateChange: function stateChange(parent) {
//proxy page state change through to child blocks
this.trigger('page:state:change', parent);
},
initItemView: function initItemView(model) {
var _this = this;

var BlockType = require("views/block/".concat(model.get('type'), "/").concat(model.get('type'), "-view"));

var options = {
autoRender: false,
script: this.options.script,
model: model,
parent: this,
pageView: this.pageView
};

if (model.get('class')) {
options.className = BlockType.default.prototype.className ? "".concat(BlockType.default.prototype.className, " ").concat(model.get('class')) : model.get('class');
} // some blocks use es6 export, some dont


if (BlockType.default) {
BlockType = BlockType.default;
}

var blockView = new BlockType(options);
this.listenTo(blockView, 'block:state:loaded', function (block) {
if (_this.isLoaded()) {
_this.trigger('block:state:loaded', _this);
}
});
this.listenTo(blockView, 'block:state:completed', function (block) {
this.trigger('block:state:completed', block);
});
return blockView;
},
isLoaded: function isLoaded() {
if (this.subviews) {
return _lodash.default.every(this.subviews, function (subview) {
return subview.isLoaded();
});
} else {
return true;
}
},
loaded: function loaded() {
if (this.options.collection.forge_path) {
this.$el.attr('data-collection-path', this.options.collection.forge_path);
}
},
isComplete: function isComplete() {
if (this.subviews) {
return _lodash.default.every(this.subviews, function (subview) {
return subview.isComplete();
});
} else {
return true;
}
}
});

var _default = BlocksView;
exports.default = _default;
});

require.register("views/block/index.js", function(exports, require, module) {
"use strict";

require("views/block/base-block-view");

require("views/block/multimedia-block-view");
});

require.register("views/block/multimedia-block-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _ef = _interopRequireDefault(require("ef/ef"));

var _baseBlockView = _interopRequireDefault(require("views/block/base-block-view"));

var _enrollmentDataService = _interopRequireDefault(require("services/data-handler-services/enrollment-data-service"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var MultimediaBlockView = _baseBlockView.default.extend({
initialize: function initialize(opts) {
if (_ef.default.enrollment && _ef.default.enrollment.attributes) {
if (_ef.default.enrollment.has('autoPlay') && this.type !== 'video') {
this.model.set('auto_play', _ef.default.enrollment.get('autoPlay'));
}

var settings = _enrollmentDataService.default.getData('settings');

if (settings && settings[this.type]) {
this.model.set('settings', settings[this.type]);

if (settings[this.type]["".concat(this.type, "-mute")]) {
this.model.set('muted', settings[this.type]["".concat(this.type, "-mute")]);
}
}
}

_baseBlockView.default.prototype.initialize.call(this, opts);
},
otherMediaPlayingHandler: function otherMediaPlayingHandler(view, type) {
var callback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {};
var subscribe = view.subscribeEvent || _chaplin.default.mediator.subscribe;
subscribe('media:status:changed', function (mediaState, mediaId, mediaType) {
if (mediaState === 'playing' && type !== mediaType) {
callback();
}
}, view);
},
dispose: function dispose() {
_baseBlockView.default.prototype.dispose.call(this, arguments);
}
});

var _default = MultimediaBlockView;
exports.default = _default;
});

require.register("views/block/templates/blocks.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "<div class=\"block-list "
+ container.escapeExpression(((helper = (helper = lookupProperty(helpers,"block_list_class") || (depth0 != null ? lookupProperty(depth0,"block_list_class") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"block_list_class","hash":{},"data":data,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":43}}}) : helper)))
+ "\"></div>\n";
},"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/browser-course-editor/browser-course-editor-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _view = _interopRequireDefault(require("views/base/view"));

var _jquery = _interopRequireDefault(require("jquery"));

var _browserCourseEditor = _interopRequireDefault(require("views/browser-course-editor/templates/browser-course-editor"));

var _gsap = require("gsap/dist/gsap");

var _Draggable = require("gsap/dist/Draggable");

var _jsYaml = _interopRequireDefault(require("js-yaml"));

var BrowserCourseEditor = _view.default.extend({
template: _browserCourseEditor.default,
container: '#site-container',
autoRender: true,
autoAttach: true,
listen: {
addedToDOM: 'loaded'
},
loaded: function loaded() {
_gsap.gsap.registerPlugin(_Draggable.Draggable);

this.howToSubmitVal = 'direct';
this.operationVal = 'replace';
this.$editorHolder = (0, _jquery.default)('#browser-editor-holder');
this.$editor = (0, _jquery.default)('#browser-course-editor');
this.$editorHandle = (0, _jquery.default)('#editor-handle');
this.setDrag();
this.setListeners();
},
setDrag: function setDrag() {
_Draggable.Draggable.create(this.$editorHolder, {
autoScroll: true,
allowEventDefault: true,
trigger: '#editor-handle'
});
},
setListeners: function setListeners() {
var _this = this;

this.$editor.find('#localeBtn').click(function (evt) {
var msg = {
locale: _jsYaml.default.load(_this.$editor.find('#ymlInput').val()),
sender: 'browserEditor'
};
parent.postMessage(msg, '*');
});
this.$editor.find('#resetBtn').click(function (evt) {
_this.$editor.find('#ymlInput').val('');
});
this.$editor.find('#submitBtn').click(function (evt) {
var msg = {
model: _jsYaml.default.load(_this.$editor.find('#ymlInput').val()),
xpath: _this.current_xpath,
operation: _this.operationVal,
sender: 'browserEditor'
};
parent.postMessage(msg, '*');
});
this.$editor.find('#howToSubmit').change(function (evt) {
_this.howToSubmitVal = _this.$editor.find('#howToSubmit').val().toLowerCase();
});
this.$editor.find('#operation').change(function (evt) {
_this.operationVal = _this.$editor.find('#operation').val().toLowerCase();
});
(0, _jquery.default)('#ymlInput').on('input', function (evt) {
if (_this.howToSubmitVal === 'direct') {
var msg = {
model: _jsYaml.default.load(_this.$editor.find('#ymlInput').val()),
xpath: _this.current_xpath,
operation: _this.operationVal
};
parent.postMessage(msg, '*');
}
});
this.setPostMessage();
},
setPostMessage: function setPostMessage() {
var _this2 = this;

parent.addEventListener('message', function (evt) {
if (evt.data.detail) {
_this2.current_xpath = evt.data.detail.xpath;

_this2.$editor.find('#ymlInput').val(evt.data.detail.model);
}
});
}
});

var _default = BrowserCourseEditor;
exports.default = _default;
});

require.register("views/browser-course-editor/templates/browser-course-editor.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
return "\n<div id=\"browser-editor-holder\">\n <div id=\"editor-handle\">Course Editor</div>\n <div id=\"browser-course-editor\">\n <button id=\"resetBtn\" data-icon=\"fas fa-trash\">CLR</button>\n <button id=\"localeBtn\">Locale</button>\n <button id=\"submitBtn\">Submit</button>\n <select id=\"howToSubmit\" name=\"howToSubmit\">\n <option>Submit</option>\n <option selected=\"selected\">Direct</option>\n </select>\n <select id=\"operation\" name=\"operation\">\n <option selected=\"selected\">Replace</option>\n <option>Before</option>\n <option>After</option>\n </select>\n <div id=\"input-holder\">\n <textarea id=\"ymlInput\" contenteditable=\"true\"></textarea>\n </div>\n </div>\n</div>\n";
},"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/compatibility/compatibility-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _view = _interopRequireDefault(require("views/base/view"));

var _compatibility = _interopRequireDefault(require("./templates/compatibility"));

var CompatibilityView = _view.default.extend({
autoRender: true,
className: 'compatibility',
autoAttach: true,
template: _compatibility.default,
initialize: function initialize(options) {
_view.default.prototype.initialize.apply(this, arguments);
}
});

var _default = CompatibilityView;
exports.default = _default;
});

require.register("views/compatibility/templates/compatibility.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "<div class=\"portrait-compat\">\n <p>"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"portraitModeWarning",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":32}}}))
+ "</p>\n <div class=\"btn btn-default\" data-close>"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"okButton",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":3,"column":42},"end":{"line":3,"column":58}}}))
+ "</div>\n</div>";
},"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/css/css-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _view = _interopRequireDefault(require("views/base/view"));

var _utils = _interopRequireDefault(require("lib/utils"));

var CssView = _view.default.extend({
autoRender: true,
autoAttach: true,
noWrap: true,
initialize: function initialize(options) {
this.template = options.template;

_view.default.prototype.initialize.apply(this, arguments);
},
getTemplateFunction: function getTemplateFunction() {
return _utils.default.tryRequire(this.template);
}
});

var _default = CssView;
exports.default = _default;
});

require.register("views/custom-content/custom-content-collection-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _collectionView = _interopRequireDefault(require("views/base/collection-view"));

var _customContentCollection = _interopRequireDefault(require("./templates/custom-content-collection"));

var _customContentItemView = _interopRequireDefault(require("./custom-content-item-view"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _jquery = _interopRequireDefault(require("jquery"));

var CustomContentView = _collectionView.default.extend({
autoRender: false,
template: _customContentCollection.default,
listSelector: '.custom-content-items',
itemView: _customContentItemView.default,
animationDuration: 0,
render: function render() {
var _this = this;

if (!this.collection || this.collection.length === 0) {
this.trigger('done');
} else {
var custom_id = this.collection.at(0).get('custom_id');
(0, _jquery.default)(this.el).on('click', function (e) {
if (e.target.href) {
var currentURL = new RegExp(location.host);

if (!currentURL.test(e.target.href)) {
_chaplin.default.mediator.publish('interstitial-page:external-link-clicked', custom_id);
}
}
});

_chaplin.default.mediator.publish('interstitial-page:view', custom_id);

this.collection.on('change:done', function () {
if (_this.collection.every(function (cc) {
return cc.get('done');
})) {
(0, _jquery.default)(_this.el).off('click');

_chaplin.default.mediator.publish('interstitial-page:done', custom_id);

_this.trigger('done');
}
});
}

_collectionView.default.prototype.render.apply(this, arguments);
},
getTemplateData: _chaplin.default.View.prototype.getTemplateData
});

var _default = CustomContentView;
exports.default = _default;
});

require.register("views/custom-content/custom-content-item-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _view = _interopRequireDefault(require("views/base/view"));

var _templates = _interopRequireDefault(require("./templates"));

var CustomContentView = _view.default.extend({
listen: {
parentAddedToDOM: 'added'
},
initialize: function initialize() {
this.template = _templates.default["custom-".concat(this.model.get('content_type'))];

_view.default.prototype.initialize.apply(this, arguments);
},
added: function added() {
var _this = this;

if (this.model.get('content_type') === 'modal') {
this.modal = this.$('#custom-modal');
this.modal.modal('show');
this.done = true;
this.modal.on('hidden.bs.modal', function () {
return _this.model.set('done', true);
});
} else {
this.done = true;
this.model.set('done', true);
}
}
});

var _default = CustomContentView;
exports.default = _default;
});

require.register("views/custom-content/templates/custom-content-collection.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
return "<div class=\"custom-content-items\"></div>";
},"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/custom-content/templates/custom-modal.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "<div class=\"modal\" id=\"custom-modal\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"false\"\n data-keyboard=\"true\" data-backdrop=\"static\" aria-modal=\"true\">\n <div class=\"modal-dialog\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-close=\"true\" data-dismiss=\"modal\" aria-label=\""
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"closeModal",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":6,"column":95},"end":{"line":6,"column":113}}}))
+ "\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n <!--<div class=\"modal-title\" id=\"custom-modal-label\">"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"header") : depth0),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":9,"column":61},"end":{"line":9,"column":73}}}))
+ "</div>-->\n </div>\n <div class=\"modal-body\">\n "
+ ((stack1 = ((helper = (helper = lookupProperty(helpers,"content") || (depth0 != null ? lookupProperty(depth0,"content") : depth0)) != null ? helper : alias2),(typeof helper === "function" ? helper.call(alias1,{"name":"content","hash":{},"data":data,"loc":{"start":{"line":12,"column":8},"end":{"line":12,"column":21}}}) : helper))) != null ? stack1 : "")
+ "\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\" data-close=\"true\">\n <span aria-hidden=\"true\">"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"closeModal",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":16,"column":35},"end":{"line":16,"column":53}}}))
+ "</span>\n <span class=\"screen-reader-content\">"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"closeModal",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":17,"column":46},"end":{"line":17,"column":64}}}))
+ "</span>\n </button>\n </div>\n </div>\n </div>\n</div>\n";
},"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/custom-content/templates/custom-text.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return ((stack1 = ((helper = (helper = lookupProperty(helpers,"content") || (depth0 != null ? lookupProperty(depth0,"content") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"content","hash":{},"data":data,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}}) : helper))) != null ? stack1 : "");
},"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/custom-content/templates/index.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _customContentCollection = _interopRequireDefault(require("./custom-content-collection"));

var _customModal = _interopRequireDefault(require("./custom-modal"));

var _customText = _interopRequireDefault(require("./custom-text"));

var _default = {
'custom-content-collection': _customContentCollection.default,
'custom-modal': _customModal.default,
'custom-text': _customText.default
};
exports.default = _default;
});

require.register("views/dialog/dialog-content-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _view = _interopRequireDefault(require("views/base/view"));

var _utils = _interopRequireDefault(require("lib/utils"));

var _dialogContent = _interopRequireDefault(require("./templates/dialog-content"));

var _dialogContentLightbox = _interopRequireDefault(require("./templates/dialog-content-lightbox"));

var ModalContentView = _view.default.extend({
noWrap: true,
autoRender: true,
initialize: function initialize(options) {
this.parent = options.parent;
this.template = this.parent.model.get('modal_style') === 'lightbox' ? _dialogContentLightbox.default : _dialogContent.default;

_utils.default.setHeadingLevel(this.model, this.model.get('heading_level'));

_view.default.prototype.initialize.apply(this, arguments);
},
getTemplateData: function getTemplateData() {
return this.parent.model.attributes;
},
getTemplateFunction: function getTemplateFunction() {
return this.template;
}
});

var _default = ModalContentView;
exports.default = _default;
});

require.register("views/dialog/dialog-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _view = _interopRequireDefault(require("views/base/view"));

var _dialog = _interopRequireDefault(require("./templates/dialog"));

var _iconLoadService = _interopRequireDefault(require("services/loader-handler-services/icon-load-service"));

var _dialogContentView = _interopRequireDefault(require("./dialog-content-view"));

var _keybindingService = require("services/event-handler-services/keybinding-service");

var _utils = _interopRequireDefault(require("lib/utils"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _jquery = _interopRequireDefault(require("jquery"));

var _focusService = _interopRequireDefault(require("services/event-handler-services/focus-service"));

// the import below is required, do not be fooled by its lack of use
// eslint-disable-next-line no-unused-vars
var Escape = _keybindingService.keys.Escape;

var DialogView = _view.default.extend({
noWrap: true,
autoRender: true,
template: _dialog.default,
listen: {
addedToDOM: 'loaded'
},
contentView: null,
regions: {
atomDialogRegion: "[data-content=\"dialog-atom-region\"]"
},
model: new _chaplin.default.Model({}),
hideOnKeydownHandler: null,
initialize: function initialize() {
_view.default.prototype.initialize.apply(this, arguments);
},
getTemplateData: function getTemplateData() {
return this.model.attributes;
},
getTemplateFunction: function getTemplateFunction() {
return this.template;
},
loaded: function loaded() {
var _this = this;

this.delegate('click', '[data-dismiss="modal"]', function (e) {
this.hide();
});
/**
* Trigger esc event on the document so that the learner does not need to be focused on
* the modal to dismiss it.
*
* Note: for assistive technologies such as voiceover, it instructs the learner to double tap in order to escape (triggering modal close)
*/

(0, _jquery.default)(document).on('keydown', this.hideOnKeydownHandler = function (e) {
_keybindingService.KeybindingService.with(e).bind(Escape, function () {
_this.hide();

e.preventDefault();
e.stopImmediatePropagation();
});
});
this.delegate('click', '[data-dismiss="modal"] *', function (e) {
e.stopPropagation();
e.target.id && _chaplin.default.mediator.publish("dialog:click:".concat(e.target.id), e);
});
this.subscribeEvent('dialog:set:content', this.setDialogContent);
},
dispose: function dispose() {
(0, _jquery.default)('body').removeClass('modal-open');
(0, _jquery.default)(document).off('keydown', this.hideOnKeydownHandler);

_view.default.prototype.dispose.apply(this, arguments);
},
setDialogContent: function setDialogContent(options) {
var _this2 = this;

// Passing in a non-object or no contentView closes the dialog
if (!_jquery.default.isPlainObject(options) || options.contentView == null) {
this.hide();
return;
}

var contentView = options.contentView,
id = options.id; // Handle existing dialog content

if (this.contentView !== null) {
// No need to do anything if it's already showing
if (this.contentView === contentView) {
return;
} // Otherwise, hide and clear current content


this.hide();
}

this.setDialogClassesAndAttributes(options);
this.contentView = options.contentView;
this.model.set('id', id);
contentView.region = 'atomDialogRegion';
this.subview(this.atomDialogRegion, contentView); // Attach the contentView to the dialog region.

contentView.attach(); // Attach the subviews of the contentView (e.g. nested blocks).

contentView.subviews.forEach(function (sv) {
return sv.attach();
}); // IconLoadService requires the elements to be in the page DOM.
// We also need to ensure we flexibly load icons scoped to any connected
// models, but not break if the contentView and/or parent is missing one.

if (contentView.model && contentView.model.has('cid')) {
_iconLoadService.default.applyIcon('fal fa-times', contentView.model.get('cid'), 'fa-lg');

this.applyButtonIcons(contentView.model);
}

if (contentView.parent && contentView.parent.model) {
var parentModel = contentView.parent.model;

if (parentModel.has('cid')) {
_iconLoadService.default.applyIcon('fal fa-times', parentModel.get('cid'), 'fa-lg');

this.applyButtonIcons(parentModel);
}

if (parentModel.has('focusOnHideSelector')) {
this.model.set('focusOnHideSelector', parentModel.get('focusOnHideSelector'));
}
}

contentView.subviews.forEach(function (sv) {
sv.trigger('page:state:change', sv.parent);

_this2.listenTo(sv, 'block:state:loaded', _this2.trapFocus.bind(_this2));
});
this.show();
},
setDialogClassesAndAttributes: function setDialogClassesAndAttributes(_ref) {
var modalClass = _ref.modalClass,
dialogClass = _ref.dialogClass,
preventContainerClose = _ref.preventContainerClose;
!!modalClass && this.$el.addClass(modalClass);
var modalContainer = this.$el.find('.modal__container');
!!dialogClass && modalContainer.addClass(dialogClass);
modalContainer.attr('data-dismiss', !preventContainerClose ? 'modal' : null);
},
resetDialogClasses: function resetDialogClasses() {
this.$el.attr('class', 'modal');
this.$el.find('.modal__container').attr('class', 'modal__container');
},
show: function show() {
(0, _jquery.default)('body').addClass('modal-open');
this.$el.show().addClass('in');
this.trapFocus();
this.publishEvent('dialog:show', {
id: this.model.get('id')
}); // TODO: Some modals may no have headers, we need to provision for a modal description somewhere

var headerTitle = this.$el.find('.modal__header__title');

if (headerTitle.length && headerTitle.attr('id')) {
var headerId = headerTitle.attr('id');
this.$el.attr('aria-labelledby', headerId);
} // Update modal top offset based on a platform header


var modalContainer = this.$el.find('.modal__container:not(.modal-drawer--bottom)').find('.js-modal__content');

if (modalContainer.length) {
var platformHeight = _utils.default.getPlatformHeaderHeight();

if (platformHeight) {
modalContainer.css('top', platformHeight);
}
}
},
trapFocus: function trapFocus() {
var _this3 = this;

if ((0, _jquery.default)('#site-container').hasClass('has-lottie')) {
_chaplin.default.mediator.subscribe('lottie:complete', function () {
_focusService.default.trapFocus(_this3, '.js-modal__content', '#site-container');
});
} else {
setTimeout(function () {
_focusService.default.trapFocus(_this3, '.js-modal__content', '#site-container');
}, 100);
}
},
hide: function hide() {
// prevent double trigger of hide with if/else here
if (this.contentView) {
this.contentView.$el.detach();
this.contentView = null;
} else {
return;
}

(0, _jquery.default)('body').removeClass('modal-open');
this.$el.removeClass('in').hide();
this.resetDialogClasses();

if (this.model.has('focusOnHideSelector')) {
(0, _jquery.default)(this.model.get('focusOnHideSelector')).focus();
}

_focusService.default.releaseFocus();

this.publishEvent('dialog:hide', {
id: this.model.get('id')
});
},
applyButtonIcons: function applyButtonIcons(model) {
var iconProps = ['button_icon_before', 'button_icon_after'];
iconProps.forEach(function (i) {
if (model.has(i)) {
var classes = model.get("".concat(i, "_classes")) || null;

_iconLoadService.default.applyIcon(model.get(i), model.get('cid'), classes);
}
});
}
});

var _default = DialogView;
exports.default = _default;
});

require.register("views/dialog/templates/dialog-content-lightbox.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"1":function(container,depth0,helpers,partials,data) {
return "data-close=\"true\" ";
},"3":function(container,depth0,helpers,partials,data) {
var lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "aria-label=\""
+ container.escapeExpression((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"closeModal",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":4,"column":67},"end":{"line":4,"column":85}}}))
+ "\" ";
},"5":function(container,depth0,helpers,partials,data) {
var lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return container.escapeExpression((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"sr_close_caption") : depth0),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":7,"column":62},"end":{"line":7,"column":84}}}));
},"7":function(container,depth0,helpers,partials,data) {
var lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return container.escapeExpression((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"close_caption") : depth0),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":7,"column":92},"end":{"line":7,"column":111}}}));
},"9":function(container,depth0,helpers,partials,data) {
var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <div data-region=\""
+ container.escapeExpression(((helper = (helper = lookupProperty(helpers,"cid") || (depth0 != null ? lookupProperty(depth0,"cid") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"cid","hash":{},"data":data,"loc":{"start":{"line":12,"column":22},"end":{"line":12,"column":29}}}) : helper)))
+ "-modal-blocks\"></div>\n";
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "<div class=\"modal__content--lightbox "
+ alias4(((helper = (helper = lookupProperty(helpers,"content_class") || (depth0 != null ? lookupProperty(depth0,"content_class") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"content_class","hash":{},"data":data,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":54}}}) : helper)))
+ " js-modal__content\">\n <div class=\"modal__header__close--lightbox\">\n <button type=\"button\" class=\"btn btn-overlay\" "
+ ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"prevent_close_feedback") : depth0),{"name":"unless","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":50},"end":{"line":3,"column":113}}})) != null ? stack1 : "")
+ "\n data-dismiss=\"modal\" "
+ ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"sr_close_caption") : depth0),{"name":"unless","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":4,"column":27},"end":{"line":4,"column":98}}})) != null ? stack1 : "")
+ ">\n"
+ ((stack1 = container.invokePartial(lookupProperty(partials,"icon"),depth0,{"name":"icon","hash":{"size":"fa-lg","name":"fa-times","prefix":"fal","uuid":(depth0 != null ? lookupProperty(depth0,"cid") : depth0)},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "")
+ " <span\n class=\"screen-reader-content\">"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"sr_close_caption") : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.program(7, data, 0),"data":data,"loc":{"start":{"line":7,"column":38},"end":{"line":7,"column":118}}})) != null ? stack1 : "")
+ "</span>\n </button>\n </div>\n <div class=\"modal__body--lightbox "
+ alias4(((helper = (helper = lookupProperty(helpers,"body_class") || (depth0 != null ? lookupProperty(depth0,"body_class") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"body_class","hash":{},"data":data,"loc":{"start":{"line":10,"column":36},"end":{"line":10,"column":50}}}) : helper)))
+ "\">\n"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"blocks") : depth0),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":11,"column":4},"end":{"line":13,"column":11}}})) != null ? stack1 : "")
+ " </div>\n "
+ alias4((lookupProperty(helpers,"f")||(depth0 && lookupProperty(depth0,"f"))||alias2).call(alias1,"editblock","",(depth0 != null ? lookupProperty(depth0,"cid") : depth0),(depth0 != null ? lookupProperty(depth0,"forge_path") : depth0),"modal",{"name":"f","hash":{},"data":data,"loc":{"start":{"line":15,"column":2},"end":{"line":15,"column":45}}}))
+ "\n</div>\n";
},"usePartial":true,"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/dialog/templates/dialog-content.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"1":function(container,depth0,helpers,partials,data) {
return "data-close=\"true\" ";
},"3":function(container,depth0,helpers,partials,data) {
var lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "aria-label=\""
+ container.escapeExpression((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"closeModal",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":6,"column":109},"end":{"line":6,"column":127}}}))
+ "\" ";
},"5":function(container,depth0,helpers,partials,data) {
var lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return container.escapeExpression((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"sr_close_caption") : depth0),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":8,"column":68},"end":{"line":8,"column":90}}}));
},"7":function(container,depth0,helpers,partials,data) {
var lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return container.escapeExpression((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"close_caption") : depth0),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":8,"column":98},"end":{"line":9,"column":25}}}));
},"9":function(container,depth0,helpers,partials,data) {
var lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "<p>"
+ container.escapeExpression((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"description") : depth0),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":14,"column":26},"end":{"line":14,"column":43}}}))
+ "</p>";
},"11":function(container,depth0,helpers,partials,data) {
var stack1, helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return ((stack1 = ((helper = (helper = lookupProperty(helpers,"customContent") || (depth0 != null ? lookupProperty(depth0,"customContent") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"customContent","hash":{},"data":data,"loc":{"start":{"line":15,"column":25},"end":{"line":15,"column":44}}}) : helper))) != null ? stack1 : "");
},"13":function(container,depth0,helpers,partials,data) {
var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <div data-region=\""
+ container.escapeExpression(((helper = (helper = lookupProperty(helpers,"cid") || (depth0 != null ? lookupProperty(depth0,"cid") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"cid","hash":{},"data":data,"loc":{"start":{"line":17,"column":22},"end":{"line":17,"column":29}}}) : helper)))
+ "-modal-blocks\"></div>\n";
},"15":function(container,depth0,helpers,partials,data) {
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <div class=\"modal__footer "
+ alias3(((helper = (helper = lookupProperty(helpers,"footer_class") || (depth0 != null ? lookupProperty(depth0,"footer_class") : depth0)) != null ? helper : alias2),(typeof helper === "function" ? helper.call(alias1,{"name":"footer_class","hash":{},"data":data,"loc":{"start":{"line":21,"column":28},"end":{"line":21,"column":44}}}) : helper)))
+ "\">\n <div class=\"modal__footer__close\">\n <button type=\"button\" class=\"btn "
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"button_class") : depth0),{"name":"if","hash":{},"fn":container.program(16, data, 0),"inverse":container.program(18, data, 0),"data":data,"loc":{"start":{"line":23,"column":39},"end":{"line":23,"column":114}}})) != null ? stack1 : "")
+ "\"\n data-dismiss=\"modal\" data-action-target=\"modal-footer-close\" "
+ ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"prevent_close_feedback") : depth0),{"name":"unless","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":24,"column":69},"end":{"line":24,"column":132}}})) != null ? stack1 : "")
+ ">\n\n"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"button_icon_before") : depth0),{"name":"if","hash":{},"fn":container.program(20, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":26,"column":8},"end":{"line":28,"column":15}}})) != null ? stack1 : "")
+ "\n"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"sr_close_caption") : depth0),{"name":"if","hash":{},"fn":container.program(22, data, 0),"inverse":container.program(24, data, 0),"data":data,"loc":{"start":{"line":30,"column":8},"end":{"line":35,"column":15}}})) != null ? stack1 : "")
+ "\n"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"button_icon_after") : depth0),{"name":"if","hash":{},"fn":container.program(26, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":37,"column":8},"end":{"line":39,"column":15}}})) != null ? stack1 : "")
+ " </button>\n </div>\n "
+ alias3((lookupProperty(helpers,"f")||(depth0 && lookupProperty(depth0,"f"))||alias2).call(alias1,"editblock","",(depth0 != null ? lookupProperty(depth0,"cid") : depth0),(depth0 != null ? lookupProperty(depth0,"forge_path") : depth0),"modal",{"name":"f","hash":{},"data":data,"loc":{"start":{"line":42,"column":4},"end":{"line":42,"column":47}}}))
+ "\n </div>\n";
},"16":function(container,depth0,helpers,partials,data) {
var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return container.escapeExpression(((helper = (helper = lookupProperty(helpers,"button_class") || (depth0 != null ? lookupProperty(depth0,"button_class") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"button_class","hash":{},"data":data,"loc":{"start":{"line":23,"column":59},"end":{"line":23,"column":75}}}) : helper)));
},"18":function(container,depth0,helpers,partials,data) {
return "btn-tertiary btn-compact";
},"20":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return ((stack1 = container.invokePartial(lookupProperty(partials,"icon"),depth0,{"name":"icon","hash":{"classes":(depth0 != null ? lookupProperty(depth0,"button_icon_before_classes") : depth0),"icon":(depth0 != null ? lookupProperty(depth0,"button_icon_before") : depth0),"uuid":(depth0 != null ? lookupProperty(depth0,"cid") : depth0)},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "");
},"22":function(container,depth0,helpers,partials,data) {
var alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " <span aria-hidden=\"true\">"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"close_caption") : depth0),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":31,"column":33},"end":{"line":31,"column":52}}}))
+ "</span>\n <span class=\"screen-reader-content\">"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"sr_close_caption") : depth0),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":32,"column":44},"end":{"line":32,"column":66}}}))
+ "</span>\n";
},"24":function(container,depth0,helpers,partials,data) {
var lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " "
+ container.escapeExpression((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"close_caption") : depth0),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":34,"column":8},"end":{"line":34,"column":27}}}))
+ "\n";
},"26":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return ((stack1 = container.invokePartial(lookupProperty(partials,"icon"),depth0,{"name":"icon","hash":{"classes":(depth0 != null ? lookupProperty(depth0,"button_icon_after_classes") : depth0),"icon":(depth0 != null ? lookupProperty(depth0,"button_icon_after") : depth0),"uuid":(depth0 != null ? lookupProperty(depth0,"cid") : depth0)},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "");
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "<div class=\"modal__content "
+ alias4(((helper = (helper = lookupProperty(helpers,"content_class") || (depth0 != null ? lookupProperty(depth0,"content_class") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"content_class","hash":{},"data":data,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":44}}}) : helper)))
+ " js-modal__content\">\n <div class=\"modal__header "
+ alias4(((helper = (helper = lookupProperty(helpers,"header_class") || (depth0 != null ? lookupProperty(depth0,"header_class") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"header_class","hash":{},"data":data,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":44}}}) : helper)))
+ "\">\n <"
+ alias4(((helper = (helper = lookupProperty(helpers,"heading_level") || (depth0 != null ? lookupProperty(depth0,"heading_level") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"heading_level","hash":{},"data":data,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":22}}}) : helper)))
+ " class=\"modal__header__title "
+ alias4(((helper = (helper = lookupProperty(helpers,"title_class") || (depth0 != null ? lookupProperty(depth0,"title_class") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"title_class","hash":{},"data":data,"loc":{"start":{"line":3,"column":51},"end":{"line":3,"column":66}}}) : helper)))
+ "\" id=\""
+ alias4(((helper = (helper = lookupProperty(helpers,"id") || (depth0 != null ? lookupProperty(depth0,"id") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"id","hash":{},"data":data,"loc":{"start":{"line":3,"column":72},"end":{"line":3,"column":78}}}) : helper)))
+ "_label\">"
+ alias4((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"header") : depth0),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":3,"column":86},"end":{"line":3,"column":98}}}))
+ "</"
+ alias4(((helper = (helper = lookupProperty(helpers,"heading_level") || (depth0 != null ? lookupProperty(depth0,"heading_level") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"heading_level","hash":{},"data":data,"loc":{"start":{"line":3,"column":100},"end":{"line":3,"column":117}}}) : helper)))
+ ">\n <div class=\"modal__header__close\">\n <button type=\"button\" class=\"btn btn-tertiary\" "
+ ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"prevent_close_feedback") : depth0),{"name":"unless","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":5,"column":53},"end":{"line":5,"column":116}}})) != null ? stack1 : "")
+ "\n data-dismiss=\"modal\" data-action-target=\"modal-header-close\" "
+ ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"sr_close_caption") : depth0),{"name":"unless","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":6,"column":69},"end":{"line":6,"column":140}}})) != null ? stack1 : "")
+ ">\n"
+ ((stack1 = container.invokePartial(lookupProperty(partials,"icon"),depth0,{"name":"icon","hash":{"size":"fa-lg","name":"fa-times","prefix":"fal","uuid":(depth0 != null ? lookupProperty(depth0,"cid") : depth0)},"data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "")
+ " <span class=\"screen-reader-content\">"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"sr_close_caption") : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.program(7, data, 0),"data":data,"loc":{"start":{"line":8,"column":44},"end":{"line":9,"column":32}}})) != null ? stack1 : "")
+ "</span>\n </button>\n </div>\n </div>\n <div class=\"modal__body "
+ alias4(((helper = (helper = lookupProperty(helpers,"body_class") || (depth0 != null ? lookupProperty(depth0,"body_class") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"body_class","hash":{},"data":data,"loc":{"start":{"line":13,"column":26},"end":{"line":13,"column":40}}}) : helper)))
+ "\">\n "
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"description") : depth0),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":14,"column":4},"end":{"line":14,"column":54}}})) != null ? stack1 : "")
+ "\n "
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"customContent") : depth0),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":15,"column":4},"end":{"line":15,"column":51}}})) != null ? stack1 : "")
+ "\n"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"blocks") : depth0),{"name":"if","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":16,"column":4},"end":{"line":18,"column":11}}})) != null ? stack1 : "")
+ " </div>\n"
+ ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"no_footer") : depth0),{"name":"unless","hash":{},"fn":container.program(15, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":20,"column":2},"end":{"line":44,"column":13}}})) != null ? stack1 : "")
+ "</div>\n";
},"usePartial":true,"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/dialog/templates/dialog.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
return "<div class=\"modal\" tabindex=\"0\" role=\"dialog\" aria-modal=\"true\" data-action-target=\"modal-container\">\n <div\n class=\"modal__container\"\n data-dismiss=\"modal\"\n data-content=\"dialog-atom-region\"></div>\n</div>";
},"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/feedback/feedback-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _view = _interopRequireDefault(require("views/base/view"));

var _blockCollectionView = _interopRequireDefault(require("views/block/block-collection-view"));

var _contentService = _interopRequireDefault(require("services/loader-handler-services/content-service"));

var _feedback = _interopRequireDefault(require("views/feedback/templates/feedback"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _lodash = _interopRequireDefault(require("lodash"));

var FeedbackView = _view.default.extend({
autoRender: true,
autoAttach: true,
region: 'feedback',
noWrap: true,
template: _feedback.default,
initialize: function initialize(options) {
this.model.set('cid', this.model.cid);

if (this.model.get('class')) {
this.className += this.model.get('class');
}

this.model.set('blocks', this.model.get('blocks'));
this.callbacks = options.callbacks;
this.script = options.script;
var self = this;
var role = this.model.get('role');

if (!self.$el.attr('aria-hidden') && (role === null || role === undefined || role === '')) {
this.model.set('role', 'alert');
} else {
this.model.set('role', false);
}

var describedby = this.model.get('describedby');

if (describedby) {
self.$el.attr('aria-describedby', describedby);
}

this.on('addedToDOM', function () {
var _this = this;

var blocksRegion = "".concat(this.model.get('cid'), "_feedback_blocks");
this.registerRegion(blocksRegion, ".".concat(blocksRegion));

_contentService.default.buildBlockCollection(this.model.get('blocks')).then(function (blocks) {
_this.blocks = blocks;
var blocksView = new _blockCollectionView.default({
script: _this.script ? _this.script.block : undefined,
collection: _this.blocks,
region: blocksRegion,
parent: _this,
pageView: options.pageView
});
self.subview('blocks', blocksView);
self.listenTo(blocksView, 'block:state:completed', self.blockCompleted);

if (blocksView.isLoaded()) {
self.setState('loaded');
} else {
self.listenTo(blocksView, 'block:state:loaded', function () {
self.setState('loaded');
});
}

if (_this.model.get('scroll_into_view')) {
setTimeout(function () {
self.el.focus({
preventScroll: true
});
self.el.scrollIntoView({
behavior: 'smooth'
});
}, 100);
} // if there is a 'close' button, move focus on it when feedback is added to dom - accessibility issue


if (self.$('[data-close]')) {
self.$('[data-close]').trigger('focus');
}

self.delegate('click', '[data-close]', function (e) {
e.preventDefault();
self.trigger('feedback:close', this);
});
});
});
this.setState('initialized');

_view.default.prototype.initialize.apply(this, arguments);
},
play: function play() {
this.setState('playing');

if (this.blocks && this.blocks.length === 0) {
this.setState('completed');
}
},
blockCompleted: function blockCompleted() {
if (this.subviewsByName.blocks.isComplete()) {
this.setState('completed');
}
},
stateCallbacks: {
unloading: function unloading() {
this.setState('unloaded');

_view.default.prototype.dispose.apply(this, arguments);
},
completed: function completed() {
if (this.model && this.model.get('closeOnComplete')) {
this.trigger('feedback:close', this);
}
}
},
setState: function setState(state) {
this.model.set('state', state); //feedback is kinda like a mini page - needs to talk to blocks the same way

_chaplin.default.mediator.publish("feedback:state:".concat(this.model.get('state')), this);

var hook = this.script && this.script[state] ? _lodash.default.bind(this.script[state], this.script) : null;
var stateCallback = this.stateCallbacks[state] ? _lodash.default.bind(this.stateCallbacks[state], this) : null;
var callback = this.callbacks && this.callbacks[state] ? _lodash.default.bind(this.callbacks[state], this) : null;

var callCallbacks = function callCallbacks() {
if (callback) {
callback();
}

if (stateCallback) {
stateCallback();
}
};

if (hook) {
if (this.script[state].length === 2) {
hook(this, callCallbacks);
} else {
hook(this);
callCallbacks();
}
} else {
callCallbacks();
}

this.trigger('page:state:change', this);
},
dispose: function dispose() {
this.setState('unloading');
}
});

var _default = FeedbackView;
exports.default = _default;
});

require.register("views/feedback/templates/feedback.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"1":function(container,depth0,helpers,partials,data) {
return "tabindex=\"0\"";
},"3":function(container,depth0,helpers,partials,data) {
var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "role=\""
+ container.escapeExpression(((helper = (helper = lookupProperty(helpers,"role") || (depth0 != null ? lookupProperty(depth0,"role") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"role","hash":{},"data":data,"loc":{"start":{"line":3,"column":41},"end":{"line":3,"column":49}}}) : helper)))
+ "\"";
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "<div class=\""
+ alias4(((helper = (helper = lookupProperty(helpers,"cid") || (depth0 != null ? lookupProperty(depth0,"cid") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":19}}}) : helper)))
+ "_feedback_blocks feedback__blocks "
+ alias4(((helper = (helper = lookupProperty(helpers,"feedbackState") || (depth0 != null ? lookupProperty(depth0,"feedbackState") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"feedbackState","hash":{},"data":data,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":70}}}) : helper)))
+ " "
+ alias4(((helper = (helper = lookupProperty(helpers,"class") || (depth0 != null ? lookupProperty(depth0,"class") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"class","hash":{},"data":data,"loc":{"start":{"line":1,"column":71},"end":{"line":1,"column":80}}}) : helper)))
+ "\"\n "
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"enable_focus") : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":44}}})) != null ? stack1 : "")
+ " data-action-target=\"feedback\" data-block= \"result\"\n "
+ ((stack1 = (lookupProperty(helpers,"compare")||(depth0 && lookupProperty(depth0,"compare"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"role") : depth0),"!==",false,{"name":"compare","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":62}}})) != null ? stack1 : "")
+ " aria-label=\""
+ alias4((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"feedbackAlert",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":3,"column":75},"end":{"line":3,"column":96}}}))
+ "\">\n</div>\n";
},"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/forge-editor/forge-editor-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _view = _interopRequireDefault(require("views/base/view"));

var _blockCollectionView = _interopRequireDefault(require("views/block/block-collection-view"));

var _browserCourseEditorView = _interopRequireDefault(require("views/browser-course-editor/browser-course-editor-view"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _jquery = _interopRequireDefault(require("jquery"));

var _customPageService = _interopRequireDefault(require("services/course-handler-services/custom-page-service"));

var _localeService = _interopRequireDefault(require("services/loader-handler-services/locale-service"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _jsYaml = _interopRequireDefault(require("js-yaml"));

var _forgeEditor = _interopRequireDefault(require("views/forge-editor/templates/forge-editor"));

var ForgeEditorView = _view.default.extend({
template: _forgeEditor.default,
container: 'body',
autoRender: true,
autoAttach: true,
listen: {
addedToDOM: 'loaded',
'page:state:loaded mediator': 'checkForBrowserEditor'
},
checkForBrowserEditor: function checkForBrowserEditor() {
if (this.hasQueryStr && !this.browserEditor) {
this.browserEditor = new _browserCourseEditorView.default();
}
},
initialize: function initialize() {
this.hasQueryStr = arguments[0];
this.curElem = {
$hoverElem: [],
$currentElem: []
};
this.seqno = 0;
this.clickElemsSeqno = 0;

_view.default.prototype.initialize.apply(this, arguments);
},
loaded: function loaded() {
this.setFloater();
this.setMouseEvents();
this.setPostMessage();
},
getContextMenuPostion: function getContextMenuPostion(evt, contextMenu) {
var INSET = 20; // # of pixels toward middle of rectangle

var mousePos = {
x: evt.pageX,
y: evt.pageY
};
var menuSize = {
x: contextMenu.outerWidth(),
y: contextMenu.outerHeight()
};
var menuPos = {};

if (mousePos.x + menuSize.x > (0, _jquery.default)(window).width() + (0, _jquery.default)(window).scrollLeft()) {
menuPos.x = mousePos.x - menuSize.x + INSET;
} else {
menuPos.x = mousePos.x - INSET;
}

if (mousePos.y + menuSize.y > (0, _jquery.default)(window).height() + (0, _jquery.default)(window).scrollTop()) {
menuPos.y = mousePos.y - menuSize.y + INSET;
} else {
menuPos.y = mousePos.y - INSET;
}

return menuPos;
},
setFloater: function setFloater() {
var _this = this;

this.$floater = (0, _jquery.default)('#forge-editor-holder #floater');
this.subscribeEvent('forge:block:contextmenu', this.setContextMenu);
this.subscribeEvent('forge:block:contextmenu', function (evt) {
var position = _this.getContextMenuPostion(evt, _this.$floater);

_this.$floater.css({
top: "".concat(position.y, "px"),
left: "".concat(position.x, "px"),
display: 'block'
});

return false;
});
this.$floater.mouseleave(function (evt) {
_this.$floater.css({
display: 'none'
});
}); // eslint-disable-next-line sonarjs/no-identical-functions

this.subscribeEvent('forge:block:mouseout', function (evt) {
_this.$floater.css({
display: 'none'
});
});
},
getXPathTo: function getXPathTo(element) {
if (element.id !== '') {
return "id(\"".concat(element.id, "\")");
}

if (element === document.body) {
return element.tagName;
}

var ix = 0;
var siblings = element.parentNode.childNodes;

for (var i = 0; i < siblings.length; i++) {
var sibling = siblings[i];

if (sibling === element) {
return "".concat(this.getXPathTo(element.parentNode), "/").concat(element.tagName, "[").concat(ix + 1, "]");
}

if (sibling.nodeType === 1 && sibling.tagName === element.tagName) {
ix++;
}
}
},
getElementByXPath: function getElementByXPath(path) {
return new XPathEvaluator().evaluate(path, document.documentElement, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
},
setMouseEvents: function setMouseEvents() {
var _this2 = this;

this.subscribeEvent('forge:block:mouseenter', function (evt) {
if (!(0, _jquery.default)(_this2.curElem.$hoverElem).is(evt.$el) && !(0, _jquery.default)(_this2.curElem.$currentElem).is(evt.$el)) {
(0, _jquery.default)(evt.$el).css('outline', '2px solid pink');

if (_this2.curElem.$hoverElem && !(0, _jquery.default)(_this2.curElem.$hoverElem).is(_this2.curElem.$currentElem)) {
(0, _jquery.default)(_this2.curElem.$hoverElem).css('outline', 'none');
}

_this2.curElem.$hoverElem = evt.$el;
}
});
this.subscribeEvent('forge:block:mouseleave', function (evt) {
if ((0, _jquery.default)(_this2.curElem.$hoverElem).is(evt.$el) && !(0, _jquery.default)(_this2.curElem.$currentElem).is(evt.$el)) {
(0, _jquery.default)(_this2.curElem.$hoverElem).css('outline', 'none');
_this2.curElem.$hoverElem = null;
}
});
this.subscribeEvent('forge:block:mousedown', function (evt) {
(0, _jquery.default)('#clicked-elems').empty();
}); // Let's say user clicks on an image (for ex.),
// we really get several forge:block:mouseup evts because there were probably
// container blocks as well which the event will propagate to.

this.subscribeEvent('forge:block:mouseup', this.setContextMenu);
},
setContextMenu: function setContextMenu(evt) {
var _this3 = this;

var blockType = evt.$el[0].getAttribute('data-forge-type');
var xpath = this.getXPathTo(evt.$el[0]);
var $curElem = evt.$el;
var $target = (0, _jquery.default)(evt.blockEvt.target);
var obj = {
blocks: [evt.modelObj]
};

var blockModel = _jsYaml.default.dump(obj, {
skipInvalid: true,
lineWidth: -1,
noRefs: true
});

this.setCurElem($target);
var clickElemId = "clickedElem".concat(this.clickElemsSeqno++); // add the propagated elems

(0, _jquery.default)('#clicked-elems').append("<li id=\"".concat(clickElemId, "\" class=\"contextMenuItem\">").concat(blockType, "</li>"));
(0, _jquery.default)("#".concat(clickElemId)).mouseover(function (evt) {
(0, _jquery.default)("#".concat(clickElemId)).toggleClass('active');
});
(0, _jquery.default)("#".concat(clickElemId)).mouseout(function (evt) {
if (!(0, _jquery.default)("#".concat(clickElemId)).hasClass('clickedElem')) {
(0, _jquery.default)("#".concat(clickElemId)).toggleClass('active');
}
});
(0, _jquery.default)("#".concat(clickElemId)).click(function (evt) {
var _window$parent;

var el = _this3.getElementByXPath(xpath);

var key;

if (_ef.default.module) {
key = _ef.default.module.currentActivity.currentPage.attributes.key;
}

var msg = {
event_type: 'forge_mode',
detail: {
action: 'editblock',
forgepath: el.getAttribute('data-forge-path') || (0, _jquery.default)(el).parents('[data-forge-path]:not([data-forge-path="undefined"])').data('data-forge-path'),
xpath: xpath,
model: blockModel,
key: key,
contentRegion: el.getAttribute('data-content-region') || (0, _jquery.default)(el).parents('[data-content-region]:not([data-content-region="undefined"])').data('content-region')
},
sender: 'sdkForge'
};
(_window$parent = window.parent) === null || _window$parent === void 0 ? void 0 : _window$parent.postMessage(msg, '*');
(0, _jquery.default)('.clickedElem').css('background', '#dddddd');
(0, _jquery.default)('.clickedElem').removeClass('clickedElem');
(0, _jquery.default)("#".concat(clickElemId)).css('background', '#00ffff');
(0, _jquery.default)("#".concat(clickElemId)).addClass('clickedElem');

_this3.setCurElem($curElem);
});
},
setCurElem: function setCurElem($curElem) {
if (this.curElem.$currentElem && this.curElem.$currentElem[0] !== $curElem[0]) {
(0, _jquery.default)(this.curElem.$currentElem).css('outline', 'none');
(0, _jquery.default)($curElem).css('outline', '1px solid #5588cc');
this.curElem.$currentElem = $curElem;
}
},
makeView: function makeView(model, xpath, operation, objPath) {
if (!xpath) {
return;
} // First, we have to remove the old (current) block from the DOM
// If not, we get problems when we render the new blocks because 2 identical
// elements might be in the DOM competing against each other.


var $tempDiv = (0, _jquery.default)('<div id="_tmpForgeDiv_"></div>');
this.curElem.currentElem = this.getElementByXPath(xpath);

if (operation === 'replace') {
this.curElem.currentElem.replaceWith($tempDiv[0]);
} // Now we can render our new blocks to a tmp location since old block is no longer in DOM


var blockName = "tmp-forge-blocks-".concat(this.seqno);
var forgeHolderId = "tmp-forge-holder-".concat(this.seqno);
this.seqno += 1;
(0, _jquery.default)('#site-container').append("<div id=\"".concat(forgeHolderId, "\" data-region=\"").concat(blockName, "\"></div>"));
var modelToMake = new _chaplin.default.Model(model);
modelToMake.get('blocks').forge_path = objPath; // eslint-disable-next-line no-unused-vars

var newBlocksView = new _blockCollectionView.default({
collection: new _chaplin.default.Collection(modelToMake.get('blocks')),
container: "#".concat(forgeHolderId)
}); // Grab the new blocks and replace / insert / append

var $newElem = (0, _jquery.default)("#".concat(forgeHolderId)).detach().find('[data-forge-type]').first();
(0, _jquery.default)(this.curElem.$currentElem).css('outline', 'none');

if (operation === 'replace') {
$tempDiv[0].replaceWith($newElem[0]);
this.curElem.$currentElem = $newElem;
} else if (operation === 'before') {
this.curElem.$currentElem = (0, _jquery.default)(this.curElem.currentElem);
this.curElem.$currentElem.before($newElem);
} else if (operation === 'after') {
this.curElem.$currentElem = (0, _jquery.default)(this.curElem.currentElem);
this.curElem.$currentElem.after($newElem);
}

(0, _jquery.default)(this.curElem.$currentElem).css('outline', '1px solid #5588cc'); // Need this for apex-charts, probably others as well

window.dispatchEvent(new Event('resize'));
},
convertObjPathToXPath: function convertObjPathToXPath(objPath, contentRegion) {
var $el = (0, _jquery.default)("".concat(contentRegion, " [data-forge-path=\"").concat(objPath, "\"]"));

if ($el.length > 0) {
return this.getXPathTo($el.get(0));
} else {
return false;
}
},
// This will inject new locales - key / value pairs - into the SDK from Forge
addLocales: function addLocales(localeObj) {
var _CustomPageService$mo = _customPageService.default.modulePaths(),
module = _CustomPageService$mo.module,
activity = _CustomPageService$mo.activity,
page = _CustomPageService$mo.page; // Pass YML like below - key / value objects
// localeObj:
// zzz1: Two Kinds of the Analysis
// zzz2: 6 Kinds of the turtles
// zzz3: nine Kinds of the aardvarks


if (localeObj) {
Object.entries(localeObj).forEach(function (_ref) {
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
code = _ref2[0],
data = _ref2[1];

_localeService.default.addResource('en', "".concat(module, ".").concat(activity, ".").concat(page), (0, _defineProperty2.default)({}, module, (0, _defineProperty2.default)({}, activity, (0, _defineProperty2.default)({}, page, data))));
});
}
},
setPostMessage: function setPostMessage() {
window.addEventListener('message', this.postMessageCallback.bind(this));
},
postMessageCallback: function postMessageCallback(evt) {
if (evt.data.locale) {
this.addLocales(evt.data.locale);
}

if (evt.data.model) {
var xpath = evt.data.xpath;

if (evt.data.objPath) {
xpath = this.convertObjPathToXPath(evt.data.objPath, evt.data.contentRegion);
}

if (xpath) {
this.makeView(evt.data.model, xpath, evt.data.operation, evt.data.objPath);
}
}
}
});

var _default = ForgeEditorView;
exports.default = _default;
});

require.register("views/forge-editor/templates/forge-editor.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
return "<div id=\"forge-editor-holder\">\n <div id=\"floater\">\n <div id=\"clicked-elems-holder\">\n <ul id=\"clicked-elems\"></ul>\n </div>\n </div>\n</div>";
},"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/menu/menu-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _view = _interopRequireDefault(require("views/base/view"));

var _blockCollectionView = _interopRequireDefault(require("views/block/block-collection-view"));

var _feedbackService = _interopRequireDefault(require("services/course-handler-services/feedback-service"));

var _animationService = _interopRequireDefault(require("services/event-handler-services/animation-service"));

var _utils = _interopRequireDefault(require("lib/utils"));

var _menu = _interopRequireDefault(require("./templates/menu"));

var _chaplin = _interopRequireDefault(require("chaplin"));

var _lodash = _interopRequireDefault(require("lodash"));

var _AniJS = _interopRequireDefault(require("AniJS"));

var _jquery = _interopRequireDefault(require("jquery"));

var MenuView = _view.default.extend({
autoRender: true,
className: 'menu',
template: _menu.default,
listSelector: '.menu-items',
animationDuration: 0,
regions: {
blocks: '.blocks',
feedback: '.feedback'
},
initialize: function initialize(options) {
_utils.default.loadPageSRText(this.model.get('title'));

this.subView = options.subView;

if (!options.subView) {
_chaplin.default.mediator.publish('page:state:initialized', this);

_chaplin.default.mediator.subscribe('block:feedback', this.renderFeedback, this);
}

this.script = _utils.default.tryRequire("menu/".concat(this.model.get('key'), "/").concat(this.model.get('key'))) || {};

if (this.script.initialized) {
this.script.initialized.call(this.script, this);
}

this.on('addedToDOM', _lodash.default.bind(this.renderBlocks, this));

_view.default.prototype.initialize.apply(this, arguments);
},
renderBlocks: function renderBlocks() {
var _this = this;

this.delegate('click', '[data-close=true]', function (e) {
e.preventDefault();

_this.trigger('close', _this);
});

var blocksLoaded = function blocksLoaded() {
if (!_this.subView) {
_chaplin.default.mediator.publish('page:state:loaded', _this);
}

if (_this.script.loaded) {
_this.script.loaded.call(_this.script, _this);
}

_AniJS.default.run();

if (_this.model.get('startAnimation')) {
_animationService.default.queueAnimationsRun();
}

_this.model.set('state', 'playing');

_this.trigger('page:state:change', _this);
};

if (this.model.get('blocks')) {
var blocksView = new _blockCollectionView.default({
collection: this.model.get('blocks'),
region: 'blocks',
script: this.script ? this.script.block : undefined,
parent: this,
pageView: this
});
this.subview('blocks', blocksView); // eslint-disable-next-line no-unused-vars

var readyToLoad = function readyToLoad() {
return blocksView.isLoaded();
};

if (blocksView.isLoaded()) {
blocksLoaded();
} else {
this.listenTo(blocksView, 'block:state:loaded', function () {
return blocksLoaded();
});
}
} else {
blocksLoaded();
}
},
renderFeedback: function renderFeedback(feedback, callbacks) {
_feedbackService.default.displayFeedback(this, feedback, callbacks);
},
dispose: function dispose() {
(0, _jquery.default)('#page-loading').attr('aria-hidden', false);
setTimeout(function () {
(0, _jquery.default)('#page-loading').attr('tabindex', -1).focus();
}, 0);

if (this.script.unloading) {
this.script.unloading.call(this.script, this, function () {});
} // If `context` is null, removes all callbacks with that function.


_chaplin.default.mediator.unsubscribe('block:feedback', this.renderFeedback, null);

_view.default.prototype.dispose.apply(this, arguments);
}
});

var _default = MenuView;
exports.default = _default;
});

require.register("views/menu/templates/menu.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"1":function(container,depth0,helpers,partials,data) {
return " <div class=\"backdrop\"></div>\n";
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return ((stack1 = lookupProperty(helpers,"if").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"backdrop") : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":7}}})) != null ? stack1 : "")
+ "<div class=\"blocks\" role=\"main\"></div>\n<div class=\"feedback\"></div>\n";
},"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/page/page-view.js", function(exports, require, module) {
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

var _ef = _interopRequireDefault(require("ef/ef"));

var _view = _interopRequireDefault(require("views/base/view"));

var _feedbackView = _interopRequireDefault(require("views/feedback/feedback-view"));

var _actionbarView = _interopRequireDefault(require("views/actionbar/actionbar-view"));

var _alertView = require("views/alert/alert-view");

var _customContentCollectionView = _interopRequireDefault(require("views/custom-content/custom-content-collection-view"));

var _blockCollectionView = _interopRequireDefault(require("views/block/block-collection-view"));

var _feedback = _interopRequireDefault(require("models/feedback"));

var _courseSettingsService = _interopRequireDefault(require("services/course-handler-services/course-settings-service"));

var _webStorageService = require("services/data-handler-services/web-storage-service");

var _chaplin = _interopRequireDefault(require("chaplin"));

var _keybindingService = require("services/event-handler-services/keybinding-service");

var _localeService = _interopRequireDefault(require("services/loader-handler-services/locale-service"));

var _contentService = _interopRequireDefault(require("services/loader-handler-services/content-service"));

var _transcriptView = _interopRequireDefault(require("views/transcript/transcript-view"));

var _feedbackService = _interopRequireDefault(require("services/course-handler-services/feedback-service"));

var _pageService = _interopRequireDefault(require("services/page-service"));

var _animationService = _interopRequireDefault(require("services/event-handler-services/animation-service"));

var _pageTimerService = _interopRequireDefault(require("services/course-handler-services/page-timer-service"));

var _blockOrderService = _interopRequireDefault(require("services/course-handler-services/block-order-service"));

var _utils = _interopRequireDefault(require("lib/utils"));

var _contentProvider = _interopRequireDefault(require("services/content-provider"));

var _page = _interopRequireDefault(require("./templates/page"));

var _timeout = _interopRequireDefault(require("./templates/timeout"));

var _aos = _interopRequireDefault(require("aos"));

var _jquery = _interopRequireDefault(require("jquery"));

var _lodash = _interopRequireDefault(require("lodash"));

var _AniJS = _interopRequireDefault(require("AniJS"));

var Tab = _keybindingService.keys.Tab,
Enter = _keybindingService.keys.Enter,
Space = _keybindingService.keys.Space;

var PageView = _view.default.extend({
autoRender: true,
regions: {
page: '#page-container',
timer: '#timer-page',
actionbar: '.actionbar',
alert: '.alert',
'audio-starter-alert': '.audio-starter-alert',
siteTranscript: '.site-transcript',
before: '.before-content',
feedback: '.feedback',
'custom-content': '.custom-content'
},
template: _page.default,
listen: {
'action:replay mediator': 'onReplay',
'action:unload mediator': 'unload',
'block:feedback mediator': 'renderFeedback',
'action:alert mediator': 'renderAlert',
'audio:play:blocked mediator': 'renderAudioStarterAlert'
},
initialize: function () {
var _initialize = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_options) {
var self,
that,
linkedPage,
scriptPath,
accSettings,
$el,
transitionInDir,
pageCompletion,
openModal,
shouldBeSkipped,
_args = arguments;
return _regenerator.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
self = this;

_utils.default.loadPageSRText(this.model.get('title'));

if (_courseSettingsService.default.get('trackPageTimes') && !_ef.default.options.local) {
this.pageTimerService = new _pageTimerService.default();
this.pageTimerService.start();
}

if (_courseSettingsService.default.get('transcript')) {
this.model.set('transcript', true);
}

if (_courseSettingsService.default.get('skipNavigationAccessibility')) {
this.model.set('skipNavigationAccessibility', true);
}

if (_courseSettingsService.default.get('pageCompletion') && _courseSettingsService.default.get('pageCompletion').completeOnError) {
this.subscribeEvent('application:error', function (_application) {
if (self !== undefined && _jquery.default.isFunction(self.completePage)) {
self.completePage();
}
});
}

_blockOrderService.default.reset();
/**
* CourseSettingsService.
*/


that = this;
(0, _jquery.default)('#site-container').addClass('focus-hide');
this.delegate('click', '#transcript_button', function (e) {
var _this = this;

e.preventDefault();
var self = this;

if (this.transcriptShowing) {
this.closeTranscript();
} else {
_chaplin.default.mediator.publish('action:pause');

this.$('#transcript_button').addClass('open');
var transcriptView = new _transcriptView.default({
region: 'siteTranscript',
model: this.model
});
transcriptView.delegate('click', '.close', function () {
self.closeTranscript();
(0, _jquery.default)('#transcript_button').focus();
});
this.subview('siteTranscript', transcriptView);
this.$('.transcript').css('display', 'block'); // something in the page view grabs focus again, so let's delay slightly

setTimeout(function () {
_this.$('.transcript .text').attr('tabindex', '0').focus();
}, 300);
that.delegate('keydown', '.transcript .text', function (e) {
var _this2 = this;

_keybindingService.KeybindingService.with(e).bind(Tab, function () {
e.preventDefault();

_this2.$('.transcript .close').attr('tabindex', '0').focus();
});
});
this.transcriptShowing = true;
}
});

_utils.default.subAriaHiddenOnDialog(this, '#main-container');

_lodash.default.bindAll(this, 'setState');

linkedPage = this.model.get('link');
scriptPath = linkedPage ? ['modules', linkedPage.module, linkedPage.activity, linkedPage.page, linkedPage.page].join('/') : ['modules', this.model.get('moduleKey'), this.model.get('activityKey'), this.model.get('key'), this.model.get('key')].join('/');
this.script = _utils.default.tryRequire(scriptPath) || {};

if (this.model.get('srContent')) {
accSettings = _courseSettingsService.default.get('accessibility');

if (accSettings && accSettings.skipKey) {
this.model.set('skipKey', accSettings.skipKey);
this.model.set('sr_skip_text', _localeService.default.t('srSkipText'));
}
}

if (this.model.get('custom-transcript')) {
this.customTranscriptKey = this.model.get('custom-transcript');
}

this.delegate('keydown', function (e) {
if ((0, _jquery.default)(e.target).prop('tagName') !== 'INPUT' && accSettings && accSettings.skipKey) {
_keybindingService.KeybindingService.with(e).bind([accSettings.skipKey.toUpperCase(), accSettings.skipKey.toLowerCase()], function () {
if (self.model.get('srContent') && e.shiftKey && e.ctrlKey) {
self.completePage();

_chaplin.default.mediator.publish('page:navigate', self.forwardKey());
}
});
}
});
$el = this.$el;

if (this.model.get('transition-in')) {
transitionInDir = this.model.get('transition-in');
$el.addClass("transition-in-".concat(transitionInDir));
$el.on('animationstart', function () {
$el.on('animationend', function () {
//console.log(`finished animation in on ${this.model.get('key')}; removing class`);
if ($el) {
$el.removeClass("transition-in-".concat(transitionInDir));
}
});
});
}

this.listenTo(this.model, 'change:state', function () {
//TODO: review the timing of this; had to move it in FeedbackView to have it run after callbacks had happened
self.trigger('page:state:change', self);

if (self.model) {
_chaplin.default.mediator.publish("page:state:".concat(self.model.get('state')), self);
}

_chaplin.default.mediator.publish('page:stateChange', self);
});
this.subscribeEvent('feedback:all:close', function () {
for (var i = this.subviews.length - 1; i >= 0; i--) {
if (this.subviews[i] instanceof _feedbackView.default) {
this.removeSubview(self.subviews[i]);
}
}
});
this.subscribeEvent('alert:close', this.closeAlert);
this.subscribeEvent('audio-starter-alert:close', this.closeAudioStarterAlert);

_chaplin.default.mediator.subscribe('page:complete', function (options) {
self.completePage();

_chaplin.default.mediator.publish('page:navigate', options.direction);
});

if (_courseSettingsService.default.get('pageCompletion')) {
pageCompletion = _courseSettingsService.default.get('pageCompletion');

if (pageCompletion.modal) {
openModal = function openModal() {
self.$('#timeout-modal-container').html(_timeout.default);
self.$('#timeout-modal').modal('show');
self.delegate('click', '#timeout-modal .keep-working', function () {
self.$('#timeout-modal').remove();
clearTimeout(self.completionTimeout);
self.completionTimeout = setTimeout(openModal, pageCompletion.timer);
});
self.delegate('click', '#timeout-modal .skip-page', function () {
self.$('#timeout-modal').remove();
self.completePage();

_chaplin.default.mediator.publish('page:navigate', 'forward');
});
};

this.completionTimeout = setTimeout(openModal, pageCompletion.timer);
} else {
self.completionTimeout = setTimeout(function () {
self.completionTimerExpired = true;
self.completePage();
}, pageCompletion.timer);
}
}

this.setState('initialized');
_context.next = 29;
return _pageService.default.shouldBeSkipped(this);

case 29:
shouldBeSkipped = _context.sent;

if (shouldBeSkipped) {
self.willBeSkipped = true; //defer page navigation until play begins

self.completePage();
}

_utils.default.applyAnimationProperty(this);

_view.default.prototype.initialize.apply(this, _args);

_chaplin.default.mediator.publish('page:initialized');

case 34:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));

function initialize(_x) {
return _initialize.apply(this, arguments);
}

return initialize;
}(),
play: function play() {
var _this3 = this;

if (this.willBeSkipped) {
_chaplin.default.mediator.publish('page:navigate', 'skip');
} else {
this.setPrevNextTitle(); //TODO: revisit trying to reuse the actionbarview, has been moved from the controller
//this.reuse('actionbar', ActionBarView, {region: 'actionbar'});

var group = _ef.default.module.get('group');

var m = new _chaplin.default.Model({
groupTitle: group !== undefined ? group.get('title') : '',
moduleTitle: _ef.default.module.get('title'),
pageTitle: this.model.get('title'),
pageProgress: _ef.default.module.getPageProgress(),
navigation: this.model.get('navigation')
});
var actionBarView = new _actionbarView.default({
region: 'actionbar',
model: m
});
this.subview('actionbar', actionBarView);

_contentService.default.applyContent(new _chaplin.default.Model(), 'modules').then(function (bm) {
// Check if a module-key exists on the modules atrribute and set it as the default block module if it exists
var currentModule = _ef.default.module.get('key');

var modulesCollection = bm.get(currentModule) && bm.get(currentModule).blocks;
return modulesCollection ? _contentService.default.applyContent(new _chaplin.default.Model(), "modules.".concat(currentModule)) : Promise.resolve(bm);
}).then(function (bm) {
var modulesBlocksView;

if (bm.get('blocks')) {
modulesBlocksView = new _blockCollectionView.default({
//eslint-disable-line no-unused-vars
collection: bm.get('blocks'),
region: 'before',
parent: _this3,
pageView: _this3
});

_this3.subview('moduleBlocks', modulesBlocksView);
}

if (bm.get('blocks') && bm.get('blocks').length > 0) {
_this3.setSkipLink();
} else {
_this3.$el.find('#skip-to-main-content').addClass('hidden');
}

var blocksView = new _blockCollectionView.default({
collection: _this3.model.get('blocks'),
region: 'page',
script: _this3.script ? _this3.script.block : undefined,
parent: _this3,
pageView: _this3
});

_this3.subview('blocks', blocksView);

_this3.listenTo(blocksView, 'block:state:completed', _this3.blockCompleted);

_this3.listenTo(blocksView, 'page:state:change', function () {
var narration = _this3.getBlocksNarration(_this3.model.get('blocks'));

if (narration.length) {
_this3.model.set('transcriptNarration', narration);

_this3.$('#transcript_button').css('display', 'block');
}
});

_this3.setPageTitle();

var readyToLoad = function readyToLoad() {
return blocksView.isLoaded() && (!modulesBlocksView || modulesBlocksView && modulesBlocksView.isLoaded());
};

var blocksLoaded = function blocksLoaded() {
if (_this3.model.get('state') !== 'initialized') {
return;
}

_this3.setState('loaded');

_blockOrderService.default.generateOrderMap(blocksView);

if (_blockOrderService.default.getCurrentOrder() !== 'complete') {
_this3.trigger('page:state:change', _this3);
}

var animateds = (0, _jquery.default)('.animated');

var playPage = function playPage() {
_this3.$el.attr('tabindex', '-1');

(0, _jquery.default)('#page-loading').removeAttr('tabindex').attr('aria-hidden', true);
setTimeout(function () {
(0, _jquery.default)(window).scrollTop(0);
}, 0);

_AniJS.default.run();

_aos.default.init();

if (_this3.model.get('startAnimation')) {
_animationService.default.queueAnimationsRun();
}

animateds.each(function (i, el) {
var classes = el.className;
el.className = '';
setTimeout(function () {
return el.className = classes;
}, 0);
});

_this3.setState('playing');
};

var pageCustomizations = _ef.default.customizations.getByKeyAndPage('page-content-customization', _this3.model.get('moduleKey'), _this3.model.get('activityKey'), _this3.model.get('key'));

var customContentView = new _customContentCollectionView.default({
region: 'custom-content',
collection: new _chaplin.default.Collection(pageCustomizations)
});
customContentView.on('done', function () {
if (_this3.model.get('instructions')) {
var feedback = new _feedback.default(_this3.model.get('instructions'));

_this3.renderFeedback(feedback, {
unloading: playPage
});
} else {
playPage();
}
});
customContentView.render();

_this3.subview('custom-content', customContentView);
};

if (readyToLoad()) {
blocksLoaded();
} else {
_this3.listenTo(blocksView, 'block:state:loaded', function () {
return readyToLoad() && blocksLoaded();
});

if (modulesBlocksView) {
_this3.listenTo(modulesBlocksView, 'block:state:loaded', function () {
return readyToLoad() && blocksLoaded();
});
}
}
});
}
},
setPrevNextTitle: function setPrevNextTitle() {
var prev = _pageService.default.getPreviousPage();

var next = _pageService.default.getNextPage();

if (prev) {
_webStorageService.SessionStorageService.setItem('prevTitle', _localeService.default.t(prev.get('title')));
}

if (next) {
_webStorageService.SessionStorageService.setItem('nextTitle', _localeService.default.t(next.get('title')));
}
},
getBlocksNarration: function getBlocksNarration(blocks) {
var _this4 = this;

var transcript = []; //Adding absent, present, parameters as transcript was not showing up when audio tag is passed from inside these key

var nestedItems = ['blocks', 'feedback', 'absent', 'present', 'parameters'].concat(this.nested);
blocks = [].concat(blocks.models || blocks);
blocks.forEach(function (block) {
if (block.get && block.get('narration') || block.narration) {
transcript.push(_localeService.default.t(block.get && block.get('narration') || block.narration));
}

nestedItems.forEach(function (item) {
if (block.attributes && block.attributes[item]) {
transcript.push.apply(transcript, (0, _toConsumableArray2.default)(_this4.getBlocksNarration(block.attributes[item])));
} else if (block[item]) {
transcript.push.apply(transcript, (0, _toConsumableArray2.default)(_this4.getBlocksNarration(block[item])));
}
});

if (blocks.subviews) {
blocks.subviews.forEach(function (view) {
if (view instanceof _blockCollectionView.default) {
transcript.push.apply(transcript, (0, _toConsumableArray2.default)(_this4.getBlocksNarration(view)));
}
});
}
});
return transcript;
},
onReplay: function onReplay() {
this.setState('playing');
},
unload: function unload() {
this.setState('unloading');
this.unsubscribeAllEvents();
},
renderFeedback: function renderFeedback(feedback, callbacks) {
_feedbackService.default.displayFeedback(this, feedback, callbacks);
},
renderAlert: function renderAlert(type, title, body, icon, visibility, timeout) {
var alertView = new _alertView.AlertView({
region: 'alert',
model: new _chaplin.default.Model({
type: type,
ico: icon,
title: title,
body: body,
visibility: visibility,
timeout: timeout
})
});
this.subview('alert', alertView);
(0, _jquery.default)('.e-sign-alert').empty();

if (type === 'alertBox.alertSuccess') {
(0, _jquery.default)('.e-sign-alert').text("".concat(_localeService.default.t('alertBox.alertSuccessHeader'), " ").concat(_localeService.default.t('alertBox.alertSuccessText')));
}

if (type === 'alertBox.alertFailure') {
(0, _jquery.default)('.e-sign-alert').text("".concat(_localeService.default.t('alertBox.alertFailureHeader'), " ").concat(_localeService.default.t('alertBox.alertFailureText')));
}
},
renderAudioStarterAlert: function renderAudioStarterAlert() {
var alertView = new _alertView.AudioStarterAlertView();
this.subview('audio-starter-alert', alertView);
},
closeAlert: function closeAlert() {
var _this$subviewsByName, _this$subviewsByName$;

(_this$subviewsByName = this.subviewsByName) === null || _this$subviewsByName === void 0 ? void 0 : (_this$subviewsByName$ = _this$subviewsByName.alert) === null || _this$subviewsByName$ === void 0 ? void 0 : _this$subviewsByName$.dispose();
(0, _jquery.default)('.alert').html('');
},
closeAudioStarterAlert: function closeAudioStarterAlert() {
this.subviewsByName['audio-starter-alert'].dispose();
(0, _jquery.default)('.audio-starter-alert').html('');
},
closeTranscript: function closeTranscript() {
if (this.subviewsByName.siteTranscript) {
this.subviewsByName.siteTranscript.dispose();
}

this.$('#transcript_button').removeClass('open');
this.$('.transcript').hide();
this.transcriptShowing = false;
},
setPageTitle: function setPageTitle() {
var titleAr = [_localeService.default.t('ModuleName') !== 'ModuleName' ? _localeService.default.t('ModuleName') : _localeService.default.t(_ef.default.module.get('title')), _localeService.default.t(_ef.default.module.currentActivity.get('title')), _localeService.default.t(_ef.default.module.currentActivity.currentPage.get('title')) || _localeService.default.t(this.model.get('page-title'))];
document.title = _lodash.default.uniq(titleAr).filter(function (t) {
return t;
}).join(' | ');
},
setSkipLink: function setSkipLink() {
var _this5 = this;

//Use foundry skip-to-main-content link (#skipLink) if it exists
if ((0, _jquery.default)('#skipLink').length) {
(0, _jquery.default)('#skipLink').on('keydown', function (e) {
_keybindingService.KeybindingService.with(e).bind([Enter, Space], function () {
_this5.skipToContent();
});
});
}

this.$el.on('click', '#skip-to-main-content', function (e) {
e.preventDefault();

_this5.skipToContent();
});
},
skipToContent: function skipToContent() {
var container = (0, _jquery.default)('#page-container').length ? '#page-container' : '#main-container';
var $focus = (0, _jquery.default)("".concat(container, " :header")).length ? (0, _jquery.default)("".concat(container, " :header")).first() : (0, _jquery.default)("".concat(container));
$focus.attr('tabindex', -1).focus();
},
blockCompleted: function blockCompleted(block) {
if (_blockOrderService.default.hasOrderedBlocks()) {
_blockOrderService.default.updateOrderMap(block, this);
}

if (this.subviewsByName.blocks.isComplete()) {
//TODO: this will fire regardless of if progress saves, which might be OK, but should confirm
this.completePage();
}
},
dispose: function dispose() {
var _arguments = arguments,
_this6 = this;

(0, _jquery.default)('#page-loading').attr('aria-hidden', false);
setTimeout(function () {
(0, _jquery.default)('#page-loading').attr('tabindex', -1).focus();
}, 0);

_blockOrderService.default.reset();

if (this.completionTimeout) {
clearTimeout(this.completionTimeout);
}

if (this.pageTimerService) {
this.pageTimerService.clear();
}

if (this.disposed || this.disposing) {
return;
}

if (this.model && (this.model.get('transition') || _courseSettingsService.default.get('transitionAll'))) {
this.disposing = true;
this.keepElement = true;
this.keepSubviews(true);
var $el = this.$el;
var key = this.model.get('key');
$el.on('animationstart', function () {
$el.on('animationend', function () {
console.log("finished animation out on ".concat(key, "; disposing")); //eslint-disable-line no-console

$el.remove();
});
});
var transitionOutDir = this.model.get('transition-out') || 'forward'; //navigation is probably happening too, let that start before we start transitioning

setTimeout(function () {
$el.removeClass('transition-in-back').removeClass('transition-in-forward').addClass("transition-out-".concat(transitionOutDir));

_view.default.prototype.dispose.apply(_this6, _arguments);
}, 0);
} else {
this.keepSubviews(true);

_view.default.prototype.dispose.apply(this, arguments);
}
},
completePage: function completePage() {
//TODO: review this in relation to the existing events in EF
if (this.completionTimeout) {
clearTimeout(this.completionTimeout);
}

if (_courseSettingsService.default.get('trackPageTimes') && !_ef.default.options.local) {
this.pageTimerService.save({
page_key: this.model.get('key'),
activity_key: this.model.get('activityKey'),
module_key: this.model.get('moduleKey')
});
}

this.model.set('completed', true);

_contentProvider.default.PageService.saveProgress(this);

this.setState('completed');
},
stateCallbacks: {
completed: function completed() {
var _this7 = this;

if (this.model.get('completedFeedback') && !this.completionTimerExpired) {
var feedback = new _feedback.default(this.model.get('completedFeedback'));

if (this.model.get('forwardOnComplete') && !this.willBeSkipped) {
this.renderFeedback(feedback, {
afterRemoved: function afterRemoved() {
_chaplin.default.mediator.publish('page:navigate', _this7.forwardKey());
}
});
} else {
this.renderFeedback(feedback);
}
} else {
if (this.model.get('forwardOnComplete') && !this.willBeSkipped) {
_chaplin.default.mediator.publish('page:navigate', this.forwardKey());
}
}

if (Object.isExtensible(this)) {
this.completionTimerExpired = false;
}
},
unloading: function unloading() {
this.setState('unloaded');
},
unloaded: function unloaded() {
this.dispose();
}
},
setState: function setState(state) {
if (this.model) {
if (this.$el) {
this.$el.removeClass(this.model.get('state'));
this.$el.addClass(state);
}

this.model.set('state', state);
}

var callback = this.stateCallbacks[state] ? _lodash.default.bind(this.stateCallbacks[state], this) : null;
var hook = this.script && this.script[state] ? _lodash.default.bind(this.script[state], this.script) : null;

if (hook && callback) {
if (this.script[state].length === 2) {
hook(this, callback);
} else {
hook(this);
callback();
}
} else if (hook) {
hook(this);
} else if (callback) {
callback();
}
},
forwardKey: function forwardKey() {
return this.model.get('navigation') && this.model.get('navigation').forward ? this.model.get('navigation').forward : 'forward';
}
});

var _default = PageView;
exports.default = _default;
});

require.register("views/page/templates/page.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"1":function(container,depth0,helpers,partials,data) {
var lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "<a id=\"skip-nav\" role=\"link\">"
+ container.escapeExpression((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"skipLinkText",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":49}}}))
+ "</a>\n";
},"3":function(container,depth0,helpers,partials,data) {
var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "<div class=\"screen-reader-content\" tabindex=\"-1\" id=\"sr-content\">\n <div>"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"srContent") : depth0),{"name":"t","hash":{},"data":data,"loc":{"start":{"line":6,"column":7},"end":{"line":6,"column":22}}}))
+ "</div>\n <div>"
+ alias3(((helper = (helper = lookupProperty(helpers,"sr_skip_text") || (depth0 != null ? lookupProperty(depth0,"sr_skip_text") : depth0)) != null ? helper : alias2),(typeof helper === "function" ? helper.call(alias1,{"name":"sr_skip_text","hash":{},"data":data,"loc":{"start":{"line":7,"column":7},"end":{"line":7,"column":23}}}) : helper)))
+ "</div>\n</div>\n";
},"5":function(container,depth0,helpers,partials,data) {
return "aria-hidden=\"true\" ";
},"7":function(container,depth0,helpers,partials,data) {
return "aria-live=\"polite\" ";
},"9":function(container,depth0,helpers,partials,data) {
var lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return "<button data-action=\"transcript\" id=\"transcript_button\" tabindex=\"0\">"
+ container.escapeExpression((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"transcriptButton",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":23,"column":69},"end":{"line":23,"column":93}}}))
+ "</button>\n<div class=\"site-transcript\" tabindex=\"-1\"></div>\n";
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"skipNavigationAccessibility") : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":7}}})) != null ? stack1 : "")
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"srContent") : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":4,"column":0},"end":{"line":9,"column":7}}})) != null ? stack1 : "")
+ "<div id=\"timer-page\"></div>\n<div id=\"timeout-modal-container\"></div>\n<div class=\"alert\" role=\"alert\"></div>\n<div class=\"audio-starter-alert\"></div>\n<div id=\"page-header\" class=\"before-content\" "
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"srContent") : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":14,"column":45},"end":{"line":14,"column":88}}})) != null ? stack1 : "")
+ ">\n <div id=\"skip-to-main-content\" class=\"skip-to-main-content\" aria-hidden=\"true\">\n <a href=\"#page-container\" class=\"js-skip-to-content\" role=\"link\" tabindex=\"0\" aria-label=\""
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"skipToMainContent",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":16,"column":94},"end":{"line":16,"column":119}}}))
+ "\"><span>"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"skipToMainContent",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":16,"column":127},"end":{"line":16,"column":152}}}))
+ "</span></a>\n </div>\n</div>\n<div class=\"feedback\" "
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"srContent") : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.program(7, data, 0),"data":data,"loc":{"start":{"line":19,"column":22},"end":{"line":19,"column":92}}})) != null ? stack1 : "")
+ "></div>\n<div id=\"page-container\" class=\"page\" "
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"srContent") : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":20,"column":38},"end":{"line":20,"column":81}}})) != null ? stack1 : "")
+ " role=\"main\"></div>\n<div class=\"actionbar\" role=\"complementary\"></div>\n"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"transcript") : depth0),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":22,"column":0},"end":{"line":25,"column":7}}})) != null ? stack1 : "")
+ "<button class=\"partner-content-btn-wrapper\" data-toggle=\"modal\" data-target=\"#print-modal\" id=\"print-button\"\n tabindex=\"0\">"
+ alias3((lookupProperty(helpers,"t")||(depth0 && lookupProperty(depth0,"t"))||alias2).call(alias1,"printButton",{"name":"t","hash":{},"data":data,"loc":{"start":{"line":27,"column":15},"end":{"line":27,"column":34}}}))
+ "</button>\n<div class=\"custom-content\"></div>\n";
},"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/page/templates/timeout.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
return "";
},"useData":true});
if (typeof define === 'function' && define.amd) {
define([], function() {
return __templateData;
});
} else if (typeof module === 'object' && module && module.exports) {
module.exports = __templateData;
} else {
__templateData;
}
});

;require.register("views/partials/icon.hbs", function(exports, require, module) {
var __templateData = require("handlebars").template({"1":function(container,depth0,helpers,partials,data) {
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return ((stack1 = lookupProperty(helpers,"if").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"index") : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.program(4, data, 0),"data":data,"loc":{"start":{"line":4,"column":4},"end":{"line":8,"column":11}}})) != null ? stack1 : "");
},"2":function(container,depth0,helpers,partials,data) {
var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
return parent[propertyName];
}
return undefined
};

return " data-icon=\""
+ alias4(((helper = (helper = lookupProperty(helpers,"uuid") || (depth0 != null ? lookupProperty(depth0,"uuid") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"uuid","hash":{},"data":data,"loc":{"start":{"line":5,"column":17},"end":{"line":5,"column":25}}}) : helper)))
+ "-"
+ alias4(((helper = (helper = lookupProperty(helpers,"index") || (depth0 != null ? lookupProperty(depth0,"index") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"index","hash":{},"data":data,"loc":{"start":{"line":5,"column":26},"end":{"line":5,"column":35}}}) : helper)))
+ "-"
+ alias4(((helper = (helper = lookupProperty(helpers,"prefix") || (depth0 != null ? lookupProperty(depth0,"prefix") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"prefix","hash":{},"data":data,"loc":{"start":{"line":5,"column":36},"end":{"line":5,"column":46}}}) : helper)))
+ " "
+ alias4(((helper = (helper = lookupPro