/*! For license information please see 258.js.LICENSE.txt */
(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[258,578],{5317:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r="ontouchend"in document;const o={bind:function(t,e){var n=500,o=e.value;if($A.isJson(e.value)&&(n=e.value.delay||500,o=e.value.callback),"function"!=typeof o)throw"callback must be a function";if(!r)return t.__longpressContextmenu__=function(e){e.preventDefault(),e.stopPropagation(),o(e,t)},void t.addEventListener("contextmenu",t.__longpressContextmenu__);var i=null,a=!1;t.__longpressStart__=function(e){"click"===e.type&&0!==e.button||(a=!1,null===i&&(i=setTimeout((function(){a=!0,o(e.touches[0],t)}),n)))},t.__longpressCancel__=function(t){null!==i&&(clearTimeout(i),i=null)},t.__longpressClick__=function(e){a&&(e.preventDefault(),e.stopPropagation()),t.__longpressCancel__(e)},t.addEventListener("touchstart",t.__longpressStart__),t.addEventListener("click",t.__longpressClick__),t.addEventListener("touchmove",t.__longpressCancel__),t.addEventListener("touchend",t.__longpressCancel__),t.addEventListener("touchcancel",t.__longpressCancel__)},unbind:function(t){if(!r)return t.removeEventListener("contextmenu",t.__longpressContextmenu__),void delete t.__longpressContextmenu__;t.removeEventListener("touchstart",t.__longpressStart__),t.removeEventListener("click",t.__longpressClick__),t.removeEventListener("touchmove",t.__longpressCancel__),t.removeEventListener("touchend",t.__longpressCancel__),t.removeEventListener("touchcancel",t.__longpressCancel__),delete t.__longpressStart__,delete t.__longpressClick__,delete t.__longpressCancel__}}},79742:(t,e)=>{"use strict";e.byteLength=function(t){var e=l(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,i=l(t),a=i[0],s=i[1],u=new o(function(t,e,n){return 3*(e+n)/4-n}(0,a,s)),c=0,f=s>0?a-4:a;for(n=0;n>16&255,u[c++]=e>>8&255,u[c++]=255&e;2===s&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,u[c++]=255&e);1===s&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e);return u},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],a=16383,s=0,l=r-o;sl?l:s+a));1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function u(t,e,r){for(var o,i,a=[],s=e;s>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},48764:(t,e,n)=>{"use strict";var r=n(79742),o=n(80645),i=n(5826);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(t).length;default:if(r)return F(t).length;e=(""+e).toLowerCase(),r=!0}}function m(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return D(this,e,n);case"utf8":case"utf-8":return O(this,e,n);case"ascii":return T(this,e,n);case"latin1":case"binary":return A(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function g(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function v(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=l.from(e,r)),l.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,o);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,o){var i,a=1,s=t.length,l=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,l/=2,n/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var c=-1;for(i=n;is&&(n=s-l),i=n;i>=0;i--){for(var f=!0,d=0;do&&(r=o):r=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(e,t.length-n),t,n,r)}function S(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function O(t,e,n){n=Math.min(t.length,n);for(var r=[],o=e;o239?4:u>223?3:u>191?2:1;if(o+f<=n)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(i=t[o+1]))&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(l=(15&u)<<12|(63&i)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=t[o+1],a=t[o+2],s=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(l=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),o+=f}return function(t){var e=t.length;if(e<=E)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},l.prototype.compare=function(t,e,n,r,o){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),s=Math.min(i,a),u=this.slice(r,o),c=t.slice(e,n),f=0;fo)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return _(this,t,e,n);case"ascii":return w(this,t,e,n);case"latin1":case"binary":return C(this,t,e,n);case"base64":return k(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function T(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;or)&&(n=r);for(var o="",i=e;in)throw new RangeError("Trying to access beyond buffer length")}function I(t,e,n,r,o,i){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function j(t,e,n,r){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-n,2);o>>8*(r?o:1-o)}function P(t,e,n,r){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-n,4);o>>8*(r?o:3-o)&255}function R(t,e,n,r,o,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function $(t,e,n,r,i){return i||R(t,0,n,4),o.write(t,e,n,r,23,4),n+4}function M(t,e,n,r,i){return i||R(t,0,n,8),o.write(t,e,n,r,52,8),n+8}l.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e0&&(o*=256);)r+=this[t+--e]*o;return r},l.prototype.readUInt8=function(t,e){return e||L(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||L(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||L(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||L(t,e,this.length);for(var r=this[t],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*e)),r},l.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||L(t,e,this.length);for(var r=e,o=1,i=this[t+--r];r>0&&(o*=256);)i+=this[t+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},l.prototype.readInt8=function(t,e){return e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||L(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(t,e){e||L(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(t,e){return e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||L(t,4,this.length),o.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||L(t,4,this.length),o.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||L(t,8,this.length),o.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||L(t,8,this.length),o.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||I(this,t,e,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[e]=255&t;++i=0&&(i*=256);)this[e+o]=t/i&255;return e+n},l.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):P(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);I(this,t,e,n,o-1,-o)}var i=0,a=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+n},l.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);I(this,t,e,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):P(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,n){return $(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return $(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return M(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return M(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--o)t[o+e]=this[o+n];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function z(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(B,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function U(t,e,n,r){for(var o=0;o=e.length||o>=t.length);++o)e[o+n]=t[o];return o}},80645:(t,e)=>{e.read=function(t,e,n,r,o){var i,a,s=8*o-r-1,l=(1<>1,c=-7,f=n?o-1:0,d=n?-1:1,h=t[e+f];for(f+=d,i=h&(1<<-c)-1,h>>=-c,c+=s;c>0;i=256*i+t[e+f],f+=d,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=r;c>0;a=256*a+t[e+f],f+=d,c-=8);if(0===i)i=1-u;else{if(i===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=u}return(h?-1:1)*a*Math.pow(2,i-r)},e.write=function(t,e,n,r,o,i){var a,s,l,u=8*i-o-1,c=(1<>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(a++,l/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(e*l-1)*Math.pow(2,o),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[n+h]=255&s,h+=p,s/=256,o-=8);for(a=a<0;t[n+h]=255&a,h+=p,a/=256,u-=8);t[n+h-p]|=128*m}},5826:t=>{var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},63409:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(1519),o=n.n(r)()((function(t){return t[1]}));o.push([t.id,'.component-resize-line[data-v-5a37a7e8]{cursor:col-resize}@media (max-width:768px){.component-resize-line[data-v-5a37a7e8]{display:none}}.component-resize-line.resizing[data-v-5a37a7e8]:after{bottom:0;content:"";cursor:col-resize;left:0;position:fixed;right:0;top:0;z-index:99999}.component-resize-line.bottom[data-v-5a37a7e8],.component-resize-line.bottom[data-v-5a37a7e8]:after{cursor:row-resize}',""]);const i=o},76095:function(t,e,n){var r,o=n(48764).Buffer;"undefined"!=typeof self&&self,r=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},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)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(17),o=n(18),i=n(19),a=n(45),s=n(46),l=n(47),u=n(48),c=n(49),f=n(12),d=n(32),h=n(33),p=n(31),m=n(1),g={Scope:m.Scope,create:m.create,find:m.find,query:m.query,register:m.register,Container:r.default,Format:o.default,Leaf:i.default,Embed:u.default,Scroll:a.default,Block:l.default,Inline:s.default,Text:c.default,Attributor:{Attribute:f.default,Class:d.default,Style:h.default,Store:p.default}};e.default=g},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(e){var n=this;return e="[Parchment] "+e,(n=t.call(this,e)||this).message=e,n.name=n.constructor.name,n}return o(e,t),e}(Error);e.ParchmentError=i;var a,s={},l={},u={},c={};function f(t,e){var n;if(void 0===e&&(e=a.ANY),"string"==typeof t)n=c[t]||s[t];else if(t instanceof Text||t.nodeType===Node.TEXT_NODE)n=c.text;else if("number"==typeof t)t&a.LEVEL&a.BLOCK?n=c.block:t&a.LEVEL&a.INLINE&&(n=c.inline);else if(t instanceof HTMLElement){var r=(t.getAttribute("class")||"").split(/\s+/);for(var o in r)if(n=l[r[o]])break;n=n||u[t.tagName]}return null==n?null:e&a.LEVEL&n.scope&&e&a.TYPE&n.scope?n:null}e.DATA_KEY="__blot",function(t){t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY"}(a=e.Scope||(e.Scope={})),e.create=function(t,e){var n=f(t);if(null==n)throw new i("Unable to create "+t+" blot");var r=n,o=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:r.create(e);return new r(o,e)},e.find=function t(n,r){return void 0===r&&(r=!1),null==n?null:null!=n[e.DATA_KEY]?n[e.DATA_KEY].blot:r?t(n.parentNode,r):null},e.query=f,e.register=function t(){for(var e=[],n=0;n1)return e.map((function(e){return t(e)}));var r=e[0];if("string"!=typeof r.blotName&&"string"!=typeof r.attrName)throw new i("Invalid definition");if("abstract"===r.blotName)throw new i("Cannot register abstract class");if(c[r.blotName||r.attrName]=r,"string"==typeof r.keyName)s[r.keyName]=r;else if(null!=r.className&&(l[r.className]=r),null!=r.tagName){Array.isArray(r.tagName)?r.tagName=r.tagName.map((function(t){return t.toUpperCase()})):r.tagName=r.tagName.toUpperCase();var o=Array.isArray(r.tagName)?r.tagName:[r.tagName];o.forEach((function(t){null!=u[t]&&null!=r.className||(u[t]=r)}))}return r}},function(t,e,n){var r=n(51),o=n(11),i=n(3),a=n(20),s=String.fromCharCode(0),l=function(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]};l.prototype.insert=function(t,e){var n={};return 0===t.length?this:(n.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n))},l.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},l.prototype.retain=function(t,e){if(t<=0)return this;var n={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)},l.prototype.push=function(t){var e=this.ops.length,n=this.ops[e-1];if(t=i(!0,{},t),"object"==typeof n){if("number"==typeof t.delete&&"number"==typeof n.delete)return this.ops[e-1]={delete:n.delete+t.delete},this;if("number"==typeof n.delete&&null!=t.insert&&(e-=1,"object"!=typeof(n=this.ops[e-1])))return this.ops.unshift(t),this;if(o(t.attributes,n.attributes)){if("string"==typeof t.insert&&"string"==typeof n.insert)return this.ops[e-1]={insert:n.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof n.retain)return this.ops[e-1]={retain:n.retain+t.retain},"object"==typeof 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},l.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},l.prototype.filter=function(t){return this.ops.filter(t)},l.prototype.forEach=function(t){this.ops.forEach(t)},l.prototype.map=function(t){return this.ops.map(t)},l.prototype.partition=function(t){var e=[],n=[];return this.forEach((function(r){(t(r)?e:n).push(r)})),[e,n]},l.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},l.prototype.changeLength=function(){return this.reduce((function(t,e){return e.insert?t+a.length(e):e.delete?t-e.delete:t}),0)},l.prototype.length=function(){return this.reduce((function(t,e){return t+a.length(e)}),0)},l.prototype.slice=function(t,e){t=t||0,"number"!=typeof e&&(e=1/0);for(var n=[],r=a.iterator(this.ops),o=0;o0&&n.next(i.retain-s)}for(var u=new l(r);e.hasNext()||n.hasNext();)if("insert"===n.peekType())u.push(n.next());else if("delete"===e.peekType())u.push(e.next());else{var c=Math.min(e.peekLength(),n.peekLength()),f=e.next(c),d=n.next(c);if("number"==typeof d.retain){var h={};"number"==typeof f.retain?h.retain=c:h.insert=f.insert;var p=a.attributes.compose(f.attributes,d.attributes,"number"==typeof f.retain);if(p&&(h.attributes=p),u.push(h),!n.hasNext()&&o(u.ops[u.ops.length-1],h)){var m=new l(e.rest());return u.concat(m).chop()}}else"number"==typeof d.delete&&"number"==typeof f.retain&&u.push(d)}return u.chop()},l.prototype.concat=function(t){var e=new l(this.ops.slice());return t.ops.length>0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e},l.prototype.diff=function(t,e){if(this.ops===t.ops)return new l;var n=[this,t].map((function(e){return e.map((function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:s;throw new Error("diff() called "+(e===t?"on":"with")+" non-document")})).join("")})),i=new l,u=r(n[0],n[1],e),c=a.iterator(this.ops),f=a.iterator(t.ops);return u.forEach((function(t){for(var e=t[1].length;e>0;){var n=0;switch(t[0]){case r.INSERT:n=Math.min(f.peekLength(),e),i.push(f.next(n));break;case r.DELETE:n=Math.min(e,c.peekLength()),c.next(n),i.delete(n);break;case r.EQUAL:n=Math.min(c.peekLength(),f.peekLength(),e);var s=c.next(n),l=f.next(n);o(s.insert,l.insert)?i.retain(n,a.attributes.diff(s.attributes,l.attributes)):i.push(l).delete(n)}e-=n}})),i.chop()},l.prototype.eachLine=function(t,e){e=e||"\n";for(var n=a.iterator(this.ops),r=new l,o=0;n.hasNext();){if("insert"!==n.peekType())return;var i=n.peek(),s=a.length(i)-n.peekLength(),u="string"==typeof i.insert?i.insert.indexOf(e,s)-s:-1;if(u<0)r.push(n.next());else if(u>0)r.push(n.next(u));else{if(!1===t(r,n.next(1).attributes||{},o))return;o+=1,r=new l}}r.length()>0&&t(r,{},o)},l.prototype.transform=function(t,e){if(e=!!e,"number"==typeof t)return this.transformPosition(t,e);for(var n=a.iterator(this.ops),r=a.iterator(t.ops),o=new l;n.hasNext()||r.hasNext();)if("insert"!==n.peekType()||!e&&"insert"===r.peekType())if("insert"===r.peekType())o.push(r.next());else{var i=Math.min(n.peekLength(),r.peekLength()),s=n.next(i),u=r.next(i);if(s.delete)continue;u.delete?o.push(u):o.retain(i,a.attributes.transform(s.attributes,u.attributes,e))}else o.retain(a.length(n.next()));return o.chop()},l.prototype.transformPosition=function(t,e){e=!!e;for(var n=a.iterator(this.ops),r=0;n.hasNext()&&r<=t;){var o=n.peekLength(),i=n.peekType();n.next(),"delete"!==i?("insert"===i&&(r0&&(t1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===t||t>=this.length()-1)){var r=this.clone();return 0===t?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}var i=o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"split",this).call(this,t,n);return this.cache={},i}}]),e}(s.default.Block);function v(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==t?e:("function"==typeof t.formats&&(e=(0,i.default)(e,t.formats())),null==t.parent||"scroll"==t.parent.blotName||t.parent.statics.scope!==t.statics.scope?e:v(t.parent,e))}g.blotName="block",g.tagName="P",g.defaultChild="break",g.allowedChildren=[u.default,s.default.Embed,c.default],e.bubbleFormats=v,e.BlockEmbed=m,e.default=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.overload=e.expandConfig=void 0;var r="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},o=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(y(this,t),this.options=w(e,r),this.container=this.options.container,null==this.container)return b.error("Invalid Quill container",e);this.options.debug&&t.debug(this.options.debug);var o=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,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 l.default,this.scroll=c.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new s.default(this.scroll),this.selection=new d.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(l.default.events.EDITOR_CHANGE,(function(t){t===l.default.events.TEXT_CHANGE&&n.root.classList.toggle("ql-blank",n.editor.isBlank())})),this.emitter.on(l.default.events.SCROLL_UPDATE,(function(t,e){var r=n.selection.lastRange,o=r&&0===r.length?r.index:void 0;C.call(n,(function(){return n.editor.update(null,e,o)}),t)}));var i=this.clipboard.convert("");this.setContents(i),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return i(t,null,[{key:"debug",value:function(t){!0===t&&(t="log"),p.default.level(t)}},{key:"find",value:function(t){return t.__quill||c.default.find(t)}},{key:"import",value:function(t){return null==this.imports[t]&&b.error("Cannot import "+t+". Are you sure it was registered?"),this.imports[t]}},{key:"register",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof t){var o=t.attrName||t.blotName;"string"==typeof o?this.register("formats/"+o,t,e):Object.keys(t).forEach((function(r){n.register(r,t[r],e)}))}else null==this.imports[t]||r||b.warn("Overwriting "+t+" with",e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&"abstract"!==e.blotName?c.default.register(e):t.startsWith("modules")&&"function"==typeof e.register&&e.register()}}]),i(t,[{key:"addContainer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof t){var n=t;(t=document.createElement("div")).classList.add(n)}return this.container.insertBefore(t,e),t}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(t,e,n){var r=this,i=k(t,e,n),a=o(i,4);return t=a[0],e=a[1],n=a[3],C.call(this,(function(){return r.editor.deleteText(t,e)}),n,t,-1*e)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}},{key:"focus",value:function(){var t=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=t,this.scrollIntoView()}},{key:"format",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.default.sources.API;return C.call(this,(function(){var r=n.getSelection(!0),o=new a.default;if(null==r)return o;if(c.default.query(t,c.default.Scope.BLOCK))o=n.editor.formatLine(r.index,r.length,v({},t,e));else{if(0===r.length)return n.selection.format(t,e),o;o=n.editor.formatText(r.index,r.length,v({},t,e))}return n.setSelection(r,l.default.sources.SILENT),o}),r)}},{key:"formatLine",value:function(t,e,n,r,i){var a,s=this,l=k(t,e,n,r,i),u=o(l,4);return t=u[0],e=u[1],a=u[2],i=u[3],C.call(this,(function(){return s.editor.formatLine(t,e,a)}),i,t,0)}},{key:"formatText",value:function(t,e,n,r,i){var a,s=this,l=k(t,e,n,r,i),u=o(l,4);return t=u[0],e=u[1],a=u[2],i=u[3],C.call(this,(function(){return s.editor.formatText(t,e,a)}),i,t,0)}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=void 0;n="number"==typeof t?this.selection.getBounds(t,e):this.selection.getBounds(t.index,t.length);var r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}},{key:"getContents",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=k(t,e),r=o(n,2);return t=r[0],e=r[1],this.editor.getContents(t,e)}},{key:"getFormat",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof t?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.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(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof t?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}},{key:"getModule",value:function(t){return this.theme.modules[t]}},{key:"getSelection",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=k(t,e),r=o(n,2);return t=r[0],e=r[1],this.editor.getText(t,e)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(e,n,r){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.sources.API;return C.call(this,(function(){return o.editor.insertEmbed(e,n,r)}),i,e)}},{key:"insertText",value:function(t,e,n,r,i){var a,s=this,l=k(t,0,n,r,i),u=o(l,4);return t=u[0],a=u[2],i=u[3],C.call(this,(function(){return s.editor.insertText(t,e,a)}),i,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,n){this.clipboard.dangerouslyPasteHTML(t,e,n)}},{key:"removeFormat",value:function(t,e,n){var r=this,i=k(t,e,n),a=o(i,4);return t=a[0],e=a[1],n=a[3],C.call(this,(function(){return r.editor.removeFormat(t,e)}),n,t)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API;return C.call(this,(function(){t=new a.default(t);var n=e.getLength(),r=e.editor.deleteText(0,n),o=e.editor.applyDelta(t),i=o.ops[o.ops.length-1];return null!=i&&"string"==typeof i.insert&&"\n"===i.insert[i.insert.length-1]&&(e.editor.deleteText(e.getLength()-1,1),o.delete(1)),r.compose(o)}),n)}},{key:"setSelection",value:function(e,n,r){if(null==e)this.selection.setRange(null,n||t.sources.API);else{var i=k(e,n,r),a=o(i,4);e=a[0],n=a[1],r=a[3],this.selection.setRange(new f.Range(e,n),r),r!==l.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API,n=(new a.default).insert(t);return this.setContents(n,e)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.default.sources.USER,e=this.scroll.update(t);return this.selection.update(t),e}},{key:"updateContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API;return C.call(this,(function(){return t=new a.default(t),e.editor.applyDelta(t,n)}),n,!0)}}]),t}();function w(t,e){if((e=(0,h.default)(!0,{container:t,modules:{clipboard:!0,keyboard:!0,history:!0}},e)).theme&&e.theme!==_.DEFAULTS.theme){if(e.theme=_.import("themes/"+e.theme),null==e.theme)throw new Error("Invalid theme "+e.theme+". Did you register it?")}else e.theme=m.default;var n=(0,h.default)(!0,{},e.theme.DEFAULTS);[n,e].forEach((function(t){t.modules=t.modules||{},Object.keys(t.modules).forEach((function(e){!0===t.modules[e]&&(t.modules[e]={})}))}));var r=Object.keys(n.modules).concat(Object.keys(e.modules)).reduce((function(t,e){var n=_.import("modules/"+e);return null==n?b.error("Cannot load "+e+" module. Are you sure you registered it?"):t[e]=n.DEFAULTS||{},t}),{});return null!=e.modules&&e.modules.toolbar&&e.modules.toolbar.constructor!==Object&&(e.modules.toolbar={container:e.modules.toolbar}),e=(0,h.default)(!0,{},_.DEFAULTS,{modules:r},n,e),["bounds","container","scrollingContainer"].forEach((function(t){"string"==typeof e[t]&&(e[t]=document.querySelector(e[t]))})),e.modules=Object.keys(e.modules).reduce((function(t,n){return e.modules[n]&&(t[n]=e.modules[n]),t}),{}),e}function C(t,e,n,r){if(this.options.strict&&!this.isEnabled()&&e===l.default.sources.USER)return new a.default;var o=null==n?null:this.getSelection(),i=this.editor.delta,s=t();if(null!=o&&(!0===n&&(n=o.index),null==r?o=x(o,s,e):0!==r&&(o=x(o,n,r,e)),this.setSelection(o,l.default.sources.SILENT)),s.length()>0){var u,c,f=[l.default.events.TEXT_CHANGE,s,i,e];(u=this.emitter).emit.apply(u,[l.default.events.EDITOR_CHANGE].concat(f)),e!==l.default.sources.SILENT&&(c=this.emitter).emit.apply(c,f)}return s}function k(t,e,n,o,i){var a={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(i=o,o=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(i=o,o=n,n=e,e=0),"object"===(void 0===n?"undefined":r(n))?(a=n,i=o):"string"==typeof n&&(null!=o?a[n]=o:i=n),[t,e,a,i=i||l.default.sources.API]}function x(t,e,n,r){if(null==t)return null;var i=void 0,s=void 0;if(e instanceof a.default){var u=[t.index,t.index+t.length].map((function(t){return e.transformPosition(t,r!==l.default.sources.USER)})),c=o(u,2);i=c[0],s=c[1]}else{var d=[t.index,t.index+t.length].map((function(t){return t=0?t+n:Math.max(e,t+n)})),h=o(d,2);i=h[0],s=h[1]}return new f.Range(i,s-i)}_.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},_.events=l.default.events,_.sources=l.default.sources,_.version="1.3.7",_.imports={delta:a.default,parchment:c.default,"core/module":u.default,"core/theme":m.default},e.expandConfig=w,e.overload=k,e.default=_},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:"compare",value:function(t,n){var r=e.order.indexOf(t),o=e.order.indexOf(n);return r>=0||o>=0?r-o:t===n?0:t1?e-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{};r(this,t),this.quill=e,this.options=n};o.DEFAULTS={},e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=["error","warn","log","info"],o="warn";function i(t){if(r.indexOf(t)<=r.indexOf(o)){for(var e,n=arguments.length,i=Array(n>1?n-1:0),a=1;a=0;u--)if(f[u]!=d[u])return!1;for(u=f.length-1;u>=0;u--)if(c=f[u],!a(t[c],e[c],n))return!1;return typeof t==typeof e}(t,e,n))};function s(t){return null==t}function l(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length||"function"!=typeof t.copy||"function"!=typeof t.slice||t.length>0&&"number"!=typeof t[0])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),o=function(){function t(t,e,n){void 0===n&&(n={}),this.attrName=t,this.keyName=e;var o=r.Scope.TYPE&r.Scope.ATTRIBUTE;null!=n.scope?this.scope=n.scope&r.Scope.LEVEL|o:this.scope=r.Scope.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}return t.keys=function(t){return[].map.call(t.attributes,(function(t){return t.name}))},t.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)},t.prototype.canAdd=function(t,e){return null!=r.query(t,r.Scope.BLOT&(this.scope|r.Scope.TYPE))&&(null==this.whitelist||("string"==typeof e?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1))},t.prototype.remove=function(t){t.removeAttribute(this.keyName)},t.prototype.value=function(t){var e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""},t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Code=void 0;var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function t(t,e){for(var n=0;n=t+n)){var a=this.newlineIndex(t,!0)+1,l=i-a+1,u=this.isolate(a,l),c=u.next;u.format(r,o),c instanceof e&&c.formatAt(0,t-a+n-l,r,o)}}}},{key:"insertAt",value:function(t,e,n){if(null==n){var o=this.descendant(c.default,t),i=r(o,2),a=i[0],s=i[1];a.insertAt(s,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){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)return this.domNode.textContent.slice(0,t).lastIndexOf("\n");var n=this.domNode.textContent.slice(t).indexOf("\n");return n>-1?t+n:-1}},{key:"optimize",value:function(t){this.domNode.textContent.endsWith("\n")||this.appendChild(s.default.create("text","\n")),i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(t),n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t),[].slice.call(this.domNode.querySelectorAll("*")).forEach((function(t){var e=s.default.find(t);null==e?t.parentNode.removeChild(t):e instanceof s.default.Embed?e.remove():e.unwrap()}))}}],[{key:"create",value:function(t){var n=i(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("spellcheck",!1),n}},{key:"formats",value:function(){return!0}}]),e}(l.default);g.blotName="code-block",g.tagName="PRE",g.TAB=" ",e.Code=m,e.default=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="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},o=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function t(t,e){for(var n=0;n=i&&!h.endsWith("\n")&&(n=!0),e.scroll.insertAt(t,h);var p=e.scroll.line(t),m=o(p,2),v=m[0],y=m[1],b=(0,g.default)({},(0,f.bubbleFormats)(v));if(v instanceof d.default){var _=v.descendant(l.default.Leaf,y),w=o(_,1)[0];b=(0,g.default)(b,(0,f.bubbleFormats)(w))}c=s.default.attributes.diff(b,c)||{}}else if("object"===r(a.insert)){var C=Object.keys(a.insert)[0];if(null==C)return t;e.scroll.insertAt(t,C,a.insert[C])}i+=u}return Object.keys(c).forEach((function(n){e.scroll.formatAt(t,u,n,c[n])})),t+u}),0),t.reduce((function(t,n){return"number"==typeof n.delete?(e.scroll.deleteAt(t,n.delete),t):t+(n.retain||n.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 a.default).retain(t).delete(e))}},{key:"formatLine",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(r).forEach((function(o){if(null==n.scroll.whitelist||n.scroll.whitelist[o]){var i=n.scroll.lines(t,Math.max(e,1)),a=e;i.forEach((function(e){var i=e.length();if(e instanceof u.default){var s=t-e.offset(n.scroll),l=e.newlineIndex(s+a)-s+1;e.formatAt(s,l,o,r[o])}else e.format(o,r[o]);a-=i}))}})),this.scroll.optimize(),this.update((new a.default).retain(t).retain(e,(0,p.default)(r)))}},{key:"formatText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(r).forEach((function(o){n.scroll.formatAt(t,e,o,r[o])})),this.update((new a.default).retain(t).retain(e,(0,p.default)(r)))}},{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 a.default)}},{key:"getFormat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===e?this.scroll.path(t).forEach((function(t){var e=o(t,1)[0];e instanceof d.default?n.push(e):e instanceof l.default.Leaf&&r.push(e)})):(n=this.scroll.lines(t,e),r=this.scroll.descendants(l.default.Leaf,t,e));var i=[n,r].map((function(t){if(0===t.length)return{};for(var e=(0,f.bubbleFormats)(t.shift());Object.keys(e).length>0;){var n=t.shift();if(null==n)return e;e=_((0,f.bubbleFormats)(n),e)}return e}));return g.default.apply(g.default,i)}},{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,n){return this.scroll.insertAt(t,e,n),this.update((new a.default).retain(t).insert(function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},e,n)))}},{key:"insertText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(r).forEach((function(o){n.scroll.formatAt(t,e.length,o,r[o])})),this.update((new a.default).retain(t).insert(e,(0,p.default)(r)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var t=this.scroll.children.head;return t.statics.blotName===d.default.blotName&&!(t.children.length>1)&&t.children.head instanceof h.default}},{key:"removeFormat",value:function(t,e){var n=this.getText(t,e),r=this.scroll.line(t+e),i=o(r,2),s=i[0],l=i[1],c=0,f=new a.default;null!=s&&(c=s instanceof u.default?s.newlineIndex(l)-l+1:s.length()-l,f=s.delta().slice(l,l+c-1).insert("\n"));var d=this.getContents(t,e+c).diff((new a.default).insert(n).concat(f)),h=(new a.default).retain(t).concat(d);return this.applyDelta(h)}},{key:"update",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=this.delta;if(1===e.length&&"characterData"===e[0].type&&e[0].target.data.match(y)&&l.default.find(e[0].target)){var o=l.default.find(e[0].target),i=(0,f.bubbleFormats)(o),s=o.offset(this.scroll),u=e[0].oldValue.replace(c.default.CONTENTS,""),d=(new a.default).insert(u),h=(new a.default).insert(o.value()),p=(new a.default).retain(s).concat(d.diff(h,n));t=p.reduce((function(t,e){return e.insert?t.insert(e.insert,i):t.push(e)}),new a.default),this.delta=r.compose(t)}else this.delta=this.getDelta(),t&&(0,m.default)(r.compose(t),this.delta)||(t=r.diff(this.delta,n));return t}}]),t}();function _(t,e){return Object.keys(e).reduce((function(n,r){return null==t[r]||(e[r]===t[r]?n[r]=e[r]:Array.isArray(e[r])?e[r].indexOf(t[r])<0&&(n[r]=e[r].concat([t[r]])):n[r]=[e[r],t[r]]),n}),{})}e.default=b},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Range=void 0;var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0;f(this,t),this.index=e,this.length=n},p=function(){function t(e,n){var r=this;f(this,t),this.emitter=n,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=i.default.create("cursor",this),this.lastRange=this.savedRange=new h(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,(function(){r.mouseDown||setTimeout(r.update.bind(r,l.default.sources.USER),1)})),this.emitter.on(l.default.events.EDITOR_CHANGE,(function(t,e){t===l.default.events.TEXT_CHANGE&&e.length()>0&&r.update(l.default.sources.SILENT)})),this.emitter.on(l.default.events.SCROLL_BEFORE_UPDATE,(function(){if(r.hasFocus()){var t=r.getNativeRange();null!=t&&t.start.node!==r.cursor.textNode&&r.emitter.once(l.default.events.SCROLL_UPDATE,(function(){try{r.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset)}catch(t){}}))}})),this.emitter.on(l.default.events.SCROLL_OPTIMIZE,(function(t,e){if(e.range){var n=e.range,o=n.startNode,i=n.startOffset,a=n.endNode,s=n.endOffset;r.setNativeRange(o,i,a,s)}})),this.update(l.default.sources.SILENT)}return o(t,[{key:"handleComposition",value:function(){var t=this;this.root.addEventListener("compositionstart",(function(){t.composing=!0})),this.root.addEventListener("compositionend",(function(){if(t.composing=!1,t.cursor.parent){var e=t.cursor.restore();if(!e)return;setTimeout((function(){t.setNativeRange(e.startNode,e.startOffset,e.endNode,e.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(l.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 n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!i.default.query(t,i.default.Scope.BLOCK)){if(n.start.node!==this.cursor.textNode){var r=i.default.find(n.start.node,!1);if(null==r)return;if(r instanceof i.default.Leaf){var o=r.split(n.start.offset);r.parent.insertBefore(this.cursor,o)}else r.insertBefore(this.cursor,n.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){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();t=Math.min(t,n-1),e=Math.min(t+e,n-1)-t;var o=void 0,i=this.scroll.leaf(t),a=r(i,2),s=a[0],l=a[1];if(null==s)return null;var u=s.position(l,!0),c=r(u,2);o=c[0],l=c[1];var f=document.createRange();if(e>0){f.setStart(o,l);var d=this.scroll.leaf(t+e),h=r(d,2);if(s=h[0],l=h[1],null==s)return null;var p=s.position(l,!0),m=r(p,2);return o=m[0],l=m[1],f.setEnd(o,l),f.getBoundingClientRect()}var g="left",v=void 0;return o instanceof Text?(l0&&(g="right")),{bottom:v.top+v.height,height:v.height,left:v[g],right:v[g],top:v.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 n=this.normalizeNative(e);return d.info("getNativeRange",n),n}},{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 e=this,n=[[t.start.node,t.start.offset]];t.native.collapsed||n.push([t.end.node,t.end.offset]);var o=n.map((function(t){var n=r(t,2),o=n[0],a=n[1],s=i.default.find(o,!0),l=s.offset(e.scroll);return 0===a?l:s instanceof i.default.Container?l+s.length():l+s.index(o,a)})),a=Math.min(Math.max.apply(Math,c(o)),this.scroll.length()-1),s=Math.min.apply(Math,[a].concat(c(o)));return new h(s,a-s)}},{key:"normalizeNative",value:function(t){if(!m(this.root,t.startContainer)||!t.collapsed&&!m(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,n=t.offset;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>n)e=e.childNodes[n],n=0;else{if(e.childNodes.length!==n)break;n=(e=e.lastChild)instanceof Text?e.data.length:e.childNodes.length+1}t.node=e,t.offset=n})),e}},{key:"rangeToNative",value:function(t){var e=this,n=t.collapsed?[t.index]:[t.index,t.index+t.length],o=[],i=this.scroll.length();return n.forEach((function(t,n){t=Math.min(i-1,t);var a,s=e.scroll.leaf(t),l=r(s,2),u=l[0],c=l[1],f=u.position(c,0!==n),d=r(f,2);a=d[0],c=d[1],o.push(a,c)})),o.length<2&&(o=o.concat(o)),o}},{key:"scrollIntoView",value:function(t){var e=this.lastRange;if(null!=e){var n=this.getBounds(e.index,e.length);if(null!=n){var o=this.scroll.length()-1,i=this.scroll.line(Math.min(e.index,o)),a=r(i,1)[0],s=a;if(e.length>0){var l=this.scroll.line(Math.min(e.index+e.length,o));s=r(l,1)[0]}if(null!=a&&null!=s){var u=t.getBoundingClientRect();n.topu.bottom&&(t.scrollTop+=n.bottom-u.bottom)}}}}},{key:"setNativeRange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(d.info("setNativeRange",t,e,n,r),null==t||null!=this.root.parentNode&&null!=t.parentNode&&null!=n.parentNode){var i=document.getSelection();if(null!=i)if(null!=t){this.hasFocus()||this.root.focus();var a=(this.getNativeRange()||{}).native;if(null==a||o||t!==a.startContainer||e!==a.startOffset||n!==a.endContainer||r!==a.endOffset){"BR"==t.tagName&&(e=[].indexOf.call(t.parentNode.childNodes,t),t=t.parentNode),"BR"==n.tagName&&(r=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);var s=document.createRange();s.setStart(t,e),s.setEnd(n,r),i.removeAllRanges(),i.addRange(s)}}else i.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.default.sources.API;if("string"==typeof e&&(n=e,e=!1),d.info("setRange",t),null!=t){var r=this.rangeToNative(t);this.setNativeRange.apply(this,c(r).concat([e]))}else this.setNativeRange(null);this.update(n)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.default.sources.USER,e=this.lastRange,n=this.getRange(),o=r(n,2),i=o[0],u=o[1];if(this.lastRange=i,null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,s.default)(e,this.lastRange)){var c;!this.composing&&null!=u&&u.native.collapsed&&u.start.node!==this.cursor.textNode&&this.cursor.restore();var f,d=[l.default.events.SELECTION_CHANGE,(0,a.default)(this.lastRange),(0,a.default)(e),t];(c=this.emitter).emit.apply(c,[l.default.events.EDITOR_CHANGE].concat(d)),t!==l.default.sources.SILENT&&(f=this.emitter).emit.apply(f,d)}}}]),t}();function m(t,e){try{e.parentNode}catch(t){return!1}return e instanceof Text&&(e=e.parentNode),t.contains(e)}e.Range=h,e.default=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n0&&(n+=1),[this.parent.domNode,n]},e.prototype.value=function(){var t;return(t={})[this.statics.blotName]=this.statics.value(this.domNode)||!0,t},e.scope=a.Scope.INLINE_BLOT,e}(i.default);e.default=s},function(t,e,n){var r=n(11),o=n(3),i={attributes:{compose:function(t,e,n){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var r=o(!0,{},e);for(var i in n||(r=Object.keys(r).reduce((function(t,e){return null!=r[e]&&(t[e]=r[e]),t}),{})),t)void 0!==t[i]&&void 0===e[i]&&(r[i]=t[i]);return Object.keys(r).length>0?r:void 0},diff:function(t,e){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var n=Object.keys(t).concat(Object.keys(e)).reduce((function(n,o){return r(t[o],e[o])||(n[o]=void 0===e[o]?null:e[o]),n}),{});return Object.keys(n).length>0?n:void 0},transform:function(t,e,n){if("object"!=typeof t)return e;if("object"==typeof e){if(!n)return e;var r=Object.keys(e).reduce((function(n,r){return void 0===t[r]&&(n[r]=e[r]),n}),{});return Object.keys(r).length>0?r:void 0}}},iterator:function(t){return new a(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 a(t){this.ops=t,this.index=0,this.offset=0}a.prototype.hasNext=function(){return this.peekLength()<1/0},a.prototype.next=function(t){t||(t=1/0);var e=this.ops[this.index];if(e){var n=this.offset,r=i.length(e);if(t>=r-n?(t=r-n,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(n,t):o.insert=e.insert,o}return{retain:1/0}},a.prototype.peek=function(){return this.ops[this.index]},a.prototype.peekLength=function(){return this.ops[this.index]?i.length(this.ops[this.index])-this.offset:1/0},a.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"},a.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var t=this.offset,e=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=t,this.index=e,[n].concat(r)}return[]},t.exports=i},function(t,e){var n=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var e,n,r;try{e=Map}catch(t){e=function(){}}try{n=Set}catch(t){n=function(){}}try{r=Promise}catch(t){r=function(){}}function i(a,l,u,c,f){"object"==typeof l&&(u=l.depth,c=l.prototype,f=l.includeNonEnumerable,l=l.circular);var d=[],h=[],p=void 0!==o;return void 0===l&&(l=!0),void 0===u&&(u=1/0),function a(u,m){if(null===u)return null;if(0===m)return u;var g,v;if("object"!=typeof u)return u;if(t(u,e))g=new e;else if(t(u,n))g=new n;else if(t(u,r))g=new r((function(t,e){u.then((function(e){t(a(e,m-1))}),(function(t){e(a(t,m-1))}))}));else if(i.__isArray(u))g=[];else if(i.__isRegExp(u))g=new RegExp(u.source,s(u)),u.lastIndex&&(g.lastIndex=u.lastIndex);else if(i.__isDate(u))g=new Date(u.getTime());else{if(p&&o.isBuffer(u))return g=o.allocUnsafe?o.allocUnsafe(u.length):new o(u.length),u.copy(g),g;t(u,Error)?g=Object.create(u):void 0===c?(v=Object.getPrototypeOf(u),g=Object.create(v)):(g=Object.create(c),v=c)}if(l){var y=d.indexOf(u);if(-1!=y)return h[y];d.push(u),h.push(g)}for(var b in t(u,e)&&u.forEach((function(t,e){var n=a(e,m-1),r=a(t,m-1);g.set(n,r)})),t(u,n)&&u.forEach((function(t){var e=a(t,m-1);g.add(e)})),u){var _;v&&(_=Object.getOwnPropertyDescriptor(v,b)),_&&null==_.set||(g[b]=a(u[b],m-1))}if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(u);for(b=0;b0){if(s instanceof l.BlockEmbed||h instanceof l.BlockEmbed)return void this.optimize();if(s instanceof f.default){var p=s.newlineIndex(s.length(),!0);if(p>-1&&(s=s.split(p+1))===h)return void this.optimize()}else if(h instanceof f.default){var m=h.newlineIndex(0);m>-1&&h.split(m+1)}var g=h.children.head instanceof c.default?null:h.children.head;s.moveChildren(h,g),s.remove()}this.optimize()}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",t)}},{key:"formatAt",value:function(t,n,r,o){(null==this.whitelist||this.whitelist[r])&&(i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"formatAt",this).call(this,t,n,r,o),this.optimize())}},{key:"insertAt",value:function(t,n,r){if(null==r||null==this.whitelist||this.whitelist[n]){if(t>=this.length())if(null==r||null==a.default.query(n,a.default.Scope.BLOCK)){var o=a.default.create(this.statics.defaultChild);this.appendChild(o),null==r&&n.endsWith("\n")&&(n=n.slice(0,-1)),o.insertAt(0,n,r)}else{var s=a.default.create(n,r);this.appendChild(s)}else i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertAt",this).call(this,t,n,r);this.optimize()}}},{key:"insertBefore",value:function(t,n){if(t.statics.scope===a.default.Scope.INLINE_BLOT){var r=a.default.create(this.statics.defaultChild);r.appendChild(t),t=r}i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n)}},{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(p,t)}},{key:"lines",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE,n=function t(e,n,r){var o=[],i=r;return e.children.forEachAt(n,r,(function(e,n,r){p(e)?o.push(e):e instanceof a.default.Container&&(o=o.concat(t(e,n,i))),i-=r})),o};return n(this,t,e)}},{key:"optimize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t,n),t.length>0&&this.emitter.emit(s.default.events.SCROLL_OPTIMIZE,t,n))}},{key:"path",value:function(t){return i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"path",this).call(this,t).slice(1)}},{key:"update",value:function(t){if(!0!==this.batch){var n=s.default.sources.USER;"string"==typeof t&&(n=t),Array.isArray(t)||(t=this.observer.takeRecords()),t.length>0&&this.emitter.emit(s.default.events.SCROLL_BEFORE_UPDATE,n,t),i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"update",this).call(this,t.concat([])),t.length>0&&this.emitter.emit(s.default.events.SCROLL_UPDATE,n,t)}}}]),e}(a.default.Scroll);m.blotName="scroll",m.className="ql-editor",m.tagName="DIV",m.defaultChild="block",m.allowedChildren=[u.default,l.BlockEmbed,d.default],e.default=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SHORTKEY=e.default=void 0;var r="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},o=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=E(t);if(null==r||null==r.key)return v.warn("Attempted to add invalid keyboard binding",r);"function"==typeof e&&(e={handler:e}),"function"==typeof n&&(n={handler:n}),r=(0,l.default)(r,e,n),this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)}},{key:"listen",value:function(){var t=this;this.quill.root.addEventListener("keydown",(function(n){if(!n.defaultPrevented){var i=n.which||n.keyCode,a=(t.bindings[i]||[]).filter((function(t){return e.match(n,t)}));if(0!==a.length){var l=t.quill.getSelection();if(null!=l&&t.quill.hasFocus()){var u=t.quill.getLine(l.index),c=o(u,2),d=c[0],h=c[1],p=t.quill.getLeaf(l.index),m=o(p,2),g=m[0],v=m[1],y=0===l.length?[g,v]:t.quill.getLeaf(l.index+l.length),b=o(y,2),_=b[0],w=b[1],C=g instanceof f.default.Text?g.value().slice(0,v):"",k=_ instanceof f.default.Text?_.value().slice(w):"",x={collapsed:0===l.length,empty:0===l.length&&d.length()<=1,format:t.quill.getFormat(l),offset:h,prefix:C,suffix:k};a.some((function(e){if(null!=e.collapsed&&e.collapsed!==x.collapsed)return!1;if(null!=e.empty&&e.empty!==x.empty)return!1;if(null!=e.offset&&e.offset!==x.offset)return!1;if(Array.isArray(e.format)){if(e.format.every((function(t){return null==x.format[t]})))return!1}else if("object"===r(e.format)&&!Object.keys(e.format).every((function(t){return!0===e.format[t]?null!=x.format[t]:!1===e.format[t]?null==x.format[t]:(0,s.default)(e.format[t],x.format[t])})))return!1;return!(null!=e.prefix&&!e.prefix.test(x.prefix)||null!=e.suffix&&!e.suffix.test(x.suffix)||!0===e.handler.call(t,l,x))}))&&n.preventDefault()}}}}))}}]),e}(p.default);function _(t,e){var n,r=t===b.keys.LEFT?"prefix":"suffix";return g(n={key:t,shiftKey:e,altKey:null},r,/^$/),g(n,"handler",(function(n){var r=n.index;t===b.keys.RIGHT&&(r+=n.length+1);var i=this.quill.getLeaf(r);return!(o(i,1)[0]instanceof f.default.Embed&&(t===b.keys.LEFT?e?this.quill.setSelection(n.index-1,n.length+1,d.default.sources.USER):this.quill.setSelection(n.index-1,d.default.sources.USER):e?this.quill.setSelection(n.index,n.length+1,d.default.sources.USER):this.quill.setSelection(n.index+n.length+1,d.default.sources.USER),1))})),n}function w(t,e){if(!(0===t.index||this.quill.getLength()<=1)){var n=this.quill.getLine(t.index),r=o(n,1)[0],i={};if(0===e.offset){var a=this.quill.getLine(t.index-1),s=o(a,1)[0];if(null!=s&&s.length()>1){var l=r.formats(),u=this.quill.getFormat(t.index-1,1);i=c.default.attributes.diff(l,u)||{}}}var f=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;this.quill.deleteText(t.index-f,f,d.default.sources.USER),Object.keys(i).length>0&&this.quill.formatLine(t.index-f,f,i,d.default.sources.USER),this.quill.focus()}}function C(t,e){var n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(!(t.index>=this.quill.getLength()-n)){var r={},i=0,a=this.quill.getLine(t.index),s=o(a,1)[0];if(e.offset>=s.length()-1){var l=this.quill.getLine(t.index+1),u=o(l,1)[0];if(u){var f=s.formats(),h=this.quill.getFormat(t.index,1);r=c.default.attributes.diff(f,h)||{},i=u.length()}}this.quill.deleteText(t.index,n,d.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(t.index+i-1,n,r,d.default.sources.USER)}}function k(t){var e=this.quill.getLines(t),n={};if(e.length>1){var r=e[0].formats(),o=e[e.length-1].formats();n=c.default.attributes.diff(o,r)||{}}this.quill.deleteText(t,d.default.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(t.index,1,n,d.default.sources.USER),this.quill.setSelection(t.index,d.default.sources.SILENT),this.quill.focus()}function x(t,e){var n=this;t.length>0&&this.quill.scroll.deleteAt(t.index,t.length);var r=Object.keys(e.format).reduce((function(t,n){return f.default.query(n,f.default.Scope.BLOCK)&&!Array.isArray(e.format[n])&&(t[n]=e.format[n]),t}),{});this.quill.insertText(t.index,"\n",r,d.default.sources.USER),this.quill.setSelection(t.index+1,d.default.sources.SILENT),this.quill.focus(),Object.keys(e.format).forEach((function(t){null==r[t]&&(Array.isArray(e.format[t])||"link"!==t&&n.quill.format(t,e.format[t],d.default.sources.USER))}))}function S(t){return{key:b.keys.TAB,shiftKey:!t,format:{"code-block":!0},handler:function(e){var n=f.default.query("code-block"),r=e.index,i=e.length,a=this.quill.scroll.descendant(n,r),s=o(a,2),l=s[0],u=s[1];if(null!=l){var c=this.quill.getIndex(l),h=l.newlineIndex(u,!0)+1,p=l.newlineIndex(c+u+i),m=l.domNode.textContent.slice(h,p).split("\n");u=0,m.forEach((function(e,o){t?(l.insertAt(h+u,n.TAB),u+=n.TAB.length,0===o?r+=n.TAB.length:i+=n.TAB.length):e.startsWith(n.TAB)&&(l.deleteAt(h+u,n.TAB.length),u-=n.TAB.length,0===o?r-=n.TAB.length:i-=n.TAB.length),u+=e.length+1})),this.quill.update(d.default.sources.USER),this.quill.setSelection(r,i,d.default.sources.SILENT)}}}}function O(t){return{key:t[0].toUpperCase(),shortKey:!0,handler:function(e,n){this.quill.format(t,!n.format[t],d.default.sources.USER)}}}function E(t){if("string"==typeof t||"number"==typeof t)return E({key:t});if("object"===(void 0===t?"undefined":r(t))&&(t=(0,a.default)(t,!1)),"string"==typeof t.key)if(null!=b.keys[t.key.toUpperCase()])t.key=b.keys[t.key.toUpperCase()];else{if(1!==t.key.length)return null;t.key=t.key.toUpperCase().charCodeAt(0)}return t.shortKey&&(t[y]=t.shortKey,delete t.shortKey),t}b.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},b.DEFAULTS={bindings:{bold:O("bold"),italic:O("italic"),underline:O("underline"),indent:{key:b.keys.TAB,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","+1",d.default.sources.USER)}},outdent:{key:b.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",d.default.sources.USER)}},"outdent backspace":{key:b.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",d.default.sources.USER):null!=e.format.list&&this.quill.format("list",!1,d.default.sources.USER)}},"indent code-block":S(!0),"outdent code-block":S(!1),"remove tab":{key:b.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(t){this.quill.deleteText(t.index-1,1,d.default.sources.USER)}},tab:{key:b.keys.TAB,handler:function(t){this.quill.history.cutoff();var e=(new u.default).retain(t.index).delete(t.length).insert("\t");this.quill.updateContents(e,d.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,d.default.sources.SILENT)}},"list empty enter":{key:b.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(t,e){this.quill.format("list",!1,d.default.sources.USER),e.format.indent&&this.quill.format("indent",!1,d.default.sources.USER)}},"checklist enter":{key:b.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(t){var e=this.quill.getLine(t.index),n=o(e,2),r=n[0],i=n[1],a=(0,l.default)({},r.formats(),{list:"checked"}),s=(new u.default).retain(t.index).insert("\n",a).retain(r.length()-i-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,d.default.sources.USER),this.quill.setSelection(t.index+1,d.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:b.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(t,e){var n=this.quill.getLine(t.index),r=o(n,2),i=r[0],a=r[1],s=(new u.default).retain(t.index).insert("\n",e.format).retain(i.length()-a-1).retain(1,{header:null});this.quill.updateContents(s,d.default.sources.USER),this.quill.setSelection(t.index+1,d.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(t,e){var n=e.prefix.length,r=this.quill.getLine(t.index),i=o(r,2),a=i[0],s=i[1];if(s>n)return!0;var l=void 0;switch(e.prefix.trim()){case"[]":case"[ ]":l="unchecked";break;case"[x]":l="checked";break;case"-":case"*":l="bullet";break;default:l="ordered"}this.quill.insertText(t.index," ",d.default.sources.USER),this.quill.history.cutoff();var c=(new u.default).retain(t.index-s).delete(n+1).retain(a.length()-2-s).retain(1,{list:l});this.quill.updateContents(c,d.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,d.default.sources.SILENT)}},"code exit":{key:b.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(t){var e=this.quill.getLine(t.index),n=o(e,2),r=n[0],i=n[1],a=(new u.default).retain(t.index+r.length()-i-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(a,d.default.sources.USER)}},"embed left":_(b.keys.LEFT,!1),"embed left shift":_(b.keys.LEFT,!0),"embed right":_(b.keys.RIGHT,!1),"embed right shift":_(b.keys.RIGHT,!0)}},e.default=b,e.SHORTKEY=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},i=function(){function t(t,e){for(var n=0;n-1}u.blotName="link",u.tagName="A",u.SANITIZED_URL="about:blank",u.PROTOCOL_WHITELIST=["http","https","mailto","tel"],e.default=u,e.sanitize=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="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},o=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=this.container.querySelector(".ql-selected");if(t!==n&&(null!=n&&n.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"),e))){if("function"==typeof Event)this.select.dispatchEvent(new Event("change"));else if("object"===("undefined"==typeof Event?"undefined":r(Event))){var o=document.createEvent("Event");o.initEvent("change",!0,!0),this.select.dispatchEvent(o)}this.close()}}},{key:"update",value:function(){var t=void 0;if(this.select.selectedIndex>-1){var e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(e)}else this.selectItem(null);var n=null!=t&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),t}();e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=v(n(0)),o=v(n(5)),i=n(4),a=v(i),s=v(n(16)),l=v(n(25)),u=v(n(24)),c=v(n(35)),f=v(n(6)),d=v(n(22)),h=v(n(7)),p=v(n(55)),m=v(n(42)),g=v(n(23));function v(t){return t&&t.__esModule?t:{default:t}}o.default.register({"blots/block":a.default,"blots/block/embed":i.BlockEmbed,"blots/break":s.default,"blots/container":l.default,"blots/cursor":u.default,"blots/embed":c.default,"blots/inline":f.default,"blots/scroll":d.default,"blots/text":h.default,"modules/clipboard":p.default,"modules/history":m.default,"modules/keyboard":g.default}),r.default.register(a.default,s.default,u.default,f.default,d.default,h.default),e.default=o.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),o=function(){function t(t){this.domNode=t,this.domNode[r.DATA_KEY]={blot:this}}return Object.defineProperty(t.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),t.create=function(t){if(null==this.tagName)throw new r.ParchmentError("Blot definition missing tagName");var e;return Array.isArray(this.tagName)?("string"==typeof t&&(t=t.toUpperCase(),parseInt(t).toString()===t&&(t=parseInt(t))),e="number"==typeof t?document.createElement(this.tagName[t-1]):this.tagName.indexOf(t)>-1?document.createElement(t):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e},t.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},t.prototype.clone=function(){var t=this.domNode.cloneNode(!1);return r.create(t)},t.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},t.prototype.deleteAt=function(t,e){this.isolate(t,e).remove()},t.prototype.formatAt=function(t,e,n,o){var i=this.isolate(t,e);if(null!=r.query(n,r.Scope.BLOT)&&o)i.wrap(n,o);else if(null!=r.query(n,r.Scope.ATTRIBUTE)){var a=r.create(this.statics.scope);i.wrap(a),a.format(n,o)}},t.prototype.insertAt=function(t,e,n){var o=null==n?r.create("text",e):r.create(e,n),i=this.split(t);this.parent.insertBefore(o,i)},t.prototype.insertInto=function(t,e){void 0===e&&(e=null),null!=this.parent&&this.parent.children.remove(this);var n=null;t.children.insertBefore(this,e),null!=e&&(n=e.domNode),this.domNode.parentNode==t.domNode&&this.domNode.nextSibling==n||t.domNode.insertBefore(this.domNode,n),this.parent=t,this.attach()},t.prototype.isolate=function(t,e){var n=this.split(t);return n.split(e),n},t.prototype.length=function(){return 1},t.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)},t.prototype.optimize=function(t){null!=this.domNode[r.DATA_KEY]&&delete this.domNode[r.DATA_KEY].mutations},t.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},t.prototype.replace=function(t){null!=t.parent&&(t.parent.insertBefore(this,t.next),t.remove())},t.prototype.replaceWith=function(t,e){var n="string"==typeof t?r.create(t,e):t;return n.replace(this),n},t.prototype.split=function(t,e){return 0===t?this:this.next},t.prototype.update=function(t,e){},t.prototype.wrap=function(t,e){var n="string"==typeof t?r.create(t,e):t;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},t.blotName="abstract",t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),o=n(32),i=n(33),a=n(1),s=function(){function t(t){this.attributes={},this.domNode=t,this.build()}return t.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])},t.prototype.build=function(){var t=this;this.attributes={};var e=r.default.keys(this.domNode),n=o.default.keys(this.domNode),s=i.default.keys(this.domNode);e.concat(n).concat(s).forEach((function(e){var n=a.query(e,a.Scope.ATTRIBUTE);n instanceof r.default&&(t.attributes[n.attrName]=n)}))},t.prototype.copy=function(t){var e=this;Object.keys(this.attributes).forEach((function(n){var r=e.attributes[n].value(e.domNode);t.format(n,r)}))},t.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={}},t.prototype.values=function(){var t=this;return Object.keys(this.attributes).reduce((function(e,n){return e[n]=t.attributes[n].value(t.domNode),e}),{})},t}();e.default=s},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function i(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter((function(t){return 0===t.indexOf(e+"-")}))}Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.keys=function(t){return(t.getAttribute("class")||"").split(/\s+/).map((function(t){return t.split("-").slice(0,-1).join("-")}))},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(this.keyName+"-"+e),!0)},e.prototype.remove=function(t){i(t,this.keyName).forEach((function(e){t.classList.remove(e)})),0===t.classList.length&&t.removeAttribute("class")},e.prototype.value=function(t){var e=(i(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""},e}(n(12).default);e.default=a},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function i(t){var e=t.split("-"),n=e.slice(1).map((function(t){return t[0].toUpperCase()+t.slice(1)})).join("");return e[0]+n}Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.keys=function(t){return(t.getAttribute("style")||"").split(";").map((function(t){return t.split(":")[0].trim()}))},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.style[i(this.keyName)]=e,!0)},e.prototype.remove=function(t){t.style[i(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")},e.prototype.value=function(t){var e=t.style[i(this.keyName)];return this.canAdd(t,e)?e:""},e}(n(12).default);e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;nr&&this.stack.undo.length>0){var o=this.stack.undo.pop();n=n.compose(o.undo),t=o.redo.compose(t)}else this.lastRecorded=r;this.stack.undo.push({redo:t,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(t){this.stack.undo.forEach((function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)})),this.stack.redo.forEach((function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)}))}},{key:"undo",value:function(){this.change("undo","redo")}}]),e}(a(n(9)).default);function l(t){var e=t.reduce((function(t,e){return t+=e.delete||0}),0),n=t.length()-e;return function(t){var e=t.ops[t.ops.length-1];return null!=e&&(null!=e.insert?"string"==typeof e.insert&&e.insert.endsWith("\n"):null!=e.attributes&&Object.keys(e.attributes).some((function(t){return null!=o.default.query(t,o.default.Scope.BLOCK)})))}(t)&&(n-=1),n}s.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},e.default=s,e.getLastChangeIndex=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BaseTooltip=void 0;var r=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"link",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=e?this.textbox.value=e:t!==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-"+t)||""),this.root.setAttribute("data-mode",t)}},{key:"restoreFocus",value:function(){var t=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=t}},{key:"save",value:function(){var t,e,n=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var r=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",n,s.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",n,s.default.sources.USER)),this.quill.root.scrollTop=r;break;case"video":e=(t=n).match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/),n=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;case"formula":if(!n)break;var o=this.quill.getSelection(!0);if(null!=o){var i=o.index+o.length;this.quill.insertEmbed(i,this.root.getAttribute("data-mode"),n,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()}}]),e}(h.default);function S(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.forEach((function(e){var r=document.createElement("option");e===n?r.setAttribute("selected","selected"):r.setAttribute("value",e),t.appendChild(r)}))}e.BaseTooltip=x,e.default=k},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this.head=this.tail=null,this.length=0}return t.prototype.append=function(){for(var t=[],e=0;e1&&this.append.apply(this,t.slice(1))},t.prototype.contains=function(t){for(var e,n=this.iterator();e=n();)if(e===t)return!0;return!1},t.prototype.insertBefore=function(t,e){t&&(t.next=e,null!=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,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)},t.prototype.offset=function(t){for(var e=0,n=this.head;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1},t.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-=1)},t.prototype.iterator=function(t){return void 0===t&&(t=this.head),function(){var e=t;return null!=t&&(t=t.next),e}},t.prototype.find=function(t,e){void 0===e&&(e=!1);for(var n,r=this.iterator();n=r();){var o=n.length();if(ta?n(r,t-a,Math.min(e,a+l-t)):n(r,0,Math.min(l,t+e-a)),a+=l}},t.prototype.map=function(t){return this.reduce((function(e,n){return e.push(t(n)),e}),[])},t.prototype.reduce=function(t,e){for(var n,r=this.iterator();n=r();)e=t(e,n);return e},t}();e.default=r},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(17),a=n(1),s={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},l=function(t){function e(e){var n=t.call(this,e)||this;return n.scroll=n,n.observer=new MutationObserver((function(t){n.update(t)})),n.observer.observe(n.domNode,s),n.attach(),n}return o(e,t),e.prototype.detach=function(){t.prototype.detach.call(this),this.observer.disconnect()},e.prototype.deleteAt=function(e,n){this.update(),0===e&&n===this.length()?this.children.forEach((function(t){t.remove()})):t.prototype.deleteAt.call(this,e,n)},e.prototype.formatAt=function(e,n,r,o){this.update(),t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){this.update(),t.prototype.insertAt.call(this,e,n,r)},e.prototype.optimize=function(e,n){var r=this;void 0===e&&(e=[]),void 0===n&&(n={}),t.prototype.optimize.call(this,n);for(var o=[].slice.call(this.observer.takeRecords());o.length>0;)e.push(o.pop());for(var s=function(t,e){void 0===e&&(e=!0),null!=t&&t!==r&&null!=t.domNode.parentNode&&(null==t.domNode[a.DATA_KEY].mutations&&(t.domNode[a.DATA_KEY].mutations=[]),e&&s(t.parent))},l=function(t){null!=t.domNode[a.DATA_KEY]&&null!=t.domNode[a.DATA_KEY].mutations&&(t instanceof i.default&&t.children.forEach(l),t.optimize(n))},u=e,c=0;u.length>0;c+=1){if(c>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(u.forEach((function(t){var e=a.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(s(a.find(t.previousSibling,!1)),[].forEach.call(t.addedNodes,(function(t){var e=a.find(t,!1);s(e,!1),e instanceof i.default&&e.children.forEach((function(t){s(t,!1)}))}))):"attributes"===t.type&&s(e.prev)),s(e))})),this.children.forEach(l),o=(u=[].slice.call(this.observer.takeRecords())).slice();o.length>0;)e.push(o.pop())}},e.prototype.update=function(e,n){var r=this;void 0===n&&(n={}),(e=e||this.observer.takeRecords()).map((function(t){var e=a.find(t.target,!0);return null==e?null:null==e.domNode[a.DATA_KEY].mutations?(e.domNode[a.DATA_KEY].mutations=[t],e):(e.domNode[a.DATA_KEY].mutations.push(t),null)})).forEach((function(t){null!=t&&t!==r&&null!=t.domNode[a.DATA_KEY]&&t.update(t.domNode[a.DATA_KEY].mutations||[],n)})),null!=this.domNode[a.DATA_KEY].mutations&&t.prototype.update.call(this,this.domNode[a.DATA_KEY].mutations,n),this.optimize(e,n)},e.blotName="scroll",e.defaultChild="block",e.scope=a.Scope.BLOCK_BLOT,e.tagName="DIV",e}(i.default);e.default=l},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(18),a=n(1),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.formats=function(n){if(n.tagName!==e.tagName)return t.formats.call(this,n)},e.prototype.format=function(n,r){var o=this;n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):(this.children.forEach((function(t){t instanceof i.default||(t=t.wrap(e.blotName,!0)),o.attributes.copy(t)})),this.unwrap())},e.prototype.formatAt=function(e,n,r,o){null!=this.formats()[r]||a.query(r,a.Scope.ATTRIBUTE)?this.isolate(e,n).format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n);var r=this.formats();if(0===Object.keys(r).length)return this.unwrap();var o=this.next;o instanceof e&&o.prev===this&&function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(t[n]!==e[n])return!1;return!0}(r,o.formats())&&(o.moveChildren(this),o.remove())},e.blotName="inline",e.scope=a.Scope.INLINE_BLOT,e.tagName="SPAN",e}(i.default);e.default=s},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(18),a=n(1),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.formats=function(n){var r=a.query(e.blotName).tagName;if(n.tagName!==r)return t.formats.call(this,n)},e.prototype.format=function(n,r){null!=a.query(n,a.Scope.BLOCK)&&(n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):this.replaceWith(e.blotName))},e.prototype.formatAt=function(e,n,r,o){null!=a.query(r,a.Scope.BLOCK)?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){if(null==r||null!=a.query(n,a.Scope.INLINE))t.prototype.insertAt.call(this,e,n,r);else{var o=this.split(e),i=a.create(n,r);o.parent.insertBefore(i,o)}},e.prototype.update=function(e,n){navigator.userAgent.match(/Trident/)?this.build():t.prototype.update.call(this,e,n)},e.blotName="block",e.scope=a.Scope.BLOCK_BLOT,e.tagName="P",e}(i.default);e.default=s},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.formats=function(t){},e.prototype.format=function(e,n){t.prototype.formatAt.call(this,0,this.length(),e,n)},e.prototype.formatAt=function(e,n,r,o){0===e&&n===this.length()?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.formats=function(){return this.statics.formats(this.domNode)},e}(n(19).default);e.default=i},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(19),a=n(1),s=function(t){function e(e){var n=t.call(this,e)||this;return n.text=n.statics.value(n.domNode),n}return o(e,t),e.create=function(t){return document.createTextNode(t)},e.value=function(t){var e=t.data;return e.normalize&&(e=e.normalize()),e},e.prototype.deleteAt=function(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)},e.prototype.index=function(t,e){return this.domNode===t?e:-1},e.prototype.insertAt=function(e,n,r){null==r?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):t.prototype.insertAt.call(this,e,n,r)},e.prototype.length=function(){return this.text.length},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},e.prototype.position=function(t,e){return void 0===e&&(e=!1),[this.domNode,t]},e.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 n=a.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},e.prototype.update=function(t,e){var n=this;t.some((function(t){return"characterData"===t.type&&t.target===n.domNode}))&&(this.text=this.statics.value(this.domNode))},e.prototype.value=function(){return this.text},e.blotName="text",e.scope=a.Scope.INLINE_BLOT,e}(i.default);e.default=s},function(t,e,n){"use strict";var r=document.createElement("div");if(r.classList.toggle("test-class",!1),r.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return arguments.length>1&&!this.contains(t)==!e?e:o.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 n=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>n.length)&&(e=n.length),e-=t.length;var r=n.indexOf(t,e);return-1!==r&&r===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,n=Object(this),r=n.length>>>0,o=arguments[1],i=0;ie.length?t:e,u=t.length>e.length?e:t,c=l.indexOf(u);if(-1!=c)return s=[[1,l.substring(0,c)],[0,u],[1,l.substring(c+u.length)]],t.length>e.length&&(s[0][0]=s[2][0]=n),s;if(1==u.length)return[[n,t],[1,e]];var f=function(t,e){var n=t.length>e.length?t:e,r=t.length>e.length?e:t;if(n.length<4||2*r.length=t.length?[r,o,s,l,f]:null}var s,l,u,c,f,d=o(n,r,Math.ceil(n.length/4)),h=o(n,r,Math.ceil(n.length/2));if(!d&&!h)return null;s=h?d&&d[4].length>h[4].length?d:h:d,t.length>e.length?(l=s[0],u=s[1],c=s[2],f=s[3]):(c=s[0],f=s[1],l=s[2],u=s[3]);var p=s[4];return[l,u,c,f,p]}(t,e);if(f){var d=f[0],h=f[1],p=f[2],m=f[3],g=f[4],v=r(d,p),y=r(h,m);return v.concat([[0,g]],y)}return function(t,e){for(var r=t.length,i=e.length,a=Math.ceil((r+i)/2),s=a,l=2*a,u=new Array(l),c=new Array(l),f=0;fr)m+=2;else if(w>i)p+=2;else if(h&&(x=s+d-b)>=0&&x=(k=r-c[x]))return o(t,e,O,w)}for(var C=-y+g;C<=y-v;C+=2){for(var k,x=s+C,S=(k=C==-y||C!=y&&c[x-1]r)v+=2;else if(S>i)g+=2;else if(!h){var O;if((_=s+d-C)>=0&&_=(k=r-k))return o(t,e,O,w)}}}return[[n,t],[1,e]]}(t,e)}(t=t.substring(0,t.length-c),e=e.substring(0,e.length-c));return f&&h.unshift([0,f]),d&&h.push([0,d]),s(h),null!=l&&(h=function(t,e){var r=function(t,e){if(0===e)return[0,t];for(var r=0,o=0;o0&&o.splice(i+2,0,[s[0],l]),u(o,i,3)}return t}(h,l)),h=function(t){for(var e=!1,r=function(t){return t.charCodeAt(0)>=56320&&t.charCodeAt(0)<=57343},o=function(t){return t.charCodeAt(t.length-1)>=55296&&t.charCodeAt(t.length-1)<=56319},i=2;i0&&a.push(t[i]);return a}(h)}function o(t,e,n,o){var i=t.substring(0,n),a=e.substring(0,o),s=t.substring(n),l=e.substring(o),u=r(i,a),c=r(s,l);return u.concat(c)}function i(t,e){if(!t||!e||t.charAt(0)!=e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),o=r,i=0;n1?(0!==o&&0!==l&&(0!==(e=i(c,u))&&(r-o-l>0&&0==t[r-o-l-1][0]?t[r-o-l-1][1]+=c.substring(0,e):(t.splice(0,0,[0,c.substring(0,e)]),r++),c=c.substring(e),u=u.substring(e)),0!==(e=a(c,u))&&(t[r][1]=c.substring(c.length-e)+t[r][1],c=c.substring(0,c.length-e),u=u.substring(0,u.length-e))),0===o?t.splice(r-l,o+l,[1,c]):0===l?t.splice(r-o,o+l,[n,u]):t.splice(r-o-l,o+l,[n,u],[1,c]),r=r-o-l+(o?1:0)+(l?1:0)+1):0!==r&&0==t[r-1][0]?(t[r-1][1]+=t[r][1],t.splice(r,1)):r++,l=0,o=0,u="",c=""}""===t[t.length-1][1]&&t.pop();var f=!1;for(r=1;r=0&&r>=e-1;r--)if(r+1=700)&&(n.bold=!0),Object.keys(n).length>0&&(e=E(e,n)),parseFloat(r.textIndent||0)>0&&(e=(new s.default).insert("\t").concat(e)),e}],["li",function(t,e){var n=l.default.query(t);if(null==n||"list-item"!==n.blotName||!A(e,"\n"))return e;for(var r=-1,o=t.parentNode;!o.classList.contains("ql-clipboard");)"list"===(l.default.query(o)||{}).blotName&&(r+=1),o=o.parentNode;return r<=0?e:e.compose((new s.default).retain(e.length()-1).retain(1,{indent:r}))}],["b",L.bind(L,"bold")],["i",L.bind(L,"italic")],["style",function(){return new s.default}]],x=[d.AlignAttribute,g.DirectionAttribute].reduce((function(t,e){return t[e.keyName]=e,t}),{}),S=[d.AlignStyle,h.BackgroundStyle,m.ColorStyle,g.DirectionStyle,v.FontStyle,y.SizeStyle].reduce((function(t,e){return t[e.keyName]=e,t}),{}),O=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.quill.root.addEventListener("paste",r.onPaste.bind(r)),r.container=r.quill.addContainer("ql-clipboard"),r.container.setAttribute("contenteditable",!0),r.container.setAttribute("tabindex",-1),r.matchers=[],k.concat(r.options.matchers).forEach((function(t){var e=o(t,2),i=e[0],a=e[1];(n.matchVisual||a!==R)&&r.addMatcher(i,a)})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof 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)}(e,t),i(e,[{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 +\<"),this.convert();var e=this.quill.getFormat(this.quill.selection.savedRange.index);if(e[p.default.blotName]){var n=this.container.innerText;return this.container.innerHTML="",(new s.default).insert(n,_({},p.default.blotName,e[p.default.blotName]))}var r=this.prepareMatching(),i=o(r,2),a=i[0],l=i[1],u=N(this.container,a,l);return A(u,"\n")&&null==u.ops[u.ops.length-1].attributes&&(u=u.compose((new s.default).retain(u.length()-1).delete(1))),w.log("convert",this.container.innerHTML,u),this.container.innerHTML="",u}},{key:"dangerouslyPasteHTML",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.default.sources.API;if("string"==typeof t)this.quill.setContents(this.convert(t),e),this.quill.setSelection(0,u.default.sources.SILENT);else{var r=this.convert(e);this.quill.updateContents((new s.default).retain(t).concat(r),n),this.quill.setSelection(t+r.length(),u.default.sources.SILENT)}}},{key:"onPaste",value:function(t){var e=this;if(!t.defaultPrevented&&this.quill.isEnabled()){var n=this.quill.getSelection(),r=(new s.default).retain(n.index),o=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(u.default.sources.SILENT),setTimeout((function(){r=r.concat(e.convert()).delete(n.length),e.quill.updateContents(r,u.default.sources.USER),e.quill.setSelection(r.length()-n.length,u.default.sources.SILENT),e.quill.scrollingContainer.scrollTop=o,e.quill.focus()}),1)}}},{key:"prepareMatching",value:function(){var t=this,e=[],n=[];return this.matchers.forEach((function(r){var i=o(r,2),a=i[0],s=i[1];switch(a){case Node.TEXT_NODE:n.push(s);break;case Node.ELEMENT_NODE:e.push(s);break;default:[].forEach.call(t.container.querySelectorAll(a),(function(t){t[C]=t[C]||[],t[C].push(s)}))}})),[e,n]}}]),e}(f.default);function E(t,e,n){return"object"===(void 0===e?"undefined":r(e))?Object.keys(e).reduce((function(t,n){return E(t,n,e[n])}),t):t.reduce((function(t,r){return r.attributes&&r.attributes[e]?t.push(r):t.insert(r.insert,(0,a.default)({},_({},e,n),r.attributes))}),new s.default)}function T(t){if(t.nodeType!==Node.ELEMENT_NODE)return{};var e="__ql-computed-style";return t[e]||(t[e]=window.getComputedStyle(t))}function A(t,e){for(var n="",r=t.ops.length-1;r>=0&&n.length-1}function N(t,e,n){return t.nodeType===t.TEXT_NODE?n.reduce((function(e,n){return n(t,e)}),new s.default):t.nodeType===t.ELEMENT_NODE?[].reduce.call(t.childNodes||[],(function(r,o){var i=N(o,e,n);return o.nodeType===t.ELEMENT_NODE&&(i=e.reduce((function(t,e){return e(o,t)}),i),i=(o[C]||[]).reduce((function(t,e){return e(o,t)}),i)),r.concat(i)}),new s.default):new s.default}function L(t,e,n){return E(n,t,!0)}function I(t,e){var n=l.default.Attributor.Attribute.keys(t),r=l.default.Attributor.Class.keys(t),o=l.default.Attributor.Style.keys(t),i={};return n.concat(r).concat(o).forEach((function(e){var n=l.default.query(e,l.default.Scope.ATTRIBUTE);null!=n&&(i[n.attrName]=n.value(t),i[n.attrName])||(null==(n=x[e])||n.attrName!==e&&n.keyName!==e||(i[n.attrName]=n.value(t)||void 0),null==(n=S[e])||n.attrName!==e&&n.keyName!==e||(n=S[e],i[n.attrName]=n.value(t)||void 0))})),Object.keys(i).length>0&&(e=E(e,i)),e}function j(t,e){var n=l.default.query(t);if(null==n)return e;if(n.prototype instanceof l.default.Embed){var r={},o=n.value(t);null!=o&&(r[n.blotName]=o,e=(new s.default).insert(r,n.formats(t)))}else"function"==typeof n.formats&&(e=E(e,n.blotName,n.formats(t)));return e}function P(t,e){return A(e,"\n")||(D(t)||e.length()>0&&t.nextSibling&&D(t.nextSibling))&&e.insert("\n"),e}function R(t,e){if(D(t)&&null!=t.nextElementSibling&&!A(e,"\n\n")){var n=t.offsetHeight+parseFloat(T(t).marginTop)+parseFloat(T(t).marginBottom);t.nextElementSibling.offsetTop>t.offsetTop+1.5*n&&e.insert("\n")}return e}function $(t,e){var n=t.data;if("O:P"===t.parentNode.tagName)return e.insert(n.trim());if(0===n.trim().length&&t.parentNode.classList.contains("ql-clipboard"))return e;if(!T(t.parentNode).whiteSpace.startsWith("pre")){var r=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,r.bind(r,!0)),(null==t.previousSibling&&D(t.parentNode)||null!=t.previousSibling&&D(t.previousSibling))&&(n=n.replace(/^\s+/,r.bind(r,!1))),(null==t.nextSibling&&D(t.parentNode)||null!=t.nextSibling&&D(t.nextSibling))&&(n=n.replace(/\s+$/,r.bind(r,!1)))}return e.insert(n)}O.DEFAULTS={matchers:[],matchVisual:!0},e.default=O,e.matchAttributor=I,e.matchBlot=j,e.matchNewline=P,e.matchSpacing=R,e.matchText=$},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n '},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;nr.right&&(i=r.right-o.right,this.root.style.left=e+i+"px"),o.leftr.bottom){var a=o.bottom-o.top,s=t.bottom-t.top+a;this.root.style.top=n-s+"px",this.root.classList.add("ql-flip")}return i}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},i=function(){function t(t,e){for(var n=0;n','','',''].join(""),e.default=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=P(n(29)),o=n(36),i=n(38),a=n(64),s=P(n(65)),l=P(n(66)),u=n(67),c=P(u),f=n(37),d=n(26),h=n(39),p=n(40),m=P(n(56)),g=P(n(68)),v=P(n(27)),y=P(n(69)),b=P(n(70)),_=P(n(71)),w=P(n(72)),C=P(n(73)),k=n(13),x=P(k),S=P(n(74)),O=P(n(75)),E=P(n(57)),T=P(n(41)),A=P(n(28)),D=P(n(59)),N=P(n(60)),L=P(n(61)),I=P(n(108)),j=P(n(62));function P(t){return t&&t.__esModule?t:{default:t}}r.default.register({"attributors/attribute/direction":i.DirectionAttribute,"attributors/class/align":o.AlignClass,"attributors/class/background":f.BackgroundClass,"attributors/class/color":d.ColorClass,"attributors/class/direction":i.DirectionClass,"attributors/class/font":h.FontClass,"attributors/class/size":p.SizeClass,"attributors/style/align":o.AlignStyle,"attributors/style/background":f.BackgroundStyle,"attributors/style/color":d.ColorStyle,"attributors/style/direction":i.DirectionStyle,"attributors/style/font":h.FontStyle,"attributors/style/size":p.SizeStyle},!0),r.default.register({"formats/align":o.AlignClass,"formats/direction":i.DirectionClass,"formats/indent":a.IndentClass,"formats/background":f.BackgroundStyle,"formats/color":d.ColorStyle,"formats/font":h.FontClass,"formats/size":p.SizeClass,"formats/blockquote":s.default,"formats/code-block":x.default,"formats/header":l.default,"formats/list":c.default,"formats/bold":m.default,"formats/code":k.Code,"formats/italic":g.default,"formats/link":v.default,"formats/script":y.default,"formats/strike":b.default,"formats/underline":_.default,"formats/image":w.default,"formats/video":C.default,"formats/list/item":u.ListItem,"modules/formula":S.default,"modules/syntax":O.default,"modules/toolbar":E.default,"themes/bubble":I.default,"themes/snow":j.default,"ui/icons":T.default,"ui/picker":A.default,"ui/icon-picker":N.default,"ui/color-picker":D.default,"ui/tooltip":L.default},!0),e.default=r.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IndentClass=void 0;var r,o=function(){function t(t,e){for(var n=0;n0&&this.children.tail.format(t,e)}},{key:"formats",value:function(){return t={},e=this.statics.blotName,n=this.statics.formats(this.domNode),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t;var t,e,n}},{key:"insertBefore",value:function(t,n){if(t instanceof d)o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n);else{var r=null==n?this.length():n.offset(this),i=this.split(r);i.parent.insertBefore(t,i)}}},{key:"optimize",value:function(t){o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){if(t.statics.blotName!==this.statics.blotName){var n=i.default.create(this.statics.defaultChild);t.moveChildren(n),this.appendChild(n)}o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t)}}]),e}(s.default);h.blotName="list",h.scope=i.default.Scope.BLOCK_BLOT,h.tagName=["OL","UL"],h.defaultChild="list-item",h.allowedChildren=[d],e.ListItem=d,e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=n(56);function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var s=function(t){function e(){return i(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof 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)}(e,t),e}(((r=o)&&r.__esModule?r:{default:r}).default);s.blotName="italic",s.tagName=["EM","I"],e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=i(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return"string"==typeof t&&n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return f.reduce((function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e}),{})}},{key:"match",value:function(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}},{key:"sanitize",value:function(t){return(0,l.sanitize)(t,["http","https","data"])?t:"//:0"}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}(s.default.Embed);d.blotName="image",d.tagName="IMG",e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=i(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return f.reduce((function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e}),{})}},{key:"sanitize",value:function(t){return l.default.sanitize(t)}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}(a.BlockEmbed);d.blotName="video",d.className="ql-video",d.tagName="IFRAME",e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.FormulaBlot=void 0;var r=function(){function t(t,e){for(var n=0;n0||null==this.cachedText)&&(this.domNode.innerHTML=t(e),this.domNode.normalize(),this.attach()),this.cachedText=e)}}]),e}(l(n(13)).default);d.className="ql-syntax";var h=new i.default.Attributor.Class("token","hljs",{scope:i.default.Scope.INLINE}),p=function(t){function e(t,n){u(this,e);var r=c(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if("function"!=typeof r.options.highlight)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var o=null;return r.quill.on(a.default.events.SCROLL_OPTIMIZE,(function(){clearTimeout(o),o=setTimeout((function(){r.highlight(),o=null}),r.options.interval)})),r.highlight(),r}return f(e,t),r(e,null,[{key:"register",value:function(){a.default.register(h,!0),a.default.register(d,!0)}}]),r(e,[{key:"highlight",value:function(){var t=this;if(!this.quill.selection.composing){this.quill.update(a.default.sources.USER);var e=this.quill.getSelection();this.quill.scroll.descendants(d).forEach((function(e){e.highlight(t.options.highlight)})),this.quill.update(a.default.sources.SILENT),null!=e&&this.quill.setSelection(e,a.default.sources.SILENT)}}}]),e}(s.default);p.DEFAULTS={highlight:null==window.hljs?null:function(t){return window.hljs.highlightAuto(t).value},interval:1e3},e.CodeBlock=d,e.CodeToken=h,e.default=p},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BubbleTooltip=void 0;var r=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},o=function(){function t(t,e){for(var n=0;n0&&o===a.default.sources.USER){r.show(),r.root.style.left="0px",r.root.style.width="",r.root.style.width=r.root.offsetWidth+"px";var i=r.quill.getLines(e.index,e.length);if(1===i.length)r.position(r.quill.getBounds(e));else{var s=i[i.length-1],l=r.quill.getIndex(s),c=Math.min(s.length()-1,e.index+e.length-l),f=r.quill.getBounds(new u.Range(l,c));r.position(f)}}else document.activeElement!==r.textbox&&r.quill.hasFocus()&&r.hide()})),r}return p(e,t),o(e,[{key:"listen",value:function(){var t=this;r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",(function(){t.root.classList.remove("ql-editing")})),this.quill.on(a.default.events.SCROLL_OPTIMIZE,(function(){setTimeout((function(){if(!t.root.classList.contains("ql-hidden")){var e=t.quill.getSelection();null!=e&&t.position(t.quill.getBounds(e))}}),1)}))}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(t){var n=r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"position",this).call(this,t),o=this.root.querySelector(".ql-tooltip-arrow");if(o.style.marginLeft="",0===n)return n;o.style.marginLeft=-1*n-o.offsetWidth/2+"px"}}]),e}(s.BaseTooltip);v.TEMPLATE=['','"].join(""),e.BubbleTooltip=v,e.default=g},function(t,e,n){t.exports=n(63)}]).default},t.exports=r()},51474:(t,e,n)=>{"use strict";function r(t){return r="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},r(t)}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(){return i=Object.assign||function(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function l(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);eCe,MultiDrag:()=>be,Sortable:()=>qt,Swap:()=>le});function u(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var c=u(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),f=u(/Edge/i),d=u(/firefox/i),h=u(/safari/i)&&!u(/chrome/i)&&!u(/android/i),p=u(/iP(ad|od|hone)/i),m=u(/chrome/i)&&u(/android/i),g={capture:!1,passive:!1};function v(t,e,n){t.addEventListener(e,n,!c&&g)}function y(t,e,n){t.removeEventListener(e,n,!c&&g)}function b(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function _(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function w(t,e,n,r){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&b(t,e):b(t,e))||r&&t===n)return t;if(t===n)break}while(t=_(t))}return null}var C,k=/\s+/g;function x(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var r=(" "+t.className+" ").replace(k," ").replace(" "+e+" "," ");t.className=(r+(n?" "+e:"")).replace(k," ")}}function S(t,e,n){var r=t&&t.style;if(r){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in r||-1!==e.indexOf("webkit")||(e="-webkit-"+e),r[e]=n+("string"==typeof n?"":"px")}}function O(t,e){var n="";if("string"==typeof t)n=t;else do{var r=S(t,"transform");r&&"none"!==r&&(n=r+" "+n)}while(!e&&(t=t.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function E(t,e,n){if(t){var r=t.getElementsByTagName(e),o=0,i=r.length;if(n)for(;o=i:o<=i))return r;if(r===T())break;r=P(r,!1)}return!1}function N(t,e,n){for(var r=0,o=0,i=t.children;o2&&void 0!==arguments[2]?arguments[2]:{},r=n.evt,o=s(n,["evt"]);W.pluginEvent.bind(qt)(t,e,a({dragEl:G,parentEl:Z,ghostEl:J,rootEl:Q,nextEl:tt,lastDownEl:et,cloneEl:nt,cloneHidden:rt,dragStarted:gt,putSortable:ut,activeSortable:qt.active,originalEvent:r,oldIndex:ot,oldDraggableIndex:at,newIndex:it,newDraggableIndex:st,hideGhostForTarget:Rt,unhideGhostForTarget:$t,cloneNowHidden:function(){rt=!0},cloneNowShown:function(){rt=!1},dispatchSortableEvent:function(t){X({sortable:e,name:t,originalEvent:r})}},o))};function X(t){K(a({putSortable:ut,cloneEl:nt,targetEl:G,rootEl:Q,oldIndex:ot,oldDraggableIndex:at,newIndex:it,newDraggableIndex:st},t))}var G,Z,J,Q,tt,et,nt,rt,ot,it,at,st,lt,ut,ct,ft,dt,ht,pt,mt,gt,vt,yt,bt,_t,wt=!1,Ct=!1,kt=[],xt=!1,St=!1,Ot=[],Et=!1,Tt=[],At="undefined"!=typeof document,Dt=p,Nt=f||c?"cssFloat":"float",Lt=At&&!m&&!p&&"draggable"in document.createElement("div"),It=function(){if(At){if(c)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),jt=function(t,e){var n=S(t),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=N(t,0,e),i=N(t,1,e),a=o&&S(o),s=i&&S(i),l=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+A(o).width,u=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+A(i).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&a.float&&"none"!==a.float){var c="left"===a.float?"left":"right";return!i||"both"!==s.clear&&s.clear!==c?"horizontal":"vertical"}return o&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||l>=r&&"none"===n[Nt]||i&&"none"===n[Nt]&&l+u>r)?"vertical":"horizontal"},Pt=function(t){function e(t,n){return function(r,o,i,a){var s=r.options.group.name&&o.options.group.name&&r.options.group.name===o.options.group.name;if(null==t&&(n||s))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(r,o,i,a),n)(r,o,i,a);var l=(n?r:o).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},o=t.group;o&&"object"==r(o)||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},Rt=function(){!It&&J&&S(J,"display","none")},$t=function(){!It&&J&&S(J,"display","")};At&&document.addEventListener("click",(function(t){if(Ct)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Ct=!1,!1}),!0);var Mt=function(t){if(G){t=t.touches?t.touches[0]:t;var e=(o=t.clientX,i=t.clientY,kt.some((function(t){if(!L(t)){var e=A(t),n=t[z].options.emptyInsertThreshold,r=o>=e.left-n&&o<=e.right+n,s=i>=e.top-n&&i<=e.bottom+n;return n&&r&&s?a=t:void 0}})),a);if(e){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[z]._onDragOver(n)}}var o,i,a},Bt=function(t){G&&G.parentNode[z]._isOutsideThisEl(t.target)};function qt(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=i({},e),t[z]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return jt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==qt.supportPointer&&"PointerEvent"in window,emptyInsertThreshold:5};for(var r in W.initializePlugins(this,t,n),n)!(r in e)&&(e[r]=n[r]);for(var o in Pt(e),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!e.forceFallback&&Lt,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?v(t,"pointerdown",this._onTapStart):(v(t,"mousedown",this._onTapStart),v(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(v(t,"dragover",this),v(t,"dragenter",this)),kt.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),i(this,U())}function Ft(t,e,n,r,o,i,a,s){var l,u,d=t[z],h=d.options.onMove;return!window.CustomEvent||c||f?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=r,l.related=o||e,l.relatedRect=i||A(e),l.willInsertAfter=s,l.originalEvent=a,t.dispatchEvent(l),h&&(u=h.call(d,l,a)),u}function zt(t){t.draggable=!1}function Ut(){Et=!1}function Ht(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,r=0;n--;)r+=e.charCodeAt(n);return r.toString(36)}function Vt(t){return setTimeout(t,0)}function Wt(t){return clearTimeout(t)}qt.prototype={constructor:qt,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(vt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,G):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,r=this.options,o=r.preventOnFilter,i=t.type,a=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,s=(a||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,u=r.filter;if(function(t){Tt.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var r=e[n];r.checked&&Tt.push(r)}}(n),!G&&!(/mousedown|pointerdown/.test(i)&&0!==t.button||r.disabled||l.isContentEditable||(s=w(s,r.draggable,n,!1))&&s.animated||et===s)){if(ot=I(s),at=I(s,r.draggable),"function"==typeof u){if(u.call(this,t,s,this))return X({sortable:e,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),Y("filter",e,{evt:t}),void(o&&t.cancelable&&t.preventDefault())}else if(u&&(u=u.split(",").some((function(r){if(r=w(l,r.trim(),n,!1))return X({sortable:e,rootEl:r,name:"filter",targetEl:s,fromEl:n,toEl:n}),Y("filter",e,{evt:t}),!0}))))return void(o&&t.cancelable&&t.preventDefault());r.handle&&!w(l,r.handle,n,!1)||this._prepareDragStart(t,a,s)}}},_prepareDragStart:function(t,e,n){var r,o=this,i=o.el,a=o.options,s=i.ownerDocument;if(n&&!G&&n.parentNode===i){var l=A(n);if(Q=i,Z=(G=n).parentNode,tt=G.nextSibling,et=n,lt=a.group,qt.dragged=G,ct={target:G,clientX:(e||t).clientX,clientY:(e||t).clientY},pt=ct.clientX-l.left,mt=ct.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,G.style["will-change"]="all",r=function(){Y("delayEnded",o,{evt:t}),qt.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!d&&o.nativeDraggable&&(G.draggable=!0),o._triggerDragStart(t,e),X({sortable:o,name:"choose",originalEvent:t}),x(G,a.chosenClass,!0))},a.ignore.split(",").forEach((function(t){E(G,t.trim(),zt)})),v(s,"dragover",Mt),v(s,"mousemove",Mt),v(s,"touchmove",Mt),v(s,"mouseup",o._onDrop),v(s,"touchend",o._onDrop),v(s,"touchcancel",o._onDrop),d&&this.nativeDraggable&&(this.options.touchStartThreshold=4,G.draggable=!0),Y("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(f||c))r();else{if(qt.eventCanceled)return void this._onDrop();v(s,"mouseup",o._disableDelayedDrag),v(s,"touchend",o._disableDelayedDrag),v(s,"touchcancel",o._disableDelayedDrag),v(s,"mousemove",o._delayedDragTouchMoveHandler),v(s,"touchmove",o._delayedDragTouchMoveHandler),a.supportPointer&&v(s,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(r,a.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){G&&zt(G),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;y(t,"mouseup",this._disableDelayedDrag),y(t,"touchend",this._disableDelayedDrag),y(t,"touchcancel",this._disableDelayedDrag),y(t,"mousemove",this._delayedDragTouchMoveHandler),y(t,"touchmove",this._delayedDragTouchMoveHandler),y(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?v(document,"pointermove",this._onTouchMove):v(document,e?"touchmove":"mousemove",this._onTouchMove):(v(G,"dragend",this),v(Q,"dragstart",this._onDragStart));try{document.selection?Vt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(wt=!1,Q&&G){Y("dragStarted",this,{evt:e}),this.nativeDraggable&&v(document,"dragover",Bt);var n=this.options;!t&&x(G,n.dragClass,!1),x(G,n.ghostClass,!0),qt.active=this,t&&this._appendGhost(),X({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(ft){this._lastX=ft.clientX,this._lastY=ft.clientY,Rt();for(var t=document.elementFromPoint(ft.clientX,ft.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(ft.clientX,ft.clientY))!==e;)e=t;if(G.parentNode[z]._isOutsideThisEl(t),e)do{if(e[z]){if(e[z]._onDragOver({clientX:ft.clientX,clientY:ft.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);$t()}},_onTouchMove:function(t){if(ct){var e=this.options,n=e.fallbackTolerance,r=e.fallbackOffset,o=t.touches?t.touches[0]:t,i=J&&O(J,!0),a=J&&i&&i.a,s=J&&i&&i.d,l=Dt&&_t&&j(_t),u=(o.clientX-ct.clientX+r.x)/(a||1)+(l?l[0]-Ot[0]:0)/(a||1),c=(o.clientY-ct.clientY+r.y)/(s||1)+(l?l[1]-Ot[1]:0)/(s||1);if(!qt.active&&!wt){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))r.right+o||t.clientX<=r.right&&t.clientY>r.bottom&&t.clientX>=r.left:t.clientX>r.right&&t.clientY>r.top||t.clientX<=r.right&&t.clientY>r.bottom+o}(t,o,this)&&!g.animated){if(g===G)return B(!1);if(g&&i===t.target&&(s=g),s&&(n=A(s)),!1!==Ft(Q,i,G,e,s,n,t,!!s))return $(),i.appendChild(G),Z=i,q(),B(!0)}else if(s.parentNode===i){n=A(s);var v,y,b,_=G.parentNode!==i,C=!function(t,e,n){var r=n?t.left:t.top,o=n?t.right:t.bottom,i=n?t.width:t.height,a=n?e.left:e.top,s=n?e.right:e.bottom,l=n?e.width:e.height;return r===a||o===s||r+i/2===a+l/2}(G.animated&&G.toRect||e,s.animated&&s.toRect||n,o),k=o?"top":"left",O=D(s,"top","top")||D(G,"top","top"),E=O?O.scrollTop:void 0;if(vt!==s&&(y=n[k],xt=!1,St=!C&&l.invertSwap||_),v=function(t,e,n,r,o,i,a,s){var l=r?t.clientY:t.clientX,u=r?n.height:n.width,c=r?n.top:n.left,f=r?n.bottom:n.right,d=!1;if(!a)if(s&&btc+u*i/2:lf-bt)return-yt}else if(l>c+u*(1-o)/2&&lf-u*i/2))return l>c+u/2?1:-1;return 0}(t,s,n,o,C?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,St,vt===s),0!==v){var T=I(G);do{T-=v,b=Z.children[T]}while(b&&("none"===S(b,"display")||b===J))}if(0===v||b===s)return B(!1);vt=s,yt=v;var N=s.nextElementSibling,j=!1,P=Ft(Q,i,G,e,s,n,t,j=1===v);if(!1!==P)return 1!==P&&-1!==P||(j=1===P),Et=!0,setTimeout(Ut,30),$(),j&&!N?i.appendChild(G):s.parentNode.insertBefore(G,j?N:s),O&&M(O,0,E-O.scrollTop),Z=G.parentNode,void 0===y||St||(bt=Math.abs(y-A(s)[k])),q(),B(!0)}if(i.contains(G))return B(!1)}return!1}function R(l,u){Y(l,p,a({evt:t,isOwner:f,axis:o?"vertical":"horizontal",revert:r,dragRect:e,targetRect:n,canSort:d,fromSortable:h,target:s,completed:B,onMove:function(n,r){return Ft(Q,i,G,e,n,A(n),t,r)},changed:q},u))}function $(){R("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function B(e){return R("dragOverCompleted",{insertion:e}),e&&(f?c._hideClone():c._showClone(p),p!==h&&(x(G,ut?ut.options.ghostClass:c.options.ghostClass,!1),x(G,l.ghostClass,!0)),ut!==p&&p!==qt.active?ut=p:p===qt.active&&ut&&(ut=null),h===p&&(p._ignoreWhileAnimating=s),p.animateAll((function(){R("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===G&&!G.animated||s===i&&!s.animated)&&(vt=null),l.dragoverBubble||t.rootEl||s===document||(G.parentNode[z]._isOutsideThisEl(t.target),!e&&Mt(t)),!l.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),m=!0}function q(){it=I(G),st=I(G,l.draggable),X({sortable:p,name:"change",toEl:i,newIndex:it,newDraggableIndex:st,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){y(document,"mousemove",this._onTouchMove),y(document,"touchmove",this._onTouchMove),y(document,"pointermove",this._onTouchMove),y(document,"dragover",Mt),y(document,"mousemove",Mt),y(document,"touchmove",Mt)},_offUpEvents:function(){var t=this.el.ownerDocument;y(t,"mouseup",this._onDrop),y(t,"touchend",this._onDrop),y(t,"pointerup",this._onDrop),y(t,"touchcancel",this._onDrop),y(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;it=I(G),st=I(G,n.draggable),Y("drop",this,{evt:t}),Z=G&&G.parentNode,it=I(G),st=I(G,n.draggable),qt.eventCanceled||(wt=!1,St=!1,xt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Wt(this.cloneId),Wt(this._dragStartId),this.nativeDraggable&&(y(document,"drop",this),y(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),h&&S(document.body,"user-select",""),S(G,"transform",""),t&&(gt&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),J&&J.parentNode&&J.parentNode.removeChild(J),(Q===Z||ut&&"clone"!==ut.lastPutMode)&&nt&&nt.parentNode&&nt.parentNode.removeChild(nt),G&&(this.nativeDraggable&&y(G,"dragend",this),zt(G),G.style["will-change"]="",gt&&!wt&&x(G,ut?ut.options.ghostClass:this.options.ghostClass,!1),x(G,this.options.chosenClass,!1),X({sortable:this,name:"unchoose",toEl:Z,newIndex:null,newDraggableIndex:null,originalEvent:t}),Q!==Z?(it>=0&&(X({rootEl:Z,name:"add",toEl:Z,fromEl:Q,originalEvent:t}),X({sortable:this,name:"remove",toEl:Z,originalEvent:t}),X({rootEl:Z,name:"sort",toEl:Z,fromEl:Q,originalEvent:t}),X({sortable:this,name:"sort",toEl:Z,originalEvent:t})),ut&&ut.save()):it!==ot&&it>=0&&(X({sortable:this,name:"update",toEl:Z,originalEvent:t}),X({sortable:this,name:"sort",toEl:Z,originalEvent:t})),qt.active&&(null!=it&&-1!==it||(it=ot,st=at),X({sortable:this,name:"end",toEl:Z,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){Y("nulling",this),Q=G=Z=J=tt=nt=et=rt=ct=ft=gt=it=st=ot=at=vt=yt=ut=lt=qt.dragged=qt.ghost=qt.clone=qt.active=null,Tt.forEach((function(t){t.checked=!0})),Tt.length=dt=ht=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":G&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,r=0,o=n.length,i=this.options;r1&&(pe.forEach((function(t){r.addAnimationState({target:t,rect:ve?A(t):o}),F(t),t.fromRect=o,e.removeAnimationState(t)})),ve=!1,function(t,e){pe.forEach((function(n,r){var o=e.children[n.sortableIndex+(t?Number(r):0)];o?e.insertBefore(n,o):e.appendChild(n)}))}(!this.options.removeCloneOnHide,n))},dragOverCompleted:function(t){var e=t.sortable,n=t.isOwner,r=t.insertion,o=t.activeSortable,i=t.parentEl,a=t.putSortable,s=this.options;if(r){if(n&&o._hideClone(),ge=!1,s.animation&&pe.length>1&&(ve||!n&&!o.options.sort&&!a)){var l=A(fe,!1,!0,!0);pe.forEach((function(t){t!==fe&&(q(t,l),i.appendChild(t))})),ve=!0}if(!n)if(ve||we(),pe.length>1){var u=he;o._showClone(e),o.options.animation&&!he&&u&&me.forEach((function(t){o.addAnimationState({target:t,rect:de}),t.fromRect=de,t.thisAnimationDuration=null}))}else o._showClone(e)}},dragOverAnimationCapture:function(t){var e=t.dragRect,n=t.isOwner,r=t.activeSortable;if(pe.forEach((function(t){t.thisAnimationDuration=null})),r.options.animation&&!n&&r.multiDrag.isMultiDrag){de=i({},e);var o=O(fe,!0);de.top-=o.f,de.left-=o.e}},dragOverAnimationComplete:function(){ve&&(ve=!1,we())},drop:function(t){var e=t.originalEvent,n=t.rootEl,r=t.parentEl,o=t.sortable,i=t.dispatchSortableEvent,a=t.oldIndex,s=t.putSortable,l=s||this.sortable;if(e){var u=this.options,c=r.children;if(!ye)if(u.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),x(fe,u.selectedClass,!~pe.indexOf(fe)),~pe.indexOf(fe))pe.splice(pe.indexOf(fe),1),ue=null,K({sortable:o,rootEl:n,name:"deselect",targetEl:fe,originalEvt:e});else{if(pe.push(fe),K({sortable:o,rootEl:n,name:"select",targetEl:fe,originalEvt:e}),e.shiftKey&&ue&&o.el.contains(ue)){var f,d,h=I(ue),p=I(fe);if(~h&&~p&&h!==p)for(p>h?(d=h,f=p):(d=p,f=h+1);d1){var m=A(fe),g=I(fe,":not(."+this.options.selectedClass+")");if(!ge&&u.animation&&(fe.thisAnimationDuration=null),l.captureAnimationState(),!ge&&(u.animation&&(fe.fromRect=m,pe.forEach((function(t){if(t.thisAnimationDuration=null,t!==fe){var e=ve?A(t):m;t.fromRect=e,l.addAnimationState({target:t,rect:e})}}))),we(),pe.forEach((function(t){c[g]?r.insertBefore(t,c[g]):r.appendChild(t),g++})),a===I(fe))){var v=!1;pe.forEach((function(t){t.sortableIndex===I(t)||(v=!0)})),v&&i("update")}pe.forEach((function(t){F(t)})),l.animateAll()}ce=l}(n===r||s&&"clone"!==s.lastPutMode)&&me.forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)}))}},nullingGlobal:function(){this.isMultiDrag=ye=!1,me.length=0},destroyGlobal:function(){this._deselectMultiDrag(),y(document,"pointerup",this._deselectMultiDrag),y(document,"mouseup",this._deselectMultiDrag),y(document,"touchend",this._deselectMultiDrag),y(document,"keydown",this._checkKeyDown),y(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(void 0!==ye&&ye||ce!==this.sortable||t&&w(t.target,this.options.draggable,this.sortable.el,!1)||t&&0!==t.button))for(;pe.length;){var e=pe[0];x(e,this.options.selectedClass,!1),pe.shift(),K({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:e,originalEvt:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},i(t,{pluginName:"multiDrag",utils:{select:function(t){var e=t.parentNode[z];e&&e.options.multiDrag&&!~pe.indexOf(t)&&(ce&&ce!==e&&(ce.multiDrag._deselectMultiDrag(),ce=e),x(t,e.options.selectedClass,!0),pe.push(t))},deselect:function(t){var e=t.parentNode[z],n=pe.indexOf(t);e&&e.options.multiDrag&&~n&&(x(t,e.options.selectedClass,!1),pe.splice(n,1))}},eventProperties:function(){var t=this,e=[],n=[];return pe.forEach((function(r){var o;e.push({multiDragElement:r,index:r.sortableIndex}),o=ve&&r!==fe?-1:ve?I(r,":not(."+t.options.selectedClass+")"):I(r),n.push({multiDragElement:r,index:o})})),{items:l(pe),clones:[].concat(me),oldIndicies:e,newIndicies:n}},optionListeners:{multiDragKey:function(t){return"ctrl"===(t=t.toLowerCase())?t="Control":t.length>1&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}function _e(t,e){me.forEach((function(n,r){var o=e.children[n.sortableIndex+(t?Number(r):0)];o?e.insertBefore(n,o):e.appendChild(n)}))}function we(){pe.forEach((function(t){t!==fe&&t.parentNode&&t.parentNode.removeChild(t)}))}qt.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?v(document,"dragover",this._handleAutoScroll):this.options.supportPointer?v(document,"pointermove",this._handleFallbackAutoScroll):e.touches?v(document,"touchmove",this._handleFallbackAutoScroll):v(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?y(document,"dragover",this._handleAutoScroll):(y(document,"pointermove",this._handleFallbackAutoScroll),y(document,"touchmove",this._handleFallbackAutoScroll),y(document,"mousemove",this._handleFallbackAutoScroll)),ne(),ee(),clearTimeout(C),C=void 0},nulling:function(){Zt=Yt=Kt=te=Jt=Xt=Gt=null,Qt.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var n=this,r=(t.touches?t.touches[0]:t).clientX,o=(t.touches?t.touches[0]:t).clientY,i=document.elementFromPoint(r,o);if(Zt=t,e||f||c||h){oe(t,this.options,i,e);var a=P(i,!0);!te||Jt&&r===Xt&&o===Gt||(Jt&&ne(),Jt=setInterval((function(){var i=P(document.elementFromPoint(r,o),!0);i!==a&&(a=i,ee()),oe(t,n.options,i,e)}),10),Xt=r,Gt=o)}else{if(!this.options.bubbleScroll||P(i,!0)===T())return void ee();oe(t,this.options,P(i,!1),!1)}}},i(t,{pluginName:"scroll",initializeByDefault:!0})}),qt.mount(se,ae);const Ce=qt},47575:(t,e,n)=>{!function(){"use strict";var e=function(t){if(null===t)return"null";if(void 0===t)return"undefined";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},r=function(t){return{eq:t}},o=r((function(t,e){return t===e})),i=function(t){return r((function(e,n){if(e.length!==n.length)return!1;for(var r=e.length,o=0;o-1},U=function(t,e){for(var n=0,r=t.length;n=0;n--){e(t[n],n)}},K=function(t,e){for(var n=[],r=[],o=0,i=t.length;o=0&&e=e.length&&t.substr(n,n+e.length)===e}(t,e,0)},Bt=function(t){return function(e){return e.replace(t,"")}},qt=Bt(/^\s+|\s+$/g),Ft=Bt(/^\s+/g),zt=Bt(/\s+$/g),Ut=function(t){return t.length>0},Ht=function(t){return!Ut(t)},Vt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Wt=function(t){return function(e){return $t(e,t)}},Kt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return $t(t,"edge/")&&$t(t,"chrome")&&$t(t,"safari")&&$t(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Vt],search:function(t){return $t(t,"chrome")&&!$t(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return $t(t,"msie")||$t(t,"trident")}},{name:"Opera",versionRegexes:[Vt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Wt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Wt("firefox")},{name:"Safari",versionRegexes:[Vt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return($t(t,"safari")||$t(t,"mobile/"))&&$t(t,"applewebkit")}}],Yt=[{name:"Windows",search:Wt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return $t(t,"iphone")||$t(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Wt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Wt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Wt("linux"),versionRegexes:[]},{name:"Solaris",search:Wt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Wt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Wt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Xt={browsers:S(Kt),oses:S(Yt)},Gt="Edge",Zt="Chrome",Jt="Opera",Qt="Firefox",te="Safari",ee=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(Gt),isChrome:r(Zt),isIE:r("IE"),isOpera:r(Jt),isFirefox:r(Qt),isSafari:r(te)}},ne={unknown:function(){return ee({current:void 0,version:Pt.unknown()})},nu:ee,edge:S(Gt),chrome:S(Zt),ie:S("IE"),opera:S(Jt),firefox:S(Qt),safari:S(te)},re="Windows",oe="Android",ie="Linux",ae="Solaris",se="FreeBSD",le="ChromeOS",ue=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(re),isiOS:r("iOS"),isAndroid:r(oe),isOSX:r("OSX"),isLinux:r(ie),isSolaris:r(ae),isFreeBSD:r(se),isChromeOS:r(le)}},ce={unknown:function(){return ue({current:void 0,version:Pt.unknown()})},nu:ue,windows:S(re),ios:S("iOS"),android:S(oe),linux:S(ie),osx:S("OSX"),solaris:S(ae),freebsd:S(se),chromeos:S(le)},fe=function(t,e,n){var r=Xt.browsers(),o=Xt.oses(),i=e.bind((function(t){return function(t,e){return ut(e.brands,(function(e){var n=e.brand.toLowerCase();return J(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:Pt.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return Rt(t,e).map((function(t){var n=Pt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(ne.unknown,ne.nu),a=function(t,e){return Rt(t,e).map((function(t){var n=Pt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(ce.unknown,ce.nu),s=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),s=a||r("(pointer:coarse)"),l=o||!i&&a&&r("(min-device-width:768px)"),u=i||a&&!l,c=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!u&&!l&&!c;return{isiPad:S(o),isiPhone:S(i),isTablet:S(l),isPhone:S(u),isTouch:S(s),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:S(c),isDesktop:S(f)}}(a,i,t,n);return{browser:i,os:a,deviceType:s}},de=function(t){return window.matchMedia(t).matches},he=Lt((function(){return fe(navigator.userAgent,$.from(navigator.userAgentData),de)})),pe=function(){return he()},me=navigator.userAgent,ge=pe(),ve=ge.browser,ye=ge.os,be=ge.deviceType,_e=/WebKit/.test(me)&&!ve.isEdge(),we="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,Ce=-1!==me.indexOf("Windows Phone"),ke={opera:ve.isOpera(),webkit:_e,ie:!(!ve.isIE()&&!ve.isEdge())&&ve.version.major,gecko:ve.isFirefox(),mac:ye.isOSX()||ye.isiOS(),iOS:be.isiPad()||be.isiPhone(),android:ye.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:ve.isIE()?document.documentMode||7:10,fileApi:we,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!ve.isIE(),desktop:be.isDesktop(),windowsPhone:Ce,browser:{current:ve.current,version:ve.version,isChrome:ve.isChrome,isEdge:ve.isEdge,isFirefox:ve.isFirefox,isIE:ve.isIE,isOpera:ve.isOpera,isSafari:ve.isSafari},os:{current:ye.current,version:ye.version,isAndroid:ye.isAndroid,isChromeOS:ye.isChromeOS,isFreeBSD:ye.isFreeBSD,isiOS:ye.isiOS,isLinux:ye.isLinux,isOSX:ye.isOSX,isSolaris:ye.isSolaris,isWindows:ye.isWindows},deviceType:{isDesktop:be.isDesktop,isiPad:be.isiPad,isiPhone:be.isiPhone,isPhone:be.isPhone,isTablet:be.isTablet,isTouch:be.isTouch,isWebView:be.isWebView}},xe=/^\s*|\s*$/g,Se=function(t){return null==t?"":(""+t).replace(xe,"")},Oe=function(t,e){return e?!("array"!==e||!Ct(t))||typeof t===e:void 0!==t},Ee=function(t,e,n,r){r=r||this,t&&(n&&(t=t[n]),kt(t,(function(t,o){if(!1===e.call(r,t,o,n))return!1;Ee(t,e,n,r)})))},Te={trim:Se,isArray:Ct,is:Oe,toArray:function(t){if(Ct(t))return t;for(var e=[],n=0,r=t.length;n1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Ae(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Ae(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Ae(n)},fromDom:Ae,fromPoint:function(t,e,n){return $.from(t.dom.elementFromPoint(e,n)).map(Ae)}},Ne=function(t,e){var n=[],r=function(t){return n.push(t),e(t)},o=e(t);do{o=o.bind(r)}while(o.isSome());return n},Le=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Ie=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},je=function(t,e){return t.dom===e.dom},Pe=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},Re=function(t,e){return pe().browser.isIE()?Pe(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)};"undefined"!=typeof window?window:Function("return this;")();var $e=function(t){return t.dom.nodeName.toLowerCase()},Me=function(t){return t.dom.nodeType},Be=function(t){return function(e){return Me(e)===t}},qe=Be(1),Fe=Be(3),ze=Be(9),Ue=Be(11),He=function(t){return De.fromDom(t.dom.ownerDocument)},Ve=function(t){return ze(t)?t:He(t)},We=function(t){return De.fromDom(Ve(t).dom.defaultView)},Ke=function(t){return $.from(t.dom.parentNode).map(De.fromDom)},Ye=function(t){return $.from(t.dom.previousSibling).map(De.fromDom)},Xe=function(t){return $.from(t.dom.nextSibling).map(De.fromDom)},Ge=function(t){return nt(Ne(t,Ye))},Ze=function(t){return Ne(t,Xe)},Je=function(t){return H(t.dom.childNodes,De.fromDom)},Qe=function(t,e){var n=t.dom.childNodes;return $.from(n[e]).map(De.fromDom)},tn=function(t){return Qe(t,0)},en=function(t){return Qe(t,t.dom.childNodes.length-1)},nn=function(t){return t.dom.childNodes.length},rn=function(t){return Ue(t)&&b(t.dom.host)},on=_(Element.prototype.attachShadow)&&_(Node.prototype.getRootNode),an=S(on),sn=on?function(t){return De.fromDom(t.dom.getRootNode())}:Ve,ln=function(t){return rn(t)?t:function(t){var e=t.dom.head;if(null==e)throw new Error("Head is not available yet");return De.fromDom(e)}(Ve(t))},un=function(t){return De.fromDom(t.dom.host)},cn=function(t){return b(t.dom.shadowRoot)},fn=function(t,e){Ke(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},dn=function(t,e){Xe(t).fold((function(){Ke(t).each((function(t){pn(t,e)}))}),(function(t){fn(t,e)}))},hn=function(t,e){tn(t).fold((function(){pn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},pn=function(t,e){t.dom.appendChild(e.dom)},mn=function(t,e){V(e,(function(e){pn(t,e)}))},gn=function(t){t.dom.textContent="",V(Je(t),(function(t){vn(t)}))},vn=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},yn=function(t){var e,n=Je(t);n.length>0&&(e=t,V(n,(function(t){fn(e,t)}))),vn(t)},bn=function(t){var e=Fe(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n=e.ownerDocument;return function(t){var e=sn(t);return rn(e)?$.some(e):$.none()}(De.fromDom(e)).fold((function(){return n.body.contains(e)}),x(bn,un))},_n=function(t,e){return{left:t,top:e,translate:function(n,r){return _n(t+n,e+r)}}},wn=_n,Cn=function(t,e){return void 0!==t?t:void 0!==e?e:0},kn=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?wn(n.offsetLeft,n.offsetTop):bn(t)?function(t){var e=t.getBoundingClientRect();return wn(e.left,e.top)}(e):wn(0,0)},xn=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return wn(n,r)},Sn=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},On=function(t,e){pe().browser.isSafari()&&_(t.dom.scrollIntoViewIfNeeded)?t.dom.scrollIntoViewIfNeeded(!1):t.dom.scrollIntoView(e)},En=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Tn=function(t){var e=void 0===t?window:t,n=e.document,r=xn(De.fromDom(n));return function(t){var e=void 0===t?window:t;return pe().browser.isFirefox()?$.none():$.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return En(r.left,r.top,n,o)}),(function(t){return En(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},An=function(t){return function(e){return!!e&&e.nodeType===t}},Dn=function(t){return!!t&&!Object.getPrototypeOf(t)},Nn=An(1),Ln=function(t){var e=t.map((function(t){return t.toLowerCase()}));return function(t){if(t&&t.nodeName){var n=t.nodeName.toLowerCase();return z(e,n)}return!1}},In=function(t,e){var n=e.toLowerCase().split(" ");return function(e){if(Nn(e))for(var r=0;r0}))},lr=function(t){var e={},n=t.dom;if(Zn(n))for(var r=0;r=t.length&&e(n)}}(i))}))}))},Cr=function(t){return{isValue:I,isError:L,getOr:S(t),getOrThunk:S(t),getOrDie:S(t),or:function(e){return Cr(t)},orThunk:function(e){return Cr(t)},fold:function(e,n){return n(t)},map:function(e){return Cr(e(t))},mapError:function(e){return Cr(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return $.some(t)}}},kr=function(t){return{isValue:L,isError:I,getOr:O,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:O,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return kr(t)},mapError:function(e){return kr(e(t))},each:C,bind:function(e){return kr(t)},exists:L,forall:I,toOptional:$.none}},xr={value:Cr,error:kr,fromOption:function(t,e){return t.fold((function(){return kr(e)}),Cr)}},Sr=function(t){if(!p(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return V(t,(function(r,o){var i=ct(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],s=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!p(s))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r0?n(r.fail.map(Or)):e(r.pass.map(Or))}))},unload:u,unloadAll:function(t){V(t,(function(t){u(t)}))},_setReferrerPolicy:function(t){e.referrerPolicy=t}}},ao=function(){var t=new WeakMap;return{forElement:function(e,n){var r=sn(e).dom;return $.from(t.get(r)).getOrThunk((function(){var e=io(r,n);return t.set(r,e),e}))}}}(),so=function(){function t(t,e){this.node=t,this.rootNode=e,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}return t.prototype.current=function(){return this.node},t.prototype.next=function(t){return this.node=this.findSibling(this.node,"firstChild","nextSibling",t),this.node},t.prototype.prev=function(t){return this.node=this.findSibling(this.node,"lastChild","previousSibling",t),this.node},t.prototype.prev2=function(t){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",t),this.node},t.prototype.findSibling=function(t,e,n,r){var o,i;if(t){if(!r&&t[e])return t[e];if(t!==this.rootNode){if(o=t[n])return o;for(i=t.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},t.prototype.findPreviousNode=function(t,e,n,r){var o,i,a;if(t){if(o=t[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(a=o[e];a;a=a[e])if(!a[e])return a;return o}if((i=t.parentNode)&&i!==this.rootNode)return i}},t}(),lo=function(t){var e;return function(n){return e=e||function(t,e){for(var n={},r=0,o=t.length;r0&&function(t,e){var n=new so(t,e).prev(!1),r=new so(t,e).next(!1),o=v(n)||ni(n,e),i=v(r)||ni(r,e);return o&&i}(t,e)},ii=function(t,e,n){var r=n||e;if(Nn(e)&&ri(e))return e;for(var o=e.childNodes,i=o.length-1;i>=0;i--)ii(t,o[i],r);if(Nn(e)){var a=e.childNodes;1===a.length&&ri(a[0])&&e.parentNode.insertBefore(a[0],e)}return function(t){return zn(t)||Fn(t)}(e)||Zo(e,r)||function(t){return!!Nn(t)&&t.childNodes.length>0}(e)||oi(e,r)||t.remove(e),e},ai=Te.makeMap,si=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,li=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ui=/[<>&\"\']/g,ci=/([a-z0-9]+);?|&([a-z0-9]+);/gi,fi={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},di={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},hi={"<":"<",">":">","&":"&",""":'"',"'":"'"},pi=function(t,e){var n,r,o,i={};if(t){for(t=t.split(","),e=e||10,n=0;n1?""+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":di[t]||""+t.charCodeAt(0)+";"}))},yi=function(t,e,n){return n=n||mi,t.replace(e?si:li,(function(t){return di[t]||n[t]||t}))},bi={encodeRaw:gi,encodeAllRaw:function(t){return(""+t).replace(ui,(function(t){return di[t]||t}))},encodeNumeric:vi,encodeNamed:yi,getEncodeFunc:function(t,e){var n=pi(e)||mi,r=ai(t.replace(/\+/g,","));return r.named&&r.numeric?function(t,e){return t.replace(e?si:li,(function(t){return void 0!==di[t]?di[t]:void 0!==n[t]?n[t]:t.length>1?""+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":""+t.charCodeAt(0)+";"}))}:r.named?e?function(t,e){return yi(t,e,n)}:yi:r.numeric?vi:gi},decode:function(t){return t.replace(ci,(function(t,e){return e?(e="x"===e.charAt(0).toLowerCase()?parseInt(e.substr(1),16):parseInt(e,10))>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):fi[e]||String.fromCharCode(e):hi[t]||mi[t]||function(t){var e=De.fromTag("div").dom;return e.innerHTML=t,e.textContent||e.innerText||t}(t)}))}},_i={},wi={},Ci=Te.makeMap,ki=Te.each,xi=Te.extend,Si=Te.explode,Oi=Te.inArray,Ei=function(t,e){return(t=Te.trim(t))?t.split(e||" "):[]},Ti=function(t,e){var n;return t&&(n={},"string"==typeof t&&(t={"*":t}),ki(t,(function(t,r){n[r]=n[r.toUpperCase()]="map"===e?Ci(t,/[, ]/):Si(t,/[, ]/)}))),n},Ai=function(t){var e={},n={},r=[],o={},i={},a=function(e,n,r){var o=t[e];return o?o=Ci(o,/[, ]/,Ci(o.toUpperCase(),/[, ]/)):(o=_i[e])||(o=Ci(n," ",Ci(n.toUpperCase()," ")),o=xi(o,r),_i[e]=o),o},s=function(t){var e,n,r,o,i,a,s={},l=function(t,n,r){var o,i,a,l=function(t,e){var n,r,o={};for(n=0,r=t.length;n]*>","gi")}));var w=function(t){return new RegExp("^"+t.replace(/([?+*])/g,".$1")+"$")},C=function(t){var n,o,i,a,s,l,u,c,f,d,h,p,m,g,v,y,b,_,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,k=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,x=/[*?+]/;if(t){var S=Ei(t,",");for(e["@"]&&(y=e["@"].attributes,b=e["@"].attributesOrder),n=0,o=S.length;n1?t:"0"+t};return"#"+o(e)+o(n)+o(r)},Ni=function(t,e){var n,r,o,i=this,a=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,s=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,l=/\s*([^:]+):\s*([^;]+);?/g,u=/\s+$/,c={},f="\ufeff";t=t||{},e&&(r=e.getValidStyles(),o=e.getInvalidStyles());var d="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(n=0;n-1&&r||(y[t+e]=-1===n?l[0]:l.join(" "),delete y[t+"-top"+e],delete y[t+"-right"+e],delete y[t+"-bottom"+e],delete y[t+"-left"+e])}}}}},C=function(t){var e,n=y[t];if(n){for(e=(n=n.split(" ")).length;e--;)if(n[e]!==n[0])return!1;return y[t]=n[0],!0}},k=function(t){return h=!0,c[t]},x=function(t,e){return h&&(t=t.replace(/\uFEFF[0-9]/g,(function(t){return c[t]}))),e||(t=t.replace(/\\([\'\";:])/g,"$1")),t},S=function(t){return String.fromCharCode(parseInt(t.slice(1),16))},O=function(t){return t.replace(/\\[0-9a-f]+/gi,S)},E=function(e,n,r,o,i,a){if(i=i||a)return"'"+(i=x(i)).replace(/\'/g,"\\'")+"'";if(n=x(n||r||o),!t.allow_script_urls){var s=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(s))return"";if(!t.allow_svg_data_urls&&/^data:image\/svg/i.test(s))return""}return b&&(n=b.call(_,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,k).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(t){return t.replace(/[;:]/g,k)}));r=l.exec(e);)if(l.lastIndex=r.index+r[0].length,o=r[1].replace(u,"").toLowerCase(),d=r[2].replace(u,""),o&&d){if(o=O(o),d=O(d),-1!==o.indexOf(f)||-1!==o.indexOf('"'))continue;if(!t.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(d)))continue;"font-weight"===o&&"700"===d?d="bold":"color"!==o&&"background-color"!==o||(d=d.toLowerCase()),d=(d=d.replace(a,Di)).replace(s,E),y[o]=h?x(d,!0):d}w("border","",!0),w("border","-width"),w("border","-color"),w("border","-style"),w("padding",""),w("margin",""),p="border",g="border-style",v="border-color",C(m="border-width")&&C(g)&&C(v)&&(y[p]=y[m]+" "+y[g]+" "+y[v],delete y[m],delete y[g],delete y[v]),"medium none"===y.border&&delete y.border,"none"===y["border-image"]&&delete y["border-image"]}return y},serialize:function(t,e){var n="",i=function(e){var o,i=r[e];if(i)for(var a=0,s=i.length;a0?" ":"")+e+": "+o+";")};return e&&r?(i("*"),i(e)):dt(t,(function(t,r){!t||o&&!function(t,e){var n=o["*"];return!(n&&n[t]||(n=o[e])&&n[t])}(r,e)||(n+=(n.length>0?" ":"")+r+": "+t+";")})),n}}},Li={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},Ii=function(t){return t instanceof Event||_(t.initEvent)},ji=function(t,e,n,r){var o,i=function(t,e){var n=null!=e?e:{};for(var r in t)_t(Li,r)||(n[r]=t[r]);return b(n.composedPath)&&(n.composedPath=function(){return t.composedPath()}),n}(e,r);return i.type=t,y(i.target)&&(i.target=null!==(o=i.srcElement)&&void 0!==o?o:n),function(t){return y(t.preventDefault)||Ii(t)}(e)&&(i.preventDefault=function(){i.defaultPrevented=!0,i.isDefaultPrevented=I,_(e.preventDefault)?e.preventDefault():Ii(e)&&(e.returnValue=!1)},i.stopPropagation=function(){i.cancelBubble=!0,i.isPropagationStopped=I,_(e.stopPropagation)?e.stopPropagation():Ii(e)&&(e.cancelBubble=!0)},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=I,i.stopPropagation()},function(t){return t.isDefaultPrevented===I||t.isDefaultPrevented===L}(i)||(i.isDefaultPrevented=!0===i.defaultPrevented?I:L,i.isPropagationStopped=!0===i.cancelBubble?I:L,i.isImmediatePropagationStopped=L)),i},Pi=/^(?:mouse|contextmenu)|click/,Ri=function(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)},$i=function(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)},Mi=function(t,e){var n=ji(t.type,t,document,e);if(function(t){return b(t)&&Pi.test(t.type)}(t)&&v(t.pageX)&&!v(t.clientX)){var r=n.target.ownerDocument||document,o=r.documentElement,i=r.body,a=n;a.pageX=t.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),a.pageY=t.clientY+(o&&o.scrollTop||i&&i.scrollTop||0)-(o&&o.clientTop||i&&i.clientTop||0)}return v(n.metaKey)&&(n.metaKey=!1),n},Bi=function(t,e,n){var r=t.document,o={type:"ready"};if(n.domLoaded)e(o);else{var i=function(){$i(t,"DOMContentLoaded",i),$i(t,"load",i),n.domLoaded||(n.domLoaded=!0,e(o)),t=null};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():Ri(t,"DOMContentLoaded",i),n.domLoaded||Ri(t,"load",i)}},qi=function(){function t(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}return t.prototype.bind=function(t,e,n,r){var o,i,a,s,l,u,c,f=this,d=window,h=function(t){f.executeHandlers(Mi(t||d.event),o)};if(t&&3!==t.nodeType&&8!==t.nodeType){t[f.expando]?o=t[f.expando]:(o=f.count++,t[f.expando]=o,f.events[o]={}),r=r||t;var p=e.split(" ");for(a=p.length;a--;)u=h,l=c=!1,"DOMContentLoaded"===(s=p[a])&&(s="ready"),f.domLoaded&&"ready"===s&&"complete"===t.readyState?n.call(r,Mi({type:s})):(f.hasMouseEnterLeave||(l=f.mouseEnterLeave[s])&&(u=function(t){var e=t.currentTarget,n=t.relatedTarget;if(n&&e.contains)n=e.contains(n);else for(;n&&n!==e;)n=n.parentNode;n||((t=Mi(t||d.event)).type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=e,f.executeHandlers(t,o))}),f.hasFocusIn||"focusin"!==s&&"focusout"!==s||(c=!0,l="focusin"===s?"focus":"blur",u=function(t){(t=Mi(t||d.event)).type="focus"===t.type?"focusin":"focusout",f.executeHandlers(t,o)}),(i=f.events[o][s])?"ready"===s&&f.domLoaded?n(Mi({type:s})):i.push({func:n,scope:r}):(f.events[o][s]=i=[{func:n,scope:r}],i.fakeName=l,i.capture=c,i.nativeHandler=u,"ready"===s?Bi(t,u,f):Ri(t,l||s,u,c)));return t=i=null,n}},t.prototype.unbind=function(t,e,n){var r,o,i,a,s;if(!t||3===t.nodeType||8===t.nodeType)return this;var l=t[this.expando];if(l){if(s=this.events[l],e){var u=e.split(" ");for(o=u.length;o--;)if(r=s[a=u[o]]){if(n)for(i=r.length;i--;)if(r[i].func===n){var c=r.nativeHandler,f=r.fakeName,d=r.capture;(r=r.slice(0,i).concat(r.slice(i+1))).nativeHandler=c,r.fakeName=f,r.capture=d,s[a]=r}n&&0!==r.length||(delete s[a],$i(t,r.fakeName||a,r.nativeHandler,r.capture))}}else dt(s,(function(e,n){$i(t,e.fakeName||n,e.nativeHandler,e.capture)})),s={};for(a in s)if(_t(s,a))return this;delete this.events[l];try{delete t[this.expando]}catch(e){t[this.expando]=null}}return this},t.prototype.fire=function(t,e,n){var r;if(!t||3===t.nodeType||8===t.nodeType)return this;var o=Mi({type:e,target:t},n);do{(r=t[this.expando])&&this.executeHandlers(o,r),t=t.parentNode||t.ownerDocument||t.defaultView||t.parentWindow}while(t&&!o.isPropagationStopped());return this},t.prototype.clean=function(t){var e,n;if(!t||3===t.nodeType||8===t.nodeType)return this;if(t[this.expando]&&this.unbind(t),t.getElementsByTagName||(t=t.document),t&&t.getElementsByTagName)for(this.unbind(t),e=(n=t.getElementsByTagName("*")).length;e--;)(t=n[e])[this.expando]&&this.unbind(t);return this},t.prototype.destroy=function(){this.events={}},t.prototype.cancel=function(t){return t&&(t.preventDefault(),t.stopImmediatePropagation()),!1},t.prototype.executeHandlers=function(t,e){var n=this.events[e],r=n&&n[t.type];if(r)for(var o=0,i=r.length;o+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),fa=new RegExp("=[\\x20\\t\\r\\n\\f]*([^\\]'\"]*?)[\\x20\\t\\r\\n\\f]*\\]","g"),da=new RegExp(sa),ha=new RegExp("^"+ia+"$"),pa={ID:new RegExp("^#("+ia+")"),CLASS:new RegExp("^\\.("+ia+")"),TAG:new RegExp("^("+ia+"|[*])"),ATTR:new RegExp("^"+aa),PSEUDO:new RegExp("^"+sa),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},ma=/^(?:input|select|textarea|button)$/i,ga=/^h\d$/i,va=/^[^{]+\{\s*\[native \w/,ya=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ba=/[+~]/,_a=/'|\\/g,wa=new RegExp("\\\\([\\da-f]{1,6}[\\x20\\t\\r\\n\\f]?|([\\x20\\t\\r\\n\\f])|.)","ig"),Ca=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{ea.apply(Ji=na.call(zi.childNodes),zi.childNodes),Ji[zi.childNodes.length].nodeType}catch(t){ea={apply:Ji.length?function(t,e){ta.apply(t,na.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}var ka=function(t,e,n,r){var o,i,a,s,l,u,c,f,d,h;if((e?e.ownerDocument||e:zi)!==zr&&Fr(e),n=n||[],!t||"string"!=typeof t)return n;if(1!==(s=(e=e||zr).nodeType)&&9!==s)return[];if(Hr&&!r){if(o=ya.exec(t))if(a=o[1]){if(9===s){if(!(i=e.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(e.ownerDocument&&(i=e.ownerDocument.getElementById(a))&&Kr(e,i)&&i.id===a)return n.push(i),n}else{if(o[2])return ea.apply(n,e.getElementsByTagName(t)),n;if((a=o[3])&&Nr.getElementsByClassName)return ea.apply(n,e.getElementsByClassName(a)),n}if(Nr.qsa&&(!Vr||!Vr.test(t))){if(f=c=Fi,d=e,h=9===s&&t,1===s&&"object"!==e.nodeName.toLowerCase()){for(u=Pr(t),(c=e.getAttribute("id"))?f=c.replace(_a,"\\$&"):e.setAttribute("id",f),f="[id='"+f+"'] ",l=u.length;l--;)u[l]=f+Da(u[l]);d=ba.test(t)&&Ta(e.parentNode)||e,h=u.join(",")}if(h)try{return ea.apply(n,d.querySelectorAll(h)),n}catch(t){}finally{c||e.removeAttribute("id")}}}return $r(t.replace(la,"$1"),e,n,r)};function xa(){var t=[];return function e(n,r){return t.push(n+" ")>Lr.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function Sa(t){return t[Fi]=!0,t}function Oa(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||Gi)-(~t.sourceIndex||Gi);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function Ea(t){return Sa((function(e){return e=+e,Sa((function(n,r){for(var o,i=t([],n.length,e),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))}))}))}function Ta(t){return t&&typeof t.getElementsByTagName!==Xi&&t}function Aa(){}function Da(t){for(var e=0,n=t.length,r="";e1?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function Ia(t,e,n,r,o){for(var i,a=[],s=0,l=t.length,u=null!=e;s-1&&(i[u]=!(a[u]=f))}}else v=Ia(v===a?v.splice(p,v.length):v),o?o(null,a,v,l):ea.apply(a,v)}))}function Pa(t){for(var e,n,r,o=t.length,i=Lr.relative[t[0].type],a=i||Lr.relative[" "],s=i?1:0,l=Na((function(t){return t===e}),a,!0),u=Na((function(t){return ra.call(e,t)>-1}),a,!0),c=[function(t,n,r){var o=!i&&(r||n!==Mr)||((e=n).nodeType?l(t,n,r):u(t,n,r));return e=null,o}];s1&&La(c),s>1&&Da(t.slice(0,s-1).concat({value:" "===t[s-2].type?"*":""})).replace(la,"$1"),n,s0},ka.contains=function(t,e){return(t.ownerDocument||t)!==zr&&Fr(t),Kr(t,e)},ka.attr=function(t,e){(t.ownerDocument||t)!==zr&&Fr(t);var n=Lr.attrHandle[e.toLowerCase()],r=n&&Zi.call(Lr.attrHandle,e.toLowerCase())?n(t,e,!Hr):void 0;return void 0!==r?r:Nr.attributes||!Hr?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},ka.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},ka.uniqueSort=function(t){var e,n=[],r=0,o=0;if(qr=!Nr.detectDuplicates,Br=!Nr.sortStable&&t.slice(0),t.sort(Yi),qr){for(;e=t[o++];)e===t[o]&&(r=n.push(o));for(;r--;)t.splice(n[r],1)}return Br=null,t},Ir=ka.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=Ir(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=Ir(e);return n},Lr=ka.selectors={cacheLength:50,createPseudo:Sa,match:pa,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(wa,Ca),t[3]=(t[3]||t[4]||t[5]||"").replace(wa,Ca),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||ka.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&ka.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return pa.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&da.test(n)&&(e=Pr(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(wa,Ca).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=Vi[t+" "];return e||(e=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+t+"("+oa+"|$)"))&&Vi(t,(function(t){return e.test("string"==typeof t.className&&t.className||typeof t.getAttribute!==Xi&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var o=ka.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,l){var u,c,f,d,h,p,m=i!==a?"nextSibling":"previousSibling",g=e.parentNode,v=s&&e.nodeName.toLowerCase(),y=!l&&!s;if(g){if(i){for(;m;){for(f=e;f=f[m];)if(s?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;p=m="only"===t&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&y){for(h=(u=(c=g[Fi]||(g[Fi]={}))[t]||[])[0]===Ui&&u[1],d=u[0]===Ui&&u[2],f=h&&g.childNodes[h];f=++h&&f&&f[m]||(d=h=0)||p.pop();)if(1===f.nodeType&&++d&&f===e){c[t]=[Ui,h,d];break}}else if(y&&(u=(e[Fi]||(e[Fi]={}))[t])&&u[0]===Ui)d=u[1];else for(;(f=++h&&f&&f[m]||(d=h=0)||p.pop())&&((s?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(y&&((f[Fi]||(f[Fi]={}))[t]=[Ui,d]),f!==e)););return(d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(t,e){var n,r=Lr.pseudos[t]||Lr.setFilters[t.toLowerCase()]||ka.error("unsupported pseudo: "+t);return r[Fi]?r(e):r.length>1?(n=[t,t,"",e],Lr.setFilters.hasOwnProperty(t.toLowerCase())?Sa((function(t,n){for(var o,i=r(t,e),a=i.length;a--;)t[o=ra.call(t,i[a])]=!(n[o]=i[a])})):function(t){return r(t,0,n)}):r}},pseudos:{not:Sa((function(t){var e=[],n=[],r=Rr(t.replace(la,"$1"));return r[Fi]?Sa((function(t,e,n,o){for(var i,a=r(t,null,o,[]),s=t.length;s--;)(i=a[s])&&(t[s]=!(e[s]=i))})):function(t,o,i){return e[0]=t,r(e,null,i,n),e[0]=null,!n.pop()}})),has:Sa((function(t){return function(e){return ka(t,e).length>0}})),contains:Sa((function(t){return t=t.replace(wa,Ca),function(e){return(e.textContent||e.innerText||Ir(e)).indexOf(t)>-1}})),lang:Sa((function(t){return ha.test(t||"")||ka.error("unsupported lang: "+t),t=t.replace(wa,Ca).toLowerCase(),function(e){var n;do{if(n=Hr?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=window.location&&window.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===Ur},focus:function(t){return t===zr.activeElement&&(!zr.hasFocus||zr.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!Lr.pseudos.empty(t)},header:function(t){return ga.test(t.nodeName)},input:function(t){return ma.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:Ea((function(){return[0]})),last:Ea((function(t,e){return[e-1]})),eq:Ea((function(t,e,n){return[n<0?n+e:n]})),even:Ea((function(t,e){for(var n=0;n=0;)t.push(r);return t})),gt:Ea((function(t,e,n){for(var r=n<0?n+e:n;++r0,r=t.length>0,o=function(o,i,a,s,l){var u,c,f,d=0,h="0",p=o&&[],m=[],g=Mr,v=o||r&&Lr.find.TAG("*",l),y=Ui+=null==g?1:Math.random()||.1,b=v.length;for(l&&(Mr=i!==zr&&i);h!==b&&null!=(u=v[h]);h++){if(r&&u){for(c=0;f=t[c++];)if(f(u,i,a)){s.push(u);break}l&&(Ui=y)}n&&((u=!f&&u)&&d--,o&&p.push(u))}if(d+=h,n&&h!==d){for(c=0;f=e[c++];)f(p,m,i,a);if(o){if(d>0)for(;h--;)p[h]||m[h]||(m[h]=Qi.call(s));m=Ia(m)}ea.apply(s,m),l&&!o&&m.length>0&&d+e.length>1&&ka.uniqueSort(s)}return l&&(Ui=y,Mr=g),p};return n?Sa(o):o}(o,r)),i.selector=t}return i},$r=ka.select=function(t,e,n,r){var o,i,a,s,l,u="function"==typeof t&&t,c=!r&&Pr(t=u.selector||t);if(n=n||[],1===c.length){if((i=c[0]=c[0].slice(0)).length>2&&"ID"===(a=i[0]).type&&Nr.getById&&9===e.nodeType&&Hr&&Lr.relative[i[1].type]){if(!(e=(Lr.find.ID(a.matches[0].replace(wa,Ca),e)||[])[0]))return n;u&&(e=e.parentNode),t=t.slice(i.shift().value.length)}for(o=pa.needsContext.test(t)?0:i.length;o--&&(a=i[o],!Lr.relative[s=a.type]);)if((l=Lr.find[s])&&(r=l(a.matches[0].replace(wa,Ca),ba.test(i[0].type)&&Ta(e.parentNode)||e))){if(i.splice(o,1),!(t=r.length&&Da(i)))return ea.apply(n,r),n;break}}return(u||Rr(t,c))(r,e,!Hr,n,ba.test(t)&&Ta(e.parentNode)||e),n},Nr.sortStable=Fi.split("").sort(Yi).join("")===Fi,Nr.detectDuplicates=!!qr,Fr(),Nr.sortDetached=!0;var Ra=document,$a=Array.prototype.push,Ma=Array.prototype.slice,Ba=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,qa=qi.Event,Fa=Te.makeMap("children,contents,next,prev"),za=function(t){return void 0!==t},Ua=function(t){return"string"==typeof t},Ha=function(t,e){var n,r=(e=e||Ra).createElement("div"),o=e.createDocumentFragment();for(r.innerHTML=t;n=r.firstChild;)o.appendChild(n);return o},Va=function(t,e,n,r){var o;if(Ua(e))e=Ha(e,is(t[0]));else if(e.length&&!e.nodeType){if(e=us.makeArray(e),r)for(o=e.length-1;o>=0;o--)Va(t,e[o],n,r);else for(o=0;o"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:Ba.exec(t)))return us(e).find(t);if(n[1])for(r=Ha(t,is(e)).firstChild;r;)$a.call(o,r),r=r.nextSibling;else{if(!(r=is(e).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(t);o.length=1,o[0]=r}}else this.add(t,!1);return o},toArray:function(){return Te.toArray(this)},add:function(t,e){var n,r,o=this;if(Ua(t))return o.add(us(t));if(!1!==e)for(n=us.unique(o.toArray().concat(us.makeArray(t))),o.length=n.length,r=0;r1&&(Fa[t]||(r=us.unique(r)),0===t.indexOf("parents")&&(r=r.reverse()));var o=us(r);return n?o.filter(n):o}})),rs({parentsUntil:function(t,e){return as(t,"parentNode",e)},nextUntil:function(t,e){return ss(t,"nextSibling",1,e).slice(1)},prevUntil:function(t,e){return ss(t,"previousSibling",1,e).slice(1)}},(function(t,e){ts.fn[t]=function(n,r){var o=[];this.each((function(){var t=e.call(o,this,n,o);t&&(us.isArray(t)?o.push.apply(o,t):o.push(t))})),this.length>1&&(o=us.unique(o),0!==t.indexOf("parents")&&"prevUntil"!==t||(o=o.reverse()));var i=us(o);return r?i.filter(r):i}})),ts.fn.is=function(t){return!!t&&this.filter(t).length>0},ts.fn.init.prototype=ts.fn,ts.overrideDefaults=function(t){var e,n=function(r,o){return e=e||t(),0===arguments.length&&(r=e.element),o||(o=e.context),new n.fn.init(r,o)};return us.extend(n,this),n},ts.attrHooks=Ja,ts.cssHooks=Qa;var us=ts,cs=Te.each,fs=Te.grep,ds=ke.ie,hs=/^([a-z0-9],?)+$/i,ps=function(t,e){var n=e.attr("style"),r=t.serialize(t.parse(n),e[0].nodeName);r||(r=null),e.attr("data-mce-style",r)},ms=function(t,e){var n,r,o=0;if(t)for(n=t.nodeType,t=t.previousSibling;t;t=t.previousSibling)r=t.nodeType,(!e||3!==r||r!==n&&t.nodeValue.length)&&(o++,n=r);return o},gs=function(t,e){void 0===e&&(e={});var n={},r=window,o={},i=0,a=ao.forElement(De.fromDom(t),{contentCssCors:e.contentCssCors,referrerPolicy:e.referrerPolicy}),s=[],l=e.schema?e.schema:Ai({}),u=Ni({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope},e.schema),c=e.ownEvents?new qi:qi.Event,f=l.getBlockElements(),h=us.overrideDefaults((function(){return{context:t,element:U.getRoot()}})),p=function(e){return e&&t&&d(e)?t.getElementById(e):e},m=function(t){return h("string"==typeof t?p(t):t)},g=function(t,e,n){var r,o,i=m(t);return i.length&&(o=(r=H[e])&&r.get?r.get(i,e):i.attr(e)),void 0===o&&(o=n||""),o},v=function(t){var e=p(t);return e?e.attributes:[]},b=function(t,n,r){""===r&&(r=null);var o=m(t),i=o.attr(n);if(o.length){var a=H[n];a&&a.set?a.set(o,r,n):o.attr(n,r),i!==r&&e.onSetAttrib&&e.onSetAttrib({attrElm:o,attrName:n,attrValue:r})}},_=function(){return e.root_element||t.body},w=function(e,n){return dr(t.body,p(e),n)},k=function(t,e,n){var r=m(t);return n?r.css(e):("float"===(e=e.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()})))&&(e=ke.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[e]:void 0)},x=function(t){var e,n;return t=p(t),e=k(t,"width"),n=k(t,"height"),-1===e.indexOf("px")&&(e=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(e,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},O=function(t,e){var n;if(!t)return!1;if(!Array.isArray(t)){if("*"===e)return 1===t.nodeType;if(hs.test(e)){var r=e.toLowerCase().split(/,/),o=t.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return!0;return!1}if(t.nodeType&&1!==t.nodeType)return!1}var i=Array.isArray(t)?t:[t];return ka(e,i[0].ownerDocument||i[0],null,i).length>0},E=function(t,e,n,r){var o,i=[],a=p(t);for(r=void 0===r,n=n||("BODY"!==_().nodeName?_().parentNode:null),Te.is(e,"string")&&(o=e,e="*"===e?function(t){return 1===t.nodeType}:function(t){return O(t,o)});a&&!(a===n||y(a.nodeType)||Fn(a)||zn(a));){if(!e||"function"==typeof e&&e(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null},T=function(t,e,n){var r=e;if(t)for("string"==typeof e&&(r=function(t){return O(t,e)}),t=t[n];t;t=t[n])if("function"==typeof r&&r(t))return t;return null},A=function(t,e,n){var r,o="string"==typeof t?p(t):t;if(!o)return!1;if(Te.isArray(o)&&(o.length||0===o.length))return r=[],cs(o,(function(t,o){t&&r.push(e.call(n,"string"==typeof t?p(t):t,o))})),r;var i=n||this;return e.call(i,o)},D=function(t,e){m(t).each((function(t,n){cs(e,(function(t,e){b(n,e,t)}))}))},N=function(t,e){var n=m(t);ds?n.each((function(t,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="
"+e,n.removeChild(n.firstChild)}catch(t){us("").html("
"+e).contents().slice(1).appendTo(n)}return e}})):n.html(e)},L=function(e,n,r,o,i){return A(e,(function(e){var a="string"==typeof n?t.createElement(n):n;return D(a,r),o&&("string"!=typeof o&&o.nodeType?a.appendChild(o):"string"==typeof o&&N(a,o)),i?a:e.appendChild(a)}))},I=function(e,n,r){return L(t.createElement(e),e,n,r,!0)},j=bi.encodeAllRaw,P=function(t,e){var n=m(t);return e?n.each((function(){for(var t;t=this.firstChild;)3===t.nodeType&&0===t.data.length?this.removeChild(t):this.parentNode.insertBefore(t,this)})).remove():n.remove(),n.length>1?n.toArray():n[0]},R=function(t,e,n){m(t).toggleClass(e,n).each((function(){""===this.className&&us(this).attr("class",null)}))},$=function(t,e,n){return A(e,(function(e){return Te.is(e,"array")&&(t=t.cloneNode(!0)),n&&cs(fs(e.childNodes),(function(e){t.appendChild(e)})),e.parentNode.replaceChild(t,e)}))},M=function(t){if(Nn(t)){var e="a"===t.nodeName.toLowerCase()&&!g(t,"href")&&g(t,"id");if(g(t,"name")||g(t,"data-mce-bookmark")||e)return!0}return!1},B=function(){return t.createRange()},q=function(n,o,i,a){if(Te.isArray(n)){for(var l=n.length,u=[];l--;)u[l]=q(n[l],o,i,a);return u}return!e.collect||n!==t&&n!==r||s.push([n,o,i,a]),c.bind(n,o,i,a||U)},F=function(e,n,o){if(Te.isArray(e)){for(var i=e.length,a=[];i--;)a[i]=F(e[i],n,o);return a}if(s.length>0&&(e===t||e===r))for(i=s.length;i--;){var l=s[i];e!==l[0]||n&&n!==l[1]||o&&o!==l[2]||c.unbind(l[0],l[1],l[2])}return c.unbind(e,n,o)},z=function(t){if(t&&Nn(t)){var e=t.getAttribute("data-mce-contenteditable");return e&&"inherit"!==e?e:"inherit"!==t.contentEditable?t.contentEditable:null}return null},U={doc:t,settings:e,win:r,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:a,boundEvents:s,styles:u,schema:l,events:c,isBlock:function(t){if("string"==typeof t)return!!f[t];if(t){var e=t.nodeType;if(e)return!(1!==e||!f[t.nodeName])}return!1},$:h,$$:m,root:null,clone:function(e,n){if(!ds||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return cs(v(e),(function(t){b(r,t.nodeName,g(e,t.nodeName))})),r},getRoot:_,getViewPort:function(t){var e=Tn(t);return{x:e.x,y:e.y,w:e.width,h:e.height}},getRect:function(t){t=p(t);var e=w(t),n=x(t);return{x:e.x,y:e.y,w:n.w,h:n.h}},getSize:x,getParent:function(t,e,n){var r=E(t,e,n,!1);return r&&r.length>0?r[0]:null},getParents:E,get:p,getNext:function(t,e){return T(t,e,"nextSibling")},getPrev:function(t,e){return T(t,e,"previousSibling")},select:function(n,r){return ka(n,p(r)||e.root_element||t,[])},is:O,add:L,create:I,createHTML:function(t,e,n){var r,o="";for(r in o+="<"+t,e)wt(e,r)&&(o+=" "+r+'="'+j(e[r])+'"');return void 0!==n?o+">"+n+""+t+">":o+" />"},createFragment:function(e){var n,r=t.createElement("div"),o=t.createDocumentFragment();for(o.appendChild(r),e&&(r.innerHTML=e);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:P,setStyle:function(t,n,r){var o=d(n)?m(t).css(n,r):m(t).css(n);e.update_styles&&ps(u,o)},getStyle:k,setStyles:function(t,n){var r=m(t).css(n);e.update_styles&&ps(u,r)},removeAllAttribs:function(t){return A(t,(function(t){var e,n=t.attributes;for(e=n.length-1;e>=0;e--)t.removeAttributeNode(n.item(e))}))},setAttrib:b,setAttribs:D,getAttrib:g,getPos:w,parseStyle:function(t){return u.parse(t)},serializeStyle:function(t,e){return u.serialize(t,e)},addStyle:function(e){var r,o;if(U!==gs.DOM&&t===document){if(n[e])return;n[e]=!0}(o=t.getElementById("mceDefaultStyles"))||((o=t.createElement("style")).id="mceDefaultStyles",o.type="text/css",(r=t.getElementsByTagName("head")[0]).firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o)),o.styleSheet?o.styleSheet.cssText+=e:o.appendChild(t.createTextNode(e))},loadCSS:function(t){t||(t=""),V(t.split(","),(function(t){o[t]=!0,a.load(t,C)}))},addClass:function(t,e){m(t).addClass(e)},removeClass:function(t,e){R(t,e,!1)},hasClass:function(t,e){return m(t).hasClass(e)},toggleClass:R,show:function(t){m(t).show()},hide:function(t){m(t).hide()},isHidden:function(t){return"none"===m(t).css("display")},uniqueId:function(t){return(t||"mce_")+i++},setHTML:N,getOuterHTML:function(t){var e="string"==typeof t?p(t):t;return Nn(e)?e.outerHTML:us("").append(us(e).clone()).html()},setOuterHTML:function(t,e){m(t).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}P(us(this).html(e),!0)}))},decode:bi.decode,encode:j,insertAfter:function(t,e){var n=p(e);return A(t,(function(t){var e=n.parentNode,r=n.nextSibling;return r?e.insertBefore(t,r):e.appendChild(t),t}))},replace:$,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=I(e),cs(v(t),(function(e){b(n,e.nodeName,g(t,e.nodeName))})),$(n,t,!0)),n||t},findCommonAncestor:function(t,e){for(var n,r=t;r;){for(n=e;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&t.ownerDocument?t.ownerDocument.documentElement:r},toHex:function(t){return u.toHex(Te.trim(t))},run:A,getAttribs:v,isEmpty:function(t,e){var n,r,o=0;if(M(t))return!1;if(t=t.firstChild){var i=new so(t,t.parentNode),a=l?l.getWhiteSpaceElements():{};e=e||(l?l.getNonEmptyElements():null);do{if(n=t.nodeType,Nn(t)){var s=t.getAttribute("data-mce-bogus");if(s){t=i.next("all"===s);continue}if(r=t.nodeName.toLowerCase(),e&&e[r]){if("br"===r){o++,t=i.next();continue}return!1}if(M(t))return!1}if(8===n)return!1;if(3===n&&!Xo(t.nodeValue))return!1;if(3===n&&t.parentNode&&a[t.parentNode.nodeName]&&Xo(t.nodeValue))return!1;t=i.next()}while(t)}return o<=1},createRng:B,nodeIndex:ms,split:function(t,e,n){var r,o,i,a=B();if(t&&e)return a.setStart(t.parentNode,ms(t)),a.setEnd(e.parentNode,ms(e)),r=a.extractContents(),(a=B()).setStart(e.parentNode,ms(e)+1),a.setEnd(t.parentNode,ms(t)+1),o=a.extractContents(),(i=t.parentNode).insertBefore(ii(U,r),t),n?i.insertBefore(n,t):i.insertBefore(e,t),i.insertBefore(ii(U,o),t),P(t),n||e},bind:q,unbind:F,fire:function(t,e,n){return c.fire(t,e,n)},getContentEditable:z,getContentEditableParent:function(t){for(var e=_(),n=null;t&&t!==e&&null===(n=z(t));t=t.parentNode);return n},destroy:function(){if(s.length>0)for(var t=s.length;t--;){var e=s[t];c.unbind(e[0],e[1],e[2])}dt(o,(function(t,e){a.unload(e),delete o[e]})),ka.setDocument&&ka.setDocument()},isChildOf:function(t,e){if(ds){for(;t;){if(e===t)return!0;t=t.parentNode}return!1}return t===e||e.contains(t)},dumpRng:function(t){return"startContainer: "+t.startContainer.nodeName+", startOffset: "+t.startOffset+", endContainer: "+t.endContainer.nodeName+", endOffset: "+t.endOffset}},H=function(t,e,n){var r=e.keep_values,o={set:function(t,r,o){e.url_converter&&null!==r&&(r=e.url_converter.call(e.url_converter_scope||n(),r,o,t[0])),t.attr("data-mce-"+o,r).attr(o,r)},get:function(t,e){return t.attr("data-mce-"+e)||t.attr(e)}},i={style:{set:function(e,n){null===n||"object"!=typeof n?(r&&e.attr("data-mce-style",n),null!==n&&"string"==typeof n?(e.removeAttr("style"),e.css(t.parse(n))):e.attr("style",n)):e.css(n)},get:function(e){var n=e.attr("data-mce-style")||e.attr("style");return t.serialize(t.parse(n),e[0].nodeName)}}};return r&&(i.href=i.src=o),i}(u,e,S(U));return U};gs.DOM=gs(document),gs.nodeIndex=ms;var vs=gs.DOM,ys=Te.each,bs=Te.grep,_s=function(){function t(t){void 0===t&&(t={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=t}return t.prototype._setReferrerPolicy=function(t){this.settings.referrerPolicy=t},t.prototype.loadScript=function(t,e,n){var r,o=vs,i=function(){o.remove(a),r&&(r.onerror=r.onload=r=null)},a=o.uniqueId();(r=document.createElement("script")).id=a,r.type="text/javascript",r.src=Te._addCacheSuffix(t),this.settings.referrerPolicy&&o.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=function(){i(),e()},r.onerror=function(){i(),_(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName("head")[0]||document.body).appendChild(r)},t.prototype.isDone=function(t){return 2===this.states[t]},t.prototype.markDone=function(t){this.states[t]=2},t.prototype.add=function(t,e,n,r){var o=this.states[t];this.queue.push(t),void 0===o&&(this.states[t]=0),e&&(this.scriptLoadedCallbacks[t]||(this.scriptLoadedCallbacks[t]=[]),this.scriptLoadedCallbacks[t].push({success:e,failure:r,scope:n||this}))},t.prototype.load=function(t,e,n,r){return this.add(t,e,n,r)},t.prototype.remove=function(t){delete this.states[t],delete this.scriptLoadedCallbacks[t]},t.prototype.loadQueue=function(t,e,n){this.loadScripts(this.queue,t,e,n)},t.prototype.loadScripts=function(t,e,n,r){var o=this,i=[],a=function(t,e){ys(o.scriptLoadedCallbacks[e],(function(e){_(e[t])&&e[t].call(e.scope)})),o.scriptLoadedCallbacks[e]=void 0};o.queueLoadedCallbacks.push({success:e,failure:r,scope:n||this});var s=function(){var e=bs(t);if(t.length=0,ys(e,(function(t){2!==o.states[t]?3!==o.states[t]?1!==o.states[t]&&(o.states[t]=1,o.loading++,o.loadScript(t,(function(){o.states[t]=2,o.loading--,a("success",t),s()}),(function(){o.states[t]=3,o.loading--,i.push(t),a("failure",t),s()}))):a("failure",t):a("success",t)})),!o.loading){var n=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,ys(n,(function(t){0===i.length?_(t.success)&&t.success.call(t.scope):_(t.failure)&&t.failure.call(t.scope,i)}))}};s()},t.ScriptLoader=new t,t}(),ws=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Cs={},ks=ws("en"),xs=function(){return bt(Cs,ks.get())},Ss={getData:function(){return ht(Cs,(function(t){return Dt({},t)}))},setCode:function(t){t&&ks.set(t)},getCode:function(){return ks.get()},add:function(t,e){var n=Cs[t];n||(Cs[t]=n={}),dt(e,(function(t,e){n[e.toLowerCase()]=t}))},translate:function(t){var e,n=xs().getOr({}),r=function(t){return _(t)?Object.prototype.toString.call(t):o(t)?"":""+t},o=function(t){return""===t||null==t},i=function(t){var e=r(t);return bt(n,e.toLowerCase()).map(r).getOr(e)},a=function(t){return t.replace(/{context:\w+}$/,"")};if(o(t))return"";if(h(e=t)&&_t(e,"raw"))return r(t.raw);if(function(t){return p(t)&&t.length>1}(t)){var s=t.slice(1);return a(i(t[0]).replace(/\{([0-9]+)\}/g,(function(t,e){return _t(s,e)?r(s[e]):t})))}return a(i(t))},isRtl:function(){return xs().bind((function(t){return bt(t,"_dir")})).exists((function(t){return"rtl"===t}))},hasCode:function(t){return _t(Cs,t)}},Os=function(){var t=[],e={},n={},r=[],o=function(t,e){var n=Y(r,(function(n){return n.name===t&&n.state===e}));V(n,(function(t){return t.callback()}))},i=function(t){var e;return n[t]&&(e=n[t].dependencies),e||[]},a=function(t,e){return"object"==typeof e?e:"string"==typeof t?{prefix:"",resource:e,suffix:""}:{prefix:t.prefix,resource:e,suffix:t.suffix}},s=function(t,r,l,u,c){if(!e[t]){var f="string"==typeof r?r:r.prefix+r.resource+r.suffix;0!==f.indexOf("/")&&-1===f.indexOf("://")&&(f=Os.baseURL+"/"+f),e[t]=f.substring(0,f.lastIndexOf("/"));var d=function(){o(t,"loaded"),function(t,e,n,r){var o=i(t);V(o,(function(t){var n=a(e,t);s(n.resource,n,void 0,void 0)})),n&&(r?n.call(r):n.call(_s))}(t,r,l,u)};n[t]?d():_s.ScriptLoader.add(f,d,u,c)}},l=function(t,o,i){void 0===i&&(i="added"),_t(n,t)&&"added"===i||_t(e,t)&&"loaded"===i?o():r.push({name:t,state:i,callback:o})};return{items:t,urls:e,lookup:n,_listeners:r,get:function(t){if(n[t])return n[t].instance},dependencies:i,requireLangPack:function(t,n){!1!==Os.languageLoad&&l(t,(function(){var r=Ss.getCode();!r||n&&-1===(","+(n||"")+",").indexOf(","+r+",")||_s.ScriptLoader.add(e[t]+"/langs/"+r+".js")}),"loaded")},add:function(e,r,i){var a=r;return t.push(a),n[e]={instance:a,dependencies:i},o(e,"added"),a},remove:function(t){delete e[t],delete n[t]},createUrl:a,addComponents:function(t,n){var r=e[t];V(n,(function(t){_s.ScriptLoader.add(r+"/"+t)}))},load:s,waitFor:l}};Os.languageLoad=!0,Os.baseURL="",Os.PluginManager=Os(),Os.ThemeManager=Os();var Es=function(){var t=function(t){var e=ws($.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set($.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set($.some(t))}}}(C);return Dt(Dt({},t),{on:function(e){return t.get().each(e)}})},Ts=function(t,e){var n=null;return{cancel:function(){m(n)||(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o0?Qn(t,e,r.join(" ")):rr(t,e),!1}(t,"class",e)},js=function(t,e){Ns(t)?t.dom.classList.add(e):Ls(t,e)},Ps=function(t){var e=Ns(t)?t.dom.classList:function(t){return Ds(t,"class")}(t);0===e.length&&rr(t,"class")},Rs=function(t,e){return Ns(t)&&t.dom.classList.contains(e)},$s=function(t,e){var n=[];return V(Je(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat($s(t,e))})),n},Ms=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Ie(n)?[]:H(n.querySelectorAll(t),De.fromDom)}(e,t)},Bs=S("mce-annotation"),qs=S("data-mce-annotation"),Fs=S("data-mce-annotation-uid"),zs=function(t,e){var n=t.selection.getRng(),r=De.fromDom(n.startContainer),o=De.fromDom(t.getBody()),i=e.fold((function(){return"."+Bs()}),(function(t){return"["+qs()+'="'+t+'"]'})),a=Qe(r,n.startOffset).getOr(r),s=Qr(a,i,(function(t){return je(t,o)})),l=function(t,e){return function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)}(t,e)?$.some(er(t,e)):$.none()};return s.bind((function(e){return l(e,""+Fs()).bind((function(n){return l(e,""+qs()).map((function(e){var r=Us(t,n);return{uid:n,name:e,elements:r}}))}))}))},Us=function(t,e){var n=De.fromDom(t.getBody());return Ms(n,"["+Fs()+'="'+e+'"]')},Hs=function(t,e){var n=ws({}),r=function(){return{listeners:[],previous:Es()}},o=function(t,e){i(t,(function(t){return e(t),t}))},i=function(t,e){var o=n.get(),i=e(bt(o,t).getOrThunk(r));o[t]=i,n.set(o)},a=As((function(){var e=n.get(),r=ot(ct(e));V(r,(function(e){i(e,(function(n){var r=n.previous.get();return zs(t,$.some(e)).fold((function(){r.isSome()&&(!function(t){o(t,(function(e){V(e.listeners,(function(e){return e(!1,t)}))}))}(e),n.previous.clear())}),(function(t){var e=t.uid,i=t.name,a=t.elements;Xn(r,e)||(!function(t,e,n){o(t,(function(r){V(r.listeners,(function(r){return r(!0,t,{uid:e,nodes:H(n,(function(t){return t.dom}))})}))}))}(i,e,a),n.previous.set(e))})),{previous:n.previous,listeners:n.listeners}}))}))}),30);t.on("remove",(function(){a.cancel()})),t.on("NodeChange",(function(){a.throttle()}));return{addListener:function(t,e){i(t,(function(t){return{previous:t.previous,listeners:t.listeners.concat([e])}}))}}},Vs=function(t,e){t.on("init",(function(){t.serializer.addNodeFilter("span",(function(t){V(t,(function(t){(function(t){return $.from(t.attr(qs())).bind(e.lookup)})(t).each((function(e){!1===e.persistent&&t.unwrap()}))}))}))}))},Ws=0,Ks=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++Ws+String(e)},Ys=function(t,e){var n,r,o=He(t).dom,i=De.fromDom(o.createDocumentFragment()),a=(n=e,(r=(o||document).createElement("div")).innerHTML=n,Je(De.fromDom(r)));mn(i,a),gn(t),pn(t,i)},Xs=function(t,e){return De.fromDom(t.dom.cloneNode(e))},Gs=function(t){return Xs(t,!1)},Zs=function(t){return Xs(t,!0)},Js=function(t,e,n){void 0===n&&(n=L);var r=new so(t,e),o=function(t){var e;do{e=r[t]()}while(e&&!Bn(e)&&!n(e));return $.from(e).filter(Bn)};return{current:function(){return $.from(r.current()).filter(Bn)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},Qs=function(t,e){var n=e||function(e){return t.isBlock(e)||Un(e)||Wn(e)},r=function(t,e,n,o){if(Bn(t)){var i=o(t,e,t.data);if(-1!==i)return $.some({container:t,offset:i})}return n().bind((function(t){return r(t.container,t.offset,n,o)}))};return{backwards:function(t,e,o,i){var a=Js(t,i,n);return r(t,e,(function(){return a.prev().map((function(t){return{container:t,offset:t.length}}))}),o).getOrNull()},forwards:function(t,e,o,i){var a=Js(t,i,n);return r(t,e,(function(){return a.next().map((function(t){return{container:t,offset:0}}))}),o).getOrNull()}}},tl=Math.round,el=function(t){return t?{left:tl(t.left),top:tl(t.top),bottom:tl(t.bottom),right:tl(t.right),width:tl(t.width),height:tl(t.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},nl=function(t,e){return t=el(t),e||(t.left=t.left+t.width),t.right=t.left,t.width=0,t},rl=function(t,e,n){return t>=0&&t<=Math.min(e.height,n.height)/2},ol=function(t,e){var n=Math.min(e.height/2,t.height/2);return t.bottom-ne.bottom)&&rl(e.top-t.bottom,t,e)},il=function(t,e){return t.top>e.bottom||!(t.bottom=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},sl=function(t){var e=t.startContainer,n=t.startOffset;return e.hasChildNodes()&&t.endOffset===n+1?e.childNodes[n]:null},ll=function(t,e){if(Nn(t)&&t.hasChildNodes()){var n=t.childNodes,r=function(t,e,n){return Math.min(Math.max(t,e),n)}(e,0,n.length-1);return n[r]}return t},ul=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿-⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),cl=function(t){return"string"==typeof t&&t.charCodeAt(0)>=768&&ul.test(t)},fl=Nn,dl=Vo,hl=In("display","block table"),pl=In("float","left right"),ml=function(){for(var t=[],e=0;e0?el(n[0]):el(t.getBoundingClientRect()),!kl(t)&&yl(t)&&Sl(e)?function(t){var e=t.ownerDocument,n=wl(e),r=e.createTextNode(_o),o=t.parentNode;o.insertBefore(r,t),n.setStart(r,0),n.setEnd(r,1);var i=el(n.getBoundingClientRect());return o.removeChild(r),i}(t):Sl(e)&&kl(t)?function(t){var e=t.startContainer,n=t.endContainer,r=t.startOffset,o=t.endOffset;if(e===n&&Bn(n)&&0===r&&1===o){var i=t.cloneRange();return i.setEndAfter(n),Ol(i)}return null}(t):e},El=function(t,e){var n=nl(t,e);return n.width=1,n.right=n.left+1,n},Tl=function(t){var e=[],n=function(t){var n,r;0!==t.height&&(e.length>0&&(n=t,r=e[e.length-1],n.left===r.left&&n.top===r.top&&n.bottom===r.bottom&&n.right===r.right)||e.push(t))},r=function(t,r){var o=wl(t.ownerDocument);if(r0&&(o.setStart(t,r-1),o.setEnd(t,r),xl(o)||n(El(Ol(o),!1))),r0},isAtStart:function(){return vl(t),0===e},isAtEnd:function(){return vl(t)?e>=t.data.length:e>=t.childNodes.length},isEqual:function(n){return n&&t===n.container()&&e===n.offset()},getNode:function(n){return _l(t,n?e-1:e)}}};Al.fromRangeStart=function(t){return Al(t.startContainer,t.startOffset)},Al.fromRangeEnd=function(t){return Al(t.endContainer,t.endOffset)},Al.after=function(t){return Al(t.parentNode,bl(t)+1)},Al.before=function(t){return Al(t.parentNode,bl(t))},Al.isAbove=function(t,e){return Gn(at(e.getClientRects()),st(t.getClientRects()),ol).getOr(!1)},Al.isBelow=function(t,e){return Gn(st(e.getClientRects()),at(t.getClientRects()),il).getOr(!1)},Al.isAtStart=function(t){return!!t&&t.isAtStart()},Al.isAtEnd=function(t){return!!t&&t.isAtEnd()},Al.isTextPosition=function(t){return!!t&&Bn(t.container())},Al.isElementPosition=function(t){return!1===Al.isTextPosition(t)};var Dl,Nl=function(t,e){Bn(e)&&0===e.data.length&&t.remove(e)},Ll=function(t,e,n){zn(n)?function(t,e,n){var r=$.from(n.firstChild),o=$.from(n.lastChild);e.insertNode(n),r.each((function(e){return Nl(t,e.previousSibling)})),o.each((function(e){return Nl(t,e.nextSibling)}))}(t,e,n):function(t,e,n){e.insertNode(n),Nl(t,n.previousSibling),Nl(t,n.nextSibling)}(t,e,n)},Il=Bn,jl=Pn,Pl=gs.nodeIndex,Rl=function(t){var e=t.parentNode;return jl(e)?Rl(e):e},$l=function(t){return t?Et(t.childNodes,(function(t,e){return jl(e)&&"BR"!==e.nodeName?t=t.concat($l(e)):t.push(e),t}),[]):[]},Ml=function(t){return function(e){return t===e}},Bl=function(t){return(Il(t)?"text()":t.nodeName.toLowerCase())+"["+function(t){var e,n;e=$l(Rl(t)),n=Tt(e,Ml(t),t),e=e.slice(0,n+1);var r=Et(e,(function(t,n,r){return Il(n)&&Il(e[r-1])&&t++,t}),0);return e=St(e,Ln([t.nodeName])),(n=Tt(e,Ml(t),t))-r}(t)+"]"},ql=function(t,e){var n,r,o,i,a,s=[];return n=e.container(),r=e.offset(),Il(n)?o=function(t,e){for(;(t=t.previousSibling)&&Il(t);)e+=t.data.length;return e}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),s.push(Bl(n)),a=function(t,e,n){var r=[];for(e=e.parentNode;!(e===t||n&&n(e));e=e.parentNode)r.push(e);return r}(t,n),a=St(a,A(Pn)),(s=s.concat(xt(a,(function(t){return Bl(t)})))).reverse().join("/")+","+o},Fl=function(t,e){var n;if(!e)return null;var r=e.split(","),o=r[0].split("/");n=r.length>1?r[1]:"before";var i=Et(o,(function(t,e){var n=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(e);return n?("text()"===n[1]&&(n[1]="#text"),function(t,e,n){var r=$l(t);return r=St(r,(function(t,e){return!Il(t)||!Il(r[e-1])})),(r=St(r,Ln([e])))[n]}(t,n[1],parseInt(n[2],10))):null}),t);return i?Il(i)?function(t,e){for(var n,r=t,o=0;Il(r);){if(n=r.data.length,e>=o&&e<=o+n){t=r,e-=o;break}if(!Il(r.nextSibling)){t=r,e=n;break}o+=n,r=r.nextSibling}return Il(t)&&e>t.data.length&&(e=t.data.length),Al(t,e)}(i,parseInt(n,10)):(n="after"===n?Pl(i)+1:Pl(i),Al(i.parentNode,n)):null},zl=Wn,Ul=function(t,e,n,r,o){var i,a=r[o?"startContainer":"endContainer"],s=r[o?"startOffset":"endOffset"],l=[],u=0,c=t.getRoot();for(Bn(a)?l.push(n?function(t,e,n){var r,o;for(o=t(e.data.slice(0,n)).length,r=e.previousSibling;r&&Bn(r);r=r.previousSibling)o+=t(r.data).length;return o}(e,a,s):s):(s>=(i=a.childNodes).length&&i.length&&(u=1,s=Math.max(0,i.length-1)),l.push(t.nodeIndex(i[s],n)+u));a&&a!==c;a=a.parentNode)l.push(t.nodeIndex(a,n));return l},Hl=function(t,e,n){var r=0;return Te.each(t.select(e),(function(t){if("all"!==t.getAttribute("data-mce-bogus"))return t!==n&&void r++})),r},Vl=function(t,e){var n,r,o,i=e?"start":"end";n=t[i+"Container"],r=t[i+"Offset"],Nn(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(e?r:r-1,o.length-1)])&&(r=e?0:n.childNodes.length,t["set"+(e?"Start":"End")](n,r))},Wl=function(t){return Vl(t,!0),Vl(t,!1),t},Kl=function(t,e){var n;if(Nn(t)&&(t=ll(t,e),zl(t)))return t;if(To(t)){if(Bn(t)&&Oo(t)&&(t=t.parentNode),n=t.previousSibling,zl(n))return n;if(n=t.nextSibling,zl(n))return n}},Yl=function(t,e,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(zl(r)||"IMG"===o)return{name:o,index:Hl(n.dom,o,r)};var a=function(t){return Kl(t.startContainer,t.startOffset)||Kl(t.endContainer,t.endOffset)}(i);return a?{name:o=a.tagName,index:Hl(n.dom,o,a)}:function(t,e,n,r){var o=e.dom,i={};return i.start=Ul(o,t,n,r,!0),e.isCollapsed()||(i.end=Ul(o,t,n,r,!1)),Ro(r)&&(i.isFakeCaret=!0),i}(t,n,e,i)},Xl=function(t,e,n){var r={"data-mce-type":"bookmark",id:e,style:"overflow:hidden;line-height:0px"};return n?t.create("span",r,""):t.create("span",r)},Gl=function(t,e){var n=t.dom,r=t.getRng(),o=n.uniqueId(),i=t.isCollapsed(),a=t.getNode(),s=a.nodeName;if("IMG"===s)return{name:s,index:Hl(n,s,a)};var l=Wl(r.cloneRange());if(!i){l.collapse(!1);var u=Xl(n,o+"_end",e);Ll(n,l,u)}(r=Wl(r)).collapse(!0);var c=Xl(n,o+"_start",e);return Ll(n,r,c),t.moveToBookmark({id:o,keep:!0}),{id:o}},Zl=function(t,e,n){return 2===e?Yl(ko,n,t):3===e?function(t){var e=t.getRng();return{start:ql(t.dom.getRoot(),Al.fromRangeStart(e)),end:ql(t.dom.getRoot(),Al.fromRangeEnd(e))}}(t):e?function(t){return{rng:t.getRng()}}(t):Gl(t,!1)},Jl=T(Yl,O,!0),Ql=gs.DOM,tu=function(t,e,n){var r=t.getParam(e,n);if(-1!==r.indexOf("=")){var o=t.getParam(e,"","hash");return bt(o,t.id).getOr(n)}return r},eu=function(t){return t.getParam("content_security_policy","")},nu=function(t){if(t.getParam("force_p_newlines",!1))return"p";var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},ru=function(t){return t.getParam("forced_root_block_attrs",{})},ou=function(t){return t.getParam("automatic_uploads",!0,"boolean")},iu=function(t){return t.getParam("images_reuse_filename",!1,"boolean")},au=function(t){return t.getParam("icons","","string")},su=function(t){return t.getParam("images_upload_url","","string")},lu=function(t){return t.getParam("images_upload_base_path","","string")},uu=function(t){return t.getParam("images_upload_credentials",!1,"boolean")},cu=function(t){return t.getParam("images_upload_handler",null,"function")},fu=function(t){return t.getParam("content_css_cors",!1,"boolean")},du=function(t){return t.getParam("referrer_policy","","string")},hu=function(t){return t.getParam("language","en","string")},pu=function(t){return t.getParam("indent_use_margin",!1)},mu=function(t){var e=t.getParam("font_css",[]);return p(e)?e:H(e.split(","),qt)},gu=function(t){var e=t.getParam("object_resizing");return!1!==e&&!ke.iOS&&(d(e)?e:"table,img,figure.image,div,video,iframe")},vu=function(t){return t.getParam("event_root")},yu=function(t){return t.getParam("theme")},bu=function(t){return t.getParam("validate")},_u=function(t){return!1!==t.getParam("inline_boundaries")},wu=function(t){return t.getParam("content_css_cors")},Cu=function(t){return t.getParam("plugins","","string")},ku=Nn,xu=Bn,Su=function(t){var e=t.parentNode;e&&e.removeChild(t)},Ou=function(t){var e=ko(t);return{count:t.length-e.length,text:e}},Eu=function(t){for(var e;-1!==(e=t.data.lastIndexOf(wo));)t.deleteData(e,1)},Tu=function(t,e){return Lu(t),e},Au=function(t,e){var n=e.container(),r=function(t,e){var n=F(t,e);return-1===n?$.none():$.some(n)}(lt(n.childNodes),t).map((function(t){return t0?(Eu(t),Al(t,e.offset()-n.count)):e}(t,e):Tu(t,e)},Nu=function(t,e){return Al.isTextPosition(e)?Du(t,e):function(t,e){return e.container()===t.parentNode?Au(t,e):Tu(t,e)}(t,e)},Lu=function(t){ku(t)&&To(t)&&(Ao(t)?t.removeAttribute("data-mce-caret"):Su(t)),xu(t)&&(Eu(t),0===t.data.length&&Su(t))},Iu=pe().browser,ju=Wn,Pu=Yn,Ru=Kn,$u=function(t,e,n){var r,o,i=nl(e.getBoundingClientRect(),n);if("BODY"===t.tagName){var a=t.ownerDocument.documentElement;r=t.scrollLeft||a.scrollLeft,o=t.scrollTop||a.scrollTop}else{var s=t.getBoundingClientRect();r=t.scrollLeft-s.left,o=t.scrollTop-s.top}i.left+=r,i.right+=r,i.top+=o,i.bottom+=o,i.width=1;var l=e.offsetWidth-e.clientWidth;return l>0&&(n&&(l*=-1),i.left+=l,i.right+=l),i},Mu=function(t,e,n,r){var o,i,a=Es(),s=nu(t),l=s.length>0?s:"p",u=function(){!function(t){for(var e=Ms(De.fromDom(t),"*[contentEditable=false],video,audio,embed,object"),n=0;n').css(Dt({},s)).appendTo(e)[0];return a.set({caret:f,element:r,before:t}),t&&us(f).addClass("mce-visual-caret-before"),c(),(o=r.ownerDocument.createRange()).setStart(i,0),o.setEnd(i,0),o},hide:u,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){a.on((function(t){var n=$u(e,t.element,t.before);us(t.caret).css(Dt({},n))}))},destroy:function(){return oo.clearInterval(o)}}},Bu=function(){return Iu.isIE()||Iu.isEdge()||Iu.isFirefox()},qu=function(t){return ju(t)||Pu(t)},Fu=function(t){return qu(t)||Rn(t)&&Bu()},zu=Wn,Uu=Yn,Hu=In("display","block table table-cell table-caption list-item"),Vu=To,Wu=Oo,Ku=Nn,Yu=Vo,Xu=function(t){return t>0},Gu=function(t){return t<0},Zu=function(t,e){for(var n;n=t(e);)if(!Wu(n))return n;return null},Ju=function(t,e,n,r,o){var i=new so(t,r),a=zu(t)||Wu(t);if(Gu(e)){if(a&&n(t=Zu(i.prev.bind(i),!0)))return t;for(;t=Zu(i.prev.bind(i),o);)if(n(t))return t}if(Xu(e)){if(a&&n(t=Zu(i.next.bind(i),!0)))return t;for(;t=Zu(i.next.bind(i),o);)if(n(t))return t}return null},Qu=function(t,e){for(;t&&t!==e;){if(Hu(t))return t;t=t.parentNode}return null},tc=function(t,e,n){return Qu(t.container(),n)===Qu(e.container(),n)},ec=function(t,e){if(!e)return null;var n=e.container(),r=e.offset();return Ku(n)?n.childNodes[r+t]:null},nc=function(t,e){var n=e.ownerDocument.createRange();return t?(n.setStartBefore(e),n.setEndBefore(e)):(n.setStartAfter(e),n.setEndAfter(e)),n},rc=function(t,e,n){return Qu(e,t)===Qu(n,t)},oc=function(t,e,n){for(var r=t?"previousSibling":"nextSibling";n&&n!==e;){var o=n[r];if(Vu(o)&&(o=o[r]),zu(o)||Uu(o)){if(rc(e,o,n))return o;break}if(Yu(o))break;n=n.parentNode}return null},ic=T(nc,!0),ac=T(nc,!1),sc=function(t,e,n){var r,o=T(oc,!0,e),i=T(oc,!1,e),a=n.startContainer,s=n.startOffset;if(Oo(a)){Ku(a)||(a=a.parentNode);var l=a.getAttribute("data-mce-caret");if("before"===l&&(r=a.nextSibling,Fu(r)))return ic(r);if("after"===l&&(r=a.previousSibling,Fu(r)))return ac(r)}if(!n.collapsed)return n;if(Bn(a)){if(Vu(a)){if(1===t){if(r=i(a))return ic(r);if(r=o(a))return ac(r)}if(-1===t){if(r=o(a))return ac(r);if(r=i(a))return ic(r)}return n}if(jo(a)&&s>=a.data.length-1)return 1===t&&(r=i(a))?ic(r):n;if(Io(a)&&s<=1)return-1===t&&(r=o(a))?ac(r):n;if(s===a.data.length)return(r=i(a))?ic(r):n;if(0===s)return(r=o(a))?ac(r):n}return n},lc=function(t,e){return $.from(ec(t?0:-1,e)).filter(zu)},uc=function(t,e,n){var r=sc(t,e,n);return-1===t?Al.fromRangeStart(r):Al.fromRangeEnd(r)},cc=function(t){return $.from(t.getNode()).map(De.fromDom)},fc=function(t,e){for(;e=t(e);)if(e.isVisible())return e;return e},dc=function(t,e){var n=tc(t,e);return!(n||!Un(t.getNode()))||n};!function(t){t[t.Backwards=-1]="Backwards",t[t.Forwards=1]="Forwards"}(Dl||(Dl={}));var hc,pc=Wn,mc=Bn,gc=Nn,vc=Un,yc=Vo,bc=function(t){return zo(t)||function(t){return!!Wo(t)&&!0!==G(lt(t.getElementsByTagName("*")),(function(t,e){return t||$o(e)}),!1)}(t)},_c=Ko,wc=function(t,e){return t.hasChildNodes()&&e0)return Al(s,--l);if(Xu(t)&&l0&&(o=wc(s,l-1),yc(o)))return!bc(o)&&(i=Ju(o,t,_c,o))?mc(i)?Al(i,i.data.length):Al.after(i):mc(o)?Al(o,o.data.length):Al.before(o);if(Xu(t)&&l'),e},zc=function(t,e){return Rc(t).fold(L,(function(t){return e.setStart(t.container(),t.offset()),e.setEnd(t.container(),t.offset()),!0}))},Uc=function(t,e,n){return!(!function(t){return!1===t.hasChildNodes()}(e)||!Bc(t,e))&&(function(t,e){var n=t.ownerDocument.createTextNode(wo);t.appendChild(n),e.setStart(n,0),e.setEnd(n,0)}(e,n),!0)},Hc=function(t,e,n,r){var o,i,a,s,l=n[e?"start":"end"],u=t.getRoot();if(l){for(a=l[0],i=u,o=l.length-1;o>=1;o--){if(s=i.childNodes,Uc(u,i,r))return!0;if(l[o]>s.length-1)return!!Uc(u,i,r)||zc(i,r);i=s[l[o]]}3===i.nodeType&&(a=Math.min(l[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(l[0],i.childNodes.length)),e?r.setStart(i,a):r.setEnd(i,a)}return!0},Vc=function(t){return Bn(t)&&t.data.length>0},Wc=function(t,e,n){var r,o,i,a,s,l,u=t.get(n.id+"_"+e),c=n.keep;if(u){if(r=u.parentNode,"start"===e?(c?u.hasChildNodes()?(r=u.firstChild,o=1):Vc(u.nextSibling)?(r=u.nextSibling,o=0):Vc(u.previousSibling)?(r=u.previousSibling,o=u.previousSibling.data.length):(r=u.parentNode,o=t.nodeIndex(u)+1):o=t.nodeIndex(u),s=r,l=o):(c?u.hasChildNodes()?(r=u.firstChild,o=1):Vc(u.previousSibling)?(r=u.previousSibling,o=u.previousSibling.data.length):(r=u.parentNode,o=t.nodeIndex(u)):o=t.nodeIndex(u),s=r,l=o),!c){for(a=u.previousSibling,i=u.nextSibling,Te.each(Te.grep(u.childNodes),(function(t){Bn(t)&&(t.nodeValue=t.nodeValue.replace(/\uFEFF/g,""))}));u=t.get(n.id+"_"+e);)t.remove(u,!0);a&&i&&a.nodeType===i.nodeType&&Bn(a)&&!ke.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),t.remove(i),s=a,l=o)}return $.some(Al(s,l))}return $.none()},Kc=function(t,e){var n=t.dom;if(e){if(qc(e))return function(t,e){var n=t.createRng();return Hc(t,!0,e,n)&&Hc(t,!1,e,n)?$.some(n):$.none()}(n,e);if(function(t){return d(t.start)}(e))return $.some(function(t,e){var n,r=t.createRng();return n=Fl(t.getRoot(),e.start),r.setStart(n.container(),n.offset()),n=Fl(t.getRoot(),e.end),r.setEnd(n.container(),n.offset()),r}(n,e));if(function(t){return _t(t,"id")}(e))return function(t,e){var n=Wc(t,"start",e),r=Wc(t,"end",e);return Gn(n,r.or(n),(function(e,n){var r=t.createRng();return r.setStart(Fc(t,e.container()),e.offset()),r.setEnd(Fc(t,n.container()),n.offset()),r}))}(n,e);if(function(t){return _t(t,"name")}(e))return function(t,e){return $.from(t.select(e.name)[e.index]).map((function(e){var n=t.createRng();return n.selectNode(e),n}))}(n,e);if(function(t){return _t(t,"rng")}(e))return $.some(e.rng)}return $.none()},Yc=function(t,e,n){return Zl(t,e,n)},Xc=function(t,e){Kc(t,e).each((function(e){t.setRng(e)}))},Gc=function(t){return Nn(t)&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},Zc=(hc=_o,function(t){return hc===t}),Jc=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},Qc=function(t){return!Jc(t)&&!Zc(t)},tf=function(t){return!!t.nodeType},ef=function(t,e,n){var r=n.startOffset,o=n.startContainer;if((o!==n.endContainer||!function(t){return t&&/^(IMG)$/.test(t.nodeName)}(o.childNodes[r]))&&Nn(o)){var i=o.childNodes,a=void 0;r=0:i0:r=e.data.length&&t.splice(0,1);var n=t[t.length-1];return 0===i&&t.length>0&&n===a&&Bn(n)&&t.splice(t.length-1,1),t},l=function(t,e,n){for(var r=[];t&&t!==n;t=t[e])r.push(t);return r},u=function(e,n){return t.getParent(e,(function(t){return t.parentNode===n}),n)},c=function(t,e,r){for(var o=r?"nextSibling":"previousSibling",i=t,a=i.parentNode;i&&i!==e;i=a){a=i.parentNode;var u=l(i===t?i:i[o],o);u.length&&(r||u.reverse(),n(s(u)))}};if(o===a)return n(s([o]));var f=t.findCommonAncestor(o,a);if(t.isChildOf(o,a))return c(o,f,!0);if(t.isChildOf(a,o))return c(a,f);var d=u(o,f)||o,h=u(a,f)||a;c(o,d,!0);var p=l(d===o?d:d.nextSibling,"nextSibling",h===a?h.nextSibling:h);p.length&&n(s(p)),c(a,h)},jf=function(t){var e=[];if(t)for(var n=0;n0?n:Pf(t)},$f=function(t){return Rf(jf(t.selection.getSel()),De.fromDom(t.getBody()))},Mf=function(t,e){return Zr(t,"table",e)},Bf=function(t){return tn(t).fold(S([t]),(function(e){return[t].concat(Bf(e))}))},qf=function(t){return en(t).fold(S([t]),(function(e){return"br"===$e(e)?Ye(e).map((function(e){return[t].concat(qf(e))})).getOr([]):[t].concat(qf(e))}))},Ff=function(t,e){return Gn(function(t){var e=t.startContainer,n=t.startOffset;return Bn(e)?0===n?$.some(De.fromDom(e)):$.none():$.from(e.childNodes[n]).map(De.fromDom)}(e),function(t){var e=t.endContainer,n=t.endOffset;return Bn(e)?n===e.data.length?$.some(De.fromDom(e)):$.none():$.from(e.childNodes[n-1]).map(De.fromDom)}(e),(function(e,n){var r=J(Bf(t),T(je,e)),o=J(qf(t),T(je,n));return r.isSome()&&o.isSome()})).getOr(!1)},zf=function(t,e,n,r){var o=n,i=new so(n,o),a=vt(t.schema.getMoveCaretBeforeOnEnterElements(),(function(t,e){return!z(["td","th","table"],e.toLowerCase())}));do{if(Bn(n)&&0!==Te.trim(n.nodeValue).length)return void(r?e.setStart(n,0):e.setEnd(n,n.nodeValue.length));if(a[n.nodeName])return void(r?e.setStartBefore(n):"BR"===n.nodeName?e.setEndBefore(n):e.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?e.setStart(o,0):e.setEnd(o,o.childNodes.length))},Uf=function(t){var e=t.selection.getSel();return e&&e.rangeCount>0},Hf=function(t,e){var n=$f(t);n.length>0?V(n,(function(n){var r=n.dom,o=t.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),e(o,!0)})):e(t.selection.getRng(),!1)},Vf=function(t,e,n){var r=Gl(t,e);n(r),t.moveToBookmark(r)},Wf=function(t,e){var n=function(e){return t(e)?$.from(e.dom.nodeValue):$.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(Fe,"text"),Kf=function(t){return Wf.get(t)},Yf=function(t,e,n,r){return Ke(e).fold((function(){return"skipping"}),(function(o){return"br"===r||function(t){return Fe(t)&&Kf(t)===wo}(e)?"valid":function(t){return qe(t)&&Rs(t,Bs())}(e)?"existing":Mc(e.dom)?"caret":of(t,n,r)&&of(t,$e(o),n)?"valid":"invalid-child"}))},Xf=function(t,e,n,r){var o=e.uid,i=void 0===o?Ks("mce-annotation"):o,a=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o0;if(i.collapsed&&!a&&function(t,e){var n=Lf(t,e,[{inline:"span"}]);e.setStart(n.startContainer,n.startOffset),e.setEnd(n.endContainer,n.endOffset),t.selection.setRng(e)}(t,i),o.getRng().collapsed&&!a){var s=Xf(t.getDoc(),r,e,n.decorate);Ys(s,_o),o.getRng().insertNode(s.dom),o.select(s.dom)}else Vf(o,!1,(function(){Hf(t,(function(o){Gf(t,o,e,n.decorate,r)}))}))}))},Jf=function(t){var e,n=(e={},{register:function(t,n){e[t]={name:t,settings:n}},lookup:function(t){return bt(e,t).map((function(t){return t.settings}))}});Vs(t,n);var r=Hs(t);return{register:function(t,e){n.register(t,e)},annotate:function(e,r){n.lookup(e).each((function(n){Zf(t,e,n,r)}))},annotationChanged:function(t,e){r.addListener(t,e)},remove:function(e){zs(t,$.some(e)).each((function(t){var e=t.elements;V(e,yn)}))},getAll:function(e){var n=function(t,e){var n=De.fromDom(t.getBody()),r=Ms(n,"["+qs()+'="'+e+'"]'),o={};return V(r,(function(t){var e=er(t,Fs()),n=bt(o,e).getOr([]);o[e]=n.concat([t])})),o}(t,e);return ht(n,(function(t){return H(t,(function(t){return t.dom}))}))}}},Qf=function(t){return{getBookmark:T(Yc,t),moveToBookmark:T(Xc,t)}};Qf.isBookmarkNode=Gc;var td=function(t,e){for(;e&&e!==t;){if(Vn(e)||Wn(e))return e;e=e.parentNode}return null},ed=function(t,e,n){if(n.collapsed)return!1;if(ke.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(Nn(r))return U(r.getClientRects(),(function(n){return al(n,t,e)}))}return U(n.getClientRects(),(function(n){return al(n,t,e)}))},nd=function(t,e,n){return t.fire(e,n)},rd=function(t,e,n,r){return t.fire("FormatApply",{format:e,node:n,vars:r})},od=function(t,e,n,r){return t.fire("FormatRemove",{format:e,node:n,vars:r})},id={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:function(t){return t.shiftKey||t.ctrlKey||t.altKey||id.metaKeyPressed(t)},metaKeyPressed:function(t){return ke.mac?t.metaKey:t.ctrlKey&&!t.altKey}},ad=Wn,sd=function(t,e){var n,r,o,i,a,s,l,u,c,f,d,h,p,m,g,v="data-mce-selected",y=e.dom,_=Te.each,w=e.getDoc(),C=document,k=Math.abs,x=Math.round,S=e.getBody(),O={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},E=function(t){return t&&("IMG"===t.nodeName||e.dom.is(t,"figure.image"))},T=function(t){return Yn(t)||y.hasClass(t,"mce-preview-object")},A=function(t){var n=t.target;(function(t,e){if("longpress"===t.type||0===t.type.indexOf("touch")){var n=t.touches[0];return E(t.target)&&!ed(n.clientX,n.clientY,e)}return E(t.target)&&!ed(t.clientX,t.clientY,e)})(t,e.selection.getRng())&&!t.isDefaultPrevented()&&e.selection.select(n)},D=function(t){return y.is(t,"figure.image")?[t.querySelector("img")]:y.hasClass(t,"mce-preview-object")&&b(t.firstElementChild)?[t,t.firstElementChild]:[t]},N=function(t){var n=gu(e);return!!n&&("false"!==t.getAttribute("data-mce-resize")&&(t!==e.getBody()&&(y.hasClass(t,"mce-preview-object")?Le(De.fromDom(t.firstElementChild),n):Le(De.fromDom(t),n))))},L=function(t,n,r){if(b(r)){var o=D(t);V(o,(function(t){t.style[n]||!e.schema.isValid(t.nodeName.toLowerCase(),n)?y.setStyle(t,n,r):y.setAttrib(t,n,""+r)}))}},I=function(t,e,n){L(t,"width",e),L(t,"height",n)},j=function(t){var a,v,b,_,w;a=t.screenX-s,v=t.screenY-l,h=a*i[2]+u,p=v*i[3]+c,h=h<5?5:h,p=p<5?5:p,b=(E(n)||T(n))&&!1!==function(t){return t.getParam("resize_img_proportional",!0,"boolean")}(e)?!id.modifierPressed(t):id.modifierPressed(t),b&&(k(a)>k(v)?(p=x(h*f),h=x(p/f)):(h=x(p/f),p=x(h*f))),I(r,h,p),_=(_=i.startPos.x+a)>0?_:0,w=(w=i.startPos.y+v)>0?w:0,y.setStyles(o,{left:_,top:w,display:"block"}),o.innerHTML=h+" × "+p,i[2]<0&&r.clientWidth<=h&&y.setStyle(r,"left",undefined+(u-h)),i[3]<0&&r.clientHeight<=p&&y.setStyle(r,"top",undefined+(c-p)),(a=S.scrollWidth-m)+(v=S.scrollHeight-g)!==0&&y.setStyles(o,{left:_-a,top:w-v}),d||(!function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(e,n,u,c,"corner-"+i.name),d=!0)},P=function(){var t=d;d=!1,t&&(L(n,"width",h),L(n,"height",p)),y.unbind(w,"mousemove",j),y.unbind(w,"mouseup",P),C!==w&&(y.unbind(C,"mousemove",j),y.unbind(C,"mouseup",P)),y.remove(r),y.remove(o),y.remove(a),R(n),t&&(!function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(e,n,h,p,"corner-"+i.name),y.setAttrib(n,"style",y.getAttrib(n,"style"))),e.nodeChanged()},R=function(t){q();var d=y.getPos(t,S),b=d.x,k=d.y,x=t.getBoundingClientRect(),E=x.width||x.right-x.left,A=x.height||x.bottom-x.top;n!==t&&($(),n=t,h=p=0);var L=e.fire("ObjectSelected",{target:t}),R=y.getAttrib(n,v,"1");N(t)&&!L.isDefaultPrevented()?_(O,(function(t,e){var d,h=function(d){var h,p=D(n)[0];s=d.screenX,l=d.screenY,u=p.clientWidth,c=p.clientHeight,f=c/u,(i=t).name=e,i.startPos={x:E*t[0]+b,y:A*t[1]+k},m=S.scrollWidth,g=S.scrollHeight,a=y.add(S,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),y.setStyles(a,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),r=T(h=n)?y.create("img",{src:ke.transparentSrc}):h.cloneNode(!0),y.addClass(r,"mce-clonedresizable"),y.setAttrib(r,"data-mce-bogus","all"),r.contentEditable="false",y.setStyles(r,{left:b,top:k,margin:0}),I(r,E,A),r.removeAttribute(v),S.appendChild(r),y.bind(w,"mousemove",j),y.bind(w,"mouseup",P),C!==w&&(y.bind(C,"mousemove",j),y.bind(C,"mouseup",P)),o=y.add(S,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},u+" × "+c)};(d=y.get("mceResizeHandle"+e))&&y.remove(d),d=y.add(S,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===ke.ie&&(d.contentEditable=!1),y.bind(d,"mousedown",(function(t){t.stopImmediatePropagation(),t.preventDefault(),h(t)})),t.elm=d,y.setStyles(d,{left:E*t[0]+b-d.offsetWidth/2,top:A*t[1]+k-d.offsetHeight/2})})):$(),y.getAttrib(n,v)||n.setAttribute(v,R)},$=function(){q(),n&&n.removeAttribute(v),dt(O,(function(t,e){var n=y.get("mceResizeHandle"+e);n&&(y.unbind(n),y.remove(n))}))},M=function(n){var r,o=function(t,e){if(t)do{if(t===e)return!0}while(t=t.parentNode)};d||e.removed||(_(y.select("img[data-mce-selected],hr[data-mce-selected]"),(function(t){t.removeAttribute(v)})),r="mousedown"===n.type?n.target:t.getNode(),o(r=y.$(r).closest("table,img,figure.image,hr,video,span.mce-preview-object")[0],S)&&(F(),o(t.getStart(!0),r)&&o(t.getEnd(!0),r))?R(r):$())},B=function(t){return ad(td(e.getBody(),t))},q=function(){dt(O,(function(t){t.elm&&(y.unbind(t.elm),delete t.elm)}))},F=function(){try{e.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(t){}};e.on("init",(function(){if(F(),ke.browser.isIE()||ke.browser.isEdge()){e.on("mousedown click",(function(t){var n=t.target,r=n.nodeName;d||!/^(TABLE|IMG|HR)$/.test(r)||B(n)||(2!==t.button&&e.selection.select(n,"TABLE"===r),"mousedown"===t.type&&e.nodeChanged())}));var t=function(t){var n=function(t){oo.setEditorTimeout(e,(function(){return e.selection.select(t)}))};if(B(t.target)||Yn(t.target))return t.preventDefault(),void n(t.target);/^(TABLE|IMG|HR)$/.test(t.target.nodeName)&&(t.preventDefault(),"IMG"===t.target.tagName&&n(t.target))};y.bind(S,"mscontrolselect",t),e.on("remove",(function(){return y.unbind(S,"mscontrolselect",t)}))}var r=oo.throttle((function(t){e.composing||M(t)}));e.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",r),e.on("keyup compositionend",(function(t){n&&"TABLE"===n.nodeName&&r(t)})),e.on("hide blur",$),e.on("contextmenu longpress",A,!0)})),e.on("remove",q);return{isResizable:N,showResizeRect:R,hideResizeRect:$,updateResizeRect:M,destroy:function(){n=r=a=null}}},ld=function(t){return Vn(t)||Wn(t)},ud=function(t,e,n){var r,o,i=n;if(i.caretPositionFromPoint)(o=i.caretPositionFromPoint(t,e))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(i.caretRangeFromPoint)r=i.caretRangeFromPoint(t,e);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(t,e),r.collapse(!0)}catch(o){r=function(t,e,n){var r,o=n.elementFromPoint(t,e),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),(r=(r=Te.toArray(i.getClientRects())).sort((function(t,n){return(t=Math.abs(Math.max(t.top-e,t.bottom-e)))-Math.abs(Math.max(n.top-e,n.bottom-e))}))).length>0){e=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(t,e),i.collapse(!0),i}catch(t){}}return null}(t,e,n)}return function(t,e){var n=t&&t.parentElement?t.parentElement():null;return Wn(function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(n,e,ld))?null:t}(r,n.body)}return r},cd=function(t,e){return t&&e&&t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset},fd=function(t,e,n){return null!==function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(t,e,n)},dd=function(t,e,n){return fd(t,e,(function(t){return t.nodeName===n}))},hd=function(t){return t&&"TABLE"===t.nodeName},pd=function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)},md=function(t,e){return To(t)&&!1===fd(t,e,Mc)},gd=function(t,e,n){for(var r=new so(e,t.getParent(e.parentNode,t.isBlock)||t.getRoot());e=r[n?"prev":"next"]();)if(Un(e))return!0},vd=function(t,e,n,r,o){var i,a,s=t.getRoot(),l=t.schema.getNonEmptyElements(),u=t.getParent(o.parentNode,t.isBlock)||s;if(r&&Un(o)&&e&&t.isEmpty(u))return $.some(Al(o.parentNode,t.nodeIndex(o)));for(var c=new so(o,u);a=c[r?"prev":"next"]();){if("false"===t.getContentEditableParent(a)||md(a,s))return $.none();if(Bn(a)&&a.nodeValue.length>0)return!1===dd(a,s,"A")?$.some(Al(a,r?a.nodeValue.length:0)):$.none();if(t.isBlock(a)||l[a.nodeName.toLowerCase()])return $.none();i=a}return n&&i?$.some(Al(i,0)):$.none()},yd=function(t,e,n,r){var o,i,a,s,l=t.getRoot(),u=!1;o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"];var c=Nn(o)&&i===o.childNodes.length,f=t.schema.getNonEmptyElements();if(s=n,To(o))return $.none();if(Nn(o)&&i>o.childNodes.length-1&&(s=!1),Fn(o)&&(o=l,i=0),o===l){if(s&&(a=o.childNodes[i>0?i-1:0])){if(To(a))return $.none();if(f[a.nodeName]||hd(a))return $.none()}if(o.hasChildNodes()){if(i=Math.min(!s&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Bn(o)&&c?o.data.length:0,!e&&o===l.lastChild&&hd(o))return $.none();if(function(t,e){for(;e&&e!==t;){if(Wn(e))return!0;e=e.parentNode}return!1}(l,o)||To(o))return $.none();if(o.hasChildNodes()&&!1===hd(o)){a=o;var d=new so(o,l);do{if(Wn(a)||To(a)){u=!1;break}if(Bn(a)&&a.nodeValue.length>0){i=s?0:a.nodeValue.length,o=a,u=!0;break}if(f[a.nodeName.toLowerCase()]&&!pd(a)){i=t.nodeIndex(a),o=a.parentNode,s||i++,u=!0;break}}while(a=s?d.next():d.prev())}}}return e&&(Bn(o)&&0===i&&vd(t,c,e,!0,o).each((function(t){o=t.container(),i=t.offset(),u=!0})),Nn(o)&&((a=o.childNodes[i])||(a=o.childNodes[i-1]),!a||!Un(a)||function(t,e){return t.previousSibling&&t.previousSibling.nodeName===e}(a,"A")||gd(t,a,!1)||gd(t,a,!0)||vd(t,c,e,!0,a).each((function(t){o=t.container(),i=t.offset(),u=!0})))),s&&!e&&Bn(o)&&i===o.nodeValue.length&&vd(t,c,e,!1,o).each((function(t){o=t.container(),i=t.offset(),u=!0})),u?$.some(Al(o,i)):$.none()},bd=function(t,e){var n=e.collapsed,r=e.cloneRange(),o=Al.fromRangeStart(e);return yd(t,n,!0,r).each((function(t){n&&Al.isAbove(o,t)||r.setStart(t.container(),t.offset())})),n||yd(t,n,!1,r).each((function(t){r.setEnd(t.container(),t.offset())})),n&&r.collapse(!0),cd(e,r)?$.none():$.some(r)},_d=function(t,e){return t.splitText(e)},wd=function(t){var e=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset;return e===r&&Bn(e)?n>0&&nn?(e=r=_d(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Bn(e)&&n>0&&n0&&oo?e-o:0}}}("height",(function(t){var e=t.dom;return bn(t)?e.getBoundingClientRect().height:e.offsetHeight})),Sd=function(t,e){return t.view(e).fold(S([]),(function(e){var n=t.owner(e),r=Sd(t,n);return[e].concat(r)}))},Od=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?$.none():$.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(De.fromDom)},owner:function(t){return Ve(t)}}),Ed=function(t){var e=De.fromDom(document),n=xn(e),r=function(t,e){var n=e.owner(t);return Sd(e,n)}(t,Od),o=kn(t),i=X(r,(function(t,e){var n=kn(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return wn(i.left+o.left+n.left,i.top+o.top+n.top)},Td=function(t){return"textarea"===$e(t)},Ad=function(t,e){var n=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return wn(n.offsetLeft,n.offsetTop);var i=Cn(null==r?void 0:r.pageYOffset,o.scrollTop),a=Cn(null==r?void 0:r.pageXOffset,o.scrollLeft),s=Cn(o.clientTop,n.clientTop),l=Cn(o.clientLeft,n.clientLeft);return kn(t).translate(a-l,i-s)}(t),r=function(t){return xd.get(t)}(t);return{element:t,bottom:n.top+r,height:r,pos:n,cleanup:e}},Dd=function(t,e){var n=function(t,e){var n=Je(t);if(0===n.length||Td(t))return{element:t,offset:e};if(e\ufeff');return fn(n.element,r),Ad(r,(function(){return vn(r)}))},Nd=function(t,e,n,r){Pd(t,(function(o,i){return Id(t,e,n,r)}),n)},Ld=function(t,e,n,r,o){var i={elm:r.element.dom,alignToTop:o};(function(t,e){return t.fire("ScrollIntoView",e).isDefaultPrevented()})(t,i)||(n(e,xn(e).top,r,o),function(t,e){t.fire("AfterScrollIntoView",e)}(t,i))},Id=function(t,e,n,r){var o=De.fromDom(t.getBody()),i=De.fromDom(t.getDoc());o.dom.offsetWidth;var a=Dd(De.fromDom(n.startContainer),n.startOffset);Ld(t,i,e,a,r),a.cleanup()},jd=function(t,e,n,r){var o=De.fromDom(t.getDoc());Ld(t,o,n,function(t){return Ad(De.fromDom(t),C)}(e),r)},Pd=function(t,e,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;e(De.fromDom(r),De.fromDom(i));var s=t.dom.createRng();s.setStart(r,o),s.setEnd(i,a),t.selection.setRng(n)},Rd=function(t,e,n,r){var o=t.pos;if(n)Sn(o.left,o.top,r);else{var i=o.top-e+t.height;Sn(o.left,i,r)}},$d=function(t,e,n,r,o){var i=n+e,a=r.pos.top,s=r.bottom,l=s-a>=n;if(ai){Rd(r,n,l?!1!==o:!0===o,t)}else s>i&&!l&&Rd(r,n,!0===o,t)},Md=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;$d(t,e,o,n,r)},Bd=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;$d(t,e,o,n,r);var i=Ed(n.element),a=Tn(window);i.topa.bottom&&On(n.element,!0===r)},qd=function(t,e,n){return Nd(t,Md,e,n)},Fd=function(t,e,n){return jd(t,e,Md,n)},zd=function(t,e,n){return Nd(t,Bd,e,n)},Ud=function(t,e,n){return jd(t,e,Bd,n)},Hd=function(t,e,n){(t.inline?qd:zd)(t,e,n)},Vd=function(t){var e=sn(t).dom;return t.dom===e.activeElement},Wd=function(t){return void 0===t&&(t=De.fromDom(document)),$.from(t.dom.activeElement).map(De.fromDom)},Kd=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Yd=Sr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Xd=(Yd.before,Yd.on,Yd.after,function(t){return t.fold(O,O,O)}),Gd=Sr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Zd={domRange:Gd.domRange,relative:Gd.relative,exact:Gd.exact,exactFromRange:function(t){return Gd.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return De.fromDom(t.startContainer)},relative:function(t,e){return Xd(t)},exact:function(t,e,n,r){return t}})}(t);return We(e)},range:Kd},Jd=pe().browser,Qd=function(t,e){var n=Fe(e)?Kf(e).length:Je(e).length+1;return t>n?n:t<0?0:t},th=function(t){return Zd.range(t.start,Qd(t.soffset,t.start),t.finish,Qd(t.foffset,t.finish))},eh=function(t,e){return!Dn(e.dom)&&(Re(t,e)||je(t,e))},nh=function(t){return function(e){return eh(t,e.start)&&eh(t,e.finish)}},rh=function(t){return!0===t.inline||Jd.isIE()},oh=function(t){return Zd.range(De.fromDom(t.startContainer),t.startOffset,De.fromDom(t.endContainer),t.endOffset)},ih=function(t){return function(t){var e=t.getSelection();return(e&&0!==e.rangeCount?$.from(e.getRangeAt(0)):$.none()).map(oh)}(We(t).dom).filter(nh(t))},ah=function(t){var e=document.createRange();try{return e.setStart(t.start.dom,t.soffset),e.setEnd(t.finish.dom,t.foffset),$.some(e)}catch(t){return $.none()}},sh=function(t){var e=rh(t)?ih(De.fromDom(t.getBody())):$.none();t.bookmark=e.isSome()?e:t.bookmark},lh=function(t){return(t.bookmark?t.bookmark:$.none()).bind((function(e){return function(t,e){return $.from(e).filter(nh(t)).map(th)}(De.fromDom(t.getBody()),e)})).bind(ah)},uh={isEditorUIElement:function(t){var e=t.className.toString();return-1!==e.indexOf("tox-")||-1!==e.indexOf("mce-")}},ch=function(t,e){pe().browser.isIE()?function(t){t.on("focusout",(function(){sh(t)}))}(t):function(t,e){t.on("mouseup touchend",(function(t){e.throttle()}))}(t,e),t.on("keyup NodeChange",(function(e){(function(t){return"nodechange"===t.type&&t.selectionChange})(e)||sh(t)}))},fh=function(t){var e=Ts((function(){sh(t)}),0);t.on("init",(function(){t.inline&&function(t,e){var n=function(){e.throttle()};gs.DOM.bind(document,"mouseup",n),t.on("remove",(function(){gs.DOM.unbind(document,"mouseup",n)}))}(t,e),ch(t,e)})),t.on("remove",(function(){e.cancel()}))},dh=gs.DOM,hh=function(t,e){var n=function(t){return t.getParam("custom_ui_selector","","string")}(t),r=dh.getParent(e,(function(e){return function(t){return uh.isEditorUIElement(t)}(e)||!!n&&t.dom.is(e,n)}));return null!==r},ph=function(t,e){var n=e.editor;fh(n),n.on("focusin",(function(){var e=t.focusedEditor;e!==n&&(e&&e.fire("blur",{focusedEditor:n}),t.setActive(n),t.focusedEditor=n,n.fire("focus",{blurredEditor:e}),n.focus(!0))})),n.on("focusout",(function(){oo.setEditorTimeout(n,(function(){var e=t.focusedEditor;hh(n,function(t){try{var e=sn(De.fromDom(t.getElement()));return Wd(e).fold((function(){return document.body}),(function(t){return t.dom}))}catch(t){return document.body}}(n))||e!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null)}))})),kd||(kd=function(e){var n=t.activeEditor;n&&function(t){if(an()&&b(t.target)){var e=De.fromDom(t.target);if(qe(e)&&cn(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return at(n)}}return $.from(t.target)}(e).each((function(e){e.ownerDocument===document&&(e===document.body||hh(n,e)||t.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null))}))},dh.bind(document,"focusin",kd))},mh=function(t,e){t.focusedEditor===e.editor&&(t.focusedEditor=null),t.activeEditor||(dh.unbind(document,"focusin",kd),kd=null)},gh=function(t,e){return function(t){return t.collapsed?$.from(ll(t.startContainer,t.startOffset)).map(De.fromDom):$.none()}(e).bind((function(e){return vo(e)?$.some(e):!1===Re(t,e)?$.some(t):$.none()}))},vh=function(t,e){gh(De.fromDom(t.getBody()),e).bind((function(t){return Pc(t.dom)})).fold((function(){t.selection.normalize()}),(function(e){return t.selection.setRng(e.toRange())}))},yh=function(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()},bh=function(t){return Vd(t)||(e=t,Wd(sn(e)).filter((function(t){return e.dom.contains(t.dom)}))).isSome();var e},_h=function(t){return t.inline?function(t){var e=t.getBody();return e&&bh(De.fromDom(e))}(t):function(t){return t.iframeElement&&Vd(De.fromDom(t.iframeElement))}(t)},wh=function(t){return _h(t)||function(t){var e=sn(De.fromDom(t.getElement()));return Wd(e).filter((function(e){return!(void 0!==(n=e.dom.classList)&&(n.contains("tox-edit-area")||n.contains("tox-edit-area__iframe")||n.contains("mce-content-body")))&&hh(t,e.dom);var n})).isSome()}(t)},Ch=function(t){return t.editorManager.setActive(t)},kh=function(t,e){t.removed||(e?Ch(t):function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===_h(t)&&lh(t).each((function(e){t.selection.setRng(e),r=e}));var o=function(t,e){return t.dom.getParent(e,(function(e){return"true"===t.dom.getContentEditable(e)}))}(t,e.getNode());if(t.$.contains(n,o))return yh(o),vh(t,r),void Ch(t);t.inline||(ke.opera||yh(n),t.getWin().focus()),(ke.gecko||t.inline)&&(yh(n),vh(t,r)),Ch(t)}(t))},xh=function(t,e,n,r,o){var i=n?e.startContainer:e.endContainer,a=n?e.startOffset:e.endOffset;return $.from(i).map(De.fromDom).map((function(t){return r&&e.collapsed?t:Qe(t,o(t,a)).getOr(t)})).bind((function(t){return qe(t)?$.some(t):Ke(t).filter(qe)})).map((function(t){return t.dom})).getOr(t)},Sh=function(t,e,n){return xh(t,e,!0,n,(function(t,e){return Math.min(nn(t),e)}))},Oh=function(t,e,n){return xh(t,e,!1,n,(function(t,e){return e>0?e-1:e}))},Eh=function(t,e){for(var n=t;t&&Bn(t)&&0===t.length;)t=e?t.nextSibling:t.previousSibling;return t||n},Th=function(t,e){return H(e,(function(e){var n=t.fire("GetSelectionRange",{range:e});return n.range!==e?n.range:e}))},Ah={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Dh=function(t,e,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(t[r])return t[r];if(t!==e){var i=t[o];if(i)return i;for(var a=t.parent;a&&a!==e;a=a.parent)if(i=a[o])return i}},Nh=function(t){if(!Xo(t.value))return!1;var e=t.parent;return!e||"span"===e.name&&!e.attr("style")||!/^[ ]+$/.test(t.value)},Lh=function(t){var e="a"===t.name&&!t.attr("href")&&t.attr("id");return t.attr("name")||t.attr("id")&&!t.firstChild||t.attr("data-mce-bookmark")||e},Ih=function(){function t(t,e){this.name=t,this.type=e,1===e&&(this.attributes=[],this.attributes.map={})}return t.create=function(e,n){var r=new t(e,Ah[e]||1);return n&&dt(n,(function(t,e){r.attr(e,t)})),r},t.prototype.replace=function(t){var e=this;return t.parent&&t.remove(),e.insert(t,e),e.remove(),e},t.prototype.attr=function(t,e){var n,r=this;if("string"!=typeof t)return null!=t&&dt(t,(function(t,e){r.attr(e,t)})),r;if(n=r.attributes){if(void 0!==e){if(null===e){if(t in n.map){delete n.map[t];for(var o=n.length;o--;)if(n[o].name===t)return n.splice(o,1),r}return r}if(t in n.map){for(o=n.length;o--;)if(n[o].name===t){n[o].value=e;break}}else n.push({name:t,value:e});return n.map[t]=e,r}return n.map[t]}},t.prototype.clone=function(){var e,n=this,r=new t(n.name,n.type);if(e=n.attributes){var o=[];o.map={};for(var i=0,a=e.length;i=s.length)for(n=0,r=a.length;n=s.length||a[n]!==s[n]){o=n+1;break}if(a.length=a.length||a[n]!==s[n]){o=n+1;break}if(1===o)return e;for(n=0,r=a.length-(o-1);n=0;n--)0!==l[n].length&&"."!==l[n]&&(".."!==l[n]?o>0?o--:i.push(l[n]):o++);return 0!==(r=(n=s.length-o)<=0?nt(i).join("/"):s.slice(0,n).join("/")+"/"+nt(i).join("/")).indexOf("/")&&(r="/"+r),a&&r.lastIndexOf("/")!==r.length-1&&(r+=a),r},t.prototype.getURI=function(t){var e;return void 0===t&&(t=!1),this.source&&!t||(e="",t||(this.protocol?e+=this.protocol+"://":e+="//",this.userInfo&&(e+=this.userInfo+"@"),this.host&&(e+=this.host),this.port&&(e+=":"+this.port)),this.path&&(e+=this.path),this.query&&(e+="?"+this.query),this.anchor&&(e+="#"+this.anchor),this.source=e),this.source},t}(),zh=Te.makeMap("button,fieldset,form,iframe,img,image,input,object,output,select,textarea"),Uh=function(t,e,n){for(var r=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,o=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,i=t.getShortEndedElements(),a=1,s=n;0!==a;)for(r.lastIndex=s;;){var l=r.exec(e);if(null===l)return s;if("!"===l[1]){s=Mt(l[2],"--")?Hh(e,!1,l.index+"!--".length):Hh(e,!0,l.index+1);break}o.lastIndex=r.lastIndex;var u=o.exec(e);if(!m(u)&&u.index===r.lastIndex){"/"===l[1]?a-=1:_t(i,l[2])||(a+=1),s=r.lastIndex+u[0].length;break}}return s},Hh=function(t,e,n){void 0===n&&(n=0);var r=t.toLowerCase();if(-1!==r.indexOf("[if ",n)&&function(t,e){return/^\s*\[if [\w\W]+\]>.*/.test(t.substr(e))}(r,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(e){var i=r.indexOf(">",n);return-1!==i?i:r.length}var a=/--!?>/g;a.lastIndex=n;var s=a.exec(t);return s?s.index+s[0].length:r.length},Vh=function(t,e){var n=t.exec(e);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null},Wh=function(t,e){var n;void 0===e&&(e=Ai());var r=null!==(n=(t=t||{}).document)&&void 0!==n?n:document,o=r.createElement("form");!1!==t.fix_self_closing&&(t.fix_self_closing=!0);var i=t.comment?t.comment:C,a=t.cdata?t.cdata:C,s=t.text?t.text:C,l=t.start?t.start:C,u=t.end?t.end:C,c=t.pi?t.pi:C,f=t.doctype?t.doctype:C,d=function(n,d){void 0===d&&(d="html");for(var h,p,m,g,v,y,b,_,w,C,k,x,S,O,E,T,A,D,N,L=n.html,I=0,j=[],P=0,R=bi.decode,$=Te.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),M="html"===d?0:1,B=function(t){var e,n;for(e=j.length;e--&&j[e].name!==t;);if(e>=0){for(n=j.length-1;n>=e;n--)(t=j[n]).valid&&u(t.name);j.length=e}},q=function(t,e){return s(jh(t,n),e)},F=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),t.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),i(jh(e,n)))},z=function(t,e){var n=t||"",r=!Mt(n,"--"),o=Hh(L,r,e);return t=L.substr(e,o-e),F(r?n+t:t),o+1},U=function(e,i,a,s,l){if(a=function(t){return jh(t,n)}((i=i.toLowerCase())in Y?i:R(a||s||l||"")),X&&!_&&!1===function(t){return 0===t.indexOf("data-")||0===t.indexOf("aria-")}(i)){var u=O[i];if(!u&&E){for(var c=E.length;c--&&!(u=E[c]).pattern.test(i););-1===c&&(u=null)}if(!u)return;if(u.validValues&&!(a in u.validValues))return}("name"===i||"id"===i)&&e in zh&&(a in r||a in o)||$[i]&&!Fh.isDomSafe(a,e,t)||_&&(i in $||0===i.indexOf("on"))||(g.map[i]=a,g.push({name:i,value:a}))},H=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^'\">]+(?:\"[^\"]*\"|'[^']*'))*[^\"'>]*(?:\"[^\">]*|'[^'>]*)?|\\s*|\\/)>))","g"),V=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,W=e.getShortEndedElements(),K=t.self_closing_elements||e.getSelfClosingElements(),Y=e.getBoolAttrs(),X=t.validate,G=t.remove_internals,Z=t.fix_self_closing,J=e.getSpecialElements(),Q=L+">";h=H.exec(Q);){var tt=h[0];if(IL.length){q(R(L.substr(h.index))),I=h.index+tt.length;continue}":"===(p=p.toLowerCase()).charAt(0)&&(p=p.substr(1)),w=p in W,Z&&K[p]&&j.length>0&&j[j.length-1].name===p&&B(p);var et=Vh(V,h[9]);if(null!==et){if("all"===et){I=Uh(e,L,H.lastIndex),H.lastIndex=I;continue}k=!1}if(!X||(C=e.getElementRule(p))){if(k=!0,X&&(O=C.attributes,E=C.attributePatterns),(S=h[9])?((_=-1!==S.indexOf("data-mce-type"))&&G&&(k=!1),(g=[]).map={},S.replace(V,(function(t,e,n,r,o){return U(p,e,n,r,o),""}))):(g=[]).map={},X&&!_){if(T=C.attributesRequired,A=C.attributesDefault,D=C.attributesForced,C.removeEmptyAttrs&&!g.length&&(k=!1),D)for(v=D.length;v--;)b=(x=D[v]).name,"{$uid}"===(N=x.value)&&(N="mce_"+P++),g.map[b]=N,g.push({name:b,value:N});if(A)for(v=A.length;v--;)(b=(x=A[v]).name)in g.map||("{$uid}"===(N=x.value)&&(N="mce_"+P++),g.map[b]=N,g.push({name:b,value:N}));if(T){for(v=T.length;v--&&!(T[v]in g.map););-1===v&&(k=!1)}if(x=g.map["data-mce-bogus"]){if("all"===x){I=Uh(e,L,H.lastIndex),H.lastIndex=I;continue}k=!1}}k&&l(p,g,w)}else k=!1;if(m=J[p]){m.lastIndex=I=h.index+tt.length,(h=m.exec(L))?(k&&(y=L.substr(I,h.index-I)),I=h.index+h[0].length):(y=L.substr(I),I=L.length),k&&(y.length>0&&q(y,!0),u(p)),H.lastIndex=I;continue}w||(S&&S.indexOf("/")===S.length-1?k&&u(p):j.push({name:p,valid:k}))}else if(p=h[1])F(p);else if(p=h[2]){if(!(1===M||t.preserve_cdata||j.length>0&&e.isValidChild(j[j.length-1].name,"#cdata"))){I=z("",h.index+2),H.lastIndex=I;continue}a(p)}else if(p=h[3])f(p);else{if((p=h[4])||"=0;v--)(p=j[v]).valid&&u(p.name)};return{parse:function(t,e){void 0===e&&(e="html"),d(function(t){for(var e,n=/data:[^;]+;base64,([a-z0-9\+\/=\s]+)/gi,r=[],o={},i=Ks("img"),a=0,s=0;e=n.exec(t);){var l=e[0],u=i+"_"+s++;o[u]=l,a]*data-mce-bogus="all"[^>]*>/g,o=t.schema,i=function(t,e){var n=new RegExp(["\\s?("+t.join("|")+')="[^"]+"'].join("|"),"gi");return e.replace(n,"")}(t.getTempAttrs(),e),a=o.getShortEndedElements();n=r.exec(i);){var s=r.lastIndex,l=n[0].length,u=void 0;u=a[n[1]]?s:Wh.findEndTag(o,i,s),i=i.substring(0,s-l)+i.substring(u),r.lastIndex=s-l}return ko(i)},Yh=Kh,Xh=function(t,e,n,r){var o,i=function(t,e){return Dt(Dt({},t),{format:e,get:!0,getInner:!0})}(e,n),a=e.no_events?i:t.fire("BeforeGetContent",i);return o="raw"===a.format?Te.trim(Yh(t.serializer,r.innerHTML)):"text"===a.format?t.dom.isEmpty(r)?"":ko(r.innerText||r.textContent):"tree"===a.format?t.serializer.serialize(r,a):function(t,e){var n=nu(t),r=new RegExp("^(<"+n+"[^>]*>( | |\\s| |
|)<\\/"+n+">[\r\n]*|
[\r\n]*)$");return e.replace(r,"")}(t,t.serializer.serialize(r,a)),z(["text","tree"],a.format)||bo(De.fromDom(r))?a.content=o:a.content=Te.trim(o),a.no_events?a.content:t.fire("GetContent",a).content},Gh=Te.each,Zh=function(t){return{compare:function(e,n){if(e.nodeName!==n.nodeName)return!1;var r=function(e){var n={};return Gh(t.getAttribs(e),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=t.getAttrib(e,o))})),n},o=function(t,e){var n,r;for(r in t)if(_t(t,r)){if(void 0===(n=e[r]))return!1;if(t[r]!==n)return!1;delete e[r]}for(r in e)if(_t(e,r))return!1;return!0};return!!o(r(e),r(n))&&(!!o(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(n,"style")))&&(!Gc(e)&&!Gc(n)))}}},Jh=Te.makeMap,Qh=function(t){var e=[],n=(t=t||{}).indent,r=Jh(t.indent_before||""),o=Jh(t.indent_after||""),i=bi.getEncodeFunc(t.entity_encoding||"raw",t.entities),a="html"===t.element_format;return{start:function(t,s,l){var u,c,f,d;if(n&&r[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n"),e.push("<",t),s)for(u=0,c=s.length;u":" />",l&&n&&o[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n")},end:function(t){var r;e.push("",t,">"),n&&o[t]&&e.length>0&&(r=e[e.length-1]).length>0&&"\n"!==r&&e.push("\n")},text:function(t,n){t.length>0&&(e[e.length]=n?t:i(t))},cdata:function(t){e.push("")},comment:function(t){e.push("\x3c!--",t,"--\x3e")},pi:function(t,r){r?e.push("",t," ",i(r),"?>"):e.push("",t,"?>"),n&&e.push("\n")},doctype:function(t){e.push("",n?"\n":"")},reset:function(){e.length=0},getContent:function(){return e.join("").replace(/\n$/,"")}}},tp=function(t,e){void 0===e&&(e=Ai());var n=Qh(t);(t=t||{}).validate=!("validate"in t)||t.validate;return{serialize:function(r){var o=t.validate,i={3:function(t){n.text(t.value,t.raw)},8:function(t){n.comment(t.value)},7:function(t){n.pi(t.name,t.value)},10:function(t){n.doctype(t.value)},4:function(t){n.cdata(t.value)},11:function(t){if(t=t.firstChild)do{a(t)}while(t=t.next)}};n.reset();var a=function(t){var r=i[t.type];if(r)r(t);else{var s=t.name,l=t.shortEnded,u=t.attributes;if(o&&u&&u.length>1){var c=[];c.map={};var f=e.getElementRule(t.name);if(f){for(var d=0,h=f.attributesOrder.length;d'))},kp=function(t){en(t).each((function(e){Ye(e).each((function(n){co(t)&&ho(e)&&co(n)&&vn(e)}))}))},xp=function(t,e,n){return Re(e,t)?(r=function(t,e){for(var n=_(e)?e:L,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=De.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(t,(function(t){return n(t)||je(t,e)})),r.slice(0,-1)):[];var r},Sp=function(t,e){return xp(t,e,L)},Op=function(t,e){return[t].concat(Sp(t,e))},Ep=function(t,e,n){return Nc(t,e,n,up)},Tp=function(t,e){return J(Op(De.fromDom(e.container()),t),co)},Ap=function(t,e,n){return Ep(t,e.dom,n).forall((function(t){return Tp(e,n).fold((function(){return!1===tc(t,n,e.dom)}),(function(r){return!1===tc(t,n,e.dom)&&Re(r,De.fromDom(t.container()))}))}))},Dp=function(t,e,n){return Tp(e,n).fold((function(){return Ep(t,e.dom,n).forall((function(t){return!1===tc(t,n,e.dom)}))}),(function(e){return Ep(t,e.dom,n).isNone()}))},Np=T(Dp,!1),Lp=T(Dp,!0),Ip=T(Ap,!1),jp=T(Ap,!0),Pp=function(t){return cc(t).exists(ho)},Rp=function(t,e,n){var r=Y(Op(De.fromDom(n.container()),e),co),o=at(r).getOr(e);return Ac(t,o.dom,n).filter(Pp)},$p=function(t,e){return cc(e).exists(ho)||Rp(!0,t,e).isSome()},Mp=function(t,e){return function(t){return $.from(t.getNode(!0)).map(De.fromDom)}(e).exists(ho)||Rp(!1,t,e).isSome()},Bp=T(Rp,!1),qp=T(Rp,!0),Fp=function(t){return Al.isTextPosition(t)&&!t.isAtStart()&&!t.isAtEnd()},zp=function(t,e){var n=Y(Op(De.fromDom(e.container()),t),co);return at(n).getOr(t)},Up=function(t,e){return Fp(e)?lp(e):lp(e)||jc(zp(t,e).dom,e).exists(lp)},Hp=function(t,e){return Fp(e)?sp(e):sp(e)||Ic(zp(t,e).dom,e).exists(sp)},Vp=function(t){return cc(t).bind((function(t){return Xr(t,qe)})).exists((function(t){return function(t){return z(["pre","pre-wrap"],t)}(ir(t,"white-space"))}))},Wp=function(t,e){return function(t,e){return jc(t.dom,e).isNone()}(t,e)||function(t,e){return Ic(t.dom,e).isNone()}(t,e)||Np(t,e)||Lp(t,e)||Mp(t,e)||$p(t,e)},Kp=function(t,e){return!Vp(e)&&(Np(t,e)||Ip(t,e)||Mp(t,e)||Up(t,e))},Yp=function(t,e){return!Vp(e)&&(Lp(t,e)||jp(t,e)||$p(t,e)||Hp(t,e))},Xp=function(t,e){return Kp(t,e)||Yp(t,function(t){var e=t.container(),n=t.offset();return Bn(e)&&n0&&n=t.data.length&&Yp(o,Al(t,t.data.length)),s=0===e&&Kp(o,Al(t,0));t.replaceData(e,n,function(t,e,n){return G(t,(function(r,o){return Jc(o)||Zc(o)?r.previousCharIsSpace||""===r.str&&e||r.str.length===t.length-1&&n?{previousCharIsSpace:!1,str:r.str+_o}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}}),{previousCharIsSpace:!1,str:""}).str}(i,s,a))}},nm=function(t,e){var n=t.data.slice(e),r=n.length-Ft(n).length;em(t,e,r)},rm=function(t,e){var n=t.data.slice(0,e),r=n.length-zt(n).length;em(t,e-r,r)},om=function(t,e,n,r){void 0===r&&(r=!0);var o=zt(t.data).length,i=r?t:e,a=r?e:t;return r?i.appendData(a.data):i.insertData(0,a.data),vn(De.fromDom(a)),n&&nm(i,o),i},im=function(t,e){return function(t,e){var n=t.container(),r=t.offset();return!1===Al.isTextPosition(t)&&n===e.parentNode&&r>Al.before(e).offset()}(e,t)?Al(e.container(),e.offset()-1):e},am=function(t){return Vo(t.previousSibling)?$.some((e=t.previousSibling,Bn(e)?Al(e,e.data.length):Al.after(e))):t.previousSibling?Rc(t.previousSibling):$.none();var e},sm=function(t){return Vo(t.nextSibling)?$.some((e=t.nextSibling,Bn(e)?Al(e,0):Al.before(e))):t.nextSibling?Pc(t.nextSibling):$.none();var e},lm=function(t,e){return am(e).orThunk((function(){return sm(e)})).orThunk((function(){return function(t,e){var n=Al.before(e.previousSibling?e.previousSibling:e.parentNode);return jc(t,n).fold((function(){return Ic(t,Al.after(e))}),$.some)}(t,e)}))},um=function(t,e){return sm(e).orThunk((function(){return am(e)})).orThunk((function(){return function(t,e){return Ic(t,Al.after(e)).fold((function(){return jc(t,Al.before(e))}),$.some)}(t,e)}))},cm=function(t,e,n){return function(t,e,n){return t?um(e,n):lm(e,n)}(t,e,n).map(T(im,n))},fm=function(t,e,n){n.fold((function(){t.focus()}),(function(n){t.selection.setRng(n.toRange(),e)}))},dm=function(t,e){return e&&_t(t.schema.getBlockElements(),$e(e))},hm=function(t){if(ei(t)){var e=De.fromHtml('
');return gn(t),pn(t,e),$.some(Al.before(e.dom))}return $.none()},pm=function(t,e,n){var r,o,i,a,s=Ye(t).filter(Fe),l=Xe(t).filter(Fe);return vn(t),(r=s,o=l,i=e,a=function(t,e,r){var o=t.dom,i=e.dom,a=o.data.length;return om(o,i,n),r.container()===i?Al(o,a):r},r.isSome()&&o.isSome()&&i.isSome()?$.some(a(r.getOrDie(),o.getOrDie(),i.getOrDie())):$.none()).orThunk((function(){return n&&(s.each((function(t){return rm(t.dom,t.dom.length)})),l.each((function(t){return nm(t.dom,0)}))),e}))},mm=function(t,e,n,r){void 0===r&&(r=!0);var o,i=cm(e,t.getBody(),n.dom),a=Yr(n,T(dm,t),(o=t.getBody(),function(t){return t.dom===o})),s=pm(n,i,function(t,e){return _t(t.schema.getTextInlineElements(),$e(e))}(t,n));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):a.bind(hm).fold((function(){r&&fm(t,e,s)}),(function(n){r&&fm(t,e,$.some(n))}))},gm=function(t){return Ms(t,"td,th")},vm=function(t,e){return{start:t,end:e}},ym=Sr([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),bm=function(t,e){return Qr(De.fromDom(t),"td,th",e)},_m=function(t){return!je(t.start,t.end)},wm=function(t,e){return Mf(t.start,e).bind((function(n){return Mf(t.end,e).bind((function(t){return e=je(n,t),r=n,e?$.some(r):$.none();var e,r}))}))},Cm=function(t){return function(e){return wm(e,t).map((function(t){return function(t,e,n){return{rng:t,table:e,cells:n}}(e,t,gm(t))}))}},km=function(t,e,n,r){if(n.collapsed||!t.forall(_m))return $.none();if(e.isSameTable){var o=t.bind(Cm(r));return $.some({start:o,end:o})}var i=bm(n.startContainer,r),a=bm(n.endContainer,r),s=i.bind(function(t){return function(e){return Mf(e,t).bind((function(t){return st(gm(t)).map((function(t){return vm(e,t)}))}))}}(r)).bind(Cm(r)),l=a.bind(function(t){return function(e){return Mf(e,t).bind((function(t){return at(gm(t)).map((function(t){return vm(t,e)}))}))}}(r)).bind(Cm(r));return $.some({start:s,end:l})},xm=function(t,e){return Q(t,(function(t){return je(t,e)}))},Sm=function(t){return Gn(xm(t.cells,t.rng.start),xm(t.cells,t.rng.end),(function(e,n){return t.cells.slice(e,n+1)}))},Om=function(t,e,n){return t.exists((function(t){return function(t,e){return!_m(t)&&wm(t,e).exists((function(t){var e=t.dom.rows;return 1===e.length&&1===e[0].cells.length}))}(t,n)&&Ff(t.start,e)}))},Em=function(t,e){var n=e.startTable,r=e.endTable,o=t.cloneRange();return n.each((function(t){return o.setStartAfter(t.dom)})),r.each((function(t){return o.setEndBefore(t.dom)})),o},Tm=function(t,e){var n=function(t){return function(e){return je(t,e)}}(t),r=function(t,e){var n=bm(t.startContainer,e),r=bm(t.endContainer,e);return Gn(n,r,vm)}(e,n),o=function(t,e){var n=function(t){return Mf(De.fromDom(t),e)},r=n(t.startContainer),o=n(t.endContainer),i=r.isSome(),a=o.isSome(),s=Gn(r,o,je).getOr(!1);return{startTable:r,endTable:o,isStartInTable:i,isEndInTable:a,isSameTable:s,isMultiTable:!s&&i&&a}}(e,n);return Om(r,e,n)?r.map((function(t){return ym.singleCellTable(e,t.start)})):o.isMultiTable?function(t,e,n,r){return km(t,e,n,r).bind((function(t){var r=t.start,o=t.end,i=r.bind(Sm).getOr([]),a=o.bind(Sm).getOr([]);if(i.length>0&&a.length>0){var s=Em(n,e);return $.some(ym.multiTable(i,a,s))}return $.none()}))}(r,o,e,n):function(t,e,n,r){return km(t,e,n,r).bind((function(t){var e=t.start,n=t.end;return e.or(n)})).bind((function(t){var r=e.isSameTable,o=Sm(t).getOr([]);if(r&&t.cells.length===o.length)return $.some(ym.fullTable(t.table));if(o.length>0){if(r)return $.some(ym.partialTable(o,$.none()));var i=Em(n,e);return $.some(ym.partialTable(o,$.some(Dt(Dt({},e),{rng:i}))))}return $.none()}))}(r,o,e,n)},Am=function(t){var e;return(8===Me(e=t)||"#comment"===$e(e)?Ye(t):en(t)).bind(Am).orThunk((function(){return $.some(t)}))},Dm=function(t){return V(t,(function(t){rr(t,"contenteditable"),Cp(t)}))},Nm=function(t,e,n,r){var o=n.cloneRange();r?(o.setStart(n.startContainer,n.startOffset),o.setEndAfter(e.dom.lastChild)):(o.setStartBefore(e.dom.firstChild),o.setEnd(n.endContainer,n.endOffset)),Pm(t,o,e,!1)},Lm=function(t){var e=$f(t),n=De.fromDom(t.selection.getNode());Kn(n.dom)&&ei(n)?t.selection.setCursorLocation(n.dom,0):t.selection.collapse(!0),e.length>1&&U(e,(function(t){return je(t,n)}))&&Qn(n,"data-mce-selected","1")},Im=function(t,e,n){var r=t.selection.getRng(),o=n.bind((function(n){var o=n.rng,i=n.isStartInTable,a=function(t,e){return $.from(t.dom.getParent(e,t.dom.isBlock)).map(De.fromDom)}(t,i?o.endContainer:o.startContainer);o.deleteContents(),function(t,e,n){n.each((function(n){e?vn(n):(Cp(n),t.selection.setCursorLocation(n.dom,0))}))}(t,i,a.filter(ei));var s=i?e[0]:e[e.length-1];return Nm(t,s,r,i),ei(s)?$.none():$.some(i?e.slice(1):e.slice(0,-1))})).getOr(e);return Dm(o),Lm(t),!0},jm=function(t,e,n,r){var o=t.selection.getRng(),i=e[0],a=n[n.length-1];Nm(t,i,o,!0),Nm(t,a,o,!1);var s=ei(i)?e:e.slice(1),l=ei(a)?n:n.slice(0,-1);return Dm(s.concat(l)),r.deleteContents(),Lm(t),!0},Pm=function(t,e,n,r){void 0===r&&(r=!0),e.deleteContents();var o,i=Am(n).getOr(n),a=De.fromDom(t.dom.getParent(i.dom,t.dom.isBlock));if(ei(a)&&(Cp(a),r&&t.selection.setCursorLocation(a.dom,0)),!je(n,a)){var s=Xn(Ke(a),n)?[]:Ke(o=a).map(Je).map((function(t){return Y(t,(function(t){return!je(o,t)}))})).getOr([]);V(s.concat(Je(n)),(function(t){je(t,a)||Re(t,a)||!ei(t)||vn(t)}))}return!0},Rm=function(t,e){return mm(t,!1,e),!0},$m=function(t,e,n,r){return Bm(e,r).fold((function(){return function(t,e,n){return Tm(e,n).map((function(e){return e.fold(T(Pm,t),T(Rm,t),T(Im,t),T(jm,t))}))}(t,e,n)}),(function(e){return function(t,e){return qm(t,e)}(t,e)})).getOr(!1)},Mm=function(t,e){return J(Op(e,t),yo)},Bm=function(t,e){return J(Op(e,t),(n="caption",function(t){return qe(t)&&$e(t)===n}));var n},qm=function(t,e){return Cp(e),t.selection.setCursorLocation(e.dom,0),$.some(!0)},Fm=function(t,e,n,r,o){return Dc(n,t.getBody(),o).bind((function(i){return function(t,e,n,r){return Pc(t.dom).bind((function(o){return Rc(t.dom).map((function(t){return e?n.isEqual(o)&&r.isEqual(t):n.isEqual(t)&&r.isEqual(o)}))})).getOr(!0)}(r,n,o,i)?function(t,e){return qm(t,e)}(t,r):function(t,e,n){return Bm(t,De.fromDom(n.getNode())).map((function(t){return!1===je(t,e)}))}(e,r,i)})).or($.some(!0))},zm=function(t,e,n,r){var o=Al.fromRangeStart(t.selection.getRng());return Mm(n,r).bind((function(r){return ei(r)?qm(t,r):function(t,e,n,r,o){return Dc(n,t.getBody(),o).bind((function(t){return Mm(e,De.fromDom(t.getNode())).map((function(t){return!1===je(t,r)}))}))}(t,n,e,r,o)})).getOr(!1)},Um=function(t,e){return t?vp(e):yp(e)},Hm=function(t,e,n){var r=De.fromDom(t.getBody());return Bm(r,n).fold((function(){return zm(t,e,r,n)||function(t,e){var n=Al.fromRangeStart(t.selection.getRng());return Um(e,n)||Ac(e,t.getBody(),n).exists((function(t){return Um(e,t)}))}(t,e)}),(function(n){return function(t,e,n,r){var o=Al.fromRangeStart(t.selection.getRng());return ei(r)?qm(t,r):Fm(t,n,e,r,o)}(t,e,r,n).getOr(!1)}))},Vm=function(t,e){var n=De.fromDom(t.selection.getStart(!0)),r=$f(t);return t.selection.isCollapsed()&&0===r.length?Hm(t,e,n):function(t,e,n){var r=De.fromDom(t.getBody()),o=t.selection.getRng();return 0!==n.length?Im(t,n,$.none()):$m(t,r,o,e)}(t,n,r)},Wm=function(t){var e=Al.fromRangeStart(t),n=Al.fromRangeEnd(t),r=t.commonAncestorContainer;return Ac(!1,r,n).map((function(o){return!tc(e,n,r)&&tc(e,o,r)?function(t,e,n,r){var o=document.createRange();return o.setStart(t,e),o.setEnd(n,r),o}(e.container(),e.offset(),o.container(),o.offset()):t})).getOr(t)},Km=function(t){return t.collapsed?t:Wm(t)},Ym=function(t,e){return t.getBlockElements()[e.name]&&function(t){return t.firstChild&&t.firstChild===t.lastChild}(e)&&function(t){return"br"===t.name||t.value===_o}(e.firstChild)},Xm=function(t,e){var n=e.firstChild,r=e.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),function(t,e){var n=t.getNonEmptyElements();return e&&(e.isEmpty(n)||Ym(t,e))}(t,r)&&(r=r.prev),!(!n||n!==r)&&("ul"===n.name||"ol"===n.name)},Gm=function(t){return t&&t.firstChild&&t.firstChild===t.lastChild&&function(t){return t.data===_o||Un(t)}(t.firstChild)},Zm=function(t){return t.length>0&&(!(e=t[t.length-1]).firstChild||Gm(e))?t.slice(0,-1):t;var e},Jm=function(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null},Qm=function(t,e){var n=Al.after(t),r=xc(e).prev(n);return r?r.toRange():null},tg=function(t,e,n){var r=t.parentNode;return Te.each(e,(function(e){r.insertBefore(e,t)})),function(t,e){var n=Al.before(t),r=xc(e).next(n);return r?r.toRange():null}(t,n)},eg=function(t,e,n,r){var o,i=function(t,e,n){var r=e.serialize(n);return function(t){var e=t.firstChild,n=t.lastChild;return e&&"META"===e.nodeName&&e.parentNode.removeChild(e),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),t}(t.createFragment(r))}(e,t,r),a=Jm(e,n.startContainer),s=Zm((o=i.firstChild,Y(o.childNodes,(function(t){return"LI"===t.nodeName})))),l=e.getRoot(),u=function(t){var r=Al.fromRangeStart(n),o=xc(e.getRoot()),i=1===t?o.prev(r):o.next(r);return!i||Jm(e,i.getNode())!==a};return u(1)?tg(a,s,l):u(2)?function(t,e,n,r){return r.insertAfter(e.reverse(),t),Qm(e[0],n)}(a,s,l,e):function(t,e,n,r){var o=function(t,e){var n=e.cloneRange(),r=e.cloneRange();return n.setStartBefore(t),r.setEndAfter(t),[n.cloneContents(),r.cloneContents()]}(t,r),i=t.parentNode;return i.insertBefore(o[0],t),Te.each(e,(function(e){i.insertBefore(e,t)})),i.insertBefore(o[1],t),i.removeChild(t),Qm(e[e.length-1],n)}(a,s,l,n)},ng=Kn,rg=function(t){var e=t.dom,n=Km(t.selection.getRng());t.selection.setRng(n);var r=e.getParent(n.startContainer,ng);!function(t,e,n){return null!==n&&n===t.getParent(e.endContainer,ng)&&Ff(De.fromDom(n),e)}(e,n,r)?t.getDoc().execCommand("Delete",!1,null):Pm(t,n,De.fromDom(r))},og=function(t,e,n){var r,o,i,a=t.selection,s=t.dom;/^ | $/.test(e)&&(e=function(t,e,n){var r=De.fromDom(t.getRoot());return n=Kp(r,Al.fromRangeStart(e))?n.replace(/^ /," "):n.replace(/^ /," "),Yp(r,Al.fromRangeEnd(e))?n.replace(/( | )(
)?$/," "):n.replace(/ (
)?$/," ")}(s,a.getRng(),e));var l=t.parser,u=n.merge,c=tp({validate:bu(t)},t.schema),f='',d=t.fire("BeforeSetContent",{content:e,format:"html",selection:!0,paste:n.paste});if(d.isDefaultPrevented())t.fire("SetContent",{content:d.content,format:"html",selection:!0,paste:n.paste});else{-1===(e=d.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,f);var h=(o=a.getRng()).startContainer||(o.parentElement?o.parentElement():null),p=t.getBody();h===p&&a.isCollapsed()&&s.isBlock(p.firstChild)&&function(t,e){return e&&!t.schema.getShortEndedElements()[e.nodeName]}(t,p.firstChild)&&s.isEmpty(p.firstChild)&&((o=s.createRng()).setStart(p.firstChild,0),o.setEnd(p.firstChild,0),a.setRng(o)),a.isCollapsed()||rg(t);var m,g={context:(r=a.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},v=l.parse(e,g);if(!0===n.paste&&Xm(t.schema,v)&&function(t,e){return!!Jm(t,e)}(s,r))return o=eg(c,s,a.getRng(),v),a.setRng(o),void t.fire("SetContent",d);if(function(t){for(var e=t;e=e.walk();)1===e.type&&e.attr("data-mce-fragment","1")}(v),"mce_marker"===(i=v.lastChild).attr("id")){var y=i;for(i=i.prev;i;i=i.walk(!0))if(3===i.type||!s.isBlock(i.name)){t.schema.isValidChild(i.parent.name,"span")&&i.parent.insert(y,i,"br"===i.name);break}}if(t._selectionOverrides.showBlockCaretContainer(r),g.invalid){t.selection.setContent(f),r=a.getNode();var _=t.getBody();for(9===r.nodeType?r=i=_:i=r;i!==_;)r=i,i=i.parentNode;e=r===_?_.innerHTML:s.getOuterHTML(r),e=c.serialize(l.parse(e.replace(//i,(function(){return c.serialize(v)})))),r===_?s.setHTML(_,e):s.setOuterHTML(r,e)}else!function(t,e,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(t.dom.createFragment(e),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?t.dom.setHTML(n,e):t.selection.setContent(e)}}(t,e=c.serialize(v),r);!function(t,e){var n=t.schema.getTextInlineElements(),r=t.dom;if(e){var o=t.getBody(),i=Zh(r);Te.each(r.select("*[data-mce-fragment]"),(function(t){if(b(n[t.nodeName.toLowerCase()])&&op(r,t))for(var e=t.parentNode;b(e)&&e!==o&&!ip(r,t,e);e=e.parentNode)if(i.compare(e,t)){r.remove(t,!0);break}}))}}(t,u),function(t,e){var n,r=t.dom,o=t.selection;if(e){o.scrollIntoView(e);var i=td(t.getBody(),e);if("false"===r.getContentEditable(i))return r.remove(e),void o.select(i);var a=r.createRng(),s=e.previousSibling;if(Bn(s)){if(a.setStart(s,s.nodeValue.length),!ke.ie){var l=e.nextSibling;Bn(l)&&(s.appendData(l.data),l.parentNode.removeChild(l))}}else a.setStartBefore(e),a.setEndBefore(e);var u=r.getParent(e,r.isBlock);r.remove(e),u&&r.isEmpty(u)&&(t.$(u).empty(),a.setStart(u,0),a.setEnd(u,0),ng(u)||function(t){return!!t.getAttribute("data-mce-fragment")}(u)||!(n=function(e){var n=Al.fromRangeStart(e);if(n=xc(t.getBody()).next(n))return n.toRange()}(a))?r.add(u,r.create("br",{"data-mce-bogus":"1"})):(a=n,r.remove(u))),o.setRng(a)}}(t,s.get("mce_marker")),m=t.getBody(),Te.each(m.getElementsByTagName("*"),(function(t){t.removeAttribute("data-mce-fragment")})),function(t,e){$.from(t.getParent(e,"td,th")).map(De.fromDom).each(kp)}(s,a.getStart()),t.fire("SetContent",d),t.addVisual()}},ig=function(t,e){e(t),t.firstChild&&ig(t.firstChild,e),t.next&&ig(t.next,e)},ag=function(t,e,n){var r=function(t,e,n){var r={},o={},i=[];for(var a in n.firstChild&&ig(n.firstChild,(function(n){V(t,(function(t){t.name===n.name&&(r[t.name]?r[t.name].nodes.push(n):r[t.name]={filter:t,nodes:[n]})})),V(e,(function(t){"string"==typeof n.attr(t.name)&&(o[t.name]?o[t.name].nodes.push(n):o[t.name]={filter:t,nodes:[n]})}))})),r)_t(r,a)&&i.push(r[a]);for(var s in o)_t(o,s)&&i.push(o[s]);return i}(t,e,n);V(r,(function(t){V(t.filter.callbacks,(function(e){e(t.nodes,t.filter.name,{})}))}))},sg=function(t){return t instanceof Ih},lg=function(t,e,n){t.dom.setHTML(t.getBody(),e),!0!==n&&function(t){_h(t)&&Pc(t.getBody()).each((function(e){var n=e.getNode(),r=Rn(n)?Pc(n).getOr(e):e;t.selection.setRng(r.toRange())}))}(t)},ug=function(t,e,n){var r=function(t,e){return Dt(Dt({format:"html"},t),{set:!0,content:sg(e)?"":e})}(n,e),o=n.no_events?r:t.fire("BeforeSetContent",r);return sg(e)||(e=o.content),$.from(t.getBody()).fold(S(e),(function(n){return sg(e)?function(t,e,n,r){ag(t.parser.getNodeFilters(),t.parser.getAttributeFilters(),n);var o=tp({validate:t.validate},t.schema).serialize(n);return r.content=bo(De.fromDom(e))?o:Te.trim(o),lg(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r),n}(t,n,e,o):function(t,e,n,r){if(0===n.length||/^\s+$/.test(n)){var o='
';"TABLE"===e.nodeName?n="| "+o+" |
":/^(UL|OL)$/.test(e.nodeName)&&(n=""+o+"");var i=nu(t);i&&t.schema.isValidChild(e.nodeName.toLowerCase(),i.toLowerCase())?(n=o,n=t.dom.createHTML(i,ru(t),n)):n||(n='
'),lg(t,n,r.no_selection),t.fire("SetContent",r)}else"raw"!==r.format&&(n=tp({validate:t.validate},t.schema).serialize(t.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=bo(De.fromDom(e))?n:Te.trim(n),lg(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r);return r.content}(t,n,e,o)}))},cg=function(t,e){return function(t,e){var n=t.dom;return n.parentNode?Gr(De.fromDom(n.parentNode),(function(n){return!je(t,n)&&e(n)})):$.none()}(t,e).isSome()},fg=function(t){return _(t)?t:L},dg=function(t,e,n){var r=e(t),o=fg(n);return r.orThunk((function(){return o(t)?$.none():function(t,e,n){for(var r=t.dom,o=fg(n);r.parentNode;){r=r.parentNode;var i=De.fromDom(r),a=e(i);if(a.isSome())return a;if(o(i))break}return $.none()}(t,e,o)}))},hg=lf,pg=function(t,e,n){var r=t.formatter.get(n);if(r)for(var o=0;o1&&"%"===t.charAt(0)};return U(["styles","attributes"],(function(n){return bt(t,n).exists((function(t){var n=p(t)?t:yt(t);return U(n,e)}))}))}))}(t,r);return t.formatter.matchNode(e,r,{},o)?n.concat([r]):n}),[])},Cg=wo,kg="_mce_caret",xg=function(t){return function(t){for(var e=[];t;){if(3===t.nodeType&&t.nodeValue!==Cg||t.childNodes.length>1)return[];1===t.nodeType&&e.push(t),t=t.firstChild}return e}(t).length>0},Sg=function(t){if(t){var e=new so(t,t);for(t=e.current();t;t=e.next())if(Bn(t))return t}return null},Og=function(t){var e=De.fromTag("span");return tr(e,{id:kg,"data-mce-bogus":"1","data-mce-type":"format-caret"}),t&&pn(e,De.fromText(Cg)),e},Eg=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(xg(e))mm(t,!1,De.fromDom(e),n);else{var i=o.getRng(),a=r.getParent(e,r.isBlock),s=i.startContainer,l=i.startOffset,u=i.endContainer,c=i.endOffset,f=function(t){var e=Sg(t);return e&&e.nodeValue.charAt(0)===Cg&&e.deleteData(0,1),e}(e);r.remove(e,!0),s===f&&l>0&&i.setStart(f,l-1),u===f&&c>0&&i.setEnd(f,c-1),a&&r.isEmpty(a)&&Cp(De.fromDom(a)),o.setRng(i)}},Tg=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(e)Eg(t,e,n);else if(!(e=Bc(t.getBody(),o.getStart())))for(;e=r.get(kg);)Eg(t,e,!1)},Ag=function(t,e){return t.appendChild(e),e},Dg=function(t,e){var n=X(t,(function(t,e){return Ag(t,e.cloneNode(!1))}),e);return Ag(n,n.ownerDocument.createTextNode(Cg))},Ng=function(t,e,n,r){var o,i,a,s=t.dom,l=t.selection,u=[],c=l.getRng(),f=c.startContainer,d=c.startOffset;for(i=f,3===f.nodeType&&(d!==f.nodeValue.length&&(o=!0),i=i.parentNode);i;){if(yg(t,i,e,n,r)){a=i;break}i.nextSibling&&(o=!0),u.push(i),i=i.parentNode}if(a)if(o){var h=l.getBookmark();c.collapse(!0);var p=Lf(t,c,t.formatter.get(e),!0);p=wd(p),t.formatter.remove(e,n,p,r),l.moveToBookmark(h)}else{var m=Bc(t.getBody(),a),g=Og(!1).dom;!function(t,e,n){var r=t.dom,o=r.getParent(n,T(rf,t));o&&r.isEmpty(o)?n.parentNode.replaceChild(e,n):(wp(De.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(e,n):r.insertAfter(e,n))}(t,g,null!==m?m:a);var v=function(t,e,n,r,o,i){var a=t.formatter,s=t.dom,l=Y(ct(a.get()),(function(t){return t!==r&&!$t(t,"removeformat")})),u=wg(t,n,l);if(Y(u,(function(e){return!hf(t,e,r)})).length>0){var c=n.cloneNode(!1);return s.add(e,c),a.remove(r,o,c,i),s.remove(c),$.some(c)}return $.none()}(t,g,a,e,n,r),y=Dg(u.concat(v.toArray()),g);Eg(t,m,!1),l.setCursorLocation(y,1),s.isEmpty(a)&&s.remove(a)}},Lg=function(t){t.on("mouseup keydown",(function(e){!function(t,e){var n=t.selection,r=t.getBody();Tg(t,null,!1),8!==e&&46!==e||!n.isCollapsed()||n.getStart().innerHTML!==Cg||Tg(t,Bc(r,n.getStart())),37!==e&&39!==e||Tg(t,Bc(r,n.getStart()))}(t,e.keyCode)}))},Ig=function(t,e){var n=t.schema.getTextInlineElements();return _t(n,$e(e))&&!Mc(e.dom)&&!Pn(e.dom)},jg={},Pg=St,Rg=kt;!function(t,e){jg[t]||(jg[t]=[]),jg[t].push(e)}("pre",(function(t){var e,n=t.selection.getRng(),r=Ln(["pre"]);n.collapsed||(e=t.selection.getSelectedBlocks(),Rg(Pg(Pg(e,r),(function(t){return r(t.previousSibling)&&-1!==Ot(e,t.previousSibling)})),(function(t){var e,n;e=t.previousSibling,us(n=t).remove(),us(e).append("
").append(n.childNodes)})))}));var $g=Te.each,Mg=function(t){return Nn(t)&&!Gc(t)&&!Mc(t)&&!Pn(t)},Bg=function(t,e){for(var n=t;n;n=n[e]){if(Bn(n)&&Ut(n.data))return t;if(Nn(n)&&!Gc(n))return n}return t},qg=function(t,e,n){var r=Zh(t);if(e&&n&&(e=Bg(e,"previousSibling"),n=Bg(n,"nextSibling"),r.compare(e,n))){for(var o=e.nextSibling;o&&o!==n;){var i=o;o=o.nextSibling,e.appendChild(i)}return t.remove(n),Te.each(Te.grep(n.childNodes),(function(t){e.appendChild(t)})),e}return n},Fg=function(t,e,n,r){if(r&&!1!==e.merge_siblings){var o=qg(t,nf(r),r);qg(t,o,nf(o,!0))}},zg=function(t,e,n){$g(t.childNodes,(function(t){Mg(t)&&(e(t)&&n(t),t.hasChildNodes()&&zg(t,e,n))}))},Ug=function(t,e){return function(n){return!(!n||!cf(t,n,e))}},Hg=function(t,e,n){return function(r){t.setStyle(r,e,n),""===r.getAttribute("style")&&r.removeAttribute("style"),function(t,e){"SPAN"===e.nodeName&&0===t.getAttribs(e).length&&t.remove(e,!0)}(t,r)}},Vg=Sr([{keep:[]},{rename:["name"]},{removed:[]}]),Wg=/^(src|href|style)$/,Kg=Te.each,Yg=lf,Xg=function(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)},Gg=function(t,e,n){var r=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"];if(Nn(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o]}return Bn(r)&&n&&o>=r.nodeValue.length&&(r=new so(r,t.getBody()).next()||r),Bn(r)&&!n&&0===o&&(r=new so(r,t.getBody()).prev()||r),r},Zg=function(t,e){var n=e?"firstChild":"lastChild";if(function(t){return/^(TR|TH|TD)$/.test(t.nodeName)}(t)&&t[n]){var r=t[n];return"TR"===t.nodeName&&r[n]||r}return t},Jg=function(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o},Qg=function(t,e,n,r,o){var i=De.fromDom(e),a=De.fromDom(t.create(r,o)),s=n?Ze(i):Ge(i);return mn(a,s),n?(fn(i,a),hn(a,i)):(dn(i,a),pn(a,i)),a.dom},tv=function(t,e,n,r){var o=nf(e,n,r);return y(o)||"BR"===o.nodeName||t.isBlock(o)},ev=function(t,e,n){var r,o=e.parentNode,i=t.dom,a=nu(t);pf(n)&&(a?o===i.getRoot()&&(n.list_block&&Yg(e,n.list_block)||V(lt(e.childNodes),(function(e){of(t,a,e.nodeName.toLowerCase())?r?r.appendChild(e):(r=Jg(i,e,a),i.setAttribs(r,t.settings.forced_root_block_attrs)):r=null}))):i.isBlock(e)&&!i.isBlock(o)&&(tv(i,e,!1)||tv(i,e.firstChild,!0,!0)||e.insertBefore(i.create("br"),e.firstChild),tv(i,e,!0)||tv(i,e.lastChild,!1,!0)||e.appendChild(i.create("br")))),function(t){return mf(t)&&gf(t)&&Xn(bt(t,"mixed"),!0)}(n)&&!Yg(n.inline,e)||i.remove(e,!0)},nv=function(t,e,n,r,o){var i,a=t.dom;if(!function(t,e,n){return!(!gf(n)||!Yg(e,n.inline))||!(!pf(n)||!Yg(e,n.block))||(mf(n)?Nn(e)&&t.is(e,n.selector):void 0)}(a,r,e)&&!function(t,e){return e.links&&"A"===t.nodeName}(r,e))return Vg.keep();var s=r;if(gf(e)&&"all"===e.remove&&p(e.preserve_attributes)){var l=Y(a.getAttribs(s),(function(t){return z(e.preserve_attributes,t.name.toLowerCase())}));if(a.removeAllAttribs(s),V(l,(function(t){return a.setAttrib(s,t.name,t.value)})),l.length>0)return Vg.rename("span")}if("all"!==e.remove){Kg(e.styles,(function(t,r){t=uf(a,sf(t,n),r+""),w(r)&&(r=t,o=null),(e.remove_similar||!o||Yg(cf(a,o,r),t))&&a.setStyle(s,r,""),i=!0})),i&&""===a.getAttrib(s,"style")&&(s.removeAttribute("style"),s.removeAttribute("data-mce-style")),Kg(e.attributes,(function(t,r){var i;if(t=sf(t,n),w(r)&&(r=t,o=null),e.remove_similar||!o||Yg(a.getAttrib(o,r),t)){if("class"===r&&(t=a.getAttrib(s,r))&&(i="",V(t.split(/\s+/),(function(t){/mce\-\w+/.test(t)&&(i+=(i?" ":"")+t)})),i))return void a.setAttrib(s,r,i);if(Wg.test(r)&&s.removeAttribute("data-mce-"+r),"style"===r&&Ln(["li"])(s)&&"none"===a.getStyle(s,"list-style-type"))return s.removeAttribute(r),void a.setStyle(s,"list-style-type","none");"class"===r&&s.removeAttribute("className"),s.removeAttribute(r)}})),Kg(e.classes,(function(t){t=sf(t,n),o&&!a.hasClass(o,t)||a.removeClass(s,t)}));for(var u=a.getAttribs(s),c=0;c1)&&r.isBlock(a)||0!==s?(gf(i)||pf(i)&&i.wrapper)&&(i.exact||1!==s||(a=function(t){var e=J(t.childNodes,uv).filter((function(t){return gg(r,t,i)}));return e.map((function(e){var n=r.clone(e,!1);return u(n),r.replace(n,t,!0),r.remove(e,!0),n})).getOr(t)}(a)),sv(t,o,n,a),function(t,e,n,r,o){yg(t,o.parentNode,n,r)&&rv(t,e,r,o)||e.merge_with_parents&&t.dom.getParent(o.parentNode,(function(i){if(yg(t,i,n,r))return rv(t,e,r,o),!0}))}(t,i,e,n,a),function(t,e,n,r){e.styles&&e.styles.backgroundColor&&zg(r,Ug(t,"fontSize"),Hg(t,"backgroundColor",sf(e.styles.backgroundColor,n)))}(r,i,n,a),function(t,e,n,r){var o=function(e){if(1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType){var n=ff(t,e.parentNode);t.getStyle(e,"color")&&n?t.setStyle(e,"text-decoration",n):t.getStyle(e,"text-decoration")===n&&t.setStyle(e,"text-decoration",null)}};e.styles&&(e.styles.color||e.styles.textDecoration)&&(Te.walk(r,o,"childNodes"),o(r))}(r,i,0,a),function(t,e,n,r){!gf(e)||"sub"!==e.inline&&"sup"!==e.inline||(zg(r,Ug(t,"fontSize"),Hg(t,"fontSize","")),t.remove(t.select("sup"===e.inline?"sub":"sup",r),!0))}(r,i,0,a),Fg(r,i,0,a)):r.remove(a,!0)}))};if("false"!==s.getContentEditable(l.getNode())){if(i){if(r)if(tf(r)){if(!c(o,r)){var p=s.createRng();p.setStartBefore(r),p.setEndAfter(r),h(s,Lf(t,p,o),!0)}}else h(s,r,!0);else if(a&&gf(i)&&!$f(t).length)!function(t,e,n){var r,o,i=t.selection,a=i.getRng(),s=a.startOffset,l=a.startContainer.nodeValue;(r=Bc(t.getBody(),i.getStart()))&&(o=Sg(r));var u,c,f=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(l&&s>0&&st?e.cells.length:t}),0)},xv=function(t,e){for(var n=t.rows,r=0;r0?vv([o]):o;var n,r,o},Iv=function(t,e){return(n=t,r=e[0],Zr(r,"table",T(je,n))).bind((function(t){var n=e[0],r=e[e.length-1],o=Ov(t);return Tv(o,n,r).map((function(t){return vv([Ev(t)])}))})).getOrThunk(Nv);var n,r},jv=function(t,e){var n=Rf(e,t);return n.length>0?Iv(t,n):function(t,e){return e.length>0&&e[0].collapsed?Nv():Lv(t,e[0])}(t,e)},Pv=function(t,e){return e>=0&&ei-o?(a.push([2,n[c]]),++c):(a.push([1,r[f]]),++f);else{s(t,l.start,o,l.start-l.diag,a);for(var d=l.start;d=t&&m>=o&&n[p]===r[m];)a[h]=p--,m--;if(g%2==0&&-f<=d&&d<=f&&a[h]<=i[h+g])return l(a[h],d+t-o,e,s)}}},c=[],s(0,n.length,0,r.length,c),c),e),e},Fv=Lt((function(){return document.implementation.createHTMLDocument("undo")})),zv=function(t){var e,n=(e=t.getBody(),Y(H(lt(e.childNodes),Mv),(function(t){return t.length>0}))),r=tt(n,(function(e){var n=Kh(t.serializer,e);return n.length>0?[n]:[]})),o=r.join("");return-1!==o.indexOf("")?function(t){return{type:"fragmented",fragments:t,content:"",bookmark:null,beforeBookmark:null}}(r):function(t){return{type:"complete",fragments:null,content:t,bookmark:null,beforeBookmark:null}}(o)},Uv=function(t,e,n){var r=n?e.beforeBookmark:e.bookmark;"fragmented"===e.type?qv(e.fragments,t.getBody()):t.setContent(e.content,{format:"raw",no_selection:!b(r)||!qc(r)||!r.isFakeCaret}),t.selection.moveToBookmark(r)},Hv=function(t){return"fragmented"===t.type?t.fragments.join(""):t.content},Vv=function(t){var e=De.fromTag("body",Fv());return Ys(e,Hv(t)),V(Ms(e,"*[data-mce-bogus]"),yn),e.dom.innerHTML},Wv=function(t,e){return!(!t||!e)&&(!!function(t,e){return Hv(t)===Hv(e)}(t,e)||function(t,e){return Vv(t)===Vv(e)}(t,e))},Kv=function(t){return 0===t.get()},Yv=function(t,e,n){Kv(n)&&(t.typing=e)},Xv=function(t,e){t.typing&&(Yv(t,!1,e),t.add())},Gv=function(t){return{undoManager:{beforeChange:function(e,n){return function(t,e,n){Kv(e)&&n.set(Jl(t.selection))}(t,e,n)},add:function(e,n,r,o,i,a){return function(t,e,n,r,o,i,a){var s=zv(t);if(i=i||{},i=Te.extend(i,s),!1===Kv(r)||t.removed)return null;var l=e.data[n.get()];if(t.fire("BeforeAddUndo",{level:i,lastLevel:l,originalEvent:a}).isDefaultPrevented())return null;if(l&&Wv(l,i))return null;e.data[n.get()]&&o.get().each((function(t){e.data[n.get()].beforeBookmark=t}));var u=function(t){return t.getParam("custom_undo_redo_levels",0,"number")}(t);if(u&&e.data.length>u){for(var c=0;c0?(t.setDirty(!0),t.fire("AddUndo",f),t.fire("change",f)):t.fire("AddUndo",f),i}(t,e,n,r,o,i,a)},undo:function(e,n,r){return function(t,e,n,r){var o;return e.typing&&(e.add(),e.typing=!1,Yv(e,!1,n)),r.get()>0&&(r.set(r.get()-1),o=e.data[r.get()],Uv(t,o,!0),t.setDirty(!0),t.fire("Undo",{level:o})),o}(t,e,n,r)},redo:function(e,n){return function(t,e,n){var r;return e.get()0||e.typing&&e.data[0]&&!Wv(zv(t),e.data[0])}(t,e,n)},hasRedo:function(t,e){return function(t,e){return e.get()=0;a--){var s=n[a];if(!mf(s)||b(s.defaultBlock))return!0;for(var l=i.length-1;l>=0;l--)if(r.is(i[l],s.selector))return!0}return!1}(t,e)},closest:function(e){return _g(t,e)},apply:function(e,n,r){return cv(t,e,n,r)},remove:function(e,n,r,o){return iv(t,e,n,r,o)},toggle:function(e,n,r){return function(t,e,n,r){var o=t.formatter.get(e);!bg(t,e,n,r)||"toggle"in o[0]&&!o[0].toggle?cv(t,e,n,r):iv(t,e,n,r)}(t,e,n,r)},formatChanged:function(e,n,r,o,i){return gv(t,e,n,r,o,i)}},editor:{getContent:function(e,n){return function(t,e,n){return $.from(t.getBody()).fold(S("tree"===e.format?new Ih("body",11):""),(function(r){return Xh(t,e,n,r)}))}(t,e,n)},setContent:function(e,n){return ug(t,e,n)},insertContent:function(e,n){return og(t,e,n)},addVisual:function(e){return function(t,e){var n=t.dom,r=b(e)?e:t.getBody();v(t.hasVisual)&&(t.hasVisual=function(t){return t.getParam("visual",!0,"boolean")}(t)),V(n.select("table,a",r),(function(e){switch(e.nodeName){case"TABLE":var r=function(t){return t.getParam("visual_table_class","mce-item-table","string")}(t),o=n.getAttrib(e,"border");o&&"0"!==o||!t.hasVisual?n.removeClass(e,r):n.addClass(e,r);break;case"A":if(!n.getAttrib(e,"href")){var i=n.getAttrib(e,"name")||e.id,a=function(t){return t.getParam("visual_anchor_class","mce-item-anchor","string")}(t);i&&t.hasVisual?n.addClass(e,a):n.removeClass(e,a)}}})),t.fire("VisualAid",{element:e,hasVisual:t.hasVisual})}(t,e)}},selection:{getContent:function(e,n){return $v(t,e,n)}},raw:{getModel:function(){return $.none()}}}},Zv=function(t){return _t(t.plugins,"rtc")},Jv=function(t){var e=t;return function(t){return bt(t.plugins,"rtc").bind((function(t){return $.from(t.setup)}))}(t).fold((function(){return e.rtcInstance=Gv(t),$.none()}),(function(t){return e.rtcInstance=function(){var t=S(null),e=S("");return{undoManager:{beforeChange:C,add:t,undo:t,redo:t,clear:C,reset:C,hasUndo:L,hasRedo:L,transact:t,ignore:C,extra:C},formatter:{match:L,matchAll:S([]),matchNode:S(void 0),canApply:L,closest:e,apply:C,remove:C,toggle:C,formatChanged:S({unbind:C})},editor:{getContent:e,setContent:e,insertContent:C,addVisual:C},selection:{getContent:e},raw:{getModel:S($.none())}}}(),$.some((function(){return t().then((function(t){return e.rtcInstance=function(t){var e=function(t){return h(t)?t:{}},n=t.undoManager,r=t.formatter,o=t.editor,i=t.selection,a=t.raw;return{undoManager:{beforeChange:n.beforeChange,add:n.add,undo:n.undo,redo:n.redo,clear:n.clear,reset:n.reset,hasUndo:n.hasUndo,hasRedo:n.hasRedo,transact:function(t,e,r){return n.transact(r)},ignore:function(t,e){return n.ignore(e)},extra:function(t,e,r,o){return n.extra(r,o)}},formatter:{match:function(t,n,o,i){return r.match(t,e(n),i)},matchAll:r.matchAll,matchNode:r.matchNode,canApply:function(t){return r.canApply(t)},closest:function(t){return r.closest(t)},apply:function(t,n,o){return r.apply(t,e(n))},remove:function(t,n,o,i){return r.remove(t,e(n))},toggle:function(t,n,o){return r.toggle(t,e(n))},formatChanged:function(t,e,n,o,i){return r.formatChanged(e,n,o,i)}},editor:{getContent:function(t,e){return o.getContent(t)},setContent:function(t,e){return o.setContent(t,e)},insertContent:function(t,e){return o.insertContent(t)},addVisual:o.addVisual},selection:{getContent:function(t,e){return i.getContent(e)}},raw:{getModel:function(){return $.some(a.getRawModel())}}}}(t),t.rtc.isRemote}))}))}))},Qv=function(t){return t.rtcInstance?t.rtcInstance:Gv(t)},ty=function(t){var e=t.rtcInstance;if(e)return e;throw new Error("Failed to get RTC instance not yet initialized.")},ey=function(t,e){return void 0===e&&(e={}),function(t,e,n){return ty(t).selection.getContent(e,n)}(t,e.format?e.format:"html",e)},ny=function(t){return 0===t.dom.length?(vn(t),$.none()):$.some(t)},ry=function(t,e,n,r){t.bind((function(t){return(r?rm:nm)(t.dom,r?t.dom.length:0),e.filter(Fe).map((function(e){return function(t,e,n,r){var o=t.dom,i=e.dom,a=r?o.length:i.length;r?(om(o,i,!1,!r),n.setStart(i,a)):(om(i,o,!1,!r),n.setEnd(i,a))}(t,e,n,r)}))})).orThunk((function(){var t=function(t,e){return t.filter((function(t){return Qf.isBookmarkNode(t.dom)})).bind(e?Xe:Ye)}(e,r).or(e).filter(Fe);return t.map((function(t){return function(t,e){Ke(t).each((function(n){var r=t.dom;e&&Kp(n,Al(r,0))?nm(r,0):!e&&Yp(n,Al(r,r.length))&&rm(r,r.length)}))}(t,r)}))}))},oy=function(t,e,n){void 0===n&&(n={});var r=function(t,e){return Dt(Dt({format:"html"},t),{set:!0,selection:!0,content:e})}(n,e),o=r;if(!r.no_events){var i=t.fire("BeforeSetContent",r);if(i.isDefaultPrevented())return void t.fire("SetContent",i);o=i}o.content=function(t,e){if("raw"!==e.format){var n=t.selection.getRng(),r=t.dom.getParent(n.commonAncestorContainer,t.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=t.parser.parse(e.content,Dt(Dt({isRootContent:!0,forced_root_block:!1},o),e));return tp({validate:t.validate},t.schema).serialize(i)}return e.content}(t,o);var a=t.selection.getRng();!function(t,e){var n=$.from(e.firstChild).map(De.fromDom),r=$.from(e.lastChild).map(De.fromDom);t.deleteContents(),t.insertNode(e);var o=n.bind(Ye).filter(Fe).bind(ny),i=r.bind(Xe).filter(Fe).bind(ny);ry(o,n,t,!0),ry(i,r,t,!1),t.collapse(!1)}(a,a.createContextualFragment(o.content)),t.selection.setRng(a),Hd(t,a),o.no_events||t.fire("SetContent",o)},iy=function(t,e,n){if(t&&_t(t,e)){var r=Y(t[e],(function(t){return t!==n}));0===r.length?delete t[e]:t[e]=r}};var ay,sy,ly=function(t){return!!t.select},uy=function(t){return!(!t||!t.ownerDocument)&&Re(De.fromDom(t.ownerDocument),De.fromDom(t))},cy=function(t,e,n,r){var o,i,a=function(t,e){var n,r,o=function(e,n){return J(n,(function(n){return t.is(n,e)}))},i=function(e){return t.getParents(e,null,t.getRoot())};return{selectorChangedWithUnbind:function(t,a){return n||(n={},r={},e.on("NodeChange",(function(t){var e=t.element,a=i(e),s={};Te.each(n,(function(t,e){o(e,a).each((function(n){r[e]||(V(t,(function(t){t(!0,{node:n,selector:e,parents:a})})),r[e]=t),s[e]=t}))})),Te.each(r,(function(t,n){s[n]||(delete r[n],Te.each(t,(function(t){t(!1,{node:e,selector:n,parents:a})})))}))}))),n[t]||(n[t]=[]),n[t].push(a),o(t,i(e.selection.getStart())).each((function(){r[t]=n[t]})),{unbind:function(){iy(n,t,a),iy(r,t,a)}}}}}(t,r).selectorChangedWithUnbind,s=function(t,e){return oy(r,t,e)},l=function(t){var e=c();e.collapse(!!t),f(e)},u=function(){return e.getSelection?e.getSelection():e.document.selection},c=function(){var n,a,s,l=function(t,e,n){try{return e.compareBoundaryPoints(t,n)}catch(t){return-1}},c=e.document;if(void 0!==r.bookmark&&!1===_h(r)){var f=lh(r);if(f.isSome())return f.map((function(t){return Th(r,[t])[0]})).getOr(c.createRange())}try{(n=u())&&!Dn(n.anchorNode)&&(a=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():c.createRange(),a=Th(r,[a])[0])}catch(t){}return a||(a=c.createRange?c.createRange():c.body.createTextRange()),a.setStart&&9===a.startContainer.nodeType&&a.collapsed&&(s=t.getRoot(),a.setStart(s,0),a.setEnd(s,0)),o&&i&&(0===l(a.START_TO_START,a,o)&&0===l(a.END_TO_END,a,o)?a=i:(o=null,i=null)),a},f=function(t,e){var n;if(function(t){return!!t&&(!!ly(t)||uy(t.startContainer)&&uy(t.endContainer))}(t)){var a=ly(t)?t:null;if(a){i=null;try{a.select()}catch(t){}}else{var s=u();if(t=r.fire("SetSelectionRange",{range:t,forward:e}).range,s){i=t;try{s.removeAllRanges(),s.addRange(t)}catch(t){}!1===e&&s.extend&&(s.collapse(t.endContainer,t.endOffset),s.extend(t.startContainer,t.startOffset)),o=s.rangeCount>0?s.getRangeAt(0):null}t.collapsed||t.startContainer!==t.endContainer||!s.setBaseAndExtent||ke.ie||t.endOffset-t.startOffset<2&&t.startContainer.hasChildNodes()&&(n=t.startContainer.childNodes[t.startOffset])&&"IMG"===n.tagName&&(s.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset),s.anchorNode===t.startContainer&&s.focusNode===t.endContainer||s.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:t,forward:e})}}},d=function(){var e=u(),n=null==e?void 0:e.anchorNode,r=null==e?void 0:e.focusNode;if(!e||!n||!r||Dn(n)||Dn(r))return!0;var o=t.createRng();o.setStart(n,e.anchorOffset),o.collapse(!0);var i=t.createRng();return i.setStart(r,e.focusOffset),i.collapse(!0),o.compareBoundaryPoints(o.START_TO_START,i)<=0},h={bookmarkManager:null,controlSelection:null,dom:t,win:e,serializer:n,editor:r,collapse:l,setCursorLocation:function(e,n){var o=t.createRng();b(e)&&b(n)?(o.setStart(e,n),o.setEnd(e,n),f(o),l(!1)):(zf(t,o,r.getBody(),!0),f(o))},getContent:function(t){return ey(r,t)},setContent:s,getBookmark:function(t,e){return p.getBookmark(t,e)},moveToBookmark:function(t){return p.moveToBookmark(t)},select:function(e,n){return function(t,e,n){return $.from(e).map((function(e){var r=t.nodeIndex(e),o=t.createRng();return o.setStart(e.parentNode,r),o.setEnd(e.parentNode,r+1),n&&(zf(t,o,e,!0),zf(t,o,e,!1)),o}))}(t,e,n).each(f),e},isCollapsed:function(){var t=c(),e=u();return!(!t||t.item)&&(t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!e||t.collapsed)},isForward:d,setNode:function(e){return s(t.getOuterHTML(e)),e},getNode:function(){return function(t,e){var n,r,o;if(!e)return t;r=e.startContainer,o=e.endContainer;var i=e.startOffset,a=e.endOffset;return n=e.commonAncestorContainer,!e.collapsed&&(r===o&&a-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?Eh(r.nextSibling,!0):r.parentNode,o=0===a?Eh(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n}(r.getBody(),c())},getSel:u,setRng:f,getRng:c,getStart:function(t){return Sh(r.getBody(),c(),t)},getEnd:function(t){return Oh(r.getBody(),c(),t)},getSelectedBlocks:function(e,n){return function(t,e,n,r){var o,i=[],a=t.getRoot();if(n=t.getParent(n||Sh(a,e,e.collapsed),t.isBlock),r=t.getParent(r||Oh(a,e,e.collapsed),t.isBlock),n&&n!==a&&i.push(n),n&&r&&n!==r){o=n;for(var s=new so(n,a);(o=s.next())&&o!==r;)t.isBlock(o)&&i.push(o)}return r&&n!==r&&r!==a&&i.push(r),i}(t,c(),e,n)},normalize:function(){var e=c(),n=u();if(!(jf(n).length>1)&&Uf(r)){var o=bd(t,e);return o.each((function(t){f(t,d())})),o.getOr(e)}return e},selectorChanged:function(t,e){return a(t,e),h},selectorChangedWithUnbind:a,getScrollContainer:function(){for(var e,n=t.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){e=n;break}n=n.parentNode}return e},scrollIntoView:function(t,e){b(t)?function(t,e,n){(t.inline?Fd:Ud)(t,e,n)}(r,t,e):Hd(r,c(),e)},placeCaretAt:function(t,e){return f(ud(t,e,r.getDoc()))},getBoundingClientRect:function(){var t=c();return t.collapsed?Al.fromRangeStart(t).getClientRects()[0]:t.getBoundingClientRect()},destroy:function(){e=o=i=null,m.destroy()}},p=Qf(h),m=sd(h,r);return h.bookmarkManager=p,h.controlSelection=m,h},fy=function(t,e,n){t.addNodeFilter("font",(function(t){V(t,(function(t){var r=e.parse(t.attr("style")),o=t.attr("color"),i=t.attr("face"),a=t.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),a&&(r["font-size"]=n[parseInt(t.attr("size"),10)-1]),t.name="span",t.attr("style",e.serialize(r)),function(t,e){V(e,(function(e){t.attr(e,null)}))}(t,["color","face","size"])}))}))},dy=function(t,e){var n=Ni();e.convert_fonts_to_spans&&fy(t,n,Te.explode(e.font_size_legacy_values)),function(t,e){t.addNodeFilter("strike",(function(t){V(t,(function(t){var n=e.parse(t.attr("style"));n["text-decoration"]="line-through",t.name="span",t.attr("style",e.serialize(n))}))}))}(t,n)},hy=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},py=function(t,e){var n;try{n=atob(e)}catch(t){return $.none()}for(var r=new Uint8Array(n.length),o=0;o0)return void(r.value=o);var i=r.next;if(i){if(3===i.type&&i.value.length){r=r.prev;continue}if(!n[i.name]&&"script"!==i.name&&"style"!==i.name){r=r.prev;continue}}var a=r.prev;r.remove(),r=a}},N=Wh({validate:w,document:t.document,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_script_urls:t.allow_script_urls,allow_conditional_comments:t.allow_conditional_comments,preserve_cdata:t.preserve_cdata,self_closing_elements:function(t){var e={};for(var n in t)"li"!==n&&"p"!==n&&(e[n]=t[n]);return e}(e.getSelfClosingElements()),cdata:function(t){g.append(A("#cdata",4)).value=t},text:function(t,e){var n;T||(t=t.replace(O," "),function(t,e){return t&&(_t(e,t.name)||"br"===t.name)}(g.lastChild,y)&&(t=t.replace(x,""))),0!==t.length&&((n=A("#text",3)).raw=!!e,g.append(n).value=t)},comment:function(t){g.append(A("#comment",8)).value=t},pi:function(t,e){g.append(A(t,7)).value=e,D(g)},doctype:function(t){g.append(A("#doctype",10)).value=t,D(g)},start:function(t,n,o){var a=w?e.getElementRule(t):{};if(a){var s=A(a.outputName||t,1);s.attributes=n,s.shortEnded=o,g.append(s);var l=_[g.name];l&&_[s.name]&&!l[s.name]&&v.push(s);for(var u=r.length;u--;){var c=r[u].name;c in n.map&&((p=i[c])?p.push(s):i[c]=[s])}y[t]&&D(s),o||(g=s),!T&&k[t]&&(T=!0)}},end:function(n){var r,o,i,a,s=w?e.getElementRule(n):{};if(s){if(y[n]&&!T){if((r=g.firstChild)&&3===r.type)if((o=r.value.replace(x,"")).length>0)r.value=o,r=r.next;else for(i=r.next,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.next,(0===o.length||E.test(o))&&(r.remove(),r=i),r=i;if((r=g.lastChild)&&3===r.type)if((o=r.value.replace(S,"")).length>0)r.value=o,r=r.prev;else for(i=r.prev,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.prev,(0===o.length||E.test(o))&&(r.remove(),r=i),r=i}if(T&&k[n]&&(T=!1),s.removeEmpty&&Cy(e,b,k,g))return a=g.parent,y[g.name]?g.empty().remove():g.unwrap(),void(g=a);s.paddEmpty&&(function(t){return wy(t,"#text")&&t.firstChild.value===_o}(g)||Cy(e,b,k,g))&&_y(t,l,y,g),g=g.parent}}},e),L=g=new Ih(l.context||t.root_name,11);if(N.parse(s,l.format),w&&v.length&&(l.context?l.invalid=!0:function(t){for(var n=xy("tr,td,th,tbody,thead,tfoot,table"),r=e.getNonEmptyElements(),o=e.getWhiteSpaceElements(),i=e.getTextBlockElements(),s=e.getSpecialElements(),l=function(t,n){if(void 0===n&&(n=t.parent),s[t.name])t.empty().remove();else{for(var r=0,o=t.children();r1)if(e.isValidChild(f.name,c.name)){m.reverse();for(var g=d=a(m[0].clone()),v=0;v0})).concat(["noopener"]).sort().join(" ")}(r)))}})),e.allow_html_in_named_anchor||t.addAttributeFilter("id,name",(function(t){for(var e,n,r,o,i=t.length;i--;)if("a"===(o=t[i]).name&&o.firstChild&&!o.attr("href")){r=o.parent,e=o.lastChild;do{n=e.prev,r.insert(e,o),e=n}while(e)}})),e.fix_list_elements&&t.addNodeFilter("ul,ol",(function(t){for(var e,n,r=t.length;r--;)if("ul"===(n=(e=t[r]).parent).name||"ol"===n.name)if(e.prev&&"li"===e.prev.name)e.prev.append(e);else{var o=new Ih("li",1);o.attr("style","list-style-type: none"),e.wrap(o)}})),e.validate&&n.getValidClasses()&&t.addAttributeFilter("class",(function(t){for(var e=n.getValidClasses(),r=t.length;r--;){for(var o=t[r],i=o.attr("class").split(" "),a="",s=0;s0?u:null),l.attr(o,null)):(u=l.attr(r),"style"===r?u=n.serializeStyle(n.parseStyle(u),l.name):i&&(u=i.call(a,u,r,l.name)),l.attr(r,u.length>0?u:null))}})),t.addAttributeFilter("class",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("class");r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}})),t.addAttributeFilter("data-mce-type",(function(t,e,n){for(var r=t.length;r--;){var o=t[r];if("bookmark"===o.attr("data-mce-type")&&!n.cleanup){var i=$.from(o.firstChild).exists((function(t){return!Co(t.value)}));i?o.unwrap():o.remove()}}})),t.addNodeFilter("noscript",(function(t){for(var e=t.length;e--;){var n=t[e].firstChild;n&&(n.value=bi.decode(n.value))}})),t.addNodeFilter("script,style",(function(t,n){for(var r=function(t){return t.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")},o=t.length;o--;){var i=t[o],a=i.firstChild?i.firstChild.value:"";if("script"===n){var s=i.attr("type");s&&i.attr("type","mce-no/type"===s?null:s.replace(/^mce\-/,"")),"xhtml"===e.element_format&&a.length>0&&(i.firstChild.value="// ")}else"xhtml"===e.element_format&&a.length>0&&(i.firstChild.value="\x3c!--\n"+r(a)+"\n--\x3e")}})),t.addNodeFilter("#comment",(function(t){for(var r=t.length;r--;){var o=t[r];e.preserve_cdata&&0===o.value.indexOf("[CDATA[")?(o.name="#cdata",o.type=4,o.value=n.decode(o.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===o.value.indexOf("mce:protected ")&&(o.name="#text",o.type=3,o.raw=!0,o.value=unescape(o.value).substr(14))}})),t.addNodeFilter("xml:namespace,input",(function(t,e){for(var n=t.length;n--;){var r=t[n];7===r.type?r.remove():1===r.type&&("input"!==e||r.attr("type")||r.attr("type","text"))}})),t.addAttributeFilter("data-mce-type",(function(e){V(e,(function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())}))})),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)}))}(i,t,r);return{schema:o,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:function(n,a){void 0===a&&(a={});var s=Dt({format:"html"},a),l=Ay(e,n,s),u=function(t,e,n){var r=ko(n.getInner?e.innerHTML:t.getOuterHTML(e));return n.selection||bo(De.fromDom(e))?r:Te.trim(r)}(r,l,s),c=function(t,e,n){var r=n.selection?Dt({forced_root_block:!1},n):n,o=t.parse(e,r);return function(t){var e=function(t){return t&&"br"===t.name},n=t.lastChild;if(e(n)){var r=n.prev;e(r)&&(n.remove(),r.remove())}}(o),o}(i,u,s);return"tree"===s.format?c:Ny(e,t,o,c,s)},addRules:o.addValidElements,setRules:o.setValidElements,addTempAttr:T(Dy,i,n),getTempAttrs:S(n),getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},Iy=function(t,e){var n=Ly(t,e);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}},jy=function(t,e){return void 0===e&&(e={}),function(t,e,n){return Qv(t).editor.getContent(e,n)}(t,e,e.format?e.format:"html")},Py=function(t,e,n){return void 0===n&&(n={}),function(t,e,n){return Qv(t).editor.setContent(e,n)}(t,e,n)},Ry=gs.DOM,$y=function(t){return $.from(t).each((function(t){return t.destroy()}))},My=function(t){if(!t.removed){var e=t._selectionOverrides,n=t.editorUpload,r=t.getBody(),o=t.getElement();r&&t.save({is_removing:!0}),t.removed=!0,t.unbindAllNativeEvents(),t.hasHiddenInput&&o&&Ry.remove(o.nextSibling),function(t){t.fire("remove")}(t),t.editorManager.remove(t),!t.inline&&r&&function(t){Ry.setStyle(t.id,"display",t.orgDisplay)}(t),function(t){t.fire("detach")}(t),Ry.remove(t.getContainer()),$y(e),$y(n),t.destroy()}},By=function(t,e){var n=t.selection,r=t.dom;t.destroyed||(e||t.removed?(e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),$y(n),$y(r)),function(t){var e=t.formElement;e&&(e._mceOldSubmit&&(e.submit=e._mceOldSubmit,e._mceOldSubmit=null),Ry.unbind(e,"submit reset",t.formEventDelegate))}(t),function(t){t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null)}(t),t.destroyed=!0):t.remove())},qy=(ay=function(t,e){return h(t)&&h(e)?qy(t,e):e},function(){for(var t=[],e=0;e0}))},Qy=function(t,e){var n,r,o=(r={},gt(e,(function(e,n){return z(t,n)}),mt(n={}),mt(r)),{t:n,f:r});return function(t,e){return{sections:S(t),settings:S(e)}}(o.t,o.f)},tb=function(t,e){return _t(t.sections(),e)},eb=function(t,e){return bt(t,"toolbar_mode").orThunk((function(){return bt(t,"toolbar_drawer").map((function(t){return!1===t?"wrap":t}))})).getOr(e)},nb=function(t,e){var n={resize:!1,toolbar_mode:eb(t,"scrolling"),toolbar_sticky:!1};return Dt(Dt(Dt({},Zy),n),e?{menubar:!1}:{})},rb=function(t,e){var n=e.external_plugins?e.external_plugins:{};return t&&t.external_plugins?Te.extend({},t.external_plugins,n):n},ob=function(t,e,n,r){return t&&function(t,e,n){var r=t.sections();return tb(t,e)&&r[e].theme===n}(e,"mobile","mobile")?Y(r,T(z,Gy)):t&&tb(e,"mobile")?r:n},ib=function(t,e,n,r){var o=Jy(n.forced_plugins),i=Jy(r.plugins),a=function(t,e){return tb(t,e)?t.sections()[e]:{}}(e,"mobile"),s=a.plugins?Jy(a.plugins):i,l=function(t,e){return[].concat(Jy(t)).concat(Jy(e))}(o,ob(t,e,i,s));if(ke.browser.isIE()&&z(l,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return Te.extend(r,{plugins:l.join(" ")})},ab=function(t,e,n,r,o){var i=t?{mobile:nb(o.mobile||{},e)}:{},a=Qy(["mobile"],qy(i,o)),s=Te.extend(n,r,a.settings(),function(t,e){return t&&tb(e,"mobile")}(t,a)?function(t,e,n){void 0===n&&(n={});var r=t.sections(),o=bt(r,e).getOr({});return Te.extend({},n,o)}(a,"mobile"):{},{validate:!0,external_plugins:rb(r,a.settings())});return ib(t,a,r,s)},sb=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i={id:e,theme:"silver",toolbar_mode:eb(t,"floating"),plugins:"",document_base_url:n,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o};return Dt(Dt({},i),r?Zy:{})}(o,e,n,Ky,t),a=ab(Yy||Xy,Yy,i,r,o);return!1!==a.deprecation_warnings&&function(t,e){var n=Hy(t),r=Vy(e),o=r.length>0,i=n.length>0,a="mobile"===e.theme;if(o||i||a){var s="\n- ",l=a?"\n\nThemes:\n- mobile":"",u=o?"\n\nPlugins:\n- "+r.join(s):"",c=i?"\n\nSettings:\n- "+n.join(s):"";console.warn("The following deprecated features are currently enabled, these will be removed in TinyMCE 6.0. See https://www.tiny.cloud/docs/release-notes/6.0-upcoming-changes/ for more information."+l+u+c)}}(o,a),a},lb=function(t,e,n){return $.from(e.settings[n]).filter(t)},ub=function(t,e,n,r){var o,i=e in t.settings?t.settings[e]:n;return"hash"===r?function(t){var e={};return"string"==typeof t?V(t.indexOf("=")>0?t.split(/[;,](?![^=;,]*(?:[;,]|$))/):t.split(","),(function(t){var n=t.split("=");n.length>1?e[Te.trim(n[0])]=Te.trim(n[1]):e[Te.trim(n[0])]=Te.trim(n[0])})):e=t,e}(i):"string"===r?lb(d,t,e).getOr(n):"number"===r?lb(w,t,e).getOr(n):"boolean"===r?lb(g,t,e).getOr(n):"object"===r?lb(h,t,e).getOr(n):"array"===r?lb(p,t,e).getOr(n):"string[]"===r?lb((o=d,function(t){return p(t)&&et(t,o)}),t,e).getOr(n):"function"===r?lb(_,t,e).getOr(n):i},cb=(sy={},{add:function(t,e){sy[t]=e},get:function(t){return sy[t]?sy[t]:{icons:{}}},has:function(t){return _t(sy,t)}}),fb=function(t,e){return e.dom[t]},db=function(t,e){return parseInt(ir(e,t),10)},hb=T(fb,"clientWidth"),pb=T(fb,"clientHeight"),mb=T(db,"margin-top"),gb=T(db,"margin-left"),vb=function(t,e,n){var r,o=De.fromDom(t.getBody()),i=t.inline?o:(r=o,De.fromDom(Ve(r).dom.documentElement)),a=function(t,e,n,r){var o=function(t){return t.dom.getBoundingClientRect()}(e);return{x:n-(t?o.left+e.dom.clientLeft+gb(e):0),y:r-(t?o.top+e.dom.clientTop+mb(e):0)}}(t.inline,i,e,n);return function(t,e,n){var r=hb(t),o=pb(t);return e>=0&&n>=0&&e<=r&&n<=o}(i,a.x,a.y)},yb=function(t){var e,n=t.inline?t.getBody():t.getContentAreaContainer();return(e=n,$.from(e).map(De.fromDom)).map(bn).getOr(!1)},bb=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},r=function(){return $.from(e[0])},o=function(){e.length>0&&n().reposition(e)},i=function(t){Q(e,(function(e){return e===t})).each((function(t){e.splice(t,1)}))},a=function(a,s){if(void 0===s&&(s=!0),!t.removed&&yb(t))return s&&t.fire("BeforeOpenNotification",{notification:a}),J(e,(function(t){return e=n().getArgs(t),r=a,!(e.type!==r.type||e.text!==r.text||e.progressBar||e.timeout||r.progressBar||r.timeout);var e,r})).getOrThunk((function(){t.editorManager.setActive(t);var s=n().open(a,(function(){i(s),o(),r().fold((function(){return t.focus()}),(function(t){return De.fromDom(t.getEl()).dom.focus()}))}));return function(t){e.push(t)}(s),o(),t.fire("OpenNotification",{notification:Dt({},s)}),s}))},s=S(e);return function(t){t.on("SkinLoaded",(function(){var e=function(t){return t.getParam("service_message")}(t);e&&a({text:e,type:"warning",timeout:0},!1),o()})),t.on("show ResizeEditor ResizeWindow NodeChange",(function(){oo.requestAnimationFrame(o)})),t.on("remove",(function(){V(e.slice(),(function(t){n().close(t)}))}))}(t),{open:a,close:function(){r().each((function(t){n().close(t),i(t),o()}))},getNotifications:s}},_b=Os.PluginManager,wb=Os.ThemeManager;var Cb=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},openUrl:e,alert:e,confirm:e,close:e,getParams:e,setParams:e}},r=function(t,e){return function(){for(var n=[],r=0;r=300)r("HTTP Error: "+i.status);else{var t,o,a=JSON.parse(i.responseText);if(a&&"string"==typeof a.location)n((t=e.basePath,o=a.location,t?t.replace(/\/$/,"")+"/"+o.replace(/^\//,""):o));else r("Invalid JSON: "+i.responseText)}};var a=new FormData;a.append("file",t.blob(),t.filename()),i.send(a)},o=function(t,e){return{url:e,blobInfo:t,status:!0}},i=function(t,e,n){return{url:"",blobInfo:t,status:!1,error:{message:e,options:n}}},a=function(t,e){Te.each(n[t],(function(t){t(e)})),delete n[t]},s=function(r,s){return r=Te.grep(r,(function(e){return!t.isUploaded(e.blobUri())})),to.all(Te.map(r,(function(r){return t.isPending(r.blobUri())?function(t){var e=t.blobUri();return new to((function(t){n[e]=n[e]||[],n[e].push(t)}))}(r):function(e,n,r){return t.markPending(e.blobUri()),new to((function(s){var l;try{var u=function(){l&&l.close()};n(e,(function(n){u(),t.markUploaded(e.blobUri(),n),a(e.blobUri(),o(e,n)),s(o(e,n))}),(function(n,r){var o=r||{};u(),t.removeFailed(e.blobUri()),a(e.blobUri(),i(e,n,o)),s(i(e,n,o))}),(function(t){t<0||t>100||$.from(l).orThunk((function(){return $.from(r).map(D)})).each((function(e){l=e,e.progressBar.value(t)}))}))}catch(t){s(i(e,t.message,{}))}}))}(r,e.handler,s)})))};return!1===_(e.handler)&&(e.handler=r),{upload:function(t,n){return e.url||e.handler!==r?s(t,n):new to((function(t){t([])}))}}},Rb=function(t){return function(){return t.notificationManager.open({text:t.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}},$b=function(t,e){return Pb(e,{url:su(t),basePath:lu(t),credentials:uu(t),handler:cu(t)})},Mb=function(t){var e,n,r=function(){var t=[],e=function(t){if(!t.blob||!t.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var e,n=t.id||jb("blobid"),r=t.name||n,o=t.blob;return{id:S(n),name:S(r),filename:S(t.filename||r+"."+(e=o.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[e.toLowerCase()]||"dat")),blob:S(o),base64:S(t.base64),blobUri:S(t.blobUri||URL.createObjectURL(o)),uri:S(t.uri)}},n=function(e){return J(t,e).getOrUndefined()},r=function(t){return n((function(e){return e.id()===t}))};return{create:function(t,n,r,o,i){if(d(t))return e({id:t,name:o,filename:i,blob:n,base64:r});if(h(t))return e(t);throw new Error("Unknown input type")},add:function(e){r(e.id())||t.push(e)},get:r,getByUri:function(t){return n((function(e){return e.blobUri()===t}))},getByData:function(t,e){return n((function(n){return n.base64()===t&&n.blob().type===e}))},findFirst:n,removeByUri:function(e){t=Y(t,(function(t){return t.blobUri()!==e||(URL.revokeObjectURL(t.blobUri()),!1)}))},destroy:function(){V(t,(function(t){URL.revokeObjectURL(t.blobUri())})),t=[]}}}(),o=Lb(),i=[],a=function(t){var e=ws(null);return t.on("change AddUndo",(function(t){e.set(Dt({},t.level))})),{fireIfChanged:function(){var n=t.undoManager.data;st(n).filter((function(t){return!Wv(e.get(),t)})).each((function(e){t.setDirty(!0),t.fire("change",{level:e,lastLevel:it(n,n.length-2).getOrNull()})}))}}}(t),s=function(e){return function(n){return t.selection?e(n):[]}},l=function(t,e,n){var r=0;do{-1!==(r=t.indexOf(e,r))&&(t=t.substring(0,r)+n+t.substr(r+e.length),r+=n.length-e.length+1)}while(-1!==r);return t},u=function(t,e,n){var r='src="'+n+'"'+(n===ke.transparentSrc?' data-mce-placeholder="1"':"");return t=l(t,'src="'+e+'"',r),t=l(t,'data-mce-src="'+e+'"','data-mce-src="'+n+'"')},c=function(e,n){V(t.undoManager.data,(function(t){"fragmented"===t.type?t.fragments=H(t.fragments,(function(t){return u(t,e,n)})):t.content=u(t.content,e,n)}))},f=function(n){return e||(e=$b(t,o)),g().then(s((function(o){var i=H(o,(function(t){return t.blobInfo}));return e.upload(i,Rb(t)).then(s((function(e){var i=[],s=H(e,(function(e,n){var a=o[n].blobInfo,s=o[n].image;return e.status&&function(t){return t.getParam("images_replace_blob_uris",!0,"boolean")}(t)?(r.removeByUri(s.src),Zv(t)||function(e,n){var r,o=t.convertURL(n,"src");c(e.src,n),t.$(e).attr({src:iu(t)?(r=n,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):n,"data-mce-src":o})}(s,e.url)):e.error&&(e.error.options.remove&&(c(s.getAttribute("src"),ke.transparentSrc),i.push(s)),function(t,e){xb(t,Ss.translate(["Failed to upload image: {0}",e]))}(t,e.error.message)),{element:s,status:e.status,uploadUri:e.url,blobInfo:a}}));return s.length>0&&a.fireIfChanged(),i.length>0&&(Zv(t)?console.error("Removing images on failed uploads is currently unsupported for RTC"):t.undoManager.transact((function(){V(i,(function(e){t.dom.remove(e),r.removeByUri(e.src)}))}))),n&&n(s),s})))})))},p=function(e){if(ou(t))return f(e)},m=function(e){if(!1===et(i,(function(t){return t(e)})))return!1;if(0===e.getAttribute("src").indexOf("data:")){var n=function(t){return t.getParam("images_dataimg_filter",I,"function")}(t);return n(e)}return!0},g=function(){return n||(n=by(o,r)),n.findAll(t.getBody(),m).then(s((function(e){return e=Y(e,(function(e){return"string"!=typeof e||(xb(t,e),!1)})),Zv(t)||V(e,(function(t){c(t.image.src,t.blobInfo.blobUri()),t.image.src=t.blobInfo.blobUri(),t.image.removeAttribute("data-mce-src")})),e})))},v=function(e){return e.replace(/src="(blob:[^"]+)"/g,(function(e,n){var i=o.getResultUri(n);if(i)return'src="'+i+'"';var a=r.getByUri(n);return a||(a=G(t.editorManager.get(),(function(t,e){return t||e.editorUpload&&e.editorUpload.blobCache.getByUri(n)}),null)),a?'src="data:'+a.blob().type+";base64,"+a.base64()+'"':e}))};return t.on("SetContent",(function(){ou(t)?p():g()})),t.on("RawSaveContent",(function(t){t.content=v(t.content)})),t.on("GetContent",(function(t){t.source_view||"raw"===t.format||"tree"===t.format||(t.content=v(t.content))})),t.on("PostRender",(function(){t.parser.addNodeFilter("img",(function(t){V(t,(function(t){var e=t.attr("src");if(!r.getByUri(e)){var n=o.getResultUri(e);n&&t.attr("src",n)}}))}))})),{blobCache:r,addFilter:function(t){i.push(t)},uploadImages:f,uploadImagesAuto:p,scanForImages:g,destroy:function(){r.destroy(),o.destroy(),n=e=null}}},Bb=function(t){var e={},n=function(t,r){t&&(d(t)?(p(r)||(r=[r]),V(r,(function(t){v(t.deep)&&(t.deep=!mf(t)),v(t.split)&&(t.split=!mf(t)||gf(t)),v(t.remove)&&mf(t)&&!gf(t)&&(t.remove="none"),mf(t)&&gf(t)&&(t.mixed=!0,t.block_expand=!0),d(t.classes)&&(t.classes=t.classes.split(/\s+/))})),e[t]=r):dt(t,(function(t,e){n(e,t)})))};return n(function(t){var e={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",defaultBlock:"p",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(t,e,n){return Nn(t)&&t.hasAttribute("href")},onformat:function(e,n,r){Te.each(r,(function(n,r){t.setAttrib(e,r,n)}))}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":function(t){var e;return null!==(e=null==t?void 0:t.customValue)&&void 0!==e?e:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return Te.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),(function(t){e[t]={block:t,remove:"all"}})),e}(t.dom)),n(function(t){return t.getParam("formats")}(t)),{get:function(t){return b(t)?e[t]:e},has:function(t){return _t(e,t)},register:n,unregister:function(t){return t&&e[t]&&delete e[t],e}}},qb=Te.each,Fb=gs.DOM,zb=function(t,e){var n,r,o,i=e&&e.schema||Ai({}),a=function(t){r="string"==typeof t?{name:t,classes:[],attrs:{}}:t;var e=Fb.create(r.name);return function(t,e){e.classes.length&&Fb.addClass(t,e.classes.join(" ")),Fb.setAttribs(t,e.attrs)}(e,r),e},s=function(t,e,n){var r,o,l=e.length>0&&e[0],u=l&&l.name,c=function(t,e){var n="string"!=typeof t?t.nodeName.toLowerCase():t,r=i.getElementRule(n),o=r&&r.parentsRequired;return!(!o||!o.length)&&(e&&-1!==Te.inArray(o,e)?e:o[0])}(t,u);if(c)u===c?(o=e[0],e=e.slice(1)):o=c;else if(l)o=e[0],e=e.slice(1);else if(!n)return t;return o&&(r=a(o)).appendChild(t),n&&(r||(r=Fb.create("div")).appendChild(t),Te.each(n,(function(e){var n=a(e);r.insertBefore(n,t)}))),s(r,e,o&&o.siblings)};return t&&t.length?(r=t[0],n=a(r),(o=Fb.create("div")).appendChild(s(n,t.slice(1),r.siblings)),o):""},Ub=function(t){var e,n={classes:[],attrs:{}};return"*"!==(t=n.selector=Te.trim(t))&&(e=t.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(t,e,r,o,i){switch(e){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==Te.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r)}if("["===o){var a=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);a&&(n.attrs[a[1]]=a[2])}return""}))),n.name=e||"div",n},Hb=function(t,e){var n,r,o,i="",a=function(t){var e=t.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");return d(e)?e:""}(t);if(""===a)return"";var s=function(t){return t.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=t.formatter.get(e)))return;e=e[0]}if("preview"in e){var l=bt(e,"preview");if(Xn(l,!1))return"";a=l.getOr(a)}n=e.block||e.inline||"span";var u,c=(u=e.selector)&&"string"==typeof u?(u=(u=u.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),Te.map(u.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(t){var e=Te.map(t.split(/(?:~\+|~|\+)/),Ub),n=e.pop();return e.length&&(n.siblings=e),n})).reverse()):[];c.length?(c[0].name||(c[0].name=n),n=e.selector,r=zb(c,t)):r=zb([n],t);var f=Fb.select(n,r)[0]||r.firstChild;return qb(e.styles,(function(t,e){var n=s(t);n&&Fb.setStyle(f,e,n)})),qb(e.attributes,(function(t,e){var n=s(t);n&&Fb.setAttrib(f,e,n)})),qb(e.classes,(function(t){var e=s(t);Fb.hasClass(f,e)||Fb.addClass(f,e)})),t.fire("PreviewFormats"),Fb.setStyles(r,{position:"absolute",left:-65535}),t.getBody().appendChild(r),o=Fb.getStyle(t.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,qb(a.split(" "),(function(e){var n=Fb.getStyle(f,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=Fb.getStyle(t.getBody(),e,!0),"#ffffff"===Fb.toHex(n).toLowerCase())||"color"===e&&"#000000"===Fb.toHex(n).toLowerCase())){if("font-size"===e&&/em|%$/.test(n)){if(0===o)return;n=parseFloat(n)/(/%$/.test(n)?100:1)*o+"px"}"border"===e&&n&&(i+="padding:0 2px;"),i+=e+":"+n+";"}})),t.fire("AfterPreviewFormats"),Fb.remove(r),i},Vb=function(t){var e=Bb(t),n=ws(null);return function(t){t.addShortcut("meta+b","","Bold"),t.addShortcut("meta+i","","Italic"),t.addShortcut("meta+u","","Underline");for(var e=1;e<=6;e++)t.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);t.addShortcut("access+7","",["FormatBlock",!1,"p"]),t.addShortcut("access+8","",["FormatBlock",!1,"div"]),t.addShortcut("access+9","",["FormatBlock",!1,"address"])}(t),Lg(t),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,n,r){!function(t,e,n,r){ty(t).formatter.apply(e,n,r)}(t,e,n,r)},remove:function(e,n,r,o){!function(t,e,n,r,o){ty(t).formatter.remove(e,n,r,o)}(t,e,n,r,o)},toggle:function(e,n,r){!function(t,e,n,r){ty(t).formatter.toggle(e,n,r)}(t,e,n,r)},match:function(e,n,r,o){return function(t,e,n,r,o){return ty(t).formatter.match(e,n,r,o)}(t,e,n,r,o)},closest:function(e){return function(t,e){return ty(t).formatter.closest(e)}(t,e)},matchAll:function(e,n){return function(t,e,n){return ty(t).formatter.matchAll(e,n)}(t,e,n)},matchNode:function(e,n,r,o){return function(t,e,n,r,o){return ty(t).formatter.matchNode(e,n,r,o)}(t,e,n,r,o)},canApply:function(e){return function(t,e){return ty(t).formatter.canApply(e)}(t,e)},formatChanged:function(e,r,o,i){return function(t,e,n,r,o,i){return ty(t).formatter.formatChanged(e,n,r,o,i)}(t,n,e,r,o,i)},getCssText:T(Hb,t)}},Wb=function(t){switch(t.toLowerCase()){case"undo":case"redo":case"mcerepaint":case"mcefocus":return!0;default:return!1}},Kb=function(t){var e=Es(),n=ws(0),r=ws(0),o={data:[],typing:!1,beforeChange:function(){!function(t,e,n){ty(t).undoManager.beforeChange(e,n)}(t,n,e)},add:function(i,a){return function(t,e,n,r,o,i,a){return ty(t).undoManager.add(e,n,r,o,i,a)}(t,o,r,n,e,i,a)},undo:function(){return function(t,e,n,r){return ty(t).undoManager.undo(e,n,r)}(t,o,n,r)},redo:function(){return function(t,e,n){return ty(t).undoManager.redo(e,n)}(t,r,o.data)},clear:function(){!function(t,e,n){ty(t).undoManager.clear(e,n)}(t,o,r)},reset:function(){!function(t,e){ty(t).undoManager.reset(e)}(t,o)},hasUndo:function(){return function(t,e,n){return ty(t).undoManager.hasUndo(e,n)}(t,o,r)},hasRedo:function(){return function(t,e,n){return ty(t).undoManager.hasRedo(e,n)}(t,o,r)},transact:function(e){return function(t,e,n,r){return ty(t).undoManager.transact(e,n,r)}(t,o,n,e)},ignore:function(e){!function(t,e,n){ty(t).undoManager.ignore(e,n)}(t,n,e)},extra:function(e,n){!function(t,e,n,r,o){ty(t).undoManager.extra(e,n,r,o)}(t,o,r,e,n)}};return Zv(t)||function(t,e,n){var r=ws(!1),o=function(t){Yv(e,!1,n),e.add({},t)};t.on("init",(function(){e.add()})),t.on("BeforeExecCommand",(function(t){var r=t.command;Wb(r)||(Xv(e,n),e.beforeChange())})),t.on("ExecCommand",(function(t){var e=t.command;Wb(e)||o(t)})),t.on("ObjectResizeStart cut",(function(){e.beforeChange()})),t.on("SaveContent ObjectResized blur",o),t.on("dragend",o),t.on("keyup",(function(n){var i=n.keyCode;n.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||n.ctrlKey)&&(o(),t.nodeChanged()),46!==i&&8!==i||t.nodeChanged(),r.get()&&e.typing&&!1===Wv(zv(t),e.data[0])&&(!1===t.isDirty()&&(t.setDirty(!0),t.fire("change",{level:e.data[0],lastLevel:null})),t.fire("TypingUndo"),r.set(!1),t.nodeChanged()))})),t.on("keydown",(function(t){var i=t.keyCode;if(!t.isDefaultPrevented())if(i>=33&&i<=36||i>=37&&i<=40||45===i)e.typing&&o(t);else{var a=t.ctrlKey&&!t.altKey||t.metaKey;!(i<16||i>20)||224===i||91===i||e.typing||a||(e.beforeChange(),Yv(e,!0,n),e.add({},t),r.set(!0))}})),t.on("mousedown",(function(t){e.typing&&o(t)})),t.on("input",(function(t){var e;t.inputType&&("insertReplacementText"===t.inputType||"insertText"===(e=t).inputType&&null===e.data||function(t){return"insertFromPaste"===t.inputType||"insertFromDrop"===t.inputType}(t))&&o(t)})),t.on("AddUndo Undo Redo ClearUndos",(function(e){e.isDefaultPrevented()||t.nodeChanged()}))}(t,o,n),function(t){t.addShortcut("meta+z","","Undo"),t.addShortcut("meta+y,meta+shift+z","","Redo")}(t),o},Yb=[9,27,id.HOME,id.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,id.DOWN,id.UP,id.LEFT,id.RIGHT].concat(ke.browser.isFirefox()?[224]:[]),Xb="data-mce-placeholder",Gb=function(t){return"keydown"===t.type||"keyup"===t.type},Zb=function(t){var e=t.keyCode;return e===id.BACKSPACE||e===id.DELETE},Jb=function(t){var e=t.dom,n=nu(t),r=function(t){return t.getParam("placeholder",Ql.getAttrib(t.getElement(),"placeholder"),"string")}(t),o=function(i,a){if(!function(t){if(Gb(t)){var e=t.keyCode;return!Zb(t)&&(id.metaKeyPressed(t)||t.altKey||e>=112&&e<=123||z(Yb,e))}return!1}(i)){var s=t.getBody(),l=!function(t){return Gb(t)&&!(Zb(t)||"keyup"===t.type&&229===t.keyCode)}(i)&&function(t,e,n){if(ei(De.fromDom(e),!1)){var r=""===n,o=e.firstElementChild;return!o||!t.getStyle(e.firstElementChild,"padding-left")&&!t.getStyle(e.firstElementChild,"padding-right")&&(r?!t.isBlock(o):n===o.nodeName.toLowerCase())}return!1}(e,s,n);(""!==e.getAttrib(s,Xb)!==l||a)&&(e.setAttrib(s,Xb,l?r:null),e.setAttrib(s,"aria-placeholder",l?r:null),function(t,e){t.fire("PlaceholderToggle",{state:e})}(t,l),t.on(l?"keydown":"keyup",o),t.off(l?"keyup":"keydown",o))}};r&&t.on("init",(function(e){o(e,!0),t.on("change SetContent ExecCommand",o),t.on("paste",(function(e){return oo.setEditorTimeout(t,(function(){return o(e)}))}))}))},Qb=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,t_=function(t,e){return Le(De.fromDom(e),function(t){return t.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")}(t))},e_=function(t){return"rtl"===gs.DOM.getStyle(t,"direction",!0)||(e=t.textContent,Qb.test(e));var e},n_=function(t,e,n){var r=function(t,e,n){return Y(gs.DOM.getParents(n.container(),"*",e),t)}(t,e,n);return $.from(r[r.length-1])},r_=function(t,e){if(!e)return e;var n=e.container(),r=e.offset();return t?Eo(n)?Bn(n.nextSibling)?Al(n.nextSibling,0):Al.after(n):Do(e)?Al(n,r+1):e:Eo(n)?Bn(n.previousSibling)?Al(n.previousSibling,n.previousSibling.data.length):Al.before(n):No(e)?Al(n,r-1):e},o_=T(r_,!0),i_=T(r_,!1),a_=function(t){return po(t)||go(t)},s_=function(t,e){return Re(t,e)?Xr(e,a_,function(t){return function(e){return je(t,De.fromDom(e.dom.parentNode))}}(t)):$.none()},l_=function(t){t.dom.isEmpty(t.getBody())&&(t.setContent(""),function(t){var e=t.getBody(),n=e.firstChild&&t.dom.isBlock(e.firstChild)?e.firstChild:e;t.selection.setCursorLocation(n,0)}(t))},u_=function(t,e){return{from:t,to:e}},c_=function(t,e){var n=De.fromDom(t),r=De.fromDom(e.container());return s_(n,r).map((function(t){return function(t,e){return{block:t,position:e}}(t,e)}))},f_=function(t,e,n){var r=c_(t,Al.fromRangeStart(n)),o=r.bind((function(n){return Ac(e,t,n.position).bind((function(n){return c_(t,n).map((function(n){return function(t,e,n){return Un(n.position.getNode())&&!1===ei(n.block)?Lc(!1,n.block.dom).bind((function(r){return r.isEqual(n.position)?Ac(e,t,r).bind((function(e){return c_(t,e)})):$.some(n)})).getOr(n):n}(t,e,n)}))}))}));return Gn(r,o,u_).filter((function(t){return function(t){return!1===je(t.from.block,t.to.block)}(t)&&function(t){return Ke(t.from.block).bind((function(e){return Ke(t.to.block).filter((function(t){return je(e,t)}))})).isSome()}(t)&&function(t){return!1===Wn(t.from.block.dom)&&!1===Wn(t.to.block.dom)}(t)}))},d_=function(t){var e=Je(t);return Q(e,co).fold(S(e),(function(t){return e.slice(0,t)}))},h_=function(t){var e=d_(t);return V(e,vn),e},p_=function(t,e){var n=Op(e,t);return J(n.reverse(),(function(t){return ei(t)})).each(vn)},m_=function(t,e,n,r){if(ei(n))return Cp(n),Pc(n.dom);0===Y(Ge(r),(function(t){return!ei(t)})).length&&ei(e)&&fn(r,De.fromTag("br"));var o=jc(n.dom,Al.before(r.dom));return V(h_(e),(function(t){fn(r,t)})),p_(t,e),o},g_=function(t,e,n){if(ei(n))return vn(n),ei(e)&&Cp(e),Pc(e.dom);var r=Rc(n.dom);return V(h_(e),(function(t){pn(n,t)})),p_(t,e),r},v_=function(t,e){return Re(e,t)?function(t,e){var n=Op(e,t);return $.from(n[n.length-1])}(e,t):$.none()},y_=function(t,e){Lc(t,e.dom).map((function(t){return t.getNode()})).map(De.fromDom).filter(ho).each(vn)},b_=function(t,e,n){return y_(!0,e),y_(!1,n),v_(e,n).fold(T(g_,t,e,n),T(m_,t,e,n))},__=function(t,e,n,r){return e?b_(t,r,n):b_(t,n,r)},w_=function(t,e){var n=De.fromDom(t.getBody()),r=function(t,e,n){return n.collapsed?f_(t,e,n):$.none()}(n.dom,e,t.selection.getRng()).bind((function(t){return __(n,e,t.from.block,t.to.block)}));return r.each((function(e){t.selection.setRng(e.toRange())})),r.isSome()},C_=function(t,e){var n=De.fromDom(e),r=T(je,t);return Yr(n,yo,r).isSome()},k_=function(t,e){var n=jc(t.dom,Al.fromRangeStart(e)).isNone(),r=Ic(t.dom,Al.fromRangeEnd(e)).isNone();return!function(t,e){return C_(t,e.startContainer)||C_(t,e.endContainer)}(t,e)&&n&&r},x_=function(t){var e=De.fromDom(t.getBody()),n=t.selection.getRng();return k_(e,n)?function(t){return t.setContent(""),t.selection.setCursorLocation(),!0}(t):function(t,e){var n=e.getRng();return Gn(s_(t,De.fromDom(n.startContainer)),s_(t,De.fromDom(n.endContainer)),(function(r,o){return!1===je(r,o)&&(n.deleteContents(),__(t,!0,r,o).each((function(t){e.setRng(t.toRange())})),!0)})).getOr(!1)}(e,t.selection)},S_=function(t,e){return!t.selection.isCollapsed()&&x_(t)},O_=Vn,E_=Wn,T_=function(t,e,n,r,o){return $.from(e._selectionOverrides.showCaret(t,n,r,o))},A_=function(t,e){return t.fire("BeforeObjectSelected",{target:e}).isDefaultPrevented()?$.none():$.some(function(t){var e=t.ownerDocument.createRange();return e.selectNode(t),e}(e))},D_=function(t,e,n){var r=sc(1,t.getBody(),e),o=Al.fromRangeStart(r),i=o.getNode();if(qu(i))return T_(1,t,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(qu(a))return T_(1,t,a,!1,!1);var s=t.dom.getParent(o.getNode(),(function(t){return E_(t)||O_(t)}));return qu(s)?T_(1,t,s,!1,n):$.none()},N_=function(t,e,n){return e.collapsed?D_(t,e,n).getOr(e):e},L_=function(t){return bp(t)||mp(t)},I_=function(t){return _p(t)||gp(t)},j_=function(t,e,n,r,o,i){return T_(r,t,i.getNode(!o),o,!0).each((function(n){if(e.collapsed){var r=e.cloneRange();o?r.setEnd(n.startContainer,n.startOffset):r.setStart(n.endContainer,n.endOffset),r.deleteContents()}else e.deleteContents();t.selection.setRng(n)})),function(t,e){Bn(e)&&0===e.data.length&&t.remove(e)}(t.dom,n),!0},P_=function(t,e){return function(t,e){var n=t.selection.getRng();if(!Bn(n.commonAncestorContainer))return!1;var r=e?Dl.Forwards:Dl.Backwards,o=xc(t.getBody()),i=T(fc,e?o.next:o.prev),a=e?L_:I_,s=uc(r,t.getBody(),n),l=r_(e,i(s));if(!l||!dc(s,l))return!1;if(a(l))return j_(t,n,s.getNode(),r,e,l);var u=i(l);return!!(u&&a(u)&&dc(l,u))&&j_(t,n,s.getNode(),r,e,u)}(t,e)},R_=Sr([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),$_=function(t,e,n,r){var o=r.getNode(!1===e);return s_(De.fromDom(t),De.fromDom(n.getNode())).map((function(t){return ei(t)?R_.remove(t.dom):R_.moveToElement(o)})).orThunk((function(){return $.some(R_.moveToElement(o))}))},M_=function(t,e,n){return Ac(e,t,n).bind((function(r){return o=r.getNode(),yo(De.fromDom(o))||go(De.fromDom(o))||function(t,e,n,r){var o=function(e){return fo(De.fromDom(e))&&!tc(n,r,t)};return lc(!e,n).fold((function(){return lc(e,r).fold(L,o)}),o)}(t,e,n,r)?$.none():e&&Wn(r.getNode())||!1===e&&Wn(r.getNode(!0))?$_(t,e,n,r):e&&_p(n)||!1===e&&bp(n)?$.some(R_.moveToPosition(r)):$.none();var o}))},B_=function(t,e,n){return function(t,e){var n=e.getNode(!1===t),r=t?"after":"before";return Nn(n)&&n.getAttribute("data-mce-caret")===r}(e,n)?function(t,e){return t&&Wn(e.nextSibling)?$.some(R_.moveToElement(e.nextSibling)):!1===t&&Wn(e.previousSibling)?$.some(R_.moveToElement(e.previousSibling)):$.none()}(e,n.getNode(!1===e)).fold((function(){return M_(t,e,n)}),$.some):M_(t,e,n).bind((function(e){return function(t,e,n){return n.fold((function(t){return $.some(R_.remove(t))}),(function(t){return $.some(R_.moveToElement(t))}),(function(n){return tc(e,n,t)?$.none():$.some(R_.moveToPosition(n))}))}(t,n,e)}))},q_=function(t,e){return $.from(td(t.getBody(),e))},F_=function(t,e){var n=t.selection.getNode();return q_(t,n).filter(Wn).fold((function(){return function(t,e,n){var r=sc(e?1:-1,t,n),o=Al.fromRangeStart(r),i=De.fromDom(t);return!1===e&&_p(o)?$.some(R_.remove(o.getNode(!0))):e&&bp(o)?$.some(R_.remove(o.getNode())):!1===e&&bp(o)&&Mp(i,o)?Bp(i,o).map((function(t){return R_.remove(t.getNode())})):e&&_p(o)&&$p(i,o)?qp(i,o).map((function(t){return R_.remove(t.getNode())})):B_(t,e,o)}(t.getBody(),e,t.selection.getRng()).exists((function(n){return n.fold(function(t,e){return function(n){return t._selectionOverrides.hideFakeCaret(),mm(t,e,De.fromDom(n)),!0}}(t,e),function(t,e){return function(n){var r=e?Al.before(n):Al.after(n);return t.selection.setRng(r.toRange()),!0}}(t,e),function(t){return function(e){return t.selection.setRng(e.toRange()),!0}}(t))}))}),I)},z_=function(t,e){var n=t.selection.getNode();return!(!Wn(n)||Kn(n))&&q_(t,n.parentNode).filter(Wn).fold((function(){var n;return n=De.fromDom(t.getBody()),V(Ms(n,".mce-offscreen-selection"),vn),mm(t,e,De.fromDom(t.selection.getNode())),l_(t),!0}),I)},U_=function(t){var e=t.dom,n=t.selection,r=td(t.getBody(),n.getNode());if(Vn(r)&&e.isBlock(r)&&e.isEmpty(r)){var o=e.create("br",{"data-mce-bogus":"1"});e.setHTML(r,""),r.appendChild(o),n.setRng(Al.before(o).toRange())}return!0},H_=function(t,e){return t.selection.isCollapsed()?F_(t,e):z_(t,e)},V_=function(t,e){return!!t.selection.isCollapsed()&&function(t,e){var n=Al.fromRangeStart(t.selection.getRng());return Ac(e,t.getBody(),n).filter((function(t){return e?hp(t):pp(t)})).bind((function(t){return $.from(ec(e?0:-1,t))})).exists((function(e){return t.selection.select(e),!0}))}(t,e)},W_=Bn,K_=function(t){return W_(t)&&t.data[0]===wo},Y_=function(t){return W_(t)&&t.data[t.data.length-1]===wo},X_=function(t){return t.ownerDocument.createTextNode(wo)},G_=function(t,e){return t?function(t){if(W_(t.previousSibling))return Y_(t.previousSibling)||t.previousSibling.appendData(wo),t.previousSibling;if(W_(t))return K_(t)||t.insertData(0,wo),t;var e=X_(t);return t.parentNode.insertBefore(e,t),e}(e):function(t){if(W_(t.nextSibling))return K_(t.nextSibling)||t.nextSibling.insertData(0,wo),t.nextSibling;if(W_(t))return Y_(t)||t.appendData(wo),t;var e=X_(t);return t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e}(e)},Z_=T(G_,!0),J_=T(G_,!1),Q_=function(t,e){return Bn(t.container())?G_(e,t.container()):G_(e,t.getNode())},tw=function(t,e){var n=e.get();return n&&t.container()===n&&Eo(n)},ew=function(t,e){return e.fold((function(e){Lu(t.get());var n=Z_(e);return t.set(n),$.some(Al(n,n.length-1))}),(function(e){return Pc(e).map((function(e){if(tw(e,t))return Al(t.get(),1);Lu(t.get());var n=Q_(e,!0);return t.set(n),Al(n,1)}))}),(function(e){return Rc(e).map((function(e){if(tw(e,t))return Al(t.get(),t.get().length-1);Lu(t.get());var n=Q_(e,!1);return t.set(n),Al(n,n.length-1)}))}),(function(e){Lu(t.get());var n=J_(e);return t.set(n),$.some(Al(n,1))}))},nw=function(t,e){for(var n=0;n0&&e(c,At(s))&&a++,c.line=a,o(c))return!0;s.push(c)}}},u=At(i.getClientRects());if(!u)return s;var c=i.getNode();return l(c),function(t,e,n,r){for(;r=Ju(r,t,Ko,e);)if(n(r))return}(t,r,l,c),s},Fw=T(qw,xw.Up,ol,il),zw=T(qw,xw.Down,il,ol),Uw=function(t){return function(e){return function(t,e){return e.line>t}(t,e)}},Hw=function(t){return function(e){return function(t,e){return e.line===t}(t,e)}},Vw=Wn,Ww=Ju,Kw=function(t,e){return Math.abs(t.left-e)},Yw=function(t,e){return Math.abs(t.right-e)},Xw=function(t,e){return t>=e.left&&t<=e.right},Gw=function(t,e){return t>=e.top&&t<=e.bottom},Zw=function(t,e,n){return void 0===n&&(n=I),Et(t,(function(t,r){if(Xw(e,r))return n(r)?r:t;if(Xw(e,t))return n(t)?t:r;var o=Math.min(Kw(t,e),Yw(t,e)),i=Math.min(Kw(r,e),Yw(r,e));return i===o&&wt(r,"node")&&Vw(r.node)||i0&&i(h,At(u))&&c++;var p=el(h);if(p.position=s,p.line=c,n(p))return u;u.push(p)}}}while(s=o(s));return u}(e,t.getBody(),Uw(1),u),v=Zw(Y(g,Hw(1)),d);if(v)return eC(t,v.position.toRange(),!1);if(v=At(Y(g,Hw(0))))return eC(t,v.position.toRange(),!1)}return 0===f.length?oC(t,l).filter(l?o:r).map((function(e){return N_(t,e.toRange(),!1)})):$.none()},oC=function(t,e){var n=t.selection.getRng(),r=t.getBody();if(e){var o=Al.fromRangeEnd(n),i=Iw(r,o);return st(i.positions)}o=Al.fromRangeStart(n),i=Lw(r,o);return at(i.positions)},iC=function(t,e,n){return oC(t,e).filter(n).exists((function(e){return t.selection.setRng(e.toRange()),!0}))},aC=function(t,e){var n=t.dom.createRng();n.setStart(e.container(),e.offset()),n.setEnd(e.container(),e.offset()),t.selection.setRng(n)},sC=function(t,e){t?e.setAttribute("data-mce-selected","inline-boundary"):e.removeAttribute("data-mce-selected")},lC=function(t,e,n){return ew(e,n).map((function(e){return aC(t,e),n}))},uC=function(t,e){if(t.selection.isCollapsed()&&!0!==t.composing&&e.get()){var n=Al.fromRangeStart(t.selection.getRng());Al.isTextPosition(n)&&!1===function(t){return Do(t)||No(t)}(n)&&(aC(t,Nu(e.get(),n)),e.set(null))}},cC=function(t,e,n){return!!_u(t)&&function(t,e,n){var r=t.getBody(),o=Al.fromRangeStart(t.selection.getRng()),i=T(t_,t);return _w(n,i,r,o).bind((function(n){return lC(t,e,n)}))}(t,e,n).isSome()},fC=function(t,e,n){return!!_u(e)&&kw(t,e)},dC=function(t){var e=ws(null),n=T(t_,t);return t.on("NodeChange",(function(r){!_u(t)||ke.browser.isIE()&&r.initial||(function(t,e,n){var r=H(Ms(De.fromDom(e.getRoot()),'*[data-mce-selected="inline-boundary"]'),(function(t){return t.dom})),o=Y(r,t),i=Y(n,t);V(rt(o,i),T(sC,!1)),V(rt(i,o),T(sC,!0))}(n,t.dom,r.parents),uC(t,e),function(t,e,n,r){if(e.selection.isCollapsed()){var o=Y(r,t);V(o,(function(r){var o=Al.fromRangeStart(e.selection.getRng());dw(t,e.getBody(),o).bind((function(t){return lC(e,n,t)}))}))}}(n,t,e,r.parents))})),e},hC=T(fC,!0),pC=T(fC,!1),mC=function(t,e,n){if(_u(t)){var r=oC(t,e).getOrThunk((function(){var n=t.selection.getRng();return e?Al.fromRangeEnd(n):Al.fromRangeStart(n)}));return dw(T(t_,t),t.getBody(),r).exists((function(e){var r=mw(e);return ew(n,r).exists((function(e){return aC(t,e),!0}))}))}return!1},gC=function(t,e){return function(n){return ew(e,n).exists((function(e){return aC(t,e),!0}))}},vC=function(t,e,n,r){var o=t.getBody(),i=T(t_,t);t.undoManager.ignore((function(){t.selection.setRng(function(t,e){var n=document.createRange();return n.setStart(t.container(),t.offset()),n.setEnd(e.container(),e.offset()),n}(n,r)),t.execCommand("Delete"),dw(i,o,Al.fromRangeStart(t.selection.getRng())).map(gw).map(gC(t,e))})),t.nodeChanged()},yC=function(t,e,n,r){var o=function(t,e){return Qu(e,t)||t}(t.getBody(),r.container()),i=T(t_,t),a=dw(i,o,r);return a.bind((function(t){return n?t.fold(S($.some(gw(t))),$.none,S($.some(mw(t))),$.none):t.fold($.none,S($.some(mw(t))),$.none,S($.some(gw(t))))})).map(gC(t,e)).getOrThunk((function(){var s=Dc(n,o,r),l=s.bind((function(t){return dw(i,o,t)}));return Gn(a,l,(function(){return n_(i,o,r).exists((function(e){return!!function(t){return Gn(Pc(t),Rc(t),(function(e,n){var r=r_(!0,e),o=r_(!1,n);return Ic(t,r).forall((function(t){return t.isEqual(o)}))})).getOr(!0)}(e)&&(mm(t,n,De.fromDom(e)),!0)}))})).orThunk((function(){return l.bind((function(o){return s.map((function(o){return n?vC(t,e,r,o):vC(t,e,o,r),!0}))}))})).getOr(!1)}))},bC=function(t,e,n){if(t.selection.isCollapsed()&&_u(t)){var r=Al.fromRangeStart(t.selection.getRng());return yC(t,e,n,r)}return!1},_C=function(t){return 1===nn(t)},wC=function(t,e,n,r){var o=T(Ig,e),i=H(Y(r,o),(function(t){return t.dom}));if(0===i.length)mm(e,t,n);else{var a=function(t,e){var n=Og(!1),r=Dg(e,n.dom);return fn(De.fromDom(t),n),vn(De.fromDom(t)),Al(r,0)}(n.dom,i);e.selection.setRng(a.toRange())}},CC=function(t,e){var n=De.fromDom(t.getBody()),r=De.fromDom(t.selection.getStart()),o=Y(function(t,e){var n=Op(e,t);return Q(n,co).fold(S(n),(function(t){return n.slice(0,t)}))}(n,r),_C);return st(o).exists((function(n){var r,i=Al.fromRangeStart(t.selection.getRng());return!(!function(t,e,n){return Gn(Pc(n),Rc(n),(function(r,o){var i=r_(!0,r),a=r_(!1,o),s=r_(!1,e);return t?Ic(n,s).exists((function(t){return t.isEqual(a)&&e.isEqual(i)})):jc(n,s).exists((function(t){return t.isEqual(i)&&e.isEqual(a)}))})).getOr(!0)}(e,i,n.dom)||(r=n,Mc(r.dom)&&xg(r.dom)))&&(wC(e,t,n,o),!0)}))},kC=function(t,e){return!!t.selection.isCollapsed()&&CC(t,e)},xC=function(t,e,n){return t._selectionOverrides.hideFakeCaret(),mm(t,e,De.fromDom(n)),!0},SC=function(t,e){return t.selection.isCollapsed()?function(t,e){var n=e?mp:gp,r=e?Dl.Forwards:Dl.Backwards,o=uc(r,t.getBody(),t.selection.getRng());return n(o)?xC(t,e,o.getNode(!e)):$.from(r_(e,o)).filter((function(t){return n(t)&&dc(o,t)})).exists((function(n){return xC(t,e,n.getNode(!e))}))}(t,e):function(t,e){var n=t.selection.getNode();return!!Yn(n)&&xC(t,e,n)}(t,e)},OC=function(t){var e=parseInt(t,10);return isNaN(e)?0:e},EC=function(t,e){return(t||"table"===$e(e)?"margin":"padding")+("rtl"===ir(e,"direction")?"-right":"-left")},TC=function(t){var e=DC(t);return!t.mode.isReadOnly()&&(e.length>1||function(t,e){return et(e,(function(e){var n=EC(pu(t),e),r=sr(e,n).map(OC).getOr(0);return"false"!==t.dom.getContentEditable(e.dom)&&r>0}))}(t,e))},AC=function(t){return mo(t)||go(t)},DC=function(t){return Y((e=t.selection.getSelectedBlocks(),H(e,De.fromDom)),(function(t){return!AC(t)&&!function(t){return Ke(t).exists(AC)}(t)&&Xr(t,(function(t){return Vn(t.dom)||Wn(t.dom)})).exists((function(t){return Vn(t.dom)}))}));var e},NC=function(t,e){var n=t.dom,r=t.selection,o=t.formatter,i=function(t){return t.getParam("indentation","40px","string")}(t),a=/[a-z%]+$/i.exec(i)[0],s=parseInt(i,10),l=pu(t),u=nu(t);t.queryCommandState("InsertUnorderedList")||t.queryCommandState("InsertOrderedList")||""!==u||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),V(DC(t),(function(t){!function(t,e,n,r,o,i){var a=EC(n,De.fromDom(i));if("outdent"===e){var s=Math.max(0,OC(i.style[a])-r);t.setStyle(i,a,s?s+o:"")}else s=OC(i.style[a])+r+o,t.setStyle(i,a,s)}(n,e,l,s,a,t.dom)}))},LC=function(t,e){if(t.selection.isCollapsed()&&TC(t)){var n=t.dom,r=t.selection.getRng(),o=Al.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&Np(De.fromDom(i),o))return NC(t,"outdent"),!0}return!1},IC=function(t,e){t.getDoc().execCommand(e,!1,null)},jC=function(t,e){t.addCommand("delete",(function(){!function(t,e){LC(t)||H_(t,!1)||P_(t,!1)||bC(t,e,!1)||w_(t,!1)||Vm(t)||V_(t,!1)||SC(t,!1)||S_(t)||kC(t,!1)||(IC(t,"Delete"),l_(t))}(t,e)})),t.addCommand("forwardDelete",(function(){!function(t,e){H_(t,!0)||P_(t,!0)||bC(t,e,!0)||w_(t,!0)||Vm(t)||V_(t,!0)||SC(t,!0)||S_(t)||kC(t,!0)||IC(t,"ForwardDelete")}(t,e)}))},PC=function(t){return void 0===t.touches||1!==t.touches.length?$.none():$.some(t.touches[0])},RC=function(t){var e=Es(),n=ws(!1),r=As((function(e){t.fire("longpress",Dt(Dt({},e),{type:"longpress"})),n.set(!0)}),400);t.on("touchstart",(function(t){PC(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.throttle(t),n.set(!1),e.set(i)}))}),!0),t.on("touchmove",(function(o){r.cancel(),PC(o).each((function(r){e.on((function(o){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(r,o)&&(e.clear(),n.set(!1),t.fire("longpresscancel"))}))}))}),!0),t.on("touchend touchcancel",(function(o){r.cancel(),"touchcancel"!==o.type&&e.get().filter((function(t){return t.target.isEqualNode(o.target)})).each((function(){n.get()?o.preventDefault():t.fire("tap",Dt(Dt({},o),{type:"tap"}))}))}),!0)},$C=function(t,e){return _t(t,e.nodeName)},MC=function(t,e){return!!Bn(e)||!!Nn(e)&&(!$C(t,e)&&!Gc(e))},BC=function(t,e){if(Bn(e)){if(0===e.nodeValue.length)return!0;if(/^\s+$/.test(e.nodeValue)&&(!e.nextSibling||$C(t,e.nextSibling)))return!0}return!1},qC=function(t){var e,n,r,o=t.dom,i=t.selection,a=t.schema,s=a.getBlockElements(),l=i.getStart(),u=t.getBody(),c=nu(t);if(l&&Nn(l)&&c){var f=u.nodeName.toLowerCase();if(a.isValidChild(f,c.toLowerCase())&&!function(t,e,n){return U(Sp(De.fromDom(n),De.fromDom(e)),(function(e){return $C(t,e.dom)}))}(s,u,l)){var d=i.getRng(),h=d.startContainer,p=d.startOffset,m=d.endContainer,g=d.endOffset,v=_h(t);for(l=u.firstChild;l;)if(MC(s,l)){if(BC(s,l)){n=l,l=l.nextSibling,o.remove(n);continue}e||(e=o.create(c,ru(t)),l.parentNode.insertBefore(e,l),r=!0),n=l,l=l.nextSibling,e.appendChild(n)}else e=null,l=l.nextSibling;r&&v&&(d.setStart(h,p),d.setEnd(m,g),i.setRng(d),t.nodeChanged())}}},FC=function(t,e){e.hasAttribute("data-mce-caret")&&(Po(e),function(t){t.selection.setRng(t.selection.getRng())}(t),t.selection.scrollIntoView(e))},zC=function(t,e){var n=function(t){return Jr(De.fromDom(t.getBody()),"*[data-mce-caret]").map((function(t){return t.dom})).getOrNull()}(t);if(n)return"compositionstart"===e.type?(e.preventDefault(),e.stopPropagation(),void FC(t,n)):void(Ao(n)&&(FC(t,n),t.undoManager.add()))},UC=Wn,HC=function(t,e,n){var r=xc(t.getBody()),o=T(fc,1===e?r.next:r.prev);if(n.collapsed&&function(t){return""!==nu(t)}(t)){var i=t.dom.getParent(n.startContainer,"PRE");if(!i)return;if(!o(Al.fromRangeStart(n))){var a=function(t){var e=t.dom.create(nu(t));return(!ke.ie||ke.ie>=11)&&(e.innerHTML='
'),e}(t);1===e?t.$(i).after(a):t.$(i).before(a),t.selection.select(a,!0),t.selection.collapse()}}},VC=function(t,e){var n=e?Dl.Forwards:Dl.Backwards,r=t.selection.getRng();return function(t,e,n){return nC(e,t,n,bp,_p,UC)}(n,t,r).orThunk((function(){return HC(t,n,r),$.none()}))},WC=function(t,e){var n=e?1:-1,r=t.selection.getRng();return function(t,e,n){return rC(e,t,n,(function(t){return bp(t)||vp(t)}),(function(t){return _p(t)||yp(t)}),UC)}(n,t,r).orThunk((function(){return HC(t,n,r),$.none()}))},KC=function(t,e){return VC(t,e).exists((function(e){return tC(t,e),!0}))},YC=function(t,e){return WC(t,e).exists((function(e){return tC(t,e),!0}))},XC=function(t,e){return iC(t,e,e?_p:bp)},GC=function(t){return z(["figcaption"],$e(t))},ZC=function(t){var e=document.createRange();return e.setStartBefore(t.dom),e.setEndBefore(t.dom),e},JC=function(t,e,n){n?pn(t,e):hn(t,e)},QC=function(t,e,n,r){return""===e?function(t,e){var n=De.fromTag("br");return JC(t,n,e),ZC(n)}(t,r):function(t,e,n,r){var o=De.fromTag(n),i=De.fromTag("br");return tr(o,r),pn(o,i),JC(t,o,e),ZC(i)}(t,r,e,n)},tk=function(t,e,n){return e?function(t,e){return Iw(t,e).breakAt.isNone()}(t.dom,n):function(t,e){return Lw(t,e).breakAt.isNone()}(t.dom,n)},ek=function(t,e){var n=De.fromDom(t.getBody()),r=Al.fromRangeStart(t.selection.getRng()),o=nu(t),i=ru(t);return function(t,e){var n=T(je,e);return Xr(De.fromDom(t.container()),co,n).filter(GC)}(r,n).exists((function(){if(tk(n,e,r)){var a=QC(n,o,i,e);return t.selection.setRng(a),!0}return!1}))},nk=function(t,e){return!!t.selection.isCollapsed()&&ek(t,e)},rk=function(t,e){return tt(function(t){return H(t,(function(t){return Dt({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:C},t)}))}(t),(function(t){return function(t,e){return e.keyCode===t.keyCode&&e.shiftKey===t.shiftKey&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey}(t,e)?[t]:[]}))},ok=function(t){for(var e=[],n=1;ne})),dk=function(t,e){return at(e.getClientRects()).bind((function(e){return ck(t,e.left,e.top)})).bind((function(t){return Nw(Rc(n=t).map((function(t){return Lw(n,t).positions.concat(t)})).getOr([]),e);var n}))},hk=function(t,e){return st(e.getClientRects()).bind((function(e){return fk(t,e.left,e.top)})).bind((function(t){return Nw(Pc(n=t).map((function(t){return[t].concat(Iw(n,t).positions)})).getOr([]),e);var n}))},pk=function(t,e,n){var r=t(e,n);return function(t){return t.breakType===ww.Wrap&&0===t.positions.length}(r)||!Un(n.getNode())&&function(t){return t.breakType===ww.Br&&1===t.positions.length}(r)?!function(t,e,n){return n.breakAt.exists((function(n){return t(e,n).breakAt.isSome()}))}(t,e,r):r.breakAt.isNone()},mk=T(pk,Lw),gk=T(pk,Iw),vk=function(t,e,n,r){var o=t.selection.getRng(),i=e?1:-1;return!(!Bu()||!function(t,e,n){var r=Al.fromRangeStart(e);return Lc(!t,n).exists((function(t){return t.isEqual(r)}))}(e,o,n))&&(T_(i,t,n,!e,!1).each((function(e){tC(t,e)})),!0)},yk=function(t,e){var n=e.getNode(t);return Nn(n)&&"TABLE"===n.nodeName?$.some(n):$.none()},bk=function(t,e,n){var r=yk(!!e,n),o=!1===e;r.fold((function(){return tC(t,n.toRange())}),(function(r){return Lc(o,t.getBody()).filter((function(t){return t.isEqual(n)})).fold((function(){return tC(t,n.toRange())}),(function(o){return function(t,e,n,r){var o=nu(e);o?e.undoManager.transact((function(){var r=De.fromTag(o);tr(r,ru(e)),pn(r,De.fromTag("br")),t?dn(De.fromDom(n),r):fn(De.fromDom(n),r);var i=e.dom.createRng();i.setStart(r.dom,0),i.setEnd(r.dom,0),tC(e,i)})):tC(e,r.toRange())}(e,t,r,n)}))}))},_k=function(t,e,n,r){var o=t.selection.getRng(),i=Al.fromRangeStart(o),a=t.getBody();if(!e&&mk(r,i)){var s=function(t,e,n){return dk(e,n).orThunk((function(){return at(n.getClientRects()).bind((function(n){return Dw(jw(t,Al.before(e)),n.left)}))})).getOr(Al.before(e))}(a,n,i);return bk(t,e,s),!0}if(e&&gk(r,i)){s=function(t,e,n){return hk(e,n).orThunk((function(){return at(n.getClientRects()).bind((function(n){return Dw(Pw(t,Al.after(e)),n.left)}))})).getOr(Al.after(e))}(a,n,i);return bk(t,e,s),!0}return!1},wk=function(t,e,n){return $.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind((function(r){return $.from(t.dom.getParent(r,"table")).map((function(o){return n(t,e,o,r)}))})).getOr(!1)},Ck=function(t,e){return wk(t,e,vk)},kk=function(t,e){return wk(t,e,_k)},xk=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){var r=pe().os;ik([{keyCode:id.RIGHT,action:ok(KC,t,!0)},{keyCode:id.LEFT,action:ok(KC,t,!1)},{keyCode:id.UP,action:ok(YC,t,!1)},{keyCode:id.DOWN,action:ok(YC,t,!0)},{keyCode:id.RIGHT,action:ok(Ck,t,!0)},{keyCode:id.LEFT,action:ok(Ck,t,!1)},{keyCode:id.UP,action:ok(kk,t,!1)},{keyCode:id.DOWN,action:ok(kk,t,!0)},{keyCode:id.RIGHT,action:ok(ak,t,!0)},{keyCode:id.LEFT,action:ok(ak,t,!1)},{keyCode:id.UP,action:ok(sk,t,!1)},{keyCode:id.DOWN,action:ok(sk,t,!0)},{keyCode:id.RIGHT,action:ok(cC,t,e,!0)},{keyCode:id.LEFT,action:ok(cC,t,e,!1)},{keyCode:id.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:ok(hC,t,e)},{keyCode:id.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:ok(pC,t,e)},{keyCode:id.UP,action:ok(nk,t,!1)},{keyCode:id.DOWN,action:ok(nk,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)}))},Sk=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){ik([{keyCode:id.BACKSPACE,action:ok(LC,t,!1)},{keyCode:id.BACKSPACE,action:ok(H_,t,!1)},{keyCode:id.DELETE,action:ok(H_,t,!0)},{keyCode:id.BACKSPACE,action:ok(P_,t,!1)},{keyCode:id.DELETE,action:ok(P_,t,!0)},{keyCode:id.BACKSPACE,action:ok(bC,t,e,!1)},{keyCode:id.DELETE,action:ok(bC,t,e,!0)},{keyCode:id.BACKSPACE,action:ok(Vm,t,!1)},{keyCode:id.DELETE,action:ok(Vm,t,!0)},{keyCode:id.BACKSPACE,action:ok(V_,t,!1)},{keyCode:id.DELETE,action:ok(V_,t,!0)},{keyCode:id.BACKSPACE,action:ok(SC,t,!1)},{keyCode:id.DELETE,action:ok(SC,t,!0)},{keyCode:id.BACKSPACE,action:ok(S_,t,!1)},{keyCode:id.DELETE,action:ok(S_,t,!0)},{keyCode:id.BACKSPACE,action:ok(w_,t,!1)},{keyCode:id.DELETE,action:ok(w_,t,!0)},{keyCode:id.BACKSPACE,action:ok(kC,t,!1)},{keyCode:id.DELETE,action:ok(kC,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)})),t.on("keyup",(function(e){!1===e.isDefaultPrevented()&&function(t,e){ik([{keyCode:id.BACKSPACE,action:ok(U_,t)},{keyCode:id.DELETE,action:ok(U_,t)}],e)}(t,e)}))},Ok=function(t,e){var n,r=e,o=t.dom,i=t.schema.getMoveCaretBeforeOnEnterElements();if(e){if(/^(LI|DT|DD)$/.test(e.nodeName)){var a=function(t){for(;t;){if(1===t.nodeType||3===t.nodeType&&t.data&&/[\r\n\s]/.test(t.data))return t;t=t.nextSibling}}(e.firstChild);a&&/^(UL|OL|DL)$/.test(a.nodeName)&&e.insertBefore(o.doc.createTextNode(_o),e.firstChild)}var s=o.createRng();if(e.normalize(),e.hasChildNodes()){for(var l=new so(e,e);n=l.current();){if(Bn(n)){s.setStart(n,0),s.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){s.setStartBefore(n),s.setEndBefore(n);break}r=n,n=l.next()}n||(s.setStart(r,0),s.setEnd(r,0))}else Un(e)?e.nextSibling&&o.isBlock(e.nextSibling)?(s.setStartBefore(e),s.setEndBefore(e)):(s.setStartAfter(e),s.setEndAfter(e)):(s.setStart(e,0),s.setEnd(e,0));t.selection.setRng(s),Hd(t,s)}},Ek=function(t){return $.from(t.dom.getParent(t.selection.getStart(!0),t.dom.isBlock))},Tk=function(t,e){return t&&t.parentNode&&t.parentNode.nodeName===e},Ak=function(t){return t&&/^(OL|UL|LI)$/.test(t.nodeName)},Dk=function(t){var e=t.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:t},Nk=function(t,e,n){for(var r=t[n?"firstChild":"lastChild"];r&&!Nn(r);)r=r[n?"nextSibling":"previousSibling"];return r===e},Lk=function(t,e,n,r,o){var i=t.dom,a=t.selection.getRng();if(n!==t.getBody()){var s;Ak(s=n)&&Ak(s.parentNode)&&(o="LI");var l=o?e(o):i.create("BR");if(Nk(n,r,!0)&&Nk(n,r,!1))if(Tk(n,"LI")){var u=Dk(n);i.insertAfter(l,u),!function(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.firstChild)===t}(n)?i.remove(n):i.remove(u)}else i.replace(l,n);else if(Nk(n,r,!0))Tk(n,"LI")?(i.insertAfter(l,Dk(n)),l.appendChild(i.doc.createTextNode(" ")),l.appendChild(n)):n.parentNode.insertBefore(l,n),i.remove(r);else if(Nk(n,r,!1))i.insertAfter(l,Dk(n)),i.remove(r);else{n=Dk(n);var c=a.cloneRange();c.setStartAfter(r),c.setEndAfter(n);var f=c.extractContents();"LI"===o&&function(t,e){return t.firstChild&&t.firstChild.nodeName===e}(f,"LI")?(l=f.firstChild,i.insertAfter(f,n)):(i.insertAfter(f,n),i.insertAfter(l,n)),i.remove(r)}Ok(t,l)}},Ik=function(t,e){return e&&"A"===e.nodeName&&t.isEmpty(e)},jk=function(t){t.innerHTML='
'},Pk=function(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e},Rk=function(t,e){return e&&t.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==t.getContentEditable(e)},$k=function(t,e,n){return!1===Bn(e)?n:t?1===n&&e.data.charAt(n-1)===wo?0:n:n===e.data.length-1&&e.data.charAt(n)===wo?e.data.length:n},Mk=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},Bk=function(t,e){var n=nu(t);n&&n.toLowerCase()===e.tagName.toLowerCase()&&function(t,e,n){var r=t.dom;$.from(n.style).map(r.parseStyle).each((function(t){var n=lr(De.fromDom(e)),o=Dt(Dt({},n),t);r.setStyles(e,o)}));var o=$.from(n.class).map((function(t){return t.split(/\s+/)})),i=$.from(e.className).map((function(t){return Y(t.split(/\s+/),(function(t){return""!==t}))}));Gn(o,i,(function(t,n){var o=Y(n,(function(e){return!z(t,e)})),i=Nt(Nt([],t,!0),o,!0);r.setAttrib(e,"class",i.join(" "))}));var a=["style","class"],s=vt(n,(function(t,e){return!z(a,e)}));r.setAttribs(e,s)}(t,e,ru(t))},qk=function(t,e){var n,r,o,i,a,s,l,u,c,f,d=t.dom,h=t.schema,p=h.getNonEmptyElements(),m=t.selection.getRng(),g=function(e){var n,o,a,s=r,l=h.getTextInlineElements();if(a=n=e||"TABLE"===u||"HR"===u?d.create(e||c):i.cloneNode(!1),!1===function(t){return t.getParam("keep_styles",!0)}(t))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(l[s.nodeName]){if(Mc(s)||Gc(s))continue;o=s.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(a=o,n.appendChild(o))}}while((s=s.parentNode)&&s!==w);return Bk(t,n),jk(a),n},v=function(t){var e,n,a=$k(t,r,o);if(Bn(r)&&(t?a>0:ar.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=f&&Bn(r)?r.nodeValue.length:0);var w=Mk(d,r);if(w){(c&&!b||!c&&b)&&(r=function(t,e,n,r,o){var i,a,s,l,u,c,f=e||"P",d=t.dom,h=Mk(d,r);if(!(a=d.getParent(r,d.isBlock))||!Rk(d,a)){if(c=(a=a||h)===t.getBody()||function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)}(a)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=d.create(f),Bk(t,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(l=r;l.parentNode!==a;)l=l.parentNode;for(;l&&!d.isBlock(l);)s=l,l=l.previousSibling;if(s&&t.schema.isValidChild(c,f.toLowerCase())){for(i=d.create(f),Bk(t,i),s.parentNode.insertBefore(i,s),l=s;l&&!d.isBlock(l);)u=l.nextSibling,i.appendChild(l),l=u;n.setStart(r,o),n.setEnd(r,o)}}return r}(t,c,m,r,o)),i=d.getParent(r,d.isBlock),l=i?d.getParent(i.parentNode,d.isBlock):null,u=i?i.nodeName.toUpperCase():"";var C=l?l.nodeName.toUpperCase():"";"LI"!==C||_||(i=l,l=l.parentNode,u=C),/^(LI|DT|DD)$/.test(u)&&d.isEmpty(i)?Lk(t,g,l,i,c):c&&i===t.getBody()||(c=c||"P",Oo(i)?(a=Po(i),d.isEmpty(i)&&jk(i),Bk(t,a),Ok(t,a)):v()?y():v(!0)?(a=i.parentNode.insertBefore(g(),i),Ok(t,Pk(i,"HR")?a:i)):(n=function(t){var e=t.cloneRange();return e.setStart(t.startContainer,$k(!0,t.startContainer,t.startOffset)),e.setEnd(t.endContainer,$k(!1,t.endContainer,t.endOffset)),e}(m).cloneRange(),n.setEndAfter(i),function(t){V($s(De.fromDom(t),Fe),(function(t){var e=t.dom;e.nodeValue=ko(e.nodeValue)}))}(s=n.extractContents()),function(t){do{Bn(t)&&(t.nodeValue=t.nodeValue.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)}(s),a=s.firstChild,d.insertAfter(s,i),function(t,e,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(t.isBlock(o))return;Nn(o)&&!e[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)(!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue||Ik(t,o))&&t.remove(o)}}(d,p,a),function(t,e){e.normalize();var n=e.lastChild;n&&!/^(left|right)$/gi.test(t.getStyle(n,"float",!0))||t.add(e,"br")}(d,i),d.isEmpty(i)&&jk(i),a.normalize(),d.isEmpty(a)?(d.remove(a),y()):(Bk(t,a),Ok(t,a))),d.setAttrib(a,"id",""),t.fire("NewBlock",{newBlock:a}))}},Fk=function(t,e,n){var r=t.dom.createRng();n?(r.setStartBefore(e),r.setEndBefore(e)):(r.setStartAfter(e),r.setEndAfter(e)),t.selection.setRng(r),Hd(t,r)},zk=function(t,e){var n,r,o=t.selection,i=t.dom,a=o.getRng();bd(i,a).each((function(t){a.setStart(t.startContainer,t.startOffset),a.setEnd(t.endContainer,t.endOffset)}));var s=a.startOffset,l=a.startContainer;if(1===l.nodeType&&l.hasChildNodes()){var u=s>l.childNodes.length-1;l=l.childNodes[Math.min(s,l.childNodes.length-1)]||l,s=u&&3===l.nodeType?l.nodeValue.length:0}var c=i.getParent(l,i.isBlock),f=c?i.getParent(c.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",h=!(!e||!e.ctrlKey);"LI"!==d||h||(c=f),l&&3===l.nodeType&&s>=l.nodeValue.length&&(function(t,e,n){for(var r,o=new so(e,n),i=t.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return!0}(t.schema,l,c)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),Ll(i,a,n),Fk(t,n,r),t.undoManager.add()},Uk=function(t,e){var n=De.fromTag("br");fn(De.fromDom(e),n),t.undoManager.add()},Hk=function(t,e){Vk(t.getBody(),e)||dn(De.fromDom(e),De.fromTag("br"));var n=De.fromTag("br");dn(De.fromDom(e),n),Fk(t,n.dom,!1),t.undoManager.add()},Vk=function(t,e){return n=Al.after(e),!!Un(n.getNode())||Ic(t,Al.after(e)).map((function(t){return Un(t.getNode())})).getOr(!1);var n},Wk=function(t){return t&&"A"===t.nodeName&&"href"in t},Kk=function(t){return t.fold(L,Wk,Wk,L)},Yk=function(t,e){e.fold(C,T(Uk,t),T(Hk,t),C)},Xk=function(t,e){var n=function(t){var e=T(t_,t),n=Al.fromRangeStart(t.selection.getRng());return dw(e,t.getBody(),n).filter(Kk)}(t);n.isSome()?n.each(T(Yk,t)):zk(t,e)},Gk=function(t,e){return Ek(t).filter((function(t){return e.length>0&&Le(De.fromDom(t),e)})).isSome()},Zk=Sr([{br:[]},{block:[]},{none:[]}]),Jk=function(t,e){return function(t){return Gk(t,function(t){return t.getParam("no_newline_selector","")}(t))}(t)},Qk=function(t){return function(e,n){return""===nu(e)===t}},tx=function(t){return function(e,n){return function(t){return Ek(t).filter((function(t){return go(De.fromDom(t))})).isSome()}(e)===t}},ex=function(t,e){return function(n,r){var o=function(t){return Ek(t).fold(S(""),(function(t){return t.nodeName.toUpperCase()}))}(n)===t.toUpperCase();return o===e}},nx=function(t){return ex("pre",t)},rx=function(t){return function(e,n){return function(t){return t.getParam("br_in_pre",!0)}(e)===t}},ox=function(t,e){return function(t){return Gk(t,function(t){return t.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")}(t))}(t)},ix=function(t,e){return e},ax=function(t){var e=nu(t),n=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o}(t.dom,t.selection.getStart());return n&&t.schema.isValidChild(n.nodeName,e||"P")},sx=function(t,e){return function(n,r){return G(t,(function(t,e){return t&&e(n,r)}),!0)?$.some(e):$.none()}},lx=function(t,e){(function(t,e){return nw([sx([Jk],Zk.none()),sx([ex("summary",!0)],Zk.br()),sx([nx(!0),rx(!1),ix],Zk.br()),sx([nx(!0),rx(!1)],Zk.block()),sx([nx(!0),rx(!0),ix],Zk.block()),sx([nx(!0),rx(!0)],Zk.br()),sx([tx(!0),ix],Zk.br()),sx([tx(!0)],Zk.block()),sx([Qk(!0),ix,ax],Zk.block()),sx([Qk(!0)],Zk.br()),sx([ox],Zk.br()),sx([Qk(!1),ix],Zk.br()),sx([ax],Zk.block())],[t,!(!e||!e.shiftKey)]).getOr(Zk.none())})(t,e).fold((function(){Xk(t,e)}),(function(){qk(t,e)}),C)},ux=function(t){t.on("keydown",(function(e){e.keyCode===id.ENTER&&function(t,e){var n;e.isDefaultPrevented()||(e.preventDefault(),(n=t.undoManager).typing&&(n.typing=!1,n.add()),t.undoManager.transact((function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),lx(t,e)})))}(t,e)}))},cx=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){ik([{keyCode:id.END,action:ok(XC,t,!0)},{keyCode:id.HOME,action:ok(XC,t,!1)},{keyCode:id.END,action:ok(lk,t,!0)},{keyCode:id.HOME,action:ok(lk,t,!1)},{keyCode:id.END,action:ok(mC,t,!0,e)},{keyCode:id.HOME,action:ok(mC,t,!1,e)}],n).each((function(t){n.preventDefault()}))}(t,e,n)}))},fx=pe().browser,dx=function(t){!function(t){var e=Ts((function(){t.composing||tm(t)}),0);fx.isIE()&&(t.on("keypress",(function(t){e.throttle()})),t.on("remove",(function(t){e.cancel()})))}(t),t.on("input",(function(e){!1===e.isComposing&&tm(t)}))},hx=pe(),px=function(t){return t.stopImmediatePropagation()},mx=function(t){return t.keyCode===id.PAGE_UP||t.keyCode===id.PAGE_DOWN},gx=function(t,e,n){n&&!t.get()?e.on("NodeChange",px,!0):!n&&t.get()&&e.off("NodeChange",px),t.set(n)},vx=function(t,e){if(!hx.os.isOSX()){var n=ws(!1);t.on("keydown",(function(e){mx(e)&&gx(n,t,!0)})),t.on("keyup",(function(r){!1===r.isDefaultPrevented()&&function(t,e,n){ik([{keyCode:id.PAGE_UP,action:ok(mC,t,!1,e)},{keyCode:id.PAGE_DOWN,action:ok(mC,t,!0,e)}],n)}(t,e,r),mx(r)&&n.get()&&(gx(n,t,!1),t.nodeChanged())}))}},yx=function(t,e){var n=e.container(),r=e.offset();return Bn(n)?(n.insertData(r,t),$.some(Al(n,r+t.length))):cc(e).map((function(n){var r=De.fromText(t);return e.isAtEnd()?dn(n,r):fn(n,r),Al(r.dom,t.length)}))},bx=T(yx,_o),_x=T(yx," "),wx=function(t,e){return function(n){return function(t,e){return!Vp(e)&&(Wp(t,e)||Up(t,e)||Hp(t,e))}(t,n)?bx(e):_x(e)}},Cx=function(t){var e=Al.fromRangeStart(t.selection.getRng()),n=De.fromDom(t.getBody());if(t.selection.isCollapsed()){var r=T(t_,t),o=Al.fromRangeStart(t.selection.getRng());return dw(r,t.getBody(),o).bind(function(t){return function(e){return e.fold((function(e){return jc(t.dom,Al.before(e))}),(function(t){return Pc(t)}),(function(t){return Rc(t)}),(function(e){return Ic(t.dom,Al.after(e))}))}}(n)).bind(wx(n,e)).exists(function(t){return function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}}(t))}return!1},kx=function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&function(t,e){ik([{keyCode:id.SPACEBAR,action:ok(Cx,t)}],e).each((function(t){e.preventDefault()}))}(t,e)}))},xx=function(t){var e=dC(t);return function(t){t.on("keyup compositionstart",T(zC,t))}(t),xk(t,e),Sk(t,e),ux(t),kx(t),dx(t),cx(t,e),vx(t,e),e},Sx=function(){function t(t){var e;this.lastPath=[],this.editor=t;var n=this;"onselectionchange"in t.getDoc()||t.on("NodeChange click mouseup keyup focus",(function(n){var r=t.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&cd(o,e)||t.fire("SelectionChange"),e=o})),t.on("contextmenu",(function(){t.fire("SelectionChange")})),t.on("SelectionChange",(function(){var e=t.selection.getStart(!0);!e||!ke.range&&t.selection.isCollapsed()||Uf(t)&&!n.isSameElementPath(e)&&t.dom.isChildOf(e,t.getBody())&&t.nodeChanged({selectionChange:!0})})),t.on("mouseup",(function(e){!e.isDefaultPrevented()&&Uf(t)&&("IMG"===t.selection.getNode().nodeName?oo.setEditorTimeout(t,(function(){t.nodeChanged()})):t.nodeChanged())}))}return t.prototype.nodeChanged=function(t){var e,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(e=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(e,r)||(e=r),n=[],this.editor.dom.getParent(e,(function(t){if(t===r)return!0;n.push(t)})),(t=t||{}).element=e,t.parents=n,this.editor.fire("NodeChange",t))},t.prototype.isSameElementPath=function(t){var e,n=this.editor.$(t).parentsUntil(this.editor.getBody()).add(t);if(n.length===this.lastPath.length){for(e=n.length;e>=0&&n[e]===this.lastPath[e];e--);if(-1===e)return this.lastPath=n,!0}return this.lastPath=n,!1},t}(),Ox=function(t){!function(t){t.on("click",(function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}))}(t),function(t){t.parser.addNodeFilter("details",(function(t){V(t,(function(t){t.attr("data-mce-open",t.attr("open")),t.attr("open","open")}))})),t.serializer.addNodeFilter("details",(function(t){V(t,(function(t){var e=t.attr("data-mce-open");t.attr("open",d(e)?e:null),t.attr("data-mce-open",null)}))}))}(t)},Ex=function(t){return Nn(t)&&po(De.fromDom(t))},Tx=function(t){t.on("click",(function(e){e.detail>=3&&function(t){var e=t.selection.getRng(),n=Al.fromRangeStart(e),r=Al.fromRangeEnd(e);if(Al.isElementPosition(n)){var o=n.container();Ex(o)&&Pc(o).each((function(t){return e.setStart(t.container(),t.offset())}))}Al.isElementPosition(r)&&(o=n.container(),Ex(o)&&Rc(o).each((function(t){return e.setEnd(t.container(),t.offset())})));t.selection.setRng(Km(e))}(t)}))},Ax=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:e.top+o.pageYOffset-r.clientTop,left:e.left+o.pageXOffset-r.clientLeft}},Dx=function(t,e){return n=function(t){return t.inline?Ax(t.getBody()):{left:0,top:0}}(t),r=function(t){var e=t.getBody();return t.inline?{left:e.scrollLeft,top:e.scrollTop}:{left:0,top:0}}(t),o=function(t,e){if(e.target.ownerDocument!==t.getDoc()){var n=Ax(t.getContentAreaContainer()),r=function(t){var e=t.getBody(),n=t.getDoc().documentElement,r={left:e.scrollLeft,top:e.scrollTop},o={left:e.scrollLeft||n.scrollLeft,top:e.scrollTop||n.scrollTop};return t.inline?r:o}(t);return{left:e.pageX-n.left+r.left,top:e.pageY-n.top+r.top}}return{left:e.pageX,top:e.pageY}}(t,e),{pageX:o.left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o},Nx=Wn,Lx=Vn,Ix=function(t,e,n,r){var o=t.dom,i=e.cloneNode(!0);o.setStyles(i,{width:n,height:r}),o.setAttrib(i,"data-mce-selected",null);var a=o.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return o.setStyles(a,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),o.setStyles(i,{margin:0,boxSizing:"border-box"}),a.appendChild(i),a},jx=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},Px=function(t,e){return function(n){if(function(t){return 0===t.button}(n)){var r=J(e.dom.getParents(n.target),function(){for(var t=[],e=0;e10){if(e.fire("dragstart",{target:t.element}).isDefaultPrevented())return;t.dragging=!0,e.focus()}if(t.dragging){var s=function(t,e){return{pageX:e.pageX-t.relX,pageY:e.pageY+5}}(t,Dx(e,r));o=t.ghost,i=e.getBody(),o.parentNode!==i&&i.appendChild(o),function(t,e,n,r,o,i){var a=0,s=0;t.style.left=e.pageX+"px",t.style.top=e.pageY+"px",e.pageX+n>o&&(a=e.pageX+n-o),e.pageY+r>i&&(s=e.pageY+r-i),t.style.width=n-a+"px",t.style.height=r-s+"px"}(t.ghost,s,t.width,t.height,t.maxX,t.maxY),n(r.clientX,r.clientY)}}))}}(e,t),a=Rx(e,t),s=function(t,e){return function(){t.on((function(t){t.dragging&&e.fire("dragend")})),$x(t)}}(e,t);t.on("mousedown",o),t.on("mousemove",i),t.on("mouseup",a),n.bind(r,"mousemove",i),n.bind(r,"mouseup",s),t.on("remove",(function(){n.unbind(r,"mousemove",i),n.unbind(r,"mouseup",s)})),t.on("keydown",(function(t){t.keyCode===id.ESC&&s()}))},Bx=function(t){Mx(t),function(t){t.on("drop",(function(e){var n=void 0!==e.clientX?t.getDoc().elementFromPoint(e.clientX,e.clientY):null;(Nx(n)||"false"===t.dom.getContentEditableParent(n))&&e.preventDefault()}))}(t),function(t){return t.getParam("block_unsupported_drop",!0,"boolean")}(t)&&function(t){var e=function(e){if(!e.isDefaultPrevented()){var n=e.dataTransfer;n&&(z(n.types,"Files")||n.files.length>0)&&(e.preventDefault(),"drop"===e.type&&xb(t,"Dropped file type is not supported"))}},n=function(n){hh(t,n.target)&&e(n)},r=function(){var r=gs.DOM,o=t.dom,i=document,a=t.inline?t.getBody():t.getDoc(),s=["drop","dragover"];V(s,(function(t){r.bind(i,t,n),o.bind(a,t,e)})),t.on("remove",(function(){V(s,(function(t){r.unbind(i,t,n),o.unbind(a,t,e)}))}))};t.on("init",(function(){oo.setEditorTimeout(t,r,0)}))}(t)},qx=Vn,Fx=Wn,zx=function(t,e){return td(t.getBody(),e)},Ux=function(t){var e,n=t.selection,r=t.dom,o=r.isBlock,i=t.getBody(),a=Mu(t,i,o,(function(){return _h(t)})),s="sel-"+r.uniqueId(),l="data-mce-selected",u=function(t){return t!==i&&(Fx(t)||Yn(t))&&r.isChildOf(t,i)},c=function(t){return bp(t)||_p(t)||mp(t)||gp(t)},f=function(t){t&&n.setRng(t)},d=n.getRng,h=function(e,r,o,i){return void 0===i&&(i=!0),t.fire("ShowCaret",{target:r,direction:e,before:o}).isDefaultPrevented()?null:(i&&n.scrollIntoView(r,-1===e),a.show(o,r))},p=function(t){return To(t)||Io(t)||jo(t)},m=function(t){return p(t.startContainer)||p(t.endContainer)},g=function(e){var n=t.schema.getShortEndedElements(),o=r.createRng(),i=e.startContainer,a=e.startOffset,s=e.endContainer,l=e.endOffset;return _t(n,i.nodeName.toLowerCase())?0===a?o.setStartBefore(i):o.setStartAfter(i):o.setStart(i,a),_t(n,s.nodeName.toLowerCase())?0===l?o.setEndBefore(s):o.setEndAfter(s):o.setEnd(s,l),o},v=function(o){var i=o.cloneNode(!0),a=t.fire("ObjectSelected",{target:o,targetClone:i});if(a.isDefaultPrevented())return null;var u=function(e,o,i){var a=t.$,l=Jr(De.fromDom(t.getBody()),"#"+s).fold((function(){return a([])}),(function(t){return a([t.dom])}));0===l.length&&(l=a('').attr("id",s)).appendTo(t.getBody());var u=r.createRng();o===i&&ke.ie?(l.empty().append('
').append(o),u.setStartAfter(l[0].firstChild.firstChild),u.setEndAfter(o)):(l.empty().append(_o).append(o).append(_o),u.setStart(l[0].firstChild,1),u.setEnd(l[0].lastChild,0)),l.css({top:r.getPos(e,t.getBody()).y}),l[0].focus();var c=n.getSel();return c.removeAllRanges(),c.addRange(u),u}(o,a.targetClone,i),c=De.fromDom(o);return V(Ms(De.fromDom(t.getBody()),"*[data-mce-selected]"),(function(t){je(c,t)||rr(t,l)})),r.getAttrib(o,l)||o.setAttribute(l,"1"),e=o,w(),u},b=function(t,e){if(!t)return null;if(t.collapsed){if(!m(t)){var n=e?1:-1,o=uc(n,i,t),a=o.getNode(!e);if(Fu(a))return h(n,a,!!e&&!o.isAtEnd(),!1);var s=o.getNode(e);if(Fu(s))return h(n,s,!e&&!o.isAtEnd(),!1)}return null}var l=t.startContainer,c=t.startOffset,f=t.endOffset;if(3===l.nodeType&&0===c&&Fx(l.parentNode)&&(l=l.parentNode,c=r.nodeIndex(l),l=l.parentNode),1!==l.nodeType)return null;if(f===c+1&&l===t.endContainer){var d=l.childNodes[c];if(u(d))return v(d)}return null},_=function(){e&&e.removeAttribute(l),Jr(De.fromDom(t.getBody()),"#"+s).each(vn),e=null},w=function(){a.hide()};return ke.ceFalse&&!Zv(t)&&function(){t.on("mouseup",(function(e){var n=d();n.collapsed&&vb(t,e.clientX,e.clientY)&&D_(t,n,!1).each(f)})),t.on("click",(function(e){var o=zx(t,e.target);o&&(Fx(o)&&(e.preventDefault(),t.focus()),qx(o)&&r.isChildOf(o,n.getNode())&&_())})),t.on("blur NewBlock",_),t.on("ResizeWindow FullscreenStateChanged",a.reposition);var l=function(e,n){var i,a,s=r.getParent(e,o),l=r.getParent(n,o);return!y(s)&&(!(e===l||!r.isChildOf(s,l)||!1!==Fx(zx(t,s)))||!r.isChildOf(l,s)&&(i=s,a=l,!(r.getParent(i,o)===r.getParent(a,o)))&&function(t){var e=t.firstChild;if(y(e))return!1;var n=Al.before(e);if(Un(n.getNode())&&1===t.childNodes.length)return!c(n);var r=xc(t).next(n);return r&&!c(r)}(s))};t.on("tap",(function(e){var n=e.target,r=zx(t,n);Fx(r)?(e.preventDefault(),A_(t,r).each(b)):u(n)&&A_(t,n).each(b)}),!0),t.on("mousedown",(function(e){var o=e.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==vb(t,e.clientX,e.clientY)){var a=zx(t,o);if(a)Fx(a)?(e.preventDefault(),A_(t,a).each(b)):(_(),qx(a)&&e.shiftKey||ed(e.clientX,e.clientY,n.getRng())||(w(),n.placeCaretAt(e.clientX,e.clientY)));else if(u(o))A_(t,o).each(b);else if(!1===Fu(o)){_(),w();var s=Qw(i,e.clientX,e.clientY);if(s&&!l(o,s.node)){e.preventDefault();var c=h(1,s.node,s.before,!1);f(c),t.getBody().focus()}}}})),t.on("keypress",(function(t){id.modifierPressed(t)||Fx(n.getNode())&&t.preventDefault()})),t.on("GetSelectionRange",(function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);(n=n.cloneRange()).selectNode(e),t.range=n}})),t.on("SetSelectionRange",(function(t){t.range=g(t.range);var e=b(t.range,t.forward);e&&(t.range=e)})),t.on("AfterSetSelectionRange",(function(t){var e,n=t.range,o=n.startContainer.parentNode;m(n)||"mcepastebin"===o.id||w(),e=o,r.hasClass(e,"mce-offscreen-selection")||_()})),t.on("copy",(function(t){var e,n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!ke.ie){var o=(e=r.get(s))?e.getElementsByTagName("*")[0]:e;o&&(t.preventDefault(),n.clearData(),n.setData("text/html",o.outerHTML),n.setData("text/plain",o.outerText||o.innerText))}})),Bx(t),function(t){var e=Ts((function(){if(!t.removed&&t.getBody().contains(document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var n=N_(t,e,!1);t.selection.setRng(n)}}}),0);t.on("focus",(function(){e.throttle()})),t.on("blur",(function(){e.cancel()}))}(t),function(t){t.on("init",(function(){t.on("focusin",(function(e){var n=e.target;if(Yn(n)){var r=td(t.getBody(),n),o=Wn(r)?r:n;t.selection.getNode()!==o&&A_(t,o).each((function(e){return t.selection.setRng(e)}))}}))}))}(t)}(),{showCaret:h,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(Po(t),f(d()),n.scrollIntoView(t))},hideFakeCaret:w,destroy:function(){a.destroy(),e=null}}},Hx=function(t){var e,n,r=Te.each,o=id.BACKSPACE,i=id.DELETE,a=t.dom,s=t.selection,l=t.parser,u=ke.gecko,c=ke.ie,f=ke.webkit,d="data:text/mce-internal,",h=c?"Text":"URL",p=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},m=function(t){return t.isDefaultPrevented()},g=function(){var e=function(t){var e=a.create("body"),n=t.cloneContents();return e.appendChild(n),s.serializer.serialize(e,{format:"html"})};t.on("keydown",(function(n){var r,s,l=n.keyCode;if(!m(n)&&(l===i||l===o)){if(r=t.selection.isCollapsed(),s=t.getBody(),r&&!a.isEmpty(s))return;if(!r&&!function(n){var r=e(n),o=a.createRng();return o.selectNode(t.getBody()),r===e(o)}(t.selection.getRng()))return;n.preventDefault(),t.setContent(""),s.firstChild&&a.isBlock(s.firstChild)?t.selection.setCursorLocation(s.firstChild,0):t.selection.setCursorLocation(s,0),t.nodeChanged()}}))},v=function(){t.shortcuts.add("meta+a",null,"SelectAll")},y=function(){t.inline||a.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;if(e.target===t.getDoc().documentElement)if(n=s.getRng(),t.getBody().focus(),"mousedown"===e.type){if(To(n.startContainer))return;s.placeCaretAt(e.clientX,e.clientY)}else s.setRng(n)}))},b=function(){Range.prototype.getClientRects||t.on("mousedown",(function(e){if(!m(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),oo.setEditorTimeout(t,(function(){n.focus()}))}}))},_=function(){t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==a.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&a.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),s.select(n))}))},w=function(){t.on("keydown",(function(t){if(!m(t)&&t.keyCode===o&&s.isCollapsed()&&0===s.getRng().startOffset){var e=s.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))},k=function(){(function(t){return t.getParam("readonly")})(t)||t.on("BeforeExecCommand mousedown",(function(){p("StyleWithCSS",!1),p("enableInlineTableEditing",!1),gu(t)||p("enableObjectResizing",!1)}))},x=function(){t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||r(a.select("a"),(function(t){var e=t.parentNode,n=a.getRoot();if(e.lastChild===t){for(;e&&!a.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}a.add(e,"br",{"data-mce-bogus":1})}}))}))},S=function(){t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},O=function(){t.inline||t.on("keydown",(function(){document.activeElement===document.body&&t.getWin().focus()}))},E=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(ke.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))},T=function(){ke.mac&&t.on("keydown",(function(e){!id.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}))},A=function(){t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},D=function(){t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))}))},N=function(){t.on("dragstart",(function(e){!function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&s.select(e.target),(n=t.selection.getContent()).length>0&&(r=d+escape(t.id)+","+escape(n),e.dataTransfer.setData(h,r)))}(e)})),t.on("drop",(function(e){if(!m(e)){var n=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(h))&&e.indexOf(d)>=0?(e=e.substr(d.length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=ud(e.x,e.y,t.getDoc());s.setRng(r),o=n.html,i=!0,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:o,internal:i}):t.execCommand("mceInsertContent",!1,o)}}var o,i}))},L=C;return Zv(t)?(f&&(y(),_(),D(),v(),ke.iOS&&(O(),E(),A())),u&&(b(),k(),S(),T())):(t.on("keydown",(function(e){var n,r;if(!m(e)&&e.keyCode===id.BACKSPACE){var o=(n=s.getRng()).startContainer,i=n.startOffset,l=a.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==l;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),(n=a.createRng()).setStart(o,0),n.setEnd(o,0),s.setRng(n))}}})),g(),ke.windowsPhone||t.on("keyup focusin mouseup",(function(t){id.modifierPressed(t)||s.normalize()}),!0),f&&(y(),_(),nu(t)&&t.on("init",(function(){p("DefaultParagraphSeparator",nu(t))})),D(),w(),l.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),ke.iOS?(O(),E(),A()):v()),ke.ie>=11&&(E(),w()),ke.ie&&(v(),p("AutoUrlDetect",!1),N()),u&&(t.on("keydown",(function(e){if(!m(e)&&e.keyCode===o){if(!t.getBody().getElementsByTagName("hr").length)return;if(s.isCollapsed()&&0===s.getRng().startOffset){var n=s.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return a.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(a.remove(r),e.preventDefault())}}})),b(),e=function(){var e=a.getAttribs(s.getStart().cloneNode(!1));return function(){var n=s.getStart();n!==t.getBody()&&(a.setAttrib(n,"style",null),r(e,(function(t){n.setAttributeNode(t.cloneNode(!0))})))}},n=function(){return!s.isCollapsed()&&a.getParent(s.getStart(),a.isBlock)!==a.getParent(s.getEnd(),a.isBlock)},t.on("keypress",(function(r){var o;if(!m(r)&&(8===r.keyCode||46===r.keyCode)&&n())return o=e(),t.getDoc().execCommand("delete",!1,null),o(),r.preventDefault(),!1})),a.bind(t.getDoc(),"cut",(function(r){var o;!m(r)&&n()&&(o=e(),oo.setEditorTimeout(t,(function(){o()})))})),k(),x(),S(),T(),w())),{refreshContentEditable:L,isHidden:function(){if(!u||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}},Vx=gs.DOM,Wx=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},Kx=function(t){return vt(t,(function(t){return!1===v(t)}))},Yx=function(t){var e=t.settings,n=t.editorUpload.blobCache;return Kx({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:Wx(t),validate:!0,blob_cache:n,document:t.getDoc(),images_dataimg_filter:e.images_dataimg_filter})},Xx=function(t){var e=t.dom.getRoot();t.inline||Uf(t)&&t.selection.getStart(!0)!==e||Pc(e).each((function(e){var n=e.getNode(),r=Rn(n)?Pc(n).getOr(e):e;ke.browser.isIE()?function(t,e){var n=De.fromDom(t.getBody()),r=(rh(t)?$.from(e):$.none()).map(oh).filter(nh(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())}))},Gx=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),Xx(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),function(t){t.settings.auto_focus&&oo.setEditorTimeout(t,(function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()}),100)}(t)},Zx=function(t){return t.inline?t.ui.styleSheetLoader:t.dom.styleSheetLoader},Jx=function(t){var e=Zx(t),n=mu(t),r=t.contentCSS,o=function(){e.unloadAll(r),t.inline||t.ui.styleSheetLoader.unloadAll(n)},i=function(){t.removed?o():t.on("remove",o)};if(t.contentStyles.length>0){var a="";Te.each(t.contentStyles,(function(t){a+=t+"\r\n"})),t.dom.addStyle(a)}var s=to.all(function(t,e,n){var r=[new to((function(n,r){return Zx(t).loadAll(e,n,r)}))];return t.inline?r:r.concat([new to((function(e,r){return t.ui.styleSheetLoader.loadAll(n,e,r)}))])}(t,r,n)).then(i).catch(i);return t.settings.content_style&&function(t,e){var n=De.fromDom(t.getBody()),r=ln(sn(n)),o=De.fromTag("style");Qn(o,"type","text/css"),pn(o,De.fromText(e)),pn(r,o),t.on("remove",(function(){vn(o)}))}(t,t.settings.content_style),s},Qx=function(t){var e=t.settings,n=t.getDoc(),r=t.getBody();!function(t){t.fire("PreInit")}(t),e.browser_spellcheck||e.gecko_spellcheck||(n.body.spellcheck=!1,Vx.setAttrib(r,"spellcheck","false")),t.quirks=Hx(t),function(t){t.fire("PostRender")}(t);var o=function(t){return t.getParam("directionality",Ss.isRtl()?"rtl":void 0)}(t);void 0!==o&&(r.dir=o),e.protect&&t.on("BeforeSetContent",(function(t){Te.each(e.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type}))},tS=function(t){!0!==t.removed&&(!function(t){Zv(t)||t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"})}(t),Gx(t))},eS=function(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(Vx.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var i=t.getBody();i.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===Vx.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=t.getParam("content_editable_state",!0)),i.disabled=!1,t.editorUpload=Mb(t),t.schema=Ai(n),t.dom=gs(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:fu(t),referrerPolicy:du(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=Ty(Yx(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",(function(e,n){for(var r,o,i=e.length,a=t.dom,s="data-mce-"+n;i--;)if((o=(r=e[i]).attr(n))&&!r.attr(s)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=a.serializeStyle(a.parseStyle(o),r.name)).length||(o=null),r.attr(s,o),r.attr(n,o)):"tabindex"===n?(r.attr(s,o),r.attr(n,null)):r.attr(s,t.convertURL(o,n,r.name))}})),e.addNodeFilter("script",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),t.settings.preserve_cdata&&e.addNodeFilter("#cdata",(function(e){for(var n=e.length;n--;){var r=e[n];r.type=8,r.name="#comment",r.value="[CDATA["+t.dom.encode(r.value)+"]]"}})),e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(e){for(var n=e.length,r=t.schema.getNonEmptyElements();n--;){var o=e[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new Ih("br",1)).shortEnded=!0)}})),e}(t),t.serializer=Iy(function(t){var e=t.settings;return Dt(Dt({},Yx(t)),Kx({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before,block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements}))}(t),t),t.selection=cy(t.dom,t.getWin(),t.serializer,t),t.annotator=Jf(t),t.formatter=Vb(t),t.undoManager=Kb(t),t._nodeChangeDispatcher=new Sx(t),t._selectionOverrides=Ux(t),RC(t),Ox(t),Zv(t)||Tx(t);var a=function(t){return Zv(t)?ws(null):xx(t)}(t);jC(t,a),function(t){nu(t)&&t.on("NodeChange",T(qC,t))}(t),Jb(t);var s=Jv(t);Qx(t),s.fold((function(){Jx(t).then((function(){return tS(t)}))}),(function(e){t.setProgressState(!0),Jx(t).then((function(){e().then((function(e){t.setProgressState(!1),tS(t)}),(function(e){t.notificationManager.open({type:"error",text:String(e)}),tS(t)}))}))}))},nS=gs.DOM,rS=function(t){var e=function(t){return t.getParam("doctype","")}(t)+"";(function(t){return t.getParam("document_base_url","")})(t)!==t.documentBaseUrl&&(e+=''),e+='';var n=function(t){return tu(t,"body_id","tinymce")}(t),r=function(t){return tu(t,"body_class","")}(t),o=t.translate(function(t){return t.getParam("iframe_aria_text","Rich Text Area. Press ALT-0 for help.","string")}(t));return eu(t)&&(e+=''),e+='
'},oS=function(t,e){var n,r,o,i,a=t.translate("Rich Text Area"),s=(n=t.id,r=a,e.height,o=function(t){return t.getParam("iframe_attrs",{})}(t),i=De.fromTag("iframe"),tr(i,o),tr(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),js(i,"tox-edit-area__iframe"),i).dom;s.onload=function(){s.onload=null,t.fire("load")};var l=function(t,e){if(document.domain!==window.location.hostname&&ke.browser.isIE()){var n=jb("mce");t[n]=function(){eS(t)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return nS.setAttrib(e,"src",r),!0}return!1}(t,s);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=s,t.iframeHTML=rS(t),nS.add(e.iframeContainer,s),l},iS=gs.DOM,aS=function(t,e,n){var r=_b.get(n),o=_b.urls[n]||t.documentBaseUrl.replace(/\/$/,"");if(n=Te.trim(n),r&&-1===Te.inArray(e,n)){if(Te.each(_b.dependencies(n),(function(n){aS(t,e,n)})),t.plugins[n])return;try{var i=new r(t,o,t.$);t.plugins[n]=i,i.init&&(i.init(t,o),e.push(n))}catch(e){!function(t,e,n){var r=Ss.translate(["Failed to initialize plugin: {0}",e]);nd(t,"PluginLoadError",{message:r}),Tb(r,n),xb(t,r)}(t,n,e)}}},sS=function(t){return t.replace(/^\-/,"")},lS=function(t){return{editorContainer:t,iframeContainer:t,api:{}}},uS=function(t){var e=t.getElement();return t.inline?lS(null):function(t){var e=iS.create("div");return iS.insertAfter(e,t),lS(e)}(e)},cS=function(t){var e=t.getElement();return t.orgDisplay=e.style.display,d(yu(t))?function(t){return t.theme.renderUI()}(t):_(yu(t))?function(t){var e=t.getElement(),n=yu(t)(t,e);return n.editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:e.offsetHeight,n}(t):uS(t)},fS=function(t){t.fire("ScriptsLoaded"),function(t){var e=Te.trim(au(t)),n=t.ui.registry.getAll().icons,r=Dt(Dt({},cb.get("default").icons),cb.get(e).icons);dt(r,(function(e,r){_t(n,r)||t.ui.registry.addIcon(r,e)}))}(t),function(t){var e=yu(t);if(d(e)){t.settings.theme=sS(e);var n=wb.get(e);t.theme=new n(t,wb.urls[e]),t.theme.init&&t.theme.init(t,wb.urls[e]||t.documentBaseUrl.replace(/\/$/,""),t.$)}else t.theme={}}(t),function(t){var e=[];Te.each(Cu(t).split(/[ ,]/),(function(n){aS(t,e,sS(n))}))}(t);var e=cS(t);!function(t,e){var n={show:$.from(e.show).getOr(C),hide:$.from(e.hide).getOr(C),disable:$.from(e.disable).getOr(C),isDisabled:$.from(e.isDisabled).getOr(L),enable:function(){t.mode.isReadOnly()||$.from(e.enable).map(N)}};t.ui=Dt(Dt({},t.ui),n)}(t,$.from(e.api).getOr({}));var n={editorContainer:e.editorContainer,iframeContainer:e.iframeContainer};return t.editorContainer=n.editorContainer?n.editorContainer:null,Nb(t),t.inline?eS(t):function(t,e){var n=oS(t,e);e.editorContainer&&(nS.get(e.editorContainer).style.display=t.orgDisplay,t.hidden=nS.isHidden(e.editorContainer)),t.getElement().style.display="none",nS.setAttrib(t.id,"aria-hidden","true"),n||eS(t)}(t,n)},dS=gs.DOM,hS=function(t){return"-"===t.charAt(0)},pS=function(t,e){var n=hu(e),r=function(t){return t.getParam("language_url","","string")}(e);if(!1===Ss.hasCode(n)&&"en"!==n){var o=""!==r?r:e.editorManager.baseURL+"/langs/"+n+".js";t.add(o,C,void 0,(function(){!function(t,e,n){Sb(t,"LanguageLoadError",Ob("language",e,n))}(e,o,n)}))}},mS=function(t,e,n){return $.from(e).filter((function(t){return t.length>0&&!cb.has(t)})).map((function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:$.some(e)}}))},gS=function(t,e,n){var r=mS(e,"default",n),o=function(t){return $.from(function(t){return t.getParam("icons_url","","string")}(t)).filter((function(t){return t.length>0})).map((function(t){return{url:t,name:$.none()}}))}(e).orThunk((function(){return mS(e,au(e),"")}));V(function(t){for(var e=[],n=function(t){e.push(t)},r=0;r=1&&n<=7){var r=function(t){return Te.explode(t.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))}(t),o=function(t){return Te.explode(t.getParam("font_size_classes",""))}(t);return o?o[n-1]||e:r[n-1]||e}return e}return e},AS=function(t){var e=t.split(/\s*,\s*/);return H(e,(function(t){return-1===t.indexOf(" ")||Mt(t,'"')||Mt(t,"'")?t:"'"+t+"'"})).join(",")},DS=function(t,e){var n=function(t){if("string"!=typeof t){var e=Te.extend({paste:t.paste,data:{paste:t.paste}},t);return{content:t.content,details:e}}return{content:t,details:{}}}(e);!function(t,e,n){Qv(t).editor.insertContent(e,n)}(t,n.content,n.details)},NS=Te.each,LS=Te.map,IS=Te.inArray,jS=function(){function t(t){this.commands={state:{},exec:{},value:{}},this.editor=t,this.setupCommands(t)}return t.prototype.execCommand=function(t,e,n,r){var o,i=!1,a=this;if(!a.editor.removed){var s;if("mcefocus"!==t.toLowerCase()&&(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||r&&r.skip_focus?(s=a.editor,lh(s).each((function(t){return s.selection.setRng(t)}))):a.editor.focus()),(r=a.editor.fire("BeforeExecCommand",{command:t,ui:e,value:n})).isDefaultPrevented())return!1;var l=t.toLowerCase();if(o=a.commands.exec[l])return o(l,e,n),a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;if(NS(this.editor.plugins,(function(r){if(r.execCommand&&r.execCommand(t,e,n))return a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),i=!0,!1})),i)return i;if(a.editor.theme&&a.editor.theme.execCommand&&a.editor.theme.execCommand(t,e,n))return a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;try{i=a.editor.getDoc().execCommand(t,e,n)}catch(t){}return!!i&&(a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0)}},t.prototype.queryCommandState=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.state[t])return e(t);try{return this.editor.getDoc().queryCommandState(t)}catch(t){}return!1}},t.prototype.queryCommandValue=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.value[t])return e(t);try{return this.editor.getDoc().queryCommandValue(t)}catch(t){}}},t.prototype.addCommands=function(t,e){void 0===e&&(e="exec");var n=this;NS(t,(function(t,r){NS(r.toLowerCase().split(","),(function(r){n.commands[e][r]=t}))}))},t.prototype.addCommand=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.exec[t]=function(t,o,i,a){return e.call(n||r.editor,o,i,a)}},t.prototype.queryCommandSupported=function(t){if(t=t.toLowerCase(),this.commands.exec[t])return!0;try{return this.editor.getDoc().queryCommandSupported(t)}catch(t){}return!1},t.prototype.addQueryStateHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.state[t]=function(){return e.call(n||r.editor)}},t.prototype.addQueryValueHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.value[t]=function(){return e.call(n||r.editor)}},t.prototype.hasCustomCommand=function(t){return t=t.toLowerCase(),!!this.commands.exec[t]},t.prototype.execNativeCommand=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(t,e,n)},t.prototype.isFormatMatch=function(t){return this.editor.formatter.match(t)},t.prototype.toggleFormat=function(t,e){this.editor.formatter.toggle(t,e),this.editor.nodeChanged()},t.prototype.storeSelection=function(t){this.selectionBookmark=this.editor.selection.getBookmark(t)},t.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},t.prototype.setupCommands=function(t){var e=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":C,"mceEndUndoLevel,mceAddUndoLevel":function(){t.undoManager.add()},mceFocus:function(e,n,r){kh(t,r)},"Cut,Copy,Paste":function(n){var r,o=t.getDoc();try{e.execNativeCommand(n)}catch(t){r=!0}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var i=t.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");ke.mac&&(i=i.replace(/Ctrl\+/g,"⌘+")),t.notificationManager.open({text:i,type:"error"})}},unlink:function(){if(t.selection.isCollapsed()){var e=t.dom.getParent(t.selection.getStart(),"a");e&&t.dom.remove(e,!0)}else t.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),NS("left,center,right,justify".split(","),(function(e){r!==e&&t.formatter.remove("align"+e)})),"none"!==r&&e.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r;e.execNativeCommand(n);var o=t.dom.getParent(t.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(e.storeSelection(),t.dom.split(r,o),e.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){e.toggleFormat(t)},"ForeColor,HiliteColor":function(t,n,r){e.toggleFormat(t,{value:r})},FontName:function(e,n,r){!function(t,e){var n=TS(t,e);t.formatter.toggle("fontname",{value:AS(n)}),t.nodeChanged()}(t,r)},FontSize:function(e,n,r){!function(t,e){t.formatter.toggle("fontsize",{value:TS(t,e)}),t.nodeChanged()}(t,r)},LineHeight:function(e,n,r){!function(t,e){t.formatter.toggle("lineheight",{value:String(e)}),t.nodeChanged()}(t,r)},Lang:function(t,n,r){e.toggleFormat(t,{value:r.code,customValue:r.customCode})},RemoveFormat:function(e){t.formatter.remove(e)},mceBlockQuote:function(){e.toggleFormat("blockquote")},FormatBlock:function(t,n,r){return e.toggleFormat(r||"p")},mceCleanup:function(){var e=t.selection.getBookmark();t.setContent(t.getContent()),t.selection.moveToBookmark(e)},mceRemoveNode:function(n,r,o){var i=o||t.selection.getNode();i!==t.getBody()&&(e.storeSelection(),t.dom.remove(i,!0),e.restoreSelection())},mceSelectNodeDepth:function(e,n,r){var o=0;t.dom.getParent(t.selection.getNode(),(function(e){if(1===e.nodeType&&o++===r)return t.selection.select(e),!1}),t.getBody())},mceSelectNode:function(e,n,r){t.selection.select(r)},mceInsertContent:function(e,n,r){DS(t,r)},mceInsertRawHTML:function(e,n,r){t.selection.setContent("tiny_mce_marker");var o=t.getContent();t.setContent(o.replace(/tiny_mce_marker/g,(function(){return r})))},mceInsertNewLine:function(e,n,r){lx(t,r)},mceToggleFormat:function(t,n,r){e.toggleFormat(r)},mceSetContent:function(e,n,r){t.setContent(r)},"Indent,Outdent":function(e){NC(t,e)},mceRepaint:C,InsertHorizontalRule:function(){t.execCommand("mceInsertContent",!1,"
")},mceToggleVisualAid:function(){t.hasVisual=!t.hasVisual,t.addVisual()},mceReplaceContent:function(e,n,r){t.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,t.selection.getContent({format:"text"})))},mceInsertLink:function(e,n,r){"string"==typeof r&&(r={href:r});var o=t.dom.getParent(t.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||t.formatter.remove("link"),r.href&&t.formatter.apply("link",r,o)},selectAll:function(){var e=t.dom.getParent(t.selection.getStart(),Vn);if(e){var n=t.dom.createRng();n.selectNodeContents(e),t.selection.setRng(n)}},mceNewDocument:function(){t.setContent("")},InsertLineBreak:function(e,n,r){return Xk(t,r),!0}});var n=function(e){return function(){var n=t.selection,r=n.isCollapsed()?[t.dom.getParent(n.getNode(),t.dom.isBlock)]:n.getSelectedBlocks(),o=LS(r,(function(n){return!!t.formatter.matchNode(n,e)}));return-1!==IS(o,!0)}};e.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){return e.isFormatMatch(t)},mceBlockQuote:function(){return e.isFormatMatch("blockquote")},Outdent:function(){return TC(t)},"InsertUnorderedList,InsertOrderedList":function(e){var n=t.dom.getParent(t.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===e&&"UL"===n.tagName||"insertorderedlist"===e&&"OL"===n.tagName)}},"state"),e.addCommands({Undo:function(){t.undoManager.undo()},Redo:function(){t.undoManager.redo()}}),e.addQueryValueHandler("FontName",(function(){return function(t){return ES(t,(function(e){return xS(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("FontSize",(function(){return function(t){return ES(t,(function(e){return kS(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("LineHeight",(function(){return function(t){return ES(t,(function(e){var n=De.fromDom(t.getBody()),r=dg(e,(function(t){return sr(t,"line-height")}),T(je,n));return r.getOrThunk((function(){var t=parseFloat(ir(e,"line-height")),n=parseFloat(ir(e,"font-size"));return String(t/n)}))})).getOr("")}(t)}),this)},t}(),PS="data-mce-contenteditable",RS=function(t,e,n){var r,o;Rs(t,e)&&!1===n?(o=e,Ns(r=t)?r.dom.classList.remove(o):Is(r,o),Ps(r)):n&&js(t,e)},$S=function(t,e,n){try{t.getDoc().execCommand(e,!1,String(n))}catch(t){}},MS=function(t,e){t.dom.contentEditable=e?"true":"false"},BS=function(t,e){var n=De.fromDom(t.getBody());RS(n,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),function(t){$.from(t.selection.getNode()).each((function(t){t.removeAttribute("data-mce-selected")}))}(t),t.readonly=!0,MS(n,!1),V(Ms(n,'*[contenteditable="true"]'),(function(t){Qn(t,PS,"true"),MS(t,!1)}))):(t.readonly=!1,MS(n,!0),function(t){V(Ms(t,'*[data-mce-contenteditable="true"]'),(function(t){rr(t,PS),MS(t,!0)}))}(n),$S(t,"StyleWithCSS",!1),$S(t,"enableInlineTableEditing",!1),$S(t,"enableObjectResizing",!1),wh(t)&&t.focus(),function(t){t.selection.setRng(t.selection.getRng())}(t),t.nodeChanged())},qS=function(t){return t.readonly},FS=function(t){t.parser.addAttributeFilter("contenteditable",(function(e){qS(t)&&V(e,(function(t){t.attr(PS,t.attr("contenteditable")),t.attr("contenteditable","false")}))})),t.serializer.addAttributeFilter(PS,(function(e){qS(t)&&V(e,(function(t){t.attr("contenteditable",t.attr(PS))}))})),t.serializer.addTempAttr(PS)},zS=function(t,e){if(function(t){return"click"===t.type}(e)&&!id.metaKeyPressed(e)){var n=De.fromDom(e.target);(function(t,e){return Qr(e,"a",(function(e){return je(e,De.fromDom(t.getBody()))})).bind((function(t){return nr(t,"href")}))})(t,n).each((function(n){if(e.preventDefault(),/^#/.test(n)){var r=t.dom.select(n+',[name="'+((Mt(o=n,i="#")?function(t,e){return t.substring(e)}(o,i.length):o)+'"]'));r.length&&t.selection.scrollIntoView(r[0],!0)}else window.open(n,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes");var o,i}))}},US=Te.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),HS=function(){function t(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||L}return t.isNative=function(t){return!!US[t.toLowerCase()]},t.prototype.fire=function(t,e){var n=t.toLowerCase(),r=ji(n,e||{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,a=o.length;i"),iO);return o[o.length-1]=Te.extend(o[o.length-1],{func:n,scope:r||this.editor}),Te.extend(o[0],{desc:this.editor.translate(e),subpatterns:o.slice(1)})},t.prototype.hasModifier=function(t){return t.altKey||t.ctrlKey||t.metaKey},t.prototype.isFunctionKey=function(t){return"keydown"===t.type&&t.keyCode>=112&&t.keyCode<=123},t.prototype.matchShortcut=function(t,e){return!!e&&(e.ctrl===t.ctrlKey&&e.meta===t.metaKey&&(e.alt===t.altKey&&e.shift===t.shiftKey&&(!!(t.keyCode===e.keyCode||t.charCode&&t.charCode===e.charCode)&&(t.preventDefault(),!0))))},t.prototype.executeShortcutAction=function(t){return t.func?t.func.call(t.scope):null},t}(),sO=function(){var t=function(){var t={},e={},n={},r={},o={},i={},a={},s=function(t,e){return function(n,r){return t[n.toLowerCase()]=Dt(Dt({},r),{type:e})}};return{addButton:s(t,"button"),addGroupToolbarButton:s(t,"grouptoolbarbutton"),addToggleButton:s(t,"togglebutton"),addMenuButton:s(t,"menubutton"),addSplitButton:s(t,"splitbutton"),addMenuItem:s(e,"menuitem"),addNestedMenuItem:s(e,"nestedmenuitem"),addToggleMenuItem:s(e,"togglemenuitem"),addAutocompleter:s(n,"autocompleter"),addContextMenu:s(o,"contextmenu"),addContextToolbar:s(i,"contexttoolbar"),addContextForm:s(i,"contextform"),addSidebar:s(a,"sidebar"),addIcon:function(t,e){return r[t.toLowerCase()]=e},getAll:function(){return{buttons:t,menuItems:e,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:a}}}}();return{addAutocompleter:t.addAutocompleter,addButton:t.addButton,addContextForm:t.addContextForm,addContextMenu:t.addContextMenu,addContextToolbar:t.addContextToolbar,addIcon:t.addIcon,addMenuButton:t.addMenuButton,addMenuItem:t.addMenuItem,addNestedMenuItem:t.addNestedMenuItem,addSidebar:t.addSidebar,addSplitButton:t.addSplitButton,addToggleButton:t.addToggleButton,addGroupToolbarButton:t.addGroupToolbarButton,addToggleMenuItem:t.addToggleMenuItem,getAll:t.getAll}},lO=gs.DOM,uO=Te.extend,cO=Te.each,fO=Te.resolve,dO=ke.ie,hO=function(){function t(t,e,n){var r=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,uO(this,ZS),this.settings=sb(this,t,this.documentBaseUrl,n.defaultSettings,e),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(_s.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),gs.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),Os.languageLoad=this.settings.language_load,Os.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new Fh(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new aO(this),this.editorCommands=new jS(this),this.settings.cache_suffix&&(ke.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:sO(),styleSheetLoader:void 0,show:C,hide:C,enable:C,disable:C,isDisabled:L};var o=tO(this);this.mode=o,this.setMode=o.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=us.overrideDefaults((function(){return{context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}}))}return t.prototype.render=function(){yS(this)},t.prototype.focus=function(t){this.execCommand("mceFocus",!1,t)},t.prototype.hasFocus=function(){return _h(this)},t.prototype.execCallback=function(t){for(var e=[],n=1;n0?wO[0]:null),OO.focusedEditor===t&&(OO.focusedEditor=null),e.length!==wO.length},SO="CSS1Compat"!==document.compatMode,OO=Dt(Dt({},WS),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:us,majorVersion:"5",minorVersion:"10.3",releaseDate:"2022-02-09",editors:_O,i18n:Ss,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,e,n=this,r="";e=Fh.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/"));var o,i=window.tinymce||window.tinyMCEPreInit;if(i)t=i.base||i.baseURL,r=i.suffix;else{for(var a=document.getElementsByTagName("script"),s=0;s0&&gO(mO(n),(function(t){var n=pO.get(t);n?e.push(n):gO(document.forms,(function(n){gO(n.elements,(function(n){n.name===t&&(t="mce_editor_"+yO++,pO.setAttrib(n,"id",t),e.push(n))}))}))}));break;case"textareas":case"specific_textareas":gO(pO.select("textarea"),(function(n){t.editor_deselector&&i(n,t.editor_deselector)||t.editor_selector&&!i(n,t.editor_selector)||e.push(n)}))}return e}(t)),t.types?gO(t.types,(function(n){Te.each(e,(function(e){return!pO.is(e,n.selector)||(c(o(e),vO({},t,n),e),!1)}))})):(Te.each(e,(function(t){var e;(e=n.get(t.id))&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(xO(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null)})),0===(e=Te.grep(e,(function(t){return!n.get(t.id)}))).length?a([]):gO(e,(function(e){!function(t,e){return t.inline&&e.tagName.toLowerCase()in r}(t,e)?c(o(e),t,e):Tb("Could not initialize inline editor on invalid inline target element",e)})))};return n.settings=t,pO.bind(window,"ready",s),new to((function(t){e?t(e):a=function(e){t(e)}}))},get:function(t){return 0===arguments.length?wO.slice(0):d(t)?J(wO,(function(e){return e.id===t})).getOr(null):w(t)&&wO[t]?wO[t]:null},add:function(t){var e=this;return _O[t.id]===t||(null===e.get(t.id)&&("length"!==t.id&&(_O[t.id]=t),_O.push(t),wO.push(t)),kO(!0),e.activeEditor=t,e.fire("AddEditor",{editor:t}),Bw||(Bw=function(t){var n=e.fire("BeforeUnload");if(n.returnValue)return t.preventDefault(),t.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",Bw))),t},createEditor:function(t,e){return this.add(new hO(t,e,this))},remove:function(t){var e,n,r=this;if(t){if(!d(t))return n=t,m(r.get(n.id))?null:(xO(n)&&r.fire("RemoveEditor",{editor:n}),0===wO.length&&window.removeEventListener("beforeunload",Bw),n.remove(),kO(wO.length>0),n);gO(pO.select(t),(function(t){(n=r.get(t.id))&&r.remove(n)}))}else for(e=wO.length-1;e>=0;e--)r.remove(wO[e])},execCommand:function(t,e,n){var r=this,o=r.get(n);switch(t){case"mceAddEditor":return r.get(n)||new hO(n,r.settings,r).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(r.execCommand("mceAddEditor",!1,n),!0)}return!!r.activeEditor&&r.activeEditor.execCommand(t,e,n)},triggerSave:function(){gO(wO,(function(t){t.save()}))},addI18n:function(t,e){Ss.add(t,e)},translate:function(t){return Ss.translate(t)},setActive:function(t){var e=this.activeEditor;this.activeEditor!==t&&(e&&e.fire("deactivate",{relatedTarget:t}),t.fire("activate",{relatedTarget:e})),this.activeEditor=t},_setBaseUrl:function(t){this.baseURL=new Fh(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new Fh(this.baseURL)}});OO.setup();var EO,TO,AO,DO,NO=Math.min,LO=Math.max,IO=Math.round,jO=function(t,e,n){var r=e.x,o=e.y,i=t.w,a=t.h,s=e.w,l=e.h,u=(n||"").split("");return"b"===u[0]&&(o+=l),"r"===u[1]&&(r+=s),"c"===u[0]&&(o+=IO(l/2)),"c"===u[1]&&(r+=IO(s/2)),"b"===u[3]&&(o-=a),"r"===u[4]&&(r-=i),"c"===u[3]&&(o-=IO(a/2)),"c"===u[4]&&(r-=IO(i/2)),PO(r,o,i,a)},PO=function(t,e,n,r){return{x:t,y:e,w:n,h:r}},RO={inflate:function(t,e,n){return PO(t.x-e,t.y-n,t.w+2*e,t.h+2*n)},relativePosition:jO,findBestRelativePosition:function(t,e,n,r){var o,i;for(i=0;i=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(t,e){var n=LO(t.x,e.x),r=LO(t.y,e.y),o=NO(t.x+t.w,e.x+e.w),i=NO(t.y+t.h,e.y+e.h);return o-n<0||i-r<0?null:PO(n,r,o-n,i-r)},clamp:function(t,e,n){var r=t.x,o=t.y,i=t.x+t.w,a=t.y+t.h,s=e.x+e.w,l=e.y+e.h,u=LO(0,e.x-r),c=LO(0,e.y-o),f=LO(0,i-s),d=LO(0,a-l);return r+=u,o+=c,n&&(i+=u,a+=c,r-=f,o-=d),PO(r,o,(i-=f)-r,(a-=d)-o)},create:PO,fromClientRect:function(t){return PO(t.left,t.top,t.width,t.height)}},$O=(EO={},TO={},{load:function(t,e){var n='Script at URL "'+e+'" failed to load',r='Script at URL "'+e+"\" did not call `tinymce.Resource.add('"+t+"', data)` within 1 second";if(void 0!==EO[t])return EO[t];var o=new to((function(o,i){var a=function(t,e,n){void 0===n&&(n=1e3);var r=!1,o=null,i=function(t){return function(){for(var e=[],n=0;n1e4?(t.success&&n<1e4&&200===e.status?t.success.call(t.success_scope,""+e.responseText,e,t):t.error&&t.error.call(t.error_scope,n>1e4?"TIMED_OUT":"GENERAL",e,t),e=null):oo.setTimeout(r,10)};if(t.scope=t.scope||this,t.success_scope=t.success_scope||t.scope,t.error_scope=t.error_scope||t.scope,t.async=!1!==t.async,t.data=t.data||"",KO.fire("beforeInitialize",{settings:t}),(e=new XMLHttpRequest).overrideMimeType&&e.overrideMimeType(t.content_type),e.open(t.type||(t.data?"POST":"GET"),t.url,t.async),t.crossDomain&&(e.withCredentials=!0),t.content_type&&e.setRequestHeader("Content-Type",t.content_type),t.requestheaders&&Te.each(t.requestheaders,(function(t){e.setRequestHeader(t.key,t.value)})),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),(e=KO.fire("beforeSend",{xhr:e,settings:t}).xhr).send(t.data),!t.async)return r();oo.setTimeout(r,10)}}),YO=Te.extend,XO=function(){function t(t){this.settings=YO({},t),this.count=0}return t.sendRPC=function(e){return(new t).send(e)},t.prototype.send=function(t){var e=t.error,n=t.success,r=YO(this.settings,t);r.success=function(t,o){void 0===(t=VO.parse(t))&&(t={error:"JSON Parse error."}),t.error?e.call(r.error_scope||r.scope,t.error,o):n.call(r.success_scope||r.scope,t.result)},r.error=function(t,n){e&&e.call(r.error_scope||r.scope,t,n)},r.data=VO.serialize({id:t.id||"c"+this.count++,method:t.method,params:t.params}),r.content_type="application/json",KO.send(r)},t}();try{var GO="__storage_test__";(FO=window.localStorage).setItem(GO,GO),FO.removeItem(GO)}catch(t){FO=function(){var t={},e=[],n={getItem:function(e){return t[e]||null},setItem:function(n,r){e.push(n),t[n]=String(r)},key:function(t){return e[t]},removeItem:function(n){e=e.filter((function(t){return t===n})),delete t[n]},clear:function(){e=[],t={}},length:0};return Object.defineProperty(n,"length",{get:function(){return e.length},configurable:!1,enumerable:!1}),n}()}var ZO={geom:{Rect:RO},util:{Promise:to,Delay:oo,Tools:Te,VK:id,URI:Fh,Class:qO,EventDispatcher:HS,Observable:WS,I18n:Ss,XHR:KO,JSON:VO,JSONRequest:XO,JSONP:WO,LocalStorage:FO,Color:function(t){var e={},n=0,r=0,o=0,i=function(t){var i;return"object"==typeof t?"r"in t?(n=t.r,r=t.g,o=t.b):"v"in t&&function(t,e,i){if(t=(parseInt(t,10)||0)%360,e=parseInt(e,10)/100,i=parseInt(i,10)/100,e=UO(0,zO(e,1)),i=UO(0,zO(i,1)),0!==e){var a=t/60,s=i*e,l=s*(1-Math.abs(a%2-1)),u=i-s;switch(Math.floor(a)){case 0:n=s,r=l,o=0;break;case 1:n=l,r=s,o=0;break;case 2:n=0,r=s,o=l;break;case 3:n=0,r=l,o=s;break;case 4:n=l,r=0,o=s;break;case 5:n=s,r=0,o=l;break;default:n=r=o=0}n=HO(255*(n+u)),r=HO(255*(r+u)),o=HO(255*(o+u))}else n=r=o=HO(255*i)}(t.h,t.s,t.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(t))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(t))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(t))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,e};return t&&i(t),e.toRgb=function(){return{r:n,g:r,b:o}},e.toHsv=function(){return function(t,e,n){var r,o;o=0;var i=zO(t/=255,zO(e/=255,n/=255)),a=UO(t,UO(e,n));return i===a?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,o=a,{h:HO(60*((t===i?3:n===i?1:5)-(t===i?e-n:n===i?t-e:n-t)/(a-i))),s:HO(100*r),v:HO(100*o)})}(n,r,o)},e.toHex=function(){var t=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+t(n)+t(r)+t(o)},e.parse=i,e},ImageUploader:function(t){var e=Lb(),n=$b(t,e);return{upload:function(e,r){return void 0===r&&(r=!0),n.upload(e,r?Rb(t):void 0)}}}},dom:{EventUtils:qi,Sizzle:ka,DomQuery:us,TreeWalker:so,TextSeeker:Qs,DOMUtils:gs,ScriptLoader:_s,RangeUtils:Cd,Serializer:Iy,StyleSheetLoader:io,ControlSelection:sd,BookmarkManager:Qf,Selection:cy,Event:qi.Event},html:{Styles:Ni,Entities:bi,Node:Ih,Schema:Ai,SaxParser:Wh,DomParser:Ty,Writer:Qh,Serializer:tp},Env:ke,AddOnManager:Os,Annotator:Jf,Formatter:Vb,UndoManager:Kb,EditorCommands:jS,WindowManager:Cb,NotificationManager:bb,EditorObservable:ZS,Shortcuts:aO,Editor:hO,FocusManager:uh,EditorManager:OO,DOM:gs.DOM,ScriptLoader:_s.ScriptLoader,PluginManager:_b,ThemeManager:wb,IconManager:cb,Resource:$O,trim:Te.trim,isArray:Te.isArray,is:Te.is,toArray:Te.toArray,makeMap:Te.makeMap,each:Te.each,map:Te.map,grep:Te.grep,inArray:Te.inArray,extend:Te.extend,create:Te.create,walk:Te.walk,createNS:Te.createNS,resolve:Te.resolve,explode:Te.explode,_addCacheSuffix:Te._addCacheSuffix,isOpera:ke.opera,isWebKit:ke.webkit,isIE:ke.ie,isGecko:ke.gecko,isMac:ke.mac},JO=Te.extend(OO,ZO);!function(t){window.tinymce=t,window.tinyMCE=t}(JO),function(e){try{t.exports=e}catch(t){}}(JO)}()},99383:(t,e,n)=>{"use strict";n.d(e,{Z:()=>f});const r={name:"ResizeLine",props:{value:{},min:{type:Number,default:100},max:{type:Number,default:600},placement:{validator:function(t){return["right","bottom"].includes(t)},default:"bottom"},reverse:{type:Boolean,default:!1},beforeResize:Function},data:function(){return{resizing:!1,mouseX:0,mouseY:0,offset:{},tmpSize:void 0}},mounted:function(){document.documentElement.addEventListener("mousemove",this.handleMove,!0),document.documentElement.addEventListener("mouseup",this.handleUp,!0)},methods:{resizeDown:function(t){var e=this;if(this.beforeResize){var n=this.beforeResize();n&&n.then?n.then((function(n){e.handleDown(t)})):this.handleDown(t)}else this.handleDown(t)},handleDown:function(t){this.mouseX=t.pageX||t.clientX+document.documentElement.scrollLeft,this.mouseY=t.pageY||t.clientY+document.documentElement.scrollTop,this.offset={left:t.target.offsetLeft,top:t.target.offsetTop},this.resizing=!0,"number"==typeof this.value&&(this.tmpSize=this.value),this.$emit("on-change",{event:"down"})},handleMove:function(t){if(this.resizing){var e,n=(t.pageX||t.clientX+document.documentElement.scrollLeft)-this.mouseX,r=(t.pageY||t.clientY+document.documentElement.scrollTop)-this.mouseY;if("number"==typeof this.tmpSize)e="bottom"==this.placement?this.reverse?this.tmpSize-r:this.tmpSize+r:this.reverse?this.tmpSize-n:this.tmpSize+n,this.min>0&&(e=Math.max(this.min,e)),this.max>0&&(e=Math.min(this.max,e)),this.$emit("input",e);this.$emit("on-change",{event:"move",diff:{x:n,y:r},offset:this.offset})}},handleUp:function(){this.resizing&&(this.resizing=!1,this.tmpSize=void 0,this.$emit("on-change",{event:"up"}))}}};var o=n(93379),i=n.n(o),a=n(63409),s={insert:"head",singleton:!1};i()(a.Z,s);a.Z.locals;var l=n(51900);const u={name:"DrawerOverlayView",components:{ResizeLine:(0,l.Z)(r,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"component-resize-line",class:[t.resizing?"resizing":"",t.placement],on:{mousedown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:(e.stopPropagation(),e.preventDefault(),t.resizeDown.apply(null,arguments))}}})}),[],!1,null,"5a37a7e8",null).exports},props:{placement:{validator:function(t){return["right","bottom"].includes(t)},default:"bottom"},size:{type:[Number,String],default:"100%"},minSize:{type:Number,default:300},resize:{type:Boolean,default:!0}},data:function(){return{dynamicSize:0}},computed:{bodyStyle:function(){var t=this.dynamicSize;return t="".concat(t,t<=100?"%":"px"),"right"==this.placement?{width:t,height:"100%"}:{width:"100%",height:t}}},watch:{size:{handler:function(t){this.dynamicSize=parseInt(t)},immediate:!0}},methods:{onClose:function(){this.$emit("on-close")},beforeResize:function(){var t=this;return new Promise((function(e){t.dynamicSize<=100&&t.updateSize(),e()}))},onChangeResize:function(t){"up"===t.event&&this.updateSize()},updateSize:function(){"bottom"===this.placement?this.dynamicSize=this.$refs.body.clientHeight:this.dynamicSize=this.$refs.body.clientWidth}}};const c={name:"DrawerOverlay",components:{DrawerOverlayView:(0,l.Z)(u,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"body",staticClass:"overlay-body",style:t.bodyStyle},[n("div",{staticClass:"overlay-close"},[n("a",{attrs:{href:"javascript:void(0)"},on:{click:function(e){return e.stopPropagation(),t.onClose.apply(null,arguments)}}},[n("svg",{staticClass:"icon fill-current",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 26 26",fill:"none",role:"img"}},[n("path",{attrs:{d:"M8.28596 6.51819C7.7978 6.03003 7.00634 6.03003 6.51819 6.51819C6.03003 7.00634 6.03003 7.7978 6.51819 8.28596L11.2322 13L6.51819 17.714C6.03003 18.2022 6.03003 18.9937 6.51819 19.4818C7.00634 19.97 7.7978 19.97 8.28596 19.4818L13 14.7678L17.714 19.4818C18.2022 19.97 18.9937 19.97 19.4818 19.4818C19.97 18.9937 19.97 18.2022 19.4818 17.714L14.7678 13L19.4818 8.28596C19.97 7.7978 19.97 7.00634 19.4818 6.51819C18.9937 6.03003 18.2022 6.03003 17.714 6.51819L13 11.2322L8.28596 6.51819Z",fill:"currentColor"}})])])]),t._v(" "),t.resize?n("ResizeLine",{staticClass:"overlay-resize",attrs:{placement:t.placement,min:t.minSize,max:0,reverse:!0,beforeResize:t.beforeResize},on:{"on-change":t.onChangeResize},model:{value:t.dynamicSize,callback:function(e){t.dynamicSize=e},expression:"dynamicSize"}}):t._e(),t._v(" "),n("div",{staticClass:"overlay-content"},[t._t("default")],2)],1)}),[],!1,null,null,null).exports},props:{value:{type:Boolean,default:!1},maskClosable:{type:Boolean,default:!0},escClosable:{type:Boolean,default:!0},placement:{validator:function(t){return["right","bottom"].includes(t)},default:"bottom"},size:{type:[Number,String],default:"100%"},minSize:{type:Number,default:300},resize:{type:Boolean,default:!0},className:{type:String},beforeClose:Function},data:function(){return{show:this.value}},watch:{value:function(t){this.show=t},show:function(t){this.value!==t&&this.$emit("input",t)}},computed:{modalClass:function(){return this.className?"common-drawer-overlay ".concat(this.className," ").concat(this.placement):"common-drawer-overlay ".concat(this.placement)}},methods:{onClose:function(){this.$refs.modal.close()}}};const f=(0,l.Z)(c,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Modal",{ref:"modal",attrs:{closable:t.escClosable,"mask-closable":t.maskClosable,"footer-hide":!0,"transition-names":[t.$A.isAndroid()?"":"drawer-slide-"+t.placement,""],beforeClose:t.beforeClose,fullscreen:"","class-name":t.modalClass},model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[n("DrawerOverlayView",{attrs:{placement:t.placement,size:t.size,minSize:t.minSize,resize:t.resize},on:{"on-close":t.onClose}},[t._t("default")],2)],1)}),[],!1,null,null,null).exports},81520:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});function r(t){return r="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},r(t)}const o={name:"ImgUpload",props:{value:{},num:{},width:{},height:{},whcut:{},type:{},http:{type:Boolean,default:!1},otherParams:{type:Object,default:function(){return{}}},uploadIng:{type:Number,default:0}},data:function(){return{actionUrl:$A.apiUrl("system/imgupload"),multiple:this.num>1,visible:!1,browseVisible:!1,isLoading:!1,browseList:[],browseListNext:[],imgVisible:"",defaultList:this.initItems(this.value),uploadList:[],maxNum:Math.min(Math.max($A.runNum(this.num),1),99),httpValue:"",httpType:"",maxSize:2048}},mounted:function(){var t=this;this.uploadList=this.$refs.upload.fileList,this.$emit("input",this.uploadList);var e=$A(this.$refs.browselistbox);e.scroll((function(){var n=e[0].scrollHeight;if(e[0].scrollTop+e.height()>=n&&t.browseListNext.length>0){var r=t.browseListNext;t.browseListNext=[],t.browsePictureFor(r)}}))},watch:{value:function(t){"string"!=typeof t?t!==this.$refs.upload.fileList&&(this.$refs.upload.fileList=this.initItems(t),this.uploadList=this.$refs.upload.fileList):this.$emit("input",this.initItems(t))},browseVisible:function(){this.httpType="",this.httpValue=""}},computed:{uploadHeaders:function(){return{fd:$A.getSessionStorageString("userWsFd"),token:this.userToken}},uploadParams:function(){var t={width:this.width,height:this.height,whcut:this.whcut};return Object.keys(this.otherParams).length>0?Object.assign(t,this.otherParams):t}},methods:{handleCallback:function(t){"callback"===this.type&&(!0===t?(this.$emit("on-callback",this.uploadList),this.$refs.upload.fileList=[],this.uploadList=this.$refs.upload.fileList):"object"===r(t)&&this.$emit("on-callback",[t])),this.browseVisible=!1},initItems:function(t){"string"==typeof t&&(t=[{url:t}]);var e=[];return $A.each(t,(function(t,n){"string"==typeof n&&(n={url:n}),n.url&&(n.active=!0,n.status="finished",void 0===n.path&&(n.path=n.url),void 0===n.thumb&&(n.thumb=n.url),e.push(n))})),e},handleView:function(t){this.visible=!0,this.imgVisible=t.url},handleRemove:function(t){var e=this.$refs.upload.fileList;this.$refs.upload.fileList.splice(e.indexOf(t),1),this.$emit("input",this.$refs.upload.fileList)},handleProgress:function(t,e){void 0===e._uploadIng&&(e._uploadIng=!0,this.$emit("update:uploadIng",this.uploadIng+1))},handleSuccess:function(t,e){this.$emit("update:uploadIng",this.uploadIng-1),1===t.ret?(e.url=t.data.url,e.path=t.data.path,e.thumb=t.data.thumb,this.handleCallback(e)):($A.noticeWarning({title:this.$L("上传失败"),desc:this.$L("文件 "+e.name+" 上传失败 "+t.msg)}),this.$refs.upload.fileList.pop()),this.$emit("input",this.$refs.upload.fileList)},handleError:function(){this.$emit("update:uploadIng",this.uploadIng-1)},handleFormatError:function(t){$A.noticeWarning({title:this.$L("文件格式不正确"),desc:this.$L("文件 "+t.name+" 格式不正确,请上传 jpg、jpeg、gif、png 格式的图片。")})},handleMaxSize:function(t){$A.noticeWarning({title:this.$L("超出文件大小限制"),desc:this.$L("文件 "+t.name+" 太大,不能超过:"+$A.bytesToSize(1024*this.maxSize))})},handleBeforeUpload:function(){var t=this.uploadList.length{"use strict";n.r(e),n.d(e,{default:()=>d});var r=n(47575),o=n.n(r),i=n(81520),a=n(20629);function s(t){return s="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},s(t)}function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e0&&(n.min_height=this.minHeight),n},closeFull:function(){this.content=this.getContent(),this.$emit("input",this.content),this.$emit("on-blur"),this.transfer=!1,null!=this.editorT&&(this.editorT.destroy(),this.editorT=null)},transferChange:function(t){t||null==this.editorT||(this.content=this.editorT.getContent(),this.$emit("input",this.content),this.editorT.destroy(),this.editorT=null)},getEditor:function(){return this.transfer?this.editorT:this.editor},concatAssciativeArrays:function(t,e){if(0===e.length)return t;if(0===t.length)return e;var n=[];for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);for(var o in e)e.hasOwnProperty(o)&&(n[o]=e[o]);return n},submitNewContent:function(){var t=this;this.isTyping=!0,null!==this.checkerTimeout&&clearTimeout(this.checkerTimeout),this.checkerTimeout=setTimeout((function(){t.isTyping=!1}),300),this.$emit("input",this.getContent())},insertContent:function(t){null!==this.getEditor()?this.getEditor().insertContent(t):this.content+=t},getContent:function(){return null===this.getEditor()?"":this.getEditor().getContent()},setContent:function(t){null===this.getEditor()?this.content=t:t!=this.getEditor().getContent()&&this.getEditor().setContent(t)},focus:function(){return null===this.getEditor()?"":this.getEditor().focus()},insertImage:function(t){this.insertContent('
')},editorImage:function(t){for(var e=0;e|\/>)/gi);if(o)for(var i=0;i').concat(t.data.name," (").concat($A.bytesToSize(1024*t.data.size),")")):$A.noticeWarning({title:this.$L("上传失败"),desc:this.$L("文件 "+e.name+" 上传失败,"+t.msg)})},handleError:function(){this.uploadIng--},handleFormatError:function(t){$A.noticeWarning({title:this.$L("文件格式不正确"),desc:this.$L("文件 "+t.name+" 格式不正确,仅支持上传:"+this.uploadFormat.join(","))})},handleMaxSize:function(t){$A.noticeWarning({title:this.$L("超出文件大小限制"),desc:this.$L("文件 "+t.name+" 太大,不能超过:"+$A.bytesToSize(1024*this.maxSize))})},handleBeforeUpload:function(){return!0}}};const d=(0,n(51900).Z)(f,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"teditor-wrapper"},[n("div",{staticClass:"teditor-box",class:[!t.inline&&t.spinShow?"teditor-loadstyle":"teditor-loadedstyle"]},[t.inline?[n("div",{ref:"myTextarea",attrs:{id:t.id},domProps:{innerHTML:t._s(t.spinShow?"":t.content)}}),t._v(" "),t.spinShow?n("Icon",{staticClass:"icon-loading icon-inline",attrs:{type:"ios-loading",size:18}}):t._e()]:[n("textarea",{ref:"myTextarea",attrs:{id:t.id}},[t._v(t._s(t.content))]),t._v(" "),t.spinShow?n("Spin",{attrs:{fix:""}},[n("Icon",{staticClass:"icon-loading",attrs:{type:"ios-loading",size:18}}),t._v(" "),n("div",[t._v(t._s(t.$L("加载组件中...")))])],1):t._e()],t._v(" "),n("ImgUpload",{ref:"myUpload",staticClass:"upload-control",attrs:{type:"callback",uploadIng:t.uploadIng,num:"50"},on:{"update:uploadIng":function(e){t.uploadIng=e},"update:upload-ing":function(e){t.uploadIng=e},"on-callback":t.editorImage}}),t._v(" "),n("Upload",{ref:"fileUpload",staticClass:"upload-control",attrs:{name:"files",action:t.actionUrl,headers:t.headers,multiple:"",format:t.uploadFormat,"show-upload-list":!1,"max-size":t.maxSize,"on-progress":t.handleProgress,"on-success":t.handleSuccess,"on-error":t.handleError,"on-format-error":t.handleFormatError,"on-exceeded-size":t.handleMaxSize,"before-upload":t.handleBeforeUpload}})],2),t._v(" "),t.uploadIng>0?n("Spin",{attrs:{fix:""}},[n("Icon",{staticClass:"icon-loading",attrs:{type:"ios-loading"}}),t._v(" "),n("div",[t._v(t._s(t.$L("正在上传文件...")))])],1):t._e(),t._v(" "),n("Modal",{staticClass:"teditor-transfer",attrs:{"footer-hide":"",fullscreen:"",transfer:""},on:{"on-visible-change":t.transferChange},model:{value:t.transfer,callback:function(e){t.transfer=e},expression:"transfer"}},[n("div",{attrs:{slot:"close"},slot:"close"},[n("Button",{attrs:{type:"primary",size:"small"}},[t._v(t._s(t.$L("完成")))])],1),t._v(" "),n("div",{staticClass:"teditor-transfer-body"},[n("textarea",{attrs:{id:"T_"+t.id}},[t._v(t._s(t.content))])]),t._v(" "),t.uploadIng>0?n("Spin",{attrs:{fix:""}},[n("Icon",{staticClass:"icon-loading",attrs:{type:"ios-loading"}}),t._v(" "),n("div",[t._v(t._s(t.$L("正在上传文件...")))])],1):t._e()],1)],1)}),[],!1,null,null,null).exports},57127:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(80641);const o={name:"UserInput",props:{value:{type:[String,Number,Array],default:""},uncancelable:{type:Array,default:function(){return[]}},disabledChoice:{type:Array,default:function(){return[]}},placeholder:{default:""},size:{default:"default"},transfer:{type:Boolean,default:!0},multipleMax:{type:Number},maxHiddenInput:{type:Boolean,default:!0},projectId:{type:Number,default:0},noProjectId:{type:Number,default:0}},data:function(){return{loadIng:0,selects:[],list:[],searchKey:null,searchHistory:[],subscribe:null}},mounted:function(){var t=this;this.subscribe=r.Store.subscribe("cacheUserActive",(function(e){var n=t.list.findIndex((function(t){return t.userid==e.userid}));n>-1&&(t.$set(t.list,n,Object.assign({},t.list[n],e)),t.handleSelectData())}))},beforeDestroy:function(){this.subscribe&&(this.subscribe.unsubscribe(),this.subscribe=null)},computed:{maxHiddenClass:function(){var t=this.multipleMax,e=this.maxHiddenInput,n=this.selects;return t&&e&&n.length>=t?"hidden-input":""}},watch:{value:{handler:function(){var t=this,e=this._tmpId=$A.randomString(6);setTimeout((function(){e===t._tmpId&&t.valueChange()}),10)},immediate:!0},selects:function(t){this.$emit("input",t)}},methods:{searchUser:function(t){var e=this;"string"!=typeof t&&(t=""),this.searchKey=t;var n=this.searchHistory.find((function(e){return e.key==t}));n&&(this.list=n.data),n||this.loadIng++,setTimeout((function(){e.searchKey==t?e.$store.dispatch("call",{url:"users/search",data:{keys:{key:t,project_id:e.projectId,no_project_id:e.noProjectId},take:30}}).then((function(n){var r=n.data;e.list=r;var o=e.searchHistory.findIndex((function(e){return e.key==t})),i={key:t,data:r,time:$A.Time()};o>-1?e.searchHistory.splice(o,1,i):e.searchHistory.push(i)})).catch((function(t){var n=t.msg;e.list=[],$A.messageWarning(n)})).finally((function(t){n||e.loadIng--})):n||e.loadIng--}),this.searchHistory.length>0?300:0)},isDisabled:function(t){return 0!==this.disabledChoice.length&&this.disabledChoice.includes(t)},openChange:function(t){t&&this.$nextTick(this.searchUser)},remoteMethod:function(){},valueChange:function(){var t=this;this.selects!=this.value&&($A.isArray(this.value)?this.selects=$A.cloneJSON(this.value):this.value?this.selects=[this.value]:this.selects=[],this.selects.some((function(e){t.list.find((function(t){return t.userid==e}))||(t.list.push({userid:e,nickname:e}),t.$store.dispatch("getUserBasic",{userid:e}))})))},handleSelectData:function(){var t=this;this.__handleSelectTimeout&&clearTimeout(this.__handleSelectTimeout),this.__handleSelectTimeout=setTimeout((function(){if(t.$refs.select){var e=t.$refs.select.getValue();e&&e.some((function(e){var n=t.list.find((function(t){return t.userid==e.value}));n&&(t.$set(e,"label",n.nickname),t.$set(e,"avatar",n.userimg))}))}}),100)}}};const i=(0,n(51900).Z)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:["common-user",t.maxHiddenClass]},[n("Select",{ref:"select",attrs:{transfer:t.transfer,placeholder:t.placeholder,size:t.size,loading:t.loadIng>0,"loading-text":t.$L("加载中..."),"default-label":t.value,"default-event-object":!0,"multiple-max":t.multipleMax,"multiple-uncancelable":t.uncancelable,"remote-method":t.remoteMethod,multiple:"",filterable:"","transfer-class-name":"common-user-transfer"},on:{"on-query-change":t.searchUser,"on-open-change":t.openChange},model:{value:t.selects,callback:function(e){t.selects=e},expression:"selects"}},[t.multipleMax?n("div",{staticClass:"user-drop-prepend",attrs:{slot:"drop-prepend"},slot:"drop-prepend"},[t._v(t._s(t.$L("最多只能选择"+t.multipleMax+"个")))]):t._e(),t._v(" "),t._t("option-prepend"),t._v(" "),t._l(t.list,(function(e,r){return n("Option",{key:r,attrs:{value:e.userid,"key-value":e.email,label:e.nickname,avatar:e.userimg,disabled:t.isDisabled(e.userid)}},[n("div",{staticClass:"user-input-option"},[n("div",{staticClass:"user-input-avatar"},[n("EAvatar",{staticClass:"avatar",attrs:{src:e.userimg}})],1),t._v(" "),n("div",{staticClass:"user-input-nickname"},[t._v(t._s(e.nickname))]),t._v(" "),n("div",{staticClass:"user-input-userid"},[t._v("ID: "+t._s(e.userid))])])])}))],2),t._v(" "),t.loadIng>0?n("div",{staticClass:"common-user-loading"},[n("Loading")],1):t._e()],1)}),[],!1,null,null,null).exports},39157:(t,e,n)=>{"use strict";n.d(e,{Z:()=>H});var r=n(20629),o=n(76095),i=n.n(o);function a(t){return a="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},a(t)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}var w=9,C=13,k=27,x=38,S=40;function O(t,e,n){var r=t;return Object.keys(e).forEach((function(t){n.indexOf(t)>-1?r.dataset[t]=e[t]:delete r.dataset[t]})),r}var E=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&&h(t,e)}(n,t);var e=g(n);function n(t,r){var o;return s(this,n),c(p(o=e.call(this,t,r)),"hoverHandler",void 0),c(p(o),"hoverHandler",void 0),o.clickHandler=null,o.hoverHandler=null,o.mounted=!1,o}return u(n,[{key:"attach",value:function(){y(d(n.prototype),"attach",this).call(this),this.mounted||(this.mounted=!0,this.clickHandler=this.getClickHandler(),this.hoverHandler=this.getHoverHandler(),this.domNode.addEventListener("click",this.clickHandler,!1),this.domNode.addEventListener("mouseenter",this.hoverHandler,!1))}},{key:"detach",value:function(){y(d(n.prototype),"detach",this).call(this),this.mounted=!1,this.clickHandler&&(this.domNode.removeEventListener("click",this.clickHandler),this.clickHandler=null)}},{key:"getClickHandler",value:function(){var t=this;return function(e){var n=t.buildEvent("mention-clicked",e);window.dispatchEvent(n),e.preventDefault()}}},{key:"getHoverHandler",value:function(){var t=this;return function(e){var n=t.buildEvent("mention-hovered",e);window.dispatchEvent(n),e.preventDefault()}}},{key:"buildEvent",value:function(t,e){var n=new Event(t,{bubbles:!0,cancelable:!0});return n.value=f({},this.domNode.dataset),n.event=e,n}}],[{key:"create",value:function(t){var e=y(d(n),"create",this).call(this),r=document.createElement("span");return r.className="ql-mention-denotation-char",r.innerHTML=t.denotationChar,e.appendChild(r),e.innerHTML+=t.value,n.setDataValues(e,t)}},{key:"setDataValues",value:function(t,e){var n=t;return Object.keys(e).forEach((function(t){n.dataset[t]=e[t]})),n}},{key:"value",value:function(t){return t.dataset}}]),n}(i().import("blots/embed"));E.blotName="mention",E.tagName="span",E.className="mention",i().register(E);var T=function(){function t(e,n){var r=this;s(this,t),this.isOpen=!1,this.itemIndex=0,this.mentionCharPos=null,this.cursorPos=null,this.values=[],this.suspendMouseEnter=!1,this.existingSourceExecutionToken=null,this.quill=e,this.options={source:null,renderItem:function(t){return"".concat(t.value)},renderLoading:function(){return null},onSelect:function(t,e){e(t)},mentionDenotationChars:["@"],showDenotationChar:!0,allowedChars:/^[a-zA-Z0-9_]*$/,minChars:0,maxChars:31,offsetTop:2,offsetLeft:0,isolateCharacter:!1,fixMentionsToQuill:!1,positioningStrategy:"normal",defaultMenuOrientation:"bottom",blotName:"mention",dataAttributes:["id","value","denotationChar","link","target","disabled"],linkTarget:"_blank",onOpen:function(){return!0},onBeforeClose:function(){return!0},onClose:function(){return!0},listItemClass:"ql-mention-list-item",mentionContainerClass:"ql-mention-list-container",mentionListClass:"ql-mention-list",spaceAfterInsert:!0,selectKeys:[C]},f(this.options,n,{dataAttributes:Array.isArray(n.dataAttributes)?this.options.dataAttributes.concat(n.dataAttributes):this.options.dataAttributes}),this.mentionContainer=document.createElement("div"),this.mentionContainer.className=this.options.mentionContainerClass?this.options.mentionContainerClass:"",this.mentionContainer.style.cssText="display: none; position: absolute;",this.mentionContainer.onmousemove=this.onContainerMouseMove.bind(this),this.options.fixMentionsToQuill&&(this.mentionContainer.style.width="auto"),this.mentionList=document.createElement("ul"),this.mentionList.id="quill-mention-list",e.root.setAttribute("aria-owns","quill-mention-list"),this.mentionList.className=this.options.mentionListClass?this.options.mentionListClass:"",this.mentionContainer.appendChild(this.mentionList),e.on("text-change",this.onTextChange.bind(this)),e.on("selection-change",this.onSelectionChange.bind(this)),e.container.addEventListener("paste",(function(){setTimeout((function(){var t=e.getSelection();r.onSelectionChange(t)}))})),e.keyboard.addBinding({key:w},this.selectHandler.bind(this)),e.keyboard.bindings[w].unshift(e.keyboard.bindings[w].pop());var o,i=_(this.options.selectKeys);try{for(i.s();!(o=i.n()).done;){var a=o.value;e.keyboard.addBinding({key:a},this.selectHandler.bind(this))}}catch(t){i.e(t)}finally{i.f()}e.keyboard.bindings[C].unshift(e.keyboard.bindings[C].pop()),e.keyboard.addBinding({key:k},this.escapeHandler.bind(this)),e.keyboard.addBinding({key:x},this.upHandler.bind(this)),e.keyboard.addBinding({key:S},this.downHandler.bind(this))}return u(t,[{key:"selectHandler",value:function(){return!(this.isOpen&&!this.existingSourceExecutionToken)||(this.selectItem(),!1)}},{key:"escapeHandler",value:function(){return!this.isOpen||(this.existingSourceExecutionToken&&(this.existingSourceExecutionToken.abandoned=!0),this.hideMentionList(),!1)}},{key:"upHandler",value:function(){return!(this.isOpen&&!this.existingSourceExecutionToken)||(this.prevItem(),!1)}},{key:"downHandler",value:function(){return!(this.isOpen&&!this.existingSourceExecutionToken)||(this.nextItem(),!1)}},{key:"showMentionList",value:function(){"fixed"===this.options.positioningStrategy?document.body.appendChild(this.mentionContainer):this.quill.container.appendChild(this.mentionContainer),this.mentionContainer.style.visibility="hidden",this.mentionContainer.style.display="",this.mentionContainer.scrollTop=0,this.setMentionContainerPosition(),this.setIsOpen(!0)}},{key:"hideMentionList",value:function(){this.options.onBeforeClose(),this.mentionContainer.style.display="none",this.mentionContainer.remove(),this.setIsOpen(!1),this.quill.root.removeAttribute("aria-activedescendant")}},{key:"highlightItem",value:function(){for(var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=0;ei-n&&(this.mentionContainer.scrollTop+=r-i+n)}}},{key:"getItemData",value:function(){var t=this.mentionList.childNodes[this.itemIndex].dataset.link,e=void 0!==t,n=this.mentionList.childNodes[this.itemIndex].dataset.target;return e&&(this.mentionList.childNodes[this.itemIndex].dataset.value=''.concat(t.value,""):0===t.id?'@
'.concat(t.value,'
').concat(t.tip,"
"):t.avatar?'').concat(t.value,"
"):'').concat(t.value,"
")},renderLoading:function(){return"Loading..."},source:function(e,n,r){for(var o="@"==r?"user-mention":"task-mention",i=document.getElementsByClassName("ql-mention-list-container"),a=0;a0&&(t.label&&r.push.apply(r,M(t.label)),n.length>0&&r.push.apply(r,M(n)))})),n(r,e)}))}}}},this.options),this.quill=new(i())(this.$refs.editor,this._options),this.quill.enable(!1),this.value?this.setContent(this.value):this.$emit("input",this.getInputCache()),this.disabled||this.quill.enable(!0),this.quill.on("selection-change",(function(e){if(!e){if(t.quill.hasFocus())return void t.quill.setSelection(0);if(document.activeElement&&"ql-clipboard"===document.activeElement.className)return void t.quill.setSelection(t.quill.getLength())}t.isFocus=!!e})),this.quill.on("text-change",(function(e){t.maxlength>0&&t.quill.getLength()>t.maxlength&&t.quill.deleteText(t.maxlength,t.quill.getLength());var n=t.$refs.editor.children[0].innerHTML;n=(n=n.replace(/^(\s*<\/p>)+|(
\s*<\/p>)+$/gi,"")).replace(/^(
<\/p>)+|(
<\/p>)+$/gi,""),t._content=n,t.$emit("input",t._content),t.$nextTick((function(e){var n=t.quill.getSelection();if(n){var r=t.quill.getText(n.index);/^\n\n$/.test(r)&&t.quill.deleteText(n.index,1)}}))})),this.quill.clipboard.addMatcher(Node.ELEMENT_NODE,(function(t,e){return e.ops=e.ops.map((function(t){var e={attributes:{},insert:t.insert};return t.attributes&&["bold","strike","italic","underline","list","blockquote","link"].some((function(n){t.attributes[n]&&(e.attributes[n]=t.attributes[n])})),e})),e})),this.$emit("on-ready",this.quill),this.disabledRecord||$A.loadScriptS(["js/recorder/recorder.mp3.min.js","js/recorder/lib.fft.js","js/recorder/frequency.histogram.view.js"],(function(e){null===e&&"function"==typeof window.Recorder&&(t.recordRec=window.Recorder({type:"mp3",bitRate:32,sampleRate:16e3,onProcess:function(e,n,r,o,i,a){t.recordWave.input(e[e.length-1],n,o),t.recordDuration=r,r>=18e4&&t.stopRecord(!1)}}),window.Recorder.Support()&&(t.recordReady=!0,t.$nextTick((function(e){t.recordWave=window.Recorder.FrequencyHistogramView({elem:t.$refs.recwave,lineCount:90,position:0,minHeight:1,stripeEnable:!1})}))))}))},setText:function(t){this.quill&&this.quill.setText(t)},setContent:function(t){this.quill&&this.quill.setContents(this.quill.clipboard.convert(t))},getInputCache:function(){var t=this.dialogId||"t_".concat(this.taskId),e=this.dialogInputCache.find((function(e){return e.key==t}));return e?e.cache:""},setInputCache:function(t){var e=this,n=this.dialogId||"t_".concat(this.taskId),r=this.dialogInputCache.findIndex((function(t){return t.key==n})),o={key:n,cache:t};r>-1?this.$store.state.dialogInputCache.splice(r,1,o):this.$store.state.dialogInputCache.push(o),this.__setInputCache&&clearTimeout(this.__setInputCache),this.__setInputCache=setTimeout((function(t){$A.setStorage("cacheDialogInput",e.$store.state.dialogInputCache)}),600)},focus:function(){var t=this;this.$nextTick((function(){t.quill&&(t.quill.setSelection(t.quill.getLength()),t.quill.focus())}))},blur:function(){var t=this;this.$nextTick((function(){t.quill&&t.quill.blur()}))},clickSend:function(t,e){if(!this.loading)switch(t){case"down":if(this.touchLimitX=!1,this.touchLimitY=!1,this.touchStart="touchstart"===e.type?e.touches[0]:e,this.startRecord())return;break;case"move":var n="touchmove"===e.type?e.touches[0]:e;this.touchLimitX=(this.touchStart.clientX-n.clientX)/window.innerWidth>.1,this.touchLimitY=(this.touchStart.clientY-n.clientY)/window.innerHeight>.1;break;case"up":if(this.stopRecord(this.touchLimitY))return;if(this.touchLimitY||this.touchLimitX)return;this.onSend()}},onSend:function(){this.rangeIndex=0,this.$emit("on-send")},startRecord:function(){var t=this;return"recorder"===this.sendClass&&(this.recordDuration=0,this.recordState="ready",this.$nextTick((function(e){t.recordRec.open((function(e){"ready"===t.recordState?(t.recordState="ing",t.recordBlob=null,setTimeout((function(e){t.recordRec.start()}),300)):t.recordRec.close()}),(function(e){t.recordState="stop",$A.messageError(e||"打开录音失败")}))})),!0)},stopRecord:function(t){var e=this;switch(this.recordState){case"ing":return this.recordState="stop",this.recordRec.stop((function(n,r){e.recordRec.close(),!0!==t&&(r<600?$A.messageWarning("说话时间太短"):(e.recordBlob=n,e.uploadRecord(r)))}),(function(t){e.recordRec.close(),$A.messageError(t||"录音失败")})),!0;case"ready":return this.recordState="stop",!0;default:return this.recordState="stop",!1}},hidePopover:function(){this.showEmoji=!1,this.showMore=!1},onClickCover:function(){var t=this;this.hidePopover(),this.$nextTick((function(e){var n;null===(n=t.quill)||void 0===n||n.focus()}))},uploadRecord:function(t){var e=this;if(null!==this.recordBlob){var n=new FileReader;n.onloadend=function(){e.$emit("on-record",{type:e.recordBlob.type,base64:n.result,duration:t})},n.readAsDataURL(this.recordBlob)}},onSelectEmoji:function(t){if(this.quill)if("emoji"===t.type){var e=document.createElement("span");e.innerHTML=t.html,this.quill.insertText(this.rangeIndex,e.innerHTML),this.rangeIndex+=e.innerHTML.length,e=null,this.windowLarge&&(this.showEmoji=!1,this.quill.setSelection(this.rangeIndex))}else"emoticon"===t.type&&(this.$emit("on-send",'
')),this.showEmoji=!1)},onCancelReply:function(){this.$emit("on-cancel-reply")},onToolbar:function(t){switch(this.hidePopover(),t){case"user":this.openMenu("@");break;case"task":this.openMenu("#");break;case"meeting":$.Store.set("addMeeting",{type:"create",dialog_id:this.dialogId,userids:[this.userId]});break;case"image":case"file":this.$emit("on-more",t)}},onMoreVisibleChange:function(t){this.showMore=t},openMenu:function(t){if(this.quill)if(0===this.value.length||this.value.endsWith("
"))this.quill.getModule("mention").openMenu(t);else{var e=this.value.replace(/<[^>]+>/g,"");0===e.length||e.endsWith(" ")?this.quill.getModule("mention").openMenu(t):this.quill.getModule("mention").openMenu(" ".concat(t))}},getProjectId:function(){var t=this,e=null;if(this.dialogId>0){if(e=this.cacheProjects.find((function(e){return e.dialog_id==t.dialogId})))return e.id;if(e=this.cacheTasks.find((function(e){return e.dialog_id==t.dialogId})))return e.project_id}else if(this.taskId>0&&(e=this.cacheTasks.find((function(e){return e.id==t.taskId}))))return e.project_id;return 0},getMentionSource:function(t,e,n){var r=this;switch(t){case"@":this.mentionMode="user-mention";var o=function(t){r.getMoreUser(e,t.map((function(t){return t.id}))).then((function(e){var o,i;(r.userList=t,r.userCache=[],e.length>0)?(t.length>2&&r.userCache.push({label:null,list:[{id:0,value:r.$L("所有人"),tip:r.$L("仅提示会话内成员")}]}),(o=r.userCache).push.apply(o,[{label:[{id:0,value:r.$L("会话内成员"),disabled:!0}],list:t},{label:[{id:0,value:r.$L("会话以外成员"),disabled:!0}],list:e}])):t.length>2?(i=r.userCache).push.apply(i,[{label:null,list:[{id:0,value:r.$L("所有人"),tip:r.$L("提示所有成员")}]},{label:[{id:0,value:r.$L("会话内成员"),disabled:!0}],list:t}]):r.userCache.push({label:null,list:t});n(r.userCache)}))};if(this.dialogData.people&&$A.arrayLength(this.userList)!==this.dialogData.people&&(this.userList=null,this.userCache=null),null!==this.userCache&&n(this.userCache),null!==this.userList)return void o(this.userList);var i=[];if(this.dialogId>0)this.$store.dispatch("call",{url:"dialog/user",data:{dialog_id:this.dialogId,getuser:1}}).then((function(t){var e=t.data;r.cacheDialogs.find((function(t){return t.id==r.dialogId}))&&r.$store.dispatch("saveDialog",{id:r.dialogId,people:e.length}),e.length>0&&i.push.apply(i,M(e.map((function(t){return{id:t.userid,value:t.nickname,avatar:t.userimg,online:t.online}})))),o(i)})).catch((function(t){o(i)}));else if(this.taskId>0){var a=this.cacheTasks.find((function(t){return t.id==r.taskId}));a&&$A.isArray(a.task_user)&&a.task_user.some((function(t){var e=r.cacheUserBasic.find((function(e){return e.userid==t.userid}));e&&i.push({id:e.userid,value:e.nickname,avatar:e.userimg,online:e.online})})),o(i)}break;case"#":if(this.mentionMode="task-mention",null!==this.taskList)return void n(this.taskList);var s=function(t){r.taskList=[],t.length>0&&(t=t.map((function(t){return{id:t.id,value:t.name}})),r.taskList.push({label:[{id:0,value:r.$L("项目未完成任务"),disabled:!0}],list:t}));var e=r.$store.getters.transforTasks(r.$store.getters.dashboardTask.all);e.length>0&&(e=e.sort((function(t,e){return $A.Date(t.end_at||"2099-12-31 23:59:59")-$A.Date(e.end_at||"2099-12-31 23:59:59")})),r.taskList.push({label:[{id:0,value:r.$L("我的待完成任务"),disabled:!0}],list:e.map((function(t){return{id:t.id,value:t.name}}))})),n(r.taskList)},l=this.getProjectId();if(l>0)return void this.$store.dispatch("getTaskForProject",l).then((function(t){var e=r.cacheTasks.filter((function(t){return!t.archived_at&&(t.project_id==l&&0===t.parent_id&&!t.archived_at&&!t.complete_at)}));e.length>0?s(e):s([])})).catch((function(t){s([])}));s([]);break;default:n([])}},getMoreUser:function(t,e){var n=this;return new Promise((function(r){var o=n.dialogData,i=o.owner_id,a="group"===o.type&&[0,n.userId].includes(i);n.taskId>0||a?(console.log(n.dialogData),n.__getMoreTimer&&clearTimeout(n.__getMoreTimer),n.__getMoreTimer=setTimeout((function(o){n.$store.dispatch("call",{url:"users/search",data:{keys:{key:t},state:1,take:30}}).then((function(t){var n=t.data.filter((function(t){return!e.includes(t.userid)}));r(n.map((function(t){return{id:t.userid,value:t.nickname,avatar:t.userimg,online:!!t.online}})))})).catch((function(t){r([])}))}),null===n.userCache?0:600)):r([])}))},checkIOSVersion:function(){var t=(window&&window.navigator&&window.navigator.userAgent).match(/OS ((\d+_?){2,3})\s/i),e=(t?t[1].replace(/_/g,"."):"unknown").split(".");return 11==+e[0]&&+e[1]>=0&&+e[1]<3},handlePaste:function(t){var e=t.clipboardData.files,n=Array.prototype.slice.call(e).filter((function(t){return!$A.leftExists(t.type,"image/")}));n.length>0&&(t.preventDefault(),this.$emit("on-file",n))}}};const H=(0,D.Z)(U,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:t.hidePopover,expression:"hidePopover"}],staticClass:"chat-input-box",class:t.boxClass},[n("div",{staticClass:"chat-input-wrapper",on:{click:function(e){return e.stopPropagation(),t.focus.apply(null,arguments)}}},[t.replyData?n("div",{staticClass:"chat-reply"},[n("UserAvatar",{attrs:{userid:t.replyData.userid,"show-icon":!1,"show-name":!0,"tooltip-disabled":!0}}),t._v(" "),n("div",{staticClass:"reply-desc"},[t._v(t._s(t.$A.getMsgSimpleDesc(t.replyData)))]),t._v(" "),n("i",{staticClass:"taskfont",on:{click:function(e){return e.stopPropagation(),t.onCancelReply.apply(null,arguments)}}},[t._v("")])],1):t._e(),t._v(" "),n("div",{ref:"editor",staticClass:"no-dark-content",style:t.editorStyle,on:{click:function(t){t.stopPropagation()},paste:t.handlePaste}}),t._v(" "),n("ul",{staticClass:"chat-toolbar",on:{click:function(t){t.stopPropagation()}}},[n("li",[t.emojiBottom?n("ETooltip",{ref:"emojiTip",attrs:{disabled:t.windowSmall||t.showEmoji,placement:"top",content:t.$L("表情")}},[n("i",{staticClass:"taskfont",on:{click:function(e){t.showEmoji=!t.showEmoji}}},[t._v("")])]):n("EPopover",{attrs:{visibleArrow:!1,placement:"top",popperClass:"chat-input-emoji-popover"},model:{value:t.showEmoji,callback:function(e){t.showEmoji=e},expression:"showEmoji"}},[n("ETooltip",{ref:"emojiTip",attrs:{slot:"reference",disabled:t.windowSmall||t.showEmoji,placement:"top",content:t.$L("表情")},slot:"reference"},[n("i",{staticClass:"taskfont"},[t._v("")])]),t._v(" "),n("ChatEmoji",{on:{"on-select":t.onSelectEmoji}})],1)],1),t._v(" "),n("li",[n("ETooltip",{attrs:{placement:"top",disabled:t.windowSmall,content:t.$L("选择会员")}},[n("i",{staticClass:"taskfont",on:{click:function(e){return t.onToolbar("user")}}},[t._v("")])])],1),t._v(" "),n("li",[n("ETooltip",{attrs:{placement:"top",disabled:t.windowSmall,content:t.$L("选择任务")}},[n("i",{staticClass:"taskfont",on:{click:function(e){return t.onToolbar("task")}}},[t._v("")])])],1),t._v(" "),n("li",[n("EPopover",{attrs:{visibleArrow:!1,placement:"top",popperClass:"chat-input-more-popover"},model:{value:t.showMore,callback:function(e){t.showMore=e},expression:"showMore"}},[n("ETooltip",{ref:"moreTip",attrs:{slot:"reference",disabled:t.windowSmall||t.showMore,placement:"top",content:t.$L("展开")},slot:"reference"},[n("i",{staticClass:"taskfont"},[t._v("")])]),t._v(" "),t.recordReady?n("div",{staticClass:"chat-input-popover-item",on:{click:function(e){return t.onToolbar("meeting")}}},[n("i",{staticClass:"taskfont"},[t._v("")]),t._v("\n "+t._s(t.$L("新会议"))+"\n ")]):t._e(),t._v(" "),n("div",{staticClass:"chat-input-popover-item",on:{click:function(e){return t.onToolbar("image")}}},[n("i",{staticClass:"taskfont"},[t._v("")]),t._v("\n "+t._s(t.$L("发送图片"))+"\n ")]),t._v(" "),n("div",{staticClass:"chat-input-popover-item",on:{click:function(e){return t.onToolbar("file")}}},[n("i",{staticClass:"taskfont"},[t._v("")]),t._v("\n "+t._s(t.$L("上传文件"))+"\n ")])],1)],1),t._v(" "),n("li",{directives:[{name:"touchmouse",rawName:"v-touchmouse",value:t.clickSend,expression:"clickSend"}],staticClass:"chat-send",class:t.sendClass},[n("ETooltip",{attrs:{placement:"top",disabled:t.windowSmall,content:t.$L("recorder"===t.sendClass?"长按录音":"发送")}},[t.loading?n("div",[n("div",{staticClass:"chat-load"},[n("Loading")],1)]):n("div",[n("transition",{attrs:{name:"mobile-send"}},["recorder"===t.sendClass?n("i",{staticClass:"taskfont"},[t._v("")]):t._e()]),t._v(" "),n("transition",{attrs:{name:"mobile-send"}},["recorder"!==t.sendClass?n("i",{staticClass:"taskfont"},[t._v("")]):t._e()])],1)])],1),t._v(" "),t.recordReady?n("li",{staticClass:"chat-record-recwave"},[n("div",{ref:"recwave"})]):t._e()]),t._v(" "),n("div",{staticClass:"chat-cover",on:{click:function(e){return e.stopPropagation(),t.onClickCover.apply(null,arguments)}}})]),t._v(" "),t.emojiBottom&&t.showEmoji?n("ChatEmoji",{on:{"on-select":t.onSelectEmoji}}):t._e(),t._v(" "),n("transition",{attrs:{name:"fade"}},[["ready","ing"].includes(t.recordState)?n("div",{directives:[{name:"transfer-dom",rawName:"v-transfer-dom"}],staticClass:"chat-input-record-transfer",class:{cancel:t.touchLimitY},style:t.recordTransferStyle,attrs:{"data-transfer":!0},on:{click:t.stopRecord}},[t.recordDuration>0?n("div",{staticClass:"record-duration"},[t._v(t._s(t.recordFormatDuration))]):n("div",{staticClass:"record-loading"},[n("Loading")],1),t._v(" "),n("div",{staticClass:"record-cancel",on:{click:function(e){return e.stopPropagation(),t.stopRecord(!0)}}},[t._v(t._s(t.$L(t.touchLimitY?"松开取消":"向上滑动取消")))])]):t._e()])],1)}),[],!1,null,null,null).exports},25895:(t,e,n)=>{"use strict";n.d(e,{Z:()=>P});var r=n(20629);const o={name:"WCircle",props:{percent:{type:Number,default:0},size:{type:Number,default:120}},computed:{style:function(){var t=this.size;return this.isNumeric(t)&&(t+="px"),{width:t,height:t}},args:function(){var t=this.percent,e=Math.min(360,3.6*t);return 360==e?e=0:0==e&&(e=360),{x:14,y:14,r:14,start:360,end:e}}},methods:{isNumeric:function(t){return""!==t&&!isNaN(parseFloat(t))&&isFinite(t)},point:function(t,e,n,r){return[(t+Math.sin(r)*n).toFixed(2),(e-Math.cos(r)*n).toFixed(2)]},full:function(t,e,n,r){return r<=0?"M ".concat(t-n," ").concat(e," A ").concat(n," ").concat(n," 0 1 1 ").concat(t+n," ").concat(e," A ").concat(n," ").concat(n," 1 1 1 ").concat(t-n," ").concat(e," Z"):"M ".concat(t-n," ").concat(e," A ").concat(n," ").concat(n," 0 1 1 ").concat(t+n," ").concat(e," A ").concat(n," ").concat(n," 1 1 1 ").concat(t-n," ").concat(e," M ").concat(t-r," ").concat(e," A ").concat(r," ").concat(r," 0 1 1 ").concat(t+r," ").concat(e," A ").concat(r," ").concat(r," 1 1 1 ").concat(t-r," ").concat(e," Z")},part:function(t,e,n,r,o,i){var a=o/360*2*Math.PI,s=i/360*2*Math.PI,l=[this.point(t,e,r,a),this.point(t,e,n,a),this.point(t,e,n,s),this.point(t,e,r,s)],u=s-a>Math.PI?"1":"0";return"M ".concat(l[0][0]," ").concat(l[0][1]," L ").concat(l[1][0]," ").concat(l[1][1]," A ").concat(n," ").concat(n," 0 ").concat(u," 1 ").concat(l[2][0]," ").concat(l[2][1]," L ").concat(l[3][0]," ").concat(l[3][1]," A ").concat(r," ").concat(r," 0 ").concat(u," 0 ").concat(l[0][0]," ").concat(l[0][1]," Z")},arc:function(t){var e=t.x,n=void 0===e?0:e,r=t.y,o=void 0===r?0:r,i=t.R,a=void 0===i?0:i,s=t.r,l=void 0===s?0:s,u=t.start,c=t.end,f=[Math.max(a,l),Math.min(a,l)];if(l=f[1],(a=f[0])<=0)return"";if(u!==+u||c!==+c)return this.full(n,o,a,l);if(Math.abs(u-c)<1e-6)return"";if(Math.abs(u-c)%360<1e-6)return this.full(n,o,a,l);var d=[u%360,c%360];return(u=d[0])>(c=d[1])&&(c+=360),this.part(n,o,a,l,u,c)}}};var i=n(51900);const a=(0,i.Z)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"common-circle",style:t.style,attrs:{"data-id":t.percent}},[n("svg",{attrs:{viewBox:"0 0 28 28"}},[n("g",{attrs:{fill:"none","fill-rule":"evenodd"}},[n("path",{staticClass:"common-circle-path",attrs:{d:"M-500-100h997V48h-997z"}}),t._v(" "),n("g",{attrs:{"fill-rule":"nonzero"}},[n("path",{staticClass:"common-circle-g-path-ring",attrs:{"stroke-width":"3",d:"M14 25.5c6.351 0 11.5-5.149 11.5-11.5S20.351 2.5 14 2.5 2.5 7.649 2.5 14 7.649 25.5 14 25.5z"}}),t._v(" "),n("path",{staticClass:"common-circle-g-path-core",attrs:{d:t.arc(t.args)}})])])])])}),[],!1,null,null,null).exports;var s=n(80641);function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e]*?>$/.test(r.text)||/^\s*\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){1,3}\s*<\/p>\s*$/.test(r.text))&&i.push("transparent"),i},contentClass:function(){var t=this.msgData,e=t.type,n=t.msg,r=[];return"text"===e&&(/^
]*?>$/.test(n.text)?r.push("an-emoticon"):/^\s*
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){3}\s*<\/p>\s*$/.test(n.text)?r.push("three-emoji"):/^\s*
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){2}\s*<\/p>\s*$/.test(n.text)?r.push("two-emoji"):/^\s*
\s*[\uD800-\uDBFF][\uDC00-\uDFFF]\s*<\/p>\s*$/.test(n.text)&&r.push("an-emoji")),r}}),watch:{msgData:{handler:function(){this.msgRead()},immediate:!0},windowActive:function(t){t&&this.msgRead()},operateAction:function(t){var e=this;this.operateEnter=!1,t&&setTimeout((function(t){e.operateEnter=!0}),500)}},methods:{handleLongpress:function(t,e){this.$emit("on-longpress",{event:t,el:e,msgData:this.msgData})},msgRead:function(){this.windowActive&&this.$store.dispatch("dialogMsgRead",this.msgData)},openReadPercentage:function(){var t=this;this.popperLoad>0||(this.popperShow?this.popperShow=!1:(this.popperLoad++,this.$store.dispatch("call",{url:"dialog/msg/readlist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.allList=n})).catch((function(){t.allList=[]})).finally((function(e){setTimeout((function(){t.popperLoad--,t.popperShow=!0}),100)}))))},recordStyle:function(t){var e=t.duration;return{width:50+Math.min(180,Math.floor(e/150))+"px"}},recordDuration:function(t){var e=Math.floor(t/6e4),n=Math.floor(t/1e3)%60;return e>0?"".concat(e,":").concat(n,"″"):"".concat(Math.max(1,n),"″")},imageStyle:function(t){var e=t.width,n=t.height;if(e&&n){var r=e,o=n;return(e>220||n>220)&&(e>n?(r=220,o=n*(220/e)):(r=e*(220/n),o=220)),{width:r+"px",height:o+"px"}}return{}},playRecord:function(){this.operateVisible||s.Store.set("audioSubscribe",{id:this.msgData.id,src:this.msgData.msg.path})},openMeeting:function(){this.operateVisible||s.Store.set("addMeeting",{type:"join",name:this.msgData.msg.name,meetingid:this.msgData.msg.meetingid,meetingdisabled:!0})},viewReply:function(){this.$emit("on-view-reply",{msg_id:this.msgData.id,reply_id:this.msgData.reply_id})},viewText:function(t){this.$emit("on-view-text",t)},viewFile:function(){this.$emit("on-view-file",this.msgData)},downFile:function(){this.$emit("on-down-file",this.msgData)},replyList:function(){this.$emit("on-reply-list",{msg_id:this.msgData.id})},onEmoji:function(t){this.$emit("on-emoji",{msg_id:this.msgData.id,symbol:t})}}};function d(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e0?n("ul",{staticClass:"dialog-emoji"},t._l(t.msgData.emoji,(function(e,r){return n("li",{key:r,class:{hasme:e.userids.includes(t.userId)},on:{click:function(n){return t.onEmoji(e.symbol)}}},[n("div",{staticClass:"emoji-symbol no-dark-content"},[t._v(t._s(e.symbol))]),t._v(" "),n("div",{staticClass:"emoji-num"},[t._v(t._s(e.userids.length))])])})),0):t._e()]),t._v(" "),n("div",{staticClass:"dialog-foot"},[!t.hideReply&&t.msgData.reply_num>0?n("div",{staticClass:"reply",on:{click:t.replyList}},[n("i",{staticClass:"taskfont"},[t._v("")]),t._v("\n "+t._s(t.msgData.reply_num)+"条回复\n ")]):t._e(),t._v(" "),t.msgData.tag?n("div",{staticClass:"tag"},[n("i",{staticClass:"taskfont"},[t._v("")])]):t._e(),t._v(" "),t.isLoading?n("Loading"):[t.timeShow?n("div",{staticClass:"time",on:{click:function(e){t.timeShow=!1}}},[t._v(t._s(t.msgData.created_at))]):n("div",{staticClass:"time",attrs:{title:t.msgData.created_at},on:{click:function(e){t.timeShow=!0}}},[t._v(t._s(t.$A.formatTime(t.msgData.created_at)))]),t._v(" "),t.hidePercentage?t._e():[t.msgData.send>1||"group"===t.dialogType?n("div",{staticClass:"percent",on:{click:t.openReadPercentage}},[n("EPopover",{ref:"percent",attrs:{"popper-class":"dialog-wrapper-read-poptip",placement:"left-end"},model:{value:t.popperShow,callback:function(e){t.popperShow=e},expression:"popperShow"}},[n("div",{staticClass:"read-poptip-content"},[n("ul",{staticClass:"read scrollbar-overlay"},[n("li",{staticClass:"read-title"},[n("em",[t._v(t._s(t.readList.length))]),t._v(t._s(t.$L("已读")))]),t._v(" "),t._l(t.readList,(function(t){return n("li",[n("UserAvatar",{attrs:{userid:t.userid,size:26,showName:""}})],1)}))],2),t._v(" "),n("ul",{staticClass:"unread scrollbar-overlay"},[n("li",{staticClass:"read-title"},[n("em",[t._v(t._s(t.unreadList.length))]),t._v(t._s(t.$L("未读")))]),t._v(" "),t._l(t.unreadList,(function(t){return n("li",[n("UserAvatar",{attrs:{userid:t.userid,size:26,showName:""}})],1)}))],2)]),t._v(" "),n("div",{attrs:{slot:"reference"},slot:"reference"})]),t._v(" "),t.popperLoad>0?n("Loading"):n("WCircle",{attrs:{percent:t.msgData.percentage,size:14}})],1):100===t.msgData.percentage?n("Icon",{staticClass:"done",attrs:{type:"md-done-all"}}):n("Icon",{staticClass:"done",attrs:{type:"md-checkmark"}})]]],2)])}),[],!1,null,null,null).exports},props:{source:{type:Object,default:function(){return{}}},dialogData:{type:Object,default:function(){return{}}},hidePercentage:{type:Boolean,default:!1},hideReply:{type:Boolean,default:!1},isReply:{type:Boolean,default:!1},operateVisible:{type:Boolean,default:!1},operateItem:{type:Object,default:function(){return{}}}},data:function(){return{subscribe:null}},computed:h(h({},(0,r.rn)(["userId"])),{},{classArray:function(){return{"dialog-item":!0,self:!this.isReply&&this.source.userid==this.userId}}}),methods:{onViewTag:function(){this.onViewReply({msg_id:this.source.id,reply_id:this.source.msg.data.id})},onLongpress:function(t){this.dispatch("on-longpress",t)},onViewReply:function(t){this.dispatch("on-view-reply",t)},onViewText:function(t){this.dispatch("on-view-text",t)},onViewFile:function(t){this.dispatch("on-view-file",t)},onDownFile:function(t){this.dispatch("on-down-file",t)},onReplyList:function(t){this.dispatch("on-reply-list",t)},onEmoji:function(t){this.dispatch("on-emoji",t)},dispatch:function(t,e){if(this.isReply)this.$emit(t,e);else{for(var n=this.$parent,r=n.$options.name;n&&(!r||"virtual-list"!==r);)(n=n.$parent)&&(r=n.$options.name);n&&n.$emit(t,e)}}}};const g=(0,i.Z)(m,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.classArray},["tag"===t.source.type?n("div",{staticClass:"dialog-tag",on:{click:t.onViewTag}},[n("div",{staticClass:"tag-user"},[n("UserAvatar",{attrs:{userid:t.source.userid,tooltipDisabled:t.source.userid==t.userId,"show-name":!0,"show-icon":!1}})],1),t._v("\n "+t._s(t.$L("remove"===t.source.msg.action?"取消标注":"标注了"))+'\n "'+t._s(t.$A.getMsgSimpleDesc(t.source.msg.data))+'"\n ')]):"notice"===t.source.type?n("div",{staticClass:"dialog-notice"},[t._v("\n "+t._s(t.source.msg.notice)+"\n ")]):[n("div",{staticClass:"dialog-avatar"},[n("UserAvatar",{attrs:{userid:t.source.userid,tooltipDisabled:t.source.userid==t.userId,size:30}})],1),t._v(" "),n("DialogView",{attrs:{"msg-data":t.source,"dialog-type":t.dialogData.type,"hide-percentage":t.hidePercentage,"hide-reply":t.hideReply,"operate-visible":t.operateVisible,"operate-action":t.operateVisible&&t.source.id===t.operateItem.id},on:{"on-longpress":t.onLongpress,"on-view-reply":t.onViewReply,"on-view-text":t.onViewText,"on-view-file":t.onViewFile,"on-down-file":t.onDownFile,"on-reply-list":t.onReplyList,"on-emoji":t.onEmoji}})]],2)}),[],!1,null,null,null).exports;const v={name:"DialogUpload",props:{dialogId:{type:Number,default:0},replyId:{type:Number,default:0},maxSize:{type:Number,default:1024e3}},data:function(){return{uploadFormat:["text","md","markdown","drawio","mind","docx","wps","doc","xls","xlsx","ppt","pptx","jpg","jpeg","png","gif","bmp","ico","raw","svg","rar","zip","jar","7-zip","tar","gzip","7z","gz","apk","dmg","tif","tiff","dwg","dxf","ofd","pdf","txt","htaccess","htgroups","htpasswd","conf","bat","cmd","cpp","c","cc","cxx","h","hh","hpp","ino","cs","css","dockerfile","go","golang","html","htm","xhtml","vue","we","wpy","java","js","jsm","jsx","json","jsp","less","lua","makefile","gnumakefile","ocamlmakefile","make","mysql","nginx","ini","cfg","prefs","m","mm","pl","pm","p6","pl6","pm6","pgsql","php","inc","phtml","shtml","php3","php4","php5","phps","phpt","aw","ctp","module","ps1","py","r","rb","ru","gemspec","rake","guardfile","rakefile","gemfile","rs","sass","scss","sh","bash","bashrc","sql","sqlserver","swift","ts","typescript","str","vbs","vb","v","vh","sv","svh","xml","rdf","rss","wsdl","xslt","atom","mathml","mml","xul","xbl","xaml","yaml","yml","asp","properties","gitignore","log","bas","prg","python","ftl","aspx","plist","mp3","wav","mp4","flv","avi","mov","wmv","mkv","3gp","rm","xmind","rp"],actionUrl:$A.apiUrl("dialog/msg/sendfile")}},computed:{headers:function(){return{fd:$A.getSessionStorageString("userWsFd"),token:this.userToken}},params:function(){return{dialog_id:this.dialogId,reply_id:this.replyId}}},methods:{handleProgress:function(t,e){void 0===e.tempId&&(e.tempId=$A.randomString(8),this.$emit("on-progress",e))},handleSuccess:function(t,e){1===t.ret?(e.data=t.data,this.$emit("on-success",e),t.data.task_id&&this.$store.dispatch("getTaskFiles",t.data.task_id)):($A.modalWarning({title:"发送失败",content:"文件 "+e.name+" 发送失败,"+t.msg}),this.$emit("on-error",e),this.$refs.upload.fileList.pop())},handleFormatError:function(t){$A.modalWarning({title:"文件格式不正确",content:"文件 "+t.name+" 格式不正确,仅支持发送:"+this.uploadFormat.join(",")})},handleMaxSize:function(t){$A.modalWarning({title:"超出文件大小限制",content:"文件 "+t.name+" 太大,不能发送超过"+$A.bytesToSize(1024*this.maxSize)+"。"})},handleClick:function(){this.$refs.upload.handleClick()},upload:function(t){this.$refs.upload.upload(t)}}};const y=(0,i.Z)(v,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("Upload",{ref:"upload",attrs:{name:"files",action:t.actionUrl,headers:t.headers,data:t.params,multiple:"",format:t.uploadFormat,"show-upload-list":!1,"max-size":t.maxSize,"on-progress":t.handleProgress,"on-success":t.handleSuccess,"on-format-error":t.handleFormatError,"on-exceeded-size":t.handleMaxSize}})}),[],!1,null,null,null).exports;var b=n(57127),_=n(99383);function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function C(t){for(var e=1;e0?e.getDialogUser():(e.$store.dispatch("forgetDialog",e.dialogId),e.goForward({name:"manage-messenger"}))})).catch((function(t){var e=t.msg;n(e)}))}))}})},onDisband:function(){var t=this;$A.modalConfirm({content:"你确定要解散【".concat(this.dialogData.name,"】群组吗?"),loading:!0,okText:"解散",onOk:function(){return new Promise((function(e,n){t.$store.dispatch("call",{url:"dialog/group/disband",data:{dialog_id:t.dialogId}}).then((function(n){var r=n.msg;e(r),t.$store.dispatch("forgetDialog",t.dialogId),t.goForward({name:"manage-messenger"})})).catch((function(t){var e=t.msg;n(e)}))}))}})}}};const S=(0,i.Z)(x,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"dialog-group-info"},[n("div",{staticClass:"group-info-title"},[t._v(t._s(t.$L("群名")))]),t._v(" "),n("div",{staticClass:"group-info-value"},[n("QuickEdit",{attrs:{value:t.dialogData.name,disabled:t.dialogData.owner_id!=t.userId},on:{"on-update":t.updateName}},[t._v(t._s(t.dialogData.name))])],1),t._v(" "),n("div",{staticClass:"group-info-title"},[t._v(t._s(t.$L("群类型")))]),t._v(" "),n("div",{staticClass:"group-info-value"},[t._v(t._s(t.$L(t.groupType)))]),t._v(" "),n("div",{staticClass:"group-info-search"},[n("Input",{attrs:{prefix:"ios-search",placeholder:t.$L("搜索"),clearable:""},model:{value:t.searchKey,callback:function(e){t.searchKey=e},expression:"searchKey"}})],1),t._v(" "),n("div",{staticClass:"group-info-user"},[n("ul",[t._l(t.userList,(function(e,r){return n("li",{key:r},[n("UserAvatar",{attrs:{userid:e.userid,size:32,showName:"",tooltipDisabled:""}}),t._v(" "),e.userid===t.dialogData.owner_id?n("div",{staticClass:"user-tag"},[t._v(t._s(t.$L("群主")))]):t.dialogData.owner_id==t.userId||e.inviter==t.userId?n("Icon",{staticClass:"user-exit",attrs:{type:"md-exit"},on:{click:function(n){return t.onExit(e)}}}):t._e()],1)})),t._v(" "),0===t.userList.length?n("li",{staticClass:"no"},[t.loadIng>0?n("Loading"):n("span",[t._v(t._s(t.$L("没有符合条件的数据")))])],1):t._e()],2)]),t._v(" "),n("div",{staticClass:"group-info-button"},[t.dialogData.owner_id==t.userId||0==t.dialogData.owner_id?n("Button",{attrs:{type:"primary"},on:{click:t.openAdd}},[t._v(t._s(t.$L("添加成员")))]):t._e(),t._v(" "),t.dialogData.owner_id==t.userId?n("Button",{attrs:{type:"error",ghost:""},on:{click:t.onDisband}},[t._v(t._s(t.$L("解散群组")))]):n("Button",{attrs:{type:"error",ghost:""},on:{click:t.onExit}},[t._v(t._s(t.$L("退出群组")))])],1),t._v(" "),n("Modal",{attrs:{title:t.$L("添加群成员"),"mask-closable":!1},model:{value:t.addShow,callback:function(e){t.addShow=e},expression:"addShow"}},[n("Form",{attrs:{model:t.addData,"label-width":"auto"},nativeOn:{submit:function(t){t.preventDefault()}}},[n("FormItem",{attrs:{prop:"userids",label:t.$L("新增成员")}},[n("UserInput",{attrs:{disabledChoice:t.addData.disabledChoice,"multiple-max":100,placeholder:t.$L("选择项目成员")},model:{value:t.addData.userids,callback:function(e){t.$set(t.addData,"userids",e)},expression:"addData.userids"}})],1)],1),t._v(" "),n("div",{staticClass:"adaption",attrs:{slot:"footer"},slot:"footer"},[n("Button",{attrs:{type:"default"},on:{click:function(e){t.addShow=!1}}},[t._v(t._s(t.$L("取消")))]),t._v(" "),n("Button",{attrs:{type:"primary",loading:t.addLoad>0},on:{click:t.onAdd}},[t._v(t._s(t.$L("确定添加")))])],1)],1)],1)}),[],!1,null,null,null).exports;var O=n(39157),E=n(85662);function T(t){return T="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(t)}function A(t){return function(t){if(Array.isArray(t))return D(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return D(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return D(t,e)}(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 D(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&this.dialogData.id>0},dialogData:function(){var t=this;return this.cacheDialogs.find((function(e){return e.id==t.dialogId}))||{}},dialogMsgList:function(){var t=this;return this.isReady?this.dialogMsgs.filter((function(e){return e.dialog_id==t.dialogId})):[]},tempMsgList:function(){var t=this;return this.isReady?this.tempMsgs.filter((function(e){return e.dialog_id==t.dialogId})):[]},allMsgList:function(){var t=this,e=this.dialogMsgList.filter((function(e){return t.msgFilter(e)})).sort((function(t,e){return t.id-e.id})),n=this.tempMsgList.filter((function(e){return t.msgFilter(e)}));if(n.length>0){var r=[];return r.push.apply(r,A(e)),r.push.apply(r,A(n)),r}return e},loadMsg:function(){return this.isLoad("msg::".concat(this.dialogId,"-").concat(this.msgId,"-").concat(this.msgType))},prevId:function(){return this.allMsgs.length>0?$A.runNum(this.allMsgs[0].prev_id):0},peopleNum:function(){return"group"===this.dialogData.type?$A.runNum(this.dialogData.people):0},pasteTitle:function(){var t=this.pasteItem,e=t.find((function(t){return"image"==t.type})),n=t.find((function(t){return"image"!=t.type}));return e&&n?"发送文件/图片":e?"发送图片":"发送文件"},msgTags:function(){var t=[{icon:"",type:"",label:"消息"}];return this.dialogData.has_tag&&t.push({icon:"",type:"tag",label:"标注"}),this.dialogData.has_image&&t.push({icon:"",type:"image",label:"图片"}),this.dialogData.has_file&&t.push({icon:"",type:"file",label:"文件"}),this.dialogData.has_link&&t.push({icon:"",type:"link",label:"链接"}),t},wrapperClass:function(){return["ready","ing"].includes(this.recordState)?["record-ready"]:null},scrollerClass:function(){return!this.$slots.head&&this.msgTags.length>1&&0===this.windowScrollY?"default-header":null},pasteWrapperClass:function(){return this.pasteItem.find((function(t){return"image"!==t.type}))?["multiple"]:[]},footerClass:function(){return this.msgNew>0&&this.allMsgs.length>0?"newmsg":this.scrollTail>500?"goto":null},msgUnreadOnly:function(){var t=0;return this.cacheDialogs.some((function(e){t+=$A.getDialogUnread(e)})),t<=0?"":(t>99&&(t="99+"),String(t))},isMyDialog:function(){var t=this.dialogData,e=this.userId;return t.dialog_user&&t.dialog_user.userid==e},replyId:function(){return parseInt(this.msgId>0?this.msgId:this.replyActiveId)},replyItem:function(){var t=this;return this.replyId?this.dialogMsgs.find((function(e){return e.id===t.replyId})):null},replyListItem:function(){var t=this;return this.replyListId?this.dialogMsgs.find((function(e){return e.id==t.replyListId})):null}}),watch:{dialogId:{handler:function(t){var e=this;t&&(this.msgNew=0,this.allMsgList.length>0&&(this.allMsgs=this.allMsgList,requestAnimationFrame(this.onToBottom)),this.msgType="",this.$store.dispatch("getDialogMsgs",{dialog_id:t,msg_id:this.msgId}).then((function(n){e.openId=t,setTimeout(e.onSearchMsgId,100)})).catch((function(t){})),this.$store.dispatch("saveInDialog",{uid:this._uid,dialog_id:t}),this.autoFocus&&this.inputFocus())},immediate:!0},msgType:function(t){this.onToBottom(),t&&this.$store.dispatch("getDialogMsgs",{dialog_id:this.dialogId,msg_id:this.msgId,msg_type:this.msgType}).catch((function(t){}))},dialogSearchMsgId:function(){this.onSearchMsgId()},dialogMsgTransfer:{handler:function(t){var e=this,n=t.time,r=t.msgFile,o=t.msgRecord,i=t.msgText;n>$A.Time()&&(this.$store.state.dialogMsgTransfer.time=0,this.$nextTick((function(){$A.isArray(r)&&r.length>0?e.sendFileMsg(r):$A.isJson(o)&&o.duration>0?e.sendRecord(o):i&&e.sendMsg(i)})))},immediate:!0},wsOpenNum:function(t){t<=1||this.$store.dispatch("getDialogMsgs",{dialog_id:this.dialogId,msg_id:this.msgId,msg_type:this.msgType}).catch((function(t){}))},allMsgList:function(t,e){var n=this.scrollInfo().tail;if(this.allMsgs=t,!this.windowActive||n>10&&e.length>0){var r=e[e.length-1].id,o=t.filter((function(t){return t.id&&t.id>r}));this.msgNew+=o.length}else this.preventToBottom||requestAnimationFrame(this.onToBottom)},windowScrollY:function(t){if($A.isIos()){var e=this.scrollInfo().tail;this.navStyle={marginTop:t+"px"},e<=10&&requestAnimationFrame(this.onToBottom)}},dialogDrag:function(t){t&&(this.operateVisible=!1)},replyActiveIndex:function(t){var e=this;t>-1&&setTimeout((function(t){return e.replyActiveIndex=-1}),800)}},methods:{sendMsg:function(t){var e,n=this;if("string"==typeof t&&t?e=t:(e=this.msgText,this.msgText=""),""!=e){e=e.replace(/<\/span> <\/p>$/,"
"),this.msgType="",this.onToBottom(),this.onActive();var r=$A.randomString(16),o={id:r,dialog_id:this.dialogData.id,reply_id:this.replyId,reply_data:this.replyItem,type:"text",userid:this.userId,msg:{text:$A.stringLength(e)>2e3?"":e}};e.length>2e3&&(o.type="loading",o.msg={}),this.tempMsgs.push(o),this.$store.dispatch("call",{url:"dialog/msg/sendtext",data:{dialog_id:this.dialogId,reply_id:this.replyId,text:e},method:"post"}).then((function(t){var e=t.data;n.tempMsgs=n.tempMsgs.filter((function(t){return t.id!=r})),n.sendSuccess(e)})).catch((function(t){var e=t.msg;$A.modalError(e),n.tempMsgs=n.tempMsgs.filter((function(t){return t.id!=r}))}))}else this.inputFocus()},sendRecord:function(t){var e=this;this.msgType="",this.onToBottom(),this.onActive();var n=$A.randomString(16);this.tempMsgs.push({id:n,dialog_id:this.dialogData.id,reply_id:this.replyId,reply_data:this.replyItem,type:"loading",userid:this.userId,msg:t}),this.$store.dispatch("call",{url:"dialog/msg/sendrecord",data:Object.assign(t,{dialog_id:this.dialogId,reply_id:this.replyId}),method:"post"}).then((function(t){var r=t.data;e.tempMsgs=e.tempMsgs.filter((function(t){return t.id!=n})),e.sendSuccess(r)})).catch((function(t){var r=t.msg;$A.modalError(r),e.tempMsgs=e.tempMsgs.filter((function(t){return t.id!=n}))}))},sendFileMsg:function(t){var e=this,n=$A.isArray(t)?t:[t];n.length>0&&(this.msgType="",this.pasteFile=[],this.pasteItem=[],n.some((function(t){var n={type:$A.getMiddle(t.type,null,"/"),name:t.name,size:t.size,result:null};if("image"===n.type){var r=new FileReader;r.readAsDataURL(t),r.onload=function(r){var o=r.target;n.result=o.result,e.pasteFile.push(t),e.pasteItem.push(n),e.pasteShow=!0}}else e.pasteFile.push(t),e.pasteItem.push(n),e.pasteShow=!0})))},msgFilter:function(t){if(this.msgType)if("tag"===this.msgType){if(!t.tag)return!1}else if("link"===this.msgType){if(!t.link)return!1}else if(this.msgType!==t.mtype)return!1;return!this.msgId||t.reply_id==this.msgId},onSearchMsgId:function(){this.dialogSearchMsgId>0&&this.openId===this.dialogId&&(this.onPositionId(this.dialogSearchMsgId),this.$store.state.dialogSearchMsgId=0)},onPositionId:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0!==t){var r=this.allMsgs.findIndex((function(e){return e.id===t}));r>-1?this.onToIndex(r):(n>0&&this.$store.dispatch("setLoad",{key:"msg-".concat(n),delay:600}),this.msgType="",this.preventToBottom=!0,this.$store.dispatch("getDialogMsgs",{dialog_id:this.dialogId,msg_id:this.msgId,position_id:t}).finally((function(r){var o=e.allMsgs.findIndex((function(e){return e.id===t}));o>-1&&e.onToIndex(o),n>0&&e.$store.dispatch("cancelLoad","msg-".concat(n)),e.preventToBottom=!1})))}},itemClassAdd:function(t){return t===this.replyActiveIndex?"dialog-shake":""},inputFocus:function(){var t=this;this.$nextTick((function(e){t.$refs.input.focus()}))},onRecordState:function(t){this.recordState=t},chatPasteDrag:function(t,e){this.dialogDrag=!1;var n="drag"===e?t.dataTransfer.files:t.clipboardData.files,r=Array.prototype.slice.call(n);r.length>0&&(t.preventDefault(),this.sendFileMsg(r))},chatDragOver:function(t,e){var n=this,r=this.__dialogDrag=$A.randomString(8);if(t){if("move"===e.dataTransfer.effectAllowed)return;this.dialogDrag=!0}else setTimeout((function(){r===n.__dialogDrag&&(n.dialogDrag=t)}),150)},onTouchStart:function(t){this.wrapperStart=Object.assign(this.scrollInfo(),{clientY:t.touches[0].clientY,exclud:!this.$refs.scroller.$el.contains(t.target)})},onTouchMove:function(t){if(this.windowSmall&&this.windowScrollY>0){if(this.wrapperStart.exclud)return void t.preventDefault();this.wrapperStart.clientY>t.touches[0].clientY?0===this.wrapperStart.tail&&t.preventDefault():0===this.wrapperStart.offset&&t.preventDefault()}},pasteSend:function(){var t=this;this.pasteFile.some((function(e){t.$refs.chatUpload.upload(e)}))},chatFile:function(t,e){switch(t){case"progress":this.onToBottom(),this.onActive(),this.tempMsgs.push({id:e.tempId,dialog_id:this.dialogData.id,reply_id:this.replyId,type:"loading",userid:this.userId,msg:{}});break;case"error":this.tempMsgs=this.tempMsgs.filter((function(t){return t.id!=e.tempId}));break;case"success":this.tempMsgs=this.tempMsgs.filter((function(t){return t.id!=e.tempId})),this.sendSuccess(e.data)}},sendSuccess:function(t){var e=this;$A.isArray(t)?t.some((function(t){e.sendSuccess(t)})):(this.$store.dispatch("saveDialogMsg",t),this.$store.dispatch("increaseTaskMsgNum",this.dialogId),this.$store.dispatch("increaseMsgReplyNum",t.reply_id),this.$store.dispatch("updateDialogLastMsg",t),this.onCancelReply(),this.onActive())},onEventFocus:function(){this.$emit("on-focus")},onEventBlur:function(){this.$emit("on-blur")},onEventMore:function(t){["image","file"].includes(t)&&this.$refs.chatUpload.handleClick()},onEventEmojiVisibleChange:function(t){t&&this.windowSmall&&this.onToBottom()},onHeightChange:function(t){var e=t.newVal-t.oldVal;if(0!==e){var n=this.scrollInfo(),r=n.offset;n.tail>0&&this.onToOffset(r+e)}},onActive:function(){this.$emit("on-active")},onToBottom:function(){this.msgNew=0;var t=this.$refs.scroller;t&&(t.scrollToBottom(),requestAnimationFrame((function(e){return t.scrollToBottom()})))},onToIndex:function(t){var e=this,n=this.$refs.scroller;n&&(n.stopToBottom(),n.scrollToIndex(t,-100),requestAnimationFrame((function(e){return n.scrollToIndex(t,-100)}))),requestAnimationFrame((function(n){return e.replyActiveIndex=t}))},onToOffset:function(t){var e=this.$refs.scroller;e&&(e.stopToBottom(),e.scrollToOffset(t),setTimeout((function(n){return e.scrollToOffset(t)}),10))},scrollInfo:function(){var t=this.$refs.scroller;return t?t.scrollInfo():{offset:0,scale:0,tail:0}},openProject:function(){this.dialogData.group_info&&(this.windowSmall&&this.$store.dispatch("openDialog",0),this.goForward({name:"manage-project",params:{projectId:this.dialogData.group_info.id}}))},openTask:function(){this.dialogData.group_info&&(this.taskId>0&&this.$store.dispatch("openDialog",0),this.$store.dispatch("openTask",this.dialogData.group_info.id))},onPrevPage:function(){var t=this;0!==this.prevId&&this.$store.dispatch("getDialogMsgs",{dialog_id:this.dialogId,msg_id:this.msgId,msg_type:this.msgType,prev_id:this.prevId}).then((function(e){var n=e.data.list.map((function(t){return t.id}));t.$nextTick((function(){var e=t.$refs.scroller,r=n.reduce((function(t,n){return{size:("object"===T(t)?t.size:e.getSize(t))+e.getSize(n)}})),o=e.getOffset()+r.size;0===t.prevId&&(o-=36),t.onToOffset(o)}))})).catch((function(){}))},openCreateGroup:function(){this.createGroupData={userids:this.dialogData.dialog_user?[this.userId,this.dialogData.dialog_user.userid]:[this.userId],uncancelable:[this.userId]},this.createGroupShow=!0},onCreateGroup:function(){var t=this;this.createGroupLoad++,this.$store.dispatch("call",{url:"dialog/group/add",data:this.createGroupData}).then((function(e){var n=e.data,r=e.msg;$A.messageSuccess(r),t.createGroupShow=!1,t.createGroupData={},t.$store.dispatch("saveDialog",n),t.$store.dispatch("openDialog",n.id)})).catch((function(t){var e=t.msg;$A.modalError(e)})).finally((function(e){t.createGroupLoad--}))},onForward:function(t){var e=this;if("open"===t)this.forwardData={userids:[],msg_id:this.operateItem.id},this.forwardShow=!0;else if("submit"===t){if(0===$A.arrayLength(this.forwardData.userids))return void $A.messageWarning("请选择转发成员");this.forwardLoad=!0,this.$store.dispatch("call",{url:"dialog/msg/forward",data:this.forwardData}).then((function(t){var n=t.data,r=t.msg;e.forwardShow=!1,e.$store.dispatch("saveDialogMsg",n.msgs),e.$store.dispatch("updateDialogLastMsg",n.msgs),$A.messageSuccess(r)})).catch((function(t){var e=t.msg;$A.modalError(e)})).finally((function(t){e.forwardLoad=!1}))}},onScroll:function(t){var e=this;this.operateVisible=!1;var n=this.scrollInfo().tail;this.scrollTail=n,this.scrollTail<=10&&(this.msgNew=0),this.scrollAction=t.target.scrollTop,this.scrollDirection=this.scrollTmp<=this.scrollAction?"down":"up",setTimeout((function(t){return e.scrollTmp=e.scrollAction}),0)},onRange:function(t){var e=this;if(!this.preventMoreLoad)for(var n="down"===this.scrollDirection?"next_id":"prev_id",r=t.start;r<=t.end;r++){var o=this.allMsgs[r][n];if(o){var i=this.allMsgs[r+("next_id"===n?1:-1)];i&&i.id!=o&&(this.preventMoreLoad=!0,this.$store.dispatch("getDialogMsgs",I({dialog_id:this.dialogId,msg_id:this.msgId,msg_type:this.msgType},n,o)).finally((function(t){e.preventMoreLoad=!1})))}}},onBack:function(){var t=this;if(!this.beforeBack)return this.handleBack();var e=this.beforeBack();e&&e.then?e.then((function(){t.handleBack()})):this.handleBack()},handleBack:function(){var t=this.$store.state.routeHistoryLast,e=t.name,n=t.params;e===this.$route.name&&/\d+/.test(n.dialogId)?this.goForward({name:this.$route.name}):this.goBack()},onLongpress:function(t){var e=this,n=t.event,r=t.el,o=t.msgData;this.operateVisible=this.operateItem.id===o.id,this.operateItem=$A.isJson(o)?o:{},this.operateHasText="text"===o.type&&o.msg.text.replace(/<[^>]+>/g,"").length>0,this.$nextTick((function(){var t=r.getBoundingClientRect(),o=e.$el.getBoundingClientRect();e.operateStyles={left:"".concat(n.clientX-o.left,"px"),top:"".concat(t.top+e.windowScrollY,"px"),height:t.height+"px"},e.operateVisible=!0}))},onOperate:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.operateVisible=!1,this.$nextTick((function(r){switch(t){case"copy":e.operateHasText?e.$copyText(e.operateItem.msg.text.replace(/<[^>]+>/g,"")).then((function(t){$A.messageSuccess("复制成功")})).catch((function(t){$A.messageError("复制失败")})):$A.messageWarning("不可复制的内容");break;case"newTask":e.operateHasText&&s.Store.set("addTask",{owner:[e.userId],name:e.operateItem.msg.text.replace(/<[^>]+>/g,"")});break;case"reply":e.onReply();break;case"forward":e.onForward("open");break;case"withdraw":e.onWithdraw();break;case"view":e.onViewFile();break;case"down":e.onDownFile();break;case"emoji":e.onEmoji(n);break;case"tag":e.onTag()}}))},onReply:function(){var t=this.scrollInfo().tail;this.replyActiveId=this.operateItem.id,this.inputFocus(),t<=10&&requestAnimationFrame(this.onToBottom)},onCancelReply:function(){this.replyActiveId=0},onWithdraw:function(){var t=this;$A.modalConfirm({content:"确定撤回此信息吗?",okText:"撤回",loading:!0,onOk:function(){return new Promise((function(e,n){t.$store.dispatch("call",{url:"dialog/msg/withdraw",data:{msg_id:t.operateItem.id}}).then((function(){e("消息已撤回"),t.$store.dispatch("forgetDialogMsg",t.operateItem.id)})).catch((function(t){var e=t.msg;n(e)}))}))}})},onViewReply:function(t){this.operateVisible||this.onPositionId(t.reply_id,t.msg_id)},onViewText:function(t){var e=t.target;if(!this.operateVisible)switch(e.nodeName){case"IMG":e.classList.contains("browse")?this.onViewPicture(e.currentSrc):(this.$store.state.previewImageIndex=0,this.$store.state.previewImageList=$A.getTextImagesInfo(e.outerHTML));break;case"SPAN":e.classList.contains("mention")&&e.classList.contains("task")&&this.$store.dispatch("openTask",$A.runNum(e.getAttribute("data-id")))}},onViewFile:function(t){if(!this.operateVisible){$A.isJson(t)||(t=this.operateItem);var e=t.msg;if(["jpg","jpeg","gif","png"].includes(e.ext))this.onViewPicture(e.path);else{var n="/single/file/msg/".concat(t.id);this.$Electron?this.$Electron.sendMessage("windowRouter",{name:"file-msg-".concat(t.id),path:n,userAgent:"/hideenOfficeTitle/",force:!1,config:{title:"".concat(e.name," (").concat($A.bytesToSize(e.size),")"),titleFixed:!0,parent:null,width:Math.min(window.screen.availWidth,1440),height:Math.min(window.screen.availHeight,900)},webPreferences:{nodeIntegrationInSubFrames:"drawio"===e.ext}}):this.$isEEUiApp?$A.eeuiAppOpenPage({pageType:"app",pageTitle:"".concat(e.name," (").concat($A.bytesToSize(e.size),")"),url:"web.js",params:{titleFixed:!0,url:$A.rightDelete(window.location.href,window.location.hash)+"#".concat(n)}}):window.open($A.apiUrl("..".concat(n)))}}},onViewPicture:function(t){var e=this,n=$A.cloneJSON(this.dialogMsgs.filter((function(t){if(t.dialog_id===e.dialogId){if("file"===t.type)return["jpg","jpeg","gif","png"].includes(t.msg.ext);if("text"===t.type)return t.msg.text.match(/
]*?>/)}return!1}))).sort((function(t,e){return t.id-e.id})),r=[];n.some((function(t){var e=t.type,n=t.msg;"file"===e?r.push({src:n.path,width:n.width,height:n.height}):"text"===e&&r.push.apply(r,A($A.getTextImagesInfo(n.text)))}));var o=r.findIndex((function(e){return e.src===t}));o>-1?(this.$store.state.previewImageIndex=o,this.$store.state.previewImageList=r):(this.$store.state.previewImageIndex=0,this.$store.state.previewImageList=[t])},onDownFile:function(t){var e=this;this.operateVisible||($A.isJson(t)||(t=this.operateItem),$A.modalConfirm({title:"下载文件",content:"".concat(t.msg.name," (").concat($A.bytesToSize(t.msg.size),")"),okText:"立即下载",onOk:function(){e.$store.dispatch("downUrl",$A.apiUrl("dialog/msg/download?msg_id=".concat(t.id)))}}))},onReplyList:function(t){this.operateVisible||(this.replyListId=t.msg_id,this.replyListShow=!0)},onEmoji:function(t){var e=this;$A.isJson(t)||(t={msg_id:this.operateItem.id,symbol:t}),this.$store.dispatch("setLoad",{key:"msg-".concat(t.msg_id),delay:600}),this.$store.dispatch("call",{url:"dialog/msg/emoji",data:t}).then((function(t){var n=t.data;e.$store.dispatch("saveDialogMsg",n)})).catch((function(t){var e=t.msg;$A.messageError(e)})).finally((function(n){e.$store.dispatch("cancelLoad","msg-".concat(t.msg_id))}))},onTag:function(){var t=this;if(!this.operateVisible){var e={msg_id:this.operateItem.id};this.$store.dispatch("setLoad",{key:"msg-".concat(e.msg_id),delay:600}),this.$store.dispatch("call",{url:"dialog/msg/tag",data:e}).then((function(e){var n=e.data;t.$store.dispatch("saveDialogMsg",n.update),n.add&&(t.$store.dispatch("saveDialogMsg",n.add),t.$store.dispatch("updateDialogLastMsg",n.add))})).catch((function(t){var e=t.msg;$A.messageError(e)})).finally((function(n){t.$store.dispatch("cancelLoad","msg-".concat(e.msg_id))}))}}}};const P=(0,i.Z)(j,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.isReady?n("div",{staticClass:"dialog-wrapper",class:t.wrapperClass,on:{drop:function(e){return e.preventDefault(),t.chatPasteDrag(e,"drag")},dragover:function(e){return e.preventDefault(),t.chatDragOver(!0,e)},dragleave:function(e){return e.preventDefault(),t.chatDragOver(!1,e)},touchstart:t.onTouchStart,touchmove:t.onTouchMove}},[n("div",{staticClass:"dialog-nav",style:t.navStyle},[t._t("head",(function(){return[n("div",{staticClass:"nav-wrapper",class:{completed:t.$A.dialogCompleted(t.dialogData)}},[n("div",{staticClass:"dialog-back",on:{click:t.onBack}},[n("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),t.msgUnreadOnly?n("div",{staticClass:"back-num"},[t._v(t._s(t.msgUnreadOnly))]):t._e()]),t._v(" "),n("div",{staticClass:"dialog-block"},[n("div",{staticClass:"dialog-avatar"},["group"==t.dialogData.type?["project"==t.dialogData.group_type?n("i",{staticClass:"taskfont icon-avatar project"},[t._v("")]):"task"==t.dialogData.group_type?n("i",{staticClass:"taskfont icon-avatar task"},[t._v("")]):n("Icon",{staticClass:"icon-avatar",attrs:{type:"ios-people"}})]:t.dialogData.dialog_user?n("div",{staticClass:"user-avatar"},[n("UserAvatar",{attrs:{online:t.dialogData.online_state,userid:t.dialogData.dialog_user.userid,size:42},on:{"update:online":function(e){return t.$set(t.dialogData,"online_state",e)}}})],1):n("Icon",{staticClass:"icon-avatar",attrs:{type:"md-person"}})],2),t._v(" "),n("div",{staticClass:"dialog-title"},[n("div",{staticClass:"main-title"},[t._l(t.$A.dialogTags(t.dialogData),(function(e){return"success"!=e.color?[n("Tag",{attrs:{color:e.color,fade:!1}},[t._v(t._s(t.$L(e.text)))])]:t._e()})),t._v(" "),n("h2",[t._v(t._s(t.dialogData.name))]),t._v(" "),t.peopleNum>0?n("em",[t._v("("+t._s(t.peopleNum)+")")]):t._e()],2),t._v(" "),"group"===t.dialogData.type?["project"===t.dialogData.group_type?n("div",{staticClass:"sub-title pointer",on:{click:t.openProject}},[t._v("\n "+t._s(t.$L("项目聊天室"))+" "+t._s(t.$L("打开项目管理"))+"\n ")]):"task"===t.dialogData.group_type?n("div",{staticClass:"sub-title pointer",on:{click:t.openTask}},[t._v("\n "+t._s(t.$L("任务聊天室"))+" "+t._s(t.$L("查看任务详情"))+"\n ")]):t._e()]:"user"===t.dialogData.type?n("div",{class:["sub-title",!0===t.dialogData.online_state?"online":"offline"]},[t._v("\n "+t._s(t.$L(!0===t.dialogData.online_state?"在线":t.dialogData.online_state))+"\n ")]):t._e()],2)]),t._v(" "),"group"===t.dialogData.type?[n("ETooltip",{attrs:{placement:"top",disabled:t.windowSmall,openDelay:600,content:t.$L("群设置")}},[n("i",{staticClass:"taskfont dialog-create",on:{click:function(e){t.groupInfoShow=!0}}},[t._v("")])])]:"user"!==t.dialogData.type||t.isMyDialog?t._e():n("ETooltip",{attrs:{placement:"top",disabled:t.windowSmall,content:t.$L("创建群组")}},[n("i",{staticClass:"taskfont dialog-create",on:{click:t.openCreateGroup}},[t._v("")])])],2),t._v(" "),n("transition",{attrs:{name:"fade"}},[t.dialogMsgList.length>10&&t.msgTags.length>1&&0===t.windowScrollY?n("div",{staticClass:"nav-tags scrollbar-hidden"},[n("ul",t._l(t.msgTags,(function(e){var r;return n("li",{key:e.type,class:(r={},r["tag-"+(e.type||"msg")]=!0,r.active=t.msgType===e.type,r),on:{click:function(n){t.msgType=e.type}}},[n("i"),t._v(" "),n("span",[t._v(t._s(t.$L(e.label)))])])})),0)]):t._e()])]}))],2),t._v(" "),n("VirtualList",{ref:"scroller",staticClass:"dialog-scroller scrollbar-overlay",class:t.scrollerClass,attrs:{"data-key":"id","data-sources":t.allMsgs,"data-component":t.msgItem,"item-class-add":t.itemClassAdd,"extra-props":{dialogData:t.dialogData,operateVisible:t.operateVisible,operateItem:t.operateItem,hidePercentage:t.isMyDialog,hideReply:t.msgId>0},"estimate-size":78,keeps:70},on:{scroll:t.onScroll,range:t.onRange,totop:t.onPrevPage,"on-longpress":t.onLongpress,"on-view-reply":t.onViewReply,"on-view-text":t.onViewText,"on-view-file":t.onViewFile,"on-down-file":t.onDownFile,"on-reply-list":t.onReplyList,"on-emoji":t.onEmoji}},[n("template",{slot:"header"},[0===t.allMsgs.length&&t.loadMsg||t.prevId>0?n("div",{staticClass:"dialog-item loading"},[n("Loading")],1):0===t.allMsgs.length?n("div",{staticClass:"dialog-item nothing"},[t._v(t._s(t.$L("暂无消息")))]):t._e()])],2),t._v(" "),n("div",{staticClass:"dialog-footer",class:t.footerClass,on:{click:t.onActive}},[n("div",{staticClass:"dialog-newmsg",on:{click:t.onToBottom}},[t._v(t._s(t.$L("有"+t.msgNew+"条新消息")))]),t._v(" "),n("div",{staticClass:"dialog-goto",on:{click:t.onToBottom}},[n("i",{staticClass:"taskfont"},[t._v("")])]),t._v(" "),n("DialogUpload",{ref:"chatUpload",staticClass:"chat-upload",attrs:{"dialog-id":t.dialogId,"reply-id":t.replyId},on:{"on-progress":function(e){return t.chatFile("progress",e)},"on-success":function(e){return t.chatFile("success",e)},"on-error":function(e){return t.chatFile("error",e)}}}),t._v(" "),n("ChatInput",{ref:"input",attrs:{"dialog-id":t.dialogId,"reply-id":t.replyActiveId,"emoji-bottom":t.windowSmall,maxlength:2e5,placeholder:t.$L("输入消息...")},on:{"on-focus":t.onEventFocus,"on-blur":t.onEventBlur,"on-more":t.onEventMore,"on-file":t.sendFileMsg,"on-send":t.sendMsg,"on-record":t.sendRecord,"on-record-state":t.onRecordState,"on-emoji-visible-change":t.onEventEmojiVisibleChange,"on-height-change":t.onHeightChange,"on-cancel-reply":t.onCancelReply},model:{value:t.msgText,callback:function(e){t.msgText=e},expression:"msgText"}})],1),t._v(" "),n("div",{staticClass:"operate-position",style:t.operateStyles},[n("Dropdown",{attrs:{trigger:"custom",placement:"top",visible:t.operateVisible,transferClassName:"dialog-wrapper-operate",transfer:""},on:{"on-clickoutside":function(e){t.operateVisible=!1}}},[n("div",{style:{userSelect:t.operateVisible?"none":"auto",height:t.operateStyles.height}}),t._v(" "),n("DropdownMenu",{attrs:{slot:"list"},slot:"list"},[n("DropdownItem",{attrs:{name:"action"}},[n("ul",{staticClass:"operate-action"},[0===t.msgId?n("li",{on:{click:function(e){return t.onOperate("reply")}}},[n("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),n("span",[t._v(t._s(t.$L("回复")))])]):t._e(),t._v(" "),n("li",{on:{click:function(e){return t.onOperate("forward")}}},[n("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),n("span",[t._v(t._s(t.$L("转发")))])]),t._v(" "),t.operateHasText?[n("li",{on:{click:function(e){return t.onOperate("copy")}}},[n("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),n("span",[t._v(t._s(t.$L("复制")))])]),t._v(" "),n("li",{on:{click:function(e){return t.onOperate("newTask")}}},[n("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),n("span",[t._v(t._s(t.$L("新任务")))])])]:t._e(),t._v(" "),t.operateItem.userid==t.userId?[n("li",{on:{click:function(e){return t.onOperate("withdraw")}}},[n("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),n("span",[t._v(t._s(t.$L("撤回")))])])]:t._e(),t._v(" "),"file"===t.operateItem.type?[n("li",{on:{click:function(e){return t.onOperate("view")}}},[n("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),n("span",[t._v(t._s(t.$L("查看")))])]),t._v(" "),n("li",{on:{click:function(e){return t.onOperate("down")}}},[n("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),n("span",[t._v(t._s(t.$L("下载")))])])]:t._e(),t._v(" "),n("li",{on:{click:function(e){return t.onOperate("tag")}}},[n("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),n("span",[t._v(t._s(t.$L(t.operateItem.tag?"取消标注":"标注")))])])],2)]),t._v(" "),n("DropdownItem",{staticClass:"dropdown-emoji",attrs:{name:"emoji"}},[n("ul",{staticClass:"operate-emoji scrollbar-hidden"},t._l(t.operateEmojis,(function(e,r){return n("li",{key:r,staticClass:"no-dark-content",domProps:{innerHTML:t._s(e)},on:{click:function(n){return t.onOperate("emoji",e)}}})})),0)])],1)],1)],1),t._v(" "),t.dialogDrag?n("div",{staticClass:"drag-over",on:{click:function(e){t.dialogDrag=!1}}},[n("div",{staticClass:"drag-text"},[t._v(t._s(t.$L("拖动到这里发送")))])]):t._e(),t._v(" "),n("Modal",{attrs:{title:t.$L(t.pasteTitle),"cancel-text":t.$L("取消"),"ok-text":t.$L("发送"),"enter-ok":!0},on:{"on-ok":t.pasteSend},model:{value:t.pasteShow,callback:function(e){t.pasteShow=e},expression:"pasteShow"}},[n("ul",{staticClass:"dialog-wrapper-paste",class:t.pasteWrapperClass},t._l(t.pasteItem,(function(e){return n("li",["image"==e.type?n("img",{attrs:{src:e.result}}):n("div",[t._v(t._s(t.$L("文件"))+": "+t._s(e.name)+" ("+t._s(t.$A.bytesToSize(e.size))+")")])])})),0)]),t._v(" "),n("Modal",{attrs:{title:t.$L("创建群组"),"mask-closable":!1},model:{value:t.createGroupShow,callback:function(e){t.createGroupShow=e},expression:"createGroupShow"}},[n("Form",{attrs:{model:t.createGroupData,"label-width":"auto"},nativeOn:{submit:function(t){t.preventDefault()}}},[n("FormItem",{attrs:{prop:"userids",label:t.$L("群成员")}},[n("UserInput",{attrs:{uncancelable:t.createGroupData.uncancelable,"multiple-max":100,placeholder:t.$L("选择项目成员")},model:{value:t.createGroupData.userids,callback:function(e){t.$set(t.createGroupData,"userids",e)},expression:"createGroupData.userids"}})],1),t._v(" "),n("FormItem",{attrs:{prop:"chat_name",label:t.$L("群名称")}},[n("Input",{attrs:{placeholder:t.$L("输入群名称(选填)")},model:{value:t.createGroupData.chat_name,callback:function(e){t.$set(t.createGroupData,"chat_name",e)},expression:"createGroupData.chat_name"}})],1)],1),t._v(" "),n("div",{staticClass:"adaption",attrs:{slot:"footer"},slot:"footer"},[n("Button",{attrs:{type:"default"},on:{click:function(e){t.createGroupShow=!1}}},[t._v(t._s(t.$L("取消")))]),t._v(" "),n("Button",{attrs:{type:"primary",loading:t.createGroupLoad>0},on:{click:t.onCreateGroup}},[t._v(t._s(t.$L("创建")))])],1)],1),t._v(" "),n("Modal",{attrs:{title:t.$L("转发"),"mask-closable":!1},model:{value:t.forwardShow,callback:function(e){t.forwardShow=e},expression:"forwardShow"}},[n("Form",{ref:"forwardForm",attrs:{model:t.forwardData,"label-width":"auto"},nativeOn:{submit:function(t){t.preventDefault()}}},[n("FormItem",{attrs:{prop:"userids",label:t.$L("转发给")}},[n("UserInput",{attrs:{"multiple-max":20,placeholder:t.$L("选择转发成员")},model:{value:t.forwardData.userids,callback:function(e){t.$set(t.forwardData,"userids",e)},expression:"forwardData.userids"}})],1)],1),t._v(" "),n("div",{staticClass:"adaption",attrs:{slot:"footer"},slot:"footer"},[n("Button",{attrs:{type:"default"},on:{click:function(e){t.forwardShow=!1}}},[t._v(t._s(t.$L("取消")))]),t._v(" "),n("Button",{attrs:{type:"primary",loading:t.forwardLoad},on:{click:function(e){return t.onForward("submit")}}},[t._v(t._s(t.$L("转发")))])],1)],1),t._v(" "),n("DrawerOverlay",{attrs:{placement:"right",size:400},model:{value:t.groupInfoShow,callback:function(e){t.groupInfoShow=e},expression:"groupInfoShow"}},[t.groupInfoShow?n("DialogGroupInfo",{attrs:{dialogId:t.dialogId}}):t._e()],1),t._v(" "),n("DrawerOverlay",{attrs:{placement:"right","class-name":"dialog-wrapper-reply-list",size:500},model:{value:t.replyListShow,callback:function(e){t.replyListShow=e},expression:"replyListShow"}},[t.replyListShow&&t.replyListItem?n("DialogWrapper",{staticClass:"reply-list",attrs:{dialogId:t.dialogId,msgId:t.replyListId}},[n("div",{staticClass:"dialog-scroller",attrs:{slot:"head"},slot:"head"},[n("DialogItem",{attrs:{source:t.replyListItem,hidePercentage:"",hideReply:"",isReply:""},on:{"on-view-text":t.onViewText,"on-view-file":t.onViewFile,"on-emoji":t.onEmoji}})],1)]):t._e()],1)],1):t._e()}),[],!1,null,null,null).exports},30021:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){s=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0)}},methods:{logDate:function(t){return $A.formatDate("m-d")==t.ymd?t.ymd+" "+this.$L("今天"):t.key},getLists:function(t){var e=this;!0===t&&(this.listPage=1),this.loadIng++,this.$store.dispatch("call",{url:"project/log/lists",data:{project_id:this.projectId,task_id:this.taskId,page:Math.max(this.listPage,1),pagesize:Math.max($A.runNum(this.listPageSize),10)}}).then((function(n){var r=n.data;!0===t&&(e.lists=[]),r.data.some((function(t){var n=t.time,r=n.ymd+" "+n.week,o=e.lists.find((function(t){return t.key==r}));if(o){var i=o.lists.find((function(e){return e.userid==t.userid}));i?i.lists.push(t):o.lists.push({userid:t.userid,lists:[t]})}else e.lists.push({key:r,ymd:t.ymd,lists:[{userid:t.userid,lists:[t]}]})})),e.hasMorePages=r.current_page ")),i.push(t("span",{class:"change-value"},"".concat(l||"-")))):i.push(t("span",{class:"change-value"},l||"-"))}if(o.userid){var u=$A.isArray(o.userid)?o.userid:[o.userid],c=[];u.some((function(e){/\d+/.test(e)?c.push(t("UserAvatar",{props:{size:18,userid:e}})):c.push(t("span",e))})),c.length>0&&i.push(t("div",{class:"detail-user"},[t("div",{class:"detail-user-wrap"},c)]))}}return t("span",{class:"log-text"},i)},operationList:function(t){var e=t.id,n=t.record,r=[];if(!$A.isJson(n))return r;if(this.taskId>0&&$A.isJson(n.flow)){var o=$A.getMiddle(n.flow.flow_item_name,"|");o&&r.push({id:e,button:"重置",content:"确定重置为【".concat(o,"】吗?")})}return r},onOperation:function(t){var e=this;$A.modalConfirm({content:t.content,loading:!0,onOk:function(){return new Promise((function(n,r){e.$store.dispatch("call",{url:"project/task/resetfromlog",data:{id:t.id}}).then((function(t){var r=t.data,o=t.msg;n(o),e.$store.dispatch("saveTask",r),e.getLists(!0)})).catch((function(t){var e=t.msg;r(e)}))}))}})},openTask:function(t){this.$store.dispatch("openTask",t)}}};const a=(0,n(51900).Z)(i,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:["project-log",0==t.taskId?"is-drawer":""]},[n("div",{staticClass:"log-title"},[t._v(t._s(t.$L("项目动态")))]),t._v(" "),n("ul",{staticClass:"logs-activity"},[t._l(t.lists,(function(e){return n("li",[n("div",{staticClass:"logs-date"},[t._v(t._s(t.logDate(e)))]),t._v(" "),n("div",{staticClass:"logs-section"},[n("Timeline",t._l(e.lists,(function(e,r){return n("TimelineItem",{key:r},[n("div",{staticClass:"logs-dot",attrs:{slot:"dot"},slot:"dot"},[e.userid?n("UserAvatar",{attrs:{userid:e.userid,size:18,showName:""}}):n("div",{staticClass:"avatar-wrapper common-avatar"},[n("EAvatar",{attrs:{size:18}},[t._v("A")]),t._v(" "),n("div",{staticClass:"avatar-name auto"},[t._v(t._s(t.$L("系统")))])],1)],1),t._v(" "),t._l(e.lists,(function(e){return[n("div",{staticClass:"log-summary"},[n("ProjectLogDetail",{attrs:{render:t.logDetail,item:e}}),t._v(" "),t.operationList(e).length>0?n("span",{staticClass:"log-operation"},t._l(t.operationList(e),(function(e,r){return n("Button",{key:r,attrs:{size:"small"},on:{click:function(n){return t.onOperation(e)}}},[t._v(t._s(e.button))])})),1):t._e(),t._v(" "),n("span",{staticClass:"log-time"},[t._v(t._s(e.time.ymd)+" "+t._s(e.time.segment)+" "+t._s(e.time.hi))])],1),t._v(" "),e.project_task?n("div",{staticClass:"log-task"},[n("em",{on:{click:function(n){return t.openTask(e.project_task)}}},[t._v(t._s(t.$L("关联任务"))+": "+t._s(e.project_task.name))])]):t._e()]}))],2)})),1)],1)])})),t._v(" "),t.loadIng>0&&t.showLoad?n("li",{staticClass:"logs-loading"},[n("Loading")],1):t.hasMorePages?n("li",{staticClass:"logs-more",on:{click:t.getMore}},[t._v(t._s(t.$L("加载更多")))]):0==t.totalNum?n("li",{staticClass:"logs-none",on:{click:function(e){return t.getLists(!0)}}},[t._v(t._s(t.$L("没有任何动态")))]):t._e()],2)])}),[],!1,null,null,null).exports},78204:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r=n(82578),o=n(20629);function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;e0)return n}return 0},showAddAssist:function(){return!this.addData.owner.includes(this.userId)}}),watch:{value:function(t){var e=this;t?(this.ready=!0,this.initCascaderData(),this.initProjectData(),this.$nextTick((function(){e.$refs.input.focus()}))):(this.beforeClose.some((function(t){"function"==typeof t&&t()})),this.beforeClose=[],this.taskTimeOpen=!1)},"addData.project_id":function(t){t>0&&$A.setStorage("cacheAddTaskProjectId",t)},"addData.column_id":function(t){var e=this,n=this.addData.project_id;this.$nextTick((function(){n&&t?e.$set(e.addData,"cascader",[n,t]):e.$set(e.addData,"cascader",[])})),t>0&&$A.setStorage("cacheAddTaskColumnId",t)}},methods:{initLanguage:function(){},initCascaderData:function(){var t=this,e=$A.cloneJSON(this.cacheProjects).sort((function(t,e){return t.top_at||e.top_at?$A.Date(e.top_at)-$A.Date(t.top_at):e.id-t.id}));this.cascaderData=e.map((function(e){var n=t.cacheColumns.filter((function(t){return t.project_id==e.id})).map((function(t){return{value:t.id,label:t.name}})),r={value:e.id,label:e.name,children:n};return 0==n.length&&(r.loading=!1),r}))},initProjectData:function(){var t=this,e=this.addData.column_id;if(e){var n=this.cacheColumns.find((function(t){return t.id==e}));n&&(this.addData.project_id=n.project_id,this.addData.column_id=n.id)}else{var r=$A.getStorageInt("cacheAddTaskProjectId"),o=$A.getStorageInt("cacheAddTaskColumnId"),i=this.cacheProjects.find((function(e){return e.id==t.projectId}))||this.cacheProjects.find((function(t){return t.id==r}))||this.cacheProjects.find((function(t){return t.id>0}));if(i){var a=this.cacheColumns.find((function(t){var e=t.project_id,n=t.id;return e==i.id&&n==o}))||this.cacheColumns.find((function(t){return t.project_id==i.id}));a?(this.addData.project_id=a.project_id,this.addData.column_id=a.id):this.$store.dispatch("getColumns",i.id).then((function(){(a=t.cacheColumns.find((function(t){var e=t.project_id,n=t.id;return e==i.id&&n==o}))||t.cacheColumns.find((function(t){return t.project_id==i.id})))&&(t.addData.project_id=a.project_id,t.addData.column_id=a.id)})).catch((function(){}))}}},taskTimeOpenChange:function(t){this.taskTimeOpen=t},taskTimeChange:function(t){var e=$A.date2string(t,"Y-m-d H:i");e[0]&&e[1]&&$A.rightExists(e[0],"00:00")&&$A.rightExists(e[1],"00:00")&&this.$set(this.addData,"times",[e[0],e[1].replace("00:00","23:59")])},onKeydown:function(t){if(13===t.keyCode){if(t.shiftKey)return;t.preventDefault(),this.onAdd()}},addSubTask:function(){""!==this.subName.trim()&&(this.addData.subtasks.push({name:this.subName.trim(),owner:[this.userId],times:[]}),this.subName="")},taskPriorityContent:function(t){var e=$A.runNum(t.days);return e<=0?t.name+" ("+this.$L("无时间限制")+")":t.name+" ("+e+this.$L("天")+")"},choosePriority:function(t){var e=new Date,n=$A.runNum(t.days);if(n>0){var r=new Date((new Date).setDate(e.getDate()+n));this.$set(this.addData,"times",$A.date2string([e,r]))}else this.$set(this.addData,"times",[]);this.$set(this.addData,"p_level",t.priority),this.$set(this.addData,"p_name",t.name),this.$set(this.addData,"p_color",t.color)},defaultPriority:function(){0!==this.taskPriority.length&&(this.addData.p_name||this.choosePriority(this.taskPriority[0]))},cascaderLoadData:function(t,e){t.loading=!0,this.$store.dispatch("getColumns",t.value).then((function(n){t.children=n.map((function(t){return{value:t.id,label:t.name}})),t.loading=!1,e()})).catch((function(){t.loading=!1,e()}))},cascaderChange:function(t){t[1]&&(this.$set(this.addData,"project_id",t[0]),this.$set(this.addData,"column_id",t[1]))},cascaderInputChange:function(t){var e=this;this.cascaderValue=t||"",!0!==this.cascaderAlready[this.cascaderValue]&&(this.cascaderAlready[this.cascaderValue]=!0,setTimeout((function(){e.cascaderLoading++}),1e3),this.$store.dispatch("getProjects",{keys:{name:this.cascaderValue},getcolumn:"yes"}).then((function(){e.cascaderLoading--,e.initCascaderData()})).catch((function(){e.cascaderLoading--})))},setData:function(t){void 0!==t.beforeClose&&(this.beforeClose.push(t.beforeClose),delete t.beforeClose),this.addData=Object.assign({},this.addData,t)},onAdd:function(t){var e=this;this.addData.name?(this.loadIng++,this.$store.dispatch("taskAdd",this.addData).then((function(n){var r=n.msg;e.loadIng--,$A.messageSuccess(r),!0===t?(e.addData=Object.assign({},e.addData,{name:"",content:"",subtasks:[]}),e.$refs.input.focus()):(e.addData={cascader:[],name:"",content:"",owner:[],add_assist:1,column_id:0,times:[],subtasks:[],p_level:0,p_name:"",p_color:""},e.close())})).catch((function(t){var n=t.msg;e.loadIng--,$A.modalError(n)}))):$A.messageError("任务描述不能为空")},close:function(){this.$emit("input",!this.value)}}};const u=(0,n(51900).Z)(l,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.ready?n("div",{staticClass:"task-add"},[n("div",{staticClass:"head",class:{empty:0==t.addData.cascader.length,visible:t.cascaderShow}},[n("Cascader",{attrs:{data:t.cascaderData,clearable:!1,placeholder:t.$L("请选择项目"),"load-data":t.cascaderLoadData,filterable:""},on:{"on-change":t.cascaderChange,"on-input-change":t.cascaderInputChange,"on-visible-change":function(e){t.cascaderShow=!t.cascaderShow}},model:{value:t.addData.cascader,callback:function(e){t.$set(t.addData,"cascader",e)},expression:"addData.cascader"}})],1),t._v(" "),n("div",{staticClass:"task-add-form"},[n("div",{staticClass:"title"},[n("Input",{ref:"input",attrs:{type:"textarea",rows:1,autosize:{minRows:1,maxRows:8},maxlength:255,placeholder:t.$L("任务描述"),enterkeyhint:"done"},on:{"on-keydown":t.onKeydown},model:{value:t.addData.name,callback:function(e){t.$set(t.addData,"name",e)},expression:"addData.name"}})],1),t._v(" "),n("div",{staticClass:"desc"},[n("TEditor",{attrs:{plugins:t.taskPlugins,options:t.taskOptions,"option-full":t.taskOptionFull,placeholder:t.$L(t.windowLarge?"详细描述,选填...(点击右键使用工具栏)":"详细描述,选填..."),placeholderFull:t.$L("详细描述..."),inline:""},model:{value:t.addData.content,callback:function(e){t.$set(t.addData,"content",e)},expression:"addData.content"}})],1),t._v(" "),n("div",{staticClass:"advanced-option"},[n("Button",{class:{advanced:t.advanced},on:{click:function(e){t.advanced=!t.advanced}}},[t._v(t._s(t.$L("高级选项")))]),t._v(" "),n("ul",{staticClass:"advanced-priority"},t._l(t.taskPriority,(function(e,r){return n("li",{key:r},[n("ETooltip",{attrs:{disabled:t.windowSmall,content:t.taskPriorityContent(e)}},[n("i",{staticClass:"taskfont",style:{color:e.color},domProps:{innerHTML:t._s(t.addData.p_name==e.name?"":"")},on:{click:function(n){return t.choosePriority(e)}}})])],1)})),0),t._v(" "),t.taskDays>0?n("DatePicker",{attrs:{open:t.taskTimeOpen,options:t.timeOptions,placeholder:t.$L("选择计划范围"),format:"yyyy/MM/dd HH:mm",type:"datetimerange",placement:"bottom"},on:{"on-change":function(e){return t.taskTimeChange(t.addData.times)},"on-open-change":t.taskTimeOpenChange},model:{value:t.addData.times,callback:function(e){t.$set(t.addData,"times",e)},expression:"addData.times"}},[n("div",{staticClass:"advanced-time",on:{click:function(e){return t.taskTimeOpenChange(!t.taskTimeOpen)}}},[n("Icon",{attrs:{type:"ios-clock-outline"}}),t._v(" "),n("em",{style:t.addData.p_color?{backgroundColor:t.addData.p_color}:{},attrs:{type:"primary"}},[t._v(t._s(t.taskDays))])],1)]):t._e()],1)]),t._v(" "),t.advanced?n("Form",{staticClass:"task-add-advanced",attrs:{"label-width":"auto"},nativeOn:{submit:function(t){t.preventDefault()}}},[n("FormItem",{attrs:{label:t.$L("计划时间")}},[n("DatePicker",{attrs:{options:t.timeOptions,editable:!1,placeholder:t.$L("选择计划范围"),format:"yyyy/MM/dd HH:mm",type:"datetimerange"},on:{"on-change":function(e){return t.taskTimeChange(t.addData.times)}},model:{value:t.addData.times,callback:function(e){t.$set(t.addData,"times",e)},expression:"addData.times"}})],1),t._v(" "),n("FormItem",{attrs:{label:t.$L("任务负责人")}},[n("UserInput",{attrs:{"multiple-max":10,placeholder:t.$L("选择任务负责人"),"project-id":t.addData.project_id,transfer:!1},model:{value:t.addData.owner,callback:function(e){t.$set(t.addData,"owner",e)},expression:"addData.owner"}}),t._v(" "),t.showAddAssist?n("div",{staticClass:"task-add-assist"},[n("Checkbox",{attrs:{"true-value":1,"false-value":0},model:{value:t.addData.add_assist,callback:function(e){t.$set(t.addData,"add_assist",e)},expression:"addData.add_assist"}},[t._v(t._s(t.$L("加入任务协助人员列表")))]),t._v(" "),n("ETooltip",{attrs:{disabled:t.windowSmall,content:t.$L("你不是任务负责人时建议加入任务协助人员列表")}},[n("Icon",{attrs:{type:"ios-alert-outline"}})],1)],1):t._e()],1),t._v(" "),n("div",{staticClass:"subtasks"},[t.addData.subtasks.length>0?n("div",{staticClass:"sublist"},[n("Row",[n("Col",{attrs:{span:"12"}},[t._v(t._s(t.$L("任务描述")))]),t._v(" "),n("Col",{attrs:{span:"6"}},[t._v(t._s(t.$L("计划时间")))]),t._v(" "),n("Col",{attrs:{span:"6"}},[t._v(t._s(t.$L("负责人")))])],1),t._v(" "),t._l(t.addData.subtasks,(function(e,r){return n("Row",{key:r},[n("Col",{attrs:{span:"12"}},[n("Input",{attrs:{maxlength:255,clearable:""},on:{"on-clear":function(e){return t.addData.subtasks.splice(r,1)}},model:{value:e.name,callback:function(n){t.$set(e,"name",n)},expression:"item.name"}})],1),t._v(" "),n("Col",{attrs:{span:"6"}},[n("DatePicker",{attrs:{options:t.timeOptions,editable:!1,placeholder:t.$L("选择时间"),format:"yyyy/MM/dd HH:mm",type:"datetimerange"},on:{"on-change":function(n){return t.taskTimeChange(e.times)}},model:{value:e.times,callback:function(n){t.$set(e,"times",n)},expression:"item.times"}})],1),t._v(" "),n("Col",{attrs:{span:"6"}},[n("UserInput",{attrs:{"multiple-max":1,placeholder:t.$L("选择负责人"),"project-id":t.addData.project_id,transfer:!1},model:{value:e.owner,callback:function(n){t.$set(e,"owner",n)},expression:"item.owner"}})],1)],1)}))],2):t._e(),t._v(" "),n("Input",{class:["enter-input",""==t.subName?"empty":""],attrs:{type:"text",placeholder:t.$L("+ 输入子任务,回车添加子任务")},on:{"on-enter":t.addSubTask},model:{value:t.subName,callback:function(e){t.subName=e},expression:"subName"}})],1)],1):t._e(),t._v(" "),n("div",{staticClass:"ivu-modal-footer"},[n("div",{staticClass:"adaption"},[n("Button",{attrs:{type:"default"},on:{click:t.close}},[t._v(t._s(t.$L("取消")))]),t._v(" "),n("ButtonGroup",{staticClass:"page-manage-add-task-button-group"},[n("Button",{attrs:{type:"primary",loading:t.loadIng>0},on:{click:t.onAdd}},[t._v(t._s(t.$L("添加任务")))]),t._v(" "),n("Dropdown",{on:{"on-click":function(e){return t.onAdd(!0)}}},[n("Button",{attrs:{type:"primary"}},[n("Icon",{attrs:{type:"ios-arrow-down"}})],1),t._v(" "),n("DropdownMenu",{attrs:{slot:"list"},slot:"list"},[n("DropdownItem",{attrs:{disabled:t.loadIng>0}},[t._v(t._s(t.$L("提交继续添加")))])],1)],1)],1)],1)])],1):t._e()}),[],!1,null,null,null).exports},97390:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var r=n(20629);function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function i(t){for(var e=1;e{"use strict";n.d(e,{Z:()=>s});function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e{"use strict";n.r(e),n.d(e,{default:()=>lt});var r=n(20629),o=n(9980),i=n.n(o),a=n(25199),s=n(78204),l=n(80641),u=n(57127);function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function f(t){for(var e=1;e0?"子任务":"任务"}}),watch:{active:function(t){t||this.$emit("on-close")},mouseEnter:function(){this.chackClose()},onFocus:function(){this.chackClose()}},methods:{getData:function(){return this.parentId>0?{task_id:this.parentId,name:this.addData.name}:(this.addData.project_id=this.projectId||this.$store.state.projectId,this.addData.column_id=this.columnId||"",this.addData.owner=[this.userId],this.addData.top=this.addTop?1:0,$A.cloneJSON(this.addData))},openAdd:function(){var t=this;this.active=!0,this.defaultPriority(),this.$nextTick((function(){t.$refs.input.focus()}))},chackClose:function(){this.mouseEnter||this.onFocus||this.addData.name||(this.active=!1)},onPriority:function(){this.$emit("on-priority",this.getData()),this.active=!1},onKeydown:function(t){if(13===t.keyCode){if(t.shiftKey)return;t.preventDefault(),this.onAdd()}},onAdd:function(){var t=this;if(this.addData.name){this.loadIng++;var e=this.parentId>0?"taskAddSub":"taskAdd";this.$store.dispatch(e,this.getData()).then((function(e){var n=e.msg;$A.messageSuccess(n),t.loadIng--,t.active=!1,t.addData={name:"",owner:0,column_id:0,times:[],subtasks:[],p_level:0,p_name:"",p_color:""}})).catch((function(e){var n=e.msg;$A.modalError(n),t.loadIng--}))}else $A.messageWarning("请输入任务描述")},taskPriorityContent:function(t){var e=$A.runNum(t.days);return e<=0?t.name+" ("+this.$L("无时间限制")+")":t.name+" ("+e+this.$L("天")+")"},choosePriority:function(t){var e=this,n=new Date,r=new Date((new Date).setDate(n.getDate()+$A.runNum(t.days)));this.$set(this.addData,"times",$A.date2string([n,r])),this.$set(this.addData,"p_level",t.priority),this.$set(this.addData,"p_name",t.name),this.$set(this.addData,"p_color",t.color),this.$nextTick((function(){e.$refs.input.focus()}))},defaultPriority:function(){0!==this.taskPriority.length&&(this.addData.p_name||this.choosePriority(this.taskPriority[0]))}}};var p=n(51900);const m=(0,p.Z)(h,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.rowMode?n("Row",{staticClass:"task-add-row"},[n("Col",{class:["row-add",t.active?"active":""],attrs:{span:"12"}},[n("div",{staticClass:"add-input",on:{mouseenter:function(e){t.mouseEnter=!0},mouseleave:function(e){t.mouseEnter=!1}}},[n("Input",{ref:"input",attrs:{type:"textarea",rows:1,autosize:{minRows:1,maxRows:3},maxlength:255,placeholder:t.$L(t.typeName+"描述,回车创建"),enterkeyhint:"done"},on:{"on-focus":function(e){t.onFocus=!0},"on-blur":function(e){t.onFocus=!1},"on-keydown":t.onKeydown},model:{value:t.addData.name,callback:function(e){t.$set(t.addData,"name",e)},expression:"addData.name"}}),t._v(" "),0==t.parentId?n("div",{staticClass:"priority"},[n("ul",t._l(t.taskPriority,(function(e,r){return n("li",{key:r},[t.active?n("ETooltip",{attrs:{disabled:t.windowSmall,content:t.taskPriorityContent(e)}},[n("i",{staticClass:"taskfont",style:{color:e.color},domProps:{innerHTML:t._s(t.addData.p_name==e.name?"":"")},on:{click:function(n){return t.choosePriority(e)}}})]):t._e()],1)})),0),t._v(" "),n("Icon",{attrs:{type:"md-settings"},on:{click:t.onPriority}})],1):t._e()],1),t._v(" "),n("div",{staticClass:"add-btn",on:{click:t.openAdd}},[n("Icon",{staticClass:"add-icon",attrs:{type:"md-add"}}),t._v(t._s(t.$L("添加"+t.typeName))+"\n ")],1)]),t._v(" "),n("Col",{attrs:{span:"3"}}),t._v(" "),n("Col",{attrs:{span:"3"}}),t._v(" "),n("Col",{attrs:{span:"3"}}),t._v(" "),n("Col",{attrs:{span:"3"}})],1):n("div",{class:["task-add-simple",t.active?"active":""],on:{mouseenter:function(e){t.mouseEnter=!0},mouseleave:function(e){t.mouseEnter=!1}}},[n("Input",{ref:"input",attrs:{type:"textarea",rows:2,autosize:{minRows:2,maxRows:3},maxlength:255,placeholder:t.$L(t.typeName+"描述,回车创建"),enterkeyhint:"done"},on:{"on-focus":function(e){t.onFocus=!0},"on-blur":function(e){t.onFocus=!1},"on-keydown":t.onKeydown},model:{value:t.addData.name,callback:function(e){t.$set(t.addData,"name",e)},expression:"addData.name"}}),t._v(" "),n("div",{staticClass:"add-placeholder",on:{click:t.openAdd}},[n("Icon",{attrs:{type:"md-add"}}),t._v(t._s(t.$L("添加"+t.typeName))+"\n ")],1),t._v(" "),n("div",{staticClass:"priority"},[n("ul",t._l(t.taskPriority,(function(e,r){return n("li",{key:r},[t.active?n("ETooltip",{attrs:{disabled:t.windowSmall,content:t.taskPriorityContent(e)}},[n("i",{staticClass:"taskfont",style:{color:e.color},domProps:{innerHTML:t._s(t.addData.p_name==e.name?"":"")},on:{click:function(n){return t.choosePriority(e)}}})]):t._e()],1)})),0),t._v(" "),n("Icon",{attrs:{type:"md-settings"},on:{click:t.onPriority}})],1)],1)}),[],!1,null,null,null).exports;var g=n(97390);function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function y(t){for(var e=1;e0&&!0!==e.sub_top||0===e.parent_id&&t.fastAddTask?n("Icon",{class:["sub-icon",t.taskOpen[e.id]?"active":""],attrs:{type:"ios-arrow-forward"},on:{click:function(n){return t.getSublist(e)}}}):t._e(),t._v(" "),n("TaskMenu",{ref:"taskMenu_"+e.id,refInFor:!0,attrs:{task:e}}),t._v(" "),n("div",{staticClass:"item-title",on:{click:function(n){return t.openTask(e)}}},[e.flow_item_name?n("span",{class:e.flow_item_status,on:{click:function(n){return n.stopPropagation(),t.openMenu(n,e)}}},[t._v(t._s(e.flow_item_name))]):t._e(),t._v(" "),!0===e.sub_top?n("span",[t._v(t._s(t.$L("子任务")))]):t._e(),t._v(" "),e.sub_my&&e.sub_my.length>0?n("span",[t._v("+"+t._s(e.sub_my.length))]):t._e(),t._v(" "),t._v("\n "+t._s(e.name)+"\n ")]),t._v(" "),n("div",{staticClass:"item-icons",on:{click:function(n){return t.openTask(e)}}},[e.desc?n("div",{staticClass:"item-icon"},[n("i",{staticClass:"taskfont"},[t._v("")])]):t._e(),t._v(" "),e.file_num>0?n("div",{staticClass:"item-icon"},[n("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),n("em",[t._v(t._s(e.file_num))])]):t._e(),t._v(" "),e.msg_num>0?n("div",{staticClass:"item-icon"},[n("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),n("em",[t._v(t._s(e.msg_num))])]):t._e(),t._v(" "),e.sub_num>0?n("div",{staticClass:"item-icon",on:{click:function(n){return n.stopPropagation(),t.getSublist(e)}}},[n("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),n("em",[t._v(t._s(e.sub_complete)+"/"+t._s(e.sub_num))])]):t._e()])],1),t._v(" "),n("Col",{staticClass:"row-column",attrs:{span:"3"}},[n("EDropdown",{attrs:{trigger:"click",size:"small",placement:"bottom",disabled:!0===e.sub_top},on:{command:function(n){return t.dropTask(e,n)}}},[n("div",{staticClass:"task-column"},[t._v(t._s(t.columnName(e.column_id)))]),t._v(" "),n("EDropdownMenu",{attrs:{slot:"dropdown"},slot:"dropdown"},t._l(t.columnList(e.project_id),(function(e){return n("EDropdownItem",{key:e.id,attrs:{command:"column::"+e.id}},[t._v("\n "+t._s(e.name)+"\n ")])})),1)],1)],1),t._v(" "),n("Col",{staticClass:"row-priority",attrs:{span:"3"}},[n("EDropdown",{attrs:{trigger:"click",size:"small",placement:"bottom",disabled:!0===e.sub_top},on:{command:function(n){return t.dropTask(e,n)}}},[n("TaskPriority",{attrs:{backgroundColor:e.p_color}},[t._v(t._s(e.p_name))]),t._v(" "),n("EDropdownMenu",{attrs:{slot:"dropdown"},slot:"dropdown"},t._l(t.taskPriority,(function(e,r){return n("EDropdownItem",{key:r,attrs:{command:"priority::"+r}},[n("i",{staticClass:"taskfont",style:{color:e.color},domProps:{innerHTML:t._s(e.p_name==e.name?"":"")}}),t._v("\n "+t._s(e.name)+"\n ")])})),1)],1)],1),t._v(" "),n("Col",{staticClass:"row-user",attrs:{span:"3"}},[n("ul",{on:{click:function(n){return t.openTask(e)}}},[t._l(t.ownerUser(e.task_user),(function(r,o){return o<3?n("li",{key:o},[n("UserAvatar",{attrs:{userid:r.userid,size:"32",borderWitdh:2,borderColor:e.color,showName:1===t.ownerUser(e.task_user).length}})],1):t._e()})),t._v(" "),0===t.ownerUser(e.task_user).length?n("li",{staticClass:"no-owner"},[n("Button",{attrs:{type:"primary",size:"small"},on:{click:function(n){return n.stopPropagation(),t.openTask(e,!0)}}},[t._v(t._s(t.$L("领取任务")))])],1):t._e()],2)]),t._v(" "),n("Col",{staticClass:"row-time",attrs:{span:"3"}},[!e.complete_at&&e.end_at?n("ETooltip",{class:["task-time",e.today?"today":"",e.overdue?"overdue":""],attrs:{disabled:t.windowSmall,"open-delay":600,content:e.end_at}},[n("div",{on:{click:function(n){return t.openTask(e)}}},[t._v(t._s(t.expiresFormat(e.end_at)))])]):t.showCompleteAt&&e.complete_at?n("div",{attrs:{title:e.complete_at}},[t._v(t._s(t.completeAtFormat(e.complete_at)))]):t._e()],1)],1),t._v(" "),!0===t.taskOpen[e.id]?n("TaskRow",{attrs:{list:t.subTask(e.id),"parent-id":e.id,"fast-add-task":0===e.parent_id&&t.fastAddTask,"open-key":t.openKey},on:{command:t.dropTask}}):t._e()],1)})),t._v(" "),t.fastAddTask||t.parentId>0?n("TaskAddSimple",{attrs:{"parent-id":t.parentId,"row-mode":""},on:{"on-priority":t.onPriority}}):t._e()],2)}),[],!1,null,null,null).exports;function C(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function k(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const x={name:"TaskArchived",props:{projectId:{type:Number,default:0}},data:function(){return{loadIng:0,keys:{},keyIs:!1,columns:[],list:[],page:1,pageSize:20,total:0,noText:""}},mounted:function(){},computed:function(t){for(var e=1;e0?n("Loading"):t._e()],1)]),t._v(" "),n("div",{staticClass:"search-container lr"},[n("ul",[n("li",[n("div",{staticClass:"search-label"},[t._v("\n "+t._s(t.$L("任务名"))+"\n ")]),t._v(" "),n("div",{staticClass:"search-content"},[n("Input",{attrs:{clearable:""},model:{value:t.keys.name,callback:function(e){t.$set(t.keys,"name",e)},expression:"keys.name"}})],1)]),t._v(" "),n("li",{staticClass:"search-button"},[n("Tooltip",{attrs:{theme:"light",placement:"right","transfer-class-name":"search-button-clear",transfer:""}},[n("Button",{attrs:{loading:t.loadIng>0,type:"primary",icon:"ios-search"},on:{click:t.onSearch}},[t._v(t._s(t.$L("搜索")))]),t._v(" "),n("div",{attrs:{slot:"content"},slot:"content"},[t.keyIs?n("Button",{attrs:{type:"text"},on:{click:function(e){t.keyIs=!1}}},[t._v(t._s(t.$L("取消筛选")))]):n("Button",{attrs:{loading:t.loadIng>0,type:"text"},on:{click:t.getLists}},[t._v(t._s(t.$L("刷新")))])],1)],1)],1)])]),t._v(" "),n("div",{staticClass:"table-page-box"},[n("Table",{attrs:{columns:t.columns,data:t.list,loading:t.loadIng>0,"no-data-text":t.$L(t.noText),stripe:""}}),t._v(" "),n("Page",{attrs:{total:t.total,current:t.page,"page-size":t.pageSize,disabled:t.loadIng>0,simple:t.windowSmall,"page-size-opts":[10,20,30,50,100],"show-elevator":"","show-sizer":"","show-total":""},on:{"on-change":t.setPage,"on-page-size-change":t.setPageSize}})],1)])}),[],!1,null,null,null).exports;var O=n(30021),E=n(99383);const T={name:"ProjectWorkflow",components:{UserInput:u.Z,Draggable:i()},props:{projectId:{type:Number,default:0}},data:function(){return{loadIng:0,list:[],openIndex:"",userShow:!1,userData:{}}},mounted:function(){},watch:{projectId:{handler:function(t){t&&this.getData()},immediate:!0}},methods:{getData:function(){var t=this;this.loadIng++,this.$store.dispatch("call",{url:"project/flow/list",data:{project_id:this.projectId}}).then((function(e){var n=e.data;t.list=n.map((function(t){return t.project_flow_bak=JSON.stringify(t.project_flow_item),t})),t.openIndex=1===t.list.length?"index_"+t.list[0].id:"",t.$nextTick(t.syncScroller)})).catch((function(t){var e=t.msg;$A.modalError(e)})).finally((function(e){t.loadIng--}))},syncScroller:function(){var t=this;this.list.some((function(e){t.$refs["overlay_".concat(e.id)]&&t.$refs["overlay_".concat(e.id)].some((function(n){Object.keys(n.attributes).includes("sync-scroller")||(n.setAttribute("sync-scroller",!0),n.addEventListener("scroll",(function(r){var o=r.target,i=o.scrollTop,a=o.scrollLeft;t.$nextTick((function(){t.$refs["overlay_".concat(e.id)].some((function(t){t!=n&&t.scrollTo(a,i)}))}))})))}))}))},contrast:function(t,e){return JSON.stringify(t)!=e},existDiff:function(){var t=this;return!!this.list.find((function(e){return t.contrast(e.project_flow_item,e.project_flow_bak)}))},onCreate:function(){var t=-1*$A.randNum(1e3,1e4);this.list.push({id:t,name:"Default",project_flow_item:[{id:-10,name:"待处理",status:"start",turns:[-10,-11,-12,-13,-14],userids:[],usertype:"add",userlimit:0},{id:-11,name:"进行中",status:"progress",turns:[-10,-11,-12,-13,-14],userids:[],usertype:"add",userlimit:0},{id:-12,name:"待测试",status:"test",turns:[-10,-11,-12,-13,-14],userids:[],usertype:"add",userlimit:0},{id:-13,name:"已完成",status:"end",turns:[-10,-11,-12,-13,-14],userids:[],usertype:"add",userlimit:0},{id:-14,name:"已取消",status:"end",turns:[-10,-11,-12,-13,-14],userids:[],usertype:"add",userlimit:0}]}),this.openIndex="index_"+t,this.$nextTick(this.syncScroller)},onDelete:function(t){var e=this;$A.modalConfirm({title:"删除工作流",content:"你确定要删除工作流吗?",loading:!0,onOk:function(){if(t.id>0)return new Promise((function(n,r){e.loadIng++,e.$store.dispatch("call",{url:"project/flow/delete",data:{project_id:e.projectId}}).then((function(r){var o=r.msg;n(o);var i=e.list.findIndex((function(e){return e.id==t.id}));i>-1&&e.list.splice(i,1)})).catch((function(t){var e=t.msg;r(e)})).finally((function(t){e.loadIng--}))}));var n=e.list.findIndex((function(e){return e.id==t.id}));n>-1&&e.list.splice(n,1)}})},onMore:function(t,e){switch(t){case"user":this.$set(this.userData,"id",e.id),this.$set(this.userData,"name",e.name),this.$set(this.userData,"userids",e.userids),this.$set(this.userData,"usertype",e.usertype),this.$set(this.userData,"userlimit",e.userlimit),this.userShow=!0;break;case"name":this.onName(e);break;case"remove":this.onRemove(e)}},onUser:function(){var t=this;this.userShow=!1,this.list.some((function(e){var n=e.project_flow_item.find((function(e){return e.id==t.userData.id}));n&&(t.$set(n,"userids",t.userData.userids),t.$set(n,"usertype",t.userData.usertype),t.$set(n,"userlimit",t.userData.userlimit))}))},onName:function(t){var e=this;$A.modalInput({value:t.name,title:"修改名称",placeholder:"请输入流程名称",onOk:function(n){if(!n)return"请输入流程名称";e.$set(t,"name",n)}})},onRemove:function(t){this.list.some((function(e){var n=e.project_flow_item.findIndex((function(e){return e.id==t.id}));n>-1&&e.project_flow_item.splice(n,1)}))},onTurns:function(t){this.$set(t,"turns",t.turns.sort())},onAdd:function(t){$A.modalInput({title:"添加状态",placeholder:"请输入状态名称",onOk:function(e){if(!e)return"请输入状态名称";var n=-1*$A.randNum(1e5,999999),r=t.project_flow_item.map((function(t){return t.id}));t.project_flow_item.push({id:n,name:e,status:"end",turns:r,userids:[],usertype:"add",userlimit:0}),t.project_flow_item.some((function(t){t.turns.push(n)}))}})},onReduction:function(t){this.$set(t,"project_flow_item",JSON.parse(t.project_flow_bak))},onSave:function(t){var e=this,n=0;t.project_flow_item.some((function(t){t.sort=n++})),this.loadIng++,this.$store.dispatch("call",{url:"project/flow/save",data:{project_id:this.projectId,flows:t.project_flow_item},method:"post"}).then((function(n){var r=n.data,o=n.msg;$.messageSuccess(o),r.project_flow_bak=JSON.stringify(r.project_flow_item);var i=e.list.findIndex((function(e){return e.id==t.id}));i>-1?e.list.splice(i,1,r):e.list.push(r),e.openIndex="index_"+r.id,e.$nextTick(e.syncScroller)})).catch((function(t){var e=t.msg;$A.modalError(e)})).finally((function(t){e.loadIng--}))},saveAll:function(){var t=this;this.list.some((function(e){t.contrast(e.project_flow_item,e.project_flow_bak)&&t.onSave(e)}))}}};const A=(0,p.Z)(T,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"project-workflow"},[n("div",{staticClass:"workflow-title"},[t._v("\n "+t._s(t.$L("工作流设置"))+"\n "),n("div",{staticClass:"title-icon"},[t.loadIng>0?n("Loading"):n("Icon",{attrs:{type:"ios-refresh"},on:{click:t.getData}})],1)]),t._v(" "),t.list.length>0?n("div",{staticClass:"workflow-content"},[n("Collapse",{attrs:{accordion:""},model:{value:t.openIndex,callback:function(e){t.openIndex=e},expression:"openIndex"}},t._l(t.list,(function(e){return n("Panel",{key:e.id,attrs:{name:"index_"+e.id}},[n("div",{staticClass:"workflow-item"},[n("div",{staticClass:"workflow-name"},[t._v(t._s(e.name))]),t._v(" "),n("div",{staticClass:"workflow-status"},t._l(e.project_flow_item,(function(e){return n("div",{class:e.status},[t._v(t._s(e.name))])})),0),t._v(" "),n("div",{staticClass:"workflow-save",on:{click:function(t){t.stopPropagation()}}},[t.contrast(e.project_flow_item,e.project_flow_bak)?[n("Button",{attrs:{loading:t.loadIng>0,type:"primary"},on:{click:function(n){return t.onSave(e)}}},[t._v(t._s(t.$L("保存")))]),t._v(" "),e.id>0?n("Button",{attrs:{disabled:t.loadIng>0,type:"primary",ghost:""},on:{click:function(n){return t.onReduction(e,n)}}},[t._v(t._s(t.$L("还原")))]):t._e()]:t._e(),t._v(" "),n("Button",{attrs:{disabled:t.loadIng>0,type:"error",ghost:""},on:{click:function(n){return t.onDelete(e)}}},[t._v(t._s(t.$L("删除")))])],2)]),t._v(" "),n("div",{staticClass:"taskflow-config",attrs:{slot:"content"},slot:"content"},[n("div",{staticClass:"taskflow-config-table"},[n("div",{staticClass:"taskflow-config-table-left-container"},[n("div",{staticClass:"taskflow-config-table-column-header left-header"},[t._v(t._s(t.$L("配置项")))]),t._v(" "),n("div",{ref:"overlay_"+e.id,refInFor:!0,staticClass:"taskflow-config-table-column-body scrollbar-overlay"},[n("div",{staticClass:"taskflow-config-table-block"},[n("div",{staticClass:"taskflow-config-table-block-title"},[t._v(t._s(t.$L("设置状态为")))]),t._v(" "),n("div",{staticClass:"taskflow-config-table-block-item"},[n("div",[n("div",{staticClass:"title"},[t._v(t._s(t.$L("开始状态")))]),t._v(" "),n("div",{staticClass:"subtitle"},[t._v(t._s(t.$L("新建任务默认状态")))])])]),t._v(" "),n("div",{staticClass:"taskflow-config-table-block-item"},[n("div",[n("div",{staticClass:"title"},[t._v(t._s(t.$L("进行中")))]),t._v(" "),n("div",{staticClass:"subtitle"},[t._v(t._s(t.$L("可设置多个状态为进行中")))])])]),t._v(" "),n("div",{staticClass:"taskflow-config-table-block-item"},[n("div",[n("div",{staticClass:"title"},[t._v(t._s(t.$L("验收/测试")))]),t._v(" "),n("div",{staticClass:"subtitle"},[t._v(t._s(t.$L("只能设置单个状态为验收/测试")))])])]),t._v(" "),n("div",{staticClass:"taskflow-config-table-block-item"},[n("div",[n("div",{staticClass:"title"},[t._v(t._s(t.$L("结束状态")))]),t._v(" "),n("div",{staticClass:"subtitle"},[t._v(t._s(t.$L("该状态下任务自动标记完成")))])])])]),t._v(" "),n("div",{staticClass:"taskflow-config-table-block hr"},[n("div",{staticClass:"taskflow-config-table-block-title"},[t._v(t._s(t.$L("可流转到")))]),t._v(" "),t._l(e.project_flow_item,(function(e){return n("div",{staticClass:"taskflow-config-table-block-item"},[n("span",{staticClass:"transform-status-name"},[t._v(t._s(e.name))])])}))],2)])]),t._v(" "),n("div",{staticClass:"taskflow-config-table-right-container"},[n("Draggable",{staticClass:"taskflow-config-table-list-wrapper",attrs:{list:e.project_flow_item,animation:150,disabled:t.windowSmall,tag:"div",draggable:".column-border"},on:{sort:function(t){}}},[t._l(e.project_flow_item,(function(r){return n("div",{staticClass:"taskflow-config-table-status-column column-border",class:r.status},[n("div",{staticClass:"taskflow-config-table-status-item taskflow-config-table-column-header"},[n("div",{staticClass:"status-label-with-menu",class:r.status},[n("div",{staticClass:"name"},[t._v(t._s(t.$L(r.name)))]),t._v(" "),n("EDropdown",{staticClass:"more",class:{opacity:r.userids.length>0},attrs:{trigger:"click"},on:{command:function(e){return t.onMore(e,r)}}},[n("div",{staticClass:"more-icon"},[r.userids.length>1?n("EAvatar",{attrs:{size:20}},[t._v(t._s(r.userids.length))]):r.userids.length>0?n("UserAvatar",{attrs:{userid:r.userids[0],size:20,tooltipDisabled:""}}):n("Icon",{attrs:{type:"ios-more"}})],1),t._v(" "),n("EDropdownMenu",{staticClass:"taskflow-config-more-dropdown-menu",attrs:{slot:"dropdown"},slot:"dropdown"},[r.userids.length>0?n("EDropdownItem",{attrs:{command:"user"}},[n("div",{staticClass:"users"},t._l(r.userids,(function(t,e){return n("UserAvatar",{key:e,attrs:{userid:t,size:28,borderWitdh:1,showName:1===r.userids.length,tooltipDisabled:""}})})),1)]):t._e(),t._v(" "),n("EDropdownItem",{attrs:{command:"user"}},[n("div",{staticClass:"item"},[n("Icon",{attrs:{type:"md-person"}}),t._v("\n "+t._s(t.$L("状态负责人"))+"\n ")],1)]),t._v(" "),n("EDropdownItem",{attrs:{command:"name"}},[n("div",{staticClass:"item"},[n("Icon",{attrs:{type:"md-create"}}),t._v(t._s(t.$L("修改名称"))+"\n ")],1)]),t._v(" "),n("EDropdownItem",{attrs:{command:"remove"}},[n("div",{staticClass:"item delete"},[n("Icon",{attrs:{type:"md-trash"}}),t._v(t._s(t.$L("删除"))+"\n ")],1)])],1)],1)],1)]),t._v(" "),n("div",{ref:"overlay_"+e.id,refInFor:!0,staticClass:"taskflow-config-table-column-body scrollbar-overlay"},[n("div",{staticClass:"taskflow-config-table-block"},[n("div",{staticClass:"taskflow-config-table-block-title"}),t._v(" "),n("RadioGroup",{model:{value:r.status,callback:function(e){t.$set(r,"status",e)},expression:"item.status"}},[n("Radio",{attrs:{label:"start"}},[n("span")]),t._v(" "),n("Radio",{attrs:{label:"progress"}},[n("span")]),t._v(" "),n("Radio",{attrs:{label:"test"}},[n("span")]),t._v(" "),n("Radio",{attrs:{label:"end"}},[n("span")])],1)],1),t._v(" "),n("div",{staticClass:"taskflow-config-table-block"},[n("div",{staticClass:"taskflow-config-table-block-title"}),t._v(" "),n("CheckboxGroup",{on:{"on-change":function(e){return t.onTurns(r)}},model:{value:r.turns,callback:function(e){t.$set(r,"turns",e)},expression:"item.turns"}},t._l(e.project_flow_item,(function(t){return n("Checkbox",{key:t.id,attrs:{label:t.id,disabled:t.id==r.id}},[n("span")])})),1)],1)])])})),t._v(" "),n("div",{staticClass:"taskflow-config-table-status-column addnew",on:{click:function(n){return t.onAdd(e)}}},[t._v(t._s(t.$L("添加状态")))])],2)],1)])])])})),1)],1):0==t.loadIng?n("div",{staticClass:"workflow-no"},[t._v("\n "+t._s(t.$L("当前项目还没有创建工作流"))+"\n "),n("Button",{attrs:{type:"primary"},on:{click:t.onCreate}},[t._v(t._s(t.$L("创建工作流")))])],1):t._e(),t._v(" "),n("Modal",{attrs:{title:t.$L("状态负责人")+" ("+t.userData.name+")","mask-closable":!1},model:{value:t.userShow,callback:function(e){t.userShow=e},expression:"userShow"}},[n("Form",{attrs:{model:t.userData,"label-width":"auto"},nativeOn:{submit:function(t){t.preventDefault()}}},[n("FormItem",{attrs:{prop:"userids",label:t.$L("状态负责人")}},[n("UserInput",{attrs:{"project-id":t.projectId,"multiple-max":5,placeholder:t.$L("选择状态负责人")},model:{value:t.userData.userids,callback:function(e){t.$set(t.userData,"userids",e)},expression:"userData.userids"}})],1),t._v(" "),n("FormItem",{attrs:{prop:"usertype",label:t.$L("流转模式")}},[n("RadioGroup",{model:{value:t.userData.usertype,callback:function(e){t.$set(t.userData,"usertype",e)},expression:"userData.usertype"}},[n("Radio",{attrs:{label:"add"}},[t._v(t._s(t.$L("添加模式")))]),t._v(" "),n("Radio",{attrs:{label:"replace"}},[t._v(t._s(t.$L("流转模式")))]),t._v(" "),n("Radio",{attrs:{label:"merge"}},[t._v(t._s(t.$L("剔除模式")))])],1),t._v(" "),"replace"==t.userData.usertype?n("div",{staticClass:"form-tip"},[t._v(t._s(t.$L("流转到【"+t.userData.name+"】时改变任务负责人为状态负责人,原本的任务负责人移至协助人员。")))]):"merge"==t.userData.usertype?n("div",{staticClass:"form-tip"},[t._v(t._s(t.$L("流转到【"+t.userData.name+"】时改变任务负责人为状态负责人(并保留操作状态的人员),原本的任务负责人移至协助人员。")))]):n("div",{staticClass:"form-tip"},[t._v(t._s(t.$L("流转到【"+t.userData.name+"】时添加状态负责人至任务负责人。")))])],1),t._v(" "),n("FormItem",{attrs:{prop:"userlimit",label:t.$L("限制负责人")}},[n("iSwitch",{attrs:{"true-value":1,"false-value":0},model:{value:t.userData.userlimit,callback:function(e){t.$set(t.userData,"userlimit",e)},expression:"userData.userlimit"}}),t._v(" "),1===t.userData.userlimit?n("div",{staticClass:"form-tip"},[t._v(t._s(t.$L("流转到【"+t.userData.name+'】时,仅"状态负责人"和"项目管理员"可以修改状态。')))]):n("div",{staticClass:"form-tip"},[t._v(t._s(t.$L("流转到【"+t.userData.name+'】时,"任务负责人"和"项目管理员"可以修改状态。')))])],1)],1),t._v(" "),n("div",{staticClass:"adaption",attrs:{slot:"footer"},slot:"footer"},[n("Button",{attrs:{type:"default"},on:{click:function(e){t.userShow=!1}}},[t._v(t._s(t.$L("取消")))]),t._v(" "),n("Button",{attrs:{type:"primary"},on:{click:t.onUser}},[t._v(t._s(t.$L("保存")))])],1)],1)],1)}),[],!1,null,null,null).exports;function D(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function N(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const L={name:"TaskDeleted",props:{projectId:{type:Number,default:0}},data:function(){return{loadIng:0,keys:{},keyIs:!1,columns:[],list:[],page:1,pageSize:20,total:0,noText:""}},mounted:function(){},computed:function(t){for(var e=1;e0?n("Loading"):t._e()],1)]),t._v(" "),n("div",{staticClass:"search-container lr"},[n("ul",[n("li",[n("div",{staticClass:"search-label"},[t._v("\n "+t._s(t.$L("任务名"))+"\n ")]),t._v(" "),n("div",{staticClass:"search-content"},[n("Input",{attrs:{clearable:""},model:{value:t.keys.name,callback:function(e){t.$set(t.keys,"name",e)},expression:"keys.name"}})],1)]),t._v(" "),n("li",{staticClass:"search-button"},[n("Tooltip",{attrs:{theme:"light",placement:"right","transfer-class-name":"search-button-clear",transfer:""}},[n("Button",{attrs:{loading:t.loadIng>0,type:"primary",icon:"ios-search"},on:{click:t.onSearch}},[t._v(t._s(t.$L("搜索")))]),t._v(" "),n("div",{attrs:{slot:"content"},slot:"content"},[t.keyIs?n("Button",{attrs:{type:"text"},on:{click:function(e){t.keyIs=!1}}},[t._v(t._s(t.$L("取消筛选")))]):n("Button",{attrs:{loading:t.loadIng>0,type:"text"},on:{click:t.getLists}},[t._v(t._s(t.$L("刷新")))])],1)],1)],1)])]),t._v(" "),n("div",{staticClass:"table-page-box"},[n("Table",{attrs:{columns:t.columns,data:t.list,loading:t.loadIng>0,"no-data-text":t.$L(t.noText),stripe:""}}),t._v(" "),n("Page",{attrs:{total:t.total,current:t.page,"page-size":t.pageSize,disabled:t.loadIng>0,simple:t.windowSmall,"page-size-opts":[10,20,30,50,100],"show-elevator":"","show-sizer":"","show-total":""},on:{"on-change":t.setPage,"on-page-size-change":t.setPageSize}})],1)])}),[],!1,null,null,null).exports;function j(t){return j="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},j(t)}const P={name:"GanttView",props:{lists:{type:Array},menuWidth:{type:Number,default:300},itemWidth:{type:Number,default:100}},data:function(){return{mouseType:"",mouseWidth:0,mouseScaleWidth:0,dateWidth:100,ganttWidth:0,mouseItem:null,mouseBak:{},dateMove:null}},mounted:function(){this.dateWidth=this.itemWidth,this.$refs.ganttRight.addEventListener("mousewheel",this.handleScroll,!1),document.addEventListener("mousemove",this.itemMouseMove),document.addEventListener("mouseup",this.itemMouseUp),window.addEventListener("resize",this.handleResize,!1),this.handleResize()},beforeDestroy:function(){this.$refs.ganttRight.removeEventListener("mousewheel",this.handleScroll,!1),document.removeEventListener("mousemove",this.itemMouseMove),document.removeEventListener("mouseup",this.itemMouseUp),window.removeEventListener("resize",this.handleResize,!1)},watch:{itemWidth:function(t){this.dateWidth=t}},computed:{monthNum:function(){var t=this.ganttWidth,e=this.dateWidth;return Math.floor(t/e/30)+2},monthStyle:function(){var t=this.mouseWidth,e=this.dateWidth;return function(n){var r=0==t?0:t/e,o=new Date,i=new Date(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0),a=new Date(i.getTime()+864e5*r),s=new Date(a.getFullYear(),a.getMonth()+1,0,23,59,59),l=e*((s-a)/1e3/60/60/24);return n>0&&(l=(s=new Date(a.getFullYear(),a.getMonth()+1+n,0)).getDate()*e),{width:l+"px"}}},monthFormat:function(){var t=this.mouseWidth,e=this.dateWidth;return function(n){var r=0==t?0:t/e,o=new Date,i=new Date(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0),a=new Date(i.getTime()+864e5*r);return n>0&&(a=new Date(a.getFullYear(),a.getMonth()+1+n,0)),$A.formatDate("Y-m",a)}},dateNum:function(){var t=this.ganttWidth,e=this.dateWidth;return Math.floor(t/e)+2},dateStyle:function(){var t=this.mouseWidth,e=this.dateWidth;return function(n){var r={},o=0==t?0:t/e,i=Math.floor(o)+n;o==Math.floor(o)&&i--;var a=0==t?n-1:i,s=new Date((new Date).getTime()+864e5*a);-1!==[0,6].indexOf(s.getDay())&&(r.backgroundColor="#f9fafb");var l=e;return 0==n&&(l=Math.abs((t%l-l)%l)),r.width=l+"px",r}},dateFormat:function(){var t=this.mouseWidth,e=this.dateWidth;return function(n,r){var o=0==t?0:t/e,i=Math.floor(o)+n;o==Math.floor(o)&&i--;var a=0==t?n-1:i,s=new Date((new Date).getTime()+864e5*a);return"day"==r?s.getDate():"week"==r?this.$L("星期".concat("日一二三四五六".charAt(s.getDay()))):s}},itemStyle:function(){var t=this.mouseWidth,e=this.dateWidth,n=this.ganttWidth;return function(r){var o=r.time,i=o.start,a=o.end,s=r.style,l=r.moveX,u=r.moveW,c=new Date,f=new Date(c.getFullYear(),c.getMonth(),c.getDate(),0,0,0).getTime(),d=(i-f)/1e3/60/60/24,h=e*d+-1*t,p=e*((a-f)/1e3/60/60/24-d);"number"==typeof l&&(h+=l),"number"==typeof u&&(p+=u);var m={left:Math.min(Math.max(h,-1.2*p),1.2*n).toFixed(2)+"px",width:p.toFixed(2)+"px"};return h<0&&Math.abs(h)n&&he.scrollHeight-e.clientHeight&&(n=e.scrollHeight-e.clientHeight),e.scrollTop!=n&&(this.mouseType="timeline",e.scrollTop=n)}0!=t.deltaX&&(this.mouseWidth+=t.deltaX,this.mouseScaleWidth+=t.deltaX*(100/this.dateWidth))},handleResize:function(){this.ganttWidth=this.$refs.ganttTimeline.clientWidth},dateMouseDown:function(t){t.preventDefault(),this.mouseItem=null,this.dateMove={clientX:t.clientX}},itemMouseDown:function(t,e){t.preventDefault();var n="moveX";"timeline-resizer"==t.target.className&&(n="moveW"),"number"!=typeof e[n]&&this.$set(e,n,0),this.mouseBak={type:n,clientX:t.clientX,value:e[n]},this.mouseItem=e,this.dateMove=null},itemMouseMove:function(t){if(null!=this.mouseItem){t.preventDefault();var e=this.mouseBak.value+(t.clientX-this.mouseBak.clientX);if("moveW"===this.mouseBak.type){var n=864e5/this.dateWidth,r=this.mouseItem.time,o=r.start;if(r.end+e*n-o<=0)return}this.$set(this.mouseItem,this.mouseBak.type,e)}else if(null!=this.dateMove){t.preventDefault();var i=5*(this.dateMove.clientX-t.clientX);this.dateMove.clientX=t.clientX,this.mouseWidth+=i,this.mouseScaleWidth+=i*(100/this.dateWidth)}},itemMouseUp:function(t){if(null!=this.mouseItem){var e=this.mouseItem.time,n=e.start,r=e.end,o=!1,i=864e5/this.dateWidth;if("number"==typeof this.mouseItem.moveX&&0!=this.mouseItem.moveX){var a=this.mouseItem.moveX*i;this.$set(this.mouseItem.time,"start",n+a),this.$set(this.mouseItem.time,"end",r+a),this.$set(this.mouseItem,"moveX",0),o=!0}if("number"==typeof this.mouseItem.moveW&&0!=this.mouseItem.moveW){var s=this.mouseItem.moveW*i;this.$set(this.mouseItem.time,"end",r+s),this.$set(this.mouseItem,"moveW",0),o=!0}o?this.$emit("on-change",this.mouseItem):"timeline-title"==t.target.className&&this.clickItem(this.mouseItem),this.mouseItem=null}else null!=this.dateMove&&(this.dateMove=null)},scrollPosition:function(t){var e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0),r=864e5/this.dateWidth,o=(this.lists[t].time.start-n)/r-this.dateWidth-this.mouseWidth;this.mouseWidth+=o,this.mouseScaleWidth+=o*(100/this.dateWidth)},clickItem:function(t){this.$emit("on-click",t)}}};function R(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function M(t){for(var e=1;e46?n("div",{staticClass:"format-week"},[t._v(t._s(t.dateFormat(r,"week")))]):t._e()])])})),0),t._v(" "),n("ul",{ref:"ganttTimeline",staticClass:"gantt-timeline",on:{scroll:t.timelineScrollListener,mouseenter:function(e){t.mouseType="timeline"}}},t._l(t.lists,(function(e,r){return n("li",{key:r},[n("div",{staticClass:"timeline-item",style:t.itemStyle(e),on:{mousedown:function(n){return t.itemMouseDown(n,e)}}},[n("div",{staticClass:"timeline-title",attrs:{title:e.label}},[t._v(t._s(e.label))]),t._v(" "),n("div",{staticClass:"timeline-resizer"})])])})),0)])])])}),[],!1,null,null,null).exports},props:{projectColumn:{default:[]},flowInfo:{default:{}}},data:function(){return{lists:[],filtrProjectId:0,editColumns:[{title:this.$L("任务名称"),key:"label",minWidth:150,ellipsis:!0},{title:this.$L("原计划时间"),minWidth:135,align:"center",render:function(t,e){var n=e.row;return!0===n.notime?t("span","-"):t("div",{style:{}},[t("div",$A.formatDate("Y-m-d H:i",Math.round(n.baktime.start/1e3))),t("div",$A.formatDate("Y-m-d H:i",Math.round(n.baktime.end/1e3)))])}},{title:this.$L("新计划时间"),minWidth:135,align:"center",render:function(t,e){var n=e.row;return t("div",{style:{}},[t("div",$A.formatDate("Y-m-d H:i",Math.round(n.newTime.start/1e3))),t("div",$A.formatDate("Y-m-d H:i",Math.round(n.newTime.end/1e3)))])}}],editData:[],editLoad:0,editShowInfo:!1}},mounted:function(){this.initData()},computed:M(M(M({},(0,r.rn)(["taskPriority"])),(0,r.Se)(["projectData"])),{},{menuWidth:function(){return this.windowWidth<1440?180:260},dropStyle:function(){return this.windowWidth<1440?{left:"142px"}:{}},completedTask:function(){return this.projectData.cacheParameter.completedTask}}),watch:{projectColumn:{handler:function(){this.initData()},deep:!0},flowInfo:{handler:function(){this.initData()},deep:!0},completedTask:function(){this.initData()}},methods:{initData:function(){this.lists=[],this.projectColumn&&this.projectColumn.some(this.checkAdd)},filtrLength:function(t){var e=this;return t.filter((function(t){return!(t.complete_at&&!e.completedTask)&&!(e.flowInfo.value>0&&t.flow_item_id!==e.flowInfo.value)})).length},checkAdd:function(t){var e=this;this.filtrProjectId>0&&t.id!=this.filtrProjectId||t.tasks&&t.tasks.some((function(t){var n=!t.start_at||!t.end_at,r=e.getTimeObj(t),o=r.start,i=r.end;if(t.complete_at&&!e.completedTask)return!1;if(e.flowInfo.value>0&&t.flow_item_id!==e.flowInfo.value)return!1;var a="#058ce4";e.taskPriority.some((function(e){if(e.priority===t.p_level)return a=e.color,!0}));var s={start:o,end:i},l=$A.cloneJSON(s),u=e.editData.find((function(e){return e.id==t.id}));u&&(s=$A.cloneJSON(u.newTime)),e.lists.push({id:t.id,label:t.name,complete:t.complete_at,overdue:t.overdue,time:s,notime:n,baktime:l,style:{background:a}})}))},onChange:function(t){var e=t.time,n=t.baktime;if(Math.abs(n.end-e.end)>1e3||Math.abs(n.start-e.start)>1e3){var r=this.editData.find((function(e){return e.id==t.id}));r?r.newTime=e:this.editData.push({id:t.id,label:t.label,notime:t.notime,baktime:t.baktime,newTime:e})}},onClick:function(t){this.$store.dispatch("openTask",t)},editSubmit:function(t){var e=this;this.editData&&this.editData.forEach((function(n){var r=e.lists.find((function(t){return t.id==n.id}));if(t){e.editLoad++;var o=$A.formatDate("Y-m-d H:i",Math.round(n.newTime.start/1e3)),i=$A.formatDate("Y-m-d H:i",Math.round(n.newTime.end/1e3)),a={task_id:n.id,times:[o,i]};e.$store.dispatch("taskUpdate",a).then((function(t){var n=t.msg;e.editLoad--,0===e.editLoad&&$A.messageSuccess(n),r&&e.$set(r,"baktime",$A.cloneJSON(r.time))})).catch((function(t){var n=t.msg;e.editLoad--,0===e.editLoad&&$A.modalError(n),r&&e.$set(r,"time",$A.cloneJSON(r.baktime))}))}else r&&e.$set(r,"time",$A.cloneJSON(r.baktime))})),this.editData=[]},getRawTime:function(t){var e=this.lists.find((function(e){return e.id==t}));return e?this.getTimeObj(e):null},getTimeObj:function(t){var e=$A.Time(t.start_at)||$A.Time(t.created_at),n=$A.Time(t.end_at)||$A.Time(t.created_at)+86400;return n==e&&(n=Math.round(new Date($A.formatDate("Y-m-d 23:59:59",n)).getTime()/1e3)),n=Math.max(n,e+60),{start:e*=1e3,end:n*=1e3}},onSwitchColumn:function(t){this.filtrProjectId=$A.runNum(t),this.initData()}}};const F=(0,p.Z)(q,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"project-gstc-gantt"},[n("GanttView",{attrs:{lists:t.lists,menuWidth:t.menuWidth,itemWidth:80},on:{"on-change":t.onChange,"on-click":t.onClick}}),t._v(" "),n("Dropdown",{staticClass:"project-gstc-dropdown-filtr",style:t.dropStyle,attrs:{trigger:"click"},on:{"on-click":t.onSwitchColumn}},[n("Icon",{staticClass:"project-gstc-dropdown-icon",class:{filtr:t.filtrProjectId>0},attrs:{type:"md-funnel"}}),t._v(" "),n("DropdownMenu",{attrs:{slot:"list"},slot:"list"},[n("DropdownItem",{class:{"dropdown-active":0==t.filtrProjectId},attrs:{name:0}},[t._v(t._s(t.$L("全部")))]),t._v(" "),t._l(t.projectColumn,(function(e,r){return n("DropdownItem",{key:r,class:{"dropdown-active":t.filtrProjectId==e.id},attrs:{name:e.id}},[t._v("\n "+t._s(e.name)+"\n "),e.tasks?n("span",[t._v("("+t._s(t.filtrLength(e.tasks))+")")]):t._e()])}))],2)],1),t._v(" "),n("div",{staticClass:"project-gstc-edit",class:{info:t.editShowInfo,visible:t.editData&&t.editData.length>0}},[n("div",{staticClass:"project-gstc-edit-info"},[n("Table",{attrs:{size:"small","max-height":"600",columns:t.editColumns,data:t.editData}}),t._v(" "),n("div",{staticClass:"project-gstc-edit-btns"},[n("Button",{attrs:{loading:t.editLoad>0,size:"small",type:"text"},on:{click:function(e){return t.editSubmit(!1)}}},[t._v(t._s(t.$L("取消")))]),t._v(" "),n("Button",{attrs:{loading:t.editLoad>0,size:"small",type:"primary"},on:{click:function(e){return t.editSubmit(!0)}}},[t._v(t._s(t.$L("保存")))]),t._v(" "),n("Icon",{staticClass:"zoom",attrs:{type:"md-arrow-dropright"},on:{click:function(e){t.editShowInfo=!1}}})],1)],1),t._v(" "),n("div",{staticClass:"project-gstc-edit-small"},[n("div",{staticClass:"project-gstc-edit-text",on:{click:function(e){t.editShowInfo=!0}}},[t._v(t._s(t.$L("未保存计划时间"))+": "),t.editData?n("span",[t._v(t._s(t.editData.length))]):t._e()]),t._v(" "),n("Button",{attrs:{loading:t.editLoad>0,size:"small",type:"text"},on:{click:function(e){return t.editSubmit(!1)}}},[t._v(t._s(t.$L("取消")))]),t._v(" "),n("Button",{attrs:{loading:t.editLoad>0,size:"small",type:"primary"},on:{click:function(e){return t.editSubmit(!0)}}},[t._v(t._s(t.$L("保存")))])],1)])],1)}),[],!1,null,null,null).exports;function z(t){return function(t){if(Array.isArray(t))return U(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return U(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U(t,e)}(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 n=0,r=new Array(e);n0&&(n=n.filter((function(t){return t.flow_item_id===e.value}))),t&&(n=n.filter((function(e){var n=e.name,r=e.desc;return $A.strExists("".concat(n,"||").concat(r),t)}))),n}},projectUser:function(){var t=this.projectData,e=this.windowWidth;if(!t.project_user)return[];var n=e>1200?8:3,r=t.project_user.filter((function(e){return e.userid!=t.owner_userid}));if(r.length<=n)return r;var o=r.slice(0,n-1);return o.push({userid:-1}),o.push(r[r.length-1]),o},allTask:function(){var t=this.cacheTasks,e=this.projectId;return t.filter((function(t){return!t.archived_at&&t.project_id==e}))},columnList:function(){var t=this,e=this.projectId,n=this.cacheColumns,r=this.allTask,o=n.filter((function(t){return t.project_id==e})).sort((function(t,e){return t.sort!=e.sort?t.sort-e.sort:t.id-e.id}));return o.forEach((function(e){e.tasks=t.transforTasks(r.filter((function(t){return t.column_id==e.id}))).sort((function(t,e){return t.complete_at||e.complete_at?$A.Date(t.complete_at)-$A.Date(e.complete_at):t.sort!=e.sort?t.sort-e.sort:t.id-e.id}))})),o},myList:function(){var t=this,e=this.allTask,n=this.taskCompleteTemps,r=this.sortField,o=this.sortType,i=e.filter((function(e){return t.myFilter(e)}));if(n.length>0){var a,s=e.filter((function(e){return n.includes(e.id)&&t.myFilter(e,!1)}));if(s.length>0)(a=i=$A.cloneJSON(i)).push.apply(a,z(s))}return i.sort((function(t,e){if("asc"==o){var n=[e,t];t=n[0],e=n[1]}return"level"==r?t.p_level-e.p_level:"end_at"==r?t.end_at==e.end_at?t.p_level-e.p_level:$A.Date(t.end_at||"2099-12-31 23:59:59")-$A.Date(e.end_at||"2099-12-31 23:59:59"):void 0}))},helpList:function(){var t=this,e=this.allTask,n=this.taskCompleteTemps,r=this.sortField,o=this.sortType,i=e.filter((function(e){return t.helpFilter(e)}));if(n.length>0){var a,s=e.filter((function(e){return n.includes(e.id)&&t.helpFilter(e,!1)}));if(s.length>0)(a=i=$A.cloneJSON(i)).push.apply(a,z(s))}return i.sort((function(t,e){if("asc"==o){var n=[e,t];t=n[0],e=n[1]}return"level"==r?t.p_level-e.p_level:"end_at"==r?t.end_at==e.end_at?t.p_level-e.p_level:$A.Date(t.end_at||"2099-12-31 23:59:59")-$A.Date(e.end_at||"2099-12-31 23:59:59"):void 0}))},unList:function(){var t=this.allTask,e=this.searchText,n=this.sortField,r=this.sortType,o=this.flowInfo;return t.filter((function(t){return!(t.parent_id>0)&&(!(o.value>0&&t.flow_item_id!==o.value)&&(!(e&&!$A.strExists(t.name,e)&&!$A.strExists(t.desc,e))&&!t.complete_at))})).sort((function(t,e){if("asc"==r){var o=[e,t];t=o[0],e=o[1]}return"level"==n?t.p_level-e.p_level:"end_at"==n?t.end_at==e.end_at?t.p_level-e.p_level:$A.Date(t.end_at||"2099-12-31 23:59:59")-$A.Date(e.end_at||"2099-12-31 23:59:59"):void 0}))},completedList:function(){var t=this.allTask,e=this.searchText,n=this.flowInfo;return t.filter((function(t){return!(t.parent_id>0)&&(!(n.value>0&&t.flow_item_id!==n.value)&&(!(e&&!$A.strExists(t.name,e)&&!$A.strExists(t.desc,e))&&t.complete_at))})).sort((function(t,e){var n=$A.Date(t.complete_at);return $A.Date(e.complete_at)-n}))},completedCount:function(){return this.allTask.filter((function(t){return!(t.parent_id>0)&&t.complete_at})).length},flowTitle:function(){var t=this.flowInfo,e=this.flowData,n=this.allTask;if(t.value){var r=e.find((function(e){return e.value===t.value}));return r?r.label:t.label}return"".concat(this.$L("全部")," (").concat(n.length,")")},flowData:function(){var t=this.flowList,e=this.allTask,n=[{value:0,label:"".concat(this.$L("全部")," (").concat(e.length,")"),children:[]}],r=t.map((function(t){return{value:t.id,label:t.name,status:t.status,children:t.project_flow_item.map((function(t){var n=e.filter((function(e){return e.flow_item_id==t.id})).length;return{value:t.id,label:"".concat(t.name," (").concat(n,")"),status:t.status,class:t.status}}))}}));return 1===r.length?n.push.apply(n,z(r[0].children)):r.length>0&&n.push.apply(n,z(r)),n}}),watch:{projectData:function(){this.sortData=this.getSort()},projectLoad:function(t){var e=this;this._loadTimeout&&clearTimeout(this._loadTimeout),t>0?this._loadTimeout=setTimeout((function(){e.loading=!0}),1e3):this.loading=!1},projectId:{handler:function(t){t>0&&this.getFlowData()},immediate:!0}},methods:{showDesc:function(){this.windowLarge||$A.modalInfo({language:!1,title:this.$L("项目描述"),content:this.projectData.desc})},searchFocus:function(){var t=this;this.$nextTick((function(){t.$refs.searchInput.focus({cursor:"end"})}))},getSort:function(){var t=[];return this.columnList.forEach((function(e){t.push({id:e.id,task:e.tasks.map((function(t){return t.id}))})})),t},sortUpdate:function(t){var e=this,n=this.sortData,r=this.getSort();if(JSON.stringify(n)!==JSON.stringify(r)){this.sortData=r;var o={project_id:this.projectId,sort:this.sortData,only_column:!0===t?1:0};this.sortDisabled=!0,this.$store.dispatch("call",{url:"project/sort",data:o}).then((function(t){var n=t.msg;$A.messageSuccess(n),e.sortDisabled=!1;var r,i=[];o.only_column?(r=-1,o.sort.forEach((function(t){r++,i.push({id:t.id,sort:r})})),e.$store.dispatch("saveColumn",i)):(o.sort.forEach((function(t){r=-1,i.push.apply(i,z(t.task.map((function(n){return r++,i.push.apply(i,z(e.allTask.filter((function(t){return t.parent_id==n})).map((function(e){return{id:e.id,sort:r,column_id:t.id}})))),{id:n,sort:r,column_id:t.id}}))))})),e.$store.dispatch("saveTask",i))})).catch((function(t){var n=t.msg;$A.modalError(n),e.sortDisabled=!1,e.$store.dispatch("getTaskForProject",e.projectId).catch((function(){}))}))}},addTopShow:function(t,e){this.$set(this.columnTopShow,t,e),e&&(this.$refs["column_"+t][0].scrollTop=0)},addTaskOpen:function(t){l.Store.set("addTask",t)},addColumnOpen:function(){var t=this;this.addColumnShow=!0,this.$nextTick((function(){t.$refs.addColumnName.focus()}))},addColumnBlur:function(){""===this.addColumnName&&(this.addColumnShow=!1)},addColumnSubmit:function(){var t=this,e=this.addColumnName.trim();""!==e&&this.$store.dispatch("call",{url:"project/column/add",data:{project_id:this.projectId,name:e}}).then((function(e){var n=e.data,r=e.msg;$A.messageSuccess(r),t.addColumnName="",t.$store.dispatch("saveColumn",n)})).catch((function(t){var e=t.msg;$A.modalError(e)}))},dropColumn:function(t,e){"title"===e?this.titleColumn(t):"remove"===e?this.removeColumn(t):e.name&&this.updateColumn(t,{color:e.color}).catch($A.modalError)},titleColumn:function(t){var e=this;$A.modalInput({value:t.name,title:"修改列表",placeholder:"输入列表名称",onOk:function(n){return n?e.updateColumn(t,{name:n}):"列表名称不能为空"}})},updateColumn:function(t,e){var n=this;return new Promise((function(r,o){!0!==n.columnLoad[t.id]?(n.$set(n.columnLoad,t.id,!0),Object.keys(e).forEach((function(r){return n.$set(t,r,e[r])})),n.$store.dispatch("call",{url:"project/column/update",data:Object.assign(e,{column_id:t.id})}).then((function(e){var o=e.data;n.$set(n.columnLoad,t.id,!1),n.$store.dispatch("saveColumn",o),r()})).catch((function(e){var r=e.msg;n.$set(n.columnLoad,t.id,!1),n.$store.dispatch("getColumns",n.projectId).catch((function(){})),o(r)}))):r()}))},removeColumn:function(t){var e=this;$A.modalConfirm({title:"删除列表",content:"你确定要删除列表【"+t.name+"】及列表内的任务吗?",loading:!0,onOk:function(){if(!0!==e.columnLoad[t.id])return e.$set(e.columnLoad,t.id,!0),new Promise((function(n,r){e.$store.dispatch("removeColumn",t.id).then((function(t){var e=t.msg;n(e)})).catch((function(t){var e=t.msg;r(e)})).finally((function(n){e.$set(e.columnLoad,t.id,!1)}))}))}})},onSort:function(t){this.sortField=t,this.sortType="desc"==this.sortType?"asc":"desc"},onSetting:function(){var t=this;this.settingLoad++,this.$store.dispatch("call",{url:"project/update",data:Object.assign(this.settingData,{project_id:this.projectId})}).then((function(e){var n=e.data,r=e.msg;$A.messageSuccess(r),t.settingShow=!1,t.$store.dispatch("saveProject",n)})).catch((function(t){var e=t.msg;$A.modalError(e)})).finally((function(e){t.settingLoad--}))},onUser:function(){var t=this;this.userLoad++,this.$store.dispatch("call",{url:"project/user",data:{project_id:this.projectId,userid:this.userData.userids}}).then((function(e){var n=e.msg;$A.messageSuccess(n),t.userShow=!1,t.$store.dispatch("getProjectOne",t.projectId).catch((function(){})),t.$store.dispatch("getTaskForProject",t.projectId).catch((function(){}))})).catch((function(t){var e=t.msg;$A.modalError(e)})).finally((function(e){t.userLoad--}))},onTransfer:function(){var t=this;this.transferLoad++,this.$store.dispatch("call",{url:"project/transfer",data:{project_id:this.projectId,owner_userid:this.transferData.owner_userid[0]}}).then((function(e){var n=e.msg;$A.messageSuccess(n),t.transferShow=!1,t.$store.dispatch("getProjectOne",t.projectId).catch((function(){})),t.$store.dispatch("getTaskForProject",t.projectId).catch((function(){}))})).catch((function(t){var e=t.msg;$A.modalError(e)})).finally((function(e){t.transferLoad--}))},onArchived:function(){var t=this;$A.modalConfirm({title:"归档项目",content:"你确定要归档项目【"+this.projectData.name+"】吗?",loading:!0,onOk:function(){return new Promise((function(e,n){t.$store.dispatch("archivedProject",t.projectId).then((function(t){var n=t.msg;e(n)})).catch((function(t){var e=t.msg;n(e)}))}))}})},onDelete:function(){var t=this;$A.modalConfirm({title:"删除项目",content:"你确定要删除项目【"+this.projectData.name+"】吗?",loading:!0,onOk:function(){return new Promise((function(e,n){t.$store.dispatch("removeProject",t.projectId).then((function(t){var n=t.msg;e(n)})).catch((function(t){var e=t.msg;n(e)}))}))}})},onExit:function(){var t=this;$A.modalConfirm({title:"退出项目",content:"你确定要退出项目【"+this.projectData.name+"】吗?",loading:!0,onOk:function(){return new Promise((function(e,n){t.$store.dispatch("exitProject",t.projectId).then((function(t){var n=t.msg;e(n)})).catch((function(t){var e=t.msg;n(e)}))}))}})},projectDropdown:function(t){var e=this;switch(t){case"setting":this.$set(this.settingData,"name",this.projectData.name),this.$set(this.settingData,"desc",this.projectData.desc),this.settingShow=!0,this.$nextTick((function(){e.$refs.projectName.focus(),setTimeout(e.$refs.projectDesc.resizeTextarea,0)}));break;case"user":if(this.projectData.owner_userid!==this.userId)return;var n=this.projectData.project_user.map((function(t){return t.userid}));this.$set(this.userData,"userids",n),this.$set(this.userData,"useridbak",n),this.$set(this.userData,"uncancelable",[this.projectData.owner_userid]),this.userShow=!0;break;case"invite":this.inviteData={},this.inviteShow=!0,this.inviteGet();break;case"workflow":this.workflowShow=!0;break;case"log":this.logShow=!0;break;case"archived_task":this.archivedTaskShow=!0;break;case"deleted_task":this.deletedTaskShow=!0;break;case"transfer":this.$set(this.transferData,"owner_userid",[this.projectData.owner_userid]),this.transferShow=!0;break;case"archived":this.onArchived();break;case"delete":this.onDelete();break;case"exit":this.onExit()}},openTask:function(t,e){this.$store.dispatch("openTask",t),!0===e&&setTimeout((function(){l.Store.set("receiveTask",!0)}),300)},openMenu:function(t,e){var n=this.$refs["taskMenu_".concat(e.id)];n&&n[0].handleClick(t)},taskIsHidden:function(t){var e=t.name,n=t.desc,r=t.complete_at,o=this.searchText,i=this.flowInfo;return!(this.projectData.cacheParameter.completedTask||!r)||(i.value>0&&t.flow_item_id!==i.value||!(!o||$A.strExists("".concat(e,"||").concat(n),o)))},ownerUser:function(t){return t.filter((function(t){return 1==t.owner})).sort((function(t,e){return t.id-e.id}))},inviteGet:function(t){var e=this;this.inviteLoad++,this.$store.dispatch("call",{url:"project/invite",data:{project_id:this.projectId,refresh:!0===t?"yes":"no"}}).then((function(t){var n=t.data;e.inviteData=n,e.inviteCopy()})).catch((function(t){var e=t.msg;$A.modalError(e)})).finally((function(t){e.inviteLoad--}))},getFlowData:function(){var t=this;this.flowInfo={},this.$store.dispatch("call",{url:"project/flow/list",data:{project_id:this.projectId}}).then((function(e){var n,r=e.data;t.flowList=r,null===(n=t.$refs.flow)||void 0===n||n.clearSelect()})).catch((function(){t.flowList=[]}))},flowChange:function(t,e){this.flowInfo=e.pop()||{}},inviteCopy:function(){this.inviteData.url&&this.$copyText(this.inviteData.url).then((function(t){$A.messageSuccess("复制成功")})).catch((function(t){$A.messageError("复制失败")}))},inviteFocus:function(){this.$refs.inviteInput.focus({cursor:"all"})},toggleCompleted:function(){this.toggleParameter("completedTask")},workflowBeforeClose:function(){var t=this;return new Promise((function(e){t.$refs.workflow.existDiff()?$A.modalConfirm({content:"设置尚未保存,是否放弃修改?",cancelText:"取消",okText:"放弃",onOk:function(){e()}}):e()}))},myFilter:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!(!this.projectData.cacheParameter.completedTask&&!0===e&&t.complete_at)&&(!(this.flowInfo.value>0&&t.flow_item_id!==this.flowInfo.value)&&(!(this.searchText&&!$A.strExists(t.name,this.searchText)&&!$A.strExists(t.desc,this.searchText))&&t.owner))},helpFilter:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!(t.parent_id>0)&&(!(!this.projectData.cacheParameter.completedTask&&!0===n&&t.complete_at)&&(!(this.flowInfo.value>0&&t.flow_item_id!==this.flowInfo.value)&&(!(this.searchText&&!$A.strExists(t.name,this.searchText)&&!$A.strExists(t.desc,this.searchText))&&(t.task_user&&t.task_user.find((function(t){var n=t.userid,r=t.owner;return n==e.userId&&0==r}))))))},expiresFormat:function(t){return $A.countDownFormat(t,this.nowTime)},tabTypeChange:function(t){switch(t){case"column":this.toggleParameter({project_id:this.projectId,key:"menuType",value:"column"});break;case"table":this.toggleParameter({project_id:this.projectId,key:"menuType",value:"table"});break;case"gantt":this.toggleParameter({project_id:this.projectId,key:"menuType",value:"gantt"})}},toggleParameter:function(t){if("completedTask"===t)this.$store.dispatch("forgetTaskCompleteTemp",!0);else if("chat"===t&&this.windowSmall)return void this.$store.dispatch("openDialog",this.projectData.dialog_id);this.$store.dispatch("toggleProjectParameter",t)},onBack:function(){var t=this.$store.state.routeHistoryLast,e=t.name,n=t.params;e===this.$route.name&&/\d+/.test(n.projectId)?this.goForward({name:this.$route.name,params:{projectId:"all"}}):this.goBack()}}};const Y=(0,p.Z)(K,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"project-panel",class:[t.tabTypeActive]},[n("PageTitle",{attrs:{title:t.projectData.name}}),t._v(" "),n("div",{staticClass:"project-titbox"},[n("div",{staticClass:"project-title"},[n("div",{staticClass:"project-back",on:{click:t.onBack}},[n("i",{staticClass:"taskfont"},[t._v("")])]),t._v(" "),n("h1",[t._v(t._s(t.projectData.name))]),t._v(" "),t.loading?n("div",{staticClass:"project-load"},[n("Loading")],1):t._e()]),t._v(" "),n("ul",{staticClass:"project-icons"},[n("li",{staticClass:"project-avatar",class:{"cursor-default":t.projectData.owner_userid!==t.userId},on:{click:function(e){return t.projectDropdown("user")}}},[n("ul",[n("li",[n("UserAvatar",{attrs:{userid:t.projectData.owner_userid,size:36,borderWitdh:2,openDelay:0}},[n("p",[t._v(t._s(t.$L("项目负责人")))])]),t._v(" "),(t.windowWidth<=980||t.projectData.cacheParameter.chat)&&t.projectUser.length>0?n("Badge",{attrs:{type:"normal",count:t.projectData.project_user.length}}):t._e()],1),t._v(" "),t._l(t.projectUser,(function(e){return!(t.windowWidth<=980||t.projectData.cacheParameter.chat)&&t.projectUser.length>0?[-1===e.userid?n("li",{staticClass:"more"},[n("ETooltip",{attrs:{disabled:t.windowSmall,content:t.$L("共"+t.projectData.project_user.length+"个成员")}},[n("Icon",{attrs:{type:"ios-more"}})],1)],1):n("li",[n("UserAvatar",{attrs:{userid:e.userid,size:36,borderWitdh:2,openDelay:0}})],1)]:t._e()}))],2)]),t._v(" "),n("li",{staticClass:"project-icon",on:{click:function(e){return t.addTaskOpen(0)}}},[n("ETooltip",{attrs:{disabled:t.windowSmall,content:t.$L("添加任务")}},[n("Icon",{staticClass:"menu-icon",attrs:{type:"md-add"}})],1)],1),t._v(" "),n("li",{class:["project-icon",""!=t.searchText?"active":""]},[n("Tooltip",{attrs:{always:""!=t.searchText,theme:"light",rawIndex:10},on:{"on-popper-show":t.searchFocus}},[n("Icon",{staticClass:"menu-icon",attrs:{type:"ios-search"},on:{click:t.searchFocus}}),t._v(" "),n("div",{attrs:{slot:"content"},slot:"content"},[n("Input",{ref:"searchInput",staticClass:"search-input",attrs:{placeholder:t.$L("名称、描述..."),clearable:""},model:{value:t.searchText,callback:function(e){t.searchText=e},expression:"searchText"}})],1)],1)],1),t._v(" "),n("li",{class:["project-icon",t.windowLarge&&t.projectData.cacheParameter.chat?"active":""],on:{click:function(e){return t.toggleParameter("chat")}}},[n("Icon",{staticClass:"menu-icon",attrs:{type:"ios-chatbubbles"}}),t._v(" "),n("Badge",{staticClass:"menu-badge",attrs:{count:t.msgUnread}})],1),t._v(" "),n("li",{staticClass:"project-icon"},[n("EDropdown",{attrs:{trigger:"click",transfer:""},on:{command:t.projectDropdown}},[n("Icon",{staticClass:"menu-icon",attrs:{type:"ios-more"}}),t._v(" "),t.projectData.owner_userid===t.userId?n("EDropdownMenu",{attrs:{slot:"dropdown"},slot:"dropdown"},[n("EDropdownItem",{attrs:{command:"setting"}},[t._v(t._s(t.$L("项目设置")))]),t._v(" "),n("EDropdownItem",{attrs:{command:"workflow"}},[t._v(t._s(t.$L("工作流设置")))]),t._v(" "),n("EDropdownItem",{attrs:{command:"user",divided:""}},[t._v(t._s(t.$L("成员管理")))]),t._v(" "),n("EDropdownItem",{attrs:{command:"invite"}},[t._v(t._s(t.$L("邀请链接")))]),t._v(" "),n("EDropdownItem",{attrs:{command:"log",divided:""}},[t._v(t._s(t.$L("项目动态")))]),t._v(" "),n("EDropdownItem",{attrs:{command:"archived_task"}},[t._v(t._s(t.$L("已归档任务")))]),t._v(" "),n("EDropdownItem",{attrs:{command:"deleted_task"}},[t._v(t._s(t.$L("已删除任务")))]),t._v(" "),n("EDropdownItem",{attrs:{command:"transfer",divided:""}},[t._v(t._s(t.$L("移交项目")))]),t._v(" "),n("EDropdownItem",{attrs:{command:"archived"}},[t._v(t._s(t.$L("归档项目")))]),t._v(" "),n("EDropdownItem",{staticStyle:{color:"#f40"},attrs:{command:"delete"}},[t._v(t._s(t.$L("删除项目")))])],1):n("EDropdownMenu",{attrs:{slot:"dropdown"},slot:"dropdown"},[n("EDropdownItem",{attrs:{command:"log"}},[t._v(t._s(t.$L("项目动态")))]),t._v(" "),n("EDropdownItem",{attrs:{command:"archived_task"}},[t._v(t._s(t.$L("已归档任务")))]),t._v(" "),n("EDropdownItem",{attrs:{command:"deleted_task"}},[t._v(t._s(t.$L("已删除任务")))]),t._v(" "),n("EDropdownItem",{staticStyle:{color:"#f40"},attrs:{command:"exit",divided:""}},[t._v(t._s(t.$L("退出项目")))])],1)],1)],1)])]),t._v(" "),n("div",{staticClass:"project-subbox"},[n("div",{staticClass:"project-subtitle",on:{click:t.showDesc}},[t._v(t._s(t.projectData.desc))]),t._v(" "),n("div",{staticClass:"project-switch"},[t.completedCount>0?n("div",{staticClass:"project-checkbox"},[n("Checkbox",{attrs:{value:t.projectData.cacheParameter.completedTask},on:{"on-change":t.toggleCompleted}},[t._v(t._s(t.$L("显示已完成")))])],1):t._e(),t._v(" "),t.flowList.length>0?n("div",{staticClass:"project-select"},[n("Cascader",{ref:"flow",attrs:{data:t.flowData,"transfer-class-name":"project-panel-flow-cascader",transfer:""},on:{"on-change":t.flowChange}},[n("span",{class:"project-flow "+(t.flowInfo.status||"")},[t._v(t._s(t.flowTitle))])])],1):t._e(),t._v(" "),n("div",{staticClass:"project-switch-button"},[n("div",{staticClass:"slider",style:t.tabTypeStyle}),t._v(" "),n("div",{class:{active:"column"===t.tabTypeActive},on:{click:function(e){return t.tabTypeChange("column")}}},[n("i",{staticClass:"taskfont"},[t._v("")])]),t._v(" "),n("div",{class:{active:"table"===t.tabTypeActive},on:{click:function(e){return t.tabTypeChange("table")}}},[n("i",{staticClass:"taskfont"},[t._v("")])]),t._v(" "),n("div",{class:{active:"gantt"===t.tabTypeActive},on:{click:function(e){return t.tabTypeChange("gantt")}}},[n("i",{staticClass:"taskfont"},[t._v("")])])])])]),t._v(" "),"column"===t.tabTypeActive?n("div",{staticClass:"project-column"},[n("Draggable",{staticClass:"column-list",attrs:{list:t.columnList,animation:150,disabled:t.sortDisabled||t.windowSmall,tag:"ul",draggable:".column-item"},on:{sort:function(e){return t.sortUpdate(!0)}}},[t._l(t.columnList,(function(e){return n("li",{staticClass:"column-item"},[n("div",{class:["column-head",e.color?"custom-color":""],style:e.color?{backgroundColor:e.color}:{}},[n("div",{staticClass:"column-head-title"},[n("AutoTip",[t._v(t._s(e.name))]),t._v(" "),n("em",[t._v("("+t._s(t.panelTask(e.tasks).length)+")")])],1),t._v(" "),n("div",{staticClass:"column-head-icon"},[!0===t.columnLoad[e.id]?n("div",{staticClass:"loading"},[n("Loading")],1):n("EDropdown",{attrs:{trigger:"click",size:"small"},on:{command:function(n){return t.dropColumn(e,n)}}},[n("Icon",{attrs:{type:"ios-more"}}),t._v(" "),n("EDropdownMenu",{staticClass:"project-panel-more-dropdown-menu",attrs:{slot:"dropdown"},slot:"dropdown"},[n("EDropdownItem",{attrs:{command:"title"}},[n("div",{staticClass:"item"},[n("Icon",{attrs:{type:"md-create"}}),t._v(t._s(t.$L("修改"))+"\n ")],1)]),t._v(" "),n("EDropdownItem",{attrs:{command:"remove"}},[n("div",{staticClass:"item"},[n("Icon",{attrs:{type:"md-trash"}}),t._v(t._s(t.$L("删除"))+"\n ")],1)]),t._v(" "),t._l(t.$store.state.columnColorList,(function(r,o){return n("EDropdownItem",{key:o,attrs:{divided:0==o,command:r}},[n("div",{staticClass:"item"},[n("i",{staticClass:"taskfont",style:{color:r.color},domProps:{innerHTML:t._s(r.color==e.color?"":"")}}),t._v(t._s(t.$L(r.name))+"\n ")])])}))],2)],1),t._v(" "),n("Icon",{staticClass:"last",attrs:{type:"md-add"},on:{click:function(n){return t.addTopShow(e.id,!0)}}})],1)]),t._v(" "),n("div",{ref:"column_"+e.id,refInFor:!0,staticClass:"column-task scrollbar-overlay"},[t.columnTopShow[e.id]?n("div",{staticClass:"task-item additem"},[n("TaskAddSimple",{attrs:{"column-id":e.id,"project-id":t.projectId,"add-top":!0,"auto-active":""},on:{"on-close":function(n){return t.addTopShow(e.id,!1)},"on-priority":t.addTaskOpen}})],1):t._e(),t._v(" "),n("Draggable",{staticClass:"task-list",attrs:{list:e.tasks,animation:150,disabled:t.sortDisabled||t.windowSmall,draggable:".task-draggable",filter:".complete",group:"task"},on:{sort:t.sortUpdate,remove:t.sortUpdate}},[t._l(e.tasks,(function(e){return n("div",{class:["task-item task-draggable",e.complete_at?"complete":"",t.taskIsHidden(e)?"hidden":""],style:e.color?{backgroundColor:e.color}:{},on:{click:function(n){return t.openTask(e)}}},[n("div",{class:["task-head",e.desc?"has-desc":""]},[n("div",{staticClass:"task-title"},[e.flow_item_name?n("span",{class:e.flow_item_status,on:{click:function(n){return n.stopPropagation(),t.openMenu(n,e)}}},[t._v(t._s(e.flow_item_name))]):t._e(),t._v(" "),n("pre",[t._v(t._s(e.name))])]),t._v(" "),n("div",{staticClass:"task-menu",on:{click:function(t){t.stopPropagation()}}},[n("TaskMenu",{ref:"taskMenu_"+e.id,refInFor:!0,attrs:{task:e,icon:"ios-more"}})],1)]),t._v(" "),e.desc?n("div",{staticClass:"task-desc"},[n("pre",{domProps:{innerHTML:t._s(e.desc)}})]):t._e(),t._v(" "),e.task_tag.length>0?n("div",{staticClass:"task-tags"},t._l(e.task_tag,(function(e,r){return n("Tag",{key:r,attrs:{color:e.color}},[t._v(t._s(e.name))])})),1):t._e(),t._v(" "),n("div",{staticClass:"task-users"},[n("ul",[t._l(t.ownerUser(e.task_user),(function(t,r){return n("li",{key:r},[n("UserAvatar",{attrs:{userid:t.userid,size:"32",borderWitdh:2,borderColor:e.color}})],1)})),t._v(" "),0===t.ownerUser(e.task_user).length?n("li",{staticClass:"no-owner"},[n("Button",{attrs:{type:"primary",size:"small",ghost:""},on:{click:function(n){return n.stopPropagation(),t.openTask(e,!0)}}},[t._v(t._s(t.$L("领取任务")))])],1):t._e()],2),t._v(" "),e.file_num>0?n("div",{staticClass:"task-icon"},[t._v(t._s(e.file_num)),n("Icon",{attrs:{type:"ios-link-outline"}})],1):t._e(),t._v(" "),e.msg_num>0?n("div",{staticClass:"task-icon"},[t._v(t._s(e.msg_num)),n("Icon",{attrs:{type:"ios-chatbubbles-outline"}})],1):t._e()]),t._v(" "),n("div",{staticClass:"task-progress"},[e.sub_num>0?n("div",{staticClass:"task-sub-num"},[t._v(t._s(e.sub_complete)+"/"+t._s(e.sub_num))]):t._e(),t._v(" "),n("Progress",{attrs:{percent:e.percent,"stroke-width":6}}),t._v(" "),e.end_at?n("ETooltip",{class:["task-time",e.today?"today":"",e.overdue?"overdue":""],attrs:{disabled:t.windowSmall,"open-delay":600,content:e.end_at}},[e.complete_at?t._e():n("div",[n("i",{staticClass:"taskfont"},[t._v("")]),t._v(t._s(t.expiresFormat(e.end_at)))])]):t._e()],1),t._v(" "),e.p_name?n("em",{staticClass:"priority-color",style:{backgroundColor:e.p_color}}):t._e()])})),t._v(" "),n("div",{staticClass:"task-item additem"},[n("TaskAddSimple",{attrs:{"column-id":e.id,"project-id":t.projectId},on:{"on-priority":t.addTaskOpen}})],1)],2)],1)])})),t._v(" "),n("li",{class:["add-column",t.addColumnShow?"show-input":""]},[n("div",{staticClass:"add-column-text",on:{click:t.addColumnOpen}},[n("Icon",{attrs:{type:"md-add"}}),t._v(t._s(t.$L("添加列表"))+"\n ")],1),t._v(" "),n("div",{staticClass:"add-column-input"},[n("Input",{ref:"addColumnName",attrs:{placeholder:t.$L("列表名称,回车创建"),clearable:""},on:{"on-blur":t.addColumnBlur,"on-enter":t.addColumnSubmit,"on-clear":function(e){t.addColumnShow=!1}},model:{value:t.addColumnName,callback:function(e){t.addColumnName=e},expression:"addColumnName"}})],1)])],2)],1):"table"===t.tabTypeActive?n("div",{staticClass:"project-table scrollbar-overlay"},[n("div",{staticClass:"project-table-head"},[n("Row",{staticClass:"task-row"},[n("Col",{attrs:{span:"12"}},[t._v("# "+t._s(t.$L("任务名称")))]),t._v(" "),n("Col",{attrs:{span:"3"}},[t._v(t._s(t.$L("列表")))]),t._v(" "),n("Col",{attrs:{span:"3"}},[n("div",{staticClass:"sort",on:{click:function(e){return t.onSort("level")}}},[t._v("\n "+t._s(t.$L("优先级"))+"\n "),n("div",{staticClass:"task-sort"},[n("Icon",{class:{on:"level"==t.sortField&&"asc"==t.sortType},attrs:{type:"md-arrow-dropup"}}),t._v(" "),n("Icon",{class:{on:"level"==t.sortField&&"desc"==t.sortType},attrs:{type:"md-arrow-dropdown"}})],1)])]),t._v(" "),n("Col",{attrs:{span:"3"}},[t._v(t._s(t.$L("负责人")))]),t._v(" "),n("Col",{attrs:{span:"3"}},[n("div",{staticClass:"sort",on:{click:function(e){return t.onSort("end_at")}}},[t._v("\n "+t._s(t.$L("到期时间"))+"\n "),n("div",{staticClass:"task-sort"},[n("Icon",{class:{on:"end_at"==t.sortField&&"asc"==t.sortType},attrs:{type:"md-arrow-dropup"}}),t._v(" "),n("Icon",{class:{on:"end_at"==t.sortField&&"desc"==t.sortType},attrs:{type:"md-arrow-dropdown"}})],1)])])],1)],1),t._v(" "),n("div",{class:["project-table-body",t.projectData.cacheParameter.showMy?"":"project-table-hide"]},[n("Row",{staticClass:"task-row"},[n("Col",{staticClass:"row-title",attrs:{span:"12"}},[n("i",{staticClass:"taskfont",on:{click:function(e){return t.toggleParameter("showMy")}}},[t._v("")]),t._v(" "),n("div",{staticClass:"row-h1"},[t._v(t._s(t.$L("我的任务")))]),t._v(" "),n("div",{staticClass:"row-num"},[t._v("("+t._s(t.myList.length)+")")])]),t._v(" "),n("Col",{attrs:{span:"3"}}),t._v(" "),n("Col",{attrs:{span:"3"}}),t._v(" "),n("Col",{attrs:{span:"3"}}),t._v(" "),n("Col",{attrs:{span:"3"}})],1),t._v(" "),t.projectData.cacheParameter.showMy?n("TaskRow",{attrs:{list:t.transforTasks(t.myList),"open-key":"my","fast-add-task":""},on:{"on-priority":t.addTaskOpen}}):t._e()],1),t._v(" "),t.helpList.length?n("div",{class:["project-table-body",t.projectData.cacheParameter.showHelp?"":"project-table-hide"]},[n("Row",{staticClass:"task-row"},[n("Col",{staticClass:"row-title",attrs:{span:"12"}},[n("i",{staticClass:"taskfont",on:{click:function(e){return t.toggleParameter("showHelp")}}},[t._v("")]),t._v(" "),n("div",{staticClass:"row-h1"},[t._v(t._s(t.$L("协助的任务")))]),t._v(" "),n("div",{staticClass:"row-num"},[t._v("("+t._s(t.helpList.length)+")")])]),t._v(" "),n("Col",{attrs:{span:"3"}}),t._v(" "),n("Col",{attrs:{span:"3"}}),t._v(" "),n("Col",{attrs:{span:"3"}}),t._v(" "),n("Col",{attrs:{span:"3"}})],1),t._v(" "),t.projectData.cacheParameter.showHelp?n("TaskRow",{attrs:{list:t.helpList,"open-key":"help"},on:{"on-priority":t.addTaskOpen}}):t._e()],1):t._e(),t._v(" "),t.projectData.task_num>0?n("div",{class:["project-table-body",t.projectData.cacheParameter.showUndone?"":"project-table-hide"]},[n("Row",{staticClass:"task-row"},[n("Col",{staticClass:"row-title",attrs:{span:"12"}},[n("i",{staticClass:"taskfont",on:{click:function(e){return t.toggleParameter("showUndone")}}},[t._v("")]),t._v(" "),n("div",{staticClass:"row-h1"},[t._v(t._s(t.$L("未完成任务")))]),t._v(" "),n("div",{staticClass:"row-num"},[t._v("("+t._s(t.unList.length)+")")])]),t._v(" "),n("Col",{attrs:{span:"3"}}),t._v(" "),n("Col",{attrs:{span:"3"}}),t._v(" "),n("Col",{attrs:{span:"3"}}),t._v(" "),n("Col",{attrs:{span:"3"}})],1),t._v(" "),t.projectData.cacheParameter.showUndone?n("TaskRow",{attrs:{list:t.unList,"open-key":"undone"},on:{"on-priority":t.addTaskOpen}}):t._e()],1):t._e(),t._v(" "),t.projectData.task_num>0?n("div",{class:["project-table-body",t.projectData.cacheParameter.showCompleted?"":"project-table-hide"]},[n("Row",{staticClass:"task-row"},[n("Col",{staticClass:"row-title",attrs:{span:"12"}},[n("i",{staticClass:"taskfont",on:{click:function(e){return t.toggleParameter("showCompleted")}}},[t._v("")]),t._v(" "),n("div",{staticClass:"row-h1"},[t._v(t._s(t.$L("已完成任务")))]),t._v(" "),n("div",{staticClass:"row-num"},[t._v("("+t._s(t.completedList.length)+")")])]),t._v(" "),n("Col",{attrs:{span:"3"}}),t._v(" "),n("Col",{attrs:{span:"3"}}),t._v(" "),n("Col",{attrs:{span:"3"}}),t._v(" "),n("Col",{attrs:{span:"3"}},[t._v(t._s(t.projectData.task_num>0&&t.projectData.cacheParameter.showCompleted?t.$L("完成时间"):""))])],1),t._v(" "),t.projectData.cacheParameter.showCompleted?n("TaskRow",{attrs:{list:t.completedList,"open-key":"completed",showCompleteAt:""},on:{"on-priority":t.addTaskOpen}}):t._e()],1):t._e()]):"gantt"===t.tabTypeActive?n("div",{staticClass:"project-gantt"},[n("ProjectGantt",{attrs:{projectColumn:t.columnList,flowInfo:t.flowInfo}})],1):t._e(),t._v(" "),n("Modal",{attrs:{title:t.$L("项目设置"),"mask-closable":!1},model:{value:t.settingShow,callback:function(e){t.settingShow=e},expression:"settingShow"}},[n("Form",{attrs:{model:t.settingData,"label-width":"auto"},nativeOn:{submit:function(t){t.preventDefault()}}},[n("FormItem",{attrs:{prop:"name",label:t.$L("项目名称")}},[n("Input",{ref:"projectName",attrs:{type:"text",maxlength:32,placeholder:t.$L("必填")},model:{value:t.settingData.name,callback:function(e){t.$set(t.settingData,"name",e)},expression:"settingData.name"}})],1),t._v(" "),n("FormItem",{attrs:{prop:"desc",label:t.$L("项目介绍")}},[n("Input",{ref:"projectDesc",attrs:{type:"textarea",autosize:{minRows:3,maxRows:5},maxlength:255,placeholder:t.$L("选填")},model:{value:t.settingData.desc,callback:function(e){t.$set(t.settingData,"desc",e)},expression:"settingData.desc"}})],1)],1),t._v(" "),n("div",{staticClass:"adaption",attrs:{slot:"footer"},slot:"footer"},[n("Button",{attrs:{type:"default"},on:{click:function(e){t.settingShow=!1}}},[t._v(t._s(t.$L("取消")))]),t._v(" "),n("Button",{attrs:{type:"primary",loading:t.settingLoad>0},on:{click:t.onSetting}},[t._v(t._s(t.$L("修改")))])],1)],1),t._v(" "),n("Modal",{attrs:{title:t.$L("成员管理"),"mask-closable":!1},model:{value:t.userShow,callback:function(e){t.userShow=e},expression:"userShow"}},[n("Form",{attrs:{model:t.userData,"label-width":"auto"},nativeOn:{submit:function(t){t.preventDefault()}}},[n("FormItem",{attrs:{prop:"userids",label:t.$L("项目成员")}},[n("UserInput",{attrs:{uncancelable:t.userData.uncancelable,"multiple-max":100,placeholder:t.$L("选择项目成员")},model:{value:t.userData.userids,callback:function(e){t.$set(t.userData,"userids",e)},expression:"userData.userids"}})],1)],1),t._v(" "),n("div",{staticClass:"adaption",attrs:{slot:"footer"},slot:"footer"},[n("Button",{attrs:{type:"default"},on:{click:function(e){t.userShow=!1}}},[t._v(t._s(t.$L("取消")))]),t._v(" "),t.userWaitRemove.length>0?n("Poptip",{staticStyle:{"margin-left":"8px"},attrs:{confirm:"",placement:"bottom",transfer:""},on:{"on-ok":t.onUser}},[n("div",{attrs:{slot:"title"},slot:"title"},[n("p",[n("strong",[t._v(t._s(t.$L("移除成员负责的任务将变成无负责人,")))])]),t._v(" "),n("p",[t._v(t._s(t.$L("注意此操作不可逆!")))]),t._v(" "),n("ul",{staticClass:"project-panel-wait-remove"},[n("li",[t._v(t._s(t.$L("即将移除"))+":")]),t._v(" "),t._l(t.userWaitRemove,(function(t){return n("li",{key:t},[n("UserAvatar",{attrs:{userid:t,size:20,showName:"",tooltipDisabled:""}})],1)}))],2)]),t._v(" "),n("Button",{attrs:{type:"primary",loading:t.userLoad>0}},[t._v(t._s(t.$L("保存")))])],1):n("Button",{attrs:{type:"primary",loading:t.userLoad>0},on:{click:t.onUser}},[t._v(t._s(t.$L("保存")))])],1)],1),t._v(" "),n("Modal",{attrs:{title:t.$L("邀请链接"),"mask-closable":!1},model:{value:t.inviteShow,callback:function(e){t.inviteShow=e},expression:"inviteShow"}},[n("Form",{attrs:{model:t.inviteData,"label-width":"auto"},nativeOn:{submit:function(t){t.preventDefault()}}},[n("FormItem",{attrs:{label:t.$L("链接地址")}},[n("Input",{ref:"inviteInput",attrs:{type:"textarea",rows:3,readonly:""},on:{"on-focus":t.inviteFocus},model:{value:t.inviteData.url,callback:function(e){t.$set(t.inviteData,"url",e)},expression:"inviteData.url"}}),t._v(" "),n("div",{staticClass:"form-tip"},[t._v(t._s(t.$L("可通过此链接直接加入项目。")))])],1)],1),t._v(" "),n("div",{staticClass:"adaption",attrs:{slot:"footer"},slot:"footer"},[n("Button",{attrs:{type:"default"},on:{click:function(e){t.inviteShow=!1}}},[t._v(t._s(t.$L("取消")))]),t._v(" "),n("Poptip",{staticStyle:{"margin-left":"8px"},attrs:{confirm:"",placement:"bottom",transfer:""},on:{"on-ok":function(e){return t.inviteGet(!0)}}},[n("div",{attrs:{slot:"title"},slot:"title"},[n("p",[n("strong",[t._v(t._s(t.$L("注意:刷新将导致原来的邀请链接失效!")))])])]),t._v(" "),n("Button",{attrs:{type:"primary",loading:t.inviteLoad>0}},[t._v(t._s(t.$L("刷新")))])],1)],1)],1),t._v(" "),n("Modal",{attrs:{title:t.$L("移交项目"),"mask-closable":!1},model:{value:t.transferShow,callback:function(e){t.transferShow=e},expression:"transferShow"}},[n("Form",{attrs:{model:t.transferData,"label-width":"auto"},nativeOn:{submit:function(t){t.preventDefault()}}},[n("FormItem",{attrs:{prop:"owner_userid",label:t.$L("项目负责人")}},[n("UserInput",{attrs:{"multiple-max":1,placeholder:t.$L("选择项目负责人")},model:{value:t.transferData.owner_userid,callback:function(e){t.$set(t.transferData,"owner_userid",e)},expression:"transferData.owner_userid"}})],1)],1),t._v(" "),n("div",{staticClass:"adaption",attrs:{slot:"footer"},slot:"footer"},[n("Button",{attrs:{type:"default"},on:{click:function(e){t.transferShow=!1}}},[t._v(t._s(t.$L("取消")))]),t._v(" "),n("Button",{attrs:{type:"primary",loading:t.transferLoad>0},on:{click:t.onTransfer}},[t._v(t._s(t.$L("移交")))])],1)],1),t._v(" "),n("DrawerOverlay",{attrs:{placement:"right",beforeClose:t.workflowBeforeClose,size:1280},model:{value:t.workflowShow,callback:function(e){t.workflowShow=e},expression:"workflowShow"}},[t.workflowShow?n("ProjectWorkflow",{ref:"workflow",attrs:{"project-id":t.projectId}}):t._e()],1),t._v(" "),n("DrawerOverlay",{attrs:{placement:"right",size:768},model:{value:t.logShow,callback:function(e){t.logShow=e},expression:"logShow"}},[t.logShow?n("ProjectLog",{attrs:{"project-id":t.projectId}}):t._e()],1),t._v(" "),n("DrawerOverlay",{attrs:{placement:"right",size:900},model:{value:t.archivedTaskShow,callback:function(e){t.archivedTaskShow=e},expression:"archivedTaskShow"}},[t.archivedTaskShow?n("TaskArchived",{attrs:{"project-id":t.projectId}}):t._e()],1),t._v(" "),n("DrawerOverlay",{attrs:{placement:"right",size:900},model:{value:t.deletedTaskShow,callback:function(e){t.deletedTaskShow=e},expression:"deletedTaskShow"}},[t.deletedTaskShow?n("TaskDeleted",{attrs:{"project-id":t.projectId}}):t._e()],1)],1)}),[],!1,null,null,null).exports;function X(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function G(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Z={name:"ProjectDialog",components:{DialogWrapper:n(25895).Z},data:function(){return{memberShowAll:!1}},computed:function(t){for(var e=1;e
");e+="".concat(this.$L("总数量"),": ").concat(t.task_num,"
"),e+="".concat(this.$L("已完成"),": ").concat(t.task_complete,"
"),e+=''.concat(this.$L("我的任务"),"
"),e+="".concat(this.$L("总数量"),": ").concat(t.task_my_num,"
"),e+="".concat(this.$L("已完成"),": ").concat(t.task_my_complete,"
"),$A.modalInfo({language:!1,title:this.$L("".concat(t.name," 项目进度")),content:e})}},handleLongpress:function(t,e){var n=this,r=$A.getAttr(e,"data-id"),o=this.projectLists.find((function(t){return t.id==r}));o&&(this.operateVisible=!1,this.operateItem=$A.isJson(o)?o:{},this.$nextTick((function(){var r=e.getBoundingClientRect(),o=n.$el.getBoundingClientRect();n.operateStyles={left:"".concat(t.clientX-o.left,"px"),top:"".concat(r.top+n.windowScrollY,"px"),height:r.height+"px"},n.operateVisible=!0})))},handleTopClick:function(){var t=this;this.$store.dispatch("call",{url:"project/top",data:{project_id:this.operateItem.id}}).then((function(e){var n=e.data;t.$store.dispatch("saveProject",n)})).catch((function(t){var e=t.msg;$A.modalError(e)}))}}};function rt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ot(t){for(var e=1;e0?n("li",{staticClass:"loading"},[n("Loading")],1):n("li",{staticClass:"nothing"},[t._v("\n "+t._s(t.$L(t.projectKeyValue?'没有任何与"'+t.projectKeyValue+'"相关的项目':"没有任何项目"))+"\n ")])]:t._e(),t._v(" "),t._l(t.projectLists,(function(e,r){return n("li",{directives:[{name:"longpress",rawName:"v-longpress",value:t.handleLongpress,expression:"handleLongpress"}],key:r,class:{operate:e.id==t.operateItem.id&&t.operateVisible},attrs:{"data-id":e.id},on:{click:function(n){return t.toggleRoute("project",{projectId:e.id})}}},[n("div",{staticClass:"project-item"},[n("div",{staticClass:"item-left"},[n("div",{staticClass:"project-h1"},[n("div",{staticClass:"project-name"},[t._v(t._s(e.name))]),t._v(" "),e.top_at?n("div",{staticClass:"icon-top"}):t._e(),t._v(" "),e.task_my_num-e.task_my_complete>0?n("div",{staticClass:"num"},[t._v(t._s(e.task_my_num-e.task_my_complete))]):t._e()]),t._v(" "),n("div",{staticClass:"project-h2"},[t._v("\n "+t._s(e.desc)+"\n ")])]),t._v(" "),e.task_num>0?n("div",{staticClass:"item-right",on:{click:function(n){return n.stopPropagation(),t.modalPercent(e)}}},[n("iCircle",{attrs:{type:"circle","trail-color":"rgba(132, 197, 106, 0.2)","trail-width":7,"stroke-color":100===e.task_percent?"rgba(132, 197, 106, 0)":"#84C56A","stroke-width":7,percent:e.task_percent,size:44}},[100===e.task_percent?n("Icon",{attrs:{type:"ios-checkmark"}}):n("span",{staticClass:"percent-text"},[t._v(t._s(e.task_percent)+"%")])],1)],1):t._e()])])}))],2),t._v(" "),n("div",{staticClass:"operate-position",style:t.operateStyles},[n("Dropdown",{attrs:{trigger:"custom",placement:t.windowLarge?"bottom":"top",visible:t.operateVisible,transfer:""},on:{"on-clickoutside":function(e){t.operateVisible=!1}}},[n("div",{style:{userSelect:t.operateVisible?"none":"auto",height:t.operateStyles.height}}),t._v(" "),n("DropdownMenu",{attrs:{slot:"list"},slot:"list"},[n("DropdownItem",{nativeOn:{click:function(e){return t.handleTopClick.apply(null,arguments)}}},[t._v("\n "+t._s(t.$L(t.operateItem.top_at?"取消置顶":"置顶该项目"))+"\n ")])],1)],1)],1)],1)}),[],!1,null,null,null).exports,ProjectDialog:J,ProjectPanel:Y},deactivated:function(){this.$store.dispatch("forgetTaskCompleteTemp",!0)},computed:ot(ot({},(0,r.rn)(["cacheProjects","wsOpenNum"])),{},{projectId:function(){var t=this.$route.params.projectId;return parseInt(/^\d+$/.test(t)?t:0)}}),watch:{projectId:{handler:function(){this.getProjectData()},immediate:!0},wsOpenNum:function(t){var e=this;t<=1||(this.wsOpenTimeout&&clearTimeout(this.wsOpenTimeout),this.wsOpenTimeout=setTimeout((function(){"manage-project"==e.$route.name&&e.getProjectData()}),5e3))}},methods:{getProjectData:function(){var t=this;if(!(this.projectId<=0)){var e=this.projectId;this.$nextTick((function(){t.$store.state.projectId=e,t.$store.dispatch("getProjectOne",e).then((function(){t.$store.dispatch("getColumns",e).catch((function(){})),t.$store.dispatch("getTaskForProject",e).catch((function(){}))})).catch((function(n){var r=n.msg;e===t.projectId&&$A.modalWarning({content:r,onOk:function(){var e=t.cacheProjects.find((function(t){return t.id}));e?$A.goForward({name:"manage-project",params:{projectId:e.id}}):$A.goForward({name:"manage-dashboard"})}})})),t.$store.dispatch("forgetTaskCompleteTemp",!0)}))}}}},st=at;const lt=(0,p.Z)(st,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"page-project"},[t.projectId>0?[n("ProjectPanel"),t._v(" "),n("ProjectDialog")]:t._e(),t._v(" "),t.windowSmall?n("ProjectList",{directives:[{name:"show",rawName:"v-show",value:0===t.projectId,expression:"projectId === 0"}]}):t._e()],2)}),[],!1,null,null,null).exports},85662:function(t,e,n){t.exports=function(t){"use strict";function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nthis.range.start)){var e=Math.max(t-this.param.buffer,0);this.checkRange(e,this.getEndByStart(e))}}},{key:"handleBehind",value:function(){var t=this.getScrollOvers();tt&&(o=n-1)}return e>0?--e:0}},{key:"getIndexOffset",value:function(t){if(!t)return 0;for(var e=0,n=0,r=0;r1&&void 0!==arguments[1]?arguments[1]:0;if(t>=this.dataSources.length-1)this.scrollToBottom();else{var n=this.virtual.getOffset(t);0!==e&&(n=Math.max(0,n+e)),this.scrollToOffset(n)}},scrollToBottom:function(){var t=this,e=this.$refs.shepherd;if(e){var n=e[this.isHorizontal?"offsetLeft":"offsetTop"];this.scrollToOffset(n),this.toBottomTime&&(clearTimeout(this.toBottomTime),this.toBottomTime=null),this.toBottomTime=setTimeout((function(){t.getOffset()+t.getClientSize()r+1||!r||(this.virtual.handleScroll(e),this.emitEvent(e,n,r,t))},emitEvent:function(t,e,n,r){this.$emit("scroll",r,this.virtual.getRange()),this.virtual.isFront()&&this.dataSources.length&&t-this.topThreshold<=0?this.$emit("totop"):this.virtual.isBehind()&&t+e+this.bottomThreshold>=n&&this.$emit("tobottom")},getRenderSlots:function(t){for(var e=[],n=this.range,r=n.start,o=n.end,i=this.dataSources,a=this.dataKey,s=this.itemClass,l=this.itemTag,u=this.itemStyle,c=this.isHorizontal,f=this.extraProps,d=this.dataComponent,h=this.itemScopedSlots,p=this.$scopedSlots&&this.$scopedSlots.item,m=r;m<=o;m++){var g=i[m];if(g){var v="function"==typeof a?a(g):g[a];"string"==typeof v||"number"==typeof v?e.push(t(w,{props:{index:m,tag:l,event:k.ITEM,horizontal:c,uniqueKey:v,source:g,extraProps:f,component:d,slotComponent:p,scopedSlots:h},style:u,class:"".concat(s).concat(this.itemClassAdd?" "+this.itemClassAdd(m):"")})):console.warn("Cannot get the data-key '".concat(a,"' from data-sources."))}else console.warn("Cannot get the index '".concat(m,"' from data-sources."))}return e}},render:function(t){var e=this.$slots,n=e.header,r=e.footer,o=this.range,i=o.padFront,a=o.padBehind,s=this.isHorizontal,l=this.pageMode,u=this.rootTag,c=this.wrapTag,f=this.wrapClass,d=this.wrapStyle,h=this.headerTag,p=this.headerClass,m=this.headerStyle,g=this.footerTag,v=this.footerClass,y=this.footerStyle,b={padding:s?"0px ".concat(a,"px 0px ").concat(i,"px"):"".concat(i,"px 0px ").concat(a,"px")},_=d?Object.assign({},d,b):b;return t(u,{ref:"root",on:{"&scroll":!l&&this.onScroll}},[n?t(C,{class:p,style:m,props:{tag:h,event:k.SLOT,uniqueKey:x.HEADER}},n):null,t(c,{class:f,attrs:{role:"group"},style:_},this.getRenderSlots(t)),r?t(C,{class:v,style:y,props:{tag:g,event:k.SLOT,uniqueKey:x.FOOTER}},r):null,t("div",{ref:"shepherd",style:{width:s?"0px":"100%",height:s?"100%":"0px"}})])}});return S}(n(70538))},9980:function(t,e,n){var r;"undefined"!=typeof self&&self,r=function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},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="fb15")}({"01f9":function(t,e,n){"use strict";var r=n("2d00"),o=n("5ca1"),i=n("2aba"),a=n("32e9"),s=n("84f2"),l=n("41a0"),u=n("7f20"),c=n("38fd"),f=n("2b4c")("iterator"),d=!([].keys&&"next"in[].keys()),h="keys",p="values",m=function(){return this};t.exports=function(t,e,n,g,v,y,b){l(n,e,g);var _,w,C,k=function(t){if(!d&&t in E)return E[t];switch(t){case h:case p:return function(){return new n(this,t)}}return function(){return new n(this,t)}},x=e+" Iterator",S=v==p,O=!1,E=t.prototype,T=E[f]||E["@@iterator"]||v&&E[v],A=T||k(v),D=v?S?k("entries"):A:void 0,N="Array"==e&&E.entries||T;if(N&&(C=c(N.call(new t)))!==Object.prototype&&C.next&&(u(C,x,!0),r||"function"==typeof C[f]||a(C,f,m)),S&&T&&T.name!==p&&(O=!0,A=function(){return T.call(this)}),r&&!b||!d&&!O&&E[f]||a(E,f,A),s[e]=A,s[x]=m,v)if(_={values:S?A:k(p),keys:y?A:k(h),entries:D},b)for(w in _)w in E||i(E,w,_[w]);else o(o.P+o.F*(d||O),e,_);return _}},"02f4":function(t,e,n){var r=n("4588"),o=n("be13");t.exports=function(t){return function(e,n){var i,a,s=String(o(e)),l=r(n),u=s.length;return l<0||l>=u?t?"":void 0:(i=s.charCodeAt(l))<55296||i>56319||l+1===u||(a=s.charCodeAt(l+1))<56320||a>57343?t?s.charAt(l):i:t?s.slice(l,l+2):a-56320+(i-55296<<10)+65536}}},"0390":function(t,e,n){"use strict";var r=n("02f4")(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},"0bfb":function(t,e,n){"use strict";var r=n("cb7c");t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},"0d58":function(t,e,n){var r=n("ce10"),o=n("e11e");t.exports=Object.keys||function(t){return r(t,o)}},1495:function(t,e,n){var r=n("86cc"),o=n("cb7c"),i=n("0d58");t.exports=n("9e1e")?Object.defineProperties:function(t,e){o(t);for(var n,a=i(e),s=a.length,l=0;s>l;)r.f(t,n=a[l++],e[n]);return t}},"214f":function(t,e,n){"use strict";n("b0c5");var r=n("2aba"),o=n("32e9"),i=n("79e5"),a=n("be13"),s=n("2b4c"),l=n("520a"),u=s("species"),c=!i((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")})),f=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();t.exports=function(t,e,n){var d=s(t),h=!i((function(){var e={};return e[d]=function(){return 7},7!=""[t](e)})),p=h?!i((function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[u]=function(){return n}),n[d](""),!e})):void 0;if(!h||!p||"replace"===t&&!c||"split"===t&&!f){var m=/./[d],g=n(a,d,""[t],(function(t,e,n,r,o){return e.exec===l?h&&!o?{done:!0,value:m.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}})),v=g[0],y=g[1];r(String.prototype,t,v),o(RegExp.prototype,d,2==e?function(t,e){return y.call(t,this,e)}:function(t){return y.call(t,this)})}}},"230e":function(t,e,n){var r=n("d3f4"),o=n("7726").document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},"23c6":function(t,e,n){var r=n("2d95"),o=n("2b4c")("toStringTag"),i="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?n:i?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},2621:function(t,e){e.f=Object.getOwnPropertySymbols},"2aba":function(t,e,n){var r=n("7726"),o=n("32e9"),i=n("69a8"),a=n("ca5a")("src"),s=n("fa5b"),l="toString",u=(""+s).split(l);n("8378").inspectSource=function(t){return s.call(t)},(t.exports=function(t,e,n,s){var l="function"==typeof n;l&&(i(n,"name")||o(n,"name",e)),t[e]!==n&&(l&&(i(n,a)||o(n,a,t[e]?""+t[e]:u.join(String(e)))),t===r?t[e]=n:s?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,l,(function(){return"function"==typeof this&&this[a]||s.call(this)}))},"2aeb":function(t,e,n){var r=n("cb7c"),o=n("1495"),i=n("e11e"),a=n("613b")("IE_PROTO"),s=function(){},l=function(){var t,e=n("230e")("iframe"),r=i.length;for(e.style.display="none",n("fab2").appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("