From 88e1fc48ef42aa00a4b9f92d8f6c80e57b2012d5 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Wed, 13 Mar 2024 14:34:48 +0100 Subject: [PATCH] Add assets --- .../bundles/bundle.ckeditor4.min.js | 6751 + .../css/bundle.ckeditor4.min.css | 150 + .../bundles/bundle.ckeditor5.min.js | 118294 +++++++++++++++ .../css/bundle.ckeditor4.min.css | 150 + .../bundles/bundle.tinymce.min.js | 56 + .../bundles/bundle.editor.min.js | 469 + .../bundles/bundle.tiptap.min.js | 32295 ++++ .../djangocms_text/css/bundle.tiptap.min.css | 452 + 8 files changed, 158617 insertions(+) create mode 100644 djangocms_text/contrib/text_ckeditor4/static/djangocms_text/bundles/bundle.ckeditor4.min.js create mode 100644 djangocms_text/contrib/text_ckeditor4/static/djangocms_text/css/bundle.ckeditor4.min.css create mode 100644 djangocms_text/contrib/text_ckeditor5/static/djangocms_text/bundles/bundle.ckeditor5.min.js create mode 100644 djangocms_text/contrib/text_ckeditor5/static/djangocms_text/css/bundle.ckeditor4.min.css create mode 100644 djangocms_text/contrib/text_tinymce/static/djangocms_text/bundles/bundle.tinymce.min.js create mode 100644 djangocms_text/static/djangocms_text/bundles/bundle.editor.min.js create mode 100644 djangocms_text/static/djangocms_text/bundles/bundle.tiptap.min.js create mode 100644 djangocms_text/static/djangocms_text/css/bundle.tiptap.min.css diff --git a/djangocms_text/contrib/text_ckeditor4/static/djangocms_text/bundles/bundle.ckeditor4.min.js b/djangocms_text/contrib/text_ckeditor4/static/djangocms_text/bundles/bundle.ckeditor4.min.js new file mode 100644 index 00000000..dad76a08 --- /dev/null +++ b/djangocms_text/contrib/text_ckeditor4/static/djangocms_text/bundles/bundle.ckeditor4.min.js @@ -0,0 +1,6751 @@ +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./private/css/cms.dialog.css": +/*!************************************!*\ + !*** ./private/css/cms.dialog.css ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + + +/***/ }), + +/***/ "./private/js/ckeditor4/ckeditor.js": +/*!******************************************!*\ + !*** ./private/js/ckeditor4/ckeditor.js ***! + \******************************************/ +/***/ (() => { + +/* +Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license/ +*/ +(function(){if(window.CKEDITOR&&window.CKEDITOR.dom)return;window.CKEDITOR||(window.CKEDITOR=function(){var a=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,d={timestamp:"N2M9",version:"4.21.0",revision:"d529d176d7",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:a},status:"unloaded",basePath:function(){var b=window.CKEDITOR_BASEPATH||"";if(!b)for(var c=document.getElementsByTagName("script"),d=0;dy.getListenerIndex(c)){y=y.listeners;k||(k=this);isNaN(p)&&(p=10);m.fn=c;m.priority=p;for(var A=y.length-1;0<=A;A--)if(y[A].priority<=p)return y.splice(A+1,0,m),{removeListener:g}; +y.unshift(m)}return{removeListener:g}},once:function(){var a=Array.prototype.slice.call(arguments),b=a[1];a[1]=function(a){a.removeListener();return b.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 c=0,e=function(){c=1},d=0,h=function(){d=1};return function(p,m,g){var x=b(this)[p];p=c;var y=d;c=d=0;if(x){var A=x.listeners;if(A.length)for(var A=A.slice(0), +F,v=0;vdocument.documentMode),mobile:-1c||b.quirks);b.gecko&&(d=a.match(/rv:([\d\.]+)/))&&(d=d[1].split("."),c=1E4*d[0]+100*(d[1]||0)+1*(d[2]||0));b.air&&(c=parseFloat(a.match(/ adobeair\/(\d+)/)[1])); +b.webkit&&(c=parseFloat(a.match(/ applewebkit\/(\d+)/)[1]));b.version=c;b.isCompatible=!(b.ie&&7>c)&&!(b.gecko&&4E4>c)&&!(b.webkit&&534>c);b.hidpi=2<=window.devicePixelRatio;b.needsBrFiller=b.gecko||b.webkit||b.ie&&10c;b.cssClass="cke_browser_"+(b.ie?"ie":b.gecko?"gecko":b.webkit?"webkit":"unknown");b.quirks&&(b.cssClass+=" cke_browser_quirks");b.ie&&(b.cssClass+=" cke_browser_ie"+(b.quirks?"6 cke_browser_iequirks":b.version));b.air&&(b.cssClass+=" cke_browser_air"); +b.iOS&&(b.cssClass+=" cke_browser_ios");b.hidpi&&(b.cssClass+=" cke_hidpi");return b}()); +"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,d=CKEDITOR.loadFullCoreTimeout;a&&(CKEDITOR.status="basic_ready",a&&a._load?a():d&&setTimeout(function(){CKEDITOR.loadFullCore&&CKEDITOR.loadFullCore()},1E3*d))})})();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,d){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_WARN&&CKEDITOR.fire("log",{type:"warn",errorCode:a,additionalData:d})}; +CKEDITOR.error=function(a,d){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_ERROR&&CKEDITOR.fire("log",{type:"error",errorCode:a,additionalData:d})}; +CKEDITOR.on("log",function(a){if(window.console&&window.console.log){var d=console[a.data.type]?a.data.type:"log",b=a.data.errorCode;if(a=a.data.additionalData)console[d]("[CKEDITOR] Error code: "+b+".",a);else console[d]("[CKEDITOR] Error code: "+b+".");console[d]("[CKEDITOR] For more information about this error go to https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#"+b)}},null,null,999);CKEDITOR.dom={}; +(function(){function a(a,y,b){this._minInterval=a;this._context=b;this._lastOutput=this._scheduledTimer=0;this._output=CKEDITOR.tools.bind(y,b||{});var c=this;this.input=function(){function a(){c._lastOutput=(new Date).getTime();c._scheduledTimer=0;c._call()}if(!c._scheduledTimer||!1!==c._reschedule()){var x=(new Date).getTime()-c._lastOutput;x/g,k=/|\s) /g,function(a,b){return b+"\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",b=0;8>b;b++)a+=Math.floor(65536*(1+Math.random())).toString(16).substring(1); +return a},override:function(a,b){var c=b(a);c.prototype=a.prototype;return c},setTimeout:function(a,b,c,g,h){h||(h=window);c||(c=h);return h.setTimeout(function(){g?a.apply(c,[].concat(g)):a.apply(c)},b||0)},debounce:function(a,b){var c;return function(){var g=this,h=arguments;clearTimeout(c);c=setTimeout(function(){c=null;a.apply(g,h)},b)}},throttle:function(a,b,c){return new this.buffers.throttle(a,b,c)},trim:function(){var a=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(b){return b.replace(a, +"")}}(),ltrim:function(){var a=/^[ \t\n\r]+/g;return function(b){return b.replace(a,"")}}(),rtrim:function(){var a=/[ \t\n\r]+$/g;return function(b){return b.replace(a,"")}}(),indexOf:function(a,b){if("function"==typeof b)for(var c=0,g=a.length;cparseFloat(c);g&&(c=c.replace("-",""));a.setStyle("width",c);b=a.getClientRect();c=Math.round(b.width);return g?-c:c}return c}}(),repeat:function(a,b){return Array(b+1).join(a)},tryThese:function(){for(var a, +b=0,c=arguments.length;bb;b++)a[b]=("0"+parseInt(a[b],10).toString(16)).slice(-2);return"#"+a.join("")})},normalizeHex:function(a){return a.replace(/#(([0-9a-f]{3}){1,2})($|;|\s+)/gi,function(a,b,c,g){a=b.toLowerCase();3==a.length&&(a=a.split(""),a=[a[0],a[0],a[1],a[1],a[2],a[2]].join(""));return"#"+a+g})},_isValidColorFormat:function(a){if(!a)return!1;a=a.replace(/\s+/g,"");return/^[a-z0-9()#%,./]+$/i.test(a)},parseCssText:function(a,b,c){var g={};c&&(a=(new CKEDITOR.dom.element("span")).setAttribute("style", +a).getAttribute("style")||"");a&&(a=CKEDITOR.tools.normalizeHex(CKEDITOR.tools.convertRgbToHex(a)));if(!a||";"==a)return g;a.replace(/"/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(a,c,x){b&&(c=c.toLowerCase(),"font-family"==c&&(x=x.replace(/\s*,\s*/g,",")),x=CKEDITOR.tools.trim(x));g[c]=x});return g},writeCssText:function(a,b){var c,g=[];for(c in a)g.push(c+":"+a[c]);b&&g.sort();return g.join("; ")},objectCompare:function(a,b,c){var g;if(!a&&!b)return!0;if(!a||!b)return!1; +for(g in a)if(a[g]!=b[g])return!1;if(!c)for(g in b)if(a[g]!=b[g])return!1;return!0},objectKeys:function(a){return CKEDITOR.tools.object.keys(a)},convertArrayToObject:function(a,b){var c={};1==arguments.length&&(b=!0);for(var g=0,h=a.length;gc;c++)a.push(Math.floor(256*Math.random()));for(c=0;c=g||0==c&&48<=g&&57>=g||1==c&&48<=g&&57>=g&&45==l?h+("\\"+g.toString(16)+" "):0==c&&1==b&&45==g?h+("\\"+a.charAt(c)):128<=g||45==g||95==g||48<=g&&57>=g||65<=g&&90>=g||97<=g&&122>=g?h+a.charAt(c):h+("\\"+a.charAt(c));a=h}else a="";return a}, +getMouseButton:function(a){return(a=a&&a.data?a.data.$:a)?CKEDITOR.tools.normalizeMouseButton(a.button):!1},normalizeMouseButton:function(a,b){if(!CKEDITOR.env.ie||9<=CKEDITOR.env.version&&!CKEDITOR.env.ie6Compat)return a;for(var c=[[CKEDITOR.MOUSE_BUTTON_LEFT,1],[CKEDITOR.MOUSE_BUTTON_MIDDLE,4],[CKEDITOR.MOUSE_BUTTON_RIGHT,2]],g=0;gl)for(d=l;3>d;d++)h[d]=0;e[0]=(h[0]&252)>>2;e[1]=(h[0]&3)<<4|h[1]>>4;e[2]=(h[1]&15)<<2|(h[2]&192)>>6;e[3]=h[2]&63;for(d=0;4>d;d++)b=d<=l?b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e[d]):b+"\x3d"}return b},style:{parse:{_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 b={},c=this._findColor(a);c.length&&(b.color=c[0],CKEDITOR.tools.array.forEach(c,function(b){a=a.replace(b,"")}));if(a=CKEDITOR.tools.trim(a))b.unprocessed=a;return b},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,b){function c(a){g.top=h[a[0]];g.right=h[a[1]];g.bottom=h[a[2]];g.left=h[a[3]]}var g={},h=b?b(a):a.split(/\s+/);switch(h.length){case 1:c([0,0,0,0]);break;case 2:c([0,1,0,1]);break;case 3:c([0,1,2,1]);break;case 4:c([0,1,2,3])}return g},border:function(a){return CKEDITOR.tools.style.border.fromCssRule(a)},_findColor:function(a){var b=[],c=CKEDITOR.tools.array,b=b.concat(a.match(this._rgbaRegExp)||[]),b=b.concat(a.match(this._hslaRegExp)||[]);return b=b.concat(c.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,b,c){var g=[];this.forEach(a,function(h,l){b.call(c,h,l,a)&&g.push(h)});return g},find:function(a,b,c){for(var g=a.length,h=0;hCKEDITOR.env.version&&(!a||"object"!==typeof a)){b=[];if("string"===typeof a)for(c=0;cCKEDITOR.env.version)for(h=0;hCKEDITOR.env.version&&(this.type==CKEDITOR.NODE_ELEMENT||this.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)&&c(f);return f},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 d=[],b=this.getDocument().$.documentElement,c=this;c&&c!=b;){var f=c.getParent();f&&d.unshift(this.getIndex.call(c,a));c=f}return d},getDocument:function(){return new CKEDITOR.dom.document(this.$.ownerDocument||this.$.parentNode.ownerDocument)},getIndex:function(a){function d(a,b){var c=b?a.getNext():a.getPrevious();return c&&c.type==CKEDITOR.NODE_TEXT?c.isEmpty()?d(c,b):c: +null}var b=this,c=-1,f;if(!this.getParent()||a&&b.type==CKEDITOR.NODE_TEXT&&b.isEmpty()&&!d(b)&&!d(b,!0))return-1;do if(!a||b.equals(this)||b.type!=CKEDITOR.NODE_TEXT||!f&&!b.isEmpty())c++,f=b.type==CKEDITOR.NODE_TEXT;while(b=b.getPrevious());return c},getNextSourceNode:function(a,d,b){if(b&&!b.call){var c=b;b=function(a){return!a.equals(c)}}a=!a&&this.getFirst&&this.getFirst();var f;if(!a){if(this.type==CKEDITOR.NODE_ELEMENT&&b&&!1===b(this,!0))return null;a=this.getNext()}for(;!a&&(f=(f||this).getParent());){if(b&& +!1===b(f,!0))return null;a=f.getNext()}return!a||b&&!1===b(a)?null:d&&d!=a.type?a.getNextSourceNode(!1,d,b):a},getPreviousSourceNode:function(a,d,b){if(b&&!b.call){var c=b;b=function(a){return!a.equals(c)}}a=!a&&this.getLast&&this.getLast();var f;if(!a){if(this.type==CKEDITOR.NODE_ELEMENT&&b&&!1===b(this,!0))return null;a=this.getPrevious()}for(;!a&&(f=(f||this).getParent());){if(b&&!1===b(f,!0))return null;a=f.getPrevious()}return!a||b&&!1===b(a)?null:d&&a.type!=d?a.getPreviousSourceNode(!1,d,b): +a},getPrevious:function(a){var d=this.$,b;do b=(d=d.previousSibling)&&10!=d.nodeType&&new CKEDITOR.dom.node(d);while(b&&a&&!a(b));return b},getNext:function(a){var d=this.$,b;do b=(d=d.nextSibling)&&new CKEDITOR.dom.node(d);while(b&&a&&!a(b));return b},getParent:function(a){var d=this.$.parentNode;return d&&(d.nodeType==CKEDITOR.NODE_ELEMENT||a&&d.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)?new CKEDITOR.dom.node(d):null},getParents:function(a){var d=this,b=[];do b[a?"push":"unshift"](d);while(d=d.getParent()); +return b},getCommonAncestor:function(a){if(a.equals(this))return this;if(a.contains&&a.contains(this))return a;var d=this.contains?this:this.getParent();do if(d.contains(a))return d;while(d=d.getParent());return null},getPosition:function(a){var d=this.$,b=a.$;if(d.compareDocumentPosition)return d.compareDocumentPosition(b);if(d==b)return CKEDITOR.POSITION_IDENTICAL;if(this.type==CKEDITOR.NODE_ELEMENT&&a.type==CKEDITOR.NODE_ELEMENT){if(d.contains){if(d.contains(b))return CKEDITOR.POSITION_CONTAINS+ +CKEDITOR.POSITION_PRECEDING;if(b.contains(d))return CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING}if("sourceIndex"in d)return 0>d.sourceIndex||0>b.sourceIndex?CKEDITOR.POSITION_DISCONNECTED:d.sourceIndex=document.documentMode||!d||(a=d+":"+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*]*?>)|^/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,d){"string"==typeof a&&(a=(d?d.$: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,d){var b=new CKEDITOR.dom.element("div",d);b.setHtml(a);return b.getFirst().remove()}; +CKEDITOR.dom.element.setMarker=function(a,d,b,c){var f=d.getCustomData("list_marker_id")||d.setCustomData("list_marker_id",CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),e=d.getCustomData("list_marker_names")||d.setCustomData("list_marker_names",{}).getCustomData("list_marker_names");a[f]=d;e[b]=1;return d.setCustomData(b,c)};CKEDITOR.dom.element.clearAllMarkers=function(a){for(var d in a)CKEDITOR.dom.element.clearMarkers(a,a[d],1)}; +CKEDITOR.dom.element.clearMarkers=function(a,d,b){var c=d.getCustomData("list_marker_names"),f=d.getCustomData("list_marker_id"),e;for(e in c)d.removeCustomData(e);d.removeCustomData("list_marker_names");b&&(d.removeCustomData("list_marker_id"),delete a[f])}; +(function(){function a(a,b){return-1<(" "+a+" ").replace(e," ").indexOf(" "+b+" ")}function d(a){var b=!0;a.$.id||(a.$.id="cke_tmp_"+CKEDITOR.tools.getNextNumber(),b=!1);return function(){b||a.removeAttribute("id")}}function b(a,b){var c=CKEDITOR.tools.escapeCss(a.$.id);return"#"+c+" "+b.split(/,\s*/).join(", #"+c+" ")}function c(a){for(var b=0,c=0,g=k[a].length;cCKEDITOR.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,b){var c=new CKEDITOR.dom.range(this.getDocument());c.setStartAfter(this);c.setEndAfter(a); +var g=c.extractContents(!1,b||!1),d;c.insertNode(this.remove());if(CKEDITOR.env.ie&&!CKEDITOR.env.edge){for(c=new CKEDITOR.dom.element("div");d=g.getFirst();)d.$.style.backgroundColor&&(d.$.style.backgroundColor=d.$.style.backgroundColor),c.append(d);c.insertAfter(this);c.remove(!0)}else g.insertAfterNode(this)},contains:document.compareDocumentPosition?function(a){return!!(this.$.compareDocumentPosition(a.$)&16)}:function(a){var b=this.$;return a.type!=CKEDITOR.NODE_ELEMENT?b.contains(a.getParent().$): +b!=a.$&&b.contains(a.$)},focus:function(){function a(){try{this.$.focus()}catch(b){}}return function(b){b?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 b=CKEDITOR.tools.extend({}, +this.$.getBoundingClientRect());!b.width&&(b.width=b.right-b.left);!b.height&&(b.height=b.bottom-b.top);return a?CKEDITOR.tools.getAbsoluteRectPosition(this.getWindow(),b):b},setHtml:CKEDITOR.env.ie&&9>CKEDITOR.env.version?function(a){try{var b=this.$;if(this.getParent())return b.innerHTML=a;var c=this.getDocument()._getHtml5ShivFrag();c.appendChild(b);b.innerHTML=a;c.removeChild(b);return a}catch(g){this.$.innerHTML="";b=new CKEDITOR.dom.element("body",this.getDocument());b.$.innerHTML=a;for(b=b.getChildren();b.count();)this.append(b.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(b){this.$[a?"textContent":"innerText"]=b}}(),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 b={},c=this.$.attributes,g;a=CKEDITOR.tools.isArray(a)? +a:[];for(g=0;g=document.documentMode){var b=this.$.scopeName;"HTML"!=b&&(a=b.toLowerCase()+":"+a)}this.getName=function(){return a};return this.getName()},getValue:function(){return this.$.value},getFirst:function(a){var b=this.$.firstChild;(b=b&&new CKEDITOR.dom.node(b))&&a&&!a(b)&&(b=b.getNext(a));return b},getLast:function(a){var b=this.$.lastChild;(b=b&&new CKEDITOR.dom.node(b))&&a&&!a(b)&&(b=b.getPrevious(a));return b},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 b=0;bCKEDITOR.env.version&&this.is("a")){var c=this.getParent();c.type==CKEDITOR.NODE_ELEMENT&&(c=c.clone(),c.setHtml(b),b=c.getHtml(),c.setHtml(a),a=c.getHtml())}return b==a},isVisible:function(){var a=(this.$.offsetHeight||this.$.offsetWidth)&&"hidden"!=this.getComputedStyle("visibility"),b,c;a&&CKEDITOR.env.webkit&&(b=this.getWindow(),!b.equals(CKEDITOR.document.getWindow())&&(c=b.$.frameElement)&&(a=(new CKEDITOR.dom.element(c)).isVisible()));return!!a},isEmptyInlineRemoveable:function(){if(!CKEDITOR.dtd.$removeEmpty[this.getName()])return!1; +for(var a=this.getChildren(),b=0,c=a.count();bCKEDITOR.env.version?function(b){return"name"==b?!!this.$.name:a.call(this,b)}:a:function(a){return!!this.$.attributes.getNamedItem(a)}}(),hide:function(){this.setStyle("display","none")},moveChildren:function(a,b){var c=this.$;a=a.$;if(c!=a){var g;if(b)for(;g=c.lastChild;)a.insertBefore(c.removeChild(g),a.firstChild);else for(;g=c.firstChild;)a.appendChild(c.removeChild(g))}},mergeSiblings:function(){function a(b,c,g){if(c&&c.type==CKEDITOR.NODE_ELEMENT){for(var d= +[];c.data("cke-bookmark")||c.isEmptyInlineRemoveable();)if(d.push(c),c=g?c.getNext():c.getPrevious(),!c||c.type!=CKEDITOR.NODE_ELEMENT)return;if(b.isIdentical(c)){for(var e=g?b.getLast():b.getFirst();d.length;)d.shift().move(b,!g);c.moveChildren(b,!g);c.remove();e&&e.type==CKEDITOR.NODE_ELEMENT&&e.mergeSiblings()}}}return function(b){if(!1===b||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(b,c){"class"==b?this.$.className=c:"style"==b?this.$.style.cssText=c:"tabindex"==b?this.$.tabIndex=c:"checked"==b?this.$.checked=c:"contenteditable"==b?a.call(this,"contentEditable",c):a.apply(this,arguments);return this}:CKEDITOR.env.ie8Compat&&CKEDITOR.env.secure?function(b,c){if("src"==b&&c.match(/^http:\/\//))try{a.apply(this, +arguments)}catch(g){}else a.apply(this,arguments);return this}:a}(),setAttributes:function(a){for(var b in a)this.setAttribute(b,a[b]);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 b= +0;bCKEDITOR.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,b=this.getElementsByTag("*"),c=0,g=b.count();cf||0f?f:d);c&&(0>e||0e?e: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;gCKEDITOR.env.version){var d=g.ownerDocument.createEventObject(),e;for(e in b)d[e]=b[e];g.fireEvent(c, +d)}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=u.getChildCount()?(u=u.getChild(E-1),t=!0):u=u.getChild(E):z=t=!0;q.type==CKEDITOR.NODE_TEXT?p?H=!0:q.split(K):0ea)for(;X;)X=f(X,D,!0);D=R}p|| +h()}}function b(){var a=!1,b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(!0),d=CKEDITOR.dom.walker.bogus();return function(f){return c(f)||b(f)?!0:d(f)&&!a?a=!0:f.type==CKEDITOR.NODE_TEXT&&(f.hasAscendant("pre")||CKEDITOR.tools.trim(f.getText()).length)||f.type==CKEDITOR.NODE_ELEMENT&&!f.is(e)?!1:!0}}function c(a){var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(1);return function(d){return c(d)||b(d)?!0:!a&&k(d)||d.type==CKEDITOR.NODE_ELEMENT&&d.is(CKEDITOR.dtd.$removeEmpty)}} +function f(a){return function(){var b;return this[a?"getPreviousNode":"getNextNode"](function(a){!b&&m(a)&&(b=a);return p(a)&&!(k(a)&&a.equals(b))})}}var e={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},k=CKEDITOR.dom.walker.bogus(),h=/^[\t\r\n ]*(?: |\xa0)$/,p=CKEDITOR.dom.walker.editable(),m=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|| +d(this,2,b,!1,"undefined"==typeof a?!0:a);return b},deleteContents:function(a){this.collapsed||d(this,0,null,a)},extractContents:function(a,b){var c=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||d(this,1,c,a,"undefined"==typeof b?!0:b);return c},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 c=this.startContainer,d=this.endContainer,e=this.collapsed,f,l,h,k;f=this.document.createElement("span");f.data("cke-bookmark",1);f.setStyle("display","none");f.setHtml("\x26nbsp;");a&&(h="cke_bm_"+CKEDITOR.tools.getNextNumber(),f.setAttribute("id",h+(e?"C":"S")));e||(l=f.clone(),l.setHtml("\x26nbsp;"),a&&l.setAttribute("id",h+"E"),k=this.clone(),b(d)&&(d=b(d), +k.moveToPosition(d,CKEDITOR.POSITION_AFTER_END)),k.collapse(),k.insertNode(l));k=this.clone();b(c)&&(d=b(c),k.moveToPosition(d,CKEDITOR.POSITION_BEFORE_START));k.collapse(!0);k.insertNode(f);l?(this.setStartAfter(f),this.setEndBefore(l)):this.moveToPosition(f,CKEDITOR.POSITION_AFTER_END);return{startNode:a?h+(e?"C":"S"):f,endNode:a?h+"E":l,serializable:a,collapsed:e}},createBookmark2:function(){function a(b){var g=b.container,d=b.offset,e;e=g;var f=d;e=e.type!=CKEDITOR.NODE_ELEMENT||0===f||f==e.getChildCount()? +0:e.getChild(f-1).type==CKEDITOR.NODE_TEXT&&e.getChild(f).type==CKEDITOR.NODE_TEXT;e&&(g=g.getChild(d-1),d=g.getLength());if(g.type==CKEDITOR.NODE_ELEMENT&&0=a.offset&&(a.offset=d.getIndex(),a.container=d.getParent()))}}var c=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT,!0);return function(c){var d=this.collapsed,e={container:this.startContainer,offset:this.startOffset},l={container:this.endContainer,offset:this.endOffset};c&&(a(e),b(e,this.root), +d||(a(l),b(l,this.root)));return{start:e.container.getAddress(c),end:d?null:l.container.getAddress(c),startOffset:e.offset,endOffset:l.offset,normalized:c,collapsed:d,is2:!0}}}(),moveToBookmark:function(a){if(a.is2){var b=this.document.getByAddress(a.start,a.normalized),c=a.startOffset,d=a.end&&this.document.getByAddress(a.end,a.normalized);a=a.endOffset;this.setStart(b,c);d?this.setEnd(d,a):this.collapse(!0)}else b=(c=a.serializable)?this.document.getById(a.startNode):a.startNode,a=c?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,c=this.startOffset,d=this.endOffset,e;if(a.type==CKEDITOR.NODE_ELEMENT)if(e=a.getChildCount(),e>c)a=a.getChild(c);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>d)b=b.getChild(d).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 c=this.startContainer,d=this.endContainer,c=c.equals(d)?a&&c.type==CKEDITOR.NODE_ELEMENT&&this.startOffset==this.endOffset-1?c.getChild(this.startOffset):c:c.getCommonAncestor(d);return b&&!c.is?c.getParent():c},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 c=this.startContainer,d=this.startOffset,e=this.collapsed;if((!a||e)&&c&&c.type==CKEDITOR.NODE_TEXT){if(d)if(d>=c.getLength())d=c.getIndex()+1,c=c.getParent();else{var f=c.split(d),d=c.getIndex()+1,c=c.getParent();this.startContainer.equals(this.endContainer)?this.setEnd(f,this.endOffset-this.startOffset):c.equals(this.endContainer)&&(this.endOffset+=1)}else d=c.getIndex(),c=c.getParent();this.setStart(c,d);if(e){this.collapse(!0);return}}c=this.endContainer;d=this.endOffset;b||e||!c||c.type!= +CKEDITOR.NODE_TEXT||(d?(d>=c.getLength()||c.split(d),d=c.getIndex()+1):d=c.getIndex(),c=c.getParent(),this.setEnd(c,d))},enlarge:function(a,b){function c(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")?null:a}function d(a,b,c){var g=new CKEDITOR.dom.range(c);g.setStart(a,b);g.setEndAt(c,CKEDITOR.POSITION_BEFORE_END);c=new CKEDITOR.dom.walker(g);for(c.guard=function(a){return!(a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary())};g=c.next();){if(g.type!=CKEDITOR.NODE_TEXT)return!1; +f=g!=a?g.getText():g.substring(b);if(e.test(f))return!1}return!0}var e=new RegExp(/[^\s\ufeff]/),f,l;switch(a){case CKEDITOR.ENLARGE_INLINE:var h=1;case CKEDITOR.ENLARGE_ELEMENT:if(this.collapsed)break;var k=this.getCommonAncestor();l=this.root;var m,p,q,u,K,E=!1,C;C=this.startContainer;var t=this.startOffset;C.type==CKEDITOR.NODE_TEXT?(t&&(C=!CKEDITOR.tools.trim(C.substring(0,t)).length&&C,E=!!C),C&&((u=C.getPrevious())||(q=C.getParent()))):(t&&(u=C.getChild(t-1)||C.getLast()),u||(q=C));for(q=c(q);q|| +u;){if(q&&!u){!K&&q.equals(k)&&(K=!0);if(h?q.isBlockBoundary():!l.contains(q))break;E&&"inline"==q.getComputedStyle("display")||(E=!1,K?m=q:this.setStartBefore(q));u=q.getPrevious()}for(;u;)if(C=!1,u.type==CKEDITOR.NODE_COMMENT)u=u.getPrevious();else{if(u.type==CKEDITOR.NODE_TEXT)f=u.getText(),e.test(f)&&(u=null),C=/[\s\ufeff]$/.test(f);else if((u.$.offsetWidth>(CKEDITOR.env.webkit?1:0)||b&&u.is("br"))&&!u.data("cke-bookmark"))if(E&&CKEDITOR.dtd.$removeEmpty[u.getName()]){f=u.getText();if(e.test(f))u= +null;else for(var t=u.$.getElementsByTagName("*"),B=0,z;z=t[B++];)if(!CKEDITOR.dtd.$removeEmpty[z.nodeName.toLowerCase()]){u=null;break}u&&(C=!!f.length)}else u=null;C&&(E?K?m=q:q&&this.setStartBefore(q):E=!0);if(u){C=u.getPrevious();if(!q&&!C){q=u;u=null;break}u=C}else q=null}q&&(q=c(q.getParent()))}C=this.endContainer;t=this.endOffset;q=u=null;K=E=!1;C.type==CKEDITOR.NODE_TEXT?CKEDITOR.tools.trim(C.substring(t)).length?E=!0:(E=!C.getLength(),t==C.getLength()?(u=C.getNext())||(q=C.getParent()):d(C, +t,l)&&(q=C.getParent())):(u=C.getChild(t))||(q=C);for(;q||u;){if(q&&!u){!K&&q.equals(k)&&(K=!0);if(h?q.isBlockBoundary():!l.contains(q))break;E&&"inline"==q.getComputedStyle("display")||(E=!1,K?p=q:q&&this.setEndAfter(q));u=q.getNext()}for(;u;){C=!1;if(u.type==CKEDITOR.NODE_TEXT)f=u.getText(),d(u,0,l)||(u=null),C=/^[\s\ufeff]/.test(f);else if(u.type==CKEDITOR.NODE_ELEMENT){if((0=l.getLength()?f.setStartAfter(l):(f.setStartBefore(l),c=0):f.setStartBefore(l));h&&h.type==CKEDITOR.NODE_TEXT&&(m?m>=h.getLength()?f.setEndAfter(h):(f.setEndAfter(h),p=0):f.setEndBefore(h));var f=new CKEDITOR.dom.walker(f),q=CKEDITOR.dom.walker.bookmark(),u=CKEDITOR.dom.walker.bogus();f.evaluator=function(b){return b.type==(a==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var K;f.guard=function(b,c){if(e&&u(b)||q(b))return!0;if(a==CKEDITOR.SHRINK_ELEMENT&& +b.type==CKEDITOR.NODE_TEXT||c&&b.equals(K)||!1===d&&b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()||b.type==CKEDITOR.NODE_ELEMENT&&b.hasAttribute("contenteditable"))return!1;c||b.type!=CKEDITOR.NODE_ELEMENT||(K=b);return!0};c&&(l=f[a==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(l,b?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_START);p&&(f.reset(),(f=f[a==CKEDITOR.SHRINK_ELEMENT?"lastBackward":"previous"]())&&this.setEndAt(f,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END)); +return!(!c&&!p)}},insertNode:function(a){this.optimizeBookmark();this.trim(!1,!0);var b=this.startContainer,c=b.getChild(this.startOffset);c?a.insertBefore(c):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,c){b.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[b.getName()]&&(c=b.getIndex(),b=b.getParent());this._setStartContainer(b);this.startOffset=c;this.endContainer||(this._setEndContainer(b),this.endOffset=c);a(this)},setEnd:function(b,c){b.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[b.getName()]&&(c=b.getIndex()+1,b=b.getParent());this._setEndContainer(b);this.endOffset=c;this.startContainer||(this._setStartContainer(b), +this.startOffset=c);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,c){switch(c){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,c){switch(c){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 c=this.createBookmark(),d=this.document.createElement(b);this.collapse(a);this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);this.extractContents().appendTo(d);d.trim();this.insertNode(d);var e=d.getBogus();e&&e.remove();d.appendBogus();this.moveToBookmark(c);return d},splitBlock:function(a,b){var c=new CKEDITOR.dom.elementPath(this.startContainer,this.root),d=new CKEDITOR.dom.elementPath(this.endContainer,this.root),e=c.block,f=d.block,l=null;if(!c.blockLimit.equals(d.blockLimit))return null;"br"!= +a&&(e||(e=this.fixBlock(!0,a),f=(new CKEDITOR.dom.elementPath(this.endContainer,this.root)).block),f||(f=this.fixBlock(!1,a)));c=e&&this.checkStartOfBlock();d=f&&this.checkEndOfBlock();this.deleteContents();e&&e.equals(f)&&(d?(l=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(f,CKEDITOR.POSITION_AFTER_END),f=null):c?(l=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START),e=null):(f=this.splitElement(e,b|| +!1),e.is("ul","ol")||e.appendBogus()));return{previousBlock:e,nextBlock:f,wasStartOfBlock:c,wasEndOfBlock:d,elementPath:l}},splitElement:function(a,b){if(!this.collapsed)return null;this.setEndAt(a,CKEDITOR.POSITION_BEFORE_END);var c=this.extractContents(!1,b||!1),d=a.clone(!1,b||!1);c.appendTo(d);d.insertAfter(a);this.moveToPosition(a,CKEDITOR.POSITION_AFTER_END);return d},removeEmptyBlocksAtEnd:function(){function a(g){return function(a){return b(a)||c(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.isEmptyInlineRemoveable()|| +g.is("table")&&a.is("caption")?!1:!0}}var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(!1);return function(b){for(var c=this.createBookmark(),d=this[b?"endPath":"startPath"](),e=d.block||d.blockLimit,f;e&&!e.equals(d.root)&&!e.getFirst(a(e));)f=e.getParent(),this[b?"setEndAt":"setStartAt"](e,CKEDITOR.POSITION_AFTER_END),e.remove(1),e=f;this.moveToBookmark(c)}}(),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,b){var d=b==CKEDITOR.START,e=this.clone();e.collapse(d);e[d?"setStartAt":"setEndAt"](a,d?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END);e=new CKEDITOR.dom.walker(e);e.evaluator=c(d);return e[d?"checkBackward":"checkForward"]()},checkStartOfBlock:function(a){var c=this.startContainer,d=this.startOffset;CKEDITOR.env.ie&&d&&c.type==CKEDITOR.NODE_TEXT&&(c=CKEDITOR.tools.ltrim(c.substring(0,d)),h.test(c)&&this.trim(0,1));a||this.trim();a=new CKEDITOR.dom.elementPath(this.startContainer, +this.root);c=this.clone();c.collapse(!0);c.setStartAt(a.block||a.blockLimit,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(c);a.evaluator=b();return a.checkBackward()},checkEndOfBlock:function(a){var c=this.endContainer,d=this.endOffset;CKEDITOR.env.ie&&c.type==CKEDITOR.NODE_TEXT&&(c=CKEDITOR.tools.rtrim(c.substring(d)),h.test(c)&&this.trim(1,0));a||this.trim();a=new CKEDITOR.dom.elementPath(this.endContainer,this.root);c=this.clone();c.collapse(!1);c.setEndAt(a.block||a.blockLimit,CKEDITOR.POSITION_BEFORE_END); +a=new CKEDITOR.dom.walker(c);a.evaluator=b();return a.checkForward()},getPreviousNode:function(a,b,c){var d=this.clone();d.collapse(1);d.setStartAt(c||this.root,CKEDITOR.POSITION_AFTER_START);c=new CKEDITOR.dom.walker(d);c.evaluator=a;c.guard=b;return c.previous()},getNextNode:function(a,b,c){var d=this.clone();d.collapse();d.setEndAt(c||this.root,CKEDITOR.POSITION_BEFORE_END);c=new CKEDITOR.dom.walker(d);c.evaluator=a;c.guard=b;return c.next()},checkReadOnly:function(){function a(b,c){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(c)||b.equals(c)))break}b=b.getParent()}return 1}return function(){var b=this.startContainer,c=this.endContainer;return!(a(b,c)&&a(c,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 c=0;a;){if(a.type==CKEDITOR.NODE_TEXT){b&&this.endContainer&&this.checkEndOfBlock()&&h.test(a.getText())?this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START):this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START);c=1;break}if(a.type==CKEDITOR.NODE_ELEMENT)if(a.isEditable())this.moveToPosition(a,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_START),c=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 d=a,e=c,f=void 0;d.type==CKEDITOR.NODE_ELEMENT&&d.isEditable(!1)&&(f=d[b?"getLast":"getFirst"](m));e||f||(f=d[b?"getPrevious":"getNext"](m));a=f}return!!c},moveToClosestEditablePosition:function(a,b){var c,d=0,e,f,l=[CKEDITOR.POSITION_AFTER_END,CKEDITOR.POSITION_BEFORE_START];a?(c=new CKEDITOR.dom.range(this.root),c.moveToPosition(a,l[b?0:1])):c=this.clone();if(a&& +!a.is(CKEDITOR.dtd.$block))d=1;else if(e=c[b?"getNextEditableNode":"getPreviousEditableNode"]())d=1,(f=e.type==CKEDITOR.NODE_ELEMENT)&&e.is(CKEDITOR.dtd.$block)&&"false"==e.getAttribute("contenteditable")?(c.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),c.setEndAt(e,CKEDITOR.POSITION_AFTER_END)):!CKEDITOR.env.needsBrFiller&&f&&e.is(CKEDITOR.dom.walker.validEmptyBlockContainers)?(c.setEnd(e,0),c.collapse()):c.moveToPosition(e,l[b?1:0]);d&&this.moveToRange(c);return!!d},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),c=CKEDITOR.dom.walker.whitespaces(!0);a.evaluator=function(a){return c(a)&&b(a)};var d=a.next();a.reset();return d&&d.equals(a.previous())?d: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:f(),getPreviousEditableNode:f(1),_getTableElement:function(a){a=a||{td:1,th:1,tr:1,tbody:1,thead:1,tfoot:1,table:1};var b=this.getTouchedStartNode(),c=this.getTouchedEndNode(),d=b.getAscendant("table",!0),c=c.getAscendant("table",!0);return d&&!this.root.contains(d)? +null:this.getEnclosedNode()?this.getEnclosedNode().getAscendant(a,!0):d&&c&&(d.equals(c)||d.contains(c)||c.contains(d))?b.getAscendant(a,!0):null},scrollIntoView:function(){var a=new CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e",this.document),b,c,d,e=this.clone();e.optimize();(d=e.startContainer.type==CKEDITOR.NODE_TEXT)?(c=e.startContainer.getText(),b=e.startContainer.split(e.startOffset),a.insertAfter(e.startContainer)):e.insertNode(a);a.scrollIntoView();d&&(e.startContainer.setText(c), +b.remove());a.remove()},getClientRects:function(){function a(b,c){var d=CKEDITOR.tools.array.map(b,function(a){return a}),e=new CKEDITOR.dom.range(c.root),g,f,h;c.startContainer instanceof CKEDITOR.dom.element&&(f=0===c.startOffset&&c.startContainer.hasAttribute("data-widget"));c.endContainer instanceof CKEDITOR.dom.element&&(h=(h=c.endOffset===(c.endContainer.getChildCount?c.endContainer.getChildCount():c.endContainer.length))&&c.endContainer.hasAttribute("data-widget"));f&&e.setStart(c.startContainer.getParent(), +c.startContainer.getIndex());h&&e.setEnd(c.endContainer.getParent(),c.endContainer.getIndex()+1);if(f||h)c=e;e=c.cloneContents().find("[data-cke-widget-id]").toArray();if(e=CKEDITOR.tools.array.map(e,function(a){var b=c.root.editor;a=a.getAttribute("data-cke-widget-id");return b.widgets.instances[a].element}))return e=CKEDITOR.tools.array.map(e,function(a){var b;b=a.getParent().hasClass("cke_widget_wrapper")?a.getParent():a;g=this.root.getDocument().$.createRange();g.setStart(b.getParent().$,b.getIndex()); +g.setEnd(b.getParent().$,b.getIndex()+1);b=g.getClientRects();b.widgetRect=a.getClientRect();return b},c),CKEDITOR.tools.array.forEach(e,function(a){function b(e){CKEDITOR.tools.array.forEach(d,function(b,g){var f=CKEDITOR.tools.objectCompare(a[e],b);f||(f=CKEDITOR.tools.objectCompare(a.widgetRect,b));f&&(Array.prototype.splice.call(d,g,a.length-e,a.widgetRect),c=!0)});c||(earguments.length||(this.range=a,this.forceBrBreak=0,this.enlargeBr=1,this.enforceRealBlocks=0,this._||(this._={}))}function d(a){var b=[];a.forEach(function(a){if("true"==a.getAttribute("contenteditable"))return b.push(a),!1},CKEDITOR.NODE_ELEMENT,!0);return b}function b(a,c,e,f){a:{null==f&&(f=d(e));for(var h;h=f.shift();)if(h.getDtd().p){f={element:h,remaining:f};break a}f=null}if(!f)return 0;if((h=CKEDITOR.filter.instances[f.element.data("cke-filter")])&&!h.check(c))return b(a, +c,e,f.remaining);c=new CKEDITOR.dom.range(f.element);c.selectNodeContents(f.element);c=c.createIterator();c.enlargeBr=a.enlargeBr;c.enforceRealBlocks=a.enforceRealBlocks;c.activeFilter=c.filter=h;a._.nestedEditable={element:f.element,container:e,remaining:f.remaining,iterator:c};return 1}function c(a,b,c){if(!b)return!1;a=a.clone();a.collapse(!c);return a.checkBoundaryOfElement(b,c?CKEDITOR.START:CKEDITOR.END)}var f=/^[\r\n\t ]+$/,e=CKEDITOR.dom.walker.bookmark(!1,!0),k=CKEDITOR.dom.walker.whitespaces(!0), +h=function(a){return e(a)&&k(a)},p={dd:1,dt:1,li:1};a.prototype={getNextParagraph:function(a){var d,k,y,A,F;a=a||"p";if(this._.nestedEditable){if(d=this._.nestedEditable.iterator.getNextParagraph(a))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,d;this.activeFilter=this.filter;if(b(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 v=this.range.clone();k=v.startPath();var l=v.endPath(),L=!v.collapsed&&c(v,k.block),w=!v.collapsed&&c(v,l.block,1);v.shrink(CKEDITOR.SHRINK_ELEMENT,!0);L&&v.setStartAt(k.block,CKEDITOR.POSITION_BEFORE_END);w&&v.setEndAt(l.block,CKEDITOR.POSITION_AFTER_START);k=v.endContainer.hasAscendant("pre",!0)||v.startContainer.hasAscendant("pre",!0);v.enlarge(this.forceBrBreak&&!k||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS); +v.collapsed||(k=new CKEDITOR.dom.walker(v.clone()),l=CKEDITOR.dom.walker.bookmark(!0,!0),k.evaluator=l,this._.nextNode=k.next(),k=new CKEDITOR.dom.walker(v.clone()),k.evaluator=l,k=k.previous(),this._.lastNode=k.getNextSourceNode(!0,null,v.root),this._.lastNode&&this._.lastNode.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()&&(l=this.range.clone(),l.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END),l.checkEndOfBlock()&& +(l=new CKEDITOR.dom.elementPath(l.endContainer,l.root),this._.lastNode=(l.block||l.blockLimit).getNextSourceNode(!0))),this._.lastNode&&v.root.contains(this._.lastNode)||(this._.lastNode=this._.docEndMarker=v.document.createText(""),this._.lastNode.insertAfter(k)),v=null);this._.started=1;k=v}l=this._.nextNode;v=this._.lastNode;for(this._.nextNode=null;l;){var L=0,w=l.hasAscendant("pre"),J=l.type!=CKEDITOR.NODE_ELEMENT,G=0;if(J)l.type==CKEDITOR.NODE_TEXT&&f.test(l.getText())&&(J=0);else{var q=l.getName(); +if(CKEDITOR.dtd.$block[q]&&"false"==l.getAttribute("contenteditable")){d=l;b(this,a,d);break}else if(l.isBlockBoundary(this.forceBrBreak&&!w&&{br:1})){if("br"==q)J=1;else if(!k&&!l.getChildCount()&&"hr"!=q){d=l;y=l.equals(v);break}k&&(k.setEndAt(l,CKEDITOR.POSITION_BEFORE_START),"br"!=q&&(this._.nextNode=l));L=1}else{if(l.getFirst()){k||(k=this.range.clone(),k.setStartAt(l,CKEDITOR.POSITION_BEFORE_START));l=l.getFirst();continue}J=1}}J&&!k&&(k=this.range.clone(),k.setStartAt(l,CKEDITOR.POSITION_BEFORE_START)); +y=(!L||J)&&l.equals(v);if(k&&!L)for(;!l.getNext(h)&&!y;){q=l.getParent();if(q.isBlockBoundary(this.forceBrBreak&&!w&&{br:1})){L=1;J=0;y||q.equals(v);k.setEndAt(q,CKEDITOR.POSITION_BEFORE_END);break}l=q;J=1;y=l.equals(v);G=1}J&&k.setEndAt(l,CKEDITOR.POSITION_AFTER_END);l=this._getNextSourceNode(l,G,v);if((y=!l)||L&&k)break}if(!d){if(!k)return this._.docEndMarker&&this._.docEndMarker.remove(),this._.nextNode=null;d=new CKEDITOR.dom.elementPath(k.startContainer,k.root);l=d.blockLimit;L={div:1,th:1,td:1}; +d=d.block;!d&&l&&!this.enforceRealBlocks&&L[l.getName()]&&k.checkStartOfBlock()&&k.checkEndOfBlock()&&!l.equals(k.root)?d=l:!d||this.enforceRealBlocks&&d.is(p)?(d=this.range.document.createElement(a),k.extractContents().appendTo(d),d.trim(),k.insertNode(d),A=F=!0):"li"!=d.getName()?k.checkStartOfBlock()&&k.checkEndOfBlock()||(d=d.clone(!1),k.extractContents().appendTo(d),d.trim(),F=k.splitBlock(),A=!F.wasStartOfBlock,F=!F.wasEndOfBlock,k.insertNode(d)):y||(this._.nextNode=d.equals(v)?null:this._getNextSourceNode(k.getBoundaryNodes().endNode, +1,v))}A&&(A=d.getPrevious())&&A.type==CKEDITOR.NODE_ELEMENT&&("br"==A.getName()?A.remove():A.getLast()&&"br"==A.getLast().$.nodeName.toLowerCase()&&A.getLast().remove());F&&(A=d.getLast())&&A.type==CKEDITOR.NODE_ELEMENT&&"br"==A.getName()&&(!CKEDITOR.env.needsBrFiller||A.getPrevious(e)||A.getNext(e))&&A.remove();this._.nextNode||(this._.nextNode=y||d.equals(v)||!v?null:this._getNextSourceNode(d,1,v));return d},_getNextSourceNode:function(a,b,c){function d(a){return!(a.equals(c)||a.equals(f))}var f= +this.range.root;for(a=a.getNextSourceNode(b,null,d);!e(a);)a=a.getNextSourceNode(b,null,d);return a}};CKEDITOR.dom.range.prototype.createIterator=function(){return new a(this)}})(); +CKEDITOR.command=function(a,d){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!==d.exec.call(this,a,b)};this.refresh=function(a,b){if(!this.readOnly&&a.readOnly)return!0;if(this.context&&!b.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:b})?!0:d.refresh&&!1!==d.refresh.apply(this,arguments)};var b;this.checkAllowed=function(c){return c||"boolean"!=typeof b?b=a.activeFilter.checkFeature(this):b};CKEDITOR.tools.extend(this,d,{modes:{wysiwyg:1},editorFocus:1,contextSensitive:!!d.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,useComputedState:!0,width:"",baseFloatZIndex:1E4,blockedKeystrokes:[CKEDITOR.CTRL+66,CKEDITOR.CTRL+73,CKEDITOR.CTRL+85]}; +(function(){function a(a,b,c,d,e){var f,g;a=[];for(f in b){g=b[f];g="boolean"==typeof g?{}:"function"==typeof g?{match:g}:B(g);"$"!=f.charAt(0)&&(g.elements=f);c&&(g.featureName=c.toLowerCase());var n=g;n.elements=k(n.elements,/\s+/)||null;n.propertiesOnly=n.propertiesOnly||!0===n.elements;var t=/\s*,\s*/,r=void 0;for(r in N){n[r]=k(n[r],t)||null;var l=n,z=O[r],h=k(n[O[r]],t),E=n[r],D=[],H=!0,I=void 0;h?H=!1:h={};for(I in E)"!"==I.charAt(0)&&(I=I.slice(1),D.push(I),h[I]=!0,H=!1);for(;I=D.pop();)E[I]= +E["!"+I],delete E["!"+I];l[z]=(H?!1:h)||null}n.match=n.match||null;d.push(g);a.push(g)}b=e.elements;e=e.generic;var C;c=0;for(d=a.length;c=--p&&(e&&CKEDITOR.document.getDocumentElement().removeStyle("cursor"),x(b))},A=function(b,c){a[b]=1;var e=d[b];delete d[b];for(var f=0;f=CKEDITOR.env.version||CKEDITOR.env.ie9Compat)?f.$.onreadystatechange=function(){if("loaded"==f.$.readyState||"complete"==f.$.readyState)f.$.onreadystatechange=null,A(b,!0)}:(f.$.onload=function(){setTimeout(function(){f.$.onload=null;f.$.onerror=null;A(b,!0)},0)},f.$.onerror=function(){f.$.onload=null;f.$.onerror=null;A(b,!1)}));f.appendTo(CKEDITOR.document.getHead())}}};e&&CKEDITOR.document.getDocumentElement().setStyle("cursor", +"wait");for(var v=0;v]+)>)|(?:!--([\S|\s]*?)--!?>)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g}}; +(function(){var a=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,d={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(b){for(var c,f,e=0,k;c=this._.htmlPartsRegex.exec(b);){f=c.index;if(f>e)if(e=b.substring(e,f),k)k.push(e);else this.onText(e); +e=this._.htmlPartsRegex.lastIndex;if(f=c[1])if(f=f.toLowerCase(),k&&CKEDITOR.dtd.$cdata[f]&&(this.onCDATA(k.join("")),k=null),!k){this.onTagClose(f);continue}if(k)k.push(c[0]);else if(f=c[3]){if(f=f.toLowerCase(),!/="/.test(f)){var h={},p,m=c[4];c=!!c[5];if(m)for(;p=a.exec(m);){var g=p[1].toLowerCase();p=p[2]||p[3]||p[4]||"";h[g]=!p&&d[g]?g:CKEDITOR.tools.htmlDecodeAttr(p)}this.onTagOpen(f,h,c);!k&&CKEDITOR.dtd.$cdata[f]&&(k=[])}}else if(f=c[2])this.onComment(f)}if(b.length>e)this.onText(b.substring(e, +b.length))}}})(); +CKEDITOR.htmlParser.basicWriter=CKEDITOR.tools.createClass({$:function(){this._={output:[]}},proto:{openTag:function(a){this._.output.push("\x3c",a)},openTagClose:function(a,d){d?this._.output.push(" /\x3e"):this._.output.push("\x3e")},attribute:function(a,d){"string"==typeof d&&(d=CKEDITOR.tools.htmlEncodeAttr(d));this._.output.push(" ",a,'\x3d"',d,'"')},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 d=this._.output.join("");a&&this.reset();return d}}});"use strict"; +(function(){CKEDITOR.htmlParser.node=function(){};CKEDITOR.htmlParser.node.prototype={remove:function(){var a=this.parent.children,d=CKEDITOR.tools.indexOf(a,this),b=this.previous,c=this.next;b&&(b.next=c);c&&(c.previous=b);a.splice(d,1);this.parent=null},replaceWith:function(a){var d=this.parent.children,b=CKEDITOR.tools.indexOf(d,this),c=a.previous=this.previous,f=a.next=this.next;c&&(c.next=a);f&&(f.previous=a);d[b]=a;a.parent=this.parent;this.parent=null},insertAfter:function(a){var d=a.parent.children, +b=CKEDITOR.tools.indexOf(d,a),c=a.next;d.splice(b+1,0,this);this.next=a.next;this.previous=a;a.next=this;c&&(c.previous=this);this.parent=a.parent},insertBefore:function(a){var d=a.parent.children,b=CKEDITOR.tools.indexOf(d,a);d.splice(b,0,this);this.next=a;(this.previous=a.previous)&&(a.previous.next=this);a.previous=this;this.parent=a.parent},getAscendant:function(a){var d="function"==typeof a?a:"string"==typeof a?function(b){return b.name==a}:function(b){return b.name in a},b=this.parent;for(;b&& +b.type==CKEDITOR.NODE_ELEMENT;){if(d(b))return b;b=b.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,d){var b=this.value;if(!(b=a.onComment(d,b,this)))return this.remove(),!1;if("string"!=typeof b)return this.replaceWith(b),!1;this.value=b;return!0},writeHtml:function(a,d){d&&this.filter(d);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,d){if(!(this.value=a.onText(d,this.value,this)))return this.remove(),!1},writeHtml:function(a,d){d&&this.filter(d);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(a){var d=this.getAscendant("style");if(d&&d.getAscendant({math:1,svg:1})){var d=CKEDITOR.htmlParser.fragment.fromHtml(this.value),b=new CKEDITOR.htmlParser.basicWriter;a.applyTo(d);d.writeHtml(b);this.value=b.getHtml()}},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 d=CKEDITOR.tools.extend({table:1,ul:1,ol:1,dl:1},CKEDITOR.dtd.table,CKEDITOR.dtd.ul,CKEDITOR.dtd.ol,CKEDITOR.dtd.dl),b={ol:1,ul:1},c=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,script:1}),f={ul:"li",ol:"li",dl:"dd",table:"tbody",tbody:"tr",thead:"tr",tfoot:"tr",tr:"td"};CKEDITOR.htmlParser.fragment.fromHtml= +function(e,k,h){function p(a){var b;if(0k;k++)if(e=d[k]){e=e.exec(a,c,this);if(!1===e)return null;if(e&&e!=c)return this.onNode(a,e);if(c.parent&&!c.name)break}return c}, +onNode:function(a,c){var d=c.type;return d==CKEDITOR.NODE_ELEMENT?this.onElement(a,c):d==CKEDITOR.NODE_TEXT?new CKEDITOR.htmlParser.text(this.onText(a,c.value,c)):d==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(a,c.value,c)):null},onAttribute:function(a,c,d,e){return(d=this.attributesRules[d])?d.exec(a,e,c,this):e}}});CKEDITOR.htmlParser.filterRulesGroup=a;a.prototype={add:function(a,c,d){this.rules.splice(this.findIndex(c),0,{value:a,priority:c,options:d})},addMany:function(a, +c,d){for(var e=[this.findIndex(c),0],k=0,h=a.length;k/g,"\x26gt;")+"\x3c/textarea\x3e");return"\x3ccke:encoded\x3e"+encodeURIComponent(a)+"\x3c/cke:encoded\x3e"})}function x(a){return a.replace(O,function(a,b){return decodeURIComponent(b)})}function y(a){return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g, +function(a){return"\x3c!--"+w+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\x3e"})}function A(a){return a.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g,function(a,b){return decodeURIComponent(b)})}function F(a,b){var c=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 c&&c[b]||""})}function v(a,b,c){var d=[],e=b.config.protectedSource,f=b._.dataStore|| +(b._.dataStore={id:1}),g=new RegExp("\x3c\\!--\\{cke_temp_"+c+"(comment)?\\}(\\d*?)--\x3e","g"),e=[/|$)/gi,//gi,//gi].concat(e);a=a.replace(/\x3c!--[\s\S]*?--\x3e/g,function(a){return"\x3c!--{cke_temp_"+c+"comment}"+(d.push(a)-1)+"--\x3e"});for(var t=0;t]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g,function(a){return a.replace(/\x3c!--\{cke_protected\}([^>]*)--\x3e/g,function(a,b){f[f.id]=decodeURIComponent(b);return"{cke_protected_"+f.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,c,d,e){return"\x3c"+c+d+"\x3e"+F(A(e),b)+"\x3c/"+c+"\x3e"})}var l;CKEDITOR.htmlDataProcessor= +function(b){var c,e,f=this;this.editor=b;this.dataFilter=c=new CKEDITOR.htmlParser.filter;this.htmlFilter=e=new CKEDITOR.htmlParser.filter;this.writer=new CKEDITOR.htmlParser.basicWriter;c.addRules(u);c.addRules(K,{applyToAll:!0});c.addRules(a(b,"data"),{applyToAll:!0});e.addRules(E);e.addRules(C,{applyToAll:!0});e.addRules(a(b,"html"),{applyToAll:!0});b.on("toHtml",function(a){var c;var e=window.crypto||window.msCrypto;c=e?e.getRandomValues(new Uint32Array(1))[0]:Math.floor(9E9*Math.random()+1E9); +a=a.data;var e=a.dataValue,e=l(e),e=v(e,b,c),e=g(e,N),e=m(e,c),e=g(e,H),e=e.replace(r,"$1cke:$2"),e=e.replace(M,"\x3ccke:$1$2\x3e\x3c/cke:$1\x3e"),e=e.replace(/(]*>)(\r\n|\n)/g,"$1$2$2"),e=e.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,"$1data-cke-"+c+"-$2"),f=a.context||b.editable().getName(),t;CKEDITOR.env.ie&&9>CKEDITOR.env.version&&"pre"==f&&(f="div",e="\x3cpre\x3e"+e+"\x3c/pre\x3e",t=1);f=b.document.createElement(f);f.setHtml("a"+e);e=f.getHtml().substr(1);e=e.replace(new RegExp("data-cke-"+ +c+"-","ig"),"");t&&(e=e.replace(/^
|<\/pre>$/gi,""));e=e.replace(I,"$1$2");e=x(e);e=A(e);c=!1===a.fixForBody?!1:d(a.enterMode,b.config.autoParagraph);e=CKEDITOR.htmlParser.fragment.fromHtml(e,a.context,c);c&&(t=e,!t.children.length&&CKEDITOR.dtd[t.name][c]&&(c=new CKEDITOR.htmlParser.element(c),t.add(c)));a.dataValue=e},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(f.dataFilter,
+!0)},null,null,10);b.on("toHtml",function(a){a=a.data;var b=a.dataValue,c=new CKEDITOR.htmlParser.basicWriter;b.writeChildrenHtml(c);b=c.getHtml(!0);a.dataValue=y(b)},null,null,15);b.on("toDataFormat",function(a){var c=a.data.dataValue;a.data.enterMode!=CKEDITOR.ENTER_BR&&(c=c.replace(/^
/i,""));a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(c,a.data.context,d(a.data.enterMode,b.config.autoParagraph))},null,null,5);b.on("toDataFormat",function(a){a.data.dataValue.filterChildren(f.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 c=a.data.dataValue,d=f.writer;d.reset();c.writeChildrenHtml(d);c=d.getHtml(!0);c=A(c);c=F(c,b);a.data.dataValue=c},null,null,15)};CKEDITOR.htmlDataProcessor.prototype={toHtml:function(a,b,c,d){var e=this.editor,f,g,t,r;b&&"object"==typeof b?(f=b.context,c=b.fixForBody,d=b.dontFilter,g=b.filter,t=b.enterMode,r=b.protectedWhitespaces):f=b;f||null===f||(f= +e.editable().getName());return e.fire("toHtml",{dataValue:a,context:f,fixForBody:c,dontFilter:d,filter:g||e.filter,enterMode:t||e.enterMode,protectedWhitespaces:r}).dataValue},toDataFormat:function(a,b){var c,d,e;b&&(c=b.context,d=b.filter,e=b.enterMode);c||null===c||(c=this.editor.editable().getName());return this.editor.fire("toDataFormat",{dataValue:a,filter:d||this.editor.filter,context:c,enterMode:e||this.editor.enterMode}).dataValue},protectSource:function(a){return v(a,this.editor)},unprotectSource:function(a){return F(a, +this.editor)},unprotectRealComments:function(a){return A(a)}};var L=/(?: |\xa0)$/,w="{cke_protected}",J=CKEDITOR.dtd,G="caption colgroup col thead tfoot tbody".split(" "),q=CKEDITOR.tools.extend({},J.$blockLimit,J.$block),u={elements:{input:h,textarea:h}},K={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}}}},E={elements:{embed:function(a){var b=a.parent;if(b&&"object"==b.name){var c=b.attributes.width,b=b.attributes.height;c&&(a.attributes.width=c);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}}},C={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 c=["name","href","src"],d,e=0;ed?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&&k(a,b=new CKEDITOR.htmlParser.text);b.value=a.attributes["data-cke-title"]|| +""},input:p,textarea:p},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,""))||!1}}};CKEDITOR.env.ie&&(C.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g,function(a){return a.toLowerCase()})});var t=/<(a|area|img|input|source)\b([^>]*)>/gi,B=/([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,z=/^(href|src|name)$/i,H=/(?:])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,N=/(])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi, +O=/([^<]*)<\/cke:encoded>/gi,r=/(<\/?)((?:object|embed|param|html|body|head|title)([\s][^>]*)?>)/gi,I=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,M=/]*?)\/?>(?!\s*<\/cke:\1)/gi;l=function(){function a(b,c){for(var d=0;d/g];return function(b){for(;a(d,b);)for(var c=d,e=0;eb?1:0},b=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:b.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,this.attributes)},filter:function(a,b){var d=this,k,h;b=d.getFilterContext(b);if(!d.parent)a.onRoot(b, +d);for(;;){k=d.name;if(!(h=a.onElementName(b,k)))return this.remove(),!1;d.name=h;if(!(d=a.onElement(b,d)))return this.remove(),!1;if(d!==this)return this.replaceWith(d),!1;if(d.name==k)break;if(d.type!=CKEDITOR.NODE_ELEMENT)return this.replaceWith(d),!1;if(!d.name)return this.replaceWithChildren(),!1}k=d.attributes;var p,m;for(p in k){for(h=k[p];;)if(m=a.onAttributeName(b,p))if(m!=p)delete k[p],p=m;else break;else{delete k[p];break}m&&(!1===(h=a.onAttribute(b,d,m,h))?delete k[m]:k[m]=h)}d.isEmpty|| +this.filterChildren(a,!1,b);return!0},filterChildren:b.filterChildren,writeHtml:function(a,b){b&&this.filter(b);var e=this.name,k=[],h=this.attributes,p,m;a.openTag(e,h);for(p in h)k.push([p,h[p]]);a.sortAttributes&&k.sort(d);p=0;for(m=k.length;pCKEDITOR.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()};q.eol.detect(a,this);q.bogus.exclude(a);q.cell.shrink(a);a.fragment=a.range.cloneContents();q.tree.rebuild(a,this);q.eol.fix(a,this);return new CKEDITOR.dom.documentFragment(a.fragment.$)},extractHtmlFromRange:function(a,b){var c=u,d={range:a,doc:a.document},e=this.getHtmlFromRange(a);if(a.collapsed)return a.optimize(), +e;a.enlarge(CKEDITOR.ENLARGE_INLINE,1);c.table.detectPurge(d);d.bookmark=a.createBookmark();delete d.range;var g=this.editor.createRange();g.moveToPosition(d.bookmark.startNode,CKEDITOR.POSITION_BEFORE_START);d.targetBookmark=g.createBookmark();c.list.detectMerge(d,this);c.table.detectRanges(d,this);c.block.detectMerge(d,this);d.tableContentsRanges?(c.table.deleteRanges(d),a.moveToBookmark(d.bookmark),d.range=a):(a.moveToBookmark(d.bookmark),d.range=a,a.extractContents(c.detectExtractMerge(d)));a.moveToBookmark(d.targetBookmark); +a.optimize();c.fixUneditableRangePosition(a);c.list.merge(d,this);c.table.purge(d,this);c.block.merge(d,this);if(b){c=a.startPath();if(d=a.checkStartOfBlock()&&a.checkEndOfBlock()&&c.block&&!a.root.equals(c.block)){a:{var d=c.block.getElementsByTag("span"),g=0,f;if(d)for(;f=d.getItem(g++);)if(!F(f)){d=!0;break a}d=!1}d=!d}d&&(a.moveToPosition(c.block,CKEDITOR.POSITION_BEFORE_START),c.block.remove())}else c.autoParagraph(this.editor,a),v(a.startContainer)&&a.startContainer.appendBogus();a.startContainer.mergeSiblings(); +return e},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(L,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&&14CKEDITOR.env.version?H.$.styleSheet.cssText=z:H.setText(z)):(z=g.appendStyleText(z),z=new CKEDITOR.dom.element(z.ownerNode||z.owningElement),f.setCustomData("stylesheet", +z),z.data("cke-temp",1))}f=g.getCustomData("stylesheet_ref")||0;g.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 N={8:1,46:1};this.attachListener(a,"key",function(b){if(a.readOnly)return!0;var c=b.data.domEvent.getKey(),d,g=a.getSelection();if(0!==g.getRanges().length){if(c in +N){var f;b=g.getRanges()[0];var t=b.startPath(),z,B,H,c=8==c,m=!1;if(CKEDITOR.env.ie&&11>CKEDITOR.env.version&&g.getSelectedElement())f=g.getSelectedElement();else if(e(g)){var l=new CKEDITOR.dom.walker(b),p=b.collapsed?b.startContainer:l.next(),m=!1,C;if(b.checkStartOfBlock()){C=b.startPath().block||b.startPath().blockLimit;var q=C.getName();C=-1!==CKEDITOR.tools.array.indexOf(["dd","dt","li"],q)&&null===C.getPrevious()}else C=!1;if(C){for(;p&&!m;)m=p.$.nodeName.toLowerCase(),m=!!K[m],p=l.next(); +l=h(b.startPath());p=h(b.endPath());m=m||l!==p}else m=void 0;m||(f=k(g))}f||m?(a.fire("saveSnapshot"),m?((d=b.startContainer.getAscendant(K,!0))?(b.setStart(d,0),b.enlarge(CKEDITOR.ENLARGE_ELEMENT),f=b):f=null,f.deleteContents()):(b.moveToPosition(f,CKEDITOR.POSITION_BEFORE_START),f.remove()),b.select(),a.fire("saveSnapshot"),d=1):b.collapsed&&((z=t.block)&&(H=z[c?"getPrevious":"getNext"](A))&&H.type==CKEDITOR.NODE_ELEMENT&&H.is("table")&&b[c?"checkStartOfBlock":"checkEndOfBlock"]()?(a.fire("saveSnapshot"), +b[c?"checkEndOfBlock":"checkStartOfBlock"]()&&z.remove(),b["moveToElementEdit"+(c?"End":"Start")](H),b.select(),a.fire("saveSnapshot"),d=1):t.blockLimit&&t.blockLimit.is("td")&&(B=t.blockLimit.getAscendant("table"))&&b.checkBoundaryOfElement(B,c?CKEDITOR.START:CKEDITOR.END)&&(H=B[c?"getPrevious":"getNext"](A))?(a.fire("saveSnapshot"),b["moveToElementEdit"+(c?"End":"Start")](H),b.checkStartOfBlock()&&b.checkEndOfBlock()?H.remove():b.select(),a.fire("saveSnapshot"),d=1):(B=t.contains(["td","th","caption"]))&& +b.checkBoundaryOfElement(B,c?CKEDITOR.START:CKEDITOR.END)&&(d=1))}return!d}});a.blockless&&CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller&&this.attachListener(this,"keyup",function(b){b.data.getKeystroke()in N&&!this.getFirst(c)&&(this.appendBogus(),b=a.createRange(),b.moveToPosition(this,CKEDITOR.POSITION_AFTER_START),b.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",b);CKEDITOR.env.ie&&!CKEDITOR.env.edge||this.attachListener(this,"mousedown",function(b){var c=b.data.getTarget();c.is("img","hr","input","textarea","select")&&!c.isReadOnly()&&(a.getSelection().selectElement(c),c.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(L,""))){var c=a.createRange();c.moveToElementEditStart(b);c.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 c= +b.data.domEvent.getKey();if(c in N&&(b=a.getSelection(),0!==b.getRanges().length)){var c=8==c,d=b.getRanges()[0];b=d.startPath();if(d.collapsed)a:{var e=b.block;if(e&&d[c?"checkStartOfBlock":"checkEndOfBlock"](!0)&&d.moveToClosestEditablePosition(e,!c)&&d.collapsed){if(d.startContainer.type==CKEDITOR.NODE_ELEMENT){var g=d.startContainer.getChild(d.startOffset-(c?1:0));if(g&&g.type==CKEDITOR.NODE_ELEMENT&&g.is("hr")){a.fire("saveSnapshot");g.remove();b=!0;break a}}d=d.startPath().block;if(!d||d&&d.contains(e))b= +void 0;else{a.fire("saveSnapshot");var f;(f=(c?d:e).getBogus())&&f.remove();f=a.getSelection();g=f.createBookmarks();(c?e:d).moveChildren(c?d:e,!1);b.lastElement.mergeSiblings();y(e,d,!c);f.selectBookmarks(g);b=!0}}else b=!1}else c=d,f=b.block,d=c.endPath().block,f&&d&&!f.equals(d)?(a.fire("saveSnapshot"),(e=f.getBogus())&&e.remove(),c.enlarge(CKEDITOR.ENLARGE_INLINE),c.deleteContents(),d.getParent()&&(d.moveChildren(f,!1),b.lastElement.mergeSiblings(),y(f,d,!0)),c=a.getSelection().getRanges()[0], +c.collapse(1),c.optimize(),""===c.startContainer.getHtml()&&c.startContainer.appendBogus(),c.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 c=a.getCustomData("stylesheet_ref");--c?a.setCustomData("stylesheet_ref",c):(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 c=b.editor;c.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))});c.on("selectionChange",function(b){if(!c.readOnly){var d=c.getSelection();d&&!d.isLocked&&(d=c.checkDirty(),c.fire("lockSnapshot"),a(b),c.fire("unlockSnapshot"), +!d&&c.resetDirty())}})});CKEDITOR.on("instanceCreated",function(a){var b=a.editor;b.on("mode",function(){var a=b.editable();if(a&&a.isInline()){var c=b.title;a.changeAttr("role","textbox");a.changeAttr("aria-multiline","true");c&&a.changeAttr("aria-label",c);c&&a.changeAttr("title",c);var d=b.fire("ariaEditorHelpLabel",{}).label;if(d&&(c=this.ui.space(this.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"top":"contents"))){var e=CKEDITOR.tools.getNextId(),d=CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+ +e+'" class\x3d"cke_voice_label"\x3e'+d+"\x3c/span\x3e");c.append(d);a.changeAttr("aria-describedby",e)}}})});CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");A=CKEDITOR.dom.walker.whitespaces(!0);F=CKEDITOR.dom.walker.bookmark(!1,!0);v=CKEDITOR.dom.walker.empty();l=CKEDITOR.dom.walker.bogus();L=/(^|]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;w= +function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT}function b(c,d){var e,g,f,h,r=[],t=d.range.startContainer;e=d.range.startPath();for(var t=l[t.getName()],k=0,z=c.getChildren(),B=z.count(),H=-1,I=-1,M=0,N=e.contains(l.$list);kCKEDITOR.env.version&&d.getChildCount()&&d.getFirst().remove())}return function(d){var e=d.startContainer,g=e.getAscendant("table",1),f=!1;c(g.getElementsByTag("td"));c(g.getElementsByTag("th"));g=d.clone();g.setStart(e,0);g=a(g).lastBackward();g||(g=d.clone(),g.setEndAt(e, +CKEDITOR.POSITION_BEFORE_END),g=a(g).lastForward(),f=!0);g||(g=e);g.is("table")?(d.setStartAt(g,CKEDITOR.POSITION_BEFORE_START),d.collapse(!0),g.remove()):(g.is({tbody:1,thead:1,tfoot:1})&&(g=b(g,"tr",f)),g.is("tr")&&(g=b(g,g.getParent().is("thead")?"th":"td",f)),(e=g.getBogus())&&e.remove(),d.moveToPosition(g,f?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END))}}();G=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 c=b.startContainer,d=!1,e;e=b.clone();e.setStart(c,0);e=a(e).lastBackward();e||(e=b.clone(),e.setEndAt(c,CKEDITOR.POSITION_BEFORE_END),e=a(e).lastForward(),d=!0);e||(e=c);e.is(CKEDITOR.dtd.$list)?(b.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),b.collapse(!0),e.remove()):((c=e.getBogus())&&c.remove(),b.moveToPosition(e,d?CKEDITOR.POSITION_AFTER_START: +CKEDITOR.POSITION_BEFORE_END),b.select())}}();q={eol:{detect:function(a,b){var c=a.range,d=c.clone(),e=c.clone(),g=new CKEDITOR.dom.elementPath(c.startContainer,b),f=new CKEDITOR.dom.elementPath(c.endContainer,b);d.collapse(1);e.collapse();g.block&&d.checkBoundaryOfElement(g.block,CKEDITOR.END)&&(c.setStartAfter(g.block),a.prependEolBr=1);f.block&&e.checkBoundaryOfElement(f.block,CKEDITOR.START)&&(c.setEndBefore(f.block),a.appendEolBr=1)},fix:function(a,b){var c=b.getDocument(),d;a.appendEolBr&&(d= +this.createEolBr(c),a.fragment.append(d));!a.prependEolBr||d&&!d.getPrevious()||a.fragment.append(this.createEolBr(c),1)},createEolBr:function(a){return a.createElement("br",{attributes:{"data-cke-eol":1}})}},bogus:{exclude:function(a){var b=a.range.getBoundaryNodes(),c=b.startNode,b=b.endNode;!b||!l(b)||c&&c.equals(b)||a.range.setEndBefore(b)}},tree:{rebuild:function(a,b){var c=a.range,d=c.getCommonAncestor(),e=new CKEDITOR.dom.elementPath(d,b),g=new CKEDITOR.dom.elementPath(c.startContainer,b), +c=new CKEDITOR.dom.elementPath(c.endContainer,b),f;d.type==CKEDITOR.NODE_TEXT&&(d=d.getParent());if(e.blockLimit.is({tr:1,table:1})){var h=e.contains("table").getParent();f=function(a){return!a.equals(h)}}else if(e.block&&e.block.is(CKEDITOR.dtd.$listItem)&&(g=g.contains(CKEDITOR.dtd.$list),c=c.contains(CKEDITOR.dtd.$list),!g.equals(c))){var r=e.contains(CKEDITOR.dtd.$list).getParent();f=function(a){return!a.equals(r)}}f||(f=function(a){return!a.equals(e.block)&&!a.equals(e.blockLimit)});this.rebuildFragment(a, +b,d,f)},rebuildFragment:function(a,b,c,d){for(var e;c&&!c.equals(b)&&d(c);)e=c.clone(0,1),a.fragment.appendTo(e),a.fragment=e,c=c.getParent()}},cell:{shrink:function(a){a=a.range;var b=a.startContainer,c=a.endContainer,d=a.startOffset,e=a.endOffset;b.type==CKEDITOR.NODE_ELEMENT&&b.equals(c)&&b.is("tr")&&++d==e&&a.shrink(CKEDITOR.SHRINK_TEXT)}}};u=function(){function a(b,c){var d=b.getParent();if(d.is(CKEDITOR.dtd.$inline))b[c?"insertBefore":"insertAfter"](d)}function b(c,d,e){a(d);a(e,1);for(var g;g= +e.getNext();)g.insertAfter(d),d=g;v(c)&&c.remove()}function c(a,b){var d=new CKEDITOR.dom.range(a);d.setStartAfter(b.startNode);d.setEndBefore(b.endNode);return d}return{list:{detectMerge:function(a,b){var d=c(b,a.bookmark),e=d.startPath(),g=d.endPath(),f=e.contains(CKEDITOR.dtd.$list),h=g.contains(CKEDITOR.dtd.$list);a.mergeList=f&&h&&f.getParent().equals(h.getParent())&&!f.equals(h);a.mergeListItems=e.block&&g.block&&e.block.is(CKEDITOR.dtd.$listItem)&&g.block.is(CKEDITOR.dtd.$listItem);if(a.mergeList|| +a.mergeListItems)d=d.clone(),d.setStartBefore(a.bookmark.startNode),d.setEndAfter(a.bookmark.endNode),a.mergeListBookmark=d.createBookmark()},merge:function(a,c){if(a.mergeListBookmark){var d=a.mergeListBookmark.startNode,e=a.mergeListBookmark.endNode,g=new CKEDITOR.dom.elementPath(d,c),f=new CKEDITOR.dom.elementPath(e,c);if(a.mergeList){var h=g.contains(CKEDITOR.dtd.$list),k=f.contains(CKEDITOR.dtd.$list);h.equals(k)||(k.moveChildren(h),k.remove())}a.mergeListItems&&(g=g.contains(CKEDITOR.dtd.$listItem), +f=f.contains(CKEDITOR.dtd.$listItem),g.equals(f)||b(f,d,e));d.remove();e.remove()}}},block:{detectMerge:function(a,b){if(!a.tableContentsRanges&&!a.mergeListBookmark){var c=new CKEDITOR.dom.range(b);c.setStartBefore(a.bookmark.startNode);c.setEndAfter(a.bookmark.endNode);a.mergeBlockBookmark=c.createBookmark()}},merge:function(a,c){if(a.mergeBlockBookmark&&!a.purgeTableBookmark){var d=a.mergeBlockBookmark.startNode,e=a.mergeBlockBookmark.endNode,g=new CKEDITOR.dom.elementPath(d,c),f=new CKEDITOR.dom.elementPath(e, +c),g=g.block,f=f.block;g&&f&&!g.equals(f)&&b(f,d,e);d.remove();e.remove()}}},table:function(){function a(c){var e=[],g,f=new CKEDITOR.dom.walker(c),h=c.startPath().contains(d),k=c.endPath().contains(d),t={};f.guard=function(a,f){if(a.type==CKEDITOR.NODE_ELEMENT){var B="visited_"+(f?"out":"in");if(a.getCustomData(B))return;CKEDITOR.dom.element.setMarker(t,a,B,1)}if(f&&h&&a.equals(h))g=c.clone(),g.setEndAt(h,CKEDITOR.POSITION_BEFORE_END),e.push(g);else if(!f&&k&&a.equals(k))g=c.clone(),g.setStartAt(k, +CKEDITOR.POSITION_AFTER_START),e.push(g);else{if(B=!f)B=a.type==CKEDITOR.NODE_ELEMENT&&a.is(d)&&(!h||b(a,h))&&(!k||b(a,k));if(!B&&(B=f))if(a.is(d))var B=h&&h.getAscendant("table",!0),I=k&&k.getAscendant("table",!0),m=a.getAscendant("table",!0),B=B&&B.contains(m)||I&&I.contains(m);else B=void 0;B&&(g=c.clone(),g.selectNodeContents(a),e.push(g))}};f.lastForward();CKEDITOR.dom.element.clearAllMarkers(t);return e}function b(a,c){var d=CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED,e=a.getPosition(c); +return e===CKEDITOR.POSITION_IDENTICAL?!1:0===(e&d)}var d={td:1,th:1,caption:1};return{detectPurge:function(a){var b=a.range,c=b.clone();c.enlarge(CKEDITOR.ENLARGE_ELEMENT);var c=new CKEDITOR.dom.walker(c),e=0;c.evaluator=function(a){a.type==CKEDITOR.NODE_ELEMENT&&a.is(d)&&++e};c.checkForward();if(1g&&e&&e.intersectsNode(c.$)){var f=[{node:d.anchorNode,offset:d.anchorOffset}, +{node:d.focusNode,offset:d.focusOffset}];d.anchorNode==c.$&&d.anchorOffset>g&&(f[0].offset-=g);d.focusNode==c.$&&d.focusOffset>g&&(f[1].offset-=g)}}c.setText(y(c.getText(),1));f&&(c=a.getDocument().$,d=c.getSelection(),c=c.createRange(),c.setStart(f[0].node,f[0].offset),c.collapse(!0),d.removeAllRanges(),d.addRange(c),d.extend(f[1].node,f[1].offset))}}function y(a,b){return b?a.replace(J,function(a,b){return b?" ":""}):a.replace(w,"")}function A(a,b){var c=b&&CKEDITOR.tools.htmlEncode(b)||"\x26nbsp;", +c=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'+c+"\x3c/div\x3e",a.document);a.fire("lockSnapshot");a.editable().append(c);var d=a.getSelection(1),e=a.createRange(),g=d.root.on("selectionchange",function(a){a.cancel()},null,null,0);e.setStartAt(c,CKEDITOR.POSITION_AFTER_START);e.setEndAt(c,CKEDITOR.POSITION_BEFORE_END); +d.selectRanges([e]);g.removeListener();a.fire("unlockSnapshot");a._.hiddenSelectionContainer=c}function F(b){var c={37:1,39:1,8:1,46:1};return function(d){var e=d.data.getKeystroke();if(c[e]){var g=b.getSelection(),f=g.getRanges()[0];g.isCollapsed()&&(f=f[38>e?"getPreviousEditableNode":"getNextEditableNode"]())&&f.type==CKEDITOR.NODE_ELEMENT&&"false"==f.getAttribute("contenteditable")&&(g=g.getStartElement(),!g.isBlockBoundary()||""!==(void 0===g.$.textContent?g.$.innerText:g.$.textContent)||a(g.getFirst())|| +8!==e&&46!==e||(g.remove(),b.fire("saveSnapshot")),b.getSelection().fake(f),d.data.preventDefault(),d.cancel())}}}function v(a){for(var b=0;b=d.getLength()?h.setStartAfter(d):h.setStartBefore(d));e&&e.type==CKEDITOR.NODE_TEXT&&(f?h.setEndAfter(e):h.setEndBefore(e));d=new CKEDITOR.dom.walker(h);d.evaluator=function(d){if(d.type==CKEDITOR.NODE_ELEMENT&&d.isReadOnly()){var e=c.clone();c.setEndBefore(d);c.collapsed&&a.splice(b--,1);d.getPosition(h.endContainer)&CKEDITOR.POSITION_CONTAINS||(e.setStartAfter(d),e.collapsed||a.splice(b+1,0,e));return!0}return!1};d.next()}}return a}var l= +"function"!=typeof window.getSelection,L=1,w=CKEDITOR.tools.repeat("​",7),J=new RegExp(w+"( )?","g"),G,q,u,K=CKEDITOR.dom.walker.invisible(1),E=function(){function a(b){return function(a){var c=a.editor.createRange();c.moveToClosestEditablePosition(a.selected,b)&&a.editor.getSelection().selectRanges([c]);return!1}}function b(a){return function(b){var c=b.editor,d=c.createRange(),e;if(!c.readOnly)return(e=d.moveToClosestEditablePosition(b.selected,a))||(e=d.moveToClosestEditablePosition(b.selected, +!a)),e&&c.getSelection().selectRanges([d]),c.fire("saveSnapshot"),b.selected.remove(),e||(d.moveToElementEditablePosition(c.editable()),c.getSelection().selectRanges([d])),c.fire("saveSnapshot"),!1}}var c=a(),d=a(1);return{37:c,38:c,39:d,40:d,8:b(),46:b(1)}}();CKEDITOR.on("instanceCreated",function(a){function b(){var a=c.getSelection();a&&a.removeAllRanges()}var c=a.editor;c.on("contentDom",function(){function a(){q=new CKEDITOR.dom.selection(c.getSelection());q.lock()}function b(){h.removeListener("mouseup", +b);m.removeListener("mouseup",b);var a=CKEDITOR.document.$.selection,c=a.createRange();"None"!=a.type&&c.parentElement()&&c.parentElement().ownerDocument==f.$&&c.select()}function d(a){var b,c;b=(b=this.document.getActive())?"input"===b.getName()||"textarea"===b.getName():!1;b||(b=this.getSelection(1),(c=g(b))&&!c.equals(n)&&(b.selectElement(c),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 f=c.document,h=CKEDITOR.document,n=c.editable(),t=f.getBody(),m=f.getDocumentElement(),B=n.isInline(),p,q;CKEDITOR.env.gecko&&n.attachListener(n,"focus",function(a){a.removeListener();0!==p&&(a=c.getSelection().getNative())&&a.isCollapsed&&a.anchorNode==n.$&&(a=c.createRange(),a.moveToElementEditStart(n),a.select())},null,null,-2);n.attachListener(n,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){if(p&&(CKEDITOR.env.webkit|| +CKEDITOR.env.gecko)){p=c._.previousActive&&c._.previousActive.equals(f.getActive());var a=null!=c._.previousScrollTop&&c._.previousScrollTop!=n.$.scrollTop;CKEDITOR.env.webkit&&p&&a&&(n.$.scrollTop=c._.previousScrollTop)}c.unlockSelection(p);p=0},null,null,-1);n.attachListener(n,"mousedown",function(){p=0});if(CKEDITOR.env.ie||CKEDITOR.env.gecko||B)l?n.attachListener(n,"beforedeactivate",a,null,null,-1):n.attachListener(c,"selectionCheck",a,null,null,-1),n.attachListener(n,CKEDITOR.env.webkit||CKEDITOR.env.gecko? +"focusout":"blur",function(){var a=q&&(q.isFake||2>q.getRanges().length);CKEDITOR.env.gecko&&!B&&a||(c.lockSelection(q),p=1)},null,null,-1),n.attachListener(n,"mousedown",function(){p=0});if(CKEDITOR.env.ie&&!B){var v;n.attachListener(n,"mousedown",function(a){2==a.data.$.button&&((a=c.document.getSelection())&&a.getType()!=CKEDITOR.SELECTION_NONE||(v=c.window.getScrollPosition()))});n.attachListener(n,"mouseup",function(a){2==a.data.$.button&&v&&(c.document.$.documentElement.scrollLeft=v.x,c.document.$.documentElement.scrollTop= +v.y);v=null});if("BackCompat"!=f.$.compatMode){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat){var u,w;m.on("mousedown",function(a){function b(a){a=a.data.$;if(u){var c=t.$.createTextRange();try{c.moveToPoint(a.clientX,a.clientY)}catch(d){}u.setEndPoint(0>w.compareEndPoints("StartToStart",c)?"EndToEnd":"StartToStart",c);u.select()}}function c(){m.removeListener("mousemove",b);h.removeListener("mouseup",c);m.removeListener("mouseup",c);u.select()}a=a.data;if(a.getTarget().is("html")&&a.$.yCKEDITOR.env.version)m.on("mousedown",function(a){a.data.getTarget().is("html")&&(h.on("mouseup",b),m.on("mouseup",b))})}}n.attachListener(n,"selectionchange",e,c);n.attachListener(n,"keyup",k,c);n.attachListener(n,"touchstart",k,c);n.attachListener(n,"touchend",k,c);CKEDITOR.env.ie&&n.attachListener(n, +"keydown",d,c);n.attachListener(n,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){c.forceNextSelectionCheck();c.selectionChange(1)});if(B&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var y;n.attachListener(n,"mousedown",function(){y=1});n.attachListener(f.getDocumentElement(),"mouseup",function(){y&&k.call(c);y=0})}else n.attachListener(CKEDITOR.env.ie?n:f.getDocumentElement(),"mouseup",k,c);CKEDITOR.env.webkit&&n.attachListener(f,"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:n.hasFocus&& +x(n)}},null,null,-1);n.attachListener(n,"keydown",F(c),null,null,-1)});c.on("setData",function(){c.unlockSelection();CKEDITOR.env.webkit&&b()});c.on("contentDomUnload",function(){c.unlockSelection()});if(CKEDITOR.env.ie9Compat)c.on("beforeDestroy",b,null,null,9);c.on("dataReady",function(){delete c._.fakeSelection;delete c._.hiddenSelectionContainer;c.selectionChange(1)});c.on("loadSnapshot",function(){var a=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),b=c.editable().getLast(a);b&&b.hasAttribute("data-cke-hidden-sel")&& +(b.remove(),CKEDITOR.env.gecko&&(a=c.editable().getFirst(a))&&a.is("br")&&a.getAttribute("_moz_editor_bogus_node")&&a.remove())},null,null,100);c.on("key",function(a){if("wysiwyg"==c.mode){var b=c.getSelection();if(b.isFake){var d=E[a.data.keyCode];if(d)return d({editor:c,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(),c=a.getCustomData("cke-fillingChar"); +c&&(c.getCustomData("ready")?(x(a),a.editor.fire("selectionCheck")):c.setCustomData("ready",1))},null,null,-1);b.on("beforeSetMode",function(){x(b.editable())},null,null,-1);b.on("getSnapshot",function(a){a.data&&(a.data=y(a.data))},b,null,20);b.on("toDataFormat",function(a){a.data.dataValue=y(a.data.dataValue)},null,null,0)});CKEDITOR.editor.prototype.selectionChange=function(a){(a?e:k).call(this)};CKEDITOR.editor.prototype.getSelection=function(a){return!this._.savedSelection&&!this._.fakeSelection|| +a?(a=this.editable())&&"wysiwyg"==this.mode&&"recreating"!==this.status?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 c=a instanceof CKEDITOR.dom.element;this.rev=b?b.rev:L++;this.document=a instanceof CKEDITOR.dom.document?a:a.getDocument();this.root=c?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 d,e;if(a)if(a.getRangeAt)d=(e=a.rangeCount&&a.getRangeAt(0))&& +new CKEDITOR.dom.node(e.commonAncestorContainer);else{try{e=a.createRange()}catch(g){}d=e&&CKEDITOR.dom.element.get(e.item&&e.item(0)||e.parentElement())}if(!d||d.type!=CKEDITOR.NODE_ELEMENT&&d.type!=CKEDITOR.NODE_TEXT||!this.root.equals(d)&&!this.root.contains(d))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 C={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:y,_createFillingCharSequenceNode:g,FILLING_CHAR_SEQUENCE:w});CKEDITOR.dom.selection.prototype={getNative:function(){return void 0!==this._.cache.nativeSel?this._.cache.nativeSel:this._.cache.nativeSel=l?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:l?function(){var a=this._.cache;if(a.type)return a.type; +var b=CKEDITOR.SELECTION_NONE;try{var c=this.getNative(),d=c.type;"Text"==d&&(b=CKEDITOR.SELECTION_TEXT);"Control"==d&&(b=CKEDITOR.SELECTION_ELEMENT);c.createRange().parentElement()&&(b=CKEDITOR.SELECTION_TEXT)}catch(e){}return a.type=b}:function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_TEXT,c=this.getNative();if(!c||!c.rangeCount)b=CKEDITOR.SELECTION_NONE;else if(1==c.rangeCount){var c=c.getRangeAt(0),d=c.startContainer;d==c.endContainer&&1==d.nodeType&&1==c.endOffset- +c.startOffset&&C[d.childNodes[c.startOffset].nodeName.toLowerCase()]&&(b=CKEDITOR.SELECTION_ELEMENT)}return a.type=b},getRanges:function(){var a=l?function(){function a(b){return(new CKEDITOR.dom.node(b)).getIndex()}var b=function(b,c){b=b.duplicate();b.collapse(c);var d=b.parentElement();if(!d.hasChildNodes())return{container:d,offset:0};for(var e=d.children,g,f,h=b.duplicate(),k=0,m=e.length-1,t=-1,l,p;k<=m;)if(t=Math.floor((k+m)/2),g=e[t],h.moveToElementText(g),l=h.compareEndPoints("StartToStart", +b),0l)k=t+1;else return{container:d,offset:a(g)};if(-1==t||t==e.length-1&&0>l){h.moveToElementText(d);h.setEndPoint("StartToStart",b);h=h.text.replace(/(\r\n|\r)/g,"\n").length;e=d.childNodes;if(!h)return g=e[e.length-1],g.nodeType!=CKEDITOR.NODE_TEXT?{container:d,offset:e.length}:{container:g,offset:g.nodeValue.length};for(d=e.length;0c.length?this.selectElement(b):this.selectRanges(c))}},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 c=a.checkDirty();a.fire("lockSnapshot");b.remove();a.fire("unlockSnapshot");!c&&a.resetDirty()}delete a._.hiddenSelectionContainer}else CKEDITOR.warn("selection-fake-reset");this.rev=L++},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,c=b&&b._.hiddenSelectionContainer;this.reset(); +if(c)for(var c=this.root,e,h=0;h]*>)[ \t\r\n]*/gi,"$1");f=f.replace(/([ \t\n\r]+| )/g," ");f=f.replace(/]*>/gi,"\n");if(CKEDITOR.env.ie){var h=a.getDocument().createElement("div");h.append(e);e.$.outerHTML="\x3cpre\x3e"+f+"\x3c/pre\x3e";e.copyAttributes(h.getFirst());e=h.getFirst().remove()}else e.setHtml(f);b=e}else f?b=y(c?[a.getHtml()]:g(a),b):a.moveChildren(b);b.replace(a);if(d){var c=b,k;(k=c.getPrevious(H))&& +k.type==CKEDITOR.NODE_ELEMENT&&k.is("pre")&&(d=x(k.getHtml(),/\n$/,"")+"\n\n"+x(c.getHtml(),/^\n/,""),CKEDITOR.env.ie?c.$.outerHTML="\x3cpre\x3e"+d+"\x3c/pre\x3e":c.setHtml(d),k.remove())}else c&&l(b)}function g(a){var b=[];x(a.getOuterHtml(),/(\S\s*)\n(?:\s|(]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(a,b,c){return b+"\x3c/pre\x3e"+c+"\x3cpre\x3e"}).replace(/([\s\S]*?)<\/pre>/gi,function(a,c){b.push(c)});return b}function x(a,b,c){var d="",e="";a=a.replace(/(^]+data-cke-bookmark.*?\/span>)|(]+data-cke-bookmark.*?\/span>$)/gi, +function(a,b,c){b&&(d=b);c&&(e=c);return""});return d+a.replace(b,c)+e}function y(a,b){var c;1=b&&a<=c}function f(a){a=a.toString(16);return 1==a.length?"0"+a:a}CKEDITOR.tools.color= +CKEDITOR.tools.createClass({$:function(a,b){this._.initialColorCode=a;this._.defaultValue=b;this._.parseInput(a)},proto:{getHex:function(){if(!this._.isValidColor)return this._.defaultValue;var a=this._.blendAlphaColor(this._.red,this._.green,this._.blue,this._.alpha);return this._.formatHexString(a[0],a[1],a[2])},getHexWithAlpha:function(){if(!this._.isValidColor)return this._.defaultValue;var a=Math.round(this._.alpha*CKEDITOR.tools.color.MAX_RGB_CHANNEL_VALUE);return this._.formatHexString(this._.red, +this._.green,this._.blue,a)},getRgb:function(){if(!this._.isValidColor)return this._.defaultValue;var a=this._.blendAlphaColor(this._.red,this._.green,this._.blue,this._.alpha);return this._.formatRgbString("rgb",a[0],a[1],a[2])},getRgba:function(){return this._.isValidColor?this._.formatRgbString("rgba",this._.red,this._.green,this._.blue,this._.alpha):this._.defaultValue},getHsl:function(){var a=0===this._.alpha||1===this._.alpha;if(!this._.isValidColor)return this._.defaultValue;this._.type=== +CKEDITOR.tools.color.TYPE_HSL&&a?a=[this._.hue,this._.saturation,this._.lightness]:(a=this._.blendAlphaColor(this._.red,this._.green,this._.blue,this._.alpha),a=this._.rgbToHsl(a[0],a[1],a[2]));return this._.formatHslString("hsl",a[0],a[1],a[2])},getHsla:function(){var a;if(!this._.isValidColor)return this._.defaultValue;a=this._.type===CKEDITOR.tools.color.TYPE_HSL?[this._.hue,this._.saturation,this._.lightness]:this._.rgbToHsl(this._.red,this._.green,this._.blue);return this._.formatHslString("hsla", +a[0],a[1],a[2],this._.alpha)},getInitialValue:function(){return this._.initialColorCode}},_:{initialColorCode:"",isValidColor:!0,type:0,hue:0,saturation:0,lightness:0,red:0,green:0,blue:0,alpha:1,blendAlphaColor:function(a,b,c,d){return CKEDITOR.tools.array.map([a,b,c],function(a){return Math.round(CKEDITOR.tools.color.MAX_RGB_CHANNEL_VALUE-d*(CKEDITOR.tools.color.MAX_RGB_CHANNEL_VALUE-a))})},formatHexString:function(a,b,c,d){a="#"+f(a)+f(b)+f(c);void 0!==d&&(a+=f(d));return a.toUpperCase()},formatRgbString:function(a, +b,c,d,f){b=[b,c,d];void 0!==f&&b.push(f);return a+"("+b.join(",")+")"},formatHslString:function(a,b,c,d,f){return a+"("+b+","+c+"%,"+d+"%"+(void 0!==f?","+f:"")+")"},parseInput:function(a){if("string"!==typeof a)this._.isValidColor=!1;else{a=CKEDITOR.tools.trim(a);var b=this._.matchStringToNamedColor(a);b&&(a=b);var b=this._.extractColorChannelsFromHex(a),c=this._.extractColorChannelsFromRgba(a);a=this._.extractColorChannelsFromHsla(a);(a=b||c||a)?(this._.type=a.type,this._.red=a.red,this._.green= +a.green,this._.blue=a.blue,this._.alpha=a.alpha,a.type===CKEDITOR.tools.color.TYPE_HSL&&(this._.hue=a.hue,this._.saturation=a.saturation,this._.lightness=a.lightness)):this._.isValidColor=!1}},matchStringToNamedColor:function(a){return CKEDITOR.tools.color.namedColors[a.toLowerCase()]||null},extractColorChannelsFromHex:function(a){-1===a.indexOf("#")&&(a="#"+a);a.match(CKEDITOR.tools.color.hex3CharsRegExp)&&(a=this._.hex3ToHex6(a));a.match(CKEDITOR.tools.color.hex4CharsRegExp)&&(a=this._.hex4ToHex8(a)); +if(!a.match(CKEDITOR.tools.color.hex6CharsRegExp)&&!a.match(CKEDITOR.tools.color.hex8CharsRegExp))return null;a=a.split("");var b=1;a[7]&&a[8]&&(b=parseInt(a[7]+a[8],16),b/=CKEDITOR.tools.color.MAX_RGB_CHANNEL_VALUE,b=Number(b.toFixed(1)));return{type:CKEDITOR.tools.color.TYPE_RGB,red:parseInt(a[1]+a[2],16),green:parseInt(a[3]+a[4],16),blue:parseInt(a[5]+a[6],16),alpha:b}},extractColorChannelsFromRgba:function(b){var c=this._.extractColorChannelsByPattern(b,CKEDITOR.tools.color.rgbRegExp);if(!c|| +3>c.length||4c.length||4=c?(e=f.createText(""),e.insertAfter(this)):(a=f.createText(""),a.insertAfter(e),a.remove()));return e},substring:function(a,d){return"number"!=typeof d?this.$.nodeValue.substr(a):this.$.nodeValue.substring(a,d)}}); +(function(){function a(a,c,d){var e=a.serializable,k=c[d?"endContainer":"startContainer"],h=d?"endOffset":"startOffset",p=e?c.document.getById(a.startNode):a.startNode;a=e?c.document.getById(a.endNode):a.endNode;k.equals(p.getPrevious())?(c.startOffset=c.startOffset-k.getLength()-a.getPrevious().getLength(),k=a.getNext()):k.equals(a.getPrevious())&&(c.startOffset-=k.getLength(),k=a.getNext());k.equals(p.getParent())&&c[h]++;k.equals(a.getParent())&&c[h]++;c[d?"endContainer":"startContainer"]=k;return c} +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,d)};var d={createIterator:function(){var a=this,c=CKEDITOR.dom.walker.bookmark(),d=[],e;return{getNextRange:function(k){e=void 0===e?0:e+1;var h=a[e];if(h&&1b?-1:1}),e=0,f;eCKEDITOR.env.version? +a[h].$.styleSheet.cssText+=f:a[h].$.innerHTML+=f}}var e={};CKEDITOR.skin={path:a,loadPart:function(c,d){CKEDITOR.skin.name!=CKEDITOR.skinName.split(",")[0]?CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(a()+"skin.js"),function(){b(c,d)}):b(c,d)},getPath:function(a){return CKEDITOR.getUrl(d(a))},icons:{},addIcon:function(a,b,c,d){a=a.toLowerCase();this.icons[a]||(this.icons[a]={path:b,offset:c||0,bgsize:d||"16px"})},getIconStyle:function(a,b,c,d,e){var f;a&&(a=a.toLowerCase(),b&&(f=this.icons[a+"-rtl"]), +f||(f=this.icons[a]));a=c||f&&f.path||"";d=d||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 "+d+"px;background-size:"+e+";"}};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{getUiColor:function(){return this.uiColor},setUiColor:function(a){var b=c(CKEDITOR.document);return(this.setUiColor=function(a){this.uiColor=a;var c=CKEDITOR.skin.chameleon,d="",e="";"function"==typeof c&&(d=c(this,"editor"),e= +c(this,"panel"));a=[[p,a]];f([b],d,a);f(h,e,a)}).call(this,a)}});var k="cke_ui_color",h=[],p=/\$color/g;CKEDITOR.on("instanceLoaded",function(a){if(!CKEDITOR.env.ie||!CKEDITOR.env.quirks){var b=a.editor;a=function(a){a=(a.data[0]||a.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();if(!a.getById("cke_ui_color")){var d=c(a);h.push(d);b.on("destroy",function(){h=CKEDITOR.tools.array.filter(h,function(a){return d!==a})});(a=b.getUiColor())&&f([d],CKEDITOR.skin.chameleon(b,"panel"), +[[p,a]])}};b.on("panelShow",a);b.on("menuShow",a);b.config.uiColor&&b.setUiColor(b.config.uiColor)}})})(); +(function(){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 d=a.getComputedStyle("border-top-color"),b=a.getComputedStyle("border-right-color");CKEDITOR.env.hc=!(!d||d!=b)}catch(c){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,d=0;de;e++){var f=e,c;c=parseInt(a[e],16);c=("0"+(0>d?0|c*(1+d):0|c+(255-c)*d).toString(16)).slice(-2);a[f]=c}return"#"+a.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(g,d){var a=b(g.uiColor,.4),a={id:"."+g.id,defaultBorder:b(a,-.2),toolbarElementsBorder:b(a,-.25),defaultBackground:a,lightBackground:b(a,.8),darkBackground:b(a,-.15),ckeButtonOn:b(a,.4),ckeResizer:b(a,-.4),ckeColorauto:b(a,.8),dialogBody:b(a,.7),dialogTab:b(a,.65),dialogTabSelected:"#FFF",dialogTabSelectedBorder:"#FFF",elementsPathColor:b(a,-.6),menubuttonHover:b(a,.1),menubuttonIcon:b(a,.5),menubuttonIconHover:b(a,.3)};return f[d].output(a).replace(/\[/g,"{").replace(/\]/g,"}")}}();CKEDITOR.plugins.add("dialogui",{onLoad:function(){var k=function(b){this._||(this._={});this._["default"]=this._.initValue=b["default"]||"";this._.required=b.required||!1;for(var a=[this._],d=1;darguments.length)){var c=k.call(this,a);c.labelId=CKEDITOR.tools.getNextId()+ +"_label";this._.children=[];var f={role:a.role||"presentation"};a.includeLabel&&(f["aria-labelledby"]=c.labelId);CKEDITOR.ui.dialog.uiElement.call(this,b,a,d,"div",null,f,function(){var d=[],g=a.required?" cke_required":"";"horizontal"!=a.labelLayout?d.push('\x3clabel class\x3d"cke_dialog_ui_labeled_label'+g+'" ',' id\x3d"'+c.labelId+'"',c.inputId?' for\x3d"'+c.inputId+'"':"",(a.labelStyle?' style\x3d"'+a.labelStyle+'"':"")+"\x3e",a.required?a.label+'\x3cspan class\x3d"cke_dialog_ui_labeled_required" aria-hidden\x3d"true"\x3e*\x3c/span\x3e': +a.label,"\x3c/label\x3e",'\x3cdiv class\x3d"cke_dialog_ui_labeled_content"',a.controlStyle?' style\x3d"'+a.controlStyle+'"':"",' role\x3d"presentation"\x3e',e.call(this,b,a),"\x3c/div\x3e"):(g={type:"hbox",widths:a.widths,padding:0,children:[{type:"html",html:'\x3clabel class\x3d"cke_dialog_ui_labeled_label'+g+'" id\x3d"'+c.labelId+'" for\x3d"'+c.inputId+'"'+(a.labelStyle?' style\x3d"'+a.labelStyle+'"':"")+"\x3e"+CKEDITOR.tools.htmlEncode(a.label)+"\x3c/label\x3e"},{type:"html",html:'\x3cspan class\x3d"cke_dialog_ui_labeled_content"'+ +(a.controlStyle?' style\x3d"'+a.controlStyle+'"':"")+"\x3e"+e.call(this,b,a)+"\x3c/span\x3e"}]},CKEDITOR.dialog._.uiElementBuilders.hbox.build(b,g,d));return d.join("")})}},textInput:function(b,a,d){if(!(3>arguments.length)){k.call(this,a);var e=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",c={"class":"cke_dialog_ui_input_"+a.type,id:e,type:a.type};a.validate&&(this.validate=a.validate);a.maxLength&&(c.maxlength=a.maxLength);a.size&&(c.size=a.size);a.inputStyle&&(c.style=a.inputStyle);var f= +this,h=!1;b.on("load",function(){f.getInputElement().on("keydown",function(a){13==a.data.getKeystroke()&&(h=!0)});f.getInputElement().on("keyup",function(a){13==a.data.getKeystroke()&&h&&(b.getButton("ok")&&setTimeout(function(){b.getButton("ok").click()},0),h=!1);f.bidi&&w.call(f,a)},null,null,1E3)});CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){var b=['\x3cdiv class\x3d"cke_dialog_ui_input_',a.type,'" role\x3d"presentation"'];a.width&&b.push('style\x3d"width:'+a.width+'" ');b.push("\x3e\x3cinput "); +c["aria-labelledby"]=this._.labelId;this._.required&&(c["aria-required"]=this._.required);for(var e in c)b.push(e+'\x3d"'+c[e]+'" ');b.push(" /\x3e\x3c/div\x3e");return b.join("")})}},textarea:function(b,a,d){if(!(3>arguments.length)){k.call(this,a);var e=this,c=this._.inputId=CKEDITOR.tools.getNextId()+"_textarea",f={};a.validate&&(this.validate=a.validate);f.rows=a.rows||5;f.cols=a.cols||20;f["class"]="cke_dialog_ui_input_textarea "+(a["class"]||"");"undefined"!=typeof a.inputStyle&&(f.style=a.inputStyle); +a.dir&&(f.dir=a.dir);if(e.bidi)b.on("load",function(){e.getInputElement().on("keyup",w)},e);CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){f["aria-labelledby"]=this._.labelId;this._.required&&(f["aria-required"]=this._.required);var a=['\x3cdiv class\x3d"cke_dialog_ui_input_textarea" role\x3d"presentation"\x3e\x3ctextarea id\x3d"',c,'" '],b;for(b in f)a.push(b+'\x3d"'+CKEDITOR.tools.htmlEncode(f[b])+'" ');a.push("\x3e",CKEDITOR.tools.htmlEncode(e._["default"]),"\x3c/textarea\x3e\x3c/div\x3e"); +return a.join("")})}},checkbox:function(b,a,d){if(!(3>arguments.length)){var e=k.call(this,a,{"default":!!a["default"]});a.validate&&(this.validate=a.validate);CKEDITOR.ui.dialog.uiElement.call(this,b,a,d,"span",null,null,function(){var c=CKEDITOR.tools.extend({},a,{id:a.id?a.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},!0),d=[],h=CKEDITOR.tools.getNextId()+"_label",g={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":h};t(c);a["default"]&&(g.checked="checked");"undefined"!= +typeof c.inputStyle&&(c.style=c.inputStyle);e.checkbox=new CKEDITOR.ui.dialog.uiElement(b,c,d,"input",null,g);d.push(' \x3clabel id\x3d"',h,'" for\x3d"',g.id,'"'+(a.labelStyle?' style\x3d"'+a.labelStyle+'"':"")+"\x3e",CKEDITOR.tools.htmlEncode(a.label),"\x3c/label\x3e");return d.join("")})}},radio:function(b,a,d){if(!(3>arguments.length)){k.call(this,a);this._["default"]||(this._["default"]=this._.initValue=a.items[0][1]);a.validate&&(this.validate=a.validate);var e=[],c=this;a.role="radiogroup"; +a.includeLabel=!0;CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){for(var d=[],h=[],g=(a.id?a.id:CKEDITOR.tools.getNextId())+"_radio",n=0;narguments.length)){var e=k.call(this,a);a.validate&&(this.validate=a.validate);e.inputId=CKEDITOR.tools.getNextId()+"_select";CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){var c=CKEDITOR.tools.extend({},a,{id:a.id?a.id+"_select":CKEDITOR.tools.getNextId()+"_select"},!0),d=[],h=[],g={id:e.inputId, +"class":"cke_dialog_ui_input_select","aria-labelledby":this._.labelId};d.push('\x3cdiv class\x3d"cke_dialog_ui_input_',a.type,'" role\x3d"presentation"');a.width&&d.push('style\x3d"width:'+a.width+'" ');d.push("\x3e");void 0!==a.size&&(g.size=a.size);void 0!==a.multiple&&(g.multiple=a.multiple);t(c);for(var n=0,l;narguments.length)){void 0===a["default"]&&(a["default"]="");var e=CKEDITOR.tools.extend(k.call(this,a),{definition:a,buttons:[]});a.validate&&(this.validate=a.validate);b.on("load",function(){CKEDITOR.document.getById(e.frameId).getParent().addClass("cke_dialog_ui_input_file")});CKEDITOR.ui.dialog.labeledElement.call(this, +b,a,d,function(){e.frameId=CKEDITOR.tools.getNextId()+"_fileInput";var b=['\x3ciframe frameborder\x3d"0" allowtransparency\x3d"0" class\x3d"cke_dialog_ui_input_file" role\x3d"presentation" id\x3d"',e.frameId,'" title\x3d"',a.label,'" src\x3d"javascript:void('];b.push(CKEDITOR.env.ie?"(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"})()":"0");b.push(')"\x3e\x3c/iframe\x3e');return b.join("")})}},fileButton:function(b,a,d){var e=this;if(!(3>arguments.length)){k.call(this, +a);a.validate&&(this.validate=a.validate);var c=CKEDITOR.tools.extend({},a),f=c.onClick;c.className=(c.className?c.className+" ":"")+"cke_dialog_ui_button";c.onClick=function(c){var d=a["for"];c=f?f.call(this,c):!1;!1!==c&&("xhr"!==c&&b.getContentElement(d[0],d[1]).submit(),this.disable())};b.on("load",function(){b.getContentElement(a["for"][0],a["for"][1])._.buttons.push(e)});CKEDITOR.ui.dialog.button.call(this,b,c,d)}},html:function(){var b=/^\s*<[\w:]+\s+([^>]*)?>/,a=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/, +d=/\/$/;return function(e,c,f){if(!(3>arguments.length)){var h=[],g=c.html;"\x3c"!=g.charAt(0)&&(g="\x3cspan\x3e"+g+"\x3c/span\x3e");var n=c.focus;if(n){var l=this.focus;this.focus=function(){("function"==typeof n?n:l).call(this);this.fire("focus")};c.isFocusable&&(this.isFocusable=this.isFocusable);this.keyboardFocusable=!0}CKEDITOR.ui.dialog.uiElement.call(this,e,c,h,"span",null,null,"");h=h.join("").match(b);g=g.match(a)||["","",""];d.test(g[1])&&(g[1]=g[1].slice(0,-1),g[2]="/"+g[2]);f.push([g[1], +" ",h[1]||"",g[2]].join(""))}}}(),fieldset:function(b,a,d,e,c){var f=c.label;this._={children:a};CKEDITOR.ui.dialog.uiElement.call(this,b,c,e,"fieldset",null,null,function(){var a=[];f&&a.push("\x3clegend"+(c.labelStyle?' style\x3d"'+c.labelStyle+'"':"")+"\x3e"+f+"\x3c/legend\x3e");for(var b=0;ba.getChildCount()?(new CKEDITOR.dom.text(b,CKEDITOR.document)).appendTo(a):a.getChild(0).$.nodeValue=b;return this},getLabel:function(){var b=CKEDITOR.document.getById(this._.labelId);return!b||1>b.getChildCount()?"":b.getChild(0).getText()},eventProcessors:v},!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 b=this.getElement();b&&b.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(b,a){this.on("click",function(){a.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 b=this.selectParentTab();setTimeout(function(){var a=b.getInputElement();a&&a.$.focus()},0)},select:function(){var b=this.selectParentTab();setTimeout(function(){var a=b.getInputElement();a&&(a.$.focus(),a.$.select())},0)},accessKeyUp:function(){this.select()}, +setValue:function(b){if(this.bidi){var a=b&&b.charAt(0);(a="‪"==a?"ltr":"‫"==a?"rtl":null)&&(b=b.slice(1));this.setDirectionMarker(a)}b||(b="");return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this,arguments)},getValue:function(){var b=CKEDITOR.ui.dialog.uiElement.prototype.getValue.call(this);if(this.bidi&&b){var a=this.getDirectionMarker();a&&(b=("ltr"==a?"‪":"‫")+b)}return b},setDirectionMarker:function(b){var a=this.getInputElement();b?a.setAttributes({dir:b,"data-cke-dir-marker":b}): +this.getDirectionMarker()&&a.removeAttributes(["dir","data-cke-dir-marker"])},getDirectionMarker:function(){return this.getInputElement().data("cke-dir-marker")},keyboardFocusable:!0},q,!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(b,a,d){var e=new CKEDITOR.dom.element("option",this.getDialog().getParentEditor().document), +c=this.getInputElement().$;e.$.text=b;e.$.value=void 0===a||null===a?b:a;void 0===d||null===d?CKEDITOR.env.ie?c.add(e.$):c.add(e.$,null):c.add(e.$,d);return this},remove:function(b){this.getInputElement().$.remove(b);return this},clear:function(){for(var b=this.getInputElement().$;0this.focusIndex&&!c&&(a=b[b.length-1]);d.currentFocusIndex=this.focusIndex;for(d=0;db-a;c--)if(this._.tabs[this._.tabIdList[c%a]][0].$.offsetHeight)return this._.tabIdList[c%a];return null}function W(){for(var a=this._.tabIdList.length,b=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId),c=b+1;ch.width-c.width-g?h.width-c.width+("rtl"==f.lang.dir?0:k[1]):d.x;c=d.y+k[0]h.height-c.height-g?h.height-c.height+k[2]:d.y;q=Math.floor(q);c=Math.floor(c);a.move(q,c,1);b.data.preventDefault()}function c(){CKEDITOR.document.removeListener("mousemove",b);CKEDITOR.document.removeListener("mouseup",c);if(CKEDITOR.env.ie6Compat){var a=u.getChild(0).getFrameDocument();a.removeListener("mousemove",b);a.removeListener("mouseup", +c)}}var e=null,d=null,f=a.getParentEditor(),g=f.config.dialog_magnetDistance,k=CKEDITOR.skin.margins||[0,0,0,0];"undefined"==typeof g&&(g=20);a.parts.title.on("mousedown",function(f){if(!a._.moved){var g=a._.element;g.getFirst().setStyle("position","absolute");g.removeStyle("display");a._.moved=!0;a.layout()}e={x:f.data.$.screenX,y:f.data.$.screenY};CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",c);d=a.getPosition();CKEDITOR.env.ie6Compat&&(g=u.getChild(0).getFrameDocument(),g.on("mousemove", +b),g.on("mouseup",c));f.data.preventDefault()},a)}function da(a){function b(b){var c="rtl"==f.lang.dir,m=h.width,q=h.height,w=m+(b.data.$.screenX-l.x)*(c?-1:1)*(a._.moved?1:2),A=q+(b.data.$.screenY-l.y)*(a._.moved?1:2),C=a._.element.getFirst(),C=c&&parseInt(C.getComputedStyle("right"),10),v=a.getPosition();v.x=v.x||0;v.y=v.y||0;v.y+A>p.height&&(A=p.height-v.y);(c?C:v.x)+w>p.width&&(w=p.width-(c?C:v.x));A=Math.floor(A);w=Math.floor(w);if(d==CKEDITOR.DIALOG_RESIZE_WIDTH||d==CKEDITOR.DIALOG_RESIZE_BOTH)m= +Math.max(e.minWidth||0,w-g);if(d==CKEDITOR.DIALOG_RESIZE_HEIGHT||d==CKEDITOR.DIALOG_RESIZE_BOTH)q=Math.max(e.minHeight||0,A-k);a.resize(m,q);a._.moved&&O(a,a._.position.x,a._.position.y);a._.moved||a.layout();b.data.preventDefault()}function c(){CKEDITOR.document.removeListener("mouseup",c);CKEDITOR.document.removeListener("mousemove",b);q&&(q.remove(),q=null);if(CKEDITOR.env.ie6Compat){var a=u.getChild(0).getFrameDocument();a.removeListener("mouseup",c);a.removeListener("mousemove",b)}}var e=a.definition, +d=e.resizable;if(d!=CKEDITOR.DIALOG_RESIZE_NONE){var f=a.getParentEditor(),g,k,p,l,h,q,m=CKEDITOR.tools.addFunction(function(d){function e(a){return a.isVisible()}h=a.getSize();var f=a.parts.contents,m=f.$.getElementsByTagName("iframe").length,w=!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks);m&&(q=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'),f.append(q));k=h.height- +a.parts.contents.getFirst(e).getSize("height",w);g=h.width-a.parts.contents.getFirst(e).getSize("width",1);l={x:d.screenX,y:d.screenY};p=CKEDITOR.document.getWindow().getViewPaneSize();CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",c);CKEDITOR.env.ie6Compat&&(f=u.getChild(0).getFrameDocument(),f.on("mousemove",b),f.on("mouseup",c));d.preventDefault&&d.preventDefault()});a.on("load",function(){var b="";d==CKEDITOR.DIALOG_RESIZE_WIDTH?b=" cke_resizer_horizontal":d==CKEDITOR.DIALOG_RESIZE_HEIGHT&& +(b=" cke_resizer_vertical");b=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_resizer'+b+" cke_resizer_"+f.lang.dir+'" title\x3d"'+CKEDITOR.tools.htmlEncode(f.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+m+', event )"\x3e'+("ltr"==f.lang.dir?"◢":"◣")+"\x3c/div\x3e");a.parts.footer.append(b,1)});f.on("destroy",function(){CKEDITOR.tools.removeFunction(m)})}}function O(a,b,c){var e=a.parts.dialog.getParent().getClientSize(),d=a.getSize(),f=a._.viewportRatio,g=Math.max(e.width- +d.width,0),e=Math.max(e.height-d.height,0);f.width=g?b/g:f.width;f.height=e?c/e:f.height;a._.viewportRatio=f}function H(a){a.data.preventDefault(1)}function P(a){var b=a.config,c=CKEDITOR.skinName||a.config.skin,e=b.dialog_backgroundCoverColor||("moono-lisa"==c?"black":"white"),c=b.dialog_backgroundCoverOpacity,d=b.baseFloatZIndex,b=CKEDITOR.tools.genKey(e,c,d),f=B[b];CKEDITOR.document.getBody().addClass("cke_dialog_open");f?f.show():(d=['\x3cdiv tabIndex\x3d"-1" style\x3d"position: ',CKEDITOR.env.ie6Compat? +"absolute":"fixed","; z-index: ",d,"; top: 0px; left: 0px; ","; width: 100%; height: 100%;",CKEDITOR.env.ie6Compat?"":"background-color: "+e,'" class\x3d"cke_dialog_background_cover"\x3e'],CKEDITOR.env.ie6Compat&&(e="\x3chtml\x3e\x3cbody style\x3d\\'background-color:"+e+";\\'\x3e\x3c/body\x3e\x3c/html\x3e",d.push('\x3ciframe hidefocus\x3d"true" frameborder\x3d"0" id\x3d"cke_dialog_background_iframe" src\x3d"javascript:'),d.push("void((function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+ +")();document.write( '"+e+"' );document.close();")+"})())"),d.push('" style\x3d"position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity\x3d0)"\x3e\x3c/iframe\x3e')),d.push("\x3c/div\x3e"),f=CKEDITOR.dom.element.createFromHtml(d.join("")),f.setOpacity(void 0!==c?c:.5),f.on("keydown",H),f.on("keypress",H),f.on("keyup",H),f.appendTo(CKEDITOR.document.getBody()),B[b]=f);a.focusManager.add(f);u=f;CKEDITOR.env.mac&&CKEDITOR.env.webkit||f.focus()}function Q(a){CKEDITOR.document.getBody().removeClass("cke_dialog_open"); +u&&(a.focusManager.remove(u),u.hide())}function R(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,c=a.data.$.altKey,e=a.data.$.shiftKey,d=String.fromCharCode(a.data.$.keyCode);(b=x[(b?"CTRL+":"")+(c?"ALT+":"")+(e?"SHIFT+":"")+d])&&b.length&&(b=b[b.length-1],b.keydown&&b.keydown.call(b.uiElement,b.dialog,b.key),a.data.preventDefault())}function S(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,c=a.data.$.altKey,e=a.data.$.shiftKey,d=String.fromCharCode(a.data.$.keyCode);(b=x[(b?"CTRL+":"")+(c?"ALT+":"")+(e? +"SHIFT+":"")+d])&&b.length&&(b=b[b.length-1],b.keyup&&(b.keyup.call(b.uiElement,b.dialog,b.key),a.data.preventDefault()))}function T(a,b,c,e,d){(x[c]||(x[c]=[])).push({uiElement:a,dialog:b,key:c,keyup:d||a.accessKeyUp,keydown:e||a.accessKeyDown})}function ea(a){for(var b in x){for(var c=x[b],e=c.length-1;0<=e;e--)c[e].dialog!=a&&c[e].uiElement!=a||c.splice(e,1);0===c.length&&delete x[b]}}function fa(a,b){a._.accessKeyMap[b]&&a.selectPage(a._.accessKeyMap[b])}function ga(){}var y=CKEDITOR.tools.cssLength, +U,u,V=!1,D=!CKEDITOR.env.ie||CKEDITOR.env.edge,aa='\x3cdiv class\x3d"cke_reset_all cke_dialog_container {editorId} {editorDialogClass} {hidpi}" dir\x3d"{langDir}" style\x3d"'+(D?"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"'+(D?"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(a,b){function c(){var a=n._.focusList;a.sort(function(a,b){return a.tabIndex!=b.tabIndex?b.tabIndex-a.tabIndex:a.focusIndex-b.focusIndex});for(var b=a.length,c=0;cb.length)){var c=n._.currentFocusIndex;n._.tabBarMode&&0>a&&(c=0);try{b[c].getInputElement().$.blur()}catch(d){}var e=c,f=1arguments.length)){var k=(e.call?e(b):e)||"div",p=["\x3c",k," "],l=(d&&d.call?d(b):d)||{},h=(f&&f.call?f(b):f)||{},q=(g&&g.call?g.call(this,a,b):g)||"",m=this.domId=h.id||CKEDITOR.tools.getNextId()+"_uiElement";b.requiredContent&&!a.getParentEditor().filter.check(b.requiredContent)&&(l.display="none",this.notAllowed= +!0);h.id=m;var r={};b.type&&(r["cke_dialog_ui_"+b.type]=1);b.className&&(r[b.className]=1);b.disabled&&(r.cke_disabled=1);for(var n=h["class"]&&h["class"].split?h["class"].split(" "):[],m=0;mCKEDITOR.env.version?"cke_dialog_ui_focused":"";b.on("focus", +function(){a._.tabBarMode=!1;a._.hasFocus=!0;t.fire("focus");c&&this.addClass(c)});b.on("blur",function(){t.fire("blur");c&&this.removeClass(c)})}});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=t.focusIndex}))}},hbox:function(a,b,c,e,d){if(!(4>arguments.length)){this._||(this._={});var f=this._.children=b,g=d&&d.widths||null,k=d&&d.height||null,p,l={role:"presentation"}; +d&&d.align&&(l.align=d.align);CKEDITOR.ui.dialog.uiElement.call(this,a,d||{type:"hbox"},e,"table",{},l,function(){var a=['\x3ctbody\x3e\x3ctr class\x3d"cke_dialog_ui_hbox"\x3e'];for(p=0;parguments.length)){this._||(this._={});var f=this._.children=b,g=d&&d.width||null,k=d&&d.heights||null;CKEDITOR.ui.dialog.uiElement.call(this,a,d||{type:"vbox"},e,"div",null,{role:"presentation"},function(){var b= +['\x3ctable role\x3d"presentation" cellspacing\x3d"0" border\x3d"0" '];b.push('style\x3d"');d&&d.expand&&b.push("height:100%;");b.push("width:"+y(g||"100%"),";");CKEDITOR.env.webkit&&b.push("float:none;");b.push('"');b.push('align\x3d"',CKEDITOR.tools.htmlEncode(d&&d.align||("ltr"==a.getParentEditor().lang.dir?"left":"right")),'" ');b.push("\x3e\x3ctbody\x3e");for(var e=0;earguments.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, +c,e){for(var d=c.children,f,g=[],k=[],p=0;pe.length&&(a=g.document.createElement(g.config.enterMode==CKEDITOR.ENTER_P?"p":"div"),b=h.shift(),c.insertNode(a),a.append(new CKEDITOR.dom.text("",g.document)),c.moveToBookmark(b),c.selectNodeContents(a),c.collapse(!0),b=c.createBookmark(),e.push(a),h.unshift(b));d=e[0].getParent();c=[];for(b=0;ba||(this.notifications.splice(a,1),b.element.remove(),this.element.getChildCount()||(this._removeListeners(),this.element.remove()))},_createElement:function(){var b=this.editor,a=b.config,c=new CKEDITOR.dom.element("div");c.addClass("cke_notifications_area");c.setAttribute("id","cke_notifications_area_"+b.name);c.setStyle("z-index",a.baseFloatZIndex-2);return c},_attachListeners:function(){var b=CKEDITOR.document.getWindow(),a=this.editor;b.on("scroll",this._uiBuffer.input);b.on("resize",this._uiBuffer.input); +a.on("change",this._changeBuffer.input);a.on("floatingSpaceLayout",this._layout,this,null,20);a.on("blur",this._layout,this,null,20)},_removeListeners:function(){var b=CKEDITOR.document.getWindow(),a=this.editor;b.removeListener("scroll",this._uiBuffer.input);b.removeListener("resize",this._uiBuffer.input);a.removeListener("change",this._changeBuffer.input);a.removeListener("floatingSpaceLayout",this._layout);a.removeListener("blur",this._layout)},_layout:function(){function b(){a.setStyle("left", +k(n+d.width-g-h))}var a=this.element,c=this.editor,d=c.ui.contentsElement.getClientRect(),e=c.ui.contentsElement.getDocumentPosition(),f,l,u=a.getClientRect(),m,g=this._notificationWidth,h=this._notificationMargin;m=CKEDITOR.document.getWindow();var p=m.getScrollPosition(),t=m.getViewPaneSize(),q=CKEDITOR.document.getBody(),r=q.getDocumentPosition(),k=CKEDITOR.tools.cssLength;g&&h||(m=this.element.getChild(0),g=this._notificationWidth=m.getClientRect().width,h=this._notificationMargin=parseInt(m.getComputedStyle("margin-left"), +10)+parseInt(m.getComputedStyle("margin-right"),10));c.toolbar&&(f=c.ui.space(c.config.toolbarLocation),l=f.getClientRect());f&&f.isVisible()&&l.bottom>d.top&&l.bottomp.y?a.setStyles({position:"fixed",top:0}):a.setStyles({position:"absolute",top:k(e.y+d.height-u.height)});var n="fixed"==a.getStyle("position")?d.left:"static"!=q.getComputedStyle("position")? +e.x-r.x:e.x;d.widthp.x+t.width?b():a.setStyle("left",k(n)):e.x+g+h>p.x+t.width?a.setStyle("left",k(n)):e.x+d.width/2+g/2+h>p.x+t.width?a.setStyle("left",k(n-e.x+p.x+t.width-g-h)):0>d.left+d.width-g-h?b():0>d.left+d.width/2-g/2?a.setStyle("left",k(n-e.x+p.x)):a.setStyle("left",k(n+d.width/2-g/2-h/2))}};CKEDITOR.plugins.notification=q})();(function(){var c='\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}"{hasArrowAriaHtml}{toggleAriaHtml}';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(c+=' onkeypress\x3d"return false;"'); +CKEDITOR.env.gecko&&(c+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');var l="";CKEDITOR.env.ie&&(l='return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26');var c=c+(' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" onclick\x3d"'+l+'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{ariaShortcutSpace}{ariaShortcut}\x3c/span\x3e{arrowHtml}\x3c/a\x3e',v=CKEDITOR.addTemplate("buttonArrow",'\x3cspan class\x3d"cke_button_arrow"\x3e'+(CKEDITOR.env.hc?"\x26#9660;":"")+"\x3c/span\x3e"),w=CKEDITOR.addTemplate("button",c);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,{isToggle:a.isToggle||!1,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,b){function c(){var f=a.mode;f&&(f=this.modes[f]?void 0!==p[f]?p[f]:CKEDITOR.TRISTATE_OFF: +CKEDITOR.TRISTATE_DISABLED,f=a.readOnly&&!this.readOnly?CKEDITOR.TRISTATE_DISABLED:f,this.setState(f),this.refresh&&this.refresh())}var p=null,q=CKEDITOR.env,r=this._.id=CKEDITOR.tools.getNextId(),g="",d=this.command,l,m,k;this._.editor=a;var e={id:r,button:this,editor:a,focus:function(){CKEDITOR.document.getById(r).focus()},execute:function(){this.button.click(a)},attach:function(a){this.button.attach(a)}},x=CKEDITOR.tools.addFunction(function(a){if(e.onkey)return a=new CKEDITOR.dom.event(a),!1!== +e.onkey(e,a.getKeystroke())}),y=CKEDITOR.tools.addFunction(function(a){var b;e.onfocus&&(b=!1!==e.onfocus(e,new CKEDITOR.dom.event(a)));return b}),u=0;e.clickFn=l=CKEDITOR.tools.addFunction(function(){u&&(a.unlockSelection(1),u=0);e.execute();q.iOS&&a.focus()});this.modes?(p={},a.on("beforeModeUnload",function(){a.mode&&this._.state!=CKEDITOR.TRISTATE_DISABLED&&(p[a.mode]=this._.state)},this),a.on("activeFilterChange",c,this),a.on("mode",c,this),!this.readOnly&&a.on("readOnly",c,this)):d&&(d=a.getCommand(d))&& +(d.on("state",function(){this.setState(d.state)},this),g+=d.state==CKEDITOR.TRISTATE_ON?"on":d.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off");var n;if(this.directional)a.on("contentDirChanged",function(b){var c=CKEDITOR.document.getById(this._.id),d=c.getFirst();b=b.data;b!=a.lang.dir?c.addClass("cke_"+b):c.removeClass("cke_ltr").removeClass("cke_rtl");d.setAttribute("style",CKEDITOR.skin.getIconStyle(n,"rtl"==b,this.icon,this.iconOffset))},this);d?(m=a.getCommandKeystroke(d))&&(k=CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard, +m)):g+="off";m=this.name||this.command;var h=null,t=this.icon;n=m;this.icon&&!/\./.test(this.icon)?(n=this.icon,t=null):(this.icon&&(h=this.icon),CKEDITOR.env.hidpi&&this.iconHiDpi&&(h=this.iconHiDpi));h?(CKEDITOR.skin.addIcon(h,h),t=null):h=n;g={id:r,name:m,iconName:n,label:this.label,cls:(this.hasArrow?"cke_button_expandable ":"")+(this.className||""),state:g,ariaDisabled:"disabled"==g?"true":"false",title:this.title+(k?" ("+k.display+")":""),ariaShortcutSpace:k?"\x26nbsp;":"",ariaShortcut:k?a.lang.common.keyboardShortcut+ +" "+k.aria:"",titleJs:q.gecko&&!q.hc?"":(this.title||"").replace("'",""),hasArrow:"string"===typeof this.hasArrow&&this.hasArrow||(this.hasArrow?"true":"false"),keydownFn:x,focusFn:y,clickFn:l,style:CKEDITOR.skin.getIconStyle(h,"rtl"==a.lang.dir,t,this.iconOffset),arrowHtml:this.hasArrow?v.output():"",hasArrowAriaHtml:this.hasArrow?' aria-expanded\x3d"false"':"",toggleAriaHtml:this.isToggle?'aria-pressed\x3d"false"':""};w.output(g,b);if(this.onRender)this.onRender();return e},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.isToggle&&!this.hasArrow&&b.setAttribute("aria-pressed",a===CKEDITOR.TRISTATE_ON),!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 D(b){function d(){for(var a=f(),e=CKEDITOR.tools.clone(b.config.toolbarGroups)||v(b),n=0;nb.order?-1:0>a.order?1:a.order]+data-cke-bookmark[^<]*?<\/span>/ig, +"");h&&t(a,c)})}function p(){if("wysiwyg"==a.mode){var b=k("paste");a.getCommand("cut").setState(k("cut"));a.getCommand("copy").setState(k("copy"));a.getCommand("paste").setState(b);a.fire("pasteState",b)}}function k(b){var c=a.getSelection(),c=c&&c.getRanges()[0];if((a.readOnly||c&&c.checkReadOnly())&&b in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==b)return CKEDITOR.TRISTATE_OFF;b=a.getSelection();c=b.getRanges();return b.getType()==CKEDITOR.SELECTION_NONE||1==c.length&&c[0].collapsed? +CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var n=CKEDITOR.plugins.clipboard,u=0,w=0;(function(){a.on("key",h);a.on("contentDom",b);a.on("selectionChange",p);if(a.contextMenu){a.contextMenu.addListener(function(){return{cut:k("cut"),copy:k("copy"),paste:k("paste")}});var c=null;a.on("menuShow",function(){c&&(c.removeListener(),c=null);var b=a.contextMenu.findItemByCommandName("paste");b&&b.element&&(c=b.element.on("touchend",function(){a._.forcePasteDialog=!0}))})}if(a.ui.addButton)a.once("instanceReady", +function(){a._.pasteButtons&&CKEDITOR.tools.array.forEach(a._.pasteButtons,function(b){if(b=a.ui.get(b))if(b=CKEDITOR.document.getById(b._.id))b.on("touchend",function(){a._.forcePasteDialog=!0})})})})();(function(){function b(c,h,d,m,e){var p=a.lang.clipboard[h];a.addCommand(h,d);a.ui.addButton&&a.ui.addButton(c,{label:p,command:h,toolbar:"clipboard,"+m});a.addMenuItems&&a.addMenuItem(h,{label:p,command:h,group:"clipboard",order:e})}b("Cut","cut",c("cut"),10,1);b("Copy","copy",c("copy"),20,4);b("Paste", +"paste",d(),30,8);a._.pasteButtons||(a._.pasteButtons=[]);a._.pasteButtons.push("Paste")})();a.getClipboardData=function(b,c){function h(a){a.removeListener();a.cancel();c(a.data)}function d(a){a.removeListener();a.cancel();c({type:e,dataValue:a.data.dataValue,dataTransfer:a.data.dataTransfer,method:"paste"})}var m=!1,e="auto";c||(c=b,b=null);a.on("beforePaste",function(a){a.removeListener();m=!0;e=a.data.type},null,null,1E3);a.on("paste",h,null,null,0);!1===v()&&(a.removeListener("paste",h),a._.forcePasteDialog&& +m&&a.fire("pasteDialog")?(a.on("pasteDialogCommit",d),a.on("dialogHide",function(a){a.removeListener();a.data.removeListener("pasteDialogCommit",d);a.data._.committed||c(null)})):c(null))}}function z(a){if(CKEDITOR.env.webkit){if(!a.match(/^[^<]*$/g)&&!a.match(/^(
<\/div>|
[^<]*<\/div>)*$/gi))return"html"}else if(CKEDITOR.env.ie){if(!a.match(/^([^<]|)*$/gi)&&!a.match(/^(

([^<]|)*<\/p>|(\r\n))*$/gi))return"html"}else if(CKEDITOR.env.gecko){if(!a.match(/^([^<]|)*$/gi))return"html"}else return"html"; +return"htmlifiedtext"}function A(a,b){function c(a){return CKEDITOR.tools.repeat("\x3c/p\x3e\x3cp\x3e",~~(a/2))+(1==a%2?"\x3cbr\x3e":"")}b=b.replace(/(?!\u3000)\s+/g," ").replace(/> +/gi,"\x3cbr\x3e");b=b.replace(/<\/?[A-Z]+>/g,function(a){return a.toLowerCase()});if(b.match(/^[^<]$/))return b;CKEDITOR.env.webkit&&-1(
|)<\/div>)(?!$|(

(
|)<\/div>))/g,"\x3cbr\x3e").replace(/^(
(
|)<\/div>){2}(?!$)/g,"\x3cdiv\x3e\x3c/div\x3e"), +b.match(/
(
|)<\/div>/)&&(b="\x3cp\x3e"+b.replace(/(
(
|)<\/div>)+/g,function(a){return c(a.split("\x3c/div\x3e\x3cdiv\x3e").length+1)})+"\x3c/p\x3e"),b=b.replace(/<\/div>
/g,"\x3cbr\x3e"),b=b.replace(/<\/?div>/g,""));CKEDITOR.env.gecko&&a.enterMode!=CKEDITOR.ENTER_BR&&(CKEDITOR.env.gecko&&(b=b.replace(/^

$/,"\x3cbr\x3e")),-1){2,}/g,function(a){return c(a.length/4)})+"\x3c/p\x3e"));return B(a,b)}function C(a){function b(){var a= +{},b;for(b in CKEDITOR.dtd)"$"!=b.charAt(0)&&"div"!=b&&"span"!=b&&(a[b]=1);return a}var c={};return{get:function(d){return"plain-text"==d?c.plainText||(c.plainText=new CKEDITOR.filter(a,"br")):"semantic-content"==d?((d=c.semanticContent)||(d=new CKEDITOR.filter(a,{}),d.allow({$1:{elements:b(),attributes:!0,styles:!1,classes:!1}}),d=c.semanticContent=d),d):d?new CKEDITOR.filter(a,d):null}}}function x(a,b,c){b=CKEDITOR.htmlParser.fragment.fromHtml(b);var d=new CKEDITOR.htmlParser.basicWriter;c.applyTo(b, +!0,!1,a.activeEnterMode);b.writeHtml(d);return d.getHtml()}function B(a,b){a.enterMode==CKEDITOR.ENTER_BR?b=b.replace(/(<\/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 D(a){a.data.preventDefault();a.data.$.dataTransfer.dropEffect="none"}function E(a){var b=CKEDITOR.plugins.clipboard;a.on("contentDom",function(){function c(b,c,d){c.select();t(a,{dataTransfer:d, +method:"drop"},1);d.sourceEditor.fire("saveSnapshot");d.sourceEditor.editable().extractHtmlFromRange(b);d.sourceEditor.getSelection().selectRanges([b]);d.sourceEditor.fire("saveSnapshot")}function d(c,d){c.select();t(a,{dataTransfer:d,method:"drop"},1);b.resetDragDataTransfer()}function g(b,c,d){var e={$:b.data.$,target:b.data.getTarget()};c&&(e.dragRange=c);d&&(e.dropRange=d);!1===a.fire(b.name,e)&&b.data.preventDefault()}function f(a){a.type!=CKEDITOR.NODE_ELEMENT&&(a=a.getParent());return a.getChildCount()} +var e=a.editable(),l=CKEDITOR.plugins.clipboard.getDropTarget(a),q=a.ui.space("top"),v=a.ui.space("bottom");b.preventDefaultDropOnElement(q);b.preventDefaultDropOnElement(v);e.attachListener(l,"dragstart",g);e.attachListener(a,"dragstart",b.resetDragDataTransfer,b,null,1);e.attachListener(a,"dragstart",function(c){b.initDragDataTransfer(c,a)},null,null,2);e.attachListener(a,"dragstart",function(){var c=b.dragRange=a.getSelection().getRanges()[0];CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(b.dragStartContainerChildCount= +c?f(c.startContainer):null,b.dragEndContainerChildCount=c?f(c.endContainer):null)},null,null,100);e.attachListener(l,"dragend",g);e.attachListener(a,"dragend",b.initDragDataTransfer,b,null,1);e.attachListener(a,"dragend",b.resetDragDataTransfer,b,null,100);e.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()}});e.attachListener(l,"drop",function(c){if(!c.data.$.defaultPrevented&&(c.data.preventDefault(),!a.readOnly)){var d=c.data.getTarget();if(!d.isReadOnly()||d.type==CKEDITOR.NODE_ELEMENT&&d.is("html")){var d=b.getRangeAtDropPosition(c,a),e=b.dragRange;d&&g(c,e,d)}}},null,null,9999);e.attachListener(a,"drop",b.initDragDataTransfer,b,null,1);e.attachListener(a,"drop",function(h){if(h=h.data){var e=h.dropRange,p=h.dragRange,k=h.dataTransfer;k.getTransferType(a)==CKEDITOR.DATA_TRANSFER_INTERNAL? +setTimeout(function(){b.internalDrop(p,e,k,a)},0):k.getTransferType(a)==CKEDITOR.DATA_TRANSFER_CROSS_EDITORS?c(p,e,k):d(e,k)}},null,null,9999)})}var r;CKEDITOR.plugins.add("clipboard",{requires:"dialog,notification,toolbar",_supportedFileMatchers:[],init:function(a){function b(b){return a.config.clipboard_handleImages?-1!==CKEDITOR.tools.indexOf(["image/png","image/jpeg","image/gif"],b.type):!1}function c(b){return CKEDITOR.tools.array.some(a.plugins.clipboard._supportedFileMatchers,function(a){return a(b)})} +function d(b){b.length&&(b=CKEDITOR.tools.array.unique(b),b=CKEDITOR.tools.array.filter(b,function(a){return!!CKEDITOR.tools.trim(a)}),b=g(b.join(", ")),a.showNotification(b,"info",a.config.clipboard_notificationDuration))}function g(b){return b?a.lang.clipboard.fileFormatNotSupportedNotification.replace(/\${formats\}/g,"\x3cem\x3e"+b+"\x3c/em\x3e"):a.lang.clipboard.fileWithoutFormatNotSupportedNotification}function f(a,b){return CKEDITOR.env.ie&&a.data.fileTransferCancel||!(CKEDITOR.env.ie||b&&v!== +b.id)?!1:b.isFileTransfer()&&1===b.getFilesCount()}var e,l=C(a);a.config.forcePasteAsPlainText?e="plain-text":a.config.pasteFilter?e=a.config.pasteFilter:!CKEDITOR.env.webkit||"pasteFilter"in a.config||(e="semantic-content");a.pasteFilter=l.get(e);y(a);E(a);CKEDITOR.dialog.add("paste",CKEDITOR.getUrl(this.path+"dialogs/paste.js"));var q=CKEDITOR.plugins.clipboard.isCustomDataTypesSupported||CKEDITOR.plugins.clipboard.isFileApiSupported,v;CKEDITOR.plugins.clipboard.addFileMatcher(a,b);a.on("paste", +function(a){if(q){var b=a.data;a=b.dataTransfer;if(!b.dataValue){for(var b=[],e=0;e <\/span>/gi," "),"html"!=a.data.type&&(b=b.replace(/]*>([^<]*)<\/span>/gi,function(a,b){return b.replace(/\t/g,"\x26nbsp;\x26nbsp; \x26nbsp;")})),-1/,"")),b=b.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1"));if(b.match(/^<[^<]+cke_(editable|contents)/i)){var d,e,f=new CKEDITOR.dom.element("div");for(f.setHtml(b);1==f.getChildCount()&&(d=f.getFirst())&&d.type==CKEDITOR.NODE_ELEMENT&&(d.hasClass("cke_editable")||d.hasClass("cke_contents"));)f=e=d;e&&(b=e.getHtml().replace(/
$/i,""))}CKEDITOR.env.ie?b=b.replace(/^ (?: |\r\n)?<(\w+)/g,function(b,d){return d.toLowerCase()in c?(a.data.preSniffing= +"html","\x3c"+d):b}):CKEDITOR.env.webkit?b=b.replace(/<\/(\w+)>


<\/div>$/,function(b,d){return d in c?(a.data.endsWithEOL=1,"\x3c/"+d+"\x3e"):b}):CKEDITOR.env.gecko&&(b=b.replace(/(\s)
$/,"$1"));a.data.dataValue=b},null,null,3);a.on("paste",function(b){b=b.data;var c=a._.nextPasteType||b.type,d=b.dataValue,e,f=a.config.clipboard_defaultContentType||"html",g=b.dataTransfer.getTransferType(a)==CKEDITOR.DATA_TRANSFER_EXTERNAL,q=!0===a.config.forcePasteAsPlainText;e="html"==c||"html"==b.preSniffing? +"html":z(d);delete a._.nextPasteType;"htmlifiedtext"==e&&(d=A(a.config,d));if("text"==c&&"html"==e)d=x(a,d,l.get("plain-text"));else if(g&&a.pasteFilter&&!b.dontFilter||q)d=x(a,d,a.pasteFilter);b.startsWithEOL&&(d='\x3cbr data-cke-eol\x3d"1"\x3e'+d);b.endsWithEOL&&(d+='\x3cbr data-cke-eol\x3d"1"\x3e');"auto"==c&&(c="html"==e||"html"==f?"html":"text");b.type=c;b.dataValue=d;delete b.preSniffing;delete b.startsWithEOL;delete b.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={addFileMatcher:function(a,b){a.plugins.clipboard._supportedFileMatchers.push(b)},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|| +9CKEDITOR.env.version||b.isInline()?b:a.document},fixSplitNodesAfterDrop:function(a,b,c,d){function g(a,c,d){var f=a;f.type==CKEDITOR.NODE_TEXT&&(f=a.getParent());if(f.equals(c)&&d!=c.getChildCount())return a=b.startContainer.getChild(b.startOffset-1),c=b.startContainer.getChild(b.startOffset),a&&a.type==CKEDITOR.NODE_TEXT&&c&&c.type==CKEDITOR.NODE_TEXT&& +(d=a.getLength(),a.setText(a.getText()+c.getText()),c.remove(),b.setStart(a,d),b.collapse(!0)),!0}var f=b.startContainer;"number"==typeof d&&"number"==typeof c&&f.type==CKEDITOR.NODE_ELEMENT&&(g(a.startContainer,f,c)||g(a.endContainer,f,d))},isDropRangeAffectedByDragRange:function(a,b){var c=b.startContainer,d=b.endOffset;return a.endContainer.equals(c)&&a.endOffset<=d||a.startContainer.getParent().equals(c)&&a.startContainer.getIndex()CKEDITOR.env.version&&this.fixSplitNodesAfterDrop(a,b,g.dragStartContainerChildCount,g.dragEndContainerChildCount);(l=this.isDropRangeAffectedByDragRange(a,b))||(e=a.createBookmark(!1));g=b.clone().createBookmark(!1);l&&(e=a.createBookmark(!1));a=e.startNode;b=e.endNode;l=g.startNode;b&&a.getPosition(l)&CKEDITOR.POSITION_PRECEDING&& +b.getPosition(l)&CKEDITOR.POSITION_FOLLOWING&&l.insertBefore(a);a=d.createRange();a.moveToBookmark(e);f.extractHtmlFromRange(a,1);b=d.createRange();g.startNode.getCommonAncestor(f)||(g=d.getSelection().createBookmarks()[0]);b.moveToBookmark(g);t(d,{dataTransfer:c,method:"drop",range:b},1);d.fire("unlockSnapshot")},getRangeAtDropPosition:function(a,b){var c=a.data.$,d=c.clientX,g=c.clientY,f=b.getSelection(!0).getRanges()[0],e=b.createRange();if(a.data.testRange)return a.data.testRange;if(document.caretRangeFromPoint&& +b.document.$.caretRangeFromPoint(d,g))c=b.document.$.caretRangeFromPoint(d,g),e.setStart(CKEDITOR.dom.node(c.startContainer),c.startOffset),e.collapse(!0);else if(c.rangeParent)e.setStart(CKEDITOR.dom.node(c.rangeParent),c.rangeOffset),e.collapse(!0);else{if(CKEDITOR.env.ie&&8q&&!l;q++){if(!l)try{c.moveToPoint(d,g-q),l=!0}catch(r){}if(!l)try{c.moveToPoint(d, +g+q),l=!0}catch(h){}}if(l){var m="cke-temp-"+(new Date).getTime();c.pasteHTML('\x3cspan id\x3d"'+m+'"\x3e​\x3c/span\x3e');var p=b.document.getById(m);e.moveToPosition(p,CKEDITOR.POSITION_BEFORE_START);p.remove()}else{var k=b.document.$.elementFromPoint(d,g),n=new CKEDITOR.dom.element(k),u;if(n.equals(b.editable())||"html"==n.getName())return f&&f.startContainer&&!f.startContainer.equals(b.editable())?f:null;u=n.getClientRect();d/i,fragmentRegExp:/\s*\x3c!--StartFragment--\x3e|\x3c!--EndFragment--\x3e\s*/g,types:[],data:{},files:[],nativeHtmlCache:"",normalizeType:function(a){a=a.toLowerCase();return"text"==a||"text/plain"==a?"Text":"url"==a?"URL":"files"===a?"Files":a}};this._.fallbackDataTransfer=new CKEDITOR.plugins.clipboard.fallbackDataTransfer(this);this.id=this.getData(r);this.id||(this.id="Text"==r?"":"cke-"+CKEDITOR.tools.getUniqueId());b&&(this.sourceEditor= +b,this.setData("text/html",b.getSelectedHtml(1)),"Text"==r||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 c="text/html"==a&&b?this._.nativeHtmlCache:this._.data[a];if(void 0===c||null===c||""===c){if(this._.fallbackDataTransfer.isRequired())c=this._.fallbackDataTransfer.getData(a, +b);else try{c=this.$.getData(a)||""}catch(d){c=""}"text/html"!=a||b||(c=this._stripHtml(c))}"Text"==a&&CKEDITOR.env.gecko&&this.getFilesCount()&&"file://"==c.substring(0,7)&&(c="");if("string"===typeof c)var g=c.indexOf("\x3c/html\x3e"),c=-1!==g?c.substring(0,g+7):c;return c},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"== +r&&"Text"==a&&(this.id=b),this._.fallbackDataTransfer.isRequired())this._.fallbackDataTransfer.setData(a,b);else try{this.$.setData(a,b)}catch(c){}},storeId:function(){"Text"!==r&&this.setData(r,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(a){a=b._.normalizeType(a);var c=b.getData(a);"text/html"==a&&(b._.nativeHtmlCache=b.getData(a, +!0),c=b._stripHtml(c));c&&(b._.data[a]=c);b._.types.push(a)}if(this.$){var b=this,c,d,g;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported){if(this.$.types)for(c=0;c$/gi,"")}a&&a.length&&(a=b(a),a=a.replace(this._.metaRegExp,""),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(c){}}else return!1;return!a._isCustomMimeTypeSupported},getData:function(a,b){var c=this._getData(this._customDataFallbackType,!0);if(b)return c;var c=this._extractDataComment(c),d=null,d=a===this._customDataFallbackType?c.content:c.data&&c.data[a]?c.data[a]:this._getData(a, +!0);return null!==d?d:""},setData:function(a,b){var c=a===this._customDataFallbackType;c&&(b=this._applyDataComment(b,this._getFallbackTypeData()));var d=b,g=this._dataTransfer.$;try{g.setData(a,d),c&&(this._dataTransfer._.nativeHtmlCache=d)}catch(f){if(this._isUnsupportedMimeTypeError(f)){c=CKEDITOR.plugins.clipboard.fallbackDataTransfer;-1===CKEDITOR.tools.indexOf(c._customTypes,a)&&c._customTypes.push(a);var c=this._getFallbackTypeContent(),e=this._getFallbackTypeData();e[a]=d;try{d=this._applyDataComment(c, +e),g.setData(this._customDataFallbackType,d),this._dataTransfer._.nativeHtmlCache=d}catch(l){d=""}}}return d},_getData:function(a,b){var c=this._dataTransfer._.data;if(!b&&c[a])return c[a];try{return this._dataTransfer.$.getData(a)}catch(d){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||{},c=this._dataTransfer._.data;CKEDITOR.tools.array.forEach(a,function(a){void 0!==c[a]?b[a]=c[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&&16c?d+c:b.width>c?d-a.left:d-a.right+b.width):mc?d-c:b.width>c?d-a.right+b.width:d-a.left);c=a.top;b.height-a.tope?p-e:b.height>e?p-a.bottom+b.height:p-a.top);CKEDITOR.env.ie&&!CKEDITOR.env.edge&&((b=a=k.$.offsetParent&&new CKEDITOR.dom.element(k.$.offsetParent))&&"html"==b.getName()&&(b=b.getDocument().getBody()),b&&"rtl"==b.getComputedStyle("direction")&&(d=CKEDITOR.env.ie8Compat?d-2*k.getDocument().getDocumentElement().$.scrollLeft:d-(a.$.scrollWidth-a.$.clientWidth))); +var a=k.getFirst(),f;(f=a.getCustomData("activePanel"))&&f.onHide&&f.onHide.call(this,1);a.setCustomData("activePanel",this);k.setStyles({top:p+"px",left:d+"px"});k.setOpacity(1);g&&g()},this);n.isLoaded?a():n.onLoad=a;CKEDITOR.tools.setTimeout(function(){var a=CKEDITOR.env.webkit&&CKEDITOR.document.getWindow().getScrollPosition().y;this.focus();l.element.focus();CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=a);this.allowBlur(!0);this._.markFirst&&(CKEDITOR.env.ie?CKEDITOR.tools.setTimeout(function(){l.markFirstDisplayed? +l.markFirstDisplayed():l._.markFirstDisplayed()},0):l.markFirstDisplayed?l.markFirstDisplayed():l._.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,g){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,g),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={})})})();(function(){var n,k,l;CKEDITOR.plugins.add("colorbutton",{requires:"panelbutton,floatpanel",init:function(a){function b(d){function b(){var d=a.config["colorButton_"+h+"Style"];d.childRule="back"==h?function(a){return f(a)}:function(a){return!(a.is("a")||a.getElementsByTag("a").count())||f(a)};return d}function z(d,w,e){var c={};d&&(c.color=d);w&&(c.colorName=w);w=!CKEDITOR.tools.isEmpty(c)&&new CKEDITOR.style(b(),c);a.execCommand(m,{newStyle:w});if(d&&e)for(e.addColor(d.substr(1).toUpperCase()), +d=t.element.find("[role\x3doption]").toArray(),e=0;eb)return null;this.boxes[b].getElement().remove(); +return this.boxes.splice(b,1)[0]}}});l=CKEDITOR.tools.createClass({$:function(a,b,c){this.editor=a;this.cssProperty=b;this.clickFn=c;this.rows=[];this._.addNewRow();if(this.editor.config.colorButton_renderContentColors)this.editor.once("instanceReady",function(){this.renderContentColors()},this)},statics:{renderContainer:function(a,b){a.push('\x3c/tbody\x3e\x3ctbody class\x3d"cke_colorhistory" style\x3d"display:none;"\x3e',"\x3ctr\x3e",'\x3ctd colspan\x3d"',b.config.colorButton_colorsPerRow,'" align\x3d"center"\x3e', +"\x3cspan\x3e\x3chr\x3e\x3c/span\x3e","\x3c/td\x3e","\x3c/tr\x3e","\x3c/tbody\x3e\x3ctbody\x3e")},getRowLimit:function(a){return a.config.colorButton_historyRowLimit},getCapacity:function(a){return l.getRowLimit(a)*a.config.colorButton_colorsPerRow},colorList:CKEDITOR.tools.style.parse._colors},_:{countColors:function(){var a=CKEDITOR.tools.getStyledSpans(this.cssProperty,this.editor.editable());return CKEDITOR.tools.array.reduce(a,function(a,c){var f=this._.getHexCode(c,this.cssProperty,l.colorList); +a[f]=a[f]||0;a[f]+=1;return a},{},this)},getHexCode:function(a,b,c){var f=a.getStyle(b);return f in c?c[f].substr(1):n.normalizeColor(a.getComputedStyle(b)).toUpperCase()},sortByOccurrencesAscending:function(a,b){var c=[],f;for(f in a){var k={};k[b]=f;k.frequency=a[f];c.push(k)}c.sort(function(a,b){return b.frequency-a.frequency});this._.trimToCapacity(c);return c.reverse()},trimToCapacity:function(a){a.splice(l.getCapacity(this.editor))},addColors:function(a){CKEDITOR.tools.array.forEach(a,function(a){this.addColor(a.colorCode)}, +this)},extractColorBox:function(a){for(var b=0;ba.status||304==a.status||0===a.status||1223==a.status))return null;switch(b){case "text":return a.responseText;case "xml":var c=a.responseXML; +return new CKEDITOR.xml(c&&c.firstChild?c:a.responseText);case "arraybuffer":return a.response;default:return null}}function g(a,b,c){var e=!!b,d=k();if(!d)return null;e&&"text"!==c&&"xml"!==c&&(d.responseType=c);d.open("GET",a,e);e&&(d.onreadystatechange=function(){4==d.readyState&&(b(h(d,c)),d=null)});d.send(null);return e?"":h(d,c)}function l(a,b,c,e,d){var f=k();if(!f)return null;f.open("POST",a,!0);f.onreadystatechange=function(){4==f.readyState&&(e&&e(h(f,d)),f=null)};f.setRequestHeader("Content-type", +c||"application/x-www-form-urlencoded; charset\x3dUTF-8");f.send(b)}return{load:function(a,b,c){return g(a,b,c||"text")},post:function(a,b,c,e){return l(a,b,c,e,"text")},loadXml:function(a,b){return g(a,b,"xml")},loadText:function(a,b){return g(a,b,"text")},loadBinary:function(a,b){return g(a,b,"arraybuffer")}}}()})();(function(){CKEDITOR.plugins.add("templates",{requires:"dialog,ajax",init:function(a){CKEDITOR.dialog.add("templates",CKEDITOR.getUrl(this.path+"dialogs/templates.js"));a.addCommand("templates",new CKEDITOR.dialogCommand("templates"));a.ui.addButton&&a.ui.addButton("Templates",{label:a.lang.templates.button,command:"templates",toolbar:"doctools,10"})}});var c={},f={};CKEDITOR.addTemplates=function(a,d){c[a]=d};CKEDITOR.getTemplates=function(a){return c[a]};CKEDITOR.loadTemplates=function(a,d){for(var e= +[],b=0,c=a.length;bf.group?1:a.orderf.order?1:0})}var k='\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"', +n="";CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(k+=' onkeypress\x3d"return false;"');CKEDITOR.env.gecko&&(k+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;" ondragstart\x3d"return false;"');CKEDITOR.env.ie&&(n='return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26');var k=k+(' onmouseover\x3d"CKEDITOR.tools.callFunction({hoverFn},{index});" onmouseout\x3d"CKEDITOR.tools.callFunction({moveOutFn},{index});" onclick\x3d"'+n+'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',r=CKEDITOR.addTemplate("menuItem",k),p=CKEDITOR.addTemplate("menuArrow", +'\x3cspan class\x3d"cke_menuarrow"\x3e\x3cspan\x3e{label}\x3c/span\x3e\x3c/span\x3e'),c=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 f=CKEDITOR.tools.extend({},b.panel,{css:[CKEDITOR.skin.getPath("editor")],level:this._.level- +1,block:{}}),c=f.block.attributes=f.attributes||{};!c.role&&(c.role="menu");this._.panelDefinition=f},_:{onShow:function(){var a=this.editor.getSelection(),b=a&&a.getStartElement(),f=this.editor.elementPath(),c=this._.listeners;this.removeAll();for(var h=0;h <\/span>/g, +""),a.replace(/<.*?>/g,"")):a.getText()}function d(a,c){var f=a,g=/\s/g,h="p br ol ul li td th div caption body".split(" "),m=!1,k=!1,p,n;do{for(p=b(f,c);!p&&f.getParent();){f=f.getParent();if(-1!==l(h,f.getName())){k=m=!0;break}p=b(f,c)}if(p&&p.getName&&-1!==l(h,p.getName())){m=!0;break}f=p}while(f&&f.getStyle&&("none"==f.getStyle("display")||!f.getText()));for(f||(f=a);f.type!==CKEDITOR.NODE_TEXT;)f=!m||c||k?f.getChild(0):f.getChild(f.getChildCount()-1);for(h=e(f);null!=(k=g.exec(h))&&(n=k.index, +c););if("number"!==typeof n&&!m)return d(f,c);if(m)c?n=0:(g=/([\.\b]*$)/,n=(k=g.exec(h))?k.index:h.length);else if(c&&(n+=1,n>h.length))return d(f);return{node:f,offset:n}}var c=/\b\w+\b/ig,f,g,h,m,k;h=m=k=a.startContainer;for(f=e(h);null!=(g=c.exec(f));)if(g.index+g[0].length>=a.startOffset)return a=g.index,c=g.index+g[0].length,0===g.index&&(g=d(h,!0),m=g.node,a=g.offset),c>=f.length&&(f=d(h),k=f.node,c=f.offset),{startNode:m,startOffset:a,endNode:k,endOffset:c};return null},_filterStyles:function(a){var b= +CKEDITOR.tools.isEmpty,e=[],d,c;for(c=0;cc.width&&(a.resize_minWidth=c.width);a.resize_minHeight>c.height&&(a.resize_minHeight=c.height);CKEDITOR.document.on("mousemove",f);CKEDITOR.document.on("mouseup",k);b.document&&(b.document.on("mousemove",f),b.document.on("mouseup",k));d.preventDefault&&d.preventDefault()});b.on("destroy", +function(){CKEDITOR.tools.removeFunction(q)});b.on("uiSpace",function(a){if("bottom"==a.data.space){var e="";h&&!p&&(e=" cke_resizer_horizontal");!h&&p&&(e=" cke_resizer_vertical");var c='\x3cspan id\x3d"'+r+'" class\x3d"cke_resizer'+e+" cke_resizer_"+g+'" title\x3d"'+CKEDITOR.tools.htmlEncode(b.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+q+', event)"\x3e'+("ltr"==g?"◢":"◣")+"\x3c/span\x3e";"ltr"==g&&"ltr"==e?a.data.html+=c:a.data.html=c+a.data.html}},b,null,100);b.on("maximize", +function(a){b.ui.space("resizer")[a.data==CKEDITOR.TRISTATE_ON?"hide":"show"]()})}}});(function(){function q(a,c){function k(b){b=h.list[b];var e;b.equals(a.editable())||"true"==b.getAttribute("contenteditable")?(e=a.createRange(),e.selectNodeContents(b),e=e.select()):(e=a.getSelection(),e.selectElement(b));CKEDITOR.env.ie&&a.fire("selectionChange",{selection:e,path:new CKEDITOR.dom.elementPath(b)});a.focus()}function l(){m&&m.setHtml('\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e');delete h.list}var n=a.ui.spaceId("path"),m,h=a._.elementsPath,q=h.idBase;c.html+='\x3cspan id\x3d"'+ +n+'_label" class\x3d"cke_voice_label"\x3e'+a.lang.elementspath.eleLabel+'\x3c/span\x3e\x3cspan id\x3d"'+n+'" class\x3d"cke_path" role\x3d"group" aria-labelledby\x3d"'+n+'_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)});h.onClick=k;var v=CKEDITOR.tools.addFunction(k),w=CKEDITOR.tools.addFunction(function(b,e){var g=h.idBase,d;e=new CKEDITOR.dom.event(e);d="rtl"==a.lang.dir;switch(e.getKeystroke()){case d? +39:37:case 9:return(d=CKEDITOR.document.getById(g+(b+1)))||(d=CKEDITOR.document.getById(g+"0")),d.focus(),!1;case d?37:39:case CKEDITOR.SHIFT+9:return(d=CKEDITOR.document.getById(g+(b-1)))||(d=CKEDITOR.document.getById(g+(h.list.length-1))),d.focus(),!1;case 27:return a.focus(),!1;case 13:case 32:return k(b),!1;case CKEDITOR.ALT+121:return a.execCommand("toolbarFocus"),!1}return!0});a.on("selectionChange",function(b){for(var e=[],g=h.list=[],d=[],c=h.filters,p=!0,k=b.data.path.elements,u=k.length;u--;){var f= +k[u],r=0;b=f.data("cke-display-name")?f.data("cke-display-name"):f.data("cke-real-element-type")?f.data("cke-real-element-type"):f.getName();(p=f.hasAttribute("contenteditable")?"true"==f.getAttribute("contenteditable"):p)||f.hasAttribute("contenteditable")||(r=1);for(var t=0;tCKEDITOR.env.version?n.createText("\r"):n.createElement("br"),b.deleteContents(),b.insertNode(a),CKEDITOR.env.needsBrFiller?(n.createText("").insertAfter(a),g&&(k||f.blockLimit).appendBogus(),a.getNext().$.nodeValue="",b.setStartAt(a.getNext(), +CKEDITOR.POSITION_AFTER_START)):b.setStartAt(a,CKEDITOR.POSITION_AFTER_END)),b.collapse(!0),b.select(),b.scrollIntoView()):r(a,e,b,l)}}};v=CKEDITOR.plugins.enterkey;u=v.enterBr;r=v.enterBlock;w=/^h[1-6]$/})();(function(){function k(a,f){var g={},c=[],e={nbsp:" ",shy:"­",gt:"\x3e",lt:"\x3c",amp:"\x26",apos:"'",quot:'"'};a=a.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g,function(a,b){var d=f?"\x26"+b+";":e[b];g[d]=f?e[b]:"\x26"+b+";";c.push(d);return""});a=a.replace(/,$/,"");if(!f&&a){a=a.split(",");var b=document.createElement("div"),d;b.innerHTML="\x26"+a.join(";\x26")+";";d=b.innerHTML;b=null;for(b=0;ba&&(a=640);420>b&&(b=420);var f=parseInt((window.screen.height-b)/2,10),g=parseInt((window.screen.width-a)/2,10);d=(d||"location\x3dno,menubar\x3dno,toolbar\x3dno,dependent\x3dyes,minimizable\x3dno,modal\x3dyes,alwaysRaised\x3dyes,resizable\x3dyes,scrollbars\x3dyes")+",width\x3d"+ +a+",height\x3d"+b+",top\x3d"+f+",left\x3d"+g;var c=window.open("",null,d,!0);if(!c)return!1;try{-1==navigator.userAgent.toLowerCase().indexOf(" chrome/")&&(c.moveTo(g,f),c.resizeTo(a,b)),c.focus(),c.location.href=e}catch(h){window.open(e,null,d,!0)}return!0}});(function(){function k(a){this.editor=a;this.loaders=[]}function l(a,c,b){var d=a.config.fileTools_defaultFileName;this.editor=a;this.lang=a.lang;"string"===typeof c?(this.data=c,this.file=n(this.data),this.loaded=this.total=this.file.size):(this.data=null,this.file=c,this.total=this.file.size,this.loaded=0);b?this.fileName=b:this.file.name?this.fileName=this.file.name:(a=this.file.type.split("/"),d&&(a[0]=d),this.fileName=a.join("."));this.uploaded=0;this.responseData=this.uploadTotal=null;this.status= +"created";this.abort=function(){this.changeStatus("abort")}}function n(a){var c=a.match(m)[1];a=a.replace(m,"");a=atob(a);var b=[],d,f,g,e;for(d=0;dd.status||299h.height-c.bottom?e("pin"):e("bottom"),d=h.width/2,d=l.floatSpacePreferRight?"right":0n.width?"rtl"==l.contentsLangDirection? +"right":"left":d-c.left>c.right-d?"left":"right",n.width>h.width?(d="left",f=0):(f="left"==d?0h.width&&(d="left"==d?"right":"left",f=0)),b.setStyle(d,w(("pin"==m?u:p)+f+("pin"==m?0:"left"==d?v:-v)))):(m="pin",e("pin"),t(d))}}}();if(p){var k=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.applicationTitle?' aria-labelledby\x3d"cke_{name}_arialbl"':" ")+"\x3e"+(a.applicationTitle?'\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'),b=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(k.output({content:p, +id:a.id,langDir:a.lang.dir,langCode:a.langCode,name:a.name,style:"display:none;z-index:"+(l.baseFloatZIndex-1),topId:a.ui.spaceId("top"),voiceLabel:a.applicationTitle}))),u=CKEDITOR.tools.eventsBuffer(500,t),e=CKEDITOR.tools.eventsBuffer(100,t);b.unselectable();b.on("mousedown",function(a){a=a.data;a.getTarget().hasAscendant("a",1)||a.preventDefault()});a.on("focus",function(b){t(b);a.on("change",u.input);g.on("scroll",e.input);g.on("resize",e.input)});a.on("blur",function(){b.hide();a.removeListener("change", +u.input);g.removeListener("scroll",e.input);g.removeListener("resize",e.input)});a.on("destroy",function(){g.removeListener("scroll",e.input);g.removeListener("resize",e.input);b.clearCustomData();b.remove()});a.focusManager.hasFocus&&b.show();a.focusManager.add(b,1)}}var g=CKEDITOR.document.getWindow(),w=CKEDITOR.tools.cssLength;CKEDITOR.plugins.add("floatingspace",{init:function(a){a.on("loaded",function(){k(this)},null,null,20)}})})();CKEDITOR.plugins.add("listblock",{requires:"panel",onLoad:function(){var f=CKEDITOR.addTemplate("panel-list",'\x3cul role\x3d"presentation" class\x3d"cke_panel_list"\x3e{items}\x3c/ul\x3e'),g=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'), +h=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'),k=/\'/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 c=b.attributes||(b.attributes={});(this.multiSelect=!!b.multiSelect)&& +(c["aria-multiselectable"]=!0);!c.role&&(c.role="listbox");this.base.apply(this,arguments);this.element.setAttribute("role",c.role);c=this.keys;c[40]="next";c[9]="next";c[38]="prev";c[CKEDITOR.SHIFT+9]="prev";c[32]=CKEDITOR.env.ie?"mouseup":"click";CKEDITOR.env.ie&&(c[13]="mouseup");this._.pendingHtml=[];this._.pendingList=[];this._.items={};this._.groups={}},_:{close:function(){if(this._.started){var a=f.output({items:this._.pendingList.join("")});this._.pendingList=[];this._.pendingHtml.push(a); +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,b,c){var d=CKEDITOR.tools.getNextId();this._.started||(this._.started=1,this._.size=this._.size||0);this._.items[a]=d;var e;e=CKEDITOR.tools.htmlEncodeAttr(a).replace(k,"\\'");a={id:d,val:e,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(c||a),text:b||a};this._.pendingList.push(g.output(a))},startGroup:function(a){this._.close();var b=CKEDITOR.tools.getNextId();this._.groups[a]=b;this._.pendingHtml.push(h.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,c=this.element.getDocument(),d;for(d in a)c.getById(a[d]).setStyle("display","");for(var e in b)a=c.getById(b[e]),d=a.getNext(),a.setStyle("display",""),d&&"ul"==d.getName()&&d.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 c=b.getById(a);c.removeClass("cke_selected");b.getById(a+"_option").removeAttribute("aria-selected"); +this.onUnmark&&this.onUnmark(c)},unmarkAll:function(){var a=this._.items,b=this.element.getDocument(),c;for(c in a){var d=a[c];b.getById(d).removeClass("cke_selected");b.getById(d+"_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"),c,d=-1;if(a)for(c=this.element.getDocument().getById(this._.items[a]).getFirst();a= +b.getItem(++d);){if(a.equals(c)){this._.focusIndex=d;break}}else this.element.focus();c&&setTimeout(function(){c.focus()},0)}}})}});CKEDITOR.plugins.add("richcombo",{requires:"floatpanel,listblock,button",beforeInit:function(e){e.ui.addHandler(CKEDITOR.UI_RICHCOMBO,CKEDITOR.ui.richCombo.handler)}}); +(function(){var e='\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"',h="";CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(e+=' onkeypress\x3d"return false;"'); +CKEDITOR.env.gecko&&(e+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');CKEDITOR.env.ie&&(h='return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26');var e=e+(' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" onclick\x3d"'+h+'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"),m=CKEDITOR.addTemplate("combo",e);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 b=[];this.render(a,b);return b.join("")},render:function(a,b){function c(){if(this.getState()!=CKEDITOR.TRISTATE_ON){var b=this.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED;a.readOnly&&!this.readOnly&&(b=CKEDITOR.TRISTATE_DISABLED);this.setState(b);this.setValue("");b!=CKEDITOR.TRISTATE_DISABLED&&this.refresh&&this.refresh()}} +var l=CKEDITOR.env,g,f,d="cke_"+this.id,e=CKEDITOR.tools.addFunction(function(b){f&&(a.unlockSelection(1),f=0);g.execute(b)},this),k=this;g={id:d,combo:this,focus:function(){CKEDITOR.document.getById(d).getChild(1).focus()},execute:function(b){var c=k._;if(c.state!=CKEDITOR.TRISTATE_DISABLED)if(k.createPanel(a),c.on)c.panel.hide();else{k.commit();var d=k.getValue();d?c.list.mark(d):c.list.unmarkAll();c.panel.showBlock(k.id,new CKEDITOR.dom.element(b),4)}},clickFn:e};this._.listeners.push(a.on("activeFilterChange", +c,this));this._.listeners.push(a.on("mode",c,this));this._.listeners.push(a.on("selectionChange",c,this));!this.readOnly&&this._.listeners.push(a.on("readOnly",c,this));var h=CKEDITOR.tools.addFunction(function(a,b){a=new CKEDITOR.dom.event(a);var c=a.getKeystroke();switch(c){case 13:case 32:case 40:CKEDITOR.tools.callFunction(e,b);break;default:g.onkey(g,c)}a.preventDefault()}),n=CKEDITOR.tools.addFunction(function(){g.onfocus&&g.onfocus()});f=0;g.keyDownFn=h;l={id:d,name:this.name||this.command, +label:this.label,title:this.title,cls:this.className||"",titleJs:l.gecko&&!l.hc?"":(this.title||"").replace("'",""),keydownFn:h,focusFn:n,clickFn:e};m.output(l,b);if(this.onRender)this.onRender();return g},createPanel:function(a){if(!this._.panel){var b=this._.panelDefinition,c=this._.panelDefinition.block,e=b.parent||CKEDITOR.document.getBody(),g="cke_combopanel__"+this.name,f=new CKEDITOR.ui.floatPanel(a,e,b),b=f.addListBlock(this.id,c),d=this;f.onShow=function(){this.element.addClass(g);d.setState(CKEDITOR.TRISTATE_ON); +d._.on=1;d.editorFocus&&!a.focusManager.hasFocus&&a.focus();if(d.onOpen)d.onOpen()};f.onHide=function(b){this.element.removeClass(g);d.setState(d.modes&&d.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);d._.on=0;if(!b&&d.onClose)d.onClose()};f.onEscape=function(){f.hide(1)};b.onClick=function(a,b){d.onClick&&d.onClick.call(d,a,b);f.hide()};this._.panel=f;this._.list=b;f.getBlock(this.id).onHide=function(){d._.on=0;d.setState(CKEDITOR.TRISTATE_OFF)};this.init&&this.init()}},setValue:function(a, +b){this._.value=a;var c=this.document.getById("cke_"+this.id+"_text");c&&(a||b?c.removeClass("cke_combo_inlinelabel"):(b=this.label,c.addClass("cke_combo_inlinelabel")),c.setText("undefined"!=typeof b?b:a));var c="undefined"!=typeof b?b:a,e=this.label,c=c===e?c:c+", "+e;(e=this.document.getById("cke_"+this.id+"_label"))&&e.setText(c)},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,b,c){this._.items[a]=c||a;this._.list.add(a,b,c)},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 b=this.document.getById("cke_"+this.id),c=b.getElementsByTag("a").getItem(0);b.setState(a,"cke_combo");a==CKEDITOR.TRISTATE_DISABLED? +b.setAttribute("aria-disabled",!0):b.removeAttribute("aria-disabled");c&&c.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 b in this._.items)if(a({value:b,text:this._.items[b]})){this.setValue(b);break}}},statics:{handler:{create:function(a){return new CKEDITOR.ui.richCombo(a)}}}});CKEDITOR.ui.prototype.addRichCombo=function(a,b){this.add(a,CKEDITOR.UI_RICHCOMBO,b)}})();(function(){function k(a,b){var c=a.config,e=b.lang,d=new CKEDITOR.style(b.styleDefinition),f=new l({entries:b.entries,styleVariable:b.styleVariable,styleDefinition:b.styleDefinition}),g;a.addCommand(b.commandName,{exec:function(a,b){var c=b.newStyle,d=b.oldStyle,e=a.getSelection().getRanges()[0],f=void 0===c;if(d||c)d&&e.collapsed&&m({editor:a,range:e,style:d}),f?a.removeStyle(d):(d&&!n(d,c)&&a.removeStyle(d),a.applyStyle(c))},refresh:function(a,b){d.checkApplicable(b,a,a.activeFilter)||this.setState(CKEDITOR.TRISTATE_DISABLED)}}); +g=a.getCommand(b.commandName);a.ui.addRichCombo(b.comboName,{label:e.label,title:e.panelTitle,command:b.commandName,toolbar:"styles,"+b.order,defaultValue:"cke-default",allowedContent:d,requiredContent:d,contentTransformations:"span"===b.styleDefinition.element?[[{element:"font",check:"span",left:function(a){return!!a.attributes.size||!!a.attributes.align||!!a.attributes.face},right:function(a){var b=" x-small small medium large x-large xx-large 48px".split(" ");a.name="span";a.attributes.size&&(a.styles["font-size"]= +b[a.attributes.size],delete a.attributes.size);a.attributes.align&&(a.styles["text-align"]=a.attributes.align,delete a.attributes.align);a.attributes.face&&(a.styles["font-family"]=a.attributes.face,delete a.attributes.face)}}]]:null,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(c.contentsCss),multiSelect:!1,attributes:{"aria-label":e.panelTitle}},init:function(){var b="("+a.lang.common.optionDefault+")";this.startGroup(e.panelTitle);this.add(this.defaultValue,b,b);f.addToCombo(this)},onClick:function(c){var d= +this.getValue();a.focus();a.fire("saveSnapshot");a.execCommand(b.commandName,{newStyle:f.getStyle(c),oldStyle:f.getStyle(d)});a.fire("saveSnapshot")},onRender:function(){a.on("selectionChange",function(c){var d=this.getValue();(c=f.getMatchingValue(a,c.data.path))?c!=d&&this.setValue(c):this.setValue("",b.defaultLabel)},this);g.on("state",function(){this.setState(g.state)},this)},refresh:function(){this.setState(g.state)}})}function n(a,b){if(!(a instanceof CKEDITOR.style&&b instanceof CKEDITOR.style))return!1; +var c=function(a,b){var c=a.getDefinition().attributes,e=b.getDefinition().attributes;return CKEDITOR.tools.objectCompare(c,e)}(a,b),e=function(a,b){return CKEDITOR.style.getStyleText(a.getDefinition())===CKEDITOR.style.getStyleText(b.getDefinition())}(a,b);return c&&e}function m(a){var b=a.editor,c=a.range,e=a.style,d,f,g;d=b.elementPath();if(a=d.contains(function(a){return e.checkElementRemovable(a)})){f=c.checkBoundaryOfElement(a,CKEDITOR.START);g=c.checkBoundaryOfElement(a,CKEDITOR.END);if(f&& +g){for(f=c.createBookmark();d=a.getFirst();)d.insertBefore(a);a.remove();c.moveToBookmark(f)}else f||g?c.moveToPosition(a,f?CKEDITOR.POSITION_BEFORE_START:CKEDITOR.POSITION_AFTER_END):(c.splitElement(a),c.moveToPosition(a,CKEDITOR.POSITION_AFTER_END)),h(c,d.elements.slice(),a);b.getSelection().selectRanges([c])}}function h(a,b,c){var e=b.pop();if(e){if(c)return h(a,b,e.equals(c)?null:c);c=e.clone();a.insertNode(c);a.moveToPosition(c,CKEDITOR.POSITION_AFTER_START);h(a,b)}}var l=CKEDITOR.tools.createClass({$:function(a){var b= +a.entries.split(";");this._.data={};this._.names=[];for(var c=0;cCKEDITOR.env.version&&b.enterMode!=CKEDITOR.ENTER_DIV&&e("div");if(CKEDITOR.env.webkit||CKEDITOR.env.ie&&10this.$.offsetHeight){var c=b.createRange();c[33==d?"moveToElementEditStart":"moveToElementEditEnd"](this);c.select();a.data.preventDefault()}});CKEDITOR.env.ie&&this.attachListener(c,"blur",function(){try{c.$.selection.empty()}catch(a){}});CKEDITOR.env.iOS&&this.attachListener(c,"touchend",function(){a.focus()});f=b.document.getElementsByTag("title").getItem(0); +f.data("cke-title",f.getText());CKEDITOR.env.ie&&(b.document.$.title=this._.docTitle);CKEDITOR.tools.setTimeout(function(){"unloaded"==this.status&&(this.status="ready");b.fire("contentDom");this._.isPendingFocus&&(b.focus(),this._.isPendingFocus=!1);setTimeout(function(){b.fire("dataReady")},0)},0,this)}}function w(a){function e(){var d;a.editable().attachListener(a,"selectionChange",function(){var c=a.getSelection().getSelectedElement();c&&(d&&(d.detachEvent("onresizestart",b),d=null),c.$.attachEvent("onresizestart", +b),d=c.$)})}function b(a){a.returnValue=!1}if(CKEDITOR.env.gecko)try{var c=a.document.$;c.execCommand("enableObjectResizing",!1,!a.config.disableObjectResizing);c.execCommand("enableInlineTableEditing",!1,!a.config.disableNativeTableHandles)}catch(f){}else CKEDITOR.env.ie&&11>CKEDITOR.env.version&&a.config.disableObjectResizing&&e()}function x(){var a=[];if(8<=CKEDITOR.document.$.documentMode){a.push("html.CSS1Compat [contenteditable\x3dfalse]{min-height:0 !important}");var e=[],b;for(b in CKEDITOR.dtd.$removeEmpty)e.push("html.CSS1Compat "+ +b+"[contenteditable\x3dfalse]");a.push(e.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 l;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 b(b){b&&b.removeListener();if(!a.isDestroyed()&&!a.isDetached()&&(a.editable(new l(a,g.getFrameDocument().getBody())),a.setData(a.getData(1),e),t)){if(u)a.on("mode",c,{iframe:g,editor:a,callback:e});a.on("mode",function(){a.status="ready"});f()}}function c(a){a&&a.removeListener();g.on("load",function(){p&&(p=!1,d())})}function f(){m=new MutationObserver(function(b){for(var c=0;c/,'\x3cstyle data-cke-temp\x3d"1"\x3e');f||(h+=CKEDITOR.tools.buildStyleHtml(b.config.contentsCss));var g=c.baseHref?'\x3cbase href\x3d"'+c.baseHref+'" data-cke-temp\x3d"1" /\x3e':"";f&&(a=a.replace(/]*>/i,function(a){b.docType= +d=a;return""}).replace(/<\?xml\s[^\?]*\?>/i,function(a){b.xmlDeclaration=a;return""}));a=b.dataProcessor.toHtml(a);f?(/]/.test(a)||(a="\x3cbody\x3e"+a),/]/.test(a)||(a="\x3chtml\x3e"+a+"\x3c/html\x3e"),/]/.test(a)?/]/.test(a)||(a=a.replace(/]*>/,"$\x26\x3ctitle\x3e\x3c/title\x3e")):a=a.replace(/]*>/,"$\x26\x3chead\x3e\x3ctitle\x3e\x3c/title\x3e\x3c/head\x3e"),g&&(a=a.replace(/]*?>/,"$\x26"+g)),a=a.replace(/<\/head\s*>/,h+"$\x26"),a= +d+a):a=c.docType+'\x3chtml dir\x3d"'+c.contentsLangDirection+'" lang\x3d"'+(c.contentsLanguage||b.langCode)+'"\x3e\x3chead\x3e\x3ctitle\x3e'+this._.docTitle+"\x3c/title\x3e"+g+h+"\x3c/head\x3e\x3cbody"+(c.bodyId?' id\x3d"'+c.bodyId+'"':"")+(c.bodyClass?' class\x3d"'+c.bodyClass+'"':"")+"\x3e"+a+"\x3c/body\x3e\x3c/html\x3e";CKEDITOR.env.gecko&&(a=a.replace(/CKEDITOR.env.version&&(a=a.replace(/]*>/,"$\x26\x3c!-- cke-content-start --\x3e"))); +a=a.replace(/CKEDITOR.env.version&&(c+='\x3cscript id\x3d"cke_shimscrpt"\x3ewindow.parent.CKEDITOR.tools.enableHtml5Elements(document)\x3c/script\x3e');g&&CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(c+='\x3cscript id\x3d"cke_basetagscrpt"\x3evar baseTag \x3d document.querySelector( "base" );baseTag.href \x3d baseTag.href;\x3c/script\x3e');a=a.replace(/(?=\s*<\/(:?head)>)/, +c);this.clearCustomData();this.clearListeners();b.fire("contentDomUnload");var l=this.getDocument();try{l.write(a)}catch(k){setTimeout(function(){l.write(a)},0)}}},getData:function(a){if(a)return this.getHtml();a=this.editor;var e=a.config,b=e.fullPage,c=b&&a.docType,f=b&&a.xmlDeclaration,d=this.getDocument(),d=b?d.getDocumentElement().getOuterHtml():d.getBody().getHtml();CKEDITOR.env.gecko&&e.enterMode!=CKEDITOR.ENTER_BR&&(d=d.replace(/
(?=\s*(:?$|<\/body>))/,""));b&&(d=d.replace(/(a+=l?1:-1))return;a=Math.min(a,c.length);a=Math.max(a,0);b.$.className=CKEDITOR.tools.ltrim(b.$.className.replace(this.classNameRegex,""));0a)return;a=Math.max(a, +0);a=Math.ceil(a/g)*g;b.setStyle(c,a?a+(d.config.indentUnit||"px"):"");""===b.getAttribute("style")&&b.removeAttribute("style")}CKEDITOR.dom.element.setMarker(this.database,b,"indent_processed",1)}}function m(b,c){return"ltr"==(c||b.getComputedStyle("direction"))?"margin-left":"margin-right"}var h=CKEDITOR.dtd.$listItem,p=CKEDITOR.dtd.$list,k=CKEDITOR.TRISTATE_DISABLED,n=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentblock",{requires:"indent",init:function(b){function c(){a.specificDefinition.apply(this, +arguments);this.allowedContent={"div h1 h2 h3 h4 h5 h6 ol p pre ul":{propertiesOnly:!0,styles:d?null:"margin-left,margin-right",classes:d||null}};this.contentTransformations=[["div: splitMarginShorthand"],["h1: splitMarginShorthand"],["h2: splitMarginShorthand"],["h3: splitMarginShorthand"],["h4: splitMarginShorthand"],["h5: splitMarginShorthand"],["h6: splitMarginShorthand"],["ol: splitMarginShorthand"],["p: splitMarginShorthand"],["pre: splitMarginShorthand"],["ul: splitMarginShorthand"]];this.enterBr&& +(this.allowedContent.div=!0);this.requiredContent=(this.enterBr?"div":"p")+(d?"("+d.join(",")+")":"{margin-left}");this.jobs={20:{refresh:function(a,b){var e=b.block||b.blockLimit;if(!e.is(h))var c=e.getAscendant(h),e=c&&b.contains(c)||e;e.is(h)&&(e=e.getParent());if(this.enterBr||this.getContext(b)){if(d){var c=d,e=e.$.className.match(this.classNameRegex),f=this.isIndent,c=e?f?e[1]!=c.slice(-1):!0:f;return c?n:k}return this.isIndent?n:e?CKEDITOR[0>=(parseInt(e.getStyle(m(e)),10)||0)?"TRISTATE_DISABLED": +"TRISTATE_OFF"]:k}return k},exec:function(a){var b=a.getSelection(),b=b&&b.getRanges()[0],c;if(c=a.elementPath().contains(p))f.call(this,c,d);else for(b=b.createIterator(),a=a.config.enterMode,b.enforceRealBlocks=!0,b.enlargeBr=a!=CKEDITOR.ENTER_BR;c=b.getNextParagraph(a==CKEDITOR.ENTER_P?"p":"div");)c.isReadOnly()||f.call(this,c,d);return!0}}}}var a=CKEDITOR.plugins.indent,d=b.config.indentClasses;a.registerCommands(b,{indentblock:new c(b,"indentblock",!0),outdentblock:new c(b,"outdentblock")}); +CKEDITOR.tools.extend(c.prototype,a.specificDefinition.prototype,{context:{div:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,p:1,pre:1,table:1},classNameRegex:d?new RegExp("(?:^|\\s+)("+d.join("|")+")(?\x3d$|\\s)"):null})}})})();(function(){function w(f){function g(b){for(var e=c.startContainer,a=c.endContainer;e&&!e.getParent().equals(b);)e=e.getParent();for(;a&&!a.getParent().equals(b);)a=a.getParent();if(!e||!a)return!1;for(var d=[],h=!1;!h;)e.equals(a)&&(h=!0),d.push(e),e=e.getNext();if(1>d.length)return!1;e=b.getParents(!0);for(a=0;am;a++)h[a].indent+=e;e=CKEDITOR.plugins.list.arrayToList(h,q,null,f.config.enterMode,b.getDirection());if(!k.isIndent){var t;if((t=b.getParent())&&t.is("li"))for(var d=e.listNode.getChildren(), +r=[],l,a=d.count()-1;0<=a;a--)(l=d.getItem(a))&&l.is&&l.is("li")&&r.push(l)}e&&e.listNode.replace(b);if(r&&r.length)for(a=0;ag.length)){f=g[g.length-1].getNext();b=e.createElement(this.type);for(d.push(b);g.length;)d=g.shift(),a=e.createElement("li"),c=d,c.is("pre")||M.test(c.getName())||"false"==c.getAttribute("contenteditable")?d.appendTo(a):(d.copyAttributes(a),h&&d.getDirection()&&(a.removeStyle("direction"), +a.removeAttribute("dir")),d.moveChildren(a),d.remove()),a.appendTo(b);h&&k&&b.setAttribute("dir",h);f?b.insertBefore(f):b.appendTo(l)}}function N(a,l,d){function f(b){if(!(!(c=k[b?"getFirst":"getLast"]())||c.is&&c.isBlockBoundary()||!(p=l.root[b?"getPrevious":"getNext"](CKEDITOR.dom.walker.invisible(!0)))||p.is&&p.isBlockBoundary({br:1})))a.document.createElement("br")[b?"insertBefore":"insertAfter"](c)}for(var e=CKEDITOR.plugins.list.listToArray(l.root,d),g=[],b=0;be[b-1].indent+1){g=e[b-1].indent+1-e[b].indent;for(h=e[b].indent;e[b]&&e[b].indent>=h;)e[b].indent+=g,b++;b--}var k=CKEDITOR.plugins.list.arrayToList(e,d,null,a.config.enterMode,l.root.getAttribute("dir")).listNode,c,p; +f(!0);f();k.replace(l.root);a.fire("contentDomInvalidated")}function C(a,l){this.name=a;this.context=this.type=l;this.allowedContent=l+" li";this.requiredContent=l}function F(a,l,d,f){for(var e,g;e=a[f?"getLast":"getFirst"](O);)(g=e.getDirection(1))!==l.getDirection(1)&&e.setAttribute("dir",g),e.remove(),d?e[f?"insertBefore":"insertAfter"](d):l.append(e,f),d=e}function G(a){function l(d){var f=a[d?"getPrevious":"getNext"](t);f&&f.type==CKEDITOR.NODE_ELEMENT&&f.is(a.getName())&&(F(a,f,null,!d),a.remove(), +a=f)}l();l(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 D(a,l,d){a.fire("saveSnapshot");d.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);var f=d.extractContents();l.trim(!1,!0);var e=l.createBookmark(),g=new CKEDITOR.dom.elementPath(l.startContainer),b=g.block,g=g.lastElement.getAscendant("li",1)||b,h=new CKEDITOR.dom.elementPath(d.startContainer),k=h.contains(CKEDITOR.dtd.$listItem), +h=h.contains(CKEDITOR.dtd.$list);b?(b=b.getBogus())&&b.remove():h&&(b=h.getPrevious(t))&&z(b)&&b.remove();(b=f.getLast())&&b.type==CKEDITOR.NODE_ELEMENT&&b.is("br")&&b.remove();(b=l.startContainer.getChild(l.startOffset))?f.insertBefore(b):l.startContainer.append(f);k&&(f=A(k))&&(g.contains(k)?(F(f,k.getParent(),k),f.remove()):g.append(f));for(;d.checkStartOfBlock()&&d.checkEndOfBlock();){h=d.startPath();f=h.block;if(!f)break;f.is("li")&&(g=f.getParent(),f.equals(g.getLast(t))&&f.equals(g.getFirst(t))&& +(f=g));d.moveToPosition(f,CKEDITOR.POSITION_BEFORE_START);f.remove()}d=d.clone();f=a.editable();d.setEndAt(f,CKEDITOR.POSITION_BEFORE_END);d=new CKEDITOR.dom.walker(d);d.evaluator=function(a){return t(a)&&!z(a)};(d=d.next())&&d.type==CKEDITOR.NODE_ELEMENT&&d.getName()in CKEDITOR.dtd.$list&&G(d);l.moveToBookmark(e);l.select();a.fire("saveSnapshot")}function A(a){return(a=a.getLast(t))&&a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in u?a:null}var u={ol:1,ul:1},P=CKEDITOR.dom.walker.whitespaces(),I=CKEDITOR.dom.walker.bookmark(), +t=function(a){return!(P(a)||I(a))},z=CKEDITOR.dom.walker.bogus();CKEDITOR.plugins.list={listToArray:function(a,l,d,f,e){if(!u[a.getName()])return[];f||(f=0);d||(d=[]);for(var g=0,b=a.getChildCount();g=b.$.documentMode&&m.append(b.createText(" ")),m.append(c.listNode),c=c.nextIndex;else if(-1==q.indent&&!d&&g){u[g.getName()]?(m=q.element.clone(!1,!0),n!=g.getDirection(1)&&m.setAttribute("dir",n)):m=new CKEDITOR.dom.documentFragment(b);var k=g.getDirection(1)!=n,w=q.element,B=w.getAttribute("class"),E=w.getAttribute("style"),J=m.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(f!=CKEDITOR.ENTER_BR||k||E||B),v,z=q.contents.length,x;for(g=0;gc&&at.version?" ":J,f=a.hotNode&&a.hotNode.getText()==d&&a.element.equals(a.hotNode)&&a.lastCmdDirection===!!c;S(a,function(d){f&&a.hotNode&&a.hotNode.remove();d[c?"insertAfter":"insertBefore"](b);d.setAttributes({"data-cke-magicline-hot":1,"data-cke-magicline-dir":!!c});a.lastCmdDirection=!!c});t.ie||a.enterMode==CKEDITOR.ENTER_BR||a.hotNode.scrollIntoView();a.line.detach()}return function(b){b=b.getSelection().getStartElement(); +var e;b=b.getAscendant(Z,1);if(!aa(a,b)&&b&&!b.equals(a.editable)&&!b.contains(a.editable)){(e=P(b))&&"false"==e.getAttribute("contenteditable")&&(b=e);a.element=b;e=w(a,b,!c);var f;n(e)&&e.is(a.triggers)&&e.is(ma)&&(!w(a,e,!c)||(f=w(a,e,!c))&&n(f)&&f.is(a.triggers))?d(e):(f=O(a,b),n(f)&&(w(a,f,!c)?(b=w(a,f,!c))&&n(b)&&b.is(a.triggers)&&d(f):d(f)))}}}()}}function A(a,c){if(!c||c.type!=CKEDITOR.NODE_ELEMENT||!c.$)return!1;var d=a.line;return d.wrap.equals(c)||d.wrap.contains(c)}function n(a){return a&& +a.type==CKEDITOR.NODE_ELEMENT&&a.$}function u(a){if(!n(a))return!1;var c;(c=ba(a))||(n(a)?(c={left:1,right:1,center:1},c=!(!c[a.getComputedStyle("float")]&&!c[a.getAttribute("align")])):c=!1);return c}function ba(a){return!!{absolute:1,fixed:1}[a.getComputedStyle("position")]}function L(a,c){return n(c)?c.is(a.triggers):null}function aa(a,c){if(!c)return!1;for(var d=c.getParents(1),b=d.length;b--;)for(var e=a.tabuList.length;e--;)if(d[b].hasAttribute(a.tabuList[e]))return!0;return!1}function na(a, +c,d){c=c[d?"getLast":"getFirst"](function(b){return a.isRelevant(b)&&!b.is(oa)});if(!c)return!1;r(a,c);return d?c.size.top>a.mouse.y:c.size.bottom(a.inInlineMode?b.editable.top+b.editable.height/2:Math.min(b.editable.height,b.pane.height)/2),c=c[f?"getLast":"getFirst"](function(a){return!(E(a)||F(a))});if(!c)return null;A(a,c)&&(c=a.line.wrap[f?"getPrevious":"getNext"](function(a){return!(E(a)||F(a))})); +if(!n(c)||u(c)||!L(a,c))return null;r(a,c);return!f&&0<=c.size.top&&q(d.y,0,c.size.top+e)?(a=a.inInlineMode||0===b.scroll.y?C:x,new z([null,c,I,M,a])):f&&c.size.bottom<=b.pane.height&&q(d.y,c.size.bottom-e,b.pane.height)?(a=a.inInlineMode||q(c.size.bottom,b.pane.height-e,b.pane.height)?D:x,new z([c,null,da,M,a])):null}function ea(a){var c=a.mouse,d=a.view,b=a.triggerOffset,e=O(a);if(!e)return null;r(a,e);var b=Math.min(b,0|e.size.outerHeight/2),f=[],k,h;if(q(c.y,e.size.top-1,e.size.top+b))h=!1;else if(q(c.y, +e.size.bottom-b,e.size.bottom+1))h=!0;else return null;if(u(e)||na(a,e,h)||e.getParent().is(fa))return null;var g=w(a,e,!h);if(g){if(g&&g.type==CKEDITOR.NODE_TEXT)return null;if(n(g)){if(u(g)||!L(a,g)||g.getParent().is(fa))return null;f=[g,e][h?"reverse":"concat"]().concat([T,M])}}else e.equals(a.editable[h?"getLast":"getFirst"](a.isRelevant))?(H(a),h&&q(c.y,e.size.bottom-b,d.pane.height)&&q(e.size.bottom,d.pane.height-b,d.pane.height)?k=D:q(c.y,0,e.size.top+b)&&(k=C)):k=x,f=[null,e][h?"reverse": +"concat"]().concat([h?da:I,M,k,e.equals(a.editable[h?"getLast":"getFirst"](a.isRelevant))?h?D:C:x]);return 0 in f?new z(f):null}function U(a,c,d,b){for(var e=c.getDocumentPosition(),f={},k={},h={},g={},l=y.length;l--;)f[y[l]]=parseInt(c.getComputedStyle.call(c,"border-"+y[l]+"-width"),10)||0,h[y[l]]=parseInt(c.getComputedStyle.call(c,"padding-"+y[l]),10)||0,k[y[l]]=parseInt(c.getComputedStyle.call(c,"margin-"+y[l]),10)||0;d&&!b||N(a,b);g.top=e.y-(d?0:a.view.scroll.y);g.left=e.x-(d?0:a.view.scroll.x); +g.outerWidth=c.$.offsetWidth;g.outerHeight=c.$.offsetHeight;g.height=g.outerHeight-(h.top+h.bottom+f.top+f.bottom);g.width=g.outerWidth-(h.left+h.right+f.left+f.right);g.bottom=g.top+g.outerHeight;g.right=g.left+g.outerWidth;a.inInlineMode&&(g.scroll={top:c.$.scrollTop,left:c.$.scrollLeft});return v({border:f,padding:h,margin:k,ignoreScroll:d},g,!0)}function r(a,c,d){if(!n(c))return c.size=null;if(!c.size)c.size={};else if(c.size.ignoreScroll==d&&c.size.date>new Date-ga)return null;return v(c.size, +U(a,c,d),{date:+new Date},!0)}function H(a,c){a.view.editable=U(a,a.editable,c,!0)}function N(a,c){a.view||(a.view={});var d=a.view;if(!(!c&&d&&d.date>new Date-ga)){var b=a.win,d=b.getScrollPosition(),b=b.getViewPaneSize();v(a.view,{scroll:{x:d.x,y:d.y,width:a.doc.$.documentElement.scrollWidth-b.width,height:a.doc.$.documentElement.scrollHeight-b.height},pane:{width:b.width,height:b.height,bottom:b.height+d.y},date:+new Date},!0)}}function pa(a,c,d,b){for(var e=b,f=b,k=0,h=!1,g=!1,l=a.view.pane.height, +p=a.mouse;p.y+ke.left-f.x&&de.top-f.y&&cCKEDITOR.env.version,B=CKEDITOR.dtd,K={},I=128,da=64,T=32,M=16,C=4,D=2,x=1,J=" ",fa=B.$listItem,oa=B.$tableContent,ma=v({},B.$nonEditable,B.$empty),Z=B.$block,ga=100,Q="width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;", +X=Q+"border-color:transparent;display:block;border-style:solid;",W="\x3cspan\x3e"+J+"\x3c/span\x3e";K[CKEDITOR.ENTER_BR]="br";K[CKEDITOR.ENTER_P]="p";K[CKEDITOR.ENTER_DIV]="div";z.prototype={set:function(a,c,d){this.properties=a+c+(d||x);return this},is:function(a){return(this.properties&a)==a}};var ha=function(){function a(a,d){var b=a.$.elementFromPoint(d.x,d.y);return b&&b.nodeType?new CKEDITOR.dom.element(b):null}return function(c,d,b){if(!c.mouse)return null;var e=c.doc,f=c.line.wrap;b=b||c.mouse; +var k=a(e,b);d&&A(c,k)&&(f.hide(),k=a(e,b),f.show());return!k||k.type!=CKEDITOR.NODE_ELEMENT||!k.$||t.ie&&9>t.version&&!c.boundary.equals(k)&&!c.boundary.contains(k)?null:k}}(),E=CKEDITOR.dom.walker.whitespaces(),F=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),ia=function(){function a(a){var b=a.element,e,f,k;if(!n(b)||b.contains(a.editable)||b.isReadOnly())return null;k=pa(a,function(a,b){return!b.equals(a)},function(a,b){return ha(a,!0,b)},b);e=k.upper;f=k.lower;if(V(a,e,f))return k.set(T, +8);if(e&&b.contains(e))for(;!e.getParent().equals(b);)e=e.getParent();else e=b.getFirst(function(b){return c(a,b)});if(f&&b.contains(f))for(;!f.getParent().equals(b);)f=f.getParent();else f=b.getLast(function(b){return c(a,b)});if(!e||!f)return null;r(a,e);r(a,f);if(!q(a.mouse.y,e.size.top,f.size.bottom))return null;for(var b=Number.MAX_VALUE,h,g,l,p;f&&!f.equals(e)&&(g=e.getNext(a.isRelevant));)h=Math.abs(ka(a,e,g)-a.mouse.y),h|<\/font>)/,b=b?"microsoft"=== +b:d.test(a);return a&&(f||b)},handle:function(e,b){var d=e.data,c=CKEDITOR.plugins.pastetools.getClipboardData(d,"text/html"),g=CKEDITOR.plugins.pastetools.getClipboardData(d,"text/rtf"),c={dataValue:c,dataTransfer:{"text/rtf":g}};if(!1!==a.fire("pasteFromWord",c)||f){d.dontFilter=!0;if(f||!a.config.pasteFromWordPromptCleanup||confirm(a.lang.pastefromword.confirmCleanup))c.dataValue=CKEDITOR.cleanWord(c.dataValue,a),CKEDITOR.plugins.clipboard.isCustomDataTypesSupported&&k&&CKEDITOR.pasteFilters.image&& +(c.dataValue=CKEDITOR.pasteFilters.image(c.dataValue,a,g)),a.fire("afterPasteFromWord",c),d.dataValue=c.dataValue,!0===a.config.forcePasteAsPlainText?d.type="text":CKEDITOR.plugins.clipboard.isCustomCopyCutSupported||"allow-word"!==a.config.forcePasteAsPlainText||(d.type="html");f=0;b()}}})}})})();(function(){function k(a,f){var g=CKEDITOR.plugins.getPath("preview"),b=a.config,e=a.title,h=function(){var a=location.origin,c=location.pathname;if(!b.baseHref&&!CKEDITOR.env.gecko)return"";if(b.baseHref)return'\x3cbase href\x3d"{HREF}"\x3e'.replace("{HREF}",b.baseHref);c=c.split("/");c.pop();c=c.join("/");return'\x3cbase href\x3d"{HREF}"\x3e'.replace("{HREF}",a+c+"/")}();return b.fullPage?a.getData().replace(//,"$\x26"+h).replace(/[^>]*(?=<\/title>)/,"$\x26 \x26mdash; "+e):b.docType+'\x3chtml dir\x3d"'+ +b.contentsLangDirection+'"\x3e\x3chead\x3e'+h+"\x3ctitle\x3e"+e+"\x3c/title\x3e"+CKEDITOR.tools.buildStyleHtml(b.contentsCss)+'\x3clink rel\x3d"stylesheet" media\x3d"screen" href\x3d"'+g+'styles/screen.css"\x3e\x3c/head\x3e'+function(){var b="\x3cbody\x3e",c=a.document&&a.document.getBody();if(!c)return b;c.getAttribute("id")&&(b=b.replace("\x3e",' id\x3d"'+c.getAttribute("id")+'"\x3e'));c.getAttribute("class")&&(b=b.replace("\x3e",' class\x3d"'+c.getAttribute("class")+'"\x3e'));return b}()+a.getData()+ +(f?"\x3cscript\x3e"+(CKEDITOR.env.ie?"window.onload":"document.onreadystatechange")+" \x3d function() { previewCallback(); } \x3c/script\x3e":"")+"\x3c/body\x3e\x3c/html\x3e"}function l(){var a=window.screen;return{width:Math.round(.8*a.width),height:Math.round(.7*a.height),left:Math.round(.1*a.width)}}function m(){var a=CKEDITOR.plugins.getPath("preview");return CKEDITOR.env.gecko?CKEDITOR.getUrl(a+"preview.html"):""}CKEDITOR.plugins.add("preview",{init:function(a){a.addCommand("preview",{modes:{wysiwyg:1}, +canUndo:!1,readOnly:1,exec:function(){CKEDITOR.plugins.preview.createPreview(a)}});a.ui.addButton&&a.ui.addButton("Preview",{label:a.lang.preview.preview,command:"preview",toolbar:"document,40"})}});CKEDITOR.plugins.preview={createPreview:function(a,f){var g={dataValue:k(a,f)},b=l(),e;e=CKEDITOR.env.ie||CKEDITOR.env.gecko?"javascript:void( (function(){document.open();"+("("+CKEDITOR.tools.fixDomain+")();").replace(/\/\/.*?\n/g,"").replace(/parent\./g,"window.opener.")+"document.write( window.opener._cke_htmlToLoad );document.close();window.opener._cke_htmlToLoad \x3d null;})() )": +null;var h=m(),d,c;if(!1===a.fire("contentPreview",g))return!1;if(e||h)window._cke_htmlToLoad=g.dataValue;d=window.open(h,null,["toolbar\x3dyes,location\x3dno,status\x3dyes,menubar\x3dyes,scrollbars\x3dyes,resizable\x3dyes","width\x3d"+b.width,"height\x3d"+b.height,"left\x3d"+b.left].join());c=new CKEDITOR.dom.window(d);e&&d&&(d.location=e);window._cke_htmlToLoad||(b=d.document,b.open(),b.write(g.dataValue),b.close());f&&(d.previewCallback=function(){"complete"===d.document.readyState&&f(c)},d.previewCallback()); +return c}}})();(function(){CKEDITOR.plugins.add("print",{requires:"preview",init:function(a){a.addCommand("print",CKEDITOR.plugins.print);a.ui.addButton&&a.ui.addButton("Print",{label:a.lang.print.toolbar,command:"print",toolbar:"document,50"})}});CKEDITOR.plugins.print={exec:function(a){CKEDITOR.plugins.preview.createPreview(a,function(a){a=a.$;CKEDITOR.env.gecko?a.print():a.document.execCommand("Print");a.close()})},canUndo:!1,readOnly:1,modes:{wysiwyg:1}}})();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 h=a._.removeFormatRegex||(a._.removeFormatRegex=new RegExp("^(?:"+a.config.removeFormatTags.replace(/,/g,"|")+")$","i")),c=a._.removeAttributes||(a._.removeAttributes=a.config.removeFormatAttributes.split(",")),e=CKEDITOR.plugins.removeformat.filter,m=a.getSelection().getRanges(),n=m.createIterator(),p=function(a){return a.type==CKEDITOR.NODE_ELEMENT},f;f=n.getNextRange();){f.enlarge(CKEDITOR.ENLARGE_INLINE);var l=f.createBookmark(), +b=l.startNode,d=l.endNode,k=function(b){for(var c=a.elementPath(b),f=c.elements,d=1,g;(g=f[d])&&!g.equals(c.block)&&!g.equals(c.blockLimit);d++)h.test(g.getName())&&e(a,g)&&b.breakParent(g)};k(b);if(d)for(k(d),b=b.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT);b&&!b.equals(d);)if(b.isReadOnly()){if(b.getPosition(d)&CKEDITOR.POSITION_CONTAINS)break;b=b.getNext(p)}else k=b.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT),"img"==b.getName()&&b.data("cke-realelement")||!e(a,b)||(h.test(b.getName())?b.remove(1): +(b.removeAttributes(c),a.fire("removeFormatCleanup",b))),b=k;f.moveToBookmark(l)}a.forceNextSelectionCheck();a.getSelection().selectRanges(m)}}},filter:function(a,h){for(var c=a._.removeFormatFilters||[],e=0;eCKEDITOR.env.version),g=l?":not([contenteditable\x3dfalse]):not(.cke_show_blocks_off)":"",d,h;for(c=b=e=f="";d=a.pop();)h=a.length?",":"",c+=".cke_show_blocks "+d+g+h,e+=".cke_show_blocks.cke_contents_ltr "+d+g+h,f+=".cke_show_blocks.cke_contents_rtl "+d+g+h,b+=".cke_show_blocks "+d+g+"{background-image:url("+CKEDITOR.getUrl(k+"images/block_"+d+".png")+")}";CKEDITOR.addCss((c+"{background-repeat:no-repeat;border:1px dotted gray;padding-top:8px}").concat(b,e+"{background-position:top left;padding-left:8px}", +f+"{background-position:top right;padding-right:8px}"));l||CKEDITOR.addCss(".cke_show_blocks [contenteditable\x3dfalse],.cke_show_blocks .cke_show_blocks_off{border:none;padding-top:0;background-image:none}.cke_show_blocks.cke_contents_rtl [contenteditable\x3dfalse],.cke_show_blocks.cke_contents_rtl .cke_show_blocks_off{padding-right:0}.cke_show_blocks.cke_contents_ltr [contenteditable\x3dfalse],.cke_show_blocks.cke_contents_ltr .cke_show_blocks_off{padding-left:0}")},init:function(a){function c(){b.refresh(a)} +if(!a.blockless){var b=a.addCommand("showblocks",k);b.canUndo=!1;a.config.startupOutlineBlocks&&b.setState(CKEDITOR.TRISTATE_ON);a.ui.addButton&&a.ui.addButton("ShowBlocks",{label:a.lang.showblocks.toolbar,command:"showblocks",toolbar:"tools,20"});a.on("mode",function(){b.state!=CKEDITOR.TRISTATE_DISABLED&&b.refresh(a)});a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&(a.on("focus",c),a.on("blur",c));a.on("contentDom",function(){b.state!=CKEDITOR.TRISTATE_DISABLED&&b.refresh(a)})}}})})();(function(){var f={preserveState:!0,editorFocus:!1,readOnly:1,exec:function(a){this.toggleState();this.refresh(a)},refresh:function(a){if(a.document){var b=this.state==CKEDITOR.TRISTATE_ON?"attachClass":"removeClass";a.editable()[b]("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(a){var b=a.addCommand("showborders",f);b.canUndo=!1;!1!==a.config.startupShowBorders&&b.setState(CKEDITOR.TRISTATE_ON);a.on("mode",function(){b.state!=CKEDITOR.TRISTATE_DISABLED&&b.refresh(a)},null,null,100);a.on("contentDom",function(){b.state!=CKEDITOR.TRISTATE_DISABLED&&b.refresh(a)});a.on("removeFormatCleanup",function(d){d=d.data;a.getCommand("showborders").state==CKEDITOR.TRISTATE_ON&&d.is("table")&&(!d.hasAttribute("border")|| +0>=parseInt(d.getAttribute("border"),10))&&d.addClass("cke_show_border")})},afterInit:function(a){var b=a.dataProcessor;a=b&&b.dataFilter;b=b&&b.htmlFilter;a&&a.addRules({elements:{table:function(a){a=a.attributes;var b=a["class"],c=parseInt(a.border,10);c&&!(0>=c)||b&&-1!=b.indexOf("cke_show_border")||(a["class"]=(b||"")+" cke_show_border")}}});b&&b.addRules({elements:{table:function(a){a=a.attributes;var b=a["class"];b&&(a["class"]=b.replace("cke_show_border","").replace(/\s{2}/," ").replace(/^\s+|\s+$/, +""))}}})}});CKEDITOR.on("dialogDefinition",function(a){var b=a.data.name;if("table"==b||"tableProperties"==b)if(a=a.data.definition,b=a.getContents("info").get("txtBorder"),b.commit=CKEDITOR.tools.override(b.commit,function(a){return function(b,c){a.apply(this,arguments);var e=parseInt(this.getValue(),10);c[!e||0>=e?"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(b,c){a.apply(this,arguments);parseInt(c.getAttribute("border"),10)||c.addClass("cke_show_border")}})})})();(function(){CKEDITOR.plugins.add("sourcearea",{init:function(a){function d(){var a=e&&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(a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var f=CKEDITOR.plugins.sourcearea;a.addMode("source",function(e){var b=a.ui.space("contents").getDocument().createElement("textarea");b.setStyles(CKEDITOR.tools.extend({width:CKEDITOR.env.ie7Compat? +"99%":"100%",height:"100%",resize:"none",outline:"none","text-align":"left"},CKEDITOR.tools.cssVendorPrefix("tab-size",a.config.sourceAreaTabSize||4)));b.setAttribute("dir","ltr");b.addClass("cke_source").addClass("cke_reset").addClass("cke_enable_context_menu");a.ui.space("contents").append(b);b=a.editable(new c(a,b));b.setData(a.getData(1));CKEDITOR.env.ie&&(b.attachListener(a,"resize",d,b),b.attachListener(CKEDITOR.document.getWindow(),"resize",d,b),CKEDITOR.tools.setTimeout(d,0,b));a.fire("ariaWidget", +this);e()});a.addCommand("source",f.commands.source);a.ui.addButton&&a.ui.addButton("Source",{isToggle:!0,label:a.lang.sourcearea.toolbar,command:"source",toolbar:"mode,10"});a.on("mode",function(){a.getCommand("source").setState("source"==a.mode?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)});var e=CKEDITOR.env.ie&&9==CKEDITOR.env.version}}});var c=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(){c.baseProto.detach.call(this);this.clearCustomData();this.remove()}}})})(); +CKEDITOR.plugins.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:!1,readOnly:1,exec:function(c){"wysiwyg"==c.mode&&c.fire("saveSnapshot");c.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED);c.setMode("source"==c.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 c=this;CKEDITOR.dialog.add("specialchar",this.path+"dialogs/specialchar.js"); +a.addCommand("specialchar",{exec:function(){var b=a.langCode,b=c.availableLangs[b]?b:c.availableLangs[b.replace(/-.*/,"")]?b.replace(/-.*/,""):"en";CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(c.path+"dialogs/lang/"+b+".js"),function(){CKEDITOR.tools.extend(a.lang.specialchar,c.langEntries[b]);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(" ");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 c=!1;CKEDITOR.on("instanceLoaded",function(a){if(!c&&CKEDITOR.plugins.autocomplete){c=!0;var b=CKEDITOR.plugins.autocomplete.prototype.getModel; +CKEDITOR.plugins.autocomplete.prototype.getModel=function(a){var d=this.editor;a=b.bind(this)(a);a.on("change-isActive",function(a){a.data?d.fire("autocompletePanelShow"):d.fire("autocompletePanelHide")});return a}}})},init:function(a){var c=this,d=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,e=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:!(e.ie&&(8>e.version||e.quirks))},toolbar:"spellchecker,20",refresh:function(){var b=a.ui.instances.Scayt.getState();a.scayt&&(b=d.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&& +d.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,d){var e=a.scayt,l,m;e&&(m=e.getSelectionNode())&&(l=c.menuGenerator(a,m),e.showBanner("."+a.contextMenu._.definition.panel.className.split(" ").join(" .")));return l}),a.contextMenu._.onHide=CKEDITOR.tools.override(a.contextMenu._.onHide, +function(b){return function(){var d=a.scayt;d&&d.hideBanner();return b.apply(this)}}))},addMenuItems:function(a){var c=this,d=CKEDITOR.plugins.scayt;a.addMenuGroup("scaytButton");for(var b=a.config.scayt_contextMenuItemsOrder.split("|"),e=0;ea.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 d= +[],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),d.push(Number(a))):b.push(!1)});null===CKEDITOR.tools.search(b,!1)?a.config.scayt_uiTabs=d: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&&(a.config.scayt_srcUrl="https://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 c=CKEDITOR.tools.isArray(a.config.scayt_disableOptionsStorage)?a.config.scayt_disableOptionsStorage:"string"===typeof a.config.scayt_disableOptionsStorage? +[a.config.scayt_disableOptionsStorage]:void 0,e="all options lang ignore-all-caps-words ignore-domain-names ignore-words-with-mixed-cases ignore-words-with-numbers".split(" "),f=["lang","ignore-all-caps-words","ignore-domain-names","ignore-words-with-mixed-cases","ignore-words-with-numbers"],g=CKEDITOR.tools.search,k=CKEDITOR.tools.indexOf;a.config.scayt_disableOptionsStorage=function(a){for(var b=[],d=0;de)return b;if(fthis.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 support@webspellchecker.net."), +this.warningCounter+=1)},isNewUdSupported:function(a){return a.getUserDictionary?!0:!1},reloadMarkup:function(a){var c;a&&(c=a.getScaytLangList(),a.reloadMarkup?a.reloadMarkup():(this.alarmCompatibilityMessage(),c&&c.ltr&&c.rtl&&a.fire("startSpellCheck, startGrammarCheck")))},replaceOldOptionsNames:function(a){for(var c in a)c in this.backCompatibilityMap&&(a[this.backCompatibilityMap[c]]=a[c],delete a[c])},createScayt:function(a){var c=this,d=CKEDITOR.plugins.scayt;this.loadScaytLibrary(a,function(a){function e(a){return new SCAYT.CKSCAYT(a, +function(){},function(){})}var f;a.window&&(f="BODY"==a.editable().$.nodeName?a.window.getFrame():a.editable());if(f){f={lang:a.config.scayt_sLang,container:f.$,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:c.options.data_attribute_name,misspelled_word_class:c.options.misspelled_word_class, +problem_grammar_data_attribute:c.options.problem_grammar_data_attribute,problem_grammar_class:c.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:d.charsToObserve};a.config.scayt_serviceProtocol&&(f.service_protocol=a.config.scayt_serviceProtocol); +a.config.scayt_serviceHost&&(f.service_host=a.config.scayt_serviceHost);a.config.scayt_servicePort&&(f.service_port=a.config.scayt_servicePort);a.config.scayt_servicePath&&(f.service_path=a.config.scayt_servicePath);"boolean"===typeof a.config.scayt_ignoreAllCapsWords&&(f["ignore-all-caps-words"]=a.config.scayt_ignoreAllCapsWords);"boolean"===typeof a.config.scayt_ignoreDomainNames&&(f["ignore-domain-names"]=a.config.scayt_ignoreDomainNames);"boolean"===typeof a.config.scayt_ignoreWordsWithMixedCases&& +(f["ignore-words-with-mixed-cases"]=a.config.scayt_ignoreWordsWithMixedCases);"boolean"===typeof a.config.scayt_ignoreWordsWithNumbers&&(f["ignore-words-with-numbers"]=a.config.scayt_ignoreWordsWithNumbers);var g;try{g=e(f)}catch(k){c.alarmCompatibilityMessage(),delete f.charsToObserve,g=e(f)}g.subscribe("suggestionListSend",function(a){for(var b={},d=[],c=0;c=g)for(b=this.getNextSourceNode(k,CKEDITOR.NODE_ELEMENT);b;){if(b.isVisible()&&0===b.getTabIndex()){d=b;break}b=b.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT)}else for(b=this.getDocument().getBody().getFirst();b=b.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!f)if(!c&&b.equals(this)){if(c=!0,k){if(!(b=b.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;f=1}}else c&&!this.contains(b)&& +(f=1);if(b.isVisible()&&!(0>(a=b.getTabIndex()))){if(f&&a==g){d=b;break}a>g&&(!d||!e||a(b=a.getTabIndex())))if(0>=g){if(f&&0===b){d=a;break}b>e&&(d=a,e=b)}else{if(f&&b==g){d=a;break}be)&&(d=a,e=b)}}d&&d.focus()};CKEDITOR.plugins.add("table",{requires:"dialog",init:function(a){function f(c){return CKEDITOR.tools.extend(c||{},{contextSensitive:1,refresh:function(c,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(c){if(c.styles){var a;if(c.styles.border)a=CKEDITOR.tools.style.parse.border(c.styles.border);else if(CKEDITOR.env.ie&&8===CKEDITOR.env.version){var b=c.styles;b["border-left"]&&b["border-left"]===b["border-right"]&&b["border-right"]===b["border-top"]&& +b["border-top"]===b["border-bottom"]&&(a=CKEDITOR.tools.style.parse.border(b["border-top"]))}a&&a.style&&"solid"===a.style&&a.width&&0!==parseFloat(a.width)&&(c.attributes.border=1);"collapse"==c.styles["border-collapse"]&&(c.attributes.cellspacing=0)}}}]]}));a.addCommand("tableProperties",new CKEDITOR.dialogCommand("tableProperties",f()));a.addCommand("tableDelete",f({exec:function(a){var d=a.elementPath().contains("table",1);if(d){var b=d.getParent(),e=a.editable();1!=b.getChildCount()||b.is("td", +"th")||b.equals(e)||(d=b);a=a.createRange();a.moveToPosition(d,CKEDITOR.POSITION_BEFORE_START);d.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 q(d,f){function b(a){return f?f.contains(a)&&a.getAscendant("table",!0).equals(f):!0}function c(a){var b=/^(?:td|th)$/;0b)b=e}return b}function u(d,f){for(var b= +D(d)?d:q(d),c=b[0].getAscendant("table"),e=w(b,1),b=w(b),h=f?e:b,a=CKEDITOR.tools.buildTableMap(c),c=[],e=[],b=[],k=a.length,g=0;gg?new CKEDITOR.dom.element(a[0][g+1]):k&&-1!==a[0][k-1].cellIndex?new CKEDITOR.dom.element(a[0][k-1]):new CKEDITOR.dom.element(c.$.parentNode); +m.length==d&&(b[0].moveToPosition(c,CKEDITOR.POSITION_AFTER_END),b[0].select(),c.remove());return k}function t(d,f){var b=d.getStartElement().getAscendant({td:1,th:1},!0);if(b){var c=b.clone();c.appendBogus();f?c.insertBefore(b):c.insertAfter(b)}}function z(d){if(d instanceof CKEDITOR.dom.selection){var f=d.getRanges(),b=q(d),c=b[0]&&b[0].getAscendant("table"),e;a:{var h=0;e=b.length-1;for(var a={},k,g;k=b[h++];)CKEDITOR.dom.element.setMarker(a,k,"delete_cell",!0);for(h=0;k=b[h++];)if((g=k.getPrevious())&& +!g.getCustomData("delete_cell")||(g=k.getNext())&&!g.getCustomData("delete_cell")){CKEDITOR.dom.element.clearAllMarkers(a);e=g;break a}CKEDITOR.dom.element.clearAllMarkers(a);h=b[0].getParent();(h=h.getPrevious())?e=h.getLast():(h=b[e].getParent(),e=(h=h.getNext())?h.getChild(0):null)}d.reset();for(d=b.length-1;0<=d;d--)z(b[d]);e?p(e,!0):c&&(f[0].moveToPosition(c,CKEDITOR.POSITION_BEFORE_START),f[0].select(),c.remove())}else d instanceof CKEDITOR.dom.element&&(f=d.getParent(),1==f.getChildCount()? +f.remove():d.remove())}function p(d,f){var b=d.getDocument(),c=CKEDITOR.document;CKEDITOR.env.ie&&10==CKEDITOR.env.version&&(c.focus(),b.focus());b=new CKEDITOR.dom.range(b);b["moveToElementEdit"+(f?"End":"Start")](d)||(b.selectNodeContents(d),b.collapse(f?!1:!0));b.select(!0)}function A(d,f,b){d=d[f];if("undefined"==typeof b)return d;for(f=0;d&&fc.length)||(e=d.getCommonAncestor())&&e.type==CKEDITOR.NODE_ELEMENT&&e.is("table"))return!1;d=c[0];e=d.getAscendant("table");var h=CKEDITOR.tools.buildTableMap(e),a=h.length,k=h[0].length,g=d.getParent().$.rowIndex,m=A(h,g,d),l;if(f){var n;try{var p=parseInt(d.getAttribute("rowspan"),10)||1;l=parseInt(d.getAttribute("colspan"),10)||1;n=h["up"==f?g-p:"down"==f?g+p:g]["left"==f?m-l:"right"==f?m+l:m]}catch(x){return!1}if(!n||d.$==n)return!1;c["up"==f||"left"==f?"unshift":"push"](new CKEDITOR.dom.element(n))}f= +d.getDocument();var r=g,p=n=0,u=!b&&new CKEDITOR.dom.documentFragment(f),w=0;for(f=0;f=k?d.removeAttribute("rowSpan"):d.$.rowSpan=n;n>=a?d.removeAttribute("colSpan"):d.$.colSpan=p;b=new CKEDITOR.dom.nodeList(e.$.rows);c=b.count();for(f=c-1;0<=f;f--)e=b.getItem(f),e.$.cells.length||(e.remove(),c++);return d}function C(d,f){var b=q(d);if(1k){c.insertBefore(new CKEDITOR.dom.element(l));break}else l=null;l||e.append(c)}else for(g=m=1,e=c.clone(),e.insertAfter(c),e.append(c=b.clone()),l=A(h,a),k=0;kv);x++){y[u+x]||(y[u+x]=[]);for(var C=0;C=w)break}}return y}; +CKEDITOR.config.tabletools_scopedHeaders=!1;(function(){function n(a,b){return CKEDITOR.tools.array.reduce(b,function(a,b){return b(a)},a)}var g=[CKEDITOR.CTRL+90,CKEDITOR.CTRL+89,CKEDITOR.CTRL+CKEDITOR.SHIFT+90],p={8:1,46:1};CKEDITOR.plugins.add("undo",{init:function(a){function b(a){d.enabled&&!1!==a.data.command.canUndo&&d.save()}function c(){d.enabled=a.readOnly?!1:"wysiwyg"==a.mode;d.onChange()}var d=a.undoManager=new e(a),l=d.editingHandler=new k(d),f=a.addCommand("undo",{exec:function(){d.undo()&&(a.selectionChange(),this.fire("afterUndo"))}, +startDisabled:!0,canUndo:!1}),h=a.addCommand("redo",{exec:function(){d.redo()&&(a.selectionChange(),this.fire("afterRedo"))},startDisabled:!0,canUndo:!1});a.setKeystroke([[g[0],"undo"],[g[1],"redo"],[g[2],"redo"]]);d.onChange=function(){f.setState(d.undoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);h.setState(d.redoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)};a.on("beforeCommandExec",b);a.on("afterCommandExec",b);a.on("saveSnapshot",function(a){d.save(a.data&&a.data.contentOnly)}); +a.on("contentDom",l.attachListeners,l);a.on("instanceReady",function(){a.fire("saveSnapshot")});a.on("beforeModeUnload",function(){"wysiwyg"==a.mode&&d.save(!0)});a.on("mode",c);a.on("readOnly",c);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(){d.reset();a.fire("saveSnapshot")};a.on("updateSnapshot",function(){d.currentImage&&d.update()});a.on("lockSnapshot", +function(a){a=a.data;d.lock(a&&a.dontUpdate,a&&a.forceUpdate)});a.on("unlockSnapshot",d.unlock,d)}});CKEDITOR.plugins.undo={};var e=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,"")})};e.prototype={type:function(a,b){var c=e.getKeyGroup(a), +d=this.strokesRecorded[c]+1;b=b||d>=this.strokesLimit;this.typing||(this.hasUndo=this.typing=!0,this.hasRedo=!1,this.onChange());b?(d=0,this.editor.fire("saveSnapshot")):this.editor.fire("change");this.strokesRecorded[c]=d;this.previousKeyGroup=c},keyGroupChanged:function(a){return e.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,c){var d=this.editor;if(this.locked||"ready"!=d.status||"wysiwyg"!=d.mode)return!1;var e=d.editable();if(!e||"ready"!=e.status)return!1;e=this.snapshots;b||(b=new f(d));if(!1===b.contents)return!1;if(this.currentImage)if(b.equalsContent(this.currentImage)){if(a||b.equalsSelection(this.currentImage))return!1}else!1!== +c&&d.fire("change");e.splice(this.index+1,e.length-this.index-1);e.length==this.limit&&e.shift();this.index=e.push(b)-1;this.currentImage=b;!1!==c&&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,d;if(c)if(a)for(d=this.index-1;0<=d;d--){if(a=b[d],!c.equalsContent(a))return a.index=d,a}else for(d=this.index+1;d=this.undoManager.strokesLimit&&(this.undoManager.type(a.keyCode,!0),this.keyEventsStack.resetInputs())}},onKeyup:function(a){var b=this.undoManager;a=a.data.getKey();var c=this.keyEventsStack.getTotalInputs();this.keyEventsStack.remove(a);if(!(e.ieFunctionalKeysBug(a)&&this.lastKeydownImage&&this.lastKeydownImage.equalsContent(new f(b.editor, +!0))))if(0=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);b.attachListener(a,"resize",c);b.attachListener(a,"mode",g);a.on("destroy",g);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({}, +t,this.lineStyle,!0)),tipLeftStyle:CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({},q,{left:"0px","border-left-color":"red","border-width":"6px 0 6px 6px"},this.tipCss,this.tipLeftStyle,!0)),tipRightStyle:CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({},q,{right:"0px","border-right-color":"red","border-width":"6px 6px 6px 0"},this.tipCss,this.tipRightStyle,!0))})}function l(a){var d;if(d=a&&a.type==CKEDITOR.NODE_ELEMENT)d=!(r[a.getComputedStyle("float")]||r[a.getAttribute("align")]);return d&& +!u[a.getComputedStyle("position")]}CKEDITOR.plugins.add("lineutils");CKEDITOR.LINEUTILS_BEFORE=1;CKEDITOR.LINEUTILS_AFTER=2;CKEDITOR.LINEUTILS_INSIDE=4;m.prototype={start:function(a){var d=this,b=this.editor,c=this.doc,e,g,f,h,k=CKEDITOR.tools.eventsBuffer(50,function(){b.readOnly||"wysiwyg"!=b.mode||(d.relations={},(g=c.$.elementFromPoint(f,h))&&g.nodeType&&(e=new CKEDITOR.dom.element(g),d.traverseSearch(e),isNaN(f+h)||d.pixelSearch(e,f,h),a&&a(d.relations,f,h)))});this.listener=this.editable.attachListener(this.target, +"mousemove",function(a){f=a.data.$.clientX;h=a.data.$.clientY;k.input()});this.editable.attachListener(this.inline?this.editable:this.frame,"mouseout",function(){k.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(d){var b=this.editor.createRange();b.moveToPosition(this.relations[d.uid].element, +a[d.type]);return b}}(),store:function(){function a(a,b,c){var e=a.getUniqueId();e in c?c[e].type|=b:c[e]={element:a,type:b}}return function(d,b){var c;b&CKEDITOR.LINEUTILS_AFTER&&l(c=d.getNext())&&c.isVisible()&&(a(c,CKEDITOR.LINEUTILS_BEFORE,this.relations),b^=CKEDITOR.LINEUTILS_AFTER);b&CKEDITOR.LINEUTILS_INSIDE&&l(c=d.getFirst())&&c.isVisible()&&(a(c,CKEDITOR.LINEUTILS_BEFORE,this.relations),b^=CKEDITOR.LINEUTILS_INSIDE);a(d,b,this.relations)}}(),traverseSearch:function(a){var d,b,c;do if(c=a.$["data-cke-expando"], +!(c&&c in this.relations)){if(a.equals(this.editable))break;if(l(a))for(d in this.lookups)(b=this.lookups[d](a))&&this.store(a,b)}while((!a||a.type!=CKEDITOR.NODE_ELEMENT||"true"!=a.getAttribute("contenteditable"))&&(a=a.getParent()))},pixelSearch:function(){function a(a,c,e,g,f){for(var h=0,k;f(e);){e+=g;if(25==++h)break;if(k=this.doc.$.elementFromPoint(c,e))if(k==a)h=0;else if(d(a,k)&&(h=0,l(k=new CKEDITOR.dom.element(k))))return k}}var d=CKEDITOR.env.ie||CKEDITOR.env.webkit?function(a,c){return a.contains(c)}: +function(a,c){return!!(a.compareDocumentPosition(c)&16)};return function(b,c,d){var g=this.win.getViewPaneSize().height,f=a.call(this,b.$,c,d,-1,function(a){return 0this.rect.bottom)return!1;this.inline? +e.left=b.elementRect.left-this.rect.relativeX:(0[^<]*c});0>d&&(d=a._.upcasts.length);a._.upcasts.splice(d,0,[CKEDITOR.tools.bind(b,e),e.name,c])}var e=b.upcast,f=b.upcastPriority||10;e&&("string"==typeof e?d(c,b,f):d(e,b,f))}function x(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 T(a){a=a.data;if("wysiwyg"==this.editor.mode){var b=this.editor.editable(),c=this.instances,d,e,f,g;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 l=b.find(".cke_widget_wrapper"),c=[];d=0;for(e=l.count();da.selected.length||G(c,"cut"===b.name)}var c=a.editor;c.on("contentDom",function(){var a=c.editable(); +a.attachListener(a,"copy",b);a.attachListener(a,"cut",b)})}function U(a){function b(){var a=e.getSelection();if(a&&(a=a.getRanges()[0])&&!a.collapsed){var b=c(a.startContainer),d=c(a.endContainer);!b&&d?(a.setEndBefore(d.wrapper),a.select()):b&&!d&&(a.setStartAfter(b.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=h.getNestedEditable(e.editable(),b.data.selection.getStartElement()))&&a.getByElement(b),d=a.widgetHoldingFocusedEditable;d?d===c&&d.focusedEditable.equals(b)||(p(a,d,null),c&&b&&p(a,c,b)):c&&b&&p(a,c,b)});e.on("dataReady",function(){H(a).commit()});e.on("blur",function(){var b;(b=a.focused)&&x(a,b);(b=a.widgetHoldingFocusedEditable)&& +p(a,b,null)})}function S(a){var b=a.editor,c={};b.on("toDataFormat",function(b){var e=CKEDITOR.tools.getNextNumber(),f=[];b.data.downcastingSessionId=e;c[e]=f;b.data.dataValue.forEach(function(b){var c=b.attributes,e;if("data-cke-widget-white-space"in c){e=z(b);var d=A(b);e.parent.attributes["data-cke-white-space-first"]&&(e.value=e.value.replace(/^ /g," "));d.parent.attributes["data-cke-white-space-last"]&&(d.value=d.value.replace(/ $/g," "))}if("data-cke-widget-id"in c){if(c=a.instances[c["data-cke-widget-id"]])e= +b.getFirst(h.isParserWidgetElement),f.push({wrapper:b,element:e,widget:c,editables:{}}),e&&"1"!=e.attributes["data-cke-widget-keep-attr"]&&delete e.attributes["data-widget"]}else if("data-cke-widget-editable"in c)return 0CKEDITOR.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,l;a.editor.fire("lockSnapshot");for(f&&(g=a.focused)&&x(a,g);g=d.pop();)b.splice(CKEDITOR.tools.indexOf(b, +g),1),g.isInited()&&(l=g.editor.checkDirty(),g.setSelected(!1),!l&&g.editor.resetDirty());f&&e&&(l=a.editor.checkDirty(),a.focused=e,a.fire("widgetFocused",{widget:e}),e.setFocused(!0),!l&&a.editor.resetDirty());for(;g=c.pop();)b.push(g),g.setSelected(!0);a.editor.fire("unlockSnapshot")}}}function ha(a){a&&a.addFilterRule(function(a){return a.replace(/\s*cke_widget_selected/g,"").replace(/\s*cke_widget_focused/g,"")})}function I(a,b,c){var d=0;b=J(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 K(a){a.cancel()}function L(a,b){var c=function(a){return a==CKEDITOR.ENTER_BR?"br":a==CKEDITOR.ENTER_DIV?"div":"p"}(a.editor.config.enterMode),d=new CKEDITOR.dom.element(c);"br"!==c&&d.appendBogus();"after"===b?d.insertAfter(a.wrapper):d.insertBefore(a.wrapper);(function(b){var c=a.editor.createRange();c.setStart(b,0);a.editor.getSelection().selectRanges([c])})(d)}function G(a,b){var c=a.widgets.focused,d,e,f; +u.hasCopyBin(a)||(e=new u(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(F(a)))}function J(a){return(a=(a=a.getDefinition().attributes)&&a["class"])? +a.split(/\s+/):null}function M(){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 N(){CKEDITOR.env.gecko&&this.editor.unlockSelection();CKEDITOR.env.webkit||(this.editor.forceNextSelectionCheck(),this.editor.selectionChange(1))}function F(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 Z(a,b){var c=a.editor.config.widget_keystrokeInsertLineBefore,d=a.editor.config.widget_keystrokeInsertLineAfter;ia(a);O(a);ja(a);P(a);ka(a);la(a);ma(a);if(CKEDITOR.env.ie&&9>CKEDITOR.env.version)a.wrapper.on("dragstart",function(b){var c=b.data.getTarget();h.getNestedEditable(a,c)||a.inline&&h.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(b==c)L(a,"before"),a.editor.fire("saveSnapshot");else if(b==d)L(a,"after"),a.editor.fire("saveSnapshot");else if(13==b)a.edit();else{if(b==CKEDITOR.CTRL+67||b==CKEDITOR.CTRL+88){G(a.editor,b==CKEDITOR.CTRL+88);return}if(b in Q||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 ia(a){(a.wrapper=a.element.getParent()).setAttribute("data-cke-widget-id", +a.id)}function O(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 ja(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 P(a){if(!0===a.mask)na(a);else if(a.mask){var b=new CKEDITOR.tools.buffers.throttle(250,oa,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 na(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 oa(){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 ka(a){if(a.draggable){var b=a.editor,c=a.wrapper.getLast(h.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",pa,a),CKEDITOR.env.ie&&9>CKEDITOR.env.version))d.on("dragstart", +function(a){a.data.preventDefault(!0)});a.dragHandlerContainer=c}}function pa(a){function b(){var b;for(r.reset();b=l.pop();)b.removeListener();var c=k;b=a.sender;var d=this.repository.finder,e=this.repository.liner,f=this.editor,g=this.editor.editable();CKEDITOR.tools.isEmpty(e.visible)||(c=d.getRange(c[0]),this.focus(),f.fire("drop",{dropRange:c,target:c.startContainer}));g.removeClass("cke_widget_dragging");e.hideVisible();f.fire("dragend",{target:b})}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(),l=[],k=[],h,m;this.repository._.draggedWidget=this;var w=c.greedySearch(),r=CKEDITOR.tools.eventsBuffer(50,function(){h=d.locate(w);k=d.sort(m,1);k.length&&(e.prepare(w,h),e.placeLine(k[0]),e.cleanup())});g.addClass("cke_widget_dragging");l.push(g.on("mousemove",function(a){m=a.data.$.clientY;r.input()}));f.fire("dragstart",{target:a.sender});l.push(f.document.once("mouseup",b,this));g.isInline()|| +l.push(CKEDITOR.document.once("mouseup",b,this))}}function la(a){var b=null;a.on("data",function(){var a=this.data.classes,d;if(b!=a){for(d in b)a&&a[d]||this.removeClass(d);for(d in a)this.addClass(d);b=a}})}function ma(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 v(a){a.element.data("cke-widget-data", +encodeURIComponent(JSON.stringify(a.data)))}function qa(){function a(){}function b(a,b,c){return c&&this.checkElement(a)?(a=c.widgets.getByElement(a,!0))&&a.checkStyleActive(this):!1}function c(a){function b(a,c,d){for(var e=a.length,f=0;f)?(?:<(?:div|span)(?: style="[^"]+")?>)?]*data-cke-copybin-start="1"[^>]*>.?<\/span>([\s\S]+)]*data-cke-copybin-end="1"[^>]*>.?<\/span>(?:<\/(?:div|span)>)?(?:<\/(?:div|span)>)?$/i, +Q={37:1,38:1,39:1,40:1,8:1,46:1};Q[CKEDITOR.SHIFT+121]=1;var u=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,n=k?100:0,m=window.requestAnimationFrame&&!k?requestAnimationFrame:setTimeout, +p,r,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);p=c.on("selectionChange",K,null,null,0);r=c.widgets.on("checkSelection",K,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();p.removeListener();r.removeListener();c.fire("unlockSnapshot"); +h.afterDestroy&&h.afterDestroy();a()},n)})}},statics:{hasCopyBin:function(a){return!!u.getCopyBin(a)},getCopyBin:function(a){return a.document.getById("cke_copybin")}}});CKEDITOR.plugins.widget=h;h.repository=q;h.nestedEditable=t})();CKEDITOR.config.widget_keystrokeInsertLineBefore=CKEDITOR.SHIFT+CKEDITOR.ALT+13;CKEDITOR.config.widget_keystrokeInsertLineAfter=CKEDITOR.SHIFT+13;CKEDITOR.config.plugins='dialogui,dialog,about,a11yhelp,dialogadvtab,basicstyles,bidi,blockquote,notification,button,toolbar,clipboard,panelbutton,panel,floatpanel,colorbutton,colordialog,xml,ajax,templates,menu,contextmenu,copyformatting,div,resize,elementspath,enterkey,entities,popup,filetools,filebrowser,find,floatingspace,listblock,richcombo,font,fakeobjects,forms,format,horizontalrule,htmlwriter,iframe,wysiwygarea,image,indent,indentblock,indentlist,smiley,justify,menubutton,language,link,list,liststyle,magicline,maximize,newpage,pagebreak,pastetext,pastetools,pastefromword,preview,print,removeformat,save,selectall,showblocks,showborders,sourcearea,specialchar,scayt,stylescombo,tab,table,tabletools,undo,flash,lineutils,widgetselection,widget';CKEDITOR.config.skin='moono-lisa';(function() {var setIcons = function(icons, strip) {var path = CKEDITOR.getUrl( 'plugins/' + strip );icons = icons.split( ',' );for ( var i = 0; i < icons.length; i++ )CKEDITOR.skin.icons[ icons[ i ] ] = { path: path, offset: -icons[ ++i ], bgsize : icons[ ++i ] };};if (CKEDITOR.env.hidpi) setIcons('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,,bgcolor,384,,textcolor,408,,templates-rtl,432,,templates,456,,copyformatting,480,,creatediv,504,,find-rtl,528,,find,552,,replace,576,,button,600,,checkbox,624,,form,648,,hiddenfield,672,,imagebutton,696,,radio,720,,select-rtl,744,,select,768,,textarea-rtl,792,,textarea,816,,textfield-rtl,840,,textfield,864,,horizontalrule,888,,iframe,912,,image,936,,indent-rtl,960,,indent,984,,outdent-rtl,1008,,outdent,1032,,smiley,1056,,justifyblock,1080,,justifycenter,1104,,justifyleft,1128,,justifyright,1152,,language,1176,,anchor-rtl,1200,,anchor,1224,,link,1248,,unlink,1272,,bulletedlist-rtl,1296,,bulletedlist,1320,,numberedlist-rtl,1344,,numberedlist,1368,,maximize,1392,,newpage-rtl,1416,,newpage,1440,,pagebreak-rtl,1464,,pagebreak,1488,,pastetext-rtl,1512,,pastetext,1536,,pastefromword-rtl,1560,,pastefromword,1584,,preview-rtl,1608,,preview,1632,,print,1656,,removeformat,1680,,save,1704,,selectall,1728,,showblocks-rtl,1752,,showblocks,1776,,source-rtl,1800,,source,1824,,specialchar,1848,,scayt,1872,,table,1896,,redo-rtl,1920,,redo,1944,,undo-rtl,1968,,undo,1992,','icons_hidpi.png');else setIcons('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,bgcolor,384,auto,textcolor,408,auto,templates-rtl,432,auto,templates,456,auto,copyformatting,480,auto,creatediv,504,auto,find-rtl,528,auto,find,552,auto,replace,576,auto,button,600,auto,checkbox,624,auto,form,648,auto,hiddenfield,672,auto,imagebutton,696,auto,radio,720,auto,select-rtl,744,auto,select,768,auto,textarea-rtl,792,auto,textarea,816,auto,textfield-rtl,840,auto,textfield,864,auto,horizontalrule,888,auto,iframe,912,auto,image,936,auto,indent-rtl,960,auto,indent,984,auto,outdent-rtl,1008,auto,outdent,1032,auto,smiley,1056,auto,justifyblock,1080,auto,justifycenter,1104,auto,justifyleft,1128,auto,justifyright,1152,auto,language,1176,auto,anchor-rtl,1200,auto,anchor,1224,auto,link,1248,auto,unlink,1272,auto,bulletedlist-rtl,1296,auto,bulletedlist,1320,auto,numberedlist-rtl,1344,auto,numberedlist,1368,auto,maximize,1392,auto,newpage-rtl,1416,auto,newpage,1440,auto,pagebreak-rtl,1464,auto,pagebreak,1488,auto,pastetext-rtl,1512,auto,pastetext,1536,auto,pastefromword-rtl,1560,auto,pastefromword,1584,auto,preview-rtl,1608,auto,preview,1632,auto,print,1656,auto,removeformat,1680,auto,save,1704,auto,selectall,1728,auto,showblocks-rtl,1752,auto,showblocks,1776,auto,source-rtl,1800,auto,source,1824,auto,specialchar,1848,auto,scayt,1872,auto,table,1896,auto,redo-rtl,1920,auto,redo,1944,auto,undo-rtl,1968,auto,undo,1992,auto','icons.png');})();CKEDITOR.lang.languages={"af":1,"sq":1,"ar":1,"az":1,"eu":1,"bn":1,"bs":1,"bg":1,"ca":1,"zh-cn":1,"zh":1,"hr":1,"cs":1,"da":1,"nl":1,"en":1,"en-au":1,"en-ca":1,"en-gb":1,"eo":1,"et":1,"fo":1,"fi":1,"fr":1,"fr-ca":1,"gl":1,"ka":1,"de":1,"de-ch":1,"el":1,"gu":1,"he":1,"hi":1,"hu":1,"is":1,"id":1,"it":1,"ja":1,"km":1,"ko":1,"ku":1,"lv":1,"lt":1,"mk":1,"ms":1,"mn":1,"no":1,"nb":1,"oc":1,"fa":1,"pl":1,"pt-br":1,"pt":1,"ro":1,"ru":1,"sr":1,"sr-latn":1,"si":1,"sk":1,"sl":1,"es":1,"sv":1,"tt":1,"th":1,"tr":1,"ug":1,"uk":1,"vi":1,"cy":1};}()); + +/***/ }), + +/***/ "./private/js/ckeditor4_plugins/cmsdialog/plugin.js": +/*!**********************************************************!*\ + !*** ./private/js/ckeditor4_plugins/cmsdialog/plugin.js ***! + \**********************************************************/ +/***/ (() => { + +(function ($) { +if (CKEDITOR && CKEDITOR.plugins && CKEDITOR.plugins.registered && CKEDITOR.plugins.registered.cmsdialog) { + return; +} +/** + * Modified version of the dialog plugin to support touch events. + * + * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @fileOverview The floating dialog plugin. + */ + +/** + * No resize for this dialog. + * + * @readonly + * @property {Number} [=0] + * @member CKEDITOR + */ +CKEDITOR.DIALOG_RESIZE_NONE = 0; + +/** + * Only allow horizontal resizing for this dialog, disable vertical resizing. + * + * @readonly + * @property {Number} [=1] + * @member CKEDITOR + */ +CKEDITOR.DIALOG_RESIZE_WIDTH = 1; + +/** + * Only allow vertical resizing for this dialog, disable horizontal resizing. + * + * @readonly + * @property {Number} [=2] + * @member CKEDITOR + */ +CKEDITOR.DIALOG_RESIZE_HEIGHT = 2; + +/** + * Allow the dialog to be resized in both directions. + * + * @readonly + * @property {Number} [=3] + * @member CKEDITOR + */ +CKEDITOR.DIALOG_RESIZE_BOTH = 3; + +/** + * Dialog state when idle. + * + * @readonly + * @property {Number} [=1] + * @member CKEDITOR + */ +CKEDITOR.DIALOG_STATE_IDLE = 1; + +/** + * Dialog state when busy. + * + * @readonly + * @property {Number} [=2] + * @member CKEDITOR + */ +CKEDITOR.DIALOG_STATE_BUSY = 2; + +( function() { + 'use strict'; + + var cssLength = CKEDITOR.tools.cssLength, + defaultDialogDefinition, + currentCover; + + function focusActiveTab( dialog ) { + dialog._.tabBarMode = true; + dialog._.tabs[ dialog._.currentTabId ][ 0 ].focus(); + dialog._.currentFocusIndex = -1; + } + + function isTabVisible( tabId ) { + return !!this._.tabs[ tabId ][ 0 ].$.offsetHeight; + } + + function getPreviousVisibleTab() { + var tabId = this._.currentTabId, + length = this._.tabIdList.length, + tabIndex = CKEDITOR.tools.indexOf( this._.tabIdList, tabId ) + length; + + for ( var i = tabIndex - 1; i > tabIndex - length; i-- ) { + if ( isTabVisible.call( this, this._.tabIdList[ i % length ] ) ) + return this._.tabIdList[ i % length ]; + } + + return null; + } + + function getNextVisibleTab() { + var tabId = this._.currentTabId, + length = this._.tabIdList.length, + tabIndex = CKEDITOR.tools.indexOf( this._.tabIdList, tabId ); + + for ( var i = tabIndex + 1; i < tabIndex + length; i++ ) { + if ( isTabVisible.call( this, this._.tabIdList[ i % length ] ) ) + return this._.tabIdList[ i % length ]; + } + + return null; + } + + + function clearOrRecoverTextInputValue( container, isRecover ) { + var inputs = container.$.getElementsByTagName( 'input' ); + for ( var i = 0, length = inputs.length; i < length; i++ ) { + var item = new CKEDITOR.dom.element( inputs[ i ] ); + + if ( item.getAttribute( 'type' ).toLowerCase() == 'text' ) { + if ( isRecover ) { + item.setAttribute( 'value', item.getCustomData( 'fake_value' ) || '' ); + item.removeCustomData( 'fake_value' ); + } else { + item.setCustomData( 'fake_value', item.getAttribute( 'value' ) ); + item.setAttribute( 'value', '' ); + } + } + } + } + + // Handle dialog element validation state UI changes. + function handleFieldValidated( isValid, msg ) { + var input = this.getInputElement(); + if ( input ) + isValid ? input.removeAttribute( 'aria-invalid' ) : input.setAttribute( 'aria-invalid', true ); + + if ( !isValid ) { + if ( this.select ) + this.select(); + else + this.focus(); + } + + msg && alert( msg ); // jshint ignore:line + + this.fire( 'validated', { valid: isValid, msg: msg } ); + } + + function resetField() { + var input = this.getInputElement(); + input && input.removeAttribute( 'aria-invalid' ); + } + + var useFlex = !CKEDITOR.env.ie || CKEDITOR.env.edge, + templateSource = ''; + + function buildDialog( editor ) { + var element = CKEDITOR.dom.element.createFromHtml( CKEDITOR.addTemplate( 'dialog', templateSource ).output( { + id: CKEDITOR.tools.getNextNumber(), + editorId: editor.id, + langDir: editor.lang.dir, + langCode: editor.langCode, + editorDialogClass: 'cke_editor_' + editor.name.replace( /\./g, '\\.' ) + '_dialog', + closeTitle: editor.lang.common.close, + hidpi: CKEDITOR.env.hidpi ? 'cke_hidpi' : '' + } ) ); + + // TODO: Change this to getById(), so it'll support custom templates. + var body = element.getChild( [ 0, 0, 0, 0, 0 ] ), + title = body.getChild( 0 ), + close = body.getChild( 1 ); + + // Don't allow dragging on dialog (https://dev.ckeditor.com/ticket/13184). + // disabled for django-CMS: editor.plugins.clipboard && CKEDITOR.plugins.clipboard.preventDefaultDropOnElement( body ); + + // IFrame shim for dialog that masks activeX in IE. (https://dev.ckeditor.com/ticket/7619) + if ( CKEDITOR.env.ie && !CKEDITOR.env.quirks && !CKEDITOR.env.edge ) { + var src = 'javascript:void(function(){' + encodeURIComponent( 'document.open();(' + CKEDITOR.tools.fixDomain + ')();document.close();' ) + '}())', // jshint ignore:line + iframe = CKEDITOR.dom.element.createFromHtml( '' ); + iframe.appendTo( body.getParent() ); + } + + // Make the Title and Close Button unselectable. + title.unselectable(); + close.unselectable(); + + return { + element: element, + parts: { + dialog: element.getChild( 0 ), + title: title, + close: close, + tabs: body.getChild( 2 ), + contents: body.getChild( [ 3, 0, 0, 0 ] ), + footer: body.getChild( [ 3, 0, 1, 0 ] ) + } + }; + } + + /** + * This is the base class for runtime dialog objects. An instance of this + * class represents a single named dialog for a single editor instance. + * + * var dialogObj = new CKEDITOR.dialog( editor, 'smiley' ); + * + * @class + * @constructor Creates a dialog class instance. + * @param {Object} editor The editor which created the dialog. + * @param {String} dialogName The dialog's registered name. + */ + CKEDITOR.dialog = function( editor, dialogName ) { + // Load the dialog definition. + var definition = CKEDITOR.dialog._.dialogDefinitions[ dialogName ], + defaultDefinition = CKEDITOR.tools.clone( defaultDialogDefinition ), + buttonsOrder = editor.config.dialog_buttonsOrder || 'OS', + dir = editor.lang.dir, + tabsToRemove = {}, + i, processed, stopPropagation; + + if ( ( buttonsOrder == 'OS' && CKEDITOR.env.mac ) || // The buttons in MacOS Apps are in reverse order (https://dev.ckeditor.com/ticket/4750) + ( buttonsOrder == 'rtl' && dir == 'ltr' ) || ( buttonsOrder == 'ltr' && dir == 'rtl' ) ) + defaultDefinition.buttons.reverse(); + + + // Completes the definition with the default values. + definition = CKEDITOR.tools.extend( definition( editor ), defaultDefinition ); + + // Clone a functionally independent copy for this dialog. + definition = CKEDITOR.tools.clone( definition ); + + // Create a complex definition object, extending it with the API + // functions. + definition = new definitionObject( this, definition ); + + var themeBuilt = buildDialog( editor ); + + // Initialize some basic parameters. + this._ = { + editor: editor, + element: themeBuilt.element, + name: dialogName, + model: null, + contentSize: { width: 0, height: 0 }, + size: { width: 0, height: 0 }, + contents: {}, + buttons: {}, + accessKeyMap: {}, + // Default value is 0.5 which means a centered dialog. + viewportRatio: { + width: 0.5, + height: 0.5 + }, + + // Initialize the tab and page map. + tabs: {}, + tabIdList: [], + currentTabId: null, + currentTabIndex: null, + pageCount: 0, + lastTab: null, + tabBarMode: false, + + // Initialize the tab order array for input widgets. + focusList: [], + currentFocusIndex: 0, + hasFocus: false + }; + + this.parts = themeBuilt.parts; + + CKEDITOR.tools.setTimeout( function() { + editor.fire( 'ariaWidget', this.parts.contents ); + }, 0, this ); + + // Set the startup styles for the dialog, avoiding it enlarging the + // page size on the dialog creation. + var startStyles = { + top: 0, + visibility: 'hidden' + }; + + if ( CKEDITOR.env.ie6Compat ) { + startStyles.position = 'absolute'; + } + + startStyles[ dir == 'rtl' ? 'right' : 'left' ] = 0; + this.parts.dialog.setStyles( startStyles ); + + + // Call the CKEDITOR.event constructor to initialize this instance. + CKEDITOR.event.call( this ); + + // Fire the "dialogDefinition" event, making it possible to customize + // the dialog definition. + this.definition = definition = CKEDITOR.fire( 'dialogDefinition', { + name: dialogName, + definition: definition, + dialog: this + }, editor ).definition; + + // Cache tabs that should be removed. + if ( !( 'removeDialogTabs' in editor._ ) && editor.config.removeDialogTabs ) { + var removeContents = editor.config.removeDialogTabs.split( ';' ); + + for ( i = 0; i < removeContents.length; i++ ) { + var parts = removeContents[ i ].split( ':' ); + if ( parts.length == 2 ) { + var removeDialogName = parts[ 0 ]; + if ( !tabsToRemove[ removeDialogName ] ) + tabsToRemove[ removeDialogName ] = []; + tabsToRemove[ removeDialogName ].push( parts[ 1 ] ); + } + } + editor._.removeDialogTabs = tabsToRemove; + } + + // Remove tabs of this dialog. + if ( editor._.removeDialogTabs && ( tabsToRemove = editor._.removeDialogTabs[ dialogName ] ) ) { + for ( i = 0; i < tabsToRemove.length; i++ ) + definition.removeContents( tabsToRemove[ i ] ); + } + + // Initialize load, show, hide, ok and cancel events. + if ( definition.onLoad ) + this.on( 'load', definition.onLoad ); + + if ( definition.onShow ) + this.on( 'show', definition.onShow ); + + if ( definition.onHide ) + this.on( 'hide', definition.onHide ); + + if ( definition.onOk ) { + this.on( 'ok', function( evt ) { + // Dialog confirm might probably introduce content changes (https://dev.ckeditor.com/ticket/5415). + editor.fire( 'saveSnapshot' ); + setTimeout( function() { + editor.fire( 'saveSnapshot' ); + }, 0 ); + if ( definition.onOk.call( this, evt ) === false ) + evt.data.hide = false; + } ); + } + + // Set default dialog state. + this.state = CKEDITOR.DIALOG_STATE_IDLE; + + if ( definition.onCancel ) { + this.on( 'cancel', function( evt ) { + if ( definition.onCancel.call( this, evt ) === false ) + evt.data.hide = false; + } ); + } + + var me = this; + + // Iterates over all items inside all content in the dialog, calling a + // function for each of them. + var iterContents = function( func ) { + var contents = me._.contents, + stop = false; + + for ( var i in contents ) { + for ( var j in contents[ i ] ) { + stop = func.call( this, contents[ i ][ j ] ); + if ( stop ) + return; + } + } + }; + + this.on( 'ok', function( evt ) { + iterContents( function( item ) { + if ( item.validate ) { + var retval = item.validate( this ), + invalid = ( typeof retval == 'string' ) || retval === false; + + if ( invalid ) { + evt.data.hide = false; + evt.stop(); + } + + handleFieldValidated.call( item, !invalid, typeof retval == 'string' ? retval : undefined ); + return invalid; + } + } ); + }, this, null, 0 ); + + this.on( 'cancel', function( evt ) { + iterContents( function( item ) { + if ( item.isChanged() ) { + if ( !editor.config.dialog_noConfirmCancel && !confirm( editor.lang.common.confirmCancel ) ) // jshint ignore:line + evt.data.hide = false; + return true; + } + } ); + }, this, null, 0 ); + + this.parts.close.on( 'click', function( evt ) { + if ( this.fire( 'cancel', { hide: true } ).hide !== false ) + this.hide(); + evt.data.preventDefault(); + }, this ); + + // Sort focus list according to tab order definitions. + function setupFocus() { + var focusList = me._.focusList; + focusList.sort( function( a, b ) { + // Mimics browser tab order logics; + if ( a.tabIndex != b.tabIndex ) + return b.tabIndex - a.tabIndex; + // Sort is not stable in some browsers, + // fall-back the comparator to 'focusIndex'; + else + return a.focusIndex - b.focusIndex; + } ); + + var size = focusList.length; + for ( var i = 0; i < size; i++ ) + focusList[ i ].focusIndex = i; + } + + // Expects 1 or -1 as an offset, meaning direction of the offset change. + function changeFocus( offset ) { + var focusList = me._.focusList; + offset = offset || 0; + + if ( focusList.length < 1 ) + return; + + var startIndex = me._.currentFocusIndex; + + if ( me._.tabBarMode && offset < 0 ) { + // If we are in tab mode, we need to mimic that we started tabbing back from the first + // focusList (so it will go to the last one). + startIndex = 0; + } + + // Trigger the 'blur' event of any input element before anything, + // since certain UI updates may depend on it. + try { + focusList[ startIndex ].getInputElement().$.blur(); + } catch ( e ) {} + + var currentIndex = startIndex, + hasTabs = me._.pageCount > 1; + + do { + currentIndex = currentIndex + offset; + + if ( hasTabs && !me._.tabBarMode && ( currentIndex == focusList.length || currentIndex == -1 ) ) { + // If the dialog was not in tab mode, then focus the first tab (https://dev.ckeditor.com/ticket/13027). + me._.tabBarMode = true; + me._.tabs[ me._.currentTabId ][ 0 ].focus(); + me._.currentFocusIndex = -1; + + // Early return, in order to avoid accessing focusList[ -1 ]. + return; + } + + currentIndex = ( currentIndex + focusList.length ) % focusList.length; + + if ( currentIndex == startIndex ) { + break; + } + } while ( offset && !focusList[ currentIndex ].isFocusable() ); + + focusList[ currentIndex ].focus(); + + // Select whole field content. + if ( focusList[ currentIndex ].type == 'text' ) + focusList[ currentIndex ].select(); + } + + this.changeFocus = changeFocus; + + + function keydownHandler( evt ) { + // If I'm not the top dialog, ignore. + if ( me != CKEDITOR.dialog._.currentTop ) + return; + + var keystroke = evt.data.getKeystroke(), + rtl = editor.lang.dir == 'rtl', + arrowKeys = [ 37, 38, 39, 40 ], + button; + + processed = stopPropagation = 0; + + if ( keystroke == 9 || keystroke == CKEDITOR.SHIFT + 9 ) { + var shiftPressed = ( keystroke == CKEDITOR.SHIFT + 9 ); + changeFocus( shiftPressed ? -1 : 1 ); + processed = 1; + } else if ( keystroke == CKEDITOR.ALT + 121 && !me._.tabBarMode && me.getPageCount() > 1 ) { + // Alt-F10 puts focus into the current tab item in the tab bar. + focusActiveTab( me ); + processed = 1; + } else if ( CKEDITOR.tools.indexOf( arrowKeys, keystroke ) != -1 && me._.tabBarMode ) { + // Array with key codes that activate previous tab. + var prevKeyCodes = [ + // Depending on the lang dir: right or left key + rtl ? 39 : 37, + // Top/bot arrow: actually for both cases it's the same. + 38 + ], + nextId = CKEDITOR.tools.indexOf( prevKeyCodes, keystroke ) != -1 ? getPreviousVisibleTab.call( me ) : getNextVisibleTab.call( me ); + + me.selectPage( nextId ); + me._.tabs[ nextId ][ 0 ].focus(); + processed = 1; + } else if ( ( keystroke == 13 || keystroke == 32 ) && me._.tabBarMode ) { + this.selectPage( this._.currentTabId ); + this._.tabBarMode = false; + this._.currentFocusIndex = -1; + changeFocus( 1 ); + processed = 1; + } + // If user presses enter key in a text box, it implies clicking OK for the dialog. + else if ( keystroke == 13 /*ENTER*/ ) { + // Don't do that for a target that handles ENTER. + var target = evt.data.getTarget(); + if ( !target.is( 'a', 'button', 'select', 'textarea' ) && ( !target.is( 'input' ) || target.$.type != 'button' ) ) { + button = this.getButton( 'ok' ); + button && CKEDITOR.tools.setTimeout( button.click, 0, button ); + processed = 1; + } + stopPropagation = 1; // Always block the propagation (https://dev.ckeditor.com/ticket/4269) + } else if ( keystroke == 27 /*ESC*/ ) { + button = this.getButton( 'cancel' ); + + // If there's a Cancel button, click it, else just fire the cancel event and hide the dialog. + if ( button ) + CKEDITOR.tools.setTimeout( button.click, 0, button ); + else { + if ( this.fire( 'cancel', { hide: true } ).hide !== false ) + this.hide(); + } + stopPropagation = 1; // Always block the propagation (https://dev.ckeditor.com/ticket/4269) + } else { + return; + } + + keypressHandler( evt ); + } + + function keypressHandler( evt ) { + if ( processed ) + evt.data.preventDefault( 1 ); + else if ( stopPropagation ) + evt.data.stopPropagation(); + } + + var dialogElement = this._.element; + + editor.focusManager.add( dialogElement, 1 ); + + // Add the dialog keyboard handlers. + this.on( 'show', function() { + dialogElement.on( 'keydown', keydownHandler, this ); + + // Some browsers instead, don't cancel key events in the keydown, but in the + // keypress. So we must do a longer trip in those cases. (https://dev.ckeditor.com/ticket/4531,https://dev.ckeditor.com/ticket/8985) + if ( CKEDITOR.env.gecko ) + dialogElement.on( 'keypress', keypressHandler, this ); + + } ); + this.on( 'hide', function() { + dialogElement.removeListener( 'keydown', keydownHandler ); + if ( CKEDITOR.env.gecko ) + dialogElement.removeListener( 'keypress', keypressHandler ); + + // Reset fields state when closing dialog. + iterContents( function( item ) { + resetField.apply( item ); + } ); + } ); + this.on( 'iframeAdded', function( evt ) { + var doc = new CKEDITOR.dom.document( evt.data.iframe.$.contentWindow.document ); + doc.on( 'keydown', keydownHandler, this, null, 0 ); + } ); + + // Auto-focus logic in dialog. + this.on( 'show', function() { + // Setup tabIndex on showing the dialog instead of on loading + // to allow dynamic tab order happen in dialog definition. + setupFocus(); + + var hasTabs = me._.pageCount > 1; + + if ( editor.config.dialog_startupFocusTab && hasTabs ) { + me._.tabBarMode = true; + me._.tabs[ me._.currentTabId ][ 0 ].focus(); + me._.currentFocusIndex = -1; + } else if ( !this._.hasFocus ) { + // https://dev.ckeditor.com/ticket/13114#comment:4. + this._.currentFocusIndex = hasTabs ? -1 : this._.focusList.length - 1; + + // Decide where to put the initial focus. + if ( definition.onFocus ) { + var initialFocus = definition.onFocus.call( this ); + // Focus the field that the user specified. + initialFocus && initialFocus.focus(); + } + // Focus the first field in layout order. + else { + changeFocus( 1 ); + } + } + }, this, null, 0xffffffff ); + + // IE6 BUG: Text fields and text areas are only half-rendered the first time the dialog appears in IE6 (https://dev.ckeditor.com/ticket/2661). + // This is still needed after [2708] and [2709] because text fields in hidden TR tags are still broken. + if ( CKEDITOR.env.ie6Compat ) { + this.on( 'load', function() { + var outer = this.getElement(), + inner = outer.getFirst(); + inner.remove(); + inner.appendTo( outer ); + }, this ); + } + + initDragAndDrop( this ); + initResizeHandles( this ); + + // Insert the title. + ( new CKEDITOR.dom.text( definition.title, CKEDITOR.document ) ).appendTo( this.parts.title ); + + // Insert the tabs and contents. + for ( i = 0; i < definition.contents.length; i++ ) { + var page = definition.contents[ i ]; + page && this.addPage( page ); + } + + this.parts.tabs.on( 'click', function( evt ) { + var target = evt.data.getTarget(); + // If we aren't inside a tab, bail out. + if ( target.hasClass( 'cke_dialog_tab' ) ) { + // Get the ID of the tab, without the 'cke_' prefix and the unique number suffix. + var id = target.$.id; + this.selectPage( id.substring( 4, id.lastIndexOf( '_' ) ) ); + + focusActiveTab( this ); + + evt.data.preventDefault(); + } + }, this ); + + // Insert buttons. + var buttonsHtml = [], + buttons = CKEDITOR.dialog._.uiElementBuilders.hbox.build( this, { + type: 'hbox', + className: 'cke_dialog_footer_buttons', + widths: [], + children: definition.buttons + }, buttonsHtml ).getChild(); + this.parts.footer.setHtml( buttonsHtml.join( '' ) ); + + for ( i = 0; i < buttons.length; i++ ) + this._.buttons[ buttons[ i ].id ] = buttons[ i ]; + + /** + * Current state of the dialog. Use the {@link #setState} method to update it. + * See the {@link #event-state} event to know more. + * + * @readonly + * @property {Number} [state=CKEDITOR.DIALOG_STATE_IDLE] + */ + }; + + // Focusable interface. Use it via dialog.addFocusable. + function Focusable( dialog, element, index ) { + this.element = element; + this.focusIndex = index; + // TODO: support tabIndex for focusables. + this.tabIndex = 0; + this.isFocusable = function() { + return !element.getAttribute( 'disabled' ) && element.isVisible(); + }; + this.focus = function() { + dialog._.currentFocusIndex = this.focusIndex; + this.element.focus(); + }; + // Bind events + element.on( 'keydown', function( e ) { + if ( e.data.getKeystroke() in { 32: 1, 13: 1 } ) + this.fire( 'click' ); + } ); + element.on( 'focus', function() { + this.fire( 'mouseover' ); + } ); + element.on( 'blur', function() { + this.fire( 'mouseout' ); + } ); + } + + // Re-layout the dialog on window resize. + function resizeWithWindow( dialog ) { + var win = CKEDITOR.document.getWindow(); + function resizeHandler() { + dialog.layout(); + } + win.on( 'resize', resizeHandler ); + dialog.on( 'hide', function() { + win.removeListener( 'resize', resizeHandler ); + } ); + } + + CKEDITOR.dialog.prototype = { + destroy: function() { + this.hide(); + this._.element.remove(); + }, + + /** + * Resizes the dialog. + * + * dialogObj.resize( 800, 640 ); + * + * @method + * @param {Number} width The width of the dialog in pixels. + * @param {Number} height The height of the dialog in pixels. + */ + resize: function( width, height ) { + if ( this._.contentSize && this._.contentSize.width == width && this._.contentSize.height == height ) + return; + + CKEDITOR.dialog.fire( 'resize', { + dialog: this, + width: width, + height: height + }, this._.editor ); + + this.fire( 'resize', { + width: width, + height: height + }, this._.editor ); + + var contents = this.parts.contents; + contents.setStyles( { + width: width + 'px', + height: height + 'px' + } ); + + // Update dialog position when dimension get changed in RTL. + if ( this._.editor.lang.dir == 'rtl' && this._.position ) { + var containerWidth = this.parts.dialog.getParent().getClientSize().width; + + this._.position.x = containerWidth - this._.contentSize.width - parseInt( this._.element.getFirst().getStyle( 'right' ), 10 ); + } + + this._.contentSize = { width: width, height: height }; + }, + + /** + * Gets the current size of the dialog in pixels. + * + * var width = dialogObj.getSize().width; + * + * @returns {Object} + * @returns {Number} return.width + * @returns {Number} return.height + */ + getSize: function() { + var element = this._.element.getFirst(); + return { width: element.$.offsetWidth || 0, height: element.$.offsetHeight || 0 }; + }, + + /** + * Moves the dialog to an `(x, y)` coordinate relative to the window. + * + * dialogObj.move( 10, 40 ); + * + * @method + * @param {Number} x The target x-coordinate. + * @param {Number} y The target y-coordinate. + * @param {Boolean} save Flag indicate whether the dialog position should be remembered on next open up. + */ + move: function( x, y, save ) { + var element = this._.element.getFirst(), rtl = this._.editor.lang.dir == 'rtl'; + + // (https://dev.ckeditor.com/ticket/8888) In some cases of a very small viewport, dialog is incorrectly + // positioned in IE7. It also happens that it remains sticky and user cannot + // scroll down/up to reveal dialog's content below/above the viewport; this is + // cumbersome. + // The only way to fix this is to move mouse out of the browser and + // go back to see that dialog position is automagically fixed. No events, + // no style change - pure magic. This is a IE7 rendering issue, which can be + // fixed with dummy style redraw on each move. + if ( CKEDITOR.env.ie ) { + element.setStyle( 'zoom', '100%' ); + } + + var containerSize = this.parts.dialog.getParent().getClientSize(), + dialogSize = this.getSize(), + ratios = this._.viewportRatio, + freeSpace = { + width: Math.max( containerSize.width - dialogSize.width, 0 ), + height: Math.max( containerSize.height - dialogSize.height, 0 ) + }; + + if ( this._.position && this._.position.x == x && this._.position.y == y ) { + // If position didn't change window might have been resized. + x = Math.floor( freeSpace.width * ratios.width ); + y = Math.floor( freeSpace.height * ratios.height ); + } else { + updateRatios( this, x, y ); + } + + // Save the current position. + this._.position = { x: x, y: y }; + + // Translate coordinate for RTL. + if ( rtl ) { + x = freeSpace.width - x; + } + + var styles = { 'top': ( y > 0 ? y : 0 ) + 'px' }; + styles[ rtl ? 'right' : 'left' ] = ( x > 0 ? x : 0 ) + 'px'; + + element.setStyles( styles ); + + save && ( this._.moved = 1 ); + }, + + /** + * Gets the dialog's position in the window. + * + * var dialogX = dialogObj.getPosition().x; + * + * @returns {Object} + * @returns {Number} return.x + * @returns {Number} return.y + */ + getPosition: function() { + return CKEDITOR.tools.extend( {}, this._.position ); + }, + + /** + * Shows the dialog box. + * + * dialogObj.show(); + */ + show: function() { + // Insert the dialog's element to the root document. + var element = this._.element, + definition = this.definition, + documentBody = CKEDITOR.document.getBody(), + baseFloatZIndex = this._.editor.config.baseFloatZIndex + 10000000; + + if ( !( element.getParent() && element.getParent().equals( documentBody ) ) ) { + element.appendTo( documentBody ); + } else { + element.setStyle( 'display', useFlex ? 'flex' : 'block' ); + } + + // First, set the dialog to an appropriate size. + this.resize( + this._.contentSize && this._.contentSize.width || definition.width || definition.minWidth, + this._.contentSize && this._.contentSize.height || definition.height || definition.minHeight + ); + + // Reset all inputs back to their default value. + this.reset(); + + // Selects the first tab if no tab is already selected. + if ( this._.currentTabId === null ) { + this.selectPage( this.definition.contents[ 0 ].id ); + } + + // Set z-index to dialog and container (#3559). + if ( CKEDITOR.dialog._.currentZIndex === null ) { + CKEDITOR.dialog._.currentZIndex = baseFloatZIndex; + } + this._.element.getFirst().setStyle( 'z-index', CKEDITOR.dialog._.currentZIndex += 10 ); // to cover CMS' structure board + this.getElement().setStyle( 'z-index', CKEDITOR.dialog._.currentZIndex ); + + // Maintain the dialog ordering and dialog cover. + if ( CKEDITOR.dialog._.currentTop === null ) { + CKEDITOR.dialog._.currentTop = this; + this._.parentDialog = null; + showCover( this._.editor ); + } else { + this._.parentDialog = CKEDITOR.dialog._.currentTop; + + var parentElement = this._.parentDialog.getElement().getFirst(); + + parentElement.$.style.zIndex -= Math.floor( baseFloatZIndex / 2 ); + this._.parentDialog.getElement().setStyle( 'z-index', parentElement.$.style.zIndex ); + CKEDITOR.dialog._.currentTop = this; + } + + element.on( 'keydown', accessKeyDownHandler ); + element.on( 'keyup', accessKeyUpHandler ); + + // Reset the hasFocus state. + this._.hasFocus = false; + + for ( var i in definition.contents ) { + if ( !definition.contents[ i ] ) { + continue; + } + + var content = definition.contents[ i ], + tab = this._.tabs[ content.id ], + requiredContent = content.requiredContent, + enableElements = 0; + + if ( !tab ) { + continue; + } + + for ( var j in this._.contents[ content.id ] ) { + var elem = this._.contents[ content.id ][ j ]; + + if ( elem.type == 'hbox' || elem.type == 'vbox' || !elem.getInputElement() ) { + continue; + } + + if ( elem.requiredContent && !this._.editor.activeFilter.check( elem.requiredContent ) ) { + elem.disable(); + } else { + elem.enable(); + enableElements++; + } + } + + if ( !enableElements || ( requiredContent && !this._.editor.activeFilter.check( requiredContent ) ) ) { + tab[ 0 ].addClass( 'cke_dialog_tab_disabled' ); + } else { + tab[ 0 ].removeClass( 'cke_dialog_tab_disabled' ); + } + } + + CKEDITOR.tools.setTimeout( function() { + this.layout(); + resizeWithWindow( this ); + + this.parts.dialog.setStyle( 'visibility', '' ); + + // Execute onLoad for the first show. + this.fireOnce( 'load', {} ); + CKEDITOR.ui.fire( 'ready', this ); + + this.fire( 'show', {} ); + this._.editor.fire( 'dialogShow', this ); + + if ( !this._.parentDialog ) { + this._.editor.focusManager.lock(); + } + + // Save the initial values of the dialog. + this.foreach( function( contentObj ) { + contentObj.setInitValue && contentObj.setInitValue(); + } ); + + }, 100, this ); + }, + + /** + * Rearrange the dialog to its previous position or the middle of the window. + * + * @since 3.5.0 + */ + layout: function() { + var el = this.parts.dialog; + + if ( !this._.moved && useFlex ) { + return; + } + + var dialogSize = this.getSize(), + win = CKEDITOR.document.getWindow(), + viewSize = win.getViewPaneSize(), + posX, + posY; + + if ( this._.moved && this._.position ) { + posX = this._.position.x; + posY = this._.position.y; + } else { + posX = ( viewSize.width - dialogSize.width ) / 2; + posY = ( viewSize.height - dialogSize.height ) / 2; + } + + if ( !CKEDITOR.env.ie6Compat ) { + el.setStyle( 'position', 'absolute' ); + el.removeStyle( 'margin' ); + } + + posX = Math.floor( posX ); + posY = Math.floor( posY ); + + this.move( posX, posY ); + }, + + /** + * Executes a function for each UI element. + * + * @param {Function} fn Function to execute for each UI element. + * @returns {CKEDITOR.dialog} The current dialog object. + */ + foreach: function( fn ) { + for ( var i in this._.contents ) { + for ( var j in this._.contents[ i ] ) { + fn.call( this, this._.contents[i][j] ); + } + } + + return this; + }, + + /** + * Resets all input values in the dialog. + * + * dialogObj.reset(); + * + * @method + * @chainable + */ + reset: ( function() { + var fn = function( widget ) { + if ( widget.reset ) + widget.reset( 1 ); + }; + return function() { + this.foreach( fn ); + return this; + }; + } )(), + + + /** + * Calls the {@link CKEDITOR.dialog.definition.uiElement#setup} method of each + * of the UI elements, with the arguments passed through it. + * It is usually being called when the dialog is opened, to put the initial value inside the field. + * + * dialogObj.setupContent(); + * + * var timestamp = ( new Date() ).valueOf(); + * dialogObj.setupContent( timestamp ); + */ + setupContent: function() { + var args = arguments; + this.foreach( function( widget ) { + if ( widget.setup ) + widget.setup.apply( widget, args ); + } ); + }, + + /** + * Calls the {@link CKEDITOR.dialog.definition.uiElement#commit} method of each + * of the UI elements, with the arguments passed through it. + * It is usually being called when the user confirms the dialog, to process the values. + * + * dialogObj.commitContent(); + * + * var timestamp = ( new Date() ).valueOf(); + * dialogObj.commitContent( timestamp ); + */ + commitContent: function() { + var args = arguments; + this.foreach( function( widget ) { + // Make sure IE triggers "change" event on last focused input before closing the dialog. (https://dev.ckeditor.com/ticket/7915) + if ( CKEDITOR.env.ie && this._.currentFocusIndex == widget.focusIndex ) + widget.getInputElement().$.blur(); + + if ( widget.commit ) + widget.commit.apply( widget, args ); + } ); + }, + + /** + * Hides the dialog box. + * + * dialogObj.hide(); + */ + hide: function() { + if ( !this.parts.dialog.isVisible() ) { + return; + } + + this.fire( 'hide', {} ); + this._.editor.fire( 'dialogHide', this ); + // Reset the tab page. + this.selectPage( this._.tabIdList[ 0 ] ); + var element = this._.element; + element.setStyle( 'display', 'none' ); + this.parts.dialog.setStyle( 'visibility', 'hidden' ); + // Unregister all access keys associated with this dialog. + unregisterAccessKey( this ); + + // Close any child(top) dialogs first. + while ( CKEDITOR.dialog._.currentTop != this ) { + CKEDITOR.dialog._.currentTop.hide(); + } + + // Maintain dialog ordering and remove cover if needed. + if ( !this._.parentDialog ) { + hideCover( this._.editor ); + } else { + var parentElement = this._.parentDialog.getElement().getFirst(); + this._.parentDialog.getElement().removeStyle( 'z-index' ); + parentElement.setStyle( 'z-index', parseInt( parentElement.$.style.zIndex, 10 ) + Math.floor( this._.editor.config.baseFloatZIndex / 2 ) ); + } + CKEDITOR.dialog._.currentTop = this._.parentDialog; + + // Deduct or clear the z-index. + if ( !this._.parentDialog ) { + CKEDITOR.dialog._.currentZIndex = null; + + // Remove access key handlers. + element.removeListener( 'keydown', accessKeyDownHandler ); + element.removeListener( 'keyup', accessKeyUpHandler ); + + var editor = this._.editor; + editor.focus(); + + // Give a while before unlock, waiting for focus to return to the editable. (https://dev.ckeditor.com/ticket/172) + setTimeout( function() { + editor.focusManager.unlock(); + + // Fixed iOS focus issue (https://dev.ckeditor.com/ticket/12381). + // Keep in mind that editor.focus() does not work in this case. + if ( CKEDITOR.env.iOS ) { + editor.window.focus(); + } + }, 0 ); + + } else { + CKEDITOR.dialog._.currentZIndex -= 10; + } + + delete this._.parentDialog; + // Reset the initial values of the dialog. + this.foreach( function( contentObj ) { + contentObj.resetInitValue && contentObj.resetInitValue(); + } ); + + // Reset dialog state back to IDLE, if busy (https://dev.ckeditor.com/ticket/13213). + this.setState( CKEDITOR.DIALOG_STATE_IDLE ); + }, + + /** + * Adds a tabbed page into the dialog. + * + * @param {Object} contents Content definition. + */ + addPage: function( contents ) { + if ( contents.requiredContent && !this._.editor.filter.check( contents.requiredContent ) ) { + return; + } + + var pageHtml = [], + titleHtml = contents.label ? ' title="' + CKEDITOR.tools.htmlEncode( contents.label ) + '"' : '', + vbox = CKEDITOR.dialog._.uiElementBuilders.vbox.build( this, { + type: 'vbox', + className: 'cke_dialog_page_contents', + children: contents.elements, + expand: !!contents.expand, + padding: contents.padding, + style: contents.style || 'width: 100%;' + }, pageHtml ), + contentMap = this._.contents[ contents.id ] = {}, + cursor, + children = vbox.getChild(), + enabledFields = 0; + + while ( ( cursor = children.shift() ) ) { + // Count all allowed fields. + if ( !cursor.notAllowed && cursor.type != 'hbox' && cursor.type != 'vbox' ) { + enabledFields++; + } + + contentMap[ cursor.id ] = cursor; + if ( typeof cursor.getChild == 'function' ) { + children.push.apply( children, cursor.getChild() ); + } + } + + // If all fields are disabled (because they are not allowed) hide this tab. + if ( !enabledFields ) { + contents.hidden = true; + } + + // Create the HTML for the tab and the content block. + var page = CKEDITOR.dom.element.createFromHtml( pageHtml.join( '' ) ); + page.setAttribute( 'role', 'tabpanel' ); + page.setStyle( 'min-height', '100%' ); + + var env = CKEDITOR.env, + tabId = 'cke_' + contents.id + '_' + CKEDITOR.tools.getNextNumber(), + tab = CKEDITOR.dom.element.createFromHtml( [ + ' 0 ? ' cke_last' : 'cke_first' ), + titleHtml, + ( !!contents.hidden ? ' style="display:none"' : '' ), + ' id="', tabId, '"', + env.gecko && !env.hc ? '' : ' href="javascript:void(0)"', + ' tabIndex="-1"', + ' hidefocus="true"', + ' role="tab">', + contents.label, + '' + ].join( '' ) ); + + page.setAttribute( 'aria-labelledby', tabId ); + + // Take records for the tabs and elements created. + this._.tabs[ contents.id ] = [ tab, page ]; + this._.tabIdList.push( contents.id ); + !contents.hidden && this._.pageCount++; + this._.lastTab = tab; + this.updateStyle(); + + // Attach the DOM nodes. + + page.setAttribute( 'name', contents.id ); + page.appendTo( this.parts.contents ); + + tab.unselectable(); + this.parts.tabs.append( tab ); + + // Add access key handlers if access key is defined. + if ( contents.accessKey ) { + registerAccessKey( this, this, 'CTRL+' + contents.accessKey, tabAccessKeyDown, tabAccessKeyUp ); + this._.accessKeyMap[ 'CTRL+' + contents.accessKey ] = contents.id; + } + }, + + /** + * Activates a tab page in the dialog by its id. + * + * dialogObj.selectPage( 'tab_1' ); + * + * @param {String} id The id of the dialog tab to be activated. + */ + selectPage: function( id ) { + if ( this._.currentTabId == id ) + return; + + if ( this._.tabs[ id ][ 0 ].hasClass( 'cke_dialog_tab_disabled' ) ) + return; + + // If event was canceled - do nothing. + if ( this.fire( 'selectPage', { page: id, currentPage: this._.currentTabId } ) === false ) + return; + + // Hide the non-selected tabs and pages. + for ( var i in this._.tabs ) { + var tab = this._.tabs[ i ][ 0 ], + page = this._.tabs[ i ][ 1 ]; + if ( i != id ) { + tab.removeClass( 'cke_dialog_tab_selected' ); + tab.removeAttribute( 'aria-selected' ); + page.hide(); + } + page.setAttribute( 'aria-hidden', i != id ); + } + + var selected = this._.tabs[ id ]; + selected[ 0 ].addClass( 'cke_dialog_tab_selected' ); + selected[ 0 ].setAttribute( 'aria-selected', true ); + + // [IE] an invisible input[type='text'] will enlarge it's width + // if it's value is long when it shows, so we clear it's value + // before it shows and then recover it (https://dev.ckeditor.com/ticket/5649) + if ( CKEDITOR.env.ie6Compat || CKEDITOR.env.ie7Compat ) { + clearOrRecoverTextInputValue( selected[ 1 ] ); + selected[ 1 ].show(); + setTimeout( function() { + clearOrRecoverTextInputValue( selected[ 1 ], 1 ); + }, 0 ); + } else { + selected[ 1 ].show(); + } + + this._.currentTabId = id; + this._.currentTabIndex = CKEDITOR.tools.indexOf( this._.tabIdList, id ); + }, + + /** + * Dialog state-specific style updates. + */ + updateStyle: function() { + // If only a single page shown, a different style is used in the central pane. + this.parts.dialog[ ( this._.pageCount === 1 ? 'add' : 'remove' ) + 'Class' ]( 'cke_single_page' ); + }, + + /** + * Hides a page's tab away from the dialog. + * + * dialog.hidePage( 'tab_3' ); + * + * @param {String} id The page's Id. + */ + hidePage: function( id ) { + var tab = this._.tabs[ id ] && this._.tabs[ id ][ 0 ]; + if ( !tab || this._.pageCount == 1 || !tab.isVisible() ) + return; + // Switch to other tab first when we're hiding the active tab. + else if ( id == this._.currentTabId ) + this.selectPage( getPreviousVisibleTab.call( this ) ); + + tab.hide(); + this._.pageCount--; + this.updateStyle(); + }, + + /** + * Unhides a page's tab. + * + * dialog.showPage( 'tab_2' ); + * + * @param {String} id The page's Id. + */ + showPage: function( id ) { + var tab = this._.tabs[ id ] && this._.tabs[ id ][ 0 ]; + if ( !tab ) + return; + tab.show(); + this._.pageCount++; + this.updateStyle(); + }, + + /** + * Gets the root DOM element of the dialog. + * + * var dialogElement = dialogObj.getElement().getFirst(); + * dialogElement.setStyle( 'padding', '5px' ); + * + * @returns {CKEDITOR.dom.element} The `` element containing this dialog. + */ + getElement: function() { + return this._.element; + }, + + /** + * Gets the name of the dialog. + * + * var dialogName = dialogObj.getName(); + * + * @returns {String} The name of this dialog. + */ + getName: function() { + return this._.name; + }, + + /** + * Gets a dialog UI element object from a dialog page. + * + * dialogObj.getContentElement( 'tabId', 'elementId' ).setValue( 'Example' ); + * + * @param {String} pageId id of dialog page. + * @param {String} elementId id of UI element. + * @returns {CKEDITOR.ui.dialog.uiElement} The dialog UI element. + */ + getContentElement: function( pageId, elementId ) { + var page = this._.contents[ pageId ]; + return page && page[ elementId ]; + }, + + /** + * Gets the value of a dialog UI element. + * + * alert( dialogObj.getValueOf( 'tabId', 'elementId' ) ); + * + * @param {String} pageId id of dialog page. + * @param {String} elementId id of UI element. + * @returns {Object} The value of the UI element. + */ + getValueOf: function( pageId, elementId ) { + return this.getContentElement( pageId, elementId ).getValue(); + }, + + /** + * Sets the value of a dialog UI element. + * + * dialogObj.setValueOf( 'tabId', 'elementId', 'Example' ); + * + * @param {String} pageId id of the dialog page. + * @param {String} elementId id of the UI element. + * @param {Object} value The new value of the UI element. + */ + setValueOf: function( pageId, elementId, value ) { + return this.getContentElement( pageId, elementId ).setValue( value ); + }, + + /** + * Gets the UI element of a button in the dialog's button row. + * + * @returns {CKEDITOR.ui.dialog.button} The button object. + * + * @param {String} id The id of the button. + */ + getButton: function( id ) { + return this._.buttons[ id ]; + }, + + /** + * Simulates a click to a dialog button in the dialog's button row. + * + * @returns The return value of the dialog's `click` event. + * + * @param {String} id The id of the button. + */ + click: function( id ) { + return this._.buttons[ id ].click(); + }, + + /** + * Disables a dialog button. + * + * @param {String} id The id of the button. + */ + disableButton: function( id ) { + return this._.buttons[ id ].disable(); + }, + + /** + * Enables a dialog button. + * + * @param {String} id The id of the button. + */ + enableButton: function( id ) { + return this._.buttons[ id ].enable(); + }, + + /** + * Gets the number of pages in the dialog. + * + * @returns {Number} Page count. + */ + getPageCount: function() { + return this._.pageCount; + }, + + /** + * Gets the editor instance which opened this dialog. + * + * @returns {CKEDITOR.editor} Parent editor instances. + */ + getParentEditor: function() { + return this._.editor; + }, + + /** + * Gets the element that was selected when opening the dialog, if any. + * + * @returns {CKEDITOR.dom.element} The element that was selected, or `null`. + */ + getSelectedElement: function() { + return this.getParentEditor().getSelection().getSelectedElement(); + }, + + /** + * Adds element to dialog's focusable list. + * + * @param {CKEDITOR.dom.element} element + * @param {Number} [index] + */ + addFocusable: function( element, index ) { + if ( typeof index == 'undefined' ) { + index = this._.focusList.length; + this._.focusList.push( new Focusable( this, element, index ) ); + } else { + this._.focusList.splice( index, 0, new Focusable( this, element, index ) ); + for ( var i = index + 1; i < this._.focusList.length; i++ ) + this._.focusList[ i ].focusIndex++; + } + }, + + /** + * Sets the dialog {@link #property-state}. + * + * @since 4.5.0 + * @param {Number} state Either {@link CKEDITOR#DIALOG_STATE_IDLE} or {@link CKEDITOR#DIALOG_STATE_BUSY}. + */ + setState: function( state ) { + var oldState = this.state; + + if ( oldState == state ) { + return; + } + + this.state = state; + + if ( state == CKEDITOR.DIALOG_STATE_BUSY ) { + // Insert the spinner on demand. + if ( !this.parts.spinner ) { + var dir = this.getParentEditor().lang.dir, + spinnerDef = { + attributes: { + 'class': 'cke_dialog_spinner' + }, + styles: { + 'float': dir == 'rtl' ? 'right' : 'left' + } + }; + + spinnerDef.styles[ 'margin-' + ( dir == 'rtl' ? 'left' : 'right' ) ] = '8px'; + + this.parts.spinner = CKEDITOR.document.createElement( 'div', spinnerDef ); + + this.parts.spinner.setHtml( '⌛' ); + this.parts.spinner.appendTo( this.parts.title, 1 ); + } + + // Finally, show the spinner. + this.parts.spinner.show(); + + this.getButton( 'ok' ).disable(); + } else if ( state == CKEDITOR.DIALOG_STATE_IDLE ) { + // Hide the spinner. But don't do anything if there is no spinner yet. + this.parts.spinner && this.parts.spinner.hide(); + + this.getButton( 'ok' ).enable(); + } + + this.fire( 'state', state ); + }, + + /** + * @inheritdoc CKEDITOR.dialog.definition#getModel + */ + getModel: function( editor ) { + // Prioritize forced model. + if ( this._.model ) { + return this._.model; + } + + if ( this.definition.getModel ) { + return this.definition.getModel( editor ); + } + + return null; + }, + + /** + * Sets the given model as the subject of the dialog. + * + * For most plugins, like the `table` or `link` plugin, the given model should be a + * {@link CKEDITOR.dom.element DOM element instance} if there is an element related to the dialog. + * For widget plugins (`image2`, `placeholder`) you should provide a {@link CKEDITOR.plugins.widget} instance that + * is the subject of this dialog. + * + * @since 4.13.0 + * @private + * @param {CKEDITOR.dom.element/CKEDITOR.plugins.widget/Object/null} newModel The model to be set. + */ + setModel: function( newModel ) { + this._.model = newModel; + }, + + /** + * Returns the current dialog mode based on the state of the feature used with this dialog. + * + * In case if the dialog definition did not define the {@link CKEDITOR.dialog.definition#getMode} + * function, it will use the {@link #getModel} method to recognize the editor mode: + * + * The {@link CKEDITOR.dialog#EDITING_MODE editing mode} is used when the method returns: + * + * * A {@link CKEDITOR.dom.element} attached to the DOM. + * * A {@link CKEDITOR.plugins.widget} instance. + * + * Otherwise the {@link CKEDITOR.dialog#CREATION_MODE creation mode} is used. + * + * @since 4.13.0 + * @param {CKEDITOR.editor} editor + * @returns {Number} Dialog mode. + */ + getMode: function( editor ) { + if ( this.definition.getMode ) { + return this.definition.getMode( editor ); + } + + var model = this.getModel( editor ); + + if ( !model || ( model instanceof CKEDITOR.dom.element && !model.getParent() ) ) { + return CKEDITOR.dialog.CREATION_MODE; + } + + return CKEDITOR.dialog.EDITING_MODE; + } + }; + + CKEDITOR.tools.extend( CKEDITOR.dialog, { + + /** + * Indicates that the dialog is introducing new changes to the editor, for example inserting + * a newly created element as a part of a feature used with this dialog. + * + * @static + * @since 4.13.0 + */ + CREATION_MODE: 0, + + /** + * Indicates that the dialog is modifying the existing editor state, for example updating + * an existing element as a part of a feature used with this dialog. + * + * @static + * @since 4.13.0 + */ + EDITING_MODE: 1, + + /** + * Registers a dialog. + * + * // Full sample plugin, which does not only register a dialog window but also adds an item to the context menu. + * // To open the dialog window, choose "Open dialog" in the context menu. + * CKEDITOR.plugins.add( 'myplugin', { + * init: function( editor ) { + * editor.addCommand( 'mydialog',new CKEDITOR.dialogCommand( 'mydialog' ) ); + * + * if ( editor.contextMenu ) { + * editor.addMenuGroup( 'mygroup', 10 ); + * editor.addMenuItem( 'My Dialog', { + * label: 'Open dialog', + * command: 'mydialog', + * group: 'mygroup' + * } ); + * editor.contextMenu.addListener( function( element ) { + * return { 'My Dialog': CKEDITOR.TRISTATE_OFF }; + * } ); + * } + * + * CKEDITOR.dialog.add( 'mydialog', function( api ) { + * // CKEDITOR.dialog.definition + * var dialogDefinition = { + * title: 'Sample dialog', + * minWidth: 390, + * minHeight: 130, + * contents: [ + * { + * id: 'tab1', + * label: 'Label', + * title: 'Title', + * expand: true, + * padding: 0, + * elements: [ + * { + * type: 'html', + * html: '

This is some sample HTML content.

' + * }, + * { + * type: 'textarea', + * id: 'textareaId', + * rows: 4, + * cols: 40 + * } + * ] + * } + * ], + * buttons: [ CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton ], + * onOk: function() { + * // "this" is now a CKEDITOR.dialog object. + * // Accessing dialog elements: + * var textareaObj = this.getContentElement( 'tab1', 'textareaId' ); + * alert( "You have entered: " + textareaObj.getValue() ); + * } + * }; + * + * return dialogDefinition; + * } ); + * } + * } ); + * + * CKEDITOR.replace( 'editor1', { extraPlugins: 'myplugin' } ); + * + * @static + * @param {String} name The dialog's name. + * @param {Function/String} dialogDefinition + * A function returning the dialog's definition, or the URL to the `.js` file holding the function. + * The function should accept an argument `editor` which is the current editor instance, and + * return an object conforming to {@link CKEDITOR.dialog.definition}. + * @see CKEDITOR.dialog.definition + */ + add: function( name, dialogDefinition ) { + // Avoid path registration from multiple instances override definition. + if ( !this._.dialogDefinitions[ name ] || typeof dialogDefinition == 'function' ) + this._.dialogDefinitions[ name ] = dialogDefinition; + }, + + /** + * @static + * @todo + */ + exists: function( name ) { + return !!this._.dialogDefinitions[ name ]; + }, + + /** + * @static + * @todo + */ + getCurrent: function() { + return CKEDITOR.dialog._.currentTop; + }, + + /** + * Check whether tab wasn't removed by {@link CKEDITOR.config#removeDialogTabs}. + * + * @since 4.1.0 + * @static + * @param {CKEDITOR.editor} editor + * @param {String} dialogName + * @param {String} tabName + * @returns {Boolean} + */ + isTabEnabled: function( editor, dialogName, tabName ) { + var cfg = editor.config.removeDialogTabs; + + return !( cfg && cfg.match( new RegExp( '(?:^|;)' + dialogName + ':' + tabName + '(?:$|;)', 'i' ) ) ); + }, + + /** + * The default OK button for dialogs. Fires the `ok` event and closes the dialog if the event succeeds. + * + * @static + * @method + */ + okButton: ( function() { + var retval = function( editor, override ) { + override = override || {}; + return CKEDITOR.tools.extend( { + id: 'ok', + type: 'button', + label: editor.lang.common.ok, + 'class': 'cke_dialog_ui_button_ok', + onClick: function( evt ) { + var dialog = evt.data.dialog; + if ( dialog.fire( 'ok', { hide: true } ).hide !== false ) + dialog.hide(); + } + }, override, true ); + }; + retval.type = 'button'; + retval.override = function( override ) { + return CKEDITOR.tools.extend( function( editor ) { + return retval( editor, override ); + }, { type: 'button' }, true ); + }; + return retval; + } )(), + + /** + * The default cancel button for dialogs. Fires the `cancel` event and + * closes the dialog if no UI element value changed. + * + * @static + * @method + */ + cancelButton: ( function() { + var retval = function( editor, override ) { + override = override || {}; + return CKEDITOR.tools.extend( { + id: 'cancel', + type: 'button', + label: editor.lang.common.cancel, + 'class': 'cke_dialog_ui_button_cancel', + onClick: function( evt ) { + var dialog = evt.data.dialog; + if ( dialog.fire( 'cancel', { hide: true } ).hide !== false ) + dialog.hide(); + } + }, override, true ); + }; + retval.type = 'button'; + retval.override = function( override ) { + return CKEDITOR.tools.extend( function( editor ) { + return retval( editor, override ); + }, { type: 'button' }, true ); + }; + return retval; + } )(), + + /** + * Registers a dialog UI element. + * + * @static + * @param {String} typeName The name of the UI element. + * @param {Function} builder The function to build the UI element. + */ + addUIElement: function( typeName, builder ) { + this._.uiElementBuilders[ typeName ] = builder; + } + } ); + + CKEDITOR.dialog._ = { + uiElementBuilders: {}, + + dialogDefinitions: {}, + + currentTop: null, + + currentZIndex: null + }; + + // "Inherit" (copy actually) from CKEDITOR.event. + CKEDITOR.event.implementOn( CKEDITOR.dialog ); + CKEDITOR.event.implementOn( CKEDITOR.dialog.prototype ); + + defaultDialogDefinition = { + resizable: CKEDITOR.DIALOG_RESIZE_BOTH, + minWidth: 600, + minHeight: 400, + buttons: [ CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton ] + }; + + // Tool function used to return an item from an array based on its id + // property. + var getById = function( array, id, recurse ) { + for ( var i = 0, item; + ( item = array[ i ] ); i++ ) { + if ( item.id == id ) + return item; + if ( recurse && item[ recurse ] ) { + var retval = getById( item[ recurse ], id, recurse ); + if ( retval ) + return retval; + } + } + return null; + }; + + // Tool function used to add an item into an array. + var addById = function( array, newItem, nextSiblingId, recurse, nullIfNotFound ) { + if ( nextSiblingId ) { + for ( var i = 0, item; + ( item = array[ i ] ); i++ ) { + if ( item.id == nextSiblingId ) { + array.splice( i, 0, newItem ); + return newItem; + } + + if ( recurse && item[ recurse ] ) { + var retval = addById( item[ recurse ], newItem, nextSiblingId, recurse, true ); + if ( retval ) + return retval; + } + } + + if ( nullIfNotFound ) + return null; + } + + array.push( newItem ); + return newItem; + }; + + // Tool function used to remove an item from an array based on its id. + var removeById = function( array, id, recurse ) { + for ( var i = 0, item; + ( item = array[ i ] ); i++ ) { + if ( item.id == id ) + return array.splice( i, 1 ); + if ( recurse && item[ recurse ] ) { + var retval = removeById( item[ recurse ], id, recurse ); + if ( retval ) + return retval; + } + } + return null; + }; + + /** + * This class is not really part of the API. It is the `definition` property value + * passed to `dialogDefinition` event handlers. + * + * CKEDITOR.on( 'dialogDefinition', function( evt ) { + * var definition = evt.data.definition; + * var content = definition.getContents( 'page1' ); + * // ... + * } ); + * + * @private + * @class CKEDITOR.dialog.definitionObject + * @extends CKEDITOR.dialog.definition + * @constructor Creates a definitionObject class instance. + */ + function definitionObject( dialog, dialogDefinition ) { + // TODO : Check if needed. + this.dialog = dialog; + + // Transform the contents entries in contentObjects. + var contents = dialogDefinition.contents; + for ( var i = 0, content; + ( content = contents[ i ] ); i++ ) + contents[ i ] = content && new contentObject( dialog, content ); + + CKEDITOR.tools.extend( this, dialogDefinition ); + } + + definitionObject.prototype = { + /** + * Gets a content definition. + * + * @param {String} id The id of the content definition. + * @returns {CKEDITOR.dialog.definition.content} The content definition matching id. + */ + getContents: function( id ) { + return getById( this.contents, id ); + }, + + /** + * Gets a button definition. + * + * @param {String} id The id of the button definition. + * @returns {CKEDITOR.dialog.definition.button} The button definition matching id. + */ + getButton: function( id ) { + return getById( this.buttons, id ); + }, + + /** + * Adds a content definition object under this dialog definition. + * + * @param {CKEDITOR.dialog.definition.content} contentDefinition The + * content definition. + * @param {String} [nextSiblingId] The id of an existing content + * definition which the new content definition will be inserted + * before. Omit if the new content definition is to be inserted as + * the last item. + * @returns {CKEDITOR.dialog.definition.content} The inserted content definition. + */ + addContents: function( contentDefinition, nextSiblingId ) { + return addById( this.contents, contentDefinition, nextSiblingId ); + }, + + /** + * Adds a button definition object under this dialog definition. + * + * @param {CKEDITOR.dialog.definition.button} buttonDefinition The + * button definition. + * @param {String} [nextSiblingId] The id of an existing button + * definition which the new button definition will be inserted + * before. Omit if the new button definition is to be inserted as + * the last item. + * @returns {CKEDITOR.dialog.definition.button} The inserted button definition. + */ + addButton: function( buttonDefinition, nextSiblingId ) { + return addById( this.buttons, buttonDefinition, nextSiblingId ); + }, + + /** + * Removes a content definition from this dialog definition. + * + * @param {String} id The id of the content definition to be removed. + * @returns {CKEDITOR.dialog.definition.content} The removed content definition. + */ + removeContents: function( id ) { + removeById( this.contents, id ); + }, + + /** + * Removes a button definition from the dialog definition. + * + * @param {String} id The id of the button definition to be removed. + * @returns {CKEDITOR.dialog.definition.button} The removed button definition. + */ + removeButton: function( id ) { + removeById( this.buttons, id ); + } + }; + + /** + * This class is not really part of the API. It is the template of the + * objects representing content pages inside the + * CKEDITOR.dialog.definitionObject. + * + * CKEDITOR.on( 'dialogDefinition', function( evt ) { + * var definition = evt.data.definition; + * var content = definition.getContents( 'page1' ); + * content.remove( 'textInput1' ); + * // ... + * } ); + * + * @private + * @class CKEDITOR.dialog.definition.contentObject + * @constructor Creates a contentObject class instance. + */ + function contentObject( dialog, contentDefinition ) { + this._ = { + dialog: dialog + }; + + CKEDITOR.tools.extend( this, contentDefinition ); + } + + contentObject.prototype = { + /** + * Gets a UI element definition under the content definition. + * + * @param {String} id The id of the UI element definition. + * @returns {CKEDITOR.dialog.definition.uiElement} + */ + get: function( id ) { + return getById( this.elements, id, 'children' ); + }, + + /** + * Adds a UI element definition to the content definition. + * + * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition The + * UI elemnet definition to be added. + * @param {String} nextSiblingId The id of an existing UI element + * definition which the new UI element definition will be inserted + * before. Omit if the new button definition is to be inserted as + * the last item. + * @returns {CKEDITOR.dialog.definition.uiElement} The element definition inserted. + */ + add: function( elementDefinition, nextSiblingId ) { + return addById( this.elements, elementDefinition, nextSiblingId, 'children' ); + }, + + /** + * Removes a UI element definition from the content definition. + * + * @param {String} id The id of the UI element definition to be removed. + * @returns {CKEDITOR.dialog.definition.uiElement} The element definition removed. + */ + remove: function( id ) { + removeById( this.elements, id, 'children' ); + } + }; + + function initDragAndDrop( dialog ) { + var lastCoords = null, + abstractDialogCoords = null, + editor = dialog.getParentEditor(), + magnetDistance = editor.config.dialog_magnetDistance, + margins = CKEDITOR.skin.margins || [ 0, 0, 0, 0 ]; + + if ( typeof magnetDistance == 'undefined' ) + magnetDistance = 20; + + function mouseMoveHandler( evt ) { + var dialogSize = dialog.getSize(), + containerSize = dialog.parts.dialog.getParent().getClientSize(), + x = evt.originalEvent.screenX, + y = evt.originalEvent.screenY, + dx = x - lastCoords.x, + dy = y - lastCoords.y, + realX, realY; + + lastCoords = { x: x, y: y }; + abstractDialogCoords.x += dx; + abstractDialogCoords.y += dy; + + if ( abstractDialogCoords.x + margins[ 3 ] < magnetDistance ) { + realX = -margins[ 3 ]; + } else if ( abstractDialogCoords.x - margins[ 1 ] > containerSize.width - dialogSize.width - magnetDistance ) { + realX = containerSize.width - dialogSize.width + ( editor.lang.dir == 'rtl' ? 0 : margins[ 1 ] ); + } else { + realX = abstractDialogCoords.x; + } + + if ( abstractDialogCoords.y + margins[ 0 ] < magnetDistance ) { + realY = -margins[ 0 ]; + } else if ( abstractDialogCoords.y - margins[ 2 ] > containerSize.height - dialogSize.height - magnetDistance ) { + realY = containerSize.height - dialogSize.height + margins[ 2 ]; + } else { + realY = abstractDialogCoords.y; + } + + realX = Math.floor( realX ); + realY = Math.floor( realY ); + + dialog.move( realX, realY, 1 ); + + evt.preventDefault(); + } + + function mouseUpHandler() { + CMS.$(CKEDITOR.document.$).off( 'pointermove', mouseMoveHandler ); + CMS.$(CKEDITOR.document.$).off( 'pointerup', mouseUpHandler ); + + if ( CKEDITOR.env.ie6Compat ) { + var coverDoc = currentCover.getChild( 0 ).getFrameDocument(); + coverDoc.removeListener( 'mousemove', mouseMoveHandler ); + coverDoc.removeListener( 'mouseup', mouseUpHandler ); + } + } + + CMS.$(dialog.parts.title.$).on( 'pointerdown', function( evt ) { + if ( !dialog._.moved ) { + var container = dialog._.element, + element = container.getFirst(); + + element.setStyle( 'position', 'absolute' ); + container.removeStyle( 'display' ); + + dialog._.moved = true; + dialog.layout(); + } + + lastCoords = { x: evt.originalEvent.screenX, y: evt.originalEvent.screenY }; + + CMS.$(CKEDITOR.document.$).on( 'pointermove', mouseMoveHandler ); + CMS.$(CKEDITOR.document.$).on( 'pointerup', mouseUpHandler ); + abstractDialogCoords = dialog.getPosition(); + + if ( CKEDITOR.env.ie6Compat ) { + var coverDoc = currentCover.getChild( 0 ).getFrameDocument(); + coverDoc.on( 'mousemove', mouseMoveHandler ); + coverDoc.on( 'mouseup', mouseUpHandler ); + } + + evt.preventDefault(); + }); + } + + function initResizeHandles( dialog ) { + var def = dialog.definition, + resizable = def.resizable; + + if ( resizable == CKEDITOR.DIALOG_RESIZE_NONE ) + return; + + var editor = dialog.getParentEditor(); + var wrapperWidth, wrapperHeight, viewSize, origin, startSize, dialogCover; + + var mouseDownFn = CKEDITOR.tools.addFunction( function( $event ) { + startSize = dialog.getSize(); + + var content = dialog.parts.contents, + iframeDialog = content.$.getElementsByTagName( 'iframe' ).length, + isBorderBox = !( CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.quirks ); + + // Shim to help capturing "mousemove" over iframe. + if ( iframeDialog ) { + CMS.$('.cke_dialog_resize_cover').remove(); + dialogCover = CKEDITOR.dom.element.createFromHtml( '
' ); + content.append( dialogCover ); + } + + // Calculate the offset between content and chrome size. + // Use size of current tab panel because we can't rely on size of contents container (#3144). + wrapperHeight = startSize.height - dialog.parts.contents.getFirst( isVisible ).getSize( 'height', isBorderBox ); + wrapperWidth = startSize.width - dialog.parts.contents.getFirst( isVisible ).getSize( 'width', 1 ); + + origin = { x: $event.screenX, y: $event.screenY }; + + viewSize = CKEDITOR.document.getWindow().getViewPaneSize(); + + CMS.$(CKEDITOR.document.$).on( 'pointermove', mouseMoveHandler ); + CMS.$(CKEDITOR.document.$).on( 'pointerup', mouseUpHandler ); + + if ( CKEDITOR.env.ie6Compat ) { + var coverDoc = currentCover.getChild( 0 ).getFrameDocument(); + coverDoc.on( 'mousemove', mouseMoveHandler ); + coverDoc.on( 'mouseup', mouseUpHandler ); + } + + $event.preventDefault && $event.preventDefault(); + + function isVisible( el ) { + return el.isVisible(); + } + } ); + + // Prepend the grip to the dialog. + dialog.on( 'load', function() { + var direction = ''; + if ( resizable == CKEDITOR.DIALOG_RESIZE_WIDTH ) + direction = ' cke_resizer_horizontal'; + else if ( resizable == CKEDITOR.DIALOG_RESIZE_HEIGHT ) + direction = ' cke_resizer_vertical'; + var resizer = CKEDITOR.dom.element.createFromHtml( + '' + + // BLACK LOWER RIGHT TRIANGLE (ltr) + // BLACK LOWER LEFT TRIANGLE (rtl) + ( editor.lang.dir == 'ltr' ? '\u25E2' : '\u25E3' ) + + '
' ); + dialog.parts.footer.append( resizer, 1 ); + } ); + editor.on( 'destroy', function() { + CKEDITOR.tools.removeFunction( mouseDownFn ); + } ); + + function mouseMoveHandler( evt ) { + var rtl = editor.lang.dir == 'rtl', + dx = ( evt.originalEvent.screenX - origin.x ) * ( rtl ? -1 : 1 ), + dy = evt.originalEvent.screenY - origin.y, + width = startSize.width, + height = startSize.height, + internalWidth = width + dx * ( dialog._.moved ? 1 : 2 ), + internalHeight = height + dy * ( dialog._.moved ? 1 : 2 ), + element = dialog._.element.getFirst(), + right = rtl && parseInt( element.getComputedStyle( 'right' ), 10 ), + position = dialog.getPosition(); + + position.x = position.x || 0; + position.y = position.y || 0; + + if ( position.y + internalHeight > viewSize.height ) { + internalHeight = viewSize.height - position.y; + } + + if ( ( rtl ? right : position.x ) + internalWidth > viewSize.width ) { + internalWidth = viewSize.width - ( rtl ? right : position.x ); + } + + internalHeight = Math.floor( internalHeight ); + internalWidth = Math.floor( internalWidth ); + + // Make sure the dialog will not be resized to the wrong side when it's in the leftmost position for RTL. + if ( resizable == CKEDITOR.DIALOG_RESIZE_WIDTH || resizable == CKEDITOR.DIALOG_RESIZE_BOTH ) { + width = Math.max( def.minWidth || 0, internalWidth - wrapperWidth ); + } + + if ( resizable == CKEDITOR.DIALOG_RESIZE_HEIGHT || resizable == CKEDITOR.DIALOG_RESIZE_BOTH ) { + height = Math.max( def.minHeight || 0, internalHeight - wrapperHeight ); + } + + dialog.resize( width, height ); + + if ( dialog._.moved ) { + var x = dialog._.position.x, + y = dialog._.position.y; + + updateRatios( dialog, x, y ); + } + + if ( !dialog._.moved ) + dialog.layout(); + + evt.preventDefault(); + } + + function mouseUpHandler() { + CMS.$(CKEDITOR.document.$).off( 'pointermove', mouseMoveHandler ); + CMS.$(CKEDITOR.document.$).off( 'pointerup', mouseUpHandler ); + + if ( dialogCover ) { + dialogCover.remove(); + dialogCover = null; + } + + if ( CKEDITOR.env.ie6Compat ) { + var coverDoc = currentCover.getChild( 0 ).getFrameDocument(); + coverDoc.removeListener( 'mouseup', mouseUpHandler ); + coverDoc.removeListener( 'mousemove', mouseMoveHandler ); + } + } + } + + function updateRatios( dialog, x, y ) { + var containerSize = dialog.parts.dialog.getParent().getClientSize(), + dialogSize = dialog.getSize(), + ratios = dialog._.viewportRatio, + freeSpace = { + width: Math.max( containerSize.width - dialogSize.width, 0 ), + height: Math.max( containerSize.height - dialogSize.height, 0 ) + }; + + ratios.width = freeSpace.width ? ( x / freeSpace.width ) : ratios.width; + ratios.height = freeSpace.height ? ( y / freeSpace.height ) : ratios.height; + + dialog._.viewportRatio = ratios; + } + + // Caching reusable covers and allowing only one cover on screen. + var covers = {}; + + function cancelEvent( ev ) { + ev.data.preventDefault( 1 ); + } + + function showCover( editor ) { + var config = editor.config, + skinName = ( CKEDITOR.skinName || editor.config.skin ), + backgroundColorStyle = config.dialog_backgroundCoverColor || ( skinName == 'moono-lisa' ? 'black' : 'white' ), + backgroundCoverOpacity = config.dialog_backgroundCoverOpacity, + baseFloatZIndex = config.baseFloatZIndex + 10000000, + coverKey = CKEDITOR.tools.genKey( backgroundColorStyle, backgroundCoverOpacity, baseFloatZIndex ), + coverElement = covers[ coverKey ]; + + CKEDITOR.document.getBody().addClass( 'cke_dialog_open' ); + CMS.$('.cke_dialog_background_cover:not(.cms-ckeditor-dialog-background-cover)').remove(); + + if ( !coverElement ) { + var html = [ + '
' + ]; + + if ( CKEDITOR.env.ie6Compat ) { + // Support for custom document.domain in IE. + var iframeHtml = ''; + + html.push( '' + + '' ); + } + + html.push( '
' ); + + coverElement = CKEDITOR.dom.element.createFromHtml( html.join( '' ) ); + coverElement.setOpacity( backgroundCoverOpacity !== undefined ? backgroundCoverOpacity : 0.5 ); + + coverElement.on( 'keydown', cancelEvent ); + coverElement.on( 'keypress', cancelEvent ); + coverElement.on( 'keyup', cancelEvent ); + + coverElement.appendTo( CKEDITOR.document.getBody() ); + covers[ coverKey ] = coverElement; + } else { + coverElement.show(); + } + + // Makes the dialog cover a focus holder as well. + editor.focusManager.add( coverElement ); + + currentCover = coverElement; + + // Using Safari/Mac, focus must be kept where it is (https://dev.ckeditor.com/ticket/7027) + if ( !( CKEDITOR.env.mac && CKEDITOR.env.webkit ) ) + coverElement.focus(); + } + + function hideCover( editor ) { + CMS.$('.cke_dialog_background_cover:not(.cms-ckeditor-dialog-background-cover)').remove(); + CKEDITOR.document.getBody().removeClass( 'cke_dialog_open' ); + if ( !currentCover ) + return; + + editor.focusManager.remove( currentCover ); + currentCover.hide(); + } + + function removeCovers() { + for ( var coverId in covers ) + covers[ coverId ].remove(); + covers = {}; + } + + var accessKeyProcessors = {}; + + function accessKeyDownHandler( evt ) { + var ctrl = evt.data.$.ctrlKey || evt.data.$.metaKey, + alt = evt.data.$.altKey, + shift = evt.data.$.shiftKey, + key = String.fromCharCode( evt.data.$.keyCode ), + keyProcessor = accessKeyProcessors[ ( ctrl ? 'CTRL+' : '' ) + ( alt ? 'ALT+' : '' ) + ( shift ? 'SHIFT+' : '' ) + key ]; + + if ( !keyProcessor || !keyProcessor.length ) + return; + + keyProcessor = keyProcessor[ keyProcessor.length - 1 ]; + keyProcessor.keydown && keyProcessor.keydown.call( keyProcessor.uiElement, keyProcessor.dialog, keyProcessor.key ); + evt.data.preventDefault(); + } + + function accessKeyUpHandler( evt ) { + var ctrl = evt.data.$.ctrlKey || evt.data.$.metaKey, + alt = evt.data.$.altKey, + shift = evt.data.$.shiftKey, + key = String.fromCharCode( evt.data.$.keyCode ), + keyProcessor = accessKeyProcessors[ ( ctrl ? 'CTRL+' : '' ) + ( alt ? 'ALT+' : '' ) + ( shift ? 'SHIFT+' : '' ) + key ]; + + if ( !keyProcessor || !keyProcessor.length ) + return; + + keyProcessor = keyProcessor[ keyProcessor.length - 1 ]; + if ( keyProcessor.keyup ) { + keyProcessor.keyup.call( keyProcessor.uiElement, keyProcessor.dialog, keyProcessor.key ); + evt.data.preventDefault(); + } + } + + function registerAccessKey( uiElement, dialog, key, downFunc, upFunc ) { + var procList = accessKeyProcessors[ key ] || ( accessKeyProcessors[ key ] = [] ); + procList.push( { + uiElement: uiElement, + dialog: dialog, + key: key, + keyup: upFunc || uiElement.accessKeyUp, + keydown: downFunc || uiElement.accessKeyDown + } ); + } + + function unregisterAccessKey( obj ) { + for ( var i in accessKeyProcessors ) { + var list = accessKeyProcessors[ i ]; + for ( var j = list.length - 1; j >= 0; j-- ) { + if ( list[ j ].dialog == obj || list[ j ].uiElement == obj ) + list.splice( j, 1 ); + } + if ( list.length === 0 ) + delete accessKeyProcessors[ i ]; + } + } + + function tabAccessKeyUp( dialog, key ) { + if ( dialog._.accessKeyMap[ key ] ) + dialog.selectPage( dialog._.accessKeyMap[ key ] ); + } + + function tabAccessKeyDown() {} + + ( function() { + CKEDITOR.ui.dialog = { + /** + * The base class of all dialog UI elements. + * + * @class CKEDITOR.ui.dialog.uiElement + * @constructor Creates a uiElement class instance. + * @param {CKEDITOR.dialog} dialog Parent dialog object. + * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition Element + * definition. + * + * Accepted fields: + * + * * `id` (Required) The id of the UI element. See {@link CKEDITOR.dialog#getContentElement}. + * * `type` (Required) The type of the UI element. The + * value to this field specifies which UI element class will be used to + * generate the final widget. + * * `title` (Optional) The popup tooltip for the UI + * element. + * * `hidden` (Optional) A flag that tells if the element + * should be initially visible. + * * `className` (Optional) Additional CSS class names + * to add to the UI element. Separated by space. + * * `style` (Optional) Additional CSS inline styles + * to add to the UI element. A semicolon (;) is required after the last + * style declaration. + * * `accessKey` (Optional) The alphanumeric access key + * for this element. Access keys are automatically prefixed by CTRL. + * * `on*` (Optional) Any UI element definition field that + * starts with `on` followed immediately by a capital letter and + * probably more letters is an event handler. Event handlers may be further + * divided into registered event handlers and DOM event handlers. Please + * refer to {@link CKEDITOR.ui.dialog.uiElement#registerEvents} and + * {@link CKEDITOR.ui.dialog.uiElement#eventProcessors} for more information. + * + * @param {Array} htmlList + * List of HTML code to be added to the dialog's content area. + * @param {Function/String} [nodeNameArg='div'] + * A function returning a string, or a simple string for the node name for + * the root DOM node. + * @param {Function/Object} [stylesArg={}] + * A function returning an object, or a simple object for CSS styles applied + * to the DOM node. + * @param {Function/Object} [attributesArg={}] + * A fucntion returning an object, or a simple object for attributes applied + * to the DOM node. + * @param {Function/String} [contentsArg=''] + * A function returning a string, or a simple string for the HTML code inside + * the root DOM node. Default is empty string. + */ + uiElement: function( dialog, elementDefinition, htmlList, nodeNameArg, stylesArg, attributesArg, contentsArg ) { + if ( arguments.length < 4 ) + return; + + var nodeName = ( nodeNameArg.call ? nodeNameArg( elementDefinition ) : nodeNameArg ) || 'div', + html = [ '<', nodeName, ' ' ], + styles = ( stylesArg && stylesArg.call ? stylesArg( elementDefinition ) : stylesArg ) || {}, + attributes = ( attributesArg && attributesArg.call ? attributesArg( elementDefinition ) : attributesArg ) || {}, + innerHTML = ( contentsArg && contentsArg.call ? contentsArg.call( this, dialog, elementDefinition ) : contentsArg ) || '', + domId = this.domId = attributes.id || CKEDITOR.tools.getNextId() + '_uiElement', + i; + + if ( elementDefinition.requiredContent && !dialog.getParentEditor().filter.check( elementDefinition.requiredContent ) ) { + styles.display = 'none'; + this.notAllowed = true; + } + + // Set the id, a unique id is required for getElement() to work. + attributes.id = domId; + + // Set the type and definition CSS class names. + var classes = {}; + if ( elementDefinition.type ) + classes[ 'cke_dialog_ui_' + elementDefinition.type ] = 1; + if ( elementDefinition.className ) + classes[ elementDefinition.className ] = 1; + if ( elementDefinition.disabled ) + classes.cke_disabled = 1; + + var attributeClasses = ( attributes[ 'class' ] && attributes[ 'class' ].split ) ? attributes[ 'class' ].split( ' ' ) : []; + for ( i = 0; i < attributeClasses.length; i++ ) { + if ( attributeClasses[ i ] ) + classes[ attributeClasses[ i ] ] = 1; + } + var finalClasses = []; + for ( i in classes ) + finalClasses.push( i ); + attributes[ 'class' ] = finalClasses.join( ' ' ); + + // Set the popup tooltop. + if ( elementDefinition.title ) + attributes.title = elementDefinition.title; + + // Write the inline CSS styles. + var styleStr = ( elementDefinition.style || '' ).split( ';' ); + + // Element alignment support. + if ( elementDefinition.align ) { + var align = elementDefinition.align; + styles[ 'margin-left' ] = align == 'left' ? 0 : 'auto'; + styles[ 'margin-right' ] = align == 'right' ? 0 : 'auto'; + } + + for ( i in styles ) + styleStr.push( i + ':' + styles[ i ] ); + if ( elementDefinition.hidden ) + styleStr.push( 'display:none' ); + for ( i = styleStr.length - 1; i >= 0; i-- ) { + if ( styleStr[ i ] === '' ) + styleStr.splice( i, 1 ); + } + if ( styleStr.length > 0 ) + attributes.style = ( attributes.style ? ( attributes.style + '; ' ) : '' ) + styleStr.join( '; ' ); + + // Write the attributes. + for ( i in attributes ) + html.push( i + '="' + CKEDITOR.tools.htmlEncode( attributes[ i ] ) + '" ' ); + + // Write the content HTML. + html.push( '>', innerHTML, '' ); + + // Add contents to the parent HTML array. + htmlList.push( html.join( '' ) ); + + ( this._ || ( this._ = {} ) ).dialog = dialog; + + // Override isChanged if it is defined in element definition. + if ( typeof elementDefinition.isChanged == 'boolean' ) + this.isChanged = function() { + return elementDefinition.isChanged; + }; + if ( typeof elementDefinition.isChanged == 'function' ) + this.isChanged = elementDefinition.isChanged; + + // Overload 'get(set)Value' on definition. + if ( typeof elementDefinition.setValue == 'function' ) { + this.setValue = CKEDITOR.tools.override( this.setValue, function( org ) { + return function( val ) { + org.call( this, elementDefinition.setValue.call( this, val ) ); + }; + } ); + } + + if ( typeof elementDefinition.getValue == 'function' ) { + this.getValue = CKEDITOR.tools.override( this.getValue, function( org ) { + return function() { + return elementDefinition.getValue.call( this, org.call( this ) ); + }; + } ); + } + + // Add events. + CKEDITOR.event.implementOn( this ); + + this.registerEvents( elementDefinition ); + if ( this.accessKeyUp && this.accessKeyDown && elementDefinition.accessKey ) + registerAccessKey( this, dialog, 'CTRL+' + elementDefinition.accessKey ); + + var me = this; + dialog.on( 'load', function() { + var input = me.getInputElement(); + if ( input ) { + var focusClass = me.type in { 'checkbox': 1, 'ratio': 1 } && CKEDITOR.env.ie && CKEDITOR.env.version < 8 ? 'cke_dialog_ui_focused' : ''; + input.on( 'focus', function() { + dialog._.tabBarMode = false; + dialog._.hasFocus = true; + me.fire( 'focus' ); + focusClass && this.addClass( focusClass ); + + } ); + + input.on( 'blur', function() { + me.fire( 'blur' ); + focusClass && this.removeClass( focusClass ); + } ); + } + } ); + + // Completes this object with everything we have in the + // definition. + CKEDITOR.tools.extend( this, elementDefinition ); + + // Register the object as a tab focus if it can be included. + if ( this.keyboardFocusable ) { + this.tabIndex = elementDefinition.tabIndex || 0; + + this.focusIndex = dialog._.focusList.push( this ) - 1; + this.on( 'focus', function() { + dialog._.currentFocusIndex = me.focusIndex; + } ); + } + }, + + /** + * Horizontal layout box for dialog UI elements, auto-expends to available width of container. + * + * @class CKEDITOR.ui.dialog.hbox + * @extends CKEDITOR.ui.dialog.uiElement + * @constructor Creates a hbox class instance. + * @param {CKEDITOR.dialog} dialog Parent dialog object. + * @param {Array} childObjList + * Array of {@link CKEDITOR.ui.dialog.uiElement} objects inside this container. + * @param {Array} childHtmlList + * Array of HTML code that correspond to the HTML output of all the + * objects in childObjList. + * @param {Array} htmlList + * Array of HTML code that this element will output to. + * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition + * The element definition. Accepted fields: + * + * * `widths` (Optional) The widths of child cells. + * * `height` (Optional) The height of the layout. + * * `padding` (Optional) The padding width inside child cells. + * * `align` (Optional) The alignment of the whole layout. + */ + hbox: function( dialog, childObjList, childHtmlList, htmlList, elementDefinition ) { + if ( arguments.length < 4 ) + return; + + this._ || ( this._ = {} ); + + var children = this._.children = childObjList, + widths = elementDefinition && elementDefinition.widths || null, + height = elementDefinition && elementDefinition.height || null, + styles = {}, + i; + /** @ignore */ + var innerHTML = function() { + var html = [ '' ]; + for ( i = 0; i < childHtmlList.length; i++ ) { + var className = 'cke_dialog_ui_hbox_child', + styles = []; + if ( i === 0 ) { + className = 'cke_dialog_ui_hbox_first'; + } + if ( i == childHtmlList.length - 1 ) { + className = 'cke_dialog_ui_hbox_last'; + } + + html.push( ' 0 ) { + html.push( 'style="' + styles.join( '; ' ) + '" ' ); + } + html.push( '>', childHtmlList[ i ], '' ); + } + html.push( '' ); + return html.join( '' ); + }; + + var attribs = { role: 'presentation' }; + elementDefinition && elementDefinition.align && ( attribs.align = elementDefinition.align ); + + CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition || { type: 'hbox' }, htmlList, 'table', styles, attribs, innerHTML ); + }, + + /** + * Vertical layout box for dialog UI elements. + * + * @class CKEDITOR.ui.dialog.vbox + * @extends CKEDITOR.ui.dialog.hbox + * @constructor Creates a vbox class instance. + * @param {CKEDITOR.dialog} dialog Parent dialog object. + * @param {Array} childObjList + * Array of {@link CKEDITOR.ui.dialog.uiElement} objects inside this container. + * @param {Array} childHtmlList + * Array of HTML code that correspond to the HTML output of all the + * objects in childObjList. + * @param {Array} htmlList Array of HTML code that this element will output to. + * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition + * The element definition. Accepted fields: + * + * * `width` (Optional) The width of the layout. + * * `heights` (Optional) The heights of individual cells. + * * `align` (Optional) The alignment of the layout. + * * `padding` (Optional) The padding width inside child cells. + * * `expand` (Optional) Whether the layout should expand + * vertically to fill its container. + */ + vbox: function( dialog, childObjList, childHtmlList, htmlList, elementDefinition ) { + if ( arguments.length < 3 ) + return; + + this._ || ( this._ = {} ); + + var children = this._.children = childObjList, + width = elementDefinition && elementDefinition.width || null, + heights = elementDefinition && elementDefinition.heights || null; + /** @ignore */ + var innerHTML = function() { + var html = [ '' ); + for ( var i = 0; i < childHtmlList.length; i++ ) { + var styles = []; + html.push( '' ); + } + html.push( '
0 ) + html.push( 'style="', styles.join( '; ' ), '" ' ); + html.push( ' class="cke_dialog_ui_vbox_child">', childHtmlList[ i ], '
' ); + return html.join( '' ); + }; + CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition || { type: 'vbox' }, htmlList, 'div', null, { role: 'presentation' }, innerHTML ); + } + }; + } )(); + + /** @class CKEDITOR.ui.dialog.uiElement */ + CKEDITOR.ui.dialog.uiElement.prototype = { + /** + * Gets the root DOM element of this dialog UI object. + * + * uiElement.getElement().hide(); + * + * @returns {CKEDITOR.dom.element} Root DOM element of UI object. + */ + getElement: function() { + return CKEDITOR.document.getById( this.domId ); + }, + + /** + * Gets the DOM element that the user inputs values. + * + * This function is used by {@link #setValue}, {@link #getValue} and {@link #focus}. It should + * be overrided in child classes where the input element isn't the root + * element. + * + * var rawValue = textInput.getInputElement().$.value; + * + * @returns {CKEDITOR.dom.element} The element where the user input values. + */ + getInputElement: function() { + return this.getElement(); + }, + + /** + * Gets the parent dialog object containing this UI element. + * + * var dialog = uiElement.getDialog(); + * + * @returns {CKEDITOR.dialog} Parent dialog object. + */ + getDialog: function() { + return this._.dialog; + }, + + /** + * Sets the value of this dialog UI object. + * + * uiElement.setValue( 'Dingo' ); + * + * @chainable + * @param {Object} value The new value. + * @param {Boolean} noChangeEvent Internal commit, to supress `change` event on this element. + */ + setValue: function( value, noChangeEvent ) { + this.getInputElement().setValue( value ); + !noChangeEvent && this.fire( 'change', { value: value } ); + return this; + }, + + /** + * Gets the current value of this dialog UI object. + * + * var myValue = uiElement.getValue(); + * + * @returns {Object} The current value. + */ + getValue: function() { + return this.getInputElement().getValue(); + }, + + /** + * Tells whether the UI object's value has changed. + * + * if ( uiElement.isChanged() ) + * confirm( 'Value changed! Continue?' ); + * + * @returns {Boolean} `true` if changed, `false` if not changed. + */ + isChanged: function() { + // Override in input classes. + return false; + }, + + /** + * Selects the parent tab of this element. Usually called by focus() or overridden focus() methods. + * + * focus : function() { + * this.selectParentTab(); + * // do something else. + * } + * + * @chainable + */ + selectParentTab: function() { + var element = this.getInputElement(), + cursor = element, + tabId; + while ( ( cursor = cursor.getParent() ) && cursor.$.className.search( 'cke_dialog_page_contents' ) == -1 ) { + + } + + // Some widgets don't have parent tabs (e.g. OK and Cancel buttons). + if ( !cursor ) + return this; + + tabId = cursor.getAttribute( 'name' ); + // Avoid duplicate select. + if ( this._.dialog._.currentTabId != tabId ) + this._.dialog.selectPage( tabId ); + return this; + }, + + /** + * Puts the focus to the UI object. Switches tabs if the UI object isn't in the active tab page. + * + * uiElement.focus(); + * + * @chainable + */ + focus: function() { + this.selectParentTab().getInputElement().focus(); + return this; + }, + + /** + * Registers the `on*` event handlers defined in the element definition. + * + * The default behavior of this function is: + * + * 1. If the on* event is defined in the class's eventProcesors list, + * then the registration is delegated to the corresponding function + * in the eventProcessors list. + * 2. If the on* event is not defined in the eventProcessors list, then + * register the event handler under the corresponding DOM event of + * the UI element's input DOM element (as defined by the return value + * of {@link #getInputElement}). + * + * This function is only called at UI element instantiation, but can + * be overridded in child classes if they require more flexibility. + * + * @chainable + * @param {CKEDITOR.dialog.definition.uiElement} definition The UI element + * definition. + */ + registerEvents: function( definition ) { + var regex = /^on([A-Z]\w+)/, + match; + + var registerDomEvent = function( uiElement, dialog, eventName, func ) { + dialog.on( 'load', function() { + uiElement.getInputElement().on( eventName, func, uiElement ); + } ); + }; + + for ( var i in definition ) { + if ( !( match = i.match( regex ) ) ) + continue; + if ( this.eventProcessors[ i ] ) + this.eventProcessors[ i ].call( this, this._.dialog, definition[ i ] ); + else + registerDomEvent( this, this._.dialog, match[ 1 ].toLowerCase(), definition[ i ] ); + } + + return this; + }, + + /** + * The event processor list used by + * {@link CKEDITOR.ui.dialog.uiElement#getInputElement} at UI element + * instantiation. The default list defines three `on*` events: + * + * 1. `onLoad` - Called when the element's parent dialog opens for the + * first time. + * 2. `onShow` - Called whenever the element's parent dialog opens. + * 3. `onHide` - Called whenever the element's parent dialog closes. + * + * // This connects the 'click' event in CKEDITOR.ui.dialog.button to onClick + * // handlers in the UI element's definitions. + * CKEDITOR.ui.dialog.button.eventProcessors = CKEDITOR.tools.extend( {}, + * CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, + * { onClick : function( dialog, func ) { this.on( 'click', func ); } }, + * true + * ); + * + * @property {Object} + */ + eventProcessors: { + onLoad: function( dialog, func ) { + dialog.on( 'load', func, this ); + }, + + onShow: function( dialog, func ) { + dialog.on( 'show', func, this ); + }, + + onHide: function( dialog, func ) { + dialog.on( 'hide', func, this ); + } + }, + + /** + * The default handler for a UI element's access key down event, which + * tries to put focus to the UI element. + * + * Can be overridded in child classes for more sophisticaed behavior. + * + * @param {CKEDITOR.dialog} dialog The parent dialog object. + * @param {String} key The key combination pressed. Since access keys + * are defined to always include the `CTRL` key, its value should always + * include a `'CTRL+'` prefix. + */ + accessKeyDown: function() { + this.focus(); + }, + + /** + * The default handler for a UI element's access key up event, which + * does nothing. + * + * Can be overridded in child classes for more sophisticated behavior. + * + * @param {CKEDITOR.dialog} dialog The parent dialog object. + * @param {String} key The key combination pressed. Since access keys + * are defined to always include the `CTRL` key, its value should always + * include a `'CTRL+'` prefix. + */ + accessKeyUp: function() {}, + + /** + * Disables a UI element. + */ + disable: function() { + var element = this.getElement(), + input = this.getInputElement(); + input.setAttribute( 'disabled', 'true' ); + element.addClass( 'cke_disabled' ); + }, + + /** + * Enables a UI element. + */ + enable: function() { + var element = this.getElement(), + input = this.getInputElement(); + input.removeAttribute( 'disabled' ); + element.removeClass( 'cke_disabled' ); + }, + + /** + * Determines whether an UI element is enabled or not. + * + * @returns {Boolean} Whether the UI element is enabled. + */ + isEnabled: function() { + return !this.getElement().hasClass( 'cke_disabled' ); + }, + + /** + * Determines whether an UI element is visible or not. + * + * @returns {Boolean} Whether the UI element is visible. + */ + isVisible: function() { + return this.getInputElement().isVisible(); + }, + + /** + * Determines whether an UI element is focus-able or not. + * Focus-able is defined as being both visible and enabled. + * + * @returns {Boolean} Whether the UI element can be focused. + */ + isFocusable: function() { + if ( !this.isEnabled() || !this.isVisible() ) + return false; + return true; + } + }; + + /** @class CKEDITOR.ui.dialog.hbox */ + CKEDITOR.ui.dialog.hbox.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement(), { + /** + * Gets a child UI element inside this container. + * + * var checkbox = hbox.getChild( [0,1] ); + * checkbox.setValue( true ); + * + * @param {Array/Number} indices An array or a single number to indicate the child's + * position in the container's descendant tree. Omit to get all the children in an array. + * @returns {Array/CKEDITOR.ui.dialog.uiElement} Array of all UI elements in the container + * if no argument given, or the specified UI element if indices is given. + */ + getChild: function( indices ) { + // If no arguments, return a clone of the children array. + if ( arguments.length < 1 ) + return this._.children.concat(); + + // If indices isn't array, make it one. + if ( !indices.splice ) + indices = [ indices ]; + + // Retrieve the child element according to tree position. + if ( indices.length < 2 ) + return this._.children[ indices[ 0 ] ]; + else + return ( this._.children[ indices[ 0 ] ] && this._.children[ indices[ 0 ] ].getChild ) ? this._.children[ indices[ 0 ] ].getChild( indices.slice( 1, indices.length ) ) : null; + } + }, true ); + + CKEDITOR.ui.dialog.vbox.prototype = new CKEDITOR.ui.dialog.hbox(); + + ( function() { + var commonBuilder = { + build: function( dialog, elementDefinition, output ) { + var children = elementDefinition.children, + child, + childHtmlList = [], + childObjList = []; + for ( var i = 0; + ( i < children.length && ( child = children[ i ] ) ); i++ ) { + var childHtml = []; + childHtmlList.push( childHtml ); + childObjList.push( CKEDITOR.dialog._.uiElementBuilders[ child.type ].build( dialog, child, childHtml ) ); + } + return new CKEDITOR.ui.dialog[ elementDefinition.type ]( dialog, childObjList, childHtmlList, output, elementDefinition ); + } + }; + + CKEDITOR.dialog.addUIElement( 'hbox', commonBuilder ); + CKEDITOR.dialog.addUIElement( 'vbox', commonBuilder ); + } )(); + + /** + * Generic dialog command. It opens a specific dialog when executed. + * + * // Register the "link" command which opens the "link" dialog. + * editor.addCommand( 'link', new CKEDITOR.dialogCommand( 'link' ) ); + * + * @class + * @constructor Creates a dialogCommand class instance. + * @extends CKEDITOR.commandDefinition + * @param {String} dialogName The name of the dialog to open when executing + * this command. + * @param {Object} [ext] Additional command definition's properties. + * @param {String} [ext.tabId] You can provide additional property (`tabId`) if you wish to open the dialog on a specific tabId. + * + * // Open the dialog on the 'keystroke' tabId. + * editor.addCommand( 'keystroke', new CKEDITOR.dialogCommand( 'a11yHelp', { tabId: 'keystroke' } ) ); + */ + CKEDITOR.dialogCommand = function( dialogName, ext ) { + this.dialogName = dialogName; + CKEDITOR.tools.extend( this, ext, true ); + }; + + CKEDITOR.dialogCommand.prototype = { + exec: function( editor ) { + var tabId = this.tabId; + editor.openDialog( this.dialogName, function( dialog ) { + // Select different tab if it's provided (#830). + if ( tabId ) { + dialog.selectPage( tabId ); + } + } ); + }, + + // Dialog commands just open a dialog ui, thus require no undo logic, + // undo support should dedicate to specific dialog implementation. + canUndo: false, + + editorFocus: 1 + }; + + ( function() { + var notEmptyRegex = /^([a]|[^a])+$/, + integerRegex = /^\d*$/, + numberRegex = /^\d*(?:\.\d+)?$/, + htmlLengthRegex = /^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/, + cssLengthRegex = /^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i, + inlineStyleRegex = /^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/; + + /** + * {@link CKEDITOR.dialog Dialog} `OR` logical value indicates the + * relation between validation functions. + * + * @readonly + * @property {Number} [=1] + * @member CKEDITOR + */ + CKEDITOR.VALIDATE_OR = 1; + + /** + * {@link CKEDITOR.dialog Dialog} `AND` logical value indicates the + * relation between validation functions. + * + * @readonly + * @property {Number} [=2] + * @member CKEDITOR + */ + CKEDITOR.VALIDATE_AND = 2; + + /** + * The namespace with dialog helper validation functions. + * + * @class + * @singleton + */ + CKEDITOR.dialog.validate = { + /** + * Performs validation functions composition. + * + * ```javascript + * CKEDITOR.dialog.validate.functions( + * CKEDITOR.dialog.validate.notEmpty( 'Value is required.' ), + * CKEDITOR.dialog.validate.number( 'Value is not a number.' ), + * 'error!' + * ); + * ``` + * + * @param {Function...} validators Validation functions which will be composed into a single validator. + * @param {String} [msg] Error message returned by the composed validation function. + * @param {Number} [relation=CKEDITOR.VALIDATE_OR] Indicates a relation between validation functions. + * Use {@link CKEDITOR#VALIDATE_OR} or {@link CKEDITOR#VALIDATE_AND}. + * + * @returns {Function} Composed validation function. + */ + functions: function() { + var args = arguments; + return function() { + // It's important for validate functions to be able to accept the value + // as argument in addition to this.getValue(), so that it is possible to + // combine validate functions together to make more sophisticated + // validators. + var value = this && this.getValue ? this.getValue() : args[ 0 ]; + + var msg, + relation = CKEDITOR.VALIDATE_AND, + functions = [], + i; + + for ( i = 0; i < args.length; i++ ) { + if ( typeof args[ i ] == 'function' ) + functions.push( args[ i ] ); + else + break; + } + + if ( i < args.length && typeof args[ i ] == 'string' ) { + msg = args[ i ]; + i++; + } + + if ( i < args.length && typeof args[ i ] == 'number' ) + relation = args[ i ]; + + var passed = ( relation == CKEDITOR.VALIDATE_AND ? true : false ); + for ( i = 0; i < functions.length; i++ ) { + if ( relation == CKEDITOR.VALIDATE_AND ) + passed = passed && functions[ i ]( value ); + else + passed = passed || functions[ i ]( value ); + } + + return !passed ? msg : true; + }; + }, + + /** + * Checks if a dialog UI element value meets the regex condition. + * + * ```javascript + * CKEDITOR.dialog.validate.regex( 'error!', /^\d*$/ )( '123' ) // true + * CKEDITOR.dialog.validate.regex( 'error!' )( '123.321' ) // error! + * ``` + * + * @param {RegExp} regex Regular expression used to validate the value. + * @param {String} msg Validator error message. + * @returns {Function} Validation function. + */ + regex: function( regex, msg ) { + /* + * Can be greatly shortened by deriving from functions validator if code size + * turns out to be more important than performance. + */ + return function() { + var value = this && this.getValue ? this.getValue() : arguments[ 0 ]; + return !regex.test( value ) ? msg : true; + }; + }, + + /** + * Checks if a dialog UI element value is not an empty string. + * + * ```javascript + * CKEDITOR.dialog.validate.notEmpty( 'error!' )( 'test' ) // true + * CKEDITOR.dialog.validate.notEmpty( 'error!' )( ' ' ) // error! + * ``` + * + * @param {String} msg Validator error message. + * @returns {Function} Validation function. + */ + notEmpty: function( msg ) { + return this.regex( notEmptyRegex, msg ); + }, + + /** + * Checks if a dialog UI element value is an Integer. + * + * ```javascript + * CKEDITOR.dialog.validate.integer( 'error!' )( '123' ) // true + * CKEDITOR.dialog.validate.integer( 'error!' )( '123.321' ) // error! + * ``` + * + * @param {String} msg Validator error message. + * @returns {Function} Validation function. + */ + integer: function( msg ) { + return this.regex( integerRegex, msg ); + }, + + /** + * Checks if a dialog UI element value is a Number. + * + * ```javascript + * CKEDITOR.dialog.validate.number( 'error!' )( '123' ) // true + * CKEDITOR.dialog.validate.number( 'error!' )( 'test' ) // error! + * ``` + * + * @param {String} msg Validator error message. + * @returns {Function} Validation function. + */ + 'number': function( msg ) { + return this.regex( numberRegex, msg ); + }, + + /** + * Checks if a dialog UI element value is a correct CSS length value. + * + * It allows `px`, `em`, `ex`, `in`, `cm`, `mm`, `pt`, `pc` units. + * + * ```javascript + * CKEDITOR.dialog.validate.cssLength( 'error!' )( '10pt' ) // true + * CKEDITOR.dialog.validate.cssLength( 'error!' )( 'solid' ) // error! + * ``` + * + * @param {String} msg Validator error message. + * @returns {Function} Validation function. + */ + 'cssLength': function( msg ) { + return this.functions( function( val ) { + return cssLengthRegex.test( CKEDITOR.tools.trim( val ) ); + }, msg ); + }, + + /** + * Checks if a dialog UI element value is a correct HTML length value. + * + * It allows `px` units. + * + * ```javascript + * CKEDITOR.dialog.validate.htmlLength( 'error!' )( '10px' ) // true + * CKEDITOR.dialog.validate.htmlLength( 'error!' )( 'solid' ) // error! + * ``` + * + * @param {String} msg Validator error message. + * @returns {Function} Validation function. + */ + 'htmlLength': function( msg ) { + return this.functions( function( val ) { + return htmlLengthRegex.test( CKEDITOR.tools.trim( val ) ); + }, msg ); + }, + + /** + * Checks if a dialog UI element value is a correct CSS inline style. + * + * ```javascript + * CKEDITOR.dialog.validate.inlineStyle( 'error!' )( 'height: 10px; width: 20px;' ) // true + * CKEDITOR.dialog.validate.inlineStyle( 'error!' )( 'test' ) // error! + * ``` + * + * @param {String} msg Validator error message. + * @returns {Function} Validation function. + */ + 'inlineStyle': function( msg ) { + return this.functions( function( val ) { + return inlineStyleRegex.test( CKEDITOR.tools.trim( val ) ); + }, msg ); + }, + + /** + * Checks if a dialog UI element value and the given value are equal. + * + * ```javascript + * CKEDITOR.dialog.validate.equals( 'foo', 'error!' )( 'foo' ) // true + * CKEDITOR.dialog.validate.equals( 'foo', 'error!' )( 'baz' ) // error! + * ``` + * + * @param {String} value The value to compare. + * @param {String} msg Validator error message. + * @returns {Function} Validation function. + */ + equals: function( value, msg ) { + return this.functions( function( val ) { + return val == value; + }, msg ); + }, + + /** + * Checks if a dialog UI element value and the given value are not equal. + * + * ```javascript + * CKEDITOR.dialog.validate.notEqual( 'foo', 'error!' )( 'baz' ) // true + * CKEDITOR.dialog.validate.notEqual( 'foo', 'error!' )( 'foo' ) // error! + * ``` + * + * @param {String} value The value to compare. + * @param {String} msg Validator error message. + * @returns {Function} Validation function. + */ + notEqual: function( value, msg ) { + return this.functions( function( val ) { + return val != value; + }, msg ); + } + }; + + CKEDITOR.on( 'instanceDestroyed', function( evt ) { + // Remove dialog cover on last instance destroy. + if ( CKEDITOR.tools.isEmpty( CKEDITOR.instances ) ) { + var currentTopDialog; + while ( ( currentTopDialog = CKEDITOR.dialog._.currentTop ) ) + currentTopDialog.hide(); + removeCovers(); + } + + var dialogs = evt.editor._.storedDialogs; + for ( var name in dialogs ) + dialogs[ name ].destroy(); + + } ); + + } )(); + + // Extend the CKEDITOR.editor class with dialog specific functions. + CKEDITOR.tools.extend( CKEDITOR.editor.prototype, { + /** + * Loads and opens a registered dialog. + * + * CKEDITOR.instances.editor1.openDialog( 'smiley' ); + * + * @member CKEDITOR.editor + * @param {String} dialogName The registered name of the dialog. + * @param {Function} callback The function to be invoked after a dialog instance is created. + * @param {CKEDITOR.dom.element/CKEDITOR.plugins.widget/Object} [forceModel] Forces opening the dialog + * using the given model as a subject. The forced model will take precedence before the + * {@link CKEDITOR.dialog.definition#getModel} method. Available since 4.13.0. + * @returns {CKEDITOR.dialog} The dialog object corresponding to the dialog displayed or + * `null` if the dialog name is not registered. + * @see CKEDITOR.dialog#add + */ + openDialog: function( dialogName, callback, forceModel ) { + var dialog = null, dialogDefinitions = CKEDITOR.dialog._.dialogDefinitions[ dialogName ]; + + if ( CKEDITOR.dialog._.currentTop === null ) + showCover( this ); + + // If the dialogDefinition is already loaded, open it immediately. + if ( typeof dialogDefinitions == 'function' ) { + var storedDialogs = this._.storedDialogs || ( this._.storedDialogs = {} ); + + dialog = storedDialogs[ dialogName ] || ( storedDialogs[ dialogName ] = new CKEDITOR.dialog( this, dialogName ) ); + + dialog.setModel( forceModel ); + + callback && callback.call( dialog, dialog ); + dialog.show(); + + } else if ( dialogDefinitions == 'failed' ) { + hideCover( this ); + throw new Error( '[CKEDITOR.dialog.openDialog] Dialog "' + dialogName + '" failed when loading definition.' ); + } else if ( typeof dialogDefinitions == 'string' ) { + + CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( dialogDefinitions ), + function() { + var dialogDefinition = CKEDITOR.dialog._.dialogDefinitions[ dialogName ]; + // In case of plugin error, mark it as loading failed. + if ( typeof dialogDefinition != 'function' ) + CKEDITOR.dialog._.dialogDefinitions[ dialogName ] = 'failed'; + + this.openDialog( dialogName, callback, forceModel ); + }, this, 0, 1 ); + } + + CKEDITOR.skin.loadPart( 'dialog' ); + + // Dissolve model, so `definition.getModel` can take precedence + // in the next dialog opening (#2423). + if ( dialog ) { + dialog.once( 'hide', function() { + dialog.setModel( null ); + }, null, null, 999 ); + } + + return dialog; + } + } ); +} )(); + +var stylesLoaded = false; + +CKEDITOR.plugins.registered['dialog'] = null; +CKEDITOR.plugins.add( 'dialog', { + requires: 'dialogui', + init: function( editor ) { + if ( !stylesLoaded ) { + CKEDITOR.document.appendStyleSheet( this.path + 'styles/dialog.css' ); + stylesLoaded = true; + } + + editor.on( 'doubleclick', function( evt ) { + if ( evt.data.dialog ) + editor.openDialog( evt.data.dialog ); + }, null, null, 999 ); + } +} ); +CKEDITOR.plugins.add( 'cmsdialog', { + requires: 'dialogui', + init: function( editor ) { + } +} ); + +// Dialog related configurations. + +/** + * The color of the dialog background cover. It should be a valid CSS color string. + * + * config.dialog_backgroundCoverColor = 'rgb(255, 254, 253)'; + * + * @cfg {String} [dialog_backgroundCoverColor='white'] + * @member CKEDITOR.config + */ + +/** + * The opacity of the dialog background cover. It should be a number within the + * range `[0.0, 1.0]`. + * + * config.dialog_backgroundCoverOpacity = 0.7; + * + * @cfg {Number} [dialog_backgroundCoverOpacity=0.5] + * @member CKEDITOR.config + */ + +/** + * If the dialog has more than one tab, put focus into the first tab as soon as dialog is opened. + * + * config.dialog_startupFocusTab = true; + * + * @cfg {Boolean} [dialog_startupFocusTab=false] + * @member CKEDITOR.config + */ + +/** + * The distance of magnetic borders used in moving and resizing dialogs, + * measured in pixels. + * + * config.dialog_magnetDistance = 30; + * + * @cfg {Number} [dialog_magnetDistance=20] + * @member CKEDITOR.config + */ + +/** + * The guideline to follow when generating the dialog buttons. There are 3 possible options: + * + * * `'OS'` - the buttons will be displayed in the default order of the user's OS; + * * `'ltr'` - for Left-To-Right order; + * * `'rtl'` - for Right-To-Left order. + * + * Example: + * + * config.dialog_buttonsOrder = 'rtl'; + * + * @since 3.5.0 + * @cfg {String} [dialog_buttonsOrder='OS'] + * @member CKEDITOR.config + */ + +/** + * The dialog contents to removed. It's a string composed by dialog name and tab name with a colon between them. + * + * Separate each pair with semicolon (see example). + * + * **Note:** All names are case-sensitive. + * + * **Note:** Be cautious when specifying dialog tabs that are mandatory, + * like `'info'`, dialog functionality might be broken because of this! + * + * config.removeDialogTabs = 'flash:advanced;image:Link'; + * + * @since 3.5.0 + * @cfg {String} [removeDialogTabs=''] + * @member CKEDITOR.config + */ + +/** + * Tells if user should not be asked to confirm close, if any dialog field was modified. + * By default it is set to `false` meaning that the confirmation dialog will be shown. + * + * config.dialog_noConfirmCancel = true; + * + * @since 4.3.0 + * @cfg {Boolean} [dialog_noConfirmCancel=false] + * @member CKEDITOR.config + */ + +/** + * Event fired when a dialog definition is about to be used to create a dialog in + * an editor instance. This event makes it possible to customize the definition + * before creating it. + * + * Note that this event is called only the first time a specific dialog is + * opened. Successive openings will use the cached dialog, and this event will + * not get fired. + * + * @event dialogDefinition + * @member CKEDITOR + * @param {Object} data + * @param {String} data.name The name of the dialog. + * @param {CKEDITOR.dialog.definition} data.definition The dialog definition that + * is being loaded. + * @param {CKEDITOR.dialog} data.dialog A dialog instance that the definition is loaded + * for. Introduced in **CKEditor 4.13.0**. + * @param {CKEDITOR.editor} editor The editor instance that will use the dialog. + */ + +/** + * Event fired when a tab is going to be selected in a dialog. + * + * @event selectPage + * @member CKEDITOR.dialog + * @param data + * @param {String} data.page The ID of the page that is going to be selected. + * @param {String} data.currentPage The ID of the current page. + */ + +/** + * Event fired when the user tries to dismiss a dialog. + * + * @event cancel + * @member CKEDITOR.dialog + * @param data + * @param {Boolean} data.hide Whether the event should proceed or not. + */ + +/** + * Event fired when the user tries to confirm a dialog. + * + * @event ok + * @member CKEDITOR.dialog + * @param data + * @param {Boolean} data.hide Whether the event should proceed or not. + */ + +/** + * Event fired when a dialog is shown. + * + * @event show + * @member CKEDITOR.dialog + */ + +/** + * Event fired when a dialog is shown. + * + * @event dialogShow + * @member CKEDITOR.editor + * @param {CKEDITOR.editor} editor This editor instance. + * @param {CKEDITOR.dialog} data The opened dialog instance. + */ + +/** + * Event fired when a dialog is hidden. + * + * @event hide + * @member CKEDITOR.dialog + */ + +/** + * Event fired when a dialog is hidden. + * + * @event dialogHide + * @member CKEDITOR.editor + * @param {CKEDITOR.editor} editor This editor instance. + * @param {CKEDITOR.dialog} data The hidden dialog instance. + */ + +/** + * Event fired when a dialog is being resized. The event is fired on + * both the {@link CKEDITOR.dialog} object and the dialog instance + * since 3.5.3, previously it was only available in the global object. + * + * @static + * @event resize + * @member CKEDITOR.dialog + * @param data + * @param {CKEDITOR.dialog} data.dialog The dialog being resized (if + * it is fired on the dialog itself, this parameter is not sent). + * @param {String} data.skin The skin name. + * @param {Number} data.width The new width. + * @param {Number} data.height The new height. + */ + +/** + * Event fired when a dialog is being resized. The event is fired on + * both the {@link CKEDITOR.dialog} object and the dialog instance + * since 3.5.3, previously it was only available in the global object. + * + * @since 3.5.0 + * @event resize + * @member CKEDITOR.dialog + * @param data + * @param {Number} data.width The new width. + * @param {Number} data.height The new height. + */ + +/** + * Event fired when the dialog state changes, usually by {@link CKEDITOR.dialog#setState}. + * + * @since 4.5.0 + * @event state + * @member CKEDITOR.dialog + * @param data + * @param {Number} data The new state. Either {@link CKEDITOR#DIALOG_STATE_IDLE} or {@link CKEDITOR#DIALOG_STATE_BUSY}. + */ +})(CMS.$); + + +/***/ }), + +/***/ "./private/js/ckeditor4_plugins/cmsplugins/plugin.js": +/*!***********************************************************!*\ + !*** ./private/js/ckeditor4_plugins/cmsplugins/plugin.js ***! + \***********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _cms_dialog__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../cms.dialog */ "./private/js/cms.dialog.js"); + + +(function ($) { + if (CKEDITOR && CKEDITOR.plugins && CKEDITOR.plugins.registered && CKEDITOR.plugins.registered.cmsplugins) { + return; + } + + /** + * Determine if we should return `div` or `span` based on the + * plugin markup. + * + * @function getFakePluginElement + * @private + * @param {String} pluginMarkup valid html hopefully + * @returns {String} div|span + */ + function getFakePluginElement(pluginMarkup) { + var innerTags = (pluginMarkup.match(/<\s*([^>\s]+)[\s\S]*?>/) || [0, false]).splice(1); + + var containsAnyBlockLikeElements = innerTags.some(function (tag) { + return tag && CKEDITOR.dtd.$block[tag]; + }); + + var fakeRealType = 'span'; + + if (containsAnyBlockLikeElements) { + fakeRealType = 'div'; + } + + return fakeRealType; + } + + /** + * @function replaceTagName + * @private + * @param {jQuery} elements + * @param {String} tagName + */ + function replaceTagName(elements, tagName) { + elements.each(function (i, el) { + var newElement; + + var element = $(el); + + newElement = $('<' + tagName + '>'); + + // attributes + $.each(el.attributes, function (index, attribute) { + newElement.attr(attribute.nodeName, attribute.nodeValue); + }); + + // content + newElement.html(element.html()); + + element.replaceWith(newElement); + }); + } + + CKEDITOR.plugins.add('CMSPlugins', { + + // Register the icons. They must match command names. + icons: 'CMSPlugins', + + // The plugin initialization logic goes inside this method. + init: function (editor) { + var that = this; + + CKEDITOR.on('instanceReady', function () { + var widgetInstances = []; + + for (var key in editor.widgets.instances) { + if (editor.widgets.instances.hasOwnProperty(key)) { + widgetInstances.push(editor.widgets.instances[key]); + } + } + + that.numberOfChildren = CKEDITOR.tools.array.filter(widgetInstances, function (i) { + return i.name === 'cms-widget'; + }).length; + }); + /** + * populated with _fresh_ child plugins + */ + this.unsaved_child_plugins = []; + + var settings = CMS_Editor.getSettings(editor.name); + console.log(settings); + this.setupCancelCleanupCallback(settings); + + // don't do anything if there are no plugins defined + if (settings === undefined || settings.plugins === undefined) { + return false; + } + + this.setupDialog(editor); + + // add the button + editor.ui.add('CMSPlugins', CKEDITOR.UI_PANELBUTTON, { + toolbar: 'cms,0', + label: settings.lang.CMSPlugins.title, + title: settings.lang.CMSPlugins.title, + className: 'cke_panelbutton__cmsplugins', + modes: { wysiwyg: 1 }, + editorFocus: 0, + + panel: { + css: [CKEDITOR.skin.getPath('editor')].concat(editor.config.contentsCss), + attributes: { 'role': 'cmsplugins', 'aria-label': settings.lang.CMSPlugins.aria } + }, + + // this is called when creating the dropdown list + onBlock: function (panel, block) { + console.log("onBlock", editor.plugins); + block.element.setHtml(editor.plugins.CMSPlugins.setupDropdown(editor)); + + var anchors = $(block.element.$).find('.cke_panel_listItem a'); + + anchors.bind('click', function (e) { + e.preventDefault(); + + that.addPlugin($(this), panel, editor); + }); + } + }); + + // handle edit event via context menu + if (editor.contextMenu) { + this.setupContextMenu(editor); + } + + editor.addCommand('cmspluginsEdit', { + exec: function () { + var element = that.getElementFromSelection(editor); + var plugin = that.getPluginWidget(element); + if (plugin) { + that.editPlugin(plugin, editor); + } + } + }); + + // handle edit event on double click + // if event is a jQuery event (touchend), than we mutate + // event a bit so we make the payload similar to what ckeditor.event produces + var handleEdit = function (event) { + event.stop(); + + if (event.type === 'touchend' || event.type === 'click') { + var cmsPluginNode = $(event.currentTarget).closest('cms-plugin')[0]; + var element; + + // pick cke_widget span + // eslint-disable-next-line new-cap + element = new CKEDITOR.dom.element(cmsPluginNode).getParent(); + + event.data = event.data || {}; + // have to fake selection to be able to replace markup after editing + editor.getSelection().fake(element); + } + + editor.execCommand('cmspluginsEdit'); + }; + + editor.on('doubleclick', handleEdit); + + editor.on('instanceReady', function () { +/* + var context = CMS.$('iframe.cke_wysiwyg_frame'); + if (context.length > 0) { + context = context.contentWindow.document.documentElement; + } else { + context = null; + } + CMS.$('cms-plugin', CMS.$('iframe.cke_wysiwyg_frame')[0] + .contentWindow.document.documentElement).on('click touchend', handleEdit); +*/ + }); + + this.setupDataProcessor(editor); + }, + + getElementFromSelection: function (editor) { + var selection = editor.getSelection(); + var element = selection.getSelectedElement() || + selection.getCommonAncestor().getAscendant('cms-plugin', true); + + return element; + }, + + getPluginWidget: function (element) { + if (!element) { + return null; + } + return element.getAscendant('cms-plugin', true) || element.findOne('cms-plugin'); + }, + + setupDialog: function (editor) { + var that = this; + var definition = function () { + return { + title: '', + minWidth: 200, + minHeight: 200, + contents: [{ + elements: [ + { + type: 'html', + html: '' + + '
'); + } + }, + { + name: 'spotify', + url: [ + /^open\.spotify\.com\/(artist\/\w+)/, + /^open\.spotify\.com\/(album\/\w+)/, + /^open\.spotify\.com\/(track\/\w+)/ + ], + html: match => { + const id = match[1]; + return ('
' + + `' + + '
'); + } + }, + { + name: 'youtube', + url: [ + /^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/, + /^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/, + /^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/, + /^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/ + ], + html: match => { + const id = match[1]; + const time = match[2]; + return ('
' + + `' + + '
'); + } + }, + { + name: 'vimeo', + url: [ + /^vimeo\.com\/(\d+)/, + /^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/, + /^vimeo\.com\/album\/[^/]+\/video\/(\d+)/, + /^vimeo\.com\/channels\/[^/]+\/(\d+)/, + /^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/, + /^vimeo\.com\/ondemand\/[^/]+\/(\d+)/, + /^player\.vimeo\.com\/video\/(\d+)/ + ], + html: match => { + const id = match[1]; + return ('
' + + `' + + '
'); + } + }, + { + name: 'instagram', + url: /^instagram\.com\/p\/(\w+)/ + }, + { + name: 'twitter', + url: /^twitter\.com/ + }, + { + name: 'googleMaps', + url: [ + /^google\.com\/maps/, + /^goo\.gl\/maps/, + /^maps\.google\.com/, + /^maps\.app\.goo\.gl/ + ] + }, + { + name: 'flickr', + url: /^flickr\.com/ + }, + { + name: 'facebook', + url: /^facebook\.com/ + } + ] + }); + this.registry = new _mediaregistry_js__WEBPACK_IMPORTED_MODULE_4__["default"](editor.locale, editor.config.get('mediaEmbed')); + } + /** + * @inheritDoc + */ + init() { + const editor = this.editor; + const schema = editor.model.schema; + const t = editor.t; + const conversion = editor.conversion; + const renderMediaPreview = editor.config.get('mediaEmbed.previewsInData'); + const elementName = editor.config.get('mediaEmbed.elementName'); + const registry = this.registry; + editor.commands.add('mediaEmbed', new _mediaembedcommand_js__WEBPACK_IMPORTED_MODULE_3__["default"](editor)); + // Configure the schema. + schema.register('media', { + inheritAllFrom: '$blockObject', + allowAttributes: ['url'] + }); + // Model -> Data + conversion.for('dataDowncast').elementToStructure({ + model: 'media', + view: (modelElement, { writer }) => { + const url = modelElement.getAttribute('url'); + return (0,_utils_js__WEBPACK_IMPORTED_MODULE_5__.createMediaFigureElement)(writer, registry, url, { + elementName, + renderMediaPreview: !!url && renderMediaPreview + }); + } + }); + // Model -> Data (url -> data-oembed-url) + conversion.for('dataDowncast').add((0,_converters_js__WEBPACK_IMPORTED_MODULE_2__.modelToViewUrlAttributeConverter)(registry, { + elementName, + renderMediaPreview + })); + // Model -> View (element) + conversion.for('editingDowncast').elementToStructure({ + model: 'media', + view: (modelElement, { writer }) => { + const url = modelElement.getAttribute('url'); + const figure = (0,_utils_js__WEBPACK_IMPORTED_MODULE_5__.createMediaFigureElement)(writer, registry, url, { + elementName, + renderForEditingView: true + }); + return (0,_utils_js__WEBPACK_IMPORTED_MODULE_5__.toMediaWidget)(figure, writer, t('media widget')); + } + }); + // Model -> View (url -> data-oembed-url) + conversion.for('editingDowncast').add((0,_converters_js__WEBPACK_IMPORTED_MODULE_2__.modelToViewUrlAttributeConverter)(registry, { + elementName, + renderForEditingView: true + })); + // View -> Model (data-oembed-url -> url) + conversion.for('upcast') + // Upcast semantic media. + .elementToElement({ + view: element => ['oembed', elementName].includes(element.name) && element.getAttribute('url') ? + { name: true } : + null, + model: (viewMedia, { writer }) => { + const url = viewMedia.getAttribute('url'); + if (registry.hasMedia(url)) { + return writer.createElement('media', { url }); + } + return null; + } + }) + // Upcast non-semantic media. + .elementToElement({ + view: { + name: 'div', + attributes: { + 'data-oembed-url': true + } + }, + model: (viewMedia, { writer }) => { + const url = viewMedia.getAttribute('data-oembed-url'); + if (registry.hasMedia(url)) { + return writer.createElement('media', { url }); + } + return null; + } + }) + // Consume `
` elements, that were left after upcast. + .add(dispatcher => { + const converter = (evt, data, conversionApi) => { + if (!conversionApi.consumable.consume(data.viewItem, { name: true, classes: 'media' })) { + return; + } + const { modelRange, modelCursor } = conversionApi.convertChildren(data.viewItem, data.modelCursor); + data.modelRange = modelRange; + data.modelCursor = modelCursor; + const modelElement = (0,ckeditor5_src_utils_js__WEBPACK_IMPORTED_MODULE_1__.first)(modelRange.getItems()); + if (!modelElement) { + // Revert consumed figure so other features can convert it. + conversionApi.consumable.revert(data.viewItem, { name: true, classes: 'media' }); + } + }; + dispatcher.on('element:figure', converter); + }); + } +} + + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-media-embed/src/mediaembedui.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-media-embed/src/mediaembedui.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ MediaEmbedUI) +/* harmony export */ }); +/* harmony import */ var ckeditor5_src_core_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core.js */ "./node_modules/ckeditor5/src/core.js"); +/* harmony import */ var ckeditor5_src_ui_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui.js */ "./node_modules/ckeditor5/src/ui.js"); +/* harmony import */ var _ui_mediaformview_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ui/mediaformview.js */ "./node_modules/@ckeditor/ckeditor5-media-embed/src/ui/mediaformview.js"); +/* harmony import */ var _mediaembedediting_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mediaembedediting.js */ "./node_modules/@ckeditor/ckeditor5-media-embed/src/mediaembedediting.js"); +/* harmony import */ var _theme_icons_media_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../theme/icons/media.svg */ "./node_modules/@ckeditor/ckeditor5-media-embed/theme/icons/media.svg"); +/** + * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ +/** + * @module media-embed/mediaembedui + */ + + + + + +/** + * The media embed UI plugin. + */ +class MediaEmbedUI extends ckeditor5_src_core_js__WEBPACK_IMPORTED_MODULE_0__.Plugin { + /** + * @inheritDoc + */ + static get requires() { + return [_mediaembedediting_js__WEBPACK_IMPORTED_MODULE_3__["default"]]; + } + /** + * @inheritDoc + */ + static get pluginName() { + return 'MediaEmbedUI'; + } + /** + * @inheritDoc + */ + init() { + const editor = this.editor; + const command = editor.commands.get('mediaEmbed'); + editor.ui.componentFactory.add('mediaEmbed', locale => { + const dropdown = (0,ckeditor5_src_ui_js__WEBPACK_IMPORTED_MODULE_1__.createDropdown)(locale); + this._setUpDropdown(dropdown, command); + return dropdown; + }); + } + _setUpDropdown(dropdown, command) { + const editor = this.editor; + const t = editor.t; + const button = dropdown.buttonView; + const registry = editor.plugins.get(_mediaembedediting_js__WEBPACK_IMPORTED_MODULE_3__["default"]).registry; + dropdown.once('change:isOpen', () => { + const form = new ((0,ckeditor5_src_ui_js__WEBPACK_IMPORTED_MODULE_1__.CssTransitionDisablerMixin)(_ui_mediaformview_js__WEBPACK_IMPORTED_MODULE_2__["default"]))(getFormValidators(editor.t, registry), editor.locale); + dropdown.panelView.children.add(form); + // Note: Use the low priority to make sure the following listener starts working after the + // default action of the drop-down is executed (i.e. the panel showed up). Otherwise, the + // invisible form/input cannot be focused/selected. + button.on('open', () => { + form.disableCssTransitions(); + // Make sure that each time the panel shows up, the URL field remains in sync with the value of + // the command. If the user typed in the input, then canceled (`urlInputView#fieldView#value` stays + // unaltered) and re-opened it without changing the value of the media command (e.g. because they + // didn't change the selection), they would see the old value instead of the actual value of the + // command. + form.url = command.value || ''; + form.urlInputView.fieldView.select(); + form.enableCssTransitions(); + }, { priority: 'low' }); + dropdown.on('submit', () => { + if (form.isValid()) { + editor.execute('mediaEmbed', form.url); + editor.editing.view.focus(); + } + }); + dropdown.on('change:isOpen', () => form.resetFormStatus()); + dropdown.on('cancel', () => { + editor.editing.view.focus(); + }); + form.delegate('submit', 'cancel').to(dropdown); + form.urlInputView.fieldView.bind('value').to(command, 'value'); + // Form elements should be read-only when corresponding commands are disabled. + form.urlInputView.bind('isEnabled').to(command, 'isEnabled'); + }); + dropdown.bind('isEnabled').to(command); + button.set({ + label: t('Insert media'), + icon: _theme_icons_media_svg__WEBPACK_IMPORTED_MODULE_4__["default"], + tooltip: true + }); + } +} +function getFormValidators(t, registry) { + return [ + form => { + if (!form.url.length) { + return t('The URL must not be empty.'); + } + }, + form => { + if (!registry.hasMedia(form.url)) { + return t('This media URL is not supported.'); + } + } + ]; +} + + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-media-embed/src/mediaregistry.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-media-embed/src/mediaregistry.js ***! + \***************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ MediaRegistry) +/* harmony export */ }); +/* harmony import */ var ckeditor5_src_ui_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui.js */ "./node_modules/ckeditor5/src/ui.js"); +/* harmony import */ var ckeditor5_src_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils.js */ "./node_modules/ckeditor5/src/utils.js"); +/* harmony import */ var _theme_icons_media_placeholder_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/media-placeholder.svg */ "./node_modules/@ckeditor/ckeditor5-media-embed/theme/icons/media-placeholder.svg"); +/** + * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + + + +const mediaPlaceholderIconViewBox = '0 0 64 42'; +/** + * A bridge between the raw media content provider definitions and the editor view content. + * + * It helps translating media URLs to corresponding {@link module:engine/view/element~Element view elements}. + * + * Mostly used by the {@link module:media-embed/mediaembedediting~MediaEmbedEditing} plugin. + */ +class MediaRegistry { + /** + * Creates an instance of the {@link module:media-embed/mediaregistry~MediaRegistry} class. + * + * @param locale The localization services instance. + * @param config The configuration of the media embed feature. + */ + constructor(locale, config) { + const providers = config.providers; + const extraProviders = config.extraProviders || []; + const removedProviders = new Set(config.removeProviders); + const providerDefinitions = providers + .concat(extraProviders) + .filter(provider => { + const name = provider.name; + if (!name) { + /** + * One of the providers (or extra providers) specified in the media embed configuration + * has no name and will not be used by the editor. In order to get this media + * provider working, double check your editor configuration. + * + * @error media-embed-no-provider-name + */ + (0,ckeditor5_src_utils_js__WEBPACK_IMPORTED_MODULE_1__.logWarning)('media-embed-no-provider-name', { provider }); + return false; + } + return !removedProviders.has(name); + }); + this.locale = locale; + this.providerDefinitions = providerDefinitions; + } + /** + * Checks whether the passed URL is representing a certain media type allowed in the editor. + * + * @param url The URL to be checked + */ + hasMedia(url) { + return !!this._getMedia(url); + } + /** + * For the given media URL string and options, it returns the {@link module:engine/view/element~Element view element} + * representing that media. + * + * **Note:** If no URL is specified, an empty view element is returned. + * + * @param writer The view writer used to produce a view element. + * @param url The URL to be translated into a view element. + */ + getMediaViewElement(writer, url, options) { + return this._getMedia(url).getViewElement(writer, options); + } + /** + * Returns a `Media` instance for the given URL. + * + * @param url The URL of the media. + * @returns The `Media` instance or `null` when there is none. + */ + _getMedia(url) { + if (!url) { + return new Media(this.locale); + } + url = url.trim(); + for (const definition of this.providerDefinitions) { + const previewRenderer = definition.html; + const pattern = (0,ckeditor5_src_utils_js__WEBPACK_IMPORTED_MODULE_1__.toArray)(definition.url); + for (const subPattern of pattern) { + const match = this._getUrlMatches(url, subPattern); + if (match) { + return new Media(this.locale, url, match, previewRenderer); + } + } + } + return null; + } + /** + * Tries to match `url` to `pattern`. + * + * @param url The URL of the media. + * @param pattern The pattern that should accept the media URL. + */ + _getUrlMatches(url, pattern) { + // 1. Try to match without stripping the protocol and "www" subdomain. + let match = url.match(pattern); + if (match) { + return match; + } + // 2. Try to match after stripping the protocol. + let rawUrl = url.replace(/^https?:\/\//, ''); + match = rawUrl.match(pattern); + if (match) { + return match; + } + // 3. Try to match after stripping the "www" subdomain. + rawUrl = rawUrl.replace(/^www\./, ''); + match = rawUrl.match(pattern); + if (match) { + return match; + } + return null; + } +} +/** + * Represents media defined by the provider configuration. + * + * It can be rendered to the {@link module:engine/view/element~Element view element} and used in the editing or data pipeline. + */ +class Media { + constructor(locale, url, match, previewRenderer) { + this.url = this._getValidUrl(url); + this._locale = locale; + this._match = match; + this._previewRenderer = previewRenderer; + } + /** + * Returns the view element representation of the media. + * + * @param writer The view writer used to produce a view element. + */ + getViewElement(writer, options) { + const attributes = {}; + let viewElement; + if (options.renderForEditingView || (options.renderMediaPreview && this.url && this._previewRenderer)) { + if (this.url) { + attributes['data-oembed-url'] = this.url; + } + if (options.renderForEditingView) { + attributes.class = 'ck-media__wrapper'; + } + const mediaHtml = this._getPreviewHtml(options); + viewElement = writer.createRawElement('div', attributes, (domElement, domConverter) => { + domConverter.setContentOf(domElement, mediaHtml); + }); + } + else { + if (this.url) { + attributes.url = this.url; + } + viewElement = writer.createEmptyElement(options.elementName, attributes); + } + writer.setCustomProperty('media-content', true, viewElement); + return viewElement; + } + /** + * Returns the HTML string of the media content preview. + */ + _getPreviewHtml(options) { + if (this._previewRenderer) { + return this._previewRenderer(this._match); + } + else { + // The placeholder only makes sense for editing view and media which have URLs. + // Placeholder is never displayed in data and URL-less media have no content. + if (this.url && options.renderForEditingView) { + return this._getPlaceholderHtml(); + } + return ''; + } + } + /** + * Returns the placeholder HTML when the media has no content preview. + */ + _getPlaceholderHtml() { + const icon = new ckeditor5_src_ui_js__WEBPACK_IMPORTED_MODULE_0__.IconView(); + const t = this._locale.t; + icon.content = _theme_icons_media_placeholder_svg__WEBPACK_IMPORTED_MODULE_2__["default"]; + icon.viewBox = mediaPlaceholderIconViewBox; + const placeholder = new ckeditor5_src_ui_js__WEBPACK_IMPORTED_MODULE_0__.Template({ + tag: 'div', + attributes: { + class: 'ck ck-reset_all ck-media__placeholder' + }, + children: [ + { + tag: 'div', + attributes: { + class: 'ck-media__placeholder__icon' + }, + children: [icon] + }, + { + tag: 'a', + attributes: { + class: 'ck-media__placeholder__url', + target: '_blank', + rel: 'noopener noreferrer', + href: this.url, + 'data-cke-tooltip-text': t('Open media in new tab') + }, + children: [ + { + tag: 'span', + attributes: { + class: 'ck-media__placeholder__url__text' + }, + children: [this.url] + } + ] + } + ] + }).render(); + return placeholder.outerHTML; + } + /** + * Returns the full URL to the specified media. + * + * @param url The URL of the media. + */ + _getValidUrl(url) { + if (!url) { + return null; + } + if (url.match(/^https?/)) { + return url; + } + return 'https://' + url; + } +} + + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-media-embed/src/ui/mediaformview.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-media-embed/src/ui/mediaformview.js ***! + \******************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ MediaFormView) +/* harmony export */ }); +/* harmony import */ var ckeditor5_src_ui_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui.js */ "./node_modules/ckeditor5/src/ui.js"); +/* harmony import */ var ckeditor5_src_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils.js */ "./node_modules/ckeditor5/src/utils.js"); +/* harmony import */ var ckeditor5_src_core_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core.js */ "./node_modules/ckeditor5/src/core.js"); +/* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css"); +/* harmony import */ var _theme_mediaform_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/mediaform.css */ "./node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaform.css"); +/** + * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ +/** + * @module media-embed/ui/mediaformview + */ + + + +// See: #8833. +// eslint-disable-next-line ckeditor5-rules/ckeditor-imports + + +/** + * The media form view controller class. + * + * See {@link module:media-embed/ui/mediaformview~MediaFormView}. + */ +class MediaFormView extends ckeditor5_src_ui_js__WEBPACK_IMPORTED_MODULE_0__.View { + /** + * @param validators Form validators used by {@link #isValid}. + * @param locale The localization services instance. + */ + constructor(validators, locale) { + super(locale); + const t = locale.t; + this.focusTracker = new ckeditor5_src_utils_js__WEBPACK_IMPORTED_MODULE_1__.FocusTracker(); + this.keystrokes = new ckeditor5_src_utils_js__WEBPACK_IMPORTED_MODULE_1__.KeystrokeHandler(); + this.set('mediaURLInputValue', ''); + this.urlInputView = this._createUrlInput(); + this.saveButtonView = this._createButton(t('Save'), ckeditor5_src_core_js__WEBPACK_IMPORTED_MODULE_2__.icons.check, 'ck-button-save'); + this.saveButtonView.type = 'submit'; + this.saveButtonView.bind('isEnabled').to(this, 'mediaURLInputValue', value => !!value); + this.cancelButtonView = this._createButton(t('Cancel'), ckeditor5_src_core_js__WEBPACK_IMPORTED_MODULE_2__.icons.cancel, 'ck-button-cancel', 'cancel'); + this._focusables = new ckeditor5_src_ui_js__WEBPACK_IMPORTED_MODULE_0__.ViewCollection(); + this._focusCycler = new ckeditor5_src_ui_js__WEBPACK_IMPORTED_MODULE_0__.FocusCycler({ + focusables: this._focusables, + focusTracker: this.focusTracker, + keystrokeHandler: this.keystrokes, + actions: { + // Navigate form fields backwards using the Shift + Tab keystroke. + focusPrevious: 'shift + tab', + // Navigate form fields forwards using the Tab key. + focusNext: 'tab' + } + }); + this._validators = validators; + this.setTemplate({ + tag: 'form', + attributes: { + class: [ + 'ck', + 'ck-media-form', + 'ck-responsive-form' + ], + tabindex: '-1' + }, + children: [ + this.urlInputView, + this.saveButtonView, + this.cancelButtonView + ] + }); + } + /** + * @inheritDoc + */ + render() { + super.render(); + (0,ckeditor5_src_ui_js__WEBPACK_IMPORTED_MODULE_0__.submitHandler)({ + view: this + }); + const childViews = [ + this.urlInputView, + this.saveButtonView, + this.cancelButtonView + ]; + childViews.forEach(v => { + // Register the view as focusable. + this._focusables.add(v); + // Register the view in the focus tracker. + this.focusTracker.add(v.element); + }); + // Start listening for the keystrokes coming from #element. + this.keystrokes.listenTo(this.element); + const stopPropagation = (data) => data.stopPropagation(); + // Since the form is in the dropdown panel which is a child of the toolbar, the toolbar's + // keystroke handler would take over the key management in the URL input. We need to prevent + // this ASAP. Otherwise, the basic caret movement using the arrow keys will be impossible. + this.keystrokes.set('arrowright', stopPropagation); + this.keystrokes.set('arrowleft', stopPropagation); + this.keystrokes.set('arrowup', stopPropagation); + this.keystrokes.set('arrowdown', stopPropagation); + } + /** + * @inheritDoc + */ + destroy() { + super.destroy(); + this.focusTracker.destroy(); + this.keystrokes.destroy(); + } + /** + * Focuses the fist {@link #_focusables} in the form. + */ + focus() { + this._focusCycler.focusFirst(); + } + /** + * The native DOM `value` of the {@link #urlInputView} element. + * + * **Note**: Do not confuse it with the {@link module:ui/inputtext/inputtextview~InputTextView#value} + * which works one way only and may not represent the actual state of the component in the DOM. + */ + get url() { + return this.urlInputView.fieldView.element.value.trim(); + } + set url(url) { + this.urlInputView.fieldView.element.value = url.trim(); + } + /** + * Validates the form and returns `false` when some fields are invalid. + */ + isValid() { + this.resetFormStatus(); + for (const validator of this._validators) { + const errorText = validator(this); + // One error per field is enough. + if (errorText) { + // Apply updated error. + this.urlInputView.errorText = errorText; + return false; + } + } + return true; + } + /** + * Cleans up the supplementary error and information text of the {@link #urlInputView} + * bringing them back to the state when the form has been displayed for the first time. + * + * See {@link #isValid}. + */ + resetFormStatus() { + this.urlInputView.errorText = null; + this.urlInputView.infoText = this._urlInputViewInfoDefault; + } + /** + * Creates a labeled input view. + * + * @returns Labeled input view instance. + */ + _createUrlInput() { + const t = this.locale.t; + const labeledInput = new ckeditor5_src_ui_js__WEBPACK_IMPORTED_MODULE_0__.LabeledFieldView(this.locale, ckeditor5_src_ui_js__WEBPACK_IMPORTED_MODULE_0__.createLabeledInputText); + const inputField = labeledInput.fieldView; + this._urlInputViewInfoDefault = t('Paste the media URL in the input.'); + this._urlInputViewInfoTip = t('Tip: Paste the URL into the content to embed faster.'); + labeledInput.label = t('Media URL'); + labeledInput.infoText = this._urlInputViewInfoDefault; + inputField.on('input', () => { + // Display the tip text only when there is some value. Otherwise fall back to the default info text. + labeledInput.infoText = inputField.element.value ? this._urlInputViewInfoTip : this._urlInputViewInfoDefault; + this.mediaURLInputValue = inputField.element.value.trim(); + }); + return labeledInput; + } + /** + * Creates a button view. + * + * @param label The button label. + * @param icon The button icon. + * @param className The additional button CSS class name. + * @param eventName An event name that the `ButtonView#execute` event will be delegated to. + * @returns The button view instance. + */ + _createButton(label, icon, className, eventName) { + const button = new ckeditor5_src_ui_js__WEBPACK_IMPORTED_MODULE_0__.ButtonView(this.locale); + button.set({ + label, + icon, + tooltip: true + }); + button.extendTemplate({ + attributes: { + class: className + } + }); + if (eventName) { + button.delegate('execute').to(this, eventName); + } + return button; + } +} + + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-media-embed/src/utils.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-media-embed/src/utils.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ createMediaFigureElement: () => (/* binding */ createMediaFigureElement), +/* harmony export */ getSelectedMediaModelWidget: () => (/* binding */ getSelectedMediaModelWidget), +/* harmony export */ getSelectedMediaViewWidget: () => (/* binding */ getSelectedMediaViewWidget), +/* harmony export */ insertMedia: () => (/* binding */ insertMedia), +/* harmony export */ isMediaWidget: () => (/* binding */ isMediaWidget), +/* harmony export */ toMediaWidget: () => (/* binding */ toMediaWidget) +/* harmony export */ }); +/* harmony import */ var ckeditor5_src_widget_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/widget.js */ "./node_modules/ckeditor5/src/widget.js"); +/** + * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * Converts a given {@link module:engine/view/element~Element} to a media embed widget: + * * Adds a {@link module:engine/view/element~Element#_setCustomProperty custom property} allowing to recognize the media widget element. + * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator. + * + * @param writer An instance of the view writer. + * @param label The element's label. + */ +function toMediaWidget(viewElement, writer, label) { + writer.setCustomProperty('media', true, viewElement); + return (0,ckeditor5_src_widget_js__WEBPACK_IMPORTED_MODULE_0__.toWidget)(viewElement, writer, { label }); +} +/** + * Returns a media widget editing view element if one is selected. + */ +function getSelectedMediaViewWidget(selection) { + const viewElement = selection.getSelectedElement(); + if (viewElement && isMediaWidget(viewElement)) { + return viewElement; + } + return null; +} +/** + * Checks if a given view element is a media widget. + */ +function isMediaWidget(viewElement) { + return !!viewElement.getCustomProperty('media') && (0,ckeditor5_src_widget_js__WEBPACK_IMPORTED_MODULE_0__.isWidget)(viewElement); +} +/** + * Creates a view element representing the media. Either a "semantic" one for the data pipeline: + * + * ```html + *
+ * + *
+ * ``` + * + * or a "non-semantic" (for the editing view pipeline): + * + * ```html + *
+ *
[ non-semantic media preview for "foo" ]
+ *
+ * ``` + */ +function createMediaFigureElement(writer, registry, url, options) { + return writer.createContainerElement('figure', { class: 'media' }, [ + registry.getMediaViewElement(writer, url, options), + writer.createSlot() + ]); +} +/** + * Returns a selected media element in the model, if any. + */ +function getSelectedMediaModelWidget(selection) { + const selectedElement = selection.getSelectedElement(); + if (selectedElement && selectedElement.is('element', 'media')) { + return selectedElement; + } + return null; +} +/** + * Creates a media element and inserts it into the model. + * + * **Note**: This method will use {@link module:engine/model/model~Model#insertContent `model.insertContent()`} logic of inserting content + * if no `insertPosition` is passed. + * + * @param url An URL of an embeddable media. + * @param findOptimalPosition If true it will try to find optimal position to insert media without breaking content + * in which a selection is. + */ +function insertMedia(model, url, selectable, findOptimalPosition) { + model.change(writer => { + const mediaElement = writer.createElement('media', { url }); + model.insertObject(mediaElement, selectable, null, { + setSelection: 'on', + findOptimalPosition: findOptimalPosition ? 'auto' : undefined + }); + }); +} + + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/augmentation.js": +/*!************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/augmentation.js ***! + \************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/** + * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + + + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/index.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/index.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Paragraph: () => (/* reexport safe */ _paragraph_js__WEBPACK_IMPORTED_MODULE_0__["default"]), +/* harmony export */ ParagraphButtonUI: () => (/* reexport safe */ _paragraphbuttonui_js__WEBPACK_IMPORTED_MODULE_1__["default"]) +/* harmony export */ }); +/* harmony import */ var _paragraph_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./paragraph.js */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js"); +/* harmony import */ var _paragraphbuttonui_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./paragraphbuttonui.js */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphbuttonui.js"); +/* harmony import */ var _augmentation_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./augmentation.js */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/augmentation.js"); +/** + * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ +/** + * @module paragraph + */ + + + + + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.js ***! + \**********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ InsertParagraphCommand) +/* harmony export */ }); +/* harmony import */ var _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core */ "./node_modules/@ckeditor/ckeditor5-core/src/index.js"); +/** + * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ +/** + * @module paragraph/insertparagraphcommand + */ + +/** + * The insert paragraph command. It inserts a new paragraph at a specific + * {@link module:engine/model/position~Position document position}. + * + * ```ts + * // Insert a new paragraph before an element in the document. + * editor.execute( 'insertParagraph', { + * position: editor.model.createPositionBefore( element ) + * } ); + * ``` + * + * If a paragraph is disallowed in the context of the specific position, the command + * will attempt to split position ancestors to find a place where it is possible + * to insert a paragraph. + * + * **Note**: This command moves the selection to the inserted paragraph. + */ +class InsertParagraphCommand extends _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__.Command { + constructor(editor) { + super(editor); + // Since this command passes position in execution block instead of selection, it should be checked directly. + this._isEnabledBasedOnSelection = false; + } + /** + * Executes the command. + * + * @param options Options for the executed command. + * @param options.position The model position at which the new paragraph will be inserted. + * @param options.attributes Attributes keys and values to set on a inserted paragraph. + * @fires execute + */ + execute(options) { + const model = this.editor.model; + const attributes = options.attributes; + let position = options.position; + // Don't execute command if position is in non-editable place. + if (!model.canEditAt(position)) { + return; + } + model.change(writer => { + position = this._findPositionToInsertParagraph(position, writer); + if (!position) { + return; + } + const paragraph = writer.createElement('paragraph'); + if (attributes) { + model.schema.setAllowedAttributes(paragraph, attributes, writer); + } + model.insertContent(paragraph, position); + writer.setSelection(paragraph, 'in'); + }); + } + /** + * Returns the best position to insert a new paragraph. + */ + _findPositionToInsertParagraph(position, writer) { + const model = this.editor.model; + if (model.schema.checkChild(position, 'paragraph')) { + return position; + } + const allowedParent = model.schema.findAllowedParent(position, 'paragraph'); + // It could be there's no ancestor limit that would allow paragraph. + // In theory, "paragraph" could be disallowed even in the "$root". + if (!allowedParent) { + return null; + } + const positionParent = position.parent; + const isTextAllowed = model.schema.checkChild(positionParent, '$text'); + // At empty $block or at the end of $block. + // [] ---> [] + // foo[] ---> foo[] + if (positionParent.isEmpty || isTextAllowed && position.isAtEnd) { + return model.createPositionAfter(positionParent); + } + // At the start of $block with text. + // []foo ---> []foo + if (!positionParent.isEmpty && isTextAllowed && position.isAtStart) { + return model.createPositionBefore(positionParent); + } + return writer.split(position, allowedParent).position; + } +} + + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _paragraphcommand_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./paragraphcommand.js */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js"); +/* harmony import */ var _insertparagraphcommand_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./insertparagraphcommand.js */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.js"); +/* harmony import */ var _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-core */ "./node_modules/@ckeditor/ckeditor5-core/src/index.js"); +/** + * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ +/** + * @module paragraph/paragraph + */ + + + +/** + * The paragraph feature for the editor. + * + * It introduces the `` element in the model which renders as a `

` element in the DOM and data. + * + * It also brings two editors commands: + * + * * The {@link module:paragraph/paragraphcommand~ParagraphCommand `'paragraph'`} command that converts all + * blocks in the model selection into paragraphs. + * * The {@link module:paragraph/insertparagraphcommand~InsertParagraphCommand `'insertParagraph'`} command + * that inserts a new paragraph at a specified location in the model. + */ +class Paragraph extends _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_2__.Plugin { + /** + * @inheritDoc + */ + static get pluginName() { + return 'Paragraph'; + } + /** + * @inheritDoc + */ + init() { + const editor = this.editor; + const model = editor.model; + editor.commands.add('paragraph', new _paragraphcommand_js__WEBPACK_IMPORTED_MODULE_0__["default"](editor)); + editor.commands.add('insertParagraph', new _insertparagraphcommand_js__WEBPACK_IMPORTED_MODULE_1__["default"](editor)); + // Schema. + model.schema.register('paragraph', { inheritAllFrom: '$block' }); + editor.conversion.elementToElement({ model: 'paragraph', view: 'p' }); + // Conversion for paragraph-like elements which has not been converted by any plugin. + editor.conversion.for('upcast').elementToElement({ + model: (viewElement, { writer }) => { + if (!Paragraph.paragraphLikeElements.has(viewElement.name)) { + return null; + } + // Do not auto-paragraph empty elements. + if (viewElement.isEmpty) { + return null; + } + return writer.createElement('paragraph'); + }, + view: /.+/, + converterPriority: 'low' + }); + } +} +/** + * A list of element names which should be treated by the autoparagraphing algorithms as + * paragraph-like. This means that e.g. the following content: + * + * ```html + *

Foo

+ * + * + * + * + * + *
X + *
    + *
  • Y
  • + *
  • Z
  • + *
+ *
+ * ``` + * + * contains five paragraph-like elements: `

`, two ``s and two `
  • `s. + * Hence, if none of the features is going to convert those elements the above content will be automatically handled + * by the paragraph feature and converted to: + * + * ```html + *

    Foo

    + *

    X

    + *

    Y

    + *

    Z

    + * ``` + * + * Note: The `` containing two `
  • ` elements was ignored as the innermost paragraph-like elements + * have a priority upon conversion. + */ +Paragraph.paragraphLikeElements = new Set([ + 'blockquote', + 'dd', + 'div', + 'dt', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'li', + 'p', + 'td', + 'th' +]); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Paragraph); + + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphbuttonui.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphbuttonui.js ***! + \*****************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ ParagraphButtonUI) +/* harmony export */ }); +/* harmony import */ var _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core */ "./node_modules/@ckeditor/ckeditor5-core/src/index.js"); +/* harmony import */ var _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui */ "./node_modules/@ckeditor/ckeditor5-ui/src/index.js"); +/* harmony import */ var _paragraph_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./paragraph.js */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js"); +/** + * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ +/** + * @module paragraph/paragraphbuttonui + */ + + + +const icon = _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__.icons.paragraph; +/** + * This plugin defines the `'paragraph'` button. It can be used together with + * {@link module:heading/headingbuttonsui~HeadingButtonsUI} to replace the standard heading dropdown. + * + * This plugin is not loaded automatically by the {@link module:paragraph/paragraph~Paragraph} plugin. It must + * be added manually. + * + * ```ts + * ClassicEditor + * .create( { + * plugins: [ ..., Heading, Paragraph, HeadingButtonsUI, ParagraphButtonUI ] + * toolbar: [ 'paragraph', 'heading1', 'heading2', 'heading3' ] + * } ) + * .then( ... ) + * .catch( ... ); + * ``` + */ +class ParagraphButtonUI extends _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__.Plugin { + /** + * @inheritDoc + */ + static get requires() { + return [_paragraph_js__WEBPACK_IMPORTED_MODULE_2__["default"]]; + } + /** + * @inheritDoc + */ + init() { + const editor = this.editor; + const t = editor.t; + editor.ui.componentFactory.add('paragraph', locale => { + const view = new _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_1__.ButtonView(locale); + const command = editor.commands.get('paragraph'); + view.label = t('Paragraph'); + view.icon = icon; + view.tooltip = true; + view.isToggleable = true; + view.bind('isEnabled').to(command); + view.bind('isOn').to(command, 'value'); + view.on('execute', () => { + editor.execute('paragraph'); + }); + return view; + }); + } +} + + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ ParagraphCommand) +/* harmony export */ }); +/* harmony import */ var _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core */ "./node_modules/@ckeditor/ckeditor5-core/src/index.js"); +/* harmony import */ var _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils */ "./node_modules/@ckeditor/ckeditor5-utils/src/index.js"); +/** + * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ +/** + * @module paragraph/paragraphcommand + */ + + +/** + * The paragraph command. + */ +class ParagraphCommand extends _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__.Command { + constructor(editor) { + super(editor); + // Since this command may pass selection in execution block, it should be checked directly. + this._isEnabledBasedOnSelection = false; + } + /** + * @inheritDoc + */ + refresh() { + const model = this.editor.model; + const document = model.document; + const block = (0,_ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_1__.first)(document.selection.getSelectedBlocks()); + this.value = !!block && block.is('element', 'paragraph'); + this.isEnabled = !!block && checkCanBecomeParagraph(block, model.schema); + } + /** + * Executes the command. All the blocks (see {@link module:engine/model/schema~Schema}) in the selection + * will be turned to paragraphs. + * + * @fires execute + * @param options Options for the executed command. + * @param options.selection The selection that the command should be applied to. By default, + * if not provided, the command is applied to the {@link module:engine/model/document~Document#selection}. + */ + execute(options = {}) { + const model = this.editor.model; + const document = model.document; + const selection = options.selection || document.selection; + // Don't execute command if selection is in non-editable place. + if (!model.canEditAt(selection)) { + return; + } + model.change(writer => { + const blocks = selection.getSelectedBlocks(); + for (const block of blocks) { + if (!block.is('element', 'paragraph') && checkCanBecomeParagraph(block, model.schema)) { + writer.rename(block, 'paragraph'); + } + } + }); + } +} +/** + * Checks whether the given block can be replaced by a paragraph. + * + * @param block A block to be tested. + * @param schema The schema of the document. + */ +function checkCanBecomeParagraph(block, schema) { + return schema.checkChild(block.parent, 'paragraph') && !schema.isObject(block); +} + + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/br.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/br.js ***! + \******************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ transformBlockBrsToParagraphs) +/* harmony export */ }); +/* harmony import */ var ckeditor5_src_engine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine.js */ "./node_modules/ckeditor5/src/engine.js"); +/** + * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ +/** + * @module paste-from-office/filters/br + */ + +/** + * Transforms `
    ` elements that are siblings to some block element into a paragraphs. + * + * @param documentFragment The view structure to be transformed. + */ +function transformBlockBrsToParagraphs(documentFragment, writer) { + const viewDocument = new ckeditor5_src_engine_js__WEBPACK_IMPORTED_MODULE_0__.ViewDocument(writer.document.stylesProcessor); + const domConverter = new ckeditor5_src_engine_js__WEBPACK_IMPORTED_MODULE_0__.DomConverter(viewDocument, { renderingMode: 'data' }); + const blockElements = domConverter.blockElements; + const inlineObjectElements = domConverter.inlineObjectElements; + const elementsToReplace = []; + for (const value of writer.createRangeIn(documentFragment)) { + const element = value.item; + if (element.is('element', 'br')) { + const nextSibling = findSibling(element, 'forward', writer, { blockElements, inlineObjectElements }); + const previousSibling = findSibling(element, 'backward', writer, { blockElements, inlineObjectElements }); + const nextSiblingIsBlock = isBlockViewElement(nextSibling, blockElements); + const previousSiblingIsBlock = isBlockViewElement(previousSibling, blockElements); + // If the
    is surrounded by blocks then convert it to a paragraph: + // *

    foo

    [
    ]

    bar

    ->

    foo

    [

    ]

    bar

    + // *

    foo

    [
    ] ->

    foo

    [

    ] + // * [
    ]

    foo

    -> [

    ]

    foo

    + if (previousSiblingIsBlock || nextSiblingIsBlock) { + elementsToReplace.push(element); + } + } + } + for (const element of elementsToReplace) { + if (element.hasClass('Apple-interchange-newline')) { + writer.remove(element); + } + else { + writer.replace(element, writer.createElement('p')); + } + } +} +/** + * Returns sibling node, threats inline elements as transparent (but should stop on an inline objects). + */ +function findSibling(viewElement, direction, writer, { blockElements, inlineObjectElements }) { + let position = writer.createPositionAt(viewElement, direction == 'forward' ? 'after' : 'before'); + // Find first position that is just before a first: + // * text node, + // * block element, + // * inline object element. + // It's ignoring any inline (non-object) elements like span, strong, etc. + position = position.getLastMatchingPosition(({ item }) => (item.is('element') && + !blockElements.includes(item.name) && + !inlineObjectElements.includes(item.name)), { direction }); + return direction == 'forward' ? position.nodeAfter : position.nodeBefore; +} +/** + * Returns true for view elements that are listed as block view elements. + */ +function isBlockViewElement(node, blockElements) { + return !!node && node.is('element') && blockElements.includes(node.name); +} + + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/image.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/image.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ _convertHexToBase64: () => (/* binding */ _convertHexToBase64), +/* harmony export */ replaceImagesSourceWithBase64: () => (/* binding */ replaceImagesSourceWithBase64) +/* harmony export */ }); +/* harmony import */ var ckeditor5_src_engine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine.js */ "./node_modules/ckeditor5/src/engine.js"); +/** + * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ +/** + * @module paste-from-office/filters/image + */ +/* globals btoa */ + +/** + * Replaces source attribute of all `` elements representing regular + * images (not the Word shapes) with inlined base64 image representation extracted from RTF or Blob data. + * + * @param documentFragment Document fragment on which transform images. + * @param rtfData The RTF data from which images representation will be used. + */ +function replaceImagesSourceWithBase64(documentFragment, rtfData) { + if (!documentFragment.childCount) { + return; + } + const upcastWriter = new ckeditor5_src_engine_js__WEBPACK_IMPORTED_MODULE_0__.UpcastWriter(documentFragment.document); + const shapesIds = findAllShapesIds(documentFragment, upcastWriter); + removeAllImgElementsRepresentingShapes(shapesIds, documentFragment, upcastWriter); + insertMissingImgs(shapesIds, documentFragment, upcastWriter); + removeAllShapeElements(documentFragment, upcastWriter); + const images = findAllImageElementsWithLocalSource(documentFragment, upcastWriter); + if (images.length) { + replaceImagesFileSourceWithInlineRepresentation(images, extractImageDataFromRtf(rtfData), upcastWriter); + } +} +/** + * Converts given HEX string to base64 representation. + * + * @internal + * @param hexString The HEX string to be converted. + * @returns Base64 representation of a given HEX string. + */ +function _convertHexToBase64(hexString) { + return btoa(hexString.match(/\w{2}/g).map(char => { + return String.fromCharCode(parseInt(char, 16)); + }).join('')); +} +/** + * Finds all shapes (`...`) ids. Shapes can represent images (canvas) + * or Word shapes (which does not have RTF or Blob representation). + * + * @param documentFragment Document fragment from which to extract shape ids. + * @returns Array of shape ids. + */ +function findAllShapesIds(documentFragment, writer) { + const range = writer.createRangeIn(documentFragment); + const shapeElementsMatcher = new ckeditor5_src_engine_js__WEBPACK_IMPORTED_MODULE_0__.Matcher({ + name: /v:(.+)/ + }); + const shapesIds = []; + for (const value of range) { + if (value.type != 'elementStart') { + continue; + } + const el = value.item; + const previousSibling = el.previousSibling; + const prevSiblingName = previousSibling && previousSibling.is('element') ? previousSibling.name : null; + // If shape element have 'o:gfxdata' attribute and is not directly before `` element it means it represent Word shape. + if (shapeElementsMatcher.match(el) && el.getAttribute('o:gfxdata') && prevSiblingName !== 'v:shapetype') { + shapesIds.push(value.item.getAttribute('id')); + } + } + return shapesIds; +} +/** + * Removes all `` elements which represents Word shapes and not regular images. + * + * @param shapesIds Shape ids which will be checked against `` elements. + * @param documentFragment Document fragment from which to remove `` elements. + */ +function removeAllImgElementsRepresentingShapes(shapesIds, documentFragment, writer) { + const range = writer.createRangeIn(documentFragment); + const imageElementsMatcher = new ckeditor5_src_engine_js__WEBPACK_IMPORTED_MODULE_0__.Matcher({ + name: 'img' + }); + const imgs = []; + for (const value of range) { + if (value.item.is('element') && imageElementsMatcher.match(value.item)) { + const el = value.item; + const shapes = el.getAttribute('v:shapes') ? el.getAttribute('v:shapes').split(' ') : []; + if (shapes.length && shapes.every(shape => shapesIds.indexOf(shape) > -1)) { + imgs.push(el); + // Shapes may also have empty source while content is paste in some browsers (Safari). + } + else if (!el.getAttribute('src')) { + imgs.push(el); + } + } + } + for (const img of imgs) { + writer.remove(img); + } +} +/** + * Removes all shape elements (`...`) so they do not pollute the output structure. + * + * @param documentFragment Document fragment from which to remove shape elements. + */ +function removeAllShapeElements(documentFragment, writer) { + const range = writer.createRangeIn(documentFragment); + const shapeElementsMatcher = new ckeditor5_src_engine_js__WEBPACK_IMPORTED_MODULE_0__.Matcher({ + name: /v:(.+)/ + }); + const shapes = []; + for (const value of range) { + if (value.type == 'elementStart' && shapeElementsMatcher.match(value.item)) { + shapes.push(value.item); + } + } + for (const shape of shapes) { + writer.remove(shape); + } +} +/** + * Inserts `img` tags if there is none after a shape. + */ +function insertMissingImgs(shapeIds, documentFragment, writer) { + const range = writer.createRangeIn(documentFragment); + const shapes = []; + for (const value of range) { + if (value.type == 'elementStart' && value.item.is('element', 'v:shape')) { + const id = value.item.getAttribute('id'); + if (shapeIds.includes(id)) { + continue; + } + if (!containsMatchingImg(value.item.parent.getChildren(), id)) { + shapes.push(value.item); + } + } + } + for (const shape of shapes) { + const attrs = { + src: findSrc(shape) + }; + if (shape.hasAttribute('alt')) { + attrs.alt = shape.getAttribute('alt'); + } + const img = writer.createElement('img', attrs); + writer.insertChild(shape.index + 1, img, shape.parent); + } + function containsMatchingImg(nodes, id) { + for (const node of nodes) { + /* istanbul ignore else -- @preserve */ + if (node.is('element')) { + if (node.name == 'img' && node.getAttribute('v:shapes') == id) { + return true; + } + if (containsMatchingImg(node.getChildren(), id)) { + return true; + } + } + } + return false; + } + function findSrc(shape) { + for (const child of shape.getChildren()) { + /* istanbul ignore else -- @preserve */ + if (child.is('element') && child.getAttribute('src')) { + return child.getAttribute('src'); + } + } + } +} +/** + * Finds all `` elements in a given document fragment which have source pointing to local `file://` resource. + * + * @param documentFragment Document fragment in which to look for `` elements. + * @returns result All found images grouped by source type. + */ +function findAllImageElementsWithLocalSource(documentFragment, writer) { + const range = writer.createRangeIn(documentFragment); + const imageElementsMatcher = new ckeditor5_src_engine_js__WEBPACK_IMPORTED_MODULE_0__.Matcher({ + name: 'img' + }); + const imgs = []; + for (const value of range) { + if (value.item.is('element') && imageElementsMatcher.match(value.item)) { + if (value.item.getAttribute('src').startsWith('file://')) { + imgs.push(value.item); + } + } + } + return imgs; +} +/** + * Extracts all images HEX representations from a given RTF data. + * + * @param rtfData The RTF data from which to extract images HEX representation. + * @returns Array of found HEX representations. Each array item is an object containing: + * + * * hex Image representation in HEX format. + * * type Type of image, `image/png` or `image/jpeg`. + */ +function extractImageDataFromRtf(rtfData) { + if (!rtfData) { + return []; + } + const regexPictureHeader = /{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/; + const regexPicture = new RegExp('(?:(' + regexPictureHeader.source + '))([\\da-fA-F\\s]+)\\}', 'g'); + const images = rtfData.match(regexPicture); + const result = []; + if (images) { + for (const image of images) { + let imageType = false; + if (image.includes('\\pngblip')) { + imageType = 'image/png'; + } + else if (image.includes('\\jpegblip')) { + imageType = 'image/jpeg'; + } + if (imageType) { + result.push({ + hex: image.replace(regexPictureHeader, '').replace(/[^\da-fA-F]/g, ''), + type: imageType + }); + } + } + } + return result; +} +/** + * Replaces `src` attribute value of all given images with the corresponding base64 image representation. + * + * @param imageElements Array of image elements which will have its source replaced. + * @param imagesHexSources Array of images hex sources (usually the result of `extractImageDataFromRtf()` function). + * The array should be the same length as `imageElements` parameter. + */ +function replaceImagesFileSourceWithInlineRepresentation(imageElements, imagesHexSources, writer) { + // Assume there is an equal amount of image elements and images HEX sources so they can be matched accordingly based on existing order. + if (imageElements.length === imagesHexSources.length) { + for (let i = 0; i < imageElements.length; i++) { + const newSrc = `data:${imagesHexSources[i].type};base64,${_convertHexToBase64(imagesHexSources[i].hex)}`; + writer.setAttribute('src', newSrc, imageElements[i]); + } + } +} + + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js ***! + \********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ transformListItemLikeElementsIntoLists: () => (/* binding */ transformListItemLikeElementsIntoLists), +/* harmony export */ unwrapParagraphInListItem: () => (/* binding */ unwrapParagraphInListItem) +/* harmony export */ }); +/* harmony import */ var ckeditor5_src_engine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine.js */ "./node_modules/ckeditor5/src/engine.js"); +/** + * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ +/** + * @module paste-from-office/filters/list + */ + +/** + * Transforms Word specific list-like elements to the semantic HTML lists. + * + * Lists in Word are represented by block elements with special attributes like: + * + * ```xml + *

    ...

    // Paragraph based list. + *

    ...

    // Heading 1 based list. + * ``` + * + * @param documentFragment The view structure to be transformed. + * @param stylesString Styles from which list-like elements styling will be extracted. + */ +function transformListItemLikeElementsIntoLists(documentFragment, stylesString) { + if (!documentFragment.childCount) { + return; + } + const writer = new ckeditor5_src_engine_js__WEBPACK_IMPORTED_MODULE_0__.UpcastWriter(documentFragment.document); + const itemLikeElements = findAllItemLikeElements(documentFragment, writer); + if (!itemLikeElements.length) { + return; + } + let currentList = null; + let currentIndentation = 1; + itemLikeElements.forEach((itemLikeElement, i) => { + const isDifferentList = isNewListNeeded(itemLikeElements[i - 1], itemLikeElement); + const previousItemLikeElement = isDifferentList ? null : itemLikeElements[i - 1]; + const indentationDifference = getIndentationDifference(previousItemLikeElement, itemLikeElement); + if (isDifferentList) { + currentList = null; + currentIndentation = 1; + } + if (!currentList || indentationDifference !== 0) { + const listStyle = detectListStyle(itemLikeElement, stylesString); + if (!currentList) { + currentList = insertNewEmptyList(listStyle, itemLikeElement.element, writer); + } + else if (itemLikeElement.indent > currentIndentation) { + const lastListItem = currentList.getChild(currentList.childCount - 1); + const lastListItemChild = lastListItem.getChild(lastListItem.childCount - 1); + currentList = insertNewEmptyList(listStyle, lastListItemChild, writer); + currentIndentation += 1; + } + else if (itemLikeElement.indent < currentIndentation) { + const differentIndentation = currentIndentation - itemLikeElement.indent; + currentList = findParentListAtLevel(currentList, differentIndentation); + currentIndentation = itemLikeElement.indent; + } + if (itemLikeElement.indent <= currentIndentation) { + if (!currentList.is('element', listStyle.type)) { + currentList = writer.rename(listStyle.type, currentList); + } + } + } + const listItem = transformElementIntoListItem(itemLikeElement.element, writer); + writer.appendChild(listItem, currentList); + }); +} +/** + * Removes paragraph wrapping content inside a list item. + */ +function unwrapParagraphInListItem(documentFragment, writer) { + for (const value of writer.createRangeIn(documentFragment)) { + const element = value.item; + if (element.is('element', 'li')) { + // Google Docs allows for single paragraph inside LI. + const firstChild = element.getChild(0); + if (firstChild && firstChild.is('element', 'p')) { + writer.unwrapElement(firstChild); + } + } + } +} +/** + * Finds all list-like elements in a given document fragment. + * + * @param documentFragment Document fragment in which to look for list-like nodes. + * @returns Array of found list-like items. Each item is an object containing: + */ +function findAllItemLikeElements(documentFragment, writer) { + const range = writer.createRangeIn(documentFragment); + // Matcher for finding list-like elements. + const itemLikeElementsMatcher = new ckeditor5_src_engine_js__WEBPACK_IMPORTED_MODULE_0__.Matcher({ + name: /^p|h\d+$/, + styles: { + 'mso-list': /.*/ + } + }); + const itemLikeElements = []; + for (const value of range) { + if (value.type === 'elementStart' && itemLikeElementsMatcher.match(value.item)) { + const itemData = getListItemData(value.item); + itemLikeElements.push({ + element: value.item, + id: itemData.id, + order: itemData.order, + indent: itemData.indent + }); + } + } + return itemLikeElements; +} +/** + * Extracts list item style from the provided CSS. + * + * List item style is extracted from the CSS stylesheet. Each list with its specific style attribute + * value (`mso-list:l1 level1 lfo1`) has its dedicated properties in a CSS stylesheet defined with a selector like: + * + * ```css + * @list l1:level1 { ... } + * ``` + * + * It contains `mso-level-number-format` property which defines list numbering/bullet style. If this property + * is not defined it means default `decimal` numbering. + * + * Here CSS string representation is used as `mso-level-number-format` property is an invalid CSS property + * and will be removed during CSS parsing. + * + * @param listLikeItem List-like item for which list style will be searched for. Usually + * a result of `findAllItemLikeElements()` function. + * @param stylesString CSS stylesheet. + * @returns An object with properties: + * + * * type - List type, could be `ul` or `ol`. + * * startIndex - List start index, valid only for ordered lists. + * * style - List style, for example: `decimal`, `lower-roman`, etc. It is extracted + * directly from Word stylesheet and adjusted to represent proper values for the CSS `list-style-type` property. + * If it cannot be adjusted, the `null` value is returned. + */ +function detectListStyle(listLikeItem, stylesString) { + const listStyleRegexp = new RegExp(`@list l${listLikeItem.id}:level${listLikeItem.indent}\\s*({[^}]*)`, 'gi'); + const listStyleTypeRegex = /mso-level-number-format:([^;]{0,100});/gi; + const listStartIndexRegex = /mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi; + const listStyleMatch = listStyleRegexp.exec(stylesString); + let listStyleType = 'decimal'; // Decimal is default one. + let type = 'ol'; //
      is default list. + let startIndex = null; + if (listStyleMatch && listStyleMatch[1]) { + const listStyleTypeMatch = listStyleTypeRegex.exec(listStyleMatch[1]); + if (listStyleTypeMatch && listStyleTypeMatch[1]) { + listStyleType = listStyleTypeMatch[1].trim(); + type = listStyleType !== 'bullet' && listStyleType !== 'image' ? 'ol' : 'ul'; + } + // Styles for the numbered lists are always defined in the Word CSS stylesheet. + // Unordered lists MAY contain a value for the Word CSS definition `mso-level-text` but sometimes + // this tag is missing. And because of that, we cannot depend on that. We need to predict the list style value + // based on the list style marker element. + if (listStyleType === 'bullet') { + const bulletedStyle = findBulletedListStyle(listLikeItem.element); + if (bulletedStyle) { + listStyleType = bulletedStyle; + } + } + else { + const listStartIndexMatch = listStartIndexRegex.exec(listStyleMatch[1]); + if (listStartIndexMatch && listStartIndexMatch[1]) { + startIndex = parseInt(listStartIndexMatch[1]); + } + } + } + return { + type, + startIndex, + style: mapListStyleDefinition(listStyleType) + }; +} +/** + * Tries to extract the `list-style-type` value based on the marker element for bulleted list. + */ +function findBulletedListStyle(element) { + const listMarkerElement = findListMarkerNode(element); + if (!listMarkerElement) { + return null; + } + const listMarker = listMarkerElement._data; + if (listMarker === 'o') { + return 'circle'; + } + else if (listMarker === '·') { + return 'disc'; + } + // Word returns '§' instead of '■' for the square list style. + else if (listMarker === '§') { + return 'square'; + } + return null; +} +/** + * Tries to find a text node that represents the marker element (list-style-type). + */ +function findListMarkerNode(element) { + // If the first child is a text node, it is the data for the element. + // The list-style marker is not present here. + if (element.getChild(0).is('$text')) { + return null; + } + for (const childNode of element.getChildren()) { + // The list-style marker will be inside the `` element. Let's ignore all non-span elements. + // It may happen that the `` element is added as the first child. Most probably, it's an anchor element. + if (!childNode.is('element', 'span')) { + continue; + } + const textNodeOrElement = childNode.getChild(0); + if (!textNodeOrElement) { + continue; + } + // If already found the marker element, use it. + if (textNodeOrElement.is('$text')) { + return textNodeOrElement; + } + return textNodeOrElement.getChild(0); + } + /* istanbul ignore next -- @preserve */ + return null; +} +/** + * Parses the `list-style-type` value extracted directly from the Word CSS stylesheet and returns proper CSS definition. + */ +function mapListStyleDefinition(value) { + if (value.startsWith('arabic-leading-zero')) { + return 'decimal-leading-zero'; + } + switch (value) { + case 'alpha-upper': + return 'upper-alpha'; + case 'alpha-lower': + return 'lower-alpha'; + case 'roman-upper': + return 'upper-roman'; + case 'roman-lower': + return 'lower-roman'; + case 'circle': + case 'disc': + case 'square': + return value; + default: + return null; + } +} +/** + * Creates an empty list of a given type and inserts it after a specified element. + * + * @param listStyle List style object which determines the type of newly created list. + * Usually a result of `detectListStyle()` function. + * @param element Element after which list is inserted. + * @returns Newly created list element. + */ +function insertNewEmptyList(listStyle, element, writer) { + const parent = element.parent; + const list = writer.createElement(listStyle.type); + const position = parent.getChildIndex(element) + 1; + writer.insertChild(position, list, parent); + // We do not support modifying the marker for a particular list item. + // Set the value for the `list-style-type` property directly to the list container. + if (listStyle.style) { + writer.setStyle('list-style-type', listStyle.style, list); + } + if (listStyle.startIndex && listStyle.startIndex > 1) { + writer.setAttribute('start', listStyle.startIndex, list); + } + return list; +} +/** + * Transforms a given element into a semantic list item. As the function operates on a provided + * {module:engine/src/view/element~Element element} it will modify the view structure to which this element belongs. + * + * @param element Element which will be transformed into a list item. + * @returns New element to which the given one was transformed. It is + * inserted in place of the old element (the reference to the old element is lost due to renaming). + */ +function transformElementIntoListItem(element, writer) { + removeBulletElement(element, writer); + writer.removeStyle('text-indent', element); // #12361 + return writer.rename('li', element); +} +/** + * Extracts list item information from Word specific list-like element style: + * + * ``` + * `style="mso-list:l1 level1 lfo1"` + * ``` + * + * where: + * + * ``` + * * `l1` is a list id (however it does not mean this is a continuous list - see #43), + * * `level1` is a list item indentation level, + * * `lfo1` is a list insertion order in a document. + * ``` + * + * @param element Element from which style data is extracted. + */ +function getListItemData(element) { + const data = {}; + const listStyle = element.getStyle('mso-list'); + if (listStyle) { + const idMatch = listStyle.match(/(^|\s{1,100})l(\d+)/i); + const orderMatch = listStyle.match(/\s{0,100}lfo(\d+)/i); + const indentMatch = listStyle.match(/\s{0,100}level(\d+)/i); + if (idMatch && orderMatch && indentMatch) { + data.id = idMatch[2]; + data.order = orderMatch[1]; + data.indent = parseInt(indentMatch[1]); + } + } + return data; +} +/** + * Removes span with a numbering/bullet from a given element. + */ +function removeBulletElement(element, writer) { + // Matcher for finding `span` elements holding lists numbering/bullets. + const bulletMatcher = new ckeditor5_src_engine_js__WEBPACK_IMPORTED_MODULE_0__.Matcher({ + name: 'span', + styles: { + 'mso-list': 'Ignore' + } + }); + const range = writer.createRangeIn(element); + for (const value of range) { + if (value.type === 'elementStart' && bulletMatcher.match(value.item)) { + writer.remove(value.item); + } + } +} +/** + * Whether the previous and current items belong to the same list. It is determined based on `item.id` + * (extracted from `mso-list` style, see #getListItemData) and a previous sibling of the current item. + * + * However, it's quite easy to change the `id` attribute for nested lists in Word. It will break the list feature while pasting. + * Let's check also the `indent` attribute. If the difference between those two elements is equal to 1, we can assume that + * the `currentItem` is a beginning of the nested list because lists in CKEditor 5 always start with the `indent=0` attribute. + * See: https://github.com/ckeditor/ckeditor5/issues/7805. + */ +function isNewListNeeded(previousItem, currentItem) { + if (!previousItem) { + return true; + } + if (previousItem.id !== currentItem.id) { + // See: https://github.com/ckeditor/ckeditor5/issues/7805. + // + // * List item 1. + // - Nested list item 1. + if (currentItem.indent - previousItem.indent === 1) { + return false; + } + return true; + } + const previousSibling = currentItem.element.previousSibling; + if (!previousSibling) { + return true; + } + // Even with the same id the list does not have to be continuous (#43). + return !isList(previousSibling); +} +function isList(element) { + return element.is('element', 'ol') || element.is('element', 'ul'); +} +/** + * Calculates the indentation difference between two given list items (based on the indent attribute + * extracted from the `mso-list` style, see #getListItemData). + */ +function getIndentationDifference(previousItem, currentItem) { + return previousItem ? currentItem.indent - previousItem.indent : currentItem.indent - 1; +} +/** + * Finds the parent list element (ul/ol) of a given list element with indentation level lower by a given value. + * + * @param listElement List element from which to start looking for a parent list. + * @param indentationDifference Indentation difference between lists. + * @returns Found list element with indentation level lower by a given value. + */ +function findParentListAtLevel(listElement, indentationDifference) { + const ancestors = listElement.getAncestors({ parentFirst: true }); + let parentList = null; + let levelChange = 0; + for (const ancestor of ancestors) { + if (ancestor.is('element', 'ul') || ancestor.is('element', 'ol')) { + levelChange++; + } + if (levelChange === indentationDifference) { + parentList = ancestor; + break; + } + } + return parentList; +} + + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/parse.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/parse.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ parseHtml: () => (/* binding */ parseHtml) +/* harmony export */ }); +/* harmony import */ var ckeditor5_src_engine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine.js */ "./node_modules/ckeditor5/src/engine.js"); +/* harmony import */ var _space_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./space.js */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/space.js"); +/** + * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ +/** + * @module paste-from-office/filters/parse + */ +/* globals DOMParser */ + + +/** + * Parses the provided HTML extracting contents of `` and ``); + const root = this.attachShadow({ mode: 'open' }); + root.appendChild(template.content.cloneNode(true)); + root.addEventListener('move', this); + this[$parts] = this[$sliders].map((slider) => new slider(root)); + } + connectedCallback() { + // A user may set a property on an _instance_ of an element, + // before its prototype has been connected to this class. + // If so, we need to run it through the proper class setter. + if (this.hasOwnProperty('color')) { + const value = this.color; + delete this['color']; + this.color = value; + } + else if (!this.color) { + this.color = this.colorModel.defaultColor; + } + } + attributeChangedCallback(_attr, _oldVal, newVal) { + const color = this.colorModel.fromAttr(newVal); + if (!this[$isSame](color)) { + this.color = color; + } + } + handleEvent(event) { + // Merge the current HSV color object with updated params. + const oldHsva = this[$hsva]; + const newHsva = { ...oldHsva, ...event.detail }; + this[$update](newHsva); + let newColor; + if (!(0,_utils_compare_js__WEBPACK_IMPORTED_MODULE_6__.equalColorObjects)(newHsva, oldHsva) && + !this[$isSame]((newColor = this.colorModel.fromHsva(newHsva)))) { + this[$color] = newColor; + (0,_utils_dom_js__WEBPACK_IMPORTED_MODULE_5__.fire)(this, 'color-changed', { value: newColor }); + } + } + [$isSame](color) { + return this.color && this.colorModel.equal(color, this.color); + } + [$update](hsva) { + this[$hsva] = hsva; + this[$parts].forEach((part) => part.update(hsva)); + } +} +//# sourceMappingURL=color-picker.js.map + +/***/ }), + +/***/ "./node_modules/vanilla-colorful/lib/components/hue.js": +/*!*************************************************************!*\ + !*** ./node_modules/vanilla-colorful/lib/components/hue.js ***! + \*************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Hue: () => (/* binding */ Hue) +/* harmony export */ }); +/* harmony import */ var _slider_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./slider.js */ "./node_modules/vanilla-colorful/lib/components/slider.js"); +/* harmony import */ var _utils_convert_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/convert.js */ "./node_modules/vanilla-colorful/lib/utils/convert.js"); +/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/vanilla-colorful/lib/utils/math.js"); + + + +class Hue extends _slider_js__WEBPACK_IMPORTED_MODULE_0__.Slider { + constructor(root) { + super(root, 'hue', 'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"', false); + } + update({ h }) { + this.h = h; + this.style([ + { + left: `${(h / 360) * 100}%`, + color: (0,_utils_convert_js__WEBPACK_IMPORTED_MODULE_1__.hsvaToHslString)({ h, s: 100, v: 100, a: 1 }) + } + ]); + this.el.setAttribute('aria-valuenow', `${(0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.round)(h)}`); + } + getMove(offset, key) { + // Hue measured in degrees of the color circle ranging from 0 to 360 + return { h: key ? (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.clamp)(this.h + offset.x * 360, 0, 360) : 360 * offset.x }; + } +} +//# sourceMappingURL=hue.js.map + +/***/ }), + +/***/ "./node_modules/vanilla-colorful/lib/components/saturation.js": +/*!********************************************************************!*\ + !*** ./node_modules/vanilla-colorful/lib/components/saturation.js ***! + \********************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Saturation: () => (/* binding */ Saturation) +/* harmony export */ }); +/* harmony import */ var _slider_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./slider.js */ "./node_modules/vanilla-colorful/lib/components/slider.js"); +/* harmony import */ var _utils_convert_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/convert.js */ "./node_modules/vanilla-colorful/lib/utils/convert.js"); +/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/vanilla-colorful/lib/utils/math.js"); + + + +class Saturation extends _slider_js__WEBPACK_IMPORTED_MODULE_0__.Slider { + constructor(root) { + super(root, 'saturation', 'aria-label="Color"', true); + } + update(hsva) { + this.hsva = hsva; + this.style([ + { + top: `${100 - hsva.v}%`, + left: `${hsva.s}%`, + color: (0,_utils_convert_js__WEBPACK_IMPORTED_MODULE_1__.hsvaToHslString)(hsva) + }, + { + 'background-color': (0,_utils_convert_js__WEBPACK_IMPORTED_MODULE_1__.hsvaToHslString)({ h: hsva.h, s: 100, v: 100, a: 1 }) + } + ]); + this.el.setAttribute('aria-valuetext', `Saturation ${(0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.round)(hsva.s)}%, Brightness ${(0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.round)(hsva.v)}%`); + } + getMove(offset, key) { + // Saturation and brightness always fit into [0, 100] range + return { + s: key ? (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.clamp)(this.hsva.s + offset.x * 100, 0, 100) : offset.x * 100, + v: key ? (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.clamp)(this.hsva.v - offset.y * 100, 0, 100) : Math.round(100 - offset.y * 100) + }; + } +} +//# sourceMappingURL=saturation.js.map + +/***/ }), + +/***/ "./node_modules/vanilla-colorful/lib/components/slider.js": +/*!****************************************************************!*\ + !*** ./node_modules/vanilla-colorful/lib/components/slider.js ***! + \****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Slider: () => (/* binding */ Slider) +/* harmony export */ }); +/* harmony import */ var _utils_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/dom.js */ "./node_modules/vanilla-colorful/lib/utils/dom.js"); +/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/vanilla-colorful/lib/utils/math.js"); + + +let hasTouched = false; +// Check if an event was triggered by touch +const isTouch = (e) => 'touches' in e; +// Prevent mobile browsers from handling mouse events (conflicting with touch ones). +// If we detected a touch interaction before, we prefer reacting to touch events only. +const isValid = (event) => { + if (hasTouched && !isTouch(event)) + return false; + if (!hasTouched) + hasTouched = isTouch(event); + return true; +}; +const pointerMove = (target, event) => { + const pointer = isTouch(event) ? event.touches[0] : event; + const rect = target.el.getBoundingClientRect(); + (0,_utils_dom_js__WEBPACK_IMPORTED_MODULE_0__.fire)(target.el, 'move', target.getMove({ + x: (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_1__.clamp)((pointer.pageX - (rect.left + window.pageXOffset)) / rect.width), + y: (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_1__.clamp)((pointer.pageY - (rect.top + window.pageYOffset)) / rect.height) + })); +}; +const keyMove = (target, event) => { + // We use `keyCode` instead of `key` to reduce the size of the library. + const keyCode = event.keyCode; + // Ignore all keys except arrow ones, Page Up, Page Down, Home and End. + if (keyCode > 40 || (target.xy && keyCode < 37) || keyCode < 33) + return; + // Do not scroll page by keys when color picker element has focus. + event.preventDefault(); + // Send relative offset to the parent component. + (0,_utils_dom_js__WEBPACK_IMPORTED_MODULE_0__.fire)(target.el, 'move', target.getMove({ + x: keyCode === 39 // Arrow Right + ? 0.01 + : keyCode === 37 // Arrow Left + ? -0.01 + : keyCode === 34 // Page Down + ? 0.05 + : keyCode === 33 // Page Up + ? -0.05 + : keyCode === 35 // End + ? 1 + : keyCode === 36 // Home + ? -1 + : 0, + y: keyCode === 40 // Arrow down + ? 0.01 + : keyCode === 38 // Arrow Up + ? -0.01 + : 0 + }, true)); +}; +class Slider { + constructor(root, part, aria, xy) { + const template = (0,_utils_dom_js__WEBPACK_IMPORTED_MODULE_0__.tpl)(`
      `); + root.appendChild(template.content.cloneNode(true)); + const el = root.querySelector(`[part=${part}]`); + el.addEventListener('mousedown', this); + el.addEventListener('touchstart', this); + el.addEventListener('keydown', this); + this.el = el; + this.xy = xy; + this.nodes = [el.firstChild, el]; + } + set dragging(state) { + const toggleEvent = state ? document.addEventListener : document.removeEventListener; + toggleEvent(hasTouched ? 'touchmove' : 'mousemove', this); + toggleEvent(hasTouched ? 'touchend' : 'mouseup', this); + } + handleEvent(event) { + switch (event.type) { + case 'mousedown': + case 'touchstart': + event.preventDefault(); + // event.button is 0 in mousedown for left button activation + if (!isValid(event) || (!hasTouched && event.button != 0)) + return; + this.el.focus(); + pointerMove(this, event); + this.dragging = true; + break; + case 'mousemove': + case 'touchmove': + event.preventDefault(); + pointerMove(this, event); + break; + case 'mouseup': + case 'touchend': + this.dragging = false; + break; + case 'keydown': + keyMove(this, event); + break; + } + } + style(styles) { + styles.forEach((style, i) => { + for (const p in style) { + this.nodes[i].style.setProperty(p, style[p]); + } + }); + } +} +//# sourceMappingURL=slider.js.map + +/***/ }), + +/***/ "./node_modules/vanilla-colorful/lib/entrypoints/hex.js": +/*!**************************************************************!*\ + !*** ./node_modules/vanilla-colorful/lib/entrypoints/hex.js ***! + \**************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ HexBase: () => (/* binding */ HexBase) +/* harmony export */ }); +/* harmony import */ var _components_color_picker_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/color-picker.js */ "./node_modules/vanilla-colorful/lib/components/color-picker.js"); +/* harmony import */ var _utils_convert_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/convert.js */ "./node_modules/vanilla-colorful/lib/utils/convert.js"); +/* harmony import */ var _utils_compare_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/compare.js */ "./node_modules/vanilla-colorful/lib/utils/compare.js"); + + + +const colorModel = { + defaultColor: '#000', + toHsva: _utils_convert_js__WEBPACK_IMPORTED_MODULE_0__.hexToHsva, + fromHsva: ({ h, s, v }) => (0,_utils_convert_js__WEBPACK_IMPORTED_MODULE_0__.hsvaToHex)({ h, s, v, a: 1 }), + equal: _utils_compare_js__WEBPACK_IMPORTED_MODULE_1__.equalHex, + fromAttr: (color) => color +}; +class HexBase extends _components_color_picker_js__WEBPACK_IMPORTED_MODULE_2__.ColorPicker { + get colorModel() { + return colorModel; + } +} +//# sourceMappingURL=hex.js.map + +/***/ }), + +/***/ "./node_modules/vanilla-colorful/lib/styles/color-picker.js": +/*!******************************************************************!*\ + !*** ./node_modules/vanilla-colorful/lib/styles/color-picker.js ***! + \******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (`:host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}`); +//# sourceMappingURL=color-picker.js.map + +/***/ }), + +/***/ "./node_modules/vanilla-colorful/lib/styles/hue.js": +/*!*********************************************************!*\ + !*** ./node_modules/vanilla-colorful/lib/styles/hue.js ***! + \*********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (`[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}`); +//# sourceMappingURL=hue.js.map + +/***/ }), + +/***/ "./node_modules/vanilla-colorful/lib/styles/saturation.js": +/*!****************************************************************!*\ + !*** ./node_modules/vanilla-colorful/lib/styles/saturation.js ***! + \****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (`[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}`); +//# sourceMappingURL=saturation.js.map + +/***/ }), + +/***/ "./node_modules/vanilla-colorful/lib/utils/compare.js": +/*!************************************************************!*\ + !*** ./node_modules/vanilla-colorful/lib/utils/compare.js ***! + \************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ equalColorObjects: () => (/* binding */ equalColorObjects), +/* harmony export */ equalColorString: () => (/* binding */ equalColorString), +/* harmony export */ equalHex: () => (/* binding */ equalHex) +/* harmony export */ }); +/* harmony import */ var _convert_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./convert.js */ "./node_modules/vanilla-colorful/lib/utils/convert.js"); + +const equalColorObjects = (first, second) => { + if (first === second) + return true; + for (const prop in first) { + // The following allows for a type-safe calling of this function (first & second have to be HSL, HSV, or RGB) + // with type-unsafe iterating over object keys. TS does not allow this without an index (`[key: string]: number`) + // on an object to define how iteration is normally done. To ensure extra keys are not allowed on our types, + // we must cast our object to unknown (as RGB demands `r` be a key, while `Record` does not care if + // there is or not), and then as a type TS can iterate over. + if (first[prop] !== + second[prop]) + return false; + } + return true; +}; +const equalColorString = (first, second) => { + return first.replace(/\s/g, '') === second.replace(/\s/g, ''); +}; +const equalHex = (first, second) => { + if (first.toLowerCase() === second.toLowerCase()) + return true; + // To compare colors like `#FFF` and `ffffff` we convert them into RGB objects + return equalColorObjects((0,_convert_js__WEBPACK_IMPORTED_MODULE_0__.hexToRgba)(first), (0,_convert_js__WEBPACK_IMPORTED_MODULE_0__.hexToRgba)(second)); +}; +//# sourceMappingURL=compare.js.map + +/***/ }), + +/***/ "./node_modules/vanilla-colorful/lib/utils/convert.js": +/*!************************************************************!*\ + !*** ./node_modules/vanilla-colorful/lib/utils/convert.js ***! + \************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ hexToHsva: () => (/* binding */ hexToHsva), +/* harmony export */ hexToRgba: () => (/* binding */ hexToRgba), +/* harmony export */ hslStringToHsva: () => (/* binding */ hslStringToHsva), +/* harmony export */ hslaStringToHsva: () => (/* binding */ hslaStringToHsva), +/* harmony export */ hslaToHsl: () => (/* binding */ hslaToHsl), +/* harmony export */ hslaToHsva: () => (/* binding */ hslaToHsva), +/* harmony export */ hsvStringToHsva: () => (/* binding */ hsvStringToHsva), +/* harmony export */ hsvaStringToHsva: () => (/* binding */ hsvaStringToHsva), +/* harmony export */ hsvaToHex: () => (/* binding */ hsvaToHex), +/* harmony export */ hsvaToHslString: () => (/* binding */ hsvaToHslString), +/* harmony export */ hsvaToHsla: () => (/* binding */ hsvaToHsla), +/* harmony export */ hsvaToHslaString: () => (/* binding */ hsvaToHslaString), +/* harmony export */ hsvaToHsv: () => (/* binding */ hsvaToHsv), +/* harmony export */ hsvaToHsvString: () => (/* binding */ hsvaToHsvString), +/* harmony export */ hsvaToHsvaString: () => (/* binding */ hsvaToHsvaString), +/* harmony export */ hsvaToRgbString: () => (/* binding */ hsvaToRgbString), +/* harmony export */ hsvaToRgba: () => (/* binding */ hsvaToRgba), +/* harmony export */ hsvaToRgbaString: () => (/* binding */ hsvaToRgbaString), +/* harmony export */ parseHue: () => (/* binding */ parseHue), +/* harmony export */ rgbStringToHsva: () => (/* binding */ rgbStringToHsva), +/* harmony export */ rgbaStringToHsva: () => (/* binding */ rgbaStringToHsva), +/* harmony export */ rgbaToHex: () => (/* binding */ rgbaToHex), +/* harmony export */ rgbaToHsva: () => (/* binding */ rgbaToHsva), +/* harmony export */ rgbaToRgb: () => (/* binding */ rgbaToRgb), +/* harmony export */ roundHsva: () => (/* binding */ roundHsva) +/* harmony export */ }); +/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ "./node_modules/vanilla-colorful/lib/utils/math.js"); + +/** + * Valid CSS units. + * https://developer.mozilla.org/en-US/docs/Web/CSS/angle + */ +const angleUnits = { + grad: 360 / 400, + turn: 360, + rad: 360 / (Math.PI * 2) +}; +const hexToHsva = (hex) => rgbaToHsva(hexToRgba(hex)); +const hexToRgba = (hex) => { + if (hex[0] === '#') + hex = hex.substring(1); + if (hex.length < 6) { + return { + r: parseInt(hex[0] + hex[0], 16), + g: parseInt(hex[1] + hex[1], 16), + b: parseInt(hex[2] + hex[2], 16), + a: hex.length === 4 ? (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(parseInt(hex[3] + hex[3], 16) / 255, 2) : 1 + }; + } + return { + r: parseInt(hex.substring(0, 2), 16), + g: parseInt(hex.substring(2, 4), 16), + b: parseInt(hex.substring(4, 6), 16), + a: hex.length === 8 ? (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(parseInt(hex.substring(6, 8), 16) / 255, 2) : 1 + }; +}; +const parseHue = (value, unit = 'deg') => { + return Number(value) * (angleUnits[unit] || 1); +}; +const hslaStringToHsva = (hslString) => { + const matcher = /hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i; + const match = matcher.exec(hslString); + if (!match) + return { h: 0, s: 0, v: 0, a: 1 }; + return hslaToHsva({ + h: parseHue(match[1], match[2]), + s: Number(match[3]), + l: Number(match[4]), + a: match[5] === undefined ? 1 : Number(match[5]) / (match[6] ? 100 : 1) + }); +}; +const hslStringToHsva = hslaStringToHsva; +const hslaToHsva = ({ h, s, l, a }) => { + s *= (l < 50 ? l : 100 - l) / 100; + return { + h: h, + s: s > 0 ? ((2 * s) / (l + s)) * 100 : 0, + v: l + s, + a + }; +}; +const hsvaToHex = (hsva) => rgbaToHex(hsvaToRgba(hsva)); +const hsvaToHsla = ({ h, s, v, a }) => { + const hh = ((200 - s) * v) / 100; + return { + h: (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(h), + s: (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(hh > 0 && hh < 200 ? ((s * v) / 100 / (hh <= 100 ? hh : 200 - hh)) * 100 : 0), + l: (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(hh / 2), + a: (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(a, 2) + }; +}; +const hsvaToHsvString = (hsva) => { + const { h, s, v } = roundHsva(hsva); + return `hsv(${h}, ${s}%, ${v}%)`; +}; +const hsvaToHsvaString = (hsva) => { + const { h, s, v, a } = roundHsva(hsva); + return `hsva(${h}, ${s}%, ${v}%, ${a})`; +}; +const hsvaToHslString = (hsva) => { + const { h, s, l } = hsvaToHsla(hsva); + return `hsl(${h}, ${s}%, ${l}%)`; +}; +const hsvaToHslaString = (hsva) => { + const { h, s, l, a } = hsvaToHsla(hsva); + return `hsla(${h}, ${s}%, ${l}%, ${a})`; +}; +const hsvaToRgba = ({ h, s, v, a }) => { + h = (h / 360) * 6; + s = s / 100; + v = v / 100; + const hh = Math.floor(h), b = v * (1 - s), c = v * (1 - (h - hh) * s), d = v * (1 - (1 - h + hh) * s), module = hh % 6; + return { + r: (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.round)([v, c, b, b, d, v][module] * 255), + g: (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.round)([d, v, v, c, b, b][module] * 255), + b: (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.round)([b, b, d, v, v, c][module] * 255), + a: (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(a, 2) + }; +}; +const hsvaToRgbString = (hsva) => { + const { r, g, b } = hsvaToRgba(hsva); + return `rgb(${r}, ${g}, ${b})`; +}; +const hsvaToRgbaString = (hsva) => { + const { r, g, b, a } = hsvaToRgba(hsva); + return `rgba(${r}, ${g}, ${b}, ${a})`; +}; +const hsvaStringToHsva = (hsvString) => { + const matcher = /hsva?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i; + const match = matcher.exec(hsvString); + if (!match) + return { h: 0, s: 0, v: 0, a: 1 }; + return roundHsva({ + h: parseHue(match[1], match[2]), + s: Number(match[3]), + v: Number(match[4]), + a: match[5] === undefined ? 1 : Number(match[5]) / (match[6] ? 100 : 1) + }); +}; +const hsvStringToHsva = hsvaStringToHsva; +const rgbaStringToHsva = (rgbaString) => { + const matcher = /rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i; + const match = matcher.exec(rgbaString); + if (!match) + return { h: 0, s: 0, v: 0, a: 1 }; + return rgbaToHsva({ + r: Number(match[1]) / (match[2] ? 100 / 255 : 1), + g: Number(match[3]) / (match[4] ? 100 / 255 : 1), + b: Number(match[5]) / (match[6] ? 100 / 255 : 1), + a: match[7] === undefined ? 1 : Number(match[7]) / (match[8] ? 100 : 1) + }); +}; +const rgbStringToHsva = rgbaStringToHsva; +const format = (number) => { + const hex = number.toString(16); + return hex.length < 2 ? '0' + hex : hex; +}; +const rgbaToHex = ({ r, g, b, a }) => { + const alphaHex = a < 1 ? format((0,_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(a * 255)) : ''; + return '#' + format(r) + format(g) + format(b) + alphaHex; +}; +const rgbaToHsva = ({ r, g, b, a }) => { + const max = Math.max(r, g, b); + const delta = max - Math.min(r, g, b); + // prettier-ignore + const hh = delta + ? max === r + ? (g - b) / delta + : max === g + ? 2 + (b - r) / delta + : 4 + (r - g) / delta + : 0; + return { + h: (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(60 * (hh < 0 ? hh + 6 : hh)), + s: (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(max ? (delta / max) * 100 : 0), + v: (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.round)((max / 255) * 100), + a + }; +}; +const roundHsva = (hsva) => ({ + h: (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(hsva.h), + s: (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(hsva.s), + v: (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(hsva.v), + a: (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(hsva.a, 2) +}); +const rgbaToRgb = ({ r, g, b }) => ({ r, g, b }); +const hslaToHsl = ({ h, s, l }) => ({ h, s, l }); +const hsvaToHsv = (hsva) => { + const { h, s, v } = roundHsva(hsva); + return { h, s, v }; +}; +//# sourceMappingURL=convert.js.map + +/***/ }), + +/***/ "./node_modules/vanilla-colorful/lib/utils/dom.js": +/*!********************************************************!*\ + !*** ./node_modules/vanilla-colorful/lib/utils/dom.js ***! + \********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ fire: () => (/* binding */ fire), +/* harmony export */ tpl: () => (/* binding */ tpl) +/* harmony export */ }); +const cache = {}; +const tpl = (html) => { + let template = cache[html]; + if (!template) { + template = document.createElement('template'); + template.innerHTML = html; + cache[html] = template; + } + return template; +}; +const fire = (target, type, detail) => { + target.dispatchEvent(new CustomEvent(type, { + bubbles: true, + detail + })); +}; +//# sourceMappingURL=dom.js.map + +/***/ }), + +/***/ "./node_modules/vanilla-colorful/lib/utils/math.js": +/*!*********************************************************!*\ + !*** ./node_modules/vanilla-colorful/lib/utils/math.js ***! + \*********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ clamp: () => (/* binding */ clamp), +/* harmony export */ round: () => (/* binding */ round) +/* harmony export */ }); +// Clamps a value between an upper and lower bound. +// We use ternary operators because it makes the minified code +// 2 times shorter then `Math.min(Math.max(a,b),c)` +const clamp = (number, min = 0, max = 1) => { + return number > max ? max : number < min ? min : number; +}; +const round = (number, digits = 0, base = Math.pow(10, digits)) => { + return Math.round(base * number) / base; +}; +//# sourceMappingURL=math.js.map + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ id: moduleId, +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/create fake namespace object */ +/******/ (() => { +/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); +/******/ var leafPrototypes; +/******/ // 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 & 16: return value when it's Promise-like +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = this(value); +/******/ if(mode & 8) return value; +/******/ if(typeof value === 'object' && value) { +/******/ if((mode & 4) && value.__esModule) return value; +/******/ if((mode & 16) && typeof value.then === 'function') return value; +/******/ } +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ var def = {}; +/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; +/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { +/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); +/******/ } +/******/ def['default'] = () => (value); +/******/ __webpack_require__.d(ns, def); +/******/ return ns; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ __webpack_require__.b = document.baseURI || self.location.href; +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ "ckeditor5": 0 +/******/ }; +/******/ +/******/ // no chunk on demand loading +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ // no on chunks loaded +/******/ +/******/ // no jsonp function +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be in strict mode. +(() => { +"use strict"; +/*!*************************************!*\ + !*** ./private/js/cms.ckeditor5.js ***! + \*************************************/ +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _ckeditor_ckeditor5_editor_classic_src_classiceditor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-editor-classic/src/classiceditor */ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js"); +/* harmony import */ var _ckeditor_ckeditor5_editor_inline_src_inlineeditor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-editor-inline/src/inlineeditor */ "./node_modules/@ckeditor/ckeditor5-editor-inline/src/inlineeditor.js"); +/* harmony import */ var _ckeditor_ckeditor5_editor_balloon_src_ballooneditor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-editor-balloon/src/ballooneditor */ "./node_modules/@ckeditor/ckeditor5-editor-balloon/src/ballooneditor.js"); +/* harmony import */ var _ckeditor_ckeditor5_ui_src_toolbar_block_blocktoolbar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/toolbar/block/blocktoolbar */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blocktoolbar.js"); +/* harmony import */ var _ckeditor_ckeditor5_essentials_src_essentials__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-essentials/src/essentials */ "./node_modules/@ckeditor/ckeditor5-essentials/src/essentials.js"); +/* harmony import */ var _ckeditor_ckeditor5_autoformat_src_autoformat__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-autoformat/src/autoformat */ "./node_modules/@ckeditor/ckeditor5-autoformat/src/autoformat.js"); +/* harmony import */ var _ckeditor_ckeditor5_autosave_src_autosave__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-autosave/src/autosave */ "./node_modules/@ckeditor/ckeditor5-autosave/src/autosave.js"); +/* harmony import */ var _ckeditor_ckeditor5_alignment_src_alignment__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-alignment/src/alignment */ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignment.js"); +/* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_bold__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/bold */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js"); +/* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_italic__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/italic */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.js"); +/* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_underline__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/underline */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline.js"); +/* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_strikethrough__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/strikethrough */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.js"); +/* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_code__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/code */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/code.js"); +/* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_subscript__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/subscript */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript.js"); +/* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_superscript__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/superscript */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript.js"); +/* harmony import */ var _ckeditor_ckeditor5_font_src_font__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @ckeditor/ckeditor5-font/src/font */ "./node_modules/@ckeditor/ckeditor5-font/src/font.js"); +/* harmony import */ var _ckeditor_ckeditor5_block_quote_src_blockquote__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @ckeditor/ckeditor5-block-quote/src/blockquote */ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js"); +/* harmony import */ var _ckeditor_ckeditor5_code_block_src_codeblock__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @ckeditor/ckeditor5-code-block/src/codeblock */ "./node_modules/@ckeditor/ckeditor5-code-block/src/codeblock.js"); +/* harmony import */ var _ckeditor_ckeditor5_heading_src_heading__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @ckeditor/ckeditor5-heading/src/heading */ "./node_modules/@ckeditor/ckeditor5-heading/src/heading.js"); +/* harmony import */ var _ckeditor_ckeditor5_heading_src_headingbuttonsui__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @ckeditor/ckeditor5-heading/src/headingbuttonsui */ "./node_modules/@ckeditor/ckeditor5-heading/src/headingbuttonsui.js"); +/* harmony import */ var _ckeditor_ckeditor5_indent_src_indent__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @ckeditor/ckeditor5-indent/src/indent */ "./node_modules/@ckeditor/ckeditor5-indent/src/indent.js"); +/* harmony import */ var _ckeditor_ckeditor5_link_src_link__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @ckeditor/ckeditor5-link/src/link */ "./node_modules/@ckeditor/ckeditor5-link/src/link.js"); +/* harmony import */ var _ckeditor_ckeditor5_list_src_list__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @ckeditor/ckeditor5-list/src/list */ "./node_modules/@ckeditor/ckeditor5-list/src/list.js"); +/* harmony import */ var _ckeditor_ckeditor5_media_embed_src_mediaembed__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @ckeditor/ckeditor5-media-embed/src/mediaembed */ "./node_modules/@ckeditor/ckeditor5-media-embed/src/mediaembed.js"); +/* harmony import */ var _ckeditor_ckeditor5_paragraph_src_paragraph__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @ckeditor/ckeditor5-paragraph/src/paragraph */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js"); +/* harmony import */ var _ckeditor_ckeditor5_paragraph_src_paragraphbuttonui__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @ckeditor/ckeditor5-paragraph/src/paragraphbuttonui */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphbuttonui.js"); +/* harmony import */ var _ckeditor_ckeditor5_paste_from_office_src_pastefromoffice__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @ckeditor/ckeditor5-paste-from-office/src/pastefromoffice */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js"); +/* harmony import */ var _ckeditor_ckeditor5_table_src_table__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @ckeditor/ckeditor5-table/src/table */ "./node_modules/@ckeditor/ckeditor5-table/src/table.js"); +/* harmony import */ var _ckeditor_ckeditor5_table_src_tabletoolbar__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @ckeditor/ckeditor5-table/src/tabletoolbar */ "./node_modules/@ckeditor/ckeditor5-table/src/tabletoolbar.js"); +/* harmony import */ var _ckeditor_ckeditor5_typing_src_texttransformation__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/texttransformation */ "./node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.js"); +/* harmony import */ var _ckeditor_ckeditor5_source_editing_src_sourceediting__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @ckeditor/ckeditor5-source-editing/src/sourceediting */ "./node_modules/@ckeditor/ckeditor5-source-editing/src/sourceediting.js"); +/* harmony import */ var _ckeditor5_plugins_cms_plugin__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./ckeditor5_plugins/cms.plugin */ "./private/js/ckeditor5_plugins/cms.plugin.js"); +/* eslint-env es6 */ +/* jshint esversion: 6 */ +/* global document, window, console */ + + +// The editor creator to use. + + + + + + + +// import UploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter'; + + + + + + + + + + + + + + + +// import Base64UploadAdapter from '@ckeditor/ckeditor5-upload/src/adapters/base64uploadadapter'; +// import Image from '@ckeditor/ckeditor5-image/src/image'; +// import ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption'; +// import ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle'; +// import ImageToolbar from '@ckeditor/ckeditor5-image/src/imagetoolbar'; +// import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; + + + + + + + + + + + +//import HorizontalLine from './ckeditor5-horizontal-line/src/horizontalline'; +//import UserStyle from './ckeditor5-user-style/src/userstyle'; + + + +class ClassicEditor extends _ckeditor_ckeditor5_editor_classic_src_classiceditor__WEBPACK_IMPORTED_MODULE_0__["default"] {} +// class InlineEditor extends InlineEditorBase {} +class BalloonEditor extends _ckeditor_ckeditor5_editor_balloon_src_ballooneditor__WEBPACK_IMPORTED_MODULE_2__["default"] {} + +// Plugins to include in the build. +var builtinPlugins = [ + _ckeditor_ckeditor5_essentials_src_essentials__WEBPACK_IMPORTED_MODULE_4__["default"], + // UploadAdapter, + _ckeditor_ckeditor5_autoformat_src_autoformat__WEBPACK_IMPORTED_MODULE_5__["default"], + _ckeditor_ckeditor5_autosave_src_autosave__WEBPACK_IMPORTED_MODULE_6__["default"], + _ckeditor_ckeditor5_alignment_src_alignment__WEBPACK_IMPORTED_MODULE_7__["default"], + _ckeditor_ckeditor5_ui_src_toolbar_block_blocktoolbar__WEBPACK_IMPORTED_MODULE_3__["default"], + _ckeditor_ckeditor5_basic_styles_src_bold__WEBPACK_IMPORTED_MODULE_8__["default"], + _ckeditor_ckeditor5_basic_styles_src_italic__WEBPACK_IMPORTED_MODULE_9__["default"], + _ckeditor_ckeditor5_basic_styles_src_underline__WEBPACK_IMPORTED_MODULE_10__["default"], + _ckeditor_ckeditor5_basic_styles_src_strikethrough__WEBPACK_IMPORTED_MODULE_11__["default"], + _ckeditor_ckeditor5_basic_styles_src_code__WEBPACK_IMPORTED_MODULE_12__["default"], + _ckeditor_ckeditor5_basic_styles_src_subscript__WEBPACK_IMPORTED_MODULE_13__["default"], + _ckeditor_ckeditor5_basic_styles_src_superscript__WEBPACK_IMPORTED_MODULE_14__["default"], + _ckeditor_ckeditor5_font_src_font__WEBPACK_IMPORTED_MODULE_15__["default"], + _ckeditor_ckeditor5_code_block_src_codeblock__WEBPACK_IMPORTED_MODULE_17__["default"], + _ckeditor_ckeditor5_block_quote_src_blockquote__WEBPACK_IMPORTED_MODULE_16__["default"], + _ckeditor_ckeditor5_heading_src_heading__WEBPACK_IMPORTED_MODULE_18__["default"], + _ckeditor_ckeditor5_heading_src_headingbuttonsui__WEBPACK_IMPORTED_MODULE_19__["default"], + //HorizontalLine, + // Base64UploadAdapter, + Image, + // ImageCaption, + // ImageStyle, + // ImageToolbar, + // ImageUpload, + _ckeditor_ckeditor5_indent_src_indent__WEBPACK_IMPORTED_MODULE_20__["default"], + _ckeditor_ckeditor5_link_src_link__WEBPACK_IMPORTED_MODULE_21__["default"], + _ckeditor_ckeditor5_list_src_list__WEBPACK_IMPORTED_MODULE_22__["default"], + _ckeditor_ckeditor5_media_embed_src_mediaembed__WEBPACK_IMPORTED_MODULE_23__["default"], + _ckeditor_ckeditor5_paragraph_src_paragraph__WEBPACK_IMPORTED_MODULE_24__["default"], + _ckeditor_ckeditor5_paragraph_src_paragraphbuttonui__WEBPACK_IMPORTED_MODULE_25__["default"], + _ckeditor_ckeditor5_paste_from_office_src_pastefromoffice__WEBPACK_IMPORTED_MODULE_26__["default"], + _ckeditor_ckeditor5_source_editing_src_sourceediting__WEBPACK_IMPORTED_MODULE_30__["default"], + _ckeditor_ckeditor5_table_src_table__WEBPACK_IMPORTED_MODULE_27__["default"], + _ckeditor_ckeditor5_table_src_tabletoolbar__WEBPACK_IMPORTED_MODULE_28__["default"], + _ckeditor_ckeditor5_typing_src_texttransformation__WEBPACK_IMPORTED_MODULE_29__["default"], + // UserStyle, + // CmsPlugin +]; + +ClassicEditor.builtinPlugins = builtinPlugins; +// InlineEditor.builtinPlugins = builtinPlugins; +BalloonEditor.builtinPlugins = builtinPlugins; + +// Editor configuration. +var defaultConfig = { + toolbar: { + items: [ + 'heading', '|', + 'bold', 'italic', 'alignment', '|', + 'link', '|', + 'bulletedList', 'numberedList', 'outdent', 'indent', '|', + 'code', 'codeblock', '|', + 'fontFamily', 'fontSize', 'fontColor', '|', + 'mediaEmbed', 'insertTable', // 'horizontalLine', 'blockQuote', + ], + shouldNotGroupWhenFull: true + }, + heading: { + options: [ + { model: 'paragraph', title: 'Paragraph', class: '' }, + { model: 'heading1', view: 'h1', title: 'Heading 1', class: '' }, + { model: 'heading2', view: 'h2', title: 'Heading 2', class: '' }, + { model: 'heading3', view: 'h3', title: 'Heading 3', class: '' }, + { model: 'heading4', view: 'h4', title: 'Heading 4', class: '' }, + { model: 'heading5', view: 'h5', title: 'Heading 5', class: '' } + ] + }, + blockquote: { + options: { + classes: 'blockquote' + } + }, + table: { + contentToolbar: [ + 'tableColumn', + 'tableRow', + 'mergeTableCells' + ] + }, + // This value must be kept in sync with the language defined in webpack.config.js. + language: 'en' +}; + +ClassicEditor.defaultConfig = Object.assign({}, defaultConfig); +ClassicEditor.defaultConfig.toolbar.items.push('|', 'sourceEditing'); +// InlineEditor.defaultConfig = defaultConfig; +BalloonEditor.defaultConfig = { + heading: defaultConfig.heading, + table: defaultConfig.table, + language: defaultConfig.language, + image: defaultConfig.image, + blockquote: defaultConfig.blockquote, + toolbar: { + items: [ + 'bold', 'italic', 'alignment', '|', + 'link', '|', + 'code', '|', // 'userstyle', + 'fontFamily', 'fontSize', 'fontColor', '|', + ] + }, + blockToolbar: { + items: [ + 'paragraph', 'heading2', 'heading3', 'heading4', 'heading5', + '|', + 'bulletedList', 'numberedList', 'outdent', 'indent', '|', + // 'cms-plugin', '|', 'LinkPlugin', + 'codeblock', '|', + 'mediaEmbed', 'insertTable', // 'horizontalLine', 'blockQuote', + ], + shouldNotGroupWhenFull: true + } +}; + + +class CMSCKEditor5Plugin { + constructor(props) { + this._editors = {}; + this._CSS = []; + } + + // initializes the editor on the target element, with the given html code + create (el, inModal, content, options, save_callback) { + if (!(el.id in this._editors)) { + const inline = el.tagName !== 'TEXTAREA'; + if (!inline) { + ClassicEditor.create(el).then( editor => { + this._editors[el.id] = editor; + }); + } else { + BalloonEditor.create(el).then( editor => { + el.classList.remove('ck-content'); // remove Ckeditor 5 default styles + this._editors[el.id] = editor; + const initialContent = editor.getData(); + editor.model.document.on('change:data', () => el.dataset.changed='true'); + editor.ui.focusTracker.on( 'change:isFocused', ( evt, name, isFocused ) => { + el.classList.remove('ck-content'); // remove Ckeditor 5 default styles + if ( !isFocused ) { + // change:data event is not reliable, so we need to double-check + if (el.dataset.changed !== 'true' && editor.getData() !== initialContent) { + el.dataset.changed='true'; + } + save_callback(); + } + } ); + const styles = document.querySelectorAll('style[data-cke="true"]'); + if (styles.length > 0) { + // Styles are installed in the document head, but we need to clone them + // for later recovery + styles.forEach((style) => { + if (this._CSS.indexOf(style) === -1) { + this._CSS.push(style.cloneNode(true)); + } + } + ); + } else { + this._CSS.forEach((style) => document.head.appendChild(style)); + } + }); + } + } + } + + // returns the edited html code + getHTML (el) { + return this._editors[el.id].getData(); + } + + // returns the edited content as json + // currently not supported by CKEditor 5 + getJSON (el) { + return undefined; + } + + // destroy the editor + destroyEditor (el) { + this._editors[el.id].destroy(); + delete this._editors[el.id]; + } + + _init() { + this.editor.ui.componentFactory.add('cms-plugin', locale => { + const view = new ButtonView(locale); + view.set({ + label: 'CMS Plugin', + icon: pluginIcon, + tooltip: true + }); + // Callback executed once the image is clicked. + view.on('execute', () => { + const selection = this.editor.model.document.selection; + const selectedElement = selection.getSelectedElement(); + if (selectedElement && selectedElement.name === 'cms-plugin') { + this.editor.execute('link', { url: selectedElement.getAttribute('url') }); + } else { + this.editor.execute('link', { url: 'https://www.django-cms.org' }); + } + }); + return view; + }); + } +} + + +window.cms_editor_plugin = new CMSCKEditor5Plugin({}); + +})(); + +/******/ })() +; +//# sourceMappingURL=bundle.ckeditor5.min.js.map \ No newline at end of file diff --git a/djangocms_text/contrib/text_ckeditor5/static/djangocms_text/css/bundle.ckeditor4.min.css b/djangocms_text/contrib/text_ckeditor5/static/djangocms_text/css/bundle.ckeditor4.min.css new file mode 100644 index 00000000..70d0cda1 --- /dev/null +++ b/djangocms_text/contrib/text_ckeditor5/static/djangocms_text/css/bundle.ckeditor4.min.css @@ -0,0 +1,150 @@ +/*!******************************************************************************!*\ + !*** css ./node_modules/css-loader/dist/cjs.js!./private/css/cms.dialog.css ***! + \******************************************************************************/ + +dialog.cms-dialog { + padding: 0; + resize: both; + top: 50%; + left: 50%; + transform: translate(calc(-50% + 250px), calc(-50% + 121px)); + width: 32rem; + height: 24rem; + min-height: 16rem; + min-width: 16rem; + .cms-modal-foot { + margin-right: 1rem; + .cms-modal-buttons { + padding-right: 10px; + } + } + .cms-modal-body iframe { + width: 100%; + height: 100%; + border: none; + } +} + +dialog.cms-form-dialog { + &::before { + position: absolute; + background: var(--dca-white); + border: 1px solid var(--dca-gray-light); + box-shadow: 0 0 10px rgba(var(--dca-shadow), .25); + height: 10px; + width: 10px; + left: 24px; + top: 8px; + transform: rotate(-135deg); + transform-origin: 0 0; + content: ""; + } + &.right::before { + right: 24px; + left: auto; + } + &::after { + position: absolute; + background: var(--dca-white); + height: 10px; + left: 10px; + top: 0; + width: 40px; + content: ""; + } + &.right::after { + right: 10px; + left: auto; + } + .dropback { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: -1; + cursor: unset; /* browser default */ + } + z-index: 1001; + position: fixed; + margin: unset; + left: auto; + transform: translate(-50%, -50%); + min-width: 200px; + padding: 10px 15px; + background-color: var(--dca-white); + border: 1px solid var(--dca-gray-light); + border-radius: 5px; + box-shadow: 0 0 10px rgba(var(--dca-shadow), .25); + form { + display: flex; + flex-flow: row; + justify-content: space-between; + align-content: baseline; + align-items: center; + } + .cancel { + display: inline-flex; + color: #f00; + margin-left: 0.5em; + margin-right: 0.5em; + cursor: pointer; + } + .submit { + display: inline-flex; + color: #693; + cursor: pointer; + } +} + + +form.cms-form { + display: flex; + flex-flow: row; + justify-content: space-between; + align-content: baseline; + align-items: center; + text-align: start; + zoom: 1; + input, select { + min-width: 200px; + width: 100%; + margin-bottom: 3px; + font-size: 0.8rem; + min-height: 1rem; + line-height: unset; + height: unset; + padding: 3px 6px !important; + } + select { /* !important for djangocms-admin-style */ + background: var(--dca-white) url("data:image/svg+xml;utf8,") no-repeat right center !important; + background-size: auto 1em !important; + appearance: none; + } + label { + font-size: 0.7rem; + padding-bottom: 4px; + } + hr { + margin: 0.3em -1em; + } + .cms-form-buttons { + display: inline-flex; + margin-inline-start: 1em; + .cancel { + color: #f00; + cursor: pointer; + zoom: 1.2; + } + .submit { + margin-left: 0.5em; + margin-right: 0.5em; + color: #693; + cursor: pointer; + zoom: 1.2; + } + } +} + + +/*# sourceMappingURL=bundle.ckeditor4.min.css.map*/ \ No newline at end of file diff --git a/djangocms_text/contrib/text_tinymce/static/djangocms_text/bundles/bundle.tinymce.min.js b/djangocms_text/contrib/text_tinymce/static/djangocms_text/bundles/bundle.tinymce.min.js new file mode 100644 index 00000000..fed6a1f7 --- /dev/null +++ b/djangocms_text/contrib/text_tinymce/static/djangocms_text/bundles/bundle.tinymce.min.js @@ -0,0 +1,56 @@ +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +var __webpack_exports__ = {}; +/*!***********************************!*\ + !*** ./private/js/cms.tinymce.js ***! + \***********************************/ + + +window.cms_editor_plugin = { + + _editors: {}, + + // initializes the editor on the target element, with the given html code + create: function(el, inline, content, options, save_callback) { + if (!(el.id in this._editors)) { + tinymce.init({ + selector: "#" + el.id, + inline: inline, + menubar: false, + height: inline ? undefined : '100%', + width: inline ? undefined : '100%', + setup: (editor) => { + editor.on('Dirty', () => el.dataset.changed = 'true'); + editor.on('blur', save_callback); + editor.on('focus', () => CMS_Editor._highlightTextplugin(el.dataset.cmsPluginId)); + this._editors[el.id] = editor; + } + }); + } else { + console.warn("editor already exists:", el.id); + } + }, + + // returns the edited html code + get_html: function(el) { + return cms_editor_plugin._get_editor(el).getContent(); + }, + + // returns the edited content as json + get_json: function(el) { + return undefined; + }, + + // destroy the editor + destroy_editor: function(el) { + cms_editor_plugin._get_editor(el).destroy(); + }, + + _get_editor: function(el) { + return tinymce.get(el.id); + } +}; + +/******/ })() +; +//# sourceMappingURL=bundle.tinymce.min.js.map \ No newline at end of file diff --git a/djangocms_text/static/djangocms_text/bundles/bundle.editor.min.js b/djangocms_text/static/djangocms_text/bundles/bundle.editor.min.js new file mode 100644 index 00000000..fb1300d3 --- /dev/null +++ b/djangocms_text/static/djangocms_text/bundles/bundle.editor.min.js @@ -0,0 +1,469 @@ +/******/ (() => { // webpackBootstrap +var __webpack_exports__ = {}; +/*!**********************************!*\ + !*** ./private/js/cms.editor.js ***! + \**********************************/ +/* eslint-env es6 */ +/* jshint esversion: 6 */ +/* global window, document, fetch, IntersectionObserver, URLSearchParams, console */ + +// ############################################################################# +// CMS Editor +// ############################################################################# + +class CMSEditor { + + // CMS Editor: constructor + // Initialize the editor object + constructor() { + this._editors = []; + this._options = {}; + this._editor_settings = {}; + + // Get the CMS object from the parent window + if (window.CMS !== undefined && window.CMS.config !== undefined) { + this.mainWindow = window; + this.CMS = window.CMS; + } else { + this.mainWindow = window.parent; + this.CMS = window.parent.CMS; + } + + document.addEventListener('DOMContentLoaded', () => this.initAll()); + if (this.CMS) { + // Only needs to happen on the main window. + this.CMS.$(window).on('cms-content-refresh', () => this._resetInlineEditors()); + } + } + + // CMS Editor: init + // Initialize a single editor + init (el) { + const editor_type = el.dataset.type || 'HTMLField'; + let content; + + // Get content: json > textarea > innerHTML + if (el.dataset.json) { + content = JSON.parse(el.dataset.json); + } else { + content = el.innerHTML; + } + if (el.tagName === 'TEXTAREA') { + el.visible = false; + content = el.value; + // el = el.insertAdjacentElement('afterend', document.createElement('div')); + } + if (!el.id) { + el.id = "cms-edit-" + Math.random().toString(36).slice(2, 9); + } + const settings = this.getSettings(el); + // Element options overwrite + settings.options = Object.assign({}, + this._options[editor_type], + settings.options || {}, + JSON.parse(el.dataset.options || '{}') + ); + + // Add event listener to delete data on modal cancel + if (settings.revert_on_cancel) { + const CMS = this.CMS; + const csrf = CMS.config.csrf; + CMS.API.Helpers.addEventListener( + 'modal-close.text-plugin.text-plugin-' + settings.plugin_id, + function(e, opts) { + if (!settings.revert_on_cancel || !settings.cancel_plugin_url) { + return; + } + CMS.$.ajax({ + method: 'POST', + url: settings.cancel_plugin_url, + data: { + token: settings.action_token, + csrfmiddlewaretoken: csrf + }, + }).done(function () { + CMS.API.Helpers.removeEventListener( + 'modal-close.text-plugin.text-plugin-' + settings.plugin_id + ); + opts.instance.close(); + }).fail(function (res) { + CMS.API.Messages.open({ + message: res.responseText + ' | ' + res.status + ' ' + res.statusText, + delay: 0, + error: true + }); + }); + + } + ); + } + const inModal = !!document.querySelector( + '.app-djangocms_text.model-text.change-form #' + el.id + ); + + // Create editor + window.cms_editor_plugin.create( + el, + inModal, + content, settings, + el.tagName !== 'TEXTAREA' ? () => this.saveData(el) : () => {} + ); + this._editors.push(el); + } + + // CMS Editor: initInlineEditors + // Register all plugins on the page for inline editing + // This is called from init_all + initInlineEditors() { + if (this.CMS === undefined || this.CMS._plugins === undefined) { + // Check the CMS frontend for plugins + // no plugins -> no inline editors + return; + } + const plugins = this.CMS._plugins; + + this.observer = this.observer || new IntersectionObserver( (entries, opts) => { + entries.forEach((entry) => { + if (entry.isIntersecting) { + this.init(entry.target); + } + }, this); + }, { + root: null, + threshold: 0.05 + }); + + plugins.forEach(function (plugin) { + if (plugin[1].plugin_type === 'TextPlugin') { + const url = plugin[1].urls.edit_plugin; + const id = plugin[1].plugin_id; + const elements = document.querySelectorAll('.cms-plugin.cms-plugin-' + id); + let wrapper; + + if (elements.length > 0) { + if (elements.length === 1 && elements[0].tagName === 'DIV') { // already wrapped? + wrapper = elements[0]; + wrapper.classList.add('cms-editor-inline-wrapper'); + } else { // no, wrap now! + wrapper = document.createElement('div'); + wrapper.classList.add('cms-editor-inline-wrapper', 'wrapped'); + wrapper = this._wrapAll(elements, wrapper); + wrapper.classList.add('cms-plugin', 'cms-plugin-' + id); + for (let child of wrapper.children) { + child.classList.remove('cms-plugin', 'cms-plugin-' + id); + } + } + wrapper.dataset.cmsEditUrl = url; + wrapper.dataset.cmsPluginId = id; + + // Catch CMS single click event to highlight the plugin + // Catch CMS double click event if present, since double click is needed by Editor + if (this.CMS) { + this.CMS.$(wrapper).on('dblclick.cms-editor', function (event) { + event.stopPropagation(); + }); + wrapper.addEventListener('focusin.cms-editor', () => { + this._highlightTextplugin(id); + }, true); + } + + // Prevent tooltip on hover + document.addEventListener('pointerover.cms-editor', (event) => { + // use time out to let other event handlers (CMS' !) run first. + setTimeout(function () { + // do not show tooltip on inline editing text fields. + this.CMS.API.Tooltip.displayToggle(false, event.target, '', id); + }, 0); + }); + + this.observer.observe(wrapper); + } + } + }, this); + + window.addEventListener('beforeunload', (event) => { + if (document.querySelector('.cms-editor-inline-wrapper[data-changed="true"]')) { + event.preventDefault(); + event.returnValue = true; + return 'Do you really want to leave this page?'; + } + }); + } + + // CMS Editor: get_settings + // Get settings from json script element + getSettings(el) { + if (typeof el === "string") { + if (this._editor_settings[el]) { + return this._editor_settings[el]; + } + el = document.getElementById(el); + } + const settings_el = ( + document.getElementById(el.dataset.settings) || + document.getElementById('cms-cfg-' + el.dataset.cmsPluginId) + ); + if (settings_el) { + this._editor_settings[el.id] = JSON.parse(settings_el.textContent); + return this._editor_settings[el.id]; + } + return {}; + } + + // CMS Editor: init_all + initAll () { + // Get global options from script element + try { + this._options = JSON.parse(document.getElementById('cms-editor-cfg').textContent); + } catch (e) { + this._options = {}; + } + // All textareas with class CMS_Editor: typically on admin site + document.querySelectorAll('textarea.CMS_Editor').forEach( + (el) => this.init(el), this + ); + // Register all plugins on the page for inline editing + this.initInlineEditors(); + } + + // CMS Editor: destroy + destroyAll() { + while (this._editors.length) { + window.cms_editor_plugin.destroyEditor(this._editors.pop()); + } + } + + saveData(el, action) { + if (el && el.dataset.changed === "true") { + const html = window.cms_editor_plugin.getHTML(el), + json = window.cms_editor_plugin.getJSON(el); + + let url = el.dataset.cmsEditUrl; + let csrf = el.dataset.cmsCsrfToken; + if (this.CMS) { + this.CMS.API.Toolbar.showLoader(); + url = this.CMS.API.Helpers.updateUrlWithPath(url); + csrf = this.CMS.config.csrf; + } + + fetch(url, { + method: 'POST', + body: new URLSearchParams({ + csrfmiddlewaretoken: csrf, + body: html, + json: JSON.stringify(json) || '', + _save: 'Save' + }), + }) + .then(response => { + el.dataset.changed = 'false'; + if (this.CMS) { + this.CMS.API.Toolbar.hideLoader(); + } + if (action !== undefined) { + action(el, response); + } + if (el.dataset.childChanged) { + this.CMS.API.Helpers.reloadBrowser('REFRESH_PAGE'); + } else { + this._loadToolbar(); + } + }) + .catch(error => { + el.dataset.changed = 'true'; + if (this.CMS) { + this.CMS.API.Messages.open({ + message: error.message, + error: true + }); + } else { + window.console.error(error.message); + } + }); + } + } + + // CMS Editor: addPluginForm + // Get form for a new child plugin + addPluginForm (plugin_type, iframe, el , onLoad, onSave) { + const settings = this.getSettings(el); + const data = { + placeholder_id: settings.placeholder_id, + plugin_type: plugin_type, + plugin_parent: settings.plugin_id, + plugin_language: settings.plugin_language, + plugin_position: settings.plugin_position + 1, + cms_path: window.parent.location.pathname, + cms_history: 0, + }; + const url = `${settings.add_plugin_url}?${new URLSearchParams(data).toString()}`; + return this.loadForm(url, iframe, el, onLoad, onSave); + } + + // CMS Editor: addPluginForm + // Get form for a new child plugin + editPluginForm (plugin_id, iframe, el, onLoad, onSave) { + let url = el.dataset.cmsEditUrl || window.location.href; + url = url.replace(/\/edit-plugin\/\d+/, '/edit-plugin/' + plugin_id); + const data = { + '_popup': 1, + cms_path: window.parent.location.pathname, + cms_history: 0, + }; + url = `${url}?${new URLSearchParams(data).toString()}`; + return this.loadForm(url, iframe, el, onLoad, onSave); + } + + loadForm (url, iframe, el, onLoad, onSave) { + iframe.addEventListener('load', () => { + const form = iframe.contentDocument; + const heading = form.querySelector('#content h1'); + const submitrow = form.querySelector('.submit-row'); + + // Remove submit button and heading + if (submitrow) { + submitrow.style.display = 'none'; + } + if (heading) { + heading.style.display = 'none'; + } + + // + let saveSuccess = !!form.querySelector('.messagelist :not(.error)'); + if (!saveSuccess) { + saveSuccess = + !!form.querySelector('.dashboard #content-main') && + !form.querySelector('.messagelist .error'); + } + if (saveSuccess) { + // Mark document and child as changed + el.dataset.changed = 'true'; + el.dataset.childChanged = 'true'; + // Hook into the django CMS dataBridge to get the details of the newly created or saved + // plugin. For new plugins we need their id to get the content. + if (!this.CMS.API.Helpers.dataBridge) { + // The dataBridge sets a timer, so typically it will not yet be present + setTimeout(() => { + if (onSave) { + onSave(el, form, this.CMS.API.Helpers.dataBridge); + } + }, 100); + } else { + if (onSave) { + onSave(el, form, this.CMS.API.Helpers.dataBridge); + } + } + // Do callback + } else if (onLoad) { + onLoad(el, form, heading, submitrow); + } + // Editor-specific dialog setup goes into the callback + }); + iframe.setAttribute('src', url); + + } + + // CMS Editor: requestPluginMarkup + // Get HTML markup for a child plugin + requestPluginMarkup (plugin_id, el) { + const settings = this.getSettings(el); + const data = { + plugin: plugin_id, + token: settings.action_token, + }; + + const url = `${settings.render_plugin_url}?${new URLSearchParams(data).toString()}`; + + return fetch(url, {method: 'GET'}) + .then(response => { + if (response.status === 200) { + return response.text(); + } + else if (response.status === 204) + { + return null; + } + }); + } + + // CMS Editor: resetInlineEditors + _resetInlineEditors () { + this.destroyAll(); + this.initAll(); + } + + // CMS Editor: loadToolbar + // Load the toolbar after saving for update + _loadToolbar () { + if (this.CMS) { + const $ = this.CMS.$; + this.CMS.API.StructureBoard._loadToolbar() + .done((newToolbar) => { + this.CMS.API.Toolbar._refreshMarkup($(newToolbar).find('.cms-toolbar')); + }) + .fail(() => this.CMS.API.Helpers.reloadBrowser()); + } + } + + _highlightTextplugin (pluginId) { + const HIGHLIGHT_TIMEOUT = 800; + + if (this.CMS) { + const $ = this.CMS.$; + const draggable = $('.cms-draggable-' + pluginId); + const doc = $(document); + const currentExpandmode = doc.data('expandmode'); + + + // expand necessary parents + doc.data('expandmode', false); + draggable + .parents('.cms-draggable') + .find('> .cms-dragitem-collapsable:not(".cms-dragitem-expanded") > .cms-dragitem-text') + .each((i, el) => { + $(el).triggerHandler(this.CMS.Plugin.click); + }); + if (draggable.length > 0) { // Expanded elements available + setTimeout(function () { + doc.data('expandmode', currentExpandmode); + }); + setTimeout( () => { + this.CMS.Plugin._highlightPluginStructure(draggable.find('.cms-dragitem:first'), + {successTimeout: 200, delay: 2000, seeThrough: true}); + }, HIGHLIGHT_TIMEOUT); + } + } + } + + // Wrap wrapper around nodes + // Just pass a collection of nodes, and a wrapper element + _wrapAll (nodes, wrapper) { + // Cache the current parent and previous sibling of the first node. + const parent = nodes[0].parentNode; + const previousSibling = nodes[0].previousSibling; + + // Place each node in wrapper. + // - If nodes is an array, we must increment the index we grab from + // after each loop. + // - If nodes is a NodeList, each node is automatically removed from + // the NodeList when it is removed from its parent with appendChild. + for (let i = 0; nodes.length - i; wrapper.firstChild === nodes[0] && i++) { + wrapper.appendChild(nodes[i]); + } + + // Place the wrapper just after the cached previousSibling, + // or if that is null, just before the first child. + const nextSibling = previousSibling ? previousSibling.nextSibling : parent.firstChild; + parent.insertBefore(wrapper, nextSibling); + + return wrapper; + } +} + +// Create global editor object +window.CMS_Editor = new CMSEditor(); + + +/******/ })() +; +//# sourceMappingURL=bundle.editor.min.js.map \ No newline at end of file diff --git a/djangocms_text/static/djangocms_text/bundles/bundle.tiptap.min.js b/djangocms_text/static/djangocms_text/bundles/bundle.tiptap.min.js new file mode 100644 index 00000000..181d4cae --- /dev/null +++ b/djangocms_text/static/djangocms_text/bundles/bundle.tiptap.min.js @@ -0,0 +1,32295 @@ +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "./node_modules/@popperjs/core/lib/createPopper.js": +/*!*********************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/createPopper.js ***! + \*********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ createPopper: () => (/* binding */ createPopper), +/* harmony export */ detectOverflow: () => (/* reexport safe */ _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_8__["default"]), +/* harmony export */ popperGenerator: () => (/* binding */ popperGenerator) +/* harmony export */ }); +/* harmony import */ var _dom_utils_getCompositeRect_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dom-utils/getCompositeRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js"); +/* harmony import */ var _dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./dom-utils/getLayoutRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js"); +/* harmony import */ var _dom_utils_listScrollParents_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dom-utils/listScrollParents.js */ "./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js"); +/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dom-utils/getOffsetParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js"); +/* harmony import */ var _utils_orderModifiers_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/orderModifiers.js */ "./node_modules/@popperjs/core/lib/utils/orderModifiers.js"); +/* harmony import */ var _utils_debounce_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/debounce.js */ "./node_modules/@popperjs/core/lib/utils/debounce.js"); +/* harmony import */ var _utils_mergeByName_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/mergeByName.js */ "./node_modules/@popperjs/core/lib/utils/mergeByName.js"); +/* harmony import */ var _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/detectOverflow.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js"); +/* harmony import */ var _dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom-utils/instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js"); + + + + + + + + + +var DEFAULT_OPTIONS = { + placement: 'bottom', + modifiers: [], + strategy: 'absolute' +}; + +function areValidElements() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return !args.some(function (element) { + return !(element && typeof element.getBoundingClientRect === 'function'); + }); +} + +function popperGenerator(generatorOptions) { + if (generatorOptions === void 0) { + generatorOptions = {}; + } + + var _generatorOptions = generatorOptions, + _generatorOptions$def = _generatorOptions.defaultModifiers, + defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, + _generatorOptions$def2 = _generatorOptions.defaultOptions, + defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; + return function createPopper(reference, popper, options) { + if (options === void 0) { + options = defaultOptions; + } + + var state = { + placement: 'bottom', + orderedModifiers: [], + options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), + modifiersData: {}, + elements: { + reference: reference, + popper: popper + }, + attributes: {}, + styles: {} + }; + var effectCleanupFns = []; + var isDestroyed = false; + var instance = { + state: state, + setOptions: function setOptions(setOptionsAction) { + var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction; + cleanupModifierEffects(); + state.options = Object.assign({}, defaultOptions, state.options, options); + state.scrollParents = { + reference: (0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isElement)(reference) ? (0,_dom_utils_listScrollParents_js__WEBPACK_IMPORTED_MODULE_1__["default"])(reference) : reference.contextElement ? (0,_dom_utils_listScrollParents_js__WEBPACK_IMPORTED_MODULE_1__["default"])(reference.contextElement) : [], + popper: (0,_dom_utils_listScrollParents_js__WEBPACK_IMPORTED_MODULE_1__["default"])(popper) + }; // Orders the modifiers based on their dependencies and `phase` + // properties + + var orderedModifiers = (0,_utils_orderModifiers_js__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_utils_mergeByName_js__WEBPACK_IMPORTED_MODULE_3__["default"])([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers + + state.orderedModifiers = orderedModifiers.filter(function (m) { + return m.enabled; + }); + runModifierEffects(); + return instance.update(); + }, + // Sync update – it will always be executed, even if not necessary. This + // is useful for low frequency updates where sync behavior simplifies the + // logic. + // For high frequency updates (e.g. `resize` and `scroll` events), always + // prefer the async Popper#update method + forceUpdate: function forceUpdate() { + if (isDestroyed) { + return; + } + + var _state$elements = state.elements, + reference = _state$elements.reference, + popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements + // anymore + + if (!areValidElements(reference, popper)) { + return; + } // Store the reference and popper rects to be read by modifiers + + + state.rects = { + reference: (0,_dom_utils_getCompositeRect_js__WEBPACK_IMPORTED_MODULE_4__["default"])(reference, (0,_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_5__["default"])(popper), state.options.strategy === 'fixed'), + popper: (0,_dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_6__["default"])(popper) + }; // Modifiers have the ability to reset the current update cycle. The + // most common use case for this is the `flip` modifier changing the + // placement, which then needs to re-run all the modifiers, because the + // logic was previously ran for the previous placement and is therefore + // stale/incorrect + + state.reset = false; + state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier + // is filled with the initial data specified by the modifier. This means + // it doesn't persist and is fresh on each update. + // To ensure persistent data, use `${name}#persistent` + + state.orderedModifiers.forEach(function (modifier) { + return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); + }); + + for (var index = 0; index < state.orderedModifiers.length; index++) { + if (state.reset === true) { + state.reset = false; + index = -1; + continue; + } + + var _state$orderedModifie = state.orderedModifiers[index], + fn = _state$orderedModifie.fn, + _state$orderedModifie2 = _state$orderedModifie.options, + _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, + name = _state$orderedModifie.name; + + if (typeof fn === 'function') { + state = fn({ + state: state, + options: _options, + name: name, + instance: instance + }) || state; + } + } + }, + // Async and optimistically optimized update – it will not be executed if + // not necessary (debounced to run at most once-per-tick) + update: (0,_utils_debounce_js__WEBPACK_IMPORTED_MODULE_7__["default"])(function () { + return new Promise(function (resolve) { + instance.forceUpdate(); + resolve(state); + }); + }), + destroy: function destroy() { + cleanupModifierEffects(); + isDestroyed = true; + } + }; + + if (!areValidElements(reference, popper)) { + return instance; + } + + instance.setOptions(options).then(function (state) { + if (!isDestroyed && options.onFirstUpdate) { + options.onFirstUpdate(state); + } + }); // Modifiers have the ability to execute arbitrary code before the first + // update cycle runs. They will be executed in the same order as the update + // cycle. This is useful when a modifier adds some persistent data that + // other modifiers need to use, but the modifier is run after the dependent + // one. + + function runModifierEffects() { + state.orderedModifiers.forEach(function (_ref) { + var name = _ref.name, + _ref$options = _ref.options, + options = _ref$options === void 0 ? {} : _ref$options, + effect = _ref.effect; + + if (typeof effect === 'function') { + var cleanupFn = effect({ + state: state, + name: name, + instance: instance, + options: options + }); + + var noopFn = function noopFn() {}; + + effectCleanupFns.push(cleanupFn || noopFn); + } + }); + } + + function cleanupModifierEffects() { + effectCleanupFns.forEach(function (fn) { + return fn(); + }); + effectCleanupFns = []; + } + + return instance; + }; +} +var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules + + + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/contains.js": +/*!***************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/contains.js ***! + \***************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ contains) +/* harmony export */ }); +/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js"); + +function contains(parent, child) { + var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method + + if (parent.contains(child)) { + return true; + } // then fallback to custom implementation with Shadow DOM support + else if (rootNode && (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isShadowRoot)(rootNode)) { + var next = child; + + do { + if (next && parent.isSameNode(next)) { + return true; + } // $FlowFixMe[prop-missing]: need a better way to handle this... + + + next = next.parentNode || next.host; + } while (next); + } // Give up, the result is false + + + return false; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getBoundingClientRect) +/* harmony export */ }); +/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js"); +/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/@popperjs/core/lib/utils/math.js"); +/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js"); +/* harmony import */ var _isLayoutViewport_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isLayoutViewport.js */ "./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js"); + + + + +function getBoundingClientRect(element, includeScale, isFixedStrategy) { + if (includeScale === void 0) { + includeScale = false; + } + + if (isFixedStrategy === void 0) { + isFixedStrategy = false; + } + + var clientRect = element.getBoundingClientRect(); + var scaleX = 1; + var scaleY = 1; + + if (includeScale && (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element)) { + scaleX = element.offsetWidth > 0 ? (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_1__.round)(clientRect.width) / element.offsetWidth || 1 : 1; + scaleY = element.offsetHeight > 0 ? (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_1__.round)(clientRect.height) / element.offsetHeight || 1 : 1; + } + + var _ref = (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isElement)(element) ? (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_2__["default"])(element) : window, + visualViewport = _ref.visualViewport; + + var addVisualOffsets = !(0,_isLayoutViewport_js__WEBPACK_IMPORTED_MODULE_3__["default"])() && isFixedStrategy; + var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX; + var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY; + var width = clientRect.width / scaleX; + var height = clientRect.height / scaleY; + return { + width: width, + height: height, + top: y, + right: x + width, + bottom: y + height, + left: x, + x: x, + y: y + }; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getClippingRect) +/* harmony export */ }); +/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js"); +/* harmony import */ var _getViewportRect_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getViewportRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js"); +/* harmony import */ var _getDocumentRect_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./getDocumentRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js"); +/* harmony import */ var _listScrollParents_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./listScrollParents.js */ "./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js"); +/* harmony import */ var _getOffsetParent_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./getOffsetParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js"); +/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js"); +/* harmony import */ var _getComputedStyle_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./getComputedStyle.js */ "./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js"); +/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js"); +/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBoundingClientRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js"); +/* harmony import */ var _getParentNode_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./getParentNode.js */ "./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js"); +/* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./contains.js */ "./node_modules/@popperjs/core/lib/dom-utils/contains.js"); +/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js"); +/* harmony import */ var _utils_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/rectToClientRect.js */ "./node_modules/@popperjs/core/lib/utils/rectToClientRect.js"); +/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/@popperjs/core/lib/utils/math.js"); + + + + + + + + + + + + + + + +function getInnerBoundingClientRect(element, strategy) { + var rect = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element, false, strategy === 'fixed'); + rect.top = rect.top + element.clientTop; + rect.left = rect.left + element.clientLeft; + rect.bottom = rect.top + element.clientHeight; + rect.right = rect.left + element.clientWidth; + rect.width = element.clientWidth; + rect.height = element.clientHeight; + rect.x = rect.left; + rect.y = rect.top; + return rect; +} + +function getClientRectFromMixedType(element, clippingParent, strategy) { + return clippingParent === _enums_js__WEBPACK_IMPORTED_MODULE_1__.viewport ? (0,_utils_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_getViewportRect_js__WEBPACK_IMPORTED_MODULE_3__["default"])(element, strategy)) : (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isElement)(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : (0,_utils_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_getDocumentRect_js__WEBPACK_IMPORTED_MODULE_5__["default"])((0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_6__["default"])(element))); +} // A "clipping parent" is an overflowable container with the characteristic of +// clipping (or hiding) overflowing elements with a position different from +// `initial` + + +function getClippingParents(element) { + var clippingParents = (0,_listScrollParents_js__WEBPACK_IMPORTED_MODULE_7__["default"])((0,_getParentNode_js__WEBPACK_IMPORTED_MODULE_8__["default"])(element)); + var canEscapeClipping = ['absolute', 'fixed'].indexOf((0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_9__["default"])(element).position) >= 0; + var clipperElement = canEscapeClipping && (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isHTMLElement)(element) ? (0,_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_10__["default"])(element) : element; + + if (!(0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isElement)(clipperElement)) { + return []; + } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 + + + return clippingParents.filter(function (clippingParent) { + return (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isElement)(clippingParent) && (0,_contains_js__WEBPACK_IMPORTED_MODULE_11__["default"])(clippingParent, clipperElement) && (0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_12__["default"])(clippingParent) !== 'body'; + }); +} // Gets the maximum area that the element is visible in due to any number of +// clipping parents + + +function getClippingRect(element, boundary, rootBoundary, strategy) { + var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); + var clippingParents = [].concat(mainClippingParents, [rootBoundary]); + var firstClippingParent = clippingParents[0]; + var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { + var rect = getClientRectFromMixedType(element, clippingParent, strategy); + accRect.top = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_13__.max)(rect.top, accRect.top); + accRect.right = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_13__.min)(rect.right, accRect.right); + accRect.bottom = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_13__.min)(rect.bottom, accRect.bottom); + accRect.left = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_13__.max)(rect.left, accRect.left); + return accRect; + }, getClientRectFromMixedType(element, firstClippingParent, strategy)); + clippingRect.width = clippingRect.right - clippingRect.left; + clippingRect.height = clippingRect.bottom - clippingRect.top; + clippingRect.x = clippingRect.left; + clippingRect.y = clippingRect.top; + return clippingRect; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getCompositeRect) +/* harmony export */ }); +/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getBoundingClientRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js"); +/* harmony import */ var _getNodeScroll_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./getNodeScroll.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js"); +/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js"); +/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js"); +/* harmony import */ var _getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./getWindowScrollBarX.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js"); +/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js"); +/* harmony import */ var _isScrollParent_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isScrollParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js"); +/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/@popperjs/core/lib/utils/math.js"); + + + + + + + + + +function isElementScaled(element) { + var rect = element.getBoundingClientRect(); + var scaleX = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(rect.width) / element.offsetWidth || 1; + var scaleY = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(rect.height) / element.offsetHeight || 1; + return scaleX !== 1 || scaleY !== 1; +} // Returns the composite rect of an element relative to its offsetParent. +// Composite means it takes into account transforms as well as layout. + + +function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { + if (isFixed === void 0) { + isFixed = false; + } + + var isOffsetParentAnElement = (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(offsetParent); + var offsetParentIsScaled = (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(offsetParent) && isElementScaled(offsetParent); + var documentElement = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_2__["default"])(offsetParent); + var rect = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_3__["default"])(elementOrVirtualElement, offsetParentIsScaled, isFixed); + var scroll = { + scrollLeft: 0, + scrollTop: 0 + }; + var offsets = { + x: 0, + y: 0 + }; + + if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { + if ((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_4__["default"])(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 + (0,_isScrollParent_js__WEBPACK_IMPORTED_MODULE_5__["default"])(documentElement)) { + scroll = (0,_getNodeScroll_js__WEBPACK_IMPORTED_MODULE_6__["default"])(offsetParent); + } + + if ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(offsetParent)) { + offsets = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_3__["default"])(offsetParent, true); + offsets.x += offsetParent.clientLeft; + offsets.y += offsetParent.clientTop; + } else if (documentElement) { + offsets.x = (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_7__["default"])(documentElement); + } + } + + return { + x: rect.left + scroll.scrollLeft - offsets.x, + y: rect.top + scroll.scrollTop - offsets.y, + width: rect.width, + height: rect.height + }; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getComputedStyle) +/* harmony export */ }); +/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js"); + +function getComputedStyle(element) { + return (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element).getComputedStyle(element); +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getDocumentElement) +/* harmony export */ }); +/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js"); + +function getDocumentElement(element) { + // $FlowFixMe[incompatible-return]: assume body is always available + return (((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isElement)(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] + element.document) || window.document).documentElement; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getDocumentRect) +/* harmony export */ }); +/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js"); +/* harmony import */ var _getComputedStyle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getComputedStyle.js */ "./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js"); +/* harmony import */ var _getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getWindowScrollBarX.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js"); +/* harmony import */ var _getWindowScroll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getWindowScroll.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js"); +/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/@popperjs/core/lib/utils/math.js"); + + + + + // Gets the entire size of the scrollable document area, even extending outside +// of the `` and `` rect bounds if horizontally scrollable + +function getDocumentRect(element) { + var _element$ownerDocumen; + + var html = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element); + var winScroll = (0,_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_1__["default"])(element); + var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; + var width = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); + var height = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); + var x = -winScroll.scrollLeft + (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__["default"])(element); + var y = -winScroll.scrollTop; + + if ((0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_4__["default"])(body || html).direction === 'rtl') { + x += (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.clientWidth, body ? body.clientWidth : 0) - width; + } + + return { + width: width, + height: height, + x: x, + y: y + }; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js ***! + \***************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getHTMLElementScroll) +/* harmony export */ }); +function getHTMLElementScroll(element) { + return { + scrollLeft: element.scrollLeft, + scrollTop: element.scrollTop + }; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js": +/*!********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getLayoutRect) +/* harmony export */ }); +/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBoundingClientRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js"); + // Returns the layout rect of an element relative to its offsetParent. Layout +// means it doesn't take into account transforms. + +function getLayoutRect(element) { + var clientRect = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element); // Use the clientRect sizes if it's not been transformed. + // Fixes https://github.com/popperjs/popper-core/issues/1223 + + var width = element.offsetWidth; + var height = element.offsetHeight; + + if (Math.abs(clientRect.width - width) <= 1) { + width = clientRect.width; + } + + if (Math.abs(clientRect.height - height) <= 1) { + height = clientRect.height; + } + + return { + x: element.offsetLeft, + y: element.offsetTop, + width: width, + height: height + }; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js": +/*!******************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getNodeName) +/* harmony export */ }); +function getNodeName(element) { + return element ? (element.nodeName || '').toLowerCase() : null; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js": +/*!********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getNodeScroll) +/* harmony export */ }); +/* harmony import */ var _getWindowScroll_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getWindowScroll.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js"); +/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js"); +/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js"); +/* harmony import */ var _getHTMLElementScroll_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getHTMLElementScroll.js */ "./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js"); + + + + +function getNodeScroll(node) { + if (node === (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(node) || !(0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(node)) { + return (0,_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_2__["default"])(node); + } else { + return (0,_getHTMLElementScroll_js__WEBPACK_IMPORTED_MODULE_3__["default"])(node); + } +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getOffsetParent) +/* harmony export */ }); +/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js"); +/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js"); +/* harmony import */ var _getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getComputedStyle.js */ "./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js"); +/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js"); +/* harmony import */ var _isTableElement_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isTableElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js"); +/* harmony import */ var _getParentNode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getParentNode.js */ "./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js"); +/* harmony import */ var _utils_userAgent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/userAgent.js */ "./node_modules/@popperjs/core/lib/utils/userAgent.js"); + + + + + + + + +function getTrueOffsetParent(element) { + if (!(0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || // https://github.com/popperjs/popper-core/issues/837 + (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(element).position === 'fixed') { + return null; + } + + return element.offsetParent; +} // `.offsetParent` reports `null` for fixed elements, while absolute elements +// return the containing block + + +function getContainingBlock(element) { + var isFirefox = /firefox/i.test((0,_utils_userAgent_js__WEBPACK_IMPORTED_MODULE_2__["default"])()); + var isIE = /Trident/i.test((0,_utils_userAgent_js__WEBPACK_IMPORTED_MODULE_2__["default"])()); + + if (isIE && (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element)) { + // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport + var elementCss = (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(element); + + if (elementCss.position === 'fixed') { + return null; + } + } + + var currentNode = (0,_getParentNode_js__WEBPACK_IMPORTED_MODULE_3__["default"])(element); + + if ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isShadowRoot)(currentNode)) { + currentNode = currentNode.host; + } + + while ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(currentNode) && ['html', 'body'].indexOf((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_4__["default"])(currentNode)) < 0) { + var css = (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(currentNode); // This is non-exhaustive but covers the most common CSS properties that + // create a containing block. + // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block + + if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { + return currentNode; + } else { + currentNode = currentNode.parentNode; + } + } + + return null; +} // Gets the closest ancestor positioned element. Handles some edge cases, +// such as table ancestors and cross browser bugs. + + +function getOffsetParent(element) { + var window = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_5__["default"])(element); + var offsetParent = getTrueOffsetParent(element); + + while (offsetParent && (0,_isTableElement_js__WEBPACK_IMPORTED_MODULE_6__["default"])(offsetParent) && (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(offsetParent).position === 'static') { + offsetParent = getTrueOffsetParent(offsetParent); + } + + if (offsetParent && ((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_4__["default"])(offsetParent) === 'html' || (0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_4__["default"])(offsetParent) === 'body' && (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(offsetParent).position === 'static')) { + return window; + } + + return offsetParent || getContainingBlock(element) || window; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js": +/*!********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getParentNode) +/* harmony export */ }); +/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js"); +/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js"); +/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js"); + + + +function getParentNode(element) { + if ((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element) === 'html') { + return element; + } + + return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle + // $FlowFixMe[incompatible-return] + // $FlowFixMe[prop-missing] + element.assignedSlot || // step into the shadow DOM of the parent of a slotted node + element.parentNode || ( // DOM Element detected + (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isShadowRoot)(element) ? element.host : null) || // ShadowRoot detected + // $FlowFixMe[incompatible-call]: HTMLElement is a Node + (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_2__["default"])(element) // fallback + + ); +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getScrollParent) +/* harmony export */ }); +/* harmony import */ var _getParentNode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getParentNode.js */ "./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js"); +/* harmony import */ var _isScrollParent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isScrollParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js"); +/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js"); +/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js"); + + + + +function getScrollParent(node) { + if (['html', 'body', '#document'].indexOf((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__["default"])(node)) >= 0) { + // $FlowFixMe[incompatible-return]: assume body is always available + return node.ownerDocument.body; + } + + if ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(node) && (0,_isScrollParent_js__WEBPACK_IMPORTED_MODULE_2__["default"])(node)) { + return node; + } + + return getScrollParent((0,_getParentNode_js__WEBPACK_IMPORTED_MODULE_3__["default"])(node)); +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getViewportRect) +/* harmony export */ }); +/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js"); +/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js"); +/* harmony import */ var _getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getWindowScrollBarX.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js"); +/* harmony import */ var _isLayoutViewport_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isLayoutViewport.js */ "./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js"); + + + + +function getViewportRect(element, strategy) { + var win = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element); + var html = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_1__["default"])(element); + var visualViewport = win.visualViewport; + var width = html.clientWidth; + var height = html.clientHeight; + var x = 0; + var y = 0; + + if (visualViewport) { + width = visualViewport.width; + height = visualViewport.height; + var layoutViewport = (0,_isLayoutViewport_js__WEBPACK_IMPORTED_MODULE_2__["default"])(); + + if (layoutViewport || !layoutViewport && strategy === 'fixed') { + x = visualViewport.offsetLeft; + y = visualViewport.offsetTop; + } + } + + return { + width: width, + height: height, + x: x + (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__["default"])(element), + y: y + }; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js": +/*!****************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/getWindow.js ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getWindow) +/* harmony export */ }); +function getWindow(node) { + if (node == null) { + return window; + } + + if (node.toString() !== '[object Window]') { + var ownerDocument = node.ownerDocument; + return ownerDocument ? ownerDocument.defaultView || window : window; + } + + return node; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getWindowScroll) +/* harmony export */ }); +/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js"); + +function getWindowScroll(node) { + var win = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(node); + var scrollLeft = win.pageXOffset; + var scrollTop = win.pageYOffset; + return { + scrollLeft: scrollLeft, + scrollTop: scrollTop + }; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getWindowScrollBarX) +/* harmony export */ }); +/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBoundingClientRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js"); +/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js"); +/* harmony import */ var _getWindowScroll_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getWindowScroll.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js"); + + + +function getWindowScrollBarX(element) { + // If has a CSS width greater than the viewport, then this will be + // incorrect for RTL. + // Popper 1 is broken in this case and never had a bug report so let's assume + // it's not an issue. I don't think anyone ever specifies width on + // anyway. + // Browsers where the left scrollbar doesn't cause an issue report `0` for + // this (e.g. Edge 2019, IE11, Safari) + return (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_1__["default"])(element)).left + (0,_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_2__["default"])(element).scrollLeft; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ isElement: () => (/* binding */ isElement), +/* harmony export */ isHTMLElement: () => (/* binding */ isHTMLElement), +/* harmony export */ isShadowRoot: () => (/* binding */ isShadowRoot) +/* harmony export */ }); +/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js"); + + +function isElement(node) { + var OwnElement = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(node).Element; + return node instanceof OwnElement || node instanceof Element; +} + +function isHTMLElement(node) { + var OwnElement = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(node).HTMLElement; + return node instanceof OwnElement || node instanceof HTMLElement; +} + +function isShadowRoot(node) { + // IE 11 has no ShadowRoot + if (typeof ShadowRoot === 'undefined') { + return false; + } + + var OwnElement = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(node).ShadowRoot; + return node instanceof OwnElement || node instanceof ShadowRoot; +} + + + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ isLayoutViewport) +/* harmony export */ }); +/* harmony import */ var _utils_userAgent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/userAgent.js */ "./node_modules/@popperjs/core/lib/utils/userAgent.js"); + +function isLayoutViewport() { + return !/^((?!chrome|android).)*safari/i.test((0,_utils_userAgent_js__WEBPACK_IMPORTED_MODULE_0__["default"])()); +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ isScrollParent) +/* harmony export */ }); +/* harmony import */ var _getComputedStyle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getComputedStyle.js */ "./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js"); + +function isScrollParent(element) { + // Firefox wants us to check `-x` and `-y` variations as well + var _getComputedStyle = (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element), + overflow = _getComputedStyle.overflow, + overflowX = _getComputedStyle.overflowX, + overflowY = _getComputedStyle.overflowY; + + return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ isTableElement) +/* harmony export */ }); +/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js"); + +function isTableElement(element) { + return ['table', 'td', 'th'].indexOf((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element)) >= 0; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js": +/*!************************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ listScrollParents) +/* harmony export */ }); +/* harmony import */ var _getScrollParent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getScrollParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js"); +/* harmony import */ var _getParentNode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getParentNode.js */ "./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js"); +/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js"); +/* harmony import */ var _isScrollParent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isScrollParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js"); + + + + +/* +given a DOM element, return the list of all scroll parents, up the list of ancesors +until we get to the top window object. This list is what we attach scroll listeners +to, because if any of these parent elements scroll, we'll need to re-calculate the +reference element's position. +*/ + +function listScrollParents(element, list) { + var _element$ownerDocumen; + + if (list === void 0) { + list = []; + } + + var scrollParent = (0,_getScrollParent_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element); + var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); + var win = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scrollParent); + var target = isBody ? [win].concat(win.visualViewport || [], (0,_isScrollParent_js__WEBPACK_IMPORTED_MODULE_2__["default"])(scrollParent) ? scrollParent : []) : scrollParent; + var updatedList = list.concat(target); + return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here + updatedList.concat(listScrollParents((0,_getParentNode_js__WEBPACK_IMPORTED_MODULE_3__["default"])(target))); +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/enums.js": +/*!**************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/enums.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ afterMain: () => (/* binding */ afterMain), +/* harmony export */ afterRead: () => (/* binding */ afterRead), +/* harmony export */ afterWrite: () => (/* binding */ afterWrite), +/* harmony export */ auto: () => (/* binding */ auto), +/* harmony export */ basePlacements: () => (/* binding */ basePlacements), +/* harmony export */ beforeMain: () => (/* binding */ beforeMain), +/* harmony export */ beforeRead: () => (/* binding */ beforeRead), +/* harmony export */ beforeWrite: () => (/* binding */ beforeWrite), +/* harmony export */ bottom: () => (/* binding */ bottom), +/* harmony export */ clippingParents: () => (/* binding */ clippingParents), +/* harmony export */ end: () => (/* binding */ end), +/* harmony export */ left: () => (/* binding */ left), +/* harmony export */ main: () => (/* binding */ main), +/* harmony export */ modifierPhases: () => (/* binding */ modifierPhases), +/* harmony export */ placements: () => (/* binding */ placements), +/* harmony export */ popper: () => (/* binding */ popper), +/* harmony export */ read: () => (/* binding */ read), +/* harmony export */ reference: () => (/* binding */ reference), +/* harmony export */ right: () => (/* binding */ right), +/* harmony export */ start: () => (/* binding */ start), +/* harmony export */ top: () => (/* binding */ top), +/* harmony export */ variationPlacements: () => (/* binding */ variationPlacements), +/* harmony export */ viewport: () => (/* binding */ viewport), +/* harmony export */ write: () => (/* binding */ write) +/* harmony export */ }); +var top = 'top'; +var bottom = 'bottom'; +var right = 'right'; +var left = 'left'; +var auto = 'auto'; +var basePlacements = [top, bottom, right, left]; +var start = 'start'; +var end = 'end'; +var clippingParents = 'clippingParents'; +var viewport = 'viewport'; +var popper = 'popper'; +var reference = 'reference'; +var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) { + return acc.concat([placement + "-" + start, placement + "-" + end]); +}, []); +var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) { + return acc.concat([placement, placement + "-" + start, placement + "-" + end]); +}, []); // modifiers that need to read the DOM + +var beforeRead = 'beforeRead'; +var read = 'read'; +var afterRead = 'afterRead'; // pure-logic modifiers + +var beforeMain = 'beforeMain'; +var main = 'main'; +var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state) + +var beforeWrite = 'beforeWrite'; +var write = 'write'; +var afterWrite = 'afterWrite'; +var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/modifiers/applyStyles.js": +/*!******************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/modifiers/applyStyles.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dom-utils/getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js"); +/* harmony import */ var _dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dom-utils/instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js"); + + // This modifier takes the styles prepared by the `computeStyles` modifier +// and applies them to the HTMLElements such as popper and arrow + +function applyStyles(_ref) { + var state = _ref.state; + Object.keys(state.elements).forEach(function (name) { + var style = state.styles[name] || {}; + var attributes = state.attributes[name] || {}; + var element = state.elements[name]; // arrow is optional + virtual elements + + if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__["default"])(element)) { + return; + } // Flow doesn't support to extend this property, but it's the most + // effective way to apply styles to an HTMLElement + // $FlowFixMe[cannot-write] + + + Object.assign(element.style, style); + Object.keys(attributes).forEach(function (name) { + var value = attributes[name]; + + if (value === false) { + element.removeAttribute(name); + } else { + element.setAttribute(name, value === true ? '' : value); + } + }); + }); +} + +function effect(_ref2) { + var state = _ref2.state; + var initialStyles = { + popper: { + position: state.options.strategy, + left: '0', + top: '0', + margin: '0' + }, + arrow: { + position: 'absolute' + }, + reference: {} + }; + Object.assign(state.elements.popper.style, initialStyles.popper); + state.styles = initialStyles; + + if (state.elements.arrow) { + Object.assign(state.elements.arrow.style, initialStyles.arrow); + } + + return function () { + Object.keys(state.elements).forEach(function (name) { + var element = state.elements[name]; + var attributes = state.attributes[name] || {}; + var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them + + var style = styleProperties.reduce(function (style, property) { + style[property] = ''; + return style; + }, {}); // arrow is optional + virtual elements + + if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__["default"])(element)) { + return; + } + + Object.assign(element.style, style); + Object.keys(attributes).forEach(function (attribute) { + element.removeAttribute(attribute); + }); + }); + }; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + name: 'applyStyles', + enabled: true, + phase: 'write', + fn: applyStyles, + effect: effect, + requires: ['computeStyles'] +}); + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/modifiers/arrow.js": +/*!************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/modifiers/arrow.js ***! + \************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js"); +/* harmony import */ var _dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dom-utils/getLayoutRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js"); +/* harmony import */ var _dom_utils_contains_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../dom-utils/contains.js */ "./node_modules/@popperjs/core/lib/dom-utils/contains.js"); +/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dom-utils/getOffsetParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js"); +/* harmony import */ var _utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/getMainAxisFromPlacement.js */ "./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js"); +/* harmony import */ var _utils_within_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/within.js */ "./node_modules/@popperjs/core/lib/utils/within.js"); +/* harmony import */ var _utils_mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/mergePaddingObject.js */ "./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js"); +/* harmony import */ var _utils_expandToHashMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/expandToHashMap.js */ "./node_modules/@popperjs/core/lib/utils/expandToHashMap.js"); +/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js"); + + + + + + + + + // eslint-disable-next-line import/no-unused-modules + +var toPaddingObject = function toPaddingObject(padding, state) { + padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { + placement: state.placement + })) : padding; + return (0,_utils_mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(typeof padding !== 'number' ? padding : (0,_utils_expandToHashMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(padding, _enums_js__WEBPACK_IMPORTED_MODULE_2__.basePlacements)); +}; + +function arrow(_ref) { + var _state$modifiersData$; + + var state = _ref.state, + name = _ref.name, + options = _ref.options; + var arrowElement = state.elements.arrow; + var popperOffsets = state.modifiersData.popperOffsets; + var basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_3__["default"])(state.placement); + var axis = (0,_utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_4__["default"])(basePlacement); + var isVertical = [_enums_js__WEBPACK_IMPORTED_MODULE_2__.left, _enums_js__WEBPACK_IMPORTED_MODULE_2__.right].indexOf(basePlacement) >= 0; + var len = isVertical ? 'height' : 'width'; + + if (!arrowElement || !popperOffsets) { + return; + } + + var paddingObject = toPaddingObject(options.padding, state); + var arrowRect = (0,_dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_5__["default"])(arrowElement); + var minProp = axis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_2__.top : _enums_js__WEBPACK_IMPORTED_MODULE_2__.left; + var maxProp = axis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_2__.bottom : _enums_js__WEBPACK_IMPORTED_MODULE_2__.right; + var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len]; + var startDiff = popperOffsets[axis] - state.rects.reference[axis]; + var arrowOffsetParent = (0,_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_6__["default"])(arrowElement); + var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; + var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is + // outside of the popper bounds + + var min = paddingObject[minProp]; + var max = clientSize - arrowRect[len] - paddingObject[maxProp]; + var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; + var offset = (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_7__.within)(min, center, max); // Prevents breaking syntax highlighting... + + var axisProp = axis; + state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$); +} + +function effect(_ref2) { + var state = _ref2.state, + options = _ref2.options; + var _options$element = options.element, + arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; + + if (arrowElement == null) { + return; + } // CSS selector + + + if (typeof arrowElement === 'string') { + arrowElement = state.elements.popper.querySelector(arrowElement); + + if (!arrowElement) { + return; + } + } + + if (!(0,_dom_utils_contains_js__WEBPACK_IMPORTED_MODULE_8__["default"])(state.elements.popper, arrowElement)) { + return; + } + + state.elements.arrow = arrowElement; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + name: 'arrow', + enabled: true, + phase: 'main', + fn: arrow, + effect: effect, + requires: ['popperOffsets'], + requiresIfExists: ['preventOverflow'] +}); + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/modifiers/computeStyles.js": +/*!********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/modifiers/computeStyles.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ mapToStyles: () => (/* binding */ mapToStyles) +/* harmony export */ }); +/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js"); +/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../dom-utils/getOffsetParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js"); +/* harmony import */ var _dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../dom-utils/getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js"); +/* harmony import */ var _dom_utils_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../dom-utils/getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js"); +/* harmony import */ var _dom_utils_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dom-utils/getComputedStyle.js */ "./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js"); +/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js"); +/* harmony import */ var _utils_getVariation_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/getVariation.js */ "./node_modules/@popperjs/core/lib/utils/getVariation.js"); +/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/@popperjs/core/lib/utils/math.js"); + + + + + + + + // eslint-disable-next-line import/no-unused-modules + +var unsetSides = { + top: 'auto', + right: 'auto', + bottom: 'auto', + left: 'auto' +}; // Round the offsets to the nearest suitable subpixel based on the DPR. +// Zooming can change the DPR, but it seems to report a value that will +// cleanly divide the values into the appropriate subpixels. + +function roundOffsetsByDPR(_ref, win) { + var x = _ref.x, + y = _ref.y; + var dpr = win.devicePixelRatio || 1; + return { + x: (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(x * dpr) / dpr || 0, + y: (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(y * dpr) / dpr || 0 + }; +} + +function mapToStyles(_ref2) { + var _Object$assign2; + + var popper = _ref2.popper, + popperRect = _ref2.popperRect, + placement = _ref2.placement, + variation = _ref2.variation, + offsets = _ref2.offsets, + position = _ref2.position, + gpuAcceleration = _ref2.gpuAcceleration, + adaptive = _ref2.adaptive, + roundOffsets = _ref2.roundOffsets, + isFixed = _ref2.isFixed; + var _offsets$x = offsets.x, + x = _offsets$x === void 0 ? 0 : _offsets$x, + _offsets$y = offsets.y, + y = _offsets$y === void 0 ? 0 : _offsets$y; + + var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({ + x: x, + y: y + }) : { + x: x, + y: y + }; + + x = _ref3.x; + y = _ref3.y; + var hasX = offsets.hasOwnProperty('x'); + var hasY = offsets.hasOwnProperty('y'); + var sideX = _enums_js__WEBPACK_IMPORTED_MODULE_1__.left; + var sideY = _enums_js__WEBPACK_IMPORTED_MODULE_1__.top; + var win = window; + + if (adaptive) { + var offsetParent = (0,_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_2__["default"])(popper); + var heightProp = 'clientHeight'; + var widthProp = 'clientWidth'; + + if (offsetParent === (0,_dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_3__["default"])(popper)) { + offsetParent = (0,_dom_utils_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_4__["default"])(popper); + + if ((0,_dom_utils_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_5__["default"])(offsetParent).position !== 'static' && position === 'absolute') { + heightProp = 'scrollHeight'; + widthProp = 'scrollWidth'; + } + } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it + + + offsetParent = offsetParent; + + if (placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.top || (placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.left || placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.right) && variation === _enums_js__WEBPACK_IMPORTED_MODULE_1__.end) { + sideY = _enums_js__WEBPACK_IMPORTED_MODULE_1__.bottom; + var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] + offsetParent[heightProp]; + y -= offsetY - popperRect.height; + y *= gpuAcceleration ? 1 : -1; + } + + if (placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.left || (placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.top || placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.bottom) && variation === _enums_js__WEBPACK_IMPORTED_MODULE_1__.end) { + sideX = _enums_js__WEBPACK_IMPORTED_MODULE_1__.right; + var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] + offsetParent[widthProp]; + x -= offsetX - popperRect.width; + x *= gpuAcceleration ? 1 : -1; + } + } + + var commonStyles = Object.assign({ + position: position + }, adaptive && unsetSides); + + var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ + x: x, + y: y + }, (0,_dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_3__["default"])(popper)) : { + x: x, + y: y + }; + + x = _ref4.x; + y = _ref4.y; + + if (gpuAcceleration) { + var _Object$assign; + + return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); + } + + return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); +} + +function computeStyles(_ref5) { + var state = _ref5.state, + options = _ref5.options; + var _options$gpuAccelerat = options.gpuAcceleration, + gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, + _options$adaptive = options.adaptive, + adaptive = _options$adaptive === void 0 ? true : _options$adaptive, + _options$roundOffsets = options.roundOffsets, + roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; + var commonStyles = { + placement: (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_6__["default"])(state.placement), + variation: (0,_utils_getVariation_js__WEBPACK_IMPORTED_MODULE_7__["default"])(state.placement), + popper: state.elements.popper, + popperRect: state.rects.popper, + gpuAcceleration: gpuAcceleration, + isFixed: state.options.strategy === 'fixed' + }; + + if (state.modifiersData.popperOffsets != null) { + state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { + offsets: state.modifiersData.popperOffsets, + position: state.options.strategy, + adaptive: adaptive, + roundOffsets: roundOffsets + }))); + } + + if (state.modifiersData.arrow != null) { + state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { + offsets: state.modifiersData.arrow, + position: 'absolute', + adaptive: false, + roundOffsets: roundOffsets + }))); + } + + state.attributes.popper = Object.assign({}, state.attributes.popper, { + 'data-popper-placement': state.placement + }); +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + name: 'computeStyles', + enabled: true, + phase: 'beforeWrite', + fn: computeStyles, + data: {} +}); + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/modifiers/eventListeners.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/modifiers/eventListeners.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dom-utils/getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js"); + // eslint-disable-next-line import/no-unused-modules + +var passive = { + passive: true +}; + +function effect(_ref) { + var state = _ref.state, + instance = _ref.instance, + options = _ref.options; + var _options$scroll = options.scroll, + scroll = _options$scroll === void 0 ? true : _options$scroll, + _options$resize = options.resize, + resize = _options$resize === void 0 ? true : _options$resize; + var window = (0,_dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(state.elements.popper); + var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); + + if (scroll) { + scrollParents.forEach(function (scrollParent) { + scrollParent.addEventListener('scroll', instance.update, passive); + }); + } + + if (resize) { + window.addEventListener('resize', instance.update, passive); + } + + return function () { + if (scroll) { + scrollParents.forEach(function (scrollParent) { + scrollParent.removeEventListener('scroll', instance.update, passive); + }); + } + + if (resize) { + window.removeEventListener('resize', instance.update, passive); + } + }; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + name: 'eventListeners', + enabled: true, + phase: 'write', + fn: function fn() {}, + effect: effect, + data: {} +}); + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/modifiers/flip.js": +/*!***********************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/modifiers/flip.js ***! + \***********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/getOppositePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js"); +/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js"); +/* harmony import */ var _utils_getOppositeVariationPlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/getOppositeVariationPlacement.js */ "./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js"); +/* harmony import */ var _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/detectOverflow.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js"); +/* harmony import */ var _utils_computeAutoPlacement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/computeAutoPlacement.js */ "./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js"); +/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js"); +/* harmony import */ var _utils_getVariation_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/getVariation.js */ "./node_modules/@popperjs/core/lib/utils/getVariation.js"); + + + + + + + // eslint-disable-next-line import/no-unused-modules + +function getExpandedFallbackPlacements(placement) { + if ((0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(placement) === _enums_js__WEBPACK_IMPORTED_MODULE_1__.auto) { + return []; + } + + var oppositePlacement = (0,_utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__["default"])(placement); + return [(0,_utils_getOppositeVariationPlacement_js__WEBPACK_IMPORTED_MODULE_3__["default"])(placement), oppositePlacement, (0,_utils_getOppositeVariationPlacement_js__WEBPACK_IMPORTED_MODULE_3__["default"])(oppositePlacement)]; +} + +function flip(_ref) { + var state = _ref.state, + options = _ref.options, + name = _ref.name; + + if (state.modifiersData[name]._skip) { + return; + } + + var _options$mainAxis = options.mainAxis, + checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, + _options$altAxis = options.altAxis, + checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, + specifiedFallbackPlacements = options.fallbackPlacements, + padding = options.padding, + boundary = options.boundary, + rootBoundary = options.rootBoundary, + altBoundary = options.altBoundary, + _options$flipVariatio = options.flipVariations, + flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, + allowedAutoPlacements = options.allowedAutoPlacements; + var preferredPlacement = state.options.placement; + var basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(preferredPlacement); + var isBasePlacement = basePlacement === preferredPlacement; + var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [(0,_utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__["default"])(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); + var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) { + return acc.concat((0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(placement) === _enums_js__WEBPACK_IMPORTED_MODULE_1__.auto ? (0,_utils_computeAutoPlacement_js__WEBPACK_IMPORTED_MODULE_4__["default"])(state, { + placement: placement, + boundary: boundary, + rootBoundary: rootBoundary, + padding: padding, + flipVariations: flipVariations, + allowedAutoPlacements: allowedAutoPlacements + }) : placement); + }, []); + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var checksMap = new Map(); + var makeFallbackChecks = true; + var firstFittingPlacement = placements[0]; + + for (var i = 0; i < placements.length; i++) { + var placement = placements[i]; + + var _basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(placement); + + var isStartVariation = (0,_utils_getVariation_js__WEBPACK_IMPORTED_MODULE_5__["default"])(placement) === _enums_js__WEBPACK_IMPORTED_MODULE_1__.start; + var isVertical = [_enums_js__WEBPACK_IMPORTED_MODULE_1__.top, _enums_js__WEBPACK_IMPORTED_MODULE_1__.bottom].indexOf(_basePlacement) >= 0; + var len = isVertical ? 'width' : 'height'; + var overflow = (0,_utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_6__["default"])(state, { + placement: placement, + boundary: boundary, + rootBoundary: rootBoundary, + altBoundary: altBoundary, + padding: padding + }); + var mainVariationSide = isVertical ? isStartVariation ? _enums_js__WEBPACK_IMPORTED_MODULE_1__.right : _enums_js__WEBPACK_IMPORTED_MODULE_1__.left : isStartVariation ? _enums_js__WEBPACK_IMPORTED_MODULE_1__.bottom : _enums_js__WEBPACK_IMPORTED_MODULE_1__.top; + + if (referenceRect[len] > popperRect[len]) { + mainVariationSide = (0,_utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__["default"])(mainVariationSide); + } + + var altVariationSide = (0,_utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__["default"])(mainVariationSide); + var checks = []; + + if (checkMainAxis) { + checks.push(overflow[_basePlacement] <= 0); + } + + if (checkAltAxis) { + checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); + } + + if (checks.every(function (check) { + return check; + })) { + firstFittingPlacement = placement; + makeFallbackChecks = false; + break; + } + + checksMap.set(placement, checks); + } + + if (makeFallbackChecks) { + // `2` may be desired in some cases – research later + var numberOfChecks = flipVariations ? 3 : 1; + + var _loop = function _loop(_i) { + var fittingPlacement = placements.find(function (placement) { + var checks = checksMap.get(placement); + + if (checks) { + return checks.slice(0, _i).every(function (check) { + return check; + }); + } + }); + + if (fittingPlacement) { + firstFittingPlacement = fittingPlacement; + return "break"; + } + }; + + for (var _i = numberOfChecks; _i > 0; _i--) { + var _ret = _loop(_i); + + if (_ret === "break") break; + } + } + + if (state.placement !== firstFittingPlacement) { + state.modifiersData[name]._skip = true; + state.placement = firstFittingPlacement; + state.reset = true; + } +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + name: 'flip', + enabled: true, + phase: 'main', + fn: flip, + requiresIfExists: ['offset'], + data: { + _skip: false + } +}); + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/modifiers/hide.js": +/*!***********************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/modifiers/hide.js ***! + \***********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js"); +/* harmony import */ var _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/detectOverflow.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js"); + + + +function getSideOffsets(overflow, rect, preventedOffsets) { + if (preventedOffsets === void 0) { + preventedOffsets = { + x: 0, + y: 0 + }; + } + + return { + top: overflow.top - rect.height - preventedOffsets.y, + right: overflow.right - rect.width + preventedOffsets.x, + bottom: overflow.bottom - rect.height + preventedOffsets.y, + left: overflow.left - rect.width - preventedOffsets.x + }; +} + +function isAnySideFullyClipped(overflow) { + return [_enums_js__WEBPACK_IMPORTED_MODULE_0__.top, _enums_js__WEBPACK_IMPORTED_MODULE_0__.right, _enums_js__WEBPACK_IMPORTED_MODULE_0__.bottom, _enums_js__WEBPACK_IMPORTED_MODULE_0__.left].some(function (side) { + return overflow[side] >= 0; + }); +} + +function hide(_ref) { + var state = _ref.state, + name = _ref.name; + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var preventedOffsets = state.modifiersData.preventOverflow; + var referenceOverflow = (0,_utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_1__["default"])(state, { + elementContext: 'reference' + }); + var popperAltOverflow = (0,_utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_1__["default"])(state, { + altBoundary: true + }); + var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); + var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); + var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); + var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); + state.modifiersData[name] = { + referenceClippingOffsets: referenceClippingOffsets, + popperEscapeOffsets: popperEscapeOffsets, + isReferenceHidden: isReferenceHidden, + hasPopperEscaped: hasPopperEscaped + }; + state.attributes.popper = Object.assign({}, state.attributes.popper, { + 'data-popper-reference-hidden': isReferenceHidden, + 'data-popper-escaped': hasPopperEscaped + }); +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + name: 'hide', + enabled: true, + phase: 'main', + requiresIfExists: ['preventOverflow'], + fn: hide +}); + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/modifiers/index.js": +/*!************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/modifiers/index.js ***! + \************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ applyStyles: () => (/* reexport safe */ _applyStyles_js__WEBPACK_IMPORTED_MODULE_0__["default"]), +/* harmony export */ arrow: () => (/* reexport safe */ _arrow_js__WEBPACK_IMPORTED_MODULE_1__["default"]), +/* harmony export */ computeStyles: () => (/* reexport safe */ _computeStyles_js__WEBPACK_IMPORTED_MODULE_2__["default"]), +/* harmony export */ eventListeners: () => (/* reexport safe */ _eventListeners_js__WEBPACK_IMPORTED_MODULE_3__["default"]), +/* harmony export */ flip: () => (/* reexport safe */ _flip_js__WEBPACK_IMPORTED_MODULE_4__["default"]), +/* harmony export */ hide: () => (/* reexport safe */ _hide_js__WEBPACK_IMPORTED_MODULE_5__["default"]), +/* harmony export */ offset: () => (/* reexport safe */ _offset_js__WEBPACK_IMPORTED_MODULE_6__["default"]), +/* harmony export */ popperOffsets: () => (/* reexport safe */ _popperOffsets_js__WEBPACK_IMPORTED_MODULE_7__["default"]), +/* harmony export */ preventOverflow: () => (/* reexport safe */ _preventOverflow_js__WEBPACK_IMPORTED_MODULE_8__["default"]) +/* harmony export */ }); +/* harmony import */ var _applyStyles_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./applyStyles.js */ "./node_modules/@popperjs/core/lib/modifiers/applyStyles.js"); +/* harmony import */ var _arrow_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./arrow.js */ "./node_modules/@popperjs/core/lib/modifiers/arrow.js"); +/* harmony import */ var _computeStyles_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./computeStyles.js */ "./node_modules/@popperjs/core/lib/modifiers/computeStyles.js"); +/* harmony import */ var _eventListeners_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./eventListeners.js */ "./node_modules/@popperjs/core/lib/modifiers/eventListeners.js"); +/* harmony import */ var _flip_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./flip.js */ "./node_modules/@popperjs/core/lib/modifiers/flip.js"); +/* harmony import */ var _hide_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hide.js */ "./node_modules/@popperjs/core/lib/modifiers/hide.js"); +/* harmony import */ var _offset_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./offset.js */ "./node_modules/@popperjs/core/lib/modifiers/offset.js"); +/* harmony import */ var _popperOffsets_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./popperOffsets.js */ "./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js"); +/* harmony import */ var _preventOverflow_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./preventOverflow.js */ "./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js"); + + + + + + + + + + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/modifiers/offset.js": +/*!*************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/modifiers/offset.js ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ distanceAndSkiddingToXY: () => (/* binding */ distanceAndSkiddingToXY) +/* harmony export */ }); +/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js"); +/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js"); + + // eslint-disable-next-line import/no-unused-modules + +function distanceAndSkiddingToXY(placement, rects, offset) { + var basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(placement); + var invertDistance = [_enums_js__WEBPACK_IMPORTED_MODULE_1__.left, _enums_js__WEBPACK_IMPORTED_MODULE_1__.top].indexOf(basePlacement) >= 0 ? -1 : 1; + + var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { + placement: placement + })) : offset, + skidding = _ref[0], + distance = _ref[1]; + + skidding = skidding || 0; + distance = (distance || 0) * invertDistance; + return [_enums_js__WEBPACK_IMPORTED_MODULE_1__.left, _enums_js__WEBPACK_IMPORTED_MODULE_1__.right].indexOf(basePlacement) >= 0 ? { + x: distance, + y: skidding + } : { + x: skidding, + y: distance + }; +} + +function offset(_ref2) { + var state = _ref2.state, + options = _ref2.options, + name = _ref2.name; + var _options$offset = options.offset, + offset = _options$offset === void 0 ? [0, 0] : _options$offset; + var data = _enums_js__WEBPACK_IMPORTED_MODULE_1__.placements.reduce(function (acc, placement) { + acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset); + return acc; + }, {}); + var _data$state$placement = data[state.placement], + x = _data$state$placement.x, + y = _data$state$placement.y; + + if (state.modifiersData.popperOffsets != null) { + state.modifiersData.popperOffsets.x += x; + state.modifiersData.popperOffsets.y += y; + } + + state.modifiersData[name] = data; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + name: 'offset', + enabled: true, + phase: 'main', + requires: ['popperOffsets'], + fn: offset +}); + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js": +/*!********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_computeOffsets_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/computeOffsets.js */ "./node_modules/@popperjs/core/lib/utils/computeOffsets.js"); + + +function popperOffsets(_ref) { + var state = _ref.state, + name = _ref.name; + // Offsets are the actual position the popper needs to have to be + // properly positioned near its reference element + // This is the most basic placement, and will be adjusted by + // the modifiers in the next step + state.modifiersData[name] = (0,_utils_computeOffsets_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ + reference: state.rects.reference, + element: state.rects.popper, + strategy: 'absolute', + placement: state.placement + }); +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + name: 'popperOffsets', + enabled: true, + phase: 'read', + fn: popperOffsets, + data: {} +}); + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js"); +/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js"); +/* harmony import */ var _utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/getMainAxisFromPlacement.js */ "./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js"); +/* harmony import */ var _utils_getAltAxis_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/getAltAxis.js */ "./node_modules/@popperjs/core/lib/utils/getAltAxis.js"); +/* harmony import */ var _utils_within_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/within.js */ "./node_modules/@popperjs/core/lib/utils/within.js"); +/* harmony import */ var _dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dom-utils/getLayoutRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js"); +/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../dom-utils/getOffsetParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js"); +/* harmony import */ var _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/detectOverflow.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js"); +/* harmony import */ var _utils_getVariation_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/getVariation.js */ "./node_modules/@popperjs/core/lib/utils/getVariation.js"); +/* harmony import */ var _utils_getFreshSideObject_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/getFreshSideObject.js */ "./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js"); +/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/@popperjs/core/lib/utils/math.js"); + + + + + + + + + + + + +function preventOverflow(_ref) { + var state = _ref.state, + options = _ref.options, + name = _ref.name; + var _options$mainAxis = options.mainAxis, + checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, + _options$altAxis = options.altAxis, + checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, + boundary = options.boundary, + rootBoundary = options.rootBoundary, + altBoundary = options.altBoundary, + padding = options.padding, + _options$tether = options.tether, + tether = _options$tether === void 0 ? true : _options$tether, + _options$tetherOffset = options.tetherOffset, + tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; + var overflow = (0,_utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(state, { + boundary: boundary, + rootBoundary: rootBoundary, + padding: padding, + altBoundary: altBoundary + }); + var basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_1__["default"])(state.placement); + var variation = (0,_utils_getVariation_js__WEBPACK_IMPORTED_MODULE_2__["default"])(state.placement); + var isBasePlacement = !variation; + var mainAxis = (0,_utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_3__["default"])(basePlacement); + var altAxis = (0,_utils_getAltAxis_js__WEBPACK_IMPORTED_MODULE_4__["default"])(mainAxis); + var popperOffsets = state.modifiersData.popperOffsets; + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, { + placement: state.placement + })) : tetherOffset; + var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? { + mainAxis: tetherOffsetValue, + altAxis: tetherOffsetValue + } : Object.assign({ + mainAxis: 0, + altAxis: 0 + }, tetherOffsetValue); + var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; + var data = { + x: 0, + y: 0 + }; + + if (!popperOffsets) { + return; + } + + if (checkMainAxis) { + var _offsetModifierState$; + + var mainSide = mainAxis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_5__.top : _enums_js__WEBPACK_IMPORTED_MODULE_5__.left; + var altSide = mainAxis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_5__.bottom : _enums_js__WEBPACK_IMPORTED_MODULE_5__.right; + var len = mainAxis === 'y' ? 'height' : 'width'; + var offset = popperOffsets[mainAxis]; + var min = offset + overflow[mainSide]; + var max = offset - overflow[altSide]; + var additive = tether ? -popperRect[len] / 2 : 0; + var minLen = variation === _enums_js__WEBPACK_IMPORTED_MODULE_5__.start ? referenceRect[len] : popperRect[len]; + var maxLen = variation === _enums_js__WEBPACK_IMPORTED_MODULE_5__.start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go + // outside the reference bounds + + var arrowElement = state.elements.arrow; + var arrowRect = tether && arrowElement ? (0,_dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_6__["default"])(arrowElement) : { + width: 0, + height: 0 + }; + var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : (0,_utils_getFreshSideObject_js__WEBPACK_IMPORTED_MODULE_7__["default"])(); + var arrowPaddingMin = arrowPaddingObject[mainSide]; + var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want + // to include its full size in the calculation. If the reference is small + // and near the edge of a boundary, the popper can overflow even if the + // reference is not overflowing as well (e.g. virtual elements with no + // width or height) + + var arrowLen = (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_8__.within)(0, referenceRect[len], arrowRect[len]); + var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; + var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; + var arrowOffsetParent = state.elements.arrow && (0,_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_9__["default"])(state.elements.arrow); + var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; + var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; + var tetherMin = offset + minOffset - offsetModifierValue - clientOffset; + var tetherMax = offset + maxOffset - offsetModifierValue; + var preventedOffset = (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_8__.within)(tether ? (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_10__.min)(min, tetherMin) : min, offset, tether ? (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_10__.max)(max, tetherMax) : max); + popperOffsets[mainAxis] = preventedOffset; + data[mainAxis] = preventedOffset - offset; + } + + if (checkAltAxis) { + var _offsetModifierState$2; + + var _mainSide = mainAxis === 'x' ? _enums_js__WEBPACK_IMPORTED_MODULE_5__.top : _enums_js__WEBPACK_IMPORTED_MODULE_5__.left; + + var _altSide = mainAxis === 'x' ? _enums_js__WEBPACK_IMPORTED_MODULE_5__.bottom : _enums_js__WEBPACK_IMPORTED_MODULE_5__.right; + + var _offset = popperOffsets[altAxis]; + + var _len = altAxis === 'y' ? 'height' : 'width'; + + var _min = _offset + overflow[_mainSide]; + + var _max = _offset - overflow[_altSide]; + + var isOriginSide = [_enums_js__WEBPACK_IMPORTED_MODULE_5__.top, _enums_js__WEBPACK_IMPORTED_MODULE_5__.left].indexOf(basePlacement) !== -1; + + var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; + + var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; + + var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; + + var _preventedOffset = tether && isOriginSide ? (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_8__.withinMaxClamp)(_tetherMin, _offset, _tetherMax) : (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_8__.within)(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); + + popperOffsets[altAxis] = _preventedOffset; + data[altAxis] = _preventedOffset - _offset; + } + + state.modifiersData[name] = data; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + name: 'preventOverflow', + enabled: true, + phase: 'main', + fn: preventOverflow, + requiresIfExists: ['offset'] +}); + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/popper-lite.js": +/*!********************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/popper-lite.js ***! + \********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ createPopper: () => (/* binding */ createPopper), +/* harmony export */ defaultModifiers: () => (/* binding */ defaultModifiers), +/* harmony export */ detectOverflow: () => (/* reexport safe */ _createPopper_js__WEBPACK_IMPORTED_MODULE_5__["default"]), +/* harmony export */ popperGenerator: () => (/* reexport safe */ _createPopper_js__WEBPACK_IMPORTED_MODULE_4__.popperGenerator) +/* harmony export */ }); +/* harmony import */ var _createPopper_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./createPopper.js */ "./node_modules/@popperjs/core/lib/createPopper.js"); +/* harmony import */ var _createPopper_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./createPopper.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js"); +/* harmony import */ var _modifiers_eventListeners_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modifiers/eventListeners.js */ "./node_modules/@popperjs/core/lib/modifiers/eventListeners.js"); +/* harmony import */ var _modifiers_popperOffsets_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modifiers/popperOffsets.js */ "./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js"); +/* harmony import */ var _modifiers_computeStyles_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modifiers/computeStyles.js */ "./node_modules/@popperjs/core/lib/modifiers/computeStyles.js"); +/* harmony import */ var _modifiers_applyStyles_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modifiers/applyStyles.js */ "./node_modules/@popperjs/core/lib/modifiers/applyStyles.js"); + + + + + +var defaultModifiers = [_modifiers_eventListeners_js__WEBPACK_IMPORTED_MODULE_0__["default"], _modifiers_popperOffsets_js__WEBPACK_IMPORTED_MODULE_1__["default"], _modifiers_computeStyles_js__WEBPACK_IMPORTED_MODULE_2__["default"], _modifiers_applyStyles_js__WEBPACK_IMPORTED_MODULE_3__["default"]]; +var createPopper = /*#__PURE__*/(0,_createPopper_js__WEBPACK_IMPORTED_MODULE_4__.popperGenerator)({ + defaultModifiers: defaultModifiers +}); // eslint-disable-next-line import/no-unused-modules + + + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/popper.js": +/*!***************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/popper.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ applyStyles: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.applyStyles), +/* harmony export */ arrow: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.arrow), +/* harmony export */ computeStyles: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.computeStyles), +/* harmony export */ createPopper: () => (/* binding */ createPopper), +/* harmony export */ createPopperLite: () => (/* reexport safe */ _popper_lite_js__WEBPACK_IMPORTED_MODULE_11__.createPopper), +/* harmony export */ defaultModifiers: () => (/* binding */ defaultModifiers), +/* harmony export */ detectOverflow: () => (/* reexport safe */ _createPopper_js__WEBPACK_IMPORTED_MODULE_10__["default"]), +/* harmony export */ eventListeners: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.eventListeners), +/* harmony export */ flip: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.flip), +/* harmony export */ hide: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.hide), +/* harmony export */ offset: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.offset), +/* harmony export */ popperGenerator: () => (/* reexport safe */ _createPopper_js__WEBPACK_IMPORTED_MODULE_9__.popperGenerator), +/* harmony export */ popperOffsets: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.popperOffsets), +/* harmony export */ preventOverflow: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.preventOverflow) +/* harmony export */ }); +/* harmony import */ var _createPopper_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./createPopper.js */ "./node_modules/@popperjs/core/lib/createPopper.js"); +/* harmony import */ var _createPopper_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./createPopper.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js"); +/* harmony import */ var _modifiers_eventListeners_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modifiers/eventListeners.js */ "./node_modules/@popperjs/core/lib/modifiers/eventListeners.js"); +/* harmony import */ var _modifiers_popperOffsets_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modifiers/popperOffsets.js */ "./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js"); +/* harmony import */ var _modifiers_computeStyles_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modifiers/computeStyles.js */ "./node_modules/@popperjs/core/lib/modifiers/computeStyles.js"); +/* harmony import */ var _modifiers_applyStyles_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modifiers/applyStyles.js */ "./node_modules/@popperjs/core/lib/modifiers/applyStyles.js"); +/* harmony import */ var _modifiers_offset_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modifiers/offset.js */ "./node_modules/@popperjs/core/lib/modifiers/offset.js"); +/* harmony import */ var _modifiers_flip_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modifiers/flip.js */ "./node_modules/@popperjs/core/lib/modifiers/flip.js"); +/* harmony import */ var _modifiers_preventOverflow_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modifiers/preventOverflow.js */ "./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js"); +/* harmony import */ var _modifiers_arrow_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modifiers/arrow.js */ "./node_modules/@popperjs/core/lib/modifiers/arrow.js"); +/* harmony import */ var _modifiers_hide_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./modifiers/hide.js */ "./node_modules/@popperjs/core/lib/modifiers/hide.js"); +/* harmony import */ var _popper_lite_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./popper-lite.js */ "./node_modules/@popperjs/core/lib/popper-lite.js"); +/* harmony import */ var _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./modifiers/index.js */ "./node_modules/@popperjs/core/lib/modifiers/index.js"); + + + + + + + + + + +var defaultModifiers = [_modifiers_eventListeners_js__WEBPACK_IMPORTED_MODULE_0__["default"], _modifiers_popperOffsets_js__WEBPACK_IMPORTED_MODULE_1__["default"], _modifiers_computeStyles_js__WEBPACK_IMPORTED_MODULE_2__["default"], _modifiers_applyStyles_js__WEBPACK_IMPORTED_MODULE_3__["default"], _modifiers_offset_js__WEBPACK_IMPORTED_MODULE_4__["default"], _modifiers_flip_js__WEBPACK_IMPORTED_MODULE_5__["default"], _modifiers_preventOverflow_js__WEBPACK_IMPORTED_MODULE_6__["default"], _modifiers_arrow_js__WEBPACK_IMPORTED_MODULE_7__["default"], _modifiers_hide_js__WEBPACK_IMPORTED_MODULE_8__["default"]]; +var createPopper = /*#__PURE__*/(0,_createPopper_js__WEBPACK_IMPORTED_MODULE_9__.popperGenerator)({ + defaultModifiers: defaultModifiers +}); // eslint-disable-next-line import/no-unused-modules + + // eslint-disable-next-line import/no-unused-modules + + // eslint-disable-next-line import/no-unused-modules + + + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ computeAutoPlacement) +/* harmony export */ }); +/* harmony import */ var _getVariation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getVariation.js */ "./node_modules/@popperjs/core/lib/utils/getVariation.js"); +/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js"); +/* harmony import */ var _detectOverflow_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./detectOverflow.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js"); +/* harmony import */ var _getBasePlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js"); + + + + +function computeAutoPlacement(state, options) { + if (options === void 0) { + options = {}; + } + + var _options = options, + placement = _options.placement, + boundary = _options.boundary, + rootBoundary = _options.rootBoundary, + padding = _options.padding, + flipVariations = _options.flipVariations, + _options$allowedAutoP = _options.allowedAutoPlacements, + allowedAutoPlacements = _options$allowedAutoP === void 0 ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.placements : _options$allowedAutoP; + var variation = (0,_getVariation_js__WEBPACK_IMPORTED_MODULE_1__["default"])(placement); + var placements = variation ? flipVariations ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.variationPlacements : _enums_js__WEBPACK_IMPORTED_MODULE_0__.variationPlacements.filter(function (placement) { + return (0,_getVariation_js__WEBPACK_IMPORTED_MODULE_1__["default"])(placement) === variation; + }) : _enums_js__WEBPACK_IMPORTED_MODULE_0__.basePlacements; + var allowedPlacements = placements.filter(function (placement) { + return allowedAutoPlacements.indexOf(placement) >= 0; + }); + + if (allowedPlacements.length === 0) { + allowedPlacements = placements; + } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... + + + var overflows = allowedPlacements.reduce(function (acc, placement) { + acc[placement] = (0,_detectOverflow_js__WEBPACK_IMPORTED_MODULE_2__["default"])(state, { + placement: placement, + boundary: boundary, + rootBoundary: rootBoundary, + padding: padding + })[(0,_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_3__["default"])(placement)]; + return acc; + }, {}); + return Object.keys(overflows).sort(function (a, b) { + return overflows[a] - overflows[b]; + }); +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/utils/computeOffsets.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/utils/computeOffsets.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ computeOffsets) +/* harmony export */ }); +/* harmony import */ var _getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js"); +/* harmony import */ var _getVariation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getVariation.js */ "./node_modules/@popperjs/core/lib/utils/getVariation.js"); +/* harmony import */ var _getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getMainAxisFromPlacement.js */ "./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js"); +/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js"); + + + + +function computeOffsets(_ref) { + var reference = _ref.reference, + element = _ref.element, + placement = _ref.placement; + var basePlacement = placement ? (0,_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(placement) : null; + var variation = placement ? (0,_getVariation_js__WEBPACK_IMPORTED_MODULE_1__["default"])(placement) : null; + var commonX = reference.x + reference.width / 2 - element.width / 2; + var commonY = reference.y + reference.height / 2 - element.height / 2; + var offsets; + + switch (basePlacement) { + case _enums_js__WEBPACK_IMPORTED_MODULE_2__.top: + offsets = { + x: commonX, + y: reference.y - element.height + }; + break; + + case _enums_js__WEBPACK_IMPORTED_MODULE_2__.bottom: + offsets = { + x: commonX, + y: reference.y + reference.height + }; + break; + + case _enums_js__WEBPACK_IMPORTED_MODULE_2__.right: + offsets = { + x: reference.x + reference.width, + y: commonY + }; + break; + + case _enums_js__WEBPACK_IMPORTED_MODULE_2__.left: + offsets = { + x: reference.x - element.width, + y: commonY + }; + break; + + default: + offsets = { + x: reference.x, + y: reference.y + }; + } + + var mainAxis = basePlacement ? (0,_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_3__["default"])(basePlacement) : null; + + if (mainAxis != null) { + var len = mainAxis === 'y' ? 'height' : 'width'; + + switch (variation) { + case _enums_js__WEBPACK_IMPORTED_MODULE_2__.start: + offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); + break; + + case _enums_js__WEBPACK_IMPORTED_MODULE_2__.end: + offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); + break; + + default: + } + } + + return offsets; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/utils/debounce.js": +/*!***********************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/utils/debounce.js ***! + \***********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ debounce) +/* harmony export */ }); +function debounce(fn) { + var pending; + return function () { + if (!pending) { + pending = new Promise(function (resolve) { + Promise.resolve().then(function () { + pending = undefined; + resolve(fn()); + }); + }); + } + + return pending; + }; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/utils/detectOverflow.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ detectOverflow) +/* harmony export */ }); +/* harmony import */ var _dom_utils_getClippingRect_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../dom-utils/getClippingRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js"); +/* harmony import */ var _dom_utils_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dom-utils/getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js"); +/* harmony import */ var _dom_utils_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dom-utils/getBoundingClientRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js"); +/* harmony import */ var _computeOffsets_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./computeOffsets.js */ "./node_modules/@popperjs/core/lib/utils/computeOffsets.js"); +/* harmony import */ var _rectToClientRect_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./rectToClientRect.js */ "./node_modules/@popperjs/core/lib/utils/rectToClientRect.js"); +/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js"); +/* harmony import */ var _dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../dom-utils/instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js"); +/* harmony import */ var _mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mergePaddingObject.js */ "./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js"); +/* harmony import */ var _expandToHashMap_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./expandToHashMap.js */ "./node_modules/@popperjs/core/lib/utils/expandToHashMap.js"); + + + + + + + + + // eslint-disable-next-line import/no-unused-modules + +function detectOverflow(state, options) { + if (options === void 0) { + options = {}; + } + + var _options = options, + _options$placement = _options.placement, + placement = _options$placement === void 0 ? state.placement : _options$placement, + _options$strategy = _options.strategy, + strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, + _options$boundary = _options.boundary, + boundary = _options$boundary === void 0 ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.clippingParents : _options$boundary, + _options$rootBoundary = _options.rootBoundary, + rootBoundary = _options$rootBoundary === void 0 ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.viewport : _options$rootBoundary, + _options$elementConte = _options.elementContext, + elementContext = _options$elementConte === void 0 ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper : _options$elementConte, + _options$altBoundary = _options.altBoundary, + altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, + _options$padding = _options.padding, + padding = _options$padding === void 0 ? 0 : _options$padding; + var paddingObject = (0,_mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(typeof padding !== 'number' ? padding : (0,_expandToHashMap_js__WEBPACK_IMPORTED_MODULE_2__["default"])(padding, _enums_js__WEBPACK_IMPORTED_MODULE_0__.basePlacements)); + var altContext = elementContext === _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.reference : _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper; + var popperRect = state.rects.popper; + var element = state.elements[altBoundary ? altContext : elementContext]; + var clippingClientRect = (0,_dom_utils_getClippingRect_js__WEBPACK_IMPORTED_MODULE_3__["default"])((0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isElement)(element) ? element : element.contextElement || (0,_dom_utils_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_5__["default"])(state.elements.popper), boundary, rootBoundary, strategy); + var referenceClientRect = (0,_dom_utils_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_6__["default"])(state.elements.reference); + var popperOffsets = (0,_computeOffsets_js__WEBPACK_IMPORTED_MODULE_7__["default"])({ + reference: referenceClientRect, + element: popperRect, + strategy: 'absolute', + placement: placement + }); + var popperClientRect = (0,_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_8__["default"])(Object.assign({}, popperRect, popperOffsets)); + var elementClientRect = elementContext === _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect + // 0 or negative = within the clipping rect + + var overflowOffsets = { + top: clippingClientRect.top - elementClientRect.top + paddingObject.top, + bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, + left: clippingClientRect.left - elementClientRect.left + paddingObject.left, + right: elementClientRect.right - clippingClientRect.right + paddingObject.right + }; + var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element + + if (elementContext === _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper && offsetData) { + var offset = offsetData[placement]; + Object.keys(overflowOffsets).forEach(function (key) { + var multiply = [_enums_js__WEBPACK_IMPORTED_MODULE_0__.right, _enums_js__WEBPACK_IMPORTED_MODULE_0__.bottom].indexOf(key) >= 0 ? 1 : -1; + var axis = [_enums_js__WEBPACK_IMPORTED_MODULE_0__.top, _enums_js__WEBPACK_IMPORTED_MODULE_0__.bottom].indexOf(key) >= 0 ? 'y' : 'x'; + overflowOffsets[key] += offset[axis] * multiply; + }); + } + + return overflowOffsets; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/utils/expandToHashMap.js": +/*!******************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/utils/expandToHashMap.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ expandToHashMap) +/* harmony export */ }); +function expandToHashMap(value, keys) { + return keys.reduce(function (hashMap, key) { + hashMap[key] = value; + return hashMap; + }, {}); +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/utils/getAltAxis.js": +/*!*************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/utils/getAltAxis.js ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getAltAxis) +/* harmony export */ }); +function getAltAxis(axis) { + return axis === 'x' ? 'y' : 'x'; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/utils/getBasePlacement.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getBasePlacement) +/* harmony export */ }); + +function getBasePlacement(placement) { + return placement.split('-')[0]; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getFreshSideObject) +/* harmony export */ }); +function getFreshSideObject() { + return { + top: 0, + right: 0, + bottom: 0, + left: 0 + }; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js ***! + \***************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getMainAxisFromPlacement) +/* harmony export */ }); +function getMainAxisFromPlacement(placement) { + return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getOppositePlacement) +/* harmony export */ }); +var hash = { + left: 'right', + right: 'left', + bottom: 'top', + top: 'bottom' +}; +function getOppositePlacement(placement) { + return placement.replace(/left|right|bottom|top/g, function (matched) { + return hash[matched]; + }); +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js ***! + \********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getOppositeVariationPlacement) +/* harmony export */ }); +var hash = { + start: 'end', + end: 'start' +}; +function getOppositeVariationPlacement(placement) { + return placement.replace(/start|end/g, function (matched) { + return hash[matched]; + }); +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/utils/getVariation.js": +/*!***************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/utils/getVariation.js ***! + \***************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getVariation) +/* harmony export */ }); +function getVariation(placement) { + return placement.split('-')[1]; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/utils/math.js": +/*!*******************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/utils/math.js ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ max: () => (/* binding */ max), +/* harmony export */ min: () => (/* binding */ min), +/* harmony export */ round: () => (/* binding */ round) +/* harmony export */ }); +var max = Math.max; +var min = Math.min; +var round = Math.round; + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/utils/mergeByName.js": +/*!**************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/utils/mergeByName.js ***! + \**************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ mergeByName) +/* harmony export */ }); +function mergeByName(modifiers) { + var merged = modifiers.reduce(function (merged, current) { + var existing = merged[current.name]; + merged[current.name] = existing ? Object.assign({}, existing, current, { + options: Object.assign({}, existing.options, current.options), + data: Object.assign({}, existing.data, current.data) + }) : current; + return merged; + }, {}); // IE11 does not support Object.values + + return Object.keys(merged).map(function (key) { + return merged[key]; + }); +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ mergePaddingObject) +/* harmony export */ }); +/* harmony import */ var _getFreshSideObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getFreshSideObject.js */ "./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js"); + +function mergePaddingObject(paddingObject) { + return Object.assign({}, (0,_getFreshSideObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(), paddingObject); +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/utils/orderModifiers.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/utils/orderModifiers.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ orderModifiers) +/* harmony export */ }); +/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js"); + // source: https://stackoverflow.com/questions/49875255 + +function order(modifiers) { + var map = new Map(); + var visited = new Set(); + var result = []; + modifiers.forEach(function (modifier) { + map.set(modifier.name, modifier); + }); // On visiting object, check for its dependencies and visit them recursively + + function sort(modifier) { + visited.add(modifier.name); + var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); + requires.forEach(function (dep) { + if (!visited.has(dep)) { + var depModifier = map.get(dep); + + if (depModifier) { + sort(depModifier); + } + } + }); + result.push(modifier); + } + + modifiers.forEach(function (modifier) { + if (!visited.has(modifier.name)) { + // check for visited object + sort(modifier); + } + }); + return result; +} + +function orderModifiers(modifiers) { + // order based on dependencies + var orderedModifiers = order(modifiers); // order based on phase + + return _enums_js__WEBPACK_IMPORTED_MODULE_0__.modifierPhases.reduce(function (acc, phase) { + return acc.concat(orderedModifiers.filter(function (modifier) { + return modifier.phase === phase; + })); + }, []); +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/utils/rectToClientRect.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/utils/rectToClientRect.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ rectToClientRect) +/* harmony export */ }); +function rectToClientRect(rect) { + return Object.assign({}, rect, { + left: rect.x, + top: rect.y, + right: rect.x + rect.width, + bottom: rect.y + rect.height + }); +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/utils/userAgent.js": +/*!************************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/utils/userAgent.js ***! + \************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getUAString) +/* harmony export */ }); +function getUAString() { + var uaData = navigator.userAgentData; + + if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) { + return uaData.brands.map(function (item) { + return item.brand + "/" + item.version; + }).join(' '); + } + + return navigator.userAgent; +} + +/***/ }), + +/***/ "./node_modules/@popperjs/core/lib/utils/within.js": +/*!*********************************************************!*\ + !*** ./node_modules/@popperjs/core/lib/utils/within.js ***! + \*********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ within: () => (/* binding */ within), +/* harmony export */ withinMaxClamp: () => (/* binding */ withinMaxClamp) +/* harmony export */ }); +/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ "./node_modules/@popperjs/core/lib/utils/math.js"); + +function within(min, value, max) { + return (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.max)(min, (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.min)(value, max)); +} +function withinMaxClamp(min, value, max) { + var v = within(min, value, max); + return v > max ? max : v; +} + +/***/ }), + +/***/ "./node_modules/linkifyjs/dist/linkify.es.js": +/*!***************************************************!*\ + !*** ./node_modules/linkifyjs/dist/linkify.es.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ MultiToken: () => (/* binding */ MultiToken), +/* harmony export */ Options: () => (/* binding */ Options), +/* harmony export */ State: () => (/* binding */ State), +/* harmony export */ createTokenClass: () => (/* binding */ createTokenClass), +/* harmony export */ find: () => (/* binding */ find), +/* harmony export */ init: () => (/* binding */ init), +/* harmony export */ multi: () => (/* binding */ multi), +/* harmony export */ options: () => (/* binding */ options), +/* harmony export */ regexp: () => (/* binding */ regexp), +/* harmony export */ registerCustomProtocol: () => (/* binding */ registerCustomProtocol), +/* harmony export */ registerPlugin: () => (/* binding */ registerPlugin), +/* harmony export */ registerTokenPlugin: () => (/* binding */ registerTokenPlugin), +/* harmony export */ reset: () => (/* binding */ reset), +/* harmony export */ stringToArray: () => (/* binding */ stringToArray), +/* harmony export */ test: () => (/* binding */ test), +/* harmony export */ tokenize: () => (/* binding */ tokenize) +/* harmony export */ }); +// THIS FILE IS AUTOMATICALLY GENERATED DO NOT EDIT DIRECTLY +// See update-tlds.js for encoding/decoding format +// https://data.iana.org/TLD/tlds-alpha-by-domain.txt +const encodedTlds = 'aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2'; +// Internationalized domain names containing non-ASCII +const encodedUtlds = 'ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2'; + +/** + * @template A + * @template B + * @param {A} target + * @param {B} properties + * @return {A & B} + */ +const assign = (target, properties) => { + for (const key in properties) { + target[key] = properties[key]; + } + return target; +}; + +/** + * Finite State Machine generation utilities + */ + +/** + * @template T + * @typedef {{ [group: string]: T[] }} Collections + */ + +/** + * @typedef {{ [group: string]: true }} Flags + */ + +// Keys in scanner Collections instances +const numeric = 'numeric'; +const ascii = 'ascii'; +const alpha = 'alpha'; +const asciinumeric = 'asciinumeric'; +const alphanumeric = 'alphanumeric'; +const domain = 'domain'; +const emoji = 'emoji'; +const scheme = 'scheme'; +const slashscheme = 'slashscheme'; +const whitespace = 'whitespace'; + +/** + * @template T + * @param {string} name + * @param {Collections} groups to register in + * @returns {T[]} Current list of tokens in the given collection + */ +function registerGroup(name, groups) { + if (!(name in groups)) { + groups[name] = []; + } + return groups[name]; +} + +/** + * @template T + * @param {T} t token to add + * @param {Collections} groups + * @param {Flags} flags + */ +function addToGroups(t, flags, groups) { + if (flags[numeric]) { + flags[asciinumeric] = true; + flags[alphanumeric] = true; + } + if (flags[ascii]) { + flags[asciinumeric] = true; + flags[alpha] = true; + } + if (flags[asciinumeric]) { + flags[alphanumeric] = true; + } + if (flags[alpha]) { + flags[alphanumeric] = true; + } + if (flags[alphanumeric]) { + flags[domain] = true; + } + if (flags[emoji]) { + flags[domain] = true; + } + for (const k in flags) { + const group = registerGroup(k, groups); + if (group.indexOf(t) < 0) { + group.push(t); + } + } +} + +/** + * @template T + * @param {T} t token to check + * @param {Collections} groups + * @returns {Flags} group flags that contain this token + */ +function flagsForToken(t, groups) { + const result = {}; + for (const c in groups) { + if (groups[c].indexOf(t) >= 0) { + result[c] = true; + } + } + return result; +} + +/** + * @template T + * @typedef {null | T } Transition + */ + +/** + * Define a basic state machine state. j is the list of character transitions, + * jr is the list of regex-match transitions, jd is the default state to + * transition to t is the accepting token type, if any. If this is the terminal + * state, then it does not emit a token. + * + * The template type T represents the type of the token this state accepts. This + * should be a string (such as of the token exports in `text.js`) or a + * MultiToken subclass (from `multi.js`) + * + * @template T + * @param {T} [token] Token that this state emits + */ +function State(token) { + if (token === void 0) { + token = null; + } + // this.n = null; // DEBUG: State name + /** @type {{ [input: string]: State }} j */ + this.j = {}; // IMPLEMENTATION 1 + // this.j = []; // IMPLEMENTATION 2 + /** @type {[RegExp, State][]} jr */ + this.jr = []; + /** @type {?State} jd */ + this.jd = null; + /** @type {?T} t */ + this.t = token; +} + +/** + * Scanner token groups + * @type Collections + */ +State.groups = {}; +State.prototype = { + accepts() { + return !!this.t; + }, + /** + * Follow an existing transition from the given input to the next state. + * Does not mutate. + * @param {string} input character or token type to transition on + * @returns {?State} the next state, if any + */ + go(input) { + const state = this; + const nextState = state.j[input]; + if (nextState) { + return nextState; + } + for (let i = 0; i < state.jr.length; i++) { + const regex = state.jr[i][0]; + const nextState = state.jr[i][1]; // note: might be empty to prevent default jump + if (nextState && regex.test(input)) { + return nextState; + } + } + // Nowhere left to jump! Return default, if any + return state.jd; + }, + /** + * Whether the state has a transition for the given input. Set the second + * argument to true to only look for an exact match (and not a default or + * regular-expression-based transition) + * @param {string} input + * @param {boolean} exactOnly + */ + has(input, exactOnly) { + if (exactOnly === void 0) { + exactOnly = false; + } + return exactOnly ? input in this.j : !!this.go(input); + }, + /** + * Short for "transition all"; create a transition from the array of items + * in the given list to the same final resulting state. + * @param {string | string[]} inputs Group of inputs to transition on + * @param {Transition | State} [next] Transition options + * @param {Flags} [flags] Collections flags to add token to + * @param {Collections} [groups] Master list of token groups + */ + ta(inputs, next, flags, groups) { + for (let i = 0; i < inputs.length; i++) { + this.tt(inputs[i], next, flags, groups); + } + }, + /** + * Short for "take regexp transition"; defines a transition for this state + * when it encounters a token which matches the given regular expression + * @param {RegExp} regexp Regular expression transition (populate first) + * @param {T | State} [next] Transition options + * @param {Flags} [flags] Collections flags to add token to + * @param {Collections} [groups] Master list of token groups + * @returns {State} taken after the given input + */ + tr(regexp, next, flags, groups) { + groups = groups || State.groups; + let nextState; + if (next && next.j) { + nextState = next; + } else { + // Token with maybe token groups + nextState = new State(next); + if (flags && groups) { + addToGroups(next, flags, groups); + } + } + this.jr.push([regexp, nextState]); + return nextState; + }, + /** + * Short for "take transitions", will take as many sequential transitions as + * the length of the given input and returns the + * resulting final state. + * @param {string | string[]} input + * @param {T | State} [next] Transition options + * @param {Flags} [flags] Collections flags to add token to + * @param {Collections} [groups] Master list of token groups + * @returns {State} taken after the given input + */ + ts(input, next, flags, groups) { + let state = this; + const len = input.length; + if (!len) { + return state; + } + for (let i = 0; i < len - 1; i++) { + state = state.tt(input[i]); + } + return state.tt(input[len - 1], next, flags, groups); + }, + /** + * Short for "take transition", this is a method for building/working with + * state machines. + * + * If a state already exists for the given input, returns it. + * + * If a token is specified, that state will emit that token when reached by + * the linkify engine. + * + * If no state exists, it will be initialized with some default transitions + * that resemble existing default transitions. + * + * If a state is given for the second argument, that state will be + * transitioned to on the given input regardless of what that input + * previously did. + * + * Specify a token group flags to define groups that this token belongs to. + * The token will be added to corresponding entires in the given groups + * object. + * + * @param {string} input character, token type to transition on + * @param {T | State} [next] Transition options + * @param {Flags} [flags] Collections flags to add token to + * @param {Collections} [groups] Master list of groups + * @returns {State} taken after the given input + */ + tt(input, next, flags, groups) { + groups = groups || State.groups; + const state = this; + + // Check if existing state given, just a basic transition + if (next && next.j) { + state.j[input] = next; + return next; + } + const t = next; + + // Take the transition with the usual default mechanisms and use that as + // a template for creating the next state + let nextState, + templateState = state.go(input); + if (templateState) { + nextState = new State(); + assign(nextState.j, templateState.j); + nextState.jr.push.apply(nextState.jr, templateState.jr); + nextState.jd = templateState.jd; + nextState.t = templateState.t; + } else { + nextState = new State(); + } + if (t) { + // Ensure newly token is in the same groups as the old token + if (groups) { + if (nextState.t && typeof nextState.t === 'string') { + const allFlags = assign(flagsForToken(nextState.t, groups), flags); + addToGroups(t, allFlags, groups); + } else if (flags) { + addToGroups(t, flags, groups); + } + } + nextState.t = t; // overwrite anything that was previously there + } + + state.j[input] = nextState; + return nextState; + } +}; + +// Helper functions to improve minification (not exported outside linkifyjs module) + +/** + * @template T + * @param {State} state + * @param {string | string[]} input + * @param {Flags} [flags] + * @param {Collections} [groups] + */ +const ta = (state, input, next, flags, groups) => state.ta(input, next, flags, groups); + +/** + * @template T + * @param {State} state + * @param {RegExp} regexp + * @param {T | State} [next] + * @param {Flags} [flags] + * @param {Collections} [groups] + */ +const tr = (state, regexp, next, flags, groups) => state.tr(regexp, next, flags, groups); + +/** + * @template T + * @param {State} state + * @param {string | string[]} input + * @param {T | State} [next] + * @param {Flags} [flags] + * @param {Collections} [groups] + */ +const ts = (state, input, next, flags, groups) => state.ts(input, next, flags, groups); + +/** + * @template T + * @param {State} state + * @param {string} input + * @param {T | State} [next] + * @param {Collections} [groups] + * @param {Flags} [flags] + */ +const tt = (state, input, next, flags, groups) => state.tt(input, next, flags, groups); + +/****************************************************************************** +Text Tokens +Identifiers for token outputs from the regexp scanner +******************************************************************************/ + +// A valid web domain token +const WORD = 'WORD'; // only contains a-z +const UWORD = 'UWORD'; // contains letters other than a-z, used for IDN + +// Special case of word +const LOCALHOST = 'LOCALHOST'; + +// Valid top-level domain, special case of WORD (see tlds.js) +const TLD = 'TLD'; + +// Valid IDN TLD, special case of UWORD (see tlds.js) +const UTLD = 'UTLD'; + +// The scheme portion of a web URI protocol. Supported types include: `mailto`, +// `file`, and user-defined custom protocols. Limited to schemes that contain +// only letters +const SCHEME = 'SCHEME'; + +// Similar to SCHEME, except makes distinction for schemes that must always be +// followed by `://`, not just `:`. Supported types include `http`, `https`, +// `ftp`, `ftps` +const SLASH_SCHEME = 'SLASH_SCHEME'; + +// Any sequence of digits 0-9 +const NUM = 'NUM'; + +// Any number of consecutive whitespace characters that are not newline +const WS = 'WS'; + +// New line (unix style) +const NL$1 = 'NL'; // \n + +// Opening/closing bracket classes +// TODO: Rename OPEN -> LEFT and CLOSE -> RIGHT in v5 to fit with Unicode names +// Also rename angle brackes to LESSTHAN and GREATER THAN +const OPENBRACE = 'OPENBRACE'; // { +const CLOSEBRACE = 'CLOSEBRACE'; // } +const OPENBRACKET = 'OPENBRACKET'; // [ +const CLOSEBRACKET = 'CLOSEBRACKET'; // ] +const OPENPAREN = 'OPENPAREN'; // ( +const CLOSEPAREN = 'CLOSEPAREN'; // ) +const OPENANGLEBRACKET = 'OPENANGLEBRACKET'; // < +const CLOSEANGLEBRACKET = 'CLOSEANGLEBRACKET'; // > +const FULLWIDTHLEFTPAREN = 'FULLWIDTHLEFTPAREN'; // ( +const FULLWIDTHRIGHTPAREN = 'FULLWIDTHRIGHTPAREN'; // ) +const LEFTCORNERBRACKET = 'LEFTCORNERBRACKET'; // 「 +const RIGHTCORNERBRACKET = 'RIGHTCORNERBRACKET'; // 」 +const LEFTWHITECORNERBRACKET = 'LEFTWHITECORNERBRACKET'; // 『 +const RIGHTWHITECORNERBRACKET = 'RIGHTWHITECORNERBRACKET'; // 』 +const FULLWIDTHLESSTHAN = 'FULLWIDTHLESSTHAN'; // < +const FULLWIDTHGREATERTHAN = 'FULLWIDTHGREATERTHAN'; // > + +// Various symbols +const AMPERSAND = 'AMPERSAND'; // & +const APOSTROPHE = 'APOSTROPHE'; // ' +const ASTERISK = 'ASTERISK'; // * +const AT = 'AT'; // @ +const BACKSLASH = 'BACKSLASH'; // \ +const BACKTICK = 'BACKTICK'; // ` +const CARET = 'CARET'; // ^ +const COLON = 'COLON'; // : +const COMMA = 'COMMA'; // , +const DOLLAR = 'DOLLAR'; // $ +const DOT = 'DOT'; // . +const EQUALS = 'EQUALS'; // = +const EXCLAMATION = 'EXCLAMATION'; // ! +const HYPHEN = 'HYPHEN'; // - +const PERCENT = 'PERCENT'; // % +const PIPE = 'PIPE'; // | +const PLUS = 'PLUS'; // + +const POUND = 'POUND'; // # +const QUERY = 'QUERY'; // ? +const QUOTE = 'QUOTE'; // " + +const SEMI = 'SEMI'; // ; +const SLASH = 'SLASH'; // / +const TILDE = 'TILDE'; // ~ +const UNDERSCORE = 'UNDERSCORE'; // _ + +// Emoji symbol +const EMOJI$1 = 'EMOJI'; + +// Default token - anything that is not one of the above +const SYM = 'SYM'; + +var tk = /*#__PURE__*/Object.freeze({ + __proto__: null, + WORD: WORD, + UWORD: UWORD, + LOCALHOST: LOCALHOST, + TLD: TLD, + UTLD: UTLD, + SCHEME: SCHEME, + SLASH_SCHEME: SLASH_SCHEME, + NUM: NUM, + WS: WS, + NL: NL$1, + OPENBRACE: OPENBRACE, + CLOSEBRACE: CLOSEBRACE, + OPENBRACKET: OPENBRACKET, + CLOSEBRACKET: CLOSEBRACKET, + OPENPAREN: OPENPAREN, + CLOSEPAREN: CLOSEPAREN, + OPENANGLEBRACKET: OPENANGLEBRACKET, + CLOSEANGLEBRACKET: CLOSEANGLEBRACKET, + FULLWIDTHLEFTPAREN: FULLWIDTHLEFTPAREN, + FULLWIDTHRIGHTPAREN: FULLWIDTHRIGHTPAREN, + LEFTCORNERBRACKET: LEFTCORNERBRACKET, + RIGHTCORNERBRACKET: RIGHTCORNERBRACKET, + LEFTWHITECORNERBRACKET: LEFTWHITECORNERBRACKET, + RIGHTWHITECORNERBRACKET: RIGHTWHITECORNERBRACKET, + FULLWIDTHLESSTHAN: FULLWIDTHLESSTHAN, + FULLWIDTHGREATERTHAN: FULLWIDTHGREATERTHAN, + AMPERSAND: AMPERSAND, + APOSTROPHE: APOSTROPHE, + ASTERISK: ASTERISK, + AT: AT, + BACKSLASH: BACKSLASH, + BACKTICK: BACKTICK, + CARET: CARET, + COLON: COLON, + COMMA: COMMA, + DOLLAR: DOLLAR, + DOT: DOT, + EQUALS: EQUALS, + EXCLAMATION: EXCLAMATION, + HYPHEN: HYPHEN, + PERCENT: PERCENT, + PIPE: PIPE, + PLUS: PLUS, + POUND: POUND, + QUERY: QUERY, + QUOTE: QUOTE, + SEMI: SEMI, + SLASH: SLASH, + TILDE: TILDE, + UNDERSCORE: UNDERSCORE, + EMOJI: EMOJI$1, + SYM: SYM +}); + +// Note that these two Unicode ones expand into a really big one with Babel +const ASCII_LETTER = /[a-z]/; +const LETTER = /\p{L}/u; // Any Unicode character with letter data type +const EMOJI = /\p{Emoji}/u; // Any Unicode emoji character +const EMOJI_VARIATION$1 = /\ufe0f/; +const DIGIT = /\d/; +const SPACE = /\s/; + +var regexp = /*#__PURE__*/Object.freeze({ + __proto__: null, + ASCII_LETTER: ASCII_LETTER, + LETTER: LETTER, + EMOJI: EMOJI, + EMOJI_VARIATION: EMOJI_VARIATION$1, + DIGIT: DIGIT, + SPACE: SPACE +}); + +/** + The scanner provides an interface that takes a string of text as input, and + outputs an array of tokens instances that can be used for easy URL parsing. +*/ +const NL = '\n'; // New line character +const EMOJI_VARIATION = '\ufe0f'; // Variation selector, follows heart and others +const EMOJI_JOINER = '\u200d'; // zero-width joiner + +let tlds = null, + utlds = null; // don't change so only have to be computed once + +/** + * Scanner output token: + * - `t` is the token name (e.g., 'NUM', 'EMOJI', 'TLD') + * - `v` is the value of the token (e.g., '123', '❤️', 'com') + * - `s` is the start index of the token in the original string + * - `e` is the end index of the token in the original string + * @typedef {{t: string, v: string, s: number, e: number}} Token + */ + +/** + * @template T + * @typedef {{ [collection: string]: T[] }} Collections + */ + +/** + * Initialize the scanner character-based state machine for the given start + * state + * @param {[string, boolean][]} customSchemes List of custom schemes, where each + * item is a length-2 tuple with the first element set to the string scheme, and + * the second element set to `true` if the `://` after the scheme is optional + */ +function init$2(customSchemes) { + if (customSchemes === void 0) { + customSchemes = []; + } + // Frequently used states (name argument removed during minification) + /** @type Collections */ + const groups = {}; // of tokens + State.groups = groups; + /** @type State */ + const Start = new State(); + if (tlds == null) { + tlds = decodeTlds(encodedTlds); + } + if (utlds == null) { + utlds = decodeTlds(encodedUtlds); + } + + // States for special URL symbols that accept immediately after start + tt(Start, "'", APOSTROPHE); + tt(Start, '{', OPENBRACE); + tt(Start, '}', CLOSEBRACE); + tt(Start, '[', OPENBRACKET); + tt(Start, ']', CLOSEBRACKET); + tt(Start, '(', OPENPAREN); + tt(Start, ')', CLOSEPAREN); + tt(Start, '<', OPENANGLEBRACKET); + tt(Start, '>', CLOSEANGLEBRACKET); + tt(Start, '(', FULLWIDTHLEFTPAREN); + tt(Start, ')', FULLWIDTHRIGHTPAREN); + tt(Start, '「', LEFTCORNERBRACKET); + tt(Start, '」', RIGHTCORNERBRACKET); + tt(Start, '『', LEFTWHITECORNERBRACKET); + tt(Start, '』', RIGHTWHITECORNERBRACKET); + tt(Start, '<', FULLWIDTHLESSTHAN); + tt(Start, '>', FULLWIDTHGREATERTHAN); + tt(Start, '&', AMPERSAND); + tt(Start, '*', ASTERISK); + tt(Start, '@', AT); + tt(Start, '`', BACKTICK); + tt(Start, '^', CARET); + tt(Start, ':', COLON); + tt(Start, ',', COMMA); + tt(Start, '$', DOLLAR); + tt(Start, '.', DOT); + tt(Start, '=', EQUALS); + tt(Start, '!', EXCLAMATION); + tt(Start, '-', HYPHEN); + tt(Start, '%', PERCENT); + tt(Start, '|', PIPE); + tt(Start, '+', PLUS); + tt(Start, '#', POUND); + tt(Start, '?', QUERY); + tt(Start, '"', QUOTE); + tt(Start, '/', SLASH); + tt(Start, ';', SEMI); + tt(Start, '~', TILDE); + tt(Start, '_', UNDERSCORE); + tt(Start, '\\', BACKSLASH); + const Num = tr(Start, DIGIT, NUM, { + [numeric]: true + }); + tr(Num, DIGIT, Num); + + // State which emits a word token + const Word = tr(Start, ASCII_LETTER, WORD, { + [ascii]: true + }); + tr(Word, ASCII_LETTER, Word); + + // Same as previous, but specific to non-fsm.ascii alphabet words + const UWord = tr(Start, LETTER, UWORD, { + [alpha]: true + }); + tr(UWord, ASCII_LETTER); // Non-accepting + tr(UWord, LETTER, UWord); + + // Whitespace jumps + // Tokens of only non-newline whitespace are arbitrarily long + // If any whitespace except newline, more whitespace! + const Ws = tr(Start, SPACE, WS, { + [whitespace]: true + }); + tt(Start, NL, NL$1, { + [whitespace]: true + }); + tt(Ws, NL); // non-accepting state to avoid mixing whitespaces + tr(Ws, SPACE, Ws); + + // Emoji tokens. They are not grouped by the scanner except in cases where a + // zero-width joiner is present + const Emoji = tr(Start, EMOJI, EMOJI$1, { + [emoji]: true + }); + tr(Emoji, EMOJI, Emoji); + tt(Emoji, EMOJI_VARIATION, Emoji); + // tt(Start, EMOJI_VARIATION, Emoji); // This one is sketchy + + const EmojiJoiner = tt(Emoji, EMOJI_JOINER); + tr(EmojiJoiner, EMOJI, Emoji); + // tt(EmojiJoiner, EMOJI_VARIATION, Emoji); // also sketchy + + // Generates states for top-level domains + // Note that this is most accurate when tlds are in alphabetical order + const wordjr = [[ASCII_LETTER, Word]]; + const uwordjr = [[ASCII_LETTER, null], [LETTER, UWord]]; + for (let i = 0; i < tlds.length; i++) { + fastts(Start, tlds[i], TLD, WORD, wordjr); + } + for (let i = 0; i < utlds.length; i++) { + fastts(Start, utlds[i], UTLD, UWORD, uwordjr); + } + addToGroups(TLD, { + tld: true, + ascii: true + }, groups); + addToGroups(UTLD, { + utld: true, + alpha: true + }, groups); + + // Collect the states generated by different protocols. NOTE: If any new TLDs + // get added that are also protocols, set the token to be the same as the + // protocol to ensure parsing works as expected. + fastts(Start, 'file', SCHEME, WORD, wordjr); + fastts(Start, 'mailto', SCHEME, WORD, wordjr); + fastts(Start, 'http', SLASH_SCHEME, WORD, wordjr); + fastts(Start, 'https', SLASH_SCHEME, WORD, wordjr); + fastts(Start, 'ftp', SLASH_SCHEME, WORD, wordjr); + fastts(Start, 'ftps', SLASH_SCHEME, WORD, wordjr); + addToGroups(SCHEME, { + scheme: true, + ascii: true + }, groups); + addToGroups(SLASH_SCHEME, { + slashscheme: true, + ascii: true + }, groups); + + // Register custom schemes. Assumes each scheme is asciinumeric with hyphens + customSchemes = customSchemes.sort((a, b) => a[0] > b[0] ? 1 : -1); + for (let i = 0; i < customSchemes.length; i++) { + const sch = customSchemes[i][0]; + const optionalSlashSlash = customSchemes[i][1]; + const flags = optionalSlashSlash ? { + [scheme]: true + } : { + [slashscheme]: true + }; + if (sch.indexOf('-') >= 0) { + flags[domain] = true; + } else if (!ASCII_LETTER.test(sch)) { + flags[numeric] = true; // numbers only + } else if (DIGIT.test(sch)) { + flags[asciinumeric] = true; + } else { + flags[ascii] = true; + } + ts(Start, sch, sch, flags); + } + + // Localhost token + ts(Start, 'localhost', LOCALHOST, { + ascii: true + }); + + // Set default transition for start state (some symbol) + Start.jd = new State(SYM); + return { + start: Start, + tokens: assign({ + groups + }, tk) + }; +} + +/** + Given a string, returns an array of TOKEN instances representing the + composition of that string. + + @method run + @param {State} start scanner starting state + @param {string} str input string to scan + @return {Token[]} list of tokens, each with a type and value +*/ +function run$1(start, str) { + // State machine is not case sensitive, so input is tokenized in lowercased + // form (still returns regular case). Uses selective `toLowerCase` because + // lowercasing the entire string causes the length and character position to + // vary in some non-English strings with V8-based runtimes. + const iterable = stringToArray(str.replace(/[A-Z]/g, c => c.toLowerCase())); + const charCount = iterable.length; // <= len if there are emojis, etc + const tokens = []; // return value + + // cursor through the string itself, accounting for characters that have + // width with length 2 such as emojis + let cursor = 0; + + // Cursor through the array-representation of the string + let charCursor = 0; + + // Tokenize the string + while (charCursor < charCount) { + let state = start; + let nextState = null; + let tokenLength = 0; + let latestAccepting = null; + let sinceAccepts = -1; + let charsSinceAccepts = -1; + while (charCursor < charCount && (nextState = state.go(iterable[charCursor]))) { + state = nextState; + + // Keep track of the latest accepting state + if (state.accepts()) { + sinceAccepts = 0; + charsSinceAccepts = 0; + latestAccepting = state; + } else if (sinceAccepts >= 0) { + sinceAccepts += iterable[charCursor].length; + charsSinceAccepts++; + } + tokenLength += iterable[charCursor].length; + cursor += iterable[charCursor].length; + charCursor++; + } + + // Roll back to the latest accepting state + cursor -= sinceAccepts; + charCursor -= charsSinceAccepts; + tokenLength -= sinceAccepts; + + // No more jumps, just make a new token from the last accepting one + tokens.push({ + t: latestAccepting.t, + // token type/name + v: str.slice(cursor - tokenLength, cursor), + // string value + s: cursor - tokenLength, + // start index + e: cursor // end index (excluding) + }); + } + + return tokens; +} + +/** + * Convert a String to an Array of characters, taking into account that some + * characters like emojis take up two string indexes. + * + * Adapted from core-js (MIT license) + * https://github.com/zloirock/core-js/blob/2d69cf5f99ab3ea3463c395df81e5a15b68f49d9/packages/core-js/internals/string-multibyte.js + * + * @function stringToArray + * @param {string} str + * @returns {string[]} + */ +function stringToArray(str) { + const result = []; + const len = str.length; + let index = 0; + while (index < len) { + let first = str.charCodeAt(index); + let second; + let char = first < 0xd800 || first > 0xdbff || index + 1 === len || (second = str.charCodeAt(index + 1)) < 0xdc00 || second > 0xdfff ? str[index] // single character + : str.slice(index, index + 2); // two-index characters + result.push(char); + index += char.length; + } + return result; +} + +/** + * Fast version of ts function for when transition defaults are well known + * @param {State} state + * @param {string} input + * @param {string} t + * @param {string} defaultt + * @param {[RegExp, State][]} jr + * @returns {State} + */ +function fastts(state, input, t, defaultt, jr) { + let next; + const len = input.length; + for (let i = 0; i < len - 1; i++) { + const char = input[i]; + if (state.j[char]) { + next = state.j[char]; + } else { + next = new State(defaultt); + next.jr = jr.slice(); + state.j[char] = next; + } + state = next; + } + next = new State(t); + next.jr = jr.slice(); + state.j[input[len - 1]] = next; + return next; +} + +/** + * Converts a string of Top-Level Domain names encoded in update-tlds.js back + * into a list of strings. + * @param {str} encoded encoded TLDs string + * @returns {str[]} original TLDs list + */ +function decodeTlds(encoded) { + const words = []; + const stack = []; + let i = 0; + let digits = '0123456789'; + while (i < encoded.length) { + let popDigitCount = 0; + while (digits.indexOf(encoded[i + popDigitCount]) >= 0) { + popDigitCount++; // encountered some digits, have to pop to go one level up trie + } + + if (popDigitCount > 0) { + words.push(stack.join('')); // whatever preceded the pop digits must be a word + for (let popCount = parseInt(encoded.substring(i, i + popDigitCount), 10); popCount > 0; popCount--) { + stack.pop(); + } + i += popDigitCount; + } else { + stack.push(encoded[i]); // drop down a level into the trie + i++; + } + } + return words; +} + +/** + * An object where each key is a valid DOM Event Name such as `click` or `focus` + * and each value is an event handler function. + * + * https://developer.mozilla.org/en-US/docs/Web/API/Element#events + * @typedef {?{ [event: string]: Function }} EventListeners + */ + +/** + * All formatted properties required to render a link, including `tagName`, + * `attributes`, `content` and `eventListeners`. + * @typedef {{ tagName: any, attributes: {[attr: string]: any}, content: string, + * eventListeners: EventListeners }} IntermediateRepresentation + */ + +/** + * Specify either an object described by the template type `O` or a function. + * + * The function takes a string value (usually the link's href attribute), the + * link type (`'url'`, `'hashtag`', etc.) and an internal token representation + * of the link. It should return an object of the template type `O` + * @template O + * @typedef {O | ((value: string, type: string, token: MultiToken) => O)} OptObj + */ + +/** + * Specify either a function described by template type `F` or an object. + * + * Each key in the object should be a link type (`'url'`, `'hashtag`', etc.). Each + * value should be a function with template type `F` that is called when the + * corresponding link type is encountered. + * @template F + * @typedef {F | { [type: string]: F}} OptFn + */ + +/** + * Specify either a value with template type `V`, a function that returns `V` or + * an object where each value resolves to `V`. + * + * The function takes a string value (usually the link's href attribute), the + * link type (`'url'`, `'hashtag`', etc.) and an internal token representation + * of the link. It should return an object of the template type `V` + * + * For the object, each key should be a link type (`'url'`, `'hashtag`', etc.). + * Each value should either have type `V` or a function that returns V. This + * function similarly takes a string value and a token. + * + * Example valid types for `Opt`: + * + * ```js + * 'hello' + * (value, type, token) => 'world' + * { url: 'hello', email: (value, token) => 'world'} + * ``` + * @template V + * @typedef {V | ((value: string, type: string, token: MultiToken) => V) | { [type: string]: V | ((value: string, token: MultiToken) => V) }} Opt + */ + +/** + * See available options: https://linkify.js.org/docs/options.html + * @typedef {{ + * defaultProtocol?: string, + * events?: OptObj, + * format?: Opt, + * formatHref?: Opt, + * nl2br?: boolean, + * tagName?: Opt, + * target?: Opt, + * rel?: Opt, + * validate?: Opt, + * truncate?: Opt, + * className?: Opt, + * attributes?: OptObj<({ [attr: string]: any })>, + * ignoreTags?: string[], + * render?: OptFn<((ir: IntermediateRepresentation) => any)> + * }} Opts + */ + +/** + * @type Required + */ +const defaults = { + defaultProtocol: 'http', + events: null, + format: noop, + formatHref: noop, + nl2br: false, + tagName: 'a', + target: null, + rel: null, + validate: true, + truncate: Infinity, + className: null, + attributes: null, + ignoreTags: [], + render: null +}; + +/** + * Utility class for linkify interfaces to apply specified + * {@link Opts formatting and rendering options}. + * + * @param {Opts | Options} [opts] Option value overrides. + * @param {(ir: IntermediateRepresentation) => any} [defaultRender] (For + * internal use) default render function that determines how to generate an + * HTML element based on a link token's derived tagName, attributes and HTML. + * Similar to render option + */ +function Options(opts, defaultRender) { + if (defaultRender === void 0) { + defaultRender = null; + } + let o = assign({}, defaults); + if (opts) { + o = assign(o, opts instanceof Options ? opts.o : opts); + } + + // Ensure all ignored tags are uppercase + const ignoredTags = o.ignoreTags; + const uppercaseIgnoredTags = []; + for (let i = 0; i < ignoredTags.length; i++) { + uppercaseIgnoredTags.push(ignoredTags[i].toUpperCase()); + } + /** @protected */ + this.o = o; + if (defaultRender) { + this.defaultRender = defaultRender; + } + this.ignoreTags = uppercaseIgnoredTags; +} +Options.prototype = { + o: defaults, + /** + * @type string[] + */ + ignoreTags: [], + /** + * @param {IntermediateRepresentation} ir + * @returns {any} + */ + defaultRender(ir) { + return ir; + }, + /** + * Returns true or false based on whether a token should be displayed as a + * link based on the user options. + * @param {MultiToken} token + * @returns {boolean} + */ + check(token) { + return this.get('validate', token.toString(), token); + }, + // Private methods + + /** + * Resolve an option's value based on the value of the option and the given + * params. If operator and token are specified and the target option is + * callable, automatically calls the function with the given argument. + * @template {keyof Opts} K + * @param {K} key Name of option to use + * @param {string} [operator] will be passed to the target option if it's a + * function. If not specified, RAW function value gets returned + * @param {MultiToken} [token] The token from linkify.tokenize + * @returns {Opts[K] | any} + */ + get(key, operator, token) { + const isCallable = operator != null; + let option = this.o[key]; + if (!option) { + return option; + } + if (typeof option === 'object') { + option = token.t in option ? option[token.t] : defaults[key]; + if (typeof option === 'function' && isCallable) { + option = option(operator, token); + } + } else if (typeof option === 'function' && isCallable) { + option = option(operator, token.t, token); + } + return option; + }, + /** + * @template {keyof Opts} L + * @param {L} key Name of options object to use + * @param {string} [operator] + * @param {MultiToken} [token] + * @returns {Opts[L] | any} + */ + getObj(key, operator, token) { + let obj = this.o[key]; + if (typeof obj === 'function' && operator != null) { + obj = obj(operator, token.t, token); + } + return obj; + }, + /** + * Convert the given token to a rendered element that may be added to the + * calling-interface's DOM + * @param {MultiToken} token Token to render to an HTML element + * @returns {any} Render result; e.g., HTML string, DOM element, React + * Component, etc. + */ + render(token) { + const ir = token.render(this); // intermediate representation + const renderFn = this.get('render', null, token) || this.defaultRender; + return renderFn(ir, token.t, token); + } +}; +function noop(val) { + return val; +} + +var options = /*#__PURE__*/Object.freeze({ + __proto__: null, + defaults: defaults, + Options: Options, + assign: assign +}); + +/****************************************************************************** + Multi-Tokens + Tokens composed of arrays of TextTokens +******************************************************************************/ + +/** + * @param {string} value + * @param {Token[]} tokens + */ +function MultiToken(value, tokens) { + this.t = 'token'; + this.v = value; + this.tk = tokens; +} + +/** + * Abstract class used for manufacturing tokens of text tokens. That is rather + * than the value for a token being a small string of text, it's value an array + * of text tokens. + * + * Used for grouping together URLs, emails, hashtags, and other potential + * creations. + * @class MultiToken + * @property {string} t + * @property {string} v + * @property {Token[]} tk + * @abstract + */ +MultiToken.prototype = { + isLink: false, + /** + * Return the string this token represents. + * @return {string} + */ + toString() { + return this.v; + }, + /** + * What should the value for this token be in the `href` HTML attribute? + * Returns the `.toString` value by default. + * @param {string} [scheme] + * @return {string} + */ + toHref(scheme) { + return this.toString(); + }, + /** + * @param {Options} options Formatting options + * @returns {string} + */ + toFormattedString(options) { + const val = this.toString(); + const truncate = options.get('truncate', val, this); + const formatted = options.get('format', val, this); + return truncate && formatted.length > truncate ? formatted.substring(0, truncate) + '…' : formatted; + }, + /** + * + * @param {Options} options + * @returns {string} + */ + toFormattedHref(options) { + return options.get('formatHref', this.toHref(options.get('defaultProtocol')), this); + }, + /** + * The start index of this token in the original input string + * @returns {number} + */ + startIndex() { + return this.tk[0].s; + }, + /** + * The end index of this token in the original input string (up to this + * index but not including it) + * @returns {number} + */ + endIndex() { + return this.tk[this.tk.length - 1].e; + }, + /** + Returns an object of relevant values for this token, which includes keys + * type - Kind of token ('url', 'email', etc.) + * value - Original text + * href - The value that should be added to the anchor tag's href + attribute + @method toObject + @param {string} [protocol] `'http'` by default + */ + toObject(protocol) { + if (protocol === void 0) { + protocol = defaults.defaultProtocol; + } + return { + type: this.t, + value: this.toString(), + isLink: this.isLink, + href: this.toHref(protocol), + start: this.startIndex(), + end: this.endIndex() + }; + }, + /** + * + * @param {Options} options Formatting option + */ + toFormattedObject(options) { + return { + type: this.t, + value: this.toFormattedString(options), + isLink: this.isLink, + href: this.toFormattedHref(options), + start: this.startIndex(), + end: this.endIndex() + }; + }, + /** + * Whether this token should be rendered as a link according to the given options + * @param {Options} options + * @returns {boolean} + */ + validate(options) { + return options.get('validate', this.toString(), this); + }, + /** + * Return an object that represents how this link should be rendered. + * @param {Options} options Formattinng options + */ + render(options) { + const token = this; + const href = this.toHref(options.get('defaultProtocol')); + const formattedHref = options.get('formatHref', href, this); + const tagName = options.get('tagName', href, token); + const content = this.toFormattedString(options); + const attributes = {}; + const className = options.get('className', href, token); + const target = options.get('target', href, token); + const rel = options.get('rel', href, token); + const attrs = options.getObj('attributes', href, token); + const eventListeners = options.getObj('events', href, token); + attributes.href = formattedHref; + if (className) { + attributes.class = className; + } + if (target) { + attributes.target = target; + } + if (rel) { + attributes.rel = rel; + } + if (attrs) { + assign(attributes, attrs); + } + return { + tagName, + attributes, + content, + eventListeners + }; + } +}; + +/** + * Create a new token that can be emitted by the parser state machine + * @param {string} type readable type of the token + * @param {object} props properties to assign or override, including isLink = true or false + * @returns {new (value: string, tokens: Token[]) => MultiToken} new token class + */ +function createTokenClass(type, props) { + class Token extends MultiToken { + constructor(value, tokens) { + super(value, tokens); + this.t = type; + } + } + for (const p in props) { + Token.prototype[p] = props[p]; + } + Token.t = type; + return Token; +} + +/** + Represents a list of tokens making up a valid email address +*/ +const Email = createTokenClass('email', { + isLink: true, + toHref() { + return 'mailto:' + this.toString(); + } +}); + +/** + Represents some plain text +*/ +const Text = createTokenClass('text'); + +/** + Multi-linebreak token - represents a line break + @class Nl +*/ +const Nl = createTokenClass('nl'); + +/** + Represents a list of text tokens making up a valid URL + @class Url +*/ +const Url = createTokenClass('url', { + isLink: true, + /** + Lowercases relevant parts of the domain and adds the protocol if + required. Note that this will not escape unsafe HTML characters in the + URL. + @param {string} [scheme] default scheme (e.g., 'https') + @return {string} the full href + */ + toHref(scheme) { + if (scheme === void 0) { + scheme = defaults.defaultProtocol; + } + // Check if already has a prefix scheme + return this.hasProtocol() ? this.v : `${scheme}://${this.v}`; + }, + /** + * Check whether this URL token has a protocol + * @return {boolean} + */ + hasProtocol() { + const tokens = this.tk; + return tokens.length >= 2 && tokens[0].t !== LOCALHOST && tokens[1].t === COLON; + } +}); + +var multi = /*#__PURE__*/Object.freeze({ + __proto__: null, + MultiToken: MultiToken, + Base: MultiToken, + createTokenClass: createTokenClass, + Email: Email, + Text: Text, + Nl: Nl, + Url: Url +}); + +/** + Not exactly parser, more like the second-stage scanner (although we can + theoretically hotswap the code here with a real parser in the future... but + for a little URL-finding utility abstract syntax trees may be a little + overkill). + + URL format: http://en.wikipedia.org/wiki/URI_scheme + Email format: http://en.wikipedia.org/wiki/EmailAddress (links to RFC in + reference) + + @module linkify + @submodule parser + @main run +*/ +const makeState = arg => new State(arg); + +/** + * Generate the parser multi token-based state machine + * @param {{ groups: Collections }} tokens + */ +function init$1(_ref) { + let { + groups + } = _ref; + // Types of characters the URL can definitely end in + const qsAccepting = groups.domain.concat([AMPERSAND, ASTERISK, AT, BACKSLASH, BACKTICK, CARET, DOLLAR, EQUALS, HYPHEN, NUM, PERCENT, PIPE, PLUS, POUND, SLASH, SYM, TILDE, UNDERSCORE]); + + // Types of tokens that can follow a URL and be part of the query string + // but cannot be the very last characters + // Characters that cannot appear in the URL at all should be excluded + const qsNonAccepting = [APOSTROPHE, COLON, COMMA, DOT, EXCLAMATION, QUERY, QUOTE, SEMI, OPENANGLEBRACKET, CLOSEANGLEBRACKET, OPENBRACE, CLOSEBRACE, CLOSEBRACKET, OPENBRACKET, OPENPAREN, CLOSEPAREN, FULLWIDTHLEFTPAREN, FULLWIDTHRIGHTPAREN, LEFTCORNERBRACKET, RIGHTCORNERBRACKET, LEFTWHITECORNERBRACKET, RIGHTWHITECORNERBRACKET, FULLWIDTHLESSTHAN, FULLWIDTHGREATERTHAN]; + + // For addresses without the mailto prefix + // Tokens allowed in the localpart of the email + const localpartAccepting = [AMPERSAND, APOSTROPHE, ASTERISK, BACKSLASH, BACKTICK, CARET, DOLLAR, EQUALS, HYPHEN, OPENBRACE, CLOSEBRACE, PERCENT, PIPE, PLUS, POUND, QUERY, SLASH, SYM, TILDE, UNDERSCORE]; + + // The universal starting state. + /** + * @type State + */ + const Start = makeState(); + const Localpart = tt(Start, TILDE); // Local part of the email address + ta(Localpart, localpartAccepting, Localpart); + ta(Localpart, groups.domain, Localpart); + const Domain = makeState(), + Scheme = makeState(), + SlashScheme = makeState(); + ta(Start, groups.domain, Domain); // parsed string ends with a potential domain name (A) + ta(Start, groups.scheme, Scheme); // e.g., 'mailto' + ta(Start, groups.slashscheme, SlashScheme); // e.g., 'http' + + ta(Domain, localpartAccepting, Localpart); + ta(Domain, groups.domain, Domain); + const LocalpartAt = tt(Domain, AT); // Local part of the email address plus @ + + tt(Localpart, AT, LocalpartAt); // close to an email address now + + // Local part of an email address can be e.g. 'http' or 'mailto' + tt(Scheme, AT, LocalpartAt); + tt(SlashScheme, AT, LocalpartAt); + const LocalpartDot = tt(Localpart, DOT); // Local part of the email address plus '.' (localpart cannot end in .) + ta(LocalpartDot, localpartAccepting, Localpart); + ta(LocalpartDot, groups.domain, Localpart); + const EmailDomain = makeState(); + ta(LocalpartAt, groups.domain, EmailDomain); // parsed string starts with local email info + @ with a potential domain name + ta(EmailDomain, groups.domain, EmailDomain); + const EmailDomainDot = tt(EmailDomain, DOT); // domain followed by DOT + ta(EmailDomainDot, groups.domain, EmailDomain); + const Email$1 = makeState(Email); // Possible email address (could have more tlds) + ta(EmailDomainDot, groups.tld, Email$1); + ta(EmailDomainDot, groups.utld, Email$1); + tt(LocalpartAt, LOCALHOST, Email$1); + + // Hyphen can jump back to a domain name + const EmailDomainHyphen = tt(EmailDomain, HYPHEN); // parsed string starts with local email info + @ with a potential domain name + ta(EmailDomainHyphen, groups.domain, EmailDomain); + ta(Email$1, groups.domain, EmailDomain); + tt(Email$1, DOT, EmailDomainDot); + tt(Email$1, HYPHEN, EmailDomainHyphen); + + // Final possible email states + const EmailColon = tt(Email$1, COLON); // URL followed by colon (potential port number here) + /*const EmailColonPort = */ + ta(EmailColon, groups.numeric, Email); // URL followed by colon and port number + + // Account for dots and hyphens. Hyphens are usually parts of domain names + // (but not TLDs) + const DomainHyphen = tt(Domain, HYPHEN); // domain followed by hyphen + const DomainDot = tt(Domain, DOT); // domain followed by DOT + ta(DomainHyphen, groups.domain, Domain); + ta(DomainDot, localpartAccepting, Localpart); + ta(DomainDot, groups.domain, Domain); + const DomainDotTld = makeState(Url); // Simplest possible URL with no query string + ta(DomainDot, groups.tld, DomainDotTld); + ta(DomainDot, groups.utld, DomainDotTld); + ta(DomainDotTld, groups.domain, Domain); + ta(DomainDotTld, localpartAccepting, Localpart); + tt(DomainDotTld, DOT, DomainDot); + tt(DomainDotTld, HYPHEN, DomainHyphen); + tt(DomainDotTld, AT, LocalpartAt); + const DomainDotTldColon = tt(DomainDotTld, COLON); // URL followed by colon (potential port number here) + const DomainDotTldColonPort = makeState(Url); // TLD followed by a port number + ta(DomainDotTldColon, groups.numeric, DomainDotTldColonPort); + + // Long URL with optional port and maybe query string + const Url$1 = makeState(Url); + + // URL with extra symbols at the end, followed by an opening bracket + const UrlNonaccept = makeState(); // URL followed by some symbols (will not be part of the final URL) + + // Query strings + ta(Url$1, qsAccepting, Url$1); + ta(Url$1, qsNonAccepting, UrlNonaccept); + ta(UrlNonaccept, qsAccepting, Url$1); + ta(UrlNonaccept, qsNonAccepting, UrlNonaccept); + + // Become real URLs after `SLASH` or `COLON NUM SLASH` + // Here works with or without scheme:// prefix + tt(DomainDotTld, SLASH, Url$1); + tt(DomainDotTldColonPort, SLASH, Url$1); + + // Note that domains that begin with schemes are treated slighly differently + const SchemeColon = tt(Scheme, COLON); // e.g., 'mailto:' + const SlashSchemeColon = tt(SlashScheme, COLON); // e.g., 'http:' + const SlashSchemeColonSlash = tt(SlashSchemeColon, SLASH); // e.g., 'http:/' + + const UriPrefix = tt(SlashSchemeColonSlash, SLASH); // e.g., 'http://' + + // Scheme states can transition to domain states + ta(Scheme, groups.domain, Domain); + tt(Scheme, DOT, DomainDot); + tt(Scheme, HYPHEN, DomainHyphen); + ta(SlashScheme, groups.domain, Domain); + tt(SlashScheme, DOT, DomainDot); + tt(SlashScheme, HYPHEN, DomainHyphen); + + // Force URL with scheme prefix followed by anything sane + ta(SchemeColon, groups.domain, Url$1); + tt(SchemeColon, SLASH, Url$1); + ta(UriPrefix, groups.domain, Url$1); + ta(UriPrefix, qsAccepting, Url$1); + tt(UriPrefix, SLASH, Url$1); + const bracketPairs = [[OPENBRACE, CLOSEBRACE], + // {} + [OPENBRACKET, CLOSEBRACKET], + // [] + [OPENPAREN, CLOSEPAREN], + // () + [OPENANGLEBRACKET, CLOSEANGLEBRACKET], + // <> + [FULLWIDTHLEFTPAREN, FULLWIDTHRIGHTPAREN], + // () + [LEFTCORNERBRACKET, RIGHTCORNERBRACKET], + // 「」 + [LEFTWHITECORNERBRACKET, RIGHTWHITECORNERBRACKET], + // 『』 + [FULLWIDTHLESSTHAN, FULLWIDTHGREATERTHAN] // <> + ]; + + for (let i = 0; i < bracketPairs.length; i++) { + const [OPEN, CLOSE] = bracketPairs[i]; + const UrlOpen = tt(Url$1, OPEN); // URL followed by open bracket + + // Continue not accepting for open brackets + tt(UrlNonaccept, OPEN, UrlOpen); + + // Closing bracket component. This character WILL be included in the URL + tt(UrlOpen, CLOSE, Url$1); + + // URL that beings with an opening bracket, followed by a symbols. + // Note that the final state can still be `UrlOpen` (if the URL has a + // single opening bracket for some reason). + const UrlOpenQ = makeState(Url); + ta(UrlOpen, qsAccepting, UrlOpenQ); + const UrlOpenSyms = makeState(); // UrlOpen followed by some symbols it cannot end it + ta(UrlOpen, qsNonAccepting); + + // URL that begins with an opening bracket, followed by some symbols + ta(UrlOpenQ, qsAccepting, UrlOpenQ); + ta(UrlOpenQ, qsNonAccepting, UrlOpenSyms); + ta(UrlOpenSyms, qsAccepting, UrlOpenQ); + ta(UrlOpenSyms, qsNonAccepting, UrlOpenSyms); + + // Close brace/bracket to become regular URL + tt(UrlOpenQ, CLOSE, Url$1); + tt(UrlOpenSyms, CLOSE, Url$1); + } + tt(Start, LOCALHOST, DomainDotTld); // localhost is a valid URL state + tt(Start, NL$1, Nl); // single new line + + return { + start: Start, + tokens: tk + }; +} + +/** + * Run the parser state machine on a list of scanned string-based tokens to + * create a list of multi tokens, each of which represents a URL, email address, + * plain text, etc. + * + * @param {State} start parser start state + * @param {string} input the original input used to generate the given tokens + * @param {Token[]} tokens list of scanned tokens + * @returns {MultiToken[]} + */ +function run(start, input, tokens) { + let len = tokens.length; + let cursor = 0; + let multis = []; + let textTokens = []; + while (cursor < len) { + let state = start; + let secondState = null; + let nextState = null; + let multiLength = 0; + let latestAccepting = null; + let sinceAccepts = -1; + while (cursor < len && !(secondState = state.go(tokens[cursor].t))) { + // Starting tokens with nowhere to jump to. + // Consider these to be just plain text + textTokens.push(tokens[cursor++]); + } + while (cursor < len && (nextState = secondState || state.go(tokens[cursor].t))) { + // Get the next state + secondState = null; + state = nextState; + + // Keep track of the latest accepting state + if (state.accepts()) { + sinceAccepts = 0; + latestAccepting = state; + } else if (sinceAccepts >= 0) { + sinceAccepts++; + } + cursor++; + multiLength++; + } + if (sinceAccepts < 0) { + // No accepting state was found, part of a regular text token add + // the first text token to the text tokens array and try again from + // the next + cursor -= multiLength; + if (cursor < len) { + textTokens.push(tokens[cursor]); + cursor++; + } + } else { + // Accepting state! + // First close off the textTokens (if available) + if (textTokens.length > 0) { + multis.push(initMultiToken(Text, input, textTokens)); + textTokens = []; + } + + // Roll back to the latest accepting state + cursor -= sinceAccepts; + multiLength -= sinceAccepts; + + // Create a new multitoken + const Multi = latestAccepting.t; + const subtokens = tokens.slice(cursor - multiLength, cursor); + multis.push(initMultiToken(Multi, input, subtokens)); + } + } + + // Finally close off the textTokens (if available) + if (textTokens.length > 0) { + multis.push(initMultiToken(Text, input, textTokens)); + } + return multis; +} + +/** + * Utility function for instantiating a new multitoken with all the relevant + * fields during parsing. + * @param {new (value: string, tokens: Token[]) => MultiToken} Multi class to instantiate + * @param {string} input original input string + * @param {Token[]} tokens consecutive tokens scanned from input string + * @returns {MultiToken} + */ +function initMultiToken(Multi, input, tokens) { + const startIdx = tokens[0].s; + const endIdx = tokens[tokens.length - 1].e; + const value = input.slice(startIdx, endIdx); + return new Multi(value, tokens); +} + +const warn = typeof console !== 'undefined' && console && console.warn || (() => {}); +const warnAdvice = 'until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.'; + +// Side-effect initialization state +const INIT = { + scanner: null, + parser: null, + tokenQueue: [], + pluginQueue: [], + customSchemes: [], + initialized: false +}; + +/** + * @typedef {{ + * start: State, + * tokens: { groups: Collections } & typeof tk + * }} ScannerInit + */ + +/** + * @typedef {{ + * start: State, + * tokens: typeof multi + * }} ParserInit + */ + +/** + * @typedef {(arg: { scanner: ScannerInit }) => void} TokenPlugin + */ + +/** + * @typedef {(arg: { scanner: ScannerInit, parser: ParserInit }) => void} Plugin + */ + +/** + * De-register all plugins and reset the internal state-machine. Used for + * testing; not required in practice. + * @private + */ +function reset() { + State.groups = {}; + INIT.scanner = null; + INIT.parser = null; + INIT.tokenQueue = []; + INIT.pluginQueue = []; + INIT.customSchemes = []; + INIT.initialized = false; +} + +/** + * Register a token plugin to allow the scanner to recognize additional token + * types before the parser state machine is constructed from the results. + * @param {string} name of plugin to register + * @param {TokenPlugin} plugin function that accepts the scanner state machine + * and available scanner tokens and collections and extends the state machine to + * recognize additional tokens or groups. + */ +function registerTokenPlugin(name, plugin) { + if (typeof plugin !== 'function') { + throw new Error(`linkifyjs: Invalid token plugin ${plugin} (expects function)`); + } + for (let i = 0; i < INIT.tokenQueue.length; i++) { + if (name === INIT.tokenQueue[i][0]) { + warn(`linkifyjs: token plugin "${name}" already registered - will be overwritten`); + INIT.tokenQueue[i] = [name, plugin]; + return; + } + } + INIT.tokenQueue.push([name, plugin]); + if (INIT.initialized) { + warn(`linkifyjs: already initialized - will not register token plugin "${name}" ${warnAdvice}`); + } +} + +/** + * Register a linkify plugin + * @param {string} name of plugin to register + * @param {Plugin} plugin function that accepts the parser state machine and + * extends the parser to recognize additional link types + */ +function registerPlugin(name, plugin) { + if (typeof plugin !== 'function') { + throw new Error(`linkifyjs: Invalid plugin ${plugin} (expects function)`); + } + for (let i = 0; i < INIT.pluginQueue.length; i++) { + if (name === INIT.pluginQueue[i][0]) { + warn(`linkifyjs: plugin "${name}" already registered - will be overwritten`); + INIT.pluginQueue[i] = [name, plugin]; + return; + } + } + INIT.pluginQueue.push([name, plugin]); + if (INIT.initialized) { + warn(`linkifyjs: already initialized - will not register plugin "${name}" ${warnAdvice}`); + } +} + +/** + * Detect URLs with the following additional protocol. Anything with format + * "protocol://..." will be considered a link. If `optionalSlashSlash` is set to + * `true`, anything with format "protocol:..." will be considered a link. + * @param {string} protocol + * @param {boolean} [optionalSlashSlash] + */ +function registerCustomProtocol(scheme, optionalSlashSlash) { + if (optionalSlashSlash === void 0) { + optionalSlashSlash = false; + } + if (INIT.initialized) { + warn(`linkifyjs: already initialized - will not register custom scheme "${scheme}" ${warnAdvice}`); + } + if (!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(scheme)) { + throw new Error(`linkifyjs: incorrect scheme format. +1. Must only contain digits, lowercase ASCII letters or "-" +2. Cannot start or end with "-" +3. "-" cannot repeat`); + } + INIT.customSchemes.push([scheme, optionalSlashSlash]); +} + +/** + * Initialize the linkify state machine. Called automatically the first time + * linkify is called on a string, but may be called manually as well. + */ +function init() { + // Initialize scanner state machine and plugins + INIT.scanner = init$2(INIT.customSchemes); + for (let i = 0; i < INIT.tokenQueue.length; i++) { + INIT.tokenQueue[i][1]({ + scanner: INIT.scanner + }); + } + + // Initialize parser state machine and plugins + INIT.parser = init$1(INIT.scanner.tokens); + for (let i = 0; i < INIT.pluginQueue.length; i++) { + INIT.pluginQueue[i][1]({ + scanner: INIT.scanner, + parser: INIT.parser + }); + } + INIT.initialized = true; +} + +/** + * Parse a string into tokens that represent linkable and non-linkable sub-components + * @param {string} str + * @return {MultiToken[]} tokens + */ +function tokenize(str) { + if (!INIT.initialized) { + init(); + } + return run(INIT.parser.start, str, run$1(INIT.scanner.start, str)); +} + +/** + * Find a list of linkable items in the given string. + * @param {string} str string to find links in + * @param {string | Opts} [type] either formatting options or specific type of + * links to find, e.g., 'url' or 'email' + * @param {Opts} [opts] formatting options for final output. Cannot be specified + * if opts already provided in `type` argument + */ +function find(str, type, opts) { + if (type === void 0) { + type = null; + } + if (opts === void 0) { + opts = null; + } + if (type && typeof type === 'object') { + if (opts) { + throw Error(`linkifyjs: Invalid link type ${type}; must be a string`); + } + opts = type; + type = null; + } + const options = new Options(opts); + const tokens = tokenize(str); + const filtered = []; + for (let i = 0; i < tokens.length; i++) { + const token = tokens[i]; + if (token.isLink && (!type || token.t === type) && options.check(token)) { + filtered.push(token.toFormattedObject(options)); + } + } + return filtered; +} + +/** + * Is the given string valid linkable text of some sort. Note that this does not + * trim the text for you. + * + * Optionally pass in a second `type` param, which is the type of link to test + * for. + * + * For example, + * + * linkify.test(str, 'email'); + * + * Returns `true` if str is a valid email. + * @param {string} str string to test for links + * @param {string} [type] optional specific link type to look for + * @returns boolean true/false + */ +function test(str, type) { + if (type === void 0) { + type = null; + } + const tokens = tokenize(str); + return tokens.length === 1 && tokens[0].isLink && (!type || tokens[0].t === type); +} + + + + +/***/ }), + +/***/ "./private/css/cms.balloon-toolbar.css": +/*!*********************************************!*\ + !*** ./private/css/cms.balloon-toolbar.css ***! + \*********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + + +/***/ }), + +/***/ "./private/css/cms.dialog.css": +/*!************************************!*\ + !*** ./private/css/cms.dialog.css ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + + +/***/ }), + +/***/ "./private/css/cms.linkfield.css": +/*!***************************************!*\ + !*** ./private/css/cms.linkfield.css ***! + \***************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + + +/***/ }), + +/***/ "./private/css/cms.tiptap.css": +/*!************************************!*\ + !*** ./private/css/cms.tiptap.css ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + + +/***/ }), + +/***/ "./node_modules/tippy.js/dist/tippy.esm.js": +/*!*************************************************!*\ + !*** ./node_modules/tippy.js/dist/tippy.esm.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ animateFill: () => (/* binding */ animateFill), +/* harmony export */ createSingleton: () => (/* binding */ createSingleton), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ delegate: () => (/* binding */ delegate), +/* harmony export */ followCursor: () => (/* binding */ followCursor), +/* harmony export */ hideAll: () => (/* binding */ hideAll), +/* harmony export */ inlinePositioning: () => (/* binding */ inlinePositioning), +/* harmony export */ roundArrow: () => (/* binding */ ROUND_ARROW), +/* harmony export */ sticky: () => (/* binding */ sticky) +/* harmony export */ }); +/* harmony import */ var _popperjs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @popperjs/core */ "./node_modules/@popperjs/core/lib/popper.js"); +/* harmony import */ var _popperjs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @popperjs/core */ "./node_modules/@popperjs/core/lib/modifiers/applyStyles.js"); +/**! +* tippy.js v6.3.7 +* (c) 2017-2021 atomiks +* MIT License +*/ + + +var ROUND_ARROW = ''; +var BOX_CLASS = "tippy-box"; +var CONTENT_CLASS = "tippy-content"; +var BACKDROP_CLASS = "tippy-backdrop"; +var ARROW_CLASS = "tippy-arrow"; +var SVG_ARROW_CLASS = "tippy-svg-arrow"; +var TOUCH_OPTIONS = { + passive: true, + capture: true +}; +var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO() { + return document.body; +}; + +function hasOwnProperty(obj, key) { + return {}.hasOwnProperty.call(obj, key); +} +function getValueAtIndexOrReturn(value, index, defaultValue) { + if (Array.isArray(value)) { + var v = value[index]; + return v == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v; + } + + return value; +} +function isType(value, type) { + var str = {}.toString.call(value); + return str.indexOf('[object') === 0 && str.indexOf(type + "]") > -1; +} +function invokeWithArgsOrReturn(value, args) { + return typeof value === 'function' ? value.apply(void 0, args) : value; +} +function debounce(fn, ms) { + // Avoid wrapping in `setTimeout` if ms is 0 anyway + if (ms === 0) { + return fn; + } + + var timeout; + return function (arg) { + clearTimeout(timeout); + timeout = setTimeout(function () { + fn(arg); + }, ms); + }; +} +function removeProperties(obj, keys) { + var clone = Object.assign({}, obj); + keys.forEach(function (key) { + delete clone[key]; + }); + return clone; +} +function splitBySpaces(value) { + return value.split(/\s+/).filter(Boolean); +} +function normalizeToArray(value) { + return [].concat(value); +} +function pushIfUnique(arr, value) { + if (arr.indexOf(value) === -1) { + arr.push(value); + } +} +function unique(arr) { + return arr.filter(function (item, index) { + return arr.indexOf(item) === index; + }); +} +function getBasePlacement(placement) { + return placement.split('-')[0]; +} +function arrayFrom(value) { + return [].slice.call(value); +} +function removeUndefinedProps(obj) { + return Object.keys(obj).reduce(function (acc, key) { + if (obj[key] !== undefined) { + acc[key] = obj[key]; + } + + return acc; + }, {}); +} + +function div() { + return document.createElement('div'); +} +function isElement(value) { + return ['Element', 'Fragment'].some(function (type) { + return isType(value, type); + }); +} +function isNodeList(value) { + return isType(value, 'NodeList'); +} +function isMouseEvent(value) { + return isType(value, 'MouseEvent'); +} +function isReferenceElement(value) { + return !!(value && value._tippy && value._tippy.reference === value); +} +function getArrayOfElements(value) { + if (isElement(value)) { + return [value]; + } + + if (isNodeList(value)) { + return arrayFrom(value); + } + + if (Array.isArray(value)) { + return value; + } + + return arrayFrom(document.querySelectorAll(value)); +} +function setTransitionDuration(els, value) { + els.forEach(function (el) { + if (el) { + el.style.transitionDuration = value + "ms"; + } + }); +} +function setVisibilityState(els, state) { + els.forEach(function (el) { + if (el) { + el.setAttribute('data-state', state); + } + }); +} +function getOwnerDocument(elementOrElements) { + var _element$ownerDocumen; + + var _normalizeToArray = normalizeToArray(elementOrElements), + element = _normalizeToArray[0]; // Elements created via a