// source --> https://studyhubonline.com/wp-content/plugins/learnpress/assets/js/dist/utils.js?ver=61e131f63d2e8 /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/index.js"); /******/ }) /************************************************************************/ /******/ ({ /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/event-callback.js": /*!************************************************************************************************************!*\ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/event-callback.js ***! \************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /** * Manage event callbacks. * Allow add/remove a callback function into custom event of an object. * * @constructor */ var Event_Callback = function Event_Callback(self) { var callbacks = {}; var $ = window.jQuery; this.on = function (event, callback) { var namespaces = event.split('.'), namespace = ''; if (namespaces.length > 1) { event = namespaces[0]; namespace = namespaces[1]; } if (!callbacks[event]) { callbacks[event] = [[], {}]; } if (namespace) { if (!callbacks[event][1][namespace]) { callbacks[event][1][namespace] = []; } callbacks[event][1][namespace].push(callback); } else { callbacks[event][0].push(callback); } return self; }; this.off = function (event, callback) { var namespaces = event.split('.'), namespace = ''; if (namespaces.length > 1) { event = namespaces[0]; namespace = namespaces[1]; } if (!callbacks[event]) { return self; } var at = -1; if (!namespace) { if ($.isFunction(callback)) { at = callbacks[event][0].indexOf(callback); if (at < 0) { return self; } callbacks[event][0].splice(at, 1); } else { callbacks[event][0] = []; } } else { if (!callbacks[event][1][namespace]) { return self; } if ($.isFunction(callback)) { at = callbacks[event][1][namespace].indexOf(callback); if (at < 0) { return self; } callbacks[event][1][namespace].splice(at, 1); } else { callbacks[event][1][namespace] = []; } } return self; }; this.callEvent = function (event, callbackArgs) { if (!callbacks[event]) { return; } if (callbacks[event][0]) { for (var i = 0; i < callbacks[event][0].length; i++) { $.isFunction(callbacks[event][0][i]) && callbacks[event][i][0].apply(self, callbackArgs); } } if (callbacks[event][1]) { for (var i in callbacks[event][1]) { for (var j = 0; j < callbacks[event][1][i].length; j++) { $.isFunction(callbacks[event][1][i][j]) && callbacks[event][1][i][j].apply(self, callbackArgs); } } } }; }; /* harmony default export */ __webpack_exports__["default"] = (Event_Callback); /***/ }), /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/extend.js": /*!****************************************************************************************************!*\ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/extend.js ***! \****************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony default export */ __webpack_exports__["default"] = (function () { window.LP = window.LP || {}; if (typeof arguments[0] === 'string') { LP[arguments[0]] = LP[arguments[0]] || {}; LP[arguments[0]] = jQuery.extend(LP[arguments[0]], arguments[1]); } else { LP = jQuery.extend(LP, arguments[0]); } }); /***/ }), /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/fn.js": /*!************************************************************************************************!*\ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/fn.js ***! \************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /** * Auto prepend `LP` prefix for jQuery fn plugin name. * * Create : $.fn.LP( 'PLUGIN_NAME', func) <=> $.fn.LP_PLUGIN_NAME * Usage: $(selector).LP('PLUGIN_NAME') <=> $(selector).LP_PLUGIN_NAME() * * @version 3.2.6 */ var $ = window.jQuery; var exp; (function () { if ($ === undefined) { return; } $.fn.LP = exp = function exp(widget, fn) { if ($.isFunction(fn)) { $.fn['LP_' + widget] = fn; } else if (widget) { var args = []; if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args.push(arguments[i]); } } return $.isFunction($(this)['LP_' + widget]) ? $(this)['LP_' + widget].apply(this, args) : this; } return this; }; })(); /* harmony default export */ __webpack_exports__["default"] = (exp); /***/ }), /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/hook.js": /*!**************************************************************************************************!*\ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/hook.js ***! \**************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); var Hook = { hooks: { action: {}, filter: {} }, addAction: function addAction(action, callable, priority, tag) { this.addHook('action', action, callable, priority, tag); return this; }, addFilter: function addFilter(action, callable, priority, tag) { this.addHook('filter', action, callable, priority, tag); return this; }, doAction: function doAction(action) { this.doHook('action', action, arguments); return this; }, applyFilters: function applyFilters(action) { return this.doHook('filter', action, arguments); }, removeAction: function removeAction(action, tag) { this.removeHook('action', action, tag); return this; }, removeFilter: function removeFilter(action, priority, tag) { this.removeHook('filter', action, priority, tag); return this; }, addHook: function addHook(hookType, action, callable, priority, tag) { if (undefined === this.hooks[hookType][action]) { this.hooks[hookType][action] = []; } var hooks = this.hooks[hookType][action]; if (undefined === tag) { tag = action + '_' + hooks.length; } this.hooks[hookType][action].push({ tag: tag, callable: callable, priority: priority }); return this; }, doHook: function doHook(hookType, action, args) { // splice args from object into array and remove first index which is the hook name args = Array.prototype.slice.call(args, 1); if (undefined !== this.hooks[hookType][action]) { var hooks = this.hooks[hookType][action], hook; //sort by priority hooks.sort(function (a, b) { return a["priority"] - b["priority"]; }); for (var i = 0; i < hooks.length; i++) { hook = hooks[i].callable; if (typeof hook !== 'function') hook = window[hook]; if ('action' === hookType) { hook.apply(null, args); } else { args[0] = hook.apply(null, args); } } } if ('filter' === hookType) { return args[0]; } return this; }, removeHook: function removeHook(hookType, action, priority, tag) { if (undefined !== this.hooks[hookType][action]) { var hooks = this.hooks[hookType][action]; for (var i = hooks.length - 1; i >= 0; i--) { if ((undefined === tag || tag === hooks[i].tag) && (undefined === priority || priority === hooks[i].priority)) { hooks.splice(i, 1); } } } return this; } }; /* harmony default export */ __webpack_exports__["default"] = (Hook); /***/ }), /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/index.js": /*!***************************************************************************************************!*\ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/index.js ***! \***************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _extend__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./extend */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/extend.js"); /* harmony import */ var _fn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fn */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/fn.js"); /* harmony import */ var _quick_tip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./quick-tip */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/quick-tip.js"); /* harmony import */ var _quick_tip__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_quick_tip__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _message_box__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./message-box */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/message-box.js"); /* harmony import */ var _event_callback__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./event-callback */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/event-callback.js"); /* harmony import */ var _hook__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hook */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/hook.js"); /* harmony import */ var _jquery_plugins__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./jquery.plugins */ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/jquery.plugins.js"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /** * Utility functions may use for both admin and frontend. * * @version 3.2.6 */ var $ = jQuery; String.prototype.getQueryVar = function (name) { name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), results = regex.exec(this); return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' ')); }; String.prototype.addQueryVar = function (name, value) { var url = this, m = url.split('#'); url = m[0]; if (name.match(/\[/)) { url += url.match(/\?/) ? '&' : '?'; url += name + '=' + value; } else if (url.indexOf('&' + name + '=') != -1 || url.indexOf('?' + name + '=') != -1) { url = url.replace(new RegExp(name + '=([^&#]*)', 'g'), name + '=' + value); } else { url += url.match(/\?/) ? '&' : '?'; url += name + '=' + value; } return url + (m[1] ? '#' + m[1] : ''); }; String.prototype.removeQueryVar = function (name) { var url = this; var m = url.split('#'); url = m[0]; name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); var regex = new RegExp('[\\?&]' + name + '([\[][^=]*)?=([^&#]*)', 'g'); url = url.replace(regex, ''); return url + (m[1] ? '#' + m[1] : ''); }; // if ( $.isEmptyObject( '' ) == false ) { // $.isEmptyObject = function( a ) { // let prop; // for ( prop in a ) { // if ( a.hasOwnProperty( prop ) ) { // return false; // } // } // return true; // }; // } var _default = { Hook: _hook__WEBPACK_IMPORTED_MODULE_5__["default"], setUrl: function setUrl(url, ember, title) { if (url) { history.pushState({}, title, url); LP.Hook.doAction('learn_press_set_location_url', url); } }, toggleGroupSection: function toggleGroupSection(el, target) { var $el = $(el), isHide = $el.hasClass('hide-if-js'); if (isHide) { $el.hide().removeClass('hide-if-js'); } $el.removeClass('hide-if-js').slideToggle(function () { var $this = $(this); if ($this.is(':visible')) { $(target).addClass('toggle-on').removeClass('toggle-off'); } else { $(target).addClass('toggle-off').removeClass('toggle-on'); } }); }, overflow: function overflow(el, v) { var $el = $(el), overflow = $el.css('overflow'); if (v) { $el.css('overflow', v).data('overflow', overflow); } else { $el.css('overflow', $el.data('overflow')); } }, getUrl: function getUrl() { return window.location.href; }, addQueryVar: function addQueryVar(name, value, url) { return (url === undefined ? window.location.href : url).addQueryVar(name, value); }, removeQueryVar: function removeQueryVar(name, url) { return (url === undefined ? window.location.href : url).removeQueryVar(name); }, reload: function reload(url) { if (!url) { url = window.location.href; } window.location.href = url; }, parseResponse: function parseResponse(response, type) { var m = response.match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/); if (m) { response = m[1]; } return (type || 'json') === 'json' ? this.parseJSON(response) : response; }, parseJSON: function parseJSON(data) { var m = (data + '').match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/); try { if (m) { data = $.parseJSON(m[1]); } else { data = $.parseJSON(data); } } catch (e) { data = {}; } return data; }, ajax: function ajax(args) { var type = args.type || 'post', dataType = args.dataType || 'json', data = args.action ? $.extend(args.data, { 'lp-ajax': args.action }) : args.data, beforeSend = args.beforeSend || function () {}, url = args.url || window.location.href; // console.debug( beforeSend ); $.ajax({ data: data, url: url, type: type, dataType: 'html', beforeSend: beforeSend.apply(null, args), success: function success(raw) { var response = LP.parseResponse(raw, dataType); $.isFunction(args.success) && args.success(response, raw); }, error: function error() { $.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array()); } }); }, doAjax: function doAjax(args) { var type = args.type || 'post', dataType = args.dataType || 'json', action = (args.prefix === undefined || 'learnpress_') + args.action, data = args.action ? $.extend(args.data, { action: action }) : args.data; $.ajax({ data: data, url: args.url || window.location.href, type: type, dataType: 'html', success: function success(raw) { var response = LP.parseResponse(raw, dataType); $.isFunction(args.success) && args.success(response, raw); }, error: function error() { $.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array()); } }); }, funcArgs2Array: function funcArgs2Array(args) { var arr = []; for (var i = 0; i < args.length; i++) { arr.push(args[i]); } return arr; }, addFilter: function addFilter(action, callback) { var $doc = $(document), event = 'LP.' + action; $doc.on(event, callback); LP.log($doc.data('events')); return this; }, applyFilters: function applyFilters() { var $doc = $(document), action = arguments[0], args = this.funcArgs2Array(arguments); if ($doc.hasEvent(action)) { args[0] = 'LP.' + action; return $doc.triggerHandler.apply($doc, args); } return args[1]; }, addAction: function addAction(action, callback) { return this.addFilter(action, callback); }, doAction: function doAction() { var $doc = $(document), action = arguments[0], args = this.funcArgs2Array(arguments); if ($doc.hasEvent(action)) { args[0] = 'LP.' + action; $doc.trigger.apply($doc, args); } }, toElement: function toElement(element, args) { if ($(element).length === 0) { return; } args = $.extend({ delay: 300, duration: 'slow', offset: 50, container: null, callback: null, invisible: false }, args || {}); var $container = $(args.container), rootTop = 0; if ($container.length === 0) { $container = $('body, html'); } rootTop = $container.offset().top; var to = $(element).offset().top + $container.scrollTop() - rootTop - args.offset; function isElementInView(element, fullyInView) { var pageTop = $container.scrollTop(); var pageBottom = pageTop + $container.height(); var elementTop = $(element).offset().top - $container.offset().top; var elementBottom = elementTop + $(element).height(); if (fullyInView === true) { return pageTop < elementTop && pageBottom > elementBottom; } return elementTop <= pageBottom && elementBottom >= pageTop; } if (args.invisible && isElementInView(element, true)) { return; } $container.fadeIn(10).delay(args.delay).animate({ scrollTop: to }, args.duration, args.callback); }, uniqueId: function uniqueId(prefix, more_entropy) { if (typeof prefix === 'undefined') { prefix = ''; } var retId; var formatSeed = function formatSeed(seed, reqWidth) { seed = parseInt(seed, 10).toString(16); // to hex str if (reqWidth < seed.length) { // so long we split return seed.slice(seed.length - reqWidth); } if (reqWidth > seed.length) { // so short we pad return new Array(1 + (reqWidth - seed.length)).join('0') + seed; } return seed; }; // BEGIN REDUNDANT if (!this.php_js) { this.php_js = {}; } // END REDUNDANT if (!this.php_js.uniqidSeed) { // init seed with big random int this.php_js.uniqidSeed = Math.floor(Math.random() * 0x75bcd15); } this.php_js.uniqidSeed++; retId = prefix; // start with prefix, add current milliseconds hex string retId += formatSeed(parseInt(new Date().getTime() / 1000, 10), 8); retId += formatSeed(this.php_js.uniqidSeed, 5); // add seed hex string if (more_entropy) { // for more entropy we add a float lower to 10 retId += (Math.random() * 10).toFixed(8).toString(); } return retId; }, log: function log() { //if (typeof LEARN_PRESS_DEBUG != 'undefined' && LEARN_PRESS_DEBUG && console) { for (var i = 0, n = arguments.length; i < n; i++) { console.log(arguments[i]); } //} }, blockContent: function blockContent() { if ($('#learn-press-block-content').length === 0) { $(LP.template('learn-press-template-block-content', {})).appendTo($('body')); } LP.hideMainScrollbar().addClass('block-content'); $(document).trigger('learn_press_block_content'); }, unblockContent: function unblockContent() { setTimeout(function () { LP.showMainScrollbar().removeClass('block-content'); $(document).trigger('learn_press_unblock_content'); }, 350); }, hideMainScrollbar: function hideMainScrollbar(el) { if (!el) { el = 'html, body'; } var $el = $(el); $el.each(function () { var $root = $(this), overflow = $root.css('overflow'); $root.css('overflow', 'hidden').attr('overflow', overflow); }); return $el; }, showMainScrollbar: function showMainScrollbar(el) { if (!el) { el = 'html, body'; } var $el = $(el); $el.each(function () { var $root = $(this), overflow = $root.attr('overflow'); $root.css('overflow', overflow).removeAttr('overflow'); }); return $el; }, template: typeof _ !== 'undefined' ? _.memoize(function (id, data) { var compiled, options = { evaluate: /<#([\s\S]+?)#>/g, interpolate: /\{\{\{([\s\S]+?)\}\}\}/g, escape: /\{\{([^\}]+?)\}\}(?!\})/g, variable: 'data' }; var tmpl = function tmpl(data) { compiled = compiled || _.template($('#' + id).html(), null, options); return compiled(data); }; return data ? tmpl(data) : tmpl; }, function (a, b) { return a + '-' + JSON.stringify(b); }) : function () { return ''; }, alert: function alert(localize, callback) { var title = '', message = ''; if (typeof localize === 'string') { message = localize; } else { if (typeof localize.title !== 'undefined') { title = localize.title; } if (typeof localize.message !== 'undefined') { message = localize.message; } } $.alerts.alert(message, title, function (e) { LP._on_alert_hide(); callback && callback(e); }); this._on_alert_show(); }, confirm: function confirm(localize, callback) { var title = '', message = ''; if (typeof localize === 'string') { message = localize; } else { if (typeof localize.title !== 'undefined') { title = localize.title; } if (typeof localize.message !== 'undefined') { message = localize.message; } } $.alerts.confirm(message, title, function (e) { LP._on_alert_hide(); callback && callback(e); }); this._on_alert_show(); }, _on_alert_show: function _on_alert_show() { var $container = $('#popup_container'), $placeholder = $('').insertAfter($container).data('xxx', $container); $container.stop().css('top', '-=50').css('opacity', '0').animate({ top: '+=50', opacity: 1 }, 250); }, _on_alert_hide: function _on_alert_hide() { var $holder = $('#popup_container_placeholder'), $container = $holder.data('xxx'); if ($container) { $container.replaceWith($holder); } $container.appendTo($(document.body)); $container.stop().animate({ top: '+=50', opacity: 0 }, 250, function () { $(this).remove(); }); }, sendMessage: function sendMessage(data, object, targetOrigin, transfer) { if ($.isPlainObject(data)) { data = JSON.stringify(data); } object = object || window; targetOrigin = targetOrigin || '*'; object.postMessage(data, targetOrigin, transfer); }, receiveMessage: function receiveMessage(event, b) { var target = event.origin || event.originalEvent.origin, data = event.data || event.originalEvent.data || ''; if (typeof data === 'string' || data instanceof String) { if (data.indexOf('{') === 0) { data = LP.parseJSON(data); } } LP.Hook.doAction('learn_press_receive_message', data, target); } }; $(document).ready(function () { if (typeof $.alerts !== 'undefined') { $.alerts.overlayColor = '#000'; $.alerts.overlayOpacity = 0.5; $.alerts.okButton = lpGlobalSettings.localize.button_ok; $.alerts.cancelButton = lpGlobalSettings.localize.button_cancel; } $('.learn-press-message.fixed').each(function () { var $el = $(this), options = $el.data(); (function ($el, options) { if (options.delayIn) { setTimeout(function () { $el.show().hide().fadeIn(); }, options.delayIn); } if (options.delayOut) { setTimeout(function () { $el.fadeOut(); }, options.delayOut + (options.delayIn || 0)); } })($el, options); }); $('body').on('click', '.learn-press-nav-tabs li a', function (e) { e.preventDefault(); var $tab = $(this), url = ''; $tab.closest('li').addClass('active').siblings().removeClass('active'); $($tab.attr('data-tab')).addClass('active').siblings().removeClass('active'); $(document).trigger('learn-press/nav-tabs/clicked', $tab); }); setTimeout(function () { $('.learn-press-nav-tabs li.active:not(.default) a').trigger('click'); }, 300); $('body.course-item-popup').parent().css('overflow', 'hidden'); (function () { var timer = null, callback = function callback() { $('.auto-check-lines').checkLines(function (r) { if (r > 1) { $(this).removeClass('single-lines'); } else { $(this).addClass('single-lines'); } $(this).attr('rows', r); }); }; $(window).on('resize.check-lines', function () { if (timer) { timer && clearTimeout(timer); timer = setTimeout(callback, 300); } else { callback(); } }); })(); $('.learn-press-tooltip, .lp-passing-conditional').LP_Tooltip({ offset: [24, 24] }); $('.learn-press-icon').LP_Tooltip({ offset: [30, 30] }); $('.learn-press-message[data-autoclose]').each(function () { var $el = $(this), delay = parseInt($el.data('autoclose')); if (delay) { setTimeout(function ($el) { $el.fadeOut(); }, delay, $el); } }); $(document).on('click', function () { $(document).trigger('learn-press/close-all-quick-tip'); }); }); Object(_extend__WEBPACK_IMPORTED_MODULE_0__["default"])(_objectSpread({ Event_Callback: _event_callback__WEBPACK_IMPORTED_MODULE_4__["default"], MessageBox: _message_box__WEBPACK_IMPORTED_MODULE_3__["default"] }, _default)); /* harmony default export */ __webpack_exports__["default"] = ({ fn: _fn__WEBPACK_IMPORTED_MODULE_1__["default"], QuickTip: _quick_tip__WEBPACK_IMPORTED_MODULE_2___default.a }); /***/ }), /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/jquery.plugins.js": /*!************************************************************************************************************!*\ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/jquery.plugins.js ***! \************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var $ = window.jQuery; var serializeJSON = function serializeJSON(path) { var isInput = $(this).is('input') || $(this).is('select') || $(this).is('textarea'); var unIndexed = isInput ? $(this).serializeArray() : $(this).find('input, select, textarea').serializeArray(), indexed = {}, validate = /(\[([a-zA-Z0-9_-]+)?\]?)/g, arrayKeys = {}, end = false; $.each(unIndexed, function () { var that = this, match = this.name.match(/^([0-9a-zA-Z_-]+)/); if (!match) { return; } var keys = this.name.match(validate), objPath = "indexed['" + match[0] + "']"; if (keys) { if (_typeof(indexed[match[0]]) != 'object') { indexed[match[0]] = {}; } $.each(keys, function (i, prop) { prop = prop.replace(/\]|\[/g, ''); var rawPath = objPath.replace(/'|\[|\]/g, ''), objExp = '', preObjPath = objPath; if (prop == '') { if (arrayKeys[rawPath] == undefined) { arrayKeys[rawPath] = 0; } else { arrayKeys[rawPath]++; } objPath += "['" + arrayKeys[rawPath] + "']"; } else { if (!isNaN(prop)) { arrayKeys[rawPath] = prop; } objPath += "['" + prop + "']"; } try { if (i == keys.length - 1) { objExp = objPath + "=that.value;"; end = true; } else { objExp = objPath + "={}"; end = false; } var evalString = "" + "if( typeof " + objPath + " == 'undefined'){" + objExp + ";" + "}else{" + "if(end){" + "if(typeof " + preObjPath + "!='object'){" + preObjPath + "={};}" + objExp + "}" + "}"; eval(evalString); } catch (e) { console.log('Error:' + e + "\n" + objExp); } }); } else { indexed[match[0]] = this.value; } }); if (path) { path = "['" + path.replace('.', "']['") + "']"; var c = 'try{indexed = indexed' + path + '}catch(ex){console.log(c, ex);}'; eval(c); } return indexed; }; var LP_Tooltip = function LP_Tooltip(options) { options = $.extend({}, { offset: [0, 0] }, options || {}); return $.each(this, function () { var $el = $(this), content = $el.data('content'); if (!content || $el.data('LP_Tooltip') !== undefined) { return; } var $tooltip = null; $el.hover(function (e) { $tooltip = $('
').html(content).appendTo($('body')).hide(); var position = $el.offset(); if ($.isArray(options.offset)) { var top = options.offset[1], left = options.offset[0]; if ($.isNumeric(left)) { position.left += left; } else {} if ($.isNumeric(top)) { position.top += top; } else {} } $tooltip.css({ top: position.top, left: position.left }); $tooltip.fadeIn(); }, function () { $tooltip && $tooltip.remove(); }); $el.data('tooltip', true); }); }; var hasEvent = function hasEvent(name) { var events = $(this).data('events'); if (typeof events.LP == 'undefined') { return false; } for (i = 0; i < events.LP.length; i++) { if (events.LP[i].namespace == name) { return true; } } return false; }; var dataToJSON = function dataToJSON() { var json = {}; $.each(this[0].attributes, function () { var m = this.name.match(/^data-(.*)/); if (m) { json[m[1]] = this.value; } }); return json; }; var rows = function rows() { var h = $(this).height(); var lh = $(this).css('line-height').replace("px", ""); $(this).attr({ height: h, 'line-height': lh }); return Math.floor(h / parseInt(lh)); }; var checkLines = function checkLines(p) { return this.each(function () { var $e = $(this), rows = $e.rows(); p.call(this, rows); }); }; var findNext = function findNext(selector) { var $selector = $(selector), $root = this.first(), index = $selector.index($root), $next = $selector.eq(index + 1); return $next.length ? $next : false; }; var findPrev = function findPrev(selector) { var $selector = $(selector), $root = this.first(), index = $selector.index($root), $prev = $selector.eq(index - 1); return $prev.length ? $prev : false; }; var progress = function progress(v) { return this.each(function () { var t = parseInt(v / 100 * 360), timer = null, $this = $(this); if (t < 180) { $this.find('.progress-circle').removeClass('gt-50'); } else { $this.find('.progress-circle').addClass('gt-50'); } $this.find('.fill').css({ transform: 'rotate(' + t + 'deg)' }); }); }; $.fn.serializeJSON = serializeJSON; $.fn.LP_Tooltip = LP_Tooltip; $.fn.hasEvent = hasEvent; $.fn.dataToJSON = dataToJSON; $.fn.rows = rows; $.fn.checkLines = checkLines; $.fn.findNext = findNext; $.fn.findPrev = findPrev; $.fn.progress = progress; /* harmony default export */ __webpack_exports__["default"] = ({ serializeJSON: serializeJSON, LP_Tooltip: LP_Tooltip, hasEvent: hasEvent, dataToJSON: dataToJSON, rows: rows, checkLines: checkLines, findNext: findNext, findPrev: findPrev, progress: progress }); /***/ }), /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/message-box.js": /*!*********************************************************************************************************!*\ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/message-box.js ***! \*********************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); var $ = window.jQuery; var MessageBox = { /* * */ $block: null, $window: null, events: {}, instances: [], instance: null, quickConfirm: function quickConfirm(elem, args) { var $e = $(elem); $('[learn-press-quick-confirm]').each(function () { var $ins; ($ins = $(this).data('quick-confirm')) && (console.log($ins), $ins.destroy()); }); !$e.attr('learn-press-quick-confirm') && $e.attr('learn-press-quick-confirm', 'true').data('quick-confirm', new function (elem, args) { var $elem = $(elem), $div = $('').insertAfter($elem), //($(document.body)), offset = $(elem).position() || { left: 0, top: 0 }, timerOut = null, timerHide = null, n = 3, hide = function hide() { $div.fadeOut('fast', function () { $(this).remove(); $div.parent().css('position', ''); }); $elem.removeAttr('learn-press-quick-confirm').data('quick-confirm', undefined); stop(); }, stop = function stop() { timerHide && clearInterval(timerHide); timerOut && clearInterval(timerOut); }, start = function start() { timerOut = setInterval(function () { if (--n == 0) { hide.call($div[0]); $.isFunction(args.onCancel) && args.onCancel(args.data); stop(); } $div.find('span').html(' (' + n + ')'); }, 1000); timerHide = setInterval(function () { if (!$elem.is(':visible') || $elem.css("visibility") == 'hidden') { stop(); $div.remove(); $div.parent().css('position', ''); $.isFunction(args.onCancel) && args.onCancel(args.data); } }, 350); }; args = $.extend({ message: '', data: null, onOk: null, onCancel: null, offset: { top: 0, left: 0 } }, args || {}); $div.html(args.message || $elem.attr('data-confirm-remove') || 'Are you sure?').append(' (' + n + ')').css({}); $div.click(function () { $.isFunction(args.onOk) && args.onOk(args.data); hide(); }).hover(function () { stop(); }, function () { start(); }); //$div.parent().css('position', 'relative'); $div.css({ left: offset.left + $elem.outerWidth() - $div.outerWidth() + args.offset.left, top: offset.top + $elem.outerHeight() + args.offset.top + 5 }).hide().fadeIn('fast'); start(); this.destroy = function () { $div.remove(); $elem.removeAttr('learn-press-quick-confirm').data('quick-confirm', undefined); stop(); }; }(elem, args)); }, show: function show(message, args) { //this.hide(); $.proxy(function () { args = $.extend({ title: '', buttons: '', events: false, autohide: false, message: message, data: false, id: LP.uniqueId(), onHide: null }, args || {}); this.instances.push(args); this.instance = args; var $doc = $(document), $body = $(document.body); if (!this.$block) { this.$block = $('
').appendTo($body); } if (!this.$window) { this.$window = $('
').insertAfter(this.$block); this.$window.click(function () {}); } //this.events = args.events || {}; this._createWindow(message, args.title, args.buttons); this.$block.show(); this.$window.show().attr('instance', args.id); $(window).bind('resize.message-box', $.proxy(this.update, this)).bind('scroll.message-box', $.proxy(this.update, this)); this.update(true); if (args.autohide) { setTimeout(function () { LP.MessageBox.hide(); $.isFunction(args.onHide) && args.onHide.call(LP.MessageBox, args); }, args.autohide); } }, this)(); }, blockUI: function blockUI(message) { message = (message !== false ? message ? message : 'Wait a moment' : '') + '
'; this.show(message); }, hide: function hide(delay, instance) { if (instance) { this._removeInstance(instance.id); } else if (this.instance) { this._removeInstance(this.instance.id); } if (this.instances.length === 0) { if (this.$block) { this.$block.hide(); } if (this.$window) { this.$window.hide(); } $(window).unbind('resize.message-box', this.update).unbind('scroll.message-box', this.update); } else { if (this.instance) { this._createWindow(this.instance.message, this.instance.title, this.instance.buttons); } } }, update: function update(force) { var that = this, $wrap = this.$window.find('#message-box-wrap'), timer = $wrap.data('timer'), _update = function _update() { LP.Hook.doAction('learn_press_message_box_before_resize', that); var $content = $wrap.find('.message-box-content').css("height", "").css('overflow', 'hidden'), width = $wrap.outerWidth(), height = $wrap.outerHeight(), contentHeight = $content.height(), windowHeight = $(window).height(), top = $wrap.offset().top; if (contentHeight > windowHeight - 50) { $content.css({ height: windowHeight - 25 }); height = $wrap.outerHeight(); } else { $content.css("height", "").css('overflow', ''); } $wrap.css({ marginTop: ($(window).height() - height) / 2 }); LP.Hook.doAction('learn_press_message_box_resize', height, that); }; if (force) _update(); timer && clearTimeout(timer); timer = setTimeout(_update, 250); }, _removeInstance: function _removeInstance(id) { for (var i = 0; i < this.instances.length; i++) { if (this.instances[i].id === id) { this.instances.splice(i, 1); var len = this.instances.length; if (len) { this.instance = this.instances[len - 1]; this.$window.attr('instance', this.instance.id); } else { this.instance = false; this.$window.removeAttr('instance'); } break; } } }, _getInstance: function _getInstance(id) { for (var i = 0; i < this.instances.length; i++) { if (this.instances[i].id === id) { return this.instances[i]; } } }, _createWindow: function _createWindow(message, title, buttons) { var $wrap = this.$window.find('#message-box-wrap').html(''); if (title) { $wrap.append('

