From b81faca5dfd6334f2752078175eb1f5974714c83 Mon Sep 17 00:00:00 2001 From: buddh4 Date: Tue, 1 Aug 2017 22:16:37 +0200 Subject: [PATCH] Rebuild prod assets. --- protected/humhub/config/assets-prod.php | 13 +- protected/humhub/docs/CHANGELOG.md | 1 + .../humhub/modules/user/tests/php_errors.log | 3 + static/assets/1f9f21b6/js/humhub.file.js | 17 +- static/assets/202ea698/README.md | 362 +++++++++++++ static/assets/202ea698/bower.json | 36 ++ static/assets/202ea698/gulpfile.js | 128 +++++ static/assets/202ea698/imagesloaded.js | 370 +++++++++++++ static/assets/202ea698/imagesloaded.pkgd.js | 493 ++++++++++++++++++ .../assets/202ea698/imagesloaded.pkgd.min.js | 7 + static/assets/3affaa6f/js/humhub.content.js | 3 +- .../{60150af8 => 80d9ad70}/CHANGELOG.md | 0 .../{60150af8 => 80d9ad70}/CONTRIBUTING.md | 0 .../assets/{60150af8 => 80d9ad70}/LICENSE-MIT | 0 .../assets/{60150af8 => 80d9ad70}/README.md | 0 .../assets/{60150af8 => 80d9ad70}/bower.json | 2 +- .../{60150af8 => 80d9ad70}/component.json | 2 +- .../dist/css/jquery.atwho.css | 0 .../dist/css/jquery.atwho.min.css | 0 .../dist/js/jquery.atwho.js | 11 +- .../dist/js/jquery.atwho.min.js | 2 +- .../examples/cross_document/dataFrame.html | 0 .../examples/cross_document/index.html | 0 .../examples/cross_document/viewFrame.html | 0 .../examples/hashtags.html | 0 .../examples/medium-editor.html | 0 .../{60150af8 => 80d9ad70}/examples/style.css | 0 .../examples/tinyMCE.html | 0 .../examples/ueditor.html | 0 .../assets/{60150af8 => 80d9ad70}/gulpfile.js | 2 +- .../assets/{60150af8 => 80d9ad70}/index.html | 0 .../{60150af8 => 80d9ad70}/package.json | 4 +- .../{60150af8 => 80d9ad70}/specRunner.html | 0 .../{60150af8 => 80d9ad70}/src/api.coffee | 1 + .../{60150af8 => 80d9ad70}/src/app.coffee | 0 .../src/controller.coffee | 0 .../{60150af8 => 80d9ad70}/src/default.coffee | 0 .../src/editableController.coffee | 7 +- .../src/jquery.atwho.css | 0 .../{60150af8 => 80d9ad70}/src/model.coffee | 0 .../src/textareaController.coffee | 0 .../{60150af8 => 80d9ad70}/src/view.coffee | 0 .../{60150af8 => 80d9ad70}/umd.template.js | 0 .../assets/{e6a3d4d7 => d0eb0089}/LICENSE.md | 0 static/assets/{e6a3d4d7 => d0eb0089}/Makefile | 0 .../assets/{e6a3d4d7 => d0eb0089}/README.md | 6 +- .../assets/{e6a3d4d7 => d0eb0089}/bower.json | 2 +- .../{e6a3d4d7 => d0eb0089}/clipboard.js | 5 +- static/assets/d0eb0089/clipboard.min.js | 9 + .../assets/{e6a3d4d7 => d0eb0089}/index.css | 0 .../{e6a3d4d7 => d0eb0089}/package.json | 2 +- static/assets/e6a3d4d7/clipboard.min.js | 9 - ...> all-41d42708f317e2a81704a75f50ab14e5.js} | 29 +- static/js/humhub/humhub.ui.widget.js | 5 + static/js/humhub/humhub.util.js | 14 + 55 files changed, 1504 insertions(+), 41 deletions(-) create mode 100644 protected/humhub/modules/user/tests/php_errors.log create mode 100644 static/assets/202ea698/README.md create mode 100644 static/assets/202ea698/bower.json create mode 100644 static/assets/202ea698/gulpfile.js create mode 100644 static/assets/202ea698/imagesloaded.js create mode 100644 static/assets/202ea698/imagesloaded.pkgd.js create mode 100644 static/assets/202ea698/imagesloaded.pkgd.min.js rename static/assets/{60150af8 => 80d9ad70}/CHANGELOG.md (100%) rename static/assets/{60150af8 => 80d9ad70}/CONTRIBUTING.md (100%) rename static/assets/{60150af8 => 80d9ad70}/LICENSE-MIT (100%) rename static/assets/{60150af8 => 80d9ad70}/README.md (100%) rename static/assets/{60150af8 => 80d9ad70}/bower.json (95%) rename static/assets/{60150af8 => 80d9ad70}/component.json (96%) rename static/assets/{60150af8 => 80d9ad70}/dist/css/jquery.atwho.css (100%) rename static/assets/{60150af8 => 80d9ad70}/dist/css/jquery.atwho.min.css (100%) rename static/assets/{60150af8 => 80d9ad70}/dist/js/jquery.atwho.js (99%) rename static/assets/{60150af8 => 80d9ad70}/dist/js/jquery.atwho.min.js (65%) rename static/assets/{60150af8 => 80d9ad70}/examples/cross_document/dataFrame.html (100%) rename static/assets/{60150af8 => 80d9ad70}/examples/cross_document/index.html (100%) rename static/assets/{60150af8 => 80d9ad70}/examples/cross_document/viewFrame.html (100%) rename static/assets/{60150af8 => 80d9ad70}/examples/hashtags.html (100%) rename static/assets/{60150af8 => 80d9ad70}/examples/medium-editor.html (100%) rename static/assets/{60150af8 => 80d9ad70}/examples/style.css (100%) rename static/assets/{60150af8 => 80d9ad70}/examples/tinyMCE.html (100%) rename static/assets/{60150af8 => 80d9ad70}/examples/ueditor.html (100%) rename static/assets/{60150af8 => 80d9ad70}/gulpfile.js (98%) rename static/assets/{60150af8 => 80d9ad70}/index.html (100%) rename static/assets/{60150af8 => 80d9ad70}/package.json (95%) rename static/assets/{60150af8 => 80d9ad70}/specRunner.html (100%) rename static/assets/{60150af8 => 80d9ad70}/src/api.coffee (98%) rename static/assets/{60150af8 => 80d9ad70}/src/app.coffee (100%) rename static/assets/{60150af8 => 80d9ad70}/src/controller.coffee (100%) rename static/assets/{60150af8 => 80d9ad70}/src/default.coffee (100%) rename static/assets/{60150af8 => 80d9ad70}/src/editableController.coffee (94%) rename static/assets/{60150af8 => 80d9ad70}/src/jquery.atwho.css (100%) rename static/assets/{60150af8 => 80d9ad70}/src/model.coffee (100%) rename static/assets/{60150af8 => 80d9ad70}/src/textareaController.coffee (100%) rename static/assets/{60150af8 => 80d9ad70}/src/view.coffee (100%) rename static/assets/{60150af8 => 80d9ad70}/umd.template.js (100%) rename static/assets/{e6a3d4d7 => d0eb0089}/LICENSE.md (100%) rename static/assets/{e6a3d4d7 => d0eb0089}/Makefile (100%) rename static/assets/{e6a3d4d7 => d0eb0089}/README.md (93%) rename static/assets/{e6a3d4d7 => d0eb0089}/bower.json (95%) rename static/assets/{e6a3d4d7 => d0eb0089}/clipboard.js (97%) create mode 100644 static/assets/d0eb0089/clipboard.min.js rename static/assets/{e6a3d4d7 => d0eb0089}/index.css (100%) rename static/assets/{e6a3d4d7 => d0eb0089}/package.json (96%) delete mode 100644 static/assets/e6a3d4d7/clipboard.min.js rename static/js/{all-eccc32c92bade6b693dae47a4a655e11.js => all-41d42708f317e2a81704a75f50ab14e5.js} (83%) diff --git a/protected/humhub/config/assets-prod.php b/protected/humhub/config/assets-prod.php index 7ae4ef5e3f..db5a2808a6 100644 --- a/protected/humhub/config/assets-prod.php +++ b/protected/humhub/config/assets-prod.php @@ -2,7 +2,7 @@ /** * This file is generated by the "yii asset" command. * DO NOT MODIFY THIS FILE DIRECTLY. - * @version 2017-06-16 20:09:02 + * @version 2017-08-01 22:12:58 */ return [ 'all' => [ @@ -10,7 +10,7 @@ return [ 'basePath' => '@webroot-static', 'baseUrl' => '@web-static', 'js' => [ - 'js/all-eccc32c92bade6b693dae47a4a655e11.js', + 'js/all-41d42708f317e2a81704a75f50ab14e5.js', ], 'css' => [ 'css/all-59bdfa4c0b50304180be32b3f5b0d157.css', @@ -352,6 +352,14 @@ return [ 'all', ], ], + 'humhub\\assets\\ImagesLoadedAsset' => [ + 'sourcePath' => null, + 'js' => [], + 'css' => [], + 'depends' => [ + 'all', + ], + ], 'humhub\\assets\\AppAsset' => [ 'sourcePath' => null, 'js' => [], @@ -388,6 +396,7 @@ return [ 'humhub\\assets\\IEFixesAsset', 'humhub\\assets\\PagedownConverterAsset', 'humhub\\assets\\ClipboardJsAsset', + 'humhub\\assets\\ImagesLoadedAsset', 'all', ], ], diff --git a/protected/humhub/docs/CHANGELOG.md b/protected/humhub/docs/CHANGELOG.md index a6ba463259..490b193baf 100644 --- a/protected/humhub/docs/CHANGELOG.md +++ b/protected/humhub/docs/CHANGELOG.md @@ -54,6 +54,7 @@ HumHub Change Log - Chg: Added `phpoffice/phpexcel` dependency - Enh: Added `JsWidget::fadeIn` for smooth widget initialization - Enh: Enhanced `AccessControl` filter with `ControllerAccess` layer for better testability and flexibility +- Enh: Added `Pending Registrations` admin view with `csv`, `xlsx` support. 1.2.1 (June 17, 2017) - Fix: Invite error in french language diff --git a/protected/humhub/modules/user/tests/php_errors.log b/protected/humhub/modules/user/tests/php_errors.log new file mode 100644 index 0000000000..9f92b13458 --- /dev/null +++ b/protected/humhub/modules/user/tests/php_errors.log @@ -0,0 +1,3 @@ +[29-Jul-2017 17:45:13 UTC] PHP Fatal error: Cannot declare class FunctionalTester, because the name is already in use in E:\codebase\humhub\master\protected\humhub\tests\codeception\_support\FunctionalTester.php on line 20 +[29-Jul-2017 17:45:34 UTC] PHP Fatal error: Cannot declare class FunctionalTester, because the name is already in use in E:\codebase\humhub\master\protected\humhub\tests\codeception\_support\FunctionalTester.php on line 20 +[29-Jul-2017 17:46:12 UTC] PHP Fatal error: Cannot redeclare user\functional\UserAccessCest::testSeeAdminInformation() in E:\codebase\humhub\master\protected\humhub\modules\user\tests\codeception\functional\UserAccessCest.php on line 32 diff --git a/static/assets/1f9f21b6/js/humhub.file.js b/static/assets/1f9f21b6/js/humhub.file.js index 54a3e6425b..6376fefac8 100644 --- a/static/assets/1f9f21b6/js/humhub.file.js +++ b/static/assets/1f9f21b6/js/humhub.file.js @@ -12,6 +12,7 @@ humhub.module('file', function (module, require, $) { var string = util.string; var action = require('action'); var event = require('event'); + var view = require('ui.view'); @@ -51,6 +52,11 @@ humhub.module('file', function (module, require, $) { objectModel: this.$.data('upload-model'), objectId: this.$.data('upload-model-id') }; + + if(this.$.data('upload-hide-in-stream')) { + data['hideInStream'] = 1; + } + return { url: this.$.data('url') || this.$.data('upload-url') || module.config.upload.url, dropZone: this.getDropZone(), @@ -60,7 +66,9 @@ humhub.module('file', function (module, require, $) { singleFileUploads: false, add: function (e, data) { if (that.options.maxNumberOfFiles && (that.getFileCount() + data.files.length > that.options.maxNumberOfFiles)) { - that.handleMaxFileReached(); + that.handleMaxFileReached(that.options.maxNumberOfFilesMessage); + } else if(that.options.phpMaxFileUploads && data.files.length > that.options.phpMaxFileUploads) { + that.handleMaxFileReached(that.options.phpMaxFileUploadsMessage); } else { data.process().done(function () { data.submit(); @@ -71,8 +79,8 @@ humhub.module('file', function (module, require, $) { }; }; - Upload.prototype.handleMaxFileReached = function () { - module.log.warn(this.$.data('max-number-of-files-message'), true); + Upload.prototype.handleMaxFileReached = function (message) { + module.log.warn(message, true); this.$ = $(this.getIdSelector()); if (!this.canUploadMore()) { this.disable(this.$.data('max-number-of-files-message')); @@ -225,7 +233,8 @@ humhub.module('file', function (module, require, $) { this.callbacks.done(e, response); } - this.fire('humhub:file:uploadEnd', [response]); + //deprecated event use uploadEnd + this.fire('humhub:file:uploadEnd', [response]);; this.fire('uploadEnd', [response]); }; diff --git a/static/assets/202ea698/README.md b/static/assets/202ea698/README.md new file mode 100644 index 0000000000..67b799dfd2 --- /dev/null +++ b/static/assets/202ea698/README.md @@ -0,0 +1,362 @@ +# imagesLoaded + +

JavaScript is all like "You images done yet or what?"

+ +[imagesloaded.desandro.com](http://imagesloaded.desandro.com) + +Detect when images have been loaded. + +## Install + +### Download + ++ [imagesloaded.pkgd.min.js](https://unpkg.com/imagesloaded@4/imagesloaded.pkgd.min.js) minified ++ [imagesloaded.pkgd.js](https://unpkg.com/imagesloaded@4/imagesloaded.pkgd.js) un-minified + +### CDN + +``` html + + + +``` + +### Package managers + +Install via [npm](https://www.npmjs.com/package/imagesloaded): `npm install imagesloaded` + +Install via [Bower](http://bower.io): `bower install imagesloaded --save` + +## jQuery + +You can use imagesLoaded as a jQuery Plugin. + +``` js +$('#container').imagesLoaded( function() { + // images have loaded +}); + +// options +$('#container').imagesLoaded( { + // options... + }, + function() { + // images have loaded + } +); +``` + +`.imagesLoaded()` returns a [jQuery Deferred object](http://api.jquery.com/category/deferred-object/). This allows you to use `.always()`, `.done()`, `.fail()` and `.progress()`. + +``` js +$('#container').imagesLoaded() + .always( function( instance ) { + console.log('all images loaded'); + }) + .done( function( instance ) { + console.log('all images successfully loaded'); + }) + .fail( function() { + console.log('all images loaded, at least one is broken'); + }) + .progress( function( instance, image ) { + var result = image.isLoaded ? 'loaded' : 'broken'; + console.log( 'image is ' + result + ' for ' + image.img.src ); + }); +``` + +## Vanilla JavaScript + +You can use imagesLoaded with vanilla JS. + +``` js +imagesLoaded( elem, callback ) +// options +imagesLoaded( elem, options, callback ) +// you can use `new` if you like +new imagesLoaded( elem, callback ) +``` + ++ `elem` _Element, NodeList, Array, or Selector String_ ++ `options` _Object_ ++ `callback` _Function_ - function triggered after all images have been loaded + +Using a callback function is the same as binding it to the `always` event (see below). + +``` js +// element +imagesLoaded( document.querySelector('#container'), function( instance ) { + console.log('all images are loaded'); +}); +// selector string +imagesLoaded( '#container', function() {...}); +// multiple elements +var posts = document.querySelectorAll('.post'); +imagesLoaded( posts, function() {...}); +``` + +Bind events with vanilla JS with .on(), .off(), and .once() methods. + +``` js +var imgLoad = imagesLoaded( elem ); +function onAlways( instance ) { + console.log('all images are loaded'); +} +// bind with .on() +imgLoad.on( 'always', onAlways ); +// unbind with .off() +imgLoad.off( 'always', onAlways ); +``` + +## Background + +Detect when background images have loaded, in addition to ``s. + +Set `{ background: true }` to detect when the element's background image has loaded. + +``` js +// jQuery +$('#container').imagesLoaded( { background: true }, function() { + console.log('#container background image loaded'); +}); + +// vanilla JS +imagesLoaded( '#container', { background: true }, function() { + console.log('#container background image loaded'); +}); +``` + +[See jQuery demo](http://codepen.io/desandro/pen/pjVMPB) or [vanilla JS demo](http://codepen.io/desandro/pen/avKooW) on CodePen. + +Set to a selector string like `{ background: '.item' }` to detect when the background images of child elements have loaded. + +``` js +// jQuery +$('#container').imagesLoaded( { background: '.item' }, function() { + console.log('all .item background images loaded'); +}); + +// vanilla JS +imagesLoaded( '#container', { background: '.item' }, function() { + console.log('all .item background images loaded'); +}); +``` + +[See jQuery demo](http://codepen.io/desandro/pen/avKoZL) or [vanilla JS demo](http://codepen.io/desandro/pen/vNrBGz) on CodePen. + +## Events + +### always + +``` js +// jQuery +$('#container').imagesLoaded().always( function( instance ) { + console.log('ALWAYS - all images have been loaded'); +}); + +// vanilla JS +imgLoad.on( 'always', function( instance ) { + console.log('ALWAYS - all images have been loaded'); +}); +``` + +Triggered after all images have been either loaded or confirmed broken. + ++ `instance` _imagesLoaded_ - the imagesLoaded instance + +### done + +``` js +// jQuery +$('#container').imagesLoaded().done( function( instance ) { + console.log('DONE - all images have been successfully loaded'); +}); + +// vanilla JS +imgLoad.on( 'done', function( instance ) { + console.log('DONE - all images have been successfully loaded'); +}); +``` + +Triggered after all images have successfully loaded without any broken images. + +### fail + +``` js +$('#container').imagesLoaded().fail( function( instance ) { + console.log('FAIL - all images loaded, at least one is broken'); +}); + +// vanilla JS +imgLoad.on( 'fail', function( instance ) { + console.log('FAIL - all images loaded, at least one is broken'); +}); +``` + +Triggered after all images have been loaded with at least one broken image. + +### progress + +``` js +imgLoad.on( 'progress', function( instance, image ) { + var result = image.isLoaded ? 'loaded' : 'broken'; + console.log( 'image is ' + result + ' for ' + image.img.src ); +}); +``` + +Triggered after each image has been loaded. + ++ `instance` _imagesLoaded_ - the imagesLoaded instance ++ `image` _LoadingImage_ - the LoadingImage instance of the loaded image + + + +## Properties + +### LoadingImage.img + +_Image_ - The `img` element + +### LoadingImage.isLoaded + +_Boolean_ - `true` when the image has successfully loaded + +### imagesLoaded.images + +Array of _LoadingImage_ instances for each image detected + +``` js +var imgLoad = imagesLoaded('#container'); +imgLoad.on( 'always', function() { + console.log( imgLoad.images.length + ' images loaded' ); + // detect which image is broken + for ( var i = 0, len = imgLoad.images.length; i < len; i++ ) { + var image = imgLoad.images[i]; + var result = image.isLoaded ? 'loaded' : 'broken'; + console.log( 'image is ' + result + ' for ' + image.img.src ); + } +}); +``` + +## Browserify + +imagesLoaded works with [Browserify](http://browserify.org/). + +``` bash +npm install imagesloaded --save +``` + +``` js +var imagesLoaded = require('imagesloaded'); + +imagesLoaded( elem, function() {...} ); +``` + +Use `.makeJQueryPlugin` to make to use `.imagesLoaded()` jQuery plugin. + +``` js +var $ = require('jquery'); +var imagesLoaded = require('imagesloaded'); + +// provide jQuery argument +imagesLoaded.makeJQueryPlugin( $ ); +// now use .imagesLoaded() jQuery plugin +$('#container').imagesLoaded( function() {...}); +``` + +## Webpack + +Install imagesLoaded with npm. + +``` bash +npm install imagesloaded +``` + +You can then `require('imagesloaded')`. + +``` js +// main.js +var imagesLoaded = require('imagesloaded'); + +imagesLoaded( '#container', function() { + // images have loaded +}); +``` + +Use `.makeJQueryPlugin` to make `.imagesLoaded()` jQuery plugin. + +``` js +// main.js +var imagesLoaded = require('imagesloaded'); +var $ = require('jquery'); + +// provide jQuery argument +imagesLoaded.makeJQueryPlugin( $ ); +// now use .imagesLoaded() jQuery plugin +$('#container').imagesLoaded( function() {...}); +``` + +Run webpack. + +``` bash +webpack main.js bundle.js +``` + +## RequireJS + +imagesLoaded works with [RequireJS](http://requirejs.org). + +You can require [imagesloaded.pkgd.js](http://imagesloaded.desandro.com/imagesloaded.pkgd.js). + +``` js +requirejs( [ + 'path/to/imagesloaded.pkgd.js', +], function( imagesLoaded ) { + imagesLoaded( '#container', function() { ... }); +}); +``` + +Use `.makeJQueryPlugin` to make `.imagesLoaded()` jQuery plugin. + +``` js +requirejs( [ + 'jquery', + 'path/to/imagesloaded.pkgd.js', +], function( $, imagesLoaded ) { + // provide jQuery argument + imagesLoaded.makeJQueryPlugin( $ ); + // now use .imagesLoaded() jQuery plugin + $('#container').imagesLoaded( function() {...}); +}); +``` + +You can manage dependencies with [Bower](http://bower.io). Set `baseUrl` to `bower_components` and set a path config for all your application code. + +``` js +requirejs.config({ + baseUrl: 'bower_components/', + paths: { // path to your app + app: '../' + } +}); + +requirejs( [ + 'imagesloaded/imagesloaded', + 'app/my-component.js' +], function( imagesLoaded, myComp ) { + imagesLoaded( '#container', function() { ... }); +}); +``` + +## Browser support + ++ IE9+ ++ Android 2.3+ ++ iOS Safari 4+ ++ All other modern browsers + +Use [imagesLoaded v3](http://imagesloaded.desandro.com/v3/) for IE8 support. + +## MIT License + +imagesLoaded is released under the [MIT License](http://desandro.mit-license.org/). Have at it. diff --git a/static/assets/202ea698/bower.json b/static/assets/202ea698/bower.json new file mode 100644 index 0000000000..ec04ab19a7 --- /dev/null +++ b/static/assets/202ea698/bower.json @@ -0,0 +1,36 @@ +{ + "name": "imagesloaded", + "description": "JavaScript is all like _You images done yet or what?_", + "main": "imagesloaded.js", + "dependencies": { + "ev-emitter": "^1.0.0" + }, + "devDependencies": { + "jquery": ">=1.9 <4.0", + "qunit": "~1.20.0" + }, + "ignore": [ + "**/.*", + "test", + "package.json", + "composer.json", + "node_modules", + "bower_components", + "tests", + "sandbox/", + "contributing.md" + ], + "homepage": "http://imagesloaded.desandro.com", + "authors": [ + "David DeSandro" + ], + "moduleType": [ + "amd", + "globals", + "node" + ], + "keywords": [ + "images" + ], + "license": "MIT" +} diff --git a/static/assets/202ea698/gulpfile.js b/static/assets/202ea698/gulpfile.js new file mode 100644 index 0000000000..66f775f3d6 --- /dev/null +++ b/static/assets/202ea698/gulpfile.js @@ -0,0 +1,128 @@ +/*jshint node: true, strict: false */ + +var fs = require('fs'); +var gulp = require('gulp'); +var rename = require('gulp-rename'); +var replace = require('gulp-replace'); + +// ----- hint ----- // + +var jshint = require('gulp-jshint'); + +gulp.task( 'hint-js', function() { + return gulp.src('imagesloaded.js') + .pipe( jshint() ) + .pipe( jshint.reporter('default') ); +}); + +gulp.task( 'hint-test', function() { + return gulp.src('test/unit/*.js') + .pipe( jshint() ) + .pipe( jshint.reporter('default') ); +}); + +gulp.task( 'hint-task', function() { + return gulp.src('gulpfile.js') + .pipe( jshint() ) + .pipe( jshint.reporter('default') ); +}); + +var jsonlint = require('gulp-json-lint'); + +gulp.task( 'jsonlint', function() { + return gulp.src( '*.json' ) + .pipe( jsonlint() ) + .pipe( jsonlint.report('verbose') ); +}); + +gulp.task( 'hint', [ 'hint-js', 'hint-test', 'hint-task', 'jsonlint' ]); + +// -------------------------- RequireJS makes pkgd -------------------------- // + +// refactored from gulp-requirejs-optimize +// https://www.npmjs.com/package/gulp-requirejs-optimize/ + +var gutil = require('gulp-util'); +var chalk = require('chalk'); +var rjsOptimize = require('gulp-requirejs-optimize'); + +// regex for banner comment +var reBannerComment = new RegExp('^\\s*(?:\\/\\*[\\s\\S]*?\\*\\/)\\s*'); + +function getBanner() { + var src = fs.readFileSync( 'imagesloaded.js', 'utf8' ); + var matches = src.match( reBannerComment ); + var banner = matches[0].replace( 'imagesLoaded', 'imagesLoaded PACKAGED' ); + return banner; +} + +function addBanner( str ) { + return replace( /^/, str ); +} + +gulp.task( 'requirejs', function() { + var banner = getBanner(); + // HACK src is not needed + // should refactor rjsOptimize to produce src + return gulp.src('imagesloaded.js') + .pipe( rjsOptimize({ + baseUrl: 'bower_components', + optimize: 'none', + include: [ + '../imagesloaded' + ] + }) ) + // remove named module + .pipe( replace( "'../imagesloaded',", '' ) ) + // add banner + .pipe( addBanner( banner ) ) + .pipe( rename('imagesloaded.pkgd.js') ) + .pipe( gulp.dest('.') ); +}); + + +// ----- uglify ----- // + +var uglify = require('gulp-uglify'); + +gulp.task( 'uglify', [ 'requirejs' ], function() { + var banner = getBanner(); + gulp.src('imagesloaded.pkgd.js') + .pipe( uglify() ) + // add banner + .pipe( addBanner( banner ) ) + .pipe( rename('imagesloaded.pkgd.min.js') ) + .pipe( gulp.dest('.') ); +}); + +// ----- version ----- // + +// set version in source files + +var minimist = require('minimist'); + +// use gulp version -t 1.2.3 +gulp.task( 'version', function() { + var args = minimist( process.argv.slice(3) ); + var version = args.t; + if ( !version || !/\d+\.\d+\.\d+/.test( version ) ) { + gutil.log( 'invalid version: ' + chalk.red( version ) ); + return; + } + gutil.log( 'ticking version to ' + chalk.green( version ) ); + + gulp.src('imagesloaded.js') + .pipe( replace( /imagesLoaded v\d+\.\d+\.\d+/, 'imagesLoaded v' + version ) ) + .pipe( gulp.dest('.') ); + + gulp.src( [ 'bower.json', 'package.json' ] ) + .pipe( replace( /"version": "\d+\.\d+\.\d+"/, '"version": "' + version + '"' ) ) + .pipe( gulp.dest('.') ); +}); + +// ----- default ----- // + +gulp.task( 'default', [ + 'hint', + 'uglify' +]); diff --git a/static/assets/202ea698/imagesloaded.js b/static/assets/202ea698/imagesloaded.js new file mode 100644 index 0000000000..fb47f765ae --- /dev/null +++ b/static/assets/202ea698/imagesloaded.js @@ -0,0 +1,370 @@ +/*! + * imagesLoaded v4.1.3 + * JavaScript is all like "You images are done yet or what?" + * MIT License + */ + +( function( window, factory ) { 'use strict'; + // universal module definition + + /*global define: false, module: false, require: false */ + + if ( typeof define == 'function' && define.amd ) { + // AMD + define( [ + 'ev-emitter/ev-emitter' + ], function( EvEmitter ) { + return factory( window, EvEmitter ); + }); + } else if ( typeof module == 'object' && module.exports ) { + // CommonJS + module.exports = factory( + window, + require('ev-emitter') + ); + } else { + // browser global + window.imagesLoaded = factory( + window, + window.EvEmitter + ); + } + +})( typeof window !== 'undefined' ? window : this, + +// -------------------------- factory -------------------------- // + +function factory( window, EvEmitter ) { + +'use strict'; + +var $ = window.jQuery; +var console = window.console; + +// -------------------------- helpers -------------------------- // + +// extend objects +function extend( a, b ) { + for ( var prop in b ) { + a[ prop ] = b[ prop ]; + } + return a; +} + +// turn element or nodeList into an array +function makeArray( obj ) { + var ary = []; + if ( Array.isArray( obj ) ) { + // use object if already an array + ary = obj; + } else if ( typeof obj.length == 'number' ) { + // convert nodeList to array + for ( var i=0; i < obj.length; i++ ) { + ary.push( obj[i] ); + } + } else { + // array of single index + ary.push( obj ); + } + return ary; +} + +// -------------------------- imagesLoaded -------------------------- // + +/** + * @param {Array, Element, NodeList, String} elem + * @param {Object or Function} options - if function, use as callback + * @param {Function} onAlways - callback function + */ +function ImagesLoaded( elem, options, onAlways ) { + // coerce ImagesLoaded() without new, to be new ImagesLoaded() + if ( !( this instanceof ImagesLoaded ) ) { + return new ImagesLoaded( elem, options, onAlways ); + } + // use elem as selector string + if ( typeof elem == 'string' ) { + elem = document.querySelectorAll( elem ); + } + + this.elements = makeArray( elem ); + this.options = extend( {}, this.options ); + + if ( typeof options == 'function' ) { + onAlways = options; + } else { + extend( this.options, options ); + } + + if ( onAlways ) { + this.on( 'always', onAlways ); + } + + this.getImages(); + + if ( $ ) { + // add jQuery Deferred object + this.jqDeferred = new $.Deferred(); + } + + // HACK check async to allow time to bind listeners + setTimeout( function() { + this.check(); + }.bind( this )); +} + +ImagesLoaded.prototype = Object.create( EvEmitter.prototype ); + +ImagesLoaded.prototype.options = {}; + +ImagesLoaded.prototype.getImages = function() { + this.images = []; + + // filter & find items if we have an item selector + this.elements.forEach( this.addElementImages, this ); +}; + +/** + * @param {Node} element + */ +ImagesLoaded.prototype.addElementImages = function( elem ) { + // filter siblings + if ( elem.nodeName == 'IMG' ) { + this.addImage( elem ); + } + // get background image on element + if ( this.options.background === true ) { + this.addElementBackgroundImages( elem ); + } + + // find children + // no non-element nodes, #143 + var nodeType = elem.nodeType; + if ( !nodeType || !elementNodeTypes[ nodeType ] ) { + return; + } + var childImgs = elem.querySelectorAll('img'); + // concat childElems to filterFound array + for ( var i=0; i < childImgs.length; i++ ) { + var img = childImgs[i]; + this.addImage( img ); + } + + // get child background images + if ( typeof this.options.background == 'string' ) { + var children = elem.querySelectorAll( this.options.background ); + for ( i=0; i < children.length; i++ ) { + var child = children[i]; + this.addElementBackgroundImages( child ); + } + } +}; + +var elementNodeTypes = { + 1: true, + 9: true, + 11: true +}; + +ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) { + var style = getComputedStyle( elem ); + if ( !style ) { + // Firefox returns null if in a hidden iframe https://bugzil.la/548397 + return; + } + // get url inside url("...") + var reURL = /url\((['"])?(.*?)\1\)/gi; + var matches = reURL.exec( style.backgroundImage ); + while ( matches !== null ) { + var url = matches && matches[2]; + if ( url ) { + this.addBackground( url, elem ); + } + matches = reURL.exec( style.backgroundImage ); + } +}; + +/** + * @param {Image} img + */ +ImagesLoaded.prototype.addImage = function( img ) { + var loadingImage = new LoadingImage( img ); + this.images.push( loadingImage ); +}; + +ImagesLoaded.prototype.addBackground = function( url, elem ) { + var background = new Background( url, elem ); + this.images.push( background ); +}; + +ImagesLoaded.prototype.check = function() { + var _this = this; + this.progressedCount = 0; + this.hasAnyBroken = false; + // complete if no images + if ( !this.images.length ) { + this.complete(); + return; + } + + function onProgress( image, elem, message ) { + // HACK - Chrome triggers event before object properties have changed. #83 + setTimeout( function() { + _this.progress( image, elem, message ); + }); + } + + this.images.forEach( function( loadingImage ) { + loadingImage.once( 'progress', onProgress ); + loadingImage.check(); + }); +}; + +ImagesLoaded.prototype.progress = function( image, elem, message ) { + this.progressedCount++; + this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded; + // progress event + this.emitEvent( 'progress', [ this, image, elem ] ); + if ( this.jqDeferred && this.jqDeferred.notify ) { + this.jqDeferred.notify( this, image ); + } + // check if completed + if ( this.progressedCount == this.images.length ) { + this.complete(); + } + + if ( this.options.debug && console ) { + console.log( 'progress: ' + message, image, elem ); + } +}; + +ImagesLoaded.prototype.complete = function() { + var eventName = this.hasAnyBroken ? 'fail' : 'done'; + this.isComplete = true; + this.emitEvent( eventName, [ this ] ); + this.emitEvent( 'always', [ this ] ); + if ( this.jqDeferred ) { + var jqMethod = this.hasAnyBroken ? 'reject' : 'resolve'; + this.jqDeferred[ jqMethod ]( this ); + } +}; + +// -------------------------- -------------------------- // + +function LoadingImage( img ) { + this.img = img; +} + +LoadingImage.prototype = Object.create( EvEmitter.prototype ); + +LoadingImage.prototype.check = function() { + // If complete is true and browser supports natural sizes, + // try to check for image status manually. + var isComplete = this.getIsImageComplete(); + if ( isComplete ) { + // report based on naturalWidth + this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); + return; + } + + // If none of the checks above matched, simulate loading on detached element. + this.proxyImage = new Image(); + this.proxyImage.addEventListener( 'load', this ); + this.proxyImage.addEventListener( 'error', this ); + // bind to image as well for Firefox. #191 + this.img.addEventListener( 'load', this ); + this.img.addEventListener( 'error', this ); + this.proxyImage.src = this.img.src; +}; + +LoadingImage.prototype.getIsImageComplete = function() { + return this.img.complete && this.img.naturalWidth !== undefined; +}; + +LoadingImage.prototype.confirm = function( isLoaded, message ) { + this.isLoaded = isLoaded; + this.emitEvent( 'progress', [ this, this.img, message ] ); +}; + +// ----- events ----- // + +// trigger specified handler for event type +LoadingImage.prototype.handleEvent = function( event ) { + var method = 'on' + event.type; + if ( this[ method ] ) { + this[ method ]( event ); + } +}; + +LoadingImage.prototype.onload = function() { + this.confirm( true, 'onload' ); + this.unbindEvents(); +}; + +LoadingImage.prototype.onerror = function() { + this.confirm( false, 'onerror' ); + this.unbindEvents(); +}; + +LoadingImage.prototype.unbindEvents = function() { + this.proxyImage.removeEventListener( 'load', this ); + this.proxyImage.removeEventListener( 'error', this ); + this.img.removeEventListener( 'load', this ); + this.img.removeEventListener( 'error', this ); +}; + +// -------------------------- Background -------------------------- // + +function Background( url, element ) { + this.url = url; + this.element = element; + this.img = new Image(); +} + +// inherit LoadingImage prototype +Background.prototype = Object.create( LoadingImage.prototype ); + +Background.prototype.check = function() { + this.img.addEventListener( 'load', this ); + this.img.addEventListener( 'error', this ); + this.img.src = this.url; + // check if image is already complete + var isComplete = this.getIsImageComplete(); + if ( isComplete ) { + this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); + this.unbindEvents(); + } +}; + +Background.prototype.unbindEvents = function() { + this.img.removeEventListener( 'load', this ); + this.img.removeEventListener( 'error', this ); +}; + +Background.prototype.confirm = function( isLoaded, message ) { + this.isLoaded = isLoaded; + this.emitEvent( 'progress', [ this, this.element, message ] ); +}; + +// -------------------------- jQuery -------------------------- // + +ImagesLoaded.makeJQueryPlugin = function( jQuery ) { + jQuery = jQuery || window.jQuery; + if ( !jQuery ) { + return; + } + // set local variable + $ = jQuery; + // $().imagesLoaded() + $.fn.imagesLoaded = function( options, callback ) { + var instance = new ImagesLoaded( this, options, callback ); + return instance.jqDeferred.promise( $(this) ); + }; +}; +// try making plugin +ImagesLoaded.makeJQueryPlugin(); + +// -------------------------- -------------------------- // + +return ImagesLoaded; + +}); diff --git a/static/assets/202ea698/imagesloaded.pkgd.js b/static/assets/202ea698/imagesloaded.pkgd.js new file mode 100644 index 0000000000..802330a410 --- /dev/null +++ b/static/assets/202ea698/imagesloaded.pkgd.js @@ -0,0 +1,493 @@ +/*! + * imagesLoaded PACKAGED v4.1.3 + * JavaScript is all like "You images are done yet or what?" + * MIT License + */ + +/** + * EvEmitter v1.1.0 + * Lil' event emitter + * MIT License + */ + +/* jshint unused: true, undef: true, strict: true */ + +( function( global, factory ) { + // universal module definition + /* jshint strict: false */ /* globals define, module, window */ + if ( typeof define == 'function' && define.amd ) { + // AMD - RequireJS + define( 'ev-emitter/ev-emitter',factory ); + } else if ( typeof module == 'object' && module.exports ) { + // CommonJS - Browserify, Webpack + module.exports = factory(); + } else { + // Browser globals + global.EvEmitter = factory(); + } + +}( typeof window != 'undefined' ? window : this, function() { + + + +function EvEmitter() {} + +var proto = EvEmitter.prototype; + +proto.on = function( eventName, listener ) { + if ( !eventName || !listener ) { + return; + } + // set events hash + var events = this._events = this._events || {}; + // set listeners array + var listeners = events[ eventName ] = events[ eventName ] || []; + // only add once + if ( listeners.indexOf( listener ) == -1 ) { + listeners.push( listener ); + } + + return this; +}; + +proto.once = function( eventName, listener ) { + if ( !eventName || !listener ) { + return; + } + // add event + this.on( eventName, listener ); + // set once flag + // set onceEvents hash + var onceEvents = this._onceEvents = this._onceEvents || {}; + // set onceListeners object + var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {}; + // set flag + onceListeners[ listener ] = true; + + return this; +}; + +proto.off = function( eventName, listener ) { + var listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) { + return; + } + var index = listeners.indexOf( listener ); + if ( index != -1 ) { + listeners.splice( index, 1 ); + } + + return this; +}; + +proto.emitEvent = function( eventName, args ) { + var listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) { + return; + } + var i = 0; + var listener = listeners[i]; + args = args || []; + // once stuff + var onceListeners = this._onceEvents && this._onceEvents[ eventName ]; + + while ( listener ) { + var isOnce = onceListeners && onceListeners[ listener ]; + if ( isOnce ) { + // remove listener + // remove before trigger to prevent recursion + this.off( eventName, listener ); + // unset once flag + delete onceListeners[ listener ]; + } + // trigger listener + listener.apply( this, args ); + // get next listener + i += isOnce ? 0 : 1; + listener = listeners[i]; + } + + return this; +}; + +proto.allOff = +proto.removeAllListeners = function() { + delete this._events; + delete this._onceEvents; +}; + +return EvEmitter; + +})); + +/*! + * imagesLoaded v4.1.3 + * JavaScript is all like "You images are done yet or what?" + * MIT License + */ + +( function( window, factory ) { 'use strict'; + // universal module definition + + /*global define: false, module: false, require: false */ + + if ( typeof define == 'function' && define.amd ) { + // AMD + define( [ + 'ev-emitter/ev-emitter' + ], function( EvEmitter ) { + return factory( window, EvEmitter ); + }); + } else if ( typeof module == 'object' && module.exports ) { + // CommonJS + module.exports = factory( + window, + require('ev-emitter') + ); + } else { + // browser global + window.imagesLoaded = factory( + window, + window.EvEmitter + ); + } + +})( typeof window !== 'undefined' ? window : this, + +// -------------------------- factory -------------------------- // + +function factory( window, EvEmitter ) { + + + +var $ = window.jQuery; +var console = window.console; + +// -------------------------- helpers -------------------------- // + +// extend objects +function extend( a, b ) { + for ( var prop in b ) { + a[ prop ] = b[ prop ]; + } + return a; +} + +// turn element or nodeList into an array +function makeArray( obj ) { + var ary = []; + if ( Array.isArray( obj ) ) { + // use object if already an array + ary = obj; + } else if ( typeof obj.length == 'number' ) { + // convert nodeList to array + for ( var i=0; i < obj.length; i++ ) { + ary.push( obj[i] ); + } + } else { + // array of single index + ary.push( obj ); + } + return ary; +} + +// -------------------------- imagesLoaded -------------------------- // + +/** + * @param {Array, Element, NodeList, String} elem + * @param {Object or Function} options - if function, use as callback + * @param {Function} onAlways - callback function + */ +function ImagesLoaded( elem, options, onAlways ) { + // coerce ImagesLoaded() without new, to be new ImagesLoaded() + if ( !( this instanceof ImagesLoaded ) ) { + return new ImagesLoaded( elem, options, onAlways ); + } + // use elem as selector string + if ( typeof elem == 'string' ) { + elem = document.querySelectorAll( elem ); + } + + this.elements = makeArray( elem ); + this.options = extend( {}, this.options ); + + if ( typeof options == 'function' ) { + onAlways = options; + } else { + extend( this.options, options ); + } + + if ( onAlways ) { + this.on( 'always', onAlways ); + } + + this.getImages(); + + if ( $ ) { + // add jQuery Deferred object + this.jqDeferred = new $.Deferred(); + } + + // HACK check async to allow time to bind listeners + setTimeout( function() { + this.check(); + }.bind( this )); +} + +ImagesLoaded.prototype = Object.create( EvEmitter.prototype ); + +ImagesLoaded.prototype.options = {}; + +ImagesLoaded.prototype.getImages = function() { + this.images = []; + + // filter & find items if we have an item selector + this.elements.forEach( this.addElementImages, this ); +}; + +/** + * @param {Node} element + */ +ImagesLoaded.prototype.addElementImages = function( elem ) { + // filter siblings + if ( elem.nodeName == 'IMG' ) { + this.addImage( elem ); + } + // get background image on element + if ( this.options.background === true ) { + this.addElementBackgroundImages( elem ); + } + + // find children + // no non-element nodes, #143 + var nodeType = elem.nodeType; + if ( !nodeType || !elementNodeTypes[ nodeType ] ) { + return; + } + var childImgs = elem.querySelectorAll('img'); + // concat childElems to filterFound array + for ( var i=0; i < childImgs.length; i++ ) { + var img = childImgs[i]; + this.addImage( img ); + } + + // get child background images + if ( typeof this.options.background == 'string' ) { + var children = elem.querySelectorAll( this.options.background ); + for ( i=0; i < children.length; i++ ) { + var child = children[i]; + this.addElementBackgroundImages( child ); + } + } +}; + +var elementNodeTypes = { + 1: true, + 9: true, + 11: true +}; + +ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) { + var style = getComputedStyle( elem ); + if ( !style ) { + // Firefox returns null if in a hidden iframe https://bugzil.la/548397 + return; + } + // get url inside url("...") + var reURL = /url\((['"])?(.*?)\1\)/gi; + var matches = reURL.exec( style.backgroundImage ); + while ( matches !== null ) { + var url = matches && matches[2]; + if ( url ) { + this.addBackground( url, elem ); + } + matches = reURL.exec( style.backgroundImage ); + } +}; + +/** + * @param {Image} img + */ +ImagesLoaded.prototype.addImage = function( img ) { + var loadingImage = new LoadingImage( img ); + this.images.push( loadingImage ); +}; + +ImagesLoaded.prototype.addBackground = function( url, elem ) { + var background = new Background( url, elem ); + this.images.push( background ); +}; + +ImagesLoaded.prototype.check = function() { + var _this = this; + this.progressedCount = 0; + this.hasAnyBroken = false; + // complete if no images + if ( !this.images.length ) { + this.complete(); + return; + } + + function onProgress( image, elem, message ) { + // HACK - Chrome triggers event before object properties have changed. #83 + setTimeout( function() { + _this.progress( image, elem, message ); + }); + } + + this.images.forEach( function( loadingImage ) { + loadingImage.once( 'progress', onProgress ); + loadingImage.check(); + }); +}; + +ImagesLoaded.prototype.progress = function( image, elem, message ) { + this.progressedCount++; + this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded; + // progress event + this.emitEvent( 'progress', [ this, image, elem ] ); + if ( this.jqDeferred && this.jqDeferred.notify ) { + this.jqDeferred.notify( this, image ); + } + // check if completed + if ( this.progressedCount == this.images.length ) { + this.complete(); + } + + if ( this.options.debug && console ) { + console.log( 'progress: ' + message, image, elem ); + } +}; + +ImagesLoaded.prototype.complete = function() { + var eventName = this.hasAnyBroken ? 'fail' : 'done'; + this.isComplete = true; + this.emitEvent( eventName, [ this ] ); + this.emitEvent( 'always', [ this ] ); + if ( this.jqDeferred ) { + var jqMethod = this.hasAnyBroken ? 'reject' : 'resolve'; + this.jqDeferred[ jqMethod ]( this ); + } +}; + +// -------------------------- -------------------------- // + +function LoadingImage( img ) { + this.img = img; +} + +LoadingImage.prototype = Object.create( EvEmitter.prototype ); + +LoadingImage.prototype.check = function() { + // If complete is true and browser supports natural sizes, + // try to check for image status manually. + var isComplete = this.getIsImageComplete(); + if ( isComplete ) { + // report based on naturalWidth + this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); + return; + } + + // If none of the checks above matched, simulate loading on detached element. + this.proxyImage = new Image(); + this.proxyImage.addEventListener( 'load', this ); + this.proxyImage.addEventListener( 'error', this ); + // bind to image as well for Firefox. #191 + this.img.addEventListener( 'load', this ); + this.img.addEventListener( 'error', this ); + this.proxyImage.src = this.img.src; +}; + +LoadingImage.prototype.getIsImageComplete = function() { + return this.img.complete && this.img.naturalWidth !== undefined; +}; + +LoadingImage.prototype.confirm = function( isLoaded, message ) { + this.isLoaded = isLoaded; + this.emitEvent( 'progress', [ this, this.img, message ] ); +}; + +// ----- events ----- // + +// trigger specified handler for event type +LoadingImage.prototype.handleEvent = function( event ) { + var method = 'on' + event.type; + if ( this[ method ] ) { + this[ method ]( event ); + } +}; + +LoadingImage.prototype.onload = function() { + this.confirm( true, 'onload' ); + this.unbindEvents(); +}; + +LoadingImage.prototype.onerror = function() { + this.confirm( false, 'onerror' ); + this.unbindEvents(); +}; + +LoadingImage.prototype.unbindEvents = function() { + this.proxyImage.removeEventListener( 'load', this ); + this.proxyImage.removeEventListener( 'error', this ); + this.img.removeEventListener( 'load', this ); + this.img.removeEventListener( 'error', this ); +}; + +// -------------------------- Background -------------------------- // + +function Background( url, element ) { + this.url = url; + this.element = element; + this.img = new Image(); +} + +// inherit LoadingImage prototype +Background.prototype = Object.create( LoadingImage.prototype ); + +Background.prototype.check = function() { + this.img.addEventListener( 'load', this ); + this.img.addEventListener( 'error', this ); + this.img.src = this.url; + // check if image is already complete + var isComplete = this.getIsImageComplete(); + if ( isComplete ) { + this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); + this.unbindEvents(); + } +}; + +Background.prototype.unbindEvents = function() { + this.img.removeEventListener( 'load', this ); + this.img.removeEventListener( 'error', this ); +}; + +Background.prototype.confirm = function( isLoaded, message ) { + this.isLoaded = isLoaded; + this.emitEvent( 'progress', [ this, this.element, message ] ); +}; + +// -------------------------- jQuery -------------------------- // + +ImagesLoaded.makeJQueryPlugin = function( jQuery ) { + jQuery = jQuery || window.jQuery; + if ( !jQuery ) { + return; + } + // set local variable + $ = jQuery; + // $().imagesLoaded() + $.fn.imagesLoaded = function( options, callback ) { + var instance = new ImagesLoaded( this, options, callback ); + return instance.jqDeferred.promise( $(this) ); + }; +}; +// try making plugin +ImagesLoaded.makeJQueryPlugin(); + +// -------------------------- -------------------------- // + +return ImagesLoaded; + +}); + diff --git a/static/assets/202ea698/imagesloaded.pkgd.min.js b/static/assets/202ea698/imagesloaded.pkgd.min.js new file mode 100644 index 0000000000..0854d63eab --- /dev/null +++ b/static/assets/202ea698/imagesloaded.pkgd.min.js @@ -0,0 +1,7 @@ +/*! + * imagesLoaded PACKAGED v4.1.3 + * JavaScript is all like "You images are done yet or what?" + * MIT License + */ + +!function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return-1==n.indexOf(t)&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{},n=i[e]=i[e]||{};return n[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return-1!=n&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=0,o=i[n];t=t||[];for(var r=this._onceEvents&&this._onceEvents[e];o;){var s=r&&r[o];s&&(this.off(e,o),delete r[o]),o.apply(this,t),n+=s?0:1,o=i[n]}return this}},t.allOff=t.removeAllListeners=function(){delete this._events,delete this._onceEvents},e}),function(e,t){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return t(e,i)}):"object"==typeof module&&module.exports?module.exports=t(e,require("ev-emitter")):e.imagesLoaded=t(e,e.EvEmitter)}("undefined"!=typeof window?window:this,function(e,t){function i(e,t){for(var i in t)e[i]=t[i];return e}function n(e){var t=[];if(Array.isArray(e))t=e;else if("number"==typeof e.length)for(var i=0;i; * Homepage: http://ichord.github.com/At.js * License: MIT @@ -809,7 +809,7 @@ EditableController = (function(superClass) { EditableController.prototype.rect = function() { var $iframe, iframeOffset, rect; rect = this.query.el.offset(); - if (!rect) { + if (!(rect && this.query.el[0].getClientRects().length)) { return; } if (this.app.iframe && !this.app.iframeAsRoot) { @@ -822,10 +822,14 @@ EditableController = (function(superClass) { }; EditableController.prototype.insert = function(content, $li) { - var data, range, suffix, suffixNode; + var data, overrides, range, suffix, suffixNode; if (!this.$inputor.is(':focus')) { this.$inputor.focus(); } + overrides = this.getOpt('functionOverrides'); + if (overrides.insert) { + return overrides.insert.call(this, content, $li); + } suffix = (suffix = this.getOpt('suffix')) === "" ? suffix : suffix || "\u00A0"; data = $li.data('item-data'); this.query.el.removeClass('atwho-query').addClass('atwho-inserted').html(content).attr('data-atwho-at-query', "" + data['atwho-at'] + this.query.text).attr('contenteditable', "false"); @@ -1183,6 +1187,7 @@ $.fn.atwho["default"] = { insertTpl: "${atwho-at}${name}", headerTpl: null, callbacks: DEFAULT_CALLBACKS, + functionOverrides: {}, searchKey: "name", suffix: void 0, hideWithoutSuffix: false, diff --git a/static/assets/60150af8/dist/js/jquery.atwho.min.js b/static/assets/80d9ad70/dist/js/jquery.atwho.min.js similarity index 65% rename from static/assets/60150af8/dist/js/jquery.atwho.min.js rename to static/assets/80d9ad70/dist/js/jquery.atwho.min.js index 3a514809c3..d1e60152b4 100644 --- a/static/assets/60150af8/dist/js/jquery.atwho.min.js +++ b/static/assets/80d9ad70/dist/js/jquery.atwho.min.js @@ -1 +1 @@ -!function(t,e){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t)}):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(this,function(t){var e,i;i={ESC:27,TAB:9,ENTER:13,CTRL:17,A:65,P:80,N:78,LEFT:37,UP:38,RIGHT:39,DOWN:40,BACKSPACE:8,SPACE:32},e={beforeSave:function(t){return r.arrayToDefaultHash(t)},matcher:function(t,e,i,n){var r,o,s,a,h;return t=t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),i&&(t="(?:^|\\s)"+t),r=decodeURI("%C3%80"),o=decodeURI("%C3%BF"),h=n?" ":"",a=new RegExp(t+"([A-Za-z"+r+"-"+o+"0-9_"+h+"'.+-]*)$|"+t+"([^\\x00-\\xff]*)$","gi"),s=a.exec(e),s?s[2]||s[1]:null},filter:function(t,e,i){var n,r,o,s;for(n=[],r=0,s=e.length;s>r;r++)o=e[r],~new String(o[i]).toLowerCase().indexOf(t.toLowerCase())&&n.push(o);return n},remoteFilter:null,sorter:function(t,e,i){var n,r,o,s;if(!t)return e;for(n=[],r=0,s=e.length;s>r;r++)o=e[r],o.atwho_order=new String(o[i]).toLowerCase().indexOf(t.toLowerCase()),o.atwho_order>-1&&n.push(o);return n.sort(function(t,e){return t.atwho_order-e.atwho_order})},tplEval:function(t,e){var i,n,r;r=t;try{return"string"!=typeof t&&(r=t(e)),r.replace(/\$\{([^\}]*)\}/g,function(t,i,n){return e[i]})}catch(n){return i=n,""}},highlighter:function(t,e){var i;return e?(i=new RegExp(">\\s*([^<]*?)("+e.replace("+","\\+")+")([^<]*)\\s*<","ig"),t.replace(i,function(t,e,i,n){return"> "+e+""+i+""+n+" <"})):t},beforeInsert:function(t,e,i){return t},beforeReposition:function(t){return t},afterMatchFailed:function(t,e){}};var n;n=function(){function e(e){this.currentFlag=null,this.controllers={},this.aliasMaps={},this.$inputor=t(e),this.setupRootElement(),this.listen()}return e.prototype.createContainer=function(e){var i;return null!=(i=this.$el)&&i.remove(),t(e.body).append(this.$el=t("
"))},e.prototype.setupRootElement=function(e,i){var n,r;if(null==i&&(i=!1),e)this.window=e.contentWindow,this.document=e.contentDocument||this.window.document,this.iframe=e;else{this.document=this.$inputor[0].ownerDocument,this.window=this.document.defaultView||this.document.parentWindow;try{this.iframe=this.window.frameElement}catch(r){if(n=r,this.iframe=null,t.fn.atwho.debug)throw new Error("iframe auto-discovery is failed.\nPlease use `setIframe` to set the target iframe manually.\n"+n)}}return this.createContainer((this.iframeAsRoot=i)?this.document:document)},e.prototype.controller=function(t){var e,i,n,r;if(this.aliasMaps[t])i=this.controllers[this.aliasMaps[t]];else{r=this.controllers;for(n in r)if(e=r[n],n===t){i=e;break}}return i?i:this.controllers[this.currentFlag]},e.prototype.setContextFor=function(t){return this.currentFlag=t,this},e.prototype.reg=function(t,e){var i,n;return n=(i=this.controllers)[t]||(i[t]=this.$inputor.is("[contentEditable]")?new l(this,t):new s(this,t)),e.alias&&(this.aliasMaps[e.alias]=t),n.init(e),this},e.prototype.listen=function(){return this.$inputor.on("compositionstart",function(t){return function(e){var i;return null!=(i=t.controller())&&i.view.hide(),t.isComposing=!0,null}}(this)).on("compositionend",function(t){return function(e){return t.isComposing=!1,setTimeout(function(e){return t.dispatch(e)}),null}}(this)).on("keyup.atwhoInner",function(t){return function(e){return t.onKeyup(e)}}(this)).on("keydown.atwhoInner",function(t){return function(e){return t.onKeydown(e)}}(this)).on("blur.atwhoInner",function(t){return function(e){var i;return(i=t.controller())?(i.expectedQueryCBId=null,i.view.hide(e,i.getOpt("displayTimeout"))):void 0}}(this)).on("click.atwhoInner",function(t){return function(e){return t.dispatch(e)}}(this)).on("scroll.atwhoInner",function(t){return function(){var e;return e=t.$inputor.scrollTop(),function(i){var n,r;return n=i.target.scrollTop,e!==n&&null!=(r=t.controller())&&r.view.hide(i),e=n,!0}}}(this)())},e.prototype.shutdown=function(){var t,e,i;i=this.controllers;for(t in i)e=i[t],e.destroy(),delete this.controllers[t];return this.$inputor.off(".atwhoInner"),this.$el.remove()},e.prototype.dispatch=function(t){var e,i,n,r;n=this.controllers,r=[];for(e in n)i=n[e],r.push(i.lookUp(t));return r},e.prototype.onKeyup=function(e){var n;switch(e.keyCode){case i.ESC:e.preventDefault(),null!=(n=this.controller())&&n.view.hide();break;case i.DOWN:case i.UP:case i.CTRL:case i.ENTER:t.noop();break;case i.P:case i.N:e.ctrlKey||this.dispatch(e);break;default:this.dispatch(e)}},e.prototype.onKeydown=function(e){var n,r;if(r=null!=(n=this.controller())?n.view:void 0,r&&r.visible())switch(e.keyCode){case i.ESC:e.preventDefault(),r.hide(e);break;case i.UP:e.preventDefault(),r.prev();break;case i.DOWN:e.preventDefault(),r.next();break;case i.P:if(!e.ctrlKey)return;e.preventDefault(),r.prev();break;case i.N:if(!e.ctrlKey)return;e.preventDefault(),r.next();break;case i.TAB:case i.ENTER:case i.SPACE:if(!r.visible())return;if(!this.controller().getOpt("spaceSelectsMatch")&&e.keyCode===i.SPACE)return;if(!this.controller().getOpt("tabSelectsMatch")&&e.keyCode===i.TAB)return;r.highlighted()?(e.preventDefault(),r.choose(e)):r.hide(e);break;default:t.noop()}},e}();var r,o=[].slice;r=function(){function i(e,i){this.app=e,this.at=i,this.$inputor=this.app.$inputor,this.id=this.$inputor[0].id||this.uid(),this.expectedQueryCBId=null,this.setting=null,this.query=null,this.pos=0,this.range=null,0===(this.$el=t("#atwho-ground-"+this.id,this.app.$el)).length&&this.app.$el.append(this.$el=t("
")),this.model=new u(this),this.view=new c(this)}return i.prototype.uid=function(){return(Math.random().toString(16)+"000000000").substr(2,8)+(new Date).getTime()},i.prototype.init=function(e){return this.setting=t.extend({},this.setting||t.fn.atwho["default"],e),this.view.init(),this.model.reload(this.setting.data)},i.prototype.destroy=function(){return this.trigger("beforeDestroy"),this.model.destroy(),this.view.destroy(),this.$el.remove()},i.prototype.callDefault=function(){var i,n,r,s;s=arguments[0],i=2<=arguments.length?o.call(arguments,1):[];try{return e[s].apply(this,i)}catch(r){return n=r,t.error(n+" Or maybe At.js doesn't have function "+s)}},i.prototype.trigger=function(t,e){var i,n;return null==e&&(e=[]),e.push(this),i=this.getOpt("alias"),n=i?t+"-"+i+".atwho":t+".atwho",this.$inputor.trigger(n,e)},i.prototype.callbacks=function(t){return this.getOpt("callbacks")[t]||e[t]},i.prototype.getOpt=function(t,e){var i,n;try{return this.setting[t]}catch(n){return i=n,null}},i.prototype.insertContentFor=function(e){var i,n;return n=this.getOpt("insertTpl"),i=t.extend({},e.data("item-data"),{"atwho-at":this.at}),this.callbacks("tplEval").call(this,n,i,"onInsert")},i.prototype.renderView=function(t){var e;return e=this.getOpt("searchKey"),t=this.callbacks("sorter").call(this,this.query.text,t.slice(0,1001),e),this.view.render(t.slice(0,this.getOpt("limit")))},i.arrayToDefaultHash=function(e){var i,n,r,o;if(!t.isArray(e))return e;for(o=[],i=0,r=e.length;r>i;i++)n=e[i],t.isPlainObject(n)?o.push(n):o.push({name:n});return o},i.prototype.lookUp=function(t){var e,i;if((!t||"click"!==t.type||this.getOpt("lookUpOnClick"))&&(!this.getOpt("suspendOnComposing")||!this.app.isComposing))return(e=this.catchQuery(t))?(this.app.setContextFor(this.at),(i=this.getOpt("delay"))?this._delayLookUp(e,i):this._lookUp(e),e):(this.expectedQueryCBId=null,e)},i.prototype._delayLookUp=function(t,e){var i,n;return i=Date.now?Date.now():(new Date).getTime(),this.previousCallTime||(this.previousCallTime=i),n=e-(i-this.previousCallTime),n>0&&e>n?(this.previousCallTime=i,this._stopDelayedCall(),this.delayedCallTimeout=setTimeout(function(e){return function(){return e.previousCallTime=0,e.delayedCallTimeout=null,e._lookUp(t)}}(this),e)):(this._stopDelayedCall(),this.previousCallTime!==i&&(this.previousCallTime=0),this._lookUp(t))},i.prototype._stopDelayedCall=function(){return this.delayedCallTimeout?(clearTimeout(this.delayedCallTimeout),this.delayedCallTimeout=null):void 0},i.prototype._generateQueryCBId=function(){return{}},i.prototype._lookUp=function(e){var i;return i=function(t,e){return t===this.expectedQueryCBId?e&&e.length>0?this.renderView(this.constructor.arrayToDefaultHash(e)):this.view.hide():void 0},this.expectedQueryCBId=this._generateQueryCBId(),this.model.query(e.text,t.proxy(i,this,this.expectedQueryCBId))},i}();var s,a=function(t,e){function i(){this.constructor=t}for(var n in e)h.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},h={}.hasOwnProperty;s=function(e){function i(){return i.__super__.constructor.apply(this,arguments)}return a(i,e),i.prototype.catchQuery=function(){var t,e,i,n,r,o,s;return e=this.$inputor.val(),t=this.$inputor.caret("pos",{iframe:this.app.iframe}),s=e.slice(0,t),r=this.callbacks("matcher").call(this,this.at,s,this.getOpt("startWithSpace"),this.getOpt("acceptSpaceBar")),n="string"==typeof r,n&&r.length0?t.getRangeAt(0):void 0},n.prototype._setRange=function(e,i,n){return null==n&&(n=this._getRange()),n&&i?(i=t(i)[0],"after"===e?(n.setEndAfter(i),n.setStartAfter(i)):(n.setEndBefore(i),n.setStartBefore(i)),n.collapse(!1),this._clearRange(n)):void 0},n.prototype._clearRange=function(t){var e;return null==t&&(t=this._getRange()),e=this.app.window.getSelection(),null==this.ctrl_a_pressed?(e.removeAllRanges(),e.addRange(t)):void 0},n.prototype._movingEvent=function(t){var e;return"click"===t.type||(e=t.which)===i.RIGHT||e===i.LEFT||e===i.UP||e===i.DOWN},n.prototype._unwrap=function(e){var i;return e=t(e).unwrap().get(0),(i=e.nextSibling)&&i.nodeValue&&(e.nodeValue+=i.nodeValue,t(i).remove()),e},n.prototype.catchQuery=function(e){var n,r,o,s,a,h,l,u,c,p,f,d;if((d=this._getRange())&&d.collapsed){if(e.which===i.ENTER)return(r=t(d.startContainer).closest(".atwho-query")).contents().unwrap(),r.is(":empty")&&r.remove(),(r=t(".atwho-query",this.app.document)).text(r.text()).contents().last().unwrap(),void this._clearRange();if(/firefox/i.test(navigator.userAgent)){if(t(d.startContainer).is(this.$inputor))return void this._clearRange();e.which===i.BACKSPACE&&d.startContainer.nodeType===document.ELEMENT_NODE&&(c=d.startOffset-1)>=0?(o=d.cloneRange(),o.setStart(d.startContainer,c),t(o.cloneContents()).contents().last().is(".atwho-inserted")&&(a=t(d.startContainer).contents().get(c),this._setRange("after",t(a).contents().last()))):e.which===i.LEFT&&d.startContainer.nodeType===document.TEXT_NODE&&(n=t(d.startContainer.previousSibling),n.is(".atwho-inserted")&&0===d.startOffset&&this._setRange("after",n.contents().last()))}if(t(d.startContainer).closest(".atwho-inserted").addClass("atwho-query").siblings().removeClass("atwho-query"),(r=t(".atwho-query",this.app.document)).length>0&&r.is(":empty")&&0===r.text().length&&r.remove(),this._movingEvent(e)||r.removeClass("atwho-inserted"),r.length>0)switch(e.which){case i.LEFT:return this._setRange("before",r.get(0),d),void r.removeClass("atwho-query");case i.RIGHT:return this._setRange("after",r.get(0).nextSibling,d),void r.removeClass("atwho-query")}if(r.length>0&&(f=r.attr("data-atwho-at-query"))&&(r.empty().html(f).attr("data-atwho-at-query",null),this._setRange("after",r.get(0),d)),o=d.cloneRange(),o.setStart(d.startContainer,0),u=this.callbacks("matcher").call(this,this.at,o.toString(),this.getOpt("startWithSpace"),this.getOpt("acceptSpaceBar")),h="string"==typeof u,0===r.length&&h&&(s=d.startOffset-this.at.length-u.length)>=0&&(d.setStart(d.startContainer,s),r=t("",this.app.document).attr(this.getOpt("editableAtwhoQueryAttrs")).addClass("atwho-query"),d.surroundContents(r.get(0)),l=r.contents().last().get(0),l&&(/firefox/i.test(navigator.userAgent)?(d.setStart(l,l.length),d.setEnd(l,l.length),this._clearRange(d)):this._setRange("after",l,d))),!(h&&u.length=0&&(this._movingEvent(e)&&r.hasClass("atwho-inserted")?r.removeClass("atwho-query"):!1!==this.callbacks("afterMatchFailed").call(this,this.at,r)&&this._setRange("after",this._unwrap(r.text(r.text()).contents().first()))),null)}},n.prototype.rect=function(){var e,i,n;return(n=this.query.el.offset())?(this.app.iframe&&!this.app.iframeAsRoot&&(i=(e=t(this.app.iframe)).offset(),n.left+=i.left-this.$inputor.scrollLeft(),n.top+=i.top-this.$inputor.scrollTop()),n.bottom=n.top+this.query.el.height(),n):void 0},n.prototype.insert=function(t,e){var i,n,r,o;return this.$inputor.is(":focus")||this.$inputor.focus(),r=""===(r=this.getOpt("suffix"))?r:r||" ",i=e.data("item-data"),this.query.el.removeClass("atwho-query").addClass("atwho-inserted").html(t).attr("data-atwho-at-query",""+i["atwho-at"]+this.query.text).attr("contenteditable","false"),(n=this._getRange())&&(this.query.el.length&&n.setEndAfter(this.query.el[0]),n.collapse(!1),n.insertNode(o=this.app.document.createTextNode(""+r)),this._setRange("after",o,n)),this.$inputor.is(":focus")||this.$inputor.focus(),this.$inputor.change()},n}(r);var u;u=function(){function e(t){this.context=t,this.at=this.context.at,this.storage=this.context.$inputor}return e.prototype.destroy=function(){return this.storage.data(this.at,null)},e.prototype.saved=function(){return this.fetch()>0},e.prototype.query=function(t,e){var i,n,r;return n=this.fetch(),r=this.context.getOpt("searchKey"),n=this.context.callbacks("filter").call(this.context,t,n,r)||[],i=this.context.callbacks("remoteFilter"),n.length>0||!i&&0===n.length?e(n):i.call(this.context,t,e)},e.prototype.fetch=function(){return this.storage.data(this.at)||[]},e.prototype.save=function(t){return this.storage.data(this.at,this.context.callbacks("beforeSave").call(this.context,t||[]))},e.prototype.load=function(t){return!this.saved()&&t?this._load(t):void 0},e.prototype.reload=function(t){return this._load(t)},e.prototype._load=function(e){return"string"==typeof e?t.ajax(e,{dataType:"json"}).done(function(t){return function(e){return t.save(e)}}(this)):this.save(e)},e}();var c;c=function(){function e(e){this.context=e,this.$el=t("
    "),this.$elUl=this.$el.children(),this.timeoutID=null,this.context.$el.append(this.$el),this.bindEvent()}return e.prototype.init=function(){var t,e;return e=this.context.getOpt("alias")||this.context.at.charCodeAt(0),t=this.context.getOpt("headerTpl"),t&&1===this.$el.children().length&&this.$el.prepend(t),this.$el.attr({id:"at-view-"+e})},e.prototype.destroy=function(){return this.$el.remove()},e.prototype.bindEvent=function(){var e,i,n;return e=this.$el.find("ul"),i=0,n=0,e.on("mousemove.atwho-view","li",function(r){return function(r){var o;if((i!==r.clientX||n!==r.clientY)&&(i=r.clientX,n=r.clientY,o=t(r.currentTarget),!o.hasClass("cur")))return e.find(".cur").removeClass("cur"),o.addClass("cur")}}(this)).on("click.atwho-view","li",function(i){return function(n){return e.find(".cur").removeClass("cur"),t(n.currentTarget).addClass("cur"),i.choose(n),n.preventDefault()}}(this))},e.prototype.visible=function(){return t.expr.filters.visible(this.$el[0])},e.prototype.highlighted=function(){return this.$el.find(".cur").length>0},e.prototype.choose=function(t){var e,i;return(e=this.$el.find(".cur")).length&&(i=this.context.insertContentFor(e),this.context._stopDelayedCall(),this.context.insert(this.context.callbacks("beforeInsert").call(this.context,i,e,t),e),this.context.trigger("inserted",[e,t]),this.hide(t)),this.context.getOpt("hideWithoutSuffix")?this.stopShowing=!0:void 0},e.prototype.reposition=function(e){var i,n,r,o;return i=this.context.app.iframeAsRoot?this.context.app.window:window,e.bottom+this.$el.height()-t(i).scrollTop()>t(i).height()&&(e.bottom=e.top-this.$el.height()),e.left>(r=t(i).width()-this.$el.width()-5)&&(e.left=r),n={left:e.left,top:e.bottom},null!=(o=this.context.callbacks("beforeReposition"))&&o.call(this.context,n),this.$el.offset(n),this.context.trigger("reposition",[n])},e.prototype.next=function(){var t,e,i,n;return t=this.$el.find(".cur").removeClass("cur"),e=t.next(),e.length||(e=this.$el.find("li:first")),e.addClass("cur"),i=e[0],n=i.offsetTop+i.offsetHeight+(i.nextSibling?i.nextSibling.offsetHeight:0),this.scrollTop(Math.max(0,n-this.$el.height()))},e.prototype.prev=function(){var t,e,i,n;return t=this.$el.find(".cur").removeClass("cur"),i=t.prev(),i.length||(i=this.$el.find("li:last")),i.addClass("cur"),n=i[0],e=n.offsetTop+n.offsetHeight+(n.nextSibling?n.nextSibling.offsetHeight:0),this.scrollTop(Math.max(0,e-this.$el.height()))},e.prototype.scrollTop=function(t){var e;return e=this.context.getOpt("scrollDuration"),e?this.$elUl.animate({scrollTop:t},e):this.$elUl.scrollTop(t)},e.prototype.show=function(){var t;return this.stopShowing?void(this.stopShowing=!1):(this.visible()||(this.$el.show(),this.$el.scrollTop(0),this.context.trigger("shown")),(t=this.context.rect())?this.reposition(t):void 0)},e.prototype.hide=function(t,e){var i;if(this.visible())return isNaN(e)?(this.$el.hide(),this.context.trigger("hidden",[t])):(i=function(t){return function(){return t.hide()}}(this),clearTimeout(this.timeoutID),this.timeoutID=setTimeout(i,e))},e.prototype.render=function(e){var i,n,r,o,s,a,h;if(!(t.isArray(e)&&e.length>0))return void this.hide();for(this.$el.find("ul").empty(),n=this.$el.find("ul"),h=this.context.getOpt("displayTpl"),r=0,s=e.length;s>r;r++)o=e[r],o=t.extend({},o,{"atwho-at":this.context.at}),a=this.context.callbacks("tplEval").call(this.context,h,o,"onDisplay"),i=t(this.context.callbacks("highlighter").call(this.context,a,this.context.query.text)),i.data("item-data",o),n.append(i);return this.show(),this.context.getOpt("highlightFirst")?n.find("li:first").addClass("cur"):void 0},e}();var p;p={load:function(t,e){var i;return(i=this.controller(t))?i.model.load(e):void 0},isSelecting:function(){var t;return!!(null!=(t=this.controller())?t.view.visible():void 0)},hide:function(){var t;return null!=(t=this.controller())?t.view.hide():void 0},reposition:function(){var t;return(t=this.controller())?t.view.reposition(t.rect()):void 0},setIframe:function(t,e){return this.setupRootElement(t,e),null},run:function(){return this.dispatch()},destroy:function(){return this.shutdown(),this.$inputor.data("atwho",null)}},t.fn.atwho=function(e){var i,r;return i=arguments,r=null,this.filter('textarea, input, [contenteditable=""], [contenteditable=true]').each(function(){var o,s;return(s=(o=t(this)).data("atwho"))||o.data("atwho",s=new n(this)),"object"!=typeof e&&e?p[e]&&s?r=p[e].apply(s,Array.prototype.slice.call(i,1)):t.error("Method "+e+" does not exist on jQuery.atwho"):s.reg(e.at,e)}),null!=r?r:this},t.fn.atwho["default"]={at:void 0,alias:void 0,data:null,displayTpl:"
  • ${name}
  • ",insertTpl:"${atwho-at}${name}",headerTpl:null,callbacks:e,searchKey:"name",suffix:void 0,hideWithoutSuffix:!1,startWithSpace:!0,acceptSpaceBar:!1,highlightFirst:!0,limit:5,maxLen:20,minLen:0,displayTimeout:300,delay:null,spaceSelectsMatch:!1,tabSelectsMatch:!0,editableAtwhoQueryAttrs:{},scrollDuration:150,suspendOnComposing:!0,lookUpOnClick:!0},t.fn.atwho.debug=!1}); \ No newline at end of file +!function(t,e){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t)}):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(this,function(t){var e,i;i={ESC:27,TAB:9,ENTER:13,CTRL:17,A:65,P:80,N:78,LEFT:37,UP:38,RIGHT:39,DOWN:40,BACKSPACE:8,SPACE:32},e={beforeSave:function(t){return r.arrayToDefaultHash(t)},matcher:function(t,e,i,n){var r,o,s,a,h;return t=t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),i&&(t="(?:^|\\s)"+t),r=decodeURI("%C3%80"),o=decodeURI("%C3%BF"),h=n?" ":"",a=new RegExp(t+"([A-Za-z"+r+"-"+o+"0-9_"+h+"'.+-]*)$|"+t+"([^\\x00-\\xff]*)$","gi"),s=a.exec(e),s?s[2]||s[1]:null},filter:function(t,e,i){var n,r,o,s;for(n=[],r=0,s=e.length;s>r;r++)o=e[r],~new String(o[i]).toLowerCase().indexOf(t.toLowerCase())&&n.push(o);return n},remoteFilter:null,sorter:function(t,e,i){var n,r,o,s;if(!t)return e;for(n=[],r=0,s=e.length;s>r;r++)o=e[r],o.atwho_order=new String(o[i]).toLowerCase().indexOf(t.toLowerCase()),o.atwho_order>-1&&n.push(o);return n.sort(function(t,e){return t.atwho_order-e.atwho_order})},tplEval:function(t,e){var i,n,r;r=t;try{return"string"!=typeof t&&(r=t(e)),r.replace(/\$\{([^\}]*)\}/g,function(t,i,n){return e[i]})}catch(n){return i=n,""}},highlighter:function(t,e){var i;return e?(i=new RegExp(">\\s*([^<]*?)("+e.replace("+","\\+")+")([^<]*)\\s*<","ig"),t.replace(i,function(t,e,i,n){return"> "+e+""+i+""+n+" <"})):t},beforeInsert:function(t,e,i){return t},beforeReposition:function(t){return t},afterMatchFailed:function(t,e){}};var n;n=function(){function e(e){this.currentFlag=null,this.controllers={},this.aliasMaps={},this.$inputor=t(e),this.setupRootElement(),this.listen()}return e.prototype.createContainer=function(e){var i;return null!=(i=this.$el)&&i.remove(),t(e.body).append(this.$el=t("
    "))},e.prototype.setupRootElement=function(e,i){var n,r;if(null==i&&(i=!1),e)this.window=e.contentWindow,this.document=e.contentDocument||this.window.document,this.iframe=e;else{this.document=this.$inputor[0].ownerDocument,this.window=this.document.defaultView||this.document.parentWindow;try{this.iframe=this.window.frameElement}catch(r){if(n=r,this.iframe=null,t.fn.atwho.debug)throw new Error("iframe auto-discovery is failed.\nPlease use `setIframe` to set the target iframe manually.\n"+n)}}return this.createContainer((this.iframeAsRoot=i)?this.document:document)},e.prototype.controller=function(t){var e,i,n,r;if(this.aliasMaps[t])i=this.controllers[this.aliasMaps[t]];else{r=this.controllers;for(n in r)if(e=r[n],n===t){i=e;break}}return i?i:this.controllers[this.currentFlag]},e.prototype.setContextFor=function(t){return this.currentFlag=t,this},e.prototype.reg=function(t,e){var i,n;return n=(i=this.controllers)[t]||(i[t]=this.$inputor.is("[contentEditable]")?new l(this,t):new s(this,t)),e.alias&&(this.aliasMaps[e.alias]=t),n.init(e),this},e.prototype.listen=function(){return this.$inputor.on("compositionstart",function(t){return function(e){var i;return null!=(i=t.controller())&&i.view.hide(),t.isComposing=!0,null}}(this)).on("compositionend",function(t){return function(e){return t.isComposing=!1,setTimeout(function(e){return t.dispatch(e)}),null}}(this)).on("keyup.atwhoInner",function(t){return function(e){return t.onKeyup(e)}}(this)).on("keydown.atwhoInner",function(t){return function(e){return t.onKeydown(e)}}(this)).on("blur.atwhoInner",function(t){return function(e){var i;return(i=t.controller())?(i.expectedQueryCBId=null,i.view.hide(e,i.getOpt("displayTimeout"))):void 0}}(this)).on("click.atwhoInner",function(t){return function(e){return t.dispatch(e)}}(this)).on("scroll.atwhoInner",function(t){return function(){var e;return e=t.$inputor.scrollTop(),function(i){var n,r;return n=i.target.scrollTop,e!==n&&null!=(r=t.controller())&&r.view.hide(i),e=n,!0}}}(this)())},e.prototype.shutdown=function(){var t,e,i;i=this.controllers;for(t in i)e=i[t],e.destroy(),delete this.controllers[t];return this.$inputor.off(".atwhoInner"),this.$el.remove()},e.prototype.dispatch=function(t){var e,i,n,r;n=this.controllers,r=[];for(e in n)i=n[e],r.push(i.lookUp(t));return r},e.prototype.onKeyup=function(e){var n;switch(e.keyCode){case i.ESC:e.preventDefault(),null!=(n=this.controller())&&n.view.hide();break;case i.DOWN:case i.UP:case i.CTRL:case i.ENTER:t.noop();break;case i.P:case i.N:e.ctrlKey||this.dispatch(e);break;default:this.dispatch(e)}},e.prototype.onKeydown=function(e){var n,r;if(r=null!=(n=this.controller())?n.view:void 0,r&&r.visible())switch(e.keyCode){case i.ESC:e.preventDefault(),r.hide(e);break;case i.UP:e.preventDefault(),r.prev();break;case i.DOWN:e.preventDefault(),r.next();break;case i.P:if(!e.ctrlKey)return;e.preventDefault(),r.prev();break;case i.N:if(!e.ctrlKey)return;e.preventDefault(),r.next();break;case i.TAB:case i.ENTER:case i.SPACE:if(!r.visible())return;if(!this.controller().getOpt("spaceSelectsMatch")&&e.keyCode===i.SPACE)return;if(!this.controller().getOpt("tabSelectsMatch")&&e.keyCode===i.TAB)return;r.highlighted()?(e.preventDefault(),r.choose(e)):r.hide(e);break;default:t.noop()}},e}();var r,o=[].slice;r=function(){function i(e,i){this.app=e,this.at=i,this.$inputor=this.app.$inputor,this.id=this.$inputor[0].id||this.uid(),this.expectedQueryCBId=null,this.setting=null,this.query=null,this.pos=0,this.range=null,0===(this.$el=t("#atwho-ground-"+this.id,this.app.$el)).length&&this.app.$el.append(this.$el=t("
    ")),this.model=new u(this),this.view=new c(this)}return i.prototype.uid=function(){return(Math.random().toString(16)+"000000000").substr(2,8)+(new Date).getTime()},i.prototype.init=function(e){return this.setting=t.extend({},this.setting||t.fn.atwho["default"],e),this.view.init(),this.model.reload(this.setting.data)},i.prototype.destroy=function(){return this.trigger("beforeDestroy"),this.model.destroy(),this.view.destroy(),this.$el.remove()},i.prototype.callDefault=function(){var i,n,r,s;s=arguments[0],i=2<=arguments.length?o.call(arguments,1):[];try{return e[s].apply(this,i)}catch(r){return n=r,t.error(n+" Or maybe At.js doesn't have function "+s)}},i.prototype.trigger=function(t,e){var i,n;return null==e&&(e=[]),e.push(this),i=this.getOpt("alias"),n=i?t+"-"+i+".atwho":t+".atwho",this.$inputor.trigger(n,e)},i.prototype.callbacks=function(t){return this.getOpt("callbacks")[t]||e[t]},i.prototype.getOpt=function(t,e){var i,n;try{return this.setting[t]}catch(n){return i=n,null}},i.prototype.insertContentFor=function(e){var i,n;return n=this.getOpt("insertTpl"),i=t.extend({},e.data("item-data"),{"atwho-at":this.at}),this.callbacks("tplEval").call(this,n,i,"onInsert")},i.prototype.renderView=function(t){var e;return e=this.getOpt("searchKey"),t=this.callbacks("sorter").call(this,this.query.text,t.slice(0,1001),e),this.view.render(t.slice(0,this.getOpt("limit")))},i.arrayToDefaultHash=function(e){var i,n,r,o;if(!t.isArray(e))return e;for(o=[],i=0,r=e.length;r>i;i++)n=e[i],t.isPlainObject(n)?o.push(n):o.push({name:n});return o},i.prototype.lookUp=function(t){var e,i;if((!t||"click"!==t.type||this.getOpt("lookUpOnClick"))&&(!this.getOpt("suspendOnComposing")||!this.app.isComposing))return(e=this.catchQuery(t))?(this.app.setContextFor(this.at),(i=this.getOpt("delay"))?this._delayLookUp(e,i):this._lookUp(e),e):(this.expectedQueryCBId=null,e)},i.prototype._delayLookUp=function(t,e){var i,n;return i=Date.now?Date.now():(new Date).getTime(),this.previousCallTime||(this.previousCallTime=i),n=e-(i-this.previousCallTime),n>0&&e>n?(this.previousCallTime=i,this._stopDelayedCall(),this.delayedCallTimeout=setTimeout(function(e){return function(){return e.previousCallTime=0,e.delayedCallTimeout=null,e._lookUp(t)}}(this),e)):(this._stopDelayedCall(),this.previousCallTime!==i&&(this.previousCallTime=0),this._lookUp(t))},i.prototype._stopDelayedCall=function(){return this.delayedCallTimeout?(clearTimeout(this.delayedCallTimeout),this.delayedCallTimeout=null):void 0},i.prototype._generateQueryCBId=function(){return{}},i.prototype._lookUp=function(e){var i;return i=function(t,e){return t===this.expectedQueryCBId?e&&e.length>0?this.renderView(this.constructor.arrayToDefaultHash(e)):this.view.hide():void 0},this.expectedQueryCBId=this._generateQueryCBId(),this.model.query(e.text,t.proxy(i,this,this.expectedQueryCBId))},i}();var s,a=function(t,e){function i(){this.constructor=t}for(var n in e)h.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},h={}.hasOwnProperty;s=function(e){function i(){return i.__super__.constructor.apply(this,arguments)}return a(i,e),i.prototype.catchQuery=function(){var t,e,i,n,r,o,s;return e=this.$inputor.val(),t=this.$inputor.caret("pos",{iframe:this.app.iframe}),s=e.slice(0,t),r=this.callbacks("matcher").call(this,this.at,s,this.getOpt("startWithSpace"),this.getOpt("acceptSpaceBar")),n="string"==typeof r,n&&r.length0?t.getRangeAt(0):void 0},n.prototype._setRange=function(e,i,n){return null==n&&(n=this._getRange()),n&&i?(i=t(i)[0],"after"===e?(n.setEndAfter(i),n.setStartAfter(i)):(n.setEndBefore(i),n.setStartBefore(i)),n.collapse(!1),this._clearRange(n)):void 0},n.prototype._clearRange=function(t){var e;return null==t&&(t=this._getRange()),e=this.app.window.getSelection(),null==this.ctrl_a_pressed?(e.removeAllRanges(),e.addRange(t)):void 0},n.prototype._movingEvent=function(t){var e;return"click"===t.type||(e=t.which)===i.RIGHT||e===i.LEFT||e===i.UP||e===i.DOWN},n.prototype._unwrap=function(e){var i;return e=t(e).unwrap().get(0),(i=e.nextSibling)&&i.nodeValue&&(e.nodeValue+=i.nodeValue,t(i).remove()),e},n.prototype.catchQuery=function(e){var n,r,o,s,a,h,l,u,c,p,f,d;if((d=this._getRange())&&d.collapsed){if(e.which===i.ENTER)return(r=t(d.startContainer).closest(".atwho-query")).contents().unwrap(),r.is(":empty")&&r.remove(),(r=t(".atwho-query",this.app.document)).text(r.text()).contents().last().unwrap(),void this._clearRange();if(/firefox/i.test(navigator.userAgent)){if(t(d.startContainer).is(this.$inputor))return void this._clearRange();e.which===i.BACKSPACE&&d.startContainer.nodeType===document.ELEMENT_NODE&&(c=d.startOffset-1)>=0?(o=d.cloneRange(),o.setStart(d.startContainer,c),t(o.cloneContents()).contents().last().is(".atwho-inserted")&&(a=t(d.startContainer).contents().get(c),this._setRange("after",t(a).contents().last()))):e.which===i.LEFT&&d.startContainer.nodeType===document.TEXT_NODE&&(n=t(d.startContainer.previousSibling),n.is(".atwho-inserted")&&0===d.startOffset&&this._setRange("after",n.contents().last()))}if(t(d.startContainer).closest(".atwho-inserted").addClass("atwho-query").siblings().removeClass("atwho-query"),(r=t(".atwho-query",this.app.document)).length>0&&r.is(":empty")&&0===r.text().length&&r.remove(),this._movingEvent(e)||r.removeClass("atwho-inserted"),r.length>0)switch(e.which){case i.LEFT:return this._setRange("before",r.get(0),d),void r.removeClass("atwho-query");case i.RIGHT:return this._setRange("after",r.get(0).nextSibling,d),void r.removeClass("atwho-query")}if(r.length>0&&(f=r.attr("data-atwho-at-query"))&&(r.empty().html(f).attr("data-atwho-at-query",null),this._setRange("after",r.get(0),d)),o=d.cloneRange(),o.setStart(d.startContainer,0),u=this.callbacks("matcher").call(this,this.at,o.toString(),this.getOpt("startWithSpace"),this.getOpt("acceptSpaceBar")),h="string"==typeof u,0===r.length&&h&&(s=d.startOffset-this.at.length-u.length)>=0&&(d.setStart(d.startContainer,s),r=t("",this.app.document).attr(this.getOpt("editableAtwhoQueryAttrs")).addClass("atwho-query"),d.surroundContents(r.get(0)),l=r.contents().last().get(0),l&&(/firefox/i.test(navigator.userAgent)?(d.setStart(l,l.length),d.setEnd(l,l.length),this._clearRange(d)):this._setRange("after",l,d))),!(h&&u.length=0&&(this._movingEvent(e)&&r.hasClass("atwho-inserted")?r.removeClass("atwho-query"):!1!==this.callbacks("afterMatchFailed").call(this,this.at,r)&&this._setRange("after",this._unwrap(r.text(r.text()).contents().first()))),null)}},n.prototype.rect=function(){var e,i,n;return n=this.query.el.offset(),n&&this.query.el[0].getClientRects().length?(this.app.iframe&&!this.app.iframeAsRoot&&(i=(e=t(this.app.iframe)).offset(),n.left+=i.left-this.$inputor.scrollLeft(),n.top+=i.top-this.$inputor.scrollTop()),n.bottom=n.top+this.query.el.height(),n):void 0},n.prototype.insert=function(t,e){var i,n,r,o,s;return this.$inputor.is(":focus")||this.$inputor.focus(),n=this.getOpt("functionOverrides"),n.insert?n.insert.call(this,t,e):(o=""===(o=this.getOpt("suffix"))?o:o||" ",i=e.data("item-data"),this.query.el.removeClass("atwho-query").addClass("atwho-inserted").html(t).attr("data-atwho-at-query",""+i["atwho-at"]+this.query.text).attr("contenteditable","false"),(r=this._getRange())&&(this.query.el.length&&r.setEndAfter(this.query.el[0]),r.collapse(!1),r.insertNode(s=this.app.document.createTextNode(""+o)),this._setRange("after",s,r)),this.$inputor.is(":focus")||this.$inputor.focus(),this.$inputor.change())},n}(r);var u;u=function(){function e(t){this.context=t,this.at=this.context.at,this.storage=this.context.$inputor}return e.prototype.destroy=function(){return this.storage.data(this.at,null)},e.prototype.saved=function(){return this.fetch()>0},e.prototype.query=function(t,e){var i,n,r;return n=this.fetch(),r=this.context.getOpt("searchKey"),n=this.context.callbacks("filter").call(this.context,t,n,r)||[],i=this.context.callbacks("remoteFilter"),n.length>0||!i&&0===n.length?e(n):i.call(this.context,t,e)},e.prototype.fetch=function(){return this.storage.data(this.at)||[]},e.prototype.save=function(t){return this.storage.data(this.at,this.context.callbacks("beforeSave").call(this.context,t||[]))},e.prototype.load=function(t){return!this.saved()&&t?this._load(t):void 0},e.prototype.reload=function(t){return this._load(t)},e.prototype._load=function(e){return"string"==typeof e?t.ajax(e,{dataType:"json"}).done(function(t){return function(e){return t.save(e)}}(this)):this.save(e)},e}();var c;c=function(){function e(e){this.context=e,this.$el=t("
      "),this.$elUl=this.$el.children(),this.timeoutID=null,this.context.$el.append(this.$el),this.bindEvent()}return e.prototype.init=function(){var t,e;return e=this.context.getOpt("alias")||this.context.at.charCodeAt(0),t=this.context.getOpt("headerTpl"),t&&1===this.$el.children().length&&this.$el.prepend(t),this.$el.attr({id:"at-view-"+e})},e.prototype.destroy=function(){return this.$el.remove()},e.prototype.bindEvent=function(){var e,i,n;return e=this.$el.find("ul"),i=0,n=0,e.on("mousemove.atwho-view","li",function(r){return function(r){var o;if((i!==r.clientX||n!==r.clientY)&&(i=r.clientX,n=r.clientY,o=t(r.currentTarget),!o.hasClass("cur")))return e.find(".cur").removeClass("cur"),o.addClass("cur")}}(this)).on("click.atwho-view","li",function(i){return function(n){return e.find(".cur").removeClass("cur"),t(n.currentTarget).addClass("cur"),i.choose(n),n.preventDefault()}}(this))},e.prototype.visible=function(){return t.expr.filters.visible(this.$el[0])},e.prototype.highlighted=function(){return this.$el.find(".cur").length>0},e.prototype.choose=function(t){var e,i;return(e=this.$el.find(".cur")).length&&(i=this.context.insertContentFor(e),this.context._stopDelayedCall(),this.context.insert(this.context.callbacks("beforeInsert").call(this.context,i,e,t),e),this.context.trigger("inserted",[e,t]),this.hide(t)),this.context.getOpt("hideWithoutSuffix")?this.stopShowing=!0:void 0},e.prototype.reposition=function(e){var i,n,r,o;return i=this.context.app.iframeAsRoot?this.context.app.window:window,e.bottom+this.$el.height()-t(i).scrollTop()>t(i).height()&&(e.bottom=e.top-this.$el.height()),e.left>(r=t(i).width()-this.$el.width()-5)&&(e.left=r),n={left:e.left,top:e.bottom},null!=(o=this.context.callbacks("beforeReposition"))&&o.call(this.context,n),this.$el.offset(n),this.context.trigger("reposition",[n])},e.prototype.next=function(){var t,e,i,n;return t=this.$el.find(".cur").removeClass("cur"),e=t.next(),e.length||(e=this.$el.find("li:first")),e.addClass("cur"),i=e[0],n=i.offsetTop+i.offsetHeight+(i.nextSibling?i.nextSibling.offsetHeight:0),this.scrollTop(Math.max(0,n-this.$el.height()))},e.prototype.prev=function(){var t,e,i,n;return t=this.$el.find(".cur").removeClass("cur"),i=t.prev(),i.length||(i=this.$el.find("li:last")),i.addClass("cur"),n=i[0],e=n.offsetTop+n.offsetHeight+(n.nextSibling?n.nextSibling.offsetHeight:0),this.scrollTop(Math.max(0,e-this.$el.height()))},e.prototype.scrollTop=function(t){var e;return e=this.context.getOpt("scrollDuration"),e?this.$elUl.animate({scrollTop:t},e):this.$elUl.scrollTop(t)},e.prototype.show=function(){var t;return this.stopShowing?void(this.stopShowing=!1):(this.visible()||(this.$el.show(),this.$el.scrollTop(0),this.context.trigger("shown")),(t=this.context.rect())?this.reposition(t):void 0)},e.prototype.hide=function(t,e){var i;if(this.visible())return isNaN(e)?(this.$el.hide(),this.context.trigger("hidden",[t])):(i=function(t){return function(){return t.hide()}}(this),clearTimeout(this.timeoutID),this.timeoutID=setTimeout(i,e))},e.prototype.render=function(e){var i,n,r,o,s,a,h;if(!(t.isArray(e)&&e.length>0))return void this.hide();for(this.$el.find("ul").empty(),n=this.$el.find("ul"),h=this.context.getOpt("displayTpl"),r=0,s=e.length;s>r;r++)o=e[r],o=t.extend({},o,{"atwho-at":this.context.at}),a=this.context.callbacks("tplEval").call(this.context,h,o,"onDisplay"),i=t(this.context.callbacks("highlighter").call(this.context,a,this.context.query.text)),i.data("item-data",o),n.append(i);return this.show(),this.context.getOpt("highlightFirst")?n.find("li:first").addClass("cur"):void 0},e}();var p;p={load:function(t,e){var i;return(i=this.controller(t))?i.model.load(e):void 0},isSelecting:function(){var t;return!!(null!=(t=this.controller())?t.view.visible():void 0)},hide:function(){var t;return null!=(t=this.controller())?t.view.hide():void 0},reposition:function(){var t;return(t=this.controller())?t.view.reposition(t.rect()):void 0},setIframe:function(t,e){return this.setupRootElement(t,e),null},run:function(){return this.dispatch()},destroy:function(){return this.shutdown(),this.$inputor.data("atwho",null)}},t.fn.atwho=function(e){var i,r;return i=arguments,r=null,this.filter('textarea, input, [contenteditable=""], [contenteditable=true]').each(function(){var o,s;return(s=(o=t(this)).data("atwho"))||o.data("atwho",s=new n(this)),"object"!=typeof e&&e?p[e]&&s?r=p[e].apply(s,Array.prototype.slice.call(i,1)):t.error("Method "+e+" does not exist on jQuery.atwho"):s.reg(e.at,e)}),null!=r?r:this},t.fn.atwho["default"]={at:void 0,alias:void 0,data:null,displayTpl:"
    • ${name}
    • ",insertTpl:"${atwho-at}${name}",headerTpl:null,callbacks:e,functionOverrides:{},searchKey:"name",suffix:void 0,hideWithoutSuffix:!1,startWithSpace:!0,acceptSpaceBar:!1,highlightFirst:!0,limit:5,maxLen:20,minLen:0,displayTimeout:300,delay:null,spaceSelectsMatch:!1,tabSelectsMatch:!0,editableAtwhoQueryAttrs:{},scrollDuration:150,suspendOnComposing:!0,lookUpOnClick:!0},t.fn.atwho.debug=!1}); \ No newline at end of file diff --git a/static/assets/60150af8/examples/cross_document/dataFrame.html b/static/assets/80d9ad70/examples/cross_document/dataFrame.html similarity index 100% rename from static/assets/60150af8/examples/cross_document/dataFrame.html rename to static/assets/80d9ad70/examples/cross_document/dataFrame.html diff --git a/static/assets/60150af8/examples/cross_document/index.html b/static/assets/80d9ad70/examples/cross_document/index.html similarity index 100% rename from static/assets/60150af8/examples/cross_document/index.html rename to static/assets/80d9ad70/examples/cross_document/index.html diff --git a/static/assets/60150af8/examples/cross_document/viewFrame.html b/static/assets/80d9ad70/examples/cross_document/viewFrame.html similarity index 100% rename from static/assets/60150af8/examples/cross_document/viewFrame.html rename to static/assets/80d9ad70/examples/cross_document/viewFrame.html diff --git a/static/assets/60150af8/examples/hashtags.html b/static/assets/80d9ad70/examples/hashtags.html similarity index 100% rename from static/assets/60150af8/examples/hashtags.html rename to static/assets/80d9ad70/examples/hashtags.html diff --git a/static/assets/60150af8/examples/medium-editor.html b/static/assets/80d9ad70/examples/medium-editor.html similarity index 100% rename from static/assets/60150af8/examples/medium-editor.html rename to static/assets/80d9ad70/examples/medium-editor.html diff --git a/static/assets/60150af8/examples/style.css b/static/assets/80d9ad70/examples/style.css similarity index 100% rename from static/assets/60150af8/examples/style.css rename to static/assets/80d9ad70/examples/style.css diff --git a/static/assets/60150af8/examples/tinyMCE.html b/static/assets/80d9ad70/examples/tinyMCE.html similarity index 100% rename from static/assets/60150af8/examples/tinyMCE.html rename to static/assets/80d9ad70/examples/tinyMCE.html diff --git a/static/assets/60150af8/examples/ueditor.html b/static/assets/80d9ad70/examples/ueditor.html similarity index 100% rename from static/assets/60150af8/examples/ueditor.html rename to static/assets/80d9ad70/examples/ueditor.html diff --git a/static/assets/60150af8/gulpfile.js b/static/assets/80d9ad70/gulpfile.js similarity index 98% rename from static/assets/60150af8/gulpfile.js rename to static/assets/80d9ad70/gulpfile.js index a757678668..e9699eab8d 100644 --- a/static/assets/60150af8/gulpfile.js +++ b/static/assets/80d9ad70/gulpfile.js @@ -43,7 +43,7 @@ gulp.task('umd', function() { gulp.task('bump', function() { gulp.src(['bower.json', 'component.json', 'package.json']) - .pipe(bump({version: "1.5.3"})) + .pipe(bump({version: "1.5.4"})) .pipe(gulp.dest('./')); }); diff --git a/static/assets/60150af8/index.html b/static/assets/80d9ad70/index.html similarity index 100% rename from static/assets/60150af8/index.html rename to static/assets/80d9ad70/index.html diff --git a/static/assets/60150af8/package.json b/static/assets/80d9ad70/package.json similarity index 95% rename from static/assets/60150af8/package.json rename to static/assets/80d9ad70/package.json index 129f0854b3..46d8d41cfa 100644 --- a/static/assets/60150af8/package.json +++ b/static/assets/80d9ad70/package.json @@ -7,7 +7,7 @@ }, "homepage": "http://ichord.github.com/At.js", "license": "MIT", - "version": "1.5.3", + "version": "1.5.4", "repository": { "type": "git", "url": "https://github.com/ichord/At.js" @@ -19,7 +19,7 @@ "test": "gulp test" }, "peerDependencies": { - "jquery": "^1.7.0" + "jquery": ">=1.7.0 <4.0.0" }, "devDependencies": { "gulp": "^3.9.0", diff --git a/static/assets/60150af8/specRunner.html b/static/assets/80d9ad70/specRunner.html similarity index 100% rename from static/assets/60150af8/specRunner.html rename to static/assets/80d9ad70/specRunner.html diff --git a/static/assets/60150af8/src/api.coffee b/static/assets/80d9ad70/src/api.coffee similarity index 98% rename from static/assets/60150af8/src/api.coffee rename to static/assets/80d9ad70/src/api.coffee index 236b82faea..2e208d3e65 100644 --- a/static/assets/60150af8/src/api.coffee +++ b/static/assets/80d9ad70/src/api.coffee @@ -37,6 +37,7 @@ $.fn.atwho.default = insertTpl: "${atwho-at}${name}" headerTpl: null callbacks: DEFAULT_CALLBACKS + functionOverrides: {} searchKey: "name" suffix: undefined hideWithoutSuffix: no diff --git a/static/assets/60150af8/src/app.coffee b/static/assets/80d9ad70/src/app.coffee similarity index 100% rename from static/assets/60150af8/src/app.coffee rename to static/assets/80d9ad70/src/app.coffee diff --git a/static/assets/60150af8/src/controller.coffee b/static/assets/80d9ad70/src/controller.coffee similarity index 100% rename from static/assets/60150af8/src/controller.coffee rename to static/assets/80d9ad70/src/controller.coffee diff --git a/static/assets/60150af8/src/default.coffee b/static/assets/80d9ad70/src/default.coffee similarity index 100% rename from static/assets/60150af8/src/default.coffee rename to static/assets/80d9ad70/src/default.coffee diff --git a/static/assets/60150af8/src/editableController.coffee b/static/assets/80d9ad70/src/editableController.coffee similarity index 94% rename from static/assets/60150af8/src/editableController.coffee rename to static/assets/80d9ad70/src/editableController.coffee index 506ace750e..d6fcaeb799 100644 --- a/static/assets/60150af8/src/editableController.coffee +++ b/static/assets/80d9ad70/src/editableController.coffee @@ -138,7 +138,9 @@ class EditableController extends Controller # @return [Hash] the offset which look likes this: {top: y, left: x, bottom: bottom} rect: -> rect = @query.el.offset() - return unless rect + # do not use {top: 0, left: 0} from jQuery when element is hidden + # happens every other time the menu is displayed on click in contenteditable + return unless rect and @query.el[0].getClientRects().length if @app.iframe and not @app.iframeAsRoot iframeOffset = ($iframe = $ @app.iframe).offset() rect.left += iframeOffset.left - @$inputor.scrollLeft() @@ -151,6 +153,9 @@ class EditableController extends Controller # @param content [String] string to insert insert: (content, $li) -> @$inputor.focus() unless @$inputor.is ':focus' + overrides = @getOpt 'functionOverrides' + if overrides.insert + return overrides.insert.call this, content, $li suffix = if (suffix = @getOpt 'suffix') == "" then suffix else suffix or "\u00A0" data = $li.data('item-data') @query.el diff --git a/static/assets/60150af8/src/jquery.atwho.css b/static/assets/80d9ad70/src/jquery.atwho.css similarity index 100% rename from static/assets/60150af8/src/jquery.atwho.css rename to static/assets/80d9ad70/src/jquery.atwho.css diff --git a/static/assets/60150af8/src/model.coffee b/static/assets/80d9ad70/src/model.coffee similarity index 100% rename from static/assets/60150af8/src/model.coffee rename to static/assets/80d9ad70/src/model.coffee diff --git a/static/assets/60150af8/src/textareaController.coffee b/static/assets/80d9ad70/src/textareaController.coffee similarity index 100% rename from static/assets/60150af8/src/textareaController.coffee rename to static/assets/80d9ad70/src/textareaController.coffee diff --git a/static/assets/60150af8/src/view.coffee b/static/assets/80d9ad70/src/view.coffee similarity index 100% rename from static/assets/60150af8/src/view.coffee rename to static/assets/80d9ad70/src/view.coffee diff --git a/static/assets/60150af8/umd.template.js b/static/assets/80d9ad70/umd.template.js similarity index 100% rename from static/assets/60150af8/umd.template.js rename to static/assets/80d9ad70/umd.template.js diff --git a/static/assets/e6a3d4d7/LICENSE.md b/static/assets/d0eb0089/LICENSE.md similarity index 100% rename from static/assets/e6a3d4d7/LICENSE.md rename to static/assets/d0eb0089/LICENSE.md diff --git a/static/assets/e6a3d4d7/Makefile b/static/assets/d0eb0089/Makefile similarity index 100% rename from static/assets/e6a3d4d7/Makefile rename to static/assets/d0eb0089/Makefile diff --git a/static/assets/e6a3d4d7/README.md b/static/assets/d0eb0089/README.md similarity index 93% rename from static/assets/e6a3d4d7/README.md rename to static/assets/d0eb0089/README.md index c4fb5aa6f3..5ff3d098a7 100644 --- a/static/assets/e6a3d4d7/README.md +++ b/static/assets/d0eb0089/README.md @@ -69,9 +69,9 @@ Supports plain strings, `text/html`, and DOM nodes | Only supports plain strings 1.5KB minimized + gzipped | 2.9KB minimized + gzipped Doesn't change document selection | Clears document selection Only an imperative API (`clipboard.copy()`) | Declarative DOM-based API -Uses `Promise`s | - -Supports paste (in IE) | - -- | Offers a fallback prompt (`Press Ctrl+C to copy`) +Uses `Promise`s | --- +Supports paste (in IE) | --- +--- | Offers a fallback prompt (`Press Ctrl+C to copy`) ## This is way too complicated! diff --git a/static/assets/e6a3d4d7/bower.json b/static/assets/d0eb0089/bower.json similarity index 95% rename from static/assets/e6a3d4d7/bower.json rename to static/assets/d0eb0089/bower.json index 29458974c3..adc4266387 100644 --- a/static/assets/e6a3d4d7/bower.json +++ b/static/assets/d0eb0089/bower.json @@ -1,7 +1,7 @@ { "name": "clipboard.js", "main": "clipboard.js", - "version": "0.3.3", + "version": "0.3.5", "homepage": "https://github.com/lgarron/clipboard.js", "authors": [ "code@garron.net" diff --git a/static/assets/e6a3d4d7/clipboard.js b/static/assets/d0eb0089/clipboard.js similarity index 97% rename from static/assets/e6a3d4d7/clipboard.js rename to static/assets/d0eb0089/clipboard.js index 98fb57da8d..645ce41521 100644 --- a/static/assets/e6a3d4d7/clipboard.js +++ b/static/assets/d0eb0089/clipboard.js @@ -67,8 +67,10 @@ _data = {"text/plain": data}; } else if (data instanceof Node) { _data = {"text/html": new XMLSerializer().serializeToString(data)}; - } else { + } else if (data instanceof Object){ _data = data; + } else { + reject("Invalid data type. Must be string, DOM node, or an object mapping MIME types to strings.") } function triggerCopy(tryBogusSelect) { @@ -84,6 +86,7 @@ bogusSelect(); triggerCopy(true); } else { + cleanup(); throw new Error("Unable to copy. Perhaps it's not available in your browser?"); } } diff --git a/static/assets/d0eb0089/clipboard.min.js b/static/assets/d0eb0089/clipboard.min.js new file mode 100644 index 0000000000..0f4ca9a5d5 --- /dev/null +++ b/static/assets/d0eb0089/clipboard.min.js @@ -0,0 +1,9 @@ +(function(e,c){"undefined"!==typeof module?module.exports=c():"function"===typeof define&&"object"===typeof define.amd?define(c):this[e]=c()})("clipboard",function(){if("undefined"===typeof document||!document.addEventListener)return null;var e={};e.copy=function(){function c(){d=!1;b=null;g&&window.getSelection().removeAllRanges();g=!1}var d=!1,b=null,g=!1;document.addEventListener("copy",function(c){if(d){for(var g in b)c.clipboardData.setData(g,b[g]);c.preventDefault()}});return function(f){return new Promise(function(m, +e){function k(b){try{if(document.execCommand("copy"))c(),m();else{if(b)throw c(),Error("Unable to copy. Perhaps it's not available in your browser?");var d=document.getSelection();if(!document.queryCommandEnabled("copy")&&d.isCollapsed){var f=document.createRange();f.selectNodeContents(document.body);d.removeAllRanges();d.addRange(f);g=!0}k(!0)}}catch(a){c(),e(a)}}d=!0;"string"===typeof f?b={"text/plain":f}:f instanceof Node?b={"text/html":(new XMLSerializer).serializeToString(f)}:f instanceof Object? +b=f:e("Invalid data type. Must be string, DOM node, or an object mapping MIME types to strings.");k(!1)})}}();e.paste=function(){var c=!1,d,b;document.addEventListener("paste",function(g){if(c){c=!1;g.preventDefault();var f=d;d=null;f(g.clipboardData.getData(b))}});return function(g){return new Promise(function(f,e){c=!0;d=f;b=g||"text/plain";try{document.execCommand("paste")||(c=!1,e(Error("Unable to paste. Pasting only works in Internet Explorer at the moment.")))}catch(h){c=!1,e(Error(h))}})}}(); +"undefined"===typeof ClipboardEvent&&"undefined"!==typeof window.clipboardData&&"undefined"!==typeof window.clipboardData.setData&&(function(c){function d(a,b){return function(){a.apply(b,arguments)}}function b(a){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._value=this._state=null;this._deferreds=[];l(a,d(f,this),d(e,this))}function g(a){var b=this;return null===this._state?void this._deferreds.push(a): +void n(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function f(a){try{if(a===this)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"==typeof a||"function"==typeof a)){var b=a.then;if("function"==typeof b)return void l(d(b,a),d(f,this),d(e,this))}this._state=!0;this._value=a;h.call(this)}catch(c){e.call(this,c)}}function e(a){this._state= +!1;this._value=a;h.call(this)}function h(){for(var a=0,b=this._deferreds.length;b>a;a++)g.call(this,this._deferreds[a]);this._deferreds=null}function k(a,b,c,d){this.onFulfilled="function"==typeof a?a:null;this.onRejected="function"==typeof b?b:null;this.resolve=c;this.reject=d}function l(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){d||(d=!0,c(e))}}var n=b.immediateFn||"function"==typeof setImmediate&&setImmediate||function(a){setTimeout(a,1)},p=Array.isArray|| +function(a){return"[object Array]"===Object.prototype.toString.call(a)};b.prototype["catch"]=function(a){return this.then(null,a)};b.prototype.then=function(a,c){var d=this;return new b(function(b,e){g.call(d,new k(a,c,b,e))})};b.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&p(arguments[0])?arguments[0]:arguments);return new b(function(b,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f, +a)},c)}a[f]=g;0===--e&&b(a)}catch(k){c(k)}}if(0===a.length)return b([]);for(var e=a.length,f=0;fd;d++)a[d].then(b,c)})};"undefined"!=typeof module&&module.exports?module.exports=b:c.Promise||(c.Promise=b)}(this),e.copy=function(c){return new Promise(function(d, +b){if("string"!==typeof c&&!("text/plain"in c))throw Error("You must provide a text/plain type.");window.clipboardData.setData("Text","string"===typeof c?c:c["text/plain"])?d():b(Error("Copying was rejected."))})},e.paste=function(){return new Promise(function(c,d){var b=window.clipboardData.getData("Text");b?c(b):d(Error("Pasting was rejected."))})});return e}); diff --git a/static/assets/e6a3d4d7/index.css b/static/assets/d0eb0089/index.css similarity index 100% rename from static/assets/e6a3d4d7/index.css rename to static/assets/d0eb0089/index.css diff --git a/static/assets/e6a3d4d7/package.json b/static/assets/d0eb0089/package.json similarity index 96% rename from static/assets/e6a3d4d7/package.json rename to static/assets/d0eb0089/package.json index 0fc1dc3a18..2cca2ac876 100644 --- a/static/assets/e6a3d4d7/package.json +++ b/static/assets/d0eb0089/package.json @@ -1,6 +1,6 @@ { "name": "clipboard-js", - "version": "0.3.3", + "version": "0.3.5", "description": "A web shim to handle clipboard APIs across browsers using a simple Promise API.", "main": "clipboard.js", "dependencies": { diff --git a/static/assets/e6a3d4d7/clipboard.min.js b/static/assets/e6a3d4d7/clipboard.min.js deleted file mode 100644 index 23376c1c16..0000000000 --- a/static/assets/e6a3d4d7/clipboard.min.js +++ /dev/null @@ -1,9 +0,0 @@ -(function(f,c){"undefined"!==typeof module?module.exports=c():"function"===typeof define&&"object"===typeof define.amd?define(c):this[f]=c()})("clipboard",function(){if("undefined"===typeof document||!document.addEventListener)return null;var f={};f.copy=function(){function c(){d=!1;b=null;e&&window.getSelection().removeAllRanges();e=!1}var d=!1,b=null,e=!1;document.addEventListener("copy",function(c){if(d){for(var e in b)c.clipboardData.setData(e,b[e]);c.preventDefault()}});return function(g){return new Promise(function(k, -f){d=!0;b="string"===typeof g?{"text/plain":g}:g instanceof Node?{"text/html":(new XMLSerializer).serializeToString(g)}:g;try{var n=document.getSelection();if(!document.queryCommandEnabled("copy")&&n.isCollapsed){var l=document.createRange();l.selectNodeContents(document.body);n.addRange(l);e=!0}if(document.execCommand("copy"))c(),k();else throw Error("Unable to copy. Perhaps it's not available in your browser?");}catch(p){c(),f(p)}})}}();f.paste=function(){var c=!1,d,b;document.addEventListener("paste", -function(e){if(c){c=!1;e.preventDefault();var g=d;d=null;g(e.clipboardData.getData(b))}});return function(e){return new Promise(function(g,f){c=!0;d=g;b=e||"text/plain";try{document.execCommand("paste")||(c=!1,f(Error("Unable to paste. Pasting only works in Internet Explorer at the moment.")))}catch(m){c=!1,f(Error(m))}})}}();"undefined"===typeof ClipboardEvent&&"undefined"!==typeof window.clipboardData&&"undefined"!==typeof window.clipboardData.setData&&(function(c){function d(a,b){return function(){a.apply(b, -arguments)}}function b(a){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._value=this._state=null;this._deferreds=[];l(a,d(f,this),d(k,this))}function e(a){var b=this;return null===this._state?void this._deferreds.push(a):void p(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var h;try{h=c(b._value)}catch(d){return void a.reject(d)}a.resolve(h)})} -function f(a){try{if(a===this)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"==typeof a||"function"==typeof a)){var b=a.then;if("function"==typeof b)return void l(d(b,a),d(f,this),d(k,this))}this._state=!0;this._value=a;m.call(this)}catch(c){k.call(this,c)}}function k(a){this._state=!1;this._value=a;m.call(this)}function m(){for(var a=0,b=this._deferreds.length;b>a;a++)e.call(this,this._deferreds[a]);this._deferreds=null}function n(a,b,c,h){this.onFulfilled="function"== -typeof a?a:null;this.onRejected="function"==typeof b?b:null;this.resolve=c;this.reject=h}function l(a,b,c){var h=!1;try{a(function(a){h||(h=!0,b(a))},function(a){h||(h=!0,c(a))})}catch(d){h||(h=!0,c(d))}}var p=b.immediateFn||"function"==typeof setImmediate&&setImmediate||function(a){setTimeout(a,1)},q=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};b.prototype["catch"]=function(a){return this.then(null,a)};b.prototype.then=function(a,c){var d=this;return new b(function(b, -f){e.call(d,new n(a,c,b,f))})};b.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&q(arguments[0])?arguments[0]:arguments);return new b(function(b,c){function d(e,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var k=g.then;if("function"==typeof k)return void k.call(g,function(a){d(e,a)},c)}a[e]=g;0===--f&&b(a)}catch(l){c(l)}}if(0===a.length)return b([]);for(var f=a.length,e=0;ed;d++)a[d].then(b,c)})};"undefined"!=typeof module&&module.exports?module.exports=b:c.Promise||(c.Promise=b)}(this),f.copy=function(c){return new Promise(function(d,b){if("string"!==typeof c&&!("text/plain"in c))throw Error("You must provide a text/plain type.");window.clipboardData.setData("Text","string"===typeof c?c:c["text/plain"])?d():b(Error("Copying was rejected."))})}, -f.paste=function(){return new Promise(function(c,d){var b=window.clipboardData.getData("Text");b?c(b):d(Error("Pasting was rejected."))})});return f}); diff --git a/static/js/all-eccc32c92bade6b693dae47a4a655e11.js b/static/js/all-41d42708f317e2a81704a75f50ab14e5.js similarity index 83% rename from static/js/all-eccc32c92bade6b693dae47a4a655e11.js rename to static/js/all-41d42708f317e2a81704a75f50ab14e5.js index 22c12b436f..58d0cd88b1 100644 --- a/static/js/all-eccc32c92bade6b693dae47a4a655e11.js +++ b/static/js/all-41d42708f317e2a81704a75f50ab14e5.js @@ -213,14 +213,20 @@ function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object http://www.jacklmoore.com/autosize */ !function(a){var b,c={className:"autosizejs",id:"autosizejs",append:"\n",callback:!1,resizeDelay:10,placeholder:!0},d=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent","whiteSpace"],e=a('

      {info}

      ',permalinkFooter:'{buttonClose}{buttonOpen}'};a["export"]({Content:n,templates:o})}),humhub.module("content.container",function(a,b,c){var d=b("client"),e=b("ui.additions"),f=function(b){var f=b.$trigger.data("content-container-id");d.post(b).then(function(a){e.switchButtons(b.$trigger,c('[data-content-container-id="'+f+'"].unfollowButton'))})["catch"](function(b){a.log.error(b,!0)})},g=function(b){var f=b.$trigger.data("content-container-id");d.post(b).then(function(a){e.switchButtons(b.$trigger,c('[data-content-container-id="'+f+'"].followButton'))})["catch"](function(b){a.log.error(b,!0)})},h=function(b){d.post(b).then(function(a){a.success&&(e.switchButtons(b.$trigger,b.$trigger.siblings(".disable")),b.$trigger.siblings(".moduleConfigure").fadeIn("fast")),b.$trigger.data("reload")&&d.reload()})["catch"](function(b){a.log.error(b,!0)})["finally"](function(){b.finish()})},i=function(b){d.post(b).then(function(a){a.success&&(e.switchButtons(b.$trigger,b.$trigger.siblings(".enable")),b.$trigger.siblings(".moduleConfigure").fadeOut("fast")),b.$trigger.data("reload")&&d.reload()})["catch"](function(b){a.log.error(b,!0)})["finally"](function(){b.finish()})};a["export"]({follow:f,unfollow:g,enableModule:h,disableModule:i})}),/*! +humhub.module("notification",function(a,b,c){var d=b("util"),e=d.object,f=d.string,g=b("ui.widget").Widget,h=b("event"),i=b("client"),j=b("ui.view"),k=b("user");a.initOnPjaxLoad=!0;var l=function(a,b){g.call(this,a,b)};e.inherits(l,g),l.prototype.init=function(a){this.isOpen=!1,this.lastEntryLoaded=!1,this.lastEntryId=0,this.originalTitle=document.title,this.initDropdown(),this.handleResult(a);var b=this;h.on("humhub:modules:notification:live:NewNotification",function(a,c,d){var e=b.$.data("notification-count")?parseInt(b.$.data("notification-count"))+c.length:c.length;b.updateCount(e),b.sendDesktopNotifications(c,d.lastSessionTime)})},l.prototype.initDropdown=function(){this.$entryList=this.$.find("ul.media-list"),this.$dropdown=this.$.find("#dropdown-notifications");var a=this;this.$entryList.scroll(function(){var b=a.$entryList.height(),c=a.$entryList.prop("scrollHeight"),d=a.$entryList.scrollTop();d>=c-b-1&&(a.lastEntryLoaded||a.loadEntries())})},l.prototype.toggle=function(a){this.lastEntryLoaded=!1,this.lastEntryId=0,this.isOpen=!this.$dropdown.is(":visible"),this.isOpen&&(this.$entryList.empty().hide(),this.loadEntries())},l.prototype.loadEntries=function(){if(!this.loading){var b=this;this.loader(),i.get(a.config.loadEntriesUrl,{data:{from:this.lastEntryId}}).then(c.proxy(this.handleResult,this))["catch"](n)["finally"](function(){b.loader(!1),b.loading=!1})}},l.prototype.handleResult=function(b){b.counter?(this.lastEntryId=b.lastEntryId,this.$entryList.append(b.output),c("span.time").timeago()):this.$entryList.append(f.template(a.templates.placeholder,{text:a.text("placeholder")})),this.updateCount(parseInt(b.newNotifications)),this.lastEntryLoaded=b.counter<6,this.$entryList.fadeIn("fast")},l.prototype.updateCount=function(a){if(this.$.data("notification-count")===a)return void(a||c("#badge-notifications").hide());if(c("#badge-notifications").hide(),a){p(a),c("#badge-notifications").html(a),c("#mark-seen-link").show(),c("#badge-notifications").fadeIn("fast");var b=c("#icon-notifications .fa"),d=b.clone();d.addClass("animated swing"),b.replaceWith(d)}else p(!1),c("#badge-notifications").html("0"),c("#mark-seen-link").hide(),c("#icon-notifications .fa").removeClass("animated swing");this.$.data("notification-count",a)},l.prototype.sendDesktopNotifications=function(b,d){if(b&&a.config.sendDesktopNotifications)if(b.text)a.sendDesktopNotifiaction(b.text);else if(b.notifications)for(var f=b.notifications,g=0;gc.data.ts||c.data&&c.data.text&&a.sendDesktopNotifiaction(c.data.text)})};var m=function(b,c){c=c||a.config.icon,b&&b.length&¬ify.createNotification("Notification",{body:b,icon:c})},n=function(b){a.log.error(b,!0)};l.prototype.loader=function(a){a!==!1?this.$.find("#loader_notifications").show():this.$.find("#loader_notifications").hide()},l.prototype.markAsSeen=function(b){var d=this;return i.post(b).then(function(a){c("#badge-notifications").hide(),c("#mark-seen-link").hide(),d.updateCount(0)})["catch"](function(b){a.log.error(b,!0)})};var o=function(a){var b=l.instance("#notification_widget");b.markAsSeen(a).then(function(){location.reload()})},p=function(a){a?document.title="("+a+") "+j.getState().title:a===!1&&(document.title=j.getState().title)};a.templates={placeholder:'
    • {text}
    • '};var q=function(b){k.isGuest()||(p(c("#notification_widget").data("notification-count")),r(),b||(c("#dropdown-notifications ul.media-list").niceScroll({cursorwidth:"7",cursorborder:"",cursorcolor:"#555",cursoropacitymax:"0.2",nativeparentscrolling:!1,railpadding:{top:0,right:3,left:0,bottom:0}}),c("#dropdown-notifications ul.media-list").on("touchmove",function(a){a.preventDefault()})),a.menu=l.instance("#notification_widget"))},r=function(){c("#notification_overview_list").length&&(c("#notification_overview_list li.new").length||c("#notification_overview_markseen").hide())};a["export"]({init:q,markAsSeen:o,sendDesktopNotifiaction:m,NotificationDropDown:l})}),humhub.module("content",function(a,b,c){var d=b("client"),e=b("util"),f=e.object,g=e.string,h=b("action"),i=h.Component,j=b("event"),k=b("ui.modal"),l="content-key",m="content-delete-url";i.addSelector("content-component");var n=function(a){i.call(this,a)};f.inherits(n,i),n.getNodeByKey=function(a){return c('[data-content-key="'+a+'"]')},n.prototype.actions=function(){return["create","edit","delete"]},n.prototype.getKey=function(){return this.$.data(l)},n.prototype.create=function(a){this.hasAction("create")||this.edit(a)},n.prototype.edit=function(a){},n.prototype["delete"]=function(b){b=b||{};var c=this;return new Promise(function(e,f){if(c.hasAction("delete")){var g=b.modal||a.config.modal.deleteConfirm;k.confirm(g).then(function(b){if(!b)return void e(!1);c.loader();var g=c.data(m)||a.config.deleteUrl;g?d.post(g,{data:{id:c.getKey()}}).then(function(a){c.remove().then(function(){e(!0)})})["catch"](function(a){f(a)})["finally"](function(){c.loader(!1)}):(f("Content delete was called, but no url could be determined for "+c.base),c.loader(!1))})}})},n.prototype.loader=function(a){},n.prototype.remove=function(){var a=this;return new Promise(function(b,c){a.$.animate({height:"toggle",opacity:"toggle"},"fast",function(){a.$.remove(),j.trigger("humhub:modules:content:afterRemove",a),b(a)})})},n.prototype.permalink=function(b){var c=a.config.modal.permalink;c.permalink=b.$trigger.data("content-permalink"),k.global.set({header:c.head,body:g.template(a.templates.permalinkBody,c),footer:g.template(a.templates.permalinkFooter,c),size:"normal"}).show(),k.global.$.find("textarea").focus().select(),j.one("humhub:ready",function(){k.global.close()})};var o={permalinkBody:'

      {info}

      ',permalinkFooter:'{buttonClose}{buttonOpen}'};a["export"]({Content:n,templates:o})}),humhub.module("content.container",function(a,b,c){var d=b("client"),e=b("ui.additions"),f=function(b){var f=b.$trigger.data("content-container-id");d.post(b).then(function(a){e.switchButtons(b.$trigger,c('[data-content-container-id="'+f+'"].unfollowButton'))})["catch"](function(b){a.log.error(b,!0)})},g=function(b){var f=b.$trigger.data("content-container-id");d.post(b).then(function(a){e.switchButtons(b.$trigger,c('[data-content-container-id="'+f+'"].followButton'))})["catch"](function(b){a.log.error(b,!0)})},h=function(b){d.post(b).then(function(a){a.success&&(e.switchButtons(b.$trigger,b.$trigger.siblings(".disable")),b.$trigger.siblings(".moduleConfigure").fadeIn("fast")),b.$trigger.data("reload")&&d.reload()})["catch"](function(b){a.log.error(b,!0)})["finally"](function(){b.finish()})},i=function(b){d.post(b).then(function(a){a.success&&(e.switchButtons(b.$trigger,b.$trigger.siblings(".enable")),b.$trigger.siblings(".moduleConfigure").fadeOut("fast")),b.$trigger.data("reload")&&d.reload()})["catch"](function(b){a.log.error(b,!0)})["finally"](function(){b.finish()})};a["export"]({follow:f,unfollow:g,enableModule:h,disableModule:i})}),/*! * Select2 4.0.3 * https://select2.github.io * @@ -241,12 +247,17 @@ return function(){if(!b||!b.requirejs){b?c=b:b={};/** */ var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('
        ');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('
      • '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(''),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a("")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('
          '),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('
        • ×
        • ');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('×');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&f<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(a.inArray(b,f)!==-1){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),a.inArray(b,g)!==-1&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
        • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){a.inArray(d,c)===-1&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")), -b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&(f=d(this),null!=f&&g.push(f))})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,f.indexOf(":all:")!==-1){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,f.indexOf(":all:")!==-1){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;return this._isInitialized?void b.call(this,c):void this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `'),this.preview&&(this.preview.show(),this.preview.add(a))}},m.prototype["delete"]=function(b){var c=this;return new Promise(function(d,e){o(b).then(function(e){c.$form.find('[value="'+b.guid+'"]').remove(),a.log.success("success.delete",!0),c.enable(),c.fire("fileDeleted",[b]),d()})["catch"](function(b){a.log.error(b,!0),e(b)})})},m.prototype.finish=function(b){this.progress&&this.progress.fadeOut().then(function(a){a.reset()}),this.errors.length&&(this.statusError(a.text("error.upload")),this.errors=[]),this.callbacks.stop&&this.callbacks.stop(b),this.$=c(this.getIdSelector()),this.canUploadMore()||this.disable(this.$.data("max-number-of-files-message")),this.fire("uploadFinish",[this])},m.prototype.canUploadMore=function(){return!this.options.maxNumberOfFiles||this.getFileCount()0},n.prototype.reset=function(){this.$list.find("li").remove(),this.$.hide()},n.prototype.remove=function(a){var b=this;return new Promise(function(d,e){b.$.find('[data-preview-guid="'+a.guid+'"]').fadeOut("fast",function(){c(this).remove(),b.$.find(".file-preview-item").length||b.hide(),d()})})};var o=function(b){var c={url:a.config.upload.deleteUrl,data:{guid:b.guid}};return f.post(c)};n.template={root:'
            ',file_edit:'',file:'',file_image:'',popover:'{name}'};var p=function(){k.on("humhub:file:created",function(a,b){h.isArray(b)||(b=[b]);var e=j.getProcessTrigger("file-handler"),f=d.instance(e.closest(".btn-group").find("[data-ui-widget]"));c.each(b,function(a,b){f.handleFileResponse(b)}),f.finish()})},q=function(a){m.instance(a.$target).trigger("upload")};a["export"]({init:p,actionUpload:q,Upload:m,Preview:n})}),humhub.module("post",function(a,b,c){var d=b("ui.widget").Widget,e=b("util").object,f=function(a,b){d.call(this,a,b)};e.inherits(f,d),a["export"]({Post:f})}),humhub.module("space",function(a,b,c){var d,e=b("client"),f=b("ui.additions"),g=b("event"),h=function(){return c(".space-layout-container").length>0},i=function(b,d){a.options&&a.options.guid===b.guid||(a.options=b,d&&g.trigger("humhub:space:changed",c.extend({},a.options)))},j=function(){return d?d.guid:null},k=function(b){e.post(b).then(function(c){c.success&&(f.switchButtons(b.$trigger,b.$trigger.siblings(".unarchive")),a.log.success("success.archived"),g.trigger("humhub:space:archived",c.space))})["catch"](function(b){a.log.error(b,!0)})},l=function(b){e.post(b).then(function(c){c.success&&(f.switchButtons(b.$trigger,b.$trigger.siblings(".archive")),a.log.success("success.unarchived"),g.trigger("humhub:space:unarchived",c.space))})["catch"](function(b){a.log.error(b,!0)})},m=function(){a.isSpacePage()||(a.options=void 0)};a["export"]({init:m,initOnPjaxLoad:!0,guid:j,archive:k,unarchive:l,isSpacePage:h,setSpace:i})}),humhub.module("comment",function(a,b,c){var d=b("content").Content,e=b("ui.widget").Widget,f=b("util").object,g=b("client"),h=b("ui.loader"),i=b("ui.additions"),j=function(a,b){e.call(this,a,b)};f.inherits(j,e),j.prototype.submit=function(b){var c=this;g.submit(b,{dataType:"html"}).then(function(a){c.addComment(a.html),c.getInput().val("").trigger("autosize.resize"),c.getRichtext().$.addClass("atwho-placeholder").focus(),c.getUpload().reset()})["catch"](function(b){a.log.error(b,!0)})},j.prototype.getRichtext=function(){return e.instance(this.$.find("div.humhub-ui-richtext"))},j.prototype.addComment=function(a){var b=c(a).hide();i.applyTo(b),this.getCommentsContainer().append(b),this.incrementCommentCount(1),b.fadeIn()},j.prototype.incrementCommentCount=function(b){try{var c=this.$.closest(".comment-container").siblings(".wall-entry-controls"),d=c.find(".comment-count");if(d.length){var e=d.data("count");e+=b,d.text(" ("+e+")").show(),d.data("count",e)}}catch(f){a.log.error(f)}},j.prototype.getUpload=function(){return e.instance(this.$.find('[name="files[]"]'))},j.prototype.getCommentsContainer=function(){return this.$.siblings(".comment")},j.prototype.getInput=function(){return this.$.find("textarea")};var k=function(a){d.call(this,a),i.observe(this.$)};f.inherits(k,d),k.prototype.edit=function(a){this.loader();var b=this;g.post(a,{dataType:"html"}).then(function(a){b.$.find(".comment_edit_content").replaceWith(a.html),b.getRichtext().focus(),b.$.find(".comment-cancel-edit-link").show(),b.$.find(".comment-edit-link").hide()})["finally"](function(){b.loader(!1)})},k.prototype.getRichtext=function(){return e.instance(this.$.find("div.humhub-ui-richtext"))},k.prototype["delete"]=function(){this["super"]("delete",{modal:a.config.modal.delteConfirm}).then(function(b){b&&a.log.success("success.delete")})["catch"](function(b){a.log.error(b,!0)})},k.prototype.editSubmit=function(b){var c=this;g.submit(b,{dataType:"html"}).then(function(b){c.replace(b.html),c.highlight(),c.$.find(".comment-cancel-edit-link").hide(),c.$.find(".comment-edit-link").show(),a.log.success("success.saved")})["catch"](function(b){a.log.error(b,!0)})},k.prototype.replace=function(a){var b=this.$.attr("id");this.$.replaceWith(a),this.$=c("#"+b),i.observe(this.$,!0)},k.prototype.cancelEdit=function(b){var c=this;this.loader(),g.html(b).then(function(a){c.replace(a.html),c.$.find(".comment-cancel-edit-link").hide(),c.$.find(".comment-edit-link").show()})["catch"](function(b){a.log.error(b,!0)})["finally"](function(){c.loader(!1)})},k.prototype.highlight=function(){i.highlight(this.$.find(".comment-message"))},k.prototype.loader=function(a){var b=this.$.find(".comment-entry-loader");return a===!1?(this.$.find(".preferences").show(),void h.reset(b)):(h.set(b,{size:"8px",css:{padding:"2px",width:"60px"}}),void this.$.find(".preferences").hide())};var l=function(b){g.post(b,{dataType:"html"}).then(function(a){var c=b.$trigger.parent();c.html(a.html),i.applyTo(c)})["catch"](function(b){a.log.error(b,!0)})},m=function(b){h.set(b.$trigger,{size:"8px",css:{padding:"2px",width:"60px"}}),g.post(b,{dataType:"html"}).then(function(a){var d=b.$trigger.closest(".comment"),e=c(a.html);d.prepend(e),b.$trigger.closest(".showMore").remove(),i.applyTo(e)})["catch"](function(c){a.log.error(c,!0),h.unset(b.$trigger)})},n=function(){c(document).on("mouseover",".comment .media",function(){var a=c(this),b=a.find(".preferences");h.is(a.find(".comment-entry-loader"))||b.show()}),c(document).on("mouseout",".comment .media",function(){var a=c(this).find(".preferences");a.find("li").hasClass("open")||a.hide()})};a["export"]({init:n,Comment:k,Form:j,showAll:l,showMore:m})}),function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b():a.NProgress=b()}(this,function(){function a(a,b,c){return ac?c:a}function b(a){return 100*(-1+a)}function c(a,c,d){var e;return e="translate3d"===j.positionUsing?{transform:"translate3d("+b(a)+"%,0,0)"}:"translate"===j.positionUsing?{transform:"translate("+b(a)+"%,0)"}:{"margin-left":b(a)+"%"},e.transition="all "+c+"ms "+d,e}function d(a,b){var c="string"==typeof a?a:g(a);return c.indexOf(" "+b+" ")>=0}function e(a,b){var c=g(a),e=c+b;d(c,b)||(a.className=e.substring(1))}function f(a,b){var c,e=g(a);d(a,b)&&(c=e.replace(" "+b+" "," "),a.className=c.substring(1,c.length-1))}function g(a){return(" "+(a.className||"")+" ").replace(/\s+/gi," ")}function h(a){a&&a.parentNode&&a.parentNode.removeChild(a)}var i={};i.version="0.2.0";var j=i.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
            '};i.configure=function(a){var b,c;for(b in a)c=a[b],void 0!==c&&a.hasOwnProperty(b)&&(j[b]=c);return this},i.status=null,i.set=function(b){var d=i.isStarted();b=a(b,j.minimum,1),i.status=1===b?null:b;var e=i.render(!d),f=e.querySelector(j.barSelector),g=j.speed,h=j.easing;return e.offsetWidth,k(function(a){""===j.positionUsing&&(j.positionUsing=i.getPositioningCSS()),l(f,c(b,g,h)),1===b?(l(e,{transition:"none",opacity:1}),e.offsetWidth,setTimeout(function(){l(e,{transition:"all "+g+"ms linear",opacity:0}),setTimeout(function(){i.remove(),a()},g)},g)):setTimeout(a,g)}),this},i.isStarted=function(){return"number"==typeof i.status},i.start=function(){i.status||i.set(0);var a=function(){setTimeout(function(){i.status&&(i.trickle(),a())},j.trickleSpeed)};return j.trickle&&a(),this},i.done=function(a){return a||i.status?i.inc(.3+.5*Math.random()).set(1):this},i.inc=function(b){var c=i.status;return c?("number"!=typeof b&&(b=(1-c)*a(Math.random()*c,.1,.95)),c=a(c+b,0,.994),i.set(c)):i.start()},i.trickle=function(){return i.inc(Math.random()*j.trickleRate)},function(){var a=0,b=0;i.promise=function(c){return c&&"resolved"!==c.state()?(0===b&&i.start(),a++,b++,c.always(function(){b--,0===b?(a=0,i.done()):i.set((a-b)/a)}),this):this}}(),i.render=function(a){if(i.isRendered())return document.getElementById("nprogress");e(document.documentElement,"nprogress-busy");var c=document.createElement("div");c.id="nprogress",c.innerHTML=j.template;var d,f=c.querySelector(j.barSelector),g=a?"-100":b(i.status||0),k=document.querySelector(j.parent);return l(f,{transition:"all 0 linear",transform:"translate3d("+g+"%,0,0)"}),j.showSpinner||(d=c.querySelector(j.spinnerSelector),d&&h(d)),k!=document.body&&e(k,"nprogress-custom-parent"),k.appendChild(c),c},i.remove=function(){f(document.documentElement,"nprogress-busy"),f(document.querySelector(j.parent),"nprogress-custom-parent");var a=document.getElementById("nprogress");a&&h(a)},i.isRendered=function(){return!!document.getElementById("nprogress")},i.getPositioningCSS=function(){var a=document.body.style,b="WebkitTransform"in a?"Webkit":"MozTransform"in a?"Moz":"msTransform"in a?"ms":"OTransform"in a?"O":"";return b+"Perspective"in a?"translate3d":b+"Transform"in a?"translate":"margin"};var k=function(){function a(){var c=b.shift();c&&c(a)}var b=[];return function(c){b.push(c),1==b.length&&a()}}(),l=function(){function a(a){return a.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(a,b){return b.toUpperCase()})}function b(a){var b=document.body.style;if(a in b)return a;for(var c,d=e.length,f=a.charAt(0).toUpperCase()+a.slice(1);d--;)if(c=e[d]+f,c in b)return c;return a}function c(c){return c=a(c),f[c]||(f[c]=b(c))}function d(a,b,d){b=c(b),a.style[b]=d}var e=["Webkit","O","Moz","ms"],f={};return function(a,b){var c,e,f=arguments;if(2==f.length)for(c in b)e=b[c],void 0!==e&&b.hasOwnProperty(c)&&d(a,c,e);else d(a,f[1],f[2])}}();return i}),/** +b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&(f=d(this),null!=f&&g.push(f))})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,f.indexOf(":all:")!==-1){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,f.indexOf(":all:")!==-1){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;return this._isInitialized?void b.call(this,c):void this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `'),this.preview&&(this.preview.show(),this.preview.add(a))}},m.prototype["delete"]=function(b){var c=this;return new Promise(function(d,e){o(b).then(function(e){c.$form.find('[value="'+b.guid+'"]').remove(),a.log.success("success.delete",!0),c.enable(),c.fire("fileDeleted",[b]),d()})["catch"](function(b){a.log.error(b,!0),e(b)})})},m.prototype.finish=function(b){this.progress&&this.progress.fadeOut().then(function(a){a.reset()}),this.errors.length&&(this.statusError(a.text("error.upload")),this.errors=[]),this.callbacks.stop&&this.callbacks.stop(b),this.$=c(this.getIdSelector()),this.canUploadMore()||this.disable(this.$.data("max-number-of-files-message")),this.fire("uploadFinish",[this])},m.prototype.canUploadMore=function(){return!this.options.maxNumberOfFiles||this.getFileCount()0},n.prototype.reset=function(){this.$list.find("li").remove(),this.$.hide()},n.prototype.remove=function(a){var b=this;return new Promise(function(d,e){b.$.find('[data-preview-guid="'+a.guid+'"]').fadeOut("fast",function(){c(this).remove(),b.$.find(".file-preview-item").length||b.hide(),d()})})};var o=function(b){var c={url:a.config.upload.deleteUrl,data:{guid:b.guid}};return f.post(c)};n.template={root:'
              ',file_edit:'',file:'',file_image:'',popover:'{name}'};var p=function(){k.on("humhub:file:created",function(a,b){h.isArray(b)||(b=[b]);var e=j.getProcessTrigger("file-handler"),f=d.instance(e.closest(".btn-group").find("[data-ui-widget]"));c.each(b,function(a,b){f.handleFileResponse(b)}),f.finish()})},q=function(a){m.instance(a.$target).trigger("upload")};a["export"]({init:p,actionUpload:q,Upload:m,Preview:n})}),humhub.module("post",function(a,b,c){var d=b("ui.widget").Widget,e=b("util").object,f=function(a,b){d.call(this,a,b)};e.inherits(f,d),a["export"]({Post:f})}),humhub.module("space",function(a,b,c){var d,e=b("client"),f=b("ui.additions"),g=b("event"),h=function(){return c(".space-layout-container").length>0},i=function(b,d){a.options&&a.options.guid===b.guid||(a.options=b,d&&g.trigger("humhub:space:changed",c.extend({},a.options)))},j=function(){return d?d.guid:null},k=function(b){e.post(b).then(function(c){c.success&&(f.switchButtons(b.$trigger,b.$trigger.siblings(".unarchive")),a.log.success("success.archived"),g.trigger("humhub:space:archived",c.space))})["catch"](function(b){a.log.error(b,!0)})},l=function(b){e.post(b).then(function(c){c.success&&(f.switchButtons(b.$trigger,b.$trigger.siblings(".archive")),a.log.success("success.unarchived"),g.trigger("humhub:space:unarchived",c.space))})["catch"](function(b){a.log.error(b,!0)})},m=function(){a.isSpacePage()||(a.options=void 0)};a["export"]({init:m,initOnPjaxLoad:!0,guid:j,archive:k,unarchive:l,isSpacePage:h,setSpace:i})}),humhub.module("comment",function(a,b,c){var d=b("content").Content,e=b("ui.widget").Widget,f=b("util").object,g=b("client"),h=b("ui.loader"),i=b("ui.additions"),j=function(a,b){e.call(this,a,b)};f.inherits(j,e),j.prototype.submit=function(b){var c=this;g.submit(b,{dataType:"html"}).then(function(a){c.addComment(a.html),c.getInput().val("").trigger("autosize.resize"),c.getRichtext().$.addClass("atwho-placeholder").focus(),c.getUpload().reset()})["catch"](function(b){a.log.error(b,!0)})},j.prototype.getRichtext=function(){return e.instance(this.$.find("div.humhub-ui-richtext"))},j.prototype.addComment=function(a){var b=c(a).hide();i.applyTo(b),this.getCommentsContainer().append(b),this.incrementCommentCount(1),b.fadeIn()},j.prototype.incrementCommentCount=function(b){try{var c=this.$.closest(".comment-container").siblings(".wall-entry-controls"),d=c.find(".comment-count");if(d.length){var e=d.data("count");e+=b,d.text(" ("+e+")").show(),d.data("count",e)}}catch(f){a.log.error(f)}},j.prototype.getUpload=function(){return e.instance(this.$.find('[name="files[]"]'))},j.prototype.getCommentsContainer=function(){return this.$.siblings(".comment")},j.prototype.getInput=function(){return this.$.find("textarea")};var k=function(a){d.call(this,a),i.observe(this.$)};f.inherits(k,d),k.prototype.edit=function(a){this.loader();var b=this;g.post(a,{dataType:"html"}).then(function(a){b.$.find(".comment_edit_content").replaceWith(a.html),b.getRichtext().focus(),b.$.find(".comment-cancel-edit-link").show(),b.$.find(".comment-edit-link").hide()})["finally"](function(){b.loader(!1)})},k.prototype.getRichtext=function(){return e.instance(this.$.find("div.humhub-ui-richtext"))},k.prototype["delete"]=function(){this["super"]("delete",{modal:a.config.modal.delteConfirm}).then(function(b){b&&a.log.success("success.delete")})["catch"](function(b){a.log.error(b,!0)})},k.prototype.editSubmit=function(b){var c=this;g.submit(b,{dataType:"html"}).then(function(b){c.replace(b.html),c.highlight(),c.$.find(".comment-cancel-edit-link").hide(),c.$.find(".comment-edit-link").show(),a.log.success("success.saved")})["catch"](function(b){a.log.error(b,!0)})},k.prototype.replace=function(a){var b=this.$.attr("id");this.$.replaceWith(a),this.$=c("#"+b),i.observe(this.$,!0)},k.prototype.cancelEdit=function(b){var c=this;this.loader(),g.html(b).then(function(a){c.replace(a.html),c.$.find(".comment-cancel-edit-link").hide(),c.$.find(".comment-edit-link").show()})["catch"](function(b){a.log.error(b,!0)})["finally"](function(){c.loader(!1)})},k.prototype.highlight=function(){i.highlight(this.$.find(".comment-message"))},k.prototype.loader=function(a){var b=this.$.find(".comment-entry-loader");return a===!1?(this.$.find(".preferences").show(),void h.reset(b)):(h.set(b,{size:"8px",css:{padding:"2px",width:"60px"}}),void this.$.find(".preferences").hide())};var l=function(b){g.post(b,{dataType:"html"}).then(function(a){var c=b.$trigger.parent();c.html(a.html),i.applyTo(c)})["catch"](function(b){a.log.error(b,!0)})},m=function(b){h.set(b.$trigger,{size:"8px",css:{padding:"2px",width:"60px"}}),g.post(b,{dataType:"html"}).then(function(a){var d=b.$trigger.closest(".comment"),e=c(a.html);d.prepend(e),b.$trigger.closest(".showMore").remove(),i.applyTo(e)})["catch"](function(c){a.log.error(c,!0),h.unset(b.$trigger)})},n=function(){c(document).on("mouseover",".comment .media",function(){var a=c(this),b=a.find(".preferences");h.is(a.find(".comment-entry-loader"))||b.show()}),c(document).on("mouseout",".comment .media",function(){var a=c(this).find(".preferences");a.find("li").hasClass("open")||a.hide()})};a["export"]({init:n,Comment:k,Form:j,showAll:l,showMore:m})}),function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b():a.NProgress=b()}(this,function(){function a(a,b,c){return ac?c:a}function b(a){return 100*(-1+a)}function c(a,c,d){var e;return e="translate3d"===j.positionUsing?{transform:"translate3d("+b(a)+"%,0,0)"}:"translate"===j.positionUsing?{transform:"translate("+b(a)+"%,0)"}:{"margin-left":b(a)+"%"},e.transition="all "+c+"ms "+d,e}function d(a,b){var c="string"==typeof a?a:g(a);return c.indexOf(" "+b+" ")>=0}function e(a,b){var c=g(a),e=c+b;d(c,b)||(a.className=e.substring(1))}function f(a,b){var c,e=g(a);d(a,b)&&(c=e.replace(" "+b+" "," "),a.className=c.substring(1,c.length-1))}function g(a){return(" "+(a.className||"")+" ").replace(/\s+/gi," ")}function h(a){a&&a.parentNode&&a.parentNode.removeChild(a)}var i={};i.version="0.2.0";var j=i.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
              '};i.configure=function(a){var b,c;for(b in a)c=a[b],void 0!==c&&a.hasOwnProperty(b)&&(j[b]=c);return this},i.status=null,i.set=function(b){var d=i.isStarted();b=a(b,j.minimum,1),i.status=1===b?null:b;var e=i.render(!d),f=e.querySelector(j.barSelector),g=j.speed,h=j.easing;return e.offsetWidth,k(function(a){""===j.positionUsing&&(j.positionUsing=i.getPositioningCSS()),l(f,c(b,g,h)),1===b?(l(e,{transition:"none",opacity:1}),e.offsetWidth,setTimeout(function(){l(e,{transition:"all "+g+"ms linear",opacity:0}),setTimeout(function(){i.remove(),a()},g)},g)):setTimeout(a,g)}),this},i.isStarted=function(){return"number"==typeof i.status},i.start=function(){i.status||i.set(0);var a=function(){setTimeout(function(){i.status&&(i.trickle(),a())},j.trickleSpeed)};return j.trickle&&a(),this},i.done=function(a){return a||i.status?i.inc(.3+.5*Math.random()).set(1):this},i.inc=function(b){var c=i.status;return c?("number"!=typeof b&&(b=(1-c)*a(Math.random()*c,.1,.95)),c=a(c+b,0,.994),i.set(c)):i.start()},i.trickle=function(){return i.inc(Math.random()*j.trickleRate)},function(){var a=0,b=0;i.promise=function(c){return c&&"resolved"!==c.state()?(0===b&&i.start(),a++,b++,c.always(function(){b--,0===b?(a=0,i.done()):i.set((a-b)/a)}),this):this}}(),i.render=function(a){if(i.isRendered())return document.getElementById("nprogress");e(document.documentElement,"nprogress-busy");var c=document.createElement("div");c.id="nprogress",c.innerHTML=j.template;var d,f=c.querySelector(j.barSelector),g=a?"-100":b(i.status||0),k=document.querySelector(j.parent);return l(f,{transition:"all 0 linear",transform:"translate3d("+g+"%,0,0)"}),j.showSpinner||(d=c.querySelector(j.spinnerSelector),d&&h(d)),k!=document.body&&e(k,"nprogress-custom-parent"),k.appendChild(c),c},i.remove=function(){f(document.documentElement,"nprogress-busy"),f(document.querySelector(j.parent),"nprogress-custom-parent");var a=document.getElementById("nprogress");a&&h(a)},i.isRendered=function(){return!!document.getElementById("nprogress")},i.getPositioningCSS=function(){var a=document.body.style,b="WebkitTransform"in a?"Webkit":"MozTransform"in a?"Moz":"msTransform"in a?"ms":"OTransform"in a?"O":"";return b+"Perspective"in a?"translate3d":b+"Transform"in a?"translate":"margin"};var k=function(){function a(){var c=b.shift();c&&c(a)}var b=[];return function(c){b.push(c),1==b.length&&a()}}(),l=function(){function a(a){return a.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(a,b){return b.toUpperCase()})}function b(a){var b=document.body.style;if(a in b)return a;for(var c,d=e.length,f=a.charAt(0).toUpperCase()+a.slice(1);d--;)if(c=e[d]+f,c in b)return c;return a}function c(c){return c=a(c),f[c]||(f[c]=b(c))}function d(a,b,d){b=c(b),a.style[b]=d}var e=["Webkit","O","Moz","ms"],f={};return function(a,b){var c,e,f=arguments;if(2==f.length)for(c in b)e=b[c],void 0!==e&&b.hasOwnProperty(c)&&d(a,c,e);else d(a,f[1],f[2])}}();return i}),/** * @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed */ -!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document);var Markdown;Markdown="object"==typeof exports&&"function"==typeof require?exports:{},function(){function a(a){return a}function b(a){return!1}function c(){}function d(){}c.prototype={chain:function(b,c){var d=this[b];if(!d)throw new Error("unknown hook "+b);d===a?this[b]=c:this[b]=function(a){var b=Array.prototype.slice.call(arguments,0);return b[0]=d.apply(null,b),c.apply(null,b)}},set:function(a,b){if(!this[a])throw new Error("unknown hook "+a);this[a]=b},addNoop:function(b){this[b]=a},addFalse:function(a){this[a]=b}},Markdown.HookCollection=c,d.prototype={set:function(a,b){this["s_"+a]=b},get:function(a){return this["s_"+a]}},Markdown.Converter=function(b){function e(a){return a=a.replace(/^[ ]{0,3}\[([^\[\]]+)\]:[ \t]*\n?[ \t]*?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(\n+)/gm,function(a,b,c,d,e,f,g){return b=b.toLowerCase(),L.set(b,A(c)),e?d+g:(f&&M.set(b,f.replace(/"/g,""")),"")})}function f(a){return a=a.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,h),a=a.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,h),a=a.replace(/\n[ ]{0,3}((<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,h),a=a.replace(/\n\n[ ]{0,3}(-]|-[^>])(?:[^-]|-[^-])*)--)>[ \t]*(?=\n{2,}))/g,h),a=a.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,h)}function g(a){return a=a.replace(/(^\n+|\n+$)/g,""),"\n\n~K"+(N.push(a)-1)+"K\n\n"}function h(a,b){return g(b)}function i(a,b,c){a=K.preBlockGamut(a,S),a=q(a);var d="
              \n";return a=a.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,d),a=a.replace(/^[ ]{0,2}([ ]?-[ ]?){3,}[ \t]*$/gm,d),a=a.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm,d),a=r(a),a=t(a),a=y(a),a=K.postBlockGamut(a,S),a=f(a),a=z(a,b,c)}function j(a){return a=K.preSpanGamut(a),a=u(a),a=k(a),a=B(a),a=n(a),a=l(a),a=D(a),a=a.replace(/~P/g,"://"),a=A(a),a=R(a),a=a.replace(/ +\n/g,"
              \n"),a=K.postSpanGamut(a)}function k(a){var b=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|-]|-[^>])(?:[^-]|-[^-])*)--)>)/gi;return a=a.replace(b,function(a){var b=a.replace(/(.)<\/?code>(?=.)/g,"$1`");return b=I(b,"!"==a.charAt(1)?"\\`*_/":"\\`*_")})}function l(a){return a.indexOf("[")===-1?a:(a=a.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,m),a=a.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,m),a=a.replace(/(\[([^\[\]]+)\])()()()()()/g,m))}function m(a,b,c,d,e,f,g,h){void 0==h&&(h="");var i=b,j=c.replace(/:\/\//g,"~P"),k=d.toLowerCase(),l=e,m=h;if(""==l)if(""==k&&(k=j.toLowerCase().replace(/ ?\n/g," ")),l="#"+k,void 0!=L.get(k))l=L.get(k),void 0!=M.get(k)&&(m=M.get(k));else{if(!(i.search(/\(\s*\)$/m)>-1))return i;l=""}l=H(l);var n='"}function n(a){return a.indexOf("![")===-1?a:(a=a.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,p),a=a.replace(/(!\[(.*?)\]\s?\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,p))}function o(a){return a.replace(/>/g,">").replace(/"+j(b)+"\n\n"}),a=a.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(a,b){return"

              "+j(b)+"

              \n\n"}),a=a.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(a,b,c){var d=b.length;return""+j(c)+"\n\n"})}function r(a,b){a+="~0";var c=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;return O?a=a.replace(c,function(a,c,d){var e,f=c,g=d.search(/[*+-]/g)>-1?"ul":"ol";"ol"===g&&(e=parseInt(d,10));var h=s(f,g,b);h=h.replace(/\s+$/,"");var i="<"+g;return e&&1!==e&&(i+=' start="'+e+'"'),h=i+">"+h+"\n"}):(c=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g,a=a.replace(c,function(a,b,c,d){var e,f=b,g=c,h=d.search(/[*+-]/g)>-1?"ul":"ol";"ol"===h&&(e=parseInt(d,10));var i=s(g,h),j="<"+h;return e&&1!==e&&(j+=' start="'+e+'"'),i=f+j+">\n"+i+"\n"})),a=a.replace(/~0/,"")}function s(a,b,c){O++,a=a.replace(/\n{2,}$/,"\n"),a+="~0";var d=T[b],e=new RegExp("(^[ \\t]*)("+d+")[ \\t]+([^\\r]+?(\\n+))(?=(~0|\\1("+d+")[ \\t]+))","gm"),f=!1;return a=a.replace(e,function(a,b,c,d){var e=d,g=/\n\n$/.test(e),h=g||e.search(/\n{2,}/)>-1,j=h||f;return e=i(F(e),!0,!j),f=g,"
            • "+e+"
            • \n"}),a=a.replace(/~0/g,""),O--,a}function t(a){return a}function u(a){return a=a.replace(/(^|[^\\`])(`+)(?!`)([^\r]*?[^`])\2(?!`)/gm,function(a,b,c,d,e){var f=d;return f=f.replace(/[ \t]*$/g,""),f=v(f),f=f.replace(/:\/\//g,"~P"),b+""+f+""})}function v(a){return a=a.replace(/&/g,"&"),a=a.replace(//g,">"),a=I(a,"*_{}[]\\",!1)}function w(a){return a.indexOf("*")===-1&&a.indexOf("_")===-1?a:(a=P(a),a=a.replace(/(^|[\W_])(?:(?!\1)|(?=^))(\*|_)\2(?=\S)([^\r]*?\S)\2\2(?!\2)(?=[\W_]|$)/g,"$1$3"),a=a.replace(/(^|[\W_])(?:(?!\1)|(?=^))(\*|_)(?=\S)((?:(?!\2)[^\r])*?\S)\2(?!\2)(?=[\W_]|$)/g,"$1$3"),Q(a))}function x(a){return a.indexOf("*")===-1&&a.indexOf("_")===-1?a:(a=P(a),a=a.replace(/(?=[^\r][*_]|[*_])(^|(?=\W__|(?!\*)[\W_]\*\*|\w\*\*\w)[^\r])(\*\*|__)(?!\2)(?=\S)((?:|[^\r]*?(?!\2)[^\r])(?=\S_|\w|\S\*\*(?:[\W_]|$)).)(?=__(?:\W|$)|\*\*(?:[^*]|$))\2/g,"$1$3"),a=a.replace(/(?=[^\r][*_]|[*_])(^|(?=\W_|(?!\*)(?:[\W_]\*|\D\*(?=\w)\D))[^\r])(\*|_)(?!\2\2\2)(?=\S)((?:(?!\2)[^\r])*?(?=[^\s_]_|(?=\w)\D\*\D|[^\s*]\*(?:[\W_]|$)).)(?=_(?:\W|$)|\*(?:[^*]|$))\2/g,"$1$3"),Q(a))}function y(a){return a=a.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(a,b){var c=b;return c=c.replace(/^[ \t]*>[ \t]?/gm,"~0"),c=c.replace(/~0/g,""),c=c.replace(/^[ \t]+$/gm,""),c=i(c),c=c.replace(/(^|\n)/g,"$1 "),c=c.replace(/(\s*
              [^\r]+?<\/pre>)/gm,function(a,b){var c=b;return c=c.replace(/^  /gm,"~0"),c=c.replace(/~0/g,"")}),g("
              \n"+c+"\n
              ")})}function z(a,b,c){a=a.replace(/^( )+/gm,function(a){return new Array(a.length+1).join(" ")}),a=a.replace(/^\n+/g,""),a=a.replace(/\n+$/g,"");for(var d=a.split(/\n{2,}/g),e=[],f=/~K(\d+)K/,g=d.length,h=0;h"),c||(i+="

              "),e.push(i))}if(!b){g=e.length;for(var h=0;h#+-.!])/g,J)}function C(a,b,c,d){if(b)return a;if(")"!==d.charAt(d.length-1))return"<"+c+d+">";for(var e=d.match(/[()]/g),f=0,g=0;g"+h}function D(a){a=a.replace(W,C);var b=function(a,b){var c=H(b);return'
              '+K.plainLinkText(b)+""};return a=a.replace(/<((https?|ftp):[^'">\s]+)>/gi,b)}function E(a){return a=a.replace(/~E(\d+)E/g,function(a,b){var c=parseInt(b);return String.fromCharCode(c)})}function F(a){return a=a.replace(/^(\t|[ ]{1,4})/gm,"~0"),a=a.replace(/~0/g,"")}function G(a){if(!/\t/.test(a))return a;var b,c=[" "," "," "," "],d=0;return a.replace(/[\n\t]/g,function(a,e){return"\n"===a?(d=e+1,a):(b=(e-d)%4,d=e+1,c[b])})}function H(a){return a=o(a),a=I(a,"*_:()[]")}function I(a,b,c){var d="(["+b.replace(/([\[\]\\])/g,"\\$1")+"])";c&&(d="\\\\"+d);var e=new RegExp(d,"g");return a=a.replace(e,J)}function J(a,b){var c=b.charCodeAt(0);return"~E"+c+"E"}var K=this.hooks=new c;K.addNoop("plainLinkText"),K.addNoop("preConversion"),K.addNoop("postNormalization"),K.addNoop("preBlockGamut"),K.addNoop("postBlockGamut"),K.addNoop("preSpanGamut"),K.addNoop("postSpanGamut"),K.addNoop("postConversion");var L,M,N,O;b=b||{};var P=a,Q=a;b.nonAsciiLetters&&!function(){var a=/[Q\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376-\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0523\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0621-\u064a\u0660-\u0669\u066e-\u066f\u0671-\u06d3\u06d5\u06e5-\u06e6\u06ee-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07c0-\u07ea\u07f4-\u07f5\u07fa\u0904-\u0939\u093d\u0950\u0958-\u0961\u0966-\u096f\u0971-\u0972\u097b-\u097f\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc-\u09dd\u09df-\u09e1\u09e6-\u09f1\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a59-\u0a5c\u0a5e\u0a66-\u0a6f\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0-\u0ae1\u0ae6-\u0aef\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3d\u0b5c-\u0b5d\u0b5f-\u0b61\u0b66-\u0b6f\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0be6-\u0bef\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58-\u0c59\u0c60-\u0c61\u0c66-\u0c6f\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0-\u0ce1\u0ce6-\u0cef\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d28\u0d2a-\u0d39\u0d3d\u0d60-\u0d61\u0d66-\u0d6f\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32-\u0e33\u0e40-\u0e46\u0e50-\u0e59\u0e81-\u0e82\u0e84\u0e87-\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa-\u0eab\u0ead-\u0eb0\u0eb2-\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0ed0-\u0ed9\u0edc-\u0edd\u0f00\u0f20-\u0f29\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8b\u1000-\u102a\u103f-\u1049\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070\u1075-\u1081\u108e\u1090-\u1099\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1159\u115f-\u11a2\u11a8-\u11f9\u1200-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u1676\u1681-\u169a\u16a0-\u16ea\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u17e0-\u17e9\u1810-\u1819\u1820-\u1877\u1880-\u18a8\u18aa\u1900-\u191c\u1946-\u196d\u1970-\u1974\u1980-\u19a9\u19c1-\u19c7\u19d0-\u19d9\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b50-\u1b59\u1b83-\u1ba0\u1bae-\u1bb9\u1c00-\u1c23\u1c40-\u1c49\u1c4d-\u1c7d\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u203f-\u2040\u2054\u2071\u207f\u2090-\u2094\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2183-\u2184\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2c6f\u2c71-\u2c7d\u2c80-\u2ce4\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3006\u3031-\u3035\u303b-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31b7\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fc3\ua000-\ua48c\ua500-\ua60c\ua610-\ua62b\ua640-\ua65f\ua662-\ua66e\ua67f-\ua697\ua717-\ua71f\ua722-\ua788\ua78b-\ua78c\ua7fb-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8d0-\ua8d9\ua900-\ua925\ua930-\ua946\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa50-\uaa59\uac00-\ud7a3\uf900-\ufa2d\ufa30-\ufa6a\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe33-\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]/g,b="Q".charCodeAt(0),c="A".charCodeAt(0),d="Z".charCodeAt(0),e="a".charCodeAt(0)-d-1;P=function(f){return f.replace(a,function(a){for(var f,g=a.charCodeAt(0),h="";g>0;)f=g%51+c,f>=b&&f++,f>d&&(f+=e),h=String.fromCharCode(f)+h,g=g/51|0;return"Q"+h+"Q"})},Q=function(a){return a.replace(/Q([A-PR-Za-z]{1,3})Q/g,function(a,f){for(var g,h=0,i=0;id&&(g-=e),g>b&&g--,g-=c,h=51*h+g;return String.fromCharCode(h)})}}();var R=b.asteriskIntraWordEmphasis?x:w;this.makeHtml=function(a){if(L)throw new Error("Recursive call to converter.makeHtml");return L=new d,M=new d,N=[],O=0,a=K.preConversion(a),a=a.replace(/~/g,"~T"),a=a.replace(/\$/g,"~D"),a=a.replace(/\r\n/g,"\n"),a=a.replace(/\r/g,"\n"),a="\n\n"+a+"\n\n",a=G(a),a=a.replace(/^[ \t]+$/gm,""),a=K.postNormalization(a),a=f(a),a=e(a),a=i(a),a=E(a),a=a.replace(/~D/g,"$$"),a=a.replace(/~T/g,"~"),a=K.postConversion(a),N=M=L=null,a};var S=function(a){return i(a)},T={ol:"\\d+[.]",ul:"[*+-]"},U="[-\\u00C0-\\u1FFF\\u2C00-\\uD7FF\\w0-9+&@#/%?=~_|[\\]()!:,.;]",V="[-\\u00C0-\\u1FFF\\u2C00-\\uD7FF\\w0-9+&@#/%=~_|[\\])]",W=new RegExp('(="|<)?\\b(https?|ftp)(://'+U+"*"+V+")(?=$|\\W)","gi"),X=new RegExp(V,"i")}}(),function(){function a(a){return a.replace(/<[^>]*>?/gi,b)}function b(a){return a.match(f)||a.match(g)||a.match(h)?a:j(a)}function c(a){if(""==a)return"";var b=/<\/?\w+[^>]*(\s|$|>)/g,c=a.toLowerCase().match(b),d=(c||[]).length;if(0==d)return a;for(var e,f,g,h="



            • ",i=[],j=[],k=!1,l=0;l")>-1)){if(f=c[l],g=-1,!/^<\//.test(f))for(var m=l+1;m"){g=m;break}g==-1?k=j[l]=!0:i[g]=!0}if(!k)return a;var l=0;return a=a.replace(b,function(a){var b=j[l]?"":a;return l++,b})}var d,e;"object"==typeof exports&&"function"==typeof require?(d=exports,e=require("./Markdown.Converter").Converter):(d=window.Markdown,e=d.Converter),d.getSanitizingConverter=function(){var b=new e;return b.hooks.chain("postConversion",a),b.hooks.chain("postConversion",c),b};var f=/^(<\/?(b|blockquote|code|del|dd|dl|dt|em|h1|h2|h3|h4|h5|h6|i|kbd|li|ol(?: start="\d+")?|p|pre|s|sup|sub|strong|strike|ul)>|<(br|hr)\s?\/?>)$/i,g=/^(]*")?(\stitle="[^"<>]+")?\s?>|<\/a>)$/i,h=/^(]*")?(\stitle="[^"<>]*")?\s?\/?>)$/i,i={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},j=function(a){return String(a).replace(/[&<>"'=\/]/g,function(a){return i[a]})}}(),function(){function a(a){return a.replace(/^\s+|\s+$/g,"")}function b(a){return a.replace(/\s+$/g,"")}function c(a){return a.replace(new RegExp("^(\\t|[ ]{1,4})","gm"),"")}function d(a,b){return a.indexOf(b)!=-1}function e(a,b){return a.replace(/<[^>]*>?/gi,function(a){return a.match(b)?a:""})}function f(a,b){for(var c={},d=0;d]*>|","<(br)\\s?\\/?>)$"].join(""),"i");Array.indexOf||(Array.prototype.indexOf=function(a){for(var b=0;b~X"+(this.hashBlocks.push(a)-1)+"X

              \n"},Markdown.Extra.prototype.hashExtraInline=function(a){return"~X"+(this.hashBlocks.push(a)-1)+"X"},Markdown.Extra.prototype.unHashExtraBlocks=function(a){function b(){var d=!1;a=a.replace(/(?:

              )?~X(\d+)X(?:<\/p>)?/g,function(a,b){d=!0;var e=parseInt(b,10);return c.hashBlocks[e]}),d===!0&&b()}var c=this;return b(),a},Markdown.Extra.prototype.wrapHeaders=function(a){function b(a){return"\n"+a+"\n"}return a=a.replace(/^.+[ \t]*\n=+[ \t]*\n+/gm,b),a=a.replace(/^.+[ \t]*\n-+[ \t]*\n+/gm,b),a=a.replace(/^\#{1,6}[ \t]*.+?[ \t]*\#*\n+/gm,b)};var q="\\{[ \\t]*((?:[#.][-_:a-zA-Z0-9]+[ \\t]*)+)\\}",r=new RegExp("^(#{1,6}.*#{0,6})[ \\t]+"+q+"[ \\t]*(?:\\n|0x03)","gm"),s=new RegExp("^(.*)[ \\t]+"+q+"[ \\t]*\\n(?=[\\-|=]+\\s*(?:\\n|0x03))","gm"),t=new RegExp("^(```[^`\\n]*)[ \\t]+"+q+"[ \\t]*\\n(?=([\\s\\S]*?)\\n```[ \\t]*(\\n|0x03))","gm");Markdown.Extra.prototype.hashHeaderAttributeBlocks=function(a){function b(a,b,d){return"

              ~XX"+(c.hashBlocks.push(d)-1)+"XX

              \n"+b+"\n"}var c=this;return a=a.replace(r,b),a=a.replace(s,b)},Markdown.Extra.prototype.hashFcbAttributeBlocks=function(a){function b(a,b,d){return"

              ~XX"+(c.hashBlocks.push(d)-1)+"XX

              \n"+b+"\n"}var c=this;return a.replace(t,b)},Markdown.Extra.prototype.applyAttributeBlocks=function(a){var b=this,c=new RegExp('

              ~XX(\\d+)XX

              [\\s]*(?:<(h[1-6]|pre)(?: +class="(\\S+)")?(>[\\s\\S]*?))',"gm");return a=a.replace(c,function(a,c,d,e,g){if(!d)return"";for(var h=parseInt(c,10),i=b.hashBlocks[h],j=i.match(/#[^\s#.]+/g)||[],k=j[0]?' id="'+j[0].substr(1,j[0].length-1)+'"':"",l=i.match(/\.[^\s#.]+/g)||[],m=0;m0&&(n=' class="'+l.join(" ")+'"'),"<"+d+k+n+g})},Markdown.Extra.prototype.tables=function(b){function c(b,c,e,f,g,h){c=c.replace(/^ *[|]/m,""),e=e.replace(/^ *[|]/m,""),f=f.replace(/^ *[|]/gm,""),c=c.replace(/[|] *$/m,""),e=e.replace(/[|] *$/m,""),f=f.replace(/[|] *$/gm,"");for(var j=e.split(/ *[|] */),k=[],l=0;l\n","\n","\n"].join("");for(l=0;l",r,"\n"].join("")}q+="\n\n";var s=f.split("\n");for(l=0;l\n",v=0;v",w,"\n"].join("")}q+="\n"}return q+="\n",d.hashExtraBlock(q)}var d=this,e=new RegExp(["^","[ ]{0,3}","[|]","(.+)\\n","[ ]{0,3}","[|]([ ]*[-:]+[-| :]*)\\n","(","(?:[ ]*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm"),f=new RegExp(["^","[ ]{0,3}","(\\S.*[|].*)\\n","[ ]{0,3}","([-:]+[ ]*[|][-| :]*)\\n","(","(?:.*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm");return b=b.replace(e,c),b=b.replace(f,c)},Markdown.Extra.prototype.stripFootnoteDefinitions=function(a){var b=this;return a=a.replace(/\n[ ]{0,3}\[\^(.+?)\]\:[ \t]*\n?([\s\S]*?)\n{1,2}((?=\n[ ]{0,3}\S)|$)/g,function(a,c,d){return c=n(c),d+="\n",d=d.replace(/^[ ]{0,3}/g,""),b.footnotes[c]=d,"\n"})},Markdown.Extra.prototype.doFootnotes=function(a){var b=this;if(b.isConvertingFootnote===!0)return a;var c=0;return a=a.replace(/\[\^(.+?)\]/g,function(a,d){var e=n(d),f=b.footnotes[e];if(void 0===f)return a;c++,b.usedFootnotes.push(e);var g=''+c+"";return b.hashExtraInline(g)})},Markdown.Extra.prototype.printFootnotes=function(a){var b=this;if(0===b.usedFootnotes.length)return a;a+='\n\n
              \n
              \n
                \n\n';for(var c=0;c'+f+' \n\n'}return a+="
              \n
              "},Markdown.Extra.prototype.fencedCodeBlocks=function(b){function c(a){return a=a.replace(/&/g,"&"),a=a.replace(//g,">"),a=a.replace(/~D/g,"$$"),a=a.replace(/~T/g,"~")}var d=this;return b=b.replace(/(?:^|\n)```([^`\n]*)\n([\s\S]*?)\n```[ \t]*(?=\n)/g,function(b,e,f){var g=a(e),h=f,i=d.googleCodePrettify?' class="prettyprint"':"",j="";g&&(j=d.googleCodePrettify||d.highlightJs?' class="language-'+g+'"':' class="'+g+'"');var k=["",c(h),"
            • "].join("");return d.hashExtraBlock(k)})},Markdown.Extra.prototype.educatePants=function(a){var b=this,c="",d=0;a.replace(/(?:)|(<)([a-zA-Z1-6]+)([^\n]*?>)([\s\S]*?)(<\/\2>)/g,function(e,f,g,h,i,j,k){var l=a.substring(d,k);return c+=b.applyPants(l),b.smartyPantsLastChar=c.substring(c.length-1),d=k+e.length,f?(/code|kbd|pre|script|noscript|iframe|math|ins|del|pre/i.test(g)?b.smartyPantsLastChar=i.substring(i.length-1):i=b.educatePants(i),void(c+=f+g+h+i+j)):void(c+=e)});var e=a.substring(d);return c+=b.applyPants(e),b.smartyPantsLastChar=c.substring(c.length-1),c},Markdown.Extra.prototype.applyPants=function(a){return a=a.replace(/---/g,"—").replace(/--/g,"–"),a=a.replace(/\.\.\./g,"…").replace(/\.\s\.\s\./g,"…"),a=a.replace(/``/g,"“").replace(/''/g,"”"),/^'$/.test(a)?/\S/.test(this.smartyPantsLastChar)?"’":"‘":/^"$/.test(a)?/\S/.test(this.smartyPantsLastChar)?"”":"“":(a=a.replace(/^'(?=[!"#\$\%'()*+,\-.\/:;<=>?\@\[\\]\^_`{|}~]\B)/,"’"),a=a.replace(/^"(?=[!"#\$\%'()*+,\-.\/:;<=>?\@\[\\]\^_`{|}~]\B)/,"”"),a=a.replace(/"'(?=\w)/g,"“‘"),a=a.replace(/'"(?=\w)/g,"‘“"),a=a.replace(/'(?=\d{2}s)/g,"’"),a=a.replace(/(\s| |--|&[mn]dash;|&\#8211;|&\#8212;|&\#x201[34];)'(?=\w)/g,"$1‘"),a=a.replace(/([^\s\[\{\(\-])'/g,"$1’"),a=a.replace(/'(?=\s|s\b)/g,"’"),a=a.replace(/'/g,"‘"),a=a.replace(/(\s| |--|&[mn]dash;|&\#8211;|&\#8212;|&\#x201[34];)"(?=\w)/g,"$1“"),a=a.replace(/([^\s\[\{\(\-])"/g,"$1”"),a=a.replace(/"(?=\s)/g,"”"),a=a.replace(/"/gi,"“"))},Markdown.Extra.prototype.runSmartyPants=function(a){return this.smartyPantsLastChar="",a=this.educatePants(a),a=a.replace(/(<([a-zA-Z1-6]+)\b([^\n>]*?)(\/)?>)/g,o)},Markdown.Extra.prototype.definitionLists=function(b){var c=new RegExp(["(\\x02\\n?|\\n\\n)","(?:","(","(","[ ]{0,3}","((?:[ \\t]*\\S.*\\n)+)","\\n?","[ ]{0,3}:[ ]+",")","([\\s\\S]+?)","(","(?=\\0x03)","|","(?=","\\n{2,}","(?=\\S)","(?!","[ ]{0,3}","(?:\\S.*\\n)+?","\\n?","[ ]{0,3}:[ ]+",")","(?!","[ ]{0,3}:[ ]+",")",")",")",")",")"].join(""),"gm"),d=this;return b=g(b),b=b.replace(c,function(b,c,e){var f=a(d.processDefListItems(e));return f="
              \n"+f+"\n
              ",c+d.hashExtraBlock(f)+"\n\n"}),h(b)},Markdown.Extra.prototype.processDefListItems=function(d){var e=this,f=new RegExp(["(\\x02\\n?|\\n\\n+)","(","[ ]{0,3}","(?![:][ ]|[ ])","(?:\\S.*\\n)+?",")","(?=\\n?[ ]{0,3}:[ ])"].join(""),"gm"),k=new RegExp(["\\n(\\n+)?","(","[ ]{0,3}","[:][ ]+",")","([\\s\\S]+?)","(?=\\n*","(?:","\\n[ ]{0,3}[:][ ]|","
              |\\x03",")",")"].join(""),"gm");return d=g(d),d=d.replace(/\n{2,}(?=\\x03)/,"\n"),d=d.replace(f,function(b,c,d){for(var f=a(d).split("\n"),g="",h=0;h"+j+"
              "}return g+"\n"}),d=d.replace(k,function(a,d,f,g){return d||g.match(/\n{2,}/)?(g=Array(f.length+1).join(" ")+g,g=c(g)+"\n\n",g="\n"+j(g,e)+"\n"):(g=b(g),g=i(c(g),e)),"\n
              "+g+"
              \n"}),h(d)},Markdown.Extra.prototype.strikethrough=function(a){return a.replace(/([\W_]|^)~T~T(?=\S)([^\r]*?\S[\*_]*)~T~T([\W_]|$)/g,"$1$2$3")},Markdown.Extra.prototype.newlines=function(a){return a.replace(/(<(?:br|\/li)>)?\n/g,function(a,b){return b?a:"
              \n"})}}(),function(a,b){"undefined"!=typeof module?module.exports=b():"function"==typeof define&&"object"==typeof define.amd?define(b):this[a]=b()}("clipboard",function(){if("undefined"==typeof document||!document.addEventListener)return null;var a={};return a.copy=function(){function a(){b=!1,c=null,d&&window.getSelection().removeAllRanges(),d=!1}var b=!1,c=null,d=!1;return document.addEventListener("copy",function(a){if(b){for(var d in c)a.clipboardData.setData(d,c[d]);a.preventDefault()}}),function(e){return new Promise(function(f,g){b=!0,c="string"==typeof e?{"text/plain":e}:e instanceof Node?{"text/html":(new XMLSerializer).serializeToString(e)}:e;try{var h=document.getSelection();if(!document.queryCommandEnabled("copy")&&h.isCollapsed){var i=document.createRange();i.selectNodeContents(document.body),h.addRange(i),d=!0}if(!document.execCommand("copy"))throw Error("Unable to copy. Perhaps it's not available in your browser?");a(),f()}catch(j){a(),g(j)}})}}(),a.paste=function(){var a,b,c=!1;return document.addEventListener("paste",function(d){if(c){c=!1,d.preventDefault();var e=a;a=null,e(d.clipboardData.getData(b))}}),function(d){return new Promise(function(e,f){c=!0,a=e,b=d||"text/plain";try{document.execCommand("paste")||(c=!1,f(Error("Unable to paste. Pasting only works in Internet Explorer at the moment.")))}catch(g){c=!1,f(Error(g))}})}}(),"undefined"==typeof ClipboardEvent&&"undefined"!=typeof window.clipboardData&&"undefined"!=typeof window.clipboardData.setData&&(function(a){function b(a,b){return function(){a.apply(b,arguments)}}function c(a){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._value=this._state=null,this._deferreds=[],i(a,b(e,this),b(f,this))}function d(a){var b=this;return null===this._state?void this._deferreds.push(a):void j(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function e(a){try{if(a===this)throw new TypeError("A promise cannot be resolved with itself."); -if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void i(b(c,a),b(e,this),b(f,this))}this._state=!0,this._value=a,g.call(this)}catch(d){f.call(this,d)}}function f(a){this._state=!1,this._value=a,g.call(this)}function g(){for(var a=0,b=this._deferreds.length;b>a;a++)d.call(this,this._deferreds[a]);this._deferreds=null}function h(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function i(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){d||(d=!0,c(e))}}var j=c.immediateFn||"function"==typeof setImmediate&&setImmediate||function(a){setTimeout(a,1)},k=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};c.prototype["catch"]=function(a){return this.then(null,a)},c.prototype.then=function(a,b){var e=this;return new c(function(c,f){d.call(e,new h(a,b,c,f))})},c.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&k(arguments[0])?arguments[0]:arguments);return new c(function(b,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;fd;d++)a[d].then(b,c)})},"undefined"!=typeof module&&module.exports?module.exports=c:a.Promise||(a.Promise=c)}(this),a.copy=function(a){return new Promise(function(b,c){if("string"!=typeof a&&!("text/plain"in a))throw Error("You must provide a text/plain type.");window.clipboardData.setData("Text","string"==typeof a?a:a["text/plain"])?b():c(Error("Copying was rejected."))})},a.paste=function(){return new Promise(function(a,b){var c=window.clipboardData.getData("Text");c?a(c):b(Error("Pasting was rejected."))})}),a}),!function(){"use strict";function a(a,b){var c;for(c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function b(a){if(!this||this.find!==b.prototype.find)return new b(a);if(this.length=0,a)if("string"==typeof a&&(a=this.find(a)),a.nodeType||a===a.window)this.length=1,this[0]=a;else{var c=a.length;for(this.length=c;c;)c-=1,this[c]=a[c]}}b.extend=a,b.contains=function(a,b){do if(b=b.parentNode,b===a)return!0;while(b);return!1},b.parseJSON=function(a){return window.JSON&&JSON.parse(a)},a(b.prototype,{find:function(a){var c=this[0]||document;return"string"==typeof a&&(a=c.querySelectorAll?c.querySelectorAll(a):"#"===a.charAt(0)?c.getElementById(a.slice(1)):c.getElementsByTagName(a)),new b(a)},hasClass:function(a){return!!this[0]&&new RegExp("(^|\\s+)"+a+"(\\s+|$)").test(this[0].className)},addClass:function(a){for(var b,c=this.length;c;){if(c-=1,b=this[c],!b.className)return b.className=a,this;if(this.hasClass(a))return this;b.className+=" "+a}return this},removeClass:function(a){for(var b,c=new RegExp("(^|\\s+)"+a+"(\\s+|$)"),d=this.length;d;)d-=1,b=this[d],b.className=b.className.replace(c," ");return this},on:function(a,b){for(var c,d,e=a.split(/\s+/);e.length;)for(a=e.shift(),c=this.length;c;)c-=1,d=this[c],d.addEventListener?d.addEventListener(a,b,!1):d.attachEvent&&d.attachEvent("on"+a,b);return this},off:function(a,b){for(var c,d,e=a.split(/\s+/);e.length;)for(a=e.shift(),c=this.length;c;)c-=1,d=this[c],d.removeEventListener?d.removeEventListener(a,b,!1):d.detachEvent&&d.detachEvent("on"+a,b);return this},empty:function(){for(var a,b=this.length;b;)for(b-=1,a=this[b];a.hasChildNodes();)a.removeChild(a.lastChild);return this},first:function(){return new b(this[0])}}),"function"==typeof define&&define.amd?define(function(){return b}):(window.blueimp=window.blueimp||{},window.blueimp.helper=b)}(),function(a){"use strict";"function"==typeof define&&define.amd?define(["./blueimp-helper"],a):(window.blueimp=window.blueimp||{},window.blueimp.Gallery=a(window.blueimp.helper||window.jQuery))}(function(a){"use strict";function b(a,c){return void 0===document.body.style.maxHeight?null:this&&this.options===b.prototype.options?a&&a.length?(this.list=a,this.num=a.length,this.initOptions(c),void this.initialize()):void this.console.log("blueimp Gallery: No or empty list provided as first argument.",a):new b(a,c)}return a.extend(b.prototype,{options:{container:"#blueimp-gallery",slidesContainer:"div",titleElement:"h3",displayClass:"blueimp-gallery-display",controlsClass:"blueimp-gallery-controls",singleClass:"blueimp-gallery-single",leftEdgeClass:"blueimp-gallery-left",rightEdgeClass:"blueimp-gallery-right",playingClass:"blueimp-gallery-playing",slideClass:"slide",slideLoadingClass:"slide-loading",slideErrorClass:"slide-error",slideContentClass:"slide-content",toggleClass:"toggle",prevClass:"prev",nextClass:"next",closeClass:"close",playPauseClass:"play-pause",typeProperty:"type",titleProperty:"title",urlProperty:"href",srcsetProperty:"urlset",displayTransition:!0,clearSlides:!0,stretchImages:!1,toggleControlsOnReturn:!0,toggleControlsOnSlideClick:!0,toggleSlideshowOnSpace:!0,enableKeyboardNavigation:!0,closeOnEscape:!0,closeOnSlideClick:!0,closeOnSwipeUpOrDown:!0,emulateTouchEvents:!0,stopTouchEventsPropagation:!1,hidePageScrollbars:!0,disableScroll:!0,carousel:!1,continuous:!0,unloadElements:!0,startSlideshow:!1,slideshowInterval:5e3,index:0,preloadRange:2,transitionSpeed:400,slideshowTransitionSpeed:void 0,event:void 0,onopen:void 0,onopened:void 0,onslide:void 0,onslideend:void 0,onslidecomplete:void 0,onclose:void 0,onclosed:void 0},carouselOptions:{hidePageScrollbars:!1,toggleControlsOnReturn:!1,toggleSlideshowOnSpace:!1,enableKeyboardNavigation:!1,closeOnEscape:!1,closeOnSlideClick:!1,closeOnSwipeUpOrDown:!1,disableScroll:!1,startSlideshow:!0},console:window.console&&"function"==typeof window.console.log?window.console:{log:function(){}},support:function(b){function c(){var a,c,d=e.transition;document.body.appendChild(b),d&&(a=d.name.slice(0,-9)+"ransform",void 0!==b.style[a]&&(b.style[a]="translateZ(0)",c=window.getComputedStyle(b).getPropertyValue(d.prefix+"transform"),e.transform={prefix:d.prefix,name:a,translate:!0,translateZ:!!c&&"none"!==c})),void 0!==b.style.backgroundSize&&(e.backgroundSize={},b.style.backgroundSize="contain",e.backgroundSize.contain="contain"===window.getComputedStyle(b).getPropertyValue("background-size"),b.style.backgroundSize="cover",e.backgroundSize.cover="cover"===window.getComputedStyle(b).getPropertyValue("background-size")),document.body.removeChild(b)}var d,e={touch:void 0!==window.ontouchstart||window.DocumentTouch&&document instanceof DocumentTouch},f={webkitTransition:{end:"webkitTransitionEnd",prefix:"-webkit-"},MozTransition:{end:"transitionend",prefix:"-moz-"},OTransition:{end:"otransitionend",prefix:"-o-"},transition:{end:"transitionend",prefix:""}};for(d in f)if(f.hasOwnProperty(d)&&void 0!==b.style[d]){e.transition=f[d],e.transition.name=d;break}return document.body?c():a(document).on("DOMContentLoaded",c),e}(document.createElement("div")),requestAnimationFrame:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame,initialize:function(){return this.initStartIndex(),this.initWidget()!==!1&&(this.initEventListeners(),this.onslide(this.index),this.ontransitionend(),void(this.options.startSlideshow&&this.play()))},slide:function(a,b){window.clearTimeout(this.timeout);var c,d,e,f=this.index;if(f!==a&&1!==this.num){if(b||(b=this.options.transitionSpeed),this.support.transform){for(this.options.continuous||(a=this.circle(a)),c=Math.abs(f-a)/(f-a),this.options.continuous&&(d=c,c=-this.positions[this.circle(a)]/this.slideWidth,c!==d&&(a=-c*this.num+a)),e=Math.abs(f-a)-1;e;)e-=1,this.move(this.circle((a>f?a:f)-e-1),this.slideWidth*c,0);a=this.circle(a),this.move(f,this.slideWidth*c,b),this.move(a,0,b),this.options.continuous&&this.move(this.circle(a-c),-(this.slideWidth*c),0)}else a=this.circle(a),this.animate(f*-this.slideWidth,a*-this.slideWidth,b);this.onslide(a)}},getIndex:function(){return this.index},getNumber:function(){return this.num},prev:function(){(this.options.continuous||this.index)&&this.slide(this.index-1)},next:function(){(this.options.continuous||this.index1&&(this.timeout=this.setTimeout(!this.requestAnimationFrame&&this.slide||function(a,c){b.animationFrameId=b.requestAnimationFrame.call(window,function(){b.slide(a,c)})},[this.index+1,this.options.slideshowTransitionSpeed],this.interval)),this.container.addClass(this.options.playingClass)},pause:function(){window.clearTimeout(this.timeout),this.interval=null,this.container.removeClass(this.options.playingClass)},add:function(a){var b;for(a.concat||(a=Array.prototype.slice.call(a)),this.list.concat||(this.list=Array.prototype.slice.call(this.list)),this.list=this.list.concat(a),this.num=this.list.length,this.num>2&&null===this.options.continuous&&(this.options.continuous=!0,this.container.removeClass(this.options.leftEdgeClass)),this.container.removeClass(this.options.rightEdgeClass).removeClass(this.options.singleClass),b=this.num-a.length;bc?(d.slidesContainer[0].style.left=b+"px",d.ontransitionend(),void window.clearInterval(f)):void(d.slidesContainer[0].style.left=(b-a)*(Math.floor(g/c*100)/100)+a+"px")},4)},preventDefault:function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},onresize:function(){this.initSlides(!0)},onmousedown:function(a){a.which&&1===a.which&&"VIDEO"!==a.target.nodeName&&(a.preventDefault(),(a.originalEvent||a).touches=[{pageX:a.pageX,pageY:a.pageY}],this.ontouchstart(a))},onmousemove:function(a){this.touchStart&&((a.originalEvent||a).touches=[{pageX:a.pageX,pageY:a.pageY}],this.ontouchmove(a))},onmouseup:function(a){this.touchStart&&(this.ontouchend(a),delete this.touchStart)},onmouseout:function(b){if(this.touchStart){var c=b.target,d=b.relatedTarget;(!d||d!==c&&!a.contains(c,d))&&this.onmouseup(b)}},ontouchstart:function(a){this.options.stopTouchEventsPropagation&&this.stopPropagation(a);var b=(a.originalEvent||a).touches[0];this.touchStart={x:b.pageX,y:b.pageY,time:Date.now()},this.isScrolling=void 0,this.touchDelta={}},ontouchmove:function(a){this.options.stopTouchEventsPropagation&&this.stopPropagation(a);var b,c,d=(a.originalEvent||a).touches[0],e=(a.originalEvent||a).scale,f=this.index;if(!(d.length>1||e&&1!==e))if(this.options.disableScroll&&a.preventDefault(),this.touchDelta={x:d.pageX-this.touchStart.x,y:d.pageY-this.touchStart.y},b=this.touchDelta.x,void 0===this.isScrolling&&(this.isScrolling=this.isScrolling||Math.abs(b)0||f===this.num-1&&0>b?Math.abs(b)/this.slideWidth+1:1,c=[f],f&&c.push(f-1),f20||Math.abs(this.touchDelta.x)>i/2,l=!g&&this.touchDelta.x>0||g===this.num-1&&this.touchDelta.x<0,m=!k&&this.options.closeOnSwipeUpOrDown&&(j&&Math.abs(this.touchDelta.y)>20||Math.abs(this.touchDelta.y)>this.slideHeight/2);this.options.continuous&&(l=!1),b=this.touchDelta.x<0?-1:1,this.isScrolling?m?this.close():this.translateY(g,0,h):k&&!l?(c=g+b,d=g-b,e=i*b,f=-i*b,this.options.continuous?(this.move(this.circle(c),e,0),this.move(this.circle(g-2*b),f,0)):c>=0&&cthis.container[0].clientHeight&&(d.style.maxHeight=this.container[0].clientHeight),this.interval&&this.slides[this.index]===e&&this.play(),this.setTimeout(this.options.onslidecomplete,[c,e]))},onload:function(a){this.oncomplete(a)},onerror:function(a){this.oncomplete(a)},onkeydown:function(a){switch(a.which||a.keyCode){case 13:this.options.toggleControlsOnReturn&&(this.preventDefault(a),this.toggleControls());break;case 27:this.options.closeOnEscape&&(this.close(),a.stopImmediatePropagation());break;case 32:this.options.toggleSlideshowOnSpace&&(this.preventDefault(a),this.toggleSlideshow());break;case 37:this.options.enableKeyboardNavigation&&(this.preventDefault(a),this.prev());break;case 39:this.options.enableKeyboardNavigation&&(this.preventDefault(a),this.next())}},handleClick:function(b){function c(b){return a(e).hasClass(b)||a(f).hasClass(b)}var d=this.options,e=b.target||b.srcElement,f=e.parentNode;c(d.toggleClass)?(this.preventDefault(b),this.toggleControls()):c(d.prevClass)?(this.preventDefault(b),this.prev()):c(d.nextClass)?(this.preventDefault(b),this.next()):c(d.closeClass)?(this.preventDefault(b),this.close()):c(d.playPauseClass)?(this.preventDefault(b),this.toggleSlideshow()):f===this.slidesContainer[0]?d.closeOnSlideClick?(this.preventDefault(b),this.close()):d.toggleControlsOnSlideClick&&(this.preventDefault(b),this.toggleControls()):f.parentNode&&f.parentNode===this.slidesContainer[0]&&d.toggleControlsOnSlideClick&&(this.preventDefault(b),this.toggleControls())},onclick:function(a){return this.options.emulateTouchEvents&&this.touchDelta&&(Math.abs(this.touchDelta.x)>20||Math.abs(this.touchDelta.y)>20)?void delete this.touchDelta:this.handleClick(a)},updateEdgeClasses:function(a){a?this.container.removeClass(this.options.leftEdgeClass):this.container.addClass(this.options.leftEdgeClass),a===this.num-1?this.container.addClass(this.options.rightEdgeClass):this.container.removeClass(this.options.rightEdgeClass)},handleSlide:function(a){this.options.continuous||this.updateEdgeClasses(a),this.loadElements(a),this.options.unloadElements&&this.unloadElements(a),this.setTitle(a)},onslide:function(a){this.index=a,this.handleSlide(a),this.setTimeout(this.options.onslide,[a,this.slides[a]])},setTitle:function(a){var b=this.slides[a].firstChild.title,c=this.titleElement;c.length&&(this.titleElement.empty(),b&&c[0].appendChild(document.createTextNode(b)))},setTimeout:function(a,b,c){var d=this;return a&&window.setTimeout(function(){a.apply(d,b||[])},c||0)},imageFactory:function(b,c){function d(b){if(!e){if(b={type:b.type,target:f},!f.parentNode)return h.setTimeout(d,[b]);e=!0,a(i).off("load error",d),k&&"load"===b.type&&(f.style.background='url("'+j+'") center no-repeat',f.style.backgroundSize=k),c(b)}}var e,f,g,h=this,i=this.imagePrototype.cloneNode(!1),j=b,k=this.options.stretchImages;return"string"!=typeof j&&(j=this.getItemProperty(b,this.options.urlProperty),g=this.getItemProperty(b,this.options.titleProperty)),k===!0&&(k="contain"),k=this.support.backgroundSize&&this.support.backgroundSize[k]&&k,k?f=this.elementPrototype.cloneNode(!1):(f=i,i.draggable=!1),g&&(f.title=g),a(i).on("load error",d),i.src=j,f},createElement:function(b,c){var d=b&&this.getItemProperty(b,this.options.typeProperty),e=d&&this[d.split("/")[0]+"Factory"]||this.imageFactory,f=b&&e.call(this,b,c),g=this.getItemProperty(b,this.options.srcsetProperty);return f||(f=this.elementPrototype.cloneNode(!1),this.setTimeout(c,[{type:"error",target:f}])),g&&f.setAttribute("srcset",g),a(f).addClass(this.options.slideContentClass),f},loadElement:function(b){this.elements[b]||(this.slides[b].firstChild?this.elements[b]=a(this.slides[b]).hasClass(this.options.slideErrorClass)?3:2:(this.elements[b]=1,a(this.slides[b]).addClass(this.options.slideLoadingClass),this.slides[b].appendChild(this.createElement(this.list[b],this.proxyListener))))},loadElements:function(a){var b,c=Math.min(this.num,2*this.options.preloadRange+1),d=a;for(b=0;c>b;b+=1)d+=b*(b%2===0?-1:1),d=this.circle(d),this.loadElement(d)},unloadElements:function(a){var b,c;for(b in this.elements)this.elements.hasOwnProperty(b)&&(c=Math.abs(a-b),c>this.options.preloadRange&&c+this.options.preloadRangea?-this.slideWidth:this.indexa;a++)this.unloadSlide(a)},toggleControls:function(){var a=this.options.controlsClass;this.container.hasClass(a)?this.container.removeClass(a):this.container.addClass(a)},toggleSlideshow:function(){this.interval?this.pause():this.play()},getNodeIndex:function(a){return parseInt(a.getAttribute("data-index"),10)},getNestedProperty:function(a,b){return b.replace(/\[(?:'([^']+)'|"([^"]+)"|(\d+))\]|(?:(?:^|\.)([^\.\[]+))/g,function(b,c,d,e,f){var g=f||c||d||e&&parseInt(e,10);b&&a&&(a=a[g])}),a},getDataProperty:function(b,c){if(b.getAttribute){var d=b.getAttribute("data-"+c.replace(/([A-Z])/g,"-$1").toLowerCase());if("string"==typeof d){if(/^(true|false|null|-?\d+(\.\d+)?|\{[\s\S]*\}|\[[\s\S]*\])$/.test(d))try{return a.parseJSON(d)}catch(e){}return d}}},getItemProperty:function(a,b){var c=a[b];return void 0===c&&(c=this.getDataProperty(a,b),void 0===c&&(c=this.getNestedProperty(a,b))),c},initStartIndex:function(){var a,b=this.options.index,c=this.options.urlProperty;if(b&&"number"!=typeof b)for(a=0;a",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document);var Markdown;Markdown="object"==typeof exports&&"function"==typeof require?exports:{},function(){function a(a){return a}function b(a){return!1}function c(){}function d(){}c.prototype={chain:function(b,c){var d=this[b];if(!d)throw new Error("unknown hook "+b);d===a?this[b]=c:this[b]=function(a){var b=Array.prototype.slice.call(arguments,0);return b[0]=d.apply(null,b),c.apply(null,b)}},set:function(a,b){if(!this[a])throw new Error("unknown hook "+a);this[a]=b},addNoop:function(b){this[b]=a},addFalse:function(a){this[a]=b}},Markdown.HookCollection=c,d.prototype={set:function(a,b){this["s_"+a]=b},get:function(a){return this["s_"+a]}},Markdown.Converter=function(b){function e(a){return a=a.replace(/^[ ]{0,3}\[([^\[\]]+)\]:[ \t]*\n?[ \t]*?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(\n+)/gm,function(a,b,c,d,e,f,g){return b=b.toLowerCase(),L.set(b,A(c)),e?d+g:(f&&M.set(b,f.replace(/"/g,""")),"")})}function f(a){return a=a.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,h),a=a.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,h),a=a.replace(/\n[ ]{0,3}((<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,h),a=a.replace(/\n\n[ ]{0,3}(-]|-[^>])(?:[^-]|-[^-])*)--)>[ \t]*(?=\n{2,}))/g,h),a=a.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,h)}function g(a){return a=a.replace(/(^\n+|\n+$)/g,""),"\n\n~K"+(N.push(a)-1)+"K\n\n"}function h(a,b){return g(b)}function i(a,b,c){a=K.preBlockGamut(a,S),a=q(a);var d="
              \n";return a=a.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,d),a=a.replace(/^[ ]{0,2}([ ]?-[ ]?){3,}[ \t]*$/gm,d),a=a.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm,d),a=r(a),a=t(a),a=y(a),a=K.postBlockGamut(a,S),a=f(a),a=z(a,b,c)}function j(a){return a=K.preSpanGamut(a),a=u(a),a=k(a),a=B(a),a=n(a),a=l(a),a=D(a),a=a.replace(/~P/g,"://"),a=A(a),a=R(a),a=a.replace(/ +\n/g,"
              \n"),a=K.postSpanGamut(a)}function k(a){var b=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|-]|-[^>])(?:[^-]|-[^-])*)--)>)/gi;return a=a.replace(b,function(a){var b=a.replace(/(.)<\/?code>(?=.)/g,"$1`");return b=I(b,"!"==a.charAt(1)?"\\`*_/":"\\`*_")})}function l(a){return a.indexOf("[")===-1?a:(a=a.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,m),a=a.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,m),a=a.replace(/(\[([^\[\]]+)\])()()()()()/g,m))}function m(a,b,c,d,e,f,g,h){void 0==h&&(h="");var i=b,j=c.replace(/:\/\//g,"~P"),k=d.toLowerCase(),l=e,m=h;if(""==l)if(""==k&&(k=j.toLowerCase().replace(/ ?\n/g," ")),l="#"+k,void 0!=L.get(k))l=L.get(k),void 0!=M.get(k)&&(m=M.get(k));else{if(!(i.search(/\(\s*\)$/m)>-1))return i;l=""}l=H(l);var n='"}function n(a){return a.indexOf("![")===-1?a:(a=a.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,p),a=a.replace(/(!\[(.*?)\]\s?\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,p))}function o(a){return a.replace(/>/g,">").replace(/"+j(b)+"\n\n"}),a=a.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(a,b){return"

              "+j(b)+"

              \n\n"}),a=a.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(a,b,c){var d=b.length;return""+j(c)+"\n\n"})}function r(a,b){a+="~0";var c=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;return O?a=a.replace(c,function(a,c,d){var e,f=c,g=d.search(/[*+-]/g)>-1?"ul":"ol";"ol"===g&&(e=parseInt(d,10));var h=s(f,g,b);h=h.replace(/\s+$/,"");var i="<"+g;return e&&1!==e&&(i+=' start="'+e+'"'),h=i+">"+h+"\n"}):(c=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g,a=a.replace(c,function(a,b,c,d){var e,f=b,g=c,h=d.search(/[*+-]/g)>-1?"ul":"ol";"ol"===h&&(e=parseInt(d,10));var i=s(g,h),j="<"+h;return e&&1!==e&&(j+=' start="'+e+'"'),i=f+j+">\n"+i+"\n"})),a=a.replace(/~0/,"")}function s(a,b,c){O++,a=a.replace(/\n{2,}$/,"\n"),a+="~0";var d=T[b],e=new RegExp("(^[ \\t]*)("+d+")[ \\t]+([^\\r]+?(\\n+))(?=(~0|\\1("+d+")[ \\t]+))","gm"),f=!1;return a=a.replace(e,function(a,b,c,d){var e=d,g=/\n\n$/.test(e),h=g||e.search(/\n{2,}/)>-1,j=h||f;return e=i(F(e),!0,!j),f=g,"
            • "+e+"
            • \n"}),a=a.replace(/~0/g,""),O--,a}function t(a){return a}function u(a){return a=a.replace(/(^|[^\\`])(`+)(?!`)([^\r]*?[^`])\2(?!`)/gm,function(a,b,c,d,e){var f=d;return f=f.replace(/[ \t]*$/g,""),f=v(f),f=f.replace(/:\/\//g,"~P"),b+""+f+""})}function v(a){return a=a.replace(/&/g,"&"),a=a.replace(//g,">"),a=I(a,"*_{}[]\\",!1)}function w(a){return a.indexOf("*")===-1&&a.indexOf("_")===-1?a:(a=P(a),a=a.replace(/(^|[\W_])(?:(?!\1)|(?=^))(\*|_)\2(?=\S)([^\r]*?\S)\2\2(?!\2)(?=[\W_]|$)/g,"$1$3"),a=a.replace(/(^|[\W_])(?:(?!\1)|(?=^))(\*|_)(?=\S)((?:(?!\2)[^\r])*?\S)\2(?!\2)(?=[\W_]|$)/g,"$1$3"),Q(a))}function x(a){return a.indexOf("*")===-1&&a.indexOf("_")===-1?a:(a=P(a),a=a.replace(/(?=[^\r][*_]|[*_])(^|(?=\W__|(?!\*)[\W_]\*\*|\w\*\*\w)[^\r])(\*\*|__)(?!\2)(?=\S)((?:|[^\r]*?(?!\2)[^\r])(?=\S_|\w|\S\*\*(?:[\W_]|$)).)(?=__(?:\W|$)|\*\*(?:[^*]|$))\2/g,"$1$3"),a=a.replace(/(?=[^\r][*_]|[*_])(^|(?=\W_|(?!\*)(?:[\W_]\*|\D\*(?=\w)\D))[^\r])(\*|_)(?!\2\2\2)(?=\S)((?:(?!\2)[^\r])*?(?=[^\s_]_|(?=\w)\D\*\D|[^\s*]\*(?:[\W_]|$)).)(?=_(?:\W|$)|\*(?:[^*]|$))\2/g,"$1$3"),Q(a))}function y(a){return a=a.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(a,b){var c=b;return c=c.replace(/^[ \t]*>[ \t]?/gm,"~0"),c=c.replace(/~0/g,""),c=c.replace(/^[ \t]+$/gm,""),c=i(c),c=c.replace(/(^|\n)/g,"$1 "),c=c.replace(/(\s*
              [^\r]+?<\/pre>)/gm,function(a,b){var c=b;return c=c.replace(/^  /gm,"~0"),c=c.replace(/~0/g,"")}),g("
              \n"+c+"\n
              ")})}function z(a,b,c){a=a.replace(/^( )+/gm,function(a){return new Array(a.length+1).join(" ")}),a=a.replace(/^\n+/g,""),a=a.replace(/\n+$/g,"");for(var d=a.split(/\n{2,}/g),e=[],f=/~K(\d+)K/,g=d.length,h=0;h"),c||(i+="

              "),e.push(i))}if(!b){g=e.length;for(var h=0;h#+-.!])/g,J)}function C(a,b,c,d){if(b)return a;if(")"!==d.charAt(d.length-1))return"<"+c+d+">";for(var e=d.match(/[()]/g),f=0,g=0;g"+h}function D(a){a=a.replace(W,C);var b=function(a,b){var c=H(b);return'
              '+K.plainLinkText(b)+""};return a=a.replace(/<((https?|ftp):[^'">\s]+)>/gi,b)}function E(a){return a=a.replace(/~E(\d+)E/g,function(a,b){var c=parseInt(b);return String.fromCharCode(c)})}function F(a){return a=a.replace(/^(\t|[ ]{1,4})/gm,"~0"),a=a.replace(/~0/g,"")}function G(a){if(!/\t/.test(a))return a;var b,c=[" "," "," "," "],d=0;return a.replace(/[\n\t]/g,function(a,e){return"\n"===a?(d=e+1,a):(b=(e-d)%4,d=e+1,c[b])})}function H(a){return a=o(a),a=I(a,"*_:()[]")}function I(a,b,c){var d="(["+b.replace(/([\[\]\\])/g,"\\$1")+"])";c&&(d="\\\\"+d);var e=new RegExp(d,"g");return a=a.replace(e,J)}function J(a,b){var c=b.charCodeAt(0);return"~E"+c+"E"}var K=this.hooks=new c;K.addNoop("plainLinkText"),K.addNoop("preConversion"),K.addNoop("postNormalization"),K.addNoop("preBlockGamut"),K.addNoop("postBlockGamut"),K.addNoop("preSpanGamut"),K.addNoop("postSpanGamut"),K.addNoop("postConversion");var L,M,N,O;b=b||{};var P=a,Q=a;b.nonAsciiLetters&&!function(){var a=/[Q\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376-\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0523\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0621-\u064a\u0660-\u0669\u066e-\u066f\u0671-\u06d3\u06d5\u06e5-\u06e6\u06ee-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07c0-\u07ea\u07f4-\u07f5\u07fa\u0904-\u0939\u093d\u0950\u0958-\u0961\u0966-\u096f\u0971-\u0972\u097b-\u097f\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc-\u09dd\u09df-\u09e1\u09e6-\u09f1\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a59-\u0a5c\u0a5e\u0a66-\u0a6f\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0-\u0ae1\u0ae6-\u0aef\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3d\u0b5c-\u0b5d\u0b5f-\u0b61\u0b66-\u0b6f\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0be6-\u0bef\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58-\u0c59\u0c60-\u0c61\u0c66-\u0c6f\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0-\u0ce1\u0ce6-\u0cef\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d28\u0d2a-\u0d39\u0d3d\u0d60-\u0d61\u0d66-\u0d6f\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32-\u0e33\u0e40-\u0e46\u0e50-\u0e59\u0e81-\u0e82\u0e84\u0e87-\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa-\u0eab\u0ead-\u0eb0\u0eb2-\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0ed0-\u0ed9\u0edc-\u0edd\u0f00\u0f20-\u0f29\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8b\u1000-\u102a\u103f-\u1049\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070\u1075-\u1081\u108e\u1090-\u1099\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1159\u115f-\u11a2\u11a8-\u11f9\u1200-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u1676\u1681-\u169a\u16a0-\u16ea\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u17e0-\u17e9\u1810-\u1819\u1820-\u1877\u1880-\u18a8\u18aa\u1900-\u191c\u1946-\u196d\u1970-\u1974\u1980-\u19a9\u19c1-\u19c7\u19d0-\u19d9\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b50-\u1b59\u1b83-\u1ba0\u1bae-\u1bb9\u1c00-\u1c23\u1c40-\u1c49\u1c4d-\u1c7d\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u203f-\u2040\u2054\u2071\u207f\u2090-\u2094\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2183-\u2184\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2c6f\u2c71-\u2c7d\u2c80-\u2ce4\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3006\u3031-\u3035\u303b-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31b7\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fc3\ua000-\ua48c\ua500-\ua60c\ua610-\ua62b\ua640-\ua65f\ua662-\ua66e\ua67f-\ua697\ua717-\ua71f\ua722-\ua788\ua78b-\ua78c\ua7fb-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8d0-\ua8d9\ua900-\ua925\ua930-\ua946\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa50-\uaa59\uac00-\ud7a3\uf900-\ufa2d\ufa30-\ufa6a\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe33-\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]/g,b="Q".charCodeAt(0),c="A".charCodeAt(0),d="Z".charCodeAt(0),e="a".charCodeAt(0)-d-1;P=function(f){return f.replace(a,function(a){for(var f,g=a.charCodeAt(0),h="";g>0;)f=g%51+c,f>=b&&f++,f>d&&(f+=e),h=String.fromCharCode(f)+h,g=g/51|0;return"Q"+h+"Q"})},Q=function(a){return a.replace(/Q([A-PR-Za-z]{1,3})Q/g,function(a,f){for(var g,h=0,i=0;id&&(g-=e),g>b&&g--,g-=c,h=51*h+g;return String.fromCharCode(h)})}}();var R=b.asteriskIntraWordEmphasis?x:w;this.makeHtml=function(a){if(L)throw new Error("Recursive call to converter.makeHtml");return L=new d,M=new d,N=[],O=0,a=K.preConversion(a),a=a.replace(/~/g,"~T"),a=a.replace(/\$/g,"~D"),a=a.replace(/\r\n/g,"\n"),a=a.replace(/\r/g,"\n"),a="\n\n"+a+"\n\n",a=G(a),a=a.replace(/^[ \t]+$/gm,""),a=K.postNormalization(a),a=f(a),a=e(a),a=i(a),a=E(a),a=a.replace(/~D/g,"$$"),a=a.replace(/~T/g,"~"),a=K.postConversion(a),N=M=L=null,a};var S=function(a){return i(a)},T={ol:"\\d+[.]",ul:"[*+-]"},U="[-\\u00C0-\\u1FFF\\u2C00-\\uD7FF\\w0-9+&@#/%?=~_|[\\]()!:,.;]",V="[-\\u00C0-\\u1FFF\\u2C00-\\uD7FF\\w0-9+&@#/%=~_|[\\])]",W=new RegExp('(="|<)?\\b(https?|ftp)(://'+U+"*"+V+")(?=$|\\W)","gi"),X=new RegExp(V,"i")}}(),function(){function a(a){return a.replace(/<[^>]*>?/gi,b)}function b(a){return a.match(f)||a.match(g)||a.match(h)?a:j(a)}function c(a){if(""==a)return"";var b=/<\/?\w+[^>]*(\s|$|>)/g,c=a.toLowerCase().match(b),d=(c||[]).length;if(0==d)return a;for(var e,f,g,h="



            • ",i=[],j=[],k=!1,l=0;l")>-1)){if(f=c[l],g=-1,!/^<\//.test(f))for(var m=l+1;m"){g=m;break}g==-1?k=j[l]=!0:i[g]=!0}if(!k)return a;var l=0;return a=a.replace(b,function(a){var b=j[l]?"":a;return l++,b})}var d,e;"object"==typeof exports&&"function"==typeof require?(d=exports,e=require("./Markdown.Converter").Converter):(d=window.Markdown,e=d.Converter),d.getSanitizingConverter=function(){var b=new e;return b.hooks.chain("postConversion",a),b.hooks.chain("postConversion",c),b};var f=/^(<\/?(b|blockquote|code|del|dd|dl|dt|em|h1|h2|h3|h4|h5|h6|i|kbd|li|ol(?: start="\d+")?|p|pre|s|sup|sub|strong|strike|ul)>|<(br|hr)\s?\/?>)$/i,g=/^(]*")?(\stitle="[^"<>]+")?\s?>|<\/a>)$/i,h=/^(]*")?(\stitle="[^"<>]*")?\s?\/?>)$/i,i={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},j=function(a){return String(a).replace(/[&<>"'=\/]/g,function(a){return i[a]})}}(),function(){function a(a){return a.replace(/^\s+|\s+$/g,"")}function b(a){return a.replace(/\s+$/g,"")}function c(a){return a.replace(new RegExp("^(\\t|[ ]{1,4})","gm"),"")}function d(a,b){return a.indexOf(b)!=-1}function e(a,b){return a.replace(/<[^>]*>?/gi,function(a){return a.match(b)?a:""})}function f(a,b){for(var c={},d=0;d]*>|","<(br)\\s?\\/?>)$"].join(""),"i");Array.indexOf||(Array.prototype.indexOf=function(a){for(var b=0;b~X"+(this.hashBlocks.push(a)-1)+"X

              \n"},Markdown.Extra.prototype.hashExtraInline=function(a){return"~X"+(this.hashBlocks.push(a)-1)+"X"},Markdown.Extra.prototype.unHashExtraBlocks=function(a){function b(){var d=!1;a=a.replace(/(?:

              )?~X(\d+)X(?:<\/p>)?/g,function(a,b){d=!0;var e=parseInt(b,10);return c.hashBlocks[e]}),d===!0&&b()}var c=this;return b(),a},Markdown.Extra.prototype.wrapHeaders=function(a){function b(a){return"\n"+a+"\n"}return a=a.replace(/^.+[ \t]*\n=+[ \t]*\n+/gm,b),a=a.replace(/^.+[ \t]*\n-+[ \t]*\n+/gm,b),a=a.replace(/^\#{1,6}[ \t]*.+?[ \t]*\#*\n+/gm,b)};var q="\\{[ \\t]*((?:[#.][-_:a-zA-Z0-9]+[ \\t]*)+)\\}",r=new RegExp("^(#{1,6}.*#{0,6})[ \\t]+"+q+"[ \\t]*(?:\\n|0x03)","gm"),s=new RegExp("^(.*)[ \\t]+"+q+"[ \\t]*\\n(?=[\\-|=]+\\s*(?:\\n|0x03))","gm"),t=new RegExp("^(```[^`\\n]*)[ \\t]+"+q+"[ \\t]*\\n(?=([\\s\\S]*?)\\n```[ \\t]*(\\n|0x03))","gm");Markdown.Extra.prototype.hashHeaderAttributeBlocks=function(a){function b(a,b,d){return"

              ~XX"+(c.hashBlocks.push(d)-1)+"XX

              \n"+b+"\n"}var c=this;return a=a.replace(r,b),a=a.replace(s,b)},Markdown.Extra.prototype.hashFcbAttributeBlocks=function(a){function b(a,b,d){return"

              ~XX"+(c.hashBlocks.push(d)-1)+"XX

              \n"+b+"\n"}var c=this;return a.replace(t,b)},Markdown.Extra.prototype.applyAttributeBlocks=function(a){var b=this,c=new RegExp('

              ~XX(\\d+)XX

              [\\s]*(?:<(h[1-6]|pre)(?: +class="(\\S+)")?(>[\\s\\S]*?))',"gm");return a=a.replace(c,function(a,c,d,e,g){if(!d)return"";for(var h=parseInt(c,10),i=b.hashBlocks[h],j=i.match(/#[^\s#.]+/g)||[],k=j[0]?' id="'+j[0].substr(1,j[0].length-1)+'"':"",l=i.match(/\.[^\s#.]+/g)||[],m=0;m0&&(n=' class="'+l.join(" ")+'"'),"<"+d+k+n+g})},Markdown.Extra.prototype.tables=function(b){function c(b,c,e,f,g,h){c=c.replace(/^ *[|]/m,""),e=e.replace(/^ *[|]/m,""),f=f.replace(/^ *[|]/gm,""),c=c.replace(/[|] *$/m,""),e=e.replace(/[|] *$/m,""),f=f.replace(/[|] *$/gm,"");for(var j=e.split(/ *[|] */),k=[],l=0;l\n","\n","\n"].join("");for(l=0;l",r,"\n"].join("")}q+="\n\n";var s=f.split("\n");for(l=0;l\n",v=0;v",w,"\n"].join("")}q+="\n"}return q+="\n",d.hashExtraBlock(q)}var d=this,e=new RegExp(["^","[ ]{0,3}","[|]","(.+)\\n","[ ]{0,3}","[|]([ ]*[-:]+[-| :]*)\\n","(","(?:[ ]*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm"),f=new RegExp(["^","[ ]{0,3}","(\\S.*[|].*)\\n","[ ]{0,3}","([-:]+[ ]*[|][-| :]*)\\n","(","(?:.*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm");return b=b.replace(e,c),b=b.replace(f,c)},Markdown.Extra.prototype.stripFootnoteDefinitions=function(a){var b=this;return a=a.replace(/\n[ ]{0,3}\[\^(.+?)\]\:[ \t]*\n?([\s\S]*?)\n{1,2}((?=\n[ ]{0,3}\S)|$)/g,function(a,c,d){return c=n(c),d+="\n",d=d.replace(/^[ ]{0,3}/g,""),b.footnotes[c]=d,"\n"})},Markdown.Extra.prototype.doFootnotes=function(a){var b=this;if(b.isConvertingFootnote===!0)return a;var c=0;return a=a.replace(/\[\^(.+?)\]/g,function(a,d){var e=n(d),f=b.footnotes[e];if(void 0===f)return a;c++,b.usedFootnotes.push(e);var g=''+c+"";return b.hashExtraInline(g)})},Markdown.Extra.prototype.printFootnotes=function(a){var b=this;if(0===b.usedFootnotes.length)return a;a+='\n\n
              \n
              \n
                \n\n';for(var c=0;c'+f+' \n\n'}return a+="
              \n
              "},Markdown.Extra.prototype.fencedCodeBlocks=function(b){function c(a){return a=a.replace(/&/g,"&"),a=a.replace(//g,">"),a=a.replace(/~D/g,"$$"),a=a.replace(/~T/g,"~")}var d=this;return b=b.replace(/(?:^|\n)```([^`\n]*)\n([\s\S]*?)\n```[ \t]*(?=\n)/g,function(b,e,f){var g=a(e),h=f,i=d.googleCodePrettify?' class="prettyprint"':"",j="";g&&(j=d.googleCodePrettify||d.highlightJs?' class="language-'+g+'"':' class="'+g+'"');var k=["",c(h),"
            • "].join("");return d.hashExtraBlock(k)})},Markdown.Extra.prototype.educatePants=function(a){var b=this,c="",d=0;a.replace(/(?:)|(<)([a-zA-Z1-6]+)([^\n]*?>)([\s\S]*?)(<\/\2>)/g,function(e,f,g,h,i,j,k){var l=a.substring(d,k);return c+=b.applyPants(l),b.smartyPantsLastChar=c.substring(c.length-1),d=k+e.length,f?(/code|kbd|pre|script|noscript|iframe|math|ins|del|pre/i.test(g)?b.smartyPantsLastChar=i.substring(i.length-1):i=b.educatePants(i),void(c+=f+g+h+i+j)):void(c+=e)});var e=a.substring(d);return c+=b.applyPants(e),b.smartyPantsLastChar=c.substring(c.length-1),c},Markdown.Extra.prototype.applyPants=function(a){return a=a.replace(/---/g,"—").replace(/--/g,"–"),a=a.replace(/\.\.\./g,"…").replace(/\.\s\.\s\./g,"…"),a=a.replace(/``/g,"“").replace(/''/g,"”"),/^'$/.test(a)?/\S/.test(this.smartyPantsLastChar)?"’":"‘":/^"$/.test(a)?/\S/.test(this.smartyPantsLastChar)?"”":"“":(a=a.replace(/^'(?=[!"#\$\%'()*+,\-.\/:;<=>?\@\[\\]\^_`{|}~]\B)/,"’"),a=a.replace(/^"(?=[!"#\$\%'()*+,\-.\/:;<=>?\@\[\\]\^_`{|}~]\B)/,"”"),a=a.replace(/"'(?=\w)/g,"“‘"),a=a.replace(/'"(?=\w)/g,"‘“"),a=a.replace(/'(?=\d{2}s)/g,"’"),a=a.replace(/(\s| |--|&[mn]dash;|&\#8211;|&\#8212;|&\#x201[34];)'(?=\w)/g,"$1‘"),a=a.replace(/([^\s\[\{\(\-])'/g,"$1’"),a=a.replace(/'(?=\s|s\b)/g,"’"),a=a.replace(/'/g,"‘"),a=a.replace(/(\s| |--|&[mn]dash;|&\#8211;|&\#8212;|&\#x201[34];)"(?=\w)/g,"$1“"),a=a.replace(/([^\s\[\{\(\-])"/g,"$1”"),a=a.replace(/"(?=\s)/g,"”"),a=a.replace(/"/gi,"“"))},Markdown.Extra.prototype.runSmartyPants=function(a){return this.smartyPantsLastChar="",a=this.educatePants(a),a=a.replace(/(<([a-zA-Z1-6]+)\b([^\n>]*?)(\/)?>)/g,o)},Markdown.Extra.prototype.definitionLists=function(b){var c=new RegExp(["(\\x02\\n?|\\n\\n)","(?:","(","(","[ ]{0,3}","((?:[ \\t]*\\S.*\\n)+)","\\n?","[ ]{0,3}:[ ]+",")","([\\s\\S]+?)","(","(?=\\0x03)","|","(?=","\\n{2,}","(?=\\S)","(?!","[ ]{0,3}","(?:\\S.*\\n)+?","\\n?","[ ]{0,3}:[ ]+",")","(?!","[ ]{0,3}:[ ]+",")",")",")",")",")"].join(""),"gm"),d=this;return b=g(b),b=b.replace(c,function(b,c,e){var f=a(d.processDefListItems(e));return f="
              \n"+f+"\n
              ",c+d.hashExtraBlock(f)+"\n\n"}),h(b)},Markdown.Extra.prototype.processDefListItems=function(d){var e=this,f=new RegExp(["(\\x02\\n?|\\n\\n+)","(","[ ]{0,3}","(?![:][ ]|[ ])","(?:\\S.*\\n)+?",")","(?=\\n?[ ]{0,3}:[ ])"].join(""),"gm"),k=new RegExp(["\\n(\\n+)?","(","[ ]{0,3}","[:][ ]+",")","([\\s\\S]+?)","(?=\\n*","(?:","\\n[ ]{0,3}[:][ ]|","
              |\\x03",")",")"].join(""),"gm");return d=g(d),d=d.replace(/\n{2,}(?=\\x03)/,"\n"),d=d.replace(f,function(b,c,d){for(var f=a(d).split("\n"),g="",h=0;h"+j+"
              "}return g+"\n"}),d=d.replace(k,function(a,d,f,g){return d||g.match(/\n{2,}/)?(g=Array(f.length+1).join(" ")+g,g=c(g)+"\n\n",g="\n"+j(g,e)+"\n"):(g=b(g),g=i(c(g),e)),"\n
              "+g+"
              \n"}),h(d)},Markdown.Extra.prototype.strikethrough=function(a){return a.replace(/([\W_]|^)~T~T(?=\S)([^\r]*?\S[\*_]*)~T~T([\W_]|$)/g,"$1$2$3")},Markdown.Extra.prototype.newlines=function(a){return a.replace(/(<(?:br|\/li)>)?\n/g,function(a,b){return b?a:"
              \n"})}}(),function(a,b){"undefined"!=typeof module?module.exports=b():"function"==typeof define&&"object"==typeof define.amd?define(b):this[a]=b()}("clipboard",function(){if("undefined"==typeof document||!document.addEventListener)return null;var a={};return a.copy=function(){function a(){b=!1,c=null,d&&window.getSelection().removeAllRanges(),d=!1}var b=!1,c=null,d=!1;return document.addEventListener("copy",function(a){if(b){for(var d in c)a.clipboardData.setData(d,c[d]);a.preventDefault()}}),function(e){return new Promise(function(f,g){function h(b){try{if(document.execCommand("copy"))a(),f();else{if(b)throw a(),Error("Unable to copy. Perhaps it's not available in your browser?");var c=document.getSelection();if(!document.queryCommandEnabled("copy")&&c.isCollapsed){var e=document.createRange();e.selectNodeContents(document.body),c.removeAllRanges(),c.addRange(e),d=!0}h(!0)}}catch(i){a(),g(i)}}b=!0,"string"==typeof e?c={"text/plain":e}:e instanceof Node?c={"text/html":(new XMLSerializer).serializeToString(e)}:e instanceof Object?c=e:g("Invalid data type. Must be string, DOM node, or an object mapping MIME types to strings."),h(!1)})}}(),a.paste=function(){var a,b,c=!1;return document.addEventListener("paste",function(d){if(c){c=!1,d.preventDefault();var e=a;a=null,e(d.clipboardData.getData(b))}}),function(d){return new Promise(function(e,f){c=!0,a=e,b=d||"text/plain";try{document.execCommand("paste")||(c=!1,f(Error("Unable to paste. Pasting only works in Internet Explorer at the moment.")))}catch(g){c=!1,f(Error(g))}})}}(),"undefined"==typeof ClipboardEvent&&"undefined"!=typeof window.clipboardData&&"undefined"!=typeof window.clipboardData.setData&&(function(a){function b(a,b){return function(){a.apply(b,arguments)}}function c(a){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._value=this._state=null,this._deferreds=[],i(a,b(e,this),b(f,this))}function d(a){var b=this;return null===this._state?void this._deferreds.push(a):void j(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value); +var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function e(a){try{if(a===this)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void i(b(c,a),b(e,this),b(f,this))}this._state=!0,this._value=a,g.call(this)}catch(d){f.call(this,d)}}function f(a){this._state=!1,this._value=a,g.call(this)}function g(){for(var a=0,b=this._deferreds.length;b>a;a++)d.call(this,this._deferreds[a]);this._deferreds=null}function h(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function i(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){d||(d=!0,c(e))}}var j=c.immediateFn||"function"==typeof setImmediate&&setImmediate||function(a){setTimeout(a,1)},k=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};c.prototype["catch"]=function(a){return this.then(null,a)},c.prototype.then=function(a,b){var e=this;return new c(function(c,f){d.call(e,new h(a,b,c,f))})},c.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&k(arguments[0])?arguments[0]:arguments);return new c(function(b,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;fd;d++)a[d].then(b,c)})},"undefined"!=typeof module&&module.exports?module.exports=c:a.Promise||(a.Promise=c)}(this),a.copy=function(a){return new Promise(function(b,c){if("string"!=typeof a&&!("text/plain"in a))throw Error("You must provide a text/plain type.");window.clipboardData.setData("Text","string"==typeof a?a:a["text/plain"])?b():c(Error("Copying was rejected."))})},a.paste=function(){return new Promise(function(a,b){var c=window.clipboardData.getData("Text");c?a(c):b(Error("Pasting was rejected."))})}),a}),/*! + * imagesLoaded PACKAGED v4.1.3 + * JavaScript is all like "You images are done yet or what?" + * MIT License + */ +!function(a,b){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",b):"object"==typeof module&&module.exports?module.exports=b():a.EvEmitter=b()}("undefined"!=typeof window?window:this,function(){function a(){}var b=a.prototype;return b.on=function(a,b){if(a&&b){var c=this._events=this._events||{},d=c[a]=c[a]||[];return-1==d.indexOf(b)&&d.push(b),this}},b.once=function(a,b){if(a&&b){this.on(a,b);var c=this._onceEvents=this._onceEvents||{},d=c[a]=c[a]||{};return d[b]=!0,this}},b.off=function(a,b){var c=this._events&&this._events[a];if(c&&c.length){var d=c.indexOf(b);return-1!=d&&c.splice(d,1),this}},b.emitEvent=function(a,b){var c=this._events&&this._events[a];if(c&&c.length){var d=0,e=c[d];b=b||[];for(var f=this._onceEvents&&this._onceEvents[a];e;){var g=f&&f[e];g&&(this.off(a,e),delete f[e]),e.apply(this,b),d+=g?0:1,e=c[d]}return this}},b.allOff=b.removeAllListeners=function(){delete this._events,delete this._onceEvents},a}),function(a,b){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("ev-emitter")):a.imagesLoaded=b(a,a.EvEmitter)}("undefined"!=typeof window?window:this,function(a,b){function c(a,b){for(var c in b)a[c]=b[c];return a}function d(a){var b=[];if(Array.isArray(a))b=a;else if("number"==typeof a.length)for(var c=0;cf?a:f)-e-1),this.slideWidth*c,0);a=this.circle(a),this.move(f,this.slideWidth*c,b),this.move(a,0,b),this.options.continuous&&this.move(this.circle(a-c),-(this.slideWidth*c),0)}else a=this.circle(a),this.animate(f*-this.slideWidth,a*-this.slideWidth,b);this.onslide(a)}},getIndex:function(){return this.index},getNumber:function(){return this.num},prev:function(){(this.options.continuous||this.index)&&this.slide(this.index-1)},next:function(){(this.options.continuous||this.index1&&(this.timeout=this.setTimeout(!this.requestAnimationFrame&&this.slide||function(a,c){b.animationFrameId=b.requestAnimationFrame.call(window,function(){b.slide(a,c)})},[this.index+1,this.options.slideshowTransitionSpeed],this.interval)),this.container.addClass(this.options.playingClass)},pause:function(){window.clearTimeout(this.timeout),this.interval=null,this.container.removeClass(this.options.playingClass)},add:function(a){var b;for(a.concat||(a=Array.prototype.slice.call(a)),this.list.concat||(this.list=Array.prototype.slice.call(this.list)),this.list=this.list.concat(a),this.num=this.list.length,this.num>2&&null===this.options.continuous&&(this.options.continuous=!0,this.container.removeClass(this.options.leftEdgeClass)),this.container.removeClass(this.options.rightEdgeClass).removeClass(this.options.singleClass),b=this.num-a.length;bc?(d.slidesContainer[0].style.left=b+"px",d.ontransitionend(),void window.clearInterval(f)):void(d.slidesContainer[0].style.left=(b-a)*(Math.floor(g/c*100)/100)+a+"px")},4)},preventDefault:function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},onresize:function(){this.initSlides(!0)},onmousedown:function(a){a.which&&1===a.which&&"VIDEO"!==a.target.nodeName&&(a.preventDefault(),(a.originalEvent||a).touches=[{pageX:a.pageX,pageY:a.pageY}],this.ontouchstart(a))},onmousemove:function(a){this.touchStart&&((a.originalEvent||a).touches=[{pageX:a.pageX,pageY:a.pageY}],this.ontouchmove(a))},onmouseup:function(a){this.touchStart&&(this.ontouchend(a),delete this.touchStart)},onmouseout:function(b){if(this.touchStart){var c=b.target,d=b.relatedTarget;(!d||d!==c&&!a.contains(c,d))&&this.onmouseup(b)}},ontouchstart:function(a){this.options.stopTouchEventsPropagation&&this.stopPropagation(a);var b=(a.originalEvent||a).touches[0];this.touchStart={x:b.pageX,y:b.pageY,time:Date.now()},this.isScrolling=void 0,this.touchDelta={}},ontouchmove:function(a){this.options.stopTouchEventsPropagation&&this.stopPropagation(a);var b,c,d=(a.originalEvent||a).touches[0],e=(a.originalEvent||a).scale,f=this.index;if(!(d.length>1||e&&1!==e))if(this.options.disableScroll&&a.preventDefault(),this.touchDelta={x:d.pageX-this.touchStart.x,y:d.pageY-this.touchStart.y},b=this.touchDelta.x,void 0===this.isScrolling&&(this.isScrolling=this.isScrolling||Math.abs(b)0||f===this.num-1&&0>b?Math.abs(b)/this.slideWidth+1:1,c=[f],f&&c.push(f-1),f20||Math.abs(this.touchDelta.x)>i/2,l=!g&&this.touchDelta.x>0||g===this.num-1&&this.touchDelta.x<0,m=!k&&this.options.closeOnSwipeUpOrDown&&(j&&Math.abs(this.touchDelta.y)>20||Math.abs(this.touchDelta.y)>this.slideHeight/2);this.options.continuous&&(l=!1),b=this.touchDelta.x<0?-1:1,this.isScrolling?m?this.close():this.translateY(g,0,h):k&&!l?(c=g+b,d=g-b,e=i*b,f=-i*b,this.options.continuous?(this.move(this.circle(c),e,0),this.move(this.circle(g-2*b),f,0)):c>=0&&cthis.container[0].clientHeight&&(d.style.maxHeight=this.container[0].clientHeight),this.interval&&this.slides[this.index]===e&&this.play(),this.setTimeout(this.options.onslidecomplete,[c,e]))},onload:function(a){this.oncomplete(a)},onerror:function(a){this.oncomplete(a)},onkeydown:function(a){switch(a.which||a.keyCode){case 13:this.options.toggleControlsOnReturn&&(this.preventDefault(a),this.toggleControls());break;case 27:this.options.closeOnEscape&&(this.close(),a.stopImmediatePropagation());break;case 32:this.options.toggleSlideshowOnSpace&&(this.preventDefault(a),this.toggleSlideshow());break;case 37:this.options.enableKeyboardNavigation&&(this.preventDefault(a),this.prev());break;case 39:this.options.enableKeyboardNavigation&&(this.preventDefault(a),this.next())}},handleClick:function(b){function c(b){return a(e).hasClass(b)||a(f).hasClass(b)}var d=this.options,e=b.target||b.srcElement,f=e.parentNode;c(d.toggleClass)?(this.preventDefault(b),this.toggleControls()):c(d.prevClass)?(this.preventDefault(b),this.prev()):c(d.nextClass)?(this.preventDefault(b),this.next()):c(d.closeClass)?(this.preventDefault(b),this.close()):c(d.playPauseClass)?(this.preventDefault(b),this.toggleSlideshow()):f===this.slidesContainer[0]?d.closeOnSlideClick?(this.preventDefault(b),this.close()):d.toggleControlsOnSlideClick&&(this.preventDefault(b),this.toggleControls()):f.parentNode&&f.parentNode===this.slidesContainer[0]&&d.toggleControlsOnSlideClick&&(this.preventDefault(b),this.toggleControls())},onclick:function(a){return this.options.emulateTouchEvents&&this.touchDelta&&(Math.abs(this.touchDelta.x)>20||Math.abs(this.touchDelta.y)>20)?void delete this.touchDelta:this.handleClick(a)},updateEdgeClasses:function(a){a?this.container.removeClass(this.options.leftEdgeClass):this.container.addClass(this.options.leftEdgeClass),a===this.num-1?this.container.addClass(this.options.rightEdgeClass):this.container.removeClass(this.options.rightEdgeClass)},handleSlide:function(a){this.options.continuous||this.updateEdgeClasses(a),this.loadElements(a),this.options.unloadElements&&this.unloadElements(a),this.setTitle(a)},onslide:function(a){this.index=a,this.handleSlide(a),this.setTimeout(this.options.onslide,[a,this.slides[a]])},setTitle:function(a){var b=this.slides[a].firstChild.title,c=this.titleElement;c.length&&(this.titleElement.empty(),b&&c[0].appendChild(document.createTextNode(b)))},setTimeout:function(a,b,c){var d=this;return a&&window.setTimeout(function(){a.apply(d,b||[])},c||0)},imageFactory:function(b,c){function d(b){if(!e){if(b={type:b.type,target:f},!f.parentNode)return h.setTimeout(d,[b]);e=!0,a(i).off("load error",d),k&&"load"===b.type&&(f.style.background='url("'+j+'") center no-repeat',f.style.backgroundSize=k),c(b)}}var e,f,g,h=this,i=this.imagePrototype.cloneNode(!1),j=b,k=this.options.stretchImages;return"string"!=typeof j&&(j=this.getItemProperty(b,this.options.urlProperty),g=this.getItemProperty(b,this.options.titleProperty)),k===!0&&(k="contain"),k=this.support.backgroundSize&&this.support.backgroundSize[k]&&k,k?f=this.elementPrototype.cloneNode(!1):(f=i,i.draggable=!1),g&&(f.title=g),a(i).on("load error",d),i.src=j,f},createElement:function(b,c){var d=b&&this.getItemProperty(b,this.options.typeProperty),e=d&&this[d.split("/")[0]+"Factory"]||this.imageFactory,f=b&&e.call(this,b,c),g=this.getItemProperty(b,this.options.srcsetProperty);return f||(f=this.elementPrototype.cloneNode(!1),this.setTimeout(c,[{type:"error",target:f}])),g&&f.setAttribute("srcset",g),a(f).addClass(this.options.slideContentClass),f},loadElement:function(b){this.elements[b]||(this.slides[b].firstChild?this.elements[b]=a(this.slides[b]).hasClass(this.options.slideErrorClass)?3:2:(this.elements[b]=1,a(this.slides[b]).addClass(this.options.slideLoadingClass),this.slides[b].appendChild(this.createElement(this.list[b],this.proxyListener))))},loadElements:function(a){var b,c=Math.min(this.num,2*this.options.preloadRange+1),d=a;for(b=0;c>b;b+=1)d+=b*(b%2===0?-1:1),d=this.circle(d),this.loadElement(d)},unloadElements:function(a){var b,c;for(b in this.elements)this.elements.hasOwnProperty(b)&&(c=Math.abs(a-b),c>this.options.preloadRange&&c+this.options.preloadRangea?-this.slideWidth:this.indexa;a++)this.unloadSlide(a)},toggleControls:function(){var a=this.options.controlsClass;this.container.hasClass(a)?this.container.removeClass(a):this.container.addClass(a)},toggleSlideshow:function(){this.interval?this.pause():this.play()},getNodeIndex:function(a){return parseInt(a.getAttribute("data-index"),10)},getNestedProperty:function(a,b){return b.replace(/\[(?:'([^']+)'|"([^"]+)"|(\d+))\]|(?:(?:^|\.)([^\.\[]+))/g,function(b,c,d,e,f){var g=f||c||d||e&&parseInt(e,10);b&&a&&(a=a[g])}),a},getDataProperty:function(b,c){if(b.getAttribute){var d=b.getAttribute("data-"+c.replace(/([A-Z])/g,"-$1").toLowerCase());if("string"==typeof d){if(/^(true|false|null|-?\d+(\.\d+)?|\{[\s\S]*\}|\[[\s\S]*\])$/.test(d))try{return a.parseJSON(d)}catch(e){}return d}}},getItemProperty:function(a,b){var c=a[b];return void 0===c&&(c=this.getDataProperty(a,b),void 0===c&&(c=this.getNestedProperty(a,b))),c},initStartIndex:function(){var a,b=this.options.index,c=this.options.urlProperty;if(b&&"number"!=typeof b)for(a=0;ad?t.getScrollLeft()>=t.page.maxw:0>=t.getScrollLeft())&&(e=d,d=0)),d&&(t.scrollmom&&t.scrollmom.stop(),t.lastdeltax+=d,t.debounced("mousewheelx",function(){var a=t.lastdeltax;t.lastdeltax=0,t.rail.drag||t.doScrollLeftBy(a)},15)),e){if(t.opt.nativeparentscrolling&&c&&!t.ispage&&!t.zoomactive)if(0>e){if(t.getScrollTop()>=t.page.maxh)return!0}else if(0>=t.getScrollTop())return!0;t.scrollmom&&t.scrollmom.stop(),t.lastdeltay+=e,t.debounced("mousewheely",function(){var a=t.lastdeltay;t.lastdeltay=0,t.rail.drag||t.doScrollBy(a)},15)}return a.stopImmediatePropagation(),a.preventDefault()}var t=this;if(this.version="3.6.6",this.name="nicescroll",this.me=j,this.opt={doc:a("body"),win:!1},a.extend(this.opt,m),this.opt.snapbackspeed=80,g)for(var u in t.opt)"undefined"!=typeof g[u]&&(t.opt[u]=g[u]);this.iddoc=(this.doc=t.opt.doc)&&this.doc[0]?this.doc[0].id||"":"",this.ispage=/^BODY|HTML/.test(t.opt.win?t.opt.win[0].nodeName:this.doc[0].nodeName),this.haswrapper=!1!==t.opt.win,this.win=t.opt.win||(this.ispage?a(window):this.doc),this.docscroll=this.ispage&&!this.haswrapper?a(window):this.win,this.body=a("body"),this.iframe=this.isfixed=this.viewport=!1,this.isiframe="IFRAME"==this.doc[0].nodeName&&"IFRAME"==this.win[0].nodeName,this.istextarea="TEXTAREA"==this.win[0].nodeName,this.forcescreen=!1,this.canshowonmouseevent="scroll"!=t.opt.autohidemode,this.page=this.view=this.onzoomout=this.onzoomin=this.onscrollcancel=this.onscrollend=this.onscrollstart=this.onclick=this.ongesturezoom=this.onkeypress=this.onmousewheel=this.onmousemove=this.onmouseup=this.onmousedown=!1,this.scroll={x:0,y:0},this.scrollratio={x:0,y:0},this.cursorheight=20,this.scrollvaluemax=0,this.isrtlmode="auto"==this.opt.rtlmode?"rtl"==(this.win[0]==window?this.body:this.win).css("direction"):!0===this.opt.rtlmode,this.observerbody=this.observerremover=this.observer=this.scrollmom=this.scrollrunning=!1;do this.id="ascrail"+e++;while(document.getElementById(this.id));this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.selectiondrag=this.cursorfreezed=this.cursor=this.rail=!1,this.visibility=!0,this.hidden=this.locked=this.railslocked=!1,this.cursoractive=!0,this.wheelprevented=!1,this.overflowx=t.opt.overflowx,this.overflowy=t.opt.overflowy,this.nativescrollingarea=!1,this.checkarea=0,this.events=[],this.saved={},this.delaylist={},this.synclist={},this.lastdeltay=this.lastdeltax=0,this.detected=o();var v=a.extend({},this.detected);this.ishwscroll=(this.canhwscroll=v.hastransform&&t.opt.hwacceleration)&&t.haswrapper,this.hasreversehr=this.isrtlmode&&!v.iswebkit,this.istouchcapable=!1,!v.cantouch||v.isios||v.isandroid||!v.iswebkit&&!v.ismozilla||(this.istouchcapable=!0,v.cantouch=!1),t.opt.enablemouselockapi||(v.hasmousecapture=!1,v.haspointerlock=!1),this.debounced=function(a,b,c){var d=t.delaylist[a];t.delaylist[a]=b,d||(t.debouncedelayed=setTimeout(function(){if(t){var b=t.delaylist[a];t.delaylist[a]=!1,b.call(t)}},c))};var w=!1;this.synched=function(a,b){return t.synclist[a]=b,function(){w||(h(function(){w=!1;for(var a in t.synclist){var b=t.synclist[a];b&&b.call(t),t.synclist[a]=!1}}),w=!0)}(),a},this.unsynched=function(a){t.synclist[a]&&(t.synclist[a]=!1)},this.css=function(a,b){for(var c in b)t.saved.css.push([a,c,a.css(c)]),a.css(c,b[c])},this.scrollTop=function(a){return"undefined"==typeof a?t.getScrollTop():t.setScrollTop(a)},this.scrollLeft=function(a){return"undefined"==typeof a?t.getScrollLeft():t.setScrollLeft(a)};var x=function(a,b,c,d,e,f,g){this.st=a,this.ed=b,this.spd=c,this.p1=d||0,this.p2=e||1,this.p3=f||0,this.p4=g||1,this.ts=(new Date).getTime(),this.df=this.ed-this.st};if(x.prototype={B2:function(a){return 3*a*a*(1-a)},B3:function(a){return 3*a*(1-a)*(1-a)},B4:function(a){return(1-a)*(1-a)*(1-a)},getNow:function(){var a=1-((new Date).getTime()-this.ts)/this.spd,b=this.B2(a)+this.B3(a)+this.B4(a);return 0>a?this.ed:this.st+Math.round(this.df*b)},update:function(a,b){return this.st=this.getNow(),this.ed=a,this.spd=b,this.ts=(new Date).getTime(),this.df=this.ed-this.st,this}},this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"},v.hastranslate3d&&v.isios&&this.doc.css("-webkit-backface-visibility","hidden"),this.getScrollTop=function(a){if(!a){if(a=k())return 16==a.length?-a[13]:-a[5];if(t.timerscroll&&t.timerscroll.bz)return t.timerscroll.bz.getNow()}return t.doc.translate.y},this.getScrollLeft=function(a){if(!a){if(a=k())return 16==a.length?-a[12]:-a[4];if(t.timerscroll&&t.timerscroll.bh)return t.timerscroll.bh.getNow()}return t.doc.translate.x},this.notifyScrollEvent=function(a){var b=document.createEvent("UIEvents");b.initUIEvent("scroll",!1,!0,window,1),b.niceevent=!0,a.dispatchEvent(b)};var y=this.isrtlmode?1:-1;v.hastranslate3d&&t.opt.enabletranslate3d?(this.setScrollTop=function(a,b){t.doc.translate.y=a,t.doc.translate.ty=-1*a+"px",t.doc.css(v.trstyle,"translate3d("+t.doc.translate.tx+","+t.doc.translate.ty+",0px)"),b||t.notifyScrollEvent(t.win[0])},this.setScrollLeft=function(a,b){t.doc.translate.x=a,t.doc.translate.tx=a*y+"px",t.doc.css(v.trstyle,"translate3d("+t.doc.translate.tx+","+t.doc.translate.ty+",0px)"),b||t.notifyScrollEvent(t.win[0])}):(this.setScrollTop=function(a,b){t.doc.translate.y=a,t.doc.translate.ty=-1*a+"px",t.doc.css(v.trstyle,"translate("+t.doc.translate.tx+","+t.doc.translate.ty+")"),b||t.notifyScrollEvent(t.win[0])},this.setScrollLeft=function(a,b){t.doc.translate.x=a,t.doc.translate.tx=a*y+"px",t.doc.css(v.trstyle,"translate("+t.doc.translate.tx+","+t.doc.translate.ty+")"),b||t.notifyScrollEvent(t.win[0])})}else this.getScrollTop=function(){return t.docscroll.scrollTop()},this.setScrollTop=function(a){return setTimeout(function(){t.docscroll.scrollTop(a)},1)},this.getScrollLeft=function(){return t.detected.ismozilla&&t.isrtlmode?Math.abs(t.docscroll.scrollLeft()):t.docscroll.scrollLeft()},this.setScrollLeft=function(a){return setTimeout(function(){t.docscroll.scrollLeft(t.detected.ismozilla&&t.isrtlmode?-a:a)},1)};this.getTarget=function(a){return!!a&&(a.target?a.target:!!a.srcElement&&a.srcElement)},this.hasParent=function(a,b){if(!a)return!1;for(var c=a.target||a.srcElement||a||!1;c&&c.id!=b;)c=c.parentNode||!1;return!1!==c};var z={thin:1,medium:3,thick:5};this.getDocumentScrollOffset=function(){return{top:window.pageYOffset||document.documentElement.scrollTop,left:window.pageXOffset||document.documentElement.scrollLeft}},this.getOffset=function(){if(t.isfixed){var a=t.win.offset(),b=t.getDocumentScrollOffset();return a.top-=b.top,a.left-=b.left,a}return a=t.win.offset(),t.viewport?(b=t.viewport.offset(),{top:a.top-b.top,left:a.left-b.left}):a},this.updateScrollBar=function(a){if(t.ishwscroll)t.rail.css({height:t.win.innerHeight()-(t.opt.railpadding.top+t.opt.railpadding.bottom)}),t.railh&&t.railh.css({width:t.win.innerWidth()-(t.opt.railpadding.left+t.opt.railpadding.right)});else{var b=t.getOffset(),c=b.top,d=b.left-(t.opt.railpadding.left+t.opt.railpadding.right),c=c+p(t.win,"border-top-width",!0),d=d+(t.rail.align?t.win.outerWidth()-p(t.win,"border-right-width")-t.rail.width:p(t.win,"border-left-width")),e=t.opt.railoffset;e&&(e.top&&(c+=e.top),e.left&&(d+=e.left)),t.railslocked||t.rail.css({top:c,left:d,height:(a?a.h:t.win.innerHeight())-(t.opt.railpadding.top+t.opt.railpadding.bottom)}),t.zoom&&t.zoom.css({top:c+1,left:1==t.rail.align?d-20:d+t.rail.width+4}),t.railh&&!t.railslocked&&(c=b.top,d=b.left,(e=t.opt.railhoffset)&&(e.top&&(c+=e.top),e.left&&(d+=e.left)),a=t.railh.align?c+p(t.win,"border-top-width",!0)+t.win.innerHeight()-t.railh.height:c+p(t.win,"border-top-width",!0),d+=p(t.win,"border-left-width"),t.railh.css({top:a-(t.opt.railpadding.top+t.opt.railpadding.bottom),left:d,width:t.railh.width}))}},this.doRailClick=function(a,b,c){var d;t.railslocked||(t.cancelEvent(a),b?(b=c?t.doScrollLeft:t.doScrollTop,d=c?(a.pageX-t.railh.offset().left-t.cursorwidth/2)*t.scrollratio.x:(a.pageY-t.rail.offset().top-t.cursorheight/2)*t.scrollratio.y,b(d)):(b=c?t.doScrollLeftBy:t.doScrollBy,d=c?t.scroll.x:t.scroll.y,a=c?a.pageX-t.railh.offset().left:a.pageY-t.rail.offset().top,c=c?t.view.w:t.view.h,b(d>=a?c:-c)))},t.hasanimationframe=h,t.hascancelanimationframe=i,t.hasanimationframe?t.hascancelanimationframe||(i=function(){t.cancelAnimationFrame=!0}):(h=function(a){return setTimeout(a,15-Math.floor(+new Date/1e3)%16)},i=clearInterval),this.init=function(){if(t.saved.css=[],v.isie7mobile||v.isoperamini)return!0;if(v.hasmstouch&&t.css(t.ispage?a("html"):t.win,{"-ms-touch-action":"none"}),t.zindex="auto",t.zindex=t.ispage||"auto"!=t.opt.zindex?t.opt.zindex:n()||"auto",!t.ispage&&"auto"!=t.zindex&&t.zindex>f&&(f=t.zindex),t.isie&&0==t.zindex&&"auto"==t.opt.zindex&&(t.zindex="auto"),!t.ispage||!v.cantouch&&!v.isieold&&!v.isie9mobile){var e=t.docscroll;t.ispage&&(e=t.haswrapper?t.win:t.doc),v.isie9mobile||t.css(e,{"overflow-y":"hidden"}),t.ispage&&v.isie7&&("BODY"==t.doc[0].nodeName?t.css(a("html"),{"overflow-y":"hidden"}):"HTML"==t.doc[0].nodeName&&t.css(a("body"),{"overflow-y":"hidden"})),!v.isios||t.ispage||t.haswrapper||t.css(a("body"),{"-webkit-overflow-scrolling":"touch"});var g=a(document.createElement("div"));g.css({position:"relative",top:0,"float":"right",width:t.opt.cursorwidth,height:"0px","background-color":t.opt.cursorcolor,border:t.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":t.opt.cursorborderradius,"-moz-border-radius":t.opt.cursorborderradius,"border-radius":t.opt.cursorborderradius}),g.hborder=parseFloat(g.outerHeight()-g.innerHeight()),g.addClass("nicescroll-cursors"),t.cursor=g;var h=a(document.createElement("div"));h.attr("id",t.id),h.addClass("nicescroll-rails nicescroll-rails-vr");var i,j,k,m=["left","right","top","bottom"];for(k in m)j=m[k],(i=t.opt.railpadding[j])?h.css("padding-"+j,i+"px"):t.opt.railpadding[j]=0;h.append(g),h.width=Math.max(parseFloat(t.opt.cursorwidth),g.outerWidth()),h.css({width:h.width+"px",zIndex:t.zindex,background:t.opt.background,cursor:"default"}),h.visibility=!0,h.scrollable=!0,h.align="left"==t.opt.railalign?0:1,t.rail=h,g=t.rail.drag=!1,!t.opt.boxzoom||t.ispage||v.isieold||(g=document.createElement("div"),t.bind(g,"click",t.doZoom),t.bind(g,"mouseenter",function(){t.zoom.css("opacity",t.opt.cursoropacitymax)}),t.bind(g,"mouseleave",function(){t.zoom.css("opacity",t.opt.cursoropacitymin)}),t.zoom=a(g),t.zoom.css({cursor:"pointer","z-index":t.zindex,backgroundImage:"url("+t.opt.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0px 0px"}),t.opt.dblclickzoom&&t.bind(t.win,"dblclick",t.doZoom),v.cantouch&&t.opt.gesturezoom&&(t.ongesturezoom=function(a){return 1.5a.scale&&t.doZoomOut(a),t.cancelEvent(a)},t.bind(t.win,"gestureend",t.ongesturezoom))),t.railh=!1;var o;if(t.opt.horizrailenabled&&(t.css(e,{"overflow-x":"hidden"}),g=a(document.createElement("div")),g.css({position:"absolute",top:0,height:t.opt.cursorwidth,width:"0px","background-color":t.opt.cursorcolor,border:t.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":t.opt.cursorborderradius,"-moz-border-radius":t.opt.cursorborderradius,"border-radius":t.opt.cursorborderradius}),v.isieold&&g.css({overflow:"hidden"}),g.wborder=parseFloat(g.outerWidth()-g.innerWidth()),g.addClass("nicescroll-cursors"),t.cursorh=g,o=a(document.createElement("div")),o.attr("id",t.id+"-hr"),o.addClass("nicescroll-rails nicescroll-rails-hr"),o.height=Math.max(parseFloat(t.opt.cursorwidth),g.outerHeight()),o.css({height:o.height+"px",zIndex:t.zindex,background:t.opt.background}),o.append(g),o.visibility=!0,o.scrollable=!0,o.align="top"==t.opt.railvalign?0:1,t.railh=o,t.railh.drag=!1),t.ispage?(h.css({position:"fixed",top:"0px",height:"100%"}),h.align?h.css({right:"0px"}):h.css({left:"0px"}),t.body.append(h),t.railh&&(o.css({position:"fixed",left:"0px",width:"100%"}),o.align?o.css({bottom:"0px"}):o.css({top:"0px"}),t.body.append(o))):(t.ishwscroll?("static"==t.win.css("position")&&t.css(t.win,{position:"relative"}),e="HTML"==t.win[0].nodeName?t.body:t.win,a(e).scrollTop(0).scrollLeft(0),t.zoom&&(t.zoom.css({position:"absolute",top:1,right:0,"margin-right":h.width+4}),e.append(t.zoom)),h.css({position:"absolute",top:0}),h.align?h.css({right:0}):h.css({left:0}),e.append(h),o&&(o.css({position:"absolute",left:0,bottom:0}),o.align?o.css({bottom:0}):o.css({top:0}),e.append(o))):(t.isfixed="fixed"==t.win.css("position"),e=t.isfixed?"fixed":"absolute",t.isfixed||(t.viewport=t.getViewport(t.win[0])),t.viewport&&(t.body=t.viewport,0==/fixed|absolute/.test(t.viewport.css("position"))&&t.css(t.viewport,{position:"relative"})),h.css({position:e}),t.zoom&&t.zoom.css({position:e}),t.updateScrollBar(),t.body.append(h),t.zoom&&t.body.append(t.zoom),t.railh&&(o.css({position:e}),t.body.append(o))),v.isios&&t.css(t.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),v.isie&&t.opt.disableoutline&&t.win.attr("hideFocus","true"),v.iswebkit&&t.opt.disableoutline&&t.win.css({outline:"none"})),!1===t.opt.autohidemode?(t.autohidedom=!1,t.rail.css({opacity:t.opt.cursoropacitymax}),t.railh&&t.railh.css({opacity:t.opt.cursoropacitymax})):!0===t.opt.autohidemode||"leave"===t.opt.autohidemode?(t.autohidedom=a().add(t.rail),v.isie8&&(t.autohidedom=t.autohidedom.add(t.cursor)),t.railh&&(t.autohidedom=t.autohidedom.add(t.railh)),t.railh&&v.isie8&&(t.autohidedom=t.autohidedom.add(t.cursorh))):"scroll"==t.opt.autohidemode?(t.autohidedom=a().add(t.rail),t.railh&&(t.autohidedom=t.autohidedom.add(t.railh))):"cursor"==t.opt.autohidemode?(t.autohidedom=a().add(t.cursor),t.railh&&(t.autohidedom=t.autohidedom.add(t.cursorh))):"hidden"==t.opt.autohidemode&&(t.autohidedom=!1,t.hide(),t.railslocked=!1),v.isie9mobile)t.scrollmom=new q(t),t.onmangotouch=function(){var a=t.getScrollTop(),b=t.getScrollLeft();if(a==t.scrollmom.lastscrolly&&b==t.scrollmom.lastscrollx)return!0;var c=a-t.mangotouch.sy,d=b-t.mangotouch.sx;if(0!=Math.round(Math.sqrt(Math.pow(d,2)+Math.pow(c,2)))){var e=0>c?-1:1,f=0>d?-1:1,g=+new Date;t.mangotouch.lazy&&clearTimeout(t.mangotouch.lazy),80i?i=Math.round(i/2):i>t.page.maxh&&(i=t.page.maxh+Math.round((i-t.page.maxh)/2)):(0>i&&(f=i=0),i>t.page.maxh&&(i=t.page.maxh,f=0));var j;if(t.railh&&t.railh.scrollable&&(j=t.isrtlmode?h-t.rail.drag.sl:t.rail.drag.sl-h,t.ishwscroll&&t.opt.bouncescroll?0>j?j=Math.round(j/2):j>t.page.maxw&&(j=t.page.maxw+Math.round((j-t.page.maxw)/2)):(0>j&&(g=j=0),j>t.page.maxw&&(j=t.page.maxw,g=0))),d=!1,t.rail.drag.dl)d=!0,"v"==t.rail.drag.dl?j=t.rail.drag.sl:"h"==t.rail.drag.dl&&(i=t.rail.drag.st);else{e=Math.abs(e);var h=Math.abs(h),k=t.opt.directionlockdeadzone;if("v"==t.rail.drag.ck){if(e>k&&h<=.3*e)return t.rail.drag=!1,!0;h>k&&(t.rail.drag.dl="f",a("body").scrollTop(a("body").scrollTop()))}else if("h"==t.rail.drag.ck){if(h>k&&e<=.3*h)return t.rail.drag=!1,!0;e>k&&(t.rail.drag.dl="f",a("body").scrollLeft(a("body").scrollLeft()))}}if(t.synched("touchmove",function(){t.rail.drag&&2==t.rail.drag.pt&&(t.prepareTransition&&t.prepareTransition(0),t.rail.scrollable&&t.setScrollTop(i),t.scrollmom.update(g,f),t.railh&&t.railh.scrollable?(t.setScrollLeft(j),t.showCursor(i,j)):t.showCursor(i),v.isie10&&document.selection.clear())}),v.ischrome&&t.istouchcapable&&(d=!1),d)return t.cancelEvent(b)}else if(1==t.rail.drag.pt)return t.onmousemove(b)}}if(t.onmousedown=function(a,b){if(!t.rail.drag||1==t.rail.drag.pt){if(t.railslocked)return t.cancelEvent(a);t.cancelScroll(),t.rail.drag={x:a.clientX,y:a.clientY,sx:t.scroll.x,sy:t.scroll.y,pt:1,hr:!!b};var c=t.getTarget(a);return!t.ispage&&v.hasmousecapture&&c.setCapture(),t.isiframe&&!v.hasmousecapture&&(t.saved.csspointerevents=t.doc.css("pointer-events"),t.css(t.doc,{"pointer-events":"none"})),t.hasmoving=!1,t.cancelEvent(a)}},t.onmouseup=function(a){if(t.rail.drag)return 1!=t.rail.drag.pt||(v.hasmousecapture&&document.releaseCapture(),t.isiframe&&!v.hasmousecapture&&t.doc.css("pointer-events",t.saved.csspointerevents),t.rail.drag=!1,t.hasmoving&&t.triggerScrollEnd(),t.cancelEvent(a))},t.onmousemove=function(a){if(t.rail.drag){if(1==t.rail.drag.pt){if(v.ischrome&&0==a.which)return t.onmouseup(a);if(t.cursorfreezed=!0,t.hasmoving=!0,t.rail.drag.hr){t.scroll.x=t.rail.drag.sx+(a.clientX-t.rail.drag.x),0>t.scroll.x&&(t.scroll.x=0);var b=t.scrollvaluemaxw;t.scroll.x>b&&(t.scroll.x=b)}else t.scroll.y=t.rail.drag.sy+(a.clientY-t.rail.drag.y),0>t.scroll.y&&(t.scroll.y=0),b=t.scrollvaluemax,t.scroll.y>b&&(t.scroll.y=b);return t.synched("mousemove",function(){t.rail.drag&&1==t.rail.drag.pt&&(t.showCursor(),t.rail.drag.hr?t.hasreversehr?t.doScrollLeft(t.scrollvaluemaxw-Math.round(t.scroll.x*t.scrollratio.x),t.opt.cursordragspeed):t.doScrollLeft(Math.round(t.scroll.x*t.scrollratio.x),t.opt.cursordragspeed):t.doScrollTop(Math.round(t.scroll.y*t.scrollratio.y),t.opt.cursordragspeed))}),t.cancelEvent(a)}}else t.checkarea=0},v.cantouch||t.opt.touchbehavior)t.onpreventclick=function(a){if(t.preventclick)return t.preventclick.tg.onclick=t.preventclick.click,t.preventclick=!1,t.cancelEvent(a)},t.bind(t.win,"mousedown",t.ontouchstart),t.onclick=!v.isios&&function(a){return!t.lastmouseup||(t.lastmouseup=!1,t.cancelEvent(a))},t.opt.grabcursorenabled&&v.cursorgrabvalue&&(t.css(t.ispage?t.doc:t.win,{cursor:v.cursorgrabvalue}),t.css(t.rail,{cursor:v.cursorgrabvalue}));else{var r=function(a){if(t.selectiondrag){if(a){var b=t.win.outerHeight();a=a.pageY-t.selectiondrag.top,0=b&&(a-=b),t.selectiondrag.df=a}0!=t.selectiondrag.df&&(t.doScrollBy(2*-Math.floor(t.selectiondrag.df/6)),t.debounced("doselectionscroll",function(){r()},50))}};t.hasTextSelected="getSelection"in document?function(){return 0t.page.maxh?t.doScrollTop(t.page.maxh):(t.scroll.y=Math.round(t.getScrollTop()*(1/t.scrollratio.y)),t.scroll.x=Math.round(t.getScrollLeft()*(1/t.scrollratio.x)),t.cursoractive&&t.noticeCursor()),t.scroll.y&&0==t.getScrollTop()&&t.doScrollTo(Math.floor(t.scroll.y*t.scrollratio.y)),t)},this.resize=t.onResize,this.lazyResize=function(a){return a=isNaN(a)?30:a,t.debounced("resize",t.resize,a),t},this.jqbind=function(b,c,d){t.events.push({e:b,n:c,f:d,q:!0}),a(b).bind(c,d)},this.bind=function(a,b,c,d){var e="jquery"in a?a[0]:a;"mousewheel"==b?"onwheel"in t.win?t._bind(e,"wheel",c,d||!1):(a="undefined"!=typeof document.onmousewheel?"mousewheel":"DOMMouseScroll",r(e,a,c,d||!1),"DOMMouseScroll"==a&&r(e,"MozMousePixelScroll",c,d||!1)):e.addEventListener?(v.cantouch&&/mouseup|mousedown|mousemove/.test(b)&&t._bind(e,"mousedown"==b?"touchstart":"mouseup"==b?"touchend":"touchmove",function(a){if(a.touches){if(2>a.touches.length){var b=a.touches.length?a.touches[0]:a;b.original=a,c.call(this,b)}}else a.changedTouches&&(b=a.changedTouches[0],b.original=a,c.call(this,b))},d||!1),t._bind(e,b,c,d||!1),v.cantouch&&"mouseup"==b&&t._bind(e,"touchcancel",c,d||!1)):t._bind(e,b,function(a){return(a=a||window.event||!1)&&a.srcElement&&(a.target=a.srcElement),"pageY"in a||(a.pageX=a.clientX+document.documentElement.scrollLeft,a.pageY=a.clientY+document.documentElement.scrollTop),!1!==c.call(e,a)&&!1!==d||t.cancelEvent(a)})},v.haseventlistener?(this._bind=function(a,b,c,d){t.events.push({e:a,n:b,f:c,b:d,q:!1}),a.addEventListener(b,c,d||!1)},this.cancelEvent=function(a){return!!a&&(a=a.original?a.original:a,a.preventDefault(),a.stopPropagation(),a.preventManipulation&&a.preventManipulation(),!1)},this.stopPropagation=function(a){return!!a&&(a=a.original?a.original:a,a.stopPropagation(),!1)},this._unbind=function(a,b,c,d){a.removeEventListener(b,c,d)}):(this._bind=function(a,b,c,d){t.events.push({e:a,n:b,f:c,b:d,q:!1}),a.attachEvent?a.attachEvent("on"+b,c):a["on"+b]=c},this.cancelEvent=function(a){return!!(a=window.event||!1)&&(a.cancelBubble=!0,a.cancel=!0,a.returnValue=!1)},this.stopPropagation=function(a){return!!(a=window.event||!1)&&(a.cancelBubble=!0,!1)},this._unbind=function(a,b,c,d){a.detachEvent?a.detachEvent("on"+b,c):a["on"+b]=!1}),this.unbindAll=function(){for(var a=0;a(t.newscrolly-d)*(b-d)||0>(t.newscrollx-e)*(a-e))&&t.cancelScroll(),0==t.opt.bouncescroll&&(0>b?b=0:b>t.page.maxh&&(b=t.page.maxh),0>a?a=0:a>t.page.maxw&&(a=t.page.maxw)),(!t.scrollrunning||a!=t.newscrollx||b!=t.newscrolly)&&(t.newscrolly=b,t.newscrollx=a,t.newscrollspeed=c||!1,!t.timer&&void(t.timer=setTimeout(function(){var c=t.getScrollTop(),d=t.getScrollLeft(),e=Math.round(Math.sqrt(Math.pow(a-d,2)+Math.pow(b-c,2))),e=t.newscrollspeed&&1=t.newscrollspeed&&(e*=t.newscrollspeed),t.prepareTransition(e,!0),t.timerscroll&&t.timerscroll.tm&&clearInterval(t.timerscroll.tm),0a?a=0:a>t.page.maxh&&(a=t.page.maxh),0>b?b=0:b>t.page.maxw&&(b=t.page.maxw),a!=t.newscrolly||b!=t.newscrollx?t.doScrollPos(b,a,t.opt.snapbackspeed):(t.onscrollend&&t.scrollrunning&&t.triggerScrollEnd(),void(t.scrollrunning=!1))}):(this.doScrollLeft=function(a,b){var c=t.scrollrunning?t.newscrolly:t.getScrollTop();t.doScrollPos(a,c,b)},this.doScrollTop=function(a,b){var c=t.scrollrunning?t.newscrollx:t.getScrollLeft();t.doScrollPos(c,a,b)},this.doScrollPos=function(a,b,c){function d(){if(t.cancelAnimationFrame)return!0;if(t.scrollrunning=!0,l=1-l)return t.timer=h(d)||1;var a,b,c=0,e=b=t.getScrollTop();t.dst.ay?(e=t.bzscroll?t.dst.py+t.bzscroll.getNow()*t.dst.ay:t.newscrolly,a=e-b,(0>a&&et.newscrolly)&&(e=t.newscrolly),t.setScrollTop(e),e==t.newscrolly&&(c=1)):c=1,b=a=t.getScrollLeft(),t.dst.ax?(b=t.bzscroll?t.dst.px+t.bzscroll.getNow()*t.dst.ax:t.newscrollx,a=b-a,(0>a&&bt.newscrollx)&&(b=t.newscrollx),t.setScrollLeft(b),b==t.newscrollx&&(c+=1)):c+=1,2==c?(t.timer=0,t.cursorfreezed=!1,t.bzscroll=!1,t.scrollrunning=!1,0>e?e=0:e>t.page.maxh&&(e=t.page.maxh),0>b?b=0:b>t.page.maxw&&(b=t.page.maxw),b!=t.newscrollx||e!=t.newscrolly?t.doScrollPos(b,e):t.onscrollend&&t.triggerScrollEnd()):t.timer=h(d)||1}if(b="undefined"==typeof b||!1===b?t.getScrollTop(!0):b,t.timer&&t.newscrolly==b&&t.newscrollx==a)return!0;t.timer&&i(t.timer),t.timer=0;var e=t.getScrollTop(),f=t.getScrollLeft();(0>(t.newscrolly-e)*(b-e)||0>(t.newscrollx-f)*(a-f))&&t.cancelScroll(),t.newscrolly=b,t.newscrollx=a,t.bouncescroll&&t.rail.visibility||(0>t.newscrolly?t.newscrolly=0:t.newscrolly>t.page.maxh&&(t.newscrolly=t.page.maxh)),t.bouncescroll&&t.railh.visibility||(0>t.newscrollx?t.newscrollx=0:t.newscrollx>t.page.maxw&&(t.newscrollx=t.page.maxw)),t.dst={},t.dst.x=a-f,t.dst.y=b-e,t.dst.px=f,t.dst.py=e;var g=Math.round(Math.sqrt(Math.pow(t.dst.x,2)+Math.pow(t.dst.y,2)));t.dst.ax=t.dst.x/g,t.dst.ay=t.dst.y/g;var j=0,k=g;if(0==t.dst.x?(j=e,k=b,t.dst.ay=1,t.dst.py=0):0==t.dst.y&&(j=f,k=a,t.dst.ax=1,t.dst.px=0),g=t.getTransitionSpeed(g),c&&1>=c&&(g*=c),t.bzscroll=0=t.page.maxh||f==t.page.maxw&&a>=t.page.maxw)&&t.checkContentSize();var l=1;t.cancelAnimationFrame=!1,t.timer=1,t.onscrollstart&&!t.scrollrunning&&t.onscrollstart.call(t,{type:"scrollstart",current:{x:f,y:e},request:{x:a,y:b},end:{x:t.newscrollx,y:t.newscrolly},speed:g}),d(),(e==t.page.maxh&&b>=e||f==t.page.maxw&&a>=f)&&t.checkContentSize(),t.noticeCursor()}},this.cancelScroll=function(){return t.timer&&i(t.timer),t.timer=0,t.bzscroll=!1,t.scrollrunning=!1,t}):(this.doScrollLeft=function(a,b){var c=t.getScrollTop();t.doScrollPos(a,c,b)},this.doScrollTop=function(a,b){var c=t.getScrollLeft();t.doScrollPos(c,a,b)},this.doScrollPos=function(a,b,c){var d=a>t.page.maxw?t.page.maxw:a;0>d&&(d=0);var e=b>t.page.maxh?t.page.maxh:b;0>e&&(e=0),t.synched("scroll",function(){t.setScrollTop(e),t.setScrollLeft(d)})},this.cancelScroll=function(){}),this.doScrollBy=function(a,b){var c=0,c=b?Math.floor((t.scroll.y-a)*t.scrollratio.y):(t.timer?t.newscrolly:t.getScrollTop(!0))-a;if(t.bouncescroll){var d=Math.round(t.view.h/2);c<-d?c=-d:c>t.page.maxh+d&&(c=t.page.maxh+d)}return t.cursorfreezed=!1,d=t.getScrollTop(!0),0>c&&0>=d?t.noticeCursor():c>t.page.maxh&&d>=t.page.maxh?(t.checkContentSize(),t.noticeCursor()):void t.doScrollTop(c)},this.doScrollLeftBy=function(a,b){var c=0,c=b?Math.floor((t.scroll.x-a)*t.scrollratio.x):(t.timer?t.newscrollx:t.getScrollLeft(!0))-a;if(t.bouncescroll){var d=Math.round(t.view.w/2);c<-d?c=-d:c>t.page.maxw+d&&(c=t.page.maxw+d)}return t.cursorfreezed=!1,d=t.getScrollLeft(!0),0>c&&0>=d||c>t.page.maxw&&d>=t.page.maxw?t.noticeCursor():void t.doScrollLeft(c)},this.doScrollTo=function(a,b){t.cursorfreezed=!1,t.doScrollTop(a)},this.checkContentSize=function(){var a=t.getContentSize();a.h==t.page.h&&a.w==t.page.w||t.resize(!1,a)},t.onscroll=function(a){t.rail.drag||t.cursorfreezed||t.synched("scroll",function(){t.scroll.y=Math.round(t.getScrollTop()*(1/t.scrollratio.y)),t.railh&&(t.scroll.x=Math.round(t.getScrollLeft()*(1/t.scrollratio.x))),t.noticeCursor()})},t.bind(t.docscroll,"scroll",t.onscroll),this.doZoomIn=function(b){if(!t.zoomactive){t.zoomactive=!0,t.zoomrestore={style:{}};var c,d="position top left zIndex backgroundColor marginTop marginBottom marginLeft marginRight".split(" "),e=t.win[0].style;for(c in d){var g=d[c];t.zoomrestore.style[g]="undefined"!=typeof e[g]?e[g]:""}return t.zoomrestore.style.width=t.win.css("width"),t.zoomrestore.style.height=t.win.css("height"),t.zoomrestore.padding={w:t.win.outerWidth()-t.win.width(),h:t.win.outerHeight()-t.win.height()},v.isios4&&(t.zoomrestore.scrollTop=a(window).scrollTop(),a(window).scrollTop(0)),t.win.css({position:v.isios4?"absolute":"fixed",top:0,left:0,"z-index":f+100,margin:"0px"}),d=t.win.css("backgroundColor"),(""==d||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(d))&&t.win.css("backgroundColor","#fff"),t.rail.css({"z-index":f+101}),t.zoom.css({"z-index":f+102}),t.zoom.css("backgroundPosition","0px -18px"),t.resizeZoom(),t.onzoomin&&t.onzoomin.call(t),t.cancelEvent(b)}},this.doZoomOut=function(b){if(t.zoomactive)return t.zoomactive=!1,t.win.css("margin",""),t.win.css(t.zoomrestore.style),v.isios4&&a(window).scrollTop(t.zoomrestore.scrollTop),t.rail.css({"z-index":t.zindex}),t.zoom.css({"z-index":t.zindex}),t.zoomrestore=!1,t.zoom.css("backgroundPosition","0px 0px"),t.onResize(),t.onzoomout&&t.onzoomout.call(t),t.cancelEvent(b)},this.doZoom=function(a){return t.zoomactive?t.doZoomOut(a):t.doZoomIn(a)},this.resizeZoom=function(){if(t.zoomactive){var b=t.getScrollTop();t.win.css({width:a(window).width()-t.zoomrestore.padding.w+"px",height:a(window).height()-t.zoomrestore.padding.h+"px"}),t.onResize(),t.setScrollTop(Math.min(t.page.maxh,b))}},this.init(),a.nicescroll.push(this)},q=function(a){var b=this;this.nc=a,this.steptime=this.lasttime=this.speedy=this.speedx=this.lasty=this.lastx=0,this.snapy=this.snapx=!1,this.demuly=this.demulx=0,this.lastscrolly=this.lastscrollx=-1,this.timer=this.chky=this.chkx=0,this.time=function(){return+new Date},this.reset=function(a,c){b.stop();var d=b.time();b.steptime=0,b.lasttime=d,b.speedx=0,b.speedy=0,b.lastx=a,b.lasty=c,b.lastscrollx=-1,b.lastscrolly=-1},this.update=function(a,c){var d=b.time();b.steptime=d-b.lasttime,b.lasttime=d;var d=c-b.lasty,e=a-b.lastx,f=b.nc.getScrollTop(),g=b.nc.getScrollLeft(),f=f+d,g=g+e;b.snapx=0>g||g>b.nc.page.maxw,b.snapy=0>f||f>b.nc.page.maxh,b.speedx=e,b.speedy=d,b.lastx=a,b.lasty=c},this.stop=function(){b.nc.unsynched("domomentum2d"),b.timer&&clearTimeout(b.timer),b.timer=0,b.lastscrollx=-1,b.lastscrolly=-1},this.doSnapy=function(a,c){var d=!1;0>c?(c=0,d=!0):c>b.nc.page.maxh&&(c=b.nc.page.maxh,d=!0),0>a?(a=0,d=!0):a>b.nc.page.maxw&&(a=b.nc.page.maxw,d=!0),d?b.nc.doScrollPos(a,c,b.nc.opt.snapbackspeed):b.nc.triggerScrollEnd()},this.doMomentum=function(a){var c=b.time(),d=a?c+a:b.lasttime;a=b.nc.getScrollLeft();var e=b.nc.getScrollTop(),f=b.nc.page.maxh,g=b.nc.page.maxw;if(b.speedx=0=c-d,(0>e||e>f||0>a||a>g)&&(d=!1),a=!(!b.speedx||!d)&&b.speedx,b.speedy&&d&&b.speedy||a){var h=Math.max(16,b.steptime);50i||i>g)&&(a=.1),b.speedy&&(j=Math.floor(b.lastscrolly-b.speedy*(1-b.demulxy)),b.lastscrolly=j,0>j||j>f)&&(a=.1),b.demulxy=Math.min(1,b.demulxy+a),b.nc.synched("domomentum2d",function(){b.speedx&&(b.nc.getScrollLeft()!=b.chkx&&b.stop(),b.chkx=i,b.nc.setScrollLeft(i)),b.speedy&&(b.nc.getScrollTop()!=b.chky&&b.stop(),b.chky=j,b.nc.setScrollTop(j)),b.timer||(b.nc.hideCursor(),b.doSnapy(i,j))}),1>b.demulxy?b.timer=setTimeout(k,h):(b.stop(),b.nc.hideCursor(),b.doSnapy(i,j))};k()}else b.doSnapy(b.nc.getScrollLeft(),b.nc.getScrollTop())}},r=a.fn.scrollTop;a.cssHooks.pageYOffset={get:function(b,c,d){return(c=a.data(b,"__nicescroll")||!1)&&c.ishwscroll?c.getScrollTop():r.call(b)},set:function(b,c){var d=a.data(b,"__nicescroll")||!1;return d&&d.ishwscroll?d.setScrollTop(parseInt(c)):r.call(b,c),this}},a.fn.scrollTop=function(b){if("undefined"==typeof b){var c=!!this[0]&&(a.data(this[0],"__nicescroll")||!1);return c&&c.ishwscroll?c.getScrollTop():r.call(this)}return this.each(function(){var c=a.data(this,"__nicescroll")||!1;c&&c.ishwscroll?c.setScrollTop(parseInt(b)):r.call(a(this),b)})};var s=a.fn.scrollLeft;a.cssHooks.pageXOffset={get:function(b,c,d){return(c=a.data(b,"__nicescroll")||!1)&&c.ishwscroll?c.getScrollLeft():s.call(b)},set:function(b,c){var d=a.data(b,"__nicescroll")||!1;return d&&d.ishwscroll?d.setScrollLeft(parseInt(c)):s.call(b,c),this}},a.fn.scrollLeft=function(b){if("undefined"==typeof b){var c=!!this[0]&&(a.data(this[0],"__nicescroll")||!1);return c&&c.ishwscroll?c.getScrollLeft():s.call(this)}return this.each(function(){var c=a.data(this,"__nicescroll")||!1;c&&c.ishwscroll?c.setScrollLeft(parseInt(b)):s.call(a(this),b)})};var t=function(b){var c=this;if(this.length=0,this.name="nicescrollarray",this.each=function(a){for(var b=0,d=0;b
              ';$("."+g+"_user_picker_container").remove(),0==$("."+g+"_user_picker_container").length&&$(a.inputId).after(b),$(a.inputId).hide(),""!=a.currentValue&&c(a.currentValue),$("#"+g+"_tag_input_field").attr("placeholder",a.placeholderText),1==a.focus&&($("#"+g+"_tag_input_field").focus(),$("#"+g+"_invite_tags").addClass("focus")),$("#"+g+"_tag_input_field").focusin(function(){$("#"+g+"_invite_tags").addClass("focus")}),$("#"+g+"_tag_input_field").focusout(function(){$("#"+g+"_invite_tags").removeClass("focus")})}function c(a){$("#"+g+"_invite_tags .userInput").remove(),$("#"+g+"_invite_tags").prepend(a),$("#"+g+"_invite_tags .userInput i").each(function(){$(this).click(function(){$(this).parent().remove(),userCount--}),userCount++})}function d(b){$("#"+g+"_userpicker li").remove(),$("#"+g+"_userpicker").html('
            • ');var c=a.data||{};a.searchUrl.indexOf("-keywordPlaceholder-")<0&&(c.keyword=b),a.userRole&&(c.userRole=a.userRole),jQuery.getJSON(a.searchUrl.replace("-keywordPlaceholder-",b),c,function(c){if($("#"+g+"_userpicker li").remove(),c.sort(function(a,c){return a.disabled!==c.disabled?a.disabledc.priority?-1:1:a.displayName.indexOf(b)>=0&&c.displayName.indexOf(b)<0?-1:a.displayName.indexOf(b)<0&&c.displayName.indexOf(b)>=0?1:0}),c.length>0){for(var d=0;d '+c[d].displayName+"";$("#"+g+"_userpicker").append(i)}0==$("#"+g+"_userpicker").children().length&&$("#"+g+"_userpicker").hide(),f=""}else $("#"+g+"_userpicker").hide();$("#"+g+"_userpicker li").removeHighlight(),$("#"+g+"_userpicker li").highlight(b),$("#"+g+"_userpicker li:eq(0)").addClass("selected")})}function e(){$("#maxUsersHint").remove();var b='";$("#"+g+"_invite_tags").after(b),$("#maxUsersHint").fadeIn("fast")}a=$.extend({inputId:"",maxUsers:0,searchUrl:"",currentValue:"",renderType:"normal",focus:!1,userGuid:"",data:{},placeholderText:"Add an user"},a);var f="",g="";b(),jQuery("#"+g+"_invite_tags").click(function(){$("#"+g+"_tag_input_field").focus()}),$("#"+g+"_tag_input_field").keydown(function(b){""==$(this).val()&&9==b.keyCode||40!=b.keyCode&&38!=b.keyCode&&13!=b.keyCode&&9!=b.keyCode||b.preventDefault(),0!=a.maxUsers&&9!=b.keyCode&&userCount==a.maxUsers&&(e(),b.preventDefault())}),$("#"+g+"_tag_input_field").keyup(function(a){if($("#"+g+"_tag_input_field").val().length>=3){if($("#"+g+"_userpicker").css({position:"absolute",top:$("#"+g+"_tag_input_field").position().top+30,left:$("#"+g+"_tag_input_field").position().left+0 +switch(e){case 38:case 63233:t.doScrollBy(72),h=!0;break;case 40:case 63235:t.doScrollBy(-72),h=!0;break;case 37:case 63232:t.railh&&(f?t.doScrollLeft(0):t.doScrollLeftBy(72),h=!0);break;case 39:case 63234:t.railh&&(f?t.doScrollLeft(t.page.maxw):t.doScrollLeftBy(-72),h=!0);break;case 33:case 63276:t.doScrollBy(t.view.h),h=!0;break;case 34:case 63277:t.doScrollBy(-t.view.h),h=!0;break;case 36:case 63273:t.railh&&f?t.doScrollPos(0,0):t.doScrollTo(0),h=!0;break;case 35:case 63275:t.railh&&f?t.doScrollPos(t.page.maxw,t.page.maxh):t.doScrollTo(t.page.maxh),h=!0;break;case 32:t.opt.spacebarenabled&&(g?t.doScrollBy(t.view.h):t.doScrollBy(-t.view.h),h=!0);break;case 27:t.zoomactive&&(t.doZoom(),h=!0)}if(h)return t.cancelEvent(d)}},t.opt.enablekeyboard&&t.bind(document,v.isopera&&!v.isopera12?"keypress":"keydown",t.onkeypress),t.bind(document,"keydown",function(a){a.ctrlKey&&(t.wheelprevented=!0)}),t.bind(document,"keyup",function(a){a.ctrlKey||(t.wheelprevented=!1)}),t.bind(window,"blur",function(a){t.wheelprevented=!1}),t.bind(window,"resize",t.lazyResize),t.bind(window,"orientationchange",t.lazyResize),t.bind(window,"load",t.lazyResize),v.ischrome&&!t.ispage&&!t.haswrapper){var s=t.win.attr("style"),h=parseFloat(t.win.css("width"))+1;t.win.css("width",h),t.synched("chromefix",function(){t.win.attr("style",s)})}t.onAttributeChange=function(a){t.lazyResize(t.isieold?250:30)},!1!==l&&(t.observerbody=new l(function(b){if(b.forEach(function(b){if("attributes"==b.type)return a("body").hasClass("modal-open")&&!a.contains(a(".modal-dialog")[0],t.doc[0])?t.hide():t.show()}),document.body.scrollHeight!=t.page.maxh)return t.lazyResize(30)}),t.observerbody.observe(document.body,{childList:!0,subtree:!0,characterData:!1,attributes:!0,attributeFilter:["class"]})),t.ispage||t.haswrapper||(!1!==l?(t.observer=new l(function(a){a.forEach(t.onAttributeChange)}),t.observer.observe(t.win[0],{childList:!0,characterData:!1,attributes:!0,subtree:!1}),t.observerremover=new l(function(a){a.forEach(function(a){if(0t.page.maxh?t.doScrollTop(t.page.maxh):(t.scroll.y=Math.round(t.getScrollTop()*(1/t.scrollratio.y)),t.scroll.x=Math.round(t.getScrollLeft()*(1/t.scrollratio.x)),t.cursoractive&&t.noticeCursor()),t.scroll.y&&0==t.getScrollTop()&&t.doScrollTo(Math.floor(t.scroll.y*t.scrollratio.y)),t)},this.resize=t.onResize,this.lazyResize=function(a){return a=isNaN(a)?30:a,t.debounced("resize",t.resize,a),t},this.jqbind=function(b,c,d){t.events.push({e:b,n:c,f:d,q:!0}),a(b).bind(c,d)},this.bind=function(a,b,c,d){var e="jquery"in a?a[0]:a;"mousewheel"==b?"onwheel"in t.win?t._bind(e,"wheel",c,d||!1):(a="undefined"!=typeof document.onmousewheel?"mousewheel":"DOMMouseScroll",r(e,a,c,d||!1),"DOMMouseScroll"==a&&r(e,"MozMousePixelScroll",c,d||!1)):e.addEventListener?(v.cantouch&&/mouseup|mousedown|mousemove/.test(b)&&t._bind(e,"mousedown"==b?"touchstart":"mouseup"==b?"touchend":"touchmove",function(a){if(a.touches){if(2>a.touches.length){var b=a.touches.length?a.touches[0]:a;b.original=a,c.call(this,b)}}else a.changedTouches&&(b=a.changedTouches[0],b.original=a,c.call(this,b))},d||!1),t._bind(e,b,c,d||!1),v.cantouch&&"mouseup"==b&&t._bind(e,"touchcancel",c,d||!1)):t._bind(e,b,function(a){return(a=a||window.event||!1)&&a.srcElement&&(a.target=a.srcElement),"pageY"in a||(a.pageX=a.clientX+document.documentElement.scrollLeft,a.pageY=a.clientY+document.documentElement.scrollTop),!1!==c.call(e,a)&&!1!==d||t.cancelEvent(a)})},v.haseventlistener?(this._bind=function(a,b,c,d){t.events.push({e:a,n:b,f:c,b:d,q:!1}),a.addEventListener(b,c,d||!1)},this.cancelEvent=function(a){return!!a&&(a=a.original?a.original:a,a.preventDefault(),a.stopPropagation(),a.preventManipulation&&a.preventManipulation(),!1)},this.stopPropagation=function(a){return!!a&&(a=a.original?a.original:a,a.stopPropagation(),!1)},this._unbind=function(a,b,c,d){a.removeEventListener(b,c,d)}):(this._bind=function(a,b,c,d){t.events.push({e:a,n:b,f:c,b:d,q:!1}),a.attachEvent?a.attachEvent("on"+b,c):a["on"+b]=c},this.cancelEvent=function(a){return!!(a=window.event||!1)&&(a.cancelBubble=!0,a.cancel=!0,a.returnValue=!1)},this.stopPropagation=function(a){return!!(a=window.event||!1)&&(a.cancelBubble=!0,!1)},this._unbind=function(a,b,c,d){a.detachEvent?a.detachEvent("on"+b,c):a["on"+b]=!1}),this.unbindAll=function(){for(var a=0;a(t.newscrolly-d)*(b-d)||0>(t.newscrollx-e)*(a-e))&&t.cancelScroll(),0==t.opt.bouncescroll&&(0>b?b=0:b>t.page.maxh&&(b=t.page.maxh),0>a?a=0:a>t.page.maxw&&(a=t.page.maxw)),(!t.scrollrunning||a!=t.newscrollx||b!=t.newscrolly)&&(t.newscrolly=b,t.newscrollx=a,t.newscrollspeed=c||!1,!t.timer&&void(t.timer=setTimeout(function(){var c=t.getScrollTop(),d=t.getScrollLeft(),e=Math.round(Math.sqrt(Math.pow(a-d,2)+Math.pow(b-c,2))),e=t.newscrollspeed&&1=t.newscrollspeed&&(e*=t.newscrollspeed),t.prepareTransition(e,!0),t.timerscroll&&t.timerscroll.tm&&clearInterval(t.timerscroll.tm),0a?a=0:a>t.page.maxh&&(a=t.page.maxh),0>b?b=0:b>t.page.maxw&&(b=t.page.maxw),a!=t.newscrolly||b!=t.newscrollx?t.doScrollPos(b,a,t.opt.snapbackspeed):(t.onscrollend&&t.scrollrunning&&t.triggerScrollEnd(),void(t.scrollrunning=!1))}):(this.doScrollLeft=function(a,b){var c=t.scrollrunning?t.newscrolly:t.getScrollTop();t.doScrollPos(a,c,b)},this.doScrollTop=function(a,b){var c=t.scrollrunning?t.newscrollx:t.getScrollLeft();t.doScrollPos(c,a,b)},this.doScrollPos=function(a,b,c){function d(){if(t.cancelAnimationFrame)return!0;if(t.scrollrunning=!0,l=1-l)return t.timer=h(d)||1;var a,b,c=0,e=b=t.getScrollTop();t.dst.ay?(e=t.bzscroll?t.dst.py+t.bzscroll.getNow()*t.dst.ay:t.newscrolly,a=e-b,(0>a&&et.newscrolly)&&(e=t.newscrolly),t.setScrollTop(e),e==t.newscrolly&&(c=1)):c=1,b=a=t.getScrollLeft(),t.dst.ax?(b=t.bzscroll?t.dst.px+t.bzscroll.getNow()*t.dst.ax:t.newscrollx,a=b-a,(0>a&&bt.newscrollx)&&(b=t.newscrollx),t.setScrollLeft(b),b==t.newscrollx&&(c+=1)):c+=1,2==c?(t.timer=0,t.cursorfreezed=!1,t.bzscroll=!1,t.scrollrunning=!1,0>e?e=0:e>t.page.maxh&&(e=t.page.maxh),0>b?b=0:b>t.page.maxw&&(b=t.page.maxw),b!=t.newscrollx||e!=t.newscrolly?t.doScrollPos(b,e):t.onscrollend&&t.triggerScrollEnd()):t.timer=h(d)||1}if(b="undefined"==typeof b||!1===b?t.getScrollTop(!0):b,t.timer&&t.newscrolly==b&&t.newscrollx==a)return!0;t.timer&&i(t.timer),t.timer=0;var e=t.getScrollTop(),f=t.getScrollLeft();(0>(t.newscrolly-e)*(b-e)||0>(t.newscrollx-f)*(a-f))&&t.cancelScroll(),t.newscrolly=b,t.newscrollx=a,t.bouncescroll&&t.rail.visibility||(0>t.newscrolly?t.newscrolly=0:t.newscrolly>t.page.maxh&&(t.newscrolly=t.page.maxh)),t.bouncescroll&&t.railh.visibility||(0>t.newscrollx?t.newscrollx=0:t.newscrollx>t.page.maxw&&(t.newscrollx=t.page.maxw)),t.dst={},t.dst.x=a-f,t.dst.y=b-e,t.dst.px=f,t.dst.py=e;var g=Math.round(Math.sqrt(Math.pow(t.dst.x,2)+Math.pow(t.dst.y,2)));t.dst.ax=t.dst.x/g,t.dst.ay=t.dst.y/g;var j=0,k=g;if(0==t.dst.x?(j=e,k=b,t.dst.ay=1,t.dst.py=0):0==t.dst.y&&(j=f,k=a,t.dst.ax=1,t.dst.px=0),g=t.getTransitionSpeed(g),c&&1>=c&&(g*=c),t.bzscroll=0=t.page.maxh||f==t.page.maxw&&a>=t.page.maxw)&&t.checkContentSize();var l=1;t.cancelAnimationFrame=!1,t.timer=1,t.onscrollstart&&!t.scrollrunning&&t.onscrollstart.call(t,{type:"scrollstart",current:{x:f,y:e},request:{x:a,y:b},end:{x:t.newscrollx,y:t.newscrolly},speed:g}),d(),(e==t.page.maxh&&b>=e||f==t.page.maxw&&a>=f)&&t.checkContentSize(),t.noticeCursor()}},this.cancelScroll=function(){return t.timer&&i(t.timer),t.timer=0,t.bzscroll=!1,t.scrollrunning=!1,t}):(this.doScrollLeft=function(a,b){var c=t.getScrollTop();t.doScrollPos(a,c,b)},this.doScrollTop=function(a,b){var c=t.getScrollLeft();t.doScrollPos(c,a,b)},this.doScrollPos=function(a,b,c){var d=a>t.page.maxw?t.page.maxw:a;0>d&&(d=0);var e=b>t.page.maxh?t.page.maxh:b;0>e&&(e=0),t.synched("scroll",function(){t.setScrollTop(e),t.setScrollLeft(d)})},this.cancelScroll=function(){}),this.doScrollBy=function(a,b){var c=0,c=b?Math.floor((t.scroll.y-a)*t.scrollratio.y):(t.timer?t.newscrolly:t.getScrollTop(!0))-a;if(t.bouncescroll){var d=Math.round(t.view.h/2);c<-d?c=-d:c>t.page.maxh+d&&(c=t.page.maxh+d)}return t.cursorfreezed=!1,d=t.getScrollTop(!0),0>c&&0>=d?t.noticeCursor():c>t.page.maxh&&d>=t.page.maxh?(t.checkContentSize(),t.noticeCursor()):void t.doScrollTop(c)},this.doScrollLeftBy=function(a,b){var c=0,c=b?Math.floor((t.scroll.x-a)*t.scrollratio.x):(t.timer?t.newscrollx:t.getScrollLeft(!0))-a;if(t.bouncescroll){var d=Math.round(t.view.w/2);c<-d?c=-d:c>t.page.maxw+d&&(c=t.page.maxw+d)}return t.cursorfreezed=!1,d=t.getScrollLeft(!0),0>c&&0>=d||c>t.page.maxw&&d>=t.page.maxw?t.noticeCursor():void t.doScrollLeft(c)},this.doScrollTo=function(a,b){t.cursorfreezed=!1,t.doScrollTop(a)},this.checkContentSize=function(){var a=t.getContentSize();a.h==t.page.h&&a.w==t.page.w||t.resize(!1,a)},t.onscroll=function(a){t.rail.drag||t.cursorfreezed||t.synched("scroll",function(){t.scroll.y=Math.round(t.getScrollTop()*(1/t.scrollratio.y)),t.railh&&(t.scroll.x=Math.round(t.getScrollLeft()*(1/t.scrollratio.x))),t.noticeCursor()})},t.bind(t.docscroll,"scroll",t.onscroll),this.doZoomIn=function(b){if(!t.zoomactive){t.zoomactive=!0,t.zoomrestore={style:{}};var c,d="position top left zIndex backgroundColor marginTop marginBottom marginLeft marginRight".split(" "),e=t.win[0].style;for(c in d){var g=d[c];t.zoomrestore.style[g]="undefined"!=typeof e[g]?e[g]:""}return t.zoomrestore.style.width=t.win.css("width"),t.zoomrestore.style.height=t.win.css("height"),t.zoomrestore.padding={w:t.win.outerWidth()-t.win.width(),h:t.win.outerHeight()-t.win.height()},v.isios4&&(t.zoomrestore.scrollTop=a(window).scrollTop(),a(window).scrollTop(0)),t.win.css({position:v.isios4?"absolute":"fixed",top:0,left:0,"z-index":f+100,margin:"0px"}),d=t.win.css("backgroundColor"),(""==d||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(d))&&t.win.css("backgroundColor","#fff"),t.rail.css({"z-index":f+101}),t.zoom.css({"z-index":f+102}),t.zoom.css("backgroundPosition","0px -18px"),t.resizeZoom(),t.onzoomin&&t.onzoomin.call(t),t.cancelEvent(b)}},this.doZoomOut=function(b){if(t.zoomactive)return t.zoomactive=!1,t.win.css("margin",""),t.win.css(t.zoomrestore.style),v.isios4&&a(window).scrollTop(t.zoomrestore.scrollTop),t.rail.css({"z-index":t.zindex}),t.zoom.css({"z-index":t.zindex}),t.zoomrestore=!1,t.zoom.css("backgroundPosition","0px 0px"),t.onResize(),t.onzoomout&&t.onzoomout.call(t),t.cancelEvent(b)},this.doZoom=function(a){return t.zoomactive?t.doZoomOut(a):t.doZoomIn(a)},this.resizeZoom=function(){if(t.zoomactive){var b=t.getScrollTop();t.win.css({width:a(window).width()-t.zoomrestore.padding.w+"px",height:a(window).height()-t.zoomrestore.padding.h+"px"}),t.onResize(),t.setScrollTop(Math.min(t.page.maxh,b))}},this.init(),a.nicescroll.push(this)},q=function(a){var b=this;this.nc=a,this.steptime=this.lasttime=this.speedy=this.speedx=this.lasty=this.lastx=0,this.snapy=this.snapx=!1,this.demuly=this.demulx=0,this.lastscrolly=this.lastscrollx=-1,this.timer=this.chky=this.chkx=0,this.time=function(){return+new Date},this.reset=function(a,c){b.stop();var d=b.time();b.steptime=0,b.lasttime=d,b.speedx=0,b.speedy=0,b.lastx=a,b.lasty=c,b.lastscrollx=-1,b.lastscrolly=-1},this.update=function(a,c){var d=b.time();b.steptime=d-b.lasttime,b.lasttime=d;var d=c-b.lasty,e=a-b.lastx,f=b.nc.getScrollTop(),g=b.nc.getScrollLeft(),f=f+d,g=g+e;b.snapx=0>g||g>b.nc.page.maxw,b.snapy=0>f||f>b.nc.page.maxh,b.speedx=e,b.speedy=d,b.lastx=a,b.lasty=c},this.stop=function(){b.nc.unsynched("domomentum2d"),b.timer&&clearTimeout(b.timer),b.timer=0,b.lastscrollx=-1,b.lastscrolly=-1},this.doSnapy=function(a,c){var d=!1;0>c?(c=0,d=!0):c>b.nc.page.maxh&&(c=b.nc.page.maxh,d=!0),0>a?(a=0,d=!0):a>b.nc.page.maxw&&(a=b.nc.page.maxw,d=!0),d?b.nc.doScrollPos(a,c,b.nc.opt.snapbackspeed):b.nc.triggerScrollEnd()},this.doMomentum=function(a){var c=b.time(),d=a?c+a:b.lasttime;a=b.nc.getScrollLeft();var e=b.nc.getScrollTop(),f=b.nc.page.maxh,g=b.nc.page.maxw;if(b.speedx=0=c-d,(0>e||e>f||0>a||a>g)&&(d=!1),a=!(!b.speedx||!d)&&b.speedx,b.speedy&&d&&b.speedy||a){var h=Math.max(16,b.steptime);50i||i>g)&&(a=.1),b.speedy&&(j=Math.floor(b.lastscrolly-b.speedy*(1-b.demulxy)),b.lastscrolly=j,0>j||j>f)&&(a=.1),b.demulxy=Math.min(1,b.demulxy+a),b.nc.synched("domomentum2d",function(){b.speedx&&(b.nc.getScrollLeft()!=b.chkx&&b.stop(),b.chkx=i,b.nc.setScrollLeft(i)),b.speedy&&(b.nc.getScrollTop()!=b.chky&&b.stop(),b.chky=j,b.nc.setScrollTop(j)),b.timer||(b.nc.hideCursor(),b.doSnapy(i,j))}),1>b.demulxy?b.timer=setTimeout(k,h):(b.stop(),b.nc.hideCursor(),b.doSnapy(i,j))};k()}else b.doSnapy(b.nc.getScrollLeft(),b.nc.getScrollTop())}},r=a.fn.scrollTop;a.cssHooks.pageYOffset={get:function(b,c,d){return(c=a.data(b,"__nicescroll")||!1)&&c.ishwscroll?c.getScrollTop():r.call(b)},set:function(b,c){var d=a.data(b,"__nicescroll")||!1;return d&&d.ishwscroll?d.setScrollTop(parseInt(c)):r.call(b,c),this}},a.fn.scrollTop=function(b){if("undefined"==typeof b){var c=!!this[0]&&(a.data(this[0],"__nicescroll")||!1);return c&&c.ishwscroll?c.getScrollTop():r.call(this)}return this.each(function(){var c=a.data(this,"__nicescroll")||!1;c&&c.ishwscroll?c.setScrollTop(parseInt(b)):r.call(a(this),b)})};var s=a.fn.scrollLeft;a.cssHooks.pageXOffset={get:function(b,c,d){return(c=a.data(b,"__nicescroll")||!1)&&c.ishwscroll?c.getScrollLeft():s.call(b)},set:function(b,c){var d=a.data(b,"__nicescroll")||!1;return d&&d.ishwscroll?d.setScrollLeft(parseInt(c)):s.call(b,c),this}},a.fn.scrollLeft=function(b){if("undefined"==typeof b){var c=!!this[0]&&(a.data(this[0],"__nicescroll")||!1);return c&&c.ishwscroll?c.getScrollLeft():s.call(this)}return this.each(function(){var c=a.data(this,"__nicescroll")||!1;c&&c.ishwscroll?c.setScrollLeft(parseInt(b)):s.call(a(this),b)})};var t=function(b){var c=this;if(this.length=0,this.name="nicescrollarray",this.each=function(a){for(var b=0,d=0;b
              ';$("."+g+"_user_picker_container").remove(),0==$("."+g+"_user_picker_container").length&&$(a.inputId).after(b),$(a.inputId).hide(),""!=a.currentValue&&c(a.currentValue),$("#"+g+"_tag_input_field").attr("placeholder",a.placeholderText),1==a.focus&&($("#"+g+"_tag_input_field").focus(),$("#"+g+"_invite_tags").addClass("focus")),$("#"+g+"_tag_input_field").focusin(function(){$("#"+g+"_invite_tags").addClass("focus")}),$("#"+g+"_tag_input_field").focusout(function(){$("#"+g+"_invite_tags").removeClass("focus")})}function c(a){$("#"+g+"_invite_tags .userInput").remove(),$("#"+g+"_invite_tags").prepend(a),$("#"+g+"_invite_tags .userInput i").each(function(){$(this).click(function(){$(this).parent().remove(),userCount--}),userCount++})}function d(b){$("#"+g+"_userpicker li").remove(),$("#"+g+"_userpicker").html('
            • ');var c=a.data||{};a.searchUrl.indexOf("-keywordPlaceholder-")<0&&(c.keyword=b),a.userRole&&(c.userRole=a.userRole),jQuery.getJSON(a.searchUrl.replace("-keywordPlaceholder-",b),c,function(c){if($("#"+g+"_userpicker li").remove(),c.sort(function(a,c){return a.disabled!==c.disabled?a.disabledc.priority?-1:1:a.displayName.indexOf(b)>=0&&c.displayName.indexOf(b)<0?-1:a.displayName.indexOf(b)<0&&c.displayName.indexOf(b)>=0?1:0}),c.length>0){for(var d=0;d '+c[d].displayName+"";$("#"+g+"_userpicker").append(i)}0==$("#"+g+"_userpicker").children().length&&$("#"+g+"_userpicker").hide(),f=""}else $("#"+g+"_userpicker").hide();$("#"+g+"_userpicker li").removeHighlight(),$("#"+g+"_userpicker li").highlight(b),$("#"+g+"_userpicker li:eq(0)").addClass("selected")})}function e(){$("#maxUsersHint").remove();var b='";$("#"+g+"_invite_tags").after(b),$("#maxUsersHint").fadeIn("fast")}a=$.extend({inputId:"",maxUsers:0,searchUrl:"",currentValue:"",renderType:"normal",focus:!1,userGuid:"",data:{},placeholderText:"Add a user"},a);var f="",g="";b(),jQuery("#"+g+"_invite_tags").click(function(){$("#"+g+"_tag_input_field").focus()}),$("#"+g+"_tag_input_field").keydown(function(b){""==$(this).val()&&9==b.keyCode||40!=b.keyCode&&38!=b.keyCode&&13!=b.keyCode&&9!=b.keyCode||b.preventDefault(),0!=a.maxUsers&&9!=b.keyCode&&userCount==a.maxUsers&&(e(),b.preventDefault())}),$("#"+g+"_tag_input_field").keyup(function(a){if($("#"+g+"_tag_input_field").val().length>=3){if($("#"+g+"_userpicker").css({position:"absolute",top:$("#"+g+"_tag_input_field").position().top+30,left:$("#"+g+"_tag_input_field").position().left+0 }),40==a.keyCode)return""===f?f=1:f+1<$("#"+g+"_userpicker li").length&&f++,$("#"+g+"_userpicker li").removeClass("selected"),$("#"+g+"_userpicker li:eq("+f+")").addClass("selected"),!1;if(38==a.keyCode)return""===f?f=1:f>0&&f--,$("#"+g+"_userpicker li").removeClass("selected"),$("#"+g+"_userpicker li:eq("+f+")").addClass("selected"),!1;if(13==a.keyCode||9==a.keyCode){var b=$("#"+g+"_userpicker .selected a").attr("href");void 0!==b&&(window.location.href=b)}else{var c=$("#"+g+"_tag_input_field").val();$("#"+g+"_userpicker").show(),d(c)}}else $("#"+g+"_userpicker").hide()}),$("#"+g+"_tag_input_field").focusout(function(){$(a.inputId).val($.fn.userpicker.parseUserInput(g))})},$.fn.userpicker.addUserTag=function(a,b,c,d){if("true"!=$("#user_"+a+" a").attr("data-taken")){var e='
            • 24x24'+c+'
            • ';$("#"+d+"_tag_input").before(e),$("#"+d+"_"+a+" i").click(function(){$("#"+d+"_"+a).remove(),userCount--}),$("#"+d+"_userpicker").hide(),$("#"+d+"_tag_input_field").focus(),$("#"+d+"_tag_input_field").val("")}},$.fn.userpicker.parseUserInput=function(a){$("#"+a+"_invite_tags").after('
              '),$("#"+a+"_inputResult").html($("#"+a+"_invite_tags").html()),$("#"+a+"_inputResult .userInput").each(function(){var b=this.id.replace(a+"_","");$(this).after(b+","),$(this).remove()});var b=$("#"+a+"_inputResult").text();return $("#"+a+"_inputResult").remove(),b}; \ No newline at end of file diff --git a/static/js/humhub/humhub.ui.widget.js b/static/js/humhub/humhub.ui.widget.js index f9a60c9575..977bd63ddb 100644 --- a/static/js/humhub/humhub.ui.widget.js +++ b/static/js/humhub/humhub.ui.widget.js @@ -30,6 +30,11 @@ humhub.module('ui.widget', function(module, require, $) { var initData = this.$.data('ui-init'); this.fire('beforeInit', [this, initData]); this.init(initData); + + if(this.options.widgetFadeIn) { + this.$.fadeIn(this.options.widgetFadeIn); + } + this.fire('afterInit', [this]); } }; diff --git a/static/js/humhub/humhub.util.js b/static/js/humhub/humhub.util.js index 3ded5d7e99..bd55c9473c 100644 --- a/static/js/humhub/humhub.util.js +++ b/static/js/humhub/humhub.util.js @@ -67,6 +67,20 @@ humhub.module('util', function(module, require, $) { }); }; }, + debounce: function(func, wait, immediate) { + var timeout; + return function() { + var context = this, args = arguments; + var later = function() { + timeout = null; + if (!immediate) func.apply(context, args); + }; + var callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) func.apply(context, args); + }; + }, inherits: function(Sub, Parent) { for(var i in Parent) { Sub[i] = Parent[i];