var _NumberPOSITIVE_INFINITY=Number.POSITIVE_INFINITY,_Mathfloor=Math.floor,_Mathmax=Math.max,_Mathmin=Math.min;(function(r,s){if('object'==typeof exports&&'object'==typeof module)module.exports=s();else if('function'==typeof define&&define.amd)define([],s);else{var d=s();for(var u in d)('object'==typeof exports?exports:r)[u]=d[u]}})(this,function(){return function(o){function r(d){if(s[d])return s[d].exports;var u=s[d]={i:d,l:!1,exports:{}};return o[d].call(u.exports,u,u.exports,r),u.l=!0,u.exports}var s={};return r.m=o,r.c=s,r.i=function(d){return d},r.d=function(d,u,f){r.o(d,u)||Object.defineProperty(d,u,{configurable:!1,enumerable:!0,get:f})},r.n=function(d){var u=d&&d.__esModule?function(){return d['default']}:function(){return d};return r.d(u,'a',u),u},r.o=function(d,u){return Object.prototype.hasOwnProperty.call(d,u)},r.p='',r(r.s=526)}([function(o,r){'use strict';/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class d extends Error{constructor(u,f){f&&(u+=' '+JSON.stringify(f)),super(u),this.name='CKEditorError',this.data=f}static isCKEditorError(u){return u instanceof d}}r.a=d},function(o,r,s){'use strict';var d=s(34),u=s(19),f=s(52),h=s(0),w=s(24);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class C{constructor(T,P){if(!T.is('element')&&!T.is('documentFragment'))throw new h.a('model-position-root-invalid: Position root invalid.');if(!(P instanceof Array)||0===P.length)throw new h.a('model-position-path-incorrect: Position path must be an Array with at least one item.',{path:P});P=T.getPath().concat(P),T=T.root,this.root=T,this.path=P}get offset(){return s.i(u.a)(this.path)}set offset(T){this.path[this.path.length-1]=T}get parent(){let T=this.root;for(let P=0;PS?0:S,P}isAfter(T){return'after'==this.compareWith(T)}isBefore(T){return'before'==this.compareWith(T)}isEqual(T){return'same'==this.compareWith(T)}isTouching(T){let P=null,S=null,E=this.compareWith(T);switch(E){case'same':return!0;case'before':P=C.createFromPosition(this),S=C.createFromPosition(T);break;case'after':P=C.createFromPosition(T),S=C.createFromPosition(this);break;default:return!1;}for(let O=P.parent;P.path.length+S.path.length;){if(P.isEqual(S))return!0;if(P.path.length>S.path.length){if(P.offset!==O.maxOffset)return!1;P.path=P.path.slice(0,-1),O=O.parent,P.offset++}else{if(0!==S.offset)return!1;S.path=S.path.slice(0,-1)}}}_getTransformedByDeletion(T,P){let S=C.createFromPosition(this);if(this.root!=T.root)return S;if('same'==s.i(f.a)(T.getParentPath(),this.getParentPath())){if(T.offsetthis.offset)return null;S.offset-=P}}else if('prefix'==s.i(f.a)(T.getParentPath(),this.getParentPath())){const E=T.path.length-1;if(T.offset<=this.path[E]){if(T.offset+P>this.path[E])return null;S.path[E]-=P}}return S}_getTransformedByInsertion(T,P,S){let E=C.createFromPosition(this);if(this.root!=T.root)return E;if('same'==s.i(f.a)(T.getParentPath(),this.getParentPath()))(T.offsetC+1;){let S=P.maxOffset-T.offset;0!=S&&w.push(new h(T,T.getShiftedBy(S))),T.path=T.path.slice(0,-1),T.offset++,P=P.parent}for(;T.path.length<=this.end.path.length;){let S=this.end.path[T.path.length-1],E=S-T.offset;0!=E&&w.push(new h(T,T.getShiftedBy(E))),T.offset=S,T.path.push(0)}return w}getWalker(w={}){return w.boundaries=this,new u.a(w)}*getItems(w={}){w.boundaries=this,w.ignoreElementEnd=!0;const C=new u.a(w);for(let T of C)yield T.item}*getPositions(w={}){w.boundaries=this;const C=new u.a(w);yield C.position;for(let T of C)yield T.nextPosition}getTransformedByDelta(w){let C=[h.createFromRange(this)];const T=new Set(['insert','move','remove','reinsert']);for(let P of w.operations)if(T.has(P.type))for(let S=0;SS.start.isAfter(E.start));const T=w.indexOf(C),P=new this(C.start,C.end);for(let S=T-1;0<=S&&w[S].end.isEqual(P.start);S++)P.start=d.a.createFromPosition(w[S].start);for(let S=T+1;S{Object.getOwnPropertyNames(h).concat(Object.getOwnPropertySymbols(h)).forEach((w)=>{if(!(w in u.prototype)){const C=Object.getOwnPropertyDescriptor(h,w);C.enumerable=!1,Object.defineProperty(u.prototype,w,C)}})})}},function(o,r,s){'use strict';function d(T){return'string'==typeof T?[new h.a(T)]:(s.i(w.a)(T)||(T=[T]),Array.from(T).map((P)=>'string'==typeof P?new h.a(P):P))}var u=s(59),f=s(72),h=s(24),w=s(41);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class C extends u.a{constructor(T,P,S){super(P),this.name=T,this._children=new f.a,S&&this.insertChildren(0,S)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(T,P=null){return P?'element'==T&&P==this.name:'element'==T||T==this.name}getChild(T){return this._children.getNode(T)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(T){return this._children.getNodeIndex(T)}getChildStartOffset(T){return this._children.getNodeStartOffset(T)}clone(T=!1){const P=T?Array.from(this._children).map((S)=>S.clone()):Array.from(this._children);return new C(this.name,this.getAttributes(),P)}offsetToIndex(T){return this._children.offsetToIndex(T)}appendChildren(T){this.insertChildren(this.childCount,T)}insertChildren(T,P){P=d(P);for(let S of P)S.parent=this;this._children.insertNodes(T,P)}removeChildren(T,P=1){const S=this._children.removeNodes(T,P);for(let E of S)E.parent=null;return S}getNodeByPath(T){let P=this;for(const S of T)P=P.getChild(S);return P}toJSON(){let T=super.toJSON();if(T.name=this.name,0{return re instanceof te?re.getValue(ie):re})}function f(oe,ie,{node:re}){let se=u(oe,re);se=1==oe.length&&oe[0]instanceof ne?se[0]:se.reduce(F,''),I(se)?ie.remove():ie.set(se)}function h(oe){return{set(ie){oe.textContent=ie},remove(){oe.textContent=''}}}function w(oe,ie,re){return{set(se){oe.setAttributeNS(re,ie,se)},remove(){oe.removeAttributeNS(re,ie)}}}function C(oe,ie){return{set(re){oe.style[ie]=re},remove(){oe.style[ie]=null}}}function T(oe){const ie=s.i(J.a)(oe,(re)=>{if(re&&(re instanceof te||D(re)||L(re)||q(re)))return re});return ie}function P(oe){if('string'==typeof oe?oe=O(oe):oe.text&&V(oe),oe.on&&(oe.eventListeners=E(oe.on),delete oe.on),!oe.text){oe.attributes&&S(oe.attributes);const ie=new W.a;if(oe.children)if(q(oe.children))ie.add(oe.children);else for(let re of oe.children)D(re)||L(re)?ie.add(re):ie.add(new ee(re));oe.children=ie}return oe}function S(oe){for(let ie in oe)oe[ie].value&&(oe[ie].value=[].concat(oe[ie].value)),R(oe,ie)}function E(oe){for(let ie in oe)R(oe,ie);return oe}function O(oe){return{text:[oe]}}function V(oe){Array.isArray(oe.text)||(oe.text=[oe.text])}function R(oe,ie){Array.isArray(oe[ie])||(oe[ie]=[oe[ie]])}function F(oe,ie){return I(ie)?oe:I(oe)?ie:`${oe} ${ie}`}function N(oe,ie){for(let re in ie)oe[re]?oe[re].push(...ie[re]):oe[re]=ie[re]}function M(oe,ie){if(ie.attributes&&(!oe.attributes&&(oe.attributes={}),N(oe.attributes,ie.attributes)),ie.eventListeners&&(!oe.eventListeners&&(oe.eventListeners={}),N(oe.eventListeners,ie.eventListeners)),ie.text&&oe.text.push(...ie.text),ie.children&&ie.children.length){if(oe.children.length!=ie.children.length)throw new K.a('ui-template-extend-children-mismatch: The number of children in extended definition does not match.');let re=0;for(let se of ie.children)M(oe.children.get(re++),se)}}function I(oe){return!oe&&0!==oe}function L(oe){return oe instanceof Z.a}function D(oe){return oe instanceof ee}function q(oe){return oe instanceof G.a}function z(){return{children:[],bindings:[],attributes:{}}}function $(oe){return'class'==oe||'style'==oe}var K=s(0),H=s(4),U=s(7),W=s(79),Z=s(9),G=s(120),J=s(504),Y=s(15),X=s(58);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class ee{constructor(oe){Object.assign(this,P(T(oe))),this._isRendered=!1,this._revertData=null}render(){const oe=this._renderNode({intoFragment:!0});return this._isRendered=!0,oe}apply(oe){return this._revertData=z(),this._renderNode({node:oe,isApplying:!0,revertData:this._revertData}),oe}revert(oe){if(!this._revertData)throw new K.a('ui-template-revert-not-applied: Attempting reverting a template which has not been applied yet.');this._revertTemplateFromNode(oe,this._revertData)}static bind(oe,ie){return{to(re,se){return new ae({eventNameOrFunction:re,attribute:re,observable:oe,emitter:ie,callback:se})},if(re,se,le){return new ne({observable:oe,emitter:ie,attribute:re,valueIfTrue:se,callback:le})}}}static extend(oe,ie){oe._isRendered&&X.a.warn('template-extend-render: Attempting to extend a template which has already been rendered.'),M(oe,P(T(ie)))}_renderNode(oe){let ie;if(ie=oe.node?this.tag&&this.text:this.tag?this.text:!this.text,ie)throw new K.a('ui-template-wrong-syntax: Node definition must have either "tag" or "text" when rendering new Node.');return this.text?this._renderText(oe):this._renderElement(oe)}_renderElement(oe){let ie=oe.node;return ie||(ie=oe.node=document.createElementNS(this.ns||'http://www.w3.org/1999/xhtml',this.tag)),this._renderAttributes(oe),this._renderElementChildren(oe),this._setUpListeners(oe),ie}_renderText(oe){let ie=oe.node;return ie?oe.revertData.text=ie.textContent:ie=oe.node=document.createTextNode(''),d(this.text)?this._bindToObservable({schema:this.text,updater:h(ie),data:oe}):ie.textContent=this.text.join(''),ie}_renderAttributes(oe){let ie,re,se,le;if(this.attributes){const de=oe.node,ce=oe.revertData;for(ie in this.attributes)if(se=de.getAttribute(ie),re=this.attributes[ie],ce&&(ce.attributes[ie]=se),le=s.i(Y.a)(re[0])&&re[0].ns?re[0].ns:null,d(re)){const ue=le?re[0].value:re;ce&&$(ie)&&ue.unshift(se),this._bindToObservable({schema:ue,updater:w(de,ie,le),data:oe})}else'style'==ie&&'string'!=typeof re[0]?this._renderStyleAttribute(re[0],oe):(ce&&se&&$(ie)&&re.unshift(se),re=re.map((ue)=>ue?ue.value||ue:ue).reduce((ue,me)=>ue.concat(me),[]).reduce(F,''),I(re)||de.setAttributeNS(le,ie,re))}}_renderStyleAttribute(oe,ie){const re=ie.node;for(let se in oe){const le=oe[se];d(le)?this._bindToObservable({schema:[le],updater:C(re,se),data:ie}):re.style[se]=le}}_renderElementChildren(oe){const ie=oe.node,re=oe.intoFragment?document.createDocumentFragment():ie,se=oe.isApplying;let le=0;for(let de of this.children)if(q(de)){if(!se){de.setParent(ie);for(let ce of de)re.appendChild(ce.element)}}else if(L(de))se||re.appendChild(de.element);else if(se){const ce=oe.revertData,ue=z();ce.children.push(ue),de._renderNode({node:re.childNodes[le++],isApplying:!0,revertData:ue})}else re.appendChild(de.render());oe.intoFragment&&ie.appendChild(re)}_setUpListeners(oe){if(this.eventListeners)for(let ie in this.eventListeners){const re=this.eventListeners[ie].map((se)=>{const[le,de]=ie.split('@');return se.activateDomEventListener(le,de,oe)});oe.revertData&&oe.revertData.bindings.push(re)}}_bindToObservable({schema:oe,updater:ie,data:re}){const se=re.revertData;f(oe,ie,re);const le=oe.filter((de)=>!I(de)).filter((de)=>de.observable).map((de)=>de.activateAttributeListener(oe,ie,re));se&&se.bindings.push(le)}_revertTemplateFromNode(oe,ie){for(let re of ie.bindings)for(let se of re)se();if(ie.text)return void(oe.textContent=ie.text);for(let re in ie.attributes){const se=ie.attributes[re];null===se?oe.removeAttribute(re):oe.setAttribute(re,se)}for(let re=0;ref(oe,ie,re);return this.emitter.listenTo(this.observable,'change:'+this.attribute,se),()=>{this.emitter.stopListening(this.observable,'change:'+this.attribute,se)}}}class ae extends te{activateDomEventListener(oe,ie,re){const se=(le,de)=>{(!ie||de.target.matches(ie))&&('function'==typeof this.eventNameOrFunction?this.eventNameOrFunction(de):this.observable.fire(this.eventNameOrFunction,de))};return this.emitter.listenTo(re.node,oe,se),()=>{this.emitter.stopListening(re.node,oe,se)}}}class ne extends te{getValue(oe){const ie=super.getValue(oe);return!I(ie)&&(this.valueIfTrue||!0)}}},function(o,r,s){'use strict';function u(M,I){M[F]||(M[F]=I||s.i(O.a)())}function f(M){return M[F]}function h(M){return M._events||Object.defineProperty(M,'_events',{value:{}}),M._events}function w(){return{callbacks:[],childEvents:[]}}function C(M,I){const L=h(M);if(L[I])return;let D=I,q=null;const z=[];for(;''!==D&&!L[D];)L[D]=w(),z.push(L[D]),q&&L[D].childEvents.push(q),q=D,D=D.substr(0,D.lastIndexOf(':'));if(''!==D){for(let $ of z)$.callbacks=L[D].callbacks.slice();L[D].childEvents.push(q)}}function T(M,I){const L=h(M)[I];if(!L)return[];let D=[L.callbacks];for(let q=0,z;q{this._delegations||(this._delegations=new Map);for(let D of M){let q=this._delegations.get(D);q?q.set(I,L):this._delegations.set(D,new Map([[I,L]]))}}}},stopDelegating(M,I){if(this._delegations)if(!M)this._delegations.clear();else if(!I)this._delegations.delete(M);else{const L=this._delegations.get(M);L&&L.delete(I)}}};r.a=N},function(o,r,s){'use strict';var u=s(195),f=s(16),w=_Mathmax;r.a=function(C,T){if('function'!=typeof C)throw new TypeError('Expected a function');return T=w(void 0===T?C.length-1:s.i(f.a)(T),0),function(){for(var P=arguments,S=-1,E=w(P.length-T,0),O=Array(E);++S{V.locale=E})}get element(){return this._element?this._element:this.template?(this._addTemplateChildren(),this._element=this.template.render()):null}set element(E){this._element=E}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=f.a.bind(this,this)}createCollection(){const E=new u.a;return this._viewCollections.add(E),E}addChildren(E){s.i(P.a)(E)||(E=[E]);for(let O of E)this._unboundChildren.add(O)}init(){if(this.ready)throw new d.a('ui-view-init-reinit: This View has already been initialized.');return Promise.resolve().then(()=>{return Promise.all(this._viewCollections.map((E)=>E.init()))}).then(()=>{this.ready=!0})}destroy(){this.stopListening();const E=this._viewCollections.map((O)=>O.destroy());return this._unboundChildren.clear(),this._viewCollections.clear(),this.element=this.template=this.locale=this.t=this._viewCollections=this._unboundChildren=null,Promise.all(E)}_addTemplateChildren(){const E=(O)=>{if(O.children)for(let V of O.children)V instanceof S?this.addChildren(V):E(V)};E(this.template)}}r.a=S,s.i(T.a)(S,h.a),s.i(T.a)(S,w.a)},function(o,r,s){'use strict';var u=s(444),f=s(445),h=s(229),w=s(11),C=s(515);r.a=function(T){return'function'==typeof T?T:null==T?h.a:'object'==typeof T?s.i(w.a)(T)?s.i(f.a)(T[0],T[1]):s.i(u.a)(T):s.i(C.a)(T)}},function(o,r){'use strict';var d=Array.isArray;r.a=d},function(o,r,s){'use strict';function d(w,C){C.isEnabled=!1}var u=s(32),f=s(4);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class h{constructor(w){this.editor=w,this.set('isEnabled',!0),this._checkEnabled&&this.on('refreshState',(C,T)=>{T.isEnabled=this._checkEnabled()})}destroy(){this.stopListening()}refreshState(){const w={isEnabled:!0};this.fire('refreshState',w),this.isEnabled=w.isEnabled}_execute(w){this.isEnabled&&this._doExecute(w)}_disable(){this.on('refreshState',d),this.refreshState()}_enable(){this.off('refreshState',d),this.refreshState()}_doExecute(){}}r.a=h,s.i(f.a)(h,u.a)},function(o,r,s){'use strict';function u(L){if(!L.isFlat)throw new M.a('model-writer-remove-range-not-flat: Trying to remove a range that starts and ends in different element.');const D=L.start.parent;P(L.start),P(L.end);const q=D.removeChildren(L.start.index,L.end.index-L.start.index);return T(D,L.start.index),q}function C(L){const D=[];L instanceof Array||(L=[L]);for(let q=0;qK+H.offsetSize,0),z=L.parent;P(L);const $=L.index;return z.insertChildren($,D),T(z,$+D.length),T(z,$),new R.a(L,L.getShiftedBy(q))},remove:u,move:function(L,D){if(!L.isFlat)throw new M.a('model-writer-move-range-not-flat: Trying to move a range that starts and ends in different element.');const q=this.remove(L);return D=D._getTransformedByDeletion(L.start,L.end.offset-L.start.offset),this.insert(D,q)},setAttribute:function(L,D,q){P(L.start),P(L.end);for(let z of L.getItems()){let $=z.is('textProxy')?z.textNode:z;null===q?$.removeAttribute(D):$.setAttribute(D,q),T($.parent,$.index)}T(L.end.parent,L.end.index)},removeAttribute:function(L,D){this.setAttribute(L,D,null)},normalizeNodes:C}},function(o,r,s){'use strict';var u=s(96),f=s(43);r.a=function(h){return s.i(f.a)(h)&&s.i(u.a)(h)}},function(o,r){'use strict';r.a=function(u){var f=typeof u;return!!u&&('object'==f||'function'==f)}},function(o,r,s){'use strict';var u=s(517);r.a=function(f){var h=s.i(u.a)(f),w=h%1;return h===h?w?h-w:h:0}},function(o,r,s){'use strict';var u=s(0);r.b=function(h,w){if(f.prototype[h])throw new u.a('model-batch-register-taken: This batch method name is already taken.',{name:h});f.prototype[h]=w};/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f{constructor(h,w='default'){this.document=h,this.deltas=[],this.type=w}get baseVersion(){return 0O.add(F))}function f(O){return'string'==typeof O?[new w.a(O)]:(s.i(T.a)(O)||(O=[O]),Array.from(O).map((V)=>'string'==typeof V?new w.a(V):V))}var h=s(76),w=s(30),C=s(274),T=s(41),P=s(98),S=s(169);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class E extends h.a{constructor(O,V,R){if(super(),this.name=O,this._attrs=s.i(P.a)(V)?s.i(C.a)(V):new Map(V),this._children=[],R&&this.insertChildren(0,R),this._classes=new Set,this._attrs.has('class')){const F=this._attrs.get('class');u(this._classes,F),this._attrs.delete('class')}this._styles=new Map,this._attrs.has('style')&&(d(this._styles,this._attrs.get('style')),this._attrs.delete('style')),this._customProperties=new Map}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}is(O,V=null){return V?'element'==O&&V==this.name:'element'==O||O==this.name}clone(O){const V=[];if(O)for(let F of this.getChildren())V.push(F.clone(O));const R=new this.constructor(this.name,this._attrs,V);return R._classes=new Set(this._classes),R._styles=new Map(this._styles),R._customProperties=new Map(this._customProperties),R.getFillerOffset=this.getFillerOffset,R}appendChildren(O){return this.insertChildren(this.childCount,O)}getChild(O){return this._children[O]}getChildIndex(O){return this._children.indexOf(O)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){0this._classes.add(V))}removeClass(...O){this._fireChange('attributes',this),O.forEach((V)=>this._classes.delete(V))}hasClass(...O){for(let V of O)if(!this._classes.has(V))return!1;return!0}getClassNames(){return this._classes.keys()}setStyle(O,V){if(this._fireChange('attributes',this),s.i(P.a)(O)){const R=Object.keys(O);for(let F of R)this._styles.set(F,O[F])}else this._styles.set(O,V)}getStyle(O){return this._styles.get(O)}getStyleNames(){return this._styles.keys()}hasStyle(...O){for(let V of O)if(!this._styles.has(V))return!1;return!0}removeStyle(...O){this._fireChange('attributes',this),O.forEach((V)=>this._styles.delete(V))}findAncestor(...O){const V=new S.a(...O);for(let R=this.parent;R;){if(V.match(R))return R;R=R.parent}return null}setCustomProperty(O,V){this._customProperties.set(O,V)}getCustomProperty(O){return this._customProperties.get(O)}removeCustomProperty(O){return this._customProperties.delete(O)}*getCustomProperties(){yield*this._customProperties.entries()}}r.a=E},function(o,r,s){'use strict';function d(S){let E;if('string'!=typeof S)E=S.keyCode+(S.altKey?P.alt:0)+(S.ctrlKey?P.ctrl:0)+(S.shiftKey?P.shift:0);else if(E=P[S.toLowerCase()],!E)throw new C.a('keyboard-unknown-key: Unknown key name.',{key:S});return E}function w(S){return S.split(/\s*\+\s*/)}var C=s(0),T=s(421);r.c=d,r.d=function(S){return'string'==typeof S&&(S=w(S)),S.map((E)=>'string'==typeof E?d(E):E).reduce((E,O)=>O+E,0)},r.a=function(S){const E=w(S);return T.a.mac&&'ctrl'==E[0].toLowerCase()?'\u2318'+(E[1]||''):S};/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */const P=function(){const S={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,esc:27,tab:9,ctrl:1114112,cmd:1114112,shift:2228224,alt:4456448};for(let E=65;90>=E;E++){const O=String.fromCharCode(E);S[O.toLowerCase()]=E}for(let E=48;57>=E;E++)S[E-48]=E;for(let E=112;123>=E;E++)S['f'+(E-111)]=E;return S}();r.b=P},function(o,r,s){'use strict';function d(h,w,C,T,P){var S=-1,E=h.length;for(C||(C=f.a),P||(P=[]);++SP?0:P,T}getLastMatchingPosition(C,T={}){T.startPosition=this;const P=new d.a(T);return P.skip(C),P.position}getAncestors(){return this.parent.is('documentFragment')?[this.parent]:this.parent.getAncestors({includeNode:!0})}isEqual(C){return this.parent==C.parent&&this.offset==C.offset}isBefore(C){return'before'==this.compareWith(C)}isAfter(C){return'after'==this.compareWith(C)}compareWith(C){if(this.isEqual(C))return'same';if(this.parent===C.parent)return 0>this.offset-C.offset?'before':'after';const T=this.getAncestors(),P=C.getAncestors(),S=s.i(u.a)(T,P);let E;switch(S){case 0:return'different';case'prefix':E=T.length-1;break;case'extension':E=P.length-1;break;default:E=S-1;}const O=T[E],V=T[E+1],R=P[E+1];if(O===this.parent){const N=this.offset-R.index;return 0>=N?'before':'after'}if(O===C.parent){const N=V.index-C.offset;return 0>N?'before':'after'}const F=V.index-R.index;return 0>F?'before':'after'}static createAt(C,T){if(C instanceof w)return this.createFromPosition(C);let P=C;if('end'==T)T=P.is('text')?P.data.length:P.childCount;else{if('before'==T)return this.createBefore(P);if('after'==T)return this.createAfter(P);T||(T=0)}return new w(P,T)}static createAfter(C){if(C.is('textProxy'))return new w(C.textNode,C.offsetInText+C.data.length);if(!C.parent)throw new f.a('view-position-after-root: You can not make position after root.',{root:C});return new w(C.parent,C.index+1)}static createBefore(C){if(C.is('textProxy'))return new w(C.textNode,C.offsetInText);if(!C.parent)throw new f.a('view-position-before-root: You can not make position before root.',{root:C});return new w(C.parent,C.index)}static createFromPosition(C){return new this(C.parent,C.offset)}}r.a=w},function(o,r,s){'use strict';var d=s(9),u=s(6),f=s(397),h=s(22);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class w extends d.a{constructor(C){super(C),this.set('label'),this.set('keystroke'),this.set('tooltip'),this.set('type','button'),this.set('isOn',!1),this.set('isEnabled',!0),this.set('withText',!1),this.set('icon'),this.set('tabindex',-1),this.bind('_tooltipString').to(this,'tooltip',this,'label',this,'keystroke',this._getTooltipString.bind(this));const T=this.bindTemplate;this.template=new u.a({tag:'button',attributes:{class:['ck-button',T.if('_tooltipString','ck-tooltip_s'),T.to('isEnabled',(P)=>P?'ck-enabled':'ck-disabled'),T.to('isOn',(P)=>P?'ck-on':'ck-off'),T.if('withText','ck-button_with-text')],type:T.to('type',(P)=>P?P:'button'),'data-ck-tooltip':[T.to('_tooltipString')],tabindex:T.to('tabindex')},children:[{tag:'span',attributes:{class:['ck-button__label']},children:[{text:T.to('label')}]}],on:{mousedown:T.to((P)=>{P.preventDefault()}),click:T.to((P)=>{this.isEnabled?this.fire('execute'):P.preventDefault()})}})}init(){let C=Promise.resolve();if(this.icon&&!this.iconView){const T=this.iconView=new f.a;T.bind('content').to(this,'icon'),this.element.insertBefore(T.element,this.element.firstChild),C=C.then(()=>this.addChildren(T))}return C.then(()=>super.init())}focus(){this.element.focus()}_getTooltipString(C,T,P){if(C){if('string'==typeof C)return C;if(P&&(P=s.i(h.a)(P)),C instanceof Function)return C(T,P);if(!0===C)return`${T}${P?` (${P})`:''}`}return!1}}r.a=w},function(o,r){'use strict';r.a=function(u,f){for(var h=-1,w=u.length,C=Array(w);++hP.maxOffset)throw new h.a('move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.');else if(P===S&&E=E&&this.targetPosition.path[R]{if(z.attrs.length&&z.attrs.length!==q)throw new E.a('observable-bind-to-attrs-length: The number of attributes must match.');z.attrs.length||(z.attrs=this._bindAttrs)}),this._to=L.to,L.callback&&(this._bindings.get(D[0]).callback=L.callback),P(this._observable,this._to),C(this),this._bindAttrs.forEach((z)=>{T(this._observable,z)})}function f(I){return I.every((L)=>'string'==typeof L)}function h(...I){if(!I.length)throw new E.a('observable-bind-to-parse-error: Invalid argument syntax in `to()`.');const L={to:[]};let D;return'function'==typeof I[I.length-1]&&(L.callback=I.pop()),I.forEach((q)=>{if('string'==typeof q)D.attrs.push(q);else if('object'==typeof q)D={observable:q,attrs:[]},L.to.push(D);else throw new E.a('observable-bind-to-parse-error: Invalid argument syntax in `to()`.')}),L}function w(I,L,D,q){const z=I[F],$=z.get(D),K=$||{};K[q]||(K[q]=new Set),K[q].add(L),$||z.set(D,K)}function C(I){let L;I._bindings.forEach((D,q)=>{I._to.forEach((z)=>{L=z.attrs[D.callback?0:I._bindAttrs.indexOf(q)],D.to.push([z.observable,L]),w(I._observable,D,z.observable,L)})})}function T(I,L){const D=I[N],q=D.get(L);let z;q.callback?z=q.callback.apply(I,q.to.map(($)=>$[0][$[1]])):(z=q.to[0],z=z[0][z[1]]),I.hasOwnProperty(L)?I[L]=z:I.set(L,z)}function P(I,L){L.forEach((D)=>{const q=I[F];let z;q.get(D.observable)||I.listenTo(D.observable,'change',($,K)=>{z=q.get(D.observable)[K],z&&z.forEach((H)=>{T(I,H.attr)})})})}var S=s(7),E=s(0),O=s(57),V=s(15);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */const R=Symbol('attributes'),F=Symbol('boundObservables'),N=Symbol('boundAttributes'),M={set(I,L){if(s.i(V.a)(I))return void Object.keys(I).forEach((q)=>{this.set(q,I[q])},this);d(this);const D=this[R];if(I in this&&!D.has(I))throw new E.a('observable-set-cannot-override: Cannot override an existing property.');Object.defineProperty(this,I,{enumerable:!0,configurable:!0,get(){return D.get(I)},set(q){const z=D.get(I);z===q&&D.has(I)||(D.set(I,q),this.fire('change:'+I,I,q,z))}}),this[I]=L},bind(...I){if(!I.length||!f(I))throw new E.a('observable-bind-wrong-attrs: All attributes must be strings.');if(new Set(I).size!==I.length)throw new E.a('observable-bind-duplicate-attrs: Attributes must be unique.');d(this);const L=this[N];I.forEach((q)=>{if(L.has(q))throw new E.a('observable-bind-rebind: Cannot bind the same attribute more that once.')});const D=new Map;return I.forEach((q)=>{const z={attr:q,to:[]};L.set(q,z),D.set(q,z)}),{to:u,_observable:this,_bindAttrs:I,_to:[],_bindings:D}},unbind(...I){if(!(R in this))return;const L=this[N],D=this[F];if(I.length){if(!f(I))throw new E.a('observable-unbind-wrong-attrs: Attributes must be strings.');I.forEach((q)=>{const z=L.get(q);let $,K,H,U;z.to.forEach((W)=>{$=W[0],K=W[1],H=D.get($),U=H[K],U.delete(z),U.size||delete H[K],Object.keys(H).length||(D.delete($),this.stopListening($,'change'))}),L.delete(q)})}else D.forEach((q,z)=>{this.stopListening(z,'change')}),D.clear(),L.clear()}};r.a=M,s.i(O.a)(M,S.a)},function(o,r,s){'use strict';var d=s(95);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class u{constructor(f){this.baseVersion=f}toJSON(){const f=s.i(d.a)(this,!0);return f.__className=this.constructor.className,delete f.delta,f}static get className(){return'engine.model.operation.Operation'}static fromJSON(f){return new this(f.baseVersion)}}r.a=u},function(o,r,s){'use strict';function d(P,S,E,O,V){return{done:!1,value:{type:P,item:S,previousPosition:E,nextPosition:O,length:V}}}var u=s(24),f=s(61),h=s(5),w=s(1),C=s(0);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class T{constructor(P={}){if(!P.boundaries&&!P.startPosition)throw new C.a('model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.');const S=P.direction||'forward';if('forward'!=S&&'backward'!=S)throw new C.a('model-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.',{direction:S});this.direction=S,this.boundaries=P.boundaries||null,this.position=P.startPosition?w.a.createFromPosition(P.startPosition):w.a.createFromPosition(this.boundaries['backward'==this.direction?'end':'start']),this.singleCharacters=!!P.singleCharacters,this.shallow=!!P.shallow,this.ignoreElementEnd=!!P.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(P){let S,E,O,V;do O=this.position,V=this._visitedParent,({done:S,value:E}=this.next());while(!S&&P(E));S||(this.position=O,this._visitedParent=V)}next(){return'forward'==this.direction?this._next():this._previous()}_next(){const P=this.position,S=w.a.createFromPosition(this.position),E=this._visitedParent;if(null===E.parent&&S.offset===E.maxOffset)return{done:!0};if(E===this._boundaryEndParent&&S.offset==this.boundaries.end.offset)return{done:!0};const O=S.textNode?S.textNode:S.nodeAfter;if(O instanceof h.a)return this.shallow?S.offset++:(S.path.push(0),this._visitedParent=O),this.position=S,d('elementStart',O,P,S,1);if(O instanceof u.a){let V,R;if(this.singleCharacters)V=1;else{let N=O.endOffset;this._boundaryEndParent==E&&this.boundaries.end.offsetN&&(N=this.boundaries.start.offset),V=S.offset-N}R=S.offset-O.startOffset;const F=new f.a(O,R-V,V);return S.offset-=V,this.position=S,d('text',F,P,S,V)}return S.path.pop(),this.position=S,this._visitedParent=E.parent,d('elementStart',E,P,S,1)}}r.a=T},function(o,r){'use strict';r.a=function(u,f,h){var w=-1,C=u.length;0>f&&(f=-f>C?0:C+f),h=h>C?C:h,0>h&&(h+=C),C=f>h?0:h-f>>>0,f>>>=0;for(var T=Array(C);++wE.clone(!0)));return new P(this.position,S,this.baseVersion)}getReversed(){return new h.a(this.position,this.nodes.maxOffset,this.baseVersion+1)}_execute(){const S=this.nodes;this.nodes=new f.a([...S].map((O)=>O.clone(!0)));const E=w.a.insert(this.position,S);return{range:E}}static get className(){return'engine.model.operation.InsertOperation'}static fromJSON(S,E){let O=[];for(let V of S.nodes)V.name?O.push(T.a.fromJSON(V)):O.push(C.a.fromJSON(V));return new P(u.a.fromJSON(S.position,E),O,S.baseVersion)}}r.a=P},function(o,r,s){'use strict';var d=s(28),u=s(1),f=s(5),h=s(112);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class w extends d.a{constructor(C,T,P){const S=C.root.document.graveyard,E=new u.a(S,[S.maxOffset,0]);super(C,T,E,P)}get type(){return'remove'}get _holderElementOffset(){return this.targetPosition.path[0]}set _holderElementOffset(C){this.targetPosition.path[0]=C}get _needsHolderElement(){if(this.delta)for(let C of this.delta.operations)if(C instanceof w){if(C==this)return!0;if(C._holderElementOffset==this._holderElementOffset)return!1}return!0}getReversed(){return new h.a(this.targetPosition,this.howMany,this.sourcePosition,this.baseVersion+1)}clone(){let C=new w(this.sourcePosition,this.howMany,this.baseVersion);return C.targetPosition=u.a.createFromPosition(this.targetPosition),C}_execute(){if(this._needsHolderElement){const C=this.targetPosition.root,T=new f.a('$graveyardHolder');C.insertChildren(this._holderElementOffset,T),this.sourcePosition.root==C&&this.sourcePosition.path[0]>=this._holderElementOffset&&this.sourcePosition.path[0]++}return super._execute()}static get className(){return'engine.model.operation.RemoveOperation'}static fromJSON(C,T){let P=u.a.fromJSON(C.sourcePosition,T);const S=new w(P,C.howMany,C.baseVersion);return S.targetPosition=u.a.fromJSON(C.targetPosition,T),S}}r.a=w},function(o,r,s){'use strict';function d(){return 0===this.childCount?0:null}var u=s(21);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends u.a{constructor(h,w,C){super(h,w,C),this.getFillerOffset=d}is(h,w=null){return w?'containerElement'==h&&w==this.name||super.is(h,w):'containerElement'==h||super.is(h)}}r.a=f},function(o,r,s){'use strict';var h=s(118),w=s(5);r.c=function(T,P){return T.setCustomProperty(C,!0),s.i(h.a)(T,{label:function(){const E=T.getChild(0),O=E.getAttribute('alt');return O?`${O} ${P}`:P}})},r.a=function(T){return!!T.getCustomProperty(C)&&s.i(h.b)(T)},r.b=function(T){return T instanceof w.a&&'image'==T.name};/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */const C=Symbol('isImage')},function(o,r){'use strict';r.a=/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function(u){return!!(u&&u[Symbol.iterator])}},function(o,r,s){'use strict';var u=s(82),f=s(125),h=s(126),w=s(136),C=s(462),T=s(94);r.a=function(S,E,O){var V=-1,R=f.a,F=S.length,N=!0,M=[],I=M;if(O)N=!1,R=h.a;else if(F>=200){var L=E?null:s.i(C.a)(S);if(L)return s.i(T.a)(L);N=!1,R=w.a,I=new u.a}else I=E?[]:M;outer:for(;++V{let I=V.matcher.matchAll(F.input);if(I)for(let L of I){const D=E instanceof Function?E(F.input):new h.a(E),q=Array.from(D.getAttributeKeys());if(!M.schema.check({name:D.name,attributes:q,inside:F.context}))continue;if(!N.consume(F.input,V.consume||L.match))continue;F.context.push(D);const z=M.convertChildren(F.input,N,F),$=w.a.createAt(D,'end');C.a.insert($,z),F.context.pop(),F.output=D;break}}},'normal')}toAttribute(E,O){this._setCallback(function(R){return(F,N,M,I)=>{let L=R.matcher.matchAll(N.input);if(L)for(let D of L){if(!M.consume(N.input,R.consume||D.match))continue;N.output||(N.output=I.convertChildren(N.input,M,N));let q=E instanceof Function?E(N.input):{key:E,value:O};d(N.output,q,N,I);break}}},'low')}toMarker(E){this._setCallback(function(V){return(R,F,N)=>{const M=V.matcher.matchAll(F.input);if(!M)return;let I;if(I=E instanceof Function?E(F.input):new h.a('$marker',{'data-name':F.input.getAttribute('data-name')}),'$marker'!=I.name||'string'!=typeof I.getAttribute('data-name'))throw new T.a('build-view-converter-invalid-marker: Invalid model element to mark marker range.');for(const L of M)if(N.consume(F.input,V.consume||L.match)){F.output=I;break}}},'normal')}_setCallback(E,O){for(let V of this._from){const R=V.matcher.getElementName(),F=R?'element:'+R:'element',N=E(V),M=null===V.priority?O:V.priority;for(let I of this._dispatchers)I.on(F,N,{priority:M})}}}},function(o,r,s){'use strict';function d(T){return'string'==typeof T?[new h.a(T)]:(s.i(w.a)(T)||(T=[T]),Array.from(T).map((P)=>'string'==typeof P?new h.a(P):P))}var u=s(72),f=s(5),h=s(24),w=s(41);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class C{constructor(T){this.markers=new Map,this._children=new u.a,T&&this.insertChildren(0,T)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(T){return'documentFragment'==T}getChild(T){return this._children.getNode(T)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(T){return this._children.getNodeIndex(T)}getChildStartOffset(T){return this._children.getNodeStartOffset(T)}getPath(){return[]}offsetToIndex(T){return this._children.offsetToIndex(T)}appendChildren(T){this.insertChildren(this.childCount,T)}insertChildren(T,P){P=d(P);for(let S of P)S.parent=this;this._children.insertNodes(T,P)}removeChildren(T,P=1){const S=this._children.removeNodes(T,P);for(let E of S)E.parent=null;return S}toJSON(){let T=[];for(let P of this._children)T.push(P.toJSON());return T}static fromJSON(T){let P=[];for(let S of T)S.name?P.push(f.a.fromJSON(S)):P.push(h.a.fromJSON(S));return new C(P)}}r.a=C},function(o,r,s){'use strict';var d=s(80),u=s(4);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f{constructor(h){this.document=h,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}}r.a=f,s.i(u.a)(f,d.a)},function(o,r,s){'use strict';var d=s(21),u=s(30),f=s(358),h=s(25),w=s(0);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class C{constructor(T={}){if(!T.boundaries&&!T.startPosition)throw new w.a('view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.');if(T.direction&&'forward'!=T.direction&&'backward'!=T.direction)throw new w.a('view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.',{direction:T.direction});this.boundaries=T.boundaries||null,this.position=T.startPosition?h.a.createFromPosition(T.startPosition):h.a.createFromPosition(T.boundaries['backward'==T.direction?'end':'start']),this.direction=T.direction||'forward',this.singleCharacters=!!T.singleCharacters,this.shallow=!!T.shallow,this.ignoreElementEnd=!!T.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(T){let P,S,E;do E=this.position,({done:P,value:S}=this.next());while(!P&&T(S));P||(this.position=E)}next(){return'forward'==this.direction?this._next():this._previous()}_next(){let T=h.a.createFromPosition(this.position);const P=this.position,S=T.parent;if(null===S.parent&&T.offset===S.childCount)return{done:!0};if(S===this._boundaryEndParent&&T.offset==this.boundaries.end.offset)return{done:!0};let E;if(S instanceof u.a){if(T.isAtEnd)return this.position=h.a.createAfter(S),this._next();E=S.data[T.offset]}else E=S.getChild(T.offset);if(E instanceof d.a)return this.shallow?T.offset++:T=new h.a(E,0),this.position=T,this._formatReturnValue('elementStart',E,P,T,1);if(E instanceof u.a){if(this.singleCharacters)return T=new h.a(E,0),this.position=T,this._next();let O=E.data.length,V=E;return E==this._boundaryEndParent?(O=this.boundaries.end.offset,V=new f.a(E,0,O),T=h.a.createAfter(V)):T.offset++,this.position=T,this._formatReturnValue('text',V,P,T,O)}if('string'==typeof E){let O;if(this.singleCharacters)O=1;else{const R=S===this._boundaryEndParent?this.boundaries.end.offset:S.data.length;O=R-T.offset}const V=new f.a(S,T.offset,O);return T.offset+=O,this.position=T,this._formatReturnValue('text',V,P,T,O)}return T=h.a.createAfter(S),this.position=T,this.ignoreElementEnd?this._next():this._formatReturnValue('elementEnd',S,P,T)}_previous(){let T=h.a.createFromPosition(this.position);const P=this.position,S=T.parent;if(null===S.parent&&0===T.offset)return{done:!0};if(S==this._boundaryStartParent&&T.offset==this.boundaries.start.offset)return{done:!0};let E;if(S instanceof u.a){if(T.isAtStart)return this.position=h.a.createBefore(S),this._previous();E=S.data[T.offset-1]}else E=S.getChild(T.offset-1);if(E instanceof d.a)return this.shallow?(T.offset--,this.position=T,this._formatReturnValue('elementStart',E,P,T,1)):(T=new h.a(E,E.childCount),this.position=T,this.ignoreElementEnd?this._previous():this._formatReturnValue('elementEnd',E,P,T));if(E instanceof u.a){if(this.singleCharacters)return T=new h.a(E,E.data.length),this.position=T,this._previous();let O=E.data.length,V=E;if(E==this._boundaryStartParent){const R=this.boundaries.start.offset;V=new f.a(E,R,E.data.length-R),O=V.data.length,T=h.a.createBefore(V)}else T.offset--;return this.position=T,this._formatReturnValue('text',V,P,T,O)}if('string'==typeof E){let O;if(!this.singleCharacters){const R=S===this._boundaryStartParent?this.boundaries.start.offset:0;O=T.offset-R}else O=1;T.offset-=O;const V=new f.a(S,T.offset,O);return this.position=T,this._formatReturnValue('text',V,P,T,O)}return T=h.a.createBefore(S),this.position=T,this._formatReturnValue('elementStart',S,P,T,1)}_formatReturnValue(T,P,S,E,O){return P instanceof f.a&&(P.offsetInText+P.data.length==P.textNode.data.length&&('forward'!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?S=h.a.createAfter(P.textNode):(E=h.a.createAfter(P.textNode),this.position=E)),0===P.offsetInText&&('backward'!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?S=h.a.createBefore(P.textNode):(E=h.a.createBefore(P.textNode),this.position=E))),{done:!1,value:{type:T,item:P,previousPosition:S,nextPosition:E,length:O}}}}r.a=C},function(o,r){'use strict';r.a=/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function(u,f){const h=_Mathmin(u.length,f.length);for(let w=0;wd(M,R));return F.forEach((M)=>R.add(M)),N}var f=s(1),h=s(5),w=s(2),C=s(7),T=s(0),P=s(4),S=s(152),E=s(522);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class O{constructor(){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map}get anchor(){if(0{if(!(N instanceof w.a))throw new T.a('model-selection-added-not-range: Trying to add an object that is not an instance of Range.');return this._ranges.every((M)=>{return!M.isEqual(N)})});if(V.length!==this._ranges.length||F){this._removeAllRanges();for(let N of V)this._pushRange(N);this._lastRangeBackward=!!R,this.fire('change:range',{directChange:!0})}}setTo(V){this.setRanges(V.getRanges(),V.isBackward)}collapse(V,R){const F=f.a.createAt(V,R),N=new w.a(F,F);this.setRanges([N])}collapseToStart(){const V=this.getFirstPosition();null!==V&&this.setRanges([new w.a(V,V)])}collapseToEnd(){const V=this.getLastPosition();null!==V&&this.setRanges([new w.a(V,V)])}setFocus(V,R){if(null===this.anchor)throw new T.a('model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.');const F=f.a.createAt(V,R);if('same'!=F.compareWith(this.focus)){const N=this.anchor;this._ranges.length&&this._popRange(),'before'==F.compareWith(N)?this.addRange(new w.a(F,N),!0):this.addRange(new w.a(N,F))}}getAttribute(V){return this._attrs.get(V)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(V){return this._attrs.has(V)}clearAttributes(){if(0h||h>f.offsetSize)throw new d.a('model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.');if(0>w||h+w>f.offsetSize)throw new d.a('model-textproxy-wrong-length: Given length value is incorrect.');this.data=f.data.substring(h,h+w),this.offsetInText=h}get startOffset(){return null===this.textNode.startOffset?null:this.textNode.startOffset+this.offsetInText}get offsetSize(){return this.data.length}get endOffset(){return null===this.startOffset?null:this.startOffset+this.offsetSize}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(f){return'textProxy'==f}getPath(){const f=this.textNode.getPath();return 0{const F=R.createElement('br');return F.dataset.ckeFiller=!0,F};r.a=(R)=>R.createTextNode('\xA0');const E=7;r.d=E;let O='';for(let R=0;R{this.listenTo(h,C,(T,P)=>{this.isEnabled&&this.onDomEvent(P)},{useCapture:this.useCapture})})}fire(h,w,C){this.isEnabled&&this.document.fire(h,new u.a(this.document,w,C))}}r.a=f},function(o,r){'use strict';/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a={window,document}},function(o,r,s){'use strict';var d=s(80),u=s(32),f=s(0),h=s(4);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class w{constructor(){this.set('isFocused',!1),this.focusedElement=null,this._elements=new Set,this._nextEventLoopTimeout=null}add(C){if(this._elements.has(C))throw new f.a('focusTracker-add-element-already-exist');this.listenTo(C,'focus',()=>this._focus(C),{useCapture:!0}),this.listenTo(C,'blur',()=>this._blur(),{useCapture:!0}),this._elements.add(C)}remove(C){C===this.focusedElement&&this._blur(C),this._elements.has(C)&&(this.stopListening(C),this._elements.delete(C))}_focus(C){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=C,this.isFocused=!0}_blur(){this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}r.a=w,s.i(h.a)(w,d.a),s.i(h.a)(w,u.a)},function(o,r,s){'use strict';var d=s(80),u=s(22);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=class{constructor(){this._listener=Object.create(d.a),this._keystrokes=new Map}listenTo(h){this._listener.listenTo(h,'keydown',(w,C)=>{this.press(C)})}set(h,w){const C=s.i(u.d)(h),T=this._keystrokes.get(C);T?T.push(w):this._keystrokes.set(C,[w])}press(h){const w=s.i(u.c)(h),C=this._keystrokes.get(w);if(!C)return!1;for(let T of C)T(h,()=>{h.preventDefault(),h.stopPropagation()});return!0}destroy(){this._keystrokes=new Map,this._listener.stopListening()}}},function(o,r,s){'use strict';var u=s(56),f=Object.prototype,h=f.hasOwnProperty;r.a=function(w,C,T){var P=w[C];h.call(w,C)&&s.i(u.a)(P,T)&&(T!==void 0||C in w)||(w[C]=T)}},function(o,r,s){'use strict';var u=s(82),f=s(125),h=s(126),w=s(27),C=s(134),T=s(136);r.a=function(S,E,O,V){var R=-1,F=f.a,N=!0,M=S.length,I=[],L=E.length;if(!M)return I;O&&(E=s.i(w.a)(E,s.i(C.a)(O))),V?(F=h.a,N=!1):E.length>=200&&(F=T.a,N=!1,E=new u.a(E));outer:for(;++Rf;f++)u+=_Mathfloor(65536*(1+Math.random())).toString(16).substring(1);return u}},function(o,r,s){'use strict';function d(L,D,q,z,$){if(z.test(q.input)&&L.schema.check({name:'paragraph',inside:q.context})){const K=new T.a('paragraph');I.add(K),q.context.push(K);const H=$.convertItem(q.input,z,q);H&&(q.output=K,K.appendChildren(H)),q.context.pop()}}function u(L,D,q,z,$){if(M.paragraphLikeElements.has(q.input.name)&&z.test(q.input,{name:!0})&&!h(q.input)&&L.schema.check({name:'paragraph',inside:q.context})){z.consume(q.input,{name:!0});const K=new T.a('paragraph');q.context.push(K);const H=$.convertChildren(q.input,z,q);K.appendChildren(V.a.normalizeNodes(H)),q.context.pop(),q.output=K}}function f(L,D){if(!D.output)return;let q;for(q=s.i(N.a)(D.output)?D.output[0]:D.output.getChild(0);q&&q.nextSibling;){const z=q.nextSibling;I.has(q)&&I.has(z)?(V.a.insert(P.a.createAt(q,'end'),Array.from(z.getChildren())),V.a.remove(S.a.createOn(z))):q=q.nextSibling}}function h(L){const D=O.a.createIn(L);for(const q of D)if(q.item instanceof E.a&&M.paragraphLikeElements.has(q.item.name))return!0;return!1}var w=s(381),C=s(3),T=s(5),P=s(1),S=s(2),E=s(21),O=s(29),V=s(13),R=s(47),F=s(48),N=s(11);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class M extends C.a{init(){const L=this.editor,D=L.document,q=L.data,z=L.editing;D.schema.registerItem('paragraph','$block'),s.i(R.a)().for(q.modelToView,z.modelToView).fromElement('paragraph').toElement('p'),s.i(F.a)().for(q.viewToModel).fromElement('p').toElement('paragraph'),q.viewToModel.on('text',($,K,H,U)=>{d(D,$,K,H,U)},{priority:'lowest'}),q.viewToModel.on('element',f,{priority:'lowest'}),q.viewToModel.on('documentFragment',f,{priority:'lowest'}),q.viewToModel.on('element',($,K,H,U)=>{u(D,$,K,H,U)},{priority:'low'}),L.commands.set('paragraph',new w.a(L))}}r.a=M,M.paragraphLikeElements=new Set(['blockquote','dd','div','dt','h1','h2','h3','h4','h5','h6','li','p','td']);const I=new WeakSet},function(o,r,s){'use strict';var d=s(59),u=s(0);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f{constructor(h){this._nodes=[],h&&this.insertNodes(0,h)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((h,w)=>h+w.offsetSize,0)}getNode(h){return this._nodes[h]||null}getNodeIndex(h){const w=this._nodes.indexOf(h);return-1==w?null:w}getNodeStartOffset(h){const w=this.getNodeIndex(h);return null===w?null:this._nodes.slice(0,w).reduce((C,T)=>C+T.offsetSize,0)}indexToOffset(h){if(h==this._nodes.length)return this.maxOffset;const w=this._nodes[h];if(!w)throw new u.a('model-nodelist-index-out-of-bounds: Given index cannot be found in the node list.');return this.getNodeStartOffset(w)}offsetToIndex(h){let w=0;for(let C of this._nodes){if(h>=w&&hh.toJSON())}}r.a=f},function(o,r,s){'use strict';var d=s(33),u=s(2),f=s(0),h=s(13),w=s(509);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class C extends d.a{constructor(T,P,S,E,O){super(O),this.range=u.a.createFromRange(T),this.key=P,this.oldValue=S===void 0?null:S,this.newValue=E===void 0?null:E}get type(){return null===this.oldValue?'addAttribute':null===this.newValue?'removeAttribute':'changeAttribute'}clone(){return new C(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new C(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_execute(){for(let T of this.range.getItems()){if(null!==this.oldValue&&!s.i(w.a)(T.getAttribute(this.key),this.oldValue))throw new f.a('attribute-operation-wrong-old-value: Changed node has different attribute value than operation\'s old attribute value.',{item:T,key:this.key,value:this.oldValue});if(null===this.oldValue&&null!==this.newValue&&T.hasAttribute(this.key))throw new f.a('attribute-operation-attribute-exists: The attribute with given key already exists.',{node:T,key:this.key});if(s.i(w.a)(this.oldValue,this.newValue))return}return h.a.setAttribute(this.range,this.key,this.newValue),{range:this.range,key:this.key,oldValue:this.oldValue,newValue:this.newValue}}static get className(){return'engine.model.operation.AttributeOperation'}static fromJSON(T,P){return new C(u.a.fromJSON(T.range,P),T.key,T.oldValue,T.newValue,T.baseVersion)}}r.a=C},function(o,r,s){'use strict';var d=s(33);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class u extends d.a{clone(){return new u(this.baseVersion)}getReversed(){return new u(this.baseVersion+1)}_execute(){}static get className(){return'engine.model.operation.NoOperation'}}r.a=u},function(o,r,s){'use strict';var d=s(39),u=s(0),f=s(4),h=s(32);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */const w=Symbol('document');class C extends d.a{constructor(T,P,S){super(T,P,S),this.set('isReadOnly',!1),this.set('isFocused',!1)}get document(){return this.getCustomProperty(w)}set document(T){if(this.getCustomProperty(w))throw new u.a('view-editableelement-document-already-set: View document is already set.');this.setCustomProperty(w,T),this.bind('isFocused').to(T,'isFocused',(P)=>P&&T.selection.editableElement==this),this.listenTo(T,'render',()=>{this.isFocused=T.isFocused&&T.selection.editableElement==this},{priority:'high'})}}r.a=C,s.i(f.a)(C,h.a)},function(o,r,s){'use strict';var d=s(0),u=s(7),f=s(4);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class h{constructor(){this.parent=null}get index(){let w;if(!this.parent)return null;if(-1==(w=this.parent.getChildIndex(this)))throw new d.a('view-node-not-found-in-parent: The node\'s parent does not contain this node.');return w}get nextSibling(){const w=this.index;return null!==w&&this.parent.getChild(w+1)||null}get previousSibling(){const w=this.index;return null!==w&&this.parent.getChild(w-1)||null}get root(){let w=this;for(;w.parent;)w=w.parent;return w}get document(){return this.parent instanceof h?this.parent.document:null}getAncestors(w={includeNode:!1,parentFirst:!1}){const C=[];for(let T=w.includeNode?this:this.parent;T;)C[w.parentFirst?'push':'unshift'](T),T=T.parent;return C}remove(){this.parent.removeChildren(this.index)}_fireChange(w,C){this.fire('change:'+w,C),this.parent&&this.parent._fireChange(w,C)}}r.a=h,s.i(f.a)(h,u.a)},function(o,r,s){'use strict';var d=s(0),u=s(29),f=s(25),h=s(4),w=s(7),C=s(21);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class T{constructor(){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel=''}setFake(P=!0,S={}){this._isFake=P,this._fakeSelectionLabel=P?S.label||'':'',this.fire('change')}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const P=this._ranges[this._ranges.length-1],S=this._lastRangeBackward?P.end:P.start;return f.a.createFromPosition(S)}get focus(){if(!this._ranges.length)return null;const P=this._ranges[this._ranges.length-1],S=this._lastRangeBackward?P.start:P.end;return f.a.createFromPosition(S)}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}addRange(P,S){if(!(P instanceof u.a))throw new d.a('view-selection-invalid-range: Invalid Range.');this._pushRange(P),this._lastRangeBackward=!!S,this.fire('change')}*getRanges(){for(let P of this._ranges)yield u.a.createFromRange(P)}getFirstRange(){let P=null;for(let S of this._ranges)(!P||S.start.isBefore(P.start))&&(P=S);return P?u.a.createFromRange(P):null}getLastRange(){let P=null;for(let S of this._ranges)(!P||S.end.isAfter(P.end))&&(P=S);return P?u.a.createFromRange(P):null}getFirstPosition(){const P=this.getFirstRange();return P?f.a.createFromPosition(P.start):null}getLastPosition(){const P=this.getLastRange();return P?f.a.createFromPosition(P.end):null}isEqual(P){if(this.isFake!=P.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=P.fakeSelectionLabel)return!1;if(this.rangeCount!=P.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(P.anchor)||!this.focus.isEqual(P.focus))return!1;for(let S of this._ranges){let E=!1;for(let O of P._ranges)if(S.isEqual(O)){E=!0;break}if(!E)return!1}return!0}removeAllRanges(){this._ranges.length&&(this._ranges=[],this.fire('change'))}setRanges(P,S){this._ranges=[];for(let E of P){if(!(E instanceof u.a))throw new d.a('view-selection-invalid-range: Invalid Range.');this._pushRange(E)}this._lastRangeBackward=!!S,this.fire('change')}setTo(P){this._isFake=P._isFake,this._fakeSelectionLabel=P._fakeSelectionLabel,this.setRanges(P.getRanges(),P.isBackward)}collapse(P,S){const E=f.a.createAt(P,S),O=new u.a(E,E);this.setRanges([O])}collapseToStart(){const P=this.getFirstPosition();null!==P&&this.setRanges([new u.a(P,P)])}collapseToEnd(){const P=this.getLastPosition();null!==P&&this.setRanges([new u.a(P,P)])}setFocus(P,S){if(null===this.anchor)throw new d.a('view-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.');const E=f.a.createAt(P,S);if('same'!=E.compareWith(this.focus)){const O=this.anchor;this._ranges.pop(),'before'==E.compareWith(O)?this.addRange(new u.a(E,O),!0):this.addRange(new u.a(O,E))}}getSelectedElement(){if(1!==this.rangeCount)return null;const P=this.getFirstRange(),S=P.start.nodeAfter,E=P.end.nodeBefore;return S instanceof C.a&&S==E?S:null}static createFromSelection(P){const S=new T;return S.setTo(P),S}_pushRange(P){for(let S of this._ranges)if(P.isIntersecting(S))throw new d.a('view-selection-range-intersects: Trying to add a range that intersects with another range from selection.',{addedRange:P,intersectingRange:S});this._ranges.push(u.a.createFromRange(P))}}r.a=T,s.i(h.a)(T,w.a)},function(o,r,s){'use strict';function f(le){const de=le.offset,ce=le.parent;if(ce.is('text'))return le;if(ce.is('attributeElement')&&0===ce.childCount){const pe=ce.parent,ge=ce.index;return ce.remove(),f(new G.a(pe,ge))}const ue=ce.getChild(de-1),me=ce.getChild(de);if(!ue||!me)return le;if(ue.is('text')&&me.is('text'))return z(ue,me);if(ue.is('attributeElement')&&me.is('attributeElement')&&ue.isSimilar(me)){const pe=ue.childCount;return ue.appendChildren(me.getChildren()),me.remove(),f(new G.a(ue,pe))}return le}function C(le,de){de=s.i(ie.a)(de)?[...de]:[de],U(de);const ce=F(le);if(!ce)throw new ne.a('view-writer-invalid-position-container');const ue=M(le,!0),me=ce.insertChildren(ue.offset,de),pe=ue.getShiftedBy(me),ge=f(ue);if(0===me)return new te.a(ge,ge);ge.isEqual(ue)||pe.offset--;const fe=f(pe);return new te.a(ge,fe)}function T(le){if(Z(le),le.isCollapsed)return new oe.a;const{start:de,end:ce}=N(le,!0),ue=de.parent,me=ce.offset-de.offset,pe=ue.removeChildren(de.offset,me),ge=f(de);return le.start=ge,le.end=G.a.createFromPosition(ge),new oe.a(pe)}function S(le,de){let ce;if(de.isAfter(le.end)){de=M(de,!0);const ue=de.parent,me=ue.childCount;le=N(le,!0),ce=T(le),de.offset+=ue.childCount-me}else ce=T(le);return C(de,ce)}function E(le,de){if(!(de instanceof Y.a))throw new ne.a('view-writer-wrap-invalid-attribute');if(Z(le),le.isCollapsed)return le;if(le.end.isEqual(le.start.getShiftedBy(1))){const be=le.start.nodeAfter;if(be instanceof Y.a&&$(de,be))return le}if(H(le)&&$(de,le.start.parent)){const be=le.start.parent.parent,_e=le.start.parent.index;return te.a.createFromParentsAndOffsets(be,_e,be,_e+1)}const{start:ce,end:ue}=N(le,!0),me=ce.parent,pe=I(me,ce.offset,ue.offset,de),ge=L(me,pe.start.offset,pe.end.offset,de),fe=f(ge.start);fe.isEqual(ge.start)||ge.end.offset--;const he=f(ge.end);return new te.a(fe,he)}function F(le){let de=le.parent;for(;!W(de);){if(!de)return;de=de.parent}return de}function N(le,de=!1){const ce=le.start,ue=le.end;if(Z(le),le.isCollapsed){const fe=M(le.start,de);return new te.a(fe,fe)}const me=M(ue,de),pe=me.parent.childCount,ge=M(ce,de);return me.offset+=me.parent.childCount-pe,new te.a(ge,me)}function M(le,de=!1){const ce=le.offset,ue=le.parent;if(le.parent.is('emptyElement'))throw new ne.a('view-writer-cannot-break-empty-element');if(le.parent.is('uiElement'))throw new ne.a('view-writer-cannot-break-ui-element');if(!de&&ue.is('text')&&W(ue.parent))return G.a.createFromPosition(le);if(W(ue))return G.a.createFromPosition(le);if(ue.is('text'))return M(q(le),de);const me=ue.childCount;if(ce==me){const pe=new G.a(ue.parent,ue.index+1);return M(pe,de)}if(0===ce){const pe=new G.a(ue.parent,ue.index);return M(pe,de)}const pe=ue.index+1,ge=ue.clone();ue.parent.insertChildren(pe,ge);const fe=ue.childCount-ce,he=ue.removeChildren(ce,fe);ge.appendChildren(he);const be=new G.a(ue.parent,pe);return M(be,de)}function I(le,de,ce,ue){let me=de;const pe=[];for(;mede instanceof ce))throw new ne.a('view-writer-insert-invalid-node');de.is('text')||U(de.getChildren())}}function W(le){return le&&(le.is('containerElement')||le.is('documentFragment'))}function Z(le){const de=F(le.start),ce=F(le.end);if(!de||!ce||de!==ce)throw new ne.a('view-writer-invalid-range-container')}var G=s(25),J=s(39),Y=s(115),X=s(168),Q=s(172),ee=s(30),te=s(29),ae=s(51),ne=s(0),oe=s(116),ie=s(41);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a={breakAttributes:function(le){return le instanceof G.a?M(le):N(le)},breakContainer:function(le){const de=le.parent;if(!de.is('containerElement'))throw new ne.a('view-writer-break-non-container-element: Trying to break an element which is not a container element.');if(!de.parent)throw new ne.a('view-writer-break-root: Trying to break root element.');if(le.isAtStart)return G.a.createBefore(de);if(!le.isAtEnd){const ce=de.clone(!1);C(G.a.createAfter(de),ce);const ue=new te.a(le,G.a.createAt(de,'end')),me=new G.a(ce,0);S(ue,me)}return G.a.createAfter(de)},mergeAttributes:f,mergeContainers:function(le){const de=le.nodeBefore,ce=le.nodeAfter;if(!de||!ce||!de.is('containerElement')||!ce.is('containerElement'))throw new ne.a('view-writer-merge-containers-invalid-position: Element before and after given position cannot be merged.');const ue=de.getChild(de.childCount-1),me=ue instanceof ee.a?G.a.createAt(ue,'end'):G.a.createAt(de,'end');return S(te.a.createIn(ce),G.a.createAt(de,'end')),T(te.a.createOn(ce)),me},insert:C,remove:T,clear:function(le,de){Z(le);const ce=le.getWalker({direction:'backward',ignoreElementEnd:!0});for(const ue of ce){const me=ue.item;let pe;if(me.is('element')&&de.isSimilar(me))pe=te.a.createOn(me);else if(!ue.nextPosition.isAfter(le.start)&&(me.is('text')||me.is('textProxy'))){const ge=me.getAncestors().find((fe)=>{return fe.is('element')&&de.isSimilar(fe)});ge&&(pe=te.a.createIn(ge))}pe&&(pe.end.isAfter(le.end)&&(pe.end=le.end),pe.start.isBefore(le.start)&&(pe.start=le.start),T(pe))}},move:S,wrap:E,wrapPosition:function(le,de){if(!(de instanceof Y.a))throw new ne.a('view-writer-wrap-invalid-attribute');if(de.isSimilar(le.parent))return D(G.a.createFromPosition(le));le.parent.is('text')&&(le=q(le));const ce=new Y.a;ce.priority=_NumberPOSITIVE_INFINITY,ce.isSimilar=()=>!1,le.parent.insertChildren(le.offset,ce);const ue=new te.a(le,le.getShiftedBy(1));E(ue,de);const me=new G.a(ce.parent,ce.index);ce.remove();const pe=me.nodeBefore,ge=me.nodeAfter;return pe instanceof ee.a&&ge instanceof ee.a?z(pe,ge):D(me)},unwrap:function(le,de){if(!(de instanceof Y.a))throw new ne.a('view-writer-unwrap-invalid-attribute');if(Z(le),le.isCollapsed)return le;if(le.end.isEqual(le.start.getShiftedBy(1))){const he=le.start.nodeAfter;if(!de.isSimilar(he)&&he instanceof Y.a&&K(de,he))return le}const{start:ce,end:ue}=N(le,!0),me=ce.parent,pe=I(me,ce.offset,ue.offset,de),ge=f(pe.start);ge.isEqual(pe.start)||pe.end.offset--;const fe=f(pe.end);return new te.a(ge,fe)},rename:function(le,de){const ce=new J.a(de,le.getAttributes());return C(G.a.createAfter(le),ce),S(te.a.createIn(le),G.a.createAt(ce)),T(te.a.createOn(le)),ce},breakViewRangePerContainer:function(le){const de=[],ce=new ae.a({boundaries:le});let ue=le.start;for(let me of ce)me.item.is('containerElement')&&(ue.isEqual(me.previousPosition)||de.push(new te.a(ue,me.previousPosition)),ue=me.nextPosition);return de.push(new te.a(ue,le.end)),de}};const se=[ee.a,Y.a,J.a,X.a,Q.a]},function(o,r,s){'use strict';var d=s(7),u=s(0),f=s(70),h=s(4);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class w{constructor(C){this._items=[],this._itemMap=new Map,this._idProperty=C&&C.idProperty||'id',this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap}get length(){return this._items.length}add(C,T){let P;const S=this._idProperty;if(S in C){if(P=C[S],'string'!=typeof P)throw new u.a('collection-add-invalid-id');if(this.get(P))throw new u.a('collection-add-item-already-exists')}else C[S]=P=s.i(f.a)();if(void 0===T)T=this._items.length;else if(T>this._items.length||0>T)throw new u.a('collection-add-item-invalid-index');return this._items.splice(T,0,C),this._itemMap.set(P,C),this.fire('add',C,T),this}get(C){let T;if('string'==typeof C)T=this._itemMap.get(C);else if('number'==typeof C)T=this._items[C];else throw new u.a('collection-get-invalid-arg: Index or id must be given.');return T||null}getIndex(C){let T;return T='string'==typeof C?this._itemMap.get(C):C,this._items.indexOf(T)}remove(C){let E=!1,T,P,S;const O=this._idProperty;if('string'==typeof C?(P=C,S=this._itemMap.get(P),E=!S,S&&(T=this._items.indexOf(S))):'number'==typeof C?(T=C,S=this._items[T],E=!S,S&&(P=S[O])):(S=C,P=S[O],T=this._items.indexOf(S),E=-1==T||!this._itemMap.get(P)),E)throw new u.a('collection-remove-404: Item not found.');this._items.splice(T,1),this._itemMap.delete(P);const V=this._bindToInternalToExternalMap.get(S);return this._bindToInternalToExternalMap.delete(S),this._bindToExternalToInternalMap.delete(V),this.fire('remove',S),S}map(C,T){return this._items.map(C,T)}find(C,T){return this._items.find(C,T)}filter(C,T){return this._items.filter(C,T)}clear(){for(this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);this.length;)this.remove(0)}bindTo(C){if(this._bindToCollection)throw new u.a('collection-bind-to-rebind: The collection cannot be bound more than once.');return this._bindToCollection=C,{as:(T)=>{this._setUpBindToBinding((P)=>new T(P))},using:(T)=>{'function'==typeof T?this._setUpBindToBinding((P)=>T(P)):this._setUpBindToBinding((P)=>P[T])}}}_setUpBindToBinding(C){const T=this._bindToCollection,P=(S,E,O)=>{const V=T._bindToCollection==this,R=T._bindToInternalToExternalMap.get(E);if(V&&R)this._bindToExternalToInternalMap.set(E,R),this._bindToInternalToExternalMap.set(R,E);else{const F=C(E);this._bindToExternalToInternalMap.set(E,F),this._bindToInternalToExternalMap.set(F,E),this.add(F,O)}};for(let S of T)P(null,S);this.listenTo(T,'add',P),this.listenTo(T,'remove',(S,E)=>{const O=this._bindToExternalToInternalMap.get(E);O&&this.remove(O)})}[Symbol.iterator](){return this._items[Symbol.iterator]()}}r.a=w,s.i(h.a)(w,d.a)},function(o,r,s){'use strict';function d(S){return S['data-ck-expando']||(S['data-ck-expando']=s.i(h.a)())}function u(S){return S&&s.i(C.a)(S.addEventListener)}var f=s(7),h=s(70),w=s(57),C=s(235);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */const T=s.i(w.a)({},f.a,{listenTo(...S){const E=S[0];u(E)&&(S[0]=this._getProxyEmitter(E)||new P(E)),f.a.listenTo.apply(this,S)},stopListening(...S){const E=S[0];if(u(E)){let O=this._getProxyEmitter(E);if(!O)return;S[0]=O}f.a.stopListening.apply(this,S)},_getProxyEmitter(S){return s.i(f.b)(this,d(S))}});r.a=T;class P{constructor(S){s.i(f.c)(this,d(S)),this._domNode=S}}s.i(w.a)(P.prototype,f.a,{on(S,E,O={}){if(f.a.on.apply(this,arguments),!(this._domListeners&&this._domListeners[S])){const V=this._createDomListener(S);this._domNode.addEventListener(S,V,!!O.useCapture),this._domListeners||(this._domListeners={}),this._domListeners[S]=V}},off(S){f.a.off.apply(this,arguments);let E;!this._domListeners[S]||(E=this._events[S])&&E.callbacks.length||this._domListeners[S].removeListener()},_createDomListener(S){const E=(O)=>{this.fire(S,O)};return E.removeListener=()=>{this._domNode.removeEventListener(S,E),delete this._domListeners[S]},E}})},function(o,r,s){'use strict';function d(T){var P=-1,S=T?T.length:0;for(this.clear();++P>>1){for(;E>>1,R=T[V];null!==R&&!s.i(h.a)(R)&&(S?R<=P:R{const H=D instanceof F.a?D.clone(!0):D(z,$,K);if(H&&$.consume(z.item,'insert')){const U=K.mapper.toViewPosition(z.range.start);K.mapper.bindElements(z.item,H),L.a.insert(U,H)}}},r.j=function(){return(D,q,z,$)=>{if(z.consume(q.item,'insert')){const K=$.mapper.toViewPosition(q.range.start),H=new N.a(q.item.data);L.a.insert(K,H)}}},r.f=function(D){return(q,z,$,K)=>{let H,U;if((D instanceof F.a?(H=D.clone(!0),U=D.clone(!0)):(z.isOpening=!0,H=D(z,$,K),z.isOpening=!1,U=D(z,$,K)),H&&U)&&$.consume(z.range,'addMarker')){const W=K.mapper;L.a.insert(W.toViewPosition(z.range.start),H),z.range.isCollapsed||L.a.insert(W.toViewPosition(z.range.end),U)}}},r.h=function(D){return D=D||((q,z)=>({value:q,key:z})),(q,z,$,K)=>{if($.consume(z.item,R(q.name))){const{key:H,value:U}=D(z.attributeNewValue,z.attributeKey,z,$,K);K.mapper.toViewElement(z.item).setAttribute(H,U)}}},r.i=function(D){return D=D||((q,z)=>({key:z})),(q,z,$,K)=>{if($.consume(z.item,R(q.name))){const{key:H}=D(z.attributeOldValue,z.attributeKey,z,$,K);K.mapper.toViewElement(z.item).removeAttribute(H)}}},r.b=function(D){return(q,z,$,K)=>{const H=D instanceof F.a?D.clone(!0):D(z.attributeNewValue,z,$,K);if(!H)return;if(!$.consume(z.item,R(q.name)))return;let U=K.mapper.toViewRange(z.range);if(null!==z.attributeOldValue&&!(D instanceof F.a)){const W=D(z.attributeOldValue,z,$,K);U=L.a.unwrap(U,W)}L.a.wrap(U,H)}},r.c=function(D){return(q,z,$,K)=>{const H=D instanceof F.a?D.clone(!0):D(z.attributeOldValue,z,$,K);if(H&&$.consume(z.item,R(q.name))){const U=K.mapper.toViewRange(z.range);L.a.unwrap(U,H)}}},r.d=function(D){return(q,z,$,K)=>{const H=D instanceof F.a?D.clone(!0):D(z,$,K);if(H&&$.consume(z.range,'addMarker')){const U=K.mapper.toViewRange(z.range),W=L.a.breakViewRangePerContainer(U);for(let Z of W)L.a.wrap(Z,H)}}},r.e=function(D){return(q,z,$,K)=>{const H=D instanceof F.a?D.clone(!0):D(z,$,K);if(H&&$.consume(z.range,'removeMarker')){const U=K.mapper.toViewRange(z.range),W=L.a.breakViewRangePerContainer(U);for(let Z of W)L.a.unwrap(Z,H)}}},r.k=function(){return(D,q,z,$)=>{if(!z.consume(q.item,'remove'))return;const K=$.mapper.toViewPosition(q.sourcePosition);let H;if(q.item.is('element'))H=M.a.createOn(K.nodeAfter);else{const U=O(K,q.item.offsetSize);H=new M.a(K,U)}L.a.remove(H.getTrimmed()),'$graveyard'==q.item.root.rootName&&$.mapper.unbindModelElement(q.item)}},r.g=function(D){return(q,z,$,K)=>{let H,U;if((D instanceof F.a?(H=D.clone(!0),U=D.clone(!0)):(z.isOpening=!0,H=D(z,$,K),z.isOpening=!1,U=D(z,$,K)),H&&U)&&$.consume(z.range,'removeMarker')){const W=K.mapper.toViewRange(z.range);L.a.clear(W.getEnlarged(),U),H.isSimilar(U)||L.a.clear(W.getEnlarged(),H)}}}},function(o,r,s){'use strict';var d=s(20),u=s(105),f=s(18),h=s(37),w=s(17),C=s(13),T=s(49),P=s(2),S=s(1);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class E extends d.a{get type(){return'insert'}get position(){return this._insertOperation?this._insertOperation.position:null}get nodes(){return this._insertOperation?this._insertOperation.nodes:null}get _insertOperation(){return this.operations[0]||null}get _reverseDeltaClass(){return u.a}static get className(){return'engine.model.delta.InsertDelta'}static get _priority(){return 20}}r.a=E,s.i(w.b)('insert',function(O,V){const R=s.i(C.b)(V);if(0===R.length)return this;const F=new E,N=new h.a(O,R,this.document.version);if(this.addDelta(F),F.addOperation(N),this.document.applyOperation(N),V instanceof T.a)for(const[M,I]of V.markers){const L=S.a.createAt(I.root),D=new P.a(I.start._getCombined(L,O),I.end._getCombined(L,O));this.setMarker(M,D)}return this}),f.a.register(E)},function(o,r,s){'use strict';var d=s(20),u=s(18),f=s(106),h=s(17),w=s(1),C=s(5),T=s(38),P=s(28),S=s(0);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class E extends d.a{get type(){return'merge'}get position(){return this._removeOperation?this._removeOperation.sourcePosition:null}getReversed(){let O=super.getReversed();return 0M._priority)||!(N._priority{return M+I.operations.length},0)}function S(N,M){const I=N[N.length-1];let L=I.operations.length+I.baseVersion,D=new E.a;for(let q=0;q{T.has(S)&&u.call(this,S,V,E.range,E.sourcePosition)},{priority:'high'})}function u(T,P,S,E){const O=S.end.offset-S.start.offset;let V=S.start;'move'==T&&(V=V._getTransformedByInsertion(E,O));const R=this._getTransformedByDocumentChange(T,P,V,O,E);'move'==T&&3==R.length&&(R[2]=S);const F=f.a.createFromRanges(R);if(!F.isEqual(this)){const N=f.a.createFromRange(this);this.start=F.start,this.end=F.end,this.fire('change',N)}}var f=s(2),h=s(7),w=s(4);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class C extends f.a{constructor(T,P){super(T,P),d.call(this)}detach(){this.stopListening()}}r.a=C,s.i(w.a)(C,h.a)},function(o,r,s){'use strict';var d=s(33),u=s(2);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends d.a{constructor(h,w,C,T,P){super(P),this.name=h,this.oldRange=w?u.a.createFromRange(w):null,this.newRange=C?u.a.createFromRange(C):null,this._markers=T}get type(){return'marker'}clone(){return new f(this.name,this.oldRange,this.newRange,this._markers,this.baseVersion)}getReversed(){return new f(this.name,this.newRange,this.oldRange,this._markers,this.baseVersion+1)}_execute(){const h=this.newRange?'set':'remove';return this._markers[h](this.name,this.newRange),{name:this.name,type:h}}toJSON(){const h=super.toJSON();return delete h._markers,h}static get className(){return'engine.model.operation.MarkerOperation'}static fromJSON(h,w){return new f(h.name,h.oldRange?u.a.fromJSON(h.oldRange,w):null,h.newRange?u.a.fromJSON(h.newRange,w):null,w.markers,h.baseVersion)}}r.a=f},function(o,r,s){'use strict';var d=s(28),u=s(38);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends d.a{get position(){return this.targetPosition}set position(h){this.targetPosition=h}get type(){return'reinsert'}getReversed(){return new u.a(this.targetPosition,this.howMany,this.baseVersion+1)}static get className(){return'engine.model.operation.ReinsertOperation'}}r.a=f},function(o,r,s){'use strict';var d=s(33),u=s(5),f=s(0),h=s(1);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class w extends d.a{constructor(C,T,P,S){super(S),this.position=C,this.oldName=T,this.newName=P}get type(){return'rename'}clone(){return new w(h.a.createFromPosition(this.position),this.oldName,this.newName,this.baseVersion)}getReversed(){return new w(h.a.createFromPosition(this.position),this.newName,this.oldName,this.baseVersion+1)}_execute(){const C=this.position.nodeAfter;if(!(C instanceof u.a))throw new f.a('rename-operation-wrong-position: Given position is invalid or node after it is not an instance of Element.');else if(C.name!==this.oldName)throw new f.a('rename-operation-wrong-name: Element to change has different name than operation\'s old name.');return this.oldName==this.newName?void 0:(C.name=this.newName,{element:C,oldName:this.oldName})}static get className(){return'engine.model.operation.RenameOperation'}static fromJSON(C,T){return new w(h.a.fromJSON(C.position,T),C.oldName,C.newName,C.baseVersion)}}r.a=w},function(o,r,s){'use strict';var d=s(33),u=s(0);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends d.a{constructor(h,w,C,T,P){super(P),this.root=h,this.key=w,this.oldValue=C,this.newValue=T}get type(){return null===this.oldValue?'addRootAttribute':null===this.newValue?'removeRootAttribute':'changeRootAttribute'}clone(){return new f(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new f(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_execute(){if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new u.a('rootattribute-operation-wrong-old-value: Changed node has different attribute value than operation\'s old attribute value.',{root:this.root,key:this.key});if(null===this.oldValue&&null!==this.newValue&&this.root.hasAttribute(this.key))throw new u.a('rootattribute-operation-attribute-exists: The attribute with given key already exists.',{root:this.root,key:this.key});return null===this.newValue?this.root.removeAttribute(this.key):this.root.setAttribute(this.key,this.newValue),{root:this.root,key:this.key,oldValue:this.oldValue,newValue:this.newValue}}static get className(){return'engine.model.operation.RootAttributeOperation'}static fromJSON(h,w){if(!w.hasRoot(h.root))throw new u.a('rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.',{rootName:h});return new f(w.getRoot(h.root),h.key,h.oldValue,h.newValue,h.baseVersion)}}r.a=f},function(o,r,s){'use strict';function d(){if(this.childCount)return null;let w=this.parent;for(;w&&w.is('attributeElement');){if(1'string'==typeof P?new u.a(P):P))}var u=s(30),f=s(4),h=s(41),w=s(7);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class C{constructor(T){this._children=[],T&&this.insertChildren(0,T)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(T){return'documentFragment'==T}appendChildren(T){return this.insertChildren(this.childCount,T)}getChild(T){return this._children[T]}getChildIndex(T){return this._children.indexOf(T)}getChildren(){return this._children[Symbol.iterator]()}insertChildren(T,P){this._fireChange('children',this);let S=0;P=d(P);for(let E of P)E.parent=this,this._children.splice(T,0,E),T++,S++;return S}removeChildren(T,P=1){this._fireChange('children',this);for(let S=T;S{this[h](),P()})}}get first(){return this.focusables.find(d)||null}get last(){return this.focusables.filter(d).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let f=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((h,w)=>{const C=h.element===this.focusTracker.focusedElement;return C&&(f=w),C}),f)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(f){f&&f.focus()}_getFocusableItem(f){const h=this.current,w=this.focusables.length;if(!w||null===h)return null;let C=(h+w+f)%w;do{let T=this.focusables.get(C);if(d(T))return T;C=(C+w+f)%w}while(C!==h);return null}}r.a=u},function(o,r,s){'use strict';function d(T){return T.every((P)=>'string'==typeof P)}var u=s(0),f=s(32),h=s(79),w=s(4);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class C extends h.a{constructor(T){super({idProperty:'viewUid'}),this.on('add',(P,S,E)=>{S.element&&this._parentElement&&this._parentElement.insertBefore(S.element,this._parentElement.children[E])}),this.on('remove',(P,S)=>{S.element&&this._parentElement&&S.element.remove()}),this.locale=T,this.set('ready',!1),this._parentElement=null}init(){if(this.ready)throw new u.a('ui-viewcollection-init-reinit: This ViewCollection has already been initialized.');return Promise.all(this.map((T)=>T.init())).then(()=>{this.ready=!0})}destroy(){let T=[];for(let P of this)T.push(P.destroy());return Promise.all(T)}add(T,P){super.add(T,P);let S=Promise.resolve();return this.ready&&!T.ready&&(S=S.then(()=>{return T.init()})),S}setParent(T){this._parentElement=T}delegate(...T){if(!T.length||!d(T))throw new u.a('ui-viewcollection-delegate-wrong-events: All event names must be strings.');return{to:(P)=>{for(let S of this)for(let E of T)S.delegate(E).to(P);this.on('add',(S,E)=>{for(let O of T)E.delegate(O).to(P)}),this.on('remove',(S,E)=>{for(let O of T)E.stopDelegating(O,P)})}}}}r.a=C,s.i(w.a)(h.a,f.a)},function(o,r,s){'use strict';function d(w,C){let T=u([w],C);T.sort((P,S)=>P.start.isBefore(S.start)?-1:1);for(let P=1;PR.start.root!=P.graveyard);V&&S.push(V)}S.length&&P.selection.setRanges(S,C)}}r.a=h},function(o,r,s){'use strict';function d(T){var P=-1,S=T?T.length:0;for(this.clear();++P=S||0>X||G&&Q>=$}function N(){var Y=s.i(f.a)();return F(Y)?M(Y):void(H=setTimeout(N,R(Y)))}function M(Y){return(clearTimeout(H),H=void 0,J&&q)?O(Y):(q=z=void 0,K)}function D(){var Y=s.i(f.a)(),X=F(Y);if(q=arguments,z=this,U=Y,X){if(void 0===H)return V(U);if(G)return clearTimeout(H),H=setTimeout(N,S),O(U)}return void 0===H&&(H=setTimeout(N,S)),K}var U=0,W=0,Z=!1,G=!1,J=!0,q,z,$,K,H;if('function'!=typeof P)throw new TypeError('Expected a function');return S=s.i(h.a)(S)||0,s.i(u.a)(E)&&(Z=!!E.leading,G='maxWait'in E,$=G?_Mathmax(s.i(h.a)(E.maxWait)||0,S):$,J='trailing'in E?!!E.trailing:J),D.cancel=function(){void 0!==H&&clearTimeout(H),U=W=0,q=z=H=void 0},D.flush=function(){return void 0===H?K:M(s.i(f.a)())},D}},function(o,r,s){'use strict';var u=s(35),f=s(16);r.a=function(h,w,C){var T=h?h.length:0;return T?(w=C||void 0===w?1:s.i(f.a)(w),s.i(u.a)(h,0>w?0:w,T)):[]}},function(o,r,s){'use strict';var u=s(35),f=s(16);r.a=function(h,w,C){var T=h?h.length:0;return T?(w=C||void 0===w?1:s.i(f.a)(w),w=T-w,s.i(u.a)(h,0,0>w?0:w)):[]}},function(o,r){'use strict';r.a=function(u){return u&&u.length?u[0]:void 0}},function(o,r,s){'use strict';var u=s(14),h=Object.prototype,w=h.hasOwnProperty,C=h.toString,T=h.propertyIsEnumerable;r.a=function(P){return s.i(u.a)(P)&&w.call(P,'callee')&&(!T.call(P,'callee')||C.call(P)=='[object Arguments]')}},function(o,r,s){'use strict';var u=s(15),w=Object.prototype,C=w.toString;r.a=function(T){var P=s.i(u.a)(T)?C.call(T):'';return P=='[object Function]'||P=='[object GeneratorFunction]'}},function(o,r,s){'use strict';var u=s(11),f=s(43),w=Object.prototype,C=w.toString;r.a=function(T){return'string'==typeof T||!s.i(u.a)(T)&&s.i(f.a)(T)&&C.call(T)=='[object String]'}},function(o,r,s){'use strict';var u=s(132);r.a=function(f,h){return f&&f.length&&h&&h.length?s.i(u.a)(f,h):f}},function(o,r,s){'use strict';var u=s(195),f=s(27),h=s(99);r.a=function(w,C){if(!(w&&w.length))return[];var T=s.i(h.a)(w);return null==C?T:s.i(f.a)(T,function(P){return s.i(u.a)(C,void 0,P)})}},function(o,r,s){'use strict';var u=s(98),f=s(274);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=function(h){return s.i(u.a)(h)?s.i(f.a)(h):new Map(h)}},function(o,r,s){'use strict';var d=s(6),u=s(3),f=s(186),h=s(40),w=s(175);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class C extends u.a{constructor(T){super(T),T.config.set('image.defaultToolbar',[]),this.isEnabled=!0}afterInit(){const T=this.editor,P=T.config.get('image.toolbar')||T.config.get('image.defaultToolbar');if(P.length){const S=this._panel=new w.a(T),E=[],O=new f.a;return d.a.extend(S.template,{attributes:{class:['ck-toolbar__container']}}),E.push(S.content.add(O)),E.push(O.fillFromConfig(P,T.ui.componentFactory)),E.push(T.ui.view.body.add(S)),this.listenTo(this.editor.editing.view,'render',()=>{this.isEnabled&&this.show()},{priority:'low'}),this.listenTo(T.ui.focusTracker,'change:isFocused',(V,R,F,N)=>{!N&&F&&this.isEnabled&&this.show()}),Promise.all(E)}}show(){const T=this.editor.editing.view.selection.getSelectedElement();T&&s.i(h.a)(T)&&this._panel.attach()}hide(){this._panel.detach()}}r.a=C},function(o){o.exports=function(s){if(!s.webpackPolyfill){var d=Object.create(s);d.children||(d.children=[]),Object.defineProperty(d,'loaded',{enumerable:!0,get:function(){return d.l}}),Object.defineProperty(d,'id',{enumerable:!0,get:function(){return d.i}}),Object.defineProperty(d,'exports',{enumerable:!0}),d.webpackPolyfill=1}return d}},function(o,r,s){'use strict';var d=s(3),u=s(47),f=s(48),h=s(158);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */const w='bold';class C extends d.a{init(){const T=this.editor,P=T.data,S=T.editing;T.document.schema.allow({name:'$inline',attributes:[w]}),s.i(u.a)().for(P.modelToView,S.modelToView).fromAttribute(w).toElement('strong'),s.i(f.a)().for(P.viewToModel).fromElement('strong').fromElement('b').fromAttribute('style',{'font-weight':'bold'}).toAttribute(w,!0),T.commands.set(w,new h.a(T,w))}}r.a=C},function(o,r,s){'use strict';var d=s(3),u=s(47),f=s(48),h=s(158);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */const w='italic';class C extends d.a{init(){const T=this.editor,P=T.data,S=T.editing;T.document.schema.allow({name:'$inline',attributes:[w]}),s.i(u.a)().for(P.modelToView,S.modelToView).fromAttribute(w).toElement('em'),s.i(f.a)().for(P.viewToModel).fromElement('em').fromElement('i').fromAttribute('style',{'font-style':'italic'}).toAttribute(w,!0),T.commands.set(w,new h.a(T,w))}}r.a=C},function(o,r,s){'use strict';var u=s(34);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=function(f,h,w){if(h.isCollapsed)return w.check({name:'$text',inside:h.getFirstPosition(),attributes:f});const C=h.getRanges();for(let T of C){const P=new u.a({boundaries:T,mergeCharacters:!0});for(let S=P.position,E=P.next();!E.done;){const O=E.value.item.name||'$text';if(w.check({name:O,inside:S,attributes:f}))return!0;S=P.position,E=P.next()}}return!1}},function(o,r,s){'use strict';var d=s(12),u=s(100),f=s(157);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class h extends d.a{constructor(w,C){super(w),this.attributeKey=C,this.set('value',!1),this.listenTo(this.editor.document.selection,'change:attribute',()=>{this.value=this.editor.document.selection.hasAttribute(this.attributeKey)})}_checkEnabled(){const w=this.editor.document;return s.i(f.a)(this.attributeKey,w.selection,w.schema)}_doExecute(w={}){const C=this.editor.document,T=C.selection,P=w.forceValue===void 0?!this.value:w.forceValue;C.enqueueChanges(()=>{if(T.isCollapsed)P?T.setAttribute(this.attributeKey,!0):T.removeAttribute(this.attributeKey);else{const S=s.i(u.a)(this.attributeKey,T.getRanges(),C.schema),E=w.batch||C.batch();for(let O of S)P?E.setAttribute(O,this.attributeKey,P):E.removeAttribute(O,this.attributeKey)}})}}r.a=h},function(o,r,s){'use strict';var d=s(1),u=s(2),f=s(25),h=s(29),w=s(30),C=s(7),T=s(4);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class P{constructor(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._viewToModelLengthCallbacks=new Map,this.on('modelToViewPosition',(S,E)=>{if(!E.viewPosition){let O=this._modelToViewMapping.get(E.modelPosition.parent);E.viewPosition=this._findPositionIn(O,E.modelPosition.offset)}},{priority:'low'}),this.on('viewToModelPosition',(S,E)=>{if(E.modelPosition)return;let O=E.viewPosition.parent,V=this._viewToModelMapping.get(O);for(;!V;)O=O.parent,V=this._viewToModelMapping.get(O);let R=this._toModelOffset(E.viewPosition.parent,E.viewPosition.offset,O);E.modelPosition=d.a.createFromParentAndOffset(V,R)},{priority:'low'})}bindElements(S,E){this._modelToViewMapping.set(S,E),this._viewToModelMapping.set(E,S)}unbindViewElement(S){const E=this.toModelElement(S);this._unbindElements(E,S)}unbindModelElement(S){const E=this.toViewElement(S);this._unbindElements(S,E)}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap}toModelElement(S){return this._viewToModelMapping.get(S)}toViewElement(S){return this._modelToViewMapping.get(S)}toModelRange(S){return new u.a(this.toModelPosition(S.start),this.toModelPosition(S.end))}toViewRange(S){return new h.a(this.toViewPosition(S.start),this.toViewPosition(S.end))}toModelPosition(S){const E={viewPosition:S,mapper:this};return this.fire('viewToModelPosition',E),E.modelPosition}toViewPosition(S){const E={modelPosition:S,mapper:this};return this.fire('modelToViewPosition',E),E.viewPosition}registerViewToModelLength(S,E){this._viewToModelLengthCallbacks.set(S,E)}_toModelOffset(S,E,O){if(O!=S){const R=this._toModelOffset(S.parent,S.index,O),F=this._toModelOffset(S,E,S);return R+F}if(S.is('text'))return E;let V=0;for(let R=0;R{const N=V.selection;if(!N.isCollapsed&&R.consume(N,'selection')){F.viewSelection.removeAllRanges();for(let M of N.getRanges()){const I=F.mapper.toViewRange(M);F.viewSelection.addRange(I,N.isBackward)}}}},r.f=function(){return(O,V,R,F)=>{const N=V.selection;if(N.isCollapsed&&R.consume(N,'selection')){const M=N.getFirstPosition(),I=F.mapper.toViewPosition(M),L=E.a.breakAttributes(I);F.viewSelection.removeAllRanges(),F.viewSelection.addRange(new S.a(L,L))}}},r.a=function(O){return(V,R,F,N)=>{const M=O instanceof P.a?O.clone(!0):O(R.value,R,R.selection,F,N);if(M){const I='selectionAttribute:'+R.key;w(R.selection,N.viewSelection,M,F,I)}}},r.b=function(O){return(V,R,F,N)=>{const M=O instanceof P.a?O.clone(!0):O(R,F,N);if(M){const I='selectionMarker:'+R.name;w(R.selection,N.viewSelection,M,F,I)}}},r.c=function(){return(O,V,R,F)=>{for(let N of F.viewSelection.getRanges())N.isCollapsed&&N.end.parent.document&&E.a.mergeAttributes(N.start);F.viewSelection.removeAllRanges()}},r.d=function(){return(O,V,R,F)=>F.viewSelection.setFake(!1)}},function(o,r,s){'use strict';var d=s(333),u=s(2),f=s(1),h=s(49),w=s(7),C=s(4),T=s(57);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class P{constructor(S,E={}){this._modelDocument=S,this.conversionApi=s.i(T.a)({dispatcher:this},E)}convertChange(S,E){'remove'!==S&&E.range&&'$graveyard'==E.range.root.rootName||'remove'==S&&'$graveyard'==E.sourcePosition.root.rootName||'rename'==S&&'$graveyard'==E.element.root.rootName||('insert'==S||'reinsert'==S?this.convertInsertion(E.range):'move'==S?this.convertMove(E.sourcePosition,E.range):'remove'==S?this.convertRemove(E.sourcePosition,E.range):'addAttribute'==S||'removeAttribute'==S||'changeAttribute'==S?this.convertAttribute(S,E.range,E.key,E.oldValue,E.newValue):'rename'==S&&this.convertRename(E.element,E.oldName))}convertInsertion(S){const E=this._createInsertConsumable(S);for(let O of S){const V=O.item,R=u.a.createFromPositionAndShift(O.previousPosition,O.length),F={item:V,range:R};this._testAndFire('insert',F,E);for(let N of V.getAttributeKeys())F.attributeKey=N,F.attributeOldValue=null,F.attributeNewValue=V.getAttribute(N),this._testAndFire(`addAttribute:${N}`,F,E)}for(let O of this._modelDocument.markers){const V=O.getRange();V.containsPosition(S.start)&&this.convertMarker('addMarker',O.name,V.getIntersection(S)),(S.containsRange(V)||S.isEqual(V))&&this.convertMarker('addMarker',O.name,V)}}convertMove(S,E){if(E.start.isBefore(S)){this.convertInsertion(E);const O=S._getTransformedByInsertion(E.start,E.end.offset-E.start.offset);this.convertRemove(O,E)}else this.convertRemove(S,E),this.convertInsertion(E)}convertRemove(S,E){const O=this._createConsumableForRange(E,'remove');for(let V of E.getItems({shallow:!0})){this._testAndFire(`remove`,{sourcePosition:S,item:V},O)}}convertAttribute(S,E,O,V,R){const F=this._createConsumableForRange(E,S+':'+O);for(let N of E){const M=N.item,I=u.a.createFromPositionAndShift(N.previousPosition,N.length);this._testAndFire(`${S}:${O}`,{item:M,range:I,attributeKey:O,attributeOldValue:V,attributeNewValue:R},F)}}convertRename(S,E){const O=S.clone(!0);O.name=E,this.conversionApi.mapper.bindElements(O,this.conversionApi.mapper.toViewElement(S));const V=new h.a;V.appendChildren(O),this.convertRemove(f.a.createBefore(S),u.a.createOn(O)),this.convertInsertion(u.a.createOn(S))}convertSelection(S){const E=Array.from(this._modelDocument.markers.getMarkersAtPosition(S.getFirstPosition())),O=this._createSelectionConsumable(S,E);this.fire('selection',{selection:S},O,this.conversionApi);for(let V of E){const R={selection:S,name:V.name};O.test(S,'selectionMarker:'+V.name)&&this.fire('selectionMarker:'+V.name,R,O,this.conversionApi)}for(let V of S.getAttributeKeys()){const R={selection:S,key:V,value:S.getAttribute(V)};O.test(S,'selectionAttribute:'+R.key)&&this.fire('selectionAttribute:'+R.key,R,O,this.conversionApi)}}convertMarker(S,E,O){if(O.root.document&&'$graveyard'!=O.root.rootName){const V=this._createMarkerConsumable(S,O);this.fire(S+':'+E,{name:E,range:O},V,this.conversionApi)}}_createInsertConsumable(S){const E=new d.a;for(let O of S){const V=O.item;E.add(V,'insert');for(let R of V.getAttributeKeys())E.add(V,'addAttribute:'+R)}return E}_createConsumableForRange(S,E){const O=new d.a;for(let V of S.getItems())O.add(V,E);return O}_createSelectionConsumable(S,E){const O=new d.a;O.add(S,'selection');for(let V of E)O.add(S,'selectionMarker:'+V.name);for(let V of S.getAttributeKeys())O.add(S,'selectionAttribute:'+V);return O}_createMarkerConsumable(S,E){const O=new d.a;return O.add(E,S),O}_testAndFire(S,E,O){if(O.test(E.item,S)){const V=E.item.name||'$text';this.fire(S+':'+V,E,O,this.conversionApi)}}}r.a=P,s.i(C.a)(P,w.a)},function(o,r,s){'use strict';var d=s(338),u=s(167),f=s(62);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=class{constructor(){this._domParser=new DOMParser,this._domConverter=new u.a({blockFiller:f.a}),this._htmlWriter=new d.a}toData(w){const C=this._domConverter.viewToDom(w,document);return this._htmlWriter.getHtml(C)}toView(w){const C=this._toDom(w);return this._domConverter.domToView(C)}_toDom(w){const C=this._domParser.parseFromString(w,'text/html'),T=C.createDocumentFragment(),P=C.body.childNodes;for(;0{S.has(O)&&u.call(this,O,V.range,V.sourcePosition)},{priority:'high'})}function u(S,E,O){let V=E.end.offset-E.start.offset,R;switch(S){case'insert':let F='sticksToNext'==this.stickiness;R=this._getTransformedByInsertion(E.start,V,F);break;case'move':case'remove':case'reinsert':let N=h.a.createFromPositionAndShift(O,V),M=N.containsPosition(this)||N.start.isEqual(this)&&'sticksToNext'==this.stickiness||N.end.isEqual(this)&&'sticksToPrevious'==this.stickiness;if(M)R=this._getCombined(O,E.start);else{let I='sticksToNext'==this.stickiness;R=this._getTransformedByMove(O,E.start,V,I)}}if(!this.isEqual(R)){const F=f.a.createFromPosition(this);this.path=R.path,this.root=R.root,this.fire('change',F)}}var f=s(1),h=s(2),w=s(7),C=s(4),T=s(0);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class P extends f.a{constructor(S,E,O){if(super(S,E),!this.root.is('rootElement'))throw new T.a('model-liveposition-root-not-rootelement: LivePosition root has to be an instance of RootElement.');this.stickiness=O||'sticksToNext',d.call(this)}detach(){this.stopListening()}}r.a=P,s.i(C.a)(P,w.a)},function(o,r,s){'use strict';function d(F,N,M){let I=s.i(O.a)(F);return M&&(I=I.slice(I.indexOf(M)+1)),I.some((L)=>L.tagName&&N.includes(L.tagName.toLowerCase()))}var u=s(30),f=s(21),h=s(25),w=s(29),C=s(77),T=s(116),P=s(51),S=s(62),E=s(413),O=s(189),V=s(410);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=class{constructor(F={}){this.blockFiller=F.blockFiller||S.b,this.preElements=['pre'],this.blockElements=['p','div','h1','h2','h3','h4','h5','h6'],this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap}bindFakeSelection(F,N){this._fakeSelectionMapping.set(F,C.a.createFromSelection(N))}fakeSelectionToView(F){return this._fakeSelectionMapping.get(F)}bindElements(F,N){this._domToViewMapping.set(F,N),this._viewToDomMapping.set(N,F)}unbindDomElement(F){const N=this._domToViewMapping.get(F);this._domToViewMapping.delete(F),this._viewToDomMapping.delete(N)}bindDocumentFragments(F,N){this._domToViewMapping.set(F,N),this._viewToDomMapping.set(N,F)}viewToDom(F,N,M={}){if(F.is('text')){const I=this._processDataFromViewText(F);return N.createTextNode(I)}if(this.getCorrespondingDom(F))return this.getCorrespondingDom(F);let I;if(F.is('documentFragment'))I=N.createDocumentFragment(),M.bind&&this.bindDocumentFragments(I,F);else{I=N.createElement(F.name),M.bind&&this.bindElements(I,F);for(let L of F.getAttributeKeys())I.setAttribute(L,F.getAttribute(L))}if(M.withChildren||void 0===M.withChildren)for(let L of this.viewChildrenToDom(F,N,M))I.appendChild(L);return I}*viewChildrenToDom(F,N,M={}){let I=F.getFillerOffset&&F.getFillerOffset(),L=0;for(let D of F.getChildren())I===L&&(yield this.blockFiller(N)),yield this.viewToDom(D,N,M),L++;I===L&&(yield this.blockFiller(N))}viewRangeToDom(F){const N=this.viewPositionToDom(F.start),M=this.viewPositionToDom(F.end),I=new Range;return I.setStart(N.parent,N.offset),I.setEnd(M.parent,M.offset),I}viewPositionToDom(F){const N=F.parent;if(N.is('text')){const M=this.getCorrespondingDomText(N);if(!M)return null;let I=F.offset;return s.i(S.c)(M)&&(I+=S.d),{parent:M,offset:I}}let M,I,L;if(0===F.offset){if(M=this.getCorrespondingDom(F.parent),!M)return null;L=M.childNodes[0]}else{if(I=this.getCorrespondingDom(F.nodeBefore),!I)return null;M=I.parentNode,L=I.nextSibling}if(this.isText(L)&&s.i(S.c)(L))return{parent:L,offset:S.d};const D=I?s.i(E.a)(I)+1:0;return{parent:M,offset:D}}domToView(F,N={}){if(s.i(S.e)(F,this.blockFiller))return null;if(this.isText(F)){if(s.i(S.f)(F))return null;const M=this._processDataFromDomText(F);return''===M?null:new u.a(M)}if(this.getCorrespondingView(F))return this.getCorrespondingView(F);let M;if(this.isDocumentFragment(F))M=new T.a,N.bind&&this.bindDocumentFragments(F,M);else{const I=N.keepOriginalCase?F.tagName:F.tagName.toLowerCase();M=new f.a(I),N.bind&&this.bindElements(F,M);const L=F.attributes;for(let D=L.length-1;0<=D;D--)M.setAttribute(L[D].name,L[D].value)}if(N.withChildren||void 0===N.withChildren)for(let I of this.domChildrenToView(F,N))M.appendChildren(I);return M}*domChildrenToView(F,N={}){for(let M=0;MI?0:I),new h.a(M,I)):null}if(0===N){const M=this.getCorrespondingView(F);if(M)return new h.a(M,0)}else{const M=this.getCorrespondingView(F.childNodes[N-1]);if(M&&M.parent)return new h.a(M.parent,M.index+1)}return null}getCorrespondingView(F){if(this.isElement(F))return this.getCorrespondingViewElement(F);return this.isDocumentFragment(F)?this.getCorrespondingViewDocumentFragment(F):this.isText(F)?this.getCorrespondingViewText(F):null}getCorrespondingViewElement(F){return this._domToViewMapping.get(F)}getCorrespondingViewDocumentFragment(F){return this._domToViewMapping.get(F)}getCorrespondingViewText(F){if(s.i(S.f)(F))return null;const N=F.previousSibling;if(N){if(!this.isElement(N))return null;const M=this.getCorrespondingViewElement(N);if(M){const I=M.nextSibling;return I instanceof u.a?M.nextSibling:null}}else{const M=this.getCorrespondingViewElement(F.parentNode);if(M){const I=M.getChild(0);return I instanceof u.a?I:null}}return null}getCorrespondingDom(F){if(F instanceof f.a)return this.getCorrespondingDomElement(F);return F instanceof T.a?this.getCorrespondingDomDocumentFragment(F):F instanceof u.a?this.getCorrespondingDomText(F):null}getCorrespondingDomElement(F){return this._viewToDomMapping.get(F)}getCorrespondingDomDocumentFragment(F){return this._viewToDomMapping.get(F)}getCorrespondingDomText(F){const N=F.previousSibling;return N&&this.getCorrespondingDom(N)?this.getCorrespondingDom(N).nextSibling:!N&&F.parent&&this.getCorrespondingDom(F.parent)?this.getCorrespondingDom(F.parent).childNodes[0]:null}focus(F){const N=this.getCorrespondingDomElement(F);N&&N.ownerDocument.activeElement!==N&&N.focus()}isText(F){return F&&F.nodeType==Node.TEXT_NODE}isElement(F){return F&&F.nodeType==Node.ELEMENT_NODE}isDocumentFragment(F){return F&&F.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isDomSelectionBackward(F){if(F.isCollapsed)return!1;const N=new Range;N.setStart(F.anchorNode,F.anchorOffset),N.setEnd(F.focusNode,F.focusOffset);const M=N.collapsed;return N.detach(),M}_processDataFromViewText(F){let N=F.data;if(F.getAncestors().some((q)=>this.preElements.includes(q.name)))return N;const M=this._getTouchingViewTextNode(F,!1),I=this._getTouchingViewTextNode(F,!0);let L=N.match(/ *$/)[0],D=N.substr(0,N.length-L.length);if(M&&' '!=M.data.charAt(M.data.length-1)||(D=D.replace(/^ /,'\xA0')),D=D.replace(/ /g,' \xA0'),0{const R=P.document.selection.getFirstPosition().parent,F=V.batch,N=E.some((M)=>R.is(M.modelElement));N&&!R.is(C)&&0===R.childCount&&F.rename(R,C)})}}r.a=T},function(o,r,s){'use strict';function d(){return new T.a('figure',{class:'image'},new P.a('img'))}var u=s(3),f=s(47),h=s(176),w=s(362),C=s(40),T=s(39),P=s(168);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class S extends u.a{static get requires(){return[h.a]}init(){const E=this.editor,O=E.document,V=O.schema,R=E.data,F=E.editing,N=E.t;V.registerItem('image'),V.requireAttributes('image',['src']),V.allow({name:'image',attributes:['alt','src'],inside:'$root'}),V.objects.add('image'),s.i(f.a)().for(R.modelToView).fromElement('image').toElement(()=>d()),s.i(f.a)().for(F.modelToView).fromElement('image').toElement(()=>s.i(C.c)(d(),N('image widget'))),s.i(w.a)([F.modelToView,R.modelToView],'src'),s.i(w.a)([F.modelToView,R.modelToView],'alt'),R.viewToModel.on('element:figure',s.i(w.b)())}}r.a=S},function(o,r,s){'use strict';var d=s(516),u=s(64),f=s(185),h=s(40);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */const w=f.a.arrowVerticalOffset,C={south(P,S){return{top:P.bottom+w,left:P.left+P.width/2-S.width/2,name:'s'}},north(P,S){return{top:P.top-S.height-w,left:P.left+P.width/2-S.width/2,name:'n'}}};class T extends f.a{constructor(P){super(P.locale),this.editor=P;const S=P.editing.view;this.listenTo(P.ui.focusTracker,'change:isFocused',(E,O,V,R)=>{R&&!V&&this.detach()}),P.listenTo(S,'render',()=>{const E=S.selection.getSelectedElement();E&&s.i(h.a)(E)||this.detach()},{priority:'low'}),this._throttledAttach=s.i(d.a)(()=>{this._attach()},100)}init(){return this.editor.ui.focusTracker.add(this.element),super.init()}attach(){this._attach(),this.editor.ui.view.listenTo(u.a.window,'scroll',this._throttledAttach),this.editor.ui.view.listenTo(u.a.window,'resize',this._throttledAttach)}detach(){this.hide(),this.editor.ui.view.stopListening(u.a.window,'scroll',this._throttledAttach),this.editor.ui.view.stopListening(u.a.window,'resize',this._throttledAttach)}_attach(){const P=this.editor.editing.view;this.attachTo({target:P.domConverter.viewRangeToDom(P.selection.getFirstRange()),positions:[C.north,C.south]})}}r.a=T},function(o,r,s){'use strict';var d=s(3),u=s(118);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends d.a{init(){let h;this.editor.editing.modelToView.on('selection',(w,C,T,P)=>{h&&h.hasClass(u.c)&&h.removeClass(u.c);const S=P.viewSelection,E=S.getSelectedElement();E&&s.i(u.b)(E)&&(S.setFake(!0,{label:s.i(u.d)(E)}),E.addClass(u.c),h=E)},{priority:'low'})}}r.a=f},function(o,r,s){'use strict';function u(w,C,T){let P=w.textNode||(T?w.nodeBefore:w.nodeAfter),S=null;for(;P&&P.getAttribute('linkHref')==C;)S=P,P=T?P.previousSibling:P.nextSibling;return S?h.a.createAt(S,T?'before':'after'):w}/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */var f=s(2),h=s(1);r.a=function(w,C){return new f.a(u(w,C,!0),u(w,C,!1))}},function(o,r,s){'use strict';var d=s(115);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class u extends d.a{}r.a=u},function(o,r,s){'use strict';function d(P){let S=1;for(let E of P.getChildren())if('ul'==E.name||'ol'==E.name)for(let O of E.getChildren())S+=d(O);return S}var u=s(379),f=s(378),h=s(3),w=s(71),C=s(377);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class T extends h.a{static get requires(){return[w.a]}init(){const P=this.editor,S=P.document.schema;S.registerItem('listItem','$block'),S.allow({name:'listItem',inside:'$root',attributes:['type','indent']}),S.requireAttributes('listItem',['type','indent']);const E=P.data,O=P.editing;this.editor.document.on('change',s.i(C.a)(this.editor.document),{priority:'high'}),this.editor.document.on('change',(V,R,F)=>{if('move'==R)for(let N of F.range.getItems())N.is('listItem')&&O.mapper.unbindModelElement(N)},{priority:'high'}),O.mapper.registerViewToModelLength('li',d),E.mapper.registerViewToModelLength('li',d),O.mapper.on('modelToViewPosition',C.b),O.mapper.on('viewToModelPosition',C.c),E.mapper.on('modelToViewPosition',C.b),O.modelToView.on('insert',C.d,{priority:'high'}),O.modelToView.on('insert:listItem',C.e),E.modelToView.on('insert',C.d,{priority:'high'}),E.modelToView.on('insert:listItem',C.e),O.modelToView.on('changeAttribute:type:listItem',C.f),E.modelToView.on('changeAttribute:type:listItem',C.f),O.modelToView.on('remove:listItem',C.g),O.modelToView.on('remove',C.h,{priority:'low'}),E.modelToView.on('remove:listItem',C.g),E.modelToView.on('remove',C.h,{priority:'low'}),O.modelToView.on('changeAttribute:indent:listItem',C.i),E.modelToView.on('changeAttribute:indent:listItem',C.i),E.viewToModel.on('element:ul',C.j,{priority:'high'}),E.viewToModel.on('element:ol',C.j,{priority:'high'}),E.viewToModel.on('element:li',C.k,{priority:'high'}),E.viewToModel.on('element:li',C.l),P.commands.set('numberedList',new u.a(P,'numbered')),P.commands.set('bulletedList',new u.a(P,'bulleted')),P.commands.set('indentList',new f.a(P,'forward')),P.commands.set('outdentList',new f.a(P,'backward'))}}r.a=T},function(o,r,s){'use strict';var d=s(187);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class u{constructor(f,h=20){this.document=f,this.size=0,this.limit=h,this.isLocked=!1,this._changeCallback=(w,C,T,P)=>{this._onBatch(P)},this._selectionChangeCallback=()=>{this._reset()},f.on('change',this._changeCallback),f.selection.on('change:range',this._selectionChangeCallback),f.selection.on('change:attribute',this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.document.batch()),this._batch}input(f){this.size+=f,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.document.off('change',this._changeCallback),this.document.selection.off('change:range',this._selectionChangeCallback),this.document.selection.off('change:attribute',this._selectionChangeCallback)}_onBatch(f){'transparent'!=f.type&&f!==this._batch&&1>=s.i(d.a)(f.getOperations())&&this._reset(!0)}_reset(f){(!this.isLocked||f)&&(this._batch=null,this.size=0)}}r.a=u},function(o,r){'use strict';r.a=/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function({emitter:u,activator:f,callback:h,contextElement:w}){u.listenTo(document,'mouseup',(C,{target:T})=>{f()&&!w.contains(T)&&h()})}},function(o,r){'use strict';r.a=/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function({view:u}){u.listenTo(u.element,'submit',(f,h)=>{h.preventDefault(),u.fire('submit')},{useCapture:!0})}},function(o,r,s){'use strict';var d=s(9),u=s(6);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends d.a{constructor(h){super(h),this.set('value'),this.set('id');const w=this.bindTemplate;this.template=new u.a({tag:'input',attributes:{type:'text',class:['ck-input','ck-input-text'],id:w.to('id')}}),this.on('change:value',(C,T,P)=>this.element.value=P||'')}select(){this.element.select()}focus(){this.element.focus()}}r.a=f},function(o,r,s){'use strict';var d=s(9),u=s(6),f=s(70),h=s(398);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class w extends d.a{constructor(C,T){super(C);const P=`ck-input-${s.i(f.a)()}`;this.set('label'),this.set('value'),this.labelView=this._createLabelView(P),this.inputView=this._createInputView(T,P),this.template=new u.a({tag:'div',children:[this.labelView,this.inputView]})}_createLabelView(C){const T=new h.a(this.locale);return T.for=C,T.bind('text').to(this,'label'),T}_createInputView(C,T){const P=new C(this.locale);return P.id=T,P.bind('value').to(this),P}select(){this.inputView.select()}focus(){this.inputView.focus()}}r.a=w},function(o,r,s){'use strict';var d=s(9),u=s(6),f=s(416),h=s(190);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */const w=s.i(h.a)('px');class C extends d.a{constructor(T){super(T);const P=this.bindTemplate;this.set('top',0),this.set('left',0),this.set('position','se'),this.set('isVisible',!1),this.content=this.createCollection(),this.template=new u.a({tag:'div',attributes:{class:['ck-balloon-panel',P.to('position',(S)=>`ck-balloon-panel_arrow_${S}`),P.if('isVisible','ck-balloon-panel_visible')],style:{top:P.to('top',w),left:P.to('left',w),maxWidth:P.to('maxWidth',w)},tabindex:-1},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(T){this.show();const P=C.defaultPositions,S=Object.assign({},{element:this.element,positions:[P.se,P.sw,P.ne,P.nw],limiter:document.body,fitInViewport:!0},T),{top:E,left:O,name:V}=s.i(f.a)(S);Object.assign(this,{top:E,left:O,position:V})}}r.a=C,C.arrowHorizontalOffset=30,C.arrowVerticalOffset=15,C.defaultPositions={se:(T)=>({top:T.bottom+C.arrowVerticalOffset,left:T.left+T.width/2-C.arrowHorizontalOffset,name:'se'}),sw:(T,P)=>({top:T.bottom+C.arrowVerticalOffset,left:T.left+T.width/2-P.width+C.arrowHorizontalOffset,name:'sw'}),ne:(T,P)=>({top:T.top-P.height-C.arrowVerticalOffset,left:T.left+T.width/2-C.arrowHorizontalOffset,name:'ne'}),nw:(T,P)=>({top:T.top-P.height-C.arrowVerticalOffset,left:T.left+T.width/2-P.width+C.arrowHorizontalOffset,name:'nw'})}},function(o,r,s){'use strict';var d=s(9),u=s(6),f=s(65),h=s(119),w=s(66),C=s(404);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class T extends d.a{constructor(P){super(P),this.items=this.createCollection(),this.focusTracker=new f.a,this.keystrokes=new w.a,this._focusCycler=new h.a({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:['arrowleft','arrowup'],focusNext:['arrowright','arrowdown']}}),this.template=new u.a({tag:'div',attributes:{class:['ck-toolbar']},children:this.items}),this.items.on('add',(S,E)=>{this.focusTracker.add(E.element)}),this.items.on('remove',(S,E)=>{this.focusTracker.remove(E.element)})}init(){return this.keystrokes.listenTo(this.element),super.init()}focus(){this._focusCycler.focusFirst()}fillFromConfig(P,S){return P?Promise.all(P.map((E)=>{const O='|'==E?new C.a:S.create(E);return this.items.add(O)})):Promise.resolve()}}r.a=T},function(o,r){'use strict';r.a=/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function(u){let f=0;for(let h of u)f++;return f}},function(o,r){'use strict';r.a=/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function(u,f,h){function w(N){const M=(V[N-1]===void 0?-1:V[N-1])+1,I=V[N+1]===void 0?-1:V[N+1],L=M>I?-1:1;O[N+L]&&(O[N]=O[N+L].slice(0)),O[N]||(O[N]=[]),O[N].push(M>I?C:T);let D=_Mathmax(M,I),q=D-N;for(;qE;F--)V[F]=w(F);V[E]=w(E),R++}while(V[E]!==S);return O[E].slice(1)}},function(o,r){'use strict';r.a=/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function(u){const f=[];for(;u&&u.nodeType!=Node.DOCUMENT_NODE;)f.unshift(u),u=u.parentNode;return f}},function(o,r){'use strict';r.a=/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function(u){return(f)=>f+u}},function(o,r){'use strict';r.a=/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function(u){const f=u.next();return f.done?null:f.value}},function(o,r,s){'use strict';var d=s(53),u=s(31),f=s.i(d.a)(u.a,'Map');r.a=f},function(o,r,s){'use strict';var d=s(53),u=s(31),f=s.i(d.a)(u.a,'Set');r.a=f},function(o,r,s){'use strict';var d=s(31),u=d.a.Uint8Array;r.a=u},function(o,r){'use strict';r.a=function(u,f,h){var w=h.length;return 0===w?u.call(f):1===w?u.call(f,h[0]):2===w?u.call(f,h[0],h[1]):3===w?u.call(f,h[0],h[1],h[2]):u.apply(f,h)}},function(o,r){'use strict';r.a=function(u,f,h,w){var C=-1,T=u.length;for(w&&T&&(h=u[++C]);++CR))return!1;var N=O.get(C);if(N)return N==T;var M=-1,I=!0,L=E&1?new u.a:void 0;for(O.set(C,T);++MP)return[];for(var O=0,V=0,R=Array(w(E/P));OT&&(T=_Mathmax(P+T,0)),s.i(u.a)(w,C,T)):-1}},function(o,r,s){'use strict';var u=s(145);r.a=function(f){return s.i(u.a)(f,1)}},function(o,r,s){'use strict';var d=s(27),u=s(129),f=s(137),h=s(8),w=s.i(h.a)(function(C){var T=s.i(d.a)(C,f.a);return T.length&&T[0]===C[0]?s.i(u.a)(T):[]});r.a=w},function(o,r,s){'use strict';var d=s(27),u=s(129),f=s(10),h=s(137),w=s(19),C=s(8),T=s.i(C.a)(function(P){var S=s.i(w.a)(P),E=s.i(d.a)(P,h.a);return S===s.i(w.a)(E)?S=void 0:E.pop(),E.length&&E[0]===P[0]?s.i(u.a)(E,s.i(f.a)(S)):[]});r.a=T},function(o,r,s){'use strict';var d=s(27),u=s(129),f=s(137),h=s(19),w=s(8),C=s.i(w.a)(function(T){var P=s.i(h.a)(T),S=s.i(d.a)(T,f.a);return P===s.i(h.a)(S)?P=void 0:S.pop(),S.length&&S[0]===T[0]?s.i(u.a)(S,void 0,P):[]});r.a=C},function(o,r,s){'use strict';var u=s(148),f=s(90),h=s(15),w=s(211),C=/[\\^$.*+?()[\]{}|]/g,T=/^\[object .+?Constructor\]$/,P=Object.prototype,S=Function.prototype.toString,E=P.hasOwnProperty,O=RegExp('^'+S.call(E).replace(C,'\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,'$1.*?')+'$');r.a=function(V){if(!s.i(h.a)(V))return!1;var R=s.i(u.a)(V)||s.i(f.a)(V)?O:T;return R.test(s.i(w.a)(V))}},function(o,r){'use strict';var u=Array.prototype,f=u.join;r.a=function(h,w){return h?f.call(h,w):''}},function(o,r,s){'use strict';var u=s(208),f=s(16);r.a=function(C,T,P){var S=C?C.length:0;if(!S)return-1;var E=S;if(void 0!==P&&(E=s.i(f.a)(P),E=(0>E?_Mathmax(S+E,0):_Mathmin(E,S-1))+1),T!==T)return s.i(u.a)(C,E,!0);for(;E--;)if(C[E]===T)return E;return-1}},function(o,r,s){'use strict';var u=s(446),f=s(16);r.a=function(h,w){return h&&h.length?s.i(u.a)(h,s.i(f.a)(w)):void 0}},function(o,r,s){'use strict';var d=s(150),u=s(8),f=s.i(u.a)(d.a);r.a=f},function(o,r,s){'use strict';var u=s(10),f=s(132);r.a=function(h,w,C){return h&&h.length&&w&&w.length?s.i(f.a)(h,w,s.i(u.a)(C)):h}},function(o,r,s){'use strict';var u=s(132);r.a=function(f,h,w){return f&&f.length&&h&&h.length?s.i(u.a)(f,h,void 0,w):f}},function(o,r,s){'use strict';var d=s(27),u=s(433),f=s(23),h=s(200),w=s(459),C=s(36),T=s(8),P=s.i(T.a)(function(S,E){E=s.i(f.a)(E,1);var O=S?S.length:0,V=s.i(u.a)(S,E);return s.i(h.a)(S,s.i(d.a)(E,function(R){return s.i(C.a)(R,O)?+R:R}).sort(w.a)),V});r.a=P},function(o,r,s){'use strict';var u=s(10),f=s(200);r.a=function(h,w){var C=[];if(!(h&&h.length))return C;var T=-1,P=[],S=h.length;for(w=s.i(u.a)(w,3);++Tw?0:w)):[]}},function(o,r,s){'use strict';var u=s(35),f=s(16);r.a=function(h,w,C){var T=h?h.length:0;return T?(w=C||void 0===w?1:s.i(f.a)(w),w=T-w,s.i(u.a)(h,0>w?0:w,T)):[]}},function(o,r,s){'use strict';var u=s(10),f=s(87);r.a=function(h,w){return h&&h.length?s.i(f.a)(h,s.i(u.a)(w,3),!1,!0):[]}},function(o,r,s){'use strict';var u=s(10),f=s(87);r.a=function(h,w){return h&&h.length?s.i(f.a)(h,s.i(u.a)(w,3)):[]}},function(o,r,s){'use strict';var u=s(148),f=s(15),h=s(44),w=0/0,C=/^\s+|\s+$/g,T=/^[-+]0x[0-9a-f]+$/i,P=/^0b[01]+$/i,S=/^0o[0-7]+$/i,E=parseInt;r.a=function(O){if('number'==typeof O)return O;if(s.i(h.a)(O))return w;if(s.i(f.a)(O)){var V=s.i(u.a)(O.valueOf)?O.valueOf():O;O=s.i(f.a)(V)?V+'':V}if('string'!=typeof O)return 0===O?O:+O;O=O.replace(C,'');var R=P.test(O);return R||S.test(O)?E(O.slice(2),R?2:8):T.test(O)?w:+O}},function(o,r,s){'use strict';var d=s(23),u=s(42),f=s(14),h=s(8),w=s.i(h.a)(function(C){return s.i(u.a)(s.i(d.a)(C,1,f.a,!0))});r.a=w},function(o,r,s){'use strict';var d=s(23),u=s(10),f=s(42),h=s(14),w=s(19),C=s(8),T=s.i(C.a)(function(P){var S=s.i(w.a)(P);return s.i(h.a)(S)&&(S=void 0),s.i(f.a)(s.i(d.a)(P,1,h.a,!0),s.i(u.a)(S))});r.a=T},function(o,r,s){'use strict';var d=s(23),u=s(42),f=s(14),h=s(19),w=s(8),C=s.i(w.a)(function(T){var P=s.i(h.a)(T);return s.i(f.a)(P)&&(P=void 0),s.i(u.a)(s.i(d.a)(T,1,f.a,!0),void 0,P)});r.a=C},function(o,r,s){'use strict';var u=s(42);r.a=function(f){return f&&f.length?s.i(u.a)(f):[]}},function(o,r,s){'use strict';var u=s(10),f=s(42);r.a=function(h,w){return h&&h.length?s.i(f.a)(h,s.i(u.a)(w)):[]}},function(o,r,s){'use strict';var u=s(42);r.a=function(f,h){return f&&f.length?s.i(u.a)(f,void 0,h):[]}},function(o,r,s){'use strict';var d=s(68),u=s(14),f=s(8),h=s.i(f.a)(function(w,C){return s.i(u.a)(w)?s.i(d.a)(w,C):[]});r.a=h},function(o,r,s){'use strict';var d=s(83),u=s(135),f=s(14),h=s(8),w=s.i(h.a)(function(C){return s.i(u.a)(s.i(d.a)(C,f.a))});r.a=w},function(o,r,s){'use strict';var d=s(83),u=s(10),f=s(135),h=s(14),w=s(19),C=s(8),T=s.i(C.a)(function(P){var S=s.i(w.a)(P);return s.i(h.a)(S)&&(S=void 0),s.i(f.a)(s.i(d.a)(P,h.a),s.i(u.a)(S))});r.a=T},function(o,r,s){'use strict';var d=s(83),u=s(135),f=s(14),h=s(19),w=s(8),C=s.i(w.a)(function(T){var P=s.i(h.a)(T);return s.i(f.a)(P)&&(P=void 0),s.i(u.a)(s.i(d.a)(T,f.a),void 0,P)});r.a=C},function(o,r,s){'use strict';var d=s(8),u=s(99),f=s.i(d.a)(u.a);r.a=f},function(o,r,s){'use strict';var u=s(67),f=s(203);r.a=function(h,w){return s.i(f.a)(h||[],w||[],u.a)}},function(o,r,s){'use strict';var u=s(448),f=s(203);r.a=function(h,w){return s.i(f.a)(h||[],w||[],u.a)}},function(o,r,s){'use strict';var d=s(8),u=s(151),f=s.i(d.a)(function(h){var w=h.length,C=1{const{batch:E,match:O}=S,V=O[1].length;this.editor.execute(`heading${V}`,{batch:E})})}_addInlineAutoformats(){new u.a(this.editor,/(\*\*)([^\*]+)(\*\*)$/g,'bold'),new u.a(this.editor,/(__)([^_]+)(__)$/g,'bold'),new u.a(this.editor,/(?:^|[^\*])(\*)([^\*_]+)(\*)$/g,'italic'),new u.a(this.editor,/(?:^|[^_])(_)([^_]+)(_)$/g,'italic')}}r.a=P},function(o,r,s){'use strict';var d=s(3),u=s(155),f=s(26),h=s(297),w=s.n(h);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class C extends d.a{static get requires(){return[u.a]}init(){const T=this.editor,P=T.t,S=T.commands.get('bold'),E='CTRL+B';T.ui.componentFactory.add('bold',(O)=>{const V=new f.a(O);return V.set({label:P('Bold'),icon:w.a,keystroke:E,tooltip:!0}),V.bind('isOn','isEnabled').to(S,'value','isEnabled'),this.listenTo(V,'execute',()=>T.execute('bold')),V}),T.keystrokes.set(E,'bold')}}r.a=C},function(o,r,s){'use strict';var d=s(3),u=s(156),f=s(26),h=s(298),w=s.n(h);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class C extends d.a{static get requires(){return[u.a]}init(){const T=this.editor,P=T.t,S=T.commands.get('italic'),E='CTRL+I';T.ui.componentFactory.add('italic',(O)=>{const V=new f.a(O);return V.set({label:P('Italic'),icon:w.a,keystroke:E,tooltip:!0}),V.bind('isOn','isEnabled').to(S,'value','isEnabled'),this.listenTo(V,'execute',()=>T.execute('italic')),V}),T.keystrokes.set(E,'italic')}}r.a=C},function(o){'use strict';/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */o.exports={toolbar:['headings','bold','italic','link','unlink','bulletedList','numberedList','undo','redo']}},function(o,r,s){'use strict';var d=s(3),u=s(317),f=s(320),h=s(319),w=s(162);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class C extends d.a{init(){const T=this.editor,P=T.document,S=T.editing.view;this._htmlDataProcessor=new w.a,S.addObserver(u.a),this.listenTo(S,'paste',(O,V)=>{const R=V.dataTransfer;let F='';R.getData('text/html')?F=s.i(h.a)(R.getData('text/html')):R.getData('text/plain')&&(F=s.i(f.a)(R.getData('text/plain'))),F=this._htmlDataProcessor.toView(F),V.preventDefault(),S.fire('clipboardInput',{dataTransfer:R,content:F})},{priority:'low'}),this.listenTo(S,'clipboardInput',(O,V)=>{if(!V.content.isEmpty){const R=this.editor.data,F=R.toModel(V.content,'$clipboardHolder');P.enqueueChanges(()=>{R.insertContent(F,P.selection)})}},{priority:'low'});const E=(O,V)=>{const R=V.dataTransfer,F=T.data.toView(T.data.getSelectedContent(P.selection));V.preventDefault(),S.fire('clipboardOutput',{dataTransfer:R,content:F,method:O.name})};this.listenTo(S,'copy',E,{priority:'low'}),this.listenTo(S,'cut',E,{priority:'low'}),this.listenTo(S,'clipboardOutput',(O,V)=>{V.content.isEmpty||V.dataTransfer.setData('text/html',this._htmlDataProcessor.toData(V.content)),'cut'==V.method&&P.enqueueChanges(()=>{T.data.deleteContent(P.selection,P.batch(),{merge:!0})})},{priority:'low'})}}r.a=C},function(o,r,s){'use strict';var d=s(323),u=s(162),f=s(325),h=s(326),w=s(420),C=s(308),T=s.n(C);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class P extends d.a{constructor(S,E){super(S,E),this.document.createRoot(),this.data.processor=new u.a,this.ui=new f.a(this,new h.a(this.locale)),this._elementReplacer=new w.a}destroy(){return this.updateEditorElement(),this._elementReplacer.restore(),this.ui.destroy().then(()=>super.destroy())}static create(S,E){return new Promise((O)=>{const V=new this(S,E);O(V.initPlugins().then(()=>V._elementReplacer.replace(S,V.ui.view.element)).then(()=>V.ui.init()).then(()=>V.fire('uiReady')).then(()=>V.editing.view.attachDomRoot(V.ui.view.editableElement)).then(()=>V.loadDataFromEditorElement()).then(()=>{V.fire('dataReady'),V.fire('ready')}).then(()=>V))})}}r.a=P},function(o,r,s){'use strict';var d=s(3),u=s(359),f=s(360);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class h extends d.a{init(){const w=this.editor,C=w.editing.view;C.addObserver(f.a),w.commands.set('enter',new u.a(w)),this.listenTo(C,'enter',(T,P)=>{w.execute('enter'),P.preventDefault()},{priority:'low'})}}r.a=h},function(o,r,s){'use strict';function d(O,V){return Array.prototype.concat(...O.map((R)=>[R,V]))}var u=s(71),f=s(173),h=s(3),w=s(401),C=s(392),T=s(79),P=s(309),S=s.n(P);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class E extends h.a{static get requires(){return[u.a,f.a]}init(){const O=this.editor,V=new T.a,R=this._getLocalizedOptions(),F=[],N=O.t,M=N('Heading');for(let L of R){const D=O.commands.get(L.modelElement),q=new w.a({commandName:L.modelElement,label:L.title,class:L.class});q.bind('isActive').to(D,'value'),V.add(q),F.push(D)}const I=new w.a({withText:!0,items:V,tooltip:M});I.bind('isEnabled').to(...d(F,'isEnabled'),(...L)=>L.some((D)=>D)),I.bind('label').to(...d(F,'value'),(...L)=>{const D=L.findIndex((q)=>q);return R[D]?R[D].title:M}),O.ui.componentFactory.add('headings',(L)=>{const D=s.i(C.a)(I,L);return this.listenTo(D,'execute',(q)=>{O.execute(q.source.commandName),O.editing.view.focus()}),D})}_getLocalizedOptions(){const O=this.editor,V=O.t,R={Paragraph:V('Paragraph'),'Heading 1':V('Heading 1'),'Heading 2':V('Heading 2'),'Heading 3':V('Heading 3')};return O.config.get('heading.options').map((F)=>{const N=R[F.title];return N&&N!=F.title&&(F=Object.assign({},F,{title:N})),F})}}r.a=E},function(o,r,s){'use strict';var d=s(3),u=s(174),f=s(372),h=s(368),w=s(312),C=s.n(w);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class T extends d.a{static get requires(){return[u.a,f.a,h.a]}}r.a=T},function(o,r,s){'use strict';var d=s(3),u=s(363),f=s(310),h=s.n(f);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class w extends d.a{static get requires(){return[u.a]}}r.a=w},function(o,r,s){'use strict';var d=s(3),u=s(367),f=s(26);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class h extends d.a{static get requires(){return[u.a]}init(){const w=this.editor.config.get('image.styles');for(let T of w)this._createButton(T);const C=this.editor.config.get('image.defaultToolbar');C&&(C.length&&C.push('|'),w.forEach((T)=>C.push(T.name)))}_createButton(w){const C=this.editor,T=C.commands.get(w.name);C.ui.componentFactory.add(w.name,(P)=>{const S=new f.a(P);return S.set({label:w.title,icon:w.icon,tooltip:!0}),S.bind('isEnabled').to(T,'isEnabled'),S.bind('isOn').to(T,'value'),this.listenTo(S,'execute',()=>C.execute(w.name)),S})}}r.a=h},function(o,r,s){'use strict';function d(I){return I.parent.getAncestors().find((L)=>L instanceof w.a)}var u=s(3),f=s(351),h=s(374),w=s(178),C=s(181),T=s(26),P=s(185),S=s(375),E=s(302),O=s.n(E),V=s(303),R=s.n(V),F=s(313),N=s.n(F);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class M extends u.a{static get requires(){return[h.a]}init(){this.editor.editing.view.addObserver(f.a),this.balloonPanelView=this._createBalloonPanel(),this.formView=this._createForm(),this._createToolbarLinkButton(),this._createToolbarUnlinkButton()}_createToolbarLinkButton(){const I=this.editor,L=I.commands.get('link'),D=I.t;I.keystrokes.set('CTRL+K',()=>this._showPanel()),I.ui.componentFactory.add('link',(q)=>{const z=new T.a(q);return z.isEnabled=!0,z.label=D('Link'),z.icon=O.a,z.keystroke='CTRL+K',z.tooltip=!0,z.bind('isEnabled').to(L,'isEnabled'),this.listenTo(z,'execute',()=>this._showPanel()),z})}_createToolbarUnlinkButton(){const I=this.editor,L=I.t,D=I.commands.get('unlink');I.ui.componentFactory.add('unlink',(q)=>{const z=new T.a(q);return z.isEnabled=!1,z.label=L('Unlink'),z.icon=R.a,z.tooltip=!0,z.bind('isEnabled').to(D,'isEnabled'),this.listenTo(z,'execute',()=>I.execute('unlink')),z})}_createBalloonPanel(){const I=this.editor,L=I.editing.view,D=new P.a(I.locale);return D.maxWidth=300,I.ui.focusTracker.add(D.element),this.listenTo(L,'click',()=>{const q=L.selection,z=d(q.getFirstPosition());q.isCollapsed&&z&&(this._attachPanelToElement(),this.listenTo(L,'render',()=>{const $=d(q.getFirstPosition());q.isCollapsed&&z===$?this._attachPanelToElement(z):this._hidePanel()}),this.listenTo(D,'change:isVisible',()=>this.stopListening(L,'render')))}),I.keystrokes.set('Tab',(q,z)=>{D.isVisible&&!this.formView.focusTracker.isFocused&&(this.formView.focus(),z())}),I.keystrokes.set('Esc',(q,z)=>{D.isVisible&&(this._hidePanel(!0),z())}),s.i(C.a)({emitter:D,activator:()=>D.isVisible,contextElement:D.element,callback:()=>this._hidePanel()}),I.ui.view.body.add(D),D}_createForm(){const I=this.editor,L=new S.a(I.locale);return L.urlInputView.bind('value').to(I.commands.get('link'),'value'),this.listenTo(L,'submit',()=>{I.execute('link',L.urlInputView.inputView.element.value),this._hidePanel(!0)}),this.listenTo(L,'unlink',()=>{I.execute('unlink'),this._hidePanel(!0)}),L.keystrokes.set('Esc',(D,q)=>{this._hidePanel(!0),q()}),this.listenTo(L,'cancel',()=>this._hidePanel(!0)),this.balloonPanelView.content.add(L),L}_attachPanelToElement(I){const L=this.editor.editing.view,D=I||d(L.selection.getFirstPosition()),q=D?L.domConverter.getCorrespondingDomElement(D):L.domConverter.viewRangeToDom(L.selection.getFirstRange());this.balloonPanelView.attachTo({target:q,limiter:L.domConverter.getCorrespondingDomElement(L.selection.editableElement)})}_hidePanel(I){this.balloonPanelView.hide(),I&&this.editor.editing.view.focus()}_showPanel(){this._attachPanelToElement(),this.formView.urlInputView.select()}}r.a=M},function(o,r,s){'use strict';var d=s(179),u=s(305),f=s.n(u),h=s(304),w=s.n(h),C=s(3),T=s(22),P=s(26);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class S extends C.a{static get requires(){return[d.a]}init(){const E=this.editor.t;this._addButton('numberedList',E('Numbered List'),f.a),this._addButton('bulletedList',E('Bulleted List'),w.a),this.listenTo(this.editor.editing.view,'enter',(O,V)=>{const R=this.editor.document,F=R.selection.getLastPosition().parent;R.selection.isCollapsed&&'listItem'==F.name&&F.isEmpty&&(this.editor.execute('outdentList'),V.preventDefault(),O.stop())}),this.listenTo(this.editor.editing.view,'keydown',(O,V)=>{let R;if(V.keystroke==s.i(T.d)('Tab')?R='indentList':V.keystroke==s.i(T.d)('Shift+Tab')&&(R='outdentList'),R){const F=this.editor.commands.get(R);F.isEnabled&&(this.editor.execute(R),V.preventDefault(),O.stop())}})}_addButton(E,O,V){const R=this.editor,F=R.commands.get(E);R.ui.componentFactory.add(E,(N)=>{const M=new P.a(N);return M.set({label:O,icon:V,tooltip:!0}),M.bind('isOn','isEnabled').to(F,'value','isEnabled'),this.listenTo(M,'execute',()=>R.execute(E)),M})}}r.a=S},function(o,r,s){'use strict';var d=s(3),u=s(385),f=s(382);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class h extends d.a{static get requires(){return[u.a,f.a]}}r.a=h},function(o,r,s){'use strict';var d=s(3),u=s(407),f=s(26),h=s(307),w=s.n(h),C=s(306),T=s.n(C);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class P extends d.a{static get requires(){return[u.a]}init(){const S=this.editor,E=S.t;this._addButton('undo',E('Undo'),'CTRL+Z',w.a),this._addButton('redo',E('Redo'),'CTRL+Y',T.a),S.keystrokes.set('CTRL+Z','undo'),S.keystrokes.set('CTRL+Y','redo'),S.keystrokes.set('CTRL+SHIFT+Z','redo')}_addButton(S,E,O,V){const R=this.editor,F=R.commands.get(S);R.ui.componentFactory.add(S,(N)=>{const M=new f.a(N);return M.set({label:E,icon:V,keystroke:O,tooltip:!0}),M.bind('isEnabled').to(F,'isEnabled'),this.listenTo(M,'execute',()=>R.execute(S)),M})}}r.a=P},function(o,r,s){r=o.exports=s(45)(),r.push([o.i,'@charset "UTF-8";\n/**\n * Makes element unselectable.\n */\n/**\n * A class which hides an element in DOM.\n */\n.ck-hidden {\n display: none; }\n\n/**\n * Wraps (S)CSS into .ck-editor namespace.\n */\n/**\n * Resets an element, ignoring its children.\n */\n.ck-reset, .ck-reset_all, .ck-reset_all *, .ck-reset_all a, .ck-reset_all textarea {\n box-sizing: border-box;\n width: auto;\n height: auto;\n position: static; }\n\n/**\n * Resets an element AND its children.\n */\n/**\n * Default width/height of an icon.\n */\nsvg.ck-icon {\n min-width: 20px;\n min-height: 20px;\n font-size: 1em;\n vertical-align: middle;\n color: inherit;\n cursor: inherit; }\n svg.ck-icon * {\n cursor: inherit;\n color: inherit;\n fill: currentColor; }\n\n/**\n * Applies styles to the main part of the tooltip.\n */\n/**\n * Applies styles to the arrow part of the tooltip.\n */\n/**\n * Applies styles to both arrow and main part of the tooltip.\n */\n/**\n * Enables the tooltip, which is the tooltip is in DOM but\n * not yet displayed.\n */\n/**\n * Disables the tooltip making it disappear from DOM.\n */\n/**\n * Shows the tooltip, which is already in DOM.\n * Requires `ck-tooltip_enabled` first.\n */\n[data-ck-tooltip]::after {\n visibility: hidden;\n opacity: 0;\n display: none;\n position: absolute;\n z-index: 999;\n pointer-events: none;\n -webkit-backface-visibility: hidden; }\n\n[data-ck-tooltip]::before {\n visibility: hidden;\n opacity: 0;\n display: none;\n position: absolute;\n z-index: 999;\n pointer-events: none;\n -webkit-backface-visibility: hidden; }\n\n[data-ck-tooltip]::after {\n content: attr(data-ck-tooltip); }\n\n[data-ck-tooltip]::before {\n content: "";\n width: 0;\n height: 0; }\n\n.ck-button,\na.ck-button {\n display: inline-block;\n position: relative;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none; }\n .ck-button::after,\n a.ck-button::after {\n display: block; }\n .ck-button::before,\n a.ck-button::before {\n display: block; }\n .ck-button.ck-button_with-text .ck-button__label,\n a.ck-button.ck-button_with-text .ck-button__label {\n display: block; }\n .ck-button:hover::after,\n a.ck-button:hover::after {\n visibility: visible;\n opacity: 1; }\n .ck-button:hover::before,\n a.ck-button:hover::before {\n visibility: visible;\n opacity: 1; }\n .ck-button:focus:not(:hover)::after,\n a.ck-button:focus:not(:hover)::after {\n display: none; }\n .ck-button:focus:not(:hover)::before,\n a.ck-button:focus:not(:hover)::before {\n display: none; }\n .ck-button .ck-button__label,\n a.ck-button .ck-button__label {\n display: none; }\n\n.ck-toolbar {\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none; }\n .ck-toolbar__separator {\n display: inline-block; }\n .ck-toolbar__newline {\n display: block;\n clear: left; }\n\n.ck-dropdown {\n display: inline-block;\n position: relative; }\n .ck-dropdown::after {\n content: \'\';\n width: 0;\n height: 0;\n pointer-events: none;\n z-index: 1;\n position: absolute;\n top: 50%;\n transform: translate(0, -50%); }\n\n.ck-dropdown__panel {\n -webkit-backface-visibility: hidden;\n display: none;\n z-index: 999;\n position: absolute;\n left: 0px;\n transform: translateY(100%); }\n .ck-dropdown__panel-visible {\n display: inline-block; }\n\n.ck-list {\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none; }\n .ck-list__item {\n display: block; }\n\n.ck-label {\n display: block; }\n\n.cke-voice-label {\n display: none; }\n\n.ck-balloon-panel {\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n display: none;\n position: absolute;\n z-index: 999; }\n .ck-balloon-panel:before, .ck-balloon-panel:after {\n content: "";\n position: absolute; }\n .ck-balloon-panel:before {\n z-index: 1; }\n .ck-balloon-panel:after {\n z-index: 2; }\n .ck-balloon-panel_arrow_s:before, .ck-balloon-panel_arrow_se:before, .ck-balloon-panel_arrow_sw:before {\n z-index: 1; }\n .ck-balloon-panel_arrow_s:after, .ck-balloon-panel_arrow_se:after, .ck-balloon-panel_arrow_sw:after {\n z-index: 2; }\n .ck-balloon-panel_arrow_n:before, .ck-balloon-panel_arrow_ne:before, .ck-balloon-panel_arrow_nw:before {\n z-index: 1; }\n .ck-balloon-panel_arrow_n:after, .ck-balloon-panel_arrow_ne:after, .ck-balloon-panel_arrow_nw:after {\n z-index: 2; }\n .ck-balloon-panel_visible {\n display: block; }\n\n.ck-floating-panel {\n position: absolute;\n display: none; }\n .ck-floating-panel_active {\n display: block; }\n\n.ck-editor .ck-toolbar.ck-toolbar_sticky {\n position: fixed;\n top: 0; }\n .ck-editor .ck-toolbar.ck-toolbar_sticky.ck-toolbar_sticky_bottom-limit {\n top: auto;\n position: absolute; }\n\n/**\n * Colors configured by the user.\n *\n * @type Map\n * @example\n *\t\t$ck-colors: ( \'foreground\': red );\n * @see $_ck-colors\n */\n/**\n * Internal map with default colors.\n *\n * @type Map\n * @see ck-color-add\n */\n/**\n * Returns a color of given name and lightness offset.\n *\n * @param {String} $name [ \'background\' ] - Name of the color.\n * @param {Number} $offset [ 0 ] - Offset of the lightness.\n * @return {String}\n * @see $_ck-colors\n */\n/**\n * Returns a border\u2013color for a given name and lightness offset.\n *\n * @param {String} $name [ \'background\' ] - Name of the color.\n * @param {Number} $offset [ 0 ] - Offset of the lightness.\n * @return {String}\n * @see $ck-color\n */\n/**\n * Adds a color to internal color map.\n *\n * @example\n *\t\t@include ck-color-add( ( \'special\': yellow, \'hover\': #00FF00 ) );\n * @param {Map} $map - A map with new colors.\n * @see $_ck-colors\n */\n/**\n * Base font size.\n *\n * @see $ck-font-sizes\n */\n/**\n * Base font face.\n *\n */\n/**\n * Base font sizes for scaling.\n *\n * @see ck-font-size\n */\n/**\n * Returns font-size in units for given level.\n *\n * @param {Number} $level [ 0 ] - Size of the font.\n * @return {String}\n * @see $ck-font-sizes\n * @see $ck-font-size-base\n */\n/**\n * Default border-radius value.\n *\n */\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n/**\n * Default spacing value ("unit").\n *\n */\n/**\n * Internal map with default spacings.\n *\n * @type Map\n * @see ck-spacing\n */\n/**\n * Returns a spacing value with units for given name.\n *\n * @param {String} $spacing [ \'standard\' ] - Spacing level.\n * @return {String}\n * @see $ck-def-spacing\n * @see $ck-def-spacings\n */\n/**\n * A visual style of focused element\'s outer shadow.\n */\n/**\n * A visual style of focused element\'s border or outline.\n */\n/**\n * A class which indicates that an element holding it is disabled.\n */\n.ck-disabled {\n opacity: .5; }\n\n/**\n * A visual style of focused element\'s border or outline.\n */\n/**\n * Brings visual styling for :focus state.\n */\n/**\n * A visual style of element\'s inner shadow (i.e. input).\n */\n/**\n * A visual style of element\'s drop shadow (i.e. panel).\n */\n/**\n * A helper to combine multiple shadows.\n */\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n/**\n * Resets an element, ignoring its children.\n */\n.ck-reset, .ck-reset_all, .ck-reset_all *, .ck-reset_all a, .ck-reset_all textarea {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n text-decoration: none;\n vertical-align: middle;\n transition: none; }\n\n/**\n * Resets an element AND its children.\n */\n.ck-reset_all, .ck-reset_all *, .ck-reset_all a, .ck-reset_all textarea {\n border-collapse: collapse;\n font: normal normal normal 12px Helvetica, Arial, Tahoma, Verdana, Sans-Serif;\n color: #333333;\n text-align: left;\n white-space: nowrap;\n cursor: auto;\n float: none; }\n\n.ck-reset_all .ck-rtl * {\n text-align: right; }\n\n.ck-reset_all iframe {\n vertical-align: inherit; }\n\n.ck-reset_all textarea {\n white-space: pre-wrap; }\n\n.ck-reset_all textarea,\n.ck-reset_all input[type="text"],\n.ck-reset_all input[type="password"] {\n cursor: text; }\n\n.ck-reset_all textarea[disabled],\n.ck-reset_all input[type="text"][disabled],\n.ck-reset_all input[type="password"][disabled] {\n cursor: default; }\n\n.ck-reset_all fieldset {\n padding: 10px;\n border: 2px groove #E0DFE3; }\n\n.ck-reset_all button::-moz-focus-inner {\n padding: 0;\n border: 0; }\n\nsvg.ck-icon {\n width: 1.66667em;\n height: 1.66667em; }\n\n[data-ck-tooltip]::after {\n left: 50%;\n transition: opacity .2s ease-in-out .2s; }\n\n[data-ck-tooltip]::before {\n left: 50%;\n transition: opacity .2s ease-in-out .2s; }\n\n[data-ck-tooltip]::after {\n border-radius: 2px;\n color: white;\n font-size: 0.7rem;\n background: #333333;\n padding: 0.4em 0.64em; }\n\n[data-ck-tooltip]::before {\n border-style: solid; }\n\n/**\n * A class once applied displays the tooltip south of the element.\n *\n * [element]\n * ^\n * +-----------+\n * | Tooltip |\n * +-----------+\n */\n.ck-tooltip_s::after {\n bottom: -4px;\n transform: translate(-50%, 100%); }\n\n.ck-tooltip_s::before {\n bottom: 0;\n transform: translate(-50%, 100%);\n border-color: transparent transparent #333333 transparent;\n border-width: 0 5px 5px 5px; }\n\n/**\n * A class once applied displays the tooltip north of the element.\n *\n * +-----------+\n * | Tooltip |\n * +-----------+\n * V\n * [element]\n */\n.ck-tooltip_n::after {\n top: -4px;\n transform: translate(-50%, -100%); }\n\n.ck-tooltip_n::before {\n top: 0;\n transform: translate(-50%, -100%);\n border-color: #333333 transparent transparent transparent;\n border-width: 5px 5px 0 5px; }\n\n/**\n * Implements a button of given background color.\n *\n * @param {String} $color - Background color of the button.\n */\n/**\n * Implements button states.\n *\n * @param {String} $color - Background color of the button.\n */\n/**\n * A helper to define button\u2013specific icon styles.\n *\n */\n.ck-button,\na.ck-button {\n background: white;\n border-color: #bfbfbf;\n border-width: 1px;\n border-style: solid;\n white-space: nowrap;\n cursor: default;\n vertical-align: middle;\n padding: 0.4em;\n line-height: 1.66667; }\n .ck-button:not(.ck-disabled):hover, .ck-button:not(.ck-disabled):focus,\n a.ck-button:not(.ck-disabled):hover,\n a.ck-button:not(.ck-disabled):focus {\n background: #e6e6e6;\n border-color: #a6a6a6; }\n .ck-button:not(.ck-disabled):active,\n a.ck-button:not(.ck-disabled):active {\n background: #d9d9d9;\n border-color: #999999;\n box-shadow: inset 0 2px 2px #bfbfbf; }\n .ck-button.ck-rounded-corners,\n .ck-rounded-corners .ck-button,\n a.ck-button.ck-rounded-corners,\n .ck-rounded-corners\n a.ck-button {\n border-radius: 2px; }\n .ck-button:focus,\n a.ck-button:focus {\n outline: none;\n border: 1px solid #6ab5f9;\n box-shadow: 0 0 3px 2px #9bcdfb; }\n .ck-button .ck-icon,\n a.ck-button .ck-icon {\n float: left; }\n .ck-button.ck-button_with-text,\n a.ck-button.ck-button_with-text {\n padding: 0.4em 0.8em; }\n .ck-button.ck-button_with-text .ck-icon,\n a.ck-button.ck-button_with-text .ck-icon {\n margin-left: -0.4em;\n margin-right: 0.4em; }\n .ck-button.ck-button_with-text .ck-button__label,\n a.ck-button.ck-button_with-text .ck-button__label {\n display: block; }\n .ck-button.ck-on,\n a.ck-button.ck-on {\n background: #f7f7f7;\n border-color: #b9b9b9; }\n .ck-button.ck-on:not(.ck-disabled):hover, .ck-button.ck-on:not(.ck-disabled):focus,\n a.ck-button.ck-on:not(.ck-disabled):hover,\n a.ck-button.ck-on:not(.ck-disabled):focus {\n background: #dedede;\n border-color: #a1a1a1; }\n .ck-button.ck-on:not(.ck-disabled):active,\n a.ck-button.ck-on:not(.ck-disabled):active {\n background: #d2d2d2;\n border-color: #949494;\n box-shadow: inset 0 2px 2px #b9b9b9; }\n .ck-button-action,\n a.ck-button-action {\n background: #61b145;\n border-color: #498534;\n text-shadow: 0 -1px #4e8e37;\n color: white; }\n .ck-button-action:not(.ck-disabled):hover, .ck-button-action:not(.ck-disabled):focus,\n a.ck-button-action:not(.ck-disabled):hover,\n a.ck-button-action:not(.ck-disabled):focus {\n background: #579f3e;\n border-color: #3f732d; }\n .ck-button-action:not(.ck-disabled):active,\n a.ck-button-action:not(.ck-disabled):active {\n background: #52963b;\n border-color: #3a6a29;\n box-shadow: inset 0 2px 2px #498534; }\n .ck-button-action:hover, .ck-button-action:focus, .ck-button-action:active,\n a.ck-button-action:hover,\n a.ck-button-action:focus,\n a.ck-button-action:active {\n text-shadow: 0 -1px #3a6a29; }\n .ck-button-bold,\n a.ck-button-bold {\n font-weight: bold; }\n .ck-button .ck-icon use,\n .ck-button .ck-icon use *,\n a.ck-button .ck-icon use,\n a.ck-button .ck-icon use * {\n color: inherit; }\n .ck-button .ck-button__label,\n a.ck-button .ck-button__label {\n float: left;\n line-height: inherit;\n font-size: inherit;\n font-weight: inherit;\n color: inherit;\n cursor: inherit; }\n\n.ck-toolbar {\n line-height: 1;\n padding: 0.4em;\n border: 1px solid #bfbfbf;\n white-space: initial;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none; }\n .ck-toolbar.ck-rounded-corners,\n .ck-rounded-corners .ck-toolbar {\n border-radius: 2px; }\n .ck-toolbar__separator {\n width: 1px;\n height: calc( 1em + 2 * 0.64em);\n vertical-align: middle;\n background: #bfbfbf; }\n .ck-toolbar__newline {\n height: 0.4em; }\n .ck-toolbar > * {\n margin-right: 0.4em; }\n .ck-toolbar > *:last-child {\n margin-right: 0; }\n\n.ck-dropdown::after {\n border-style: solid;\n border-width: .4em .4em 0 .4em;\n border-color: #707070 transparent;\n right: 0.8em; }\n\n.ck-dropdown .ck-button.ck-dropdown__button {\n padding-right: 1.6em; }\n .ck-dropdown .ck-button.ck-dropdown__button .ck-button__label {\n width: 7em;\n overflow: hidden;\n text-overflow: ellipsis; }\n\n.ck-dropdown__panel {\n border: 1px solid #b9b9b9;\n bottom: 1px;\n background: white;\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2); }\n .ck-dropdown__panel.ck-rounded-corners,\n .ck-rounded-corners .ck-dropdown__panel {\n border-radius: 2px; }\n\n.ck-list {\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n list-style-type: none;\n background: white; }\n .ck-list.ck-rounded-corners,\n .ck-rounded-corners .ck-list {\n border-radius: 2px; }\n .ck-list__item {\n padding: 0.64em;\n cursor: default;\n min-width: 12em; }\n .ck-list__item:hover, .ck-list__item:focus {\n background: #f7f7f7; }\n .ck-list__item:focus {\n box-shadow: 0 0 3px 2px #9bcdfb;\n position: relative;\n z-index: 1;\n outline: none; }\n .ck-list__item:last-of-type {\n border: none; }\n .ck-list__item_active {\n background: #1a8bf1;\n color: white; }\n .ck-list__item_active:hover, .ck-list__item_active:focus {\n background: #0e7ee2; }\n\n.ck-label {\n font-weight: bold; }\n\n.ck-input-text {\n box-shadow: 2px 2px 3px #e6e6e6 inset;\n border: 1px solid #b9b9b9;\n padding: 0.64em;\n min-width: 250px; }\n .ck-input-text.ck-rounded-corners,\n .ck-rounded-corners .ck-input-text {\n border-radius: 2px; }\n .ck-input-text:focus {\n outline: none;\n border: 1px solid #6ab5f9;\n box-shadow: 0 0 3px 2px #9bcdfb, 2px 2px 3px #e6e6e6 inset; }\n\n.ck-balloon-panel {\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);\n min-width: 50px;\n min-height: 15px;\n background: white;\n border: 1px solid #b9b9b9; }\n .ck-balloon-panel.ck-rounded-corners,\n .ck-rounded-corners .ck-balloon-panel {\n border-radius: 2px; }\n .ck-balloon-panel:before, .ck-balloon-panel:after {\n width: 0;\n height: 0;\n border-style: solid; }\n .ck-balloon-panel_arrow_s:before, .ck-balloon-panel_arrow_s:after, .ck-balloon-panel_arrow_se:before, .ck-balloon-panel_arrow_se:after, .ck-balloon-panel_arrow_sw:before, .ck-balloon-panel_arrow_sw:after {\n border-width: 0 10px 15px 10px; }\n .ck-balloon-panel_arrow_s:before, .ck-balloon-panel_arrow_se:before, .ck-balloon-panel_arrow_sw:before {\n border-color: transparent transparent #b9b9b9 transparent; }\n .ck-balloon-panel_arrow_s:after, .ck-balloon-panel_arrow_se:after, .ck-balloon-panel_arrow_sw:after {\n border-color: transparent transparent white transparent;\n margin-top: 2px; }\n .ck-balloon-panel_arrow_n:before, .ck-balloon-panel_arrow_n:after, .ck-balloon-panel_arrow_ne:before, .ck-balloon-panel_arrow_ne:after, .ck-balloon-panel_arrow_nw:before, .ck-balloon-panel_arrow_nw:after {\n border-width: 15px 10px 0 10px; }\n .ck-balloon-panel_arrow_n:before, .ck-balloon-panel_arrow_ne:before, .ck-balloon-panel_arrow_nw:before {\n border-color: #b9b9b9 transparent transparent; }\n .ck-balloon-panel_arrow_n:after, .ck-balloon-panel_arrow_ne:after, .ck-balloon-panel_arrow_nw:after {\n border-color: white transparent transparent transparent;\n margin-bottom: 2px; }\n .ck-balloon-panel_arrow_s:before, .ck-balloon-panel_arrow_s:after {\n left: 50%;\n margin-left: -10px;\n top: -15px; }\n .ck-balloon-panel_arrow_se:before, .ck-balloon-panel_arrow_se:after {\n left: 20px;\n top: -15px; }\n .ck-balloon-panel_arrow_sw:before, .ck-balloon-panel_arrow_sw:after {\n right: 20px;\n top: -15px; }\n .ck-balloon-panel_arrow_n:before, .ck-balloon-panel_arrow_n:after {\n left: 50%;\n margin-left: -10px;\n bottom: -15px; }\n .ck-balloon-panel_arrow_ne:before, .ck-balloon-panel_arrow_ne:after {\n left: 20px;\n bottom: -15px; }\n .ck-balloon-panel_arrow_nw:before, .ck-balloon-panel_arrow_nw:after {\n right: 20px;\n bottom: -15px; }\n\n.ck-floating-panel {\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #bfbfbf;\n background: #f7f7f7; }\n .ck-floating-panel.ck-rounded-corners,\n .ck-rounded-corners .ck-floating-panel {\n border-radius: 2px; }\n\n.ck-toolbar__container {\n background: #f7f7f7; }\n .ck-toolbar__container .ck-toolbar {\n border-radius: 0;\n border: 0; }\n .ck-toolbar__container .ck-toolbar .ck-button {\n border-width: 0; }\n .ck-toolbar__container .ck-toolbar .ck-button:not(:hover):not(:focus):not(.ck-on), .ck-toolbar__container .ck-toolbar .ck-button.ck-disabled {\n background: #f7f7f7; }\n .ck-toolbar__container .ck-toolbar .ck-button.ck-on {\n background: #dedede;\n border-color: #a1a1a1; }\n .ck-toolbar__container .ck-toolbar .ck-button.ck-on:not(.ck-disabled):hover, .ck-toolbar__container .ck-toolbar .ck-button.ck-on:not(.ck-disabled):focus {\n background: #c6c6c6;\n border-color: #888888; }\n .ck-toolbar__container .ck-toolbar .ck-button.ck-on:not(.ck-disabled):active {\n background: #b9b9b9;\n border-color: #7c7c7c;\n box-shadow: inset 0 2px 2px #a1a1a1; }\n .ck-toolbar__container .ck-toolbar .ck-dropdown__button {\n border-width: 1px; }\n .ck-toolbar__container .ck-toolbar .ck-dropdown__button:not(:hover):not(:focus):not(.ck-on) {\n background: white; }\n .ck-toolbar__container.ck-balloon-panel_arrow_s:after, .ck-toolbar__container.ck-balloon-panel_arrow_se:after, .ck-toolbar__container.ck-balloon-panel_arrow_sw:after {\n border-bottom-color: #f7f7f7; }\n .ck-toolbar__container.ck-balloon-panel_arrow_n:after, .ck-toolbar__container.ck-balloon-panel_arrow_ne:after, .ck-toolbar__container.ck-balloon-panel_arrow_nw:after {\n border-top-color: #f7f7f7; }\n\n.ck-editor .ck-toolbar.ck-toolbar_sticky {\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #bfbfbf;\n border-width: 0 0 1px;\n background: #f7f7f7; }\n\n.ck-editor {\n position: relative; }\n .ck-editor.ck-rounded-corners,\n .ck-rounded-corners .ck-editor {\n border-radius: 2px; }\n .ck-editor .ck-editor__top .ck-toolbar {\n border-radius: 0;\n border-top: 0;\n border-left: 0;\n border-right: 0; }\n .ck-editor .ck-editor__top .ck-toolbar .ck-button {\n border-width: 0; }\n .ck-editor .ck-editor__top .ck-toolbar .ck-button:not(:hover):not(:focus):not(.ck-on), .ck-editor .ck-editor__top .ck-toolbar .ck-button.ck-disabled {\n background: #f7f7f7; }\n .ck-editor .ck-editor__top .ck-toolbar .ck-button.ck-on {\n background: #dedede;\n border-color: #a1a1a1; }\n .ck-editor .ck-editor__top .ck-toolbar .ck-button.ck-on:not(.ck-disabled):hover, .ck-editor .ck-editor__top .ck-toolbar .ck-button.ck-on:not(.ck-disabled):focus {\n background: #c6c6c6;\n border-color: #888888; }\n .ck-editor .ck-editor__top .ck-toolbar .ck-button.ck-on:not(.ck-disabled):active {\n background: #b9b9b9;\n border-color: #7c7c7c;\n box-shadow: inset 0 2px 2px #a1a1a1; }\n .ck-editor .ck-editor__top .ck-toolbar .ck-dropdown__button {\n border-width: 1px; }\n .ck-editor .ck-editor__top .ck-toolbar .ck-dropdown__button:not(:hover):not(:focus):not(.ck-on) {\n background: white; }\n .ck-editor .ck-editor__main {\n background: white; }\n .ck-editor .ck-editor__bottom {\n border-bottom: 0;\n border-left: 0;\n border-right: 0;\n padding: 0.8em; }\n .ck-editor .ck-editor__editable.ck-focused {\n outline: 1px solid #6ab5f9;\n box-shadow: 2px 2px 3px #e6e6e6 inset; }\n .ck-editor .ck-editor__editable_inline {\n overflow: auto;\n padding: 0 0.8em; }\n\n.ck-editor,\n.ck-editor-bottom {\n background: #f7f7f7;\n border: 1px solid #b9b9b9; }\n',''])},function(o,r,s){r=o.exports=s(45)(),r.push([o.i,'/**\n * Default spacing value ("unit").\n *\n */\n/**\n * Internal map with default spacings.\n *\n * @type Map\n * @see ck-spacing\n */\n/**\n * Returns a spacing value with units for given name.\n *\n * @param {String} $spacing [ \'standard\' ] - Spacing level.\n * @return {String}\n * @see $ck-def-spacing\n * @see $ck-def-spacings\n */\n/**\n * Base font size.\n *\n * @see $ck-font-sizes\n */\n/**\n * Base font face.\n *\n */\n/**\n * Base font sizes for scaling.\n *\n * @see ck-font-size\n */\n/**\n * Returns font-size in units for given level.\n *\n * @param {Number} $level [ 0 ] - Size of the font.\n * @return {String}\n * @see $ck-font-sizes\n * @see $ck-font-size-base\n */\n.ck-heading_heading1 {\n font-size: 1.5em; }\n\n.ck-heading_heading2 {\n font-size: 1.3em; }\n\n.ck-heading_heading3 {\n font-size: 1.1em; }\n\n[class*="ck-heading_"] {\n line-height: 21.6px;\n padding: 9.6px; }\n\n[class*="ck-heading_heading"] {\n font-weight: bold; }\n',''])},function(o,r,s){r=o.exports=s(45)(),r.push([o.i,'@charset "UTF-8";\n/**\n * Colors configured by the user.\n *\n * @type Map\n * @example\n *\t\t$ck-colors: ( \'foreground\': red );\n * @see $_ck-colors\n */\n/**\n * Internal map with default colors.\n *\n * @type Map\n * @see ck-color-add\n */\n/**\n * Returns a color of given name and lightness offset.\n *\n * @param {String} $name [ \'background\' ] - Name of the color.\n * @param {Number} $offset [ 0 ] - Offset of the lightness.\n * @return {String}\n * @see $_ck-colors\n */\n/**\n * Returns a border\u2013color for a given name and lightness offset.\n *\n * @param {String} $name [ \'background\' ] - Name of the color.\n * @param {Number} $offset [ 0 ] - Offset of the lightness.\n * @return {String}\n * @see $ck-color\n */\n/**\n * Adds a color to internal color map.\n *\n * @example\n *\t\t@include ck-color-add( ( \'special\': yellow, \'hover\': #00FF00 ) );\n * @param {Map} $map - A map with new colors.\n * @see $_ck-colors\n */\n/**\n * A visual style of element\'s inner shadow (i.e. input).\n */\n/**\n * A visual style of element\'s drop shadow (i.e. panel).\n */\n/**\n * A helper to combine multiple shadows.\n */\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n/**\n * A visual style of focused element\'s outer shadow.\n */\n/**\n * A visual style of focused element\'s border or outline.\n */\n/**\n * A class which indicates that an element holding it is disabled.\n */\n.ck-disabled {\n opacity: .5; }\n\n/**\n * A visual style of focused element\'s border or outline.\n */\n/**\n * Brings visual styling for :focus state.\n */\n.ck-widget.image figcaption {\n background-color: #f7f7f7;\n padding: 10px;\n font-size: .8em;\n color: #858585; }\n .ck-widget.image figcaption:focus {\n outline: none;\n box-shadow: none; }\n .ck-widget.image figcaption.focused {\n outline: 1px solid #6ab5f9;\n box-shadow: 2px 2px 3px #e6e6e6 inset;\n background-color: white; }\n',''])},function(o,r,s){r=o.exports=s(45)(),r.push([o.i,'/**\n * Default spacing value ("unit").\n *\n */\n/**\n * Internal map with default spacings.\n *\n * @type Map\n * @see ck-spacing\n */\n/**\n * Returns a spacing value with units for given name.\n *\n * @param {String} $spacing [ \'standard\' ] - Spacing level.\n * @return {String}\n * @see $ck-def-spacing\n * @see $ck-def-spacings\n */\n.cke-text-alternative-form {\n padding: 1.2em;\n overflow: hidden; }\n .cke-text-alternative-form .ck-label {\n margin-bottom: 0.4em; }\n .cke-text-alternative-form__actions {\n clear: both;\n padding-top: 1.2em; }\n .cke-text-alternative-form__actions .ck-button {\n float: right; }\n .cke-text-alternative-form__actions .ck-button + .ck-button {\n margin-right: 0.64em; }\n .cke-text-alternative-form__actions .ck-button + .ck-button + .ck-button {\n float: left; }\n',''])},function(o,r,s){r=o.exports=s(45)(),r.push([o.i,'.ck-widget {\n margin: 10px 0;\n padding: 0; }\n .ck-widget.ck-widget_selected, .ck-widget.ck-widget_selected:hover {\n outline: 2px solid #ace; }\n .ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected {\n outline: 2px solid #ddd; }\n .ck-widget:hover {\n outline: 2px solid yellow; }\n\n.image {\n text-align: center;\n clear: both; }\n .image.image-style-side {\n float: right;\n margin-left: 0.8em;\n max-width: 50%; }\n\n.image > img {\n display: block;\n margin: 0 auto;\n max-width: 100%; }\n',''])},function(o,r,s){r=o.exports=s(45)(),r.push([o.i,'/**\n * Default spacing value ("unit").\n *\n */\n/**\n * Internal map with default spacings.\n *\n * @type Map\n * @see ck-spacing\n */\n/**\n * Returns a spacing value with units for given name.\n *\n * @param {String} $spacing [ \'standard\' ] - Spacing level.\n * @return {String}\n * @see $ck-def-spacing\n * @see $ck-def-spacings\n */\n.ck-link-form {\n padding: 1.2em;\n overflow: hidden; }\n .ck-link-form .ck-label {\n margin-bottom: 0.4em; }\n .ck-link-form__actions {\n clear: both;\n padding-top: 1.2em; }\n .ck-link-form__actions .ck-button {\n float: right; }\n .ck-link-form__actions .ck-button + .ck-button {\n margin-right: 0.64em; }\n .ck-link-form__actions .ck-button + .ck-button + .ck-button {\n float: left; }\n',''])},function(o){o.exports='\n\n \n bold\n Created with Sketch.\n \n \n \n \n \n \n \n \n'},function(o){o.exports='\n\n \n italic\n Created with Sketch.\n \n \n \n \n \n \n \n \n'},function(o){o.exports='\n'},function(o){o.exports='\n'},function(o){o.exports='\n'},function(o){o.exports='\n\n \n link\n Created with Sketch.\n \n \n \n \n \n \n \n \n \n \n \n'},function(o){o.exports='\n\n \n unlink\n Created with Sketch.\n \n \n \n \n \n \n \n \n \n \n \n'},function(o){o.exports='\n\n \n bulletedlist\n Created with Sketch.\n \n \n \n \n \n \n \n \n'},function(o){o.exports='\n\n \n numberedlist\n Created with Sketch.\n \n \n \n \n \n \n \n \n \n \n \n \n \n'},function(o){o.exports='\n\n \n redo\n Created with Sketch.\n \n \n \n \n \n \n \n \n'},function(o){o.exports='\n\n \n undo\n Created with Sketch.\n \n \n \n \n \n \n \n \n'},function(o,r,s){var d=s(291);'string'==typeof d&&(d=[[o.i,d,'']]);s(46)(d,{});d.locals&&(o.exports=d.locals),!1},function(o,r,s){var d=s(292);'string'==typeof d&&(d=[[o.i,d,'']]);s(46)(d,{});d.locals&&(o.exports=d.locals),!1},function(o,r,s){var d=s(293);'string'==typeof d&&(d=[[o.i,d,'']]);s(46)(d,{});d.locals&&(o.exports=d.locals),!1},function(o,r,s){var d=s(294);'string'==typeof d&&(d=[[o.i,d,'']]);s(46)(d,{});d.locals&&(o.exports=d.locals),!1},function(o,r,s){var d=s(295);'string'==typeof d&&(d=[[o.i,d,'']]);s(46)(d,{});d.locals&&(o.exports=d.locals),!1},function(o,r,s){var d=s(296);'string'==typeof d&&(d=[[o.i,d,'']]);s(46)(d,{});d.locals&&(o.exports=d.locals),!1},function(o){var s=function(){return this}();try{s=s||Function('return this')()||(1,eval)('this')}catch(d){'object'==typeof window&&(s=window)}o.exports=s},function(o,r,s){'use strict';var d=s(2),u=s(61);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=class{constructor(h,w,C){let T;if('function'==typeof C)T=C;else{T=(S)=>{const{batch:E}=S;h.execute(C,{batch:E})}}h.document.on('change',(P,S,E)=>{if('insert'!=S)return;const O=E.range.getItems().next().value;if(!(O instanceof u.a))return;const V=O.textNode,R=V.data;if('paragraph'!==V.parent.name||!R)return;const F=w.exec(R);F&&h.document.enqueueChanges(()=>{const N=h.document.batch(),M=d.a.createFromParentsAndOffsets(V.parent,0,V.parent,F[0].length);N.remove(M),T({batch:N,match:F})})})}}},function(o,r,s){'use strict';function d(w){return Array.from(w.getChildren()).reduce((C,T)=>C+T.data,'')}var u=s(110),f=s(100);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=class{constructor(w,C,T){this.editor=w;let P,S,E,O;C instanceof RegExp?P=C:E=C,'string'==typeof T?S=T:O=T,E=E||((V)=>{let R,F=[],N=[];for(;null!==(R=P.exec(V))&&!(R&&4>R.length);){let{index:M,1:I,2:L,3:D}=R;M+=R[0].length-(I+L+D).length;const z=[M,M+I.length],$=[M+I.length+L.length,M+I.length+L.length+D.length];F.push(z),F.push($),N.push([M+I.length,M+I.length+L.length])}return{remove:F,format:N}}),O=O||((V,R)=>{for(let F of R)V.setAttribute(F,S,!0)}),w.document.on('change',(V,R)=>{if('insert'!==R)return;const F=this.editor.document.selection;if(!F.isCollapsed||!F.focus||!F.focus.parent)return;const N=F.focus.parent,M=d(N).slice(0,F.focus.offset),I=E(M),L=[];I.format.forEach((z)=>{void 0===z[0]||void 0===z[1]||L.push(u.a.createFromParentsAndOffsets(N,z[0],N,z[1]))});const D=[];if(I.remove.slice().reverse().forEach((z)=>{void 0===z[0]||void 0===z[1]||D.push(u.a.createFromParentsAndOffsets(N,z[0],N,z[1]))}),!(L.length&&D.length))return;const q=w.document.batch();w.document.enqueueChanges(()=>{const z=s.i(f.a)(S,L,w.document.schema);O(q,z);for(let $ of D)q.remove($)})})}}},function(o,r,s){'use strict';var d=s(63),u=s(318);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends d.a{constructor(h){super(h),this.domEventType=['paste','copy','cut']}onDomEvent(h){this.fire(h.type,h,{dataTransfer:new u.a(h.clipboardData)})}}r.a=f},function(o,r){'use strict';/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=class{constructor(u){this._native=u}getData(u){return this._native.getData(u)}setData(u,f){this._native.setData(u,f)}}},function(o,r){'use strict';r.a=/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function(u){return u.replace(/(\s+)<\/span>/g,(f,h)=>{return 1==h.length?' ':h})}},function(o,r){'use strict';r.a=/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function(u){return u=u.replace(//g,'>').replace(/\n\n/g,'

').replace(/\n/g,' ').replace(/^\s/,' ').replace(/\s$/,' ').replace(/\s\s/g,'  '),-1

')&&(u=`

${u}

`),u}},function(o,r,s){'use strict';var d=s(66);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class u extends d.a{constructor(f){super(),this.editor=f}set(f,h){if('string'==typeof h){const w=h;h=()=>{this.editor.execute(w)}}super.set(f,h)}listenTo(f){this._listener.listenTo(f,'keydown',(h,w)=>{const C=this.press(w);C&&w.preventDefault()})}}r.a=u},function(o,r,s){'use strict';var d=s(7),u=s(408),f=s(324),h=s(521),w=s(327),C=s(342),T=s(0),P=s(4);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class S{constructor(E){const O=this.constructor.build&&this.constructor.build.plugins;this.config=new u.a(E,this.constructor.build&&this.constructor.build.config),this.config.define('plugins',O),this.plugins=new f.a(this,O),this.commands=new Map,this.locale=new h.a(this.config.get('lang')),this.t=this.locale.t,this.document=new C.a,this.data=new w.a(this.document)}initPlugins(){function O(F,N){return F.reduce((M,I)=>{return M.then(I[N].bind(I))},Promise.resolve())}const V=this,R=this.config;return function(){return V.plugins.load(R.get('plugins')||[])}().then((F)=>{return O(F,'init').then(()=>O(F,'afterInit'))}).then(()=>this.fire('pluginsReady'))}destroy(){return this.fire('destroy'),this.stopListening(),Promise.resolve().then(()=>{this.document.destroy(),this.data.destroy()})}execute(E,O){let V=this.commands.get(E);if(!V)throw new T.a('editor-command-not-found: Specified command has not been added to the editor.');V._execute(O)}static create(E){return new Promise((O)=>{const V=new this(E);O(V.initPlugins().then(()=>{V.fire('dataReady'),V.fire('ready')}).then(()=>V))})}}r.a=S,s.i(P.a)(S,d.a)},function(o,r,s){'use strict';var d=s(322),u=s(321),f=s(329),h=s(411),w=s(419);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class C extends d.a{constructor(T,P){super(P),this.element=T,this.editing=new f.a(this.document),this.keystrokes=new u.a(this),this.keystrokes.listenTo(this.editing.view)}destroy(){return Promise.resolve().then(()=>this.keystrokes.destroy()).then(()=>this.editing.destroy()).then(super.destroy())}setData(T){this.data.set(T)}getData(){return this.data.get()}updateEditorElement(){s.i(w.a)(this.element,this.getData())}loadDataFromEditorElement(){this.setData(s.i(h.a)(this.element))}static create(T,P){return new Promise((S)=>{const E=new this(T,P);S(E.initPlugins().then(()=>{E.fire('dataReady'),E.fire('ready')}).then(()=>E))})}}r.a=C},function(o,r,s){'use strict';var d=s(3),u=s(0),f=s(58);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class h{constructor(w,C=[]){this._editor=w,this._availablePlugins=new Map,this._plugins=new Map;for(const T of C)this._availablePlugins.set(T,T),T.pluginName&&this._availablePlugins.set(T.pluginName,T)}*[Symbol.iterator](){for(const w of this._plugins)'function'==typeof w[0]&&(yield w)}get(w){return this._plugins.get(w)}load(w,C=[]){function T(q){return L.includes(q)||R.get(q)||N.has(q)?void 0:P(q).catch((z)=>{throw f.a.error('plugincollection-load: It was not possible to load the plugin.',{plugin:q}),z})}function P(q){return new Promise((z)=>{N.add(q),E(q),q.requires&&q.requires.forEach((K)=>{const H=S(K);if(C.includes(H))throw new u.a('plugincollection-required: Cannot load a plugin because one of its dependencies is listed inthe `removePlugins` option.',{plugin:H,requiredBy:q});T(H)});const $=new q(F);R._add(q,$),M.push($),z()})}function S(q){return'function'==typeof q?q:R._availablePlugins.get(q)}function E(q){if(!(q.prototype instanceof d.a))throw new u.a('plugincollection-instance: The loaded plugin module is not an instance of Plugin.',{plugin:q})}function V(q){return q.map((z)=>S(z)).filter((z)=>!!z)}const R=this,F=this._editor,N=new Set,M=[],I=V(w),L=V(C),D=function(q){const z=[];for(const $ of q)S($)||z.push($);return z.length?z:null}(w);if(D){const q='plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.';return f.a.error(q,{plugins:D}),Promise.reject(new u.a(q,{plugins:D}))}return Promise.all(I.map(T)).then(()=>M)}_add(w,C){this._plugins.set(w,C),w.pluginName&&this._plugins.set(w.pluginName,C)}}r.a=h},function(o,r,s){'use strict';var d=s(388),u=s(65),f=s(402);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=class{constructor(w,C){this.editor=w,this.view=C,this.componentFactory=new d.a(w),this.focusTracker=new u.a,C.set('width',w.config.get('ui.width')),C.set('height',w.config.get('ui.height')),C.toolbar.bind('isActive').to(this.focusTracker,'isFocused'),C.toolbar.limiterElement=C.element;const T=w.editing.createRoot('div');C.editable.bind('isReadOnly').to(T),C.editable.bind('isFocused').to(w.editing.view),C.editable.name=T.rootName,this.focusTracker.add(C.editableElement)}init(){const w=this.editor;return this.view.init().then(()=>{return this.view.toolbar.fillFromConfig(w.config.get('toolbar'),this.componentFactory)}).then(()=>{s.i(f.a)({origin:w.editing.view,originFocusTracker:this.focusTracker,originKeystrokeHandler:w.keystrokes,toolbar:this.view.toolbar})})}destroy(){return this.view.destroy()}}},function(o,r,s){'use strict';var d=s(395),u=s(394),f=s(403);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class h extends d.a{constructor(w){super(w),this.toolbar=new f.a(w),this.editable=new u.a(w),this.top.add(this.toolbar),this.main.add(this.editable)}get editableElement(){return this.editable.element}}r.a=h},function(o,r,s){'use strict';var d=s(4),u=s(7),f=s(159),h=s(161),w=s(101),C=s(337),T=s(335),P=s(116),S=s(2),E=s(1),O=s(331),V=s(328),R=s(332),F=s(330);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class N{constructor(M,I){this.model=M,this.processor=I,this.mapper=new f.a,this.modelToView=new h.a(this.model,{mapper:this.mapper}),this.modelToView.on('insert:$text',s.i(w.j)(),{priority:'lowest'}),this.viewToModel=new C.a({schema:M.schema}),this.viewToModel.on('text',s.i(T.a)(),{priority:'lowest'}),this.viewToModel.on('element',s.i(T.b)(),{priority:'lowest'}),this.viewToModel.on('documentFragment',s.i(T.b)(),{priority:'lowest'}),this.on('insertContent',(L,D)=>s.i(O.a)(this,D.content,D.selection,D.batch)),this.on('deleteContent',(L,D)=>s.i(V.a)(D.selection,D.batch,D.options)),this.on('modifySelection',(L,D)=>s.i(R.a)(this,D.selection,D.options)),this.on('getSelectedContent',(L,D)=>{D.content=s.i(F.a)(D.selection)})}get(M='main'){return this.stringify(this.model.getRoot(M))}stringify(M){const I=this.toView(M);return this.processor.toData(I)}toView(M){const I=S.a.createIn(M),L=new P.a;return this.mapper.bindElements(M,L),this.modelToView.convertInsertion(I),this.mapper.clearBindings(),L}set(M,I='main'){const L=this.model.getRoot(I);this.model.enqueueChanges(()=>{this.model.selection.removeAllRanges(),this.model.selection.clearAttributes(),this.model.batch('transparent').remove(S.a.createIn(L)).insert(E.a.createAt(L,0),this.parse(M))})}parse(M,I='$root'){const L=this.processor.toView(M);return this.toModel(L,I)}toModel(M,I='$root'){return this.viewToModel.convert(M,{context:[I]})}destroy(){}insertContent(M,I,L){this.fire('insertContent',{content:M,selection:I,batch:L})}deleteContent(M,I,L){this.fire('deleteContent',{batch:I,selection:M,options:L})}modifySelection(M,I){this.fire('modifySelection',{selection:M,options:I})}getSelectedContent(M){const I={selection:M};return this.fire('getSelectedContent',I),I.content}}r.a=N,s.i(d.a)(N,u.a)},function(o,r,s){'use strict';function u(S,E,O){const V=O.path,R=_Mathmin(E.path.length-1,V.length-1);let F=s.i(P.a)(E.path,V);if('number'==typeof F)for(;F{this.modelToView.convertChange(O,V)},{priority:'low'}),this._listener.listenTo(this.model,'changesDone',()=>{const E=this.model.selection;this.modelToView.convertSelection(E),this.view.render()},{priority:'low'}),this._listener.listenTo(this.model.markers,'add',(E,O)=>{this.modelToView.convertMarker('addMarker',O.name,O.getRange())}),this._listener.listenTo(this.model.markers,'remove',(E,O)=>{this.modelToView.convertMarker('removeMarker',O.name,O.getRange())}),this._listener.listenTo(this.view,'selectionChange',s.i(w.a)(this.model,this.mapper)),this.modelToView.on('insert:$text',s.i(h.j)(),{priority:'lowest'}),this.modelToView.on('remove',s.i(h.k)(),{priority:'low'}),this.modelToView.on('selection',s.i(C.c)(),{priority:'low'}),this.modelToView.on('selection',s.i(C.d)(),{priority:'low'}),this.modelToView.on('selection',s.i(C.e)(),{priority:'low'}),this.modelToView.on('selection',s.i(C.f)(),{priority:'low'})}createRoot(S,E='main'){const O=this.view.createRoot(S,E),V=this.model.getRoot(E);return this.mapper.bindElements(V,O),O}destroy(){this.view.destroy(),this._listener.stopListening()}}},function(o,r,s){'use strict';function u(P){const S=[];Array.from(P.getItems({direction:'backward'})).map((E)=>h.a.createOn(E)).filter((E)=>{const O=(E.start.isAfter(P.start)||E.start.isEqual(P.start))&&(E.end.isBefore(P.end)||E.end.isEqual(P.end));return O}).forEach((E)=>{S.push(E.start.parent),s.i(T.c)(E)}),S.forEach((E)=>{for(let O=E;O.parent&&O.isEmpty;){const V=h.a.createOn(O);O=O.parent,s.i(T.c)(V)}})}/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */var f=s(49),h=s(2),w=s(1),C=s(24),T=s(13);r.a=function(P){const S=new f.a,E=P.getFirstRange();if(!E||E.isCollapsed)return S;const O=E.start.root,V=E.start.getCommonPath(E.end),R=O.getNodeByPath(V);let F=E.start.parent==E.end.parent?E:h.a.createFromParentsAndOffsets(R,E.start.path[V.length],R,E.end.path[V.length]+1);const N=F.end.offset-F.start.offset;for(const M of F.getItems({shallow:!0}))M.is('textProxy')?S.appendChildren(new C.a(M.data,M.getAttributes())):S.appendChildren(M.clone(!0));if(F!=E){const M=E._getTransformedByMove(F.start,w.a.createAt(S,0),N)[0],I=new h.a(w.a.createAt(S),M.start),L=new h.a(M.end,w.a.createAt(S,'end'));u(L),u(I)}return S}},function(o,r,s){'use strict';var u=s(1),f=s(166),h=s(5),w=s(2),C=s(58);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=function(P,S,E,O){O||(O=P.model.batch()),E.isCollapsed||P.deleteContent(E,O,{merge:!0});const V=new T(P,O,E.anchor);let R;R=S.is('documentFragment')?S.getChildren():[S],V.handleNodes(R,{isFirst:!0,isLast:!0});const F=V.getSelectionRange();F?E.setRanges([F]):C.a.warn('insertcontent-no-range: Cannot determine a proper selection range after insertion.')};class T{constructor(P,S,E){this.dataController=P,this.batch=S,this.position=E,this.canMergeWith=new Set([this.position.parent]),this.schema=P.model.schema}handleNodes(P,S){P=Array.from(P);for(let E=0;E!0);if(S.schema.check({name:'$text',inside:E.nextPosition}))return E.nextPosition}}/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function f(S,E){const O=S.position.textNode;if(O){const V=O.data;for(let R=S.position.offset-O.startOffset;s.i(P.a)(V,R)||'character'==E&&s.i(P.b)(V,R);)S.next(),R=S.position.offset-O.startOffset}return S.position}function h(S,E){const O=S.root,V=w.a.createAt(O,E?'end':0);return E?new T.a(S,V):new T.a(V,S)}var w=s(1),C=s(34),T=s(2),P=s(275);r.a=function(S,E,O={}){const V=S.model.schema,R='backward'!=O.direction,F=O.unit?O.unit:'character',N=E.focus,M=new C.a({boundaries:h(N,R),singleCharacters:!0,direction:R?'forward':'backward'}),I={walker:M,schema:V,isForward:R,unit:F};for(let L;L=M.next();){if(L.done)return;const D=u(I,L.value);if(D)return void E.setFocus(D)}}},function(o,r,s){'use strict';var d=s(61);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=class{constructor(){this._consumable=new Map,this._textProxyRegistry=new Map}add(f,h){f instanceof d.a&&(f=this._getSymbolForTextProxy(f)),this._consumable.has(f)||this._consumable.set(f,new Map),this._consumable.get(f).set(h,!0)}consume(f,h){return f instanceof d.a&&(f=this._getSymbolForTextProxy(f)),!!this.test(f,h)&&(this._consumable.get(f).set(h,!1),!0)}test(f,h){f instanceof d.a&&(f=this._getSymbolForTextProxy(f));const w=this._consumable.get(f);if(w===void 0)return null;const C=w.get(h);return void 0===C?null:C}revert(f,h){f instanceof d.a&&(f=this._getSymbolForTextProxy(f));const w=this.test(f,h);return!1===w?(this._consumable.get(f).set(h,!0),!0):!0!==w&&null}_getSymbolForTextProxy(f){let h=null;const w=this._textProxyRegistry.get(f.startOffset);if(w){const C=w.get(f.endOffset);C&&(h=C.get(f.parent))}return h||(h=this._addSymbolForTextProxy(f.startOffset,f.endOffset,f.parent)),h}_addSymbolForTextProxy(f,h,w){const C=Symbol();let T,P;return T=this._textProxyRegistry.get(f),T||(T=new Map,this._textProxyRegistry.set(f,T)),P=T.get(h),P||(P=new Map,T.set(h,P)),P.set(w,C),C}}},function(o,r,s){'use strict';var u=s(60);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=function(f,h){return(w,C)=>{const T=C.newSelection,P=new u.a,S=[];for(let E of T.getRanges())S.push(h.toModelRange(E));P.setRanges(S,T.isBackward),P.isEqual(f.selection)||f.enqueueChanges(()=>{f.selection.setTo(P)})}}},function(o,r,s){'use strict';/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */var f=s(49),h=s(24),w=s(13);r.b=function(){return(C,T,P,S)=>{if(!T.output&&P.consume(T.input,{name:!0})){const E=S.convertChildren(T.input,P,T);T.output=new f.a(s.i(w.b)(E))}}},r.a=function(){return(C,T,P,S)=>{const E={name:'$text',inside:T.context};S.schema.check(E)&&P.consume(T.input)&&(T.output=new h.a(T.input.data))}}},function(o,r,s){'use strict';var d=s(11),u=s(0);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f{constructor(){this._consumables=new Map}add(w,C){let T;return w.is('text')||w.is('documentFragment')?void this._consumables.set(w,!0):void(this._consumables.has(w)?T=this._consumables.get(w):(T=new h,this._consumables.set(w,T)),T.add(C))}test(w,C){const T=this._consumables.get(w);return void 0===T?null:w.is('text')||w.is('documentFragment')?T:T.test(C)}consume(w,C){return!!this.test(w,C)&&(w.is('text')||w.is('documentFragment')?this._consumables.set(w,!1):this._consumables.get(w).consume(C),!0)}revert(w,C){const T=this._consumables.get(w);T!==void 0&&(w.is('text')||w.is('documentFragment')?this._consumables.set(w,!0):T.revert(C))}static consumablesFromElement(w){const C={name:!0,attribute:[],class:[],style:[]},T=w.getAttributeKeys();for(let E of T)'style'!=E&&'class'!=E&&C.attribute.push(E);const P=w.getClassNames();for(let E of P)C.class.push(E);const S=w.getStyleNames();for(let E of S)C.style.push(E);return C}static createFrom(w,C){if(C||(C=new f),w.is('text'))return C.add(w),C;w.is('element')&&C.add(w,f.consumablesFromElement(w)),w.is('documentFragment')&&C.add(w);for(let T of w.getChildren())C=f.createFrom(T,C);return C}}r.a=f;class h{constructor(){this._canConsumeName=null,this._consumables={attribute:new Map,style:new Map,class:new Map}}add(w){for(let C in w.name&&(this._canConsumeName=!0),this._consumables)C in w&&this._add(C,w[C])}test(w){if(w.name&&!this._canConsumeName)return this._canConsumeName;for(let C in this._consumables)if(C in w){const T=this._test(C,w[C]);if(!0!==T)return T}return!0}consume(w){for(let C in w.name&&(this._canConsumeName=!1),this._consumables)C in w&&this._consume(C,w[C])}revert(w){for(let C in w.name&&(this._canConsumeName=!0),this._consumables)C in w&&this._revert(C,w[C])}_add(w,C){const T=s.i(d.a)(C)?C:[C],P=this._consumables[w];for(let S of T){if('attribute'===w&&('class'===S||'style'===S))throw new u.a('viewconsumable-invalid-attribute: Classes and styles should be handled separately.');P.set(S,!0)}}_test(w,C){const T=s.i(d.a)(C)?C:[C],P=this._consumables[w];for(let S of T)if('attribute'===w&&('class'===S||'style'===S)){const E=this._test(S,[...this._consumables[S].keys()]);if(!0!==E)return E}else{const E=P.get(S);if(E===void 0)return null;if(!E)return!1}return!0}_consume(w,C){const T=s.i(d.a)(C)?C:[C],P=this._consumables[w];for(let S of T)'attribute'===w&&('class'===S||'style'===S)?this._consume(S,[...this._consumables[S].keys()]):P.set(S,!1)}_revert(w,C){const T=s.i(d.a)(C)?C:[C],P=this._consumables[w];for(let S of T)if('attribute'===w&&('class'===S||'style'===S))this._revert(S,[...this._consumables[S].keys()]);else{const E=P.get(S);!1===E&&P.set(S,!0)}}}},function(o,r,s){'use strict';function d(R){const F=new Set,N=new Map,M=new P.a({startPosition:T.a.createAt(R,0),ignoreElementEnd:!0});for(const I of M)'$marker'==I.item.name&&F.add(I.item);for(const I of F){const L=I.getAttribute('data-name'),D=T.a.createBefore(I);N.has(L)?N.get(L).end=T.a.createFromPosition(D):N.set(L,new C.a(T.a.createFromPosition(D))),s.i(O.c)(C.a.createOn(I))}return N}var u=s(336),f=s(7),h=s(4),w=s(57),C=s(2),T=s(1),P=s(34),S=s(59),E=s(49),O=s(13);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class V{constructor(R={}){this.conversionApi=s.i(w.a)({},R),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this)}convert(R,F={}){this.fire('viewCleanup',R);const N=u.a.createFrom(R),M=this._convertItem(R,N,F);if(!(M instanceof S.a||M instanceof E.a))return M;let I=M;return I.is('documentFragment')||(I=new E.a([I])),I.markers=d(I),I}_convertItem(R,F,N={}){const M=s.i(w.a)({},N,{input:R,output:null});return R.is('element')?this.fire('element:'+R.name,M,F,this.conversionApi):R.is('text')?this.fire('text',M,F,this.conversionApi):this.fire('documentFragment',M,F,this.conversionApi),M.output}_convertChildren(R,F,N={}){const M=Array.from(R.getChildren()),I=M.map((L)=>this._convertItem(L,F,N));return I.reduce((L,D)=>D?L.concat(D):L,[])}}r.a=V,s.i(h.a)(V,f.a)},function(o,r){'use strict';/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=class{getHtml(u){const f=document.implementation.createHTMLDocument(''),h=f.createElement('div');return h.appendChild(u),h.innerHTML}}},function(o,r,s){'use strict';/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */var d=s(163),u=s(102),f=s(103),h=s(104),w=s(105),C=s(164),T=s(106),P=s(108),S=s(165),E=s(109)},function(o,r,s){'use strict';function d(H,U){const W=H.clone(),Z=W.operations[0];return Z.oldRange=Z.oldRange.getTransformedByDelta(U)[0],Z.newRange=Z.newRange.getTransformedByDelta(U)[0],[W]}function u(H,U){function W(){const Q=new w.a(H.position.getShiftedBy(Y),H.position.getShiftedBy(X)),ee=new P.a(Q,U.key,J,U.value,0);Z.addOperation(ee)}const Z=new V.a,G=H.nodes;let J=G.getNode(0).getAttribute(U.key),Y=0,X=G.getNode(0).offsetSize;for(let Q=1;Q{const Z=s.i(h.c)(H,U,W);return H.range.containsPosition(U.position)&&Z.push(u(U,H)),Z}),s.i(h.b)(V.a,I.a,(H,U,W)=>{const Z=new C.a(U.position.root,U.position.path.slice(0,-1)),G=s.i(h.c)(H,U,W);for(let J of H.operations)if(J.range.containsPosition(Z)||J.range.start.isEqual(Z)){const Y=new V.a,X=Z.getShiftedBy(1),Q=C.a.createFromPosition(X);Q.path.push(0);const ee=U._cloneOperation.nodes.getNode(0).getAttribute(J.key);Y.addOperation(new P.a(new w.a(X,Q),J.key,ee===void 0?null:ee,J.newValue,0)),G.push(Y);break}return G}),s.i(h.b)(R.a,N.a,(H,U,W)=>{return H.position.isEqual(U.position)?[U.getReversed(),H.clone()]:s.i(h.c)(H,U,W)}),s.i(h.b)(F.a,I.a,d),s.i(h.b)(F.a,N.a,d),s.i(h.b)(F.a,D.a,d),s.i(h.b)(F.a,q.a,d),s.i(h.b)(F.a,M.a,d),s.i(h.b)(F.a,z.a,d),s.i(h.b)(M.a,N.a,(H,U,W)=>{const Z=H.sourcePosition.root==U.position.root&&'same'===s.i(K.a)(H.sourcePosition.getParentPath(),U.position.getParentPath()),G=H.sourcePosition.offset<=U.position.offset&&H.sourcePosition.offset+H.howMany>U.position.offset;return Z&&G?[U.getReversed(),H.clone()]:s.i(h.c)(H,U,W)}),s.i(h.b)(N.a,R.a,(H,U,W)=>{return H.position.isEqual(U.position)?[f()]:s.i(h.c)(H,U,W)}),s.i(h.b)(N.a,M.a,(H,U,W)=>{const Z=H.position.root==U.sourcePosition.root&&'same'===s.i(K.a)(H.position.getParentPath(),U.sourcePosition.getParentPath()),G=U.sourcePosition.offset<=H.position.offset&&U.sourcePosition.offset+U.howMany>H.position.offset;return Z&&G?[f()]:s.i(h.c)(H,U,W)}),s.i(h.b)(I.a,I.a,(H,U,W)=>{const Z=H.position.getParentPath(),G=U.position.getParentPath();if('same'==s.i(K.a)(Z,G)){if(H.position.offset==U.position.offset)return[f()];if(H.position.offsetU._cloneOperation.sourcePosition.offset&&J._cloneOperation.sourcePosition.offset--,[J]}const J=H.clone();return J._cloneOperation.position.offset++,J._moveOperation.sourcePosition.path[J._moveOperation.sourcePosition.path.length-2]++,J._moveOperation.targetPosition.path[J._moveOperation.targetPosition.path.length-2]++,J._moveOperation.sourcePosition.offset=H.position.offset-U.position.offset,H._cloneOperation instanceof E.a&&U._cloneOperation instanceof E.a&&H._cloneOperation.sourcePosition.offset>U._cloneOperation.sourcePosition.offset&&J._cloneOperation.sourcePosition.offset--,[J]}return s.i(h.c)(H,U,W)}),s.i(h.b)(I.a,q.a,(H,U,W)=>{return'same'===s.i(K.a)(U.position.path,H.position.getParentPath())?[f()]:s.i(h.c)(H,U,W)}),s.i(h.b)(I.a,D.a,(H,U,W)=>{const Z='same'===s.i(K.a)(H.position.getParentPath(),U.range.start.getParentPath()),G=U.range.start.offset=H.position.offset;if(Z&&G)return[f()];if('same'===s.i(K.a)(H.position.getParentPath(),U.range.end.getShiftedBy(-1).path)){const J=H.clone(),Y=C.a.createFromPosition(U.range.start);Y.path.push(U.howMany-1);const X=Y.getShiftedBy(1);J._cloneOperation.position=X;const Q=C.a.createFromPosition(Y);Q.path.push(H.position.offset),J._moveOperation.sourcePosition=Q;const ee=C.a.createFromPosition(X);return ee.path.push(0),J._moveOperation.targetPosition=ee,[J]}return s.i(h.c)(H,U,W)}),s.i(h.b)(I.a,V.a,(H,U)=>{H=H.clone();const W=new C.a(H.position.root,H.position.path.slice(0,-1));if(H._cloneOperation instanceof S.a)for(let Z of U.operations)if(Z.range.containsPosition(W)||Z.range.start.isEqual(W)){null===Z.newValue?H._cloneOperation.nodes.getNode(0).removeAttribute(Z.key):H._cloneOperation.nodes.getNode(0).setAttribute(Z.key,Z.newValue);break}return[H]}),s.i(h.b)(q.a,I.a,(H,U,W)=>{if('same'===s.i(K.a)(H.position.path,U.position.getParentPath())){const Z=[U.getReversed(),H.clone()];return Z[1].operations[1].targetPosition.path[0]++,Z}return s.i(h.c)(H,U,W)}),s.i(h.b)(L.a,V.a,(H,U)=>{const W=[H.clone()];return U.range.containsPosition(H.position)&&W.push(u(H,U)),W}),s.i(h.b)(D.a,I.a,(H,U,W)=>{const Z='same'===s.i(K.a)(H.range.start.getParentPath(),U.position.getParentPath()),G=H.range.start.offset=U.position.offset;if(Z&&G)return[U.getReversed(),H.clone()];if('same'===s.i(K.a)(U.position.getParentPath(),H.range.end.getShiftedBy(-1).path)){const J=H.clone();return J._insertOperation.position.offset++,J._moveOperation.howMany++,J._moveOperation.targetPosition.path[J._moveOperation.targetPosition.path.length-2]++,[J]}return s.i(h.c)(H,U,W)}),s.i(h.b)(z.a,I.a,(H,U,W)=>{const Z=new C.a(U.position.root,U.position.path.slice(0,-1)),G=s.i(h.c)(H,U,W);if(H.operations[0].position.isEqual(Z)){const J=H.clone();J.operations[0].position=H.operations[0].position.getShiftedBy(1),G.push(J)}return G}),s.i(h.b)(I.a,z.a,(H,U)=>{H=H.clone();const W=new C.a(H.position.root,H.position.path.slice(0,-1));return H._cloneOperation instanceof S.a&&U.operations[0].position.isEqual(W)&&(H._cloneOperation.nodes.getNode(0).name=U.operations[0].newName),[H]}),s.i(h.b)($.a,I.a,(H,U,W)=>{const Z=s.i(h.c)(H,U,W),G=U._cloneOperation.position;for(let J of Z)for(let Y of J.operations){const X=Y.sourcePosition.getShiftedBy(Y.howMany);X.isEqual(G)&&(Y.howMany+=1)}return Z}),s.i(h.b)(I.a,$.a,(H,U,W)=>{U=U.clone();const Z=H._cloneOperation.position;for(let G of U.operations){const J=G.sourcePosition.getShiftedBy(G.howMany);J.isEqual(Z)&&(G.howMany+=1)}return s.i(h.c)(H,U,W)})},function(o,r,s){'use strict';function d(P,S,E,O){const V=P.document,R=new T,F=new w.a(S,E,O,V.markers,V.version);P.addDelta(R),R.addOperation(F),V.applyOperation(F)}var u=s(20),f=s(18),h=s(17),w=s(111),C=s(0);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class T extends u.a{get type(){return'marker'}get _reverseDeltaClass(){return T}static get className(){return'engine.model.delta.MarkerDelta'}}r.a=T,s.i(h.b)('setMarker',function(P,S){const E='string'==typeof P?P:P.name,O=this.document.markers.get(E);if(!S&&!O)throw new C.a('batch-setMarker-no-range: Range parameter is required when adding a new marker.');const V=O?O.getRange():null;return S?d(this,E,V,S):d(this,E,null,V),this}),s.i(h.b)('removeMarker',function(P){const S='string'==typeof P?P:P.name;if(!this.document.markers.has(S))throw new C.a('batch-removeMarker-no-marker: Trying to remove marker that does not exist.');const E=this.document.markers.get(S).getRange();return d(this,S,E,null),this}),f.a.register(T)},function(o,r,s){'use strict';function d(z){const $=z.textNode;if($){const K=$.data,H=z.offset-$.startOffset;return!s.i(L.a)(K,H)&&!s.i(L.b)(K,H)}return!0}function*u(z,$){for(let K=!1;!K;){if(K=!0,z){const H=z.next();H.done||(K=!1,yield{walker:z,value:H.value})}if($){const H=$.next();H.done||(K=!1,yield{walker:$,value:H.value})}}}var f=s(339),h=s(340),w=s(2),C=s(1),T=s(348),P=s(17),S=s(343),E=s(344),O=s(349),V=s(34),R=s(345),F=s(95),N=s(7),M=s(0),I=s(4),L=s(275);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */const D='$graveyard';class q{constructor(){this.version=0,this.schema=new O.a,this.history=new S.a(this),this.markers=new R.a,this.selection=new E.a(this),this._pendingChanges=[],this.roots=new Map,this.selection.on('change:range',()=>{for(let z of this.selection.getRanges())if(!this._validateSelectionRange(z))throw new M.a('document-selection-wrong-position: Range from document selection starts or ends at incorrect position.',{range:z})}),this.createRoot('$root',D)}get graveyard(){return this.getRoot(D)}applyOperation(z){if(z.baseVersion!==this.version)throw new M.a('model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.',{operation:z});let $=z._execute();this.version++,this.history.addDelta(z.delta),$&&this.fire('change',z.type,$,z.delta.batch,z.delta.type)}batch(z){return new P.a(this,z)}createRoot(z='$root',$='main'){if(this.roots.has($))throw new M.a('model-document-createRoot-name-exists: Root with specified name already exists.',{name:$});const K=new T.a(this,z,$);return this.roots.set($,K),K}destroy(){this.selection.destroy(),this.stopListening()}enqueueChanges(z){if(this._pendingChanges.push(z),1==this._pendingChanges.length){for(;this._pendingChanges.length;)this._pendingChanges[0](),this._pendingChanges.shift();this.fire('changesDone')}}getRoot(z='main'){if(!this.roots.has(z))throw new M.a('model-document-getRoot-root-not-exist: Root with specified name does not exist.',{name:z});return this.roots.get(z)}hasRoot(z){return this.roots.has(z)}getRootNames(){return Array.from(this.roots.keys()).filter((z)=>z!=D)}getNearestSelectionRange(z,$='both'){if(this.schema.check({name:'$text',inside:z}))return new w.a(z);let K,H;('both'==$||'backward'==$)&&(K=new V.a({startPosition:z,direction:'backward'})),('both'==$||'forward'==$)&&(H=new V.a({startPosition:z}));for(let U of u(K,H)){const W=U.walker==K?'elementEnd':'elementStart',Z=U.value;if(Z.type==W&&this.schema.objects.has(Z.item.name))return w.a.createOn(Z.item);if(this.schema.check({name:'$text',inside:Z.nextPosition}))return new w.a(Z.nextPosition)}return null}toJSON(){const z=s.i(F.a)(this);return z.selection='[engine.model.LiveSelection]',z}_getDefaultRoot(){for(let z of this.roots.values())if(z!==this.graveyard)return z;return this.graveyard}_getDefaultRange(){const z=this._getDefaultRoot(),$=new C.a(z,[0]),K=this.getNearestSelectionRange($);return K||new w.a($)}_validateSelectionRange(z){return d(z.start)&&d(z.end)}}r.a=q,s.i(I.a)(q,N.a)},function(o,r,s){'use strict';var d=s(0);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=class{constructor(){this._deltas=[],this._historyPoints=new Map}addDelta(f){if(0=h)break;yield C}}}getDelta(f){let h=this._historyPoints.get(f);if(h===void 0)return null;const w=[];for(h;hf&&this._historyPoints.set(T,this._historyPoints.get(T)+C)}}_getIndex(f){let h=this._historyPoints.get(f);if(h===void 0){const w=this._deltas[this._deltas.length-1],C=w.baseVersion+w.operations.length;if(0>f||f>=C)return-1;throw new d.a('model-history-wrong-version: Given base version points to the middle of a delta.')}return h}}},function(o,r,s){'use strict';function d(F){return F instanceof C.a||F instanceof w.a?F.getAttributes():null}var u=s(1),f=s(2),h=s(110),w=s(24),C=s(61),T=s(152),P=s(0),S=s(58),E=s(60);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */const O='selection:',V=new Set(['addAttribute','removeAttribute','changeAttribute','addRootAttribute','removeRootAttribute','changeRootAttribute']);class R extends E.a{constructor(F){super(),this._document=F,this._attributePriority=new Map,this.listenTo(this._document,'change',(N,M)=>{V.has(M)&&this._updateAttributes(!1)})}get isCollapsed(){const F=this._ranges.length;return!(0!==F)||super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().start}get rangeCount(){return this._ranges.length?this._ranges.length:1}destroy(){for(let F=0;F{N.root==this._document.graveyard&&this._fixGraveyardSelection(N,I),this.fire('change:range',{directChange:!1})}),N}_updateAttributes(F){const N=s.i(T.a)(this._getSurroundingAttributes()),M=s.i(T.a)(this.getAttributes());if(F)this._attributePriority=new Map,this._attrs=new Map;else for(let[L,D]of this._attributePriority)'low'==D&&(this._attrs.delete(L),this._attributePriority.delete(L));this._setAttributesTo(N,!1);const I=[];for(let[L,D]of this.getAttributes())M.has(L)&&M.get(L)===D||I.push(L);for(let[L]of M)this.hasAttribute(L)||I.push(L);0{return new T.a(q,I.key,I.oldValue,I.newValue,I.baseVersion)})},AttributeOperation(I,L,D){if(I.key===L.key){let q=I.range.getDifference(L.range).map(($)=>{return new T.a($,I.key,I.oldValue,I.newValue,I.baseVersion)});const z=I.range.getIntersection(L.range);return z&&(D?q.push(new T.a(z,L.key,L.newValue,I.newValue,I.baseVersion)):0===q.length&&q.push(new R.a(0))),q}return[I.clone()]},RootAttributeOperation:u,RenameOperation:u,MarkerOperation:u,MoveOperation(I,L){const D=F.a.createFromPositionAndShift(L.sourcePosition,L.howMany);let q=[];L instanceof V.a&&L._needsHolderElement&&I.range.root==L.targetPosition.root&&I.range.start.path[0]>=L._holderElementOffset&&(I=I.clone(),I.range.start.path[0]++,I.range.end.path[0]++);const z=w(I.range.getDifference(D)),$=I.range.getIntersection(D);return null!==z&&(z.start=z.start._getTransformedByDeletion(L.sourcePosition,L.howMany),z.end=z.end._getTransformedByDeletion(L.sourcePosition,L.howMany),q=z._getTransformedByInsertion(L.getMovedRangeStart(),L.howMany,!0,!1).reverse()),null!==$&&($.start=$.start._getCombined(L.sourcePosition,L.getMovedRangeStart()),$.end=$.end._getCombined(L.sourcePosition,L.getMovedRangeStart()),q.push($)),q.map((K)=>{return new T.a(K,I.key,I.oldValue,I.newValue,I.baseVersion)})}},RootAttributeOperation:{InsertOperation:u,AttributeOperation:u,RootAttributeOperation(I,L,D){return I.root!==L.root||I.key!==L.key||(I.newValue===L.newValue||D)&&I.newValue!==L.newValue?[I.clone()]:[new R.a(I.baseVersion)]},RenameOperation:u,MarkerOperation:u,MoveOperation:u},RenameOperation:{InsertOperation(I,L){const D=I.clone();return D.position=D.position._getTransformedByInsertion(L.position,L.nodes.maxOffset,!0),[D]},AttributeOperation:u,RootAttributeOperation:u,RenameOperation(I,L,D){const q=I.clone();if(I.position.isEqual(L.position))if(D)q.oldName=L.newName;else return[new R.a(I.baseVersion)];return[q]},MarkerOperation:u,MoveOperation(I,L){const D=I.clone(),q=D.position.isEqual(L.sourcePosition);return D.position=D.position._getTransformedByMove(L.sourcePosition,L.targetPosition,L.howMany,!0,q),[D]}},MarkerOperation:{InsertOperation(I,L){const D=I.clone();return D.oldRange&&(D.oldRange=D.oldRange._getTransformedByInsertion(L.position,L.nodes.maxOffset,!1,!1)[0]),D.newRange&&(D.newRange=D.newRange._getTransformedByInsertion(L.position,L.nodes.maxOffset,!1,!1)[0]),[D]},AttributeOperation:u,RootAttributeOperation:u,RenameOperation:u,MarkerOperation(I,L,D){const q=I.clone();if(I.name==L.name)if(D)q.oldRange=L.newRange;else return[new R.a(I.baseVersion)];return[q]},MoveOperation(I,L){const D=I.clone();if(D.oldRange){const q=D.oldRange._getTransformedByMove(L.sourcePosition,L.targetPosition,L.howMany);D.oldRange=F.a.createFromRanges(q)}if(D.newRange){const q=D.newRange._getTransformedByMove(L.sourcePosition,L.targetPosition,L.howMany);D.newRange=F.a.createFromRanges(q)}return[D]}},MoveOperation:{InsertOperation(I,L,D){let q=F.a.createFromPositionAndShift(I.sourcePosition,I.howMany);q=q._getTransformedByInsertion(L.position,L.nodes.maxOffset,!1,I.isSticky)[0];let z=new I.constructor(q.start,q.end.offset-q.start.offset,I instanceof V.a?I.baseVersion:I.targetPosition._getTransformedByInsertion(L.position,L.nodes.maxOffset,!D),I instanceof V.a?void 0:I.baseVersion);return z.isSticky=I.isSticky,z._holderElementOffset=I._holderElementOffset,[z]},AttributeOperation:u,RootAttributeOperation:u,RenameOperation:u,MarkerOperation:u,MoveOperation(I,L,D){if(h(I,L)&&h(L,I))return[L.getReversed()];if(I instanceof V.a&&L instanceof V.a){const J=I.targetPosition.path[0],Y=L.targetPosition.path[0];J>=Y&&D&&(I=I.clone(),I.targetPosition.path[0]++)}I instanceof V.a&&!(L instanceof V.a)?D=!0:!(I instanceof V.a)&&L instanceof V.a&&(D=!1);const q=F.a.createFromPositionAndShift(I.sourcePosition,I.howMany),z=F.a.createFromPositionAndShift(L.sourcePosition,L.howMany);let $=[],K=w(q.getDifference(z));K&&(K.start=K.start._getTransformedByMove(L.sourcePosition,L.targetPosition,L.howMany,!I.isSticky,!1),K.end=K.end._getTransformedByMove(L.sourcePosition,L.targetPosition,L.howMany,I.isSticky,!1),$.push(K));const H=q.getIntersection(z);let U=s.i(N.a)(I.sourcePosition.getParentPath(),L.sourcePosition.getParentPath()),W=q.containsPosition(L.targetPosition)||q.start.isEqual(L.targetPosition)&&I.isSticky||q.end.isEqual(L.targetPosition)&&I.isSticky,Z=z.containsRange(q)&&(z.containsPosition(I.targetPosition)||z.start.isEqual(I.targetPosition)||z.end.isEqual(I.targetPosition));if(null!==H&&('extension'===U||'same'===U&&D||Z)&&!W&&(H.start=H.start._getCombined(L.sourcePosition,L.getMovedRangeStart()),H.end=H.end._getCombined(L.sourcePosition,L.getMovedRangeStart()),K&&q.start.isBefore(z.start)?$.push(H):$.unshift(H)),0===$.length)return I instanceof V.a?(I=I.clone(),I.howMany=0,I.sourcePosition=L.targetPosition,[I]):[new R.a(I.baseVersion)];let G=I.targetPosition._getTransformedByMove(L.sourcePosition,L.targetPosition,L.howMany,!D,L.isSticky||Z);return $.reverse().map((J)=>{let Y=new I.constructor(J.start,J.end.offset-J.start.offset,I instanceof V.a?I.baseVersion:G,I instanceof V.a?void 0:I.baseVersion);return Y.isSticky=I.isSticky,Y._holderElementOffset=I._holderElementOffset,Y})}}}},function(o,r,s){'use strict';var d=s(5);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class u extends d.a{constructor(f,h,w='main'){super(h),this._doc=f,this.rootName=w}get document(){return this._doc}is(f,h){return h?'rootElement'==f&&h==this.name||super.is(f,h):'rootElement'==f||super.is(f)}toJSON(){return this.rootName}}r.a=u},function(o,r,s){'use strict';function d(E,O,V){for(let R=V.length-1,F=O.length-1;0<=R&&0<=F;){const N=O[F];if(!E.hasItem(N))return!1;const M=E._extensionChains.get(N);if(M.includes(V[R]))R--,F--;else return!1}return!0}var u=s(1),f=s(5),h=s(95),w=s(11),C=s(149),T=s(0);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class P{constructor(){this.objects=new Set,this.limits=new Set,this._items=new Map,this._extensionChains=new Map,this.registerItem('$root'),this.registerItem('$block'),this.registerItem('$inline'),this.registerItem('$text','$inline'),this.allow({name:'$block',inside:'$root'}),this.allow({name:'$inline',inside:'$block'}),this.registerItem('$clipboardHolder','$root'),this.allow({name:'$inline',inside:'$clipboardHolder'})}allow(E){this._getItem(E.name).allow(P._normalizeQueryPath(E.inside),E.attributes)}disallow(E){this._getItem(E.name).disallow(P._normalizeQueryPath(E.inside),E.attributes)}requireAttributes(E,O){this._getItem(E).requireAttributes(O)}check(E){if(!this.hasItem(E.name))return!1;s.i(w.a)(E.attributes)?0===E.attributes.length&&E.attributes.push(void 0):E.attributes=[E.attributes];const O=P._normalizeQueryPath(E.inside),V=this._extensionChains.get(E.name).map((R)=>{return this._getItem(R)});if(!this._getItem(E.name)._checkRequiredAttributes(E.attributes))return!1;for(let R of E.attributes)for(let F of V)if(F._hasMatchingPath('disallow',O,R))return!1;for(let R of E.attributes){let F=!1;for(let N of V)if(N._hasMatchingPath('allow',O,R)){F=!0;break}if(!F)return!1}return!0}hasItem(E){return this._items.has(E)}registerItem(E,O){if(this.hasItem(E))throw new T.a('model-schema-item-exists: Item with specified name already exists in schema.');if(!!O&&!this.hasItem(O))throw new T.a('model-schema-no-item: Item with specified name does not exist in schema.');this._items.set(E,new S(this));const V=this.hasItem(O)?this._extensionChains.get(O).concat(E):[E];this._extensionChains.set(E,V)}itemExtends(E,O){if(!this.hasItem(E)||!this.hasItem(O))throw new T.a('model-schema-no-item: Item with specified name does not exist in schema.');const V=this._extensionChains.get(E);return V.some((R)=>R==O)}_getItem(E){if(!this.hasItem(E))throw new T.a('model-schema-no-item: Item with specified name does not exist in schema.');return this._items.get(E)}static _normalizeQueryPath(E){let O=[];if(s.i(w.a)(E))for(let V of E)V instanceof f.a?O.push(V.name):s.i(C.a)(V)&&O.push(V);else if(E instanceof u.a){for(let V=E.parent;null!==V;)O.push(V.name),V=V.parent;O.reverse()}else s.i(C.a)(E)&&(O=E.split(' '));return O}}r.a=P;class S{constructor(E){this._schema=E,this._allowed=[],this._disallowed=[],this._requiredAttributes=[]}allow(E,O){this._addPath('_allowed',E,O)}disallow(E,O){this._addPath('_disallowed',E,O)}requireAttributes(E){this._requiredAttributes.push(E)}_addPath(E,O,V){O=O.slice(),s.i(w.a)(V)||(V=[V]);for(let R of V)this[E].push({path:O,attribute:R})}_getPaths(E,O){const V='allow'===E?this._allowed:this._disallowed,R=[];for(let F of V)F.attribute===O&&R.push(F.path);return R}_checkRequiredAttributes(E){let O=!0;for(let V of this._requiredAttributes){O=!0;for(let R of V)if(-1==E.indexOf(R)){O=!1;break}if(O)break}return O}_hasMatchingPath(E,O,V){const R=this._getPaths(E,V);for(const F of R)if(d(this._schema,O,F))return!0;return!1}toJSON(){const E=s.i(h.a)(this);return E._schema='[model.Schema]',E}}},function(o,r,s){'use strict';var d=s(77),u=s(357),f=s(167),h=s(171),w=s(62),C=s(58),T=s(170),P=s(356),S=s(353),E=s(354),O=s(352),V=s(4),R=s(32);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class F{constructor(){this.domRoots=new Map,this.selection=new d.a,this.domConverter=new f.a,this.roots=new Map,this.set('isFocused',!1),this.renderer=new u.a(this.domConverter,this.selection),this.renderer.bind('isFocused').to(this,'isFocused'),this._observers=new Map,this.addObserver(T.a),this.addObserver(P.a),this.addObserver(S.a),this.addObserver(E.a),this.addObserver(O.a),s.i(w.h)(this),this.on('render',()=>{this.disableObservers(),this.renderer.render(),this.enableObservers()})}addObserver(N){let M=this._observers.get(N);if(M)return M;M=new N(this),this._observers.set(N,M);for(let[I,L]of this.domRoots)M.observe(L,I);return M.enable(),M}getObserver(N){return this._observers.get(N)}createRoot(N,M='main'){const I='string'==typeof N?N:N.tagName,L=new h.a(I.toLowerCase(),M);return L.document=this,this.roots.set(M,L),L.on('change:children',(D,q)=>this.renderer.markToSync('children',q)),L.on('change:attributes',(D,q)=>this.renderer.markToSync('attributes',q)),L.on('change:text',(D,q)=>this.renderer.markToSync('text',q)),this.domConverter.isElement(N)&&this.attachDomRoot(N,M),L}attachDomRoot(N,M='main'){const I=this.getRoot(M);this.domRoots.set(M,N),this.domConverter.bindElements(N,I),this.renderer.markToSync('children',I),this.renderer.domDocuments.add(N.ownerDocument);for(let L of this._observers.values())L.observe(N,M)}getRoot(N='main'){return this.roots.get(N)}getDomRoot(N='main'){return this.domRoots.get(N)}render(){this.fire('render')}focus(){if(!this.isFocused){const N=this.selection.editableElement;N?(this.domConverter.focus(N),this.render()):C.a.warn('view-focus-no-selection: There is no selection in any editable to focus.')}}disableObservers(){for(let N of this._observers.values())N.disable()}enableObservers(){for(let N of this._observers.values())N.enable()}destroy(){for(let N of this._observers.values())N.destroy()}}r.a=F,s.i(V.a)(F,R.a)},function(o,r,s){'use strict';var d=s(63);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class u extends d.a{constructor(f){super(f),this.domEventType='click'}onDomEvent(f){this.fire(f.type,f)}}r.a=u},function(o,r,s){'use strict';function d(T){return T==h.b.arrowright||T==h.b.arrowleft||T==h.b.arrowup||T==h.b.arrowdown}var u=s(50),f=s(77),h=s(22),w=s(143);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class C extends u.a{constructor(T){super(T),this._fireSelectionChangeDoneDebounced=s.i(w.a)((P)=>this.document.fire('selectionChangeDone',P),200)}observe(){const T=this.document;T.on('keydown',(P,S)=>{const E=T.selection;E.isFake&&d(S.keyCode)&&this.isEnabled&&(S.preventDefault(),this._handleSelectionMove(S.keyCode))},{priority:'lowest'})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(T){const P=this.document.selection,S=f.a.createFromSelection(P);S.setFake(!1),(T==h.b.arrowleft||T==h.b.arrowup)&&S.collapseToStart(),(T==h.b.arrowright||T==h.b.arrowdown)&&S.collapseToEnd();const E={oldSelection:P,newSelection:S,domSelection:null};this.document.fire('selectionChange',E),this._fireSelectionChangeDoneDebounced(E)}}r.a=C},function(o,r,s){'use strict';var d=s(63);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class u extends d.a{constructor(f){super(f),this.domEventType=['focus','blur'],this.useCapture=!0,f.on('focus',()=>{f.isFocused=!0,this._renderTimeoutId=setTimeout(()=>f.render(),0)}),f.on('blur',(h,w)=>{const C=f.selection.editableElement;(null===C||C===w.target)&&(f.isFocused=!1,f.render())})}onDomEvent(f){this.fire(f.type,f)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}r.a=u},function(o,r,s){'use strict';var d=s(63),u=s(22);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends d.a{constructor(h){super(h),this.domEventType='keydown'}onDomEvent(h){this.fire('keydown',h,{keyCode:h.keyCode,altKey:h.altKey,ctrlKey:h.ctrlKey||h.metaKey,shiftKey:h.shiftKey,get keystroke(){return s.i(u.c)(this)}})}}r.a=f},function(o,r,s){'use strict';var d=s(63);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class u extends d.a{constructor(f){super(f),this.domEventType='mousedown'}onDomEvent(f){this.fire(f.type,f)}}r.a=u},function(o,r,s){'use strict';var d=s(50),u=s(170),f=s(58),h=s(143);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class w extends d.a{constructor(C){super(C),this.mutationObserver=C.getObserver(u.a),this.document=C,this.selection=C.selection,this.domConverter=C.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=s.i(h.a)((T)=>this.document.fire('selectionChangeDone',T),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),2e3)}observe(C){const T=C.ownerDocument;this._documents.has(T)||(this.listenTo(T,'selectionchange',()=>{this._handleSelectionChange(T)}),this._documents.add(T))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(C){if(this.isEnabled&&this.document.isFocused){this.mutationObserver.flush();const T=C.defaultView.getSelection(),P=this.domConverter.domSelectionToView(T);if(!this.selection.isEqual(P)){if(this._isInfiniteLoop(P))return void f.a.warn('selectionchange-infinite-loop: Selection change observer detected an infinite rendering loop.');const S={oldSelection:this.selection,newSelection:P,domSelection:T};this.document.fire('selectionChange',S),this._fireSelectionChangeDoneDebounced(S)}}}_isInfiniteLoop(C){return this._lastSelection&&this._lastButOneSelection&&(C.isEqual(this._lastSelection)||C.isEqual(this._lastButOneSelection))?this._loopbackCounter++:(this._lastButOneSelection=this._lastSelection,this._lastSelection=C,this._loopbackCounter=0),!!(50N.name),F=O.getAttributeKeys();for(let N of F)V.setAttribute(N,O.getAttribute(N));for(let N of R)O.hasAttribute(N)||V.removeAttribute(N)}_updateChildren(O,V){function R($,K){if($===K)return!0;return F.isText($)&&F.isText(K)?$.data===K.data:s.i(f.e)($,F.blockFiller)&&s.i(f.e)(K,F.blockFiller)}const F=this.domConverter,N=F.getCorrespondingDom(O);if(N){const M=N.ownerDocument,I=V.inlineFillerPosition,L=N.childNodes,D=Array.from(F.viewChildrenToDom(O,M,{bind:!0}));if(I&&I.parent==O){const $=D[I.offset];this.domConverter.isText($)?$.data=f.i+$.data:D.splice(I.offset,0,M.createTextNode(f.i))}const q=s.i(w.a)(L,D,R);let z=0;for(let $ of q)'insert'===$?(s.i(C.a)(N,z,D[z]),z++):'delete'===$?(this.domConverter.unbindDomElement(L[z]),s.i(T.a)(L[z])):z++}}_updateSelection(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const O=this.domConverter.getCorrespondingDomElement(this.selection.editableElement);this.isFocused&&O&&(this.selection.isFake?this._updateFakeSelection(O):(this._removeFakeSelection(),this._updateDomSelection(O)))}_updateFakeSelection(O){const V=O.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=V.createElement('div'),this._fakeSelectionContainer.style.position='fixed',this._fakeSelectionContainer.style.top=0,this._fakeSelectionContainer.style.left='-9999px',this._fakeSelectionContainer.appendChild(V.createTextNode('\xA0'))),this._fakeSelectionContainer.parentElement||O.appendChild(this._fakeSelectionContainer);const R=this.selection.fakeSelectionLabel||'\xA0';this._fakeSelectionContainer.firstChild.data=R;const F=V.getSelection();F.removeAllRanges();const N=new Range;N.selectNodeContents(this._fakeSelectionContainer),F.addRange(N),this.domConverter.bindFakeSelection(this._fakeSelectionContainer,this.selection)}_updateDomSelection(O){const V=O.ownerDocument.defaultView.getSelection(),R=V&&this.domConverter.domSelectionToView(V);if(!(R&&this.selection.isEqual(R))){const F=this.domConverter.viewPositionToDom(this.selection.anchor),N=this.domConverter.viewPositionToDom(this.selection.focus);V.collapse(F.parent,F.offset),V.extend(N.parent,N.offset)}}_removeDomSelection(){for(let O of this.domDocuments){const V=O.getSelection();if(V.rangeCount){const R=O.activeElement,F=this.domConverter.getCorrespondingViewElement(R);R&&F&&O.getSelection().removeAllRanges()}}}_removeFakeSelection(){const O=this._fakeSelectionContainer;O&&O.remove()}_updateFocus(){if(this.isFocused){const O=this.selection.editableElement;O&&this.domConverter.focus(O)}}}r.a=E,s.i(h.a)(E,P.a)},function(o,r,s){'use strict';var d=s(0);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class u{constructor(f,h,w){if(this.textNode=f,0>h||h>f.data.length)throw new d.a('view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.');if(0>w||h+w>f.data.length)throw new d.a('view-textproxy-wrong-length: Given length value is incorrect.');this.data=f.data.substring(h,h+w),this.offsetInText=h}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(f){return'textProxy'==f}getAncestors(f={includeNode:!1,parentFirst:!1}){const h=[];for(let w=f.includeNode?this.textNode:this.parent;null!==w;)h[f.parentFirst?'push':'unshift'](w),w=w.parent;return h}}r.a=u},function(o,r,s){'use strict';function d(C,T,P,S){const E=P.isCollapsed,O=P.getFirstRange(),V=O.start.parent,R=O.end.parent;if(!(S.limits.has(V.name)||S.limits.has(R.name))){if(V.root==V)return void(E||C.deleteContent(P,T));if(E)u(T,P,O.start);else{const F=O.start.isAtStart&&O.end.isAtEnd;C.deleteContent(P,T,{merge:F}),F||(V==R?u(T,P,P.focus):P.collapse(R))}}}function u(C,T,P){if(P.isAtEnd){const S=P.parent,E=new S.constructor(S.name,S.getAttributes());C.insert(h.a.createAfter(P.parent),E)}else C.split(P);T.collapse(P.parent.nextSibling)}var f=s(12),h=s(1);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class w extends f.a{_doExecute(){const C=this.editor.document,T=C.batch();C.enqueueChanges(()=>{d(this.editor.data,T,C.selection,C.schema),this.fire('afterExecute',{batch:T})})}}r.a=w},function(o,r,s){'use strict';var d=s(50),u=s(117),f=s(22);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class h extends d.a{constructor(w){super(w),w.on('keydown',(C,T)=>{this.isEnabled&&T.keyCode==f.b.enter&&w.fire('enter',new u.a(w,T.domEvent))})}observe(){}}r.a=h},function(o,r,s){'use strict';var d=s(2),u=s(12),f=s(60);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class h extends u.a{constructor(w,C){super(w),Object.assign(this,C),this.set('value',!1),this.listenTo(w.document,'changesDone',()=>this._updateValue())}_doExecute(w={}){const C=this.editor,T=C.document,P=this.value;T.enqueueChanges(()=>{const S=w.batch||T.batch();for(let E of T.selection.getSelectedBlocks())if(!P)E.is(this.modelElement)||S.rename(E,this.modelElement);else if(E.is(this.modelElement)){const O=new f.a;O.addRange(d.a.createIn(E)),C.execute('paragraph',{selection:O,batch:S})}})}_updateValue(){const w=this.editor.document.selection.getSelectedBlocks().next().value;w&&(this.value=w.is(this.modelElement))}}r.a=h},function(o,r,s){'use strict';/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function f(T,P,S,E){const O=T.name.split(':'),V=O[0]+':'+O[1];if(S.consume(P.item,V)){const R=E.mapper.toViewElement(P.item),F=R.getChild(0);'removeAttribute'==O[0]?F.removeAttribute(P.attributeKey):F.setAttribute(P.attributeKey,P.attributeNewValue)}}var h=s(5),w=s(1),C=s(13);r.b=function(){return(T,P,S,E)=>{const O=P.input;if(S.test(O,{name:!0,class:'image'})&&E.schema.check({name:'image',inside:P.context,attributes:'src'})){const V=O.getChild(0);if(V&&'img'==V.name&&S.test(V,{name:!0,attribute:'src'})){S.consume(O,{name:!0,class:'image'}),S.consume(V,{name:!0,attribute:'src'});const R=new h.a('image',{src:V.getAttribute('src')});S.consume(V,{attribute:['alt']})&&R.setAttribute('alt',V.getAttribute('alt')),P.context.push(R);const F=E.convertChildren(O,S,P),N=w.a.createAt(R,'end');C.a.insert(N,F),P.context.pop(),P.output=R}}}},r.a=function(T,P){for(let S of T)S.on(`addAttribute:${P}:image`,f),S.on(`changeAttribute:${P}:image`,f),S.on(`removeAttribute:${P}:image`,f)}},function(o,r,s){'use strict';function d(D,q,z,$){if('insert'===q){const K=new T.a({boundaries:z.range,ignoreElementEnd:!0});for(let H of K){const U=H.item;'elementStart'==H.type&&s.i(M.b)(U)&&!s.i(I.c)(U)&&$.document.enqueueChanges(()=>{$.insert(R.a.createAt(U,'end'),new P.a('caption'))})}}}function u(D,q){return(z,$)=>{if(h($.item)){const K=$.item.parent,H=K.parent,U=q.toViewElement(H);let W=q.toViewElement(K);U&&!W&&(W=D(),w(W,K,U,q))}}}function f(D){return(q,z,$,K)=>{const H=z.item;if(s.i(M.b)(H.parent)&&0this._updateView(),{priority:'high'})}_removeEmptyCaption(){const D=this.editor.editing.view.selection,q=this._lastSelectedEditable;if(!q)return;if(D.editableElement===q)return;const z=D.getSelectedElement();if(z&&s.i(M.a)(z)){const $=q.findAncestor((K)=>K==z);if($)return}if(0===q.childCount){const $=this.editor.editing.mapper;V.a.remove(O.a.createOn(q)),$.unbindViewElement(q)}}_addCaptionWhenSelected(){const D=this.editor.editing,q=D.view.selection,z=q.getSelectedElement(),$=D.mapper;if(z&&s.i(M.a)(z)){const K=$.toModelElement(z),H=s.i(I.c)(K);let U=$.toViewElement(H);U||(U=this._createCaption(),w(U,H,z,$)),this._lastSelectedEditable=U}}_updateView(){const D=this.editor.editing.view.selection;this._removeEmptyCaption(),this._addCaptionWhenSelected();const q=D.editableElement;q&&s.i(I.d)(D.editableElement)&&(this._lastSelectedEditable=D.editableElement)}}r.a=L},function(o,r,s){'use strict';var w=s(75),C=s(5);r.a=function(P){return()=>{const S=new w.a('figcaption',{contenteditable:!0});return S.document=P,S.setCustomProperty(T,!0),S.on('change:isFocused',(E,O,V)=>{V?S.addClass('focused'):S.removeClass('focused')}),S}},r.d=function(P){return!!P.getCustomProperty(T)},r.c=function(P){for(let S of P.getChildren())if(S instanceof C.a&&'caption'==S.name)return S;return null},r.b=function(P){const S=P.parent;return'figcaption'==P.name&&S&&'figure'==S.name&&S.hasClass('image')?{name:!0}:null};/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */const T=Symbol('imageCaption')},function(o,r,s){'use strict';/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function f(P,S,E,O){const V=S.input,R=S.output;if(E.test(V,{class:P.className})&&s.i(T.b)(R)){const F=[...R.getAttributeKeys(),'imageStyle'];O.schema.check({name:'image',inside:S.context,attributes:F})&&(E.consume(V,{class:P.className}),R.setAttribute('imageStyle',P.value))}}function h(P,S){for(let E of S)if(E.value===P)return E}function w(P,S,E){return S&&('changeAttribute'==P||'removeAttribute'==P)&&(E.removeClass(S.className),!0)}function C(P,S,E){return S&&('addAttribute'==P||'changeAttribute'==P)&&(E.addClass(S.className),!0)}var T=s(40);r.a=function(P){return(S,E,O,V)=>{const R=S.name.split(':')[0],F=R+':imageStyle';if(O.test(E.item,F)){const N=h(E.attributeNewValue,P),M=h(E.attributeOldValue,P),I=V.mapper.toViewElement(E.item);(w(R,M,I)||C(R,N,I))&&O.consume(E.item,F)}}},r.b=function(P){const S=P.filter((E)=>null!==E.value);return(E,O,V,R)=>{for(let F of S)f(F,O,V,R)}}},function(o,r,s){'use strict';var d=s(12),u=s(40);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends d.a{constructor(h,w){super(h),this.set('value',!1),this.style=w,this.listenTo(h.document,'changesDone',()=>{this._updateValue(),this.refreshState()})}_updateValue(){const h=this.editor.document,w=h.selection.getSelectedElement();return w?void(null===this.style.value?this.value=!w.hasAttribute('imageStyle'):this.value=w.getAttribute('imageStyle')==this.style.value):void(this.value=!1)}_checkEnabled(){const h=this.editor.document.selection.getSelectedElement();return s.i(u.b)(h)}_doExecute(h={}){if(this.value)return;const w=this.editor,C=w.document,T=C.selection,P=T.getSelectedElement();C.enqueueChanges(()=>{const S=h.batch||C.batch();S.setAttribute(P,'imageStyle',this.style.value)})}}r.a=f},function(o,r,s){'use strict';var d=s(3),u=s(366),f=s(174),h=s(365),w=s(300),C=s.n(w),T=s(301),P=s.n(T);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class S extends d.a{static get requires(){return[f.a]}init(){const E=this.editor,O=E.t,V=E.document,R=V.schema,F=E.data,N=E.editing;E.config.define('image.styles',[{name:'imageStyleFull',title:O('Full size image'),icon:C.a,value:null},{name:'imageStyleSide',title:O('Side image'),icon:P.a,value:'side',className:'image-style-side'}]);const M=E.config.get('image.styles');R.allow({name:'image',attributes:'imageStyle',inside:'$root'});const I=s.i(h.a)(M);N.modelToView.on('addAttribute:imageStyle:image',I),F.modelToView.on('addAttribute:imageStyle:image',I),N.modelToView.on('changeAttribute:imageStyle:image',I),F.modelToView.on('changeAttribute:imageStyle:image',I),N.modelToView.on('removeAttribute:imageStyle:image',I),F.modelToView.on('removeAttribute:imageStyle:image',I),F.viewToModel.on('element:figure',s.i(h.b)(M),{priority:'low'});for(let L of M)E.commands.set(L.name,new u.a(E,L))}}r.a=S},function(o,r,s){'use strict';var d=s(3),u=s(26),f=s(370),h=s(387),w=s(181),C=s(153),T=s(371),P=s(175),S=s(299),E=s.n(S),O=s(311),V=s.n(O);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class R extends d.a{static get requires(){return[f.a]}init(){this._createButton();const F=this.editor.config.get('image.defaultToolbar');return F&&(F.length&&F.push('|'),F.push('imageTextAlternative')),this._createBalloonPanel().then((N)=>{this.balloonPanel=N,this.form=N.content.get(0)})}_createButton(){const F=this.editor,N=F.commands.get('imageTextAlternative'),M=F.t;F.ui.componentFactory.add('imageTextAlternative',(I)=>{const L=new u.a(I);return L.set({label:M('Change image text alternative'),icon:E.a,tooltip:!0}),L.bind('isEnabled').to(N,'isEnabled'),this.listenTo(L,'execute',()=>this._showBalloonPanel()),L})}_createBalloonPanel(){const F=this.editor,N=new P.a(F),M=new T.a(F.locale);this.listenTo(M,'submit',()=>{F.execute('imageTextAlternative',{newValue:M.lebeledInput.inputView.element.value}),this._hideBalloonPanel()});const I=F.plugins.get(C.a);return I&&this.listenTo(N,'change:isVisible',()=>{N.isVisible?(I.hide(),I.isEnabled=!1):(I.show(),I.isEnabled=!0)}),this.listenTo(M,'cancel',()=>this._hideBalloonPanel()),s.i(h.a)({emitter:N,activator:()=>N.isVisible,callback:()=>this._hideBalloonPanel()}),s.i(w.a)({emitter:N,activator:()=>N.isVisible,contextElement:N.element,callback:()=>this._hideBalloonPanel()}),Promise.all([N.content.add(M),F.ui.view.body.add(N)]).then(()=>N)}_showBalloonPanel(){const F=this.editor,N=F.commands.get('imageTextAlternative');this.form.lebeledInput.value=N.value||'',this.balloonPanel.attach(),this.form.lebeledInput.select()}_hideBalloonPanel(){const F=this.editor;this.balloonPanel.detach(),F.editing.view.focus()}}r.a=R},function(o,r,s){'use strict';var d=s(12),u=s(40);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends d.a{constructor(h){super(h),this.set('value',!1),this.listenTo(h.document,'changesDone',()=>{this._updateValue(),this.refreshState()})}_updateValue(){const h=this.editor.document,w=h.selection.getSelectedElement();this.value=s.i(u.b)(w)&&w.hasAttribute('alt')&&w.getAttribute('alt')}_checkEnabled(){const h=this.editor.document.selection.getSelectedElement();return s.i(u.b)(h)}_doExecute(h){const w=this.editor,C=w.document,T=C.selection.getSelectedElement();C.enqueueChanges(()=>{const P=h.batch||C.batch();P.setAttribute(T,'alt',h.newValue)})}}r.a=f},function(o,r,s){'use strict';var d=s(369),u=s(3);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends u.a{init(){this.editor.commands.set('imageTextAlternative',new d.a(this.editor))}}r.a=f},function(o,r,s){'use strict';var d=s(9),u=s(26),f=s(6),h=s(184),w=s(183),C=s(182);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class T extends d.a{constructor(P){super(P);const S=this.locale.t;this.lebeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(S('Save')),this.saveButtonView.type='submit',this.cancelButtonView=this._createButton(S('Cancel'),'cancel'),f.a.extend(this.saveButtonView.template,{attributes:{class:['ck-button-action']}}),this.template=new f.a({tag:'form',attributes:{class:['cke-text-alternative-form']},children:[this.lebeledInput,{tag:'div',attributes:{class:['cke-text-alternative-form__actions']},children:[this.saveButtonView,this.cancelButtonView]}]}),s.i(C.a)({view:this})}_createButton(P,S){const E=new u.a(this.locale);return E.label=P,E.withText=!0,S&&E.delegate('execute').to(this,S),E}_createLabeledInputView(){const P=this.locale.t,S=new h.a(this.locale,w.a);return S.label=P('Text alternative'),S}}r.a=T},function(o,r,s){'use strict';function d(N){return N==R.b.arrowright||N==R.b.arrowleft||N==R.b.arrowup||N==R.b.arrowdown}function u(N){return N==R.b.delete||N==R.b.backspace}function f(N){for(;N;){if(N instanceof E.a&&!(N instanceof O.a))return!0;N=N.parent}return!1}var h=s(3),w=s(176),C=s(355),T=s(2),P=s(60),S=s(5),E=s(75),O=s(171),V=s(118),R=s(22);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class F extends h.a{static get requires(){return[w.a]}init(){const N=this.editor.editing.view;N.addObserver(C.a),this.listenTo(N,'mousedown',(...M)=>this._onMousedown(...M)),this.listenTo(N,'keydown',(...M)=>this._onKeydown(...M),{priority:'high'})}_onMousedown(N,M){const I=this.editor,L=I.editing.view;let D=M.target;if(f(D))return;if(!s.i(V.b)(D)&&(D=D.findAncestor(V.b),!D))return;M.preventDefault(),L.isFocused||L.focus();const q=I.editing.mapper.toModelElement(D);I.document.enqueueChanges(()=>{this._setSelectionOverElement(q)})}_onKeydown(N,M){const I=M.keyCode,L=I==R.b.delete||I==R.b.arrowdown||I==R.b.arrowright;(u(I)&&this._handleDelete(L)||d(I)&&this._handleArrowKeys(L))&&(M.preventDefault(),N.stop())}_handleDelete(N){const M=this.editor.document,I=M.selection;if(!I.isCollapsed)return;const L=this._getObjectElementNextToSelection(N);if(L)return M.enqueueChanges(()=>{const D=I.anchor.parent;if(D.isEmpty){const q=M.batch();q.remove(D)}this._setSelectionOverElement(L)}),!0}_handleArrowKeys(N){const M=this.editor.document,I=M.schema,L=M.selection,D=L.getSelectedElement();if(D&&I.objects.has(D.name)){const z=N?L.getLastPosition():L.getFirstPosition(),$=M.getNearestSelectionRange(z,N?'forward':'backward');return $&&M.enqueueChanges(()=>{L.setRanges([$])}),!0}if(!L.isCollapsed)return;const q=this._getObjectElementNextToSelection(N);if(q instanceof S.a&&M.schema.objects.has(q.name))return M.enqueueChanges(()=>{this._setSelectionOverElement(q)}),!0}_setSelectionOverElement(N){this.editor.document.selection.setRanges([T.a.createOn(N)])}_getObjectElementNextToSelection(N){const M=this.editor.document,I=M.schema,L=M.selection,D=this.editor.data,q=P.a.createFromSelection(L);D.modifySelection(q,{direction:N?'forward':'backward'});const z=N?q.focus.nodeBefore:q.focus.nodeAfter;return z instanceof S.a&&I.objects.has(z.name)?z:null}}r.a=F},function(o,r,s){'use strict';var d=s(12),u=s(24),f=s(2),h=s(100),w=s(157),C=s(177);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class T extends d.a{constructor(P){super(P),this.set('value',void 0),this.listenTo(this.editor.document.selection,'change:attribute',()=>{this.value=this.editor.document.selection.getAttribute('linkHref')})}_checkEnabled(){const P=this.editor.document;return s.i(w.a)('linkHref',P.selection,P.schema)}_doExecute(P){const S=this.editor.document,E=S.selection;S.enqueueChanges(()=>{const O=S.batch();if(E.isCollapsed){const V=E.getFirstPosition(),R=V.parent;if(E.hasAttribute('linkHref')){const F=s.i(C.a)(E.getFirstPosition(),E.getAttribute('linkHref'));O.setAttribute(F,'linkHref',P),E.setRanges([F])}else if(S.schema.check({name:'$text',attributes:'linkHref',inside:R.name})){const F=new u.a(P,{linkHref:P});O.insert(V,F),E.setRanges([f.a.createOn(F)])}}else{const V=s.i(h.a)('linkHref',E.getRanges(),S.schema);for(let R of V)O.setAttribute(R,'linkHref',P)}})}}r.a=T},function(o,r,s){'use strict';var d=s(3),u=s(47),f=s(48),h=s(178),w=s(373),C=s(376);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class T extends d.a{init(){const P=this.editor,S=P.data,E=P.editing;P.document.schema.allow({name:'$inline',attributes:'linkHref'}),s.i(u.a)().for(S.modelToView,E.modelToView).fromAttribute('linkHref').toElement((O)=>new h.a('a',{href:O})),s.i(f.a)().for(S.viewToModel).fromElement('a').toAttribute((O)=>({key:'linkHref',value:O.getAttribute('href')})),P.commands.set('link',new w.a(P)),P.commands.set('unlink',new C.a(P))}}r.a=T},function(o,r,s){'use strict';var d=s(9),u=s(6),f=s(120),h=s(26),w=s(184),C=s(183),T=s(182),P=s(65),S=s(119),E=s(66);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class O extends d.a{constructor(V){super(V);const R=V.t;this.focusTracker=new P.a,this.keystrokes=new E.a,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(R('Save')),this.saveButtonView.type='submit',this.cancelButtonView=this._createButton(R('Cancel'),'cancel'),this.unlinkButtonView=this._createButton(R('Unlink'),'unlink'),this._focusables=new f.a,this._focusCycler=new S.a({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:'shift + tab',focusNext:'tab'}}),u.a.extend(this.saveButtonView.template,{attributes:{class:['ck-button-action']}}),this.template=new u.a({tag:'form',attributes:{class:['ck-link-form']},children:[this.urlInputView,{tag:'div',attributes:{class:['ck-link-form__actions']},children:[this.saveButtonView,this.cancelButtonView,this.unlinkButtonView]}]}),s.i(T.a)({view:this});const F=[this.urlInputView,this.saveButtonView,this.cancelButtonView,this.unlinkButtonView];F.forEach((N)=>{this._focusables.add(N),this.focusTracker.add(N.element)})}init(){return this.keystrokes.listenTo(this.element),super.init()}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const V=this.locale.t,R=new w.a(this.locale,C.a);return R.label=V('Link URL'),R}_createButton(V,R){const F=new h.a(this.locale);return F.label=V,F.withText=!0,R&&F.delegate('execute').to(this,R),F}}r.a=O},function(o,r,s){'use strict';var d=s(12),u=s(177);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends d.a{constructor(h){super(h),this.listenTo(h.document.selection,'change:attribute',()=>this.refreshState())}_doExecute(){const h=this.editor.document,w=h.selection;h.enqueueChanges(()=>{const C=w.isCollapsed?[s.i(u.a)(w.getFirstPosition(),w.getAttribute('linkHref'))]:w.getRanges(),T=h.batch();for(let P of C)T.removeAttribute(P,'linkHref')})}_checkEnabled(){return this.editor.document.selection.hasAttribute('linkHref')}}r.a=f},function(o,r,s){'use strict';/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function R(Y,X,Q){const ee=Y.nodeBefore;let te=Y.nodeAfter;if(te&&'listItem'==te.name){const ae=ee&&ee.is('listItem')?ee.getAttribute('indent')+1:0;let ne=te.getAttribute('indent')-ae;const oe=[];for(;te&&'listItem'==te.name&&te.getAttribute('indent')>ae;){ne>te.getAttribute('indent')&&(ne=te.getAttribute('indent'));const ie=te.getAttribute('indent')-ne;oe.push({item:te,indent:ie}),te=te.nextSibling}0{for(let ie of oe.reverse())Q.setAttribute(ie.item,'indent',ie.indent)})}}function F(Y,X,Q,ee){let te=Y[X?'nodeBefore':'nodeAfter'];if(!te)return;const ae=M(te,{checkAllSiblings:!0,getNext:X,sameIndent:!0});if(!ae)return;const ne=ae.getAttribute('indent'),oe=ae.getAttribute('type');0===ne||Q.enqueueChanges(()=>{for(;te&&te.is('listItem')&&te.getAttribute('indent')>=ne;)te.getAttribute('type')!=oe&&te.getAttribute('indent')==ne&&ee.setAttribute(te,'type',oe),te=te[X?'previousSibling':'nextSibling']})}function N(Y,X){const Q='numbered'==Y.getAttribute('type')?'ol':'ul',ee=new z.a,te=new U.a(Q,null);return te.appendChildren(ee),X.bindElements(Y,ee),ee}function M(Y,X){const Q=X.getNext?'nextSibling':'previousSibling',ee=X.getNext?'nodeAfter':'nodeBefore',te=!!X.checkAllSiblings,ae=!!X.sameIndent,ne=!!X.biggerIndent,oe=!!X.smallerIndent,ie=!!X.isMapped,re=Y instanceof $.a?Y.getAttribute('indent'):X.indent;for(let se=Y instanceof $.a?Y[Q]:Y[ee],le;se&&'listItem'==se.name;){if(le=se.getAttribute('indent'),ae&&re==le||ne&&rele){if(!ie||X.mapper.toViewElement(se))return se;se=se[Q];continue}if(!te)return null;se=se[Q]}return null}function I(Y,X){return Y&&X&&('ul'==Y.name||'ol'==Y.name)&&Y.name==X.name?J.a.mergeContainers(W.a.createAfter(Y)):null}function L(Y,X,Q,ee){const te=X.parent;let ae,ne=M(Y,{sameIndent:!0,smallerIndent:!0,checkAllSiblings:!0});if(ne&&ne.getAttribute('indent')==Y.getAttribute('indent')){let ie=Q.toViewElement(ne);ae=J.a.breakContainer(W.a.createAfter(ie))}else ne=Y.previousSibling,ae=ne&&'listItem'==ne.name?ne.getAttribute('indent')=X;)Y=Y.nextSibling,Y.getAttribute('indent')==X&&(Q=Y);return Q}var z=s(380),$=s(5),K=s(1),H=s(13),U=s(39),W=s(25),Z=s(29),G=s(51),J=s(78);r.e=function(Y,X,Q,ee){if(Q.test(X.item,'insert')&&Q.test(X.item,'addAttribute:type')&&Q.test(X.item,'addAttribute:indent')){Q.consume(X.item,'insert'),Q.consume(X.item,'addAttribute:type'),Q.consume(X.item,'addAttribute:indent');const te=X.item,ae=N(te,ee.mapper);L(te,ae,ee.mapper)}},r.f=function(Y,X,Q,ee){if(!Q.consume(X.item,'changeAttribute:type'))return;const te=ee.mapper.toViewElement(X.item);J.a.breakContainer(W.a.createBefore(te)),J.a.breakContainer(W.a.createAfter(te));let ae=te.parent;const ne='numbered'==X.attributeNewValue?'ol':'ul';ae=J.a.rename(ae,ne),I(ae,ae.nextSibling),I(ae.previousSibling,ae)},r.g=function(Y,X,Q,ee){if(Q.consume(X.item,'remove')){const te=ee.mapper.toViewPosition(X.sourcePosition),ae=te.nodeAfter.is('li')?te.nodeAfter:te.nodeAfter.getChild(0);J.a.breakContainer(W.a.createBefore(ae)),J.a.breakContainer(W.a.createAfter(ae));const ne=ae.parent,oe=ne.previousSibling,ie=Z.a.createOn(ne);J.a.remove(ie),oe&&oe.nextSibling&&I(oe,oe.nextSibling),D(X.item.getAttribute('indent')+1,X.sourcePosition,ie.start,ae,ee.mapper),'$graveyard'==X.item.root.rootName&&ee.mapper.unbindModelElement(X.item)}},r.i=function(Y,X,Q,ee){if(!Q.consume(X.item,'changeAttribute:indent'))return;const te=ee.mapper.toViewElement(X.item);J.a.breakContainer(W.a.createBefore(te)),J.a.breakContainer(W.a.createAfter(te));const ae=te.parent,ne=ae.previousSibling,oe=Z.a.createOn(ae);J.a.remove(oe);let ie;ne&&ne.nextSibling&&(ie=I(ne,ne.nextSibling)),ie||(ie=oe.start),D(X.attributeOldValue+1,X.range.start,oe.start,te,ee.mapper),L(X.item,te,ee.mapper,ie)},r.d=function(Y,X,Q,ee){if('listItem'!=X.item.name){let te=ee.mapper.toViewPosition(X.range.start);const ae=[];for(;('ul'==te.parent.name||'ol'==te.parent.name)&&(te=J.a.breakContainer(te),'li'==te.parent.name);){const ne=te,oe=W.a.createAt(te.parent,'end');if(!ne.isEqual(oe)){const ie=J.a.remove(new Z.a(ne,oe));ae.push(ie)}te=W.a.createAfter(te.parent)}if(0ne.is('ul')||ne.is('ol')),ae=new G.a({startPosition:W.a.createAt(ee,0)});for(let ne of ae)if('elementStart'==ne.type&&ne.item.is('li')){X.viewPosition=ne.previousPosition;break}else if('elementEnd'==ne.type&&ne.item==te){X.viewPosition=ne.nextPosition;break}}},r.c=function(Y,X){const Q=X.viewPosition,ee=Q.parent,te=X.mapper;if('ul'==ee.name||'ol'==ee.name){if(!Q.isAtEnd){const ae=te.toModelElement(Q.nodeAfter);X.modelPosition=K.a.createBefore(ae)}else{const ae=te.toModelElement(Q.nodeBefore),ne=te.getModelLength(Q.nodeBefore);X.modelPosition=K.a.createBefore(ae).getShiftedBy(ne)}Y.stop()}else if('li'==ee.name&&Q.nodeBefore&&('ul'==Q.nodeBefore.name||'ol'==Q.nodeBefore.name)){const ae=te.toModelElement(ee);let ne=1,oe=Q.nodeBefore;for(;oe&&(oe.is('ul')||oe.is('ol'));)ne+=te.getModelLength(oe),oe=oe.previousSibling;X.modelPosition=K.a.createBefore(ae).getShiftedBy(ne),Y.stop()}},r.a=function(Y){return(X,Q,ee,te)=>{if('remove'==Q)R(ee.sourcePosition,Y,te),F(ee.sourcePosition,!1,Y,te);else if('move'==Q)R(ee.sourcePosition,Y,te),F(ee.sourcePosition,!1,Y,te),R(ee.range.start,Y,te),F(ee.range.start,!1,Y,te),R(ee.range.end,Y,te),F(ee.range.end,!0,Y,te);else if('rename'==Q&&'listItem'==ee.oldName&&'listItem'!=ee.newName){const ae=ee.element;Y.enqueueChanges(()=>{te.removeAttribute(ae,'indent').removeAttribute(ae,'type')});const ne=K.a.createAfter(ee.element);R(ne,Y,te)}else'insert'==Q&&(R(ee.range.start,Y,te),F(ee.range.start,!1,Y,te),R(ee.range.end,Y,te),F(ee.range.end,!0,Y,te))}}},function(o,r,s){'use strict';var d=s(12),u=s(191);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends d.a{constructor(h,w){super(h),this._indentBy='forward'==w?1:-1,this.listenTo(h.document.selection,'change:range',()=>{this.refreshState()}),this.listenTo(h.document,'changesDone',()=>{this.refreshState()})}_doExecute(){const h=this.editor.document,w=h.batch();let C=Array.from(h.selection.getSelectedBlocks());h.enqueueChanges(()=>{const T=C[C.length-1];for(let P=T.nextSibling;P&&'listItem'==P.name&&P.getAttribute('indent')>T.getAttribute('indent');)C.push(P),P=P.nextSibling;0>this._indentBy&&(C=C.reverse());for(let S of C){const E=S.getAttribute('indent')+this._indentBy;if(0>E)w.rename(S,'paragraph');else{if(0this._indentBy){let O=S.previousSibling;for(;O.getAttribute('indent')>E;)O=O.previousSibling;O.getAttribute('type')!=S.getAttribute('type')&&w.setAttribute(S,'type',O.getAttribute('type'))}w.setAttribute(S,'indent',E)}}})}_checkEnabled(){const h=s.i(u.a)(this.editor.document.selection.getSelectedBlocks());if(!h||!h.is('listItem'))return!1;const w=h.previousSibling,C=h.getAttribute('indent'),T=C+this._indentBy;if(0=P;)O>E.getAttribute('indent')&&(O=E.getAttribute('indent')),E.getAttribute('indent')==O&&C[T?'unshift':'push'](E),E=E[T?'previousSibling':'nextSibling']}var u=s(12),f=s(1),h=s(191);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class w extends u.a{constructor(C,T){super(C),this.type='bulleted'==T?'bulleted':'numbered',this.set('value',!1);const P=()=>{this.refreshValue(),this.refreshState()};this.listenTo(C.document.selection,'change:range',P),this.listenTo(C.document,'changesDone',P)}refreshValue(){const C=s.i(h.a)(this.editor.document.selection.getSelectedBlocks());this.value=null!==C&&C.getAttribute('type')==this.type}_doExecute(C={}){const T=this.editor.document,P=Array.from(T.selection.getSelectedBlocks()),S=!0===this.value;T.enqueueChanges(()=>{const E=C.batch||T.batch();if(S){let O=P[P.length-1].nextSibling,V=_NumberPOSITIVE_INFINITY,R=[];for(;O&&'listItem'==O.name&&0!==O.getAttribute('indent');){const F=O.getAttribute('indent');Fthis._updateValue())}_doExecute(f={}){const h=this.editor.document;h.enqueueChanges(()=>{const w=f.batch||h.batch(),C=(f.selection||h.selection).getSelectedBlocks();for(let T of C)T.is('paragraph')||w.rename(T,'paragraph')})}_updateValue(){const f=this.editor.document.selection.getSelectedBlocks().next().value;f&&(this.value=f.is('paragraph'))}}r.a=u},function(o,r,s){'use strict';var d=s(3),u=s(383),f=s(384);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class h extends d.a{init(){const w=this.editor,C=w.editing.view;C.addObserver(f.a),w.commands.set('forwardDelete',new u.a(w,'forward')),w.commands.set('delete',new u.a(w,'backward')),this.listenTo(C,'delete',(T,P)=>{w.execute('forward'==P.direction?'forwardDelete':'delete',{unit:P.unit}),P.preventDefault()})}}r.a=h},function(o,r,s){'use strict';var d=s(12),u=s(60),f=s(180),h=s(187);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class w extends d.a{constructor(C,T){super(C),this.direction=T,this._buffer=new f.a(C.document,C.config.get('typing.undoStep'))}_doExecute(C={}){const T=this.editor.document,P=this.editor.data;T.enqueueChanges(()=>{this._buffer.lock();const S=u.a.createFromSelection(T.selection);if(S.isCollapsed&&P.modifySelection(S,{direction:this.direction,unit:C.unit}),S.isCollapsed)return;let E=0;S.getFirstRange().getMinimalFlatRanges().forEach((O)=>{E+=s.i(h.a)(O.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),P.deleteContent(S,this._buffer.batch,{merge:!0}),this._buffer.input(E),T.selection.setRanges(S.getRanges(),S.isBackward),this._buffer.unlock()})}}r.a=w},function(o,r,s){'use strict';var d=s(50),u=s(117),f=s(22);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class h extends d.a{constructor(w){super(w),w.on('keydown',(C,T)=>{const P={};if(T.keyCode==f.b.delete)P.direction='forward',P.unit='character';else if(T.keyCode==f.b.backspace)P.direction='backward',P.unit='codePoint';else return;P.unit=T.altKey?'word':P.unit,w.fire('delete',new u.a(w,T.domEvent,P))})}observe(){}}r.a=h},function(o,r,s){'use strict';function d(F){return!!F.ctrlKey||R.includes(F.keyCode)}function u(F,N){return F instanceof C.a&&N instanceof C.a?F.data===N.data:F===N}var f=s(3),h=s(2),w=s(25),C=s(30),T=s(188),P=s(409),S=s(22),E=s(386);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class O extends f.a{init(){const F=this.editor,N=F.editing.view,M=new E.a(F,F.config.get('typing.undoStep')||20);F.commands.set('input',M),this.listenTo(N,'keydown',(I,L)=>{this._handleKeydown(L,M.buffer)},{priority:'lowest'}),this.listenTo(N,'mutations',(I,L,D)=>{this._handleMutations(L,D)})}_handleKeydown(F,N){const M=this.editor.document;d(F)||M.selection.isCollapsed||(N.lock(),M.enqueueChanges(()=>{this.editor.data.deleteContent(M.selection,N.batch)}),N.unlock())}_handleMutations(F,N){new V(this.editor).handle(F,N)}}r.a=O;class V{constructor(F){this.editor=F,this.editing=this.editor.editing}handle(F,N){for(let M of F)this._handleTextMutation(M,N),this._handleTextNodeInsertion(M)}_handleTextMutation(F,N){if('text'!=F.type)return;const M=F.newText.replace(/\u00A0/g,' '),I=F.oldText.replace(/\u00A0/g,' '),L=s.i(T.a)(I,M);let D=null,q=null;for(let G=0;G=F;F++)R.push(F)},function(o,r,s){'use strict';var d=s(12),u=s(180);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends d.a{constructor(h,w){super(h),this._buffer=new u.a(h.document,w)}destroy(){super.destroy(),this._buffer.destroy(),this._buffer=null}get buffer(){return this._buffer}_doExecute(h={}){const w=this.editor.document,C=h.text||'',T=C.length,P=h.range||w.selection.getFirstRange(),S=h.resultRange;w.enqueueChanges(()=>{const E=P.isCollapsed;this._buffer.lock(),E||this._buffer.batch.remove(P),this._buffer.batch.weakInsert(P.start,C),S?this.editor.data.model.selection.setRanges([S]):E&&this.editor.data.model.selection.collapse(P.start.getShiftedBy(T)),this._buffer.unlock(),this._buffer.input(T)})}}r.a=f},function(o,r,s){'use strict';var u=s(22);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=function({emitter:f,activator:h,callback:w}){f.listenTo(document,'keydown',(C,{keyCode:T})=>{T==u.b.esc&&h()&&w()})}},function(o,r,s){'use strict';var d=s(0);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=class{constructor(f){this.editor=f,this._components=new Map}add(f,h){if(this._components.get(f))throw new d.a('componentfactory-item-exists: The item already exists in the component factory.',{name:f});this._components.set(f,h)}create(f){return this._components.get(f)(this.editor.locale)}}},function(o,r,s){'use strict';var u=s(26),f=s(391),h=s(390);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=function(w,C){const T=new u.a(C);T.bind('label','isOn','isEnabled','withText','keystroke','tooltip').to(w);const P=new h.a(C);return new f.a(C,T,P)}},function(o,r,s){'use strict';var d=s(9),u=s(6);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends d.a{constructor(h){super(h);const w=this.bindTemplate;this.set('isVisible',!1),this.children=this.createCollection(),this.template=new u.a({tag:'div',attributes:{class:['ck-reset','ck-dropdown__panel',w.if('isVisible','ck-dropdown__panel-visible')]},children:this.children})}}r.a=f},function(o,r,s){'use strict';var d=s(9),u=s(6),f=s(65),h=s(66);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class w extends d.a{constructor(C,T,P){super(C),u.a.extend(T.template,{attributes:{class:['ck-dropdown__button']}}),this.buttonView=T,this.panelView=P,this.set('isOpen',!1),this.focusTracker=new f.a,this.keystrokes=new h.a,this.template=new u.a({tag:'div',attributes:{class:['ck-dropdown']},children:[T,P]}),this.listenTo(T,'execute',()=>this.isOpen=!this.isOpen),P.bind('isVisible').to(this,'isOpen')}init(){this.keystrokes.listenTo(this.element),this.focusTracker.add(this.element);const C=(T,P)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,P())};return this.keystrokes.set('arrowdown',(T,P)=>{this.isOpen||(this.isOpen=!0,P())}),this.keystrokes.set('arrowright',(T,P)=>{this.isOpen&&P()}),this.keystrokes.set('arrowleft',C),this.keystrokes.set('esc',C),super.init()}focus(){this.buttonView.focus()}}r.a=w},function(o,r,s){'use strict';function u(C){C.listenTo(document,'click',(T,{target:P})=>{C.element==P||C.element.contains(P)||(C.isOpen=!1)})}/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */var f=s(400),h=s(399),w=s(389);r.a=function(C,T){const P=s.i(w.a)(C,T),S=P.listView=new f.a(T);return S.items.bindTo(C.items).using((E)=>{const O=new h.a(T);return O.bind(...Object.keys(E)).to(E),O}),S.items.delegate('execute').to(P),P.panelView.children.add(S),P.on('change:isOpen',(E,O,V)=>{V?u(P):P.stopListening(document)}),P.on('execute',()=>{P.isOpen=!1}),P.keystrokes.set('arrowdown',(E,O)=>{P.isOpen&&(S.focus(),O())}),P.keystrokes.set('arrowup',(E,O)=>{P.isOpen&&(S.focusLast(),O())}),P}},function(o,r,s){'use strict';var d=s(9),u=s(6);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends d.a{constructor(h,w){super(h);const C=this.bindTemplate;w&&(this.element=this.editableElement=w),this.template=new u.a({tag:'div',attributes:{class:[C.to('isFocused',(T)=>T?'ck-focused':'ck-blurred'),'ck-editor__editable'],contenteditable:C.to('isReadOnly',(T)=>!T)}}),this.set('isReadOnly',!1),this.set('isFocused',!1),this.externalElement=w}init(){return this.externalElement?this.template.apply(this.externalElement):this.editableElement=this.element,super.init()}destroy(){return this.externalElement&&this.template.revert(this.externalElement),super.destroy()}}r.a=f},function(o,r,s){'use strict';var d=s(393),u=s(6);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends d.a{constructor(h,w){super(h,w);const C=this.bindTemplate,T=this.t;this.set('name',null);u.a.extend(this.template,{attributes:{role:'textbox','aria-label':C.to('name',(S)=>{return T('Rich Text Editor, %0',[S])}),class:'ck-editor__editable_inline'}})}}r.a=f},function(o,r,s){'use strict';var d=s(396),u=s(70),f=s(6);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class h extends d.a{constructor(w){super(w);const C=this.t,T=s.i(u.a)();this.set('width',null),this.set('height',null),this.top=this.createCollection(),this.main=this.createCollection(),this.template=new f.a({tag:'div',attributes:{class:['ck-reset','ck-editor','ck-rounded-corners'],role:'application',dir:'ltr',lang:w.lang,'aria-labelledby':`cke-editor__aria-label_${T}`},children:[{tag:'span',attributes:{id:`cke-editor__aria-label_${T}`,class:'cke-voice-label'},children:[C('Rich Text Editor')]},{tag:'div',attributes:{class:'ck-editor__top ck-reset_all',role:'presentation'},children:this.top},{tag:'div',attributes:{class:'ck-editor__main',role:'presentation'},children:this.main}]})}}r.a=h},function(o,r,s){'use strict';var d=s(9),u=s(6);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends d.a{constructor(h){super(h),this.body=this.createCollection()}init(){return Promise.resolve().then(()=>this._renderBodyCollection()).then(()=>super.init())}destroy(){return this._bodyCollectionContainer.remove(),super.destroy()}_renderBodyCollection(){const h=this._bodyCollectionContainer=new u.a({tag:'div',attributes:{class:['ck-body','ck-rounded-corners','ck-reset_all']},children:this.body}).render();document.body.appendChild(h)}}r.a=f},function(o,r,s){'use strict';var d=s(9),u=s(6);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends d.a{constructor(){super();const h=this.bindTemplate;this.set('content'),this.set('viewBox','0 0 20 20'),this.template=new u.a({tag:'svg',ns:'http://www.w3.org/2000/svg',attributes:{class:'ck-icon',viewBox:h.to('viewBox')}}),this.on('change:content',(w,C,T)=>{for(const P=new DOMParser().parseFromString(T.trim(),'image/svg+xml').firstChild;0{this.focusTracker.add(P.element)}),this.items.on('remove',(T,P)=>{this.focusTracker.remove(P.element)})}init(){return this.keystrokes.listenTo(this.element),super.init()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}r.a=C},function(o,r,s){'use strict';var d=s(57),u=s(4),f=s(32);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class h{constructor(w,C){C&&s.i(d.a)(this,C),w&&this.set(w)}}r.a=h,s.i(u.a)(h,f.a)},function(o,r){'use strict';r.a=/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function({origin:u,originKeystrokeHandler:f,originFocusTracker:h,toolbar:w}){h.add(w.element),f.set('Alt+F10',(C,T)=>{h.isFocused&&!w.focusTracker.isFocused&&(w.focus(),T())}),w.keystrokes.set('Esc',(C,T)=>{w.focusTracker.isFocused&&(u.focus(),T())})}},function(o,r,s){'use strict';var d=s(64),u=s(6),f=s(186),h=s(190);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */const w=s.i(h.a)('px');class C extends f.a{constructor(T){super(T);const P=this.bindTemplate;this.set('isActive',!1),this.set('isSticky',!1),this.set('limiterElement',null),this.set('limiterOffset',50),this.set('_marginLeft',null),this.set('_isStickyToTheLimiter',!1),u.a.extend(this.template,{attributes:{class:[P.if('isSticky','ck-toolbar_sticky'),P.if('_isStickyToTheLimiter','ck-toolbar_sticky_bottom-limit')],style:{width:P.to('isSticky',(S)=>{return S?w(this._elementPlaceholder.getBoundingClientRect().width):null}),bottom:P.to('_isStickyToTheLimiter',(S)=>{return S?w(this.limiterOffset):null}),marginLeft:P.to('_marginLeft')}}}),this._elementPlaceholder=new u.a({tag:'div',attributes:{class:['ck-toolbar__placeholder'],style:{display:P.to('isSticky',(S)=>S?'block':'none'),height:P.to('isSticky',(S)=>{return S?w(this._toolbarRect.height):null})}}}).render()}init(){super.init(),this.element.parentNode.insertBefore(this._elementPlaceholder,this.element),this.listenTo(d.a.window,'scroll',()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,'change:isActive',()=>{this._checkIfShouldBeSticky()})}destroy(){return super.destroy().then(()=>{this._elementPlaceholder.remove()})}_checkIfShouldBeSticky(){const T=this._limiterRect=this.limiterElement.getBoundingClientRect(),P=this._toolbarRect=this.element.getBoundingClientRect();this.isSticky=this.isActive&&0>T.top&&this._toolbarRect.height+this.limiterOffset{const w=h.batch.deltas[h.batch.deltas.length-1],C=w.baseVersion+w.operations.length,T=Array.from(this.editor.document.history.getDeltas(C)).filter((P)=>{return!this._createdBatches.has(P.batch)});this._restoreSelection(h.selection.ranges,h.selection.isBackward,T),this._redo(h.batch)}),this.refreshState()}_redo(h){const w=this.editor.document,C=w.batch();this._createdBatches.add(C);const T=h.deltas.slice();T.reverse();for(let P of T){const S=P.baseVersion+P.operations.length;let E=[P.getReversed()];for(let O of w.history.getDeltas(S))this._createdBatches.has(O.batch)||(E=s.i(u.a)(E,[O],!0).deltasA);for(let O of E){O.baseVersion=w.version,C.addDelta(O);for(let V of O.operations)w.applyOperation(V)}}}}r.a=f},function(o,r,s){'use strict';var d=s(121),u=s(107);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */class f extends d.a{_doExecute(h=null){let w=h?this._stack.findIndex((T)=>T.batch==h):this._stack.length-1;const C=this._stack.splice(w,1)[0];this.editor.document.enqueueChanges(()=>{const T=this._undo(C.batch),P=this.editor.document.history.getDeltas(C.batch.baseVersion);this._restoreSelection(C.selection.ranges,C.selection.isBackward,P),this.fire('revert',C.batch,T)}),this.refreshState()}_getItemIndexFromBaseVersion(h){for(let w=0;w{this._batchRegistry.has(P)||'transparent'==P.type||(this._redoCommand._createdBatches.has(P)?this._undoCommand.addBatch(P):!this._undoCommand._createdBatches.has(P)&&(this._undoCommand.addBatch(P),this._redoCommand.clearStack()),this._batchRegistry.add(P))},{priority:'highest'}),this.listenTo(this._undoCommand,'revert',(w,C,T)=>{this._redoCommand.addBatch(T)})}}r.a=h},function(o,r,s){'use strict';var d=s(98);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=class{constructor(f,h){this._config={},h&&this.define(h),f&&this._setObjectToTarget(this._config,f)}set(f,h){this._setToTarget(this._config,f,h)}define(f,h){this._setToTarget(this._config,f,h,!0)}get(f){return this._getFromSource(this._config,f)}_setToTarget(f,h,w,C=!1){if(s.i(d.a)(h))return void this._setObjectToTarget(f,h,C);const T=h.split('.');h=T.pop();for(let P of T)s.i(d.a)(f[P])||(f[P]={}),f=f[P];return s.i(d.a)(w)?(s.i(d.a)(f[h])||(f[h]={}),f=f[h],void this._setObjectToTarget(f,w,C)):void(C&&'undefined'!=typeof f[h]||(f[h]=w))}_getFromSource(f,h){const w=h.split('.');h=w.pop();for(let C of w){if(!s.i(d.a)(f[C])){f=null;break}f=f[C]}return f?f[h]:void 0}_setObjectToTarget(f,h,w){Object.keys(h).forEach((C)=>{this._setToTarget(f,C,h[C],w)})}}},function(o,r){'use strict';r.a=/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function(u,f){function h(){P&&(C.push(P),P=null)}function w(S){return P&&P.type==S}const C=[];let T=0,P;return u.forEach((S)=>{'equal'==S?(h(),T++):'insert'==S?(w('insert')?P.values.push(f[T]):(h(),P={type:'insert',index:T,values:[f[T]]}),T++):w('delete')?P.howMany++:(h(),P={type:'delete',index:T,howMany:1})}),h(),C}},function(o,r,s){'use strict';var u=s(189);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=function(f,h){const w=s.i(u.a)(f),C=s.i(u.a)(h);let T=0;for(;w[T]==C[T]&&w[T];)T++;return 0==T?null:w[T-1]}},function(o,r){'use strict';r.a=/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function(u){return u instanceof HTMLTextAreaElement?u.value:u.innerHTML}},function(o,r,s){'use strict';var u=s(64);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=function(f){for(;f&&'html'!=f.tagName.toLowerCase();){if('static'!=u.a.window.getComputedStyle(f).position)return f;f=f.parentElement}return null}},function(o,r){'use strict';r.a=/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function(u){let f=0;for(;u.previousSibling;)u=u.previousSibling,f++;return f}},function(o,r){'use strict';r.a=/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function(u,f,h){u.insertBefore(h,u.childNodes[f]||null)}},function(o,r){'use strict';r.a=/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function(u){return'[object Range]'==Object.prototype.toString.apply(u)}},function(o,r,s){'use strict';function u(P,S,E){const{left:O,top:V,name:R}=P(S,E);return[R,E.clone().moveTo(O,V)]}/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function f(P,S,E,O,V){let R=0,F=0,N,M;const I=E.getArea();return P.some((L)=>{function D(){F=K,R=$,N=z,M=q}const[q,z]=u(L,S,E);let $,K;if(O)if(V){const H=O.getIntersection(V);$=H?H.getIntersectionArea(z):0}else $=O.getIntersectionArea(z);return V&&(K=V.getIntersectionArea(z)),V&&!O?K>F&&D():!V&&O?$>R&&D():K>F&&$>=R?D():K>=F&&$>R&&D(),$===I}),N?[M,N]:null}function h({left:P,top:S}){const{scrollX:E,scrollY:O}=w.a.window;return{left:P+E,top:S+O}}var w=s(64),C=s(417),T=s(412);r.a=function({element:P,target:S,positions:E,limiter:O,fitInViewport:V}){const R=s.i(T.a)(P.parentElement),F=new C.a(P),N=new C.a(S);let M,I;if(!O&&!V)[I,M]=u(E[0],N,F);else{const q=O&&new C.a(O),z=V&&C.a.getViewportRect();[I,M]=f(E,N,F,q,z)||u(E[0],N,F)}let{left:L,top:D}=h(M);if(R){const q=h(new C.a(R)),z=w.a.window.getComputedStyle(R);L-=q.left,D-=q.top,L+=R.scrollLeft,D+=R.scrollTop,L-=parseInt(z.borderLeftWidth,10),D-=parseInt(z.borderTopWidth,10)}return{left:L,top:D,name:I}}},function(o,r,s){'use strict';var d=s(64),u=s(415),f=s(508);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */const h=['top','right','bottom','left','width','height'];class w{constructor(C){(s.i(f.a)(C)||s.i(u.a)(C))&&(C=C.getBoundingClientRect()),h.forEach((T)=>this[T]=C[T])}clone(){return new w(this)}moveTo(C,T){return this.top=T,this.right=C+this.width,this.bottom=T+this.height,this.left=C,this}moveBy(C,T){return this.top+=T,this.right+=C,this.left+=C,this.bottom+=T,this}getIntersection(C){const T={top:_Mathmax(this.top,C.top),right:_Mathmin(this.right,C.right),bottom:_Mathmin(this.bottom,C.bottom),left:_Mathmax(this.left,C.left)};return T.width=T.right-T.left,T.height=T.bottom-T.top,0>T.width||0>T.height?null:new w(T)}getIntersectionArea(C){const T=this.getIntersection(C);return T?T.getArea():0}getArea(){return this.width*this.height}static getViewportRect(){const{innerWidth:C,innerHeight:T}=d.a.window;return new w({top:0,right:C,bottom:T,left:0,width:C,height:T})}}r.a=w},function(o,r){'use strict';r.a=/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function(u){const f=u.parentNode;f&&f.removeChild(u)}},function(o,r){'use strict';r.a=/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */function(u,f){u instanceof HTMLTextAreaElement&&(u.value=f),u.innerHTML=f}},function(o,r){'use strict';/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=class{constructor(){this._replacedElements=[]}replace(u,f){this._replacedElements.push({element:u,newElement:f}),u.style.display='none',f&&u.parentNode.insertBefore(f,u.nextSibling)}restore(){this._replacedElements.forEach(({element:u,newElement:f})=>{u.style.display='',f&&f.remove()}),this._replacedElements=[]}}},function(o,r){'use strict';/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */const u=navigator.userAgent.toLowerCase(),f={mac:function(h){return-1=f?u:f)),u}},function(o,r,s){'use strict';var u=s(15),f=Object.create;r.a=function(h){return s.i(u.a)(h)?f(h):{}}},function(o,r,s){'use strict';var u=s(16),f=s(518);r.a=function(h,w,C,T){var P=h.length;for(C=s.i(u.a)(C),0>C&&(C=-C>P?0:P+C),T=void 0===T||T>P?P:s.i(u.a)(T),0>T&&(T+=P),T=C>T?0:s.i(f.a)(T);Ch?w:0,s.i(u.a)(h,w)?f[h]:void 0}},function(o,r,s){'use strict';var u=s(127);r.a=function(f){return function(h){return s.i(u.a)(h,f)}}},function(o,r,s){'use strict';var u=s(67),f=s(88),h=s(36),w=s(54),C=s(15),T=s(55);r.a=function(P,S,E,O){S=s.i(w.a)(S,P)?[S]:s.i(f.a)(S);for(var V=-1,R=S.length,N=P,M;null!=N&&++Vh||P&&S&&O&&!E&&!V||C&&S&&O||!w&&O||!T)return 1;if(!C&&!P&&!V&&fP?void 0:S,P=1),w=Object(w);++TT)return!1;var P=C.length-1;return T==P?C.pop():h.call(C,T,1),!0}},function(o,r,s){'use strict';var u=s(85);r.a=function(f){var h=this.__data__,w=s.i(u.a)(h,f);return 0>w?void 0:h[w][1]}},function(o,r,s){'use strict';var u=s(85);r.a=function(f){return-1C?w.push([f,h]):w[C][1]=h,this}},function(o,r,s){'use strict';var u=s(424),f=s(81),h=s(192);r.a=function(){this.__data__={hash:new u.a,map:new(h.a||f.a),string:new u.a}}},function(o,r,s){'use strict';var u=s(89);r.a=function(f){return s.i(u.a)(this,f)['delete'](f)}},function(o,r,s){'use strict';var u=s(89);r.a=function(f){return s.i(u.a)(this,f).get(f)}},function(o,r,s){'use strict';var u=s(89);r.a=function(f){return s.i(u.a)(this,f).has(f)}},function(o,r,s){'use strict';var u=s(89);r.a=function(f,h){return s.i(u.a)(this,f).set(f,h),this}},function(o,r,s){'use strict';var u=s(127),f=s(35);r.a=function(h,w){return 1==w.length?h:s.i(u.a)(h,s.i(f.a)(w,0,-1))}},function(o,r){'use strict';r.a=function(f){return this.__data__.set(f,'__lodash_hash_undefined__'),this}},function(o,r){'use strict';r.a=function(u){return this.__data__.has(u)}},function(o,r){'use strict';r.a=function(u){var f=-1,h=Array(u.size);return u.forEach(function(w){h[++f]=[w,w]}),h}},function(o,r,s){'use strict';var u=s(81);r.a=function(){this.__data__=new u.a}},function(o,r){'use strict';r.a=function(u){return this.__data__['delete'](u)}},function(o,r){'use strict';r.a=function(u){return this.__data__.get(u)}},function(o,r){'use strict';r.a=function(u){return this.__data__.has(u)}},function(o,r,s){'use strict';var u=s(81),f=s(122);r.a=function(w,C){var T=this.__data__;return T instanceof u.a&&T.__data__.length==200&&(T=this.__data__=new f.a(T.__data__)),T.set(w,C),this}},function(o,r,s){'use strict';var d=s(512),u=s(520),f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,h=/\\(\\)?/g,w=s.i(d.a)(function(C){var T=[];return s.i(u.a)(C).replace(f,function(P,S,E,O){T.push(E?O.replace(h,'$1'):S||P)}),T});r.a=w},function(o,r,s){'use strict';var d=s(212),u=s(213),f=s(214),h=s(215),w=s(216),C=s(217),T=s(144),P=s(145),S=s(218),E=s(219),O=s(220),V=s(221),R=s(222),F=s(223),N=s(224),M=s(225),I=s(226),L=s(227),D=s(146),q=s(230),z=s(231),$=s(232),K=s(233),H=s(234),U=s(236),W=s(19),Z=s(237),G=s(238),J=s(239),Y=s(150),X=s(240),Q=s(241),ee=s(242),te=s(243),ae=s(244),ne=s(245),oe=s(246),ie=s(247),re=s(248),se=s(249),le=s(250),de=s(251),ce=s(252),ue=s(253),me=s(254),pe=s(255),ge=s(256),fe=s(257),he=s(258),be=s(260),_e=s(261),ke=s(262),ye=s(263),we=s(264),ve=s(265),xe=s(99),Ce=s(151),Te=s(266),Ae=s(267),Pe=s(268),Se=s(269),Ee=s(270),Oe=s(271),Ve=s(272),Re=s(273);r.a={chunk:d.a,compact:u.a,concat:f.a,difference:h.a,differenceBy:w.a,differenceWith:C.a,drop:T.a,dropRight:P.a,dropRightWhile:S.a,dropWhile:E.a,fill:O.a,findIndex:V.a,findLastIndex:R.a,first:F.a,flatten:N.a,flattenDeep:M.a,flattenDepth:I.a,fromPairs:L.a,head:D.a,indexOf:q.a,initial:z.a,intersection:$.a,intersectionBy:K.a,intersectionWith:H.a,join:U.a,last:W.a,lastIndexOf:Z.a,nth:G.a,pull:J.a,pullAll:Y.a,pullAllBy:X.a,pullAllWith:Q.a,pullAt:ee.a,remove:te.a,reverse:ae.a,slice:ne.a,sortedIndex:oe.a,sortedIndexBy:ie.a,sortedIndexOf:re.a,sortedLastIndex:se.a,sortedLastIndexBy:le.a,sortedLastIndexOf:de.a,sortedUniq:ce.a,sortedUniqBy:ue.a,tail:me.a,take:pe.a,takeRight:ge.a,takeRightWhile:fe.a,takeWhile:he.a,union:be.a,unionBy:_e.a,unionWith:ke.a,uniq:ye.a,uniqBy:we.a,uniqWith:ve.a,unzip:xe.a,unzipWith:Ce.a,without:Te.a,xor:Ae.a,xorBy:Pe.a,xorWith:Se.a,zip:Ee.a,zipObject:Oe.a,zipObjectDeep:Ve.a,zipWith:Re.a}},function(o,r,s){'use strict';var d=s(212),u=s(213),f=s(214),h=s(215),w=s(216),C=s(217),T=s(144),P=s(145),S=s(218),E=s(219),O=s(220),V=s(221),R=s(222),F=s(223),N=s(224),M=s(225),I=s(226),L=s(227),D=s(146),q=s(230),z=s(231),$=s(232),K=s(233),H=s(234),U=s(236),W=s(19),Z=s(237),G=s(238),J=s(239),Y=s(150),X=s(240),Q=s(241),ee=s(242),te=s(243),ae=s(244),ne=s(245),oe=s(246),ie=s(247),re=s(248),se=s(249),le=s(250),de=s(251),ce=s(252),ue=s(253),me=s(254),pe=s(255),ge=s(256),fe=s(257),he=s(258),be=s(260),_e=s(261),ke=s(262),ye=s(263),we=s(264),ve=s(265),xe=s(99),Ce=s(151),Te=s(266),Ae=s(267),Pe=s(268),Se=s(269),Ee=s(270),Oe=s(271),Ve=s(272),Re=s(273),Fe=s(501);s.d(r,'a',function(){return Fe.a})},function(o,r,s){'use strict';var d=s(67),u=s(139),f=s(461),h=s(96),w=s(92),C=s(511),T=Object.prototype,P=T.propertyIsEnumerable,S=!P.call({valueOf:1},'valueOf'),E=s.i(f.a)(function(O,V){if(S||s.i(w.a)(V)||s.i(h.a)(V))return void s.i(u.a)(V,s.i(C.a)(V),O);for(var R in V)s.i(d.a)(O,R,V[R])});r.a=E},function(o,r,s){'use strict';var u=s(197);r.a=function(f,h){return s.i(u.a)(f,!0,!0,h)}},function(o,r){'use strict';r.a=function(u){return function(){return u}}},function(o,r,s){'use strict';var u=s(438),f=s(469);r.a=function(h,w){return null!=h&&s.i(f.a)(h,w,u.a)}},function(o,r,s){'use strict';(function(d){var u=s(505),f=s(31),h={'function':!0,object:!0},w=h[typeof exports]&&exports&&!exports.nodeType?exports:void 0,C=h[typeof d]&&d&&!d.nodeType?d:void 0,T=C&&C.exports===w?w:void 0,P=T?f.a.Buffer:void 0,S=P?function(E){return E instanceof P}:s.i(u.a)(!1);r.a=S}).call(r,s(154)(o))},function(o,r,s){'use strict';var u=s(43),f=s(98);r.a=function(h){return!!h&&1===h.nodeType&&s.i(u.a)(h)&&!s.i(f.a)(h)}},function(o,r,s){'use strict';var u=s(130);r.a=function(f,h){return s.i(u.a)(f,h)}},function(o,r,s){'use strict';var u=s(97),f=s(43),G={};G['[object Float32Array]']=G['[object Float64Array]']=G['[object Int8Array]']=G['[object Int16Array]']=G['[object Int32Array]']=G['[object Uint8Array]']=G['[object Uint8ClampedArray]']=G['[object Uint16Array]']=G['[object Uint32Array]']=!0,G['[object Arguments]']=G['[object Array]']=G['[object ArrayBuffer]']=G['[object Boolean]']=G['[object DataView]']=G['[object Date]']=G['[object Error]']=G['[object Function]']=G['[object Map]']=G['[object Number]']=G['[object Object]']=G['[object RegExp]']=G['[object Set]']=G['[object String]']=G['[object WeakMap]']=!1;var J=Object.prototype,Y=J.toString;r.a=function(X){return s.i(f.a)(X)&&s.i(u.a)(X.length)&&!!G[Y.call(X)]}},function(o,r,s){'use strict';var u=s(443),f=s(207),h=s(36),w=s(92),C=Object.prototype,T=C.hasOwnProperty;r.a=function(P){for(var S=-1,E=s.i(w.a)(P),O=s.i(u.a)(P),V=O.length,R=s.i(f.a)(P),N=R||[],M=N.length,I;++Sw?-1:1;return C*1.7976931348623157e308}return w===w?w:0}},function(o,r,s){'use strict';var u=s(434),f=s(16);r.a=function(w){return w?s.i(u.a)(s.i(f.a)(w),0,4294967295):0}},function(o,r,s){'use strict';var d=s(463),u=s(69),f=s.i(d.a)(u.a);r.a=f},function(o,r,s){'use strict';var u=s(450);r.a=function(f){return null==f?'':s.i(u.a)(f)}},function(o,r,s){'use strict';var d=s(525);/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */r.a=class{constructor(f){this.lang=f||'en',this.t=(...h)=>this._t(...h)}_t(f,h){let w=s.i(d.a)(this.lang,f);return h&&(w=w.replace(/\%(\d+)/g,(C,T)=>{return T