' + title + '

'); } $wrap.append($('
').html(message)); if (buttons) { var $buttons = $('
'); switch (buttons) { case 'yesNo': $buttons.append(this._createButton(LP_Settings.localize.button_yes, 'yes')); $buttons.append(this._createButton(LP_Settings.localize.button_no, 'no')); break; case 'okCancel': $buttons.append(this._createButton(LP_Settings.localize.button_ok, 'ok')); $buttons.append(this._createButton(LP_Settings.localize.button_cancel, 'cancel')); break; default: $buttons.append(this._createButton(LP_Settings.localize.button_ok, 'ok')); } $wrap.append($buttons); } }, _createButton: function _createButton(title, type) { var $button = $(''), callback = 'on' + (type.substr(0, 1).toUpperCase() + type.substr(1)); $button.data('callback', callback).click(function () { var instance = $(this).data('instance'), callback = instance.events[$(this).data('callback')]; if ($.type(callback) === 'function') { if (callback.apply(LP.MessageBox, [instance]) === false) {// return; } else { LP.MessageBox.hide(null, instance); } } else { LP.MessageBox.hide(null, instance); } }).data('instance', this.instance); return $button; } }; /* harmony default export */ __webpack_exports__["default"] = (MessageBox); /***/ }), /***/ "../../../Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/quick-tip.js": /*!*******************************************************************************************************!*\ !*** E:/Work/Webs/WP/Clouds/Thimpress/Plugins/github.com/learnpress/assets/src/js/utils/quick-tip.js ***! \*******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { ; (function ($) { function QuickTip(el, options) { var $el = $(el), uniId = $el.attr('data-id') || LP.uniqueId(); options = $.extend({ event: 'hover', autoClose: true, single: true, closeInterval: 1000, arrowOffset: null, tipClass: '' }, options, $el.data()); $el.attr('data-id', uniId); var content = $el.attr('data-content-tip') || $el.html(), $tip = $('
' + content + '
'), t = null, closeInterval = 0, useData = false, arrowOffset = options.arrowOffset === 'el' ? $el.outerWidth() / 2 : 8, $content = $('#__' + uniId); if ($content.length === 0) { $(document.body).append($('
').attr('id', '__' + uniId).html(content).css('display', 'none')); } content = $content.html(); $tip.addClass(options.tipClass); $el.data('content-tip', content); if ($el.attr('data-content-tip')) { //$el.removeAttr('data-content-tip'); useData = true; } closeInterval = options.closeInterval; if (options.autoClose === false) { $tip.append(''); $tip.on('click', '.close', function () { close(); }); } function show() { if (t) { clearTimeout(t); return; } if (options.single) { $('.learn-press-tip').not($el).LP('QuickTip', 'close'); } $tip.appendTo(document.body); var pos = $el.offset(); $tip.css({ top: pos.top - $tip.outerHeight() - 8, left: pos.left - $tip.outerWidth() / 2 + arrowOffset }); } function hide() { t && clearTimeout(t); t = setTimeout(function () { $tip.detach(); t = null; }, closeInterval); } function close() { closeInterval = 0; hide(); closeInterval = options.closeInterval; } function open() { show(); } if (!useData) { $el.html(''); } if (options.event === 'click') { $el.on('click', function (e) { e.stopPropagation(); show(); }); } $(document).on('learn-press/close-all-quick-tip', function () { close(); }); $el.hover(function (e) { e.stopPropagation(); if (options.event !== 'click') { show(); } }, function (e) { e.stopPropagation(); if (options.autoClose) { hide(); } }).addClass('ready'); return { close: close, open: open }; } $.fn.LP('QuickTip', function (options) { return $.each(this, function () { var $tip = $(this).data('quick-tip'); if (!$tip) { $tip = new QuickTip(this, options); $(this).data('quick-tip', $tip); } if ($.type(options) === 'string') { $tip[options] && $tip[options].apply($tip); } }); }); })(jQuery); /***/ }) /******/ }); //# sourceMappingURL=utils.js.map; // source --> https://studyhubonline.com/wp-content/plugins/learnpress/assets/src/js/vendor/watch.js?ver=61e131f63d2e8 if (!Object.prototype.watchChange) { var isFunction = function (fn) { return fn && {}.toString.call(fn) === '[object Function]'; }; Object.defineProperty( Object.prototype, 'watchChange', { enumerable: false, configurable: true, writable: false, value: function (prop, handler) { var obj = this; function x(prop, handler) { var oldval = obj[prop], newval = oldval, getter = function () { return newval; }, setter = function (val) { return newval = handler.call(obj, prop, oldval, val); }; if (delete obj[prop]) { Object.defineProperty( obj, prop, { get: getter, set: setter, enumerable: true, configurable: true } ); } } if (isFunction(prop)) { for (var k in this) { new x(k, prop); } } else { new x(prop, handler) } } }); } if (!Object.prototype.unwatchChange) { Object.defineProperty( Object.prototype, 'unwatchChange', { enumerable: false, configurable: true, writable: false, value: function (prop) { var val = this[prop]; delete this[prop]; this[prop] = val; } } ); }; // source --> https://studyhubonline.com/wp-content/plugins/learnpress/assets/js/vendor/plugins.all.min.js?ver=61e131f63d2e8 var isFunction;Object.prototype.watchChange||(isFunction=function(e){return e&&"[object Function]"==={}.toString.call(e)},Object.defineProperty(Object.prototype,"watchChange",{enumerable:!1,configurable:!0,writable:!1,value:function(e,t){var i=this;function n(t,n){var o=i[t],r=o;delete i[t]&&Object.defineProperty(i,t,{get:function(){return r},set:function(e){return r=n.call(i,t,o,e)},enumerable:!0,configurable:!0})}if(isFunction(e))for(var o in this)n(o,e);else n(e,t)}})),Object.prototype.unwatchChange||Object.defineProperty(Object.prototype,"unwatchChange",{enumerable:!1,configurable:!0,writable:!1,value:function(e){var t=this[e];delete this[e],this[e]=t}}),function(i){var o,r=[],s=!1,a=!1,c={interval:250,force_process:!1},u=i(window);function f(){a=!1;for(var e=0;e=o&&r-(t.data("appear-top-offset")||0)<=o+u.height()&&e+t.width()>=n&&e-(t.data("appear-left-offset")||0)<=n+u.width()},i.fn.extend({appear:function(e){var t=i.extend({},c,e||{}),n=this.selector||this;return s||(e=function(){a||(a=!0,setTimeout(f,t.interval))},i(window).scroll(e).resize(e),s=!0),t.force_process&&setTimeout(f,t.interval),r.push(n),i(n)}}),i.extend({force_appear:function(){return!!s&&(f(),!0)}})}(jQuery),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(r){"use strict";var g=r.scrollTo=function(e,t,n){return r(window).scrollTo(e,t,n)};function i(e){return!e.nodeName||-1!==r.inArray(e.nodeName.toLowerCase(),["iframe","#document","html","body"])}function t(e){return r.isFunction(e)||r.isPlainObject(e)?e:{top:e,left:e}}return g.defaults={axis:"xy",duration:0,limit:!0},r.fn.scrollTo=function(e,n,m){"object"==typeof n&&(m=n,n=0),"function"==typeof m&&(m={onAfter:m}),"max"===e&&(e=9e9),m=r.extend({},g.defaults,m),n=n||m.duration;var _=m.queue&&1 https://studyhubonline.com/wp-includes/js/plupload/moxie.min.js?ver=1.3.5 var MXI_DEBUG=!1;!function(s,E){"use strict";var a={};function n(e,t){for(var i,n=[],r=0;rt[s]){a=1;break}}if(!i)return a;switch(i){case">":case"gt":return 0=":case"ge":return 0<=a;case"<=":case"le":return a<=0;case"==":case"=":case"eq":return 0===a;case"<>":case"!=":case"ne":return 0!==a;case"":case"<":case"lt":return a<0;default:return null}},global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return s.OS=s.os,MXI_DEBUG&&(s.debug={runtime:!0,events:!1},s.log=function(){var e,t,i=arguments[0];"string"===n.typeOf(i)&&(i=n.sprintf.apply(this,arguments)),window&&window.console&&window.console.log?window.console.log(i):document&&((e=document.getElementById("moxie-console"))||((e=document.createElement("pre")).id="moxie-console",document.body.appendChild(e)),-1!==n.inArray(n.typeOf(i),["object","array"])?(t=i,e.appendChild(document.createTextNode(t+"\n"))):e.appendChild(document.createTextNode(i+"\n")))}),s}),e("moxie/core/I18n",["moxie/core/utils/Basic"],function(i){var t={};return{addI18n:function(e){return i.extend(t,e)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(e){var t=[].slice.call(arguments,1);return e.replace(/%[a-z]/g,function(){var e=t.shift();return"undefined"!==i.typeOf(e)?e:""})}}}),e("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(a,n){var e={mimes:{},extensions:{},addMimeType:function(e){for(var t,i,n=e.split(/,/),r=0;r>16&255,n=s>>8&255,s=255&s,d[l++]=64==r?String.fromCharCode(i):64==o?String.fromCharCode(i,n):String.fromCharCode(i,n,s),c>12&63,n=o>>6&63,r=63&o,l[u++]=s.charAt(o>>18&63)+s.charAt(i)+s.charAt(n)+s.charAt(r),ap.MAX_RESIZE_WIDTH||this.height>p.MAX_RESIZE_HEIGHT)throw new u.ImageError(u.ImageError.MAX_RESOLUTION_ERR);this.exec("Image","downsize",e.width,e.height,e.crop,e.preserveHeaders)}catch(e){this.trigger("error",e.code)}},crop:function(e,t,i){this.downsize(e,t,!0,i)},getAsCanvas:function(){if(!l.can("create_canvas"))throw new u.RuntimeError(u.RuntimeError.NOT_SUPPORTED_ERR);return this.connectRuntime(this.ruid).exec.call(this,"Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new u.DOMException(u.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsBlob",e||"image/jpeg",t||90)},getAsDataURL:function(e,t){if(!this.size)throw new u.DOMException(u.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsDataURL",e||"image/jpeg",t||90)},getAsBinaryString:function(e,t){t=this.getAsDataURL(e,t);return h.atob(t.substring(t.indexOf("base64,")+7))},embed:function(r,e){var o,s=this;e=a.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90},e||{});try{if(!(r=n.get(r)))throw new u.DOMException(u.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new u.DOMException(u.DOMException.INVALID_STATE_ERR);this.width>p.MAX_RESIZE_WIDTH||this.height;var t=new p;return t.bind("Resize",function(){!function(e,t){var i=this;if(l.can("create_canvas")){var n=i.getAsCanvas();if(n)return r.appendChild(n),n=null,i.destroy(),void s.trigger("embedded")}if(!(n=i.getAsDataURL(e,t)))throw new u.ImageError(u.ImageError.WRONG_FORMAT);l.can("use_data_uri_of",n.length)?(r.innerHTML='',i.destroy(),s.trigger("embedded")):((t=new c).bind("TransportingComplete",function(){o=s.connectRuntime(this.result.ruid),s.bind("Embedded",function(){a.extend(o.getShimContainer().style,{top:"0px",left:"0px",width:i.width+"px",height:i.height+"px"}),o=null},999),o.exec.call(s,"ImageView","display",this.result.uid,width,height),i.destroy()}),t.transport(h.atob(n.substring(n.indexOf("base64,")+7)),e,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:r}))}.call(this,e.type,e.quality)}),t.bind("Load",function(){t.downsize(e)}),this.meta.thumb&&this.meta.thumb.width>=e.width&&this.meta.thumb.height>=e.height?t.load(this.meta.thumb.data):t.clone(this,!1),t}catch(e){this.trigger("error",e.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.unbindAll()}}),this.handleEventProps(f),this.bind("Load Resize",function(){!function(e){e=e||this.exec("Image","getInfo");this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name)}.call(this)},999)}return p.MAX_RESIZE_WIDTH=8192,p.MAX_RESIZE_HEIGHT=8192,p.prototype=i.instance,p}),e("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(s,e,a,u){var c={};return a.addConstructor("html5",function(e){var t,i,n=this,r=a.capTest,o=a.capTrue,o=s.extend({access_binary:r(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return n.can("access_binary")&&!!c.Image},display_media:r(u.can("create_canvas")||u.can("use_data_uri_over32kb")),do_cors:r(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:r(("draggable"in(t=document.createElement("div"))||"ondragstart"in t&&"ondrop"in t)&&("IE"!==u.browser||u.verComp(u.version,9,">"))),filter_by_extension:r("Chrome"===u.browser&&u.verComp(u.version,28,">=")||"IE"===u.browser&&u.verComp(u.version,10,">=")||"Safari"===u.browser&&u.verComp(u.version,7,">=")),return_response_headers:o,return_response_type:function(e){return!("json"!==e||!window.JSON)||u.can("return_response_type",e)},return_status_code:o,report_upload_progress:r(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return n.can("access_binary")&&u.can("create_canvas")},select_file:function(){return u.can("use_fileinput")&&window.File},select_folder:function(){return n.can("select_file")&&"Chrome"===u.browser&&u.verComp(u.version,21,">=")},select_multiple:function(){return n.can("select_file")&&!("Safari"===u.browser&&"Windows"===u.os)&&!("iOS"===u.os&&u.verComp(u.osVersion,"7.0.0",">")&&u.verComp(u.osVersion,"8.0.0","<"))},send_binary_string:r(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:r(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||n.can("send_binary_string")},slice_blob:r(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return n.can("slice_blob")&&n.can("send_multipart")},summon_file_dialog:function(){return n.can("select_file")&&("Firefox"===u.browser&&u.verComp(u.version,4,">=")||"Opera"===u.browser&&u.verComp(u.version,12,">=")||"IE"===u.browser&&u.verComp(u.version,10,">=")||!!~s.inArray(u.browser,["Chrome","Safari"]))},upload_filesize:o},arguments[2]);a.call(this,e,arguments[1]||"html5",o),s.extend(this,{init:function(){this.trigger("Init")},destroy:(i=this.destroy,function(){i.call(n),i=n=null})}),s.extend(this.getShim(),c)}),c}),e("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(o){var s={},a="moxie_"+o.guid();function u(){this.returnValue=!1}function c(){this.cancelBubble=!0}function r(t,e,i){if(e=e.toLowerCase(),t[a]&&s[t[a]]&&s[t[a]][e]){for(var n,r=(n=s[t[a]][e]).length-1;0<=r&&(n[r].orig!==i&&n[r].key!==i||(t.removeEventListener?t.removeEventListener(e,n[r].func,!1):t.detachEvent&&t.detachEvent("on"+e,n[r].func),n[r].orig=null,n[r].func=null,n.splice(r,1),void 0===i));r--);if(n.length||delete s[t[a]][e],o.isEmptyObj(s[t[a]])){delete s[t[a]];try{delete t[a]}catch(e){t[a]=void 0}}}}return{addEvent:function(e,t,i,n){var r;t=t.toLowerCase(),e.addEventListener?e.addEventListener(t,r=i,!1):e.attachEvent&&e.attachEvent("on"+t,r=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=u,e.stopPropagation=c,i(e)}),e[a]||(e[a]=o.guid()),s.hasOwnProperty(e[a])||(s[e[a]]={}),(e=s[e[a]]).hasOwnProperty(t)||(e[t]=[]),e[t].push({func:r,orig:i,key:n})},removeEvent:r,removeAllEvents:function(i,n){i&&i[a]&&o.each(s[i[a]],function(e,t){r(i,t,n)})}}}),e("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,a,u,c,l,d,m){return e.FileInput=function(){var s;u.extend(this,{init:function(e){var t,i,n=this,r=n.getRuntime(),o=(s=e).accept.mimes||d.extList2mimes(s.accept,r.can("filter_by_extension"));(i=r.getShimContainer()).innerHTML='",t=c.get(r.uid),u.extend(t.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),e=c.get(s.browse_button),r.can("summon_file_dialog")&&("static"===c.getStyle(e,"position")&&(e.style.position="relative"),o=parseInt(c.getStyle(e,"z-index"),10)||1,e.style.zIndex=o,i.style.zIndex=o-1,l.addEvent(e,"click",function(e){var t=c.get(r.uid);t&&!t.disabled&&t.click(),e.preventDefault()},n.uid)),e=r.can("summon_file_dialog")?e:i,l.addEvent(e,"mouseover",function(){n.trigger("mouseenter")},n.uid),l.addEvent(e,"mouseout",function(){n.trigger("mouseleave")},n.uid),l.addEvent(e,"mousedown",function(){n.trigger("mousedown")},n.uid),l.addEvent(c.get(s.container),"mouseup",function(){n.trigger("mouseup")},n.uid),t.onchange=function e(t){var i;n.files=[],u.each(this.files,function(e){var t="";if(s.directory&&"."==e.name)return!0;e.webkitRelativePath&&(t="/"+e.webkitRelativePath.replace(/^\//,"")),(e=new a(r.uid,e)).relativePath=t,n.files.push(e)}),"IE"!==m.browser&&"IEMobile"!==m.browser?this.value="":(i=this.cloneNode(!0),this.parentNode.replaceChild(i,this),i.onchange=e),n.files.length&&n.trigger("change")},n.trigger({type:"ready",async:!0}),i=null},disable:function(e){var t=this.getRuntime();(t=c.get(t.uid))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),e=e.getShimContainer();l.removeAllEvents(e,this.uid),l.removeAllEvents(s&&c.get(s.container),this.uid),l.removeAllEvents(s&&c.get(s.browse_button),this.uid),e&&(e.innerHTML=""),t.removeInstance(this.uid),s=e=t=null}})}}),e("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(e,t){return e.Blob=function(){this.slice=function(){return new t(this.getRuntime().uid,function(t,i,n){var e;if(!window.File.prototype.slice)return(e=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?e.call(t,i,n):null;try{return t.slice(),t.slice(i,n)}catch(e){return t.slice(i,n-i)}}.apply(this,arguments))}}}),e("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(e,r,c,l,d,m){return e.FileDrop=function(){var t,i,o=[],n=[];function s(e){if(e.dataTransfer&&e.dataTransfer.types){e=c.toArray(e.dataTransfer.types||[]);return-1!==c.inArray("Files",e)||-1!==c.inArray("public.file-url",e)||-1!==c.inArray("application/x-moz-file",e)}}function a(e,t){!function(e){if(!n.length)return!0;e=m.getFileExtension(e.name);return!e||-1!==c.inArray(e,n)}(e)||((e=new r(i,e)).relativePath=t||"",o.push(e))}function u(e,t){var i=[];c.each(e,function(n){i.push(function(e){var t,i;i=e,(t=n).isFile?t.file(function(e){a(e,t.fullPath),i()},function(){i()}):t.isDirectory?function(e,t){var n=[],r=e.createReader();!function t(i){r.readEntries(function(e){e.length?([].push.apply(n,e),t(i)):i()},i)}(function(){u(n,t)})}(t,i):i()})}),c.inSeries(i,function(){t()})}c.extend(this,{init:function(e){var r=this;t=e,i=r.ruid,n=function(e){for(var t=[],i=0;i=")&&p.verComp(p.version,7,"<"),o="Android Browser"===p.browser,s=!1;if(u=e.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),(a=!window.XMLHttpRequest||"IE"===p.browser&&p.verComp(p.version,8,"<")?function(){for(var e=["Msxml2.XMLHTTP.6.0","Microsoft.XMLHTTP"],t=0;tthis.length())throw new Error("You are trying to read outside the source boundaries.");for(n=this.littleEndian?0:-8*(t-1),i=r=0;rthis.length())throw new Error("You are trying to write outside the source boundaries.");for(n=this.littleEndian?0:-8*(i-1),r=0;r>Math.abs(n+8*r)&255)},BYTE:function(e){return this.read(e,1)},SHORT:function(e){return this.read(e,2)},LONG:function(e){return this.read(e,4)},SLONG:function(e){e=this.read(e,4);return 2147483647=o.length));i++);},purge:function(){this.headers=s=[]}}}}),e("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(g,o,x){function s(e){var t,l,f,p,i;if(o.call(this,e),l={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}},f={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},n=(p={tiffHeader:10}).tiffHeader,t={clear:this.clear},g.extend(this,{read:function(){try{return s.prototype.read.apply(this,arguments)}catch(e){throw new x.ImageError(x.ImageError.INVALID_META_ERR)}},write:function(){try{return s.prototype.write.apply(this,arguments)}catch(e){throw new x.ImageError(x.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(e){return this.LONG(e)/this.LONG(e+4)},SRATIONAL:function(e){return this.SLONG(e)/this.SLONG(e+4)},ASCII:function(e){return this.CHAR(e)},TIFF:function(){return i||null},EXIF:function(){var e=null;if(p.exifIFD){try{e=r.call(this,p.exifIFD,l.exif)}catch(e){return null}if(e.ExifVersion&&"array"===g.typeOf(e.ExifVersion)){for(var t=0,i="";t=this.length())throw new x.ImageError(x.ImageError.INVALID_META_ERR);"ASCII"!==s?(a=u.asArray(s,o,n),s=1==n?a[0]:a,f.hasOwnProperty(i)&&"object"!=typeof s?c[i]=f[i][s]:c[i]=s):c[i]=g.trim(u.STRING(o,n).replace(/\0$/,""))}return c}n&&(p.IFD1=p.tiffHeader+n)}return s.prototype=o.prototype,s}),e("moxie/runtime/html5/image/JPEG",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/html5/image/JPEGHeaders","moxie/runtime/html5/utils/BinaryReader","moxie/runtime/html5/image/ExifParser"],function(s,a,u,c,l){return function(e){var i,n,t,r=new c(e);if(65496!==r.SHORT(0))throw new a.ImageError(a.ImageError.WRONG_FORMAT);i=new u(e);try{n=new l(i.get("app1")[0])}catch(e){}function o(e){var t,i=0;for(e=e||r;i<=e.length();){if(65472<=(t=e.SHORT(i+=2))&&t<=65475)return i+=5,{height:e.SHORT(i),width:e.SHORT(i+=2)};t=e.SHORT(i+=2),i+=t-2}return null}t=o.call(this),s.extend(this,{type:"image/jpeg",size:r.length(),width:t&&t.width||0,height:t&&t.height||0,setExif:function(e,t){if(!n)return!1;"object"===s.typeOf(e)?s.each(e,function(e,t){n.setExif(t,e)}):n.setExif(e,t),i.set("app1",n.SEGMENT())},writeHeaders:function(){return arguments.length?i.restore(arguments[0]):i.restore(e)},stripHeaders:function(e){return i.strip(e)},purge:function(){!function(){n&&i&&r&&(n.clear(),i.purge(),r.clear(),t=i=n=r=null)}.call(this)}}),n&&(this.meta={tiff:n.TIFF(),exif:n.EXIF(),gps:n.GPS(),thumb:function(){var e,t,i=n.thumb();if(i&&(e=new c(i),t=o(e),e.clear(),t))return t.data=i,t;return null}()})}}),e("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(n,o,s){return function(e){var r,t;function i(){r&&(r.clear(),e=t=r=null)}r=new s(e),function(){for(var e=0,t=0,i=[35152,20039,3338,6666],t=0;t>1;i=null;t=a/t;return 0==t?1:t}(e,r),f=0;f=")||"IE"===a.browser&&a.verComp(a.version,10,">=")||"Safari"===a.browser&&a.verComp(a.version,7,">=")),resize_image:function(){return u.Image&&i.can("access_binary")&&a.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(e){return!("json"!==e||!window.JSON)||!!~o.inArray(e,["text","document",""])},return_status_code:function(e){return!o.arrayDiff(e,[200,404])},select_file:function(){return a.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return i.can("select_file")},summon_file_dialog:function(){return i.can("select_file")&&("Firefox"===a.browser&&a.verComp(a.version,4,">=")||"Opera"===a.browser&&a.verComp(a.version,12,">=")||"IE"===a.browser&&a.verComp(a.version,10,">=")||!!~o.inArray(a.browser,["Chrome","Safari"]))},upload_filesize:r,use_http_method:function(e){return!o.arrayDiff(e,["GET","POST"])}}),o.extend(this,{init:function(){this.trigger("Init")},destroy:(t=this.destroy,function(){t.call(i),t=i=null})}),o.extend(this.getShim(),u)}),u}),e("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,m,h,f,p,s,g){return e.FileInput=function(){var u,c,l=[];function d(){var e,t,i,n,r=this,o=r.getRuntime(),s=h.guid("uid_"),a=o.getShimContainer();u&&(t=f.get(u+"_form"))&&h.extend(t.style,{top:"100%"}),(i=document.createElement("form")).setAttribute("id",s+"_form"),i.setAttribute("method","post"),i.setAttribute("enctype","multipart/form-data"),i.setAttribute("encoding","multipart/form-data"),h.extend(i.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),(n=document.createElement("input")).setAttribute("id",s),n.setAttribute("type","file"),n.setAttribute("name",c.name||"Filedata"),n.setAttribute("accept",l.join(",")),h.extend(n.style,{fontSize:"999px",opacity:0}),i.appendChild(n),a.appendChild(i),h.extend(n.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===g.browser&&g.verComp(g.version,10,"<")&&h.extend(n.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),n.onchange=function(){var e;if(this.value){if(this.files){if(0===(e=this.files[0]).size)return void i.parentNode.removeChild(i)}else e={name:this.value};e=new m(o.uid,e),this.onchange=function(){},d.call(r),r.files=[e],n.setAttribute("id",e.uid),i.setAttribute("id",e.uid+"_form"),r.trigger("change"),n=i=null}},o.can("summon_file_dialog")&&(e=f.get(c.browse_button),p.removeEvent(e,"click",r.uid),p.addEvent(e,"click",function(e){n&&!n.disabled&&n.click(),e.preventDefault()},r.uid)),u=s,a=t=e=null}h.extend(this,{init:function(e){var t,i,n,r=this,o=r.getRuntime();l=(c=e).accept.mimes||s.extList2mimes(e.accept,o.can("filter_by_extension")),t=o.getShimContainer(),n=f.get(e.browse_button),o.can("summon_file_dialog")&&("static"===f.getStyle(n,"position")&&(n.style.position="relative"),i=parseInt(f.getStyle(n,"z-index"),10)||1,n.style.zIndex=i,t.style.zIndex=i-1),i=o.can("summon_file_dialog")?n:t,p.addEvent(i,"mouseover",function(){r.trigger("mouseenter")},r.uid),p.addEvent(i,"mouseout",function(){r.trigger("mouseleave")},r.uid),p.addEvent(i,"mousedown",function(){r.trigger("mousedown")},r.uid),p.addEvent(f.get(e.container),"mouseup",function(){r.trigger("mouseup")},r.uid),n=null,d.call(this),r.trigger({type:"ready",async:!(t=null)})},disable:function(e){var t;(t=f.get(u))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),e=e.getShimContainer();p.removeAllEvents(e,this.uid),p.removeAllEvents(c&&f.get(c.container),this.uid),p.removeAllEvents(c&&f.get(c.browse_button),this.uid),e&&(e.innerHTML=""),t.removeInstance(this.uid),u=l=c=e=t=null}})}}),e("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(e,t){return e.FileReader=t}),e("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(e,f,p,g,x,E,y,w){return e.XMLHttpRequest=function(){var l,d,m;function h(t){var e,i,n,r=this,o=!1;if(m){if(e=m.id.replace(/_iframe$/,""),e=p.get(e+"_form")){for(n=(i=e.getElementsByTagName("input")).length;n--;)switch(i[n].getAttribute("type")){case"hidden":i[n].parentNode.removeChild(i[n]);break;case"file":o=!0}i=[],o||e.parentNode.removeChild(e),e=null}setTimeout(function(){E.removeEvent(m,"load",r.uid),m.parentNode&&m.parentNode.removeChild(m);var e=r.getRuntime().getShimContainer();e.children.length||e.parentNode.removeChild(e),e=m=null,t()},1)}}f.extend(this,{send:function(t,e){var i,n,r,o,s,a,u=this,c=u.getRuntime();if(l=d=null,e instanceof w&&e.hasBlob()){if(o=e.getBlob(),i=o.uid,r=p.get(i),!(n=p.get(i+"_form")))throw new x.DOMException(x.DOMException.NOT_FOUND_ERR)}else i=f.guid("uid_"),(n=document.createElement("form")).setAttribute("id",i+"_form"),n.setAttribute("method",t.method),n.setAttribute("enctype","multipart/form-data"),n.setAttribute("encoding","multipart/form-data"),c.getShimContainer().appendChild(n);n.setAttribute("target",i+"_iframe"),e instanceof w&&e.each(function(e,t){var i;e instanceof y?r&&r.setAttribute("name",t):(i=document.createElement("input"),f.extend(i,{type:"hidden",name:t,value:e}),r?n.insertBefore(i,r):n.appendChild(i))}),n.setAttribute("action",t.url),s=c.getShimContainer()||document.body,(a=document.createElement("div")).innerHTML='',m=a.firstChild,s.appendChild(m),E.addEvent(m,"load",function(){var e;try{e=m.contentWindow.document||m.contentDocument||window.frames[m.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(e.title)?l=e.title.replace(/^(\d+).*$/,"$1"):(l=200,d=f.trim(e.body.innerHTML),u.trigger({type:"progress",loaded:d.length,total:d.length}),o&&u.trigger({type:"uploadprogress",loaded:o.size||1025,total:o.size||1025}))}catch(e){if(!g.hasSameOrigin(t.url))return void h.call(u,function(){u.trigger("error")});l=404}h.call(u,function(){u.trigger("load")})},u.uid),n.submit(),u.trigger("loadstart")},getStatus:function(){return l},getResponse:function(e){if("json"===e&&"string"===f.typeOf(d)&&window.JSON)try{return JSON.parse(d.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(e){return null}return d},abort:function(){var e=this;m&&m.contentWindow&&(m.contentWindow.stop?m.contentWindow.stop():m.contentWindow.document.execCommand?m.contentWindow.document.execCommand("Stop"):m.src="about:blank"),h.call(this,function(){e.dispatchEvent("abort")})}})}}),e("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(e,t){return e.Image=t}),function(e){for(var t=0;t https://studyhubonline.com/wp-includes/js/plupload/plupload.min.js?ver=2.1.9 !function(e,I,S){var T=e.setTimeout,D={};function w(e){var t=e.required_features,r={};function i(e,t,i){var n={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};n[e]?r[n[e]]=t:i||(r[e]=t)}return"string"==typeof t?F.each(t.split(/\s*,\s*/),function(e){i(e,!0)}):"object"==typeof t?F.each(t,function(e,t){i(t,e)}):!0===t&&(0":"gt","&":"amp",'"':"quot","'":"#39"};return e&&(""+e).replace(/[<>&\"\']/g,function(e){return t[e]?"&"+t[e]+";":e})},toArray:I.toArray,inArray:I.inArray,addI18n:I.addI18n,translate:I.translate,isEmptyObj:I.isEmptyObj,hasClass:I.hasClass,addClass:I.addClass,removeClass:I.removeClass,getStyle:I.getStyle,addEvent:I.addEvent,removeEvent:I.removeEvent,removeAllEvents:I.removeAllEvents,cleanName:function(e){for(var t=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"],i=0;i(i/=1024)?t(e/i,1)+" "+F.translate("gb"):e>(i/=1024)?t(e/i,1)+" "+F.translate("mb"):1024e?(this.trigger("Error",{code:F.FILE_SIZE_ERROR,message:F.translate("File size error."),file:t}),i(!1)):i(!0)}),F.addFileFilter("prevent_duplicates",function(e,t,i){if(e)for(var n=this.files.length;n--;)if(t.name===this.files[n].name&&t.size===this.files[n].size)return this.trigger("Error",{code:F.FILE_DUPLICATE_ERROR,message:F.translate("Duplicate file error."),file:t}),void i(!1);i(!0)}),F.Uploader=function(e){var u,i,n,p,t=F.guid(),l=[],h={},o=[],d=[],c=!1;function r(){var e,t,i=0;if(this.state==F.STARTED){for(t=0;tu?(t=Math.min(u,a.size-c),a.slice(c,c+t)):(t=a.size,a),u&&d.chunks&&(r.settings.send_chunk_number?(n.chunk=Math.ceil(c/u),n.chunks=Math.ceil(a.size/u)):(n.offset=c,n.total=a.size)),(p=new I.XMLHttpRequest).upload&&(p.upload.onprogress=function(e){s.loaded=Math.min(s.size,c+e.loaded),r.trigger("UploadProgress",s)}),p.onload=function(){400<=p.status?f():(l=r.settings.max_retries,t=a.size?(s.size!=s.origSize&&(a.destroy(),a=null),r.trigger("UploadProgress",s),s.status=F.DONE,r.trigger("FileUploaded",s,{response:p.responseText,status:p.status,responseHeaders:p.getAllResponseHeaders()})):T(g,1))},p.onerror=function(){f()},p.onloadend=function(){this.destroy(),p=null},r.settings.multipart&&d.multipart?(p.open("post",o,!0),F.each(r.settings.headers,function(e,t){p.setRequestHeader(t,e)}),i=new I.FormData,F.each(F.extend(n,r.settings.multipart_params),function(e,t){i.append(t,e)}),i.append(r.settings.file_data_name,e),p.send(i,{runtime_order:r.settings.runtimes,required_caps:r.settings.required_features,preferred_caps:h})):(o=F.buildUrl(r.settings.url,F.extend(n,r.settings.multipart_params)),p.open("post",o,!0),p.setRequestHeader("Content-Type","application/octet-stream"),F.each(r.settings.headers,function(e,t){p.setRequestHeader(t,e)}),p.send(e,{runtime_order:r.settings.runtimes,required_caps:r.settings.required_features,preferred_caps:h})))}s.loaded&&(c=s.loaded=u?u*Math.floor(s.loaded/u):0),a=s.getSource(),r.settings.resize.enabled&&function(e,t){if(e.ruid){e=I.Runtime.getInfo(e.ruid);if(e)return e.can(t)}}(a,"send_binary_string")&&~I.inArray(a.type,["image/jpeg","image/png"])?function(t,e,i){var n=new I.Image;try{n.onload=function(){if(e.width>this.width&&e.height>this.height&&e.quality===S&&e.preserve_headers&&!e.crop)return this.destroy(),i(t);n.downsize(e.width,e.height,e.crop,e.preserve_headers)},n.onresize=function(){i(this.getAsBlob(t.type,e.quality)),this.destroy()},n.onerror=function(){i(t)},n.load(t)}catch(e){i(t)}}.call(this,a,r.settings.resize,function(e){a=e,s.size=e.size,g()}):g()}function R(e,t){s(t)}function E(e){if(e.state==F.STARTED)i=+new Date;else if(e.state==F.STOPPED)for(var t=e.files.length-1;0<=t;t--)e.files[t].status==F.UPLOADING&&(e.files[t].status=F.QUEUED,a())}function y(){p&&p.abort()}function v(e){a(),T(function(){r.call(e)},1)}function z(e,t){t.code===F.INIT_ERROR?e.destroy():t.code===F.HTTP_ERROR&&(t.file.status=F.FAILED,s(t.file),e.state==F.STARTED&&(e.trigger("CancelUpload"),T(function(){r.call(e)},1)))}function O(e){e.stop(),F.each(l,function(e){e.destroy()}),l=[],o.length&&(F.each(o,function(e){e.destroy()}),o=[]),d.length&&(F.each(d,function(e){e.destroy()}),d=[]),c=!(h={}),i=p=null,n.reset()}u={runtimes:I.Runtime.order,max_retries:0,chunk_size:0,multipart:!0,multi_selection:!0,file_data_name:"file",filters:{mime_types:[],prevent_duplicates:!1,max_file_size:0},resize:{enabled:!1,preserve_headers:!0,crop:!1},send_file_name:!0,send_chunk_number:!0},_.call(this,e,null,!0),n=new F.QueueProgress,F.extend(this,{id:t,uid:t,state:F.STOPPED,features:{},runtime:null,files:l,settings:u,total:n,init:function(){var t,i=this,e=i.getOption("preinit");return"function"==typeof e?e(i):F.each(e,function(e,t){i.bind(t,e)}),function(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",y),this.bind("BeforeUpload",m),this.bind("UploadFile",b),this.bind("UploadProgress",R),this.bind("StateChanged",E),this.bind("QueueChanged",a),this.bind("Error",z),this.bind("FileUploaded",v),this.bind("Destroy",O)}.call(i),F.each(["container","browse_button","drop_element"],function(e){if(null===i.getOption(e))return!(t={code:F.INIT_ERROR,message:F.translate("'%' specified, but cannot be found.")})}),t?i.trigger("Error",t):u.browse_button||u.drop_element?void g.call(i,u,function(e){var t=i.getOption("init");"function"==typeof t?t(i):F.each(t,function(e,t){i.bind(t,e)}),e?(i.runtime=I.Runtime.getInfo(f()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:F.INIT_ERROR,message:F.translate("Init error.")})}):i.trigger("Error",{code:F.INIT_ERROR,message:F.translate("You must specify either 'browse_button' or 'drop_element'.")})},setOption:function(e,t){_.call(this,e,t,!this.runtime)},getOption:function(e){return e?u[e]:u},refresh:function(){o.length&&F.each(o,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=F.STARTED&&(this.state=F.STARTED,this.trigger("StateChanged"),r.call(this))},stop:function(){this.state!=F.STOPPED&&(this.state=F.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){c=arguments[0]===S||arguments[0],o.length&&F.each(o,function(e){e.disable(c)}),this.trigger("DisableBrowse",c)},getFile:function(e){for(var t=l.length-1;0<=t;t--)if(l[t].id===e)return l[t]},addFile:function(e,n){var r,s=this,a=[],o=[];r=f(),function e(i){var t=I.typeOf(i);if(i instanceof I.File){if(!i.ruid&&!i.isDetached()){if(!r)return!1;i.ruid=r,i.connectRuntime(r)}e(new F.File(i))}else i instanceof I.Blob?(e(i.getSource()),i.destroy()):i instanceof F.File?(n&&(i.name=n),a.push(function(t){var n,e,r;n=i,e=function(e){e||(l.push(i),o.push(i),s.trigger("FileFiltered",i)),T(t,1)},r=[],I.each(s.settings.filters,function(e,i){D[i]&&r.push(function(t){D[i].call(s,e,n,function(e){t(!e)})})}),I.inSeries(r,e)})):-1!==I.inArray(t,["file","blob"])?e(new I.File(null,i)):"node"===t&&"filelist"===I.typeOf(i.files)?I.each(i.files,e):"array"===t&&(n=null,I.each(i,e))}(e),a.length&&I.inSeries(a,function(){o.length&&s.trigger("FilesAdded",o)})},removeFile:function(e){for(var t="string"==typeof e?e:e.id,i=l.length-1;0<=i;i--)if(l[i].id===t)return this.splice(i,1)[0]},splice:function(e,t){var t=l.splice(e===S?0:e,t===S?l.length:t),i=!1;return this.state==F.STARTED&&(F.each(t,function(e){if(e.status===F.UPLOADING)return!(i=!0)}),i&&this.stop()),this.trigger("FilesRemoved",t),F.each(t,function(e){e.destroy()}),i&&this.start(),t},dispatchEvent:function(e){var t,i;if(e=e.toLowerCase(),t=this.hasEventListener(e)){t.sort(function(e,t){return t.priority-e.priority}),(i=[].slice.call(arguments)).shift(),i.unshift(this);for(var n=0;n