text: "use strict";function _typeof2(t){return(_typeof2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _createClass(t,e,i){return e&&_defineProperties(t.prototype,e),i&&_defineProperties(t,i),t}require("./jquery.js"),require("./proper.js"),require("./Boostrap.js"),function(t,e){"object"===("undefined"==typeof exports?"undefined":_typeof2(exports))&&"object"===("undefined"==typeof module?"undefined":_typeof2(module))?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"===("undefined"==typeof exports?"undefined":_typeof2(exports))?exports.Quill=e():t.Quill=e()}("undefined"!=typeof self?self:void 0,function(){return o={},n.m=i=[function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(17),o=i(18),a=i(19),r=i(45),s=i(46),l=i(47),c=i(48),h=i(49),u=i(12),d=i(32),f=i(33),p=i(31),g=i(1),v={Scope:g.Scope,create:g.create,find:g.find,query:g.query,register:g.register,Container:n.default,Format:o.default,Leaf:a.default,Embed:c.default,Scroll:r.default,Block:l.default,Inline:s.default,Text:h.default,Attributor:{Attribute:u.default,Class:d.default,Style:f.default,Store:p.default}};e.default=v},function(t,n,e){var o,i=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(n,"__esModule",{value:!0});var a,r=(a=Error,i(s,a),s);function s(t){var e=this;return t="[Parchment] "+t,(e=a.call(this,t)||this).message=t,e.name=e.constructor.name,e}n.ParchmentError=r;var l,c,h={},u={},d={},f={};function p(t,e){var i;if(void 0===e&&(e=l.ANY),"string"==typeof t)i=f[t]||h[t];else if(t instanceof Text||t.nodeType===Node.TEXT_NODE)i=f.text;else if("number"==typeof t)t&l.LEVEL&l.BLOCK?i=f.block:t&l.LEVEL&l.INLINE&&(i=f.inline);else if(t instanceof HTMLElement){var n=(t.getAttribute("class")||"").split(/\s+/);for(var o in n)if(i=u[n[o]])break;i=i||d[t.tagName]}return null!=i&&e&l.LEVEL&i.scope&&e&l.TYPE&i.scope?i:null}n.DATA_KEY="__blot",(c=l=n.Scope||(n.Scope={}))[c.TYPE=3]="TYPE",c[c.LEVEL=12]="LEVEL",c[c.ATTRIBUTE=13]="ATTRIBUTE",c[c.BLOT=14]="BLOT",c[c.INLINE=7]="INLINE",c[c.BLOCK=11]="BLOCK",c[c.BLOCK_BLOT=10]="BLOCK_BLOT",c[c.INLINE_BLOT=6]="INLINE_BLOT",c[c.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",c[c.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",c[c.ANY=15]="ANY",n.create=function(t,e){var i=p(t);if(null==i)throw new r("Unable to create "+t+" blot");var n=i,o=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:n.create(e);return new n(o,e)},n.find=function t(e,i){return void 0===i&&(i=!1),null==e?null:null!=e[n.DATA_KEY]?e[n.DATA_KEY].blot:i?t(e.parentNode,i):null},n.query=p,n.register=function e(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];if(1<t.length)return t.map(function(t){return e(t)});var n=t[0];if("string"!=typeof n.blotName&&"string"!=typeof n.attrName)throw new r("Invalid definition");if("abstract"===n.blotName)throw new r("Cannot register abstract class");return"string"==typeof(f[n.blotName||n.attrName]=n).keyName?h[n.keyName]=n:(null!=n.className&&(u[n.className]=n),null!=n.tagName&&(Array.isArray(n.tagName)?n.tagName=n.tagName.map(function(t){return t.toUpperCase()}):n.tagName=n.tagName.toUpperCase(),(Array.isArray(n.tagName)?n.tagName:[n.tagName]).forEach(function(t){null!=d[t]&&null!=n.className||(d[t]=n)}))),n}},function(t,e,i){function f(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]}var l=i(51),p=i(11),n=i(3),g=i(20),o=String.fromCharCode(0);f.prototype.insert=function(t,e){var i={};return 0===t.length?this:(i.insert=t,null!=e&&"object"===_typeof2(e)&&0<Object.keys(e).length&&(i.attributes=e),this.push(i))},f.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},f.prototype.retain=function(t,e){if(t<=0)return this;var i={retain:t};return null!=e&&"object"===_typeof2(e)&&0<Object.keys(e).length&&(i.attributes=e),this.push(i)},f.prototype.push=function(t){var e=this.ops.length,i=this.ops[e-1];if(t=n(!0,{},t),"object"===_typeof2(i)){if("number"==typeof t.delete&&"number"==typeof i.delete)return this.ops[e-1]={delete:i.delete+t.delete},this;if("number"==typeof i.delete&&null!=t.insert&&(--e,"object"!==_typeof2(i=this.ops[e-1])))return this.ops.unshift(t),this;if(p(t.attributes,i.attributes)){if("string"==typeof t.insert&&"string"==typeof i.insert)return this.ops[e-1]={insert:i.insert+t.insert},"object"===_typeof2(t.attributes)&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof i.retain)return this.ops[e-1]={retain:i.retain+t.retain},"object"===_typeof2(t.attributes)&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},f.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},f.prototype.filter=function(t){return this.ops.filter(t)},f.prototype.forEach=function(t){this.ops.forEach(t)},f.prototype.map=function(t){return this.ops.map(t)},f.prototype.partition=function(e){var i=[],n=[];return this.forEach(function(t){(e(t)?i:n).push(t)}),[i,n]},f.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},f.prototype.changeLength=function(){return this.reduce(function(t,e){return e.insert?t+g.length(e):e.delete?t-e.delete:t},0)},f.prototype.length=function(){return this.reduce(function(t,e){return t+g.length(e)},0)},f.prototype.slice=function(t,e){t=t||0,"number"!=typeof e&&(e=1/0);for(var i,n=[],o=g.iterator(this.ops),a=0;a<e&&o.hasNext();){a<t?i=o.next(t-a):(i=o.next(e-a),n.push(i)),a+=g.length(i)}return new f(n)},f.prototype.compose=function(t){var e=g.iterator(this.ops),i=g.iterator(t.ops),n=[],o=i.peek();if(null!=o&&"number"==typeof o.retain&&null==o.attributes){for(var a=o.retain;"insert"===e.peekType()&&e.peekLength()<=a;)a-=e.peekLength(),n.push(e.next());0<o.retain-a&&i.next(o.retain-a)}for(var r=new f(n);e.hasNext()||i.hasNext();)if("insert"===i.peekType())r.push(i.next());else if("delete"===e.peekType())r.push(e.next());else{var s=Math.min(e.peekLength(),i.peekLength()),l=e.next(s),c=i.next(s);if("number"==typeof c.retain){var h={};"number"==typeof l.retain?h.retain=s:h.insert=l.insert;var u=g.attributes.compose(l.attributes,c.attributes,"number"==typeof l.retain);if(u&&(h.attributes=u),r.push(h),!i.hasNext()&&p(r.ops[r.ops.length-1],h)){var d=new f(e.rest());return r.concat(d).chop()}}else"number"==typeof c.delete&&"number"==typeof l.retain&&r.push(c)}return r.chop()},f.prototype.concat=function(t){var e=new f(this.ops.slice());return 0<t.ops.length&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e},f.prototype.diff=function(i,t){if(this.ops===i.ops)return new f;var e=[this,i].map(function(e){return e.map(function(t){if(null!=t.insert)return"string"==typeof t.insert?t.insert:o;throw new Error("diff() called "+(e===i?"on":"with")+" non-document")}).join("")}),a=new f,n=l(e[0],e[1],t),r=g.iterator(this.ops),s=g.iterator(i.ops);return n.forEach(function(t){for(var e=t[1].length;0<e;){var i=0;switch(t[0]){case l.INSERT:i=Math.min(s.peekLength(),e),a.push(s.next(i));break;case l.DELETE:i=Math.min(e,r.peekLength()),r.next(i),a.delete(i);break;case l.EQUAL:i=Math.min(r.peekLength(),s.peekLength(),e);var n=r.next(i),o=s.next(i);p(n.insert,o.insert)?a.retain(i,g.attributes.diff(n.attributes,o.attributes)):a.push(o).delete(i)}e-=i}}),a.chop()},f.prototype.eachLine=function(t,e){e=e||"\n";for(var i=g.iterator(this.ops),n=new f,o=0;i.hasNext();){if("insert"!==i.peekType())return;var a=i.peek(),r=g.length(a)-i.peekLength(),s="string"==typeof a.insert?a.insert.indexOf(e,r)-r:-1;if(s<0)n.push(i.next());else if(0<s)n.push(i.next(s));else{if(!1===t(n,i.next(1).attributes||{},o))return;o+=1,n=new f}}0<n.length()&&t(n,{},o)},f.prototype.transform=function(t,e){if(e=!!e,"number"==typeof t)return this.transformPosition(t,e);for(var i=g.iterator(this.ops),n=g.iterator(t.ops),o=new f;i.hasNext()||n.hasNext();)if("insert"!==i.peekType()||!e&&"insert"===n.peekType())if("insert"===n.peekType())o.push(n.next());else{var a=Math.min(i.peekLength(),n.peekLength()),r=i.next(a),s=n.next(a);if(r.delete)continue;s.delete?o.push(s):o.retain(a,g.attributes.transform(r.attributes,s.attributes,e))}else o.retain(g.length(i.next()));return o.chop()},f.prototype.transformPosition=function(t,e){e=!!e;for(var i=g.iterator(this.ops),n=0;i.hasNext()&&n<=t;){var o=i.peekLength(),a=i.peekType();i.next(),"delete"!==a?("insert"===a&&(n<t||!e)&&(t+=o),n+=o):t-=Math.min(o,t-n)}return t},t.exports=f},function(t,e){function f(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===a.call(t)}function p(t){if(t&&"[object Object]"===a.call(t)){var e,i=o.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&o.call(t.constructor.prototype,"isPrototypeOf");if(!t.constructor||i||n){for(e in t);return void 0===e||o.call(t,e)}}}function g(t,e){i&&"__proto__"===e.name?i(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue}function v(t,e){if("__proto__"===e){if(!o.call(t,e))return;if(n)return n(t,e).value}return t[e]}var o=Object.prototype.hasOwnProperty,a=Object.prototype.toString,i=Object.defineProperty,n=Object.getOwnPropertyDescriptor;t.exports=function t(e,i){var n,o,a,r,s,l,c=e,h=1,u=arguments.length,d=!1;for("boolean"==typeof c&&(d=c,c=i||{},h=2),(null==c||"object"!==_typeof2(c)&&"function"!=typeof c)&&(c={});h<u;++h)if(null!=(n=arguments[h]))for(o in n)a=v(c,o),c!==(r=v(n,o))&&(d&&r&&(p(r)||(s=f(r)))?(l=s?(s=!1,a&&f(a)?a:[]):a&&p(a)?a:{},g(c,{name:o,newValue:t(d,l,r)})):void 0!==r&&g(c,{name:o,newValue:r}));return c}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BlockEmbed=e.bubbleFormats=void 0;var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:r(o,e,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}var a=d(i(3)),s=d(i(2)),l=d(i(0)),c=d(i(16)),h=d(i(6)),u=d(i(7));function d(t){return t&&t.__esModule?t:{default:t}}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}function g(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var v=(g(m,l.default.Embed),n(m,[{key:"attach",value:function(){r(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"attach",this).call(this),this.attributes=new l.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return(new s.default).insert(this.value(),(0,a.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(t,e){var i=l.default.query(t,l.default.Scope.BLOCK_ATTRIBUTE);null!=i&&this.attributes.attribute(i,e)}},{key:"formatAt",value:function(t,e,i,n){this.format(i,n)}},{key:"insertAt",value:function(t,e,i){var n;"string"==typeof e&&e.endsWith("\n")?(n=l.default.create(b.blotName),this.parent.insertBefore(n,0===t?this:this.next),n.insertAt(0,e.slice(0,-1))):r(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"insertAt",this).call(this,t,e,i)}}]),m);function m(){return f(this,m),p(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}v.scope=l.default.Scope.BLOCK_BLOT;var b=(g(y,l.default.Block),n(y,[{key:"delta",value:function(){return null==this.cache.delta&&(this.cache.delta=this.descendants(l.default.Leaf).reduce(function(t,e){return 0===e.length()?t:t.insert(e.value(),x(e))},new s.default).insert("\n",x(this))),this.cache.delta}},{key:"deleteAt",value:function(t,e){r(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"deleteAt",this).call(this,t,e),this.cache={}}},{key:"formatAt",value:function(t,e,i,n){e<=0||(l.default.query(i,l.default.Scope.BLOCK)?t+e===this.length()&&this.format(i,n):r(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"formatAt",this).call(this,t,Math.min(e,this.length()-t-1),i,n),this.cache={})}},{key:"insertAt",value:function(t,e,i){if(null!=i)return r(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"insertAt",this).call(this,t,e,i);var n,o,a;0!==e.length&&(0<(o=(n=e.split("\n")).shift()).length&&(t<this.length()-1||null==this.children.tail?r(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"insertAt",this).call(this,Math.min(t,this.length()-1),o):this.children.tail.insertAt(this.children.tail.length(),o),this.cache={}),a=this,n.reduce(function(t,e){return(a=a.split(t,!0)).insertAt(0,e),e.length},t+o.length))}},{key:"insertBefore",value:function(t,e){var i=this.children.head;r(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"insertBefore",this).call(this,t,e),i instanceof c.default&&i.remove(),this.cache={}}},{key:"length",value:function(){return null==this.cache.length&&(this.cache.length=r(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"length",this).call(this)+1),this.cache.length}},{key:"moveChildren",value:function(t,e){r(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"moveChildren",this).call(this,t,e),this.cache={}}},{key:"optimize",value:function(t){r(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"optimize",this).call(this,t),this.cache={}}},{key:"path",value:function(t){return r(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"path",this).call(this,t,!0)}},{key:"removeChild",value:function(t){r(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"removeChild",this).call(this,t),this.cache={}}},{key:"split",value:function(t,e){var i=1<arguments.length&&void 0!==e&&e;if(i&&(0===t||t>=this.length()-1)){var n=this.clone();return 0===t?(this.parent.insertBefore(n,this),this):(this.parent.insertBefore(n,this.next),n)}var o=r(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"split",this).call(this,t,i);return this.cache={},o}}]),y);function y(t){f(this,y);var e=p(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,t));return e.cache={},e}function x(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return null==t?e:("function"==typeof t.formats&&(e=(0,a.default)(e,t.formats())),null==t.parent||"scroll"==t.parent.blotName||t.parent.statics.scope!==t.statics.scope?e:x(t.parent,e))}b.blotName="block",b.tagName="P",b.defaultChild="break",b.allowedChildren=[h.default,l.default.Embed,u.default],e.bubbleFormats=x,e.BlockEmbed=v,e.default=b},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.overload=e.expandConfig=void 0;var r="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(t){return _typeof2(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":_typeof2(t)},h=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var i=[],n=!0,o=!1,a=void 0;try{for(var r,s=t[Symbol.iterator]();!(n=(r=s.next()).done)&&(i.push(r.value),!e||i.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return i}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}i(50);var u=m(i(2)),a=m(i(14)),d=m(i(8)),s=m(i(9)),l=m(i(0)),f=i(15),c=m(f),p=m(i(3)),g=m(i(10)),v=m(i(34));function m(t){return t&&t.__esModule?t:{default:t}}function b(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var y=(0,g.default)("quill"),x=(n(w,null,[{key:"debug",value:function(t){!0===t&&(t="log"),g.default.level(t)}},{key:"find",value:function(t){return t.__quill||l.default.find(t)}},{key:"import",value:function(t){return null==this.imports[t]&&y.error("Cannot import "+t+". Are you sure it was registered?"),this.imports[t]}},{key:"register",value:function(e,i,t){var n,o=this,a=2<arguments.length&&void 0!==t&&t;"string"!=typeof e?"string"==typeof(n=e.attrName||e.blotName)?this.register("formats/"+n,e,i):Object.keys(e).forEach(function(t){o.register(t,e[t],i)}):(null==this.imports[e]||a||y.warn("Overwriting "+e+" with",i),this.imports[e]=i,(e.startsWith("blots/")||e.startsWith("formats/"))&&"abstract"!==i.blotName?l.default.register(i):e.startsWith("modules")&&"function"==typeof i.register&&i.register())}}]),n(w,[{key:"addContainer",value:function(t,e){var i,n=1<arguments.length&&void 0!==e?e:null;return"string"==typeof t&&(i=t,(t=document.createElement("div")).classList.add(i)),this.container.insertBefore(t,n),t}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(t,e,i){var n=this,o=A(t,e,i),a=h(o,4);return t=a[0],e=a[1],i=a[3],C.call(this,function(){return n.editor.deleteText(t,e)},i,t,-1*e)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(t){var e=!(0<arguments.length&&void 0!==t)||t;this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}},{key:"focus",value:function(){var t=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=t,this.scrollIntoView()}},{key:"format",value:function(i,n,t){var o=this,e=2<arguments.length&&void 0!==t?t:d.default.sources.API;return C.call(this,function(){var t=o.getSelection(!0),e=new u.default;if(null==t)return e;if(l.default.query(i,l.default.Scope.BLOCK))e=o.editor.formatLine(t.index,t.length,b({},i,n));else{if(0===t.length)return o.selection.format(i,n),e;e=o.editor.formatText(t.index,t.length,b({},i,n))}return o.setSelection(t,d.default.sources.SILENT),e},e)}},{key:"formatLine",value:function(t,e,i,n,o){var a,r=this,s=A(t,e,i,n,o),l=h(s,4);return t=l[0],e=l[1],a=l[2],o=l[3],C.call(this,function(){return r.editor.formatLine(t,e,a)},o,t,0)}},{key:"formatText",value:function(t,e,i,n,o){var a,r=this,s=A(t,e,i,n,o),l=h(s,4);return t=l[0],e=l[1],a=l[2],o=l[3],C.call(this,function(){return r.editor.formatText(t,e,a)},o,t,0)}},{key:"getBounds",value:function(t,e){var i=1<arguments.length&&void 0!==e?e:0,n=void 0,n="number"==typeof t?this.selection.getBounds(t,i):this.selection.getBounds(t.index,t.length),o=this.container.getBoundingClientRect();return{bottom:n.bottom-o.top,height:n.height,left:n.left-o.left,right:n.right-o.left,top:n.top-o.top,width:n.width}}},{key:"getContents",value:function(t,e){var i=A(o=0<arguments.length&&void 0!==t?t:0,a=1<arguments.length&&void 0!==e?e:this.getLength()-o),n=h(i,2),o=n[0],a=n[1];return this.editor.getContents(o,a)}},{key:"getFormat",value:function(t,e){var i=0<arguments.length&&void 0!==t?t:this.getSelection(!0),n=1<arguments.length&&void 0!==e?e:0;return"number"==typeof i?this.editor.getFormat(i,n):this.editor.getFormat(i.index,i.length)}},{key:"getIndex",value:function(t){return t.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(t){return this.scroll.leaf(t)}},{key:"getLine",value:function(t){return this.scroll.line(t)}},{key:"getLines",value:function(t,e){var i=0<arguments.length&&void 0!==t?t:0,n=1<arguments.length&&void 0!==e?e:Number.MAX_VALUE;return"number"!=typeof i?this.scroll.lines(i.index,i.length):this.scroll.lines(i,n)}},{key:"getModule",value:function(t){return this.theme.modules[t]}},{key:"getSelection",value:function(t){return 0<arguments.length&&void 0!==t&&t&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(t,e){var i=A(o=0<arguments.length&&void 0!==t?t:0,a=1<arguments.length&&void 0!==e?e:this.getLength()-o),n=h(i,2),o=n[0],a=n[1];return this.editor.getText(o,a)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(t,e,i,n){var o=this,a=3<arguments.length&&void 0!==n?n:w.sources.API;return C.call(this,function(){return o.editor.insertEmbed(t,e,i)},a,t)}},{key:"insertText",value:function(t,e,i,n,o){var a,r=this,s=A(t,0,i,n,o),l=h(s,4);return t=l[0],a=l[2],o=l[3],C.call(this,function(){return r.editor.insertText(t,e,a)},o,t,e.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(t,e,i){this.clipboard.dangerouslyPasteHTML(t,e,i)}},{key:"removeFormat",value:function(t,e,i){var n=this,o=A(t,e,i),a=h(o,4);return t=a[0],e=a[1],i=a[3],C.call(this,function(){return n.editor.removeFormat(t,e)},i,t)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(o,t){var a=this,e=1<arguments.length&&void 0!==t?t:d.default.sources.API;return C.call(this,function(){o=new u.default(o);var t=a.getLength(),e=a.editor.deleteText(0,t),i=a.editor.applyDelta(o),n=i.ops[i.ops.length-1];return null!=n&&"string"==typeof n.insert&&"\n"===n.insert[n.insert.length-1]&&(a.editor.deleteText(a.getLength()-1,1),i.delete(1)),e.compose(i)},e)}},{key:"setSelection",value:function(t,e,i){var n,o;null==t?this.selection.setRange(null,e||w.sources.API):(n=A(t,e,i),t=(o=h(n,4))[0],e=o[1],i=o[3],this.selection.setRange(new f.Range(t,e),i),i!==d.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer))}},{key:"setText",value:function(t,e){var i=1<arguments.length&&void 0!==e?e:d.default.sources.API,n=(new u.default).insert(t);return this.setContents(n,i)}},{key:"update",value:function(t){var e=0<arguments.length&&void 0!==t?t:d.default.sources.USER,i=this.scroll.update(e);return this.selection.update(e),i}},{key:"updateContents",value:function(t,e){var i=this,n=1<arguments.length&&void 0!==e?e:d.default.sources.API;return C.call(this,function(){return t=new u.default(t),i.editor.applyDelta(t,n)},n,!0)}}]),w);function w(t){var o=this,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,w),this.options=k(t,e),this.container=this.options.container,null==this.container)return y.error("Invalid Quill container",t);this.options.debug&&w.debug(this.options.debug);var i=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",(this.container.__quill=this).root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new d.default,this.scroll=l.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new a.default(this.scroll),this.selection=new c.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(d.default.events.EDITOR_CHANGE,function(t){t===d.default.events.TEXT_CHANGE&&o.root.classList.toggle("ql-blank",o.editor.isBlank())}),this.emitter.on(d.default.events.SCROLL_UPDATE,function(t,e){var i=o.selection.lastRange,n=i&&0===i.length?i.index:void 0;C.call(o,function(){return o.editor.update(null,e,n)},t)});var n=this.clipboard.convert("<div class='ql-editor' style=\"white-space: normal;\">"+i+"<p><br></p></div>");this.setContents(n),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}function k(t,i){if((i=(0,p.default)(!0,{container:t,modules:{clipboard:!0,keyboard:!0,history:!0}},i)).theme&&i.theme!==x.DEFAULTS.theme){if(i.theme=x.import("themes/"+i.theme),null==i.theme)throw new Error("Invalid theme "+i.theme+". Did you register it?")}else i.theme=v.default;var e=(0,p.default)(!0,{},i.theme.DEFAULTS);[e,i].forEach(function(e){e.modules=e.modules||{},Object.keys(e.modules).forEach(function(t){!0===e.modules[t]&&(e.modules[t]={})})});var n=Object.keys(e.modules).concat(Object.keys(i.modules)).reduce(function(t,e){var i=x.import("modules/"+e);return null==i?y.error("Cannot load "+e+" module. Are you sure you registered it?"):t[e]=i.DEFAULTS||{},t},{});return null!=i.modules&&i.modules.toolbar&&i.modules.toolbar.constructor!==Object&&(i.modules.toolbar={container:i.modules.toolbar}),i=(0,p.default)(!0,{},x.DEFAULTS,{modules:n},e,i),["bounds","container","scrollingContainer"].forEach(function(t){"string"==typeof i[t]&&(i[t]=document.querySelector(i[t]))}),i.modules=Object.keys(i.modules).reduce(function(t,e){return i.modules[e]&&(t[e]=i.modules[e]),t},{}),i}function C(t,e,i,n){if(this.options.strict&&!this.isEnabled()&&e===d.default.sources.USER)return new u.default;var o,a,r,s=null==i?null:this.getSelection(),l=this.editor.delta,c=t();return null!=s&&(!0===i&&(i=s.index),null==n?s=S(s,c,e):0!==n&&(s=S(s,i,n,e)),this.setSelection(s,d.default.sources.SILENT)),0<c.length()&&(a=[d.default.events.TEXT_CHANGE,c,l,e],(o=this.emitter).emit.apply(o,[d.default.events.EDITOR_CHANGE].concat(a)),e!==d.default.sources.SILENT&&(r=this.emitter).emit.apply(r,a)),c}function A(t,e,i,n,o){var a={};return"number"==typeof t.index&&"number"==typeof t.length?t=(e=("number"!=typeof e&&(o=n,n=i,i=e),t.length),t.index):"number"!=typeof e&&(o=n,n=i,i=e,e=0),"object"===(void 0===i?"undefined":r(i))?(a=i,o=n):"string"==typeof i&&(null!=n?a[i]=n:o=i),[t,e,a,o=o||d.default.sources.API]}function S(t,e,i,n){if(null==t)return null;var o,a,r,s,l=void 0,c=void 0;return c=e instanceof u.default?(o=[t.index,t.index+t.length].map(function(t){return e.transformPosition(t,n!==d.default.sources.USER)}),l=(a=h(o,2))[0],a[1]):(r=[t.index,t.index+t.length].map(function(t){return t<e||t===e&&n===d.default.sources.USER?t:0<=i?t+i:Math.max(e,t+i)}),l=(s=h(r,2))[0],s[1]),new f.Range(l,c-l)}x.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},x.events=d.default.events,x.sources=d.default.sources,x.version="1.3.7",x.imports={delta:u.default,parchment:l.default,"core/module":s.default,"core/theme":v.default},e.expandConfig=k,e.overload=A,e.default=x},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:r(o,e,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}var a=l(i(7)),s=l(i(0));function l(t){return t&&t.__esModule?t:{default:t}}var c=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(h,s.default.Inline),n(h,[{key:"formatAt",value:function(t,e,i,n){var o;h.compare(this.statics.blotName,i)<0&&s.default.query(i,s.default.Scope.BLOT)?(o=this.isolate(t,e),n&&o.wrap(i,n)):r(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"formatAt",this).call(this,t,e,i,n)}},{key:"optimize",value:function(t){var e;r(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"optimize",this).call(this,t),this.parent instanceof h&&0<h.compare(this.statics.blotName,this.parent.statics.blotName)&&(e=this.parent.isolate(this.offset(),this.length()),this.moveChildren(e),e.wrap(this))}}],[{key:"compare",value:function(t,e){var i=h.order.indexOf(t),n=h.order.indexOf(e);return 0<=i||0<=n?i-n:t===e?0:t<e?-1:1}}]),h);function h(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}c.allowedChildren=[c,s.default.Embed,a.default],c.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],e.default=c},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n,o=i(0);var a=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,((n=o)&&n.__esModule?n:{default:n}).default.Text),r);function r(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}e.default=a},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a=r(i(54));function r(t){return t&&t.__esModule?t:{default:t}}var s=(0,r(i(10)).default)("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(function(t){document.addEventListener(t,function(){for(var t=arguments.length,i=Array(t),e=0;e<t;e++)i[e]=arguments[e];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(t){var e;t.__quill&&t.__quill.emitter&&(e=t.__quill.emitter).handleDOM.apply(e,i)})})});var l=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(c,a.default),n(c,[{key:"emit",value:function(){s.log.apply(s,arguments),function t(e,i,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,i);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,i,n)}if("value"in o)return o.value;var r=o.get;return void 0!==r?r.call(n):void 0}(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(n){for(var t=arguments.length,o=Array(1<t?t-1:0),e=1;e<t;e++)o[e-1]=arguments[e];(this.listeners[n.type]||[]).forEach(function(t){var e=t.node,i=t.handler;n.target!==e&&!e.contains(n.target)||i.apply(void 0,[n].concat(o))})}},{key:"listenDOM",value:function(t,e,i){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push({node:e,handler:i})}}]),c);function c(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this));return t.listeners={},t.on("error",s.error),t}l.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},l.sources={API:"api",SILENT:"silent",USER:"user"},e.default=l},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});function n(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this.quill=t,this.options=e}n.DEFAULTS={},e.default=n},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var a=["error","warn","log","info"],r="warn";function n(t){if(a.indexOf(t)<=a.indexOf(r)){for(var e,i=arguments.length,n=Array(1<i?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(e=console)[t].apply(e,n)}}function o(i){return a.reduce(function(t,e){return t[e]=n.bind(console,e,i),t},{})}n.level=o.level=function(t){r=t},e.default=o},function(t,e,i){var s=Array.prototype.slice,l=i(52),c=i(53),h=t.exports=function(t,e,i){return i=i||{},t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=_typeof2(t)&&"object"!=_typeof2(e)?i.strict?t===e:t==e:function(t,e,i){var n,o;if(u(t)||u(e))return!1;if(t.prototype!==e.prototype)return!1;if(c(t))return!!c(e)&&(t=s.call(t),e=s.call(e),h(t,e,i));if(d(t)){if(!d(e))return!1;if(t.length!==e.length)return!1;for(n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}try{var a=l(t),r=l(e)}catch(t){return!1}if(a.length!=r.length)return!1;for(a.sort(),r.sort(),n=a.length-1;0<=n;n--)if(a[n]!=r[n])return!1;for(n=a.length-1;0<=n;n--)if(o=a[n],!h(t[o],e[o],i))return!1;return _typeof2(t)===_typeof2(e)}(t,e,i))};function u(t){return null==t}function d(t){return!(!t||"object"!==_typeof2(t)||"number"!=typeof t.length||"function"!=typeof t.copy||"function"!=typeof t.slice||0<t.length&&"number"!=typeof t[0])}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var o=i(1),n=(a.keys=function(t){return[].map.call(t.attributes,function(t){return t.name})},a.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)},a.prototype.canAdd=function(t,e){return null!=o.query(t,o.Scope.BLOT&(this.scope|o.Scope.TYPE))&&(null==this.whitelist||("string"==typeof e?-1<this.whitelist.indexOf(e.replace(/["']/g,"")):-1<this.whitelist.indexOf(e)))},a.prototype.remove=function(t){t.removeAttribute(this.keyName)},a.prototype.value=function(t){var e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""},a);function a(t,e,i){void 0===i&&(i={}),this.attrName=t,this.keyName=e;var n=o.Scope.TYPE&o.Scope.ATTRIBUTE;null!=i.scope?this.scope=i.scope&o.Scope.LEVEL|n:this.scope=o.Scope.ATTRIBUTE,null!=i.whitelist&&(this.whitelist=i.whitelist)}e.default=n},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Code=void 0;var s=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var i=[],n=!0,o=!1,a=void 0;try{for(var r,s=t[Symbol.iterator]();!(n=(r=s.next()).done)&&(i.push(r.value),!e||i.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return i}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:r(o,e,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}var a=d(i(2)),c=d(i(0)),l=d(i(4)),h=d(i(6)),u=d(i(7));function d(t){return t&&t.__esModule?t:{default:t}}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}function g(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var v=(g(m,h.default),m);function m(){return f(this,m),p(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}v.blotName="code",v.tagName="CODE";var b=(g(y,l.default),n(y,[{key:"delta",value:function(){var i=this,t=this.domNode.textContent;return t.endsWith("\n")&&(t=t.slice(0,-1)),t.split("\n").reduce(function(t,e){return t.insert(e).insert("\n",i.formats())},new a.default)}},{key:"format",value:function(t,e){var i,n;t===this.statics.blotName&&e||(i=this.descendant(u.default,this.length()-1),null!=(n=s(i,1)[0])&&n.deleteAt(n.length()-1,1),r(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,t,e))}},{key:"formatAt",value:function(t,e,i,n){var o,a,r,s,l;0!==e&&(null==c.default.query(i,c.default.Scope.BLOCK)||i===this.statics.blotName&&n===this.statics.formats(this.domNode)||(o=this.newlineIndex(t))<0||t+e<=o||(r=o-(a=this.newlineIndex(t,!0)+1)+1,l=(s=this.isolate(a,r)).next,s.format(i,n),l instanceof y&&l.formatAt(0,t-a+e-r,i,n)))}},{key:"insertAt",value:function(t,e,i){var n,o,a,r;null==i&&(n=this.descendant(u.default,t),a=(o=s(n,2))[0],r=o[1],a.insertAt(r,e))}},{key:"length",value:function(){var t=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?t:t+1}},{key:"newlineIndex",value:function(t,e){if(1<arguments.length&&void 0!==e&&e)return this.domNode.textContent.slice(0,t).lastIndexOf("\n");var i=this.domNode.textContent.slice(t).indexOf("\n");return-1<i?t+i:-1}},{key:"optimize",value:function(t){this.domNode.textContent.endsWith("\n")||this.appendChild(c.default.create("text","\n")),r(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"optimize",this).call(this,t);var e=this.next;null!=e&&e.prev===this&&e.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===e.statics.formats(e.domNode)&&(e.optimize(t),e.moveChildren(this),e.remove())}},{key:"replace",value:function(t){r(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"replace",this).call(this,t),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(t){var e=c.default.find(t);null==e?t.parentNode.removeChild(t):e instanceof c.default.Embed?e.remove():e.unwrap()})}}],[{key:"create",value:function(t){var e=r(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,t);return e.setAttribute("spellcheck",!1),e}},{key:"formats",value:function(){return!0}}]),y);function y(){return f(this,y),p(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}b.blotName="code-block",b.tagName="PRE",b.TAB="  ",e.Code=v,e.default=b},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var v="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(t){return _typeof2(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":_typeof2(t)},m=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var i=[],n=!0,o=!1,a=void 0;try{for(var r,s=t[Symbol.iterator]();!(n=(r=s.next()).done)&&(i.push(r.value),!e||i.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return i}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var d=r(i(2)),b=r(i(20)),y=r(i(0)),u=r(i(13)),f=r(i(24)),x=i(4),w=r(x),a=r(i(16)),c=r(i(21)),p=r(i(11)),k=r(i(3));function r(t){return t&&t.__esModule?t:{default:t}}var g=/^[ -~]*$/,s=(n(l,[{key:"applyDelta",value:function(t){var f=this,p=!1;this.scroll.update();var g=this.scroll.length();return this.scroll.batchStart(),(t=t.reduce(function(t,e){if(1===e.insert){var i=(0,c.default)(e.attributes);return delete i.image,t.insert({image:e.attributes.image},i)}if(null==e.attributes||!0!==e.attributes.list&&!0!==e.attributes.bullet||((e=(0,c.default)(e)).attributes.list?e.attributes.list="ordered":(e.attributes.list="bullet",delete e.attributes.bullet)),"string"!=typeof e.insert)return t.push(e);var n=e.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return t.insert(n,e.attributes)},new d.default)).reduce(function(e,t){var i=t.retain||t.delete||t.insert.length||1,n=t.attributes||{};if(null!=t.insert){if("string"==typeof t.insert){var o=t.insert;o.endsWith("\n")&&p&&(p=!1,o=o.slice(0,-1)),g<=e&&!o.endsWith("\n")&&(p=!0),f.scroll.insertAt(e,o);var a,r,s=f.scroll.line(e),l=m(s,2),c=l[0],h=l[1],u=(0,k.default)({},(0,x.bubbleFormats)(c));c instanceof w.default&&(a=c.descendant(y.default.Leaf,h),r=m(a,1)[0],u=(0,k.default)(u,(0,x.bubbleFormats)(r))),n=b.default.attributes.diff(u,n)||{}}else if("object"===v(t.insert)){var d=Object.keys(t.insert)[0];if(null==d)return e;f.scroll.insertAt(e,d,t.insert[d])}g+=i}return Object.keys(n).forEach(function(t){f.scroll.formatAt(e,i,t,n[t])}),e+i},0),t.reduce(function(t,e){return"number"==typeof e.delete?(f.scroll.deleteAt(t,e.delete),t):t+(e.retain||e.insert.length||1)},0),this.scroll.batchEnd(),this.update(t)}},{key:"deleteText",value:function(t,e){return this.scroll.deleteAt(t,e),this.update((new d.default).retain(t).delete(e))}},{key:"formatLine",value:function(r,e,t){var s=this,l=2<arguments.length&&void 0!==t?t:{};return this.scroll.update(),Object.keys(l).forEach(function(o){var t,a;null!=s.scroll.whitelist&&!s.scroll.whitelist[o]||(t=s.scroll.lines(r,Math.max(e,1)),a=e,t.forEach(function(t){var e,i,n=t.length();t instanceof u.default?(e=r-t.offset(s.scroll),i=t.newlineIndex(e+a)-e+1,t.formatAt(e,i,o,l[o])):t.format(o,l[o]),a-=n}))}),this.scroll.optimize(),this.update((new d.default).retain(r).retain(e,(0,c.default)(l)))}},{key:"formatText",value:function(e,i,t){var n=this,o=2<arguments.length&&void 0!==t?t:{};return Object.keys(o).forEach(function(t){n.scroll.formatAt(e,i,t,o[t])}),this.update((new d.default).retain(e).retain(i,(0,c.default)(o)))}},{key:"getContents",value:function(t,e){return this.delta.slice(t,t+e)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(t,e){return t.concat(e.delta())},new d.default)}},{key:"getFormat",value:function(t,e){var i=1<arguments.length&&void 0!==e?e:0,n=[],o=[];0===i?this.scroll.path(t).forEach(function(t){var e=m(t,1)[0];e instanceof w.default?n.push(e):e instanceof y.default.Leaf&&o.push(e)}):(n=this.scroll.lines(t,i),o=this.scroll.descendants(y.default.Leaf,t,i));var a=[n,o].map(function(t){if(0===t.length)return{};for(var e=(0,x.bubbleFormats)(t.shift());0<Object.keys(e).length;){var i=t.shift();if(null==i)return e;e=function(i,n){return Object.keys(n).reduce(function(t,e){return null==i[e]||(n[e]===i[e]?t[e]=n[e]:Array.isArray(n[e])?n[e].indexOf(i[e])<0&&(t[e]=n[e].concat([i[e]])):t[e]=[n[e],i[e]]),t},{})}((0,x.bubbleFormats)(i),e)}return e});return k.default.apply(k.default,a)}},{key:"getText",value:function(t,e){return this.getContents(t,e).filter(function(t){return"string"==typeof t.insert}).map(function(t){return t.insert}).join("")}},{key:"insertEmbed",value:function(t,e,i){return this.scroll.insertAt(t,e,i),this.update((new d.default).retain(t).insert((a=i,(o=e)in(n={})?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a,n)));var n,o,a}},{key:"insertText",value:function(e,i,t){var n=this,o=2<arguments.length&&void 0!==t?t:{};return i=i.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(e,i),Object.keys(o).forEach(function(t){n.scroll.formatAt(e,i.length,t,o[t])}),this.update((new d.default).retain(e).insert(i,(0,c.default)(o)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(1<this.scroll.children.length)return!1;var t=this.scroll.children.head;return t.statics.blotName===w.default.blotName&&!(1<t.children.length)&&t.children.head instanceof a.default}},{key:"removeFormat",value:function(t,e){var i=this.getText(t,e),n=this.scroll.line(t+e),o=m(n,2),a=o[0],r=o[1],s=0,l=new d.default;null!=a&&(s=a instanceof u.default?a.newlineIndex(r)-r+1:a.length()-r,l=a.delta().slice(r,r+s-1).insert("\n"));var c=this.getContents(t,e+s).diff((new d.default).insert(i).concat(l)),h=(new d.default).retain(t).concat(c);return this.applyDelta(h)}},{key:"update",value:function(t,e,i){var n,o,a,r,s,l,c=1<arguments.length&&void 0!==e?e:[],h=2<arguments.length&&void 0!==i?i:void 0,u=this.delta;return 1===c.length&&"characterData"===c[0].type&&c[0].target.data.match(g)&&y.default.find(c[0].target)?(n=y.default.find(c[0].target),o=(0,x.bubbleFormats)(n),a=n.offset(this.scroll),r=c[0].oldValue.replace(f.default.CONTENTS,""),s=(new d.default).insert(r),l=(new d.default).insert(n.value()),t=(new d.default).retain(a).concat(s.diff(l,h)).reduce(function(t,e){return e.insert?t.insert(e.insert,o):t.push(e)},new d.default),this.delta=u.compose(t)):(this.delta=this.getDelta(),t&&(0,p.default)(u.compose(t),this.delta)||(t=u.diff(this.delta,h))),t}}]),l);function l(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),this.scroll=t,this.delta=this.getDelta()}e.default=s},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Range=void 0;var b=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var i=[],n=!0,o=!1,a=void 0;try{for(var r,s=t[Symbol.iterator]();!(n=(r=s.next()).done)&&(i.push(r.value),!e||i.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return i}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var l=a(i(0)),h=a(i(21)),u=a(i(11)),d=a(i(8));function a(t){return t&&t.__esModule?t:{default:t}}function s(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var f=(0,a(i(10)).default)("quill:selection"),c=function t(e){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;r(this,t),this.index=e,this.length=i},p=(n(g,[{key:"handleComposition",value:function(){var e=this;this.root.addEventListener("compositionstart",function(){e.composing=!0}),this.root.addEventListener("compositionend",function(){if(e.composing=!1,e.cursor.parent){var t=e.cursor.restore();if(!t)return;setTimeout(function(){e.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)},1)}})}},{key:"handleDragging",value:function(){var t=this;this.emitter.listenDOM("mousedown",document.body,function(){t.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){t.mouseDown=!1,t.update(d.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(t,e){if(null==this.scroll.whitelist||this.scroll.whitelist[t]){this.scroll.update();var i=this.getNativeRange();if(null!=i&&i.native.collapsed&&!l.default.query(t,l.default.Scope.BLOCK)){if(i.start.node!==this.cursor.textNode){var n,o=l.default.find(i.start.node,!1);if(null==o)return;o instanceof l.default.Leaf?(n=o.split(i.start.offset),o.parent.insertBefore(this.cursor,n)):o.insertBefore(this.cursor,i.start.node),this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(t,e){var i=1<arguments.length&&void 0!==e?e:0,n=this.scroll.length();t=Math.min(t,n-1),i=Math.min(t+i,n-1)-t;var o=void 0,a=this.scroll.leaf(t),r=b(a,2),s=r[0],l=r[1];if(null==s)return null;var c=s.position(l,!0),h=b(c,2);o=h[0],l=h[1];var u=document.createRange();if(0<i){u.setStart(o,l);var d=this.scroll.leaf(t+i),f=b(d,2),s=f[0],l=f[1];if(null==s)return null;var p=s.position(l,!0),g=b(p,2),o=g[0];return l=g[1],u.setEnd(o,l),u.getBoundingClientRect()}var v="left",m=void 0;return o instanceof Text?(l<o.data.length?(u.setStart(o,l),u.setEnd(o,l+1)):(u.setStart(o,l-1),u.setEnd(o,l),v="right"),m=u.getBoundingClientRect()):(m=s.domNode.getBoundingClientRect(),0<l&&(v="right")),{bottom:m.top+m.height,height:m.height,left:m[v],right:m[v],top:m.top,width:0}}},{key:"getNativeRange",value:function(){var t=document.getSelection();if(null==t||t.rangeCount<=0)return null;var e=t.getRangeAt(0);if(null==e)return null;var i=this.normalizeNative(e);return f.info("getNativeRange",i),i}},{key:"getRange",value:function(){var t=this.getNativeRange();return null==t?[null,null]:[this.normalizedToRange(t),t]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(t){var r=this,e=[[t.start.node,t.start.offset]];t.native.collapsed||e.push([t.end.node,t.end.offset]);var i=e.map(function(t){var e=b(t,2),i=e[0],n=e[1],o=l.default.find(i,!0),a=o.offset(r.scroll);return 0===n?a:o instanceof l.default.Container?a+o.length():a+o.index(i,n)}),n=Math.min(Math.max.apply(Math,s(i)),this.scroll.length()-1),o=Math.min.apply(Math,[n].concat(s(i)));return new c(o,n-o)}},{key:"normalizeNative",value:function(t){if(!v(this.root,t.startContainer)||!t.collapsed&&!v(this.root,t.endContainer))return null;var e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach(function(t){for(var e=t.node,i=t.offset;!(e instanceof Text)&&0<e.childNodes.length;)if(e.childNodes.length>i)e=e.childNodes[i],i=0;else{if(e.childNodes.length!==i)break;i=(e=e.lastChild)instanceof Text?e.data.length:e.childNodes.length+1}t.node=e,t.offset=i}),e}},{key:"rangeToNative",value:function(t){var c=this,e=t.collapsed?[t.index]:[t.index,t.index+t.length],h=[],u=this.scroll.length();return e.forEach(function(t,e){t=Math.min(u-1,t);var i=c.scroll.leaf(t),n=b(i,2),o=n[0],a=n[1],r=o.position(a,0!==e),s=b(r,2),l=s[0],a=s[1];h.push(l,a)}),h.length<2&&(h=h.concat(h)),h}},{key:"scrollIntoView",value:function(t){var e,i,n,o,a,r,s,l=this.lastRange;null==l||null!=(e=this.getBounds(l.index,l.length))&&(i=this.scroll.length()-1,n=this.scroll.line(Math.min(l.index,i)),r=o=b(n,1)[0],0<l.length&&(a=this.scroll.line(Math.min(l.index+l.length,i)),r=b(a,1)[0]),null!=o&&null!=r&&(s=t.getBoundingClientRect(),e.top<s.top?t.scrollTop-=s.top-e.top:e.bottom>s.bottom&&(t.scrollTop+=e.bottom-s.bottom)))}},{key:"setNativeRange",value:function(t,e,i,n,o){var a,r,s,l=2<arguments.length&&void 0!==i?i:t,c=3<arguments.length&&void 0!==n?n:e,h=4<arguments.length&&void 0!==o&&o;f.info("setNativeRange",t,e,l,c),null!=t&&(null==this.root.parentNode||null==t.parentNode||null==l.parentNode)||null!=(a=document.getSelection())&&(null!=t?(this.hasFocus()||this.root.focus(),null!=(r=(this.getNativeRange()||{}).native)&&!h&&t===r.startContainer&&e===r.startOffset&&l===r.endContainer&&c===r.endOffset||("BR"==t.tagName&&(e=[].indexOf.call(t.parentNode.childNodes,t),t=t.parentNode),"BR"==l.tagName&&(c=[].indexOf.call(l.parentNode.childNodes,l),l=l.parentNode),(s=document.createRange()).setStart(t,e),s.setEnd(l,c),a.removeAllRanges(),a.addRange(s))):(a.removeAllRanges(),this.root.blur(),document.body.focus()))}},{key:"setRange",value:function(t,e,i){var n,o=1<arguments.length&&void 0!==e&&e,a=2<arguments.length&&void 0!==i?i:d.default.sources.API;"string"==typeof o&&(a=o,o=!1),f.info("setRange",t),null!=t?(n=this.rangeToNative(t),this.setNativeRange.apply(this,s(n).concat([o]))):this.setNativeRange(null),this.update(a)}},{key:"update",value:function(t){var e,i,n,o=0<arguments.length&&void 0!==t?t:d.default.sources.USER,a=this.lastRange,r=this.getRange(),s=b(r,2),l=s[0],c=s[1];this.lastRange=l,null!=this.lastRange&&(this.savedRange=this.lastRange),(0,u.default)(a,this.lastRange)||(!this.composing&&null!=c&&c.native.collapsed&&c.start.node!==this.cursor.textNode&&this.cursor.restore(),i=[d.default.events.SELECTION_CHANGE,(0,h.default)(this.lastRange),(0,h.default)(a),o],(e=this.emitter).emit.apply(e,[d.default.events.EDITOR_CHANGE].concat(i)),o!==d.default.sources.SILENT&&(n=this.emitter).emit.apply(n,i))}}]),g);function g(t,e){var s=this;r(this,g),this.emitter=e,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=l.default.create("cursor",this),this.lastRange=this.savedRange=new c(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){s.mouseDown||setTimeout(s.update.bind(s,d.default.sources.USER),1)}),this.emitter.on(d.default.events.EDITOR_CHANGE,function(t,e){t===d.default.events.TEXT_CHANGE&&0<e.length()&&s.update(d.default.sources.SILENT)}),this.emitter.on(d.default.events.SCROLL_BEFORE_UPDATE,function(){var t;!s.hasFocus()||null!=(t=s.getNativeRange())&&t.start.node!==s.cursor.textNode&&s.emitter.once(d.default.events.SCROLL_UPDATE,function(){try{s.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset)}catch(t){}})}),this.emitter.on(d.default.events.SCROLL_OPTIMIZE,function(t,e){var i,n,o,a,r;e.range&&(n=(i=e.range).startNode,o=i.startOffset,a=i.endNode,r=i.endOffset,s.setNativeRange(n,o,a,r))}),this.update(d.default.sources.SILENT)}function v(t,e){try{e.parentNode}catch(t){return}return e instanceof Text&&(e=e.parentNode),t.contains(e)}e.Range=c,e.default=p},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a,r=i(0);var s=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(l,((a=r)&&a.__esModule?a:{default:a}).default.Embed),n(l,[{key:"insertInto",value:function(t,e){0===t.children.length?function t(e,i,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,i);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,i,n)}if("value"in o)return o.value;var r=o.get;return void 0!==r?r.call(n):void 0}(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"insertInto",this).call(this,t,e):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),l);function l(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}s.blotName="break",s.tagName="BR",e.default=s},function(t,e,i){var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var a,r=i(44),s=i(30),l=i(1),c=(a=s.default,o(h,a),h.prototype.appendChild=function(t){this.insertBefore(t)},h.prototype.attach=function(){a.prototype.attach.call(this),this.children.forEach(function(t){t.attach()})},h.prototype.build=function(){var i=this;this.children=new r.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(t){try{var e=u(t);i.insertBefore(e,i.children.head||void 0)}catch(t){if(t instanceof l.ParchmentError)return;throw t}})},h.prototype.deleteAt=function(t,e){if(0===t&&e===this.length())return this.remove();this.children.forEachAt(t,e,function(t,e,i){t.deleteAt(e,i)})},h.prototype.descendant=function(t,e){var i=this.children.find(e),n=i[0],o=i[1];return null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t?[n,o]:n instanceof h?n.descendant(t,o):[null,-1]},h.prototype.descendants=function(n,t,e){void 0===t&&(t=0),void 0===e&&(e=Number.MAX_VALUE);var o=[],a=e;return this.children.forEachAt(t,e,function(t,e,i){(null==n.blotName&&n(t)||null!=n.blotName&&t instanceof n)&&o.push(t),t instanceof h&&(o=o.concat(t.descendants(n,e,a))),a-=i}),o},h.prototype.detach=function(){this.children.forEach(function(t){t.detach()}),a.prototype.detach.call(this)},h.prototype.formatAt=function(t,e,n,o){this.children.forEachAt(t,e,function(t,e,i){t.formatAt(e,i,n,o)})},h.prototype.insertAt=function(t,e,i){var n,o=this.children.find(t),a=o[0],r=o[1];a?a.insertAt(r,e,i):(n=null==i?l.create("text",e):l.create(e,i),this.appendChild(n))},h.prototype.insertBefore=function(e,t){if(null!=this.statics.allowedChildren&&!this.statics.allowedChildren.some(function(t){return e instanceof t}))throw new l.ParchmentError("Cannot insert "+e.statics.blotName+" into "+this.statics.blotName);e.insertInto(this,t)},h.prototype.length=function(){return this.children.reduce(function(t,e){return t+e.length()},0)},h.prototype.moveChildren=function(e,i){this.children.forEach(function(t){e.insertBefore(t,i)})},h.prototype.optimize=function(t){var e;a.prototype.optimize.call(this,t),0===this.children.length&&(null!=this.statics.defaultChild?(e=l.create(this.statics.defaultChild),this.appendChild(e),e.optimize(t)):this.remove())},h.prototype.path=function(t,e){void 0===e&&(e=!1);var i=this.children.find(t,e),n=i[0],o=i[1],a=[[this,t]];return n instanceof h?a.concat(n.path(o,e)):(null!=n&&a.push([n,o]),a)},h.prototype.removeChild=function(t){this.children.remove(t)},h.prototype.replace=function(t){t instanceof h&&t.moveChildren(this),a.prototype.replace.call(this,t)},h.prototype.split=function(t,n){if(void 0===n&&(n=!1),!n){if(0===t)return this;if(t===this.length())return this.next}var o=this.clone();return this.parent.insertBefore(o,this.next),this.children.forEachAt(t,this.length(),function(t,e,i){t=t.split(e,n),o.appendChild(t)}),o},h.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},h.prototype.update=function(t,e){var n=this,i=[],o=[];t.forEach(function(t){t.target===n.domNode&&"childList"===t.type&&(i.push.apply(i,t.addedNodes),o.push.apply(o,t.removedNodes))}),o.forEach(function(t){var e;null!=t.parentNode&&"IFRAME"!==t.tagName&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY||null!=(e=l.find(t))&&(null!=e.domNode.parentNode&&e.domNode.parentNode!==n.domNode||e.detach())}),i.filter(function(t){return t.parentNode==n.domNode}).sort(function(t,e){return t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(t){var e=null;null!=t.nextSibling&&(e=l.find(t.nextSibling));var i=u(t);i.next==e&&null!=i.next||(null!=i.parent&&i.parent.removeChild(n),n.insertBefore(i,e||void 0))})},h);function h(t){var e=a.call(this,t)||this;return e.build(),e}function u(e){var i=l.find(e);if(null==i)try{i=l.create(e)}catch(t){i=l.create(l.Scope.INLINE),[].slice.call(e.childNodes).forEach(function(t){i.domNode.appendChild(t)}),e.parentNode&&e.parentNode.replaceChild(i.domNode,e),i.attach()}return i}e.default=c},function(t,e,i){var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var a,r=i(12),s=i(31),l=i(17),c=i(1),h=(a=l.default,o(u,a),u.formats=function(t){return"string"==typeof this.tagName||(Array.isArray(this.tagName)?t.tagName.toLowerCase():void 0)},u.prototype.format=function(t,e){var i=c.query(t);i instanceof r.default?this.attributes.attribute(i,e):e&&(null==i||t===this.statics.blotName&&this.formats()[t]===e||this.replaceWith(t,e))},u.prototype.formats=function(){var t=this.attributes.values(),e=this.statics.formats(this.domNode);return null!=e&&(t[this.statics.blotName]=e),t},u.prototype.replaceWith=function(t,e){var i=a.prototype.replaceWith.call(this,t,e);return this.attributes.copy(i),i},u.prototype.update=function(t,e){var i=this;a.prototype.update.call(this,t,e),t.some(function(t){return t.target===i.domNode&&"attributes"===t.type})&&this.attributes.build()},u.prototype.wrap=function(t,e){var i=a.prototype.wrap.call(this,t,e);return i instanceof u&&i.statics.scope===this.statics.scope&&this.attributes.move(i),i},u);function u(t){var e=a.call(this,t)||this;return e.attributes=new s.default(e.domNode),e}e.default=h},function(t,e,i){var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var a,r=i(30),s=i(1),l=(a=r.default,o(c,a),c.value=function(t){return!0},c.prototype.index=function(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1},c.prototype.position=function(t,e){var i=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return 0<t&&(i+=1),[this.parent.domNode,i]},c.prototype.value=function(){var t={};return t[this.statics.blotName]=this.statics.value(this.domNode)||!0,t},c.scope=s.Scope.INLINE_BLOT,c);function c(){return null!==a&&a.apply(this,arguments)||this}e.default=l},function(t,e,i){var o=i(11),a=i(3),r={attributes:{compose:function(t,e,i){"object"!==_typeof2(t)&&(t={}),"object"!==_typeof2(e)&&(e={});var n=a(!0,{},e);for(var o in i||(n=Object.keys(n).reduce(function(t,e){return null!=n[e]&&(t[e]=n[e]),t},{})),t)void 0!==t[o]&&void 0===e[o]&&(n[o]=t[o]);return 0<Object.keys(n).length?n:void 0},diff:function(i,n){"object"!==_typeof2(i)&&(i={}),"object"!==_typeof2(n)&&(n={});var t=Object.keys(i).concat(Object.keys(n)).reduce(function(t,e){return o(i[e],n[e])||(t[e]=void 0===n[e]?null:n[e]),t},{});return 0<Object.keys(t).length?t:void 0},transform:function(i,n,t){if("object"!==_typeof2(i))return n;if("object"===_typeof2(n)){if(!t)return n;var e=Object.keys(n).reduce(function(t,e){return void 0===i[e]&&(t[e]=n[e]),t},{});return 0<Object.keys(e).length?e:void 0}}},iterator:function(t){return new n(t)},length:function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"string"==typeof t.insert?t.insert.length:1}};function n(t){this.ops=t,this.index=0,this.offset=0}n.prototype.hasNext=function(){return this.peekLength()<1/0},n.prototype.next=function(t){t=t||1/0;var e=this.ops[this.index];if(e){var i=this.offset,n=r.length(e);if(n-i<=t?(t=n-i,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};var o={};return e.attributes&&(o.attributes=e.attributes),"number"==typeof e.retain?o.retain=t:"string"==typeof e.insert?o.insert=e.insert.substr(i,t):o.insert=e.insert,o}return{retain:1/0}},n.prototype.peek=function(){return this.ops[this.index]},n.prototype.peekLength=function(){return this.ops[this.index]?r.length(this.ops[this.index])-this.offset:1/0},n.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},n.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var t=this.offset,e=this.index,i=this.next(),n=this.ops.slice(this.index);return this.offset=t,this.index=e,[i].concat(n)}return[]},t.exports=r},function(t,e){var i=function(){function y(t,e){return null!=e&&t instanceof e}var x,w,k;try{x=Map}catch(t){x=function(){}}try{w=Set}catch(t){w=function(){}}try{k=Promise}catch(t){k=function(){}}function C(t,f,e,p,g){"object"===_typeof2(f)&&(e=f.depth,p=f.prototype,g=f.includeNonEnumerable,f=f.circular);var v=[],m=[],b="undefined"!=typeof Buffer;return void 0===f&&(f=!0),void 0===e&&(e=1/0),function o(t,a){if(null===t)return null;if(0===a)return t;var r,e,i;if("object"!=_typeof2(t))return t;if(y(t,x))r=new x;else if(y(t,w))r=new w;else if(y(t,k))r=new k(function(e,i){t.then(function(t){e(o(t,a-1))},function(t){i(o(t,a-1))})});else if(C.__isArray(t))r=[];else if(C.__isRegExp(t))r=new RegExp(t.source,A(t)),t.lastIndex&&(r.lastIndex=t.lastIndex);else if(C.__isDate(t))r=new Date(t.getTime());else{if(b&&Buffer.isBuffer(t))return r=Buffer.allocUnsafe?Buffer.allocUnsafe(t.length):new Buffer(t.length),t.copy(r),r;y(t,Error)?r=Object.create(t):void 0===p?(e=Object.getPrototypeOf(t),r=Object.create(e)):(r=Object.create(p),e=p)}if(f){var n=v.indexOf(t);if(-1!=n)return m[n];v.push(t),m.push(r)}for(var s in y(t,x)&&t.forEach(function(t,e){var i=o(e,a-1),n=o(t,a-1);r.set(i,n)}),y(t,w)&&t.forEach(function(t){var e=o(t,a-1);r.add(e)}),t)e&&(i=Object.getOwnPropertyDescriptor(e,s)),i&&null==i.set||(r[s]=o(t[s],a-1));if(Object.getOwnPropertySymbols)for(var l=Object.getOwnPropertySymbols(t),s=0;s<l.length;s++){var c=l[s];(u=Object.getOwnPropertyDescriptor(t,c))&&!u.enumerable&&!g||(r[c]=o(t[c],a-1),u.enumerable||Object.defineProperty(r,c,{enumerable:!1}))}if(g)for(var h=Object.getOwnPropertyNames(t),s=0;s<h.length;s++){var u,d=h[s];(u=Object.getOwnPropertyDescriptor(t,d))&&u.enumerable||(r[d]=o(t[d],a-1),Object.defineProperty(r,d,{enumerable:!1}))}return r}(t,e)}function e(t){return Object.prototype.toString.call(t)}function A(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}return C.clonePrototype=function(t){if(null===t)return null;function e(){}return e.prototype=t,new e},C.__objToStr=e,C.__isDate=function(t){return"object"===_typeof2(t)&&"[object Date]"===e(t)},C.__isArray=function(t){return"object"===_typeof2(t)&&"[object Array]"===e(t)},C.__isRegExp=function(t){return"object"===_typeof2(t)&&"[object RegExp]"===e(t)},C.__getRegExpFlags=A,C}();"object"===_typeof2(t)&&t.exports&&(t.exports=i)},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var u=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var i=[],n=!0,o=!1,a=void 0;try{for(var r,s=t[Symbol.iterator]();!(n=(r=s.next()).done)&&(i.push(r.value),!e||i.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return i}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function d(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:d(o,e,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}var r=c(i(0)),a=c(i(8)),f=i(4),s=c(f),p=c(i(16)),g=c(i(13)),l=c(i(25));function c(t){return t&&t.__esModule?t:{default:t}}function h(t){return t instanceof s.default||t instanceof f.BlockEmbed}var v=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(m,r.default.Scroll),n(m,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(t,e){var i,n=this.line(t),o=u(n,2),a=o[0],r=o[1],s=this.line(t+e),l=u(s,1)[0];if(d(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"deleteAt",this).call(this,t,e),null!=l&&a!==l&&0<r){if(a instanceof f.BlockEmbed||l instanceof f.BlockEmbed)return void this.optimize();if(a instanceof g.default){var c=a.newlineIndex(a.length(),!0);if(-1<c&&(a=a.split(c+1))===l)return void this.optimize()}else l instanceof g.default&&-1<(i=l.newlineIndex(0))&&l.split(i+1);var h=l.children.head instanceof p.default?null:l.children.head;a.moveChildren(l,h),a.remove()}this.optimize()}},{key:"enable",value:function(t){var e=!(0<arguments.length&&void 0!==t)||t;this.domNode.setAttribute("contenteditable",e)}},{key:"formatAt",value:function(t,e,i,n){null!=this.whitelist&&!this.whitelist[i]||(d(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"formatAt",this).call(this,t,e,i,n),this.optimize())}},{key:"insertAt",value:function(t,e,i){var n,o;null!=i&&null!=this.whitelist&&!this.whitelist[e]||(t>=this.length()?null==i||null==r.default.query(e,r.default.Scope.BLOCK)?(n=r.default.create(this.statics.defaultChild),this.appendChild(n),null==i&&e.endsWith("\n")&&(e=e.slice(0,-1)),n.insertAt(0,e,i)):(o=r.default.create(e,i),this.appendChild(o)):d(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"insertAt",this).call(this,t,e,i),this.optimize())}},{key:"insertBefore",value:function(t,e){var i;t.statics.scope===r.default.Scope.INLINE_BLOT&&((i=r.default.create(this.statics.defaultChild)).appendChild(t),t=i),d(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"insertBefore",this).call(this,t,e)}},{key:"leaf",value:function(t){return this.path(t).pop()||[null,-1]}},{key:"line",value:function(t){return t===this.length()?this.line(t-1):this.descendant(h,t)}},{key:"lines",value:function(t,e){return function n(t,e,i){var o=[],a=i;return t.children.forEachAt(e,i,function(t,e,i){h(t)?o.push(t):t instanceof r.default.Container&&(o=o.concat(n(t,e,a))),a-=i}),o}(this,0<arguments.length&&void 0!==t?t:0,1<arguments.length&&void 0!==e?e:Number.MAX_VALUE)}},{key:"optimize",value:function(t,e){var i=0<arguments.length&&void 0!==t?t:[],n=1<arguments.length&&void 0!==e?e:{};!0!==this.batch&&(d(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"optimize",this).call(this,i,n),0<i.length&&this.emitter.emit(a.default.events.SCROLL_OPTIMIZE,i,n))}},{key:"path",value:function(t){return d(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"path",this).call(this,t).slice(1)}},{key:"update",value:function(t){var e;!0!==this.batch&&(e=a.default.sources.USER,"string"==typeof t&&(e=t),Array.isArray(t)||(t=this.observer.takeRecords()),0<t.length&&this.emitter.emit(a.default.events.SCROLL_BEFORE_UPDATE,e,t),d(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"update",this).call(this,t.concat([])),0<t.length&&this.emitter.emit(a.default.events.SCROLL_UPDATE,e,t))}}]),m);function m(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,m);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,t));return i.emitter=e.emitter,Array.isArray(e.whitelist)&&(i.whitelist=e.whitelist.reduce(function(t,e){return t[e]=!0,t},{})),i.domNode.addEventListener("DOMNodeInserted",function(){}),i.optimize(),i.enable(),i}v.blotName="scroll",v.className="ql-editor",v.tagName="DIV",v.defaultChild="block",v.allowedChildren=[s.default,f.BlockEmbed,l.default],e.default=v},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SHORTKEY=e.default=void 0;var x="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(t){return _typeof2(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":_typeof2(t)},w=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var i=[],n=!0,o=!1,a=void 0;try{for(var r,s=t[Symbol.iterator]();!(n=(r=s.next()).done)&&(i.push(r.value),!e||i.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return i}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a=h(i(21)),k=h(i(11)),s=h(i(3)),c=h(i(2)),u=h(i(20)),C=h(i(0)),f=h(i(5)),r=h(i(10)),l=h(i(9));function h(t){return t&&t.__esModule?t:{default:t}}function d(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var p=(0,r.default)("quill:keyboard"),g=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",v=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(A,l.default),n(A,null,[{key:"match",value:function(e,i){return i=O(i),!["altKey","ctrlKey","metaKey","shiftKey"].some(function(t){return!!i[t]!==e[t]&&null!==i[t]})&&i.key===(e.which||e.keyCode)}}]),n(A,[{key:"addBinding",value:function(t,e,i){var n=1<arguments.length&&void 0!==e?e:{},o=2<arguments.length&&void 0!==i?i:{},a=O(t);if(null==a||null==a.key)return p.warn("Attempted to add invalid keyboard binding",a);"function"==typeof n&&(n={handler:n}),"function"==typeof o&&(o={handler:o}),a=(0,s.default)(a,n,o),this.bindings[a.key]=this.bindings[a.key]||[],this.bindings[a.key].push(a)}},{key:"listen",value:function(){var y=this;this.quill.root.addEventListener("keydown",function(e){var t,i,n,o,a,r,s,l,c,h,u,d,f,p,g,v,m,b;e.defaultPrevented||(t=e.which||e.keyCode,0===(i=(y.bindings[t]||[]).filter(function(t){return A.match(e,t)})).length||null!=(n=y.quill.getSelection())&&y.quill.hasFocus()&&(o=y.quill.getLine(n.index),r=(a=w(o,2))[0],s=a[1],l=y.quill.getLeaf(n.index),h=(c=w(l,2))[0],u=c[1],d=0===n.length?[h,u]:y.quill.getLeaf(n.index+n.length),p=(f=w(d,2))[0],g=f[1],v=h instanceof C.default.Text?h.value().slice(0,u):"",m=p instanceof C.default.Text?p.value().slice(g):"",b={collapsed:0===n.length,empty:0===n.length&&r.length()<=1,format:y.quill.getFormat(n),offset:s,prefix:v,suffix:m},i.some(function(e){if(null!=e.collapsed&&e.collapsed!==b.collapsed)return!1;if(null!=e.empty&&e.empty!==b.empty)return!1;if(null!=e.offset&&e.offset!==b.offset)return!1;if(Array.isArray(e.format)){if(e.format.every(function(t){return null==b.format[t]}))return!1}else if("object"===x(e.format)&&!Object.keys(e.format).every(function(t){return!0===e.format[t]?null!=b.format[t]:!1===e.format[t]?null==b.format[t]:(0,k.default)(e.format[t],b.format[t])}))return!1;return!(null!=e.prefix&&!e.prefix.test(b.prefix)||null!=e.suffix&&!e.suffix.test(b.suffix)||!0===e.handler.call(y,n,b))})&&e.preventDefault()))})}}]),A);function A(e,t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,e,t));return i.bindings={},Object.keys(i.options.bindings).forEach(function(t){("list autofill"!==t||null==e.scroll.whitelist||e.scroll.whitelist.list)&&i.options.bindings[t]&&i.addBinding(i.options.bindings[t])}),i.addBinding({key:A.keys.ENTER,shiftKey:null},T),i.addBinding({key:A.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(i.addBinding({key:A.keys.BACKSPACE},{collapsed:!0},b),i.addBinding({key:A.keys.DELETE},{collapsed:!0},y)):(i.addBinding({key:A.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},b),i.addBinding({key:A.keys.DELETE},{collapsed:!0,suffix:/^.?$/},y)),i.addBinding({key:A.keys.BACKSPACE},{collapsed:!1},S),i.addBinding({key:A.keys.DELETE},{collapsed:!1},S),i.addBinding({key:A.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},b),i.listen(),i}function m(n,o){var t=n===v.keys.LEFT?"prefix":"suffix",e={key:n,shiftKey:o,altKey:null};return d(e,t,/^$/),d(e,"handler",function(t){var e=t.index;n===v.keys.RIGHT&&(e+=t.length+1);var i=this.quill.getLeaf(e);return!(w(i,1)[0]instanceof C.default.Embed)||(n===v.keys.LEFT?o?this.quill.setSelection(t.index-1,t.length+1,f.default.sources.USER):this.quill.setSelection(t.index-1,f.default.sources.USER):o?this.quill.setSelection(t.index,t.length+1,f.default.sources.USER):this.quill.setSelection(t.index+t.length+1,f.default.sources.USER),!1)}),e}function b(t,e){var i,n,o,a,r,s,l,c;0===t.index||this.quill.getLength()<=1||(i=this.quill.getLine(t.index),n=w(i,1)[0],l={},0===e.offset&&(o=this.quill.getLine(t.index-1),null!=(a=w(o,1)[0])&&1<a.length()&&(r=n.formats(),s=this.quill.getFormat(t.index-1,1),l=u.default.attributes.diff(r,s)||{})),c=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1,this.quill.deleteText(t.index-c,c,f.default.sources.USER),0<Object.keys(l).length&&this.quill.formatLine(t.index-c,c,l,f.default.sources.USER),this.quill.focus())}function y(t,e){var i,n,o,a,r,s,l,c,h=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;t.index>=this.quill.getLength()-h||(l={},c=0,i=this.quill.getLine(t.index),n=w(i,1)[0],e.offset>=n.length()-1&&(o=this.quill.getLine(t.index+1),(a=w(o,1)[0])&&(r=n.formats(),s=this.quill.getFormat(t.index,1),l=u.default.attributes.diff(r,s)||{},c=a.length())),this.quill.deleteText(t.index,h,f.default.sources.USER),0<Object.keys(l).length&&this.quill.formatLine(t.index+c-1,h,l,f.default.sources.USER))}function S(t){var e,i,n=this.quill.getLines(t),o={};1<n.length&&(e=n[0].formats(),i=n[n.length-1].formats(),o=u.default.attributes.diff(i,e)||{}),this.quill.deleteText(t,f.default.sources.USER),0<Object.keys(o).length&&this.quill.formatLine(t.index,1,o,f.default.sources.USER),this.quill.setSelection(t.index,f.default.sources.SILENT),this.quill.focus()}function T(t,i){var e=this;0<t.length&&this.quill.scroll.deleteAt(t.index,t.length);var n=Object.keys(i.format).reduce(function(t,e){return C.default.query(e,C.default.Scope.BLOCK)&&!Array.isArray(i.format[e])&&(t[e]=i.format[e]),t},{});this.quill.insertText(t.index,"\n",n,f.default.sources.USER),this.quill.setSelection(t.index+1,f.default.sources.SILENT),this.quill.focus(),Object.keys(i.format).forEach(function(t){null==n[t]&&(Array.isArray(i.format[t])||"link"!==t&&e.quill.format(t,i.format[t],f.default.sources.USER))})}function E(d){return{key:v.keys.TAB,shiftKey:!d,format:{"code-block":!0},handler:function(t){var e,i,n,o,a=C.default.query("code-block"),r=t.index,s=t.length,l=this.quill.scroll.descendant(a,r),c=w(l,2),h=c[0],u=c[1];null!=h&&(e=this.quill.getIndex(h),i=h.newlineIndex(u,!0)+1,n=h.newlineIndex(e+u+s),o=h.domNode.textContent.slice(i,n).split("\n"),u=0,o.forEach(function(t,e){d?(h.insertAt(i+u,a.TAB),u+=a.TAB.length,0===e?r+=a.TAB.length:s+=a.TAB.length):t.startsWith(a.TAB)&&(h.deleteAt(i+u,a.TAB.length),u-=a.TAB.length,0===e?r-=a.TAB.length:s-=a.TAB.length),u+=t.length+1}),this.quill.update(f.default.sources.USER),this.quill.setSelection(r,s,f.default.sources.SILENT))}}}function _(i){return{key:i[0].toUpperCase(),shortKey:!0,handler:function(t,e){this.quill.format(i,!e.format[i],f.default.sources.USER)}}}function O(t){if("string"==typeof t||"number"==typeof t)return O({key:t});if("object"===(void 0===t?"undefined":x(t))&&(t=(0,a.default)(t,!1)),"string"==typeof t.key)if(null!=v.keys[t.key.toUpperCase()])t.key=v.keys[t.key.toUpperCase()];else{if(1!==t.key.length)return null;t.key=t.key.toUpperCase().charCodeAt(0)}return t.shortKey&&(t[g]=t.shortKey,delete t.shortKey),t}v.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},v.DEFAULTS={bindings:{bold:_("bold"),italic:_("italic"),underline:_("underline"),indent:{key:v.keys.TAB,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","+1",f.default.sources.USER)}},outdent:{key:v.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","-1",f.default.sources.USER)}},"outdent backspace":{key:v.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(t,e){null!=e.format.indent?this.quill.format("indent","-1",f.default.sources.USER):null!=e.format.list&&this.quill.format("list",!1,f.default.sources.USER)}},"indent code-block":E(!0),"outdent code-block":E(!1),"remove tab":{key:v.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(t){this.quill.deleteText(t.index-1,1,f.default.sources.USER)}},tab:{key:v.keys.TAB,handler:function(t){this.quill.history.cutoff();var e=(new c.default).retain(t.index).delete(t.length).insert("\t");this.quill.updateContents(e,f.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,f.default.sources.SILENT)}},"list empty enter":{key:v.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(t,e){this.quill.format("list",!1,f.default.sources.USER),e.format.indent&&this.quill.format("indent",!1,f.default.sources.USER)}},"checklist enter":{key:v.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(t){var e=this.quill.getLine(t.index),i=w(e,2),n=i[0],o=i[1],a=(0,s.default)({},n.formats(),{list:"checked"}),r=(new c.default).retain(t.index).insert("\n",a).retain(n.length()-o-1).retain(1,{list:"unchecked"});this.quill.updateContents(r,f.default.sources.USER),this.quill.setSelection(t.index+1,f.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:v.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(t,e){var i=this.quill.getLine(t.index),n=w(i,2),o=n[0],a=n[1],r=(new c.default).retain(t.index).insert("\n",e.format).retain(o.length()-a-1).retain(1,{header:null});this.quill.updateContents(r,f.default.sources.USER),this.quill.setSelection(t.index+1,f.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(t,e){var i=e.prefix.length,n=this.quill.getLine(t.index),o=w(n,2),a=o[0],r=o[1];if(i<r)return!0;var s=void 0;switch(e.prefix.trim()){case"[]":case"[ ]":s="unchecked";break;case"[x]":s="checked";break;case"-":case"*":s="bullet";break;default:s="ordered"}this.quill.insertText(t.index," ",f.default.sources.USER),this.quill.history.cutoff();var l=(new c.default).retain(t.index-r).delete(i+1).retain(a.length()-2-r).retain(1,{list:s});this.quill.updateContents(l,f.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-i,f.default.sources.SILENT)}},"code exit":{key:v.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(t){var e=this.quill.getLine(t.index),i=w(e,2),n=i[0],o=i[1],a=(new c.default).retain(t.index+n.length()-o-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(a,f.default.sources.USER)}},"embed left":m(v.keys.LEFT,!1),"embed left shift":m(v.keys.LEFT,!0),"embed right":m(v.keys.RIGHT,!1),"embed right shift":m(v.keys.RIGHT,!0)}},e.default=v,e.SHORTKEY=g},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});function r(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:r(o,e,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}var c=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var i=[],n=!0,o=!1,a=void 0;try{for(var r,s=t[Symbol.iterator]();!(n=(r=s.next()).done)&&(i.push(r.value),!e||i.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return i}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var h=a(i(0)),u=a(i(7));function a(t){return t&&t.__esModule?t:{default:t}}var s=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(d,h.default.Embed),n(d,null,[{key:"value",value:function(){}}]),n(d,[{key:"detach",value:function(){null!=this.parent&&this.parent.removeChild(this)}},{key:"format",value:function(t,e){if(0!==this._length)return r(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"format",this).call(this,t,e);for(var i=this,n=0;null!=i&&i.statics.scope!==h.default.Scope.BLOCK_BLOT;)n+=i.offset(i.parent),i=i.parent;null!=i&&(this._length=d.CONTENTS.length,i.optimize(),i.formatAt(n,d.CONTENTS.length,t,e),this._length=0)}},{key:"index",value:function(t,e){return t===this.textNode?0:r(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"index",this).call(this,t,e)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){r(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!this.selection.composing&&null!=this.parent){var t,e,i=this.textNode,n=this.selection.getNativeRange(),o=void 0,a=void 0,r=void 0;for(null!=n&&n.start.node===i&&n.end.node===i&&(t=[i,n.start.offset,n.end.offset],o=t[0],a=t[1],r=t[2]);null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==d.CONTENTS&&(e=this.textNode.data.split(d.CONTENTS).join(""),this.next instanceof u.default?(o=this.next.domNode,this.next.insertAt(0,e),this.textNode.data=d.CONTENTS):(this.textNode.data=e,this.parent.insertBefore(h.default.create(this.textNode),this),this.textNode=document.createTextNode(d.CONTENTS),this.domNode.appendChild(this.textNode))),this.remove(),null!=a){var s=[a,r].map(function(t){return Math.max(0,Math.min(o.data.length,t-1))}),l=c(s,2);return a=l[0],r=l[1],{startNode:o,startOffset:a,endNode:o,endOffset:r}}}}},{key:"update",value:function(t,e){var i,n=this;!t.some(function(t){return"characterData"===t.type&&t.target===n.textNode})||(i=this.restore())&&(e.range=i)}},{key:"value",value:function(){return""}}]),d);function d(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,d);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,t));return i.selection=e,i.textNode=document.createTextNode(d.CONTENTS),i.domNode.appendChild(i.textNode),i._length=0,i}s.blotName="cursor",s.className="ql-cursor",s.tagName="span",s.CONTENTS="\ufeff",e.default=s},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=r(i(0)),o=i(4),a=r(o);function r(t){return t&&t.__esModule?t:{default:t}}var s=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(l,n.default.Container),l);function l(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}s.allowedChildren=[a.default,o.BlockEmbed,s],e.default=s},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorStyle=e.ColorClass=e.ColorAttributor=void 0;var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a,r=i(0),s=(a=r)&&a.__esModule?a:{default:a};var l=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(c,s.default.Attributor.Style),n(c,[{key:"value",value:function(t){var e=function t(e,i,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,i);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,i,n)}if("value"in o)return o.value;var r=o.get;return void 0!==r?r.call(n):void 0}(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"value",this).call(this,t);return e.startsWith("rgb(")?(e=e.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+e.split(",").map(function(t){return("00"+parseInt(t).toString(16)).slice(-2)}).join("")):e}}]),c);function c(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(c.__proto__||Object.getPrototypeOf(c)).apply(this,arguments))}var h=new s.default.Attributor.Class("color","ql-color",{scope:s.default.Scope.INLINE}),u=new l("color","color",{scope:s.default.Scope.INLINE});e.ColorAttributor=l,e.ColorClass=h,e.ColorStyle=u},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.sanitize=e.default=void 0;var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:r(o,e,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}var a,s=i(6);var l=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(c,((a=s)&&a.__esModule?a:{default:a}).default),n(c,[{key:"format",value:function(t,e){if(t!==this.statics.blotName||!e)return r(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"format",this).call(this,t,e);e=this.constructor.sanitize(e),this.domNode.setAttribute("href",e)}}],[{key:"create",value:function(t){var e=r(c.__proto__||Object.getPrototypeOf(c),"create",this).call(this,t);return t=this.sanitize(t),e.setAttribute("href",t),e.setAttribute("rel","noopener noreferrer"),e.setAttribute("target","_blank"),e}},{key:"formats",value:function(t){return t.getAttribute("href")}},{key:"sanitize",value:function(t){return h(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}}]),c);function c(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(c.__proto__||Object.getPrototypeOf(c)).apply(this,arguments))}function h(t,e){var i=document.createElement("a");i.href=t;var n=i.href.slice(0,i.href.indexOf(":"));return-1<e.indexOf(n)}l.blotName="link",l.tagName="A",l.SANITIZED_URL="about:blank",l.PROTOCOL_WHITELIST=["http","https","mailto","tel"],e.default=l,e.sanitize=h},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(t){return _typeof2(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":_typeof2(t)},n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var r=l(i(23)),s=l(i(107));function l(t){return t&&t.__esModule?t:{default:t}}var c=0;function h(t,e){t.setAttribute(e,!("true"===t.getAttribute(e)))}var u=(n(d,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),h(this.label,"aria-expanded"),h(this.options,"aria-hidden")}},{key:"buildItem",value:function(t){var e=this,i=document.createElement("span");return i.tabIndex="0",i.setAttribute("role","button"),i.classList.add("ql-picker-item"),t.hasAttribute("value")&&i.setAttribute("data-value",t.getAttribute("value")),t.textContent&&i.setAttribute("data-label",t.textContent),i.addEventListener("click",function(){e.selectItem(i,!0)}),i.addEventListener("keydown",function(t){switch(t.keyCode){case r.default.keys.ENTER:e.selectItem(i,!0),t.preventDefault();break;case r.default.keys.ESCAPE:e.escape(),t.preventDefault()}}),i}},{key:"buildLabel",value:function(){var t=document.createElement("span");return t.classList.add("ql-picker-label"),t.innerHTML=s.default,t.tabIndex="0",t.setAttribute("role","button"),t.setAttribute("aria-expanded","false"),this.container.appendChild(t),t}},{key:"buildOptions",value:function(){var i=this,n=document.createElement("span");n.classList.add("ql-picker-options"),n.setAttribute("aria-hidden","true"),n.tabIndex="-1",n.id="ql-picker-options-"+c,c+=1,this.label.setAttribute("aria-controls",n.id),this.options=n,[].slice.call(this.select.options).forEach(function(t){var e=i.buildItem(t);n.appendChild(e),!0===t.selected&&i.selectItem(e)}),this.container.appendChild(n)}},{key:"buildPicker",value:function(){var e=this;[].slice.call(this.select.attributes).forEach(function(t){e.container.setAttribute(t.name,t.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var t=this;this.close(),setTimeout(function(){return t.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(t,e){var i,n=1<arguments.length&&void 0!==e&&e,o=this.container.querySelector(".ql-selected");t!==o&&(null!=o&&o.classList.remove("ql-selected"),null!=t&&(t.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(t.parentNode.children,t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),n&&("function"==typeof Event?this.select.dispatchEvent(new Event("change")):"object"===("undefined"==typeof Event?"undefined":a(Event))&&((i=document.createEvent("Event")).initEvent("change",!0,!0),this.select.dispatchEvent(i)),this.close())))}},{key:"update",value:function(){var t,e=void 0;-1<this.select.selectedIndex?(t=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex],e=this.select.options[this.select.selectedIndex],this.selectItem(t)):this.selectItem(null);var i=null!=e&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",i)}}]),d);function d(t){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,d),this.select=t,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){e.togglePicker()}),this.label.addEventListener("keydown",function(t){switch(t.keyCode){case r.default.keys.ENTER:e.togglePicker();break;case r.default.keys.ESCAPE:e.escape(),t.preventDefault()}}),this.select.addEventListener("change",this.update.bind(this))}e.default=u},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=m(i(0)),o=m(i(5)),a=i(4),r=m(a),s=m(i(16)),l=m(i(25)),c=m(i(24)),h=m(i(35)),u=m(i(6)),d=m(i(22)),f=m(i(7)),p=m(i(55)),g=m(i(42)),v=m(i(23));function m(t){return t&&t.__esModule?t:{default:t}}o.default.register({"blots/block":r.default,"blots/block/embed":a.BlockEmbed,"blots/break":s.default,"blots/container":l.default,"blots/cursor":c.default,"blots/embed":h.default,"blots/inline":u.default,"blots/scroll":d.default,"blots/text":f.default,"modules/clipboard":p.default,"modules/history":g.default,"modules/keyboard":v.default}),n.default.register(r.default,s.default,c.default,u.default,d.default,f.default),e.default=o.default},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var r=i(1),n=(Object.defineProperty(o.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),o.create=function(t){if(null==this.tagName)throw new r.ParchmentError("Blot definition missing tagName");var e=Array.isArray(this.tagName)?("string"==typeof t&&(t=t.toUpperCase(),parseInt(t).toString()===t&&(t=parseInt(t))),"number"==typeof t?document.createElement(this.tagName[t-1]):-1<this.tagName.indexOf(t)?document.createElement(t):document.createElement(this.tagName[0])):document.createElement(this.tagName);return this.className&&e.classList.add(this.className),e},o.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},o.prototype.clone=function(){var t=this.domNode.cloneNode(!1);return r.create(t)},o.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},o.prototype.deleteAt=function(t,e){this.isolate(t,e).remove()},o.prototype.formatAt=function(t,e,i,n){var o,a=this.isolate(t,e);null!=r.query(i,r.Scope.BLOT)&&n?a.wrap(i,n):null!=r.query(i,r.Scope.ATTRIBUTE)&&(o=r.create(this.statics.scope),a.wrap(o),o.format(i,n))},o.prototype.insertAt=function(t,e,i){var n=null==i?r.create("text",e):r.create(e,i),o=this.split(t);this.parent.insertBefore(n,o)},o.prototype.insertInto=function(t,e){void 0===e&&(e=null),null!=this.parent&&this.parent.children.remove(this);var i=null;t.children.insertBefore(this,e),null!=e&&(i=e.domNode),this.domNode.parentNode==t.domNode&&this.domNode.nextSibling==i||t.domNode.insertBefore(this.domNode,i),this.parent=t,this.attach()},o.prototype.isolate=function(t,e){var i=this.split(t);return i.split(e),i},o.prototype.length=function(){return 1},o.prototype.offset=function(t){return void 0===t&&(t=this.parent),null==this.parent||this==t?0:this.parent.children.offset(this)+this.parent.offset(t)},o.prototype.optimize=function(t){null!=this.domNode[r.DATA_KEY]&&delete this.domNode[r.DATA_KEY].mutations},o.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},o.prototype.replace=function(t){null!=t.parent&&(t.parent.insertBefore(this,t.next),t.remove())},o.prototype.replaceWith=function(t,e){var i="string"==typeof t?r.create(t,e):t;return i.replace(this),i},o.prototype.split=function(t,e){return 0===t?this:this.next},o.prototype.update=function(t,e){},o.prototype.wrap=function(t,e){var i="string"==typeof t?r.create(t,e):t;return null!=this.parent&&this.parent.insertBefore(i,this.next),i.appendChild(this),i},o.blotName="abstract",o);function o(t){this.domNode=t,this.domNode[r.DATA_KEY]={blot:this}}e.default=n},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var o=i(12),a=i(32),r=i(33),s=i(1),n=(l.prototype.attribute=function(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])},l.prototype.build=function(){var i=this;this.attributes={};var t=o.default.keys(this.domNode),e=a.default.keys(this.domNode),n=r.default.keys(this.domNode);t.concat(e).concat(n).forEach(function(t){var e=s.query(t,s.Scope.ATTRIBUTE);e instanceof o.default&&(i.attributes[e.attrName]=e)})},l.prototype.copy=function(i){var n=this;Object.keys(this.attributes).forEach(function(t){var e=n.attributes[t].value(n.domNode);i.format(t,e)})},l.prototype.move=function(t){var e=this;this.copy(t),Object.keys(this.attributes).forEach(function(t){e.attributes[t].remove(e.domNode)}),this.attributes={}},l.prototype.values=function(){var i=this;return Object.keys(this.attributes).reduce(function(t,e){return t[e]=i.attributes[e].value(i.domNode),t},{})},l);function l(t){this.attributes={},this.domNode=t,this.build()}e.default=n},function(t,e,i){var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var a=i(12);function r(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(function(t){return 0===t.indexOf(e+"-")})}var s,l=(s=a.default,o(c,s),c.keys=function(t){return(t.getAttribute("class")||"").split(/\s+/).map(function(t){return t.split("-").slice(0,-1).join("-")})},c.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(this.keyName+"-"+e),!0)},c.prototype.remove=function(e){r(e,this.keyName).forEach(function(t){e.classList.remove(t)}),0===e.classList.length&&e.removeAttribute("class")},c.prototype.value=function(t){var e=(r(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""},c);function c(){return null!==s&&s.apply(this,arguments)||this}e.default=l},function(t,e,i){var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var a=i(12);function r(t){var e=t.split("-"),i=e.slice(1).map(function(t){return t[0].toUpperCase()+t.slice(1)}).join("");return e[0]+i}var s,l=(s=a.default,o(c,s),c.keys=function(t){return(t.getAttribute("style")||"").split(";").map(function(t){return t.split(":")[0].trim()})},c.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.style[r(this.keyName)]=e,!0)},c.prototype.remove=function(t){t.style[r(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")},c.prototype.value=function(t){var e=t.style[r(this.keyName)];return this.canAdd(t,e)?e:""},c);function c(){return null!==s&&s.apply(this,arguments)||this}e.default=l},function(t,e,i){function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}Object.defineProperty(e,"__esModule",{value:!0});var o=(function(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}(a,[{key:"init",value:function(){var e=this;Object.keys(this.options.modules).forEach(function(t){null==e.modules[t]&&e.addModule(t)})}},{key:"addModule",value:function(t){var e=this.quill.constructor.import("modules/"+t);return this.modules[t]=new e(this.quill,this.options.modules[t]||{}),this.modules[t]}}]),a);function a(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),this.quill=t,this.options=e,this.modules={}}o.DEFAULTS={modules:{}},o.themes={default:o},e.default=o},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a=s(i(0)),r=s(i(7));function s(t){return t&&t.__esModule?t:{default:t}}var l="\ufeff",c=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(h,a.default.Embed),n(h,[{key:"index",value:function(t,e){return t===this.leftGuard?0:t===this.rightGuard?1:function t(e,i,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,i);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,i,n)}if("value"in o)return o.value;var r=o.get;return void 0!==r?r.call(n):void 0}(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"index",this).call(this,t,e)}},{key:"restore",value:function(t){var e,i=void 0,n=void 0,o=t.data.split(l).join("");return t===this.leftGuard?i=this.prev instanceof r.default?(e=this.prev.length(),this.prev.insertAt(e,o),{startNode:this.prev.domNode,startOffset:e+o.length}):(n=document.createTextNode(o),this.parent.insertBefore(a.default.create(n),this),{startNode:n,startOffset:o.length}):t===this.rightGuard&&(i=this.next instanceof r.default?(this.next.insertAt(0,o),{startNode:this.next.domNode,startOffset:o.length}):(n=document.createTextNode(o),this.parent.insertBefore(a.default.create(n),this.next),{startNode:n,startOffset:o.length})),t.data=l,i}},{key:"update",value:function(t,i){var n=this;t.forEach(function(t){var e;"characterData"!==t.type||t.target!==n.leftGuard&&t.target!==n.rightGuard||(e=n.restore(t.target))&&(i.range=e)})}}]),h);function h(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h);var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,t));return e.contentNode=document.createElement("span"),e.contentNode.setAttribute("contenteditable",!1),[].slice.call(e.domNode.childNodes).forEach(function(t){e.contentNode.appendChild(t)}),e.leftGuard=document.createTextNode(l),e.rightGuard=document.createTextNode(l),e.domNode.appendChild(e.leftGuard),e.domNode.appendChild(e.contentNode),e.domNode.appendChild(e.rightGuard),e}e.default=c},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AlignStyle=e.AlignClass=e.AlignAttribute=void 0;var n,o=i(0),a=(n=o)&&n.__esModule?n:{default:n};var r={scope:a.default.Scope.BLOCK,whitelist:["right","center","justify"]},s=new a.default.Attributor.Attribute("align","align",r),l=new a.default.Attributor.Class("align","ql-align",r),c=new a.default.Attributor.Style("align","text-align",r);e.AlignAttribute=s,e.AlignClass=l,e.AlignStyle=c},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.BackgroundStyle=e.BackgroundClass=void 0;var n,o=i(0),a=(n=o)&&n.__esModule?n:{default:n},r=i(26);var s=new a.default.Attributor.Class("background","ql-bg",{scope:a.default.Scope.INLINE}),l=new r.ColorAttributor("background","background-color",{scope:a.default.Scope.INLINE});e.BackgroundClass=s,e.BackgroundStyle=l},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.DirectionStyle=e.DirectionClass=e.DirectionAttribute=void 0;var n,o=i(0),a=(n=o)&&n.__esModule?n:{default:n};var r={scope:a.default.Scope.BLOCK,whitelist:["rtl"]},s=new a.default.Attributor.Attribute("direction","dir",r),l=new a.default.Attributor.Class("direction","ql-direction",r),c=new a.default.Attributor.Style("direction","direction",r);e.DirectionAttribute=s,e.DirectionClass=l,e.DirectionStyle=c},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.FontClass=e.FontStyle=void 0;var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a,r=i(0),s=(a=r)&&a.__esModule?a:{default:a};var l={scope:s.default.Scope.INLINE,whitelist:["serif","monospace"]},c=new s.default.Attributor.Class("font","ql-font",l);function h(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}var u=new(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(h,s.default.Attributor.Style),n(h,[{key:"value",value:function(t){return function t(e,i,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,i);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,i,n)}if("value"in o)return o.value;var r=o.get;return void 0!==r?r.call(n):void 0}(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"value",this).call(this,t).replace(/["']/g,"")}}]),h)("font","font-family",l);e.FontStyle=u,e.FontClass=c},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SizeStyle=e.SizeClass=void 0;var n,o=i(0),a=(n=o)&&n.__esModule?n:{default:n};var r=new a.default.Attributor.Class("size","ql-size",{scope:a.default.Scope.INLINE,whitelist:["small","large","huge"]}),s=new a.default.Attributor.Style("size","font-size",{scope:a.default.Scope.INLINE,whitelist:["10px","18px","32px"]});e.SizeClass=r,e.SizeStyle=s},function(t,e,i){t.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.getLastChangeIndex=e.default=void 0;var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a=s(i(0)),r=s(i(5));function s(t){return t&&t.__esModule?t:{default:t}}var l=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(c,s(i(9)).default),n(c,[{key:"change",value:function(t,e){var i,n;0!==this.stack[t].length&&(i=this.stack[t].pop(),this.stack[e].push(i),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(i[t],r.default.sources.USER),this.ignoreChange=!1,n=h(i[t]),this.quill.setSelection(n))}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(t,e){var i,n,o;0!==t.ops.length&&(this.stack.redo=[],o=this.quill.getContents().diff(e),i=Date.now(),this.lastRecorded+this.options.delay>i&&0<this.stack.undo.length?(n=this.stack.undo.pop(),o=o.compose(n.undo),t=n.redo.compose(t)):this.lastRecorded=i,this.stack.undo.push({redo:t,undo:o}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(e){this.stack.undo.forEach(function(t){t.undo=e.transform(t.undo,!0),t.redo=e.transform(t.redo,!0)}),this.stack.redo.forEach(function(t){t.undo=e.transform(t.undo,!0),t.redo=e.transform(t.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),c);function c(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,t,e));return o.lastRecorded=0,o.ignoreChange=!1,o.clear(),o.quill.on(r.default.events.EDITOR_CHANGE,function(t,e,i,n){t!==r.default.events.TEXT_CHANGE||o.ignoreChange||(o.options.userOnly&&n!==r.default.sources.USER?o.transform(e):o.record(e,i))}),o.quill.keyboard.addBinding({key:"Z",shortKey:!0},o.undo.bind(o)),o.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},o.redo.bind(o)),/Win/i.test(navigator.platform)&&o.quill.keyboard.addBinding({key:"Y",shortKey:!0},o.redo.bind(o)),o}function h(t){var e,i,n=t.reduce(function(t,e){return t+=e.delete||0},0),o=t.length()-n;return null!=(i=(e=t).ops[e.ops.length-1])&&(null!=i.insert?"string"==typeof i.insert&&i.insert.endsWith("\n"):null!=i.attributes&&Object.keys(i.attributes).some(function(t){return null!=a.default.query(t,a.default.Scope.BLOCK)}))&&--o,o}l.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},e.default=l,e.getLastChangeIndex=h},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BaseTooltip=void 0;var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a=p(i(3)),r=p(i(2)),s=p(i(8)),l=p(i(23)),c=p(i(34)),h=p(i(59)),u=p(i(60)),d=p(i(28)),f=p(i(61));function p(t){return t&&t.__esModule?t:{default:t}}function g(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}function m(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var b=[!1,"center","right","justify"],y=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],x=[!1,"serif","monospace"],w=["1","2","3",!1],k=["small",!1,"large","huge"],C=(m(A,c.default),n(A,[{key:"addModule",value:function(t){var e=function t(e,i,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,i);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,i,n)}if("value"in o)return o.value;var r=o.get;return void 0!==r?r.call(n):void 0}(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"addModule",this).call(this,t);return"toolbar"===t&&this.extendToolbar(e),e}},{key:"buildButtons",value:function(t,n){t.forEach(function(i){(i.getAttribute("class")||"").split(/\s+/).forEach(function(t){var e;t.startsWith("ql-")&&(t=t.slice("ql-".length),null!=n[t]&&("direction"===t?i.innerHTML=n[t][""]+n[t].rtl:"string"==typeof n[t]?i.innerHTML=n[t]:null!=(e=i.value||"")&&n[t][e]&&(i.innerHTML=n[t][e])))})})}},{key:"buildPickers",value:function(t,i){var e=this;this.pickers=t.map(function(t){if(t.classList.contains("ql-align"))return null==t.querySelector("option")&&E(t,b),new u.default(t,i.align);if(t.classList.contains("ql-background")||t.classList.contains("ql-color")){var e=t.classList.contains("ql-background")?"background":"color";return null==t.querySelector("option")&&E(t,y,"background"==e?"#ffffff":"#000000"),new h.default(t,i[e])}return null==t.querySelector("option")&&(t.classList.contains("ql-font")?E(t,x):t.classList.contains("ql-header")?E(t,w):t.classList.contains("ql-size")&&E(t,k)),new d.default(t)}),this.quill.on(s.default.events.EDITOR_CHANGE,function(){e.pickers.forEach(function(t){t.update()})})}}]),A);function A(i,t){g(this,A);var n=v(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,i,t));return i.emitter.listenDOM("click",document.body,function t(e){if(!document.body.contains(i.root))return document.body.removeEventListener("click",t);null==n.tooltip||n.tooltip.root.contains(e.target)||document.activeElement===n.tooltip.textbox||n.quill.hasFocus()||n.tooltip.hide(),null!=n.pickers&&n.pickers.forEach(function(t){t.container.contains(e.target)||t.close()})}),n}C.DEFAULTS=(0,a.default)(!0,{},c.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var i=this,n=this.container.querySelector("input.ql-image[type=file]");null==n&&((n=document.createElement("input")).setAttribute("type","file"),n.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),n.classList.add("ql-image"),n.addEventListener("change",function(){var t;null!=n.files&&null!=n.files[0]&&((t=new FileReader).onload=function(t){var e=i.quill.getSelection(!0);i.quill.updateContents((new r.default).retain(e.index).delete(e.length).insert({image:t.target.result}),s.default.sources.USER),i.quill.setSelection(e.index+1,s.default.sources.SILENT),n.value=""},t.readAsDataURL(n.files[0]))}),this.container.appendChild(n)),n.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var S=(m(T,f.default),n(T,[{key:"listen",value:function(){var e=this;this.textbox.addEventListener("keydown",function(t){l.default.match(t,"enter")?(e.save(),t.preventDefault()):l.default.match(t,"escape")&&(e.cancel(),t.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(t,e){var i=0<arguments.length&&void 0!==t?t:"link",n=1<arguments.length&&void 0!==e?e:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=n?this.textbox.value=n:i!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+i)||""),this.root.setAttribute("data-mode",i)}},{key:"restoreFocus",value:function(){var t=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=t}},{key:"save",value:function(){var t=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var e=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,s.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,s.default.sources.USER)),this.quill.root.scrollTop=e;break;case"video":t=function(t){var e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?(e[1]||"https")+"://www.youtube.com/embed/"+e[2]+"?showinfo=0":(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(e[1]||"https")+"://player.vimeo.com/video/"+e[2]+"/":t}(t);case"formula":if(!t)break;var i,n=this.quill.getSelection(!0);null!=n&&(i=n.index+n.length,this.quill.insertEmbed(i,this.root.getAttribute("data-mode"),t,s.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(i+1," ",s.default.sources.USER),this.quill.setSelection(i+2,s.default.sources.USER))}this.textbox.value="",this.hide()}}]),T);function T(t,e){g(this,T);var i=v(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,t,e));return i.textbox=i.root.querySelector('input[type="text"]'),i.listen(),i}function E(i,t,e){var n=2<arguments.length&&void 0!==e&&e;t.forEach(function(t){var e=document.createElement("option");t===n?e.setAttribute("selected","selected"):e.setAttribute("value",t),i.appendChild(e)})}e.BaseTooltip=S,e.default=C},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=(o.prototype.append=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.insertBefore(t[0],null),1<t.length&&this.append.apply(this,t.slice(1))},o.prototype.contains=function(t){for(var e,i=this.iterator();e=i();)if(e===t)return!0;return!1},o.prototype.insertBefore=function(t,e){t&&(null!=(t.next=e)?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?((this.tail.next=t).prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)},o.prototype.offset=function(t){for(var e=0,i=this.head;null!=i;){if(i===t)return e;e+=i.length(),i=i.next}return-1},o.prototype.remove=function(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),--this.length)},o.prototype.iterator=function(e){return void 0===e&&(e=this.head),function(){var t=e;return null!=e&&(e=e.next),t}},o.prototype.find=function(t,e){void 0===e&&(e=!1);for(var i,n=this.iterator();i=n();){var o=i.length();if(t<o||e&&t===o&&(null==i.next||0!==i.next.length()))return[i,t];t-=o}return[null,0]},o.prototype.forEach=function(t){for(var e,i=this.iterator();e=i();)t(e)},o.prototype.forEachAt=function(t,e,i){if(!(e<=0))for(var n,o=this.find(t),a=o[0],r=t-o[1],s=this.iterator(a);(n=s())&&r<t+e;){var l=n.length();r<t?i(n,t-r,Math.min(e,r+l-t)):i(n,0,Math.min(l,t+e-r)),r+=l}},o.prototype.map=function(i){return this.reduce(function(t,e){return t.push(i(e)),t},[])},o.prototype.reduce=function(t,e){for(var i,n=this.iterator();i=n();)e=t(e,i);return e},o);function o(){this.head=this.tail=null,this.length=0}e.default=n},function(t,e,i){var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var l,c=i(17),h=i(1),a={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},r=(l=c.default,o(s,l),s.prototype.detach=function(){l.prototype.detach.call(this),this.observer.disconnect()},s.prototype.deleteAt=function(t,e){this.update(),0===t&&e===this.length()?this.children.forEach(function(t){t.remove()}):l.prototype.deleteAt.call(this,t,e)},s.prototype.formatAt=function(t,e,i,n){this.update(),l.prototype.formatAt.call(this,t,e,i,n)},s.prototype.insertAt=function(t,e,i){this.update(),l.prototype.insertAt.call(this,t,e,i)},s.prototype.optimize=function(t,i){var n=this;void 0===t&&(t=[]),void 0===i&&(i={}),l.prototype.optimize.call(this,i);for(var e=[].slice.call(this.observer.takeRecords());0<e.length;)t.push(e.pop());for(var o=function t(e,i){void 0===i&&(i=!0),null!=e&&e!==n&&null!=e.domNode.parentNode&&(null==e.domNode[h.DATA_KEY].mutations&&(e.domNode[h.DATA_KEY].mutations=[]),i&&t(e.parent))},a=function t(e){null!=e.domNode[h.DATA_KEY]&&null!=e.domNode[h.DATA_KEY].mutations&&(e instanceof c.default&&e.children.forEach(t),e.optimize(i))},r=t,s=0;0<r.length;s+=1){if(100<=s)throw new Error("[Parchment] Maximum optimize iterations reached");for(r.forEach(function(t){var e=h.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(o(h.find(t.previousSibling,!1)),[].forEach.call(t.addedNodes,function(t){var e=h.find(t,!1);o(e,!1),e instanceof c.default&&e.children.forEach(function(t){o(t,!1)})})):"attributes"===t.type&&o(e.prev)),o(e))}),this.children.forEach(a),e=(r=[].slice.call(this.observer.takeRecords())).slice();0<e.length;)t.push(e.pop())}},s.prototype.update=function(t,e){var i=this;void 0===e&&(e={}),(t=t||this.observer.takeRecords()).map(function(t){var e=h.find(t.target,!0);return null==e?null:null==e.domNode[h.DATA_KEY].mutations?(e.domNode[h.DATA_KEY].mutations=[t],e):(e.domNode[h.DATA_KEY].mutations.push(t),null)}).forEach(function(t){null!=t&&t!==i&&null!=t.domNode[h.DATA_KEY]&&t.update(t.domNode[h.DATA_KEY].mutations||[],e)}),null!=this.domNode[h.DATA_KEY].mutations&&l.prototype.update.call(this,this.domNode[h.DATA_KEY].mutations,e),this.optimize(t,e)},s.blotName="scroll",s.defaultChild="block",s.scope=h.Scope.BLOCK_BLOT,s.tagName="DIV",s);function s(t){var e=l.call(this,t)||this;return(e.scroll=e).observer=new MutationObserver(function(t){e.update(t)}),e.observer.observe(e.domNode,a),e.attach(),e}e.default=r},function(t,e,i){var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var a=i(18),r=i(1);var s,l=(s=a.default,o(c,s),c.formats=function(t){if(t.tagName!==c.tagName)return s.formats.call(this,t)},c.prototype.format=function(t,e){var i=this;t!==this.statics.blotName||e?s.prototype.format.call(this,t,e):(this.children.forEach(function(t){t instanceof a.default||(t=t.wrap(c.blotName,!0)),i.attributes.copy(t)}),this.unwrap())},c.prototype.formatAt=function(t,e,i,n){null!=this.formats()[i]||r.query(i,r.Scope.ATTRIBUTE)?this.isolate(t,e).format(i,n):s.prototype.formatAt.call(this,t,e,i,n)},c.prototype.optimize=function(t){s.prototype.optimize.call(this,t);var e=this.formats();if(0===Object.keys(e).length)return this.unwrap();var i=this.next;i instanceof c&&i.prev===this&&function(t,e){if(Object.keys(t).length===Object.keys(e).length){for(var i in t)if(t[i]!==e[i])return;return 1}}(e,i.formats())&&(i.moveChildren(this),i.remove())},c.blotName="inline",c.scope=r.Scope.INLINE_BLOT,c.tagName="SPAN",c);function c(){return null!==s&&s.apply(this,arguments)||this}e.default=l},function(t,e,i){var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var a,r=i(18),s=i(1),l=(a=r.default,o(c,a),c.formats=function(t){var e=s.query(c.blotName).tagName;if(t.tagName!==e)return a.formats.call(this,t)},c.prototype.format=function(t,e){null!=s.query(t,s.Scope.BLOCK)&&(t!==this.statics.blotName||e?a.prototype.format.call(this,t,e):this.replaceWith(c.blotName))},c.prototype.formatAt=function(t,e,i,n){null!=s.query(i,s.Scope.BLOCK)?this.format(i,n):a.prototype.formatAt.call(this,t,e,i,n)},c.prototype.insertAt=function(t,e,i){var n,o;null==i||null!=s.query(e,s.Scope.INLINE)?a.prototype.insertAt.call(this,t,e,i):(n=this.split(t),o=s.create(e,i),n.parent.insertBefore(o,n))},c.prototype.update=function(t,e){navigator.userAgent.match(/Trident/)?this.build():a.prototype.update.call(this,t,e)},c.blotName="block",c.scope=s.Scope.BLOCK_BLOT,c.tagName="P",c);function c(){return null!==a&&a.apply(this,arguments)||this}e.default=l},function(t,e,i){var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var a,r=i(19),s=(a=r.default,o(l,a),l.formats=function(t){},l.prototype.format=function(t,e){a.prototype.formatAt.call(this,0,this.length(),t,e)},l.prototype.formatAt=function(t,e,i,n){0===t&&e===this.length()?this.format(i,n):a.prototype.formatAt.call(this,t,e,i,n)},l.prototype.formats=function(){return this.statics.formats(this.domNode)},l);function l(){return null!==a&&a.apply(this,arguments)||this}e.default=s},function(t,e,i){var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var a,r=i(19),s=i(1),l=(a=r.default,o(c,a),c.create=function(t){return document.createTextNode(t)},c.value=function(t){var e=t.data;return e.normalize&&(e=e.normalize()),e},c.prototype.deleteAt=function(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)},c.prototype.index=function(t,e){return this.domNode===t?e:-1},c.prototype.insertAt=function(t,e,i){null==i?(this.text=this.text.slice(0,t)+e+this.text.slice(t),this.domNode.data=this.text):a.prototype.insertAt.call(this,t,e,i)},c.prototype.length=function(){return this.text.length},c.prototype.optimize=function(t){a.prototype.optimize.call(this,t),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof c&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},c.prototype.position=function(t,e){return void 0===e&&(e=!1),[this.domNode,t]},c.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var i=s.create(this.domNode.splitText(t));return this.parent.insertBefore(i,this.next),this.text=this.statics.value(this.domNode),i},c.prototype.update=function(t,e){var i=this;t.some(function(t){return"characterData"===t.type&&t.target===i.domNode})&&(this.text=this.statics.value(this.domNode))},c.prototype.value=function(){return this.text},c.blotName="text",c.scope=s.Scope.INLINE_BLOT,c);function c(t){var e=a.call(this,t)||this;return e.text=e.statics.value(e.domNode),e}e.default=l},function(t,e,i){var n,o=document.createElement("div");o.classList.toggle("test-class",!1),o.classList.contains("test-class")&&(n=DOMTokenList.prototype.toggle,DOMTokenList.prototype.toggle=function(t,e){return 1<arguments.length&&!this.contains(t)==!e?e:n.call(this,t)}),String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return e=e||0,this.substr(e,t.length)===t}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){var i=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>i.length)&&(e=i.length),e-=t.length;var n=i.indexOf(t,e);return-1!==n&&n===e}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,i=Object(this),n=i.length>>>0,o=arguments[1],a=0;a<n;a++)if(e=i[a],t.call(o,e,a,i))return e}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(t,e){var S=-1,T=1,p=0;function g(t,e,i){if(t==e)return t?[[p,t]]:[];(i<0||t.length<i)&&(i=null);var n=v(t,e),o=t.substring(0,n),n=m(t=t.substring(n),e=e.substring(n)),a=t.substring(t.length-n),r=function(t,e){var i;if(!t)return[[T,e]];if(!e)return[[S,t]];var n=t.length>e.length?t:e,o=t.length>e.length?e:t,a=n.indexOf(o);if(-1!=a)return i=[[T,n.substring(0,a)],[p,o],[T,n.substring(a+o.length)]],t.length>e.length&&(i[0][0]=i[2][0]=S),i;if(1==o.length)return[[S,t],[T,e]];var r=function(t,e){var i=t.length>e.length?t:e,n=t.length>e.length?e:t;if(i.length<4||2*n.length<i.length)return null;function o(t,e,i){for(var n,o,a,r,s=t.substring(i,i+Math.floor(t.length/4)),l=-1,c="";-1!=(l=e.indexOf(s,l+1));){var h=v(t.substring(i),e.substring(l)),u=m(t.substring(0,i),e.substring(0,l));c.length<u+h&&(c=e.substring(l-u,l)+e.substring(l,l+h),n=t.substring(0,i-u),o=t.substring(i+h),a=e.substring(0,l-u),r=e.substring(l+h))}return 2*c.length>=t.length?[n,o,a,r,c]:null}var a,r,s,l,c,h=o(i,n,Math.ceil(i.length/4)),u=o(i,n,Math.ceil(i.length/2));{if(!h&&!u)return null;a=!u||h&&h[4].length>u[4].length?h:u}t.length>e.length?(r=a[0],s=a[1],l=a[2],c=a[3]):(l=a[0],c=a[1],r=a[2],s=a[3]);var d=a[4];return[r,s,l,c,d]}(t,e);if(r){var s=r[0],l=r[1],c=r[2],h=r[3],u=r[4],d=g(s,c),f=g(l,h);return d.concat([[p,u]],f)}return function(t,e){for(var i=t.length,n=e.length,o=Math.ceil((i+n)/2),a=o,r=2*o,s=new Array(r),l=new Array(r),c=0;c<r;c++)s[c]=-1,l[c]=-1;s[a+1]=0,l[a+1]=0;for(var h=i-n,u=h%2!=0,d=0,f=0,p=0,g=0,v=0;v<o;v++){for(var m=-v+d;m<=v-f;m+=2){for(var b,y=a+m,x=(A=m==-v||m!=v&&s[y-1]<s[y+1]?s[y+1]:s[y-1]+1)-m;A<i&&x<n&&t.charAt(A)==e.charAt(x);)A++,x++;if(s[y]=A,i<A)f+=2;else if(n<x)d+=2;else if(u){if(0<=(k=a+h-m)&&k<r&&-1!=l[k])if((b=i-l[k])<=A)return E(t,e,A,x)}}for(var w=-v+p;w<=v-g;w+=2){for(var k=a+w,C=(b=w==-v||w!=v&&l[k-1]<l[k+1]?l[k+1]:l[k-1]+1)-w;b<i&&C<n&&t.charAt(i-b-1)==e.charAt(n-C-1);)b++,C++;if(l[k]=b,i<b)g+=2;else if(n<C)p+=2;else if(!u){if(0<=(y=a+h-w)&&y<r&&-1!=s[y]){var A=s[y],x=a+A-y;if((b=i-b)<=A)return E(t,e,A,x)}}}}return[[S,t],[T,e]]}(t,e)}(t=t.substring(0,t.length-n),e=e.substring(0,e.length-n));return o&&r.unshift([p,o]),a&&r.push([p,a]),function t(e){e.push([p,""]);var i=0;var n=0;var o=0;var a="";var r="";var s;for(;i<e.length;)switch(e[i][0]){case T:o++,r+=e[i][1],i++;break;case S:n++,a+=e[i][1],i++;break;case p:1<n+o?(0!==n&&0!==o&&(0!==(s=v(r,a))&&(0<i-n-o&&e[i-n-o-1][0]==p?e[i-n-o-1][1]+=r.substring(0,s):(e.splice(0,0,[p,r.substring(0,s)]),i++),r=r.substring(s),a=a.substring(s)),0!==(s=m(r,a))&&(e[i][1]=r.substring(r.length-s)+e[i][1],r=r.substring(0,r.length-s),a=a.substring(0,a.length-s))),0===n?e.splice(i-o,n+o,[T,r]):0===o?e.splice(i-n,n+o,[S,a]):e.splice(i-n-o,n+o,[S,a],[T,r]),i=i-n-o+(n?1:0)+(o?1:0)+1):0!==i&&e[i-1][0]==p?(e[i-1][1]+=e[i][1],e.splice(i,1)):i++,n=o=0,r=a=""}""===e[e.length-1][1]&&e.pop();var l=!1;i=1;for(;i<e.length-1;)e[i-1][0]==p&&e[i+1][0]==p&&(e[i][1].substring(e[i][1].length-e[i-1][1].length)==e[i-1][1]?(e[i][1]=e[i-1][1]+e[i][1].substring(0,e[i][1].length-e[i-1][1].length),e[i+1][1]=e[i-1][1]+e[i+1][1],e.splice(i-1,1),l=!0):e[i][1].substring(0,e[i+1][1].length)==e[i+1][1]&&(e[i-1][1]+=e[i+1][1],e[i][1]=e[i][1].substring(e[i+1][1].length)+e[i+1][1],e.splice(i+1,1),l=!0)),i++;l&&t(e)}(r),null!=i&&(r=function(t,e){var i=function(t,e){if(0===e)return[p,t];for(var i=0,n=0;n<t.length;n++){var o=t[n];if(o[0]===S||o[0]===p){var a=i+o[1].length;if(e===a)return[n+1,t];if(e<a){t=t.slice();var r=e-i,s=[o[0],o[1].slice(0,r)],l=[o[0],o[1].slice(r)];return t.splice(n,1,s,l),[n+1,t]}i=a}}throw new Error("cursor_pos is out of bounds!")}(t,e),n=i[1],o=i[0],a=n[o],r=n[o+1];{if(null==a)return t;if(a[0]!==p)return t;if(null!=r&&a[1]+r[1]===r[1]+a[1])return n.splice(o,2,r,a),l(n,o,2);if(null==r||0!==r[1].indexOf(a[1]))return t;n.splice(o,2,[r[0],a[1]],[0,a[1]]);var s=r[1].slice(a[1].length);return 0<s.length&&n.splice(o+2,0,[r[0],s]),l(n,o,3)}}(r,i)),r=function(t){for(var e=!1,i=function(t){return 56320<=t.charCodeAt(0)&&t.charCodeAt(0)<=57343},n=2;n<t.length;n+=1)t[n-2][0]===p&&function(t){return 55296<=t.charCodeAt(t.length-1)&&t.charCodeAt(t.length-1)<=56319}(t[n-2][1])&&t[n-1][0]===S&&i(t[n-1][1])&&t[n][0]===T&&i(t[n][1])&&(e=!0,t[n-1][1]=t[n-2][1].slice(-1)+t[n-1][1],t[n][1]=t[n-2][1].slice(-1)+t[n][1],t[n-2][1]=t[n-2][1].slice(0,-1));if(!e)return t;for(var o=[],n=0;n<t.length;n+=1)0<t[n][1].length&&o.push(t[n]);return o}(r)}function E(t,e,i,n){var o=t.substring(0,i),a=e.substring(0,n),r=t.substring(i),s=e.substring(n),l=g(o,a),c=g(r,s);return l.concat(c)}function v(t,e){if(!t||!e||t.charAt(0)!=e.charAt(0))return 0;for(var i=0,n=Math.min(t.length,e.length),o=n,a=0;i<o;)t.substring(a,o)==e.substring(a,o)?a=i=o:n=o,o=Math.floor((n-i)/2+i);return o}function m(t,e){if(!t||!e||t.charAt(t.length-1)!=e.charAt(e.length-1))return 0;for(var i=0,n=Math.min(t.length,e.length),o=n,a=0;i<o;)t.substring(t.length-o,t.length-a)==e.substring(e.length-o,e.length-a)?a=i=o:n=o,o=Math.floor((n-i)/2+i);return o}var i=g;function l(t,e,i){for(var n,o,a=e+i-1;0<=a&&e-1<=a;a--){a+1<t.length&&(n=t[a],o=t[a+1],n[0]===o[1]&&t.splice(a,2,[n[0],n[1]+o[1]]))}return t}i.INSERT=T,i.DELETE=S,i.EQUAL=p,t.exports=i},function(t,e){function i(t){var e=[];for(var i in t)e.push(i);return e}(t.exports="function"==typeof Object.keys?Object.keys:i).shim=i},function(t,e){var i="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();function n(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function o(t){return t&&"object"==_typeof2(t)&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}(e=t.exports=i?n:o).supported=n,e.unsupported=o},function(t,e){var n=Object.prototype.hasOwnProperty,f="~";function c(){}function a(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function i(){this._events=new c,this._eventsCount=0}Object.create&&(c.prototype=Object.create(null),(new c).__proto__||(f=!1)),i.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)n.call(t,e)&&i.push(f?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},i.prototype.listeners=function(t,e){var i=f?f+t:t,n=this._events[i];if(e)return!!n;if(!n)return[];if(n.fn)return[n.fn];for(var o=0,a=n.length,r=new Array(a);o<a;o++)r[o]=n[o].fn;return r},i.prototype.emit=function(t,e,i,n,o,a){var r=f?f+t:t;if(!this._events[r])return!1;var s,l=this._events[r],c=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,i),!0;case 4:return l.fn.call(l.context,e,i,n),!0;case 5:return l.fn.call(l.context,e,i,n,o),!0;case 6:return l.fn.call(l.context,e,i,n,o,a),!0}for(d=1,s=new Array(c-1);d<c;d++)s[d-1]=arguments[d];l.fn.apply(l.context,s)}else for(var h,u=l.length,d=0;d<u;d++)switch(l[d].once&&this.removeListener(t,l[d].fn,void 0,!0),c){case 1:l[d].fn.call(l[d].context);break;case 2:l[d].fn.call(l[d].context,e);break;case 3:l[d].fn.call(l[d].context,e,i);break;case 4:l[d].fn.call(l[d].context,e,i,n);break;default:if(!s)for(h=1,s=new Array(c-1);h<c;h++)s[h-1]=arguments[h];l[d].fn.apply(l[d].context,s)}return!0},i.prototype.on=function(t,e,i){var n=new a(e,i||this),o=f?f+t:t;return this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],n]:this._events[o].push(n):(this._events[o]=n,this._eventsCount++),this},i.prototype.once=function(t,e,i){var n=new a(e,i||this,!0),o=f?f+t:t;return this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],n]:this._events[o].push(n):(this._events[o]=n,this._eventsCount++),this},i.prototype.removeListener=function(t,e,i,n){var o=f?f+t:t;if(!this._events[o])return this;if(!e)return 0==--this._eventsCount?this._events=new c:delete this._events[o],this;var a=this._events[o];if(a.fn)a.fn!==e||n&&!a.once||i&&a.context!==i||(0==--this._eventsCount?this._events=new c:delete this._events[o]);else{for(var r=0,s=[],l=a.length;r<l;r++)(a[r].fn!==e||n&&!a[r].once||i&&a[r].context!==i)&&s.push(a[r]);s.length?this._events[o]=1===s.length?s[0]:s:0==--this._eventsCount?this._events=new c:delete this._events[o]}return this},i.prototype.removeAllListeners=function(t){var e;return t?(e=f?f+t:t,this._events[e]&&(0==--this._eventsCount?this._events=new c:delete this._events[e])):(this._events=new c,this._eventsCount=0),this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prototype.setMaxListeners=function(){return this},i.prefixed=f,i.EventEmitter=i,void 0!==t&&(t.exports=i)},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.matchText=e.matchSpacing=e.matchNewline=e.matchBlot=e.matchAttributor=e.default=void 0;var o="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(t){return _typeof2(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":_typeof2(t)},l=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var i=[],n=!0,o=!1,a=void 0;try{for(var r,s=t[Symbol.iterator]();!(n=(r=s.next()).done)&&(i.push(r.value),!e||i.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return i}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=function(t,e,i){return e&&a(t.prototype,e),i&&a(t,i),t};function a(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var r=x(i(3)),c=x(i(2)),s=x(i(0)),h=x(i(5)),u=x(i(10)),d=x(i(9)),f=i(36),p=i(37),g=x(i(13)),v=i(26),m=i(38),b=i(39),y=i(40);function x(t){return t&&t.__esModule?t:{default:t}}function w(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var k=(0,u.default)("quill:clipboard"),C="__ql-matcher",A=[[Node.TEXT_NODE,j],[Node.TEXT_NODE,R],["br",function(t,e){P(e,"\n")||e.insert("\n");return e}],[Node.ELEMENT_NODE,R],[Node.ELEMENT_NODE,D],[Node.ELEMENT_NODE,z],[Node.ELEMENT_NODE,M],[Node.ELEMENT_NODE,function(t,e){var i={},n=t.style||{};n.fontStyle&&"italic"===L(t).fontStyle&&(i.italic=!0);n.fontWeight&&(L(t).fontWeight.startsWith("bold")||700<=parseInt(L(t).fontWeight))&&(i.bold=!0);0<Object.keys(i).length&&(e=O(e,i));0<parseFloat(n.textIndent||0)&&(e=(new c.default).insert("\t").concat(e));return e}],["li",function(t,e){var i=s.default.query(t);if(null==i||"list-item"!==i.blotName||!P(e,"\n"))return e;var n=-1,o=t.parentNode;for(;!o.classList.contains("ql-clipboard");)"list"===(s.default.query(o)||{}).blotName&&(n+=1),o=o.parentNode;return n<=0?e:e.compose((new c.default).retain(e.length()-1).retain(1,{indent:n}))}],["b",I.bind(I,"bold")],["i",I.bind(I,"italic")],["style",function(){return new c.default}]],S=[f.AlignAttribute,m.DirectionAttribute].reduce(function(t,e){return t[e.keyName]=e,t},{}),T=[f.AlignStyle,p.BackgroundStyle,v.ColorStyle,m.DirectionStyle,b.FontStyle,y.SizeStyle].reduce(function(t,e){return t[e.keyName]=e,t},{}),E=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(_,d.default),n(_,[{key:"addMatcher",value:function(t,e){this.matchers.push([t,e])}},{key:"convert",value:function(t){if("string"==typeof t)return this.container.innerHTML=t.replace(/\>\r?\n +\</g,"><"),this.convert();var e=this.quill.getFormat(this.quill.selection.savedRange.index);if(e[g.default.blotName]){var i=this.container.innerText;return this.container.innerHTML="",(new c.default).insert(i,w({},g.default.blotName,e[g.default.blotName]))}var n=this.prepareMatching(),o=l(n,2),a=o[0],r=o[1],s=function n(o,a,r){return o.nodeType===o.TEXT_NODE?r.reduce(function(t,e){return e(o,t)},new c.default):o.nodeType===o.ELEMENT_NODE?[].reduce.call(o.childNodes||[],function(t,i){var e=n(i,a,r);return i.nodeType===o.ELEMENT_NODE&&(e=a.reduce(function(t,e){return e(i,t)},e),e=(i[C]||[]).reduce(function(t,e){return e(i,t)},e)),t.concat(e)},new c.default):new c.default}(this.container,a,r);return P(s,"\n")&&null==s.ops[s.ops.length-1].attributes&&(s=s.compose((new c.default).retain(s.length()-1).delete(1))),k.log("convert",this.container.innerHTML,s),this.container.innerHTML="",s}},{key:"dangerouslyPasteHTML",value:function(t,e,i){var n,o=2<arguments.length&&void 0!==i?i:h.default.sources.API;"string"==typeof t?(this.quill.setContents(this.convert(t),e),this.quill.setSelection(0,h.default.sources.SILENT)):(n=this.convert(e),this.quill.updateContents((new c.default).retain(t).concat(n),o),this.quill.setSelection(t+n.length(),h.default.sources.SILENT))}},{key:"onPaste",value:function(t){var e,i,n,o=this;!t.defaultPrevented&&this.quill.isEnabled()&&(e=this.quill.getSelection(),i=(new c.default).retain(e.index),n=this.quill.scrollingContainer.scrollTop,this.container.focus(),this.quill.selection.update(h.default.sources.SILENT),setTimeout(function(){i=i.concat(o.convert()).delete(e.length),o.quill.updateContents(i,h.default.sources.USER),o.quill.setSelection(i.length()-e.length,h.default.sources.SILENT),o.quill.scrollingContainer.scrollTop=n,o.quill.focus()},1))}},{key:"prepareMatching",value:function(){var o=this,a=[],r=[];return this.matchers.forEach(function(t){var e=l(t,2),i=e[0],n=e[1];switch(i){case Node.TEXT_NODE:r.push(n);break;case Node.ELEMENT_NODE:a.push(n);break;default:[].forEach.call(o.container.querySelectorAll(i),function(t){t[C]=t[C]||[],t[C].push(n)})}}),[a,r]}}]),_);function _(t,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,_);var a=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,t,o));return a.quill.root.addEventListener("paste",a.onPaste.bind(a)),a.container=a.quill.addContainer("ql-clipboard"),a.container.setAttribute("contenteditable",!0),a.container.setAttribute("tabindex",-1),a.matchers=[],A.concat(a.options.matchers).forEach(function(t){var e=l(t,2),i=e[0],n=e[1];!o.matchVisual&&n===z||a.addMatcher(i,n)}),a}function O(t,i,n){return"object"===(void 0===i?"undefined":o(i))?Object.keys(i).reduce(function(t,e){return O(t,e,i[e])},t):t.reduce(function(t,e){return e.attributes&&e.attributes[i]?t.push(e):t.insert(e.insert,(0,r.default)({},w({},i,n),e.attributes))},new c.default)}function L(t){if(t.nodeType!==Node.ELEMENT_NODE)return{};var e="__ql-computed-style";return t[e]||(t[e]=window.getComputedStyle(t))}function P(t,e){for(var i="",n=t.ops.length-1;0<=n&&i.length<e.length;--n){var o=t.ops[n];if("string"!=typeof o.insert)break;i=o.insert+i}return i.slice(-1*e.length)===e}function N(t){if(0!==t.childNodes.length){var e=L(t);return-1<["block","list-item"].indexOf(e.display)}}function I(t,e,i){return O(i,t,!0)}function M(i,t){var e=s.default.Attributor.Attribute.keys(i),n=s.default.Attributor.Class.keys(i),o=s.default.Attributor.Style.keys(i),a={};return e.concat(n).concat(o).forEach(function(t){var e=s.default.query(t,s.default.Scope.ATTRIBUTE);null!=e&&(a[e.attrName]=e.value(i),a[e.attrName])||(null==(e=S[t])||e.attrName!==t&&e.keyName!==t||(a[e.attrName]=e.value(i)||void 0),null==(e=T[t])||e.attrName!==t&&e.keyName!==t||(e=T[t],a[e.attrName]=e.value(i)||void 0))}),0<Object.keys(a).length&&(t=O(t,a)),t}function D(t,e){var i,n,o=s.default.query(t);return null==o||(o.prototype instanceof s.default.Embed?(i={},null!=(n=o.value(t))&&(i[o.blotName]=n,e=(new c.default).insert(i,o.formats(t)))):"function"==typeof o.formats&&(e=O(e,o.blotName,o.formats(t)))),e}function R(t,e){return P(e,"\n")||(N(t)||0<e.length()&&t.nextSibling&&N(t.nextSibling))&&e.insert("\n"),e}function z(t,e){var i;return N(t)&&null!=t.nextElementSibling&&!P(e,"\n\n")&&(i=t.offsetHeight+parseFloat(L(t).marginTop)+parseFloat(L(t).marginBottom),t.nextElementSibling.offsetTop>t.offsetTop+1.5*i&&e.insert("\n")),e}function j(t,e){var i,n=t.data;return"O:P"===t.parentNode.tagName?e.insert(n.trim()):0===n.trim().length&&t.parentNode.classList.contains("ql-clipboard")?e:(L(t.parentNode).whiteSpace.startsWith("pre")||(i=function(t,e){return(e=e.replace(/[^\u00a0]/g,"")).length<1&&t?" ":e},n=(n=n.replace(/\r\n/g," ").replace(/\n/g," ")).replace(/\s\s+/g,i.bind(i,!0)),(null==t.previousSibling&&N(t.parentNode)||null!=t.previousSibling&&N(t.previousSibling))&&(n=n.replace(/^\s+/,i.bind(i,!1))),(null==t.nextSibling&&N(t.parentNode)||null!=t.nextSibling&&N(t.nextSibling))&&(n=n.replace(/\s+$/,i.bind(i,!1)))),e.insert(n))}E.DEFAULTS={matchers:[],matchVisual:!0},e.default=E,e.matchAttributor=M,e.matchBlot=D,e.matchNewline=R,e.matchSpacing=z,e.matchText=j},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:r(o,e,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}var a,s=i(6);var l=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(c,((a=s)&&a.__esModule?a:{default:a}).default),n(c,[{key:"optimize",value:function(t){r(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"optimize",this).call(this,t),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return r(c.__proto__||Object.getPrototypeOf(c),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),c);function c(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(c.__proto__||Object.getPrototypeOf(c)).apply(this,arguments))}l.blotName="bold",l.tagName=["STRONG","B"],e.default=l},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.addControls=e.default=void 0;var u=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var i=[],n=!0,o=!1,a=void 0;try{for(var r,s=t[Symbol.iterator]();!(n=(r=s.next()).done)&&(i.push(r.value),!e||i.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return i}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var d=s(i(2)),f=s(i(0)),p=s(i(5)),a=s(i(10)),r=s(i(9));function s(t){return t&&t.__esModule?t:{default:t}}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}var g=(0,a.default)("quill:toolbar"),c=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(h,r.default),n(h,[{key:"addHandler",value:function(t,e){this.handlers[t]=e}},{key:"attach",value:function(l){var c=this,h=[].find.call(l.classList,function(t){return 0===t.indexOf("ql-")});if(h){if(h=h.slice("ql-".length),"BUTTON"===l.tagName&&l.setAttribute("type","button"),null==this.handlers[h]){if(null!=this.quill.scroll.whitelist&&null==this.quill.scroll.whitelist[h])return void g.warn("ignoring attaching to disabled format",h,l);if(null==f.default.query(h))return void g.warn("ignoring attaching to nonexistent format",h,l)}var t="SELECT"===l.tagName?"change":"click";l.addEventListener(t,function(t){var e=void 0;if("SELECT"===l.tagName){if(l.selectedIndex<0)return;var i=l.options[l.selectedIndex],e=!i.hasAttribute("selected")&&i.value||!1}else e=!l.classList.contains("ql-active")&&(l.value||!l.hasAttribute("value")),t.preventDefault();c.quill.focus();var n,o,a,r=c.quill.selection.getRange(),s=u(r,1)[0];if(null!=c.handlers[h])c.handlers[h].call(c,e);else if(f.default.query(h).prototype instanceof f.default.Embed){if(!(e=prompt("Enter "+h)))return;c.quill.updateContents((new d.default).retain(s.index).delete(s.length).insert((a=e,(o=h)in(n={})?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a,n)),p.default.sources.USER)}else c.quill.format(h,e,p.default.sources.USER);c.update(s)}),this.controls.push([h,l])}}},{key:"update",value:function(s){var l=null==s?{}:this.quill.getFormat(s);this.controls.forEach(function(t){var e,i,n,o=u(t,2),a=o[0],r=o[1];"SELECT"===r.tagName?(e=void 0,null==s?e=null:null==l[a]?e=r.querySelector("option[selected]"):Array.isArray(l[a])||("string"==typeof(i=l[a])&&(i=i.replace(/\"/g,'\\"')),e=r.querySelector('option[value="'+i+'"]')),null==e?(r.value="",r.selectedIndex=-1):e.selected=!0):null==s?r.classList.remove("ql-active"):r.hasAttribute("value")?(n=l[a]===r.getAttribute("value")||null!=l[a]&&l[a].toString()===r.getAttribute("value")||null==l[a]&&!r.getAttribute("value"),r.classList.toggle("ql-active",n)):r.classList.toggle("ql-active",null!=l[a])})}}]),h);function h(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h);var i,n=l(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,t,e));if(Array.isArray(n.options.container)?(m(i=document.createElement("div"),n.options.container),t.container.parentNode.insertBefore(i,t.container),n.container=i):"string"==typeof n.options.container?n.container=document.querySelector(n.options.container):n.container=n.options.container,n.container instanceof HTMLElement)return n.container.classList.add("ql-toolbar"),n.controls=[],n.handlers={},Object.keys(n.options.handlers).forEach(function(t){n.addHandler(t,n.options.handlers[t])}),[].forEach.call(n.container.querySelectorAll("button, select"),function(t){n.attach(t)}),n.quill.on(p.default.events.EDITOR_CHANGE,function(t,e){t===p.default.events.SELECTION_CHANGE&&n.update(e)}),n.quill.on(p.default.events.SCROLL_OPTIMIZE,function(){var t=n.quill.selection.getRange(),e=u(t,1)[0];n.update(e)}),n;var o=g.error("Container required for toolbar",n.options);return l(n,o)}function v(t,e,i){var n=document.createElement("button");n.setAttribute("type","button"),n.classList.add("ql-"+e),null!=i&&(n.value=i),t.appendChild(n)}function m(e,t){Array.isArray(t[0])||(t=[t]),t.forEach(function(t){var s=document.createElement("span");s.classList.add("ql-formats"),t.forEach(function(t){var e,i,n,o,a,r;"string"==typeof t?v(s,t):(i=t[e=Object.keys(t)[0]],Array.isArray(i)?(n=s,o=e,a=i,(r=document.createElement("select")).classList.add("ql-"+o),a.forEach(function(t){var e=document.createElement("option");!1!==t?e.setAttribute("value",t):e.setAttribute("selected","selected"),r.appendChild(e)}),n.appendChild(r)):v(s,e,i))}),e.appendChild(s)})}c.DEFAULTS={},c.DEFAULTS={container:null,handlers:{clean:function(){var t,e=this,i=this.quill.getSelection();null!=i&&(0==i.length?(t=this.quill.getFormat(),Object.keys(t).forEach(function(t){null!=f.default.query(t,f.default.Scope.INLINE)&&e.quill.format(t,!1)})):this.quill.removeFormat(i,p.default.sources.USER))},direction:function(t){var e=this.quill.getFormat().align;"rtl"===t&&null==e?this.quill.format("align","right",p.default.sources.USER):t||"right"!==e||this.quill.format("align",!1,p.default.sources.USER),this.quill.format("direction",t,p.default.sources.USER)},indent:function(t){var e,i=this.quill.getSelection(),n=this.quill.getFormat(i),o=parseInt(n.indent||0);"+1"!==t&&"-1"!==t||(e="+1"===t?1:-1,"rtl"===n.direction&&(e*=-1),this.quill.format("indent",o+e,p.default.sources.USER))},link:function(t){!0===t&&(t=prompt("Enter link URL:")),this.quill.format("link",t,p.default.sources.USER)},list:function(t){var e=this.quill.getSelection(),i=this.quill.getFormat(e);"check"===t?"checked"===i.list||"unchecked"===i.list?this.quill.format("list",!1,p.default.sources.USER):this.quill.format("list","unchecked",p.default.sources.USER):this.quill.format("list",t,p.default.sources.USER)}}},e.default=c,e.addControls=m},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:r(o,e,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}var a,s=i(28);var l=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(c,((a=s)&&a.__esModule?a:{default:a}).default),n(c,[{key:"buildItem",value:function(t){var e=r(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"buildItem",this).call(this,t);return e.style.backgroundColor=t.getAttribute("value")||"",e}},{key:"selectItem",value:function(t,e){r(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"selectItem",this).call(this,t,e);var i=this.label.querySelector(".ql-color-label"),n=t&&t.getAttribute("data-value")||"";i&&("line"===i.tagName?i.style.stroke=n:i.style.fill=n)}}]),c);function c(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,t));return i.label.innerHTML=e,i.container.classList.add("ql-color-picker"),[].slice.call(i.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(t){t.classList.add("ql-primary")}),i}e.default=l},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a,r=i(28);var s=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(l,((a=r)&&a.__esModule?a:{default:a}).default),n(l,[{key:"selectItem",value:function(t,e){(function t(e,i,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,i);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,i,n)}if("value"in o)return o.value;var r=o.get;return void 0!==r?r.call(n):void 0})(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"selectItem",this).call(this,t,e),t=t||this.defaultItem,this.label.innerHTML=t.innerHTML}}]),l);function l(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,t));return i.container.classList.add("ql-icon-picker"),[].forEach.call(i.container.querySelectorAll(".ql-picker-item"),function(t){t.innerHTML=e[t.getAttribute("data-value")||""]}),i.defaultItem=i.container.querySelector(".ql-selected"),i.selectItem(i.defaultItem),i}e.default=s},function(t,e,i){function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}Object.defineProperty(e,"__esModule",{value:!0});var o=(function(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}(a,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(t){var e=t.left+t.width/2-this.root.offsetWidth/2,i=t.bottom+this.quill.root.scrollTop;this.root.style.left=e+"px",this.root.style.top=i+"px",this.root.classList.remove("ql-flip");var n,o,a=this.boundsContainer.getBoundingClientRect(),r=this.root.getBoundingClientRect(),s=0;return r.right>a.right&&(s=a.right-r.right,this.root.style.left=e+s+"px"),r.left<a.left&&(s=a.left-r.left,this.root.style.left=e+s+"px"),r.bottom>a.bottom&&(n=r.bottom-r.top,o=t.bottom-t.top+n,this.root.style.top=i-o+"px",this.root.classList.add("ql-flip")),s}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),a);function a(t,e){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),this.quill=t,this.boundsContainer=e||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){i.root.style.marginTop=-1*i.quill.root.scrollTop+"px"}),this.hide()}e.default=o},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});function r(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:r(o,e,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}var c=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var i=[],n=!0,o=!1,a=void 0;try{for(var r,s=t[Symbol.iterator]();!(n=(r=s.next()).done)&&(i.push(r.value),!e||i.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return i}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a=p(i(3)),h=p(i(8)),s=i(43),l=p(s),u=p(i(27)),d=i(15),f=p(i(41));function p(t){return t&&t.__esModule?t:{default:t}}function g(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}function m(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var b=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],y=(m(x,l.default),n(x,[{key:"extendToolbar",value:function(i){i.container.classList.add("ql-snow"),this.buildButtons([].slice.call(i.container.querySelectorAll("button")),f.default),this.buildPickers([].slice.call(i.container.querySelectorAll("select")),f.default),this.tooltip=new w(this.quill,this.options.bounds),i.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(t,e){i.handlers.link.call(i,!e.format.link)})}}]),x);function x(t,e){g(this,x),null!=e.modules.toolbar&&null==e.modules.toolbar.container&&(e.modules.toolbar.container=b);var i=v(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,t,e));return i.quill.container.classList.add("ql-snow"),i}y.DEFAULTS=(0,a.default)(!0,{},l.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(t){if(t){var e=this.quill.getSelection();if(null==e||0==e.length)return;var i=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(i)&&0!==i.indexOf("mailto:")&&(i="mailto:"+i),this.quill.theme.tooltip.edit("link",i)}else this.quill.format("link",!1)}}}}});var w=(m(k,s.BaseTooltip),n(k,[{key:"listen",value:function(){var l=this;r(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(t){l.root.classList.contains("ql-editing")?l.save():l.edit("link",l.preview.textContent),t.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(t){var e;null!=l.linkRange&&(e=l.linkRange,l.restoreFocus(),l.quill.formatText(e,"link",!1,h.default.sources.USER),delete l.linkRange),t.preventDefault(),l.hide()}),this.quill.on(h.default.events.SELECTION_CHANGE,function(t,e,i){if(null!=t){if(0===t.length&&i===h.default.sources.USER){var n=l.quill.scroll.descendant(u.default,t.index),o=c(n,2),a=o[0],r=o[1];if(null!=a){l.linkRange=new d.Range(t.index-r,a.length());var s=u.default.formats(a.domNode);return l.preview.textContent=s,l.preview.setAttribute("href",s),l.show(),void l.position(l.quill.getBounds(l.linkRange))}}else delete l.linkRange;l.hide()}})}},{key:"show",value:function(){r(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),k);function k(t,e){g(this,k);var i=v(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,t,e));return i.preview=i.root.querySelector("a.ql-preview"),i}w.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),e.default=y},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=D(i(29)),o=i(36),a=i(38),r=i(64),s=D(i(65)),l=D(i(66)),c=i(67),h=D(c),u=i(37),d=i(26),f=i(39),p=i(40),g=D(i(56)),v=D(i(68)),m=D(i(27)),b=D(i(69)),y=D(i(70)),x=D(i(71)),w=D(i(72)),k=D(i(73)),C=i(13),A=D(C),S=D(i(74)),T=D(i(75)),E=D(i(57)),_=D(i(41)),O=D(i(28)),L=D(i(59)),P=D(i(60)),N=D(i(61)),I=D(i(108)),M=D(i(62));function D(t){return t&&t.__esModule?t:{default:t}}n.default.register({"attributors/attribute/direction":a.DirectionAttribute,"attributors/class/align":o.AlignClass,"attributors/class/background":u.BackgroundClass,"attributors/class/color":d.ColorClass,"attributors/class/direction":a.DirectionClass,"attributors/class/font":f.FontClass,"attributors/class/size":p.SizeClass,"attributors/style/align":o.AlignStyle,"attributors/style/background":u.BackgroundStyle,"attributors/style/color":d.ColorStyle,"attributors/style/direction":a.DirectionStyle,"attributors/style/font":f.FontStyle,"attributors/style/size":p.SizeStyle},!0),n.default.register({"formats/align":o.AlignClass,"formats/direction":a.DirectionClass,"formats/indent":r.IndentClass,"formats/background":u.BackgroundStyle,"formats/color":d.ColorStyle,"formats/font":f.FontClass,"formats/size":p.SizeClass,"formats/blockquote":s.default,"formats/code-block":A.default,"formats/header":l.default,"formats/list":h.default,"formats/bold":g.default,"formats/code":C.Code,"formats/italic":v.default,"formats/link":m.default,"formats/script":b.default,"formats/strike":y.default,"formats/underline":x.default,"formats/image":w.default,"formats/video":k.default,"formats/list/item":c.ListItem,"modules/formula":S.default,"modules/syntax":T.default,"modules/toolbar":E.default,"themes/bubble":I.default,"themes/snow":M.default,"ui/icons":_.default,"ui/picker":O.default,"ui/icon-picker":P.default,"ui/color-picker":L.default,"ui/tooltip":N.default},!0),e.default=n.default},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.IndentClass=void 0;var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:r(o,e,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}var a,s=i(0),l=(a=s)&&a.__esModule?a:{default:a};function c(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(c.__proto__||Object.getPrototypeOf(c)).apply(this,arguments))}var h=new(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(c,l.default.Attributor.Class),n(c,[{key:"add",value:function(t,e){var i;return"+1"!==e&&"-1"!==e||(i=this.value(t)||0,e="+1"===e?i+1:i-1),0===e?(this.remove(t),!0):r(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"add",this).call(this,t,e)}},{key:"canAdd",value:function(t,e){return r(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"canAdd",this).call(this,t,e)||r(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"canAdd",this).call(this,t,parseInt(e))}},{key:"value",value:function(t){return parseInt(r(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"value",this).call(this,t))||void 0}}]),c)("indent","ql-indent",{scope:l.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});e.IndentClass=h},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n,o=i(4);var a=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,((n=o)&&n.__esModule?n:{default:n}).default),r);function r(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}a.blotName="blockquote",a.tagName="blockquote",e.default=a},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a,r=i(4);var s=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(l,((a=r)&&a.__esModule?a:{default:a}).default),n(l,null,[{key:"formats",value:function(t){return this.tagName.indexOf(t.tagName)+1}}]),l);function l(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}s.blotName="header",s.tagName=["H1","H2","H3","H4","H5","H6"],e.default=s},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.ListItem=void 0;var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:r(o,e,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}var a=c(i(0)),s=c(i(4)),l=c(i(25));function c(t){return t&&t.__esModule?t:{default:t}}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}function d(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var f=(d(p,s.default),n(p,[{key:"format",value:function(t,e){t!==g.blotName||e?r(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,t,e):this.replaceWith(a.default.create(this.statics.scope))}},{key:"remove",value:function(){null==this.prev&&null==this.next?this.parent.remove():r(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(t,e){return this.parent.isolate(this.offset(this.parent),this.length()),t===this.parent.statics.blotName?(this.parent.replaceWith(t,e),this):(this.parent.unwrap(),r(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"replaceWith",this).call(this,t,e))}}],[{key:"formats",value:function(t){return t.tagName===this.tagName?void 0:r(p.__proto__||Object.getPrototypeOf(p),"formats",this).call(this,t)}}]),p);function p(){return h(this,p),u(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}f.blotName="list-item",f.tagName="LI";var g=(d(v,l.default),n(v,null,[{key:"create",value:function(t){var e="ordered"===t?"OL":"UL",i=r(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this,e);return"checked"!==t&&"unchecked"!==t||i.setAttribute("data-checked","checked"===t),i}},{key:"formats",value:function(t){return"OL"===t.tagName?"ordered":"UL"===t.tagName?t.hasAttribute("data-checked")?"true"===t.getAttribute("data-checked")?"checked":"unchecked":"bullet":void 0}}]),n(v,[{key:"format",value:function(t,e){0<this.children.length&&this.children.tail.format(t,e)}},{key:"formats",value:function(){return t={},e=this.statics.blotName,i=this.statics.formats(this.domNode),e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t;var t,e,i}},{key:"insertBefore",value:function(t,e){var i,n;t instanceof f?r(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertBefore",this).call(this,t,e):(i=null==e?this.length():e.offset(this),(n=this.split(i)).parent.insertBefore(t,n))}},{key:"optimize",value:function(t){r(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"optimize",this).call(this,t);var e=this.next;null!=e&&e.prev===this&&e.statics.blotName===this.statics.blotName&&e.domNode.tagName===this.domNode.tagName&&e.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(e.moveChildren(this),e.remove())}},{key:"replace",value:function(t){var e;t.statics.blotName!==this.statics.blotName&&(e=a.default.create(this.statics.defaultChild),t.moveChildren(e),this.appendChild(e)),r(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"replace",this).call(this,t)}}]),v);function v(n){h(this,v);function t(t){var e,i;t.target.parentNode===n&&(e=o.statics.formats(n),i=a.default.find(t.target),"checked"===e?i.format("list","unchecked"):"unchecked"===e&&i.format("list","checked"))}var o=u(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,n));return n.addEventListener("touchstart",t),n.addEventListener("mousedown",t),o}g.blotName="list",g.scope=a.default.Scope.BLOCK_BLOT,g.tagName=["OL","UL"],g.defaultChild="list-item",g.allowedChildren=[f],e.ListItem=f,e.default=g},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n,o=i(56);var a=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,((n=o)&&n.__esModule?n:{default:n}).default),r);function r(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}a.blotName="italic",a.tagName=["EM","I"],e.default=a},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a,r=i(6);var s=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(l,((a=r)&&a.__esModule?a:{default:a}).default),n(l,null,[{key:"create",value:function(t){return"super"===t?document.createElement("sup"):"sub"===t?document.createElement("sub"):function t(e,i,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,i);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,i,n)}if("value"in o)return o.value;var r=o.get;return void 0!==r?r.call(n):void 0}(l.__proto__||Object.getPrototypeOf(l),"create",this).call(this,t)}},{key:"formats",value:function(t){return"SUB"===t.tagName?"sub":"SUP"===t.tagName?"super":void 0}}]),l);function l(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}s.blotName="script",s.tagName=["SUB","SUP"],e.default=s},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n,o=i(6);var a=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,((n=o)&&n.__esModule?n:{default:n}).default),r);function r(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}a.blotName="strike",a.tagName="S",e.default=a},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n,o=i(6);var a=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,((n=o)&&n.__esModule?n:{default:n}).default),r);function r(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}a.blotName="underline",a.tagName="U",e.default=a},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:r(o,e,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}var a,s=i(0),l=(a=s)&&a.__esModule?a:{default:a},c=i(27);var h=["alt","height","width"],u=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(d,l.default.Embed),n(d,[{key:"format",value:function(t,e){-1<h.indexOf(t)?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):r(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"format",this).call(this,t,e)}}],[{key:"create",value:function(t){var e=r(d.__proto__||Object.getPrototypeOf(d),"create",this).call(this,t);return"string"==typeof t&&e.setAttribute("src",this.sanitize(t)),e}},{key:"formats",value:function(i){return h.reduce(function(t,e){return i.hasAttribute(e)&&(t[e]=i.getAttribute(e)),t},{})}},{key:"match",value:function(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}},{key:"sanitize",value:function(t){return(0,c.sanitize)(t,["http","https","data"])?t:"//:0"}},{key:"value",value:function(t){return t.getAttribute("src")}}]),d);function d(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,d),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}u.blotName="image",u.tagName="IMG",e.default=u},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:r(o,e,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}var a,s=i(4),l=i(27),c=(a=l)&&a.__esModule?a:{default:a};var h=["height","width"],u=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(d,s.BlockEmbed),n(d,[{key:"format",value:function(t,e){-1<h.indexOf(t)?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):r(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"format",this).call(this,t,e)}}],[{key:"create",value:function(t){var e=r(d.__proto__||Object.getPrototypeOf(d),"create",this).call(this,t);return e.setAttribute("frameborder","0"),e.setAttribute("allowfullscreen",!0),e.setAttribute("src",this.sanitize(t)),e}},{key:"formats",value:function(i){return h.reduce(function(t,e){return i.hasAttribute(e)&&(t[e]=i.getAttribute(e)),t},{})}},{key:"sanitize",value:function(t){return c.default.sanitize(t)}},{key:"value",value:function(t){return t.getAttribute("src")}}]),d);function d(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,d),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}u.blotName="video",u.className="ql-video",u.tagName="IFRAME",e.default=u},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.FormulaBlot=void 0;var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a=l(i(35)),r=l(i(5)),s=l(i(9));function l(t){return t&&t.__esModule?t:{default:t}}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var d=(u(f,a.default),n(f,null,[{key:"create",value:function(t){var e=function t(e,i,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,i);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,i,n)}if("value"in o)return o.value;var r=o.get;return void 0!==r?r.call(n):void 0}(f.__proto__||Object.getPrototypeOf(f),"create",this).call(this,t);return"string"==typeof t&&(window.katex.render(t,e,{throwOnError:!1,errorColor:"#f00"}),e.setAttribute("data-value",t)),e}},{key:"value",value:function(t){return t.getAttribute("data-value")}}]),f);function f(){return c(this,f),h(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}d.blotName="formula",d.className="ql-formula",d.tagName="SPAN";var p=(u(g,s.default),n(g,null,[{key:"register",value:function(){r.default.register(d,!0)}}]),g);function g(){c(this,g);var t=h(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));if(null==window.katex)throw new Error("Formula module requires KaTeX.");return t}e.FormulaBlot=d,e.default=p},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.CodeToken=e.CodeBlock=void 0;var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a=l(i(0)),r=l(i(5)),s=l(i(9));function l(t){return t&&t.__esModule?t:{default:t}}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var d=(u(f,l(i(13)).default),n(f,[{key:"replaceWith",value:function(t){this.domNode.textContent=this.domNode.textContent,this.attach(),function t(e,i,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,i);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,i,n)}if("value"in o)return o.value;var r=o.get;return void 0!==r?r.call(n):void 0}(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"replaceWith",this).call(this,t)}},{key:"highlight",value:function(t){var e=this.domNode.textContent;this.cachedText!==e&&((0<e.trim().length||null==this.cachedText)&&(this.domNode.innerHTML=t(e),this.domNode.normalize(),this.attach()),this.cachedText=e)}}]),f);function f(){return c(this,f),h(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}d.className="ql-syntax";var p=new a.default.Attributor.Class("token","hljs",{scope:a.default.Scope.INLINE}),g=(u(v,s.default),n(v,null,[{key:"register",value:function(){r.default.register(p,!0),r.default.register(d,!0)}}]),n(v,[{key:"highlight",value:function(){var t,e=this;this.quill.selection.composing||(this.quill.update(r.default.sources.USER),t=this.quill.getSelection(),this.quill.scroll.descendants(d).forEach(function(t){t.highlight(e.options.highlight)}),this.quill.update(r.default.sources.SILENT),null!=t&&this.quill.setSelection(t,r.default.sources.SILENT))}}]),v);function v(t,e){c(this,v);var i=h(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,t,e));if("function"!=typeof i.options.highlight)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var n=null;return i.quill.on(r.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(n),n=setTimeout(function(){i.highlight(),n=null},i.options.interval)}),i.highlight(),i}g.DEFAULTS={highlight:null==window.hljs?null:function(t){return window.hljs.highlightAuto(t).value},interval:1e3},e.CodeBlock=d,e.CodeToken=p,e.default=g},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(t,e){t.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(t,e){t.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(t,e){t.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(t,e){t.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(t,e){t.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BubbleTooltip=void 0;function r(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:r(o,e,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}var n=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t};function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a=d(i(3)),h=d(i(8)),s=i(43),l=d(s),u=i(15),c=d(i(41));function d(t){return t&&t.__esModule?t:{default:t}}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==_typeof2(e)&&"function"!=typeof e?t:e}function g(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof2(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var v=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],m=(g(b,l.default),n(b,[{key:"extendToolbar",value:function(t){this.tooltip=new y(this.quill,this.options.bounds),this.tooltip.root.appendChild(t.container),this.buildButtons([].slice.call(t.container.querySelectorAll("button")),c.default),this.buildPickers([].slice.call(t.container.querySelectorAll("select")),c.default)}}]),b);function b(t,e){f(this,b),null!=e.modules.toolbar&&null==e.modules.toolbar.container&&(e.modules.toolbar.container=v);var i=p(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,t,e));return i.quill.container.classList.add("ql-bubble"),i}m.DEFAULTS=(0,a.default)(!0,{},l.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(t){t?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var y=(g(x,s.BaseTooltip),n(x,[{key:"listen",value:function(){var e=this;r(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){e.root.classList.remove("ql-editing")}),this.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){var t;e.root.classList.contains("ql-hidden")||null!=(t=e.quill.getSelection())&&e.position(e.quill.getBounds(t))},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(t){var e=r(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"position",this).call(this,t),i=this.root.querySelector(".ql-tooltip-arrow");if(i.style.marginLeft="",0===e)return e;i.style.marginLeft=-1*e-i.offsetWidth/2+"px"}}]),x);function x(t,e){f(this,x);var c=p(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,t,e));return c.quill.on(h.default.events.EDITOR_CHANGE,function(t,e,i,n){var o,a,r,s,l;t===h.default.events.SELECTION_CHANGE&&(null!=e&&0<e.length&&n===h.default.sources.USER?(c.show(),c.root.style.left="0px",c.root.style.width="",c.root.style.width=c.root.offsetWidth+"px",1===(o=c.quill.getLines(e.index,e.length)).length?c.position(c.quill.getBounds(e)):(a=o[o.length-1],r=c.quill.getIndex(a),s=Math.min(a.length()-1,e.index+e.length-r),l=c.quill.getBounds(new u.Range(r,s)),c.position(l))):document.activeElement!==c.textbox&&c.quill.hasFocus()&&c.hide())}),c}y.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),e.BubbleTooltip=y,e.default=m},function(t,e,i){t.exports=i(63)}],n.c=o,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=109).default;function n(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return i[t].call(e.exports,e,e.exports,n),e.l=!0,e.exports}var i,o}),function(){function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),i}var e,i,n;"".trim||(String.prototype.trim=function(){return this.replace(/^[\s﻿]+|[\s﻿]+$/g,"")}),window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(t,e){if(null==this)throw new TypeError('"this" is null or not defined');var i=Object(this),n=i.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var o=e,a=0;a<n;){var r=i[a];if(t.call(o,r,a,i))return a;a++}return-1},configurable:!0,writable:!0}),String.prototype.includes||(String.prototype.includes=function(t,e){return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),n=1;n<arguments.length;n++){var o=arguments[n];if(null!=o)for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(i[a]=o[a])}return i},writable:!0,configurable:!0}),t.prototype=window.Event.prototype,"function"!=typeof window.CustomEvent&&(window.CustomEvent=t),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){var e=this;if(!document.documentElement.contains(e))return null;do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}),document.execCommand("AutoUrlDetect",!1,!1),"document"in self&&("classList"in document.createElement("_")&&(!document.createElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg","g"))||function(t){if("Element"in t){var e="classList",i="prototype",n=t.Element[i],o=Object,a=String[i].trim||function(){return this.replace(/^\s+|\s+$/g,"")},r=Array[i].indexOf||function(t){for(var e=0,i=this.length;e<i;e++)if(e in this&&this[e]===t)return e;return-1},s=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},l=function(t,e){if(""===e)throw new s("SYNTAX_ERR","The token must not be empty.");if(/\s/.test(e))throw new s("INVALID_CHARACTER_ERR","The token must not contain space characters.");return r.call(t,e)},c=function(t){for(var e=a.call(t.getAttribute("class")||""),i=e?e.split(/\s+/):[],n=0,o=i.length;n<o;n++)this.push(i[n]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},h=c[i]=[],u=function(){return new c(this)};if(s[i]=Error[i],h.item=function(t){return this[t]||null},h.contains=function(t){return~l(this,t+"")},h.add=function(){for(var t,e=arguments,i=0,n=e.length,o=!1;~l(this,t=e[i]+"")||(this.push(t),o=!0),++i<n;);o&&this._updateClassName()},h.remove=function(){var t,e,i=arguments,n=0,o=i.length,a=!1;do{for(e=l(this,t=i[n]+"");~e;)this.splice(e,1),a=!0,e=l(this,t)}while(++n<o);a&&this._updateClassName()},h.toggle=function(t,e){var i=this.contains(t),n=i?!0!==e&&"remove":!1!==e&&"add";return n&&this[n](t),!0===e||!1===e?e:!i},h.replace=function(t,e){var i=l(t+"");~i&&(this.splice(i,1,e),this._updateClassName())},h.toString=function(){return this.join(" ")},o.defineProperty){var d={get:u,enumerable:!0,configurable:!0};try{o.defineProperty(n,e,d)}catch(t){void 0!==t.number&&-2146823252!==t.number||(d.enumerable=!1,o.defineProperty(n,e,d))}}else o[i].__defineGetter__&&n.__defineGetter__(e,u)}}(self),(n=document.createElement("_")).classList.add("c1","c2"),n.classList.contains("c2")||((e=function(t){var n=DOMTokenList.prototype[t];DOMTokenList.prototype[t]=function(t){for(var e=arguments.length,i=0;i<e;i++)t=arguments[i],n.call(this,t)}})("add"),e("remove")),n.classList.toggle("c3",!1),n.classList.contains("c3")&&(i=DOMTokenList.prototype.toggle,DOMTokenList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)==!e?e:i.call(this,t)}),"replace"in document.createElement("_").classList||(DOMTokenList.prototype.replace=function(t,e){var i=this.toString().split(" "),n=i.indexOf(t+"");~n&&(i=i.slice(n),this.remove.apply(this,i),this.add(e),this.add.apply(this,i.slice(1)))}),n=null),window.Promise=function(){function l(t){return"function"==typeof t}var i=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},n=0,e=void 0,o=void 0,r=function(t,e){d[n]=t,d[n+1]=e,2===(n+=2)&&(o?o(f):b())};var t="undefined"!=typeof window?window:void 0,a=t||{},s=a.MutationObserver||a.WebKitMutationObserver,c="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function u(){var t=setTimeout;return function(){return t(f,1)}}var d=new Array(1e3);function f(){for(var t=0;t<n;t+=2){(0,d[t])(d[t+1]),d[t]=void 0,d[t+1]=void 0}n=0}var p,g,v,m,b=void 0;function y(t,e){var i=this,n=new this.constructor(k);void 0===n[w]&&R(n);var o,a=i._state;return a?(o=arguments[a-1],r(function(){return M(a,n,o,i._result)})):N(i,n,t,e),n}function x(t){if(t&&"object"===_typeof2(t)&&t.constructor===this)return t;var e=new this(k);return _(e,t),e}b=c?function(){return process.nextTick(f)}:s?(g=0,v=new s(f),m=document.createTextNode(""),v.observe(m,{characterData:!0}),function(){m.data=g=++g%2}):h?((p=new MessageChannel).port1.onmessage=f,function(){return p.port2.postMessage(0)}):(void 0===t&&"function"==typeof require?function(){try{var t=Function("return this")().require("vertx");return void 0!==(e=t.runOnLoop||t.runOnContext)?function(){e(f)}:u()}catch(t){return u()}}:u)();var w=Math.random().toString(36).substring(2);function k(){}var C=void 0,A=1,S=2;function T(t,n,o){r(function(e){var i=!1,t=function(t,e,i,n){try{t.call(e,i,n)}catch(t){return t}}(o,n,function(t){i||(i=!0,(n!==t?_:L)(e,t))},function(t){i||(i=!0,P(e,t))},e._label);!i&&t&&(i=!0,P(e,t))},t)}function E(t,e,i){var n,o;e.constructor===t.constructor&&i===y&&e.constructor.resolve===x?(n=t,(o=e)._state===A?L(n,o._result):o._state===S?P(n,o._result):N(o,void 0,function(t){return _(n,t)},function(t){return P(n,t)})):void 0!==i&&l(i)?T(t,e,i):L(t,e)}function _(t,e){if(t===e)P(t,new TypeError("You cannot resolve a promise with itself"));else if(o=_typeof2(n=e),null===n||"object"!==o&&"function"!==o)L(t,e);else{var i=void 0;try{i=e.then}catch(e){return void P(t,e)}E(t,e,i)}var n,o}function O(t){t._onerror&&t._onerror(t._result),I(t)}function L(t,e){t._state===C&&(t._result=e,t._state=A,0!==t._subscribers.length&&r(I,t))}function P(t,e){t._state===C&&(t._state=S,t._result=e,r(O,t))}function N(t,e,i,n){var o=t._subscribers,a=o.length;t._onerror=null,o[a]=e,o[a+A]=i,o[a+S]=n,0===a&&t._state&&r(I,t)}function I(t){var e=t._subscribers,i=t._state;if(0!==e.length){for(var n=void 0,o=void 0,a=t._result,r=0;r<e.length;r+=3)n=e[r],o=e[r+i],n?M(i,n,o,a):o(a);t._subscribers.length=0}}function M(t,e,i,n){var o=l(i),a=void 0,r=void 0,s=!0;if(o){try{a=i(n)}catch(t){s=!1,r=t}if(e===a)return void P(e,new TypeError("A promises callback cannot return that same promise."))}else a=n;e._state!==C||(o&&s?_(e,a):!1===s?P(e,r):t===A?L(e,a):t===S&&P(e,a))}var D=0;function R(t){t[w]=D++,t._state=void 0,t._result=void 0,t._subscribers=[]}var z=(j.prototype._enumerate=function(t){for(var e=0;this._state===C&&e<t.length;e++)this._eachEntry(t[e],e)},j.prototype._eachEntry=function(e,t){var i=this._instanceConstructor,n=i.resolve;if(n===x){var o,a=void 0,r=void 0,s=!1;try{a=e.then}catch(t){s=!0,r=t}a===y&&e._state!==C?this._settledAt(e._state,t,e._result):"function"!=typeof a?(this._remaining--,this._result[t]=e):i===B?(o=new i(k),s?P(o,r):E(o,e,a),this._willSettleAt(o,t)):this._willSettleAt(new i(function(t){return t(e)}),t)}else this._willSettleAt(n(e),t)},j.prototype._settledAt=function(t,e,i){var n=this.promise;n._state===C&&(this._remaining--,t===S?P(n,i):this._result[e]=i),0===this._remaining&&L(n,this._result)},j.prototype._willSettleAt=function(t,e){var i=this;N(t,void 0,function(t){return i._settledAt(A,e,t)},function(t){return i._settledAt(S,e,t)})},j);function j(t,e){this._instanceConstructor=t,this.promise=new t(k),this.promise[w]||R(this.promise),i(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?L(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&L(this.promise,this._result))):P(this.promise,new Error("Array Methods must be provided an Array"))}var B=(F.prototype.catch=function(t){return this.then(null,t)},F.prototype.finally=function(e){var i=this.constructor;return l(e)?this.then(function(t){return i.resolve(e()).then(function(){return t})},function(t){return i.resolve(e()).then(function(){throw t})}):this.then(e,e)},F);function F(t){this[w]=D++,this._result=this._state=void 0,this._subscribers=[],k!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof F?function(e,t){try{t(function(t){_(e,t)},function(t){P(e,t)})}catch(t){P(e,t)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return B.prototype.then=y,B.all=function(t){return new z(this,t).promise},B.race=function(o){var a=this;return i(o)?new a(function(t,e){for(var i=o.length,n=0;n<i;n++)a.resolve(o[n]).then(t,e)}):new a(function(t,e){return e(new TypeError("You must pass an array to race."))})},B.resolve=x,B.reject=function(t){var e=new this(k);return P(e,t),e},B._setScheduler=function(t){o=t},B._setAsap=function(t){r=t},B._asap=r,B.polyfill=function(){var t=void 0;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var i=null;try{i=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===i&&!e.cast)return}t.Promise=B},B.Promise=B}()}(),function(t){"function"==typeof define&&define.amd?define([],t):"object"==("undefined"==typeof exports?"undefined":_typeof2(exports))?module.exports=t():(void 0).Tagify=t()}(function(){function e(e,t){var i,n=Object.keys(e);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(e),t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)),n}function d(o){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?e(a,!0).forEach(function(t){var e,i,n;e=o,n=a[i=t],i in e?Object.defineProperty(e,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[i]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(a)):e(a).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(a,t))})}return o}function f(t){return function(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var i="undefined"!=typeof InstallTrigger;function p(t){var e=Object.prototype.toString.call(t).split(" ")[1].slice(0,-1);return t===Object(t)&&"Array"!=e&&"Function"!=e&&"RegExp"!=e&&"HTMLUnknownElement"!=e}function c(t){var e=document.createElement("div");return t.replace(/\&#?[0-9a-z]+;/gi,function(t){return e.innerHTML=t,e.innerText})}function o(t){return(new DOMParser).parseFromString(t.trim(),"text/html").body.firstElementChild}function g(t){return t?t.replace(/\>[\r\n ]+\</g,"><").replace(/(<.*?>)|\s+/g,function(t,e){return e||" "}):""}function a(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/`|'/g,"&#039;")}function h(t,e,i){function n(t,e){for(var i in e)e.hasOwnProperty(i)&&(p(e[i])?p(t[i])?n(t[i],e[i]):t[i]=Object.assign({},e[i]):t[i]=e[i])}return t instanceof Object||(t={}),n(t,e),i&&n(t,i),t}function v(t){return String.prototype.normalize?"string"==typeof t?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):void 0:t}function t(t,e){if(!t)return console.warn("Tagify: ","invalid input element ",t),this;this.applySettings(t,e||{}),this.state={editing:!1,actions:{},mixMode:{},dropdown:{},flaggedTags:{}},this.value=[],this.listeners={},this.DOM={},h(this,new this.EventDispatcher(this)),this.build(t),this.getCSSVars(),this.loadOriginalValues(),this.events.customBinding.call(this),this.events.binding.call(this),t.autofocus&&this.DOM.input.focus()}return(t.prototype={isIE:window.document.documentMode,TEXTS:{empty:"empty",exceed:"number of tags exceeded",pattern:"pattern mismatch",duplicate:"already exists",notAllowed:"not allowed"},DEFAULTS:{delimiters:",",pattern:null,maxTags:1/0,callbacks:{},addTagOnBlur:!0,duplicates:!1,whitelist:[],blacklist:[],enforceWhitelist:!1,keepInvalidTags:!1,mixTagsAllowedAfter:/,|\.|\:|\s/,mixTagsInterpolator:["[[","]]"],backspace:!0,skipInvalid:!1,editTags:2,transformTag:function(){},autoComplete:{enabled:!0,rightKey:!1},dropdown:{classname:"",enabled:2,maxItems:10,searchKeys:[],fuzzySearch:!0,accentedSearch:!0,highlightFirst:!1,closeOnSelect:!0,position:"all"},hooks:{beforeRemoveTag:function(){return Promise.resolve()}}},templates:{wrapper:function(t,e){return'<tags class="tagify '.concat(e.mode?"tagify--"+e.mode:""," ").concat(t.className,'"\n                        ').concat(e.readonly?"readonly":"",'\n                        tabIndex="-1">\n                <span contenteditable data-placeholder="').concat(e.placeholder||"&#8203;",'" aria-placeholder="').concat(e.placeholder||"",'"\n                    class="tagify__input"\n                    role="textbox"\n                    aria-autocomplete="both"\n                    aria-multiline="').concat("mix"==e.mode,'"></span>\n            </tags>')},tag:function(t,e){return'<tag title="'.concat(e.title||t,"\"\n                        contenteditable='false'\n                        spellcheck='false'\n                        tabIndex=\"-1\"\n                        class=\"tagify__tag ").concat(e.class?e.class:"",'"\n                        ').concat(this.getAttributes(e),">\n                <x title='' class='tagify__tag__removeBtn' role='button' aria-label='remove tag'></x>\n                <div>\n                    <span class='tagify__tag-text'>").concat(t,"</span>\n                </div>\n            </tag>")},dropdown:function(t){var e=t.dropdown,i="".concat("manual"==e.position?"":"tagify__dropdown tagify__dropdown--".concat(e.position)," ").concat(e.classname).trim();return'<div class="'.concat(i,'" role="listbox" aria-labelledby="dropdown">\n                        <div class="tagify__dropdown__wrapper"></div>\n                    </div>')},dropdownItem:function(t){return"<div ".concat(this.getAttributes(t),"\n                        class='tagify__dropdown__item ").concat(t.class?t.class:"",'\'\n                        tabindex="0"\n                        role="option">').concat(t.value,"</div>")}},customEventsList:["add","remove","invalid","input","click","keydown","focus","blur","edit:input","edit:updated","edit:start","edit:keydown","dropdown:show","dropdown:hide","dropdown:select"],applySettings:function(i,t){var n=this;if(this.DEFAULTS.templates=this.templates,this.settings=h({},this.DEFAULTS,t),this.settings.readonly=i.hasAttribute("readonly"),this.settings.placeholder=i.getAttribute("placeholder")||this.settings.placeholder||"",this.isIE&&(this.settings.autoComplete=!1),["whitelist","blacklist"].forEach(function(t){var e=i.getAttribute("data-"+t);e&&(e=e.split(n.settings.delimiters))instanceof Array&&(n.settings[t]=e)}),"autoComplete"in t&&!p(t.autoComplete)&&(this.settings.autoComplete=this.DEFAULTS.autoComplete,this.settings.autoComplete.enabled=t.autoComplete),i.pattern)try{this.settings.pattern=new RegExp(i.pattern)}catch(t){}if(this.settings.delimiters)try{this.settings.delimiters=new RegExp(this.settings.delimiters,"g")}catch(t){}"select"==this.settings.mode&&(this.settings.dropdown.enabled=0),"mix"==this.settings.mode&&(this.settings.autoComplete.rightKey=!0)},getAttributes:function(t){if("[object Object]"!=Object.prototype.toString.call(t))return"";for(var e,i=Object.keys(t),n="",o=i.length;o--;)"class"!=(e=i[o])&&t.hasOwnProperty(e)&&t[e]&&(n+=" "+e+(t[e]?'="'.concat(t[e],'"'):""));return n},getCaretGlobalPosition:function(){var t=document.getSelection();if(t.rangeCount){var e,i,n=t.getRangeAt(0),o=n.startContainer,a=n.startOffset;return 0<a?((i=document.createRange()).setStart(o,a-1),i.setEnd(o,a),{left:(e=i.getBoundingClientRect()).right,top:e.top,bottom:e.bottom}):o.getBoundingClientRect()}return{left:-9999,top:-9999}},getCSSVars:function(){var t,e,i=getComputedStyle(this.DOM.scope,null);this.CSSVars={tagHideTransition:(e=(t=function(t){if(!t)return{};var e=(t=t.trim().split(" ")[0]).split(/\d+/g).filter(function(t){return t}).pop().trim();return{value:+t.split(e).filter(function(t){return t})[0].trim(),unit:e}}(i.getPropertyValue("--tag-hide-transition"))).value,"s"==t.unit?1e3*e:e)}},build:function(t){var e=this.DOM,i=this.settings.templates.wrapper(t,this.settings);e.originalInput=t,e.scope=o(i),e.input=e.scope.querySelector("[contenteditable]"),t.parentNode.insertBefore(e.scope,t),0<=this.settings.dropdown.enabled&&this.dropdown.init.call(this)},destroy:function(){this.DOM.scope.parentNode.removeChild(this.DOM.scope),this.dropdown.hide.call(this,!0),clearTimeout(this.dropdownHide__bindEventsTimeout)},loadOriginalValues:function(t){if(t=t||this.DOM.originalInput.value)if(this.removeAllTags(),"mix"==this.settings.mode)this.parseMixTags(t.trim());else{try{"string"!=typeof JSON.parse(t)&&(t=JSON.parse(t))}catch(t){}this.addTags(t).forEach(function(t){return t&&t.classList.add("tagify--noAnim")})}},cloneEvent:function(t){var e={};for(var i in t)e[i]=t[i];return e},EventDispatcher:function(o){var a=document.createTextNode("");function i(e,t,i){i&&t.split(/\s+/g).forEach(function(t){return a[e+"EventListener"].call(a,t,i)})}this.off=function(t,e){return i("remove",t,e),this},this.on=function(t,e){return e&&"function"==typeof e&&i("add",t,e),this},this.trigger=function(t,e){var i;if(t)if(o.settings.isJQueryPlugin)"remove"==t&&(t="removeTag"),jQuery(o.DOM.originalInput).triggerHandler(t,[e]);else{try{var n=h({},e);n.tagify=this,i=new CustomEvent(t,{detail:n})}catch(t){console.warn(t)}a.dispatchEvent(i)}}},loading:function(t){return this.state.isLoading=t,this.DOM.scope.classList[t?"add":"remove"]("tagify--loading"),this},toggleFocusClass:function(t){this.DOM.scope.classList.toggle("tagify--focus",!!t)},events:{customBinding:function(){var e=this;this.customEventsList.forEach(function(t){e.on(t,e.settings.callbacks[t])})},binding:function(t){var e,i=!(0<arguments.length&&void 0!==t)||t,n=this.events.callbacks,o=i?"addEventListener":"removeEventListener";if(!this.state.mainEvents||!i)for(var a in(this.state.mainEvents=i)&&!this.listeners.main&&(this.DOM.input.addEventListener(this.isIE?"keydown":"input",n[this.isIE?"onInputIE":"onInput"].bind(this)),this.settings.isJQueryPlugin&&jQuery(this.DOM.originalInput).on("tagify.removeAllTags",this.removeAllTags.bind(this))),e=this.listeners.main=this.listeners.main||{focus:["input",n.onFocusBlur.bind(this)],blur:["input",n.onFocusBlur.bind(this)],keydown:["input",n.onKeydown.bind(this)],click:["scope",n.onClickScope.bind(this)],dblclick:["scope",n.onDoubleClickScope.bind(this)],paste:["input",n.onPaste.bind(this)]})"blur"==a&&!i||this.DOM[e[a][0]][o](a,e[a][1])},callbacks:{onFocusBlur:function(t){var e=t.target?t.target.textContent.trim():"",i=this.settings,n=t.type,o=0<=i.dropdown.enabled,a={relatedTarget:t.relatedTarget},r=t.relatedTarget&&t.relatedTarget.classList.contains("tagify__tag")&&this.DOM.scope.contains(t.relatedTarget),s=this.state.actions.selectOption&&(o||!i.dropdown.closeOnSelect),l=this.state.actions.addNew&&o;if(!r){if("blur"==n&&t.relatedTarget===this.DOM.scope)return this.dropdown.hide.call(this),void this.DOM.input.focus();if(!s&&!l)if(this.state.hasFocus="focus"==n&&+new Date,this.toggleFocusClass(this.state.hasFocus),this.setRangeAtStartEnd(!1),"mix"!=i.mode){if("focus"==n)return this.trigger("focus",a),void(0===i.dropdown.enabled&&this.dropdown.show.call(this));"blur"==n&&(this.trigger("blur",a),this.loading(!1),("select"==this.settings.mode?!this.value.length||this.value[0].value!=e:e&&!this.state.actions.selectOption&&i.addTagOnBlur)&&this.addTags(e,!0)),this.DOM.input.removeAttribute("style"),this.dropdown.hide.call(this)}else if("focus"==n){if(this.fixFirefoxLastTagNoCaret())return;this.trigger("focus",a)}else"blur"==t.type&&(this.trigger("blur",a),this.loading(!1),this.dropdown.hide.call(this),this.state.dropdown.visible=void 0)}},onKeydown:function(t){var n=this,e=t.target.textContent.trim();if(this.trigger("keydown",{originalEvent:this.cloneEvent(t)}),"mix"==this.settings.mode){switch(t.key){case"Left":case"ArrowLeft":this.state.actions.ArrowLeft=!0;break;case"Delete":case"Backspace":if(this.state.editing)return;var i=document.getSelection(),o="Delete"==t.key&&i.anchorOffset==i.anchorNode.length,a=1==i.anchorNode.nodeType||!i.anchorOffset&&i.anchorNode.previousElementSibling,r=c(this.DOM.input.innerHTML),s=this.getTagElms();if(3==i.anchorNode.nodeType&&!i.anchorNode.nodeValue&&i.anchorNode.previousElementSibling&&t.preventDefault(),(a||o)&&!this.settings.backspace)return void t.preventDefault();setTimeout(function(){var t=c(n.DOM.input.innerHTML);if((i.anchorNode==n.DOM.input&&t.length==r.length||!i.anchorOffset&&t.length>=r.length)&&(n.removeTags(i.anchorNode.previousElementSibling),n.fixFirefoxLastTagNoCaret(),2==n.DOM.input.children.length&&"BR"==n.DOM.input.children[1].tagName))return n.DOM.input.innerHTML="",!(n.value.length=0);n.value=[].map.call(s,function(t,e){var i=t.__tagifyTagData;if(t.parentNode)return i;n.trigger("remove",{tag:t,index:e,data:i})}).filter(function(t){return t})},50)}return!0}switch(t.key){case"Backspace":this.state.dropdown.visible||""!=e&&8203!=e.charCodeAt(0)||(!0===this.settings.backspace?this.removeTags():"edit"==this.settings.backspace&&setTimeout(this.editTag.bind(this),0));break;case"Esc":case"Escape":if(this.state.dropdown.visible)return;t.target.blur();break;case"Down":case"ArrowDown":this.state.dropdown.visible||this.dropdown.show.call(this);break;case"ArrowRight":var l=this.state.inputSuggestion||this.state.ddItemData;if(l&&this.settings.autoComplete.rightKey)return void this.addTags([l],!0);break;case"Tab":if(!e||"select"==this.settings.mode)return!0;case"Enter":t.preventDefault(),setTimeout(function(){n.state.actions.selectOption||n.addTags(e,!0)})}},onInput:function(t){var e=this.input.normalize.call(this),i=e.length>=this.settings.dropdown.enabled,n={value:e,inputElm:this.DOM.input};if("mix"==this.settings.mode)return this.events.callbacks.onMixTagsInput.call(this,t);n.isValid=this.validateTag({value:e}),this.trigger("input",n),e?this.input.value!=e&&(this.input.set.call(this,e,!1),-1!=e.search(this.settings.delimiters)?this.addTags(e)&&this.input.set.call(this):0<=this.settings.dropdown.enabled&&this.dropdown[i?"show":"hide"].call(this,e)):this.input.set.call(this,"")},onMixTagsInput:function(){var t,e,i,n,o,a,r,s,l=this,c=this.settings;if(this.value.length<this.getTagElms().length)return this.value=[].map.call(this.getTagElms(),function(t){return t.__tagifyTagData}),void this.update();if(this.hasMaxTags())return!0;if(window.getSelection&&0<(r=window.getSelection()).rangeCount&&3==r.anchorNode.nodeType){if((t=r.getRangeAt(0).cloneRange()).collapse(!0),t.setStart(r.focusNode,0),n=(e=t.toString().slice(0,t.endOffset)).split(c.pattern).length-1,(i=e.match(c.pattern))&&(o=e.slice(e.lastIndexOf(i[i.length-1]))),o){this.state.actions.ArrowLeft=!1,this.state.tag={prefix:o.match(c.pattern)[0],value:o.replace(c.pattern,"")},this.state.tag.baseOffset=r.baseOffset-this.state.tag.value.length,a=this.state.tag.value.length>=c.dropdown.enabled;try{s=(s=this.state.flaggedTags[this.state.tag.baseOffset]).prefix==this.state.tag.prefix&&s.value[0]==this.state.tag.value[0],this.state.flaggedTags[this.state.tag.baseOffset]&&!this.state.tag.value&&delete this.state.flaggedTags[this.state.tag.baseOffset]}catch(t){}(s||n<this.state.mixMode.matchedPatternCount)&&(a=!1)}else this.state.flaggedTags={};this.state.mixMode.matchedPatternCount=n}setTimeout(function(){l.update(),l.trigger("input",h({},l.state.tag,{textContent:l.DOM.input.textContent})),l.state.tag&&l.dropdown[a?"show":"hide"].call(l,l.state.tag.value)},10)},onInputIE:function(t){var e=this;setTimeout(function(){e.events.callbacks.onInput.call(e,t)})},onClickScope:function(t){var e=t.target.closest(".tagify__tag"),i=this.settings,n=new Date-this.state.hasFocus;if(t.target!=this.DOM.scope){if(!t.target.classList.contains("tagify__tag__removeBtn"))return e?(this.trigger("click",{tag:e,index:this.getNodeIndex(e),data:this.tagData(e),originalEvent:this.cloneEvent(t)}),void(1==this.settings.editTags&&this.events.callbacks.onDoubleClickScope.call(this,t))):void(t.target==this.DOM.input&&500<n?this.state.dropdown.visible?this.dropdown.hide.call(this):0===i.dropdown.enabled&&"mix"!=i.mode&&this.dropdown.show.call(this):"select"==i.mode&&(this.state.dropdown.visible||this.dropdown.show.call(this)));this.removeTags(t.target.parentNode)}else this.DOM.input.focus()},onPaste:function(t){var e;"mix"!=this.settings.mode&&(t.preventDefault(),e=(t.clipboardData||window.clipboardData).getData("Text"),this.input.set.call(this,e))},onEditTagInput:function(t,e){var i=t.closest(".tagify__tag"),n=this.getNodeIndex(i),o=this.input.normalize.call(this,t),a=o!=t.originalValue,r=this.validateTag({value:o});a||!0!==t.originalIsValid||(r=!0),i.classList.toggle("tagify--invalid",!0!==r),i.__tagifyTagData.__isValid=r,o.length>=this.settings.dropdown.enabled&&(this.state.editing.value=o,this.dropdown.show.call(this,o)),this.trigger("edit:input",{tag:i,index:n,data:h({},this.value[n],{newValue:o}),originalEvent:this.cloneEvent(e)})},onEditTagFocus:function(t){this.state.editing={scope:t,input:t.querySelector("[contenteditable]")}},onEditTagBlur:function(t){if(this.state.editing=!1,this.state.hasFocus||this.toggleFocusClass(),this.DOM.scope.contains(t)){var e=t.closest(".tagify__tag"),i=this.input.normalize.call(this,t),n=i!=t.originalValue,o=h({},e.__tagifyTagData,{value:i}),a=this.validateTag(o);if(!i)return this.removeTags(e),void this.onEditTagDone(null,o);n?(this.settings.transformTag.call(this,o),!0===(a=this.validateTag(o))?this.onEditTagDone(e,o):this.trigger("invalid",{data:o,tag:e,message:a})):this.onEditTagDone(e,o)}},onEditTagkeydown:function(t,e){switch(this.trigger("edit:keydown",{originalEvent:this.cloneEvent(t)}),t.key){case"Esc":case"Escape":t.target.textContent=t.target.originalValue,e.__tagifyTagData=e.__tagifyTagData.__originalData;case"Enter":case"Tab":t.preventDefault(),t.target.blur()}},onDoubleClickScope:function(t){var e,i,n=t.target.closest("tag"),o=this.settings;n&&(e=n.classList.contains("tagify__tag--editable"),i=n.hasAttribute("readonly"),"select"==o.mode||o.readonly||e||i||!this.settings.editTags||this.editTag(n),this.toggleFocusClass(!0),this.trigger("dblclick",{tag:n,index:this.getNodeIndex(n),data:this.tagData(n)}))}}},fixFirefoxLastTagNoCaret:function(){var t=this.DOM.input;if(i&&t.childNodes.length&&1==t.lastChild.nodeType)return t.appendChild(document.createTextNode("")),this.setRangeAtStartEnd(!0),!0},editTag:function(e,t){var i=this;t=t||{};var n=(e=e||this.getLastTag()).querySelector(".tagify__tag-text"),o=this.getNodeIndex(e),a=e.__tagifyTagData,r=this.events.callbacks,s=this,l=!0;if(n){if(!(a instanceof Object&&"editable"in a)||a.editable)return e.__tagifyTagData.__originalData=h({},a),e.classList.add("tagify__tag--editable"),n.originalValue=n.textContent,n.setAttribute("contenteditable",!0),n.addEventListener("focus",r.onEditTagFocus.bind(this,e)),n.addEventListener("blur",function(){setTimeout(r.onEditTagBlur.bind(s),0,n)}),n.addEventListener("input",r.onEditTagInput.bind(this,n)),n.addEventListener("keydown",function(t){return r.onEditTagkeydown.call(i,t,e)}),n.focus(),this.setRangeAtStartEnd(!1,n),t.skipValidation||(l=this.editTagToggleValidity(e,a.value)),n.originalIsValid=l,this.trigger("edit:start",{tag:e,index:o,data:a,isValid:l}),this}else console.warn("Cannot find element in Tag template: ",".tagify__tag-text")},editTagToggleValidity:function(t){var e,i=t.__tagifyTagData;if(i)return e=!(!i.__isValid||1==i.__isValid),t.classList.toggle("tagify--invalid",e),i.__isValid;console.warn("tag has no data: ",t,i)},onEditTagDone:function(t,e){var i=this;e=e||{};var n={tag:t,index:this.getNodeIndex(t),data:e};this.trigger("edit:beforeUpdate",n),delete e.__originalData,t&&(this.editTagToggleValidity(t),this.replaceTag(t,e)),this.trigger("edit:updated",n),this.dropdown.hide.call(this),!0===e.__isValid&&this.getTagElms("tagify--notAllowed").forEach(function(t){var e=i.validateTag(t.__tagifyTagData);!0===e&&(t.__tagifyTagData.__isValid=e,i.replaceTag(t))})},replaceTag:function(t,e){e&&e.value||(e=t.__tagifyTagData),e.__isValid&&1!=e.__isValid&&h(e,this.getInvaildTagParams(e,e.__isValid));var i=this.createTagElem(e);t.parentNode.replaceChild(i,t),this.updateValueByDOMTags()},updateValueByDOMTags:function(){var e=this;this.value.length=0,[].forEach.call(this.getTagElms(),function(t){t.classList.contains("tagify--notAllowed")||e.value.push(t.__tagifyTagData)}),this.update()},setRangeAtStartEnd:function(e,i){i=(i=i||this.DOM.input).lastChild||i;var n=document.getSelection();n.rangeCount&&["Start","End"].forEach(function(t){return n.getRangeAt(0)["set"+t](i,e?0:i.length)})},input:{value:"",set:function(t,e){var i=0<arguments.length&&void 0!==t?t:"",n=!(1<arguments.length&&void 0!==e)||e,o=this.settings.dropdown.closeOnSelect;this.input.value=i,n&&(this.DOM.input.innerHTML=i),!i&&o&&setTimeout(this.dropdown.hide.bind(this),20),this.input.autocomplete.suggest.call(this),this.input.validate.call(this),this.setRangeAtStartEnd()},validate:function(){var t=!this.input.value||this.validateTag({value:this.input.value});"select"==this.settings.mode?this.DOM.scope.classList.toggle("tagify--invalid",!0!==t):this.DOM.input.classList.toggle("tagify__input--invalid",!0!==t)},normalize:function(t){var e=t||this.DOM.input,i=[];e.childNodes.forEach(function(t){return 3==t.nodeType&&i.push(t.nodeValue)}),i=i.join("\n");try{i=i.replace(/(?:\r\n|\r|\n)/g,this.settings.delimiters.source.charAt(0))}catch(t){}return i=i.replace(/\s/g," ").replace(/^\s+/,"")},autocomplete:{suggest:function(t){var e,i,n;this.settings.autoComplete.enabled&&("string"==typeof(t=t||{})&&(t={value:t}),i=(e=t.value||"").substr(0,this.input.value.length).toLowerCase(),n=e.substring(this.input.value.length),e&&this.input.value&&i==this.input.value.toLowerCase()?(this.DOM.input.setAttribute("data-suggest",n),this.state.inputSuggestion=t):(this.DOM.input.removeAttribute("data-suggest"),delete this.state.inputSuggestion))},set:function(t){var e=this.DOM.input.getAttribute("data-suggest"),i=t||(e?this.input.value+e:null);return!!i&&("mix"==this.settings.mode?this.replaceTextWithNode(document.createTextNode(this.state.tag.prefix+i)):(this.input.set.call(this,i),this.setRangeAtStartEnd()),this.input.autocomplete.suggest.call(this),this.dropdown.hide.call(this),!0)}}},getTagIdx:function(e){return this.value.findIndex(function(t){return JSON.stringify(t)==JSON.stringify(e)})},getNodeIndex:function(t){var e=0;if(t)for(;t=t.previousElementSibling;)e++;return e},getTagElms:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var n=[".tagify__tag"].concat(e).join(".");return this.DOM.scope.querySelectorAll(n)},getLastTag:function(){var t=this.DOM.scope.querySelectorAll("tag:not(.tagify--hide):not([readonly])");return t[t.length-1]},tagData:function(t,e){return e&&(t.__tagifyTagData=h({},t.__tagifyTagData||{},e)),t.__tagifyTagData},isTagDuplicate:function(i){return"select"!=this.settings.mode&&this.value.reduce(function(t,e){return i.trim().toLowerCase()===e.value.toLowerCase()?t+1:t},0)},getTagIndexByValue:function(i){var n=[];return this.getTagElms().forEach(function(t,e){t.textContent.trim().toLowerCase()==i.toLowerCase()&&n.push(e)}),n},getTagElmByValue:function(t){var e=this.getTagIndexByValue(t)[0];return this.getTagElms()[e]},markTagByValue:function(t,e){return!!(e=e||this.getTagElmByValue(t))&&(e.classList.add("tagify--mark"),setTimeout(function(){e.classList.remove("tagify--mark")},100),e)},isTagBlacklisted:function(e){return e=e.toLowerCase().trim(),this.settings.blacklist.filter(function(t){return e==t.toLowerCase()}).length},isTagWhitelisted:function(e){return this.settings.whitelist.some(function(t){return"string"==typeof e?e.trim().toLowerCase()===(t.value||t).toLowerCase():JSON.stringify(t).toLowerCase()===JSON.stringify(e).toLowerCase()})},validateTag:function(t){var e=t.value.trim(),i=this.settings,n=!0;return e?i.pattern&&i.pattern instanceof RegExp&&!i.pattern.test(e)?n=this.TEXTS.pattern:!i.duplicates&&this.isTagDuplicate(e)?n=this.TEXTS.duplicate:(this.isTagBlacklisted(e)||i.enforceWhitelist&&!this.isTagWhitelisted(e))&&(n=this.TEXTS.notAllowed):n=this.TEXTS.empty,n},getInvaildTagParams:function(t,e){return{"aria-invalid":!0,class:(t.class||"")+" tagify--notAllowed",title:e}},hasMaxTags:function(){return this.value.length>=this.settings.maxTags&&this.TEXTS.exceed},normalizeTags:function(t){function i(t){return(t+"").split(r).filter(function(t){return t}).map(function(t){return{value:t.trim()}})}var e,n,o=this.settings,a=o.whitelist,r=o.delimiters,s=o.mode,l=!!a&&a[0]instanceof Object,c=t instanceof Array,h=c&&t[0]instanceof Object&&"value"in t[0],u=[];if(h)return(e=[]).concat.apply(e,f(t.map(function(e){return i(e.value).map(function(t){return d(d({},e),t)})})));if("number"==typeof t&&(t=t.toString()),"string"==typeof t){if(!t.trim())return[];t=i(t)}else{c&&(t=(n=[]).concat.apply(n,f(t.map(i))))}return l&&(t.forEach(function(e){var t=a.filter(function(t){return t.value.toLowerCase()==e.value.toLowerCase()});t[0]?u.push(t[0]):"mix"!=s&&u.push(e)}),u.length&&(t=u)),t},parseMixTags:function(t){var r=this,e=this.settings,s=e.mixTagsInterpolator,l=e.duplicates,c=e.transformTag,h=e.enforceWhitelist,u=[];return t=t.split(s[0]).map(function(t,e){var i,n,o=t.split(s[1]),a=o[0];try{i=JSON.parse(a)}catch(t){i=r.normalizeTags(a)[0]}if(!(1<o.length)||h&&!r.isTagWhitelisted(i.value)||!l&&r.isTagDuplicate(i.value)){if(t)return e?s[0]+t:t}else c.call(r,i),n=r.createTagElem(i),u.push(i),n.classList.add("tagify--noAnim"),o[0]=n.outerHTML,r.value.push(i);return o.join("")}).join(""),this.DOM.input.innerHTML=t,this.DOM.input.appendChild(document.createTextNode("")),this.DOM.input.normalize(),this.getTagElms().forEach(function(t,e){return t.__tagifyTagData=u[e]}),this.update(),t},replaceTextWithNode:function(t,e){if(this.state.tag||e){e=e||this.state.tag.prefix+this.state.tag.value;var i,n,o=this.state.selection||window.getSelection(),a=o.anchorNode;return a.splitText(o.anchorOffset),i=a.nodeValue.lastIndexOf(e),(n=a.splitText(i)).nodeValue=n.nodeValue.replace(e,""),a.parentNode.insertBefore(t,n),this.DOM.input.normalize(),n}},selectTag:function(t,e){if(!this.settings.enforceWhitelist||this.isTagWhitelisted(e.value))return this.input.set.call(this,e.value,!0),this.state.actions.selectOption&&setTimeout(this.setRangeAtStartEnd.bind(this)),this.getLastTag()?this.replaceTag(this.getLastTag(),e):this.appendTag(t),this.value[0]=e,this.trigger("add",{tag:t,data:e}),this.update(),[t]},addEmptyTag:function(){var t={value:""},e=this.createTagElem(t);e.__tagifyTagData=t,this.appendTag(e),this.editTag(e,{skipValidation:!0})},addTags:function(t,e,i){var n,o=this,a=2<arguments.length&&void 0!==i?i:this.settings.skipInvalid,r=[],s=this.settings;return t&&0!=t.length?(t=this.normalizeTags(t),"mix"==s.mode?(s.transformTag.call(this,t[0]),n=this.createTagElem(t[0]),this.replaceTextWithNode(n)||this.DOM.input.appendChild(n),setTimeout(function(){return n.classList.add("tagify--noAnim")},300),t[0].prefix=t[0].prefix||this.state.tag?this.state.tag.prefix:(s.pattern.source||s.pattern)[0],this.value.push(t[0]),this.update(),this.state.tag=null,this.trigger("add",h({},{tag:n},{data:t[0]})),this.fixFirefoxLastTagNoCaret(),n):("select"==s.mode&&(e=!1),this.DOM.input.removeAttribute("style"),t.forEach(function(t){var e,i={};if(t=Object.assign({},t),s.transformTag.call(o,t),t.__isValid=o.hasMaxTags()||o.validateTag(t),!0!==t.__isValid){if(a)return;h(i,o.getInvaildTagParams(t,t.__isValid)),t.__isValid==o.TEXTS.duplicate&&o.markTagByValue(t.value)}if(i.role="tag",t.readonly&&(i["aria-readonly"]=!0),(e=o.createTagElem(h({},t,i))).__tagifyTagData=t,r.push(e),"select"==s.mode)return o.selectTag(e,t);o.appendTag(e),t.__isValid&&!0===t.__isValid?(o.value.push(t),o.update(),o.trigger("add",{tag:e,index:o.value.length-1,data:t})):(o.trigger("invalid",{data:t,index:o.value.length,tag:e,message:t.__isValid}),s.keepInvalidTags||setTimeout(function(){return o.removeTags(e,!0)},1e3)),o.dropdown.position.call(o)}),t.length&&e&&this.input.set.call(this),this.dropdown.refilter.call(this),r)):("select"==s.mode&&this.removeAllTags(),r)},appendTag:function(t){var e=this.DOM.scope.lastElementChild;e===this.DOM.input?this.DOM.scope.insertBefore(t,e):this.DOM.scope.appendChild(t)},createTagElem:function(t){var e,i=a(t.value),n=this.settings.templates.tag.call(this,i,t);return this.settings.readonly&&(t.readonly=!0),(e=o(n=g(n))).__tagifyTagData=t,e},reCheckInvalidTags:function(){var o=this,t=this.DOM.scope.querySelectorAll(".tagify__tag.tagify--notAllowed");[].forEach.call(t,function(t){var e=t.__tagifyTagData,i=t.getAttribute("title")==o.TEXTS.duplicate,n=!0===o.validateTag(e);i&&n&&(e.__isValid=!0,o.replaceTag(t,e))})},removeTags:function(t,i,n){var o,a=this;t=t&&t instanceof HTMLElement?[t]:t instanceof Array?t:t?[t]:[this.getLastTag()],o=t.reduce(function(t,e){return e&&("string"==typeof e&&(e=a.getTagElmByValue(e)),e&&t.push({node:e,data:e.__tagifyTagData})),t},[]),n="number"==typeof n?n:this.CSSVars.tagHideTransition,"select"==this.settings.mode&&(n=0,this.input.set.call(this)),1==o.length&&o[0].node.classList.contains("tagify--notAllowed")&&(i=!0),this.settings.hooks.beforeRemoveTag(o).then(function(){function e(t){var e;t.node.parentNode&&(e=this.getTagIdx(t.data),t.node.parentNode.removeChild(t.node),i?this.settings.keepInvalidTags&&this.trigger("remove",{tag:t.node,index:e}):(this.trigger("remove",{tag:t.node,index:e,data:t.data}),this.dropdown.refilter.call(this),this.dropdown.position.call(this),this.DOM.input.normalize(),this.settings.keepInvalidTags&&this.reCheckInvalidTags()))}n&&10<n&&1==o.length?function(t){t.node.style.width=parseFloat(window.getComputedStyle(t.node).width)+"px",document.body.clientTop,t.node.classList.add("tagify--hide"),setTimeout(e.bind(this),n,t)}.call(a,o[0]):o.forEach(e.bind(a)),i||(o.forEach(function(t){var e=a.getTagIdx(t.data);-1<e&&a.value.splice(e,1)}),a.update())}).catch(function(t){})},removeAllTags:function(){this.value=[],"mix"==this.settings.mode?this.DOM.input.innerHTML="":Array.prototype.slice.call(this.getTagElms()).forEach(function(t){return t.parentNode.removeChild(t)}),this.dropdown.position.call(this),"select"==this.settings.mode&&this.input.set.call(this),this.update()},removeValueById:function(){},preUpdate:function(){this.DOM.scope.classList.toggle("tagify--hasMaxTags",this.value.length>=this.settings.maxTags),this.DOM.scope.classList.toggle("tagify--noTags",!this.value.length)},update:function(){this.preUpdate();var t=this.DOM.originalInput,e=t.value,i=this.value.map(function(t){var e={};for(var i in t)"__isValid"!=i&&(e[i]=t[i]);return e}),n=new CustomEvent("change",{bubbles:!0});t.value="mix"==this.settings.mode?this.getMixedTagsAsString(i):i.length?this.settings.originalInputValueFormat?this.settings.originalInputValueFormat(i):JSON.stringify(i):"",n.simulated=!0,t._valueTracker&&t._valueTracker.setValue(e),t.dispatchEvent(n)},getMixedTagsAsString:function(){var i="",n=this,o=this.settings.mixTagsInterpolator;return function e(t){t.childNodes.forEach(function(t){if(1==t.nodeType){if(t.classList.contains("tagify__tag")&&t.__tagifyTagData)return void(i+=o[0]+JSON.stringify(t.__tagifyTagData)+o[1]);"BR"!=t.tagName||t.parentNode!=n.DOM.input&&1!=t.parentNode.childNodes.length?"DIV"!=t.tagName&&"P"!=t.tagName||(i+="\r\n",e(t)):i+="\r\n"}else i+=t.textContent})}(this.DOM.input),i},getNodeHeight:function(t){var e,i=t.cloneNode(!0);return i.style.cssText="position:fixed; top:-9999px; opacity:0",document.body.appendChild(i),e=i.clientHeight,i.parentNode.removeChild(i),e},dropdown:{init:function(){this.DOM.dropdown=o(this.settings.templates.dropdown(this.settings)),this.DOM.dropdown.content=this.DOM.dropdown.querySelector(".tagify__dropdown__wrapper")},show:function(t){var e,i,n,o,a,r,s=this,l=this.settings,c=window.getSelection(),h="mix"==l.mode&&!l.enforceWhitelist,u=!l.whitelist||!l.whitelist.length,d="manual"==l.dropdown.position;if(!(u&&!h||!1===l.dropdown.enable||this.state.isLoading)){if(clearTimeout(this.dropdownHide__bindEventsTimeout),this.suggestedListItems=this.dropdown.filterListItems.call(this,t),this.suggestedListItems.length)t&&h&&!this.state.editing.scope&&(a=this.suggestedListItems[0].value,r=t,a.toLowerCase()!=r.toLowerCase())&&this.suggestedListItems.unshift({value:t});else{if(!t||!h||this.state.editing.scope)return this.input.autocomplete.suggest.call(this),this.dropdown.hide.call(this),void this.events.binding.call(this);this.suggestedListItems=[{value:t}]}n=p(i=this.suggestedListItems[0])?i.value:i,l.autoComplete&&n&&0==n.indexOf(t)&&this.input.autocomplete.suggest.call(this,i),e=this.dropdown.createListHTML.call(this,this.suggestedListItems),this.DOM.dropdown.content.innerHTML=g(e),(l.enforceWhitelist&&!d||l.dropdown.highlightFirst)&&this.dropdown.highlightOption.call(this,this.DOM.dropdown.content.children[0]),this.DOM.scope.setAttribute("aria-expanded",!0),this.trigger("dropdown:show",this.DOM.dropdown),this.state.dropdown.visible=t||!0,this.state.selection={anchorOffset:c.anchorOffset,anchorNode:c.anchorNode},this.dropdown.position.call(this),document.body.contains(this.DOM.dropdown)||(d||(this.events.binding.call(this,!1),o=this.getNodeHeight(this.DOM.dropdown),this.DOM.dropdown.classList.add("tagify__dropdown--initial"),this.dropdown.position.call(this,o),document.body.appendChild(this.DOM.dropdown),setTimeout(function(){return s.DOM.dropdown.classList.remove("tagify__dropdown--initial")})),setTimeout(this.dropdown.events.binding.bind(this)))}},hide:function(t){var e=this.DOM,i=e.scope,n=e.dropdown,o="manual"==this.settings.dropdown.position&&!t;n&&document.body.contains(n)&&!o&&(window.removeEventListener("resize",this.dropdown.position),this.dropdown.events.binding.call(this,!1),clearTimeout(this.dropdownHide__bindEventsTimeout),this.dropdownHide__bindEventsTimeout=setTimeout(this.events.binding.bind(this),250),i.setAttribute("aria-expanded",!1),n.parentNode.removeChild(n),this.state.dropdown.visible=!1,this.state.ddItemData=this.state.ddItemElm=this.state.selection=null,this.state.tag&&this.state.tag.value.length&&(this.state.flaggedTags[this.state.tag.baseOffset]=this.state.tag),this.trigger("dropdown:hide",n))},refilter:function(){this.suggestedListItems=this.dropdown.filterListItems.call(this,"");var t=this.dropdown.createListHTML.call(this,this.suggestedListItems);this.DOM.dropdown.content.innerHTML=g(t),this.trigger("dropdown:updated",this.DOM.dropdown)},position:function(t){var e,i,n,o,a,r,s=this.DOM.dropdown,l=this.DOM["input"==this.settings.dropdown.position?"input":"scope"];this.state.dropdown.visible&&(r="text"==this.settings.dropdown.position?(o=(i=this.getCaretGlobalPosition()).bottom,n=i.top,a=i.left,"auto"):(n=(i=l.getBoundingClientRect()).top,o=i.bottom-1,a=i.left,i.width+"px"),n=Math.floor(n),o=Math.ceil(o),e=document.documentElement.clientHeight-o<(t||s.clientHeight),s.style.cssText="left:"+(a+window.pageXOffset)+"px; width:"+r+";"+(e?"bottom:"+(document.documentElement.clientHeight-n-window.pageYOffset-2)+"px;":"top: "+(o+window.pageYOffset)+"px"),s.setAttribute("placement",e?"top":"bottom"))},events:{binding:function(t){var e=!(0<arguments.length&&void 0!==t)||t,i=this.dropdown.events.callbacks,n=this.listeners.dropdown=this.listeners.dropdown||{position:this.dropdown.position.bind(this),onKeyDown:i.onKeyDown.bind(this),onMouseOver:i.onMouseOver.bind(this),onMouseLeave:i.onMouseLeave.bind(this),onClick:i.onClick.bind(this),onScroll:i.onScroll.bind(this)},o=e?"addEventListener":"removeEventListener";"manual"!=this.settings.dropdown.position&&(window[o]("resize",n.position),window[o]("keydown",n.onKeyDown)),this.DOM.dropdown[o]("mouseover",n.onMouseOver),this.DOM.dropdown[o]("mouseleave",n.onMouseLeave),this.DOM.dropdown[o]("mousedown",n.onClick),this.DOM.dropdown.content[o]("scroll",n.onScroll),this.DOM[this.listeners.main.click[0]][o]("click",this.listeners.main.click[1])},callbacks:{onKeyDown:function(t){var e,i=this.DOM.dropdown.querySelector("[class$='--active']"),n=i;switch(t.key){case"ArrowDown":case"ArrowUp":case"Down":case"Up":t.preventDefault(),n=(n=n&&n[("ArrowUp"==t.key||"Up"==t.key?"previous":"next")+"ElementSibling"])||(e=this.DOM.dropdown.content.children)["ArrowUp"==t.key||"Up"==t.key?e.length-1:0],this.dropdown.highlightOption.call(this,n,!0);break;case"Escape":case"Esc":this.dropdown.hide.call(this);break;case"ArrowRight":if(this.state.actions.ArrowLeft)return;case"Tab":if("mix"!=this.settings.mode&&!this.settings.autoComplete.rightKey){try{var o=n?n.textContent:this.suggestedListItems[0].value;this.input.autocomplete.set.call(this,o)}catch(t){}return!1}case"Enter":t.preventDefault(),this.dropdown.selectOption.call(this,i);break;case"Backspace":if("mix"==this.settings.mode||this.state.editing.scope)return;var a=this.input.value.trim();""!=a&&8203!=a.charCodeAt(0)||(!0===this.settings.backspace?this.removeTags():"edit"==this.settings.backspace&&setTimeout(this.editTag.bind(this),0))}},onMouseOver:function(t){var e=t.target.closest(".tagify__dropdown__item");e&&this.dropdown.highlightOption.call(this,e)},onMouseLeave:function(){this.dropdown.highlightOption.call(this)},onClick:function(t){var e;0==t.button&&t.target!=this.DOM.dropdown&&(e=t.target.closest(".tagify__dropdown__item"),t.target.closest(".tagify__dropdown__addNewBtn"),e&&this.dropdown.selectOption.call(this,e))},onScroll:function(t){var e=t.target,i=e.scrollTop/(e.scrollHeight-e.parentNode.clientHeight)*100;this.trigger("dropdown:scroll",{percentage:Math.round(i)})}}},highlightOption:function(t,e){var i,n="tagify__dropdown__item--active";if(this.state.ddItemElm&&(this.state.ddItemElm.classList.remove(n),this.state.ddItemElm.removeAttribute("aria-selected")),!t)return this.state.ddItemData=null,this.state.ddItemElm=null,void this.input.autocomplete.suggest.call(this);i=this.suggestedListItems[this.getNodeIndex(t)],this.state.ddItemData=i,(this.state.ddItemElm=t).classList.add(n),t.setAttribute("aria-selected",!0),e&&(t.parentNode.scrollTop=t.clientHeight+t.offsetTop-t.parentNode.clientHeight),this.settings.autoComplete&&(this.input.autocomplete.suggest.call(this,i),"manual"!=this.settings.dropdown.position&&this.dropdown.position.call(this))},selectOption:function(t){var e,i,n=this;t&&(this.state.actions.selectOption=!0,setTimeout(function(){return n.state.actions.selectOption=!1},50),e=this.settings.dropdown.closeOnSelect,i=this.suggestedListItems[this.getNodeIndex(t)].value||this.input.value,this.trigger("dropdown:select",i),this.state.editing?this.onEditTagDone(this.state.editing.scope,d(d({},this.state.editing.scope.__tagifyTagData),{},{value:i,__isValid:!0})):this.addTags([i],!0),setTimeout(function(){n.DOM.input.focus(),n.toggleFocusClass(!0)}),e&&this.dropdown.hide.call(this))},filterListItems:function(t){var i,e,n,o,a,r=this,s=this.settings,l=[],c=s.whitelist,h=s.dropdown.maxItems||1/0,u=s.dropdown.searchKeys.concat(["searchBy","value"]),d=0;if(!t)return(s.duplicates?c:c.filter(function(t){return!r.isTagDuplicate(p(t)?t.value:t)})).slice(0,h);for(;d<c.length&&(i=c[d]instanceof Object?c[d]:{value:c[d]},o=u.reduce(function(t,e){return t+" "+(i[e]||"")},"").toLowerCase(),n=s.dropdown.accentedSearch?v(o).indexOf(v(t.toLowerCase())):o.indexOf(t.toLowerCase()),e=s.dropdown.fuzzySearch?0<=n:0==n,a=!s.duplicates&&this.isTagDuplicate(p(i)?i.value:i),e&&!a&&h--&&l.push(i),0!=h);d++);return l},createListHTML:function(t){var n=this;return t.map(function(t){"string"==typeof t&&(t={value:t});var e=n.settings.dropdown.mapValueTo,i=h({},t,{value:a((e?"function"==typeof e?e(t):t[e]:t.value)||"")});return n.settings.templates.dropdownItem.call(n,i)}).join("")}}}).removeTag=t.prototype.removeTags,t}),function(t,e){if("object"===("undefined"==typeof exports?"undefined":_typeof2(exports))&&"object"===("undefined"==typeof module?"undefined":_typeof2(module)))module.exports=e(require("jquery"));else if("function"==typeof define&&define.amd)define(["jquery"],e);else{var i="object"===("undefined"==typeof exports?"undefined":_typeof2(exports))?e(require("jquery")):e(t.jQuery);for(var n in i)("object"===("undefined"==typeof exports?"undefined":_typeof2(exports))?exports:t)[n]=i[n]}}(window,function(e){return n={},o.m=i={0:function(t){t.exports=e},1:function(t,e,i){var n=i(0),a=i.n(n);function o(t){return(o="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(t){return _typeof2(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":_typeof2(t)})(t)}function r(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var s=function(){function o(t,e,i,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),this.markup=t,this.children=e,this.options=i,this.callback=n}var t,e,i;return t=o,(e=[{key:"render",value:function(t){var e,i=a()(this.markup);return this.options&&this.options.contents&&i.html(this.options.contents),this.options&&this.options.className&&i.addClass(this.options.className),this.options&&this.options.data&&a.a.each(this.options.data,function(t,e){i.attr("data-"+t,e)}),this.options&&this.options.click&&i.on("click",this.options.click),this.children&&(e=i.find(".note-children-container"),this.children.forEach(function(t){t.render(e.length?e:i)})),this.callback&&this.callback(i,this.options),this.options&&this.options.callback&&this.options.callback(i),t&&t.append(i),i}}])&&r(t.prototype,e),i&&r(t,i),o}();e.a={create:function(i,n){return function(){var t="object"===o(arguments[1])?arguments[1]:arguments[0],e=Array.isArray(arguments[0])?arguments[0]:[];return t&&t.children&&(e=t.children),new s(i,e,t,n)}}}},2:function(e){(function(t){e.exports=t}).call(this,{})},3:function(t,e,i){var n=i(0),w=i.n(n);w.a.summernote=w.a.summernote||{lang:{}},w.a.extend(w.a.summernote.lang,{"en-US":{font:{bold:"Bold",italic:"Italic",underline:"Underline",clear:"Remove Font Style",height:"Line Height",name:"Font Family",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript",size:"Font Size",sizeunit:"Font Size Unit"},image:{image:"Picture",insert:"Insert Image",resizeFull:"Resize full",resizeHalf:"Resize half",resizeQuarter:"Resize quarter",resizeNone:"Original size",floatLeft:"Float Left",floatRight:"Float Right",floatNone:"Remove float",shapeRounded:"Shape: Rounded",shapeCircle:"Shape: Circle",shapeThumbnail:"Shape: Thumbnail",shapeNone:"Shape: None",dragImageHere:"Drag image or text here",dropImage:"Drop image or Text",selectFromFiles:"Select from files",maximumFileSize:"Maximum file size",maximumFileSizeError:"Maximum file size exceeded.",url:"Image URL",remove:"Remove Image",original:"Original"},video:{video:"Video",videoLink:"Video Link",insert:"Insert Video",url:"Video URL",providers:"(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)"},link:{link:"Link",insert:"Insert Link",unlink:"Unlink",edit:"Edit",textToDisplay:"Text to display",url:"To what URL should this link go?",openInNewWindow:"Open in new window",useProtocol:"Use default protocol"},table:{table:"Table",addRowAbove:"Add row above",addRowBelow:"Add row below",addColLeft:"Add column left",addColRight:"Add column right",delRow:"Delete row",delCol:"Delete column",delTable:"Delete table"},hr:{insert:"Insert Horizontal Rule"},style:{style:"Style",p:"Normal",blockquote:"Quote",pre:"Code",h1:"Header 1",h2:"Header 2",h3:"Header 3",h4:"Header 4",h5:"Header 5",h6:"Header 6"},lists:{unordered:"Unordered list",ordered:"Ordered list"},options:{help:"Help",fullscreen:"Full Screen",codeview:"Code View"},paragraph:{paragraph:"Paragraph",outdent:"Outdent",indent:"Indent",left:"Align left",center:"Align center",right:"Align right",justify:"Justify full"},color:{recent:"Recent Color",more:"More Color",background:"Background Color",foreground:"Text Color",transparent:"Transparent",setTransparent:"Set transparent",reset:"Reset",resetToDefault:"Reset to default",cpSelect:"Select"},shortcut:{shortcuts:"Keyboard shortcuts",close:"Close",textFormatting:"Text formatting",action:"Action",paragraphFormatting:"Paragraph formatting",documentStyle:"Document Style",extraKeys:"Extra keys"},help:{escape:"Escape",insertParagraph:"Insert Paragraph",undo:"Undo the last command",redo:"Redo the last command",tab:"Tab",untab:"Untab",bold:"Set a bold style",italic:"Set a italic style",underline:"Set a underline style",strikethrough:"Set a strikethrough style",removeFormat:"Clean a style",justifyLeft:"Set left align",justifyCenter:"Set center align",justifyRight:"Set right align",justifyFull:"Set full align",insertUnorderedList:"Toggle unordered list",insertOrderedList:"Toggle ordered list",outdent:"Outdent on current paragraph",indent:"Indent on current paragraph",formatPara:"Change current block's format as a paragraph(P tag)",formatH1:"Change current block's format as H1",formatH2:"Change current block's format as H2",formatH3:"Change current block's format as H3",formatH4:"Change current block's format as H4",formatH5:"Change current block's format as H5",formatH6:"Change current block's format as H6",insertHorizontalRule:"Insert horizontal rule","linkDialog.show":"Show Link Dialog"},history:{undo:"Undo",redo:"Redo"},specialChar:{specialChar:"SPECIAL CHARACTERS",select:"Select Special characters"},output:{noSelection:"No Selection Made!"}}});var o="function"==typeof define&&i(2),a=["sans-serif","serif","monospace","cursive","fantasy"];function r(t){return-1===w.a.inArray(t.toLowerCase(),a)?"'".concat(t,"'"):t}var s,l,c=navigator.userAgent,h=/MSIE|Trident/i.test(c);h&&((l=/MSIE (\d+[.]\d+)/.exec(c))&&(s=parseFloat(l[1])),(l=/Trident\/.*rv:([0-9]{1,}[.0-9]{0,})/.exec(c))&&(s=parseFloat(l[1])));var u=/Edge\/\d+/.test(c),d="ontouchstart"in window||0<navigator.MaxTouchPoints||0<navigator.msMaxTouchPoints,f=h?"DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted":"input",p={isMac:-1<navigator.appVersion.indexOf("Mac"),isMSIE:h,isEdge:u,isFF:!u&&/firefox/i.test(c),isPhantom:/PhantomJS/i.test(c),isWebkit:!u&&/webkit/i.test(c),isChrome:!u&&/chrome/i.test(c),isSafari:!u&&/safari/i.test(c)&&!/chrome/i.test(c),browserVersion:s,jqueryVersion:parseFloat(w.a.fn.jquery),isSupportAmd:o,isSupportTouch:d,isFontInstalled:function(t){var e="Comic Sans MS"===t?"Courier New":"Comic Sans MS",i="mmmmmmmmmmwwwww",n=document.createElement("canvas").getContext("2d");n.font="200px '"+e+"'";var o=n.measureText(i).width;return n.font="200px "+r(t)+', "'+e+'"',o!==n.measureText(i).width},isW3CRangeSupport:!!document.createRange,inputEventName:f,genericFontFamilies:a,validFontName:r};var g=0;var v={eq:function(e){return function(t){return e===t}},eq2:function(t,e){return t===e},peq2:function(i){return function(t,e){return t[i]===e[i]}},ok:function(){return!0},fail:function(){return!1},self:function(t){return t},not:function(t){return function(){return!t.apply(t,arguments)}},and:function(e,i){return function(t){return e(t)&&i(t)}},invoke:function(t,e){return function(){return t[e].apply(t,arguments)}},resetUniqueId:function(){g=0},uniqueId:function(t){var e=++g+"";return t?t+e:e},rect2bnd:function(t){var e=w()(document);return{top:t.top+e.scrollTop(),left:t.left+e.scrollLeft(),width:t.right-t.left,height:t.bottom-t.top}},invertObject:function(t){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[t[i]]=i);return e},namespaceToCamel:function(t,e){return(e=e||"")+t.split(".").map(function(t){return t.substring(0,1).toUpperCase()+t.substring(1)}).join("")},debounce:function(n,o,a){var r;return function(){var t=this,e=arguments,i=a&&!r;clearTimeout(r),r=setTimeout(function(){r=null,a||n.apply(t,e)},o),i&&n.apply(t,e)}},isValidUrl:function(t){return/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/gi.test(t)}};function m(t){return t[0]}function b(t){return t[t.length-1]}function y(t){return t.slice(1)}function x(t,e){if(t&&t.length&&e){if(t.indexOf)return-1!==t.indexOf(e);if(t.contains)return t.contains(e)}return!1}var k={head:m,last:b,initial:function(t){return t.slice(0,t.length-1)},tail:y,prev:function(t,e){if(t&&t.length&&e){var i=t.indexOf(e);return-1===i?null:t[i-1]}return null},next:function(t,e){if(t&&t.length&&e){var i=t.indexOf(e);return-1===i?null:t[i+1]}return null},find:function(t,e){for(var i=0,n=t.length;i<n;i++){var o=t[i];if(e(o))return o}},contains:x,all:function(t,e){for(var i=0,n=t.length;i<n;i++)if(!e(t[i]))return!1;return!0},sum:function(t,i){return i=i||v.self,t.reduce(function(t,e){return t+i(e)},0)},from:function(t){for(var e=[],i=t.length,n=-1;++n<i;)e[n]=t[n];return e},isEmpty:function(t){return!t||!t.length},clusterBy:function(t,n){return t.length?y(t).reduce(function(t,e){var i=b(t);return n(b(i),e)?i[i.length]=e:t[t.length]=[e],t},[[m(t)]]):[]},compact:function(t){for(var e=[],i=0,n=t.length;i<n;i++)t[i]&&e.push(t[i]);return e},unique:function(t){for(var e=[],i=0,n=t.length;i<n;i++)x(e,t[i])||e.push(t[i]);return e}},C=String.fromCharCode(160);function A(t){return t&&w()(t).hasClass("note-editable")}function S(e){return e=e.toUpperCase(),function(t){return t&&t.nodeName.toUpperCase()===e}}function T(t){return t&&3===t.nodeType}function E(t){return t&&/^BR|^IMG|^HR|^IFRAME|^BUTTON|^INPUT|^AUDIO|^VIDEO|^EMBED/.test(t.nodeName.toUpperCase())}function _(t){return!A(t)&&(t&&/^DIV|^P|^LI|^H[1-7]/.test(t.nodeName.toUpperCase()))}var O=S("PRE"),L=S("LI");var P=S("TABLE"),N=S("DATA");function I(t){return!(j(t)||M(t)||D(t)||_(t)||P(t)||z(t)||N(t))}function M(t){return t&&/^UL|^OL/.test(t.nodeName.toUpperCase())}var D=S("HR");function R(t){return t&&/^TD|^TH/.test(t.nodeName.toUpperCase())}var z=S("BLOCKQUOTE");function j(t){return R(t)||z(t)||A(t)}var B=S("A");var F=S("BODY");var H=p.isMSIE&&p.browserVersion<11?"&nbsp;":"<br>";function X(t){return T(t)?t.nodeValue.length:t?t.childNodes.length:0}function Y(t){var e=X(t);return 0===e||(!T(t)&&1===e&&t.innerHTML===H||!(!k.all(t.childNodes,T)||""!==t.innerHTML))}function q(t){E(t)||X(t)||(t.innerHTML=H)}function W(t,e){for(;t;){if(e(t))return t;if(A(t))break;t=t.parentNode}return null}function $(t,e){e=e||v.fail;var i=[];return W(t,function(t){return A(t)||i.push(t),e(t)}),i}function V(t,e){e=e||v.fail;for(var i=[];t&&!e(t);)i.push(t),t=t.nextSibling;return i}function U(t,e){var i=e.nextSibling,n=e.parentNode;return i?n.insertBefore(t,i):n.appendChild(t),t}function G(i,t){return w.a.each(t,function(t,e){i.appendChild(e)}),i}function K(t){return 0===t.offset}function Z(t){return t.offset===X(t.node)}function Q(t){return K(t)||Z(t)}function J(t,e){for(;t&&t!==e;){if(0!==et(t))return!1;t=t.parentNode}return!0}function tt(t,e){if(!e)return!1;for(;t&&t!==e;){if(et(t)!==X(t.parentNode)-1)return!1;t=t.parentNode}return!0}function et(t){for(var e=0;t=t.previousSibling;)e+=1;return e}function it(t){return!!(t&&t.childNodes&&t.childNodes.length)}function nt(t,e){var i,n;if(0===t.offset){if(A(t.node))return null;i=t.node.parentNode,n=et(t.node)}else n=it(t.node)?X(i=t.node.childNodes[t.offset-1]):(i=t.node,e?0:t.offset-1);return{node:i,offset:n}}function ot(t,e){var i;if(X(t.node)===t.offset){if(A(t.node))return null;var n=rt(t.node),o=n?(i=n,0):(i=t.node.parentNode,et(t.node)+1)}else o=it(t.node)?(i=t.node.childNodes[t.offset],0):(i=t.node,e?X(t.node):t.offset+1);return{node:i,offset:o}}function at(t,e){var i;if(Y(t.node))return{node:i=t.node.nextSibling,offset:o=0};if(X(t.node)===t.offset){if(A(t.node))return null;var n=rt(t.node),o=n?(i=n,0):(i=t.node.parentNode,et(t.node)+1);A(i)&&(i=t.node.nextSibling,o=0)}else if(it(t.node)){if(o=0,Y(i=t.node.childNodes[t.offset]))return null}else if(i=t.node,o=e?X(t.node):t.offset+1,Y(i))return null;return{node:i,offset:o}}function rt(t){if(t.nextSibling&&t.parent===t.nextSibling.parent)return T(t.nextSibling)?t.nextSibling:rt(t.nextSibling)}function st(t,e){return t.node===e.node&&t.offset===e.offset}function lt(t,e){var i=e&&e.isSkipPaddingBlankHTML,n=e&&e.isNotSplitEdgePoint,o=e&&e.isDiscardEmptySplits;if(o&&(i=!0),Q(t)&&(T(t.node)||n)){if(K(t))return t.node;if(Z(t))return t.node.nextSibling}if(T(t.node))return t.node.splitText(t.offset);var a=t.node.childNodes[t.offset],r=U(t.node.cloneNode(!1),t.node);return G(r,V(a)),i||(q(t.node),q(r)),o&&(Y(t.node)&&ut(t.node),Y(r))?(ut(r),t.node.nextSibling):r}function ct(t,i,n){var e=$(i.node,v.eq(t));return e.length?1===e.length?lt(i,n):e.reduce(function(t,e){return t===i.node&&(t=lt(i,n)),lt({node:e,offset:t?et(t):X(e)},n)}):null}function ht(t){return document.createElement(t)}function ut(t,e){if(t&&t.parentNode){if(t.removeNode)return t.removeNode(e);var i=t.parentNode;if(!e){for(var n=[],o=0,a=t.childNodes.length;o<a;o++)n.push(t.childNodes[o]);for(var r=0,s=n.length;r<s;r++)i.insertBefore(n[r],t)}i.removeChild(t)}}var dt=S("TEXTAREA");function ft(t,e){var i=dt(t[0])?t.val():t.html();return e?i.replace(/[\n\r]/g,""):i}var pt={NBSP_CHAR:C,ZERO_WIDTH_NBSP_CHAR:"\ufeff",blank:H,emptyPara:"<p>".concat(H,"</p>"),makePredByNodeName:S,isEditable:A,isControlSizing:function(t){return t&&w()(t).hasClass("note-control-sizing")},isText:T,isElement:function(t){return t&&1===t.nodeType},isVoid:E,isPara:_,isPurePara:function(t){return _(t)&&!L(t)},isHeading:function(t){return t&&/^H[1-7]/.test(t.nodeName.toUpperCase())},isInline:I,isBlock:v.not(I),isBodyInline:function(t){return I(t)&&!W(t,_)},isBody:F,isParaInline:function(t){return I(t)&&!!W(t,_)},isPre:O,isList:M,isTable:P,isData:N,isCell:R,isBlockquote:z,isBodyContainer:j,isAnchor:B,isDiv:S("DIV"),isLi:L,isBR:S("BR"),isSpan:S("SPAN"),isB:S("B"),isU:S("U"),isS:S("S"),isI:S("I"),isImg:S("IMG"),isTextarea:dt,deepestChildIsEmpty:function(t){do{if(null===t.firstElementChild||""===t.firstElementChild.innerHTML)break}while(t=t.firstElementChild);return Y(t)},isEmpty:Y,isEmptyAnchor:v.and(B,Y),isClosestSibling:function(t,e){return t.nextSibling===e||t.previousSibling===e},withClosestSiblings:function(t,e){e=e||v.ok;var i=[];return t.previousSibling&&e(t.previousSibling)&&i.push(t.previousSibling),i.push(t),t.nextSibling&&e(t.nextSibling)&&i.push(t.nextSibling),i},nodeLength:X,isLeftEdgePoint:K,isRightEdgePoint:Z,isEdgePoint:Q,isLeftEdgeOf:J,isRightEdgeOf:tt,isLeftEdgePointOf:function(t,e){return K(t)&&J(t.node,e)},isRightEdgePointOf:function(t,e){return Z(t)&&tt(t.node,e)},prevPoint:nt,nextPoint:ot,nextPointWithEmptyNode:at,isSamePoint:st,isVisiblePoint:function(t){if(T(t.node)||!it(t.node)||Y(t.node))return!0;var e=t.node.childNodes[t.offset-1],i=t.node.childNodes[t.offset];return!(e&&!E(e)||i&&!E(i))},prevPointUntil:function(t,e){for(;t;){if(e(t))return t;t=nt(t)}return null},nextPointUntil:function(t,e){for(;t;){if(e(t))return t;t=ot(t)}return null},isCharPoint:function(t){if(!T(t.node))return!1;var e=t.node.nodeValue.charAt(t.offset-1);return e&&" "!==e&&e!==C},isSpacePoint:function(t){if(!T(t.node))return!1;var e=t.node.nodeValue.charAt(t.offset-1);return" "===e||e===C},walkPoint:function(t,e,i,n){for(var o=t;o&&(i(o),!st(o,e));)o=at(o,n&&t.node!==o.node&&e.node!==o.node)},ancestor:W,singleChildAncestor:function(t,e){for(t=t.parentNode;t&&1===X(t);){if(e(t))return t;if(A(t))break;t=t.parentNode}return null},listAncestor:$,lastAncestor:function(t,e){var i=$(t);return k.last(i.filter(e))},listNext:V,listPrev:function(t,e){e=e||v.fail;for(var i=[];t&&!e(t);)i.push(t),t=t.previousSibling;return i},listDescendant:function(o,a){var r=[];return a=a||v.ok,function t(e){o!==e&&a(e)&&r.push(e);for(var i=0,n=e.childNodes.length;i<n;i++)t(e.childNodes[i])}(o),r},commonAncestor:function(t,e){for(var i=$(t),n=e;n;n=n.parentNode)if(-1<i.indexOf(n))return n;return null},wrap:function(t,e){var i=t.parentNode,n=w()("<"+e+">")[0];return i.insertBefore(n,t),n.appendChild(t),n},insertAfter:U,appendChildNodes:G,position:et,hasChildren:it,makeOffsetPath:function(t,e){return $(e,v.eq(t)).map(et).reverse()},fromOffsetPath:function(t,e){for(var i=t,n=0,o=e.length;n<o;n++)i=i.childNodes.length<=e[n]?i.childNodes[i.childNodes.length-1]:i.childNodes[e[n]];return i},splitTree:ct,splitPoint:function(t,e){var i,n=e?_:j,o=$(t.node,n),a=k.last(o)||t.node,r=n(a)?(i=o[o.length-2],a):(i=a).parentNode,s=i&&ct(i,t,{isSkipPaddingBlankHTML:e,isNotSplitEdgePoint:e});return s||r!==t.node||(s=t.node.childNodes[t.offset]),{rightNode:s,container:r}},create:ht,createText:function(t){return document.createTextNode(t)},remove:ut,removeWhile:function(t,e){for(;t&&!A(t)&&e(t);){var i=t.parentNode;ut(t),t=i}},replace:function(t,e){if(t.nodeName.toUpperCase()===e.toUpperCase())return t;var i=ht(e);return t.style.cssText&&(i.style.cssText=t.style.cssText),G(i,k.from(t.childNodes)),U(i,t),ut(t),i},html:function(t,e){var i=ft(t);return e&&(i=(i=i.replace(/<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g,function(t,e,i){i=i.toUpperCase();var n=/^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(i)&&!!e,o=/^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(i);return t+(n||o?"\n":"")})).trim()),i},value:ft,posFromPlaceholder:function(t){var e=w()(t),i=e.offset(),n=e.outerHeight(!0);return{left:i.left,top:i.top+n}},attachEvents:function(e,i){Object.keys(i).forEach(function(t){e.on(t,i[t])})},detachEvents:function(e,i){Object.keys(i).forEach(function(t){e.off(t,i[t])})},isCustomStyleTag:function(t){return t&&!T(t)&&k.contains(t.classList,"note-styletag")}};function gt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var vt=function(){function i(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),this.$note=t,this.memos={},this.modules={},this.layoutInfo={},this.options=w.a.extend(!0,{},e),w.a.summernote.ui=w.a.summernote.ui_template(this.options),this.ui=w.a.summernote.ui,this.initialize()}var t,e,n;return t=i,(e=[{key:"initialize",value:function(){return this.layoutInfo=this.ui.createLayout(this.$note),this._initialize(),this.$note.hide(),this}},{key:"destroy",value:function(){this._destroy(),this.$note.removeData("summernote"),this.ui.removeLayout(this.$note,this.layoutInfo)}},{key:"reset",value:function(){var t=this.isDisabled();this.code(pt.emptyPara),this._destroy(),this._initialize(),t&&this.disable()}},{key:"_initialize",value:function(){var e=this;this.options.id=v.uniqueId(w.a.now()),this.options.container=this.options.container||this.layoutInfo.editor;var i=w.a.extend({},this.options.buttons);Object.keys(i).forEach(function(t){e.memo("button."+t,i[t])});var n=w.a.extend({},this.options.modules,w.a.summernote.plugins||{});Object.keys(n).forEach(function(t){e.module(t,n[t],!0)}),Object.keys(this.modules).forEach(function(t){e.initializeModule(t)})}},{key:"_destroy",value:function(){var e=this;Object.keys(this.modules).reverse().forEach(function(t){e.removeModule(t)}),Object.keys(this.memos).forEach(function(t){e.removeMemo(t)}),this.triggerEvent("destroy",this)}},{key:"code",value:function(t){var e=this.invoke("codeview.isActivated");if(void 0===t)return this.invoke("codeview.sync"),e?this.layoutInfo.codable.val():this.layoutInfo.editable.html();e?this.invoke("codeview.sync",t):this.layoutInfo.editable.html(t),this.$note.val(t),this.triggerEvent("change",t,this.layoutInfo.editable)}},{key:"isDisabled",value:function(){return"false"===this.layoutInfo.editable.attr("contenteditable")}},{key:"enable",value:function(){this.layoutInfo.editable.attr("contenteditable",!0),this.invoke("toolbar.activate",!0),this.triggerEvent("disable",!1),this.options.editing=!0}},{key:"disable",value:function(){this.invoke("codeview.isActivated")&&this.invoke("codeview.deactivate"),this.layoutInfo.editable.attr("contenteditable",!1),this.options.editing=!1,this.invoke("toolbar.deactivate",!0),this.triggerEvent("disable",!0)}},{key:"triggerEvent",value:function(){var t=k.head(arguments),e=k.tail(k.from(arguments)),i=this.options.callbacks[v.namespaceToCamel(t,"on")];i&&i.apply(this.$note[0],e),this.$note.trigger("summernote."+t,e)}},{key:"initializeModule",value:function(t){var e=this.modules[t];e.shouldInitialize=e.shouldInitialize||v.ok,e.shouldInitialize()&&(e.initialize&&e.initialize(),e.events&&pt.attachEvents(this.$note,e.events))}},{key:"module",value:function(t,e,i){if(1===arguments.length)return this.modules[t];this.modules[t]=new e(this),i||this.initializeModule(t)}},{key:"removeModule",value:function(t){var e=this.modules[t];e.shouldInitialize()&&(e.events&&pt.detachEvents(this.$note,e.events),e.destroy&&e.destroy()),delete this.modules[t]}},{key:"memo",value:function(t,e){if(1===arguments.length)return this.memos[t];this.memos[t]=e}},{key:"removeMemo",value:function(t){this.memos[t]&&this.memos[t].destroy&&this.memos[t].destroy(),delete this.memos[t]}},{key:"createInvokeHandlerAndUpdateState",value:function(e,i){var n=this;return function(t){n.createInvokeHandler(e,i)(t),n.invoke("buttons.updateCurrentStyle")}}},{key:"createInvokeHandler",value:function(i,n){var o=this;return function(t){t.preventDefault();var e=w()(t.target);o.invoke(i,n||e.closest("[data-value]").data("value"),e)}}},{key:"invoke",value:function(){var t=k.head(arguments),e=k.tail(k.from(arguments)),i=t.split("."),n=1<i.length,o=n&&k.head(i),a=n?k.last(i):k.head(i),r=this.modules[o||"editor"];return!o&&this[a]?this[a].apply(this,e):r&&r[a]&&r.shouldInitialize()?r[a].apply(r,e):void 0}}])&&gt(t.prototype,e),n&&gt(t,n),i}();function mt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function bt(t,e){for(var i,n=t.parentElement(),o=document.body.createTextRange(),a=k.from(n.childNodes),r=0;r<a.length;r++)if(!pt.isText(a[r])){if(o.moveToElementText(a[r]),0<=o.compareEndPoints("StartToStart",t))break;i=a[r]}if(0!==r&&pt.isText(a[r-1])){var s=document.body.createTextRange(),l=null;s.moveToElementText(i||n),s.collapse(!i),l=i?i.nextSibling:n.firstChild;var c=t.duplicate();c.setEndPoint("StartToStart",s);for(var h=c.text.replace(/[\r\n]/g,"").length;h>l.nodeValue.length&&l.nextSibling;)h-=l.nodeValue.length,l=l.nextSibling;l.nodeValue;e&&l.nextSibling&&pt.isText(l.nextSibling)&&h===l.nodeValue.length&&(h-=l.nodeValue.length,l=l.nextSibling),n=l,r=h}return{cont:n,offset:r}}function yt(t){var e=document.body.createTextRange(),i=function t(e,i){var n;if(pt.isText(e)){var o=pt.listPrev(e,v.not(pt.isText)),a=k.last(o).previousSibling,r=a||e.parentNode;i+=k.sum(k.tail(o),pt.nodeLength),n=!a}else{if(r=e.childNodes[i]||e,pt.isText(r))return t(r,0);i=0,n=!1}return{node:r,collapseToStart:n,offset:i}}(t.node,t.offset);return e.moveToElementText(i.node),e.collapse(i.collapseToStart),e.moveStart("character",i.offset),e}w.a.fn.extend({summernote:function(){var t=w.a.type(k.head(arguments)),e="string"===t,i="object"===t,o=w.a.extend({},w.a.summernote.options,i?k.head(arguments):{});o.langInfo=w.a.extend(!0,{},w.a.summernote.lang["en-US"],w.a.summernote.lang[o.lang]),o.icons=w.a.extend(!0,{},w.a.summernote.options.icons,o.icons),o.tooltip="auto"===o.tooltip?!p.isSupportTouch:o.tooltip,this.each(function(t,e){var i,n=w()(e);n.data("summernote")||(i=new vt(n,o),n.data("summernote",i),n.data("summernote").triggerEvent("init",i.layoutInfo))});var n=this.first();if(n.length){var a=n.data("summernote");if(e)return a.invoke.apply(a,k.from(arguments));o.focus&&a.invoke("editor.focus")}return this}});var xt=function(){function r(t,e,i,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),this.sc=t,this.so=e,this.ec=i,this.eo=n,this.isOnEditable=this.makeIsOn(pt.isEditable),this.isOnList=this.makeIsOn(pt.isList),this.isOnAnchor=this.makeIsOn(pt.isAnchor),this.isOnCell=this.makeIsOn(pt.isCell),this.isOnData=this.makeIsOn(pt.isData)}var t,e,i;return t=r,(e=[{key:"nativeRange",value:function(){if(p.isW3CRangeSupport){var t=document.createRange();return t.setStart(this.sc,this.so),t.setEnd(this.ec,this.eo),t}var e=yt({node:this.sc,offset:this.so});return e.setEndPoint("EndToEnd",yt({node:this.ec,offset:this.eo})),e}},{key:"getPoints",value:function(){return{sc:this.sc,so:this.so,ec:this.ec,eo:this.eo}}},{key:"getStartPoint",value:function(){return{node:this.sc,offset:this.so}}},{key:"getEndPoint",value:function(){return{node:this.ec,offset:this.eo}}},{key:"select",value:function(){var t,e=this.nativeRange();return p.isW3CRangeSupport?(0<(t=document.getSelection()).rangeCount&&t.removeAllRanges(),t.addRange(e)):e.select(),this}},{key:"scrollIntoView",value:function(t){var e=w()(t).height();return t.scrollTop+e<this.sc.offsetTop&&(t.scrollTop+=Math.abs(t.scrollTop+e-this.sc.offsetTop)),this}},{key:"normalize",value:function(){function t(t,e){if(!t)return t;if(pt.isVisiblePoint(t)&&(!pt.isEdgePoint(t)||pt.isRightEdgePoint(t)&&!e||pt.isLeftEdgePoint(t)&&e||pt.isRightEdgePoint(t)&&e&&pt.isVoid(t.node.nextSibling)||pt.isLeftEdgePoint(t)&&!e&&pt.isVoid(t.node.previousSibling)||pt.isBlock(t.node)&&pt.isEmpty(t.node)))return t;var i,n=pt.ancestor(t.node,pt.isBlock),o=!1;o||(i=pt.prevPoint(t)||{node:null},o=(pt.isLeftEdgePointOf(t,n)||pt.isVoid(i.node))&&!e);var a,r=!1;if(r||(a=pt.nextPoint(t)||{node:null},r=(pt.isRightEdgePointOf(t,n)||pt.isVoid(a.node))&&e),o||r){if(pt.isVisiblePoint(t))return t;e=!e}return(e?pt.nextPointUntil(pt.nextPoint(t),pt.isVisiblePoint):pt.prevPointUntil(pt.prevPoint(t),pt.isVisiblePoint))||t}var e=t(this.getEndPoint(),!1),i=this.isCollapsed()?e:t(this.getStartPoint(),!0);return new r(i.node,i.offset,e.node,e.offset)}},{key:"nodes",value:function(i,t){i=i||v.ok;var n=t&&t.includeAncestor,o=t&&t.fullyContains,e=this.getStartPoint(),a=this.getEndPoint(),r=[],s=[];return pt.walkPoint(e,a,function(t){var e;pt.isEditable(t.node)||(o?(pt.isLeftEdgePoint(t)&&s.push(t.node),pt.isRightEdgePoint(t)&&k.contains(s,t.node)&&(e=t.node)):e=n?pt.ancestor(t.node,i):t.node,e&&i(e)&&r.push(e))},!0),k.unique(r)}},{key:"commonAncestor",value:function(){return pt.commonAncestor(this.sc,this.ec)}},{key:"expand",value:function(t){var e=pt.ancestor(this.sc,t),i=pt.ancestor(this.ec,t);if(!e&&!i)return new r(this.sc,this.so,this.ec,this.eo);var n=this.getPoints();return e&&(n.sc=e,n.so=0),i&&(n.ec=i,n.eo=pt.nodeLength(i)),new r(n.sc,n.so,n.ec,n.eo)}},{key:"collapse",value:function(t){return t?new r(this.sc,this.so,this.sc,this.so):new r(this.ec,this.eo,this.ec,this.eo)}},{key:"splitText",value:function(){var t=this.sc===this.ec,e=this.getPoints();return pt.isText(this.ec)&&!pt.isEdgePoint(this.getEndPoint())&&this.ec.splitText(this.eo),pt.isText(this.sc)&&!pt.isEdgePoint(this.getStartPoint())&&(e.sc=this.sc.splitText(this.so),e.so=0,t&&(e.ec=e.sc,e.eo=this.eo-this.so)),new r(e.sc,e.so,e.ec,e.eo)}},{key:"deleteContents",value:function(){if(this.isCollapsed())return this;var t=this.splitText(),e=t.nodes(null,{fullyContains:!0}),n=pt.prevPointUntil(t.getStartPoint(),function(t){return!k.contains(e,t.node)}),o=[];return w.a.each(e,function(t,e){var i=e.parentNode;n.node!==i&&1===pt.nodeLength(i)&&o.push(i),pt.remove(e,!1)}),w.a.each(o,function(t,e){pt.remove(e,!1)}),new r(n.node,n.offset,n.node,n.offset).normalize()}},{key:"makeIsOn",value:function(e){return function(){var t=pt.ancestor(this.sc,e);return!!t&&t===pt.ancestor(this.ec,e)}}},{key:"isLeftEdgeOf",value:function(t){if(!pt.isLeftEdgePoint(this.getStartPoint()))return!1;var e=pt.ancestor(this.sc,t);return e&&pt.isLeftEdgeOf(this.sc,e)}},{key:"isCollapsed",value:function(){return this.sc===this.ec&&this.so===this.eo}},{key:"wrapBodyInlineWithPara",value:function(){if(pt.isBodyContainer(this.sc)&&pt.isEmpty(this.sc))return this.sc.innerHTML=pt.emptyPara,new r(this.sc.firstChild,0,this.sc.firstChild,0);var t,e,i,n,o=this.normalize();return pt.isParaInline(this.sc)||pt.isPara(this.sc)?o:(pt.isInline(o.sc)?(t=pt.listAncestor(o.sc,v.not(pt.isInline)),e=k.last(t),pt.isInline(e)||(e=t[t.length-2]||o.sc.childNodes[o.so])):e=o.sc.childNodes[0<o.so?o.so-1:0],!e||(n=(n=pt.listPrev(e,pt.isParaInline).reverse()).concat(pt.listNext(e.nextSibling,pt.isParaInline))).length&&(i=pt.wrap(k.head(n),"p"),pt.appendChildNodes(i,k.tail(n))),this.normalize())}},{key:"insertNode",value:function(t){var e=this;(pt.isText(t)||pt.isInline(t))&&(e=this.wrapBodyInlineWithPara().deleteContents());var i=pt.splitPoint(e.getStartPoint(),pt.isInline(t));return i.rightNode?(i.rightNode.parentNode.insertBefore(t,i.rightNode),pt.isEmpty(i.rightNode)&&pt.isPara(t)&&i.rightNode.parentNode.removeChild(i.rightNode)):i.container.appendChild(t),t}},{key:"pasteHTML",value:function(t){t=w.a.trim(t);var e=w()("<div></div>").html(t)[0],i=k.from(e.childNodes),n=this,o=!1;return 0<=n.so&&(i=i.reverse(),o=!0),i=i.map(function(t){return n.insertNode(t)}),o&&(i=i.reverse()),i}},{key:"toString",value:function(){var t=this.nativeRange();return p.isW3CRangeSupport?t.toString():t.text}},{key:"getWordRange",value:function(t){var e=this.getEndPoint();if(!pt.isCharPoint(e))return this;var i=pt.prevPointUntil(e,function(t){return!pt.isCharPoint(t)});return t&&(e=pt.nextPointUntil(e,function(t){return!pt.isCharPoint(t)})),new r(i.node,i.offset,e.node,e.offset)}},{key:"getWordsRange",value:function(t){function e(t){return!pt.isCharPoint(t)&&!pt.isSpacePoint(t)}var i=this.getEndPoint();if(e(i))return this;var n=pt.prevPointUntil(i,e);return t&&(i=pt.nextPointUntil(i,e)),new r(n.node,n.offset,i.node,i.offset)}},{key:"getWordsMatchRange",value:function(n){var o=this.getEndPoint(),t=pt.prevPointUntil(o,function(t){if(!pt.isCharPoint(t)&&!pt.isSpacePoint(t))return!0;var e=new r(t.node,t.offset,o.node,o.offset),i=n.exec(e.toString());return i&&0===i.index}),e=new r(t.node,t.offset,o.node,o.offset),i=e.toString(),a=n.exec(i);return a&&a[0].length===i.length?e:null}},{key:"bookmark",value:function(t){return{s:{path:pt.makeOffsetPath(t,this.sc),offset:this.so},e:{path:pt.makeOffsetPath(t,this.ec),offset:this.eo}}}},{key:"paraBookmark",value:function(t){return{s:{path:k.tail(pt.makeOffsetPath(k.head(t),this.sc)),offset:this.so},e:{path:k.tail(pt.makeOffsetPath(k.last(t),this.ec)),offset:this.eo}}}},{key:"getClientRects",value:function(){return this.nativeRange().getClientRects()}}])&&mt(t.prototype,e),i&&mt(t,i),r}(),wt={create:function(t,e,i,n){if(4===arguments.length)return new xt(t,e,i,n);if(2===arguments.length)return new xt(i=t,n=e,i,n);var o=this.createFromSelection();if(o||1!==arguments.length)return o;var a=t;return pt.isEditable(a)&&(a=a.lastChild),this.createFromBodyElement(a,pt.emptyPara===t.innerHTML)},createFromBodyElement:function(t,e){var i=1<arguments.length&&void 0!==e&&e;return this.createFromNode(t).collapse(i)},createFromSelection:function(){if(p.isW3CRangeSupport){var t=document.getSelection();if(!t||0===t.rangeCount)return null;if(pt.isBody(t.anchorNode))return null;var e=t.getRangeAt(0),i=e.startContainer,n=e.startOffset,o=e.endContainer,a=e.endOffset}else{var r=document.selection.createRange(),s=r.duplicate();s.collapse(!1);var l=r;l.collapse(!0);var c=bt(l,!0),h=bt(s,!1);pt.isText(c.node)&&pt.isLeftEdgePoint(c)&&pt.isTextNode(h.node)&&pt.isRightEdgePoint(h)&&h.node.nextSibling===c.node&&(c=h),i=c.cont,n=c.offset,o=h.cont,a=h.offset}return new xt(i,n,o,a)},createFromNode:function(t){var e=t,i=0,n=t,o=pt.nodeLength(n);return pt.isVoid(e)&&(i=pt.listPrev(e).length-1,e=e.parentNode),pt.isBR(n)?(o=pt.listPrev(n).length-1,n=n.parentNode):pt.isVoid(n)&&(o=pt.listPrev(n).length,n=n.parentNode),this.create(e,i,n,o)},createFromNodeBefore:function(t){return this.createFromNode(t).collapse(!0)},createFromNodeAfter:function(t){return this.createFromNode(t).collapse()},createFromBookmark:function(t,e){var i=pt.fromOffsetPath(t,e.s.path),n=e.s.offset,o=pt.fromOffsetPath(t,e.e.path),a=e.e.offset;return new xt(i,n,o,a)},createFromParaBookmark:function(t,e){var i=t.s.offset,n=t.e.offset,o=pt.fromOffsetPath(k.head(e),t.s.path),a=pt.fromOffsetPath(k.last(e),t.e.path);return new xt(o,i,a,n)}},kt={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,LEFT:37,UP:38,RIGHT:39,DOWN:40,NUM0:48,NUM1:49,NUM2:50,NUM3:51,NUM4:52,NUM5:53,NUM6:54,NUM7:55,NUM8:56,B:66,E:69,I:73,J:74,K:75,L:76,R:82,S:83,U:85,V:86,Y:89,Z:90,SLASH:191,LEFTBRACKET:219,BACKSLASH:220,RIGHTBRACKET:221,HOME:36,END:35,PAGEUP:33,PAGEDOWN:34},Ct={isEdit:function(t){return k.contains([kt.BACKSPACE,kt.TAB,kt.ENTER,kt.SPACE,kt.DELETE],t)},isMove:function(t){return k.contains([kt.LEFT,kt.UP,kt.RIGHT,kt.DOWN],t)},isNavigation:function(t){return k.contains([kt.HOME,kt.END,kt.PAGEUP,kt.PAGEDOWN],t)},nameFromCode:v.invertObject(kt),code:kt};function At(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var St=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.stack=[],this.stackOffset=-1,this.context=t,this.$editable=t.layoutInfo.editable,this.editable=this.$editable[0]}var t,i,n;return t=e,(i=[{key:"makeSnapshot",value:function(){var t=wt.create(this.editable);return{contents:this.$editable.html(),bookmark:t&&t.isOnEditable()?t.bookmark(this.editable):{s:{path:[],offset:0},e:{path:[],offset:0}}}}},{key:"applySnapshot",value:function(t){null!==t.contents&&this.$editable.html(t.contents),null!==t.bookmark&&wt.createFromBookmark(this.editable,t.bookmark).select()}},{key:"rewind",value:function(){this.$editable.html()!==this.stack[this.stackOffset].contents&&this.recordUndo(),this.stackOffset=0,this.applySnapshot(this.stack[this.stackOffset])}},{key:"commit",value:function(){this.stack=[],this.stackOffset=-1,this.recordUndo()}},{key:"reset",value:function(){this.stack=[],this.stackOffset=-1,this.$editable.html(""),this.recordUndo()}},{key:"undo",value:function(){this.$editable.html()!==this.stack[this.stackOffset].contents&&this.recordUndo(),0<this.stackOffset&&(this.stackOffset--,this.applySnapshot(this.stack[this.stackOffset]))}},{key:"redo",value:function(){this.stack.length-1>this.stackOffset&&(this.stackOffset++,this.applySnapshot(this.stack[this.stackOffset]))}},{key:"recordUndo",value:function(){this.stackOffset++,this.stack.length>this.stackOffset&&(this.stack=this.stack.slice(0,this.stackOffset)),this.stack.push(this.makeSnapshot()),this.stack.length>this.context.options.historyLimit&&(this.stack.shift(),--this.stackOffset)}}])&&At(t.prototype,i),n&&At(t,n),e}();function Tt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Et=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,n;return e=t,(i=[{key:"jQueryCSS",value:function(i,t){if(p.jqueryVersion<1.9){var n={};return w.a.each(t,function(t,e){n[e]=i.css(e)}),n}return i.css(t)}},{key:"fromNode",value:function(t){var e=this.jQueryCSS(t,["font-family","font-size","text-align","list-style-type","line-height"])||{},i=t[0].style.fontSize||e["font-size"];return e["font-size"]=parseInt(i,10),e["font-size-unit"]=i.match(/[a-z%]+$/),e}},{key:"stylePara",value:function(t,i){w.a.each(t.nodes(pt.isPara,{includeAncestor:!0}),function(t,e){w()(e).css(i)})}},{key:"styleNodes",value:function(t,e){t=t.splitText();var i=e&&e.nodeName||"SPAN",n=!(!e||!e.expandClosestSibling),o=!(!e||!e.onlyPartialContains);if(t.isCollapsed())return[t.insertNode(pt.create(i))];var a,r=pt.makePredByNodeName(i),s=t.nodes(pt.isText,{fullyContains:!0}).map(function(t){return pt.singleChildAncestor(t,r)||pt.wrap(t,i)});return n?(o&&(a=t.nodes(),r=v.and(r,function(t){return k.contains(a,t)})),s.map(function(t){var e=pt.withClosestSiblings(t,r),i=k.head(e),n=k.tail(e);return w.a.each(n,function(t,e){pt.appendChildNodes(i,e.childNodes),pt.remove(e)}),k.head(e)})):s}},{key:"current",value:function(t){var e,i=w()(pt.isElement(t.sc)?t.sc:t.sc.parentNode),n=this.fromNode(i);try{n=w.a.extend(n,{"font-bold":document.queryCommandState("bold")?"bold":"normal","font-italic":document.queryCommandState("italic")?"italic":"normal","font-underline":document.queryCommandState("underline")?"underline":"normal","font-subscript":document.queryCommandState("subscript")?"subscript":"normal","font-superscript":document.queryCommandState("superscript")?"superscript":"normal","font-strikethrough":document.queryCommandState("strikethrough")?"strikethrough":"normal","font-family":document.queryCommandValue("fontname")||n["font-family"]})}catch(t){}t.isOnList()?(e=-1<["circle","disc","disc-leading-zero","square"].indexOf(n["list-style-type"]),n["list-style"]=e?"unordered":"ordered"):n["list-style"]="none";var o,a=pt.ancestor(t.sc,pt.isPara);return a&&a.style["line-height"]?n["line-height"]=a.style.lineHeight:(o=parseInt(n["line-height"],10)/parseInt(n["font-size"],10),n["line-height"]=o.toFixed(1)),n.anchor=t.isOnAnchor()&&pt.ancestor(t.sc,pt.isAnchor),n.ancestors=pt.listAncestor(t.sc,pt.isEditable),n.range=t,n}}])&&Tt(e.prototype,i),n&&Tt(e,n),t}();function _t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Ot=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,n;return e=t,(i=[{key:"insertOrderedList",value:function(t){this.toggleList("OL",t)}},{key:"insertUnorderedList",value:function(t){this.toggleList("UL",t)}},{key:"indent",value:function(t){var o=this,e=wt.create(t).wrapBodyInlineWithPara(),i=e.nodes(pt.isPara,{includeAncestor:!0}),n=k.clusterBy(i,v.peq2("parentNode"));w.a.each(n,function(t,e){var i,n=k.head(e);pt.isLi(n)?(i=o.findList(n.previousSibling))?e.map(function(t){return i.appendChild(t)}):(o.wrapList(e,n.parentNode.nodeName),e.map(function(t){return t.parentNode}).map(function(t){return o.appendToPrevious(t)})):w.a.each(e,function(t,e){w()(e).css("marginLeft",function(t,e){return(parseInt(e,10)||0)+25})})}),e.select()}},{key:"outdent",value:function(t){var n=this,e=wt.create(t).wrapBodyInlineWithPara(),i=e.nodes(pt.isPara,{includeAncestor:!0}),o=k.clusterBy(i,v.peq2("parentNode"));w.a.each(o,function(t,e){var i=k.head(e);pt.isLi(i)?n.releaseList([e]):w.a.each(e,function(t,e){w()(e).css("marginLeft",function(t,e){return 25<(e=parseInt(e,10)||0)?e-25:""})})}),e.select()}},{key:"toggleList",value:function(i,t){var n,e,o=this,a=wt.create(t).wrapBodyInlineWithPara(),r=a.nodes(pt.isPara,{includeAncestor:!0}),s=a.paraBookmark(r),l=k.clusterBy(r,v.peq2("parentNode"));k.find(r,pt.isPurePara)?(n=[],w.a.each(l,function(t,e){n=n.concat(o.wrapList(e,i))}),r=n):(e=a.nodes(pt.isList,{includeAncestor:!0}).filter(function(t){return!w.a.nodeName(t,i)})).length?w.a.each(e,function(t,e){pt.replace(e,i)}):r=this.releaseList(l,!0),wt.createFromParaBookmark(s,r).select()}},{key:"wrapList",value:function(t,e){var i=k.head(t),n=k.last(t),o=pt.isList(i.previousSibling)&&i.previousSibling,a=pt.isList(n.nextSibling)&&n.nextSibling,r=o||pt.insertAfter(pt.create(e||"UL"),n);return t=t.map(function(t){return pt.isPurePara(t)?pt.replace(t,"LI"):t}),pt.appendChildNodes(r,t),a&&(pt.appendChildNodes(r,k.from(a.childNodes)),pt.remove(a)),t}},{key:"releaseList",value:function(t,c){var h=this,u=[];return w.a.each(t,function(t,e){var i,n,o,a=k.head(e),r=k.last(e),s=c?pt.lastAncestor(a,pt.isList):a.parentNode,l=s.parentNode;"LI"===s.parentNode.nodeName?(e.map(function(t){var e=h.findNextSiblings(t);l.nextSibling?l.parentNode.insertBefore(t,l.nextSibling):l.parentNode.appendChild(t),e.length&&(h.wrapList(e,s.nodeName),t.appendChild(e[0].parentNode))}),0===s.children.length&&l.removeChild(s),0===l.childNodes.length&&l.parentNode.removeChild(l)):(i=1<s.childNodes.length?pt.splitTree(s,{node:r.parentNode,offset:pt.position(r)+1},{isSkipPaddingBlankHTML:!0}):null,n=pt.splitTree(s,{node:a.parentNode,offset:pt.position(a)},{isSkipPaddingBlankHTML:!0}),e=c?pt.listDescendant(n,pt.isLi):k.from(n.childNodes).filter(pt.isLi),!c&&pt.isList(s.parentNode)||(e=e.map(function(t){return pt.replace(t,"P")})),w.a.each(k.from(e).reverse(),function(t,e){pt.insertAfter(e,s)}),o=k.compact([s,n,i]),w.a.each(o,function(t,e){var i=[e].concat(pt.listDescendant(e,pt.isList));w.a.each(i.reverse(),function(t,e){pt.nodeLength(e)||pt.remove(e,!0)})})),u=u.concat(e)}),u}},{key:"appendToPrevious",value:function(t){return t.previousSibling?pt.appendChildNodes(t.previousSibling,[t]):this.wrapList([t],"LI")}},{key:"findList",value:function(t){return t?k.find(t.children,function(t){return-1<["OL","UL"].indexOf(t.nodeName)}):null}},{key:"findNextSiblings",value:function(t){for(var e=[];t.nextSibling;)e.push(t.nextSibling),t=t.nextSibling;return e}}])&&_t(e.prototype,i),n&&_t(e,n),t}();function Lt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Pt=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.bullet=new Ot,this.options=t.options}var t,i,n;return t=e,(i=[{key:"insertTab",value:function(t,e){var i=pt.createText(new Array(e+1).join(pt.NBSP_CHAR));(t=t.deleteContents()).insertNode(i,!0),(t=wt.create(i,e)).select()}},{key:"insertParagraph",value:function(t,e){e=(e=(e=e||wt.create(t)).deleteContents()).wrapBodyInlineWithPara();var i=pt.ancestor(e.sc,pt.isPara);if(i){if(pt.isLi(i)&&(pt.isEmpty(i)||pt.deepestChildIsEmpty(i)))return void this.bullet.toggleList(i.parentNode.nodeName);var n,o,a=null;1===this.options.blockquoteBreakingLevel?a=pt.ancestor(i,pt.isBlockquote):2===this.options.blockquoteBreakingLevel&&(a=pt.lastAncestor(i,pt.isBlockquote)),a?(s=w()(pt.emptyPara)[0],pt.isRightEdgePoint(e.getStartPoint())&&pt.isBR(e.sc.nextSibling)&&w()(e.sc.nextSibling).remove(),(n=pt.splitTree(a,e.getStartPoint(),{isDiscardEmptySplits:!0}))?n.parentNode.insertBefore(s,n):pt.insertAfter(s,a)):(s=pt.splitTree(i,e.getStartPoint()),o=(o=pt.listDescendant(i,pt.isEmptyAnchor)).concat(pt.listDescendant(s,pt.isEmptyAnchor)),w.a.each(o,function(t,e){pt.remove(e)}),(pt.isHeading(s)||pt.isPre(s)||pt.isCustomStyleTag(s))&&pt.isEmpty(s)&&(s=pt.replace(s,"p")))}else{var r=e.sc.childNodes[e.so],s=w()(pt.emptyPara)[0];r?e.sc.insertBefore(s,r):e.sc.appendChild(s)}wt.create(s,0).normalize().select().scrollIntoView(t)}}])&&Lt(t.prototype,i),n&&Lt(t,n),e}();function Nt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function It(t,d,f,o){var p={colPos:0,rowPos:0},g=[],v=[];function m(t,e,i,n,o,a,r){var s={baseRow:i,baseCell:n,isRowSpan:o,isColSpan:a,isVirtual:r};g[t]||(g[t]=[]),g[t][e]=s}function b(t,e){if(!g[t])return e;if(!g[t][e])return e;for(var i=e;g[t][i];)if(i++,!g[t][i])return i}function y(t,e,i,n){t===p.rowPos&&p.colPos>=i.cellIndex&&i.cellIndex<=e&&!n&&p.colPos++}function e(){for(var t=o.rows,e=0;e<t.length;e++)for(var i=t[e].cells,n=0;n<i.length;n++)!function(t,e){var i=b(t.rowIndex,e.cellIndex),n=1<e.colSpan,o=1<e.rowSpan,a=t.rowIndex===p.rowPos&&e.cellIndex===p.colPos;m(t.rowIndex,i,t,e,o,n,!1);var r=e.attributes.rowSpan?parseInt(e.attributes.rowSpan.value,10):0;if(1<r)for(var s=1;s<r;s++){var l=t.rowIndex+s;y(l,i,e,a),m(l,i,t,e,!0,n,!0)}var c=e.attributes.colSpan?parseInt(e.attributes.colSpan.value,10):0;if(1<c)for(var h=1;h<c;h++){var u=b(t.rowIndex,i+h);y(t.rowIndex,u,e,a),m(t.rowIndex,u,t,e,o,!0,!0)}}(t[e],i[n])}this.getActionList=function(){for(var t,e,i,n=d===It.where.Row?p.rowPos:-1,o=d===It.where.Column?p.colPos:-1,a=0,r=!0;r;){var s=0<=n?n:a,l=0<=o?o:a,c=g[s];if(!c)return r=!1,v;var h=c[l];if(!h)return r=!1,v;var u=It.resultAction.Ignore;switch(f){case It.requestAction.Add:u=function(t){switch(d){case It.where.Column:if(t.isColSpan)return It.resultAction.SumSpanCount;if(t.isRowSpan&&t.isVirtual)return It.resultAction.Ignore;break;case It.where.Row:if(t.isRowSpan)return It.resultAction.SumSpanCount;if(t.isColSpan&&t.isVirtual)return It.resultAction.Ignore}return It.resultAction.AddCell}(h);break;case It.requestAction.Delete:u=function(t){switch(d){case It.where.Column:if(t.isColSpan)return It.resultAction.SubtractSpanCount;break;case It.where.Row:if(!t.isVirtual&&t.isRowSpan)return It.resultAction.AddCell;if(t.isRowSpan)return It.resultAction.SubtractSpanCount}return It.resultAction.RemoveCell}(h)}v.push((t=u,e=s,i=l,{baseCell:h.baseCell,action:t,virtualTable:{rowIndex:e,cellIndex:i}})),a++}return v},t&&t.tagName&&("td"===t.tagName.toLowerCase()||"th"===t.tagName.toLowerCase())&&(p.colPos=t.cellIndex,t.parentElement&&t.parentElement.tagName&&"tr"===t.parentElement.tagName.toLowerCase()&&(p.rowPos=t.parentElement.rowIndex)),e()}It.where={Row:0,Column:1},It.requestAction={Add:0,Delete:1},It.resultAction={Ignore:0,SubtractSpanCount:1,RemoveCell:2,AddCell:3,SumSpanCount:4};var Mt=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,n;return e=t,(i=[{key:"tab",value:function(t,e){var i=pt.ancestor(t.commonAncestor(),pt.isCell),n=pt.ancestor(i,pt.isTable),o=pt.listDescendant(n,pt.isCell),a=k[e?"prev":"next"](o,i);a&&wt.create(a,0).select()}},{key:"addRow",value:function(t,e){for(var i=pt.ancestor(t.commonAncestor(),pt.isCell),n=w()(i).closest("tr"),o=this.recoverAttributes(n),a=w()("<tr"+o+"></tr>"),r=new It(i,It.where.Row,It.requestAction.Add,w()(n).closest("table")[0]).getActionList(),s=0;s<r.length;s++){var l=r[s],c=this.recoverAttributes(l.baseCell);switch(l.action){case It.resultAction.AddCell:a.append("<td"+c+">"+pt.blank+"</td>");break;case It.resultAction.SumSpanCount:if("top"===e)if((l.baseCell.parent?l.baseCell.closest("tr").rowIndex:0)<=n[0].rowIndex){var h=w()("<div></div>").append(w()("<td"+c+">"+pt.blank+"</td>").removeAttr("rowspan")).html();a.append(h);break}var u=parseInt(l.baseCell.rowSpan,10);u++,l.baseCell.setAttribute("rowSpan",u)}}if("top"===e)n.before(a);else{if(1<i.rowSpan){var d=n[0].rowIndex+(i.rowSpan-2);return void w()(w()(n).parent().find("tr")[d]).after(w()(a))}n.after(a)}}},{key:"addCol",value:function(t,e){var i=pt.ancestor(t.commonAncestor(),pt.isCell),n=w()(i).closest("tr");w()(n).siblings().push(n);for(var o=new It(i,It.where.Column,It.requestAction.Add,w()(n).closest("table")[0]).getActionList(),a=0;a<o.length;a++){var r,s=o[a],l=this.recoverAttributes(s.baseCell);switch(s.action){case It.resultAction.AddCell:"right"===e?w()(s.baseCell).after("<td"+l+">"+pt.blank+"</td>"):w()(s.baseCell).before("<td"+l+">"+pt.blank+"</td>");break;case It.resultAction.SumSpanCount:"right"===e?(r=parseInt(s.baseCell.colSpan,10),r++,s.baseCell.setAttribute("colSpan",r)):w()(s.baseCell).before("<td"+l+">"+pt.blank+"</td>")}}}},{key:"recoverAttributes",value:function(t){var e="";if(!t)return e;for(var i=t.attributes||[],n=0;n<i.length;n++)"id"!==i[n].name.toLowerCase()&&i[n].specified&&(e+=" "+i[n].name+"='"+i[n].value+"'");return e}},{key:"deleteRow",value:function(t){for(var e=pt.ancestor(t.commonAncestor(),pt.isCell),i=w()(e).closest("tr"),n=i.children("td, th").index(w()(e)),o=i[0].rowIndex,a=new It(e,It.where.Row,It.requestAction.Delete,w()(i).closest("table")[0]).getActionList(),r=0;r<a.length;r++)if(a[r]){var s=a[r].baseCell,l=a[r].virtualTable,c=s.rowSpan&&1<s.rowSpan,h=c?parseInt(s.rowSpan,10):0;switch(a[r].action){case It.resultAction.Ignore:continue;case It.resultAction.AddCell:var u=i.next("tr")[0];if(!u)continue;var d=i[0].cells[n];c&&(2<h?(h--,u.insertBefore(d,u.cells[n]),u.cells[n].setAttribute("rowSpan",h),u.cells[n].innerHTML=""):2===h&&(u.insertBefore(d,u.cells[n]),u.cells[n].removeAttribute("rowSpan"),u.cells[n].innerHTML=""));continue;case It.resultAction.SubtractSpanCount:c&&(2<h?(h--,s.setAttribute("rowSpan",h),l.rowIndex!==o&&s.cellIndex===n&&(s.innerHTML="")):2===h&&(s.removeAttribute("rowSpan"),l.rowIndex!==o&&s.cellIndex===n&&(s.innerHTML="")));continue;case It.resultAction.RemoveCell:continue}}i.remove()}},{key:"deleteCol",value:function(t){for(var e=pt.ancestor(t.commonAncestor(),pt.isCell),i=w()(e).closest("tr"),n=i.children("td, th").index(w()(e)),o=new It(e,It.where.Column,It.requestAction.Delete,w()(i).closest("table")[0]).getActionList(),a=0;a<o.length;a++)if(o[a])switch(o[a].action){case It.resultAction.Ignore:continue;case It.resultAction.SubtractSpanCount:var r,s=o[a].baseCell;s.colSpan&&1<s.colSpan&&(2<(r=s.colSpan?parseInt(s.colSpan,10):0)?(r--,s.setAttribute("colSpan",r),s.cellIndex===n&&(s.innerHTML="")):2===r&&(s.removeAttribute("colSpan"),s.cellIndex===n&&(s.innerHTML="")));continue;case It.resultAction.RemoveCell:pt.remove(o[a].baseCell,!0);continue}}},{key:"createTable",value:function(t,e,i){for(var n,o=[],a=0;a<t;a++)o.push("<td>"+pt.blank+"</td>");n=o.join("");for(var r,s=[],l=0;l<e;l++)s.push("<tr>"+n+"</tr>");r=s.join("");var c=w()("<table>"+r+"</table>");return i&&i.tableClassName&&c.addClass(i.tableClassName),c[0]}},{key:"deleteTable",value:function(t){var e=pt.ancestor(t.commonAncestor(),pt.isCell);w()(e).closest("table").remove()}}])&&Nt(e.prototype,i),n&&Nt(e,n),t}();function Dt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Rt=function(){function a(t){var h=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),this.context=t,this.$note=t.layoutInfo.note,this.$editor=t.layoutInfo.editor,this.$editable=t.layoutInfo.editable,this.options=t.options,this.lang=this.options.langInfo,this.editable=this.$editable[0],this.lastRange=null,this.snapshot=null,this.style=new Et,this.table=new Mt,this.typing=new Pt(t),this.bullet=new Ot,this.history=new St(t),this.context.memo("help.escape",this.lang.help.escape),this.context.memo("help.undo",this.lang.help.undo),this.context.memo("help.redo",this.lang.help.redo),this.context.memo("help.tab",this.lang.help.tab),this.context.memo("help.untab",this.lang.help.untab),this.context.memo("help.insertParagraph",this.lang.help.insertParagraph),this.context.memo("help.insertOrderedList",this.lang.help.insertOrderedList),this.context.memo("help.insertUnorderedList",this.lang.help.insertUnorderedList),this.context.memo("help.indent",this.lang.help.indent),this.context.memo("help.outdent",this.lang.help.outdent),this.context.memo("help.formatPara",this.lang.help.formatPara),this.context.memo("help.insertHorizontalRule",this.lang.help.insertHorizontalRule),this.context.memo("help.fontName",this.lang.help.fontName);for(var e=["bold","italic","underline","strikethrough","superscript","subscript","justifyLeft","justifyCenter","justifyRight","justifyFull","formatBlock","removeFormat","backColor"],i=0,n=e.length;i<n;i++)this[e[i]]=function(e){return function(t){h.beforeCommand(),document.execCommand(e,!1,t),h.afterCommand(!0)}}(e[i]),this.context.memo("help."+e[i],this.lang.help[e[i]]);this.fontName=this.wrapCommand(function(t){return h.fontStyling("font-family",p.validFontName(t))}),this.fontSize=this.wrapCommand(function(t){var e=h.currentStyle()["font-size-unit"];return h.fontStyling("font-size",t+e)}),this.fontSizeUnit=this.wrapCommand(function(t){var e=h.currentStyle()["font-size"];return h.fontStyling("font-size",e+t)});for(var o=1;o<=6;o++)this["formatH"+o]=function(t){return function(){h.formatBlock("H"+t)}}(o),this.context.memo("help.formatH"+o,this.lang.help["formatH"+o]);this.insertParagraph=this.wrapCommand(function(){h.typing.insertParagraph(h.editable)}),this.insertOrderedList=this.wrapCommand(function(){h.bullet.insertOrderedList(h.editable)}),this.insertUnorderedList=this.wrapCommand(function(){h.bullet.insertUnorderedList(h.editable)}),this.indent=this.wrapCommand(function(){h.bullet.indent(h.editable)}),this.outdent=this.wrapCommand(function(){h.bullet.outdent(h.editable)}),this.insertNode=this.wrapCommand(function(t){h.isLimited(w()(t).text().length)||(h.getLastRange().insertNode(t),h.setLastRange(wt.createFromNodeAfter(t).select()))}),this.insertText=this.wrapCommand(function(t){var e;h.isLimited(t.length)||(e=h.getLastRange().insertNode(pt.createText(t)),h.setLastRange(wt.create(e,pt.nodeLength(e)).select()))}),this.pasteHTML=this.wrapCommand(function(t){var e;h.isLimited(t.length)||(t=h.context.invoke("codeview.purify",t),e=h.getLastRange().pasteHTML(t),h.setLastRange(wt.createFromNodeAfter(k.last(e)).select()))}),this.formatBlock=this.wrapCommand(function(t,e){var i=h.options.callbacks.onApplyCustomStyle;i?i.call(h,e,h.context,h.onFormatBlock):h.onFormatBlock(t,e)}),this.insertHorizontalRule=this.wrapCommand(function(){var t=h.getLastRange().insertNode(pt.create("HR"));t.nextSibling&&h.setLastRange(wt.create(t.nextSibling,0).normalize().select())}),this.lineHeight=this.wrapCommand(function(t){h.style.stylePara(h.getLastRange(),{lineHeight:t})}),this.createLink=this.wrapCommand(function(t){var e,i,n,o=t.url,a=t.text,r=t.isNewWindow,s=t.checkProtocol,l=t.range||h.getLastRange(),c=a.length-l.toString().length;0<c&&h.isLimited(c)||(e=l.toString()!==a,"string"==typeof o&&(o=o.trim()),h.options.onCreateLink?o=h.options.onCreateLink(o):s&&(o=/^([A-Za-z][A-Za-z0-9+-.]*\:|#|\/)/.test(o)?o:h.options.defaultProtocol+o),i=[],e?(n=(l=l.deleteContents()).insertNode(w()("<A>"+a+"</A>")[0]),i.push(n)):i=h.style.styleNodes(l,{nodeName:"A",expandClosestSibling:!0,onlyPartialContains:!0}),w.a.each(i,function(t,e){w()(e).attr("href",o),r?w()(e).attr("target","_blank"):w()(e).removeAttr("target")}),h.setLastRange(h.createRangeFromList(i).select()))}),this.color=this.wrapCommand(function(t){var e=t.foreColor,i=t.backColor;e&&document.execCommand("foreColor",!1,e),i&&document.execCommand("backColor",!1,i)}),this.foreColor=this.wrapCommand(function(t){document.execCommand("foreColor",!1,t)}),this.insertTable=this.wrapCommand(function(t){var e=t.split("x");h.getLastRange().deleteContents().insertNode(h.table.createTable(e[0],e[1],h.options))}),this.removeMedia=this.wrapCommand(function(){var t=w()(h.restoreTarget()).parent();t.closest("figure").length?t.closest("figure").remove():t=w()(h.restoreTarget()).detach(),h.context.triggerEvent("media.delete",t,h.$editable)}),this.floatMe=this.wrapCommand(function(t){var e=w()(h.restoreTarget());e.toggleClass("note-float-left","left"===t),e.toggleClass("note-float-right","right"===t),e.css("float","none"===t?"":t)}),this.resize=this.wrapCommand(function(t){var e=w()(h.restoreTarget());0===(t=parseFloat(t))?e.css("width",""):e.css({width:100*t+"%",height:""})})}var t,e,i;return t=a,(e=[{key:"initialize",value:function(){var i=this;this.$editable.on("keydown",function(t){if(t.keyCode===Ct.code.ENTER&&i.context.triggerEvent("enter",t),i.context.triggerEvent("keydown",t),i.snapshot=i.history.makeSnapshot(),i.hasKeyShortCut=!1,t.isDefaultPrevented()||(i.options.shortcuts?i.hasKeyShortCut=i.handleKeyMap(t):i.preventDefaultEditableShortCuts(t)),i.isLimited(1,t)){var e=i.getLastRange();if(e.eo-e.so==0)return!1}i.setLastRange(),i.options.recordEveryKeystroke&&!1===i.hasKeyShortCut&&i.history.recordUndo()}).on("keyup",function(t){i.setLastRange(),i.context.triggerEvent("keyup",t)}).on("focus",function(t){i.setLastRange(),i.context.triggerEvent("focus",t)}).on("blur",function(t){i.context.triggerEvent("blur",t)}).on("mousedown",function(t){i.context.triggerEvent("mousedown",t)}).on("mouseup",function(t){i.setLastRange(),i.history.recordUndo(),i.context.triggerEvent("mouseup",t)}).on("scroll",function(t){i.context.triggerEvent("scroll",t)}).on("paste",function(t){i.setLastRange(),i.context.triggerEvent("paste",t)}).on("input",function(){i.isLimited(0)&&i.snapshot&&i.history.applySnapshot(i.snapshot)}),this.$editable.attr("spellcheck",this.options.spellCheck),this.$editable.attr("autocorrect",this.options.spellCheck),this.options.disableGrammar&&this.$editable.attr("data-gramm",!1),this.$editable.html(pt.html(this.$note)||pt.emptyPara),this.$editable.on(p.inputEventName,v.debounce(function(){i.context.triggerEvent("change",i.$editable.html(),i.$editable)},10)),this.$editable.on("focusin",function(t){i.context.triggerEvent("focusin",t)}).on("focusout",function(t){i.context.triggerEvent("focusout",t)}),this.options.airMode?this.options.overrideContextMenu&&this.$editor.on("contextmenu",function(t){return i.context.triggerEvent("contextmenu",t),!1}):(this.options.width&&this.$editor.outerWidth(this.options.width),this.options.height&&this.$editable.outerHeight(this.options.height),this.options.maxHeight&&this.$editable.css("max-height",this.options.maxHeight),this.options.minHeight&&this.$editable.css("min-height",this.options.minHeight)),this.history.recordUndo(),this.setLastRange()}},{key:"destroy",value:function(){this.$editable.off()}},{key:"handleKeyMap",value:function(t){var e=this.options.keyMap[p.isMac?"mac":"pc"],i=[];t.metaKey&&i.push("CMD"),t.ctrlKey&&!t.altKey&&i.push("CTRL"),t.shiftKey&&i.push("SHIFT");var n=Ct.nameFromCode[t.keyCode];n&&i.push(n);var o=e[i.join("+")];if("TAB"!==n||this.options.tabDisable)if(o){if(!1!==this.context.invoke(o))return t.preventDefault(),!0}else Ct.isEdit(t.keyCode)&&this.afterCommand();else this.afterCommand();return!1}},{key:"preventDefaultEditableShortCuts",value:function(t){(t.ctrlKey||t.metaKey)&&k.contains([66,73,85],t.keyCode)&&t.preventDefault()}},{key:"isLimited",value:function(t,e){return t=t||0,(void 0===e||!(Ct.isMove(e.keyCode)||Ct.isNavigation(e.keyCode)||e.ctrlKey||e.metaKey||k.contains([Ct.code.BACKSPACE,Ct.code.DELETE],e.keyCode)))&&(0<this.options.maxTextLength&&this.$editable.text().length+t>this.options.maxTextLength)}},{key:"createRange",value:function(){return this.focus(),this.setLastRange(),this.getLastRange()}},{key:"createRangeFromList",value:function(t){var e=wt.createFromNodeBefore(k.head(t)).getStartPoint(),i=wt.createFromNodeAfter(k.last(t)).getEndPoint();return wt.create(e.node,e.offset,i.node,i.offset)}},{key:"setLastRange",value:function(t){t?this.lastRange=t:(this.lastRange=wt.create(this.editable),0===w()(this.lastRange.sc).closest(".note-editable").length&&(this.lastRange=wt.createFromBodyElement(this.editable)))}},{key:"getLastRange",value:function(){return this.lastRange||this.setLastRange(),this.lastRange}},{key:"saveRange",value:function(t){t&&this.getLastRange().collapse().select()}},{key:"restoreRange",value:function(){this.lastRange&&(this.lastRange.select(),this.focus())}},{key:"saveTarget",value:function(t){this.$editable.data("target",t)}},{key:"clearTarget",value:function(){this.$editable.removeData("target")}},{key:"restoreTarget",value:function(){return this.$editable.data("target")}},{key:"currentStyle",value:function(){var t=wt.create();return(t=t&&t.normalize())?this.style.current(t):this.style.fromNode(this.$editable)}},{key:"styleFromNode",value:function(t){return this.style.fromNode(t)}},{key:"undo",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.undo(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"commit",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.commit(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"redo",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.redo(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"beforeCommand",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),document.execCommand("styleWithCSS",!1,this.options.styleWithCSS),this.focus()}},{key:"afterCommand",value:function(t){this.normalizeContent(),this.history.recordUndo(),t||this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"tab",value:function(){var t=this.getLastRange();if(t.isCollapsed()&&t.isOnCell())this.table.tab(t);else{if(0===this.options.tabSize)return!1;this.isLimited(this.options.tabSize)||(this.beforeCommand(),this.typing.insertTab(t,this.options.tabSize),this.afterCommand())}}},{key:"untab",value:function(){var t=this.getLastRange();if(t.isCollapsed()&&t.isOnCell())this.table.tab(t,!0);else if(0===this.options.tabSize)return!1}},{key:"wrapCommand",value:function(t){return function(){this.beforeCommand(),t.apply(this,arguments),this.afterCommand()}}},{key:"insertImage",value:function(t,e){var i,n=this;return i=t,w.a.Deferred(function(t){var e=w()("<img>");e.one("load",function(){e.off("error abort"),t.resolve(e)}).one("error abort",function(){e.off("load").detach(),t.reject(e)}).css({display:"none"}).appendTo(document.body).attr("src",i)}).promise().then(function(t){n.beforeCommand(),"function"==typeof e?e(t):("string"==typeof e&&t.attr("data-filename",e),t.css("width",Math.min(n.$editable.width(),t.width()))),t.show(),n.getLastRange().insertNode(t[0]),n.setLastRange(wt.createFromNodeAfter(t[0]).select()),n.afterCommand()}).fail(function(t){n.context.triggerEvent("image.upload.error",t)})}},{key:"insertImagesAsDataURL",value:function(t){var o=this;w.a.each(t,function(t,e){var n,i=e.name;o.options.maximumImageFileSize&&o.options.maximumImageFileSize<e.size?o.context.triggerEvent("image.upload.error",o.lang.image.maximumFileSizeError):(n=e,w.a.Deferred(function(i){w.a.extend(new FileReader,{onload:function(t){var e=t.target.result;i.resolve(e)},onerror:function(t){i.reject(t)}}).readAsDataURL(n)}).promise().then(function(t){return o.insertImage(t,i)}).fail(function(){o.context.triggerEvent("image.upload.error")}))})}},{key:"insertImagesOrCallback",value:function(t){this.options.callbacks.onImageUpload?this.context.triggerEvent("image.upload",t):this.insertImagesAsDataURL(t)}},{key:"getSelectedText",value:function(){var t=this.getLastRange();return t.isOnAnchor()&&(t=wt.createFromNode(pt.ancestor(t.sc,pt.isAnchor))),t.toString()}},{key:"onFormatBlock",value:function(t,e){var i,n;document.execCommand("FormatBlock",!1,p.isMSIE?"<"+t+">":t),e&&e.length&&(e[0].tagName.toUpperCase()!==t.toUpperCase()&&(e=e.find(t)),e&&e.length&&((i=e[0].className||"")&&(n=this.createRange(),w()([n.sc,n.ec]).closest(t).addClass(i))))}},{key:"formatPara",value:function(){this.formatBlock("P")}},{key:"fontStyling",value:function(t,e){var i,n,o,a=this.getLastRange();""!==a?(i=this.style.styleNodes(a),this.$editor.find(".note-status-output").html(""),w()(i).css(t,e),a.isCollapsed()?(n=k.head(i))&&!pt.nodeLength(n)&&(n.innerHTML=pt.ZERO_WIDTH_NBSP_CHAR,wt.createFromNode(n.firstChild).select(),this.setLastRange(),this.$editable.data("bogus",n)):this.setLastRange(this.createRangeFromList(i).select())):(o=w.a.now(),this.$editor.find(".note-status-output").html('<div id="note-status-output-'+o+'" class="alert alert-info">'+this.lang.output.noSelection+"</div>"),setTimeout(function(){w()("#note-status-output-"+o).remove()},5e3))}},{key:"unlink",value:function(){var t,e=this.getLastRange();e.isOnAnchor()&&(t=pt.ancestor(e.sc,pt.isAnchor),(e=wt.createFromNode(t)).select(),this.setLastRange(),this.beforeCommand(),document.execCommand("unlink"),this.afterCommand())}},{key:"getLinkInfo",value:function(){var t=this.getLastRange().expand(pt.isAnchor),e=w()(k.head(t.nodes(pt.isAnchor))),i={range:t,text:t.toString(),url:e.length?e.attr("href"):""};return e.length&&(i.isNewWindow="_blank"===e.attr("target")),i}},{key:"addRow",value:function(t){var e=this.getLastRange(this.$editable);e.isCollapsed()&&e.isOnCell()&&(this.beforeCommand(),this.table.addRow(e,t),this.afterCommand())}},{key:"addCol",value:function(t){var e=this.getLastRange(this.$editable);e.isCollapsed()&&e.isOnCell()&&(this.beforeCommand(),this.table.addCol(e,t),this.afterCommand())}},{key:"deleteRow",value:function(){var t=this.getLastRange(this.$editable);t.isCollapsed()&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteRow(t),this.afterCommand())}},{key:"deleteCol",value:function(){var t=this.getLastRange(this.$editable);t.isCollapsed()&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteCol(t),this.afterCommand())}},{key:"deleteTable",value:function(){var t=this.getLastRange(this.$editable);t.isCollapsed()&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteTable(t),this.afterCommand())}},{key:"resizeTo",value:function(t,e,i){var n,o,a;a=i?{width:(n=t.y/t.x)<(o=e.data("ratio"))?t.x:t.y/o,height:n<o?t.x*o:t.y}:{width:t.x,height:t.y},e.css(a)}},{key:"hasFocus",value:function(){return this.$editable.is(":focus")}},{key:"focus",value:function(){this.hasFocus()||this.$editable.focus()}},{key:"isEmpty",value:function(){return pt.isEmpty(this.$editable[0])||pt.emptyPara===this.$editable.html()}},{key:"empty",value:function(){this.context.invoke("code",pt.emptyPara)}},{key:"normalizeContent",value:function(){this.$editable[0].normalize()}}])&&Dt(t.prototype,e),i&&Dt(t,i),a}();function zt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var jt=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.$editable=t.layoutInfo.editable}var t,i,n;return t=e,(i=[{key:"initialize",value:function(){this.$editable.on("paste",this.pasteByEvent.bind(this))}},{key:"pasteByEvent",value:function(t){var e,i,n=this,o=t.originalEvent.clipboardData;o&&o.items&&o.items.length?"file"===(e=1<o.items.length?o.items[1]:k.head(o.items)).kind&&-1!==e.type.indexOf("image/")?(this.context.invoke("editor.insertImagesOrCallback",[e.getAsFile()]),t.preventDefault()):"string"===e.kind&&this.context.invoke("editor.isLimited",o.getData("Text").length)&&t.preventDefault():window.clipboardData&&(i=window.clipboardData.getData("text"),this.context.invoke("editor.isLimited",i.length)&&t.preventDefault()),setTimeout(function(){n.context.invoke("editor.afterCommand")},10)}}])&&zt(t.prototype,i),n&&zt(t,n),e}();function Bt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Ft=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.$eventListener=w()(document),this.$editor=t.layoutInfo.editor,this.$editable=t.layoutInfo.editable,this.options=t.options,this.lang=this.options.langInfo,this.documentEventHandlers={},this.$dropzone=w()(['<div class="note-dropzone">','<div class="note-dropzone-message"></div>',"</div>"].join("")).prependTo(this.$editor)}var t,i,n;return t=e,(i=[{key:"initialize",value:function(){this.options.disableDragAndDrop?(this.documentEventHandlers.onDrop=function(t){t.preventDefault()},this.$eventListener=this.$dropzone,this.$eventListener.on("drop",this.documentEventHandlers.onDrop)):this.attachDragAndDropEvent()}},{key:"attachDragAndDropEvent",value:function(){var o=this,n=w()(),a=this.$dropzone.find(".note-dropzone-message");this.documentEventHandlers.onDragenter=function(t){var e=o.context.invoke("codeview.isActivated"),i=0<o.$editor.width()&&0<o.$editor.height();e||n.length||!i||(o.$editor.addClass("dragover"),o.$dropzone.width(o.$editor.width()),o.$dropzone.height(o.$editor.height()),a.text(o.lang.image.dragImageHere)),n=n.add(t.target)},this.documentEventHandlers.onDragleave=function(t){(n=n.not(t.target)).length&&"BODY"!==t.target.nodeName||(n=w()(),o.$editor.removeClass("dragover"))},this.documentEventHandlers.onDrop=function(){n=w()(),o.$editor.removeClass("dragover")},this.$eventListener.on("dragenter",this.documentEventHandlers.onDragenter).on("dragleave",this.documentEventHandlers.onDragleave).on("drop",this.documentEventHandlers.onDrop),this.$dropzone.on("dragenter",function(){o.$dropzone.addClass("hover"),a.text(o.lang.image.dropImage)}).on("dragleave",function(){o.$dropzone.removeClass("hover"),a.text(o.lang.image.dragImageHere)}),this.$dropzone.on("drop",function(t){var n=t.originalEvent.dataTransfer;t.preventDefault(),n&&n.files&&n.files.length?(o.$editable.focus(),o.context.invoke("editor.insertImagesOrCallback",n.files)):w.a.each(n.types,function(t,e){var i;-1<e.toLowerCase().indexOf("_moz_")||(i=n.getData(e),-1<e.toLowerCase().indexOf("text")?o.context.invoke("editor.pasteHTML",i):w()(i).each(function(t,e){o.context.invoke("editor.insertNode",e)}))})}).on("dragover",!1)}},{key:"destroy",value:function(){var e=this;Object.keys(this.documentEventHandlers).forEach(function(t){e.$eventListener.off(t.substr(2).toLowerCase(),e.documentEventHandlers[t])}),this.documentEventHandlers={}}}])&&Bt(t.prototype,i),n&&Bt(t,n),e}();function Ht(t){if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=function(t,e){if(!t)return;if("string"==typeof t)return Xt(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Xt(t,e)}(t))){var e=0,i=function(){};return{s:i,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,o,a=!0,r=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){r=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(r)throw o}}}}function Xt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Yt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var qt=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.$editor=t.layoutInfo.editor,this.$editable=t.layoutInfo.editable,this.$codable=t.layoutInfo.codable,this.options=t.options,this.CodeMirrorConstructor=window.CodeMirror,this.options.codemirror.CodeMirrorConstructor&&(this.CodeMirrorConstructor=this.options.codemirror.CodeMirrorConstructor)}var t,i,n;return t=e,(i=[{key:"sync",value:function(t){var e=this.isActivated(),i=this.CodeMirrorConstructor;e&&(t?i?this.$codable.data("cmEditor").getDoc().setValue(t):this.$codable.val(t):i&&this.$codable.data("cmEditor").save())}},{key:"initialize",value:function(){var e=this;this.$codable.on("keyup",function(t){t.keyCode===Ct.code.ESCAPE&&e.deactivate()})}},{key:"isActivated",value:function(){return this.$editor.hasClass("codeview")}},{key:"toggle",value:function(){this.isActivated()?this.deactivate():this.activate(),this.context.triggerEvent("codeview.toggled")}},{key:"purify",value:function(t){var o;return this.options.codeviewFilter&&(t=t.replace(this.options.codeviewFilterRegex,""),this.options.codeviewIframeFilter&&(o=this.options.codeviewIframeWhitelistSrc.concat(this.options.codeviewIframeWhitelistSrcBase),t=t.replace(/(<iframe.*?>.*?(?:<\/iframe>)?)/gi,function(t){if(/<.+src(?==?('|"|\s)?)[\s\S]+src(?=('|"|\s)?)[^>]*?>/i.test(t))return"";var e,i=Ht(o);try{for(i.s();!(e=i.n()).done;){var n=e.value;if(new RegExp('src="(https?:)?//'+n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+'/(.+)"').test(t))return t}}catch(t){i.e(t)}finally{i.f()}return""}))),t}},{key:"activate",value:function(){var e,i,n=this,t=this.CodeMirrorConstructor;this.$codable.val(pt.html(this.$editable,this.options.prettifyHtml)),this.$codable.height(this.$editable.height()),this.context.invoke("toolbar.updateCodeview",!0),this.context.invoke("airPopover.updateCodeview",!0),this.$editor.addClass("codeview"),this.$codable.focus(),t?(e=t.fromTextArea(this.$codable[0],this.options.codemirror),this.options.codemirror.tern&&(i=new t.TernServer(this.options.codemirror.tern),e.ternServer=i,e.on("cursorActivity",function(t){i.updateArgHints(t)})),e.on("blur",function(t){n.context.triggerEvent("blur.codeview",e.getValue(),t)}),e.on("change",function(){n.context.triggerEvent("change.codeview",e.getValue(),e)}),e.setSize(null,this.$editable.outerHeight()),this.$codable.data("cmEditor",e)):(this.$codable.on("blur",function(t){n.context.triggerEvent("blur.codeview",n.$codable.val(),t)}),this.$codable.on("input",function(){n.context.triggerEvent("change.codeview",n.$codable.val(),n.$codable)}))}},{key:"deactivate",value:function(){var t;this.CodeMirrorConstructor&&(t=this.$codable.data("cmEditor"),this.$codable.val(t.getValue()),t.toTextArea());var e=this.purify(pt.value(this.$codable,this.options.prettifyHtml)||pt.emptyPara),i=this.$editable.html()!==e;this.$editable.html(e),this.$editable.height(this.options.height?this.$codable.height():"auto"),this.$editor.removeClass("codeview"),i&&this.context.triggerEvent("change",this.$editable.html(),this.$editable),this.$editable.focus(),this.context.invoke("toolbar.updateCodeview",!1),this.context.invoke("airPopover.updateCodeview",!1)}},{key:"destroy",value:function(){this.isActivated()&&this.deactivate()}}])&&Yt(t.prototype,i),n&&Yt(t,n),e}();function Wt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var $t=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.$document=w()(document),this.$statusbar=t.layoutInfo.statusbar,this.$editable=t.layoutInfo.editable,this.options=t.options}var t,i,n;return t=e,(i=[{key:"initialize",value:function(){var n=this;this.options.airMode||this.options.disableResizeEditor?this.destroy():this.$statusbar.on("mousedown",function(t){t.preventDefault(),t.stopPropagation();function e(t){var e=t.clientY-(24+i),e=0<n.options.minheight?Math.max(e,n.options.minheight):e;e=0<n.options.maxHeight?Math.min(e,n.options.maxHeight):e,n.$editable.height(e)}var i=n.$editable.offset().top-n.$document.scrollTop();n.$document.on("mousemove",e).one("mouseup",function(){n.$document.off("mousemove",e)})})}},{key:"destroy",value:function(){this.$statusbar.off(),this.$statusbar.addClass("locked")}}])&&Wt(t.prototype,i),n&&Wt(t,n),e}();function Vt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Ut=function(){function i(t){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),this.context=t,this.$editor=t.layoutInfo.editor,this.$toolbar=t.layoutInfo.toolbar,this.$editable=t.layoutInfo.editable,this.$codable=t.layoutInfo.codable,this.$window=w()(window),this.$scrollbar=w()("html, body"),this.onResize=function(){e.resizeTo({h:e.$window.height()-e.$toolbar.outerHeight()})}}var t,e,n;return t=i,(e=[{key:"resizeTo",value:function(t){this.$editable.css("height",t.h),this.$codable.css("height",t.h),this.$codable.data("cmeditor")&&this.$codable.data("cmeditor").setsize(null,t.h)}},{key:"toggle",value:function(){this.$editor.toggleClass("fullscreen"),this.isFullscreen()?(this.$editable.data("orgHeight",this.$editable.css("height")),this.$editable.data("orgMaxHeight",this.$editable.css("maxHeight")),this.$editable.css("maxHeight",""),this.$window.on("resize",this.onResize).trigger("resize"),this.$scrollbar.css("overflow","hidden")):(this.$window.off("resize",this.onResize),this.resizeTo({h:this.$editable.data("orgHeight")}),this.$editable.css("maxHeight",this.$editable.css("orgMaxHeight")),this.$scrollbar.css("overflow","visible")),this.context.invoke("toolbar.updateFullscreen",this.isFullscreen())}},{key:"isFullscreen",value:function(){return this.$editor.hasClass("fullscreen")}}])&&Vt(t.prototype,e),n&&Vt(t,n),i}();function Gt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Kt=function(){function e(t){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.$document=w()(document),this.$editingArea=t.layoutInfo.editingArea,this.options=t.options,this.lang=this.options.langInfo,this.events={"summernote.mousedown":function(t,e){i.update(e.target,e)&&e.preventDefault()},"summernote.keyup summernote.scroll summernote.change summernote.dialog.shown":function(){i.update()},"summernote.disable summernote.blur":function(){i.hide()},"summernote.codeview.toggled":function(){i.update()}}}var t,i,n;return t=e,(i=[{key:"initialize",value:function(){var a=this;this.$handle=w()(['<div class="note-handle">','<div class="note-control-selection">','<div class="note-control-selection-bg"></div>','<div class="note-control-holder note-control-nw"></div>','<div class="note-control-holder note-control-ne"></div>','<div class="note-control-holder note-control-sw"></div>','<div class="',this.options.disableResizeImage?"note-control-holder":"note-control-sizing",' note-control-se"></div>',this.options.disableResizeImage?"":'<div class="note-control-selection-info"></div>',"</div>","</div>"].join("")).prependTo(this.$editingArea),this.$handle.on("mousedown",function(t){var e,i,n,o;pt.isControlSizing(t.target)&&(t.preventDefault(),t.stopPropagation(),e=a.$handle.find(".note-control-selection").data("target"),i=e.offset(),n=a.$document.scrollTop(),o=function(t){a.context.invoke("editor.resizeTo",{x:t.clientX-i.left,y:t.clientY-(i.top-n)},e,!t.shiftKey),a.update(e[0],t)},a.$document.on("mousemove",o).one("mouseup",function(t){t.preventDefault(),a.$document.off("mousemove",o),a.context.invoke("editor.afterCommand")}),e.data("ratio")||e.data("ratio",e.height()/e.width()))}),this.$handle.on("wheel",function(t){t.preventDefault(),a.update()})}},{key:"destroy",value:function(){this.$handle.remove()}},{key:"update",value:function(t,e){if(this.context.isDisabled())return!1;var i,n,o,a,r,s,l=pt.isImg(t),c=this.$handle.find(".note-control-selection");return this.context.invoke("imagePopover.update",t,e),l?(o={left:(n=(i=w()(t)).position()).left+parseInt(i.css("marginLeft"),10),top:n.top+parseInt(i.css("marginTop"),10)},a={w:i.outerWidth(!1),h:i.outerHeight(!1)},c.css({display:"block",left:o.left,top:o.top,width:a.w,height:a.h}).data("target",i),(r=new Image).src=i.attr("src"),s=a.w+"x"+a.h+" ("+this.lang.image.original+": "+r.width+"x"+r.height+")",c.find(".note-control-selection-info").text(s),this.context.invoke("editor.saveTarget",t)):this.hide(),l}},{key:"hide",value:function(){this.context.invoke("editor.clearTarget"),this.$handle.children().hide()}}])&&Gt(t.prototype,i),n&&Gt(t,n),e}();function Zt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Qt=/^([A-Za-z][A-Za-z0-9+-.]*\:[\/]{2}|tel:|mailto:[A-Z0-9._%+-]+@)?(www\.)?(.+)$/i,Jt=function(){function e(t){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.options=t.options,this.events={"summernote.keyup":function(t,e){e.isDefaultPrevented()||i.handleKeyup(e)},"summernote.keydown":function(t,e){i.handleKeydown(e)}}}var t,i,n;return t=e,(i=[{key:"initialize",value:function(){this.lastWordRange=null}},{key:"destroy",value:function(){this.lastWordRange=null}},{key:"replace",value:function(){var t,e,i,n,o;!this.lastWordRange||(e=(t=this.lastWordRange.toString()).match(Qt))&&(e[1]||e[2])&&(i=e[1]?t:"http://"+t,n=this.options.showDomainOnlyForAutolink?t.replace(/^(?:https?:\/\/)?(?:tel?:?)?(?:mailto?:?)?(?:www\.)?/i,"").split("/")[0]:t,o=w()("<a />").html(n).attr("href",i)[0],this.context.options.linkTargetBlank&&w()(o).attr("target","_blank"),this.lastWordRange.insertNode(o),this.lastWordRange=null,this.context.invoke("editor.focus"))}},{key:"handleKeydown",value:function(t){var e;k.contains([Ct.code.ENTER,Ct.code.SPACE],t.keyCode)&&(e=this.context.invoke("editor.createRange").getWordRange(),this.lastWordRange=e)}},{key:"handleKeyup",value:function(t){k.contains([Ct.code.ENTER,Ct.code.SPACE],t.keyCode)&&this.replace()}}])&&Zt(t.prototype,i),n&&Zt(t,n),e}();function te(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var ee=function(){function i(t){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),this.$note=t.layoutInfo.note,this.events={"summernote.change":function(){e.$note.val(t.invoke("code"))}}}var t,e,n;return t=i,(e=[{key:"shouldInitialize",value:function(){return pt.isTextarea(this.$note[0])}}])&&te(t.prototype,e),n&&te(t,n),i}();function ie(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var ne=function(){function e(t){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.options=t.options.replace||{},this.keys=[Ct.code.ENTER,Ct.code.SPACE,Ct.code.PERIOD,Ct.code.COMMA,Ct.code.SEMICOLON,Ct.code.SLASH],this.previousKeydownCode=null,this.events={"summernote.keyup":function(t,e){e.isDefaultPrevented()||i.handleKeyup(e)},"summernote.keydown":function(t,e){i.handleKeydown(e)}}}var t,i,n;return t=e,(i=[{key:"shouldInitialize",value:function(){return!!this.options.match}},{key:"initialize",value:function(){this.lastWord=null}},{key:"destroy",value:function(){this.lastWord=null}},{key:"replace",value:function(){var i,t;this.lastWord&&(t=(i=this).lastWord.toString(),this.options.match(t,function(t){if(t){var e="";if("string"==typeof t?e=pt.createText(t):t instanceof jQuery?e=t[0]:t instanceof Node&&(e=t),!e)return;i.lastWord.insertNode(e),i.lastWord=null,i.context.invoke("editor.focus")}}))}},{key:"handleKeydown",value:function(t){var e;this.previousKeydownCode&&k.contains(this.keys,this.previousKeydownCode)||k.contains(this.keys,t.keyCode)&&(e=this.context.invoke("editor.createRange").getWordRange(),this.lastWord=e),this.previousKeydownCode=t.keyCode}},{key:"handleKeyup",value:function(t){k.contains(this.keys,t.keyCode)&&this.replace()}}])&&ie(t.prototype,i),n&&ie(t,n),e}();function oe(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var ae=function(){function i(t){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),this.context=t,this.$editingArea=t.layoutInfo.editingArea,this.options=t.options,!0===this.options.inheritPlaceholder&&(this.options.placeholder=this.context.$note.attr("placeholder")||this.options.placeholder),this.events={"summernote.init summernote.change":function(){e.update()},"summernote.codeview.toggled":function(){e.update()}}}var t,e,n;return t=i,(e=[{key:"shouldInitialize",value:function(){return!!this.options.placeholder}},{key:"initialize",value:function(){var t=this;this.$placeholder=w()('<div class="note-placeholder">'),this.$placeholder.on("click",function(){t.context.invoke("focus")}).html(this.options.placeholder).prependTo(this.$editingArea),this.update()}},{key:"destroy",value:function(){this.$placeholder.remove()}},{key:"update",value:function(){var t=!this.context.invoke("codeview.isActivated")&&this.context.invoke("editor.isEmpty");this.$placeholder.toggle(t)}}])&&oe(t.prototype,e),n&&oe(t,n),i}();function re(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var se=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.ui=w.a.summernote.ui,this.context=t,this.$toolbar=t.layoutInfo.toolbar,this.options=t.options,this.lang=this.options.langInfo,this.invertedKeyMap=v.invertObject(this.options.keyMap[p.isMac?"mac":"pc"])}var t,i,n;return t=e,(i=[{key:"representShortcut",value:function(t){var e=this.invertedKeyMap[t];return this.options.shortcuts&&e?(p.isMac&&(e=e.replace("CMD","⌘").replace("SHIFT","⇧"))," ("+(e=e.replace("BACKSLASH","\\").replace("SLASH","/").replace("LEFTBRACKET","[").replace("RIGHTBRACKET","]"))+")"):""}},{key:"button",value:function(t){return!this.options.tooltip&&t.tooltip&&delete t.tooltip,t.container=this.options.container,this.ui.button(t)}},{key:"initialize",value:function(){this.addToolbarButtons(),this.addImagePopoverButtons(),this.addLinkPopoverButtons(),this.addTablePopoverButtons(),this.fontInstalledMap={}}},{key:"destroy",value:function(){delete this.fontInstalledMap}},{key:"isFontInstalled",value:function(t){return Object.prototype.hasOwnProperty.call(this.fontInstalledMap,t)||(this.fontInstalledMap[t]=p.isFontInstalled(t)||k.contains(this.options.fontNamesIgnoreCheck,t)),this.fontInstalledMap[t]}},{key:"isFontDeservedToAdd",value:function(t){return""!==(t=t.toLowerCase())&&this.isFontInstalled(t)&&-1===p.genericFontFamilies.indexOf(t)}},{key:"colorPalette",value:function(d,t,i,n){var f=this;return this.ui.buttonGroup({className:"note-color "+d,children:[this.button({className:"note-current-color-button",contents:this.ui.icon(this.options.icons.font+" note-recent-color"),tooltip:t,click:function(t){var e=w()(t.currentTarget);i&&n?f.context.invoke("editor.color",{backColor:e.attr("data-backColor"),foreColor:e.attr("data-foreColor")}):i?f.context.invoke("editor.color",{backColor:e.attr("data-backColor")}):n&&f.context.invoke("editor.color",{foreColor:e.attr("data-foreColor")})},callback:function(t){var e=t.find(".note-recent-color");i&&(e.css("background-color",f.options.colorButton.backColor),t.attr("data-backColor",f.options.colorButton.backColor)),n?(e.css("color",f.options.colorButton.foreColor),t.attr("data-foreColor",f.options.colorButton.foreColor)):e.css("color","transparent")}}),this.button({className:"dropdown-toggle",contents:this.ui.dropdownButtonContents("",this.options),tooltip:this.lang.color.more,data:{toggle:"dropdown"}}),this.ui.dropdown({items:(i?['<div class="note-palette">','<div class="note-palette-title">'+this.lang.color.background+"</div>","<div>",'<button type="button" class="note-color-reset btn btn-light btn-default" data-event="backColor" data-value="transparent">',this.lang.color.transparent,"</button>","</div>",'<div class="note-holder" data-event="backColor">\x3c!-- back colors --\x3e</div>',"<div>",'<button type="button" class="note-color-select btn btn-light btn-default" data-event="openPalette" data-value="backColorPicker">',this.lang.color.cpSelect,"</button>",'<input type="color" id="backColorPicker" class="note-btn note-color-select-btn" value="'+this.options.colorButton.backColor+'" data-event="backColorPalette">',"</div>",'<div class="note-holder-custom" id="backColorPalette" data-event="backColor"></div>',"</div>"].join(""):"")+(n?['<div class="note-palette">','<div class="note-palette-title">'+this.lang.color.foreground+"</div>","<div>",'<button type="button" class="note-color-reset btn btn-light btn-default" data-event="removeFormat" data-value="foreColor">',this.lang.color.resetToDefault,"</button>","</div>",'<div class="note-holder" data-event="foreColor">\x3c!-- fore colors --\x3e</div>',"<div>",'<button type="button" class="note-color-select btn btn-light btn-default" data-event="openPalette" data-value="foreColorPicker">',this.lang.color.cpSelect,"</button>",'<input type="color" id="foreColorPicker" class="note-btn note-color-select-btn" value="'+this.options.colorButton.foreColor+'" data-event="foreColorPalette">',"</div>",'<div class="note-holder-custom" id="foreColorPalette" data-event="foreColor"></div>',"</div>"].join(""):""),callback:function(i){i.find(".note-holder").each(function(t,e){var i=w()(e);i.append(f.ui.palette({colors:f.options.colors,colorsName:f.options.colorsName,eventName:i.data("event"),container:f.options.container,tooltip:f.options.tooltip}).render())});var n=[["#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF"]];i.find(".note-holder-custom").each(function(t,e){var i=w()(e);i.append(f.ui.palette({colors:n,colorsName:n,eventName:i.data("event"),container:f.options.container,tooltip:f.options.tooltip}).render())}),i.find("input[type=color]").each(function(t,e){w()(e).change(function(){var t=i.find("#"+w()(this).data("event")).find(".note-color-btn").first(),e=this.value.toUpperCase();t.css("background-color",e).attr("aria-label",e).attr("data-value",e).attr("data-original-title",e),t.click()})})},click:function(t){t.stopPropagation();var e,i,n,o,a,r,s,l=w()("."+d).find(".note-dropdown-menu"),c=w()(t.target),h=c.data("event"),u=c.attr("data-value");"openPalette"===h?(e=l.find("#"+u),n=(i=w()(l.find("#"+e.data("event")).find(".note-color-row")[0])).find(".note-color-btn").last().detach(),o=e.val(),n.css("background-color",o).attr("aria-label",o).attr("data-value",o).attr("data-original-title",o),i.prepend(n),e.click()):(k.contains(["backColor","foreColor"],h)&&(a="backColor"===h?"background-color":"color",r=c.closest(".note-color").find(".note-recent-color"),s=c.closest(".note-color").find(".note-current-color-button"),r.css(a,u),s.attr("data-"+h,u)),f.context.invoke("editor."+h,u))}})]}).render()}},{key:"addToolbarButtons",value:function(){var n=this;this.context.memo("button.style",function(){return n.ui.buttonGroup([n.button({className:"dropdown-toggle",contents:n.ui.dropdownButtonContents(n.ui.icon(n.options.icons.magic),n.options),tooltip:n.lang.style.style,data:{toggle:"dropdown"}}),n.ui.dropdown({className:"dropdown-style",items:n.options.styleTags,title:n.lang.style.style,template:function(t){"string"==typeof t&&(t={tag:t,title:Object.prototype.hasOwnProperty.call(n.lang.style,t)?n.lang.style[t]:t});var e=t.tag,i=t.title;return"<"+e+(t.style?' style="'+t.style+'" ':"")+(t.className?' class="'+t.className+'"':"")+">"+i+"</"+e+">"},click:n.context.createInvokeHandler("editor.formatBlock")})]).render()});for(var t=0,e=this.options.styleTags.length;t<e;t++)!function(t){var e=n.options.styleTags[t];n.context.memo("button.style."+e,function(){return n.button({className:"note-btn-style-"+e,contents:'<div data-value="'+e+'">'+e.toUpperCase()+"</div>",tooltip:n.lang.style[e],click:n.context.createInvokeHandler("editor.formatBlock")}).render()})}(t);this.context.memo("button.bold",function(){return n.button({className:"note-btn-bold",contents:n.ui.icon(n.options.icons.bold),tooltip:n.lang.font.bold+n.representShortcut("bold"),click:n.context.createInvokeHandlerAndUpdateState("editor.bold")}).render()}),this.context.memo("button.italic",function(){return n.button({className:"note-btn-italic",contents:n.ui.icon(n.options.icons.italic),tooltip:n.lang.font.italic+n.representShortcut("italic"),click:n.context.createInvokeHandlerAndUpdateState("editor.italic")}).render()}),this.context.memo("button.underline",function(){return n.button({className:"note-btn-underline",contents:n.ui.icon(n.options.icons.underline),tooltip:n.lang.font.underline+n.representShortcut("underline"),click:n.context.createInvokeHandlerAndUpdateState("editor.underline")}).render()}),this.context.memo("button.clear",function(){return n.button({contents:n.ui.icon(n.options.icons.eraser),tooltip:n.lang.font.clear+n.representShortcut("removeFormat"),click:n.context.createInvokeHandler("editor.removeFormat")}).render()}),this.context.memo("button.strikethrough",function(){return n.button({className:"note-btn-strikethrough",contents:n.ui.icon(n.options.icons.strikethrough),tooltip:n.lang.font.strikethrough+n.representShortcut("strikethrough"),click:n.context.createInvokeHandlerAndUpdateState("editor.strikethrough")}).render()}),this.context.memo("button.superscript",function(){return n.button({className:"note-btn-superscript",contents:n.ui.icon(n.options.icons.superscript),tooltip:n.lang.font.superscript,click:n.context.createInvokeHandlerAndUpdateState("editor.superscript")}).render()}),this.context.memo("button.subscript",function(){return n.button({className:"note-btn-subscript",contents:n.ui.icon(n.options.icons.subscript),tooltip:n.lang.font.subscript,click:n.context.createInvokeHandlerAndUpdateState("editor.subscript")}).render()}),this.context.memo("button.fontname",function(){var t=n.context.invoke("editor.currentStyle");return n.options.addDefaultFonts&&w.a.each(t["font-family"].split(","),function(t,e){e=e.trim().replace(/['"]+/g,""),n.isFontDeservedToAdd(e)&&-1===n.options.fontNames.indexOf(e)&&n.options.fontNames.push(e)}),n.ui.buttonGroup([n.button({className:"dropdown-toggle",contents:n.ui.dropdownButtonContents('<span class="note-current-fontname"></span>',n.options),tooltip:n.lang.font.name,data:{toggle:"dropdown"}}),n.ui.dropdownCheck({className:"dropdown-fontname",checkClassName:n.options.icons.menuCheck,items:n.options.fontNames.filter(n.isFontInstalled.bind(n)),title:n.lang.font.name,template:function(t){return'<span style="font-family: '+p.validFontName(t)+'">'+t+"</span>"},click:n.context.createInvokeHandlerAndUpdateState("editor.fontName")})]).render()}),this.context.memo("button.fontsize",function(){return n.ui.buttonGroup([n.button({className:"dropdown-toggle",contents:n.ui.dropdownButtonContents('<span class="note-current-fontsize"></span>',n.options),tooltip:n.lang.font.size,data:{toggle:"dropdown"}}),n.ui.dropdownCheck({className:"dropdown-fontsize",checkClassName:n.options.icons.menuCheck,items:n.options.fontSizes,title:n.lang.font.size,click:n.context.createInvokeHandlerAndUpdateState("editor.fontSize")})]).render()}),this.context.memo("button.fontsizeunit",function(){return n.ui.buttonGroup([n.button({className:"dropdown-toggle",contents:n.ui.dropdownButtonContents('<span class="note-current-fontsizeunit"></span>',n.options),tooltip:n.lang.font.sizeunit,data:{toggle:"dropdown"}}),n.ui.dropdownCheck({className:"dropdown-fontsizeunit",checkClassName:n.options.icons.menuCheck,items:n.options.fontSizeUnits,title:n.lang.font.sizeunit,click:n.context.createInvokeHandlerAndUpdateState("editor.fontSizeUnit")})]).render()}),this.context.memo("button.color",function(){return n.colorPalette("note-color-all",n.lang.color.recent,!0,!0)}),this.context.memo("button.forecolor",function(){return n.colorPalette("note-color-fore",n.lang.color.foreground,!1,!0)}),this.context.memo("button.backcolor",function(){return n.colorPalette("note-color-back",n.lang.color.background,!0,!1)}),this.context.memo("button.ul",function(){return n.button({contents:n.ui.icon(n.options.icons.unorderedlist),tooltip:n.lang.lists.unordered+n.representShortcut("insertUnorderedList"),click:n.context.createInvokeHandler("editor.insertUnorderedList")}).render()}),this.context.memo("button.ol",function(){return n.button({contents:n.ui.icon(n.options.icons.orderedlist),tooltip:n.lang.lists.ordered+n.representShortcut("insertOrderedList"),click:n.context.createInvokeHandler("editor.insertOrderedList")}).render()});var i=this.button({contents:this.ui.icon(this.options.icons.alignLeft),tooltip:this.lang.paragraph.left+this.representShortcut("justifyLeft"),click:this.context.createInvokeHandler("editor.justifyLeft")}),o=this.button({contents:this.ui.icon(this.options.icons.alignCenter),tooltip:this.lang.paragraph.center+this.representShortcut("justifyCenter"),click:this.context.createInvokeHandler("editor.justifyCenter")}),a=this.button({contents:this.ui.icon(this.options.icons.alignRight),tooltip:this.lang.paragraph.right+this.representShortcut("justifyRight"),click:this.context.createInvokeHandler("editor.justifyRight")}),r=this.button({contents:this.ui.icon(this.options.icons.alignJustify),tooltip:this.lang.paragraph.justify+this.representShortcut("justifyFull"),click:this.context.createInvokeHandler("editor.justifyFull")}),s=this.button({contents:this.ui.icon(this.options.icons.outdent),tooltip:this.lang.paragraph.outdent+this.representShortcut("outdent"),click:this.context.createInvokeHandler("editor.outdent")}),l=this.button({contents:this.ui.icon(this.options.icons.indent),tooltip:this.lang.paragraph.indent+this.representShortcut("indent"),click:this.context.createInvokeHandler("editor.indent")});this.context.memo("button.justifyLeft",v.invoke(i,"render")),this.context.memo("button.justifyCenter",v.invoke(o,"render")),this.context.memo("button.justifyRight",v.invoke(a,"render")),this.context.memo("button.justifyFull",v.invoke(r,"render")),this.context.memo("button.outdent",v.invoke(s,"render")),this.context.memo("button.indent",v.invoke(l,"render")),this.context.memo("button.paragraph",function(){return n.ui.buttonGroup([n.button({className:"dropdown-toggle",contents:n.ui.dropdownButtonContents(n.ui.icon(n.options.icons.alignLeft),n.options),tooltip:n.lang.paragraph.paragraph,data:{toggle:"dropdown"}}),n.ui.dropdown([n.ui.buttonGroup({className:"note-align",children:[i,o,a,r]}),n.ui.buttonGroup({className:"note-list",children:[s,l]})])]).render()}),this.context.memo("button.height",function(){return n.ui.buttonGroup([n.button({className:"dropdown-toggle",contents:n.ui.dropdownButtonContents(n.ui.icon(n.options.icons.textHeight),n.options),tooltip:n.lang.font.height,data:{toggle:"dropdown"}}),n.ui.dropdownCheck({items:n.options.lineHeights,checkClassName:n.options.icons.menuCheck,className:"dropdown-line-height",title:n.lang.font.height,click:n.context.createInvokeHandler("editor.lineHeight")})]).render()}),this.context.memo("button.table",function(){return n.ui.buttonGroup([n.button({className:"dropdown-toggle",contents:n.ui.dropdownButtonContents(n.ui.icon(n.options.icons.table),n.options),tooltip:n.lang.table.table,data:{toggle:"dropdown"}}),n.ui.dropdown({title:n.lang.table.table,className:"note-table",items:['<div class="note-dimension-picker">','<div class="note-dimension-picker-mousecatcher" data-event="insertTable" data-value="1x1"></div>','<div class="note-dimension-picker-highlighted"></div>','<div class="note-dimension-picker-unhighlighted"></div>',"</div>",'<div class="note-dimension-display">1 x 1</div>'].join("")})],{callback:function(t){t.find(".note-dimension-picker-mousecatcher").css({width:n.options.insertTableMaxSize.col+"em",height:n.options.insertTableMaxSize.row+"em"}).mousedown(n.context.createInvokeHandler("editor.insertTable")).on("mousemove",n.tableMoveHandler.bind(n))}}).render()}),this.context.memo("button.link",function(){return n.button({contents:n.ui.icon(n.options.icons.link),tooltip:n.lang.link.link+n.representShortcut("linkDialog.show"),click:n.context.createInvokeHandler("linkDialog.show")}).render()}),this.context.memo("button.picture",function(){return n.button({contents:n.ui.icon(n.options.icons.picture),tooltip:n.lang.image.image,click:n.context.createInvokeHandler("imageDialog.show")}).render()}),this.context.memo("button.video",function(){return n.button({contents:n.ui.icon(n.options.icons.video),tooltip:n.lang.video.video,click:n.context.createInvokeHandler("videoDialog.show")}).render()}),this.context.memo("button.hr",function(){return n.button({contents:n.ui.icon(n.options.icons.minus),tooltip:n.lang.hr.insert+n.representShortcut("insertHorizontalRule"),click:n.context.createInvokeHandler("editor.insertHorizontalRule")}).render()}),this.context.memo("button.fullscreen",function(){return n.button({className:"btn-fullscreen note-codeview-keep",contents:n.ui.icon(n.options.icons.arrowsAlt),tooltip:n.lang.options.fullscreen,click:n.context.createInvokeHandler("fullscreen.toggle")}).render()}),this.context.memo("button.codeview",function(){return n.button({className:"btn-codeview note-codeview-keep",contents:n.ui.icon(n.options.icons.code),tooltip:n.lang.options.codeview,click:n.context.createInvokeHandler("codeview.toggle")}).render()}),this.context.memo("button.redo",function(){return n.button({contents:n.ui.icon(n.options.icons.redo),tooltip:n.lang.history.redo+n.representShortcut("redo"),click:n.context.createInvokeHandler("editor.redo")}).render()}),this.context.memo("button.undo",function(){return n.button({contents:n.ui.icon(n.options.icons.undo),tooltip:n.lang.history.undo+n.representShortcut("undo"),click:n.context.createInvokeHandler("editor.undo")}).render()}),this.context.memo("button.help",function(){return n.button({contents:n.ui.icon(n.options.icons.question),tooltip:n.lang.options.help,click:n.context.createInvokeHandler("helpDialog.show")}).render()})}},{key:"addImagePopoverButtons",value:function(){var t=this;this.context.memo("button.resizeFull",function(){return t.button({contents:'<span class="note-fontsize-10">100%</span>',tooltip:t.lang.image.resizeFull,click:t.context.createInvokeHandler("editor.resize","1")}).render()}),this.context.memo("button.resizeHalf",function(){return t.button({contents:'<span class="note-fontsize-10">50%</span>',tooltip:t.lang.image.resizeHalf,click:t.context.createInvokeHandler("editor.resize","0.5")}).render()}),this.context.memo("button.resizeQuarter",function(){return t.button({contents:'<span class="note-fontsize-10">25%</span>',tooltip:t.lang.image.resizeQuarter,click:t.context.createInvokeHandler("editor.resize","0.25")}).render()}),this.context.memo("button.resizeNone",function(){return t.button({contents:t.ui.icon(t.options.icons.rollback),tooltip:t.lang.image.resizeNone,click:t.context.createInvokeHandler("editor.resize","0")}).render()}),this.context.memo("button.floatLeft",function(){return t.button({contents:t.ui.icon(t.options.icons.floatLeft),tooltip:t.lang.image.floatLeft,click:t.context.createInvokeHandler("editor.floatMe","left")}).render()}),this.context.memo("button.floatRight",function(){return t.button({contents:t.ui.icon(t.options.icons.floatRight),tooltip:t.lang.image.floatRight,click:t.context.createInvokeHandler("editor.floatMe","right")}).render()}),this.context.memo("button.floatNone",function(){return t.button({contents:t.ui.icon(t.options.icons.rollback),tooltip:t.lang.image.floatNone,click:t.context.createInvokeHandler("editor.floatMe","none")}).render()}),this.context.memo("button.removeMedia",function(){return t.button({contents:t.ui.icon(t.options.icons.trash),tooltip:t.lang.image.remove,click:t.context.createInvokeHandler("editor.removeMedia")}).render()})}},{key:"addLinkPopoverButtons",value:function(){var t=this;this.context.memo("button.linkDialogShow",function(){return t.button({contents:t.ui.icon(t.options.icons.link),tooltip:t.lang.link.edit,click:t.context.createInvokeHandler("linkDialog.show")}).render()}),this.context.memo("button.unlink",function(){return t.button({contents:t.ui.icon(t.options.icons.unlink),tooltip:t.lang.link.unlink,click:t.context.createInvokeHandler("editor.unlink")}).render()})}},{key:"addTablePopoverButtons",value:function(){var t=this;this.context.memo("button.addRowUp",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowAbove),tooltip:t.lang.table.addRowAbove,click:t.context.createInvokeHandler("editor.addRow","top")}).render()}),this.context.memo("button.addRowDown",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowBelow),tooltip:t.lang.table.addRowBelow,click:t.context.createInvokeHandler("editor.addRow","bottom")}).render()}),this.context.memo("button.addColLeft",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colBefore),tooltip:t.lang.table.addColLeft,click:t.context.createInvokeHandler("editor.addCol","left")}).render()}),this.context.memo("button.addColRight",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colAfter),tooltip:t.lang.table.addColRight,click:t.context.createInvokeHandler("editor.addCol","right")}).render()}),this.context.memo("button.deleteRow",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowRemove),tooltip:t.lang.table.delRow,click:t.context.createInvokeHandler("editor.deleteRow")}).render()}),this.context.memo("button.deleteCol",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colRemove),tooltip:t.lang.table.delCol,click:t.context.createInvokeHandler("editor.deleteCol")}).render()}),this.context.memo("button.deleteTable",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.trash),tooltip:t.lang.table.delTable,click:t.context.createInvokeHandler("editor.deleteTable")}).render()})}},{key:"build",value:function(t,e){for(var i=0,n=e.length;i<n;i++){for(var o=e[i],a=Array.isArray(o)?o[0]:o,r=Array.isArray(o)?1===o.length?[o[0]]:o[1]:[o],s=this.ui.buttonGroup({className:"note-"+a}).render(),l=0,c=r.length;l<c;l++){var h=this.context.memo("button."+r[l]);h&&s.append("function"==typeof h?h(this.context):h)}s.appendTo(t)}}},{key:"updateCurrentStyle",value:function(t){var e,o,a,r,n,s=this,i=t||this.$toolbar,l=this.context.invoke("editor.currentStyle");this.updateBtnStates(i,{".note-btn-bold":function(){return"bold"===l["font-bold"]},".note-btn-italic":function(){return"italic"===l["font-italic"]},".note-btn-underline":function(){return"underline"===l["font-underline"]},".note-btn-subscript":function(){return"subscript"===l["font-subscript"]},".note-btn-superscript":function(){return"superscript"===l["font-superscript"]},".note-btn-strikethrough":function(){return"strikethrough"===l["font-strikethrough"]}}),l["font-family"]&&(e=l["font-family"].split(",").map(function(t){return t.replace(/[\'\"]/g,"").replace(/\s+$/,"").replace(/^\s+/,"")}),o=k.find(e,this.isFontInstalled.bind(this)),i.find(".dropdown-fontname a").each(function(t,e){var i=w()(e),n=i.data("value")+""==o+"";i.toggleClass("checked",n)}),i.find(".note-current-fontname").text(o).css("font-family",o)),l["font-size"]&&(a=l["font-size"],i.find(".dropdown-fontsize a").each(function(t,e){var i=w()(e),n=i.data("value")+""==a+"";i.toggleClass("checked",n)}),i.find(".note-current-fontsize").text(a),r=l["font-size-unit"],i.find(".dropdown-fontsizeunit a").each(function(t,e){var i=w()(e),n=i.data("value")+""==r+"";i.toggleClass("checked",n)}),i.find(".note-current-fontsizeunit").text(r)),l["line-height"]&&(n=l["line-height"],i.find(".dropdown-line-height li a").each(function(t,e){var i=w()(e).data("value")+""==n+"";s.className=i?"checked":""}))}},{key:"updateBtnStates",value:function(i,t){var n=this;w.a.each(t,function(t,e){n.ui.toggleBtnActive(i.find(t),e())})}},{key:"tableMoveHandler",value:function(t){var e,i,n=w()(t.target.parentNode),o=n.next(),a=n.find(".note-dimension-picker-mousecatcher"),r=n.find(".note-dimension-picker-highlighted"),s=n.find(".note-dimension-picker-unhighlighted");i=void 0===t.offsetX?(e=w()(t.target).offset(),{x:t.pageX-e.left,y:t.pageY-e.top}):{x:t.offsetX,y:t.offsetY};var l=Math.ceil(i.x/18)||1,c=Math.ceil(i.y/18)||1;r.css({width:l+"em",height:c+"em"}),a.data("value",l+"x"+c),3<l&&l<this.options.insertTableMaxSize.col&&s.css({width:l+1+"em"}),3<c&&c<this.options.insertTableMaxSize.row&&s.css({height:c+1+"em"}),o.html(l+" x "+c)}}])&&re(t.prototype,i),n&&re(t,n),e}();function le(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var ce=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.$window=w()(window),this.$document=w()(document),this.ui=w.a.summernote.ui,this.$note=t.layoutInfo.note,this.$editor=t.layoutInfo.editor,this.$toolbar=t.layoutInfo.toolbar,this.$editable=t.layoutInfo.editable,this.$statusbar=t.layoutInfo.statusbar,this.options=t.options,this.isFollowing=!1,this.followScroll=this.followScroll.bind(this)}var t,i,n;return t=e,(i=[{key:"shouldInitialize",value:function(){return!this.options.airMode}},{key:"initialize",value:function(){var t=this;this.options.toolbar=this.options.toolbar||[],this.options.toolbar.length?this.context.invoke("buttons.build",this.$toolbar,this.options.toolbar):this.$toolbar.hide(),this.options.toolbarContainer&&this.$toolbar.appendTo(this.options.toolbarContainer),this.changeContainer(!1),this.$note.on("summernote.keyup summernote.mouseup summernote.change",function(){t.context.invoke("buttons.updateCurrentStyle")}),this.context.invoke("buttons.updateCurrentStyle"),this.options.followingToolbar&&this.$window.on("scroll resize",this.followScroll)}},{key:"destroy",value:function(){this.$toolbar.children().remove(),this.options.followingToolbar&&this.$window.off("scroll resize",this.followScroll)}},{key:"followScroll",value:function(){if(this.$editor.hasClass("fullscreen"))return!1;var t=this.$editor.outerHeight(),e=this.$editor.width(),i=this.$toolbar.height(),n=this.$statusbar.height(),o=0;this.options.otherStaticBar&&(o=w()(this.options.otherStaticBar).outerHeight());var a=this.$document.scrollTop(),r=this.$editor.offset().top,s=r-o,l=r+t-o-i-n;!this.isFollowing&&s<a&&a<l-i?(this.isFollowing=!0,this.$editable.css({marginTop:this.$toolbar.outerHeight()}),this.$toolbar.css({position:"fixed",top:o,width:e,zIndex:1e3})):this.isFollowing&&(a<s||l<a)&&(this.isFollowing=!1,this.$toolbar.css({position:"relative",top:0,width:"100%",zIndex:"auto"}),this.$editable.css({marginTop:""}))}},{key:"changeContainer",value:function(t){t?this.$toolbar.prependTo(this.$editor):this.options.toolbarContainer&&this.$toolbar.appendTo(this.options.toolbarContainer),this.options.followingToolbar&&this.followScroll()}},{key:"updateFullscreen",value:function(t){this.ui.toggleBtnActive(this.$toolbar.find(".btn-fullscreen"),t),this.changeContainer(t)}},{key:"updateCodeview",value:function(t){this.ui.toggleBtnActive(this.$toolbar.find(".btn-codeview"),t),t?this.deactivate():this.activate()}},{key:"activate",value:function(t){var e=this.$toolbar.find("button");t||(e=e.not(".note-codeview-keep")),this.ui.toggleBtn(e,!0)}},{key:"deactivate",value:function(t){var e=this.$toolbar.find("button");t||(e=e.not(".note-codeview-keep")),this.ui.toggleBtn(e,!1)}}])&&le(t.prototype,i),n&&le(t,n),e}();function he(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var ue=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.ui=w.a.summernote.ui,this.$body=w()(document.body),this.$editor=t.layoutInfo.editor,this.options=t.options,this.lang=this.options.langInfo,t.memo("help.linkDialog.show",this.options.langInfo.help["linkDialog.show"])}var t,i,n;return t=e,(i=[{key:"initialize",value:function(){var t=this.options.dialogsInBody?this.$body:this.options.container,e=['<div class="form-group note-form-group">','<label for="note-dialog-link-txt-'.concat(this.options.id,'" class="note-form-label">').concat(this.lang.link.textToDisplay,"</label>"),'<input id="note-dialog-link-txt-'.concat(this.options.id,'" class="note-link-text form-control note-form-control note-input" type="text"/>'),"</div>",'<div class="form-group note-form-group">','<label for="note-dialog-link-url-'.concat(this.options.id,'" class="note-form-label">').concat(this.lang.link.url,"</label>"),'<input id="note-dialog-link-url-'.concat(this.options.id,'" class="note-link-url form-control note-form-control note-input" type="text" value="http://"/>'),"</div>",this.options.disableLinkTarget?"":w()("<div/>").append(this.ui.checkbox({className:"sn-checkbox-open-in-new-window",text:this.lang.link.openInNewWindow,checked:!0}).render()).html(),w()("<div/>").append(this.ui.checkbox({className:"sn-checkbox-use-protocol",text:this.lang.link.useProtocol,checked:!0}).render()).html()].join(""),i='<input type="button" href="#" class="'.concat("btn btn-primary note-btn note-btn-primary note-link-btn",'" value="').concat(this.lang.link.insert,'" disabled>');this.$dialog=this.ui.dialog({className:"link-dialog",title:this.lang.link.insert,fade:this.options.dialogsFade,body:e,footer:i}).render().appendTo(t)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(t,e){t.on("keypress",function(t){t.keyCode===Ct.code.ENTER&&(t.preventDefault(),e.trigger("click"))})}},{key:"toggleLinkBtn",value:function(t,e,i){this.ui.toggleBtn(t,e.val()&&i.val())}},{key:"showLinkDialog",value:function(l){var c=this;return w.a.Deferred(function(i){var n=c.$dialog.find(".note-link-text"),o=c.$dialog.find(".note-link-url"),a=c.$dialog.find(".note-link-btn"),r=c.$dialog.find(".sn-checkbox-open-in-new-window input[type=checkbox]"),s=c.$dialog.find(".sn-checkbox-use-protocol input[type=checkbox]");c.ui.onDialogShown(c.$dialog,function(){c.context.triggerEvent("dialog.shown"),!l.url&&v.isValidUrl(l.text)&&(l.url=l.text),n.on("input paste propertychange",function(){l.text=n.val(),c.toggleLinkBtn(a,n,o)}).val(l.text),o.on("input paste propertychange",function(){l.text||n.val(o.val()),c.toggleLinkBtn(a,n,o)}).val(l.url),p.isSupportTouch||o.trigger("focus"),c.toggleLinkBtn(a,n,o),c.bindEnterKey(o,a),c.bindEnterKey(n,a);var t=void 0!==l.isNewWindow?l.isNewWindow:c.context.options.linkTargetBlank;r.prop("checked",t);var e=!l.url&&c.context.options.useProtocol;s.prop("checked",e),a.one("click",function(t){t.preventDefault(),i.resolve({range:l.range,url:o.val(),text:n.val(),isNewWindow:r.is(":checked"),checkProtocol:s.is(":checked")}),c.ui.hideDialog(c.$dialog)})}),c.ui.onDialogHidden(c.$dialog,function(){n.off(),o.off(),a.off(),"pending"===i.state()&&i.reject()}),c.ui.showDialog(c.$dialog)}).promise()}},{key:"show",value:function(){var e=this,t=this.context.invoke("editor.getLinkInfo");this.context.invoke("editor.saveRange"),this.showLinkDialog(t).then(function(t){e.context.invoke("editor.restoreRange"),e.context.invoke("editor.createLink",t)}).fail(function(){e.context.invoke("editor.restoreRange")})}}])&&he(t.prototype,i),n&&he(t,n),e}();function de(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var fe=function(){function i(t){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),this.context=t,this.ui=w.a.summernote.ui,this.options=t.options,this.events={"summernote.keyup summernote.mouseup summernote.change summernote.scroll":function(){e.update()},"summernote.disable summernote.dialog.shown summernote.blur":function(){e.hide()}}}var t,e,n;return t=i,(e=[{key:"shouldInitialize",value:function(){return!k.isEmpty(this.options.popover.link)}},{key:"initialize",value:function(){this.$popover=this.ui.popover({className:"note-link-popover",callback:function(t){t.find(".popover-content,.note-popover-content").prepend('<span><a target="_blank"></a>&nbsp;</span>')}}).render().appendTo(this.options.container);var t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.link),this.$popover.on("mousedown",function(t){t.preventDefault()})}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(){var t,e,i,n,o;this.context.invoke("editor.hasFocus")&&(t=this.context.invoke("editor.getLastRange")).isCollapsed()&&t.isOnAnchor()?(e=pt.ancestor(t.sc,pt.isAnchor),i=w()(e).attr("href"),this.$popover.find("a").attr("href",i).text(i),n=pt.posFromPlaceholder(e),o=w()(this.options.container).offset(),n.top-=o.top,n.left-=o.left,this.$popover.css({display:"block",left:n.left,top:n.top})):this.hide()}},{key:"hide",value:function(){this.$popover.hide()}}])&&de(t.prototype,e),n&&de(t,n),i}();function pe(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var ge=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.ui=w.a.summernote.ui,this.$body=w()(document.body),this.$editor=t.layoutInfo.editor,this.options=t.options,this.lang=this.options.langInfo}var t,i,n;return t=e,(i=[{key:"initialize",value:function(){var t,e,i="";this.options.maximumImageFileSize&&(t=Math.floor(Math.log(this.options.maximumImageFileSize)/Math.log(1024)),e=+(this.options.maximumImageFileSize/Math.pow(1024,t)).toFixed(2)+" "+" KMGTP"[t]+"B",i="<small>".concat(this.lang.image.maximumFileSize+" : "+e,"</small>"));var n=this.options.dialogsInBody?this.$body:this.options.container,o=['<div class="form-group note-form-group note-group-select-from-files">','<label for="note-dialog-image-file-'+this.options.id+'" class="note-form-label">'+this.lang.image.selectFromFiles+"</label>",'<input id="note-dialog-image-file-'+this.options.id+'" class="note-image-input form-control-file note-form-control note-input" ',' type="file" name="files" accept="image/*" multiple="multiple"/>',i,"</div>",'<div class="form-group note-group-image-url">','<label for="note-dialog-image-url-'+this.options.id+'" class="note-form-label">'+this.lang.image.url+"</label>",'<input id="note-dialog-image-url-'+this.options.id+'" class="note-image-url form-control note-form-control note-input" type="text"/>',"</div>"].join(""),a='<input type="button" href="#" class="'.concat("btn btn-primary note-btn note-btn-primary note-image-btn",'" value="').concat(this.lang.image.insert,'" disabled>');this.$dialog=this.ui.dialog({title:this.lang.image.insert,fade:this.options.dialogsFade,body:o,footer:a}).render().appendTo(n)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(t,e){t.on("keypress",function(t){t.keyCode===Ct.code.ENTER&&(t.preventDefault(),e.trigger("click"))})}},{key:"show",value:function(){var e=this;this.context.invoke("editor.saveRange"),this.showImageDialog().then(function(t){e.ui.hideDialog(e.$dialog),e.context.invoke("editor.restoreRange"),"string"==typeof t?e.options.callbacks.onImageLinkInsert?e.context.triggerEvent("image.link.insert",t):e.context.invoke("editor.insertImage",t):e.context.invoke("editor.insertImagesOrCallback",t)}).fail(function(){e.context.invoke("editor.restoreRange")})}},{key:"showImageDialog",value:function(){var o=this;return w.a.Deferred(function(e){var t=o.$dialog.find(".note-image-input"),i=o.$dialog.find(".note-image-url"),n=o.$dialog.find(".note-image-btn");o.ui.onDialogShown(o.$dialog,function(){o.context.triggerEvent("dialog.shown"),t.replaceWith(t.clone().on("change",function(t){e.resolve(t.target.files||t.target.value)}).val("")),i.on("input paste propertychange",function(){o.ui.toggleBtn(n,i.val())}).val(""),p.isSupportTouch||i.trigger("focus"),n.click(function(t){t.preventDefault(),e.resolve(i.val())}),o.bindEnterKey(i,n)}),o.ui.onDialogHidden(o.$dialog,function(){t.off(),i.off(),n.off(),"pending"===e.state()&&e.reject()}),o.ui.showDialog(o.$dialog)})}}])&&pe(t.prototype,i),n&&pe(t,n),e}();function ve(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var me=function(){function i(t){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),this.context=t,this.ui=w.a.summernote.ui,this.editable=t.layoutInfo.editable[0],this.options=t.options,this.events={"summernote.disable summernote.blur":function(){e.hide()}}}var t,e,n;return t=i,(e=[{key:"shouldInitialize",value:function(){return!k.isEmpty(this.options.popover.image)}},{key:"initialize",value:function(){this.$popover=this.ui.popover({className:"note-image-popover"}).render().appendTo(this.options.container);var t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.image),this.$popover.on("mousedown",function(t){t.preventDefault()})}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(t,e){var i,n,o;pt.isImg(t)?(i=w()(t).offset(),n=w()(this.options.container).offset(),o={},this.options.popatmouse?(o.left=e.pageX-20,o.top=e.pageY):o=i,o.top-=n.top,o.left-=n.left,this.$popover.css({display:"block",left:o.left,top:o.top})):this.hide()}},{key:"hide",value:function(){this.$popover.hide()}}])&&ve(t.prototype,e),n&&ve(t,n),i}();function be(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var ye=function(){function e(t){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.ui=w.a.summernote.ui,this.options=t.options,this.events={"summernote.mousedown":function(t,e){i.update(e.target)},"summernote.keyup summernote.scroll summernote.change":function(){i.update()},"summernote.disable summernote.blur":function(){i.hide()}}}var t,i,n;return t=e,(i=[{key:"shouldInitialize",value:function(){return!k.isEmpty(this.options.popover.table)}},{key:"initialize",value:function(){this.$popover=this.ui.popover({className:"note-table-popover"}).render().appendTo(this.options.container);var t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.table),p.isFF&&document.execCommand("enableInlineTableEditing",!1,!1),this.$popover.on("mousedown",function(t){t.preventDefault()})}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(t){if(this.context.isDisabled())return!1;var e,i,n=pt.isCell(t);return n?(e=pt.posFromPlaceholder(t),i=w()(this.options.container).offset(),e.top-=i.top,e.left-=i.left,this.$popover.css({display:"block",left:e.left,top:e.top})):this.hide(),n}},{key:"hide",value:function(){this.$popover.hide()}}])&&be(t.prototype,i),n&&be(t,n),e}();function xe(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var we=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.ui=w.a.summernote.ui,this.$body=w()(document.body),this.$editor=t.layoutInfo.editor,this.options=t.options,this.lang=this.options.langInfo}var t,i,n;return t=e,(i=[{key:"initialize",value:function(){var t=this.options.dialogsInBody?this.$body:this.options.container,e=['<div class="form-group note-form-group row-fluid">','<label for="note-dialog-video-url-'.concat(this.options.id,'" class="note-form-label">').concat(this.lang.video.url,' <small class="text-muted">').concat(this.lang.video.providers,"</small></label>"),'<input id="note-dialog-video-url-'.concat(this.options.id,'" class="note-video-url form-control note-form-control note-input" type="text"/>'),"</div>"].join(""),i='<input type="button" href="#" class="'.concat("btn btn-primary note-btn note-btn-primary note-video-btn",'" value="').concat(this.lang.video.insert,'" disabled>');this.$dialog=this.ui.dialog({title:this.lang.video.insert,fade:this.options.dialogsFade,body:e,footer:i}).render().appendTo(t)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(t,e){t.on("keypress",function(t){t.keyCode===Ct.code.ENTER&&(t.preventDefault(),e.trigger("click"))})}},{key:"createVideoNode",value:function(t){var e=t.match(/\/\/(?:(?:www|m)\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?$/),i=t.match(/(?:www\.|\/\/)instagram\.com\/p\/(.[a-zA-Z0-9_-]*)/),n=t.match(/\/\/vine\.co\/v\/([a-zA-Z0-9]+)/),o=t.match(/\/\/(player\.)?vimeo\.com\/([a-z]*\/)*(\d+)[?]?.*/),a=t.match(/.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/),r=t.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),s=t.match(/\/\/v\.qq\.com.*?vid=(.+)/),l=t.match(/\/\/v\.qq\.com\/x?\/?(page|cover).*?\/([^\/]+)\.html\??.*/),c=t.match(/^.+.(mp4|m4v)$/),h=t.match(/^.+.(ogg|ogv)$/),u=t.match(/^.+.(webm)$/),d=t.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/);if(e&&11===e[1].length){var f=e[1],p=0;if(void 0!==e[2]){var g=e[2].match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/);if(g)for(var v=[3600,60,1],m=0,b=v.length;m<b;m++)p+=void 0!==g[m+1]?v[m]*parseInt(g[m+1],10):0}x=w()("<iframe>").attr("frameborder",0).attr("src","//www.youtube.com/embed/"+f+(0<p?"?start="+p:"")).attr("width","640").attr("height","360")}else if(i&&i[0].length)x=w()("<iframe>").attr("frameborder",0).attr("src","https://instagram.com/p/"+i[1]+"/embed/").attr("width","612").attr("height","710").attr("scrolling","no").attr("allowtransparency","true");else if(n&&n[0].length)x=w()("<iframe>").attr("frameborder",0).attr("src",n[0]+"/embed/simple").attr("width","600").attr("height","600").attr("class","vine-embed");else if(o&&o[3].length)x=w()("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("src","//player.vimeo.com/video/"+o[3]).attr("width","640").attr("height","360");else if(a&&a[2].length)x=w()("<iframe>").attr("frameborder",0).attr("src","//www.dailymotion.com/embed/video/"+a[2]).attr("width","640").attr("height","360");else if(r&&r[1].length)x=w()("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("height","498").attr("width","510").attr("src","//player.youku.com/embed/"+r[1]);else if(s&&s[1].length||l&&l[2].length)var y=s&&s[1].length?s[1]:l[2],x=w()("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("height","310").attr("width","500").attr("src","https://v.qq.com/txp/iframe/player.html?vid="+y+"&amp;auto=0");else if(c||h||u)x=w()("<video controls>").attr("src",t).attr("width","640").attr("height","360");else{if(!d||!d[0].length)return!1;x=w()("<iframe>").attr("frameborder",0).attr("src","https://www.facebook.com/plugins/video.php?href="+encodeURIComponent(d[0])+"&show_text=0&width=560").attr("width","560").attr("height","301").attr("scrolling","no").attr("allowtransparency","true")}return x.addClass("note-video-clip"),x[0]}},{key:"show",value:function(){var i=this,t=this.context.invoke("editor.getSelectedText");this.context.invoke("editor.saveRange"),this.showVideoDialog(t).then(function(t){i.ui.hideDialog(i.$dialog),i.context.invoke("editor.restoreRange");var e=i.createVideoNode(t);e&&i.context.invoke("editor.insertNode",e)}).fail(function(){i.context.invoke("editor.restoreRange")})}},{key:"showVideoDialog",value:function(){var n=this;return w.a.Deferred(function(e){var i=n.$dialog.find(".note-video-url"),t=n.$dialog.find(".note-video-btn");n.ui.onDialogShown(n.$dialog,function(){n.context.triggerEvent("dialog.shown"),i.on("input paste propertychange",function(){n.ui.toggleBtn(t,i.val())}),p.isSupportTouch||i.trigger("focus"),t.click(function(t){t.preventDefault(),e.resolve(i.val())}),n.bindEnterKey(i,t)}),n.ui.onDialogHidden(n.$dialog,function(){i.off(),t.off(),"pending"===e.state()&&e.reject()}),n.ui.showDialog(n.$dialog)})}}])&&xe(t.prototype,i),n&&xe(t,n),e}();function ke(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Ce=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.ui=w.a.summernote.ui,this.$body=w()(document.body),this.$editor=t.layoutInfo.editor,this.options=t.options,this.lang=this.options.langInfo}var t,i,n;return t=e,(i=[{key:"initialize",value:function(){var t=this.options.dialogsInBody?this.$body:this.options.container,e=['<p class="text-center">','<a href="http://summernote.org/" target="_blank">Summernote 0.8.18</a> · ','<a href="https://github.com/summernote/summernote" target="_blank">Project</a> · ','<a href="https://github.com/summernote/summernote/issues" target="_blank">Issues</a>',"</p>"].join("");this.$dialog=this.ui.dialog({title:this.lang.options.help,fade:this.options.dialogsFade,body:this.createShortcutList(),footer:e,callback:function(t){t.find(".modal-body,.note-modal-body").css({"max-height":300,overflow:"scroll"})}}).render().appendTo(t)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"createShortcutList",value:function(){var n=this,o=this.options.keyMap[p.isMac?"mac":"pc"];return Object.keys(o).map(function(t){var e=o[t],i=w()('<div><div class="help-list-item"></div></div>');return i.append(w()("<label><kbd>"+t+"</kdb></label>").css({width:180,"margin-right":10})).append(w()("<span/>").html(n.context.memo("help."+e)||e)),i.html()}).join("")}},{key:"showHelpDialog",value:function(){var e=this;return w.a.Deferred(function(t){e.ui.onDialogShown(e.$dialog,function(){e.context.triggerEvent("dialog.shown"),t.resolve()}),e.ui.showDialog(e.$dialog)}).promise()}},{key:"show",value:function(){var t=this;this.context.invoke("editor.saveRange"),this.showHelpDialog().then(function(){t.context.invoke("editor.restoreRange")})}}])&&ke(t.prototype,i),n&&ke(t,n),e}();function Ae(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Se=function(){function e(t){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.ui=w.a.summernote.ui,this.options=t.options,this.hidable=!0,this.onContextmenu=!1,this.pageX=null,this.pageY=null,this.events={"summernote.contextmenu":function(t){i.options.editing&&(t.preventDefault(),t.stopPropagation(),i.onContextmenu=!0,i.update(!0))},"summernote.mousedown":function(t,e){i.pageX=e.pageX,i.pageY=e.pageY},"summernote.keyup summernote.mouseup summernote.scroll":function(t,e){i.options.editing&&!i.onContextmenu&&(i.pageX=e.pageX,i.pageY=e.pageY,i.update()),i.onContextmenu=!1},"summernote.disable summernote.change summernote.dialog.shown summernote.blur":function(){i.hide()},"summernote.focusout":function(){i.$popover.is(":active,:focus")||i.hide()}}}var t,i,n;return t=e,(i=[{key:"shouldInitialize",value:function(){return this.options.airMode&&!k.isEmpty(this.options.popover.air)}},{key:"initialize",value:function(){var t=this;this.$popover=this.ui.popover({className:"note-air-popover"}).render().appendTo(this.options.container);var e=this.$popover.find(".popover-content");this.context.invoke("buttons.build",e,this.options.popover.air),this.$popover.on("mousedown",function(){t.hidable=!1}),this.$popover.on("mouseup",function(){t.hidable=!0})}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(t){var e,i,n=this.context.invoke("editor.currentStyle");!n.range||n.range.isCollapsed()&&!t?this.hide():(e={left:this.pageX,top:this.pageY},i=w()(this.options.container).offset(),e.top-=i.top,e.left-=i.left,this.$popover.css({display:"block",left:Math.max(e.left,0)+-5,top:e.top+5}),this.context.invoke("buttons.updateCurrentStyle",this.$popover))}},{key:"updateCodeview",value:function(t){this.ui.toggleBtnActive(this.$popover.find(".btn-codeview"),t),t&&this.hide()}},{key:"hide",value:function(){this.hidable&&this.$popover.hide()}}])&&Ae(t.prototype,i),n&&Ae(t,n),e}();function Te(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Ee=function(){function e(t){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.ui=w.a.summernote.ui,this.$editable=t.layoutInfo.editable,this.options=t.options,this.hint=this.options.hint||[],this.direction=this.options.hintDirection||"bottom",this.hints=Array.isArray(this.hint)?this.hint:[this.hint],this.events={"summernote.keyup":function(t,e){e.isDefaultPrevented()||i.handleKeyup(e)},"summernote.keydown":function(t,e){i.handleKeydown(e)},"summernote.disable summernote.dialog.shown summernote.blur":function(){i.hide()}}}var t,i,n;return t=e,(i=[{key:"shouldInitialize",value:function(){return 0<this.hints.length}},{key:"initialize",value:function(){var e=this;this.lastWordRange=null,this.matchingWord=null,this.$popover=this.ui.popover({className:"note-hint-popover",hideArrow:!0,direction:""}).render().appendTo(this.options.container),this.$popover.hide(),this.$content=this.$popover.find(".popover-content,.note-popover-content"),this.$content.on("click",".note-hint-item",function(t){e.$content.find(".active").removeClass("active"),w()(t.currentTarget).addClass("active"),e.replace()}),this.$popover.on("mousedown",function(t){t.preventDefault()})}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"selectItem",value:function(t){this.$content.find(".active").removeClass("active"),t.addClass("active"),this.$content[0].scrollTop=t[0].offsetTop-this.$content.innerHeight()/2}},{key:"moveDown",value:function(){var t,e=this.$content.find(".note-hint-item.active"),i=e.next();i.length?this.selectItem(i):((t=e.parent().next()).length||(t=this.$content.find(".note-hint-group").first()),this.selectItem(t.find(".note-hint-item").first()))}},{key:"moveUp",value:function(){var t,e=this.$content.find(".note-hint-item.active"),i=e.prev();i.length?this.selectItem(i):((t=e.parent().prev()).length||(t=this.$content.find(".note-hint-group").last()),this.selectItem(t.find(".note-hint-item").last()))}},{key:"replace",value:function(){var t,e,i,n=this.$content.find(".note-hint-item.active");n.length&&(t=this.nodeFromItem(n),null!==this.matchingWord&&0===this.matchingWord.length?this.lastWordRange.so=this.lastWordRange.eo:null!==this.matchingWord&&0<this.matchingWord.length&&!this.lastWordRange.isCollapsed()&&(0<(e=this.lastWordRange.eo-this.lastWordRange.so-this.matchingWord.length)&&(this.lastWordRange.so+=e)),this.lastWordRange.insertNode(t),"next"===this.options.hintSelect?(i=document.createTextNode(""),w()(t).after(i),wt.createFromNodeBefore(i).select()):wt.createFromNodeAfter(t).select(),this.lastWordRange=null,this.hide(),this.context.invoke("editor.focus"))}},{key:"nodeFromItem",value:function(t){var e=this.hints[t.data("index")],i=t.data("item"),n=e.content?e.content(i):i;return"string"==typeof n&&(n=pt.createText(n)),n}},{key:"createItemTemplates",value:function(i,t){var n=this.hints[i];return t.map(function(t){var e=w()('<div class="note-hint-item"/>');return e.append(n.template?n.template(t):t+""),e.data({index:i,item:t}),e})}},{key:"handleKeydown",value:function(t){this.$popover.is(":visible")&&(t.keyCode===Ct.code.ENTER?(t.preventDefault(),this.replace()):t.keyCode===Ct.code.UP?(t.preventDefault(),this.moveUp()):t.keyCode===Ct.code.DOWN&&(t.preventDefault(),this.moveDown()))}},{key:"searchKeyword",value:function(t,e,i){var n,o=this.hints[t];o&&o.match.test(e)&&o.search?(n=o.match.exec(e),this.matchingWord=n[0],o.search(n[1],i)):i()}},{key:"createGroup",value:function(e,t){var i=this,n=w()('<div class="note-hint-group note-hint-group-'+e+'"></div>');return this.searchKeyword(e,t,function(t){(t=t||[]).length&&(n.html(i.createItemTemplates(e,t)),i.show())}),n}},{key:"handleKeyup",value:function(t){var i=this;if(!k.contains([Ct.code.ENTER,Ct.code.UP,Ct.code.DOWN],t.keyCode)){var e,n,o,a,r=this.context.invoke("editor.getLastRange");if("words"===this.options.hintMode){if(e=r.getWordsRange(r),n=e.toString(),this.hints.forEach(function(t){if(t.match.test(n))return e=r.getWordsMatchRange(t.match),!1}),!e)return void this.hide();n=e.toString()}else e=r.getWordRange(),n=e.toString();this.hints.length&&n?(this.$content.empty(),o=v.rect2bnd(k.last(e.getClientRects())),a=w()(this.options.container).offset(),o&&(o.top-=a.top,o.left-=a.left,this.$popover.hide(),this.lastWordRange=e,this.hints.forEach(function(t,e){t.match.test(n)&&i.createGroup(e,n).appendTo(i.$content)}),this.$content.find(".note-hint-item:first").addClass("active"),"top"===this.direction?this.$popover.css({left:o.left,top:o.top-this.$popover.outerHeight()-5}):this.$popover.css({left:o.left,top:o.top+o.height+5}))):this.hide()}}},{key:"show",value:function(){this.$popover.show()}},{key:"hide",value:function(){this.$popover.hide()}}])&&Te(t.prototype,i),n&&Te(t,n),e}();w.a.summernote=w.a.extend(w.a.summernote,{version:"0.8.18",plugins:{},dom:pt,range:wt,lists:k,options:{langInfo:w.a.summernote.lang["en-US"],editing:!0,modules:{editor:Rt,clipboard:jt,dropzone:Ft,codeview:qt,statusbar:$t,fullscreen:Ut,handle:Kt,hintPopover:Ee,autoLink:Jt,autoSync:ee,autoReplace:ne,placeholder:ae,buttons:se,toolbar:ce,linkDialog:ue,linkPopover:fe,imageDialog:ge,imagePopover:me,tablePopover:ye,videoDialog:we,helpDialog:Ce,airPopover:Se},buttons:{},lang:"en-US",followingToolbar:!1,toolbarPosition:"top",otherStaticBar:"",codeviewKeepButton:!1,toolbar:[["style",["style"]],["font",["bold","underline","clear"]],["fontname",["fontname"]],["color",["color"]],["para",["ul","ol","paragraph"]],["table",["table"]],["insert",["link","picture","video"]],["view",["fullscreen","codeview","help"]]],popatmouse:!0,popover:{image:[["resize",["resizeFull","resizeHalf","resizeQuarter","resizeNone"]],["float",["floatLeft","floatRight","floatNone"]],["remove",["removeMedia"]]],link:[["link",["linkDialogShow","unlink"]]],table:[["add",["addRowDown","addRowUp","addColLeft","addColRight"]],["delete",["deleteRow","deleteCol","deleteTable"]]],air:[["color",["color"]],["font",["bold","underline","clear"]],["para",["ul","paragraph"]],["table",["table"]],["insert",["link","picture"]],["view",["fullscreen","codeview"]]]},airMode:!1,overrideContextMenu:!1,width:null,height:null,linkTargetBlank:!0,useProtocol:!0,defaultProtocol:"http://",focus:!1,tabDisabled:!1,tabSize:4,styleWithCSS:!1,shortcuts:!0,textareaAutoSync:!0,tooltip:"auto",container:null,maxTextLength:0,blockquoteBreakingLevel:2,spellCheck:!0,disableGrammar:!1,placeholder:null,inheritPlaceholder:!1,recordEveryKeystroke:!1,historyLimit:200,showDomainOnlyForAutolink:!1,hintMode:"word",hintSelect:"after",hintDirection:"bottom",styleTags:["p","blockquote","pre","h1","h2","h3","h4","h5","h6"],fontNames:["Arial","Arial Black","Comic Sans MS","Courier New","Helvetica Neue","Helvetica","Impact","Lucida Grande","Tahoma","Times New Roman","Verdana"],fontNamesIgnoreCheck:[],addDefaultFonts:!0,fontSizes:["8","9","10","11","12","14","18","24","36"],fontSizeUnits:["px","pt"],colors:[["#000000","#424242","#636363","#9C9C94","#CEC6CE","#EFEFEF","#F7F7F7","#FFFFFF"],["#FF0000","#FF9C00","#FFFF00","#00FF00","#00FFFF","#0000FF","#9C00FF","#FF00FF"],["#F7C6CE","#FFE7CE","#FFEFC6","#D6EFD6","#CEDEE7","#CEE7F7","#D6D6E7","#E7D6DE"],["#E79C9C","#FFC69C","#FFE79C","#B5D6A5","#A5C6CE","#9CC6EF","#B5A5D6","#D6A5BD"],["#E76363","#F7AD6B","#FFD663","#94BD7B","#73A5AD","#6BADDE","#8C7BC6","#C67BA5"],["#CE0000","#E79439","#EFC631","#6BA54A","#4A7B8C","#3984C6","#634AA5","#A54A7B"],["#9C0000","#B56308","#BD9400","#397B21","#104A5A","#085294","#311873","#731842"],["#630000","#7B3900","#846300","#295218","#083139","#003163","#21104A","#4A1031"]],colorsName:[["Black","Tundora","Dove Gray","Star Dust","Pale Slate","Gallery","Alabaster","White"],["Red","Orange Peel","Yellow","Green","Cyan","Blue","Electric Violet","Magenta"],["Azalea","Karry","Egg White","Zanah","Botticelli","Tropical Blue","Mischka","Twilight"],["Tonys Pink","Peach Orange","Cream Brulee","Sprout","Casper","Perano","Cold Purple","Careys Pink"],["Mandy","Rajah","Dandelion","Olivine","Gulf Stream","Viking","Blue Marguerite","Puce"],["Guardsman Red","Fire Bush","Golden Dream","Chelsea Cucumber","Smalt Blue","Boston Blue","Butterfly Bush","Cadillac"],["Sangria","Mai Tai","Buddha Gold","Forest Green","Eden","Venice Blue","Meteorite","Claret"],["Rosewood","Cinnamon","Olive","Parsley","Tiber","Midnight Blue","Valentino","Loulou"]],colorButton:{foreColor:"#000000",backColor:"#FFFF00"},lineHeights:["1.0","1.2","1.4","1.5","1.6","1.8","2.0","3.0"],tableClassName:"table table-bordered",insertTableMaxSize:{col:10,row:10},dialogsInBody:!1,dialogsFade:!1,maximumImageFileSize:null,callbacks:{onBeforeCommand:null,onBlur:null,onBlurCodeview:null,onChange:null,onChangeCodeview:null,onDialogShown:null,onEnter:null,onFocus:null,onImageLinkInsert:null,onImageUpload:null,onImageUploadError:null,onInit:null,onKeydown:null,onKeyup:null,onMousedown:null,onMouseup:null,onPaste:null,onScroll:null},codemirror:{mode:"text/html",htmlMode:!0,lineNumbers:!0},codeviewFilter:!1,codeviewFilterRegex:/<\/*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|ilayer|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|t(?:itle|extarea)|xml)[^>]*?>/gi,codeviewIframeFilter:!0,codeviewIframeWhitelistSrc:[],codeviewIframeWhitelistSrcBase:["www.youtube.com","www.youtube-nocookie.com","www.facebook.com","vine.co","instagram.com","player.vimeo.com","www.dailymotion.com","player.youku.com","v.qq.com"],keyMap:{pc:{ESC:"escape",ENTER:"insertParagraph","CTRL+Z":"undo","CTRL+Y":"redo",TAB:"tab","SHIFT+TAB":"untab","CTRL+B":"bold","CTRL+I":"italic","CTRL+U":"underline","CTRL+SHIFT+S":"strikethrough","CTRL+BACKSLASH":"removeFormat","CTRL+SHIFT+L":"justifyLeft","CTRL+SHIFT+E":"justifyCenter","CTRL+SHIFT+R":"justifyRight","CTRL+SHIFT+J":"justifyFull","CTRL+SHIFT+NUM7":"insertUnorderedList","CTRL+SHIFT+NUM8":"insertOrderedList","CTRL+LEFTBRACKET":"outdent","CTRL+RIGHTBRACKET":"indent","CTRL+NUM0":"formatPara","CTRL+NUM1":"formatH1","CTRL+NUM2":"formatH2","CTRL+NUM3":"formatH3","CTRL+NUM4":"formatH4","CTRL+NUM5":"formatH5","CTRL+NUM6":"formatH6","CTRL+ENTER":"insertHorizontalRule","CTRL+K":"linkDialog.show"},mac:{ESC:"escape",ENTER:"insertParagraph","CMD+Z":"undo","CMD+SHIFT+Z":"redo",TAB:"tab","SHIFT+TAB":"untab","CMD+B":"bold","CMD+I":"italic","CMD+U":"underline","CMD+SHIFT+S":"strikethrough","CMD+BACKSLASH":"removeFormat","CMD+SHIFT+L":"justifyLeft","CMD+SHIFT+E":"justifyCenter","CMD+SHIFT+R":"justifyRight","CMD+SHIFT+J":"justifyFull","CMD+SHIFT+NUM7":"insertUnorderedList","CMD+SHIFT+NUM8":"insertOrderedList","CMD+LEFTBRACKET":"outdent","CMD+RIGHTBRACKET":"indent","CMD+NUM0":"formatPara","CMD+NUM1":"formatH1","CMD+NUM2":"formatH2","CMD+NUM3":"formatH3","CMD+NUM4":"formatH4","CMD+NUM5":"formatH5","CMD+NUM6":"formatH6","CMD+ENTER":"insertHorizontalRule","CMD+K":"linkDialog.show"}},icons:{align:"note-icon-align",alignCenter:"note-icon-align-center",alignJustify:"note-icon-align-justify",alignLeft:"note-icon-align-left",alignRight:"note-icon-align-right",rowBelow:"note-icon-row-below",colBefore:"note-icon-col-before",colAfter:"note-icon-col-after",rowAbove:"note-icon-row-above",rowRemove:"note-icon-row-remove",colRemove:"note-icon-col-remove",indent:"note-icon-align-indent",outdent:"note-icon-align-outdent",arrowsAlt:"note-icon-arrows-alt",bold:"note-icon-bold",caret:"note-icon-caret",circle:"note-icon-circle",close:"note-icon-close",code:"note-icon-code",eraser:"note-icon-eraser",floatLeft:"note-icon-float-left",floatRight:"note-icon-float-right",font:"note-icon-font",frame:"note-icon-frame",italic:"note-icon-italic",link:"note-icon-link",unlink:"note-icon-chain-broken",magic:"note-icon-magic",menuCheck:"note-icon-menu-check",minus:"note-icon-minus",orderedlist:"note-icon-orderedlist",pencil:"note-icon-pencil",picture:"note-icon-picture",question:"note-icon-question",redo:"note-icon-redo",rollback:"note-icon-rollback",square:"note-icon-square",strikethrough:"note-icon-strikethrough",subscript:"note-icon-subscript",superscript:"note-icon-superscript",table:"note-icon-table",textHeight:"note-icon-text-height",trash:"note-icon-trash",underline:"note-icon-underline",undo:"note-icon-undo",unorderedlist:"note-icon-unorderedlist",video:"note-icon-video"}}})},5:function(){},53:function(t,e,i){i.r(e);var n=i(0),o=i.n(n),a=i(1);function r(t){return(r="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(t){return _typeof2(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":_typeof2(t)})(t)}function s(t){return t}function l(f){return{editor:c,toolbar:h,editingArea:u,codable:d,editable:p,statusbar:g,airEditor:v,airEditable:m,buttonGroup:b,dropdown:y,dropdownButtonContents:s,dropdownCheck:x,dialog:w,popover:k,icon:A,checkbox:C,options:f,palette:function(t,e){return a.a.create('<div class="note-color-palette"/>',function(t,e){for(var i=[],n=0,o=e.colors.length;n<o;n++){for(var a=e.eventName,r=e.colors[n],s=e.colorsName[n],l=[],c=0,h=r.length;c<h;c++){var u=r[c],d=s[c];l.push(['<button type="button" class="note-color-btn"','style="background-color:',u,'" ','data-event="',a,'" ','data-value="',u,'" ','title="',d,'" ','aria-label="',d,'" ','data-toggle="button" tabindex="-1"></button>'].join(""))}i.push('<div class="note-color-row">'+l.join("")+"</div>")}t.html(i.join("")),e.tooltip&&t.find(".note-color-btn").tooltip({container:e.container||f.container,trigger:"hover",placement:"bottom"})})(t,e)},button:function(t,e){return a.a.create('<button type="button" class="note-btn btn btn-light btn-sm" tabindex="-1">',function(t,e){e&&e.tooltip&&t.attr({title:e.tooltip,"aria-label":e.tooltip}).tooltip({container:e.container||f.container,trigger:"hover",placement:"bottom"}).on("click",function(t){o()(t.currentTarget).tooltip("hide")}),e&&e.codeviewButton&&t.addClass("note-codeview-keep")})(t,e)},toggleBtn:function(t,e){t.toggleClass("disabled",!e),t.attr("disabled",!e)},toggleBtnActive:function(t,e){t.toggleClass("active",e)},onDialogShown:function(t,e){t.one("shown.bs.modal",e)},onDialogHidden:function(t,e){t.one("hidden.bs.modal",e)},showDialog:function(t){t.modal("show")},hideDialog:function(t){t.modal("hide")},createLayout:function(t){var e=(f.airMode?v([u([d(),m()])]):"bottom"===f.toolbarPosition?c([u([d(),p()]),h(),g()]):c([h(),u([d(),p()]),g()])).render();return e.insertAfter(t),{note:t,editor:e,toolbar:e.find(".note-toolbar"),editingArea:e.find(".note-editing-area"),editable:e.find(".note-editable"),codable:e.find(".note-codable"),statusbar:e.find(".note-statusbar")}},removeLayout:function(t,e){t.html(e.editable.html()),e.editor.remove(),t.show()}}}var c=a.a.create('<div class="note-editor note-frame card"/>'),h=a.a.create('<div class="note-toolbar card-header" role="toolbar"/>'),u=a.a.create('<div class="note-editing-area"/>'),d=a.a.create('<textarea class="note-codable" aria-multiline="true"/>'),p=a.a.create('<div class="note-editable card-block" contentEditable="true" role="textbox" aria-multiline="true"/>'),g=a.a.create(['<output class="note-status-output" role="status" aria-live="polite"></output>','<div class="note-statusbar" role="status">','<div class="note-resizebar" aria-label="Resize">','<div class="note-icon-bar"></div>','<div class="note-icon-bar"></div>','<div class="note-icon-bar"></div>',"</div>","</div>"].join("")),v=a.a.create('<div class="note-editor note-airframe"/>'),m=a.a.create(['<div class="note-editable" contentEditable="true" role="textbox" aria-multiline="true"></div>','<output class="note-status-output" role="status" aria-live="polite"></output>'].join("")),b=a.a.create('<div class="note-btn-group btn-group">'),y=a.a.create('<div class="note-dropdown-menu dropdown-menu" role="list">',function(t,o){var e=Array.isArray(o.items)?o.items.map(function(t){var e="string"==typeof t?t:t.value||"",i=o.template?o.template(t):t,n="object"===r(t)?t.option:void 0;return'<a class="dropdown-item" href="#" '+('data-value="'+e+'"')+(void 0!==n?' data-option="'+n+'"':"")+' role="listitem" aria-label="'+e+'">'+i+"</a>"}).join(""):o.items;t.html(e).attr({"aria-label":o.title}),o&&o.codeviewKeepButton&&t.addClass("note-codeview-keep")}),x=a.a.create('<div class="note-dropdown-menu dropdown-menu note-check" role="list">',function(t,n){var e=Array.isArray(n.items)?n.items.map(function(t){var e="string"==typeof t?t:t.value||"",i=n.template?n.template(t):t;return'<a class="dropdown-item" href="#" data-value="'+e+'" role="listitem" aria-label="'+t+'">'+A(n.checkClassName)+" "+i+"</a>"}).join(""):n.items;t.html(e).attr({"aria-label":n.title}),n&&n.codeviewKeepButton&&t.addClass("note-codeview-keep")}),w=a.a.create('<div class="modal note-modal" aria-hidden="false" tabindex="-1" role="dialog"/>',function(t,e){e.fade&&t.addClass("fade"),t.attr({"aria-label":e.title}),t.html(['<div class="modal-dialog">','<div class="modal-content">',e.title?'<div class="modal-header"><h4 class="modal-title">'+e.title+'</h4><button type="button" class="close" data-dismiss="modal" aria-label="Close" aria-hidden="true">&times;</button></div>':"",'<div class="modal-body">'+e.body+"</div>",e.footer?'<div class="modal-footer">'+e.footer+"</div>":"","</div>","</div>"].join(""))}),k=a.a.create(['<div class="note-popover popover in">','<div class="arrow"></div>','<div class="popover-content note-children-container"></div>',"</div>"].join(""),function(t,e){var i=void 0!==e.direction?e.direction:"bottom";t.addClass(i),e.hideArrow&&t.find(".arrow").hide()}),C=a.a.create('<div class="form-check"></div>',function(t,e){t.html(['<label class="form-check-label"'+(e.id?' for="note-'+e.id+'"':"")+">",'<input type="checkbox" class="form-check-input"'+(e.id?' id="note-'+e.id+'"':""),e.checked?" checked":"",' aria-label="'+(e.text?e.text:"")+'"',' aria-checked="'+(e.checked?"true":"false")+'"/>'," "+(e.text?e.text:"")+"</label>"].join(""))}),A=function(t,e){return"<"+(e=e||"i")+' class="'+t+'"></'+e+">"};i(3),i(5);o.a.summernote=o.a.extend(o.a.summernote,{ui_template:l,interface:"bs4"}),o.a.summernote.options.styleTags=["p",{title:"Blockquote",tag:"blockquote",className:"blockquote",value:"blockquote"},"pre","h1","h2","h3","h4","h5","h6"]}},o.c=n,o.d=function(t,e,i){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===_typeof2(e)&&e&&e.__esModule)return e;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(i,n,function(t){return e[t]}.bind(null,n));return i},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=53);function o(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return i[t].call(e.exports,e,e.exports,o),e.l=!0,e.exports}var i,n}),function(o){var u=o.Markdown=function(t){switch(_typeof2(t)){case"undefined":this.dialect=u.dialects.Gruber;break;case"object":this.dialect=t;break;default:if(!(t in u.dialects))throw new Error("Unknown Markdown dialect '"+String(t)+"'");this.dialect=u.dialects[t]}this.em_state=[],this.strong_state=[],this.debug_indent=""};function r(){return"Markdown.mk_block( "+uneval(this.toString())+", "+uneval(this.trailing)+", "+uneval(this.lineNumber)+" )"}function s(){var t=require("util");return"Markdown.mk_block( "+t.inspect(this.toString())+", "+t.inspect(this.trailing)+", "+t.inspect(this.lineNumber)+" )"}o.parse=function(t,e){return new u(e).toTree(t)},o.toHTML=function(t,e,i){var n=o.toHTMLTree(t,e,i);return o.renderJsonML(n)},o.toHTMLTree=function(t,e,i){"string"==typeof t&&(t=this.parse(t,e));var n=f(t),o={};n&&n.references&&(o=n.references);var a=function t(e,i,n){var o;n=n||{};var a=e.slice(0);"function"==typeof n.preprocessTreeNode&&(a=n.preprocessTreeNode(a,i));var r=f(a);if(r){for(o in a[1]={},r)a[1][o]=r[o];r=a[1]}if("string"==typeof a)return a;switch(a[0]){case"header":a[0]="h"+a[1].level,delete a[1].level;break;case"bulletlist":a[0]="ul";break;case"numberlist":a[0]="ol";break;case"listitem":a[0]="li";break;case"para":a[0]="p";break;case"markdown":a[0]="html",r&&delete r.references;break;case"code_block":a[0]="pre",o=r?2:1;var s=["code"];s.push.apply(s,a.splice(o,a.length-o)),a[o]=s;break;case"inlinecode":a[0]="code";break;case"img":a[1].src=a[1].href,delete a[1].href;break;case"linebreak":a[0]="br";break;case"link":a[0]="a";break;case"link_ref":a[0]="a";var l=i[r.ref];if(!l)return r.original;delete r.ref,r.href=l.href,l.title&&(r.title=l.title),delete r.original;break;case"img_ref":a[0]="img";var l=i[r.ref];if(!l)return r.original;delete r.ref,r.src=l.href,l.title&&(r.title=l.title),delete r.original}o=1;if(r){for(var c in a[1]){o=2;break}1===o&&a.splice(o,1)}for(;o<a.length;++o)a[o]=t(a[o],i,n);return a}(t,o,i);return function t(e){var i=f(e)?2:1;for(;i<e.length;)"string"==typeof e[i]?i+1<e.length&&"string"==typeof e[i+1]?e[i]+=e.splice(i+1,1)[0]:++i:(t(e[i]),++i)}(a),a};var k,C,A,S,T=u.mk_block=function(t,e,i){1==arguments.length&&(e="\n\n");var n=new String(t);return n.trailing=e,n.inspect=s,n.toSource=r,null!=i&&(n.lineNumber=i),n};function l(t){for(var e=0,i=-1;-1!==(i=t.indexOf("\n",i+1));)e++;return e}function E(t,e,i,n){if(e)t.push(["para"].concat(i));else{var o=t[t.length-1]instanceof Array&&"para"==t[t.length-1][0]?t[t.length-1]:t;n&&1<t.length&&i.unshift(n);for(var a=0;a<i.length;a++){var r=i[a];"string"==typeof r&&1<o.length&&"string"==typeof o[o.length-1]?o[o.length-1]+=r:o.push(r)}}}function _(t,e,i){var n,o=t.list,a=o[o.length-1];a[1]instanceof Array&&"para"==a[1][0]||(e+1==i.length?a.push(["para"].concat(a.splice(1,a.length-1))):(n=a.pop(),a.push(["para"].concat(a.splice(1,a.length-1)),n)))}function t(r,s){var l=r+"_state",c="strong"==r?"em_state":"strong_state";function h(t){this.len_after=t,this.name="close_"+s}return function(t,e){if(this[l][0]==s)return this[l].shift(),[t.length,new h(t.length-s.length)];var i=this[c].slice(),n=this[l].slice();this[l].unshift(s);var o=this.processInline(t.substr(s.length)),a=o[o.length-1];this[l].shift();return a instanceof h?(o.pop(),[t.length-a.len_after,[r].concat(o)]):(this[c]=i,this[l]=n,[s.length,s])}}u.prototype.split_blocks=function(t){t=t.replace(/(\r\n|\n|\r)/g,"\n");var e,i=/([\s\S]+?)($|\n#|\n(?:\s*\n|$)+)/g,n=[],o=1;for(null!=(e=/^(\s*\n)/.exec(t))&&(o+=l(e[0]),i.lastIndex=e[0].length);null!==(e=i.exec(t));)"\n#"==e[2]&&(e[2]="\n",i.lastIndex--),n.push(T(e[1],e[2],o)),o+=l(e[0]);return n},u.prototype.processBlock=function(t,e){var i=this.dialect.block,n=i.__order__;if("__call__"in i)return i.__call__.call(this,t,e);for(var o=0;o<n.length;o++){var a=i[n[o]].call(this,t,e);if(a)return(!c(a)||0<a.length&&!c(a[0]))&&this.debug(n[o],"didn't return a proper array"),a}return[]},u.prototype.processInline=function(t){return this.dialect.inline.__call__.call(this,String(t))},u.prototype.toTree=function(t,e){var i=t instanceof Array?t:this.split_blocks(t),n=this.tree;try{for(this.tree=e||this.tree||["markdown"];i.length;){var o=this.processBlock(i.shift(),i);o.length&&this.tree.push.apply(this.tree,o)}return this.tree}finally{e&&(this.tree=n)}},u.prototype.debug=function(){var t=Array.prototype.slice.call(arguments);t.unshift(this.debug_indent),"undefined"!=typeof print&&print.apply(print,t),"undefined"!=typeof console&&void 0!==console.log&&console.log.apply(null,t)},u.prototype.loop_re_over_block=function(t,e,i){for(var n,o=e.valueOf();o.length&&null!=(n=t.exec(o));)o=o.substr(n[0].length),i.call(this,n);return o},u.dialects={},u.dialects.Gruber={block:{atxHeader:function(t,e){var i=t.match(/^(#{1,6})\s*(.*?)\s*#*\s*(?:\n|$)/);if(i){var n=["header",{level:i[1].length}];return Array.prototype.push.apply(n,this.processInline(i[2])),i[0].length<t.length&&e.unshift(T(t.substr(i[0].length),t.trailing,t.lineNumber+2)),[n]}},setextHeader:function(t,e){var i=t.match(/^(.*)\n([-=])\2\2+(?:\n|$)/);if(i){var n=["header",{level:"="===i[2]?1:2},i[1]];return i[0].length<t.length&&e.unshift(T(t.substr(i[0].length),t.trailing,t.lineNumber+2)),[n]}},code:function(t,e){var i=[],n=/^(?: {0,3}\t| {4})(.*)\n?/;if(t.match(n)){t:for(;;){var o=this.loop_re_over_block(n,t.valueOf(),function(t){i.push(t[1])});if(o.length){e.unshift(T(o,t.trailing));break t}if(!e.length)break t;if(!e[0].match(n))break t;i.push(t.trailing.replace(/[^\n]/g,"").substring(2)),t=e.shift()}return[["code_block",i.join("\n")]]}},horizRule:function(t,e){var i=t.match(/^(?:([\s\S]*?)\n)?[ \t]*([-_*])(?:[ \t]*\2){2,}[ \t]*(?:\n([\s\S]*))?$/);if(i){var n=[["hr"]];return i[1]&&n.unshift.apply(n,this.processBlock(i[1],[])),i[3]&&e.unshift(T(i[3])),n}},lists:(k="[*+-]|\\d+\\.",C=/[*+-]/,A=new RegExp("^( {0,3})("+k+")[ \t]+"),S="(?: {0,3}\\t| {4})",function(t,e){if(u=t.match(A)){for(var i,n,o=[],a=w(u),r=!1,s=[o[0].list];;){for(var l=t.split(/(?=\n)/),c="",h=0;h<l.length;h++){var u,d="",f=l[h].replace(/^\n/,function(t){return d=t,""}),p=(n=o.length,new RegExp("(?:^("+S+"{0,"+n+"} {0,3})("+k+")\\s+)|(^"+S+"{0,"+(n-1)+"}[ ]{0,4})"));if(void 0!==(u=f.match(p))[1]){c.length&&(E(i,r,this.processInline(c),d),r=!1,c=""),u[1]=u[1].replace(/ {0,3}\t/g,"    ");var g=Math.floor(u[1].length/4)+1;if(g>o.length)a=w(u),i.push(a),i=a[1]=["listitem"];else{for(var v=!1,m=0;m<o.length;m++)if(o[m].indent==u[1]){a=o[m].list,o.splice(m+1,o.length-(m+1)),v=!0;break}v||(++g<=o.length?(o.splice(g,o.length-g),a=o[g-1].list):(a=w(u),i.push(a))),i=["listitem"],a.push(i)}d=""}f.length>u[0].length&&(c+=d+f.substr(u[0].length))}c.length&&(E(i,r,this.processInline(c),d),r=!1,c="");var b=function(t,e){for(var i=new RegExp("^("+S+"{"+t+"}.*?\\n?)*$"),n=new RegExp("^"+S+"{"+t+"}","gm"),o=[];0<e.length&&i.exec(e[0]);){var a=e.shift(),r=a.replace(n,"");o.push(T(r,a.trailing,a.lineNumber))}return o}(o.length,e);0<b.length&&(O(o,_,this),i.push.apply(i,this.toTree(b,[])));var y=e[0]&&e[0].valueOf()||"";if(!y.match(A)&&!y.match(/^ /))break;t=e.shift();var x=this.dialect.block.horizRule(t,e);if(x){s.push.apply(s,x);break}O(o,_,this),r=!0}return s}function w(t){var e=C.exec(t[2])?["bulletlist"]:["numberlist"];return o.push({list:e,indent:t[1]}),e}}),blockquote:function(t,e){if(t.match(/^>/m)){var i=[];if(">"!=t[0]){for(var n=t.split(/\n/),o=[],a=t.lineNumber;n.length&&">"!=n[0][0];)o.push(n.shift()),a++;var r=T(o.join("\n"),"\n",t.lineNumber);i.push.apply(i,this.processBlock(r,[])),t=T(n.join("\n"),t.trailing,a)}for(;e.length&&">"==e[0][0];){var s=e.shift();t=T(t+t.trailing+s,s.trailing,t.lineNumber)}var l=t.replace(/^> ?/gm,""),c=(this.tree,this.toTree(l,["blockquote"])),h=f(c);return h&&h.references&&(delete h.references,d(h)&&c.splice(1,1)),i.push(c),i}},referenceDefn:function(t,e){var i=/^\s*\[(.*?)\]:\s*(\S+)(?:\s+(?:(['"])(.*?)\3|\((.*?)\)))?\n?/;if(t.match(i)){f(this.tree)||this.tree.splice(1,0,{});var n=f(this.tree);void 0===n.references&&(n.references={});var o=this.loop_re_over_block(i,t,function(t){t[2]&&"<"==t[2][0]&&">"==t[2][t[2].length-1]&&(t[2]=t[2].substring(1,t[2].length-1));var e=n.references[t[1].toLowerCase()]={href:t[2]};void 0!==t[4]?e.title=t[4]:void 0!==t[5]&&(e.title=t[5])});return o.length&&e.unshift(T(o,t.trailing)),[]}},para:function(t){return[["para"].concat(this.processInline(t))]}}},u.dialects.Gruber.inline={__oneElement__:function(t,e,i){var n,o;return e=e||this.dialect.inline.__patterns__,(n=new RegExp("([\\s\\S]*?)("+(e.source||e)+")").exec(t))?n[1]?[n[1].length,n[1]]:(n[2]in this.dialect.inline&&(o=this.dialect.inline[n[2]].call(this,t.substr(n.index),n,i||[])),o=o||[n[2].length,n[2]]):[t.length,t]},__call__:function(t,e){var i,n=[];function o(t){"string"==typeof t&&"string"==typeof n[n.length-1]?n[n.length-1]+=t:n.push(t)}for(;0<t.length;)i=this.dialect.inline.__oneElement__.call(this,t,e,n),t=t.substr(i.shift()),O(i,o);return n},"]":function(){},"}":function(){},__escape__:/^\\[\\`\*_{}\[\]()#\+.!\-]/,"\\":function(t){return this.dialect.inline.__escape__.exec(t)?[2,t.charAt(1)]:[1,"\\"]},"![":function(t){var e=t.match(/^!\[(.*?)\][ \t]*\([ \t]*([^")]*?)(?:[ \t]+(["'])(.*?)\3)?[ \t]*\)/);if(e){e[2]&&"<"==e[2][0]&&">"==e[2][e[2].length-1]&&(e[2]=e[2].substring(1,e[2].length-1)),e[2]=this.dialect.inline.__call__.call(this,e[2],/\\/)[0];var i={alt:e[1],href:e[2]||""};return void 0!==e[4]&&(i.title=e[4]),[e[0].length,["img",i]]}return(e=t.match(/^!\[(.*?)\][ \t]*\[(.*?)\]/))?[e[0].length,["img_ref",{alt:e[1],ref:e[2].toLowerCase(),original:e[0]}]]:[2,"!["]},"[":function(t){var e=String(t),i=u.DialectHelpers.inline_until_char.call(this,t.substr(1),"]");if(!i)return[1,"["];var n,o,a=1+i[0],r=i[1],s=(t=t.substr(a)).match(/^\s*\([ \t]*([^"']*)(?:[ \t]+(["'])(.*?)\2)?[ \t]*\)/);if(s){var l=s[1];if(a+=s[0].length,l&&"<"==l[0]&&">"==l[l.length-1]&&(l=l.substring(1,l.length-1)),!s[3])for(var c=1,h=0;h<l.length;h++)switch(l[h]){case"(":c++;break;case")":0==--c&&(a-=l.length-h,l=l.substring(0,h))}return o={href:(l=this.dialect.inline.__call__.call(this,l,/\\/)[0])||""},void 0!==s[3]&&(o.title=s[3]),n=["link",o].concat(r),[a,n]}return(s=t.match(/^\s*\[(.*?)\]/))?(a+=s[0].length,n=["link_ref",o={ref:(s[1]||String(r)).toLowerCase(),original:e.substr(0,a)}].concat(r),[a,n]):1==r.length&&"string"==typeof r[0]?(n=["link_ref",o={ref:r[0].toLowerCase(),original:e.substr(0,a)},r[0]],[a,n]):[1,"["]},"<":function(t){var e;return null!=(e=t.match(/^<(?:((https?|ftp|mailto):[^>]+)|(.*?@.*?\.[a-zA-Z]+))>/))?e[3]?[e[0].length,["link",{href:"mailto:"+e[3]},e[3]]]:"mailto"==e[2]?[e[0].length,["link",{href:e[1]},e[1].substr("mailto:".length)]]:[e[0].length,["link",{href:e[1]},e[1]]]:[1,"<"]},"`":function(t){var e=t.match(/(`+)(([\s\S]*?)\1)/);return e&&e[2]?[e[1].length+e[2].length,["inlinecode",e[3]]]:[1,"`"]},"  \n":function(){return[3,["linebreak"]]}},u.dialects.Gruber.inline["**"]=t("strong","**"),u.dialects.Gruber.inline.__=t("strong","__"),u.dialects.Gruber.inline["*"]=t("em","*"),u.dialects.Gruber.inline._=t("em","_"),u.buildBlockOrder=function(t){var e=[];for(var i in t)"__order__"!=i&&"__call__"!=i&&e.push(i);t.__order__=e},u.buildInlinePatterns=function(t){var e,i=[];for(var n in t){n.match(/^__.*__$/)||(e=n.replace(/([\\.*+?|()\[\]{}])/g,"\\$1").replace(/\n/,"\\n"),i.push(1==n.length?e:"(?:"+e+")"))}i=i.join("|"),t.__patterns__=i;var o=t.__call__;t.__call__=function(t,e){return null!=e?o.call(this,t,e):o.call(this,t,i)}},u.DialectHelpers={},u.DialectHelpers.inline_until_char=function(t,e){for(var i=0,n=[];;){if(t.charAt(i)==e)return[++i,n];if(i>=t.length)return null;var o=this.dialect.inline.__oneElement__.call(this,t.substr(i));i+=o[0],n.push.apply(n,o.slice(1))}},u.subclassDialect=function(t){function e(){}function i(){}return e.prototype=t.block,i.prototype=t.inline,{block:new e,inline:new i}},u.buildBlockOrder(u.dialects.Gruber.block),u.buildInlinePatterns(u.dialects.Gruber.inline),u.dialects.Maruku=u.subclassDialect(u.dialects.Gruber),u.dialects.Maruku.processMetaHash=function(t){for(var e,i=function(t){var e=t.split(""),i=[""],n=!1;for(;e.length;){var o=e.shift();switch(o){case" ":n?i[i.length-1]+=o:i.push("");break;case"'":case'"':n=!n;break;case"\\":o=e.shift();default:i[i.length-1]+=o}}return i}(t),n={},o=0;o<i.length;++o){/^#/.test(i[o])?n.id=i[o].substring(1):/^\./.test(i[o])?n.class?n.class=n.class+i[o].replace(/./," "):n.class=i[o].substring(1):/\=/.test(i[o])&&(n[(e=i[o].split(/\=/))[0]]=e[1])}return n},u.dialects.Maruku.block.document_meta=function(t){if(!(1<t.lineNumber)&&t.match(/^(?:\w+:.*\n)*\w+:.*$/)){f(this.tree)||this.tree.splice(1,0,{});var e=t.split(/\n/);for(p in e){var i=e[p].match(/(\w+):\s*(.*)$/),n=i[1].toLowerCase(),o=i[2];this.tree[1][n]=o}return[]}},u.dialects.Maruku.block.block_meta=function(t){var e=t.match(/(^|\n) {0,3}\{:\s*((?:\\\}|[^\}])*)\s*\}$/);if(e){var i=this.dialect.processMetaHash(e[2]);if(""===e[1]){var n=this.tree[this.tree.length-1],o=f(n);if("string"==typeof n)return;for(a in o||(o={},n.splice(1,0,o)),i)o[a]=i[a];return[]}var r=t.replace(/\n.*$/,""),s=this.processBlock(r,[]);for(a in(o=f(s[0]))||(o={},s[0].splice(1,0,o)),i)o[a]=i[a];return s}},u.dialects.Maruku.block.definition_list=function(t,e){var i=/^((?:[^\s:].*\n)+):\s+([\s\S]+)$/,n=["dl"];if(r=t.match(i)){for(var o=[t];e.length&&i.exec(e[0]);)o.push(e.shift());for(var a=0;a<o.length;++a){for(var r,s=(r=o[a].match(i))[1].replace(/\n$/,"").split(/\n/),l=r[2].split(/\n:\s+/),c=0;c<s.length;++c)n.push(["dt",s[c]]);for(c=0;c<l.length;++c)n.push(["dd"].concat(this.processInline(l[c].replace(/(\n)\s+/,"$1"))))}return[n]}},u.dialects.Maruku.block.table=function(t,e){function i(t,e){(e=e||"\\s").match(/^[\\|\[\]{}?*.+^$]$/)&&(e="\\"+e);for(var i,n=[],o=new RegExp("^((?:\\\\.|[^\\\\"+e+"])*)"+e+"(.*)");i=t.match(o);)n.push(i[1]),t=i[2];return n.push(t),n}var n,o;if(o=t.match(/^ {0,3}\|(.+)\n {0,3}\|\s*([\-:]+[\-| :]*)\n((?:\s*\|.*(?:\n|$))*)(?=\n|$)/))o[3]=o[3].replace(/^\s*\|/gm,"");else if(!(o=t.match(/^ {0,3}(\S(?:\\.|[^\\|])*\|.*)\n {0,3}([\-:]+\s*\|[\-| :]*)\n((?:(?:\\.|[^\\|])*\|.*(?:\n|$))*)(?=\n|$)/)))return;var a=["table",["thead",["tr"]],["tbody"]];o[2]=o[2].replace(/\|\s*$/,"").split("|");var r=[];for(O(o[2],function(t){t.match(/^\s*-+:\s*$/)?r.push({align:"right"}):t.match(/^\s*:-+\s*$/)?r.push({align:"left"}):t.match(/^\s*:-+:\s*$/)?r.push({align:"center"}):r.push({})}),o[1]=i(o[1].replace(/\|\s*$/,""),"|"),n=0;n<o[1].length;n++)a[1][1].push(["th",r[n]||{}].concat(this.processInline(o[1][n].trim())));return O(o[3].replace(/\|\s*$/gm,"").split("\n"),function(t){var e=["tr"];for(t=i(t,"|"),n=0;n<t.length;n++)e.push(["td",r[n]||{}].concat(this.processInline(t[n].trim())));a[2].push(e)},this),[a]},u.dialects.Maruku.inline["{:"]=function(t,e,i){if(!i.length)return[2,"{:"];var n=i[i.length-1];if("string"==typeof n)return[2,"{:"];var o=t.match(/^\{:\s*((?:\\\}|[^\}])*)\s*\}/);if(!o)return[2,"{:"];var a=this.dialect.processMetaHash(o[1]),r=f(n);for(var s in r||(r={},n.splice(1,0,r)),a)r[s]=a[s];return[o[0].length,""]},u.dialects.Maruku.inline.__escape__=/^\\[\\`\*_{}\[\]()#\+.!\-|:]/,u.buildBlockOrder(u.dialects.Maruku.block),u.buildInlinePatterns(u.dialects.Maruku.inline);var c=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},O=Array.prototype.forEach?function(t,e,i){return t.forEach(e,i)}:function(t,e,i){for(var n=0;n<t.length;n++)e.call(i||t,t[n],n,t)},d=function(t){for(var e in t)if(hasOwnProperty.call(t,e))return!1;return!0};function f(t){return c(t)&&1<t.length&&"object"===_typeof2(t[1])&&!c(t[1])?t[1]:void 0}function h(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function g(t){if("string"==typeof t)return h(t);var e=t.shift(),i={},n=[];for(!t.length||"object"!==_typeof2(t[0])||t[0]instanceof Array||(i=t.shift());t.length;)n.push(g(t.shift()));var o="";for(var a in i)o+=" "+a+'="'+h(i[a])+'"';return"img"==e||"br"==e||"hr"==e?"<"+e+o+"/>":"<"+e+o+">"+n.join("")+"</"+e+">"}o.renderJsonML=function(t,e){(e=e||{}).root=e.root||!1;var i=[];if(e.root)i.push(g(t));else for(t.shift(),!t.length||"object"!==_typeof2(t[0])||t[0]instanceof Array||t.shift();t.length;)i.push(g(t.shift()));return i.join("\n\n")}}("undefined"==typeof exports?(window.markdown={},window.markdown):exports),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof2(exports))?t(require("jquery")):t(jQuery)}(function(w){function o(i,n){w.each(["autofocus","savable","hideable","width","height","resize","iconlibrary","language","footer","fullscreen","hiddenButtons","disabledButtons"],function(t,e){void 0!==w(i).data(e)&&((n="object"==_typeof2(n)?n:{})[e]=w(i).data(e))}),this.$ns="bootstrap-markdown",this.$element=w(i),this.$editable={el:null,type:null,attrKeys:[],attrValues:[],content:null},this.$options=w.extend(!0,{},w.fn.markdown.defaults,n,this.$element.data("options")),this.$oldContent=null,this.$isPreview=!1,this.$isFullscreen=!1,this.$editor=null,this.$textarea=null,this.$handler=[],this.$callback=[],this.$nextTab=[],this.showEditor()}o.prototype={constructor:o,__alterButtons:function(i,n){var t=this.$handler,o="all"==i,a=this;w.each(t,function(t,e){!1===(!o&&e.indexOf(i)<0)&&n(a.$editor.find('button[data-handler="'+e+'"]'))})},__buildButtons:function(t,e){for(var i=this.$ns,n=this.$handler,o=this.$callback,a=0;a<t.length;a++)for(var r=t[a],s=0;s<r.length;s++){for(var l=r[s].data,c=w("<div/>",{class:"btn-group"}),h=0;h<l.length;h++){var u,d=l[h],f=i+"-"+d.name,p=this.__getIcon(d.icon),g=d.btnText?d.btnText:"",v=d.btnClass?d.btnClass:"btn",m=d.tabIndex?d.tabIndex:"-1",b=void 0!==d.hotkey?d.hotkey:"",y=void 0!==jQuery.hotkeys&&""!==b?" ("+b+")":"",x=w("<button></button>");x.text(" "+this.__localize(g)).addClass("btn-default btn-sm").addClass(v),v.match(/btn\-(primary|success|info|warning|danger|link)/)&&x.removeClass("btn-default"),x.attr({type:"button",title:this.__localize(d.title)+y,tabindex:m,"data-provider":i,"data-handler":f,"data-hotkey":b}),!0===d.toggle&&x.attr("data-toggle","button"),(u=w("<span/>")).addClass(p),u.prependTo(x),c.append(x),n.push(f),o.push(d.callback)}e.append(c)}return e},__setListener:function(){var t=void 0!==this.$textarea.attr("rows"),e=5<this.$textarea.val().split("\n").length?this.$textarea.val().split("\n").length:"5",i=t?this.$textarea.attr("rows"):e;this.$textarea.attr("rows",i),this.$options.resize&&this.$textarea.css("resize",this.$options.resize),this.$textarea.on({focus:w.proxy(this.focus,this),keyup:w.proxy(this.keyup,this),change:w.proxy(this.change,this),select:w.proxy(this.select,this)}),this.eventSupported("keydown")&&this.$textarea.on("keydown",w.proxy(this.keydown,this)),this.eventSupported("keypress")&&this.$textarea.on("keypress",w.proxy(this.keypress,this)),this.$textarea.data("markdown",this)},__handle:function(t){var e=w(t.currentTarget),i=this.$handler,n=this.$callback,o=e.attr("data-handler"),a=n[i.indexOf(o)];w(t.currentTarget).focus(),a(this),this.change(this),o.indexOf("cmdSave")<0&&this.$textarea.focus(),t.preventDefault()},__localize:function(t){var e=w.fn.markdown.messages,i=this.$options.language;return void 0!==e&&void 0!==e[i]&&void 0!==e[i][t]?e[i][t]:t},__getIcon:function(t){return"object"==_typeof2(t)?t[this.$options.iconlibrary]:t},setFullscreen:function(t){var e=this.$editor,i=this.$textarea;!0===t?(e.addClass("md-fullscreen-mode"),w("body").addClass("md-nooverflow"),this.$options.onFullscreen(this)):(e.removeClass("md-fullscreen-mode"),w("body").removeClass("md-nooverflow"),1==this.$isPreview&&this.hidePreview().showPreview()),this.$isFullscreen=t,i.focus()},showEditor:function(){var t,n,e,i,o,a,r,s,l,c=this,h=this.$ns,u=this.$element,d=(u.css("height"),u.css("width"),this.$editable),f=this.$handler,p=this.$callback,g=this.$options,v=w("<div/>",{class:"md-editor",click:function(){c.focus()}});return null===this.$editor?(t=w("<div/>",{class:"md-header btn-toolbar"}),n=[],0<g.buttons.length&&(n=n.concat(g.buttons[0])),0<g.additionalButtons.length&&w.each(g.additionalButtons[0],function(t,i){var e=w.grep(n,function(t,e){return t.name===i.name});0<e.length?e[0].data=e[0].data.concat(i.data):n.push(g.additionalButtons[0][t])}),0<g.reorderButtonGroups.length&&(n=n.filter(function(t){return-1<g.reorderButtonGroups.indexOf(t.name)}).sort(function(t,e){return g.reorderButtonGroups.indexOf(t.name)<g.reorderButtonGroups.indexOf(e.name)?-1:g.reorderButtonGroups.indexOf(t.name)>g.reorderButtonGroups.indexOf(e.name)?1:0})),0<n.length&&(t=this.__buildButtons([n],t)),g.fullscreen.enable&&t.append('<div class="md-controls"><a class="md-control md-control-fullscreen" href="#"><span class="'+this.__getIcon(g.fullscreen.icons.fullscreenOn)+'"></span></a></div>').on("click",".md-control-fullscreen",function(t){t.preventDefault(),c.setFullscreen(!0)}),v.append(t),u.is("textarea")?(u.before(v),(o=u).addClass("md-input"),v.append(o)):(e="function"==typeof toMarkdown?toMarkdown(u.html()):u.html(),i=w.trim(e),o=w("<textarea/>",{class:"md-input",val:i}),v.append(o),d.el=u,d.type=u.prop("tagName").toLowerCase(),d.content=u.html(),w(u[0].attributes).each(function(){d.attrKeys.push(this.nodeName),d.attrValues.push(this.nodeValue)}),u.replaceWith(v)),a=w("<div/>",{class:"md-footer"}),r=!1,g.savable&&(r=!0,f.push("cmdSave"),p.push(g.onSave),a.append('<button class="btn btn-success" data-provider="'+h+'" data-handler="cmdSave"><i class="icon icon-white icon-ok"></i> '+this.__localize("Save")+"</button>")),s="function"==typeof g.footer?g.footer(this):g.footer,""!==w.trim(s)&&(r=!0,a.append(s)),r&&v.append(a),g.width&&"inherit"!==g.width&&(jQuery.isNumeric(g.width)?(v.css("display","table"),o.css("width",g.width+"px")):v.addClass(g.width)),g.height&&"inherit"!==g.height&&(jQuery.isNumeric(g.height)?(l=g.height,t&&(l=Math.max(0,l-t.outerHeight())),a&&(l=Math.max(0,l-a.outerHeight())),o.css("height",l+"px")):v.addClass(g.height)),this.$editor=v,this.$textarea=o,this.$editable=d,this.$oldContent=this.getContent(),this.__setListener(),this.$editor.attr("id",(new Date).getTime()),this.$editor.on("click",'[data-provider="bootstrap-markdown"]',w.proxy(this.__handle,this)),(this.$element.is(":disabled")||this.$element.is("[readonly]"))&&(this.$editor.addClass("md-editor-disabled"),this.disableButtons("all")),this.eventSupported("keydown")&&"object"===_typeof2(jQuery.hotkeys)&&t.find('[data-provider="bootstrap-markdown"]').each(function(){var t=w(this),e=t.attr("data-hotkey");""!==e.toLowerCase()&&o.bind("keydown",e,function(){return t.trigger("click"),!1})}),"preview"===g.initialstate?this.showPreview():"fullscreen"===g.initialstate&&g.fullscreen.enable&&this.setFullscreen(!0)):this.$editor.show(),g.autofocus&&(this.$textarea.focus(),this.$editor.addClass("active")),g.fullscreen.enable&&!1!==g.fullscreen&&(this.$editor.append('<div class="md-fullscreen-controls"><a href="#" class="exit-fullscreen" title="Exit fullscreen"><span class="'+this.__getIcon(g.fullscreen.icons.fullscreenOff)+'"></span></a></div>'),this.$editor.on("click",".exit-fullscreen",function(t){t.preventDefault(),c.setFullscreen(!1)})),this.hideButtons(g.hiddenButtons),this.disableButtons(g.disabledButtons),g.onShow(this),this},parseContent:function(t){var t=t||this.$textarea.val(),e=this.$options.parser?this.$options.parser(t):"object"==("undefined"==typeof markdown?"undefined":_typeof2(markdown))?markdown.toHTML(t):"function"==typeof marked?marked(t):t;return e},showPreview:function(){var t,e,i=this.$options,n=this.$textarea,o=n.next(),a=w("<div/>",{class:"md-preview","data-provider":"markdown-preview"});return 1==this.$isPreview||(this.$isPreview=!0,this.disableButtons("all").enableButtons("cmdPreview"),t="string"==typeof(e=i.onPreview(this))?e:this.parseContent(),a.html(t),o&&"md-footer"==o.attr("class")?a.insertBefore(o):n.parent().append(a),a.css({width:n.outerWidth()+"px",height:n.outerHeight()+"px"}),this.$options.resize&&a.css("resize",this.$options.resize),n.hide(),a.data("markdown",this),(this.$element.is(":disabled")||this.$element.is("[readonly]"))&&(this.$editor.addClass("md-editor-disabled"),this.disableButtons("all"))),this},hidePreview:function(){return this.$isPreview=!1,this.$editor.find('div[data-provider="markdown-preview"]').remove(),this.enableButtons("all"),this.disableButtons(this.$options.disabledButtons),this.$textarea.show(),this.__setListener(),this},isDirty:function(){return this.$oldContent!=this.getContent()},getContent:function(){return this.$textarea.val()},setContent:function(t){return this.$textarea.val(t),this},findSelection:function(t){var e;if(0<=(e=this.getContent().indexOf(t))&&0<t.length){var i,n=this.getSelection();return this.setSelection(e,e+t.length),i=this.getSelection(),this.setSelection(n.start,n.end),i}return null},getSelection:function(){var e=this.$textarea[0];return("selectionStart"in e?function(){var t=e.selectionEnd-e.selectionStart;return{start:e.selectionStart,end:e.selectionEnd,length:t,text:e.value.substr(e.selectionStart,t)}}:function(){return null})()},setSelection:function(t,e){var i=this.$textarea[0];return("selectionStart"in i?function(){i.selectionStart=t,i.selectionEnd=e}:function(){return null})()},replaceSelection:function(t){var e=this.$textarea[0];return("selectionStart"in e?function(){return e.value=e.value.substr(0,e.selectionStart)+t+e.value.substr(e.selectionEnd,e.value.length),e.selectionStart=e.value.length,this}:function(){return e.value+=t,jQuery(e)})()},getNextTab:function(){if(0===this.$nextTab.length)return null;var t,e=this.$nextTab.shift();return"function"==typeof e?t=e():"object"==_typeof2(e)&&0<e.length&&(t=e),t},setNextTab:function(t,e){var i,n;"string"==typeof t?(i=this).$nextTab.push(function(){return i.findSelection(t)}):"number"==typeof t&&"number"==typeof e&&(n=this.getSelection(),this.setSelection(t,e),this.$nextTab.push(this.getSelection()),this.setSelection(n.start,n.end))},__parseButtonNameParam:function(t){return"string"==typeof t?t.split(" "):t},enableButtons:function(t){var i=this.__parseButtonNameParam(t),n=this;return w.each(i,function(t,e){n.__alterButtons(i[t],function(t){t.removeAttr("disabled")})}),this},disableButtons:function(t){var i=this.__parseButtonNameParam(t),n=this;return w.each(i,function(t,e){n.__alterButtons(i[t],function(t){t.attr("disabled","disabled")})}),this},hideButtons:function(t){var i=this.__parseButtonNameParam(t),n=this;return w.each(i,function(t,e){n.__alterButtons(i[t],function(t){t.addClass("hidden")})}),this},showButtons:function(t){var i=this.__parseButtonNameParam(t),n=this;return w.each(i,function(t,e){n.__alterButtons(i[t],function(t){t.removeClass("hidden")})}),this},eventSupported:function(t){var e=t in this.$element;return e||(this.$element.setAttribute(t,"return;"),e="function"==typeof this.$element[t]),e},keyup:function(t){var e,i,n,o=!1;switch(t.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:o=null!==(e=this.getNextTab())?(i=this,setTimeout(function(){i.setSelection(e.start,e.end)},500),!0):((n=this.getSelection()).start!=n.end||n.end!=this.getContent().length)&&(this.setSelection(this.getContent().length,this.getContent().length),!0);break;case 13:o=!1;break;case 27:this.$isFullscreen&&this.setFullscreen(!1),o=!1;break;default:o=!1}o&&(t.stopPropagation(),t.preventDefault()),this.$options.onChange(this)},change:function(){return this.$options.onChange(this),this},select:function(){return this.$options.onSelect(this),this},focus:function(){var t=this.$options,e=(t.hideable,this.$editor);return e.addClass("active"),w(document).find(".md-editor").each(function(){var t;w(this).attr("id")!==e.attr("id")&&(null===(t=w(this).find("textarea").data("markdown"))&&(t=w(this).find('div[data-provider="markdown-preview"]').data("markdown")),t&&t.blur())}),t.onFocus(this),this},blur:function(){var i,t,e,n=this.$options,o=n.hideable,a=this.$editor,r=this.$editable;return!a.hasClass("active")&&0!==this.$element.parent().length||(a.removeClass("active"),o&&(null!==r.el?(i=w("<"+r.type+"/>"),t=this.getContent(),e=this.parseContent(t),w(r.attrKeys).each(function(t,e){i.attr(r.attrKeys[t],r.attrValues[t])}),i.html(e),a.replaceWith(i)):a.hide()),n.onBlur(this)),this}};var t=w.fn.markdown;w.fn.markdown=function(n){return this.each(function(){var t=w(this),e=t.data("markdown"),i="object"==_typeof2(n)&&n;e||t.data("markdown",e=new o(this,i))})},w.fn.markdown.messages={},w.fn.markdown.defaults={autofocus:!1,hideable:!1,savable:!1,width:"inherit",height:"inherit",resize:"none",iconlibrary:"glyph",language:"en",initialstate:"editor",parser:null,buttons:[[{name:"groupFont",data:[{name:"cmdBold",hotkey:"Ctrl+B",title:"Bold",icon:{glyph:"glyphicon glyphicon-bold",fa:"fa fa-bold","fa-3":"icon-bold"},callback:function(t){var e=t.getSelection(),i=t.getContent(),n=0===e.length?t.__localize("strong text"):e.text,o="**"===i.substr(e.start-2,2)&&"**"===i.substr(e.end,2)?(t.setSelection(e.start-2,e.end+2),t.replaceSelection(n),e.start-2):(t.replaceSelection("**"+n+"**"),e.start+2);t.setSelection(o,o+n.length)}},{name:"cmdItalic",title:"Italic",hotkey:"Ctrl+I",icon:{glyph:"glyphicon glyphicon-italic",fa:"fa fa-italic","fa-3":"icon-italic"},callback:function(t){var e=t.getSelection(),i=t.getContent(),n=0===e.length?t.__localize("emphasized text"):e.text,o="_"===i.substr(e.start-1,1)&&"_"===i.substr(e.end,1)?(t.setSelection(e.start-1,e.end+1),t.replaceSelection(n),e.start-1):(t.replaceSelection("_"+n+"_"),e.start+1);t.setSelection(o,o+n.length)}},{name:"cmdHeading",title:"Heading",hotkey:"Ctrl+H",icon:{glyph:"glyphicon glyphicon-header",fa:"fa fa-header","fa-3":"icon-font"},callback:function(t){var e,i=t.getSelection(),n=t.getContent(),o=0===i.length?t.__localize("heading text"):i.text+"\n",a=4,r="### "===n.substr(i.start-a,a)||(a=3,"###"===n.substr(i.start-a,a))?(t.setSelection(i.start-a,i.end),t.replaceSelection(o),i.start-a):0<i.start&&((e=n.substr(i.start-1,1))&&"\n"!=e)?(t.replaceSelection("\n\n### "+o),i.start+6):(t.replaceSelection("### "+o),i.start+4);t.setSelection(r,r+o.length)}}]},{name:"groupLink",data:[{name:"cmdUrl",title:"URL/Link",hotkey:"Ctrl+L",icon:{glyph:"glyphicon glyphicon-link",fa:"fa fa-link","fa-3":"icon-link"},callback:function(t){var e,i,n=t.getSelection(),o=(t.getContent(),0===n.length?t.__localize("enter link description here"):n.text),a=prompt(t.__localize("Insert Hyperlink"),"http://"),r=new RegExp("^((http|https)://|(mailto:)|(//))[a-z0-9]","i");null!==a&&""!==a&&"http://"!==a&&r.test(a)&&(i=w("<div>"+a+"</div>").text(),t.replaceSelection("["+o+"]("+i+")"),e=n.start+1,t.setSelection(e,e+o.length))}},{name:"cmdImage",title:"Image",hotkey:"Ctrl+G",icon:{glyph:"glyphicon glyphicon-picture",fa:"fa fa-picture-o","fa-3":"icon-picture"},callback:function(t){var e,i,n=t.getSelection(),o=(t.getContent(),0===n.length?t.__localize("enter image description here"):n.text),a=prompt(t.__localize("Insert Image Hyperlink"),"http://"),r=new RegExp("^((http|https)://|(//))[a-z0-9]","i");null!==a&&""!==a&&"http://"!==a&&r.test(a)&&(i=w("<div>"+a+"</div>").text(),t.replaceSelection("!["+o+"]("+i+' "'+t.__localize("enter image title here")+'")'),e=n.start+2,t.setNextTab(t.__localize("enter image title here")),t.setSelection(e,e+o.length))}}]},{name:"groupMisc",data:[{name:"cmdList",hotkey:"Ctrl+U",title:"Unordered List",icon:{glyph:"glyphicon glyphicon-list",fa:"fa fa-list","fa-3":"icon-list-ul"},callback:function(t){var i,e,n,o=t.getSelection();t.getContent();n=0===o.length?(e=t.__localize("list text here"),t.replaceSelection("- "+e),o.start+2):o.text.indexOf("\n")<0?(e=o.text,t.replaceSelection("- "+e),o.start+2):(i=[],e=(i=o.text.split("\n"))[0],w.each(i,function(t,e){i[t]="- "+e}),t.replaceSelection("\n\n"+i.join("\n")),o.start+4),t.setSelection(n,n+e.length)}},{name:"cmdListO",hotkey:"Ctrl+O",title:"Ordered List",icon:{glyph:"glyphicon glyphicon-th-list",fa:"fa fa-list-ol","fa-3":"icon-list-ol"},callback:function(t){var i,e,n,o=t.getSelection();t.getContent();n=0===o.length?(e=t.__localize("list text here"),t.replaceSelection("1. "+e),o.start+3):o.text.indexOf("\n")<0?(e=o.text,t.replaceSelection("1. "+e),o.start+3):(i=[],e=(i=o.text.split("\n"))[0],w.each(i,function(t,e){i[t]="1. "+e}),t.replaceSelection("\n\n"+i.join("\n")),o.start+5),t.setSelection(n,n+e.length)}},{name:"cmdCode",hotkey:"Ctrl+K",title:"Code",icon:{glyph:"glyphicon glyphicon-asterisk",fa:"fa fa-code","fa-3":"icon-code"},callback:function(t){var e=t.getSelection(),i=t.getContent(),n=0===e.length?t.__localize("code text here"):e.text,o="```\n"===i.substr(e.start-4,4)&&"\n```"===i.substr(e.end,4)?(t.setSelection(e.start-4,e.end+4),t.replaceSelection(n),e.start-4):"`"===i.substr(e.start-1,1)&&"`"===i.substr(e.end,1)?(t.setSelection(e.start-1,e.end+1),t.replaceSelection(n),e.start-1):-1<i.indexOf("\n")?(t.replaceSelection("```\n"+n+"\n```"),e.start+4):(t.replaceSelection("`"+n+"`"),e.start+1);t.setSelection(o,o+n.length)}},{name:"cmdQuote",hotkey:"Ctrl+Q",title:"Quote",icon:{glyph:"glyphicon glyphicon-comment",fa:"fa fa-quote-left","fa-3":"icon-quote-left"},callback:function(t){var i,e,n,o=t.getSelection();t.getContent();n=0===o.length?(e=t.__localize("quote here"),t.replaceSelection("> "+e),o.start+2):o.text.indexOf("\n")<0?(e=o.text,t.replaceSelection("> "+e),o.start+2):(i=[],e=(i=o.text.split("\n"))[0],w.each(i,function(t,e){i[t]="> "+e}),t.replaceSelection("\n\n"+i.join("\n")),o.start+4),t.setSelection(n,n+e.length)}}]},{name:"groupUtil",data:[{name:"cmdPreview",toggle:!0,hotkey:"Ctrl+P",title:"Preview",btnText:"Preview",btnClass:"btn btn-primary btn-sm",icon:{glyph:"glyphicon glyphicon-search",fa:"fa fa-search","fa-3":"icon-search"},callback:function(t){!1===t.$isPreview?t.showPreview():t.hidePreview()}}]}]],additionalButtons:[],reorderButtonGroups:[],hiddenButtons:[],disabledButtons:[],footer:"",fullscreen:{enable:!0,icons:{fullscreenOn:{fa:"fa fa-expand",glyph:"glyphicon glyphicon-fullscreen","fa-3":"icon-resize-full"},fullscreenOff:{fa:"fa fa-compress",glyph:"glyphicon glyphicon-fullscreen","fa-3":"icon-resize-small"}}},onShow:function(){},onPreview:function(){},onSave:function(){},onBlur:function(){},onFocus:function(){},onChange:function(){},onFullscreen:function(){},onSelect:function(){}},w.fn.markdown.Constructor=o,w.fn.markdown.noConflict=function(){return w.fn.markdown=t,this};function e(t){var e=t;e.data("markdown")?e.data("markdown").showEditor():e.markdown()}w(document).on("click.markdown.data-api",'[data-provide="markdown-editable"]',function(t){e(w(this)),t.preventDefault()}).on("click focusin",function(t){var n;n=w(document.activeElement),w(document).find(".md-editor").each(function(){var t=w(this),e=n.closest(".md-editor")[0]===this,i=t.find("textarea").data("markdown")||t.find('div[data-provider="markdown-preview"]').data("markdown");i&&!e&&i.blur()})}).ready(function(){w('textarea[data-provide="markdown"]').each(function(){e(w(this))})})}),$.fn.markdown.defaults.iconlibrary="fa",$.fn.markdown.defaults.buttons[0][0].data[2].icon.fa="fa fa-heading",$.fn.markdown.defaults.buttons[0][1].data[1].icon.fa="fa fa-image",$.fn.markdown.defaults.buttons[0][2].data[1].icon.fa="fa fa-list-ol",function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==("undefined"==typeof exports?"undefined":_typeof2(exports))?require("jquery"):jQuery)}(function(a){function i(t,e,i){e={content:{message:"object"==_typeof2(e)?e.message:e,title:e.title?e.title:"",icon:e.icon?e.icon:"",url:e.url?e.url:"#",target:e.target?e.target:"-"}};i=a.extend(!0,{},e,i),this.settings=a.extend(!0,{},n,i),this._defaults=n,"-"==this.settings.content.target&&(this.settings.content.target=this.settings.url_target),this.animations={start:"webkitAnimationStart oanimationstart MSAnimationStart animationstart",end:"webkitAnimationEnd oanimationend MSAnimationEnd animationend"},"number"==typeof this.settings.offset&&(this.settings.offset={x:this.settings.offset,y:this.settings.offset}),this.init()}var n={element:"body",position:null,type:"info",allow_dismiss:!0,newest_on_top:!1,showProgressbar:!1,placement:{from:"top",align:"right"},offset:20,spacing:10,z_index:1031,delay:5e3,timer:1e3,url_target:"_blank",mouse_over:null,animate:{enter:"animated fadeInDown",exit:"animated fadeOutUp"},onShow:null,onShown:null,onClose:null,onClosed:null,icon_type:"class",template:'<div data-notify="container" class="col-xs-11 col-sm-4 alert alert-{0}" role="alert"><button type="button" aria-hidden="true" class="close" data-notify="dismiss">&times;</button><span data-notify="icon"></span> <span data-notify="title">{1}</span> <span data-notify="message">{2}</span><div class="progress" data-notify="progressbar"><div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div></div><a href="{3}" target="{4}" data-notify="url"></a></div>'};String.format=function(){for(var t=arguments[0],e=1;e<arguments.length;e++)t=t.replace(RegExp("\\{"+(e-1)+"\\}","gm"),arguments[e]);return t},a.extend(i.prototype,{init:function(){var r=this;this.buildNotify(),this.settings.content.icon&&this.setIcon(),"#"!=this.settings.content.url&&this.styleURL(),this.styleDismiss(),this.placement(),this.bind(),this.notify={$ele:this.$ele,update:function(t,e){var i={};for(var t in"string"==typeof t?i[t]=e:i=t,i)switch(t){case"type":this.$ele.removeClass("alert-"+r.settings.type),this.$ele.find('[data-notify="progressbar"] > .progress-bar').removeClass("progress-bar-"+r.settings.type),r.settings.type=i[t],this.$ele.addClass("alert-"+i[t]).find('[data-notify="progressbar"] > .progress-bar').addClass("progress-bar-"+i[t]);break;case"icon":var n=this.$ele.find('[data-notify="icon"]');"class"==r.settings.icon_type.toLowerCase()?n.removeClass(r.settings.content.icon).addClass(i[t]):(n.is("img")||n.find("img"),n.attr("src",i[t]));break;case"progress":var o=r.settings.delay-r.settings.delay*(i[t]/100);this.$ele.data("notify-delay",o),this.$ele.find('[data-notify="progressbar"] > div').attr("aria-valuenow",i[t]).css("width",i[t]+"%");break;case"url":this.$ele.find('[data-notify="url"]').attr("href",i[t]);break;case"target":this.$ele.find('[data-notify="url"]').attr("target",i[t]);break;default:this.$ele.find('[data-notify="'+t+'"]').html(i[t])}var a=this.$ele.outerHeight()+parseInt(r.settings.spacing)+parseInt(r.settings.offset.y);r.reposition(a)},close:function(){r.close()}}},buildNotify:function(){var t=this.settings.content;this.$ele=a(String.format(this.settings.template,this.settings.type,t.title,t.message,t.url,t.target)),this.$ele.attr("data-notify-position",this.settings.placement.from+"-"+this.settings.placement.align),this.settings.allow_dismiss||this.$ele.find('[data-notify="dismiss"]').css("display","none"),(this.settings.delay<=0&&!this.settings.showProgressbar||!this.settings.showProgressbar)&&this.$ele.find('[data-notify="progressbar"]').remove()},setIcon:function(){"class"==this.settings.icon_type.toLowerCase()?this.$ele.find('[data-notify="icon"]').addClass(this.settings.content.icon):this.$ele.find('[data-notify="icon"]').is("img")?this.$ele.find('[data-notify="icon"]').attr("src",this.settings.content.icon):this.$ele.find('[data-notify="icon"]').append('<img src="'+this.settings.content.icon+'" alt="Notify Icon" />')},styleDismiss:function(){this.$ele.find('[data-notify="dismiss"]').css({position:"absolute",right:"10px",top:"5px",zIndex:this.settings.z_index+2})},styleURL:function(){this.$ele.find('[data-notify="url"]').css({backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)",height:"100%",left:"0px",position:"absolute",top:"0px",width:"100%",zIndex:this.settings.z_index+1})},placement:function(){var i=this,t=this.settings.offset.y,e={display:"inline-block",margin:"0px auto",position:this.settings.position?this.settings.position:"body"===this.settings.element?"fixed":"absolute",transition:"all .5s ease-in-out",zIndex:this.settings.z_index},n=!1,o=this.settings;switch(a('[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])').each(function(){return t=Math.max(t,parseInt(a(this).css(o.placement.from))+parseInt(a(this).outerHeight())+parseInt(o.spacing))}),1==this.settings.newest_on_top&&(t=this.settings.offset.y),e[this.settings.placement.from]=t+"px",this.settings.placement.align){case"left":case"right":e[this.settings.placement.align]=this.settings.offset.x+"px";break;case"center":e.left=0,e.right=0}this.$ele.css(e).addClass(this.settings.animate.enter),a.each(Array("webkit","moz","o","ms",""),function(t,e){i.$ele[0].style[e+"AnimationIterationCount"]=1}),a(this.settings.element).append(this.$ele),1==this.settings.newest_on_top&&(t=parseInt(t)+parseInt(this.settings.spacing)+this.$ele.outerHeight(),this.reposition(t)),a.isFunction(i.settings.onShow)&&i.settings.onShow.call(this.$ele),this.$ele.one(this.animations.start,function(t){n=!0}).one(this.animations.end,function(t){a.isFunction(i.settings.onShown)&&i.settings.onShown.call(this)}),setTimeout(function(){n||a.isFunction(i.settings.onShown)&&i.settings.onShown.call(this)},600)},bind:function(){var i,n=this;this.$ele.find('[data-notify="dismiss"]').on("click",function(){n.close()}),this.$ele.mouseover(function(t){a(this).data("data-hover","true")}).mouseout(function(t){a(this).data("data-hover","false")}),this.$ele.data("data-hover","false"),0<this.settings.delay&&(n.$ele.data("notify-delay",n.settings.delay),i=setInterval(function(){var t,e=parseInt(n.$ele.data("notify-delay"))-n.settings.timer;("false"===n.$ele.data("data-hover")&&"pause"==n.settings.mouse_over||"pause"!=n.settings.mouse_over)&&(t=(n.settings.delay-e)/n.settings.delay*100,n.$ele.data("notify-delay",e),n.$ele.find('[data-notify="progressbar"] > div').attr("aria-valuenow",t).css("width",t+"%")),e<=-n.settings.timer&&(clearInterval(i),n.close())},n.settings.timer))},close:function(){var e=this,t=parseInt(this.$ele.css(this.settings.placement.from)),i=!1;this.$ele.data("closing","true").addClass(this.settings.animate.exit),e.reposition(t),a.isFunction(e.settings.onClose)&&e.settings.onClose.call(this.$ele),this.$ele.one(this.animations.start,function(t){i=!0}).one(this.animations.end,function(t){a(this).remove(),a.isFunction(e.settings.onClosed)&&e.settings.onClosed.call(this)}),setTimeout(function(){i||(e.$ele.remove(),e.settings.onClosed&&e.settings.onClosed(e.$ele))},600)},reposition:function(t){var e=this,i='[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])',n=this.$ele.nextAll(i);1==this.settings.newest_on_top&&(n=this.$ele.prevAll(i)),n.each(function(){a(this).css(e.settings.placement.from,t),t=parseInt(t)+parseInt(e.settings.spacing)+a(this).outerHeight()})}}),a.notify=function(t,e){return new i(0,t,e).notify},a.notifyDefaults=function(t){return n=a.extend(!0,{},n,t)},a.notifyClose=function(t){void 0===t||"all"==t?a("[data-notify]").find('[data-notify="dismiss"]').trigger("click"):a('[data-notify-position="'+t+'"]').find('[data-notify="dismiss"]').trigger("click")}}),$.notifyDefaults({template:'<div data-notify="container" class="alert alert-{0}" role="alert"><button type="button" aria-hidden="true" class="close" data-notify="dismiss"></button><span data-notify="icon"></span><span data-notify="title">{1}</span><span data-notify="message">{2}</span><div class="progress" data-notify="progressbar"><div class="progress-bar progress-bar-animated bg-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div></div><a href="{3}" target="{4}" data-notify="url"></a></div>'}),("function"==typeof define&&define.amd?define:function(t,e){"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):window.toastr=e(window.jQuery)})(["jquery"],function(v){return C=0,a="error",r="info",s="success",l="warning",t={clear:function(t,e){var i=y();w||m(i),n(t,i,e)||function(t){for(var e=w.children(),i=e.length-1;0<=i;i--)n(v(e[i]),t)}(i)},remove:function(t){var e=y();return w||m(e),t&&0===v(":focus",t).length?void x(t):void(w.children().length&&w.remove())},error:function(t,e,i){return o({type:a,iconClass:y().iconClasses.error,message:t,optionsOverride:i,title:e})},getContainer:m,info:function(t,e,i){return o({type:r,iconClass:y().iconClasses.info,message:t,optionsOverride:i,title:e})},options:{},subscribe:function(t){e=t},success:function(t,e,i){return o({type:s,iconClass:y().iconClasses.success,message:t,optionsOverride:i,title:e})},version:"2.1.4",warning:function(t,e,i){return o({type:l,iconClass:y().iconClasses.warning,message:t,optionsOverride:i,title:e})}};function m(t,e){return t=t||y(),(w=v("#"+t.containerId)).length||e&&(i=t,(w=v("<div/>").attr("id",i.containerId).addClass(i.positionClass)).appendTo(v(i.target)),w=w),w;var i}function n(t,e,i){var n=!(!i||!i.force)&&i.force;return t&&(n||0===v(":focus",t).length)&&(t[e.hideMethod]({duration:e.hideDuration,easing:e.hideEasing,complete:function(){x(t)}}),1)}function b(t){e&&e(t)}function o(e){function i(t){return null==t&&(t=""),t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function n(t){var e=t&&!1!==r.closeMethod?r.closeMethod:r.hideMethod,i=t&&!1!==r.closeDuration?r.closeDuration:r.hideDuration,n=t&&!1!==r.closeEasing?r.closeEasing:r.hideEasing;if(!v(":focus",c).length||t)return clearTimeout(p.intervalId),c[e]({duration:i,easing:n,complete:function(){x(c),clearTimeout(l),r.onHidden&&"hidden"!==g.state&&r.onHidden(),g.state="hidden",g.endTime=new Date,b(g)}})}function t(){(0<r.timeOut||0<r.extendedTimeOut)&&(l=setTimeout(n,r.extendedTimeOut),p.maxHideTime=parseFloat(r.extendedTimeOut),p.hideEta=(new Date).getTime()+p.maxHideTime)}function o(){clearTimeout(l),p.hideEta=0,c.stop(!0,!0)[r.showMethod]({duration:r.showDuration,easing:r.showEasing})}function a(){var t=(p.hideEta-(new Date).getTime())/p.maxHideTime*100;d.width(t+"%")}var r=y(),s=e.iconClass||r.iconClass;if(void 0!==e.optionsOverride&&(r=v.extend(r,e.optionsOverride),s=e.optionsOverride.iconClass||s),!function(t,e){if(t.preventDuplicates){if(e.message===k)return 1;k=e.message}}(r,e)){C++,w=m(r,!0);var l=null,c=v("<div/>"),h=v("<div/>"),u=v("<div/>"),d=v("<div/>"),f=v(r.closeHtml),p={intervalId:null,hideEta:null,maxHideTime:null},g={toastId:C,state:"visible",startTime:new Date,options:r,map:e};return e.iconClass&&c.addClass(r.toastClass).addClass(s),function(){{var t;e.title&&(t=e.title,r.escapeHtml&&(t=i(e.title)),h.append(t).addClass(r.titleClass),c.append(h))}}(),function(){{var t;e.message&&(t=e.message,r.escapeHtml&&(t=i(e.message)),u.append(t).addClass(r.messageClass),c.append(u))}}(),r.closeButton&&(f.addClass(r.closeClass).attr("role","button"),c.prepend(f)),r.progressBar&&(d.addClass(r.progressClass),c.prepend(d)),r.rtl&&c.addClass("rtl"),r.newestOnTop?w.prepend(c):w.append(c),function(){var t="";switch(e.iconClass){case"toast-success":case"toast-info":t="polite";break;default:t="assertive"}c.attr("aria-live",t)}(),c.hide(),c[r.showMethod]({duration:r.showDuration,easing:r.showEasing,complete:r.onShown}),0<r.timeOut&&(l=setTimeout(n,r.timeOut),p.maxHideTime=parseFloat(r.timeOut),p.hideEta=(new Date).getTime()+p.maxHideTime,r.progressBar&&(p.intervalId=setInterval(a,10))),r.closeOnHover&&c.hover(o,t),!r.onclick&&r.tapToDismiss&&c.click(n),r.closeButton&&f&&f.click(function(t){t.stopPropagation?t.stopPropagation():void 0!==t.cancelBubble&&!0!==t.cancelBubble&&(t.cancelBubble=!0),r.onCloseClick&&r.onCloseClick(t),n(!0)}),r.onclick&&c.click(function(t){r.onclick(t),n()}),b(g),r.debug&&console&&console.log(g),c}}function y(){return v.extend({},{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'<button type="button">&times;</button>',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1},t.options)}function x(t){w=w||m(),t.is(":visible")||(t.remove(),t=null,0===w.children().length&&(w.remove(),k=void 0))}var w,e,k,C,a,r,s,l,t}),function(t){if("object"==("undefined"==typeof exports?"undefined":_typeof2(exports))&&"object"==("undefined"==typeof module?"undefined":_typeof2(module)))module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e=t();for(var i in e)("object"==("undefined"==typeof exports?"undefined":_typeof2(exports))?exports:void 0)[i]=e[i]}}(function(){return o={},i.m=n=[function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==_typeof2(Symbol.iterator)?function(t){return _typeof2(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":_typeof2(t)},n="dual-listbox__title",s="dual-listbox__item",o="dual-listbox__button",l="dual-listbox__item--selected",a=(function(t,e,i){return e&&c(t.prototype,e),i&&c(t,i),t}(r,[{key:"setDefaults",value:function(){this.addEvent=null,this.removeEvent=null,this.availableTitle="Available options",this.selectedTitle="Selected options",this.addButtonText="add",this.removeButtonText="remove",this.addAllButtonText="add all",this.removeAllButtonText="remove all",this.searchPlaceholder="Search"}},{key:"addEventListener",value:function(t,e){this.dualListbox.addEventListener(t,e)}},{key:"addSelected",value:function(e){var i=this,t=this.available.indexOf(e);-1<t&&(this.available.splice(t,1),this.selected.push(e),this._selectOption(e.dataset.id),this.redraw(),setTimeout(function(){var t=document.createEvent("HTMLEvents");t.initEvent("added",!1,!0),t.addedElement=e,i.dualListbox.dispatchEvent(t)},0))}},{key:"redraw",value:function(){this.updateAvailableListbox(),this.updateSelectedListbox()}},{key:"removeSelected",value:function(e){var i=this,t=this.selected.indexOf(e);-1<t&&(this.selected.splice(t,1),this.available.push(e),this._deselectOption(e.dataset.id),this.redraw(),setTimeout(function(){var t=document.createEvent("HTMLEvents");t.initEvent("removed",!1,!0),t.removedElement=e,i.dualListbox.dispatchEvent(t)},0))}},{key:"searchLists",value:function(t,e){for(var i=e.querySelectorAll("."+s),n=t.toLowerCase(),o=0;o<i.length;o++){var a=i[o];-1===a.textContent.toLowerCase().indexOf(n)?a.style.display="none":a.style.display="list-item"}}},{key:"updateAvailableListbox",value:function(){this._updateListbox(this.availableList,this.available)}},{key:"updateSelectedListbox",value:function(){this._updateListbox(this.selectedList,this.selected)}},{key:"_actionAllSelected",value:function(t){var e=this;t.preventDefault(),this.available.filter(function(t){return"none"!==t.style.display}).forEach(function(t){return e.addSelected(t)})}},{key:"_updateListbox",value:function(t,e){for(;t.firstChild;)t.removeChild(t.firstChild);for(var i=0;i<e.length;i++){var n=e[i];t.appendChild(n)}}},{key:"_actionItemSelected",value:function(t){t.preventDefault();var e=this.dualListbox.querySelector("."+l);e&&this.addSelected(e)}},{key:"_actionAllDeselected",value:function(t){var e=this;t.preventDefault(),this.selected.filter(function(t){return"none"!==t.style.display}).forEach(function(t){return e.removeSelected(t)})}},{key:"_actionItemDeselected",value:function(t){t.preventDefault();var e=this.dualListbox.querySelector("."+l);e&&this.removeSelected(e)}},{key:"_actionItemDoubleClick",value:function(t,e){var i=1<arguments.length&&void 0!==e?e:null;i&&(i.preventDefault(),i.stopPropagation()),-1<this.selected.indexOf(t)?this.removeSelected(t):this.addSelected(t)}},{key:"_actionItemClick",value:function(t,e,i){var n=2<arguments.length&&void 0!==i?i:null;n&&n.preventDefault();for(var o=e.querySelectorAll("."+s),a=0;a<o.length;a++){var r=o[a];r!==t&&r.classList.remove(l)}t.classList.contains(l)?t.classList.remove(l):t.classList.add(l)}},{key:"_addActions",value:function(){this._addButtonActions(),this._addSearchActions()}},{key:"_addButtonActions",value:function(){var e=this;this.add_all_button.addEventListener("click",function(t){return e._actionAllSelected(t)}),this.add_button.addEventListener("click",function(t){return e._actionItemSelected(t)}),this.remove_button.addEventListener("click",function(t){return e._actionItemDeselected(t)}),this.remove_all_button.addEventListener("click",function(t){return e._actionAllDeselected(t)})}},{key:"_addClickActions",value:function(e){var i=this;return e.addEventListener("dblclick",function(t){return i._actionItemDoubleClick(e,t)}),e.addEventListener("click",function(t){return i._actionItemClick(e,i.dualListbox,t)}),e}},{key:"_addSearchActions",value:function(){var e=this;this.search.addEventListener("change",function(t){return e.searchLists(t.target.value,e.dualListbox)}),this.search.addEventListener("keyup",function(t){return e.searchLists(t.target.value,e.dualListbox)})}},{key:"_buildDualListbox",value:function(t){this.select.style.display="none",this.dualListBoxContainer.appendChild(this._createList(this.availableListTitle,this.availableList)),this.dualListBoxContainer.appendChild(this.buttons),this.dualListBoxContainer.appendChild(this._createList(this.selectedListTitle,this.selectedList)),this.dualListbox.appendChild(this.search),this.dualListbox.appendChild(this.dualListBoxContainer),t.insertBefore(this.dualListbox,this.select)}},{key:"_createList",value:function(t,e){var i=document.createElement("div");return i.appendChild(t),i.appendChild(e),i}},{key:"_createButtons",value:function(){this.buttons=document.createElement("div"),this.buttons.classList.add("dual-listbox__buttons"),this.add_all_button=document.createElement("button"),this.add_all_button.classList.add(o),this.add_all_button.innerHTML=this.addAllButtonText,this.add_button=document.createElement("button"),this.add_button.classList.add(o),this.add_button.innerHTML=this.addButtonText,this.remove_button=document.createElement("button"),this.remove_button.classList.add(o),this.remove_button.innerHTML=this.removeButtonText,this.remove_all_button=document.createElement("button"),this.remove_all_button.classList.add(o),this.remove_all_button.innerHTML=this.removeAllButtonText,this.buttons.appendChild(this.add_all_button),this.buttons.appendChild(this.add_button),this.buttons.appendChild(this.remove_button),this.buttons.appendChild(this.remove_all_button)}},{key:"_createListItem",value:function(t){var e=document.createElement("li");return e.classList.add(s),e.innerHTML=t.text,e.dataset.id=t.value,this._addClickActions(e),e}},{key:"_createSearch",value:function(){this.search=document.createElement("input"),this.search.classList.add("dual-listbox__search"),this.search.placeholder=this.searchPlaceholder}},{key:"_deselectOption",value:function(t){for(var e=this.select.options,i=0;i<e.length;i++){var n=e[i];n.value===t&&(n.selected=!1)}this.removeEvent&&this.removeEvent(t)}},{key:"_initOptions",value:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e])}},{key:"_initReusableElements",value:function(){this.dualListbox=document.createElement("div"),this.dualListbox.classList.add("dual-listbox"),this.select.id&&this.dualListbox.classList.add(this.select.id),this.dualListBoxContainer=document.createElement("div"),this.dualListBoxContainer.classList.add("dual-listbox__container"),this.availableList=document.createElement("ul"),this.availableList.classList.add("dual-listbox__available"),this.selectedList=document.createElement("ul"),this.selectedList.classList.add("dual-listbox__selected"),this.availableListTitle=document.createElement("div"),this.availableListTitle.classList.add(n),this.availableListTitle.innerText=this.availableTitle,this.selectedListTitle=document.createElement("div"),this.selectedListTitle.classList.add(n),this.selectedListTitle.innerText=this.selectedTitle,this._createButtons(),this._createSearch()}},{key:"_selectOption",value:function(t){for(var e=this.select.options,i=0;i<e.length;i++){var n=e[i];n.value===t&&(n.selected=!0)}this.addEvent&&this.addEvent(t)}},{key:"_splitOptions",value:function(t){for(var e=0;e<t.length;e++){var i=t[e];r.isDomElement(i)?this._addOption({text:i.innerHTML,value:i.value,selected:i.attributes.selected}):this._addOption(i)}}},{key:"_addOption",value:function(t){var e=this._createListItem(t);t.selected?this.selected.push(e):this.available.push(e)}}],[{key:"isDomElement",value:function(t){return"object"===("undefined"==typeof HTMLElement?"undefined":i(HTMLElement))?t instanceof HTMLElement:t&&"object"===(void 0===t?"undefined":i(t))&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName}}]),r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,r),this.setDefaults(),this.selected=[],this.available=[],r.isDomElement(t)?this.select=t:this.select=document.querySelector(t),this._initOptions(e),this._initReusableElements(),this._splitOptions(this.select.options),void 0!==e.options&&this._splitOptions(e.options),this._buildDualListbox(this.select.parentNode),this._addActions(),this.redraw()}function c(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}e.default=a,e.DualListbox=a}],i.c=o,i.p="",i(0);function i(t){if(o[t])return o[t].exports;var e=o[t]={exports:{},id:t,loaded:!1};return n[t].call(e.exports,e,e.exports,i),e.loaded=!0,e.exports}var n,o}),function(t,e){"object"==("undefined"==typeof exports?"undefined":_typeof2(exports))&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).ApexCharts=e()}(void 0,function(){function y(t){return(y="function"==typeof Symbol&&"symbol"==_typeof2(Symbol.iterator)?function(t){return _typeof2(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":_typeof2(t)})(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}function s(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function o(e,t){var i,n=Object.keys(e);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(e),t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)),n}function P(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?o(Object(i),!0).forEach(function(t){s(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(a){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e,i,n,o=c(a);return e=r?(t=c(this).constructor,Reflect.construct(o,arguments,t)):o.apply(this,arguments),i=this,!(n=e)||"object"!=_typeof2(n)&&"function"!=typeof n?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(i):n}}function C(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t){if(t){if("string"==typeof t)return u(t,void 0);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?u(t,void 0):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var L=(r(S,[{key:"shadeRGBColor",value:function(t,e){var i=e.split(","),n=t<0?0:255,o=t<0?-1*t:t,a=parseInt(i[0].slice(4),10),r=parseInt(i[1],10),s=parseInt(i[2],10);return"rgb("+(Math.round((n-a)*o)+a)+","+(Math.round((n-r)*o)+r)+","+(Math.round((n-s)*o)+s)+")"}},{key:"shadeHexColor",value:function(t,e){var i=parseInt(e.slice(1),16),n=t<0?0:255,o=t<0?-1*t:t,a=i>>16,r=i>>8&255,s=255&i;return"#"+(16777216+65536*(Math.round((n-a)*o)+a)+256*(Math.round((n-r)*o)+r)+(Math.round((n-s)*o)+s)).toString(16).slice(1)}},{key:"shadeColor",value:function(t,e){return S.isColorHex(e)?this.shadeHexColor(t,e):this.shadeRGBColor(t,e)}}],[{key:"bind",value:function(t,e){return function(){return t.apply(e,arguments)}}},{key:"isObject",value:function(t){return t&&"object"===y(t)&&!Array.isArray(t)&&null!=t}},{key:"listToArray",value:function(t){for(var e=[],i=0;i<t.length;i++)e[i]=t[i];return e}},{key:"extend",value:function(e,i){var n=this;"function"!=typeof Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var o in n)n.hasOwnProperty(o)&&(e[o]=n[o])}return e});var o=Object.assign({},e);return this.isObject(e)&&this.isObject(i)&&Object.keys(i).forEach(function(t){n.isObject(i[t])&&t in e?o[t]=n.extend(e[t],i[t]):Object.assign(o,s({},t,i[t]))}),o}},{key:"extendArray",value:function(t,e){var i=[];return t.map(function(t){i.push(S.extend(e,t))}),i}},{key:"monthMod",value:function(t){return t%12}},{key:"clone",value:function(t){if("[object Array]"===Object.prototype.toString.call(t)){for(var e=[],i=0;i<t.length;i++)e[i]=this.clone(t[i]);return e}if("[object Null]"===Object.prototype.toString.call(t))return null;if("[object Date]"===Object.prototype.toString.call(t))return t;if("object"!==y(t))return t;var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=this.clone(t[o]));return n}},{key:"log10",value:function(t){return Math.log(t)/Math.LN10}},{key:"roundToBase10",value:function(t){return Math.pow(10,Math.floor(Math.log10(t)))}},{key:"roundToBase",value:function(t,e){return Math.pow(e,Math.floor(Math.log(t)/Math.log(e)))}},{key:"parseNumber",value:function(t){return null===t?t:parseFloat(t)}},{key:"randomId",value:function(){return(Math.random()+1).toString(36).substring(4)}},{key:"noExponents",value:function(t){var e=String(t).split(/[eE]/);if(1===e.length)return e[0];var i="",n=t<0?"-":"",o=e[0].replace(".",""),a=Number(e[1])+1;if(a<0){for(i=n+"0.";a++;)i+="0";return i+o.replace(/^-/,"")}for(a-=o.length;a--;)i+="0";return o+i}},{key:"getDimensions",value:function(t){var e=getComputedStyle(t),i=[],n=t.clientHeight,o=t.clientWidth;return n-=parseFloat(e.paddingTop)+parseFloat(e.paddingBottom),o-=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight),i.push(o),i.push(n),i}},{key:"getBoundingClientRect",value:function(t){var e=t.getBoundingClientRect();return{top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:t.clientWidth,height:t.clientHeight,x:e.left,y:e.top}}},{key:"getLargestStringFromArr",value:function(t){return t.reduce(function(t,e){return Array.isArray(e)&&(e=e.reduce(function(t,e){return t.length>e.length?t:e})),t.length>e.length?t:e},0)}},{key:"hexToRgba",value:function(t,e){var i=0<arguments.length&&void 0!==t?t:"#999999",n=1<arguments.length&&void 0!==e?e:.6;"#"!==i.substring(0,1)&&(i="#999999");for(var o=(o=i.replace("#","")).match(new RegExp("(.{"+o.length/3+"})","g")),a=0;a<o.length;a++)o[a]=parseInt(1===o[a].length?o[a]+o[a]:o[a],16);return void 0!==n&&o.push(n),"rgba("+o.join(",")+")"}},{key:"getOpacityFromRGBA",value:function(t){return parseFloat(t.replace(/^.*,(.+)\)/,"$1"))}},{key:"rgb2hex",value:function(t){return(t=t.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&4===t.length?"#"+("0"+parseInt(t[1],10).toString(16)).slice(-2)+("0"+parseInt(t[2],10).toString(16)).slice(-2)+("0"+parseInt(t[3],10).toString(16)).slice(-2):""}},{key:"isColorHex",value:function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i.test(t)}},{key:"polarToCartesian",value:function(t,e,i,n){var o=(n-90)*Math.PI/180;return{x:t+i*Math.cos(o),y:e+i*Math.sin(o)}}},{key:"escapeString",value:function(t,e){var i=1<arguments.length&&void 0!==e?e:"x",n=t.toString().slice();return n.replace(/[` ~!@#$%^&*()_|+\-=?;:'",.<>{}[\]\\/]/gi,i)}},{key:"negToZero",value:function(t){return t<0?0:t}},{key:"moveIndexInArray",value:function(t,e,i){if(i>=t.length)for(var n=i-t.length+1;n--;)t.push(void 0);return t.splice(i,0,t.splice(e,1)[0]),t}},{key:"extractNumber",value:function(t){return parseFloat(t.replace(/[^\d.]*/g,""))}},{key:"findAncestor",value:function(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t}},{key:"setELstyles",value:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t.style.key=e[i])}},{key:"isNumber",value:function(t){return!isNaN(t)&&parseFloat(Number(t))===t&&!isNaN(parseInt(t,10))}},{key:"isFloat",value:function(t){return Number(t)===t&&t%1!=0}},{key:"isSafari",value:function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}},{key:"isFirefox",value:function(){return-1<navigator.userAgent.toLowerCase().indexOf("firefox")}},{key:"isIE11",value:function(){if(-1!==window.navigator.userAgent.indexOf("MSIE")||-1<window.navigator.appVersion.indexOf("Trident/"))return!0}},{key:"isIE",value:function(){var t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(0<e)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);if(0<t.indexOf("Trident/")){var i=t.indexOf("rv:");return parseInt(t.substring(i+3,t.indexOf(".",i)),10)}var n=t.indexOf("Edge/");return 0<n&&parseInt(t.substring(n+5,t.indexOf(".",n)),10)}}]),S),N=(r(A,[{key:"getDefaultFilter",value:function(t,e){var i=this.w;t.unfilter(!0),(new window.SVG.Filter).size("120%","180%","-5%","-40%"),"none"!==i.config.states.normal.filter?this.applyFilter(t,e,i.config.states.normal.filter.type,i.config.states.normal.filter.value):i.config.chart.dropShadow.enabled&&this.dropShadow(t,i.config.chart.dropShadow,e)}},{key:"addNormalFilter",value:function(t,e){var i=this.w;i.config.chart.dropShadow.enabled&&!t.node.classList.contains("apexcharts-marker")&&this.dropShadow(t,i.config.chart.dropShadow,e)}},{key:"addLightenFilter",value:function(t,i,e){var n=this,o=this.w,a=e.intensity;L.isFirefox()||(t.unfilter(!0),new window.SVG.Filter,t.filter(function(t){var e=o.config.chart.dropShadow;(e.enabled?n.addShadow(t,i,e):t).componentTransfer({rgb:{type:"linear",slope:1.5,intercept:a}})}),t.filterer.node.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(t.filterer.node))}},{key:"addDarkenFilter",value:function(t,i,e){var n=this,o=this.w,a=e.intensity;L.isFirefox()||(t.unfilter(!0),new window.SVG.Filter,t.filter(function(t){var e=o.config.chart.dropShadow;(e.enabled?n.addShadow(t,i,e):t).componentTransfer({rgb:{type:"linear",slope:a}})}),t.filterer.node.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(t.filterer.node))}},{key:"applyFilter",value:function(t,e,i,n){var o=3<arguments.length&&void 0!==n?n:.5;switch(i){case"none":this.addNormalFilter(t,e);break;case"lighten":this.addLightenFilter(t,e,{intensity:o});break;case"darken":this.addDarkenFilter(t,e,{intensity:o})}}},{key:"addShadow",value:function(t,e,i){var n=i.blur,o=i.top,a=i.left,r=i.color,s=i.opacity,l=t.flood(Array.isArray(r)?r[e]:r,s).composite(t.sourceAlpha,"in").offset(a,o).gaussianBlur(n).merge(t.source);return t.blend(t.source,l)}},{key:"dropShadow",value:function(t,e,i){var n=2<arguments.length&&void 0!==i?i:0,o=e.top,a=e.left,r=e.blur,s=e.color,l=e.opacity,c=e.noUserSpaceOnUse,h=this.w;return t.unfilter(!0),L.isIE()&&"radialBar"===h.config.chart.type||(s=Array.isArray(s)?s[n]:s,t.filter(function(t){var e=L.isSafari()||L.isFirefox()||L.isIE()?t.flood(s,l).composite(t.sourceAlpha,"in").offset(a,o).gaussianBlur(r):t.flood(s,l).composite(t.sourceAlpha,"in").offset(a,o).gaussianBlur(r).merge(t.source);t.blend(t.source,e)}),c||t.filterer.node.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(t.filterer.node)),t}},{key:"setSelectionFilter",value:function(t,e,i){var n,o=this.w;void 0!==o.globals.selectedDataPoints[e]&&-1<o.globals.selectedDataPoints[e].indexOf(i)&&(t.node.setAttribute("selected",!0),"none"!==(n=o.config.states.active.filter)&&this.applyFilter(t,e,n.type,n.value))}},{key:"_scaleFilterSize",value:function(i){!function(t){for(var e in t)t.hasOwnProperty(e)&&i.setAttribute(e,t[e])}({width:"200%",height:"200%",x:"-50%",y:"-50%"})}}]),A),I=(r(k,[{key:"setEasingFunctions",value:function(){var t;if(!this.w.globals.easing){switch(this.w.config.chart.animations.easing){case"linear":t="-";break;case"easein":t="<";break;case"easeout":t=">";break;case"easeinout":t="<>";break;case"swing":t=function(t){return--t*t*(2.70158*t+1.70158)+1};break;case"bounce":t=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375};break;case"elastic":t=function(t){return t===!!t?t:Math.pow(2,-10*t)*Math.sin((t-.075)*(2*Math.PI)/.3)+1};break;default:t="<>"}this.w.globals.easing=t}}},{key:"animateLine",value:function(t,e,i,n){t.attr(e).animate(n).attr(i)}},{key:"animateCircleRadius",value:function(t,e,i,n,o,a){e=e||0,t.attr({r:e}).animate(n,o).attr({r:i}).afterAll(function(){a()})}},{key:"animateCircle",value:function(t,e,i,n,o){t.attr({r:e.r,cx:e.cx,cy:e.cy}).animate(n,o).attr({r:i.r,cx:i.cx,cy:i.cy})}},{key:"animateRect",value:function(t,e,i,n,o){t.attr(e).animate(n).attr(i).afterAll(function(){return o()})}},{key:"animatePathsGradually",value:function(t){var e=t.el,i=t.realIndex,n=t.j,o=t.fill,a=t.pathFrom,r=t.pathTo,s=t.speed,l=t.delay,c=this.w,h=0;c.config.chart.animations.animateGradually.enabled&&(h=c.config.chart.animations.animateGradually.delay),c.config.chart.animations.dynamicAnimation.enabled&&c.globals.dataChanged&&"bar"!==c.config.chart.type&&(h=0),this.morphSVG(e,i,n,"line"!==c.config.chart.type||c.globals.comboCharts?o:"stroke",a,r,s,l*h)}},{key:"showDelayedElements",value:function(){this.w.globals.delayedElements.forEach(function(t){t.el.classList.remove("apexcharts-element-hidden")})}},{key:"animationCompleted",value:function(t){var e=this.w;e.globals.animationEnded||(e.globals.animationEnded=!0,this.showDelayedElements(),"function"==typeof e.config.chart.events.animationEnd&&e.config.chart.events.animationEnd(this.ctx,{el:t,w:e}))}},{key:"morphSVG",value:function(t,e,i,n,o,a,r,s){var l=this,c=this.w;function h(){return"radar"===c.config.chart.type&&(r=1),"M 0 ".concat(c.globals.gridHeight)}o=o||t.attr("pathFrom"),a=a||t.attr("pathTo"),(!o||-1<o.indexOf("undefined")||-1<o.indexOf("NaN"))&&(o=h()),(!a||-1<a.indexOf("undefined")||-1<a.indexOf("NaN"))&&(a=h()),c.globals.shouldAnimate||(r=1),t.plot(o).animate(1,c.globals.easing,s).plot(o).animate(r,c.globals.easing,s).plot(a).afterAll(function(){L.isNumber(i)?i===c.globals.series[c.globals.maxValsInArrayIndex].length-2&&c.globals.shouldAnimate&&l.animationCompleted(t):"none"!==n&&c.globals.shouldAnimate&&(!c.globals.comboCharts&&e===c.globals.series.length-1||c.globals.comboCharts)&&l.animationCompleted(t),l.showDelayedElements()})}}]),k),M=(r(w,[{key:"drawLine",value:function(t,e,i,n,o,a,r){var s=4<arguments.length&&void 0!==o?o:"#a8a8a8",l=5<arguments.length&&void 0!==a?a:0,c=6<arguments.length&&void 0!==r?r:null;return this.w.globals.dom.Paper.line().attr({x1:t,y1:e,x2:i,y2:n,stroke:s,"stroke-dasharray":l,"stroke-width":c})}},{key:"drawRect",value:function(t,e,i,n,o,a,r,s,l,c){var h=0<arguments.length&&void 0!==t?t:0,u=1<arguments.length&&void 0!==e?e:0,d=2<arguments.length&&void 0!==i?i:0,f=3<arguments.length&&void 0!==n?n:0,p=4<arguments.length&&void 0!==o?o:0,g=5<arguments.length&&void 0!==a?a:"#fefefe",v=6<arguments.length&&void 0!==r?r:1,m=7<arguments.length&&void 0!==s?s:null,b=8<arguments.length&&void 0!==l?l:null,y=9<arguments.length&&void 0!==c?c:0,x=this.w.globals.dom.Paper.rect();return x.attr({x:h,y:u,width:0<d?d:0,height:0<f?f:0,rx:p,ry:p,opacity:v,"stroke-width":null!==m?m:0,stroke:null!==b?b:"none","stroke-dasharray":y}),x.node.setAttribute("fill",g),x}},{key:"drawPolygon",value:function(t,e,i,n){var o=1<arguments.length&&void 0!==e?e:"#e1e1e1",a=2<arguments.length&&void 0!==i?i:1,r=3<arguments.length&&void 0!==n?n:"none";return this.w.globals.dom.Paper.polygon(t).attr({fill:r,stroke:o,"stroke-width":a})}},{key:"drawCircle",value:function(t,e){var i=1<arguments.length&&void 0!==e?e:null,n=this.w.globals.dom.Paper.circle(2*t);return null!==i&&n.attr(i),n}},{key:"drawPath",value:function(t){var e=t.d,i=void 0===e?"":e,n=t.stroke,o=void 0===n?"#a8a8a8":n,a=t.strokeWidth,r=void 0===a?1:a,s=t.fill,l=t.fillOpacity,c=void 0===l?1:l,h=t.strokeOpacity,u=void 0===h?1:h,d=t.classes,f=t.strokeLinecap,p=void 0===f?null:f,g=t.strokeDashArray,v=void 0===g?0:g,m=this.w;return null===p&&(p=m.config.stroke.lineCap),(-1<i.indexOf("undefined")||-1<i.indexOf("NaN"))&&(i="M 0 ".concat(m.globals.gridHeight)),m.globals.dom.Paper.path(i).attr({fill:s,"fill-opacity":c,stroke:o,"stroke-opacity":u,"stroke-linecap":p,"stroke-width":r,"stroke-dasharray":v,class:d})}},{key:"group",value:function(t){var e=0<arguments.length&&void 0!==t?t:null,i=this.w.globals.dom.Paper.group();return null!==e&&i.attr(e),i}},{key:"move",value:function(t,e){return["M",t,e].join(" ")}},{key:"line",value:function(t,e,i){var n=2<arguments.length&&void 0!==i?i:null,o=null;return null===n?o=["L",t,e].join(" "):"H"===n?o=["H",t].join(" "):"V"===n&&(o=["V",e].join(" ")),o}},{key:"curve",value:function(t,e,i,n,o,a){return["C",t,e,i,n,o,a].join(" ")}},{key:"quadraticCurve",value:function(t,e,i,n){return["Q",t,e,i,n].join(" ")}},{key:"arc",value:function(t,e,i,n,o,a,r,s){return[7<arguments.length&&void 0!==s&&s?"a":"A",t,e,i,n,o,a,r].join(" ")}},{key:"renderPaths",value:function(t){var e,i=t.j,n=t.realIndex,o=t.pathFrom,a=t.pathTo,r=t.stroke,s=t.strokeWidth,l=t.strokeLinecap,c=t.fill,h=t.animationDelay,u=t.initialSpeed,d=t.dataChangeSpeed,f=t.className,p=t.shouldClipToGrid,g=void 0===p||p,v=t.bindEventsOnPaths,m=void 0===v||v,b=t.drawShadow,y=void 0===b||b,x=this.w,w=new N(this.ctx),k=new I(this.ctx),C=this.w.config.chart.animations.enabled,A=C&&this.w.config.chart.animations.dynamicAnimation.enabled,S=!!(C&&!x.globals.resized||A&&x.globals.dataChanged&&x.globals.shouldAnimate);S?e=o:(e=a,x.globals.animationEnded=!0);var T,E=x.config.stroke.dashArray,_=Array.isArray(E)?E[n]:x.config.stroke.dashArray,O=this.drawPath({d:e,stroke:r,strokeWidth:s,fill:c,fillOpacity:1,classes:f,strokeLinecap:l,strokeDashArray:_});O.attr("index",n),g&&O.attr({"clip-path":"url(#gridRectMask".concat(x.globals.cuid,")")}),"none"!==x.config.states.normal.filter.type?w.getDefaultFilter(O,n):x.config.chart.dropShadow.enabled&&y&&(!x.config.chart.dropShadow.enabledOnSeries||x.config.chart.dropShadow.enabledOnSeries&&-1!==x.config.chart.dropShadow.enabledOnSeries.indexOf(n))&&(T=x.config.chart.dropShadow,w.dropShadow(O,T,n)),m&&(O.node.addEventListener("mouseenter",this.pathMouseEnter.bind(this,O)),O.node.addEventListener("mouseleave",this.pathMouseLeave.bind(this,O)),O.node.addEventListener("mousedown",this.pathMouseDown.bind(this,O))),O.attr({pathTo:a,pathFrom:o});var L={el:O,j:i,realIndex:n,pathFrom:o,pathTo:a,fill:c,strokeWidth:s,delay:h};return!C||x.globals.resized||x.globals.dataChanged?!x.globals.resized&&x.globals.dataChanged||k.showDelayedElements():k.animatePathsGradually(P(P({},L),{},{speed:u})),x.globals.dataChanged&&A&&S&&k.animatePathsGradually(P(P({},L),{},{speed:d})),O}},{key:"drawPattern",value:function(e,i,n,t,o){var a=3<arguments.length&&void 0!==t?t:"#a8a8a8",r=4<arguments.length&&void 0!==o?o:0;return this.w.globals.dom.Paper.pattern(i,n,function(t){"horizontalLines"===e?t.line(0,0,n,0).stroke({color:a,width:r+1}):"verticalLines"===e?t.line(0,0,0,i).stroke({color:a,width:r+1}):"slantedLines"===e?t.line(0,0,i,n).stroke({color:a,width:r}):"squares"===e?t.rect(i,n).fill("none").stroke({color:a,width:r}):"circles"===e&&t.circle(i).fill("none").stroke({color:a,width:r})})}},{key:"drawGradient",value:function(t,e,i,n,o,a,r,s,l){var c=5<arguments.length&&void 0!==a?a:null,h=6<arguments.length&&void 0!==r?r:null,u=7<arguments.length&&void 0!==s?s:null,d=8<arguments.length&&void 0!==l?l:0,f=this.w;e.length<9&&0===e.indexOf("#")&&(e=L.hexToRgba(e,n)),i.length<9&&0===i.indexOf("#")&&(i=L.hexToRgba(i,o));var p=0,g=1,v=1,m=null;null!==h&&(p=void 0!==h[0]?h[0]/100:0,g=void 0!==h[1]?h[1]/100:1,v=void 0!==h[2]?h[2]/100:1,m=void 0!==h[3]?h[3]/100:null);var b,y,x=!("donut"!==f.config.chart.type&&"pie"!==f.config.chart.type&&"polarArea"!==f.config.chart.type&&"bubble"!==f.config.chart.type),w=null===u||0===u.length?f.globals.dom.Paper.gradient(x?"radial":"linear",function(t){t.at(p,e,n),t.at(g,i,o),t.at(v,i,o),null!==m&&t.at(m,e,n)}):f.globals.dom.Paper.gradient(x?"radial":"linear",function(e){(Array.isArray(u[d])?u[d]:u).forEach(function(t){e.at(t.offset/100,t.color,t.opacity)})});return x?(b=f.globals.gridWidth/2,y=f.globals.gridHeight/2,"bubble"!==f.config.chart.type?w.attr({gradientUnits:"userSpaceOnUse",cx:b,cy:y,r:c}):w.attr({cx:.5,cy:.5,r:.8,fx:.2,fy:.2})):"vertical"===t?w.from(0,0).to(0,1):"diagonal"===t?w.from(0,0).to(1,1):"horizontal"===t?w.from(0,1).to(1,1):"diagonal2"===t&&w.from(1,0).to(0,1),w}},{key:"drawText",value:function(t){var e,i=t.x,n=t.y,o=t.text,a=t.textAnchor,r=t.fontSize,s=t.fontFamily,l=t.fontWeight,c=t.foreColor,h=t.opacity,u=t.cssClass,d=void 0===u?"":u,f=t.isPlainText,p=void 0===f||f,g=this.w;return void 0===o&&(o=""),a=a||"start",c&&c.length||(c=g.config.chart.foreColor),s=s||g.config.chart.fontFamily,l=l||"regular",(e=Array.isArray(o)?g.globals.dom.Paper.text(function(t){for(var e=0;e<o.length;e++)0===e?t.tspan(o[e]):t.tspan(o[e]).newLine()}):p?g.globals.dom.Paper.plain(o):g.globals.dom.Paper.text(function(t){return t.tspan(o)})).attr({x:i,y:n,"text-anchor":a,"dominant-baseline":"auto","font-size":r,"font-family":s,"font-weight":l,fill:c,class:"apexcharts-text "+d}),e.node.style.fontFamily=s,e.node.style.opacity=h,e}},{key:"drawMarker",value:function(t,e,i){t=t||0;var n,o,a,r=i.pSize||0,s=null;return"square"===i.shape?(n=void 0===i.pRadius?r/2:i.pRadius,null!==e&&r||(n=r=0),o=1.2*r+n,(a=this.drawRect(o,o,o,o,n)).attr({x:t-o/2,y:e-o/2,cx:t,cy:e,class:i.class?i.class:"",fill:i.pointFillColor,"fill-opacity":i.pointFillOpacity?i.pointFillOpacity:1,stroke:i.pointStrokeColor,"stroke-width":i.pWidth?i.pWidth:0,"stroke-opacity":i.pointStrokeOpacity?i.pointStrokeOpacity:1}),s=a):"circle"!==i.shape&&i.shape||(L.isNumber(e)||(e=r=0),s=this.drawCircle(r,{cx:t,cy:e,class:i.class?i.class:"",stroke:i.pointStrokeColor,fill:i.pointFillColor,"fill-opacity":i.pointFillOpacity?i.pointFillOpacity:1,"stroke-width":i.pWidth?i.pWidth:0,"stroke-opacity":i.pointStrokeOpacity?i.pointStrokeOpacity:1})),s}},{key:"pathMouseEnter",value:function(t,e){var i,n=this.w,o=new N(this.ctx),a=parseInt(t.node.getAttribute("index"),10),r=parseInt(t.node.getAttribute("j"),10);"function"==typeof n.config.chart.events.dataPointMouseEnter&&n.config.chart.events.dataPointMouseEnter(e,this.ctx,{seriesIndex:a,dataPointIndex:r,w:n}),this.ctx.events.fireEvent("dataPointMouseEnter",[e,this.ctx,{seriesIndex:a,dataPointIndex:r,w:n}]),"none"!==n.config.states.active.filter.type&&"true"===t.node.getAttribute("selected")||"none"===n.config.states.hover.filter.type||"none"===n.config.states.active.filter.type||n.globals.isTouchDevice||(i=n.config.states.hover.filter,o.applyFilter(t,a,i.type,i.value))}},{key:"pathMouseLeave",value:function(t,e){var i=this.w,n=new N(this.ctx),o=parseInt(t.node.getAttribute("index"),10),a=parseInt(t.node.getAttribute("j"),10);"function"==typeof i.config.chart.events.dataPointMouseLeave&&i.config.chart.events.dataPointMouseLeave(e,this.ctx,{seriesIndex:o,dataPointIndex:a,w:i}),this.ctx.events.fireEvent("dataPointMouseLeave",[e,this.ctx,{seriesIndex:o,dataPointIndex:a,w:i}]),"none"!==i.config.states.active.filter.type&&"true"===t.node.getAttribute("selected")||"none"!==i.config.states.hover.filter.type&&n.getDefaultFilter(t,o)}},{key:"pathMouseDown",value:function(t,e){var i,n,o,a,r,s=this.w,l=new N(this.ctx),c=parseInt(t.node.getAttribute("index"),10),h=parseInt(t.node.getAttribute("j"),10),u="false";"true"===t.node.getAttribute("selected")?(t.node.setAttribute("selected","false"),-1<s.globals.selectedDataPoints[c].indexOf(h)&&(i=s.globals.selectedDataPoints[c].indexOf(h),s.globals.selectedDataPoints[c].splice(i,1))):(!s.config.states.active.allowMultipleDataPointsSelection&&0<s.globals.selectedDataPoints.length&&(s.globals.selectedDataPoints=[],n=s.globals.dom.Paper.select(".apexcharts-series path").members,o=s.globals.dom.Paper.select(".apexcharts-series circle, .apexcharts-series rect").members,(a=function(t){Array.prototype.forEach.call(t,function(t){t.node.setAttribute("selected","false"),l.getDefaultFilter(t,c)})})(n),a(o)),t.node.setAttribute("selected","true"),u="true",void 0===s.globals.selectedDataPoints[c]&&(s.globals.selectedDataPoints[c]=[]),s.globals.selectedDataPoints[c].push(h)),"true"===u?"none"!==(r=s.config.states.active.filter)&&l.applyFilter(t,c,r.type,r.value):"none"!==s.config.states.active.filter.type&&l.getDefaultFilter(t,c),"function"==typeof s.config.chart.events.dataPointSelection&&s.config.chart.events.dataPointSelection(e,this.ctx,{selectedDataPoints:s.globals.selectedDataPoints,seriesIndex:c,dataPointIndex:h,w:s}),e&&this.ctx.events.fireEvent("dataPointSelection",[e,this.ctx,{selectedDataPoints:s.globals.selectedDataPoints,seriesIndex:c,dataPointIndex:h,w:s}])}},{key:"rotateAroundCenter",value:function(t){var e=t.getBBox();return{x:e.x+e.width/2,y:e.y+e.height/2}}},{key:"getTextRects",value:function(t,e,i,n,o){var a=!(4<arguments.length&&void 0!==o)||o,r=this.w,s=this.drawText({x:-200,y:-200,text:t,textAnchor:"start",fontSize:e,fontFamily:i,foreColor:"#fff",opacity:0});n&&s.attr("transform",n),r.globals.dom.Paper.add(s);var l=s.bbox();return a||(l=s.node.getBoundingClientRect()),s.remove(),{width:l.width,height:l.height}}},{key:"placeTextWithEllipsis",value:function(t,e,i){if("function"==typeof t.getComputedTextLength&&0<(t.textContent=e).length&&t.getComputedTextLength()>=i/.8){for(var n=e.length-3;0<n;n-=3)if(t.getSubStringLength(0,n)<=i/.8)return void(t.textContent=e.substring(0,n)+"...");t.textContent="."}}}],[{key:"setAttrs",value:function(t,e){for(var i in e)e.hasOwnProperty(i)&&t.setAttribute(i,e[i])}}]),w),e=(r(x,[{key:"setOrientations",value:function(t,e){var i,n,o,a,r,s,l=1<arguments.length&&void 0!==e?e:null,c=this.w;"vertical"===t.label.orientation&&(i=null!==l?l:0,null!==(n=c.globals.dom.baseEl.querySelector(".apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='".concat(i,"']")))&&(o=n.getBoundingClientRect(),n.setAttribute("x",parseFloat(n.getAttribute("x"))-o.height+4),"top"===t.label.position?n.setAttribute("y",parseFloat(n.getAttribute("y"))+o.width):n.setAttribute("y",parseFloat(n.getAttribute("y"))-o.width),r=(a=this.annoCtx.graphics.rotateAroundCenter(n)).x,s=a.y,n.setAttribute("transform","rotate(-90 ".concat(r," ").concat(s,")"))))}},{key:"addBackgroundToAnno",value:function(t,e){var i=this.w;if(!e.label.text||e.label.text&&!e.label.text.trim())return null;var n=i.globals.dom.baseEl.querySelector(".apexcharts-grid").getBoundingClientRect(),o=t.getBoundingClientRect(),a=e.label.style.padding.left,r=e.label.style.padding.right,s=e.label.style.padding.top,l=e.label.style.padding.bottom;"vertical"===e.label.orientation&&(s=e.label.style.padding.left,l=e.label.style.padding.right,a=e.label.style.padding.top,r=e.label.style.padding.bottom);var c=o.left-n.left-a,h=o.top-n.top-s,u=this.annoCtx.graphics.drawRect(c-i.globals.barPadForNumericAxis,h,o.width+a+r,o.height+s+l,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&u.node.classList.add(e.id),u}},{key:"annotationsBackground",value:function(){function i(t,e,i){var n,o,a=s.globals.dom.baseEl.querySelector(".apexcharts-".concat(i,"-annotations .apexcharts-").concat(i,"-annotation-label[rel='").concat(e,"']"));a&&(n=a.parentNode,(o=r.addBackgroundToAnno(a,t))&&n.insertBefore(o.node,a))}var r=this,s=this.w;s.config.annotations.xaxis.map(function(t,e){i(t,e,"xaxis")}),s.config.annotations.yaxis.map(function(t,e){i(t,e,"yaxis")}),s.config.annotations.points.map(function(t,e){i(t,e,"point")})}},{key:"getStringX",value:function(t){var e=this.w,i=t;e.config.xaxis.convertedCatToNumeric&&e.globals.categoryLabels.length&&(t=e.globals.categoryLabels.indexOf(t)+1);var n=e.globals.labels.indexOf(t),o=e.globals.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g text:nth-child("+(n+1)+")");return o&&(i=parseFloat(o.getAttribute("x"))),i}}]),x),d=(r(b,[{key:"addXaxisAnnotation",value:function(t,e,i){var n=this.w,o=this.invertAxis?n.globals.minY:n.globals.minX,a=this.invertAxis?n.globals.maxY:n.globals.maxX,r=this.invertAxis?n.globals.yRange[0]:n.globals.xRange,s=(t.x-o)/(r/n.globals.gridWidth);this.annoCtx.inversedReversedAxis&&(s=(a-t.x)/(r/n.globals.gridWidth));var l=t.label.text;"category"!==n.config.xaxis.type&&!n.config.xaxis.convertedCatToNumeric||this.invertAxis||n.globals.dataFormatXNumeric||(s=this.annoCtx.helpers.getStringX(t.x));var c,h,u,d,f,p,g,v=t.strokeDashArray;L.isNumber(s)&&(null===t.x2||void 0===t.x2?(c=this.annoCtx.graphics.drawLine(s+t.offsetX,0+t.offsetY,s+t.offsetX,n.globals.gridHeight+t.offsetY,t.borderColor,v,t.borderWidth),e.appendChild(c.node),t.id&&c.node.classList.add(t.id)):(u=(t.x2-o)/(r/n.globals.gridWidth),this.annoCtx.inversedReversedAxis&&(u=(a-t.x2)/(r/n.globals.gridWidth)),"category"!==n.config.xaxis.type&&!n.config.xaxis.convertedCatToNumeric||this.invertAxis||n.globals.dataFormatXNumeric||(u=this.annoCtx.helpers.getStringX(t.x2)),u<s&&(h=s,s=u,u=h),(d=this.annoCtx.graphics.drawRect(s+t.offsetX,0+t.offsetY,u-s,n.globals.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,v)).node.classList.add("apexcharts-annotation-rect"),d.attr("clip-path","url(#gridRectMask".concat(n.globals.cuid,")")),e.appendChild(d.node),t.id&&d.node.classList.add(t.id)),f="top"===t.label.position?4:n.globals.gridHeight,p=this.annoCtx.graphics.getTextRects(l,parseFloat(t.label.style.fontSize)),(g=this.annoCtx.graphics.drawText({x:s+t.label.offsetX,y:f+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?p.width/2-12:-p.width/2:0),text:l,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:"apexcharts-xaxis-annotation-label ".concat(t.label.style.cssClass," ").concat(t.id?t.id:"")})).attr({rel:i}),e.appendChild(g.node),this.annoCtx.helpers.setOrientations(t,i))}},{key:"drawXAxisAnnotations",value:function(){var i=this,t=this.w,n=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map(function(t,e){i.addXaxisAnnotation(t,n.node,e)}),n}}]),b),E=(r(m,[{key:"getStackedSeriesTotals",value:function(){var t=this.w,e=[];if(0===t.globals.series.length)return e;for(var i=0;i<t.globals.series[t.globals.maxValsInArrayIndex].length;i++){for(var n=0,o=0;o<t.globals.series.length;o++)void 0!==t.globals.series[o][i]&&(n+=t.globals.series[o][i]);e.push(n)}return t.globals.stackedSeriesTotals=e}},{key:"getSeriesTotalByIndex",value:function(t){var e=0<arguments.length&&void 0!==t?t:null;return null===e?this.w.config.series.reduce(function(t,e){return t+e},0):this.w.globals.series[e].reduce(function(t,e){return t+e},0)}},{key:"isSeriesNull",value:function(t){var e=0<arguments.length&&void 0!==t?t:null;return 0===(null===e?this.w.config.series.filter(function(t){return null!==t}):this.w.config.series[e].data.filter(function(t){return null!==t})).length}},{key:"seriesHaveSameValues",value:function(t){return this.w.globals.series[t].every(function(t,e,i){return t===i[0]})}},{key:"getCategoryLabels",value:function(t){var e=this.w,i=t.slice();return e.config.xaxis.convertedCatToNumeric&&(i=t.map(function(t){return e.config.xaxis.labels.formatter(t-e.globals.minX+1)})),i}},{key:"getLargestSeries",value:function(){var t=this.w;t.globals.maxValsInArrayIndex=t.globals.series.map(function(t){return t.length}).indexOf(Math.max.apply(Math,t.globals.series.map(function(t){return t.length})))}},{key:"getLargestMarkerSize",value:function(){var t=this.w,e=0;return t.globals.markers.size.forEach(function(t){e=Math.max(e,t)}),t.globals.markers.largestSize=e}},{key:"getSeriesTotals",value:function(){var t=this.w;t.globals.seriesTotals=t.globals.series.map(function(t,e){var i=0;if(Array.isArray(t))for(var n=0;n<t.length;n++)i+=t[n];else i+=t;return i})}},{key:"getSeriesTotalsXRange",value:function(o,a){var r=this.w;return r.globals.series.map(function(t,e){for(var i=0,n=0;n<t.length;n++)r.globals.seriesX[e][n]>o&&r.globals.seriesX[e][n]<a&&(i+=t[n]);return i})}},{key:"getPercentSeries",value:function(){var s=this.w;s.globals.seriesPercent=s.globals.series.map(function(t,e){var i=[];if(Array.isArray(t))for(var n=0;n<t.length;n++){var o=s.globals.stackedSeriesTotals[n],a=0;o&&(a=100*t[n]/o),i.push(a)}else{var r=100*t/s.globals.seriesTotals.reduce(function(t,e){return t+e},0);i.push(r)}return i})}},{key:"getCalculatedRatios",value:function(){var t,e,i,n,o=this.w.globals,a=[],r=0,s=[],l=.1,c=0;if(o.yRange=[],o.isMultipleYAxis)for(var h=0;h<o.minYArr.length;h++)o.yRange.push(Math.abs(o.minYArr[h]-o.maxYArr[h])),s.push(0);else o.yRange.push(Math.abs(o.minY-o.maxY));o.xRange=Math.abs(o.maxX-o.minX),o.zRange=Math.abs(o.maxZ-o.minZ);for(var u=0;u<o.yRange.length;u++)a.push(o.yRange[u]/o.gridHeight);if(e=o.xRange/o.gridWidth,i=Math.abs(o.initialMaxX-o.initialMinX)/o.gridWidth,t=o.yRange/o.gridWidth,n=o.xRange/o.gridHeight,(r=o.zRange/o.gridHeight*16)||(r=1),o.minY!==Number.MIN_VALUE&&0!==Math.abs(o.minY)&&(o.hasNegs=!0),o.isMultipleYAxis){s=[];for(var d=0;d<a.length;d++)s.push(-o.minYArr[d]/a[d])}else s.push(-o.minY/a[0]),o.minY!==Number.MIN_VALUE&&0!==Math.abs(o.minY)&&(l=-o.minY/t,c=o.minX/e);return{yRatio:a,invertedYRatio:t,zRatio:r,xRatio:e,initialXRatio:i,invertedXRatio:n,baseLineInvertedY:l,baseLineY:s,baseLineX:c}}},{key:"getLogSeries",value:function(t){var i=this,n=this.w;return n.globals.seriesLog=t.map(function(t,e){return n.config.yaxis[e]&&n.config.yaxis[e].logarithmic?t.map(function(t){return null===t?null:i.getLogVal(t,e)}):t}),n.globals.invalidLogScale?t:n.globals.seriesLog}},{key:"getLogVal",value:function(t,e){var i=this.w;return(Math.log(t)-Math.log(i.globals.minYArr[e]))/(Math.log(i.globals.maxYArr[e])-Math.log(i.globals.minYArr[e]))}},{key:"getLogYRatios",value:function(t){var a=this,r=this.w,s=this.w.globals;return s.yLogRatio=t.slice(),s.logYRange=s.yRange.map(function(t,e){if(r.config.yaxis[e]&&a.w.config.yaxis[e].logarithmic){var i,n=-Number.MAX_VALUE,o=Number.MIN_VALUE;return s.seriesLog.forEach(function(t,e){t.forEach(function(t){r.config.yaxis[e]&&r.config.yaxis[e].logarithmic&&(n=Math.max(t,n),o=Math.min(t,o))})}),i=Math.pow(s.yRange[e],Math.abs(o-n)/s.yRange[e]),s.yLogRatio[e]=i/s.gridHeight,i}}),s.invalidLogScale?t.slice():s.yLogRatio}}],[{key:"checkComboSeries",value:function(t){var e=!1,i=0;return t.length&&void 0!==t[0].type&&(e=!0,t.forEach(function(t){"bar"!==t.type&&"column"!==t.type&&"candlestick"!==t.type||i++})),{comboBarCount:i,comboCharts:e}}},{key:"extendArrayProps",value:function(t,e,i){return e.yaxis&&(e=t.extendYAxis(e,i)),e.annotations&&(e.annotations.yaxis&&(e=t.extendYAxisAnnotations(e)),e.annotations.xaxis&&(e=t.extendXAxisAnnotations(e)),e.annotations.points&&(e=t.extendPointAnnotations(e))),e}}]),m),f=(r(v,[{key:"addYaxisAnnotation",value:function(t,e,i){var n,o,a,r,s=this.w,l=t.strokeDashArray,c=this._getY1Y2("y1",t),h=t.label.text;null===t.y2||void 0===t.y2?(n=this.annoCtx.graphics.drawLine(0+t.offsetX,c+t.offsetY,s.globals.gridWidth+t.offsetX,c+t.offsetY,t.borderColor,l,t.borderWidth),e.appendChild(n.node),t.id&&n.node.classList.add(t.id)):((a=this._getY1Y2("y2",t))>c&&(o=c,c=a,a=o),(r=this.annoCtx.graphics.drawRect(0+t.offsetX,a+t.offsetY,s.globals.gridWidth+t.offsetX,c-a,0,t.fillColor,t.opacity,1,t.borderColor,l)).node.classList.add("apexcharts-annotation-rect"),r.attr("clip-path","url(#gridRectMask".concat(s.globals.cuid,")")),e.appendChild(r.node),t.id&&r.node.classList.add(t.id));var u="right"===t.label.position?s.globals.gridWidth:0,d=this.annoCtx.graphics.drawText({x:u+t.label.offsetX,y:(a||c)+t.label.offsetY-3,text:h,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:"apexcharts-yaxis-annotation-label ".concat(t.label.style.cssClass," ").concat(t.id?t.id:"")});d.attr({rel:i}),e.appendChild(d.node)}},{key:"_getY1Y2",value:function(t,e){var i,n,o,a,r="y1"===t?e.y:e.y2,s=this.w;return this.annoCtx.invertAxis?(i=s.globals.labels.indexOf(r),s.config.xaxis.convertedCatToNumeric&&(i=s.globals.categoryLabels.indexOf(r)),(n=s.globals.dom.baseEl.querySelector(".apexcharts-yaxis-texts-g text:nth-child("+(i+1)+")"))&&(a=parseFloat(n.getAttribute("y")))):(o=s.config.yaxis[e.yAxisIndex].logarithmic?(r=new E(this.annoCtx.ctx).getLogVal(r,e.yAxisIndex))/s.globals.yLogRatio[e.yAxisIndex]:(r-s.globals.minYArr[e.yAxisIndex])/(s.globals.yRange[e.yAxisIndex]/s.globals.gridHeight),a=s.globals.gridHeight-o,s.config.yaxis[e.yAxisIndex]&&s.config.yaxis[e.yAxisIndex].reversed&&(a=o)),a}},{key:"drawYAxisAnnotations",value:function(){var i=this,t=this.w,n=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.map(function(t,e){i.addYaxisAnnotation(t,n.node,e)}),n}}]),v),p=(r(g,[{key:"addPointAnnotation",value:function(t,e,i){var n=this.w,o=0,a=0,r=0;this.annoCtx.invertAxis&&console.warn("Point annotation is not supported in horizontal bar charts.");var s,l,c=parseFloat(t.y);"string"==typeof t.x?(l=n.globals.labels.indexOf(t.x),n.config.xaxis.convertedCatToNumeric&&(l=n.globals.categoryLabels.indexOf(t.x)),o=this.annoCtx.helpers.getStringX(t.x),null===t.y&&(c=n.globals.series[t.seriesIndex][l])):o=(t.x-n.globals.minX)/(n.globals.xRange/n.globals.gridWidth),s=n.config.yaxis[t.yAxisIndex].logarithmic?(c=new E(this.annoCtx.ctx).getLogVal(c,t.yAxisIndex))/n.globals.yLogRatio[t.yAxisIndex]:(c-n.globals.minYArr[t.yAxisIndex])/(n.globals.yRange[t.yAxisIndex]/n.globals.gridHeight);var h,u,d,f,p,g,v,a=n.globals.gridHeight-s-parseFloat(t.label.style.fontSize)-t.marker.size,r=n.globals.gridHeight-s;n.config.yaxis[t.yAxisIndex]&&n.config.yaxis[t.yAxisIndex].reversed&&(a=s+parseFloat(t.label.style.fontSize)+t.marker.size,r=s),L.isNumber(o)&&(h={pSize:t.marker.size,pWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:"apexcharts-point-annotation-marker ".concat(t.marker.cssClass," ").concat(t.id?t.id:"")},u=this.annoCtx.graphics.drawMarker(o+t.marker.offsetX,r+t.marker.offsetY,h),e.appendChild(u.node),d=t.label.text?t.label.text:"",(f=this.annoCtx.graphics.drawText({x:o+t.label.offsetX,y:a+t.label.offsetY,text:d,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:"apexcharts-point-annotation-label ".concat(t.label.style.cssClass," ").concat(t.id?t.id:"")})).attr({rel:i}),e.appendChild(f.node),t.customSVG.SVG&&((p=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass})).attr({transform:"translate(".concat(o+t.customSVG.offsetX,", ").concat(a+t.customSVG.offsetY,")")}),p.node.innerHTML=t.customSVG.SVG,e.appendChild(p.node)),t.image.path&&(g=t.image.width?t.image.width:20,v=t.image.height?t.image.height:20,this.annoCtx.addImage({x:o+t.image.offsetX-g/2,y:a+t.image.offsetY-v/2,width:g,height:v,path:t.image.path,appendTo:".apexcharts-point-annotations"})))}},{key:"drawPointAnnotations",value:function(){var i=this,t=this.w,n=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map(function(t,e){i.addPointAnnotation(t,n.node,e)}),n}}]),g);function g(t){a(this,g),this.w=t.w,this.annoCtx=t}function v(t){a(this,v),this.w=t.w,this.annoCtx=t}function m(t){a(this,m),this.ctx=t,this.w=t.w}function b(t){a(this,b),this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis}function x(t){a(this,x),this.w=t.w,this.annoCtx=t}function w(t){a(this,w),this.ctx=t,this.w=t.w}function k(t){a(this,k),this.ctx=t,this.w=t.w,this.setEasingFunctions()}function A(t){a(this,A),this.ctx=t,this.w=t.w}function S(){a(this,S)}var t,T,_={name:"en",options:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],toolbar:{exportToSVG:"Download SVG",exportToPNG:"Download PNG",exportToCSV:"Download CSV",menu:"Menu",selection:"Selection",selectionZoom:"Selection Zoom",zoomIn:"Zoom In",zoomOut:"Zoom Out",pan:"Panning",reset:"Reset Zoom"}}},O=(r(Fe,[{key:"init",value:function(){return{annotations:{position:"front",yaxis:[this.yAxisAnnotation],xaxis:[this.xAxisAnnotation],points:[this.pointAnnotation],texts:[],images:[],shapes:[]},chart:{animations:{enabled:!0,easing:"easeinout",speed:800,animateGradually:{delay:150,enabled:!0},dynamicAnimation:{enabled:!0,speed:350}},background:"transparent",locales:[_],defaultLocale:"en",dropShadow:{enabled:!1,enabledOnSeries:void 0,top:2,left:2,blur:4,color:"#000",opacity:.35},events:{animationEnd:void 0,beforeMount:void 0,mounted:void 0,updated:void 0,click:void 0,mouseMove:void 0,legendClick:void 0,markerClick:void 0,selection:void 0,dataPointSelection:void 0,dataPointMouseEnter:void 0,dataPointMouseLeave:void 0,beforeZoom:void 0,zoomed:void 0,scrolled:void 0},foreColor:"#373d3f",fontFamily:"Helvetica, Arial, sans-serif",height:"auto",parentHeightOffset:15,redrawOnParentResize:!0,id:void 0,group:void 0,offsetX:0,offsetY:0,selection:{enabled:!1,type:"x",fill:{color:"#24292e",opacity:.1},stroke:{width:1,color:"#24292e",opacity:.4,dashArray:3},xaxis:{min:void 0,max:void 0},yaxis:{min:void 0,max:void 0}},sparkline:{enabled:!1},brush:{enabled:!1,autoScaleYaxis:!0,target:void 0},stacked:!1,stackType:"normal",toolbar:{show:!0,offsetX:0,offsetY:0,tools:{download:!0,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0,customIcons:[]},export:{csv:{filename:void 0,columnDelimiter:",",headerCategory:"category",headerValue:"value",dateFormatter:function(t){return new Date(t).toDateString()}}},autoSelected:"zoom"},type:"line",width:"100%",zoom:{enabled:!0,type:"x",autoScaleYaxis:!1,zoomedArea:{fill:{color:"#90CAF9",opacity:.4},stroke:{color:"#0D47A1",opacity:.4,width:1}}}},plotOptions:{area:{fillTo:"origin"},bar:{horizontal:!1,columnWidth:"70%",barHeight:"70%",distributed:!1,startingShape:"flat",endingShape:"flat",rangeBarOverlap:!0,colors:{ranges:[],backgroundBarColors:[],backgroundBarOpacity:1,backgroundBarRadius:0},dataLabels:{position:"top",maxItems:100,hideOverflowingLabels:!0,orientation:"horizontal"}},bubble:{minBubbleRadius:void 0,maxBubbleRadius:void 0},candlestick:{colors:{upward:"#00B746",downward:"#EF403C"},wick:{useFillColor:!0}},heatmap:{radius:2,enableShades:!0,shadeIntensity:.5,reverseNegativeShade:!1,distributed:!1,useFillColorAsStroke:!1,colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0}},radialBar:{inverseOrder:!1,startAngle:0,endAngle:360,offsetX:0,offsetY:0,hollow:{margin:5,size:"50%",background:"transparent",image:void 0,imageWidth:150,imageHeight:150,imageOffsetX:0,imageOffsetY:0,imageClipped:!0,position:"front",dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},track:{show:!0,startAngle:void 0,endAngle:void 0,background:"#f2f2f2",strokeWidth:"97%",opacity:1,margin:5,dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},dataLabels:{show:!0,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:0,formatter:function(t){return t}},value:{show:!0,fontSize:"14px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:16,formatter:function(t){return t+"%"}},total:{show:!1,label:"Total",fontSize:"16px",fontWeight:600,fontFamily:void 0,color:void 0,formatter:function(t){return t.globals.seriesTotals.reduce(function(t,e){return t+e},0)/t.globals.series.length+"%"}}}},pie:{customScale:1,offsetX:0,offsetY:0,startAngle:0,expandOnClick:!0,dataLabels:{offset:0,minAngleToShowLabel:10},donut:{size:"65%",background:"transparent",labels:{show:!1,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:-10,formatter:function(t){return t}},value:{show:!0,fontSize:"20px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:10,formatter:function(t){return t}},total:{show:!1,showAlways:!1,label:"Total",fontSize:"16px",fontWeight:400,fontFamily:void 0,color:void 0,formatter:function(t){return t.globals.seriesTotals.reduce(function(t,e){return t+e},0)}}}}},polarArea:{rings:{strokeWidth:1,strokeColor:"#e8e8e8"}},radar:{size:void 0,offsetX:0,offsetY:0,polygons:{strokeWidth:1,strokeColors:"#e8e8e8",connectorColors:"#e8e8e8",fill:{colors:void 0}}}},colors:void 0,dataLabels:{enabled:!0,enabledOnSeries:void 0,formatter:function(t){return null!==t?t:""},textAnchor:"middle",distributed:!1,offsetX:0,offsetY:0,style:{fontSize:"12px",fontFamily:void 0,fontWeight:600,colors:void 0},background:{enabled:!0,foreColor:"#fff",borderRadius:2,padding:4,opacity:.9,borderWidth:1,borderColor:"#fff",dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.45}},dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.45}},fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]},image:{src:[],width:void 0,height:void 0},pattern:{style:"squares",width:6,height:6,strokeWidth:2}},grid:{show:!0,borderColor:"#e0e0e0",strokeDashArray:0,position:"back",xaxis:{lines:{show:!1}},yaxis:{lines:{show:!0}},row:{colors:void 0,opacity:.5},column:{colors:void 0,opacity:.5},padding:{top:0,right:10,bottom:0,left:12}},labels:[],legend:{show:!0,showForSingleSeries:!1,showForNullSeries:!0,showForZeroSeries:!0,floating:!1,position:"bottom",horizontalAlign:"center",inverseOrder:!1,fontSize:"12px",fontFamily:void 0,fontWeight:400,width:void 0,height:void 0,formatter:void 0,tooltipHoverFormatter:void 0,offsetX:-20,offsetY:4,labels:{colors:void 0,useSeriesColors:!1},markers:{width:12,height:12,strokeWidth:0,fillColors:void 0,strokeColor:"#fff",radius:12,customHTML:void 0,offsetX:0,offsetY:0,onClick:void 0},itemMargin:{horizontal:5,vertical:2},onItemClick:{toggleDataSeries:!0},onItemHover:{highlightDataSeries:!0}},markers:{discrete:[],size:0,colors:void 0,strokeColors:"#fff",strokeWidth:2,strokeOpacity:.9,strokeDashArray:0,fillOpacity:1,shape:"circle",radius:2,offsetX:0,offsetY:0,onClick:void 0,onDblClick:void 0,showNullDataPoints:!0,hover:{size:void 0,sizeOffset:3}},noData:{text:void 0,align:"center",verticalAlign:"middle",offsetX:0,offsetY:0,style:{color:void 0,fontSize:"14px",fontFamily:void 0}},responsive:[],series:void 0,states:{normal:{filter:{type:"none",value:0}},hover:{filter:{type:"lighten",value:.15}},active:{allowMultipleDataPointsSelection:!1,filter:{type:"darken",value:.65}}},title:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:0,floating:!1,style:{fontSize:"14px",fontWeight:900,fontFamily:void 0,color:void 0}},subtitle:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:30,floating:!1,style:{fontSize:"12px",fontWeight:400,fontFamily:void 0,color:void 0}},stroke:{show:!0,curve:"smooth",lineCap:"butt",width:2,colors:void 0,dashArray:0},tooltip:{enabled:!0,enabledOnSeries:void 0,shared:!0,followCursor:!1,intersect:!1,inverseOrder:!1,custom:void 0,fillSeriesColor:!1,theme:"light",style:{fontSize:"12px",fontFamily:void 0},onDatasetHover:{highlightDataSeries:!1},x:{show:!0,format:"dd MMM",formatter:void 0},y:{formatter:void 0,title:{formatter:function(t){return t+": "}}},z:{formatter:void 0,title:"Size: "},marker:{show:!0,fillColors:void 0},items:{display:"flex"},fixed:{enabled:!1,position:"topRight",offsetX:0,offsetY:0}},xaxis:{type:"category",categories:[],convertedCatToNumeric:!1,sorted:!1,offsetX:0,offsetY:0,labels:{show:!0,rotate:-45,rotateAlways:!1,hideOverlappingLabels:!0,trim:!1,minHeight:void 0,maxHeight:120,showDuplicates:!0,style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""},offsetX:0,offsetY:0,format:void 0,formatter:void 0,datetimeUTC:!0,datetimeFormatter:{year:"yyyy",month:"MMM 'yy",day:"dd MMM",hour:"HH:mm",minute:"HH:mm:ss"}},axisBorder:{show:!0,color:"#e0e0e0",width:"100%",height:1,offsetX:0,offsetY:0},axisTicks:{show:!0,color:"#e0e0e0",height:6,offsetX:0,offsetY:0},tickAmount:void 0,tickPlacement:"on",min:void 0,max:void 0,range:void 0,floating:!1,position:"bottom",title:{text:void 0,offsetX:0,offsetY:0,style:{color:void 0,fontSize:"12px",fontWeight:900,fontFamily:void 0,cssClass:""}},crosshairs:{show:!0,width:1,position:"back",opacity:.9,stroke:{color:"#b6b6b6",width:1,dashArray:3},fill:{type:"solid",color:"#B1B9C4",gradient:{colorFrom:"#D8E3F0",colorTo:"#BED1E6",stops:[0,100],opacityFrom:.4,opacityTo:.5}},dropShadow:{enabled:!1,left:0,top:0,blur:1,opacity:.4}},tooltip:{enabled:!0,offsetY:0,formatter:void 0,style:{fontSize:"12px",fontFamily:void 0}}},yaxis:this.yAxis,theme:{mode:"light",palette:"palette1",monochrome:{enabled:!1,color:"#008FFB",shadeTo:"light",shadeIntensity:.65}}}}}]),Fe),D=(r(Be,[{key:"drawAxesAnnotations",value:function(){var t=this.w;if(t.globals.axisCharts){for(var e=this.yAxisAnnotations.drawYAxisAnnotations(),i=this.xAxisAnnotations.drawXAxisAnnotations(),n=this.pointsAnnotations.drawPointAnnotations(),o=t.config.chart.animations.enabled,a=[e,i,n],r=[i.node,e.node,n.node],s=0;s<3;s++)t.globals.dom.elGraphical.add(a[s]),!o||t.globals.resized||t.globals.dataChanged||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&1<t.globals.dataPoints&&r[s].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:r[s],index:0});this.helpers.annotationsBackground()}}},{key:"drawImageAnnos",value:function(){var i=this;this.w.config.annotations.images.map(function(t,e){i.addImage(t,e)})}},{key:"drawTextAnnos",value:function(){var i=this;this.w.config.annotations.texts.map(function(t,e){i.addText(t,e)})}},{key:"addXaxisAnnotation",value:function(t,e,i){this.xAxisAnnotations.addXaxisAnnotation(t,e,i)}},{key:"addYaxisAnnotation",value:function(t,e,i){this.yAxisAnnotations.addYaxisAnnotation(t,e,i)}},{key:"addPointAnnotation",value:function(t,e,i){this.pointsAnnotations.addPointAnnotation(t,e,i)}},{key:"addText",value:function(t){var e=t.x,i=t.y,n=t.text,o=t.textAnchor,a=t.foreColor,r=t.fontSize,s=t.fontFamily,l=t.fontWeight,c=t.cssClass,h=t.backgroundColor,u=t.borderWidth,d=t.strokeDashArray,f=t.borderRadius,p=t.borderColor,g=t.appendTo,v=void 0===g?".apexcharts-annotations":g,m=t.paddingLeft,b=void 0===m?4:m,y=t.paddingRight,x=void 0===y?4:y,w=t.paddingBottom,k=void 0===w?2:w,C=t.paddingTop,A=void 0===C?2:C,S=this.w,T=this.graphics.drawText({x:e,y:i,text:n,textAnchor:o||"start",fontSize:r||"12px",fontWeight:l||"regular",fontFamily:s||S.config.chart.fontFamily,foreColor:a||S.config.chart.foreColor,cssClass:c}),E=S.globals.dom.baseEl.querySelector(v);E&&E.appendChild(T.node);var _,O=T.bbox();n&&(_=this.graphics.drawRect(O.x-b,O.y-A,O.width+b+x,O.height+k+A,f,h||"transparent",1,u,p,d),E.insertBefore(_.node,T.node))}},{key:"addImage",value:function(t){var e=this.w,i=t.path,n=t.x,o=void 0===n?0:n,a=t.y,r=void 0===a?0:a,s=t.width,l=void 0===s?20:s,c=t.height,h=void 0===c?20:c,u=t.appendTo,d=void 0===u?".apexcharts-annotations":u,f=e.globals.dom.Paper.image(i);f.size(l,h).move(o,r);var p=e.globals.dom.baseEl.querySelector(d);p&&p.appendChild(f.node)}},{key:"addXaxisAnnotationExternal",value:function(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"xaxis",contextMethod:i.addXaxisAnnotation}),i}},{key:"addYaxisAnnotationExternal",value:function(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"yaxis",contextMethod:i.addYaxisAnnotation}),i}},{key:"addPointAnnotationExternal",value:function(t,e,i){return void 0===this.invertAxis&&(this.invertAxis=i.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"point",contextMethod:i.addPointAnnotation}),i}},{key:"addAnnotationExternal",value:function(t){var e=t.params,i=t.pushToMemory,n=t.context,o=t.type,a=t.contextMethod,r=n,s=r.w,l=s.globals.dom.baseEl.querySelector(".apexcharts-".concat(o,"-annotations")),c=l.childNodes.length+1,h=new O,u=Object.assign({},"xaxis"===o?h.xAxisAnnotation:"yaxis"===o?h.yAxisAnnotation:h.pointAnnotation),d=L.extend(u,e);switch(o){case"xaxis":this.addXaxisAnnotation(d,l,c);break;case"yaxis":this.addYaxisAnnotation(d,l,c);break;case"point":this.addPointAnnotation(d,l,c)}var f=s.globals.dom.baseEl.querySelector(".apexcharts-".concat(o,"-annotations .apexcharts-").concat(o,"-annotation-label[rel='").concat(c,"']")),p=this.helpers.addBackgroundToAnno(f,d);return p&&l.insertBefore(p.node,f),i&&s.globals.memory.methodsToExec.push({context:r,id:d.id?d.id:L.randomId(),method:a,label:"addAnnotation",params:e}),n}},{key:"clearAnnotations",value:function(t){var i=t.w,e=i.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations");i.globals.memory.methodsToExec.map(function(t,e){"addText"!==t.label&&"addAnnotation"!==t.label||i.globals.memory.methodsToExec.splice(e,1)}),e=L.listToArray(e),Array.prototype.forEach.call(e,function(t){for(;t.firstChild;)t.removeChild(t.firstChild)})}},{key:"removeAnnotation",value:function(t,i){var n=t.w,e=n.globals.dom.baseEl.querySelectorAll(".".concat(i));e&&(n.globals.memory.methodsToExec.map(function(t,e){t.id===i&&n.globals.memory.methodsToExec.splice(e,1)}),Array.prototype.forEach.call(e,function(t){t.parentElement.removeChild(t)}))}}]),Be),R=(r(je,[{key:"clippedImgArea",value:function(t){var e=this.w,i=e.config,n=parseInt(e.globals.gridWidth,10),o=parseInt(e.globals.gridHeight,10),a=o<n?n:o,r=t.image,s=0,l=0,l=void 0===t.width&&void 0===t.height?void 0!==i.fill.image.width&&void 0!==i.fill.image.height?(s=i.fill.image.width+1,i.fill.image.height):(s=a+1,a):(s=t.width,t.height),c=document.createElementNS(e.globals.SVGNS,"pattern");M.setAttrs(c,{id:t.patternID,patternUnits:t.patternUnits?t.patternUnits:"userSpaceOnUse",width:s+"px",height:l+"px"});var h=document.createElementNS(e.globals.SVGNS,"image");c.appendChild(h),h.setAttributeNS(window.SVG.xlink,"href",r),M.setAttrs(h,{x:0,y:0,preserveAspectRatio:"none",width:s+"px",height:l+"px"}),h.style.opacity=t.opacity,e.globals.dom.elDefs.node.appendChild(c)}},{key:"getSeriesIndex",value:function(t){var e=this.w;return("bar"===e.config.chart.type||"rangeBar"===e.config.chart.type)&&e.config.plotOptions.bar.distributed||"heatmap"===e.config.chart.type?this.seriesIndex=t.seriesNumber:this.seriesIndex=t.seriesNumber%e.globals.series.length,this.seriesIndex}},{key:"fillPath",value:function(t){var e=this.w;this.opts=t;var i,n,o,a=this.w.config;this.seriesIndex=this.getSeriesIndex(t);var r=this.getFillColors()[this.seriesIndex];void 0!==e.globals.seriesColors[this.seriesIndex]&&(r=e.globals.seriesColors[this.seriesIndex]),"function"==typeof r&&(r=r({seriesIndex:this.seriesIndex,dataPointIndex:t.dataPointIndex,value:t.value,w:e}));var s,l,c=this.getFillType(this.seriesIndex),h=Array.isArray(a.fill.opacity)?a.fill.opacity[this.seriesIndex]:a.fill.opacity,u=r;return t.color&&(r=t.color),-1===r.indexOf("rgb")?r.length<9&&(u=L.hexToRgba(r,h)):-1<r.indexOf("rgba")&&(h=L.getOpacityFromRGBA(r)),t.opacity&&(h=t.opacity),"pattern"===c&&(n=this.handlePatternFill(n,r,h,u)),"gradient"===c&&(o=this.handleGradientFill(r,h,this.seriesIndex)),i="image"===c?(s=a.fill.image.src,l=t.patternID?t.patternID:"",this.clippedImgArea({opacity:h,image:Array.isArray(s)?t.seriesNumber<s.length?s[t.seriesNumber]:s[0]:s,width:t.width?t.width:void 0,height:t.height?t.height:void 0,patternUnits:t.patternUnits,patternID:"pattern".concat(e.globals.cuid).concat(t.seriesNumber+1).concat(l)}),"url(#pattern".concat(e.globals.cuid).concat(t.seriesNumber+1).concat(l,")")):"gradient"===c?o:"pattern"===c?n:u,t.solid&&(i=u),i}},{key:"getFillType",value:function(t){var e=this.w;return Array.isArray(e.config.fill.type)?e.config.fill.type[t]:e.config.fill.type}},{key:"getFillColors",value:function(){var t=this.w,e=t.config,i=this.opts,n=[];return t.globals.comboCharts?"line"===t.config.series[this.seriesIndex].type?Array.isArray(t.globals.stroke.colors)?n=t.globals.stroke.colors:n.push(t.globals.stroke.colors):Array.isArray(t.globals.fill.colors)?n=t.globals.fill.colors:n.push(t.globals.fill.colors):"line"===e.chart.type?Array.isArray(t.globals.stroke.colors)?n=t.globals.stroke.colors:n.push(t.globals.stroke.colors):Array.isArray(t.globals.fill.colors)?n=t.globals.fill.colors:n.push(t.globals.fill.colors),void 0!==i.fillColors&&(n=[],Array.isArray(i.fillColors)?n=i.fillColors.slice():n.push(i.fillColors)),n}},{key:"handlePatternFill",value:function(t,e,i,n){var o=this.w.config,a=this.opts,r=new M(this.ctx),s=void 0===o.fill.pattern.strokeWidth?Array.isArray(o.stroke.width)?o.stroke.width[this.seriesIndex]:o.stroke.width:Array.isArray(o.fill.pattern.strokeWidth)?o.fill.pattern.strokeWidth[this.seriesIndex]:o.fill.pattern.strokeWidth,l=e;return Array.isArray(o.fill.pattern.style)?void 0!==o.fill.pattern.style[a.seriesNumber]?r.drawPattern(o.fill.pattern.style[a.seriesNumber],o.fill.pattern.width,o.fill.pattern.height,l,s,i):n:r.drawPattern(o.fill.pattern.style,o.fill.pattern.width,o.fill.pattern.height,l,s,i)}},{key:"handleGradientFill",value:function(t,e,i){var n=this.w.config,o=this.opts,a=new M(this.ctx),r=new L,s=n.fill.gradient.type,l=t,c=void 0===n.fill.gradient.opacityFrom?e:Array.isArray(n.fill.gradient.opacityFrom)?n.fill.gradient.opacityFrom[i]:n.fill.gradient.opacityFrom;-1<l.indexOf("rgba")&&(c=L.getOpacityFromRGBA(l));var h,u,d,f=void 0===n.fill.gradient.opacityTo?e:Array.isArray(n.fill.gradient.opacityTo)?n.fill.gradient.opacityTo[i]:n.fill.gradient.opacityTo;return void 0===n.fill.gradient.gradientToColors||0===n.fill.gradient.gradientToColors.length?u="dark"===n.fill.gradient.shade?r.shadeColor(-1*parseFloat(n.fill.gradient.shadeIntensity),-1<t.indexOf("rgb")?L.rgb2hex(t):t):r.shadeColor(parseFloat(n.fill.gradient.shadeIntensity),-1<t.indexOf("rgb")?L.rgb2hex(t):t):-1<(u=h=n.fill.gradient.gradientToColors[o.seriesNumber]).indexOf("rgba")&&(f=L.getOpacityFromRGBA(h)),n.fill.gradient.inverseColors&&(d=l,l=u,u=d),-1<l.indexOf("rgb")&&(l=L.rgb2hex(l)),-1<u.indexOf("rgb")&&(u=L.rgb2hex(u)),a.drawGradient(s,l,u,c,f,o.size,n.fill.gradient.stops,n.fill.gradient.colorStops,i)}}]),je),z=(r(ze,[{key:"setGlobalMarkerSize",value:function(){var e=this.w;if(e.globals.markers.size=Array.isArray(e.config.markers.size)?e.config.markers.size:[e.config.markers.size],0<e.globals.markers.size.length){if(e.globals.markers.size.length<e.globals.series.length+1)for(var t=0;t<=e.globals.series.length;t++)void 0===e.globals.markers.size[t]&&e.globals.markers.size.push(e.globals.markers.size[0])}else e.globals.markers.size=e.config.series.map(function(t){return e.config.markers.size})}},{key:"plotChartMarkers",value:function(t,e,i,n,o){var a,r=4<arguments.length&&void 0!==o&&o,s=this.w,l=e,c=t,h=null,u=new M(this.ctx);if((0<s.globals.markers.size[e]||r)&&(h=u.group({class:r?"":"apexcharts-series-markers"})).attr("clip-path","url(#gridRectMarkerMask".concat(s.globals.cuid,")")),Array.isArray(c.x))for(var d=0;d<c.x.length;d++){var f,p=1===i&&1===d?1:1===i&&0===d?0:i,g="apexcharts-marker";"line"!==s.config.chart.type&&"area"!==s.config.chart.type||s.globals.comboCharts||s.config.tooltip.intersect||(g+=" no-pointer-events"),(Array.isArray(s.config.markers.size)?0<s.globals.markers.size[e]:0<s.config.markers.size)||r?(L.isNumber(c.y[d])?g+=" w".concat(L.randomId()):g="apexcharts-nullpoint",f=this.getMarkerConfig(g,e,p),s.config.series[l].data[p]&&(s.config.series[l].data[p].fillColor&&(f.pointFillColor=s.config.series[l].data[p].fillColor),s.config.series[l].data[p].strokeColor&&(f.pointStrokeColor=s.config.series[l].data[p].strokeColor)),n&&(f.pSize=n),(a=u.drawMarker(c.x[d],c.y[d],f)).attr("rel",p),a.attr("j",p),a.attr("index",e),a.node.setAttribute("default-marker-size",f.pSize),new N(this.ctx).setSelectionFilter(a,e,p),this.addEvents(a),h&&h.add(a)):(void 0===s.globals.pointsArray[e]&&(s.globals.pointsArray[e]=[]),s.globals.pointsArray[e].push([c.x[d],c.y[d]]))}return h}},{key:"getMarkerConfig",value:function(t,e,i){var n=2<arguments.length&&void 0!==i?i:null,o=this.w,a=this.getMarkerStyle(e),r=o.globals.markers.size[e],s=o.config.markers;return null!==n&&s.discrete.length&&s.discrete.map(function(t){t.seriesIndex===e&&t.dataPointIndex===n&&(a.pointStrokeColor=t.strokeColor,a.pointFillColor=t.fillColor,r=t.size)}),{pSize:r,pRadius:s.radius,pWidth:Array.isArray(s.strokeWidth)?s.strokeWidth[e]:s.strokeWidth,pointStrokeColor:a.pointStrokeColor,pointFillColor:a.pointFillColor,shape:Array.isArray(s.shape)?s.shape[e]:s.shape,class:t,pointStrokeOpacity:Array.isArray(s.strokeOpacity)?s.strokeOpacity[e]:s.strokeOpacity,pointStrokeDashArray:Array.isArray(s.strokeDashArray)?s.strokeDashArray[e]:s.strokeDashArray,pointFillOpacity:Array.isArray(s.fillOpacity)?s.fillOpacity[e]:s.fillOpacity,seriesIndex:e}}},{key:"addEvents",value:function(t){var e=this.w,i=new M(this.ctx);t.node.addEventListener("mouseenter",i.pathMouseEnter.bind(this.ctx,t)),t.node.addEventListener("mouseleave",i.pathMouseLeave.bind(this.ctx,t)),t.node.addEventListener("mousedown",i.pathMouseDown.bind(this.ctx,t)),t.node.addEventListener("click",e.config.markers.onClick),t.node.addEventListener("dblclick",e.config.markers.onDblClick),t.node.addEventListener("touchstart",i.pathMouseDown.bind(this.ctx,t),{passive:!0})}},{key:"getMarkerStyle",value:function(t){var e=this.w,i=e.globals.markers.colors,n=e.config.markers.strokeColor||e.config.markers.strokeColors;return{pointStrokeColor:Array.isArray(n)?n[t]:n,pointFillColor:Array.isArray(i)?i[t]:i}}}]),ze),j=(r(Re,[{key:"draw",value:function(t,e,i){var n=this.w,o=new M(this.ctx),a=i.realIndex,r=i.pointsPos,s=i.zRatio,l=i.elParent,c=o.group({class:"apexcharts-series-markers apexcharts-series-".concat(n.config.chart.type)});if(c.attr("clip-path","url(#gridRectMarkerMask".concat(n.globals.cuid,")")),Array.isArray(r.x))for(var h=0;h<r.x.length;h++){var u=e+1,d=!0;0===e&&0===h&&(u=0),0===e&&1===h&&(u=1);var f,p=0,g=n.globals.markers.size[a];s!==1/0&&(g=n.globals.seriesZ[a][u]/s,(f=n.config.plotOptions.bubble).minBubbleRadius&&g<f.minBubbleRadius&&(g=f.minBubbleRadius),f.maxBubbleRadius&&g>f.maxBubbleRadius&&(g=f.maxBubbleRadius)),n.config.chart.animations.enabled||(p=g);var v,m=r.x[h],b=r.y[h],p=p||0;null!==b&&void 0!==n.globals.series[a][u]||(d=!1),d&&(v=this.drawPoint(m,b,p,g,a,u,e),c.add(v)),l.add(c)}}},{key:"drawPoint",value:function(t,e,i,n,o,a,r){var s,l,c=this.w,h=o,u=new I(this.ctx),d=new N(this.ctx),f=new R(this.ctx),p=new z(this.ctx),g=new M(this.ctx),v=p.getMarkerConfig("apexcharts-marker",h),m=f.fillPath({seriesNumber:o,dataPointIndex:a,patternUnits:"objectBoundingBox",value:c.globals.series[o][r]}),b=g.drawCircle(i);if(c.config.series[h].data[a]&&c.config.series[h].data[a].fillColor&&(m=c.config.series[h].data[a].fillColor),b.attr({cx:t,cy:e,fill:m,stroke:v.pointStrokeColor,r:n,"stroke-width":v.pWidth,"stroke-dasharray":v.pointStrokeDashArray,"stroke-opacity":v.pointStrokeOpacity}),c.config.chart.dropShadow.enabled&&(s=c.config.chart.dropShadow,d.dropShadow(b,s,o)),!this.initialAnim||c.globals.dataChanged||c.globals.resized||(l=c.config.chart.animations.speed,u.animateCircleRadius(b,0,n,l,c.globals.easing,function(){window.setTimeout(function(){u.animationCompleted(b)},100)})),c.globals.dataChanged)if(this.dynamicAnim){var y,x,w,k,C=c.config.chart.animations.dynamicAnimation.speed;null!=(k=c.globals.previousPaths[o]&&c.globals.previousPaths[o][r])&&(y=k.x,x=k.y,w=void 0!==k.r?k.r:n);for(var A=0;A<c.globals.collapsedSeries.length;A++)c.globals.collapsedSeries[A].index===o&&(C=1,n=0);0===t&&0===e&&(n=0),u.animateCircle(b,{cx:y,cy:x,r:w},{cx:t,cy:e,r:n},C,c.globals.easing)}else b.attr({r:n});return b.attr({rel:a,j:a,index:o,"default-marker-size":n}),d.setSelectionFilter(b,o,a),p.addEvents(b),b.node.classList.add("apexcharts-marker"),b}},{key:"centerTextInBubble",value:function(t){var e=this.w;return{y:t+=parseInt(e.config.dataLabels.style.fontSize,10)/4}}}]),Re),B=(r(De,[{key:"dataLabelsCorrection",value:function(t,e,i,n,o,a,r){var s=this.w,l=!1,c=new M(this.ctx).getTextRects(i,r),h=c.width,u=c.height;void 0===s.globals.dataLabelsRects[n]&&(s.globals.dataLabelsRects[n]=[]),s.globals.dataLabelsRects[n].push({x:t,y:e,width:h,height:u});var d,f=s.globals.dataLabelsRects[n].length-2,p=void 0!==s.globals.lastDrawnDataLabelsIndexes[n]?s.globals.lastDrawnDataLabelsIndexes[n][s.globals.lastDrawnDataLabelsIndexes[n].length-1]:0;return void 0===s.globals.dataLabelsRects[n][f]||(t>(d=s.globals.dataLabelsRects[n][p]).x+d.width+2||e>d.y+d.height+2||t+h<d.x)&&(l=!0),0!==o&&!a||(l=!0),{x:t,y:e,textRects:c,drawnextLabel:l}}},{key:"drawDataLabel",value:function(t,e,i,n,o){var a=this,r=4<arguments.length&&void 0!==o?o:2,s=this.w,l=new M(this.ctx),c=s.config.dataLabels,h=0,u=0,d=i,f=null;if(!c.enabled||!Array.isArray(t.x))return f;f=l.group({class:"apexcharts-data-labels"});for(var p=0;p<t.x.length;p++){var g,v,m,h=t.x[p]+c.offsetX;u=t.y[p]+c.offsetY+r,isNaN(h)||(1===i&&0===p&&(d=0),1===i&&1===p&&(d=1),g=s.globals.series[e][d],v="",m=function(t){return s.config.dataLabels.formatter(t,{ctx:a.ctx,seriesIndex:e,dataPointIndex:d,w:s})},"bubble"===s.config.chart.type?(v=m(g=s.globals.seriesZ[e][d]),u=t.y[p],u=new j(this.ctx).centerTextInBubble(u,e,d).y):void 0!==g&&(v=m(g)),this.plotDataLabelsText({x:h,y:u,text:v,i:e,j:d,parent:f,offsetCorrection:!0,dataLabelsConfig:s.config.dataLabels}))}return f}},{key:"plotDataLabelsText",value:function(t){var e,i,n,o,a,r,s=this.w,l=new M(this.ctx),c=t.x,h=t.y,u=t.i,d=t.j,f=t.text,p=t.textAnchor,g=t.parent,v=t.dataLabelsConfig,m=t.color,b=t.alwaysDrawDataLabel,y=t.offsetCorrection;Array.isArray(s.config.dataLabels.enabledOnSeries)&&s.config.dataLabels.enabledOnSeries.indexOf(u)<0||(e={x:c,y:h,drawnextLabel:!0},y&&(e=this.dataLabelsCorrection(c,h,f,u,d,b,parseInt(v.style.fontSize,10))),s.globals.zoomed||(c=e.x,h=e.y),e.textRects&&(c+e.textRects.width<-20||c>s.globals.gridWidth+20)&&(f=""),i=s.globals.dataLabels.style.colors[u],(("bar"===s.config.chart.type||"rangeBar"===s.config.chart.type)&&s.config.plotOptions.bar.distributed||s.config.dataLabels.distributed)&&(i=s.globals.dataLabels.style.colors[d]),m&&(i=m),n=v.offsetX,o=v.offsetY,"bar"!==s.config.chart.type&&"rangeBar"!==s.config.chart.type||(o=n=0),e.drawnextLabel&&((a=l.drawText({width:100,height:parseInt(v.style.fontSize,10),x:c+n,y:h+o,foreColor:i,textAnchor:p||v.textAnchor,text:f,fontSize:v.style.fontSize,fontFamily:v.style.fontFamily,fontWeight:v.style.fontWeight||"normal"})).attr({class:"apexcharts-datalabel",cx:c,cy:h}),v.dropShadow.enabled&&(r=v.dropShadow,new N(this.ctx).dropShadow(a,r)),g.add(a),void 0===s.globals.lastDrawnDataLabelsIndexes[u]&&(s.globals.lastDrawnDataLabelsIndexes[u]=[]),s.globals.lastDrawnDataLabelsIndexes[u].push(d)))}},{key:"addBackgroundToDataLabel",value:function(t,e){var i=this.w,n=i.config.dataLabels.background,o=n.padding,a=n.padding/2,r=e.width,s=e.height,l=new M(this.ctx).drawRect(e.x-o,e.y-a/2,r+2*o,s+a,n.borderRadius,"transparent"===i.config.chart.background?"#fff":i.config.chart.background,n.opacity,n.borderWidth,n.borderColor);return n.dropShadow.enabled&&new N(this.ctx).dropShadow(l,n.dropShadow),l}},{key:"dataLabelsBackground",value:function(){var t=this.w;if("bubble"!==t.config.chart.type)for(var e=t.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels text"),i=0;i<e.length;i++){var n,o=e[i],a=o.getBBox(),r=null;a.width&&a.height&&(r=this.addBackgroundToDataLabel(o,a)),r&&(o.parentNode.insertBefore(r.node,o),n=o.getAttribute("fill"),!t.config.chart.animations.enabled||t.globals.resized||t.globals.dataChanged?r.attr({fill:n}):r.animate().attr({fill:n}),o.setAttribute("fill",t.config.dataLabels.background.foreColor))}}},{key:"bringForward",value:function(){for(var t=this.w,e=t.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels"),i=t.globals.dom.baseEl.querySelector(".apexcharts-plot-series:last-child"),n=0;n<e.length;n++)i&&i.insertBefore(e[n],i.nextSibling)}}]),De),F=(r(Me,[{key:"handleBarDataLabels",value:function(t){var e=t.x,i=t.y,n=t.y1,o=t.y2,a=t.i,r=t.j,s=t.realIndex,l=t.series,c=t.barHeight,h=t.barWidth,u=t.barYPosition,d=t.visibleSeries,f=t.renderedPath,p=this.w,g=new M(this.barCtx.ctx),v=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[s]:this.barCtx.strokeWidth,m=e+parseFloat(h*d),b=i+parseFloat(c*d);p.globals.isXNumeric&&!p.globals.isBarHorizontal&&(m=e+parseFloat(h*(d+1)),b=i+parseFloat(c*(d+1))-v);var y=e,x=i,w=p.config.dataLabels,k=this.barCtx.barOptions.dataLabels;void 0!==u&&this.barCtx.isTimelineBar&&(x=b=u);var C,A=w.offsetX,S=w.offsetY,T={width:0,height:0};p.config.dataLabels.enabled&&(C=String(p.globals.minY).length>String(p.globals.maxY).length?p.globals.minY:p.globals.maxY,T=g.getTextRects(p.globals.yLabelFormatters[0](C),parseFloat(w.style.fontSize)));var E={x:e,y:i,i:a,j:r,renderedPath:f,bcx:m,bcy:b,barHeight:c,barWidth:h,textRects:T,strokeWidth:v,dataLabelsX:y,dataLabelsY:x,barDataLabelsConfig:k,offX:A,offY:S},_=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(E):this.calculateColumnsDataLabelsPosition(E);return f.attr({cy:_.bcy,cx:_.bcx,j:r,val:l[a][r],barHeight:c,barWidth:h}),this.drawCalculatedDataLabels({x:_.dataLabelsX,y:_.dataLabelsY,val:this.barCtx.isTimelineBar?[n,o]:l[a][r],i:s,j:r,barWidth:h,barHeight:c,textRects:T,dataLabelsConfig:w})}},{key:"calculateColumnsDataLabelsPosition",value:function(t){var e=this.w,i=t.i,n=t.j,o=t.y,a=t.bcx,r=t.barWidth,s=t.barHeight,l=t.textRects,c=t.dataLabelsY,h=t.barDataLabelsConfig,u=t.strokeWidth,d=t.offX,f=t.offY,s=Math.abs(s),p="vertical"===e.config.plotOptions.bar.dataLabels.orientation;a-=u/2;var g=e.globals.gridWidth/e.globals.dataPoints,v=e.globals.isXNumeric?a-r/2+d:a-g+r/2+d;p&&(v=v+l.height/2-u/2-2);var m=this.barCtx.series[i][n]<0,b=o;switch(this.barCtx.isReversed&&(b=o-s+(m?2*s:0),o-=s),h.position){case"center":c=p?m?b+s/2+f:b+s/2-f:m?b-s/2+l.height/2+f:b+s/2+l.height/2-f;break;case"bottom":c=p?m?b+s+f:b+s-f:m?b-s+l.height+u+f:b+s-l.height/2+u-f;break;case"top":c=p?m?b+f:b-f:m?b-l.height/2-f:b+l.height+f}return e.config.chart.stacked||(c<0?c=0+u:c+l.height/3>e.globals.gridHeight&&(c=e.globals.gridHeight-u)),{bcx:a,bcy:o,dataLabelsX:v,dataLabelsY:c}}},{key:"calculateBarsDataLabelsPosition",value:function(t){var e=this.w,i=t.x,n=t.i,o=t.j,a=t.bcy,r=t.barHeight,s=t.barWidth,l=t.textRects,c=t.dataLabelsX,h=t.strokeWidth,u=t.barDataLabelsConfig,d=t.offX,f=t.offY,p=e.globals.gridHeight/e.globals.dataPoints,s=Math.abs(s),g=a-(this.barCtx.isTimelineBar?0:p)+r/2+l.height/2+f-3,v=this.barCtx.series[n][o]<0,m=i;switch(this.barCtx.isReversed&&(m=i+s-(v?2*s:0),i=e.globals.gridWidth-s),u.position){case"center":c=v?m+s/2-d:m-s/2+d;break;case"bottom":c=v?m+s-h-Math.round(l.width/2)-d:m-s+h+Math.round(l.width/2)+d;break;case"top":c=v?m-h+Math.round(l.width/2)-d:m-h-Math.round(l.width/2)+d}return e.config.chart.stacked||(c<0?c=c+l.width+h:c+l.width/2>e.globals.gridWidth&&(c=e.globals.gridWidth-l.width-h)),{bcx:i,bcy:a,dataLabelsX:c,dataLabelsY:g}}},{key:"drawCalculatedDataLabels",value:function(t){var e=t.x,i=t.y,n=t.val,o=t.i,a=t.j,r=t.textRects,s=t.barHeight,l=t.barWidth,c=t.dataLabelsConfig,h=this.w,u="rotate(0)";"vertical"===h.config.plotOptions.bar.dataLabels.orientation&&(u="rotate(-90, ".concat(e,", ").concat(i,")"));var d,f,p,g,v=new B(this.barCtx.ctx),m=new M(this.barCtx.ctx),b=c.formatter,y=null,x=-1<h.globals.collapsedSeriesIndices.indexOf(o);return c.enabled&&!x&&(y=m.group({class:"apexcharts-data-labels",transform:u}),d="",void 0!==n&&(d=b(n,{seriesIndex:o,dataPointIndex:a,w:h})),0===n&&h.config.chart.stacked&&(d=""),f=h.globals.series[o][a]<=0,p=h.config.plotOptions.bar.dataLabels.position,"vertical"===h.config.plotOptions.bar.dataLabels.orientation&&("top"===p&&(c.textAnchor=f?"end":"start"),"center"===p&&(c.textAnchor="middle"),"bottom"===p&&(c.textAnchor=f?"end":"start")),this.barCtx.isTimelineBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&l<m.getTextRects(d,parseFloat(c.style.fontSize)).width&&(d=""),h.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&(this.barCtx.isHorizontal?(0<(l=Math.abs(h.globals.series[o][a])/this.barCtx.invertedYRatio[this.barCtx.yaxisIndex])&&r.width/1.6>l||l<0&&r.width/1.6<l)&&(d=""):(s=Math.abs(h.globals.series[o][a])/this.barCtx.yRatio[this.barCtx.yaxisIndex],r.height/1.6>s&&(d=""))),g=P({},c),this.barCtx.isHorizontal&&n<0&&("start"===c.textAnchor?g.textAnchor="end":"end"===c.textAnchor&&(g.textAnchor="start")),v.plotDataLabelsText({x:e,y:i,text:d,i:o,j:a,parent:y,dataLabelsConfig:g,alwaysDrawDataLabel:!0,offsetCorrection:!0})),y}}]),Me),H=(r(Ie,[{key:"getAllSeriesEls",value:function(){return this.w.globals.dom.baseEl.getElementsByClassName("apexcharts-series")}},{key:"getSeriesByName",value:function(t){return this.w.globals.dom.baseEl.querySelector("[seriesName='".concat(L.escapeString(t),"']"))}},{key:"isSeriesHidden",value:function(t){var e=this.getSeriesByName(t),i=parseInt(e.getAttribute("data:realIndex"),10);return{isHidden:e.classList.contains("apexcharts-series-collapsed"),realIndex:i}}},{key:"addCollapsedClassToSeries",value:function(i,n){var t=this.w;function e(t){for(var e=0;e<t.length;e++)t[e].index===n&&i.node.classList.add("apexcharts-series-collapsed")}e(t.globals.collapsedSeries),e(t.globals.ancillaryCollapsedSeries)}},{key:"toggleSeries",value:function(t){var e=this.isSeriesHidden(t);return this.ctx.legend.legendHelpers.toggleDataSeries(e.realIndex,e.isHidden),e.isHidden}},{key:"showSeries",value:function(t){var e=this.isSeriesHidden(t);e.isHidden&&this.ctx.legend.legendHelpers.toggleDataSeries(e.realIndex,!0)}},{key:"hideSeries",value:function(t){var e=this.isSeriesHidden(t);e.isHidden||this.ctx.legend.legendHelpers.toggleDataSeries(e.realIndex,!1)}},{key:"resetSeries",value:function(t,e,i){var n=!(0<arguments.length&&void 0!==t)||t,o=!(1<arguments.length&&void 0!==e)||e,a=!(2<arguments.length&&void 0!==i)||i,r=this.w,s=L.clone(r.globals.initialSeries);r.globals.previousPaths=[],a?(r.globals.collapsedSeries=[],r.globals.ancillaryCollapsedSeries=[],r.globals.collapsedSeriesIndices=[],r.globals.ancillaryCollapsedSeriesIndices=[]):s=this.emptyCollapsedSeries(s),r.config.series=s,n&&(o&&(r.globals.zoomed=!1,this.ctx.updateHelpers.revertDefaultAxisMinMax()),this.ctx.updateHelpers._updateSeries(s,r.config.chart.animations.dynamicAnimation.enabled))}},{key:"emptyCollapsedSeries",value:function(t){for(var e=this.w,i=0;i<t.length;i++)-1<e.globals.collapsedSeriesIndices.indexOf(i)&&(t[i].data=[]);return t}},{key:"toggleSeriesOnHover",value:function(t,e){var i=this.w,n=i.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels");if("mousemove"===t.type){var o=parseInt(e.getAttribute("rel"),10)-1,a=null,r=null;i.globals.axisCharts||"radialBar"===i.config.chart.type?i.globals.axisCharts?(a=i.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(o,"']")),r=i.globals.dom.baseEl.querySelector(".apexcharts-datalabels[data\\:realIndex='".concat(o,"']"))):a=i.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(1+o,"']")):a=i.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(1+o,"'] path"));for(var s=0;s<n.length;s++)n[s].classList.add(this.legendInactiveClass);null!==a&&(i.globals.axisCharts||a.parentNode.classList.remove(this.legendInactiveClass),a.classList.remove(this.legendInactiveClass),null!==r&&r.classList.remove(this.legendInactiveClass))}else if("mouseout"===t.type)for(var l=0;l<n.length;l++)n[l].classList.remove(this.legendInactiveClass)}},{key:"highlightRangeInSeries",value:function(t,e){function i(t){for(var e=0;e<r.length;e++)r[e].classList[t](o.legendInactiveClass)}var n,o=this,a=this.w,r=a.globals.dom.baseEl.getElementsByClassName("apexcharts-heatmap-rect");"mousemove"===t.type?(n=parseInt(e.getAttribute("rel"),10)-1,i("add"),function(t){for(var e=0;e<r.length;e++){var i=parseInt(r[e].getAttribute("val"),10);i>=t.from&&i<=t.to&&r[e].classList.remove(o.legendInactiveClass)}}(a.config.plotOptions.heatmap.colorScale.ranges[n])):"mouseout"===t.type&&i("remove")}},{key:"getActiveConfigSeriesIndex",value:function(t){var n=0<arguments.length&&void 0!==t&&t,o=this.w,e=0;if(1<o.config.series.length)for(var i=o.config.series.map(function(t,e){var i=!1;return n&&(i="bar"===o.config.series[e].type||"column"===o.config.series[e].type),t.data&&0<t.data.length&&!i?e:-1}),a=0;a<i.length;a++)if(-1!==i[a]){e=i[a];break}return e}},{key:"getPreviousPaths",value:function(){var s=this.w;s.globals.previousPaths=[],["line","area","bar","candlestick","radar"].forEach(function(t){for(var e=s.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(t,"-series .apexcharts-series")),i=0;i<e.length;i++)!function(t,e,i){for(var n,o=t[e].childNodes,a={type:i,paths:[],realIndex:t[e].getAttribute("data:realIndex")},r=0;r<o.length;r++)o[r].hasAttribute("pathTo")&&(n=o[r].getAttribute("pathTo"),a.paths.push({d:n}));s.globals.previousPaths.push(a)}(e,i,t)}),this.handlePrevBubbleScatterPaths("bubble"),this.handlePrevBubbleScatterPaths("scatter");var t=s.globals.dom.baseEl.querySelectorAll(".apexcharts-heatmap .apexcharts-series");if(0<t.length)for(var e=0;e<t.length;e++){for(var i=s.globals.dom.baseEl.querySelectorAll(".apexcharts-heatmap .apexcharts-series[data\\:realIndex='".concat(e,"'] rect")),n=[],o=0;o<i.length;o++)n.push({color:i[o].getAttribute("color")});s.globals.previousPaths.push(n)}s.globals.axisCharts||(s.globals.previousPaths=s.globals.series)}},{key:"handlePrevBubbleScatterPaths",value:function(t){var e=this.w,i=e.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(t,"-series .apexcharts-series"));if(0<i.length)for(var n=0;n<i.length;n++){for(var o=e.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(t,"-series .apexcharts-series[data\\:realIndex='").concat(n,"'] circle")),a=[],r=0;r<o.length;r++)a.push({x:o[r].getAttribute("cx"),y:o[r].getAttribute("cy"),r:o[r].getAttribute("r")});e.globals.previousPaths.push(a)}}},{key:"clearPreviousPaths",value:function(){var t=this.w;t.globals.previousPaths=[],t.globals.allSeriesCollapsed=!1}},{key:"handleNoData",value:function(){var t,e=this.w,i=e.config.noData,n=new M(this.ctx),o=e.globals.svgWidth/2,a=e.globals.svgHeight/2,r="middle";e.globals.noData=!0,e.globals.animationEnded=!0,"left"===i.align?(o=10,r="start"):"right"===i.align&&(o=e.globals.svgWidth-10,r="end"),"top"===i.verticalAlign?a=50:"bottom"===i.verticalAlign&&(a=e.globals.svgHeight-50),o+=i.offsetX,a=a+parseInt(i.style.fontSize,10)+2+i.offsetY,void 0!==i.text&&""!==i.text&&(t=n.drawText({x:o,y:a,text:i.text,textAnchor:r,fontSize:i.style.fontSize,fontFamily:i.style.fontFamily,foreColor:i.style.color,opacity:1,class:"apexcharts-text-nodata"}),e.globals.dom.Paper.add(t))}},{key:"setNullSeriesToZeroValues",value:function(t){for(var e=this.w,i=0;i<t.length;i++)if(0===t[i].length)for(var n=0;n<t[e.globals.maxValsInArrayIndex].length;n++)t[i].push(0);return t}},{key:"hasAllSeriesEqualX",value:function(){for(var t=!0,e=this.w,i=this.filteredSeriesX(),n=0;n<i.length-1;n++)if(i[n][0]!==i[n+1][0]){t=!1;break}return e.globals.allSeriesHasEqualX=t}},{key:"filteredSeriesX",value:function(){return this.w.globals.seriesX.map(function(t){return 0<t.length?t:[]})}}]),Ie),X=(r(Ne,[{key:"initVariables",value:function(t){var e=this.w;this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(var i=0;i<t.length;i++)if(0<t[i].length&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[i].length),e.globals.isXNumeric)for(var n=0;n<t[i].length;n++)e.globals.seriesX[i][n]>e.globals.minX&&e.globals.seriesX[i][n]<e.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=e.globals.dataPoints;0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1)}},{key:"initialPositions",value:function(){var t,e,i,n,o,a,r,s,l,c=this.w,h=c.globals.dataPoints;return this.barCtx.isTimelineBar&&(h=c.globals.labels.length),this.barCtx.isHorizontal?(n=(i=c.globals.gridHeight/h)/this.barCtx.seriesLen,c.globals.isXNumeric&&(n=(i=c.globals.gridHeight/this.barCtx.totalItems)/this.barCtx.seriesLen),n=n*parseInt(this.barCtx.barOptions.barHeight,10)/100,r=this.barCtx.baseLineInvertedY+c.globals.padHorizontal+(this.barCtx.isReversed?c.globals.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),e=(i-n*this.barCtx.seriesLen)/2):(l=c.globals.gridWidth/this.barCtx.visibleItems,c.config.xaxis.convertedCatToNumeric&&(l=c.globals.gridWidth/c.globals.dataPoints),o=l/this.barCtx.seriesLen*parseInt(this.barCtx.barOptions.columnWidth,10)/100,c.globals.isXNumeric&&(s=this.barCtx.xRatio,c.config.xaxis.convertedCatToNumeric&&(s=this.barCtx.initialXRatio),c.globals.minXDiff&&.5!==c.globals.minXDiff&&0<c.globals.minXDiff/s&&(l=c.globals.minXDiff/s),(o=l/this.barCtx.seriesLen*parseInt(this.barCtx.barOptions.columnWidth,10)/100)<1&&(o=1)),a=c.globals.gridHeight-this.barCtx.baseLineY[this.barCtx.yaxisIndex]-(this.barCtx.isReversed?c.globals.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.yaxisIndex]:0),t=c.globals.padHorizontal+(l-o*this.barCtx.seriesLen)/2),{x:t,y:e,yDivision:i,xDivision:l,barHeight:n,barWidth:o,zeroH:a,zeroW:r}}},{key:"getPathFillColor",value:function(e,i,n,t){var o=this.w,a=new R(this.barCtx.ctx),r=null,s=this.barCtx.barOptions.distributed?n:i;return 0<this.barCtx.barOptions.colors.ranges.length&&this.barCtx.barOptions.colors.ranges.map(function(t){e[i][n]>=t.from&&e[i][n]<=t.to&&(r=t.color)}),o.config.series[i].data[n]&&o.config.series[i].data[n].fillColor&&(r=o.config.series[i].data[n].fillColor),a.fillPath({seriesNumber:this.barCtx.barOptions.distributed?s:t,dataPointIndex:n,color:r,value:e[i][n]})}},{key:"getStrokeWidth",value:function(t,e,i){var n=0,o=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,o.config.stroke.show&&(this.barCtx.isNullValue||(n=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[i]:this.barCtx.strokeWidth)),n}},{key:"barBackground",value:function(t){var e,i,n=t.j,o=t.i,a=t.x1,r=t.x2,s=t.y1,l=t.y2,c=t.elSeries,h=this.w,u=new M(this.barCtx.ctx),d=new H(this.barCtx.ctx).getActiveConfigSeriesIndex();0<this.barCtx.barOptions.colors.backgroundBarColors.length&&d===o&&(n>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(n-=this.barCtx.barOptions.colors.backgroundBarColors.length),e=this.barCtx.barOptions.colors.backgroundBarColors[n],i=u.drawRect(void 0!==a?a:0,void 0!==s?s:0,void 0!==r?r:h.globals.gridWidth,void 0!==l?l:h.globals.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity),c.add(i),i.node.classList.add("apexcharts-backgroundBar"))}},{key:"getColumnPaths",value:function(t){var e=t.barWidth,i=t.barXPosition,n=t.yRatio,o=t.y1,a=t.y2,r=t.strokeWidth,s=t.series,l=t.realIndex,c=t.i,h=t.j,u=t.w,d=new M(this.barCtx.ctx);(r=Array.isArray(r)?r[l]:r)||(r=0);var f={barWidth:e,strokeWidth:r,yRatio:n,barXPosition:i,y1:o,y2:a},p=this.getRoundedBars(u,f,s,c,h),g=i,v=i+e,m=d.move(g,p.y1),b=d.move(g,p.y1);return 0<u.globals.previousPaths.length&&(b=this.barCtx.getPreviousPath(l,h,!1)),{pathTo:m=m+d.line(g,p.y2)+p.endingPath+d.line(v-r,p.y2)+d.line(v-r,p.y1)+p.startingPath+"z",pathFrom:b=b+d.line(g,o)+d.line(v-r,o)+d.line(v-r,o)+d.line(v-r,o)+d.line(g,o)}}},{key:"getBarpaths",value:function(t){var e=t.barYPosition,i=t.barHeight,n=t.x1,o=t.x2,a=t.strokeWidth,r=t.series,s=t.realIndex,l=t.i,c=t.j,h=t.w,u=new M(this.barCtx.ctx);(a=Array.isArray(a)?a[s]:a)||(a=0);var d={barHeight:i,strokeWidth:a,barYPosition:e,x2:o,x1:n},f=this.getRoundedBars(h,d,r,l,c),p=u.move(f.x1,e),g=u.move(f.x1,e);0<h.globals.previousPaths.length&&(g=this.barCtx.getPreviousPath(s,c,!1));var v=e,m=e+i;return{pathTo:p=p+u.line(f.x2,v)+f.endingPath+u.line(f.x2,m-a)+u.line(f.x1,m-a)+f.startingPath+"z",pathFrom:g=g+u.line(n,v)+u.line(n,m-a)+u.line(n,m-a)+u.line(n,m-a)+u.line(n,v)}}},{key:"getRoundedBars",value:function(t,e,i,n,o){var a=new M(this.barCtx.ctx),r=(r=Array.isArray(e.strokeWidth)?e.strokeWidth[n]:e.strokeWidth)||0;if(this.barCtx.isHorizontal){var s=null,l="",c=e.x2,h=e.x1;if(void 0!==i[n][o]||null!==i[n][o]){var u=i[n][o]<0,d=e.barHeight/2-r;switch(u&&(d=-e.barHeight/2-r),d>Math.abs(c-h)&&(d=Math.abs(c-h)),"rounded"===this.barCtx.barOptions.endingShape&&(c=e.x2-d/2),"rounded"===this.barCtx.barOptions.startingShape&&(h=e.x1+d/2),this.barCtx.barOptions.endingShape){case"flat":s=a.line(c,e.barYPosition+e.barHeight-r);break;case"rounded":s=a.quadraticCurve(c+d,e.barYPosition+(e.barHeight-r)/2,c,e.barYPosition+e.barHeight-r)}switch(this.barCtx.barOptions.startingShape){case"flat":l=a.line(h,e.barYPosition+e.barHeight-r);break;case"rounded":l=a.quadraticCurve(h-d,e.barYPosition+e.barHeight/2,h,e.barYPosition)}}return{endingPath:s,startingPath:l,x2:c,x1:h}}var f=null,p="",g=e.y2,v=e.y1;if(void 0!==i[n][o]||null!==i[n][o]){var m=i[n][o]<0,b=e.barWidth/2-r;switch(m&&(b=-e.barWidth/2-r),b>Math.abs(g-v)&&(b=Math.abs(g-v)),"rounded"===this.barCtx.barOptions.endingShape&&(g+=b/2),"rounded"===this.barCtx.barOptions.startingShape&&(v-=b/2),this.barCtx.barOptions.endingShape){case"flat":f=a.line(e.barXPosition+e.barWidth-r,g);break;case"rounded":f=a.quadraticCurve(e.barXPosition+(e.barWidth-r)/2,g-b,e.barXPosition+e.barWidth-r,g)}switch(this.barCtx.barOptions.startingShape){case"flat":p=a.line(e.barXPosition+e.barWidth-r,v);break;case"rounded":p=a.quadraticCurve(e.barXPosition+(e.barWidth-r)/2,v+b,e.barXPosition,v)}}return{endingPath:f,startingPath:p,y2:g,y1:v}}}]),Ne),Y=(r(Pe,[{key:"draw",value:function(t,e){var i=this.w,n=new M(this.ctx),o=new E(this.ctx,i);t=o.getLogSeries(t),this.series=t,this.yRatio=o.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);var a=n.group({class:"apexcharts-bar-series apexcharts-plot-series"});i.config.dataLabels.enabled&&this.totalItems>this.barOptions.dataLabels.maxItems&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering.");for(var r=0,s=0;r<t.length;r++,s++){var l=void 0,c=void 0,h=[],u=[],d=i.globals.comboCharts?e[r]:r,f=n.group({class:"apexcharts-series",rel:r+1,seriesName:L.escapeString(i.globals.seriesNames[d]),"data:realIndex":d});this.ctx.series.addCollapsedClassToSeries(f,d),0<t[r].length&&(this.visibleI=this.visibleI+1);var p=0,g=0;1<this.yRatio.length&&(this.yaxisIndex=d),this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed;var v=this.barHelpers.initialPositions(),c=v.y,p=v.barHeight,m=v.yDivision,b=v.zeroW,l=v.x,g=v.barWidth,y=v.xDivision,x=v.zeroH;this.horizontal||u.push(l+g/2);for(var w=n.group({class:"apexcharts-datalabels","data:realIndex":d}),k=0;k<i.globals.dataPoints;k++){var C=this.barHelpers.getStrokeWidth(r,k,d),A=null,S={indexes:{i:r,j:k,realIndex:d,bc:s},x:l,y:c,strokeWidth:C,elSeries:f};this.isHorizontal?(A=this.drawBarPaths(P(P({},S),{},{barHeight:p,zeroW:b,yDivision:m})),g=this.series[r][k]/this.invertedYRatio):(A=this.drawColumnPaths(P(P({},S),{},{xDivision:y,barWidth:g,zeroH:x})),p=this.series[r][k]/this.yRatio[this.yaxisIndex]),c=A.y,l=A.x,0<k&&u.push(l+g/2),h.push(c);var T=this.barHelpers.getPathFillColor(t,r,k,d);this.renderSeries({realIndex:d,pathFill:T,j:k,i:r,pathFrom:A.pathFrom,pathTo:A.pathTo,strokeWidth:C,elSeries:f,x:l,y:c,series:t,barHeight:p,barWidth:g,elDataLabelsWrap:w,visibleSeries:this.visibleI,type:"bar"})}i.globals.seriesXvalues[d]=u,i.globals.seriesYvalues[d]=h,a.add(f)}return a}},{key:"renderSeries",value:function(t){var e=t.realIndex,i=t.pathFill,n=t.lineFill,o=t.j,a=t.i,r=t.pathFrom,s=t.pathTo,l=t.strokeWidth,c=t.elSeries,h=t.x,u=t.y,d=t.y1,f=t.y2,p=t.series,g=t.barHeight,v=t.barWidth,m=t.barYPosition,b=t.elDataLabelsWrap,y=t.visibleSeries,x=t.type,w=this.w,k=new M(this.ctx),n=n||(this.barOptions.distributed?w.globals.stroke.colors[o]:w.globals.stroke.colors[e]);w.config.series[a].data[o]&&w.config.series[a].data[o].strokeColor&&(n=w.config.series[a].data[o].strokeColor),this.isNullValue&&(i="none");var C=o/w.config.chart.animations.animateGradually.delay*(w.config.chart.animations.speed/w.globals.dataPoints)/2.4,A=k.renderPaths({i:a,j:o,realIndex:e,pathFrom:r,pathTo:s,stroke:n,strokeWidth:l,strokeLineCap:w.config.stroke.lineCap,fill:i,animationDelay:C,initialSpeed:w.config.chart.animations.speed,dataChangeSpeed:w.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(x,"-area")});A.attr("clip-path","url(#gridRectMask".concat(w.globals.cuid,")")),void 0!==d&&void 0!==f&&(A.attr("data-range-y1",d),A.attr("data-range-y2",f)),new N(this.ctx).setSelectionFilter(A,e,o),c.add(A);var S=new F(this).handleBarDataLabels({x:h,y:u,y1:d,y2:f,i:a,j:o,series:p,realIndex:e,barHeight:g,barWidth:v,barYPosition:m,renderedPath:A,visibleSeries:y});return null!==S&&b.add(S),c.add(b),c}},{key:"drawBarPaths",value:function(t){var e=t.indexes,i=t.barHeight,n=t.strokeWidth,o=t.zeroW,a=t.x,r=t.y,s=t.yDivision,l=t.elSeries,c=this.w,h=e.i,u=e.j;c.globals.isXNumeric&&(r=(c.globals.seriesX[h][u]-c.globals.minX)/this.invertedXRatio-i);var d=r+i*this.visibleI,a=void 0===this.series[h][u]||null===this.series[h][u]?o:o+this.series[h][u]/this.invertedYRatio-2*(this.isReversed?this.series[h][u]/this.invertedYRatio:0),f=this.barHelpers.getBarpaths({barYPosition:d,barHeight:i,x1:o,x2:a,strokeWidth:n,series:this.series,realIndex:e.realIndex,i:h,j:u,w:c});return c.globals.isXNumeric||(r+=s),this.barHelpers.barBackground({j:u,i:h,y1:d-i*this.visibleI,y2:i*this.seriesLen,elSeries:l}),{pathTo:f.pathTo,pathFrom:f.pathFrom,x:a,y:r,barYPosition:d}}},{key:"drawColumnPaths",value:function(t){var e,i=t.indexes,n=t.x,o=t.y,a=t.xDivision,r=t.barWidth,s=t.zeroH,l=t.strokeWidth,c=t.elSeries,h=this.w,u=i.i,d=i.j,f=i.bc;h.globals.isXNumeric&&(e=u,h.globals.seriesX[u].length||(e=h.globals.maxValsInArrayIndex),n=(h.globals.seriesX[e][d]-h.globals.minX)/this.xRatio-r*this.seriesLen/2);var p=n+r*this.visibleI,o=void 0===this.series[u][d]||null===this.series[u][d]?s:s-this.series[u][d]/this.yRatio[this.yaxisIndex]+2*(this.isReversed?this.series[u][d]/this.yRatio[this.yaxisIndex]:0),g=this.barHelpers.getColumnPaths({barXPosition:p,barWidth:r,y1:s,y2:o,strokeWidth:l,series:this.series,realIndex:i.realIndex,i:u,j:d,w:h});return h.globals.isXNumeric||(n+=a),this.barHelpers.barBackground({bc:f,j:d,i:u,x1:p-l/2-r*this.visibleI,x2:r*this.seriesLen+l/2,elSeries:c}),{pathTo:g.pathTo,pathFrom:g.pathFrom,x:n,y:o,barXPosition:p}}},{key:"getPreviousPath",value:function(t,e){for(var i,n=this.w,o=0;o<n.globals.previousPaths.length;o++){var a=n.globals.previousPaths[o];a.paths&&0<a.paths.length&&parseInt(a.realIndex,10)===parseInt(t,10)&&void 0!==n.globals.previousPaths[o].paths[e]&&(i=n.globals.previousPaths[o].paths[e].d)}return i}}]),Pe),q=(r(Le,[{key:"isValidDate",value:function(t){return!isNaN(this.parseDate(t))}},{key:"getTimeStamp",value:function(t){return Date.parse(t)?this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(t).toISOString().substr(0,25)).getTime():new Date(t).getTime():t}},{key:"getDate",value:function(t){return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(t).toUTCString()):new Date(t)}},{key:"parseDate",value:function(t){var e=Date.parse(t);if(!isNaN(e))return this.getTimeStamp(t);var i=Date.parse(t.replace(/-/g,"/").replace(/[a-z]+/gi," "));return this.getTimeStamp(i)}},{key:"parseDateWithTimezone",value:function(t){return Date.parse(t.replace(/-/g,"/").replace(/[a-z]+/gi," "))}},{key:"formatDate",value:function(t,e){var i=this.w.globals.locale,n=this.w.config.xaxis.labels.datetimeUTC,o=["\0"].concat(C(i.months)),a=[""].concat(C(i.shortMonths)),r=[""].concat(C(i.days)),s=[""].concat(C(i.shortDays));function l(t,e){var i=t+"";for(e=e||2;i.length<e;)i="0"+i;return i}var c=n?t.getUTCFullYear():t.getFullYear();e=(e=(e=e.replace(/(^|[^\\])yyyy+/g,"$1"+c)).replace(/(^|[^\\])yy/g,"$1"+c.toString().substr(2,2))).replace(/(^|[^\\])y/g,"$1"+c);var h=(n?t.getUTCMonth():t.getMonth())+1;e=(e=(e=(e=e.replace(/(^|[^\\])MMMM+/g,"$1"+o[0])).replace(/(^|[^\\])MMM/g,"$1"+a[0])).replace(/(^|[^\\])MM/g,"$1"+l(h))).replace(/(^|[^\\])M/g,"$1"+h);var u=n?t.getUTCDate():t.getDate();e=(e=(e=(e=e.replace(/(^|[^\\])dddd+/g,"$1"+r[0])).replace(/(^|[^\\])ddd/g,"$1"+s[0])).replace(/(^|[^\\])dd/g,"$1"+l(u))).replace(/(^|[^\\])d/g,"$1"+u);var d=n?t.getUTCHours():t.getHours(),f=12<d?d-12:0===d?12:d;e=(e=(e=(e=e.replace(/(^|[^\\])HH+/g,"$1"+l(d))).replace(/(^|[^\\])H/g,"$1"+d)).replace(/(^|[^\\])hh+/g,"$1"+l(f))).replace(/(^|[^\\])h/g,"$1"+f);var p=n?t.getUTCMinutes():t.getMinutes();e=(e=e.replace(/(^|[^\\])mm+/g,"$1"+l(p))).replace(/(^|[^\\])m/g,"$1"+p);var g=n?t.getUTCSeconds():t.getSeconds();e=(e=e.replace(/(^|[^\\])ss+/g,"$1"+l(g))).replace(/(^|[^\\])s/g,"$1"+g);var v=n?t.getUTCMilliseconds():t.getMilliseconds();e=e.replace(/(^|[^\\])fff+/g,"$1"+l(v,3)),v=Math.round(v/10),e=e.replace(/(^|[^\\])ff/g,"$1"+l(v)),v=Math.round(v/10);var m=d<12?"AM":"PM";e=(e=(e=e.replace(/(^|[^\\])f/g,"$1"+v)).replace(/(^|[^\\])TT+/g,"$1"+m)).replace(/(^|[^\\])T/g,"$1"+m.charAt(0));var b=m.toLowerCase();e=(e=e.replace(/(^|[^\\])tt+/g,"$1"+b)).replace(/(^|[^\\])t/g,"$1"+b.charAt(0));var y,x=-t.getTimezoneOffset(),w=n||!x?"Z":0<x?"+":"-";n||(y=(x=Math.abs(x))%60,w+=l(Math.floor(x/60))+":"+l(y)),e=e.replace(/(^|[^\\])K/g,"$1"+w);var k=(n?t.getUTCDay():t.getDay())+1;return(e=(e=(e=(e=e.replace(new RegExp(r[0],"g"),r[k])).replace(new RegExp(s[0],"g"),s[k])).replace(new RegExp(o[0],"g"),o[h])).replace(new RegExp(a[0],"g"),a[h])).replace(/\\(.)/g,"$1")}},{key:"getTimeUnitsfromTimestamp",value:function(t,e){var i=this.w;void 0!==i.config.xaxis.min&&(t=i.config.xaxis.min),void 0!==i.config.xaxis.max&&(e=i.config.xaxis.max);var n=this.getDate(t),o=this.getDate(e),a=this.formatDate(n,"yyyy MM dd HH mm").split(" "),r=this.formatDate(o,"yyyy MM dd HH mm").split(" ");return{minMinute:parseInt(a[4],10),maxMinute:parseInt(r[4],10),minHour:parseInt(a[3],10),maxHour:parseInt(r[3],10),minDate:parseInt(a[2],10),maxDate:parseInt(r[2],10),minMonth:parseInt(a[1],10)-1,maxMonth:parseInt(r[1],10)-1,minYear:parseInt(a[0],10),maxYear:parseInt(r[0],10)}}},{key:"isLeapYear",value:function(t){return t%4==0&&t%100!=0||t%400==0}},{key:"calculcateLastDaysOfMonth",value:function(t,e,i){return this.determineDaysOfMonths(t,e)-i}},{key:"determineDaysOfYear",value:function(t){var e=365;return this.isLeapYear(t)&&(e=366),e}},{key:"determineRemainingDaysOfYear",value:function(t,e,i){var n=this.daysCntOfYear[e]+i;return 1<e&&this.isLeapYear()&&n++,n}},{key:"determineDaysOfMonths",value:function(t,e){var i=30;switch(t=L.monthMod(t),!0){case-1<this.months30.indexOf(t):2===t&&(i=this.isLeapYear(e)?29:28);break;case-1<this.months31.indexOf(t):default:i=31}return i}}]),Le),W=function(){l(e,Y);var t=h(e);function e(){return a(this,e),t.apply(this,arguments)}return r(e,[{key:"draw",value:function(t,e){var i=this.w,n=new M(this.ctx);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=i.globals.seriesRangeStart,this.seriesRangeEnd=i.globals.seriesRangeEnd,this.barHelpers.initVariables(t);for(var o=n.group({class:"apexcharts-rangebar-series apexcharts-plot-series"}),a=0;a<t.length;a++){var r=void 0,s=void 0,l=void 0,c=i.globals.comboCharts?e[a]:a,h=n.group({class:"apexcharts-series",seriesName:L.escapeString(i.globals.seriesNames[c]),rel:a+1,"data:realIndex":c});0<t[a].length&&(this.visibleI=this.visibleI+1);var u=0,d=0;1<this.yRatio.length&&(this.yaxisIndex=c);for(var f=this.barHelpers.initialPositions(),s=f.y,p=f.zeroW,r=f.x,d=f.barWidth,g=f.xDivision,v=f.zeroH,m=n.group({class:"apexcharts-datalabels","data:realIndex":c}),b=0;b<i.globals.dataPoints;b++){var y=this.barHelpers.getStrokeWidth(a,b,c),x=this.seriesRangeStart[a][b],w=this.seriesRangeEnd[a][b],k=null,C=null,A={x:r,y:s,strokeWidth:y,elSeries:h},l=f.yDivision;if(u=f.barHeight,this.isHorizontal){C=s+u*this.visibleI;var S,T=(l-u*this.seriesLen)/2;if(void 0===i.config.series[a].data[b])break;this.isTimelineBar&&i.config.series[a].data[b].x&&(u=(S=this.detectOverlappingBars({i:a,j:b,barYPosition:C,srty:T,barHeight:u,yDivision:l,initPositions:f})).barHeight,C=S.barYPosition),d=(k=this.drawRangeBarPaths(P({indexes:{i:a,j:b,realIndex:c},barHeight:u,barYPosition:C,zeroW:p,yDivision:l,y1:x,y2:w},A))).barWidth}else u=(k=this.drawRangeColumnPaths(P({indexes:{i:a,j:b,realIndex:c},zeroH:v,barWidth:d,xDivision:g},A))).barHeight;s=k.y,r=k.x;var E=this.barHelpers.getPathFillColor(t,a,b,c),_=i.globals.stroke.colors[c];this.renderSeries({realIndex:c,pathFill:E,lineFill:_,j:b,i:a,x:r,y:s,y1:x,y2:w,pathFrom:k.pathFrom,pathTo:k.pathTo,strokeWidth:y,elSeries:h,series:t,barHeight:u,barYPosition:C,barWidth:d,elDataLabelsWrap:m,visibleSeries:this.visibleI,type:"rangebar"})}o.add(h)}return o}},{key:"detectOverlappingBars",value:function(t){var e=t.i,i=t.j,n=t.barYPosition,o=t.srty,a=t.barHeight,r=t.yDivision,s=t.initPositions,l=this.w,c=[],h=l.config.series[e].data[i].rangeName,u=l.config.series[e].data[i].x,d=l.globals.labels.indexOf(u),f=l.globals.seriesRangeBarTimeline[e].findIndex(function(t){return t.x===u&&0<t.overlaps.length}),n=o+a*this.visibleI+r*d;return-1<f&&!l.config.plotOptions.bar.rangeBarOverlap&&-1<(c=l.globals.seriesRangeBarTimeline[e][f].overlaps).indexOf(h)&&(n=(a=s.barHeight/c.length)*this.visibleI+r*(100-parseInt(this.barOptions.barHeight,10))/100/2+a*(this.visibleI+c.indexOf(h))+r*d),{barYPosition:n,barHeight:a}}},{key:"drawRangeColumnPaths",value:function(t){var e=t.indexes,i=t.x,n=(t.strokeWidth,t.xDivision),o=t.barWidth,a=t.zeroH,r=this.w,s=e.i,l=e.j,c=this.yRatio[this.yaxisIndex],h=e.realIndex,u=this.getRangeValue(h,l),d=Math.min(u.start,u.end),f=Math.max(u.start,u.end);r.globals.isXNumeric&&(i=(r.globals.seriesX[s][l]-r.globals.minX)/this.xRatio-o/2);var p=i+o*this.visibleI;void 0===this.series[s][l]||null===this.series[s][l]?d=a:(d=a-d/c,f=a-f/c);var g=Math.abs(f-d),v=this.barHelpers.getColumnPaths({barXPosition:p,barWidth:o,y1:d,y2:f,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,j:l,w:r});return r.globals.isXNumeric||(i+=n),{pathTo:v.pathTo,pathFrom:v.pathFrom,barHeight:g,x:i,y:f,barXPosition:p}}},{key:"drawRangeBarPaths",value:function(t){var e=t.indexes,i=t.y,n=t.y1,o=t.y2,a=t.yDivision,r=t.barHeight,s=t.barYPosition,l=t.zeroW,c=this.w,h=l+n/this.invertedYRatio,u=l+o/this.invertedYRatio,d=Math.abs(u-h),f=this.barHelpers.getBarpaths({barYPosition:s,barHeight:r,x1:h,x2:u,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:e.realIndex,j:e.j,w:c});return c.globals.isXNumeric||(i+=a),{pathTo:f.pathTo,pathFrom:f.pathFrom,barWidth:d,x:u,y:i}}},{key:"getRangeValue",value:function(t,e){var i=this.w;return{start:i.globals.seriesRangeStart[t][e],end:i.globals.seriesRangeEnd[t][e]}}},{key:"getTooltipValues",value:function(t){var e=t.ctx,i=t.seriesIndex,n=t.dataPointIndex,o=t.y1,a=t.y2,r=t.w,s=r.globals.seriesRangeStart[i][n],l=r.globals.seriesRangeEnd[i][n],c=r.globals.labels[n],h=r.config.series[i].name,u=r.config.tooltip.y.formatter,d=r.config.tooltip.y.title.formatter,f={w:r,seriesIndex:i,dataPointIndex:n};"function"==typeof d&&(h=d(h,f)),o&&a&&(s=o,l=a,r.config.series[i].data[n].x&&(c=r.config.series[i].data[n].x+":"),"function"==typeof u&&(c=u(c,f)));var p,g="",v="",m=r.globals.colors[i];return v=void 0===r.config.tooltip.x.formatter?"datetime"===r.config.xaxis.type?(g=(p=new q(e)).formatDate(p.getDate(s),r.config.tooltip.x.format),p.formatDate(p.getDate(l),r.config.tooltip.x.format)):(g=s,l):(g=r.config.tooltip.x.formatter(s),r.config.tooltip.x.formatter(l)),{start:s,end:l,startVal:g,endVal:v,ylabel:c,color:m,seriesName:h}}},{key:"buildCustomTooltipHTML",value:function(t){return'<div class="apexcharts-tooltip-rangebar"><div> <span class="series-name" style="color: '+t.color+'">'+(t.seriesName||"")+'</span></div><div> <span class="category">'+t.ylabel+' </span> <span class="value start-value">'+t.start+'</span> <span class="separator">-</span> <span class="value end-value">'+t.end+"</span></div></div>"}}]),e}(),$=(r(Oe,[{key:"line",value:function(){return{chart:{animations:{easing:"swing"}},dataLabels:{enabled:!1},stroke:{width:5,curve:"straight"},markers:{size:0,hover:{sizeOffset:6}},xaxis:{crosshairs:{width:1}}}}},{key:"sparkline",value:function(t){return this.opts.yaxis[0].show=!1,this.opts.yaxis[0].title.text="",this.opts.yaxis[0].axisBorder.show=!1,this.opts.yaxis[0].axisTicks.show=!1,this.opts.yaxis[0].floating=!0,L.extend(t,{grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},legend:{show:!1},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}},chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1}})}},{key:"bar",value:function(){return{chart:{stacked:!1,animations:{easing:"swing"}},plotOptions:{bar:{dataLabels:{position:"center"}}},dataLabels:{style:{colors:["#fff"]},background:{enabled:!1}},stroke:{width:0,lineCap:"square"},fill:{opacity:.85},legend:{markers:{shape:"square",radius:2,size:8}},tooltip:{shared:!1},xaxis:{tooltip:{enabled:!1},tickPlacement:"between",crosshairs:{width:"barWidth",position:"back",fill:{type:"gradient"},dropShadow:{enabled:!1},stroke:{width:0}}}}}},{key:"candlestick",value:function(){return{stroke:{width:1,colors:["#333"]},fill:{opacity:1},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:function(t){var e=t.seriesIndex,i=t.dataPointIndex,n=t.w;return'<div class="apexcharts-tooltip-candlestick"><div>Open: <span class="value">'+n.globals.seriesCandleO[e][i]+'</span></div><div>High: <span class="value">'+n.globals.seriesCandleH[e][i]+'</span></div><div>Low: <span class="value">'+n.globals.seriesCandleL[e][i]+'</span></div><div>Close: <span class="value">'+n.globals.seriesCandleC[e][i]+"</span></div></div>"}},states:{active:{filter:{type:"none"}}},xaxis:{crosshairs:{width:1}}}}},{key:"rangeBar",value:function(){return{stroke:{width:0,lineCap:"square"},plotOptions:{bar:{dataLabels:{position:"center"}}},dataLabels:{enabled:!1,formatter:function(t,e){e.ctx;var i=e.seriesIndex,n=e.dataPointIndex,o=e.w,a=o.globals.seriesRangeStart[i][n];return o.globals.seriesRangeEnd[i][n]-a},background:{enabled:!1},style:{colors:["#fff"]}},tooltip:{shared:!1,followCursor:!0,custom:function(t){return t.w.config.plotOptions&&t.w.config.plotOptions.bar&&t.w.config.plotOptions.bar.horizontal?(h=new W((c=t).ctx,null),u=h.getTooltipValues(c),d=u.color,f=u.seriesName,p=u.ylabel,g=u.startVal,v=u.endVal,h.buildCustomTooltipHTML({color:d,seriesName:f,ylabel:p,start:g,end:v})):(i=new W((e=t).ctx,null),n=i.getTooltipValues(e),o=n.color,a=n.seriesName,r=n.ylabel,s=n.start,l=n.end,i.buildCustomTooltipHTML({color:o,seriesName:a,ylabel:r,start:s,end:l}));var e,i,n,o,a,r,s,l,c,h,u,d,f,p,g,v}},xaxis:{tickPlacement:"between",tooltip:{enabled:!1},crosshairs:{stroke:{width:0}}}}}},{key:"area",value:function(){return{stroke:{width:4},fill:{type:"gradient",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}},markers:{size:0,hover:{sizeOffset:6}},tooltip:{followCursor:!1}}}},{key:"brush",value:function(t){return L.extend(t,{chart:{toolbar:{autoSelected:"selection",show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1},stroke:{width:1},tooltip:{enabled:!1},xaxis:{tooltip:{enabled:!1}}})}},{key:"stacked100",value:function(i){i.dataLabels=i.dataLabels||{},i.dataLabels.formatter=i.dataLabels.formatter||void 0;var t=i.dataLabels.formatter;return i.yaxis.forEach(function(t,e){i.yaxis[e].min=0,i.yaxis[e].max=100}),"bar"===i.chart.type&&(i.dataLabels.formatter=t||function(t){return"number"==typeof t&&t?t.toFixed(0)+"%":t}),i}},{key:"convertCatToNumeric",value:function(t){return t.xaxis.convertedCatToNumeric=!0,t}},{key:"convertCatToNumericXaxis",value:function(t,e,i){t.xaxis.type="numeric",t.xaxis.labels=t.xaxis.labels||{},t.xaxis.labels.formatter=t.xaxis.labels.formatter||function(t){return L.isNumber(t)?Math.floor(t):t};var n=t.xaxis.labels.formatter,o=t.xaxis.categories&&t.xaxis.categories.length?t.xaxis.categories:t.labels;return i&&i.length&&(o=i.map(function(t){return t.toString()})),o&&o.length&&(t.xaxis.labels.formatter=function(t){return L.isNumber(t)?n(o[Math.floor(t)-1]):n(t)}),t.xaxis.categories=[],t.labels=[],t.xaxis.tickAmount=t.xaxis.tickAmount||"dataPoints",t}},{key:"bubble",value:function(){return{dataLabels:{style:{colors:["#fff"]}},tooltip:{shared:!1,intersect:!0},xaxis:{crosshairs:{width:0}},fill:{type:"solid",gradient:{shade:"light",inverse:!0,shadeIntensity:.55,opacityFrom:.4,opacityTo:.8}}}}},{key:"scatter",value:function(){return{dataLabels:{enabled:!1},tooltip:{shared:!1,intersect:!0},markers:{size:6,strokeWidth:1,hover:{sizeOffset:2}}}}},{key:"heatmap",value:function(){return{chart:{stacked:!1},fill:{opacity:1},dataLabels:{style:{colors:["#fff"]}},stroke:{colors:["#fff"]},tooltip:{followCursor:!0,marker:{show:!1},x:{show:!1}},legend:{position:"top",markers:{shape:"square",size:10,offsetY:2}},grid:{padding:{right:20}}}}},{key:"pie",value:function(){return{chart:{toolbar:{show:!1}},plotOptions:{pie:{donut:{labels:{show:!1}}}},dataLabels:{formatter:function(t){return t.toFixed(1)+"%"},style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",stops:[0,100]}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"}}}},{key:"donut",value:function(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(t){return t.toFixed(1)+"%"},style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",shadeIntensity:.35,stops:[80,100],opacityFrom:1,opacityTo:1}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"}}}},{key:"polarArea",value:function(){return this.opts.yaxis[0].tickAmount=this.opts.yaxis[0].tickAmount?this.opts.yaxis[0].tickAmount:6,{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(t){return t.toFixed(1)+"%"},enabled:!1},stroke:{show:!0,width:2},fill:{opacity:.7},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"}}}},{key:"radar",value:function(){return this.opts.yaxis[0].labels.offsetY=this.opts.yaxis[0].labels.offsetY?this.opts.yaxis[0].labels.offsetY:6,{dataLabels:{enabled:!1,style:{fontSize:"11px"}},stroke:{width:2},markers:{size:3,strokeWidth:1,strokeOpacity:1},fill:{opacity:.2},tooltip:{shared:!1,intersect:!0,followCursor:!0},grid:{show:!1},xaxis:{labels:{formatter:function(t){return t},style:{colors:["#a8a8a8"],fontSize:"11px"}},tooltip:{enabled:!1},crosshairs:{show:!1}}}}},{key:"radialBar",value:function(){return{chart:{animations:{dynamicAnimation:{enabled:!0,speed:800}},toolbar:{show:!1}},fill:{gradient:{shade:"dark",shadeIntensity:.4,inverseColors:!1,type:"diagonal2",opacityFrom:1,opacityTo:1,stops:[70,98,100]}},legend:{show:!1,position:"right"},tooltip:{enabled:!1,fillSeriesColor:!0}}}}]),Oe),V=(r(_e,[{key:"init",value:function(t){var e=t.responsiveOverride,i=this.opts,n=new O,o=new $(i);this.chartType=i.chart.type,"histogram"===this.chartType&&(i.chart.type="bar",i=L.extend({plotOptions:{bar:{columnWidth:"99.99%"}}},i)),i=this.extendYAxis(i),i=this.extendAnnotations(i);var a,r=n.init(),s={};i&&"object"===y(i)&&(a={},a=-1!==["line","area","bar","candlestick","rangeBar","histogram","bubble","scatter","heatmap","pie","polarArea","donut","radar","radialBar"].indexOf(i.chart.type)?o[i.chart.type]():o.line(),i.chart.brush&&i.chart.brush.enabled&&(a=o.brush(a)),i.chart.stacked&&"100%"===i.chart.stackType&&(i=o.stacked100(i)),this.checkForDarkTheme(window.Apex),this.checkForDarkTheme(i),i.xaxis=i.xaxis||window.Apex.xaxis||{},e||(i.xaxis.convertedCatToNumeric=!1),((i=this.checkForCatToNumericXAxis(this.chartType,a,i)).chart.sparkline&&i.chart.sparkline.enabled||window.Apex.chart&&window.Apex.chart.sparkline&&window.Apex.chart.sparkline.enabled)&&(a=o.sparkline(a)),s=L.extend(r,a));var l=L.extend(s,window.Apex),r=L.extend(l,i);return this.handleUserInputErrors(r)}},{key:"checkForCatToNumericXAxis",value:function(t,e,i){var n=new $(i),o="bar"===t&&i.plotOptions&&i.plotOptions.bar&&i.plotOptions.bar.horizontal,a="pie"===t||"polarArea"===t||"donut"===t||"radar"===t||"radialBar"===t||"heatmap"===t,r="datetime"!==i.xaxis.type&&"numeric"!==i.xaxis.type,s=i.xaxis.tickPlacement?i.xaxis.tickPlacement:e.xaxis&&e.xaxis.tickPlacement;return o||a||!r||"between"===s||(i=n.convertCatToNumeric(i)),i}},{key:"extendYAxis",value:function(n,t){var o=new O;(void 0===n.yaxis||!n.yaxis||Array.isArray(n.yaxis)&&0===n.yaxis.length)&&(n.yaxis={}),n.yaxis.constructor!==Array&&window.Apex.yaxis&&window.Apex.yaxis.constructor!==Array&&(n.yaxis=L.extend(n.yaxis,window.Apex.yaxis)),n.yaxis.constructor!==Array?n.yaxis=[L.extend(o.yAxis,n.yaxis)]:n.yaxis=L.extendArray(n.yaxis,o.yAxis);var e=!1;n.yaxis.forEach(function(t){t.logarithmic&&(e=!0)});var a=n.series;return t&&!a&&(a=t.config.series),e&&a.length!==n.yaxis.length&&a.length&&(n.yaxis=a.map(function(t,e){if(t.name||(a[e].name="series-".concat(e+1)),n.yaxis[e])return n.yaxis[e].seriesName=a[e].name,n.yaxis[e];var i=L.extend(o.yAxis,n.yaxis[0]);return i.show=!1,i})),e&&1<a.length&&a.length!==n.yaxis.length&&console.warn("A multi-series logarithmic chart should have equal number of series and y-axes. Please make sure to equalize both."),n}},{key:"extendAnnotations",value:function(t){return void 0===t.annotations&&(t.annotations={},t.annotations.yaxis=[],t.annotations.xaxis=[],t.annotations.points=[]),t=this.extendYAxisAnnotations(t),t=this.extendXAxisAnnotations(t),this.extendPointAnnotations(t)}},{key:"extendYAxisAnnotations",value:function(t){var e=new O;return t.annotations.yaxis=L.extendArray(void 0!==t.annotations.yaxis?t.annotations.yaxis:[],e.yAxisAnnotation),t}},{key:"extendXAxisAnnotations",value:function(t){var e=new O;return t.annotations.xaxis=L.extendArray(void 0!==t.annotations.xaxis?t.annotations.xaxis:[],e.xAxisAnnotation),t}},{key:"extendPointAnnotations",value:function(t){var e=new O;return t.annotations.points=L.extendArray(void 0!==t.annotations.points?t.annotations.points:[],e.pointAnnotation),t}},{key:"checkForDarkTheme",value:function(t){t.theme&&"dark"===t.theme.mode&&(t.tooltip||(t.tooltip={}),"light"!==t.tooltip.theme&&(t.tooltip.theme="dark"),t.chart.foreColor||(t.chart.foreColor="#f6f7f8"),t.chart.background||(t.chart.background="#424242"),t.theme.palette||(t.theme.palette="palette4"))}},{key:"handleUserInputErrors",value:function(t){var e=t;if(e.tooltip.shared&&e.tooltip.intersect)throw new Error("tooltip.shared cannot be enabled when tooltip.intersect is true. Turn off any other option by setting it to false.");if(("bar"===e.chart.type||"rangeBar"===e.chart.type)&&e.plotOptions.bar.horizontal){if(1<e.yaxis.length)throw new Error("Multiple Y Axis for bars are not supported. Switch to column chart by setting plotOptions.bar.horizontal=false");e.yaxis[0].reversed&&(e.yaxis[0].opposite=!0),e.xaxis.tooltip.enabled=!1,e.yaxis[0].tooltip.enabled=!1,e.chart.zoom.enabled=!1}return"bar"!==e.chart.type&&"rangeBar"!==e.chart.type||e.tooltip.shared&&("barWidth"===e.xaxis.crosshairs.width&&1<e.series.length&&(console.warn('crosshairs.width = "barWidth" is only supported in single series, not in a multi-series barChart.'),e.xaxis.crosshairs.width="tickWidth"),e.plotOptions.bar.horizontal&&(e.states.hover.type="none",e.tooltip.shared=!1),e.tooltip.followCursor||(console.warn("followCursor option in shared columns cannot be turned off. Please set %ctooltip.followCursor: true","color: blue;"),e.tooltip.followCursor=!0)),"candlestick"===e.chart.type&&e.yaxis[0].reversed&&(console.warn("Reversed y-axis in candlestick chart is not supported."),e.yaxis[0].reversed=!1),e.chart.group&&0===e.yaxis[0].labels.minWidth&&console.warn("It looks like you have multiple charts in synchronization. You must provide yaxis.labels.minWidth which must be EQUAL for all grouped charts to prevent incorrect behaviour."),Array.isArray(e.stroke.width)&&"line"!==e.chart.type&&"area"!==e.chart.type&&(console.warn("stroke.width option accepts array only for line and area charts. Reverted back to Number"),e.stroke.width=e.stroke.width[0]),e}}]),_e),U=(r(Ee,[{key:"initGlobalVars",value:function(t){t.series=[],t.seriesCandleO=[],t.seriesCandleH=[],t.seriesCandleL=[],t.seriesCandleC=[],t.seriesRangeStart=[],t.seriesRangeEnd=[],t.seriesRangeBarTimeline=[],t.seriesPercent=[],t.seriesX=[],t.seriesZ=[],t.seriesNames=[],t.seriesTotals=[],t.seriesLog=[],t.seriesColors=[],t.stackedSeriesTotals=[],t.seriesXvalues=[],t.seriesYvalues=[],t.labels=[],t.categoryLabels=[],t.timescaleLabels=[],t.noLabelsProvided=!1,t.resizeTimer=null,t.selectionResizeTimer=null,t.delayedElements=[],t.pointsArray=[],t.dataLabelsRects=[],t.isXNumeric=!1,t.xaxisLabelsCount=0,t.skipLastTimelinelabel=!1,t.skipFirstTimelinelabel=!1,t.isDataXYZ=!1,t.isMultiLineX=!1,t.isMultipleYAxis=!1,t.maxY=-Number.MAX_VALUE,t.minY=Number.MIN_VALUE,t.minYArr=[],t.maxYArr=[],t.maxX=-Number.MAX_VALUE,t.minX=Number.MAX_VALUE,t.initialMaxX=-Number.MAX_VALUE,t.initialMinX=Number.MAX_VALUE,t.maxDate=0,t.minDate=Number.MAX_VALUE,t.minZ=Number.MAX_VALUE,t.maxZ=-Number.MAX_VALUE,t.minXDiff=Number.MAX_VALUE,t.yAxisScale=[],t.xAxisScale=null,t.xAxisTicksPositions=[],t.yLabelsCoords=[],t.yTitleCoords=[],t.barPadForNumericAxis=0,t.padHorizontal=0,t.xRange=0,t.yRange=[],t.zRange=0,t.dataPoints=0,t.xTickAmount=0}},{key:"globalVars",value:function(t){return{chartID:null,cuid:null,events:{beforeMount:[],mounted:[],updated:[],clicked:[],selection:[],dataPointSelection:[],zoomed:[],scrolled:[]},colors:[],clientX:null,clientY:null,fill:{colors:[]},stroke:{colors:[]},dataLabels:{style:{colors:[]}},radarPolygons:{fill:{colors:[]}},markers:{colors:[],size:t.markers.size,largestSize:0},animationEnded:!1,isTouchDevice:"ontouchstart"in window||navigator.msMaxTouchPoints,isDirty:!1,isExecCalled:!1,initialConfig:null,initialSeries:[],lastXAxis:[],lastYAxis:[],columnSeries:null,labels:[],timescaleLabels:[],noLabelsProvided:!1,allSeriesCollapsed:!1,collapsedSeries:[],collapsedSeriesIndices:[],ancillaryCollapsedSeries:[],ancillaryCollapsedSeriesIndices:[],risingSeries:[],dataFormatXNumeric:!1,capturedSeriesIndex:-1,capturedDataPointIndex:-1,selectedDataPoints:[],goldenPadding:35,invalidLogScale:!1,ignoreYAxisIndexes:[],yAxisSameScaleIndices:[],maxValsInArrayIndex:0,radialSize:0,selection:void 0,zoomEnabled:"zoom"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.zoom&&t.chart.zoom.enabled,panEnabled:"pan"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.pan,selectionEnabled:"selection"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.selection,yaxis:null,mousedown:!1,lastClientPosition:{},visibleXRange:void 0,yValueDecimal:0,total:0,SVGNS:"http://www.w3.org/2000/svg",svgWidth:0,svgHeight:0,noData:!1,locale:{},dom:{},memory:{methodsToExec:[]},shouldAnimate:!0,skipLastTimelinelabel:!1,skipFirstTimelinelabel:!1,delayedElements:[],axisCharts:!0,isDataXYZ:!1,resized:!1,resizeTimer:null,comboCharts:!1,dataChanged:!1,previousPaths:[],allSeriesHasEqualX:!0,pointsArray:[],dataLabelsRects:[],lastDrawnDataLabelsIndexes:[],hasNullValues:!1,easing:null,zoomed:!1,gridWidth:0,gridHeight:0,rotateXLabels:!1,defaultLabels:!1,xLabelFormatter:void 0,yLabelFormatters:[],xaxisTooltipFormatter:void 0,ttKeyFormatter:void 0,ttVal:void 0,ttZFormatter:void 0,LINE_HEIGHT_RATIO:1.618,xAxisLabelsHeight:0,xAxisLabelsWidth:0,yAxisLabelsWidth:0,scaleX:1,scaleY:1,translateX:0,translateY:0,translateYAxisX:[],yAxisWidths:[],translateXAxisY:0,translateXAxisX:0,tooltip:null}}},{key:"init",value:function(t){var e=this.globalVars(t);return this.initGlobalVars(e),e.initialConfig=L.extend({},t),e.initialSeries=L.clone(t.series),e.lastXAxis=L.clone(e.initialConfig.xaxis),e.lastYAxis=L.clone(e.initialConfig.yaxis),e}}]),Ee),G=(r(Te,[{key:"init",value:function(){var t=new V(this.opts).init({responsiveOverride:!1});return{config:t,globals:(new U).init(t)}}}]),Te),K=(r(Se,[{key:"isMultiFormat",value:function(){return this.isFormatXY()||this.isFormat2DArray()}},{key:"isFormatXY",value:function(){var t=this.w.config.series.slice(),e=new H(this.ctx);if(this.activeSeriesIndex=e.getActiveConfigSeriesIndex(),void 0!==t[this.activeSeriesIndex].data&&0<t[this.activeSeriesIndex].data.length&&null!==t[this.activeSeriesIndex].data[0]&&void 0!==t[this.activeSeriesIndex].data[0].x&&null!==t[this.activeSeriesIndex].data[0])return!0}},{key:"isFormat2DArray",value:function(){var t=this.w.config.series.slice(),e=new H(this.ctx);if(this.activeSeriesIndex=e.getActiveConfigSeriesIndex(),void 0!==t[this.activeSeriesIndex].data&&0<t[this.activeSeriesIndex].data.length&&void 0!==t[this.activeSeriesIndex].data[0]&&null!==t[this.activeSeriesIndex].data[0]&&t[this.activeSeriesIndex].data[0].constructor===Array)return!0}},{key:"handleFormat2DArray",value:function(t,e){var i=this.w.config,n=this.w.globals;i.xaxis.sorted&&("datetime"===i.xaxis.type?t[e].data.sort(function(t,e){return new Date(t[0]).getTime()-new Date(e[0]).getTime()}):"numeric"===i.xaxis.type&&t[e].data.sort(function(t,e){return t[0]-e[0]}));for(var o,a=0;a<t[e].data.length;a++)void 0!==t[e].data[a][1]&&(Array.isArray(t[e].data[a][1])&&4===t[e].data[a][1].length?this.twoDSeries.push(L.parseNumber(t[e].data[a][1][3])):5===t[e].data[a].length?this.twoDSeries.push(L.parseNumber(t[e].data[a][4])):this.twoDSeries.push(L.parseNumber(t[e].data[a][1])),n.dataFormatXNumeric=!0),"datetime"===i.xaxis.type?(o=new Date(t[e].data[a][0]),o=new Date(o).getTime(),this.twoDSeriesX.push(o)):this.twoDSeriesX.push(t[e].data[a][0]);for(var r=0;r<t[e].data.length;r++)void 0!==t[e].data[r][2]&&(this.threeDSeries.push(t[e].data[r][2]),n.isDataXYZ=!0)}},{key:"handleFormatXY",value:function(t,e){var i=this.w.config,n=this.w.globals,o=new q(this.ctx),a=e;-1<n.collapsedSeriesIndices.indexOf(e)&&(a=this.activeSeriesIndex),i.xaxis.sorted&&("datetime"===i.xaxis.type?t[e].data.sort(function(t,e){return new Date(t.x).getTime()-new Date(e.x).getTime()}):"numeric"===i.xaxis.type&&t[e].data.sort(function(t,e){return t.x-e.x}));for(var r=0;r<t[e].data.length;r++)void 0!==t[e].data[r].y&&(Array.isArray(t[e].data[r].y)?this.twoDSeries.push(L.parseNumber(t[e].data[r].y[t[e].data[r].y.length-1])):this.twoDSeries.push(L.parseNumber(t[e].data[r].y)));for(var s=0;s<t[a].data.length;s++){var l,c="string"==typeof t[a].data[s].x,h=Array.isArray(t[a].data[s].x),u=!h&&!!o.isValidDate(t[a].data[s].x.toString());c||u?c||i.xaxis.convertedCatToNumeric?(l=n.isBarHorizontal&&n.isRangeData,"datetime"!==i.xaxis.type||l?(this.fallbackToCategory=!0,this.twoDSeriesX.push(t[a].data[s].x)):this.twoDSeriesX.push(o.parseDate(t[a].data[s].x))):"datetime"===i.xaxis.type?this.twoDSeriesX.push(o.parseDate(t[a].data[s].x.toString())):(n.dataFormatXNumeric=!0,n.isXNumeric=!0,this.twoDSeriesX.push(parseFloat(t[a].data[s].x))):(h?this.fallbackToCategory=!0:(n.isXNumeric=!0,n.dataFormatXNumeric=!0),this.twoDSeriesX.push(t[a].data[s].x))}if(t[e].data[0]&&void 0!==t[e].data[0].z){for(var d=0;d<t[e].data.length;d++)this.threeDSeries.push(t[e].data[d].z);n.isDataXYZ=!0}}},{key:"handleRangeData",value:function(t,e){var i=this.w.config,n=this.w.globals,o={};return this.isFormat2DArray()?o=this.handleRangeDataFormat("array",t,e):this.isFormatXY()&&(o=this.handleRangeDataFormat("xy",t,e)),n.seriesRangeStart.push(o.start),n.seriesRangeEnd.push(o.end),"datetime"===i.xaxis.type&&n.seriesRangeBarTimeline.push(o.rangeUniques),n.seriesRangeBarTimeline.forEach(function(t,e){t&&t.forEach(function(r,t){r.y.forEach(function(t,e){for(var i,n,o,a=0;a<r.y.length;a++)e!==a&&(i=t.y1,n=t.y2,o=r.y[a].y1,i<=r.y[a].y2&&o<=n&&(r.overlaps.indexOf(t.rangeName)<0&&r.overlaps.push(t.rangeName),r.overlaps.indexOf(r.y[a].rangeName)<0&&r.overlaps.push(r.y[a].rangeName)))})})}),o}},{key:"handleCandleStickData",value:function(t,e){var i=this.w.globals,n={};return this.isFormat2DArray()?n=this.handleCandleStickDataFormat("array",t,e):this.isFormatXY()&&(n=this.handleCandleStickDataFormat("xy",t,e)),i.seriesCandleO[e]=n.o,i.seriesCandleH[e]=n.h,i.seriesCandleL[e]=n.l,i.seriesCandleC[e]=n.c,n}},{key:"handleRangeDataFormat",value:function(t,a,r){var s=[],l=[],c=a[r].data.filter(function(e,t,i){return t===i.findIndex(function(t){return t.x===e.x})}).map(function(t,e){return{x:t.x,overlaps:[],y:[]}}),e="Please provide [Start, End] values in valid format. Read more https://apexcharts.com/docs/series/#rangecharts",i=new H(this.ctx).getActiveConfigSeriesIndex();if("array"===t){if(2!==a[i].data[0][1].length)throw new Error(e);for(var n=0;n<a[r].data.length;n++)s.push(a[r].data[n][1][0]),l.push(a[r].data[n][1][1])}else if("xy"===t){if(2!==a[i].data[0].y.length)throw new Error(e);for(var o=0;o<a[r].data.length;o++)!function(t){var e=L.randomId(),i=a[r].data[t].x,n={y1:a[r].data[t].y[0],y2:a[r].data[t].y[1],rangeName:e};a[r].data[t].rangeName=e;var o=c.findIndex(function(t){return t.x===i});c[o].y.push(n),s.push(n.y1),l.push(n.y2)}(o)}return{start:s,end:l,rangeUniques:c}}},{key:"handleCandleStickDataFormat",value:function(t,e,i){var n=[],o=[],a=[],r=[],s="Please provide [Open, High, Low and Close] values in valid format. Read more https://apexcharts.com/docs/series/#candlestick";if("array"===t){if(!Array.isArray(e[i].data[0][1])&&5!==e[i].data[0].length||Array.isArray(e[i].data[0][1])&&4!==e[i].data[0][1].length)throw new Error(s);if(5===e[i].data[0].length)for(var l=0;l<e[i].data.length;l++)n.push(e[i].data[l][1]),o.push(e[i].data[l][2]),a.push(e[i].data[l][3]),r.push(e[i].data[l][4]);else for(var c=0;c<e[i].data.length;c++)n.push(e[i].data[c][1][0]),o.push(e[i].data[c][1][1]),a.push(e[i].data[c][1][2]),r.push(e[i].data[c][1][3])}else if("xy"===t){if(4!==e[i].data[0].y.length)throw new Error(s);for(var h=0;h<e[i].data.length;h++)n.push(e[i].data[h].y[0]),o.push(e[i].data[h].y[1]),a.push(e[i].data[h].y[2]),r.push(e[i].data[h].y[3])}return{o:n,h:o,l:a,c:r}}},{key:"parseDataAxisCharts",value:function(t,e){for(var i,n=this,o=1<arguments.length&&void 0!==e?e:this.ctx,a=this.w.config,r=this.w.globals,s=new q(o),l=0<a.labels.length?a.labels.slice():a.xaxis.categories.slice(),c=0;c<t.length;c++){if(this.twoDSeries=[],this.twoDSeriesX=[],this.threeDSeries=[],void 0===t[c].data)return void console.error("It is a possibility that you may have not included 'data' property in series.");"rangeBar"!==a.chart.type&&"rangeArea"!==a.chart.type&&"rangeBar"!==t[c].type&&"rangeArea"!==t[c].type||(r.isRangeData=!0,this.handleRangeData(t,c)),this.isMultiFormat()?(this.isFormat2DArray()?this.handleFormat2DArray(t,c):this.isFormatXY()&&this.handleFormatXY(t,c),"candlestick"!==a.chart.type&&"candlestick"!==t[c].type||this.handleCandleStickData(t,c),r.series.push(this.twoDSeries),r.labels.push(this.twoDSeriesX),r.seriesX.push(this.twoDSeriesX),c!==this.activeSeriesIndex||this.fallbackToCategory||(r.isXNumeric=!0)):("datetime"===a.xaxis.type?(r.isXNumeric=!0,function(){for(var t=0;t<l.length;t++)if("string"==typeof l[t]){if(!s.isValidDate(l[t]))throw new Error("You have provided invalid Date format. Please provide a valid JavaScript Date");n.twoDSeriesX.push(s.parseDate(l[t]))}else n.twoDSeriesX.push(l[t])}(),r.seriesX.push(this.twoDSeriesX)):"numeric"===a.xaxis.type&&(r.isXNumeric=!0,0<l.length&&(this.twoDSeriesX=l,r.seriesX.push(this.twoDSeriesX))),r.labels.push(this.twoDSeriesX),i=t[c].data.map(function(t){return L.parseNumber(t)}),r.series.push(i)),r.seriesZ.push(this.threeDSeries),void 0!==t[c].name?r.seriesNames.push(t[c].name):r.seriesNames.push("series-"+parseInt(c+1,10)),void 0!==t[c].color?r.seriesColors.push(t[c].color):r.seriesColors.push(void 0)}return this.w}},{key:"parseDataNonAxisCharts",value:function(t){var e=this.w.globals,i=this.w.config;e.series=t.slice(),e.seriesNames=i.labels.slice();for(var n=0;n<e.series.length;n++)void 0===e.seriesNames[n]&&e.seriesNames.push("series-"+(n+1));return this.w}},{key:"handleExternalLabelsData",value:function(t){var e=this.w.config,i=this.w.globals;0<e.xaxis.categories.length?i.labels=e.xaxis.categories:0<e.labels.length?i.labels=e.labels.slice():this.fallbackToCategory?(i.labels=i.labels[0],i.seriesRangeBarTimeline.length&&(i.seriesRangeBarTimeline.map(function(t){t.forEach(function(t){i.labels.indexOf(t.x)<0&&t.x&&i.labels.push(t.x)})}),i.labels=i.labels.filter(function(t,e,i){return i.indexOf(t)===e})),e.xaxis.convertedCatToNumeric&&(new $(e).convertCatToNumericXaxis(e,this.ctx,i.seriesX[0]),this._generateExternalLabels(t))):this._generateExternalLabels(t)}},{key:"_generateExternalLabels",value:function(t){var e=this.w.globals,i=this.w.config,n=[];if(e.axisCharts){if(0<e.series.length)for(var o=0;o<e.series[e.maxValsInArrayIndex].length;o++)n.push(o+1);e.seriesX=[];for(var a=0;a<t.length;a++)e.seriesX.push(n);e.isXNumeric=!0}if(0===n.length){n=e.axisCharts?[]:e.series.map(function(t,e){return e+1});for(var r=0;r<t.length;r++)e.seriesX.push(n)}e.labels=n,i.xaxis.convertedCatToNumeric&&(e.categoryLabels=n.map(function(t){return i.xaxis.labels.formatter(t)})),e.noLabelsProvided=!0}},{key:"parseData",value:function(t){var e,i=this.w,n=i.config,o=i.globals;this.excludeCollapsedSeriesInYAxis(),this.fallbackToCategory=!1,this.ctx.core.resetGlobals(),this.ctx.core.isMultipleY(),o.axisCharts?this.parseDataAxisCharts(t):this.parseDataNonAxisCharts(t),this.coreUtils.getLargestSeries(),"bar"===n.chart.type&&n.chart.stacked&&(e=new H(this.ctx),o.series=e.setNullSeriesToZeroValues(o.series)),this.coreUtils.getSeriesTotals(),o.axisCharts&&this.coreUtils.getStackedSeriesTotals(),this.coreUtils.getPercentSeries(),o.dataFormatXNumeric||o.isXNumeric&&("numeric"!==n.xaxis.type||0!==n.labels.length||0!==n.xaxis.categories.length)||this.handleExternalLabelsData(t);for(var a=this.coreUtils.getCategoryLabels(o.labels),r=0;r<a.length;r++)if(Array.isArray(a[r])){o.isMultiLineX=!0;break}}},{key:"excludeCollapsedSeriesInYAxis",value:function(){var i=this,n=this.w;n.globals.ignoreYAxisIndexes=n.globals.collapsedSeries.map(function(t,e){if(i.w.globals.isMultipleYAxis&&!n.config.chart.stacked)return t.index})}}]),Se),Z=(r(Ae,[{key:"xLabelFormat",value:function(t,e,i){var n=this.w;if("datetime"!==n.config.xaxis.type||void 0!==n.config.xaxis.labels.formatter||void 0!==n.config.tooltip.x.formatter)return t(e,i);var o=new q(this.ctx);return o.formatDate(o.getDate(e),n.config.tooltip.x.format)}},{key:"defaultGeneralFormatter",value:function(t){return Array.isArray(t)?t.map(function(t){return t}):t}},{key:"defaultYFormatter",value:function(t,e,i){var n=this.w;return L.isNumber(t)&&(t=0!==n.globals.yValueDecimal?t.toFixed(void 0!==e.decimalsInFloat?e.decimalsInFloat:n.globals.yValueDecimal):n.globals.maxYArr[i]-n.globals.minYArr[i]<10?t.toFixed(1):t.toFixed(0)),t}},{key:"setLabelFormatters",value:function(){var n=this,o=this.w;return o.globals.xLabelFormatter=function(t){return n.defaultGeneralFormatter(t)},o.globals.xaxisTooltipFormatter=function(t){return n.defaultGeneralFormatter(t)},o.globals.ttKeyFormatter=function(t){return n.defaultGeneralFormatter(t)},o.globals.ttZFormatter=function(t){return t},o.globals.legendFormatter=function(t){return n.defaultGeneralFormatter(t)},void 0!==o.config.xaxis.labels.formatter?o.globals.xLabelFormatter=o.config.xaxis.labels.formatter:o.globals.xLabelFormatter=function(t){return L.isNumber(t)?!o.config.xaxis.convertedCatToNumeric&&"numeric"===o.config.xaxis.type&&o.globals.dataPoints<50||o.globals.isBarHorizontal&&o.globals.maxY-o.globals.minYArr<4?t.toFixed(1):t.toFixed(0):t},"function"==typeof o.config.tooltip.x.formatter?o.globals.ttKeyFormatter=o.config.tooltip.x.formatter:o.globals.ttKeyFormatter=o.globals.xLabelFormatter,"function"==typeof o.config.xaxis.tooltip.formatter&&(o.globals.xaxisTooltipFormatter=o.config.xaxis.tooltip.formatter),!Array.isArray(o.config.tooltip.y)&&void 0===o.config.tooltip.y.formatter||(o.globals.ttVal=o.config.tooltip.y),void 0!==o.config.tooltip.z.formatter&&(o.globals.ttZFormatter=o.config.tooltip.z.formatter),void 0!==o.config.legend.formatter&&(o.globals.legendFormatter=o.config.legend.formatter),o.config.yaxis.forEach(function(e,i){void 0!==e.labels.formatter?o.globals.yLabelFormatters[i]=e.labels.formatter:o.globals.yLabelFormatters[i]=function(t){return o.globals.xyCharts?Array.isArray(t)?t.map(function(t){return n.defaultYFormatter(t,e,i)}):n.defaultYFormatter(t,e,i):t}}),o.globals}},{key:"heatmapLabelFormatters",value:function(){var t,e=this.w;"heatmap"===e.config.chart.type&&(e.globals.yAxisScale[0].result=e.globals.seriesNames.slice(),t=e.globals.seriesNames.reduce(function(t,e){return t.length>e.length?t:e},0),e.globals.yAxisScale[0].niceMax=t,e.globals.yAxisScale[0].niceMin=t)}}]),Ae),Q=(r(Ce,[{key:"getLabel",value:function(t,e,i,n,o,a){var r,s,l=4<arguments.length&&void 0!==o?o:[],c=5<arguments.length&&void 0!==a?a:"12px",h=this.w,u=void 0===t[n]?"":t[n],d=u,f=h.globals.xLabelFormatter,p=h.config.xaxis.labels.formatter,g=!1,d=new Z(this.ctx).xLabelFormat(f,u,u);void 0!==p&&(d=p(u,t[n],n)),0<e.length?(r=e[n].unit,s=null,e.forEach(function(t){"month"===t.unit?s="year":"day"===t.unit?s="month":"hour"===t.unit?s="day":"minute"===t.unit&&(s="hour")}),g=s===r,i=e[n].position,d=e[n].value):"datetime"===h.config.xaxis.type&&void 0===p&&(d=""),void 0===d&&(d=""),d=Array.isArray(d)?d:d.toString();var v=new M(this.ctx),m=h.globals.rotateXLabels?v.getTextRects(d,parseInt(c,10),null,"rotate(".concat(h.config.xaxis.labels.rotate," 0 0)"),!1):v.getTextRects(d,parseInt(c,10));return!Array.isArray(d)&&(0===d.indexOf("NaN")||0===d.toLowerCase().indexOf("invalid")||0<=d.toLowerCase().indexOf("infinity")||0<=l.indexOf(d)&&!h.config.xaxis.labels.showDuplicates&&"hours"!==this.ctx.timeScale.tickInterval&&"minutes"!==this.ctx.timeScale.tickInterval)&&(d=""),{x:i,text:d,textRect:m,isBold:g}}},{key:"checkForOverflowingLabels",value:function(t,e,i,n,o){var a,r=this.w;return 0===t&&r.globals.skipFirstTimelinelabel&&(e.text=""),t===i-1&&r.globals.skipLastTimelinelabel&&(e.text=""),r.config.xaxis.labels.hideOverlappingLabels&&0<n.length&&(a=o[o.length-1],e.x<a.textRect.width/(r.globals.rotateXLabels?Math.abs(r.config.xaxis.labels.rotate)/12:1.01)+a.x&&(e.text="")),e}},{key:"checkForReversedLabels",value:function(t,e){var i=this.w;return i.config.yaxis[t]&&i.config.yaxis[t].reversed&&e.reverse(),e}},{key:"isYAxisHidden",value:function(t){var e=this.w,i=new E(this.ctx);return!e.config.yaxis[t].show||!e.config.yaxis[t].showForNullSeries&&i.isSeriesNull(t)&&-1===e.globals.collapsedSeriesIndices.indexOf(t)}},{key:"drawYAxisTicks",value:function(t,e,i,n,o,a,r){var s=this.w,l=new M(this.ctx),c=s.globals.translateY;if(n.show&&0<e){!0===s.config.yaxis[o].opposite&&(t+=n.width);for(var h=e;0<=h;h--){var u=c+e/10+s.config.yaxis[o].labels.offsetY-1;s.globals.isBarHorizontal&&(u=a*h),"heatmap"===s.config.chart.type&&(u+=a/2);var d=l.drawLine(t+i.offsetX-n.width+n.offsetX,u+n.offsetY,t+i.offsetX+n.offsetX,u+n.offsetY,n.color);r.add(d),c+=a}}}}]),Ce),J=(r(ke,[{key:"fixSvgStringForIe11",value:function(t){if(!L.isIE11())return t;var e=0,i=t.replace(/xmlns="http:\/\/www.w3.org\/2000\/svg"/g,function(t){return 2==++e?'xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs"':t});return(i=i.replace(/xmlns:NS\d+=""/g,"")).replace(/NS\d+:(\w+:\w+=")/g,"$1")}},{key:"getSvgString",value:function(){var t=this.w.globals.dom.Paper.svg();return this.fixSvgStringForIe11(t)}},{key:"cleanup",value:function(){var t=this.w,e=t.globals.dom.baseEl.getElementsByClassName("apexcharts-xcrosshairs"),i=t.globals.dom.baseEl.getElementsByClassName("apexcharts-ycrosshairs"),n=t.globals.dom.baseEl.querySelectorAll(".apexcharts-zoom-rect, .apexcharts-selection-rect");Array.prototype.forEach.call(n,function(t){t.setAttribute("width",0)}),e&&e[0]&&(e[0].setAttribute("x",-500),e[0].setAttribute("x1",-500),e[0].setAttribute("x2",-500)),i&&i[0]&&(i[0].setAttribute("y",-100),i[0].setAttribute("y1",-100),i[0].setAttribute("y2",-100))}},{key:"svgUrl",value:function(){this.cleanup();var t=this.getSvgString(),e=new Blob([t],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(e)}},{key:"dataURI",value:function(){var h=this;return new Promise(function(i){var t=h.w;h.cleanup();var n=document.createElement("canvas");n.width=t.globals.svgWidth,n.height=parseInt(t.globals.dom.elWrap.style.height,10);var e="transparent"===t.config.chart.background?"#fff":t.config.chart.background,o=n.getContext("2d");o.fillStyle=e,o.fillRect(0,0,n.width,n.height);var a,r,s,l,c=h.getSvgString();window.canvg&&L.isIE11()?((a=window.canvg.Canvg.fromString(o,c,{ignoreClear:!0,ignoreDimensions:!0})).start(),r=n.msToBlob(),a.stop(),i({blob:r})):(s="data:image/svg+xml,"+encodeURIComponent(c),(l=new Image).crossOrigin="anonymous",l.onload=function(){var t,e;o.drawImage(l,0,0),n.msToBlob?(t=n.msToBlob(),i({blob:t})):(e=n.toDataURL("image/png"),i({imgURI:e}))},l.src=s)})}},{key:"exportToSVG",value:function(){this.triggerDownload(this.svgUrl(),null,".svg")}},{key:"exportToPng",value:function(){var n=this;this.dataURI().then(function(t){var e=t.imgURI,i=t.blob;i?navigator.msSaveOrOpenBlob(i,n.w.globals.chartID+".png"):n.triggerDownload(e,null,".png")})}},{key:"exportToCSV",value:function(t){var c=this,h=t.series,u=t.columnDelimiter,e=t.lineDelimiter,i=void 0===e?"\n":e,d=this.w,f=[],p=[],n="data:text/csv;charset=utf-8,",g=new K(this.ctx),v=new Q(this.ctx);f.push(d.config.chart.toolbar.export.csv.headerCategory),h.map(function(t,e){d.globals.axisCharts&&f.push(t.name?t.name:"series-".concat(e))}),d.globals.axisCharts||(f.push(d.config.chart.toolbar.export.csv.headerValue),p.push(f.join(u))),h.map(function(t,e){d.globals.axisCharts?function(t,e){if(f.length&&0===e&&p.push(f.join(u)),t.data&&t.data.length)for(var i=0;i<t.data.length;i++){f=[];var n=(a=i,l=s=r=void 0,l="",d.globals.axisCharts?("category"!==d.config.xaxis.type&&!d.config.xaxis.convertedCatToNumeric||(l=d.globals.isBarHorizontal?(r=d.globals.yLabelFormatters[0],s=new H(c.ctx).getActiveConfigSeriesIndex(),r(d.globals.labels[a],{seriesIndex:s,dataPointIndex:a,w:d})):v.getLabel(d.globals.labels,d.globals.timescaleLabels,0,a).text),"datetime"===d.config.xaxis.type&&(d.config.xaxis.categories.length?l=d.config.xaxis.categories[a]:d.config.labels.length&&(l=d.config.labels[a]))):l=d.config.labels[a],l);if(n||(g.isFormatXY()?n=h[e].data[i].x:g.isFormat2DArray()&&(n=h[e].data[i]?h[e].data[i][0]:"")),0===e){f.push("datetime"===d.config.xaxis.type&&10<=String(n).length?d.config.chart.toolbar.export.csv.dateFormatter(n):n);for(var o=0;o<d.globals.series.length;o++)f.push(d.globals.series[o][i])}("candlestick"===d.config.chart.type||t.type&&"candlestick"===t.type)&&(f.pop(),f.push(d.globals.seriesCandleO[e][i]),f.push(d.globals.seriesCandleH[e][i]),f.push(d.globals.seriesCandleL[e][i]),f.push(d.globals.seriesCandleC[e][i])),"rangeBar"===d.config.chart.type&&(f.pop(),f.push(d.globals.seriesRangeStart[e][i]),f.push(d.globals.seriesRangeEnd[e][i])),f.length&&p.push(f.join(u))}var a,r,s,l}(t,e):((f=[]).push(d.globals.labels[e]),f.push(d.globals.series[e]),p.push(f.join(u)))}),n+=p.join(i),this.triggerDownload(encodeURI(n),d.config.chart.toolbar.export.csv.filename,".csv")}},{key:"triggerDownload",value:function(t,e,i){var n=document.createElement("a");n.href=t,n.download=(e||this.w.globals.chartID)+i,document.body.appendChild(n),n.click(),document.body.removeChild(n)}}]),ke),tt=(r(we,[{key:"drawXaxis",value:function(){var r=this,s=this.w,l=new M(this.ctx),t=l.group({class:"apexcharts-xaxis",transform:"translate(".concat(s.config.xaxis.offsetX,", ").concat(s.config.xaxis.offsetY,")")}),c=l.group({class:"apexcharts-xaxis-texts-g",transform:"translate(".concat(s.globals.translateXAxisX,", ").concat(s.globals.translateXAxisY,")")});t.add(c);for(var h=s.globals.padHorizontal,u=[],e=0;e<this.xaxisLabels.length;e++)u.push(this.xaxisLabels[e]);var i,d,n,o,a,f,p=u.length;if(h=s.globals.isXNumeric?(i=1<p?p-1:p,d=s.globals.gridWidth/i,h+d/2+s.config.xaxis.labels.offsetX):(d=s.globals.gridWidth/u.length,h+d+s.config.xaxis.labels.offsetX),s.config.xaxis.labels.show)for(var g=0;g<=p-1;g++)!function(t){var e=h-d/2+s.config.xaxis.labels.offsetX;0===t&&1===p&&d/2===h&&1===s.globals.dataPoints&&(e=s.globals.gridWidth/2);var i=r.axesUtils.getLabel(u,s.globals.timescaleLabels,e,t,r.drawnLabels,r.xaxisFontSize),n=28;s.globals.rotateXLabels&&(n=22),(i=r.axesUtils.checkForOverflowingLabels(t,i,p,r.drawnLabels,r.drawnLabelsRects)).text&&s.globals.xaxisLabelsCount++;var o=l.drawText({x:i.x,y:r.offY+s.config.xaxis.labels.offsetY+n-("top"===s.config.xaxis.position?s.globals.xAxisHeight+s.config.xaxis.axisTicks.height-2:0),text:i.text,textAnchor:"middle",fontWeight:i.isBold?600:s.config.xaxis.labels.style.fontWeight,fontSize:r.xaxisFontSize,fontFamily:r.xaxisFontFamily,foreColor:Array.isArray(r.xaxisForeColors)?s.config.xaxis.convertedCatToNumeric?r.xaxisForeColors[s.globals.minX+t-1]:r.xaxisForeColors[t]:r.xaxisForeColors,isPlainText:!1,cssClass:"apexcharts-xaxis-label "+s.config.xaxis.labels.style.cssClass});c.add(o);var a=document.createElementNS(s.globals.SVGNS,"title");a.textContent=Array.isArray(i.text)?i.text.join(" "):i.text,o.node.appendChild(a),""!==i.text&&(r.drawnLabels.push(i.text),r.drawnLabelsRects.push(i)),h+=d}(g);return void 0!==s.config.xaxis.title.text&&(n=l.group({class:"apexcharts-xaxis-title"}),o=l.drawText({x:s.globals.gridWidth/2+s.config.xaxis.title.offsetX,y:this.offY-parseFloat(this.xaxisFontSize)+s.globals.xAxisLabelsHeight+s.config.xaxis.title.offsetY,text:s.config.xaxis.title.text,textAnchor:"middle",fontSize:s.config.xaxis.title.style.fontSize,fontFamily:s.config.xaxis.title.style.fontFamily,fontWeight:s.config.xaxis.title.style.fontWeight,foreColor:s.config.xaxis.title.style.color,cssClass:"apexcharts-xaxis-title-text "+s.config.xaxis.title.style.cssClass}),n.add(o),t.add(n)),s.config.xaxis.axisBorder.show&&(a=s.globals.barPadForNumericAxis,f=l.drawLine(s.globals.padHorizontal+s.config.xaxis.axisBorder.offsetX-a,this.offY,this.xaxisBorderWidth+a,this.offY,s.config.xaxis.axisBorder.color,0,this.xaxisBorderHeight),t.add(f)),t}},{key:"drawXaxisInversed",value:function(t){var e,i,n=this.w,o=new M(this.ctx),a=n.config.yaxis[0].opposite?n.globals.translateYAxisX[t]:0,r=o.group({class:"apexcharts-yaxis apexcharts-xaxis-inversed",rel:t}),s=o.group({class:"apexcharts-yaxis-texts-g apexcharts-xaxis-inversed-texts-g",transform:"translate("+a+", 0)"});r.add(s);var l=[];if(n.config.yaxis[t].show)for(var c=0;c<this.xaxisLabels.length;c++)l.push(this.xaxisLabels[c]);i=-(e=n.globals.gridHeight/l.length)/2.2;var h,u,d=n.globals.yLabelFormatters[0],f=n.config.yaxis[0].labels;if(f.show)for(var p=0;p<=l.length-1;p++){var g=d(g=void 0===l[p]?"":l[p],{seriesIndex:t,dataPointIndex:p,w:n}),v=0;Array.isArray(g)&&(v=g.length/2*parseInt(f.style.fontSize,10));var m=o.drawText({x:f.offsetX-15,y:i+e+f.offsetY-v,text:g,textAnchor:this.yaxis.opposite?"start":"end",foreColor:Array.isArray(f.style.colors)?f.style.colors[p]:f.style.colors,fontSize:f.style.fontSize,fontFamily:f.style.fontFamily,fontWeight:f.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-yaxis-label "+f.style.cssClass});s.add(m);var b,y=document.createElementNS(n.globals.SVGNS,"title");y.textContent=g.text,m.node.appendChild(y),0!==n.config.yaxis[t].labels.rotate&&(b=o.rotateAroundCenter(m.node),m.node.setAttribute("transform","rotate(".concat(n.config.yaxis[t].labels.rotate," 0 ").concat(b.y,")"))),i+=e}void 0!==n.config.yaxis[0].title.text&&(h=o.group({class:"apexcharts-yaxis-title apexcharts-xaxis-title-inversed",transform:"translate("+a+", 0)"}),u=o.drawText({x:0,y:n.globals.gridHeight/2,text:n.config.yaxis[0].title.text,textAnchor:"middle",foreColor:n.config.yaxis[0].title.style.color,fontSize:n.config.yaxis[0].title.style.fontSize,fontWeight:n.config.yaxis[0].title.style.fontWeight,fontFamily:n.config.yaxis[0].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text "+n.config.yaxis[0].title.style.cssClass}),h.add(u),r.add(h));var x=0;this.isCategoryBarHorizontal&&n.config.yaxis[0].opposite&&(x=n.globals.gridWidth);var w,k=n.config.xaxis.axisBorder;return k.show&&(w=o.drawLine(n.globals.padHorizontal+k.offsetX+x,1+k.offsetY,n.globals.padHorizontal+k.offsetX+x,n.globals.gridHeight+k.offsetY,k.color,0),r.add(w)),n.config.yaxis[0].axisTicks.show&&this.axesUtils.drawYAxisTicks(x,l.length,n.config.yaxis[0].axisBorder,n.config.yaxis[0].axisTicks,0,e,r),r}},{key:"drawXaxisTicks",value:function(t,e){var i,n,o,a=this.w,r=t;t<0||t-2>a.globals.gridWidth||(n=(i=this.offY+a.config.xaxis.axisTicks.offsetY)+a.config.xaxis.axisTicks.height,"top"===a.config.xaxis.position&&(n=i-a.config.xaxis.axisTicks.height),a.config.xaxis.axisTicks.show&&(o=new M(this.ctx).drawLine(t+a.config.xaxis.axisTicks.offsetX,i+a.config.xaxis.offsetY,r+a.config.xaxis.axisTicks.offsetX,n+a.config.xaxis.offsetY,a.config.xaxis.axisTicks.color),e.add(o),o.node.classList.add("apexcharts-xaxis-tick")))}},{key:"getXAxisTicksPositions",value:function(){var t=this.w,e=[],i=this.xaxisLabels.length,n=t.globals.padHorizontal;if(0<t.globals.timescaleLabels.length)for(var o=0;o<i;o++)n=this.xaxisLabels[o].position,e.push(n);else for(var a=i,r=0;r<a;r++){var s=a;t.globals.isXNumeric&&"bar"!==t.config.chart.type&&--s,n+=t.globals.gridWidth/s,e.push(n)}return e}},{key:"xAxisLabelCorrections",value:function(){var n=this.w,o=new M(this.ctx),t=n.globals.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g"),a=n.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-texts-g text"),e=n.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-inversed text"),i=n.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-inversed-texts-g text tspan");if(n.globals.rotateXLabels||n.config.xaxis.labels.rotateAlways)for(var r=0;r<a.length;r++){var s=o.rotateAroundCenter(a[r]);s.y=s.y-1,s.x=s.x+1,a[r].setAttribute("transform","rotate(".concat(n.config.xaxis.labels.rotate," ").concat(s.x," ").concat(s.y,")")),a[r].setAttribute("text-anchor","end"),t.setAttribute("transform","translate(0, ".concat(-10,")"));var l=a[r].childNodes;n.config.xaxis.labels.trim&&Array.prototype.forEach.call(l,function(t){o.placeTextWithEllipsis(t,t.textContent,n.config.xaxis.labels.maxHeight-("bottom"===n.config.legend.position?20:10))})}else!function(){for(var e=n.globals.gridWidth/(n.globals.labels.length+1),t=0;t<a.length;t++){var i=a[t].childNodes;n.config.xaxis.labels.trim&&"datetime"!==n.config.xaxis.type&&Array.prototype.forEach.call(i,function(t){o.placeTextWithEllipsis(t,t.textContent,e)})}}();if(0<e.length){var c=e[e.length-1].getBBox(),h=e[0].getBBox();c.x<-20&&e[e.length-1].parentNode.removeChild(e[e.length-1]),h.x+h.width>n.globals.gridWidth&&!n.globals.isBarHorizontal&&e[0].parentNode.removeChild(e[0]);for(var u=0;u<i.length;u++)o.placeTextWithEllipsis(i[u],i[u].textContent,n.config.yaxis[0].labels.maxWidth-2*parseFloat(n.config.yaxis[0].title.style.fontSize)-20)}}}]),we),et=(r(xe,[{key:"drawGridArea",value:function(t){var e=0<arguments.length&&void 0!==t?t:null,i=this.w,n=new M(this.ctx);null===e&&(e=n.group({class:"apexcharts-grid"}));var o=n.drawLine(i.globals.padHorizontal,1,i.globals.padHorizontal,i.globals.gridHeight,"transparent"),a=n.drawLine(i.globals.padHorizontal,i.globals.gridHeight,i.globals.gridWidth,i.globals.gridHeight,"transparent");return e.add(a),e.add(o),e}},{key:"drawGrid",value:function(){var t=null;return this.w.globals.axisCharts&&(t=this.renderGrid(),this.drawGridArea(t.el)),t}},{key:"createGridMask",value:function(){var e,t=this.w,i=t.globals,n=new M(this.ctx),o=Array.isArray(t.config.stroke.width)?0:t.config.stroke.width;Array.isArray(t.config.stroke.width)&&(e=0,t.config.stroke.width.forEach(function(t){e=Math.max(e,t)}),o=e),i.dom.elGridRectMask=document.createElementNS(i.SVGNS,"clipPath"),i.dom.elGridRectMask.setAttribute("id","gridRectMask".concat(i.cuid)),i.dom.elGridRectMarkerMask=document.createElementNS(i.SVGNS,"clipPath"),i.dom.elGridRectMarkerMask.setAttribute("id","gridRectMarkerMask".concat(i.cuid));var a=t.config.chart.type,r=0,s=0;("bar"===a||"rangeBar"===a||0<t.globals.comboBarCount)&&t.globals.isXNumeric&&!t.globals.isBarHorizontal&&(r=t.config.grid.padding.left,s=t.config.grid.padding.right,i.barPadForNumericAxis>r&&(r=i.barPadForNumericAxis,s=i.barPadForNumericAxis)),i.dom.elGridRect=n.drawRect(-o/2-r-2,-o/2,i.gridWidth+o+s+r+4,i.gridHeight+o,0,"#fff"),new E(this).getLargestMarkerSize();var l=t.globals.markers.largestSize+1;i.dom.elGridRectMarker=n.drawRect(2*-l,2*-l,i.gridWidth+4*l,i.gridHeight+4*l,0,"#fff"),i.dom.elGridRectMask.appendChild(i.dom.elGridRect.node),i.dom.elGridRectMarkerMask.appendChild(i.dom.elGridRectMarker.node);var c=i.dom.baseEl.querySelector("defs");c.appendChild(i.dom.elGridRectMask),c.appendChild(i.dom.elGridRectMarkerMask)}},{key:"_drawGridLines",value:function(t){var e=t.i,i=t.x1,n=t.y1,o=t.x2,a=t.y2,r=t.xCount,s=t.parent,l=this.w;0===e&&l.globals.skipFirstTimelinelabel||e===r-1&&l.globals.skipLastTimelinelabel&&!l.config.xaxis.labels.formatter||"radar"===l.config.chart.type||(l.config.grid.xaxis.lines.show&&this._drawGridLine({x1:i,y1:n,x2:o,y2:a,parent:s}),new tt(this.ctx).drawXaxisTicks(i,this.elg))}},{key:"_drawGridLine",value:function(t){var e=t.x1,i=t.y1,n=t.x2,o=t.y2,a=t.parent,r=this.w,s=a.node.classList.contains("apexcharts-gridlines-horizontal"),l=r.config.grid.strokeDashArray,c=r.globals.barPadForNumericAxis,h=new M(this).drawLine(e-(s?c:0),i,n+(s?c:0),o,r.config.grid.borderColor,l);h.node.classList.add("apexcharts-gridline"),a.add(h)}},{key:"_drawGridBandRect",value:function(t){var e,i,n=t.c,o=t.x1,a=t.y1,r=t.x2,s=t.y2,l=t.type,c=this.w,h=new M(this.ctx),u=c.globals.barPadForNumericAxis;"column"===l&&"datetime"===c.config.xaxis.type||(e=c.config.grid[l].colors[n],i=h.drawRect(o-("row"===l?u:0),a,r+("row"===l?2*u:0),s,0,e,c.config.grid[l].opacity),this.elg.add(i),i.attr("clip-path","url(#gridRectMask".concat(c.globals.cuid,")")),i.node.classList.add("apexcharts-grid-".concat(l)))}},{key:"_drawXYLines",value:function(t){var e,i,s=this,l=t.xCount,n=t.tickAmount,c=this.w;if((c.config.grid.xaxis.lines.show||c.config.xaxis.axisTicks.show)&&(e=c.globals.padHorizontal,i=c.globals.gridHeight,c.globals.timescaleLabels.length?function(t){for(var e=t.xC,i=t.x1,n=t.y1,o=t.x2,a=t.y2,r=0;r<e;r++)i=s.xaxisLabels[r].position,o=s.xaxisLabels[r].position,s._drawGridLines({i:r,x1:i,y1:n,x2:o,y2:a,xCount:l,parent:s.elgridLinesV})}({xC:l,x1:e,y1:0,x2:void 0,y2:i}):(c.globals.isXNumeric&&(l=c.globals.xAxisScale.result.length),c.config.xaxis.convertedCatToNumeric&&(l=c.globals.xaxisLabelsCount),function(t){for(var e=t.xC,i=t.x1,n=t.y1,o=t.x2,a=t.y2,r=0;r<e+(c.globals.isXNumeric?0:1);r++)0===r&&1===e&&1===c.globals.dataPoints&&(o=i=c.globals.gridWidth/2),s._drawGridLines({i:r,x1:i,y1:n,x2:o,y2:a,xCount:l,parent:s.elgridLinesV}),o=i+=c.globals.gridWidth/(c.globals.isXNumeric?e-1:e)}({xC:l,x1:e,y1:0,x2:void 0,y2:i}))),c.config.grid.yaxis.lines.show){var o=0,a=0,r=c.globals.gridWidth,h=n+1;this.isTimelineBar&&(h=c.globals.labels.length);for(var u=0;u<h+(this.isTimelineBar?1:0);u++)this._drawGridLine({x1:0,y1:o,x2:r,y2:a,parent:this.elgridLinesH}),a=o+=c.globals.gridHeight/(this.isTimelineBar?h:n)}}},{key:"_drawInvertedXYLines",value:function(t){var e=t.xCount,i=this.w;if(i.config.grid.xaxis.lines.show||i.config.xaxis.axisTicks.show)for(var n,o=i.globals.padHorizontal,a=i.globals.gridHeight,r=0;r<e+1;r++)i.config.grid.xaxis.lines.show&&this._drawGridLine({x1:o,y1:0,x2:n,y2:a,parent:this.elgridLinesV}),new tt(this.ctx).drawXaxisTicks(o,this.elg),n=o=o+i.globals.gridWidth/e+.3;if(i.config.grid.yaxis.lines.show)for(var s=0,l=0,c=i.globals.gridWidth,h=0;h<i.globals.dataPoints+1;h++)this._drawGridLine({x1:0,y1:s,x2:c,y2:l,parent:this.elgridLinesH}),l=s+=i.globals.gridHeight/i.globals.dataPoints}},{key:"renderGrid",value:function(){var t=this.w,e=new M(this.ctx);this.elg=e.group({class:"apexcharts-grid"}),this.elgridLinesH=e.group({class:"apexcharts-gridlines-horizontal"}),this.elgridLinesV=e.group({class:"apexcharts-gridlines-vertical"}),this.elg.add(this.elgridLinesH),this.elg.add(this.elgridLinesV),t.config.grid.show||(this.elgridLinesV.hide(),this.elgridLinesH.hide());for(var i,n=t.globals.yAxisScale.length?t.globals.yAxisScale[0].result.length-1:5,o=0;o<t.globals.series.length&&(void 0!==t.globals.yAxisScale[o]&&(n=t.globals.yAxisScale[o].result.length-1),!(2<n));o++);return!t.globals.isBarHorizontal||this.isTimelineBar?(i=this.xaxisLabels.length,this.isTimelineBar&&(n=t.globals.labels.length,t.config.xaxis.tickAmount&&t.config.xaxis.labels.formatter&&(i=t.config.xaxis.tickAmount)),this._drawXYLines({xCount:i,tickAmount:n})):(i=n,n=t.globals.xTickAmount,this._drawInvertedXYLines({xCount:i,tickAmount:n})),this.drawGridBands(i,n),{el:this.elg,xAxisTickWidth:t.globals.gridWidth/i}}},{key:"drawGridBands",value:function(t,e){var i=this.w;if(void 0!==i.config.grid.row.colors&&0<i.config.grid.row.colors.length)for(var n=0,o=i.globals.gridHeight/e,a=i.globals.gridWidth,r=0,s=0;r<e;r++,s++)s>=i.config.grid.row.colors.length&&(s=0),this._drawGridBandRect({c:s,x1:0,y1:n,x2:a,y2:o,type:"row"}),n+=i.globals.gridHeight/e;if(void 0!==i.config.grid.column.colors&&0<i.config.grid.column.colors.length)for(var l=i.globals.isBarHorizontal||"category"!==i.config.xaxis.type&&!i.config.xaxis.convertedCatToNumeric?t:t-1,c=i.globals.padHorizontal,h=i.globals.padHorizontal+i.globals.gridWidth/l,u=i.globals.gridHeight,d=0,f=0;d<t;d++,f++)f>=i.config.grid.column.colors.length&&(f=0),this._drawGridBandRect({c:f,x1:c,y1:0,x2:h,y2:u,type:"column"}),c+=i.globals.gridWidth/l}}]),xe),it=(r(ye,[{key:"niceScale",value:function(t,e,i,n,o){var a=2<arguments.length&&void 0!==i?i:10,r=3<arguments.length&&void 0!==n?n:0,s=4<arguments.length?o:void 0,l=this.w;if("dataPoints"===a&&(a=l.globals.dataPoints-1),t===Number.MIN_VALUE&&0===e||!L.isNumber(t)&&!L.isNumber(e)||t===Number.MIN_VALUE&&e===-Number.MAX_VALUE)return t=0,e=a,this.linearScale(t,e,a);e<t?(console.warn("axis.min cannot be greater than axis.max"),e=t+.1):t===e&&(t=0===t?0:t-.5,e=0===e?2:e+.5);var c=[],h=Math.abs(e-t);h<1&&s&&("candlestick"===l.config.chart.type||"candlestick"===l.config.series[r].type||l.globals.isRangeData)&&(e*=1.01);var u=a+1;u<2?u=2:2<u&&(u-=2);var d=h/u,f=Math.floor(L.log10(d)),p=Math.pow(10,f),g=Math.round(d/p);g<1&&(g=1);var v=g*p,m=v*Math.floor(t/v),b=v*Math.ceil(e/v),y=m;if(s&&2<h){for(;c.push(y),!((y+=v)>b););return{result:c,niceMin:c[0],niceMax:c[c.length-1]}}var x=t;(c=[]).push(x);for(var w=Math.abs(e-t)/a,k=0;k<=a;k++)x+=w,c.push(x);return c[c.length-2]>=e&&c.pop(),{result:c,niceMin:c[0],niceMax:c[c.length-1]}}},{key:"linearScale",value:function(t,e,i){var n=2<arguments.length&&void 0!==i?i:10,o=Math.abs(e-t)/n;n===Number.MAX_VALUE&&(n=10,o=1);for(var a=[],r=t;0<=n;)a.push(r),r+=o,--n;return{result:a,niceMin:a[0],niceMax:a[a.length-1]}}},{key:"logarithmicScale",value:function(t,o,a,e){(o<=0||o===Number.MIN_VALUE)&&(o=.01);for(var r=Math.log(o)/Math.log(10),s=Math.log(a)/Math.log(10),i=Math.abs(a-o)/e,n=[],l=o;0<=e;)n.push(l),l+=i,--e;var c=n.map(function(t,e){t<=0&&(t=.01);var i=(s-r)/(a-o),n=Math.pow(10,r+i*(t-r));return Math.round(n/L.roundToBase(n,10))*L.roundToBase(n,10)});return 0===c[0]&&(c[0]=1),{result:c,niceMin:c[0],niceMax:c[c.length-1]}}},{key:"setYScaleForIndex",value:function(t,e,i){var n=this.w.globals,o=this.w.config,a=n.isBarHorizontal?o.xaxis:o.yaxis[t];void 0===n.yAxisScale[t]&&(n.yAxisScale[t]=[]);var r,s=Math.abs(i-e);a.logarithmic&&s<=5&&(n.invalidLogScale=!0),a.logarithmic&&5<s?(n.allSeriesCollapsed=!1,n.yAxisScale[t]=this.logarithmicScale(t,e,i,a.tickAmount?a.tickAmount:Math.floor(Math.log10(i)))):i!==-Number.MAX_VALUE&&L.isNumber(i)?(n.allSeriesCollapsed=!1,void 0===a.min&&void 0===a.max||a.forceNiceScale?(r=void 0===o.yaxis[t].max&&void 0===o.yaxis[t].min||o.yaxis[t].forceNiceScale,n.yAxisScale[t]=this.niceScale(e,i,a.tickAmount?a.tickAmount:s<5&&1<s?s+1:5,t,r)):n.yAxisScale[t]=this.linearScale(e,i,a.tickAmount)):n.yAxisScale[t]=this.linearScale(0,5,5)}},{key:"setXScale",value:function(t,e){var i=this.w,n=i.globals,o=i.config.xaxis,a=Math.abs(e-t);return e!==-Number.MAX_VALUE&&L.isNumber(e)?n.xAxisScale=this.niceScale(t,e,o.tickAmount?o.tickAmount:a<5&&1<a?a+1:5,0):n.xAxisScale=this.linearScale(0,5,5),n.xAxisScale}},{key:"setMultipleYScales",value:function(){var a=this,t=this.w.globals,r=this.w.config,s=t.minYArr.concat([]),l=t.maxYArr.concat([]),c=[];r.yaxis.forEach(function(i,n){var o=n;r.series.forEach(function(t,e){t.name===i.seriesName&&(n!==(o=e)?c.push({index:e,similarIndex:n,alreadyExists:!0}):c.push({index:e}))});var t=s[o],e=l[o];a.setYScaleForIndex(n,t,e)}),this.sameScaleInMultipleAxes(s,l,c)}},{key:"sameScaleInMultipleAxes",value:function(t,o,e){var s=this,l=this.w.config,c=this.w.globals,a=[];e.forEach(function(t){t.alreadyExists&&(void 0===a[t.index]&&(a[t.index]=[]),a[t.index].push(t.index),a[t.index].push(t.similarIndex))}),(c.yAxisSameScaleIndices=a).forEach(function(n,o){a.forEach(function(t,e){var i;o!==e&&(i=t,0<n.filter(function(t){return-1!==i.indexOf(t)}).length)&&(a[o]=a[o].concat(a[e]))})});var i=a.map(function(i){return i.filter(function(t,e){return i.indexOf(t)===e})}).map(function(t){return t.sort()}),a=a.filter(function(t){return!!t}),n=(r=i.slice()).map(function(t){return JSON.stringify(t)}),r=r.filter(function(t,e){return n.indexOf(JSON.stringify(t))===e}),h=[],u=[];t.forEach(function(i,n){r.forEach(function(t,e){-1<t.indexOf(n)&&(void 0===h[e]&&(h[e]=[],u[e]=[]),h[e].push({key:n,value:i}),u[e].push({key:n,value:o[n]}))})});var d=Array.apply(null,Array(r.length)).map(Number.prototype.valueOf,Number.MIN_VALUE),f=Array.apply(null,Array(r.length)).map(Number.prototype.valueOf,-Number.MAX_VALUE);h.forEach(function(t,i){t.forEach(function(t,e){d[i]=Math.min(t.value,d[i])})}),u.forEach(function(t,i){t.forEach(function(t,e){f[i]=Math.max(t.value,f[i])})}),t.forEach(function(t,r){u.forEach(function(i,n){var o=d[n],a=f[n];l.chart.stacked&&(a=0,i.forEach(function(t,e){t.value!==-Number.MAX_VALUE&&(a+=t.value),o!==Number.MIN_VALUE&&(o+=h[n][e].value)})),i.forEach(function(t,e){i[e].key===r&&(void 0!==l.yaxis[r].min&&(o="function"==typeof l.yaxis[r].min?l.yaxis[r].min(c.minY):l.yaxis[r].min),void 0!==l.yaxis[r].max&&(a="function"==typeof l.yaxis[r].max?l.yaxis[r].max(c.maxY):l.yaxis[r].max),s.setYScaleForIndex(r,o,a))})})})}},{key:"autoScaleY",value:function(t,h,u){var d=(t=t||this).w;if(d.globals.isMultipleYAxis||d.globals.collapsedSeries.length)return console.warn("autoScaleYaxis is not supported in a multi-yaxis chart."),h;var f=d.globals.seriesX[0],p=d.config.chart.stacked;return h.forEach(function(n,t){for(var o=0,e=0;e<f.length;e++)if(f[e]>=u.xaxis.min){o=e;break}var r,s,a=d.globals.minYArr[t],l=d.globals.maxYArr[t],c=d.globals.stackedSeriesTotals;d.globals.series.forEach(function(i,t){var e=i[o];p?(e=c[o],r=s=e,c.forEach(function(t,e){f[e]<=u.xaxis.max&&f[e]>=u.xaxis.min&&(s<t&&null!==t&&(s=t),i[e]<r&&null!==i[e]&&(r=i[e]))})):(r=s=e,i.forEach(function(i,n){var o,a;f[n]<=u.xaxis.max&&f[n]>=u.xaxis.min&&(a=o=i,d.globals.series.forEach(function(t,e){null!==i&&(o=Math.min(t[n],o),a=Math.max(t[n],a))}),s<a&&null!==a&&(s=a),o<r&&null!==o&&(r=o))})),void 0===r&&void 0===s&&(r=a,s=l),(s*=s<0?.9:1.1)<0&&s<l&&(s=l),(r*=r<0?1.1:.9)<0&&a<r&&(r=a),1<h.length?(h[t].min=void 0===n.min?r:n.min,h[t].max=void 0===n.max?s:n.max):(h[0].min=void 0===n.min?r:n.min,h[0].max=void 0===n.max?s:n.max)})}),h}}]),ye),nt=(r(be,[{key:"init",value:function(){this.setYRange(),this.setXRange(),this.setZRange()}},{key:"getMinYMaxY",value:function(t,e,i,n){var o=1<arguments.length&&void 0!==e?e:Number.MAX_VALUE,a=2<arguments.length&&void 0!==i?i:-Number.MAX_VALUE,r=3<arguments.length&&void 0!==n?n:null,s=this.w.config,l=this.w.globals,c=-Number.MAX_VALUE,h=Number.MIN_VALUE;null===r&&(r=t+1);var u=l.series,d=u,f=u;"candlestick"===s.chart.type?(d=l.seriesCandleL,f=l.seriesCandleH):l.isRangeData&&(d=l.seriesRangeStart,f=l.seriesRangeEnd);for(var p=t;p<r;p++){l.dataPoints=Math.max(l.dataPoints,u[p].length);for(var g=0;g<l.series[p].length;g++){var v=u[p][g];null!==v&&L.isNumber(v)?(c=Math.max(c,f[p][g]),o=Math.min(o,d[p][g]),a=Math.max(a,d[p][g]),"candlestick"===this.w.config.chart.type&&(c=Math.max(c,l.seriesCandleO[p][g]),c=Math.max(c,l.seriesCandleH[p][g]),c=Math.max(c,l.seriesCandleL[p][g]),a=c=Math.max(c,l.seriesCandleC[p][g])),L.isFloat(v)&&(v=L.noExponents(v),l.yValueDecimal=Math.max(l.yValueDecimal,v.toString().split(".")[1].length)),h>d[p][g]&&d[p][g]<0&&(h=d[p][g])):l.hasNullValues=!0}}return"rangeBar"===s.chart.type&&l.seriesRangeStart.length&&l.isBarHorizontal&&"datetime"===s.xaxis.type&&(h=o),"bar"===s.chart.type&&(h<0&&c<0&&(c=0),h===Number.MIN_VALUE&&(h=0)),{minY:h,maxY:c,lowestY:o,highestY:a}}},{key:"setYRange",value:function(){var i=this.w.globals,e=this.w.config;i.maxY=-Number.MAX_VALUE,i.minY=Number.MIN_VALUE;var t=Number.MAX_VALUE;if(i.isMultipleYAxis)for(var n=0;n<i.series.length;n++){var o=this.getMinYMaxY(n,t,null,n+1);i.minYArr.push(o.minY),i.maxYArr.push(o.maxY),t=o.lowestY}var a,r=this.getMinYMaxY(0,t,null,i.series.length);return i.minY=r.minY,i.maxY=r.maxY,t=r.lowestY,e.chart.stacked&&this._setStackedMinMax(),"line"!==e.chart.type&&"area"!==e.chart.type&&"candlestick"!==e.chart.type&&("rangeBar"!==e.chart.type||i.isBarHorizontal)||i.minY!==Number.MIN_VALUE||t===-Number.MAX_VALUE||t===i.maxY||(a=i.maxY-t,0<=t&&t<=10&&(a=0),i.minY=t-5*a/100,0<t&&i.minY<0&&(i.minY=0),i.maxY=i.maxY+5*a/100),e.yaxis.forEach(function(t,e){void 0!==t.max&&("number"==typeof t.max?i.maxYArr[e]=t.max:"function"==typeof t.max&&(i.maxYArr[e]=t.max(i.maxY)),i.maxY=i.maxYArr[e]),void 0!==t.min&&("number"==typeof t.min?i.minYArr[e]=t.min:"function"==typeof t.min&&(i.minYArr[e]=t.min(i.minY)),i.minY=i.minYArr[e])}),i.isBarHorizontal&&["min","max"].forEach(function(t){void 0!==e.xaxis[t]&&"number"==typeof e.xaxis[t]&&("min"===t?i.minY=e.xaxis[t]:i.maxY=e.xaxis[t])}),i.isMultipleYAxis?(this.scales.setMultipleYScales(),i.minY=t,i.yAxisScale.forEach(function(t,e){i.minYArr[e]=t.niceMin,i.maxYArr[e]=t.niceMax})):(this.scales.setYScaleForIndex(0,i.minY,i.maxY),i.minY=i.yAxisScale[0].niceMin,i.maxY=i.yAxisScale[0].niceMax,i.minYArr[0]=i.yAxisScale[0].niceMin,i.maxYArr[0]=i.yAxisScale[0].niceMax),{minY:i.minY,maxY:i.maxY,minYArr:i.minYArr,maxYArr:i.maxYArr}}},{key:"setXRange",value:function(){var t,i=this.w.globals,e=this.w.config,n="numeric"===e.xaxis.type||"datetime"===e.xaxis.type||"category"===e.xaxis.type&&!i.noLabelsProvided||i.noLabelsProvided||i.isXNumeric;if(i.isXNumeric&&function(){for(var t=0;t<i.series.length;t++)if(i.labels[t])for(var e=0;e<i.labels[t].length;e++)null!==i.labels[t][e]&&L.isNumber(i.labels[t][e])&&(i.maxX=Math.max(i.maxX,i.labels[t][e]),i.initialMaxX=Math.max(i.maxX,i.labels[t][e]),i.minX=Math.min(i.minX,i.labels[t][e]),i.initialMinX=Math.min(i.minX,i.labels[t][e]))}(),i.noLabelsProvided&&0===e.xaxis.categories.length&&(i.maxX=i.labels[i.labels.length-1],i.initialMaxX=i.labels[i.labels.length-1],i.minX=1,i.initialMinX=1),i.isXNumeric||i.noLabelsProvided||i.dataFormatXNumeric){if(void 0===e.xaxis.tickAmount?(t=Math.round(i.svgWidth/150),"numeric"===e.xaxis.type&&i.dataPoints<30&&(t=i.dataPoints-1),t>i.dataPoints&&0!==i.dataPoints&&(t=i.dataPoints-1)):"dataPoints"===e.xaxis.tickAmount?(1<i.series.length&&(t=i.series[i.maxValsInArrayIndex].length-1),i.isXNumeric&&(t=i.maxX-i.minX-1)):t=e.xaxis.tickAmount,i.xTickAmount=t,void 0!==e.xaxis.max&&"number"==typeof e.xaxis.max&&(i.maxX=e.xaxis.max),void 0!==e.xaxis.min&&"number"==typeof e.xaxis.min&&(i.minX=e.xaxis.min),void 0!==e.xaxis.range&&(i.minX=i.maxX-e.xaxis.range),i.minX!==Number.MAX_VALUE&&i.maxX!==-Number.MAX_VALUE)if(e.xaxis.convertedCatToNumeric&&!i.dataFormatXNumeric){for(var o=[],a=i.minX-1;a<i.maxX;a++)o.push(a+1);i.xAxisScale={result:o,niceMin:o[0],niceMax:o[o.length-1]}}else i.xAxisScale=this.scales.setXScale(i.minX,i.maxX);else i.xAxisScale=this.scales.linearScale(1,t,t),i.noLabelsProvided&&0<i.labels.length&&(i.xAxisScale=this.scales.linearScale(1,i.labels.length,t-1),i.seriesX=i.labels.slice());n&&(i.labels=i.xAxisScale.result.slice())}return i.isBarHorizontal&&i.labels.length&&(i.xTickAmount=i.labels.length),this._handleSingleDataPoint(),this._getMinXDiff(),{minX:i.minX,maxX:i.maxX}}},{key:"setZRange",value:function(){var t=this.w.globals;if(t.isDataXYZ)for(var e=0;e<t.series.length;e++)if(void 0!==t.seriesZ[e])for(var i=0;i<t.seriesZ[e].length;i++)null!==t.seriesZ[e][i]&&L.isNumber(t.seriesZ[e][i])&&(t.maxZ=Math.max(t.maxZ,t.seriesZ[e][i]),t.minZ=Math.min(t.minZ,t.seriesZ[e][i]))}},{key:"_handleSingleDataPoint",value:function(){var t,e,i,n=this.w.globals,o=this.w.config;n.minX===n.maxX&&(t=new q(this.ctx),"datetime"===o.xaxis.type?((e=t.getDate(n.minX)).setUTCDate(e.getDate()-2),n.minX=new Date(e).getTime(),(i=t.getDate(n.maxX)).setUTCDate(i.getDate()+2),n.maxX=new Date(i).getTime()):"numeric"!==o.xaxis.type&&("category"!==o.xaxis.type||n.noLabelsProvided)||(n.minX=n.minX-2,n.initialMinX=n.minX,n.maxX=n.maxX+2,n.initialMaxX=n.maxX))}},{key:"_getMinXDiff",value:function(){var o=this.w.globals;o.isXNumeric&&o.seriesX.forEach(function(t,n){1===t.length&&t.push(o.seriesX[o.maxValsInArrayIndex][o.seriesX[o.maxValsInArrayIndex].length-1]);var e=t.slice();e.sort(function(t,e){return t-e}),e.forEach(function(t,e){var i;0<e&&0<(i=t-o.seriesX[n][e-1])&&(o.minXDiff=Math.min(i,o.minXDiff))}),1===o.dataPoints&&o.minXDiff===Number.MAX_VALUE&&(o.minXDiff=.5)})}},{key:"_setStackedMinMax",value:function(){var t=this.w.globals,e=[],i=[];if(t.series.length)for(var n=0;n<t.series[t.maxValsInArrayIndex].length;n++)for(var o=0,a=0,r=0;r<t.series.length;r++)null!==t.series[r][n]&&L.isNumber(t.series[r][n])&&(0<t.series[r][n]?o=o+parseFloat(t.series[r][n])+1e-4:a+=parseFloat(t.series[r][n])),r===t.series.length-1&&(e.push(o),i.push(a));for(var s=0;s<e.length;s++)t.maxY=Math.max(t.maxY,e[s]),t.minY=Math.min(t.minY,i[s])}}]),be),ot=(r(me,[{key:"drawYaxis",value:function(r){var s=this.w,l=new M(this.ctx),c=s.config.yaxis[r].labels.style,h=c.fontSize,u=c.fontFamily,d=c.fontWeight,t=l.group({class:"apexcharts-yaxis",rel:r,transform:"translate("+s.globals.translateYAxisX[r]+", 0)"});if(this.axesUtils.isYAxisHidden(r))return t;var f=l.group({class:"apexcharts-yaxis-texts-g"});t.add(f);var e,i,n,p=s.globals.yAxisScale[r].result.length-1,g=s.globals.gridHeight/p,v=s.globals.translateY,m=s.globals.yLabelFormatters[r],b=s.globals.yAxisScale[r].result.slice(),b=this.axesUtils.checkForReversedLabels(r,b),y="";if(s.config.yaxis[r].labels.show)for(var o=p;0<=o;o--)!function(t){var e=b[t];e=m(e,t);var i=s.config.yaxis[r].labels.padding;s.config.yaxis[r].opposite&&0!==s.config.yaxis.length&&(i*=-1);var n,o,a=l.drawText({x:i,y:v+p/10+s.config.yaxis[r].labels.offsetY+1,text:e,textAnchor:s.config.yaxis[r].opposite?"start":"end",fontSize:h,fontFamily:u,fontWeight:d,foreColor:Array.isArray(c.colors)?c.colors[t]:c.colors,isPlainText:!1,cssClass:"apexcharts-yaxis-label "+c.cssClass});t===p&&(y=a),f.add(a),0!==s.config.yaxis[r].labels.rotate&&(n=l.rotateAroundCenter(y.node),o=l.rotateAroundCenter(a.node),a.node.setAttribute("transform","rotate(".concat(s.config.yaxis[r].labels.rotate," ").concat(n.x," ").concat(o.y,")"))),v+=g}(o);void 0!==s.config.yaxis[r].title.text&&(e=l.group({class:"apexcharts-yaxis-title"}),i=0,s.config.yaxis[r].opposite&&(i=s.globals.translateYAxisX[r]),n=l.drawText({x:i,y:s.globals.gridHeight/2+s.globals.translateY+s.config.yaxis[r].title.offsetY,text:s.config.yaxis[r].title.text,textAnchor:"end",foreColor:s.config.yaxis[r].title.style.color,fontSize:s.config.yaxis[r].title.style.fontSize,fontWeight:s.config.yaxis[r].title.style.fontWeight,fontFamily:s.config.yaxis[r].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text "+s.config.yaxis[r].title.style.cssClass}),e.add(n),t.add(e));var a,x=s.config.yaxis[r].axisBorder,w=31+x.offsetX;return s.config.yaxis[r].opposite&&(w=-31-x.offsetX),x.show&&(a=l.drawLine(w,s.globals.translateY+x.offsetY-2,w,s.globals.gridHeight+s.globals.translateY+x.offsetY+2,x.color,0,x.width),t.add(a)),s.config.yaxis[r].axisTicks.show&&this.axesUtils.drawYAxisTicks(w,p,x,s.config.yaxis[r].axisTicks,r,g,t),t}},{key:"drawYaxisInversed",value:function(t){var e=this.w,i=new M(this.ctx),n=i.group({class:"apexcharts-xaxis apexcharts-yaxis-inversed"}),o=i.group({class:"apexcharts-xaxis-texts-g",transform:"translate(".concat(e.globals.translateXAxisX,", ").concat(e.globals.translateXAxisY,")")});n.add(o);var a=e.globals.yAxisScale[t].result.length-1,r=e.globals.gridWidth/a+.1,s=r+e.config.xaxis.labels.offsetX,l=e.globals.xLabelFormatter,c=e.globals.yAxisScale[t].result.slice(),h=e.globals.timescaleLabels;0<h.length&&(this.xaxisLabels=h.slice(),a=(c=h.slice()).length),c=this.axesUtils.checkForReversedLabels(t,c);var u=h.length;if(e.config.xaxis.labels.show)for(var d=u?0:a;u?d<u:0<=d;u?d++:d--){var f=c[d];f=l(f,d);var p,g=e.globals.gridWidth+e.globals.padHorizontal-(s-r+e.config.xaxis.labels.offsetX);h.length&&(g=(p=this.axesUtils.getLabel(c,h,g,d,this.drawnLabels,this.xaxisFontSize)).x,f=p.text,this.drawnLabels.push(p.text),0===d&&e.globals.skipFirstTimelinelabel&&(f=""),d===c.length-1&&e.globals.skipLastTimelinelabel&&(f=""));var v=i.drawText({x:g,y:this.xAxisoffX+e.config.xaxis.labels.offsetY+30-("top"===e.config.xaxis.position?e.globals.xAxisHeight+e.config.xaxis.axisTicks.height-2:0),text:f,textAnchor:"middle",foreColor:Array.isArray(this.xaxisForeColors)?this.xaxisForeColors[t]:this.xaxisForeColors,fontSize:this.xaxisFontSize,fontFamily:this.xaxisFontFamily,fontWeight:e.config.xaxis.labels.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-xaxis-label "+e.config.xaxis.labels.style.cssClass});o.add(v),v.tspan(f);var m=document.createElementNS(e.globals.SVGNS,"title");m.textContent=f,v.node.appendChild(m),s+=r}return this.inversedYAxisTitleText(n),this.inversedYAxisBorder(n),n}},{key:"inversedYAxisBorder",value:function(t){var e,i,n=this.w,o=new M(this.ctx),a=n.config.xaxis.axisBorder;a.show&&(e=0,"bar"===n.config.chart.type&&n.globals.isXNumeric&&(e-=15),i=o.drawLine(n.globals.padHorizontal+e+a.offsetX,this.xAxisoffX,n.globals.gridWidth,this.xAxisoffX,a.color,0,a.height),t.add(i))}},{key:"inversedYAxisTitleText",value:function(t){var e,i,n=this.w,o=new M(this.ctx);void 0!==n.config.xaxis.title.text&&(e=o.group({class:"apexcharts-xaxis-title apexcharts-yaxis-title-inversed"}),i=o.drawText({x:n.globals.gridWidth/2+n.config.xaxis.title.offsetX,y:this.xAxisoffX+parseFloat(this.xaxisFontSize)+parseFloat(n.config.xaxis.title.style.fontSize)+n.config.xaxis.title.offsetY+20,text:n.config.xaxis.title.text,textAnchor:"middle",fontSize:n.config.xaxis.title.style.fontSize,fontFamily:n.config.xaxis.title.style.fontFamily,fontWeight:n.config.xaxis.title.style.fontWeight,cssClass:"apexcharts-xaxis-title-text "+n.config.xaxis.title.style.cssClass}),e.add(i),t.add(e))}},{key:"yAxisTitleRotate",value:function(t,e){var i=this.w,n=new M(this.ctx),o={width:0,height:0},a={width:0,height:0},r=i.globals.dom.baseEl.querySelector(" .apexcharts-yaxis[rel='".concat(t,"'] .apexcharts-yaxis-texts-g"));null!==r&&(o=r.getBoundingClientRect());var s,l,c=i.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(t,"'] .apexcharts-yaxis-title text"));null!==c&&(a=c.getBoundingClientRect()),null!==c&&(s=this.xPaddingForYAxisTitle(t,o,a,e),c.setAttribute("x",s.xPos-(e?10:0))),null!==c&&(l=n.rotateAroundCenter(c),c.setAttribute("transform","rotate(".concat(e?-1*i.config.yaxis[t].title.rotate:i.config.yaxis[t].title.rotate," ").concat(l.x," ").concat(l.y,")")))}},{key:"xPaddingForYAxisTitle",value:function(t,e,i,n){var o=this.w,a=0,r=10;return void 0===o.config.yaxis[t].title.text||t<0?{xPos:a,padd:0}:(n?a=e.width+o.config.yaxis[t].title.offsetX+i.width/2+r/2:(a=-1*e.width+o.config.yaxis[t].title.offsetX+r/2+i.width/2,o.globals.isBarHorizontal&&(r=25,a=-1*e.width-o.config.yaxis[t].title.offsetX-r)),{xPos:a,padd:r})}},{key:"setYAxisXPosition",value:function(o,a){var r=this.w,s=0,l=0,c=18,h=1;1<r.config.yaxis.length&&(this.multipleYs=!0),r.config.yaxis.map(function(t,e){var i=-1<r.globals.ignoreYAxisIndexes.indexOf(e)||!t.show||t.floating||0===o[e].width,n=o[e].width+a[e].width;t.opposite?r.globals.isBarHorizontal?(l=r.globals.gridWidth+r.globals.translateX-1,r.globals.translateYAxisX[e]=l-t.labels.offsetX):(l=r.globals.gridWidth+r.globals.translateX+h,i||(h=h+n+20),r.globals.translateYAxisX[e]=l-t.labels.offsetX+20):(s=r.globals.translateX-c,i||(c=c+n+20),r.globals.translateYAxisX[e]=s+t.labels.offsetX)})}},{key:"setYAxisTextAlignments",value:function(){var r=this.w,t=r.globals.dom.baseEl.getElementsByClassName("apexcharts-yaxis");(t=L.listToArray(t)).forEach(function(t,e){var i,n,o,a=r.config.yaxis[e];void 0!==a.labels.align&&(i=r.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(e,"'] .apexcharts-yaxis-texts-g")),n=r.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis[rel='".concat(e,"'] .apexcharts-yaxis-label")),n=L.listToArray(n),o=i.getBoundingClientRect(),"left"===a.labels.align?(n.forEach(function(t,e){t.setAttribute("text-anchor","start")}),a.opposite||i.setAttribute("transform","translate(-".concat(o.width,", 0)"))):"center"===a.labels.align?(n.forEach(function(t,e){t.setAttribute("text-anchor","middle")}),i.setAttribute("transform","translate(".concat(o.width/2*(a.opposite?1:-1),", 0)"))):"right"===a.labels.align&&(n.forEach(function(t,e){t.setAttribute("text-anchor","end")}),a.opposite&&i.setAttribute("transform","translate(".concat(o.width,", 0)"))))})}}]),me),at=(r(ve,[{key:"addEventListener",value:function(t,e){var i=this.w;i.globals.events.hasOwnProperty(t)?i.globals.events[t].push(e):i.globals.events[t]=[e]}},{key:"removeEventListener",value:function(t,e){var i,n=this.w;!n.globals.events.hasOwnProperty(t)||-1!==(i=n.globals.events[t].indexOf(e))&&n.globals.events[t].splice(i,1)}},{key:"fireEvent",value:function(t,e){var i=this.w;if(i.globals.events.hasOwnProperty(t)){e&&e.length||(e=[]);for(var n=i.globals.events[t],o=n.length,a=0;a<o;a++)n[a].apply(null,e)}}},{key:"setupEventHandlers",value:function(){var e=this,i=this.w,n=this.ctx,o=i.globals.dom.baseEl.querySelector(i.globals.chartClass);this.ctx.eventList.forEach(function(t){o.addEventListener(t,function(t){var e=Object.assign({},i,{seriesIndex:i.globals.capturedSeriesIndex,dataPointIndex:i.globals.capturedDataPointIndex});"mousemove"===t.type||"touchmove"===t.type?"function"==typeof i.config.chart.events.mouseMove&&i.config.chart.events.mouseMove(t,n,e):("mouseup"===t.type&&1===t.which||"touchend"===t.type)&&("function"==typeof i.config.chart.events.click&&i.config.chart.events.click(t,n,e),n.ctx.events.fireEvent("click",[t,n,e]))},{capture:!1,passive:!0})}),this.ctx.eventList.forEach(function(t){i.globals.dom.baseEl.addEventListener(t,e.documentEvent)}),this.ctx.core.setupBrushHandler()}},{key:"documentEvent",value:function(t){var e,i=this.w,n=t.target.className;"click"!==t.type||(e=i.globals.dom.baseEl.querySelector(".apexcharts-menu"))&&e.classList.contains("apexcharts-menu-open")&&"apexcharts-menu-icon"!==n&&e.classList.remove("apexcharts-menu-open"),i.globals.clientX="touchmove"===t.type?t.touches[0].clientX:t.clientX,i.globals.clientY="touchmove"===t.type?t.touches[0].clientY:t.clientY}}]),ve),rt=(r(ge,[{key:"setCurrentLocaleValues",value:function(e){var t=this.w.config.chart.locales;window.Apex.chart&&window.Apex.chart.locales&&0<window.Apex.chart.locales.length&&(t=this.w.config.chart.locales.concat(window.Apex.chart.locales));var i=t.filter(function(t){return t.name===e})[0];if(!i)throw new Error("Wrong locale name provided. Please make sure you set the correct locale name in options");var n=L.extend(_,i);this.w.globals.locale=n.options}}]),ge),st=(r(pe,[{key:"drawAxis",value:function(t){var e,i,n=this.w.globals,o=this.w.config,a=new tt(this.ctx),r=new ot(this.ctx);n.axisCharts&&"radar"!==t&&(n.isBarHorizontal?(i=r.drawYaxisInversed(0),e=a.drawXaxisInversed(0),n.dom.elGraphical.add(e),n.dom.elGraphical.add(i)):(e=a.drawXaxis(),n.dom.elGraphical.add(e),o.yaxis.map(function(t,e){-1===n.ignoreYAxisIndexes.indexOf(e)&&(i=r.drawYaxis(e),n.dom.Paper.add(i))}))),o.yaxis.map(function(t,e){-1===n.ignoreYAxisIndexes.indexOf(e)&&r.yAxisTitleRotate(e,t.opposite)})}}]),pe),lt=(r(fe,[{key:"drawXCrosshairs",value:function(){var t,e=this.w,i=new M(this.ctx),n=new N(this.ctx),o=e.config.xaxis.crosshairs.fill.gradient,a=e.config.xaxis.crosshairs.dropShadow,r=e.config.xaxis.crosshairs.fill.type,s=o.colorFrom,l=o.colorTo,c=o.opacityFrom,h=o.opacityTo,u=o.stops,d=a.enabled,f=a.left,p=a.top,g=a.blur,v=a.color,m=a.opacity,b=e.config.xaxis.crosshairs.fill.color;e.config.xaxis.crosshairs.show&&("gradient"===r&&(b=i.drawGradient("vertical",s,l,c,h,null,u,null)),t=i.drawRect(),1===e.config.xaxis.crosshairs.width&&(t=i.drawLine()),t.attr({class:"apexcharts-xcrosshairs",x:0,y:0,y2:e.globals.gridHeight,width:L.isNumber(e.config.xaxis.crosshairs.width)?e.config.xaxis.crosshairs.width:0,height:e.globals.gridHeight,fill:b,filter:"none","fill-opacity":e.config.xaxis.crosshairs.opacity,stroke:e.config.xaxis.crosshairs.stroke.color,"stroke-width":e.config.xaxis.crosshairs.stroke.width,"stroke-dasharray":e.config.xaxis.crosshairs.stroke.dashArray}),d&&(t=n.dropShadow(t,{left:f,top:p,blur:g,color:v,opacity:m})),e.globals.dom.elGraphical.add(t))}},{key:"drawYCrosshairs",value:function(){var t,e=this.w,i=new M(this.ctx),n=e.config.yaxis[0].crosshairs,o=e.globals.barPadForNumericAxis;e.config.yaxis[0].crosshairs.show&&((t=i.drawLine(-o,0,e.globals.gridWidth+o,0,n.stroke.color,n.stroke.dashArray,n.stroke.width)).attr({class:"apexcharts-ycrosshairs"}),e.globals.dom.elGraphical.add(t));var a=i.drawLine(-o,0,e.globals.gridWidth+o,0,n.stroke.color,0,0);a.attr({class:"apexcharts-ycrosshairs-hidden"}),e.globals.dom.elGraphical.add(a)}}]),fe),ct=(r(de,[{key:"checkResponsiveConfig",value:function(t){var a,r,e,i,s=this,l=this.w,n=l.config;0!==n.responsive.length&&((a=n.responsive.slice()).sort(function(t,e){return t.breakpoint>e.breakpoint?1:e.breakpoint>t.breakpoint?-1:0}).reverse(),r=new V({}),e=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=a[0].breakpoint,i=0<window.innerWidth?window.innerWidth:screen.width;if(e<i){var n=E.extendArrayProps(r,l.globals.initialConfig,l),t=L.extend(n,t);t=L.extend(l.config,t),s.overrideResponsiveOptions(t)}else for(var o=0;o<a.length;o++)i<a[o].breakpoint&&(t=E.extendArrayProps(r,a[o].options,l),t=L.extend(l.config,t),s.overrideResponsiveOptions(t))},t?(i=E.extendArrayProps(r,t,l),i=L.extend(l.config,i),e(i=L.extend(i,t))):e({}))}},{key:"overrideResponsiveOptions",value:function(t){var e=new V(t).init({responsiveOverride:!0});this.w.config=e}}]),de),ht=(r(ue,[{key:"init",value:function(){this.setDefaultColors()}},{key:"setDefaultColors",value:function(){var n=this,o=this.w,t=new L;if(o.globals.dom.elWrap.classList.add("apexcharts-theme-".concat(o.config.theme.mode)),void 0===o.config.colors?o.globals.colors=this.predefined():(o.globals.colors=o.config.colors,Array.isArray(o.config.colors)&&0<o.config.colors.length&&"function"==typeof o.config.colors[0]&&(o.globals.colors=o.config.series.map(function(t,e){var i=o.config.colors[e];return"function"==typeof(i=i||o.config.colors[0])?(n.isColorFn=!0,i({value:o.globals.axisCharts?o.globals.series[e][0]?o.globals.series[e][0]:0:o.globals.series[e],seriesIndex:e,dataPointIndex:e,w:o})):i}))),o.globals.seriesColors.map(function(t,e){t&&(o.globals.colors[e]=t)}),o.config.theme.monochrome.enabled){var e=[],i=o.globals.series.length;this.isBarDistributed&&(i=o.globals.series[0].length*o.globals.series.length);for(var a=o.config.theme.monochrome.color,r=1/(i/o.config.theme.monochrome.shadeIntensity),s=o.config.theme.monochrome.shadeTo,l=0,c=0;c<i;c++){var h=void 0,h="dark"===s?t.shadeColor(-1*l,a):t.shadeColor(l,a);l+=r,e.push(h)}o.globals.colors=e.slice()}var u=o.globals.colors.slice();this.pushExtraColors(o.globals.colors),["fill","stroke"].forEach(function(t){void 0===o.config[t].colors?o.globals[t].colors=n.isColorFn?o.config.colors:u:o.globals[t].colors=o.config[t].colors.slice(),n.pushExtraColors(o.globals[t].colors)}),void 0===o.config.dataLabels.style.colors?o.globals.dataLabels.style.colors=u:o.globals.dataLabels.style.colors=o.config.dataLabels.style.colors.slice(),this.pushExtraColors(o.globals.dataLabels.style.colors,50),void 0===o.config.plotOptions.radar.polygons.fill.colors?o.globals.radarPolygons.fill.colors=["dark"===o.config.theme.mode?"#424242":"#fff"]:o.globals.radarPolygons.fill.colors=o.config.plotOptions.radar.polygons.fill.colors.slice(),this.pushExtraColors(o.globals.radarPolygons.fill.colors,20),void 0===o.config.markers.colors?o.globals.markers.colors=u:o.globals.markers.colors=o.config.markers.colors.slice(),this.pushExtraColors(o.globals.markers.colors)}},{key:"pushExtraColors",value:function(t,e,i){var n=2<arguments.length&&void 0!==i?i:null,o=this.w,a=e||o.globals.series.length;if(null===n&&(n=this.isBarDistributed||"heatmap"===o.config.chart.type&&o.config.plotOptions.heatmap.colorScale.inverse),n&&(a=o.globals.series[0].length*o.globals.series.length),t.length<a)for(var r=a-t.length,s=0;s<r;s++)t.push(t[s])}},{key:"updateThemeOptions",value:function(t){t.chart=t.chart||{},t.tooltip=t.tooltip||{};var e=t.theme.mode||"light",i=t.theme.palette?t.theme.palette:"dark"===e?"palette4":"palette1",n=t.chart.foreColor?t.chart.foreColor:"dark"===e?"#f6f7f8":"#373d3f";return t.tooltip.theme=e,t.chart.foreColor=n,t.theme.palette=i,t}},{key:"predefined",value:function(){switch(this.w.config.theme.palette){case"palette1":this.colors=["#008FFB","#00E396","#FEB019","#FF4560","#775DD0"];break;case"palette2":this.colors=["#3f51b5","#03a9f4","#4caf50","#f9ce1d","#FF9800"];break;case"palette3":this.colors=["#33b2df","#546E7A","#d4526e","#13d8aa","#A5978B"];break;case"palette4":this.colors=["#4ecdc4","#c7f464","#81D4FA","#fd6a6a","#546E7A"];break;case"palette5":this.colors=["#2b908f","#f9a3a4","#90ee7e","#fa4443","#69d2e7"];break;case"palette6":this.colors=["#449DD1","#F86624","#EA3546","#662E9B","#C5D86D"];break;case"palette7":this.colors=["#D7263D","#1B998B","#2E294E","#F46036","#E2C044"];break;case"palette8":this.colors=["#662E9B","#F86624","#F9C80E","#EA3546","#43BCCD"];break;case"palette9":this.colors=["#5C4742","#A5978B","#8D5B4C","#5A2A27","#C4BBAF"];break;case"palette10":this.colors=["#A300D6","#7D02EB","#5653FE","#2983FF","#00B1F2"];break;default:this.colors=["#008FFB","#00E396","#FEB019","#FF4560","#775DD0"]}return this.colors}}]),ue),ut=(r(he,[{key:"draw",value:function(){this.drawTitleSubtitle("title"),this.drawTitleSubtitle("subtitle")}},{key:"drawTitleSubtitle",value:function(t){var e,i=this.w,n="title"===t?i.config.title:i.config.subtitle,o=i.globals.svgWidth/2,a=n.offsetY,r="middle";"left"===n.align?(o=10,r="start"):"right"===n.align&&(o=i.globals.svgWidth-10,r="end"),o+=n.offsetX,a=a+parseInt(n.style.fontSize,10)+n.margin/2,void 0!==n.text&&((e=new M(this.ctx).drawText({x:o,y:a,text:n.text,textAnchor:r,fontSize:n.style.fontSize,fontFamily:n.style.fontFamily,fontWeight:n.style.fontWeight,foreColor:n.style.color,opacity:1})).node.setAttribute("class","apexcharts-".concat(t,"-text")),i.globals.dom.Paper.add(e))}}]),he),dt=(r(ce,[{key:"getTitleSubtitleCoords",value:function(t){var e,i=this.w,n=0,o=0,a="title"===t?i.config.title.floating:i.config.subtitle.floating,r=i.globals.dom.baseEl.querySelector(".apexcharts-".concat(t,"-text"));return null===r||a||(n=(e=r.getBoundingClientRect()).width,o=i.globals.axisCharts?e.height+5:e.height),{width:n,height:o}}},{key:"getLegendsRect",value:function(){var t=this.w,e=t.globals.dom.baseEl.querySelector(".apexcharts-legend"),i=Object.assign({},L.getBoundingClientRect(e));return null!==e&&!t.config.legend.floating&&t.config.legend.show?this.dCtx.lgRect={x:i.x,y:i.y,height:i.height,width:0===i.height?0:i.width}:this.dCtx.lgRect={x:0,y:0,height:0,width:0},"left"!==t.config.legend.position&&"right"!==t.config.legend.position||1.5*this.dCtx.lgRect.width>t.globals.svgWidth&&(this.dCtx.lgRect.width=t.globals.svgWidth/1.5),this.dCtx.lgRect}},{key:"getLargestStringFromMultiArr",value:function(t,e){var i,n,o=t;return this.w.globals.isMultiLineX&&(i=e.map(function(t,e){return Array.isArray(t)?t.length:1}),n=Math.max.apply(Math,C(i)),o=e[i.indexOf(n)]),o}}]),ce),ft=(r(le,[{key:"getxAxisLabelsCoords",value:function(){var t,e,i,n,o,a,r,s,l,c,h,u=this.w,d=u.globals.labels.slice();return u.config.xaxis.convertedCatToNumeric&&0===d.length&&(d=u.globals.categoryLabels),0<u.globals.timescaleLabels.length?(e={width:(t=this.getxAxisTimeScaleLabelsCoords()).width,height:t.height},u.globals.rotateXLabels=!1):(this.dCtx.lgWidthForSideLegends="left"!==u.config.legend.position&&"right"!==u.config.legend.position||u.config.legend.floating?0:this.dCtx.lgRect.width,i=u.globals.xLabelFormatter,a=L.getLargestStringFromArr(d),r=this.dCtx.dimHelpers.getLargestStringFromMultiArr(a,d),u.globals.isBarHorizontal&&(r=a=u.globals.yAxisScale[0].result.reduce(function(t,e){return t.length>e.length?t:e},0)),o=a,a=(n=new Z(this.dCtx.ctx)).xLabelFormat(i,a,o),r=n.xLabelFormat(i,r,o),(u.config.xaxis.convertedCatToNumeric&&void 0===a||""===String(a).trim())&&(r=a="1"),l=h=(s=new M(this.dCtx.ctx)).getTextRects(a,u.config.xaxis.labels.style.fontSize),a!==r&&(l=s.getTextRects(r,u.config.xaxis.labels.style.fontSize)),(e={width:h.width>=l.width?h.width:l.width,height:h.height>=l.height?h.height:l.height}).width*d.length>u.globals.svgWidth-this.dCtx.lgWidthForSideLegends-this.dCtx.yAxisWidth-this.dCtx.gridPad.left-this.dCtx.gridPad.right&&0!==u.config.xaxis.labels.rotate||u.config.xaxis.labels.rotateAlways?u.globals.isBarHorizontal||(u.globals.rotateXLabels=!0,h=(c=function(t){return s.getTextRects(t,u.config.xaxis.labels.style.fontSize,u.config.xaxis.labels.style.fontFamily,"rotate(".concat(u.config.xaxis.labels.rotate," 0 0)"),!1)})(a),a!==r&&(l=c(r)),e.height=(h.height>l.height?h.height:l.height)/1.5,e.width=h.width>l.width?h.width:l.width):u.globals.rotateXLabels=!1),u.config.xaxis.labels.show||(e={width:0,height:0}),{width:e.width,height:e.height}}},{key:"getxAxisTitleCoords",value:function(){var t,e=this.w,i=0,n=0;return void 0!==e.config.xaxis.title.text&&(i=(t=new M(this.dCtx.ctx).getTextRects(e.config.xaxis.title.text,e.config.xaxis.title.style.fontSize)).width,n=t.height),{width:i,height:n}}},{key:"getxAxisTimeScaleLabelsCoords",value:function(){var t,e=this.w;this.dCtx.timescaleLabels=e.globals.timescaleLabels.slice();var i=this.dCtx.timescaleLabels.map(function(t){return t.value}),n=i.reduce(function(t,e){return void 0===t?(console.error("You have possibly supplied invalid Date format. Please supply a valid JavaScript Date"),0):t.length>e.length?t:e},0);return 1.05*(t=new M(this.dCtx.ctx).getTextRects(n,e.config.xaxis.labels.style.fontSize)).width*i.length>e.globals.gridWidth&&0!==e.config.xaxis.labels.rotate&&(e.globals.overlappingXLabels=!0),t}},{key:"additionalPaddingXLabels",value:function(t){var r=this,s=this.w,l=s.globals,c=s.config,h=c.xaxis.type,u=t.width;l.skipLastTimelinelabel=!1,l.skipFirstTimelinelabel=!1;var d=s.config.yaxis[0].opposite&&s.globals.isBarHorizontal;c.yaxis.forEach(function(t,e){var i,n,o,a;d?(r.dCtx.gridPad.left<u&&(r.dCtx.xPadLeft=u/2+1),r.dCtx.xPadRight=u/2+1):(i=e,-1!==l.collapsedSeriesIndices.indexOf(i)||("datetime"!==h&&r.dCtx.gridPad.left<u/2-r.dCtx.yAxisWidthLeft&&!l.rotateXLabels&&!c.xaxis.labels.trim&&(r.dCtx.xPadLeft=u/2+1),r.dCtx.timescaleLabels&&r.dCtx.timescaleLabels.length?(n=r.dCtx.timescaleLabels[0],o=r.dCtx.timescaleLabels[r.dCtx.timescaleLabels.length-1].position+u/1.75-r.dCtx.yAxisWidthRight,a=n.position-u/1.75+r.dCtx.yAxisWidthLeft,o>l.gridWidth&&(l.skipLastTimelinelabel=!0),a<0&&(l.skipFirstTimelinelabel=!0)):"datetime"===h?r.dCtx.gridPad.right<u&&!l.rotateXLabels&&(l.skipLastTimelinelabel=!0):"datetime"!==h&&r.dCtx.gridPad.right<u/2-r.dCtx.yAxisWidthRight&&!l.rotateXLabels&&("between"!==s.config.xaxis.tickPlacement||s.globals.isBarHorizontal)&&(r.dCtx.xPadRight=u/2+1)))})}}]),le),pt=(r(se,[{key:"getyAxisLabelsCoords",value:function(){var u=this,d=this.w,f=[],p=10,g=new Q(this.dCtx.ctx);return d.config.yaxis.map(function(t,e){var i,n,o,a,r,s,l,c,h=d.globals.yAxisScale[e];!g.isYAxisHidden(e)&&t.labels.show&&h.result.length?(void 0!==(r=a=(i=d.globals.yLabelFormatters[e])(n=String(h.niceMin).length>String(h.niceMax).length?h.niceMin:h.niceMax,{seriesIndex:e,dataPointIndex:-1,w:d}))&&0!==a.length||(a=n),d.globals.isBarHorizontal&&(p=0,o=d.globals.labels.slice(),a=i(a=L.getLargestStringFromArr(o),{seriesIndex:e,dataPointIndex:-1,w:d}),r=u.dCtx.dimHelpers.getLargestStringFromMultiArr(a,o)),c=l=(s=new M(u.dCtx.ctx)).getTextRects(a,t.labels.style.fontSize),a!==r&&(c=s.getTextRects(r,t.labels.style.fontSize)),f.push({width:(c.width>l.width?c.width:l.width)+p,height:c.height>l.height?c.height:l.height})):f.push({width:0,height:0})}),f}},{key:"getyAxisTitleCoords",value:function(){var n=this,t=this.w,o=[];return t.config.yaxis.map(function(t,e){var i;t.show&&void 0!==t.title.text?(i=new M(n.dCtx.ctx).getTextRects(t.title.text,t.title.style.fontSize,t.title.style.fontFamily,"rotate(-90 0 0)",!1),o.push({width:i.width,height:i.height})):o.push({width:0,height:0})}),o}},{key:"getTotalYAxisWidth",value:function(){function i(t,e){var i=o.config.yaxis[e].floating,n=0;0<t.width&&!i?(n=t.width+l,-1<o.globals.ignoreYAxisIndexes.indexOf(e)&&(n=n-t.width-l)):n=i||c.isYAxisHidden(e)?0:5,o.config.yaxis[e].opposite?s+=n:r+=n,a+=n}var o=this.w,a=0,r=0,s=0,l=1<o.globals.yAxisScale.length?10:0,c=new Q(this.dCtx.ctx);return o.globals.yLabelsCoords.map(function(t,e){i(t,e)}),o.globals.yTitleCoords.map(function(t,e){i(t,e)}),o.globals.isBarHorizontal&&(a=o.globals.yLabelsCoords[0].width+o.globals.yTitleCoords[0].width+15),this.dCtx.yAxisWidthLeft=r,this.dCtx.yAxisWidthRight=s,a}}]),se),gt=(r(re,[{key:"gridPadForColumnsInNumericAxis",value:function(t){var e=this.w;if(e.globals.noData||e.globals.allSeriesCollapsed)return 0;var i,n,o,a=e.config.chart.type,r=0,s="bar"===a||"rangeBar"===a?e.config.series.length:1;return 0<e.globals.comboBarCount&&(s=e.globals.comboBarCount),e.globals.collapsedSeries.forEach(function(t){"bar"!==t.type&&"rangeBar"!==t.type||--s}),e.config.chart.stacked&&(s=1),("bar"===a||"rangeBar"===a||0<e.globals.comboBarCount)&&e.globals.isXNumeric&&!e.globals.isBarHorizontal&&0<s&&((o=Math.abs(e.globals.initialMaxX-e.globals.initialMinX))<=3&&(o=e.globals.dataPoints),i=o/t,e.globals.minXDiff&&0<e.globals.minXDiff/i&&(n=e.globals.minXDiff/i),t/2<n&&(n/=2),(r=n/s*parseInt(e.config.plotOptions.bar.columnWidth,10)/100)<1&&(r=1),r=r/(1<s?1:1.5)+5,e.globals.barPadForNumericAxis=r),r}},{key:"gridPadFortitleSubtitle",value:function(){var e=this,i=this.w,t=i.globals,n=this.dCtx.isSparkline||!i.globals.axisCharts?0:10;["title","subtitle"].forEach(function(t){void 0!==i.config[t].text?n+=i.config[t].margin:n+=e.dCtx.isSparkline||!i.globals.axisCharts?0:5}),!i.config.legend.show||"bottom"!==i.config.legend.position||i.config.legend.floating||i.globals.axisCharts||(n+=10);var o=this.dCtx.dimHelpers.getTitleSubtitleCoords("title"),a=this.dCtx.dimHelpers.getTitleSubtitleCoords("subtitle");t.gridHeight=t.gridHeight-o.height-a.height-n,t.translateY=t.translateY+o.height+a.height+n}},{key:"setGridXPosForDualYAxis",value:function(i,n){var o=this.w,a=new Q(this.dCtx.ctx);o.config.yaxis.map(function(t,e){-1!==o.globals.ignoreYAxisIndexes.indexOf(e)||t.floating||a.isYAxisHidden(e)||(t.opposite&&(o.globals.translateX=o.globals.translateX-(n[e].width+i[e].width)-parseInt(o.config.yaxis[e].labels.style.fontSize,10)/1.2-12),o.globals.translateX<2&&(o.globals.translateX=2))})}}]),re),vt=(r(ae,[{key:"plotCoords",value:function(){var t=this.w.globals;this.lgRect=this.dimHelpers.getLegendsRect(),t.axisCharts?this.setDimensionsForAxisCharts():this.setDimensionsForNonAxisCharts(),this.dimGrid.gridPadFortitleSubtitle(),t.gridHeight=t.gridHeight-this.gridPad.top-this.gridPad.bottom,t.gridWidth=t.gridWidth-this.gridPad.left-this.gridPad.right-this.xPadRight-this.xPadLeft;var e=this.dimGrid.gridPadForColumnsInNumericAxis(t.gridWidth);t.gridWidth=t.gridWidth-2*e,t.translateX=t.translateX+this.gridPad.left+this.xPadLeft+(0<e?e+4:0),t.translateY=t.translateY+this.gridPad.top}},{key:"setDimensionsForAxisCharts",value:function(){var t=this,i=this.w,e=i.globals,n=this.dimYAxis.getyAxisLabelsCoords(),o=this.dimYAxis.getyAxisTitleCoords();i.globals.yLabelsCoords=[],i.globals.yTitleCoords=[],i.config.yaxis.map(function(t,e){i.globals.yLabelsCoords.push({width:n[e].width,index:e}),i.globals.yTitleCoords.push({width:o[e].width,index:e})}),this.yAxisWidth=this.dimYAxis.getTotalYAxisWidth();var a=this.dimXAxis.getxAxisLabelsCoords(),r=this.dimXAxis.getxAxisTitleCoords();this.conditionalChecksForAxisCoords(a,r),e.translateXAxisY=i.globals.rotateXLabels?this.xAxisHeight/8:-4,e.translateXAxisX=i.globals.rotateXLabels&&i.globals.isXNumeric&&i.config.xaxis.labels.rotate<=-45?-this.xAxisWidth/4:0,i.globals.isBarHorizontal&&(e.rotateXLabels=!1,e.translateXAxisY=parseInt(i.config.xaxis.labels.style.fontSize,10)/1.5*-1),e.translateXAxisY=e.translateXAxisY+i.config.xaxis.labels.offsetY,e.translateXAxisX=e.translateXAxisX+i.config.xaxis.labels.offsetX;var s=this.yAxisWidth,l=this.xAxisHeight;e.xAxisLabelsHeight=this.xAxisHeight,e.xAxisLabelsWidth=this.xAxisWidth,e.xAxisHeight=this.xAxisHeight;var c=10;function h(){e.translateX=s,e.gridHeight=e.svgHeight-t.lgRect.height-l-(t.isSparkline?0:i.globals.rotateXLabels?10:15),e.gridWidth=e.svgWidth-s}switch("radar"!==i.config.chart.type&&!this.isSparkline||(s=0,l=e.goldenPadding),this.isSparkline&&(this.lgRect={height:0,width:0},c=s=l=0),this.dimXAxis.additionalPaddingXLabels(a),"top"===i.config.xaxis.position&&(c=e.xAxisHeight-i.config.xaxis.axisTicks.height-5),i.config.legend.position){case"bottom":e.translateY=c,h();break;case"top":e.translateY=this.lgRect.height+c,h();break;case"left":e.translateY=c,e.translateX=this.lgRect.width+s,e.gridHeight=e.svgHeight-l-12,e.gridWidth=e.svgWidth-this.lgRect.width-s;break;case"right":e.translateY=c,e.translateX=s,e.gridHeight=e.svgHeight-l-12,e.gridWidth=e.svgWidth-this.lgRect.width-s-5;break;default:throw new Error("Legend position not supported")}this.dimGrid.setGridXPosForDualYAxis(o,n),new ot(this.ctx).setYAxisXPosition(n,o)}},{key:"setDimensionsForNonAxisCharts",value:function(){var t=this.w,e=t.globals,i=t.config,n=0;t.config.legend.show&&!t.config.legend.floating&&(n=20);var o="pie"===i.chart.type||"polarArea"===i.chart.type||"donut"===i.chart.type?"pie":"radialBar",a=i.plotOptions[o].offsetY,r=i.plotOptions[o].offsetX;if(!i.legend.show||i.legend.floating)return e.gridHeight=e.svgHeight-i.grid.padding.left+i.grid.padding.right,e.gridWidth=e.gridHeight,e.translateY=a,void(e.translateX=r+(e.svgWidth-e.gridWidth)/2);switch(i.legend.position){case"bottom":e.gridHeight=e.svgHeight-this.lgRect.height-e.goldenPadding,e.gridWidth=e.gridHeight,e.translateY=a-10,e.translateX=r+(e.svgWidth-e.gridWidth)/2;break;case"top":e.gridHeight=e.svgHeight-this.lgRect.height-e.goldenPadding,e.gridWidth=e.gridHeight,e.translateY=this.lgRect.height+a+10,e.translateX=r+(e.svgWidth-e.gridWidth)/2;break;case"left":e.gridWidth=e.svgWidth-this.lgRect.width-n,e.gridHeight="auto"!==i.chart.height?e.svgHeight:e.gridWidth,e.translateY=a,e.translateX=r+this.lgRect.width+n;break;case"right":e.gridWidth=e.svgWidth-this.lgRect.width-n-5,e.gridHeight="auto"!==i.chart.height?e.svgHeight:e.gridWidth,e.translateY=a,e.translateX=r+10;break;default:throw new Error("Legend position not supported")}}},{key:"conditionalChecksForAxisCoords",value:function(t,e){var i=this.w;this.xAxisHeight=(t.height+e.height)*(i.globals.isMultiLineX?1.2:i.globals.LINE_HEIGHT_RATIO)+(i.globals.rotateXLabels?22:10),this.xAxisWidth=t.width,this.xAxisHeight-e.height>i.config.xaxis.labels.maxHeight&&(this.xAxisHeight=i.config.xaxis.labels.maxHeight),i.config.xaxis.labels.minHeight&&this.xAxisHeight<i.config.xaxis.labels.minHeight&&(this.xAxisHeight=i.config.xaxis.labels.minHeight),i.config.xaxis.floating&&(this.xAxisHeight=0);var n=0,o=0;i.config.yaxis.forEach(function(t){n+=t.labels.minWidth,o+=t.labels.maxWidth}),this.yAxisWidth<n&&(this.yAxisWidth=n),this.yAxisWidth>o&&(this.yAxisWidth=o)}}]),ae),mt=(r(oe,[{key:"getLegendStyles",value:function(){var t=document.createElement("style");t.setAttribute("type","text/css");var e=document.createTextNode("\t\n    \t\n      .apexcharts-legend {\t\n        display: flex;\t\n        overflow: auto;\t\n        padding: 0 10px;\t\n      }\t\n      .apexcharts-legend.position-bottom, .apexcharts-legend.position-top {\t\n        flex-wrap: wrap\t\n      }\t\n      .apexcharts-legend.position-right, .apexcharts-legend.position-left {\t\n        flex-direction: column;\t\n        bottom: 0;\t\n      }\t\n      .apexcharts-legend.position-bottom.apexcharts-align-left, .apexcharts-legend.position-top.apexcharts-align-left, .apexcharts-legend.position-right, .apexcharts-legend.position-left {\t\n        justify-content: flex-start;\t\n      }\t\n      .apexcharts-legend.position-bottom.apexcharts-align-center, .apexcharts-legend.position-top.apexcharts-align-center {\t\n        justify-content: center;  \t\n      }\t\n      .apexcharts-legend.position-bottom.apexcharts-align-right, .apexcharts-legend.position-top.apexcharts-align-right {\t\n        justify-content: flex-end;\t\n      }\t\n      .apexcharts-legend-series {\t\n        cursor: pointer;\t\n        line-height: normal;\t\n      }\t\n      .apexcharts-legend.position-bottom .apexcharts-legend-series, .apexcharts-legend.position-top .apexcharts-legend-series{\t\n        display: flex;\t\n        align-items: center;\t\n      }\t\n      .apexcharts-legend-text {\t\n        position: relative;\t\n        font-size: 14px;\t\n      }\t\n      .apexcharts-legend-text *, .apexcharts-legend-marker * {\t\n        pointer-events: none;\t\n      }\t\n      .apexcharts-legend-marker {\t\n        position: relative;\t\n        display: inline-block;\t\n        cursor: pointer;\t\n        margin-right: 3px;\t\n        border-style: solid;\n      }\t\n      \t\n      .apexcharts-legend.apexcharts-align-right .apexcharts-legend-series, .apexcharts-legend.apexcharts-align-left .apexcharts-legend-series{\t\n        display: inline-block;\t\n      }\t\n      .apexcharts-legend-series.apexcharts-no-click {\t\n        cursor: auto;\t\n      }\t\n      .apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {\t\n        display: none !important;\t\n      }\t\n      .apexcharts-inactive-legend {\t\n        opacity: 0.45;\t\n      }");return t.appendChild(e),t}},{key:"getLegendBBox",value:function(){var t=this.w.globals.dom.baseEl.querySelector(".apexcharts-legend").getBoundingClientRect(),e=t.width;return{clwh:t.height,clww:e}}},{key:"appendToForeignObject",value:function(){var t=this.w.globals;t.dom.elLegendForeign=document.createElementNS(t.SVGNS,"foreignObject");var e=t.dom.elLegendForeign;e.setAttribute("x",0),e.setAttribute("y",0),e.setAttribute("width",t.svgWidth),e.setAttribute("height",t.svgHeight),t.dom.elLegendWrap.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),e.appendChild(t.dom.elLegendWrap),e.appendChild(this.getLegendStyles()),t.dom.Paper.node.insertBefore(e,t.dom.elGraphical.node)}},{key:"toggleDataSeries",value:function(t,e){var i,n,o,a,r,s=this,l=this.w;l.globals.axisCharts||"radialBar"===l.config.chart.type?(l.globals.resized=!0,n=i=null,l.globals.risingSeries=[],n=l.globals.axisCharts?(i=l.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(t,"']")),parseInt(i.getAttribute("data:realIndex"),10)):(i=l.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(t+1,"']")),parseInt(i.getAttribute("rel"),10)-1),e?[{cs:l.globals.collapsedSeries,csi:l.globals.collapsedSeriesIndices},{cs:l.globals.ancillaryCollapsedSeries,csi:l.globals.ancillaryCollapsedSeriesIndices}].forEach(function(t){s.riseCollapsedSeries(t.cs,t.csi,n)}):this.hideSeries({seriesEl:i,realIndex:n})):(o=l.globals.dom.Paper.select(" .apexcharts-series[rel='".concat(t+1,"'] path")),"pie"!==(a=l.config.chart.type)&&"polarArea"!==a&&"donut"!==a||(r=l.config.plotOptions.pie.donut.labels,new M(this.lgCtx.ctx).pathMouseDown(o.members[0],null),this.lgCtx.ctx.pie.printDataLabelsInner(o.members[0].node,r)),o.fire("click"))}},{key:"hideSeries",value:function(t){var e,i,n=t.seriesEl,o=t.realIndex,a=this.w,r=L.clone(a.config.series);a.globals.axisCharts?(e=!1,a.config.yaxis[o]&&a.config.yaxis[o].show&&a.config.yaxis[o].showAlways&&(e=!0,a.globals.ancillaryCollapsedSeriesIndices.indexOf(o)<0&&(a.globals.ancillaryCollapsedSeries.push({index:o,data:r[o].data.slice(),type:n.parentNode.className.baseVal.split("-")[1]}),a.globals.ancillaryCollapsedSeriesIndices.push(o))),e||(a.globals.collapsedSeries.push({index:o,data:r[o].data.slice(),type:n.parentNode.className.baseVal.split("-")[1]}),a.globals.collapsedSeriesIndices.push(o),i=a.globals.risingSeries.indexOf(o),a.globals.risingSeries.splice(i,1))):(a.globals.collapsedSeries.push({index:o,data:r[o]}),a.globals.collapsedSeriesIndices.push(o));for(var s=n.childNodes,l=0;l<s.length;l++)s[l].classList.contains("apexcharts-series-markers-wrap")&&(s[l].classList.contains("apexcharts-hide")?s[l].classList.remove("apexcharts-hide"):s[l].classList.add("apexcharts-hide"));a.globals.allSeriesCollapsed=a.globals.collapsedSeries.length===a.config.series.length,r=this._getSeriesBasedOnCollapsedState(r),this.lgCtx.ctx.updateHelpers._updateSeries(r,a.config.chart.animations.dynamicAnimation.enabled)}},{key:"riseCollapsedSeries",value:function(t,e,i){var n=this.w,o=L.clone(n.config.series);if(0<t.length){for(var a=0;a<t.length;a++)t[a].index===i&&(n.globals.axisCharts?o[i].data=t[a].data.slice():o[i]=t[a].data,t.splice(a,1),e.splice(a,1),n.globals.risingSeries.push(i));o=this._getSeriesBasedOnCollapsedState(o),this.lgCtx.ctx.updateHelpers._updateSeries(o,n.config.chart.animations.dynamicAnimation.enabled)}}},{key:"_getSeriesBasedOnCollapsedState",value:function(i){var n=this.w;return n.globals.axisCharts?i.forEach(function(t,e){-1<n.globals.collapsedSeriesIndices.indexOf(e)&&(i[e].data=[])}):i.forEach(function(t,e){-1<n.globals.collapsedSeriesIndices.indexOf(e)&&(i[e]=0)}),i}}]),oe),bt=(r(ne,[{key:"init",value:function(){var t=this.w,e=t.globals,i=t.config;if((i.legend.showForSingleSeries&&1===e.series.length||this.isBarsDistributed||1<e.series.length||!e.axisCharts)&&i.legend.show){for(;e.dom.elLegendWrap.firstChild;)e.dom.elLegendWrap.removeChild(e.dom.elLegendWrap.firstChild);this.drawLegends(),L.isIE11()?document.getElementsByTagName("head")[0].appendChild(this.legendHelpers.getLegendStyles()):this.legendHelpers.appendToForeignObject(),"bottom"===i.legend.position||"top"===i.legend.position?this.legendAlignHorizontal():"right"!==i.legend.position&&"left"!==i.legend.position||this.legendAlignVertical()}}},{key:"drawLegends",value:function(){var t,e=this.w,i=e.config.legend.fontFamily,n=e.globals.seriesNames,o=e.globals.colors.slice();"heatmap"===e.config.chart.type?(n=(t=e.config.plotOptions.heatmap.colorScale.ranges).map(function(t){return t.name?t.name:t.from+" - "+t.to}),o=t.map(function(t){return t.color})):this.isBarsDistributed&&(n=e.globals.labels.slice());for(var a=e.globals.legendFormatter,r=e.config.legend.inverseOrder,s=r?n.length-1:0;r?0<=s:s<=n.length-1;r?s--:s++){var l=a(n[s],{seriesIndex:s,w:e}),c=!1,h=!1;if(0<e.globals.collapsedSeries.length)for(var u=0;u<e.globals.collapsedSeries.length;u++)e.globals.collapsedSeries[u].index===s&&(c=!0);if(0<e.globals.ancillaryCollapsedSeriesIndices.length)for(var d=0;d<e.globals.ancillaryCollapsedSeriesIndices.length;d++)e.globals.ancillaryCollapsedSeriesIndices[d]===s&&(h=!0);var f=document.createElement("span");f.classList.add("apexcharts-legend-marker");var p=e.config.legend.markers.offsetX,g=e.config.legend.markers.offsetY,v=e.config.legend.markers.height,m=e.config.legend.markers.width,b=e.config.legend.markers.strokeWidth,y=e.config.legend.markers.strokeColor,x=e.config.legend.markers.radius,w=f.style;w.background=o[s],w.color=o[s],e.config.legend.markers.fillColors&&e.config.legend.markers.fillColors[s]&&(w.background=e.config.legend.markers.fillColors[s]),void 0!==e.globals.seriesColors[s]&&(w.background=e.globals.seriesColors[s],w.color=e.globals.seriesColors[s]),w.height=Array.isArray(v)?parseFloat(v[s])+"px":parseFloat(v)+"px",w.width=Array.isArray(m)?parseFloat(m[s])+"px":parseFloat(m)+"px",w.left=Array.isArray(p)?p[s]:p,w.top=Array.isArray(g)?g[s]:g,w.borderWidth=Array.isArray(b)?b[s]:b,w.borderColor=Array.isArray(y)?y[s]:y,w.borderRadius=Array.isArray(x)?parseFloat(x[s])+"px":parseFloat(x)+"px",e.config.legend.markers.customHTML&&(Array.isArray(e.config.legend.markers.customHTML)?e.config.legend.markers.customHTML[s]&&(f.innerHTML=e.config.legend.markers.customHTML[s]()):f.innerHTML=e.config.legend.markers.customHTML()),M.setAttrs(f,{rel:s+1,"data:collapsed":c||h}),(c||h)&&f.classList.add("apexcharts-inactive-legend");var k=document.createElement("div"),C=document.createElement("span");C.classList.add("apexcharts-legend-text"),C.innerHTML=Array.isArray(l)?l.join(" "):l;var A=(A=e.config.legend.labels.useSeriesColors?e.globals.colors[s]:e.config.legend.labels.colors)||e.config.chart.foreColor;C.style.color=A,C.style.fontSize=parseFloat(e.config.legend.fontSize)+"px",C.style.fontWeight=e.config.legend.fontWeight,C.style.fontFamily=i||e.config.chart.fontFamily,M.setAttrs(C,{rel:s+1,i:s,"data:default-text":encodeURIComponent(l),"data:collapsed":c||h}),k.appendChild(f),k.appendChild(C);var S=new E(this.ctx);e.config.legend.showForZeroSeries||0===S.getSeriesTotalByIndex(s)&&S.seriesHaveSameValues(s)&&!S.isSeriesNull(s)&&-1===e.globals.collapsedSeriesIndices.indexOf(s)&&-1===e.globals.ancillaryCollapsedSeriesIndices.indexOf(s)&&k.classList.add("apexcharts-hidden-zero-series"),e.config.legend.showForNullSeries||S.isSeriesNull(s)&&-1===e.globals.collapsedSeriesIndices.indexOf(s)&&-1===e.globals.ancillaryCollapsedSeriesIndices.indexOf(s)&&k.classList.add("apexcharts-hidden-null-series"),e.globals.dom.elLegendWrap.appendChild(k),e.globals.dom.elLegendWrap.classList.add("apexcharts-align-".concat(e.config.legend.horizontalAlign)),e.globals.dom.elLegendWrap.classList.add("position-"+e.config.legend.position),k.classList.add("apexcharts-legend-series"),k.style.margin="".concat(e.config.legend.itemMargin.vertical,"px ").concat(e.config.legend.itemMargin.horizontal,"px"),e.globals.dom.elLegendWrap.style.width=e.config.legend.width?e.config.legend.width+"px":"",e.globals.dom.elLegendWrap.style.height=e.config.legend.height?e.config.legend.height+"px":"",M.setAttrs(k,{rel:s+1,"data:collapsed":c||h}),(c||h)&&k.classList.add("apexcharts-inactive-legend"),e.config.legend.onItemClick.toggleDataSeries||k.classList.add("apexcharts-no-click")}"heatmap"!==e.config.chart.type&&!this.isBarsDistributed&&e.config.legend.onItemClick.toggleDataSeries&&e.globals.dom.elWrap.addEventListener("click",this.onLegendClick,!0),e.config.legend.onItemHover.highlightDataSeries&&(e.globals.dom.elWrap.addEventListener("mousemove",this.onLegendHovered,!0),e.globals.dom.elWrap.addEventListener("mouseout",this.onLegendHovered,!0))}},{key:"setLegendWrapXY",value:function(t,e){var i,n,o,a=this.w,r=a.globals.dom.baseEl.querySelector(".apexcharts-legend"),s=r.getBoundingClientRect(),l=0,c=0;"bottom"===a.config.legend.position?c+=a.globals.svgHeight-s.height/2:"top"===a.config.legend.position&&(c=c+(0<(n=(i=new vt(this.ctx)).dimHelpers.getTitleSubtitleCoords("title").height)?n-10:0)+(0<(o=i.dimHelpers.getTitleSubtitleCoords("subtitle").height)?o-10:0)),r.style.position="absolute",l=l+t+a.config.legend.offsetX,c=c+e+a.config.legend.offsetY,r.style.left=l+"px",r.style.top=c+"px","bottom"===a.config.legend.position?(r.style.top="auto",r.style.bottom=5-a.config.legend.offsetY+"px"):"right"===a.config.legend.position&&(r.style.left="auto",r.style.right=25+a.config.legend.offsetX+"px"),["width","height"].forEach(function(t){r.style[t]&&(r.style[t]=parseInt(a.config.legend[t],10)+"px")})}},{key:"legendAlignHorizontal",value:function(){var t=this.w;t.globals.dom.baseEl.querySelector(".apexcharts-legend").style.right=0;var e=this.legendHelpers.getLegendBBox(),i=new vt(this.ctx),n=i.dimHelpers.getTitleSubtitleCoords("title"),o=i.dimHelpers.getTitleSubtitleCoords("subtitle"),a=0;"bottom"===t.config.legend.position?a=-e.clwh/1.8:"top"===t.config.legend.position&&(a=n.height+o.height+t.config.title.margin+t.config.subtitle.margin-10),this.setLegendWrapXY(20,a)}},{key:"legendAlignVertical",value:function(){var t=this.w,e=this.legendHelpers.getLegendBBox(),i=0;"left"===t.config.legend.position&&(i=20),"right"===t.config.legend.position&&(i=t.globals.svgWidth-e.clww-10),this.setLegendWrapXY(i,20)}},{key:"onLegendHovered",value:function(t){var e,i=this.w,n=t.target.classList.contains("apexcharts-legend-text")||t.target.classList.contains("apexcharts-legend-marker");"heatmap"===i.config.chart.type||this.isBarsDistributed?n&&(e=parseInt(t.target.getAttribute("rel"),10)-1,this.ctx.events.fireEvent("legendHover",[this.ctx,e,this.w]),new H(this.ctx).highlightRangeInSeries(t,t.target)):!t.target.classList.contains("apexcharts-inactive-legend")&&n&&new H(this.ctx).toggleSeriesOnHover(t,t.target)}},{key:"onLegendClick",value:function(t){var e,i,n,o;(t.target.classList.contains("apexcharts-legend-text")||t.target.classList.contains("apexcharts-legend-marker"))&&(e=parseInt(t.target.getAttribute("rel"),10)-1,i="true"===t.target.getAttribute("data:collapsed"),"function"==typeof(n=this.w.config.chart.events.legendClick)&&n(this.ctx,e,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,e,this.w]),"function"==typeof(o=this.w.config.legend.markers.onClick)&&t.target.classList.contains("apexcharts-legend-marker")&&(o(this.ctx,e,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,e,this.w])),this.legendHelpers.toggleDataSeries(e,i))}}]),ne),yt=(r(ie,[{key:"createToolbar",value:function(){function t(){return document.createElement("div")}var o=this,a=this.w,e=t();if(e.setAttribute("class","apexcharts-toolbar"),e.style.top=a.config.chart.toolbar.offsetY+"px",e.style.right=3-a.config.chart.toolbar.offsetX+"px",a.globals.dom.elWrap.appendChild(e),this.elZoom=t(),this.elZoomIn=t(),this.elZoomOut=t(),this.elPan=t(),this.elSelection=t(),this.elZoomReset=t(),this.elMenuIcon=t(),this.elMenu=t(),this.elCustomIcons=[],this.t=a.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(var i=0;i<this.t.customIcons.length;i++)this.elCustomIcons.push(t());function n(t,e,i){var n=t.toLowerCase();o.t[n]&&a.config.chart.zoom.enabled&&r.push({el:e,icon:"string"==typeof o.t[n]?o.t[n]:i,title:o.localeValues[t],class:"apexcharts-".concat(n,"-icon")})}var r=[];function s(t){o.t[t]&&a.config.chart[t].enabled&&r.push({el:"zoom"===t?o.elZoom:o.elSelection,icon:"string"==typeof o.t[t]?o.t[t]:"zoom"===t?'<svg xmlns="http://www.w3.org/2000/svg" fill="#000000" height="24" viewBox="0 0 24 24" width="24">\n    <path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>\n    <path d="M0 0h24v24H0V0z" fill="none"/>\n    <path d="M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"/>\n</svg>':'<svg fill="#6E8192" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">\n    <path d="M0 0h24v24H0z" fill="none"/>\n    <path d="M3 5h2V3c-1.1 0-2 .9-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2c0-1.1-.9-2-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2z"/>\n</svg>',title:o.localeValues["zoom"===t?"selectionZoom":"selection"],class:a.globals.isTouchDevice?"apexcharts-element-hidden":"apexcharts-".concat(t,"-icon")})}n("zoomIn",this.elZoomIn,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n    <path d="M0 0h24v24H0z" fill="none"/>\n    <path d="M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>\n</svg>\n'),n("zoomOut",this.elZoomOut,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n    <path d="M0 0h24v24H0z" fill="none"/>\n    <path d="M7 11v2h10v-2H7zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>\n</svg>\n'),s("zoom"),s("selection"),this.t.pan&&a.config.chart.zoom.enabled&&r.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000" height="24" viewBox="0 0 24 24" width="24">\n    <defs>\n        <path d="M0 0h24v24H0z" id="a"/>\n    </defs>\n    <clipPath id="b">\n        <use overflow="visible" xlink:href="#a"/>\n    </clipPath>\n    <path clip-path="url(#b)" d="M23 5.5V20c0 2.2-1.8 4-4 4h-7.3c-1.08 0-2.1-.43-2.85-1.19L1 14.83s1.26-1.23 1.3-1.25c.22-.19.49-.29.79-.29.22 0 .42.06.6.16.04.01 4.31 2.46 4.31 2.46V4c0-.83.67-1.5 1.5-1.5S11 3.17 11 4v7h1V1.5c0-.83.67-1.5 1.5-1.5S15 .67 15 1.5V11h1V2.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5V11h1V5.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5z"/>\n</svg>',title:this.localeValues.pan,class:a.globals.isTouchDevice?"apexcharts-element-hidden":"apexcharts-pan-icon"}),n("reset",this.elZoomReset,'<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">\n    <path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>\n    <path d="M0 0h24v24H0z" fill="none"/>\n</svg>'),this.t.download&&r.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(var l=0;l<this.elCustomIcons.length;l++)r.push({el:this.elCustomIcons[l],icon:this.t.customIcons[l].icon,title:this.t.customIcons[l].title,index:this.t.customIcons[l].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[l].class});r.forEach(function(t,e){t.index&&L.moveIndexInArray(r,e,t.index)});for(var c=0;c<r.length;c++)M.setAttrs(r[c].el,{class:r[c].class,title:r[c].title}),r[c].el.innerHTML=r[c].icon,e.appendChild(r[c].el);this._createHamburgerMenu(e),a.globals.zoomEnabled?this.elZoom.classList.add(this.selectedClass):a.globals.panEnabled?this.elPan.classList.add(this.selectedClass):a.globals.selectionEnabled&&this.elSelection.classList.add(this.selectedClass),this.addToolbarEventListeners()}},{key:"_createHamburgerMenu",value:function(t){this.elMenuItems=[],t.appendChild(this.elMenu),M.setAttrs(this.elMenu,{class:"apexcharts-menu"});var e=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}];this.w.globals.allSeriesHasEqualX||e.splice(2,1);for(var i=0;i<e.length;i++)this.elMenuItems.push(document.createElement("div")),this.elMenuItems[i].innerHTML=e[i].title,M.setAttrs(this.elMenuItems[i],{class:"apexcharts-menu-item ".concat(e[i].name),title:e[i].title}),this.elMenu.appendChild(this.elMenuItems[i])}},{key:"addToolbarEventListeners",value:function(){var e=this;this.elZoomReset.addEventListener("click",this.handleZoomReset.bind(this)),this.elSelection.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),this.elZoom.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),this.elZoomIn.addEventListener("click",this.handleZoomIn.bind(this)),this.elZoomOut.addEventListener("click",this.handleZoomOut.bind(this)),this.elPan.addEventListener("click",this.togglePanning.bind(this)),this.elMenuIcon.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(function(t){t.classList.contains("exportSVG")?t.addEventListener("click",e.handleDownload.bind(e,"svg")):t.classList.contains("exportPNG")?t.addEventListener("click",e.handleDownload.bind(e,"png")):t.classList.contains("exportCSV")&&t.addEventListener("click",e.handleDownload.bind(e,"csv"))});for(var t=0;t<this.t.customIcons.length;t++)this.elCustomIcons[t].addEventListener("click",this.t.customIcons[t].click.bind(this,this.ctx,this.ctx.w))}},{key:"toggleZoomSelection",value:function(n){this.ctx.getSyncedCharts().forEach(function(t){t.ctx.toolbar.toggleOtherControls();var e="selection"===n?t.ctx.toolbar.elSelection:t.ctx.toolbar.elZoom,i="selection"===n?"selectionEnabled":"zoomEnabled";t.w.globals[i]=!t.w.globals[i],e.classList.contains(t.ctx.toolbar.selectedClass)?e.classList.remove(t.ctx.toolbar.selectedClass):e.classList.add(t.ctx.toolbar.selectedClass)})}},{key:"getToolbarIconsReference",value:function(){var t=this.w;this.elZoom||(this.elZoom=t.globals.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=t.globals.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=t.globals.dom.baseEl.querySelector(".apexcharts-selection-icon"))}},{key:"enableZoomPanFromToolbar",value:function(t){this.toggleOtherControls(),"pan"===t?this.w.globals.panEnabled=!0:this.w.globals.zoomEnabled=!0;var e="pan"===t?this.elPan:this.elZoom,i="pan"===t?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),i&&i.classList.remove(this.selectedClass)}},{key:"togglePanning",value:function(){this.ctx.getSyncedCharts().forEach(function(t){t.ctx.toolbar.toggleOtherControls(),t.w.globals.panEnabled=!t.w.globals.panEnabled,t.ctx.toolbar.elPan.classList.contains(t.ctx.toolbar.selectedClass)?t.ctx.toolbar.elPan.classList.remove(t.ctx.toolbar.selectedClass):t.ctx.toolbar.elPan.classList.add(t.ctx.toolbar.selectedClass)})}},{key:"toggleOtherControls",value:function(){var e=this,t=this.w;t.globals.panEnabled=!1,t.globals.zoomEnabled=!1,t.globals.selectionEnabled=!1,this.getToolbarIconsReference(),[this.elPan,this.elSelection,this.elZoom].forEach(function(t){t&&t.classList.remove(e.selectedClass)})}},{key:"handleZoomIn",value:function(){var t=this.w,e=(t.globals.minX+t.globals.maxX)/2,i=(t.globals.minX+e)/2,n=(t.globals.maxX+e)/2,o=this._getNewMinXMaxX(i,n);t.globals.disableZoomIn||this.zoomUpdateOptions(o.minX,o.maxX)}},{key:"handleZoomOut",value:function(){var t,e,i,n,o=this.w;"datetime"===o.config.xaxis.type&&new Date(o.globals.minX).getUTCFullYear()<1e3||(t=(o.globals.minX+o.globals.maxX)/2,e=o.globals.minX-(t-o.globals.minX),i=o.globals.maxX-(t-o.globals.maxX),n=this._getNewMinXMaxX(e,i),o.globals.disableZoomOut||this.zoomUpdateOptions(n.minX,n.maxX))}},{key:"_getNewMinXMaxX",value:function(t,e){var i=this.w.config.xaxis.convertedCatToNumeric;return{minX:i?Math.floor(t):t,maxX:i?Math.floor(e):e}}},{key:"zoomUpdateOptions",value:function(t,e){var i,n,o,a,r=this.w;void 0!==t||void 0!==e?r.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=r.globals.dataPoints),e-t<2)||(i={min:t,max:e},(n=this.getBeforeZoomRange(i))&&(i=n.xaxis),o={xaxis:i},a=L.clone(r.globals.initialConfig.yaxis),r.config.chart.zoom.autoScaleYaxis&&(a=new it(this.ctx).autoScaleY(this.ctx,a,{xaxis:i})),r.config.chart.group||(o.yaxis=a),this.w.globals.zoomed=!0,this.ctx.updateHelpers._updateOptions(o,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(i,a)):this.handleZoomReset()}},{key:"zoomCallback",value:function(t,e){"function"==typeof this.ev.zoomed&&this.ev.zoomed(this.ctx,{xaxis:t,yaxis:e})}},{key:"getBeforeZoomRange",value:function(t,e){var i=null;return"function"==typeof this.ev.beforeZoom&&(i=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),i}},{key:"toggleMenu",value:function(){var t=this;window.setTimeout(function(){t.elMenu.classList.contains("apexcharts-menu-open")?t.elMenu.classList.remove("apexcharts-menu-open"):t.elMenu.classList.add("apexcharts-menu-open")},0)}},{key:"handleDownload",value:function(t){var e=this.w,i=new J(this.ctx);switch(t){case"svg":i.exportToSVG(this.ctx);break;case"png":i.exportToPng(this.ctx);break;case"csv":i.exportToCSV({series:e.config.series,columnDelimiter:e.config.chart.toolbar.export.csv.columnDelimiter})}}},{key:"handleZoomReset",value:function(){this.ctx.getSyncedCharts().forEach(function(t){var e=t.w;e.globals.lastXAxis.min=void 0,e.globals.lastXAxis.max=void 0,t.updateHelpers.revertDefaultAxisMinMax(),"function"==typeof e.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:e.config.xaxis.min,max:e.config.xaxis.max}),e.globals.zoomed=!1;var i=t.ctx.series.emptyCollapsedSeries(L.clone(e.globals.initialSeries));t.updateHelpers._updateSeries(i,e.config.chart.animations.dynamicAnimation.enabled)})}},{key:"destroy",value:function(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elZoomReset=null,this.elMenuIcon=null}}]),ie),xt=function(){l(n,yt);var i=h(n);function n(t){var e;return a(this,n),(e=i.call(this,t)).ctx=t,e.w=t.w,e.dragged=!1,e.graphics=new M(e.ctx),e.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend"],e.clientX=0,e.clientY=0,e.startX=0,e.endX=0,e.dragX=0,e.startY=0,e.endY=0,e.dragY=0,e.moveDirection="none",e}return r(n,[{key:"init",value:function(t){var e=this,i=t.xyRatios,n=this.w,o=this;this.xyRatios=i,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.gridRect=n.globals.dom.baseEl.querySelector(".apexcharts-grid"),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),n.globals.dom.elGraphical.add(this.zoomRect),n.globals.dom.elGraphical.add(this.selectionRect),"x"===n.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:n.globals.gridWidth,maxY:n.globals.gridHeight}).on("dragmove",this.selectionDragging.bind(this,"dragging")):"y"===n.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:n.globals.gridWidth}).on("dragmove",this.selectionDragging.bind(this,"dragging")):this.slDraggableRect=this.selectionRect.draggable().on("dragmove",this.selectionDragging.bind(this,"dragging")),this.preselectedSelection(),this.hoverArea=n.globals.dom.baseEl.querySelector("".concat(n.globals.chartClass," .apexcharts-svg")),this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(function(t){e.hoverArea.addEventListener(t,o.svgMouseEvents.bind(o,i),{capture:!1,passive:!0})})}},{key:"destroy",value:function(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null,this.gridRect=null}},{key:"svgMouseEvents",value:function(t,e){var i=this.w,n=this,o=this.ctx.toolbar,a=i.globals.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,r=i.config.chart.toolbar.autoSelected;e.shiftKey?(this.shiftWasPressed=!0,o.enableZoomPanFromToolbar("pan"===r?"zoom":"pan")):this.shiftWasPressed&&(o.enableZoomPanFromToolbar(r),this.shiftWasPressed=!1);var s,l,c=e.target.classList;c.contains("apexcharts-selection-rect")||c.contains("apexcharts-legend-marker")||c.contains("apexcharts-legend-text")||e.target.parentNode.classList.contains("apexcharts-toolbar")||(n.clientX="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientX:"touchend"===e.type?e.changedTouches[0].clientX:e.clientX,n.clientY="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientY:"touchend"===e.type?e.changedTouches[0].clientY:e.clientY,"mousedown"===e.type&&1===e.which&&(s=n.gridRect.getBoundingClientRect(),n.startX=n.clientX-s.left,n.startY=n.clientY-s.top,n.dragged=!1,n.w.globals.mousedown=!0),("mousemove"===e.type&&1===e.which||"touchmove"===e.type)&&(n.dragged=!0,i.globals.panEnabled?(i.globals.selection=null,n.w.globals.mousedown&&n.panDragging({context:n,zoomtype:a,xyRatios:t})):(n.w.globals.mousedown&&i.globals.zoomEnabled||n.w.globals.mousedown&&i.globals.selectionEnabled)&&(n.selection=n.selectionDrawing({context:n,zoomtype:a}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||(l=n.gridRect.getBoundingClientRect(),n.w.globals.mousedown&&(n.endX=n.clientX-l.left,n.endY=n.clientY-l.top,n.dragX=Math.abs(n.endX-n.startX),n.dragY=Math.abs(n.endY-n.startY),(i.globals.zoomEnabled||i.globals.selectionEnabled)&&n.selectionDrawn({context:n,zoomtype:a}),i.globals.panEnabled&&i.config.xaxis.convertedCatToNumeric&&n.delayedPanScrolled()),i.globals.zoomEnabled&&n.hideSelectionRect(this.selectionRect),n.dragged=!1,n.w.globals.mousedown=!1),this.makeSelectionRectDraggable())}},{key:"makeSelectionRectDraggable",value:function(){var t,e=this.w;!this.selectionRect||0<(t=this.selectionRect.node.getBoundingClientRect()).width&&0<t.height&&this.slDraggableRect.selectize({points:"l, r",pointSize:8,pointType:"rect"}).resize({constraint:{minX:0,minY:0,maxX:e.globals.gridWidth,maxY:e.globals.gridHeight}}).on("resizing",this.selectionDragging.bind(this,"resizing"))}},{key:"preselectedSelection",value:function(){var t,e,i=this.w,n=this.xyRatios;i.globals.zoomEnabled||(void 0!==i.globals.selection&&null!==i.globals.selection?this.drawSelectionRect(i.globals.selection):void 0!==i.config.chart.selection.xaxis.min&&void 0!==i.config.chart.selection.xaxis.max&&(e={x:t=(i.config.chart.selection.xaxis.min-i.globals.minX)/n.xRatio,y:0,width:i.globals.gridWidth-(i.globals.maxX-i.config.chart.selection.xaxis.max)/n.xRatio-t,height:i.globals.gridHeight,translateX:0,translateY:0,selectionEnabled:!0},this.drawSelectionRect(e),this.makeSelectionRectDraggable(),"function"==typeof i.config.chart.events.selection&&i.config.chart.events.selection(this.ctx,{xaxis:{min:i.config.chart.selection.xaxis.min,max:i.config.chart.selection.xaxis.max},yaxis:{}})))}},{key:"drawSelectionRect",value:function(t){var e,i=t.x,n=t.y,o=t.width,a=t.height,r=t.translateX,s=void 0===r?0:r,l=t.translateY,c=void 0===l?0:l,h=this.w,u=this.zoomRect,d=this.selectionRect;!this.dragged&&null===h.globals.selection||(e={transform:"translate("+s+", "+c+")"},h.globals.zoomEnabled&&this.dragged&&(o<0&&(o=1),u.attr({x:i,y:n,width:o,height:a,fill:h.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":h.config.chart.zoom.zoomedArea.fill.opacity,stroke:h.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":h.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":h.config.chart.zoom.zoomedArea.stroke.opacity}),M.setAttrs(u.node,e)),h.globals.selectionEnabled&&(d.attr({x:i,y:n,width:0<o?o:0,height:0<a?a:0,fill:h.config.chart.selection.fill.color,"fill-opacity":h.config.chart.selection.fill.opacity,stroke:h.config.chart.selection.stroke.color,"stroke-width":h.config.chart.selection.stroke.width,"stroke-dasharray":h.config.chart.selection.stroke.dashArray,"stroke-opacity":h.config.chart.selection.stroke.opacity}),M.setAttrs(d.node,e)))}},{key:"hideSelectionRect",value:function(t){t&&t.attr({x:0,y:0,width:0,height:0})}},{key:"selectionDrawing",value:function(t){var e,i=t.context,n=t.zoomtype,o=this.w,a=i,r=this.gridRect.getBoundingClientRect(),s=a.startX-1,l=a.startY,c=!1,h=!1,u=a.clientX-r.left-s,d=a.clientY-r.top-l;return Math.abs(u+s)>o.globals.gridWidth?u=o.globals.gridWidth-s:a.clientX-r.left<0&&(u=s),s>a.clientX-r.left&&(c=!0,u=Math.abs(u)),l>a.clientY-r.top&&(h=!0,d=Math.abs(d)),e="x"===n?{x:c?s-u:s,y:0,width:u,height:o.globals.gridHeight}:"y"===n?{x:0,y:h?l-d:l,width:o.globals.gridWidth,height:d}:{x:c?s-u:s,y:h?l-d:l,width:u,height:d},a.drawSelectionRect(e),a.selectionDragging("resizing"),e}},{key:"selectionDragging",value:function(t){var r=this,s=this.w,l=this.xyRatios,c=this.selectionRect,e=0;"resizing"===t&&(e=30);function i(t){return parseFloat(c.node.getAttribute(t))}var n={x:i("x"),y:i("y"),width:i("width"),height:i("height")};s.globals.selection=n,"function"==typeof s.config.chart.events.selection&&s.globals.selectionEnabled&&(clearTimeout(this.w.globals.selectionResizeTimer),this.w.globals.selectionResizeTimer=window.setTimeout(function(){var t=r.gridRect.getBoundingClientRect(),e=c.node.getBoundingClientRect(),i=s.globals.xAxisScale.niceMin+(e.left-t.left)*l.xRatio,n=s.globals.xAxisScale.niceMin+(e.right-t.left)*l.xRatio,o=s.globals.yAxisScale[0].niceMin+(t.bottom-e.bottom)*l.yRatio[0],a=s.globals.yAxisScale[0].niceMax-(e.top-t.top)*l.yRatio[0];s.config.chart.events.selection(r.ctx,{xaxis:{min:i,max:n},yaxis:{min:o,max:a}})},e))}},{key:"selectionDrawn",value:function(t){var e,i,n=t.context,o=t.zoomtype,a=this.w,r=n,s=this.xyRatios,l=this.ctx.toolbar;r.startX>r.endX&&(e=r.startX,r.startX=r.endX,r.endX=e),r.startY>r.endY&&(i=r.startY,r.startY=r.endY,r.endY=i);var c,h,u,d,f,p,g=a.globals.xAxisScale.niceMin+r.startX*s.xRatio,v=a.globals.xAxisScale.niceMin+r.endX*s.xRatio,m=[],b=[];a.config.yaxis.forEach(function(t,e){m.push(a.globals.yAxisScale[e].niceMax-s.yRatio[e]*r.startY),b.push(a.globals.yAxisScale[e].niceMax-s.yRatio[e]*r.endY)}),r.dragged&&(10<r.dragX||10<r.dragY)&&g!==v&&(a.globals.zoomEnabled?(h=L.clone(a.globals.initialConfig.yaxis),c=L.clone(a.globals.initialConfig.xaxis),a.globals.zoomed=!0,a.config.xaxis.convertedCatToNumeric&&(g=Math.floor(g),v=Math.floor(v),g<1&&(g=1,v=a.globals.dataPoints),v-g<2&&(v=g+1)),"xy"!==o&&"x"!==o||(c={min:g,max:v}),"xy"!==o&&"y"!==o||h.forEach(function(t,e){h[e].min=b[e],h[e].max=m[e]}),a.config.chart.zoom.autoScaleYaxis&&(h=new it(r.ctx).autoScaleY(r.ctx,h,{xaxis:c})),!l||(u=l.getBeforeZoomRange(c,h))&&(c=u.xaxis?u.xaxis:c,h=u.yaxis?u.yaxis:h),d={xaxis:c},a.config.chart.group||(d.yaxis=h),r.ctx.updateHelpers._updateOptions(d,!1,r.w.config.chart.animations.dynamicAnimation.enabled),"function"==typeof a.config.chart.events.zoomed&&l.zoomCallback(c,h)):a.globals.selectionEnabled&&(f=null,p={min:g,max:v},"xy"!==o&&"y"!==o||(f=L.clone(a.config.yaxis)).forEach(function(t,e){f[e].min=b[e],f[e].max=m[e]}),a.globals.selection=r.selection,"function"==typeof a.config.chart.events.selection&&a.config.chart.events.selection(r.ctx,{xaxis:p,yaxis:f})))}},{key:"panDragging",value:function(t){var e,i,n=t.context,o=this.w,a=n;void 0!==o.globals.lastClientPosition.x&&(e=o.globals.lastClientPosition.x-a.clientX,i=o.globals.lastClientPosition.y-a.clientY,Math.abs(e)>Math.abs(i)&&0<e?this.moveDirection="left":Math.abs(e)>Math.abs(i)&&e<0?this.moveDirection="right":Math.abs(i)>Math.abs(e)&&0<i?this.moveDirection="up":Math.abs(i)>Math.abs(e)&&i<0&&(this.moveDirection="down")),o.globals.lastClientPosition={x:a.clientX,y:a.clientY};var r=o.globals.minX,s=o.globals.maxX;o.config.xaxis.convertedCatToNumeric||a.panScrolled(r,s)}},{key:"delayedPanScrolled",value:function(){var t=this.w,e=t.globals.minX,i=t.globals.maxX,n=(t.globals.maxX-t.globals.minX)/2;"left"===this.moveDirection?(e=t.globals.minX+n,i=t.globals.maxX+n):"right"===this.moveDirection&&(e=t.globals.minX-n,i=t.globals.maxX-n),e=Math.floor(e),i=Math.floor(i),this.updateScrolledChart({xaxis:{min:e,max:i}},e,i)}},{key:"panScrolled",value:function(t,e){var i=this.w,n=this.xyRatios,o=L.clone(i.globals.initialConfig.yaxis);"left"===this.moveDirection?(t=i.globals.minX+i.globals.gridWidth/15*n.xRatio,e=i.globals.maxX+i.globals.gridWidth/15*n.xRatio):"right"===this.moveDirection&&(t=i.globals.minX-i.globals.gridWidth/15*n.xRatio,e=i.globals.maxX-i.globals.gridWidth/15*n.xRatio),(t<i.globals.initialMinX||e>i.globals.initialMaxX)&&(t=i.globals.minX,e=i.globals.maxX);var a={min:t,max:e};i.config.chart.zoom.autoScaleYaxis&&(o=new it(this.ctx).autoScaleY(this.ctx,o,{xaxis:a}));var r={xaxis:{min:t,max:e}};i.config.chart.group||(r.yaxis=o),this.updateScrolledChart(r,t,e)}},{key:"updateScrolledChart",value:function(t,e,i){var n=this.w;this.ctx.updateHelpers._updateOptions(t,!1,!1),"function"==typeof n.config.chart.events.scrolled&&n.config.chart.events.scrolled(this.ctx,{xaxis:{min:e,max:i}})}}]),n}(),wt=(r(ee,[{key:"getNearestValues",value:function(t){var e=t.hoverArea,i=t.elGrid,n=t.clientX,o=t.clientY,a=this.w,r=a.globals.gridWidth,s=r/(a.globals.dataPoints-1),l=i.getBoundingClientRect(),c=this.hasBars();!a.globals.comboCharts&&!c||a.config.xaxis.convertedCatToNumeric||(s=r/a.globals.dataPoints);var h=n-l.left-a.globals.barPadForNumericAxis,u=o-l.top;h<0||u<0||h>a.globals.gridWidth||u>a.globals.gridHeight?(e.classList.remove("hovering-zoom"),e.classList.remove("hovering-pan")):a.globals.zoomEnabled?(e.classList.remove("hovering-pan"),e.classList.add("hovering-zoom")):a.globals.panEnabled&&(e.classList.remove("hovering-zoom"),e.classList.add("hovering-pan"));var d=Math.round(h/s);c&&!a.config.xaxis.convertedCatToNumeric&&(d=Math.ceil(h/s),--d);for(var f,p=null,g=null,v=[],m=0;m<a.globals.seriesXvalues.length;m++)v.push([a.globals.seriesXvalues[m][0]-1e-6].concat(a.globals.seriesXvalues[m]));return v=v.map(function(t){return t.filter(function(t){return t})}),f=a.globals.seriesYvalues.map(function(t){return t.filter(function(t){return L.isNumber(t)})}),a.globals.isXNumeric&&(p=(g=this.closestInMultiArray(h,u,v,f)).index,d=g.j,null!==p&&(v=a.globals.seriesXvalues[p],d=(g=this.closestInArray(h,v)).index)),a.globals.capturedSeriesIndex=null===p?-1:p,(!d||d<1)&&(d=0),{capturedSeries:p,j:a.globals.capturedDataPointIndex=d,hoverX:h,hoverY:u}}},{key:"closestInMultiArray",value:function(r,s,l,c){var t=this.w,e=0,h=null,u=-1;1<t.globals.series.length?e=this.getFirstActiveXArray(l):h=0;var i=c[e][0],n=l[e][0],d=Math.abs(r-n),f=Math.abs(s-i),p=f+d;return c.map(function(t,a){t.map(function(t,e){var i=Math.abs(s-c[a][e]),n=Math.abs(r-l[a][e]),o=n+i;o<p&&(p=o,d=n,f=i,h=a,u=e)})}),{index:h,j:u}}},{key:"getFirstActiveXArray",value:function(t){for(var e=0,i=t.map(function(t,e){return 0<t.length?e:-1}),n=0;n<i.length;n++)if(-1!==i[n]){e=i[n];break}return e}},{key:"closestInArray",value:function(t,e){for(var i=e[0],n=null,o=Math.abs(t-i),a=0;a<e.length;a++){var r=Math.abs(t-e[a]);r<o&&(o=r,n=a)}return{index:n}}},{key:"isXoverlap",value:function(t){var e=[],i=this.w.globals.seriesX.filter(function(t){return void 0!==t[0]});if(0<i.length)for(var n=0;n<i.length-1;n++)void 0!==i[n][t]&&void 0!==i[n+1][t]&&i[n][t]!==i[n+1][t]&&e.push("unEqual");return 0===e.length}},{key:"isInitialSeriesSameLen",value:function(){for(var t=!0,e=this.w.globals.initialSeries,i=0;i<e.length-1;i++)if(e[i].data.length!==e[i+1].data.length){t=!1;break}return t}},{key:"getBarsHeight",value:function(t){return C(t).reduce(function(t,e){return t+e.getBBox().height},0)}},{key:"getElMarkers",value:function(){return this.w.globals.dom.baseEl.querySelectorAll(" .apexcharts-series-markers")}},{key:"getAllMarkers",value:function(){var t=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap");(t=C(t)).sort(function(t,e){return Number(e.getAttribute("data:realIndex"))<Number(t.getAttribute("data:realIndex"))?0:-1});var e=[];return t.forEach(function(t){e.push(t.querySelector(".apexcharts-marker"))}),e}},{key:"hasMarkers",value:function(){return 0<this.getElMarkers().length}},{key:"getElBars",value:function(){return this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-bar-series,  .apexcharts-candlestick-series, .apexcharts-rangebar-series")}},{key:"hasBars",value:function(){return 0<this.getElBars().length}},{key:"getHoverMarkerSize",value:function(t){var e=this.w,i=e.config.markers.hover.size;return void 0===i&&(i=e.globals.markers.size[t]+e.config.markers.hover.sizeOffset),i}},{key:"toggleAllTooltipSeriesGroups",value:function(t){var e=this.w,i=this.ttCtx;0===i.allTooltipSeriesGroups.length&&(i.allTooltipSeriesGroups=e.globals.dom.baseEl.querySelectorAll(".apexcharts-tooltip-series-group"));for(var n=i.allTooltipSeriesGroups,o=0;o<n.length;o++)"enable"===t?(n[o].classList.add("apexcharts-active"),n[o].style.display=e.config.tooltip.items.display):(n[o].classList.remove("apexcharts-active"),n[o].style.display="none")}}]),ee),kt=(r(te,[{key:"drawSeriesTexts",value:function(t){var e=t.shared,i=void 0===e||e,n=t.ttItems,o=t.i,a=void 0===o?0:o,r=t.j,s=void 0===r?null:r,l=t.y1,c=t.y2,h=this.w;void 0!==h.config.tooltip.custom?this.handleCustomTooltip({i:a,j:s,y1:l,y2:c,w:h}):this.toggleActiveInactiveSeries(i);var u=this.getValuesToPrint({i:a,j:s});this.printLabels({i:a,j:s,values:u,ttItems:n,shared:i});var d=this.ttCtx.getElTooltip();this.ttCtx.tooltipRect.ttWidth=d.getBoundingClientRect().width,this.ttCtx.tooltipRect.ttHeight=d.getBoundingClientRect().height}},{key:"printLabels",value:function(t){var a,r=this,s=t.i,l=t.j,e=t.values,c=t.ttItems,h=t.shared,u=this.w,d=e.xVal,f=e.zVal,p=e.xAxisTTVal,g="",v=u.globals.colors[s];null!==l&&u.config.plotOptions.bar.distributed&&(v=u.globals.colors[l]);for(var i=0,n=u.globals.series.length-1;i<u.globals.series.length;i++,n--)!function(t,e){var i=r.getFormatters(s);g=r.getSeriesName({fn:i.yLbTitleFormatter,index:s,seriesIndex:s,j:l});var n,o=u.config.tooltip.inverseOrder?e:t;u.globals.axisCharts&&(n=function(t){return i.yLbFormatter(u.globals.series[t][l],{series:u.globals.series,seriesIndex:t,dataPointIndex:l,w:u})},a=h?(i=r.getFormatters(o),g=r.getSeriesName({fn:i.yLbTitleFormatter,index:o,seriesIndex:s,j:l}),v=u.globals.colors[o],n(o)):n(s)),null===l&&(a=i.yLbFormatter(u.globals.series[s],u)),r.DOMHandling({i:s,t:o,j:l,ttItems:c,values:{val:a,xVal:d,xAxisTTVal:p,zVal:f},seriesName:g,shared:h,pColor:v})}(i,n)}},{key:"getFormatters",value:function(t){var e,i=this.w,n=i.globals.yLabelFormatters[t];return void 0!==i.globals.ttVal?Array.isArray(i.globals.ttVal)?(n=i.globals.ttVal[t]&&i.globals.ttVal[t].formatter,e=i.globals.ttVal[t]&&i.globals.ttVal[t].title&&i.globals.ttVal[t].title.formatter):(n=i.globals.ttVal.formatter,"function"==typeof i.globals.ttVal.title.formatter&&(e=i.globals.ttVal.title.formatter)):e=i.config.tooltip.y.title.formatter,"function"!=typeof n&&(n=i.globals.yLabelFormatters[0]?i.globals.yLabelFormatters[0]:function(t){return t}),"function"!=typeof e&&(e=function(t){return t}),{yLbFormatter:n,yLbTitleFormatter:e}}},{key:"getSeriesName",value:function(t){var e=t.fn,i=t.index,n=t.seriesIndex,o=t.j,a=this.w;return e(String(a.globals.seriesNames[i]),{series:a.globals.series,seriesIndex:n,dataPointIndex:o,w:a})}},{key:"DOMHandling",value:function(t){t.i;var e=t.t,i=(t.j,t.ttItems),n=t.values,o=t.seriesName,a=t.shared,r=t.pColor,s=this.w,l=this.ttCtx,c=n.val,h=n.xVal,u=n.xAxisTTVal,d=n.zVal,f=null,f=i[e].children;s.config.tooltip.fillSeriesColor&&(i[e].style.backgroundColor=r,f[0].style.display="none"),l.showTooltipTitle&&(null===l.tooltipTitle&&(l.tooltipTitle=s.globals.dom.baseEl.querySelector(".apexcharts-tooltip-title")),l.tooltipTitle.innerHTML=h),l.blxaxisTooltip&&(l.xaxisTooltipText.innerHTML=""!==u?u:h);var p=i[e].querySelector(".apexcharts-tooltip-text-label");p&&(p.innerHTML=o||"");var g=i[e].querySelector(".apexcharts-tooltip-text-value");g&&(g.innerHTML=void 0!==c?c:""),f[0]&&f[0].classList.contains("apexcharts-tooltip-marker")&&(s.config.tooltip.marker.fillColors&&Array.isArray(s.config.tooltip.marker.fillColors)&&(r=s.config.tooltip.marker.fillColors[e]),f[0].style.backgroundColor=r),s.config.tooltip.marker.show||(f[0].style.display="none"),null!==d&&(i[e].querySelector(".apexcharts-tooltip-text-z-label").innerHTML=s.config.tooltip.z.title,i[e].querySelector(".apexcharts-tooltip-text-z-value").innerHTML=void 0!==d?d:""),a&&f[0]&&(null==c||-1<s.globals.collapsedSeriesIndices.indexOf(e)?f[0].parentNode.style.display="none":f[0].parentNode.style.display=s.config.tooltip.items.display)}},{key:"toggleActiveInactiveSeries",value:function(t){var e,i=this.w;t?this.tooltipUtil.toggleAllTooltipSeriesGroups("enable"):(this.tooltipUtil.toggleAllTooltipSeriesGroups("disable"),(e=i.globals.dom.baseEl.querySelector(".apexcharts-tooltip-series-group"))&&(e.classList.add("apexcharts-active"),e.style.display=i.config.tooltip.items.display))}},{key:"getValuesToPrint",value:function(t){var e=t.i,i=t.j,n=this.w,o=this.ctx.series.filteredSeriesX(),a="",r="",s=null,l=null,c={series:n.globals.series,seriesIndex:e,dataPointIndex:i,w:n},h=n.globals.ttZFormatter;null===i?l=n.globals.series[e]:n.globals.isXNumeric?(a=o[e][i],0===o[e].length&&(a=o[this.tooltipUtil.getFirstActiveXArray(o)][i])):a=void 0!==n.globals.labels[i]?n.globals.labels[i]:"";var u=a;return n.globals.isXNumeric&&"datetime"===n.config.xaxis.type?a=new Z(this.ctx).xLabelFormat(n.globals.ttKeyFormatter,u,u):n.globals.isBarHorizontal||(a=n.globals.xLabelFormatter(u,c)),void 0!==n.config.tooltip.x.formatter&&(a=n.globals.ttKeyFormatter(u,c)),0<n.globals.seriesZ.length&&0<n.globals.seriesZ[0].length&&(s=h(n.globals.seriesZ[e][i],n)),r="function"==typeof n.config.xaxis.tooltip.formatter?n.globals.xaxisTooltipFormatter(u,c):a,{val:Array.isArray(l)?l.join(" "):l,xVal:Array.isArray(a)?a.join(" "):a,xAxisTTVal:Array.isArray(r)?r.join(" "):r,zVal:s}}},{key:"handleCustomTooltip",value:function(t){var e=t.i,i=t.j,n=t.y1,o=t.y2,a=t.w,r=this.ttCtx.getElTooltip(),s=a.config.tooltip.custom;Array.isArray(s)&&s[e]&&(s=s[e]),r.innerHTML=s({ctx:this.ctx,series:a.globals.series,seriesIndex:e,dataPointIndex:i,y1:n,y2:o,w:a})}}]),te),Ct=(r(Jt,[{key:"moveXCrosshairs",value:function(t,e){var i,n=1<arguments.length&&void 0!==e?e:null,o=this.ttCtx,a=this.w,r=o.getElXCrosshairs(),s=t-o.xcrosshairsWidth/2,l=a.globals.labels.slice().length;null!==n&&(s=a.globals.gridWidth/l*n),null!==r&&(r.setAttribute("x",s),r.setAttribute("x1",s),r.setAttribute("x2",s),r.setAttribute("y2",a.globals.gridHeight),r.classList.add("apexcharts-active")),s<0&&(s=0),s>a.globals.gridWidth&&(s=a.globals.gridWidth),o.blxaxisTooltip&&(i=s,"tickWidth"!==a.config.xaxis.crosshairs.width&&"barWidth"!==a.config.xaxis.crosshairs.width||(i=s+o.xcrosshairsWidth/2),this.moveXAxisTooltip(i))}},{key:"moveYCrosshairs",value:function(t){var e=this.ttCtx;null!==e.ycrosshairs&&M.setAttrs(e.ycrosshairs,{y1:t,y2:t}),null!==e.ycrosshairsHidden&&M.setAttrs(e.ycrosshairsHidden,{y1:t,y2:t})}},{key:"moveXAxisTooltip",value:function(t){var e,i,n=this.w,o=this.ttCtx;null!==o.xaxisTooltip&&(o.xaxisTooltip.classList.add("apexcharts-active"),e=o.xaxisOffY+n.config.xaxis.tooltip.offsetY+n.globals.translateY+1+n.config.xaxis.offsetY,t-=o.xaxisTooltip.getBoundingClientRect().width/2,isNaN(t)||(t+=n.globals.translateX,i=new M(this.ctx).getTextRects(o.xaxisTooltipText.innerHTML),o.xaxisTooltipText.style.minWidth=i.width+"px",o.xaxisTooltip.style.left=t+"px",o.xaxisTooltip.style.top=e+"px"))}},{key:"moveYAxisTooltip",value:function(t){var e=this.w,i=this.ttCtx;null===i.yaxisTTEls&&(i.yaxisTTEls=e.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));var n=parseInt(i.ycrosshairsHidden.getAttribute("y1"),10),o=e.globals.translateY+n,a=i.yaxisTTEls[t].getBoundingClientRect().height,r=e.globals.translateYAxisX[t]-2;e.config.yaxis[t].opposite&&(r-=26),o-=a/2,-1===e.globals.ignoreYAxisIndexes.indexOf(t)?(i.yaxisTTEls[t].classList.add("apexcharts-active"),i.yaxisTTEls[t].style.top=o+"px",i.yaxisTTEls[t].style.left=r+e.config.yaxis[t].tooltip.offsetX+"px"):i.yaxisTTEls[t].classList.remove("apexcharts-active")}},{key:"moveTooltip",value:function(t,e,i){var n,o,a=2<arguments.length&&void 0!==i?i:null,r=this.w,s=this.ttCtx,l=s.getElTooltip(),c=s.tooltipRect,h=null!==a?parseFloat(a):1,u=parseFloat(t)+h+5,d=parseFloat(e)+h/2;u>r.globals.gridWidth/2&&(u=u-c.ttWidth-h-15),u>r.globals.gridWidth-c.ttWidth-10&&(u=r.globals.gridWidth-c.ttWidth),u<-20&&(u=-20),r.config.tooltip.followCursor&&(n=s.getElGrid().getBoundingClientRect(),d=s.e.clientY+r.globals.translateY-n.top-c.ttHeight/2),r.config.tooltip.followCursor||(u=(o=this.positionChecks(c,u,d)).x,d=o.y),isNaN(u)||(u+=r.globals.translateX,l.style.left=u+"px",l.style.top=d+"px")}},{key:"positionChecks",value:function(t,e,i){var n=this.w;return t.ttHeight/2+i>n.globals.gridHeight&&(i=n.globals.gridHeight-t.ttHeight+n.globals.translateY),i<0&&(i=0),{x:e,y:i}}},{key:"moveMarkers",value:function(t,e){var i=this.w,n=this.ttCtx;if(0<i.globals.markers.size[t])for(var o=i.globals.dom.baseEl.querySelectorAll(" .apexcharts-series[data\\:realIndex='".concat(t,"'] .apexcharts-marker")),a=0;a<o.length;a++)parseInt(o[a].getAttribute("rel"),10)===e&&(n.marker.resetPointsSize(),n.marker.enlargeCurrentPoint(e,o[a]));else n.marker.resetPointsSize(),this.moveDynamicPointOnHover(e,t)}},{key:"moveDynamicPointOnHover",value:function(t,e){var i,n,o,a=this.w,r=this.ttCtx,s=a.globals.pointsArray,l=r.tooltipUtil.getHoverMarkerSize(e),c=a.config.series[e].type;c&&("column"===c||"candlestick"===c)||(i=s[e][t][0],n=s[e][t][1]?s[e][t][1]:0,(o=a.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(e,"'] .apexcharts-series-markers circle")))&&n<a.globals.gridHeight&&0<n&&(o.setAttribute("r",l),o.setAttribute("cx",i),o.setAttribute("cy",n)),this.moveXCrosshairs(i),r.fixedTooltip||this.moveTooltip(i,n,l))}},{key:"moveDynamicPointsOnHover",value:function(t){var e=this.ttCtx,i=e.w,n=0,o=0,a=i.globals.pointsArray,r=new H(this.ctx).getActiveConfigSeriesIndex(!0),s=e.tooltipUtil.getHoverMarkerSize(r);a[r]&&(n=a[r][t][0],o=a[r][t][1]);var l,c=e.tooltipUtil.getAllMarkers();if(null!==c)for(var h=0;h<i.globals.series.length;h++){var u,d=a[h];i.globals.comboCharts&&void 0===d&&c.splice(h,0,null),d&&d.length&&(u=a[h][t][1],c[h].setAttribute("cx",n),null!==u&&!isNaN(u)&&u<i.globals.gridHeight&&0<u?(c[h]&&c[h].setAttribute("r",s),c[h]&&c[h].setAttribute("cy",u)):c[h]&&c[h].setAttribute("r",0))}this.moveXCrosshairs(n),e.fixedTooltip||(l=o||i.globals.gridHeight,this.moveTooltip(n,l,s))}},{key:"moveStickyTooltipOverBars",value:function(t){var e=this.w,i=this.ttCtx,n=e.globals.columnSeries?e.globals.columnSeries.length:e.globals.series.length,o=2<=n&&n%2==0?Math.floor(n/2):Math.floor(n/2)+1,a=e.globals.dom.baseEl.querySelector(".apexcharts-bar-series .apexcharts-series[rel='".concat(o,"'] path[j='").concat(t,"'], .apexcharts-candlestick-series .apexcharts-series[rel='").concat(o,"'] path[j='").concat(t,"'], .apexcharts-rangebar-series .apexcharts-series[rel='").concat(o,"'] path[j='").concat(t,"']")),r=a?parseFloat(a.getAttribute("cx")):0,s=a?parseFloat(a.getAttribute("barWidth")):0;e.globals.isXNumeric?r-=n%2!=0?s/2:0:(r=i.xAxisTicksPositions[t-1]+i.dataPointsDividedWidth/2,isNaN(r)&&(r=i.xAxisTicksPositions[t]-i.dataPointsDividedWidth/2));var l,c=i.getElGrid().getBoundingClientRect(),h=i.e.clientY-c.top-i.tooltipRect.ttHeight/2;this.moveXCrosshairs(r),i.fixedTooltip||(l=h||e.globals.gridHeight,this.moveTooltip(r,l))}}]),Jt),At=(r(Qt,[{key:"drawDynamicPoints",value:function(){var t=this.w,e=new M(this.ctx),i=new z(this.ctx),n=C(n=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series"));t.config.chart.stacked&&n.sort(function(t,e){return parseFloat(t.getAttribute("data:realIndex"))-parseFloat(e.getAttribute("data:realIndex"))});for(var o=0;o<n.length;o++){var a,r,s,l,c=n[o].querySelector(".apexcharts-series-markers-wrap");null!==c&&(a=void 0,r="apexcharts-marker w".concat((Math.random()+1).toString(36).substring(4)),"line"!==t.config.chart.type&&"area"!==t.config.chart.type||t.globals.comboCharts||t.config.tooltip.intersect||(r+=" no-pointer-events"),s=i.getMarkerConfig(r,o),(a=e.drawMarker(0,0,s)).node.setAttribute("default-marker-size",0),(l=document.createElementNS(t.globals.SVGNS,"g")).classList.add("apexcharts-series-markers"),l.appendChild(a.node),c.appendChild(l))}}},{key:"enlargeCurrentPoint",value:function(t,e,i,n){var o=2<arguments.length&&void 0!==i?i:null,a=3<arguments.length&&void 0!==n?n:null,r=this.w;"bubble"!==r.config.chart.type&&this.newPointSize(t,e);var s,l=e.getAttribute("cx"),c=e.getAttribute("cy");null!==o&&null!==a&&(l=o,c=a),this.tooltipPosition.moveXCrosshairs(l),this.fixedTooltip||("radar"===r.config.chart.type&&(s=this.ttCtx.getElGrid().getBoundingClientRect(),l=this.ttCtx.e.clientX-s.left),this.tooltipPosition.moveTooltip(l,c,r.config.markers.hover.size))}},{key:"enlargePoints",value:function(t){for(var e=this.w,i=this.ttCtx,n=t,o=e.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),a=e.config.markers.hover.size,r=0;r<o.length;r++){var s,l,c=o[r].getAttribute("rel"),h=o[r].getAttribute("index");void 0===a&&(a=e.globals.markers.size[h]+e.config.markers.hover.sizeOffset),n===parseInt(c,10)?(this.newPointSize(n,o[r]),s=o[r].getAttribute("cx"),l=o[r].getAttribute("cy"),this.tooltipPosition.moveXCrosshairs(s),i.fixedTooltip||this.tooltipPosition.moveTooltip(s,l,a)):this.oldPointSize(o[r])}}},{key:"newPointSize",value:function(t,e){var i,n=this.w,o=n.config.markers.hover.size,a=0===t?e.parentNode.firstChild:e.parentNode.lastChild;"0"!==a.getAttribute("default-marker-size")&&(i=parseInt(a.getAttribute("index"),10),void 0===o&&(o=n.globals.markers.size[i]+n.config.markers.hover.sizeOffset),a.setAttribute("r",o))}},{key:"oldPointSize",value:function(t){var e=parseFloat(t.getAttribute("default-marker-size"));t.setAttribute("r",e)}},{key:"resetPointsSize",value:function(){for(var t=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),e=0;e<t.length;e++){var i=parseFloat(t[e].getAttribute("default-marker-size"));L.isNumber(i)?t[e].setAttribute("r",i):t[e].setAttribute("r",0)}}}]),Qt),St=(r(Zt,[{key:"getAttr",value:function(t,e){return parseFloat(t.target.getAttribute(e))}},{key:"handleHeatTooltip",value:function(t){var e,i,n,o,a,r,s,l=t.e,c=t.opt,h=t.x,u=t.y,d=this.ttCtx,f=this.w;return l.target.classList.contains("apexcharts-heatmap-rect")&&(e=this.getAttr(l,"i"),i=this.getAttr(l,"j"),n=this.getAttr(l,"cx"),o=this.getAttr(l,"cy"),a=this.getAttr(l,"width"),r=this.getAttr(l,"height"),d.tooltipLabels.drawSeriesTexts({ttItems:c.ttItems,i:e,j:i,shared:!1}),f.globals.capturedSeriesIndex=e,f.globals.capturedDataPointIndex=i,h=n+d.tooltipRect.ttWidth/2+a,u=o+d.tooltipRect.ttHeight/2-r/2,d.tooltipPosition.moveXCrosshairs(n+a/2),h>f.globals.gridWidth/2&&(h=n-d.tooltipRect.ttWidth/2+a),d.w.config.tooltip.followCursor&&(s=d.getElGrid().getBoundingClientRect(),u=d.e.clientY-s.top+f.globals.translateY/2-10)),{x:h,y:u}}},{key:"handleMarkerTooltip",value:function(t){var e,i,n,o,a,r,s,l=t.e,c=t.opt,h=t.x,u=t.y,d=this.w,f=this.ttCtx;return l.target.classList.contains("apexcharts-marker")&&(e=parseInt(c.paths.getAttribute("cx"),10),i=parseInt(c.paths.getAttribute("cy"),10),n=parseFloat(c.paths.getAttribute("val")),a=parseInt(c.paths.getAttribute("rel"),10),r=parseInt(c.paths.parentNode.parentNode.parentNode.getAttribute("rel"),10)-1,f.intersect&&(o=L.findAncestor(c.paths,"apexcharts-series"))&&(r=parseInt(o.getAttribute("data:realIndex"),10)),f.tooltipLabels.drawSeriesTexts({ttItems:c.ttItems,i:r,j:a,shared:!f.showOnIntersect&&d.config.tooltip.shared}),"mouseup"===l.type&&f.markerClick(l,r,a),d.globals.capturedSeriesIndex=r,d.globals.capturedDataPointIndex=a,h=e,u=i+d.globals.translateY-1.4*f.tooltipRect.ttHeight,f.w.config.tooltip.followCursor&&(s=f.getElGrid().getBoundingClientRect(),u=f.e.clientY+d.globals.translateY-s.top),n<0&&(u=i),f.marker.enlargeCurrentPoint(a,c.paths,h,u)),{x:h,y:u}}},{key:"handleBarTooltip",value:function(t){var e,i,n,o,a=t.e,r=t.opt,s=this.w,l=this.ttCtx,c=l.getElTooltip(),h=0,u=0,d=0,f=this.getBarTooltipXY({e:a,opt:r}),p=f.i,g=f.barHeight,v=f.j;s.globals.capturedSeriesIndex=p,s.globals.capturedDataPointIndex=v,s.globals.isBarHorizontal&&l.tooltipUtil.hasBars()||!s.config.tooltip.shared?(u=f.x,d=f.y,e=Array.isArray(s.config.stroke.width)?s.config.stroke.width[p]:s.config.stroke.width,h=u):s.globals.comboCharts||s.config.tooltip.shared||(h/=2),isNaN(d)?d=s.globals.svgHeight-l.tooltipRect.ttHeight:d<0&&(d=0),u+l.tooltipRect.ttWidth>s.globals.gridWidth?u-=l.tooltipRect.ttWidth:u<0&&(u=0),l.w.config.tooltip.followCursor&&(i=l.getElGrid().getBoundingClientRect(),d=l.e.clientY-i.top),null===l.tooltip&&(l.tooltip=s.globals.dom.baseEl.querySelector(".apexcharts-tooltip")),s.config.tooltip.shared||(0<s.globals.comboBarCount?l.tooltipPosition.moveXCrosshairs(h+e/2):l.tooltipPosition.moveXCrosshairs(h)),!l.fixedTooltip&&(!s.config.tooltip.shared||s.globals.isBarHorizontal&&l.tooltipUtil.hasBars())&&((n=s.globals.isMultipleYAxis?s.config.yaxis[o]&&s.config.yaxis[o].reversed:s.config.yaxis[0].reversed)&&(u-=l.tooltipRect.ttWidth)<0&&(u=0),c.style.left=u+s.globals.translateX+"px",o=parseInt(r.paths.parentNode.getAttribute("data:realIndex"),10),!n||s.globals.isBarHorizontal&&l.tooltipUtil.hasBars()||(d=d+g-2*(s.globals.series[p][v]<0?g:0)),l.tooltipRect.ttHeight+d>s.globals.gridHeight?(d=s.globals.gridHeight-l.tooltipRect.ttHeight+s.globals.translateY,c.style.top=d+"px"):c.style.top=d+s.globals.translateY-l.tooltipRect.ttHeight/2+"px")}},{key:"getBarTooltipXY",value:function(t){var e,i,n,o,a,r,s,l,c,h,u=t.e,d=t.opt,f=this.w,p=null,g=this.ttCtx,v=0,m=0,b=0,y=0,x=0,w=u.target.classList;return(w.contains("apexcharts-bar-area")||w.contains("apexcharts-candlestick-area")||w.contains("apexcharts-rangebar-area"))&&(i=(e=u.target).getBoundingClientRect(),n=d.elGrid.getBoundingClientRect(),o=i.height,x=i.height,a=i.width,r=parseInt(e.getAttribute("cx"),10),s=parseInt(e.getAttribute("cy"),10),y=parseFloat(e.getAttribute("barWidth")),l="touchmove"===u.type?u.touches[0].clientX:u.clientX,p=parseInt(e.getAttribute("j"),10),v=parseInt(e.parentNode.getAttribute("rel"),10)-1,c=e.getAttribute("data-range-y1"),h=e.getAttribute("data-range-y2"),f.globals.comboCharts&&(v=parseInt(e.parentNode.getAttribute("data:realIndex"),10)),g.tooltipLabels.drawSeriesTexts({ttItems:d.ttItems,i:v,j:p,y1:c?parseInt(c,10):null,y2:h?parseInt(h,10):null,shared:!g.showOnIntersect&&f.config.tooltip.shared}),b=f.config.tooltip.followCursor?f.globals.isBarHorizontal?(m=l-n.left+15,s-g.dataPointsDividedHeight+o/2-g.tooltipRect.ttHeight/2):(m=f.globals.isXNumeric?r-a/2:r-g.dataPointsDividedWidth+a/2,u.clientY-n.top-g.tooltipRect.ttHeight/2-15):f.globals.isBarHorizontal?((m=r)<g.xyRatios.baseLineInvertedY&&(m=r-g.tooltipRect.ttWidth),s-g.dataPointsDividedHeight+o/2-g.tooltipRect.ttHeight/2):(m=f.globals.isXNumeric?r-a/2:r-g.dataPointsDividedWidth+a/2,s)),{x:m,y:b,barHeight:x,barWidth:y,i:v,j:p}}}]),Zt),Tt=(r(Kt,[{key:"drawXaxisTooltip",value:function(){var t=this.w,e=this.ttCtx,i="bottom"===t.config.xaxis.position;e.xaxisOffY=i?t.globals.gridHeight+1:-t.globals.xAxisHeight-t.config.xaxis.axisTicks.height+3;var n=i?"apexcharts-xaxistooltip apexcharts-xaxistooltip-bottom":"apexcharts-xaxistooltip apexcharts-xaxistooltip-top",o=t.globals.dom.elWrap;e.blxaxisTooltip&&null===t.globals.dom.baseEl.querySelector(".apexcharts-xaxistooltip")&&(e.xaxisTooltip=document.createElement("div"),e.xaxisTooltip.setAttribute("class",n+" apexcharts-theme-"+t.config.tooltip.theme),o.appendChild(e.xaxisTooltip),e.xaxisTooltipText=document.createElement("div"),e.xaxisTooltipText.classList.add("apexcharts-xaxistooltip-text"),e.xaxisTooltipText.style.fontFamily=t.config.xaxis.tooltip.style.fontFamily||t.config.chart.fontFamily,e.xaxisTooltipText.style.fontSize=t.config.xaxis.tooltip.style.fontSize,e.xaxisTooltip.appendChild(e.xaxisTooltipText))}},{key:"drawYaxisTooltip",value:function(){for(var o=this.w,a=this.ttCtx,t=0;t<o.config.yaxis.length;t++)!function(i){var t=o.config.yaxis[i].opposite||o.config.yaxis[i].crosshairs.opposite;a.yaxisOffX=t?o.globals.gridWidth+1:1;var n="apexcharts-yaxistooltip apexcharts-yaxistooltip-".concat(i,t?" apexcharts-yaxistooltip-right":" apexcharts-yaxistooltip-left");o.globals.yAxisSameScaleIndices.map(function(t,e){t.map(function(t,e){e===i&&(n+=o.config.yaxis[e].show?" ":" apexcharts-yaxistooltip-hidden")})});var e=o.globals.dom.elWrap;null===o.globals.dom.baseEl.querySelector(".apexcharts-yaxistooltip apexcharts-yaxistooltip-".concat(i))&&(a.yaxisTooltip=document.createElement("div"),a.yaxisTooltip.setAttribute("class",n+" apexcharts-theme-"+o.config.tooltip.theme),e.appendChild(a.yaxisTooltip),0===i&&(a.yaxisTooltipText=[]),a.yaxisTooltipText[i]=document.createElement("div"),a.yaxisTooltipText[i].classList.add("apexcharts-yaxistooltip-text"),a.yaxisTooltip.appendChild(a.yaxisTooltipText[i]))}(t)}},{key:"setXCrosshairWidth",value:function(){var t,e,i,n,o,a,r=this.w,s=this.ttCtx,l=s.getElXCrosshairs();s.xcrosshairsWidth=parseInt(r.config.xaxis.crosshairs.width,10),r.globals.comboCharts?null!==(t=r.globals.dom.baseEl.querySelector(".apexcharts-bar-area"))&&"barWidth"===r.config.xaxis.crosshairs.width?(e=parseFloat(t.getAttribute("barWidth")),s.xcrosshairsWidth=e):"tickWidth"===r.config.xaxis.crosshairs.width&&(i=r.globals.labels.length,s.xcrosshairsWidth=r.globals.gridWidth/i):"tickWidth"===r.config.xaxis.crosshairs.width?(n=r.globals.labels.length,s.xcrosshairsWidth=r.globals.gridWidth/n):"barWidth"===r.config.xaxis.crosshairs.width&&(null!==(o=r.globals.dom.baseEl.querySelector(".apexcharts-bar-area"))?(a=parseFloat(o.getAttribute("barWidth")),s.xcrosshairsWidth=a):s.xcrosshairsWidth=1),r.globals.isBarHorizontal&&(s.xcrosshairsWidth=0),null!==l&&0<s.xcrosshairsWidth&&l.setAttribute("width",s.xcrosshairsWidth)}},{key:"handleYCrosshair",value:function(){var t=this.w,e=this.ttCtx;e.ycrosshairs=t.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs"),e.ycrosshairsHidden=t.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs-hidden")}},{key:"drawYaxisTooltipText",value:function(t,e,i){var n,o,a,r,s=this.ttCtx,l=this.w,c=l.globals.yLabelFormatters[t];s.yaxisTooltips[t]&&(o=(e-(n=s.getElGrid().getBoundingClientRect()).top)*i.yRatio[t],a=l.globals.maxYArr[t]-l.globals.minYArr[t],r=l.globals.minYArr[t]+(a-o),s.tooltipPosition.moveYCrosshairs(e-n.top),s.yaxisTooltipText[t].innerHTML=c(r),s.tooltipPosition.moveYAxisTooltip(t))}}]),Kt),Et=(r(Gt,[{key:"getElTooltip",value:function(t){return(t=t||this).w.globals.dom.baseEl.querySelector(".apexcharts-tooltip")}},{key:"getElXCrosshairs",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-xcrosshairs")}},{key:"getElGrid",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-grid")}},{key:"drawTooltip",value:function(t){var i=this.w;this.xyRatios=t,this.blxaxisTooltip=i.config.xaxis.tooltip.enabled&&i.globals.axisCharts,this.yaxisTooltips=i.config.yaxis.map(function(t,e){return!!(t.show&&t.tooltip.enabled&&i.globals.axisCharts)}),this.allTooltipSeriesGroups=[],i.globals.axisCharts||(this.showTooltipTitle=!1);var e,n,o=document.createElement("div");o.classList.add("apexcharts-tooltip"),o.classList.add("apexcharts-theme-".concat(this.tConfig.theme)),i.globals.dom.elWrap.appendChild(o),i.globals.axisCharts&&(this.axesTooltip.drawXaxisTooltip(),this.axesTooltip.drawYaxisTooltip(),this.axesTooltip.setXCrosshairWidth(),this.axesTooltip.handleYCrosshair(),e=new tt(this.ctx),this.xAxisTicksPositions=e.getXAxisTicksPositions()),!i.globals.comboCharts&&!this.tConfig.intersect&&"bar"!==i.config.chart.type&&"rangeBar"!==i.config.chart.type||this.tConfig.shared||(this.showOnIntersect=!0),0!==i.config.markers.size&&0!==i.globals.markers.largestSize||this.marker.drawDynamicPoints(this),i.globals.collapsedSeries.length!==i.globals.series.length&&(this.dataPointsDividedHeight=i.globals.gridHeight/i.globals.dataPoints,this.dataPointsDividedWidth=i.globals.gridWidth/i.globals.dataPoints,this.showTooltipTitle&&(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.classList.add("apexcharts-tooltip-title"),this.tooltipTitle.style.fontFamily=this.tConfig.style.fontFamily||i.config.chart.fontFamily,this.tooltipTitle.style.fontSize=this.tConfig.style.fontSize,o.appendChild(this.tooltipTitle)),n=i.globals.series.length,(i.globals.xyCharts||i.globals.comboCharts)&&this.tConfig.shared&&(n=this.showOnIntersect?1:i.globals.series.length),this.legendLabels=i.globals.dom.baseEl.querySelectorAll(".apexcharts-legend-text"),this.ttItems=this.createTTElements(n),this.addSVGEvents())}},{key:"createTTElements",value:function(t){for(var e=this.w,i=[],n=this.getElTooltip(),o=0;o<t;o++){var a=document.createElement("div");a.classList.add("apexcharts-tooltip-series-group"),this.tConfig.shared&&this.tConfig.enabledOnSeries&&Array.isArray(this.tConfig.enabledOnSeries)&&this.tConfig.enabledOnSeries.indexOf(o)<0&&a.classList.add("apexcharts-tooltip-series-group-hidden");var r=document.createElement("span");r.classList.add("apexcharts-tooltip-marker"),r.style.backgroundColor=e.globals.colors[o],a.appendChild(r);var s=document.createElement("div");s.classList.add("apexcharts-tooltip-text"),s.style.fontFamily=this.tConfig.style.fontFamily||e.config.chart.fontFamily,s.style.fontSize=this.tConfig.style.fontSize;var l=document.createElement("div");l.classList.add("apexcharts-tooltip-y-group");var c=document.createElement("span");c.classList.add("apexcharts-tooltip-text-label"),l.appendChild(c);var h=document.createElement("span");h.classList.add("apexcharts-tooltip-text-value"),l.appendChild(h);var u=document.createElement("div");u.classList.add("apexcharts-tooltip-z-group");var d=document.createElement("span");d.classList.add("apexcharts-tooltip-text-z-label"),u.appendChild(d);var f=document.createElement("span");f.classList.add("apexcharts-tooltip-text-z-value"),u.appendChild(f),s.appendChild(l),s.appendChild(u),a.appendChild(s),n.appendChild(a),i.push(a)}return i}},{key:"addSVGEvents",value:function(){var t=this.w,e=t.config.chart.type,i=this.getElTooltip(),n=!("bar"!==e&&"candlestick"!==e&&"rangeBar"!==e),o="area"===e||"line"===e||"scatter"===e||"bubble"===e||"radar"===e,a=t.globals.dom.Paper.node,r=this.getElGrid();r&&(this.seriesBound=r.getBoundingClientRect());var s,l,c,h=[],u=[],d={hoverArea:a,elGrid:r,tooltipEl:i,tooltipY:h,tooltipX:u,ttItems:this.ttItems};if(t.globals.axisCharts&&(o?s=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:longestSeries='true'] .apexcharts-marker"):n?s=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-bar-area, .apexcharts-series .apexcharts-candlestick-area, .apexcharts-series .apexcharts-rangebar-area"):"heatmap"===e&&(s=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-heatmap")),s&&s.length))for(var f=0;f<s.length;f++)h.push(s[f].getAttribute("cy")),u.push(s[f].getAttribute("cx"));t.globals.xyCharts&&!this.showOnIntersect||t.globals.comboCharts&&!this.showOnIntersect||n&&this.tooltipUtil.hasBars()&&this.tConfig.shared?this.addPathsEventListeners([a],d):n&&!t.globals.comboCharts||o&&this.showOnIntersect?this.addDatapointEventsListeners(d):t.globals.axisCharts&&"heatmap"!==e||(l=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series"),this.addPathsEventListeners(l,d)),this.showOnIntersect&&(0<(c=t.globals.dom.baseEl.querySelectorAll(".apexcharts-line-series .apexcharts-marker, .apexcharts-area-series .apexcharts-marker")).length&&this.addPathsEventListeners(c,d),this.tooltipUtil.hasBars()&&!this.tConfig.shared&&this.addDatapointEventsListeners(d))}},{key:"drawFixedTooltipRect",value:function(){var t=this.w,e=this.getElTooltip(),i=e.getBoundingClientRect(),n=i.width+10,o=i.height+10,a=this.tConfig.fixed.offsetX,r=this.tConfig.fixed.offsetY,s=this.tConfig.fixed.position.toLowerCase();return-1<s.indexOf("right")&&(a=a+t.globals.svgWidth-n+10),-1<s.indexOf("bottom")&&(r=r+t.globals.svgHeight-o-10),e.style.left=a+"px",e.style.top=r+"px",{x:a,y:r,ttWidth:n,ttHeight:o}}},{key:"addDatapointEventsListeners",value:function(t){var e=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers .apexcharts-marker, .apexcharts-bar-area, .apexcharts-candlestick-area, .apexcharts-rangebar-area");this.addPathsEventListeners(e,t)}},{key:"addPathsEventListeners",value:function(n,t){for(var e,o=this,i=(e=function(e){var i={paths:n[e],tooltipEl:t.tooltipEl,tooltipY:t.tooltipY,tooltipX:t.tooltipX,elGrid:t.elGrid,hoverArea:t.hoverArea,ttItems:t.ttItems};["mousemove","mouseup","touchmove","mouseout","touchend"].map(function(t){return n[e].addEventListener(t,o.seriesHover.bind(o,i),{capture:!1,passive:!0})})},r.toString=function(){return e.toString()},r),a=0;a<n.length;a++)i(a);function r(t){return e.apply(this,arguments)}}},{key:"seriesHover",value:function(n,o){var a=this,t=[],e=this.w;e.config.chart.group&&(t=this.ctx.getGroupedCharts()),e.globals.axisCharts&&(e.globals.minX===-1/0&&e.globals.maxX===1/0||0===e.globals.dataPoints)||(t.length?t.forEach(function(t){var e=a.getElTooltip(t),i={paths:n.paths,tooltipEl:e,tooltipY:n.tooltipY,tooltipX:n.tooltipX,elGrid:n.elGrid,hoverArea:n.hoverArea,ttItems:t.w.globals.tooltip.ttItems};t.w.globals.minX===a.w.globals.minX&&t.w.globals.maxX===a.w.globals.maxX&&t.w.globals.tooltip.seriesHoverByContext({chartCtx:t,ttCtx:t.w.globals.tooltip,opt:i,e:o})}):this.seriesHoverByContext({chartCtx:this.ctx,ttCtx:this.w.globals.tooltip,opt:n,e:o}))}},{key:"seriesHoverByContext",value:function(t){var e=t.chartCtx,i=t.ttCtx,n=t.opt,o=t.e,a=e.w,r=this.getElTooltip();i.tooltipRect={x:0,y:0,ttWidth:r.getBoundingClientRect().width,ttHeight:r.getBoundingClientRect().height},i.e=o,!i.tooltipUtil.hasBars()||a.globals.comboCharts||i.isBarShared||this.tConfig.onDatasetHover.highlightDataSeries&&new H(e).toggleSeriesOnHover(o,o.target.parentNode),i.fixedTooltip&&i.drawFixedTooltipRect(),a.globals.axisCharts?i.axisChartsTooltips({e:o,opt:n,tooltipRect:i.tooltipRect}):i.nonAxisChartsTooltips({e:o,opt:n,tooltipRect:i.tooltipRect})}},{key:"axisChartsTooltips",value:function(t){var e=t.e,i=t.opt,n=this.w,o=i.elGrid.getBoundingClientRect(),a="touchmove"===e.type?e.touches[0].clientX:e.clientX,r="touchmove"===e.type?e.touches[0].clientY:e.clientY;if(this.clientY=r,this.clientX=a,n.globals.capturedSeriesIndex=-1,n.globals.capturedDataPointIndex=-1,r<o.top||r>o.top+o.height)this.handleMouseOut(i);else{if(Array.isArray(this.tConfig.enabledOnSeries)&&!n.config.tooltip.shared){var s=parseInt(i.paths.getAttribute("index"),10);if(this.tConfig.enabledOnSeries.indexOf(s)<0)return void this.handleMouseOut(i)}var l=this.getElTooltip(),c=this.getElXCrosshairs(),h=n.globals.xyCharts||"bar"===n.config.chart.type&&!n.globals.isBarHorizontal&&this.tooltipUtil.hasBars()&&this.tConfig.shared||n.globals.comboCharts&&this.tooltipUtil.hasBars();if(n.globals.isBarHorizontal&&this.tooltipUtil.hasBars()&&(h=!1),"mousemove"===e.type||"touchmove"===e.type||"mouseup"===e.type){null!==c&&c.classList.add("apexcharts-active");var u,d,f,p=this.yaxisTooltips.filter(function(t){return!0===t});if(null!==this.ycrosshairs&&p.length&&this.ycrosshairs.classList.add("apexcharts-active"),h&&!this.showOnIntersect?this.handleStickyTooltip(e,a,r,i):"heatmap"===n.config.chart.type?(d=(u=this.intersect.handleHeatTooltip({e:e,opt:i,x:d,y:f})).x,f=u.y,l.style.left=d+"px",l.style.top=f+"px"):(this.tooltipUtil.hasBars()&&this.intersect.handleBarTooltip({e:e,opt:i}),this.tooltipUtil.hasMarkers()&&this.intersect.handleMarkerTooltip({e:e,opt:i,x:d,y:f})),this.yaxisTooltips.length)for(var g=0;g<n.config.yaxis.length;g++)this.axesTooltip.drawYaxisTooltipText(g,r,this.xyRatios);i.tooltipEl.classList.add("apexcharts-active")}else"mouseout"!==e.type&&"touchend"!==e.type||this.handleMouseOut(i)}}},{key:"nonAxisChartsTooltips",value:function(t){var e,i,n=t.e,o=t.opt,a=t.tooltipRect,r=this.w,s=o.paths.getAttribute("rel"),l=this.getElTooltip(),c=r.globals.dom.elWrap.getBoundingClientRect();"mousemove"===n.type||"touchmove"===n.type?(l.classList.add("apexcharts-active"),this.tooltipLabels.drawSeriesTexts({ttItems:o.ttItems,i:parseInt(s,10)-1,shared:!1}),e=r.globals.clientX-c.left-a.ttWidth/2,i=r.globals.clientY-c.top-a.ttHeight-10,l.style.left=e+"px",l.style.top=i+"px"):"mouseout"!==n.type&&"touchend"!==n.type||l.classList.remove("apexcharts-active")}},{key:"handleStickyTooltip",value:function(t,e,i,n){var o=this.w,a=this.tooltipUtil.getNearestValues({context:this,hoverArea:n.hoverArea,elGrid:n.elGrid,clientX:e,clientY:i}),r=a.j,s=a.capturedSeries;a.hoverX<0||a.hoverX>o.globals.gridWidth?this.handleMouseOut(n):null!==s?this.handleStickyCapturedSeries(t,s,n,r):this.tooltipUtil.isXoverlap(r)&&this.create(t,this,0,r,n.ttItems)}},{key:"handleStickyCapturedSeries",value:function(t,e,i,n){var o=this.w;null===o.globals.series[e][n]?this.handleMouseOut(i):void 0!==o.globals.series[e][n]?this.tConfig.shared&&this.tooltipUtil.isXoverlap(n)&&this.tooltipUtil.isInitialSeriesSameLen()?this.create(t,this,e,n,i.ttItems):this.create(t,this,e,n,i.ttItems,!1):this.tooltipUtil.isXoverlap(n)&&this.create(t,this,0,n,i.ttItems)}},{key:"deactivateHoverFilter",value:function(){for(var t=this.w,e=new M(this.ctx),i=t.globals.dom.Paper.select(".apexcharts-bar-area"),n=0;n<i.length;n++)e.pathMouseLeave(i[n])}},{key:"handleMouseOut",value:function(t){var e=this.w,i=this.getElXCrosshairs();if(t.tooltipEl.classList.remove("apexcharts-active"),this.deactivateHoverFilter(),"bubble"!==e.config.chart.type&&this.marker.resetPointsSize(),null!==i&&i.classList.remove("apexcharts-active"),null!==this.ycrosshairs&&this.ycrosshairs.classList.remove("apexcharts-active"),this.blxaxisTooltip&&this.xaxisTooltip.classList.remove("apexcharts-active"),this.yaxisTooltips.length){null===this.yaxisTTEls&&(this.yaxisTTEls=e.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));for(var n=0;n<this.yaxisTTEls.length;n++)this.yaxisTTEls[n].classList.remove("apexcharts-active")}e.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach(function(t){var e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(e)})}},{key:"markerClick",value:function(t,e,i){var n=this.w;"function"==typeof n.config.chart.events.markerClick&&n.config.chart.events.markerClick(t,this.ctx,{seriesIndex:e,dataPointIndex:i,w:n}),this.ctx.events.fireEvent("markerClick",[t,this.ctx,{seriesIndex:e,dataPointIndex:i,w:n}])}},{key:"create",value:function(t,e,i,n,o,a){var r=5<arguments.length&&void 0!==a?a:null,s=this.w,l=e;"mouseup"===t.type&&this.markerClick(t,i,n),null===r&&(r=this.tConfig.shared);var c=this.tooltipUtil.hasMarkers(),h=this.tooltipUtil.getElBars();if(s.config.legend.tooltipHoverFormatter){var u=s.config.legend.tooltipHoverFormatter,d=Array.from(this.legendLabels);d.forEach(function(t){var e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(e)});for(var f=0;f<d.length;f++){var p=d[f],g=parseInt(p.getAttribute("i"),10),v=decodeURIComponent(p.getAttribute("data:default-text")),m=u(v,{seriesIndex:r?g:i,dataPointIndex:n,w:s});if(r)p.innerHTML=s.globals.collapsedSeriesIndices.indexOf(g)<0?m:v;else if(p.innerHTML=g===i?m:v,i===g)break}}if(r){if(l.tooltipLabels.drawSeriesTexts({ttItems:o,i:i,j:n,shared:!this.showOnIntersect&&this.tConfig.shared}),c&&(0<s.globals.markers.largestSize?l.marker.enlargePoints(n):l.tooltipPosition.moveDynamicPointsOnHover(n)),this.tooltipUtil.hasBars()&&(this.barSeriesHeight=this.tooltipUtil.getBarsHeight(h),0<this.barSeriesHeight)){var b=new M(this.ctx),y=s.globals.dom.Paper.select(".apexcharts-bar-area[j='".concat(n,"']"));this.deactivateHoverFilter(),this.tooltipPosition.moveStickyTooltipOverBars(n);for(var x=0;x<y.length;x++)b.pathMouseEnter(y[x])}}else l.tooltipLabels.drawSeriesTexts({shared:!1,ttItems:o,i:i,j:n}),this.tooltipUtil.hasBars()&&l.tooltipPosition.moveStickyTooltipOverBars(n),c&&l.tooltipPosition.moveMarkers(i,n)}}]),Gt),_t=function(){l(e,Y);var t=h(e);function e(){return a(this,e),t.apply(this,arguments)}return r(e,[{key:"draw",value:function(y,x){var w=this,k=this.w;this.graphics=new M(this.ctx),this.bar=new Y(this.ctx,this.xyRatios);var t=new E(this.ctx,k);y=t.getLogSeries(y),this.yRatio=t.getLogYRatios(this.yRatio),this.barHelpers.initVariables(y),"100%"===k.config.chart.stackType&&(y=k.globals.seriesPercent.slice()),this.series=y,this.totalItems=0,this.prevY=[],this.prevX=[],this.prevYF=[],this.prevXF=[],this.prevYVal=[],this.prevXVal=[],this.xArrj=[],this.xArrjF=[],this.xArrjVal=[],this.yArrj=[],this.yArrjF=[],this.yArrjVal=[];for(var e=0;e<y.length;e++)0<y[e].length&&(this.totalItems+=y[e].length);for(var C=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),A=0,S=0,i=0,n=0;i<y.length;i++,n++)!function(t,e){var i=void 0,n=void 0,o=void 0,a=void 0,r=[],s=[],l=k.globals.comboCharts?x[t]:t;1<w.yRatio.length&&(w.yaxisIndex=l),w.isReversed=k.config.yaxis[w.yaxisIndex]&&k.config.yaxis[w.yaxisIndex].reversed;var c=w.graphics.group({class:"apexcharts-series",seriesName:L.escapeString(k.globals.seriesNames[l]),rel:t+1,"data:realIndex":l});w.ctx.series.addCollapsedClassToSeries(c,l);var h=w.graphics.group({class:"apexcharts-datalabels","data:realIndex":l}),u=0,d=0,f=w.initialPositions(A,S,i,n,o,a);S=f.y,u=f.barHeight,n=f.yDivision,a=f.zeroW,A=f.x,d=f.barWidth,i=f.xDivision,o=f.zeroH,w.yArrj=[],w.yArrjF=[],w.yArrjVal=[],w.xArrj=[],w.xArrjF=[],w.xArrjVal=[],1===w.prevY.length&&w.prevY[0].every(function(t){return isNaN(t)})&&(w.prevY[0]=w.prevY[0].map(function(t){return o}),w.prevYF[0]=w.prevYF[0].map(function(t){return 0}));for(var p=0;p<k.globals.dataPoints;p++){var g=w.barHelpers.getStrokeWidth(t,p,l),v={indexes:{i:t,j:p,realIndex:l,bc:e},strokeWidth:g,x:A,y:S,elSeries:c},m=null;w.isHorizontal?(m=w.drawStackedBarPaths(P(P({},v),{},{zeroW:a,barHeight:u,yDivision:n})),d=w.series[t][p]/w.invertedYRatio):(m=w.drawStackedColumnPaths(P(P({},v),{},{xDivision:i,barWidth:d,zeroH:o})),u=w.series[t][p]/w.yRatio[w.yaxisIndex]),S=m.y,A=m.x,r.push(A),s.push(S);var b=w.barHelpers.getPathFillColor(y,t,p,l),c=w.renderSeries({realIndex:l,pathFill:b,j:p,i:t,pathFrom:m.pathFrom,pathTo:m.pathTo,strokeWidth:g,elSeries:c,x:A,y:S,series:y,barHeight:u,barWidth:d,elDataLabelsWrap:h,type:"bar",visibleSeries:0})}k.globals.seriesXvalues[l]=r,k.globals.seriesYvalues[l]=s,w.prevY.push(w.yArrj),w.prevYF.push(w.yArrjF),w.prevYVal.push(w.yArrjVal),w.prevX.push(w.xArrj),w.prevXF.push(w.xArrjF),w.prevXVal.push(w.xArrjVal),C.add(c)}(i,n);return C}},{key:"initialPositions",value:function(t,e,i,n,o,a){var r,s,l=this.w;return this.isHorizontal?(r=(r=n=l.globals.gridHeight/l.globals.dataPoints)*parseInt(l.config.plotOptions.bar.barHeight,10)/100,a=this.baseLineInvertedY+l.globals.padHorizontal+(this.isReversed?l.globals.gridWidth:0)-(this.isReversed?2*this.baseLineInvertedY:0),e=(n-r)/2):(s=i=l.globals.gridWidth/l.globals.dataPoints,s=l.globals.isXNumeric&&1<l.globals.dataPoints?(i=l.globals.minXDiff/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:s*parseInt(l.config.plotOptions.bar.columnWidth,10)/100,o=this.baseLineY[this.yaxisIndex]+(this.isReversed?l.globals.gridHeight:0)-(this.isReversed?2*this.baseLineY[this.yaxisIndex]:0),t=l.globals.padHorizontal+(i-s)/2),{x:t,y:e,yDivision:n,xDivision:i,barHeight:r,barWidth:s,zeroH:o,zeroW:a}}},{key:"drawStackedBarPaths",value:function(t){for(var e,i,n=t.indexes,o=t.barHeight,a=t.strokeWidth,r=t.zeroW,s=t.x,l=t.y,c=t.yDivision,h=t.elSeries,u=this.w,d=l,f=n.i,p=n.j,g=0,v=0;v<this.prevXF.length;v++)g+=this.prevXF[v][p];e=0<f?(i=r,this.prevXVal[f-1][p]<0?i=0<=this.series[f][p]?this.prevX[f-1][p]+g-2*(this.isReversed?g:0):this.prevX[f-1][p]:0<=this.prevXVal[f-1][p]&&(i=0<=this.series[f][p]?this.prevX[f-1][p]:this.prevX[f-1][p]-g+2*(this.isReversed?g:0)),i):r,s=null===this.series[f][p]?e:e+this.series[f][p]/this.invertedYRatio-2*(this.isReversed?this.series[f][p]/this.invertedYRatio:0),this.xArrj.push(s),this.xArrjF.push(Math.abs(e-s)),this.xArrjVal.push(this.series[f][p]);var m=this.barHelpers.getBarpaths({barYPosition:d,barHeight:o,x1:e,x2:s,strokeWidth:a,series:this.series,realIndex:n.realIndex,i:f,j:p,w:u});return this.barHelpers.barBackground({j:p,i:f,y1:d,y2:o,elSeries:h}),l+=c,{pathTo:m.pathTo,pathFrom:m.pathFrom,x:s,y:l}}},{key:"drawStackedColumnPaths",value:function(t){var e=t.indexes,i=t.x,n=t.y,o=t.xDivision,a=t.barWidth,r=t.zeroH,s=(t.strokeWidth,t.elSeries),l=this.w,c=e.i,h=e.j,u=e.bc;l.globals.isXNumeric&&(i=((l.globals.seriesX[c][h]||0)-l.globals.minX)/this.xRatio-a/2);for(var d,f=i,p=0,g=0;g<this.prevYF.length;g++)p+=isNaN(this.prevYF[g][h])?0:this.prevYF[g][h];if(0<c&&!l.globals.isXNumeric||0<c&&l.globals.isXNumeric&&l.globals.seriesX[c-1][h]===l.globals.seriesX[c][h]){var v,m,b=Math.min(this.yRatio.length+1,c+1);if(void 0!==this.prevY[c-1])for(var y=1;y<b;y++)if(!isNaN(this.prevY[c-y][h])){m=this.prevY[c-y][h];break}for(var x=1;x<b;x++){if(this.prevYVal[c-x][h]<0){v=0<=this.series[c][h]?m-p+2*(this.isReversed?p:0):m;break}if(0<=this.prevYVal[c-x][h]){v=0<=this.series[c][h]?m:m+p-2*(this.isReversed?p:0);break}}void 0===v&&(v=l.globals.gridHeight),d=this.prevYF[0].every(function(t){return 0===t})&&this.prevYF.slice(1,c).every(function(t){return t.every(function(t){return isNaN(t)})})?l.globals.gridHeight-r:v}else d=l.globals.gridHeight-r;n=d-this.series[c][h]/this.yRatio[this.yaxisIndex]+2*(this.isReversed?this.series[c][h]/this.yRatio[this.yaxisIndex]:0),this.yArrj.push(n),this.yArrjF.push(Math.abs(d-n)),this.yArrjVal.push(this.series[c][h]);var w=this.barHelpers.getColumnPaths({barXPosition:f,barWidth:a,y1:d,y2:n,yRatio:this.yRatio[this.yaxisIndex],strokeWidth:this.strokeWidth,series:this.series,realIndex:e.realIndex,i:c,j:h,w:l});return this.barHelpers.barBackground({bc:u,j:h,i:c,x1:f,x2:a,elSeries:s}),i+=o,{pathTo:w.pathTo,pathFrom:w.pathFrom,x:l.globals.isXNumeric?i-o:i,y:n}}}]),e}(),Ot=function(){l(e,Y);var t=h(e);function e(){return a(this,e),t.apply(this,arguments)}return r(e,[{key:"draw",value:function(t,e){var i=this.w,n=new M(this.ctx),o=new R(this.ctx);this.candlestickOptions=this.w.config.plotOptions.candlestick;var a=new E(this.ctx,i);t=a.getLogSeries(t),this.series=t,this.yRatio=a.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);for(var r=n.group({class:"apexcharts-candlestick-series apexcharts-plot-series"}),s=0;s<t.length;s++){var l,c,h,u,d=void 0,f=void 0,p=[],g=[],v=i.globals.comboCharts?e[s]:s,m=n.group({class:"apexcharts-series",seriesName:L.escapeString(i.globals.seriesNames[v]),rel:s+1,"data:realIndex":v});0<t[s].length&&(this.visibleI=this.visibleI+1),1<this.yRatio.length&&(this.yaxisIndex=v);var b=this.barHelpers.initialPositions();f=b.y,h=b.barHeight,d=b.x,u=b.barWidth,l=b.xDivision,c=b.zeroH,g.push(d+u/2);for(var y=n.group({class:"apexcharts-datalabels","data:realIndex":v}),x=0;x<i.globals.dataPoints;x++){var w=this.barHelpers.getStrokeWidth(s,x,v),k=this.drawCandleStickPaths({indexes:{i:s,j:x,realIndex:v},x:d,y:f,xDivision:l,barWidth:u,zeroH:c,strokeWidth:w,elSeries:m}),f=k.y,d=k.x,C=k.color;0<x&&g.push(d+u/2),p.push(f);var A=o.fillPath({seriesNumber:v,dataPointIndex:x,color:C,value:t[s][x]}),S=this.candlestickOptions.wick.useFillColor?C:void 0;this.renderSeries({realIndex:v,pathFill:A,lineFill:S,j:x,i:s,pathFrom:k.pathFrom,pathTo:k.pathTo,strokeWidth:w,elSeries:m,x:d,y:f,series:t,barHeight:h,barWidth:u,elDataLabelsWrap:y,visibleSeries:this.visibleI,type:"candlestick"})}i.globals.seriesXvalues[v]=g,i.globals.seriesYvalues[v]=p,r.add(m)}return r}},{key:"drawCandleStickPaths",value:function(t){var e=t.indexes,i=t.x,n=(t.y,t.xDivision),o=t.barWidth,a=t.zeroH,r=t.strokeWidth,s=this.w,l=new M(this.ctx),c=e.i,h=e.j,u=!0,d=s.config.plotOptions.candlestick.colors.upward,f=s.config.plotOptions.candlestick.colors.downward,p=this.yRatio[this.yaxisIndex],g=e.realIndex,v=this.getOHLCValue(g,h),m=a,b=a;v.o>v.c&&(u=!1);var y=Math.min(v.o,v.c),x=Math.max(v.o,v.c);s.globals.isXNumeric&&(i=(s.globals.seriesX[g][h]-s.globals.minX)/this.xRatio-o/2);var w=i+o*this.visibleI;void 0===this.series[c][h]||null===this.series[c][h]?y=a:(y=a-y/p,x=a-x/p,m=a-v.h/p,b=a-v.l/p);var k=l.move(w,a),C=l.move(w,y);return 0<s.globals.previousPaths.length&&(C=this.getPreviousPath(g,h,!0)),k=l.move(w,x)+l.line(w+o/2,x)+l.line(w+o/2,m)+l.line(w+o/2,x)+l.line(w+o,x)+l.line(w+o,y)+l.line(w+o/2,y)+l.line(w+o/2,b)+l.line(w+o/2,y)+l.line(w,y)+l.line(w,x-r/2),C+=l.move(w,y),s.globals.isXNumeric||(i+=n),{pathTo:k,pathFrom:C,x:i,y:x,barXPosition:w,color:u?d:f}}},{key:"getOHLCValue",value:function(t,e){var i=this.w;return{o:i.globals.seriesCandleO[t][e],h:i.globals.seriesCandleH[t][e],l:i.globals.seriesCandleL[t][e],c:i.globals.seriesCandleC[t][e]}}}]),e}(),Lt=(r(Ut,[{key:"draw",value:function(t){var e=this.w,i=new M(this.ctx),n=i.group({class:"apexcharts-heatmap"});n.attr("clip-path","url(#gridRectMask".concat(e.globals.cuid,")"));var o=e.globals.gridWidth/e.globals.dataPoints,a=e.globals.gridHeight/e.globals.series.length,r=0,s=!1;this.checkColorRange();var l=t.slice();e.config.yaxis[0].reversed&&(s=!0,l.reverse());for(var c=s?0:l.length-1;s?c<l.length:0<=c;s?c++:c--){var h,u=i.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:L.escapeString(e.globals.seriesNames[c]),rel:c+1,"data:realIndex":c});this.ctx.series.addCollapsedClassToSeries(u,c),e.config.chart.dropShadow.enabled&&(h=e.config.chart.dropShadow,new N(this.ctx).dropShadow(u,h,c));for(var d=0,f=0;f<l[c].length;f++){var p=1,g=e.config.plotOptions.heatmap.shadeIntensity,v=this.determineHeatColor(c,f),p=e.globals.hasNegs||this.negRange?e.config.plotOptions.heatmap.reverseNegativeShade?v.percent<0?v.percent/100*(1.25*g):(1-v.percent/100)*(1.25*g):v.percent<=0?1-(1+v.percent/100)*g:(1-v.percent/100)*g:1-v.percent/100,m=v.color,b=new L;e.config.plotOptions.heatmap.enableShades&&(p<0&&(p=0),m="dark"===this.w.config.theme.mode?L.hexToRgba(b.shadeColor(-1*p,v.color),e.config.fill.opacity):L.hexToRgba(b.shadeColor(p,v.color),e.config.fill.opacity)),"image"===e.config.fill.type&&(m=new R(this.ctx).fillPath({seriesNumber:c,dataPointIndex:f,opacity:e.globals.hasNegs?v.percent<0?1-(1+v.percent/100):g+v.percent/100:v.percent/100,patternID:L.randomId(),width:e.config.fill.image.width?e.config.fill.image.width:o,height:e.config.fill.image.height?e.config.fill.image.height:a}));var y,x,w,k=this.rectRadius,C=i.drawRect(d,r,o,a,k);C.attr({cx:d,cy:r}),C.node.classList.add("apexcharts-heatmap-rect"),u.add(C),C.attr({fill:m,i:c,index:c,j:f,val:l[c][f],"stroke-width":this.strokeWidth,stroke:e.config.plotOptions.heatmap.useFillColorAsStroke?m:e.globals.stroke.colors[0],color:m}),C.node.addEventListener("mouseenter",i.pathMouseEnter.bind(this,C)),C.node.addEventListener("mouseleave",i.pathMouseLeave.bind(this,C)),C.node.addEventListener("mousedown",i.pathMouseDown.bind(this,C)),e.config.chart.animations.enabled&&!e.globals.dataChanged&&(y=1,e.globals.resized||(y=e.config.chart.animations.speed),this.animateHeatMap(C,d,r,o,a,y)),e.globals.dataChanged&&(x=1,this.dynamicAnim.enabled&&e.globals.shouldAnimate&&(x=this.dynamicAnim.speed,w=(w=e.globals.previousPaths[c]&&e.globals.previousPaths[c][f]&&e.globals.previousPaths[c][f].color)||"rgba(255, 255, 255, 0)",this.animateHeatColor(C,L.isColorHex(w)?w:L.rgb2hex(w),L.isColorHex(m)?m:L.rgb2hex(m),x)));var A=this.calculateHeatmapDataLabels({x:d,y:r,i:c,j:f,heatColorProps:v,series:l,rectHeight:a,rectWidth:o});null!==A&&u.add(A),d+=o}r+=a,n.add(u)}var S=e.globals.yAxisScale[0].result.slice();e.config.yaxis[0].reversed?S.unshift(""):S.push(""),e.globals.yAxisScale[0].result=S;var T=e.globals.gridHeight/e.globals.series.length;return e.config.yaxis[0].labels.offsetY=-T/2,n}},{key:"checkColorRange",value:function(){var i=this,t=this.w.config.plotOptions.heatmap;0<t.colorScale.ranges.length&&t.colorScale.ranges.map(function(t,e){t.from<=0&&(i.negRange=!0)})}},{key:"determineHeatColor",value:function(t,e){var i=this.w,n=i.globals.series[t][e],o=i.config.plotOptions.heatmap,a=o.colorScale.inverse?e:t,r=i.globals.colors[a],s=null,l=Math.min.apply(Math,C(i.globals.series[t])),c=Math.max.apply(Math,C(i.globals.series[t]));o.distributed||(l=i.globals.minY,c=i.globals.maxY),void 0!==o.colorScale.min&&(l=o.colorScale.min<i.globals.minY?o.colorScale.min:i.globals.minY,c=o.colorScale.max>i.globals.maxY?o.colorScale.max:i.globals.maxY);var h=Math.abs(c)+Math.abs(l),u=100*n/(0===h?h-1e-6:h);return 0<o.colorScale.ranges.length&&o.colorScale.ranges.map(function(t,e){var i;n>=t.from&&n<=t.to&&(r=t.color,s=t.foreColor?t.foreColor:null,l=t.from,c=t.to,i=Math.abs(c)+Math.abs(l),u=100*n/(0===i?i-1e-6:i))}),{color:r,foreColor:s,percent:u}}},{key:"calculateHeatmapDataLabels",value:function(t){var e,i,n,o,a,r=t.x,s=t.y,l=t.i,c=t.j,h=t.heatColorProps,u=(t.series,t.rectHeight),d=t.rectWidth,f=this.w,p=f.config.dataLabels,g=new M(this.ctx),v=new B(this.ctx),m=p.formatter,b=null;return p.enabled&&(b=g.group({class:"apexcharts-data-labels"}),e=p.offsetX,i=p.offsetY,n=r+d/2+e,o=s+u/2+parseFloat(p.style.fontSize)/3+i,a=m(f.globals.series[l][c],{seriesIndex:l,dataPointIndex:c,w:f}),v.plotDataLabelsText({x:n,y:o,text:a,i:l,j:c,color:h.foreColor,parent:b,dataLabelsConfig:p})),b}},{key:"animateHeatMap",value:function(t,e,i,n,o,a){var r=new I(this.ctx);r.animateRect(t,{x:e+n/2,y:i+o/2,width:0,height:0},{x:e,y:i,width:n,height:o},a,function(){r.animationCompleted(t)})}},{key:"animateHeatColor",value:function(t,e,i,n){t.attr({fill:e}).animate(n).attr({fill:i})}}]),Ut),Pt=(r(Vt,[{key:"drawYAxisTexts",value:function(t,e,i,n){var o=this.w,a=o.config.yaxis[0],r=o.globals.yLabelFormatters[0];return new M(this.ctx).drawText({x:t+a.labels.offsetX,y:e+a.labels.offsetY,text:r(n,i),textAnchor:"middle",fontSize:a.labels.style.fontSize,fontFamily:a.labels.style.fontFamily,foreColor:Array.isArray(a.labels.style.colors)?a.labels.style.colors[i]:a.labels.style.colors})}}]),Vt),Nt=(r($t,[{key:"draw",value:function(t){var e=this,i=this.w,n=new M(this.ctx);if(this.ret=n.group({class:"apexcharts-pie"}),i.globals.noData)return this.ret;for(var o=0,a=0;a<t.length;a++)o+=L.negToZero(t[a]);var r=[],s=n.group();0===o&&(o=1e-5),t.forEach(function(t){e.maxY=Math.max(e.maxY,t)}),"polarArea"===this.chartType&&this.drawPolarElements();for(var l=0;l<t.length;l++){var c=this.fullAngle*L.negToZero(t[l])/o;r.push(c),"polarArea"===this.chartType?(r[l]=this.fullAngle/t.length,this.sliceSizes.push(i.globals.radialSize*t[l]/this.maxY)):this.sliceSizes.push(i.globals.radialSize)}if(i.globals.dataChanged){for(var h,u=0,d=0;d<i.globals.previousPaths.length;d++)u+=L.negToZero(i.globals.previousPaths[d]);for(var f=0;f<i.globals.previousPaths.length;f++)h=this.fullAngle*L.negToZero(i.globals.previousPaths[f])/u,this.prevSectorAngleArr.push(h)}this.donutSize<0&&(this.donutSize=0);var p,g=i.config.plotOptions.pie.customScale,v=i.globals.gridWidth/2,m=i.globals.gridHeight/2,b=v-i.globals.gridWidth/2*g,y=m-i.globals.gridHeight/2*g;"donut"===this.chartType&&((p=n.drawCircle(this.donutSize)).attr({cx:this.centerX,cy:this.centerY,fill:i.config.plotOptions.pie.donut.background?i.config.plotOptions.pie.donut.background:"transparent"}),s.add(p));var x,w=this.drawArcs(r,t);return this.sliceLabels.forEach(function(t){w.add(t)}),s.attr({transform:"translate(".concat(b,", ").concat(y,") scale(").concat(g,")")}),s.add(w),this.ret.add(s),this.donutDataLabels.show&&(x=this.renderInnerDataLabels(this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show,translateX:b,translateY:y}),this.ret.add(x)),this.ret}},{key:"drawArcs",value:function(t,e){var i=this.w,n=new N(this.ctx),o=new M(this.ctx),a=new R(this.ctx),r=o.group({class:"apexcharts-slices"}),s=i.config.plotOptions.pie.startAngle%this.fullAngle,l=s,c=s,h=s,u=s;this.strokeWidth=i.config.stroke.show?i.config.stroke.width:0;for(var d=0;d<t.length;d++){var f=o.group({class:"apexcharts-series apexcharts-pie-series",seriesName:L.escapeString(i.globals.seriesNames[d]),rel:d+1,"data:realIndex":d});r.add(f),c=u,h=(l=h)+t[d],u=c+this.prevSectorAngleArr[d];var p,g=h<l?this.fullAngle+h-l:h-l,v=a.fillPath({seriesNumber:d,size:this.sliceSizes[d],value:e[d]}),m=this.getChangedPath(c,u),b=o.drawPath({d:m,stroke:Array.isArray(this.lineColorArr)?this.lineColorArr[d]:this.lineColorArr,strokeWidth:0,fill:v,fillOpacity:i.config.fill.opacity,classes:"apexcharts-pie-area apexcharts-".concat(this.chartType.toLowerCase(),"-slice-").concat(d)});b.attr({index:0,j:d}),i.config.chart.dropShadow.enabled&&(p=i.config.chart.dropShadow,n.dropShadow(b,p,d)),this.addListeners(b,this.donutDataLabels),M.setAttrs(b.node,{"data:angle":g,"data:startAngle":l,"data:strokeWidth":this.strokeWidth,"data:value":e[d]});var y={x:0,y:0};"pie"===this.chartType||"polarArea"===this.chartType?y=L.polarToCartesian(this.centerX,this.centerY,i.globals.radialSize/1.25+i.config.plotOptions.pie.dataLabels.offset,(l+g/2)%this.fullAngle):"donut"===this.chartType&&(y=L.polarToCartesian(this.centerX,this.centerY,(i.globals.radialSize+this.donutSize)/2+i.config.plotOptions.pie.dataLabels.offset,(l+g/2)%this.fullAngle)),f.add(b);var x,w,k,C,A,S,T,E,_=0;!this.initialAnim||i.globals.resized||i.globals.dataChanged?this.animBeginArr.push(0):(0==(_=g/this.fullAngle*i.config.chart.animations.speed)&&(_=1),this.animDur=_+this.animDur,this.animBeginArr.push(this.animDur)),this.dynamicAnim&&i.globals.dataChanged?this.animatePaths(b,{size:this.sliceSizes[d],endAngle:h,startAngle:l,prevStartAngle:c,prevEndAngle:u,animateStartingPos:!0,i:d,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:i.config.chart.animations.dynamicAnimation.speed}):this.animatePaths(b,{size:this.sliceSizes[d],endAngle:h,startAngle:l,i:d,totalItems:t.length-1,animBeginArr:this.animBeginArr,dur:_}),i.config.plotOptions.pie.expandOnClick&&"polarArea"!==this.chartType&&b.click(this.pieClicked.bind(this,d)),i.config.dataLabels.enabled&&(x=y.x,w=y.y,k=100*g/this.fullAngle+"%",0!=g&&i.config.plotOptions.pie.dataLabels.minAngleToShowLabel<t[d]&&(void 0!==(C=i.config.dataLabels.formatter)&&(k=C(i.globals.seriesPercent[d][0],{seriesIndex:d,w:i})),A=i.globals.dataLabels.style.colors[d],S=o.group({class:"apexcharts-datalabels"}),T=o.drawText({x:x,y:w,text:k,textAnchor:"middle",fontSize:i.config.dataLabels.style.fontSize,fontFamily:i.config.dataLabels.style.fontFamily,fontWeight:i.config.dataLabels.style.fontWeight,foreColor:A}),S.add(T),i.config.dataLabels.dropShadow.enabled&&(E=i.config.dataLabels.dropShadow,n.dropShadow(T,E)),T.node.classList.add("apexcharts-pie-label"),i.config.chart.animations.animate&&!1===i.globals.resized&&(T.node.classList.add("apexcharts-pie-label-delay"),T.node.style.animationDelay=i.config.chart.animations.speed/940+"s"),this.sliceLabels.push(S)))}return r}},{key:"addListeners",value:function(t,e){var i=new M(this.ctx);t.node.addEventListener("mouseenter",i.pathMouseEnter.bind(this,t)),t.node.addEventListener("mouseleave",i.pathMouseLeave.bind(this,t)),t.node.addEventListener("mouseleave",this.revertDataLabelsInner.bind(this,t.node,e)),t.node.addEventListener("mousedown",i.pathMouseDown.bind(this,t)),this.donutDataLabels.total.showAlways||(t.node.addEventListener("mouseenter",this.printDataLabelsInner.bind(this,t.node,e)),t.node.addEventListener("mousedown",this.printDataLabelsInner.bind(this,t.node,e)))}},{key:"animatePaths",value:function(t,e){var i=this.w,n=e.endAngle<e.startAngle?this.fullAngle+e.endAngle-e.startAngle:e.endAngle-e.startAngle,o=n,a=e.startAngle,r=e.startAngle;void 0!==e.prevStartAngle&&void 0!==e.prevEndAngle&&(a=e.prevEndAngle,o=e.prevEndAngle<e.prevStartAngle?this.fullAngle+e.prevEndAngle-e.prevStartAngle:e.prevEndAngle-e.prevStartAngle),e.i===i.config.series.length-1&&(n+r>this.fullAngle?e.endAngle=e.endAngle-(n+r):n+r<this.fullAngle&&(e.endAngle=e.endAngle+(this.fullAngle-(n+r)))),n===this.fullAngle&&(n=this.fullAngle-.01),this.animateArc(t,a,r,n,o,e)}},{key:"animateArc",value:function(e,i,n,o,a,r){var s,l=this,t=this.w,c=new I(this.ctx),h=r.size;(isNaN(i)||isNaN(a))&&(i=n,a=o,r.dur=0);var u=o,d=n,f=i<n?this.fullAngle+i-n:i-n;t.globals.dataChanged&&r.shouldSetPrevPaths&&r.prevEndAngle&&(s=l.getPiePath({me:l,startAngle:r.prevStartAngle,angle:r.prevEndAngle<r.prevStartAngle?this.fullAngle+r.prevEndAngle-r.prevStartAngle:r.prevEndAngle-r.prevStartAngle,size:h}),e.attr({d:s})),0!==r.dur?e.animate(r.dur,t.globals.easing,r.animBeginArr[r.i]).afterAll(function(){"pie"!==l.chartType&&"donut"!==l.chartType&&"polarArea"!==l.chartType||this.animate(t.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":l.strokeWidth}),r.i===t.config.series.length-1&&c.animationCompleted(e)}).during(function(t){u=f+(o-f)*t,r.animateStartingPos&&(u=a+(o-a)*t,d=i-a+(n-(i-a))*t),s=l.getPiePath({me:l,startAngle:d,angle:u,size:h}),e.node.setAttribute("data:pathOrig",s),e.attr({d:s})}):(s=l.getPiePath({me:l,startAngle:d,angle:o,size:h}),r.isTrack||(t.globals.animationEnded=!0),e.node.setAttribute("data:pathOrig",s),e.attr({d:s,"stroke-width":l.strokeWidth}))}},{key:"pieClicked",value:function(t){var e,i,n,o,a,r=this.w,s=this.sliceSizes[t]+(r.config.plotOptions.pie.expandOnClick?4:0),l=r.globals.dom.Paper.select(".apexcharts-".concat(this.chartType.toLowerCase(),"-slice-").concat(t)).members[0];"true"!==l.attr("data:pieClicked")?(e=r.globals.dom.baseEl.getElementsByClassName("apexcharts-pie-area"),Array.prototype.forEach.call(e,function(t){t.setAttribute("data:pieClicked","false");var e=t.getAttribute("data:pathOrig");t.setAttribute("d",e)}),l.attr("data:pieClicked","true"),i=parseInt(l.attr("data:startAngle"),10),n=parseInt(l.attr("data:angle"),10),o=this.getPiePath({me:this,startAngle:i,angle:n,size:s}),360!==n&&l.plot(o)):(l.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner(l.node,this.donutDataLabels),a=l.attr("data:pathOrig"),l.attr({d:a}))}},{key:"getChangedPath",value:function(t,e){var i="";return this.dynamicAnim&&this.w.globals.dataChanged&&(i=this.getPiePath({me:this,startAngle:t,angle:e-t,size:this.size})),i}},{key:"getPiePath",value:function(t){var e=t.me,i=t.startAngle,n=t.angle,o=t.size,a=i,r=Math.PI*(a-90)/180,s=n+i;Math.ceil(s)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(s=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01),Math.ceil(s)>this.fullAngle&&(s-=this.fullAngle);var l=Math.PI*(s-90)/180,c=e.centerX+o*Math.cos(r),h=e.centerY+o*Math.sin(r),u=e.centerX+o*Math.cos(l),d=e.centerY+o*Math.sin(l),f=L.polarToCartesian(e.centerX,e.centerY,e.donutSize,s),p=L.polarToCartesian(e.centerX,e.centerY,e.donutSize,a),g=180<n?1:0,v=["M",c,h,"A",o,o,0,g,1,u,d];return"donut"===e.chartType?[].concat(v,["L",f.x,f.y,"A",e.donutSize,e.donutSize,0,g,0,p.x,p.y,"L",c,h,"z"]).join(" "):"pie"===e.chartType||"polarArea"===e.chartType?[].concat(v,["L",e.centerX,e.centerY,"L",c,h]).join(" "):[].concat(v).join(" ")}},{key:"drawPolarElements",value:function(){var t=this.w,e=new it(this.ctx),i=new M(this.ctx),n=new Pt(this.ctx),o=i.group(),a=i.group(),r=void 0===t.config.yaxis[0].max&&void 0===t.config.yaxis[0].min,s=e.niceScale(0,Math.ceil(this.maxY),t.config.yaxis[0].tickAmount,0,r),l=s.result.reverse(),c=s.result.length;this.maxY=s.niceMax;for(var h=t.globals.radialSize,u=h/(c-1),d=0;d<c-1;d++){var f,p=i.drawCircle(h);p.attr({cx:this.centerX,cy:this.centerY,fill:"none","stroke-width":t.config.plotOptions.polarArea.rings.strokeWidth,stroke:t.config.plotOptions.polarArea.rings.strokeColor}),t.config.yaxis[0].show&&(f=n.drawYAxisTexts(this.centerX,this.centerY-h+parseInt(t.config.yaxis[0].labels.style.fontSize,10)/2,d,l[d]),a.add(f)),o.add(p),h-=u}this.ret.add(o),this.ret.add(a)}},{key:"renderInnerDataLabels",value:function(t,e){var i=this.w,n=new M(this.ctx),o=n.group({class:"apexcharts-datalabels-group",transform:"translate(".concat(e.translateX?e.translateX:0,", ").concat(e.translateY?e.translateY:0,") scale(").concat(i.config.plotOptions.pie.customScale,")")}),a=t.total.show;o.node.style.opacity=e.opacity;var r,s,l,c=e.centerX,h=e.centerY,u=void 0===t.name.color?i.globals.colors[0]:t.name.color,d=t.name.fontSize,f=t.name.fontFamily,p=t.value.fontWeight,g=void 0===t.value.color?i.config.chart.foreColor:t.value.color,v=t.value.formatter,m="",b="";return a?(u=t.total.color,d=t.total.fontSize,f=t.total.fontFamily,p=t.total.fontWeight,b=t.total.label,m=t.total.formatter(i)):1===i.globals.series.length&&(m=v(i.globals.series[0],i),b=i.globals.seriesNames[0]),b=b&&t.name.formatter(b,t.total.show,i),t.name.show&&((r=n.drawText({x:c,y:h+parseFloat(t.name.offsetY),text:b,textAnchor:"middle",foreColor:u,fontSize:d,fontWeight:p,fontFamily:f})).node.classList.add("apexcharts-datalabel-label"),o.add(r)),t.value.show&&(s=t.name.show?parseFloat(t.value.offsetY)+16:t.value.offsetY,(l=n.drawText({x:c,y:h+s,text:m,textAnchor:"middle",foreColor:g,fontWeight:t.value.fontWeight,fontSize:t.value.fontSize,fontFamily:t.value.fontFamily})).node.classList.add("apexcharts-datalabel-value"),o.add(l)),o}},{key:"printInnerLabels",value:function(t,e,i,n){var o,a=this.w;n?o=void 0===t.name.color?a.globals.colors[parseInt(n.parentNode.getAttribute("rel"),10)-1]:t.name.color:1<a.globals.series.length&&t.total.show&&(o=t.total.color);var r=a.globals.dom.baseEl.querySelector(".apexcharts-datalabel-label"),s=a.globals.dom.baseEl.querySelector(".apexcharts-datalabel-value");i=(0,t.value.formatter)(i,a),n||"function"!=typeof t.total.formatter||(i=t.total.formatter(a));var l=e===t.total.label;e=t.name.formatter(e,l,a),null!==r&&(r.textContent=e),null!==s&&(s.textContent=i),null!==r&&(r.style.fill=o)}},{key:"printDataLabelsInner",value:function(t,e){var i=this.w,n=t.getAttribute("data:value"),o=i.globals.seriesNames[parseInt(t.parentNode.getAttribute("rel"),10)-1];1<i.globals.series.length&&this.printInnerLabels(e,o,n,t);var a=i.globals.dom.baseEl.querySelector(".apexcharts-datalabels-group");null!==a&&(a.style.opacity=1)}},{key:"revertDataLabelsInner",value:function(t,n){function e(t){var e=t.makeSliceOut,i=t.printLabel;Array.prototype.forEach.call(c,function(t){"true"===t.getAttribute("data:pieClicked")&&(e&&(l=!0),i&&a.printDataLabelsInner(t,n))})}var i,o,a=this,r=this.w,s=r.globals.dom.baseEl.querySelector(".apexcharts-datalabels-group"),l=!1,c=r.globals.dom.baseEl.getElementsByClassName("apexcharts-pie-area");e({makeSliceOut:!0,printLabel:!1}),n.total.show&&1<r.globals.series.length?l&&!n.total.showAlways?e({makeSliceOut:!1,printLabel:!0}):this.printInnerLabels(n,n.total.label,n.total.formatter(r)):(e({makeSliceOut:!1,printLabel:!0}),l||(r.globals.selectedDataPoints.length&&1<r.globals.series.length?0<r.globals.selectedDataPoints[0].length?(i=r.globals.selectedDataPoints[0],o=r.globals.dom.baseEl.querySelector(".apexcharts-".concat(this.chartType.toLowerCase(),"-slice-").concat(i)),this.printDataLabelsInner(o,n)):s&&r.globals.selectedDataPoints.length&&0===r.globals.selectedDataPoints[0].length&&(s.style.opacity=0):s&&1<r.globals.series.length&&(s.style.opacity=0)))}}]),$t),It=(r(Wt,[{key:"draw",value:function(t){var f=this,p=this.w,g=new R(this.ctx),v=[],m=new B(this.ctx);t.length&&(this.dataPointsLen=t[p.globals.maxValsInArrayIndex].length),this.disAngle=2*Math.PI/this.dataPointsLen;var e,i=p.globals.gridWidth/2,n=p.globals.gridHeight/2,o=i+p.config.plotOptions.radar.offsetX,a=n+p.config.plotOptions.radar.offsetY,r=this.graphics.group({class:"apexcharts-radar-series apexcharts-plot-series",transform:"translate(".concat(o||0,", ").concat(a||0,")")}),b=[],y=null,x=null;return this.yaxisLabels=this.graphics.group({class:"apexcharts-yaxis"}),t.forEach(function(t,s){var e=t.length===p.globals.dataPoints,l=f.graphics.group().attr({class:"apexcharts-series","data:longestSeries":e,seriesName:L.escapeString(p.globals.seriesNames[s]),rel:s+1,"data:realIndex":s});f.dataRadiusOfPercent[s]=[],f.dataRadius[s]=[],f.angleArr[s]=[],t.forEach(function(t,e){var i=Math.abs(f.maxValue-f.minValue);t+=Math.abs(f.minValue),f.dataRadiusOfPercent[s][e]=t/i,f.dataRadius[s][e]=f.dataRadiusOfPercent[s][e]*f.size,f.angleArr[s][e]=e*f.disAngle}),b=f.getDataPointsPos(f.dataRadius[s],f.angleArr[s]);var i=f.createPaths(b,{x:0,y:0});y=f.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),x=f.graphics.group({class:"apexcharts-datalabels","data:realIndex":s}),p.globals.delayedElements.push({el:y.node,index:s});var n={i:s,realIndex:s,animationDelay:s,initialSpeed:p.config.chart.animations.speed,dataChangeSpeed:p.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-radar",shouldClipToGrid:!1,bindEventsOnPaths:!1,stroke:p.globals.stroke.colors[s],strokeLineCap:p.config.stroke.lineCap},o=null;0<p.globals.previousPaths.length&&(o=f.getPreviousPath(s));for(var a=0;a<i.linePathsTo.length;a++){var r=f.graphics.renderPaths(P(P({},n),{},{pathFrom:null===o?i.linePathsFrom[a]:o,pathTo:i.linePathsTo[a],strokeWidth:Array.isArray(f.strokeWidth)?f.strokeWidth[s]:f.strokeWidth,fill:"none",drawShadow:!1}));l.add(r);var c,h,u=g.fillPath({seriesNumber:s}),d=f.graphics.renderPaths(P(P({},n),{},{pathFrom:null===o?i.areaPathsFrom[a]:o,pathTo:i.areaPathsTo[a],strokeWidth:0,fill:u,drawShadow:!1}));p.config.chart.dropShadow.enabled&&(c=new N(f.ctx),h=p.config.chart.dropShadow,c.dropShadow(d,Object.assign({},h,{noUserSpaceOnUse:!0}),s)),l.add(d)}t.forEach(function(t,e){var i=new z(f.ctx).getMarkerConfig("apexcharts-marker",s,e),n=f.graphics.drawMarker(b[e].x,b[e].y,i);n.attr("rel",e),n.attr("j",e),n.attr("index",s),n.node.setAttribute("default-marker-size",i.pSize);var o=f.graphics.group({class:"apexcharts-series-markers"});o&&o.add(n),y.add(o),l.add(y);var a,r=p.config.dataLabels;r.enabled&&(a=r.formatter(p.globals.series[s][e],{seriesIndex:s,dataPointIndex:e,w:p}),m.plotDataLabelsText({x:b[e].x,y:b[e].y,text:a,textAnchor:"middle",i:s,j:s,parent:x,offsetCorrection:!1,dataLabelsConfig:P({},r)})),l.add(x)}),v.push(l)}),this.drawPolygons({parent:r}),p.config.xaxis.labels.show&&(e=this.drawXAxisTexts(),r.add(e)),r.add(this.yaxisLabels),v.forEach(function(t){r.add(t)}),r}},{key:"drawPolygons",value:function(t){for(var a=this,r=this.w,s=t.parent,n=new Pt(this.ctx),o=r.globals.yAxisScale[0].result.reverse(),e=o.length,i=[],l=this.size/(e-1),c=0;c<e;c++)i[c]=l*c;i.reverse();var h=[],u=[];i.forEach(function(t,n){var e=a.getPolygonPos(t),o="";e.forEach(function(t,e){var i;0===n&&(i=a.graphics.drawLine(t.x,t.y,0,0,Array.isArray(a.polygons.connectorColors)?a.polygons.connectorColors[e]:a.polygons.connectorColors),u.push(i)),0===e&&a.yaxisLabelsTextsPos.push({x:t.x,y:t.y}),o+=t.x+","+t.y+" "}),h.push(o)}),h.forEach(function(t,e){var i=a.polygons.strokeColors,n=a.polygons.strokeWidth,o=a.graphics.drawPolygon(t,Array.isArray(i)?i[e]:i,Array.isArray(n)?n[e]:n,r.globals.radarPolygons.fill.colors[e]);s.add(o)}),u.forEach(function(t){s.add(t)}),r.config.yaxis[0].show&&this.yaxisLabelsTextsPos.forEach(function(t,e){var i=n.drawYAxisTexts(t.x,t.y,e,o[e]);a.yaxisLabels.add(i)})}},{key:"drawXAxisTexts",value:function(){var r=this,s=this.w,l=s.config.xaxis.labels,c=this.graphics.group({class:"apexcharts-xaxis"}),h=this.getPolygonPos(this.size);return s.globals.labels.forEach(function(t,e){var i,n,o=s.config.xaxis.labels.formatter,a=new B(r.ctx);h[e]&&(i=r.getTextPos(h[e],r.size),n=o(t,{seriesIndex:-1,dataPointIndex:e,w:s}),a.plotDataLabelsText({x:i.newX,y:i.newY,text:n,textAnchor:i.textAnchor,i:e,j:e,parent:c,color:l.style.colors[e]?l.style.colors[e]:"#a8a8a8",dataLabelsConfig:P({textAnchor:i.textAnchor,dropShadow:{enabled:!1}},l),offsetCorrection:!1}))}),c}},{key:"createPaths",value:function(i,t){var n,o,a=this,e=[],r=[],s=[],l=[];return i.length&&(r=[this.graphics.move(t.x,t.y)],l=[this.graphics.move(t.x,t.y)],n=this.graphics.move(i[0].x,i[0].y),o=this.graphics.move(i[0].x,i[0].y),i.forEach(function(t,e){n+=a.graphics.line(t.x,t.y),o+=a.graphics.line(t.x,t.y),e===i.length-1&&(n+="Z",o+="Z")}),e.push(n),s.push(o)),{linePathsFrom:r,linePathsTo:e,areaPathsFrom:l,areaPathsTo:s}}},{key:"getTextPos",value:function(t,e){var i="middle",n=t.x,o=t.y;return 10<=Math.abs(t.x)?0<t.x?(i="start",n+=10):t.x<0&&(i="end",n-=10):i="middle",Math.abs(t.y)>=e-10&&(t.y<0?o-=10:0<t.y&&(o+=10)),{textAnchor:i,newX:n,newY:o}}},{key:"getPreviousPath",value:function(t){for(var e=this.w,i=null,n=0;n<e.globals.previousPaths.length;n++){var o=e.globals.previousPaths[n];0<o.paths.length&&parseInt(o.realIndex,10)===parseInt(t,10)&&void 0!==e.globals.previousPaths[n].paths[0]&&(i=e.globals.previousPaths[n].paths[0].d)}return i}},{key:"getDataPointsPos",value:function(t,e,i){var n=2<arguments.length&&void 0!==i?i:this.dataPointsLen;t=t||[],e=e||[];for(var o=[],a=0;a<n;a++){var r={};r.x=t[a]*Math.sin(e[a]),r.y=-t[a]*Math.cos(e[a]),o.push(r)}return o}},{key:"getPolygonPos",value:function(t){for(var e=[],i=2*Math.PI/this.dataPointsLen,n=0;n<this.dataPointsLen;n++){var o={};o.x=t*Math.sin(n*i),o.y=-t*Math.cos(n*i),e.push(o)}return e}}]),Wt),Mt=function(){l(o,Nt);var n=h(o);function o(t){var e;a(this,o),(e=n.call(this,t)).ctx=t,e.w=t.w,e.animBeginArr=[0],e.animDur=0;var i=e.w;return e.startAngle=i.config.plotOptions.radialBar.startAngle,e.endAngle=i.config.plotOptions.radialBar.endAngle,e.totalAngle=Math.abs(i.config.plotOptions.radialBar.endAngle-i.config.plotOptions.radialBar.startAngle),e.trackStartAngle=i.config.plotOptions.radialBar.track.startAngle,e.trackEndAngle=i.config.plotOptions.radialBar.track.endAngle,e.radialDataLabels=i.config.plotOptions.radialBar.dataLabels,e.trackStartAngle||(e.trackStartAngle=e.startAngle),e.trackEndAngle||(e.trackEndAngle=e.endAngle),360===e.endAngle&&(e.endAngle=359.99),e.margin=parseInt(i.config.plotOptions.radialBar.track.margin,10),e}return r(o,[{key:"draw",value:function(t){var e=this.w,i=new M(this.ctx),n=i.group({class:"apexcharts-radialbar"});if(e.globals.noData)return n;var o=i.group(),a=this.defaultSize/2,r=e.globals.gridWidth/2,s=this.defaultSize/2.05;e.config.chart.sparkline.enabled||(s=s-e.config.stroke.width-e.config.chart.dropShadow.blur);var l,c=e.globals.fill.colors;e.config.plotOptions.radialBar.track.show&&(l=this.drawTracks({size:s,centerX:r,centerY:a,colorArr:c,series:t}),o.add(l));var h=this.drawArcs({size:s,centerX:r,centerY:a,colorArr:c,series:t}),u=360;e.config.plotOptions.radialBar.startAngle<0&&(u=this.totalAngle);var d,f=(360-u)/360;return e.globals.radialSize=s-s*f,this.radialDataLabels.value.show&&(d=Math.max(this.radialDataLabels.value.offsetY,this.radialDataLabels.name.offsetY),e.globals.radialSize+=d*f),o.add(h.g),"front"===e.config.plotOptions.radialBar.hollow.position&&(h.g.add(h.elHollow),h.dataLabels&&h.g.add(h.dataLabels)),n.add(o),n}},{key:"drawTracks",value:function(t){var e=this.w,i=new M(this.ctx),n=i.group({class:"apexcharts-tracks"}),o=new N(this.ctx),a=new R(this.ctx),r=this.getStrokeWidth(t);t.size=t.size-r/2;for(var s=0;s<t.series.length;s++){var l=i.group({class:"apexcharts-radialbar-track apexcharts-track"});n.add(l),l.attr({rel:s+1}),t.size=t.size-r-this.margin;var c=e.config.plotOptions.radialBar.track,h=a.fillPath({seriesNumber:0,size:t.size,fillColors:Array.isArray(c.background)?c.background[s]:c.background,solid:!0}),u=this.trackStartAngle,d=this.trackEndAngle;360<=Math.abs(d)+Math.abs(u)&&(d=360-Math.abs(this.startAngle)-.1);var f,p=i.drawPath({d:"",stroke:h,strokeWidth:r*parseInt(c.strokeWidth,10)/100,fill:"none",strokeOpacity:c.opacity,classes:"apexcharts-radialbar-area"});c.dropShadow.enabled&&(f=c.dropShadow,o.dropShadow(p,f)),l.add(p),p.attr("id","apexcharts-radialbarTrack-"+s),this.animatePaths(p,{centerX:t.centerX,centerY:t.centerY,endAngle:d,startAngle:u,size:t.size,i:s,totalItems:2,animBeginArr:0,dur:0,isTrack:!0,easing:e.globals.easing})}return n}},{key:"drawArcs",value:function(t){var e=this.w,i=new M(this.ctx),n=new R(this.ctx),o=new N(this.ctx),a=i.group(),r=this.getStrokeWidth(t);t.size=t.size-r/2;var s=e.config.plotOptions.radialBar.hollow.background,l=t.size-r*t.series.length-this.margin*t.series.length-r*parseInt(e.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,c=l-e.config.plotOptions.radialBar.hollow.margin;void 0!==e.config.plotOptions.radialBar.hollow.image&&(s=this.drawHollowImage(t,a,l,s));var h,u=this.drawHollow({size:c,centerX:t.centerX,centerY:t.centerY,fill:s||"transparent"});e.config.plotOptions.radialBar.hollow.dropShadow.enabled&&(h=e.config.plotOptions.radialBar.hollow.dropShadow,o.dropShadow(u,h));var d=1;!this.radialDataLabels.total.show&&1<e.globals.series.length&&(d=0);var f=null;this.radialDataLabels.show&&(f=this.renderInnerDataLabels(this.radialDataLabels,{hollowSize:l,centerX:t.centerX,centerY:t.centerY,opacity:d})),"back"===e.config.plotOptions.radialBar.hollow.position&&(a.add(u),f&&a.add(f));var p=!1;e.config.plotOptions.radialBar.inverseOrder&&(p=!0);for(var g=p?t.series.length-1:0;p?0<=g:g<t.series.length;p?g--:g++){var v=i.group({class:"apexcharts-series apexcharts-radial-series",seriesName:L.escapeString(e.globals.seriesNames[g])});a.add(v),v.attr({rel:g+1,"data:realIndex":g}),this.ctx.series.addCollapsedClassToSeries(v,g),t.size=t.size-r-this.margin;var m=n.fillPath({seriesNumber:g,size:t.size,value:t.series[g]}),b=this.startAngle,y=void 0,x=L.negToZero(100<t.series[g]?100:t.series[g])/100,w=Math.round(this.totalAngle*x)+this.startAngle,k=void 0;e.globals.dataChanged&&(y=this.startAngle,k=Math.round(this.totalAngle*L.negToZero(e.globals.previousPaths[g])/100)+y),360<=Math.abs(w)+Math.abs(b)&&(w-=.01),360<=Math.abs(k)+Math.abs(y)&&(k-=.01);var C,A=w-b,S=Array.isArray(e.config.stroke.dashArray)?e.config.stroke.dashArray[g]:e.config.stroke.dashArray,T=i.drawPath({d:"",stroke:m,strokeWidth:r,fill:"none",fillOpacity:e.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+g,strokeDashArray:S});M.setAttrs(T.node,{"data:angle":A,"data:value":t.series[g]}),e.config.chart.dropShadow.enabled&&(C=e.config.chart.dropShadow,o.dropShadow(T,C,g)),this.addListeners(T,this.radialDataLabels),v.add(T),T.attr({index:0,j:g});var E=0;!this.initialAnim||e.globals.resized||e.globals.dataChanged||(E=(w-b)/360*e.config.chart.animations.speed,this.animDur=E/(1.2*t.series.length)+this.animDur,this.animBeginArr.push(this.animDur)),e.globals.dataChanged&&(E=(w-b)/360*e.config.chart.animations.dynamicAnimation.speed,this.animDur=E/(1.2*t.series.length)+this.animDur,this.animBeginArr.push(this.animDur)),this.animatePaths(T,{centerX:t.centerX,centerY:t.centerY,endAngle:w,startAngle:b,prevEndAngle:k,prevStartAngle:y,size:t.size,i:g,totalItems:2,animBeginArr:this.animBeginArr,dur:E,shouldSetPrevPaths:!0,easing:e.globals.easing})}return{g:a,elHollow:u,dataLabels:f}}},{key:"drawHollow",value:function(t){var e=new M(this.ctx).drawCircle(2*t.size);return e.attr({class:"apexcharts-radialbar-hollow",cx:t.centerX,cy:t.centerY,r:t.size,fill:t.fill}),e}},{key:"drawHollowImage",value:function(e,t,i,n){var o,a,r,s,l=this.w,c=new R(this.ctx),h=L.randomId(),u=l.config.plotOptions.radialBar.hollow.image;return l.config.plotOptions.radialBar.hollow.imageClipped?(c.clippedImgArea({width:i,height:i,image:u,patternID:"pattern".concat(l.globals.cuid).concat(h)}),n="url(#pattern".concat(l.globals.cuid).concat(h,")")):(o=l.config.plotOptions.radialBar.hollow.imageWidth,a=l.config.plotOptions.radialBar.hollow.imageHeight,void 0===o&&void 0===a?(r=l.globals.dom.Paper.image(u).loaded(function(t){this.move(e.centerX-t.width/2+l.config.plotOptions.radialBar.hollow.imageOffsetX,e.centerY-t.height/2+l.config.plotOptions.radialBar.hollow.imageOffsetY)}),t.add(r)):(s=l.globals.dom.Paper.image(u).loaded(function(t){this.move(e.centerX-o/2+l.config.plotOptions.radialBar.hollow.imageOffsetX,e.centerY-a/2+l.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(o,a)}),t.add(s))),n}},{key:"getStrokeWidth",value:function(t){var e=this.w;return t.size*(100-parseInt(e.config.plotOptions.radialBar.hollow.size,10))/100/(t.series.length+1)-this.margin}}]),o}(),Dt=(r(qt,[{key:"sameValueSeriesFix",value:function(t,e){var i,n=this.w;return"line"!==n.config.chart.type||"gradient"!==n.config.fill.type&&"gradient"!==n.config.fill.type[t]||!new E(this.lineCtx.ctx,n).seriesHaveSameValues(t)||((i=e[t].slice())[i.length-1]=i[i.length-1]+1e-6,e[t]=i),e}},{key:"calculatePoints",value:function(t){var e,i=t.series,n=t.realIndex,o=t.x,a=t.y,r=t.i,s=t.j,l=t.prevY,c=this.w,h=[],u=[];return 0===s&&(e=this.lineCtx.categoryAxisCorrection+c.config.markers.offsetX,c.globals.isXNumeric&&(e=(c.globals.seriesX[n][0]-c.globals.minX)/this.lineCtx.xRatio+c.config.markers.offsetX),h.push(e),u.push(L.isNumber(i[r][0])?l+c.config.markers.offsetY:null)),h.push(o+c.config.markers.offsetX),u.push(L.isNumber(i[r][s+1])?a+c.config.markers.offsetY:null),{x:h,y:u}}},{key:"checkPreviousPaths",value:function(t){for(var e=t.pathFromLine,i=t.pathFromArea,n=t.realIndex,o=this.w,a=0;a<o.globals.previousPaths.length;a++){var r=o.globals.previousPaths[a];("line"===r.type||"area"===r.type)&&0<r.paths.length&&parseInt(r.realIndex,10)===parseInt(n,10)&&("line"===r.type?(this.lineCtx.appendPathFrom=!1,e=o.globals.previousPaths[a].paths[0].d):"area"===r.type&&(this.lineCtx.appendPathFrom=!1,i=o.globals.previousPaths[a].paths[0].d,o.config.stroke.show&&o.globals.previousPaths[a].paths[1]&&(e=o.globals.previousPaths[a].paths[1].d)))}return{pathFromLine:e,pathFromArea:i}}},{key:"determineFirstPrevY",value:function(t){var e=t.i,i=t.series,n=t.prevY,o=t.lineYPosition,a=this.w;if(void 0!==i[e][0])n=(o=a.config.chart.stacked&&0<e?this.lineCtx.prevSeriesY[e-1][0]:this.lineCtx.zeroY)-i[e][0]/this.lineCtx.yRatio[this.lineCtx.yaxisIndex]+2*(this.lineCtx.isReversed?i[e][0]/this.lineCtx.yRatio[this.lineCtx.yaxisIndex]:0);else if(a.config.chart.stacked&&0<e&&void 0===i[e][0])for(var r=e-1;0<=r;r--)if(null!==i[r][0]&&void 0!==i[r][0]){n=o=this.lineCtx.prevSeriesY[r][0];break}return{prevY:n,lineYPosition:o}}}]),qt),Rt=(r(Yt,[{key:"draw",value:function(t,e,i){var n=this.w,o=new M(this.ctx),a=n.globals.comboCharts?e:n.config.chart.type,r=o.group({class:"apexcharts-".concat(a,"-series apexcharts-plot-series")}),s=new E(this.ctx,n);this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,t=s.getLogSeries(t),this.yRatio=s.getLogYRatios(this.yRatio);for(var l=[],c=0;c<t.length;c++){t=this.lineHelpers.sameValueSeriesFix(c,t);var h=n.globals.comboCharts?i[c]:c;this._initSerieVariables(t,c,h);var u=[],d=[],f=n.globals.padHorizontal+this.categoryAxisCorrection;this.ctx.series.addCollapsedClassToSeries(this.elSeries,h),n.globals.isXNumeric&&0<n.globals.seriesX.length&&(f=(n.globals.seriesX[h][0]-n.globals.minX)/this.xRatio),d.push(f);var p,g=f,v=g,m=this.zeroY,m=this.lineHelpers.determineFirstPrevY({i:c,series:t,prevY:m,lineYPosition:0}).prevY;u.push(m),p=m;var b=this._calculatePathsFrom({series:t,i:c,realIndex:h,prevX:v,prevY:m}),y=this._iterateOverDataPoints({series:t,realIndex:h,i:c,x:f,y:1,pX:g,pY:p,pathsFrom:b,linePaths:[],areaPaths:[],seriesIndex:i,lineYPosition:0,xArrj:d,yArrj:u});this._handlePaths({type:a,realIndex:h,i:c,paths:y}),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),l.push(this.elSeries)}if(n.config.chart.stacked)for(var x=l.length;0<x;x--)r.add(l[x-1]);else for(var w=0;w<l.length;w++)r.add(l[w]);return r}},{key:"_initSerieVariables",value:function(t,e,i){var n=this.w,o=new M(this.ctx);this.xDivision=n.globals.gridWidth/(n.globals.dataPoints-("on"===n.config.xaxis.tickPlacement?1:0)),this.strokeWidth=Array.isArray(n.config.stroke.width)?n.config.stroke.width[i]:n.config.stroke.width,1<this.yRatio.length&&(this.yaxisIndex=i),this.isReversed=n.config.yaxis[this.yaxisIndex]&&n.config.yaxis[this.yaxisIndex].reversed,this.zeroY=n.globals.gridHeight-this.baseLineY[this.yaxisIndex]-(this.isReversed?n.globals.gridHeight:0)+(this.isReversed?2*this.baseLineY[this.yaxisIndex]:0),this.areaBottomY=this.zeroY,(this.zeroY>n.globals.gridHeight||"end"===n.config.plotOptions.area.fillTo)&&(this.areaBottomY=n.globals.gridHeight),this.categoryAxisCorrection=this.xDivision/2,this.elSeries=o.group({class:"apexcharts-series",seriesName:L.escapeString(n.globals.seriesNames[i])}),this.elPointsMain=o.group({class:"apexcharts-series-markers-wrap","data:realIndex":i}),this.elDataLabelsWrap=o.group({class:"apexcharts-datalabels","data:realIndex":i});var a=t[e].length===n.globals.dataPoints;this.elSeries.attr({"data:longestSeries":a,rel:e+1,"data:realIndex":i}),this.appendPathFrom=!0}},{key:"_calculatePathsFrom",value:function(t){var e,i,n,o,a,r=t.series,s=t.i,l=t.realIndex,c=t.prevX,h=t.prevY,u=this.w,d=new M(this.ctx);if(null===r[s][0]){for(var f=0;f<r[s].length;f++)if(null!==r[s][f]){c=this.xDivision*f,h=this.zeroY-r[s][f]/this.yRatio[this.yaxisIndex],e=d.move(c,h),i=d.move(c,this.areaBottomY);break}}else e=d.move(c,h),i=d.move(c,this.areaBottomY)+d.line(c,h);return o=d.move(-1,this.zeroY)+d.line(-1,this.zeroY),a=d.move(-1,this.zeroY)+d.line(-1,this.zeroY),0<u.globals.previousPaths.length&&(o=(n=this.lineHelpers.checkPreviousPaths({pathFromLine:o,pathFromArea:a,realIndex:l})).pathFromLine,a=n.pathFromArea),{prevX:c,prevY:h,linePath:e,areaPath:i,pathFromLine:o,pathFromArea:a}}},{key:"_handlePaths",value:function(t){var e=t.type,i=t.realIndex,n=t.i,o=t.paths,a=this.w,r=new M(this.ctx),s=new R(this.ctx);this.prevSeriesY.push(o.yArrj),a.globals.seriesXvalues[i]=o.xArrj,a.globals.seriesYvalues[i]=o.yArrj,this.pointsChart||a.globals.delayedElements.push({el:this.elPointsMain.node,index:i});var l={i:n,realIndex:i,animationDelay:n,initialSpeed:a.config.chart.animations.speed,dataChangeSpeed:a.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(e)};if("area"===e)for(var c=s.fillPath({seriesNumber:i}),h=0;h<o.areaPaths.length;h++){var u=r.renderPaths(P(P({},l),{},{pathFrom:o.pathFromArea,pathTo:o.areaPaths[h],stroke:"none",strokeWidth:0,strokeLineCap:null,fill:c}));this.elSeries.add(u)}if(a.config.stroke.show&&!this.pointsChart)for(var d="line"===e?s.fillPath({seriesNumber:i,i:n}):a.globals.stroke.colors[i],f=0;f<o.linePaths.length;f++){var p=r.renderPaths(P(P({},l),{},{pathFrom:o.pathFromLine,pathTo:o.linePaths[f],stroke:d,strokeWidth:this.strokeWidth,strokeLineCap:a.config.stroke.lineCap,fill:"none"}));this.elSeries.add(p)}}},{key:"_iterateOverDataPoints",value:function(t){for(var e=t.series,i=t.realIndex,n=t.i,o=t.x,a=t.y,r=t.pX,s=t.pY,l=t.pathsFrom,c=t.linePaths,h=t.areaPaths,u=t.seriesIndex,d=t.lineYPosition,f=t.xArrj,p=t.yArrj,g=this.w,v=new M(this.ctx),m=this.yRatio,b=l.prevY,y=l.linePath,x=l.areaPath,w=l.pathFromLine,k=l.pathFromArea,C=L.isNumber(g.globals.minYArr[i])?g.globals.minYArr[i]:g.globals.minY,A=1<g.globals.dataPoints?g.globals.dataPoints-1:g.globals.dataPoints,S=0;S<A;S++){var T,E=void 0===e[n][S+1]||null===e[n][S+1];g.globals.isXNumeric?(T=g.globals.seriesX[i][S+1],void 0===g.globals.seriesX[i][S+1]&&(T=g.globals.seriesX[i][A-1]),o=(T-g.globals.minX)/this.xRatio):o+=this.xDivision,d=g.config.chart.stacked&&0<n&&g.globals.collapsedSeries.length<g.config.series.length-1?this.prevSeriesY[function(t){for(var e=t,i=0;i<g.globals.series.length;i++)if(-1<g.globals.collapsedSeriesIndices.indexOf(t)){e--;break}return 0<=e?e:0}(n-1)][S+1]:this.zeroY,a=E?d-C/m[this.yaxisIndex]+2*(this.isReversed?C/m[this.yaxisIndex]:0):d-e[n][S+1]/m[this.yaxisIndex]+2*(this.isReversed?e[n][S+1]/m[this.yaxisIndex]:0),f.push(o),p.push(a);var _=this.lineHelpers.calculatePoints({series:e,x:o,y:a,realIndex:i,i:n,j:S,prevY:b}),O=this._createPaths({series:e,i:n,realIndex:i,j:S,x:o,y:a,pX:r,pY:s,linePath:y,areaPath:x,linePaths:c,areaPaths:h,seriesIndex:u}),h=O.areaPaths,c=O.linePaths,r=O.pX,s=O.pY,x=O.areaPath,y=O.linePath;this.appendPathFrom&&(w+=v.line(o,this.zeroY),k+=v.line(o,this.zeroY)),this.handleNullDataPoints(e,_,n,S,i),this._handleMarkersAndLabels({pointsPos:_,series:e,x:o,y:a,prevY:b,i:n,j:S,realIndex:i})}return{yArrj:p,xArrj:f,pathFromArea:k,areaPaths:h,pathFromLine:w,linePaths:c}}},{key:"_handleMarkersAndLabels",value:function(t){var e,i=t.pointsPos,n=(t.series,t.x,t.y,t.prevY,t.i),o=t.j,a=t.realIndex,r=this.w,s=new B(this.ctx);this.pointsChart?this.scatter.draw(this.elSeries,o,{realIndex:a,pointsPos:i,zRatio:this.zRatio,elParent:this.elPointsMain}):(1<r.globals.series[n].length&&this.elPointsMain.node.classList.add("apexcharts-element-hidden"),null!==(e=this.markers.plotChartMarkers(i,a,o+1))&&this.elPointsMain.add(e));var l=s.drawDataLabel(i,a,o+1,null);null!==l&&this.elDataLabelsWrap.add(l)}},{key:"_createPaths",value:function(t){var e,i,n=t.series,o=t.i,a=t.realIndex,r=t.j,s=t.x,l=t.y,c=t.pX,h=t.pY,u=t.linePath,d=t.areaPath,f=t.linePaths,p=t.areaPaths,g=t.seriesIndex,v=this.w,m=new M(this.ctx),b=v.config.stroke.curve,y=this.areaBottomY;return Array.isArray(v.config.stroke.curve)&&(b=Array.isArray(g)?v.config.stroke.curve[g[o]]:v.config.stroke.curve[o]),"smooth"===b?(e=.35*(s-c),v.globals.hasNullValues?(null!==n[o][r]&&(d=null!==n[o][r+1]?(u=m.move(c,h)+m.curve(c+e,h,s-e,l,s+1,l),m.move(c+1,h)+m.curve(c+e,h,s-e,l,s+1,l)+m.line(s,y)+m.line(c,y)+"z"):(u=m.move(c,h),m.move(c,h)+"z")),f.push(u),p.push(d)):(u+=m.curve(c+e,h,s-e,l,s,l),d+=m.curve(c+e,h,s-e,l,s,l)),c=s,h=l,r===n[o].length-2&&(d=d+m.curve(c,h,s,l,s,y)+m.move(s,l)+"z",v.globals.hasNullValues||(f.push(u),p.push(d)))):(null===n[o][r+1]&&(u+=m.move(s,l),i=v.globals.isXNumeric?(v.globals.seriesX[a][r]-v.globals.minX)/this.xRatio:s-this.xDivision,d=d+m.line(i,y)+m.move(s,l)+"z"),null===n[o][r]&&(u+=m.move(s,l),d+=m.move(s,y)),"stepline"===b?(u=u+m.line(s,null,"H")+m.line(null,l,"V"),d=d+m.line(s,null,"H")+m.line(null,l,"V")):"straight"===b&&(u+=m.line(s,l),d+=m.line(s,l)),r===n[o].length-2&&(d=d+m.line(s,y)+m.move(s,l)+"z",f.push(u),p.push(d))),{linePaths:f,areaPaths:p,pX:c,pY:h,linePath:u,areaPath:d}}},{key:"handleNullDataPoints",value:function(t,e,i,n,o){var a,r=this.w;!(null===t[i][n]&&r.config.markers.showNullDataPoints||1===t[i].length)||null!==(a=this.markers.plotChartMarkers(e,o,n+1,this.strokeWidth-r.config.markers.strokeWidth/2,!0))&&this.elPointsMain.add(a)}}]),Yt),zt=(r(Xt,[{key:"calculateTimeScaleTicks",value:function(t,e){var r=this,s=this.w;if(s.globals.allSeriesCollapsed)return s.globals.labels=[],s.globals.timescaleLabels=[],[];var i=new q(this.ctx),n=(e-t)/864e5;this.determineInterval(n),s.globals.disableZoomIn=!1,s.globals.disableZoomOut=!1,n<.005?s.globals.disableZoomIn=!0:5e4<n&&(s.globals.disableZoomOut=!0);var o=i.getTimeUnitsfromTimestamp(t,e,this.utc),a=s.globals.gridWidth/n,l=a/24,c=l/60,h=Math.floor(24*n),u=Math.floor(24*n*60),d=Math.floor(n),f=Math.floor(n/30),p=Math.floor(n/365),g={minMinute:o.minMinute,minHour:o.minHour,minDate:o.minDate,minMonth:o.minMonth,minYear:o.minYear},v={firstVal:g,currentMinute:g.minMinute,currentHour:g.minHour,currentMonthDate:g.minDate,currentDate:g.minDate,currentMonth:g.minMonth,currentYear:g.minYear,daysWidthOnXAxis:a,hoursWidthOnXAxis:l,minutesWidthOnXAxis:c,numberOfMinutes:u,numberOfHours:h,numberOfDays:d,numberOfMonths:f,numberOfYears:p};switch(this.tickInterval){case"years":this.generateYearScale(v);break;case"months":case"half_year":this.generateMonthScale(v);break;case"months_days":case"months_fortnight":case"days":case"week_days":this.generateDayScale(v);break;case"hours":this.generateHourScale(v);break;case"minutes":this.generateMinuteScale(v)}var m=this.timeScaleArray.map(function(t){var e={position:t.position,unit:t.unit,year:t.year,day:t.day?t.day:1,hour:t.hour?t.hour:0,month:t.month+1};return"month"===t.unit?P(P({},e),{},{day:1,value:t.value+1}):"day"===t.unit||"hour"===t.unit?P(P({},e),{},{value:t.value}):"minute"===t.unit?P(P({},e),{},{value:t.value,minute:t.value}):t});return m.filter(function(t){var e=1,i=Math.ceil(s.globals.gridWidth/120),n=t.value;void 0!==s.config.xaxis.tickAmount&&(i=s.config.xaxis.tickAmount),m.length>i&&(e=Math.floor(m.length/i));var o=!1,a=!1;switch(r.tickInterval){case"years":"year"===t.unit&&(o=!0);break;case"half_year":e=7,"year"===t.unit&&(o=!0);break;case"months":e=1,"year"===t.unit&&(o=!0);break;case"months_fortnight":e=15,"year"!==t.unit&&"month"!==t.unit||(o=!0),30===n&&(a=!0);break;case"months_days":e=10,"month"===t.unit&&(o=!0),30===n&&(a=!0);break;case"week_days":e=8,"month"===t.unit&&(o=!0);break;case"days":e=1,"month"===t.unit&&(o=!0);break;case"hours":"day"===t.unit&&(o=!0);break;case"minutes":n%5!=0&&(a=!0)}if("minutes"===r.tickInterval||"hours"===r.tickInterval){if(!a)return!0}else if((n%e==0||o)&&!a)return!0})}},{key:"recalcDimensionsBasedOnFormat",value:function(t){var e=this.w,i=this.formatDates(t),n=this.removeOverlappingTS(i);e.globals.timescaleLabels=n.slice(),new vt(this.ctx).plotCoords()}},{key:"determineInterval",value:function(t){switch(!0){case 1825<t:this.tickInterval="years";break;case 800<t&&t<=1825:this.tickInterval="half_year";break;case 180<t&&t<=800:this.tickInterval="months";break;case 90<t&&t<=180:this.tickInterval="months_fortnight";break;case 60<t&&t<=90:this.tickInterval="months_days";break;case 30<t&&t<=60:this.tickInterval="week_days";break;case 2<t&&t<=30:this.tickInterval="days";break;case.1<t&&t<=2:this.tickInterval="hours";break;case t<.1:this.tickInterval="minutes";break;default:this.tickInterval="days"}}},{key:"generateYearScale",value:function(t){var e,i=t.firstVal,n=t.currentMonth,o=t.currentYear,a=t.daysWidthOnXAxis,r=t.numberOfYears,s=i.minYear,l=0,c=new q(this.ctx);1<i.minDate||0<i.minMonth?(e=c.determineRemainingDaysOfYear(i.minYear,i.minMonth,i.minDate),l=(c.determineDaysOfYear(i.minYear)-e+1)*a,s=i.minYear+1,this.timeScaleArray.push({position:l,value:s,unit:"year",year:s,month:L.monthMod(n+1)})):1===i.minDate&&0===i.minMonth&&this.timeScaleArray.push({position:l,value:s,unit:"year",year:o,month:L.monthMod(n+1)});for(var h=s,u=l,d=0;d<r;d++)h++,u=c.determineDaysOfYear(h-1)*a+u,this.timeScaleArray.push({position:u,value:h,unit:"year",year:h,month:1})}},{key:"generateMonthScale",value:function(t){var e,i,n,o=t.firstVal,a=t.currentMonthDate,r=t.currentMonth,s=t.currentYear,l=t.daysWidthOnXAxis,c=t.numberOfMonths,h=r,u=0,d=new q(this.ctx),f="month",p=0;1<o.minDate?(u=(d.determineDaysOfMonths(r+1,o.minYear)-a+1)*l,h=L.monthMod(r+1),e=s+p,i=L.monthMod(h),0===(n=h)&&(f="year",n=e,e+=p+=i=1),this.timeScaleArray.push({position:u,value:n,unit:f,year:e,month:i})):this.timeScaleArray.push({position:u,value:h,unit:f,year:s,month:L.monthMod(r)});for(var g=h+1,v=u,m=0;m<c;m++){0===(g=L.monthMod(g))?(f="year",p+=1):f="month";var b=this._getYear(s,g,p),v=d.determineDaysOfMonths(g,b)*l+v,y=0===g?b:g;this.timeScaleArray.push({position:v,value:y,unit:f,year:b,month:0===g?1:g}),g++}}},{key:"generateDayScale",value:function(t){function e(t,e,i){return t>s.determineDaysOfMonths(e+1,i)&&(l="month",d=e+=h=1),e}var i=t.firstVal,n=t.currentMonth,o=t.currentYear,a=t.hoursWidthOnXAxis,r=t.numberOfDays,s=new q(this.ctx),l="day",c=i.minDate+1,h=c,u=(24-i.minHour)*a,d=c,f=e(h,n,o);0===i.minHour&&1===i.minDate&&(u=0,d=L.monthMod(i.minMonth),l="month",h=i.minDate,r++),this.timeScaleArray.push({position:u,value:d,unit:l,year:this._getYear(o,f,0),month:L.monthMod(f),day:h});for(var p=u,g=0;g<r;g++){l="day",f=e(h+=1,f,this._getYear(o,f,0));var v=this._getYear(o,f,0),p=24*a+p,m=1===h?L.monthMod(f):h;this.timeScaleArray.push({position:p,value:m,unit:l,year:v,month:L.monthMod(f),day:m})}}},{key:"generateHourScale",value:function(t){function e(t,e){return t>l.determineDaysOfMonths(e+1,a)?e+=1:e}var i=t.firstVal,n=t.currentDate,o=t.currentMonth,a=t.currentYear,r=t.minutesWidthOnXAxis,s=t.numberOfHours,l=new q(this.ctx),c="hour",h=60-i.minMinute,u=h*r,d=i.minHour+1,f=d+1;60==h&&(u=0,f=(d=i.minHour)+1);var p=n,g=e(p,o);this.timeScaleArray.push({position:u,value:d,unit:c,day:p,hour:f,year:a,month:L.monthMod(g)});for(var v,m,b=u,y=0;y<s;y++){c="hour",24<=f&&(f=0,c="day",v=p+=1,m=g,v>l.determineDaysOfMonths(m+1,a)&&(m+=p=1),g=e(p,g={month:m,date:p}.month));var x=this._getYear(a,g,0),b=0===f&&0===y?h*r:60*r+b,w=0===f?p:f;this.timeScaleArray.push({position:b,value:w,unit:c,hour:f,day:p,year:x,month:L.monthMod(g)}),f++}}},{key:"generateMinuteScale",value:function(t){var e=t.firstVal,i=t.currentMinute,n=t.currentHour,o=t.currentDate,a=t.currentMonth,r=t.currentYear,s=t.minutesWidthOnXAxis,l=t.numberOfMinutes,c=s-(i-e.minMinute),h=e.minMinute+1,u=h+1,d=o,f=a,p=n;this.timeScaleArray.push({position:c,value:h,unit:"minute",day:d,hour:p,minute:u,year:r,month:L.monthMod(f)});for(var g=c,v=0;v<l;v++)60<=u&&(u=0,24===(p+=1)&&(p=0)),g=s+g,this.timeScaleArray.push({position:g,value:u,unit:"minute",hour:p,minute:u,day:d,year:this._getYear(r,f,0),month:L.monthMod(f)}),u++}},{key:"createRawDateString",value:function(t,e){var i=t.year;return i+="-"+("0"+t.month.toString()).slice(-2),"day"===t.unit?i+="day"===t.unit?"-"+("0"+e).slice(-2):"-01":i+="-"+("0"+(t.day?t.day:"1")).slice(-2),"hour"===t.unit?i+="hour"===t.unit?"T"+("0"+e).slice(-2):"T00":i+="T"+("0"+(t.hour?t.hour:"0")).slice(-2),i+="minute"===t.unit?":"+("0"+e).slice(-2)+":00":":00:00",this.utc&&(i+=".000Z"),i}},{key:"formatDates",value:function(t){var s=this,l=this.w;return t.map(function(t){var e,i,n=t.value.toString(),o=new q(s.ctx),a=s.createRawDateString(t,n),r=o.getDate(o.parseDate(a));return s.utc||(r=o.getDate(o.parseDateWithTimezone(a))),n=void 0===l.config.xaxis.labels.format?(e="dd MMM",i=l.config.xaxis.labels.datetimeFormatter,"year"===t.unit&&(e=i.year),"month"===t.unit&&(e=i.month),"day"===t.unit&&(e=i.day),"hour"===t.unit&&(e=i.hour),"minute"===t.unit&&(e=i.minute),o.formatDate(r,e)):o.formatDate(r,l.config.xaxis.labels.format),{dateString:a,position:t.position,value:n,unit:t.unit,year:t.year,month:t.month}})}},{key:"removeOverlappingTS",value:function(o){var a,r=this,s=new M(this.ctx),l=!1;0<o.length&&o[0].value&&o.every(function(t){return t.value.length===o[0].value.length})&&(l=!0,a=s.getTextRects(o[0].value).width);var c=0,t=o.map(function(t,e){if(0<e&&r.w.config.xaxis.labels.hideOverlappingLabels){var i=l?a:s.getTextRects(o[c].value).width,n=o[c].position;return t.position>n+i+10?(c=e,t):null}return t});return t.filter(function(t){return null!==t})}},{key:"_getYear",value:function(t,e,i){return t+Math.floor(e/12)+i}}]),Xt),jt=(r(Ht,[{key:"setupElements",value:function(){var t=this.w.globals,e=this.w.config,i=e.chart.type;t.axisCharts=-1<["line","area","bar","rangeBar","candlestick","scatter","bubble","radar","heatmap"].indexOf(i),t.xyCharts=-1<["line","area","bar","rangeBar","candlestick","scatter","bubble"].indexOf(i),t.isBarHorizontal=("bar"===e.chart.type||"rangeBar"===e.chart.type)&&e.plotOptions.bar.horizontal,t.chartClass=".apexcharts"+t.cuid,t.dom.baseEl=this.el,t.dom.elWrap=document.createElement("div"),M.setAttrs(t.dom.elWrap,{id:t.chartClass.substring(1),class:"apexcharts-canvas "+t.chartClass.substring(1)}),this.el.appendChild(t.dom.elWrap),t.dom.Paper=new window.SVG.Doc(t.dom.elWrap),t.dom.Paper.attr({class:"apexcharts-svg","xmlns:data":"ApexChartsNS",transform:"translate(".concat(e.chart.offsetX,", ").concat(e.chart.offsetY,")")}),t.dom.Paper.node.style.background=e.chart.background,this.setSVGDimensions(),t.dom.elGraphical=t.dom.Paper.group().attr({class:"apexcharts-inner apexcharts-graphical"}),t.dom.elAnnotations=t.dom.Paper.group().attr({class:"apexcharts-annotations"}),t.dom.elDefs=t.dom.Paper.defs(),t.dom.elLegendWrap=document.createElement("div"),t.dom.elLegendWrap.classList.add("apexcharts-legend"),t.dom.elWrap.appendChild(t.dom.elLegendWrap),t.dom.Paper.add(t.dom.elGraphical),t.dom.elGraphical.add(t.dom.elDefs)}},{key:"plotChartType",value:function(i,t){var n=this.w,o=n.config,a=n.globals,r={series:[],i:[]},s={series:[],i:[]},l={series:[],i:[]},c={series:[],i:[]},h={series:[],i:[]},u={series:[],i:[]};a.series.map(function(t,e){void 0!==i[e].type?("column"===i[e].type||"bar"===i[e].type?(1<a.series.length&&o.plotOptions.bar.horizontal&&console.warn("Horizontal bars are not supported in a mixed/combo chart. Please turn off `plotOptions.bar.horizontal`"),h.series.push(t),h.i.push(e),n.globals.columnSeries=h.series):"area"===i[e].type?(s.series.push(t),s.i.push(e)):"line"===i[e].type?(r.series.push(t),r.i.push(e)):"scatter"===i[e].type?(l.series.push(t),l.i.push(e)):"bubble"===i[e].type?(c.series.push(t),c.i.push(e)):"candlestick"===i[e].type?(u.series.push(t),u.i.push(e)):console.warn("You have specified an unrecognized chart type. Available types for this propery are line/area/column/bar/scatter/bubble"),a.comboCharts=!0):(r.series.push(t),r.i.push(e))});var e=new Rt(this.ctx,t),d=new Ot(this.ctx,t);this.ctx.pie=new Nt(this.ctx);var f,p,g,v,m=new Mt(this.ctx),b=new W(this.ctx,t),y=new It(this.ctx),x=[];if(a.comboCharts)0<s.series.length&&x.push(e.draw(s.series,"area",s.i)),0<h.series.length&&(n.config.chart.stacked?(f=new _t(this.ctx,t),x.push(f.draw(h.series,h.i))):(p=new Y(this.ctx,t),x.push(p.draw(h.series,h.i)))),0<r.series.length&&x.push(e.draw(r.series,"line",r.i)),0<u.series.length&&x.push(d.draw(u.series,u.i)),0<l.series.length&&(g=new Rt(this.ctx,t,!0),x.push(g.draw(l.series,"scatter",l.i))),0<c.series.length&&(v=new Rt(this.ctx,t,!0),x.push(v.draw(c.series,"bubble",c.i)));else switch(o.chart.type){case"line":x=e.draw(a.series,"line");break;case"area":x=e.draw(a.series,"area");break;case"bar":x=o.chart.stacked?new _t(this.ctx,t).draw(a.series):new Y(this.ctx,t).draw(a.series);break;case"candlestick":x=new Ot(this.ctx,t).draw(a.series);break;case"rangeBar":x=b.draw(a.series);break;case"heatmap":x=new Lt(this.ctx,t).draw(a.series);break;case"pie":case"donut":case"polarArea":x=this.ctx.pie.draw(a.series);break;case"radialBar":x=m.draw(a.series);break;case"radar":x=y.draw(a.series);break;default:x=e.draw(a.series)}return x}},{key:"setSVGDimensions",value:function(){var t=this.w.globals,e=this.w.config;t.svgWidth=e.chart.width,t.svgHeight=e.chart.height;var i,n=L.getDimensions(this.el),o=e.chart.width.toString().split(/[0-9]+/g).pop();"%"===o?L.isNumber(n[0])&&(0===n[0].width&&(n=L.getDimensions(this.el.parentNode)),t.svgWidth=n[0]*parseInt(e.chart.width,10)/100):"px"!==o&&""!==o||(t.svgWidth=parseInt(e.chart.width,10)),"auto"!==t.svgHeight&&""!==t.svgHeight?"%"===e.chart.height.toString().split(/[0-9]+/g).pop()?(i=L.getDimensions(this.el.parentNode),t.svgHeight=i[1]*parseInt(e.chart.height,10)/100):t.svgHeight=parseInt(e.chart.height,10):t.axisCharts?t.svgHeight=t.svgWidth/1.61:t.svgHeight=t.svgWidth/1.2,t.svgWidth<0&&(t.svgWidth=0),t.svgHeight<0&&(t.svgHeight=0),M.setAttrs(t.dom.Paper.node,{width:t.svgWidth,height:t.svgHeight});var a=!e.chart.sparkline.enabled&&t.axisCharts?e.chart.parentHeightOffset:0;t.dom.Paper.node.parentNode.parentNode.style.minHeight=t.svgHeight+a+"px",t.dom.elWrap.style.width=t.svgWidth+"px",t.dom.elWrap.style.height=t.svgHeight+"px"}},{key:"shiftGraphPosition",value:function(){var t=this.w.globals,e=t.translateY,i={transform:"translate("+t.translateX+", "+e+")"};M.setAttrs(t.dom.elGraphical.node,i)}},{key:"resizeNonAxisCharts",value:function(){var t=this.w,e=t.globals,i=0,n=t.config.chart.sparkline.enabled?1:15;n+=t.config.grid.padding.bottom,"top"!==t.config.legend.position&&"bottom"!==t.config.legend.position||!t.config.legend.show||t.config.legend.floating||(i=new bt(this.ctx).legendHelpers.getLegendBBox().clwh+10);var o,a,r=t.globals.dom.baseEl.querySelector(".apexcharts-radialbar"),s=2.05*t.globals.radialSize;r&&!t.config.chart.sparkline.enabled&&(s=(o=L.getBoundingClientRect(r)).bottom,a=o.bottom-o.top,s=Math.max(2.05*t.globals.radialSize,a));var l=s+e.translateY+i+n;e.dom.elLegendForeign&&e.dom.elLegendForeign.setAttribute("height",l),e.dom.elWrap.style.height=l+"px",M.setAttrs(e.dom.Paper.node,{height:l}),e.dom.Paper.node.parentNode.parentNode.style.minHeight=l+"px"}},{key:"coreCalculations",value:function(){new nt(this.ctx).init()}},{key:"resetGlobals",value:function(){function t(){return e.w.config.series.map(function(t){return[]})}var e=this,i=new U,n=this.w.globals;i.initGlobalVars(n),n.seriesXvalues=t(),n.seriesYvalues=t()}},{key:"isMultipleY",value:function(){if(this.w.config.yaxis.constructor===Array&&1<this.w.config.yaxis.length)return this.w.globals.isMultipleYAxis=!0}},{key:"xySettings",value:function(){var t,e=null,i=this.w;return i.globals.axisCharts&&("back"===i.config.xaxis.crosshairs.position&&new lt(this.ctx).drawXCrosshairs(),"back"===i.config.yaxis[0].crosshairs.position&&new lt(this.ctx).drawYCrosshairs(),"datetime"===i.config.xaxis.type&&void 0===i.config.xaxis.labels.formatter&&(this.ctx.timeScale=new zt(this.ctx),t=[],isFinite(i.globals.minX)&&isFinite(i.globals.maxX)&&!i.globals.isBarHorizontal?t=this.ctx.timeScale.calculateTimeScaleTicks(i.globals.minX,i.globals.maxX):i.globals.isBarHorizontal&&(t=this.ctx.timeScale.calculateTimeScaleTicks(i.globals.minY,i.globals.maxY)),this.ctx.timeScale.recalcDimensionsBasedOnFormat(t)),e=new E(this.ctx).getCalculatedRatios()),e}},{key:"updateSourceChart",value:function(t){this.ctx.w.globals.selection=void 0,this.ctx.updateHelpers._updateOptions({chart:{selection:{xaxis:{min:t.w.globals.minX,max:t.w.globals.maxX}}}},!1,!1)}},{key:"setupBrushHandler",value:function(){var e,i=this,a=this.w;a.config.chart.brush.enabled&&"function"!=typeof a.config.chart.events.selection&&((e=a.config.chart.brush.targets||[a.config.chart.brush.target]).forEach(function(t){var e=ApexCharts.getChartByID(t);e.w.globals.brushSource=i.ctx,"function"!=typeof e.w.config.chart.events.zoomed&&(e.w.config.chart.events.zoomed=function(){i.updateSourceChart(e)}),"function"!=typeof e.w.config.chart.events.scrolled&&(e.w.config.chart.events.scrolled=function(){i.updateSourceChart(e)})}),a.config.chart.events.selection=function(t,i){e.forEach(function(t){var n=ApexCharts.getChartByID(t),o=L.clone(a.config.yaxis);a.config.chart.brush.autoScaleYaxis&&1===n.w.globals.series.length&&(o=new it(n).autoScaleY(n,o,i));var e=n.w.config.yaxis.reduce(function(t,e,i){return[].concat(C(t),[P(P({},n.w.config.yaxis[i]),{},{min:o[0].min,max:o[0].max})])},[]);n.ctx.updateHelpers._updateOptions({xaxis:{min:i.xaxis.min,max:i.xaxis.max},yaxis:e},!1,!1,!1,!1)})})}}]),Ht),Bt=(r(Ft,[{key:"_updateOptions",value:function(i,t,e,n,o){var a=this,r=1<arguments.length&&void 0!==t&&t,s=!(2<arguments.length&&void 0!==e)||e,l=!(3<arguments.length&&void 0!==n)||n,c=4<arguments.length&&void 0!==o&&o,h=[this.ctx];l&&(h=this.ctx.getSyncedCharts()),this.ctx.w.globals.isExecCalled&&(h=[this.ctx],this.ctx.w.globals.isExecCalled=!1),h.forEach(function(t){var e=t.w;return e.globals.shouldAnimate=s,r||(e.globals.resized=!0,e.globals.dataChanged=!0,s&&t.series.getPreviousPaths()),i&&"object"===y(i)&&(t.config=new V(i),i=E.extendArrayProps(t.config,i,e),t.w.globals.chartID!==a.ctx.w.globals.chartID&&delete i.series,e.config=L.extend(e.config,i),c&&(e.globals.lastXAxis=i.xaxis?L.clone(i.xaxis):[],e.globals.lastYAxis=i.yaxis?L.clone(i.yaxis):[],e.globals.initialConfig=L.extend({},e.config),e.globals.initialSeries=L.clone(e.config.series))),t.update(i)})}},{key:"_updateSeries",value:function(t,e,i){var n,o=this,a=2<arguments.length&&void 0!==i&&i,r=this.w;return r.globals.shouldAnimate=e,r.globals.dataChanged=!0,e&&this.ctx.series.getPreviousPaths(),r.globals.axisCharts?(0===(n=t.map(function(t,e){return o._extendSeries(t,e)})).length&&(n=[{data:[]}]),r.config.series=n):r.config.series=t.slice(),a&&(r.globals.initialSeries=L.clone(r.config.series)),this.ctx.update({series:t})}},{key:"_extendSeries",value:function(t,e){var i=this.w,n=i.config.series[e];return P(P({},i.config.series[e]),{},{name:t.name?t.name:n&&n.name,color:t.color?t.color:n&&n.color,type:t.type?t.type:n&&n.type,data:t.data?t.data:n&&n.data})}},{key:"toggleDataPointSelection",value:function(t,e){var i=this.w,n=null,o=".apexcharts-series[data\\:realIndex='".concat(t,"']");return i.globals.axisCharts?n=i.globals.dom.Paper.select("".concat(o," path[j='").concat(e,"'], ").concat(o," circle[j='").concat(e,"'], ").concat(o," rect[j='").concat(e,"']")).members[0]:void 0===e&&(n=i.globals.dom.Paper.select("".concat(o," path[j='").concat(t,"']")).members[0],"pie"!==i.config.chart.type&&"polarArea"!==i.config.chart.type&&"donut"!==i.config.chart.type||this.ctx.pie.pieClicked(t)),n?(new M(this.ctx).pathMouseDown(n,null),n.node?n.node:null):(console.warn("toggleDataPointSelection: Element not found"),null)}},{key:"forceXAxisUpdate",value:function(e){var t,i=this.w;return["min","max"].forEach(function(t){void 0!==e.xaxis[t]&&(i.config.xaxis[t]=e.xaxis[t],i.globals.lastXAxis[t]=e.xaxis[t])}),e.xaxis.categories&&e.xaxis.categories.length&&(i.config.xaxis.categories=e.xaxis.categories),i.config.xaxis.convertedCatToNumeric&&(t=new $(e),e=t.convertCatToNumericXaxis(e,this.ctx)),e}},{key:"forceYAxisUpdate",value:function(i){var t=this.w;return t.config.chart.stacked&&"100%"===t.config.chart.stackType&&(Array.isArray(i.yaxis)?i.yaxis.forEach(function(t,e){i.yaxis[e].min=0,i.yaxis[e].max=100}):(i.yaxis.min=0,i.yaxis.max=100)),i}},{key:"revertDefaultAxisMinMax",value:function(){var n=this,o=this.w;o.config.xaxis.min=o.globals.lastXAxis.min,o.config.xaxis.max=o.globals.lastXAxis.max,o.config.yaxis.map(function(t,e){var i;o.globals.zoomed||void 0!==o.globals.lastYAxis[e]?(i=e,void 0!==o.globals.lastYAxis[i]&&(o.config.yaxis[i].min=o.globals.lastYAxis[i].min,o.config.yaxis[i].max=o.globals.lastYAxis[i].max)):void 0!==n.ctx.opts.yaxis[e]&&(t.min=n.ctx.opts.yaxis[e].min,t.max=n.ctx.opts.yaxis[e].max)})}}]),Ft);function Ft(t){a(this,Ft),this.ctx=t,this.w=t.w}function Ht(t,e){a(this,Ht),this.ctx=e,this.w=e.w,this.el=t}function Xt(t){a(this,Xt),this.ctx=t,this.w=t.w,this.timeScaleArray=[],this.utc=this.w.config.xaxis.labels.datetimeUTC}function Yt(t,e,i){a(this,Yt),this.ctx=t,this.w=t.w,this.xyRatios=e,this.pointsChart=!("bubble"!==this.w.config.chart.type&&"scatter"!==this.w.config.chart.type)||i,this.scatter=new j(this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new Dt(this),this.markers=new z(this.ctx),this.prevSeriesY=[],this.categoryAxisCorrection=0,this.yaxisIndex=0}function qt(t){a(this,qt),this.w=t.w,this.lineCtx=t}function Wt(t){a(this,Wt),this.ctx=t,this.w=t.w,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animDur=0;var e=this.w;this.graphics=new M(this.ctx),this.lineColorArr=void 0!==e.globals.stroke.colors?e.globals.stroke.colors:e.globals.colors,this.defaultSize=e.globals.svgHeight<e.globals.svgWidth?e.globals.gridHeight+1.5*e.globals.goldenPadding:e.globals.gridWidth,this.maxValue=this.w.globals.maxY,this.minValue=this.w.globals.minY,this.polygons=e.config.plotOptions.radar.polygons,this.strokeWidth=e.config.stroke.show?e.config.stroke.width:0,this.size=this.defaultSize/2.1-this.strokeWidth-e.config.chart.dropShadow.blur,e.config.xaxis.labels.show&&(this.size=this.size-e.globals.xAxisLabelsWidth/1.75),void 0!==e.config.plotOptions.radar.size&&(this.size=e.config.plotOptions.radar.size),this.dataRadiusOfPercent=[],this.dataRadius=[],this.angleArr=[],this.yaxisLabelsTextsPos=[]}function $t(t){a(this,$t),this.ctx=t,this.w=t.w;var e=this.w;this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=void 0!==e.globals.stroke.colors?e.globals.stroke.colors:e.globals.colors,this.defaultSize=e.globals.svgHeight<e.globals.svgWidth?e.globals.gridHeight:e.globals.gridWidth,this.centerY=this.defaultSize/2,this.centerX=e.globals.gridWidth/2,this.fullAngle=360,e.globals.radialSize=this.defaultSize/2.05-e.config.stroke.width-(e.config.chart.sparkline.enabled?0:e.config.chart.dropShadow.blur),this.donutSize=e.globals.radialSize*parseInt(e.config.plotOptions.pie.donut.size,10)/100,this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSectorAngleArr=[]}function Vt(t){a(this,Vt),this.ctx=t,this.w=t.w}function Ut(t,e){a(this,Ut),this.ctx=t,this.w=t.w,this.xRatio=e.xRatio,this.yRatio=e.yRatio,this.negRange=!1,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}function Gt(t){a(this,Gt),this.ctx=t,this.w=t.w;var e=this.w;this.tConfig=e.config.tooltip,this.tooltipUtil=new wt(this),this.tooltipLabels=new kt(this),this.tooltipPosition=new Ct(this),this.marker=new At(this),this.intersect=new St(this),this.axesTooltip=new Tt(this),this.showOnIntersect=this.tConfig.intersect,this.showTooltipTitle=this.tConfig.x.show,this.fixedTooltip=this.tConfig.fixed.enabled,this.xaxisTooltip=null,this.yaxisTTEls=null,this.isBarShared=!e.globals.isBarHorizontal&&this.tConfig.shared}function Kt(t){a(this,Kt),this.w=t.w,this.ttCtx=t}function Zt(t){a(this,Zt),this.w=t.w,this.ttCtx=t}function Qt(t){a(this,Qt),this.w=t.w,this.ttCtx=t,this.ctx=t.ctx,this.tooltipPosition=new Ct(t)}function Jt(t){a(this,Jt),this.ttCtx=t,this.ctx=t.ctx,this.w=t.w}function te(t){a(this,te),this.w=t.w,this.ctx=t.ctx,this.ttCtx=t,this.tooltipUtil=new wt(t)}function ee(t){a(this,ee),this.w=t.w,this.ttCtx=t,this.ctx=t.ctx}function ie(t){a(this,ie),this.ctx=t,this.w=t.w,this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar}function ne(t,e){a(this,ne),this.ctx=t,this.w=t.w,this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.isBarsDistributed="bar"===this.w.config.chart.type&&this.w.config.plotOptions.bar.distributed&&1===this.w.config.series.length,this.legendHelpers=new mt(this)}function oe(t){a(this,oe),this.w=t.w,this.lgCtx=t}function ae(t){a(this,ae),this.ctx=t,this.w=t.w,this.lgRect={},this.yAxisWidth=0,this.yAxisWidthLeft=0,this.yAxisWidthRight=0,this.xAxisHeight=0,this.isSparkline=this.w.config.chart.sparkline.enabled,this.dimHelpers=new dt(this),this.dimYAxis=new pt(this),this.dimXAxis=new ft(this),this.dimGrid=new gt(this),this.lgWidthForSideLegends=0,this.gridPad=this.w.config.grid.padding,this.xPadRight=0,this.xPadLeft=0}function re(t){a(this,re),this.w=t.w,this.dCtx=t}function se(t){a(this,se),this.w=t.w,this.dCtx=t}function le(t){a(this,le),this.w=t.w,this.dCtx=t}function ce(t){a(this,ce),this.w=t.w,this.dCtx=t}function he(t){a(this,he),this.ctx=t,this.w=t.w}function ue(t){a(this,ue),this.ctx=t,this.colors=[],this.w=t.w;var e=this.w;this.isColorFn=!1,this.isBarDistributed=e.config.plotOptions.bar.distributed&&("bar"===e.config.chart.type||"rangeBar"===e.config.chart.type)}function de(t){a(this,de),this.ctx=t,this.w=t.w}function fe(t){a(this,fe),this.ctx=t,this.w=t.w}function pe(t){a(this,pe),this.ctx=t,this.w=t.w}function ge(t){a(this,ge),this.ctx=t,this.w=t.w}function ve(t){a(this,ve),this.ctx=t,this.w=t.w,this.documentEvent=L.bind(this.documentEvent,this)}function me(t){a(this,me),this.ctx=t,this.w=t.w;var e=this.w;this.xaxisFontSize=e.config.xaxis.labels.style.fontSize,this.axisFontFamily=e.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=e.config.xaxis.labels.style.colors,this.isCategoryBarHorizontal="bar"===e.config.chart.type&&e.config.plotOptions.bar.horizontal,this.xAxisoffX=0,"bottom"===e.config.xaxis.position&&(this.xAxisoffX=e.globals.gridHeight),this.drawnLabels=[],this.axesUtils=new Q(t)}function be(t){a(this,be),this.ctx=t,this.w=t.w,this.scales=new it(t)}function ye(t){a(this,ye),this.ctx=t,this.w=t.w}function xe(t){a(this,xe),this.ctx=t,this.w=t.w;var e=this.w;this.xaxisLabels=e.globals.labels.slice(),this.axesUtils=new Q(t),this.isTimelineBar="datetime"===e.config.xaxis.type&&e.globals.seriesRangeBarTimeline.length,0<e.globals.timescaleLabels.length&&(this.xaxisLabels=e.globals.timescaleLabels.slice())}function we(t){a(this,we),this.ctx=t,this.w=t.w;var e=this.w;this.axesUtils=new Q(t),this.xaxisLabels=e.globals.labels.slice(),0<e.globals.timescaleLabels.length&&!e.globals.isBarHorizontal&&(this.xaxisLabels=e.globals.timescaleLabels.slice()),this.drawnLabels=[],this.drawnLabelsRects=[],"top"===e.config.xaxis.position?this.offY=0:this.offY=e.globals.gridHeight+1,this.offY=this.offY+e.config.xaxis.axisBorder.offsetY,this.isCategoryBarHorizontal="bar"===e.config.chart.type&&e.config.plotOptions.bar.horizontal,this.xaxisFontSize=e.config.xaxis.labels.style.fontSize,this.xaxisFontFamily=e.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=e.config.xaxis.labels.style.colors,this.xaxisBorderWidth=e.config.xaxis.axisBorder.width,this.isCategoryBarHorizontal&&(this.xaxisBorderWidth=e.config.yaxis[0].axisBorder.width.toString()),-1<this.xaxisBorderWidth.indexOf("%")?this.xaxisBorderWidth=e.globals.gridWidth*parseInt(this.xaxisBorderWidth,10)/100:this.xaxisBorderWidth=parseInt(this.xaxisBorderWidth,10),this.xaxisBorderHeight=e.config.xaxis.axisBorder.height,this.yaxis=e.config.yaxis[0]}function ke(t){a(this,ke),this.ctx=t,this.w=t.w}function Ce(t){a(this,Ce),this.ctx=t,this.w=t.w}function Ae(t){a(this,Ae),this.ctx=t,this.w=t.w,this.tooltipKeyFormat="dd MMM"}function Se(t){a(this,Se),this.ctx=t,this.w=t.w,this.twoDSeries=[],this.threeDSeries=[],this.twoDSeriesX=[],this.coreUtils=new E(this.ctx)}function Te(t){a(this,Te),this.opts=t}function Ee(){a(this,Ee)}function _e(t){a(this,_e),this.opts=t}function Oe(t){a(this,Oe),this.opts=t}function Le(t){a(this,Le),this.ctx=t,this.w=t.w,this.months31=[1,3,5,7,8,10,12],this.months30=[2,4,6,9,11],this.daysCntOfYear=[0,31,59,90,120,151,181,212,243,273,304,334]}function Pe(t,e){a(this,Pe),this.ctx=t,this.w=t.w;var i=this.w;this.barOptions=i.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=i.config.stroke.width,this.isNullValue=!1,this.isTimelineBar="datetime"===i.config.xaxis.type&&i.globals.seriesRangeBarTimeline.length,this.xyRatios=e,null!==this.xyRatios&&(this.xRatio=e.xRatio,this.initialXRatio=e.initialXRatio,this.yRatio=e.yRatio,this.invertedXRatio=e.invertedXRatio,this.invertedYRatio=e.invertedYRatio,this.baseLineY=e.baseLineY,this.baseLineInvertedY=e.baseLineInvertedY),this.yaxisIndex=0,this.seriesLen=0,this.barHelpers=new X(this)}function Ne(t){a(this,Ne),this.w=t.w,this.barCtx=t}function Ie(t){a(this,Ie),this.ctx=t,this.w=t.w,this.legendInactiveClass="legend-mouseover-inactive"}function Me(t){a(this,Me),this.w=t.w,this.barCtx=t}function De(t){a(this,De),this.ctx=t,this.w=t.w}function Re(t){a(this,Re),this.ctx=t,this.w=t.w,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled}function ze(t,e){a(this,ze),this.ctx=t,this.w=t.w}function je(t){a(this,je),this.ctx=t,this.w=t.w,this.opts=null,this.seriesIndex=0}function Be(t){a(this,Be),this.ctx=t,this.w=t.w,this.graphics=new M(this.ctx),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new e(this),this.xAxisAnnotations=new d(this),this.yAxisAnnotations=new f(this),this.pointsAnnotations=new p(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0),this.xDivision=this.w.globals.gridWidth/this.w.globals.dataPoints}function Fe(){a(this,Fe),this.yAxis={show:!0,showAlways:!1,showForNullSeries:!0,seriesName:void 0,opposite:!1,reversed:!1,logarithmic:!1,tickAmount:void 0,forceNiceScale:!1,max:void 0,min:void 0,floating:!1,decimalsInFloat:void 0,labels:{show:!0,minWidth:0,maxWidth:160,offsetX:0,offsetY:0,align:void 0,rotate:0,padding:20,style:{colors:[],fontSize:"11px",fontWeight:400,fontFamily:void 0,cssClass:""},formatter:void 0},axisBorder:{show:!1,color:"#e0e0e0",width:1,offsetX:0,offsetY:0},axisTicks:{show:!1,color:"#e0e0e0",width:6,offsetX:0,offsetY:0},title:{text:void 0,rotate:-90,offsetY:0,offsetX:0,style:{color:void 0,fontSize:"11px",fontWeight:900,fontFamily:void 0,cssClass:""}},tooltip:{enabled:!1,offsetX:0},crosshairs:{show:!0,position:"front",stroke:{color:"#b6b6b6",width:1,dashArray:0}}},this.pointAnnotation={x:0,y:null,yAxisIndex:0,seriesIndex:0,marker:{size:4,fillColor:"#fff",strokeWidth:2,strokeColor:"#333",shape:"circle",offsetX:0,offsetY:0,radius:2,cssClass:""},label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",offsetX:0,offsetY:0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}},customSVG:{SVG:void 0,cssClass:void 0,offsetX:0,offsetY:0},image:{path:void 0,width:20,height:20,offsetX:0,offsetY:0}},this.yAxisAnnotation={y:0,y2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,yAxisIndex:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"end",position:"right",offsetX:0,offsetY:-3,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.xAxisAnnotation={x:0,x2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",orientation:"vertical",position:"top",offsetX:0,offsetY:0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.text={x:0,y:0,text:"",textAnchor:"start",foreColor:void 0,fontSize:"13px",fontFamily:void 0,fontWeight:400,appendTo:".apexcharts-annotations",backgroundColor:"transparent",borderColor:"#c2c2c2",borderRadius:0,borderWidth:0,paddingLeft:4,paddingRight:4,paddingTop:2,paddingBottom:2}}function He(t){(this.el=t).remember("_selectHandler",this),this.pointSelection={isSelected:!1},this.rectSelection={isSelected:!1},this.pointsList={lt:[0,0],rt:["width",0],rb:["width","height"],lb:[0,"height"],t:["width",0],r:["width","height"],b:["width","height"],l:[0,"height"]},this.pointCoord=function(t,e,i){var n="string"!=typeof t?t:e[t];return i?n/2:n},this.pointCoords=function(t,e){var i=this.pointsList[t];return{x:this.pointCoord(i[0],e,"t"===t||"b"===t),y:this.pointCoord(i[1],e,"r"===t||"l"===t)}}}function Xe(t){switch(t[0]){case"z":case"Z":t[0]="L",t[1]=this.start[0],t[2]=this.start[1];break;case"H":t[0]="L",t[2]=this.pos[1];break;case"V":t[0]="L",t[2]=t[1],t[1]=this.pos[0];break;case"T":t[0]="Q",t[3]=t[1],t[4]=t[2],t[1]=this.reflection[1],t[2]=this.reflection[0];break;case"S":t[0]="C",t[6]=t[4],t[5]=t[3],t[4]=t[2],t[3]=t[1],t[2]=this.reflection[1],t[1]=this.reflection[0]}return t}function Ye(t){var e=t.length;return this.pos=[t[e-2],t[e-1]],-1!="SCQT".indexOf(t[0])&&(this.reflection=[2*this.pos[0]-t[e-4],2*this.pos[1]-t[e-3]]),t}function qe(t){var e=[t];switch(t[0]){case"M":return this.pos=this.start=[t[1],t[2]],e;case"L":t[5]=t[3]=t[1],t[6]=t[4]=t[2],t[1]=this.pos[0],t[2]=this.pos[1];break;case"Q":t[6]=t[4],t[5]=t[3],t[4]=t[4]/3+2*t[2]/3,t[3]=t[3]/3+2*t[1]/3,t[2]=this.pos[1]/3+2*t[2]/3,t[1]=this.pos[0]/3+2*t[1]/3;break;case"A":t=(e=function(t,e){var i,n,o,a,r,s,l,c,h,u,d,f,p,g,v,m,b,y,x,w,k,C,A,S,T,E,_=Math.abs(e[1]),O=Math.abs(e[2]),L=e[3]%360,P=e[4],N=e[5],I=e[6],M=e[7],D=new SVG.Point(t),R=new SVG.Point(I,M),z=[];if(0===_||0===O||D.x===R.x&&D.y===R.y)return[["C",D.x,D.y,R.x,R.y,R.x,R.y]];for(1<(n=(i=new SVG.Point((D.x-R.x)/2,(D.y-R.y)/2).transform((new SVG.Matrix).rotate(L))).x*i.x/(_*_)+i.y*i.y/(O*O))&&(_*=n=Math.sqrt(n),O*=n),o=(new SVG.Matrix).rotate(L).scale(1/_,1/O).rotate(-L),D=D.transform(o),s=(a=[(R=R.transform(o)).x-D.x,R.y-D.y])[0]*a[0]+a[1]*a[1],r=Math.sqrt(s),a[0]/=r,a[1]/=r,l=s<4?Math.sqrt(1-s/4):0,P===N&&(l*=-1),c=new SVG.Point((R.x+D.x)/2+l*-a[1],(R.y+D.y)/2+l*a[0]),h=new SVG.Point(D.x-c.x,D.y-c.y),u=new SVG.Point(R.x-c.x,R.y-c.y),d=Math.acos(h.x/Math.sqrt(h.x*h.x+h.y*h.y)),h.y<0&&(d*=-1),f=Math.acos(u.x/Math.sqrt(u.x*u.x+u.y*u.y)),u.y<0&&(f*=-1),N&&f<d&&(f+=2*Math.PI),!N&&d<f&&(f-=2*Math.PI),m=[],p=(f-(b=d))/(g=Math.ceil(2*Math.abs(d-f)/Math.PI)),v=4*Math.tan(p/4)/3,k=0;k<=g;k++)x=Math.cos(b),y=Math.sin(b),w=new SVG.Point(c.x+x,c.y+y),m[k]=[new SVG.Point(w.x+v*y,w.y-v*x),w,new SVG.Point(w.x-v*y,w.y+v*x)],b+=p;for(m[0][0]=m[0][1].clone(),m[m.length-1][2]=m[m.length-1][1].clone(),o=(new SVG.Matrix).rotate(L).scale(_,O).rotate(-L),k=0,C=m.length;k<C;k++)m[k][0]=m[k][0].transform(o),m[k][1]=m[k][1].transform(o),m[k][2]=m[k][2].transform(o);for(k=1,C=m.length;k<C;k++)A=(w=m[k-1][2]).x,S=w.y,T=(w=m[k][0]).x,E=w.y,I=(w=m[k][1]).x,M=w.y,z.push(["C",A,S,T,E,I,M]);return z}(this.pos,t))[0]}return t[0]="C",this.pos=[t[5],t[6]],this.reflection=[2*t[5]-t[3],2*t[6]-t[4]],e}function We(t,e){if(!1===e)return!1;for(var i=e,n=t.length;i<n;++i)if("M"==t[i][0])return i;return!1}t="undefined"!=typeof window?window:void 0,T=function(o,a){var c=(void 0!==this?this:o).SVG=function(t){if(c.supported)return t=new c.Doc(t),c.parser.draw||c.prepare(),t};if(c.ns="http://www.w3.org/2000/svg",c.xmlns="http://www.w3.org/2000/xmlns/",c.xlink="http://www.w3.org/1999/xlink",c.svgjs="http://svgjs.com/svgjs",c.supported=!0,!c.supported)return!1;c.did=1e3,c.eid=function(t){return"Svgjs"+s(t)+c.did++},c.create=function(t){var e=a.createElementNS(this.ns,t);return e.setAttribute("id",this.eid(t)),e},c.extend=function(){for(var t,e=(t=[].slice.call(arguments)).pop(),i=t.length-1;0<=i;i--)if(t[i])for(var n in e)t[i].prototype[n]=e[n];c.Set&&c.Set.inherit&&c.Set.inherit()},c.invent=function(t){var e="function"==typeof t.create?t.create:function(){this.constructor.call(this,c.create(t.create))};return t.inherit&&(e.prototype=new t.inherit),t.extend&&c.extend(e,t.extend),t.construct&&c.extend(t.parent||c.Container,t.construct),e},c.adopt=function(t){return t?t.instance?t.instance:((e="svg"==t.nodeName?t.parentNode instanceof o.SVGElement?new c.Nested:new c.Doc:"linearGradient"==t.nodeName?new c.Gradient("linear"):"radialGradient"==t.nodeName?new c.Gradient("radial"):c[s(t.nodeName)]?new(c[s(t.nodeName)]):new c.Element(t)).type=t.nodeName,((e.node=t).instance=e)instanceof c.Doc&&e.namespace().defs(),e.setData(JSON.parse(t.getAttribute("svgjs:data"))||{}),e):null;var e},c.prepare=function(){var t=a.getElementsByTagName("body")[0],e=(t?new c.Doc(t):c.adopt(a.documentElement).nested()).size(2,0);c.parser={body:t||a.documentElement,draw:e.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").node,poly:e.polyline().node,path:e.path().node,native:c.create("svg")}},c.parser={native:c.create("svg")},a.addEventListener("DOMContentLoaded",function(){c.parser.draw||c.prepare()},!1),c.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},c.utils={map:function(t,e){for(var i=t.length,n=[],o=0;o<i;o++)n.push(e(t[o]));return n},filter:function(t,e){for(var i=t.length,n=[],o=0;o<i;o++)e(t[o])&&n.push(t[o]);return n},filterSVGElements:function(t){return this.filter(t,function(t){return t instanceof o.SVGElement})}},c.defaults={attrs:{"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","font-size":16,"font-family":"Helvetica, Arial, sans-serif","text-anchor":"start"}},c.Color=function(t){var e,i;this.r=0,this.g=0,this.b=0,t&&("string"==typeof t?c.regex.isRgb.test(t)?(e=c.regex.rgb.exec(t.replace(c.regex.whitespace,"")),this.r=parseInt(e[1]),this.g=parseInt(e[2]),this.b=parseInt(e[3])):c.regex.isHex.test(t)&&(e=c.regex.hex.exec(4==(i=t).length?["#",i.substring(1,2),i.substring(1,2),i.substring(2,3),i.substring(2,3),i.substring(3,4),i.substring(3,4)].join(""):i),this.r=parseInt(e[1],16),this.g=parseInt(e[2],16),this.b=parseInt(e[3],16)):"object"===y(t)&&(this.r=t.r,this.g=t.g,this.b=t.b))},c.extend(c.Color,{toString:function(){return this.toHex()},toHex:function(){return"#"+u(this.r)+u(this.g)+u(this.b)},toRgb:function(){return"rgb("+[this.r,this.g,this.b].join()+")"},brightness:function(){return this.r/255*.3+this.g/255*.59+this.b/255*.11},morph:function(t){return this.destination=new c.Color(t),this},at:function(t){return this.destination?(t=t<0?0:1<t?1:t,new c.Color({r:~~(this.r+(this.destination.r-this.r)*t),g:~~(this.g+(this.destination.g-this.g)*t),b:~~(this.b+(this.destination.b-this.b)*t)})):this}}),c.Color.test=function(t){return t+="",c.regex.isHex.test(t)||c.regex.isRgb.test(t)},c.Color.isRgb=function(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b},c.Color.isColor=function(t){return c.Color.isRgb(t)||c.Color.test(t)},c.Array=function(t,e){0==(t=(t||[]).valueOf()).length&&e&&(t=e.valueOf()),this.value=this.parse(t)},c.extend(c.Array,{toString:function(){return this.value.join(" ")},valueOf:function(){return this.value},parse:function(t){return t=t.valueOf(),Array.isArray(t)?t:this.split(t)}}),c.PointArray=function(t,e){c.Array.call(this,t,e||[[0,0]])},c.PointArray.prototype=new c.Array,c.PointArray.prototype.constructor=c.PointArray;for(var l={M:function(t,e,i){return e.x=i.x=t[0],e.y=i.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},Z:function(t,e,i){return e.x=i.x,e.y=i.y,["Z"]}},t="mlhvqtcsaz".split(""),e=0,i=t.length;e<i;++e)l[t[e]]=function(a){return function(t,e,i){if("H"==a)t[0]=t[0]+e.x;else if("V"==a)t[0]=t[0]+e.y;else if("A"==a)t[5]=t[5]+e.x,t[6]=t[6]+e.y;else for(var n=0,o=t.length;n<o;++n)t[n]=t[n]+(n%2?e.y:e.x);return l[a](t,e,i)}}(t[e].toUpperCase());c.PathArray=function(t,e){c.Array.call(this,t,e||[["M",0,0]])},c.PathArray.prototype=new c.Array,c.PathArray.prototype.constructor=c.PathArray,c.extend(c.PathArray,{toString:function(){return function(t){for(var e=0,i=t.length,n="";e<i;e++)n+=t[e][0],null!=t[e][1]&&(n+=t[e][1],null!=t[e][2]&&(n+=" ",n+=t[e][2],null!=t[e][3]&&(n+=" ",n+=t[e][3],n+=" ",n+=t[e][4],null!=t[e][5]&&(n+=" ",n+=t[e][5],n+=" ",n+=t[e][6],null!=t[e][7]&&(n+=" ",n+=t[e][7])))));return n+" "}(this.value)},move:function(){var t=this.bbox();return t.x,t.y,this},at:function(t){if(!this.destination)return this;for(var e=this.value,i=this.destination.value,n=[],o=new c.PathArray,a=0,r=e.length;a<r;a++){n[a]=[e[a][0]];for(var s=1,l=e[a].length;s<l;s++)n[a][s]=e[a][s]+(i[a][s]-e[a][s])*t;"A"===n[a][0]&&(n[a][4]=+(0!=n[a][4]),n[a][5]=+(0!=n[a][5]))}return o.value=n,o},parse:function(t){if(t instanceof c.PathArray)return t.valueOf();var e,i={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};t="string"==typeof t?t.replace(c.regex.numbersWithDots,h).replace(c.regex.pathLetters," $& ").replace(c.regex.hyphen,"$1 -").trim().split(c.regex.delimiter):t.reduce(function(t,e){return[].concat.call(t,e)},[]);for(var n=[],o=new c.Point,a=new c.Point,r=0,s=t.length;c.regex.isPathLetter.test(t[r])?(e=t[r],++r):"M"==e?e="L":"m"==e&&(e="l"),n.push(l[e].call(null,t.slice(r,r+=i[e.toUpperCase()]).map(parseFloat),o,a)),r<s;);return n},bbox:function(){return c.parser.draw||c.prepare(),c.parser.path.setAttribute("d",this.toString()),c.parser.path.getBBox()}}),c.Number=c.invent({create:function(t,e){this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(c.regex.numberAndUnit))&&(this.value=parseFloat(e[1]),"%"==e[5]?this.value/=100:"s"==e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof c.Number&&(this.value=t.valueOf(),this.unit=t.unit)},extend:{toString:function(){return("%"==this.unit?~~(1e8*this.value)/1e6:"s"==this.unit?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(t){return t=new c.Number(t),new c.Number(this+t,this.unit||t.unit)},minus:function(t){return t=new c.Number(t),new c.Number(this-t,this.unit||t.unit)},times:function(t){return t=new c.Number(t),new c.Number(this*t,this.unit||t.unit)},divide:function(t){return t=new c.Number(t),new c.Number(this/t,this.unit||t.unit)},to:function(t){var e=new c.Number(this);return"string"==typeof t&&(e.unit=t),e},morph:function(t){return this.destination=new c.Number(t),t.relative&&(this.destination.value+=this.value),this},at:function(t){return this.destination?new c.Number(this.destination).minus(this).times(t).plus(this):this}}}),c.Element=c.invent({create:function(t){this._stroke=c.defaults.attrs.stroke,this._event=null,this.dom={},(this.node=t)&&(this.type=t.nodeName,(this.node.instance=this)._stroke=t.getAttribute("stroke")||this._stroke)},extend:{x:function(t){return this.attr("x",t)},y:function(t){return this.attr("y",t)},cx:function(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)},cy:function(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)},move:function(t,e){return this.x(t).y(e)},center:function(t,e){return this.cx(t).cy(e)},width:function(t){return this.attr("width",t)},height:function(t){return this.attr("height",t)},size:function(t,e){var i=d(this,t,e);return this.width(new c.Number(i.width)).height(new c.Number(i.height))},clone:function(t){this.writeDataToDom();var e=g(this.node.cloneNode(!0));return t?t.add(e):this.after(e),e},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(t){return this.after(t).remove(),t},addTo:function(t){return t.put(this)},putIn:function(t){return t.add(this)},id:function(t){return this.attr("id",t)},show:function(){return this.style("display","")},hide:function(){return this.style("display","none")},visible:function(){return"none"!=this.style("display")},toString:function(){return this.attr("id")},classes:function(){var t=this.attr("class");return null==t?[]:t.trim().split(c.regex.delimiter)},hasClass:function(t){return-1!=this.classes().indexOf(t)},addClass:function(t){var e;return this.hasClass(t)||((e=this.classes()).push(t),this.attr("class",e.join(" "))),this},removeClass:function(e){return this.hasClass(e)&&this.attr("class",this.classes().filter(function(t){return t!=e}).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)},reference:function(t){return c.get(this.attr(t))},parent:function(t){var e=this;if(!e.node.parentNode)return null;if(e=c.adopt(e.node.parentNode),!t)return e;for(;e&&e.node instanceof o.SVGElement;){if("string"==typeof t?e.matches(t):e instanceof t)return e;if(!e.node.parentNode||"#document"==e.node.parentNode.nodeName)return null;e=c.adopt(e.node.parentNode)}},doc:function(){return this instanceof c.Doc?this:this.parent(c.Doc)},parents:function(t){var e=[],i=this;do{if(!(i=i.parent(t))||!i.node)break;e.push(i)}while(i.parent);return e},matches:function(t){return((e=this.node).matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector).call(e,t);var e},native:function(){return this.node},svg:function(t){var e=a.createElement("svg");if(!(t&&this instanceof c.Parent))return e.appendChild(t=a.createElement("svg")),this.writeDataToDom(),t.appendChild(this.node.cloneNode(!0)),e.innerHTML.replace(/^<svg>/,"").replace(/<\/svg>$/,"");e.innerHTML="<svg>"+t.replace(/\n/,"").replace(/<([\w:-]+)([^<]+?)\/>/g,"<$1$2></$1>")+"</svg>";for(var i=0,n=e.firstChild.childNodes.length;i<n;i++)this.node.appendChild(e.firstChild.firstChild);return this},writeDataToDom:function(){return(this.each||this.lines)&&(this.each?this:this.lines()).each(function(){this.writeDataToDom()}),this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(t){return this.dom=t,this},is:function(t){return this instanceof t}}}),c.easing={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)}},c.morph=function(i){return function(t,e){return new c.MorphObj(t,e).at(i)}},c.Situation=c.invent({create:function(t){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new c.Number(t.duration).valueOf(),this.delay=new c.Number(t.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=t.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),c.FX=c.invent({create:function(t){this._target=t,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(t,e,i){"object"===y(t)&&(e=t.ease,i=t.delay,t=t.duration);var n=new c.Situation({duration:t||1e3,delay:i||0,ease:c.easing[e||"-"]||e});return this.queue(n),this},target:function(t){return t&&t instanceof c.Element?(this._target=t,this):this._target},timeToAbsPos:function(t){return(t-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(t){return this.situation.duration/this._speed*t+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=o.requestAnimationFrame(function(){this.step()}.bind(this))},stopAnimFrame:function(){o.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(t){return("function"==typeof t||t instanceof c.Situation)&&this.situations.push(t),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof c.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var t,e=this.situation;if(e.init)return this;for(var i in e.animations){t=this.target()[i](),Array.isArray(t)||(t=[t]),Array.isArray(e.animations[i])||(e.animations[i]=[e.animations[i]]);for(var n=t.length;n--;)e.animations[i][n]instanceof c.Number&&(t[n]=new c.Number(t[n])),e.animations[i][n]=t[n].morph(e.animations[i][n])}for(var i in e.attrs)e.attrs[i]=new c.MorphObj(this.target().attr(i),e.attrs[i]);for(var i in e.styles)e.styles[i]=new c.MorphObj(this.target().style(i),e.styles[i]);return e.initialTransformation=this.target().matrixify(),e.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(t,e){var i=this.active;return this.active=!1,e&&this.clearQueue(),t&&this.situation&&(i||this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},after:function(i){var n=this.last();return this.target().on("finished.fx",function t(e){e.detail.situation==n&&(i.call(this,n),this.off("finished.fx",t))}),this._callStart()},during:function(e){function t(t){t.detail.situation==i&&e.call(this,t.detail.pos,c.morph(t.detail.pos),t.detail.eased,i)}var i=this.last();return this.target().off("during.fx",t).on("during.fx",t),this.after(function(){this.off("during.fx",t)}),this._callStart()},afterAll:function(e){function i(t){e.call(this),this.off("allfinished.fx",i)}return this.target().off("allfinished.fx",i).on("allfinished.fx",i),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(t,e,i){return this.last()[i||"animations"][t]=e,this._callStart()},step:function(t){var e,i,n;t||(this.absPos=this.timeToAbsPos(+new Date)),!1!==this.situation.loops?(e=Math.max(this.absPos,0),i=Math.floor(e),!0===this.situation.loops||i<this.situation.loops?(this.pos=e-i,n=this.situation.loop,this.situation.loop=i):(this.absPos=this.situation.loops,this.pos=1,n=this.situation.loop-1,this.situation.loop=this.situation.loops),this.situation.reversing&&(this.situation.reversed=this.situation.reversed!=Boolean((this.situation.loop-n)%2))):(this.absPos=Math.min(this.absPos,1),this.pos=this.absPos),this.pos<0&&(this.pos=0),this.situation.reversed&&(this.pos=1-this.pos);var o=this.situation.ease(this.pos);for(var a in this.situation.once)a>this.lastPos&&a<=o&&(this.situation.once[a].call(this.target(),this.pos,o),delete this.situation.once[a]);return this.active&&this.target().fire("during",{pos:this.pos,eased:o,fx:this,situation:this.situation}),this.situation&&(this.eachAt(),1==this.pos&&!this.situation.reversed||this.situation.reversed&&0==this.pos?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.situations.length||(this.target().off(".fx"),this.active=!1)),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=o),this},eachAt:function(){var e=this,t=this.target(),i=this.situation;for(var n in i.animations)r=[].concat(i.animations[n]).map(function(t){return"string"!=typeof t&&t.at?t.at(i.ease(e.pos),e.pos):t}),t[n].apply(t,r);for(var n in i.attrs)r=[n].concat(i.attrs[n]).map(function(t){return"string"!=typeof t&&t.at?t.at(i.ease(e.pos),e.pos):t}),t.attr.apply(t,r);for(var n in i.styles)r=[n].concat(i.styles[n]).map(function(t){return"string"!=typeof t&&t.at?t.at(i.ease(e.pos),e.pos):t}),t.style.apply(t,r);if(i.transforms.length){r=i.initialTransformation,n=0;for(var o=i.transforms.length;n<o;n++)var a=i.transforms[n],r=a instanceof c.Matrix?a.relative?r.multiply((new c.Matrix).morph(a).at(i.ease(this.pos))):r.morph(a).at(i.ease(this.pos)):(a.relative||a.undo(r.extract()),r.multiply(a.at(i.ease(this.pos))));t.matrix(r)}return this},once:function(t,e,i){var n=this.last();return i||(t=n.ease(t)),n.once[t]=e,this},_callStart:function(){return setTimeout(function(){this.start()}.bind(this),0),this}},parent:c.Element,construct:{animate:function(t,e,i){return(this.fx||(this.fx=new c.FX(this))).animate(t,e,i)},delay:function(t){return(this.fx||(this.fx=new c.FX(this))).delay(t)},stop:function(t,e){return this.fx&&this.fx.stop(t,e),this},finish:function(){return this.fx&&this.fx.finish(),this}}}),c.MorphObj=c.invent({create:function(t,e){return c.Color.isColor(e)?new c.Color(t).morph(e):c.regex.delimiter.test(t)?c.regex.pathLetters.test(t)?new c.PathArray(t).morph(e):new c.Array(t).morph(e):c.regex.numberAndUnit.test(e)?new c.Number(t).morph(e):(this.value=t,void(this.destination=e))},extend:{at:function(t,e){return e<1?this.value:this.destination},valueOf:function(){return this.value}}}),c.extend(c.FX,{attr:function(t,e){if("object"===y(t))for(var i in t)this.attr(i,t[i]);else this.add(t,e,"attrs");return this},plot:function(t,e,i,n){return 4==arguments.length?this.plot([t,e,i,n]):this.add("plot",new(this.target().morphArray)(t))}}),c.Box=c.invent({create:function(t,e,i,n){if(!("object"!==y(t)||t instanceof c.Element))return c.Box.call(this,null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height);var o;4==arguments.length&&(this.x=t,this.y=e,this.width=i,this.height=n),null==(o=this).x&&(o.x=0,o.y=0,o.width=0,o.height=0),o.w=o.width,o.h=o.height,o.x2=o.x+o.width,o.y2=o.y+o.height,o.cx=o.x+o.width/2,o.cy=o.y+o.height/2}}),c.BBox=c.invent({create:function(e){if(c.Box.apply(this,[].slice.call(arguments)),e instanceof c.Element){var i,n;try{if(!a.documentElement.contains){for(var t=e.node;t.parentNode;)t=t.parentNode;if(t!=a)throw new Error("Element not in the dom")}i=e.node.getBBox()}catch(t){e instanceof c.Shape?(c.parser.draw||c.prepare(),i=(n=e.clone(c.parser.draw.instance).show()).node.getBBox(),n.remove()):i={x:e.node.clientLeft,y:e.node.clientTop,width:e.node.clientWidth,height:e.node.clientHeight}}c.Box.call(this,i)}},inherit:c.Box,parent:c.Element,construct:{bbox:function(){return new c.BBox(this)}}}),c.BBox.prototype.constructor=c.BBox,c.Matrix=c.invent({create:function(t){var e=p([1,0,0,1,0,0]);t=t instanceof c.Element?t.matrixify():"string"==typeof t?p(t.split(c.regex.delimiter).map(parseFloat)):6==arguments.length?p([].slice.call(arguments)):Array.isArray(t)?p(t):"object"===y(t)?t:e;for(var i=b.length-1;0<=i;--i)this[b[i]]=null!=t[b[i]]?t[b[i]]:e[b[i]]},extend:{extract:function(){var t=f(this,0,1),e=(f(this,1,0),180/Math.PI*Math.atan2(t.y,t.x)-90);return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(e*Math.PI/180)+this.f*Math.sin(e*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(e*Math.PI/180)+this.e*Math.sin(-e*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),rotation:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new c.Matrix(this)}},clone:function(){return new c.Matrix(this)},morph:function(t){return this.destination=new c.Matrix(t),this},multiply:function(t){return new c.Matrix(this.native().multiply(((e=t)instanceof c.Matrix||(e=new c.Matrix(e)),e.native())));var e},inverse:function(){return new c.Matrix(this.native().inverse())},translate:function(t,e){return new c.Matrix(this.native().translate(t||0,e||0))},native:function(){for(var t=c.parser.native.createSVGMatrix(),e=b.length-1;0<=e;e--)t[b[e]]=this[b[e]];return t},toString:function(){return"matrix("+v(this.a)+","+v(this.b)+","+v(this.c)+","+v(this.d)+","+v(this.e)+","+v(this.f)+")"}},parent:c.Element,construct:{ctm:function(){return new c.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof c.Nested){var t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new c.Matrix(e)}return new c.Matrix(this.node.getScreenCTM())}}}),c.Point=c.invent({create:function(t,e){var i=Array.isArray(t)?{x:t[0],y:t[1]}:"object"===y(t)?{x:t.x,y:t.y}:null!=t?{x:t,y:null!=e?e:t}:{x:0,y:0};this.x=i.x,this.y=i.y},extend:{clone:function(){return new c.Point(this)},morph:function(t,e){return this.destination=new c.Point(t,e),this}}}),c.extend(c.Element,{point:function(t,e){return new c.Point(t,e).transform(this.screenCTM().inverse())}}),c.extend(c.Element,{attr:function(t,e,i){if(null==t){for(t={},i=(e=this.node.attributes).length-1;0<=i;i--)t[e[i].nodeName]=c.regex.isNumber.test(e[i].nodeValue)?parseFloat(e[i].nodeValue):e[i].nodeValue;return t}if("object"===y(t))for(var n in t)this.attr(n,t[n]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?c.defaults.attrs[t]:c.regex.isNumber.test(e)?parseFloat(e):e;"stroke-width"==t?this.attr("stroke",0<parseFloat(e)?this._stroke:null):"stroke"==t&&(this._stroke=e),"fill"!=t&&"stroke"!=t||(c.regex.isImage.test(e)&&(e=this.doc().defs().image(e,0,0)),e instanceof c.Image&&(e=this.doc().defs().pattern(0,0,function(){this.add(e)}))),"number"==typeof e?e=new c.Number(e):c.Color.isColor(e)?e=new c.Color(e):Array.isArray(e)&&(e=new c.Array(e)),"leading"==t?this.leading&&this.leading(e):"string"==typeof i?this.node.setAttributeNS(i,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!=t&&"x"!=t||this.rebuild(t,e)}return this}}),c.extend(c.Element,{transform:function(t,e){var i;return"object"!==y(t)?(i=new c.Matrix(this).extract(),"string"==typeof t?i[t]:i):(i=new c.Matrix(this),e=!!e||!!t.relative,null!=t.a&&(i=e?i.multiply(new c.Matrix(t)):new c.Matrix(t)),this.attr("transform",i))}}),c.extend(c.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(c.regex.transforms).slice(0,-1).map(function(t){var e=t.trim().split("(");return[e[0],e[1].split(c.regex.delimiter).map(function(t){return parseFloat(t)})]}).reduce(function(t,e){return"matrix"==e[0]?t.multiply(p(e[1])):t[e[0]].apply(t,e[1])},new c.Matrix)},toParent:function(t){if(this==t)return this;var e=this.screenCTM(),i=t.screenCTM().inverse();return this.addTo(t).untransform().transform(i.multiply(e)),this},toDoc:function(){return this.toParent(this.doc())}}),c.Transformation=c.invent({create:function(t,e){if(1<arguments.length&&"boolean"!=typeof e)return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(t))for(var i=0,n=this.arguments.length;i<n;++i)this[this.arguments[i]]=t[i];else if("object"===y(t))for(i=0,n=this.arguments.length;i<n;++i)this[this.arguments[i]]=t[this.arguments[i]];!(this.inversed=!1)===e&&(this.inversed=!0)}}),c.Translate=c.invent({parent:c.Matrix,inherit:c.Transformation,create:function(t,e){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["transformedX","transformedY"],method:"translate"}}),c.extend(c.Element,{style:function(t,e){if(0==arguments.length)return this.node.style.cssText||"";if(arguments.length<2)if("object"===y(t))for(var i in t)this.style(i,t[i]);else{if(!c.regex.isCss.test(t))return this.node.style[r(t)];for(t=t.split(/\s*;\s*/).filter(function(t){return!!t}).map(function(t){return t.split(/\s*:\s*/)});e=t.pop();)this.style(e[0],e[1])}else this.node.style[r(t)]=null===e||c.regex.isBlank.test(e)?"":e;return this}}),c.Parent=c.invent({create:function(t){this.constructor.call(this,t)},inherit:c.Element,extend:{children:function(){return c.utils.map(c.utils.filterSVGElements(this.node.childNodes),function(t){return c.adopt(t)})},add:function(t,e){return null==e?this.node.appendChild(t.node):t.node!=this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this},put:function(t,e){return this.add(t,e),t},has:function(t){return 0<=this.index(t)},index:function(t){return[].slice.call(this.node.childNodes).indexOf(t.node)},get:function(t){return c.adopt(this.node.childNodes[t])},first:function(){return this.get(0)},last:function(){return this.get(this.node.childNodes.length-1)},each:function(t,e){for(var i=this.children(),n=0,o=i.length;n<o;n++)i[n]instanceof c.Element&&t.apply(i[n],[n,i]),e&&i[n]instanceof c.Container&&i[n].each(t,e);return this},removeElement:function(t){return this.node.removeChild(t.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this},defs:function(){return this.doc().defs()}}}),c.extend(c.Parent,{ungroup:function(t,e){return 0===e||this instanceof c.Defs||this.node==c.parser.draw||(t=t||(this instanceof c.Doc?this:this.parent(c.Parent)),e=e||1/0,this.each(function(){return this instanceof c.Defs?this:this instanceof c.Parent?this.ungroup(t,e-1):this.toParent(t)}),this.node.firstChild||this.remove()),this},flatten:function(t,e){return this.ungroup(t,e)}}),c.Container=c.invent({create:function(t){this.constructor.call(this,t)},inherit:c.Parent}),c.ViewBox=c.invent({parent:c.Container,construct:{}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach(function(e){c.Element.prototype[e]=function(t){return c.on(this.node,e,t),this}}),c.listeners=[],c.handlerMap=[],c.listenerId=0,c.on=function(t,e,i,n,o){var a=i.bind(n||t.instance||t),r=(c.handlerMap.indexOf(t)+1||c.handlerMap.push(t))-1,s=e.split(".")[0],l=e.split(".")[1]||"*";c.listeners[r]=c.listeners[r]||{},c.listeners[r][s]=c.listeners[r][s]||{},c.listeners[r][s][l]=c.listeners[r][s][l]||{},i._svgjsListenerId||(i._svgjsListenerId=++c.listenerId),c.listeners[r][s][l][i._svgjsListenerId]=a,t.addEventListener(s,a,o||!1)},c.off=function(t,e,i){var n=c.handlerMap.indexOf(t),o=e&&e.split(".")[0],a=e&&e.split(".")[1],r="";if(-1!=n)if(i){if("function"==typeof i&&(i=i._svgjsListenerId),!i)return;c.listeners[n][o]&&c.listeners[n][o][a||"*"]&&(t.removeEventListener(o,c.listeners[n][o][a||"*"][i],!1),delete c.listeners[n][o][a||"*"][i])}else if(a&&o){if(c.listeners[n][o]&&c.listeners[n][o][a]){for(var s in c.listeners[n][o][a])c.off(t,[o,a].join("."),s);delete c.listeners[n][o][a]}}else if(a)for(var l in c.listeners[n])for(var r in c.listeners[n][l])a===r&&c.off(t,[l,a].join("."));else if(o){if(c.listeners[n][o]){for(var r in c.listeners[n][o])c.off(t,[o,r].join("."));delete c.listeners[n][o]}}else{for(var l in c.listeners[n])c.off(t,l);delete c.listeners[n],delete c.handlerMap[n]}},c.extend(c.Element,{on:function(t,e,i,n){return c.on(this.node,t,e,i,n),this},off:function(t,e){return c.off(this.node,t,e),this},fire:function(t,e){return t instanceof o.Event?this.node.dispatchEvent(t):this.node.dispatchEvent(t=new c.CustomEvent(t,{detail:e,cancelable:!0})),this._event=t,this},event:function(){return this._event}}),c.Defs=c.invent({create:"defs",inherit:c.Container}),c.G=c.invent({create:"g",inherit:c.Container,extend:{x:function(t){return null==t?this.transform("x"):this.transform({x:t-this.x()},!0)}},construct:{group:function(){return this.put(new c.G)}}}),c.Doc=c.invent({create:function(t){t&&("svg"==(t="string"==typeof t?a.getElementById(t):t).nodeName?this.constructor.call(this,t):(this.constructor.call(this,c.create("svg")),t.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:c.Container,extend:{namespace:function(){return this.attr({xmlns:c.ns,version:"1.1"}).attr("xmlns:xlink",c.xlink,c.xmlns).attr("xmlns:svgjs",c.svgjs,c.xmlns)},defs:function(){var t;return this._defs||((t=this.node.getElementsByTagName("defs")[0])?this._defs=c.adopt(t):this._defs=new c.Defs,this.node.appendChild(this._defs.node)),this._defs},parent:function(){return this.node.parentNode&&"#document"!=this.node.parentNode.nodeName?this.node.parentNode:null},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,c.parser.draw&&!c.parser.draw.parentNode&&this.node.appendChild(c.parser.draw),this},clone:function(t){this.writeDataToDom();var e=this.node,i=g(e.cloneNode(!0));return t?(t.node||t).appendChild(i.node):e.parentNode.insertBefore(i.node,e.nextSibling),i}}}),c.extend(c.Element,{}),c.Gradient=c.invent({create:function(t){this.constructor.call(this,c.create(t+"Gradient")),this.type=t},inherit:c.Container,extend:{at:function(t,e,i){return this.put(new c.Stop).update(t,e,i)},update:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(t,e,i){return"transform"==t&&(t="gradientTransform"),c.Container.prototype.attr.call(this,t,e,i)}},construct:{gradient:function(t,e){return this.defs().gradient(t,e)}}}),c.extend(c.Gradient,c.FX,{from:function(t,e){return"radial"==(this._target||this).type?this.attr({fx:new c.Number(t),fy:new c.Number(e)}):this.attr({x1:new c.Number(t),y1:new c.Number(e)})},to:function(t,e){return"radial"==(this._target||this).type?this.attr({cx:new c.Number(t),cy:new c.Number(e)}):this.attr({x2:new c.Number(t),y2:new c.Number(e)})}}),c.extend(c.Defs,{gradient:function(t,e){return this.put(new c.Gradient(t)).update(e)}}),c.Stop=c.invent({create:"stop",inherit:c.Element,extend:{update:function(t,e,i){return("number"==typeof t||t instanceof c.Number)&&(t={offset:arguments[0],color:e,opacity:i}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new c.Number(t.offset)),this}}}),c.Pattern=c.invent({create:"pattern",inherit:c.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this},toString:function(){return this.fill()},attr:function(t,e,i){return"transform"==t&&(t="patternTransform"),c.Container.prototype.attr.call(this,t,e,i)}},construct:{pattern:function(t,e,i){return this.defs().pattern(t,e,i)}}}),c.extend(c.Defs,{pattern:function(t,e,i){return this.put(new c.Pattern).update(i).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}}),c.Shape=c.invent({create:function(t){this.constructor.call(this,t)},inherit:c.Element}),c.Symbol=c.invent({create:"symbol",inherit:c.Container,construct:{symbol:function(){return this.put(new c.Symbol)}}}),c.Use=c.invent({create:"use",inherit:c.Shape,extend:{element:function(t,e){return this.attr("href",(e||"")+"#"+t,c.xlink)}},construct:{use:function(t,e){return this.put(new c.Use).element(t,e)}}}),c.Rect=c.invent({create:"rect",inherit:c.Shape,construct:{rect:function(t,e){return this.put(new c.Rect).size(t,e)}}}),c.Circle=c.invent({create:"circle",inherit:c.Shape,construct:{circle:function(t){return this.put(new c.Circle).rx(new c.Number(t).divide(2)).move(0,0)}}}),c.extend(c.Circle,c.FX,{rx:function(t){return this.attr("r",t)},ry:function(t){return this.rx(t)}}),c.Ellipse=c.invent({create:"ellipse",inherit:c.Shape,construct:{ellipse:function(t,e){return this.put(new c.Ellipse).size(t,e).move(0,0)}}}),c.extend(c.Ellipse,c.Rect,c.FX,{rx:function(t){return this.attr("rx",t)},ry:function(t){return this.attr("ry",t)}}),c.extend(c.Circle,c.Ellipse,{x:function(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())},y:function(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())},cx:function(t){return null==t?this.attr("cx"):this.attr("cx",t)},cy:function(t){return null==t?this.attr("cy"):this.attr("cy",t)},width:function(t){return null==t?2*this.rx():this.rx(new c.Number(t).divide(2))},height:function(t){return null==t?2*this.ry():this.ry(new c.Number(t).divide(2))},size:function(t,e){var i=d(this,t,e);return this.rx(new c.Number(i.width).divide(2)).ry(new c.Number(i.height).divide(2))}}),c.Line=c.invent({create:"line",inherit:c.Shape,extend:{array:function(){return new c.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(t,e,i,n){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:i,y2:n}:new c.PointArray(t).toLine(),this.attr(t))},move:function(t,e){return this.attr(this.array().move(t,e).toLine())},size:function(t,e){var i=d(this,t,e);return this.attr(this.array().size(i.width,i.height).toLine())}},construct:{line:function(t,e,i,n){return c.Line.prototype.plot.apply(this.put(new c.Line),null!=t?[t,e,i,n]:[0,0,0,0])}}}),c.Polyline=c.invent({create:"polyline",inherit:c.Shape,construct:{polyline:function(t){return this.put(new c.Polyline).plot(t||new c.PointArray)}}}),c.Polygon=c.invent({create:"polygon",inherit:c.Shape,construct:{polygon:function(t){return this.put(new c.Polygon).plot(t||new c.PointArray)}}}),c.extend(c.Polyline,c.Polygon,{array:function(){return this._array||(this._array=new c.PointArray(this.attr("points")))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new c.PointArray(t))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},size:function(t,e){var i=d(this,t,e);return this.attr("points",this.array().size(i.width,i.height))}}),c.extend(c.Line,c.Polyline,c.Polygon,{morphArray:c.PointArray,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){var e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){var e=this.bbox();return null==t?e.height:this.size(e.width,t)}}),c.Path=c.invent({create:"path",inherit:c.Shape,extend:{morphArray:c.PathArray,array:function(){return this._array||(this._array=new c.PathArray(this.attr("d")))},plot:function(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new c.PathArray(t))},clear:function(){return delete this._array,this}},construct:{path:function(t){return this.put(new c.Path).plot(t||new c.PathArray)}}}),c.Image=c.invent({create:"image",inherit:c.Shape,extend:{load:function(e){if(!e)return this;var i=this,n=new o.Image;return c.on(n,"load",function(){c.off(n);var t=i.parent(c.Pattern);null!==t&&(0==i.width()&&0==i.height()&&i.size(n.width,n.height),t&&0==t.width()&&0==t.height()&&t.size(i.width(),i.height()),"function"==typeof i._loaded&&i._loaded.call(i,{width:n.width,height:n.height,ratio:n.width/n.height,url:e}))}),c.on(n,"error",function(t){c.off(n),"function"==typeof i._error&&i._error.call(i,t)}),this.attr("href",n.src=this.src=e,c.xlink)},loaded:function(t){return this._loaded=t,this},error:function(t){return this._error=t,this}},construct:{image:function(t,e,i){return this.put(new c.Image).load(t).size(e||0,i||e||0)}}}),c.Text=c.invent({create:function(){this.constructor.call(this,c.create("text")),this.dom.leading=new c.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",c.defaults.attrs["font-family"])},inherit:c.Shape,extend:{x:function(t){return null==t?this.attr("x"):this.attr("x",t)},text:function(t){if(void 0===t){t="";for(var e=this.node.childNodes,i=0,n=e.length;i<n;++i)0!=i&&3!=e[i].nodeType&&1==c.adopt(e[i]).dom.newLined&&(t+="\n"),t+=e[i].textContent;return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else{i=0;for(var o=(t=t.split("\n")).length;i<o;i++)this.tspan(t[i]).newLine()}return this.build(!1).rebuild()},size:function(t){return this.attr("font-size",t).rebuild()},leading:function(t){return null==t?this.dom.leading:(this.dom.leading=new c.Number(t),this.rebuild())},lines:function(){var t=(this.textPath&&this.textPath()||this).node,e=c.utils.map(c.utils.filterSVGElements(t.childNodes),function(t){return c.adopt(t)});return new c.Set(e)},rebuild:function(t){var e,i,n;return"boolean"==typeof t&&(this._rebuild=t),this._rebuild&&(i=0,n=(e=this).dom.leading*new c.Number(this.attr("font-size")),this.lines().each(function(){this.dom.newLined&&(e.textPath()||this.attr("x",e.attr("x")),"\n"==this.text()?i+=n:(this.attr("dy",n+i),i=0))}),this.fire("rebuild")),this},build:function(t){return this._build=!!t,this},setData:function(t){return this.dom=t,this.dom.leading=new c.Number(t.leading||1.3),this}},construct:{text:function(t){return this.put(new c.Text).text(t)},plain:function(t){return this.put(new c.Text).plain(t)}}}),c.Tspan=c.invent({create:"tspan",inherit:c.Shape,extend:{text:function(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?t.call(this,this):this.plain(t),this)},dx:function(t){return this.attr("dx",t)},dy:function(t){return this.attr("dy",t)},newLine:function(){var t=this.parent(c.Text);return this.dom.newLined=!0,this.dy(t.dom.leading*t.attr("font-size")).attr("x",t.x())}}}),c.extend(c.Text,c.Tspan,{plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(a.createTextNode(t)),this},tspan:function(t){var e=(this.textPath&&this.textPath()||this).node,i=new c.Tspan;return!1===this._build&&this.clear(),e.appendChild(i.node),i.text(t)},clear:function(){for(var t=(this.textPath&&this.textPath()||this).node;t.hasChildNodes();)t.removeChild(t.lastChild);return this},length:function(){return this.node.getComputedTextLength()}}),c.TextPath=c.invent({create:"textPath",inherit:c.Parent,parent:c.Text,construct:{morphArray:c.PathArray,array:function(){var t=this.track();return t?t.array():null},plot:function(t){var e=this.track(),i=null;return e&&(i=e.plot(t)),null==t?i:this},track:function(){var t=this.textPath();if(t)return t.reference("href")},textPath:function(){if(this.node.firstChild&&"textPath"==this.node.firstChild.nodeName)return c.adopt(this.node.firstChild)}}}),c.Nested=c.invent({create:function(){this.constructor.call(this,c.create("svg")),this.style("overflow","visible")},inherit:c.Container,construct:{nested:function(){return this.put(new c.Nested)}}});var n={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"==e?t:t+"-"+e}};function h(t,e,i,n){return i+n.replace(c.regex.dots," .")}function r(t){return t.toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()})}function s(t){return t.charAt(0).toUpperCase()+t.slice(1)}function u(t){var e=t.toString(16);return 1==e.length?"0"+e:e}function d(t,e,i){var n;return null!=e&&null!=i||(n=t.bbox(),null==e?e=n.width/n.height*i:null==i&&(i=n.height/n.width*e)),{width:e,height:i}}function f(t,e,i){return{x:e*t.a+i*t.c,y:e*t.b+i*t.d}}function p(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}function g(t){for(var e=t.childNodes.length-1;0<=e;e--)t.childNodes[e]instanceof o.SVGElement&&g(t.childNodes[e]);return c.adopt(t).id(c.eid(t.nodeName))}function v(t){return 1e-37<Math.abs(t)?t:0}["fill","stroke"].forEach(function(i){var t={};t[i]=function(t){if(void 0===t)return this;if("string"==typeof t||c.Color.isRgb(t)||t&&"function"==typeof t.fill)this.attr(i,t);else for(var e=n[i].length-1;0<=e;e--)null!=t[n[i][e]]&&this.attr(n.prefix(i,n[i][e]),t[n[i][e]]);return this},c.extend(c.Element,c.FX,t)}),c.extend(c.Element,c.FX,{translate:function(t,e){return this.transform({x:t,y:e})},matrix:function(t){return this.attr("transform",new c.Matrix(6==arguments.length?[].slice.call(arguments):t))},opacity:function(t){return this.attr("opacity",t)},dx:function(t){return this.x(new c.Number(t).plus(this instanceof c.FX?0:this.x()),!0)},dy:function(t){return this.y(new c.Number(t).plus(this instanceof c.FX?0:this.y()),!0)}}),c.extend(c.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(t){return this.node.getPointAtLength(t)}}),c.Set=c.invent({create:function(t){Array.isArray(t)?this.members=t:this.clear()},extend:{add:function(){for(var t=[].slice.call(arguments),e=0,i=t.length;e<i;e++)this.members.push(t[e]);return this},remove:function(t){var e=this.index(t);return-1<e&&this.members.splice(e,1),this},each:function(t){for(var e=0,i=this.members.length;e<i;e++)t.apply(this.members[e],[e,this.members]);return this},clear:function(){return this.members=[],this},length:function(){return this.members.length},has:function(t){return 0<=this.index(t)},index:function(t){return this.members.indexOf(t)},get:function(t){return this.members[t]},first:function(){return this.get(0)},last:function(){return this.get(this.members.length-1)},valueOf:function(){return this.members}},construct:{set:function(t){return new c.Set(t)}}}),c.FX.Set=c.invent({create:function(t){this.set=t}}),c.Set.inherit=function(){var t=[];for(var e in c.Shape.prototype)"function"==typeof c.Shape.prototype[e]&&"function"!=typeof c.Set.prototype[e]&&t.push(e);for(var e in t.forEach(function(i){c.Set.prototype[i]=function(){for(var t=0,e=this.members.length;t<e;t++)this.members[t]&&"function"==typeof this.members[t][i]&&this.members[t][i].apply(this.members[t],arguments);return"animate"==i?this.fx||(this.fx=new c.FX.Set(this)):this}}),t=[],c.FX.prototype)"function"==typeof c.FX.prototype[e]&&"function"!=typeof c.FX.Set.prototype[e]&&t.push(e);t.forEach(function(i){c.FX.Set.prototype[i]=function(){for(var t=0,e=this.set.members.length;t<e;t++)this.set.members[t].fx[i].apply(this.set.members[t].fx,arguments);return this}})},c.extend(c.Element,{}),c.extend(c.Element,{remember:function(t,e){if("object"===y(t))for(var i in t)this.remember(i,t[i]);else{if(1==arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0==arguments.length)this._memory={};else for(var t=arguments.length-1;0<=t;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory||(this._memory={})}}),c.get=function(e){var t=a.getElementById(function(){var t=(e||"").toString().match(c.regex.reference);if(t)return t[1]}()||e);return c.adopt(t)},c.select=function(t,e){return new c.Set(c.utils.map((e||a).querySelectorAll(t),function(t){return c.adopt(t)}))},c.extend(c.Parent,{select:function(t){return c.select(t,this.node)}});var m,b="abcdef".split("");return"function"!=typeof o.CustomEvent?((m=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var i=a.createEvent("CustomEvent");return i.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),i}).prototype=o.Event.prototype,c.CustomEvent=m):c.CustomEvent=o.CustomEvent,c},"function"==typeof define&&define.amd?define(function(){return T(t,t.document)}):"object"===("undefined"==typeof exports?"undefined":y(exports))&&"undefined"!=typeof module?module.exports=t.document?T(t,t.document):function(t){return T(t,t.document)}:t.SVG=T(t,t.document),function(){SVG.Filter=SVG.invent({create:"filter",inherit:SVG.Parent,extend:{source:"SourceGraphic",sourceAlpha:"SourceAlpha",background:"BackgroundImage",backgroundAlpha:"BackgroundAlpha",fill:"FillPaint",stroke:"StrokePaint",autoSetIn:!0,put:function(t,e){return this.add(t,e),!t.attr("in")&&this.autoSetIn&&t.attr("in",this.source),t.attr("result")||t.attr("result",t),t},blend:function(t,e,i){return this.put(new SVG.BlendEffect(t,e,i))},colorMatrix:function(t,e){return this.put(new SVG.ColorMatrixEffect(t,e))},convolveMatrix:function(t){return this.put(new SVG.ConvolveMatrixEffect(t))},componentTransfer:function(t){return this.put(new SVG.ComponentTransferEffect(t))},composite:function(t,e,i){return this.put(new SVG.CompositeEffect(t,e,i))},flood:function(t,e){return this.put(new SVG.FloodEffect(t,e))},offset:function(t,e){return this.put(new SVG.OffsetEffect(t,e))},image:function(t){return this.put(new SVG.ImageEffect(t))},merge:function(){var t=[void 0];for(var e in arguments)t.push(arguments[e]);return this.put(new(SVG.MergeEffect.bind.apply(SVG.MergeEffect,t)))},gaussianBlur:function(t,e){return this.put(new SVG.GaussianBlurEffect(t,e))},morphology:function(t,e){return this.put(new SVG.MorphologyEffect(t,e))},diffuseLighting:function(t,e,i){return this.put(new SVG.DiffuseLightingEffect(t,e,i))},displacementMap:function(t,e,i,n,o){return this.put(new SVG.DisplacementMapEffect(t,e,i,n,o))},specularLighting:function(t,e,i,n){return this.put(new SVG.SpecularLightingEffect(t,e,i,n))},tile:function(){return this.put(new SVG.TileEffect)},turbulence:function(t,e,i,n,o){return this.put(new SVG.TurbulenceEffect(t,e,i,n,o))},toString:function(){return"url(#"+this.attr("id")+")"}}}),SVG.extend(SVG.Defs,{filter:function(t){var e=this.put(new SVG.Filter);return"function"==typeof t&&t.call(e,e),e}}),SVG.extend(SVG.Container,{filter:function(t){return this.defs().filter(t)}}),SVG.extend(SVG.Element,SVG.G,SVG.Nested,{filter:function(t){return this.filterer=t instanceof SVG.Element?t:this.doc().filter(t),this.doc()&&this.filterer.doc()!==this.doc()&&this.doc().defs().add(this.filterer),this.attr("filter",this.filterer),this.filterer},unfilter:function(t){return this.filterer&&!0===t&&this.filterer.remove(),delete this.filterer,this.attr("filter",null)}}),SVG.Effect=SVG.invent({create:function(){this.constructor.call(this)},inherit:SVG.Element,extend:{in:function(t){return null==t?this.parent()&&this.parent().select('[result="'+this.attr("in")+'"]').get(0)||this.attr("in"):this.attr("in",t)},result:function(t){return null==t?this.attr("result"):this.attr("result",t)},toString:function(){return this.result()}}}),SVG.ParentEffect=SVG.invent({create:function(){this.constructor.call(this)},inherit:SVG.Parent,extend:{in:function(t){return null==t?this.parent()&&this.parent().select('[result="'+this.attr("in")+'"]').get(0)||this.attr("in"):this.attr("in",t)},result:function(t){return null==t?this.attr("result"):this.attr("result",t)},toString:function(){return this.result()}}});var t={blend:function(t,e){return this.parent()&&this.parent().blend(this,t,e)},colorMatrix:function(t,e){return this.parent()&&this.parent().colorMatrix(t,e).in(this)},convolveMatrix:function(t){return this.parent()&&this.parent().convolveMatrix(t).in(this)},componentTransfer:function(t){return this.parent()&&this.parent().componentTransfer(t).in(this)},composite:function(t,e){return this.parent()&&this.parent().composite(this,t,e)},flood:function(t,e){return this.parent()&&this.parent().flood(t,e)},offset:function(t,e){return this.parent()&&this.parent().offset(t,e).in(this)},image:function(t){return this.parent()&&this.parent().image(t)},merge:function(){return this.parent()&&this.parent().merge.apply(this.parent(),[this].concat(arguments))},gaussianBlur:function(t,e){return this.parent()&&this.parent().gaussianBlur(t,e).in(this)},morphology:function(t,e){return this.parent()&&this.parent().morphology(t,e).in(this)},diffuseLighting:function(t,e,i){return this.parent()&&this.parent().diffuseLighting(t,e,i).in(this)},displacementMap:function(t,e,i,n){return this.parent()&&this.parent().displacementMap(this,t,e,i,n)},specularLighting:function(t,e,i,n){return this.parent()&&this.parent().specularLighting(t,e,i,n).in(this)},tile:function(){return this.parent()&&this.parent().tile().in(this)},turbulence:function(t,e,i,n,o){return this.parent()&&this.parent().turbulence(t,e,i,n,o).in(this)}};SVG.extend(SVG.Effect,t),SVG.extend(SVG.ParentEffect,t),SVG.ChildEffect=SVG.invent({create:function(){this.constructor.call(this)},inherit:SVG.Element,extend:{in:function(t){this.attr("in",t)}}});var e={blend:function(t,e,i){this.attr({in:t,in2:e,mode:i||"normal"})},colorMatrix:function(t,e){"matrix"==t&&(e=o(e)),this.attr({type:t,values:void 0===e?null:e})},convolveMatrix:function(t){t=o(t),this.attr({order:Math.sqrt(t.split(" ").length),kernelMatrix:t})},composite:function(t,e,i){this.attr({in:t,in2:e,operator:i})},flood:function(t,e){this.attr("flood-color",t),null!=e&&this.attr("flood-opacity",e)},offset:function(t,e){this.attr({dx:t,dy:e})},image:function(t){this.attr("href",t,SVG.xlink)},displacementMap:function(t,e,i,n,o){this.attr({in:t,in2:e,scale:i,xChannelSelector:n,yChannelSelector:o})},gaussianBlur:function(t,e){null!=t||null!=e?this.attr("stdDeviation",function(t){if(!Array.isArray(t))return t;for(var e=0,i=t.length,n=[];e<i;e++)n.push(t[e]);return n.join(" ")}(Array.prototype.slice.call(arguments))):this.attr("stdDeviation","0 0")},morphology:function(t,e){this.attr({operator:t,radius:e})},tile:function(){},turbulence:function(t,e,i,n,o){this.attr({numOctaves:e,seed:i,stitchTiles:n,baseFrequency:t,type:o})}},i={merge:function(t){var e;if(t instanceof SVG.Set){var i=this;t.each(function(t){this instanceof SVG.MergeNode?i.put(this):(this instanceof SVG.Effect||this instanceof SVG.ParentEffect)&&i.put(new SVG.MergeNode(this))})}else{e=Array.isArray(t)?t:arguments;for(var n=0;n<e.length;n++)e[n]instanceof SVG.MergeNode?this.put(e[n]):this.put(new SVG.MergeNode(e[n]))}},componentTransfer:function(e){if(this.rgb=new SVG.Set,["r","g","b","a"].forEach(function(t){this[t]=new(SVG["Func"+t.toUpperCase()])("identity"),this.rgb.add(this[t]),this.node.appendChild(this[t].node)}.bind(this)),e)for(var t in e.rgb&&(["r","g","b"].forEach(function(t){this[t].attr(e.rgb)}.bind(this)),delete e.rgb),e)this[t].attr(e[t])},diffuseLighting:function(t,e,i){this.attr({surfaceScale:t,diffuseConstant:e,kernelUnitLength:i})},specularLighting:function(t,e,i,n){this.attr({surfaceScale:t,diffuseConstant:e,specularExponent:i,kernelUnitLength:n})}},n={distantLight:function(t,e){this.attr({azimuth:t,elevation:e})},pointLight:function(t,e,i){this.attr({x:t,y:e,z:i})},spotLight:function(t,e,i,n,o,a){this.attr({x:t,y:e,z:i,pointsAtX:n,pointsAtY:o,pointsAtZ:a})},mergeNode:function(t){this.attr("in",t)}};function o(t){return Array.isArray(t)&&(t=new SVG.Array(t)),t.toString().replace(/^\s+/,"").replace(/\s+$/,"").replace(/\s+/g," ")}function a(){var t=function(){};for(var e in"function"==typeof arguments[arguments.length-1]&&(t=arguments[arguments.length-1],Array.prototype.splice.call(arguments,arguments.length-1,1)),arguments)for(var i in arguments[e])t(arguments[e][i],i,arguments[e])}["r","g","b","a"].forEach(function(t){n["Func"+t.toUpperCase()]=function(t){switch(this.attr("type",t),t){case"table":this.attr("tableValues",arguments[1]);break;case"linear":this.attr("slope",arguments[1]),this.attr("intercept",arguments[2]);break;case"gamma":this.attr("amplitude",arguments[1]),this.attr("exponent",arguments[2]),this.attr("offset",arguments[2])}}}),a(e,function(t,e){var i=e.charAt(0).toUpperCase()+e.slice(1);SVG[i+"Effect"]=SVG.invent({create:function(){this.constructor.call(this,SVG.create("fe"+i)),t.apply(this,arguments),this.result(this.attr("id")+"Out")},inherit:SVG.Effect,extend:{}})}),a(i,function(t,e){var i=e.charAt(0).toUpperCase()+e.slice(1);SVG[i+"Effect"]=SVG.invent({create:function(){this.constructor.call(this,SVG.create("fe"+i)),t.apply(this,arguments),this.result(this.attr("id")+"Out")},inherit:SVG.ParentEffect,extend:{}})}),a(n,function(t,e){var i=e.charAt(0).toUpperCase()+e.slice(1);SVG[i]=SVG.invent({create:function(){this.constructor.call(this,SVG.create("fe"+i)),t.apply(this,arguments)},inherit:SVG.ChildEffect,extend:{}})}),SVG.extend(SVG.MergeEffect,{in:function(t){return t instanceof SVG.MergeNode?this.add(t,0):this.add(new SVG.MergeNode(t),0),this}}),SVG.extend(SVG.CompositeEffect,SVG.BlendEffect,SVG.DisplacementMapEffect,{in2:function(t){return null==t?this.parent()&&this.parent().select('[result="'+this.attr("in2")+'"]').get(0)||this.attr("in2"):this.attr("in2",t)}}),SVG.filter={sepiatone:[.343,.669,.119,0,0,.249,.626,.13,0,0,.172,.334,.111,0,0,0,0,0,1,0]}}.call(void 0),SVG.extend(SVG.PathArray,{morph:function(t){for(var e=this.value,i=this.parse(t),n=0,o=0,a=!1,r=!1;!1!==n||!1!==o;){var s,a=We(e,!1!==n&&n+1),r=We(i,!1!==o&&o+1);!1===n&&(n=0==(s=new SVG.PathArray(l.start).bbox()).height||0==s.width?e.push(e[0])-1:e.push(["M",s.x+s.width/2,s.y+s.height/2])-1),!1===o&&(o=0==(s=new SVG.PathArray(l.dest).bbox()).height||0==s.width?i.push(i[0])-1:i.push(["M",s.x+s.width/2,s.y+s.height/2])-1);var l=function(t,e,i,n,o,a,r){for(var s=t.slice(e,i||r),l=n.slice(o,a||r),c=0,h={pos:[0,0],start:[0,0]},u={pos:[0,0],start:[0,0]};s[c]=Xe.call(h,s[c]),l[c]=Xe.call(u,l[c]),s[c][0]!=l[c][0]||"M"==s[c][0]||"A"==s[c][0]&&(s[c][4]!=l[c][4]||s[c][5]!=l[c][5])?(Array.prototype.splice.apply(s,[c,1].concat(qe.call(h,s[c]))),Array.prototype.splice.apply(l,[c,1].concat(qe.call(u,l[c])))):(s[c]=Ye.call(h,s[c]),l[c]=Ye.call(u,l[c])),++c!=s.length||c!=l.length;)c==s.length&&s.push(["C",h.pos[0],h.pos[1],h.pos[0],h.pos[1],h.pos[0],h.pos[1]]),c==l.length&&l.push(["C",u.pos[0],u.pos[1],u.pos[0],u.pos[1],u.pos[0],u.pos[1]]);return{start:s,dest:l}}(e,n,a,i,o,r),e=e.slice(0,n).concat(l.start,!1===a?[]:e.slice(a)),i=i.slice(0,o).concat(l.dest,!1===r?[]:i.slice(r)),n=!1!==a&&n+l.start.length,o=!1!==r&&o+l.dest.length}return this.value=e,this.destination=new SVG.PathArray,this.destination.value=i,this}}),function(){function n(t){t.remember("_draggable",this),this.el=t}n.prototype.init=function(t,e){var i=this;this.constraint=t,this.value=e,this.el.on("mousedown.drag",function(t){i.start(t)}),this.el.on("touchstart.drag",function(t){i.start(t)})},n.prototype.transformPoint=function(t,e){var i=(t=t||window.event).changedTouches&&t.changedTouches[0]||t;return this.p.x=i.clientX-(e||0),this.p.y=i.clientY,this.p.matrixTransform(this.m)},n.prototype.getBBox=function(){var t=this.el.bbox();return this.el instanceof SVG.Nested&&(t=this.el.rbox()),(this.el instanceof SVG.G||this.el instanceof SVG.Use||this.el instanceof SVG.Nested)&&(t.x=this.el.x(),t.y=this.el.y()),t},n.prototype.start=function(t){if("click"!=t.type&&"mousedown"!=t.type&&"mousemove"!=t.type||1==(t.which||t.buttons)){var e=this;if(this.el.fire("beforedrag",{event:t,handler:this}),!this.el.event().defaultPrevented){t.preventDefault(),t.stopPropagation(),this.parent=this.parent||this.el.parent(SVG.Nested)||this.el.parent(SVG.Doc),this.p=this.parent.node.createSVGPoint(),this.m=this.el.node.getScreenCTM().inverse();var i,n=this.getBBox();if(this.el instanceof SVG.Text)switch(i=this.el.node.getComputedTextLength(),this.el.attr("text-anchor")){case"middle":i/=2;break;case"start":i=0}this.startPoints={point:this.transformPoint(t,i),box:n,transform:this.el.transform()},SVG.on(window,"mousemove.drag",function(t){e.drag(t)}),SVG.on(window,"touchmove.drag",function(t){e.drag(t)}),SVG.on(window,"mouseup.drag",function(t){e.end(t)}),SVG.on(window,"touchend.drag",function(t){e.end(t)}),this.el.fire("dragstart",{event:t,p:this.startPoints.point,m:this.m,handler:this})}}},n.prototype.drag=function(t){var e,i=this.getBBox(),n=this.transformPoint(t),o=this.startPoints.box.x+n.x-this.startPoints.point.x,a=this.startPoints.box.y+n.y-this.startPoints.point.y,r=this.constraint,s=n.x-this.startPoints.point.x,l=n.y-this.startPoints.point.y;return this.el.fire("dragmove",{event:t,p:n,m:this.m,handler:this}),this.el.event().defaultPrevented||("function"==typeof r?("boolean"==typeof(e=r.call(this.el,o,a,this.m))&&(e={x:e,y:e}),!0===e.x?this.el.x(o):!1!==e.x&&this.el.x(e.x),!0===e.y?this.el.y(a):!1!==e.y&&this.el.y(e.y)):"object"==_typeof2(r)&&(null!=r.minX&&o<r.minX?s=(o=r.minX)-this.startPoints.box.x:null!=r.maxX&&o>r.maxX-i.width&&(s=(o=r.maxX-i.width)-this.startPoints.box.x),null!=r.minY&&a<r.minY?l=(a=r.minY)-this.startPoints.box.y:null!=r.maxY&&a>r.maxY-i.height&&(l=(a=r.maxY-i.height)-this.startPoints.box.y),null!=r.snapToGrid&&(o-=o%r.snapToGrid,a-=a%r.snapToGrid,s-=s%r.snapToGrid,l-=l%r.snapToGrid),this.el instanceof SVG.G?this.el.matrix(this.startPoints.transform).transform({x:s,y:l},!0):this.el.move(o,a))),n},n.prototype.end=function(t){var e=this.drag(t);this.el.fire("dragend",{event:t,p:e,m:this.m,handler:this}),SVG.off(window,"mousemove.drag"),SVG.off(window,"touchmove.drag"),SVG.off(window,"mouseup.drag"),SVG.off(window,"touchend.drag")},SVG.extend(SVG.Element,{draggable:function(t,e){"function"!=typeof t&&"object"!=_typeof2(t)||(e=t,t=!0);var i=this.remember("_draggable")||new n(this);return(t=void 0===t||t)?i.init(e||{},t):(this.off("mousedown.drag"),this.off("touchstart.drag")),this}})}.call(void 0),He.prototype.init=function(t,e){var i=this.el.bbox();this.options={};var n=this.el.selectize.defaults.points;for(var o in this.el.selectize.defaults)this.options[o]=this.el.selectize.defaults[o],void 0!==e[o]&&(this.options[o]=e[o]);var a=["points","pointsExclude"];for(var o in a){var r=this.options[a[o]];"string"==typeof r?r=0<r.length?r.split(/\s*,\s*/i):[]:"boolean"==typeof r&&"points"===a[o]&&(r=r?n:[]),this.options[a[o]]=r}this.options.points=[n,this.options.points].reduce(function(t,e){return t.filter(function(t){return-1<e.indexOf(t)})}),this.options.points=[this.options.points,this.options.pointsExclude].reduce(function(t,e){return t.filter(function(t){return e.indexOf(t)<0})}),this.parent=this.el.parent(),this.nested=this.nested||this.parent.group(),this.nested.matrix(new SVG.Matrix(this.el).translate(i.x,i.y)),this.options.deepSelect&&-1!==["line","polyline","polygon"].indexOf(this.el.type)?this.selectPoints(t):this.selectRect(t),this.observe(),this.cleanup()},He.prototype.selectPoints=function(t){return this.pointSelection.isSelected=t,this.pointSelection.set||(this.pointSelection.set=this.parent.set(),this.drawPoints()),this},He.prototype.getPointArray=function(){var e=this.el.bbox();return this.el.array().valueOf().map(function(t){return[t[0]-e.x,t[1]-e.y]})},He.prototype.drawPoints=function(){for(var o=this,t=this.getPointArray(),e=0,i=t.length;e<i;++e){var n=function(n){return function(t){(t=t||window.event).preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation();var e=t.pageX||t.touches[0].pageX,i=t.pageY||t.touches[0].pageY;o.el.fire("point",{x:e,y:i,i:n,event:t})}}(e),a=this.drawPoint(t[e][0],t[e][1]).addClass(this.options.classPoints).addClass(this.options.classPoints+"_point").on("touchstart",n).on("mousedown",n);this.pointSelection.set.add(a)}},He.prototype.drawPoint=function(t,e){var i=this.options.pointType;switch(i){case"circle":return this.drawCircle(t,e);case"rect":return this.drawRect(t,e);default:if("function"==typeof i)return i.call(this,t,e);throw new Error("Unknown "+i+" point type!")}},He.prototype.drawCircle=function(t,e){return this.nested.circle(this.options.pointSize).center(t,e)},He.prototype.drawRect=function(t,e){return this.nested.rect(this.options.pointSize,this.options.pointSize).center(t,e)},He.prototype.updatePointSelection=function(){var e=this.getPointArray();this.pointSelection.set.each(function(t){this.cx()===e[t][0]&&this.cy()===e[t][1]||this.center(e[t][0],e[t][1])})},He.prototype.updateRectSelection=function(){var t,n=this,o=this.el.bbox();this.rectSelection.set.get(0).attr({width:o.width,height:o.height}),this.options.points.length&&this.options.points.map(function(t,e){var i=n.pointCoords(t,o);n.rectSelection.set.get(e+1).center(i.x,i.y)}),this.options.rotationPoint&&(t=this.rectSelection.set.length(),this.rectSelection.set.get(t-1).center(o.width/2,20))},He.prototype.selectRect=function(t){var e,i,o=this,a=this.el.bbox();function r(n){return function(t){(t=t||window.event).preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation();var e=t.pageX||t.touches[0].pageX,i=t.pageY||t.touches[0].pageY;o.el.fire(n,{x:e,y:i,event:t})}}this.rectSelection.isSelected=t,this.rectSelection.set=this.rectSelection.set||this.parent.set(),this.rectSelection.set.get(0)||this.rectSelection.set.add(this.nested.rect(a.width,a.height).addClass(this.options.classRect)),this.options.points.length&&this.rectSelection.set.length()<2&&(this.options.points.map(function(t,e){var i=o.pointCoords(t,a),n=o.drawPoint(i.x,i.y).attr("class",o.options.classPoints+"_"+t).on("mousedown",r(t)).on("touchstart",r(t));o.rectSelection.set.add(n)}),this.rectSelection.set.each(function(){this.addClass(o.options.classPoints)})),this.options.rotationPoint&&(this.options.points&&!this.rectSelection.set.get(9)||!this.options.points&&!this.rectSelection.set.get(1))&&(e=function(t){(t=t||window.event).preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation();var e=t.pageX||t.touches[0].pageX,i=t.pageY||t.touches[0].pageY;o.el.fire("rot",{x:e,y:i,event:t})},i=this.drawPoint(a.width/2,20).attr("class",this.options.classPoints+"_rot").on("touchstart",e).on("mousedown",e),this.rectSelection.set.add(i))},He.prototype.handler=function(){var t=this.el.bbox();this.nested.matrix(new SVG.Matrix(this.el).translate(t.x,t.y)),this.rectSelection.isSelected&&this.updateRectSelection(),this.pointSelection.isSelected&&this.updatePointSelection()},He.prototype.observe=function(){var t=this;if(MutationObserver)if(this.rectSelection.isSelected||this.pointSelection.isSelected)this.observerInst=this.observerInst||new MutationObserver(function(){t.handler()}),this.observerInst.observe(this.el.node,{attributes:!0});else try{this.observerInst.disconnect(),delete this.observerInst}catch(t){}else this.el.off("DOMAttrModified.select"),(this.rectSelection.isSelected||this.pointSelection.isSelected)&&this.el.on("DOMAttrModified.select",function(){t.handler()})},He.prototype.cleanup=function(){!this.rectSelection.isSelected&&this.rectSelection.set&&(this.rectSelection.set.each(function(){this.remove()}),this.rectSelection.set.clear(),delete this.rectSelection.set),!this.pointSelection.isSelected&&this.pointSelection.set&&(this.pointSelection.set.each(function(){this.remove()}),this.pointSelection.set.clear(),delete this.pointSelection.set),this.pointSelection.isSelected||this.rectSelection.isSelected||(this.nested.remove(),delete this.nested)},SVG.extend(SVG.Element,{selectize:function(t,e){return"object"==_typeof2(t)&&(e=t,t=!0),(this.remember("_selectHandler")||new He(this)).init(void 0===t||t,e||{}),this}}),SVG.Element.prototype.selectize.defaults={points:["lt","rt","rb","lb","t","r","b","l"],pointsExclude:[],classRect:"svg_select_boundingRect",classPoints:"svg_select_points",pointSize:7,rotationPoint:!0,deepSelect:!1,pointType:"circle"},function(){(function(){function e(t){t.remember("_resizeHandler",this),this.el=t,this.parameters={},this.lastUpdateCall=null,this.p=t.doc().node.createSVGPoint()}e.prototype.transformPoint=function(t,e,i){return this.p.x=t-(this.offset.x-window.pageXOffset),this.p.y=e-(this.offset.y-window.pageYOffset),this.p.matrixTransform(i||this.m)},e.prototype._extractPosition=function(t){return{x:null!=t.clientX?t.clientX:t.touches[0].clientX,y:null!=t.clientY?t.clientY:t.touches[0].clientY}},e.prototype.init=function(t){var e=this;if(this.stop(),"stop"!==t){for(var i in this.options={},this.el.resize.defaults)this.options[i]=this.el.resize.defaults[i],void 0!==t[i]&&(this.options[i]=t[i]);this.el.on("lt.resize",function(t){e.resize(t||window.event)}),this.el.on("rt.resize",function(t){e.resize(t||window.event)}),this.el.on("rb.resize",function(t){e.resize(t||window.event)}),this.el.on("lb.resize",function(t){e.resize(t||window.event)}),this.el.on("t.resize",function(t){e.resize(t||window.event)}),this.el.on("r.resize",function(t){e.resize(t||window.event)}),this.el.on("b.resize",function(t){e.resize(t||window.event)}),this.el.on("l.resize",function(t){e.resize(t||window.event)}),this.el.on("rot.resize",function(t){e.resize(t||window.event)}),this.el.on("point.resize",function(t){e.resize(t||window.event)}),this.update()}},e.prototype.stop=function(){return this.el.off("lt.resize"),this.el.off("rt.resize"),this.el.off("rb.resize"),this.el.off("lb.resize"),this.el.off("t.resize"),this.el.off("r.resize"),this.el.off("b.resize"),this.el.off("l.resize"),this.el.off("rot.resize"),this.el.off("point.resize"),this},e.prototype.resize=function(t){var e=this;this.m=this.el.node.getScreenCTM().inverse(),this.offset={x:window.pageXOffset,y:window.pageYOffset};var i,n=this._extractPosition(t.detail.event);switch(this.parameters={type:this.el.type,p:this.transformPoint(n.x,n.y),x:t.detail.x,y:t.detail.y,box:this.el.bbox(),rotation:this.el.transform().rotation},"text"===this.el.type&&(this.parameters.fontSize=this.el.attr()["font-size"]),void 0!==t.detail.i&&(i=this.el.array().valueOf(),this.parameters.i=t.detail.i,this.parameters.pointCoords=[i[t.detail.i][0],i[t.detail.i][1]]),t.type){case"lt":this.calc=function(t,e){var i=this.snapToGrid(t,e);if(0<this.parameters.box.width-i[0]&&0<this.parameters.box.height-i[1]){if("text"===this.parameters.type)return this.el.move(this.parameters.box.x+i[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize-i[0]);i=this.checkAspectRatio(i),this.el.move(this.parameters.box.x+i[0],this.parameters.box.y+i[1]).size(this.parameters.box.width-i[0],this.parameters.box.height-i[1])}};break;case"rt":this.calc=function(t,e){var i=this.snapToGrid(t,e,2);if(0<this.parameters.box.width+i[0]&&0<this.parameters.box.height-i[1]){if("text"===this.parameters.type)return this.el.move(this.parameters.box.x-i[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize+i[0]);i=this.checkAspectRatio(i,!0),this.el.move(this.parameters.box.x,this.parameters.box.y+i[1]).size(this.parameters.box.width+i[0],this.parameters.box.height-i[1])}};break;case"rb":this.calc=function(t,e){var i=this.snapToGrid(t,e,0);if(0<this.parameters.box.width+i[0]&&0<this.parameters.box.height+i[1]){if("text"===this.parameters.type)return this.el.move(this.parameters.box.x-i[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize+i[0]);i=this.checkAspectRatio(i),this.el.move(this.parameters.box.x,this.parameters.box.y).size(this.parameters.box.width+i[0],this.parameters.box.height+i[1])}};break;case"lb":this.calc=function(t,e){var i=this.snapToGrid(t,e,1);if(0<this.parameters.box.width-i[0]&&0<this.parameters.box.height+i[1]){if("text"===this.parameters.type)return this.el.move(this.parameters.box.x+i[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize-i[0]);i=this.checkAspectRatio(i,!0),this.el.move(this.parameters.box.x+i[0],this.parameters.box.y).size(this.parameters.box.width-i[0],this.parameters.box.height+i[1])}};break;case"t":this.calc=function(t,e){var i=this.snapToGrid(t,e,2);if(0<this.parameters.box.height-i[1]){if("text"===this.parameters.type)return;this.el.move(this.parameters.box.x,this.parameters.box.y+i[1]).height(this.parameters.box.height-i[1])}};break;case"r":this.calc=function(t,e){var i=this.snapToGrid(t,e,0);if(0<this.parameters.box.width+i[0]){if("text"===this.parameters.type)return;this.el.move(this.parameters.box.x,this.parameters.box.y).width(this.parameters.box.width+i[0])}};break;case"b":this.calc=function(t,e){var i=this.snapToGrid(t,e,0);if(0<this.parameters.box.height+i[1]){if("text"===this.parameters.type)return;this.el.move(this.parameters.box.x,this.parameters.box.y).height(this.parameters.box.height+i[1])}};break;case"l":this.calc=function(t,e){var i=this.snapToGrid(t,e,1);if(0<this.parameters.box.width-i[0]){if("text"===this.parameters.type)return;this.el.move(this.parameters.box.x+i[0],this.parameters.box.y).width(this.parameters.box.width-i[0])}};break;case"rot":this.calc=function(t,e){var i=t+this.parameters.p.x,n=e+this.parameters.p.y,o=Math.atan2(this.parameters.p.y-this.parameters.box.y-this.parameters.box.height/2,this.parameters.p.x-this.parameters.box.x-this.parameters.box.width/2),a=Math.atan2(n-this.parameters.box.y-this.parameters.box.height/2,i-this.parameters.box.x-this.parameters.box.width/2),r=this.parameters.rotation+180*(a-o)/Math.PI+this.options.snapToAngle/2;this.el.center(this.parameters.box.cx,this.parameters.box.cy).rotate(r-r%this.options.snapToAngle,this.parameters.box.cx,this.parameters.box.cy)};break;case"point":this.calc=function(t,e){var i=this.snapToGrid(t,e,this.parameters.pointCoords[0],this.parameters.pointCoords[1]),n=this.el.array().valueOf();n[this.parameters.i][0]=this.parameters.pointCoords[0]+i[0],n[this.parameters.i][1]=this.parameters.pointCoords[1]+i[1],this.el.plot(n)}}this.el.fire("resizestart",{dx:this.parameters.x,dy:this.parameters.y,event:t}),SVG.on(window,"touchmove.resize",function(t){e.update(t||window.event)}),SVG.on(window,"touchend.resize",function(){e.done()}),SVG.on(window,"mousemove.resize",function(t){e.update(t||window.event)}),SVG.on(window,"mouseup.resize",function(){e.done()})},e.prototype.update=function(t){var e,i,n,o;t?(e=this._extractPosition(t),n=(i=this.transformPoint(e.x,e.y)).x-this.parameters.p.x,o=i.y-this.parameters.p.y,this.lastUpdateCall=[n,o],this.calc(n,o),this.el.fire("resizing",{dx:n,dy:o,event:t})):this.lastUpdateCall&&this.calc(this.lastUpdateCall[0],this.lastUpdateCall[1])},e.prototype.done=function(){this.lastUpdateCall=null,SVG.off(window,"mousemove.resize"),SVG.off(window,"mouseup.resize"),SVG.off(window,"touchmove.resize"),SVG.off(window,"touchend.resize"),this.el.fire("resizedone")},e.prototype.snapToGrid=function(t,e,i,n){var o=void 0!==n?[(i+t)%this.options.snapToGrid,(n+e)%this.options.snapToGrid]:(i=null==i?3:i,[(this.parameters.box.x+t+(1&i?0:this.parameters.box.width))%this.options.snapToGrid,(this.parameters.box.y+e+(2&i?0:this.parameters.box.height))%this.options.snapToGrid]);return t<0&&(o[0]-=this.options.snapToGrid),e<0&&(o[1]-=this.options.snapToGrid),t-=Math.abs(o[0])<this.options.snapToGrid/2?o[0]:o[0]-(t<0?-this.options.snapToGrid:this.options.snapToGrid),e-=Math.abs(o[1])<this.options.snapToGrid/2?o[1]:o[1]-(e<0?-this.options.snapToGrid:this.options.snapToGrid),this.constraintToBox(t,e,i,n)},e.prototype.constraintToBox=function(t,e,i,n){var o,a=this.options.constraint||{},r=void 0!==n?(o=i,n):(o=this.parameters.box.x+(1&i?0:this.parameters.box.width),this.parameters.box.y+(2&i?0:this.parameters.box.height));return void 0!==a.minX&&o+t<a.minX&&(t=a.minX-o),void 0!==a.maxX&&a.maxX<o+t&&(t=a.maxX-o),void 0!==a.minY&&r+e<a.minY&&(e=a.minY-r),void 0!==a.maxY&&a.maxY<r+e&&(e=a.maxY-r),[t,e]},e.prototype.checkAspectRatio=function(t,e){if(!this.options.saveAspectRatio)return t;var i=t.slice(),n=this.parameters.box.width/this.parameters.box.height,o=this.parameters.box.width+t[0],a=this.parameters.box.height-t[1],r=o/a;return r<n?(i[1]=o/n-this.parameters.box.height,e&&(i[1]=-i[1])):n<r&&(i[0]=this.parameters.box.width-a*n,e&&(i[0]=-i[0])),i},SVG.extend(SVG.Element,{resize:function(t){return(this.remember("_resizeHandler")||new e(this)).init(t||{}),this}}),SVG.Element.prototype.resize.defaults={snapToAngle:.1,snapToGrid:1,constraint:{},saveAspectRatio:!1}}).call(this)}(),function(t,e){void 0===e&&(e={});var i,n,o=e.insertAt;"undefined"!=typeof document&&(i=document.head||document.getElementsByTagName("head")[0],(n=document.createElement("style")).type="text/css","top"===o&&i.firstChild?i.insertBefore(n,i.firstChild):i.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t)))}('.apexcharts-canvas {\n  position: relative;\n  user-select: none;\n  /* cannot give overflow: hidden as it will crop tooltips which overflow outside chart area */\n}\n\n\n/* scrollbar is not visible by default for legend, hence forcing the visibility */\n.apexcharts-canvas ::-webkit-scrollbar {\n  -webkit-appearance: none;\n  width: 6px;\n}\n\n.apexcharts-canvas ::-webkit-scrollbar-thumb {\n  border-radius: 4px;\n  background-color: rgba(0, 0, 0, .5);\n  box-shadow: 0 0 1px rgba(255, 255, 255, .5);\n  -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5);\n}\n\n\n.apexcharts-inner {\n  position: relative;\n}\n\n.apexcharts-text tspan {\n  font-family: inherit;\n}\n\n.legend-mouseover-inactive {\n  transition: 0.15s ease all;\n  opacity: 0.20;\n}\n\n.apexcharts-series-collapsed {\n  opacity: 0;\n}\n\n.apexcharts-tooltip {\n  border-radius: 5px;\n  box-shadow: 2px 2px 6px -4px #999;\n  cursor: default;\n  font-size: 14px;\n  left: 62px;\n  opacity: 0;\n  pointer-events: none;\n  position: absolute;\n  top: 20px;\n  overflow: hidden;\n  white-space: nowrap;\n  z-index: 12;\n  transition: 0.15s ease all;\n}\n\n.apexcharts-tooltip.apexcharts-active {\n  opacity: 1;\n  transition: 0.15s ease all;\n}\n\n.apexcharts-tooltip.apexcharts-theme-light {\n  border: 1px solid #e3e3e3;\n  background: rgba(255, 255, 255, 0.96);\n}\n\n.apexcharts-tooltip.apexcharts-theme-dark {\n  color: #fff;\n  background: rgba(30, 30, 30, 0.8);\n}\n\n.apexcharts-tooltip * {\n  font-family: inherit;\n}\n\n\n.apexcharts-tooltip-title {\n  padding: 6px;\n  font-size: 15px;\n  margin-bottom: 4px;\n}\n\n.apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title {\n  background: #ECEFF1;\n  border-bottom: 1px solid #ddd;\n}\n\n.apexcharts-tooltip.apexcharts-theme-dark .apexcharts-tooltip-title {\n  background: rgba(0, 0, 0, 0.7);\n  border-bottom: 1px solid #333;\n}\n\n.apexcharts-tooltip-text-value,\n.apexcharts-tooltip-text-z-value {\n  display: inline-block;\n  font-weight: 600;\n  margin-left: 5px;\n}\n\n.apexcharts-tooltip-text-z-label:empty,\n.apexcharts-tooltip-text-z-value:empty {\n  display: none;\n}\n\n.apexcharts-tooltip-text-value,\n.apexcharts-tooltip-text-z-value {\n  font-weight: 600;\n}\n\n.apexcharts-tooltip-marker {\n  width: 12px;\n  height: 12px;\n  position: relative;\n  top: 0px;\n  margin-right: 10px;\n  border-radius: 50%;\n}\n\n.apexcharts-tooltip-series-group {\n  padding: 0 10px;\n  display: none;\n  text-align: left;\n  justify-content: left;\n  align-items: center;\n}\n\n.apexcharts-tooltip-series-group.apexcharts-active .apexcharts-tooltip-marker {\n  opacity: 1;\n}\n\n.apexcharts-tooltip-series-group.apexcharts-active,\n.apexcharts-tooltip-series-group:last-child {\n  padding-bottom: 4px;\n}\n\n.apexcharts-tooltip-series-group-hidden {\n  opacity: 0;\n  height: 0;\n  line-height: 0;\n  padding: 0 !important;\n}\n\n.apexcharts-tooltip-y-group {\n  padding: 6px 0 5px;\n}\n\n.apexcharts-tooltip-candlestick {\n  padding: 4px 8px;\n}\n\n.apexcharts-tooltip-candlestick>div {\n  margin: 4px 0;\n}\n\n.apexcharts-tooltip-candlestick span.value {\n  font-weight: bold;\n}\n\n.apexcharts-tooltip-rangebar {\n  padding: 5px 8px;\n}\n\n.apexcharts-tooltip-rangebar .category {\n  font-weight: 600;\n  color: #777;\n}\n\n.apexcharts-tooltip-rangebar .series-name {\n  font-weight: bold;\n  display: block;\n  margin-bottom: 5px;\n}\n\n.apexcharts-xaxistooltip {\n  opacity: 0;\n  padding: 9px 10px;\n  pointer-events: none;\n  color: #373d3f;\n  font-size: 13px;\n  text-align: center;\n  border-radius: 2px;\n  position: absolute;\n  z-index: 10;\n  background: #ECEFF1;\n  border: 1px solid #90A4AE;\n  transition: 0.15s ease all;\n}\n\n.apexcharts-xaxistooltip.apexcharts-theme-dark {\n  background: rgba(0, 0, 0, 0.7);\n  border: 1px solid rgba(0, 0, 0, 0.5);\n  color: #fff;\n}\n\n.apexcharts-xaxistooltip:after,\n.apexcharts-xaxistooltip:before {\n  left: 50%;\n  border: solid transparent;\n  content: " ";\n  height: 0;\n  width: 0;\n  position: absolute;\n  pointer-events: none;\n}\n\n.apexcharts-xaxistooltip:after {\n  border-color: rgba(236, 239, 241, 0);\n  border-width: 6px;\n  margin-left: -6px;\n}\n\n.apexcharts-xaxistooltip:before {\n  border-color: rgba(144, 164, 174, 0);\n  border-width: 7px;\n  margin-left: -7px;\n}\n\n.apexcharts-xaxistooltip-bottom:after,\n.apexcharts-xaxistooltip-bottom:before {\n  bottom: 100%;\n}\n\n.apexcharts-xaxistooltip-top:after,\n.apexcharts-xaxistooltip-top:before {\n  top: 100%;\n}\n\n.apexcharts-xaxistooltip-bottom:after {\n  border-bottom-color: #ECEFF1;\n}\n\n.apexcharts-xaxistooltip-bottom:before {\n  border-bottom-color: #90A4AE;\n}\n\n.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:after {\n  border-bottom-color: rgba(0, 0, 0, 0.5);\n}\n\n.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:before {\n  border-bottom-color: rgba(0, 0, 0, 0.5);\n}\n\n.apexcharts-xaxistooltip-top:after {\n  border-top-color: #ECEFF1\n}\n\n.apexcharts-xaxistooltip-top:before {\n  border-top-color: #90A4AE;\n}\n\n.apexcharts-xaxistooltip-top.apexcharts-theme-dark:after {\n  border-top-color: rgba(0, 0, 0, 0.5);\n}\n\n.apexcharts-xaxistooltip-top.apexcharts-theme-dark:before {\n  border-top-color: rgba(0, 0, 0, 0.5);\n}\n\n.apexcharts-xaxistooltip.apexcharts-active {\n  opacity: 1;\n  transition: 0.15s ease all;\n}\n\n.apexcharts-yaxistooltip {\n  opacity: 0;\n  padding: 4px 10px;\n  pointer-events: none;\n  color: #373d3f;\n  font-size: 13px;\n  text-align: center;\n  border-radius: 2px;\n  position: absolute;\n  z-index: 10;\n  background: #ECEFF1;\n  border: 1px solid #90A4AE;\n}\n\n.apexcharts-yaxistooltip.apexcharts-theme-dark {\n  background: rgba(0, 0, 0, 0.7);\n  border: 1px solid rgba(0, 0, 0, 0.5);\n  color: #fff;\n}\n\n.apexcharts-yaxistooltip:after,\n.apexcharts-yaxistooltip:before {\n  top: 50%;\n  border: solid transparent;\n  content: " ";\n  height: 0;\n  width: 0;\n  position: absolute;\n  pointer-events: none;\n}\n\n.apexcharts-yaxistooltip:after {\n  border-color: rgba(236, 239, 241, 0);\n  border-width: 6px;\n  margin-top: -6px;\n}\n\n.apexcharts-yaxistooltip:before {\n  border-color: rgba(144, 164, 174, 0);\n  border-width: 7px;\n  margin-top: -7px;\n}\n\n.apexcharts-yaxistooltip-left:after,\n.apexcharts-yaxistooltip-left:before {\n  left: 100%;\n}\n\n.apexcharts-yaxistooltip-right:after,\n.apexcharts-yaxistooltip-right:before {\n  right: 100%;\n}\n\n.apexcharts-yaxistooltip-left:after {\n  border-left-color: #ECEFF1;\n}\n\n.apexcharts-yaxistooltip-left:before {\n  border-left-color: #90A4AE;\n}\n\n.apexcharts-yaxistooltip-left.apexcharts-theme-dark:after {\n  border-left-color: rgba(0, 0, 0, 0.5);\n}\n\n.apexcharts-yaxistooltip-left.apexcharts-theme-dark:before {\n  border-left-color: rgba(0, 0, 0, 0.5);\n}\n\n.apexcharts-yaxistooltip-right:after {\n  border-right-color: #ECEFF1;\n}\n\n.apexcharts-yaxistooltip-right:before {\n  border-right-color: #90A4AE;\n}\n\n.apexcharts-yaxistooltip-right.apexcharts-theme-dark:after {\n  border-right-color: rgba(0, 0, 0, 0.5);\n}\n\n.apexcharts-yaxistooltip-right.apexcharts-theme-dark:before {\n  border-right-color: rgba(0, 0, 0, 0.5);\n}\n\n.apexcharts-yaxistooltip.apexcharts-active {\n  opacity: 1;\n}\n\n.apexcharts-yaxistooltip-hidden {\n  display: none;\n}\n\n.apexcharts-xcrosshairs,\n.apexcharts-ycrosshairs {\n  pointer-events: none;\n  opacity: 0;\n  transition: 0.15s ease all;\n}\n\n.apexcharts-xcrosshairs.apexcharts-active,\n.apexcharts-ycrosshairs.apexcharts-active {\n  opacity: 1;\n  transition: 0.15s ease all;\n}\n\n.apexcharts-ycrosshairs-hidden {\n  opacity: 0;\n}\n\n.apexcharts-selection-rect {\n  cursor: move;\n}\n\n.svg_select_boundingRect, .svg_select_points_rot {\n  pointer-events: none;\n  opacity: 0;\n  visibility: hidden;\n}\n.apexcharts-selection-rect + g .svg_select_boundingRect,\n.apexcharts-selection-rect + g .svg_select_points_rot {\n  opacity: 0;\n  visibility: hidden;\n}\n\n.apexcharts-selection-rect + g .svg_select_points_l,\n.apexcharts-selection-rect + g .svg_select_points_r {\n  cursor: ew-resize;\n  opacity: 1;\n  visibility: visible;\n}\n\n.svg_select_points {\n  fill: #efefef;\n  stroke: #333;\n  rx: 2;\n}\n\n.apexcharts-svg.apexcharts-zoomable.hovering-zoom {\n  cursor: crosshair\n}\n\n.apexcharts-svg.apexcharts-zoomable.hovering-pan {\n  cursor: move\n}\n\n.apexcharts-zoom-icon,\n.apexcharts-zoomin-icon,\n.apexcharts-zoomout-icon,\n.apexcharts-reset-icon,\n.apexcharts-pan-icon,\n.apexcharts-selection-icon,\n.apexcharts-menu-icon,\n.apexcharts-toolbar-custom-icon {\n  cursor: pointer;\n  width: 20px;\n  height: 20px;\n  line-height: 24px;\n  color: #6E8192;\n  text-align: center;\n}\n\n.apexcharts-zoom-icon svg,\n.apexcharts-zoomin-icon svg,\n.apexcharts-zoomout-icon svg,\n.apexcharts-reset-icon svg,\n.apexcharts-menu-icon svg {\n  fill: #6E8192;\n}\n\n.apexcharts-selection-icon svg {\n  fill: #444;\n  transform: scale(0.76)\n}\n\n.apexcharts-theme-dark .apexcharts-zoom-icon svg,\n.apexcharts-theme-dark .apexcharts-zoomin-icon svg,\n.apexcharts-theme-dark .apexcharts-zoomout-icon svg,\n.apexcharts-theme-dark .apexcharts-reset-icon svg,\n.apexcharts-theme-dark .apexcharts-pan-icon svg,\n.apexcharts-theme-dark .apexcharts-selection-icon svg,\n.apexcharts-theme-dark .apexcharts-menu-icon svg,\n.apexcharts-theme-dark .apexcharts-toolbar-custom-icon svg {\n  fill: #f3f4f5;\n}\n\n.apexcharts-canvas .apexcharts-zoom-icon.apexcharts-selected svg,\n.apexcharts-canvas .apexcharts-selection-icon.apexcharts-selected svg,\n.apexcharts-canvas .apexcharts-reset-zoom-icon.apexcharts-selected svg {\n  fill: #008FFB;\n}\n\n.apexcharts-theme-light .apexcharts-selection-icon:not(.apexcharts-selected):hover svg,\n.apexcharts-theme-light .apexcharts-zoom-icon:not(.apexcharts-selected):hover svg,\n.apexcharts-theme-light .apexcharts-zoomin-icon:hover svg,\n.apexcharts-theme-light .apexcharts-zoomout-icon:hover svg,\n.apexcharts-theme-light .apexcharts-reset-icon:hover svg,\n.apexcharts-theme-light .apexcharts-menu-icon:hover svg {\n  fill: #333;\n}\n\n.apexcharts-selection-icon,\n.apexcharts-menu-icon {\n  position: relative;\n}\n\n.apexcharts-reset-icon {\n  margin-left: 5px;\n}\n\n.apexcharts-zoom-icon,\n.apexcharts-reset-icon,\n.apexcharts-menu-icon {\n  transform: scale(0.85);\n}\n\n.apexcharts-zoomin-icon,\n.apexcharts-zoomout-icon {\n  transform: scale(0.7)\n}\n\n.apexcharts-zoomout-icon {\n  margin-right: 3px;\n}\n\n.apexcharts-pan-icon {\n  transform: scale(0.62);\n  position: relative;\n  left: 1px;\n  top: 0px;\n}\n\n.apexcharts-pan-icon svg {\n  fill: #fff;\n  stroke: #6E8192;\n  stroke-width: 2;\n}\n\n.apexcharts-pan-icon.apexcharts-selected svg {\n  stroke: #008FFB;\n}\n\n.apexcharts-pan-icon:not(.apexcharts-selected):hover svg {\n  stroke: #333;\n}\n\n.apexcharts-toolbar {\n  position: absolute;\n  z-index: 11;\n  max-width: 176px;\n  text-align: right;\n  border-radius: 3px;\n  padding: 0px 6px 2px 6px;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\n.apexcharts-menu {\n  background: #fff;\n  position: absolute;\n  top: 100%;\n  border: 1px solid #ddd;\n  border-radius: 3px;\n  padding: 3px;\n  right: 10px;\n  opacity: 0;\n  min-width: 110px;\n  transition: 0.15s ease all;\n  pointer-events: none;\n}\n\n.apexcharts-menu.apexcharts-menu-open {\n  opacity: 1;\n  pointer-events: all;\n  transition: 0.15s ease all;\n}\n\n.apexcharts-menu-item {\n  padding: 6px 7px;\n  font-size: 12px;\n  cursor: pointer;\n}\n\n.apexcharts-theme-light .apexcharts-menu-item:hover {\n  background: #eee;\n}\n\n.apexcharts-theme-dark .apexcharts-menu {\n  background: rgba(0, 0, 0, 0.7);\n  color: #fff;\n}\n\n@media screen and (min-width: 768px) {\n  .apexcharts-canvas:hover .apexcharts-toolbar {\n    opacity: 1;\n  }\n}\n\n.apexcharts-datalabel.apexcharts-element-hidden {\n  opacity: 0;\n}\n\n.apexcharts-pie-label,\n.apexcharts-datalabels,\n.apexcharts-datalabel,\n.apexcharts-datalabel-label,\n.apexcharts-datalabel-value {\n  cursor: default;\n  pointer-events: none;\n}\n\n.apexcharts-pie-label-delay {\n  opacity: 0;\n  animation-name: opaque;\n  animation-duration: 0.3s;\n  animation-fill-mode: forwards;\n  animation-timing-function: ease;\n}\n\n.apexcharts-canvas .apexcharts-element-hidden {\n  opacity: 0;\n}\n\n.apexcharts-hide .apexcharts-series-points {\n  opacity: 0;\n}\n\n.apexcharts-gridline,\n.apexcharts-annotation-rect,\n.apexcharts-tooltip .apexcharts-marker,\n.apexcharts-area-series .apexcharts-area,\n.apexcharts-line,\n.apexcharts-zoom-rect,\n.apexcharts-toolbar svg,\n.apexcharts-area-series .apexcharts-series-markers .apexcharts-marker.no-pointer-events,\n.apexcharts-line-series .apexcharts-series-markers .apexcharts-marker.no-pointer-events,\n.apexcharts-radar-series path,\n.apexcharts-radar-series polygon {\n  pointer-events: none;\n}\n\n\n/* markers */\n\n.apexcharts-marker {\n  transition: 0.15s ease all;\n}\n\n@keyframes opaque {\n  0% {\n    opacity: 0;\n  }\n  100% {\n    opacity: 1;\n  }\n}\n\n\n/* Resize generated styles */\n\n@keyframes resizeanim {\n  from {\n    opacity: 0;\n  }\n  to {\n    opacity: 0;\n  }\n}\n\n.resize-triggers {\n  animation: 1ms resizeanim;\n  visibility: hidden;\n  opacity: 0;\n}\n\n.resize-triggers,\n.resize-triggers>div,\n.contract-trigger:before {\n  content: " ";\n  display: block;\n  position: absolute;\n  top: 0;\n  left: 0;\n  height: 100%;\n  width: 100%;\n  overflow: hidden;\n}\n\n.resize-triggers>div {\n  background: #eee;\n  overflow: auto;\n}\n\n.contract-trigger:before {\n  width: 200%;\n  height: 200%;\n}'),function(){function i(t){var e=t.__resizeTriggers__,i=e.firstElementChild,n=e.lastElementChild,o=i?i.firstElementChild:null;n&&(n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight),o&&(o.style.width=i.offsetWidth+1+"px",o.style.height=i.offsetHeight+1+"px"),i&&(i.scrollLeft=i.scrollWidth,i.scrollTop=i.scrollHeight)}function n(e){var t=this;i(this),this.__resizeRAF__&&r(this.__resizeRAF__),this.__resizeRAF__=a(function(){t.offsetWidth==t.__resizeLast__.width&&t.offsetHeight==t.__resizeLast__.height||(t.__resizeLast__.width=t.offsetWidth,t.__resizeLast__.height=t.offsetHeight,t.__resizeListeners__.forEach(function(t){t.call(e)}))})}var e,o,a=(e=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){return window.setTimeout(t,20)},function(t){return e(t)}),r=(o=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout,function(t){return o(t)}),t=!1,s="animationstart",l="Webkit Moz O ms".split(" "),c="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),h=document.createElement("fakeelement");if(void 0!==h.style.animationName&&(t=!0),!1===t)for(var u=0;u<l.length;u++)if(void 0!==h.style[l[u]+"AnimationName"]){s=c[u];break}window.addResizeListener=function(e,t){e.__resizeTriggers__||("static"==getComputedStyle(e).position&&(e.style.position="relative"),e.__resizeLast__={},e.__resizeListeners__=[],(e.__resizeTriggers__=document.createElement("div")).className="resize-triggers",e.__resizeTriggers__.innerHTML='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',e.appendChild(e.__resizeTriggers__),i(e),e.addEventListener("scroll",n,!0),s&&e.__resizeTriggers__.addEventListener(s,function(t){"resizeanim"==t.animationName&&i(e)})),e.__resizeListeners__.push(t)},window.removeResizeListener=function(t,e){t&&(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),t.__resizeListeners__.length||(t.removeEventListener("scroll",n),t.__resizeTriggers__.parentNode&&(t.__resizeTriggers__=!t.removeChild(t.__resizeTriggers__))))}}(),window.Apex={};var $e=(r(Ge,[{key:"initModules",value:function(){this.ctx.publicMethods=["updateOptions","updateSeries","appendData","appendSeries","toggleSeries","showSeries","hideSeries","setLocale","resetSeries","zoomX","toggleDataPointSelection","dataURI","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","paper","destroy"],this.ctx.eventList=["click","mousedown","mousemove","touchstart","touchmove","mouseup","touchend"],this.ctx.animations=new I(this.ctx),this.ctx.axes=new st(this.ctx),this.ctx.core=new jt(this.ctx.el,this.ctx),this.ctx.config=new V({}),this.ctx.data=new K(this.ctx),this.ctx.grid=new et(this.ctx),this.ctx.graphics=new M(this.ctx),this.ctx.coreUtils=new E(this.ctx),this.ctx.crosshairs=new lt(this.ctx),this.ctx.events=new at(this.ctx),this.ctx.exports=new J(this.ctx),this.ctx.localization=new rt(this.ctx),this.ctx.options=new O,this.ctx.responsive=new ct(this.ctx),this.ctx.series=new H(this.ctx),this.ctx.theme=new ht(this.ctx),this.ctx.formatters=new Z(this.ctx),this.ctx.titleSubtitle=new ut(this.ctx),this.ctx.legend=new bt(this.ctx),this.ctx.toolbar=new yt(this.ctx),this.ctx.dimensions=new vt(this.ctx),this.ctx.updateHelpers=new Bt(this.ctx),this.ctx.zoomPanSelection=new xt(this.ctx),this.ctx.w.globals.tooltip=new Et(this.ctx)}}]),Ge),Ve=(r(Ue,[{key:"clear",value:function(){this.ctx.zoomPanSelection&&this.ctx.zoomPanSelection.destroy(),this.ctx.toolbar&&this.ctx.toolbar.destroy(),this.ctx.animations=null,this.ctx.axes=null,this.ctx.annotations=null,this.ctx.core=null,this.ctx.data=null,this.ctx.grid=null,this.ctx.series=null,this.ctx.responsive=null,this.ctx.theme=null,this.ctx.formatters=null,this.ctx.titleSubtitle=null,this.ctx.legend=null,this.ctx.dimensions=null,this.ctx.options=null,this.ctx.crosshairs=null,this.ctx.zoomPanSelection=null,this.ctx.updateHelpers=null,this.ctx.toolbar=null,this.ctx.localization=null,this.ctx.w.globals.tooltip=null,this.clearDomElements()}},{key:"killSVG",value:function(t){t.each(function(t,e){this.removeClass("*"),this.off(),this.stop()},!0),t.ungroup(),t.clear()}},{key:"clearDomElements",value:function(){var e=this,t=this.w.globals.dom.Paper.node;t.parentNode&&t.parentNode.parentNode&&(t.parentNode.parentNode.style.minHeight="unset"),this.ctx.eventList.forEach(function(t){e.w.globals.dom.baseEl.removeEventListener(t,e.ctx.events.documentEvent)});var i=this.w.globals.dom;if(null!==this.ctx.el)for(;this.ctx.el.firstChild;)this.ctx.el.removeChild(this.ctx.el.firstChild);this.killSVG(i.Paper),i.Paper.remove(),i.elWrap=null,i.elGraphical=null,i.elAnnotations=null,i.elLegendWrap=null,i.baseEl=null,i.elGridRect=null,i.elGridRectMask=null,i.elGridRectMarkerMask=null,i.elDefs=null}}]),Ue);function Ue(t){a(this,Ue),this.ctx=t,this.w=t.w}function Ge(t){a(this,Ge),this.ctx=t,this.w=t.w}return r(Ke,[{key:"render",value:function(){var o=this;return new Promise(function(t,e){if(null!==o.el){void 0===Apex._chartInstances&&(Apex._chartInstances=[]),o.w.config.chart.id&&Apex._chartInstances.push({id:o.w.globals.chartID,group:o.w.config.chart.group,chart:o}),o.setLocale(o.w.config.chart.defaultLocale);var i=o.w.config.chart.events.beforeMount;"function"==typeof i&&i(o,o.w),o.events.fireEvent("beforeMount",[o,o.w]),window.addEventListener("resize",o.windowResizeHandler),window.addResizeListener(o.el.parentNode,o._parentResizeCallback.bind(o));var n=o.create(o.w.config.series,{});if(!n)return t(o);o.mount(n).then(function(){"function"==typeof o.w.config.chart.events.mounted&&o.w.config.chart.events.mounted(o,o.w),o.events.fireEvent("mounted",[o,o.w]),t(n)}).catch(function(t){e(t)})}else e(new Error("Element not found"))})}},{key:"create",value:function(t,e){var i=this.w;new $e(this).initModules();var n=this.w.globals;if(n.noData=!1,n.animationEnded=!1,this.responsive.checkResponsiveConfig(e),i.config.xaxis.convertedCatToNumeric&&new $(i.config).convertCatToNumericXaxis(i.config,this.ctx),null===this.el)return n.animationEnded=!0,null;if(this.core.setupElements(),0===n.svgWidth)return n.animationEnded=!0,null;var o=E.checkComboSeries(t);n.comboCharts=o.comboCharts,n.comboBarCount=o.comboBarCount;var a=t.every(function(t){return t.data&&0===t.data.length});0!==t.length&&!a||this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(t),this.theme.init(),new z(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),n.noData&&n.collapsedSeries.length!==n.series.length&&!i.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),n.axisCharts&&(this.core.coreCalculations(),"category"!==i.config.xaxis.type&&this.formatters.setLabelFormatters()),this.formatters.heatmapLabelFormatters(),this.dimensions.plotCoords();var r=this.core.xySettings();this.grid.createGridMask();var s=this.core.plotChartType(t,r),l=new B(this);l.bringForward(),i.config.dataLabels.background.enabled&&l.dataLabelsBackground(),this.core.shiftGraphPosition();var c={plot:{left:i.globals.translateX,top:i.globals.translateY,width:i.globals.gridWidth,height:i.globals.gridHeight}};return{elGraph:s,xyRatios:r,elInner:i.globals.dom.elGraphical,dimensions:c}}},{key:"mount",value:function(t){var s=this,l=0<arguments.length&&void 0!==t?t:null,c=this,h=c.w;return new Promise(function(t,e){if(null===c.el)return e(new Error("Not enough data to display or target element not found"));null!==l&&!h.globals.allSeriesCollapsed||c.series.handleNoData(),c.axes.drawAxis(h.config.chart.type,l.xyRatios),c.grid=new et(c);var i=c.grid.drawGrid();c.annotations=new D(c),c.annotations.drawImageAnnos(),c.annotations.drawTextAnnos(),"back"===h.config.grid.position&&i&&h.globals.dom.elGraphical.add(i.el);var n,o=new tt(s.ctx),a=new ot(s.ctx);if(null!==i&&(o.xAxisLabelCorrections(i.xAxisTickWidth),a.setYAxisTextAlignments()),"back"===h.config.annotations.position&&(h.globals.dom.Paper.add(h.globals.dom.elAnnotations),c.annotations.drawAxesAnnotations()),Array.isArray(l.elGraph))for(var r=0;r<l.elGraph.length;r++)h.globals.dom.elGraphical.add(l.elGraph[r]);else h.globals.dom.elGraphical.add(l.elGraph);"front"===h.config.grid.position&&i&&h.globals.dom.elGraphical.add(i.el),"front"===h.config.xaxis.crosshairs.position&&c.crosshairs.drawXCrosshairs(),"front"===h.config.yaxis[0].crosshairs.position&&c.crosshairs.drawYCrosshairs(),"front"===h.config.annotations.position&&(h.globals.dom.Paper.add(h.globals.dom.elAnnotations),c.annotations.drawAxesAnnotations()),h.globals.noData||(h.config.tooltip.enabled&&!h.globals.noData&&c.w.globals.tooltip.drawTooltip(l.xyRatios),h.globals.axisCharts&&(h.globals.isXNumeric||h.config.xaxis.convertedCatToNumeric)?(h.config.chart.zoom.enabled||h.config.chart.selection&&h.config.chart.selection.enabled||h.config.chart.pan&&h.config.chart.pan.enabled)&&c.zoomPanSelection.init({xyRatios:l.xyRatios}):(n=h.config.chart.toolbar.tools,["zoom","zoomin","zoomout","selection","pan","reset"].forEach(function(t){n[t]=!1})),h.config.chart.toolbar.show&&!h.globals.allSeriesCollapsed&&c.toolbar.createToolbar()),0<h.globals.memory.methodsToExec.length&&h.globals.memory.methodsToExec.forEach(function(t){t.method(t.params,!1,t.context)}),h.globals.axisCharts||h.globals.noData||c.core.resizeNonAxisCharts(),t(c)})}},{key:"destroy",value:function(){window.removeEventListener("resize",this.windowResizeHandler),window.removeResizeListener(this.el.parentNode,this._parentResizeCallback.bind(this));var i=this.w.config.chart.id;i&&Apex._chartInstances.forEach(function(t,e){t.id===i&&Apex._chartInstances.splice(e,1)}),new Ve(this.ctx).clear()}},{key:"updateOptions",value:function(t,e,i,n,o){var a=this,r=1<arguments.length&&void 0!==e&&e,s=!(2<arguments.length&&void 0!==i)||i,l=!(3<arguments.length&&void 0!==n)||n,c=!(4<arguments.length&&void 0!==o)||o,h=this.w;return h.globals.selection=void 0,t.series&&(this.series.resetSeries(!1,!0,!1),t.series.length&&t.series[0].data&&(t.series=t.series.map(function(t,e){return a.updateHelpers._extendSeries(t,e)})),this.updateHelpers.revertDefaultAxisMinMax()),t.xaxis&&(t=this.updateHelpers.forceXAxisUpdate(t)),t.yaxis&&(t=this.updateHelpers.forceYAxisUpdate(t)),0<h.globals.collapsedSeriesIndices.length&&this.series.clearPreviousPaths(),t.theme&&(t=this.theme.updateThemeOptions(t)),this.updateHelpers._updateOptions(t,r,s,l,c)}},{key:"updateSeries",value:function(t,e,i){var n=0<arguments.length&&void 0!==t?t:[],o=!(1<arguments.length&&void 0!==e)||e,a=!(2<arguments.length&&void 0!==i)||i;return this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(n,o,a)}},{key:"appendSeries",value:function(t,e,i){var n=!(1<arguments.length&&void 0!==e)||e,o=!(2<arguments.length&&void 0!==i)||i,a=this.w.config.series.slice();return a.push(t),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(a,n,o)}},{key:"appendData",value:function(t,e){var i=!(1<arguments.length&&void 0!==e)||e;this.w.globals.dataChanged=!0,this.series.getPreviousPaths();for(var n=this.w.config.series.slice(),o=0;o<n.length;o++)if(null!==t[o]&&void 0!==t[o])for(var a=0;a<t[o].data.length;a++)n[o].data.push(t[o].data[a]);return this.w.config.series=n,i&&(this.w.globals.initialSeries=L.clone(this.w.config.series)),this.update({series:this.w.config.series})}},{key:"update",value:function(n){var o=this;return new Promise(function(t,e){new Ve(o.ctx).clear();var i=o.create(o.w.config.series,n);if(!i)return t(o);o.mount(i).then(function(){"function"==typeof o.w.config.chart.events.updated&&o.w.config.chart.events.updated(o,o.w),o.events.fireEvent("updated",[o,o.w]),o.w.globals.isDirty=!0,t(o)}).catch(function(t){e(t)})})}},{key:"getSyncedCharts",value:function(){var t=this.getGroupedCharts(),e=[this];return t.length&&(e=[],t.forEach(function(t){e.push(t)})),e}},{key:"getGroupedCharts",value:function(){var e=this;return Apex._chartInstances.filter(function(t){if(t.group)return!0}).map(function(t){return e.w.config.chart.group===t.group?t.chart:e})}},{key:"toggleSeries",value:function(t){return this.series.toggleSeries(t)}},{key:"showSeries",value:function(t){this.series.showSeries(t)}},{key:"hideSeries",value:function(t){this.series.hideSeries(t)}},{key:"resetSeries",value:function(t,e){var i=!(0<arguments.length&&void 0!==t)||t,n=!(1<arguments.length&&void 0!==e)||e;this.series.resetSeries(i,n)}},{key:"addEventListener",value:function(t,e){this.events.addEventListener(t,e)}},{key:"removeEventListener",value:function(t,e){this.events.removeEventListener(t,e)}},{key:"addXaxisAnnotation",value:function(t,e,i){var n=!(1<arguments.length&&void 0!==e)||e,o=2<arguments.length&&void 0!==i?i:void 0,a=o||this;a.annotations.addXaxisAnnotationExternal(t,n,a)}},{key:"addYaxisAnnotation",value:function(t,e,i){var n=!(1<arguments.length&&void 0!==e)||e,o=2<arguments.length&&void 0!==i?i:void 0,a=o||this;a.annotations.addYaxisAnnotationExternal(t,n,a)}},{key:"addPointAnnotation",value:function(t,e,i){var n=!(1<arguments.length&&void 0!==e)||e,o=2<arguments.length&&void 0!==i?i:void 0,a=o||this;a.annotations.addPointAnnotationExternal(t,n,a)}},{key:"clearAnnotations",value:function(t){var e=0<arguments.length&&void 0!==t?t:void 0,i=e||this;i.annotations.clearAnnotations(i)}},{key:"removeAnnotation",value:function(t,e){var i=1<arguments.length&&void 0!==e?e:void 0,n=i||this;n.annotations.removeAnnotation(n,t)}},{key:"getChartArea",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner")}},{key:"getSeriesTotalXRange",value:function(t,e){return this.coreUtils.getSeriesTotalsXRange(t,e)}},{key:"getHighestValueInSeries",value:function(t){var e=0<arguments.length&&void 0!==t?t:0;return new nt(this.ctx).getMinYMaxY(e).highestY}},{key:"getLowestValueInSeries",value:function(t){var e=0<arguments.length&&void 0!==t?t:0;return new nt(this.ctx).getMinYMaxY(e).lowestY}},{key:"getSeriesTotal",value:function(){return this.w.globals.seriesTotals}},{key:"toggleDataPointSelection",value:function(t,e){return this.updateHelpers.toggleDataPointSelection(t,e)}},{key:"zoomX",value:function(t,e){this.ctx.toolbar.zoomUpdateOptions(t,e)}},{key:"setLocale",value:function(t){this.localization.setCurrentLocaleValues(t)}},{key:"dataURI",value:function(){return new J(this.ctx).dataURI()}},{key:"paper",value:function(){return this.w.globals.dom.Paper}},{key:"_parentResizeCallback",value:function(){!this.w.globals.noData&&this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}},{key:"_windowResize",value:function(){var t=this;clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout(function(){t.w.globals.resized=!0,t.w.globals.dataChanged=!1,t.ctx.update({series:t.w.config.series})},150)}}],[{key:"getChartByID",value:function(e){var t=Apex._chartInstances.filter(function(t){return t.id===e})[0];return t&&t.chart}},{key:"initOnLoad",value:function(){for(var t=document.querySelectorAll("[data-apexcharts]"),e=0;e<t.length;e++)new Ke(t[e],JSON.parse(t[e].getAttribute("data-options"))).render()}},{key:"exec",value:function(t,e){var i=this.getChartByID(t);if(i){i.w.globals.isExecCalled=!0;var n=null;if(-1!==i.publicMethods.indexOf(e)){for(var o=arguments.length,a=new Array(2<o?o-2:0),r=2;r<o;r++)a[r-2]=arguments[r];n=i[e].apply(i,a)}return n}}},{key:"merge",value:function(t,e){return L.extend(t,e)}}]),Ke;function Ke(t,e){a(this,Ke),this.opts=e,(this.ctx=this).w=new G(e).init(),this.el=t,this.w.globals.cuid=L.randomId(),this.w.globals.chartID=this.w.config.chart.id?this.w.config.chart.id:this.w.globals.cuid,new $e(this).initModules(),this.create=L.bind(this.create,this),this.windowResizeHandler=this._windowResize.bind(this)}}),function(u){u.sessionTimeout=function(t){function e(){clearTimeout(i),(l.countdownMessage||l.countdownBar)&&r("session",!0),"function"==typeof l.onStart&&l.onStart(l),l.keepAlive&&(h||(u.ajax({type:l.ajaxType,url:l.keepAliveUrl,data:l.ajaxData}),h=!0,setTimeout(function(){h=!1},l.keepAliveInterval))),i=setTimeout(function(){"function"!=typeof l.onWarn?u("#session-timeout-dialog").modal("show"):l.onWarn(l),clearTimeout(i),u("#session-timeout-dialog").hasClass("in")||!l.countdownMessage&&!l.countdownBar||r("dialog",!0),i=setTimeout(function(){"function"!=typeof l.onRedir?window.location=l.redirUrl:l.onRedir(l)},l.redirAfter-l.warnAfter)},l.warnAfter)}function r(t,e){clearTimeout(c.timer),"dialog"===t&&e?c.timeLeft=Math.floor((l.redirAfter-l.warnAfter)/1e3):"session"===t&&e&&(c.timeLeft=Math.floor(l.redirAfter/1e3)),l.countdownBar&&"dialog"===t?c.percentLeft=Math.floor(c.timeLeft/((l.redirAfter-l.warnAfter)/1e3)*100):l.countdownBar&&"session"===t&&(c.percentLeft=Math.floor(c.timeLeft/(l.redirAfter/1e3)*100));var i,n,o=u(".countdown-holder"),a=0<=c.timeLeft?c.timeLeft:0;l.countdownSmart?(0<(n=0<(i=Math.floor(a/60))?i+"m":"").length&&(n+=" "),n+=a%60+"s",o.text(n)):o.text(a+"s"),l.countdownBar&&u(".countdown-bar").css("width",c.percentLeft+"%"),c.timeLeft=c.timeLeft-1,c.timer=setTimeout(function(){r(t)},1e3)}var i,n,o,a,s={title:"Your Session is About to Expire!",message:"Your session is about to expire.",logoutButton:"Logout",keepAliveButton:"Stay Connected",keepAliveUrl:"/keep-alive",ajaxType:"POST",ajaxData:"",redirUrl:"/timed-out",logoutUrl:"/log-out",warnAfter:9e5,redirAfter:12e5,keepAliveInterval:5e3,keepAlive:!0,ignoreUserActivity:!1,onStart:!1,onWarn:!1,onRedir:!1,countdownMessage:!1,countdownBar:!1,countdownSmart:!1},l=s,c={};if(t&&(l=u.extend(s,t)),l.warnAfter>=l.redirAfter)return console.error('Bootstrap-session-timeout plugin is miss-configured. Option "redirAfter" must be equal or greater than "warnAfter".'),!1;"function"!=typeof l.onWarn&&(n=l.countdownMessage?"<p>"+l.countdownMessage.replace(/{timer}/g,'<span class="countdown-holder"></span>')+"</p>":"",o=l.countdownBar?'<div class="progress">                   <div class="progress-bar progress-bar-striped countdown-bar active" role="progressbar" style="min-width: 15px; width: 100%;">                     <span class="countdown-holder"></span>                   </div>                 </div>':"",u("body").append('<div class="modal fade" id="session-timeout-dialog">               <div class="modal-dialog">                 <div class="modal-content">                   <div class="modal-header">                     <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>                     <h4 class="modal-title">'+l.title+'</h4>                   </div>                   <div class="modal-body">                     <p>'+l.message+"</p>                     "+n+"                     "+o+'                   </div>                   <div class="modal-footer">                     <button id="session-timeout-dialog-logout" type="button" class="btn btn-default">'+l.logoutButton+'</button>                     <button id="session-timeout-dialog-keepalive" type="button" class="btn btn-primary" data-dismiss="modal">'+l.keepAliveButton+"</button>                   </div>                 </div>               </div>              </div>"),u("#session-timeout-dialog-logout").on("click",function(){window.location=l.logoutUrl}),u("#session-timeout-dialog").on("hide.bs.modal",function(){e()})),l.ignoreUserActivity||(a=[-1,-1],u(document).on("keyup mouseup mousemove touchend touchmove",function(t){if("mousemove"===t.type){if(t.clientX===a[0]&&t.clientY===a[1])return;a[0]=t.clientX,a[1]=t.clientY}e(),0<u("#session-timeout-dialog").length&&u("#session-timeout-dialog").data("bs.modal")&&u("#session-timeout-dialog").data("bs.modal").isShown&&(u("#session-timeout-dialog").modal("hide"),u("body").removeClass("modal-open"),u("div.modal-backdrop").remove())}));var h=!1;e()}}(jQuery),function(u){u.idleTimer=function(t,n){var e;"object"==_typeof2(t)?(e=t,t=null):"number"==typeof t&&(e={timeout:t},t=null),n=n||document,e=u.extend({idle:!1,timeout:3e4,events:"mousemove keydown wheel DOMMouseScroll mousewheel mousedown touchstart touchmove MSPointerDown MSPointerMove"},e);function i(t){var e=u.data(n,"idleTimerObj")||{};e.idle=!e.idle,e.olddate=+new Date;var i=u.Event((e.idle?"idle":"active")+".idleTimer");u(n).trigger(i,[n,u.extend({},e),t])}function o(t){var e=u.data(n,"idleTimerObj")||{};if(("storage"!==t.type||t.originalEvent.key===e.timerSyncId)&&null==e.remaining){if("mousemove"===t.type){if(t.pageX===e.pageX&&t.pageY===e.pageY)return;if(void 0===t.pageX&&void 0===t.pageY)return;if(new Date-e.olddate<200)return}clearTimeout(e.tId),e.idle&&i(t),e.lastActive=+new Date,e.pageX=t.pageX,e.pageY=t.pageY,"storage"!==t.type&&e.timerSyncId&&"undefined"!=typeof localStorage&&localStorage.setItem(e.timerSyncId,e.lastActive),e.tId=setTimeout(i,e.timeout)}}function a(){var t=u.data(n,"idleTimerObj")||{};t.idle=t.idleBackup,t.olddate=+new Date,t.lastActive=t.olddate,t.remaining=null,clearTimeout(t.tId),t.idle||(t.tId=setTimeout(i,t.timeout))}var r,s,l,c=u(n),h=c.data("idleTimerObj")||{};if(null===t&&void 0!==h.idle)return a(),c;if(null!==t){if(null!==t&&void 0===h.idle)return!1;if("destroy"===t)return l=u.data(n,"idleTimerObj")||{},clearTimeout(l.tId),c.removeData("idleTimerObj"),c.off("._idleTimer"),c;if("pause"===t)return null==(s=u.data(n,"idleTimerObj")||{}).remaining&&(s.remaining=s.timeout-(new Date-s.olddate),clearTimeout(s.tId)),c;if("resume"===t)return null!=(r=u.data(n,"idleTimerObj")||{}).remaining&&(r.idle||(r.tId=setTimeout(i,r.remaining)),r.remaining=null),c;if("reset"===t)return a(),c;if("getRemainingTime"===t)return function(){var t=u.data(n,"idleTimerObj")||{};if(t.idle)return 0;if(null!=t.remaining)return t.remaining;var e=t.timeout-(new Date-t.lastActive);return e<0&&(e=0),e}();if("getElapsedTime"===t)return new Date-h.olddate;if("getLastActiveTime"===t)return h.lastActive;if("isIdle"===t)return h.idle}return c.on(u.trim((e.events+" ").split(" ").join("._idleTimer ")),function(t){o(t)}),e.timerSyncId&&u(window).bind("storage",o),(h=u.extend({},{olddate:+new Date,lastActive:+new Date,idle:e.idle,idleBackup:e.idle,timeout:e.timeout,remaining:null,timerSyncId:e.timerSyncId,tId:null,pageX:null,pageY:null})).idle||(h.tId=setTimeout(i,h.timeout)),u.data(n,"idleTimerObj",h),c},u.fn.idleTimer=function(t){return this[0]?u.idleTimer(t,this[0]):this}}(jQuery),function(){var e=0,a={};function i(t){if(!t)throw new Error("No options passed to Waypoint constructor");if(!t.element)throw new Error("No element option passed to Waypoint constructor");if(!t.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=i.Adapter.extend({},i.defaults,t),this.element=this.options.element,this.adapter=new i.Adapter(this.element),this.callback=t.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=i.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=i.Context.findOrCreateByElement(this.options.context),i.offsetAliases[this.options.offset]&&(this.options.offset=i.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),a[this.key]=this,e+=1}i.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},i.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},i.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete a[this.key]},i.prototype.disable=function(){return this.enabled=!1,this},i.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},i.prototype.next=function(){return this.group.next(this)},i.prototype.previous=function(){return this.group.previous(this)},i.invokeAll=function(t){var e=[];for(var i in a)e.push(a[i]);for(var n=0,o=e.length;n<o;n++)e[n][t]()},i.destroyAll=function(){i.invokeAll("destroy")},i.disableAll=function(){i.invokeAll("disable")},i.enableAll=function(){for(var t in i.Context.refreshAll(),a)a[t].enabled=!0;return this},i.refreshAll=function(){i.Context.refreshAll()},i.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},i.viewportWidth=function(){return document.documentElement.clientWidth},i.adapters=[],i.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},i.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=i}(),function(){function e(t){window.setTimeout(t,1e3/60)}var i=0,n={},v=window.Waypoint,t=window.onload;function o(t){this.element=t,this.Adapter=v.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,n[t.waypointContextKey]=this,i+=1,v.windowContext||(v.windowContext=!0,v.windowContext=new o(window)),this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}o.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},o.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical),i=this.element==this.element.window;t&&e&&!i&&(this.adapter.off(".waypoints"),delete n[this.key])},o.prototype.createThrottledResizeHandler=function(){var t=this;function e(){t.handleResize(),t.didResize=!1}this.adapter.on("resize.waypoints",function(){t.didResize||(t.didResize=!0,v.requestAnimationFrame(e))})},o.prototype.createThrottledScrollHandler=function(){var t=this;function e(){t.handleScroll(),t.didScroll=!1}this.adapter.on("scroll.waypoints",function(){t.didScroll&&!v.isTouch||(t.didScroll=!0,v.requestAnimationFrame(e))})},o.prototype.handleResize=function(){v.Context.refreshAll()},o.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var n=e[i],o=n.newScroll>n.oldScroll?n.forward:n.backward;for(var a in this.waypoints[i]){var r,s,l=this.waypoints[i][a];null!==l.triggerPoint&&(r=n.oldScroll<l.triggerPoint,s=n.newScroll>=l.triggerPoint,(r&&s||!r&&!s)&&(l.queueTrigger(o),t[l.group.id]=l.group))}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},o.prototype.innerHeight=function(){return this.element==this.element.window?v.viewportHeight():this.adapter.innerHeight()},o.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},o.prototype.innerWidth=function(){return this.element==this.element.window?v.viewportWidth():this.adapter.innerWidth()},o.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var n=0,o=t.length;n<o;n++)t[n].destroy()},o.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),n={};for(var o in this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}}){var a=t[o];for(var r in this.waypoints[o]){var s,l,c,h,u=this.waypoints[o][r],d=u.options.offset,f=u.triggerPoint,p=0,g=null==f;u.element!==u.element.window&&(p=u.adapter.offset()[a.offsetProp]),"function"==typeof d?d=d.apply(u):"string"==typeof d&&(d=parseFloat(d),-1<u.options.offset.indexOf("%")&&(d=Math.ceil(a.contextDimension*d/100))),s=a.contextScroll-a.contextOffset,u.triggerPoint=Math.floor(p+s-d),l=f<a.oldScroll,c=u.triggerPoint>=a.oldScroll,h=!l&&!c,!g&&(l&&c)?(u.queueTrigger(a.backward),n[u.group.id]=u.group):(!g&&h||g&&a.oldScroll>=u.triggerPoint)&&(u.queueTrigger(a.forward),n[u.group.id]=u.group)}}return v.requestAnimationFrame(function(){for(var t in n)n[t].flushTriggers()}),this},o.findOrCreateByElement=function(t){return o.findByElement(t)||new o(t)},o.refreshAll=function(){for(var t in n)n[t].refresh()},o.findByElement=function(t){return n[t.waypointContextKey]},window.onload=function(){t&&t(),o.refreshAll()},v.requestAnimationFrame=function(t){(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||e).call(window,t)},v.Context=o}(),function(){function r(t,e){return t.triggerPoint-e.triggerPoint}function s(t,e){return e.triggerPoint-t.triggerPoint}var e={vertical:{},horizontal:{}},i=window.Waypoint;function n(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),e[this.axis][this.name]=this}n.prototype.add=function(t){this.waypoints.push(t)},n.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},n.prototype.flushTriggers=function(){for(var t in this.triggerQueues){var e=this.triggerQueues[t],i="up"===t||"left"===t;e.sort(i?s:r);for(var n=0,o=e.length;n<o;n+=1){var a=e[n];!a.options.continuous&&n!==e.length-1||a.trigger([t])}}this.clearTriggerQueues()},n.prototype.next=function(t){this.waypoints.sort(r);var e=i.Adapter.inArray(t,this.waypoints);return e===this.waypoints.length-1?null:this.waypoints[e+1]},n.prototype.previous=function(t){this.waypoints.sort(r);var e=i.Adapter.inArray(t,this.waypoints);return e?this.waypoints[e-1]:null},n.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},n.prototype.remove=function(t){var e=i.Adapter.inArray(t,this.waypoints);-1<e&&this.waypoints.splice(e,1)},n.prototype.first=function(){return this.waypoints[0]},n.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},n.findOrCreate=function(t){return e[t.axis][t.name]||new n(t)},i.Group=n}(),function(){var i=window.jQuery,t=window.Waypoint;function n(t){this.$element=i(t)}i.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(t,e){n.prototype[e]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[e].apply(this.$element,t)}}),i.each(["extend","inArray","isEmptyObject"],function(t,e){n[e]=i[e]}),t.adapters.push({name:"jquery",Adapter:n}),t.Adapter=n}(),function(){var o=window.Waypoint;function t(n){return function(){var e=[],i=arguments[0];return n.isFunction(arguments[0])&&((i=n.extend({},arguments[1])).handler=arguments[0]),this.each(function(){var t=n.extend({},i,{element:this});"string"==typeof t.context&&(t.context=n(this).closest(t.context)[0]),e.push(new o(t))}),e}}window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(),function(i){i.fn.counterUp=function(t){var e=i.extend({time:400,delay:10},t);return this.each(function(){var l=i(this),c=e;l.waypoint(function(){for(var t=c.time/c.delay,e=[n=l.attr("data-value")],i=/[0-9]+,[0-9]+/.test(n),n=n.replace(/,/g,""),o=(/^[0-9]+$/.test(n),/^[0-9]+\.[0-9]+$/.test(n)),a=o?(n.split(".")[1]||[]).length:0,r=t;1<=r;r--){var s=parseInt(n/t*r);if(o&&(s=parseFloat(n/t*r).toFixed(a)),i)for(;/(\d+)(\d{3})/.test(s.toString());)s=s.toString().replace(/(\d+)(\d{3})/,"$1,$2");e.unshift(s)}l.data("counterup-nums",e),l.text("0");l.data("counterup-func",function(){l.data("counterup-nums")&&(l.text(l.data("counterup-nums").shift()),l.data("counterup-nums").length?setTimeout(l.data("counterup-func"),c.delay):(l.data("counterup-nums"),l.data("counterup-nums",null),l.data("counterup-func",null)))}),setTimeout(l.data("counterup-func"),c.delay)},{offset:"100%",triggerOnce:!0})})}}(jQuery),function(t){function i(){for(var t=0;t<C.length;t++)C[t][0](C[t][1]);m=!(C=[])}function n(t,e){C.push([t,e]),m||(m=!0,k(i,0))}function e(t,e){function i(t){l(e,t)}try{t(function(t){r(e,t)},i)}catch(t){i(t)}}function o(e){var t=(i=e.owner).state_,i=i.data_,n=e[t];if(e=e.then,"function"==typeof n){t=x;try{i=n(i)}catch(t){l(e,t)}}a(e,i)||(t===x&&r(e,i),t===w&&l(e,i))}function a(e,i){var n;try{if(e===i)throw new TypeError("A promises callback cannot return that same promise.");if(i&&("function"==typeof i||"object"===_typeof2(i))){var t=i.then;if("function"==typeof t)return t.call(i,function(t){n||(n=!0,(i!==t?r:s)(e,t))},function(t){n||(n=!0,l(e,t))}),1}}catch(t){return n||l(e,t),1}}function r(t,e){t!==e&&a(t,e)||s(t,e)}function s(t,e){t.state_===b&&(t.state_=y,t.data_=e,n(h,t))}function l(t,e){t.state_===b&&(t.state_=y,t.data_=e,n(u,t))}function c(t){var e=t.then_;for(t.then_=void 0,t=0;t<e.length;t++)o(e[t])}function h(t){t.state_=x,c(t)}function u(t){t.state_=w,c(t)}function d(t){if("function"!=typeof t)throw new TypeError("Promise constructor takes a function argument");if(!1==this instanceof d)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this.then_=[],e(t,this)}var f,p=t.Promise,g=p&&"resolve"in p&&"reject"in p&&"all"in p&&"race"in p&&(new p(function(t){f=t}),"function"==typeof f);"undefined"!=typeof exports&&exports?(exports.Promise=g?p:d,exports.Polyfill=d):"function"==typeof define&&define.amd?define(function(){return g?p:d}):g||(t.Promise=d);function v(){}var m,b="pending",y="sealed",x="fulfilled",w="rejected",k="undefined"!=typeof setImmediate?setImmediate:setTimeout,C=[];d.prototype={constructor:d,state_:b,then_:null,data_:void 0,then:function(t,e){var i={owner:this,then:new this.constructor(v),fulfilled:t,rejected:e};return this.state_===x||this.state_===w?n(o,i):this.then_.push(i),i.then},catch:function(t){return this.then(null,t)}},d.all=function(r){if("[object Array]"!==Object.prototype.toString.call(r))throw new TypeError("You must pass an array to Promise.all().");return new this(function(i,t){for(var e,n=[],o=0,a=0;a<r.length;a++)(e=r[a])&&"function"==typeof e.then?e.then(function(e){return o++,function(t){n[e]=t,--o||i(n)}}(a),t):n[a]=e;o||i(n)})},d.race=function(o){if("[object Array]"!==Object.prototype.toString.call(o))throw new TypeError("You must pass an array to Promise.race().");return new this(function(t,e){for(var i,n=0;n<o.length;n++)(i=o[n])&&"function"==typeof i.then?i.then(t,e):t(i)})},d.resolve=function(e){return e&&"object"===_typeof2(e)&&e.constructor===this?e:new this(function(t){t(e)})},d.reject=function(i){return new this(function(t,e){e(i)})}}("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0),function(t,e){"object"==("undefined"==typeof exports?"undefined":_typeof2(exports))&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Sweetalert2=e()}(void 0,function(){function a(t){return(a="function"==typeof Symbol&&"symbol"==_typeof2(Symbol.iterator)?function(t){return _typeof2(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":_typeof2(t)})(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function s(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}function d(){return(d=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t}).apply(this,arguments)}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function o(t,e,i){return(o=h()?Reflect.construct:function(t,e,i){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return i&&c(o,i.prototype),o}).apply(null,arguments)}function u(t,e,i){return(u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=l(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function f(e){return Object.keys(e).map(function(t){return e[t]})}function p(t){return Array.prototype.slice.call(t)}function g(t){return t&&"function"==typeof t.toPromise}function v(t){return g(t)?t.toPromise():Promise.resolve(t)}function m(t){return t&&Promise.resolve(t)===t}function b(t){return t instanceof Element||"object"===a(e=t)&&e.jquery;var e}function t(t){var e={};for(var i in t)e[t[i]]="swal2-"+t[i];return e}function y(t){var e=V();return e?e.querySelector(t):null}function e(t){return y(".".concat(t))}function i(){return p(U().querySelectorAll(".".concat(W.icon)))}function x(){var t=i().filter(function(t){return pt(t)});return t.length?t[0]:null}function w(){return e(W.title)}function I(){return e(W.content)}function k(){return e(W.image)}function C(){return e(W["progress-steps"])}function A(){return e(W["validation-message"])}function M(){return y(".".concat(W.actions," .").concat(W.confirm))}function D(){return y(".".concat(W.actions," .").concat(W.cancel))}function R(){return e(W.actions)}function S(){return e(W.header)}function z(){return e(W.footer)}function T(){return e(W["timer-progress-bar"])}function E(){return e(W.close)}function _(){var t=p(U().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort(function(t,e){return t=parseInt(t.getAttribute("tabindex")),(e=parseInt(e.getAttribute("tabindex")))<t?1:t<e?-1:0}),e=p(U().querySelectorAll('\n  a[href],\n  area[href],\n  input:not([disabled]),\n  select:not([disabled]),\n  textarea:not([disabled]),\n  button:not([disabled]),\n  iframe,\n  object,\n  embed,\n  [tabindex="0"],\n  [contenteditable],\n  audio[controls],\n  video[controls],\n  summary\n')).filter(function(t){return"-1"!==t.getAttribute("tabindex")});return function(t){for(var e=[],i=0;i<t.length;i++)-1===e.indexOf(t[i])&&e.push(t[i]);return e}(t.concat(e)).filter(function(t){return pt(t)})}function O(){return!G()&&!document.body.classList.contains(W["no-backdrop"])}function j(){return U().hasAttribute("data-loading")}function L(e,t){var i;e.textContent="",t&&(p((i=(new DOMParser).parseFromString(t,"text/html")).querySelector("head").childNodes).forEach(function(t){e.appendChild(t)}),p(i.querySelector("body").childNodes).forEach(function(t){e.appendChild(t)}))}function P(t,e){if(e){for(var i=e.split(/\s+/),n=0;n<i.length;n++)if(!t.classList.contains(i[n]))return;return 1}}function B(t,e,i){var n,o=e;if(p((n=t).classList).forEach(function(t){-1===f(W).indexOf(t)&&-1===f($).indexOf(t)&&-1===f(o.showClass).indexOf(t)&&n.classList.remove(t)}),e.customClass&&e.customClass[i]){if("string"!=typeof e.customClass[i]&&!e.customClass[i].forEach)return H("Invalid type of customClass.".concat(i,'! Expected string or iterable object, got "').concat(a(e.customClass[i]),'"'));ut(t,e.customClass[i])}}function N(t){return"function"==typeof t?t():t}var F="SweetAlert2:",H=function(t){console.warn("".concat(F," ").concat(t))},X=function(t){console.error("".concat(F," ").concat(t))},Y=[],q=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),W=t(["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","toast-column","show","hide","close","title","header","content","html-container","actions","confirm","cancel","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"]),$=t(["success","warning","info","question","error"]),V=function(){return document.body.querySelector(".".concat(W.container))},U=function(){return e(W.popup)},G=function(){return document.body.classList.contains(W["toast-shown"])},K={previousBodyPadding:null};function Z(t,e){if(!e)return null;switch(e){case"select":case"textarea":case"file":return ft(t,W[e]);case"checkbox":return t.querySelector(".".concat(W.checkbox," input"));case"radio":return t.querySelector(".".concat(W.radio," input:checked"))||t.querySelector(".".concat(W.radio," input:first-child"));case"range":return t.querySelector(".".concat(W.range," input"));default:return ft(t,W.input)}}function Q(t){var e;t.focus(),"file"!==t.type&&(e=t.value,t.value="",t.value=e)}function J(t,e,i){t&&e&&("string"==typeof e&&(e=e.split(/\s+/).filter(Boolean)),e.forEach(function(e){t.forEach?t.forEach(function(t){i?t.classList.add(e):t.classList.remove(e)}):i?t.classList.add(e):t.classList.remove(e)}))}function tt(t,e,i){i||0===parseInt(i)?t.style[e]="number"==typeof i?"".concat(i,"px"):i:t.style.removeProperty(e)}function et(t,e){var i=1<arguments.length&&void 0!==e?e:"flex";t.style.opacity="",t.style.display=i}function it(t){t.style.opacity="",t.style.display="none"}function nt(t,e,i){e?et(t,i):it(t)}function ot(t){return t.scrollHeight>t.clientHeight}function at(t){var e=window.getComputedStyle(t),i=parseFloat(e.getPropertyValue("animation-duration")||"0"),n=parseFloat(e.getPropertyValue("transition-duration")||"0");return 0<i||0<n}function rt(t,e){var i=1<arguments.length&&void 0!==e&&e,n=T();pt(n)&&(i&&(n.style.transition="none",n.style.width="100%"),setTimeout(function(){n.style.transition="width ".concat(t/1e3,"s linear"),n.style.width="0%"},10))}function st(){return"undefined"==typeof window||"undefined"==typeof document}function lt(t){Re.isVisible()&&ht!==t.target.value&&Re.resetValidationMessage(),ht=t.target.value}function ct(t,e){t instanceof HTMLElement?e.appendChild(t):"object"===a(t)?vt(t,e):t&&L(e,t)}var ht,ut=function(t,e){J(t,e,!0)},dt=function(t,e){J(t,e,!1)},ft=function(t,e){for(var i=0;i<t.childNodes.length;i++)if(P(t.childNodes[i],e))return t.childNodes[i]},pt=function(t){return!(!t||!(t.offsetWidth||t.offsetHeight||t.getClientRects().length))},gt='\n <div aria-labelledby="'.concat(W.title,'" aria-describedby="').concat(W.content,'" class="').concat(W.popup,'" tabindex="-1">\n   <div class="').concat(W.header,'">\n     <ul class="').concat(W["progress-steps"],'"></ul>\n     <div class="').concat(W.icon," ").concat($.error,'"></div>\n     <div class="').concat(W.icon," ").concat($.question,'"></div>\n     <div class="').concat(W.icon," ").concat($.warning,'"></div>\n     <div class="').concat(W.icon," ").concat($.info,'"></div>\n     <div class="').concat(W.icon," ").concat($.success,'"></div>\n     <img class="').concat(W.image,'" />\n     <h2 class="').concat(W.title,'" id="').concat(W.title,'"></h2>\n     <button type="button" class="').concat(W.close,'"></button>\n   </div>\n   <div class="').concat(W.content,'">\n     <div id="').concat(W.content,'" class="').concat(W["html-container"],'"></div>\n     <input class="').concat(W.input,'" />\n     <input type="file" class="').concat(W.file,'" />\n     <div class="').concat(W.range,'">\n       <input type="range" />\n       <output></output>\n     </div>\n     <select class="').concat(W.select,'"></select>\n     <div class="').concat(W.radio,'"></div>\n     <label for="').concat(W.checkbox,'" class="').concat(W.checkbox,'">\n       <input type="checkbox" />\n       <span class="').concat(W.label,'"></span>\n     </label>\n     <textarea class="').concat(W.textarea,'"></textarea>\n     <div class="').concat(W["validation-message"],'" id="').concat(W["validation-message"],'"></div>\n   </div>\n   <div class="').concat(W.actions,'">\n     <button type="button" class="').concat(W.confirm,'">OK</button>\n     <button type="button" class="').concat(W.cancel,'">Cancel</button>\n   </div>\n   <div class="').concat(W.footer,'"></div>\n   <div class="').concat(W["timer-progress-bar-container"],'">\n     <div class="').concat(W["timer-progress-bar"],'"></div>\n   </div>\n </div>\n').replace(/(^|\n)\s*/g,""),vt=function(t,e){t.jquery?mt(e,t):L(e,t.toString())},mt=function(t,e){if(t.textContent="",0 in e)for(var i=0;i in e;i++)t.appendChild(e[i].cloneNode(!0));else t.appendChild(e.cloneNode(!0))},bt=function(){if(st())return!1;var t=document.createElement("div"),e={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&void 0!==t.style[i])return e[i];return!1}();function yt(t,e,i){var n;nt(t,i["show".concat((n=e).charAt(0).toUpperCase()+n.slice(1),"Button")],"inline-block"),L(t,i["".concat(e,"ButtonText")]),t.setAttribute("aria-label",i["".concat(e,"ButtonAriaLabel")]),t.className=W[e],B(t,i,"".concat(e,"Button")),ut(t,i["".concat(e,"ButtonClass")])}function xt(t,e){t.placeholder&&!e.inputPlaceholder||(t.placeholder=e.inputPlaceholder)}var wt={promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap},kt=["input","file","range","select","radio","checkbox","textarea"],Ct=function(t){if(!Et[t.input])return X('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(t.input,'"'));var e=Tt(t.input),i=Et[t.input](e,t);et(i),setTimeout(function(){Q(i)})},At=function(t,e){var i=Z(I(),t);if(i)for(var n in function(t){for(var e=0;e<t.attributes.length;e++){var i=t.attributes[e].name;-1===["type","value","style"].indexOf(i)&&t.removeAttribute(i)}}(i),e)"range"===t&&"placeholder"===n||i.setAttribute(n,e[n])},St=function(t){var e=Tt(t.input);t.customClass&&ut(e,t.customClass.input)},Tt=function(t){var e=W[t]?W[t]:W.input;return ft(I(),e)},Et={};function _t(){return V()&&V().getAttribute("data-queue-step")}function Ot(t,e){var i,n,o,a,r,s,l;B(S(),e,"header"),function(s){var l=C();if(!s.progressSteps||0===s.progressSteps.length)return it(l);et(l),l.textContent="";var c=parseInt(void 0===s.currentProgressStep?_t():s.currentProgressStep);c>=s.progressSteps.length&&H("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),s.progressSteps.forEach(function(t,e){var i,n,o,a,r=(i=t,n=document.createElement("li"),ut(n,W["progress-step"]),L(n,i),n);l.appendChild(r),e===c&&ut(r,W["active-progress-step"]),e!==s.progressSteps.length-1&&(o=s,a=document.createElement("li"),ut(a,W["progress-step-line"]),o.progressStepsDistance&&(a.style.width=o.progressStepsDistance),l.appendChild(a))})}(e),i=e,(o=wt.innerParams.get(t))&&i.icon===o.icon&&x()?B(x(),i,"icon"):(Nt(),i.icon&&(-1!==Object.keys($).indexOf(i.icon)?(et(n=y(".".concat(W.icon,".").concat($[i.icon]))),Mt(n,i),It(),B(n,i,"icon"),ut(n,i.showClass.icon)):X('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(i.icon,'"')))),function(t){var e=k();if(!t.imageUrl)return it(e);et(e,""),e.setAttribute("src",t.imageUrl),e.setAttribute("alt",t.imageAlt),tt(e,"width",t.imageWidth),tt(e,"height",t.imageHeight),e.className=W.image,B(e,t,"image")}(e),a=e,nt(r=w(),a.title||a.titleText),a.title&&ct(a.title,r),a.titleText&&(r.innerText=a.titleText),B(r,a,"title"),s=e,L(l=E(),s.closeButtonHtml),B(l,s,"closeButton"),nt(l,s.showCloseButton),l.setAttribute("aria-label",s.closeButtonAriaLabel)}function Lt(t,e){var i,n,o,a,r,s,l,c,h,u,d,f,p,g,v,m,b,y,x,w,k,C,A,S,T,E,_,O=e,L=U();tt(L,"width",O.width),tt(L,"padding",O.padding),O.background&&(L.style.background=O.background),P=L,N=O,P.className="".concat(W.popup," ").concat(pt(P)?N.showClass.popup:""),N.toast?(ut([document.documentElement,document.body],W["toast-shown"]),ut(P,W.toast)):ut(P,W.modal),B(P,N,"popup"),"string"==typeof N.customClass&&ut(P,N.customClass),N.icon&&ut(P,W["icon-".concat(N.icon)]),x=e,(_=V())&&("string"==typeof(w=x.backdrop)?_.style.background=w:w||ut([document.documentElement,document.body],W["no-backdrop"]),!x.backdrop&&x.allowOutsideClick&&H('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),k=_,(C=x.position)in W?ut(k,W[C]):(H('The "position" parameter is not valid, defaulting to "center"'),ut(k,W.center)),A=_,!(S=x.grow)||"string"!=typeof S||(T="grow-".concat(S))in W&&ut(A,W[T]),B(_,x,"container"),(E=document.body.getAttribute("data-swal2-queue-step"))&&(_.setAttribute("data-queue-step",E),document.body.removeAttribute("data-swal2-queue-step"))),Ot(t,e),d=t,f=e,y=I().querySelector("#".concat(W.content)),f.html?(ct(f.html,y),et(y,"block")):f.text?(y.textContent=f.text,et(y,"block")):it(y),p=d,g=f,v=I(),m=wt.innerParams.get(p),b=!m||g.input!==m.input,kt.forEach(function(t){var e=W[t],i=ft(v,e);At(t,g.inputAttributes),i.className=e,b&&it(i)}),g.input&&(b&&Ct(g),St(g)),B(I(),f,"content"),o=e,c=R(),h=M(),u=D(),o.showConfirmButton||o.showCancelButton||it(c),B(c,o,"actions"),yt(h,"confirm",o),yt(u,"cancel",o),o.buttonsStyling?(s=o,ut([a=h,r=u],W.styled),s.confirmButtonColor&&(a.style.backgroundColor=s.confirmButtonColor),s.cancelButtonColor&&(r.style.backgroundColor=s.cancelButtonColor),j()||(l=window.getComputedStyle(a).getPropertyValue("background-color"),a.style.borderLeftColor=l,a.style.borderRightColor=l)):(dt([h,u],W.styled),h.style.backgroundColor=h.style.borderLeftColor=h.style.borderRightColor="",u.style.backgroundColor=u.style.borderLeftColor=u.style.borderRightColor=""),o.reverseButtons&&h.parentNode.insertBefore(u,h),i=e,nt(n=z(),i.footer),i.footer&&ct(i.footer,n),B(n,i,"footer"),"function"==typeof e.onRender&&e.onRender(U());var P,N}function Pt(){return M()&&M().click()}Et.text=Et.email=Et.password=Et.number=Et.tel=Et.url=function(t,e){return"string"==typeof e.inputValue||"number"==typeof e.inputValue?t.value=e.inputValue:m(e.inputValue)||H('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(a(e.inputValue),'"')),xt(t,e),t.type=e.input,t},Et.file=function(t,e){return xt(t,e),t},Et.range=function(t,e){var i=t.querySelector("input"),n=t.querySelector("output");return i.value=e.inputValue,i.type=e.input,n.value=e.inputValue,t},Et.select=function(t,e){var i;return t.textContent="",e.inputPlaceholder&&(L(i=document.createElement("option"),e.inputPlaceholder),i.value="",i.disabled=!0,i.selected=!0,t.appendChild(i)),t},Et.radio=function(t){return t.textContent="",t},Et.checkbox=function(t,e){var i=Z(I(),"checkbox");return i.value=1,i.id=W.checkbox,i.checked=Boolean(e.inputValue),L(t.querySelector("span"),e.inputPlaceholder),t},Et.textarea=function(e,t){var i,n;return e.value=t.inputValue,xt(e,t),"MutationObserver"in window&&(i=parseInt(window.getComputedStyle(U()).width),n=parseInt(window.getComputedStyle(U()).paddingLeft)+parseInt(window.getComputedStyle(U()).paddingRight),new MutationObserver(function(){var t=e.offsetWidth+n;U().style.width=i<t?"".concat(t,"px"):null}).observe(e,{attributes:!0,attributeFilter:["style"]})),e};var Nt=function(){for(var t=i(),e=0;e<t.length;e++)it(t[e])},It=function(){for(var t=U(),e=window.getComputedStyle(t).getPropertyValue("background-color"),i=t.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix"),n=0;n<i.length;n++)i[n].style.backgroundColor=e},Mt=function(t,e){t.textContent="",e.iconHtml?L(t,Dt(e.iconHtml)):"success"===e.icon?L(t,'\n      <div class="swal2-success-circular-line-left"></div>\n      <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n      <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>\n      <div class="swal2-success-circular-line-right"></div>\n    '):"error"===e.icon?L(t,'\n      <span class="swal2-x-mark">\n        <span class="swal2-x-mark-line-left"></span>\n        <span class="swal2-x-mark-line-right"></span>\n      </span>\n    '):L(t,Dt({question:"?",warning:"!",info:"i"}[e.icon]))},Dt=function(t){return'<div class="'.concat(W["icon-content"],'">').concat(t,"</div>")},Rt=[];function zt(){var t=U();t||Re.fire(),t=U();var e=R(),i=M();et(e),et(i,"inline-block"),ut([t,e],W.loading),i.disabled=!0,t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()}function jt(){if(Yt.timeout)return function(){var t=T(),e=parseInt(window.getComputedStyle(t).width);t.style.removeProperty("transition"),t.style.width="100%";var i=parseInt(window.getComputedStyle(t).width),n=parseInt(e/i*100);t.style.removeProperty("transition"),t.style.width="".concat(n,"%")}(),Yt.timeout.stop()}function Bt(){if(Yt.timeout){var t=Yt.timeout.start();return rt(t),t}}function Ft(t){return Object.prototype.hasOwnProperty.call(qt,t)}function Ht(t){return $t[t]}function Xt(t){for(var e in t)Ft(s=e)||H('Unknown parameter "'.concat(s,'"')),t.toast&&(r=e,-1!==Vt.indexOf(r)&&H('The parameter "'.concat(r,'" is incompatible with toasts'))),Ht(a=e)&&(n=Ht(i=a),o='"'.concat(i,'" is deprecated and will be removed in the next major release. Please use "').concat(n,'" instead.'),-1===Y.indexOf(o)&&(Y.push(o),H(o)));var i,n,o,a,r,s}var Yt={},qt={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconHtml:void 0,toast:!1,animation:!0,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:void 0,target:"body",backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showCancelButton:!1,preConfirm:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusCancel:!1,showCloseButton:!1,closeButtonHtml:"&times;",closeButtonAriaLabel:"Close this dialog",showLoaderOnConfirm:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,onBeforeOpen:void 0,onOpen:void 0,onRender:void 0,onClose:void 0,onAfterClose:void 0,onDestroy:void 0,scrollbarPadding:!0},Wt=["title","titleText","text","html","footer","icon","hideClass","customClass","allowOutsideClick","allowEscapeKey","showConfirmButton","showCancelButton","confirmButtonText","confirmButtonAriaLabel","confirmButtonColor","cancelButtonText","cancelButtonAriaLabel","cancelButtonColor","buttonsStyling","reverseButtons","showCloseButton","closeButtonHtml","closeButtonAriaLabel","imageUrl","imageWidth","imageHeight","imageAlt","progressSteps","currentProgressStep","onClose","onAfterClose","onDestroy"],$t={animation:'showClass" and "hideClass'},Vt=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusCancel","heightAuto","keydownListenerCapture"],Ut=Object.freeze({isValidParameter:Ft,isUpdatableParameter:function(t){return-1!==Wt.indexOf(t)},isDeprecatedParameter:Ht,argsToParams:function(n){var o={};return"object"!==a(n[0])||b(n[0])?["title","html","icon"].forEach(function(t,e){var i=n[e];"string"==typeof i||b(i)?o[t]=i:void 0!==i&&X("Unexpected type of ".concat(t,'! Expected "string" or "Element", got ').concat(a(i)))}):d(o,n[0]),o},isVisible:function(){return pt(U())},clickConfirm:Pt,clickCancel:function(){return D()&&D().click()},getContainer:V,getPopup:U,getTitle:w,getContent:I,getHtmlContainer:function(){return e(W["html-container"])},getImage:k,getIcon:x,getIcons:i,getCloseButton:E,getActions:R,getConfirmButton:M,getCancelButton:D,getHeader:S,getFooter:z,getTimerProgressBar:T,getFocusableElements:_,getValidationMessage:A,isLoading:j,fire:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return o(this,e)},mixin:function(n){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}(i,t);var o,a,e=(o=i,a=h(),function(){var t,e,i,n=l(o);return e=this,!(i=a?(t=l(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments))||"object"!=_typeof2(i)&&"function"!=typeof i?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(e):i});function i(){return r(this,i),e.apply(this,arguments)}return s(i,[{key:"_main",value:function(t){return u(l(i.prototype),"_main",this).call(this,d({},n,t))}}]),i}(this)},queue:function(t){var a=this;function r(t,e){Rt=[],t(e)}Rt=t;var s=[];return new Promise(function(o){!function e(i,n){i<Rt.length?(document.body.setAttribute("data-swal2-queue-step",i),a.fire(Rt[i]).then(function(t){void 0!==t.value?(s.push(t.value),e(i+1,n)):r(o,{dismiss:t.dismiss})})):r(o,{value:s})}(0)})},getQueueStep:_t,insertQueueStep:function(t,e){return e&&e<Rt.length?Rt.splice(e,0,t):Rt.push(t)},deleteQueueStep:function(t){void 0!==Rt[t]&&Rt.splice(t,1)},showLoading:zt,enableLoading:zt,getTimerLeft:function(){return Yt.timeout&&Yt.timeout.getTimerLeft()},stopTimer:jt,resumeTimer:Bt,toggleTimer:function(){var t=Yt.timeout;return t&&(t.running?jt:Bt)()},increaseTimer:function(t){if(Yt.timeout){var e=Yt.timeout.increase(t);return rt(e,!0),e}},isTimerRunning:function(){return Yt.timeout&&Yt.timeout.isRunning()}});function Gt(){var t,e=wt.innerParams.get(this);e&&(t=wt.domCache.get(this),e.showConfirmButton||(it(t.confirmButton),e.showCancelButton||it(t.actions)),dt([t.popup,t.actions],W.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.cancelButton.disabled=!1)}function Kt(){return window.MSInputMethodContext&&document.documentMode}function Zt(){var t=V(),e=U();t.style.removeProperty("align-items"),e.offsetTop<0&&(t.style.alignItems="flex-start")}var Qt=function(t){var e=V();return t===e||!(ot(e)||"INPUT"===t.tagName||ot(I())&&I().contains(t))},Jt={swalPromiseResolve:new WeakMap};function te(t,e,i,n){var o;i?ie(t,n):(new Promise(function(t){var e=window.scrollX,i=window.scrollY;Yt.restoreFocusTimeout=setTimeout(function(){Yt.previousActiveElement&&Yt.previousActiveElement.focus?(Yt.previousActiveElement.focus(),Yt.previousActiveElement=null):document.body&&document.body.focus(),t()},100),void 0!==e&&void 0!==i&&window.scrollTo(e,i)}).then(function(){return ie(t,n)}),Yt.keydownTarget.removeEventListener("keydown",Yt.keydownHandler,{capture:Yt.keydownListenerCapture}),Yt.keydownHandlerAdded=!1),e.parentNode&&!document.body.getAttribute("data-swal2-queue-step")&&e.parentNode.removeChild(e),O()&&(null!==K.previousBodyPadding&&(document.body.style.paddingRight="".concat(K.previousBodyPadding,"px"),K.previousBodyPadding=null),P(document.body,W.iosfix)&&(o=parseInt(document.body.style.top,10),dt(document.body,W.iosfix),document.body.style.top="",document.body.scrollTop=-1*o),"undefined"!=typeof window&&Kt()&&window.removeEventListener("resize",Zt),p(document.body.children).forEach(function(t){t.hasAttribute("data-previous-aria-hidden")?(t.setAttribute("aria-hidden",t.getAttribute("data-previous-aria-hidden")),t.removeAttribute("data-previous-aria-hidden")):t.removeAttribute("aria-hidden")})),dt([document.documentElement,document.body],[W.shown,W["height-auto"],W["no-backdrop"],W["toast-shown"],W["toast-column"]])}function ee(t){var e,i,n,o=U();o&&(e=wt.innerParams.get(this))&&!P(o,e.hideClass.popup)&&(i=Jt.swalPromiseResolve.get(this),dt(o,e.showClass.popup),ut(o,e.hideClass.popup),n=V(),dt(n,e.showClass.backdrop),ut(n,e.hideClass.backdrop),function(t,e,i){var n=V(),o=bt&&at(e),a=i.onClose,r=i.onAfterClose;null!==a&&"function"==typeof a&&a(e),o?(s=t,l=e,c=n,h=r,Yt.swalCloseEventFinishedCallback=te.bind(null,s,c,G(),h),l.addEventListener(bt,function(t){t.target===l&&(Yt.swalCloseEventFinishedCallback(),delete Yt.swalCloseEventFinishedCallback)})):te(t,n,G(),r);var s,l,c,h}(this,o,e),void 0!==t?(t.isDismissed=void 0!==t.dismiss,t.isConfirmed=void 0===t.dismiss):t={isDismissed:!0,isConfirmed:!1},i(t||{}))}var ie=function(t,e){setTimeout(function(){"function"==typeof e&&e(),t._destroy()})};function ne(t,e,i){var n=wt.domCache.get(t);e.forEach(function(t){n[t].disabled=i})}function oe(t,e){if(!t)return!1;if("radio"===t.type)for(var i=t.parentNode.parentNode.querySelectorAll("input"),n=0;n<i.length;n++)i[n].disabled=e;else t.disabled=e}var ae=(s(se,[{key:"start",value:function(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}},{key:"stop",value:function(){return this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=new Date-this.started),this.remaining}},{key:"increase",value:function(t){var e=this.running;return e&&this.stop(),this.remaining+=t,e&&this.start(),this.remaining}},{key:"getTimerLeft",value:function(){return this.running&&(this.stop(),this.start()),this.remaining}},{key:"isRunning",value:function(){return this.running}}]),se),re={email:function(t,e){return/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid email address")},url:function(t,e){return/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid URL")}};function se(t,e){r(this,se),this.callback=t,this.remaining=e,this.running=!1,this.start()}function le(t){var e,i,n,o,a,r,s,l,c,h,u,d,f,p,g,v,m,b;(e=t).inputValidator||Object.keys(re).forEach(function(t){e.input===t&&(e.inputValidator=re[t])}),t.showLoaderOnConfirm&&!t.preConfirm&&H("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),t.animation=N(t.animation),(i=t).target&&("string"!=typeof i.target||document.querySelector(i.target))&&("string"==typeof i.target||i.target.appendChild)||(H('Target parameter is not valid, defaulting to "body"'),i.target="body"),"string"==typeof t.title&&(t.title=t.title.split("\n").join("<br />")),n=t,b=!!(o=V())&&(o.parentNode.removeChild(o),dt([document.documentElement,document.body],[W["no-backdrop"],W["toast-shown"],W["has-column"]]),!0),st()?X("SweetAlert2 requires document to initialize"):((a=document.createElement("div")).className=W.container,b&&ut(a,W["no-transition"]),L(a,gt),(r="string"==typeof(s=n.target)?document.querySelector(s):s).appendChild(a),l=n,(c=U()).setAttribute("role",l.toast?"alert":"dialog"),c.setAttribute("aria-live",l.toast?"polite":"assertive"),l.toast||c.setAttribute("aria-modal","true"),"rtl"===window.getComputedStyle(r).direction&&ut(V(),W.rtl),h=I(),u=ft(h,W.input),d=ft(h,W.file),f=h.querySelector(".".concat(W.range," input")),p=h.querySelector(".".concat(W.range," output")),g=ft(h,W.select),v=h.querySelector(".".concat(W.checkbox," input")),m=ft(h,W.textarea),u.oninput=lt,d.onchange=lt,g.onchange=lt,v.onchange=lt,m.oninput=lt,f.oninput=function(t){lt(t),p.value=f.value},f.onchange=function(t){lt(t),f.nextSibling.value=f.value})}function ce(t){var e=V(),i=U();"function"==typeof t.onBeforeOpen&&t.onBeforeOpen(i);var n=window.getComputedStyle(document.body).overflowY;h=e,u=i,d=t,ut(h,d.showClass.backdrop),et(u),ut(u,d.showClass.popup),ut([document.documentElement,document.body],W.shown),d.heightAuto&&d.backdrop&&!d.toast&&ut([document.documentElement,document.body],W["height-auto"]),l=e,c=i,bt&&at(c)?(l.style.overflowY="hidden",c.addEventListener(bt,he)):l.style.overflowY="auto",O()&&(o=e,a=t.scrollbarPadding,r=n,(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||"MacIntel"===navigator.platform&&1<navigator.maxTouchPoints)&&!P(document.body,W.iosfix)&&(s=document.body.scrollTop,document.body.style.top="".concat(-1*s,"px"),ut(document.body,W.iosfix),function(){var e,t=V();t.ontouchstart=function(t){e=Qt(t.target)},t.ontouchmove=function(t){e&&(t.preventDefault(),t.stopPropagation())}}(),navigator.userAgent.match(/(CriOS|FxiOS|EdgiOS|YaBrowser|UCBrowser)/i)||U().scrollHeight>window.innerHeight-44&&(V().style.paddingBottom="".concat(44,"px"))),"undefined"!=typeof window&&Kt()&&(Zt(),window.addEventListener("resize",Zt)),!a||"hidden"===r||null===K.previousBodyPadding&&document.body.scrollHeight>window.innerHeight&&(K.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(K.previousBodyPadding+function(){var t=document.createElement("div");t.className=W["scrollbar-measure"],document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e}(),"px")),setTimeout(function(){o.scrollTop=0}),p(document.body.children).forEach(function(t){var e,i;t===V()||(e=t,i=V(),"function"==typeof e.contains&&e.contains(i))||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")),t.setAttribute("aria-hidden","true"))})),G()||Yt.previousActiveElement||(Yt.previousActiveElement=document.activeElement),"function"==typeof t.onOpen&&setTimeout(function(){return t.onOpen(i)}),dt(e,W["no-transition"]);var o,a,r,s;var l,c;var h,u,d}function he(t){var e,i=U();t.target===i&&(e=V(),i.removeEventListener(bt,he),e.style.overflowY="auto")}function ue(t,e){"select"===e.input||"radio"===e.input?function(e,i){function n(t){return ke[i.input](o,Ce(t),i)}var o=I();g(i.inputOptions)||m(i.inputOptions)?(zt(),v(i.inputOptions).then(function(t){e.hideLoading(),n(t)})):"object"===a(i.inputOptions)?n(i.inputOptions):X("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(a(i.inputOptions)))}(t,e):-1!==["text","email","number","tel","textarea"].indexOf(e.input)&&(g(e.inputValue)||m(e.inputValue))&&function(e,i){var n=e.getInput();it(n),v(i.inputValue).then(function(t){n.value="number"===i.input?parseFloat(t)||0:"".concat(t),et(n),n.focus(),e.hideLoading()})["catch"](function(t){X("Error in inputValue promise: ".concat(t)),n.value="",et(n),n.focus(),e.hideLoading()})}(t,e)}function de(t,e){t.disableButtons(),e.input?function(e,i){var n=function(t,e){var i=t.getInput();if(!i)return null;switch(e.input){case"checkbox":return me(i);case"radio":return be(i);case"file":return ye(i);default:return e.inputAutoTrim?i.value.trim():i.value}}(e,i);i.inputValidator?(e.disableInput(),Promise.resolve().then(function(){return v(i.inputValidator(n,i.validationMessage))}).then(function(t){e.enableButtons(),e.enableInput(),t?e.showValidationMessage(t):Ae(e,i,n)})):e.getInput().checkValidity()?Ae(e,i,n):(e.enableButtons(),e.showValidationMessage(i.validationMessage))}(t,e):Ae(t,e,!0)}function fe(t,e){t.closePopup({value:e})}function pe(e,t,i,n){t.keydownTarget&&t.keydownHandlerAdded&&(t.keydownTarget.removeEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!1),i.toast||(t.keydownHandler=function(t){return function(t,e,i){var n=wt.innerParams.get(t);n.stopKeydownPropagation&&e.stopPropagation(),"Enter"===e.key?Ee(t,e,n):"Tab"===e.key?_e(e,n):-1!==Se.indexOf(e.key)?Oe():-1!==Te.indexOf(e.key)&&Le(e,n,i)}(e,t,n)},t.keydownTarget=i.keydownListenerCapture?window:U(),t.keydownListenerCapture=i.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)}function ge(t,e,i){var n=_();if(0<n.length)return(e+=i)===n.length?e=0:-1===e&&(e=n.length-1),n[e].focus();U().focus()}function ve(t,e,i){wt.innerParams.get(t).toast?function(e,t,i){t.popup.onclick=function(){var t=wt.innerParams.get(e);t.showConfirmButton||t.showCancelButton||t.showCloseButton||t.input||i(q.close)}}(t,e,i):(function(e){e.popup.onmousedown=function(){e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(Pe=!0)}}}(e),function(e){e.container.onmousedown=function(){e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,t.target!==e.popup&&!e.popup.contains(t.target)||(Pe=!0)}}}(e),function(i,n,o){n.container.onclick=function(t){var e=wt.innerParams.get(i);Pe?Pe=!1:t.target===n.container&&N(e.allowOutsideClick)&&o(q.backdrop)}}(t,e,i))}function me(t){return t.checked?1:0}function be(t){return t.checked?t.value:null}function ye(t){return t.files.length?null!==t.getAttribute("multiple")?t.files:t.files[0]:null}function xe(t){for(var e in t)t[e]=new WeakMap}var we,ke={select:function(t,e,o){function a(t,e,i){var n=document.createElement("option");n.value=i,L(n,e),o.inputValue.toString()===i.toString()&&(n.selected=!0),t.appendChild(n)}var r=ft(t,W.select);e.forEach(function(t){var e,i=t[0],n=t[1];Array.isArray(n)?((e=document.createElement("optgroup")).label=i,e.disabled=!1,r.appendChild(e),n.forEach(function(t){return a(e,t[1],t[0])})):a(r,n,i)}),r.focus()},radio:function(t,e,r){var s=ft(t,W.radio);e.forEach(function(t){var e=t[0],i=t[1],n=document.createElement("input"),o=document.createElement("label");n.type="radio",n.name=W.radio,n.value=e,r.inputValue.toString()===e.toString()&&(n.checked=!0);var a=document.createElement("span");L(a,i),a.className=W.label,o.appendChild(n),o.appendChild(a),s.appendChild(o)});var i=s.querySelectorAll("input");i.length&&i[0].focus()}},Ce=function n(i){var o=[];return"undefined"!=typeof Map&&i instanceof Map?i.forEach(function(t,e){var i=t;"object"===a(i)&&(i=n(i)),o.push([e,i])}):Object.keys(i).forEach(function(t){var e=i[t];"object"===a(e)&&(e=n(e)),o.push([t,e])}),o},Ae=function(e,t,i){t.showLoaderOnConfirm&&zt(),t.preConfirm?(e.resetValidationMessage(),Promise.resolve().then(function(){return v(t.preConfirm(i,t.validationMessage))}).then(function(t){pt(A())||!1===t?e.hideLoading():fe(e,void 0===t?i:t)})):fe(e,i)},Se=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Left","Right","Up","Down"],Te=["Escape","Esc"],Ee=function(t,e,i){if(!e.isComposing&&e.target&&t.getInput()&&e.target.outerHTML===t.getInput().outerHTML){if(-1!==["textarea","file"].indexOf(i.input))return;Pt(),e.preventDefault()}},_e=function(t){for(var e=t.target,i=_(),n=-1,o=0;o<i.length;o++)if(e===i[o]){n=o;break}t.shiftKey?ge(0,n,-1):ge(0,n,1),t.stopPropagation(),t.preventDefault()},Oe=function(){var t=M(),e=D();document.activeElement===t&&pt(e)?e.focus():document.activeElement===e&&pt(t)&&t.focus()},Le=function(t,e,i){N(e.allowEscapeKey)&&(t.preventDefault(),i(q.esc))},Pe=!1,Ne=function(){document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()},Ie=Object.freeze({hideLoading:Gt,disableLoading:Gt,getInput:function(t){var e=wt.innerParams.get(t||this),i=wt.domCache.get(t||this);return i?Z(i.content,e.input):null},close:ee,closePopup:ee,closeModal:ee,closeToast:ee,enableButtons:function(){ne(this,["confirmButton","cancelButton"],!1)},disableButtons:function(){ne(this,["confirmButton","cancelButton"],!0)},enableInput:function(){return oe(this.getInput(),!1)},disableInput:function(){return oe(this.getInput(),!0)},showValidationMessage:function(t){var e=wt.domCache.get(this);L(e.validationMessage,t);var i=window.getComputedStyle(e.popup);e.validationMessage.style.marginLeft="-".concat(i.getPropertyValue("padding-left")),e.validationMessage.style.marginRight="-".concat(i.getPropertyValue("padding-right")),et(e.validationMessage);var n=this.getInput();n&&(n.setAttribute("aria-invalid",!0),n.setAttribute("aria-describedBy",W["validation-message"]),Q(n),ut(n,W.inputerror))},resetValidationMessage:function(){var t=wt.domCache.get(this);t.validationMessage&&it(t.validationMessage);var e=this.getInput();e&&(e.removeAttribute("aria-invalid"),e.removeAttribute("aria-describedBy"),dt(e,W.inputerror))},getProgressSteps:function(){return wt.domCache.get(this).progressSteps},_main:function(t){Xt(t),Yt.currentInstance&&Yt.currentInstance._destroy(),Yt.currentInstance=this;var e,i,n,o,a=(e=t,i=d({},qt.showClass,e.showClass),n=d({},qt.hideClass,e.hideClass),(o=d({},qt,e)).showClass=i,o.hideClass=n,!1===e.animation&&(o.showClass={popup:"swal2-noanimation",backdrop:"swal2-noanimation"},o.hideClass={}),o);le(a),Object.freeze(a),Yt.timeout&&(Yt.timeout.stop(),delete Yt.timeout),clearTimeout(Yt.restoreFocusTimeout);var r,s,l,c,h,u=(r=this,s={popup:U(),container:V(),content:I(),actions:R(),confirmButton:M(),cancelButton:D(),closeButton:E(),validationMessage:A(),progressSteps:C()},wt.domCache.set(r,s),s);return Lt(this,a),wt.innerParams.set(this,a),l=this,c=u,h=a,new Promise(function(t){function e(t){l.closePopup({dismiss:t})}var i,n,o,a;Jt.swalPromiseResolve.set(l,t),c.confirmButton.onclick=function(){return de(l,h)},c.cancelButton.onclick=function(){return t=e,l.disableButtons(),void t(q.cancel);var t},c.closeButton.onclick=function(){return e(q.close)},ve(l,c,e),pe(l,Yt,h,e),(h.toast&&(h.input||h.footer||h.showCloseButton)?ut:dt)(document.body,W["toast-column"]),ue(l,h),ce(h),i=Yt,n=h,o=e,it(a=T()),n.timer&&(i.timeout=new ae(function(){o("timer"),delete i.timeout},n.timer),n.timerProgressBar&&(et(a),setTimeout(function(){i.timeout.running&&rt(n.timer)}))),function(t,e){e.toast||(N(e.allowEnterKey)?e.focusCancel&&pt(t.cancelButton)?t.cancelButton.focus():e.focusConfirm&&pt(t.confirmButton)?t.confirmButton.focus():ge(0,-1,1):Ne())}(c,h),setTimeout(function(){c.container.scrollTop=0})})},update:function(e){var t=U(),i=wt.innerParams.get(this);if(!t||P(t,i.hideClass.popup))return H("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");var n={};Object.keys(e).forEach(function(t){Re.isUpdatableParameter(t)?n[t]=e[t]:H('Invalid parameter to update: "'.concat(t,'". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js'))});var o=d({},i,n);Lt(this,o),wt.innerParams.set(this,o),Object.defineProperties(this,{params:{value:d({},this.params,e),writable:!1,enumerable:!0}})},_destroy:function(){var t=wt.domCache.get(this),e=wt.innerParams.get(this);e&&(t.popup&&Yt.swalCloseEventFinishedCallback&&(Yt.swalCloseEventFinishedCallback(),delete Yt.swalCloseEventFinishedCallback),Yt.deferDisposalTimer&&(clearTimeout(Yt.deferDisposalTimer),delete Yt.deferDisposalTimer),"function"==typeof e.onDestroy&&e.onDestroy(),delete this.params,delete Yt.keydownHandler,delete Yt.keydownTarget,xe(wt),xe(Jt))}}),Me=(s(De,[{key:"then",value:function(t){return wt.promise.get(this).then(t)}},{key:"finally",value:function(t){return wt.promise.get(this).finally(t)}}]),De);function De(){if(r(this,De),"undefined"!=typeof window){"undefined"==typeof Promise&&X("This package requires a Promise library, please include a shim to enable it in this browser (See: https://github.com/sweetalert2/sweetalert2/wiki/Migration-from-SweetAlert-to-SweetAlert2#1-ie-support)"),we=this;for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var n=Object.freeze(this.constructor.argsToParams(e));Object.defineProperties(this,{params:{value:n,writable:!1,enumerable:!0,configurable:!0}});var o=this._main(this.params);wt.promise.set(this,o)}}d(Me.prototype,Ie),d(Me,Ut),Object.keys(Ie).forEach(function(t){Me[t]=function(){if(we)return we[t].apply(we,arguments)}}),Me.DismissReason=q,Me.version="9.17.1";var Re=Me;return Re.default=Re}),swal.mixin({width:400,heightAuto:!1,padding:"2.5rem",buttonsStyling:!1,confirmButtonClass:"btn btn-success",confirmButtonColor:null,cancelButtonClass:"btn btn-secondary",cancelButtonColor:null});var Sticky=function(){function i(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,i),this.selector=t,this.elements=[],this.version="1.3.0",this.vp=this.getViewportSize(),this.body=document.querySelector("body"),this.options={wrap:e.wrap||!1,wrapWith:e.wrapWith||"<span></span>",marginTop:e.marginTop||0,marginBottom:e.marginBottom||0,stickyFor:e.stickyFor||0,stickyClass:e.stickyClass||null,stickyContainer:e.stickyContainer||"body"},this.updateScrollTopPosition=this.updateScrollTopPosition.bind(this),this.updateScrollTopPosition(),window.addEventListener("load",this.updateScrollTopPosition),window.addEventListener("scroll",this.updateScrollTopPosition),this.run()}return _createClass(i,[{key:"run",value:function(){var e=this,i=setInterval(function(){var t;"complete"===document.readyState&&(clearInterval(i),t=document.querySelectorAll(e.selector),e.forEach(t,function(t){return e.renderElement(t)}))},10)}},{key:"renderElement",value:function(t){var e=this;t.sticky={},t.sticky.active=!1,t.sticky.marginTop=parseInt(t.getAttribute("data-margin-top"))||this.options.marginTop,t.sticky.marginBottom=parseInt(t.getAttribute("data-margin-bottom"))||this.options.marginBottom,t.sticky.stickyFor=parseInt(t.getAttribute("data-sticky-for"))||this.options.stickyFor,t.sticky.stickyClass=t.getAttribute("data-sticky-class")||this.options.stickyClass,t.sticky.wrap=!!t.hasAttribute("data-sticky-wrap")||this.options.wrap,t.sticky.stickyContainer=this.options.stickyContainer,t.sticky.container=this.getStickyContainer(t),t.sticky.container.rect=this.getRectangle(t.sticky.container),t.sticky.rect=this.getRectangle(t),"img"===t.tagName.toLowerCase()&&(t.onload=function(){return t.sticky.rect=e.getRectangle(t)}),t.sticky.wrap&&this.wrapElement(t),this.activate(t)}},{key:"wrapElement",value:function(t){t.insertAdjacentHTML("beforebegin",t.getAttribute("data-sticky-wrapWith")||this.options.wrapWith),t.previousSibling.appendChild(t)}},{key:"activate",value:function(t){t.sticky.rect.top+t.sticky.rect.height<t.sticky.container.rect.top+t.sticky.container.rect.height&&t.sticky.stickyFor<this.vp.width&&!t.sticky.active&&(t.sticky.active=!0),this.elements.indexOf(t)<0&&this.elements.push(t),t.sticky.resizeEvent||(this.initResizeEvents(t),t.sticky.resizeEvent=!0),t.sticky.scrollEvent||(this.initScrollEvents(t),t.sticky.scrollEvent=!0),this.setPosition(t)}},{key:"initResizeEvents",value:function(t){var e=this;t.sticky.resizeListener=function(){return e.onResizeEvents(t)},window.addEventListener("resize",t.sticky.resizeListener)}},{key:"destroyResizeEvents",value:function(t){window.removeEventListener("resize",t.sticky.resizeListener)}},{key:"onResizeEvents",value:function(t){this.vp=this.getViewportSize(),t.sticky.rect=this.getRectangle(t),t.sticky.container.rect=this.getRectangle(t.sticky.container),t.sticky.rect.top+t.sticky.rect.height<t.sticky.container.rect.top+t.sticky.container.rect.height&&t.sticky.stickyFor<this.vp.width&&!t.sticky.active?t.sticky.active=!0:(t.sticky.rect.top+t.sticky.rect.height>=t.sticky.container.rect.top+t.sticky.container.rect.height||t.sticky.stickyFor>=this.vp.width&&t.sticky.active)&&(t.sticky.active=!1),this.setPosition(t)}},{key:"initScrollEvents",value:function(t){var e=this;t.sticky.scrollListener=function(){return e.onScrollEvents(t)},window.addEventListener("scroll",t.sticky.scrollListener)}},{key:"destroyScrollEvents",value:function(t){window.removeEventListener("scroll",t.sticky.scrollListener)}},{key:"onScrollEvents",value:function(t){t.sticky&&t.sticky.active&&this.setPosition(t)}},{key:"setPosition",value:function(t){this.css(t,{position:"",width:"",top:"",left:""}),this.vp.height<t.sticky.rect.height||!t.sticky.active||(t.sticky.rect.width||(t.sticky.rect=this.getRectangle(t)),t.sticky.wrap&&this.css(t.parentNode,{display:"block",width:t.sticky.rect.width+"px",height:t.sticky.rect.height+"px"}),0===t.sticky.rect.top&&t.sticky.container===this.body?(this.css(t,{position:"fixed",top:t.sticky.rect.top+"px",left:t.sticky.rect.left+"px",width:t.sticky.rect.width+"px"}),t.sticky.stickyClass&&t.classList.add(t.sticky.stickyClass)):this.scrollTop>t.sticky.rect.top-t.sticky.marginTop?(this.css(t,{position:"fixed",width:t.sticky.rect.width+"px",left:t.sticky.rect.left+"px"}),this.scrollTop+t.sticky.rect.height+t.sticky.marginTop>t.sticky.container.rect.top+t.sticky.container.offsetHeight-t.sticky.marginBottom?(t.sticky.stickyClass&&t.classList.remove(t.sticky.stickyClass),this.css(t,{top:t.sticky.container.rect.top+t.sticky.container.offsetHeight-(this.scrollTop+t.sticky.rect.height+t.sticky.marginBottom)+"px"})):(t.sticky.stickyClass&&t.classList.add(t.sticky.stickyClass),this.css(t,{top:t.sticky.marginTop+"px"}))):(t.sticky.stickyClass&&t.classList.remove(t.sticky.stickyClass),this.css(t,{position:"",width:"",top:"",left:""}),t.sticky.wrap&&this.css(t.parentNode,{display:"",width:"",height:""})))}},{key:"update",value:function(){var e=this;this.forEach(this.elements,function(t){t.sticky.rect=e.getRectangle(t),t.sticky.container.rect=e.getRectangle(t.sticky.container),e.activate(t),e.setPosition(t)})}},{key:"destroy",value:function(){var e=this;window.removeEventListener("load",this.updateScrollTopPosition),window.removeEventListener("scroll",this.updateScrollTopPosition),this.forEach(this.elements,function(t){e.destroyResizeEvents(t),e.destroyScrollEvents(t),delete t.sticky})}},{key:"getStickyContainer",value:function(t){for(var e=t.parentNode;!e.hasAttribute("data-sticky-container")&&!e.parentNode.querySelector(t.sticky.stickyContainer)&&e!==this.body;)e=e.parentNode;return e}},{key:"getRectangle",value:function(t){this.css(t,{position:"",width:"",top:"",left:""});for(var e=Math.max(t.offsetWidth,t.clientWidth,t.scrollWidth),i=Math.max(t.offsetHeight,t.clientHeight,t.scrollHeight),n=0,o=0;n+=t.offsetTop||0,o+=t.offsetLeft||0,t=t.offsetParent;);return{top:n,left:o,width:e,height:i}}},{key:"getViewportSize",value:function(){return{width:Math.max(document.documentElement.clientWidth,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight,window.innerHeight||0)}}},{key:"updateScrollTopPosition",value:function(){this.scrollTop=(window.pageYOffset||document.scrollTop)-(document.clientTop||0)||0}},{key:"forEach",value:function(t,e){for(var i=0,n=t.length;i<n;i++)e(t[i])}},{key:"css",value:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t.style[i]=e[i])}}]),i}();!function(t){"undefined"!=typeof exports?module.exports=t:"function"==typeof define&&define.amd?define([],function(){return t}):(void 0).Sticky=t}(Sticky);var identity=function(t){return t},isArray=function(t){return $.isArray(t)},isObject=function(t){return!isArray(t)&&t instanceof Object},isNumber=function(t){return t instanceof Number},isFunction=function(t){return t instanceof Function},indexOf=function(t,e){return $.inArray(e,t)},inArray=function(t,e){return-1!==indexOf(t,e)},foreach=function(t,e){for(var i in t)t.hasOwnProperty(i)&&e(t[i],i,t)},last=function(t){return t[t.length-1]},argumentsToArray=function(t){return Array.prototype.slice.call(t)},extend=function(){var i={};return foreach(argumentsToArray(arguments),function(t){foreach(t,function(t,e){i[e]=t})}),i},mapToArray=function(t,n){var o=[];return foreach(t,function(t,e,i){o.push(n(t,e,i))}),o},mapToObject=function(t,n,o){var a={};return foreach(t,function(t,e,i){e=o?o(e,t):e,a[e]=n(t,e,i)}),a},map=function(t,e,i){return isArray(t)?mapToArray(t,e):mapToObject(t,e,i)},pluck=function(t,e){return map(t,function(t){return t[e]})},filter=function(t,n){var o;return isArray(t)?(o=[],foreach(t,function(t,e,i){n(t,e,i)&&o.push(t)})):(o={},foreach(t,function(t,e,i){n(t,e,i)&&(o[e]=t)})),o},call=function(t,i,n){return map(t,function(t,e){return t[i].apply(t,n||[])})},throttle=function(e,i){var n=null;return function(){var t=arguments;null===n&&(n=setTimeout(function(){n=null},e),i.apply(this,t))}},mixinPubSub=function(t){var n={};return(t=t||{}).publish=function(t,e){foreach(n[t],function(t){t(e)})},t.subscribe=function(t,e){n[t]=n[t]||[],n[t].push(e)},t.unsubscribe=function(i){foreach(n,function(t){var e=indexOf(t,i);-1!==e&&t.splice(e,1)})},t};!function(s){function o(t,n){var o,a=mixinPubSub(),e=t.$;return a.getType=function(){throw'implement me (return type. "text", "radio", etc.)'},a.$=function(t){return t?e.find(t):e},a.disable=function(){a.$().prop("disabled",!0),a.publish("isEnabled",!1)},a.enable=function(){a.$().prop("disabled",!1),a.publish("isEnabled",!0)},n.equalTo=function(t,e){return t===e},n.publishChange=function(t,e){var i=a.get();n.equalTo(i,o)||a.publish("change",{e:t,domElement:e}),o=i},a}function n(t,e){var i=o(t,e);return i.get=function(){return i.$().val()},i.set=function(t){i.$().val(t)},i.clear=function(){i.set("")},e.buildSetter=function(e){return function(t){e.call(i,t)}},i}function a(t,e){t=isArray(t)?t:[t],e=isArray(e)?e:[e];var i=!0;return t.length!==e.length?i=!1:foreach(t,function(t){inArray(e,t)||(i=!1)}),i}function l(t){var e={},i=n(t,e);return i.getType=function(){return"button"},i.$().on("change",function(t){e.publishChange(t,this)}),i}function c(t){var e={},i=n(t,e);return i.getType=function(){return"checkbox"},i.get=function(){var t=[];return i.$().filter(":checked").each(function(){t.push(s(this).val())}),t},i.set=function(t){t=isArray(t)?t:[t],i.$().each(function(){s(this).prop("checked",!1)}),foreach(t,function(t){i.$().filter('[value="'+t+'"]').prop("checked",!0)})},e.equalTo=a,i.$().change(function(t){e.publishChange(t,this)}),i}function h(t){var e=w(t,{});return e.getType=function(){return"email"},e}function u(t){var e={},i=o(t,e);return i.getType=function(){return"file"},i.get=function(){return last(i.$().val().split("\\"))},i.clear=function(){this.$().each(function(){s(this).wrap("<form>").closest("form").get(0).reset(),s(this).unwrap()})},i.$().change(function(t){e.publishChange(t,this)}),i}function d(t){var e={},i=n(t,e);return i.getType=function(){return"hidden"},i.$().change(function(t){e.publishChange(t,this)}),i}function f(t){var e={},n=o(t,e);return n.getType=function(){return"file[multiple]"},n.get=function(){for(var t=n.$().get(0).files||[],e=[],i=0;i<(t.length||0);i+=1)e.push(t[i].name);return e},n.clear=function(){this.$().each(function(){s(this).wrap("<form>").closest("form").get(0).reset(),s(this).unwrap()})},n.$().change(function(t){e.publishChange(t,this)}),n}function p(t){var e={},i=n(t,e);return i.getType=function(){return"select[multiple]"},i.get=function(){return i.$().val()||[]},i.set=function(t){i.$().val(""===t?[]:isArray(t)?t:[t])},e.equalTo=a,i.$().change(function(t){e.publishChange(t,this)}),i}function g(t){var e=w(t,{});return e.getType=function(){return"password"},e}function v(t){var e={},i=n(t,e);return i.getType=function(){return"radio"},i.get=function(){return i.$().filter(":checked").val()||null},i.set=function(t){t?i.$().filter('[value="'+t+'"]').prop("checked",!0):i.$().each(function(){s(this).prop("checked",!1)})},i.$().change(function(t){e.publishChange(t,this)}),i}function m(t){var e={},i=n(t,e);return i.getType=function(){return"range"},i.$().change(function(t){e.publishChange(t,this)}),i}function b(t){var e={},i=n(t,e);return i.getType=function(){return"select"},i.$().change(function(t){e.publishChange(t,this)}),i}function y(t){var e={},i=n(t,e);return i.getType=function(){return"textarea"},i.$().on("change keyup keydown",function(t){e.publishChange(t,this)}),i}function x(t){var e=w(t,{});return e.getType=function(){return"url"},e}function r(t){function e(e,t){(isObject(t)?t:a.find(t)).each(function(){var t=s(this).attr("name");o[t]=r[e]({$:s(this)})})}function i(e,t){var i=[],n=isObject(t)?t:a.find(t);isObject(t)?o[n.attr("name")]=r[e]({$:n}):(n.each(function(){-1===indexOf(i,s(this).attr("name"))&&i.push(s(this).attr("name"))}),foreach(i,function(t){o[t]=r[e]({$:a.find('input[name="'+t+'"]')})}))}var o={},a=t.$,r=t.constructorOverride||{button:l,text:w,url:x,email:h,password:g,range:m,textarea:y,select:b,"select[multiple]":p,radio:v,checkbox:c,file:u,"file[multiple]":f,hidden:d};return a.is("input, select, textarea")?a.is('input[type="button"], button, input[type="submit"]')?e("button",a):a.is("textarea")?e("textarea",a):a.is('input[type="text"]')||a.is("input")&&!a.attr("type")?e("text",a):a.is('input[type="password"]')?e("password",a):a.is('input[type="email"]')?e("email",a):a.is('input[type="url"]')?e("url",a):a.is('input[type="range"]')?e("range",a):a.is("select")?a.is("[multiple]")?e("select[multiple]",a):e("select",a):a.is('input[type="file"]')?a.is("[multiple]")?e("file[multiple]",a):e("file",a):a.is('input[type="hidden"]')?e("hidden",a):a.is('input[type="radio"]')?i("radio",a):a.is('input[type="checkbox"]')?i("checkbox",a):e("text",a):(e("button",'input[type="button"], button, input[type="submit"]'),e("text",'input[type="text"]'),e("password",'input[type="password"]'),e("email",'input[type="email"]'),e("url",'input[type="url"]'),e("range",'input[type="range"]'),e("textarea","textarea"),e("select","select:not([multiple])"),e("select[multiple]","select[multiple]"),e("file",'input[type="file"]:not([multiple])'),e("file[multiple]",'input[type="file"][multiple]'),e("hidden",'input[type="hidden"]'),i("radio",'input[type="radio"]'),i("checkbox",'input[type="checkbox"]')),o}var w=function(t){var e={},i=n(t,e);return i.getType=function(){return"text"},i.$().on("change keyup keydown",function(t){e.publishChange(t,this)}),i};s.fn.inputVal=function(t){var e=s(this),i=r({$:e});return e.is("input, textarea, select")?void 0===t?i[e.attr("name")].get():(i[e.attr("name")].set(t),e):void 0===t?call(i,"get"):(foreach(t,function(t,e){i[e].set(t)}),e)},s.fn.inputOnChange=function(e){var t=s(this),i=r({$:t});return foreach(i,function(t){t.subscribe("change",function(t){e.call(t.domElement,t.e)})}),t},s.fn.inputDisable=function(){var t=s(this);return call(r({$:t}),"disable"),t},s.fn.inputEnable=function(){var t=s(this);return call(r({$:t}),"enable"),t},s.fn.inputClear=function(){var t=s(this);return call(r({$:t}),"clear"),t}}(jQuery),$.fn.repeaterVal=function(){var t,n;return function i(t){if(1===t.length&&(0===t[0].key.length||1===t[0].key.length&&!t[0].key[0]))return t[0].val;foreach(t,function(t){t.head=t.key.shift()});var e,n,o=(e={},foreach(t,function(t){e[t.head]||(e[t.head]=[]),e[t.head].push(t)}),e);return/^[0-9]+$/.test(t[0].head)?(n=[],foreach(o,function(t){n.push(i(t))})):(n={},foreach(o,function(t,e){n[e]=i(t)})),n}((t=$(this).inputVal(),n=[],foreach(t,function(t,e){var i=[];"undefined"!==e&&(i.push(e.match(/^[^\[]*/)[0]),i=i.concat(map(e.match(/\[[^\]]*\]/g),function(t){return t.replace(/[\[\]]/g,"")})),n.push({val:t,key:i}))}),n))},$.fn.repeater=function(p){var g;return p=p||{},$(this).each(function(){function l(t,e){return t.filter(function(){return!e||0===$(this).closest(pluck(e,"selector").join(",")).length})}function i(){return l(o.find("[data-repeater-item]"),p.repeaters)}var t=$(this),n=p.show||function(){$(this).show()},e=p.hide||function(t){t()},o=t.find("[data-repeater-list]").first(),a=o.find("[data-repeater-item]").first().clone().hide(),r=l(l($(this).find("[data-repeater-item]"),p.repeaters).first().find("[data-repeater-delete]"),p.repeaters);p.isFirstItemUndeletable&&r&&r.remove();function s(){var t=o.data("repeater-list");return p.$parent?p.$parent.data("item-name")+"["+t+"]":t}function c(t){p.repeaters&&t.each(function(){var e=$(this);foreach(p.repeaters,function(t){e.find(t.selector).repeater(extend(t,{$parent:e}))})})}function h(t,e,i){t&&foreach(t,function(t){i.call(e.find(t.selector)[0],t)})}function u(t,r,s){t.each(function(o){var a=$(this);a.data("item-name",r+"["+o+"]"),l(a.find("[name]"),s).each(function(){var t=$(this),e=t.attr("name").match(/\[[^\]]+\]/g),i=e?last(e).replace(/\[|\]/g,""):t.attr("name"),n=r+"["+o+"]["+i+"]"+(t.is(":checkbox")||t.attr("multiple")?"[]":"");t.attr("name",n),h(s,a,function(t){var e=$(this);u(l(e.find("[data-repeater-item]"),t.repeaters||[]),r+"["+o+"]["+e.find("[data-repeater-list]").first().data("repeater-list")+"]",t.repeaters)})})}),o.find("input[name][checked]").removeAttr("checked").prop("checked",!0)}u(i(),s(),p.repeaters),c(i()),p.initEmpty&&i().remove(),p.ready&&p.ready(function(){u(i(),s(),p.repeaters)});function d(t){var e=a.clone();f(e,t),p.repeaters&&c(e),n.call(e.get(0))}var f=function(t,e){o.append(t),u(i(),s(),p.repeaters),t.find("[name]").each(function(){$(this).inputClear()}),function a(t,e,i){var n;(e||p.defaultValues)&&(n={},l(t.find("[name]"),i).each(function(){var t=$(this).attr("name").match(/\[([^\]]*)(\]|\]\[\])$/)[1];n[t]=$(this).attr("name")}),t.inputVal(map(filter(e||p.defaultValues,function(t,e){return n[e]}),identity,function(t){return n[t]}))),h(i,t,function(n){var o=$(this);l(o.find("[data-repeater-item]"),n.repeaters).each(function(){var i,t=o.find("[data-repeater-list]").data("repeater-list");e&&e[t]?(i=$(this).clone(),o.find("[data-repeater-item]").remove(),foreach(e[t],function(t){var e=i.clone();a(e,t,n.repeaters||[]),o.find("[data-repeater-list]").append(e)})):a($(this),n.defaultValues,n.repeaters||[])})})}(t,e||p.defaultValues,p.repeaters)};g=function(t){i().remove(),foreach(t,d)},l(t.find("[data-repeater-create]"),p.repeaters).click(function(){d()}),o.on("click","[data-repeater-delete]",function(){var t=$(this).closest("[data-repeater-item]").get(0);e.call(t,function(){$(t).remove(),u(i(),s(),p.repeaters)})})}),this.setList=g,this};